diff options
Diffstat (limited to 'arch/blackfin/mach-bf533')
-rw-r--r-- | arch/blackfin/mach-bf533/Kconfig | 92 | ||||
-rw-r--r-- | arch/blackfin/mach-bf533/Makefile | 9 | ||||
-rw-r--r-- | arch/blackfin/mach-bf533/boards/Makefile | 8 | ||||
-rw-r--r-- | arch/blackfin/mach-bf533/boards/cm_bf533.c | 267 | ||||
-rw-r--r-- | arch/blackfin/mach-bf533/boards/ezkit.c | 224 | ||||
-rw-r--r-- | arch/blackfin/mach-bf533/boards/generic_board.c | 95 | ||||
-rw-r--r-- | arch/blackfin/mach-bf533/boards/stamp.c | 321 | ||||
-rw-r--r-- | arch/blackfin/mach-bf533/cpu.c | 161 | ||||
-rw-r--r-- | arch/blackfin/mach-bf533/head.S | 774 | ||||
-rw-r--r-- | arch/blackfin/mach-bf533/ints-priority.c | 65 |
10 files changed, 2016 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf533/Kconfig b/arch/blackfin/mach-bf533/Kconfig new file mode 100644 index 000000000000..14297b3ed5c3 --- /dev/null +++ b/arch/blackfin/mach-bf533/Kconfig | |||
@@ -0,0 +1,92 @@ | |||
1 | if (BF533 || BF532 || BF531) | ||
2 | |||
3 | menu "BF533/2/1 Specific Configuration" | ||
4 | |||
5 | comment "Interrupt Priority Assignment" | ||
6 | menu "Priority" | ||
7 | |||
8 | config UART_ERROR | ||
9 | int "UART ERROR" | ||
10 | default 7 | ||
11 | config SPORT0_ERROR | ||
12 | int "SPORT0 ERROR" | ||
13 | default 7 | ||
14 | config SPI_ERROR | ||
15 | int "SPI ERROR" | ||
16 | default 7 | ||
17 | config SPORT1_ERROR | ||
18 | int "SPORT1 ERROR" | ||
19 | default 7 | ||
20 | config PPI_ERROR | ||
21 | int "PPI ERROR" | ||
22 | default 7 | ||
23 | config DMA_ERROR | ||
24 | int "DMA ERROR" | ||
25 | default 7 | ||
26 | config PLLWAKE_ERROR | ||
27 | int "PLL WAKEUP ERROR" | ||
28 | default 7 | ||
29 | |||
30 | config RTC_ERROR | ||
31 | int "RTC ERROR" | ||
32 | default 8 | ||
33 | config DMA0_PPI | ||
34 | int "DMA0 PPI" | ||
35 | default 8 | ||
36 | |||
37 | config DMA1_SPORT0RX | ||
38 | int "DMA1 (SPORT0 RX)" | ||
39 | default 9 | ||
40 | config DMA2_SPORT0TX | ||
41 | int "DMA2 (SPORT0 TX)" | ||
42 | default 9 | ||
43 | config DMA3_SPORT1RX | ||
44 | int "DMA3 (SPORT1 RX)" | ||
45 | default 9 | ||
46 | config DMA4_SPORT1TX | ||
47 | int "DMA4 (SPORT1 TX)" | ||
48 | default 9 | ||
49 | config DMA5_SPI | ||
50 | int "DMA5 (SPI)" | ||
51 | default 10 | ||
52 | config DMA6_UARTRX | ||
53 | int "DMA6 (UART0 RX)" | ||
54 | default 10 | ||
55 | config DMA7_UARTTX | ||
56 | int "DMA7 (UART0 TX)" | ||
57 | default 10 | ||
58 | config TIMER0 | ||
59 | int "TIMER0" | ||
60 | default 11 | ||
61 | config TIMER1 | ||
62 | int "TIMER1" | ||
63 | default 11 | ||
64 | config TIMER2 | ||
65 | int "TIMER2" | ||
66 | default 11 | ||
67 | config PFA | ||
68 | int "PF Interrupt A" | ||
69 | default 12 | ||
70 | config PFB | ||
71 | int "PF Interrupt B" | ||
72 | default 12 | ||
73 | config MEMDMA0 | ||
74 | int "MEMORY DMA0" | ||
75 | default 13 | ||
76 | config MEMDMA1 | ||
77 | int "MEMORY DMA1" | ||
78 | default 13 | ||
79 | config WDTIMER | ||
80 | int "WATCH DOG TIMER" | ||
81 | default 13 | ||
82 | |||
83 | help | ||
84 | Enter the priority numbers between 7-13 ONLY. Others are Reserved. | ||
85 | This applies to all the above. It is not recommended to assign the | ||
86 | highest priority number 7 to UART or any other device. | ||
87 | |||
88 | endmenu | ||
89 | |||
90 | endmenu | ||
91 | |||
92 | endif | ||
diff --git a/arch/blackfin/mach-bf533/Makefile b/arch/blackfin/mach-bf533/Makefile new file mode 100644 index 000000000000..76d2c2b8579a --- /dev/null +++ b/arch/blackfin/mach-bf533/Makefile | |||
@@ -0,0 +1,9 @@ | |||
1 | # | ||
2 | # arch/blackfin/mach-bf533/Makefile | ||
3 | # | ||
4 | |||
5 | extra-y := head.o | ||
6 | |||
7 | obj-y := ints-priority.o | ||
8 | |||
9 | obj-$(CONFIG_CPU_FREQ_BF533) += cpu.o | ||
diff --git a/arch/blackfin/mach-bf533/boards/Makefile b/arch/blackfin/mach-bf533/boards/Makefile new file mode 100644 index 000000000000..12a631ab389d --- /dev/null +++ b/arch/blackfin/mach-bf533/boards/Makefile | |||
@@ -0,0 +1,8 @@ | |||
1 | # | ||
2 | # arch/blackfin/mach-bf533/boards/Makefile | ||
3 | # | ||
4 | |||
5 | obj-$(CONFIG_GENERIC_BOARD) += generic_board.o | ||
6 | obj-$(CONFIG_BFIN533_STAMP) += stamp.o | ||
7 | obj-$(CONFIG_BFIN533_EZKIT) += ezkit.o | ||
8 | obj-$(CONFIG_BFIN533_BLUETECHNIX_CM) += cm_bf533.o | ||
diff --git a/arch/blackfin/mach-bf533/boards/cm_bf533.c b/arch/blackfin/mach-bf533/boards/cm_bf533.c new file mode 100644 index 000000000000..23a7f607df3f --- /dev/null +++ b/arch/blackfin/mach-bf533/boards/cm_bf533.c | |||
@@ -0,0 +1,267 @@ | |||
1 | /* | ||
2 | * File: arch/blackfin/mach-bf533/boards/cm_bf533.c | ||
3 | * Based on: arch/blackfin/mach-bf533/boards/ezkit.c | ||
4 | * Author: Aidan Williams <aidan@nicta.com.au> Copright 2005 | ||
5 | * | ||
6 | * Created: 2005 | ||
7 | * Description: Board description file | ||
8 | * | ||
9 | * Modified: | ||
10 | * Copyright 2004-2006 Analog Devices Inc. | ||
11 | * | ||
12 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or modify | ||
15 | * it under the terms of the GNU General Public License as published by | ||
16 | * the Free Software Foundation; either version 2 of the License, or | ||
17 | * (at your option) any later version. | ||
18 | * | ||
19 | * This program is distributed in the hope that it will be useful, | ||
20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
22 | * GNU General Public License for more details. | ||
23 | * | ||
24 | * You should have received a copy of the GNU General Public License | ||
25 | * along with this program; if not, see the file COPYING, or write | ||
26 | * to the Free Software Foundation, Inc., | ||
27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
28 | */ | ||
29 | |||
30 | #include <linux/device.h> | ||
31 | #include <linux/platform_device.h> | ||
32 | #include <linux/mtd/mtd.h> | ||
33 | #include <linux/mtd/partitions.h> | ||
34 | #include <linux/spi/spi.h> | ||
35 | #include <linux/spi/flash.h> | ||
36 | #include <linux/usb_isp1362.h> | ||
37 | #include <asm/irq.h> | ||
38 | #include <asm/bfin5xx_spi.h> | ||
39 | |||
40 | /* | ||
41 | * Name the Board for the /proc/cpuinfo | ||
42 | */ | ||
43 | char *bfin_board_name = "Bluetechnix CM BF533"; | ||
44 | |||
45 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | ||
46 | /* all SPI peripherals info goes here */ | ||
47 | |||
48 | static struct mtd_partition bfin_spi_flash_partitions[] = { | ||
49 | { | ||
50 | .name = "bootloader", | ||
51 | .size = 0x00020000, | ||
52 | .offset = 0, | ||
53 | .mask_flags = MTD_CAP_ROM | ||
54 | },{ | ||
55 | .name = "kernel", | ||
56 | .size = 0xe0000, | ||
57 | .offset = 0x20000 | ||
58 | },{ | ||
59 | .name = "file system", | ||
60 | .size = 0x700000, | ||
61 | .offset = 0x00100000, | ||
62 | } | ||
63 | }; | ||
64 | |||
65 | static struct flash_platform_data bfin_spi_flash_data = { | ||
66 | .name = "m25p80", | ||
67 | .parts = bfin_spi_flash_partitions, | ||
68 | .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions), | ||
69 | .type = "m25p64", | ||
70 | }; | ||
71 | |||
72 | /* SPI flash chip (m25p64) */ | ||
73 | static struct bfin5xx_spi_chip spi_flash_chip_info = { | ||
74 | .enable_dma = 0, /* use dma transfer with this chip*/ | ||
75 | .bits_per_word = 8, | ||
76 | }; | ||
77 | |||
78 | /* SPI ADC chip */ | ||
79 | static struct bfin5xx_spi_chip spi_adc_chip_info = { | ||
80 | .enable_dma = 1, /* use dma transfer with this chip*/ | ||
81 | .bits_per_word = 16, | ||
82 | }; | ||
83 | |||
84 | #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | ||
85 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { | ||
86 | .enable_dma = 0, | ||
87 | .bits_per_word = 16, | ||
88 | }; | ||
89 | #endif | ||
90 | |||
91 | static struct spi_board_info bfin_spi_board_info[] __initdata = { | ||
92 | { | ||
93 | /* the modalias must be the same as spi device driver name */ | ||
94 | .modalias = "m25p80", /* Name of spi_driver for this device */ | ||
95 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | ||
96 | .bus_num = 1, /* Framework bus number */ | ||
97 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ | ||
98 | .platform_data = &bfin_spi_flash_data, | ||
99 | .controller_data = &spi_flash_chip_info, | ||
100 | .mode = SPI_MODE_3, | ||
101 | },{ | ||
102 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ | ||
103 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ | ||
104 | .bus_num = 1, /* Framework bus number */ | ||
105 | .chip_select = 2, /* Framework chip select. */ | ||
106 | .platform_data = NULL, /* No spi_driver specific config */ | ||
107 | .controller_data = &spi_adc_chip_info, | ||
108 | }, | ||
109 | #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | ||
110 | { | ||
111 | .modalias = "ad1836-spi", | ||
112 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ | ||
113 | .bus_num = 1, | ||
114 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, | ||
115 | .controller_data = &ad1836_spi_chip_info, | ||
116 | }, | ||
117 | #endif | ||
118 | }; | ||
119 | |||
120 | /* SPI controller data */ | ||
121 | static struct bfin5xx_spi_master spi_bfin_master_info = { | ||
122 | .num_chipselect = 8, | ||
123 | .enable_dma = 1, /* master has the ability to do dma transfer */ | ||
124 | }; | ||
125 | |||
126 | static struct platform_device spi_bfin_master_device = { | ||
127 | .name = "bfin-spi-master", | ||
128 | .id = 1, /* Bus number */ | ||
129 | .dev = { | ||
130 | .platform_data = &spi_bfin_master_info, /* Passed to driver */ | ||
131 | }, | ||
132 | }; | ||
133 | #endif /* spi master and devices */ | ||
134 | |||
135 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | ||
136 | static struct platform_device rtc_device = { | ||
137 | .name = "rtc-bfin", | ||
138 | .id = -1, | ||
139 | }; | ||
140 | #endif | ||
141 | |||
142 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | ||
143 | static struct resource smc91x_resources[] = { | ||
144 | { | ||
145 | .start = 0x20200300, | ||
146 | .end = 0x20200300 + 16, | ||
147 | .flags = IORESOURCE_MEM, | ||
148 | },{ | ||
149 | .start = IRQ_PF0, | ||
150 | .end = IRQ_PF0, | ||
151 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
152 | }, | ||
153 | }; | ||
154 | static struct platform_device smc91x_device = { | ||
155 | .name = "smc91x", | ||
156 | .id = 0, | ||
157 | .num_resources = ARRAY_SIZE(smc91x_resources), | ||
158 | .resource = smc91x_resources, | ||
159 | }; | ||
160 | #endif | ||
161 | |||
162 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | ||
163 | static struct resource bfin_uart_resources[] = { | ||
164 | { | ||
165 | .start = 0xFFC00400, | ||
166 | .end = 0xFFC004FF, | ||
167 | .flags = IORESOURCE_MEM, | ||
168 | }, | ||
169 | }; | ||
170 | |||
171 | static struct platform_device bfin_uart_device = { | ||
172 | .name = "bfin-uart", | ||
173 | .id = 1, | ||
174 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | ||
175 | .resource = bfin_uart_resources, | ||
176 | }; | ||
177 | #endif | ||
178 | |||
179 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | ||
180 | static struct platform_device bfin_sport0_uart_device = { | ||
181 | .name = "bfin-sport-uart", | ||
182 | .id = 0, | ||
183 | }; | ||
184 | |||
185 | static struct platform_device bfin_sport1_uart_device = { | ||
186 | .name = "bfin-sport-uart", | ||
187 | .id = 1, | ||
188 | }; | ||
189 | #endif | ||
190 | |||
191 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) | ||
192 | static struct resource isp1362_hcd_resources[] = { | ||
193 | { | ||
194 | .start = 0x20308000, | ||
195 | .end = 0x20308000, | ||
196 | .flags = IORESOURCE_MEM, | ||
197 | },{ | ||
198 | .start = 0x20308004, | ||
199 | .end = 0x20308004, | ||
200 | .flags = IORESOURCE_MEM, | ||
201 | },{ | ||
202 | .start = IRQ_PF4, | ||
203 | .end = IRQ_PF4, | ||
204 | .flags = IORESOURCE_IRQ, | ||
205 | }, | ||
206 | }; | ||
207 | |||
208 | static struct isp1362_platform_data isp1362_priv = { | ||
209 | .sel15Kres = 1, | ||
210 | .clknotstop = 0, | ||
211 | .oc_enable = 0, | ||
212 | .int_act_high = 0, | ||
213 | .int_edge_triggered = 0, | ||
214 | .remote_wakeup_connected = 0, | ||
215 | .no_power_switching = 1, | ||
216 | .power_switching_mode = 0, | ||
217 | }; | ||
218 | |||
219 | static struct platform_device isp1362_hcd_device = { | ||
220 | .name = "isp1362-hcd", | ||
221 | .id = 0, | ||
222 | .dev = { | ||
223 | .platform_data = &isp1362_priv, | ||
224 | }, | ||
225 | .num_resources = ARRAY_SIZE(isp1362_hcd_resources), | ||
226 | .resource = isp1362_hcd_resources, | ||
227 | }; | ||
228 | #endif | ||
229 | |||
230 | static struct platform_device *cm_bf533_devices[] __initdata = { | ||
231 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | ||
232 | &bfin_uart_device, | ||
233 | #endif | ||
234 | |||
235 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | ||
236 | &bfin_sport0_uart_device, | ||
237 | &bfin_sport1_uart_device, | ||
238 | #endif | ||
239 | |||
240 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | ||
241 | &rtc_device, | ||
242 | #endif | ||
243 | |||
244 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) | ||
245 | &isp1362_hcd_device, | ||
246 | #endif | ||
247 | |||
248 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | ||
249 | &smc91x_device, | ||
250 | #endif | ||
251 | |||
252 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | ||
253 | &spi_bfin_master_device, | ||
254 | #endif | ||
255 | }; | ||
256 | |||
257 | static int __init cm_bf533_init(void) | ||
258 | { | ||
259 | printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); | ||
260 | platform_add_devices(cm_bf533_devices, ARRAY_SIZE(cm_bf533_devices)); | ||
261 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | ||
262 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); | ||
263 | #endif | ||
264 | return 0; | ||
265 | } | ||
266 | |||
267 | arch_initcall(cm_bf533_init); | ||
diff --git a/arch/blackfin/mach-bf533/boards/ezkit.c b/arch/blackfin/mach-bf533/boards/ezkit.c new file mode 100644 index 000000000000..747298ea907b --- /dev/null +++ b/arch/blackfin/mach-bf533/boards/ezkit.c | |||
@@ -0,0 +1,224 @@ | |||
1 | /* | ||
2 | * File: arch/blackfin/mach-bf533/ezkit.c | ||
3 | * Based on: Orginal Work | ||
4 | * Author: Aidan Williams <aidan@nicta.com.au> | ||
5 | * | ||
6 | * Created: 2005 | ||
7 | * Description: | ||
8 | * | ||
9 | * Modified: Robin Getz <rgetz@blackfin.uclinux.org> - Named the boards | ||
10 | * Copyright 2005 National ICT Australia (NICTA) | ||
11 | * Copyright 2004-2006 Analog Devices Inc. | ||
12 | * | ||
13 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or modify | ||
16 | * it under the terms of the GNU General Public License as published by | ||
17 | * the Free Software Foundation; either version 2 of the License, or | ||
18 | * (at your option) any later version. | ||
19 | * | ||
20 | * This program is distributed in the hope that it will be useful, | ||
21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
23 | * GNU General Public License for more details. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License | ||
26 | * along with this program; if not, see the file COPYING, or write | ||
27 | * to the Free Software Foundation, Inc., | ||
28 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
29 | */ | ||
30 | |||
31 | #include <linux/device.h> | ||
32 | #include <linux/platform_device.h> | ||
33 | #include <linux/mtd/mtd.h> | ||
34 | #include <linux/mtd/partitions.h> | ||
35 | #include <linux/spi/spi.h> | ||
36 | #include <linux/spi/flash.h> | ||
37 | #include <linux/usb_isp1362.h> | ||
38 | #include <asm/irq.h> | ||
39 | #include <asm/bfin5xx_spi.h> | ||
40 | |||
41 | /* | ||
42 | * Name the Board for the /proc/cpuinfo | ||
43 | */ | ||
44 | char *bfin_board_name = "ADDS-BF533-EZKIT"; | ||
45 | |||
46 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | ||
47 | static struct platform_device rtc_device = { | ||
48 | .name = "rtc-bfin", | ||
49 | .id = -1, | ||
50 | }; | ||
51 | #endif | ||
52 | |||
53 | /* | ||
54 | * USB-LAN EzExtender board | ||
55 | * Driver needs to know address, irq and flag pin. | ||
56 | */ | ||
57 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | ||
58 | static struct resource smc91x_resources[] = { | ||
59 | { | ||
60 | .name = "smc91x-regs", | ||
61 | .start = 0x20310300, | ||
62 | .end = 0x20310300 + 16, | ||
63 | .flags = IORESOURCE_MEM, | ||
64 | },{ | ||
65 | .start = IRQ_PF9, | ||
66 | .end = IRQ_PF9, | ||
67 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
68 | }, | ||
69 | }; | ||
70 | static struct platform_device smc91x_device = { | ||
71 | .name = "smc91x", | ||
72 | .id = 0, | ||
73 | .num_resources = ARRAY_SIZE(smc91x_resources), | ||
74 | .resource = smc91x_resources, | ||
75 | }; | ||
76 | #endif | ||
77 | |||
78 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | ||
79 | /* all SPI peripherals info goes here */ | ||
80 | |||
81 | #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) | ||
82 | static struct mtd_partition bfin_spi_flash_partitions[] = { | ||
83 | { | ||
84 | .name = "bootloader", | ||
85 | .size = 0x00020000, | ||
86 | .offset = 0, | ||
87 | .mask_flags = MTD_CAP_ROM | ||
88 | },{ | ||
89 | .name = "kernel", | ||
90 | .size = 0xe0000, | ||
91 | .offset = 0x20000 | ||
92 | },{ | ||
93 | .name = "file system", | ||
94 | .size = 0x700000, | ||
95 | .offset = 0x00100000, | ||
96 | } | ||
97 | }; | ||
98 | |||
99 | static struct flash_platform_data bfin_spi_flash_data = { | ||
100 | .name = "m25p80", | ||
101 | .parts = bfin_spi_flash_partitions, | ||
102 | .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions), | ||
103 | .type = "m25p64", | ||
104 | }; | ||
105 | |||
106 | /* SPI flash chip (m25p64) */ | ||
107 | static struct bfin5xx_spi_chip spi_flash_chip_info = { | ||
108 | .enable_dma = 0, /* use dma transfer with this chip*/ | ||
109 | .bits_per_word = 8, | ||
110 | }; | ||
111 | #endif | ||
112 | |||
113 | #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) | ||
114 | /* SPI ADC chip */ | ||
115 | static struct bfin5xx_spi_chip spi_adc_chip_info = { | ||
116 | .enable_dma = 1, /* use dma transfer with this chip*/ | ||
117 | .bits_per_word = 16, | ||
118 | }; | ||
119 | #endif | ||
120 | |||
121 | #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | ||
122 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { | ||
123 | .enable_dma = 0, | ||
124 | .bits_per_word = 16, | ||
125 | }; | ||
126 | #endif | ||
127 | |||
128 | static struct spi_board_info bfin_spi_board_info[] __initdata = { | ||
129 | #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) | ||
130 | { | ||
131 | /* the modalias must be the same as spi device driver name */ | ||
132 | .modalias = "m25p80", /* Name of spi_driver for this device */ | ||
133 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | ||
134 | .bus_num = 1, /* Framework bus number */ | ||
135 | .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/ | ||
136 | .platform_data = &bfin_spi_flash_data, | ||
137 | .controller_data = &spi_flash_chip_info, | ||
138 | .mode = SPI_MODE_3, | ||
139 | }, | ||
140 | #endif | ||
141 | |||
142 | #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) | ||
143 | { | ||
144 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ | ||
145 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ | ||
146 | .bus_num = 1, /* Framework bus number */ | ||
147 | .chip_select = 1, /* Framework chip select. */ | ||
148 | .platform_data = NULL, /* No spi_driver specific config */ | ||
149 | .controller_data = &spi_adc_chip_info, | ||
150 | }, | ||
151 | #endif | ||
152 | |||
153 | #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | ||
154 | { | ||
155 | .modalias = "ad1836-spi", | ||
156 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ | ||
157 | .bus_num = 1, | ||
158 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, | ||
159 | .controller_data = &ad1836_spi_chip_info, | ||
160 | }, | ||
161 | #endif | ||
162 | }; | ||
163 | |||
164 | /* SPI controller data */ | ||
165 | static struct bfin5xx_spi_master spi_bfin_master_info = { | ||
166 | .num_chipselect = 8, | ||
167 | .enable_dma = 1, /* master has the ability to do dma transfer */ | ||
168 | }; | ||
169 | |||
170 | static struct platform_device spi_bfin_master_device = { | ||
171 | .name = "bfin-spi-master", | ||
172 | .id = 1, /* Bus number */ | ||
173 | .dev = { | ||
174 | .platform_data = &spi_bfin_master_info, /* Passed to driver */ | ||
175 | }, | ||
176 | }; | ||
177 | #endif /* spi master and devices */ | ||
178 | |||
179 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | ||
180 | static struct resource bfin_uart_resources[] = { | ||
181 | { | ||
182 | .start = 0xFFC00400, | ||
183 | .end = 0xFFC004FF, | ||
184 | .flags = IORESOURCE_MEM, | ||
185 | }, | ||
186 | }; | ||
187 | |||
188 | static struct platform_device bfin_uart_device = { | ||
189 | .name = "bfin-uart", | ||
190 | .id = 1, | ||
191 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | ||
192 | .resource = bfin_uart_resources, | ||
193 | }; | ||
194 | #endif | ||
195 | |||
196 | static struct platform_device *ezkit_devices[] __initdata = { | ||
197 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | ||
198 | &smc91x_device, | ||
199 | #endif | ||
200 | |||
201 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | ||
202 | &spi_bfin_master_device, | ||
203 | #endif | ||
204 | |||
205 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | ||
206 | &rtc_device, | ||
207 | #endif | ||
208 | |||
209 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | ||
210 | &bfin_uart_device, | ||
211 | #endif | ||
212 | }; | ||
213 | |||
214 | static int __init ezkit_init(void) | ||
215 | { | ||
216 | printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); | ||
217 | platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices)); | ||
218 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | ||
219 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); | ||
220 | #endif | ||
221 | return 0; | ||
222 | } | ||
223 | |||
224 | arch_initcall(ezkit_init); | ||
diff --git a/arch/blackfin/mach-bf533/boards/generic_board.c b/arch/blackfin/mach-bf533/boards/generic_board.c new file mode 100644 index 000000000000..c0f43ccfbfb5 --- /dev/null +++ b/arch/blackfin/mach-bf533/boards/generic_board.c | |||
@@ -0,0 +1,95 @@ | |||
1 | /* | ||
2 | * File: arch/blackfin/mach-bf533/generic_board.c | ||
3 | * Based on: arch/blackfin/mach-bf533/ezkit.c | ||
4 | * Author: Aidan Williams <aidan@nicta.com.au> | ||
5 | * | ||
6 | * Created: 2005 | ||
7 | * Description: | ||
8 | * | ||
9 | * Modified: | ||
10 | * Copyright 2005 National ICT Australia (NICTA) | ||
11 | * Copyright 2004-2006 Analog Devices Inc. | ||
12 | * | ||
13 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or modify | ||
16 | * it under the terms of the GNU General Public License as published by | ||
17 | * the Free Software Foundation; either version 2 of the License, or | ||
18 | * (at your option) any later version. | ||
19 | * | ||
20 | * This program is distributed in the hope that it will be useful, | ||
21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
23 | * GNU General Public License for more details. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License | ||
26 | * along with this program; if not, see the file COPYING, or write | ||
27 | * to the Free Software Foundation, Inc., | ||
28 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
29 | */ | ||
30 | |||
31 | #include <linux/device.h> | ||
32 | #include <linux/platform_device.h> | ||
33 | #include <asm/irq.h> | ||
34 | |||
35 | /* | ||
36 | * Name the Board for the /proc/cpuinfo | ||
37 | */ | ||
38 | char *bfin_board_name = "UNKNOWN BOARD"; | ||
39 | |||
40 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | ||
41 | static struct platform_device rtc_device = { | ||
42 | .name = "rtc-bfin", | ||
43 | .id = -1, | ||
44 | }; | ||
45 | #endif | ||
46 | |||
47 | /* | ||
48 | * Driver needs to know address, irq and flag pin. | ||
49 | */ | ||
50 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | ||
51 | static struct resource smc91x_resources[] = { | ||
52 | { | ||
53 | .start = 0x20300300, | ||
54 | .end = 0x20300300 + 16, | ||
55 | .flags = IORESOURCE_MEM, | ||
56 | },{ | ||
57 | .start = IRQ_PROG_INTB, | ||
58 | .end = IRQ_PROG_INTB, | ||
59 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
60 | },{ | ||
61 | /* | ||
62 | * denotes the flag pin and is used directly if | ||
63 | * CONFIG_IRQCHIP_DEMUX_GPIO is defined. | ||
64 | */ | ||
65 | .start = IRQ_PF7, | ||
66 | .end = IRQ_PF7, | ||
67 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
68 | }, | ||
69 | }; | ||
70 | |||
71 | static struct platform_device smc91x_device = { | ||
72 | .name = "smc91x", | ||
73 | .id = 0, | ||
74 | .num_resources = ARRAY_SIZE(smc91x_resources), | ||
75 | .resource = smc91x_resources, | ||
76 | }; | ||
77 | #endif | ||
78 | |||
79 | static struct platform_device *generic_board_devices[] __initdata = { | ||
80 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | ||
81 | &rtc_device, | ||
82 | #endif | ||
83 | |||
84 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | ||
85 | &smc91x_device, | ||
86 | #endif | ||
87 | }; | ||
88 | |||
89 | static int __init generic_board_init(void) | ||
90 | { | ||
91 | printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); | ||
92 | return platform_add_devices(generic_board_devices, ARRAY_SIZE(generic_board_devices)); | ||
93 | } | ||
94 | |||
95 | arch_initcall(generic_board_init); | ||
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c new file mode 100644 index 000000000000..d7b3a5d74e8c --- /dev/null +++ b/arch/blackfin/mach-bf533/boards/stamp.c | |||
@@ -0,0 +1,321 @@ | |||
1 | /* | ||
2 | * File: arch/blackfin/mach-bf533/stamp.c | ||
3 | * Based on: arch/blackfin/mach-bf533/ezkit.c | ||
4 | * Author: Aidan Williams <aidan@nicta.com.au> | ||
5 | * | ||
6 | * Created: 2005 | ||
7 | * Description: Board Info File for the BF533-STAMP | ||
8 | * | ||
9 | * Modified: | ||
10 | * Copyright 2005 National ICT Australia (NICTA) | ||
11 | * Copyright 2004-2006 Analog Devices Inc. | ||
12 | * | ||
13 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or modify | ||
16 | * it under the terms of the GNU General Public License as published by | ||
17 | * the Free Software Foundation; either version 2 of the License, or | ||
18 | * (at your option) any later version. | ||
19 | * | ||
20 | * This program is distributed in the hope that it will be useful, | ||
21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
23 | * GNU General Public License for more details. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License | ||
26 | * along with this program; if not, see the file COPYING, or write | ||
27 | * to the Free Software Foundation, Inc., | ||
28 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
29 | */ | ||
30 | |||
31 | #include <linux/device.h> | ||
32 | #include <linux/platform_device.h> | ||
33 | #include <linux/mtd/mtd.h> | ||
34 | #include <linux/mtd/partitions.h> | ||
35 | #include <linux/spi/spi.h> | ||
36 | #include <linux/spi/flash.h> | ||
37 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) | ||
38 | #include <linux/usb_isp1362.h> | ||
39 | #endif | ||
40 | #include <asm/irq.h> | ||
41 | #include <asm/bfin5xx_spi.h> | ||
42 | |||
43 | /* | ||
44 | * Name the Board for the /proc/cpuinfo | ||
45 | */ | ||
46 | char *bfin_board_name = "ADDS-BF533-STAMP"; | ||
47 | |||
48 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | ||
49 | static struct platform_device rtc_device = { | ||
50 | .name = "rtc-bfin", | ||
51 | .id = -1, | ||
52 | }; | ||
53 | #endif | ||
54 | |||
55 | /* | ||
56 | * Driver needs to know address, irq and flag pin. | ||
57 | */ | ||
58 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | ||
59 | static struct resource smc91x_resources[] = { | ||
60 | { | ||
61 | .name = "smc91x-regs", | ||
62 | .start = 0x20300300, | ||
63 | .end = 0x20300300 + 16, | ||
64 | .flags = IORESOURCE_MEM, | ||
65 | },{ | ||
66 | .start = IRQ_PF7, | ||
67 | .end = IRQ_PF7, | ||
68 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
69 | }, | ||
70 | }; | ||
71 | |||
72 | static struct platform_device smc91x_device = { | ||
73 | .name = "smc91x", | ||
74 | .id = 0, | ||
75 | .num_resources = ARRAY_SIZE(smc91x_resources), | ||
76 | .resource = smc91x_resources, | ||
77 | }; | ||
78 | #endif | ||
79 | |||
80 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) | ||
81 | static struct resource net2272_bfin_resources[] = { | ||
82 | { | ||
83 | .start = 0x20300000, | ||
84 | .end = 0x20300000 + 0x100, | ||
85 | .flags = IORESOURCE_MEM, | ||
86 | },{ | ||
87 | .start = IRQ_PF10, | ||
88 | .end = IRQ_PF10, | ||
89 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
90 | }, | ||
91 | }; | ||
92 | |||
93 | static struct platform_device net2272_bfin_device = { | ||
94 | .name = "net2272", | ||
95 | .id = -1, | ||
96 | .num_resources = ARRAY_SIZE(net2272_bfin_resources), | ||
97 | .resource = net2272_bfin_resources, | ||
98 | }; | ||
99 | #endif | ||
100 | |||
101 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | ||
102 | /* all SPI peripherals info goes here */ | ||
103 | |||
104 | #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) | ||
105 | static struct mtd_partition bfin_spi_flash_partitions[] = { | ||
106 | { | ||
107 | .name = "bootloader", | ||
108 | .size = 0x00020000, | ||
109 | .offset = 0, | ||
110 | .mask_flags = MTD_CAP_ROM | ||
111 | },{ | ||
112 | .name = "kernel", | ||
113 | .size = 0xe0000, | ||
114 | .offset = 0x20000 | ||
115 | },{ | ||
116 | .name = "file system", | ||
117 | .size = 0x700000, | ||
118 | .offset = 0x00100000, | ||
119 | } | ||
120 | }; | ||
121 | |||
122 | static struct flash_platform_data bfin_spi_flash_data = { | ||
123 | .name = "m25p80", | ||
124 | .parts = bfin_spi_flash_partitions, | ||
125 | .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions), | ||
126 | .type = "m25p64", | ||
127 | }; | ||
128 | |||
129 | /* SPI flash chip (m25p64) */ | ||
130 | static struct bfin5xx_spi_chip spi_flash_chip_info = { | ||
131 | .enable_dma = 0, /* use dma transfer with this chip*/ | ||
132 | .bits_per_word = 8, | ||
133 | }; | ||
134 | #endif | ||
135 | |||
136 | #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) | ||
137 | /* SPI ADC chip */ | ||
138 | static struct bfin5xx_spi_chip spi_adc_chip_info = { | ||
139 | .enable_dma = 1, /* use dma transfer with this chip*/ | ||
140 | .bits_per_word = 16, | ||
141 | }; | ||
142 | #endif | ||
143 | |||
144 | #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | ||
145 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { | ||
146 | .enable_dma = 0, | ||
147 | .bits_per_word = 16, | ||
148 | }; | ||
149 | #endif | ||
150 | |||
151 | #if defined(CONFIG_PBX) | ||
152 | static struct bfin5xx_spi_chip spi_si3xxx_chip_info = { | ||
153 | .ctl_reg = 0x4, /* send zero */ | ||
154 | .enable_dma = 0, | ||
155 | .bits_per_word = 8, | ||
156 | .cs_change_per_word = 1, | ||
157 | }; | ||
158 | #endif | ||
159 | |||
160 | #if defined(CONFIG_AD5304) || defined(CONFIG_AD5304_MODULE) | ||
161 | static struct bfin5xx_spi_chip ad5304_chip_info = { | ||
162 | .enable_dma = 0, | ||
163 | .bits_per_word = 16, | ||
164 | }; | ||
165 | #endif | ||
166 | |||
167 | static struct spi_board_info bfin_spi_board_info[] __initdata = { | ||
168 | #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) | ||
169 | { | ||
170 | /* the modalias must be the same as spi device driver name */ | ||
171 | .modalias = "m25p80", /* Name of spi_driver for this device */ | ||
172 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | ||
173 | .bus_num = 1, /* Framework bus number */ | ||
174 | .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/ | ||
175 | .platform_data = &bfin_spi_flash_data, | ||
176 | .controller_data = &spi_flash_chip_info, | ||
177 | .mode = SPI_MODE_3, | ||
178 | }, | ||
179 | #endif | ||
180 | |||
181 | #if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) | ||
182 | { | ||
183 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ | ||
184 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ | ||
185 | .bus_num = 1, /* Framework bus number */ | ||
186 | .chip_select = 1, /* Framework chip select. */ | ||
187 | .platform_data = NULL, /* No spi_driver specific config */ | ||
188 | .controller_data = &spi_adc_chip_info, | ||
189 | }, | ||
190 | #endif | ||
191 | |||
192 | #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | ||
193 | { | ||
194 | .modalias = "ad1836-spi", | ||
195 | .max_speed_hz = 31250000, /* max spi clock (SCK) speed in HZ */ | ||
196 | .bus_num = 1, | ||
197 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, | ||
198 | .controller_data = &ad1836_spi_chip_info, | ||
199 | }, | ||
200 | #endif | ||
201 | |||
202 | #if defined(CONFIG_PBX) | ||
203 | { | ||
204 | .modalias = "fxs-spi", | ||
205 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ | ||
206 | .bus_num = 1, | ||
207 | .chip_select = 3, | ||
208 | .controller_data= &spi_si3xxx_chip_info, | ||
209 | .mode = SPI_MODE_3, | ||
210 | }, | ||
211 | { | ||
212 | .modalias = "fxo-spi", | ||
213 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ | ||
214 | .bus_num = 1, | ||
215 | .chip_select = 2, | ||
216 | .controller_data= &spi_si3xxx_chip_info, | ||
217 | .mode = SPI_MODE_3, | ||
218 | }, | ||
219 | #endif | ||
220 | |||
221 | #if defined(CONFIG_AD5304) || defined(CONFIG_AD5304_MODULE) | ||
222 | { | ||
223 | .modalias = "ad5304_spi", | ||
224 | .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ | ||
225 | .bus_num = 1, | ||
226 | .chip_select = 2, | ||
227 | .platform_data = NULL, | ||
228 | .controller_data = &ad5304_chip_info, | ||
229 | .mode = SPI_MODE_2, | ||
230 | }, | ||
231 | #endif | ||
232 | }; | ||
233 | |||
234 | /* SPI controller data */ | ||
235 | static struct bfin5xx_spi_master spi_bfin_master_info = { | ||
236 | .num_chipselect = 8, | ||
237 | .enable_dma = 1, /* master has the ability to do dma transfer */ | ||
238 | }; | ||
239 | |||
240 | static struct platform_device spi_bfin_master_device = { | ||
241 | .name = "bfin-spi-master", | ||
242 | .id = 1, /* Bus number */ | ||
243 | .dev = { | ||
244 | .platform_data = &spi_bfin_master_info, /* Passed to driver */ | ||
245 | }, | ||
246 | }; | ||
247 | #endif /* spi master and devices */ | ||
248 | |||
249 | #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) | ||
250 | static struct platform_device bfin_fb_device = { | ||
251 | .name = "bf537-fb", | ||
252 | }; | ||
253 | #endif | ||
254 | |||
255 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | ||
256 | static struct resource bfin_uart_resources[] = { | ||
257 | { | ||
258 | .start = 0xFFC00400, | ||
259 | .end = 0xFFC004FF, | ||
260 | .flags = IORESOURCE_MEM, | ||
261 | }, | ||
262 | }; | ||
263 | |||
264 | static struct platform_device bfin_uart_device = { | ||
265 | .name = "bfin-uart", | ||
266 | .id = 1, | ||
267 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | ||
268 | .resource = bfin_uart_resources, | ||
269 | }; | ||
270 | #endif | ||
271 | |||
272 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | ||
273 | static struct platform_device bfin_sport0_uart_device = { | ||
274 | .name = "bfin-sport-uart", | ||
275 | .id = 0, | ||
276 | }; | ||
277 | |||
278 | static struct platform_device bfin_sport1_uart_device = { | ||
279 | .name = "bfin-sport-uart", | ||
280 | .id = 1, | ||
281 | }; | ||
282 | #endif | ||
283 | |||
284 | static struct platform_device *stamp_devices[] __initdata = { | ||
285 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | ||
286 | &rtc_device, | ||
287 | #endif | ||
288 | |||
289 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | ||
290 | &smc91x_device, | ||
291 | #endif | ||
292 | |||
293 | #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) | ||
294 | &net2272_bfin_device, | ||
295 | #endif | ||
296 | |||
297 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | ||
298 | &spi_bfin_master_device, | ||
299 | #endif | ||
300 | |||
301 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | ||
302 | &bfin_uart_device, | ||
303 | #endif | ||
304 | |||
305 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | ||
306 | &bfin_sport0_uart_device, | ||
307 | &bfin_sport1_uart_device, | ||
308 | #endif | ||
309 | }; | ||
310 | |||
311 | static int __init stamp_init(void) | ||
312 | { | ||
313 | printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); | ||
314 | platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); | ||
315 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | ||
316 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); | ||
317 | #endif | ||
318 | return 0; | ||
319 | } | ||
320 | |||
321 | arch_initcall(stamp_init); | ||
diff --git a/arch/blackfin/mach-bf533/cpu.c b/arch/blackfin/mach-bf533/cpu.c new file mode 100644 index 000000000000..99547c4c290e --- /dev/null +++ b/arch/blackfin/mach-bf533/cpu.c | |||
@@ -0,0 +1,161 @@ | |||
1 | /* | ||
2 | * File: arch/blackfin/mach-bf533/cpu.c | ||
3 | * Based on: | ||
4 | * Author: michael.kang@analog.com | ||
5 | * | ||
6 | * Created: | ||
7 | * Description: clock scaling for the bf533 | ||
8 | * | ||
9 | * Modified: | ||
10 | * Copyright 2004-2006 Analog Devices Inc. | ||
11 | * | ||
12 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or modify | ||
15 | * it under the terms of the GNU General Public License as published by | ||
16 | * the Free Software Foundation; either version 2 of the License, or | ||
17 | * (at your option) any later version. | ||
18 | * | ||
19 | * This program is distributed in the hope that it will be useful, | ||
20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
22 | * GNU General Public License for more details. | ||
23 | * | ||
24 | * You should have received a copy of the GNU General Public License | ||
25 | * along with this program; if not, see the file COPYING, or write | ||
26 | * to the Free Software Foundation, Inc., | ||
27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
28 | */ | ||
29 | |||
30 | #include <linux/kernel.h> | ||
31 | #include <linux/types.h> | ||
32 | #include <linux/init.h> | ||
33 | #include <linux/cpufreq.h> | ||
34 | #include <asm/dpmc.h> | ||
35 | #include <linux/fs.h> | ||
36 | #include <asm/bfin-global.h> | ||
37 | |||
38 | /* CONFIG_CLKIN_HZ=11059200 */ | ||
39 | #define VCO5 (CONFIG_CLKIN_HZ*45) /*497664000 */ | ||
40 | #define VCO4 (CONFIG_CLKIN_HZ*36) /*398131200 */ | ||
41 | #define VCO3 (CONFIG_CLKIN_HZ*27) /*298598400 */ | ||
42 | #define VCO2 (CONFIG_CLKIN_HZ*18) /*199065600 */ | ||
43 | #define VCO1 (CONFIG_CLKIN_HZ*9) /*99532800 */ | ||
44 | #define VCO(x) VCO##x | ||
45 | |||
46 | #define FREQ(x) {VCO(x),VCO(x)/4},{VCO(x),VCO(x)/2},{VCO(x),VCO(x)} | ||
47 | /* frequency */ | ||
48 | static struct cpufreq_frequency_table bf533_freq_table[] = { | ||
49 | FREQ(1), | ||
50 | FREQ(3), | ||
51 | {VCO4, VCO4 / 2}, {VCO4, VCO4}, | ||
52 | FREQ(5), | ||
53 | {0, CPUFREQ_TABLE_END}, | ||
54 | }; | ||
55 | |||
56 | /* | ||
57 | * dpmc_fops->ioctl() | ||
58 | * static int dpmc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) | ||
59 | */ | ||
60 | static int bf533_getfreq(unsigned int cpu) | ||
61 | { | ||
62 | unsigned long cclk_mhz, vco_mhz; | ||
63 | |||
64 | /* The driver only support single cpu */ | ||
65 | if (cpu == 0) | ||
66 | dpmc_fops.ioctl(NULL, NULL, IOCTL_GET_CORECLOCK, &cclk_mhz); | ||
67 | else | ||
68 | cclk_mhz = -1; | ||
69 | return cclk_mhz; | ||
70 | } | ||
71 | |||
72 | static int bf533_target(struct cpufreq_policy *policy, | ||
73 | unsigned int target_freq, unsigned int relation) | ||
74 | { | ||
75 | unsigned long cclk_mhz; | ||
76 | unsigned long vco_mhz; | ||
77 | unsigned long flags; | ||
78 | unsigned int index, vco_index; | ||
79 | int i; | ||
80 | |||
81 | struct cpufreq_freqs freqs; | ||
82 | if (cpufreq_frequency_table_target | ||
83 | (policy, bf533_freq_table, target_freq, relation, &index)) | ||
84 | return -EINVAL; | ||
85 | cclk_mhz = bf533_freq_table[index].frequency; | ||
86 | vco_mhz = bf533_freq_table[index].index; | ||
87 | |||
88 | dpmc_fops.ioctl(NULL, NULL, IOCTL_CHANGE_FREQUENCY, &vco_mhz); | ||
89 | freqs.old = bf533_getfreq(0); | ||
90 | freqs.new = cclk_mhz; | ||
91 | freqs.cpu = 0; | ||
92 | |||
93 | pr_debug("cclk begin change to cclk %d,vco=%d,index=%d,target=%d,oldfreq=%d\n", | ||
94 | cclk_mhz, vco_mhz, index, target_freq, freqs.old); | ||
95 | |||
96 | cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); | ||
97 | local_irq_save(flags); | ||
98 | dpmc_fops.ioctl(NULL, NULL, IOCTL_SET_CCLK, &cclk_mhz); | ||
99 | local_irq_restore(flags); | ||
100 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); | ||
101 | |||
102 | vco_mhz = get_vco(); | ||
103 | cclk_mhz = get_cclk(); | ||
104 | return 0; | ||
105 | } | ||
106 | |||
107 | /* make sure that only the "userspace" governor is run -- anything else wouldn't make sense on | ||
108 | * this platform, anyway. | ||
109 | */ | ||
110 | static int bf533_verify_speed(struct cpufreq_policy *policy) | ||
111 | { | ||
112 | return cpufreq_frequency_table_verify(policy, &bf533_freq_table); | ||
113 | } | ||
114 | |||
115 | static int __init __bf533_cpu_init(struct cpufreq_policy *policy) | ||
116 | { | ||
117 | int result; | ||
118 | |||
119 | if (policy->cpu != 0) | ||
120 | return -EINVAL; | ||
121 | |||
122 | policy->governor = CPUFREQ_DEFAULT_GOVERNOR; | ||
123 | |||
124 | policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; | ||
125 | /*Now ,only support one cpu */ | ||
126 | policy->cur = bf533_getfreq(0); | ||
127 | cpufreq_frequency_table_get_attr(bf533_freq_table, policy->cpu); | ||
128 | return cpufreq_frequency_table_cpuinfo(policy, bf533_freq_table); | ||
129 | } | ||
130 | |||
131 | static struct freq_attr *bf533_freq_attr[] = { | ||
132 | &cpufreq_freq_attr_scaling_available_freqs, | ||
133 | NULL, | ||
134 | }; | ||
135 | |||
136 | static struct cpufreq_driver bf533_driver = { | ||
137 | .verify = bf533_verify_speed, | ||
138 | .target = bf533_target, | ||
139 | .get = bf533_getfreq, | ||
140 | .init = __bf533_cpu_init, | ||
141 | .name = "bf533", | ||
142 | .owner = THIS_MODULE, | ||
143 | .attr = bf533_freq_attr, | ||
144 | }; | ||
145 | |||
146 | static int __init bf533_cpu_init(void) | ||
147 | { | ||
148 | return cpufreq_register_driver(&bf533_driver); | ||
149 | } | ||
150 | |||
151 | static void __exit bf533_cpu_exit(void) | ||
152 | { | ||
153 | cpufreq_unregister_driver(&bf533_driver); | ||
154 | } | ||
155 | |||
156 | MODULE_AUTHOR("Mickael Kang"); | ||
157 | MODULE_DESCRIPTION("cpufreq driver for BF533 CPU"); | ||
158 | MODULE_LICENSE("GPL"); | ||
159 | |||
160 | module_init(bf533_cpu_init); | ||
161 | module_exit(bf533_cpu_exit); | ||
diff --git a/arch/blackfin/mach-bf533/head.S b/arch/blackfin/mach-bf533/head.S new file mode 100644 index 000000000000..4808edb0680f --- /dev/null +++ b/arch/blackfin/mach-bf533/head.S | |||
@@ -0,0 +1,774 @@ | |||
1 | /* | ||
2 | * File: arch/blackfin/mach-bf533/head.S | ||
3 | * Based on: | ||
4 | * Author: Jeff Dionne <jeff@uclinux.org> COPYRIGHT 1998 D. Jeff Dionne | ||
5 | * | ||
6 | * Created: 1998 | ||
7 | * Description: bf533 startup file | ||
8 | * | ||
9 | * Modified: | ||
10 | * Copyright 2004-2006 Analog Devices Inc. | ||
11 | * | ||
12 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or modify | ||
15 | * it under the terms of the GNU General Public License as published by | ||
16 | * the Free Software Foundation; either version 2 of the License, or | ||
17 | * (at your option) any later version. | ||
18 | * | ||
19 | * This program is distributed in the hope that it will be useful, | ||
20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
22 | * GNU General Public License for more details. | ||
23 | * | ||
24 | * You should have received a copy of the GNU General Public License | ||
25 | * along with this program; if not, see the file COPYING, or write | ||
26 | * to the Free Software Foundation, Inc., | ||
27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
28 | */ | ||
29 | |||
30 | #include <linux/linkage.h> | ||
31 | #include <asm/blackfin.h> | ||
32 | #if CONFIG_BFIN_KERNEL_CLOCK | ||
33 | #include <asm/mach/mem_init.h> | ||
34 | #endif | ||
35 | #if CONFIG_DEBUG_KERNEL_START | ||
36 | #include <asm/mach-common/def_LPBlackfin.h> | ||
37 | #endif | ||
38 | |||
39 | .global __rambase | ||
40 | .global __ramstart | ||
41 | .global __ramend | ||
42 | .extern ___bss_stop | ||
43 | .extern ___bss_start | ||
44 | .extern _bf53x_relocate_l1_mem | ||
45 | |||
46 | #define INITIAL_STACK 0xFFB01000 | ||
47 | |||
48 | .text | ||
49 | |||
50 | ENTRY(__start) | ||
51 | ENTRY(__stext) | ||
52 | /* R0: argument of command line string, passed from uboot, save it */ | ||
53 | R7 = R0; | ||
54 | /* Set the SYSCFG register */ | ||
55 | R0 = 0x36; | ||
56 | /*Enable Cycle Counter and Nesting Of Interrupts(3rd Bit)*/ | ||
57 | SYSCFG = R0; | ||
58 | R0 = 0; | ||
59 | |||
60 | /*Clear Out All the data and pointer Registers*/ | ||
61 | R1 = R0; | ||
62 | R2 = R0; | ||
63 | R3 = R0; | ||
64 | R4 = R0; | ||
65 | R5 = R0; | ||
66 | R6 = R0; | ||
67 | |||
68 | P0 = R0; | ||
69 | P1 = R0; | ||
70 | P2 = R0; | ||
71 | P3 = R0; | ||
72 | P4 = R0; | ||
73 | P5 = R0; | ||
74 | |||
75 | LC0 = r0; | ||
76 | LC1 = r0; | ||
77 | L0 = r0; | ||
78 | L1 = r0; | ||
79 | L2 = r0; | ||
80 | L3 = r0; | ||
81 | |||
82 | /* Clear Out All the DAG Registers*/ | ||
83 | B0 = r0; | ||
84 | B1 = r0; | ||
85 | B2 = r0; | ||
86 | B3 = r0; | ||
87 | |||
88 | I0 = r0; | ||
89 | I1 = r0; | ||
90 | I2 = r0; | ||
91 | I3 = r0; | ||
92 | |||
93 | M0 = r0; | ||
94 | M1 = r0; | ||
95 | M2 = r0; | ||
96 | M3 = r0; | ||
97 | |||
98 | #if CONFIG_DEBUG_KERNEL_START | ||
99 | |||
100 | /* | ||
101 | * Set up a temporary Event Vector Table, so if something bad happens before | ||
102 | * the kernel is fully started, it doesn't vector off into the bootloaders | ||
103 | * table | ||
104 | */ | ||
105 | P0.l = lo(EVT2); | ||
106 | P0.h = hi(EVT2); | ||
107 | P1.l = lo(EVT15); | ||
108 | P1.h = hi(EVT15); | ||
109 | P2.l = debug_kernel_start_trap; | ||
110 | P2.h = debug_kernel_start_trap; | ||
111 | |||
112 | RTS = P2; | ||
113 | RTI = P2; | ||
114 | RTX = P2; | ||
115 | RTN = P2; | ||
116 | RTE = P2; | ||
117 | |||
118 | .Lfill_temp_vector_table: | ||
119 | [P0++] = P2; /* Core Event Vector Table */ | ||
120 | CC = P0 == P1; | ||
121 | if !CC JUMP .Lfill_temp_vector_table | ||
122 | P0 = r0; | ||
123 | P1 = r0; | ||
124 | P2 = r0; | ||
125 | |||
126 | #endif | ||
127 | |||
128 | p0.h = hi(FIO_MASKA_C); | ||
129 | p0.l = lo(FIO_MASKA_C); | ||
130 | r0 = 0xFFFF(Z); | ||
131 | w[p0] = r0.L; /* Disable all interrupts */ | ||
132 | ssync; | ||
133 | |||
134 | p0.h = hi(FIO_MASKB_C); | ||
135 | p0.l = lo(FIO_MASKB_C); | ||
136 | r0 = 0xFFFF(Z); | ||
137 | w[p0] = r0.L; /* Disable all interrupts */ | ||
138 | ssync; | ||
139 | |||
140 | /* Turn off the icache */ | ||
141 | p0.l = (IMEM_CONTROL & 0xFFFF); | ||
142 | p0.h = (IMEM_CONTROL >> 16); | ||
143 | R1 = [p0]; | ||
144 | R0 = ~ENICPLB; | ||
145 | R0 = R0 & R1; | ||
146 | |||
147 | /* Anomaly 05000125 */ | ||
148 | #ifdef ANOMALY_05000125 | ||
149 | CLI R2; | ||
150 | SSYNC; | ||
151 | #endif | ||
152 | [p0] = R0; | ||
153 | SSYNC; | ||
154 | #ifdef ANOMALY_05000125 | ||
155 | STI R2; | ||
156 | #endif | ||
157 | |||
158 | /* Turn off the dcache */ | ||
159 | p0.l = (DMEM_CONTROL & 0xFFFF); | ||
160 | p0.h = (DMEM_CONTROL >> 16); | ||
161 | R1 = [p0]; | ||
162 | R0 = ~ENDCPLB; | ||
163 | R0 = R0 & R1; | ||
164 | |||
165 | /* Anomaly 05000125 */ | ||
166 | #ifdef ANOMALY_05000125 | ||
167 | CLI R2; | ||
168 | SSYNC; | ||
169 | #endif | ||
170 | [p0] = R0; | ||
171 | SSYNC; | ||
172 | #ifdef ANOMALY_05000125 | ||
173 | STI R2; | ||
174 | #endif | ||
175 | |||
176 | /* Initialise UART */ | ||
177 | p0.h = hi(UART_LCR); | ||
178 | p0.l = lo(UART_LCR); | ||
179 | r0 = 0x0(Z); | ||
180 | w[p0] = r0.L; /* To enable DLL writes */ | ||
181 | ssync; | ||
182 | |||
183 | p0.h = hi(UART_DLL); | ||
184 | p0.l = lo(UART_DLL); | ||
185 | r0 = 0x0(Z); | ||
186 | w[p0] = r0.L; | ||
187 | ssync; | ||
188 | |||
189 | p0.h = hi(UART_DLH); | ||
190 | p0.l = lo(UART_DLH); | ||
191 | r0 = 0x00(Z); | ||
192 | w[p0] = r0.L; | ||
193 | ssync; | ||
194 | |||
195 | p0.h = hi(UART_GCTL); | ||
196 | p0.l = lo(UART_GCTL); | ||
197 | r0 = 0x0(Z); | ||
198 | w[p0] = r0.L; /* To enable UART clock */ | ||
199 | ssync; | ||
200 | |||
201 | /* Initialize stack pointer */ | ||
202 | sp.l = lo(INITIAL_STACK); | ||
203 | sp.h = hi(INITIAL_STACK); | ||
204 | fp = sp; | ||
205 | usp = sp; | ||
206 | |||
207 | /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */ | ||
208 | call _bf53x_relocate_l1_mem; | ||
209 | #if CONFIG_BFIN_KERNEL_CLOCK | ||
210 | call _start_dma_code; | ||
211 | #endif | ||
212 | |||
213 | /* Code for initializing Async memory banks */ | ||
214 | |||
215 | p2.h = hi(EBIU_AMBCTL1); | ||
216 | p2.l = lo(EBIU_AMBCTL1); | ||
217 | r0.h = hi(AMBCTL1VAL); | ||
218 | r0.l = lo(AMBCTL1VAL); | ||
219 | [p2] = r0; | ||
220 | ssync; | ||
221 | |||
222 | p2.h = hi(EBIU_AMBCTL0); | ||
223 | p2.l = lo(EBIU_AMBCTL0); | ||
224 | r0.h = hi(AMBCTL0VAL); | ||
225 | r0.l = lo(AMBCTL0VAL); | ||
226 | [p2] = r0; | ||
227 | ssync; | ||
228 | |||
229 | p2.h = hi(EBIU_AMGCTL); | ||
230 | p2.l = lo(EBIU_AMGCTL); | ||
231 | r0 = AMGCTLVAL; | ||
232 | w[p2] = r0; | ||
233 | ssync; | ||
234 | |||
235 | /* This section keeps the processor in supervisor mode | ||
236 | * during kernel boot. Switches to user mode at end of boot. | ||
237 | * See page 3-9 of Hardware Reference manual for documentation. | ||
238 | */ | ||
239 | |||
240 | /* EVT15 = _real_start */ | ||
241 | |||
242 | p0.l = lo(EVT15); | ||
243 | p0.h = hi(EVT15); | ||
244 | p1.l = _real_start; | ||
245 | p1.h = _real_start; | ||
246 | [p0] = p1; | ||
247 | csync; | ||
248 | |||
249 | p0.l = lo(IMASK); | ||
250 | p0.h = hi(IMASK); | ||
251 | p1.l = IMASK_IVG15; | ||
252 | p1.h = 0x0; | ||
253 | [p0] = p1; | ||
254 | csync; | ||
255 | |||
256 | raise 15; | ||
257 | p0.l = .LWAIT_HERE; | ||
258 | p0.h = .LWAIT_HERE; | ||
259 | reti = p0; | ||
260 | #if defined(ANOMALY_05000281) | ||
261 | nop; nop; nop; | ||
262 | #endif | ||
263 | rti; | ||
264 | |||
265 | .LWAIT_HERE: | ||
266 | jump .LWAIT_HERE; | ||
267 | |||
268 | ENTRY(_real_start) | ||
269 | [ -- sp ] = reti; | ||
270 | p0.l = lo(WDOG_CTL); | ||
271 | p0.h = hi(WDOG_CTL); | ||
272 | r0 = 0xAD6(z); | ||
273 | w[p0] = r0; /* watchdog off for now */ | ||
274 | ssync; | ||
275 | |||
276 | /* Code update for BSS size == 0 | ||
277 | * Zero out the bss region. | ||
278 | */ | ||
279 | |||
280 | p1.l = ___bss_start; | ||
281 | p1.h = ___bss_start; | ||
282 | p2.l = ___bss_stop; | ||
283 | p2.h = ___bss_stop; | ||
284 | r0 = 0; | ||
285 | p2 -= p1; | ||
286 | lsetup (.L_clear_bss, .L_clear_bss) lc0 = p2; | ||
287 | .L_clear_bss: | ||
288 | B[p1++] = r0; | ||
289 | |||
290 | /* In case there is a NULL pointer reference | ||
291 | * Zero out region before stext | ||
292 | */ | ||
293 | |||
294 | p1.l = 0x0; | ||
295 | p1.h = 0x0; | ||
296 | r0.l = __stext; | ||
297 | r0.h = __stext; | ||
298 | r0 = r0 >> 1; | ||
299 | p2 = r0; | ||
300 | r0 = 0; | ||
301 | lsetup (.L_clear_zero, .L_clear_zero) lc0 = p2; | ||
302 | .L_clear_zero: | ||
303 | W[p1++] = r0; | ||
304 | |||
305 | /* pass the uboot arguments to the global value command line */ | ||
306 | R0 = R7; | ||
307 | call _cmdline_init; | ||
308 | |||
309 | p1.l = __rambase; | ||
310 | p1.h = __rambase; | ||
311 | r0.l = __sdata; | ||
312 | r0.h = __sdata; | ||
313 | [p1] = r0; | ||
314 | |||
315 | p1.l = __ramstart; | ||
316 | p1.h = __ramstart; | ||
317 | p3.l = ___bss_stop; | ||
318 | p3.h = ___bss_stop; | ||
319 | |||
320 | r1 = p3; | ||
321 | [p1] = r1; | ||
322 | |||
323 | /* | ||
324 | * load the current thread pointer and stack | ||
325 | */ | ||
326 | r1.l = _init_thread_union; | ||
327 | r1.h = _init_thread_union; | ||
328 | |||
329 | r2.l = 0x2000; | ||
330 | r2.h = 0x0000; | ||
331 | r1 = r1 + r2; | ||
332 | sp = r1; | ||
333 | usp = sp; | ||
334 | fp = sp; | ||
335 | call _start_kernel; | ||
336 | .L_exit: | ||
337 | jump.s .L_exit; | ||
338 | |||
339 | .section .l1.text | ||
340 | #if CONFIG_BFIN_KERNEL_CLOCK | ||
341 | ENTRY(_start_dma_code) | ||
342 | p0.h = hi(SIC_IWR); | ||
343 | p0.l = lo(SIC_IWR); | ||
344 | r0.l = 0x1; | ||
345 | r0.h = 0x0; | ||
346 | [p0] = r0; | ||
347 | SSYNC; | ||
348 | |||
349 | /* | ||
350 | * Set PLL_CTL | ||
351 | * - [14:09] = MSEL[5:0] : CLKIN / VCO multiplication factors | ||
352 | * - [8] = BYPASS : BYPASS the PLL, run CLKIN into CCLK/SCLK | ||
353 | * - [7] = output delay (add 200ps of delay to mem signals) | ||
354 | * - [6] = input delay (add 200ps of input delay to mem signals) | ||
355 | * - [5] = PDWN : 1=All Clocks off | ||
356 | * - [3] = STOPCK : 1=Core Clock off | ||
357 | * - [1] = PLL_OFF : 1=Disable Power to PLL | ||
358 | * - [0] = DF : 1=Pass CLKIN/2 to PLL / 0=Pass CLKIN to PLL | ||
359 | * all other bits set to zero | ||
360 | */ | ||
361 | |||
362 | p0.h = hi(PLL_LOCKCNT); | ||
363 | p0.l = lo(PLL_LOCKCNT); | ||
364 | r0 = 0x300(Z); | ||
365 | w[p0] = r0.l; | ||
366 | ssync; | ||
367 | |||
368 | P2.H = hi(EBIU_SDGCTL); | ||
369 | P2.L = lo(EBIU_SDGCTL); | ||
370 | R0 = [P2]; | ||
371 | BITSET (R0, 24); | ||
372 | [P2] = R0; | ||
373 | SSYNC; | ||
374 | |||
375 | r0 = CONFIG_VCO_MULT & 63; /* Load the VCO multiplier */ | ||
376 | r0 = r0 << 9; /* Shift it over, */ | ||
377 | r1 = CLKIN_HALF; /* Do we need to divide CLKIN by 2?*/ | ||
378 | r0 = r1 | r0; | ||
379 | r1 = PLL_BYPASS; /* Bypass the PLL? */ | ||
380 | r1 = r1 << 8; /* Shift it over */ | ||
381 | r0 = r1 | r0; /* add them all together */ | ||
382 | |||
383 | p0.h = hi(PLL_CTL); | ||
384 | p0.l = lo(PLL_CTL); /* Load the address */ | ||
385 | cli r2; /* Disable interrupts */ | ||
386 | ssync; | ||
387 | w[p0] = r0.l; /* Set the value */ | ||
388 | idle; /* Wait for the PLL to stablize */ | ||
389 | sti r2; /* Enable interrupts */ | ||
390 | |||
391 | .Lcheck_again: | ||
392 | p0.h = hi(PLL_STAT); | ||
393 | p0.l = lo(PLL_STAT); | ||
394 | R0 = W[P0](Z); | ||
395 | CC = BITTST(R0,5); | ||
396 | if ! CC jump .Lcheck_again; | ||
397 | |||
398 | /* Configure SCLK & CCLK Dividers */ | ||
399 | r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV); | ||
400 | p0.h = hi(PLL_DIV); | ||
401 | p0.l = lo(PLL_DIV); | ||
402 | w[p0] = r0.l; | ||
403 | ssync; | ||
404 | |||
405 | p0.l = lo(EBIU_SDRRC); | ||
406 | p0.h = hi(EBIU_SDRRC); | ||
407 | r0 = mem_SDRRC; | ||
408 | w[p0] = r0.l; | ||
409 | ssync; | ||
410 | |||
411 | p0.l = (EBIU_SDBCTL & 0xFFFF); | ||
412 | p0.h = (EBIU_SDBCTL >> 16); /* SDRAM Memory Bank Control Register */ | ||
413 | r0 = mem_SDBCTL; | ||
414 | w[p0] = r0.l; | ||
415 | ssync; | ||
416 | |||
417 | P2.H = hi(EBIU_SDGCTL); | ||
418 | P2.L = lo(EBIU_SDGCTL); | ||
419 | R0 = [P2]; | ||
420 | BITCLR (R0, 24); | ||
421 | p0.h = hi(EBIU_SDSTAT); | ||
422 | p0.l = lo(EBIU_SDSTAT); | ||
423 | r2.l = w[p0]; | ||
424 | cc = bittst(r2,3); | ||
425 | if !cc jump .Lskip; | ||
426 | NOP; | ||
427 | BITSET (R0, 23); | ||
428 | .Lskip: | ||
429 | [P2] = R0; | ||
430 | SSYNC; | ||
431 | |||
432 | R0.L = lo(mem_SDGCTL); | ||
433 | R0.H = hi(mem_SDGCTL); | ||
434 | R1 = [p2]; | ||
435 | R1 = R1 | R0; | ||
436 | [P2] = R1; | ||
437 | SSYNC; | ||
438 | |||
439 | p0.h = hi(SIC_IWR); | ||
440 | p0.l = lo(SIC_IWR); | ||
441 | r0.l = lo(IWR_ENABLE_ALL) | ||
442 | r0.h = hi(IWR_ENABLE_ALL) | ||
443 | [p0] = r0; | ||
444 | SSYNC; | ||
445 | |||
446 | RTS; | ||
447 | #endif /* CONFIG_BFIN_KERNEL_CLOCK */ | ||
448 | |||
449 | ENTRY(_bfin_reset) | ||
450 | /* No more interrupts to be handled*/ | ||
451 | CLI R6; | ||
452 | SSYNC; | ||
453 | |||
454 | #if defined(CONFIG_BFIN_SHARED_FLASH_ENET) | ||
455 | p0.h = hi(FIO_INEN); | ||
456 | p0.l = lo(FIO_INEN); | ||
457 | r0.l = ~(1 << CONFIG_ENET_FLASH_PIN); | ||
458 | w[p0] = r0.l; | ||
459 | |||
460 | p0.h = hi(FIO_DIR); | ||
461 | p0.l = lo(FIO_DIR); | ||
462 | r0.l = (1 << CONFIG_ENET_FLASH_PIN); | ||
463 | w[p0] = r0.l; | ||
464 | |||
465 | p0.h = hi(FIO_FLAG_C); | ||
466 | p0.l = lo(FIO_FLAG_C); | ||
467 | r0.l = (1 << CONFIG_ENET_FLASH_PIN); | ||
468 | w[p0] = r0.l; | ||
469 | #endif | ||
470 | |||
471 | /* Clear the bits 13-15 in SWRST if they werent cleared */ | ||
472 | p0.h = hi(SWRST); | ||
473 | p0.l = lo(SWRST); | ||
474 | csync; | ||
475 | r0.l = w[p0]; | ||
476 | |||
477 | /* Clear the IMASK register */ | ||
478 | p0.h = hi(IMASK); | ||
479 | p0.l = lo(IMASK); | ||
480 | r0 = 0x0; | ||
481 | [p0] = r0; | ||
482 | |||
483 | /* Clear the ILAT register */ | ||
484 | p0.h = hi(ILAT); | ||
485 | p0.l = lo(ILAT); | ||
486 | r0 = [p0]; | ||
487 | [p0] = r0; | ||
488 | SSYNC; | ||
489 | |||
490 | /* Disable the WDOG TIMER */ | ||
491 | p0.h = hi(WDOG_CTL); | ||
492 | p0.l = lo(WDOG_CTL); | ||
493 | r0.l = 0xAD6; | ||
494 | w[p0] = r0.l; | ||
495 | SSYNC; | ||
496 | |||
497 | /* Clear the sticky bit incase it is already set */ | ||
498 | p0.h = hi(WDOG_CTL); | ||
499 | p0.l = lo(WDOG_CTL); | ||
500 | r0.l = 0x8AD6; | ||
501 | w[p0] = r0.l; | ||
502 | SSYNC; | ||
503 | |||
504 | /* Program the count value */ | ||
505 | R0.l = 0x100; | ||
506 | R0.h = 0x0; | ||
507 | P0.h = hi(WDOG_CNT); | ||
508 | P0.l = lo(WDOG_CNT); | ||
509 | [P0] = R0; | ||
510 | SSYNC; | ||
511 | |||
512 | /* Program WDOG_STAT if necessary */ | ||
513 | P0.h = hi(WDOG_CTL); | ||
514 | P0.l = lo(WDOG_CTL); | ||
515 | R0 = W[P0](Z); | ||
516 | CC = BITTST(R0,1); | ||
517 | if !CC JUMP .LWRITESTAT; | ||
518 | CC = BITTST(R0,2); | ||
519 | if !CC JUMP .LWRITESTAT; | ||
520 | JUMP .LSKIP_WRITE; | ||
521 | |||
522 | .LWRITESTAT: | ||
523 | /* When watch dog timer is enabled, a write to STAT will load the contents of CNT to STAT */ | ||
524 | R0 = 0x0000(z); | ||
525 | P0.h = hi(WDOG_STAT); | ||
526 | P0.l = lo(WDOG_STAT) | ||
527 | [P0] = R0; | ||
528 | SSYNC; | ||
529 | |||
530 | .LSKIP_WRITE: | ||
531 | /* Enable the reset event */ | ||
532 | P0.h = hi(WDOG_CTL); | ||
533 | P0.l = lo(WDOG_CTL); | ||
534 | R0 = W[P0](Z); | ||
535 | BITCLR(R0,1); | ||
536 | BITCLR(R0,2); | ||
537 | W[P0] = R0.L; | ||
538 | SSYNC; | ||
539 | NOP; | ||
540 | |||
541 | /* Enable the wdog counter */ | ||
542 | R0 = W[P0](Z); | ||
543 | BITCLR(R0,4); | ||
544 | W[P0] = R0.L; | ||
545 | SSYNC; | ||
546 | |||
547 | IDLE; | ||
548 | |||
549 | RTS; | ||
550 | |||
551 | #if CONFIG_DEBUG_KERNEL_START | ||
552 | debug_kernel_start_trap: | ||
553 | /* Set up a temp stack in L1 - SDRAM might not be working */ | ||
554 | P0.L = lo(L1_DATA_A_START + 0x100); | ||
555 | P0.H = hi(L1_DATA_A_START + 0x100); | ||
556 | SP = P0; | ||
557 | |||
558 | /* Make sure the Clocks are the way I think they should be */ | ||
559 | r0 = CONFIG_VCO_MULT & 63; /* Load the VCO multiplier */ | ||
560 | r0 = r0 << 9; /* Shift it over, */ | ||
561 | r1 = CLKIN_HALF; /* Do we need to divide CLKIN by 2?*/ | ||
562 | r0 = r1 | r0; | ||
563 | r1 = PLL_BYPASS; /* Bypass the PLL? */ | ||
564 | r1 = r1 << 8; /* Shift it over */ | ||
565 | r0 = r1 | r0; /* add them all together */ | ||
566 | |||
567 | p0.h = hi(PLL_CTL); | ||
568 | p0.l = lo(PLL_CTL); /* Load the address */ | ||
569 | cli r2; /* Disable interrupts */ | ||
570 | ssync; | ||
571 | w[p0] = r0.l; /* Set the value */ | ||
572 | idle; /* Wait for the PLL to stablize */ | ||
573 | sti r2; /* Enable interrupts */ | ||
574 | |||
575 | .Lcheck_again1: | ||
576 | p0.h = hi(PLL_STAT); | ||
577 | p0.l = lo(PLL_STAT); | ||
578 | R0 = W[P0](Z); | ||
579 | CC = BITTST(R0,5); | ||
580 | if ! CC jump .Lcheck_again1; | ||
581 | |||
582 | /* Configure SCLK & CCLK Dividers */ | ||
583 | r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV); | ||
584 | p0.h = hi(PLL_DIV); | ||
585 | p0.l = lo(PLL_DIV); | ||
586 | w[p0] = r0.l; | ||
587 | ssync; | ||
588 | |||
589 | /* Make sure UART is enabled - you can never be sure */ | ||
590 | |||
591 | /* | ||
592 | * Setup for console. Argument comes from the menuconfig | ||
593 | */ | ||
594 | |||
595 | #ifdef CONFIG_BAUD_9600 | ||
596 | #define CONSOLE_BAUD_RATE 9600 | ||
597 | #elif CONFIG_BAUD_19200 | ||
598 | #define CONSOLE_BAUD_RATE 19200 | ||
599 | #elif CONFIG_BAUD_38400 | ||
600 | #define CONSOLE_BAUD_RATE 38400 | ||
601 | #elif CONFIG_BAUD_57600 | ||
602 | #define CONSOLE_BAUD_RATE 57600 | ||
603 | #elif CONFIG_BAUD_115200 | ||
604 | #define CONSOLE_BAUD_RATE 115200 | ||
605 | #endif | ||
606 | |||
607 | p0.h = hi(UART_GCTL); | ||
608 | p0.l = lo(UART_GCTL); | ||
609 | r0 = 0x00(Z); | ||
610 | w[p0] = r0.L; /* To Turn off UART clocks */ | ||
611 | ssync; | ||
612 | |||
613 | p0.h = hi(UART_LCR); | ||
614 | p0.l = lo(UART_LCR); | ||
615 | r0 = 0x83(Z); | ||
616 | w[p0] = r0.L; /* To enable DLL writes */ | ||
617 | ssync; | ||
618 | |||
619 | R1 = (((CONFIG_CLKIN_HZ * CONFIG_VCO_MULT) / CONFIG_SCLK_DIV) / (CONSOLE_BAUD_RATE * 16)); | ||
620 | |||
621 | p0.h = hi(UART_DLL); | ||
622 | p0.l = lo(UART_DLL); | ||
623 | r0 = 0xFF(Z); | ||
624 | r0 = R1 & R0; | ||
625 | w[p0] = r0.L; | ||
626 | ssync; | ||
627 | |||
628 | p0.h = hi(UART_DLH); | ||
629 | p0.l = lo(UART_DLH); | ||
630 | r1 >>= 8 ; | ||
631 | w[p0] = r1.L; | ||
632 | ssync; | ||
633 | |||
634 | p0.h = hi(UART_GCTL); | ||
635 | p0.l = lo(UART_GCTL); | ||
636 | r0 = 0x0(Z); | ||
637 | w[p0] = r0.L; /* To enable UART clock */ | ||
638 | ssync; | ||
639 | |||
640 | p0.h = hi(UART_LCR); | ||
641 | p0.l = lo(UART_LCR); | ||
642 | r0 = 0x03(Z); | ||
643 | w[p0] = r0.L; /* To Turn on UART */ | ||
644 | ssync; | ||
645 | |||
646 | p0.h = hi(UART_GCTL); | ||
647 | p0.l = lo(UART_GCTL); | ||
648 | r0 = 0x01(Z); | ||
649 | w[p0] = r0.L; /* To Turn on UART Clocks */ | ||
650 | ssync; | ||
651 | |||
652 | P0.h = hi(UART_THR); | ||
653 | P0.l = lo(UART_THR); | ||
654 | P1.h = hi(UART_LSR); | ||
655 | P1.l = lo(UART_LSR); | ||
656 | |||
657 | R0.L = 'K'; | ||
658 | call .Lwait_char; | ||
659 | R0.L='e'; | ||
660 | call .Lwait_char; | ||
661 | R0.L='r'; | ||
662 | call .Lwait_char; | ||
663 | R0.L='n' | ||
664 | call .Lwait_char; | ||
665 | R0.L='e' | ||
666 | call .Lwait_char; | ||
667 | R0.L='l'; | ||
668 | call .Lwait_char; | ||
669 | R0.L=' '; | ||
670 | call .Lwait_char; | ||
671 | R0.L='c'; | ||
672 | call .Lwait_char; | ||
673 | R0.L='r'; | ||
674 | call .Lwait_char; | ||
675 | R0.L='a'; | ||
676 | call .Lwait_char; | ||
677 | R0.L='s'; | ||
678 | call .Lwait_char; | ||
679 | R0.L='h'; | ||
680 | call .Lwait_char; | ||
681 | R0.L='\r'; | ||
682 | call .Lwait_char; | ||
683 | R0.L='\n'; | ||
684 | call .Lwait_char; | ||
685 | |||
686 | R0.L='S'; | ||
687 | call .Lwait_char; | ||
688 | R0.L='E'; | ||
689 | call .Lwait_char; | ||
690 | R0.L='Q' | ||
691 | call .Lwait_char; | ||
692 | R0.L='S' | ||
693 | call .Lwait_char; | ||
694 | R0.L='T'; | ||
695 | call .Lwait_char; | ||
696 | R0.L='A'; | ||
697 | call .Lwait_char; | ||
698 | R0.L='T'; | ||
699 | call .Lwait_char; | ||
700 | R0.L='='; | ||
701 | call .Lwait_char; | ||
702 | R2 = SEQSTAT; | ||
703 | call .Ldump_reg; | ||
704 | |||
705 | R0.L=' '; | ||
706 | call .Lwait_char; | ||
707 | R0.L='R'; | ||
708 | call .Lwait_char; | ||
709 | R0.L='E' | ||
710 | call .Lwait_char; | ||
711 | R0.L='T' | ||
712 | call .Lwait_char; | ||
713 | R0.L='X'; | ||
714 | call .Lwait_char; | ||
715 | R0.L='='; | ||
716 | call .Lwait_char; | ||
717 | R2 = RETX; | ||
718 | call .Ldump_reg; | ||
719 | |||
720 | R0.L='\r'; | ||
721 | call .Lwait_char; | ||
722 | R0.L='\n'; | ||
723 | call .Lwait_char; | ||
724 | |||
725 | .Ldebug_kernel_start_trap_done: | ||
726 | JUMP .Ldebug_kernel_start_trap_done; | ||
727 | .Ldump_reg: | ||
728 | R3 = 32; | ||
729 | R4 = 0x0F; | ||
730 | R5 = ':'; /* one past 9 */ | ||
731 | |||
732 | .Ldump_reg2: | ||
733 | R0 = R2; | ||
734 | R3 += -4; | ||
735 | R0 >>>= R3; | ||
736 | R0 = R0 & R4; | ||
737 | R0 += 0x30; | ||
738 | CC = R0 <= R5; | ||
739 | if CC JUMP .Ldump_reg1; | ||
740 | R0 += 7; | ||
741 | |||
742 | .Ldump_reg1: | ||
743 | R1.l = W[P1]; | ||
744 | CC = BITTST(R1, 5); | ||
745 | if !CC JUMP .Ldump_reg1; | ||
746 | W[P0] = r0; | ||
747 | |||
748 | CC = R3 == 0; | ||
749 | if !CC JUMP .Ldump_reg2 | ||
750 | RTS; | ||
751 | |||
752 | .Lwait_char: | ||
753 | R1.l = W[P1]; | ||
754 | CC = BITTST(R1, 5); | ||
755 | if !CC JUMP .Lwait_char; | ||
756 | W[P0] = r0; | ||
757 | RTS; | ||
758 | |||
759 | #endif /* CONFIG_DEBUG_KERNEL_START */ | ||
760 | |||
761 | .data | ||
762 | |||
763 | /* | ||
764 | * Set up the usable of RAM stuff. Size of RAM is determined then | ||
765 | * an initial stack set up at the end. | ||
766 | */ | ||
767 | |||
768 | .align 4 | ||
769 | __rambase: | ||
770 | .long 0 | ||
771 | __ramstart: | ||
772 | .long 0 | ||
773 | __ramend: | ||
774 | .long 0 | ||
diff --git a/arch/blackfin/mach-bf533/ints-priority.c b/arch/blackfin/mach-bf533/ints-priority.c new file mode 100644 index 000000000000..36a693345204 --- /dev/null +++ b/arch/blackfin/mach-bf533/ints-priority.c | |||
@@ -0,0 +1,65 @@ | |||
1 | /* | ||
2 | * File: arch/blackfin/mach-bf533/ints-priority.c | ||
3 | * Based on: | ||
4 | * Author: Michael Hennerich | ||
5 | * | ||
6 | * Created: ? | ||
7 | * Description: Set up the interupt priorities | ||
8 | * | ||
9 | * Modified: | ||
10 | * Copyright 2004-2006 Analog Devices Inc. | ||
11 | * | ||
12 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or modify | ||
15 | * it under the terms of the GNU General Public License as published by | ||
16 | * the Free Software Foundation; either version 2 of the License, or | ||
17 | * (at your option) any later version. | ||
18 | * | ||
19 | * This program is distributed in the hope that it will be useful, | ||
20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
22 | * GNU General Public License for more details. | ||
23 | * | ||
24 | * You should have received a copy of the GNU General Public License | ||
25 | * along with this program; if not, see the file COPYING, or write | ||
26 | * to the Free Software Foundation, Inc., | ||
27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
28 | */ | ||
29 | |||
30 | #include <linux/module.h> | ||
31 | #include <asm/blackfin.h> | ||
32 | #include <asm/irq.h> | ||
33 | |||
34 | void program_IAR(void) | ||
35 | { | ||
36 | /* Program the IAR0 Register with the configured priority */ | ||
37 | bfin_write_SIC_IAR0(((CONFIG_PLLWAKE_ERROR - 7) << PLLWAKE_ERROR_POS) | | ||
38 | ((CONFIG_DMA_ERROR - 7) << DMA_ERROR_POS) | | ||
39 | ((CONFIG_PPI_ERROR - 7) << PPI_ERROR_POS) | | ||
40 | ((CONFIG_SPORT0_ERROR - 7) << SPORT0_ERROR_POS) | | ||
41 | ((CONFIG_SPI_ERROR - 7) << SPI_ERROR_POS) | | ||
42 | ((CONFIG_SPORT1_ERROR - 7) << SPORT1_ERROR_POS) | | ||
43 | ((CONFIG_UART_ERROR - 7) << UART_ERROR_POS) | | ||
44 | ((CONFIG_RTC_ERROR - 7) << RTC_ERROR_POS)); | ||
45 | |||
46 | bfin_write_SIC_IAR1(((CONFIG_DMA0_PPI - 7) << DMA0_PPI_POS) | | ||
47 | ((CONFIG_DMA1_SPORT0RX - 7) << DMA1_SPORT0RX_POS) | | ||
48 | ((CONFIG_DMA2_SPORT0TX - 7) << DMA2_SPORT0TX_POS) | | ||
49 | ((CONFIG_DMA3_SPORT1RX - 7) << DMA3_SPORT1RX_POS) | | ||
50 | ((CONFIG_DMA4_SPORT1TX - 7) << DMA4_SPORT1TX_POS) | | ||
51 | ((CONFIG_DMA5_SPI - 7) << DMA5_SPI_POS) | | ||
52 | ((CONFIG_DMA6_UARTRX - 7) << DMA6_UARTRX_POS) | | ||
53 | ((CONFIG_DMA7_UARTTX - 7) << DMA7_UARTTX_POS)); | ||
54 | |||
55 | bfin_write_SIC_IAR2(((CONFIG_TIMER0 - 7) << TIMER0_POS) | | ||
56 | ((CONFIG_TIMER1 - 7) << TIMER1_POS) | | ||
57 | ((CONFIG_TIMER2 - 7) << TIMER2_POS) | | ||
58 | ((CONFIG_PFA - 7) << PFA_POS) | | ||
59 | ((CONFIG_PFB - 7) << PFB_POS) | | ||
60 | ((CONFIG_MEMDMA0 - 7) << MEMDMA0_POS) | | ||
61 | ((CONFIG_MEMDMA1 - 7) << MEMDMA1_POS) | | ||
62 | ((CONFIG_WDTIMER - 7) << WDTIMER_POS)); | ||
63 | |||
64 | SSYNC(); | ||
65 | } | ||