aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-footbridge/common.c5
-rw-r--r--arch/arm/mach-footbridge/ebsa285.c17
-rw-r--r--arch/arm/mach-footbridge/include/mach/hardware.h6
3 files changed, 15 insertions, 13 deletions
diff --git a/arch/arm/mach-footbridge/common.c b/arch/arm/mach-footbridge/common.c
index e0091685fd48..9e8220e38398 100644
--- a/arch/arm/mach-footbridge/common.c
+++ b/arch/arm/mach-footbridge/common.c
@@ -143,11 +143,6 @@ static struct map_desc fb_common_io_desc[] __initdata = {
143 .pfn = __phys_to_pfn(DC21285_ARMCSR_BASE), 143 .pfn = __phys_to_pfn(DC21285_ARMCSR_BASE),
144 .length = ARMCSR_SIZE, 144 .length = ARMCSR_SIZE,
145 .type = MT_DEVICE, 145 .type = MT_DEVICE,
146 }, {
147 .virtual = XBUS_BASE,
148 .pfn = __phys_to_pfn(0x40000000),
149 .length = XBUS_SIZE,
150 .type = MT_DEVICE,
151 } 146 }
152}; 147};
153 148
diff --git a/arch/arm/mach-footbridge/ebsa285.c b/arch/arm/mach-footbridge/ebsa285.c
index 3ff7a0c30a0f..aee8300f3490 100644
--- a/arch/arm/mach-footbridge/ebsa285.c
+++ b/arch/arm/mach-footbridge/ebsa285.c
@@ -4,6 +4,7 @@
4 * EBSA285 machine fixup 4 * EBSA285 machine fixup
5 */ 5 */
6#include <linux/init.h> 6#include <linux/init.h>
7#include <linux/io.h>
7#include <linux/spinlock.h> 8#include <linux/spinlock.h>
8#include <linux/slab.h> 9#include <linux/slab.h>
9#include <linux/leds.h> 10#include <linux/leds.h>
@@ -17,6 +18,11 @@
17 18
18/* LEDs */ 19/* LEDs */
19#if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS) 20#if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS)
21#define XBUS_AMBER_L BIT(0)
22#define XBUS_GREEN_L BIT(1)
23#define XBUS_RED_L BIT(2)
24#define XBUS_TOGGLE BIT(7)
25
20struct ebsa285_led { 26struct ebsa285_led {
21 struct led_classdev cdev; 27 struct led_classdev cdev;
22 u8 mask; 28 u8 mask;
@@ -36,6 +42,7 @@ static const struct {
36}; 42};
37 43
38static unsigned char hw_led_state; 44static unsigned char hw_led_state;
45static void __iomem *xbus;
39 46
40static void ebsa285_led_set(struct led_classdev *cdev, 47static void ebsa285_led_set(struct led_classdev *cdev,
41 enum led_brightness b) 48 enum led_brightness b)
@@ -47,7 +54,7 @@ static void ebsa285_led_set(struct led_classdev *cdev,
47 hw_led_state |= led->mask; 54 hw_led_state |= led->mask;
48 else 55 else
49 hw_led_state &= ~led->mask; 56 hw_led_state &= ~led->mask;
50 *XBUS_LEDS = hw_led_state; 57 writeb(hw_led_state, xbus);
51} 58}
52 59
53static enum led_brightness ebsa285_led_get(struct led_classdev *cdev) 60static enum led_brightness ebsa285_led_get(struct led_classdev *cdev)
@@ -65,9 +72,13 @@ static int __init ebsa285_leds_init(void)
65 if (!machine_is_ebsa285()) 72 if (!machine_is_ebsa285())
66 return -ENODEV; 73 return -ENODEV;
67 74
75 xbus = ioremap(XBUS_CS2, SZ_4K);
76 if (!xbus)
77 return -ENOMEM;
78
68 /* 3 LEDS all off */ 79 /* 3 LEDS all off */
69 hw_led_state = XBUS_LED_AMBER | XBUS_LED_GREEN | XBUS_LED_RED; 80 hw_led_state = XBUS_AMBER_L | XBUS_GREEN_L | XBUS_RED_L;
70 *XBUS_LEDS = hw_led_state; 81 writeb(hw_led_state, xbus);
71 82
72 for (i = 0; i < ARRAY_SIZE(ebsa285_leds); i++) { 83 for (i = 0; i < ARRAY_SIZE(ebsa285_leds); i++) {
73 struct ebsa285_led *led; 84 struct ebsa285_led *led;
diff --git a/arch/arm/mach-footbridge/include/mach/hardware.h b/arch/arm/mach-footbridge/include/mach/hardware.h
index e3d6ccac2162..02f6d7a706b1 100644
--- a/arch/arm/mach-footbridge/include/mach/hardware.h
+++ b/arch/arm/mach-footbridge/include/mach/hardware.h
@@ -51,11 +51,7 @@
51#define PCIMEM_SIZE 0x01000000 51#define PCIMEM_SIZE 0x01000000
52#define PCIMEM_BASE MMU_IO(0xf0000000, 0x80000000) 52#define PCIMEM_BASE MMU_IO(0xf0000000, 0x80000000)
53 53
54#define XBUS_LEDS ((volatile unsigned char *)(XBUS_BASE + 0x12000)) 54#define XBUS_CS2 0x40012000
55#define XBUS_LED_AMBER (1 << 0)
56#define XBUS_LED_GREEN (1 << 1)
57#define XBUS_LED_RED (1 << 2)
58#define XBUS_LED_TOGGLE (1 << 8)
59 55
60#define XBUS_SWITCH ((volatile unsigned char *)(XBUS_BASE + 0x12000)) 56#define XBUS_SWITCH ((volatile unsigned char *)(XBUS_BASE + 0x12000))
61#define XBUS_SWITCH_SWITCH ((*XBUS_SWITCH) & 15) 57#define XBUS_SWITCH_SWITCH ((*XBUS_SWITCH) & 15)