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.
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 | 14 ++++++++++++++ drivers/acpi/acpi_platform.c | 1 + 4 files changed, 23 insertions(+)
--- 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" },
{ } };
--- 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 aa68353..7f348eb 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";
--- arch/arm64/kernel/perf_event.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index 9ba33c4..99b00d8 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,14 @@ static struct of_device_id armpmu_of_device_ids[] = { {}, };
+#ifdef CONFIG_ACPI +static const struct acpi_device_id armpmu_acpi_match[] = { + { "LINA0007", }, + {}, +}; +MODULE_DEVICE_TABLE(acpi, armpmu_acpi_match); +#endif + static int armpmu_device_probe(struct platform_device *pdev) { if (!cpu_pmu) @@ -1234,6 +1245,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, };
Hi Tomasz:
On 2013-9-18 16:36, Tomasz Nowicki wrote:
arch/arm64/kernel/perf_event.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index 9ba33c4..99b00d8 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,14 @@ static struct of_device_id armpmu_of_device_ids[] = { {}, }; +#ifdef CONFIG_ACPI +static const struct acpi_device_id armpmu_acpi_match[] = {
- { "LINA0007", },
- {},
+}; +MODULE_DEVICE_TABLE(acpi, armpmu_acpi_match);
perf_event for ARM64 is not a kernel module, so I think +MODULE_DEVICE_TABLE(acpi, armpmu_acpi_match); is not needed here.
I think you had met the compile warning, something like: warning: data definition has no type or storage class [enabled by default] warning: type defaults to ‘int’ in declaration of ‘MODULE_DEVICE_TABLE’ [-Wimplicit-int] warning: parameter names (without types) in function declaration [enabled by default]
Thanks Hanjun
W dniu 22.09.2013 05:45, Hanjun Guo pisze:
Hi Tomasz:
On 2013-9-18 16:36, Tomasz Nowicki wrote:
arch/arm64/kernel/perf_event.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index 9ba33c4..99b00d8 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,14 @@ static struct of_device_id armpmu_of_device_ids[] = { {}, };
+#ifdef CONFIG_ACPI +static const struct acpi_device_id armpmu_acpi_match[] = {
- { "LINA0007", },
- {},
+}; +MODULE_DEVICE_TABLE(acpi, armpmu_acpi_match);
perf_event for ARM64 is not a kernel module, so I think +MODULE_DEVICE_TABLE(acpi, armpmu_acpi_match); is not needed here.
Definitely not needed here... Will fix it in next ver.
Tomasz
I think you had met the compile warning, something like: warning: data definition has no type or storage class [enabled by default] warning: type defaults to ‘int’ in declaration of ‘MODULE_DEVICE_TABLE’ [-Wimplicit-int] warning: parameter names (without types) in function declaration [enabled by default]
Thanks Hanjun
Linaro-acpi mailing list Linaro-acpi@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-acpi