]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/hal/arm/mx51/karo/v1_0/include/hal_platform_setup.h
RedBoot Release 2010-03-22
[karo-tx-redboot.git] / packages / hal / arm / mx51 / karo / v1_0 / include / hal_platform_setup.h
1 #ifndef CYGONCE_HAL_PLATFORM_SETUP_H
2 #define CYGONCE_HAL_PLATFORM_SETUP_H
3
4 //=============================================================================
5 //
6 //      hal_platform_setup.h
7 //
8 //      Platform specific support for HAL (assembly code)
9 //
10 //=============================================================================
11 //####ECOSGPLCOPYRIGHTBEGIN####
12 // -------------------------------------------
13 // This file is part of eCos, the Embedded Configurable Operating System.
14 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
15 //
16 // eCos is free software; you can redistribute it and/or modify it under
17 // the terms of the GNU General Public License as published by the Free
18 // Software Foundation; either version 2 or (at your option) any later version.
19 //
20 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
21 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
23 // for more details.
24 //
25 // You should have received a copy of the GNU General Public License along
26 // with eCos; if not, write to the Free Software Foundation, Inc.,
27 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
28 //
29 // As a special exception, if other files instantiate templates or use macros
30 // or inline functions from this file, or you compile this file and link it
31 // with other works to produce a work based on this file, this file does not
32 // by itself cause the resulting work to be covered by the GNU General Public
33 // License. However the source code for this file must still be made available
34 // in accordance with section (3) of the GNU General Public License.
35 //
36 // This exception does not invalidate any other reasons why a work based on
37 // this file might be covered by the GNU General Public License.
38 //
39 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
40 // at http://sources.redhat.com/ecos/ecos-license/
41 // -------------------------------------------
42 //####ECOSGPLCOPYRIGHTEND####
43 //===========================================================================
44
45 #include <pkgconf/system.h>                     // System-wide configuration info
46 #include CYGBLD_HAL_VARIANT_H                   // Variant specific configuration
47 #include CYGBLD_HAL_PLATFORM_H                  // Platform specific configuration
48 #include <cyg/hal/hal_soc.h>                    // Variant specific hardware definitions
49 #include <cyg/hal/hal_mmu.h>                    // MMU definitions
50 #include <cyg/hal/karo_tx51.h>                  // Platform specific hardware definitions
51 #include CYGHWR_MEMORY_LAYOUT_H
52
53 #if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
54 #define PLATFORM_SETUP1 _platform_setup1
55 #define CYGHWR_HAL_ARM_HAS_MMU
56
57 #ifdef CYG_HAL_STARTUP_ROMRAM
58 #define CYGSEM_HAL_ROM_RESET_USES_JUMP
59 #endif
60
61 #define TX51_NAND_PAGE_SIZE             2048
62 #define TX51_NAND_BLKS_PER_PAGE         64
63
64 #define DEBUG_LED_BIT                   10
65 #define LED_GPIO_BASE                   GPIO4_BASE_ADDR
66 #define LED_MUX_OFFSET                  0x1d0
67 #define LED_MUX_MODE                    0x13
68
69 #define LED_ON  LED_CTRL #1
70 #define LED_OFF LED_CTRL #0
71
72 #ifndef CYGOPT_HAL_ARM_TX51_DEBUG
73         .macro  LED_CTRL,val
74         .endm
75         .macro  LED_BLINK,val
76         .endm
77         .macro  DELAY,ms
78         .endm
79 #else
80 #define CYGHWR_LED_MACRO        LED_BLINK #\x
81         .macro  DELAY,ms
82         ldr     r10, =\ms
83 111:
84         subs    r10, r10, #1
85         bmi     113f
86         ldr     r9, =(3600 / 10)
87 112:
88         subs    r9, r9, #1
89         bne     112b
90         b       111b
91         .ltorg
92 113:
93         .endm
94
95         .macro  LED_CTRL,val
96         // switch user LED (GPIO4_10) on STK5
97         ldr     r10, =LED_GPIO_BASE
98         // GPIO_DR
99         mov     r9, \val
100         cmp     r9, #0
101         movne   r9, #(1 << DEBUG_LED_BIT)       @ LED ON
102         moveq   r9, #0                          @ LED OFF
103         str     r9, [r10, #GPIO_DR]
104         .endm
105
106         .macro  LED_BLINK,val
107         mov     r8, \val
108 211:
109         subs    r8, r8, #1
110         bmi     212f
111         LED_CTRL #1
112         DELAY   200
113         LED_CTRL #0
114         DELAY   300
115         b       211b
116 212:
117         DELAY   1000
118         .endm
119 #endif
120
121         .macro  LED_INIT
122         // initialize GPIO4_10 (PAD CSI2_D13) for LED on STK5
123         ldr     r10, =LED_GPIO_BASE
124         // GPIO_GDIR
125         ldr     r9, [r10, #GPIO_GDIR]
126         orr     r9, r9, #(1 << DEBUG_LED_BIT)
127         str     r9, [r10, #GPIO_GDIR]
128         // iomux
129         ldr     r10, =IOMUXC_BASE_ADDR
130         mov     r9, #LED_MUX_MODE
131         str     r9, [r10, #LED_MUX_OFFSET]
132         // GPIO_DR
133         mov     r9, #(1 << DEBUG_LED_BIT)       @ LED ON
134         str     r9, [r10, #GPIO_DR]
135         .endm
136
137 #define DCDGEN(type, addr, data)  .long type, addr, data
138
139 #define PLATFORM_PREAMBLE flash_header
140
141 // This macro represents the initial startup code for the platform
142         .macro  _platform_setup1
143 KARO_TX51_SETUP_START:
144         mrs     r0, CPSR
145         mov     r0, #0x1f
146         orr     r0, r0, #128
147         orr     r0, r0, #64
148         msr     CPSR_xc, r0
149
150         ldr     r1, =ROM_BASE_ADDR
151         ldr     r11, [r1, #ROM_SI_REV_OFFSET]
152
153         setup_sdram
154
155         ldr     r0, =GPC_BASE_ADDR
156         cmp     r11, #0x10        // r11 contains the silicon rev
157         ldrls   r1, =0x1FC00000
158         ldrhi   r1, =0x1A800000
159         str     r1, [r0, #4]
160
161         // Explicitly disable L2 cache
162         mrc     15, 0, r0, c1, c0, 1
163         bic     r0, r0, #0x2
164         mcr     15, 0, r0, c1, c0, 1
165
166         // reconfigure L2 cache aux control reg
167         mov     r0, #0xC0               // tag RAM
168         add     r0, r0, #0x4            // data RAM
169         orr     r0, r0, #(1 << 24)      // disable write allocate delay
170         orr     r0, r0, #(1 << 23)      // disable write allocate combine
171         orr     r0, r0, #(1 << 22)      // disable write allocate
172
173         @ cc is still set from "cmp r11, #0x10" above
174         orrls   r0, r0, #(1 << 25)      @ disable write combine for TO 2 and lower revs
175
176         mcr     15, 1, r0, c9, c0, 2
177
178 init_aips_start:
179         init_aips
180         LED_INIT
181 init_m4if_start:
182         init_m4if
183
184 #ifdef CYG_HAL_STARTUP_ROMRAM     /* enable running from RAM */
185         LED_BLINK #1
186 #endif /* CYG_HAL_STARTUP_ROMRAM */
187 init_clock_start:
188         init_clock
189
190 Normal_Boot_Continue:
191 /*
192  * Note:
193  *      IOMUX/PBC setup is done in C function plf_hardware_init() for simplicity
194  */
195 STACK_Setup:
196         @ Set up a stack [for calling C code]
197         ldr     r1, =__startup_stack
198         ldr     r2, =RAM_BANK0_BASE
199         orr     sp, r1, r2
200
201         @ Create MMU tables
202         bl      hal_mmu_init
203         LED_BLINK #2
204
205         /* Workaround for arm erratum #709718 */
206         @ Setup PRRR so device is always mapped to non-shared
207         mrc     MMU_CP, 0, r1, c10, c2, 0 // Read Primary Region Remap Register
208         bic     r1, #(3 << 16)
209         mcr     MMU_CP, 0, r1, c10, c2, 0 // Write Primary Region Remap Register
210
211         @ Enable MMU
212         ldr     r2, =10f
213         mrc     MMU_CP, 0, r1, MMU_Control, c0
214         orr     r1, r1, #7                      @ enable MMU bit
215         orr     r1, r1, #0x800                  @ enable z bit
216         orr     r1, r1, #(1 << 28)              @ Enable TEX remap, workaround for L1 cache issue
217         mcr     MMU_CP, 0, r1, MMU_Control, c0
218
219         /* Workaround for arm errata #621766 */
220         mrc     MMU_CP, 0, r1, MMU_Control, c0, 1
221         orr     r1, r1, #(1 << 5)               @ enable L1NEON bit
222         mcr     MMU_CP, 0, r1, MMU_Control, c0, 1
223
224         mov     pc, r2                          @ Change address spaces
225         .align  5
226 10:
227         LED_BLINK #3
228         .endm   @ _platform_setup1
229
230         /* AIPS setup - Only setup MPROTx registers. The PACR default values are good.*/
231         .macro  init_aips
232         /*
233         * Set all MPROTx to be non-bufferable, trusted for R/W,
234         * not forced to user-mode.
235         */
236         ldr     r0, =AIPS1_CTRL_BASE_ADDR
237         ldr     r1, AIPS1_PARAM
238         str     r1, [r0, #0x00]
239         str     r1, [r0, #0x04]
240         ldr     r0, =AIPS2_CTRL_BASE_ADDR
241         str     r1, [r0, #0x00]
242         str     r1, [r0, #0x04]
243         .endm   /* init_aips */
244
245         .macro  WDOG_RESET
246         ldr     r0, =WDOG_BASE_ADDR
247         mov     r1, #0
248 1:
249         strh    r1, [r0]
250         b       1b
251         .endm
252
253         .macro  init_clock
254         ldr     r0, =CCM_BASE_ADDR
255         ldr     r1, [r0, #CLKCTL_CCR]
256         tst     r1, #(1 << 12)
257         bne     osc_ok
258
259         orr     r1, r1, #(1 << 12)
260         str     r1, [r0, #CLKCTL_CCR]
261
262         ldr     r1, [r0, #CLKCTL_CCSR]
263         bic     r1, #(1 << 9)   /* switch lp_apm to OSC */
264         str     r1, [r0, #CLKCTL_CCSR]
265 osc_ok:
266         /* Gate off clocks to the peripherals first */
267         ldr     r1, =0x3FFFFFFF
268         str     r1, [r0, #CLKCTL_CCGR0]
269         ldr     r1, =0x0
270         str     r1, [r0, #CLKCTL_CCGR1]
271         str     r1, [r0, #CLKCTL_CCGR2]
272         str     r1, [r0, #CLKCTL_CCGR3]
273
274         ldr     r1, =0x00030000
275         str     r1, [r0, #CLKCTL_CCGR4]
276         ldr     r1, =0x00FFF030
277         str     r1, [r0, #CLKCTL_CCGR5]
278         ldr     r1, =0x00000300
279         str     r1, [r0, #CLKCTL_CCGR6]
280
281         /* Disable IPU and HSC dividers */
282         mov     r1, #0x60000
283         str     r1, [r0, #CLKCTL_CCDR]
284
285         /* Make sure to switch the DDR away from PLL 1 */
286         ldr     r1, CCM_CBCDR_VAL1
287         str     r1, [r0, #CLKCTL_CBCDR]
288         /* make sure divider effective */
289 1:
290         ldr     r1, [r0, #CLKCTL_CDHIPR]
291         cmp     r1, #0x0
292         bne     1b
293
294         /* Switch ARM to step clock */
295         ldr     r1, [r0, #CLKCTL_CCSR]
296         mov     r1, #0x4
297         str     r1, [r0, #CLKCTL_CCSR]
298
299         setup_pll PLL1, 800
300         setup_pll PLL3, 665
301
302         /* Switch peripheral to PLL 3 */
303         ldr     r1, CCM_CBCMR_VAL1
304         str     r1, [r0, #CLKCTL_CBCMR]
305
306         ldr     r1, CCM_CBCDR_VAL2
307         str     r1, [r0, #CLKCTL_CBCDR]
308
309         setup_pll PLL2, 665
310
311         /* Switch peripheral to PLL 2 */
312         ldr     r1, CCM_CBCDR_VAL1
313         str     r1, [r0, #CLKCTL_CBCDR]
314         /* Use lp_apm (24MHz) source for perclk */
315         ldr     r1, CCM_CBCMR_VAL2
316         str     r1, [r0, #CLKCTL_CBCMR]
317
318         setup_pll PLL3, 216
319
320         /* Set the platform clock dividers */
321         ldr     r2, =PLATFORM_BASE_ADDR
322         ldr     r1, PLATFORM_CLOCK_DIV
323         str     r1, [r2, #PLATFORM_ICGC]
324
325         /* Run TO 3.0 at Full speed, for other TO's wait till we increase VDDGP */
326         cmp     r11, #0x10
327         movls   r1, #1
328         movhi   r1, #0
329         str     r1, [r0, #CLKCTL_CACRR]
330
331         /* Switch ARM back to PLL 1. */
332         mov     r1, #0
333         str     r1, [r0, #CLKCTL_CCSR]
334
335         /* setup the rest */
336         @ ddr clock from PLL 1, all perclk dividers are 1 since using 24MHz
337         ldr     r1, CCM_CBCDR_VAL3
338         str     r1, [r0, #CLKCTL_CBCDR]
339
340         /* Restore the default values in the Gate registers */
341         ldr     r1, =0xFFFFFFFF
342         str     r1, [r0, #CLKCTL_CCGR0]
343         str     r1, [r0, #CLKCTL_CCGR1]
344         str     r1, [r0, #CLKCTL_CCGR2]
345         str     r1, [r0, #CLKCTL_CCGR3]
346         str     r1, [r0, #CLKCTL_CCGR4]
347         str     r1, [r0, #CLKCTL_CCGR5]
348         str     r1, [r0, #CLKCTL_CCGR6]
349
350         /* Use PLL 2 for UART's, get 66.5MHz from it */
351         ldr     r1, CCM_CSCMR1_VAL
352         str     r1, [r0, #CLKCTL_CSCMR1]
353         ldr     r1, CCM_CSCDR1_VAL
354         str     r1, [r0, #CLKCTL_CSCDR1]
355
356         /* make sure divider effective */
357 1:
358         ldr     r1, [r0, #CLKCTL_CDHIPR]
359         cmp     r1, #0x0
360         bne     1b
361
362         mov     r1, #0x00000
363         str     r1, [r0, #CLKCTL_CCDR]
364
365         @ for cko - for ARM div by 8
366         mov     r1, #0x000A0000
367         orr     r1, r1, #0x00000F0
368         str     r1, [r0, #CLKCTL_CCOSR]
369
370         ldr     r1, [r0, #CLKCTL_CCR]
371         bic     r1, #(1 << 8)           /* switch off FPM */
372         str     r1, [r0, #CLKCTL_CCR]
373 end_clk_init:
374         .endm   @ init_clock
375
376         .macro  setup_pll pll_nr, mhz
377         ldr     r2, BASE_ADDR_\pll_nr
378         ldr     r1, PLL_VAL_0x1232
379         str     r1, [r2, #PLL_DP_CTL]           @ Set DPLL ON (set UPEN bit); BRMO=1
380         mov     r1, #0x2
381         str     r1, [r2, #PLL_DP_CONFIG]        @ Enable auto-restart AREN bit
382
383         ldr     r1, W_DP_OP_\mhz
384         str     r1, [r2, #PLL_DP_OP]
385         str     r1, [r2, #PLL_DP_HFS_OP]
386
387         ldr     r1, W_DP_MFD_\mhz
388         str     r1, [r2, #PLL_DP_MFD]
389         str     r1, [r2, #PLL_DP_HFS_MFD]
390
391         ldr     r1, W_DP_MFN_\mhz
392         str     r1, [r2, #PLL_DP_MFN]
393         str     r1, [r2, #PLL_DP_HFS_MFN]
394
395         mov     r1, #0x3
396         str     r1, [r2, #PLL_DP_CONFIG]        @ Assert LDREQ
397
398         @ Now restart PLL
399         ldr     r1, PLL_VAL_0x1232
400         str     r1, [r2, #PLL_DP_CTL]
401 101:
402         ldr     r1, [r2, #PLL_DP_CTL]
403         ands    r1, r1, #0x1
404         beq     101b
405         .endm
406
407         /* M3IF setup */
408         .macro  init_m4if
409         ldr     r1, =M4IF_BASE_ADDR
410         ldr     r0, M4IF_M4IF4_VAL
411         str     r0, [r1, #M4IF_MIF4]
412
413         /* Configure M4IF registers, VPU and IPU given higher priority (=0x4) */
414         ldr     r0, M4IF_FBPM0_VAL
415         str     r0, [r1, #M4IF_FBPM0]
416
417         ldr     r0, M4IF_FPWC_VAL
418         str     r0, [r1, #M4IF_FPWC]
419         .endm   /* init_m4if */
420
421         .macro  setup_sdram
422 #if 0
423         cmp     r11, #0x10    // r11 contains the silicon rev
424         bls     skip_setup
425         /* Decrease the DRAM SDCLK pads to HIGH Drive strength */
426         ldr     r0, =IOMUXC_BASE_ADDR
427         ldr     r1, =0x000000e5
428         str     r1, [r0, #0x4b8]
429         /* Change the delay line configuration */
430         ldr     r0, =ESDCTL_BASE_ADDR
431         ldr     r1, =0x00f49400
432         str     r1, [r0, #ESDCTL_ESDCDLY1]
433         ldr     r1, =0x00f49a00
434         str     r1, [r0, #ESDCTL_ESDCDLY2]
435         ldr     r1, =0x00f49100
436         str     r1, [r0, #ESDCTL_ESDCDLY3]
437         ldr     r1, =0x00f48900
438         str     r1, [r0, #ESDCTL_ESDCDLY4]
439         ldr     r1, =0x00f49400
440         str     r1, [r0, #ESDCTL_ESDCDLY5]
441 #endif
442 skip_setup:
443         .endm
444 #else // defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
445 #define PLATFORM_SETUP1
446 #endif
447
448 #define PLATFORM_VECTORS         _platform_vectors
449         .macro  _platform_vectors
450         .globl  _KARO_MAGIC
451 _KARO_MAGIC:
452         .ascii  "KARO_CE6"
453         .globl  _KARO_STRUCT_SIZE
454 _KARO_STRUCT_SIZE:
455         .word   0       // reserve space structure length
456
457         .globl  _KARO_CECFG_START
458 _KARO_CECFG_START:
459         .rept   1024/4
460         .word   0       // reserve space for CE configuration
461         .endr
462
463         .globl  _KARO_CECFG_END
464 _KARO_CECFG_END:
465         .endm
466
467         .align  5
468         .ascii  "KARO TX51 " __DATE__ " " __TIME__
469         .align
470
471 /* SDRAM timing setup */
472 #define RALAT           1
473 #define LHD             0
474
475 #if SDRAM_SIZE <= SZ_128M
476 #define RA_BITS         (13 - 11)       /* row addr bits - 11 */
477 #else
478 #define RA_BITS         (14 - 11)       /* row addr bits - 11 */
479 #endif
480
481 #define CA_BITS         (10 - 8)        /* 0-2: col addr bits - 8 3: rsrvd */
482 #define DSIZ            2       /* 0: D[31..16] 1: D[15..D0] 2: D[31..0] 3: rsrvd */
483 #define SREFR           3       /* 0: disabled 1-5: 2^n rows/clock *: rsrvd */
484 #define SRT             0       /* 0: disabled *: 1: self refr. ... */
485 #define PWDT            0       /* 0: disabled 1: precharge pwdn
486                                    2: pwdn after 64 clocks 3: pwdn after 128 clocks */
487 #define ESDCTL_VAL      (0x80000000 | (SREFR << 28) | (RA_BITS << 24) | (CA_BITS << 20) | \
488                          (DSIZ << 16) | (SRT << 14) | (PWDT << 12))
489
490 #define SDRAM_CLK       200
491 #define NS_TO_CK(ns)    (((ns) * SDRAM_CLK + 999) / 1000)
492
493         .macro          CK_VAL, name, clks, offs
494         .iflt           \clks - \offs
495         .set            \name, 0
496         .else
497         .set            \name, \clks - \offs
498         .endif
499         .endm
500
501         .macro          NS_VAL, name, ns, offs
502         .iflt           \ns - \offs
503         .set            \name, 0
504         .else
505         CK_VAL          \name, NS_TO_CK(\ns), \offs
506         .endif
507         .endm
508
509 #if SDRAM_SIZE <= SZ_128M
510 /* MT46H32M32LF-6 */
511 NS_VAL  tRFC,   125, 10 /* clks - 10 (0..15) */
512 NS_VAL  tXSR,   138, 25 /* clks - 25 (0..15) */
513 NS_VAL  tXP,    25, 1   /* clks - 1 (0..7)  */
514 CK_VAL  tWTR,   1, 1    /* clks - 1 (0..1)  */
515 NS_VAL  tRP,    18, 2   /* clks - 2 (0..3)  */
516 CK_VAL  tMRD,   2, 1    /* clks - 1 (0..3)  */
517 NS_VAL  tWR,    15, 2   /* clks - 2 (0..1)  */
518 NS_VAL  tRAS,   42, 1   /* clks - 1 (0..15) */
519 NS_VAL  tRRD,   12, 1   /* clks - 1 (0..3)  */
520 NS_VAL  tRCD,   18, 1   /* clks - 1 (0..7) */
521 NS_VAL  tRC,    60, 1   /* 0: 20 *: clks - 1 (0..15) */
522 #else
523 /* MT46H64M32LF-5 or -6 */
524 NS_VAL  tRFC,   72, 10  /* clks - 10 (0..15) */
525 NS_VAL  tXSR,   113, 25 /* clks - 25 (0..15) */
526 CK_VAL  tXP,    2, 1    /* clks - 1 (0..7)  */
527 CK_VAL  tWTR,   2, 1    /* clks - 1 (0..1)  */
528 NS_VAL  tRP,    18, 2   /* clks - 2 (0..3)  */
529 CK_VAL  tMRD,   2, 1    /* clks - 1 (0..3)  */
530 NS_VAL  tWR,    15, 2   /* clks - 2 (0..1)  */
531 NS_VAL  tRAS,   42, 1   /* clks - 1 (0..15) */
532 NS_VAL  tRRD,   12, 1   /* clks - 1 (0..3)  */
533 NS_VAL  tRCD,   18, 1   /* clks - 1 (0..7) */
534 NS_VAL  tRC,    60, 1   /* 0: 20 *: clks - 1 (0..15) */
535 #endif
536
537 #define ESDCFG_VAL      ((tRFC << 28) | (tXSR << 24) | (tXP << 21) | \
538                         (tWTR << 20) | (tRP << 18) | (tMRD << 16) | \
539                         (tRAS << 12) | (tRRD << 10) | (tWR << 7) | \
540                         (tRCD << 4) | (tRC << 0))
541 /*
542         0x70655427
543 */
544 #define ESDMISC_RALAT(n)        (((n) & 0x3) << 7)
545 #define ESDMISC_DDR2_EN(n)      (((n) & 0x1) << 4)
546 #define ESDMISC_DDR_EN(n)       (((n) & 0x1) << 3)
547 #define ESDMISC_AP(n)           (((n) & 0xf) << 16)
548 #define ESDMISC_VAL             (ESDMISC_AP(10) | ESDMISC_RALAT(RALAT) | \
549                                 (LHD << 5) | ESDMISC_DDR2_EN(0) | ESDMISC_DDR_EN(0))
550
551         .macro  flash_header
552         b       reset_vector
553         .org    0x400
554 app_start_addr:
555         .long reset_vector
556 app_code_barker:
557         .long   0xB1
558 app_code_csf:
559         .long   0 // 0x97f40000 - 0x1000
560 dcd_ptr_ptr:
561         .long   dcd_ptr
562 super_root_key:
563         .long   0 // hab_super_root_key
564 dcd_ptr:
565         .long   dcd_data
566 app_dest_ptr:
567 #ifndef RAM_BANK1_SIZE
568         .long   RAM_BANK0_BASE + SDRAM_SIZE - REDBOOT_OFFSET
569 #else
570         .long   RAM_BANK1_BASE + RAM_BANK1_SIZE - REDBOOT_OFFSET
571 #endif
572 dcd_data:
573         .long   0xB17219E9   // Fixed. can't change.
574 dcd_len:
575         .long   dcd_end - dcd_start
576 dcd_start:
577         DCDGEN(4, ESDCTL_BASE_ADDR + ESDCTL_ESDCTL0, 0x80000000)
578         DCDGEN(4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x04008008)
579         DCDGEN(4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00008010)
580         DCDGEN(4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00008010)
581         DCDGEN(4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00338018)
582         DCDGEN(4, ESDCTL_BASE_ADDR + ESDCTL_ESDCTL0, ESDCTL_VAL)
583         DCDGEN(4, ESDCTL_BASE_ADDR + ESDCTL_ESDCFG0, ESDCFG_VAL)
584 #ifdef RAM_BANK1_SIZE
585         DCDGEN(4, ESDCTL_BASE_ADDR + ESDCTL_ESDCTL1, ESDCTL_VAL)
586         DCDGEN(4, ESDCTL_BASE_ADDR + ESDCTL_ESDCFG1, ESDCFG_VAL)
587 #endif
588         DCDGEN(4, ESDCTL_BASE_ADDR + 0x34, 0x00020000 | ((RALAT & 0x3) << 29))
589         DCDGEN(4, ESDCTL_BASE_ADDR + ESDCTL_ESDMISC, ESDMISC_VAL)
590         DCDGEN(4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00000000)
591 dcd_end:
592 image_len:
593         .long   REDBOOT_IMAGE_SIZE
594         .endm
595
596 SRC_BASE_ADDR_W:        .long   SRC_BASE_ADDR
597 WDOG_BASE_ADDR_W:       .long   WDOG_BASE_ADDR
598 AIPS1_PARAM:            .word   0x77777777
599 M4IF_FBPM0_VAL:         .word   0x00000103
600 M4IF_M4IF4_VAL:         .word   0x00230185
601 M4IF_FPWC_VAL:          .word   0x00240126
602 MXC_REDBOOT_ROM_START:  .long   SDRAM_BASE_ADDR + SDRAM_SIZE - REDBOOT_OFFSET
603 CCM_CBCDR_VAL1:         .word   0x19239145
604 CCM_CBCDR_VAL2:         .word   0x13239145
605 #if SDRAM_CLK == 200
606 CCM_CBCDR_VAL3:         .word   0x59E35100
607 #else
608 CCM_CBCDR_VAL3:         .word   0x21E35100
609 #endif
610 CCM_CBCMR_VAL1:         .word   0x000010C0
611 CCM_CBCMR_VAL2:         .word   0x000020C0
612 CCM_CSCMR1_VAL:         .word   0xA5A2A020
613 CCM_CSCDR1_VAL:         .word   0x00C30321
614 BASE_ADDR_PLL1:         .long   PLL1_BASE_ADDR
615 BASE_ADDR_PLL2:         .long   PLL2_BASE_ADDR
616 BASE_ADDR_PLL3:         .long   PLL3_BASE_ADDR
617 PLL_VAL_0x1232:         .word   0x1232
618 W_DP_OP_800:            .word   DP_OP_800
619 W_DP_MFD_800:           .word   DP_MFD_800
620 W_DP_MFN_800:           .word   DP_MFN_800
621 W_DP_OP_700:            .word   DP_OP_700
622 W_DP_MFD_700:           .word   DP_MFD_700
623 W_DP_MFN_700:           .word   DP_MFN_700
624 W_DP_OP_400:            .word   DP_OP_400
625 W_DP_MFD_400:           .word   DP_MFD_400
626 W_DP_MFN_400:           .word   DP_MFN_400
627 W_DP_OP_532:            .word   DP_OP_532
628 W_DP_MFD_532:           .word   DP_MFD_532
629 W_DP_MFN_532:           .word   DP_MFN_532
630 W_DP_OP_665:            .word   DP_OP_665
631 W_DP_MFD_665:           .word   DP_MFD_665
632 W_DP_MFN_665:           .word   DP_MFN_665
633 W_DP_OP_216:            .word   DP_OP_216
634 W_DP_MFD_216:           .word   DP_MFD_216
635 W_DP_MFN_216:           .word   DP_MFN_216
636 PLATFORM_CLOCK_DIV:     .word   0x00000124
637
638 /*----------------------------------------------------------------------*/
639 /* end of hal_platform_setup.h                                          */
640 #endif /* CYGONCE_HAL_PLATFORM_SETUP_H */