1dd02936fSMingkai Hu /* 2dd02936fSMingkai Hu * Copyright 2016 Freescale Semiconductor 3dd02936fSMingkai Hu * 4dd02936fSMingkai Hu * SPDX-License-Identifier: GPL-2.0+ 5dd02936fSMingkai Hu */ 6dd02936fSMingkai Hu 7dd02936fSMingkai Hu #ifndef __LS1046ARDB_H__ 8dd02936fSMingkai Hu #define __LS1046ARDB_H__ 9dd02936fSMingkai Hu 10dd02936fSMingkai Hu #include "ls1046a_common.h" 11dd02936fSMingkai Hu 12dd02936fSMingkai Hu #ifdef CONFIG_SD_BOOT 13dd02936fSMingkai Hu #define CONFIG_SYS_TEXT_BASE 0x82000000 14dd02936fSMingkai Hu #else 15dd02936fSMingkai Hu #define CONFIG_SYS_TEXT_BASE 0x40100000 16dd02936fSMingkai Hu #endif 17dd02936fSMingkai Hu 18dd02936fSMingkai Hu #define CONFIG_SYS_CLK_FREQ 100000000 19dd02936fSMingkai Hu #define CONFIG_DDR_CLK_FREQ 100000000 20dd02936fSMingkai Hu 21dd02936fSMingkai Hu #define CONFIG_LAYERSCAPE_NS_ACCESS 22dd02936fSMingkai Hu #define CONFIG_MISC_INIT_R 23dd02936fSMingkai Hu 24dd02936fSMingkai Hu #define CONFIG_DIMM_SLOTS_PER_CTLR 1 25dd02936fSMingkai Hu /* Physical Memory Map */ 26dd02936fSMingkai Hu #define CONFIG_CHIP_SELECTS_PER_CTRL 4 27dd02936fSMingkai Hu #define CONFIG_NR_DRAM_BANKS 2 28dd02936fSMingkai Hu 29dd02936fSMingkai Hu #define CONFIG_DDR_SPD 30dd02936fSMingkai Hu #define SPD_EEPROM_ADDRESS 0x51 31dd02936fSMingkai Hu #define CONFIG_SYS_SPD_BUS_NUM 0 32dd02936fSMingkai Hu 33dd02936fSMingkai Hu #define CONFIG_DDR_ECC 34dd02936fSMingkai Hu #define CONFIG_ECC_INIT_VIA_DDRCONTROLLER 35dd02936fSMingkai Hu #define CONFIG_MEM_INIT_VALUE 0xdeadbeef 36dd02936fSMingkai Hu #define CONFIG_FSL_DDR_BIST /* enable built-in memory test */ 37dc760aedSHou Zhiqiang #ifndef CONFIG_SPL 38dd02936fSMingkai Hu #define CONFIG_FSL_DDR_INTERACTIVE /* Interactive debugging */ 39dc760aedSHou Zhiqiang #endif 40dd02936fSMingkai Hu 41dd02936fSMingkai Hu #ifdef CONFIG_RAMBOOT_PBL 42dd02936fSMingkai Hu #define CONFIG_SYS_FSL_PBL_PBI board/freescale/ls1046ardb/ls1046ardb_pbi.cfg 43dd02936fSMingkai Hu #endif 44dd02936fSMingkai Hu 45dd02936fSMingkai Hu #ifdef CONFIG_SD_BOOT 46dd02936fSMingkai Hu #ifdef CONFIG_EMMC_BOOT 47dd02936fSMingkai Hu #define CONFIG_SYS_FSL_PBL_RCW \ 48dd02936fSMingkai Hu board/freescale/ls1046ardb/ls1046ardb_rcw_emmc.cfg 49dd02936fSMingkai Hu #else 50dd02936fSMingkai Hu #define CONFIG_SYS_FSL_PBL_RCW board/freescale/ls1046ardb/ls1046ardb_rcw_sd.cfg 51dd02936fSMingkai Hu #endif 52dd02936fSMingkai Hu #endif 53dd02936fSMingkai Hu 54a52ff334SSumit Garg #ifndef SPL_NO_IFC 55dd02936fSMingkai Hu /* IFC */ 56dd02936fSMingkai Hu #define CONFIG_FSL_IFC 57dd02936fSMingkai Hu /* 58dd02936fSMingkai Hu * NAND Flash Definitions 59dd02936fSMingkai Hu */ 60dd02936fSMingkai Hu #define CONFIG_NAND_FSL_IFC 61a52ff334SSumit Garg #endif 62dd02936fSMingkai Hu 63dd02936fSMingkai Hu #define CONFIG_SYS_NAND_BASE 0x7e800000 64dd02936fSMingkai Hu #define CONFIG_SYS_NAND_BASE_PHYS CONFIG_SYS_NAND_BASE 65dd02936fSMingkai Hu 66dd02936fSMingkai Hu #define CONFIG_SYS_NAND_CSPR_EXT (0x0) 67dd02936fSMingkai Hu #define CONFIG_SYS_NAND_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \ 68dd02936fSMingkai Hu | CSPR_PORT_SIZE_8 \ 69dd02936fSMingkai Hu | CSPR_MSEL_NAND \ 70dd02936fSMingkai Hu | CSPR_V) 71dd02936fSMingkai Hu #define CONFIG_SYS_NAND_AMASK IFC_AMASK(64 * 1024) 72dd02936fSMingkai Hu #define CONFIG_SYS_NAND_CSOR (CSOR_NAND_ECC_ENC_EN /* ECC on encode */ \ 73dd02936fSMingkai Hu | CSOR_NAND_ECC_DEC_EN /* ECC on decode */ \ 74dd02936fSMingkai Hu | CSOR_NAND_ECC_MODE_8 /* 8-bit ECC */ \ 75dd02936fSMingkai Hu | CSOR_NAND_RAL_3 /* RAL = 3 Bytes */ \ 76dd02936fSMingkai Hu | CSOR_NAND_PGS_4K /* Page Size = 4K */ \ 77dd02936fSMingkai Hu | CSOR_NAND_SPRZ_224 /* Spare size = 224 */ \ 78dd02936fSMingkai Hu | CSOR_NAND_PB(64)) /* 64 Pages Per Block */ 79dd02936fSMingkai Hu 80dd02936fSMingkai Hu #define CONFIG_SYS_NAND_ONFI_DETECTION 81dd02936fSMingkai Hu 82dd02936fSMingkai Hu #define CONFIG_SYS_NAND_FTIM0 (FTIM0_NAND_TCCST(0x7) | \ 83dd02936fSMingkai Hu FTIM0_NAND_TWP(0x18) | \ 84dd02936fSMingkai Hu FTIM0_NAND_TWCHT(0x7) | \ 85dd02936fSMingkai Hu FTIM0_NAND_TWH(0xa)) 86dd02936fSMingkai Hu #define CONFIG_SYS_NAND_FTIM1 (FTIM1_NAND_TADLE(0x32) | \ 87dd02936fSMingkai Hu FTIM1_NAND_TWBE(0x39) | \ 88dd02936fSMingkai Hu FTIM1_NAND_TRR(0xe) | \ 89dd02936fSMingkai Hu FTIM1_NAND_TRP(0x18)) 90dd02936fSMingkai Hu #define CONFIG_SYS_NAND_FTIM2 (FTIM2_NAND_TRAD(0xf) | \ 91dd02936fSMingkai Hu FTIM2_NAND_TREH(0xa) | \ 92dd02936fSMingkai Hu FTIM2_NAND_TWHRE(0x1e)) 93dd02936fSMingkai Hu #define CONFIG_SYS_NAND_FTIM3 0x0 94dd02936fSMingkai Hu 95dd02936fSMingkai Hu #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE } 96dd02936fSMingkai Hu #define CONFIG_SYS_MAX_NAND_DEVICE 1 97dd02936fSMingkai Hu #define CONFIG_MTD_NAND_VERIFY_WRITE 98dd02936fSMingkai Hu #define CONFIG_CMD_NAND 99dd02936fSMingkai Hu 100dd02936fSMingkai Hu #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024) 101dd02936fSMingkai Hu 102dd02936fSMingkai Hu /* 103dd02936fSMingkai Hu * CPLD 104dd02936fSMingkai Hu */ 105dd02936fSMingkai Hu #define CONFIG_SYS_CPLD_BASE 0x7fb00000 106dd02936fSMingkai Hu #define CPLD_BASE_PHYS CONFIG_SYS_CPLD_BASE 107dd02936fSMingkai Hu 108dd02936fSMingkai Hu #define CONFIG_SYS_CPLD_CSPR_EXT (0x0) 109dd02936fSMingkai Hu #define CONFIG_SYS_CPLD_CSPR (CSPR_PHYS_ADDR(CPLD_BASE_PHYS) | \ 110dd02936fSMingkai Hu CSPR_PORT_SIZE_8 | \ 111dd02936fSMingkai Hu CSPR_MSEL_GPCM | \ 112dd02936fSMingkai Hu CSPR_V) 113dd02936fSMingkai Hu #define CONFIG_SYS_CPLD_AMASK IFC_AMASK(64 * 1024) 114dd02936fSMingkai Hu #define CONFIG_SYS_CPLD_CSOR CSOR_NOR_ADM_SHIFT(16) 115dd02936fSMingkai Hu 116dd02936fSMingkai Hu /* CPLD Timing parameters for IFC GPCM */ 117dd02936fSMingkai Hu #define CONFIG_SYS_CPLD_FTIM0 (FTIM0_GPCM_TACSE(0x0e) | \ 118dd02936fSMingkai Hu FTIM0_GPCM_TEADC(0x0e) | \ 119dd02936fSMingkai Hu FTIM0_GPCM_TEAHC(0x0e)) 120dd02936fSMingkai Hu #define CONFIG_SYS_CPLD_FTIM1 (FTIM1_GPCM_TACO(0xff) | \ 121dd02936fSMingkai Hu FTIM1_GPCM_TRAD(0x3f)) 122dd02936fSMingkai Hu #define CONFIG_SYS_CPLD_FTIM2 (FTIM2_GPCM_TCS(0xf) | \ 123dd02936fSMingkai Hu FTIM2_GPCM_TCH(0xf) | \ 124dd02936fSMingkai Hu FTIM2_GPCM_TWP(0x3E)) 125dd02936fSMingkai Hu #define CONFIG_SYS_CPLD_FTIM3 0x0 126dd02936fSMingkai Hu 127dd02936fSMingkai Hu /* IFC Timing Params */ 128dd02936fSMingkai Hu #define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NAND_CSPR_EXT 129dd02936fSMingkai Hu #define CONFIG_SYS_CSPR0 CONFIG_SYS_NAND_CSPR 130dd02936fSMingkai Hu #define CONFIG_SYS_AMASK0 CONFIG_SYS_NAND_AMASK 131dd02936fSMingkai Hu #define CONFIG_SYS_CSOR0 CONFIG_SYS_NAND_CSOR 132dd02936fSMingkai Hu #define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NAND_FTIM0 133dd02936fSMingkai Hu #define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NAND_FTIM1 134dd02936fSMingkai Hu #define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NAND_FTIM2 135dd02936fSMingkai Hu #define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NAND_FTIM3 136dd02936fSMingkai Hu 137dd02936fSMingkai Hu #define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_CPLD_CSPR_EXT 138dd02936fSMingkai Hu #define CONFIG_SYS_CSPR2 CONFIG_SYS_CPLD_CSPR 139dd02936fSMingkai Hu #define CONFIG_SYS_AMASK2 CONFIG_SYS_CPLD_AMASK 140dd02936fSMingkai Hu #define CONFIG_SYS_CSOR2 CONFIG_SYS_CPLD_CSOR 141dd02936fSMingkai Hu #define CONFIG_SYS_CS2_FTIM0 CONFIG_SYS_CPLD_FTIM0 142dd02936fSMingkai Hu #define CONFIG_SYS_CS2_FTIM1 CONFIG_SYS_CPLD_FTIM1 143dd02936fSMingkai Hu #define CONFIG_SYS_CS2_FTIM2 CONFIG_SYS_CPLD_FTIM2 144dd02936fSMingkai Hu #define CONFIG_SYS_CS2_FTIM3 CONFIG_SYS_CPLD_FTIM3 145dd02936fSMingkai Hu 146dd02936fSMingkai Hu /* EEPROM */ 147dd02936fSMingkai Hu #define CONFIG_ID_EEPROM 148dd02936fSMingkai Hu #define CONFIG_SYS_I2C_EEPROM_NXID 149dd02936fSMingkai Hu #define CONFIG_SYS_EEPROM_BUS_NUM 0 150dd02936fSMingkai Hu #define CONFIG_SYS_I2C_EEPROM_ADDR 0x53 151dd02936fSMingkai Hu #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 152dd02936fSMingkai Hu #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3 153dd02936fSMingkai Hu #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5 154dd02936fSMingkai Hu #define I2C_RETIMER_ADDR 0x18 155dd02936fSMingkai Hu 156dccef2ecSHou Zhiqiang /* PMIC */ 157dccef2ecSHou Zhiqiang #define CONFIG_POWER 158dccef2ecSHou Zhiqiang #ifdef CONFIG_POWER 159dccef2ecSHou Zhiqiang #define CONFIG_POWER_I2C 160dccef2ecSHou Zhiqiang #endif 161dccef2ecSHou Zhiqiang 162dd02936fSMingkai Hu /* 163dd02936fSMingkai Hu * Environment 164dd02936fSMingkai Hu */ 165a52ff334SSumit Garg #ifndef SPL_NO_ENV 166dd02936fSMingkai Hu #define CONFIG_ENV_OVERWRITE 167a52ff334SSumit Garg #endif 168dd02936fSMingkai Hu 169dd02936fSMingkai Hu #if defined(CONFIG_SD_BOOT) 170dd02936fSMingkai Hu #define CONFIG_SYS_MMC_ENV_DEV 0 1718104deb2SAlison Wang #define CONFIG_ENV_OFFSET (3 * 1024 * 1024) 172dd02936fSMingkai Hu #define CONFIG_ENV_SIZE 0x2000 173dd02936fSMingkai Hu #else 174dd02936fSMingkai Hu #define CONFIG_ENV_SIZE 0x2000 /* 8KB */ 1758104deb2SAlison Wang #define CONFIG_ENV_OFFSET 0x300000 /* 3MB */ 176dd02936fSMingkai Hu #define CONFIG_ENV_SECT_SIZE 0x40000 /* 256KB */ 177dd02936fSMingkai Hu #endif 178dd02936fSMingkai Hu 17999b47c25SYork Sun #define AQR105_IRQ_MASK 0x80000000 180dd02936fSMingkai Hu /* FMan */ 181a52ff334SSumit Garg #ifndef SPL_NO_FMAN 18299b47c25SYork Sun 18399b47c25SYork Sun #ifdef CONFIG_NET 18499b47c25SYork Sun #define CONFIG_PHYLIB 18599b47c25SYork Sun #define CONFIG_PHY_GIGE /* Include GbE speed/duplex detection */ 18699b47c25SYork Sun #define CONFIG_PHY_REALTEK 18799b47c25SYork Sun #endif 18899b47c25SYork Sun 189dd02936fSMingkai Hu #ifdef CONFIG_SYS_DPAA_FMAN 190dd02936fSMingkai Hu #define CONFIG_FMAN_ENET 191dd02936fSMingkai Hu #define CONFIG_PHY_AQUANTIA 19299b47c25SYork Sun #define CONFIG_PHYLIB_10G 193dd02936fSMingkai Hu #define RGMII_PHY1_ADDR 0x1 194dd02936fSMingkai Hu #define RGMII_PHY2_ADDR 0x2 195dd02936fSMingkai Hu 196dd02936fSMingkai Hu #define SGMII_PHY1_ADDR 0x3 197dd02936fSMingkai Hu #define SGMII_PHY2_ADDR 0x4 198dd02936fSMingkai Hu 199dd02936fSMingkai Hu #define FM1_10GEC1_PHY_ADDR 0x0 200dd02936fSMingkai Hu 201dd02936fSMingkai Hu #define CONFIG_ETHPRIME "FM1@DTSEC3" 202dd02936fSMingkai Hu #endif 20399b47c25SYork Sun 204a52ff334SSumit Garg #endif 205dd02936fSMingkai Hu 206dd02936fSMingkai Hu /* QSPI device */ 207a52ff334SSumit Garg #ifndef SPL_NO_QSPI 208dd02936fSMingkai Hu #ifdef CONFIG_FSL_QSPI 209dd02936fSMingkai Hu #define CONFIG_SPI_FLASH_SPANSION 210dd02936fSMingkai Hu #define FSL_QSPI_FLASH_SIZE (1 << 26) 211dd02936fSMingkai Hu #define FSL_QSPI_FLASH_NUM 2 212dd02936fSMingkai Hu #endif 213a52ff334SSumit Garg #endif 214dd02936fSMingkai Hu 21597205eeaSjerry.huang@nxp.com /* USB */ 216a52ff334SSumit Garg #ifndef SPL_NO_USB 21797205eeaSjerry.huang@nxp.com #define CONFIG_HAS_FSL_XHCI_USB 21897205eeaSjerry.huang@nxp.com #ifdef CONFIG_HAS_FSL_XHCI_USB 21997205eeaSjerry.huang@nxp.com #define CONFIG_USB_XHCI_HCD 22097205eeaSjerry.huang@nxp.com #define CONFIG_USB_XHCI_FSL 22197205eeaSjerry.huang@nxp.com #define CONFIG_USB_XHCI_DWC3 22297205eeaSjerry.huang@nxp.com #define CONFIG_USB_MAX_CONTROLLER_COUNT 3 22397205eeaSjerry.huang@nxp.com #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 2 22497205eeaSjerry.huang@nxp.com #define CONFIG_USB_STORAGE 22597205eeaSjerry.huang@nxp.com #endif 226a52ff334SSumit Garg #endif 22797205eeaSjerry.huang@nxp.com 228dd02936fSMingkai Hu /* SATA */ 229a52ff334SSumit Garg #ifndef SPL_NO_SATA 230dd02936fSMingkai Hu #define CONFIG_LIBATA 231dd02936fSMingkai Hu #define CONFIG_SCSI_AHCI 232dd02936fSMingkai Hu #define CONFIG_SCSI_AHCI_PLAT 233dd02936fSMingkai Hu 234dd02936fSMingkai Hu #define CONFIG_SYS_SATA AHCI_BASE_ADDR 235dd02936fSMingkai Hu 236dd02936fSMingkai Hu #define CONFIG_SYS_SCSI_MAX_SCSI_ID 1 237dd02936fSMingkai Hu #define CONFIG_SYS_SCSI_MAX_LUN 1 238dd02936fSMingkai Hu #define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \ 239dd02936fSMingkai Hu CONFIG_SYS_SCSI_MAX_LUN) 240a52ff334SSumit Garg #endif 2419e0bb4c1SPrabhakar Kushwaha 242a52ff334SSumit Garg #ifndef SPL_NO_MISC 2438de227eeSQianyu Gong #undef CONFIG_BOOTCOMMAND 244*f7b75f8bSSumit Garg #define CONFIG_BOOTCOMMAND "run distro_bootcmd; env exists secureboot" \ 245*f7b75f8bSSumit Garg "&& esbc_halt; run qspi_bootcmd;" 246dd02936fSMingkai Hu #define MTDPARTS_DEFAULT "mtdparts=1550000.quadspi:1m(rcw)," \ 247dd02936fSMingkai Hu "15m(u-boot),48m(kernel.itb);" \ 248dd02936fSMingkai Hu "7e800000.flash:16m(nand_uboot)," \ 249dd02936fSMingkai Hu "48m(nand_kernel),448m(nand_free)" 250a52ff334SSumit Garg #endif 251dd02936fSMingkai Hu 252f7244f2cSVinitha Pillai-B57223 #include <asm/fsl_secure_boot.h> 253f7244f2cSVinitha Pillai-B57223 254dd02936fSMingkai Hu #endif /* __LS1046ARDB_H__ */ 255