blob: 1ea6befa9b9490ac869567bdef3770420beceb0b [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Ashish Kumar1ef4c772017-08-31 16:12:55 +05302/*
Yangbo Lubb32e682021-06-03 10:51:19 +08003 * Copyright 2017, 2020-2021 NXP
Ashish Kumar1ef4c772017-08-31 16:12:55 +05304 */
5
6#ifndef __LS1088A_QDS_H
7#define __LS1088A_QDS_H
8
9#include "ls1088a_common.h"
10
Ashish Kumar4feb83b2017-11-06 13:18:44 +053011#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
Ashish Kumar1ef4c772017-08-31 16:12:55 +053012#define SYS_NO_FLASH
Ashish Kumar1ef4c772017-08-31 16:12:55 +053013#endif
14
Tom Rini8c70baa2021-12-14 13:36:40 -050015#define COUNTER_FREQUENCY_REAL (get_board_sys_clk()/4)
Ashish Kumar1ef4c772017-08-31 16:12:55 +053016#define COUNTER_FREQUENCY 25000000 /* 25MHz */
17
Ashish Kumar1ef4c772017-08-31 16:12:55 +053018#define CONFIG_MEM_INIT_VALUE 0xdeadbeef
19#define SPD_EEPROM_ADDRESS 0x51
20#define CONFIG_SYS_SPD_BUS_NUM 0
21
22
23/*
24 * IFC Definitions
25 */
26#if !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_SD_BOOT_QSPI)
27#define CONFIG_SYS_NOR0_CSPR_EXT (0x0)
28#define CONFIG_SYS_NOR_AMASK IFC_AMASK(128*1024*1024)
29#define CONFIG_SYS_NOR_AMASK_EARLY IFC_AMASK(64*1024*1024)
30
31#define CONFIG_SYS_NOR0_CSPR \
32 (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS) | \
33 CSPR_PORT_SIZE_16 | \
34 CSPR_MSEL_NOR | \
35 CSPR_V)
36#define CONFIG_SYS_NOR0_CSPR_EARLY \
37 (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS_EARLY) | \
38 CSPR_PORT_SIZE_16 | \
39 CSPR_MSEL_NOR | \
40 CSPR_V)
41#define CONFIG_SYS_NOR1_CSPR \
42 (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH1_BASE_PHYS) | \
43 CSPR_PORT_SIZE_16 | \
44 CSPR_MSEL_NOR | \
45 CSPR_V)
46#define CONFIG_SYS_NOR1_CSPR_EARLY \
47 (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH1_BASE_PHYS_EARLY) | \
48 CSPR_PORT_SIZE_16 | \
49 CSPR_MSEL_NOR | \
50 CSPR_V)
51#define CONFIG_SYS_NOR_CSOR CSOR_NOR_ADM_SHIFT(12)
52#define CONFIG_SYS_NOR_FTIM0 (FTIM0_NOR_TACSE(0x4) | \
53 FTIM0_NOR_TEADC(0x5) | \
Ashish Kumar55fd8b92018-02-19 14:16:58 +053054 FTIM0_NOR_TAVDS(0x6) | \
Ashish Kumar1ef4c772017-08-31 16:12:55 +053055 FTIM0_NOR_TEAHC(0x5))
56#define CONFIG_SYS_NOR_FTIM1 (FTIM1_NOR_TACO(0x35) | \
Ashish Kumar55fd8b92018-02-19 14:16:58 +053057 FTIM1_NOR_TRAD_NOR(0x1a) | \
Ashish Kumar1ef4c772017-08-31 16:12:55 +053058 FTIM1_NOR_TSEQRAD_NOR(0x13))
Ashish Kumar55fd8b92018-02-19 14:16:58 +053059#define CONFIG_SYS_NOR_FTIM2 (FTIM2_NOR_TCS(0x8) | \
60 FTIM2_NOR_TCH(0x8) | \
61 FTIM2_NOR_TWPH(0xe) | \
Ashish Kumar1ef4c772017-08-31 16:12:55 +053062 FTIM2_NOR_TWP(0x1c))
63#define CONFIG_SYS_NOR_FTIM3 0x04000000
64#define CONFIG_SYS_IFC_CCR 0x01000000
65
66#ifndef SYS_NO_FLASH
Ashish Kumar1ef4c772017-08-31 16:12:55 +053067#define CONFIG_SYS_FLASH_QUIET_TEST
68#define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */
69
Ashish Kumar1ef4c772017-08-31 16:12:55 +053070#define CONFIG_SYS_MAX_FLASH_SECT 1024 /* sectors per device */
71#define CONFIG_SYS_FLASH_ERASE_TOUT 60000 /* Flash Erase Timeout (ms) */
72#define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (ms) */
73
74#define CONFIG_SYS_FLASH_EMPTY_INFO
75#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE,\
76 CONFIG_SYS_FLASH_BASE + 0x40000000}
77#endif
78#endif
79
Ashish Kumar1ef4c772017-08-31 16:12:55 +053080#define CONFIG_SYS_NAND_MAX_ECCPOS 256
81#define CONFIG_SYS_NAND_MAX_OOBFREE 2
82
83#define CONFIG_SYS_NAND_CSPR_EXT (0x0)
84#define CONFIG_SYS_NAND_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
85 | CSPR_PORT_SIZE_8 /* Port Size = 8 bit */ \
86 | CSPR_MSEL_NAND /* MSEL = NAND */ \
87 | CSPR_V)
88#define CONFIG_SYS_NAND_AMASK IFC_AMASK(64 * 1024)
89
90#define CONFIG_SYS_NAND_CSOR (CSOR_NAND_ECC_ENC_EN /* ECC on encode */ \
91 | CSOR_NAND_ECC_DEC_EN /* ECC on decode */ \
92 | CSOR_NAND_ECC_MODE_4 /* 4-bit ECC */ \
93 | CSOR_NAND_RAL_3 /* RAL = 3Byes */ \
94 | CSOR_NAND_PGS_2K /* Page Size = 2K */ \
95 | CSOR_NAND_SPRZ_64/* Spare size = 64 */ \
96 | CSOR_NAND_PB(64)) /*Pages Per Block = 64*/
97
Ashish Kumar1ef4c772017-08-31 16:12:55 +053098/* ONFI NAND Flash mode0 Timing Params */
99#define CONFIG_SYS_NAND_FTIM0 (FTIM0_NAND_TCCST(0x07) | \
100 FTIM0_NAND_TWP(0x18) | \
101 FTIM0_NAND_TWCHT(0x07) | \
102 FTIM0_NAND_TWH(0x0a))
103#define CONFIG_SYS_NAND_FTIM1 (FTIM1_NAND_TADLE(0x32) | \
104 FTIM1_NAND_TWBE(0x39) | \
105 FTIM1_NAND_TRR(0x0e) | \
106 FTIM1_NAND_TRP(0x18))
107#define CONFIG_SYS_NAND_FTIM2 (FTIM2_NAND_TRAD(0x0f) | \
108 FTIM2_NAND_TREH(0x0a) | \
109 FTIM2_NAND_TWHRE(0x1e))
110#define CONFIG_SYS_NAND_FTIM3 0x0
111
112#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
113#define CONFIG_SYS_MAX_NAND_DEVICE 1
114#define CONFIG_MTD_NAND_VERIFY_WRITE
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530115
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530116#define CONFIG_SYS_I2C_FPGA_ADDR 0x66
117#define QIXIS_LBMAP_SWITCH 6
118#define QIXIS_QMAP_MASK 0xe0
119#define QIXIS_QMAP_SHIFT 5
120#define QIXIS_LBMAP_MASK 0x0f
121#define QIXIS_LBMAP_SHIFT 0
122#define QIXIS_LBMAP_DFLTBANK 0x0e
123#define QIXIS_LBMAP_ALTBANK 0x2e
124#define QIXIS_LBMAP_SD 0x00
Ashish Kumar55769ca2018-01-17 12:16:37 +0530125#define QIXIS_LBMAP_EMMC 0x00
126#define QIXIS_LBMAP_IFC 0x00
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530127#define QIXIS_LBMAP_SD_QSPI 0x0e
128#define QIXIS_LBMAP_QSPI 0x0e
Ashish Kumar55769ca2018-01-17 12:16:37 +0530129#define QIXIS_RCW_SRC_IFC 0x25
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530130#define QIXIS_RCW_SRC_SD 0x40
Ashish Kumar55769ca2018-01-17 12:16:37 +0530131#define QIXIS_RCW_SRC_EMMC 0x41
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530132#define QIXIS_RCW_SRC_QSPI 0x62
133#define QIXIS_RST_CTL_RESET 0x41
134#define QIXIS_RCFG_CTL_RECONFIG_IDLE 0x20
135#define QIXIS_RCFG_CTL_RECONFIG_START 0x21
136#define QIXIS_RCFG_CTL_WATCHDOG_ENBLE 0x08
137#define QIXIS_RST_FORCE_MEM 0x01
138#define QIXIS_STAT_PRES1 0xb
139#define QIXIS_SDID_MASK 0x07
140#define QIXIS_ESDHC_NO_ADAPTER 0x7
141
142#define CONFIG_SYS_FPGA_CSPR_EXT (0x0)
143#define CONFIG_SYS_FPGA_CSPR (CSPR_PHYS_ADDR(QIXIS_BASE_PHYS_EARLY) \
144 | CSPR_PORT_SIZE_8 \
145 | CSPR_MSEL_GPCM \
146 | CSPR_V)
147#define SYS_FPGA_CSPR_FINAL (CSPR_PHYS_ADDR(QIXIS_BASE_PHYS) \
148 | CSPR_PORT_SIZE_8 \
149 | CSPR_MSEL_GPCM \
150 | CSPR_V)
151
Ashish Kumare563ed82018-02-19 14:14:09 +0530152#define SYS_FPGA_AMASK IFC_AMASK(64 * 1024)
Ashish Kumar4feb83b2017-11-06 13:18:44 +0530153#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530154#define CONFIG_SYS_FPGA_CSOR CSOR_GPCM_ADM_SHIFT(0)
155#else
156#define CONFIG_SYS_FPGA_CSOR CSOR_GPCM_ADM_SHIFT(12)
157#endif
158/* QIXIS Timing parameters*/
159#define SYS_FPGA_CS_FTIM0 (FTIM0_GPCM_TACSE(0x0e) | \
160 FTIM0_GPCM_TEADC(0x0e) | \
161 FTIM0_GPCM_TEAHC(0x0e))
162#define SYS_FPGA_CS_FTIM1 (FTIM1_GPCM_TACO(0xff) | \
163 FTIM1_GPCM_TRAD(0x3f))
164#define SYS_FPGA_CS_FTIM2 (FTIM2_GPCM_TCS(0xf) | \
165 FTIM2_GPCM_TCH(0xf) | \
166 FTIM2_GPCM_TWP(0x3E))
167#define SYS_FPGA_CS_FTIM3 0x0
168
Pankit Garg112aeba2018-12-27 04:37:57 +0000169#ifdef CONFIG_TFABOOT
170#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NOR0_CSPR_EXT
171#define CONFIG_SYS_CSPR0 CONFIG_SYS_NOR0_CSPR_EARLY
172#define CONFIG_SYS_CSPR0_FINAL CONFIG_SYS_NOR0_CSPR
173#define CONFIG_SYS_AMASK0 CONFIG_SYS_NOR_AMASK
174#define CONFIG_SYS_CSOR0 CONFIG_SYS_NOR_CSOR
175#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NOR_FTIM0
176#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NOR_FTIM1
177#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NOR_FTIM2
178#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NOR_FTIM3
179#define CONFIG_SYS_CSPR1_EXT CONFIG_SYS_NOR0_CSPR_EXT
180#define CONFIG_SYS_CSPR1 CONFIG_SYS_NOR1_CSPR_EARLY
181#define CONFIG_SYS_CSPR1_FINAL CONFIG_SYS_NOR1_CSPR
182#define CONFIG_SYS_AMASK1 CONFIG_SYS_NOR_AMASK_EARLY
183#define CONFIG_SYS_AMASK1_FINAL CONFIG_SYS_NOR_AMASK
184#define CONFIG_SYS_CSOR1 CONFIG_SYS_NOR_CSOR
185#define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NOR_FTIM0
186#define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NOR_FTIM1
187#define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NOR_FTIM2
188#define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NOR_FTIM3
189#define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_NAND_CSPR_EXT
190#define CONFIG_SYS_CSPR2 CONFIG_SYS_NAND_CSPR
191#define CONFIG_SYS_AMASK2 CONFIG_SYS_NAND_AMASK
192#define CONFIG_SYS_CSOR2 CONFIG_SYS_NAND_CSOR
193#define CONFIG_SYS_CS2_FTIM0 CONFIG_SYS_NAND_FTIM0
194#define CONFIG_SYS_CS2_FTIM1 CONFIG_SYS_NAND_FTIM1
195#define CONFIG_SYS_CS2_FTIM2 CONFIG_SYS_NAND_FTIM2
196#define CONFIG_SYS_CS2_FTIM3 CONFIG_SYS_NAND_FTIM3
197#define CONFIG_SYS_CSPR3_EXT CONFIG_SYS_FPGA_CSPR_EXT
198#define CONFIG_SYS_CSPR3 CONFIG_SYS_FPGA_CSPR
199#define CONFIG_SYS_CSPR3_FINAL SYS_FPGA_CSPR_FINAL
200#define CONFIG_SYS_AMASK3 SYS_FPGA_AMASK
201#define CONFIG_SYS_CSOR3 CONFIG_SYS_FPGA_CSOR
202#define CONFIG_SYS_CS3_FTIM0 SYS_FPGA_CS_FTIM0
203#define CONFIG_SYS_CS3_FTIM1 SYS_FPGA_CS_FTIM1
204#define CONFIG_SYS_CS3_FTIM2 SYS_FPGA_CS_FTIM2
205#define CONFIG_SYS_CS3_FTIM3 SYS_FPGA_CS_FTIM3
206#else
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530207#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
208#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NAND_CSPR_EXT
209#define CONFIG_SYS_CSPR0 CONFIG_SYS_NAND_CSPR
210#define CONFIG_SYS_AMASK0 CONFIG_SYS_NAND_AMASK
211#define CONFIG_SYS_CSOR0 CONFIG_SYS_NAND_CSOR
212#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NAND_FTIM0
213#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NAND_FTIM1
214#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NAND_FTIM2
215#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NAND_FTIM3
216#define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_FPGA_CSPR_EXT
217#define CONFIG_SYS_CSPR2 CONFIG_SYS_FPGA_CSPR
218#define CONFIG_SYS_CSPR2_FINAL SYS_FPGA_CSPR_FINAL
Ashish Kumare563ed82018-02-19 14:14:09 +0530219#define CONFIG_SYS_AMASK2 SYS_FPGA_AMASK
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530220#define CONFIG_SYS_CSOR2 CONFIG_SYS_FPGA_CSOR
221#define CONFIG_SYS_CS2_FTIM0 SYS_FPGA_CS_FTIM0
222#define CONFIG_SYS_CS2_FTIM1 SYS_FPGA_CS_FTIM1
223#define CONFIG_SYS_CS2_FTIM2 SYS_FPGA_CS_FTIM2
224#define CONFIG_SYS_CS2_FTIM3 SYS_FPGA_CS_FTIM3
225#else
226#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NOR0_CSPR_EXT
227#define CONFIG_SYS_CSPR0 CONFIG_SYS_NOR0_CSPR_EARLY
228#define CONFIG_SYS_CSPR0_FINAL CONFIG_SYS_NOR0_CSPR
229#define CONFIG_SYS_AMASK0 CONFIG_SYS_NOR_AMASK
230#define CONFIG_SYS_CSOR0 CONFIG_SYS_NOR_CSOR
231#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NOR_FTIM0
232#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NOR_FTIM1
233#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NOR_FTIM2
234#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NOR_FTIM3
235#define CONFIG_SYS_CSPR1_EXT CONFIG_SYS_NOR0_CSPR_EXT
236#define CONFIG_SYS_CSPR1 CONFIG_SYS_NOR1_CSPR_EARLY
237#define CONFIG_SYS_CSPR1_FINAL CONFIG_SYS_NOR1_CSPR
238#define CONFIG_SYS_AMASK1 CONFIG_SYS_NOR_AMASK_EARLY
239#define CONFIG_SYS_AMASK1_FINAL CONFIG_SYS_NOR_AMASK
240#define CONFIG_SYS_CSOR1 CONFIG_SYS_NOR_CSOR
241#define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NOR_FTIM0
242#define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NOR_FTIM1
243#define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NOR_FTIM2
244#define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NOR_FTIM3
245#define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_NAND_CSPR_EXT
246#define CONFIG_SYS_CSPR2 CONFIG_SYS_NAND_CSPR
247#define CONFIG_SYS_AMASK2 CONFIG_SYS_NAND_AMASK
248#define CONFIG_SYS_CSOR2 CONFIG_SYS_NAND_CSOR
249#define CONFIG_SYS_CS2_FTIM0 CONFIG_SYS_NAND_FTIM0
250#define CONFIG_SYS_CS2_FTIM1 CONFIG_SYS_NAND_FTIM1
251#define CONFIG_SYS_CS2_FTIM2 CONFIG_SYS_NAND_FTIM2
252#define CONFIG_SYS_CS2_FTIM3 CONFIG_SYS_NAND_FTIM3
253#define CONFIG_SYS_CSPR3_EXT CONFIG_SYS_FPGA_CSPR_EXT
254#define CONFIG_SYS_CSPR3 CONFIG_SYS_FPGA_CSPR
Ashish Kumare563ed82018-02-19 14:14:09 +0530255#define CONFIG_SYS_CSPR3_FINAL SYS_FPGA_CSPR_FINAL
256#define CONFIG_SYS_AMASK3 SYS_FPGA_AMASK
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530257#define CONFIG_SYS_CSOR3 CONFIG_SYS_FPGA_CSOR
Ashish Kumare563ed82018-02-19 14:14:09 +0530258#define CONFIG_SYS_CS3_FTIM0 SYS_FPGA_CS_FTIM0
259#define CONFIG_SYS_CS3_FTIM1 SYS_FPGA_CS_FTIM1
260#define CONFIG_SYS_CS3_FTIM2 SYS_FPGA_CS_FTIM2
261#define CONFIG_SYS_CS3_FTIM3 SYS_FPGA_CS_FTIM3
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530262#endif
Pankit Garg112aeba2018-12-27 04:37:57 +0000263#endif
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530264
265#define CONFIG_SYS_LS_MC_BOOT_TIMEOUT_MS 5000
266
267/*
268 * I2C bus multiplexer
269 */
270#define I2C_MUX_PCA_ADDR_PRI 0x77
271#define I2C_MUX_PCA_ADDR_SEC 0x76 /* Secondary multiplexer */
272#define I2C_RETIMER_ADDR 0x18
273#define I2C_RETIMER_ADDR2 0x19
274#define I2C_MUX_CH_DEFAULT 0x8
275#define I2C_MUX_CH5 0xD
276
Rajesh Bhagat170eecf2018-01-17 16:13:05 +0530277#define I2C_MUX_CH_VOL_MONITOR 0xA
278
279/* Voltage monitor on channel 2*/
280#define I2C_VOL_MONITOR_ADDR 0x63
281#define I2C_VOL_MONITOR_BUS_V_OFFSET 0x2
282#define I2C_VOL_MONITOR_BUS_V_OVF 0x1
283#define I2C_VOL_MONITOR_BUS_V_SHIFT 3
Rajesh Bhagata4216252018-01-17 16:13:09 +0530284#define I2C_SVDD_MONITOR_ADDR 0x4F
285
Rajesh Bhagata4216252018-01-17 16:13:09 +0530286/* The lowest and highest voltage allowed for LS1088AQDS */
287#define VDD_MV_MIN 819
288#define VDD_MV_MAX 1212
289
Rajesh Bhagat170eecf2018-01-17 16:13:05 +0530290#define PWM_CHANNEL0 0x0
291
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530292/*
293* RTC configuration
294*/
295#define RTC
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530296#define CONFIG_SYS_I2C_RTC_ADDR 0x51 /* Channel 3*/
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530297
298/* EEPROM */
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530299#define CONFIG_SYS_I2C_EEPROM_NXID
300#define CONFIG_SYS_EEPROM_BUS_NUM 0
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530301
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530302#ifdef CONFIG_FSL_DSPI
Pankit Garg112aeba2018-12-27 04:37:57 +0000303#if !defined(CONFIG_TFABOOT) && \
304 !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_SD_BOOT_QSPI)
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530305#endif
306#endif
307
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530308#define CONFIG_FSL_MEMAC
309
310/* MMC */
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530311#define CONFIG_ESDHC_DETECT_QUIRK ((readb(QIXIS_BASE + QIXIS_STAT_PRES1) & \
312 QIXIS_SDID_MASK) != QIXIS_ESDHC_NO_ADAPTER)
313
Biwen Lia39b9472020-12-10 11:02:47 +0800314#define COMMON_ENV \
315 "kernelheader_addr_r=0x80200000\0" \
316 "fdtheader_addr_r=0x80100000\0" \
317 "kernel_addr_r=0x81000000\0" \
318 "fdt_addr_r=0x90000000\0" \
319 "load_addr=0xa0000000\0"
320
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530321/* Initial environment variables */
Udit Agarwal22ec2382019-11-07 16:11:32 +0000322#ifdef CONFIG_NXP_ESBC
Udit Agarwal09fd5792017-11-22 09:01:26 +0530323#undef CONFIG_EXTRA_ENV_SETTINGS
324#define CONFIG_EXTRA_ENV_SETTINGS \
Biwen Lia39b9472020-12-10 11:02:47 +0800325 COMMON_ENV \
Udit Agarwal09fd5792017-11-22 09:01:26 +0530326 "hwconfig=fsl_ddr:bank_intlv=auto\0" \
327 "loadaddr=0x90100000\0" \
328 "kernel_addr=0x100000\0" \
329 "ramdisk_addr=0x800000\0" \
330 "ramdisk_size=0x2000000\0" \
331 "fdt_high=0xa0000000\0" \
332 "initrd_high=0xffffffffffffffff\0" \
333 "kernel_start=0x1000000\0" \
334 "kernel_load=0xa0000000\0" \
335 "kernel_size=0x2800000\0" \
Priyanka Jain06532702021-07-19 14:51:24 +0530336 "mcinitcmd=sf probe 0:0;sf read 0xa0a00000 0xa00000 0x200000;" \
Priyanka Singhf745ae92020-01-22 10:32:34 +0000337 "sf read 0xa0640000 0x640000 0x4000; esbc_validate 0xa0640000;" \
Udit Agarwal09fd5792017-11-22 09:01:26 +0530338 "sf read 0xa0e00000 0xe00000 0x100000;" \
Priyanka Singhf745ae92020-01-22 10:32:34 +0000339 "sf read 0xa0680000 0x680000 0x4000;esbc_validate 0xa0680000;" \
Udit Agarwal09fd5792017-11-22 09:01:26 +0530340 "fsl_mc start mc 0xa0a00000 0xa0e00000\0" \
341 "mcmemsize=0x70000000 \0"
Udit Agarwal22ec2382019-11-07 16:11:32 +0000342#else /* if !(CONFIG_NXP_ESBC) */
Pankit Garg112aeba2018-12-27 04:37:57 +0000343#ifdef CONFIG_TFABOOT
344#define QSPI_MC_INIT_CMD \
Priyanka Jain06532702021-07-19 14:51:24 +0530345 "sf probe 0:0;sf read 0x80a00000 0xA00000 0x200000;" \
346 "sf read 0x80e00000 0xE00000 0x100000;" \
347 "fsl_mc start mc 0x80a00000 0x80e00000\0"
Pankit Garg112aeba2018-12-27 04:37:57 +0000348#define SD_MC_INIT_CMD \
Priyanka Jain06532702021-07-19 14:51:24 +0530349 "mmcinfo;mmc read 0x80a00000 0x5000 0x1000;" \
350 "mmc read 0x80e00000 0x7000 0x800;" \
351 "fsl_mc start mc 0x80a00000 0x80e00000\0"
Pankit Garg112aeba2018-12-27 04:37:57 +0000352#define IFC_MC_INIT_CMD \
353 "fsl_mc start mc 0x580A00000 0x580E00000\0"
354
355#undef CONFIG_EXTRA_ENV_SETTINGS
356#define CONFIG_EXTRA_ENV_SETTINGS \
Biwen Lia39b9472020-12-10 11:02:47 +0800357 COMMON_ENV \
Pankit Garg112aeba2018-12-27 04:37:57 +0000358 "hwconfig=fsl_ddr:bank_intlv=auto\0" \
359 "loadaddr=0x90100000\0" \
360 "kernel_addr=0x100000\0" \
361 "kernel_addr_sd=0x800\0" \
362 "ramdisk_addr=0x800000\0" \
363 "ramdisk_size=0x2000000\0" \
364 "fdt_high=0xa0000000\0" \
365 "initrd_high=0xffffffffffffffff\0" \
366 "kernel_start=0x1000000\0" \
367 "kernel_start_sd=0x8000\0" \
368 "kernel_load=0xa0000000\0" \
369 "kernel_size=0x2800000\0" \
370 "kernel_size_sd=0x14000\0" \
Priyanka Jain06532702021-07-19 14:51:24 +0530371 "mcinitcmd=sf probe 0:0;sf read 0x80a00000 0xA00000 0x200000;" \
372 "sf read 0x80e00000 0xE00000 0x100000;" \
373 "fsl_mc start mc 0x80a00000 0x80e00000\0" \
Biwen Li5bef8692020-03-19 19:38:42 +0800374 "mcmemsize=0x70000000 \0" \
375 "BOARD=ls1088aqds\0" \
376 "scriptaddr=0x80000000\0" \
377 "scripthdraddr=0x80080000\0" \
378 BOOTENV \
379 "boot_scripts=ls1088aqds_boot.scr\0" \
380 "boot_script_hdr=hdr_ls1088aqds_bs.out\0" \
381 "scan_dev_for_boot_part=" \
382 "part list ${devtype} ${devnum} devplist; " \
383 "env exists devplist || setenv devplist 1; " \
384 "for distro_bootpart in ${devplist}; do " \
385 "if fstype ${devtype} " \
386 "${devnum}:${distro_bootpart} " \
387 "bootfstype; then " \
388 "run scan_dev_for_boot; " \
389 "fi; " \
390 "done\0" \
391 "boot_a_script=" \
392 "load ${devtype} ${devnum}:${distro_bootpart} " \
393 "${scriptaddr} ${prefix}${script}; " \
394 "env exists secureboot && load ${devtype} " \
395 "${devnum}:${distro_bootpart} " \
396 "${scripthdraddr} ${prefix}${boot_script_hdr}; "\
397 "env exists secureboot " \
398 "&& esbc_validate ${scripthdraddr};" \
399 "source ${scriptaddr}\0" \
400 "qspi_bootcmd=echo Trying load from qspi..; " \
401 "sf probe 0:0; " \
402 "sf read 0x80001000 0xd00000 0x100000; " \
403 "fsl_mc lazyapply dpl 0x80001000 && " \
404 "sf read $kernel_load $kernel_start " \
405 "$kernel_size && bootm $kernel_load#$BOARD\0" \
406 "sd_bootcmd=echo Trying load from sd card..; " \
407 "mmcinfo;mmc read 0x80001000 0x6800 0x800; "\
408 "fsl_mc lazyapply dpl 0x80001000 && " \
409 "mmc read $kernel_load $kernel_start_sd " \
410 "$kernel_size_sd && bootm $kernel_load#$BOARD\0" \
411 "nor_bootcmd=echo Trying load from nor..; " \
412 "fsl_mc lazyapply dpl 0x580d00000 && " \
413 "cp.b $kernel_start $kernel_load " \
414 "$kernel_size && bootm $kernel_load#$BOARD\0"
Pankit Garg112aeba2018-12-27 04:37:57 +0000415#else
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530416#if defined(CONFIG_QSPI_BOOT)
417#undef CONFIG_EXTRA_ENV_SETTINGS
418#define CONFIG_EXTRA_ENV_SETTINGS \
Biwen Lia39b9472020-12-10 11:02:47 +0800419 COMMON_ENV \
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530420 "hwconfig=fsl_ddr:bank_intlv=auto\0" \
421 "loadaddr=0x90100000\0" \
422 "kernel_addr=0x100000\0" \
423 "ramdisk_addr=0x800000\0" \
424 "ramdisk_size=0x2000000\0" \
425 "fdt_high=0xa0000000\0" \
426 "initrd_high=0xffffffffffffffff\0" \
427 "kernel_start=0x1000000\0" \
428 "kernel_load=0xa0000000\0" \
429 "kernel_size=0x2800000\0" \
Priyanka Jain06532702021-07-19 14:51:24 +0530430 "mcinitcmd=sf probe 0:0;sf read 0x80a00000 0xA00000 0x200000;" \
431 "sf read 0x80e00000 0xE00000 0x100000;" \
432 "fsl_mc start mc 0x80a00000 0x80e00000\0" \
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530433 "mcmemsize=0x70000000 \0"
Ashish Kumar4feb83b2017-11-06 13:18:44 +0530434#elif defined(CONFIG_SD_BOOT)
435#undef CONFIG_EXTRA_ENV_SETTINGS
436#define CONFIG_EXTRA_ENV_SETTINGS \
Biwen Lia39b9472020-12-10 11:02:47 +0800437 COMMON_ENV \
Ashish Kumar4feb83b2017-11-06 13:18:44 +0530438 "hwconfig=fsl_ddr:bank_intlv=auto\0" \
439 "loadaddr=0x90100000\0" \
440 "kernel_addr=0x800\0" \
441 "ramdisk_addr=0x800000\0" \
442 "ramdisk_size=0x2000000\0" \
443 "fdt_high=0xa0000000\0" \
444 "initrd_high=0xffffffffffffffff\0" \
445 "kernel_start=0x8000\0" \
446 "kernel_load=0xa0000000\0" \
447 "kernel_size=0x14000\0" \
Priyanka Jain06532702021-07-19 14:51:24 +0530448 "mcinitcmd=mmcinfo;mmc read 0x80a00000 0x5000 0x1000;" \
449 "mmc read 0x80e00000 0x7000 0x800;" \
450 "fsl_mc start mc 0x80a00000 0x80e00000\0" \
Ashish Kumar4feb83b2017-11-06 13:18:44 +0530451 "mcmemsize=0x70000000 \0"
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530452#else /* NOR BOOT */
453#undef CONFIG_EXTRA_ENV_SETTINGS
454#define CONFIG_EXTRA_ENV_SETTINGS \
Biwen Lia39b9472020-12-10 11:02:47 +0800455 COMMON_ENV \
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530456 "hwconfig=fsl_ddr:bank_intlv=auto\0" \
457 "loadaddr=0x90100000\0" \
458 "kernel_addr=0x100000\0" \
459 "ramdisk_addr=0x800000\0" \
460 "ramdisk_size=0x2000000\0" \
461 "fdt_high=0xa0000000\0" \
462 "initrd_high=0xffffffffffffffff\0" \
463 "kernel_start=0x1000000\0" \
464 "kernel_load=0xa0000000\0" \
465 "kernel_size=0x2800000\0" \
466 "mcinitcmd=fsl_mc start mc 0x580A00000 0x580E00000\0" \
467 "mcmemsize=0x70000000 \0"
468#endif
Pankit Garg112aeba2018-12-27 04:37:57 +0000469#endif /* CONFIG_TFABOOT */
Udit Agarwal22ec2382019-11-07 16:11:32 +0000470#endif /* CONFIG_NXP_ESBC */
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530471
Biwen Li5bef8692020-03-19 19:38:42 +0800472#ifdef CONFIG_TFABOOT
473#define QSPI_NOR_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; " \
474 "env exists secureboot && esbc_halt;;"
475#define IFC_NOR_BOOTCOMMAND "run distro_bootcmd; run nor_bootcmd; " \
476 "env exists secureboot && esbc_halt;;"
477#define SD_BOOTCOMMAND "run distro_bootcmd; run sd_bootcmd; " \
478 "env exists secureboot && esbc_halt;;"
479#endif
480
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530481#ifdef CONFIG_FSL_MC_ENET
482#define CONFIG_FSL_MEMAC
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530483#define RGMII_PHY1_ADDR 0x1
484#define RGMII_PHY2_ADDR 0x2
485#define SGMII_CARD_PORT1_PHY_ADDR 0x1C
486#define SGMII_CARD_PORT2_PHY_ADDR 0x1d
487#define SGMII_CARD_PORT3_PHY_ADDR 0x1E
488#define SGMII_CARD_PORT4_PHY_ADDR 0x1F
489
490#define XQSGMII_CARD_PHY1_PORT0_ADDR 0x0
491#define XQSGMII_CARD_PHY1_PORT1_ADDR 0x1
492#define XQSGMII_CARD_PHY1_PORT2_ADDR 0x2
493#define XQSGMII_CARD_PHY1_PORT3_ADDR 0x3
494#define XQSGMII_CARD_PHY2_PORT0_ADDR 0x4
495#define XQSGMII_CARD_PHY2_PORT1_ADDR 0x5
496#define XQSGMII_CARD_PHY2_PORT2_ADDR 0x6
497#define XQSGMII_CARD_PHY2_PORT3_ADDR 0x7
498#define XQSGMII_CARD_PHY3_PORT0_ADDR 0x8
499#define XQSGMII_CARD_PHY3_PORT1_ADDR 0x9
500#define XQSGMII_CARD_PHY3_PORT2_ADDR 0xa
501#define XQSGMII_CARD_PHY3_PORT3_ADDR 0xb
502#define XQSGMII_CARD_PHY4_PORT0_ADDR 0xc
503#define XQSGMII_CARD_PHY4_PORT1_ADDR 0xd
504#define XQSGMII_CARD_PHY4_PORT2_ADDR 0xe
505#define XQSGMII_CARD_PHY4_PORT3_ADDR 0xf
506
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530507#endif
508
Ashish Kumar1ef4c772017-08-31 16:12:55 +0530509#define BOOT_TARGET_DEVICES(func) \
510 func(USB, usb, 0) \
511 func(MMC, mmc, 0) \
512 func(SCSI, scsi, 0) \
513 func(DHCP, dhcp, na)
514#include <config_distro_bootcmd.h>
515
516#include <asm/fsl_secure_boot.h>
517
518#endif /* __LS1088A_QDS_H */