Skip to content

Commit e031cd5

Browse files
author
Bryan Wu
committed
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>
1 parent d61015f commit e031cd5

10 files changed

Lines changed: 7 additions & 76 deletions

File tree

‎arch/arm/mach-realview/core.c‎

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535

3636
#include <mach/hardware.h>
3737
#include <asm/irq.h>
38-
#include <asm/leds.h>
3938
#include <asm/mach-types.h>
4039
#include <asm/hardware/arm_timer.h>
4140
#include <asm/hardware/icst.h>
@@ -436,44 +435,6 @@ struct clcd_board clcd_plat_data = {
436435
.remove = versatile_clcd_remove_dma,
437436
};
438437

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-
477438
/*
478439
* Where is the timer (VA)?
479440
*/

‎arch/arm/mach-realview/core.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <linux/io.h>
2727

2828
#include <asm/setup.h>
29-
#include <asm/leds.h>
3029

3130
#define APB_DEVICE(name, busid, base, plat) \
3231
static AMBA_APB_DEVICE(name, busid, 0, REALVIEW_##base##_BASE, base##_IRQ, plat)
@@ -47,7 +46,6 @@ extern void __iomem *timer1_va_base;
4746
extern void __iomem *timer2_va_base;
4847
extern void __iomem *timer3_va_base;
4948

50-
extern void realview_leds_event(led_event_t ledevt);
5149
extern void realview_timer_init(unsigned int timer_irq);
5250
extern int realview_flash_register(struct resource *res, u32 num);
5351
extern int realview_eth_register(const char *name, struct resource *res);

‎arch/arm/mach-realview/realview_eb.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
#include <mach/hardware.h>
3232
#include <asm/irq.h>
33-
#include <asm/leds.h>
3433
#include <asm/mach-types.h>
3534
#include <asm/pmu.h>
3635
#include <asm/pgtable.h>
@@ -462,10 +461,6 @@ static void __init realview_eb_init(void)
462461
struct amba_device *d = amba_devs[i];
463462
amba_device_register(d, &iomem_resource);
464463
}
465-
466-
#ifdef CONFIG_LEDS
467-
leds_event = realview_leds_event;
468-
#endif
469464
}
470465

471466
MACHINE_START(REALVIEW_EB, "ARM-RealView EB")

‎arch/arm/mach-realview/realview_pb1176.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
#include <mach/hardware.h>
3434
#include <asm/irq.h>
35-
#include <asm/leds.h>
3635
#include <asm/mach-types.h>
3736
#include <asm/pmu.h>
3837
#include <asm/pgtable.h>
@@ -375,10 +374,6 @@ static void __init realview_pb1176_init(void)
375374
struct amba_device *d = amba_devs[i];
376375
amba_device_register(d, &iomem_resource);
377376
}
378-
379-
#ifdef CONFIG_LEDS
380-
leds_event = realview_leds_event;
381-
#endif
382377
}
383378

384379
MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176")

‎arch/arm/mach-realview/realview_pb11mp.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
#include <mach/hardware.h>
3232
#include <asm/irq.h>
33-
#include <asm/leds.h>
3433
#include <asm/mach-types.h>
3534
#include <asm/pmu.h>
3635
#include <asm/pgtable.h>
@@ -357,10 +356,6 @@ static void __init realview_pb11mp_init(void)
357356
struct amba_device *d = amba_devs[i];
358357
amba_device_register(d, &iomem_resource);
359358
}
360-
361-
#ifdef CONFIG_LEDS
362-
leds_event = realview_leds_event;
363-
#endif
364359
}
365360

366361
MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")

‎arch/arm/mach-realview/realview_pba8.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <linux/io.h>
3030

3131
#include <asm/irq.h>
32-
#include <asm/leds.h>
3332
#include <asm/mach-types.h>
3433
#include <asm/pmu.h>
3534
#include <asm/pgtable.h>
@@ -299,10 +298,6 @@ static void __init realview_pba8_init(void)
299298
struct amba_device *d = amba_devs[i];
300299
amba_device_register(d, &iomem_resource);
301300
}
302-
303-
#ifdef CONFIG_LEDS
304-
leds_event = realview_leds_event;
305-
#endif
306301
}
307302

308303
MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8")

‎arch/arm/mach-realview/realview_pbx.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <linux/io.h>
2929

3030
#include <asm/irq.h>
31-
#include <asm/leds.h>
3231
#include <asm/mach-types.h>
3332
#include <asm/pmu.h>
3433
#include <asm/smp_twd.h>
@@ -394,10 +393,6 @@ static void __init realview_pbx_init(void)
394393
struct amba_device *d = amba_devs[i];
395394
amba_device_register(d, &iomem_resource);
396395
}
397-
398-
#ifdef CONFIG_LEDS
399-
leds_event = realview_leds_event;
400-
#endif
401396
}
402397

403398
MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX")

‎arch/arm/mach-versatile/core.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#include <linux/mtd/physmap.h>
3838

3939
#include <asm/irq.h>
40-
#include <asm/leds.h>
4140
#include <asm/hardware/arm_timer.h>
4241
#include <asm/hardware/icst.h>
4342
#include <asm/hardware/vic.h>
@@ -763,10 +762,6 @@ void __init versatile_init(void)
763762
struct amba_device *d = amba_devs[i];
764763
amba_device_register(d, &iomem_resource);
765764
}
766-
767-
#ifdef CONFIG_LEDS
768-
leds_event = versatile_leds_event;
769-
#endif
770765
}
771766

772767
/*

‎arch/arm/plat-versatile/Kconfig‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ config PLAT_VERSATILE_FPGA_IRQ_NR
1313
depends on PLAT_VERSATILE_FPGA_IRQ
1414

1515
config PLAT_VERSATILE_LEDS
16-
def_bool y if LEDS_CLASS
16+
def_bool y if NEW_LEDS
1717
depends on ARCH_REALVIEW || ARCH_VERSATILE
18+
select LEDS_CLASS
19+
select LEDS_TRIGGER
1820

1921
config PLAT_VERSATILE_SCHED_CLOCK
2022
def_bool y

‎arch/arm/plat-versatile/leds.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ static const struct {
3737
} versatile_leds[] = {
3838
{ "versatile:0", "heartbeat", },
3939
{ "versatile:1", "mmc0", },
40-
{ "versatile:2", },
41-
{ "versatile:3", },
42-
{ "versatile:4", },
43-
{ "versatile:5", },
40+
{ "versatile:2", "cpu0" },
41+
{ "versatile:3", "cpu1" },
42+
{ "versatile:4", "cpu2" },
43+
{ "versatile:5", "cpu3" },
4444
{ "versatile:6", },
4545
{ "versatile:7", },
4646
};

0 commit comments

Comments
 (0)