2013-01-18 16:14:24 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2009
|
|
|
|
* Stefano Babic DENX Software Engineering sbabic@denx.de.
|
|
|
|
*
|
|
|
|
* (C) Copyright 2010
|
|
|
|
* Klaus Steinhammer TTECH Control Gmbh kst@tttech.com
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2013-01-18 16:14:24 +00:00
|
|
|
*
|
2013-04-30 11:15:33 +00:00
|
|
|
* Refer doc/README.imximage for more details about how-to configure
|
2013-01-18 16:14:24 +00:00
|
|
|
* and create imximage boot image
|
|
|
|
*
|
|
|
|
* The syntax is taken as close as possible with the kwbimage
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Boot Device : one of
|
|
|
|
* spi, nand, onenand, sd
|
|
|
|
*/
|
2010-07-06 17:32:09 +00:00
|
|
|
BOOT_FROM spi
|
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/*
|
|
|
|
* Device Configuration Data (DCD)
|
|
|
|
*
|
|
|
|
* Each entry must have the format:
|
|
|
|
* Addr-type Address Value
|
|
|
|
*
|
|
|
|
* where:
|
|
|
|
* Addr-type register length (1,2 or 4 bytes)
|
|
|
|
* Address absolute address of the register
|
|
|
|
* value value to be stored in the register
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* #######################
|
|
|
|
* ### Disable WDOG ###
|
|
|
|
* #######################
|
|
|
|
*/
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 2 0x73f98000 0x30
|
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/*
|
|
|
|
* #######################
|
|
|
|
* ### SET DDR Clk ###
|
|
|
|
* #######################
|
|
|
|
*/
|
|
|
|
/* CCM: CBMCR - ddr_clk_sel: axi_b (133MHz) */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73FD4018 0x000024C0
|
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/* DOUBLE SPI CLK (13MHz->26 MHz Clock) */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73FD4038 0x2010241
|
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/* IOMUXC_SW_PAD_CTL_PAD_CSPI1_MOSI HYS_ENABLE | DRV_MAX | SRE_FAST */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa8600 0x00000107
|
2013-01-18 16:14:24 +00:00
|
|
|
/* IOMUXC_SW_PAD_CTL_PAD_CSPI1_MISO HYS_ENABLE | DRV_MAX | SRE_FAST */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa8604 0x00000107
|
2013-01-18 16:14:24 +00:00
|
|
|
/* IOMUXC_SW_PAD_CTL_PAD_CSPI1_SS0 HYS_ENABLE | PKE_ENABLE | DRV_MAX | SRE_FAST */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa8608 0x00000187
|
2013-01-18 16:14:24 +00:00
|
|
|
/* IOMUXC_SW_PAD_CTL_PAD_CSPI1_SS1 HYS_ENABLE | PKE_ENABLE | DRV_MAX | SRE_FAST */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa860c 0x00000187
|
2013-01-18 16:14:24 +00:00
|
|
|
/* IOMUXC_SW_PAD_CTL_PAD_CSPI1_SCLK HYS_ENABLE | DRV_MAX | SRE_FAST */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa8614 0x00000107
|
2013-01-18 16:14:24 +00:00
|
|
|
/* IOMUXC_SW_PAD_CTL_PAD_DI1_PIN11 HYS_ENABLE | DRV_MAX | SRE_FAST (CSPI1_SS2) */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa86a8 0x00000187
|
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/*
|
|
|
|
* #######################
|
|
|
|
* ### Settings IOMUXC ###
|
|
|
|
* #######################
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* DDR IOMUX configuration
|
|
|
|
* Control, Data, Address pads are in their default state: HIGH DS, FAST SR.
|
|
|
|
* IOMUXC_SW_PAD_CTL_PAD_DRAM_SDCLK MAX DS
|
|
|
|
*/
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa84b8 0x000000e7
|
2013-01-18 16:14:24 +00:00
|
|
|
/* PVTC MAX (at GPC, PGR reg) */
|
|
|
|
/* DATA 4 0x73FD8004 0x1fc00000 */
|
2010-07-06 17:32:09 +00:00
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/* DQM0 DS high slew rate slow */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa84d4 0x000000e4
|
2013-01-18 16:14:24 +00:00
|
|
|
/* DQM1 DS high slew rate slow */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa84d8 0x000000e4
|
2013-01-18 16:14:24 +00:00
|
|
|
/* DQM2 DS high slew rate slow */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa84dc 0x000000e4
|
2013-01-18 16:14:24 +00:00
|
|
|
/* DQM3 DS high slew rate slow */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa84e0 0x000000e4
|
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS0 DS high & SLEW slow */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa84bc 0x000000c4
|
2013-01-18 16:14:24 +00:00
|
|
|
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS1 DS high & SLEW slow */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa84c0 0x000000c4
|
2013-01-18 16:14:24 +00:00
|
|
|
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS2 DS high & SLEW slow */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa84c4 0x000000c4
|
2013-01-18 16:14:24 +00:00
|
|
|
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS3 DS high & SLEW slow */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa84c8 0x000000c4
|
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/* DRAM_DATA B0 */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa88a4 0x00000004
|
2013-01-18 16:14:24 +00:00
|
|
|
/* DRAM_DATA B1 */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa88ac 0x00000004
|
2013-01-18 16:14:24 +00:00
|
|
|
/* DRAM_DATA B2 */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa88b8 0x00000004
|
2013-01-18 16:14:24 +00:00
|
|
|
/* DRAM_DATA B3 */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa882c 0x00000004
|
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/* DRAM_DATA B0 slew rate */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa8878 0x00000000
|
2013-01-18 16:14:24 +00:00
|
|
|
/* DRAM_DATA B1 slew rate */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa8880 0x00000000
|
2013-01-18 16:14:24 +00:00
|
|
|
/* DRAM_DATA B2 slew rate */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa888c 0x00000000
|
2013-01-18 16:14:24 +00:00
|
|
|
/* DRAM_DATA B3 slew rate */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x73fa889c 0x00000000
|
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/*
|
|
|
|
* #######################
|
|
|
|
* ### Configure SDRAM ###
|
|
|
|
* #######################
|
|
|
|
*/
|
2010-07-06 17:32:09 +00:00
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/* Configure CS0 */
|
|
|
|
/* ####################### */
|
2010-07-06 17:32:09 +00:00
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/* ESDCTL0: Enable controller */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83fd9000 0x83220000
|
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/* Init DRAM on CS0 /
|
|
|
|
/* ESDSCR: Precharge command */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83fd9014 0x04008008
|
2013-01-18 16:14:24 +00:00
|
|
|
/* ESDSCR: Refresh command */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83fd9014 0x00008010
|
2013-01-18 16:14:24 +00:00
|
|
|
/* ESDSCR: Refresh command */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83fd9014 0x00008010
|
2013-01-18 16:14:24 +00:00
|
|
|
/* ESDSCR: LMR with CAS=3 and BL=3 (Burst Length = 8) */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83fd9014 0x00338018
|
2013-01-18 16:14:24 +00:00
|
|
|
/* ESDSCR: EMR with half Drive strength (= medium strength @ i.MX51) */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83fd9014 0x0020801a
|
2013-01-18 16:14:24 +00:00
|
|
|
/* ESDSCR */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83fd9014 0x00008000
|
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/* ESDSCR: EMR with full Drive strength */
|
|
|
|
/* DATA 4 0x83fd9014 0x0000801a */
|
2010-07-06 17:32:09 +00:00
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/* ESDCTL0: 14 ROW, 10 COL, 32Bit, SREF=8 */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83fd9000 0xC3220000
|
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/*
|
|
|
|
* ESDCFG0: tRFC:22clks, tXSR:28clks, tXP:2clks, tWTR:2clk, tRP:3clks, tMRD:2clks
|
|
|
|
* tRAS:8clks, tRRD:2clks, tWR:3clks, tRCD:3clks, tRC:11clks
|
|
|
|
* DATA 4 0x83fd9004 0xC33574AA
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* micron mDDR
|
|
|
|
* ESDCFG0: tRFC:11clks, tXSR:19clks, tXP:1clks, tWTR:2clk, tRP:3clks, tMRD:2clks
|
|
|
|
* tRAS:7clks, tRRD:2clks, tWR:3clks, tRCD:3clks, tRC:9clks
|
|
|
|
* DATA 4 0x83FD9004 0x101564a8
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* hynix mDDR
|
|
|
|
* ESDCFG0: tRFC:17clks, tXSR:21clks, tXP:3clks, tWTR:1clk, tRP:3clks, tMRD:2clks
|
|
|
|
* tRAS:7clks, tRRD:2clks, tWR:3clks, tRCD:3clks, tRC:9clks
|
|
|
|
*/
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83FD9004 0x704564a8
|
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/* ESDMISC: AP=10, Bank interleaving on, MIF3 en, RALAT=2 */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83fd9010 0x000a1700
|
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/* Configure CS1 */
|
|
|
|
/* ####################### */
|
2010-07-06 17:32:09 +00:00
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/* ESDCTL1: Enable controller */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83fd9008 0x83220000
|
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/* Init DRAM on CS1 */
|
|
|
|
/* ESDSCR: Precharge command */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83fd9014 0x0400800c
|
2013-01-18 16:14:24 +00:00
|
|
|
/* ESDSCR: Refresh command */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83fd9014 0x00008014
|
2013-01-18 16:14:24 +00:00
|
|
|
/* ESDSCR: Refresh command */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83fd9014 0x00008014
|
2013-01-18 16:14:24 +00:00
|
|
|
/* ESDSCR: LMR with CAS=3 and BL=3 (Burst Length = 8) */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83fd9014 0x0033801c
|
2013-01-18 16:14:24 +00:00
|
|
|
/* ESDSCR: EMR with half Drive strength (= medium strength @ i.MX51) */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83fd9014 0x0020801e
|
2013-01-18 16:14:24 +00:00
|
|
|
/* ESDSCR */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83fd9014 0x00008004
|
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/* ESDCTL1: 14 ROW, 10 COL, 32Bit, SREF=8 */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83fd9008 0xC3220000
|
2013-01-18 16:14:24 +00:00
|
|
|
/*
|
|
|
|
* ESDCFG1: tRFC:22clks, tXSR:28clks, tXP:2clks, tWTR:2clk, tRP:3clks, tMRD:2clks
|
|
|
|
* tRAS:8clks, tRRD:2clks, tWR:3clks, tRCD:3clks, tRC:11clks
|
|
|
|
* DATA 4 0x83fd900c 0xC33574AA
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* micron mDDR
|
|
|
|
* ESDCFG1: tRFC:11clks, tXSR:19clks, tXP:1clks, tWTR:2clk, tRP:3clks, tMRD:2clks
|
|
|
|
* tRAS:7clks, tRRD:2clks, tWR:3clks, tRCD:3clks, tRC:9clks
|
|
|
|
* DATA 4 0x83FD900C 0x101564a8
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* hynix mDDR
|
|
|
|
* ESDCFG0: tRFC:17clks, tXSR:21clks, tXP:3clks, tWTR:1clk, tRP:3clks, tMRD:2clks
|
|
|
|
* tRAS:7clks, tRRD:2clks, tWR:3clks, tRCD:3clks, tRC:9clks
|
|
|
|
*/
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83FD900C 0x704564a8
|
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/* ESDSCR (mDRAM configuration finished) */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83FD9014 0x00000004
|
|
|
|
|
2013-01-18 16:14:24 +00:00
|
|
|
/* ESDSCR - clear "configuration request" bit */
|
2010-07-06 17:32:09 +00:00
|
|
|
DATA 4 0x83fd9014 0x00000000
|