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
54 #define CYGHWR_HAL_ARM_HAS_MMU
56 #define INTERNAL_BOOT_MODE
58 #if defined(INTERNAL_BOOT_MODE)
59 #define PLATFORM_PREAMBLE setup_flash_header
62 #ifdef CYG_HAL_STARTUP_ROMRAM
63 #define CYGSEM_HAL_ROM_RESET_USES_JUMP
66 #define CYGHWR_HAL_ROM_VADDR 0x0
68 // This macro represents the initial startup code for the platform
69 // r11 is reserved to contain chip rev info in this file
70 .macro _platform_setup1
71 FSL_BOARD_SETUP_START:
72 // invalidate I/D cache/TLB and drain write buffer
74 mcr 15, 0, r0, c7, c7, 0 /* invalidate I cache and D cache */
75 mcr 15, 0, r0, c8, c7, 0 /* invalidate TLBs */
76 mcr 15, 0, r0, c7, c10, 4 /* Drain the write buffer */
78 #if defined(INTERNAL_BOOT_MODE)
79 // On internal boot mode, check MEM CTRL bits for boot source
80 mov r0, #NAND_FLASH_BOOT
81 ldr r1, CCM_BASE_ADDR_W
82 ldr r1, [r1, #CLKCTL_RCSR]
84 movne r0, #MMC_FLASH_BOOT
85 ldr r1, MXCBOOT_FLAG_ADDR_W
88 mov r0, #SDRAM_NON_FLASH_BOOT
89 ldr r1, MXCBOOT_FLAG_ADDR_W
90 str r0, [r1] // for checking boot source from nand, nor or sdram
93 .globl init_spba_start, init_aips_start, init_max_start, init_m3if_start
103 #ifndef INTERNAL_BOOT_MODE
104 // check if sdram has been setup
105 cmp pc, #SDRAM_BASE_ADDR
107 cmp pc, #(SDRAM_BASE_ADDR + SDRAM_SIZE)
108 blo HWInitialise_skip_SDRAM_setup
110 // Now we must boot from Flash
111 mov r0, #NOR_FLASH_BOOT
112 ldr r1, MXCBOOT_FLAG_ADDR_W
118 #ifndef INTERNAL_BOOT_MODE
122 /* Assume DDR memory */
126 HWInitialise_skip_SDRAM_setup:
128 add r2, r0, #0x1000 // 4K window
130 blo Normal_Boot_Continue
132 bhi Normal_Boot_Continue
134 /* Copy image from flash to SDRAM first */
135 ldr r1, MXC_REDBOOT_ROM_START
137 1: ldmia r0!, {r3-r10}
144 and r0, pc, r1 /* offset of pc */
145 ldr r1, MXC_REDBOOT_ROM_START
153 mov r0, #NAND_FLASH_BOOT
154 ldr r1, MXCBOOT_FLAG_ADDR_W
157 ldr r1, MXCFIS_FLAG_ADDR_W
160 mov r0, #NFC_BASE; //r0: nfc base. Reloaded after each page copying
161 add r12, r0, #0x1E00 //r12: NFC register base. Doesn't change
162 ldrh r3, [r12, #NAND_FLASH_CONFIG1_REG_OFF]
166 ldr r7, CCM_BASE_ADDR_W
167 ldr r1, [r7, #CLKCTL_RCSR]
168 /*BUS WIDTH setting*/
170 orrne r1, r1, #0x4000
171 biceq r1, r1, #0x4000
180 orrne r1, r1, #0x100 /*2KB page size*/
181 biceq r1, r1, #0x100 /*512B page size*/
182 movne r2, #32 /*64 bytes*/
183 moveq r2, #8 /*16 bytes*/
187 bicne r3, r3, #1 /*Enable 8bit ECC mode*/
188 movne r2, #109 /*218 bytes*/
189 moveq r2, #64 /*128 bytes*/
191 str r1, [r7, #CLKCTL_RCSR]
192 strh r2, [r12, #ECC_RSLT_SPARE_AREA_REG_OFF]
193 strh r3, [r12, #NAND_FLASH_CONFIG1_REG_OFF]
195 //unlock internal buffer
197 strh r3, [r12, #NFC_CONFIGURATION_REG_OFF]
200 strh r3, [r12, #UNLOCK_START_BLK_ADD_REG_OFF]
202 strh r3, [r12, #UNLOCK_END_BLK_ADD_REG_OFF]
204 strh r3, [r12, #NF_WR_PROT_REG_OFF]
206 /* r0: NFC base address. RAM buffer base address. [constantly]
207 * r1: starting flash address to be copied. [constantly]
208 * r2: page size. [Doesn't change]
209 * r3: used as argument.
210 * r11: starting SDRAM address for copying. [Updated constantly].
211 * r12: NFC register base address. [constantly].
212 * r13: end of SDRAM address for copying. [Doesn't change].
216 ldr r3, [r7, #CLKCTL_RCSR]
221 mov r1, #0x800 /*Strang Why is not 4K offset*/
224 1: /*Update the indicator of copy area */
225 ldr r11, MXC_REDBOOT_ROM_START
226 add r13, r11, #REDBOOT_IMAGE_SIZE
238 do_addr_input //1st addr cycle
240 do_addr_input //2nd addr cycle
242 do_addr_input //3rd addr cycle
244 do_addr_input //4th addr cycle
245 b end_of_nfc_addr_ops
249 do_addr_input //1st addr cycle
251 do_addr_input //2nd addr cycle
253 do_addr_input //3rd addr cycle
255 do_addr_input //4th addr cycle
257 do_addr_input //5th addr cycle
261 b end_of_nfc_addr_ops
265 do_addr_input //1st addr cycle
267 do_addr_input //2nd addr cycle
269 do_addr_input //3rd addr cycle
271 do_addr_input //4th addr cycle
273 do_addr_input //5th addr cycle
282 // Check if x16/2kb page
284 bhi nfc_addr_data_output_done_4k
285 beq nfc_addr_data_output_done_2k
286 beq nfc_addr_data_output_done_512
288 // check for bad block
289 // mov r3, r1, lsl #(32-17) // get rid of block number
290 // cmp r3, #(0x800 << (32-17)) // check if not page 0 or 1
291 b nfc_addr_data_output_done
293 nfc_addr_data_output_done_4k:
295 b nfc_addr_data_output_done
297 nfc_addr_data_output_done_2k:
299 // check for bad block
300 //TODO mov r3, r1, lsl #(32-17) // get rid of block number
301 // cmp r3, #(0x800 << (32-17)) // check if not page 0 or 1
302 b nfc_addr_data_output_done
304 nfc_addr_data_output_done_512:
305 // check for bad block
306 // TODO mov r3, r1, lsl #(32-5-9) // get rid of block number
307 // TODO cmp r3, #(512 << (32-5-9)) // check if not page 0 or 1
309 nfc_addr_data_output_done:
312 add r4, r0, #0x1000 //r3 -> spare area buf 0
317 // really sucks. Bad block!!!!
320 // even suckier since we already read the first page!
321 // Check if x16/2kb page
324 subhi r11, r11, #0x1000 //rewind 1 page for the sdram pointer
325 subhi r1, r1, #0x1000 //rewind 1 page for the flash pointer
327 subeq r11, r11, #0x800 //rewind 1 page for the sdram pointer
328 subeq r1, r1, #0x800 //rewind 1 page for the flash pointer
330 sublo r11, r11, #512 //rewind 1 page for the sdram pointer
331 sublo r1, r1, #512 //rewind 1 page for the flash pointer
333 // Check if x16/2kb page
334 ldr r7, CCM_BASE_ADDR_W
335 ldr r7, [r7, #CLKCTL_RCSR]
337 addne r1, r1, #(128*4096)
338 bne Skip_bad_block_done
340 addeq r1, r1, #(32*512)
341 addne r1, r1, #(64*2048)
347 add r2, r2, #NFC_BASE
348 1: ldmia r0!, {r3-r10}
352 sub r2, r2, #NFC_BASE
355 bge NAND_Copy_Main_done
356 // Check if x16/2kb page
363 Normal_Boot_Continue:
365 #ifdef CYG_HAL_STARTUP_ROMRAM /* enable running from RAM */
366 /* Copy image from flash to SDRAM first */
369 ldr r1, MXC_REDBOOT_ROM_START
371 beq HWInitialise_skip_SDRAM_copy
373 add r2, r0, #REDBOOT_IMAGE_SIZE
375 1: ldmia r0!, {r3-r10}
382 and r0, pc, r1 /* offset of pc */
383 ldr r1, =(SDRAM_BASE_ADDR + SDRAM_SIZE - 0x100000 + 0x8)
389 #endif /* CYG_HAL_STARTUP_ROMRAM */
391 HWInitialise_skip_SDRAM_copy:
394 // Set up a stack [for calling C code]
395 ldr r1, =__startup_stack
396 ldr r2, =RAM_BANK0_BASE
404 mrc MMU_CP, 0, r1, MMU_Control, c0 // get c1 value to r1 first
405 orr r1, r1, #7 // enable MMU bit
406 mcr MMU_CP, 0, r1, MMU_Control, c0
407 mov pc,r2 /* Change address spaces */
412 // Save shadow copy of BCR, also hardware configuration
416 str r9,[r1] // Saved far above...
418 .endm // _platform_setup1
422 ldrh r3, [r12, #NAND_FLASH_CONFIG2_REG_OFF]
423 ands r3, r3, #NAND_FLASH_CONFIG2_INT_DONE
425 bx lr // do_wait_op_done
429 ldrh r3, [r12, #NAND_FLASH_CONFIG1_REG_OFF]
430 orr r3, r3, #(NAND_FLASH_CONFIG1_INT_MSK | NAND_FLASH_CONFIG1_ECC_EN)
431 strh r3, [r12, #NAND_FLASH_CONFIG1_REG_OFF]
433 strh r8, [r12, #RAM_BUFFER_ADDRESS_REG_OFF]
435 mov r3, #FDO_PAGE_SPARE_VAL
436 strh r3, [r12, #NAND_FLASH_CONFIG2_REG_OFF]
439 #else // defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
440 #define PLATFORM_SETUP1
445 .endm /* init_spba */
447 /* AIPS setup - Only setup MPROTx registers. The PACR default values are good.*/
450 * Set all MPROTx to be non-bufferable, trusted for R/W,
451 * not forced to user-mode.
453 ldr r0, AIPS1_CTRL_BASE_ADDR_W
454 ldr r1, AIPS1_PARAM_W
457 ldr r0, AIPS2_CTRL_BASE_ADDR_W
460 .endm /* init_aips */
462 /* MAX (Multi-Layer AHB Crossbar Switch) setup */
464 ldr r0, MAX_BASE_ADDR_W
465 /* MPR - priority for MX25 is IAHB>DAHB>USBOTG>RTIC>(SDHC2/SDMA) */
467 str r1, [r0, #0x000] /* for S0 */
468 str r1, [r0, #0x100] /* for S1 */
469 str r1, [r0, #0x200] /* for S2 */
470 str r1, [r0, #0x300] /* for S3 */
471 str r1, [r0, #0x400] /* for S4 */
472 /* SGPCR - always park on last master */
474 str r1, [r0, #0x010] /* for S0 */
475 str r1, [r0, #0x110] /* for S1 */
476 str r1, [r0, #0x210] /* for S2 */
477 str r1, [r0, #0x310] /* for S3 */
478 str r1, [r0, #0x410] /* for S4 */
479 /* MGPCR - restore default values */
481 str r1, [r0, #0x800] /* for M0 */
482 str r1, [r0, #0x900] /* for M1 */
483 str r1, [r0, #0xA00] /* for M2 */
484 str r1, [r0, #0xB00] /* for M3 */
485 str r1, [r0, #0xC00] /* for M4 */
490 ldr r0, CCM_BASE_ADDR_W
492 /* default CLKO to 1/32 of the ARM core */
493 ldr r1, [r0, #CLKCTL_MCR]
494 bic r1, r1, #0x00F00000
495 bic r1, r1, #0x7F000000
497 add r2, r2, #0x00200000
499 str r1, [r0, #CLKCTL_MCR]
501 /* enable all the clocks */
503 str r2, [r0, #CLKCTL_CGR0]
505 str r2, [r0, #CLKCTL_CGR1]
507 str r2, [r0, #CLKCTL_CGR2]
508 .endm /* init_clock */
512 /* Configure M3IF registers */
515 * M3IF Control Register (M3IFCTL) for MX25
516 * MRRP[0] = LCDC on priority list (1 << 0) = 0x00000001
517 * MRRP[1] = MAX1 not on priority list (0 << 1) = 0x00000000
518 * MRRP[2] = MAX0 not on priority list (0 << 2) = 0x00000000
519 * MRRP[3] = USB HOST not on priority list (0 << 3) = 0x00000000
520 * MRRP[4] = SDMA not on priority list (0 << 4) = 0x00000000
521 * MRRP[5] = SD/ATA/FEC not on priority list (0 << 5) = 0x00000000
522 * MRRP[6] = SCMFBC not on priority list (0 << 6) = 0x00000000
523 * MRRP[7] = CSI not on priority list (0 << 7) = 0x00000000
528 str r0, [r1] /* M3IF control reg */
529 .endm /* init_m3if */
531 /* CPLD on CS5 setup */
533 ldr r0, WEIM_CTRL_CS5_W
534 ldr r1, CS5_CSCRU_0x0000D843
536 ldr r1, CS5_CSCRL_0x22252521
538 ldr r1, CS5_CSCRA_0x22220A00
543 ldr r0, ESDCTL_BASE_W
549 mov r2, #0x1 /* mDDR */
550 mov r1, #RAM_BANK0_BASE
555 blne setup_sdram_bank
557 ldr r3, ESDCTL_DELAY5
562 strh r3, [r12, #NAND_FLASH_CMD_REG_OFF]
563 mov r3, #NAND_FLASH_CONFIG2_FCMD_EN;
564 strh r3, [r12, #NAND_FLASH_CONFIG2_REG_OFF]
566 .endm // nfc_cmd_input
570 strh r3, [r12, #NAND_FLASH_ADD_REG_OFF]
571 mov r3, #NAND_FLASH_CONFIG2_FADD_EN
572 strh r3, [r12, #NAND_FLASH_CONFIG2_REG_OFF]
574 .endm // do_addr_input
576 /* To support 133MHz DDR */
579 ldr r1, IOMUXC_BASE_ADDR_W
581 add r2, r1, #0x4C8 - 0x368
585 .endm /* init_iomuxc */
588 * r0: control base, r1: ram bank base
589 * r2: ddr type(0:DDR2, 1:MDDR) r3, r4: working
592 mov r3, #0xE /*0xA + 0x4*/
594 orreq r3, r3, #0x300 /*DDR2*/
604 2: adr r4, ESDCTL_CONFIG
608 cmp r1, #RAM_BANK1_BASE
612 ldr r3, ESDCTL_0x92220000
616 ldr r4, RAM_PARAM1_MDDR
622 cmp r1, #RAM_BANK1_BASE
623 ldr r3, ESDCTL_0xB2220000
627 ldr r4, RAM_PARAM4_MDDR
629 ldr r4, RAM_PARAM5_MDDR
631 ldr r4, RAM_PARAM3_MDDR
633 ldr r4, RAM_PARAM2_MDDR
636 ldr r3, ESDCTL_0x92220000
640 ldr r4, RAM_PARAM1_MDDR
644 cmp r1, #RAM_BANK1_BASE
645 ldr r3, ESDCTL_0xA2220000
652 ldr r3, ESDCTL_0xB2220000
655 adr r4, RAM_PARAM6_MDDR
661 ldreq r4, RAM_PARAM7_MDDR
663 adr r4, RAM_PARAM3_MDDR
668 cmp r1, #RAM_BANK1_BASE
669 ldr r3, ESDCTL_0x82226080
687 #define PLATFORM_VECTORS _platform_vectors
688 .macro _platform_vectors
689 .globl _board_BCR, _board_CFG
690 _board_BCR: .long 0 // Board Control register shadow
691 _board_CFG: .long 0 // Board Configuration (read at RESET)
694 //Internal Boot, from MMC/SD cards or NAND flash
695 #ifdef INTERNAL_BOOT_MODE
696 #define DCDGEN(i,type, addr, data) \
702 #define FHEADER_OFFSET 0x400
704 .macro setup_flash_header
706 #if defined(FHEADER_OFFSET)
709 app_code_jump_v: .long reset_vector
710 app_code_barker: .long 0xB1
711 app_code_csf: .long 0
712 hwcfg_ptr_ptr: .long hwcfg_ptr
713 super_root_key: .long 0
714 hwcfg_ptr: .long dcd_data
715 app_dest_ptr: .long SDRAM_BASE_ADDR + SDRAM_SIZE - 0x100000
716 dcd_data: .long 0xB17219E9
717 #ifdef MEMORY_MDDR_ENABLE
723 // real dcd data table
725 // WEIM config-CS5 init -- CPLD
726 DCDGEN( 1, 4, 0xB8002050, 0x0000D843) // CS5_CSCRU
727 DCDGEN( 2, 4, 0xB8002054, 0x22252521) // CS5_CSCRL
728 DCDGEN( 3, 4, 0xB8002058, 0x22220A00) // CS5_CSCRA
730 #ifdef MEMORY_MDDR_ENABLE
732 DCDGEN( 4, 4, 0xB8001010, 0x00000004) // enable mDDR
733 DCDGEN( 5, 4, 0xB8001000, 0x92100000) // precharge command
734 DCDGEN( 6, 1, 0x80000400, 0x12344321) // precharge all dummy write
735 DCDGEN( 7, 4, 0xB8001000, 0xA2100000) // auto-refresh command
736 DCDGEN( 8, 4, 0x80000000, 0x12344321) // dummy write for refresh
737 DCDGEN( 9, 4, 0x80000000, 0x12344321) // dummy write for refresh
738 DCDGEN(10, 4, 0xB8001000, 0xB2100000) // Load Mode Register command - cas=3 bl=8
739 DCDGEN(11, 1, 0x80000033, 0xda) // dummy write -- address has the mode bits
740 DCDGEN(12, 1, 0x81000000, 0xff) // dummy write -- address has the mode bits
742 // For DDR clock speed max = 133 MHz, HYB18M1G320BF-7.5 memory
743 // based on data sheet HYx18M1G16x_BF_rev100.pdf.
745 // ESDCTL0=0x82216880:
746 // SDE=1 ESDRAM Controller Enable: Enabled
747 // SMODE=000 SDRAM Controller Operating Mode: Normal Read/Write
748 // SP=0 Supervisor Protect: User mode accesses allowed
749 // ROW=010 Row Address Width: 13 Row Addresses
750 // COL=10 Column Address Width: 10 Column Addresses
751 // DSIZ=01 SDRAM Memory Data Width: 16-bit memory width aligned to D[15:0]
752 // SREFR=011 SDRAM Refresh Rate: 4 rows each refresh clock,
753 // 8192 rows/64 mS @ 32 kHz
754 // 7.81 uS row rate at 32 kHz
755 // PWDT=10 Power Down Timer: 64 clocks (HCLK) after completion of last access
756 // with Active Power Down (most aggressive)
757 // FP=0 Full Page: Not Full Page
758 // BL=1 Burst Length: 8
759 // PRCT=000000 Precharge Timer: Disabled
761 DCDGEN(13, 4, 0xB8001000, 0x82216880)
763 // ESDCFG0=0x00295729:
764 // tXP=01 LPDDR exit power down to next valid command delay: 2 clocks
765 // tWTR=0 LPDDR WRITE to READ Command Delay: 1 clock
766 // tRP=10 SDRAM Row Precharge Delay: 3 clocks
767 // tMRD=01 SDRAM Load Mode Register to ACTIVE Command: 2 clocks
768 // tWR=0 SDRAM WRITE to PRECHARGE Command: 2 clocks
769 // tRAS=101 SDRAM ACTIVE to PRECHARGE Command: 6 clocks
770 // tRRD=01 ACTIVE Bank A to ACTIVE Bank B Command: 2 clocks
771 // tCAS=11 SDRAM CAS Latency: 3 clocks
772 // tRCD=010 SDRAM Row to Column Delay: 3 clocks
773 // tRC=1001 SDRAM Row Cycle Delay: 9 clocks
775 DCDGEN(14, 4, 0xB8001004, 0x00295729)
778 DCDGEN( 4, 4, 0xB8001004, 0x0076E83A) // initial value for ESDCFG0
779 DCDGEN( 5, 4, 0xB8001010, 0x00000204) // ESD_MISC
780 DCDGEN( 6, 4, 0xB8001000, 0x92210000) // CS0 precharge command
781 DCDGEN( 7, 4, 0x80000f00, 0x12344321) // precharge all dummy write
782 DCDGEN( 8, 4, 0xB8001000, 0xB2210000) // Load Mode Register command
783 DCDGEN( 9, 1, 0x82000000, 0xda) // dummy write -- Load EMR2
784 DCDGEN(10, 1, 0x83000000, 0xda) // dummy write -- Load EMR3
785 DCDGEN(11, 1, 0x81000400, 0xda) // dummy write -- Load EMR1; enable DLL
786 DCDGEN(12, 1, 0x80000333, 0xda) // dummy write -- Load MR; reset DLL
788 DCDGEN(13, 4, 0xB8001000, 0x92210000) // CS0 precharge command
789 DCDGEN(14, 1, 0x80000400, 0x12345678) // precharge all dummy write
791 DCDGEN(15, 4, 0xB8001000, 0xA2210000) // select manual refresh mode
792 DCDGEN(16, 4, 0x80000000, 0x87654321) // manual refresh
793 DCDGEN(17, 4, 0x80000000, 0x87654321) // manual refresh twice
795 DCDGEN(18, 4, 0xB8001000, 0xB2210000) // Load Mode Register command
796 DCDGEN(19, 1, 0x80000233, 0xda) // -- Load MR; CL=3, BL=8, end DLL reset
797 DCDGEN(20, 1, 0x81000780, 0xda) // -- Load EMR1; OCD default
798 DCDGEN(21, 1, 0x81000400, 0xda) // -- Load EMR1; OCD exit
800 // ESD_ESDCTL0 SDE_SMODE_SP_ROW_00_COL_00_DSIZ_SREFR_0_PWDT_0_FP_BL_0__PRCT
801 // ESD_ESDCTL0 32'b1_000__0__010_00__10_00___10___011_0___00_0__0__0_0_000000
802 // @; normal mode row=010//col=10//dzize=10//self ref=011//PWDT =00//BL =0//prct =000000
803 DCDGEN(22, 4, 0xB8001000, 0x82216080)
805 // Init IOMUXC_SW_PAD_CTL_GRP_DDRTYPE_GRP(1-5)
806 DCDGEN(23, 4, 0x43FAC454, 0x00001000)
810 DCDGEN(99, 4, 0x53F80008, 0x20034000) // CLKCTL ARM=400 AHB=133
812 //CARD_FLASH_CFG_PARMS_T---length
813 card_cfg: .long REDBOOT_IMAGE_SIZE
817 AIPS1_CTRL_BASE_ADDR_W: .word AIPS1_CTRL_BASE_ADDR
818 AIPS2_CTRL_BASE_ADDR_W: .word AIPS2_CTRL_BASE_ADDR
819 AIPS1_PARAM_W: .word 0x77777777
820 MAX_BASE_ADDR_W: .word MAX_BASE_ADDR
821 MAX_PARAM1: .word 0x00043210
822 ESDCTL_BASE_W: .word ESDCTL_BASE_ADDR
823 M3IF_BASE_W: .word M3IF_BASE
824 RAM_PARAM1_MDDR: .word 0x00000400
825 RAM_PARAM2_MDDR: .word 0x00000333
826 RAM_PARAM3_MDDR: .word 0x02000400
828 RAM_PARAM4_MDDR: .word 0x04000000
829 RAM_PARAM5_MDDR: .word 0x06000000
830 RAM_PARAM6_MDDR: .word 0x00000233
832 RAM_PARAM7_MDDR: .word 0x02000780
833 ESDCTL_0x92220000: .word 0x92220000
834 ESDCTL_0xA2220000: .word 0xA2220000
835 ESDCTL_0xB2220000: .word 0xB2220000
836 ESDCTL_0x82226080: .word 0x82226080
837 ESDCTL_CONFIG: .word 0x007FFC3F
839 ESDCTL_DELAY5: .word 0x00F49F00
840 IOMUXC_BASE_ADDR_W: .word IOMUXC_BASE_ADDR
841 CCM_CCTL_W: .word 0x20034000 // ARM clk = 400, AHB clk = 133
842 MPCTL_PARAM_399_W: .word MPCTL_PARAM_399
843 MPCTL_PARAM_532_W: .word MPCTL_PARAM_532
844 UPCTL_PARAM_W: .word UPCTL_PARAM_300
845 CCM_CGR0_W: .word 0x1FFFFFFF
846 CCM_CGR1_W: .word 0xFFFFFFFF
847 CCM_CGR2_W: .word 0x000FDFFF
848 MXCBOOT_FLAG_ADDR_W: .word MXCBOOT_FLAG_REG
849 MXCFIS_FLAG_ADDR_W: .word MXCFIS_FLAG_REG
850 MXC_REDBOOT_ROM_START: .word SDRAM_BASE_ADDR + SDRAM_SIZE - 0x100000
851 CONST_0x0FFF: .word 0x0FFF
852 CCM_BASE_ADDR_W: .word CCM_BASE_ADDR
853 WEIM_CTRL_CS5_W: .word WEIM_CTRL_CS5
854 WEIM_CTRL_CS0_W: .word WEIM_CTRL_CS0
855 CS0_CSCRU_0x0000CC03: .word 0x0000DCF6
856 CS0_CSCRL_0xA0330D01: .word 0x444A4541
857 CS0_CSCRA_0x00220800: .word 0x44443302
858 CS5_CSCRU_0x0000D843: .word 0x0000D843
859 CS5_CSCRL_0x22252521: .word 0x22252521
860 CS5_CSCRA_0x22220A00: .word 0x22220A00
861 /*---------------------------------------------------------------------------*/
862 /* end of hal_platform_setup.h */
863 #endif /* CYGONCE_HAL_PLATFORM_SETUP_H */