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-bf537 | |
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-bf537')
-rw-r--r-- | arch/blackfin/mach-bf537/boards/cm_bf537.c | 87 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/generic_board.c | 397 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/pnav10.c | 53 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/stamp.c | 142 |
4 files changed, 569 insertions, 110 deletions
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537.c b/arch/blackfin/mach-bf537/boards/cm_bf537.c index a8f947b72754..44dea05e1d03 100644 --- a/arch/blackfin/mach-bf537/boards/cm_bf537.c +++ b/arch/blackfin/mach-bf537/boards/cm_bf537.c | |||
@@ -35,7 +35,9 @@ | |||
35 | #include <linux/spi/spi.h> | 35 | #include <linux/spi/spi.h> |
36 | #include <linux/spi/flash.h> | 36 | #include <linux/spi/flash.h> |
37 | #include <linux/usb_isp1362.h> | 37 | #include <linux/usb_isp1362.h> |
38 | #include <linux/pata_platform.h> | ||
38 | #include <linux/irq.h> | 39 | #include <linux/irq.h> |
40 | #include <asm/dma.h> | ||
39 | #include <asm/bfin5xx_spi.h> | 41 | #include <asm/bfin5xx_spi.h> |
40 | 42 | ||
41 | /* | 43 | /* |
@@ -113,7 +115,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
113 | /* the modalias must be the same as spi device driver name */ | 115 | /* the modalias must be the same as spi device driver name */ |
114 | .modalias = "m25p80", /* Name of spi_driver for this device */ | 116 | .modalias = "m25p80", /* Name of spi_driver for this device */ |
115 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 117 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
116 | .bus_num = 1, /* Framework bus number */ | 118 | .bus_num = 0, /* Framework bus number */ |
117 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ | 119 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ |
118 | .platform_data = &bfin_spi_flash_data, | 120 | .platform_data = &bfin_spi_flash_data, |
119 | .controller_data = &spi_flash_chip_info, | 121 | .controller_data = &spi_flash_chip_info, |
@@ -125,7 +127,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
125 | { | 127 | { |
126 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ | 128 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ |
127 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ | 129 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ |
128 | .bus_num = 1, /* Framework bus number */ | 130 | .bus_num = 0, /* Framework bus number */ |
129 | .chip_select = 1, /* Framework chip select. */ | 131 | .chip_select = 1, /* Framework chip select. */ |
130 | .platform_data = NULL, /* No spi_driver specific config */ | 132 | .platform_data = NULL, /* No spi_driver specific config */ |
131 | .controller_data = &spi_adc_chip_info, | 133 | .controller_data = &spi_adc_chip_info, |
@@ -136,7 +138,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
136 | { | 138 | { |
137 | .modalias = "ad1836-spi", | 139 | .modalias = "ad1836-spi", |
138 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ | 140 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
139 | .bus_num = 1, | 141 | .bus_num = 0, |
140 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, | 142 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, |
141 | .controller_data = &ad1836_spi_chip_info, | 143 | .controller_data = &ad1836_spi_chip_info, |
142 | }, | 144 | }, |
@@ -146,7 +148,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
146 | { | 148 | { |
147 | .modalias = "ad9960-spi", | 149 | .modalias = "ad9960-spi", |
148 | .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ | 150 | .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ |
149 | .bus_num = 1, | 151 | .bus_num = 0, |
150 | .chip_select = 1, | 152 | .chip_select = 1, |
151 | .controller_data = &ad9960_spi_chip_info, | 153 | .controller_data = &ad9960_spi_chip_info, |
152 | }, | 154 | }, |
@@ -156,7 +158,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
156 | { | 158 | { |
157 | .modalias = "spi_mmc_dummy", | 159 | .modalias = "spi_mmc_dummy", |
158 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 160 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
159 | .bus_num = 1, | 161 | .bus_num = 0, |
160 | .chip_select = 7, | 162 | .chip_select = 7, |
161 | .platform_data = NULL, | 163 | .platform_data = NULL, |
162 | .controller_data = &spi_mmc_chip_info, | 164 | .controller_data = &spi_mmc_chip_info, |
@@ -165,7 +167,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
165 | { | 167 | { |
166 | .modalias = "spi_mmc", | 168 | .modalias = "spi_mmc", |
167 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 169 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
168 | .bus_num = 1, | 170 | .bus_num = 0, |
169 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, | 171 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, |
170 | .platform_data = NULL, | 172 | .platform_data = NULL, |
171 | .controller_data = &spi_mmc_chip_info, | 173 | .controller_data = &spi_mmc_chip_info, |
@@ -174,17 +176,33 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
174 | #endif | 176 | #endif |
175 | }; | 177 | }; |
176 | 178 | ||
179 | /* SPI (0) */ | ||
180 | static struct resource bfin_spi0_resource[] = { | ||
181 | [0] = { | ||
182 | .start = SPI0_REGBASE, | ||
183 | .end = SPI0_REGBASE + 0xFF, | ||
184 | .flags = IORESOURCE_MEM, | ||
185 | }, | ||
186 | [1] = { | ||
187 | .start = CH_SPI, | ||
188 | .end = CH_SPI, | ||
189 | .flags = IORESOURCE_IRQ, | ||
190 | } | ||
191 | }; | ||
192 | |||
177 | /* SPI controller data */ | 193 | /* SPI controller data */ |
178 | static struct bfin5xx_spi_master spi_bfin_master_info = { | 194 | static struct bfin5xx_spi_master bfin_spi0_info = { |
179 | .num_chipselect = 8, | 195 | .num_chipselect = 8, |
180 | .enable_dma = 1, /* master has the ability to do dma transfer */ | 196 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
181 | }; | 197 | }; |
182 | 198 | ||
183 | static struct platform_device spi_bfin_master_device = { | 199 | static struct platform_device bfin_spi0_device = { |
184 | .name = "bfin-spi-master", | 200 | .name = "bfin-spi", |
185 | .id = 1, /* Bus number */ | 201 | .id = 0, /* Bus number */ |
202 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), | ||
203 | .resource = bfin_spi0_resource, | ||
186 | .dev = { | 204 | .dev = { |
187 | .platform_data = &spi_bfin_master_info, /* Passed to driver */ | 205 | .platform_data = &bfin_spi0_info, /* Passed to driver */ |
188 | }, | 206 | }, |
189 | }; | 207 | }; |
190 | #endif /* spi master and devices */ | 208 | #endif /* spi master and devices */ |
@@ -316,6 +334,43 @@ static struct platform_device bfin_mac_device = { | |||
316 | }; | 334 | }; |
317 | #endif | 335 | #endif |
318 | 336 | ||
337 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | ||
338 | #define PATA_INT 64 | ||
339 | |||
340 | static struct pata_platform_info bfin_pata_platform_data = { | ||
341 | .ioport_shift = 2, | ||
342 | .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED, | ||
343 | }; | ||
344 | |||
345 | static struct resource bfin_pata_resources[] = { | ||
346 | { | ||
347 | .start = 0x2030C000, | ||
348 | .end = 0x2030C01F, | ||
349 | .flags = IORESOURCE_MEM, | ||
350 | }, | ||
351 | { | ||
352 | .start = 0x2030D018, | ||
353 | .end = 0x2030D01B, | ||
354 | .flags = IORESOURCE_MEM, | ||
355 | }, | ||
356 | { | ||
357 | .start = PATA_INT, | ||
358 | .end = PATA_INT, | ||
359 | .flags = IORESOURCE_IRQ, | ||
360 | }, | ||
361 | }; | ||
362 | |||
363 | static struct platform_device bfin_pata_device = { | ||
364 | .name = "pata_platform", | ||
365 | .id = -1, | ||
366 | .num_resources = ARRAY_SIZE(bfin_pata_resources), | ||
367 | .resource = bfin_pata_resources, | ||
368 | .dev = { | ||
369 | .platform_data = &bfin_pata_platform_data, | ||
370 | } | ||
371 | }; | ||
372 | #endif | ||
373 | |||
319 | static struct platform_device *cm_bf537_devices[] __initdata = { | 374 | static struct platform_device *cm_bf537_devices[] __initdata = { |
320 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | 375 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
321 | &rtc_device, | 376 | &rtc_device, |
@@ -347,7 +402,11 @@ static struct platform_device *cm_bf537_devices[] __initdata = { | |||
347 | #endif | 402 | #endif |
348 | 403 | ||
349 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 404 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
350 | &spi_bfin_master_device, | 405 | &bfin_spi0_device, |
406 | #endif | ||
407 | |||
408 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | ||
409 | &bfin_pata_device, | ||
351 | #endif | 410 | #endif |
352 | }; | 411 | }; |
353 | 412 | ||
@@ -358,6 +417,10 @@ static int __init cm_bf537_init(void) | |||
358 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 417 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
359 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); | 418 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); |
360 | #endif | 419 | #endif |
420 | |||
421 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | ||
422 | irq_desc[PATA_INT].status |= IRQ_NOAUTOEN; | ||
423 | #endif | ||
361 | return 0; | 424 | return 0; |
362 | } | 425 | } |
363 | 426 | ||
diff --git a/arch/blackfin/mach-bf537/boards/generic_board.c b/arch/blackfin/mach-bf537/boards/generic_board.c index 648d984e98d6..5e9d09eb8579 100644 --- a/arch/blackfin/mach-bf537/boards/generic_board.c +++ b/arch/blackfin/mach-bf537/boards/generic_board.c | |||
@@ -8,7 +8,7 @@ | |||
8 | * | 8 | * |
9 | * Modified: | 9 | * Modified: |
10 | * Copyright 2005 National ICT Australia (NICTA) | 10 | * Copyright 2005 National ICT Australia (NICTA) |
11 | * Copyright 2004-2006 Analog Devices Inc. | 11 | * Copyright 2004-2007 Analog Devices Inc. |
12 | * | 12 | * |
13 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | 13 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
14 | * | 14 | * |
@@ -34,20 +34,74 @@ | |||
34 | #include <linux/mtd/partitions.h> | 34 | #include <linux/mtd/partitions.h> |
35 | #include <linux/spi/spi.h> | 35 | #include <linux/spi/spi.h> |
36 | #include <linux/spi/flash.h> | 36 | #include <linux/spi/flash.h> |
37 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) | ||
37 | #include <linux/usb_isp1362.h> | 38 | #include <linux/usb_isp1362.h> |
39 | #endif | ||
40 | #include <linux/pata_platform.h> | ||
38 | #include <linux/irq.h> | 41 | #include <linux/irq.h> |
42 | #include <linux/interrupt.h> | ||
39 | #include <linux/usb_sl811.h> | 43 | #include <linux/usb_sl811.h> |
44 | #include <asm/dma.h> | ||
40 | #include <asm/bfin5xx_spi.h> | 45 | #include <asm/bfin5xx_spi.h> |
46 | #include <asm/reboot.h> | ||
47 | #include <linux/spi/ad7877.h> | ||
41 | 48 | ||
42 | /* | 49 | /* |
43 | * Name the Board for the /proc/cpuinfo | 50 | * Name the Board for the /proc/cpuinfo |
44 | */ | 51 | */ |
45 | char *bfin_board_name = "UNKNOWN BOARD"; | 52 | char *bfin_board_name = "GENERIC Board"; |
46 | 53 | ||
47 | /* | 54 | /* |
48 | * Driver needs to know address, irq and flag pin. | 55 | * Driver needs to know address, irq and flag pin. |
49 | */ | 56 | */ |
50 | 57 | ||
58 | #define ISP1761_BASE 0x203C0000 | ||
59 | #define ISP1761_IRQ IRQ_PF7 | ||
60 | |||
61 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) | ||
62 | static struct resource bfin_isp1761_resources[] = { | ||
63 | [0] = { | ||
64 | .name = "isp1761-regs", | ||
65 | .start = ISP1761_BASE + 0x00000000, | ||
66 | .end = ISP1761_BASE + 0x000fffff, | ||
67 | .flags = IORESOURCE_MEM, | ||
68 | }, | ||
69 | [1] = { | ||
70 | .start = ISP1761_IRQ, | ||
71 | .end = ISP1761_IRQ, | ||
72 | .flags = IORESOURCE_IRQ, | ||
73 | }, | ||
74 | }; | ||
75 | |||
76 | static struct platform_device bfin_isp1761_device = { | ||
77 | .name = "isp1761", | ||
78 | .id = 0, | ||
79 | .num_resources = ARRAY_SIZE(bfin_isp1761_resources), | ||
80 | .resource = bfin_isp1761_resources, | ||
81 | }; | ||
82 | |||
83 | static struct platform_device *bfin_isp1761_devices[] = { | ||
84 | &bfin_isp1761_device, | ||
85 | }; | ||
86 | |||
87 | int __init bfin_isp1761_init(void) | ||
88 | { | ||
89 | unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices); | ||
90 | |||
91 | printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); | ||
92 | set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING); | ||
93 | |||
94 | return platform_add_devices(bfin_isp1761_devices, num_devices); | ||
95 | } | ||
96 | |||
97 | void __exit bfin_isp1761_exit(void) | ||
98 | { | ||
99 | platform_device_unregister(&bfin_isp1761_device); | ||
100 | } | ||
101 | |||
102 | arch_initcall(bfin_isp1761_init); | ||
103 | #endif | ||
104 | |||
51 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) | 105 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) |
52 | static struct resource bfin_pcmcia_cf_resources[] = { | 106 | static struct resource bfin_pcmcia_cf_resources[] = { |
53 | { | 107 | { |
@@ -59,10 +113,6 @@ static struct resource bfin_pcmcia_cf_resources[] = { | |||
59 | .end = 0x20311FFF, | 113 | .end = 0x20311FFF, |
60 | .flags = IORESOURCE_MEM, | 114 | .flags = IORESOURCE_MEM, |
61 | }, { | 115 | }, { |
62 | .start = IRQ_PROG_INTA, | ||
63 | .end = IRQ_PROG_INTA, | ||
64 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, | ||
65 | }, { | ||
66 | .start = IRQ_PF4, | 116 | .start = IRQ_PF4, |
67 | .end = IRQ_PF4, | 117 | .end = IRQ_PF4, |
68 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, | 118 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, |
@@ -96,14 +146,7 @@ static struct resource smc91x_resources[] = { | |||
96 | .end = 0x20300300 + 16, | 146 | .end = 0x20300300 + 16, |
97 | .flags = IORESOURCE_MEM, | 147 | .flags = IORESOURCE_MEM, |
98 | }, { | 148 | }, { |
99 | .start = IRQ_PROG_INTB, | 149 | |
100 | .end = IRQ_PROG_INTB, | ||
101 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
102 | }, { | ||
103 | /* | ||
104 | * denotes the flag pin and is used directly if | ||
105 | * CONFIG_IRQCHIP_DEMUX_GPIO is defined. | ||
106 | */ | ||
107 | .start = IRQ_PF7, | 150 | .start = IRQ_PF7, |
108 | .end = IRQ_PF7, | 151 | .end = IRQ_PF7, |
109 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | 152 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
@@ -117,6 +160,28 @@ static struct platform_device smc91x_device = { | |||
117 | }; | 160 | }; |
118 | #endif | 161 | #endif |
119 | 162 | ||
163 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) | ||
164 | static struct resource dm9000_resources[] = { | ||
165 | [0] = { | ||
166 | .start = 0x203FB800, | ||
167 | .end = 0x203FB800 + 8, | ||
168 | .flags = IORESOURCE_MEM, | ||
169 | }, | ||
170 | [1] = { | ||
171 | .start = IRQ_PF9, | ||
172 | .end = IRQ_PF9, | ||
173 | .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE), | ||
174 | }, | ||
175 | }; | ||
176 | |||
177 | static struct platform_device dm9000_device = { | ||
178 | .name = "dm9000", | ||
179 | .id = -1, | ||
180 | .num_resources = ARRAY_SIZE(dm9000_resources), | ||
181 | .resource = dm9000_resources, | ||
182 | }; | ||
183 | #endif | ||
184 | |||
120 | #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) | 185 | #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) |
121 | static struct resource sl811_hcd_resources[] = { | 186 | static struct resource sl811_hcd_resources[] = { |
122 | { | 187 | { |
@@ -128,12 +193,8 @@ static struct resource sl811_hcd_resources[] = { | |||
128 | .end = 0x20340004, | 193 | .end = 0x20340004, |
129 | .flags = IORESOURCE_MEM, | 194 | .flags = IORESOURCE_MEM, |
130 | }, { | 195 | }, { |
131 | .start = IRQ_PROG_INTA, | 196 | .start = CONFIG_USB_SL811_BFIN_IRQ, |
132 | .end = IRQ_PROG_INTA, | 197 | .end = CONFIG_USB_SL811_BFIN_IRQ, |
133 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
134 | }, { | ||
135 | .start = IRQ_PF0 + CONFIG_USB_SL811_BFIN_GPIO, | ||
136 | .end = IRQ_PF0 + CONFIG_USB_SL811_BFIN_GPIO, | ||
137 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | 198 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
138 | }, | 199 | }, |
139 | }; | 200 | }; |
@@ -141,21 +202,19 @@ static struct resource sl811_hcd_resources[] = { | |||
141 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) | 202 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) |
142 | void sl811_port_power(struct device *dev, int is_on) | 203 | void sl811_port_power(struct device *dev, int is_on) |
143 | { | 204 | { |
144 | unsigned short mask = (1<<CONFIG_USB_SL811_BFIN_GPIO_VBUS); | 205 | gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS"); |
145 | 206 | gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS); | |
146 | bfin_write_PORT_FER(bfin_read_PORT_FER() & ~mask); | ||
147 | bfin_write_FIO_DIR(bfin_read_FIO_DIR() | mask); | ||
148 | 207 | ||
149 | if (is_on) | 208 | if (is_on) |
150 | bfin_write_FIO_FLAG_S(mask); | 209 | gpio_set_value(CONFIG_USB_SL811_BFIN_GPIO_VBUS, 1); |
151 | else | 210 | else |
152 | bfin_write_FIO_FLAG_C(mask); | 211 | gpio_set_value(CONFIG_USB_SL811_BFIN_GPIO_VBUS, 0); |
153 | } | 212 | } |
154 | #endif | 213 | #endif |
155 | 214 | ||
156 | static struct sl811_platform_data sl811_priv = { | 215 | static struct sl811_platform_data sl811_priv = { |
157 | .potpg = 10, | 216 | .potpg = 10, |
158 | .power = 250, /* == 500mA */ | 217 | .power = 250, /* == 500mA */ |
159 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) | 218 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) |
160 | .port_power = &sl811_port_power, | 219 | .port_power = &sl811_port_power, |
161 | #endif | 220 | #endif |
@@ -170,7 +229,6 @@ static struct platform_device sl811_hcd_device = { | |||
170 | .num_resources = ARRAY_SIZE(sl811_hcd_resources), | 229 | .num_resources = ARRAY_SIZE(sl811_hcd_resources), |
171 | .resource = sl811_hcd_resources, | 230 | .resource = sl811_hcd_resources, |
172 | }; | 231 | }; |
173 | |||
174 | #endif | 232 | #endif |
175 | 233 | ||
176 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) | 234 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
@@ -184,13 +242,9 @@ static struct resource isp1362_hcd_resources[] = { | |||
184 | .end = 0x20360004, | 242 | .end = 0x20360004, |
185 | .flags = IORESOURCE_MEM, | 243 | .flags = IORESOURCE_MEM, |
186 | }, { | 244 | }, { |
187 | .start = IRQ_PROG_INTA, | 245 | .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ, |
188 | .end = IRQ_PROG_INTA, | 246 | .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ, |
189 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | 247 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
190 | }, { | ||
191 | .start = IRQ_PF0 + CONFIG_USB_ISP1362_BFIN_GPIO, | ||
192 | .end = IRQ_PF0 + CONFIG_USB_ISP1362_BFIN_GPIO, | ||
193 | .flags = IORESOURCE_IRQ, | ||
194 | }, | 248 | }, |
195 | }; | 249 | }; |
196 | 250 | ||
@@ -246,7 +300,8 @@ static struct platform_device net2272_bfin_device = { | |||
246 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 300 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
247 | /* all SPI peripherals info goes here */ | 301 | /* all SPI peripherals info goes here */ |
248 | 302 | ||
249 | #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) | 303 | #if defined(CONFIG_MTD_M25P80) \ |
304 | || defined(CONFIG_MTD_M25P80_MODULE) | ||
250 | static struct mtd_partition bfin_spi_flash_partitions[] = { | 305 | static struct mtd_partition bfin_spi_flash_partitions[] = { |
251 | { | 306 | { |
252 | .name = "bootloader", | 307 | .name = "bootloader", |
@@ -302,70 +357,198 @@ static struct bfin5xx_spi_chip ad9960_spi_chip_info = { | |||
302 | }; | 357 | }; |
303 | #endif | 358 | #endif |
304 | 359 | ||
360 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | ||
361 | static struct bfin5xx_spi_chip spi_mmc_chip_info = { | ||
362 | .enable_dma = 1, | ||
363 | .bits_per_word = 8, | ||
364 | }; | ||
365 | #endif | ||
366 | |||
367 | #if defined(CONFIG_PBX) | ||
368 | static struct bfin5xx_spi_chip spi_si3xxx_chip_info = { | ||
369 | .ctl_reg = 0x4, /* send zero */ | ||
370 | .enable_dma = 0, | ||
371 | .bits_per_word = 8, | ||
372 | .cs_change_per_word = 1, | ||
373 | }; | ||
374 | #endif | ||
375 | |||
376 | #if defined(CONFIG_AD5304) || defined(CONFIG_AD5304_MODULE) | ||
377 | static struct bfin5xx_spi_chip ad5304_chip_info = { | ||
378 | .enable_dma = 0, | ||
379 | .bits_per_word = 16, | ||
380 | }; | ||
381 | #endif | ||
382 | |||
383 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) | ||
384 | static struct bfin5xx_spi_chip spi_ad7877_chip_info = { | ||
385 | .enable_dma = 0, | ||
386 | .bits_per_word = 16, | ||
387 | }; | ||
388 | |||
389 | static const struct ad7877_platform_data bfin_ad7877_ts_info = { | ||
390 | .model = 7877, | ||
391 | .vref_delay_usecs = 50, /* internal, no capacitor */ | ||
392 | .x_plate_ohms = 419, | ||
393 | .y_plate_ohms = 486, | ||
394 | .pressure_max = 1000, | ||
395 | .pressure_min = 0, | ||
396 | .stopacq_polarity = 1, | ||
397 | .first_conversion_delay = 3, | ||
398 | .acquisition_time = 1, | ||
399 | .averaging = 1, | ||
400 | .pen_down_acc_interval = 1, | ||
401 | }; | ||
402 | #endif | ||
403 | |||
305 | static struct spi_board_info bfin_spi_board_info[] __initdata = { | 404 | static struct spi_board_info bfin_spi_board_info[] __initdata = { |
306 | #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) | 405 | #if defined(CONFIG_MTD_M25P80) \ |
406 | || defined(CONFIG_MTD_M25P80_MODULE) | ||
307 | { | 407 | { |
308 | /* the modalias must be the same as spi device driver name */ | 408 | /* the modalias must be the same as spi device driver name */ |
309 | .modalias = "m25p80", /* Name of spi_driver for this device */ | 409 | .modalias = "m25p80", /* Name of spi_driver for this device */ |
310 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 410 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
311 | .bus_num = 1, /* Framework bus number */ | 411 | .bus_num = 0, /* Framework bus number */ |
312 | .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL1*/ | 412 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ |
313 | .platform_data = &bfin_spi_flash_data, | 413 | .platform_data = &bfin_spi_flash_data, |
314 | .controller_data = &spi_flash_chip_info, | 414 | .controller_data = &spi_flash_chip_info, |
315 | .mode = SPI_MODE_3, | 415 | .mode = SPI_MODE_3, |
316 | }, | 416 | }, |
317 | #endif | 417 | #endif |
318 | 418 | ||
319 | #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) | 419 | #if defined(CONFIG_SPI_ADC_BF533) \ |
420 | || defined(CONFIG_SPI_ADC_BF533_MODULE) | ||
320 | { | 421 | { |
321 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ | 422 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ |
322 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ | 423 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ |
323 | .bus_num = 1, /* Framework bus number */ | 424 | .bus_num = 0, /* Framework bus number */ |
324 | .chip_select = 1, /* Framework chip select. */ | 425 | .chip_select = 1, /* Framework chip select. */ |
325 | .platform_data = NULL, /* No spi_driver specific config */ | 426 | .platform_data = NULL, /* No spi_driver specific config */ |
326 | .controller_data = &spi_adc_chip_info, | 427 | .controller_data = &spi_adc_chip_info, |
327 | }, | 428 | }, |
328 | #endif | 429 | #endif |
329 | 430 | ||
330 | #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | 431 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ |
432 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | ||
331 | { | 433 | { |
332 | .modalias = "ad1836-spi", | 434 | .modalias = "ad1836-spi", |
333 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ | 435 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
334 | .bus_num = 1, | 436 | .bus_num = 0, |
335 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, | 437 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, |
336 | .controller_data = &ad1836_spi_chip_info, | 438 | .controller_data = &ad1836_spi_chip_info, |
337 | }, | 439 | }, |
338 | #endif | 440 | #endif |
339 | |||
340 | #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) | 441 | #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) |
341 | { | 442 | { |
342 | .modalias = "ad9960-spi", | 443 | .modalias = "ad9960-spi", |
343 | .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ | 444 | .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ |
344 | .bus_num = 1, | 445 | .bus_num = 0, |
345 | .chip_select = 1, | 446 | .chip_select = 1, |
346 | .controller_data = &ad9960_spi_chip_info, | 447 | .controller_data = &ad9960_spi_chip_info, |
347 | }, | 448 | }, |
348 | #endif | 449 | #endif |
450 | #if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) | ||
451 | { | ||
452 | .modalias = "spi_mmc_dummy", | ||
453 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | ||
454 | .bus_num = 0, | ||
455 | .chip_select = 0, | ||
456 | .platform_data = NULL, | ||
457 | .controller_data = &spi_mmc_chip_info, | ||
458 | .mode = SPI_MODE_3, | ||
459 | }, | ||
460 | { | ||
461 | .modalias = "spi_mmc", | ||
462 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | ||
463 | .bus_num = 0, | ||
464 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, | ||
465 | .platform_data = NULL, | ||
466 | .controller_data = &spi_mmc_chip_info, | ||
467 | .mode = SPI_MODE_3, | ||
468 | }, | ||
469 | #endif | ||
470 | #if defined(CONFIG_PBX) | ||
471 | { | ||
472 | .modalias = "fxs-spi", | ||
473 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ | ||
474 | .bus_num = 0, | ||
475 | .chip_select = 8 - CONFIG_J11_JUMPER, | ||
476 | .controller_data = &spi_si3xxx_chip_info, | ||
477 | .mode = SPI_MODE_3, | ||
478 | }, | ||
479 | { | ||
480 | .modalias = "fxo-spi", | ||
481 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ | ||
482 | .bus_num = 0, | ||
483 | .chip_select = 8 - CONFIG_J19_JUMPER, | ||
484 | .controller_data = &spi_si3xxx_chip_info, | ||
485 | .mode = SPI_MODE_3, | ||
486 | }, | ||
487 | #endif | ||
488 | #if defined(CONFIG_AD5304) || defined(CONFIG_AD5304_MODULE) | ||
489 | { | ||
490 | .modalias = "ad5304_spi", | ||
491 | .max_speed_hz = 1250000, /* max spi clock (SCK) speed in HZ */ | ||
492 | .bus_num = 0, | ||
493 | .chip_select = 2, | ||
494 | .platform_data = NULL, | ||
495 | .controller_data = &ad5304_chip_info, | ||
496 | .mode = SPI_MODE_2, | ||
497 | }, | ||
498 | #endif | ||
499 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) | ||
500 | { | ||
501 | .modalias = "ad7877", | ||
502 | .platform_data = &bfin_ad7877_ts_info, | ||
503 | .irq = IRQ_PF6, | ||
504 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ | ||
505 | .bus_num = 1, | ||
506 | .chip_select = 1, | ||
507 | .controller_data = &spi_ad7877_chip_info, | ||
508 | }, | ||
509 | #endif | ||
349 | }; | 510 | }; |
350 | 511 | ||
351 | /* SPI controller data */ | 512 | /* SPI controller data */ |
352 | static struct bfin5xx_spi_master spi_bfin_master_info = { | 513 | static struct bfin5xx_spi_master bfin_spi0_info = { |
353 | .num_chipselect = 8, | 514 | .num_chipselect = 8, |
354 | .enable_dma = 1, /* master has the ability to do dma transfer */ | 515 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
355 | }; | 516 | }; |
356 | 517 | ||
357 | static struct platform_device spi_bfin_master_device = { | 518 | /* SPI (0) */ |
358 | .name = "bfin-spi-master", | 519 | static struct resource bfin_spi0_resource[] = { |
359 | .id = 1, /* Bus number */ | 520 | [0] = { |
521 | .start = SPI0_REGBASE, | ||
522 | .end = SPI0_REGBASE + 0xFF, | ||
523 | .flags = IORESOURCE_MEM, | ||
524 | }, | ||
525 | [1] = { | ||
526 | .start = CH_SPI, | ||
527 | .end = CH_SPI, | ||
528 | .flags = IORESOURCE_IRQ, | ||
529 | }, | ||
530 | }; | ||
531 | |||
532 | static struct platform_device bfin_spi0_device = { | ||
533 | .name = "bfin-spi", | ||
534 | .id = 0, /* Bus number */ | ||
535 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), | ||
536 | .resource = bfin_spi0_resource, | ||
360 | .dev = { | 537 | .dev = { |
361 | .platform_data = &spi_bfin_master_info, /* Passed to driver */ | 538 | .platform_data = &bfin_spi0_info, /* Passed to driver */ |
362 | }, | 539 | }, |
363 | }; | 540 | }; |
364 | #endif /* spi master and devices */ | 541 | #endif /* spi master and devices */ |
365 | 542 | ||
366 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) | 543 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) |
367 | static struct platform_device bfin_fb_device = { | 544 | static struct platform_device bfin_fb_device = { |
368 | .name = "bf537-fb", | 545 | .name = "bf537-lq035", |
546 | }; | ||
547 | #endif | ||
548 | |||
549 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) | ||
550 | static struct platform_device bfin_fb_adv7393_device = { | ||
551 | .name = "bfin-adv7393", | ||
369 | }; | 552 | }; |
370 | #endif | 553 | #endif |
371 | 554 | ||
@@ -390,15 +573,86 @@ static struct platform_device bfin_uart_device = { | |||
390 | }; | 573 | }; |
391 | #endif | 574 | #endif |
392 | 575 | ||
393 | static struct platform_device *stamp_devices[] __initdata = { | 576 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
394 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | 577 | static struct resource bfin_twi0_resource[] = { |
395 | &rtc_device, | 578 | [0] = { |
579 | .start = TWI0_REGBASE, | ||
580 | .end = TWI0_REGBASE + 0xFF, | ||
581 | .flags = IORESOURCE_MEM, | ||
582 | }, | ||
583 | [1] = { | ||
584 | .start = IRQ_TWI, | ||
585 | .end = IRQ_TWI, | ||
586 | .flags = IORESOURCE_IRQ, | ||
587 | }, | ||
588 | }; | ||
589 | |||
590 | static struct platform_device i2c_bfin_twi_device = { | ||
591 | .name = "i2c-bfin-twi", | ||
592 | .id = 0, | ||
593 | .num_resources = ARRAY_SIZE(bfin_twi0_resource), | ||
594 | .resource = bfin_twi0_resource, | ||
595 | }; | ||
596 | #endif | ||
597 | |||
598 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | ||
599 | static struct platform_device bfin_sport0_uart_device = { | ||
600 | .name = "bfin-sport-uart", | ||
601 | .id = 0, | ||
602 | }; | ||
603 | |||
604 | static struct platform_device bfin_sport1_uart_device = { | ||
605 | .name = "bfin-sport-uart", | ||
606 | .id = 1, | ||
607 | }; | ||
608 | #endif | ||
609 | |||
610 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | ||
611 | #define PATA_INT 55 | ||
612 | |||
613 | static struct pata_platform_info bfin_pata_platform_data = { | ||
614 | .ioport_shift = 1, | ||
615 | .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED, | ||
616 | }; | ||
617 | |||
618 | static struct resource bfin_pata_resources[] = { | ||
619 | { | ||
620 | .start = 0x20314020, | ||
621 | .end = 0x2031403F, | ||
622 | .flags = IORESOURCE_MEM, | ||
623 | }, | ||
624 | { | ||
625 | .start = 0x2031401C, | ||
626 | .end = 0x2031401F, | ||
627 | .flags = IORESOURCE_MEM, | ||
628 | }, | ||
629 | { | ||
630 | .start = PATA_INT, | ||
631 | .end = PATA_INT, | ||
632 | .flags = IORESOURCE_IRQ, | ||
633 | }, | ||
634 | }; | ||
635 | |||
636 | static struct platform_device bfin_pata_device = { | ||
637 | .name = "pata_platform", | ||
638 | .id = -1, | ||
639 | .num_resources = ARRAY_SIZE(bfin_pata_resources), | ||
640 | .resource = bfin_pata_resources, | ||
641 | .dev = { | ||
642 | .platform_data = &bfin_pata_platform_data, | ||
643 | } | ||
644 | }; | ||
396 | #endif | 645 | #endif |
397 | 646 | ||
647 | static struct platform_device *stamp_devices[] __initdata = { | ||
398 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) | 648 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) |
399 | &bfin_pcmcia_cf_device, | 649 | &bfin_pcmcia_cf_device, |
400 | #endif | 650 | #endif |
401 | 651 | ||
652 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | ||
653 | &rtc_device, | ||
654 | #endif | ||
655 | |||
402 | #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) | 656 | #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) |
403 | &sl811_hcd_device, | 657 | &sl811_hcd_device, |
404 | #endif | 658 | #endif |
@@ -411,6 +665,10 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
411 | &smc91x_device, | 665 | &smc91x_device, |
412 | #endif | 666 | #endif |
413 | 667 | ||
668 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) | ||
669 | &dm9000_device, | ||
670 | #endif | ||
671 | |||
414 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) | 672 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) |
415 | &bfin_mac_device, | 673 | &bfin_mac_device, |
416 | #endif | 674 | #endif |
@@ -420,16 +678,33 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
420 | #endif | 678 | #endif |
421 | 679 | ||
422 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 680 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
423 | &spi_bfin_master_device, | 681 | &bfin_spi0_device, |
424 | #endif | 682 | #endif |
425 | 683 | ||
426 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) | 684 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) |
427 | &bfin_fb_device, | 685 | &bfin_fb_device, |
428 | #endif | 686 | #endif |
429 | 687 | ||
688 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) | ||
689 | &bfin_fb_adv7393_device, | ||
690 | #endif | ||
691 | |||
430 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 692 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
431 | &bfin_uart_device, | 693 | &bfin_uart_device, |
432 | #endif | 694 | #endif |
695 | |||
696 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) | ||
697 | &i2c_bfin_twi_device, | ||
698 | #endif | ||
699 | |||
700 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | ||
701 | &bfin_sport0_uart_device, | ||
702 | &bfin_sport1_uart_device, | ||
703 | #endif | ||
704 | |||
705 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | ||
706 | &bfin_pata_device, | ||
707 | #endif | ||
433 | }; | 708 | }; |
434 | 709 | ||
435 | static int __init stamp_init(void) | 710 | static int __init stamp_init(void) |
@@ -437,9 +712,21 @@ static int __init stamp_init(void) | |||
437 | printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); | 712 | printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); |
438 | platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); | 713 | platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); |
439 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 714 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
440 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); | 715 | spi_register_board_info(bfin_spi_board_info, |
716 | ARRAY_SIZE(bfin_spi_board_info)); | ||
717 | #endif | ||
718 | |||
719 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | ||
720 | irq_desc[PATA_INT].status |= IRQ_NOAUTOEN; | ||
441 | #endif | 721 | #endif |
442 | return 0; | 722 | return 0; |
443 | } | 723 | } |
444 | 724 | ||
445 | arch_initcall(stamp_init); | 725 | arch_initcall(stamp_init); |
726 | |||
727 | void native_machine_restart(char *cmd) | ||
728 | { | ||
729 | /* workaround reboot hang when booting from SPI */ | ||
730 | if ((bfin_read_SYSCR() & 0x7) == 0x3) | ||
731 | bfin_gpio_reset_spi0_ssel1(); | ||
732 | } | ||
diff --git a/arch/blackfin/mach-bf537/boards/pnav10.c b/arch/blackfin/mach-bf537/boards/pnav10.c index 8806f1230f2d..20507e92a3a4 100644 --- a/arch/blackfin/mach-bf537/boards/pnav10.c +++ b/arch/blackfin/mach-bf537/boards/pnav10.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/usb_isp1362.h> | 38 | #include <linux/usb_isp1362.h> |
39 | #endif | 39 | #endif |
40 | #include <linux/irq.h> | 40 | #include <linux/irq.h> |
41 | #include <asm/dma.h> | ||
41 | #include <asm/bfin5xx_spi.h> | 42 | #include <asm/bfin5xx_spi.h> |
42 | #include <linux/usb_sl811.h> | 43 | #include <linux/usb_sl811.h> |
43 | 44 | ||
@@ -130,15 +131,13 @@ static struct resource sl811_hcd_resources[] = { | |||
130 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) | 131 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) |
131 | void sl811_port_power(struct device *dev, int is_on) | 132 | void sl811_port_power(struct device *dev, int is_on) |
132 | { | 133 | { |
133 | unsigned short mask = (1 << CONFIG_USB_SL811_BFIN_GPIO_VBUS); | 134 | gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS"); |
134 | 135 | gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS); | |
135 | bfin_write_PORT_FER(bfin_read_PORT_FER() & ~mask); | ||
136 | bfin_write_FIO_DIR(bfin_read_FIO_DIR() | mask); | ||
137 | 136 | ||
138 | if (is_on) | 137 | if (is_on) |
139 | bfin_write_FIO_FLAG_S(mask); | 138 | gpio_set_value(CONFIG_USB_SL811_BFIN_GPIO_VBUS, 1); |
140 | else | 139 | else |
141 | bfin_write_FIO_FLAG_C(mask); | 140 | gpio_set_value(CONFIG_USB_SL811_BFIN_GPIO_VBUS, 0); |
142 | } | 141 | } |
143 | #endif | 142 | #endif |
144 | 143 | ||
@@ -323,7 +322,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
323 | /* the modalias must be the same as spi device driver name */ | 322 | /* the modalias must be the same as spi device driver name */ |
324 | .modalias = "m25p80", /* Name of spi_driver for this device */ | 323 | .modalias = "m25p80", /* Name of spi_driver for this device */ |
325 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 324 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
326 | .bus_num = 1, /* Framework bus number */ | 325 | .bus_num = 0, /* Framework bus number */ |
327 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ | 326 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ |
328 | .platform_data = &bfin_spi_flash_data, | 327 | .platform_data = &bfin_spi_flash_data, |
329 | .controller_data = &spi_flash_chip_info, | 328 | .controller_data = &spi_flash_chip_info, |
@@ -336,7 +335,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
336 | { | 335 | { |
337 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ | 336 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ |
338 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ | 337 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ |
339 | .bus_num = 1, /* Framework bus number */ | 338 | .bus_num = 0, /* Framework bus number */ |
340 | .chip_select = 1, /* Framework chip select. */ | 339 | .chip_select = 1, /* Framework chip select. */ |
341 | .platform_data = NULL, /* No spi_driver specific config */ | 340 | .platform_data = NULL, /* No spi_driver specific config */ |
342 | .controller_data = &spi_adc_chip_info, | 341 | .controller_data = &spi_adc_chip_info, |
@@ -348,7 +347,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
348 | { | 347 | { |
349 | .modalias = "ad1836-spi", | 348 | .modalias = "ad1836-spi", |
350 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ | 349 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
351 | .bus_num = 1, | 350 | .bus_num = 0, |
352 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, | 351 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, |
353 | .controller_data = &ad1836_spi_chip_info, | 352 | .controller_data = &ad1836_spi_chip_info, |
354 | }, | 353 | }, |
@@ -357,7 +356,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
357 | { | 356 | { |
358 | .modalias = "ad9960-spi", | 357 | .modalias = "ad9960-spi", |
359 | .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ | 358 | .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ |
360 | .bus_num = 1, | 359 | .bus_num = 0, |
361 | .chip_select = 1, | 360 | .chip_select = 1, |
362 | .controller_data = &ad9960_spi_chip_info, | 361 | .controller_data = &ad9960_spi_chip_info, |
363 | }, | 362 | }, |
@@ -366,7 +365,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
366 | { | 365 | { |
367 | .modalias = "spi_mmc_dummy", | 366 | .modalias = "spi_mmc_dummy", |
368 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 367 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
369 | .bus_num = 1, | 368 | .bus_num = 0, |
370 | .chip_select = 7, | 369 | .chip_select = 7, |
371 | .platform_data = NULL, | 370 | .platform_data = NULL, |
372 | .controller_data = &spi_mmc_chip_info, | 371 | .controller_data = &spi_mmc_chip_info, |
@@ -375,7 +374,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
375 | { | 374 | { |
376 | .modalias = "spi_mmc", | 375 | .modalias = "spi_mmc", |
377 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 376 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
378 | .bus_num = 1, | 377 | .bus_num = 0, |
379 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, | 378 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, |
380 | .platform_data = NULL, | 379 | .platform_data = NULL, |
381 | .controller_data = &spi_mmc_chip_info, | 380 | .controller_data = &spi_mmc_chip_info, |
@@ -396,24 +395,40 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
396 | 395 | ||
397 | }; | 396 | }; |
398 | 397 | ||
398 | /* SPI (0) */ | ||
399 | static struct resource bfin_spi0_resource[] = { | ||
400 | [0] = { | ||
401 | .start = SPI0_REGBASE, | ||
402 | .end = SPI0_REGBASE + 0xFF, | ||
403 | .flags = IORESOURCE_MEM, | ||
404 | }, | ||
405 | [1] = { | ||
406 | .start = CH_SPI, | ||
407 | .end = CH_SPI, | ||
408 | .flags = IORESOURCE_IRQ, | ||
409 | } | ||
410 | }; | ||
411 | |||
399 | /* SPI controller data */ | 412 | /* SPI controller data */ |
400 | static struct bfin5xx_spi_master spi_bfin_master_info = { | 413 | static struct bfin5xx_spi_master bfin_spi0_info = { |
401 | .num_chipselect = 8, | 414 | .num_chipselect = 8, |
402 | .enable_dma = 1, /* master has the ability to do dma transfer */ | 415 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
403 | }; | 416 | }; |
404 | 417 | ||
405 | static struct platform_device spi_bfin_master_device = { | 418 | static struct platform_device bfin_spi0_device = { |
406 | .name = "bfin-spi-master", | 419 | .name = "bfin-spi", |
407 | .id = 1, /* Bus number */ | 420 | .id = 0, /* Bus number */ |
421 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), | ||
422 | .resource = bfin_spi0_resource, | ||
408 | .dev = { | 423 | .dev = { |
409 | .platform_data = &spi_bfin_master_info, /* Passed to driver */ | 424 | .platform_data = &bfin_spi0_info, /* Passed to driver */ |
410 | }, | 425 | }, |
411 | }; | 426 | }; |
412 | #endif /* spi master and devices */ | 427 | #endif /* spi master and devices */ |
413 | 428 | ||
414 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) | 429 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) |
415 | static struct platform_device bfin_fb_device = { | 430 | static struct platform_device bfin_fb_device = { |
416 | .name = "bf537-fb", | 431 | .name = "bf537-lq035", |
417 | }; | 432 | }; |
418 | #endif | 433 | #endif |
419 | 434 | ||
@@ -469,7 +484,7 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
469 | #endif | 484 | #endif |
470 | 485 | ||
471 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 486 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
472 | &spi_bfin_master_device, | 487 | &bfin_spi0_device, |
473 | #endif | 488 | #endif |
474 | 489 | ||
475 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) | 490 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) |
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c index 9c43d7756510..47d7d4a0e73d 100644 --- a/arch/blackfin/mach-bf537/boards/stamp.c +++ b/arch/blackfin/mach-bf537/boards/stamp.c | |||
@@ -37,10 +37,13 @@ | |||
37 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) | 37 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
38 | #include <linux/usb_isp1362.h> | 38 | #include <linux/usb_isp1362.h> |
39 | #endif | 39 | #endif |
40 | #include <linux/pata_platform.h> | ||
40 | #include <linux/irq.h> | 41 | #include <linux/irq.h> |
41 | #include <linux/interrupt.h> | 42 | #include <linux/interrupt.h> |
42 | #include <linux/usb_sl811.h> | 43 | #include <linux/usb_sl811.h> |
44 | #include <asm/dma.h> | ||
43 | #include <asm/bfin5xx_spi.h> | 45 | #include <asm/bfin5xx_spi.h> |
46 | #include <asm/reboot.h> | ||
44 | #include <linux/spi/ad7877.h> | 47 | #include <linux/spi/ad7877.h> |
45 | 48 | ||
46 | /* | 49 | /* |
@@ -199,15 +202,13 @@ static struct resource sl811_hcd_resources[] = { | |||
199 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) | 202 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) |
200 | void sl811_port_power(struct device *dev, int is_on) | 203 | void sl811_port_power(struct device *dev, int is_on) |
201 | { | 204 | { |
202 | unsigned short mask = (1 << CONFIG_USB_SL811_BFIN_GPIO_VBUS); | 205 | gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS"); |
203 | 206 | gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS); | |
204 | bfin_write_PORT_FER(bfin_read_PORT_FER() & ~mask); | ||
205 | bfin_write_FIO_DIR(bfin_read_FIO_DIR() | mask); | ||
206 | 207 | ||
207 | if (is_on) | 208 | if (is_on) |
208 | bfin_write_FIO_FLAG_S(mask); | 209 | gpio_set_value(CONFIG_USB_SL811_BFIN_GPIO_VBUS, 1); |
209 | else | 210 | else |
210 | bfin_write_FIO_FLAG_C(mask); | 211 | gpio_set_value(CONFIG_USB_SL811_BFIN_GPIO_VBUS, 0); |
211 | } | 212 | } |
212 | #endif | 213 | #endif |
213 | 214 | ||
@@ -407,7 +408,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
407 | /* the modalias must be the same as spi device driver name */ | 408 | /* the modalias must be the same as spi device driver name */ |
408 | .modalias = "m25p80", /* Name of spi_driver for this device */ | 409 | .modalias = "m25p80", /* Name of spi_driver for this device */ |
409 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 410 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
410 | .bus_num = 1, /* Framework bus number */ | 411 | .bus_num = 0, /* Framework bus number */ |
411 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ | 412 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ |
412 | .platform_data = &bfin_spi_flash_data, | 413 | .platform_data = &bfin_spi_flash_data, |
413 | .controller_data = &spi_flash_chip_info, | 414 | .controller_data = &spi_flash_chip_info, |
@@ -420,7 +421,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
420 | { | 421 | { |
421 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ | 422 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ |
422 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ | 423 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ |
423 | .bus_num = 1, /* Framework bus number */ | 424 | .bus_num = 0, /* Framework bus number */ |
424 | .chip_select = 1, /* Framework chip select. */ | 425 | .chip_select = 1, /* Framework chip select. */ |
425 | .platform_data = NULL, /* No spi_driver specific config */ | 426 | .platform_data = NULL, /* No spi_driver specific config */ |
426 | .controller_data = &spi_adc_chip_info, | 427 | .controller_data = &spi_adc_chip_info, |
@@ -432,7 +433,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
432 | { | 433 | { |
433 | .modalias = "ad1836-spi", | 434 | .modalias = "ad1836-spi", |
434 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ | 435 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
435 | .bus_num = 1, | 436 | .bus_num = 0, |
436 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, | 437 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, |
437 | .controller_data = &ad1836_spi_chip_info, | 438 | .controller_data = &ad1836_spi_chip_info, |
438 | }, | 439 | }, |
@@ -441,7 +442,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
441 | { | 442 | { |
442 | .modalias = "ad9960-spi", | 443 | .modalias = "ad9960-spi", |
443 | .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ | 444 | .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ |
444 | .bus_num = 1, | 445 | .bus_num = 0, |
445 | .chip_select = 1, | 446 | .chip_select = 1, |
446 | .controller_data = &ad9960_spi_chip_info, | 447 | .controller_data = &ad9960_spi_chip_info, |
447 | }, | 448 | }, |
@@ -450,7 +451,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
450 | { | 451 | { |
451 | .modalias = "spi_mmc_dummy", | 452 | .modalias = "spi_mmc_dummy", |
452 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 453 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
453 | .bus_num = 1, | 454 | .bus_num = 0, |
454 | .chip_select = 0, | 455 | .chip_select = 0, |
455 | .platform_data = NULL, | 456 | .platform_data = NULL, |
456 | .controller_data = &spi_mmc_chip_info, | 457 | .controller_data = &spi_mmc_chip_info, |
@@ -459,7 +460,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
459 | { | 460 | { |
460 | .modalias = "spi_mmc", | 461 | .modalias = "spi_mmc", |
461 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 462 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
462 | .bus_num = 1, | 463 | .bus_num = 0, |
463 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, | 464 | .chip_select = CONFIG_SPI_MMC_CS_CHAN, |
464 | .platform_data = NULL, | 465 | .platform_data = NULL, |
465 | .controller_data = &spi_mmc_chip_info, | 466 | .controller_data = &spi_mmc_chip_info, |
@@ -470,16 +471,16 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
470 | { | 471 | { |
471 | .modalias = "fxs-spi", | 472 | .modalias = "fxs-spi", |
472 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ | 473 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ |
473 | .bus_num = 1, | 474 | .bus_num = 0, |
474 | .chip_select = 3, | 475 | .chip_select = 8 - CONFIG_J11_JUMPER, |
475 | .controller_data = &spi_si3xxx_chip_info, | 476 | .controller_data = &spi_si3xxx_chip_info, |
476 | .mode = SPI_MODE_3, | 477 | .mode = SPI_MODE_3, |
477 | }, | 478 | }, |
478 | { | 479 | { |
479 | .modalias = "fxo-spi", | 480 | .modalias = "fxo-spi", |
480 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ | 481 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ |
481 | .bus_num = 1, | 482 | .bus_num = 0, |
482 | .chip_select = 2, | 483 | .chip_select = 8 - CONFIG_J19_JUMPER, |
483 | .controller_data = &spi_si3xxx_chip_info, | 484 | .controller_data = &spi_si3xxx_chip_info, |
484 | .mode = SPI_MODE_3, | 485 | .mode = SPI_MODE_3, |
485 | }, | 486 | }, |
@@ -488,7 +489,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
488 | { | 489 | { |
489 | .modalias = "ad5304_spi", | 490 | .modalias = "ad5304_spi", |
490 | .max_speed_hz = 1250000, /* max spi clock (SCK) speed in HZ */ | 491 | .max_speed_hz = 1250000, /* max spi clock (SCK) speed in HZ */ |
491 | .bus_num = 1, | 492 | .bus_num = 0, |
492 | .chip_select = 2, | 493 | .chip_select = 2, |
493 | .platform_data = NULL, | 494 | .platform_data = NULL, |
494 | .controller_data = &ad5304_chip_info, | 495 | .controller_data = &ad5304_chip_info, |
@@ -509,23 +510,45 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
509 | }; | 510 | }; |
510 | 511 | ||
511 | /* SPI controller data */ | 512 | /* SPI controller data */ |
512 | static struct bfin5xx_spi_master spi_bfin_master_info = { | 513 | static struct bfin5xx_spi_master bfin_spi0_info = { |
513 | .num_chipselect = 8, | 514 | .num_chipselect = 8, |
514 | .enable_dma = 1, /* master has the ability to do dma transfer */ | 515 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
515 | }; | 516 | }; |
516 | 517 | ||
517 | static struct platform_device spi_bfin_master_device = { | 518 | /* SPI (0) */ |
518 | .name = "bfin-spi-master", | 519 | static struct resource bfin_spi0_resource[] = { |
519 | .id = 1, /* Bus number */ | 520 | [0] = { |
521 | .start = SPI0_REGBASE, | ||
522 | .end = SPI0_REGBASE + 0xFF, | ||
523 | .flags = IORESOURCE_MEM, | ||
524 | }, | ||
525 | [1] = { | ||
526 | .start = CH_SPI, | ||
527 | .end = CH_SPI, | ||
528 | .flags = IORESOURCE_IRQ, | ||
529 | }, | ||
530 | }; | ||
531 | |||
532 | static struct platform_device bfin_spi0_device = { | ||
533 | .name = "bfin-spi", | ||
534 | .id = 0, /* Bus number */ | ||
535 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), | ||
536 | .resource = bfin_spi0_resource, | ||
520 | .dev = { | 537 | .dev = { |
521 | .platform_data = &spi_bfin_master_info, /* Passed to driver */ | 538 | .platform_data = &bfin_spi0_info, /* Passed to driver */ |
522 | }, | 539 | }, |
523 | }; | 540 | }; |
524 | #endif /* spi master and devices */ | 541 | #endif /* spi master and devices */ |
525 | 542 | ||
526 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) | 543 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) |
527 | static struct platform_device bfin_fb_device = { | 544 | static struct platform_device bfin_fb_device = { |
528 | .name = "bf537-fb", | 545 | .name = "bf537-lq035", |
546 | }; | ||
547 | #endif | ||
548 | |||
549 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) | ||
550 | static struct platform_device bfin_fb_adv7393_device = { | ||
551 | .name = "bfin-adv7393", | ||
529 | }; | 552 | }; |
530 | #endif | 553 | #endif |
531 | 554 | ||
@@ -551,9 +574,24 @@ static struct platform_device bfin_uart_device = { | |||
551 | #endif | 574 | #endif |
552 | 575 | ||
553 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) | 576 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
577 | static struct resource bfin_twi0_resource[] = { | ||
578 | [0] = { | ||
579 | .start = TWI0_REGBASE, | ||
580 | .end = TWI0_REGBASE, | ||
581 | .flags = IORESOURCE_MEM, | ||
582 | }, | ||
583 | [1] = { | ||
584 | .start = IRQ_TWI, | ||
585 | .end = IRQ_TWI, | ||
586 | .flags = IORESOURCE_IRQ, | ||
587 | }, | ||
588 | }; | ||
589 | |||
554 | static struct platform_device i2c_bfin_twi_device = { | 590 | static struct platform_device i2c_bfin_twi_device = { |
555 | .name = "i2c-bfin-twi", | 591 | .name = "i2c-bfin-twi", |
556 | .id = 0, | 592 | .id = 0, |
593 | .num_resources = ARRAY_SIZE(bfin_twi0_resource), | ||
594 | .resource = bfin_twi0_resource, | ||
557 | }; | 595 | }; |
558 | #endif | 596 | #endif |
559 | 597 | ||
@@ -569,6 +607,43 @@ static struct platform_device bfin_sport1_uart_device = { | |||
569 | }; | 607 | }; |
570 | #endif | 608 | #endif |
571 | 609 | ||
610 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | ||
611 | #define PATA_INT 55 | ||
612 | |||
613 | static struct pata_platform_info bfin_pata_platform_data = { | ||
614 | .ioport_shift = 1, | ||
615 | .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED, | ||
616 | }; | ||
617 | |||
618 | static struct resource bfin_pata_resources[] = { | ||
619 | { | ||
620 | .start = 0x20314020, | ||
621 | .end = 0x2031403F, | ||
622 | .flags = IORESOURCE_MEM, | ||
623 | }, | ||
624 | { | ||
625 | .start = 0x2031401C, | ||
626 | .end = 0x2031401F, | ||
627 | .flags = IORESOURCE_MEM, | ||
628 | }, | ||
629 | { | ||
630 | .start = PATA_INT, | ||
631 | .end = PATA_INT, | ||
632 | .flags = IORESOURCE_IRQ, | ||
633 | }, | ||
634 | }; | ||
635 | |||
636 | static struct platform_device bfin_pata_device = { | ||
637 | .name = "pata_platform", | ||
638 | .id = -1, | ||
639 | .num_resources = ARRAY_SIZE(bfin_pata_resources), | ||
640 | .resource = bfin_pata_resources, | ||
641 | .dev = { | ||
642 | .platform_data = &bfin_pata_platform_data, | ||
643 | } | ||
644 | }; | ||
645 | #endif | ||
646 | |||
572 | static struct platform_device *stamp_devices[] __initdata = { | 647 | static struct platform_device *stamp_devices[] __initdata = { |
573 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) | 648 | #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) |
574 | &bfin_pcmcia_cf_device, | 649 | &bfin_pcmcia_cf_device, |
@@ -603,13 +678,17 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
603 | #endif | 678 | #endif |
604 | 679 | ||
605 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 680 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
606 | &spi_bfin_master_device, | 681 | &bfin_spi0_device, |
607 | #endif | 682 | #endif |
608 | 683 | ||
609 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) | 684 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) |
610 | &bfin_fb_device, | 685 | &bfin_fb_device, |
611 | #endif | 686 | #endif |
612 | 687 | ||
688 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) | ||
689 | &bfin_fb_adv7393_device, | ||
690 | #endif | ||
691 | |||
613 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 692 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
614 | &bfin_uart_device, | 693 | &bfin_uart_device, |
615 | #endif | 694 | #endif |
@@ -622,6 +701,10 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
622 | &bfin_sport0_uart_device, | 701 | &bfin_sport0_uart_device, |
623 | &bfin_sport1_uart_device, | 702 | &bfin_sport1_uart_device, |
624 | #endif | 703 | #endif |
704 | |||
705 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | ||
706 | &bfin_pata_device, | ||
707 | #endif | ||
625 | }; | 708 | }; |
626 | 709 | ||
627 | static int __init stamp_init(void) | 710 | static int __init stamp_init(void) |
@@ -632,7 +715,18 @@ static int __init stamp_init(void) | |||
632 | spi_register_board_info(bfin_spi_board_info, | 715 | spi_register_board_info(bfin_spi_board_info, |
633 | ARRAY_SIZE(bfin_spi_board_info)); | 716 | ARRAY_SIZE(bfin_spi_board_info)); |
634 | #endif | 717 | #endif |
718 | |||
719 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | ||
720 | irq_desc[PATA_INT].status |= IRQ_NOAUTOEN; | ||
721 | #endif | ||
635 | return 0; | 722 | return 0; |
636 | } | 723 | } |
637 | 724 | ||
638 | arch_initcall(stamp_init); | 725 | arch_initcall(stamp_init); |
726 | |||
727 | void native_machine_restart(char *cmd) | ||
728 | { | ||
729 | /* workaround reboot hang when booting from SPI */ | ||
730 | if ((bfin_read_SYSCR() & 0x7) == 0x3) | ||
731 | bfin_gpio_reset_spi0_ssel1(); | ||
732 | } | ||