diff options
author | Darius Augulis <augulis.darius@gmail.com> | 2010-08-01 16:38:43 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-08-14 11:10:23 -0400 |
commit | ff266c0c91942cf56b03675ac5fc820b1ac600e1 (patch) | |
tree | 3bd8a4377fc705753b788a37122cb18311fd34a8 /arch | |
parent | eab5cfa065c94389b72d84670b6197ae60ccb235 (diff) |
ARM: mach-real6410: add dm9000 ethernet support for mach-real6410
This patch is based on "[PATCH v2] Support for Real6410"
Signed-off-by: Darius Augulis <augulis.darius@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-s3c64xx/mach-real6410.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c index 04a472a79f3f..1a0485ad4da6 100644 --- a/arch/arm/mach-s3c64xx/mach-real6410.c +++ b/arch/arm/mach-s3c64xx/mach-real6410.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/list.h> | 18 | #include <linux/list.h> |
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/dm9000.h> | ||
20 | #include <linux/serial_core.h> | 21 | #include <linux/serial_core.h> |
21 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
22 | #include <asm/mach-types.h> | 23 | #include <asm/mach-types.h> |
@@ -24,6 +25,7 @@ | |||
24 | #include <asm/mach/map.h> | 25 | #include <asm/mach/map.h> |
25 | #include <mach/map.h> | 26 | #include <mach/map.h> |
26 | #include <mach/s3c6410.h> | 27 | #include <mach/s3c6410.h> |
28 | #include <mach/regs-srom.h> | ||
27 | #include <plat/cpu.h> | 29 | #include <plat/cpu.h> |
28 | #include <plat/regs-serial.h> | 30 | #include <plat/regs-serial.h> |
29 | 31 | ||
@@ -62,6 +64,44 @@ static struct s3c2410_uartcfg real6410_uartcfgs[] __initdata = { | |||
62 | }, | 64 | }, |
63 | }; | 65 | }; |
64 | 66 | ||
67 | /* DM9000AEP 10/100 ethernet controller */ | ||
68 | |||
69 | static struct resource real6410_dm9k_resource[] = { | ||
70 | [0] = { | ||
71 | .start = S3C64XX_PA_XM0CSN1, | ||
72 | .end = S3C64XX_PA_XM0CSN1 + 1, | ||
73 | .flags = IORESOURCE_MEM | ||
74 | }, | ||
75 | [1] = { | ||
76 | .start = S3C64XX_PA_XM0CSN1 + 4, | ||
77 | .end = S3C64XX_PA_XM0CSN1 + 5, | ||
78 | .flags = IORESOURCE_MEM | ||
79 | }, | ||
80 | [2] = { | ||
81 | .start = S3C_EINT(7), | ||
82 | .end = S3C_EINT(7), | ||
83 | .flags = IORESOURCE_IRQ, | ||
84 | } | ||
85 | }; | ||
86 | |||
87 | static struct dm9000_plat_data real6410_dm9k_pdata = { | ||
88 | .flags = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM), | ||
89 | }; | ||
90 | |||
91 | static struct platform_device real6410_device_eth = { | ||
92 | .name = "dm9000", | ||
93 | .id = -1, | ||
94 | .num_resources = ARRAY_SIZE(real6410_dm9k_resource), | ||
95 | .resource = real6410_dm9k_resource, | ||
96 | .dev = { | ||
97 | .platform_data = &real6410_dm9k_pdata, | ||
98 | }, | ||
99 | }; | ||
100 | |||
101 | static struct platform_device *real6410_devices[] __initdata = { | ||
102 | &real6410_device_eth, | ||
103 | }; | ||
104 | |||
65 | static void __init real6410_map_io(void) | 105 | static void __init real6410_map_io(void) |
66 | { | 106 | { |
67 | s3c64xx_init_io(NULL, 0); | 107 | s3c64xx_init_io(NULL, 0); |
@@ -71,6 +111,29 @@ static void __init real6410_map_io(void) | |||
71 | 111 | ||
72 | static void __init real6410_machine_init(void) | 112 | static void __init real6410_machine_init(void) |
73 | { | 113 | { |
114 | u32 cs1; | ||
115 | |||
116 | /* configure nCS1 width to 16 bits */ | ||
117 | |||
118 | cs1 = __raw_readl(S3C64XX_SROM_BW) & | ||
119 | ~(S3C64XX_SROM_BW__CS_MASK << S3C64XX_SROM_BW__NCS1__SHIFT); | ||
120 | cs1 |= ((1 << S3C64XX_SROM_BW__DATAWIDTH__SHIFT) | | ||
121 | (1 << S3C64XX_SROM_BW__WAITENABLE__SHIFT) | | ||
122 | (1 << S3C64XX_SROM_BW__BYTEENABLE__SHIFT)) << | ||
123 | S3C64XX_SROM_BW__NCS1__SHIFT; | ||
124 | __raw_writel(cs1, S3C64XX_SROM_BW); | ||
125 | |||
126 | /* set timing for nCS1 suitable for ethernet chip */ | ||
127 | |||
128 | __raw_writel((0 << S3C64XX_SROM_BCX__PMC__SHIFT) | | ||
129 | (6 << S3C64XX_SROM_BCX__TACP__SHIFT) | | ||
130 | (4 << S3C64XX_SROM_BCX__TCAH__SHIFT) | | ||
131 | (1 << S3C64XX_SROM_BCX__TCOH__SHIFT) | | ||
132 | (13 << S3C64XX_SROM_BCX__TACC__SHIFT) | | ||
133 | (4 << S3C64XX_SROM_BCX__TCOS__SHIFT) | | ||
134 | (0 << S3C64XX_SROM_BCX__TACS__SHIFT), S3C64XX_SROM_BC1); | ||
135 | |||
136 | platform_add_devices(real6410_devices, ARRAY_SIZE(real6410_devices)); | ||
74 | } | 137 | } |
75 | 138 | ||
76 | MACHINE_START(REAL6410, "REAL6410") | 139 | MACHINE_START(REAL6410, "REAL6410") |