Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 Logic PD, Inc. |
| 3 | * Adam Ford <aford173@gmail.com> |
| 4 | * |
| 5 | * SPDX-License-Identifier: GPL-2.0+ |
| 6 | * |
| 7 | * Refer doc/README.imximage for more details about how-to configure |
| 8 | * and create imximage boot image |
| 9 | * |
| 10 | * The syntax is taken as close as possible with the kwbimage |
| 11 | */ |
| 12 | |
Stefano Babic | 33731bc | 2017-06-29 10:16:06 +0200 | [diff] [blame] | 13 | #include <asm/mach-imx/imximage.cfg> |
Adam Ford | a2965c9 | 2017-04-07 10:25:34 -0500 | [diff] [blame] | 14 | |
| 15 | /* image version */ |
| 16 | IMAGE_VERSION 2 |
| 17 | |
| 18 | BOOT_OFFSET FLASH_OFFSET_STANDARD |
| 19 | |
| 20 | /* |
| 21 | * Device Configuration Data (DCD) |
| 22 | * |
| 23 | * Each entry must have the format: |
| 24 | * Addr-type Address Value |
| 25 | * |
| 26 | * where: |
| 27 | * Addr-type register length (1,2 or 4 bytes) |
| 28 | * Address absolute address of the register |
| 29 | * value value to be stored in the register |
| 30 | */ |
| 31 | |
| 32 | #define __ASSEMBLY__ |
| 33 | #include <config.h> |
| 34 | #include "asm/arch-mx6/mx6-ddr.h" |
| 35 | #include "asm/arch-mx6/iomux.h" |
| 36 | #include "asm/arch-mx6/crm_regs.h" |
| 37 | |
| 38 | DATA 4, MX6_IOM_GRP_DDR_TYPE, 0x000C0000 |
| 39 | DATA 4, MX6_IOM_GRP_DDRPKE, 0x00000000 |
| 40 | DATA 4, MX6_IOM_DRAM_SDCLK_0, 0x00000030 |
| 41 | DATA 4, MX6_IOM_DRAM_SDCLK_1, 0x00000030 |
| 42 | DATA 4, MX6_IOM_DRAM_CAS, 0x00000030 |
| 43 | DATA 4, MX6_IOM_DRAM_RAS, 0x00000030 |
| 44 | DATA 4, MX6_IOM_GRP_ADDDS, 0x00000030 |
| 45 | DATA 4, MX6_IOM_DRAM_RESET, 0x00000030 |
| 46 | DATA 4, MX6_IOM_DRAM_SDBA2, 0x00000000 |
| 47 | DATA 4, MX6_IOM_DRAM_SDODT0, 0x00000030 |
| 48 | DATA 4, MX6_IOM_DRAM_SDODT1, 0x00000030 |
| 49 | DATA 4, MX6_IOM_GRP_CTLDS, 0x00000030 |
| 50 | DATA 4, MX6_IOM_DDRMODE_CTL, 0x00020000 |
| 51 | DATA 4, MX6_IOM_DRAM_SDQS0, 0x00000030 |
| 52 | DATA 4, MX6_IOM_DRAM_SDQS1, 0x00000030 |
| 53 | DATA 4, MX6_IOM_DRAM_SDQS2, 0x00000030 |
| 54 | DATA 4, MX6_IOM_DRAM_SDQS3, 0x00000030 |
| 55 | DATA 4, MX6_IOM_GRP_DDRMODE, 0x00020000 |
| 56 | DATA 4, MX6_IOM_GRP_B0DS, 0x00000030 |
| 57 | DATA 4, MX6_IOM_GRP_B1DS, 0x00000030 |
| 58 | DATA 4, MX6_IOM_GRP_B2DS, 0x00000030 |
| 59 | DATA 4, MX6_IOM_GRP_B3DS, 0x00000030 |
| 60 | DATA 4, MX6_IOM_DRAM_DQM0, 0x00000030 |
| 61 | DATA 4, MX6_IOM_DRAM_DQM1, 0x00000030 |
| 62 | DATA 4, MX6_IOM_DRAM_DQM2, 0x00000030 |
| 63 | DATA 4, MX6_IOM_DRAM_DQM3, 0x00000030 |
| 64 | DATA 4, MX6_MMDC_P0_MDSCR, 0x00008000 |
| 65 | DATA 4, MX6_MMDC_P0_MPZQHWCTRL, 0xA1390003 |
| 66 | DATA 4, MX6_MMDC_P0_MPWLDECTRL0, 0x002D003A |
| 67 | DATA 4, MX6_MMDC_P0_MPWLDECTRL1, 0x0038002B |
| 68 | DATA 4, MX6_MMDC_P0_MPDGCTRL0, 0x03340338 |
| 69 | DATA 4, MX6_MMDC_P0_MPDGCTRL1, 0x0334032C |
| 70 | DATA 4, MX6_MMDC_P0_MPRDDLCTL, 0x4036383C |
| 71 | DATA 4, MX6_MMDC_P0_MPWRDLCTL, 0x2E384038 |
| 72 | DATA 4, MX6_MMDC_P0_MPRDDQBY0DL, 0x33333333 |
| 73 | DATA 4, MX6_MMDC_P0_MPRDDQBY1DL, 0x33333333 |
| 74 | DATA 4, MX6_MMDC_P0_MPRDDQBY2DL, 0x33333333 |
| 75 | DATA 4, MX6_MMDC_P0_MPRDDQBY3DL, 0x33333333 |
| 76 | DATA 4, MX6_MMDC_P0_MPMUR0, 0x00000800 |
| 77 | DATA 4, MX6_MMDC_P0_MDPDC, 0x00020036 |
| 78 | DATA 4, MX6_MMDC_P0_MDOTC, 0x09444040 |
| 79 | DATA 4, MX6_MMDC_P0_MDCFG0, 0xB8BE7955 |
| 80 | DATA 4, MX6_MMDC_P0_MDCFG1, 0xFF328F64 |
| 81 | DATA 4, MX6_MMDC_P0_MDCFG2, 0x01FF00DB |
| 82 | DATA 4, MX6_MMDC_P0_MDMISC, 0x00011740 |
| 83 | DATA 4, MX6_MMDC_P0_MDSCR, 0x00008000 |
| 84 | DATA 4, MX6_MMDC_P0_MDRWD, 0x000026D2 |
| 85 | DATA 4, MX6_MMDC_P0_MDOR, 0x00BE1023 |
| 86 | DATA 4, MX6_MMDC_P0_MDASP, 0x00000047 |
| 87 | DATA 4, MX6_MMDC_P0_MDCTL, 0x85190000 |
| 88 | DATA 4, MX6_MMDC_P0_MDSCR, 0x00888032 |
| 89 | DATA 4, MX6_MMDC_P0_MDSCR, 0x00008033 |
| 90 | DATA 4, MX6_MMDC_P0_MDSCR, 0x00008031 |
| 91 | DATA 4, MX6_MMDC_P0_MDSCR, 0x19408030 |
| 92 | DATA 4, MX6_MMDC_P0_MDSCR, 0x04008040 |
| 93 | DATA 4, MX6_MMDC_P0_MDREF, 0x00007800 |
| 94 | DATA 4, MX6_MMDC_P0_MPODTCTRL, 0x00000007 |
| 95 | DATA 4, MX6_MMDC_P0_MDPDC, 0x00025576 |
| 96 | DATA 4, MX6_MMDC_P0_MAPSR, 0x00011006 |
| 97 | DATA 4, MX6_MMDC_P0_MDSCR, 0x00000000 |
| 98 | |
| 99 | /* set the default clock gate to save power */ |
| 100 | DATA 4, CCM_CCGR0, 0x00C03F3F |
| 101 | DATA 4, CCM_CCGR1, 0x0030FC03 |
| 102 | DATA 4, CCM_CCGR2, 0x0FFFC000 |
| 103 | DATA 4, CCM_CCGR3, 0x3FF00000 |
| 104 | DATA 4, CCM_CCGR4, 0xFFFFF300 |
| 105 | DATA 4, CCM_CCGR5, 0x0F0000F3 |
| 106 | DATA 4, CCM_CCGR6, 0x00000FFF |
| 107 | |
| 108 | /* enable AXI cache for VDOA/VPU/IPU */ |
| 109 | DATA 4 MX6_IOMUXC_GPR4 0xF00000CF |
| 110 | /* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */ |
| 111 | DATA 4 MX6_IOMUXC_GPR6 0x007F007F |
| 112 | DATA 4 MX6_IOMUXC_GPR7 0x007F007F |