This patch set convert PMU driver to ACPI for ARMv8 arch. Despite driver is initialized in early boot stage, no ACPI related actions are taken then. All PMU resources coming from ACPI tables are use by others units once bus is enumerated.
Changes for v2: - remove MODULE_DEVICE_TABLE macro since perf_event is not kernel module
Tomasz Nowicki (3): ACPI, ARMv8: Whitelist armv8-pmu driver for ACPI. armv8, dts: Move device resources to DSTD ACPI table. armv8, pmu: Add the match table and pointers for ACPI probing to the driver.
arch/arm64/boot/dts/foundation-v8-acpi.dts | 4 ++++ arch/arm64/boot/dts/rtsm_ve-aemv8a-acpi.dts | 4 ++++ arch/arm64/kernel/perf_event.c | 13 +++++++++++++ drivers/acpi/acpi_platform.c | 1 + 4 files changed, 22 insertions(+)
Signed-off-by: Tomasz Nowicki tomasz.nowicki@linaro.org --- drivers/acpi/acpi_platform.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c index c5eed01..f34d135 100644 --- a/drivers/acpi/acpi_platform.c +++ b/drivers/acpi/acpi_platform.c @@ -33,6 +33,7 @@ static const struct acpi_device_id acpi_platform_device_ids[] = { /* arm64 platform devices */ { "LINA0003" }, { "LINA0005" }, + { "LINA0007" },
{ } };
Signed-off-by: Tomasz Nowicki tomasz.nowicki@linaro.org --- arch/arm64/boot/dts/foundation-v8-acpi.dts | 4 ++++ arch/arm64/boot/dts/rtsm_ve-aemv8a-acpi.dts | 4 ++++ 2 files changed, 8 insertions(+)
diff --git a/arch/arm64/boot/dts/foundation-v8-acpi.dts b/arch/arm64/boot/dts/foundation-v8-acpi.dts index 78ca197..b955c89 100644 --- a/arch/arm64/boot/dts/foundation-v8-acpi.dts +++ b/arch/arm64/boot/dts/foundation-v8-acpi.dts @@ -83,6 +83,9 @@ clock-frequency = <100000000>; };
+ /* + * Removed for ACPI + * pmu { compatible = "arm,armv8-pmuv3"; interrupts = <0 60 4>, @@ -90,6 +93,7 @@ <0 62 4>, <0 63 4>; }; + */
smb { compatible = "arm,vexpress,v2m-p1", "simple-bus"; diff --git a/arch/arm64/boot/dts/rtsm_ve-aemv8a-acpi.dts b/arch/arm64/boot/dts/rtsm_ve-aemv8a-acpi.dts index 27bb501..208053e 100644 --- a/arch/arm64/boot/dts/rtsm_ve-aemv8a-acpi.dts +++ b/arch/arm64/boot/dts/rtsm_ve-aemv8a-acpi.dts @@ -88,6 +88,9 @@ clock-frequency = <100000000>; };
+ /* + * Removed for ACPI + * pmu { compatible = "arm,armv8-pmuv3"; interrupts = <0 60 4>, @@ -95,6 +98,7 @@ <0 62 4>, <0 63 4>; }; + */
smb { compatible = "simple-bus";
Signed-off-by: Tomasz Nowicki tomasz.nowicki@linaro.org --- arch/arm64/kernel/perf_event.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index 9ba33c4..c70a187 100644 --- a/arch/arm64/kernel/perf_event.c +++ b/arch/arm64/kernel/perf_event.c @@ -28,6 +28,9 @@ #include <linux/platform_device.h> #include <linux/spinlock.h> #include <linux/uaccess.h> +#ifdef CONFIG_ACPI +#include <linux/acpi.h> +#endif
#include <asm/cputype.h> #include <asm/irq.h> @@ -1221,6 +1224,13 @@ static struct of_device_id armpmu_of_device_ids[] = { {}, };
+#ifdef CONFIG_ACPI +static const struct acpi_device_id armpmu_acpi_match[] = { + { "LINA0007", }, + {}, +}; +#endif + static int armpmu_device_probe(struct platform_device *pdev) { if (!cpu_pmu) @@ -1234,6 +1244,9 @@ static struct platform_driver armpmu_driver = { .driver = { .name = "arm-pmu", .of_match_table = armpmu_of_device_ids, +#ifdef CONFIG_ACPI + .acpi_match_table = ACPI_PTR(armpmu_acpi_match), +#endif }, .probe = armpmu_device_probe, };
On 23 September 2013 17:33, Tomasz Nowicki tomasz.nowicki@linaro.orgwrote:
This patch set convert PMU driver to ACPI for ARMv8 arch. Despite driver is initialized in early boot stage, no ACPI related actions are taken then. All PMU resources coming from ACPI tables are use by others units once bus is enumerated.
Changes for v2: - remove MODULE_DEVICE_TABLE macro since perf_event is not kernel module
All 3 patches, Acked-by: Hanjun Guo hanjun.guo@linaro.org
Tomasz Nowicki (3): ACPI, ARMv8: Whitelist armv8-pmu driver for ACPI. armv8, dts: Move device resources to DSTD ACPI table. armv8, pmu: Add the match table and pointers for ACPI probing to the driver.
arch/arm64/boot/dts/foundation-v8-acpi.dts | 4 ++++ arch/arm64/boot/dts/rtsm_ve-aemv8a-acpi.dts | 4 ++++ arch/arm64/kernel/perf_event.c | 13 +++++++++++++ drivers/acpi/acpi_platform.c | 1 + 4 files changed, 22 insertions(+)
-- 1.7.9.5
Linaro-acpi mailing list Linaro-acpi@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-acpi