diff options
author | Bryan Wu <bryan.wu@analog.com> | 2007-10-10 13:20:06 -0400 |
---|---|---|
committer | Bryan Wu <bryan.wu@analog.com> | 2007-10-10 13:20:06 -0400 |
commit | c6c4d7bbbb498c38afa05688dfc2784948a0c4e2 (patch) | |
tree | 9ebefb1b6c6ceff6e83eda3dfcbd616a725ecced /arch/blackfin/mach-bf561/boards/ezkit.c | |
parent | bbf25010f1a6b761914430f5fca081ec8c7accd1 (diff) |
Blackfin arch: update platform driver resource information to all board files
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin/mach-bf561/boards/ezkit.c')
-rw-r--r-- | arch/blackfin/mach-bf561/boards/ezkit.c | 82 |
1 files changed, 74 insertions, 8 deletions
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c index 724191da20a2..57e14edca8b1 100644 --- a/arch/blackfin/mach-bf561/boards/ezkit.c +++ b/arch/blackfin/mach-bf561/boards/ezkit.c | |||
@@ -32,6 +32,8 @@ | |||
32 | #include <linux/spi/spi.h> | 32 | #include <linux/spi/spi.h> |
33 | #include <linux/irq.h> | 33 | #include <linux/irq.h> |
34 | #include <linux/interrupt.h> | 34 | #include <linux/interrupt.h> |
35 | #include <linux/pata_platform.h> | ||
36 | #include <asm/dma.h> | ||
35 | #include <asm/bfin5xx_spi.h> | 37 | #include <asm/bfin5xx_spi.h> |
36 | 38 | ||
37 | /* | 39 | /* |
@@ -140,17 +142,33 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = { | |||
140 | #endif | 142 | #endif |
141 | #endif | 143 | #endif |
142 | 144 | ||
145 | /* SPI (0) */ | ||
146 | static struct resource bfin_spi0_resource[] = { | ||
147 | [0] = { | ||
148 | .start = SPI0_REGBASE, | ||
149 | .end = SPI0_REGBASE + 0xFF, | ||
150 | .flags = IORESOURCE_MEM, | ||
151 | }, | ||
152 | [1] = { | ||
153 | .start = CH_SPI, | ||
154 | .end = CH_SPI, | ||
155 | .flags = IORESOURCE_IRQ, | ||
156 | } | ||
157 | }; | ||
158 | |||
143 | /* SPI controller data */ | 159 | /* SPI controller data */ |
144 | static struct bfin5xx_spi_master spi_bfin_master_info = { | 160 | static struct bfin5xx_spi_master bfin_spi0_info = { |
145 | .num_chipselect = 8, | 161 | .num_chipselect = 8, |
146 | .enable_dma = 1, /* master has the ability to do dma transfer */ | 162 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
147 | }; | 163 | }; |
148 | 164 | ||
149 | static struct platform_device spi_bfin_master_device = { | 165 | static struct platform_device bfin_spi0_device = { |
150 | .name = "bfin-spi-master", | 166 | .name = "bfin-spi", |
151 | .id = 1, /* Bus number */ | 167 | .id = 0, /* Bus number */ |
168 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), | ||
169 | .resource = bfin_spi0_resource, | ||
152 | .dev = { | 170 | .dev = { |
153 | .platform_data = &spi_bfin_master_info, /* Passed to driver */ | 171 | .platform_data = &bfin_spi0_info, /* Passed to driver */ |
154 | }, | 172 | }, |
155 | }; | 173 | }; |
156 | 174 | ||
@@ -160,23 +178,63 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
160 | { | 178 | { |
161 | .modalias = "ad1836-spi", | 179 | .modalias = "ad1836-spi", |
162 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ | 180 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
163 | .bus_num = 1, | 181 | .bus_num = 0, |
164 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, | 182 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, |
165 | .controller_data = &ad1836_spi_chip_info, | 183 | .controller_data = &ad1836_spi_chip_info, |
166 | }, | 184 | }, |
167 | #endif | 185 | #endif |
168 | }; | 186 | }; |
169 | 187 | ||
188 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | ||
189 | #define PATA_INT 55 | ||
190 | |||
191 | static struct pata_platform_info bfin_pata_platform_data = { | ||
192 | .ioport_shift = 1, | ||
193 | .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED, | ||
194 | }; | ||
195 | |||
196 | static struct resource bfin_pata_resources[] = { | ||
197 | { | ||
198 | .start = 0x20314020, | ||
199 | .end = 0x2031403F, | ||
200 | .flags = IORESOURCE_MEM, | ||
201 | }, | ||
202 | { | ||
203 | .start = 0x2031401C, | ||
204 | .end = 0x2031401F, | ||
205 | .flags = IORESOURCE_MEM, | ||
206 | }, | ||
207 | { | ||
208 | .start = PATA_INT, | ||
209 | .end = PATA_INT, | ||
210 | .flags = IORESOURCE_IRQ, | ||
211 | }, | ||
212 | }; | ||
213 | |||
214 | static struct platform_device bfin_pata_device = { | ||
215 | .name = "pata_platform", | ||
216 | .id = -1, | ||
217 | .num_resources = ARRAY_SIZE(bfin_pata_resources), | ||
218 | .resource = bfin_pata_resources, | ||
219 | .dev = { | ||
220 | .platform_data = &bfin_pata_platform_data, | ||
221 | } | ||
222 | }; | ||
223 | #endif | ||
224 | |||
170 | static struct platform_device *ezkit_devices[] __initdata = { | 225 | static struct platform_device *ezkit_devices[] __initdata = { |
171 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | 226 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
172 | &smc91x_device, | 227 | &smc91x_device, |
173 | #endif | 228 | #endif |
174 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 229 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
175 | &spi_bfin_master_device, | 230 | &bfin_spi0_device, |
176 | #endif | 231 | #endif |
177 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 232 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
178 | &bfin_uart_device, | 233 | &bfin_uart_device, |
179 | #endif | 234 | #endif |
235 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | ||
236 | &bfin_pata_device, | ||
237 | #endif | ||
180 | }; | 238 | }; |
181 | 239 | ||
182 | static int __init ezkit_init(void) | 240 | static int __init ezkit_init(void) |
@@ -194,7 +252,15 @@ static int __init ezkit_init(void) | |||
194 | SSYNC(); | 252 | SSYNC(); |
195 | #endif | 253 | #endif |
196 | 254 | ||
197 | return spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); | 255 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
256 | spi_register_board_info(bfin_spi_board_info, | ||
257 | ARRAY_SIZE(bfin_spi_board_info)); | ||
258 | #endif | ||
259 | |||
260 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | ||
261 | irq_desc[PATA_INT].status |= IRQ_NOAUTOEN; | ||
262 | #endif | ||
263 | return 0; | ||
198 | } | 264 | } |
199 | 265 | ||
200 | arch_initcall(ezkit_init); | 266 | arch_initcall(ezkit_init); |