Niel Fourie | 37bfd9c | 2021-01-21 13:19:20 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * (C) Copyright 2016 Keymile AG |
| 4 | * Rainer Boschung <rainer.boschung@keymile.com> |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #ifndef __KMCENT2_H |
| 9 | #define __KMCENT2_H |
| 10 | |
| 11 | #define CONFIG_HOSTNAME "kmcent2" |
| 12 | #define KM_BOARD_NAME CONFIG_HOSTNAME |
| 13 | |
| 14 | /* |
| 15 | * The Linux fsl_fman driver needs to be able to process frames with more |
| 16 | * than just the VLAN tag (i.e. eDSA tag). It is passed as a kernel boot |
| 17 | * parameters |
| 18 | */ |
| 19 | #define CONFIG_KM_DEF_BOOT_ARGS_CPU "fsl_dpaa_fman.fsl_fm_max_frm=1558" |
| 20 | |
| 21 | #include "km/keymile-common.h" |
| 22 | |
| 23 | /* Application IFC chip selects */ |
| 24 | #define SYS_LAWAPP_BASE 0xc0000000 |
| 25 | #define SYS_LAWAPP_BASE_PHYS (0xf00000000ull | SYS_LAWAPP_BASE) |
| 26 | |
| 27 | /* Application IFC CS4 MRAM */ |
| 28 | #define CONFIG_SYS_MRAM_BASE SYS_LAWAPP_BASE |
| 29 | #define SYS_MRAM_BASE_PHYS SYS_LAWAPP_BASE_PHYS |
| 30 | #define SYS_MRAM_CSPR_EXT (0x0f) |
| 31 | #define SYS_MRAM_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_MRAM_BASE) | \ |
| 32 | CSPR_PORT_SIZE_8 | /* 8 bit */ \ |
| 33 | CSPR_MSEL_GPCM | /* msel = gpcm */ \ |
| 34 | CSPR_V /* bank is valid */) |
| 35 | #define SYS_MRAM_AMASK IFC_AMASK(2 * 1024 * 1024) /* 2 MiB */ |
| 36 | #define SYS_MRAM_CSOR CSOR_GPCM_TRHZ_40 |
| 37 | /* MRAM Timing parameters for IFC CS4 */ |
| 38 | #define SYS_MRAM_FTIM0 (FTIM0_GPCM_TACSE(0x6) | \ |
| 39 | FTIM0_GPCM_TEADC(0x8) | \ |
| 40 | FTIM0_GPCM_TEAHC(0x2)) |
| 41 | #define SYS_MRAM_FTIM1 (FTIM1_GPCM_TACO(0x2) | \ |
| 42 | FTIM1_GPCM_TRAD(0xe)) |
| 43 | #define SYS_MRAM_FTIM2 (FTIM2_GPCM_TCS(0x2) | \ |
| 44 | FTIM2_GPCM_TCH(0x2) | \ |
| 45 | FTIM2_GPCM_TWP(0x8)) |
| 46 | #define SYS_MRAM_FTIM3 0x04000000 |
| 47 | #define CONFIG_SYS_CSPR4_EXT SYS_MRAM_CSPR_EXT |
| 48 | #define CONFIG_SYS_CSPR4 SYS_MRAM_CSPR |
| 49 | #define CONFIG_SYS_AMASK4 SYS_MRAM_AMASK |
| 50 | #define CONFIG_SYS_CSOR4 SYS_MRAM_CSOR |
| 51 | #define CONFIG_SYS_CS4_FTIM0 SYS_MRAM_FTIM0 |
| 52 | #define CONFIG_SYS_CS4_FTIM1 SYS_MRAM_FTIM1 |
| 53 | #define CONFIG_SYS_CS4_FTIM2 SYS_MRAM_FTIM2 |
| 54 | #define CONFIG_SYS_CS4_FTIM3 SYS_MRAM_FTIM3 |
| 55 | |
| 56 | /* Application IFC CS6: BFTIC */ |
| 57 | #define SYS_BFTIC_BASE 0xd0000000 |
| 58 | #define SYS_BFTIC_BASE_PHYS (0xf00000000ull | SYS_BFTIC_BASE) |
| 59 | #define SYS_BFTIC_CSPR_EXT (0x0f) |
| 60 | #define SYS_BFTIC_CSPR (CSPR_PHYS_ADDR(SYS_BFTIC_BASE) | \ |
| 61 | CSPR_PORT_SIZE_8 | /* Port size = 8 bit */\ |
| 62 | CSPR_MSEL_GPCM | /* MSEL = GPCM */\ |
| 63 | CSPR_V) /* valid */ |
| 64 | #define SYS_BFTIC_AMASK IFC_AMASK(64 * 1024) /* 64kB */ |
| 65 | #define SYS_BFTIC_CSOR CSOR_GPCM_TRHZ_40 |
| 66 | /* BFTIC Timing parameters for IFC CS6 */ |
| 67 | #define SYS_BFTIC_FTIM0 (FTIM0_GPCM_TACSE(0x6) | \ |
| 68 | FTIM0_GPCM_TEADC(0x8) | \ |
| 69 | FTIM0_GPCM_TEAHC(0x2)) |
| 70 | #define SYS_BFTIC_FTIM1 (FTIM1_GPCM_TACO(0x2) | \ |
| 71 | FTIM1_GPCM_TRAD(0x12)) |
| 72 | #define SYS_BFTIC_FTIM2 (FTIM2_GPCM_TCS(0x3) | \ |
| 73 | FTIM2_GPCM_TCH(0x1) | \ |
| 74 | FTIM2_GPCM_TWP(0x12)) |
| 75 | #define SYS_BFTIC_FTIM3 0x04000000 |
| 76 | #define CONFIG_SYS_CSPR6_EXT SYS_BFTIC_CSPR_EXT |
| 77 | #define CONFIG_SYS_CSPR6 SYS_BFTIC_CSPR |
| 78 | #define CONFIG_SYS_AMASK6 SYS_BFTIC_AMASK |
| 79 | #define CONFIG_SYS_CSOR6 SYS_BFTIC_CSOR |
| 80 | #define CONFIG_SYS_CS6_FTIM0 SYS_BFTIC_FTIM0 |
| 81 | #define CONFIG_SYS_CS6_FTIM1 SYS_BFTIC_FTIM1 |
| 82 | #define CONFIG_SYS_CS6_FTIM2 SYS_BFTIC_FTIM2 |
| 83 | #define CONFIG_SYS_CS6_FTIM3 SYS_BFTIC_FTIM3 |
| 84 | |
| 85 | /* Application IFC CS7 PAXE */ |
| 86 | #define CONFIG_SYS_PAXE_BASE 0xd8000000 |
| 87 | #define SYS_PAXE_BASE_PHYS (0xf00000000ull | CONFIG_SYS_PAXE_BASE) |
| 88 | #define SYS_PAXE_CSPR_EXT (0x0f) |
| 89 | #define SYS_PAXE_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_PAXE_BASE) | \ |
| 90 | CSPR_PORT_SIZE_8 | /* Port size = 8 bit */\ |
| 91 | CSPR_MSEL_GPCM | /* MSEL = GPCM */\ |
| 92 | CSPR_V) /* valid */ |
| 93 | #define SYS_PAXE_AMASK IFC_AMASK(64 * 1024) /* 64kB */ |
| 94 | #define SYS_PAXE_CSOR CSOR_GPCM_TRHZ_40 |
| 95 | /* PAXE Timing parameters for IFC CS7 */ |
| 96 | #define SYS_PAXE_FTIM0 (FTIM0_GPCM_TACSE(0x6) | \ |
| 97 | FTIM0_GPCM_TEADC(0x8) | \ |
| 98 | FTIM0_GPCM_TEAHC(0x2)) |
| 99 | #define SYS_PAXE_FTIM1 (FTIM1_GPCM_TACO(0x2) | \ |
| 100 | FTIM1_GPCM_TRAD(0x12)) |
| 101 | #define SYS_PAXE_FTIM2 (FTIM2_GPCM_TCS(0x3) | \ |
| 102 | FTIM2_GPCM_TCH(0x1) | \ |
| 103 | FTIM2_GPCM_TWP(0x12)) |
| 104 | #define SYS_PAXE_FTIM3 0x04000000 |
| 105 | #define CONFIG_SYS_CSPR7_EXT SYS_PAXE_CSPR_EXT |
| 106 | #define CONFIG_SYS_CSPR7 SYS_PAXE_CSPR |
| 107 | #define CONFIG_SYS_AMASK7 SYS_PAXE_AMASK |
| 108 | #define CONFIG_SYS_CSOR7 SYS_PAXE_CSOR |
| 109 | #define CONFIG_SYS_CS7_FTIM0 SYS_PAXE_FTIM0 |
| 110 | #define CONFIG_SYS_CS7_FTIM1 SYS_PAXE_FTIM1 |
| 111 | #define CONFIG_SYS_CS7_FTIM2 SYS_PAXE_FTIM2 |
| 112 | #define CONFIG_SYS_CS7_FTIM3 SYS_PAXE_FTIM3 |
| 113 | |
| 114 | /* PRST */ |
| 115 | #define KM_BFTIC4_RST 0 |
| 116 | #define KM_DPAXE_RST 1 |
| 117 | #define KM_FEMT_RST 3 |
| 118 | #define KM_FOAM_RST 4 |
| 119 | #define KM_EFE_RST 5 |
| 120 | #define KM_ES_PHY_RST 6 |
| 121 | #define KM_XES_PHY_RST 7 |
| 122 | #define KM_ZL30158_RST 8 |
| 123 | #define KM_ZL30364_RST 9 |
| 124 | #define KM_BOBCAT_RST 10 |
| 125 | #define KM_ETHSW_DDR_RST 12 |
| 126 | #define KM_CFE_RST 13 |
| 127 | #define KM_PEXSW_RST 14 |
| 128 | #define KM_PEXSW_NT_RST 15 |
| 129 | |
| 130 | /* QRIO GPIOs used for deblocking */ |
| 131 | #define KM_I2C_DEBLOCK_PORT QRIO_GPIO_A |
| 132 | #define KM_I2C_DEBLOCK_SCL 20 |
| 133 | #define KM_I2C_DEBLOCK_SDA 21 |
| 134 | |
| 135 | /* High Level Configuration Options */ |
| 136 | #define CONFIG_SYS_BOOK3E_HV /* Category E.HV supported */ |
| 137 | #define CONFIG_FSL_CORENET /* Freescale CoreNet platform */ |
| 138 | |
| 139 | #define CONFIG_RESET_VECTOR_ADDRESS 0xebfffffc |
| 140 | |
| 141 | #define CONFIG_SYS_FSL_CPC /* Corenet Platform Cache */ |
| 142 | #define CONFIG_SYS_NUM_CPC CONFIG_SYS_NUM_DDR_CTLRS |
Niel Fourie | 37bfd9c | 2021-01-21 13:19:20 +0100 | [diff] [blame] | 143 | |
| 144 | /* Environment in parallel NOR-Flash */ |
| 145 | #define CONFIG_ENV_TOTAL_SIZE 0x040000 |
| 146 | #define ENV_DEL_ADDR 0xebf00000 /*direct for newenv*/ |
| 147 | |
Niel Fourie | 37bfd9c | 2021-01-21 13:19:20 +0100 | [diff] [blame] | 148 | /* |
| 149 | * These can be toggled for performance analysis, otherwise use default. |
| 150 | */ |
| 151 | #define CONFIG_SYS_CACHE_STASHING |
Niel Fourie | 37bfd9c | 2021-01-21 13:19:20 +0100 | [diff] [blame] | 152 | #define CONFIG_SYS_INIT_L2CSR0 L2CSR0_L2E |
Niel Fourie | 37bfd9c | 2021-01-21 13:19:20 +0100 | [diff] [blame] | 153 | |
Niel Fourie | 37bfd9c | 2021-01-21 13:19:20 +0100 | [diff] [blame] | 154 | /* POST memory regions test */ |
| 155 | #define CONFIG_POST CONFIG_SYS_POST_MEM_REGIONS |
| 156 | |
| 157 | /* |
| 158 | * Config the L3 Cache as L3 SRAM |
| 159 | */ |
| 160 | #define CONFIG_SYS_INIT_L3_ADDR 0xFFFC0000 |
| 161 | #define CONFIG_SYS_L3_SIZE 256 << 10 |
| 162 | |
| 163 | #define CONFIG_SYS_DCSRBAR 0xf0000000 |
| 164 | #define CONFIG_SYS_DCSRBAR_PHYS 0xf00000000ull |
| 165 | |
| 166 | /* |
| 167 | * DDR Setup |
| 168 | */ |
| 169 | #define CONFIG_VERY_BIG_RAM |
| 170 | #define CONFIG_SYS_DDR_SDRAM_BASE 0x00000000 |
| 171 | #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE |
Niel Fourie | 37bfd9c | 2021-01-21 13:19:20 +0100 | [diff] [blame] | 172 | |
Niel Fourie | 37bfd9c | 2021-01-21 13:19:20 +0100 | [diff] [blame] | 173 | #define SPD_EEPROM_ADDRESS 0x54 |
| 174 | #define CONFIG_SYS_SDRAM_SIZE 4096 /* for fixed parameter use */ |
| 175 | |
Niel Fourie | 37bfd9c | 2021-01-21 13:19:20 +0100 | [diff] [blame] | 176 | /****************************************************************************** |
| 177 | * (PRAM usage) |
| 178 | * ... ------------------------------------------------------- |
| 179 | * ... |ROOTFSSIZE | PNVRAM |PHRAM |RESERVED_PRAM | END_OF_RAM |
| 180 | * ... |<------------------- pram -------------------------->| |
| 181 | * ... ------------------------------------------------------- |
| 182 | * @END_OF_RAM: |
| 183 | * @CONFIG_KM_RESERVED_PRAM: reserved pram for special purpose |
| 184 | * @CONFIG_KM_PHRAM: address for /var |
| 185 | * @CONFIG_KM_PNVRAM: address for PNVRAM (for the application) |
| 186 | * @CONFIG_KM_ROOTFSSIZE: address for rootfilesystem in RAM |
| 187 | */ |
| 188 | |
| 189 | /* size of rootfs in RAM */ |
| 190 | #define CONFIG_KM_ROOTFSSIZE 0x0 |
| 191 | /* set the default PRAM value to at least PNVRAM + PHRAM when pram env variable |
| 192 | * is not valid yet, which is the case for when u-boot copies itself to RAM |
| 193 | */ |
| 194 | #define CONFIG_PRAM ((CONFIG_KM_PNVRAM + CONFIG_KM_PHRAM) >> 10) |
| 195 | |
| 196 | /* |
| 197 | * IFC Definitions |
| 198 | */ |
| 199 | /* NOR flash on IFC CS0 */ |
| 200 | #define CONFIG_SYS_FLASH_BASE 0xe8000000 |
| 201 | #define CONFIG_SYS_FLASH_BASE_PHYS (0xf00000000ull | \ |
| 202 | CONFIG_SYS_FLASH_BASE) |
| 203 | |
| 204 | #define CONFIG_SYS_NOR_CSPR_EXT (0x0f) |
| 205 | #define CONFIG_SYS_NOR_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE) | \ |
| 206 | CSPR_PORT_SIZE_16 | /* Port size = 16 bit */\ |
| 207 | 0x00000010 | /* drive TE high */\ |
| 208 | CSPR_MSEL_NOR | /* MSEL = NOR */\ |
| 209 | CSPR_V) /* valid */ |
| 210 | #define CONFIG_SYS_NOR_AMASK IFC_AMASK(64 * 1024 * 1024) /* 64MB */ |
| 211 | #define CONFIG_SYS_NOR_CSOR (CSOR_NOR_AVD_TGL_PGM_EN | /* AVD toggle */\ |
| 212 | CSOR_NOR_TRHZ_20 | \ |
| 213 | CSOR_NOR_BCTLD) |
| 214 | |
| 215 | /* NOR Flash Timing Params */ |
| 216 | #define CONFIG_SYS_NOR_FTIM0 (FTIM0_NOR_TACSE(0x1) | \ |
| 217 | FTIM0_NOR_TEADC(0x7) | \ |
| 218 | FTIM0_NOR_TEAHC(0x1)) |
| 219 | #define CONFIG_SYS_NOR_FTIM1 (FTIM1_NOR_TACO(0x1) | \ |
| 220 | FTIM1_NOR_TRAD_NOR(0x21) | \ |
| 221 | FTIM1_NOR_TSEQRAD_NOR(0x21)) |
| 222 | #define CONFIG_SYS_NOR_FTIM2 (FTIM2_NOR_TCH(0x1) | \ |
| 223 | FTIM2_NOR_TCS(0x1) | \ |
| 224 | FTIM2_NOR_TWP(0xb) | \ |
| 225 | FTIM2_NOR_TWPH(0x6)) |
| 226 | #define CONFIG_SYS_NOR_FTIM3 0x0 |
| 227 | |
| 228 | #define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NOR_CSPR_EXT |
| 229 | #define CONFIG_SYS_CSPR0 CONFIG_SYS_NOR_CSPR |
| 230 | #define CONFIG_SYS_AMASK0 CONFIG_SYS_NOR_AMASK |
| 231 | #define CONFIG_SYS_CSOR0 CONFIG_SYS_NOR_CSOR |
| 232 | #define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NOR_FTIM0 |
| 233 | #define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NOR_FTIM1 |
| 234 | #define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NOR_FTIM2 |
| 235 | #define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NOR_FTIM3 |
| 236 | |
| 237 | /* More NOR Flash params */ |
| 238 | #define CONFIG_SYS_FLASH_QUIET_TEST |
| 239 | |
Niel Fourie | 37bfd9c | 2021-01-21 13:19:20 +0100 | [diff] [blame] | 240 | #define CONFIG_SYS_MAX_FLASH_SECT 512 /* sectors per device */ |
| 241 | |
| 242 | #define CONFIG_SYS_FLASH_EMPTY_INFO |
| 243 | #define CONFIG_SYS_FLASH_BANKS_LIST {CONFIG_SYS_FLASH_BASE_PHYS} |
| 244 | |
| 245 | /* NAND Flash on IFC CS1*/ |
Niel Fourie | 37bfd9c | 2021-01-21 13:19:20 +0100 | [diff] [blame] | 246 | #define CONFIG_SYS_NAND_BASE 0xfa000000 |
| 247 | #define CONFIG_SYS_NAND_BASE_PHYS (0xf00000000ull | CONFIG_SYS_NAND_BASE) |
| 248 | |
| 249 | #define CONFIG_SYS_NAND_CSPR_EXT (0x0f) |
| 250 | #define CONFIG_SYS_NAND_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_NAND_BASE) | \ |
| 251 | CSPR_PORT_SIZE_8 | /* Port Size = 8 bit */\ |
| 252 | 0x00000010 | /* drive TE high */\ |
| 253 | CSPR_MSEL_NAND | /* MSEL = NAND */\ |
| 254 | CSPR_V) /* valid */ |
| 255 | #define CONFIG_SYS_NAND_AMASK IFC_AMASK(64 * 1024) /* 64kB */ |
| 256 | |
| 257 | #define CONFIG_SYS_NAND_CSOR (CSOR_NAND_ECC_ENC_EN | /* ECC encoder on */ \ |
| 258 | CSOR_NAND_ECC_DEC_EN | /* ECC decoder on */ \ |
| 259 | CSOR_NAND_ECC_MODE_4 | /* 4-bit ECC */ \ |
| 260 | CSOR_NAND_RAL_3 | /* RAL = 3Bytes */ \ |
| 261 | CSOR_NAND_PGS_2K | /* Page size = 2K */ \ |
| 262 | CSOR_NAND_SPRZ_128 | /* Spare size = 128 */ \ |
| 263 | CSOR_NAND_PB(64) | /* 64 Pages/Block */ \ |
| 264 | CSOR_NAND_TRHZ_40 | /**/ \ |
| 265 | CSOR_NAND_BCTLD) /**/ |
| 266 | |
Niel Fourie | 37bfd9c | 2021-01-21 13:19:20 +0100 | [diff] [blame] | 267 | /* ONFI NAND Flash mode0 Timing Params */ |
| 268 | #define CONFIG_SYS_NAND_FTIM0 (FTIM0_NAND_TCCST(0x3) | \ |
| 269 | FTIM0_NAND_TWP(0x8) | \ |
| 270 | FTIM0_NAND_TWCHT(0x3) | \ |
| 271 | FTIM0_NAND_TWH(0x5)) |
| 272 | #define CONFIG_SYS_NAND_FTIM1 (FTIM1_NAND_TADLE(0x1e) | \ |
| 273 | FTIM1_NAND_TWBE(0x1e) | \ |
| 274 | FTIM1_NAND_TRR(0x6) | \ |
| 275 | FTIM1_NAND_TRP(0x8)) |
| 276 | #define CONFIG_SYS_NAND_FTIM2 (FTIM2_NAND_TRAD(0x9) | \ |
| 277 | FTIM2_NAND_TREH(0x5) | \ |
| 278 | FTIM2_NAND_TWHRE(0x3c)) |
| 279 | #define CONFIG_SYS_NAND_FTIM3 (FTIM3_NAND_TWW(0x1e)) |
| 280 | |
| 281 | #define CONFIG_SYS_CSPR1_EXT CONFIG_SYS_NAND_CSPR_EXT |
| 282 | #define CONFIG_SYS_CSPR1 CONFIG_SYS_NAND_CSPR |
| 283 | #define CONFIG_SYS_AMASK1 CONFIG_SYS_NAND_AMASK |
| 284 | #define CONFIG_SYS_CSOR1 CONFIG_SYS_NAND_CSOR |
| 285 | #define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NAND_FTIM0 |
| 286 | #define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NAND_FTIM1 |
| 287 | #define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NAND_FTIM2 |
| 288 | #define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NAND_FTIM3 |
| 289 | |
| 290 | /* More NAND Flash Params */ |
| 291 | #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE } |
| 292 | #define CONFIG_SYS_MAX_NAND_DEVICE 1 |
| 293 | |
| 294 | /* QRIO on IFC CS2 */ |
| 295 | #define CONFIG_SYS_QRIO_BASE 0xfb000000 |
| 296 | #define CONFIG_SYS_QRIO_BASE_PHYS (0xf00000000ull | CONFIG_SYS_QRIO_BASE) |
| 297 | #define SYS_QRIO_CSPR_EXT (0x0f) |
| 298 | #define SYS_QRIO_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_QRIO_BASE) | \ |
| 299 | CSPR_PORT_SIZE_8 | /* Port size = 8 bit */\ |
| 300 | 0x00000010 | /* drive TE high */\ |
| 301 | CSPR_MSEL_GPCM | /* MSEL = GPCM */\ |
| 302 | CSPR_V) /* valid */ |
| 303 | #define SYS_QRIO_AMASK IFC_AMASK(64 * 1024) /* 64kB */ |
| 304 | #define SYS_QRIO_CSOR (CSOR_GPCM_TRHZ_20 |\ |
| 305 | CSOR_GPCM_BCTLD) |
| 306 | /* QRIO Timing parameters for IFC CS2 */ |
| 307 | #define SYS_QRIO_FTIM0 (FTIM0_GPCM_TACSE(0x2) | \ |
| 308 | FTIM0_GPCM_TEADC(0x8) | \ |
| 309 | FTIM0_GPCM_TEAHC(0x2)) |
| 310 | #define SYS_QRIO_FTIM1 (FTIM1_GPCM_TACO(0x2) | \ |
| 311 | FTIM1_GPCM_TRAD(0x6)) |
| 312 | #define SYS_QRIO_FTIM2 (FTIM2_GPCM_TCS(0x1) | \ |
| 313 | FTIM2_GPCM_TCH(0x1) | \ |
| 314 | FTIM2_GPCM_TWP(0x7)) |
| 315 | #define SYS_QRIO_FTIM3 0x04000000 |
| 316 | #define CONFIG_SYS_CSPR2_EXT SYS_QRIO_CSPR_EXT |
| 317 | #define CONFIG_SYS_CSPR2 SYS_QRIO_CSPR |
| 318 | #define CONFIG_SYS_AMASK2 SYS_QRIO_AMASK |
| 319 | #define CONFIG_SYS_CSOR2 SYS_QRIO_CSOR |
| 320 | #define CONFIG_SYS_CS2_FTIM0 SYS_QRIO_FTIM0 |
| 321 | #define CONFIG_SYS_CS2_FTIM1 SYS_QRIO_FTIM1 |
| 322 | #define CONFIG_SYS_CS2_FTIM2 SYS_QRIO_FTIM2 |
| 323 | #define CONFIG_SYS_CS2_FTIM3 SYS_QRIO_FTIM3 |
| 324 | |
Niel Fourie | 37bfd9c | 2021-01-21 13:19:20 +0100 | [diff] [blame] | 325 | #define CONFIG_HWCONFIG |
| 326 | |
| 327 | /* define to use L1 as initial stack */ |
| 328 | #define CONFIG_SYS_INIT_RAM_LOCK |
| 329 | #define CONFIG_SYS_INIT_RAM_ADDR 0xfdd00000 /* Initial L1 address */ |
| 330 | #define CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH 0xf |
| 331 | #define CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW 0xfe03c000 |
| 332 | /* The assembler doesn't like typecast */ |
| 333 | #define CONFIG_SYS_INIT_RAM_ADDR_PHYS \ |
| 334 | ((CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH * 1ull << 32) | \ |
| 335 | CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW) |
| 336 | #define CONFIG_SYS_INIT_RAM_SIZE 0x00004000 |
| 337 | |
Tom Rini | 4c97c8c | 2022-05-24 14:14:02 -0400 | [diff] [blame] | 338 | #define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
Niel Fourie | 37bfd9c | 2021-01-21 13:19:20 +0100 | [diff] [blame] | 339 | |
Niel Fourie | 37bfd9c | 2021-01-21 13:19:20 +0100 | [diff] [blame] | 340 | #define CONFIG_SYS_MONITOR_LEN 0xc0000 /* 768k */ |
| 341 | |
Niel Fourie | 37bfd9c | 2021-01-21 13:19:20 +0100 | [diff] [blame] | 342 | /* |
| 343 | * Serial Port - controlled on board with jumper J8 |
| 344 | * open - index 2 |
| 345 | * shorted - index 1 |
| 346 | * Retain non-DM serial port for debug purposes. |
| 347 | */ |
| 348 | #if !defined(CONFIG_DM_SERIAL) |
Niel Fourie | 37bfd9c | 2021-01-21 13:19:20 +0100 | [diff] [blame] | 349 | #define CONFIG_SYS_NS16550_SERIAL |
| 350 | #define CONFIG_SYS_NS16550_REG_SIZE 1 |
| 351 | #define CONFIG_SYS_NS16550_CLK (get_bus_freq(0) / 2) |
| 352 | #define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_CCSRBAR + 0x11C500) |
| 353 | #endif |
| 354 | |
| 355 | #ifndef __ASSEMBLY__ |
| 356 | void set_sda(int state); |
| 357 | void set_scl(int state); |
| 358 | int get_sda(void); |
| 359 | int get_scl(void); |
| 360 | #endif |
| 361 | |
| 362 | /* |
| 363 | * General PCI |
| 364 | * Memory space is mapped 1-1, but I/O space must start from 0. |
| 365 | */ |
| 366 | /* controller 1 */ |
| 367 | #define CONFIG_SYS_PCIE1_MEM_VIRT 0x80000000 |
| 368 | #define CONFIG_SYS_PCIE1_MEM_PHYS 0xc00000000ull |
| 369 | #define CONFIG_SYS_PCIE1_IO_VIRT 0xf8000000 |
| 370 | #define CONFIG_SYS_PCIE1_IO_PHYS 0xff8000000ull |
| 371 | |
| 372 | #define CONFIG_SYS_BMAN_NUM_PORTALS 10 |
| 373 | #define CONFIG_SYS_BMAN_MEM_BASE 0xf4000000 |
| 374 | #define CONFIG_SYS_BMAN_MEM_PHYS 0xff4000000ull |
| 375 | #define CONFIG_SYS_BMAN_MEM_SIZE 0x02000000 |
| 376 | #define CONFIG_SYS_BMAN_SP_CINH_SIZE 0x1000 |
| 377 | #define CONFIG_SYS_BMAN_CENA_SIZE (CONFIG_SYS_BMAN_MEM_SIZE >> 1) |
| 378 | #define CONFIG_SYS_BMAN_CINH_BASE (CONFIG_SYS_BMAN_MEM_BASE + \ |
| 379 | CONFIG_SYS_BMAN_CENA_SIZE) |
| 380 | #define CONFIG_SYS_BMAN_CINH_SIZE (CONFIG_SYS_BMAN_MEM_SIZE >> 1) |
| 381 | #define CONFIG_SYS_BMAN_SWP_ISDR_REG 0xE08 |
| 382 | #define CONFIG_SYS_QMAN_NUM_PORTALS 10 |
| 383 | #define CONFIG_SYS_QMAN_MEM_BASE 0xf6000000 |
| 384 | #define CONFIG_SYS_QMAN_MEM_PHYS 0xff6000000ull |
| 385 | #define CONFIG_SYS_QMAN_MEM_SIZE 0x02000000 |
| 386 | #define CONFIG_SYS_QMAN_SP_CINH_SIZE 0x1000 |
| 387 | #define CONFIG_SYS_QMAN_CENA_SIZE (CONFIG_SYS_QMAN_MEM_SIZE >> 1) |
| 388 | #define CONFIG_SYS_QMAN_CINH_BASE (CONFIG_SYS_QMAN_MEM_BASE + \ |
| 389 | CONFIG_SYS_QMAN_CENA_SIZE) |
| 390 | #define CONFIG_SYS_QMAN_CINH_SIZE (CONFIG_SYS_QMAN_MEM_SIZE >> 1) |
| 391 | #define CONFIG_SYS_QMAN_SWP_ISDR_REG 0xE08 |
| 392 | |
| 393 | #define CONFIG_SYS_DPAA_FMAN |
| 394 | #define CONFIG_SYS_DPAA_PME |
| 395 | |
Niel Fourie | 37bfd9c | 2021-01-21 13:19:20 +0100 | [diff] [blame] | 396 | #define CONFIG_SYS_FDT_PAD (0x3000 + CONFIG_SYS_QE_FMAN_FW_LENGTH) |
| 397 | |
| 398 | /* Qman / Bman */ |
| 399 | /* RGMII (FM1@DTESC5) is local managemant interface */ |
| 400 | #define CONFIG_SYS_RGMII2_PHY_ADDR 0x11 |
Niel Fourie | 37bfd9c | 2021-01-21 13:19:20 +0100 | [diff] [blame] | 401 | |
| 402 | /* |
| 403 | * Hardware Watchdog |
| 404 | */ |
| 405 | #define CONFIG_WATCHDOG_PRESC 34 /* wdog prescaler 2^(64-34) ~10min */ |
| 406 | #define CONFIG_WATCHDOG_RC WRC_CHIP /* reset chip on watchdog event */ |
| 407 | |
| 408 | /* |
| 409 | * For booting Linux, the board info and command line data |
| 410 | * have to be in the first 64 MB of memory, since this is |
| 411 | * the maximum mapped by the Linux kernel during initialization. |
| 412 | */ |
| 413 | #define CONFIG_SYS_BOOTMAPSZ (64 << 20) /* Initial map for Linux*/ |
| 414 | #define CONFIG_SYS_BOOTM_LEN (64 << 20) /* Increase max gunzip size */ |
| 415 | |
| 416 | /* |
| 417 | * Environment Configuration |
| 418 | */ |
| 419 | #ifndef CONFIG_KM_DEF_ENV /* if not set by keymile-common.h */ |
| 420 | #define CONFIG_KM_DEF_ENV |
| 421 | #endif |
| 422 | |
| 423 | #define __USB_PHY_TYPE utmi |
| 424 | |
| 425 | #define CONFIG_KM_DEF_ENV_CPU \ |
| 426 | "boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \ |
| 427 | "cramfsloadfdt=" \ |
| 428 | "cramfsload ${fdt_addr_r} " \ |
| 429 | "fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \ |
| 430 | "u-boot=" CONFIG_HOSTNAME "/u-boot.bin\0" \ |
| 431 | "update=protect off " __stringify(CONFIG_SYS_MONITOR_BASE) \ |
| 432 | " +${filesize} && " \ |
| 433 | "erase " __stringify(CONFIG_SYS_MONITOR_BASE) \ |
| 434 | " +${filesize} && " \ |
| 435 | "cp.b ${load_addr_r} " \ |
| 436 | __stringify(CONFIG_SYS_MONITOR_BASE) " ${filesize} && " \ |
| 437 | "protect on " __stringify(CONFIG_SYS_MONITOR_BASE) \ |
| 438 | " +${filesize}\0" \ |
| 439 | "update-nor=protect off " __stringify(CONFIG_SYS_FLASH_BASE) \ |
| 440 | " +${filesize} && " \ |
| 441 | "erase " __stringify(CONFIG_SYS_FLASH_BASE) \ |
| 442 | " +${filesize} && " \ |
| 443 | "cp.b ${load_addr_r} " \ |
| 444 | __stringify(CONFIG_SYS_FLASH_BASE) " ${filesize} && " \ |
| 445 | "protect on " __stringify(CONFIG_SYS_MONITOR_BASE) \ |
| 446 | " +" __stringify(CONFIG_SYS_MONITOR_LEN) "\0" \ |
| 447 | "set_fdthigh=true\0" \ |
| 448 | "checkfdt=true\0" \ |
| 449 | "fpgacfg=true\0" \ |
| 450 | "" |
| 451 | |
| 452 | #define CONFIG_HW_ENV_SETTINGS \ |
| 453 | "hwconfig=fsl_ddr:ctlr_intlv=cacheline\0" \ |
| 454 | "usb_phy_type=" __stringify(__USB_PHY_TYPE) "\0" \ |
| 455 | "usb_dr_mode=host\0" |
| 456 | |
| 457 | #define CONFIG_KM_NEW_ENV \ |
| 458 | "newenv=protect off " __stringify(ENV_DEL_ADDR) \ |
| 459 | " +" __stringify(CONFIG_ENV_TOTAL_SIZE) " && " \ |
| 460 | "erase " __stringify(ENV_DEL_ADDR) \ |
| 461 | " +" __stringify(CONFIG_ENV_TOTAL_SIZE) " && " \ |
| 462 | "protect on " __stringify(ENV_DEL_ADDR) \ |
| 463 | " +" __stringify(CONFIG_ENV_TOTAL_SIZE) "\0" |
| 464 | |
| 465 | /* ppc_82xx is the equivalent to ppc_6xx, the generic ppc toolchain */ |
| 466 | #ifndef CONFIG_KM_DEF_ARCH |
| 467 | #define CONFIG_KM_DEF_ARCH "arch=ppc_82xx\0" |
| 468 | #endif |
| 469 | |
| 470 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 471 | CONFIG_KM_DEF_ENV \ |
| 472 | CONFIG_KM_DEF_ARCH \ |
| 473 | CONFIG_KM_NEW_ENV \ |
| 474 | CONFIG_HW_ENV_SETTINGS \ |
| 475 | "EEprom_ivm=pca9547:70:9\0" \ |
| 476 | "" |
| 477 | |
| 478 | #endif /* __KMCENT2_H */ |