aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@simtec.co.uk>2008-12-13 15:44:11 -0500
committerBen Dooks <ben-linux@fluff.org>2008-12-14 06:34:46 -0500
commitfbd627100bc4a9ebce8c7617df499ee5db763780 (patch)
treea5d42eb2878639bf9c27770d3c58fc7aeab829d5
parent72aaf09fda49f5919d98d65d35e5179f3acb0497 (diff)
[ARM] KS8695: Fix up device registration.
The KS8695 device.c provides registration functionality for the KS8695's various devices such as watchdog timers and ethernet devices. Rather than predicating those on the config options for the drivers, always register the platform devices so that a later built module can hook on. Also, the ethernet used to register virtual addresses in the platform data. This is wrong and so this patch changes them to physical addresses and also passes in the appropriate physical region for the PHY or Switch as appropriate. Signed-off-by: Daniel Silverstone <dsilvers@simtec.co.uk> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
-rw-r--r--arch/arm/mach-ks8695/devices.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/arch/arm/mach-ks8695/devices.c b/arch/arm/mach-ks8695/devices.c
index 4bd251482c8f..36ab0fd3d9b6 100644
--- a/arch/arm/mach-ks8695/devices.c
+++ b/arch/arm/mach-ks8695/devices.c
@@ -25,19 +25,20 @@
25#include <mach/regs-wan.h> 25#include <mach/regs-wan.h>
26#include <mach/regs-lan.h> 26#include <mach/regs-lan.h>
27#include <mach/regs-hpna.h> 27#include <mach/regs-hpna.h>
28#include <mach/regs-switch.h>
29#include <mach/regs-misc.h>
28 30
29 31
30/* -------------------------------------------------------------------- 32/* --------------------------------------------------------------------
31 * Ethernet 33 * Ethernet
32 * -------------------------------------------------------------------- */ 34 * -------------------------------------------------------------------- */
33 35
34#if defined(CONFIG_ARM_KS8695_ETHER) || defined(CONFIG_ARM_KS8695_ETHER_MODULE)
35static u64 eth_dmamask = 0xffffffffUL; 36static u64 eth_dmamask = 0xffffffffUL;
36 37
37static struct resource ks8695_wan_resources[] = { 38static struct resource ks8695_wan_resources[] = {
38 [0] = { 39 [0] = {
39 .start = KS8695_WAN_VA, 40 .start = KS8695_WAN_PA,
40 .end = KS8695_WAN_VA + 0x00ff, 41 .end = KS8695_WAN_PA + 0x00ff,
41 .flags = IORESOURCE_MEM, 42 .flags = IORESOURCE_MEM,
42 }, 43 },
43 [1] = { 44 [1] = {
@@ -58,6 +59,12 @@ static struct resource ks8695_wan_resources[] = {
58 .end = KS8695_IRQ_WAN_LINK, 59 .end = KS8695_IRQ_WAN_LINK,
59 .flags = IORESOURCE_IRQ, 60 .flags = IORESOURCE_IRQ,
60 }, 61 },
62 [4] = {
63 .name = "WAN PHY",
64 .start = KS8695_MISC_PA,
65 .end = KS8695_MISC_PA + 0x1f,
66 .flags = IORESOURCE_MEM,
67 },
61}; 68};
62 69
63static struct platform_device ks8695_wan_device = { 70static struct platform_device ks8695_wan_device = {
@@ -74,8 +81,8 @@ static struct platform_device ks8695_wan_device = {
74 81
75static struct resource ks8695_lan_resources[] = { 82static struct resource ks8695_lan_resources[] = {
76 [0] = { 83 [0] = {
77 .start = KS8695_LAN_VA, 84 .start = KS8695_LAN_PA,
78 .end = KS8695_LAN_VA + 0x00ff, 85 .end = KS8695_LAN_PA + 0x00ff,
79 .flags = IORESOURCE_MEM, 86 .flags = IORESOURCE_MEM,
80 }, 87 },
81 [1] = { 88 [1] = {
@@ -90,6 +97,12 @@ static struct resource ks8695_lan_resources[] = {
90 .end = KS8695_IRQ_LAN_TX_STATUS, 97 .end = KS8695_IRQ_LAN_TX_STATUS,
91 .flags = IORESOURCE_IRQ, 98 .flags = IORESOURCE_IRQ,
92 }, 99 },
100 [3] = {
101 .name = "LAN SWITCH",
102 .start = KS8695_SWITCH_PA,
103 .end = KS8695_SWITCH_PA + 0x4f,
104 .flags = IORESOURCE_MEM,
105 },
93}; 106};
94 107
95static struct platform_device ks8695_lan_device = { 108static struct platform_device ks8695_lan_device = {
@@ -106,8 +119,8 @@ static struct platform_device ks8695_lan_device = {
106 119
107static struct resource ks8695_hpna_resources[] = { 120static struct resource ks8695_hpna_resources[] = {
108 [0] = { 121 [0] = {
109 .start = KS8695_HPNA_VA, 122 .start = KS8695_HPNA_PA,
110 .end = KS8695_HPNA_VA + 0x00ff, 123 .end = KS8695_HPNA_PA + 0x00ff,
111 .flags = IORESOURCE_MEM, 124 .flags = IORESOURCE_MEM,
112 }, 125 },
113 [1] = { 126 [1] = {
@@ -149,18 +162,12 @@ void __init ks8696_add_device_hpna(void)
149{ 162{
150 platform_device_register(&ks8695_hpna_device); 163 platform_device_register(&ks8695_hpna_device);
151} 164}
152#else
153void __init ks8695_add_device_wan(void) {}
154void __init ks8695_add_device_lan(void) {}
155void __init ks8696_add_device_hpna(void) {}
156#endif
157 165
158 166
159/* -------------------------------------------------------------------- 167/* --------------------------------------------------------------------
160 * Watchdog 168 * Watchdog
161 * -------------------------------------------------------------------- */ 169 * -------------------------------------------------------------------- */
162 170
163#if defined(CONFIG_KS8695_WATCHDOG) || defined(CONFIG_KS8695_WATCHDOG_MODULE)
164static struct platform_device ks8695_wdt_device = { 171static struct platform_device ks8695_wdt_device = {
165 .name = "ks8695_wdt", 172 .name = "ks8695_wdt",
166 .id = -1, 173 .id = -1,
@@ -171,9 +178,6 @@ static void __init ks8695_add_device_watchdog(void)
171{ 178{
172 platform_device_register(&ks8695_wdt_device); 179 platform_device_register(&ks8695_wdt_device);
173} 180}
174#else
175static void __init ks8695_add_device_watchdog(void) {}
176#endif
177 181
178 182
179/* -------------------------------------------------------------------- 183/* --------------------------------------------------------------------
@@ -190,7 +194,7 @@ void __init ks8695_init_leds(u8 cpu_led, u8 timer_led)
190 gpio_direction_output(cpu_led, 1); 194 gpio_direction_output(cpu_led, 1);
191 gpio_direction_output(timer_led, 1); 195 gpio_direction_output(timer_led, 1);
192 196
193 ks8695_leds_cpu = cpu_led; 197 ks8695_leds_cpu = cpu_led;
194 ks8695_leds_timer = timer_led; 198 ks8695_leds_timer = timer_led;
195} 199}
196#else 200#else