Merge branch 'bkl/procfs' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic...
[linux-2.6-block.git] / arch / arm / mach-realview / realview_pbx.c
index a21a4b395f733ad44a07ceae7371104375f2d2cd..a235ba30996ba42341c9c2d28e724d67f34e54af 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/irq.h>
 #include <asm/leds.h>
 #include <asm/mach-types.h>
+#include <asm/pmu.h>
 #include <asm/smp_twd.h>
 #include <asm/hardware/gic.h>
 #include <asm/hardware/cache-l2x0.h>
@@ -270,6 +271,36 @@ static struct resource realview_pbx_isp1761_resources[] = {
        },
 };
 
+static struct resource pmu_resources[] = {
+       [0] = {
+               .start          = IRQ_PBX_PMU_CPU0,
+               .end            = IRQ_PBX_PMU_CPU0,
+               .flags          = IORESOURCE_IRQ,
+       },
+       [1] = {
+               .start          = IRQ_PBX_PMU_CPU1,
+               .end            = IRQ_PBX_PMU_CPU1,
+               .flags          = IORESOURCE_IRQ,
+       },
+       [2] = {
+               .start          = IRQ_PBX_PMU_CPU2,
+               .end            = IRQ_PBX_PMU_CPU2,
+               .flags          = IORESOURCE_IRQ,
+       },
+       [3] = {
+               .start          = IRQ_PBX_PMU_CPU3,
+               .end            = IRQ_PBX_PMU_CPU3,
+               .flags          = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device pmu_device = {
+       .name                   = "arm-pmu",
+       .id                     = ARM_PMU_DEVICE_CPU,
+       .num_resources          = ARRAY_SIZE(pmu_resources),
+       .resource               = pmu_resources,
+};
+
 static void __init gic_init_irq(void)
 {
        /* ARM PBX on-board GIC */
@@ -334,8 +365,8 @@ static void realview_pbx_reset(char mode)
         * in the system FPGA
         */
        __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl);
-       __raw_writel(0x0000, reset_ctrl);
-       __raw_writel(0x0004, reset_ctrl);
+       __raw_writel(0x00F0, reset_ctrl);
+       __raw_writel(0x00F4, reset_ctrl);
 }
 
 static void __init realview_pbx_init(void)
@@ -354,6 +385,7 @@ static void __init realview_pbx_init(void)
                /* 16KB way size, 8-way associativity, parity disabled
                 * Bits:  .. 0 0 0 0 1 00 1 0 1 001 0 000 0 .... .... .... */
                l2x0_init(l2x0_base, 0x02520000, 0xc0000fff);
+               platform_device_register(&pmu_device);
        }
 #endif