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/karo_tx25.h> // Platform specific hardware definitions
51 #include CYGHWR_MEMORY_LAYOUT_H
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
57 //#define INTERNAL_BOOT_MODE
59 #if defined(INTERNAL_BOOT_MODE)
60 #define PLATFORM_PREAMBLE setup_flash_header
63 #ifdef CYG_HAL_STARTUP_ROMRAM
64 #define CYGSEM_HAL_ROM_RESET_USES_JUMP
67 #define TX25_NAND_PAGE_SIZE 2048
68 #define TX25_NAND_BLKS_PER_PAGE 64
70 #define DEBUG_LED_BIT 7
72 #ifndef CYGOPT_HAL_ARM_TX25_DEBUG
81 #define CYGHWR_LED_MACRO LED_BLINK #\x
97 // switch user LED (GPIO2[7] PAD A21) on STK5
98 ldr r10, GPIO2_BASE_ADDR_W
102 movne r9, #(1 << DEBUG_LED_BIT) // LED ON
103 moveq r9, #0 // LED OFF
104 str r9, [r10, #GPIO_DR]
123 .macro early_uart_setup
124 ldr r1, IOMUXC_BASE_ADDR_W
137 ldr r1, UART1_BASE_ADDR_W
138 mov r0, #(1 << 0) @ UART_EN
139 // orr r0, r0, #(1 << 14) @ ADEN
140 str r0, [r1, #0x80] @ UCR1
142 mov r0, #(1 << 14) @ IRTS
143 orr r0, r0, #((1 << 5) | (1 << 2) | (1 << 1)) @ word size 8bit, TXEN, RXEN
144 str r0, [r1, #0x84] @ UCR2
146 ldr r0, [r1, #0x88] @ UCR3
147 orr r0, r0, #(1 << 2) @ RXDMUXSEL
148 str r0, [r1, #0x88] @ UCR3
151 str r0, [r1, #0xa4] @ UBIR
154 str r0, [r1, #0xa8] @ UBMR
158 ldr r9, UART1_BASE_ADDR_W
160 ldr r10, [r9, #0xb4] @ UTS
161 tst r10, #(1 << 4) @ TXFULL
167 .set progress_ind, 'A'
169 uart_putc #progress_ind
170 .set progress_ind, progress_ind + 1
173 .macro early_uart_setup
182 // initialize GPIO2[7] (Pad A21) for LED on STK5
183 ldr r10, GPIO2_BASE_ADDR_W
185 mov r9, #(1 << DEBUG_LED_BIT)
186 str r9, [r10, #GPIO_GDIR]
188 ldr r10, IOMUXC_BASE_ADDR_W
192 ldr r10, GPIO2_BASE_ADDR_W
194 mov r9, #(1 << DEBUG_LED_BIT) // LED ON
195 str r9, [r10, #GPIO_DR]
198 // This macro represents the initial startup code for the platform
199 // r11 is reserved to contain chip rev info in this file
200 .macro _platform_setup1
201 KARO_TX25_SETUP_START:
202 // invalidate I/D cache/TLB
204 mcr 15, 0, r0, c7, c7, 0 /* invalidate I cache and D cache */
205 mcr 15, 0, r0, c8, c7, 0 /* invalidate TLBs */
206 mcr 15, 0, r0, c7, c10, 4 /* Data Write Barrier */
217 #ifndef INTERNAL_BOOT_MODE
218 // check if sdram has been setup
219 #ifdef RAM_BANK1_SIZE
220 cmp pc, #RAM_BANK1_BASE
222 cmp pc, #(RAM_BANK1_BASE + RAM_BANK1_SIZE)
223 blo HWInitialise_skip_SDRAM_setup
225 cmp pc, #RAM_BANK0_BASE
227 cmp pc, #(RAM_BANK0_BASE + RAM_BANK0_SIZE)
228 blo HWInitialise_skip_SDRAM_setup
229 #endif // RAM_BANK1_SIZE
230 #endif // INTERNAL_BOOT_MODE
239 #ifndef INTERNAL_BOOT_MODE
248 HWInitialise_skip_SDRAM_setup:
250 add r2, r0, #0x0800 // 2K window
252 blo Normal_Boot_Continue
254 bhi Normal_Boot_Continue
258 /* Copy image from NFC buffer to SDRAM first */
259 ldr r1, MXC_REDBOOT_RAM_START
272 mov r0, #NFC_BASE // r0: nfc base. Reloaded after each page copy
273 add r12, r0, #0x1E00 // r12: NFC register base. Doesn't change
274 ldrh r3, [r12, #NAND_FLASH_CONFIG1_REG_OFF]
278 ldr r7, CCM_BASE_ADDR_W
279 ldr r1, [r7, #CLKCTL_RCSR]
280 /* BUS WIDTH setting */
282 orrne r1, r1, #(1 << 14)
283 biceq r1, r1, #(1 << 14)
287 orrne r1, r1, #(1 << 9)
290 bic r1, r1, #(1 << 9)
292 orrne r1, r1, #(1 << 8) /* 2KB page size */
293 biceq r1, r1, #(1 << 8) /* 512B page size */
294 movne r2, #(64 >> 1) /* 64 bytes */
295 moveq r2, #8 /* 16 bytes */
299 bicne r3, r3, #1 /* Enable 8bit ECC mode */
300 movne r2, #109 /* 218 bytes */
301 moveq r2, #(128 >> 1) /* 128 bytes */
303 str r1, [r7, #CLKCTL_RCSR]
304 strh r2, [r12, #ECC_RSLT_SPARE_AREA_REG_OFF]
305 strh r3, [r12, #NAND_FLASH_CONFIG1_REG_OFF]
307 //unlock internal buffer
309 strh r3, [r12, #NFC_CONFIGURATION_REG_OFF]
312 strh r3, [r12, #UNLOCK_START_BLK_ADD_REG_OFF]
314 strh r3, [r12, #UNLOCK_END_BLK_ADD_REG_OFF]
316 strh r3, [r12, #NF_WR_PROT_REG_OFF]
318 /* r0: NFC base address. RAM buffer base address. [Updated constantly]
319 * r1: starting flash address to be copied. [Updated constantly]
320 * r2: page size. [Doesn't change]
321 * r3: used as argument.
322 * r11: starting SDRAM address for copying. [Updated constantly].
323 * r12: NFC register base address. [Updated constantly].
324 * r13: end of SDRAM address for copying. [Doesn't change].
327 ldr r3, [r7, #CLKCTL_RCSR]
336 /* Update the indicator of copy area */
337 ldr r11, MXC_REDBOOT_RAM_START
338 add r13, r11, #REDBOOT_IMAGE_SIZE
350 do_addr_input //1st addr cycle
352 do_addr_input //2nd addr cycle
354 do_addr_input //3rd addr cycle
356 do_addr_input //4th addr cycle
357 b end_of_nfc_addr_ops
361 do_addr_input //1st addr cycle
363 do_addr_input //2nd addr cycle
365 do_addr_input //3rd addr cycle
367 do_addr_input //4th addr cycle
369 do_addr_input //5th addr cycle
373 b end_of_nfc_addr_ops
377 do_addr_input //1st addr cycle
379 do_addr_input //2nd addr cycle
381 do_addr_input //3rd addr cycle
383 do_addr_input //4th addr cycle
385 do_addr_input //5th addr cycle
394 // Check if x16/2kb page
396 bhi nfc_addr_data_output_done_4k
397 beq nfc_addr_data_output_done_2k
398 beq nfc_addr_data_output_done_512
400 // check for bad block
401 // mov r3, r1, lsl #(32-17) // get rid of block number
402 // cmp r3, #(0x800 << (32-17)) // check if not page 0 or 1
403 b nfc_addr_data_output_done
405 nfc_addr_data_output_done_4k:
407 b nfc_addr_data_output_done
409 nfc_addr_data_output_done_2k:
410 // check for bad block
411 //TODO: mov r3, r1, lsl #(32-17) // get rid of block number
412 // cmp r3, #(0x800 << (32-17)) // check if not page 0 or 1
413 b nfc_addr_data_output_done
415 nfc_addr_data_output_done_512:
416 // check for bad block
417 // TODO: mov r3, r1, lsl #(32-5-9) // get rid of block number
418 // TODO: cmp r3, #(512 << (32-5-9)) // check if not page 0 or 1
420 nfc_addr_data_output_done:
423 add r4, r0, #0x1000 //r3 -> spare area buf 0
428 // really sucks. Bad block!!!!
431 // even suckier since we already read the first page!
432 // Check if x16/2kb page
435 subhi r11, r11, #0x1000 //rewind 1 page for the sdram pointer
436 subhi r1, r1, #0x1000 //rewind 1 page for the flash pointer
438 subeq r11, r11, #0x800 //rewind 1 page for the sdram pointer
439 subeq r1, r1, #0x800 //rewind 1 page for the flash pointer
441 sublo r11, r11, #512 //rewind 1 page for the sdram pointer
442 sublo r1, r1, #512 //rewind 1 page for the flash pointer
444 // Check if x16/2kb page
445 ldr r7, CCM_BASE_ADDR_W
446 ldr r7, [r7, #CLKCTL_RCSR]
448 addne r1, r1, #(128 * 4096)
449 bne Skip_bad_block_done
451 addeq r1, r1, #(32 * 512)
452 addne r1, r1, #(64 * 2048)
459 add r2, r2, #NFC_BASE
465 sub r2, r2, #NFC_BASE
468 bge NAND_Copy_Main_done
469 // Check if x16/2kb page
475 Normal_Boot_Continue:
480 // Set up a stack [for calling C code]
481 ldr sp, =__startup_stack
489 mrc MMU_CP, 0, r1, MMU_Control, c0 // get c1 value to r1 first
490 orr r1, r1, #7 // enable MMU bit
492 mcr MMU_CP, 0, r1, MMU_Control, c0
493 mov pc, r2 /* Change address spaces */
497 .endm // _platform_setup1
500 ldr r0, SDRAM_ADDR_MASK
501 ldr r1, MXC_REDBOOT_RAM_START
508 ldrh r3, [r12, #NAND_FLASH_CONFIG2_REG_OFF]
509 ands r3, r3, #NAND_FLASH_CONFIG2_INT_DONE
511 bx lr // do_wait_op_done
514 ldrh r3, [r12, #NAND_FLASH_CONFIG1_REG_OFF]
515 orr r3, r3, #(NAND_FLASH_CONFIG1_INT_MSK | NAND_FLASH_CONFIG1_ECC_EN)
516 strh r3, [r12, #NAND_FLASH_CONFIG1_REG_OFF]
518 strh r8, [r12, #RAM_BUFFER_ADDRESS_REG_OFF]
520 mov r3, #FDO_PAGE_SPARE_VAL
521 strh r3, [r12, #NAND_FLASH_CONFIG2_REG_OFF]
524 #else // defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
525 #define PLATFORM_SETUP1
530 .endm /* init_spba */
532 /* AIPS setup - Only setup MPROTx registers. The PACR default values are good.*/
535 * Set all MPROTx to be non-bufferable, trusted for R/W,
536 * not forced to user-mode.
538 ldr r0, AIPS1_CTRL_BASE_ADDR_W
539 ldr r1, AIPS1_PARAM_W
542 ldr r0, AIPS2_CTRL_BASE_ADDR_W
545 .endm /* init_aips */
547 /* MAX (Multi-Layer AHB Crossbar Switch) setup */
549 ldr r0, MAX_BASE_ADDR_W
550 /* MPR - priority for MX25 is IAHB>DAHB>USBOTG>RTIC>(SDHC2/SDMA) */
552 str r1, [r0, #0x000] /* for S0 */
553 str r1, [r0, #0x100] /* for S1 */
554 str r1, [r0, #0x200] /* for S2 */
555 str r1, [r0, #0x300] /* for S3 */
556 str r1, [r0, #0x400] /* for S4 */
557 /* SGPCR - always park on last master */
559 str r1, [r0, #0x010] /* for S0 */
560 str r1, [r0, #0x110] /* for S1 */
561 str r1, [r0, #0x210] /* for S2 */
562 str r1, [r0, #0x310] /* for S3 */
563 str r1, [r0, #0x410] /* for S4 */
564 /* MGPCR - restore default values */
566 str r1, [r0, #0x800] /* for M0 */
567 str r1, [r0, #0x900] /* for M1 */
568 str r1, [r0, #0xA00] /* for M2 */
569 str r1, [r0, #0xB00] /* for M3 */
570 str r1, [r0, #0xC00] /* for M4 */
575 ldr r0, CCM_BASE_ADDR_W
577 /* default CLKO to 1/6 of the USB PLL */
578 ldr r1, [r0, #CLKCTL_MCR]
579 bic r1, r1, #0x00F00000
580 bic r1, r1, #0x7F000000
581 mov r2, #0x45000000 /* set CLKO divider to 6 */
582 add r2, r2, #0x00600000 /* select usb_clk clock source for CLKO */
584 str r1, [r0, #CLKCTL_MCR]
586 ldr r1, CCM_CCTL_VAL_W
587 str r1, [r0, #CLKCTL_CCTL] /* configure ARM clk */
589 /* enable all the clocks */
591 str r2, [r0, #CLKCTL_CGR0]
593 str r2, [r0, #CLKCTL_CGR1]
595 str r2, [r0, #CLKCTL_CGR2]
596 .endm /* init_clock */
600 /* Configure M3IF registers */
603 * M3IF Control Register (M3IFCTL) for MX25
604 * MRRP[0] = LCDC on priority list (1 << 0) = 0x00000001
605 * MRRP[1] = MAX1 not on priority list (0 << 1) = 0x00000000
606 * MRRP[2] = MAX0 not on priority list (0 << 2) = 0x00000000
607 * MRRP[3] = USB HOST not on priority list (0 << 3) = 0x00000000
608 * MRRP[4] = SDMA not on priority list (0 << 4) = 0x00000000
609 * MRRP[5] = SD/ATA/FEC not on priority list (0 << 5) = 0x00000000
610 * MRRP[6] = SCMFBC not on priority list (0 << 6) = 0x00000000
611 * MRRP[7] = CSI not on priority list (0 << 7) = 0x00000000
616 str r0, [r1] /* M3IF control reg */
617 .endm /* init_m3if */
620 ldr r0, IOMUXC_BASE_ADDR_W
624 ldr r0, ESDCTL_BASE_W
625 mov r1, #RAM_BANK0_BASE
627 #ifdef RAM_BANK1_SIZE
628 mov r1, #RAM_BANK1_BASE
634 strh r3, [r12, #NAND_FLASH_CMD_REG_OFF]
635 mov r3, #NAND_FLASH_CONFIG2_FCMD_EN;
636 strh r3, [r12, #NAND_FLASH_CONFIG2_REG_OFF]
638 .endm // nfc_cmd_input
642 strh r3, [r12, #NAND_FLASH_ADD_REG_OFF]
643 mov r3, #NAND_FLASH_CONFIG2_FADD_EN
644 strh r3, [r12, #NAND_FLASH_CONFIG2_REG_OFF]
646 .endm // do_addr_input
648 /* To support 133MHz DDR */
651 ldr r1, IOMUXC_BASE_ADDR_W
653 add r2, r1, #0x4C8 - 0x368
658 .endm /* init_iomuxc */
660 #define ESDCTL_NORMAL (0 << 28)
661 #define ESDCTL_PCHG (1 << 28)
662 #define ESDCTL_AREF (2 << 28)
663 #define ESDCTL_LMOD (3 << 28)
664 #define ESDCTL_SLFRFSH (4 << 28)
666 #define RA_BITS 2 /* row addr bits - 11 */
667 #define CA_BITS 1 /* 0-2: col addr bits - 8 3: rsrvd */
668 #define DSIZ 1 /* 0: D[31..16] 1: D[15..D0] 2: D[31..0] 3: rsrvd */
669 #define SREFR 3 /* 0: disabled 1-5: 2^n rows/clock *: rsrvd */
670 #define PWDT 1 /* 0: disabled 1: precharge pwdn
671 2: pwdn after 64 clocks 3: pwdn after 128 clocks */
672 #define FP 1 /* 0: not full page 1: full page */
673 #define BL 1 /* 0: 4(not for LPDDR) 1: 8 */
674 #define PRCT 0 /* 0: disabled *: clks / 2 (0..63) */
675 #define ESDCTLVAL (0x80000000 | (RA_BITS << 24) | (CA_BITS << 20) | \
676 (DSIZ << 16) | (SREFR << 13) | (PWDT << 10) | (FP << 8) | \
677 (BL << 7) | (PRCT << 0))
679 #define tXP 0 /* clks - 1 (0..3) */ // N/A
680 #define tWTR 0 /* clks - 1 (0..1) */ // N/A
681 #define tRP 2 /* clks - 1 (0..3) */ // 2
682 #define tMRD 1 /* clks - 1 (0..3) */ // 1
683 #define tWR 0 /* clks - 2 (0..1) */ // 0
684 #define tRAS 5 /* clks - 1 (0..7) */ // 5
685 #define tRRD 1 /* clks - 1 (0..3) */ // 1
686 #define tCAS 2 /* 0: 3 clks[LPDDR] 1: rsrvd *: clks (2..3) */ // 3
687 #define tRCD 2 /* clks - 1 (0..7) */ // 2
688 #define tRC 7 /* 0: 20 *: clks - 1 (0..15) */ // 8
690 #define ESDCFGVAL ((tXP << 21) | (tWTR << 20) | (tRP << 18) | (tMRD << 16) | \
691 (tWR << 15) | (tRAS << 12) | (tRRD << 10) | (tCAS << 8) | \
692 (tRCD << 4) | (tRC << 0))
695 * r0: control base, r1: ram bank base
699 mov r3, #(1 << 1) /* SDRAM controller reset */
700 str r3, [r0, #ESDCTL_ESDMISC]
702 ldr r3, [r0, #ESDCTL_ESDMISC]
706 ldr r3, ESDCTL_CONFIG
707 cmp r1, #RAM_BANK1_BASE
708 movhs r2, #0xc // bank 1 ESDCFG offset
709 movlo r2, #0x4 // bank 0 ESDCFG offset
711 sub r2, r2, #4 // adjust to ESDCTL offset
713 ldr r3, ESDCTL_CMD_PRECHARGE
715 str r3, [r1, #(1 << 10)] // precharge all command
717 ldr r3, ESDCTL_CMD_AUTOREFR
720 ldrb r3, [r1] // perform auto refresh cycles
723 ldr r3, ESDCTL_CMD_MODEREG
725 strb r3, [r1, #((tCAS << 4) | (FP << 2) | 0x03)] // load mode reg via A0..A11
727 ldr r3, ESDCTL_CMD_NORMAL
732 #define PLATFORM_VECTORS _platform_vectors
733 .macro _platform_vectors
737 .globl _KARO_STRUCT_SIZE
739 .word 0 // reserve space structure length
741 .globl _KARO_CECFG_START
744 .word 0 // reserve space for CE configuration
747 .globl _KARO_CECFG_END
751 //Internal Boot, from MMC/SD cards or NAND flash
752 #ifdef INTERNAL_BOOT_MODE
753 #define DCDGEN(type, addr, data) \
758 #define FHEADER_OFFSET 0x400
760 #ifdef RAM_BANK1_SIZE
761 #define PHYS_ADDR(a) ((a) - RAM_BANK0_BASE - RAM_BANK0_SIZE + RAM_BANK1_BASE)
763 #define PHYS_ADDR(a) (a)
766 .macro setup_flash_header
768 #if defined(FHEADER_OFFSET)
771 app_code_jump_v: .long PHYS_ADDR(reset_vector)
772 app_code_barker: .long 0xB1
773 app_code_csf: .long 0
774 hwcfg_ptr_ptr: .long PHYS_ADDR(hwcfg_ptr)
775 super_root_key: .long 0
776 hwcfg_ptr: .long PHYS_ADDR(dcd_data)
777 #ifdef RAM_BANK1_SIZE
778 app_dest_ptr: .long RAM_BANK1_BASE + RAM_BANK1_SIZE - REDBOOT_OFFSET
780 app_dest_ptr: .long RAM_BANK0_BASE + RAM_BANK0_SIZE - REDBOOT_OFFSET
782 dcd_data: .long 0xB17219E9
785 // real dcd data table
787 DCDGEN(4, 0xB8001010, 0x00000000) // disable mDDR
788 DCDGEN(4, 0xB8001000, 0x92100000) // precharge command
789 DCDGEN(1, 0x80000400, 0x00000000) // precharge all dummy write
790 DCDGEN(4, 0xB8001000, 0xA2100000) // auto-refresh command
791 DCDGEN(4, 0x80000000, 0x00000000) // dummy write for refresh
792 DCDGEN(4, 0x80000000, 0x00000000) // dummy write for refresh
793 DCDGEN(4, 0x80000000, 0x00000000) // dummy write for refresh
794 DCDGEN(4, 0x80000000, 0x00000000) // dummy write for refresh
795 DCDGEN(4, 0x80000000, 0x00000000) // dummy write for refresh
796 DCDGEN(4, 0x80000000, 0x00000000) // dummy write for refresh
797 DCDGEN(4, 0x80000000, 0x00000000) // dummy write for refresh
798 DCDGEN(4, 0x80000000, 0x00000000) // dummy write for refresh
799 DCDGEN(4, 0xB8001000, 0xB2100000) // Load Mode Register command - cas=3 bl=8
800 DCDGEN(1, 0x80000033, 0x00) // dummy write -- address has the mode bits
802 // For DDR clock speed max = 133 MHz, HYB18M1G320BF-7.5 memory
803 // based on data sheet HYx18M1G16x_BF_rev100.pdf.
805 // ESDCTL0=0x82216880:
806 // SDE=1 ESDRAM Controller Enable: Enabled
807 // SMODE=000 SDRAM Controller Operating Mode: Normal Read/Write
808 // SP=0 Supervisor Protect: User mode accesses allowed
809 // ROW=010 Row Address Width: 13 Row Addresses
810 // COL=10 Column Address Width: 10 Column Addresses
811 // DSIZ=01 SDRAM Memory Data Width: 16-bit memory width aligned to D[15:0]
812 // SREFR=011 SDRAM Refresh Rate: 4 rows each refresh clock,
813 // 8192 rows/64 mS @ 32 kHz
814 // 7.81 uS row rate at 32 kHz
815 // PWDT=10 Power Down Timer: 64 clocks (HCLK) after completion of last access
816 // with Active Power Down (most aggressive)
817 // FP=0 Full Page: Not Full Page
818 // BL=1 Burst Length: 8
819 // PRCT=000000 Precharge Timer: Disabled
821 DCDGEN(4, 0xB8001000, ESDCTLVAL)
823 // ESDCFG0=0x00295728:
824 // tXP=01 LPDDR exit power down to next valid command delay: 2 clocks
825 // tWTR=0 LPDDR WRITE to READ Command Delay: 1 clock
826 // tRP=10 SDRAM Row Precharge Delay: 3 clocks
827 // tMRD=01 SDRAM Load Mode Register to ACTIVE Command: 2 clocks
828 // tWR=0 SDRAM WRITE to PRECHARGE Command: 2 clocks
829 // tRAS=101 SDRAM ACTIVE to PRECHARGE Command: 6 clocks
830 // tRRD=01 ACTIVE Bank A to ACTIVE Bank B Command: 2 clocks
831 // tCAS=11 SDRAM CAS Latency: 3 clocks
832 // tRCD=010 SDRAM Row to Column Delay: 3 clocks
833 // tRC=1000 SDRAM Row Cycle Delay: 9 clocks
835 DCDGEN(4, 0xB8001004, ESDCFGVAL)
838 DCDGEN(4, 0x53F80008, 0x20034000) // CLKCTL ARM=400 AHB=133
841 //CARD_FLASH_CFG_PARMS_T---length
843 .long REDBOOT_IMAGE_SIZE
847 SDRAM_ADDR_MASK: .word 0xFFFC0000
848 #ifdef RAM_BANK1_SIZE
849 MXC_REDBOOT_RAM_START: .word RAM_BANK1_BASE + RAM_BANK1_SIZE - REDBOOT_OFFSET
851 MXC_REDBOOT_RAM_START: .word RAM_BANK0_BASE + RAM_BANK0_SIZE - REDBOOT_OFFSET
853 AIPS1_CTRL_BASE_ADDR_W: .word AIPS1_CTRL_BASE_ADDR
854 AIPS2_CTRL_BASE_ADDR_W: .word AIPS2_CTRL_BASE_ADDR
855 AIPS1_PARAM_W: .word 0x77777777
856 MAX_BASE_ADDR_W: .word MAX_BASE_ADDR
857 MAX_PARAM1: .word 0x00043210
858 ESDCTL_BASE_W: .word ESDCTL_BASE_ADDR
859 M3IF_BASE_W: .word M3IF_BASE
860 ESDCTL_CMD_NORMAL: .word ESDCTLVAL | ESDCTL_NORMAL
861 ESDCTL_CMD_AUTOREFR: .word ESDCTLVAL | ESDCTL_AREF
862 ESDCTL_CMD_PRECHARGE: .word ESDCTLVAL | ESDCTL_PCHG
863 ESDCTL_CMD_MODEREG: .word ESDCTLVAL | ESDCTL_LMOD
864 ESDCTL_CONFIG: .word ESDCFGVAL
865 IOMUXC_BASE_ADDR_W: .word IOMUXC_BASE_ADDR
866 GPIO2_BASE_ADDR_W: .word GPIO2_BASE_ADDR
868 UART1_BASE_ADDR_W: .word UART1_BASE_ADDR
869 UART1_UBIR_W: .word 0x0f
870 UART1_UBMR_W: .word 0x2e
872 CCM_CGR0_W: .word 0x1FFFFFFF
873 CCM_CGR1_W: .word 0xFFFFFFFF
874 CCM_CGR2_W: .word 0x000FDFFF
875 CCM_BASE_ADDR_W: .word CCM_BASE_ADDR
876 CCM_CCTL_VAL_W: .word 0x20034000
877 /*-----------------------------------------------------------------------*/
878 /* end of hal_platform_setup.h */
879 #endif /* CYGONCE_HAL_PLATFORM_SETUP_H */