blob: 5912fe95ccfbc9c632bd3900046b950aa8d4e327 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Ashish Kumar77697762017-08-31 16:12:55 +05302/*
Yangbo Lu34f39ce2021-06-03 10:51:19 +08003 * Copyright 2017, 2020-2021 NXP
Ashish Kumar77697762017-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 Kumar91fded62017-11-06 13:18:44 +053011#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
Ashish Kumar77697762017-08-31 16:12:55 +053012#define CONFIG_QIXIS_I2C_ACCESS
13#define SYS_NO_FLASH
Ashish Kumar77697762017-08-31 16:12:55 +053014#else
Ashish Kumarc1c597e2018-02-19 14:16:58 +053015#define CONFIG_QIXIS_I2C_ACCESS
Ashish Kumar77697762017-08-31 16:12:55 +053016#endif
17
Tom Rini2f8a6db2021-12-14 13:36:40 -050018#define COUNTER_FREQUENCY_REAL (get_board_sys_clk()/4)
Ashish Kumar77697762017-08-31 16:12:55 +053019#define COUNTER_FREQUENCY 25000000 /* 25MHz */
20
21#define CONFIG_DIMM_SLOTS_PER_CTLR 1
22
Ashish Kumar77697762017-08-31 16:12:55 +053023#define CONFIG_MEM_INIT_VALUE 0xdeadbeef
24#define SPD_EEPROM_ADDRESS 0x51
25#define CONFIG_SYS_SPD_BUS_NUM 0
26
27
28/*
29 * IFC Definitions
30 */
31#if !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_SD_BOOT_QSPI)
32#define CONFIG_SYS_NOR0_CSPR_EXT (0x0)
33#define CONFIG_SYS_NOR_AMASK IFC_AMASK(128*1024*1024)
34#define CONFIG_SYS_NOR_AMASK_EARLY IFC_AMASK(64*1024*1024)
35
36#define CONFIG_SYS_NOR0_CSPR \
37 (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS) | \
38 CSPR_PORT_SIZE_16 | \
39 CSPR_MSEL_NOR | \
40 CSPR_V)
41#define CONFIG_SYS_NOR0_CSPR_EARLY \
42 (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS_EARLY) | \
43 CSPR_PORT_SIZE_16 | \
44 CSPR_MSEL_NOR | \
45 CSPR_V)
46#define CONFIG_SYS_NOR1_CSPR \
47 (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH1_BASE_PHYS) | \
48 CSPR_PORT_SIZE_16 | \
49 CSPR_MSEL_NOR | \
50 CSPR_V)
51#define CONFIG_SYS_NOR1_CSPR_EARLY \
52 (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH1_BASE_PHYS_EARLY) | \
53 CSPR_PORT_SIZE_16 | \
54 CSPR_MSEL_NOR | \
55 CSPR_V)
56#define CONFIG_SYS_NOR_CSOR CSOR_NOR_ADM_SHIFT(12)
57#define CONFIG_SYS_NOR_FTIM0 (FTIM0_NOR_TACSE(0x4) | \
58 FTIM0_NOR_TEADC(0x5) | \
Ashish Kumarc1c597e2018-02-19 14:16:58 +053059 FTIM0_NOR_TAVDS(0x6) | \
Ashish Kumar77697762017-08-31 16:12:55 +053060 FTIM0_NOR_TEAHC(0x5))
61#define CONFIG_SYS_NOR_FTIM1 (FTIM1_NOR_TACO(0x35) | \
Ashish Kumarc1c597e2018-02-19 14:16:58 +053062 FTIM1_NOR_TRAD_NOR(0x1a) | \
Ashish Kumar77697762017-08-31 16:12:55 +053063 FTIM1_NOR_TSEQRAD_NOR(0x13))
Ashish Kumarc1c597e2018-02-19 14:16:58 +053064#define CONFIG_SYS_NOR_FTIM2 (FTIM2_NOR_TCS(0x8) | \
65 FTIM2_NOR_TCH(0x8) | \
66 FTIM2_NOR_TWPH(0xe) | \
Ashish Kumar77697762017-08-31 16:12:55 +053067 FTIM2_NOR_TWP(0x1c))
68#define CONFIG_SYS_NOR_FTIM3 0x04000000
69#define CONFIG_SYS_IFC_CCR 0x01000000
70
71#ifndef SYS_NO_FLASH
Ashish Kumar77697762017-08-31 16:12:55 +053072#define CONFIG_SYS_FLASH_QUIET_TEST
73#define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */
74
75#define CONFIG_SYS_MAX_FLASH_BANKS 2 /* number of banks */
76#define CONFIG_SYS_MAX_FLASH_SECT 1024 /* sectors per device */
77#define CONFIG_SYS_FLASH_ERASE_TOUT 60000 /* Flash Erase Timeout (ms) */
78#define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (ms) */
79
80#define CONFIG_SYS_FLASH_EMPTY_INFO
81#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE,\
82 CONFIG_SYS_FLASH_BASE + 0x40000000}
83#endif
84#endif
85
Ashish Kumar77697762017-08-31 16:12:55 +053086#define CONFIG_SYS_NAND_MAX_ECCPOS 256
87#define CONFIG_SYS_NAND_MAX_OOBFREE 2
88
89#define CONFIG_SYS_NAND_CSPR_EXT (0x0)
90#define CONFIG_SYS_NAND_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
91 | CSPR_PORT_SIZE_8 /* Port Size = 8 bit */ \
92 | CSPR_MSEL_NAND /* MSEL = NAND */ \
93 | CSPR_V)
94#define CONFIG_SYS_NAND_AMASK IFC_AMASK(64 * 1024)
95
96#define CONFIG_SYS_NAND_CSOR (CSOR_NAND_ECC_ENC_EN /* ECC on encode */ \
97 | CSOR_NAND_ECC_DEC_EN /* ECC on decode */ \
98 | CSOR_NAND_ECC_MODE_4 /* 4-bit ECC */ \
99 | CSOR_NAND_RAL_3 /* RAL = 3Byes */ \
100 | CSOR_NAND_PGS_2K /* Page Size = 2K */ \
101 | CSOR_NAND_SPRZ_64/* Spare size = 64 */ \
102 | CSOR_NAND_PB(64)) /*Pages Per Block = 64*/
103
Ashish Kumar77697762017-08-31 16:12:55 +0530104/* ONFI NAND Flash mode0 Timing Params */
105#define CONFIG_SYS_NAND_FTIM0 (FTIM0_NAND_TCCST(0x07) | \
106 FTIM0_NAND_TWP(0x18) | \
107 FTIM0_NAND_TWCHT(0x07) | \
108 FTIM0_NAND_TWH(0x0a))
109#define CONFIG_SYS_NAND_FTIM1 (FTIM1_NAND_TADLE(0x32) | \
110 FTIM1_NAND_TWBE(0x39) | \
111 FTIM1_NAND_TRR(0x0e) | \
112 FTIM1_NAND_TRP(0x18))
113#define CONFIG_SYS_NAND_FTIM2 (FTIM2_NAND_TRAD(0x0f) | \
114 FTIM2_NAND_TREH(0x0a) | \
115 FTIM2_NAND_TWHRE(0x1e))
116#define CONFIG_SYS_NAND_FTIM3 0x0
117
118#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
119#define CONFIG_SYS_MAX_NAND_DEVICE 1
120#define CONFIG_MTD_NAND_VERIFY_WRITE
Ashish Kumar77697762017-08-31 16:12:55 +0530121
Ashish Kumar77697762017-08-31 16:12:55 +0530122#define CONFIG_FSL_QIXIS
123#define CONFIG_SYS_I2C_FPGA_ADDR 0x66
124#define QIXIS_LBMAP_SWITCH 6
125#define QIXIS_QMAP_MASK 0xe0
126#define QIXIS_QMAP_SHIFT 5
127#define QIXIS_LBMAP_MASK 0x0f
128#define QIXIS_LBMAP_SHIFT 0
129#define QIXIS_LBMAP_DFLTBANK 0x0e
130#define QIXIS_LBMAP_ALTBANK 0x2e
131#define QIXIS_LBMAP_SD 0x00
Ashish Kumar6c8945e2018-01-17 12:16:37 +0530132#define QIXIS_LBMAP_EMMC 0x00
133#define QIXIS_LBMAP_IFC 0x00
Ashish Kumar77697762017-08-31 16:12:55 +0530134#define QIXIS_LBMAP_SD_QSPI 0x0e
135#define QIXIS_LBMAP_QSPI 0x0e
Ashish Kumar6c8945e2018-01-17 12:16:37 +0530136#define QIXIS_RCW_SRC_IFC 0x25
Ashish Kumar77697762017-08-31 16:12:55 +0530137#define QIXIS_RCW_SRC_SD 0x40
Ashish Kumar6c8945e2018-01-17 12:16:37 +0530138#define QIXIS_RCW_SRC_EMMC 0x41
Ashish Kumar77697762017-08-31 16:12:55 +0530139#define QIXIS_RCW_SRC_QSPI 0x62
140#define QIXIS_RST_CTL_RESET 0x41
141#define QIXIS_RCFG_CTL_RECONFIG_IDLE 0x20
142#define QIXIS_RCFG_CTL_RECONFIG_START 0x21
143#define QIXIS_RCFG_CTL_WATCHDOG_ENBLE 0x08
144#define QIXIS_RST_FORCE_MEM 0x01
145#define QIXIS_STAT_PRES1 0xb
146#define QIXIS_SDID_MASK 0x07
147#define QIXIS_ESDHC_NO_ADAPTER 0x7
148
149#define CONFIG_SYS_FPGA_CSPR_EXT (0x0)
150#define CONFIG_SYS_FPGA_CSPR (CSPR_PHYS_ADDR(QIXIS_BASE_PHYS_EARLY) \
151 | CSPR_PORT_SIZE_8 \
152 | CSPR_MSEL_GPCM \
153 | CSPR_V)
154#define SYS_FPGA_CSPR_FINAL (CSPR_PHYS_ADDR(QIXIS_BASE_PHYS) \
155 | CSPR_PORT_SIZE_8 \
156 | CSPR_MSEL_GPCM \
157 | CSPR_V)
158
Ashish Kumarb555e292018-02-19 14:14:09 +0530159#define SYS_FPGA_AMASK IFC_AMASK(64 * 1024)
Ashish Kumar91fded62017-11-06 13:18:44 +0530160#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
Ashish Kumar77697762017-08-31 16:12:55 +0530161#define CONFIG_SYS_FPGA_CSOR CSOR_GPCM_ADM_SHIFT(0)
162#else
163#define CONFIG_SYS_FPGA_CSOR CSOR_GPCM_ADM_SHIFT(12)
164#endif
165/* QIXIS Timing parameters*/
166#define SYS_FPGA_CS_FTIM0 (FTIM0_GPCM_TACSE(0x0e) | \
167 FTIM0_GPCM_TEADC(0x0e) | \
168 FTIM0_GPCM_TEAHC(0x0e))
169#define SYS_FPGA_CS_FTIM1 (FTIM1_GPCM_TACO(0xff) | \
170 FTIM1_GPCM_TRAD(0x3f))
171#define SYS_FPGA_CS_FTIM2 (FTIM2_GPCM_TCS(0xf) | \
172 FTIM2_GPCM_TCH(0xf) | \
173 FTIM2_GPCM_TWP(0x3E))
174#define SYS_FPGA_CS_FTIM3 0x0
175
Pankit Garg1a12b4a2018-12-27 04:37:57 +0000176#ifdef CONFIG_TFABOOT
177#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NOR0_CSPR_EXT
178#define CONFIG_SYS_CSPR0 CONFIG_SYS_NOR0_CSPR_EARLY
179#define CONFIG_SYS_CSPR0_FINAL CONFIG_SYS_NOR0_CSPR
180#define CONFIG_SYS_AMASK0 CONFIG_SYS_NOR_AMASK
181#define CONFIG_SYS_CSOR0 CONFIG_SYS_NOR_CSOR
182#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NOR_FTIM0
183#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NOR_FTIM1
184#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NOR_FTIM2
185#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NOR_FTIM3
186#define CONFIG_SYS_CSPR1_EXT CONFIG_SYS_NOR0_CSPR_EXT
187#define CONFIG_SYS_CSPR1 CONFIG_SYS_NOR1_CSPR_EARLY
188#define CONFIG_SYS_CSPR1_FINAL CONFIG_SYS_NOR1_CSPR
189#define CONFIG_SYS_AMASK1 CONFIG_SYS_NOR_AMASK_EARLY
190#define CONFIG_SYS_AMASK1_FINAL CONFIG_SYS_NOR_AMASK
191#define CONFIG_SYS_CSOR1 CONFIG_SYS_NOR_CSOR
192#define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NOR_FTIM0
193#define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NOR_FTIM1
194#define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NOR_FTIM2
195#define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NOR_FTIM3
196#define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_NAND_CSPR_EXT
197#define CONFIG_SYS_CSPR2 CONFIG_SYS_NAND_CSPR
198#define CONFIG_SYS_AMASK2 CONFIG_SYS_NAND_AMASK
199#define CONFIG_SYS_CSOR2 CONFIG_SYS_NAND_CSOR
200#define CONFIG_SYS_CS2_FTIM0 CONFIG_SYS_NAND_FTIM0
201#define CONFIG_SYS_CS2_FTIM1 CONFIG_SYS_NAND_FTIM1
202#define CONFIG_SYS_CS2_FTIM2 CONFIG_SYS_NAND_FTIM2
203#define CONFIG_SYS_CS2_FTIM3 CONFIG_SYS_NAND_FTIM3
204#define CONFIG_SYS_CSPR3_EXT CONFIG_SYS_FPGA_CSPR_EXT
205#define CONFIG_SYS_CSPR3 CONFIG_SYS_FPGA_CSPR
206#define CONFIG_SYS_CSPR3_FINAL SYS_FPGA_CSPR_FINAL
207#define CONFIG_SYS_AMASK3 SYS_FPGA_AMASK
208#define CONFIG_SYS_CSOR3 CONFIG_SYS_FPGA_CSOR
209#define CONFIG_SYS_CS3_FTIM0 SYS_FPGA_CS_FTIM0
210#define CONFIG_SYS_CS3_FTIM1 SYS_FPGA_CS_FTIM1
211#define CONFIG_SYS_CS3_FTIM2 SYS_FPGA_CS_FTIM2
212#define CONFIG_SYS_CS3_FTIM3 SYS_FPGA_CS_FTIM3
213#else
Ashish Kumar77697762017-08-31 16:12:55 +0530214#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
215#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NAND_CSPR_EXT
216#define CONFIG_SYS_CSPR0 CONFIG_SYS_NAND_CSPR
217#define CONFIG_SYS_AMASK0 CONFIG_SYS_NAND_AMASK
218#define CONFIG_SYS_CSOR0 CONFIG_SYS_NAND_CSOR
219#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NAND_FTIM0
220#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NAND_FTIM1
221#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NAND_FTIM2
222#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NAND_FTIM3
223#define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_FPGA_CSPR_EXT
224#define CONFIG_SYS_CSPR2 CONFIG_SYS_FPGA_CSPR
225#define CONFIG_SYS_CSPR2_FINAL SYS_FPGA_CSPR_FINAL
Ashish Kumarb555e292018-02-19 14:14:09 +0530226#define CONFIG_SYS_AMASK2 SYS_FPGA_AMASK
Ashish Kumar77697762017-08-31 16:12:55 +0530227#define CONFIG_SYS_CSOR2 CONFIG_SYS_FPGA_CSOR
228#define CONFIG_SYS_CS2_FTIM0 SYS_FPGA_CS_FTIM0
229#define CONFIG_SYS_CS2_FTIM1 SYS_FPGA_CS_FTIM1
230#define CONFIG_SYS_CS2_FTIM2 SYS_FPGA_CS_FTIM2
231#define CONFIG_SYS_CS2_FTIM3 SYS_FPGA_CS_FTIM3
232#else
233#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NOR0_CSPR_EXT
234#define CONFIG_SYS_CSPR0 CONFIG_SYS_NOR0_CSPR_EARLY
235#define CONFIG_SYS_CSPR0_FINAL CONFIG_SYS_NOR0_CSPR
236#define CONFIG_SYS_AMASK0 CONFIG_SYS_NOR_AMASK
237#define CONFIG_SYS_CSOR0 CONFIG_SYS_NOR_CSOR
238#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NOR_FTIM0
239#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NOR_FTIM1
240#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NOR_FTIM2
241#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NOR_FTIM3
242#define CONFIG_SYS_CSPR1_EXT CONFIG_SYS_NOR0_CSPR_EXT
243#define CONFIG_SYS_CSPR1 CONFIG_SYS_NOR1_CSPR_EARLY
244#define CONFIG_SYS_CSPR1_FINAL CONFIG_SYS_NOR1_CSPR
245#define CONFIG_SYS_AMASK1 CONFIG_SYS_NOR_AMASK_EARLY
246#define CONFIG_SYS_AMASK1_FINAL CONFIG_SYS_NOR_AMASK
247#define CONFIG_SYS_CSOR1 CONFIG_SYS_NOR_CSOR
248#define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NOR_FTIM0
249#define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NOR_FTIM1
250#define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NOR_FTIM2
251#define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NOR_FTIM3
252#define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_NAND_CSPR_EXT
253#define CONFIG_SYS_CSPR2 CONFIG_SYS_NAND_CSPR
254#define CONFIG_SYS_AMASK2 CONFIG_SYS_NAND_AMASK
255#define CONFIG_SYS_CSOR2 CONFIG_SYS_NAND_CSOR
256#define CONFIG_SYS_CS2_FTIM0 CONFIG_SYS_NAND_FTIM0
257#define CONFIG_SYS_CS2_FTIM1 CONFIG_SYS_NAND_FTIM1
258#define CONFIG_SYS_CS2_FTIM2 CONFIG_SYS_NAND_FTIM2
259#define CONFIG_SYS_CS2_FTIM3 CONFIG_SYS_NAND_FTIM3
260#define CONFIG_SYS_CSPR3_EXT CONFIG_SYS_FPGA_CSPR_EXT
261#define CONFIG_SYS_CSPR3 CONFIG_SYS_FPGA_CSPR
Ashish Kumarb555e292018-02-19 14:14:09 +0530262#define CONFIG_SYS_CSPR3_FINAL SYS_FPGA_CSPR_FINAL
263#define CONFIG_SYS_AMASK3 SYS_FPGA_AMASK
Ashish Kumar77697762017-08-31 16:12:55 +0530264#define CONFIG_SYS_CSOR3 CONFIG_SYS_FPGA_CSOR
Ashish Kumarb555e292018-02-19 14:14:09 +0530265#define CONFIG_SYS_CS3_FTIM0 SYS_FPGA_CS_FTIM0
266#define CONFIG_SYS_CS3_FTIM1 SYS_FPGA_CS_FTIM1
267#define CONFIG_SYS_CS3_FTIM2 SYS_FPGA_CS_FTIM2
268#define CONFIG_SYS_CS3_FTIM3 SYS_FPGA_CS_FTIM3
Ashish Kumar77697762017-08-31 16:12:55 +0530269#endif
Pankit Garg1a12b4a2018-12-27 04:37:57 +0000270#endif
Ashish Kumar77697762017-08-31 16:12:55 +0530271
272#define CONFIG_SYS_LS_MC_BOOT_TIMEOUT_MS 5000
273
274/*
275 * I2C bus multiplexer
276 */
277#define I2C_MUX_PCA_ADDR_PRI 0x77
278#define I2C_MUX_PCA_ADDR_SEC 0x76 /* Secondary multiplexer */
279#define I2C_RETIMER_ADDR 0x18
280#define I2C_RETIMER_ADDR2 0x19
281#define I2C_MUX_CH_DEFAULT 0x8
282#define I2C_MUX_CH5 0xD
283
Rajesh Bhagat23a12cb2018-01-17 16:13:05 +0530284#define I2C_MUX_CH_VOL_MONITOR 0xA
285
286/* Voltage monitor on channel 2*/
287#define I2C_VOL_MONITOR_ADDR 0x63
288#define I2C_VOL_MONITOR_BUS_V_OFFSET 0x2
289#define I2C_VOL_MONITOR_BUS_V_OVF 0x1
290#define I2C_VOL_MONITOR_BUS_V_SHIFT 3
Rajesh Bhagatef0789b2018-01-17 16:13:09 +0530291#define I2C_SVDD_MONITOR_ADDR 0x4F
292
Rajesh Bhagatef0789b2018-01-17 16:13:09 +0530293/* The lowest and highest voltage allowed for LS1088AQDS */
294#define VDD_MV_MIN 819
295#define VDD_MV_MAX 1212
296
Rajesh Bhagat23a12cb2018-01-17 16:13:05 +0530297#define PWM_CHANNEL0 0x0
298
Ashish Kumar77697762017-08-31 16:12:55 +0530299/*
300* RTC configuration
301*/
302#define RTC
Ashish Kumar77697762017-08-31 16:12:55 +0530303#define CONFIG_SYS_I2C_RTC_ADDR 0x51 /* Channel 3*/
Ashish Kumar77697762017-08-31 16:12:55 +0530304
305/* EEPROM */
Ashish Kumar77697762017-08-31 16:12:55 +0530306#define CONFIG_SYS_I2C_EEPROM_NXID
307#define CONFIG_SYS_EEPROM_BUS_NUM 0
Ashish Kumar77697762017-08-31 16:12:55 +0530308
Ashish Kumar77697762017-08-31 16:12:55 +0530309#ifdef CONFIG_FSL_DSPI
Pankit Garg1a12b4a2018-12-27 04:37:57 +0000310#if !defined(CONFIG_TFABOOT) && \
311 !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_SD_BOOT_QSPI)
Ashish Kumar77697762017-08-31 16:12:55 +0530312#endif
313#endif
314
Ashish Kumar91fded62017-11-06 13:18:44 +0530315#ifdef CONFIG_SPL_BUILD
316#define CONFIG_SYS_MONITOR_BASE CONFIG_SPL_TEXT_BASE
317#else
Ashish Kumar77697762017-08-31 16:12:55 +0530318#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
Ashish Kumar91fded62017-11-06 13:18:44 +0530319#endif
Ashish Kumar77697762017-08-31 16:12:55 +0530320
321#define CONFIG_FSL_MEMAC
322
323/* MMC */
Ashish Kumar77697762017-08-31 16:12:55 +0530324#define CONFIG_ESDHC_DETECT_QUIRK ((readb(QIXIS_BASE + QIXIS_STAT_PRES1) & \
325 QIXIS_SDID_MASK) != QIXIS_ESDHC_NO_ADAPTER)
326
Biwen Li166e40b2020-12-10 11:02:47 +0800327#define COMMON_ENV \
328 "kernelheader_addr_r=0x80200000\0" \
329 "fdtheader_addr_r=0x80100000\0" \
330 "kernel_addr_r=0x81000000\0" \
331 "fdt_addr_r=0x90000000\0" \
332 "load_addr=0xa0000000\0"
333
Ashish Kumar77697762017-08-31 16:12:55 +0530334/* Initial environment variables */
Udit Agarwal5536c3c2019-11-07 16:11:32 +0000335#ifdef CONFIG_NXP_ESBC
Udit Agarwal30c41d22017-11-22 09:01:26 +0530336#undef CONFIG_EXTRA_ENV_SETTINGS
337#define CONFIG_EXTRA_ENV_SETTINGS \
Biwen Li166e40b2020-12-10 11:02:47 +0800338 COMMON_ENV \
Udit Agarwal30c41d22017-11-22 09:01:26 +0530339 "hwconfig=fsl_ddr:bank_intlv=auto\0" \
340 "loadaddr=0x90100000\0" \
341 "kernel_addr=0x100000\0" \
342 "ramdisk_addr=0x800000\0" \
343 "ramdisk_size=0x2000000\0" \
344 "fdt_high=0xa0000000\0" \
345 "initrd_high=0xffffffffffffffff\0" \
346 "kernel_start=0x1000000\0" \
347 "kernel_load=0xa0000000\0" \
348 "kernel_size=0x2800000\0" \
Priyanka Jain50ddea62021-07-19 14:51:24 +0530349 "mcinitcmd=sf probe 0:0;sf read 0xa0a00000 0xa00000 0x200000;" \
Priyanka Singh4238e372020-01-22 10:32:34 +0000350 "sf read 0xa0640000 0x640000 0x4000; esbc_validate 0xa0640000;" \
Udit Agarwal30c41d22017-11-22 09:01:26 +0530351 "sf read 0xa0e00000 0xe00000 0x100000;" \
Priyanka Singh4238e372020-01-22 10:32:34 +0000352 "sf read 0xa0680000 0x680000 0x4000;esbc_validate 0xa0680000;" \
Udit Agarwal30c41d22017-11-22 09:01:26 +0530353 "fsl_mc start mc 0xa0a00000 0xa0e00000\0" \
354 "mcmemsize=0x70000000 \0"
Udit Agarwal5536c3c2019-11-07 16:11:32 +0000355#else /* if !(CONFIG_NXP_ESBC) */
Pankit Garg1a12b4a2018-12-27 04:37:57 +0000356#ifdef CONFIG_TFABOOT
357#define QSPI_MC_INIT_CMD \
Priyanka Jain50ddea62021-07-19 14:51:24 +0530358 "sf probe 0:0;sf read 0x80a00000 0xA00000 0x200000;" \
359 "sf read 0x80e00000 0xE00000 0x100000;" \
360 "fsl_mc start mc 0x80a00000 0x80e00000\0"
Pankit Garg1a12b4a2018-12-27 04:37:57 +0000361#define SD_MC_INIT_CMD \
Priyanka Jain50ddea62021-07-19 14:51:24 +0530362 "mmcinfo;mmc read 0x80a00000 0x5000 0x1000;" \
363 "mmc read 0x80e00000 0x7000 0x800;" \
364 "fsl_mc start mc 0x80a00000 0x80e00000\0"
Pankit Garg1a12b4a2018-12-27 04:37:57 +0000365#define IFC_MC_INIT_CMD \
366 "fsl_mc start mc 0x580A00000 0x580E00000\0"
367
368#undef CONFIG_EXTRA_ENV_SETTINGS
369#define CONFIG_EXTRA_ENV_SETTINGS \
Biwen Li166e40b2020-12-10 11:02:47 +0800370 COMMON_ENV \
Pankit Garg1a12b4a2018-12-27 04:37:57 +0000371 "hwconfig=fsl_ddr:bank_intlv=auto\0" \
372 "loadaddr=0x90100000\0" \
373 "kernel_addr=0x100000\0" \
374 "kernel_addr_sd=0x800\0" \
375 "ramdisk_addr=0x800000\0" \
376 "ramdisk_size=0x2000000\0" \
377 "fdt_high=0xa0000000\0" \
378 "initrd_high=0xffffffffffffffff\0" \
379 "kernel_start=0x1000000\0" \
380 "kernel_start_sd=0x8000\0" \
381 "kernel_load=0xa0000000\0" \
382 "kernel_size=0x2800000\0" \
383 "kernel_size_sd=0x14000\0" \
Priyanka Jain50ddea62021-07-19 14:51:24 +0530384 "mcinitcmd=sf probe 0:0;sf read 0x80a00000 0xA00000 0x200000;" \
385 "sf read 0x80e00000 0xE00000 0x100000;" \
386 "fsl_mc start mc 0x80a00000 0x80e00000\0" \
Biwen Li472dfe52020-03-19 19:38:42 +0800387 "mcmemsize=0x70000000 \0" \
388 "BOARD=ls1088aqds\0" \
389 "scriptaddr=0x80000000\0" \
390 "scripthdraddr=0x80080000\0" \
391 BOOTENV \
392 "boot_scripts=ls1088aqds_boot.scr\0" \
393 "boot_script_hdr=hdr_ls1088aqds_bs.out\0" \
394 "scan_dev_for_boot_part=" \
395 "part list ${devtype} ${devnum} devplist; " \
396 "env exists devplist || setenv devplist 1; " \
397 "for distro_bootpart in ${devplist}; do " \
398 "if fstype ${devtype} " \
399 "${devnum}:${distro_bootpart} " \
400 "bootfstype; then " \
401 "run scan_dev_for_boot; " \
402 "fi; " \
403 "done\0" \
404 "boot_a_script=" \
405 "load ${devtype} ${devnum}:${distro_bootpart} " \
406 "${scriptaddr} ${prefix}${script}; " \
407 "env exists secureboot && load ${devtype} " \
408 "${devnum}:${distro_bootpart} " \
409 "${scripthdraddr} ${prefix}${boot_script_hdr}; "\
410 "env exists secureboot " \
411 "&& esbc_validate ${scripthdraddr};" \
412 "source ${scriptaddr}\0" \
413 "qspi_bootcmd=echo Trying load from qspi..; " \
414 "sf probe 0:0; " \
415 "sf read 0x80001000 0xd00000 0x100000; " \
416 "fsl_mc lazyapply dpl 0x80001000 && " \
417 "sf read $kernel_load $kernel_start " \
418 "$kernel_size && bootm $kernel_load#$BOARD\0" \
419 "sd_bootcmd=echo Trying load from sd card..; " \
420 "mmcinfo;mmc read 0x80001000 0x6800 0x800; "\
421 "fsl_mc lazyapply dpl 0x80001000 && " \
422 "mmc read $kernel_load $kernel_start_sd " \
423 "$kernel_size_sd && bootm $kernel_load#$BOARD\0" \
424 "nor_bootcmd=echo Trying load from nor..; " \
425 "fsl_mc lazyapply dpl 0x580d00000 && " \
426 "cp.b $kernel_start $kernel_load " \
427 "$kernel_size && bootm $kernel_load#$BOARD\0"
Pankit Garg1a12b4a2018-12-27 04:37:57 +0000428#else
Ashish Kumar77697762017-08-31 16:12:55 +0530429#if defined(CONFIG_QSPI_BOOT)
430#undef CONFIG_EXTRA_ENV_SETTINGS
431#define CONFIG_EXTRA_ENV_SETTINGS \
Biwen Li166e40b2020-12-10 11:02:47 +0800432 COMMON_ENV \
Ashish Kumar77697762017-08-31 16:12:55 +0530433 "hwconfig=fsl_ddr:bank_intlv=auto\0" \
434 "loadaddr=0x90100000\0" \
435 "kernel_addr=0x100000\0" \
436 "ramdisk_addr=0x800000\0" \
437 "ramdisk_size=0x2000000\0" \
438 "fdt_high=0xa0000000\0" \
439 "initrd_high=0xffffffffffffffff\0" \
440 "kernel_start=0x1000000\0" \
441 "kernel_load=0xa0000000\0" \
442 "kernel_size=0x2800000\0" \
Priyanka Jain50ddea62021-07-19 14:51:24 +0530443 "mcinitcmd=sf probe 0:0;sf read 0x80a00000 0xA00000 0x200000;" \
444 "sf read 0x80e00000 0xE00000 0x100000;" \
445 "fsl_mc start mc 0x80a00000 0x80e00000\0" \
Ashish Kumar77697762017-08-31 16:12:55 +0530446 "mcmemsize=0x70000000 \0"
Ashish Kumar91fded62017-11-06 13:18:44 +0530447#elif defined(CONFIG_SD_BOOT)
448#undef CONFIG_EXTRA_ENV_SETTINGS
449#define CONFIG_EXTRA_ENV_SETTINGS \
Biwen Li166e40b2020-12-10 11:02:47 +0800450 COMMON_ENV \
Ashish Kumar91fded62017-11-06 13:18:44 +0530451 "hwconfig=fsl_ddr:bank_intlv=auto\0" \
452 "loadaddr=0x90100000\0" \
453 "kernel_addr=0x800\0" \
454 "ramdisk_addr=0x800000\0" \
455 "ramdisk_size=0x2000000\0" \
456 "fdt_high=0xa0000000\0" \
457 "initrd_high=0xffffffffffffffff\0" \
458 "kernel_start=0x8000\0" \
459 "kernel_load=0xa0000000\0" \
460 "kernel_size=0x14000\0" \
Priyanka Jain50ddea62021-07-19 14:51:24 +0530461 "mcinitcmd=mmcinfo;mmc read 0x80a00000 0x5000 0x1000;" \
462 "mmc read 0x80e00000 0x7000 0x800;" \
463 "fsl_mc start mc 0x80a00000 0x80e00000\0" \
Ashish Kumar91fded62017-11-06 13:18:44 +0530464 "mcmemsize=0x70000000 \0"
Ashish Kumar77697762017-08-31 16:12:55 +0530465#else /* NOR BOOT */
466#undef CONFIG_EXTRA_ENV_SETTINGS
467#define CONFIG_EXTRA_ENV_SETTINGS \
Biwen Li166e40b2020-12-10 11:02:47 +0800468 COMMON_ENV \
Ashish Kumar77697762017-08-31 16:12:55 +0530469 "hwconfig=fsl_ddr:bank_intlv=auto\0" \
470 "loadaddr=0x90100000\0" \
471 "kernel_addr=0x100000\0" \
472 "ramdisk_addr=0x800000\0" \
473 "ramdisk_size=0x2000000\0" \
474 "fdt_high=0xa0000000\0" \
475 "initrd_high=0xffffffffffffffff\0" \
476 "kernel_start=0x1000000\0" \
477 "kernel_load=0xa0000000\0" \
478 "kernel_size=0x2800000\0" \
479 "mcinitcmd=fsl_mc start mc 0x580A00000 0x580E00000\0" \
480 "mcmemsize=0x70000000 \0"
481#endif
Pankit Garg1a12b4a2018-12-27 04:37:57 +0000482#endif /* CONFIG_TFABOOT */
Udit Agarwal5536c3c2019-11-07 16:11:32 +0000483#endif /* CONFIG_NXP_ESBC */
Ashish Kumar77697762017-08-31 16:12:55 +0530484
Biwen Li472dfe52020-03-19 19:38:42 +0800485#ifdef CONFIG_TFABOOT
486#define QSPI_NOR_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; " \
487 "env exists secureboot && esbc_halt;;"
488#define IFC_NOR_BOOTCOMMAND "run distro_bootcmd; run nor_bootcmd; " \
489 "env exists secureboot && esbc_halt;;"
490#define SD_BOOTCOMMAND "run distro_bootcmd; run sd_bootcmd; " \
491 "env exists secureboot && esbc_halt;;"
492#endif
493
Ashish Kumar77697762017-08-31 16:12:55 +0530494#ifdef CONFIG_FSL_MC_ENET
495#define CONFIG_FSL_MEMAC
Ashish Kumar77697762017-08-31 16:12:55 +0530496#define RGMII_PHY1_ADDR 0x1
497#define RGMII_PHY2_ADDR 0x2
498#define SGMII_CARD_PORT1_PHY_ADDR 0x1C
499#define SGMII_CARD_PORT2_PHY_ADDR 0x1d
500#define SGMII_CARD_PORT3_PHY_ADDR 0x1E
501#define SGMII_CARD_PORT4_PHY_ADDR 0x1F
502
503#define XQSGMII_CARD_PHY1_PORT0_ADDR 0x0
504#define XQSGMII_CARD_PHY1_PORT1_ADDR 0x1
505#define XQSGMII_CARD_PHY1_PORT2_ADDR 0x2
506#define XQSGMII_CARD_PHY1_PORT3_ADDR 0x3
507#define XQSGMII_CARD_PHY2_PORT0_ADDR 0x4
508#define XQSGMII_CARD_PHY2_PORT1_ADDR 0x5
509#define XQSGMII_CARD_PHY2_PORT2_ADDR 0x6
510#define XQSGMII_CARD_PHY2_PORT3_ADDR 0x7
511#define XQSGMII_CARD_PHY3_PORT0_ADDR 0x8
512#define XQSGMII_CARD_PHY3_PORT1_ADDR 0x9
513#define XQSGMII_CARD_PHY3_PORT2_ADDR 0xa
514#define XQSGMII_CARD_PHY3_PORT3_ADDR 0xb
515#define XQSGMII_CARD_PHY4_PORT0_ADDR 0xc
516#define XQSGMII_CARD_PHY4_PORT1_ADDR 0xd
517#define XQSGMII_CARD_PHY4_PORT2_ADDR 0xe
518#define XQSGMII_CARD_PHY4_PORT3_ADDR 0xf
519
Ashish Kumar77697762017-08-31 16:12:55 +0530520#define CONFIG_ETHPRIME "DPMAC1@xgmii"
Ashish Kumar77697762017-08-31 16:12:55 +0530521
522#endif
523
Ashish Kumar77697762017-08-31 16:12:55 +0530524#define BOOT_TARGET_DEVICES(func) \
525 func(USB, usb, 0) \
526 func(MMC, mmc, 0) \
527 func(SCSI, scsi, 0) \
528 func(DHCP, dhcp, na)
529#include <config_distro_bootcmd.h>
530
531#include <asm/fsl_secure_boot.h>
532
533#endif /* __LS1088A_QDS_H */