From patchwork Wed Jun 22 17:33:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 2177 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 056B023F08 for ; Wed, 22 Jun 2011 17:33:25 +0000 (UTC) Received: from mail-vx0-f180.google.com (mail-vx0-f180.google.com [209.85.220.180]) by fiordland.canonical.com (Postfix) with ESMTP id ACFAAA1839D for ; Wed, 22 Jun 2011 17:33:24 +0000 (UTC) Received: by vxd7 with SMTP id 7so1147668vxd.11 for ; Wed, 22 Jun 2011 10:33:24 -0700 (PDT) Received: by 10.52.95.194 with SMTP id dm2mr1337817vdb.47.1308764004137; Wed, 22 Jun 2011 10:33:24 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.52.183.130 with SMTP id em2cs153326vdc; Wed, 22 Jun 2011 10:33:23 -0700 (PDT) Received: by 10.14.9.231 with SMTP id 79mr765099eet.241.1308764002679; Wed, 22 Jun 2011 10:33:22 -0700 (PDT) Received: from eu1sys200aog107.obsmtp.com (eu1sys200aog107.obsmtp.com [207.126.144.123]) by mx.google.com with SMTP id b70si1546422eea.33.2011.06.22.10.33.15 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 22 Jun 2011 10:33:22 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.123 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.123; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.123 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob107.postini.com ([207.126.147.11]) with SMTP ID DSNKTgInW2mIuc6t62T5UwX1/DQZrnJivUTF@postini.com; Wed, 22 Jun 2011 17:33:22 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D5873D7; Wed, 22 Jun 2011 17:33:14 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 8489E4863; Wed, 22 Jun 2011 17:33:14 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 4C694A8074; Wed, 22 Jun 2011 19:33:07 +0200 (CEST) Received: from localhost.localdomain (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 22 Jun 2011 19:33:14 +0200 From: Linus Walleij To: Cc: Lee Jones , Linus Walleij , Bryan Wu , Richard Purdie Subject: [PATCH 2/3] mach-realview: retire custom LED code Date: Wed, 22 Jun 2011 19:33:11 +0200 Message-ID: <1308763991-24782-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.3.2 MIME-Version: 1.0 From: Linus Walleij 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. Cc: Bryan Wu Cc: Richard Purdie Signed-off-by: Linus Walleij --- arch/arm/mach-realview/core.c | 39 ------------------------------ arch/arm/mach-realview/core.h | 2 - arch/arm/mach-realview/realview_eb.c | 4 --- arch/arm/mach-realview/realview_pb1176.c | 4 --- arch/arm/mach-realview/realview_pb11mp.c | 4 --- arch/arm/mach-realview/realview_pba8.c | 4 --- arch/arm/mach-realview/realview_pbx.c | 4 --- arch/arm/plat-versatile/leds.c | 13 +++++++--- 8 files changed, 9 insertions(+), 65 deletions(-) diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index 5c23450..3a12b6b 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -437,44 +436,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)? */ diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h index 5c83d1e..47ee3bc 100644 --- a/arch/arm/mach-realview/core.h +++ b/arch/arm/mach-realview/core.h @@ -26,7 +26,6 @@ #include #include -#include #define AMBA_DEVICE(name,busid,base,plat) \ static struct amba_device name##_device = { \ @@ -57,7 +56,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); diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c index 10e75fa..2fb438a 100644 --- a/arch/arm/mach-realview/realview_eb.c +++ b/arch/arm/mach-realview/realview_eb.c @@ -30,7 +30,6 @@ #include #include -#include #include #include #include @@ -455,9 +454,6 @@ static void __init realview_eb_init(void) amba_device_register(d, &iomem_resource); } -#ifdef CONFIG_LEDS - leds_event = realview_leds_event; -#endif realview_reset = realview_eb_reset; } diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c index eab6070..2e0350a 100644 --- a/arch/arm/mach-realview/realview_pb1176.c +++ b/arch/arm/mach-realview/realview_pb1176.c @@ -30,7 +30,6 @@ #include #include -#include #include #include #include @@ -350,9 +349,6 @@ static void __init realview_pb1176_init(void) amba_device_register(d, &iomem_resource); } -#ifdef CONFIG_LEDS - leds_event = realview_leds_event; -#endif realview_reset = realview_pb1176_reset; } diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c index b2985fc..9dd929a 100644 --- a/arch/arm/mach-realview/realview_pb11mp.c +++ b/arch/arm/mach-realview/realview_pb11mp.c @@ -30,7 +30,6 @@ #include #include -#include #include #include #include @@ -352,9 +351,6 @@ static void __init realview_pb11mp_init(void) amba_device_register(d, &iomem_resource); } -#ifdef CONFIG_LEDS - leds_event = realview_leds_event; -#endif realview_reset = realview_pb11mp_reset; } diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c index fb68665..d1bcd5f 100644 --- a/arch/arm/mach-realview/realview_pba8.c +++ b/arch/arm/mach-realview/realview_pba8.c @@ -29,7 +29,6 @@ #include #include -#include #include #include #include @@ -302,9 +301,6 @@ static void __init realview_pba8_init(void) amba_device_register(d, &iomem_resource); } -#ifdef CONFIG_LEDS - leds_event = realview_leds_event; -#endif realview_reset = realview_pba8_reset; } diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c index 92ace2c..797a509 100644 --- a/arch/arm/mach-realview/realview_pbx.c +++ b/arch/arm/mach-realview/realview_pbx.c @@ -28,7 +28,6 @@ #include #include -#include #include #include #include @@ -385,9 +384,6 @@ static void __init realview_pbx_init(void) amba_device_register(d, &iomem_resource); } -#ifdef CONFIG_LEDS - leds_event = realview_leds_event; -#endif realview_reset = realview_pbx_reset; } diff --git a/arch/arm/plat-versatile/leds.c b/arch/arm/plat-versatile/leds.c index 3169fa5..8d33bef 100644 --- a/arch/arm/plat-versatile/leds.c +++ b/arch/arm/plat-versatile/leds.c @@ -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", "arm-cpu" }, + { "versatile:3", "arm-cpu" }, + { "versatile:4", "arm-cpu" }, + { "versatile:5", "arm-cpu" }, { "versatile:6", }, { "versatile:7", }, }; @@ -85,6 +85,11 @@ static int __init versatile_leds_init(void) led->cdev.brightness_set = versatile_led_set; led->cdev.brightness_get = versatile_led_get; led->cdev.default_trigger = versatile_leds[i].trigger; + /* Some trigger data for CPU LEDs */ + if (i >= 2 && i <= 5 ) { + /* This is the CPU number actually */ + led->cdev.trigger_data = (void *) i - 2; + } led->mask = BIT(i); if (led_classdev_register(NULL, &led->cdev) < 0) {