Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Markus Niebel | ee2cd2b | 2014-07-18 16:52:44 +0200 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2013, 2014 Markus Niebel <Markus.Niebel@tq-group.com> |
| 4 | * |
Patrick Delaunay | 488b6ac | 2020-02-28 15:18:12 +0100 | [diff] [blame] | 5 | * Refer doc/imx/mkimage/imximage.txt for more details about how-to configure |
Markus Niebel | ee2cd2b | 2014-07-18 16:52:44 +0200 | [diff] [blame] | 6 | * and create imximage boot image |
| 7 | * |
| 8 | * The syntax is taken as close as possible with the kwbimage |
| 9 | */ |
| 10 | |
| 11 | /* image version */ |
| 12 | IMAGE_VERSION 2 |
| 13 | |
| 14 | #define __ASSEMBLY__ |
| 15 | #include <config.h> |
| 16 | |
| 17 | /* |
| 18 | * Boot Device : one of |
| 19 | * spi, sd (the board has no nand neither onenand) |
| 20 | */ |
| 21 | #if defined(CONFIG_TQMA6X_MMC_BOOT) |
| 22 | BOOT_FROM sd |
| 23 | #elif defined(CONFIG_TQMA6X_SPI_BOOT) |
| 24 | BOOT_FROM spi |
| 25 | #endif |
| 26 | |
| 27 | #include "asm/arch/mx6-ddr.h" |
| 28 | #include "asm/arch/iomux.h" |
| 29 | #include "asm/arch/crm_regs.h" |
| 30 | |
| 31 | /* TQMa6Q/D DDR config Rev. 0100B */ |
| 32 | /* IOMUX configuration */ |
| 33 | DATA 4, MX6_IOM_GRP_DDR_TYPE, 0x000C0000 |
| 34 | DATA 4, MX6_IOM_GRP_DDRPKE, 0x00000000 |
| 35 | DATA 4, MX6_IOM_DRAM_SDCLK_0, 0x00008030 |
| 36 | DATA 4, MX6_IOM_DRAM_SDCLK_1, 0x00008030 |
| 37 | DATA 4, MX6_IOM_DRAM_CAS, 0x00008030 |
| 38 | DATA 4, MX6_IOM_DRAM_RAS, 0x00008030 |
| 39 | DATA 4, MX6_IOM_GRP_ADDDS, 0x00000030 |
| 40 | DATA 4, MX6_IOM_DRAM_RESET, 0x000C3030 |
| 41 | DATA 4, MX6_IOM_DRAM_SDCKE0, 0x00003000 |
| 42 | DATA 4, MX6_IOM_DRAM_SDCKE1, 0x00000000 |
| 43 | DATA 4, MX6_IOM_DRAM_SDBA2, 0x00000000 |
| 44 | DATA 4, MX6_IOM_DRAM_SDODT0, 0x00003030 |
| 45 | DATA 4, MX6_IOM_DRAM_SDODT1, 0x00003030 |
| 46 | DATA 4, MX6_IOM_GRP_CTLDS, 0x00000030 |
| 47 | DATA 4, MX6_IOM_DDRMODE_CTL, 0x00020000 |
| 48 | DATA 4, MX6_IOM_DRAM_SDQS0, 0x00000030 |
| 49 | DATA 4, MX6_IOM_DRAM_SDQS1, 0x00000030 |
| 50 | DATA 4, MX6_IOM_DRAM_SDQS2, 0x00000030 |
| 51 | DATA 4, MX6_IOM_DRAM_SDQS3, 0x00000030 |
| 52 | DATA 4, MX6_IOM_DRAM_SDQS4, 0x00000030 |
| 53 | DATA 4, MX6_IOM_DRAM_SDQS5, 0x00000030 |
| 54 | DATA 4, MX6_IOM_DRAM_SDQS6, 0x00000030 |
| 55 | DATA 4, MX6_IOM_DRAM_SDQS7, 0x00000030 |
| 56 | DATA 4, MX6_IOM_GRP_DDRMODE, 0x00020000 |
| 57 | DATA 4, MX6_IOM_GRP_B0DS, 0x00000030 |
| 58 | DATA 4, MX6_IOM_GRP_B1DS, 0x00000030 |
| 59 | DATA 4, MX6_IOM_GRP_B2DS, 0x00000030 |
| 60 | DATA 4, MX6_IOM_GRP_B3DS, 0x00000030 |
| 61 | DATA 4, MX6_IOM_GRP_B4DS, 0x00000030 |
| 62 | DATA 4, MX6_IOM_GRP_B5DS, 0x00000030 |
| 63 | DATA 4, MX6_IOM_GRP_B6DS, 0x00000030 |
| 64 | DATA 4, MX6_IOM_GRP_B7DS, 0x00000030 |
| 65 | DATA 4, MX6_IOM_DRAM_DQM0, 0x00000030 |
| 66 | DATA 4, MX6_IOM_DRAM_DQM1, 0x00000030 |
| 67 | DATA 4, MX6_IOM_DRAM_DQM2, 0x00000030 |
| 68 | DATA 4, MX6_IOM_DRAM_DQM3, 0x00000030 |
| 69 | DATA 4, MX6_IOM_DRAM_DQM4, 0x00000030 |
| 70 | DATA 4, MX6_IOM_DRAM_DQM5, 0x00000030 |
| 71 | DATA 4, MX6_IOM_DRAM_DQM6, 0x00000030 |
| 72 | DATA 4, MX6_IOM_DRAM_DQM7, 0x00000030 |
| 73 | |
| 74 | /* memory interface calibration values */ |
| 75 | DATA 4, MX6_MMDC_P0_MPZQHWCTRL, 0xA1390003 |
| 76 | DATA 4, MX6_MMDC_P1_MPZQHWCTRL, 0xA1390003 |
| 77 | DATA 4, MX6_MMDC_P0_MPWLDECTRL0, 0x001B0013 |
| 78 | DATA 4, MX6_MMDC_P0_MPWLDECTRL1, 0x0018001B |
| 79 | DATA 4, MX6_MMDC_P1_MPWLDECTRL0, 0x001B0016 |
| 80 | DATA 4, MX6_MMDC_P1_MPWLDECTRL1, 0x0012001C |
| 81 | DATA 4, MX6_MMDC_P0_MPDGCTRL0, 0x43400350 |
| 82 | DATA 4, MX6_MMDC_P0_MPDGCTRL1, 0x023E032C |
| 83 | DATA 4, MX6_MMDC_P1_MPDGCTRL0, 0x43400348 |
| 84 | DATA 4, MX6_MMDC_P1_MPDGCTRL1, 0x03300304 |
| 85 | DATA 4, MX6_MMDC_P0_MPRDDLCTL, 0x3C323436 |
| 86 | DATA 4, MX6_MMDC_P1_MPRDDLCTL, 0x38383242 |
| 87 | DATA 4, MX6_MMDC_P0_MPWRDLCTL, 0x3E3C4440 |
| 88 | DATA 4, MX6_MMDC_P1_MPWRDLCTL, 0x4236483E |
| 89 | DATA 4, MX6_MMDC_P0_MPRDDQBY0DL, 0x33333333 |
| 90 | DATA 4, MX6_MMDC_P0_MPRDDQBY1DL, 0x33333333 |
| 91 | DATA 4, MX6_MMDC_P0_MPRDDQBY2DL, 0x33333333 |
| 92 | DATA 4, MX6_MMDC_P0_MPRDDQBY3DL, 0x33333333 |
| 93 | DATA 4, MX6_MMDC_P1_MPRDDQBY0DL, 0x33333333 |
| 94 | DATA 4, MX6_MMDC_P1_MPRDDQBY1DL, 0x33333333 |
| 95 | DATA 4, MX6_MMDC_P1_MPRDDQBY2DL, 0x33333333 |
| 96 | DATA 4, MX6_MMDC_P1_MPRDDQBY3DL, 0x33333333 |
| 97 | DATA 4, MX6_MMDC_P0_MPMUR0, 0x00000800 |
| 98 | DATA 4, MX6_MMDC_P1_MPMUR0, 0x00000800 |
| 99 | |
| 100 | /* configure memory interface */ |
| 101 | DATA 4, MX6_MMDC_P0_MDPDC, 0x00020036 |
| 102 | DATA 4, MX6_MMDC_P0_MDOTC, 0x09444040 |
| 103 | DATA 4, MX6_MMDC_P0_MDCFG0, 0x545A79B4 |
| 104 | DATA 4, MX6_MMDC_P0_MDCFG1, 0xDB538F64 |
| 105 | DATA 4, MX6_MMDC_P0_MDCFG2, 0x01FF00DB |
| 106 | DATA 4, MX6_MMDC_P0_MDMISC, 0x00001740 |
| 107 | DATA 4, MX6_MMDC_P0_MDSCR, 0x00008000 |
| 108 | DATA 4, MX6_MMDC_P0_MDRWD, 0x000026D2 |
| 109 | DATA 4, MX6_MMDC_P0_MDOR, 0x005A1023 |
| 110 | DATA 4, MX6_MMDC_P0_MDASP, 0x00000027 |
| 111 | DATA 4, MX6_MMDC_P0_MDCTL, 0x831A0000 |
| 112 | DATA 4, MX6_MMDC_P0_MDSCR, 0x00088032 |
| 113 | DATA 4, MX6_MMDC_P0_MDSCR, 0x00008033 |
| 114 | DATA 4, MX6_MMDC_P0_MDSCR, 0x00048031 |
| 115 | DATA 4, MX6_MMDC_P0_MDSCR, 0x09308030 |
| 116 | DATA 4, MX6_MMDC_P0_MDSCR, 0x04008040 |
| 117 | DATA 4, MX6_MMDC_P0_MDREF, 0x00005800 |
| 118 | DATA 4, MX6_MMDC_P0_MPODTCTRL, 0x00022222 |
| 119 | DATA 4, MX6_MMDC_P1_MPODTCTRL, 0x00022222 |
| 120 | DATA 4, MX6_MMDC_P0_MDPDC, 0x00025536 |
| 121 | DATA 4, MX6_MMDC_P0_MAPSR, 0x00001006 |
| 122 | DATA 4, MX6_MMDC_P0_MDSCR, 0x00000000 |
| 123 | |
| 124 | #include "clocks.cfg" |