Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 2 | /* |
Yangbo Lu | bb32e68 | 2021-06-03 10:51:19 +0800 | [diff] [blame] | 3 | * Copyright 2017, 2020-2021 NXP |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef __LS1088A_QDS_H |
| 7 | #define __LS1088A_QDS_H |
| 8 | |
| 9 | #include "ls1088a_common.h" |
| 10 | |
Ashish Kumar | 4feb83b | 2017-11-06 13:18:44 +0530 | [diff] [blame] | 11 | #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI) |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 12 | #define SYS_NO_FLASH |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 13 | #endif |
| 14 | |
Tom Rini | 8c70baa | 2021-12-14 13:36:40 -0500 | [diff] [blame] | 15 | #define COUNTER_FREQUENCY_REAL (get_board_sys_clk()/4) |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 16 | |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 17 | #define CONFIG_MEM_INIT_VALUE 0xdeadbeef |
| 18 | #define SPD_EEPROM_ADDRESS 0x51 |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 19 | |
| 20 | |
| 21 | /* |
| 22 | * IFC Definitions |
| 23 | */ |
| 24 | #if !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_SD_BOOT_QSPI) |
| 25 | #define CONFIG_SYS_NOR0_CSPR_EXT (0x0) |
| 26 | #define CONFIG_SYS_NOR_AMASK IFC_AMASK(128*1024*1024) |
| 27 | #define CONFIG_SYS_NOR_AMASK_EARLY IFC_AMASK(64*1024*1024) |
| 28 | |
| 29 | #define CONFIG_SYS_NOR0_CSPR \ |
| 30 | (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS) | \ |
| 31 | CSPR_PORT_SIZE_16 | \ |
| 32 | CSPR_MSEL_NOR | \ |
| 33 | CSPR_V) |
| 34 | #define CONFIG_SYS_NOR0_CSPR_EARLY \ |
| 35 | (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS_EARLY) | \ |
| 36 | CSPR_PORT_SIZE_16 | \ |
| 37 | CSPR_MSEL_NOR | \ |
| 38 | CSPR_V) |
| 39 | #define CONFIG_SYS_NOR1_CSPR \ |
| 40 | (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH1_BASE_PHYS) | \ |
| 41 | CSPR_PORT_SIZE_16 | \ |
| 42 | CSPR_MSEL_NOR | \ |
| 43 | CSPR_V) |
| 44 | #define CONFIG_SYS_NOR1_CSPR_EARLY \ |
| 45 | (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH1_BASE_PHYS_EARLY) | \ |
| 46 | CSPR_PORT_SIZE_16 | \ |
| 47 | CSPR_MSEL_NOR | \ |
| 48 | CSPR_V) |
| 49 | #define CONFIG_SYS_NOR_CSOR CSOR_NOR_ADM_SHIFT(12) |
| 50 | #define CONFIG_SYS_NOR_FTIM0 (FTIM0_NOR_TACSE(0x4) | \ |
| 51 | FTIM0_NOR_TEADC(0x5) | \ |
Ashish Kumar | 55fd8b9 | 2018-02-19 14:16:58 +0530 | [diff] [blame] | 52 | FTIM0_NOR_TAVDS(0x6) | \ |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 53 | FTIM0_NOR_TEAHC(0x5)) |
| 54 | #define CONFIG_SYS_NOR_FTIM1 (FTIM1_NOR_TACO(0x35) | \ |
Ashish Kumar | 55fd8b9 | 2018-02-19 14:16:58 +0530 | [diff] [blame] | 55 | FTIM1_NOR_TRAD_NOR(0x1a) | \ |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 56 | FTIM1_NOR_TSEQRAD_NOR(0x13)) |
Ashish Kumar | 55fd8b9 | 2018-02-19 14:16:58 +0530 | [diff] [blame] | 57 | #define CONFIG_SYS_NOR_FTIM2 (FTIM2_NOR_TCS(0x8) | \ |
| 58 | FTIM2_NOR_TCH(0x8) | \ |
| 59 | FTIM2_NOR_TWPH(0xe) | \ |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 60 | FTIM2_NOR_TWP(0x1c)) |
| 61 | #define CONFIG_SYS_NOR_FTIM3 0x04000000 |
| 62 | #define CONFIG_SYS_IFC_CCR 0x01000000 |
| 63 | |
| 64 | #ifndef SYS_NO_FLASH |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 65 | #define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */ |
| 66 | |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 67 | #define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE,\ |
| 68 | CONFIG_SYS_FLASH_BASE + 0x40000000} |
| 69 | #endif |
| 70 | #endif |
| 71 | |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 72 | #define CONFIG_SYS_NAND_MAX_ECCPOS 256 |
| 73 | #define CONFIG_SYS_NAND_MAX_OOBFREE 2 |
| 74 | |
| 75 | #define CONFIG_SYS_NAND_CSPR_EXT (0x0) |
| 76 | #define CONFIG_SYS_NAND_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \ |
| 77 | | CSPR_PORT_SIZE_8 /* Port Size = 8 bit */ \ |
| 78 | | CSPR_MSEL_NAND /* MSEL = NAND */ \ |
| 79 | | CSPR_V) |
| 80 | #define CONFIG_SYS_NAND_AMASK IFC_AMASK(64 * 1024) |
| 81 | |
| 82 | #define CONFIG_SYS_NAND_CSOR (CSOR_NAND_ECC_ENC_EN /* ECC on encode */ \ |
| 83 | | CSOR_NAND_ECC_DEC_EN /* ECC on decode */ \ |
| 84 | | CSOR_NAND_ECC_MODE_4 /* 4-bit ECC */ \ |
| 85 | | CSOR_NAND_RAL_3 /* RAL = 3Byes */ \ |
| 86 | | CSOR_NAND_PGS_2K /* Page Size = 2K */ \ |
| 87 | | CSOR_NAND_SPRZ_64/* Spare size = 64 */ \ |
| 88 | | CSOR_NAND_PB(64)) /*Pages Per Block = 64*/ |
| 89 | |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 90 | /* ONFI NAND Flash mode0 Timing Params */ |
| 91 | #define CONFIG_SYS_NAND_FTIM0 (FTIM0_NAND_TCCST(0x07) | \ |
| 92 | FTIM0_NAND_TWP(0x18) | \ |
| 93 | FTIM0_NAND_TWCHT(0x07) | \ |
| 94 | FTIM0_NAND_TWH(0x0a)) |
| 95 | #define CONFIG_SYS_NAND_FTIM1 (FTIM1_NAND_TADLE(0x32) | \ |
| 96 | FTIM1_NAND_TWBE(0x39) | \ |
| 97 | FTIM1_NAND_TRR(0x0e) | \ |
| 98 | FTIM1_NAND_TRP(0x18)) |
| 99 | #define CONFIG_SYS_NAND_FTIM2 (FTIM2_NAND_TRAD(0x0f) | \ |
| 100 | FTIM2_NAND_TREH(0x0a) | \ |
| 101 | FTIM2_NAND_TWHRE(0x1e)) |
| 102 | #define CONFIG_SYS_NAND_FTIM3 0x0 |
| 103 | |
| 104 | #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE } |
| 105 | #define CONFIG_SYS_MAX_NAND_DEVICE 1 |
| 106 | #define CONFIG_MTD_NAND_VERIFY_WRITE |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 107 | |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 108 | #define CONFIG_SYS_I2C_FPGA_ADDR 0x66 |
| 109 | #define QIXIS_LBMAP_SWITCH 6 |
| 110 | #define QIXIS_QMAP_MASK 0xe0 |
| 111 | #define QIXIS_QMAP_SHIFT 5 |
| 112 | #define QIXIS_LBMAP_MASK 0x0f |
| 113 | #define QIXIS_LBMAP_SHIFT 0 |
| 114 | #define QIXIS_LBMAP_DFLTBANK 0x0e |
| 115 | #define QIXIS_LBMAP_ALTBANK 0x2e |
| 116 | #define QIXIS_LBMAP_SD 0x00 |
Ashish Kumar | 55769ca | 2018-01-17 12:16:37 +0530 | [diff] [blame] | 117 | #define QIXIS_LBMAP_EMMC 0x00 |
| 118 | #define QIXIS_LBMAP_IFC 0x00 |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 119 | #define QIXIS_LBMAP_SD_QSPI 0x0e |
| 120 | #define QIXIS_LBMAP_QSPI 0x0e |
Ashish Kumar | 55769ca | 2018-01-17 12:16:37 +0530 | [diff] [blame] | 121 | #define QIXIS_RCW_SRC_IFC 0x25 |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 122 | #define QIXIS_RCW_SRC_SD 0x40 |
Ashish Kumar | 55769ca | 2018-01-17 12:16:37 +0530 | [diff] [blame] | 123 | #define QIXIS_RCW_SRC_EMMC 0x41 |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 124 | #define QIXIS_RCW_SRC_QSPI 0x62 |
| 125 | #define QIXIS_RST_CTL_RESET 0x41 |
| 126 | #define QIXIS_RCFG_CTL_RECONFIG_IDLE 0x20 |
| 127 | #define QIXIS_RCFG_CTL_RECONFIG_START 0x21 |
| 128 | #define QIXIS_RCFG_CTL_WATCHDOG_ENBLE 0x08 |
| 129 | #define QIXIS_RST_FORCE_MEM 0x01 |
| 130 | #define QIXIS_STAT_PRES1 0xb |
| 131 | #define QIXIS_SDID_MASK 0x07 |
| 132 | #define QIXIS_ESDHC_NO_ADAPTER 0x7 |
| 133 | |
| 134 | #define CONFIG_SYS_FPGA_CSPR_EXT (0x0) |
| 135 | #define CONFIG_SYS_FPGA_CSPR (CSPR_PHYS_ADDR(QIXIS_BASE_PHYS_EARLY) \ |
| 136 | | CSPR_PORT_SIZE_8 \ |
| 137 | | CSPR_MSEL_GPCM \ |
| 138 | | CSPR_V) |
| 139 | #define SYS_FPGA_CSPR_FINAL (CSPR_PHYS_ADDR(QIXIS_BASE_PHYS) \ |
| 140 | | CSPR_PORT_SIZE_8 \ |
| 141 | | CSPR_MSEL_GPCM \ |
| 142 | | CSPR_V) |
| 143 | |
Ashish Kumar | e563ed8 | 2018-02-19 14:14:09 +0530 | [diff] [blame] | 144 | #define SYS_FPGA_AMASK IFC_AMASK(64 * 1024) |
Ashish Kumar | 4feb83b | 2017-11-06 13:18:44 +0530 | [diff] [blame] | 145 | #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI) |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 146 | #define CONFIG_SYS_FPGA_CSOR CSOR_GPCM_ADM_SHIFT(0) |
| 147 | #else |
| 148 | #define CONFIG_SYS_FPGA_CSOR CSOR_GPCM_ADM_SHIFT(12) |
| 149 | #endif |
| 150 | /* QIXIS Timing parameters*/ |
| 151 | #define SYS_FPGA_CS_FTIM0 (FTIM0_GPCM_TACSE(0x0e) | \ |
| 152 | FTIM0_GPCM_TEADC(0x0e) | \ |
| 153 | FTIM0_GPCM_TEAHC(0x0e)) |
| 154 | #define SYS_FPGA_CS_FTIM1 (FTIM1_GPCM_TACO(0xff) | \ |
| 155 | FTIM1_GPCM_TRAD(0x3f)) |
| 156 | #define SYS_FPGA_CS_FTIM2 (FTIM2_GPCM_TCS(0xf) | \ |
| 157 | FTIM2_GPCM_TCH(0xf) | \ |
| 158 | FTIM2_GPCM_TWP(0x3E)) |
| 159 | #define SYS_FPGA_CS_FTIM3 0x0 |
| 160 | |
Pankit Garg | 112aeba | 2018-12-27 04:37:57 +0000 | [diff] [blame] | 161 | #ifdef CONFIG_TFABOOT |
| 162 | #define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NOR0_CSPR_EXT |
| 163 | #define CONFIG_SYS_CSPR0 CONFIG_SYS_NOR0_CSPR_EARLY |
| 164 | #define CONFIG_SYS_CSPR0_FINAL CONFIG_SYS_NOR0_CSPR |
| 165 | #define CONFIG_SYS_AMASK0 CONFIG_SYS_NOR_AMASK |
| 166 | #define CONFIG_SYS_CSOR0 CONFIG_SYS_NOR_CSOR |
| 167 | #define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NOR_FTIM0 |
| 168 | #define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NOR_FTIM1 |
| 169 | #define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NOR_FTIM2 |
| 170 | #define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NOR_FTIM3 |
| 171 | #define CONFIG_SYS_CSPR1_EXT CONFIG_SYS_NOR0_CSPR_EXT |
| 172 | #define CONFIG_SYS_CSPR1 CONFIG_SYS_NOR1_CSPR_EARLY |
| 173 | #define CONFIG_SYS_CSPR1_FINAL CONFIG_SYS_NOR1_CSPR |
| 174 | #define CONFIG_SYS_AMASK1 CONFIG_SYS_NOR_AMASK_EARLY |
| 175 | #define CONFIG_SYS_AMASK1_FINAL CONFIG_SYS_NOR_AMASK |
| 176 | #define CONFIG_SYS_CSOR1 CONFIG_SYS_NOR_CSOR |
| 177 | #define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NOR_FTIM0 |
| 178 | #define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NOR_FTIM1 |
| 179 | #define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NOR_FTIM2 |
| 180 | #define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NOR_FTIM3 |
| 181 | #define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_NAND_CSPR_EXT |
| 182 | #define CONFIG_SYS_CSPR2 CONFIG_SYS_NAND_CSPR |
| 183 | #define CONFIG_SYS_AMASK2 CONFIG_SYS_NAND_AMASK |
| 184 | #define CONFIG_SYS_CSOR2 CONFIG_SYS_NAND_CSOR |
| 185 | #define CONFIG_SYS_CS2_FTIM0 CONFIG_SYS_NAND_FTIM0 |
| 186 | #define CONFIG_SYS_CS2_FTIM1 CONFIG_SYS_NAND_FTIM1 |
| 187 | #define CONFIG_SYS_CS2_FTIM2 CONFIG_SYS_NAND_FTIM2 |
| 188 | #define CONFIG_SYS_CS2_FTIM3 CONFIG_SYS_NAND_FTIM3 |
| 189 | #define CONFIG_SYS_CSPR3_EXT CONFIG_SYS_FPGA_CSPR_EXT |
| 190 | #define CONFIG_SYS_CSPR3 CONFIG_SYS_FPGA_CSPR |
| 191 | #define CONFIG_SYS_CSPR3_FINAL SYS_FPGA_CSPR_FINAL |
| 192 | #define CONFIG_SYS_AMASK3 SYS_FPGA_AMASK |
| 193 | #define CONFIG_SYS_CSOR3 CONFIG_SYS_FPGA_CSOR |
| 194 | #define CONFIG_SYS_CS3_FTIM0 SYS_FPGA_CS_FTIM0 |
| 195 | #define CONFIG_SYS_CS3_FTIM1 SYS_FPGA_CS_FTIM1 |
| 196 | #define CONFIG_SYS_CS3_FTIM2 SYS_FPGA_CS_FTIM2 |
| 197 | #define CONFIG_SYS_CS3_FTIM3 SYS_FPGA_CS_FTIM3 |
| 198 | #else |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 199 | #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI) |
| 200 | #define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NAND_CSPR_EXT |
| 201 | #define CONFIG_SYS_CSPR0 CONFIG_SYS_NAND_CSPR |
| 202 | #define CONFIG_SYS_AMASK0 CONFIG_SYS_NAND_AMASK |
| 203 | #define CONFIG_SYS_CSOR0 CONFIG_SYS_NAND_CSOR |
| 204 | #define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NAND_FTIM0 |
| 205 | #define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NAND_FTIM1 |
| 206 | #define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NAND_FTIM2 |
| 207 | #define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NAND_FTIM3 |
| 208 | #define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_FPGA_CSPR_EXT |
| 209 | #define CONFIG_SYS_CSPR2 CONFIG_SYS_FPGA_CSPR |
| 210 | #define CONFIG_SYS_CSPR2_FINAL SYS_FPGA_CSPR_FINAL |
Ashish Kumar | e563ed8 | 2018-02-19 14:14:09 +0530 | [diff] [blame] | 211 | #define CONFIG_SYS_AMASK2 SYS_FPGA_AMASK |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 212 | #define CONFIG_SYS_CSOR2 CONFIG_SYS_FPGA_CSOR |
| 213 | #define CONFIG_SYS_CS2_FTIM0 SYS_FPGA_CS_FTIM0 |
| 214 | #define CONFIG_SYS_CS2_FTIM1 SYS_FPGA_CS_FTIM1 |
| 215 | #define CONFIG_SYS_CS2_FTIM2 SYS_FPGA_CS_FTIM2 |
| 216 | #define CONFIG_SYS_CS2_FTIM3 SYS_FPGA_CS_FTIM3 |
| 217 | #else |
| 218 | #define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NOR0_CSPR_EXT |
| 219 | #define CONFIG_SYS_CSPR0 CONFIG_SYS_NOR0_CSPR_EARLY |
| 220 | #define CONFIG_SYS_CSPR0_FINAL CONFIG_SYS_NOR0_CSPR |
| 221 | #define CONFIG_SYS_AMASK0 CONFIG_SYS_NOR_AMASK |
| 222 | #define CONFIG_SYS_CSOR0 CONFIG_SYS_NOR_CSOR |
| 223 | #define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NOR_FTIM0 |
| 224 | #define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NOR_FTIM1 |
| 225 | #define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NOR_FTIM2 |
| 226 | #define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NOR_FTIM3 |
| 227 | #define CONFIG_SYS_CSPR1_EXT CONFIG_SYS_NOR0_CSPR_EXT |
| 228 | #define CONFIG_SYS_CSPR1 CONFIG_SYS_NOR1_CSPR_EARLY |
| 229 | #define CONFIG_SYS_CSPR1_FINAL CONFIG_SYS_NOR1_CSPR |
| 230 | #define CONFIG_SYS_AMASK1 CONFIG_SYS_NOR_AMASK_EARLY |
| 231 | #define CONFIG_SYS_AMASK1_FINAL CONFIG_SYS_NOR_AMASK |
| 232 | #define CONFIG_SYS_CSOR1 CONFIG_SYS_NOR_CSOR |
| 233 | #define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NOR_FTIM0 |
| 234 | #define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NOR_FTIM1 |
| 235 | #define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NOR_FTIM2 |
| 236 | #define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NOR_FTIM3 |
| 237 | #define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_NAND_CSPR_EXT |
| 238 | #define CONFIG_SYS_CSPR2 CONFIG_SYS_NAND_CSPR |
| 239 | #define CONFIG_SYS_AMASK2 CONFIG_SYS_NAND_AMASK |
| 240 | #define CONFIG_SYS_CSOR2 CONFIG_SYS_NAND_CSOR |
| 241 | #define CONFIG_SYS_CS2_FTIM0 CONFIG_SYS_NAND_FTIM0 |
| 242 | #define CONFIG_SYS_CS2_FTIM1 CONFIG_SYS_NAND_FTIM1 |
| 243 | #define CONFIG_SYS_CS2_FTIM2 CONFIG_SYS_NAND_FTIM2 |
| 244 | #define CONFIG_SYS_CS2_FTIM3 CONFIG_SYS_NAND_FTIM3 |
| 245 | #define CONFIG_SYS_CSPR3_EXT CONFIG_SYS_FPGA_CSPR_EXT |
| 246 | #define CONFIG_SYS_CSPR3 CONFIG_SYS_FPGA_CSPR |
Ashish Kumar | e563ed8 | 2018-02-19 14:14:09 +0530 | [diff] [blame] | 247 | #define CONFIG_SYS_CSPR3_FINAL SYS_FPGA_CSPR_FINAL |
| 248 | #define CONFIG_SYS_AMASK3 SYS_FPGA_AMASK |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 249 | #define CONFIG_SYS_CSOR3 CONFIG_SYS_FPGA_CSOR |
Ashish Kumar | e563ed8 | 2018-02-19 14:14:09 +0530 | [diff] [blame] | 250 | #define CONFIG_SYS_CS3_FTIM0 SYS_FPGA_CS_FTIM0 |
| 251 | #define CONFIG_SYS_CS3_FTIM1 SYS_FPGA_CS_FTIM1 |
| 252 | #define CONFIG_SYS_CS3_FTIM2 SYS_FPGA_CS_FTIM2 |
| 253 | #define CONFIG_SYS_CS3_FTIM3 SYS_FPGA_CS_FTIM3 |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 254 | #endif |
Pankit Garg | 112aeba | 2018-12-27 04:37:57 +0000 | [diff] [blame] | 255 | #endif |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 256 | |
| 257 | #define CONFIG_SYS_LS_MC_BOOT_TIMEOUT_MS 5000 |
| 258 | |
| 259 | /* |
| 260 | * I2C bus multiplexer |
| 261 | */ |
| 262 | #define I2C_MUX_PCA_ADDR_PRI 0x77 |
| 263 | #define I2C_MUX_PCA_ADDR_SEC 0x76 /* Secondary multiplexer */ |
| 264 | #define I2C_RETIMER_ADDR 0x18 |
| 265 | #define I2C_RETIMER_ADDR2 0x19 |
| 266 | #define I2C_MUX_CH_DEFAULT 0x8 |
| 267 | #define I2C_MUX_CH5 0xD |
| 268 | |
Rajesh Bhagat | 170eecf | 2018-01-17 16:13:05 +0530 | [diff] [blame] | 269 | #define I2C_MUX_CH_VOL_MONITOR 0xA |
| 270 | |
| 271 | /* Voltage monitor on channel 2*/ |
| 272 | #define I2C_VOL_MONITOR_ADDR 0x63 |
| 273 | #define I2C_VOL_MONITOR_BUS_V_OFFSET 0x2 |
| 274 | #define I2C_VOL_MONITOR_BUS_V_OVF 0x1 |
| 275 | #define I2C_VOL_MONITOR_BUS_V_SHIFT 3 |
Rajesh Bhagat | a421625 | 2018-01-17 16:13:09 +0530 | [diff] [blame] | 276 | #define I2C_SVDD_MONITOR_ADDR 0x4F |
| 277 | |
Rajesh Bhagat | a421625 | 2018-01-17 16:13:09 +0530 | [diff] [blame] | 278 | /* The lowest and highest voltage allowed for LS1088AQDS */ |
| 279 | #define VDD_MV_MIN 819 |
| 280 | #define VDD_MV_MAX 1212 |
| 281 | |
Rajesh Bhagat | 170eecf | 2018-01-17 16:13:05 +0530 | [diff] [blame] | 282 | #define PWM_CHANNEL0 0x0 |
| 283 | |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 284 | /* |
| 285 | * RTC configuration |
| 286 | */ |
| 287 | #define RTC |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 288 | #define CONFIG_SYS_I2C_RTC_ADDR 0x51 /* Channel 3*/ |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 289 | |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 290 | #ifdef CONFIG_FSL_DSPI |
Pankit Garg | 112aeba | 2018-12-27 04:37:57 +0000 | [diff] [blame] | 291 | #if !defined(CONFIG_TFABOOT) && \ |
| 292 | !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_SD_BOOT_QSPI) |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 293 | #endif |
| 294 | #endif |
| 295 | |
Biwen Li | a39b947 | 2020-12-10 11:02:47 +0800 | [diff] [blame] | 296 | #define COMMON_ENV \ |
| 297 | "kernelheader_addr_r=0x80200000\0" \ |
| 298 | "fdtheader_addr_r=0x80100000\0" \ |
| 299 | "kernel_addr_r=0x81000000\0" \ |
| 300 | "fdt_addr_r=0x90000000\0" \ |
| 301 | "load_addr=0xa0000000\0" |
| 302 | |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 303 | /* Initial environment variables */ |
Udit Agarwal | 22ec238 | 2019-11-07 16:11:32 +0000 | [diff] [blame] | 304 | #ifdef CONFIG_NXP_ESBC |
Udit Agarwal | 09fd579 | 2017-11-22 09:01:26 +0530 | [diff] [blame] | 305 | #undef CONFIG_EXTRA_ENV_SETTINGS |
| 306 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
Biwen Li | a39b947 | 2020-12-10 11:02:47 +0800 | [diff] [blame] | 307 | COMMON_ENV \ |
Udit Agarwal | 09fd579 | 2017-11-22 09:01:26 +0530 | [diff] [blame] | 308 | "hwconfig=fsl_ddr:bank_intlv=auto\0" \ |
| 309 | "loadaddr=0x90100000\0" \ |
| 310 | "kernel_addr=0x100000\0" \ |
| 311 | "ramdisk_addr=0x800000\0" \ |
| 312 | "ramdisk_size=0x2000000\0" \ |
| 313 | "fdt_high=0xa0000000\0" \ |
| 314 | "initrd_high=0xffffffffffffffff\0" \ |
| 315 | "kernel_start=0x1000000\0" \ |
| 316 | "kernel_load=0xa0000000\0" \ |
| 317 | "kernel_size=0x2800000\0" \ |
Priyanka Jain | 0653270 | 2021-07-19 14:51:24 +0530 | [diff] [blame] | 318 | "mcinitcmd=sf probe 0:0;sf read 0xa0a00000 0xa00000 0x200000;" \ |
Priyanka Singh | f745ae9 | 2020-01-22 10:32:34 +0000 | [diff] [blame] | 319 | "sf read 0xa0640000 0x640000 0x4000; esbc_validate 0xa0640000;" \ |
Udit Agarwal | 09fd579 | 2017-11-22 09:01:26 +0530 | [diff] [blame] | 320 | "sf read 0xa0e00000 0xe00000 0x100000;" \ |
Priyanka Singh | f745ae9 | 2020-01-22 10:32:34 +0000 | [diff] [blame] | 321 | "sf read 0xa0680000 0x680000 0x4000;esbc_validate 0xa0680000;" \ |
Udit Agarwal | 09fd579 | 2017-11-22 09:01:26 +0530 | [diff] [blame] | 322 | "fsl_mc start mc 0xa0a00000 0xa0e00000\0" \ |
| 323 | "mcmemsize=0x70000000 \0" |
Udit Agarwal | 22ec238 | 2019-11-07 16:11:32 +0000 | [diff] [blame] | 324 | #else /* if !(CONFIG_NXP_ESBC) */ |
Pankit Garg | 112aeba | 2018-12-27 04:37:57 +0000 | [diff] [blame] | 325 | #ifdef CONFIG_TFABOOT |
| 326 | #define QSPI_MC_INIT_CMD \ |
Priyanka Jain | 0653270 | 2021-07-19 14:51:24 +0530 | [diff] [blame] | 327 | "sf probe 0:0;sf read 0x80a00000 0xA00000 0x200000;" \ |
| 328 | "sf read 0x80e00000 0xE00000 0x100000;" \ |
| 329 | "fsl_mc start mc 0x80a00000 0x80e00000\0" |
Pankit Garg | 112aeba | 2018-12-27 04:37:57 +0000 | [diff] [blame] | 330 | #define SD_MC_INIT_CMD \ |
Priyanka Jain | 0653270 | 2021-07-19 14:51:24 +0530 | [diff] [blame] | 331 | "mmcinfo;mmc read 0x80a00000 0x5000 0x1000;" \ |
| 332 | "mmc read 0x80e00000 0x7000 0x800;" \ |
| 333 | "fsl_mc start mc 0x80a00000 0x80e00000\0" |
Pankit Garg | 112aeba | 2018-12-27 04:37:57 +0000 | [diff] [blame] | 334 | #define IFC_MC_INIT_CMD \ |
| 335 | "fsl_mc start mc 0x580A00000 0x580E00000\0" |
| 336 | |
| 337 | #undef CONFIG_EXTRA_ENV_SETTINGS |
| 338 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
Biwen Li | a39b947 | 2020-12-10 11:02:47 +0800 | [diff] [blame] | 339 | COMMON_ENV \ |
Pankit Garg | 112aeba | 2018-12-27 04:37:57 +0000 | [diff] [blame] | 340 | "hwconfig=fsl_ddr:bank_intlv=auto\0" \ |
| 341 | "loadaddr=0x90100000\0" \ |
| 342 | "kernel_addr=0x100000\0" \ |
| 343 | "kernel_addr_sd=0x800\0" \ |
| 344 | "ramdisk_addr=0x800000\0" \ |
| 345 | "ramdisk_size=0x2000000\0" \ |
| 346 | "fdt_high=0xa0000000\0" \ |
| 347 | "initrd_high=0xffffffffffffffff\0" \ |
| 348 | "kernel_start=0x1000000\0" \ |
| 349 | "kernel_start_sd=0x8000\0" \ |
| 350 | "kernel_load=0xa0000000\0" \ |
| 351 | "kernel_size=0x2800000\0" \ |
| 352 | "kernel_size_sd=0x14000\0" \ |
Priyanka Jain | 0653270 | 2021-07-19 14:51:24 +0530 | [diff] [blame] | 353 | "mcinitcmd=sf probe 0:0;sf read 0x80a00000 0xA00000 0x200000;" \ |
| 354 | "sf read 0x80e00000 0xE00000 0x100000;" \ |
| 355 | "fsl_mc start mc 0x80a00000 0x80e00000\0" \ |
Biwen Li | 5bef869 | 2020-03-19 19:38:42 +0800 | [diff] [blame] | 356 | "mcmemsize=0x70000000 \0" \ |
| 357 | "BOARD=ls1088aqds\0" \ |
| 358 | "scriptaddr=0x80000000\0" \ |
| 359 | "scripthdraddr=0x80080000\0" \ |
| 360 | BOOTENV \ |
| 361 | "boot_scripts=ls1088aqds_boot.scr\0" \ |
| 362 | "boot_script_hdr=hdr_ls1088aqds_bs.out\0" \ |
| 363 | "scan_dev_for_boot_part=" \ |
| 364 | "part list ${devtype} ${devnum} devplist; " \ |
| 365 | "env exists devplist || setenv devplist 1; " \ |
| 366 | "for distro_bootpart in ${devplist}; do " \ |
| 367 | "if fstype ${devtype} " \ |
| 368 | "${devnum}:${distro_bootpart} " \ |
| 369 | "bootfstype; then " \ |
| 370 | "run scan_dev_for_boot; " \ |
| 371 | "fi; " \ |
| 372 | "done\0" \ |
| 373 | "boot_a_script=" \ |
| 374 | "load ${devtype} ${devnum}:${distro_bootpart} " \ |
| 375 | "${scriptaddr} ${prefix}${script}; " \ |
| 376 | "env exists secureboot && load ${devtype} " \ |
| 377 | "${devnum}:${distro_bootpart} " \ |
| 378 | "${scripthdraddr} ${prefix}${boot_script_hdr}; "\ |
| 379 | "env exists secureboot " \ |
| 380 | "&& esbc_validate ${scripthdraddr};" \ |
| 381 | "source ${scriptaddr}\0" \ |
| 382 | "qspi_bootcmd=echo Trying load from qspi..; " \ |
| 383 | "sf probe 0:0; " \ |
| 384 | "sf read 0x80001000 0xd00000 0x100000; " \ |
| 385 | "fsl_mc lazyapply dpl 0x80001000 && " \ |
| 386 | "sf read $kernel_load $kernel_start " \ |
| 387 | "$kernel_size && bootm $kernel_load#$BOARD\0" \ |
| 388 | "sd_bootcmd=echo Trying load from sd card..; " \ |
| 389 | "mmcinfo;mmc read 0x80001000 0x6800 0x800; "\ |
| 390 | "fsl_mc lazyapply dpl 0x80001000 && " \ |
| 391 | "mmc read $kernel_load $kernel_start_sd " \ |
| 392 | "$kernel_size_sd && bootm $kernel_load#$BOARD\0" \ |
| 393 | "nor_bootcmd=echo Trying load from nor..; " \ |
| 394 | "fsl_mc lazyapply dpl 0x580d00000 && " \ |
| 395 | "cp.b $kernel_start $kernel_load " \ |
| 396 | "$kernel_size && bootm $kernel_load#$BOARD\0" |
Pankit Garg | 112aeba | 2018-12-27 04:37:57 +0000 | [diff] [blame] | 397 | #else |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 398 | #if defined(CONFIG_QSPI_BOOT) |
| 399 | #undef CONFIG_EXTRA_ENV_SETTINGS |
| 400 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
Biwen Li | a39b947 | 2020-12-10 11:02:47 +0800 | [diff] [blame] | 401 | COMMON_ENV \ |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 402 | "hwconfig=fsl_ddr:bank_intlv=auto\0" \ |
| 403 | "loadaddr=0x90100000\0" \ |
| 404 | "kernel_addr=0x100000\0" \ |
| 405 | "ramdisk_addr=0x800000\0" \ |
| 406 | "ramdisk_size=0x2000000\0" \ |
| 407 | "fdt_high=0xa0000000\0" \ |
| 408 | "initrd_high=0xffffffffffffffff\0" \ |
| 409 | "kernel_start=0x1000000\0" \ |
| 410 | "kernel_load=0xa0000000\0" \ |
| 411 | "kernel_size=0x2800000\0" \ |
Priyanka Jain | 0653270 | 2021-07-19 14:51:24 +0530 | [diff] [blame] | 412 | "mcinitcmd=sf probe 0:0;sf read 0x80a00000 0xA00000 0x200000;" \ |
| 413 | "sf read 0x80e00000 0xE00000 0x100000;" \ |
| 414 | "fsl_mc start mc 0x80a00000 0x80e00000\0" \ |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 415 | "mcmemsize=0x70000000 \0" |
Ashish Kumar | 4feb83b | 2017-11-06 13:18:44 +0530 | [diff] [blame] | 416 | #elif defined(CONFIG_SD_BOOT) |
| 417 | #undef CONFIG_EXTRA_ENV_SETTINGS |
| 418 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
Biwen Li | a39b947 | 2020-12-10 11:02:47 +0800 | [diff] [blame] | 419 | COMMON_ENV \ |
Ashish Kumar | 4feb83b | 2017-11-06 13:18:44 +0530 | [diff] [blame] | 420 | "hwconfig=fsl_ddr:bank_intlv=auto\0" \ |
| 421 | "loadaddr=0x90100000\0" \ |
| 422 | "kernel_addr=0x800\0" \ |
| 423 | "ramdisk_addr=0x800000\0" \ |
| 424 | "ramdisk_size=0x2000000\0" \ |
| 425 | "fdt_high=0xa0000000\0" \ |
| 426 | "initrd_high=0xffffffffffffffff\0" \ |
| 427 | "kernel_start=0x8000\0" \ |
| 428 | "kernel_load=0xa0000000\0" \ |
| 429 | "kernel_size=0x14000\0" \ |
Priyanka Jain | 0653270 | 2021-07-19 14:51:24 +0530 | [diff] [blame] | 430 | "mcinitcmd=mmcinfo;mmc read 0x80a00000 0x5000 0x1000;" \ |
| 431 | "mmc read 0x80e00000 0x7000 0x800;" \ |
| 432 | "fsl_mc start mc 0x80a00000 0x80e00000\0" \ |
Ashish Kumar | 4feb83b | 2017-11-06 13:18:44 +0530 | [diff] [blame] | 433 | "mcmemsize=0x70000000 \0" |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 434 | #else /* NOR BOOT */ |
| 435 | #undef CONFIG_EXTRA_ENV_SETTINGS |
| 436 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
Biwen Li | a39b947 | 2020-12-10 11:02:47 +0800 | [diff] [blame] | 437 | COMMON_ENV \ |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 438 | "hwconfig=fsl_ddr:bank_intlv=auto\0" \ |
| 439 | "loadaddr=0x90100000\0" \ |
| 440 | "kernel_addr=0x100000\0" \ |
| 441 | "ramdisk_addr=0x800000\0" \ |
| 442 | "ramdisk_size=0x2000000\0" \ |
| 443 | "fdt_high=0xa0000000\0" \ |
| 444 | "initrd_high=0xffffffffffffffff\0" \ |
| 445 | "kernel_start=0x1000000\0" \ |
| 446 | "kernel_load=0xa0000000\0" \ |
| 447 | "kernel_size=0x2800000\0" \ |
| 448 | "mcinitcmd=fsl_mc start mc 0x580A00000 0x580E00000\0" \ |
| 449 | "mcmemsize=0x70000000 \0" |
| 450 | #endif |
Pankit Garg | 112aeba | 2018-12-27 04:37:57 +0000 | [diff] [blame] | 451 | #endif /* CONFIG_TFABOOT */ |
Udit Agarwal | 22ec238 | 2019-11-07 16:11:32 +0000 | [diff] [blame] | 452 | #endif /* CONFIG_NXP_ESBC */ |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 453 | |
Biwen Li | 5bef869 | 2020-03-19 19:38:42 +0800 | [diff] [blame] | 454 | #ifdef CONFIG_TFABOOT |
| 455 | #define QSPI_NOR_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; " \ |
| 456 | "env exists secureboot && esbc_halt;;" |
| 457 | #define IFC_NOR_BOOTCOMMAND "run distro_bootcmd; run nor_bootcmd; " \ |
| 458 | "env exists secureboot && esbc_halt;;" |
| 459 | #define SD_BOOTCOMMAND "run distro_bootcmd; run sd_bootcmd; " \ |
| 460 | "env exists secureboot && esbc_halt;;" |
| 461 | #endif |
| 462 | |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 463 | #ifdef CONFIG_FSL_MC_ENET |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 464 | #define RGMII_PHY1_ADDR 0x1 |
| 465 | #define RGMII_PHY2_ADDR 0x2 |
| 466 | #define SGMII_CARD_PORT1_PHY_ADDR 0x1C |
| 467 | #define SGMII_CARD_PORT2_PHY_ADDR 0x1d |
| 468 | #define SGMII_CARD_PORT3_PHY_ADDR 0x1E |
| 469 | #define SGMII_CARD_PORT4_PHY_ADDR 0x1F |
| 470 | |
| 471 | #define XQSGMII_CARD_PHY1_PORT0_ADDR 0x0 |
| 472 | #define XQSGMII_CARD_PHY1_PORT1_ADDR 0x1 |
| 473 | #define XQSGMII_CARD_PHY1_PORT2_ADDR 0x2 |
| 474 | #define XQSGMII_CARD_PHY1_PORT3_ADDR 0x3 |
| 475 | #define XQSGMII_CARD_PHY2_PORT0_ADDR 0x4 |
| 476 | #define XQSGMII_CARD_PHY2_PORT1_ADDR 0x5 |
| 477 | #define XQSGMII_CARD_PHY2_PORT2_ADDR 0x6 |
| 478 | #define XQSGMII_CARD_PHY2_PORT3_ADDR 0x7 |
| 479 | #define XQSGMII_CARD_PHY3_PORT0_ADDR 0x8 |
| 480 | #define XQSGMII_CARD_PHY3_PORT1_ADDR 0x9 |
| 481 | #define XQSGMII_CARD_PHY3_PORT2_ADDR 0xa |
| 482 | #define XQSGMII_CARD_PHY3_PORT3_ADDR 0xb |
| 483 | #define XQSGMII_CARD_PHY4_PORT0_ADDR 0xc |
| 484 | #define XQSGMII_CARD_PHY4_PORT1_ADDR 0xd |
| 485 | #define XQSGMII_CARD_PHY4_PORT2_ADDR 0xe |
| 486 | #define XQSGMII_CARD_PHY4_PORT3_ADDR 0xf |
| 487 | |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 488 | #endif |
| 489 | |
Ashish Kumar | 1ef4c77 | 2017-08-31 16:12:55 +0530 | [diff] [blame] | 490 | #define BOOT_TARGET_DEVICES(func) \ |
| 491 | func(USB, usb, 0) \ |
| 492 | func(MMC, mmc, 0) \ |
| 493 | func(SCSI, scsi, 0) \ |
| 494 | func(DHCP, dhcp, na) |
| 495 | #include <config_distro_bootcmd.h> |
| 496 | |
| 497 | #include <asm/fsl_secure_boot.h> |
| 498 | |
| 499 | #endif /* __LS1088A_QDS_H */ |