1 #ifndef CYGONCE_HAL_PLATFORM_SETUP_H
2 #define CYGONCE_HAL_PLATFORM_SETUP_H
4 //=============================================================================
6 // hal_platform_setup.h
8 // Platform specific support for HAL (assembly code)
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.
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.
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
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.
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.
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.
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 //===========================================================================
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/fsl_board.h> // Platform specific hardware definitions
52 #if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
53 #define PLATFORM_SETUP1 _platform_setup1
55 //#define BOOT_FROM_MMC
57 #if defined(BOOT_FROM_MMC)
58 #define PLATFORM_PREAMBLE setup_flash_header
59 //#define MEMORY_MDDR_ENABLE
62 #define CYGHWR_HAL_ARM_HAS_MMU
64 #ifdef CYG_HAL_STARTUP_ROMRAM
65 #define CYGSEM_HAL_ROM_RESET_USES_JUMP
68 #define CYGHWR_HAL_ROM_VADDR 0x0
71 #define UNALIGNED_ACCESS_ENABLE
72 #define SET_T_BIT_DISABLE
73 #define LOW_INT_LATENCY_ENABLE
74 #define BRANCH_PREDICTION_ENABLE
77 #define UNALIGNED_ACCESS_ENABLE
78 #define LOW_INT_LATENCY_ENABLE
79 #define BRANCH_PREDICTION_ENABLE
81 //#define TURN_OFF_IMPRECISE_ABORT
83 // This macro represents the initial startup code for the platform
84 // r11 is reserved to contain chip rev info in this file
85 .macro _platform_setup1
86 FSL_BOARD_SETUP_START:
89 * - invalidate I/D cache/TLB and drain write buffer;
90 * - invalidate L2 cache
92 * - branch predictions
94 #ifdef TURN_OFF_IMPRECISE_ABORT
100 mrc 15, 0, r1, c1, c0, 0
101 bic r1, r1, #(0x3<<21)
102 bic r1, r1, #(0x3<<11)
105 #ifndef BRANCH_PREDICTION_ENABLE
106 mrc 15, 0, r0, c1, c0, 1
108 mcr 15, 0, r0, c1, c0, 1
110 mrc 15, 0, r0, c1, c0, 1
112 mcr 15, 0, r0, c1, c0, 1
116 #ifdef UNALIGNED_ACCESS_ENABLE
120 #ifdef LOW_INT_LATENCY_ENABLE
123 mcr 15, 0, r1, c1, c0, 0
125 #ifdef BRANCH_PREDICTION_ENABLE
127 mcr 15, 0, r0, c15, c2, 4
131 mcr 15, 0, r0, c7, c7, 0 /* invalidate I cache and D cache */
132 mcr 15, 0, r0, c8, c7, 0 /* invalidate TLBs */
133 mcr 15, 0, r0, c7, c10, 4 /* Drain the write buffer */
135 /* Also setup the Peripheral Port Remap register inside the core */
136 ldr r0, ARM_PPMRR /* start from AIPS 2GB region */
137 mcr p15, 0, r0, c15, c2, 4
139 /*** L2 Cache setup/invalidation/disable ***/
140 /* Disable L2 cache first */
141 mov r0, #L2CC_BASE_ADDR
142 ldr r2, [r0, #L2_CACHE_CTL_REG]
144 str r2, [r0, #L2_CACHE_CTL_REG]
146 * Configure L2 Cache:
147 * - 128k size(16k way)
148 * - 8-way associativity
149 * - 0 ws TAG/VALID/DIRTY
152 ldr r1, [r0, #L2_CACHE_AUX_CTL_REG]
153 and r1, r1, #0xFE000000
154 ldr r2, L2CACHE_PARAM
156 str r1, [r0, #L2_CACHE_AUX_CTL_REG]
157 ldr r1, ROM_VER_ADDR_W
160 /* Workaournd for DDR issue:WT*/
161 ldreq r1, [r0, #L2_CACHE_DBG_CTL_REG]
163 streq r1, [r0, #L2_CACHE_DBG_CTL_REG]
167 str r1, [r0, #L2_CACHE_INV_WAY_REG]
169 /* Poll Invalidate By Way register */
170 ldr r2, [r0, #L2_CACHE_INV_WAY_REG]
173 /*** End of L2 operations ***/
175 #if defined(BOOT_FROM_MMC)
176 mov r0, #MMC_FLASH_BOOT
177 ldr r1, AVIC_VECTOR0_ADDR_W
178 str r0, [r1] // if MMC is selected, set MXCFIS_FLAG_REG
180 mov r0, #SDRAM_NON_FLASH_BOOT
181 ldr r1, AVIC_VECTOR0_ADDR_W
182 str r0, [r1] // for checking boot source from nand or sdram
185 * End of ARM1136 init
197 * Use default setting is more stable then the settinig from IC team for EINCE
200 #ifndef BOOT_FROM_MMC
201 /* If SDRAM has been setup, bypass clock/WEIM setup */
202 cmp pc, #SDRAM_BASE_ADDR
204 cmp pc, #(SDRAM_BASE_ADDR + SDRAM_SIZE)
205 blo HWInitialise_skip_SDRAM_setup
207 mov r0, #NOR_FLASH_BOOT
208 ldr r1, AVIC_VECTOR0_ADDR_W
213 #ifndef BOOT_FROM_MMC
218 /* Assuming DDR memory first */
221 HWInitialise_skip_SDRAM_setup:
224 add r2, r0, #0x1000 // 4K window
226 blo Normal_Boot_Continue
228 bhi Normal_Boot_Continue
230 /* Copy image from flash to SDRAM first */
231 ldr r1, MXC_REDBOOT_ROM_START
233 1: ldmia r0!, {r3-r10}
239 and r0, pc, r1 /* offset of pc */
240 ldr r1, MXC_REDBOOT_ROM_START
248 mov r0, #NAND_FLASH_BOOT
249 ldr r1, AVIC_VECTOR0_ADDR_W
252 ldr r1, AVIC_VECTOR1_ADDR_W
255 mov r0, #NFC_BASE; //r0: nfc base. Reloaded after each page copying
256 add r12, r0, #0x1E00 //r12: NFC register base. Doesn't change
257 ldrh r3, [r12, #NAND_FLASH_CONFIG1_REG_OFF]
261 ldr r7, CCM_BASE_ADDR_W
262 ldr r1, [r7, #CLKCTL_RCSR]
263 /*BUS WIDTH setting*/
265 orrne r1, r1, #0x4000
266 biceq r1, r1, #0x4000
275 orrne r1, r1, #0x100 /*2KB page size*/
276 biceq r1, r1, #0x100 /*512B page size*/
277 movne r2, #32 /*64 bytes*/
278 moveq r2, #8 /*16 bytes*/
282 bicne r3, r3, #1 /*Enable 8bit ECC mode*/
283 movne r2, #109 /*218 bytes*/
284 moveq r2, #64 /*128 bytes*/
286 str r1, [r7, #CLKCTL_RCSR]
287 strh r2, [r12, #ECC_RSLT_SPARE_AREA_REG_OFF]
288 strh r3, [r12, #NAND_FLASH_CONFIG1_REG_OFF]
290 //unlock internal buffer
292 strh r3, [r12, #NFC_CONFIGURATION_REG_OFF]
295 strh r3, [r12, #UNLOCK_START_BLK_ADD_REG_OFF]
297 strh r3, [r12, #UNLOCK_END_BLK_ADD_REG_OFF]
299 strh r3, [r12, #NF_WR_PROT_REG_OFF]
301 /* r0: NFC base address. RAM buffer base address. [constantly]
302 * r1: starting flash address to be copied. [constantly]
303 * r2: page size. [Doesn't change]
304 * r3: used as argument.
305 * r11: starting SDRAM address for copying. [Updated constantly].
306 * r12: NFC register base address. [constantly].
307 * r13: end of SDRAM address for copying. [Doesn't change].
311 ldr r3, [r7, #CLKCTL_RCSR]
316 mov r1, #0x800 /*Strang Why is not 4K offset*/
319 1: /*Update the indicator of copy area */
320 ldr r11, MXC_REDBOOT_ROM_START
321 add r13, r11, #REDBOOT_IMAGE_SIZE
333 do_addr_input //1st addr cycle
335 do_addr_input //2nd addr cycle
337 do_addr_input //3rd addr cycle
339 do_addr_input //4th addr cycle
340 b end_of_nfc_addr_ops
344 do_addr_input //1st addr cycle
346 do_addr_input //2nd addr cycle
348 do_addr_input //3rd addr cycle
350 do_addr_input //4th addr cycle
352 do_addr_input //5th addr cycle
356 b end_of_nfc_addr_ops
360 do_addr_input //1st addr cycle
362 do_addr_input //2nd addr cycle
364 do_addr_input //3rd addr cycle
366 do_addr_input //4th addr cycle
368 do_addr_input //5th addr cycle
377 // Check if x16/2kb page
379 bhi nfc_addr_data_output_done_4k
380 beq nfc_addr_data_output_done_2k
381 beq nfc_addr_data_output_done_512
383 // check for bad block
384 // mov r3, r1, lsl #(32-17) // get rid of block number
385 // cmp r3, #(0x800 << (32-17)) // check if not page 0 or 1
386 b nfc_addr_data_output_done
388 nfc_addr_data_output_done_4k:
390 b nfc_addr_data_output_done
392 nfc_addr_data_output_done_2k:
394 // check for bad block
395 //TODO mov r3, r1, lsl #(32-17) // get rid of block number
396 // cmp r3, #(0x800 << (32-17)) // check if not page 0 or 1
397 b nfc_addr_data_output_done
399 nfc_addr_data_output_done_512:
400 // check for bad block
401 // TODO mov r3, r1, lsl #(32-5-9) // get rid of block number
402 // TODO cmp r3, #(512 << (32-5-9)) // check if not page 0 or 1
404 nfc_addr_data_output_done:
407 add r4, r0, #0x1000 //r3 -> spare area buf 0
412 // really sucks. Bad block!!!!
415 // even suckier since we already read the first page!
416 // Check if x16/2kb page
419 subhi r11, r11, #0x1000 //rewind 1 page for the sdram pointer
420 subhi r1, r1, #0x1000 //rewind 1 page for the flash pointer
422 subeq r11, r11, #0x800 //rewind 1 page for the sdram pointer
423 subeq r1, r1, #0x800 //rewind 1 page for the flash pointer
425 sublo r11, r11, #512 //rewind 1 page for the sdram pointer
426 sublo r1, r1, #512 //rewind 1 page for the flash pointer
428 // Check if x16/2kb page
429 ldr r7, CCM_BASE_ADDR_W
430 ldr r7, [r7, #CLKCTL_RCSR]
432 addne r1, r1, #(128*4096)
433 bne Skip_bad_block_done
435 addeq r1, r1, #(32*512)
436 addne r1, r1, #(64*2048)
442 add r2, r2, #NFC_BASE
443 1: ldmia r0!, {r3-r10}
447 sub r2, r2, #NFC_BASE
450 bge NAND_Copy_Main_done
451 // Check if x16/2kb page
458 Normal_Boot_Continue:
460 #ifdef CYG_HAL_STARTUP_ROMRAM /* enable running from RAM */
461 /* Copy image from flash to SDRAM first */
464 ldr r1, MXC_REDBOOT_ROM_START
466 beq HWInitialise_skip_SDRAM_copy
468 add r2, r0, #REDBOOT_IMAGE_SIZE
470 1: ldmia r0!, {r3-r10}
476 and r0, pc, r1 /* offset of pc */
477 ldr r1, =(SDRAM_BASE_ADDR + SDRAM_SIZE - 0x100000 + 0x8)
483 #endif /* CYG_HAL_STARTUP_ROMRAM */
485 HWInitialise_skip_SDRAM_copy:
490 * IOMUX/PBC setup is done in C function plf_hardware_init() for simplicity
494 // Set up a stack [for calling C code]
495 ldr r1, =__startup_stack
496 ldr r2, =RAM_BANK0_BASE
504 mrc MMU_CP, 0, r1, MMU_Control, c0 // get c1 value to r1 first
505 orr r1, r1, #7 // enable MMU bit
506 orr r1, r1, #0x800 // enable z bit
507 mcr MMU_CP, 0, r1, MMU_Control, c0
508 mov pc,r2 /* Change address spaces */
514 // Save shadow copy of BCR, also hardware configuration
518 str r9, [r1] // Saved far above...
520 .endm // _platform_setup1
524 ldrh r3, [r12, #NAND_FLASH_CONFIG2_REG_OFF]
525 ands r3, r3, #NAND_FLASH_CONFIG2_INT_DONE
527 bx lr // do_wait_op_done
530 ldrh r3, [r12, #NAND_FLASH_CONFIG1_REG_OFF]
531 orr r3, r3, #(NAND_FLASH_CONFIG1_INT_MSK | NAND_FLASH_CONFIG1_ECC_EN)
532 strh r3, [r12, #NAND_FLASH_CONFIG1_REG_OFF]
534 strh r8, [r12, #RAM_BUFFER_ADDRESS_REG_OFF]
536 mov r3, #FDO_PAGE_SPARE_VAL
537 strh r3, [r12, #NAND_FLASH_CONFIG2_REG_OFF]
540 #else // defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
541 #define PLATFORM_SETUP1
546 .endm /* init_spba */
548 /* AIPS setup - Only setup MPROTx registers. The PACR default values are good.*/
551 * Set all MPROTx to be non-bufferable, trusted for R/W,
552 * not forced to user-mode.
554 ldr r0, AIPS1_CTRL_BASE_ADDR_W
555 ldr r1, AIPS1_PARAM_W
558 ldr r0, AIPS2_CTRL_BASE_ADDR_W
563 * Clear the on and off peripheral modules Supervisor Protect bit
564 * for SDMA to access them. Did not change the AIPS control registers
565 * (offset 0x20) access type
567 ldr r0, AIPS1_CTRL_BASE_ADDR_W
574 and r1, r1, #0x00FFFFFF
577 ldr r0, AIPS2_CTRL_BASE_ADDR_W
584 and r1, r1, #0x00FFFFFF
586 .endm /* init_aips */
588 /* MAX (Multi-Layer AHB Crossbar Switch) setup */
590 ldr r0, MAX_BASE_ADDR_W
591 /* MPR - priority is M4 > M2 > M3 > M5 > M0 > M1 */
593 str r1, [r0, #0x000] /* for S0 */
594 str r1, [r0, #0x100] /* for S1 */
595 str r1, [r0, #0x200] /* for S2 */
596 str r1, [r0, #0x300] /* for S3 */
597 str r1, [r0, #0x400] /* for S4 */
598 /* SGPCR - always park on last master */
600 str r1, [r0, #0x010] /* for S0 */
601 str r1, [r0, #0x110] /* for S1 */
602 str r1, [r0, #0x210] /* for S2 */
603 str r1, [r0, #0x310] /* for S3 */
604 str r1, [r0, #0x410] /* for S4 */
605 /* MGPCR - restore default values */
607 str r1, [r0, #0x800] /* for M0 */
608 str r1, [r0, #0x900] /* for M1 */
609 str r1, [r0, #0xA00] /* for M2 */
610 str r1, [r0, #0xB00] /* for M3 */
611 str r1, [r0, #0xC00] /* for M4 */
612 str r1, [r0, #0xD00] /* for M5 */
617 ldr r0, CCM_BASE_ADDR_W
619 /* default CLKO to 1/32 of the ARM core*/
620 ldr r1, [r0, #CLKCTL_COSR]
621 bic r1, r1, #0x00000FF00
622 bic r1, r1, #0x0000000FF
626 str r1, [r0, #CLKCTL_COSR]
629 str r2, [r0, #CLKCTL_CCMR]
632 ldr r3, ROM_VER_ADDR_W
635 ldreq r2, [r0, #CLKCTL_PDR0]
638 ldrne r3, MPCTL_PARAM_532_W /* consumer path*/
639 ldreq r3, MPCTL_PARAM_399_W /* auto path*/
641 /*Set MPLL , arm clock and ahb clock*/
642 str r3, [r0, #CLKCTL_MPCTL]
644 ldr r1, PPCTL_PARAM_W
645 str r1, [r0, #CLKCTL_PPCTL]
648 ldreq r1, [r0, #CLKCTL_PDR0]
649 orreq r1, r1, #0x800000
650 streq r1, [r0, #CLKCTL_PDR0]
653 bicne r1, r1, #0x800000
654 str r1, [r0, #CLKCTL_PDR0]
656 ldr r1, [r0, #CLKCTL_CGR0]
657 orr r1, r1, #0x00300000
658 str r1, [r0, #CLKCTL_CGR0]
660 ldr r1, [r0, #CLKCTL_CGR1]
661 orr r1, r1, #0x00000C00
662 orr r1, r1, #0x00000003
663 str r1, [r0, #CLKCTL_CGR1]
665 .endm /* init_clock */
669 /* Configure M3IF registers */
672 * M3IF Control Register (M3IFCTL)
673 * MRRP[0] = L2CC0 not on priority list (0 << 0) = 0x00000000
674 * MRRP[1] = MAX1 not on priority list (0 << 0) = 0x00000000
675 * MRRP[2] = L2CC1 not on priority list (0 << 0) = 0x00000000
676 * MRRP[3] = USB not on priority list (0 << 0) = 0x00000000
677 * MRRP[4] = SDMA not on priority list (0 << 0) = 0x00000000
678 * MRRP[5] = GPU not on priority list (0 << 0) = 0x00000000
679 * MRRP[6] = IPU1 on priority list (1 << 6) = 0x00000040
680 * MRRP[7] = IPU2 not on priority list (0 << 0) = 0x00000000
685 str r0, [r1] /* M3IF control reg */
686 .endm /* init_m3if */
689 ldr r0, WEIM_CTRL_CS0_W
690 ldr r1, CS0_CSCRU_0x0000CC03
692 ldr r1, CS0_CSCRL_0xA0330D01
694 ldr r1, CS0_CSCRA_0x00220800
698 /* CPLD on CS5 setup */
700 ldr r0, WEIM_CTRL_CS5_W
701 ldr r1, CS5_CSCRU_0x0000D843
703 ldr r1, CS5_CSCRL_0x22252521
705 ldr r1, CS5_CSCRA_0x22220A00
710 ldr r0, ESDCTL_BASE_W
713 ldr r2, ROM_VER_ADDR_W
720 mov r1, #RAM_BANK0_BASE
725 blne setup_sdram_bank
728 mov r1, #RAM_BANK1_BASE
733 blne setup_sdram_bank
738 movne r3, #L2CC_BASE_ADDR
739 ldrne r4, [r3, #L2_CACHE_AUX_CTL_REG]
740 orrne r4, r4, #0x1000
741 strne r4, [r3, #L2_CACHE_AUX_CTL_REG]
743 ldr r3, ESDCTL_DELAY5
748 strh r3, [r12, #NAND_FLASH_CMD_REG_OFF]
749 mov r3, #NAND_FLASH_CONFIG2_FCMD_EN;
750 strh r3, [r12, #NAND_FLASH_CONFIG2_REG_OFF]
752 .endm // nfc_cmd_input
756 strh r3, [r12, #NAND_FLASH_ADD_REG_OFF]
757 mov r3, #NAND_FLASH_CONFIG2_FADD_EN
758 strh r3, [r12, #NAND_FLASH_CONFIG2_REG_OFF]
760 .endm // do_addr_input
762 /* To support 133MHz DDR */
765 ldr r1, IOMUXC_BASE_ADDR_W
767 add r2, r1, #0x4C8 - 0x368
771 .endm /* init_iomuxc */
774 * r0: control base, r1: ram bank base
775 * r2: ddr type(0:DDR2, 1:MDDR) r3, r4: working
778 mov r3, #0xE /*0xA + 0x4*/
780 orreq r3, r3, #0x300 /*DDR2*/
790 2: adr r4, ESDCTL_CONFIG
794 cmp r1, #RAM_BANK1_BASE
798 ldr r3, ESDCTL_0x92220000
802 ldr r4, RAM_PARAM1_MDDR
808 cmp r1, #RAM_BANK1_BASE
809 ldr r3, ESDCTL_0xB2220000
813 ldr r4, RAM_PARAM4_MDDR
815 ldr r4, RAM_PARAM5_MDDR
817 ldr r4, RAM_PARAM3_MDDR
819 ldr r4, RAM_PARAM2_MDDR
822 ldr r3, ESDCTL_0x92220000
826 ldr r4, RAM_PARAM1_MDDR
830 cmp r1, #RAM_BANK1_BASE
831 ldr r3, ESDCTL_0xA2220000
838 ldr r3, ESDCTL_0xB2220000
841 adr r4, RAM_PARAM6_MDDR
847 ldreq r4, RAM_PARAM7_MDDR
849 adr r4, RAM_PARAM3_MDDR
854 cmp r1, #RAM_BANK1_BASE
855 ldr r3, ESDCTL_0x82226080
873 #define PLATFORM_VECTORS _platform_vectors
874 .macro _platform_vectors
875 .globl _board_BCR, _board_CFG
876 _board_BCR: .long 0 // Board Control register shadow
877 _board_CFG: .long 0 // Board Configuration (read at RESET)
880 //Internal Boot, from MMC/SD cards
881 #ifdef MXCFLASH_SELECT_MMC
882 #define DCDGEN(i,type, addr, data) \
888 #define FHEADER_OFFSET 0x400
890 #define GEN_FHEADERADDR(x) ((x) + FHEADER_OFFSET)
892 #define GEN_FHEADERADDR(x) (x)
895 .macro setup_flash_header
898 #if defined(FHEADER_OFFSET)
901 app_code_jump_v: .long GEN_FHEADERADDR(reset_vector)
902 app_code_barker: .long 0xB1
903 app_code_csf: .long 0
904 hwcfg_ptr_ptr: .long GEN_FHEADERADDR(hwcfg_ptr)
905 super_root_key: .long 0
906 hwcfg_ptr: .long GEN_FHEADERADDR(dcd_data)
907 app_dest_ptr: .long SDRAM_BASE_ADDR + SDRAM_SIZE - 0x100000
908 dcd_data: .long 0xB17219E9
909 #ifdef MEMORY_MDDR_ENABLE
913 //arm clock is 266Mhz and ahb clock is 133Mhz
914 //DCDGEN(1, 4, 0x53F80004, 0x00821000)
916 //WEIM config-CS5 init
917 DCDGEN(1, 4, 0xB8002054, 0x444a4541)
918 DCDGEN(1_1, 4, 0xB8002050, 0x0000dcf6)
919 DCDGEN(1_2, 4, 0xB8002058, 0x44443302)
922 DCDGEN(2, 4, 0xB8001010, 0x00000004)
924 DCDGEN(3, 4, 0xB8001010, 0x0000000C)
925 DCDGEN(4, 4, 0xB800100C, 0x007ffc3f)
926 DCDGEN(5, 4, 0xB800100C, 0x007ffc3f)
927 DCDGEN(6, 4, 0xB8001004, 0x007ffc3f)
928 DCDGEN(7, 4, 0xB8001000, 0x92220000)
929 DCDGEN(8, 1, 0x80000400, 0xda)
930 DCDGEN(9, 4, 0xB8001000, 0xA2220000)
931 DCDGEN(10, 4, 0x80000000, 0x87654321)
932 DCDGEN(11, 4, 0x80000000, 0x87654321)
933 DCDGEN(12, 4, 0xB8001000, 0xB2220000)
934 DCDGEN(13, 1, 0x80000033, 0xda)
935 DCDGEN(14, 1, 0x82000000, 0xda)
936 DCDGEN(15, 4, 0xB8001000, 0x82226080)
937 DCDGEN(16, 4, 0xB8001010, 0x00000004)
938 DCDGEN(17, 4, 0xB8001008, 0x00002000)
940 //add MMC FLASH BOOT mode in MXCFIS_FLAG_REG
941 //DCDGEN(18, 4, 0x68000100, 0x40000000)
946 //arm clock is 266Mhz and ahb clock is 133Mhz
947 //DCDGEN(1, 4, 0x53F80004, 0x00821000)
949 //WEIM config-CS5 init
950 DCDGEN(1, 4, 0xB8002050, 0x0000d843)
951 DCDGEN(1_1, 4, 0xB8002054, 0x22252521)
952 DCDGEN(1_2, 4, 0xB8002058, 0x22220a00)
955 DCDGEN(2, 4, 0xB8001010, 0x00000304)
956 DCDGEN(3, 4, 0xB8001010, 0x0000030C)
957 DCDGEN(4, 4, 0xB8001004, 0x007ffc3f)
958 DCDGEN(5, 4, 0xB8001000, 0x92220000)
959 DCDGEN(6, 4, 0x80000400, 0x12345678)
960 DCDGEN(7, 4, 0xB8001000, 0xA2220000)
961 DCDGEN(8, 4, 0x80000000, 0x87654321)
962 DCDGEN(9, 4, 0x80000000, 0x87654321)
963 DCDGEN(10, 4, 0xB8001000, 0xB2220000)
964 DCDGEN(11, 1, 0x80000233, 0xda)
965 DCDGEN(12, 1, 0x82000780, 0xda)
966 DCDGEN(13, 1, 0x82000400, 0xda)
967 DCDGEN(14, 4, 0xB8001000, 0x82226080)
968 DCDGEN(15, 4, 0xB8001004, 0x007ffc3f)
969 DCDGEN(16, 4, 0xB800100C, 0x007ffc3f)
970 DCDGEN(17, 4, 0xB8001010, 0x00000304)
971 DCDGEN(18, 4, 0xB8001008, 0x00002000)
973 //add MMC FLASH BOOT mode in MXCFIS_FLAG_REG
974 //DCDGEN(17, 4, #MMC_FLASH_BOOT, #MXCBOOT_FLAG_REG)
975 //DCDGEN(19, 4, 0x68000100, 0x40000000)
978 //CARD_FLASH_CFG_PARMS_T---length
979 card_cfg: .long REDBOOT_IMAGE_SIZE
983 ARM_PPMRR: .word 0x40000015
984 L2CACHE_PARAM: .word 0x00030024
985 IIM_SREV_REG_VAL: .word IIM_BASE_ADDR + IIM_SREV_OFF
986 AIPS1_CTRL_BASE_ADDR_W: .word AIPS1_CTRL_BASE_ADDR
987 AIPS2_CTRL_BASE_ADDR_W: .word AIPS2_CTRL_BASE_ADDR
988 AIPS1_PARAM_W: .word 0x77777777
989 MAX_BASE_ADDR_W: .word MAX_BASE_ADDR
990 MAX_PARAM1: .word 0x00302154
991 CLKCTL_BASE_ADDR_W: .word CLKCTL_BASE_ADDR
992 ESDCTL_BASE_W: .word ESDCTL_BASE
993 M3IF_BASE_W: .word M3IF_BASE
994 RAM_PARAM1_MDDR: .word 0x00000400
995 RAM_PARAM2_MDDR: .word 0x00000333
996 RAM_PARAM3_MDDR: .word 0x02000400
998 RAM_PARAM4_MDDR: .word 0x04000000
999 RAM_PARAM5_MDDR: .word 0x06000000
1000 RAM_PARAM6_MDDR: .word 0x00000233
1002 RAM_PARAM7_MDDR: .word 0x02000780
1003 ESDCTL_0x92220000: .word 0x92220000
1004 ESDCTL_0xA2220000: .word 0xA2220000
1005 ESDCTL_0xB2220000: .word 0xB2220000
1006 ESDCTL_0x82226080: .word 0x82226080
1007 ESDCTL_CONFIG: .word 0x007FFC3F //DDR2
1008 .word 0x00295729 //MDDR
1009 ESDCTL_DELAY5: .word 0x00F49F00
1010 IOMUXC_BASE_ADDR_W: .word IOMUXC_BASE_ADDR
1011 CCM_CCMR_W: .word 0x003F4208
1012 CCM_PDR0_W: .word 0x00801000
1013 MPCTL_PARAM_399_W: .word MPCTL_PARAM_399
1014 MPCTL_PARAM_532_W: .word MPCTL_PARAM_532
1015 PPCTL_PARAM_W: .word PPCTL_PARAM_300
1016 AVIC_VECTOR0_ADDR_W: .word MXCBOOT_FLAG_REG
1017 AVIC_VECTOR1_ADDR_W: .word MXCFIS_FLAG_REG
1018 MXC_REDBOOT_ROM_START: .word SDRAM_BASE_ADDR + SDRAM_SIZE - 0x100000
1019 CONST_0x0FFF: .word 0x0FFF
1020 CCM_BASE_ADDR_W: .word CCM_BASE_ADDR
1021 IPU_CTRL_BASE_ADDR_W: .word IPU_CTRL_BASE_ADDR
1022 WEIM_CTRL_CS5_W: .word WEIM_CTRL_CS5
1023 WEIM_CTRL_CS0_W: .word WEIM_CTRL_CS0
1024 CS0_CSCRU_0x0000CC03: .word 0x0000DCF6
1025 CS0_CSCRL_0xA0330D01: .word 0x444A4541
1026 CS0_CSCRA_0x00220800: .word 0x44443302
1027 CS5_CSCRU_0x0000D843: .word 0x0000D843
1028 CS5_CSCRL_0x22252521: .word 0x22252521
1029 CS5_CSCRA_0x22220A00: .word 0x22220A00
1030 ROM_VER_ADDR_W: .word ROM_BASE_ADDR + ROM_SI_REV_OFFSET
1031 /*---------------------------------------------------------------------------*/
1032 /* end of hal_platform_setup.h */
1033 #endif /* CYGONCE_HAL_PLATFORM_SETUP_H */