summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiarhei Siamashka <siarhei.siamashka@gmail.com>2013-01-12 07:47:11 +0400
committerAlejandro Mery <amery@geeks.cl>2013-01-24 20:28:53 +0400
commitfcce981f3089efb7fd5213f4e81cba374392ef52 (patch)
treeb01d8c9d1f74fdad0bbf5ddc30ce8539f48224fa
parentb1f1a4e6d776d8db1d16cdb136822cd7485e5d69 (diff)
downloadlinux-sunxi-fcce981f3089efb7fd5213f4e81cba374392ef52.tar.xz
mach-sunxi: configure IRQ for ARM Cortex-A8 performance monitoring unit
This allows the use of performance monitoring unit for statistical sampling based profiling (oprofile, perf). The downside is that the performance unit in Cortex-A8 is affected by erratum 628216, which causes it to miss interrupts in some cases and disrupt profiling results. Some information in public access about this erratum can be found here: http://www.freescale.com/files/32bit/doc/errata/IMX53CE.pdf As a result, it may be preferable to keep using the standard timer for general purpose profiling instead of the PMU cycle counter. But some of the other performance events may be still useful in practice (cache misses, ...). Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
-rw-r--r--arch/arm/mach-sun4i/devices.c17
-rwxr-xr-xarch/arm/mach-sun5i/devices.c17
2 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/mach-sun4i/devices.c b/arch/arm/mach-sun4i/devices.c
index a6dfc8890263..94090b4d8075 100644
--- a/arch/arm/mach-sun4i/devices.c
+++ b/arch/arm/mach-sun4i/devices.c
@@ -36,6 +36,7 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/setup.h>
+#include <asm/pmu.h>
#include <mach/hardware.h>
#include <mach/i2c.h>
#include <mach/ramconsole.h>
@@ -174,6 +175,21 @@ struct platform_device sun4i_twi2_device = {
},
};
+static struct resource sun4i_pmu_resources[] = {
+ {
+ .start = SW_INT_IRQNO_PLE_PFM,
+ .end = SW_INT_IRQNO_PLE_PFM,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+struct platform_device sun4i_pmu_device = {
+ .name = "arm-pmu",
+ .id = ARM_PMU_DEVICE_CPU,
+ .resource = sun4i_pmu_resources,
+ .num_resources = ARRAY_SIZE(sun4i_pmu_resources),
+};
+
#if defined(CONFIG_MALI_DRM) || defined(CONFIG_MALI_DRM_MODULE)
static struct platform_device sun4i_device_mali_drm = {
.name = "mali_drm",
@@ -212,6 +228,7 @@ static struct platform_device *sw_pdevs[] __initdata = {
&sun4i_twi0_device,
&sun4i_twi1_device,
&sun4i_twi2_device,
+ &sun4i_pmu_device,
#if defined(CONFIG_MALI_DRM) || defined(CONFIG_MALI_DRM_MODULE)
&sun4i_device_mali_drm,
#endif
diff --git a/arch/arm/mach-sun5i/devices.c b/arch/arm/mach-sun5i/devices.c
index 6c0d69be2c3c..9ce055876218 100755
--- a/arch/arm/mach-sun5i/devices.c
+++ b/arch/arm/mach-sun5i/devices.c
@@ -39,6 +39,7 @@
#include <asm/mach/time.h>
#include <asm/setup.h>
#include <mach/io.h>
+#include <asm/pmu.h>
#include <mach/hardware.h>
#include <mach/i2c.h>
@@ -175,6 +176,21 @@ struct platform_device sun5i_twi2_device = {
},
};
+static struct resource sun5i_pmu_resources[] = {
+ {
+ .start = SW_INT_IRQNO_PLE_PFM,
+ .end = SW_INT_IRQNO_PLE_PFM,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+struct platform_device sun5i_pmu_device = {
+ .name = "arm-pmu",
+ .id = ARM_PMU_DEVICE_CPU,
+ .resource = sun5i_pmu_resources,
+ .num_resources = ARRAY_SIZE(sun5i_pmu_resources),
+};
+
static struct platform_device *sw_pdevs[] __initdata = {
&debug_uart,
&sw_pdev_dmac,
@@ -182,6 +198,7 @@ static struct platform_device *sw_pdevs[] __initdata = {
&sun5i_twi0_device,
&sun5i_twi1_device,
&sun5i_twi2_device,
+ &sun5i_pmu_device,
};
void __init sw_pdev_init(void)