183d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */ 2dd02936fSMingkai Hu /* 3dd02936fSMingkai Hu * Copyright 2016 Freescale Semiconductor 4dd02936fSMingkai Hu */ 5dd02936fSMingkai Hu 6dd02936fSMingkai Hu #ifndef __LS1046ARDB_H__ 7dd02936fSMingkai Hu #define __LS1046ARDB_H__ 8dd02936fSMingkai Hu 9dd02936fSMingkai Hu #include "ls1046a_common.h" 10dd02936fSMingkai Hu 11dd02936fSMingkai Hu #define CONFIG_SYS_CLK_FREQ 100000000 12dd02936fSMingkai Hu #define CONFIG_DDR_CLK_FREQ 100000000 13dd02936fSMingkai Hu 14dd02936fSMingkai Hu #define CONFIG_LAYERSCAPE_NS_ACCESS 15dd02936fSMingkai Hu #define CONFIG_MISC_INIT_R 16dd02936fSMingkai Hu 17dd02936fSMingkai Hu #define CONFIG_DIMM_SLOTS_PER_CTLR 1 18dd02936fSMingkai Hu /* Physical Memory Map */ 19dd02936fSMingkai Hu #define CONFIG_CHIP_SELECTS_PER_CTRL 4 20dd02936fSMingkai Hu #define CONFIG_NR_DRAM_BANKS 2 21dd02936fSMingkai Hu 22dd02936fSMingkai Hu #define CONFIG_DDR_SPD 23dd02936fSMingkai Hu #define SPD_EEPROM_ADDRESS 0x51 24dd02936fSMingkai Hu #define CONFIG_SYS_SPD_BUS_NUM 0 25dd02936fSMingkai Hu 26dd02936fSMingkai Hu #define CONFIG_DDR_ECC 27dd02936fSMingkai Hu #define CONFIG_ECC_INIT_VIA_DDRCONTROLLER 28dd02936fSMingkai Hu #define CONFIG_MEM_INIT_VALUE 0xdeadbeef 29dd02936fSMingkai Hu #define CONFIG_FSL_DDR_BIST /* enable built-in memory test */ 30dc760aedSHou Zhiqiang #ifndef CONFIG_SPL 31dd02936fSMingkai Hu #define CONFIG_FSL_DDR_INTERACTIVE /* Interactive debugging */ 32dc760aedSHou Zhiqiang #endif 33dd02936fSMingkai Hu 34dd02936fSMingkai Hu #ifdef CONFIG_SD_BOOT 35*038b965cSYork Sun #define CONFIG_SYS_FSL_PBL_PBI board/freescale/ls1046ardb/ls1046ardb_pbi.cfg 36dd02936fSMingkai Hu #ifdef CONFIG_EMMC_BOOT 37dd02936fSMingkai Hu #define CONFIG_SYS_FSL_PBL_RCW \ 38dd02936fSMingkai Hu board/freescale/ls1046ardb/ls1046ardb_rcw_emmc.cfg 39dd02936fSMingkai Hu #else 40dd02936fSMingkai Hu #define CONFIG_SYS_FSL_PBL_RCW board/freescale/ls1046ardb/ls1046ardb_rcw_sd.cfg 41dd02936fSMingkai Hu #endif 42*038b965cSYork Sun #elif defined(CONFIG_QSPI_BOOT) 43*038b965cSYork Sun #define CONFIG_SYS_FSL_PBL_RCW \ 44*038b965cSYork Sun board/freescale/ls1046ardb/ls1046ardb_rcw_qspi.cfg 45*038b965cSYork Sun #define CONFIG_SYS_FSL_PBL_PBI \ 46*038b965cSYork Sun board/freescale/ls1046ardb/ls1046ardb_qspi_pbi.cfg 47*038b965cSYork Sun #define CONFIG_SYS_UBOOT_BASE 0x40100000 48*038b965cSYork Sun #define CONFIG_SYS_SPL_ARGS_ADDR 0x90000000 49dd02936fSMingkai Hu #endif 50dd02936fSMingkai Hu 51a52ff334SSumit Garg #ifndef SPL_NO_IFC 52dd02936fSMingkai Hu /* IFC */ 53dd02936fSMingkai Hu #define CONFIG_FSL_IFC 54dd02936fSMingkai Hu /* 55dd02936fSMingkai Hu * NAND Flash Definitions 56dd02936fSMingkai Hu */ 57dd02936fSMingkai Hu #define CONFIG_NAND_FSL_IFC 58a52ff334SSumit Garg #endif 59dd02936fSMingkai Hu 60dd02936fSMingkai Hu #define CONFIG_SYS_NAND_BASE 0x7e800000 61dd02936fSMingkai Hu #define CONFIG_SYS_NAND_BASE_PHYS CONFIG_SYS_NAND_BASE 62dd02936fSMingkai Hu 63dd02936fSMingkai Hu #define CONFIG_SYS_NAND_CSPR_EXT (0x0) 64dd02936fSMingkai Hu #define CONFIG_SYS_NAND_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \ 65dd02936fSMingkai Hu | CSPR_PORT_SIZE_8 \ 66dd02936fSMingkai Hu | CSPR_MSEL_NAND \ 67dd02936fSMingkai Hu | CSPR_V) 68dd02936fSMingkai Hu #define CONFIG_SYS_NAND_AMASK IFC_AMASK(64 * 1024) 69dd02936fSMingkai Hu #define CONFIG_SYS_NAND_CSOR (CSOR_NAND_ECC_ENC_EN /* ECC on encode */ \ 70dd02936fSMingkai Hu | CSOR_NAND_ECC_DEC_EN /* ECC on decode */ \ 71dd02936fSMingkai Hu | CSOR_NAND_ECC_MODE_8 /* 8-bit ECC */ \ 72dd02936fSMingkai Hu | CSOR_NAND_RAL_3 /* RAL = 3 Bytes */ \ 73dd02936fSMingkai Hu | CSOR_NAND_PGS_4K /* Page Size = 4K */ \ 74dd02936fSMingkai Hu | CSOR_NAND_SPRZ_224 /* Spare size = 224 */ \ 75dd02936fSMingkai Hu | CSOR_NAND_PB(64)) /* 64 Pages Per Block */ 76dd02936fSMingkai Hu 77dd02936fSMingkai Hu #define CONFIG_SYS_NAND_ONFI_DETECTION 78dd02936fSMingkai Hu 79dd02936fSMingkai Hu #define CONFIG_SYS_NAND_FTIM0 (FTIM0_NAND_TCCST(0x7) | \ 80dd02936fSMingkai Hu FTIM0_NAND_TWP(0x18) | \ 81dd02936fSMingkai Hu FTIM0_NAND_TWCHT(0x7) | \ 82dd02936fSMingkai Hu FTIM0_NAND_TWH(0xa)) 83dd02936fSMingkai Hu #define CONFIG_SYS_NAND_FTIM1 (FTIM1_NAND_TADLE(0x32) | \ 84dd02936fSMingkai Hu FTIM1_NAND_TWBE(0x39) | \ 85dd02936fSMingkai Hu FTIM1_NAND_TRR(0xe) | \ 86dd02936fSMingkai Hu FTIM1_NAND_TRP(0x18)) 87dd02936fSMingkai Hu #define CONFIG_SYS_NAND_FTIM2 (FTIM2_NAND_TRAD(0xf) | \ 88dd02936fSMingkai Hu FTIM2_NAND_TREH(0xa) | \ 89dd02936fSMingkai Hu FTIM2_NAND_TWHRE(0x1e)) 90dd02936fSMingkai Hu #define CONFIG_SYS_NAND_FTIM3 0x0 91dd02936fSMingkai Hu 92dd02936fSMingkai Hu #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE } 93dd02936fSMingkai Hu #define CONFIG_SYS_MAX_NAND_DEVICE 1 94dd02936fSMingkai Hu #define CONFIG_MTD_NAND_VERIFY_WRITE 95dd02936fSMingkai Hu 96dd02936fSMingkai Hu #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024) 97dd02936fSMingkai Hu 98dd02936fSMingkai Hu /* 99dd02936fSMingkai Hu * CPLD 100dd02936fSMingkai Hu */ 101dd02936fSMingkai Hu #define CONFIG_SYS_CPLD_BASE 0x7fb00000 102dd02936fSMingkai Hu #define CPLD_BASE_PHYS CONFIG_SYS_CPLD_BASE 103dd02936fSMingkai Hu 104dd02936fSMingkai Hu #define CONFIG_SYS_CPLD_CSPR_EXT (0x0) 105dd02936fSMingkai Hu #define CONFIG_SYS_CPLD_CSPR (CSPR_PHYS_ADDR(CPLD_BASE_PHYS) | \ 106dd02936fSMingkai Hu CSPR_PORT_SIZE_8 | \ 107dd02936fSMingkai Hu CSPR_MSEL_GPCM | \ 108dd02936fSMingkai Hu CSPR_V) 109dd02936fSMingkai Hu #define CONFIG_SYS_CPLD_AMASK IFC_AMASK(64 * 1024) 110dd02936fSMingkai Hu #define CONFIG_SYS_CPLD_CSOR CSOR_NOR_ADM_SHIFT(16) 111dd02936fSMingkai Hu 112dd02936fSMingkai Hu /* CPLD Timing parameters for IFC GPCM */ 113dd02936fSMingkai Hu #define CONFIG_SYS_CPLD_FTIM0 (FTIM0_GPCM_TACSE(0x0e) | \ 114dd02936fSMingkai Hu FTIM0_GPCM_TEADC(0x0e) | \ 115dd02936fSMingkai Hu FTIM0_GPCM_TEAHC(0x0e)) 116dd02936fSMingkai Hu #define CONFIG_SYS_CPLD_FTIM1 (FTIM1_GPCM_TACO(0xff) | \ 117dd02936fSMingkai Hu FTIM1_GPCM_TRAD(0x3f)) 118dd02936fSMingkai Hu #define CONFIG_SYS_CPLD_FTIM2 (FTIM2_GPCM_TCS(0xf) | \ 119dd02936fSMingkai Hu FTIM2_GPCM_TCH(0xf) | \ 120dd02936fSMingkai Hu FTIM2_GPCM_TWP(0x3E)) 121dd02936fSMingkai Hu #define CONFIG_SYS_CPLD_FTIM3 0x0 122dd02936fSMingkai Hu 123dd02936fSMingkai Hu /* IFC Timing Params */ 124dd02936fSMingkai Hu #define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NAND_CSPR_EXT 125dd02936fSMingkai Hu #define CONFIG_SYS_CSPR0 CONFIG_SYS_NAND_CSPR 126dd02936fSMingkai Hu #define CONFIG_SYS_AMASK0 CONFIG_SYS_NAND_AMASK 127dd02936fSMingkai Hu #define CONFIG_SYS_CSOR0 CONFIG_SYS_NAND_CSOR 128dd02936fSMingkai Hu #define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NAND_FTIM0 129dd02936fSMingkai Hu #define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NAND_FTIM1 130dd02936fSMingkai Hu #define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NAND_FTIM2 131dd02936fSMingkai Hu #define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NAND_FTIM3 132dd02936fSMingkai Hu 133dd02936fSMingkai Hu #define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_CPLD_CSPR_EXT 134dd02936fSMingkai Hu #define CONFIG_SYS_CSPR2 CONFIG_SYS_CPLD_CSPR 135dd02936fSMingkai Hu #define CONFIG_SYS_AMASK2 CONFIG_SYS_CPLD_AMASK 136dd02936fSMingkai Hu #define CONFIG_SYS_CSOR2 CONFIG_SYS_CPLD_CSOR 137dd02936fSMingkai Hu #define CONFIG_SYS_CS2_FTIM0 CONFIG_SYS_CPLD_FTIM0 138dd02936fSMingkai Hu #define CONFIG_SYS_CS2_FTIM1 CONFIG_SYS_CPLD_FTIM1 139dd02936fSMingkai Hu #define CONFIG_SYS_CS2_FTIM2 CONFIG_SYS_CPLD_FTIM2 140dd02936fSMingkai Hu #define CONFIG_SYS_CS2_FTIM3 CONFIG_SYS_CPLD_FTIM3 141dd02936fSMingkai Hu 142dd02936fSMingkai Hu /* EEPROM */ 143dd02936fSMingkai Hu #define CONFIG_ID_EEPROM 144dd02936fSMingkai Hu #define CONFIG_SYS_I2C_EEPROM_NXID 145dd02936fSMingkai Hu #define CONFIG_SYS_EEPROM_BUS_NUM 0 146dd02936fSMingkai Hu #define CONFIG_SYS_I2C_EEPROM_ADDR 0x53 147dd02936fSMingkai Hu #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 148dd02936fSMingkai Hu #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3 149dd02936fSMingkai Hu #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5 150dd02936fSMingkai Hu #define I2C_RETIMER_ADDR 0x18 151dd02936fSMingkai Hu 152dccef2ecSHou Zhiqiang /* PMIC */ 153dccef2ecSHou Zhiqiang #define CONFIG_POWER 154dccef2ecSHou Zhiqiang #ifdef CONFIG_POWER 155dccef2ecSHou Zhiqiang #define CONFIG_POWER_I2C 156dccef2ecSHou Zhiqiang #endif 157dccef2ecSHou Zhiqiang 158dd02936fSMingkai Hu /* 159dd02936fSMingkai Hu * Environment 160dd02936fSMingkai Hu */ 161a52ff334SSumit Garg #ifndef SPL_NO_ENV 162dd02936fSMingkai Hu #define CONFIG_ENV_OVERWRITE 163a52ff334SSumit Garg #endif 164dd02936fSMingkai Hu 165dd02936fSMingkai Hu #if defined(CONFIG_SD_BOOT) 166dd02936fSMingkai Hu #define CONFIG_SYS_MMC_ENV_DEV 0 1678104deb2SAlison Wang #define CONFIG_ENV_OFFSET (3 * 1024 * 1024) 168dd02936fSMingkai Hu #define CONFIG_ENV_SIZE 0x2000 169dd02936fSMingkai Hu #else 170dd02936fSMingkai Hu #define CONFIG_ENV_SIZE 0x2000 /* 8KB */ 1718104deb2SAlison Wang #define CONFIG_ENV_OFFSET 0x300000 /* 3MB */ 172dd02936fSMingkai Hu #define CONFIG_ENV_SECT_SIZE 0x40000 /* 256KB */ 173dd02936fSMingkai Hu #endif 174dd02936fSMingkai Hu 17599b47c25SYork Sun #define AQR105_IRQ_MASK 0x80000000 176dd02936fSMingkai Hu /* FMan */ 177a52ff334SSumit Garg #ifndef SPL_NO_FMAN 17899b47c25SYork Sun 17999b47c25SYork Sun #ifdef CONFIG_NET 18099b47c25SYork Sun #define CONFIG_PHY_REALTEK 18199b47c25SYork Sun #endif 18299b47c25SYork Sun 183dd02936fSMingkai Hu #ifdef CONFIG_SYS_DPAA_FMAN 184dd02936fSMingkai Hu #define CONFIG_FMAN_ENET 185dd02936fSMingkai Hu #define CONFIG_PHY_AQUANTIA 18699b47c25SYork Sun #define CONFIG_PHYLIB_10G 187dd02936fSMingkai Hu #define RGMII_PHY1_ADDR 0x1 188dd02936fSMingkai Hu #define RGMII_PHY2_ADDR 0x2 189dd02936fSMingkai Hu 190dd02936fSMingkai Hu #define SGMII_PHY1_ADDR 0x3 191dd02936fSMingkai Hu #define SGMII_PHY2_ADDR 0x4 192dd02936fSMingkai Hu 193dd02936fSMingkai Hu #define FM1_10GEC1_PHY_ADDR 0x0 194dd02936fSMingkai Hu 1954ace3040SPrabhakar Kushwaha #define FDT_SEQ_MACADDR_FROM_ENV 1964ace3040SPrabhakar Kushwaha 197dd02936fSMingkai Hu #define CONFIG_ETHPRIME "FM1@DTSEC3" 198dd02936fSMingkai Hu #endif 19999b47c25SYork Sun 200a52ff334SSumit Garg #endif 201dd02936fSMingkai Hu 202dd02936fSMingkai Hu /* QSPI device */ 203a52ff334SSumit Garg #ifndef SPL_NO_QSPI 204dd02936fSMingkai Hu #ifdef CONFIG_FSL_QSPI 205dd02936fSMingkai Hu #define CONFIG_SPI_FLASH_SPANSION 206dd02936fSMingkai Hu #define FSL_QSPI_FLASH_SIZE (1 << 26) 207dd02936fSMingkai Hu #define FSL_QSPI_FLASH_NUM 2 208dd02936fSMingkai Hu #endif 209a52ff334SSumit Garg #endif 210dd02936fSMingkai Hu 211a52ff334SSumit Garg #ifndef SPL_NO_MISC 2128de227eeSQianyu Gong #undef CONFIG_BOOTCOMMAND 213aab2ef9aSShengzhou Liu #if defined(CONFIG_QSPI_BOOT) 2149b457cc6SVinitha Pillai-B57223 #define CONFIG_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; " \ 2159b457cc6SVinitha Pillai-B57223 "env exists secureboot && esbc_halt;;" 216aab2ef9aSShengzhou Liu #elif defined(CONFIG_SD_BOOT) 2179b457cc6SVinitha Pillai-B57223 #define CONFIG_BOOTCOMMAND "run distro_bootcmd;run sd_bootcmd; " \ 2189b457cc6SVinitha Pillai-B57223 "env exists secureboot && esbc_halt;" 219aab2ef9aSShengzhou Liu #endif 220a52ff334SSumit Garg #endif 221dd02936fSMingkai Hu 222f7244f2cSVinitha Pillai-B57223 #include <asm/fsl_secure_boot.h> 223f7244f2cSVinitha Pillai-B57223 224dd02936fSMingkai Hu #endif /* __LS1046ARDB_H__ */ 225