ARM: mach-realview and mach-versatile: retire custom LED code
authorBryan Wu <bryan.wu@canonical.com>
Tue, 13 Mar 2012 10:06:36 +0000 (18:06 +0800)
committerBryan Wu <bryan.wu@canonical.com>
Wed, 1 Aug 2012 03:22:04 +0000 (11:22 +0800)
This replaces the custom LED trigger code in mach-realview with
some overarching platform code for the plat-versatile family that
will lock down LEDs 2 thru 5 for CPU activity indication. The
day we have 8 core ARM systems the plat-versatile code will have
to become more elaborate.

Tested on RealView PB11MPCore by invoking four different CPU
hogs (yes > /dev/null&) and see the LEDs go on one at a time.
They all go off as the hogs are killed. Tested on the PB1176
as well - just one activity led (led 2) goes on and off with
CPU activity.

(bryan.wu@canonical.com: use ledtrig-cpu instead of ledtrig-arm-cpu)

Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Acked-by: Pawel Moll <pawel.moll@arm.com>
arch/arm/mach-realview/core.c
arch/arm/mach-realview/core.h
arch/arm/mach-realview/realview_eb.c
arch/arm/mach-realview/realview_pb1176.c
arch/arm/mach-realview/realview_pb11mp.c
arch/arm/mach-realview/realview_pba8.c
arch/arm/mach-realview/realview_pbx.c
arch/arm/mach-versatile/core.c
arch/arm/plat-versatile/Kconfig
arch/arm/plat-versatile/leds.c

index 45868bb43cbd2fbcbfcdfff638dc15f1cbd7d38b..d22dee96484dfc18c758d8cf245689962f1a39ed 100644 (file)
@@ -35,7 +35,6 @@
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
-#include <asm/leds.h>
 #include <asm/mach-types.h>
 #include <asm/hardware/arm_timer.h>
 #include <asm/hardware/icst.h>
@@ -436,44 +435,6 @@ struct clcd_board clcd_plat_data = {
        .remove         = versatile_clcd_remove_dma,
 };
 
-#ifdef CONFIG_LEDS
-#define VA_LEDS_BASE (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LED_OFFSET)
-
-void realview_leds_event(led_event_t ledevt)
-{
-       unsigned long flags;
-       u32 val;
-       u32 led = 1 << smp_processor_id();
-
-       local_irq_save(flags);
-       val = readl(VA_LEDS_BASE);
-
-       switch (ledevt) {
-       case led_idle_start:
-               val = val & ~led;
-               break;
-
-       case led_idle_end:
-               val = val | led;
-               break;
-
-       case led_timer:
-               val = val ^ REALVIEW_SYS_LED7;
-               break;
-
-       case led_halted:
-               val = 0;
-               break;
-
-       default:
-               break;
-       }
-
-       writel(val, VA_LEDS_BASE);
-       local_irq_restore(flags);
-}
-#endif /* CONFIG_LEDS */
-
 /*
  * Where is the timer (VA)?
  */
index f8f2c0ac4c01531d495b62817cfc01af202f7b8e..f2141ae5a7deb910322807b607baa4df66de67e8 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/io.h>
 
 #include <asm/setup.h>
-#include <asm/leds.h>
 
 #define APB_DEVICE(name, busid, base, plat)                    \
 static AMBA_APB_DEVICE(name, busid, 0, REALVIEW_##base##_BASE, base##_IRQ, plat)
@@ -47,7 +46,6 @@ extern void __iomem *timer1_va_base;
 extern void __iomem *timer2_va_base;
 extern void __iomem *timer3_va_base;
 
-extern void realview_leds_event(led_event_t ledevt);
 extern void realview_timer_init(unsigned int timer_irq);
 extern int realview_flash_register(struct resource *res, u32 num);
 extern int realview_eth_register(const char *name, struct resource *res);
index baf382c5e77601957b2ef8982ccdd61552f9b2f2..21661ade885ffd7f29c4d7d223332777cf275ce6 100644 (file)
@@ -30,7 +30,6 @@
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
-#include <asm/leds.h>
 #include <asm/mach-types.h>
 #include <asm/pmu.h>
 #include <asm/pgtable.h>
@@ -462,10 +461,6 @@ static void __init realview_eb_init(void)
                struct amba_device *d = amba_devs[i];
                amba_device_register(d, &iomem_resource);
        }
-
-#ifdef CONFIG_LEDS
-       leds_event = realview_leds_event;
-#endif
 }
 
 MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
index b1d7cafa1a6d2e295c2f95529b1d556df4b85db1..c0ff882c5cb865bb31ef3e07c5c498f0c9de11f7 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
-#include <asm/leds.h>
 #include <asm/mach-types.h>
 #include <asm/pmu.h>
 #include <asm/pgtable.h>
@@ -375,10 +374,6 @@ static void __init realview_pb1176_init(void)
                struct amba_device *d = amba_devs[i];
                amba_device_register(d, &iomem_resource);
        }
-
-#ifdef CONFIG_LEDS
-       leds_event = realview_leds_event;
-#endif
 }
 
 MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176")
index a98c536e3327afa9823a2b29ffd081258be2ae5a..30779ae40c046a85cdb7456918f02812cc2bc451 100644 (file)
@@ -30,7 +30,6 @@
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
-#include <asm/leds.h>
 #include <asm/mach-types.h>
 #include <asm/pmu.h>
 #include <asm/pgtable.h>
@@ -357,10 +356,6 @@ static void __init realview_pb11mp_init(void)
                struct amba_device *d = amba_devs[i];
                amba_device_register(d, &iomem_resource);
        }
-
-#ifdef CONFIG_LEDS
-       leds_event = realview_leds_event;
-#endif
 }
 
 MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")
index 59650174e6ed39e9c3bc9e44441beb48b22a4214..081cd72c090e01ad41a106f86267958bbb3a7505 100644 (file)
@@ -29,7 +29,6 @@
 #include <linux/io.h>
 
 #include <asm/irq.h>
-#include <asm/leds.h>
 #include <asm/mach-types.h>
 #include <asm/pmu.h>
 #include <asm/pgtable.h>
@@ -299,10 +298,6 @@ static void __init realview_pba8_init(void)
                struct amba_device *d = amba_devs[i];
                amba_device_register(d, &iomem_resource);
        }
-
-#ifdef CONFIG_LEDS
-       leds_event = realview_leds_event;
-#endif
 }
 
 MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8")
index 3f2f605624e95270fd1039e64a3a0a2d2180cd06..1ce62b9f846c2a1b306124b422c4fd9bd73b209a 100644 (file)
@@ -28,7 +28,6 @@
 #include <linux/io.h>
 
 #include <asm/irq.h>
-#include <asm/leds.h>
 #include <asm/mach-types.h>
 #include <asm/pmu.h>
 #include <asm/smp_twd.h>
@@ -394,10 +393,6 @@ static void __init realview_pbx_init(void)
                struct amba_device *d = amba_devs[i];
                amba_device_register(d, &iomem_resource);
        }
-
-#ifdef CONFIG_LEDS
-       leds_event = realview_leds_event;
-#endif
 }
 
 MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX")
index cd8ea3588f93d3db2b557def5d0e844cf101b380..855ca02581e8fb062e0a43ab2225ad0edb434d7a 100644 (file)
@@ -37,7 +37,6 @@
 #include <linux/mtd/physmap.h>
 
 #include <asm/irq.h>
-#include <asm/leds.h>
 #include <asm/hardware/arm_timer.h>
 #include <asm/hardware/icst.h>
 #include <asm/hardware/vic.h>
@@ -763,10 +762,6 @@ void __init versatile_init(void)
                struct amba_device *d = amba_devs[i];
                amba_device_register(d, &iomem_resource);
        }
-
-#ifdef CONFIG_LEDS
-       leds_event = versatile_leds_event;
-#endif
 }
 
 /*
index 81ee7cc344575956a698ad929fe70ca8df1cee33..5c73e31c1e14cf57f7754a674d5758c3b1a75e13 100644 (file)
@@ -13,8 +13,10 @@ config PLAT_VERSATILE_FPGA_IRQ_NR
        depends on PLAT_VERSATILE_FPGA_IRQ
 
 config PLAT_VERSATILE_LEDS
-       def_bool y if LEDS_CLASS
+       def_bool y if NEW_LEDS
        depends on ARCH_REALVIEW || ARCH_VERSATILE
+       select LEDS_CLASS
+       select LEDS_TRIGGER
 
 config PLAT_VERSATILE_SCHED_CLOCK
        def_bool y
index 3169fa555ea689acc1875c6bbacba2d6f3319ad0..d2490d00b46cd4e2e6c17a685eda16942ee930d6 100644 (file)
@@ -37,10 +37,10 @@ static const struct {
 } versatile_leds[] = {
        { "versatile:0", "heartbeat", },
        { "versatile:1", "mmc0", },
-       { "versatile:2", },
-       { "versatile:3", },
-       { "versatile:4", },
-       { "versatile:5", },
+       { "versatile:2", "cpu0" },
+       { "versatile:3", "cpu1" },
+       { "versatile:4", "cpu2" },
+       { "versatile:5", "cpu3" },
        { "versatile:6", },
        { "versatile:7", },
 };