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 r0, [r1, #0x94] @ USR1
159 tst r0, #(1 << 4) @ AWAKE
162 ldr r0, [r1, #0x98] @ USR2
163 tst r0, #(1 << 15) @ ADET
167 str r0, [r1, #0x40] @TXFIFO
169 mov r2, #RAM_BANK1_BASE
170 ldr r0, [r1, #0xa4] @ UBIR
172 ldr r0, [r1, #0xa8] @ UBMR
179 ldr r9, UART1_BASE_ADDR_W
181 ldr r10, [r9, #0xb4] @ UTS
182 tst r10, #(1 << 4) @ TXFULL
188 .set progress_ind, 'A'
190 uart_putc #progress_ind
191 .set progress_ind, progress_ind + 1
194 .macro early_uart_setup
203 // initialize GPIO2[7] (Pad A21) for LED on STK5
204 ldr r10, GPIO2_BASE_ADDR_W
206 mov r9, #(1 << DEBUG_LED_BIT)
207 str r9, [r10, #GPIO_GDIR]
209 ldr r10, IOMUXC_BASE_ADDR_W
213 ldr r10, GPIO2_BASE_ADDR_W
215 mov r9, #(1 << DEBUG_LED_BIT) // LED ON
216 str r9, [r10, #GPIO_DR]
219 // This macro represents the initial startup code for the platform
220 // r11 is reserved to contain chip rev info in this file
221 .macro _platform_setup1
222 KARO_TX25_SETUP_START:
223 // invalidate I/D cache/TLB
225 mcr 15, 0, r0, c7, c7, 0 /* invalidate I cache and D cache */
226 mcr 15, 0, r0, c8, c7, 0 /* invalidate TLBs */
227 mcr 15, 0, r0, c7, c10, 4 /* Data Write Barrier */
238 #ifndef INTERNAL_BOOT_MODE
239 // check if sdram has been setup
240 #ifdef RAM_BANK1_SIZE
241 cmp pc, #RAM_BANK1_BASE
243 cmp pc, #(RAM_BANK1_BASE + RAM_BANK1_SIZE)
244 blo HWInitialise_skip_SDRAM_setup
246 cmp pc, #RAM_BANK0_BASE
248 cmp pc, #(RAM_BANK0_BASE + RAM_BANK0_SIZE)
249 blo HWInitialise_skip_SDRAM_setup
250 #endif // RAM_BANK1_SIZE
251 #endif // INTERNAL_BOOT_MODE
260 #ifndef INTERNAL_BOOT_MODE
269 HWInitialise_skip_SDRAM_setup:
271 add r2, r0, #0x0800 // 2K window
273 blo Normal_Boot_Continue
275 bhi Normal_Boot_Continue
279 /* Copy image from NFC buffer to SDRAM first */
280 ldr r1, MXC_REDBOOT_RAM_START
293 mov r0, #NFC_BASE // r0: nfc base. Reloaded after each page copy
294 add r12, r0, #0x1E00 // r12: NFC register base. Doesn't change
295 ldrh r3, [r12, #NAND_FLASH_CONFIG1_REG_OFF]
299 ldr r7, CCM_BASE_ADDR_W
300 ldr r1, [r7, #CLKCTL_RCSR]
301 /* BUS WIDTH setting */
302 tst r1, #(1 << 24)// Freescale: 0x20000000
303 orrne r1, r1, #(1 << 14)
304 biceq r1, r1, #(1 << 14)
307 tst r1, #(1 << 27)// Freescale: 0x10000000
308 orrne r1, r1, #(1 << 9)
311 bic r1, r1, #(1 << 9)
312 tst r1, #(1 << 26)// Freescale: 0x08000000
313 orrne r1, r1, #(1 << 8) /* 2KB page size */
314 biceq r1, r1, #(1 << 8) /* 512B page size */
315 movne r2, #(64 >> 1) /* 64 bytes */
316 moveq r2, #8 /* 16 bytes */
319 tst r1, #(1 << 26)// Freescale: 0x08000000
320 bicne r3, r3, #1 /* Enable 8bit ECC mode */
321 movne r2, #109 /* 218 bytes */
322 moveq r2, #(128 >> 1) /* 128 bytes */
324 str r1, [r7, #CLKCTL_RCSR]
325 strh r2, [r12, #ECC_RSLT_SPARE_AREA_REG_OFF]
326 strh r3, [r12, #NAND_FLASH_CONFIG1_REG_OFF]
328 //unlock internal buffer
330 strh r3, [r12, #NFC_CONFIGURATION_REG_OFF]
333 strh r3, [r12, #UNLOCK_START_BLK_ADD_REG_OFF]
335 strh r3, [r12, #UNLOCK_END_BLK_ADD_REG_OFF]
337 strh r3, [r12, #NF_WR_PROT_REG_OFF]
339 /* r0: NFC base address. RAM buffer base address. [Updated constantly]
340 * r1: starting flash address to be copied. [Updated constantly]
341 * r2: page size. [Doesn't change]
342 * r3: used as argument.
343 * r11: starting SDRAM address for copying. [Updated constantly].
344 * r12: NFC register base address. [Updated constantly].
345 * r13: end of SDRAM address for copying. [Doesn't change].
348 ldr r3, [r7, #CLKCTL_RCSR]
357 /* Update the indicator of copy area */
358 ldr r11, MXC_REDBOOT_RAM_START
359 add r13, r11, #REDBOOT_IMAGE_SIZE
371 do_addr_input //1st addr cycle
373 do_addr_input //2nd addr cycle
375 do_addr_input //3rd addr cycle
377 do_addr_input //4th addr cycle
378 b end_of_nfc_addr_ops
382 do_addr_input //1st addr cycle
384 do_addr_input //2nd addr cycle
386 do_addr_input //3rd addr cycle
388 do_addr_input //4th addr cycle
390 do_addr_input //5th addr cycle
394 b end_of_nfc_addr_ops
398 do_addr_input //1st addr cycle
400 do_addr_input //2nd addr cycle
402 do_addr_input //3rd addr cycle
404 do_addr_input //4th addr cycle
406 do_addr_input //5th addr cycle
415 // Check if x16/2kb page
417 bhi nfc_addr_data_output_done_4k
418 beq nfc_addr_data_output_done_2k
419 beq nfc_addr_data_output_done_512
421 // check for bad block
422 // mov r3, r1, lsl #(32-17) // get rid of block number
423 // cmp r3, #(0x800 << (32-17)) // check if not page 0 or 1
424 b nfc_addr_data_output_done
426 nfc_addr_data_output_done_4k:
428 b nfc_addr_data_output_done
430 nfc_addr_data_output_done_2k:
431 // check for bad block
432 //TODO: mov r3, r1, lsl #(32-17) // get rid of block number
433 // cmp r3, #(0x800 << (32-17)) // check if not page 0 or 1
434 b nfc_addr_data_output_done
436 nfc_addr_data_output_done_512:
437 // check for bad block
438 // TODO: mov r3, r1, lsl #(32-5-9) // get rid of block number
439 // TODO: cmp r3, #(512 << (32-5-9)) // check if not page 0 or 1
441 nfc_addr_data_output_done:
444 add r4, r0, #0x1000 //r3 -> spare area buf 0
449 // really sucks. Bad block!!!!
452 // even suckier since we already read the first page!
453 // Check if x16/2kb page
456 subhi r11, r11, #0x1000 //rewind 1 page for the sdram pointer
457 subhi r1, r1, #0x1000 //rewind 1 page for the flash pointer
459 subeq r11, r11, #0x800 //rewind 1 page for the sdram pointer
460 subeq r1, r1, #0x800 //rewind 1 page for the flash pointer
462 sublo r11, r11, #512 //rewind 1 page for the sdram pointer
463 sublo r1, r1, #512 //rewind 1 page for the flash pointer
465 // Check if x16/2kb page
466 ldr r7, CCM_BASE_ADDR_W
467 ldr r7, [r7, #CLKCTL_RCSR]
469 addne r1, r1, #(128 * 4096)
470 bne Skip_bad_block_done
472 addeq r1, r1, #(32 * 512)
473 addne r1, r1, #(64 * 2048)
480 add r2, r2, #NFC_BASE
486 sub r2, r2, #NFC_BASE
489 bge NAND_Copy_Main_done
490 // Check if x16/2kb page
496 Normal_Boot_Continue:
501 // Set up a stack [for calling C code]
502 ldr sp, =__startup_stack
510 mrc MMU_CP, 0, r1, MMU_Control, c0 // get c1 value to r1 first
511 orr r1, r1, #7 // enable MMU bit
513 mcr MMU_CP, 0, r1, MMU_Control, c0
514 mov pc, r2 /* Change address spaces */
518 .endm // _platform_setup1
521 ldr r0, SDRAM_ADDR_MASK
522 ldr r1, MXC_REDBOOT_RAM_START
529 ldrh r3, [r12, #NAND_FLASH_CONFIG2_REG_OFF]
530 ands r3, r3, #NAND_FLASH_CONFIG2_INT_DONE
532 bx lr // do_wait_op_done
535 ldrh r3, [r12, #NAND_FLASH_CONFIG1_REG_OFF]
536 orr r3, r3, #(NAND_FLASH_CONFIG1_INT_MSK | NAND_FLASH_CONFIG1_ECC_EN)
537 strh r3, [r12, #NAND_FLASH_CONFIG1_REG_OFF]
539 strh r8, [r12, #RAM_BUFFER_ADDRESS_REG_OFF]
541 mov r3, #FDO_PAGE_SPARE_VAL
542 strh r3, [r12, #NAND_FLASH_CONFIG2_REG_OFF]
545 #else // defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
546 #define PLATFORM_SETUP1
551 .endm /* init_spba */
553 /* AIPS setup - Only setup MPROTx registers. The PACR default values are good.*/
556 * Set all MPROTx to be non-bufferable, trusted for R/W,
557 * not forced to user-mode.
559 ldr r0, AIPS1_CTRL_BASE_ADDR_W
560 ldr r1, AIPS1_PARAM_W
563 ldr r0, AIPS2_CTRL_BASE_ADDR_W
566 .endm /* init_aips */
568 /* MAX (Multi-Layer AHB Crossbar Switch) setup */
570 ldr r0, MAX_BASE_ADDR_W
571 /* MPR - priority for MX25 is IAHB>DAHB>USBOTG>RTIC>(SDHC2/SDMA) */
573 str r1, [r0, #0x000] /* for S0 */
574 str r1, [r0, #0x100] /* for S1 */
575 str r1, [r0, #0x200] /* for S2 */
576 str r1, [r0, #0x300] /* for S3 */
577 str r1, [r0, #0x400] /* for S4 */
578 /* SGPCR - always park on last master */
580 str r1, [r0, #0x010] /* for S0 */
581 str r1, [r0, #0x110] /* for S1 */
582 str r1, [r0, #0x210] /* for S2 */
583 str r1, [r0, #0x310] /* for S3 */
584 str r1, [r0, #0x410] /* for S4 */
585 /* MGPCR - restore default values */
587 str r1, [r0, #0x800] /* for M0 */
588 str r1, [r0, #0x900] /* for M1 */
589 str r1, [r0, #0xA00] /* for M2 */
590 str r1, [r0, #0xB00] /* for M3 */
591 str r1, [r0, #0xC00] /* for M4 */
596 ldr r0, CCM_BASE_ADDR_W
598 /* default CLKO to 1/6 of the USB PLL */
599 ldr r1, [r0, #CLKCTL_MCR]
600 bic r1, r1, #0x00F00000
601 bic r1, r1, #0x7F000000
602 mov r2, #0x45000000 /* set CLKO divider to 6 */
603 add r2, r2, #0x00600000 /* select usb_clk clock source for CLKO */
605 str r1, [r0, #CLKCTL_MCR]
607 ldr r1, CCM_CCTL_VAL_W
608 str r1, [r0, #CLKCTL_CCTL] /* configure ARM clk */
610 /* enable all the clocks */
612 str r2, [r0, #CLKCTL_CGR0]
614 str r2, [r0, #CLKCTL_CGR1]
616 str r2, [r0, #CLKCTL_CGR2]
617 .endm /* init_clock */
621 /* Configure M3IF registers */
624 * M3IF Control Register (M3IFCTL) for MX25
625 * MRRP[0] = LCDC on priority list (1 << 0) = 0x00000001
626 * MRRP[1] = MAX1 not on priority list (0 << 1) = 0x00000000
627 * MRRP[2] = MAX0 not on priority list (0 << 2) = 0x00000000
628 * MRRP[3] = USB HOST not on priority list (0 << 3) = 0x00000000
629 * MRRP[4] = SDMA not on priority list (0 << 4) = 0x00000000
630 * MRRP[5] = SD/ATA/FEC not on priority list (0 << 5) = 0x00000000
631 * MRRP[6] = SCMFBC not on priority list (0 << 6) = 0x00000000
632 * MRRP[7] = CSI not on priority list (0 << 7) = 0x00000000
637 str r0, [r1] /* M3IF control reg */
638 .endm /* init_m3if */
641 ldr r0, IOMUXC_BASE_ADDR_W
645 ldr r0, ESDCTL_BASE_W
646 mov r1, #RAM_BANK0_BASE
648 #ifdef RAM_BANK1_SIZE
649 mov r1, #RAM_BANK1_BASE
655 strh r3, [r12, #NAND_FLASH_CMD_REG_OFF]
656 mov r3, #NAND_FLASH_CONFIG2_FCMD_EN;
657 strh r3, [r12, #NAND_FLASH_CONFIG2_REG_OFF]
659 .endm // nfc_cmd_input
663 strh r3, [r12, #NAND_FLASH_ADD_REG_OFF]
664 mov r3, #NAND_FLASH_CONFIG2_FADD_EN
665 strh r3, [r12, #NAND_FLASH_CONFIG2_REG_OFF]
667 .endm // do_addr_input
669 /* To support 133MHz DDR */
672 ldr r1, IOMUXC_BASE_ADDR_W
674 add r2, r1, #0x4C8 - 0x368
679 .endm /* init_iomuxc */
681 #define ESDCTL_NORMAL (0 << 28)
682 #define ESDCTL_PCHG (1 << 28)
683 #define ESDCTL_AREF (2 << 28)
684 #define ESDCTL_LMOD (3 << 28)
685 #define ESDCTL_SLFRFSH (4 << 28)
687 #define RA_BITS 2 /* row addr bits - 11 */
688 #define CA_BITS 1 /* 0-2: col addr bits - 8 3: rsrvd */
689 #define DSIZ 1 /* 0: D[31..16] 1: D[15..D0] 2: D[31..0] 3: rsrvd */
690 #define SREFR 3 /* 0: disabled 1-5: 2^n rows/clock *: rsrvd */
691 #define PWDT 1 /* 0: disabled 1: precharge pwdn
692 2: pwdn after 64 clocks 3: pwdn after 128 clocks */
693 #define FP 1 /* 0: not full page 1: full page */
694 #define BL 1 /* 0: 4(not for LPDDR) 1: 8 */
695 #define PRCT 0 /* 0: disabled *: clks / 2 (0..63) */
696 #define ESDCTLVAL (0x80000000 | (RA_BITS << 24) | (CA_BITS << 20) | \
697 (DSIZ << 16) | (SREFR << 13) | (PWDT << 10) | (FP << 8) | \
698 (BL << 7) | (PRCT << 0))
700 #define tXP 0 /* clks - 1 (0..3) */ // N/A
701 #define tWTR 0 /* clks - 1 (0..1) */ // N/A
702 #define tRP 2 /* clks - 1 (0..3) */ // 2
703 #define tMRD 1 /* clks - 1 (0..3) */ // 1
704 #define tWR 0 /* clks - 2 (0..1) */ // 0
705 #define tRAS 5 /* clks - 1 (0..7) */ // 5
706 #define tRRD 1 /* clks - 1 (0..3) */ // 1
707 #define tCAS 2 /* 0: 3 clks[LPDDR] 1: rsrvd *: clks (2..3) */ // 3
708 #define tRCD 2 /* clks - 1 (0..7) */ // 2
709 #define tRC 7 /* 0: 20 *: clks - 1 (0..15) */ // 8
711 #define ESDCFGVAL ((tXP << 21) | (tWTR << 20) | (tRP << 18) | (tMRD << 16) | \
712 (tWR << 15) | (tRAS << 12) | (tRRD << 10) | (tCAS << 8) | \
713 (tRCD << 4) | (tRC << 0))
716 * r0: control base, r1: ram bank base
720 mov r3, #(1 << 1) /* SDRAM controller reset */
721 str r3, [r0, #ESDCTL_ESDMISC]
723 ldr r3, [r0, #ESDCTL_ESDMISC]
727 ldr r3, ESDCTL_CONFIG
728 cmp r1, #RAM_BANK1_BASE
729 movhs r2, #0xc // bank 1 ESDCFG offset
730 movlo r2, #0x4 // bank 0 ESDCFG offset
732 sub r2, r2, #4 // adjust to ESDCTL offset
734 ldr r3, ESDCTL_CMD_PRECHARGE
736 str r3, [r1, #(1 << 10)] // precharge all command
738 ldr r3, ESDCTL_CMD_AUTOREFR
741 ldrb r3, [r1] // perform auto refresh cycles
744 ldr r3, ESDCTL_CMD_MODEREG
746 strb r3, [r1, #((tCAS << 4) | (FP << 2) | 0x03)] // load mode reg via A0..A11
748 ldr r3, ESDCTL_CMD_NORMAL
753 #define PLATFORM_VECTORS _platform_vectors
754 .macro _platform_vectors
757 //Internal Boot, from MMC/SD cards or NAND flash
758 #ifdef INTERNAL_BOOT_MODE
759 #define DCDGEN(type, addr, data) \
764 #define FHEADER_OFFSET 0x400
766 #ifdef RAM_BANK1_SIZE
767 #define PHYS_ADDR(a) ((a) - RAM_BANK0_BASE - RAM_BANK0_SIZE + RAM_BANK1_BASE)
769 #define PHYS_ADDR(a) (a)
772 .macro setup_flash_header
774 #if defined(FHEADER_OFFSET)
777 app_code_jump_v: .long PHYS_ADDR(reset_vector)
778 app_code_barker: .long 0xB1
779 app_code_csf: .long 0
780 hwcfg_ptr_ptr: .long PHYS_ADDR(hwcfg_ptr)
781 super_root_key: .long 0
782 hwcfg_ptr: .long PHYS_ADDR(dcd_data)
783 #ifdef RAM_BANK1_SIZE
784 app_dest_ptr: .long RAM_BANK1_BASE + RAM_BANK1_SIZE - REDBOOT_OFFSET
786 app_dest_ptr: .long RAM_BANK0_BASE + RAM_BANK0_SIZE - REDBOOT_OFFSET
788 dcd_data: .long 0xB17219E9
791 // real dcd data table
793 DCDGEN(4, 0xB8001010, 0x00000000) // disable mDDR
794 DCDGEN(4, 0xB8001000, 0x92100000) // precharge command
795 DCDGEN(1, 0x80000400, 0x00000000) // precharge all dummy write
796 DCDGEN(4, 0xB8001000, 0xA2100000) // auto-refresh command
797 DCDGEN(4, 0x80000000, 0x00000000) // dummy write for refresh
798 DCDGEN(4, 0x80000000, 0x00000000) // dummy write for refresh
799 DCDGEN(4, 0x80000000, 0x00000000) // dummy write for refresh
800 DCDGEN(4, 0x80000000, 0x00000000) // dummy write for refresh
801 DCDGEN(4, 0x80000000, 0x00000000) // dummy write for refresh
802 DCDGEN(4, 0x80000000, 0x00000000) // dummy write for refresh
803 DCDGEN(4, 0x80000000, 0x00000000) // dummy write for refresh
804 DCDGEN(4, 0x80000000, 0x00000000) // dummy write for refresh
805 DCDGEN(4, 0xB8001000, 0xB2100000) // Load Mode Register command - cas=3 bl=8
806 DCDGEN(1, 0x80000033, 0x00) // dummy write -- address has the mode bits
808 // For DDR clock speed max = 133 MHz, HYB18M1G320BF-7.5 memory
809 // based on data sheet HYx18M1G16x_BF_rev100.pdf.
811 // ESDCTL0=0x82216880:
812 // SDE=1 ESDRAM Controller Enable: Enabled
813 // SMODE=000 SDRAM Controller Operating Mode: Normal Read/Write
814 // SP=0 Supervisor Protect: User mode accesses allowed
815 // ROW=010 Row Address Width: 13 Row Addresses
816 // COL=10 Column Address Width: 10 Column Addresses
817 // DSIZ=01 SDRAM Memory Data Width: 16-bit memory width aligned to D[15:0]
818 // SREFR=011 SDRAM Refresh Rate: 4 rows each refresh clock,
819 // 8192 rows/64 mS @ 32 kHz
820 // 7.81 uS row rate at 32 kHz
821 // PWDT=10 Power Down Timer: 64 clocks (HCLK) after completion of last access
822 // with Active Power Down (most aggressive)
823 // FP=0 Full Page: Not Full Page
824 // BL=1 Burst Length: 8
825 // PRCT=000000 Precharge Timer: Disabled
827 DCDGEN(4, 0xB8001000, ESDCTLVAL)
829 // ESDCFG0=0x00295728:
830 // tXP=01 LPDDR exit power down to next valid command delay: 2 clocks
831 // tWTR=0 LPDDR WRITE to READ Command Delay: 1 clock
832 // tRP=10 SDRAM Row Precharge Delay: 3 clocks
833 // tMRD=01 SDRAM Load Mode Register to ACTIVE Command: 2 clocks
834 // tWR=0 SDRAM WRITE to PRECHARGE Command: 2 clocks
835 // tRAS=101 SDRAM ACTIVE to PRECHARGE Command: 6 clocks
836 // tRRD=01 ACTIVE Bank A to ACTIVE Bank B Command: 2 clocks
837 // tCAS=11 SDRAM CAS Latency: 3 clocks
838 // tRCD=010 SDRAM Row to Column Delay: 3 clocks
839 // tRC=1000 SDRAM Row Cycle Delay: 9 clocks
841 DCDGEN(4, 0xB8001004, ESDCFGVAL)
844 DCDGEN(4, 0x53F80008, 0x20034000) // CLKCTL ARM=400 AHB=133
847 //CARD_FLASH_CFG_PARMS_T---length
849 .long REDBOOT_IMAGE_SIZE
853 SDRAM_ADDR_MASK: .word 0xFFFC0000
854 #ifdef RAM_BANK1_SIZE
855 MXC_REDBOOT_RAM_START: .word RAM_BANK1_BASE + RAM_BANK1_SIZE - REDBOOT_OFFSET
857 MXC_REDBOOT_RAM_START: .word RAM_BANK0_BASE + RAM_BANK0_SIZE - REDBOOT_OFFSET
859 AIPS1_CTRL_BASE_ADDR_W: .word AIPS1_CTRL_BASE_ADDR
860 AIPS2_CTRL_BASE_ADDR_W: .word AIPS2_CTRL_BASE_ADDR
861 AIPS1_PARAM_W: .word 0x77777777
862 MAX_BASE_ADDR_W: .word MAX_BASE_ADDR
863 MAX_PARAM1: .word 0x00043210
864 ESDCTL_BASE_W: .word ESDCTL_BASE_ADDR
865 M3IF_BASE_W: .word M3IF_BASE
866 ESDCTL_CMD_NORMAL: .word ESDCTLVAL | ESDCTL_NORMAL
867 ESDCTL_CMD_AUTOREFR: .word ESDCTLVAL | ESDCTL_AREF
868 ESDCTL_CMD_PRECHARGE: .word ESDCTLVAL | ESDCTL_PCHG
869 ESDCTL_CMD_MODEREG: .word ESDCTLVAL | ESDCTL_LMOD
870 ESDCTL_CONFIG: .word ESDCFGVAL
871 IOMUXC_BASE_ADDR_W: .word IOMUXC_BASE_ADDR
872 GPIO2_BASE_ADDR_W: .word GPIO2_BASE_ADDR
874 UART1_BASE_ADDR_W: .word UART1_BASE_ADDR
875 UART1_UBIR_W: .word 0x0f
876 UART1_UBMR_W: .word 0x2e
878 CCM_CGR0_W: .word 0x1FFFFFFF
879 CCM_CGR1_W: .word 0xFFFFFFFF
880 CCM_CGR2_W: .word 0x000FDFFF
881 CCM_BASE_ADDR_W: .word CCM_BASE_ADDR
882 CCM_CCTL_VAL_W: .word 0x30030000
883 /*-----------------------------------------------------------------------*/
884 /* end of hal_platform_setup.h */
885 #endif /* CYGONCE_HAL_PLATFORM_SETUP_H */