diff options
author | Thomas Abraham <thomas.ab@samsung.com> | 2010-12-02 04:16:20 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2010-12-29 19:37:48 -0500 |
commit | 9b580cdb1c0294df2a2cfa845f11d65ee53e27ca (patch) | |
tree | ea662e189e4d9a45983cc584e16674a25eb703bd /arch/arm/mach-s5pv210/mach-smdkv210.c | |
parent | 81f9becd6a9e0f7a77e27e459e99cc74594bd205 (diff) |
ARM: S5PV210: Add DM9000 support on SMDKV210
This patch adds DM9000 Ethernet Controller device support for SMDKV210.
Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s5pv210/mach-smdkv210.c')
-rw-r--r-- | arch/arm/mach-s5pv210/mach-smdkv210.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c index 1fbc45b2a432..30eec118a3a4 100644 --- a/arch/arm/mach-s5pv210/mach-smdkv210.c +++ b/arch/arm/mach-s5pv210/mach-smdkv210.c | |||
@@ -14,6 +14,8 @@ | |||
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/serial_core.h> | 15 | #include <linux/serial_core.h> |
16 | #include <linux/sysdev.h> | 16 | #include <linux/sysdev.h> |
17 | #include <linux/dm9000.h> | ||
18 | #include <linux/gpio.h> | ||
17 | 19 | ||
18 | #include <asm/mach/arch.h> | 20 | #include <asm/mach/arch.h> |
19 | #include <asm/mach/map.h> | 21 | #include <asm/mach/map.h> |
@@ -24,6 +26,8 @@ | |||
24 | #include <mach/regs-clock.h> | 26 | #include <mach/regs-clock.h> |
25 | 27 | ||
26 | #include <plat/regs-serial.h> | 28 | #include <plat/regs-serial.h> |
29 | #include <plat/regs-srom.h> | ||
30 | #include <plat/gpio-cfg.h> | ||
27 | #include <plat/s5pv210.h> | 31 | #include <plat/s5pv210.h> |
28 | #include <plat/devs.h> | 32 | #include <plat/devs.h> |
29 | #include <plat/cpu.h> | 33 | #include <plat/cpu.h> |
@@ -102,6 +106,39 @@ static struct samsung_keypad_platdata smdkv210_keypad_data __initdata = { | |||
102 | .cols = 8, | 106 | .cols = 8, |
103 | }; | 107 | }; |
104 | 108 | ||
109 | static struct resource smdkv210_dm9000_resources[] = { | ||
110 | [0] = { | ||
111 | .start = S5PV210_PA_SROM_BANK5, | ||
112 | .end = S5PV210_PA_SROM_BANK5, | ||
113 | .flags = IORESOURCE_MEM, | ||
114 | }, | ||
115 | [1] = { | ||
116 | .start = S5PV210_PA_SROM_BANK5 + 2, | ||
117 | .end = S5PV210_PA_SROM_BANK5 + 2, | ||
118 | .flags = IORESOURCE_MEM, | ||
119 | }, | ||
120 | [2] = { | ||
121 | .start = IRQ_EINT(9), | ||
122 | .end = IRQ_EINT(9), | ||
123 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
124 | }, | ||
125 | }; | ||
126 | |||
127 | static struct dm9000_plat_data smdkv210_dm9000_platdata = { | ||
128 | .flags = DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM, | ||
129 | .dev_addr = { 0x00, 0x09, 0xc0, 0xff, 0xec, 0x48 }, | ||
130 | }; | ||
131 | |||
132 | struct platform_device smdkv210_dm9000 = { | ||
133 | .name = "dm9000", | ||
134 | .id = -1, | ||
135 | .num_resources = ARRAY_SIZE(smdkv210_dm9000_resources), | ||
136 | .resource = smdkv210_dm9000_resources, | ||
137 | .dev = { | ||
138 | .platform_data = &smdkv210_dm9000_platdata, | ||
139 | }, | ||
140 | }; | ||
141 | |||
105 | static struct platform_device *smdkv210_devices[] __initdata = { | 142 | static struct platform_device *smdkv210_devices[] __initdata = { |
106 | &s5pv210_device_iis0, | 143 | &s5pv210_device_iis0, |
107 | &s5pv210_device_ac97, | 144 | &s5pv210_device_ac97, |
@@ -119,8 +156,26 @@ static struct platform_device *smdkv210_devices[] __initdata = { | |||
119 | &s3c_device_rtc, | 156 | &s3c_device_rtc, |
120 | &s3c_device_ts, | 157 | &s3c_device_ts, |
121 | &s3c_device_wdt, | 158 | &s3c_device_wdt, |
159 | &smdkv210_dm9000, | ||
122 | }; | 160 | }; |
123 | 161 | ||
162 | static void __init smdkv210_dm9000_init(void) | ||
163 | { | ||
164 | unsigned int tmp; | ||
165 | |||
166 | gpio_request(S5PV210_MP01(5), "nCS5"); | ||
167 | s3c_gpio_cfgpin(S5PV210_MP01(5), S3C_GPIO_SFN(2)); | ||
168 | gpio_free(S5PV210_MP01(5)); | ||
169 | |||
170 | tmp = (5 << S5P_SROM_BCX__TACC__SHIFT); | ||
171 | __raw_writel(tmp, S5P_SROM_BC5); | ||
172 | |||
173 | tmp = __raw_readl(S5P_SROM_BW); | ||
174 | tmp &= (S5P_SROM_BW__CS_MASK << S5P_SROM_BW__NCS5__SHIFT); | ||
175 | tmp |= (1 << S5P_SROM_BW__NCS5__SHIFT); | ||
176 | __raw_writel(tmp, S5P_SROM_BW); | ||
177 | } | ||
178 | |||
124 | static struct i2c_board_info smdkv210_i2c_devs0[] __initdata = { | 179 | static struct i2c_board_info smdkv210_i2c_devs0[] __initdata = { |
125 | { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */ | 180 | { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */ |
126 | }; | 181 | }; |
@@ -150,6 +205,8 @@ static void __init smdkv210_machine_init(void) | |||
150 | { | 205 | { |
151 | s3c_pm_init(); | 206 | s3c_pm_init(); |
152 | 207 | ||
208 | smdkv210_dm9000_init(); | ||
209 | |||
153 | samsung_keypad_set_platdata(&smdkv210_keypad_data); | 210 | samsung_keypad_set_platdata(&smdkv210_keypad_data); |
154 | s3c24xx_ts_set_platdata(&s3c_ts_platform); | 211 | s3c24xx_ts_set_platdata(&s3c_ts_platform); |
155 | 212 | ||