Commit 62d636aa2ac2171fd8105cca0b9ea96117b66547
omap: remove omap5912osk board support
Emails to the board maintainer "Rishi Bhattacharya <rishi@ti.com>" have been bouncing. Tom suggested to remove this board. Remove also omap1510_udc.c because this is the last board to enable it. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Suggested-by: Tom Rini <trini@ti.com>
Showing 13 changed files with 1 additions and 3295 deletions Side-by-side Diff
- arch/arm/Kconfig
- board/ti/omap5912osk/Kconfig
- board/ti/omap5912osk/MAINTAINERS
- board/ti/omap5912osk/Makefile
- board/ti/omap5912osk/config.mk
- board/ti/omap5912osk/lowlevel_init.S
- board/ti/omap5912osk/omap5912osk.c
- configs/omap5912osk_defconfig
- doc/README.scrapyard
- drivers/usb/gadget/Makefile
- drivers/usb/gadget/omap1510_udc.c
- include/configs/omap1510.h
- include/configs/omap5912osk.h
... | ... | @@ -287,9 +287,6 @@ |
287 | 287 | config TARGET_NHK8815 |
288 | 288 | bool "Support nhk8815" |
289 | 289 | |
290 | -config TARGET_OMAP5912OSK | |
291 | - bool "Support omap5912osk" | |
292 | - | |
293 | 290 | config TARGET_EDMINIV2 |
294 | 291 | bool "Support edminiv2" |
295 | 292 | |
... | ... | @@ -977,7 +974,6 @@ |
977 | 974 | source "board/ti/dra7xx/Kconfig" |
978 | 975 | source "board/ti/evm/Kconfig" |
979 | 976 | source "board/ti/ks2_evm/Kconfig" |
980 | -source "board/ti/omap5912osk/Kconfig" | |
981 | 977 | source "board/ti/omap5_uevm/Kconfig" |
982 | 978 | source "board/ti/panda/Kconfig" |
983 | 979 | source "board/ti/sdp3430/Kconfig" |
1 | -if TARGET_OMAP5912OSK | |
2 | - | |
3 | -config SYS_CPU | |
4 | - string | |
5 | - default "arm926ejs" | |
6 | - | |
7 | -config SYS_BOARD | |
8 | - string | |
9 | - default "omap5912osk" | |
10 | - | |
11 | -config SYS_VENDOR | |
12 | - string | |
13 | - default "ti" | |
14 | - | |
15 | -config SYS_SOC | |
16 | - string | |
17 | - default "omap" | |
18 | - | |
19 | -config SYS_CONFIG_NAME | |
20 | - string | |
21 | - default "omap5912osk" | |
22 | - | |
23 | -endif |
1 | -# | |
2 | -# (C) Copyright 2002-2004 | |
3 | -# Gary Jennejohn, DENX Software Engineering, <garyj@denx.de> | |
4 | -# David Mueller, ELSOFT AG, <d.mueller@elsoft.ch> | |
5 | -# | |
6 | -# (C) Copyright 2003 | |
7 | -# Texas Instruments, <www.ti.com> | |
8 | -# Kshitij Gupta <Kshitij@ti.com> | |
9 | -# | |
10 | -# (C) Copyright 2004 | |
11 | -# Texas Instruments, <www.ti.com> | |
12 | -# Rishi Bhattacharya <rishi@ti.com> | |
13 | -# | |
14 | -# TI OSK board with OMAP5912 (ARM925EJS) cpu | |
15 | -# see http://www.ti.com/ for more information on Texas Instruments | |
16 | -# | |
17 | -# OSK has 1 bank of 32 MB SDRAM | |
18 | -# Physical Address: | |
19 | -# 1000'0000 to 1200'0000 | |
20 | -# | |
21 | -# | |
22 | -# Linux-Kernel is expected to be at 1000'8000, entry 1000'8000 | |
23 | -# (mem base + reserved) | |
24 | -# | |
25 | -# When running from RAM use address 1108'0000, otherwise when | |
26 | -# booting from NOR flash link to address 0000'0000. | |
27 | -# | |
28 | - | |
29 | -CONFIG_SYS_TEXT_BASE = 0x00000000 | |
30 | -#CONFIG_SYS_TEXT_BASE = 0x11080000 |
1 | -/* | |
2 | - * Board specific setup info | |
3 | - * | |
4 | - * (C) Copyright 2003 | |
5 | - * Texas Instruments, <www.ti.com> | |
6 | - * Kshitij Gupta <Kshitij@ti.com> | |
7 | - * | |
8 | - * Modified for OMAP 1610 H2 board by Nishant Kamat, Jan 2004 | |
9 | - * | |
10 | - * Modified for OMAP 5912 OSK board by Rishi Bhattacharya, Apr 2004 | |
11 | - * SPDX-License-Identifier: GPL-2.0+ | |
12 | - */ | |
13 | - | |
14 | -#include <config.h> | |
15 | -#include <version.h> | |
16 | - | |
17 | -#if defined(CONFIG_OMAP1610) | |
18 | -#include <./configs/omap1510.h> | |
19 | -#endif | |
20 | - | |
21 | -.globl lowlevel_init | |
22 | -lowlevel_init: | |
23 | - | |
24 | - /*------------------------------------------------------* | |
25 | - * Ensure i-cache is enabled * | |
26 | - * To configure TC regs without fetching instruction * | |
27 | - *------------------------------------------------------*/ | |
28 | - mrc p15, 0, r0, c1, c0 | |
29 | - orr r0, r0, #0x1000 | |
30 | - mcr p15, 0, r0, c1, c0 | |
31 | - | |
32 | - /*------------------------------------------------------* | |
33 | - *mask all IRQs by setting all bits in the INTMR default* | |
34 | - *------------------------------------------------------*/ | |
35 | - mov r1, #0xffffffff | |
36 | - ldr r0, =REG_IHL1_MIR | |
37 | - str r1, [r0] | |
38 | - ldr r0, =REG_IHL2_MIR | |
39 | - str r1, [r0] | |
40 | - | |
41 | - /*------------------------------------------------------* | |
42 | - * Set up ARM CLM registers (IDLECT1) * | |
43 | - *------------------------------------------------------*/ | |
44 | - ldr r0, REG_ARM_IDLECT1 | |
45 | - ldr r1, VAL_ARM_IDLECT1 | |
46 | - str r1, [r0] | |
47 | - | |
48 | - /*------------------------------------------------------* | |
49 | - * Set up ARM CLM registers (IDLECT2) * | |
50 | - *------------------------------------------------------*/ | |
51 | - ldr r0, REG_ARM_IDLECT2 | |
52 | - ldr r1, VAL_ARM_IDLECT2 | |
53 | - str r1, [r0] | |
54 | - | |
55 | - /*------------------------------------------------------* | |
56 | - * Set up ARM CLM registers (IDLECT3) * | |
57 | - *------------------------------------------------------*/ | |
58 | - ldr r0, REG_ARM_IDLECT3 | |
59 | - ldr r1, VAL_ARM_IDLECT3 | |
60 | - str r1, [r0] | |
61 | - | |
62 | - mov r1, #0x01 /* PER_EN bit */ | |
63 | - ldr r0, REG_ARM_RSTCT2 | |
64 | - strh r1, [r0] /* CLKM; Peripheral reset. */ | |
65 | - | |
66 | - /* Set CLKM to Sync-Scalable */ | |
67 | - mov r1, #0x1000 | |
68 | - ldr r0, REG_ARM_SYSST | |
69 | - | |
70 | - mov r2, #0 | |
71 | -1: cmp r2, #1 | |
72 | - streqh r1, [r0] | |
73 | - add r2, r2, #1 | |
74 | - cmp r2, #0x100 /* wait for any bubbles to finish */ | |
75 | - bne 1b | |
76 | - | |
77 | - ldr r1, VAL_ARM_CKCTL | |
78 | - ldr r0, REG_ARM_CKCTL | |
79 | - strh r1, [r0] | |
80 | - | |
81 | - /* a few nops to let settle */ | |
82 | - nop | |
83 | - nop | |
84 | - nop | |
85 | - nop | |
86 | - nop | |
87 | - nop | |
88 | - nop | |
89 | - nop | |
90 | - nop | |
91 | - nop | |
92 | - | |
93 | - /* setup DPLL 1 */ | |
94 | - /* Ramp up the clock to 96Mhz */ | |
95 | - ldr r1, VAL_DPLL1_CTL | |
96 | - ldr r0, REG_DPLL1_CTL | |
97 | - strh r1, [r0] | |
98 | - ands r1, r1, #0x10 /* Check if PLL is enabled. */ | |
99 | - beq lock_end /* Do not look for lock if BYPASS selected */ | |
100 | -2: | |
101 | - ldrh r1, [r0] | |
102 | - ands r1, r1, #0x01 /* Check the LOCK bit.*/ | |
103 | - beq 2b /* loop until bit goes hi. */ | |
104 | -lock_end: | |
105 | - | |
106 | - /*------------------------------------------------------* | |
107 | - * Turn off the watchdog during init... * | |
108 | - *------------------------------------------------------*/ | |
109 | - ldr r0, REG_WATCHDOG | |
110 | - ldr r1, WATCHDOG_VAL1 | |
111 | - str r1, [r0] | |
112 | - ldr r1, WATCHDOG_VAL2 | |
113 | - str r1, [r0] | |
114 | - ldr r0, REG_WSPRDOG | |
115 | - ldr r1, WSPRDOG_VAL1 | |
116 | - str r1, [r0] | |
117 | - ldr r0, REG_WWPSDOG | |
118 | - | |
119 | -watch1Wait: | |
120 | - ldr r1, [r0] | |
121 | - tst r1, #0x10 | |
122 | - bne watch1Wait | |
123 | - | |
124 | - ldr r0, REG_WSPRDOG | |
125 | - ldr r1, WSPRDOG_VAL2 | |
126 | - str r1, [r0] | |
127 | - ldr r0, REG_WWPSDOG | |
128 | -watch2Wait: | |
129 | - ldr r1, [r0] | |
130 | - tst r1, #0x10 | |
131 | - bne watch2Wait | |
132 | - | |
133 | - /* Set memory timings corresponding to the new clock speed */ | |
134 | - ldr r3, VAL_SDRAM_CONFIG_SDF0 | |
135 | - | |
136 | - /* Check execution location to determine current execution location | |
137 | - * and branch to appropriate initialization code. | |
138 | - */ | |
139 | - mov r0, #0x10000000 /* Load physical SDRAM base. */ | |
140 | - mov r1, pc /* Get current execution location. */ | |
141 | - cmp r1, r0 /* Compare. */ | |
142 | - bge skip_sdram /* Skip over EMIF-fast initialization if running from SDRAM. */ | |
143 | - | |
144 | - /* identify the device revision, -- TMX or TMP(TMS) */ | |
145 | - ldr r0, REG_DEVICE_ID | |
146 | - ldr r1, [r0] | |
147 | - | |
148 | - ldr r0, VAL_DEVICE_ID_TMP | |
149 | - mov r1, r1, lsl #15 | |
150 | - mov r1, r1, lsr #16 | |
151 | - cmp r0, r1 | |
152 | - bne skip_TMP_Patch | |
153 | - | |
154 | - /* Enable TMP/TMS device new features */ | |
155 | - mov r0, #1 | |
156 | - ldr r1, REG_TC_EMIFF_DOUBLER | |
157 | - str r0, [r1] | |
158 | - | |
159 | - /* Enable new ac parameters */ | |
160 | - mov r0, #0x0b | |
161 | - ldr r1, REG_SDRAM_CONFIG2 | |
162 | - str r0, [r1] | |
163 | - | |
164 | - ldr r3, VAL_SDRAM_CONFIG_SDF1 | |
165 | - | |
166 | -skip_TMP_Patch: | |
167 | - | |
168 | - /* | |
169 | - * Delay for SDRAM initialization. | |
170 | - */ | |
171 | - mov r0, #0x1800 /* value should be checked */ | |
172 | -3: | |
173 | - subs r0, r0, #0x1 /* Decrement count */ | |
174 | - bne 3b | |
175 | - | |
176 | - /* | |
177 | - * Set SDRAM control values. Disable refresh before MRS command. | |
178 | - */ | |
179 | - | |
180 | - /* mobile ddr operation */ | |
181 | - ldr r0, REG_SDRAM_OPERATION | |
182 | - mov r2, #07 | |
183 | - str r2, [r0] | |
184 | - | |
185 | - /* config register */ | |
186 | - ldr r0, REG_SDRAM_CONFIG | |
187 | - str r3, [r0] | |
188 | - | |
189 | - /* manual command register */ | |
190 | - ldr r0, REG_SDRAM_MANUAL_CMD | |
191 | - | |
192 | - /* issue set cke high */ | |
193 | - mov r1, #CMD_SDRAM_CKE_SET_HIGH | |
194 | - str r1, [r0] | |
195 | - | |
196 | - /* issue nop */ | |
197 | - mov r1, #CMD_SDRAM_NOP | |
198 | - str r1, [r0] | |
199 | - | |
200 | - mov r2, #0x0100 | |
201 | -waitMDDR1: | |
202 | - subs r2, r2, #1 | |
203 | - bne waitMDDR1 /* delay loop */ | |
204 | - | |
205 | - /* issue precharge */ | |
206 | - mov r1, #CMD_SDRAM_PRECHARGE | |
207 | - str r1, [r0] | |
208 | - | |
209 | - /* issue autorefresh x 2 */ | |
210 | - mov r1, #CMD_SDRAM_AUTOREFRESH | |
211 | - str r1, [r0] | |
212 | - str r1, [r0] | |
213 | - | |
214 | - /* mrs register ddr mobile */ | |
215 | - ldr r0, REG_SDRAM_MRS | |
216 | - mov r1, #0x33 | |
217 | - str r1, [r0] | |
218 | - | |
219 | - /* emrs1 low-power register */ | |
220 | - ldr r0, REG_SDRAM_EMRS1 | |
221 | - /* self refresh on all banks */ | |
222 | - mov r1, #0 | |
223 | - str r1, [r0] | |
224 | - | |
225 | - ldr r0, REG_DLL_URD_CONTROL | |
226 | - ldr r1, DLL_URD_CONTROL_VAL | |
227 | - str r1, [r0] | |
228 | - | |
229 | - ldr r0, REG_DLL_LRD_CONTROL | |
230 | - ldr r1, DLL_LRD_CONTROL_VAL | |
231 | - str r1, [r0] | |
232 | - | |
233 | - ldr r0, REG_DLL_WRT_CONTROL | |
234 | - ldr r1, DLL_WRT_CONTROL_VAL | |
235 | - str r1, [r0] | |
236 | - | |
237 | - /* delay loop */ | |
238 | - mov r0, #0x0100 | |
239 | -waitMDDR2: | |
240 | - subs r0, r0, #1 | |
241 | - bne waitMDDR2 | |
242 | - | |
243 | - /* | |
244 | - * Delay for SDRAM initialization. | |
245 | - */ | |
246 | - mov r0, #0x1800 | |
247 | -4: | |
248 | - subs r0, r0, #1 /* Decrement count. */ | |
249 | - bne 4b | |
250 | - b common_tc | |
251 | - | |
252 | -skip_sdram: | |
253 | - ldr r0, REG_SDRAM_CONFIG | |
254 | - str r3, [r0] | |
255 | - | |
256 | -common_tc: | |
257 | - /* slow interface */ | |
258 | - ldr r1, VAL_TC_EMIFS_CS0_CONFIG | |
259 | - ldr r0, REG_TC_EMIFS_CS0_CONFIG | |
260 | - str r1, [r0] /* Chip Select 0 */ | |
261 | - | |
262 | - ldr r1, VAL_TC_EMIFS_CS1_CONFIG | |
263 | - ldr r0, REG_TC_EMIFS_CS1_CONFIG | |
264 | - str r1, [r0] /* Chip Select 1 */ | |
265 | - | |
266 | - ldr r1, VAL_TC_EMIFS_CS3_CONFIG | |
267 | - ldr r0, REG_TC_EMIFS_CS3_CONFIG | |
268 | - str r1, [r0] /* Chip Select 3 */ | |
269 | - | |
270 | - ldr r1, VAL_TC_EMIFS_DWS | |
271 | - ldr r0, REG_TC_EMIFS_DWS | |
272 | - str r1, [r0] /* Enable EMIFS.RDY for CS1 (ether) */ | |
273 | - | |
274 | -#ifdef CONFIG_H2_OMAP1610 | |
275 | - /* inserting additional 2 clock cycle hold time for LAN */ | |
276 | - ldr r0, REG_TC_EMIFS_CS1_ADVANCED | |
277 | - ldr r1, VAL_TC_EMIFS_CS1_ADVANCED | |
278 | - str r1, [r0] | |
279 | -#endif | |
280 | - /* Start MPU Timer 1 */ | |
281 | - ldr r0, REG_MPU_LOAD_TIMER | |
282 | - ldr r1, VAL_MPU_LOAD_TIMER | |
283 | - str r1, [r0] | |
284 | - | |
285 | - ldr r0, REG_MPU_CNTL_TIMER | |
286 | - ldr r1, VAL_MPU_CNTL_TIMER | |
287 | - str r1, [r0] | |
288 | - | |
289 | - /* | |
290 | - * Setup a temporary stack | |
291 | - */ | |
292 | - ldr sp, SRAM_STACK | |
293 | - bic sp, sp, #7 /* 8-byte alignment for ABI compliance */ | |
294 | - | |
295 | - /* | |
296 | - * Save the old lr(passed in ip) and the current lr to stack | |
297 | - */ | |
298 | - push {ip, lr} | |
299 | - | |
300 | - /* | |
301 | - * go setup pll, mux, memory | |
302 | - */ | |
303 | - bl s_init | |
304 | - pop {ip, pc} | |
305 | - | |
306 | - /* back to arch calling code */ | |
307 | - mov pc, lr | |
308 | - | |
309 | - /* the literal pools origin */ | |
310 | - .ltorg | |
311 | - | |
312 | -REG_DEVICE_ID: /* 32 bits */ | |
313 | - .word 0xfffe2004 | |
314 | -REG_TC_EMIFS_CONFIG: | |
315 | - .word 0xfffecc0c | |
316 | -REG_TC_EMIFS_CS0_CONFIG: /* 32 bits */ | |
317 | - .word 0xfffecc10 | |
318 | -REG_TC_EMIFS_CS1_CONFIG: /* 32 bits */ | |
319 | - .word 0xfffecc14 | |
320 | -REG_TC_EMIFS_CS2_CONFIG: /* 32 bits */ | |
321 | - .word 0xfffecc18 | |
322 | -REG_TC_EMIFS_CS3_CONFIG: /* 32 bits */ | |
323 | - .word 0xfffecc1c | |
324 | -REG_TC_EMIFS_DWS: /* 32 bits */ | |
325 | - .word 0xfffecc40 | |
326 | -#ifdef CONFIG_H2_OMAP1610 | |
327 | -REG_TC_EMIFS_CS1_ADVANCED: /* 32 bits */ | |
328 | - .word 0xfffecc54 | |
329 | -#endif | |
330 | - | |
331 | -/* MPU clock/reset/power mode control registers */ | |
332 | -REG_ARM_CKCTL: /* 16 bits */ | |
333 | - .word 0xfffece00 | |
334 | -REG_ARM_IDLECT3: /* 16 bits */ | |
335 | - .word 0xfffece24 | |
336 | -REG_ARM_IDLECT2: /* 16 bits */ | |
337 | - .word 0xfffece08 | |
338 | -REG_ARM_IDLECT1: /* 16 bits */ | |
339 | - .word 0xfffece04 | |
340 | -REG_ARM_RSTCT2: /* 16 bits */ | |
341 | - .word 0xfffece14 | |
342 | -REG_ARM_SYSST: /* 16 bits */ | |
343 | - .word 0xfffece18 | |
344 | - | |
345 | -/* DPLL control registers */ | |
346 | -REG_DPLL1_CTL: /* 16 bits */ | |
347 | - .word 0xfffecf00 | |
348 | - | |
349 | -/* Watch Dog register */ | |
350 | -/* secure watchdog stop */ | |
351 | -REG_WSPRDOG: | |
352 | - .word 0xfffeb048 | |
353 | -/* watchdog write pending */ | |
354 | -REG_WWPSDOG: | |
355 | - .word 0xfffeb034 | |
356 | - | |
357 | -WSPRDOG_VAL1: | |
358 | - .word 0x0000aaaa | |
359 | -WSPRDOG_VAL2: | |
360 | - .word 0x00005555 | |
361 | - | |
362 | -/* SDRAM config is: auto refresh enabled, 16 bit 4 bank, | |
363 | - counter @8192 rows, 10 ns, 8 burst */ | |
364 | -REG_SDRAM_CONFIG: | |
365 | - .word 0xfffecc20 | |
366 | -REG_SDRAM_CONFIG2: | |
367 | - .word 0xfffecc3c | |
368 | -REG_TC_EMIFF_DOUBLER: /* 32 bits */ | |
369 | - .word 0xfffecc60 | |
370 | - | |
371 | -/* Operation register */ | |
372 | -REG_SDRAM_OPERATION: | |
373 | - .word 0xfffecc80 | |
374 | - | |
375 | -/* Manual command register */ | |
376 | -REG_SDRAM_MANUAL_CMD: | |
377 | - .word 0xfffecc84 | |
378 | - | |
379 | -/* SDRAM MRS (New) config is: CAS latency is 2, burst length 8 */ | |
380 | -REG_SDRAM_MRS: | |
381 | - .word 0xfffecc70 | |
382 | - | |
383 | -/* SDRAM MRS (New) config is: CAS latency is 2, burst length 8 */ | |
384 | -REG_SDRAM_EMRS1: | |
385 | - .word 0xfffecc78 | |
386 | - | |
387 | -/* WRT DLL register */ | |
388 | -REG_DLL_WRT_CONTROL: | |
389 | - .word 0xfffecc68 | |
390 | -DLL_WRT_CONTROL_VAL: | |
391 | - .word 0x03f00002 /* Phase of 72deg, write offset +31 */ | |
392 | - | |
393 | -/* URD DLL register */ | |
394 | -REG_DLL_URD_CONTROL: | |
395 | - .word 0xfffeccc0 | |
396 | -DLL_URD_CONTROL_VAL: | |
397 | - .word 0x00800002 /* Phase of 72deg, read offset +31 */ | |
398 | - | |
399 | -/* LRD DLL register */ | |
400 | -REG_DLL_LRD_CONTROL: | |
401 | - .word 0xfffecccc | |
402 | -DLL_LRD_CONTROL_VAL: | |
403 | - .word 0x00800002 /* read offset +31 */ | |
404 | - | |
405 | -REG_WATCHDOG: | |
406 | - .word 0xfffec808 | |
407 | -WATCHDOG_VAL1: | |
408 | - .word 0x000000f5 | |
409 | -WATCHDOG_VAL2: | |
410 | - .word 0x000000a0 | |
411 | - | |
412 | -REG_MPU_LOAD_TIMER: | |
413 | - .word 0xfffec504 | |
414 | -REG_MPU_CNTL_TIMER: | |
415 | - .word 0xfffec500 | |
416 | -VAL_MPU_LOAD_TIMER: | |
417 | - .word 0xffffffff | |
418 | -VAL_MPU_CNTL_TIMER: | |
419 | - .word 0xffffffa1 | |
420 | - | |
421 | -/* 96 MHz Samsung Mobile DDR */ | |
422 | -/* Original setting for TMX device */ | |
423 | -VAL_SDRAM_CONFIG_SDF0: | |
424 | - .word 0x0014e6fe | |
425 | - | |
426 | -/* NEW_SYS_FREQ mode (valid only TMP/TMS devices) */ | |
427 | -VAL_SDRAM_CONFIG_SDF1: | |
428 | - .word 0x0114e6fe | |
429 | - | |
430 | -VAL_ARM_CKCTL: | |
431 | - .word 0x2000 /* was: 0x3000, now use CLK_REF for timer input */ | |
432 | -VAL_DPLL1_CTL: | |
433 | - .word 0x2830 | |
434 | - | |
435 | -#ifdef CONFIG_OSK_OMAP5912 | |
436 | -VAL_TC_EMIFS_CS0_CONFIG: | |
437 | - .word 0x002130b0 | |
438 | -VAL_TC_EMIFS_CS1_CONFIG: | |
439 | - .word 0x00001133 | |
440 | -VAL_TC_EMIFS_CS2_CONFIG: | |
441 | - .word 0x000055f0 | |
442 | -VAL_TC_EMIFS_CS3_CONFIG: | |
443 | - .word 0x88013141 | |
444 | -VAL_TC_EMIFS_DWS: /* Enable EMIFS.RDY for CS1 access (ether) */ | |
445 | - .word 0x000000c0 | |
446 | -VAL_DEVICE_ID_TMP: /* TMP/TMS=0xb65f, TMX=0xb58c */ | |
447 | - .word 0xb65f | |
448 | -#endif | |
449 | - | |
450 | -#ifdef CONFIG_H2_OMAP1610 | |
451 | -VAL_TC_EMIFS_CS0_CONFIG: | |
452 | - .word 0x00203331 | |
453 | -VAL_TC_EMIFS_CS1_CONFIG: | |
454 | - .word 0x8180fff3 | |
455 | -VAL_TC_EMIFS_CS2_CONFIG: | |
456 | - .word 0xf800f22a | |
457 | -VAL_TC_EMIFS_CS3_CONFIG: | |
458 | - .word 0x88013141 | |
459 | -VAL_TC_EMIFS_CS1_ADVANCED: | |
460 | - .word 0x00000022 | |
461 | -#endif | |
462 | - | |
463 | -VAL_ARM_IDLECT1: | |
464 | - .word 0x00000400 | |
465 | -VAL_ARM_IDLECT2: | |
466 | - .word 0x00000886 | |
467 | -VAL_ARM_IDLECT3: | |
468 | - .word 0x00000015 | |
469 | - | |
470 | -SRAM_STACK: | |
471 | - .word CONFIG_SYS_INIT_SP_ADDR | |
472 | - | |
473 | -/* command values */ | |
474 | -.equ CMD_SDRAM_NOP, 0x00000000 | |
475 | -.equ CMD_SDRAM_PRECHARGE, 0x00000001 | |
476 | -.equ CMD_SDRAM_AUTOREFRESH, 0x00000002 | |
477 | -.equ CMD_SDRAM_CKE_SET_HIGH, 0x00000007 |
1 | -/* | |
2 | - * (C) Copyright 2002 | |
3 | - * Sysgo Real-Time Solutions, GmbH <www.elinos.com> | |
4 | - * Marius Groeger <mgroeger@sysgo.de> | |
5 | - * | |
6 | - * (C) Copyright 2002 | |
7 | - * David Mueller, ELSOFT AG, <d.mueller@elsoft.ch> | |
8 | - * | |
9 | - * (C) Copyright 2003 | |
10 | - * Texas Instruments, <www.ti.com> | |
11 | - * Kshitij Gupta <Kshitij@ti.com> | |
12 | - * | |
13 | - * (C) Copyright 2004 | |
14 | - * Texas Instruments, <www.ti.com> | |
15 | - * Rishi Bhattacharya <rishi@ti.com> | |
16 | - * | |
17 | - * SPDX-License-Identifier: GPL-2.0+ | |
18 | - */ | |
19 | - | |
20 | -#include <common.h> | |
21 | -#include <netdev.h> | |
22 | -#if defined(CONFIG_OMAP1610) | |
23 | -#include <./configs/omap1510.h> | |
24 | -#endif | |
25 | - | |
26 | -DECLARE_GLOBAL_DATA_PTR; | |
27 | - | |
28 | -void flash__init (void); | |
29 | -void ether__init (void); | |
30 | -void set_muxconf_regs (void); | |
31 | -void peripheral_power_enable (void); | |
32 | - | |
33 | -#define COMP_MODE_ENABLE ((unsigned int)0x0000EAEF) | |
34 | - | |
35 | -static inline void delay (unsigned long loops) | |
36 | -{ | |
37 | - __asm__ volatile ("1:\n" | |
38 | - "subs %0, %1, #1\n" | |
39 | - "bne 1b":"=r" (loops):"0" (loops)); | |
40 | -} | |
41 | - | |
42 | -/* | |
43 | - * Miscellaneous platform dependent initialisations | |
44 | - */ | |
45 | - | |
46 | -int board_init (void) | |
47 | -{ | |
48 | - gd->bd->bi_arch_number = MACH_TYPE_OMAP_OSK; | |
49 | - | |
50 | - /* adress of boot parameters */ | |
51 | - gd->bd->bi_boot_params = 0x10000100; | |
52 | - | |
53 | - flash__init(); | |
54 | - ether__init(); | |
55 | - | |
56 | - return 0; | |
57 | -} | |
58 | - | |
59 | -void s_init(void) | |
60 | -{ | |
61 | - /* Configure MUX settings */ | |
62 | - set_muxconf_regs (); | |
63 | - peripheral_power_enable (); | |
64 | - | |
65 | -/* this speeds up your boot a quite a bit. However to make it | |
66 | - * work, you need make sure your kernel startup flush bug is fixed. | |
67 | - * ... rkw ... | |
68 | - */ | |
69 | - icache_enable (); | |
70 | -} | |
71 | - | |
72 | -/****************************** | |
73 | - Routine: | |
74 | - Description: | |
75 | -******************************/ | |
76 | -void flash__init (void) | |
77 | -{ | |
78 | -#define EMIFS_GlB_Config_REG 0xfffecc0c | |
79 | - unsigned int regval; | |
80 | - regval = *((volatile unsigned int *) EMIFS_GlB_Config_REG); | |
81 | - /* Turn off write protection for flash devices. */ | |
82 | - regval = regval | 0x0001; | |
83 | - *((volatile unsigned int *) EMIFS_GlB_Config_REG) = regval; | |
84 | -} | |
85 | -/************************************************************* | |
86 | - Routine:ether__init | |
87 | - Description: take the Ethernet controller out of reset and wait | |
88 | - for the EEPROM load to complete. | |
89 | -*************************************************************/ | |
90 | -void ether__init (void) | |
91 | -{ | |
92 | -#define ETH_CONTROL_REG 0x0480000b | |
93 | - int i; | |
94 | - | |
95 | - *((volatile unsigned short *) 0xfffece08) = 0x03FF; | |
96 | - *((volatile unsigned short *) 0xfffb3824) = 0x8000; | |
97 | - *((volatile unsigned short *) 0xfffb3830) = 0x0000; | |
98 | - *((volatile unsigned short *) 0xfffb3834) = 0x0009; | |
99 | - *((volatile unsigned short *) 0xfffb3838) = 0x0009; | |
100 | - *((volatile unsigned short *) 0xfffb3818) = 0x0002; | |
101 | - *((volatile unsigned short *) 0xfffb382C) = 0x0048; | |
102 | - *((volatile unsigned short *) 0xfffb3824) = 0x8603; | |
103 | - udelay (3); | |
104 | - for (i=0;i<2000;i++); | |
105 | - *((volatile unsigned short *) 0xfffb381C) = 0x6610; | |
106 | - udelay (30); | |
107 | - for (i=0;i<10000;i++); | |
108 | - | |
109 | - *((volatile unsigned char *) ETH_CONTROL_REG) &= ~0x01; | |
110 | - udelay (3); | |
111 | - | |
112 | - | |
113 | -} | |
114 | - | |
115 | -/****************************** | |
116 | - Routine: | |
117 | - Description: | |
118 | -******************************/ | |
119 | -int dram_init(void) | |
120 | -{ | |
121 | - gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE); | |
122 | - | |
123 | - return 0; | |
124 | -} | |
125 | - | |
126 | -void dram_init_banksize(void) | |
127 | -{ | |
128 | - gd->bd->bi_dram[0].start = PHYS_SDRAM_1; | |
129 | - gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; | |
130 | -} | |
131 | - | |
132 | -/****************************************************** | |
133 | - Routine: set_muxconf_regs | |
134 | - Description: Setting up the configuration Mux registers | |
135 | - specific to the hardware | |
136 | -*******************************************************/ | |
137 | -void set_muxconf_regs (void) | |
138 | -{ | |
139 | - volatile unsigned int *MuxConfReg; | |
140 | - /* set each registers to its reset value; */ | |
141 | - MuxConfReg = | |
142 | - (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_0); | |
143 | - /* setup for UART1 */ | |
144 | - *MuxConfReg &= ~(0x02000000); /* bit 25 */ | |
145 | - /* setup for UART2 */ | |
146 | - *MuxConfReg &= ~(0x01000000); /* bit 24 */ | |
147 | - /* Disable Uwire CS Hi-Z */ | |
148 | - *MuxConfReg |= 0x08000000; | |
149 | - MuxConfReg = | |
150 | - (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_3); | |
151 | - *MuxConfReg = 0x00000000; | |
152 | - MuxConfReg = | |
153 | - (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_4); | |
154 | - *MuxConfReg = 0x00000000; | |
155 | - MuxConfReg = | |
156 | - (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_5); | |
157 | - *MuxConfReg = 0x00000000; | |
158 | - MuxConfReg = | |
159 | - (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_6); | |
160 | - /*setup mux for UART3 */ | |
161 | - *MuxConfReg |= 0x00000001; /* bit3, 1, 0 (mux0 5,5,26) */ | |
162 | - *MuxConfReg &= ~0x0000003e; | |
163 | - MuxConfReg = | |
164 | - (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_7); | |
165 | - *MuxConfReg = 0x00000000; | |
166 | - MuxConfReg = | |
167 | - (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_8); | |
168 | - /* Disable Uwire CS Hi-Z */ | |
169 | - *MuxConfReg |= 0x00001200; /*bit 9 for CS0 12 for CS3 */ | |
170 | - MuxConfReg = | |
171 | - (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_9); | |
172 | - /* Need to turn on bits 21 and 12 in FUNC_MUX_CTRL_9 so the */ | |
173 | - /* hardware will actually use TX and RTS based on bit 25 in */ | |
174 | - /* FUNC_MUX_CTRL_0. I told you this thing was screwy! */ | |
175 | - *MuxConfReg |= 0x00201000; | |
176 | - MuxConfReg = | |
177 | - (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_A); | |
178 | - *MuxConfReg = 0x00000000; | |
179 | - MuxConfReg = | |
180 | - (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_B); | |
181 | - *MuxConfReg = 0x00000000; | |
182 | - MuxConfReg = | |
183 | - (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_C); | |
184 | - /* setup for UART2 */ | |
185 | - /* Need to turn on bits 27 and 24 in FUNC_MUX_CTRL_C so the */ | |
186 | - /* hardware will actually use TX and RTS based on bit 24 in */ | |
187 | - /* FUNC_MUX_CTRL_0. */ | |
188 | - *MuxConfReg |= 0x09000000; | |
189 | - MuxConfReg = | |
190 | - (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_D); | |
191 | - *MuxConfReg |= 0x00000020; | |
192 | - MuxConfReg = | |
193 | - (volatile unsigned int *) ((unsigned int) PULL_DWN_CTRL_0); | |
194 | - *MuxConfReg = 0x00000000; | |
195 | - MuxConfReg = | |
196 | - (volatile unsigned int *) ((unsigned int) PULL_DWN_CTRL_1); | |
197 | - *MuxConfReg = 0x00000000; | |
198 | - /* mux setup for SD/MMC driver */ | |
199 | - MuxConfReg = | |
200 | - (volatile unsigned int *) ((unsigned int) PULL_DWN_CTRL_2); | |
201 | - *MuxConfReg &= 0xFFFE0FFF; | |
202 | - MuxConfReg = | |
203 | - (volatile unsigned int *) ((unsigned int) PULL_DWN_CTRL_3); | |
204 | - *MuxConfReg = 0x00000000; | |
205 | - MuxConfReg = | |
206 | - (volatile unsigned int *) ((unsigned int) MOD_CONF_CTRL_0); | |
207 | - /* bit 13 for MMC2 XOR_CLK */ | |
208 | - *MuxConfReg &= ~(0x00002000); | |
209 | - /* bit 29 for UART 1 */ | |
210 | - *MuxConfReg &= ~(0x00002000); | |
211 | - MuxConfReg = | |
212 | - (volatile unsigned int *) ((unsigned int) FUNC_MUX_CTRL_0); | |
213 | - /* Configure for USB. Turn on VBUS_CTRL and VBUS_MODE. */ | |
214 | - *MuxConfReg |= 0x000C0000; | |
215 | - MuxConfReg = | |
216 | - (volatile unsigned int *) ((unsigned int)USB_TRANSCEIVER_CTRL); | |
217 | - *MuxConfReg &= ~(0x00000070); | |
218 | - *MuxConfReg &= ~(0x00000008); | |
219 | - *MuxConfReg |= 0x00000003; | |
220 | - *MuxConfReg |= 0x00000180; | |
221 | - MuxConfReg = | |
222 | - (volatile unsigned int *) ((unsigned int) MOD_CONF_CTRL_0); | |
223 | - /* bit 17, software controls VBUS */ | |
224 | - *MuxConfReg &= ~(0x00020000); | |
225 | - /* Enable USB 48 and 12M clocks */ | |
226 | - *MuxConfReg |= 0x00000200; | |
227 | - *MuxConfReg &= ~(0x00000180); | |
228 | - /*2.75V for MMCSDIO1 */ | |
229 | - MuxConfReg = | |
230 | - (volatile unsigned int *) ((unsigned int) VOLTAGE_CTRL_0); | |
231 | - *MuxConfReg = 0x00001FE7; | |
232 | - MuxConfReg = | |
233 | - (volatile unsigned int *) ((unsigned int) PU_PD_SEL_0); | |
234 | - *MuxConfReg = 0x00000000; | |
235 | - MuxConfReg = | |
236 | - (volatile unsigned int *) ((unsigned int) PU_PD_SEL_1); | |
237 | - *MuxConfReg = 0x00000000; | |
238 | - MuxConfReg = | |
239 | - (volatile unsigned int *) ((unsigned int) PU_PD_SEL_2); | |
240 | - *MuxConfReg = 0x00000000; | |
241 | - MuxConfReg = | |
242 | - (volatile unsigned int *) ((unsigned int) PU_PD_SEL_3); | |
243 | - *MuxConfReg = 0x00000000; | |
244 | - MuxConfReg = | |
245 | - (volatile unsigned int *) ((unsigned int) PU_PD_SEL_4); | |
246 | - *MuxConfReg = 0x00000000; | |
247 | - MuxConfReg = | |
248 | - (volatile unsigned int *) ((unsigned int) PULL_DWN_CTRL_4); | |
249 | - *MuxConfReg = 0x00000000; | |
250 | - /* Turn on UART2 48 MHZ clock */ | |
251 | - MuxConfReg = | |
252 | - (volatile unsigned int *) ((unsigned int) MOD_CONF_CTRL_0); | |
253 | - *MuxConfReg |= 0x40000000; | |
254 | - MuxConfReg = | |
255 | - (volatile unsigned int *) ((unsigned int) USB_OTG_CTRL); | |
256 | - /* setup for USB VBus detection OMAP161x */ | |
257 | - *MuxConfReg |= 0x00040000; /* bit 18 */ | |
258 | - MuxConfReg = | |
259 | - (volatile unsigned int *) ((unsigned int) PU_PD_SEL_2); | |
260 | - /* PullUps for SD/MMC driver */ | |
261 | - *MuxConfReg |= ~(0xFFFE0FFF); | |
262 | - MuxConfReg = | |
263 | - (volatile unsigned int *) ((unsigned int)COMP_MODE_CTRL_0); | |
264 | - *MuxConfReg = COMP_MODE_ENABLE; | |
265 | -} | |
266 | - | |
267 | -/****************************************************** | |
268 | - Routine: peripheral_power_enable | |
269 | - Description: Enable the power for UART1 | |
270 | -*******************************************************/ | |
271 | -void peripheral_power_enable (void) | |
272 | -{ | |
273 | -#define UART1_48MHZ_ENABLE ((unsigned short)0x0200) | |
274 | -#define SW_CLOCK_REQUEST ((volatile unsigned short *)0xFFFE0834) | |
275 | - | |
276 | - *SW_CLOCK_REQUEST |= UART1_48MHZ_ENABLE; | |
277 | -} | |
278 | - | |
279 | -/* | |
280 | - * Check Board Identity | |
281 | - */ | |
282 | -int checkboard(void) | |
283 | -{ | |
284 | - char buf[64]; | |
285 | - int i = getenv_f("serial#", buf, sizeof(buf)); | |
286 | - | |
287 | - puts("Board: OSK5912"); | |
288 | - | |
289 | - if (i > 0) { | |
290 | - puts(", serial# "); | |
291 | - puts(buf); | |
292 | - } | |
293 | - putc('\n'); | |
294 | - | |
295 | - return (0); | |
296 | -} | |
297 | - | |
298 | -#ifdef CONFIG_CMD_NET | |
299 | -int board_eth_init(bd_t *bis) | |
300 | -{ | |
301 | - int rc = 0; | |
302 | -#ifdef CONFIG_LAN91C96 | |
303 | - rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE); | |
304 | -#endif | |
305 | - return rc; | |
306 | -} | |
307 | -#endif |
... | ... | @@ -12,6 +12,7 @@ |
12 | 12 | |
13 | 13 | Board Arch CPU Commit Removed Last known maintainer/contact |
14 | 14 | ================================================================================================= |
15 | +omap5912osk arm arm926ejs - - Rishi Bhattacharya <rishi@ti.com> | |
15 | 16 | p1023rds powerpc mpc85xx d0bc5140 2014-07-22 Roy Zang <tie-fei.zang@freescale.com> |
16 | 17 | spc1920 powerpc mpc8xx 98ad54be 2014-07-07 |
17 | 18 | v37 powerpc mpc8xx b8c1438a 2014-07-07 |
1 | -/* | |
2 | - * (C) Copyright 2003 | |
3 | - * Gerry Hamel, geh@ti.com, Texas Instruments | |
4 | - * | |
5 | - * Based on | |
6 | - * linux/drivers/usb/device/bi/omap.c | |
7 | - * TI OMAP1510 USB bus interface driver | |
8 | - * | |
9 | - * Author: MontaVista Software, Inc. | |
10 | - * source@mvista.com | |
11 | - * (C) Copyright 2002 | |
12 | - * | |
13 | - * SPDX-License-Identifier: GPL-2.0+ | |
14 | - */ | |
15 | - | |
16 | -#include <common.h> | |
17 | -#include <asm/io.h> | |
18 | -#include <usbdevice.h> | |
19 | -#include <usb/omap1510_udc.h> | |
20 | -#include <usb/udc.h> | |
21 | - | |
22 | -#include "ep0.h" | |
23 | - | |
24 | - | |
25 | -#define UDC_INIT_MDELAY 80 /* Device settle delay */ | |
26 | -#define UDC_MAX_ENDPOINTS 31 /* Number of endpoints on this UDC */ | |
27 | - | |
28 | -/* Some kind of debugging output... */ | |
29 | -#if 1 | |
30 | -#define UDCDBG(str) | |
31 | -#define UDCDBGA(fmt,args...) | |
32 | -#else /* The bugs still exists... */ | |
33 | -#define UDCDBG(str) serial_printf("[%s] %s:%d: " str "\n", __FILE__,__FUNCTION__,__LINE__) | |
34 | -#define UDCDBGA(fmt,args...) serial_printf("[%s] %s:%d: " fmt "\n", __FILE__,__FUNCTION__,__LINE__, ##args) | |
35 | -#endif | |
36 | - | |
37 | -#if 1 | |
38 | -#define UDCREG(name) | |
39 | -#define UDCREGL(name) | |
40 | -#else /* The bugs still exists... */ | |
41 | -#define UDCREG(name) serial_printf("%s():%d: %s[%08x]=%.4x\n",__FUNCTION__,__LINE__, (#name), name, inw(name)) /* For 16-bit regs */ | |
42 | -#define UDCREGL(name) serial_printf("%s():%d: %s[%08x]=%.8x\n",__FUNCTION__,__LINE__, (#name), name, inl(name)) /* For 32-bit regs */ | |
43 | -#endif | |
44 | - | |
45 | - | |
46 | -static struct urb *ep0_urb = NULL; | |
47 | - | |
48 | -static struct usb_device_instance *udc_device; /* Used in interrupt handler */ | |
49 | -static u16 udc_devstat = 0; /* UDC status (DEVSTAT) */ | |
50 | -static u32 udc_interrupts = 0; | |
51 | - | |
52 | -static void udc_stall_ep (unsigned int ep_addr); | |
53 | - | |
54 | - | |
55 | -static struct usb_endpoint_instance *omap1510_find_ep (int ep) | |
56 | -{ | |
57 | - int i; | |
58 | - | |
59 | - for (i = 0; i < udc_device->bus->max_endpoints; i++) { | |
60 | - if (udc_device->bus->endpoint_array[i].endpoint_address == ep) | |
61 | - return &udc_device->bus->endpoint_array[i]; | |
62 | - } | |
63 | - return NULL; | |
64 | -} | |
65 | - | |
66 | -/* ************************************************************************** */ | |
67 | -/* IO | |
68 | - */ | |
69 | - | |
70 | -/* | |
71 | - * omap1510_prepare_endpoint_for_rx | |
72 | - * | |
73 | - * This function implements TRM Figure 14-11. | |
74 | - * | |
75 | - * The endpoint to prepare for transfer is specified as a physical endpoint | |
76 | - * number. For OUT (rx) endpoints 1 through 15, the corresponding endpoint | |
77 | - * configuration register is checked to see if the endpoint is ISO or not. | |
78 | - * If the OUT endpoint is valid and is non-ISO then its FIFO is enabled. | |
79 | - * No action is taken for endpoint 0 or for IN (tx) endpoints 16 through 30. | |
80 | - */ | |
81 | -static void omap1510_prepare_endpoint_for_rx (int ep_addr) | |
82 | -{ | |
83 | - int ep_num = ep_addr & USB_ENDPOINT_NUMBER_MASK; | |
84 | - | |
85 | - UDCDBGA ("omap1510_prepare_endpoint %x", ep_addr); | |
86 | - if (((ep_addr & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT)) { | |
87 | - if ((inw (UDC_EP_RX (ep_num)) & | |
88 | - (UDC_EPn_RX_Valid | UDC_EPn_RX_Iso)) == | |
89 | - UDC_EPn_RX_Valid) { | |
90 | - /* rx endpoint is valid, non-ISO, so enable its FIFO */ | |
91 | - outw (UDC_EP_Sel | ep_num, UDC_EP_NUM); | |
92 | - outw (UDC_Set_FIFO_En, UDC_CTRL); | |
93 | - outw (0, UDC_EP_NUM); | |
94 | - } | |
95 | - } | |
96 | -} | |
97 | - | |
98 | -/* omap1510_configure_endpoints | |
99 | - * | |
100 | - * This function implements TRM Figure 14-10. | |
101 | - */ | |
102 | -static void omap1510_configure_endpoints (struct usb_device_instance *device) | |
103 | -{ | |
104 | - int ep; | |
105 | - struct usb_bus_instance *bus; | |
106 | - struct usb_endpoint_instance *endpoint; | |
107 | - unsigned short ep_ptr; | |
108 | - unsigned short ep_size; | |
109 | - unsigned short ep_isoc; | |
110 | - unsigned short ep_doublebuffer; | |
111 | - int ep_addr; | |
112 | - int packet_size; | |
113 | - int buffer_size; | |
114 | - int attributes; | |
115 | - | |
116 | - bus = device->bus; | |
117 | - | |
118 | - /* There is a dedicated 2048 byte buffer for USB packets that may be | |
119 | - * arbitrarily partitioned among the endpoints on 8-byte boundaries. | |
120 | - * The first 8 bytes are reserved for receiving setup packets on | |
121 | - * endpoint 0. | |
122 | - */ | |
123 | - ep_ptr = 8; /* reserve the first 8 bytes for the setup fifo */ | |
124 | - | |
125 | - for (ep = 0; ep < bus->max_endpoints; ep++) { | |
126 | - endpoint = bus->endpoint_array + ep; | |
127 | - ep_addr = endpoint->endpoint_address; | |
128 | - if ((ep_addr & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) { | |
129 | - /* IN endpoint */ | |
130 | - packet_size = endpoint->tx_packetSize; | |
131 | - attributes = endpoint->tx_attributes; | |
132 | - } else { | |
133 | - /* OUT endpoint */ | |
134 | - packet_size = endpoint->rcv_packetSize; | |
135 | - attributes = endpoint->rcv_attributes; | |
136 | - } | |
137 | - | |
138 | - switch (packet_size) { | |
139 | - case 0: | |
140 | - ep_size = 0; | |
141 | - break; | |
142 | - case 8: | |
143 | - ep_size = 0; | |
144 | - break; | |
145 | - case 16: | |
146 | - ep_size = 1; | |
147 | - break; | |
148 | - case 32: | |
149 | - ep_size = 2; | |
150 | - break; | |
151 | - case 64: | |
152 | - ep_size = 3; | |
153 | - break; | |
154 | - case 128: | |
155 | - ep_size = 4; | |
156 | - break; | |
157 | - case 256: | |
158 | - ep_size = 5; | |
159 | - break; | |
160 | - case 512: | |
161 | - ep_size = 6; | |
162 | - break; | |
163 | - default: | |
164 | - UDCDBGA ("ep 0x%02x has bad packet size %d", | |
165 | - ep_addr, packet_size); | |
166 | - packet_size = 0; | |
167 | - ep_size = 0; | |
168 | - break; | |
169 | - } | |
170 | - | |
171 | - switch (attributes & USB_ENDPOINT_XFERTYPE_MASK) { | |
172 | - case USB_ENDPOINT_XFER_CONTROL: | |
173 | - case USB_ENDPOINT_XFER_BULK: | |
174 | - case USB_ENDPOINT_XFER_INT: | |
175 | - default: | |
176 | - /* A non-isochronous endpoint may optionally be | |
177 | - * double-buffered. For now we disable | |
178 | - * double-buffering. | |
179 | - */ | |
180 | - ep_doublebuffer = 0; | |
181 | - ep_isoc = 0; | |
182 | - if (packet_size > 64) | |
183 | - packet_size = 0; | |
184 | - if (!ep || !ep_doublebuffer) | |
185 | - buffer_size = packet_size; | |
186 | - else | |
187 | - buffer_size = packet_size * 2; | |
188 | - break; | |
189 | - case USB_ENDPOINT_XFER_ISOC: | |
190 | - /* Isochronous endpoints are always double- | |
191 | - * buffered, but the double-buffering bit | |
192 | - * in the endpoint configuration register | |
193 | - * becomes the msb of the endpoint size so we | |
194 | - * set the double-buffering flag to zero. | |
195 | - */ | |
196 | - ep_doublebuffer = 0; | |
197 | - ep_isoc = 1; | |
198 | - buffer_size = packet_size * 2; | |
199 | - break; | |
200 | - } | |
201 | - | |
202 | - /* check to see if our packet buffer RAM is exhausted */ | |
203 | - if ((ep_ptr + buffer_size) > 2048) { | |
204 | - UDCDBGA ("out of packet RAM for ep 0x%02x buf size %d", ep_addr, buffer_size); | |
205 | - buffer_size = packet_size = 0; | |
206 | - } | |
207 | - | |
208 | - /* force a default configuration for endpoint 0 since it is | |
209 | - * always enabled | |
210 | - */ | |
211 | - if (!ep && ((packet_size < 8) || (packet_size > 64))) { | |
212 | - buffer_size = packet_size = 64; | |
213 | - ep_size = 3; | |
214 | - } | |
215 | - | |
216 | - if (!ep) { | |
217 | - /* configure endpoint 0 */ | |
218 | - outw ((ep_size << 12) | (ep_ptr >> 3), UDC_EP0); | |
219 | - /*UDCDBGA("ep 0 buffer offset 0x%03x packet size 0x%03x", */ | |
220 | - /* ep_ptr, packet_size); */ | |
221 | - } else if ((ep_addr & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) { | |
222 | - /* IN endpoint */ | |
223 | - if (packet_size) { | |
224 | - outw ((1 << 15) | (ep_doublebuffer << 14) | | |
225 | - (ep_size << 12) | (ep_isoc << 11) | | |
226 | - (ep_ptr >> 3), | |
227 | - UDC_EP_TX (ep_addr & | |
228 | - USB_ENDPOINT_NUMBER_MASK)); | |
229 | - UDCDBGA ("IN ep %d buffer offset 0x%03x" | |
230 | - " packet size 0x%03x", | |
231 | - ep_addr & USB_ENDPOINT_NUMBER_MASK, | |
232 | - ep_ptr, packet_size); | |
233 | - } else { | |
234 | - outw (0, | |
235 | - UDC_EP_TX (ep_addr & | |
236 | - USB_ENDPOINT_NUMBER_MASK)); | |
237 | - } | |
238 | - } else { | |
239 | - /* OUT endpoint */ | |
240 | - if (packet_size) { | |
241 | - outw ((1 << 15) | (ep_doublebuffer << 14) | | |
242 | - (ep_size << 12) | (ep_isoc << 11) | | |
243 | - (ep_ptr >> 3), | |
244 | - UDC_EP_RX (ep_addr & | |
245 | - USB_ENDPOINT_NUMBER_MASK)); | |
246 | - UDCDBGA ("OUT ep %d buffer offset 0x%03x" | |
247 | - " packet size 0x%03x", | |
248 | - ep_addr & USB_ENDPOINT_NUMBER_MASK, | |
249 | - ep_ptr, packet_size); | |
250 | - } else { | |
251 | - outw (0, | |
252 | - UDC_EP_RX (ep_addr & | |
253 | - USB_ENDPOINT_NUMBER_MASK)); | |
254 | - } | |
255 | - } | |
256 | - ep_ptr += buffer_size; | |
257 | - } | |
258 | -} | |
259 | - | |
260 | -/* omap1510_deconfigure_device | |
261 | - * | |
262 | - * This function balances omap1510_configure_device. | |
263 | - */ | |
264 | -static void omap1510_deconfigure_device (void) | |
265 | -{ | |
266 | - int epnum; | |
267 | - | |
268 | - UDCDBG ("clear Cfg_Lock"); | |
269 | - outw (inw (UDC_SYSCON1) & ~UDC_Cfg_Lock, UDC_SYSCON1); | |
270 | - UDCREG (UDC_SYSCON1); | |
271 | - | |
272 | - /* deconfigure all endpoints */ | |
273 | - for (epnum = 1; epnum <= 15; epnum++) { | |
274 | - outw (0, UDC_EP_RX (epnum)); | |
275 | - outw (0, UDC_EP_TX (epnum)); | |
276 | - } | |
277 | -} | |
278 | - | |
279 | -/* omap1510_configure_device | |
280 | - * | |
281 | - * This function implements TRM Figure 14-9. | |
282 | - */ | |
283 | -static void omap1510_configure_device (struct usb_device_instance *device) | |
284 | -{ | |
285 | - omap1510_configure_endpoints (device); | |
286 | - | |
287 | - | |
288 | - /* Figure 14-9 indicates we should enable interrupts here, but we have | |
289 | - * other routines (udc_all_interrupts, udc_suspended_interrupts) to | |
290 | - * do that. | |
291 | - */ | |
292 | - | |
293 | - UDCDBG ("set Cfg_Lock"); | |
294 | - outw (inw (UDC_SYSCON1) | UDC_Cfg_Lock, UDC_SYSCON1); | |
295 | - UDCREG (UDC_SYSCON1); | |
296 | -} | |
297 | - | |
298 | -/* omap1510_write_noniso_tx_fifo | |
299 | - * | |
300 | - * This function implements TRM Figure 14-30. | |
301 | - * | |
302 | - * If the endpoint has an active tx_urb, then the next packet of data from the | |
303 | - * URB is written to the tx FIFO. The total amount of data in the urb is given | |
304 | - * by urb->actual_length. The maximum amount of data that can be sent in any | |
305 | - * one packet is given by endpoint->tx_packetSize. The number of data bytes | |
306 | - * from this URB that have already been transmitted is given by endpoint->sent. | |
307 | - * endpoint->last is updated by this routine with the number of data bytes | |
308 | - * transmitted in this packet. | |
309 | - * | |
310 | - * In accordance with Figure 14-30, the EP_NUM register must already have been | |
311 | - * written with the value to select the appropriate tx FIFO before this routine | |
312 | - * is called. | |
313 | - */ | |
314 | -static void omap1510_write_noniso_tx_fifo (struct usb_endpoint_instance | |
315 | - *endpoint) | |
316 | -{ | |
317 | - struct urb *urb = endpoint->tx_urb; | |
318 | - | |
319 | - if (urb) { | |
320 | - unsigned int last, i; | |
321 | - | |
322 | - UDCDBGA ("urb->buffer %p, buffer_length %d, actual_length %d", | |
323 | - urb->buffer, urb->buffer_length, urb->actual_length); | |
324 | - if ((last = | |
325 | - MIN (urb->actual_length - endpoint->sent, | |
326 | - endpoint->tx_packetSize))) { | |
327 | - u8 *cp = urb->buffer + endpoint->sent; | |
328 | - | |
329 | - UDCDBGA ("endpoint->sent %d, tx_packetSize %d, last %d", endpoint->sent, endpoint->tx_packetSize, last); | |
330 | - | |
331 | - if (((u32) cp & 1) == 0) { /* word aligned? */ | |
332 | - outsw (UDC_DATA, cp, last >> 1); | |
333 | - } else { /* byte aligned. */ | |
334 | - for (i = 0; i < (last >> 1); i++) { | |
335 | - u16 w = ((u16) cp[2 * i + 1] << 8) | | |
336 | - (u16) cp[2 * i]; | |
337 | - outw (w, UDC_DATA); | |
338 | - } | |
339 | - } | |
340 | - if (last & 1) { | |
341 | - outb (*(cp + last - 1), UDC_DATA); | |
342 | - } | |
343 | - } | |
344 | - endpoint->last = last; | |
345 | - } | |
346 | -} | |
347 | - | |
348 | -/* omap1510_read_noniso_rx_fifo | |
349 | - * | |
350 | - * This function implements TRM Figure 14-28. | |
351 | - * | |
352 | - * If the endpoint has an active rcv_urb, then the next packet of data is read | |
353 | - * from the rcv FIFO and written to rcv_urb->buffer at offset | |
354 | - * rcv_urb->actual_length to append the packet data to the data from any | |
355 | - * previous packets for this transfer. We assume that there is sufficient room | |
356 | - * left in the buffer to hold an entire packet of data. | |
357 | - * | |
358 | - * The return value is the number of bytes read from the FIFO for this packet. | |
359 | - * | |
360 | - * In accordance with Figure 14-28, the EP_NUM register must already have been | |
361 | - * written with the value to select the appropriate rcv FIFO before this routine | |
362 | - * is called. | |
363 | - */ | |
364 | -static int omap1510_read_noniso_rx_fifo (struct usb_endpoint_instance | |
365 | - *endpoint) | |
366 | -{ | |
367 | - struct urb *urb = endpoint->rcv_urb; | |
368 | - int len = 0; | |
369 | - | |
370 | - if (urb) { | |
371 | - len = inw (UDC_RXFSTAT); | |
372 | - | |
373 | - if (len) { | |
374 | - unsigned char *cp = urb->buffer + urb->actual_length; | |
375 | - | |
376 | - insw (UDC_DATA, cp, len >> 1); | |
377 | - if (len & 1) | |
378 | - *(cp + len - 1) = inb (UDC_DATA); | |
379 | - } | |
380 | - } | |
381 | - return len; | |
382 | -} | |
383 | - | |
384 | -/* omap1510_prepare_for_control_write_status | |
385 | - * | |
386 | - * This function implements TRM Figure 14-17. | |
387 | - * | |
388 | - * We have to deal here with non-autodecoded control writes that haven't already | |
389 | - * been dealt with by ep0_recv_setup. The non-autodecoded standard control | |
390 | - * write requests are: set/clear endpoint feature, set configuration, set | |
391 | - * interface, and set descriptor. ep0_recv_setup handles set/clear requests for | |
392 | - * ENDPOINT_HALT by halting the endpoint for a set request and resetting the | |
393 | - * endpoint for a clear request. ep0_recv_setup returns an error for | |
394 | - * SET_DESCRIPTOR requests which causes them to be terminated with a stall by | |
395 | - * the setup handler. A SET_INTERFACE request is handled by ep0_recv_setup by | |
396 | - * generating a DEVICE_SET_INTERFACE event. This leaves only the | |
397 | - * SET_CONFIGURATION event for us to deal with here. | |
398 | - * | |
399 | - */ | |
400 | -static void omap1510_prepare_for_control_write_status (struct urb *urb) | |
401 | -{ | |
402 | - struct usb_device_request *request = &urb->device_request;; | |
403 | - | |
404 | - /* check for a SET_CONFIGURATION request */ | |
405 | - if (request->bRequest == USB_REQ_SET_CONFIGURATION) { | |
406 | - int configuration = le16_to_cpu (request->wValue) & 0xff; | |
407 | - unsigned short devstat = inw (UDC_DEVSTAT); | |
408 | - | |
409 | - if ((devstat & (UDC_ADD | UDC_CFG)) == UDC_ADD) { | |
410 | - /* device is currently in ADDRESSED state */ | |
411 | - if (configuration) { | |
412 | - /* Assume the specified non-zero configuration | |
413 | - * value is valid and switch to the CONFIGURED | |
414 | - * state. | |
415 | - */ | |
416 | - outw (UDC_Dev_Cfg, UDC_SYSCON2); | |
417 | - } | |
418 | - } else if ((devstat & UDC_CFG) == UDC_CFG) { | |
419 | - /* device is currently in CONFIGURED state */ | |
420 | - if (!configuration) { | |
421 | - /* Switch to ADDRESSED state. */ | |
422 | - outw (UDC_Clr_Cfg, UDC_SYSCON2); | |
423 | - } | |
424 | - } | |
425 | - } | |
426 | - | |
427 | - /* select EP0 tx FIFO */ | |
428 | - outw (UDC_EP_Dir | UDC_EP_Sel, UDC_EP_NUM); | |
429 | - /* clear endpoint (no data bytes in status stage) */ | |
430 | - outw (UDC_Clr_EP, UDC_CTRL); | |
431 | - /* enable the EP0 tx FIFO */ | |
432 | - outw (UDC_Set_FIFO_En, UDC_CTRL); | |
433 | - /* deselect the endpoint */ | |
434 | - outw (UDC_EP_Dir, UDC_EP_NUM); | |
435 | -} | |
436 | - | |
437 | -/* udc_state_transition_up | |
438 | - * udc_state_transition_down | |
439 | - * | |
440 | - * Helper functions to implement device state changes. The device states and | |
441 | - * the events that transition between them are: | |
442 | - * | |
443 | - * STATE_ATTACHED | |
444 | - * || /\ | |
445 | - * \/ || | |
446 | - * DEVICE_HUB_CONFIGURED DEVICE_HUB_RESET | |
447 | - * || /\ | |
448 | - * \/ || | |
449 | - * STATE_POWERED | |
450 | - * || /\ | |
451 | - * \/ || | |
452 | - * DEVICE_RESET DEVICE_POWER_INTERRUPTION | |
453 | - * || /\ | |
454 | - * \/ || | |
455 | - * STATE_DEFAULT | |
456 | - * || /\ | |
457 | - * \/ || | |
458 | - * DEVICE_ADDRESS_ASSIGNED DEVICE_RESET | |
459 | - * || /\ | |
460 | - * \/ || | |
461 | - * STATE_ADDRESSED | |
462 | - * || /\ | |
463 | - * \/ || | |
464 | - * DEVICE_CONFIGURED DEVICE_DE_CONFIGURED | |
465 | - * || /\ | |
466 | - * \/ || | |
467 | - * STATE_CONFIGURED | |
468 | - * | |
469 | - * udc_state_transition_up transitions up (in the direction from STATE_ATTACHED | |
470 | - * to STATE_CONFIGURED) from the specified initial state to the specified final | |
471 | - * state, passing through each intermediate state on the way. If the initial | |
472 | - * state is at or above (i.e. nearer to STATE_CONFIGURED) the final state, then | |
473 | - * no state transitions will take place. | |
474 | - * | |
475 | - * udc_state_transition_down transitions down (in the direction from | |
476 | - * STATE_CONFIGURED to STATE_ATTACHED) from the specified initial state to the | |
477 | - * specified final state, passing through each intermediate state on the way. | |
478 | - * If the initial state is at or below (i.e. nearer to STATE_ATTACHED) the final | |
479 | - * state, then no state transitions will take place. | |
480 | - * | |
481 | - * These functions must only be called with interrupts disabled. | |
482 | - */ | |
483 | -static void udc_state_transition_up (usb_device_state_t initial, | |
484 | - usb_device_state_t final) | |
485 | -{ | |
486 | - if (initial < final) { | |
487 | - switch (initial) { | |
488 | - case STATE_ATTACHED: | |
489 | - usbd_device_event_irq (udc_device, | |
490 | - DEVICE_HUB_CONFIGURED, 0); | |
491 | - if (final == STATE_POWERED) | |
492 | - break; | |
493 | - case STATE_POWERED: | |
494 | - usbd_device_event_irq (udc_device, DEVICE_RESET, 0); | |
495 | - if (final == STATE_DEFAULT) | |
496 | - break; | |
497 | - case STATE_DEFAULT: | |
498 | - usbd_device_event_irq (udc_device, | |
499 | - DEVICE_ADDRESS_ASSIGNED, 0); | |
500 | - if (final == STATE_ADDRESSED) | |
501 | - break; | |
502 | - case STATE_ADDRESSED: | |
503 | - usbd_device_event_irq (udc_device, DEVICE_CONFIGURED, | |
504 | - 0); | |
505 | - case STATE_CONFIGURED: | |
506 | - break; | |
507 | - default: | |
508 | - break; | |
509 | - } | |
510 | - } | |
511 | -} | |
512 | - | |
513 | -static void udc_state_transition_down (usb_device_state_t initial, | |
514 | - usb_device_state_t final) | |
515 | -{ | |
516 | - if (initial > final) { | |
517 | - switch (initial) { | |
518 | - case STATE_CONFIGURED: | |
519 | - usbd_device_event_irq (udc_device, DEVICE_DE_CONFIGURED, 0); | |
520 | - if (final == STATE_ADDRESSED) | |
521 | - break; | |
522 | - case STATE_ADDRESSED: | |
523 | - usbd_device_event_irq (udc_device, DEVICE_RESET, 0); | |
524 | - if (final == STATE_DEFAULT) | |
525 | - break; | |
526 | - case STATE_DEFAULT: | |
527 | - usbd_device_event_irq (udc_device, DEVICE_POWER_INTERRUPTION, 0); | |
528 | - if (final == STATE_POWERED) | |
529 | - break; | |
530 | - case STATE_POWERED: | |
531 | - usbd_device_event_irq (udc_device, DEVICE_HUB_RESET, 0); | |
532 | - case STATE_ATTACHED: | |
533 | - break; | |
534 | - default: | |
535 | - break; | |
536 | - } | |
537 | - } | |
538 | -} | |
539 | - | |
540 | -/* Handle all device state changes. | |
541 | - * This function implements TRM Figure 14-21. | |
542 | - */ | |
543 | -static void omap1510_udc_state_changed (void) | |
544 | -{ | |
545 | - u16 bits; | |
546 | - u16 devstat = inw (UDC_DEVSTAT); | |
547 | - | |
548 | - UDCDBGA ("state changed, devstat %x, old %x", devstat, udc_devstat); | |
549 | - | |
550 | - bits = devstat ^ udc_devstat; | |
551 | - if (bits) { | |
552 | - if (bits & UDC_ATT) { | |
553 | - if (devstat & UDC_ATT) { | |
554 | - UDCDBG ("device attached and powered"); | |
555 | - udc_state_transition_up (udc_device->device_state, STATE_POWERED); | |
556 | - } else { | |
557 | - UDCDBG ("device detached or unpowered"); | |
558 | - udc_state_transition_down (udc_device->device_state, STATE_ATTACHED); | |
559 | - } | |
560 | - } | |
561 | - if (bits & UDC_USB_Reset) { | |
562 | - if (devstat & UDC_USB_Reset) { | |
563 | - UDCDBG ("device reset in progess"); | |
564 | - udc_state_transition_down (udc_device->device_state, STATE_POWERED); | |
565 | - } else { | |
566 | - UDCDBG ("device reset completed"); | |
567 | - } | |
568 | - } | |
569 | - if (bits & UDC_DEF) { | |
570 | - if (devstat & UDC_DEF) { | |
571 | - UDCDBG ("device entering default state"); | |
572 | - udc_state_transition_up (udc_device->device_state, STATE_DEFAULT); | |
573 | - } else { | |
574 | - UDCDBG ("device leaving default state"); | |
575 | - udc_state_transition_down (udc_device->device_state, STATE_POWERED); | |
576 | - } | |
577 | - } | |
578 | - if (bits & UDC_SUS) { | |
579 | - if (devstat & UDC_SUS) { | |
580 | - UDCDBG ("entering suspended state"); | |
581 | - usbd_device_event_irq (udc_device, DEVICE_BUS_INACTIVE, 0); | |
582 | - } else { | |
583 | - UDCDBG ("leaving suspended state"); | |
584 | - usbd_device_event_irq (udc_device, DEVICE_BUS_ACTIVITY, 0); | |
585 | - } | |
586 | - } | |
587 | - if (bits & UDC_R_WK_OK) { | |
588 | - UDCDBGA ("remote wakeup %s", (devstat & UDC_R_WK_OK) | |
589 | - ? "enabled" : "disabled"); | |
590 | - } | |
591 | - if (bits & UDC_ADD) { | |
592 | - if (devstat & UDC_ADD) { | |
593 | - UDCDBG ("default -> addressed"); | |
594 | - udc_state_transition_up (udc_device->device_state, STATE_ADDRESSED); | |
595 | - } else { | |
596 | - UDCDBG ("addressed -> default"); | |
597 | - udc_state_transition_down (udc_device->device_state, STATE_DEFAULT); | |
598 | - } | |
599 | - } | |
600 | - if (bits & UDC_CFG) { | |
601 | - if (devstat & UDC_CFG) { | |
602 | - UDCDBG ("device configured"); | |
603 | - /* The ep0_recv_setup function generates the | |
604 | - * DEVICE_CONFIGURED event when a | |
605 | - * USB_REQ_SET_CONFIGURATION setup packet is | |
606 | - * received, so we should already be in the | |
607 | - * state STATE_CONFIGURED. | |
608 | - */ | |
609 | - udc_state_transition_up (udc_device->device_state, STATE_CONFIGURED); | |
610 | - } else { | |
611 | - UDCDBG ("device deconfigured"); | |
612 | - udc_state_transition_down (udc_device->device_state, STATE_ADDRESSED); | |
613 | - } | |
614 | - } | |
615 | - } | |
616 | - | |
617 | - /* Clear interrupt source */ | |
618 | - outw (UDC_DS_Chg, UDC_IRQ_SRC); | |
619 | - | |
620 | - /* Save current DEVSTAT */ | |
621 | - udc_devstat = devstat; | |
622 | -} | |
623 | - | |
624 | -/* Handle SETUP USB interrupt. | |
625 | - * This function implements TRM Figure 14-14. | |
626 | - */ | |
627 | -static void omap1510_udc_setup (struct usb_endpoint_instance *endpoint) | |
628 | -{ | |
629 | - UDCDBG ("-> Entering device setup"); | |
630 | - | |
631 | - do { | |
632 | - const int setup_pktsize = 8; | |
633 | - unsigned char *datap = | |
634 | - (unsigned char *) &ep0_urb->device_request; | |
635 | - | |
636 | - /* Gain access to EP 0 setup FIFO */ | |
637 | - outw (UDC_Setup_Sel, UDC_EP_NUM); | |
638 | - | |
639 | - /* Read control request data */ | |
640 | - insb (UDC_DATA, datap, setup_pktsize); | |
641 | - | |
642 | - UDCDBGA ("EP0 setup read [%x %x %x %x %x %x %x %x]", | |
643 | - *(datap + 0), *(datap + 1), *(datap + 2), | |
644 | - *(datap + 3), *(datap + 4), *(datap + 5), | |
645 | - *(datap + 6), *(datap + 7)); | |
646 | - | |
647 | - /* Reset EP0 setup FIFO */ | |
648 | - outw (0, UDC_EP_NUM); | |
649 | - } while (inw (UDC_IRQ_SRC) & UDC_Setup); | |
650 | - | |
651 | - /* Try to process setup packet */ | |
652 | - if (ep0_recv_setup (ep0_urb)) { | |
653 | - /* Not a setup packet, stall next EP0 transaction */ | |
654 | - udc_stall_ep (0); | |
655 | - UDCDBG ("can't parse setup packet, still waiting for setup"); | |
656 | - return; | |
657 | - } | |
658 | - | |
659 | - /* Check direction */ | |
660 | - if ((ep0_urb->device_request.bmRequestType & USB_REQ_DIRECTION_MASK) | |
661 | - == USB_REQ_HOST2DEVICE) { | |
662 | - UDCDBG ("control write on EP0"); | |
663 | - if (le16_to_cpu (ep0_urb->device_request.wLength)) { | |
664 | - /* We don't support control write data stages. | |
665 | - * The only standard control write request with a data | |
666 | - * stage is SET_DESCRIPTOR, and ep0_recv_setup doesn't | |
667 | - * support that so we just stall those requests. A | |
668 | - * function driver might support a non-standard | |
669 | - * write request with a data stage, but it isn't | |
670 | - * obvious what we would do with the data if we read it | |
671 | - * so we'll just stall it. It seems like the API isn't | |
672 | - * quite right here. | |
673 | - */ | |
674 | -#if 0 | |
675 | - /* Here is what we would do if we did support control | |
676 | - * write data stages. | |
677 | - */ | |
678 | - ep0_urb->actual_length = 0; | |
679 | - outw (0, UDC_EP_NUM); | |
680 | - /* enable the EP0 rx FIFO */ | |
681 | - outw (UDC_Set_FIFO_En, UDC_CTRL); | |
682 | -#else | |
683 | - /* Stall this request */ | |
684 | - UDCDBG ("Stalling unsupported EP0 control write data " | |
685 | - "stage."); | |
686 | - udc_stall_ep (0); | |
687 | -#endif | |
688 | - } else { | |
689 | - omap1510_prepare_for_control_write_status (ep0_urb); | |
690 | - } | |
691 | - } else { | |
692 | - UDCDBG ("control read on EP0"); | |
693 | - /* The ep0_recv_setup function has already placed our response | |
694 | - * packet data in ep0_urb->buffer and the packet length in | |
695 | - * ep0_urb->actual_length. | |
696 | - */ | |
697 | - endpoint->tx_urb = ep0_urb; | |
698 | - endpoint->sent = 0; | |
699 | - /* select the EP0 tx FIFO */ | |
700 | - outw (UDC_EP_Dir | UDC_EP_Sel, UDC_EP_NUM); | |
701 | - /* Write packet data to the FIFO. omap1510_write_noniso_tx_fifo | |
702 | - * will update endpoint->last with the number of bytes written | |
703 | - * to the FIFO. | |
704 | - */ | |
705 | - omap1510_write_noniso_tx_fifo (endpoint); | |
706 | - /* enable the FIFO to start the packet transmission */ | |
707 | - outw (UDC_Set_FIFO_En, UDC_CTRL); | |
708 | - /* deselect the EP0 tx FIFO */ | |
709 | - outw (UDC_EP_Dir, UDC_EP_NUM); | |
710 | - } | |
711 | - | |
712 | - UDCDBG ("<- Leaving device setup"); | |
713 | -} | |
714 | - | |
715 | -/* Handle endpoint 0 RX interrupt | |
716 | - * This routine implements TRM Figure 14-16. | |
717 | - */ | |
718 | -static void omap1510_udc_ep0_rx (struct usb_endpoint_instance *endpoint) | |
719 | -{ | |
720 | - unsigned short status; | |
721 | - | |
722 | - UDCDBG ("RX on EP0"); | |
723 | - /* select EP0 rx FIFO */ | |
724 | - outw (UDC_EP_Sel, UDC_EP_NUM); | |
725 | - | |
726 | - status = inw (UDC_STAT_FLG); | |
727 | - | |
728 | - if (status & UDC_ACK) { | |
729 | - /* Check direction */ | |
730 | - if ((ep0_urb->device_request.bmRequestType | |
731 | - & USB_REQ_DIRECTION_MASK) == USB_REQ_HOST2DEVICE) { | |
732 | - /* This rx interrupt must be for a control write data | |
733 | - * stage packet. | |
734 | - * | |
735 | - * We don't support control write data stages. | |
736 | - * We should never end up here. | |
737 | - */ | |
738 | - | |
739 | - /* clear the EP0 rx FIFO */ | |
740 | - outw (UDC_Clr_EP, UDC_CTRL); | |
741 | - | |
742 | - /* deselect the EP0 rx FIFO */ | |
743 | - outw (0, UDC_EP_NUM); | |
744 | - | |
745 | - UDCDBG ("Stalling unexpected EP0 control write " | |
746 | - "data stage packet"); | |
747 | - udc_stall_ep (0); | |
748 | - } else { | |
749 | - /* This rx interrupt must be for a control read status | |
750 | - * stage packet. | |
751 | - */ | |
752 | - UDCDBG ("ACK on EP0 control read status stage packet"); | |
753 | - /* deselect EP0 rx FIFO */ | |
754 | - outw (0, UDC_EP_NUM); | |
755 | - } | |
756 | - } else if (status & UDC_STALL) { | |
757 | - UDCDBG ("EP0 stall during RX"); | |
758 | - /* deselect EP0 rx FIFO */ | |
759 | - outw (0, UDC_EP_NUM); | |
760 | - } else { | |
761 | - /* deselect EP0 rx FIFO */ | |
762 | - outw (0, UDC_EP_NUM); | |
763 | - } | |
764 | -} | |
765 | - | |
766 | -/* Handle endpoint 0 TX interrupt | |
767 | - * This routine implements TRM Figure 14-18. | |
768 | - */ | |
769 | -static void omap1510_udc_ep0_tx (struct usb_endpoint_instance *endpoint) | |
770 | -{ | |
771 | - unsigned short status; | |
772 | - struct usb_device_request *request = &ep0_urb->device_request; | |
773 | - | |
774 | - UDCDBG ("TX on EP0"); | |
775 | - /* select EP0 TX FIFO */ | |
776 | - outw (UDC_EP_Dir | UDC_EP_Sel, UDC_EP_NUM); | |
777 | - | |
778 | - status = inw (UDC_STAT_FLG); | |
779 | - if (status & UDC_ACK) { | |
780 | - /* Check direction */ | |
781 | - if ((request->bmRequestType & USB_REQ_DIRECTION_MASK) == | |
782 | - USB_REQ_HOST2DEVICE) { | |
783 | - /* This tx interrupt must be for a control write status | |
784 | - * stage packet. | |
785 | - */ | |
786 | - UDCDBG ("ACK on EP0 control write status stage packet"); | |
787 | - /* deselect EP0 TX FIFO */ | |
788 | - outw (UDC_EP_Dir, UDC_EP_NUM); | |
789 | - } else { | |
790 | - /* This tx interrupt must be for a control read data | |
791 | - * stage packet. | |
792 | - */ | |
793 | - int wLength = le16_to_cpu (request->wLength); | |
794 | - | |
795 | - /* Update our count of bytes sent so far in this | |
796 | - * transfer. | |
797 | - */ | |
798 | - endpoint->sent += endpoint->last; | |
799 | - | |
800 | - /* We are finished with this transfer if we have sent | |
801 | - * all of the bytes in our tx urb (urb->actual_length) | |
802 | - * unless we need a zero-length terminating packet. We | |
803 | - * need a zero-length terminating packet if we returned | |
804 | - * fewer bytes than were requested (wLength) by the host, | |
805 | - * and the number of bytes we returned is an exact | |
806 | - * multiple of the packet size endpoint->tx_packetSize. | |
807 | - */ | |
808 | - if ((endpoint->sent == ep0_urb->actual_length) | |
809 | - && ((ep0_urb->actual_length == wLength) | |
810 | - || (endpoint->last != | |
811 | - endpoint->tx_packetSize))) { | |
812 | - /* Done with control read data stage. */ | |
813 | - UDCDBG ("control read data stage complete"); | |
814 | - /* deselect EP0 TX FIFO */ | |
815 | - outw (UDC_EP_Dir, UDC_EP_NUM); | |
816 | - /* select EP0 RX FIFO to prepare for control | |
817 | - * read status stage. | |
818 | - */ | |
819 | - outw (UDC_EP_Sel, UDC_EP_NUM); | |
820 | - /* clear the EP0 RX FIFO */ | |
821 | - outw (UDC_Clr_EP, UDC_CTRL); | |
822 | - /* enable the EP0 RX FIFO */ | |
823 | - outw (UDC_Set_FIFO_En, UDC_CTRL); | |
824 | - /* deselect the EP0 RX FIFO */ | |
825 | - outw (0, UDC_EP_NUM); | |
826 | - } else { | |
827 | - /* We still have another packet of data to send | |
828 | - * in this control read data stage or else we | |
829 | - * need a zero-length terminating packet. | |
830 | - */ | |
831 | - UDCDBG ("ACK control read data stage packet"); | |
832 | - omap1510_write_noniso_tx_fifo (endpoint); | |
833 | - /* enable the EP0 tx FIFO to start transmission */ | |
834 | - outw (UDC_Set_FIFO_En, UDC_CTRL); | |
835 | - /* deselect EP0 TX FIFO */ | |
836 | - outw (UDC_EP_Dir, UDC_EP_NUM); | |
837 | - } | |
838 | - } | |
839 | - } else if (status & UDC_STALL) { | |
840 | - UDCDBG ("EP0 stall during TX"); | |
841 | - /* deselect EP0 TX FIFO */ | |
842 | - outw (UDC_EP_Dir, UDC_EP_NUM); | |
843 | - } else { | |
844 | - /* deselect EP0 TX FIFO */ | |
845 | - outw (UDC_EP_Dir, UDC_EP_NUM); | |
846 | - } | |
847 | -} | |
848 | - | |
849 | -/* Handle RX transaction on non-ISO endpoint. | |
850 | - * This function implements TRM Figure 14-27. | |
851 | - * The ep argument is a physical endpoint number for a non-ISO OUT endpoint | |
852 | - * in the range 1 to 15. | |
853 | - */ | |
854 | -static void omap1510_udc_epn_rx (int ep) | |
855 | -{ | |
856 | - unsigned short status; | |
857 | - | |
858 | - /* Check endpoint status */ | |
859 | - status = inw (UDC_STAT_FLG); | |
860 | - | |
861 | - if (status & UDC_ACK) { | |
862 | - int nbytes; | |
863 | - struct usb_endpoint_instance *endpoint = | |
864 | - omap1510_find_ep (ep); | |
865 | - | |
866 | - nbytes = omap1510_read_noniso_rx_fifo (endpoint); | |
867 | - usbd_rcv_complete (endpoint, nbytes, 0); | |
868 | - | |
869 | - /* enable rx FIFO to prepare for next packet */ | |
870 | - outw (UDC_Set_FIFO_En, UDC_CTRL); | |
871 | - } else if (status & UDC_STALL) { | |
872 | - UDCDBGA ("STALL on RX endpoint %d", ep); | |
873 | - } else if (status & UDC_NAK) { | |
874 | - UDCDBGA ("NAK on RX ep %d", ep); | |
875 | - } else { | |
876 | - serial_printf ("omap-bi: RX on ep %d with status %x", ep, | |
877 | - status); | |
878 | - } | |
879 | -} | |
880 | - | |
881 | -/* Handle TX transaction on non-ISO endpoint. | |
882 | - * This function implements TRM Figure 14-29. | |
883 | - * The ep argument is a physical endpoint number for a non-ISO IN endpoint | |
884 | - * in the range 16 to 30. | |
885 | - */ | |
886 | -static void omap1510_udc_epn_tx (int ep) | |
887 | -{ | |
888 | - unsigned short status; | |
889 | - | |
890 | - /*serial_printf("omap1510_udc_epn_tx( %x )\n",ep); */ | |
891 | - | |
892 | - /* Check endpoint status */ | |
893 | - status = inw (UDC_STAT_FLG); | |
894 | - | |
895 | - if (status & UDC_ACK) { | |
896 | - struct usb_endpoint_instance *endpoint = | |
897 | - omap1510_find_ep (ep); | |
898 | - | |
899 | - /* We need to transmit a terminating zero-length packet now if | |
900 | - * we have sent all of the data in this URB and the transfer | |
901 | - * size was an exact multiple of the packet size. | |
902 | - */ | |
903 | - if (endpoint->tx_urb | |
904 | - && (endpoint->last == endpoint->tx_packetSize) | |
905 | - && (endpoint->tx_urb->actual_length - endpoint->sent - | |
906 | - endpoint->last == 0)) { | |
907 | - /* Prepare to transmit a zero-length packet. */ | |
908 | - endpoint->sent += endpoint->last; | |
909 | - /* write 0 bytes of data to FIFO */ | |
910 | - omap1510_write_noniso_tx_fifo (endpoint); | |
911 | - /* enable tx FIFO to start transmission */ | |
912 | - outw (UDC_Set_FIFO_En, UDC_CTRL); | |
913 | - } else if (endpoint->tx_urb | |
914 | - && endpoint->tx_urb->actual_length) { | |
915 | - /* retire the data that was just sent */ | |
916 | - usbd_tx_complete (endpoint); | |
917 | - /* Check to see if we have more data ready to transmit | |
918 | - * now. | |
919 | - */ | |
920 | - if (endpoint->tx_urb | |
921 | - && endpoint->tx_urb->actual_length) { | |
922 | - /* write data to FIFO */ | |
923 | - omap1510_write_noniso_tx_fifo (endpoint); | |
924 | - /* enable tx FIFO to start transmission */ | |
925 | - outw (UDC_Set_FIFO_En, UDC_CTRL); | |
926 | - } | |
927 | - } | |
928 | - } else if (status & UDC_STALL) { | |
929 | - UDCDBGA ("STALL on TX endpoint %d", ep); | |
930 | - } else if (status & UDC_NAK) { | |
931 | - UDCDBGA ("NAK on TX endpoint %d", ep); | |
932 | - } else { | |
933 | - /*serial_printf("omap-bi: TX on ep %d with status %x\n", ep, status); */ | |
934 | - } | |
935 | -} | |
936 | - | |
937 | - | |
938 | -/* | |
939 | -------------------------------------------------------------------------------- | |
940 | -*/ | |
941 | - | |
942 | -/* Handle general USB interrupts and dispatch according to type. | |
943 | - * This function implements TRM Figure 14-13. | |
944 | - */ | |
945 | -void omap1510_udc_irq (void) | |
946 | -{ | |
947 | - u16 irq_src = inw (UDC_IRQ_SRC); | |
948 | - int valid_irq = 0; | |
949 | - | |
950 | - if (!(irq_src & ~UDC_SOF_Flg)) /* ignore SOF interrupts ) */ | |
951 | - return; | |
952 | - | |
953 | - UDCDBGA ("< IRQ #%d start >- %x", udc_interrupts, irq_src); | |
954 | - /*serial_printf("< IRQ #%d start >- %x\n", udc_interrupts, irq_src); */ | |
955 | - | |
956 | - if (irq_src & UDC_DS_Chg) { | |
957 | - /* Device status changed */ | |
958 | - omap1510_udc_state_changed (); | |
959 | - valid_irq++; | |
960 | - } | |
961 | - if (irq_src & UDC_EP0_RX) { | |
962 | - /* Endpoint 0 receive */ | |
963 | - outw (UDC_EP0_RX, UDC_IRQ_SRC); /* ack interrupt */ | |
964 | - omap1510_udc_ep0_rx (udc_device->bus->endpoint_array + 0); | |
965 | - valid_irq++; | |
966 | - } | |
967 | - if (irq_src & UDC_EP0_TX) { | |
968 | - /* Endpoint 0 transmit */ | |
969 | - outw (UDC_EP0_TX, UDC_IRQ_SRC); /* ack interrupt */ | |
970 | - omap1510_udc_ep0_tx (udc_device->bus->endpoint_array + 0); | |
971 | - valid_irq++; | |
972 | - } | |
973 | - if (irq_src & UDC_Setup) { | |
974 | - /* Device setup */ | |
975 | - omap1510_udc_setup (udc_device->bus->endpoint_array + 0); | |
976 | - valid_irq++; | |
977 | - } | |
978 | - /*if (!valid_irq) */ | |
979 | - /* serial_printf("unknown interrupt, IRQ_SRC %.4x\n", irq_src); */ | |
980 | - UDCDBGA ("< IRQ #%d end >", udc_interrupts); | |
981 | - udc_interrupts++; | |
982 | -} | |
983 | - | |
984 | -/* This function implements TRM Figure 14-26. */ | |
985 | -void omap1510_udc_noniso_irq (void) | |
986 | -{ | |
987 | - unsigned short epnum; | |
988 | - unsigned short irq_src = inw (UDC_IRQ_SRC); | |
989 | - int valid_irq = 0; | |
990 | - | |
991 | - if (!(irq_src & (UDC_EPn_RX | UDC_EPn_TX))) | |
992 | - return; | |
993 | - | |
994 | - UDCDBGA ("non-ISO IRQ, IRQ_SRC %x", inw (UDC_IRQ_SRC)); | |
995 | - | |
996 | - if (irq_src & UDC_EPn_RX) { /* Endpoint N OUT transaction */ | |
997 | - /* Determine the endpoint number for this interrupt */ | |
998 | - epnum = (inw (UDC_EPN_STAT) & 0x0f00) >> 8; | |
999 | - UDCDBGA ("RX on ep %x", epnum); | |
1000 | - | |
1001 | - /* acknowledge interrupt */ | |
1002 | - outw (UDC_EPn_RX, UDC_IRQ_SRC); | |
1003 | - | |
1004 | - if (epnum) { | |
1005 | - /* select the endpoint FIFO */ | |
1006 | - outw (UDC_EP_Sel | epnum, UDC_EP_NUM); | |
1007 | - | |
1008 | - omap1510_udc_epn_rx (epnum); | |
1009 | - | |
1010 | - /* deselect the endpoint FIFO */ | |
1011 | - outw (epnum, UDC_EP_NUM); | |
1012 | - } | |
1013 | - valid_irq++; | |
1014 | - } | |
1015 | - if (irq_src & UDC_EPn_TX) { /* Endpoint N IN transaction */ | |
1016 | - /* Determine the endpoint number for this interrupt */ | |
1017 | - epnum = (inw (UDC_EPN_STAT) & 0x000f) | USB_DIR_IN; | |
1018 | - UDCDBGA ("TX on ep %x", epnum); | |
1019 | - | |
1020 | - /* acknowledge interrupt */ | |
1021 | - outw (UDC_EPn_TX, UDC_IRQ_SRC); | |
1022 | - | |
1023 | - if (epnum) { | |
1024 | - /* select the endpoint FIFO */ | |
1025 | - outw (UDC_EP_Sel | UDC_EP_Dir | epnum, UDC_EP_NUM); | |
1026 | - | |
1027 | - omap1510_udc_epn_tx (epnum); | |
1028 | - | |
1029 | - /* deselect the endpoint FIFO */ | |
1030 | - outw (UDC_EP_Dir | epnum, UDC_EP_NUM); | |
1031 | - } | |
1032 | - valid_irq++; | |
1033 | - } | |
1034 | - if (!valid_irq) | |
1035 | - serial_printf (": unknown non-ISO interrupt, IRQ_SRC %.4x\n", | |
1036 | - irq_src); | |
1037 | -} | |
1038 | - | |
1039 | -/* | |
1040 | -------------------------------------------------------------------------------- | |
1041 | -*/ | |
1042 | - | |
1043 | - | |
1044 | -/* | |
1045 | - * Start of public functions. | |
1046 | - */ | |
1047 | - | |
1048 | -/* Called to start packet transmission. */ | |
1049 | -int udc_endpoint_write (struct usb_endpoint_instance *endpoint) | |
1050 | -{ | |
1051 | - unsigned short epnum = | |
1052 | - endpoint->endpoint_address & USB_ENDPOINT_NUMBER_MASK; | |
1053 | - | |
1054 | - UDCDBGA ("Starting transmit on ep %x", epnum); | |
1055 | - | |
1056 | - if (endpoint->tx_urb) { | |
1057 | - /* select the endpoint FIFO */ | |
1058 | - outw (UDC_EP_Sel | UDC_EP_Dir | epnum, UDC_EP_NUM); | |
1059 | - /* write data to FIFO */ | |
1060 | - omap1510_write_noniso_tx_fifo (endpoint); | |
1061 | - /* enable tx FIFO to start transmission */ | |
1062 | - outw (UDC_Set_FIFO_En, UDC_CTRL); | |
1063 | - /* deselect the endpoint FIFO */ | |
1064 | - outw (UDC_EP_Dir | epnum, UDC_EP_NUM); | |
1065 | - } | |
1066 | - | |
1067 | - return 0; | |
1068 | -} | |
1069 | - | |
1070 | -/* Start to initialize h/w stuff */ | |
1071 | -int udc_init (void) | |
1072 | -{ | |
1073 | - u16 udc_rev; | |
1074 | - uchar value; | |
1075 | - ulong gpio; | |
1076 | - int i; | |
1077 | - | |
1078 | - /* Let the device settle down before we start */ | |
1079 | - for (i = 0; i < UDC_INIT_MDELAY; i++) udelay(1000); | |
1080 | - | |
1081 | - udc_device = NULL; | |
1082 | - | |
1083 | - UDCDBG ("starting"); | |
1084 | - | |
1085 | - /* Check peripheral reset. Must be 1 to make sure | |
1086 | - MPU TIPB peripheral reset is inactive */ | |
1087 | - UDCREG (ARM_RSTCT2); | |
1088 | - | |
1089 | - /* Set and check clock control. | |
1090 | - * We might ought to be using the clock control API to do | |
1091 | - * this instead of fiddling with the clock registers directly | |
1092 | - * here. | |
1093 | - */ | |
1094 | - outw ((1 << 4) | (1 << 5), CLOCK_CTRL); | |
1095 | - UDCREG (CLOCK_CTRL); | |
1096 | - | |
1097 | - /* Set and check SOFT | |
1098 | - * The below line of code has been changed to perform a | |
1099 | - * read-modify-write instead of a simple write for | |
1100 | - * configuring the SOFT_REQ register. This allows the code | |
1101 | - * to be compatible with OMAP5912 and OMAP16xx devices | |
1102 | - */ | |
1103 | - outw ((1 << 4) | (1 << 3) | 1 | (inw(SOFT_REQ)), SOFT_REQ); | |
1104 | - | |
1105 | - /* Short delay to wait for DPLL */ | |
1106 | - udelay (1000); | |
1107 | - | |
1108 | - /* Print banner with device revision */ | |
1109 | - udc_rev = inw (UDC_REV) & 0xff; | |
1110 | - | |
1111 | -#ifdef CONFIG_OMAP1610 | |
1112 | - printf ("USB: TI OMAP5912 USB function module rev %d.%d\n", | |
1113 | - udc_rev >> 4, udc_rev & 0xf); | |
1114 | -#endif | |
1115 | - | |
1116 | - /* The VBUS_MODE bit selects whether VBUS detection is done via | |
1117 | - * software (1) or hardware (0). When software detection is | |
1118 | - * selected, VBUS_CTRL selects whether USB is not connected (0) | |
1119 | - * or connected (1). | |
1120 | - */ | |
1121 | - outl (inl (FUNC_MUX_CTRL_0) | UDC_VBUS_MODE, FUNC_MUX_CTRL_0); | |
1122 | - outl (inl (FUNC_MUX_CTRL_0) & ~UDC_VBUS_CTRL, FUNC_MUX_CTRL_0); | |
1123 | - UDCREGL (FUNC_MUX_CTRL_0); | |
1124 | - | |
1125 | - /* | |
1126 | - * At this point, device is ready for configuration... | |
1127 | - */ | |
1128 | - | |
1129 | - UDCDBG ("disable USB interrupts"); | |
1130 | - outw (0, UDC_IRQ_EN); | |
1131 | - UDCREG (UDC_IRQ_EN); | |
1132 | - | |
1133 | - UDCDBG ("disable USB DMA"); | |
1134 | - outw (0, UDC_DMA_IRQ_EN); | |
1135 | - UDCREG (UDC_DMA_IRQ_EN); | |
1136 | - | |
1137 | - UDCDBG ("initialize SYSCON1"); | |
1138 | - outw (UDC_Self_Pwr | UDC_Pullup_En, UDC_SYSCON1); | |
1139 | - UDCREG (UDC_SYSCON1); | |
1140 | - | |
1141 | - return 0; | |
1142 | -} | |
1143 | - | |
1144 | -/* Stall endpoint */ | |
1145 | -static void udc_stall_ep (unsigned int ep_addr) | |
1146 | -{ | |
1147 | - /*int ep_addr = PHYS_EP_TO_EP_ADDR(ep); */ | |
1148 | - int ep_num = ep_addr & USB_ENDPOINT_NUMBER_MASK; | |
1149 | - | |
1150 | - UDCDBGA ("stall ep_addr %d", ep_addr); | |
1151 | - | |
1152 | - /* REVISIT? | |
1153 | - * The OMAP TRM section 14.2.4.2 says we must check that the FIFO | |
1154 | - * is empty before halting the endpoint. The current implementation | |
1155 | - * doesn't check that the FIFO is empty. | |
1156 | - */ | |
1157 | - | |
1158 | - if (!ep_num) { | |
1159 | - outw (UDC_Stall_Cmd, UDC_SYSCON2); | |
1160 | - } else if ((ep_addr & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) { | |
1161 | - if (inw (UDC_EP_RX (ep_num)) & UDC_EPn_RX_Valid) { | |
1162 | - /* we have a valid rx endpoint, so halt it */ | |
1163 | - outw (UDC_EP_Sel | ep_num, UDC_EP_NUM); | |
1164 | - outw (UDC_Set_Halt, UDC_CTRL); | |
1165 | - outw (ep_num, UDC_EP_NUM); | |
1166 | - } | |
1167 | - } else { | |
1168 | - if (inw (UDC_EP_TX (ep_num)) & UDC_EPn_TX_Valid) { | |
1169 | - /* we have a valid tx endpoint, so halt it */ | |
1170 | - outw (UDC_EP_Sel | UDC_EP_Dir | ep_num, UDC_EP_NUM); | |
1171 | - outw (UDC_Set_Halt, UDC_CTRL); | |
1172 | - outw (ep_num, UDC_EP_NUM); | |
1173 | - } | |
1174 | - } | |
1175 | -} | |
1176 | - | |
1177 | -/* Reset endpoint */ | |
1178 | -#if 0 | |
1179 | -static void udc_reset_ep (unsigned int ep_addr) | |
1180 | -{ | |
1181 | - /*int ep_addr = PHYS_EP_TO_EP_ADDR(ep); */ | |
1182 | - int ep_num = ep_addr & USB_ENDPOINT_NUMBER_MASK; | |
1183 | - | |
1184 | - UDCDBGA ("reset ep_addr %d", ep_addr); | |
1185 | - | |
1186 | - if (!ep_num) { | |
1187 | - /* control endpoint 0 can't be reset */ | |
1188 | - } else if ((ep_addr & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) { | |
1189 | - UDCDBGA ("UDC_EP_RX(%d) = 0x%04x", ep_num, | |
1190 | - inw (UDC_EP_RX (ep_num))); | |
1191 | - if (inw (UDC_EP_RX (ep_num)) & UDC_EPn_RX_Valid) { | |
1192 | - /* we have a valid rx endpoint, so reset it */ | |
1193 | - outw (ep_num | UDC_EP_Sel, UDC_EP_NUM); | |
1194 | - outw (UDC_Reset_EP, UDC_CTRL); | |
1195 | - outw (ep_num, UDC_EP_NUM); | |
1196 | - UDCDBGA ("OUT endpoint %d reset", ep_num); | |
1197 | - } | |
1198 | - } else { | |
1199 | - UDCDBGA ("UDC_EP_TX(%d) = 0x%04x", ep_num, | |
1200 | - inw (UDC_EP_TX (ep_num))); | |
1201 | - /* Resetting of tx endpoints seems to be causing the USB function | |
1202 | - * module to fail, which causes problems when the driver is | |
1203 | - * uninstalled. We'll skip resetting tx endpoints for now until | |
1204 | - * we figure out what the problem is. | |
1205 | - */ | |
1206 | -#if 0 | |
1207 | - if (inw (UDC_EP_TX (ep_num)) & UDC_EPn_TX_Valid) { | |
1208 | - /* we have a valid tx endpoint, so reset it */ | |
1209 | - outw (ep_num | UDC_EP_Dir | UDC_EP_Sel, UDC_EP_NUM); | |
1210 | - outw (UDC_Reset_EP, UDC_CTRL); | |
1211 | - outw (ep_num | UDC_EP_Dir, UDC_EP_NUM); | |
1212 | - UDCDBGA ("IN endpoint %d reset", ep_num); | |
1213 | - } | |
1214 | -#endif | |
1215 | - } | |
1216 | -} | |
1217 | -#endif | |
1218 | - | |
1219 | -/* ************************************************************************** */ | |
1220 | - | |
1221 | -/** | |
1222 | - * udc_check_ep - check logical endpoint | |
1223 | - * | |
1224 | - * Return physical endpoint number to use for this logical endpoint or zero if not valid. | |
1225 | - */ | |
1226 | -#if 0 | |
1227 | -int udc_check_ep (int logical_endpoint, int packetsize) | |
1228 | -{ | |
1229 | - if ((logical_endpoint == 0x80) || | |
1230 | - ((logical_endpoint & 0x8f) != logical_endpoint)) { | |
1231 | - return 0; | |
1232 | - } | |
1233 | - | |
1234 | - switch (packetsize) { | |
1235 | - case 8: | |
1236 | - case 16: | |
1237 | - case 32: | |
1238 | - case 64: | |
1239 | - case 128: | |
1240 | - case 256: | |
1241 | - case 512: | |
1242 | - break; | |
1243 | - default: | |
1244 | - return 0; | |
1245 | - } | |
1246 | - | |
1247 | - return EP_ADDR_TO_PHYS_EP (logical_endpoint); | |
1248 | -} | |
1249 | -#endif | |
1250 | - | |
1251 | -/* | |
1252 | - * udc_setup_ep - setup endpoint | |
1253 | - * | |
1254 | - * Associate a physical endpoint with endpoint_instance | |
1255 | - */ | |
1256 | -void udc_setup_ep (struct usb_device_instance *device, | |
1257 | - unsigned int ep, struct usb_endpoint_instance *endpoint) | |
1258 | -{ | |
1259 | - UDCDBGA ("setting up endpoint addr %x", endpoint->endpoint_address); | |
1260 | - | |
1261 | - /* This routine gets called by bi_modinit for endpoint 0 and from | |
1262 | - * bi_config for all of the other endpoints. bi_config gets called | |
1263 | - * during the DEVICE_CREATE, DEVICE_CONFIGURED, and | |
1264 | - * DEVICE_SET_INTERFACE events. We need to reconfigure the OMAP packet | |
1265 | - * RAM after bi_config scans the selected device configuration and | |
1266 | - * initializes the endpoint structures, but before this routine enables | |
1267 | - * the OUT endpoint FIFOs. Since bi_config calls this routine in a | |
1268 | - * loop for endpoints 1 through UDC_MAX_ENDPOINTS, we reconfigure our | |
1269 | - * packet RAM here when ep==1. | |
1270 | - * I really hate to do this here, but it seems like the API exported | |
1271 | - * by the USB bus interface controller driver to the usbd-bi module | |
1272 | - * isn't quite right so there is no good place to do this. | |
1273 | - */ | |
1274 | - if (ep == 1) { | |
1275 | - omap1510_deconfigure_device (); | |
1276 | - omap1510_configure_device (device); | |
1277 | - } | |
1278 | - | |
1279 | - if (endpoint && (ep < UDC_MAX_ENDPOINTS)) { | |
1280 | - int ep_addr = endpoint->endpoint_address; | |
1281 | - | |
1282 | - if (!ep_addr) { | |
1283 | - /* nothing to do for endpoint 0 */ | |
1284 | - } else if ((ep_addr & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) { | |
1285 | - /* nothing to do for IN (tx) endpoints */ | |
1286 | - } else { /* OUT (rx) endpoint */ | |
1287 | - if (endpoint->rcv_packetSize) { | |
1288 | - /*struct urb* urb = &(urb_out_array[ep&0xFF]); */ | |
1289 | - /*urb->endpoint = endpoint; */ | |
1290 | - /*urb->device = device; */ | |
1291 | - /*urb->buffer_length = sizeof(urb->buffer); */ | |
1292 | - | |
1293 | - /*endpoint->rcv_urb = urb; */ | |
1294 | - omap1510_prepare_endpoint_for_rx (ep_addr); | |
1295 | - } | |
1296 | - } | |
1297 | - } | |
1298 | -} | |
1299 | - | |
1300 | -/** | |
1301 | - * udc_disable_ep - disable endpoint | |
1302 | - * @ep: | |
1303 | - * | |
1304 | - * Disable specified endpoint | |
1305 | - */ | |
1306 | -#if 0 | |
1307 | -void udc_disable_ep (unsigned int ep_addr) | |
1308 | -{ | |
1309 | - /*int ep_addr = PHYS_EP_TO_EP_ADDR(ep); */ | |
1310 | - int ep_num = ep_addr & USB_ENDPOINT_NUMBER_MASK; | |
1311 | - struct usb_endpoint_instance *endpoint = omap1510_find_ep (ep_addr); /*udc_device->bus->endpoint_array + ep; */ | |
1312 | - | |
1313 | - UDCDBGA ("disable ep_addr %d", ep_addr); | |
1314 | - | |
1315 | - if (!ep_num) { | |
1316 | - /* nothing to do for endpoint 0 */ ; | |
1317 | - } else if ((ep_addr & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) { | |
1318 | - if (endpoint->tx_packetSize) { | |
1319 | - /* we have a valid tx endpoint */ | |
1320 | - /*usbd_flush_tx(endpoint); */ | |
1321 | - endpoint->tx_urb = NULL; | |
1322 | - } | |
1323 | - } else { | |
1324 | - if (endpoint->rcv_packetSize) { | |
1325 | - /* we have a valid rx endpoint */ | |
1326 | - /*usbd_flush_rcv(endpoint); */ | |
1327 | - endpoint->rcv_urb = NULL; | |
1328 | - } | |
1329 | - } | |
1330 | -} | |
1331 | -#endif | |
1332 | - | |
1333 | -/* ************************************************************************** */ | |
1334 | - | |
1335 | -/** | |
1336 | - * udc_connected - is the USB cable connected | |
1337 | - * | |
1338 | - * Return non-zero if cable is connected. | |
1339 | - */ | |
1340 | -#if 0 | |
1341 | -int udc_connected (void) | |
1342 | -{ | |
1343 | - return ((inw (UDC_DEVSTAT) & UDC_ATT) == UDC_ATT); | |
1344 | -} | |
1345 | -#endif | |
1346 | - | |
1347 | -/* Turn on the USB connection by enabling the pullup resistor */ | |
1348 | -void udc_connect (void) | |
1349 | -{ | |
1350 | - UDCDBG ("connect, enable Pullup"); | |
1351 | - outl (0x00000018, FUNC_MUX_CTRL_D); | |
1352 | -} | |
1353 | - | |
1354 | -/* Turn off the USB connection by disabling the pullup resistor */ | |
1355 | -void udc_disconnect (void) | |
1356 | -{ | |
1357 | - UDCDBG ("disconnect, disable Pullup"); | |
1358 | - outl (0x00000000, FUNC_MUX_CTRL_D); | |
1359 | -} | |
1360 | - | |
1361 | -/* ************************************************************************** */ | |
1362 | - | |
1363 | - | |
1364 | -/* | |
1365 | - * udc_disable_interrupts - disable interrupts | |
1366 | - * switch off interrupts | |
1367 | - */ | |
1368 | -#if 0 | |
1369 | -void udc_disable_interrupts (struct usb_device_instance *device) | |
1370 | -{ | |
1371 | - UDCDBG ("disabling all interrupts"); | |
1372 | - outw (0, UDC_IRQ_EN); | |
1373 | -} | |
1374 | -#endif | |
1375 | - | |
1376 | -/* ************************************************************************** */ | |
1377 | - | |
1378 | -/** | |
1379 | - * udc_ep0_packetsize - return ep0 packetsize | |
1380 | - */ | |
1381 | -#if 0 | |
1382 | -int udc_ep0_packetsize (void) | |
1383 | -{ | |
1384 | - return EP0_PACKETSIZE; | |
1385 | -} | |
1386 | -#endif | |
1387 | - | |
1388 | -/* Switch on the UDC */ | |
1389 | -void udc_enable (struct usb_device_instance *device) | |
1390 | -{ | |
1391 | - UDCDBGA ("enable device %p, status %d", device, device->status); | |
1392 | - | |
1393 | - /* initialize driver state variables */ | |
1394 | - udc_devstat = 0; | |
1395 | - | |
1396 | - /* Save the device structure pointer */ | |
1397 | - udc_device = device; | |
1398 | - | |
1399 | - /* Setup ep0 urb */ | |
1400 | - if (!ep0_urb) { | |
1401 | - ep0_urb = | |
1402 | - usbd_alloc_urb (udc_device, | |
1403 | - udc_device->bus->endpoint_array); | |
1404 | - } else { | |
1405 | - serial_printf ("udc_enable: ep0_urb already allocated %p\n", | |
1406 | - ep0_urb); | |
1407 | - } | |
1408 | - | |
1409 | - UDCDBG ("Check clock status"); | |
1410 | - UDCREG (STATUS_REQ); | |
1411 | - | |
1412 | - /* The VBUS_MODE bit selects whether VBUS detection is done via | |
1413 | - * software (1) or hardware (0). When software detection is | |
1414 | - * selected, VBUS_CTRL selects whether USB is not connected (0) | |
1415 | - * or connected (1). | |
1416 | - */ | |
1417 | - outl (inl (FUNC_MUX_CTRL_0) | UDC_VBUS_CTRL | UDC_VBUS_MODE, | |
1418 | - FUNC_MUX_CTRL_0); | |
1419 | - UDCREGL (FUNC_MUX_CTRL_0); | |
1420 | - | |
1421 | - omap1510_configure_device (device); | |
1422 | -} | |
1423 | - | |
1424 | -/* Switch off the UDC */ | |
1425 | -void udc_disable (void) | |
1426 | -{ | |
1427 | - UDCDBG ("disable UDC"); | |
1428 | - | |
1429 | - omap1510_deconfigure_device (); | |
1430 | - | |
1431 | - /* The VBUS_MODE bit selects whether VBUS detection is done via | |
1432 | - * software (1) or hardware (0). When software detection is | |
1433 | - * selected, VBUS_CTRL selects whether USB is not connected (0) | |
1434 | - * or connected (1). | |
1435 | - */ | |
1436 | - outl (inl (FUNC_MUX_CTRL_0) | UDC_VBUS_MODE, FUNC_MUX_CTRL_0); | |
1437 | - outl (inl (FUNC_MUX_CTRL_0) & ~UDC_VBUS_CTRL, FUNC_MUX_CTRL_0); | |
1438 | - UDCREGL (FUNC_MUX_CTRL_0); | |
1439 | - | |
1440 | - /* Free ep0 URB */ | |
1441 | - if (ep0_urb) { | |
1442 | - /*usbd_dealloc_urb(ep0_urb); */ | |
1443 | - ep0_urb = NULL; | |
1444 | - } | |
1445 | - | |
1446 | - /* Reset device pointer. | |
1447 | - * We ought to do this here to balance the initialization of udc_device | |
1448 | - * in udc_enable, but some of our other exported functions get called | |
1449 | - * by the bus interface driver after udc_disable, so we have to hang on | |
1450 | - * to the device pointer to avoid a null pointer dereference. */ | |
1451 | - /* udc_device = NULL; */ | |
1452 | -} | |
1453 | - | |
1454 | -/** | |
1455 | - * udc_startup - allow udc code to do any additional startup | |
1456 | - */ | |
1457 | -void udc_startup_events (struct usb_device_instance *device) | |
1458 | -{ | |
1459 | - /* The DEVICE_INIT event puts the USB device in the state STATE_INIT. */ | |
1460 | - usbd_device_event_irq (device, DEVICE_INIT, 0); | |
1461 | - | |
1462 | - /* The DEVICE_CREATE event puts the USB device in the state | |
1463 | - * STATE_ATTACHED. | |
1464 | - */ | |
1465 | - usbd_device_event_irq (device, DEVICE_CREATE, 0); | |
1466 | - | |
1467 | - /* Some USB controller driver implementations signal | |
1468 | - * DEVICE_HUB_CONFIGURED and DEVICE_RESET events here. | |
1469 | - * DEVICE_HUB_CONFIGURED causes a transition to the state STATE_POWERED, | |
1470 | - * and DEVICE_RESET causes a transition to the state STATE_DEFAULT. | |
1471 | - * The OMAP USB client controller has the capability to detect when the | |
1472 | - * USB cable is connected to a powered USB bus via the ATT bit in the | |
1473 | - * DEVSTAT register, so we will defer the DEVICE_HUB_CONFIGURED and | |
1474 | - * DEVICE_RESET events until later. | |
1475 | - */ | |
1476 | - | |
1477 | - udc_enable (device); | |
1478 | -} | |
1479 | - | |
1480 | -/** | |
1481 | - * udc_irq - do pseudo interrupts | |
1482 | - */ | |
1483 | -void udc_irq(void) | |
1484 | -{ | |
1485 | - /* Loop while we have interrupts. | |
1486 | - * If we don't do this, the input chain | |
1487 | - * polling delay is likely to miss | |
1488 | - * host requests. | |
1489 | - */ | |
1490 | - while (inw (UDC_IRQ_SRC) & ~UDC_SOF_Flg) { | |
1491 | - /* Handle any new IRQs */ | |
1492 | - omap1510_udc_irq (); | |
1493 | - omap1510_udc_noniso_irq (); | |
1494 | - } | |
1495 | -} | |
1496 | - | |
1497 | -/* Flow control */ | |
1498 | -void udc_set_nak(int epid) | |
1499 | -{ | |
1500 | - /* TODO: implement this functionality in omap1510 */ | |
1501 | -} | |
1502 | - | |
1503 | -void udc_unset_nak (int epid) | |
1504 | -{ | |
1505 | - /* TODO: implement this functionality in omap1510 */ | |
1506 | -} |
1 | -/* | |
2 | - * | |
3 | - * BRIEF MODULE DESCRIPTION | |
4 | - * OMAP hardware map | |
5 | - * | |
6 | - * Copyright (C) 2001 RidgeRun, Inc. (http://www.ridgerun.com) | |
7 | - * Author: RidgeRun, Inc. | |
8 | - * Greg Lonnon (glonnon@ridgerun.com) or info@ridgerun.com | |
9 | - * | |
10 | - * SPDX-License-Identifier: GPL-2.0+ | |
11 | - */ | |
12 | - | |
13 | -#include <linux/sizes.h> | |
14 | - | |
15 | -/* | |
16 | - There are 2 sets of general I/O --> | |
17 | - 1. GPIO (shared between ARM & DSP, configured by ARM) | |
18 | - 2. MPUIO which can be used only by the ARM. | |
19 | - | |
20 | - Base address FFFB:5000 is where the ARM accesses the MPUIO control registers | |
21 | - (see 7.2.2 of the TRM for MPUIO reg definitions). | |
22 | - | |
23 | - Base address E101:5000 is reserved for ARM access of the same MPUIO control | |
24 | - regs, but via the DSP I/O map. This address is unavailable on 1510. | |
25 | - | |
26 | - Base address FFFC:E000 is where the ARM accesses the GPIO config registers | |
27 | - directly via its own peripheral bus. | |
28 | - | |
29 | - Base address E101:E000 is where the ARM can access the same GPIO config | |
30 | - registers, but the access takes place through the ARM port interface (called | |
31 | - API or MPUI) via the DSP's peripheral bus (DSP I/O space). | |
32 | - | |
33 | - Therefore, the ARM should setup the GPIO regs thru the FFFC:E000 addresses | |
34 | - instead of the E101:E000 addresses. The DSP has only read access of the pin | |
35 | - control register, so this may explain the inability to write to E101:E018. | |
36 | - Try accessing pin control reg at FFFC:E018. | |
37 | - */ | |
38 | -#define OMAP1510_GPIO_BASE 0xfffce000 | |
39 | -#define OMAP1510_GPIO_START OMAP1510_GPIO_BASE | |
40 | -#define OMAP1510_GPIO_SIZE SZ_4K | |
41 | - | |
42 | -#define OMAP1510_MCBSP1_BASE 0xE1011000 | |
43 | -#define OMAP1510_MCBSP1_SIZE SZ_4K | |
44 | -#define OMAP1510_MCBSP1_START 0xE1011000 | |
45 | - | |
46 | -#define OMAP1510_MCBSP2_BASE 0xFFFB1000 | |
47 | - | |
48 | -#define OMAP1510_MCBSP3_BASE 0xE1017000 | |
49 | -#define OMAP1510_MCBSP3_SIZE SZ_4K | |
50 | -#define OMAP1510_MCBSP3_START 0xE1017000 | |
51 | - | |
52 | -/* | |
53 | - * Where's the flush address (for flushing D and I cache?) | |
54 | - */ | |
55 | -#define FLUSH_BASE 0xdf000000 | |
56 | -#define FLUSH_BASE_PHYS 0x00000000 | |
57 | - | |
58 | -#ifndef __ASSEMBLER__ | |
59 | - | |
60 | -#define PCIO_BASE 0 | |
61 | - | |
62 | -/* | |
63 | - * RAM definitions | |
64 | - */ | |
65 | -#define MAPTOPHYS(a) ((unsigned long)(a) - PAGE_OFFSET) | |
66 | -#define KERNTOPHYS(a) ((unsigned long)(&a)) | |
67 | -#define KERNEL_BASE (0x10008000) | |
68 | -#endif | |
69 | - | |
70 | -/* macro to get at IO space when running virtually */ | |
71 | -#define IO_ADDRESS(x) ((x)) | |
72 | - | |
73 | -/* ---------------------------------------------------------------------------- | |
74 | - * OMAP1510 system registers | |
75 | - * ---------------------------------------------------------------------------- | |
76 | - */ | |
77 | - | |
78 | -#define OMAP1510_UART1_BASE 0xfffb0000 /* "BLUETOOTH-UART" */ | |
79 | -#define OMAP1510_UART2_BASE 0xfffb0800 /* "MODEM-UART" */ | |
80 | -#define OMAP1510_RTC_BASE 0xfffb4800 /* RTC */ | |
81 | -#define OMAP1510_UART3_BASE 0xfffb9800 /* Shared MPU/DSP UART */ | |
82 | -#define OMAP1510_COM_MCBSP2_BASE 0xffff1000 /* Com McBSP2 */ | |
83 | -#define OMAP1510_AUDIO_MCBSP_BASE 0xffff1800 /* Audio McBSP2 */ | |
84 | -#define OMAP1510_ARMIO_BASE 0xfffb5000 /* keyboard/gpio */ | |
85 | - | |
86 | -/* | |
87 | - * OMAP1510 UART3 Registers | |
88 | - */ | |
89 | - | |
90 | -#define OMAP_MPU_UART3_BASE 0xFFFB9800 /* UART3 through MPU bus */ | |
91 | - | |
92 | -/* UART3 Registers Maping through MPU bus */ | |
93 | - | |
94 | -#define UART3_RHR (OMAP_MPU_UART3_BASE + 0) | |
95 | -#define UART3_THR (OMAP_MPU_UART3_BASE + 0) | |
96 | -#define UART3_DLL (OMAP_MPU_UART3_BASE + 0) | |
97 | -#define UART3_IER (OMAP_MPU_UART3_BASE + 4) | |
98 | -#define UART3_DLH (OMAP_MPU_UART3_BASE + 4) | |
99 | -#define UART3_IIR (OMAP_MPU_UART3_BASE + 8) | |
100 | -#define UART3_FCR (OMAP_MPU_UART3_BASE + 8) | |
101 | -#define UART3_EFR (OMAP_MPU_UART3_BASE + 8) | |
102 | -#define UART3_LCR (OMAP_MPU_UART3_BASE + 0x0C) | |
103 | -#define UART3_MCR (OMAP_MPU_UART3_BASE + 0x10) | |
104 | -#define UART3_XON1_ADDR1 (OMAP_MPU_UART3_BASE + 0x10) | |
105 | -#define UART3_XON2_ADDR2 (OMAP_MPU_UART3_BASE + 0x14) | |
106 | -#define UART3_LSR (OMAP_MPU_UART3_BASE + 0x14) | |
107 | -#define UART3_TCR (OMAP_MPU_UART3_BASE + 0x18) | |
108 | -#define UART3_MSR (OMAP_MPU_UART3_BASE + 0x18) | |
109 | -#define UART3_XOFF1 (OMAP_MPU_UART3_BASE + 0x18) | |
110 | -#define UART3_XOFF2 (OMAP_MPU_UART3_BASE + 0x1C) | |
111 | -#define UART3_SPR (OMAP_MPU_UART3_BASE + 0x1C) | |
112 | -#define UART3_TLR (OMAP_MPU_UART3_BASE + 0x1C) | |
113 | -#define UART3_MDR1 (OMAP_MPU_UART3_BASE + 0x20) | |
114 | -#define UART3_MDR2 (OMAP_MPU_UART3_BASE + 0x24) | |
115 | -#define UART3_SFLSR (OMAP_MPU_UART3_BASE + 0x28) | |
116 | -#define UART3_TXFLL (OMAP_MPU_UART3_BASE + 0x28) | |
117 | -#define UART3_RESUME (OMAP_MPU_UART3_BASE + 0x2C) | |
118 | -#define UART3_TXFLH (OMAP_MPU_UART3_BASE + 0x2C) | |
119 | -#define UART3_SFREGL (OMAP_MPU_UART3_BASE + 0x30) | |
120 | -#define UART3_RXFLL (OMAP_MPU_UART3_BASE + 0x30) | |
121 | -#define UART3_SFREGH (OMAP_MPU_UART3_BASE + 0x34) | |
122 | -#define UART3_RXFLH (OMAP_MPU_UART3_BASE + 0x34) | |
123 | -#define UART3_BLR (OMAP_MPU_UART3_BASE + 0x38) | |
124 | -#define UART3_ACREG (OMAP_MPU_UART3_BASE + 0x3C) | |
125 | -#define UART3_DIV16 (OMAP_MPU_UART3_BASE + 0x3C) | |
126 | -#define UART3_SCR (OMAP_MPU_UART3_BASE + 0x40) | |
127 | -#define UART3_SSR (OMAP_MPU_UART3_BASE + 0x44) | |
128 | -#define UART3_EBLR (OMAP_MPU_UART3_BASE + 0x48) | |
129 | -#define UART3_OSC_12M_SEL (OMAP_MPU_UART3_BASE + 0x4C) | |
130 | -#define UART3_MVR (OMAP_MPU_UART3_BASE + 0x50) | |
131 | - | |
132 | -/* | |
133 | - * Configuration Registers | |
134 | - */ | |
135 | -#define FUNC_MUX_CTRL_0 0xfffe1000 | |
136 | -#define FUNC_MUX_CTRL_1 0xfffe1004 | |
137 | -#define FUNC_MUX_CTRL_2 0xfffe1008 | |
138 | -#define COMP_MODE_CTRL_0 0xfffe100c | |
139 | -#define FUNC_MUX_CTRL_3 0xfffe1010 | |
140 | -#define FUNC_MUX_CTRL_4 0xfffe1014 | |
141 | -#define FUNC_MUX_CTRL_5 0xfffe1018 | |
142 | -#define FUNC_MUX_CTRL_6 0xfffe101C | |
143 | -#define FUNC_MUX_CTRL_7 0xfffe1020 | |
144 | -#define FUNC_MUX_CTRL_8 0xfffe1024 | |
145 | -#define FUNC_MUX_CTRL_9 0xfffe1028 | |
146 | -#define FUNC_MUX_CTRL_A 0xfffe102C | |
147 | -#define FUNC_MUX_CTRL_B 0xfffe1030 | |
148 | -#define FUNC_MUX_CTRL_C 0xfffe1034 | |
149 | -#define FUNC_MUX_CTRL_D 0xfffe1038 | |
150 | -#define PULL_DWN_CTRL_0 0xfffe1040 | |
151 | -#define PULL_DWN_CTRL_1 0xfffe1044 | |
152 | -#define PULL_DWN_CTRL_2 0xfffe1048 | |
153 | -#define PULL_DWN_CTRL_3 0xfffe104c | |
154 | -#define GATE_INH_CTRL_0 0xfffe1050 | |
155 | -#define VOLTAGE_CTRL_0 0xfffe1060 | |
156 | -#define TEST_DBG_CTRL_0 0xfffe1070 | |
157 | - | |
158 | -#define MOD_CONF_CTRL_0 0xfffe1080 | |
159 | - | |
160 | -#ifdef CONFIG_OMAP1610 /* 1610 Configuration Register */ | |
161 | - | |
162 | -#define USB_OTG_CTRL 0xFFFB040C | |
163 | -#define USB_TRANSCEIVER_CTRL 0xFFFE1064 | |
164 | -#define PULL_DWN_CTRL_4 0xFFFE10AC | |
165 | -#define PU_PD_SEL_0 0xFFFE10B4 | |
166 | -#define PU_PD_SEL_1 0xFFFE10B8 | |
167 | -#define PU_PD_SEL_2 0xFFFE10BC | |
168 | -#define PU_PD_SEL_3 0xFFFE10C0 | |
169 | -#define PU_PD_SEL_4 0xFFFE10C4 | |
170 | - | |
171 | -#endif | |
172 | -/* | |
173 | - * Traffic Controller Memory Interface Registers | |
174 | - */ | |
175 | -#define TCMIF_BASE 0xfffecc00 | |
176 | -#define IMIF_PRIO (TCMIF_BASE + 0x00) | |
177 | -#define EMIFS_PRIO_REG (TCMIF_BASE + 0x04) | |
178 | -#define EMIFF_PRIO_REG (TCMIF_BASE + 0x08) | |
179 | -#define EMIFS_CONFIG_REG (TCMIF_BASE + 0x0c) | |
180 | -#define EMIFS_CS0_CONFIG (TCMIF_BASE + 0x10) | |
181 | -#define EMIFS_CS1_CONFIG (TCMIF_BASE + 0x14) | |
182 | -#define EMIFS_CS2_CONFIG (TCMIF_BASE + 0x18) | |
183 | -#define EMIFS_CS3_CONFIG (TCMIF_BASE + 0x1c) | |
184 | -#define EMIFF_SDRAM_CONFIG (TCMIF_BASE + 0x20) | |
185 | -#define EMIFF_MRS (TCMIF_BASE + 0x24) | |
186 | -#define TC_TIMEOUT1 (TCMIF_BASE + 0x28) | |
187 | -#define TC_TIMEOUT2 (TCMIF_BASE + 0x2c) | |
188 | -#define TC_TIMEOUT3 (TCMIF_BASE + 0x30) | |
189 | -#define TC_ENDIANISM (TCMIF_BASE + 0x34) | |
190 | -#define EMIFF_SDRAM_CONFIG_2 (TCMIF_BASE + 0x3c) | |
191 | -#define EMIF_CFG_DYNAMIC_WS (TCMIF_BASE + 0x40) | |
192 | - | |
193 | -/* | |
194 | - * LCD Panel | |
195 | - */ | |
196 | -#define TI925_LCD_BASE 0xFFFEC000 | |
197 | -#define TI925_LCD_CONTROL (TI925_LCD_BASE) | |
198 | -#define TI925_LCD_TIMING0 (TI925_LCD_BASE+0x4) | |
199 | -#define TI925_LCD_TIMING1 (TI925_LCD_BASE+0x8) | |
200 | -#define TI925_LCD_TIMING2 (TI925_LCD_BASE+0xc) | |
201 | -#define TI925_LCD_STATUS (TI925_LCD_BASE+0x10) | |
202 | -#define TI925_LCD_SUBPANEL (TI925_LCD_BASE+0x14) | |
203 | - | |
204 | -#define OMAP_LCD_CONTROL TI925_LCD_CONTROL | |
205 | - | |
206 | -/* I2C Registers */ | |
207 | - | |
208 | -#define I2C_BASE 0xfffb3800 | |
209 | - | |
210 | -#define I2C_REV (I2C_BASE + 0x00) | |
211 | -#define I2C_IE (I2C_BASE + 0x04) | |
212 | -#define I2C_STAT (I2C_BASE + 0x08) | |
213 | -#define I2C_IV (I2C_BASE + 0x0c) | |
214 | -#define I2C_BUF (I2C_BASE + 0x14) | |
215 | -#define I2C_CNT (I2C_BASE + 0x18) | |
216 | -#define I2C_DATA (I2C_BASE + 0x1c) | |
217 | -#define I2C_CON (I2C_BASE + 0x24) | |
218 | -#define I2C_OA (I2C_BASE + 0x28) | |
219 | -#define I2C_SA (I2C_BASE + 0x2c) | |
220 | -#define I2C_PSC (I2C_BASE + 0x30) | |
221 | -#define I2C_SCLL (I2C_BASE + 0x34) | |
222 | -#define I2C_SCLH (I2C_BASE + 0x38) | |
223 | -#define I2C_SYSTEST (I2C_BASE + 0x3c) | |
224 | - | |
225 | -/* I2C masks */ | |
226 | - | |
227 | -/* I2C Interrupt Enable Register (I2C_IE): */ | |
228 | - | |
229 | -#define I2C_IE_XRDY_IE (1 << 4) /* Transmit data ready interrupt enable */ | |
230 | -#define I2C_IE_RRDY_IE (1 << 3) /* Receive data ready interrupt enable */ | |
231 | -#define I2C_IE_ARDY_IE (1 << 2) /* Register access ready interrupt enable */ | |
232 | -#define I2C_IE_NACK_IE (1 << 1) /* No acknowledgment interrupt enable */ | |
233 | -#define I2C_IE_AL_IE (1 << 0) /* Arbitration lost interrupt enable */ | |
234 | - | |
235 | -/* I2C Status Register (I2C_STAT): */ | |
236 | - | |
237 | -#define I2C_STAT_SBD (1 << 15) /* Single byte data */ | |
238 | -#define I2C_STAT_BB (1 << 12) /* Bus busy */ | |
239 | -#define I2C_STAT_ROVR (1 << 11) /* Receive overrun */ | |
240 | -#define I2C_STAT_XUDF (1 << 10) /* Transmit underflow */ | |
241 | -#define I2C_STAT_AAS (1 << 9) /* Address as slave */ | |
242 | -#define I2C_STAT_AD0 (1 << 8) /* Address zero */ | |
243 | -#define I2C_STAT_XRDY (1 << 4) /* Transmit data ready */ | |
244 | -#define I2C_STAT_RRDY (1 << 3) /* Receive data ready */ | |
245 | -#define I2C_STAT_ARDY (1 << 2) /* Register access ready */ | |
246 | -#define I2C_STAT_NACK (1 << 1) /* No acknowledgment interrupt enable */ | |
247 | -#define I2C_STAT_AL (1 << 0) /* Arbitration lost interrupt enable */ | |
248 | - | |
249 | -/* I2C Interrupt Vector Register (I2C_IV): */ | |
250 | - | |
251 | -/* I2C Interrupt Code Register (I2C_INTCODE): */ | |
252 | - | |
253 | -#define I2C_INTCODE_MASK 7 | |
254 | -#define I2C_INTCODE_NONE 0 | |
255 | -#define I2C_INTCODE_AL 1 /* Arbitration lost */ | |
256 | -#define I2C_INTCODE_NAK 2 /* No acknowledgement/general call */ | |
257 | -#define I2C_INTCODE_ARDY 3 /* Register access ready */ | |
258 | -#define I2C_INTCODE_RRDY 4 /* Rcv data ready */ | |
259 | -#define I2C_INTCODE_XRDY 5 /* Xmit data ready */ | |
260 | - | |
261 | -/* I2C Buffer Configuration Register (I2C_BUF): */ | |
262 | - | |
263 | -#define I2C_BUF_RDMA_EN (1 << 15) /* Receive DMA channel enable */ | |
264 | -#define I2C_BUF_XDMA_EN (1 << 7) /* Transmit DMA channel enable */ | |
265 | - | |
266 | -/* I2C Configuration Register (I2C_CON): */ | |
267 | - | |
268 | -#define I2C_CON_EN (1 << 15) /* I2C module enable */ | |
269 | -#define I2C_CON_BE (1 << 14) /* Big endian mode */ | |
270 | -#define I2C_CON_STB (1 << 11) /* Start byte mode (master mode only) */ | |
271 | -#define I2C_CON_MST (1 << 10) /* Master/slave mode */ | |
272 | -#define I2C_CON_TRX (1 << 9) /* Transmitter/receiver mode (master mode only) */ | |
273 | -#define I2C_CON_XA (1 << 8) /* Expand address */ | |
274 | -#define I2C_CON_RM (1 << 2) /* Repeat mode (master mode only) */ | |
275 | -#define I2C_CON_STP (1 << 1) /* Stop condition (master mode only) */ | |
276 | -#define I2C_CON_STT (1 << 0) /* Start condition (master mode only) */ | |
277 | - | |
278 | -/* I2C System Test Register (I2C_SYSTEST): */ | |
279 | - | |
280 | -#define I2C_SYSTEST_ST_EN (1 << 15) /* System test enable */ | |
281 | -#define I2C_SYSTEST_FREE (1 << 14) /* Free running mode (on breakpoint) */ | |
282 | -#define I2C_SYSTEST_TMODE_MASK (3 << 12) /* Test mode select */ | |
283 | -#define I2C_SYSTEST_TMODE_SHIFT (12) /* Test mode select */ | |
284 | -#define I2C_SYSTEST_SCL_I (1 << 3) /* SCL line sense input value */ | |
285 | -#define I2C_SYSTEST_SCL_O (1 << 2) /* SCL line drive output value */ | |
286 | -#define I2C_SYSTEST_SDA_I (1 << 1) /* SDA line sense input value */ | |
287 | -#define I2C_SYSTEST_SDA_O (1 << 0) /* SDA line drive output value */ | |
288 | - | |
289 | -/* | |
290 | - * MMC/SD Host Controller Registers | |
291 | - */ | |
292 | - | |
293 | -#define OMAP_MMC_CMD 0xFFFB7800 /* MMC Command */ | |
294 | -#define OMAP_MMC_ARGL 0xFFFB7804 /* MMC argument low */ | |
295 | -#define OMAP_MMC_ARGH 0xFFFB7808 /* MMC argument high */ | |
296 | -#define OMAP_MMC_CON 0xFFFB780C /* MMC system configuration */ | |
297 | -#define OMAP_MMC_STAT 0xFFFB7810 /* MMC status */ | |
298 | -#define OMAP_MMC_IE 0xFFFB7814 /* MMC system interrupt enable */ | |
299 | -#define OMAP_MMC_CTO 0xFFFB7818 /* MMC command time-out */ | |
300 | -#define OMAP_MMC_DTO 0xFFFB781C /* MMC data time-out */ | |
301 | -#define OMAP_MMC_DATA 0xFFFB7820 /* MMC TX/RX FIFO data */ | |
302 | -#define OMAP_MMC_BLEN 0xFFFB7824 /* MMC block length */ | |
303 | -#define OMAP_MMC_NBLK 0xFFFB7828 /* MMC number of blocks */ | |
304 | -#define OMAP_MMC_BUF 0xFFFB782C /* MMC buffer configuration */ | |
305 | -#define OMAP_MMC_SPI 0xFFFB7830 /* MMC serial port interface */ | |
306 | -#define OMAP_MMC_SDIO 0xFFFB7834 /* MMC SDIO mode configuration */ | |
307 | -#define OMAP_MMC_SYST 0xFFFB7838 /* MMC system test */ | |
308 | -#define OMAP_MMC_REV 0xFFFB783C /* MMC module version */ | |
309 | -#define OMAP_MMC_RSP0 0xFFFB7840 /* MMC command response 0 */ | |
310 | -#define OMAP_MMC_RSP1 0xFFFB7844 /* MMC command response 1 */ | |
311 | -#define OMAP_MMC_RSP2 0xFFFB7848 /* MMC command response 2 */ | |
312 | -#define OMAP_MMC_RSP3 0xFFFB784C /* MMC command response 3 */ | |
313 | -#define OMAP_MMC_RSP4 0xFFFB7850 /* MMC command response 4 */ | |
314 | -#define OMAP_MMC_RSP5 0xFFFB7854 /* MMC command response 5 */ | |
315 | -#define OMAP_MMC_RSP6 0xFFFB7858 /* MMC command response 6 */ | |
316 | -#define OMAP_MMC_RSP7 0xFFFB785C /* MMC command response 4 */ | |
317 | - | |
318 | -/* MMC masks */ | |
319 | - | |
320 | -#define OMAP_MMC_END_OF_CMD (1 << 0) /* End of command phase */ | |
321 | -#define OMAP_MMC_CARD_BUSY (1 << 2) /* Card enter busy state */ | |
322 | -#define OMAP_MMC_BLOCK_RS (1 << 3) /* Block received/sent */ | |
323 | -#define OMAP_MMC_EOF_BUSY (1 << 4) /* Card exit busy state */ | |
324 | -#define OMAP_MMC_DATA_TIMEOUT (1 << 5) /* Data response time-out */ | |
325 | -#define OMAP_MMC_DATA_CRC (1 << 6) /* Date CRC error */ | |
326 | -#define OMAP_MMC_CMD_TIMEOUT (1 << 7) /* Command response time-out */ | |
327 | -#define OMAP_MMC_CMD_CRC (1 << 8) /* Command CRC error */ | |
328 | -#define OMAP_MMC_A_FULL (1 << 10) /* Buffer almost full */ | |
329 | -#define OMAP_MMC_A_EMPTY (1 << 11) /* Buffer almost empty */ | |
330 | -#define OMAP_MMC_OCR_BUSY (1 << 12) /* OCR busy */ | |
331 | -#define OMAP_MMC_CARD_IRQ (1 << 13) /* Card IRQ received */ | |
332 | -#define OMAP_MMC_CARD_ERR (1 << 14) /* Card status error in response */ | |
333 | - | |
334 | -/* 2.9.2 MPUI Interface Registers FFFE:C900 */ | |
335 | - | |
336 | -#define MPUI_CTRL_REG (volatile __u32 *)(0xfffec900) | |
337 | -#define MPUI_DEBUG_ADDR (volatile __u32 *)(0xfffec904) | |
338 | -#define MPUI_DEBUG_DATA (volatile __u32 *)(0xfffec908) | |
339 | -#define MPUI_DEBUG_FLAG (volatile __u16 *)(0xfffec90c) | |
340 | -#define MPUI_STATUS_REG (volatile __u16 *)(0xfffec910) | |
341 | -#define MPUI_DSP_STATUS_REG (volatile __u16 *)(0xfffec914) | |
342 | -#define MPUI_DSP_BOOT_CONFIG (volatile __u16 *)(0xfffec918) | |
343 | -#define MPUI_DSP_API_CONFIG (volatile __u16 *)(0xfffec91c) | |
344 | - | |
345 | -/* 2.9.6 Traffic Controller Memory Interface Registers: */ | |
346 | -#define OMAP_IMIF_PRIO_REG 0xfffecc00 | |
347 | -#define OMAP_EMIFS_PRIO_REG 0xfffecc04 | |
348 | -#define OMAP_EMIFF_PRIO_REG 0xfffecc08 | |
349 | -#define OMAP_EMIFS_CONFIG_REG 0xfffecc0c | |
350 | -#define OMAP_EMIFS_CS0_CONFIG 0xfffecc10 | |
351 | -#define OMAP_EMIFS_CS1_CONFIG 0xfffecc14 | |
352 | -#define OMAP_EMIFS_CS2_CONFIG 0xfffecc18 | |
353 | -#define OMAP_EMIFS_CS3_CONFIG 0xfffecc1c | |
354 | -#define OMAP_EMIFF_SDRAM_CONFIG 0xfffecc20 | |
355 | -#define OMAP_EMIFF_MRS 0xfffecc24 | |
356 | -#define OMAP_TIMEOUT1 0xfffecc28 | |
357 | -#define OMAP_TIMEOUT2 0xfffecc2c | |
358 | -#define OMAP_TIMEOUT3 0xfffecc30 | |
359 | -#define OMAP_ENDIANISM 0xfffecc34 | |
360 | - | |
361 | -/* 2.9.10 EMIF Slow Interface Configuration Register (EMIFS_CONFIG_REG): */ | |
362 | -#define OMAP_EMIFS_CONFIG_FR (1 << 4) | |
363 | -#define OMAP_EMIFS_CONFIG_PDE (1 << 3) | |
364 | -#define OMAP_EMIFS_CONFIG_PWD_EN (1 << 2) | |
365 | -#define OMAP_EMIFS_CONFIG_BM (1 << 1) | |
366 | -#define OMAP_EMIFS_CONFIG_WP (1 << 0) | |
367 | - | |
368 | -/* | |
369 | - * Memory chunk set aside for the Framebuffer in SRAM | |
370 | - */ | |
371 | -#define SRAM_FRAMEBUFFER_MEMORY OMAP1510_SRAM_BASE | |
372 | - | |
373 | - | |
374 | -/* | |
375 | - * DMA | |
376 | - */ | |
377 | - | |
378 | -#define OMAP1510_DMA_BASE 0xFFFED800 | |
379 | -#define OMAP_DMA_BASE OMAP1510_DMA_BASE | |
380 | - | |
381 | -/* Global Register selection */ | |
382 | -#define NO_GLOBAL_DMA_ACCESS 0 | |
383 | - | |
384 | -/* Channel select field | |
385 | - * NOTE: all other channels are linear, chan0 is 0, chan1 is 1, etc... | |
386 | - */ | |
387 | -#define LCD_CHANNEL 0xc | |
388 | - | |
389 | -/* Register Select Field (LCD) */ | |
390 | -#define DMA_LCD_CTRL 0 | |
391 | -#define DMA_LCD_TOP_F1_L 1 | |
392 | -#define DMA_LCD_TOP_F1_U 2 | |
393 | -#define DMA_LCD_BOT_F1_L 3 | |
394 | -#define DMA_LCD_BOT_F1_U 4 | |
395 | - | |
396 | -#define LCD_FRAME_MODE (1<<0) | |
397 | -#define LCD_FRAME_IT_IE (1<<1) | |
398 | -#define LCD_BUS_ERROR_IT_IE (1<<2) | |
399 | -#define LCD_FRAME_1_IT_COND (1<<3) | |
400 | -#define LCD_FRAME_2_IT_COND (1<<4) | |
401 | -#define LCD_BUS_ERROR_IT_COND (1<<5) | |
402 | -#define LCD_SOURCE_IMIF (1<<6) | |
403 | - | |
404 | -/* | |
405 | - * Real-Time Clock | |
406 | - */ | |
407 | - | |
408 | -#define RTC_SECONDS (volatile __u8 *)(OMAP1510_RTC_BASE + 0x00) | |
409 | -#define RTC_MINUTES (volatile __u8 *)(OMAP1510_RTC_BASE + 0x04) | |
410 | -#define RTC_HOURS (volatile __u8 *)(OMAP1510_RTC_BASE + 0x08) | |
411 | -#define RTC_DAYS (volatile __u8 *)(OMAP1510_RTC_BASE + 0x0C) | |
412 | -#define RTC_MONTHS (volatile __u8 *)(OMAP1510_RTC_BASE + 0x10) | |
413 | -#define RTC_YEARS (volatile __u8 *)(OMAP1510_RTC_BASE + 0x14) | |
414 | -#define RTC_CTRL (volatile __u8 *)(OMAP1510_RTC_BASE + 0x40) | |
415 | - | |
416 | - | |
417 | -/* --------------------------------------------------------------------------- | |
418 | - * OMAP1510 Interrupt Handlers | |
419 | - * --------------------------------------------------------------------------- | |
420 | - * | |
421 | - */ | |
422 | -#define OMAP_IH1_BASE 0xfffecb00 | |
423 | -#define OMAP_IH2_BASE 0xfffe0000 | |
424 | -#define OMAP1510_ITR 0x0 | |
425 | -#define OMAP1510_MASK 0x4 | |
426 | - | |
427 | -#define INTERRUPT_HANDLER_BASE OMAP_IH1_BASE | |
428 | -#define INTERRUPT_INPUT_REGISTER OMAP1510_ITR | |
429 | -#define INTERRUPT_MASK_REGISTER OMAP1510_MASK | |
430 | - | |
431 | - | |
432 | -/* --------------------------------------------------------------------------- | |
433 | - * OMAP1510 TIMERS | |
434 | - * --------------------------------------------------------------------------- | |
435 | - * | |
436 | - */ | |
437 | - | |
438 | -#define OMAP1510_32kHz_TIMER_BASE 0xfffb9000 | |
439 | - | |
440 | -/* 32k Timer Registers */ | |
441 | -#define TIMER32k_CR 0x08 | |
442 | -#define TIMER32k_TVR 0x00 | |
443 | -#define TIMER32k_TCR 0x04 | |
444 | - | |
445 | -/* 32k Timer Control Register definition */ | |
446 | -#define TIMER32k_TSS (1<<0) | |
447 | -#define TIMER32k_TRB (1<<1) | |
448 | -#define TIMER32k_INT (1<<2) | |
449 | -#define TIMER32k_ARL (1<<3) | |
450 | - | |
451 | -/* MPU Timer base addresses */ | |
452 | -#define OMAP1510_MPUTIMER_BASE 0xfffec500 | |
453 | -#define OMAP1510_MPUTIMER_OFF 0x00000100 | |
454 | - | |
455 | -#define OMAP1510_TIMER1_BASE 0xfffec500 | |
456 | -#define OMAP1510_TIMER2_BASE 0xfffec600 | |
457 | -#define OMAP1510_TIMER3_BASE 0xfffec700 | |
458 | - | |
459 | -/* MPU Timer Registers */ | |
460 | -#define CNTL_TIMER 0 | |
461 | -#define LOAD_TIM 4 | |
462 | -#define READ_TIM 8 | |
463 | - | |
464 | -/* CNTL_TIMER register bits */ | |
465 | -#define MPUTIM_FREE (1<<6) | |
466 | -#define MPUTIM_CLOCK_ENABLE (1<<5) | |
467 | -#define MPUTIM_PTV_MASK (0x7<<MPUTIM_PTV_BIT) | |
468 | -#define MPUTIM_PTV_BIT 2 | |
469 | -#define MPUTIM_AR (1<<1) | |
470 | -#define MPUTIM_ST (1<<0) | |
471 | - | |
472 | -/* --------------------------------------------------------------------------- | |
473 | - * OMAP1510 GPIO (SHARED) | |
474 | - * --------------------------------------------------------------------------- | |
475 | - * | |
476 | - */ | |
477 | -#define GPIO_DATA_INPUT_REG (OMAP1510_GPIO_BASE + 0x0) | |
478 | -#define GPIO_DATA_OUTPUT_REG (OMAP1510_GPIO_BASE + 0x4) | |
479 | -#define GPIO_DIR_CONTROL_REG (OMAP1510_GPIO_BASE + 0x8) | |
480 | -#define GPIO_INT_CONTROL_REG (OMAP1510_GPIO_BASE + 0xc) | |
481 | -#define GPIO_INT_MASK_REG (OMAP1510_GPIO_BASE + 0x10) | |
482 | -#define GPIO_INT_STATUS_REG (OMAP1510_GPIO_BASE + 0x14) | |
483 | -#define GPIO_PIN_CONTROL_REG (OMAP1510_GPIO_BASE + 0x18) | |
484 | - | |
485 | - | |
486 | -/* --------------------------- | |
487 | - * OMAP1510 MPUIO (ARM only) | |
488 | - *---------------------------- | |
489 | - */ | |
490 | -#define OMAP1510_MPUIO_BASE 0xFFFB5000 | |
491 | -#define MPUIO_DATA_INPUT_REG (OMAP1510_MPUIO_BASE + 0x0) | |
492 | -#define MPUIO_DATA_OUTPUT_REG (OMAP1510_MPUIO_BASE + 0x4) | |
493 | -#define MPUIO_DIR_CONTROL_REG (OMAP1510_MPUIO_BASE + 0x8) | |
494 | - | |
495 | -/* --------------------------------------------------------------------------- | |
496 | - * OMAP1510 TIPB (only) | |
497 | - * --------------------------------------------------------------------------- | |
498 | - * | |
499 | - */ | |
500 | -#define TIPB_PUBLIC_CNTL_BASE 0xfffed300 | |
501 | -#define MPU_PUBLIC_TIPB_CNTL_REG (TIPB_PUBLIC_CNTL_BASE + 0x8) | |
502 | -#define TIPB_PRIVATE_CNTL_BASE 0xfffeca00 | |
503 | -#define MPU_PRIVATE_TIPB_CNTL_REG (TIPB_PRIVATE_CNTL_BASE + 0x8) | |
504 | - | |
505 | -/* | |
506 | - * --------------------------------------------------------------------------- | |
507 | - * OMAP1510 Camera Interface | |
508 | - * --------------------------------------------------------------------------- | |
509 | - */ | |
510 | -#define CAMERA_BASE (IO_BASE + 0x6800) | |
511 | -#define CAM_CTRLCLOCK_REG (CAMERA_BASE + 0x00) | |
512 | -#define CAM_IT_STATUS_REG (CAMERA_BASE + 0x04) | |
513 | -#define CAM_MODE_REG (CAMERA_BASE + 0x08) | |
514 | -#define CAM_STATUS_REG (CAMERA_BASE + 0x0C) | |
515 | -#define CAM_CAMDATA_REG (CAMERA_BASE + 0x10) | |
516 | -#define CAM_GPIO_REG (CAMERA_BASE + 0x14) | |
517 | -#define CAM_PEAK_CTR_REG (CAMERA_BASE + 0x18) | |
518 | - | |
519 | -#if 0 | |
520 | -#ifndef __ASSEMBLY__ | |
521 | -typedef struct { | |
522 | - __u32 ctrlclock; | |
523 | - __u32 it_status; | |
524 | - __u32 mode; | |
525 | - __u32 status; | |
526 | - __u32 camdata; | |
527 | - __u32 gpio; | |
528 | - __u32 peak_counter; | |
529 | -} camera_regs_t; | |
530 | -#endif | |
531 | -#endif | |
532 | - | |
533 | -/* CTRLCLOCK bit shifts */ | |
534 | -#define FOSCMOD_BIT 0 | |
535 | -#define FOSCMOD_MASK (0x7 << FOSCMOD_BIT) | |
536 | -#define FOSCMOD_12MHz 0x0 | |
537 | -#define FOSCMOD_6MHz 0x2 | |
538 | -#define FOSCMOD_9_6MHz 0x4 | |
539 | -#define FOSCMOD_24MHz 0x5 | |
540 | -#define FOSCMOD_8MHz 0x6 | |
541 | -#define POLCLK (1<<3) | |
542 | -#define CAMEXCLK_EN (1<<4) | |
543 | -#define MCLK_EN (1<<5) | |
544 | -#define DPLL_EN (1<<6) | |
545 | -#define LCLK_EN (1<<7) | |
546 | - | |
547 | -/* IT_STATUS bit shifts */ | |
548 | -#define V_UP (1<<0) | |
549 | -#define V_DOWN (1<<1) | |
550 | -#define H_UP (1<<2) | |
551 | -#define H_DOWN (1<<3) | |
552 | -#define FIFO_FULL (1<<4) | |
553 | -#define DATA_XFER (1<<5) | |
554 | - | |
555 | -/* MODE bit shifts */ | |
556 | -#define CAMOSC (1<<0) | |
557 | -#define IMGSIZE_BIT 1 | |
558 | -#define IMGSIZE_MASK (0x3 << IMGSIZE_BIT) | |
559 | -#define IMGSIZE_CIF (0x0 << IMGSIZE_BIT) /* 352x288 */ | |
560 | -#define IMGSIZE_QCIF (0x1 << IMGSIZE_BIT) /* 176x144 */ | |
561 | -#define IMGSIZE_VGA (0x2 << IMGSIZE_BIT) /* 640x480 */ | |
562 | -#define IMGSIZE_QVGA (0x3 << IMGSIZE_BIT) /* 320x240 */ | |
563 | -#define ORDERCAMD (1<<3) | |
564 | -#define EN_V_UP (1<<4) | |
565 | -#define EN_V_DOWN (1<<5) | |
566 | -#define EN_H_UP (1<<6) | |
567 | -#define EN_H_DOWN (1<<7) | |
568 | -#define EN_DMA (1<<8) | |
569 | -#define THRESHOLD (1<<9) | |
570 | -#define THRESHOLD_BIT 9 | |
571 | -#define THRESHOLD_MASK (0x7f<<9) | |
572 | -#define EN_NIRQ (1<<16) | |
573 | -#define EN_FIFO_FULL (1<<17) | |
574 | -#define RAZ_FIFO (1<<18) | |
575 | - | |
576 | -/* STATUS bit shifts */ | |
577 | -#define VSTATUS (1<<0) | |
578 | -#define HSTATUS (1<<1) | |
579 | - | |
580 | -/* GPIO bit shifts */ | |
581 | -#define CAM_RST (1<<0) | |
582 | - | |
583 | - | |
584 | -/********************* | |
585 | - * Watchdog timer. | |
586 | - *********************/ | |
587 | -#define WDTIM_BASE 0xfffec800 | |
588 | -#define WDTIM_CONTROL (WDTIM_BASE+0x00) | |
589 | -#define WDTIM_LOAD (WDTIM_BASE+0x04) | |
590 | -#define WDTIM_READ (WDTIM_BASE+0x04) | |
591 | -#define WDTIM_MODE (WDTIM_BASE+0x08) | |
592 | - | |
593 | -/* Values to write to mode register to disable the watchdog function. */ | |
594 | -#define DISABLE_SEQ1 0xF5 | |
595 | -#define DISABLE_SEQ2 0xA0 | |
596 | - | |
597 | -/* WDTIM_CONTROL bit definitions. */ | |
598 | -#define WDTIM_CONTROL_ST BIT7 | |
599 | - | |
600 | - | |
601 | -/* --------------------------------------------------------------------------- | |
602 | - * Differentiating processor versions for those who care. | |
603 | - * --------------------------------------------------------------------------- | |
604 | - * | |
605 | - */ | |
606 | -#define OMAP1509 0 | |
607 | -#define OMAP1510 1 | |
608 | - | |
609 | -#define OMAP1510_ID_CODE_REG 0xfffed404 | |
610 | - | |
611 | -#ifndef __ASSEMBLY__ | |
612 | -int cpu_type(void); | |
613 | -#endif | |
614 | - | |
615 | -/*****************************************************************************/ | |
616 | - | |
617 | -#define CLKGEN_RESET_BASE (0xfffece00) | |
618 | -#define ARM_CKCTL (volatile __u16 *)(CLKGEN_RESET_BASE + 0x0) | |
619 | -#define ARM_IDLECT1 (volatile __u16 *)(CLKGEN_RESET_BASE + 0x4) | |
620 | -#define ARM_IDLECT2 (volatile __u16 *)(CLKGEN_RESET_BASE + 0x8) | |
621 | -#define ARM_EWUPCT (volatile __u16 *)(CLKGEN_RESET_BASE + 0xC) | |
622 | -#define ARM_RSTCT1 (volatile __u16 *)(CLKGEN_RESET_BASE + 0x10) | |
623 | -#define ARM_RSTCT2 (volatile __u16 *)(CLKGEN_RESET_BASE + 0x14) | |
624 | -#define ARM_SYSST (volatile __u16 *)(CLKGEN_RESET_BASE + 0x18) | |
625 | - | |
626 | - | |
627 | -#define CK_CLKIN 12 /* MHz */ | |
628 | -#define CK_RATEF 1 | |
629 | -#define CK_IDLEF 2 | |
630 | -#define CK_ENABLEF 4 | |
631 | -#define CK_SELECTF 8 | |
632 | -#ifndef __ASSEMBLER__ | |
633 | -#define CK_DPLL1 ((volatile __u16 *)0xfffecf00) | |
634 | -#else | |
635 | -#define CK_DPLL1 (0xfffecf00) | |
636 | -#endif | |
637 | -#define SETARM_IDLE_SHIFT | |
638 | - | |
639 | -/* ARM_CKCTL bit shifts */ | |
640 | -#define PERDIV 0 | |
641 | -#define LCDDIV 2 | |
642 | -#define ARMDIV 4 | |
643 | -#define DSPDIV 6 | |
644 | -#define TCDIV 8 | |
645 | -#define DSPMMUDIV 10 | |
646 | -#define ARM_TIMXO 12 | |
647 | -#define EN_DSPCK 13 | |
648 | -#define ARM_INTHCK_SEL 14 /* REVISIT -- where is this used? */ | |
649 | - | |
650 | -#define ARM_CKCTL_RSRVD_BIT15 (1 << 15) | |
651 | -#define ARM_CKCTL_ARM_INTHCK_SEL (1 << 14) | |
652 | -#define ARM_CKCTL_EN_DSPCK (1 << 13) | |
653 | -#define ARM_CKCTL_ARM_TIMXO (1 << 12) | |
654 | -#define ARM_CKCTL_DSPMMU_DIV1 (1 << 11) | |
655 | -#define ARM_CKCTL_DSPMMU_DIV2 (1 << 10) | |
656 | -#define ARM_CKCTL_TCDIV1 (1 << 9) | |
657 | -#define ARM_CKCTL_TCDIV2 (1 << 8) | |
658 | -#define ARM_CKCTL_DSPDIV1 (1 << 7) | |
659 | -#define ARM_CKCTL_DSPDIV0 (1 << 6) | |
660 | -#define ARM_CKCTL_ARMDIV1 (1 << 5) | |
661 | -#define ARM_CKCTL_ARMDIV0 (1 << 4) | |
662 | -#define ARM_CKCTL_LCDDIV1 (1 << 3) | |
663 | -#define ARM_CKCTL_LCDDIV0 (1 << 2) | |
664 | -#define ARM_CKCTL_PERDIV1 (1 << 1) | |
665 | -#define ARM_CKCTL_PERDIV0 (1 << 0) | |
666 | - | |
667 | -/* ARM_IDLECT1 bit shifts */ | |
668 | -#define IDLWDT_ARM 0 | |
669 | -#define IDLXORP_ARM 1 | |
670 | -#define IDLPER_ARM 2 | |
671 | -#define IDLLCD_ARM 3 | |
672 | -#define IDLLB_ARM 4 | |
673 | -#define IDLHSAB_ARM 5 | |
674 | -#define IDLIF_ARM 6 | |
675 | -#define IDLDPLL_ARM 7 | |
676 | -#define IDLAPI_ARM 8 | |
677 | -#define IDLTIM_ARM 9 | |
678 | -#define SETARM_IDLE 11 | |
679 | - | |
680 | -/* ARM_IDLECT2 bit shifts */ | |
681 | -#define EN_WDTCK 0 | |
682 | -#define EN_XORPCK 1 | |
683 | -#define EN_PERCK 2 | |
684 | -#define EN_LCDCK 3 | |
685 | -#define EN_LBCK 4 | |
686 | -#define EN_HSABCK 5 | |
687 | -#define EN_APICK 6 | |
688 | -#define EN_TIMCK 7 | |
689 | -#define DMACK_REQ 8 | |
690 | -#define EN_GPIOCK 9 | |
691 | -#define EN_LBFREECK 10 | |
692 | - | |
693 | -#define ARM_RSTCT1_SW_RST (1 << 3) | |
694 | -#define ARM_RSTCT1_DSP_RST (1 << 2) | |
695 | -#define ARM_RSTCT1_DSP_EN (1 << 1) | |
696 | -#define ARM_RSTCT1_ARM_RST (1 << 0) | |
697 | - | |
698 | -/* ARM_RSTCT2 bit shifts */ | |
699 | -#define EN_PER 0 | |
700 | - | |
701 | -#define ARM_SYSST_RSRVD_BIT15 (1 << 15) | |
702 | -#define ARM_SYSST_RSRVD_BIT14 (1 << 14) | |
703 | -#define ARM_SYSST_CLOCK_SELECT2 (1 << 13) | |
704 | -#define ARM_SYSST_CLOCK_SELECT1 (1 << 12) | |
705 | -#define ARM_SYSST_CLOCK_SELECT0 (1 << 11) | |
706 | -#define ARM_SYSST_RSRVD_BIT10 (1 << 10) | |
707 | -#define ARM_SYSST_RSRVD_BIT9 (1 << 9) | |
708 | -#define ARM_SYSST_RSRVD_BIT8 (1 << 8) | |
709 | -#define ARM_SYSST_RSRVD_BIT7 (1 << 7) | |
710 | -#define ARM_SYSST_IDLE_DSP (1 << 6) | |
711 | -#define ARM_SYSST_POR (1 << 5) | |
712 | -#define ARM_SYSST_EXT_RST (1 << 4) | |
713 | -#define ARM_SYSST_ARM_MCRST (1 << 3) | |
714 | -#define ARM_SYSST_ARM_WDRST (1 << 2) | |
715 | -#define ARM_SYSST_GLOB_SWRST (1 << 1) | |
716 | -#define ARM_SYSST_DSP_WDRST (1 << 0) | |
717 | - | |
718 | -/* Table 15-23. DPLL Control Registers: */ | |
719 | -#define DPLL_CTL_REG (volatile __u16 *)(0xfffecf00) | |
720 | - | |
721 | -/* Table 15-24. Control Register (CTL_REG): */ | |
722 | - | |
723 | -#define DPLL_CTL_REG_IOB (1 << 13) | |
724 | -#define DPLL_CTL_REG_PLL_MULT Fld(5,0) | |
725 | - | |
726 | -/*****************************************************************************/ | |
727 | - | |
728 | -/* OMAP INTERRUPT REGISTERS */ | |
729 | -#define IRQ_ITR 0x00 | |
730 | -#define IRQ_MIR 0x04 | |
731 | -#define IRQ_SIR_IRQ 0x10 | |
732 | -#define IRQ_SIR_FIQ 0x14 | |
733 | -#define IRQ_CONTROL_REG 0x18 | |
734 | -#define IRQ_ISR 0x9c | |
735 | -#define IRQ_ILR0 0x1c | |
736 | - | |
737 | -#define REG_IHL1_MIR (OMAP_IH1_BASE+IRQ_MIR) | |
738 | -#define REG_IHL2_MIR (OMAP_IH2_BASE+IRQ_MIR) | |
739 | - | |
740 | -/* INTERRUPT LEVEL REGISTER BITS */ | |
741 | -#define ILR_PRIORITY_MASK (0x3c) | |
742 | -#define ILR_PRIORITY_SHIFT (2) | |
743 | -#define ILR_LEVEL_TRIGGER (1<<1) | |
744 | -#define ILR_FIQ (1<<0) | |
745 | - | |
746 | -#define IRQ_LEVEL_INT 1 | |
747 | -#define IRQ_EDGE_INT 0 | |
748 | - | |
749 | -/* Macros to access registers */ | |
750 | -#define outb(v,p) *(volatile u8 *) (p) = v | |
751 | -#define outw(v,p) *(volatile u16 *) (p) = v | |
752 | -#define outl(v,p) *(volatile u32 *) (p) = v | |
753 | - | |
754 | -#define inb(p) *(volatile u8 *) (p) | |
755 | -#define inw(p) *(volatile u16 *) (p) | |
756 | -#define inl(p) *(volatile u32 *) (p) |
1 | -/* | |
2 | - * (C) Copyright 2003 | |
3 | - * Texas Instruments. | |
4 | - * Kshitij Gupta <kshitij@ti.com> | |
5 | - * Configuation settings for the TI OMAP Innovator board. | |
6 | - * | |
7 | - * SPDX-License-Identifier: GPL-2.0+ | |
8 | - */ | |
9 | - | |
10 | -#ifndef __CONFIG_H | |
11 | -#define __CONFIG_H | |
12 | - | |
13 | -/* | |
14 | - * High Level Configuration Options | |
15 | - * (easy to change) | |
16 | - */ | |
17 | -#define CONFIG_ARM926EJS 1 /* This is an arm926ejs CPU core */ | |
18 | -#define CONFIG_OMAP 1 /* in a TI OMAP core */ | |
19 | -#define CONFIG_OMAP1610 1 /* 5912 is same as 1610 */ | |
20 | -#define CONFIG_OSK_OMAP5912 1 /* a OSK Board */ | |
21 | - | |
22 | -#define CONFIG_DISPLAY_CPUINFO 1 /* display cpu info (and speed) */ | |
23 | -#define CONFIG_DISPLAY_BOARDINFO 1 /* display board info */ | |
24 | - | |
25 | -/* input clock of PLL */ | |
26 | -/* the OMAP5912 OSK has 12MHz input clock */ | |
27 | -#define CONFIG_SYS_CLK_FREQ 12000000 | |
28 | - | |
29 | -#define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */ | |
30 | -#define CONFIG_SETUP_MEMORY_TAGS 1 | |
31 | -#define CONFIG_INITRD_TAG 1 /* Required for ramdisk support */ | |
32 | - | |
33 | -/* | |
34 | - * Size of malloc() pool | |
35 | - */ | |
36 | -#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128*1024) | |
37 | - | |
38 | -/* | |
39 | - * Hardware drivers | |
40 | - */ | |
41 | -/* | |
42 | -*/ | |
43 | -#define CONFIG_LAN91C96 | |
44 | -#define CONFIG_LAN91C96_BASE 0x04800300 | |
45 | -#define CONFIG_LAN91C96_EXT_PHY | |
46 | - | |
47 | -/* | |
48 | - * NS16550 Configuration | |
49 | - */ | |
50 | -#define CONFIG_SYS_NS16550 | |
51 | -#define CONFIG_SYS_NS16550_SERIAL | |
52 | -#define CONFIG_SYS_NS16550_REG_SIZE (-4) | |
53 | -#define CONFIG_SYS_NS16550_CLK (48000000) /* can be 12M/32Khz or 48Mhz */ | |
54 | -#define CONFIG_SYS_NS16550_COM1 0xfffb0000 /* uart1, bluetooth uart | |
55 | - on helen */ | |
56 | - | |
57 | -/* | |
58 | - * select serial console configuration | |
59 | - */ | |
60 | -#define CONFIG_SERIAL1 1 /* we use SERIAL 1 on OMAP5912 OSK */ | |
61 | - | |
62 | -/* allow to overwrite serial and ethaddr */ | |
63 | -#define CONFIG_ENV_OVERWRITE | |
64 | -#define CONFIG_CONS_INDEX 1 | |
65 | -#define CONFIG_BAUDRATE 115200 | |
66 | - | |
67 | -/* | |
68 | - * Command line configuration. | |
69 | - */ | |
70 | -#include <config_cmd_default.h> | |
71 | - | |
72 | -#define CONFIG_CMD_DHCP | |
73 | - | |
74 | - | |
75 | -/* | |
76 | - * BOOTP options | |
77 | - */ | |
78 | -#define CONFIG_BOOTP_SUBNETMASK | |
79 | -#define CONFIG_BOOTP_GATEWAY | |
80 | -#define CONFIG_BOOTP_HOSTNAME | |
81 | -#define CONFIG_BOOTP_BOOTPATH | |
82 | - | |
83 | - | |
84 | -#include <configs/omap1510.h> | |
85 | - | |
86 | -#define CONFIG_BOOTDELAY 3 | |
87 | -#define CONFIG_BOOTARGS "mem=32M console=ttyS0,115200n8 noinitrd \ | |
88 | - root=/dev/nfs rw nfsroot=157.87.82.48:\ | |
89 | - /home/mwd/myfs/target ip=dhcp" | |
90 | -#define CONFIG_NETMASK 255.255.254.0 /* talk on MY local net */ | |
91 | -#define CONFIG_IPADDR 156.117.97.156 /* static IP I currently own */ | |
92 | -#define CONFIG_SERVERIP 156.117.97.139 /* current IP of my dev pc */ | |
93 | -#define CONFIG_BOOTFILE "uImage" /* file to load */ | |
94 | - | |
95 | -#if defined(CONFIG_CMD_KGDB) | |
96 | -#define CONFIG_KGDB_BAUDRATE 115200 /* speed to run kgdb serial port */ | |
97 | -#endif | |
98 | - | |
99 | -/* | |
100 | - * Miscellaneous configurable options | |
101 | - */ | |
102 | -#define CONFIG_SYS_LONGHELP /* undef to save memory */ | |
103 | -#define CONFIG_SYS_PROMPT "OMAP5912 OSK # " /* Monitor Command Prompt */ | |
104 | -#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ | |
105 | -/* Print Buffer Size */ | |
106 | -#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) | |
107 | -#define CONFIG_SYS_MAXARGS 16 /* max number of command args */ | |
108 | -#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */ | |
109 | - | |
110 | -#define CONFIG_SYS_MEMTEST_START 0x10000000 /* memtest works on */ | |
111 | -#define CONFIG_SYS_MEMTEST_END 0x12000000 /* 32 MB in DRAM */ | |
112 | - | |
113 | -#define CONFIG_SYS_LOAD_ADDR 0x10000000 /* default load address */ | |
114 | - | |
115 | -/* The 1610 has 6 timers, they can be driven by the RefClk (12Mhz) or by | |
116 | - * DPLL1. This time is further subdivided by a local divisor. | |
117 | - */ | |
118 | -#define CONFIG_SYS_TIMERBASE 0xFFFEC500 /* use timer 1 */ | |
119 | -#define CONFIG_SYS_PTV 7 /* 2^(PTV+1), divide by 256 */ | |
120 | - | |
121 | -/*----------------------------------------------------------------------- | |
122 | - * Physical Memory Map | |
123 | - */ | |
124 | -#define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */ | |
125 | -#define PHYS_SDRAM_1 0x10000000 /* SDRAM Bank #1 */ | |
126 | -#define PHYS_SDRAM_1_SIZE 0x02000000 /* 32 MB */ | |
127 | - | |
128 | -#define PHYS_FLASH_1 0x00000000 /* Flash Bank #1 */ | |
129 | -#define PHYS_FLASH_2 0x01000000 /* Flash Bank #2 */ | |
130 | - | |
131 | -#define CONFIG_SYS_FLASH_BASE PHYS_FLASH_1 | |
132 | - | |
133 | -#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE /* Monitor at beginning of flash */ | |
134 | - | |
135 | -#define PHYS_SRAM 0x20000000 | |
136 | - | |
137 | -/*----------------------------------------------------------------------- | |
138 | - * FLASH driver setup | |
139 | - */ | |
140 | -#define CONFIG_SYS_FLASH_CFI 1 /* Flash memory is CFI compliant */ | |
141 | -#define CONFIG_FLASH_CFI_DRIVER 1 /* Use drivers/mtd/cfi_flash.c */ | |
142 | - | |
143 | -#define CONFIG_SYS_FLASH_BANKS_LIST { PHYS_FLASH_1, PHYS_FLASH_2 } | |
144 | - | |
145 | -#define CONFIG_SYS_MAX_FLASH_BANKS 2 /* max number of memory banks */ | |
146 | -#define PHYS_FLASH_SIZE 0x02000000 /* 32MB */ | |
147 | -#define CONFIG_SYS_MAX_FLASH_SECT (259) /* max number of sectors on one chip */ | |
148 | - | |
149 | -#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1 /* Use buffered writes (~10x faster) */ | |
150 | -#define CONFIG_SYS_FLASH_PROTECTION 1 /* Use hardware sector protection */ | |
151 | - | |
152 | -#define CONFIG_SYS_FLASH_EMPTY_INFO /* print 'E' for empty sector on flinfo */ | |
153 | - | |
154 | -/* timeout values are in ticks */ | |
155 | -#define CONFIG_SYS_FLASH_ERASE_TOUT (20*CONFIG_SYS_HZ) /* Timeout for Flash Erase */ | |
156 | -#define CONFIG_SYS_FLASH_WRITE_TOUT (20*CONFIG_SYS_HZ) /* Timeout for Flash Write */ | |
157 | - | |
158 | -/*----------------------------------------------------------------------- | |
159 | - * FLASH and environment organization | |
160 | - */ | |
161 | -#define CONFIG_ENV_IS_IN_FLASH 1 | |
162 | -/* addr of environment */ | |
163 | -#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET) | |
164 | - | |
165 | -#define CONFIG_ENV_SIZE 0x20000 /* Total Size of Environment Sector */ | |
166 | -#define CONFIG_ENV_OFFSET 0x40000 /* environment starts here */ | |
167 | - | |
168 | -#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 | |
169 | -#define CONFIG_SYS_INIT_RAM_ADDR PHYS_SRAM | |
170 | -#define CONFIG_SYS_INIT_RAM_SIZE (250 * 1024) | |
171 | -#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \ | |
172 | - CONFIG_SYS_INIT_RAM_SIZE) | |
173 | - | |
174 | -#endif /* __CONFIG_H */ |
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3
-
mentioned in commit 9ea7f3