diff options
author | Bryan Wu <bryan.wu@canonical.com> | 2012-03-13 06:06:36 -0400 |
---|---|---|
committer | Bryan Wu <bryan.wu@canonical.com> | 2012-07-31 23:22:04 -0400 |
commit | e031cd513ec2ff661465dc1198220075719e72d1 (patch) | |
tree | f45ad6e54e220fed35e4c6c572a07b74cbe96740 /arch | |
parent | d61015fad9703990e4b0c826ed943b13794f19c8 (diff) |
ARM: mach-realview and mach-versatile: retire custom LED code
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-realview/core.c | 39 | ||||
-rw-r--r-- | arch/arm/mach-realview/core.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_eb.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_pb1176.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_pb11mp.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_pba8.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_pbx.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-versatile/core.c | 5 | ||||
-rw-r--r-- | arch/arm/plat-versatile/Kconfig | 4 | ||||
-rw-r--r-- | arch/arm/plat-versatile/leds.c | 8 |
10 files changed, 7 insertions, 76 deletions
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index 45868bb43cbd..d22dee96484d 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c | |||
@@ -35,7 +35,6 @@ | |||
35 | 35 | ||
36 | #include <mach/hardware.h> | 36 | #include <mach/hardware.h> |
37 | #include <asm/irq.h> | 37 | #include <asm/irq.h> |
38 | #include <asm/leds.h> | ||
39 | #include <asm/mach-types.h> | 38 | #include <asm/mach-types.h> |
40 | #include <asm/hardware/arm_timer.h> | 39 | #include <asm/hardware/arm_timer.h> |
41 | #include <asm/hardware/icst.h> | 40 | #include <asm/hardware/icst.h> |
@@ -436,44 +435,6 @@ struct clcd_board clcd_plat_data = { | |||
436 | .remove = versatile_clcd_remove_dma, | 435 | .remove = versatile_clcd_remove_dma, |
437 | }; | 436 | }; |
438 | 437 | ||
439 | #ifdef CONFIG_LEDS | ||
440 | #define VA_LEDS_BASE (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LED_OFFSET) | ||
441 | |||
442 | void realview_leds_event(led_event_t ledevt) | ||
443 | { | ||
444 | unsigned long flags; | ||
445 | u32 val; | ||
446 | u32 led = 1 << smp_processor_id(); | ||
447 | |||
448 | local_irq_save(flags); | ||
449 | val = readl(VA_LEDS_BASE); | ||
450 | |||
451 | switch (ledevt) { | ||
452 | case led_idle_start: | ||
453 | val = val & ~led; | ||
454 | break; | ||
455 | |||
456 | case led_idle_end: | ||
457 | val = val | led; | ||
458 | break; | ||
459 | |||
460 | case led_timer: | ||
461 | val = val ^ REALVIEW_SYS_LED7; | ||
462 | break; | ||
463 | |||
464 | case led_halted: | ||
465 | val = 0; | ||
466 | break; | ||
467 | |||
468 | default: | ||
469 | break; | ||
470 | } | ||
471 | |||
472 | writel(val, VA_LEDS_BASE); | ||
473 | local_irq_restore(flags); | ||
474 | } | ||
475 | #endif /* CONFIG_LEDS */ | ||
476 | |||
477 | /* | 438 | /* |
478 | * Where is the timer (VA)? | 439 | * Where is the timer (VA)? |
479 | */ | 440 | */ |
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h index f8f2c0ac4c01..f2141ae5a7de 100644 --- a/arch/arm/mach-realview/core.h +++ b/arch/arm/mach-realview/core.h | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/io.h> | 26 | #include <linux/io.h> |
27 | 27 | ||
28 | #include <asm/setup.h> | 28 | #include <asm/setup.h> |
29 | #include <asm/leds.h> | ||
30 | 29 | ||
31 | #define APB_DEVICE(name, busid, base, plat) \ | 30 | #define APB_DEVICE(name, busid, base, plat) \ |
32 | static AMBA_APB_DEVICE(name, busid, 0, REALVIEW_##base##_BASE, base##_IRQ, plat) | 31 | static AMBA_APB_DEVICE(name, busid, 0, REALVIEW_##base##_BASE, base##_IRQ, plat) |
@@ -47,7 +46,6 @@ extern void __iomem *timer1_va_base; | |||
47 | extern void __iomem *timer2_va_base; | 46 | extern void __iomem *timer2_va_base; |
48 | extern void __iomem *timer3_va_base; | 47 | extern void __iomem *timer3_va_base; |
49 | 48 | ||
50 | extern void realview_leds_event(led_event_t ledevt); | ||
51 | extern void realview_timer_init(unsigned int timer_irq); | 49 | extern void realview_timer_init(unsigned int timer_irq); |
52 | extern int realview_flash_register(struct resource *res, u32 num); | 50 | extern int realview_flash_register(struct resource *res, u32 num); |
53 | extern int realview_eth_register(const char *name, struct resource *res); | 51 | extern int realview_eth_register(const char *name, struct resource *res); |
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c index baf382c5e776..21661ade885f 100644 --- a/arch/arm/mach-realview/realview_eb.c +++ b/arch/arm/mach-realview/realview_eb.c | |||
@@ -30,7 +30,6 @@ | |||
30 | 30 | ||
31 | #include <mach/hardware.h> | 31 | #include <mach/hardware.h> |
32 | #include <asm/irq.h> | 32 | #include <asm/irq.h> |
33 | #include <asm/leds.h> | ||
34 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
35 | #include <asm/pmu.h> | 34 | #include <asm/pmu.h> |
36 | #include <asm/pgtable.h> | 35 | #include <asm/pgtable.h> |
@@ -462,10 +461,6 @@ static void __init realview_eb_init(void) | |||
462 | struct amba_device *d = amba_devs[i]; | 461 | struct amba_device *d = amba_devs[i]; |
463 | amba_device_register(d, &iomem_resource); | 462 | amba_device_register(d, &iomem_resource); |
464 | } | 463 | } |
465 | |||
466 | #ifdef CONFIG_LEDS | ||
467 | leds_event = realview_leds_event; | ||
468 | #endif | ||
469 | } | 464 | } |
470 | 465 | ||
471 | MACHINE_START(REALVIEW_EB, "ARM-RealView EB") | 466 | MACHINE_START(REALVIEW_EB, "ARM-RealView EB") |
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c index b1d7cafa1a6d..c0ff882c5cb8 100644 --- a/arch/arm/mach-realview/realview_pb1176.c +++ b/arch/arm/mach-realview/realview_pb1176.c | |||
@@ -32,7 +32,6 @@ | |||
32 | 32 | ||
33 | #include <mach/hardware.h> | 33 | #include <mach/hardware.h> |
34 | #include <asm/irq.h> | 34 | #include <asm/irq.h> |
35 | #include <asm/leds.h> | ||
36 | #include <asm/mach-types.h> | 35 | #include <asm/mach-types.h> |
37 | #include <asm/pmu.h> | 36 | #include <asm/pmu.h> |
38 | #include <asm/pgtable.h> | 37 | #include <asm/pgtable.h> |
@@ -375,10 +374,6 @@ static void __init realview_pb1176_init(void) | |||
375 | struct amba_device *d = amba_devs[i]; | 374 | struct amba_device *d = amba_devs[i]; |
376 | amba_device_register(d, &iomem_resource); | 375 | amba_device_register(d, &iomem_resource); |
377 | } | 376 | } |
378 | |||
379 | #ifdef CONFIG_LEDS | ||
380 | leds_event = realview_leds_event; | ||
381 | #endif | ||
382 | } | 377 | } |
383 | 378 | ||
384 | MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176") | 379 | MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176") |
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c index a98c536e3327..30779ae40c04 100644 --- a/arch/arm/mach-realview/realview_pb11mp.c +++ b/arch/arm/mach-realview/realview_pb11mp.c | |||
@@ -30,7 +30,6 @@ | |||
30 | 30 | ||
31 | #include <mach/hardware.h> | 31 | #include <mach/hardware.h> |
32 | #include <asm/irq.h> | 32 | #include <asm/irq.h> |
33 | #include <asm/leds.h> | ||
34 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
35 | #include <asm/pmu.h> | 34 | #include <asm/pmu.h> |
36 | #include <asm/pgtable.h> | 35 | #include <asm/pgtable.h> |
@@ -357,10 +356,6 @@ static void __init realview_pb11mp_init(void) | |||
357 | struct amba_device *d = amba_devs[i]; | 356 | struct amba_device *d = amba_devs[i]; |
358 | amba_device_register(d, &iomem_resource); | 357 | amba_device_register(d, &iomem_resource); |
359 | } | 358 | } |
360 | |||
361 | #ifdef CONFIG_LEDS | ||
362 | leds_event = realview_leds_event; | ||
363 | #endif | ||
364 | } | 359 | } |
365 | 360 | ||
366 | MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore") | 361 | MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore") |
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c index 59650174e6ed..081cd72c090e 100644 --- a/arch/arm/mach-realview/realview_pba8.c +++ b/arch/arm/mach-realview/realview_pba8.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/io.h> | 29 | #include <linux/io.h> |
30 | 30 | ||
31 | #include <asm/irq.h> | 31 | #include <asm/irq.h> |
32 | #include <asm/leds.h> | ||
33 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
34 | #include <asm/pmu.h> | 33 | #include <asm/pmu.h> |
35 | #include <asm/pgtable.h> | 34 | #include <asm/pgtable.h> |
@@ -299,10 +298,6 @@ static void __init realview_pba8_init(void) | |||
299 | struct amba_device *d = amba_devs[i]; | 298 | struct amba_device *d = amba_devs[i]; |
300 | amba_device_register(d, &iomem_resource); | 299 | amba_device_register(d, &iomem_resource); |
301 | } | 300 | } |
302 | |||
303 | #ifdef CONFIG_LEDS | ||
304 | leds_event = realview_leds_event; | ||
305 | #endif | ||
306 | } | 301 | } |
307 | 302 | ||
308 | MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8") | 303 | MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8") |
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c index 3f2f605624e9..1ce62b9f846c 100644 --- a/arch/arm/mach-realview/realview_pbx.c +++ b/arch/arm/mach-realview/realview_pbx.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <linux/io.h> | 28 | #include <linux/io.h> |
29 | 29 | ||
30 | #include <asm/irq.h> | 30 | #include <asm/irq.h> |
31 | #include <asm/leds.h> | ||
32 | #include <asm/mach-types.h> | 31 | #include <asm/mach-types.h> |
33 | #include <asm/pmu.h> | 32 | #include <asm/pmu.h> |
34 | #include <asm/smp_twd.h> | 33 | #include <asm/smp_twd.h> |
@@ -394,10 +393,6 @@ static void __init realview_pbx_init(void) | |||
394 | struct amba_device *d = amba_devs[i]; | 393 | struct amba_device *d = amba_devs[i]; |
395 | amba_device_register(d, &iomem_resource); | 394 | amba_device_register(d, &iomem_resource); |
396 | } | 395 | } |
397 | |||
398 | #ifdef CONFIG_LEDS | ||
399 | leds_event = realview_leds_event; | ||
400 | #endif | ||
401 | } | 396 | } |
402 | 397 | ||
403 | MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX") | 398 | MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX") |
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c index cd8ea3588f93..855ca02581e8 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <linux/mtd/physmap.h> | 37 | #include <linux/mtd/physmap.h> |
38 | 38 | ||
39 | #include <asm/irq.h> | 39 | #include <asm/irq.h> |
40 | #include <asm/leds.h> | ||
41 | #include <asm/hardware/arm_timer.h> | 40 | #include <asm/hardware/arm_timer.h> |
42 | #include <asm/hardware/icst.h> | 41 | #include <asm/hardware/icst.h> |
43 | #include <asm/hardware/vic.h> | 42 | #include <asm/hardware/vic.h> |
@@ -763,10 +762,6 @@ void __init versatile_init(void) | |||
763 | struct amba_device *d = amba_devs[i]; | 762 | struct amba_device *d = amba_devs[i]; |
764 | amba_device_register(d, &iomem_resource); | 763 | amba_device_register(d, &iomem_resource); |
765 | } | 764 | } |
766 | |||
767 | #ifdef CONFIG_LEDS | ||
768 | leds_event = versatile_leds_event; | ||
769 | #endif | ||
770 | } | 765 | } |
771 | 766 | ||
772 | /* | 767 | /* |
diff --git a/arch/arm/plat-versatile/Kconfig b/arch/arm/plat-versatile/Kconfig index 81ee7cc34457..5c73e31c1e14 100644 --- a/arch/arm/plat-versatile/Kconfig +++ b/arch/arm/plat-versatile/Kconfig | |||
@@ -13,8 +13,10 @@ config PLAT_VERSATILE_FPGA_IRQ_NR | |||
13 | depends on PLAT_VERSATILE_FPGA_IRQ | 13 | depends on PLAT_VERSATILE_FPGA_IRQ |
14 | 14 | ||
15 | config PLAT_VERSATILE_LEDS | 15 | config PLAT_VERSATILE_LEDS |
16 | def_bool y if LEDS_CLASS | 16 | def_bool y if NEW_LEDS |
17 | depends on ARCH_REALVIEW || ARCH_VERSATILE | 17 | depends on ARCH_REALVIEW || ARCH_VERSATILE |
18 | select LEDS_CLASS | ||
19 | select LEDS_TRIGGER | ||
18 | 20 | ||
19 | config PLAT_VERSATILE_SCHED_CLOCK | 21 | config PLAT_VERSATILE_SCHED_CLOCK |
20 | def_bool y | 22 | def_bool y |
diff --git a/arch/arm/plat-versatile/leds.c b/arch/arm/plat-versatile/leds.c index 3169fa555ea6..d2490d00b46c 100644 --- a/arch/arm/plat-versatile/leds.c +++ b/arch/arm/plat-versatile/leds.c | |||
@@ -37,10 +37,10 @@ static const struct { | |||
37 | } versatile_leds[] = { | 37 | } versatile_leds[] = { |
38 | { "versatile:0", "heartbeat", }, | 38 | { "versatile:0", "heartbeat", }, |
39 | { "versatile:1", "mmc0", }, | 39 | { "versatile:1", "mmc0", }, |
40 | { "versatile:2", }, | 40 | { "versatile:2", "cpu0" }, |
41 | { "versatile:3", }, | 41 | { "versatile:3", "cpu1" }, |
42 | { "versatile:4", }, | 42 | { "versatile:4", "cpu2" }, |
43 | { "versatile:5", }, | 43 | { "versatile:5", "cpu3" }, |
44 | { "versatile:6", }, | 44 | { "versatile:6", }, |
45 | { "versatile:7", }, | 45 | { "versatile:7", }, |
46 | }; | 46 | }; |