blob: 2bc910a3fc85e3134462e05a8fe16a41be5f1c99 [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/*
Priyanka Singh4238e372020-01-22 10:32:34 +00003 * Copyright 2017, 2020 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
11
Ashish Kumar77697762017-08-31 16:12:55 +053012#ifndef __ASSEMBLY__
13unsigned long get_board_sys_clk(void);
14unsigned long get_board_ddr_clk(void);
15#endif
16
Pankit Garg1a12b4a2018-12-27 04:37:57 +000017#ifdef CONFIG_TFABOOT
18#define CONFIG_SYS_MMC_ENV_DEV 0
Ashish Kumar77697762017-08-31 16:12:55 +053019
Chuanhua Han17489902019-08-01 16:36:57 +080020#define CONFIG_MISC_INIT_R
Pankit Garg1a12b4a2018-12-27 04:37:57 +000021#else
Ashish Kumar77697762017-08-31 16:12:55 +053022#if defined(CONFIG_QSPI_BOOT)
Ashish Kumar91fded62017-11-06 13:18:44 +053023#elif defined(CONFIG_SD_BOOT)
Ashish Kumar91fded62017-11-06 13:18:44 +053024#define CONFIG_SYS_MMC_ENV_DEV 0
Ashish Kumar77697762017-08-31 16:12:55 +053025#endif
Pankit Garg1a12b4a2018-12-27 04:37:57 +000026#endif
Ashish Kumar77697762017-08-31 16:12:55 +053027
Ashish Kumar91fded62017-11-06 13:18:44 +053028#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
Ashish Kumar77697762017-08-31 16:12:55 +053029#define CONFIG_QIXIS_I2C_ACCESS
30#define SYS_NO_FLASH
31
Ashish Kumar91fded62017-11-06 13:18:44 +053032#undef CONFIG_CMD_IMLS
Ashish Kumar77697762017-08-31 16:12:55 +053033#define CONFIG_SYS_CLK_FREQ 100000000
34#define CONFIG_DDR_CLK_FREQ 100000000
35#else
Ashish Kumarc1c597e2018-02-19 14:16:58 +053036#define CONFIG_QIXIS_I2C_ACCESS
Chuanhua Hanc8b2e362019-07-26 20:25:35 +080037#ifndef CONFIG_DM_I2C
Ashish Kumarc1c597e2018-02-19 14:16:58 +053038#define CONFIG_SYS_I2C_EARLY_INIT
Chuanhua Hanc8b2e362019-07-26 20:25:35 +080039#endif
Ashish Kumar77697762017-08-31 16:12:55 +053040#define CONFIG_SYS_CLK_FREQ get_board_sys_clk()
41#define CONFIG_DDR_CLK_FREQ get_board_ddr_clk()
42#endif
43
44#define COUNTER_FREQUENCY_REAL (CONFIG_SYS_CLK_FREQ/4)
45#define COUNTER_FREQUENCY 25000000 /* 25MHz */
46
47#define CONFIG_DIMM_SLOTS_PER_CTLR 1
48
49#define CONFIG_DDR_SPD
50#define CONFIG_DDR_ECC
51#define CONFIG_ECC_INIT_VIA_DDRCONTROLLER
52#define CONFIG_MEM_INIT_VALUE 0xdeadbeef
53#define SPD_EEPROM_ADDRESS 0x51
54#define CONFIG_SYS_SPD_BUS_NUM 0
55
56
57/*
58 * IFC Definitions
59 */
60#if !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_SD_BOOT_QSPI)
61#define CONFIG_SYS_NOR0_CSPR_EXT (0x0)
62#define CONFIG_SYS_NOR_AMASK IFC_AMASK(128*1024*1024)
63#define CONFIG_SYS_NOR_AMASK_EARLY IFC_AMASK(64*1024*1024)
64
65#define CONFIG_SYS_NOR0_CSPR \
66 (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS) | \
67 CSPR_PORT_SIZE_16 | \
68 CSPR_MSEL_NOR | \
69 CSPR_V)
70#define CONFIG_SYS_NOR0_CSPR_EARLY \
71 (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS_EARLY) | \
72 CSPR_PORT_SIZE_16 | \
73 CSPR_MSEL_NOR | \
74 CSPR_V)
75#define CONFIG_SYS_NOR1_CSPR \
76 (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH1_BASE_PHYS) | \
77 CSPR_PORT_SIZE_16 | \
78 CSPR_MSEL_NOR | \
79 CSPR_V)
80#define CONFIG_SYS_NOR1_CSPR_EARLY \
81 (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH1_BASE_PHYS_EARLY) | \
82 CSPR_PORT_SIZE_16 | \
83 CSPR_MSEL_NOR | \
84 CSPR_V)
85#define CONFIG_SYS_NOR_CSOR CSOR_NOR_ADM_SHIFT(12)
86#define CONFIG_SYS_NOR_FTIM0 (FTIM0_NOR_TACSE(0x4) | \
87 FTIM0_NOR_TEADC(0x5) | \
Ashish Kumarc1c597e2018-02-19 14:16:58 +053088 FTIM0_NOR_TAVDS(0x6) | \
Ashish Kumar77697762017-08-31 16:12:55 +053089 FTIM0_NOR_TEAHC(0x5))
90#define CONFIG_SYS_NOR_FTIM1 (FTIM1_NOR_TACO(0x35) | \
Ashish Kumarc1c597e2018-02-19 14:16:58 +053091 FTIM1_NOR_TRAD_NOR(0x1a) | \
Ashish Kumar77697762017-08-31 16:12:55 +053092 FTIM1_NOR_TSEQRAD_NOR(0x13))
Ashish Kumarc1c597e2018-02-19 14:16:58 +053093#define CONFIG_SYS_NOR_FTIM2 (FTIM2_NOR_TCS(0x8) | \
94 FTIM2_NOR_TCH(0x8) | \
95 FTIM2_NOR_TWPH(0xe) | \
Ashish Kumar77697762017-08-31 16:12:55 +053096 FTIM2_NOR_TWP(0x1c))
97#define CONFIG_SYS_NOR_FTIM3 0x04000000
98#define CONFIG_SYS_IFC_CCR 0x01000000
99
100#ifndef SYS_NO_FLASH
Ashish Kumar77697762017-08-31 16:12:55 +0530101#define CONFIG_SYS_FLASH_QUIET_TEST
102#define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */
103
104#define CONFIG_SYS_MAX_FLASH_BANKS 2 /* number of banks */
105#define CONFIG_SYS_MAX_FLASH_SECT 1024 /* sectors per device */
106#define CONFIG_SYS_FLASH_ERASE_TOUT 60000 /* Flash Erase Timeout (ms) */
107#define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (ms) */
108
109#define CONFIG_SYS_FLASH_EMPTY_INFO
110#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE,\
111 CONFIG_SYS_FLASH_BASE + 0x40000000}
112#endif
113#endif
114
115#define CONFIG_NAND_FSL_IFC
116#define CONFIG_SYS_NAND_MAX_ECCPOS 256
117#define CONFIG_SYS_NAND_MAX_OOBFREE 2
118
119#define CONFIG_SYS_NAND_CSPR_EXT (0x0)
120#define CONFIG_SYS_NAND_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
121 | CSPR_PORT_SIZE_8 /* Port Size = 8 bit */ \
122 | CSPR_MSEL_NAND /* MSEL = NAND */ \
123 | CSPR_V)
124#define CONFIG_SYS_NAND_AMASK IFC_AMASK(64 * 1024)
125
126#define CONFIG_SYS_NAND_CSOR (CSOR_NAND_ECC_ENC_EN /* ECC on encode */ \
127 | CSOR_NAND_ECC_DEC_EN /* ECC on decode */ \
128 | CSOR_NAND_ECC_MODE_4 /* 4-bit ECC */ \
129 | CSOR_NAND_RAL_3 /* RAL = 3Byes */ \
130 | CSOR_NAND_PGS_2K /* Page Size = 2K */ \
131 | CSOR_NAND_SPRZ_64/* Spare size = 64 */ \
132 | CSOR_NAND_PB(64)) /*Pages Per Block = 64*/
133
134#define CONFIG_SYS_NAND_ONFI_DETECTION
135
136/* ONFI NAND Flash mode0 Timing Params */
137#define CONFIG_SYS_NAND_FTIM0 (FTIM0_NAND_TCCST(0x07) | \
138 FTIM0_NAND_TWP(0x18) | \
139 FTIM0_NAND_TWCHT(0x07) | \
140 FTIM0_NAND_TWH(0x0a))
141#define CONFIG_SYS_NAND_FTIM1 (FTIM1_NAND_TADLE(0x32) | \
142 FTIM1_NAND_TWBE(0x39) | \
143 FTIM1_NAND_TRR(0x0e) | \
144 FTIM1_NAND_TRP(0x18))
145#define CONFIG_SYS_NAND_FTIM2 (FTIM2_NAND_TRAD(0x0f) | \
146 FTIM2_NAND_TREH(0x0a) | \
147 FTIM2_NAND_TWHRE(0x1e))
148#define CONFIG_SYS_NAND_FTIM3 0x0
149
150#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
151#define CONFIG_SYS_MAX_NAND_DEVICE 1
152#define CONFIG_MTD_NAND_VERIFY_WRITE
153#define CONFIG_CMD_NAND
154
155#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
156
157#define CONFIG_FSL_QIXIS
158#define CONFIG_SYS_I2C_FPGA_ADDR 0x66
159#define QIXIS_LBMAP_SWITCH 6
160#define QIXIS_QMAP_MASK 0xe0
161#define QIXIS_QMAP_SHIFT 5
162#define QIXIS_LBMAP_MASK 0x0f
163#define QIXIS_LBMAP_SHIFT 0
164#define QIXIS_LBMAP_DFLTBANK 0x0e
165#define QIXIS_LBMAP_ALTBANK 0x2e
166#define QIXIS_LBMAP_SD 0x00
Ashish Kumar6c8945e2018-01-17 12:16:37 +0530167#define QIXIS_LBMAP_EMMC 0x00
168#define QIXIS_LBMAP_IFC 0x00
Ashish Kumar77697762017-08-31 16:12:55 +0530169#define QIXIS_LBMAP_SD_QSPI 0x0e
170#define QIXIS_LBMAP_QSPI 0x0e
Ashish Kumar6c8945e2018-01-17 12:16:37 +0530171#define QIXIS_RCW_SRC_IFC 0x25
Ashish Kumar77697762017-08-31 16:12:55 +0530172#define QIXIS_RCW_SRC_SD 0x40
Ashish Kumar6c8945e2018-01-17 12:16:37 +0530173#define QIXIS_RCW_SRC_EMMC 0x41
Ashish Kumar77697762017-08-31 16:12:55 +0530174#define QIXIS_RCW_SRC_QSPI 0x62
175#define QIXIS_RST_CTL_RESET 0x41
176#define QIXIS_RCFG_CTL_RECONFIG_IDLE 0x20
177#define QIXIS_RCFG_CTL_RECONFIG_START 0x21
178#define QIXIS_RCFG_CTL_WATCHDOG_ENBLE 0x08
179#define QIXIS_RST_FORCE_MEM 0x01
180#define QIXIS_STAT_PRES1 0xb
181#define QIXIS_SDID_MASK 0x07
182#define QIXIS_ESDHC_NO_ADAPTER 0x7
183
184#define CONFIG_SYS_FPGA_CSPR_EXT (0x0)
185#define CONFIG_SYS_FPGA_CSPR (CSPR_PHYS_ADDR(QIXIS_BASE_PHYS_EARLY) \
186 | CSPR_PORT_SIZE_8 \
187 | CSPR_MSEL_GPCM \
188 | CSPR_V)
189#define SYS_FPGA_CSPR_FINAL (CSPR_PHYS_ADDR(QIXIS_BASE_PHYS) \
190 | CSPR_PORT_SIZE_8 \
191 | CSPR_MSEL_GPCM \
192 | CSPR_V)
193
Ashish Kumarb555e292018-02-19 14:14:09 +0530194#define SYS_FPGA_AMASK IFC_AMASK(64 * 1024)
Ashish Kumar91fded62017-11-06 13:18:44 +0530195#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
Ashish Kumar77697762017-08-31 16:12:55 +0530196#define CONFIG_SYS_FPGA_CSOR CSOR_GPCM_ADM_SHIFT(0)
197#else
198#define CONFIG_SYS_FPGA_CSOR CSOR_GPCM_ADM_SHIFT(12)
199#endif
200/* QIXIS Timing parameters*/
201#define SYS_FPGA_CS_FTIM0 (FTIM0_GPCM_TACSE(0x0e) | \
202 FTIM0_GPCM_TEADC(0x0e) | \
203 FTIM0_GPCM_TEAHC(0x0e))
204#define SYS_FPGA_CS_FTIM1 (FTIM1_GPCM_TACO(0xff) | \
205 FTIM1_GPCM_TRAD(0x3f))
206#define SYS_FPGA_CS_FTIM2 (FTIM2_GPCM_TCS(0xf) | \
207 FTIM2_GPCM_TCH(0xf) | \
208 FTIM2_GPCM_TWP(0x3E))
209#define SYS_FPGA_CS_FTIM3 0x0
210
Pankit Garg1a12b4a2018-12-27 04:37:57 +0000211#ifdef CONFIG_TFABOOT
212#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NOR0_CSPR_EXT
213#define CONFIG_SYS_CSPR0 CONFIG_SYS_NOR0_CSPR_EARLY
214#define CONFIG_SYS_CSPR0_FINAL CONFIG_SYS_NOR0_CSPR
215#define CONFIG_SYS_AMASK0 CONFIG_SYS_NOR_AMASK
216#define CONFIG_SYS_CSOR0 CONFIG_SYS_NOR_CSOR
217#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NOR_FTIM0
218#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NOR_FTIM1
219#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NOR_FTIM2
220#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NOR_FTIM3
221#define CONFIG_SYS_CSPR1_EXT CONFIG_SYS_NOR0_CSPR_EXT
222#define CONFIG_SYS_CSPR1 CONFIG_SYS_NOR1_CSPR_EARLY
223#define CONFIG_SYS_CSPR1_FINAL CONFIG_SYS_NOR1_CSPR
224#define CONFIG_SYS_AMASK1 CONFIG_SYS_NOR_AMASK_EARLY
225#define CONFIG_SYS_AMASK1_FINAL CONFIG_SYS_NOR_AMASK
226#define CONFIG_SYS_CSOR1 CONFIG_SYS_NOR_CSOR
227#define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NOR_FTIM0
228#define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NOR_FTIM1
229#define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NOR_FTIM2
230#define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NOR_FTIM3
231#define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_NAND_CSPR_EXT
232#define CONFIG_SYS_CSPR2 CONFIG_SYS_NAND_CSPR
233#define CONFIG_SYS_AMASK2 CONFIG_SYS_NAND_AMASK
234#define CONFIG_SYS_CSOR2 CONFIG_SYS_NAND_CSOR
235#define CONFIG_SYS_CS2_FTIM0 CONFIG_SYS_NAND_FTIM0
236#define CONFIG_SYS_CS2_FTIM1 CONFIG_SYS_NAND_FTIM1
237#define CONFIG_SYS_CS2_FTIM2 CONFIG_SYS_NAND_FTIM2
238#define CONFIG_SYS_CS2_FTIM3 CONFIG_SYS_NAND_FTIM3
239#define CONFIG_SYS_CSPR3_EXT CONFIG_SYS_FPGA_CSPR_EXT
240#define CONFIG_SYS_CSPR3 CONFIG_SYS_FPGA_CSPR
241#define CONFIG_SYS_CSPR3_FINAL SYS_FPGA_CSPR_FINAL
242#define CONFIG_SYS_AMASK3 SYS_FPGA_AMASK
243#define CONFIG_SYS_CSOR3 CONFIG_SYS_FPGA_CSOR
244#define CONFIG_SYS_CS3_FTIM0 SYS_FPGA_CS_FTIM0
245#define CONFIG_SYS_CS3_FTIM1 SYS_FPGA_CS_FTIM1
246#define CONFIG_SYS_CS3_FTIM2 SYS_FPGA_CS_FTIM2
247#define CONFIG_SYS_CS3_FTIM3 SYS_FPGA_CS_FTIM3
248#else
Ashish Kumar77697762017-08-31 16:12:55 +0530249#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
250#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NAND_CSPR_EXT
251#define CONFIG_SYS_CSPR0 CONFIG_SYS_NAND_CSPR
252#define CONFIG_SYS_AMASK0 CONFIG_SYS_NAND_AMASK
253#define CONFIG_SYS_CSOR0 CONFIG_SYS_NAND_CSOR
254#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NAND_FTIM0
255#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NAND_FTIM1
256#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NAND_FTIM2
257#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NAND_FTIM3
258#define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_FPGA_CSPR_EXT
259#define CONFIG_SYS_CSPR2 CONFIG_SYS_FPGA_CSPR
260#define CONFIG_SYS_CSPR2_FINAL SYS_FPGA_CSPR_FINAL
Ashish Kumarb555e292018-02-19 14:14:09 +0530261#define CONFIG_SYS_AMASK2 SYS_FPGA_AMASK
Ashish Kumar77697762017-08-31 16:12:55 +0530262#define CONFIG_SYS_CSOR2 CONFIG_SYS_FPGA_CSOR
263#define CONFIG_SYS_CS2_FTIM0 SYS_FPGA_CS_FTIM0
264#define CONFIG_SYS_CS2_FTIM1 SYS_FPGA_CS_FTIM1
265#define CONFIG_SYS_CS2_FTIM2 SYS_FPGA_CS_FTIM2
266#define CONFIG_SYS_CS2_FTIM3 SYS_FPGA_CS_FTIM3
267#else
268#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NOR0_CSPR_EXT
269#define CONFIG_SYS_CSPR0 CONFIG_SYS_NOR0_CSPR_EARLY
270#define CONFIG_SYS_CSPR0_FINAL CONFIG_SYS_NOR0_CSPR
271#define CONFIG_SYS_AMASK0 CONFIG_SYS_NOR_AMASK
272#define CONFIG_SYS_CSOR0 CONFIG_SYS_NOR_CSOR
273#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NOR_FTIM0
274#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NOR_FTIM1
275#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NOR_FTIM2
276#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NOR_FTIM3
277#define CONFIG_SYS_CSPR1_EXT CONFIG_SYS_NOR0_CSPR_EXT
278#define CONFIG_SYS_CSPR1 CONFIG_SYS_NOR1_CSPR_EARLY
279#define CONFIG_SYS_CSPR1_FINAL CONFIG_SYS_NOR1_CSPR
280#define CONFIG_SYS_AMASK1 CONFIG_SYS_NOR_AMASK_EARLY
281#define CONFIG_SYS_AMASK1_FINAL CONFIG_SYS_NOR_AMASK
282#define CONFIG_SYS_CSOR1 CONFIG_SYS_NOR_CSOR
283#define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NOR_FTIM0
284#define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NOR_FTIM1
285#define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NOR_FTIM2
286#define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NOR_FTIM3
287#define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_NAND_CSPR_EXT
288#define CONFIG_SYS_CSPR2 CONFIG_SYS_NAND_CSPR
289#define CONFIG_SYS_AMASK2 CONFIG_SYS_NAND_AMASK
290#define CONFIG_SYS_CSOR2 CONFIG_SYS_NAND_CSOR
291#define CONFIG_SYS_CS2_FTIM0 CONFIG_SYS_NAND_FTIM0
292#define CONFIG_SYS_CS2_FTIM1 CONFIG_SYS_NAND_FTIM1
293#define CONFIG_SYS_CS2_FTIM2 CONFIG_SYS_NAND_FTIM2
294#define CONFIG_SYS_CS2_FTIM3 CONFIG_SYS_NAND_FTIM3
295#define CONFIG_SYS_CSPR3_EXT CONFIG_SYS_FPGA_CSPR_EXT
296#define CONFIG_SYS_CSPR3 CONFIG_SYS_FPGA_CSPR
Ashish Kumarb555e292018-02-19 14:14:09 +0530297#define CONFIG_SYS_CSPR3_FINAL SYS_FPGA_CSPR_FINAL
298#define CONFIG_SYS_AMASK3 SYS_FPGA_AMASK
Ashish Kumar77697762017-08-31 16:12:55 +0530299#define CONFIG_SYS_CSOR3 CONFIG_SYS_FPGA_CSOR
Ashish Kumarb555e292018-02-19 14:14:09 +0530300#define CONFIG_SYS_CS3_FTIM0 SYS_FPGA_CS_FTIM0
301#define CONFIG_SYS_CS3_FTIM1 SYS_FPGA_CS_FTIM1
302#define CONFIG_SYS_CS3_FTIM2 SYS_FPGA_CS_FTIM2
303#define CONFIG_SYS_CS3_FTIM3 SYS_FPGA_CS_FTIM3
Ashish Kumar77697762017-08-31 16:12:55 +0530304#endif
Pankit Garg1a12b4a2018-12-27 04:37:57 +0000305#endif
Ashish Kumar77697762017-08-31 16:12:55 +0530306
307#define CONFIG_SYS_LS_MC_BOOT_TIMEOUT_MS 5000
308
309/*
310 * I2C bus multiplexer
311 */
312#define I2C_MUX_PCA_ADDR_PRI 0x77
313#define I2C_MUX_PCA_ADDR_SEC 0x76 /* Secondary multiplexer */
314#define I2C_RETIMER_ADDR 0x18
315#define I2C_RETIMER_ADDR2 0x19
316#define I2C_MUX_CH_DEFAULT 0x8
317#define I2C_MUX_CH5 0xD
318
Rajesh Bhagat23a12cb2018-01-17 16:13:05 +0530319#define I2C_MUX_CH_VOL_MONITOR 0xA
320
321/* Voltage monitor on channel 2*/
322#define I2C_VOL_MONITOR_ADDR 0x63
323#define I2C_VOL_MONITOR_BUS_V_OFFSET 0x2
324#define I2C_VOL_MONITOR_BUS_V_OVF 0x1
325#define I2C_VOL_MONITOR_BUS_V_SHIFT 3
Rajesh Bhagatef0789b2018-01-17 16:13:09 +0530326#define I2C_SVDD_MONITOR_ADDR 0x4F
327
328#define CONFIG_VID_FLS_ENV "ls1088aqds_vdd_mv"
329#define CONFIG_VID
330
331/* The lowest and highest voltage allowed for LS1088AQDS */
332#define VDD_MV_MIN 819
333#define VDD_MV_MAX 1212
334
335#define CONFIG_VOL_MONITOR_LTC3882_SET
336#define CONFIG_VOL_MONITOR_LTC3882_READ
Rajesh Bhagat23a12cb2018-01-17 16:13:05 +0530337
338/* PM Bus commands code for LTC3882*/
339#define PMBUS_CMD_PAGE 0x0
340#define PMBUS_CMD_READ_VOUT 0x8B
341#define PMBUS_CMD_PAGE_PLUS_WRITE 0x05
342#define PMBUS_CMD_VOUT_COMMAND 0x21
343
344#define PWM_CHANNEL0 0x0
345
Ashish Kumar77697762017-08-31 16:12:55 +0530346/*
347* RTC configuration
348*/
349#define RTC
Ashish Kumar77697762017-08-31 16:12:55 +0530350#define CONFIG_SYS_I2C_RTC_ADDR 0x51 /* Channel 3*/
Ashish Kumar77697762017-08-31 16:12:55 +0530351
352/* EEPROM */
353#define CONFIG_ID_EEPROM
354#define CONFIG_SYS_I2C_EEPROM_NXID
355#define CONFIG_SYS_EEPROM_BUS_NUM 0
356#define CONFIG_SYS_I2C_EEPROM_ADDR 0x57
357#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
358#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
359#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5
360
Ashish Kumar77697762017-08-31 16:12:55 +0530361#ifdef CONFIG_FSL_DSPI
362#define CONFIG_SPI_FLASH_STMICRO
363#define CONFIG_SPI_FLASH_SST
364#define CONFIG_SPI_FLASH_EON
Pankit Garg1a12b4a2018-12-27 04:37:57 +0000365#if !defined(CONFIG_TFABOOT) && \
366 !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_SD_BOOT_QSPI)
Ashish Kumar77697762017-08-31 16:12:55 +0530367#endif
368#endif
369
370#define CONFIG_CMD_MEMINFO
Ashish Kumar77697762017-08-31 16:12:55 +0530371
Ashish Kumar91fded62017-11-06 13:18:44 +0530372#ifdef CONFIG_SPL_BUILD
373#define CONFIG_SYS_MONITOR_BASE CONFIG_SPL_TEXT_BASE
374#else
Ashish Kumar77697762017-08-31 16:12:55 +0530375#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
Ashish Kumar91fded62017-11-06 13:18:44 +0530376#endif
Ashish Kumar77697762017-08-31 16:12:55 +0530377
378#define CONFIG_FSL_MEMAC
379
380/* MMC */
Ashish Kumar77697762017-08-31 16:12:55 +0530381#define CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33
382#define CONFIG_ESDHC_DETECT_QUIRK ((readb(QIXIS_BASE + QIXIS_STAT_PRES1) & \
383 QIXIS_SDID_MASK) != QIXIS_ESDHC_NO_ADAPTER)
384
385/* Initial environment variables */
Udit Agarwal5536c3c2019-11-07 16:11:32 +0000386#ifdef CONFIG_NXP_ESBC
Udit Agarwal30c41d22017-11-22 09:01:26 +0530387#undef CONFIG_EXTRA_ENV_SETTINGS
388#define CONFIG_EXTRA_ENV_SETTINGS \
389 "hwconfig=fsl_ddr:bank_intlv=auto\0" \
390 "loadaddr=0x90100000\0" \
391 "kernel_addr=0x100000\0" \
392 "ramdisk_addr=0x800000\0" \
393 "ramdisk_size=0x2000000\0" \
394 "fdt_high=0xa0000000\0" \
395 "initrd_high=0xffffffffffffffff\0" \
396 "kernel_start=0x1000000\0" \
397 "kernel_load=0xa0000000\0" \
398 "kernel_size=0x2800000\0" \
399 "mcinitcmd=sf probe 0:0;sf read 0xa0a00000 0xa00000 0x100000;" \
Priyanka Singh4238e372020-01-22 10:32:34 +0000400 "sf read 0xa0640000 0x640000 0x4000; esbc_validate 0xa0640000;" \
Udit Agarwal30c41d22017-11-22 09:01:26 +0530401 "sf read 0xa0e00000 0xe00000 0x100000;" \
Priyanka Singh4238e372020-01-22 10:32:34 +0000402 "sf read 0xa0680000 0x680000 0x4000;esbc_validate 0xa0680000;" \
Udit Agarwal30c41d22017-11-22 09:01:26 +0530403 "fsl_mc start mc 0xa0a00000 0xa0e00000\0" \
404 "mcmemsize=0x70000000 \0"
Udit Agarwal5536c3c2019-11-07 16:11:32 +0000405#else /* if !(CONFIG_NXP_ESBC) */
Pankit Garg1a12b4a2018-12-27 04:37:57 +0000406#ifdef CONFIG_TFABOOT
407#define QSPI_MC_INIT_CMD \
408 "sf probe 0:0;sf read 0x80000000 0xA00000 0x100000;" \
409 "sf read 0x80100000 0xE00000 0x100000;" \
410 "fsl_mc start mc 0x80000000 0x80100000\0"
411#define SD_MC_INIT_CMD \
412 "mmcinfo;mmc read 0x80000000 0x5000 0x800;" \
413 "mmc read 0x80100000 0x7000 0x800;" \
414 "fsl_mc start mc 0x80000000 0x80100000\0"
415#define IFC_MC_INIT_CMD \
416 "fsl_mc start mc 0x580A00000 0x580E00000\0"
417
418#undef CONFIG_EXTRA_ENV_SETTINGS
419#define CONFIG_EXTRA_ENV_SETTINGS \
420 "hwconfig=fsl_ddr:bank_intlv=auto\0" \
421 "loadaddr=0x90100000\0" \
422 "kernel_addr=0x100000\0" \
423 "kernel_addr_sd=0x800\0" \
424 "ramdisk_addr=0x800000\0" \
425 "ramdisk_size=0x2000000\0" \
426 "fdt_high=0xa0000000\0" \
427 "initrd_high=0xffffffffffffffff\0" \
428 "kernel_start=0x1000000\0" \
429 "kernel_start_sd=0x8000\0" \
430 "kernel_load=0xa0000000\0" \
431 "kernel_size=0x2800000\0" \
432 "kernel_size_sd=0x14000\0" \
433 "mcinitcmd=sf probe 0:0;sf read 0x80000000 0xA00000 0x100000;" \
434 "sf read 0x80100000 0xE00000 0x100000;" \
435 "fsl_mc start mc 0x80000000 0x80100000\0" \
Biwen Li472dfe52020-03-19 19:38:42 +0800436 "mcmemsize=0x70000000 \0" \
437 "BOARD=ls1088aqds\0" \
438 "scriptaddr=0x80000000\0" \
439 "scripthdraddr=0x80080000\0" \
440 BOOTENV \
441 "boot_scripts=ls1088aqds_boot.scr\0" \
442 "boot_script_hdr=hdr_ls1088aqds_bs.out\0" \
443 "scan_dev_for_boot_part=" \
444 "part list ${devtype} ${devnum} devplist; " \
445 "env exists devplist || setenv devplist 1; " \
446 "for distro_bootpart in ${devplist}; do " \
447 "if fstype ${devtype} " \
448 "${devnum}:${distro_bootpart} " \
449 "bootfstype; then " \
450 "run scan_dev_for_boot; " \
451 "fi; " \
452 "done\0" \
453 "boot_a_script=" \
454 "load ${devtype} ${devnum}:${distro_bootpart} " \
455 "${scriptaddr} ${prefix}${script}; " \
456 "env exists secureboot && load ${devtype} " \
457 "${devnum}:${distro_bootpart} " \
458 "${scripthdraddr} ${prefix}${boot_script_hdr}; "\
459 "env exists secureboot " \
460 "&& esbc_validate ${scripthdraddr};" \
461 "source ${scriptaddr}\0" \
462 "qspi_bootcmd=echo Trying load from qspi..; " \
463 "sf probe 0:0; " \
464 "sf read 0x80001000 0xd00000 0x100000; " \
465 "fsl_mc lazyapply dpl 0x80001000 && " \
466 "sf read $kernel_load $kernel_start " \
467 "$kernel_size && bootm $kernel_load#$BOARD\0" \
468 "sd_bootcmd=echo Trying load from sd card..; " \
469 "mmcinfo;mmc read 0x80001000 0x6800 0x800; "\
470 "fsl_mc lazyapply dpl 0x80001000 && " \
471 "mmc read $kernel_load $kernel_start_sd " \
472 "$kernel_size_sd && bootm $kernel_load#$BOARD\0" \
473 "nor_bootcmd=echo Trying load from nor..; " \
474 "fsl_mc lazyapply dpl 0x580d00000 && " \
475 "cp.b $kernel_start $kernel_load " \
476 "$kernel_size && bootm $kernel_load#$BOARD\0"
Pankit Garg1a12b4a2018-12-27 04:37:57 +0000477#else
Ashish Kumar77697762017-08-31 16:12:55 +0530478#if defined(CONFIG_QSPI_BOOT)
479#undef CONFIG_EXTRA_ENV_SETTINGS
480#define CONFIG_EXTRA_ENV_SETTINGS \
481 "hwconfig=fsl_ddr:bank_intlv=auto\0" \
482 "loadaddr=0x90100000\0" \
483 "kernel_addr=0x100000\0" \
484 "ramdisk_addr=0x800000\0" \
485 "ramdisk_size=0x2000000\0" \
486 "fdt_high=0xa0000000\0" \
487 "initrd_high=0xffffffffffffffff\0" \
488 "kernel_start=0x1000000\0" \
489 "kernel_load=0xa0000000\0" \
490 "kernel_size=0x2800000\0" \
491 "mcinitcmd=sf probe 0:0;sf read 0x80000000 0xA00000 0x100000;" \
492 "sf read 0x80100000 0xE00000 0x100000;" \
493 "fsl_mc start mc 0x80000000 0x80100000\0" \
494 "mcmemsize=0x70000000 \0"
Ashish Kumar91fded62017-11-06 13:18:44 +0530495#elif defined(CONFIG_SD_BOOT)
496#undef CONFIG_EXTRA_ENV_SETTINGS
497#define CONFIG_EXTRA_ENV_SETTINGS \
498 "hwconfig=fsl_ddr:bank_intlv=auto\0" \
499 "loadaddr=0x90100000\0" \
500 "kernel_addr=0x800\0" \
501 "ramdisk_addr=0x800000\0" \
502 "ramdisk_size=0x2000000\0" \
503 "fdt_high=0xa0000000\0" \
504 "initrd_high=0xffffffffffffffff\0" \
505 "kernel_start=0x8000\0" \
506 "kernel_load=0xa0000000\0" \
507 "kernel_size=0x14000\0" \
508 "mcinitcmd=mmcinfo;mmc read 0x80000000 0x5000 0x800;" \
509 "mmc read 0x80100000 0x7000 0x800;" \
510 "fsl_mc start mc 0x80000000 0x80100000\0" \
511 "mcmemsize=0x70000000 \0"
Ashish Kumar77697762017-08-31 16:12:55 +0530512#else /* NOR BOOT */
513#undef CONFIG_EXTRA_ENV_SETTINGS
514#define CONFIG_EXTRA_ENV_SETTINGS \
515 "hwconfig=fsl_ddr:bank_intlv=auto\0" \
516 "loadaddr=0x90100000\0" \
517 "kernel_addr=0x100000\0" \
518 "ramdisk_addr=0x800000\0" \
519 "ramdisk_size=0x2000000\0" \
520 "fdt_high=0xa0000000\0" \
521 "initrd_high=0xffffffffffffffff\0" \
522 "kernel_start=0x1000000\0" \
523 "kernel_load=0xa0000000\0" \
524 "kernel_size=0x2800000\0" \
525 "mcinitcmd=fsl_mc start mc 0x580A00000 0x580E00000\0" \
526 "mcmemsize=0x70000000 \0"
527#endif
Pankit Garg1a12b4a2018-12-27 04:37:57 +0000528#endif /* CONFIG_TFABOOT */
Udit Agarwal5536c3c2019-11-07 16:11:32 +0000529#endif /* CONFIG_NXP_ESBC */
Ashish Kumar77697762017-08-31 16:12:55 +0530530
Biwen Li472dfe52020-03-19 19:38:42 +0800531#ifdef CONFIG_TFABOOT
532#define QSPI_NOR_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; " \
533 "env exists secureboot && esbc_halt;;"
534#define IFC_NOR_BOOTCOMMAND "run distro_bootcmd; run nor_bootcmd; " \
535 "env exists secureboot && esbc_halt;;"
536#define SD_BOOTCOMMAND "run distro_bootcmd; run sd_bootcmd; " \
537 "env exists secureboot && esbc_halt;;"
538#endif
539
Ashish Kumar77697762017-08-31 16:12:55 +0530540#ifdef CONFIG_FSL_MC_ENET
541#define CONFIG_FSL_MEMAC
Ashish Kumar77697762017-08-31 16:12:55 +0530542#define RGMII_PHY1_ADDR 0x1
543#define RGMII_PHY2_ADDR 0x2
544#define SGMII_CARD_PORT1_PHY_ADDR 0x1C
545#define SGMII_CARD_PORT2_PHY_ADDR 0x1d
546#define SGMII_CARD_PORT3_PHY_ADDR 0x1E
547#define SGMII_CARD_PORT4_PHY_ADDR 0x1F
548
549#define XQSGMII_CARD_PHY1_PORT0_ADDR 0x0
550#define XQSGMII_CARD_PHY1_PORT1_ADDR 0x1
551#define XQSGMII_CARD_PHY1_PORT2_ADDR 0x2
552#define XQSGMII_CARD_PHY1_PORT3_ADDR 0x3
553#define XQSGMII_CARD_PHY2_PORT0_ADDR 0x4
554#define XQSGMII_CARD_PHY2_PORT1_ADDR 0x5
555#define XQSGMII_CARD_PHY2_PORT2_ADDR 0x6
556#define XQSGMII_CARD_PHY2_PORT3_ADDR 0x7
557#define XQSGMII_CARD_PHY3_PORT0_ADDR 0x8
558#define XQSGMII_CARD_PHY3_PORT1_ADDR 0x9
559#define XQSGMII_CARD_PHY3_PORT2_ADDR 0xa
560#define XQSGMII_CARD_PHY3_PORT3_ADDR 0xb
561#define XQSGMII_CARD_PHY4_PORT0_ADDR 0xc
562#define XQSGMII_CARD_PHY4_PORT1_ADDR 0xd
563#define XQSGMII_CARD_PHY4_PORT2_ADDR 0xe
564#define XQSGMII_CARD_PHY4_PORT3_ADDR 0xf
565
Ashish Kumar77697762017-08-31 16:12:55 +0530566#define CONFIG_ETHPRIME "DPMAC1@xgmii"
567#define CONFIG_PHY_GIGE /* Include GbE speed/duplex detection */
568
569#endif
570
Ashish Kumar77697762017-08-31 16:12:55 +0530571#define BOOT_TARGET_DEVICES(func) \
572 func(USB, usb, 0) \
573 func(MMC, mmc, 0) \
574 func(SCSI, scsi, 0) \
575 func(DHCP, dhcp, na)
576#include <config_distro_bootcmd.h>
577
578#include <asm/fsl_secure_boot.h>
579
580#endif /* __LS1088A_QDS_H */