blob: 15c3ff53fe8e7544681ffc4aa0fe1bb96a0de86b [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Shaohui Xiedd335672015-11-11 17:58:37 +08002/*
3 * Copyright 2015 Freescale Semiconductor, Inc.
Shaohui Xiedd335672015-11-11 17:58:37 +08004 */
5
6#ifndef __LS1043AQDS_H__
7#define __LS1043AQDS_H__
8
9#include "ls1043a_common.h"
10
Shaohui Xiedd335672015-11-11 17:58:37 +080011/* Physical Memory Map */
Shaohui Xiedd335672015-11-11 17:58:37 +080012
Shaohui Xiedd335672015-11-11 17:58:37 +080013#define SPD_EEPROM_ADDRESS 0x51
Shaohui Xiedd335672015-11-11 17:58:37 +080014
Shaohui Xiedd335672015-11-11 17:58:37 +080015#ifdef CONFIG_DDR_ECC
Shaohui Xiedd335672015-11-11 17:58:37 +080016#define CONFIG_MEM_INIT_VALUE 0xdeadbeef
17#endif
18
Shaohui Xiedd335672015-11-11 17:58:37 +080019#ifdef CONFIG_SYS_DPAA_FMAN
Shaohui Xiedd335672015-11-11 17:58:37 +080020#define RGMII_PHY1_ADDR 0x1
21#define RGMII_PHY2_ADDR 0x2
22#define SGMII_CARD_PORT1_PHY_ADDR 0x1C
23#define SGMII_CARD_PORT2_PHY_ADDR 0x1D
24#define SGMII_CARD_PORT3_PHY_ADDR 0x1E
25#define SGMII_CARD_PORT4_PHY_ADDR 0x1F
26/* PHY address on QSGMII riser card on slot 1 */
27#define QSGMII_CARD_PORT1_PHY_ADDR_S1 0x4
28#define QSGMII_CARD_PORT2_PHY_ADDR_S1 0x5
29#define QSGMII_CARD_PORT3_PHY_ADDR_S1 0x6
30#define QSGMII_CARD_PORT4_PHY_ADDR_S1 0x7
31/* PHY address on QSGMII riser card on slot 2 */
32#define QSGMII_CARD_PORT1_PHY_ADDR_S2 0x8
33#define QSGMII_CARD_PORT2_PHY_ADDR_S2 0x9
34#define QSGMII_CARD_PORT3_PHY_ADDR_S2 0xA
35#define QSGMII_CARD_PORT4_PHY_ADDR_S2 0xB
36#endif
37
Tang Yuantian57894be2015-12-09 15:32:18 +080038/* SATA */
Tang Yuantian57894be2015-12-09 15:32:18 +080039
Wenbin Song63b11da2016-03-09 13:38:25 +080040/* EEPROM */
Wenbin Song63b11da2016-03-09 13:38:25 +080041#define CONFIG_SYS_I2C_EEPROM_NXID
42#define CONFIG_SYS_EEPROM_BUS_NUM 0
Wenbin Song63b11da2016-03-09 13:38:25 +080043
Tang Yuantian57894be2015-12-09 15:32:18 +080044#define CONFIG_SYS_SATA AHCI_BASE_ADDR
45
Shaohui Xiedd335672015-11-11 17:58:37 +080046/*
47 * IFC Definitions
48 */
Qianyu Gong138a36a2016-01-25 15:16:07 +080049#if !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_SD_BOOT_QSPI)
Shaohui Xiedd335672015-11-11 17:58:37 +080050#define CONFIG_SYS_NOR0_CSPR_EXT (0x0)
51#define CONFIG_SYS_NOR0_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS) | \
52 CSPR_PORT_SIZE_16 | \
53 CSPR_MSEL_NOR | \
54 CSPR_V)
55#define CONFIG_SYS_NOR1_CSPR_EXT (0x0)
56#define CONFIG_SYS_NOR1_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS \
57 + 0x8000000) | \
58 CSPR_PORT_SIZE_16 | \
59 CSPR_MSEL_NOR | \
60 CSPR_V)
61#define CONFIG_SYS_NOR_AMASK IFC_AMASK(128 * 1024 * 1024)
62
63#define CONFIG_SYS_NOR_CSOR (CSOR_NOR_ADM_SHIFT(4) | \
64 CSOR_NOR_TRHZ_80)
65#define CONFIG_SYS_NOR_FTIM0 (FTIM0_NOR_TACSE(0x4) | \
66 FTIM0_NOR_TEADC(0x5) | \
67 FTIM0_NOR_TEAHC(0x5))
68#define CONFIG_SYS_NOR_FTIM1 (FTIM1_NOR_TACO(0x35) | \
69 FTIM1_NOR_TRAD_NOR(0x1a) | \
70 FTIM1_NOR_TSEQRAD_NOR(0x13))
71#define CONFIG_SYS_NOR_FTIM2 (FTIM2_NOR_TCS(0x4) | \
72 FTIM2_NOR_TCH(0x4) | \
73 FTIM2_NOR_TWPH(0xe) | \
74 FTIM2_NOR_TWP(0x1c))
75#define CONFIG_SYS_NOR_FTIM3 0
76
Shaohui Xiedd335672015-11-11 17:58:37 +080077#define CONFIG_SYS_MAX_FLASH_SECT 1024 /* sectors per device */
78#define CONFIG_SYS_FLASH_ERASE_TOUT 60000 /* Flash Erase Timeout (ms) */
79#define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (ms) */
80
81#define CONFIG_SYS_FLASH_EMPTY_INFO
82#define CONFIG_SYS_FLASH_BANKS_LIST {CONFIG_SYS_FLASH_BASE_PHYS, \
83 CONFIG_SYS_FLASH_BASE_PHYS + 0x8000000}
84
Shaohui Xiedd335672015-11-11 17:58:37 +080085#define CONFIG_SYS_WRITE_SWAPPED_DATA
86
87/*
88 * NAND Flash Definitions
89 */
Shaohui Xiedd335672015-11-11 17:58:37 +080090
91#define CONFIG_SYS_NAND_BASE 0x7e800000
92#define CONFIG_SYS_NAND_BASE_PHYS CONFIG_SYS_NAND_BASE
93
94#define CONFIG_SYS_NAND_CSPR_EXT (0x0)
95
96#define CONFIG_SYS_NAND_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
97 | CSPR_PORT_SIZE_8 \
98 | CSPR_MSEL_NAND \
99 | CSPR_V)
100#define CONFIG_SYS_NAND_AMASK IFC_AMASK(64*1024)
101#define CONFIG_SYS_NAND_CSOR (CSOR_NAND_ECC_ENC_EN /* ECC on encode */ \
102 | CSOR_NAND_ECC_DEC_EN /* ECC on decode */ \
103 | CSOR_NAND_ECC_MODE_4 /* 4-bit ECC */ \
104 | CSOR_NAND_RAL_3 /* RAL = 3 Bytes */ \
105 | CSOR_NAND_PGS_2K /* Page Size = 2K */ \
106 | CSOR_NAND_SPRZ_64 /* Spare size = 64 */ \
107 | CSOR_NAND_PB(64)) /* 64 Pages Per Block */
108
Shaohui Xiedd335672015-11-11 17:58:37 +0800109#define CONFIG_SYS_NAND_FTIM0 (FTIM0_NAND_TCCST(0x7) | \
110 FTIM0_NAND_TWP(0x18) | \
111 FTIM0_NAND_TWCHT(0x7) | \
112 FTIM0_NAND_TWH(0xa))
113#define CONFIG_SYS_NAND_FTIM1 (FTIM1_NAND_TADLE(0x32) | \
114 FTIM1_NAND_TWBE(0x39) | \
115 FTIM1_NAND_TRR(0xe) | \
116 FTIM1_NAND_TRP(0x18))
117#define CONFIG_SYS_NAND_FTIM2 (FTIM2_NAND_TRAD(0xf) | \
118 FTIM2_NAND_TREH(0xa) | \
119 FTIM2_NAND_TWHRE(0x1e))
120#define CONFIG_SYS_NAND_FTIM3 0x0
121
122#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
123#define CONFIG_SYS_MAX_NAND_DEVICE 1
124#define CONFIG_MTD_NAND_VERIFY_WRITE
Gong Qianyu760df892016-01-25 15:16:06 +0800125#endif
Shaohui Xiedd335672015-11-11 17:58:37 +0800126
127#ifdef CONFIG_NAND_BOOT
Shaohui Xiedd335672015-11-11 17:58:37 +0800128#define CONFIG_SYS_NAND_U_BOOT_SIZE (640 << 10)
129#endif
130
Rajesh Bhagat90bde112018-11-05 18:02:48 +0000131#if defined(CONFIG_TFABOOT) || \
132 defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
Gong Qianyu760df892016-01-25 15:16:06 +0800133#endif
134
Shaohui Xiedd335672015-11-11 17:58:37 +0800135/*
136 * QIXIS Definitions
137 */
Shaohui Xiedd335672015-11-11 17:58:37 +0800138
139#ifdef CONFIG_FSL_QIXIS
140#define QIXIS_BASE 0x7fb00000
141#define QIXIS_BASE_PHYS QIXIS_BASE
142#define CONFIG_SYS_I2C_FPGA_ADDR 0x66
143#define QIXIS_LBMAP_SWITCH 6
144#define QIXIS_LBMAP_MASK 0x0f
145#define QIXIS_LBMAP_SHIFT 0
146#define QIXIS_LBMAP_DFLTBANK 0x00
147#define QIXIS_LBMAP_ALTBANK 0x04
Gong Qianyu9da2c672015-12-31 18:29:04 +0800148#define QIXIS_LBMAP_NAND 0x09
149#define QIXIS_LBMAP_SD 0x00
Gong Qianyu760df892016-01-25 15:16:06 +0800150#define QIXIS_LBMAP_SD_QSPI 0xff
Qianyu Gong138a36a2016-01-25 15:16:07 +0800151#define QIXIS_LBMAP_QSPI 0xff
Gong Qianyu9da2c672015-12-31 18:29:04 +0800152#define QIXIS_RCW_SRC_NAND 0x106
153#define QIXIS_RCW_SRC_SD 0x040
Qianyu Gong138a36a2016-01-25 15:16:07 +0800154#define QIXIS_RCW_SRC_QSPI 0x045
Gong Qianyu4ce7be02015-12-31 18:29:03 +0800155#define QIXIS_RST_CTL_RESET 0x41
Shaohui Xiedd335672015-11-11 17:58:37 +0800156#define QIXIS_RCFG_CTL_RECONFIG_IDLE 0x20
157#define QIXIS_RCFG_CTL_RECONFIG_START 0x21
158#define QIXIS_RCFG_CTL_WATCHDOG_ENBLE 0x08
159
160#define CONFIG_SYS_FPGA_CSPR_EXT (0x0)
161#define CONFIG_SYS_FPGA_CSPR (CSPR_PHYS_ADDR(QIXIS_BASE_PHYS) | \
162 CSPR_PORT_SIZE_8 | \
163 CSPR_MSEL_GPCM | \
164 CSPR_V)
165#define CONFIG_SYS_FPGA_AMASK IFC_AMASK(64 * 1024)
166#define CONFIG_SYS_FPGA_CSOR (CSOR_NOR_ADM_SHIFT(4) | \
167 CSOR_NOR_NOR_MODE_AVD_NOR | \
168 CSOR_NOR_TRHZ_80)
169
170/*
171 * QIXIS Timing parameters for IFC GPCM
172 */
173#define CONFIG_SYS_FPGA_FTIM0 (FTIM0_GPCM_TACSE(0xc) | \
174 FTIM0_GPCM_TEADC(0x20) | \
175 FTIM0_GPCM_TEAHC(0x10))
176#define CONFIG_SYS_FPGA_FTIM1 (FTIM1_GPCM_TACO(0x50) | \
177 FTIM1_GPCM_TRAD(0x1f))
178#define CONFIG_SYS_FPGA_FTIM2 (FTIM2_GPCM_TCS(0x8) | \
179 FTIM2_GPCM_TCH(0x8) | \
180 FTIM2_GPCM_TWP(0xf0))
181#define CONFIG_SYS_FPGA_FTIM3 0x0
182#endif
183
Rajesh Bhagat90bde112018-11-05 18:02:48 +0000184#ifdef CONFIG_TFABOOT
185#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NOR0_CSPR_EXT
186#define CONFIG_SYS_CSPR0 CONFIG_SYS_NOR0_CSPR
187#define CONFIG_SYS_AMASK0 CONFIG_SYS_NOR_AMASK
188#define CONFIG_SYS_CSOR0 CONFIG_SYS_NOR_CSOR
189#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NOR_FTIM0
190#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NOR_FTIM1
191#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NOR_FTIM2
192#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NOR_FTIM3
193#define CONFIG_SYS_CSPR1_EXT CONFIG_SYS_NOR1_CSPR_EXT
194#define CONFIG_SYS_CSPR1 CONFIG_SYS_NOR1_CSPR
195#define CONFIG_SYS_AMASK1 CONFIG_SYS_NOR_AMASK
196#define CONFIG_SYS_CSOR1 CONFIG_SYS_NOR_CSOR
197#define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NOR_FTIM0
198#define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NOR_FTIM1
199#define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NOR_FTIM2
200#define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NOR_FTIM3
201#define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_NAND_CSPR_EXT
202#define CONFIG_SYS_CSPR2 CONFIG_SYS_NAND_CSPR
203#define CONFIG_SYS_AMASK2 CONFIG_SYS_NAND_AMASK
204#define CONFIG_SYS_CSOR2 CONFIG_SYS_NAND_CSOR
205#define CONFIG_SYS_CS2_FTIM0 CONFIG_SYS_NAND_FTIM0
206#define CONFIG_SYS_CS2_FTIM1 CONFIG_SYS_NAND_FTIM1
207#define CONFIG_SYS_CS2_FTIM2 CONFIG_SYS_NAND_FTIM2
208#define CONFIG_SYS_CS2_FTIM3 CONFIG_SYS_NAND_FTIM3
209#define CONFIG_SYS_CSPR3_EXT CONFIG_SYS_FPGA_CSPR_EXT
210#define CONFIG_SYS_CSPR3 CONFIG_SYS_FPGA_CSPR
211#define CONFIG_SYS_AMASK3 CONFIG_SYS_FPGA_AMASK
212#define CONFIG_SYS_CSOR3 CONFIG_SYS_FPGA_CSOR
213#define CONFIG_SYS_CS3_FTIM0 CONFIG_SYS_FPGA_FTIM0
214#define CONFIG_SYS_CS3_FTIM1 CONFIG_SYS_FPGA_FTIM1
215#define CONFIG_SYS_CS3_FTIM2 CONFIG_SYS_FPGA_FTIM2
216#define CONFIG_SYS_CS3_FTIM3 CONFIG_SYS_FPGA_FTIM3
217#else
Shaohui Xiedd335672015-11-11 17:58:37 +0800218#ifdef CONFIG_NAND_BOOT
219#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NAND_CSPR_EXT
220#define CONFIG_SYS_CSPR0 CONFIG_SYS_NAND_CSPR
221#define CONFIG_SYS_AMASK0 CONFIG_SYS_NAND_AMASK
222#define CONFIG_SYS_CSOR0 CONFIG_SYS_NAND_CSOR
223#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NAND_FTIM0
224#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NAND_FTIM1
225#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NAND_FTIM2
226#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NAND_FTIM3
227#define CONFIG_SYS_CSPR1_EXT CONFIG_SYS_NOR0_CSPR_EXT
228#define CONFIG_SYS_CSPR1 CONFIG_SYS_NOR0_CSPR
229#define CONFIG_SYS_AMASK1 CONFIG_SYS_NOR_AMASK
230#define CONFIG_SYS_CSOR1 CONFIG_SYS_NOR_CSOR
231#define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NOR_FTIM0
232#define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NOR_FTIM1
233#define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NOR_FTIM2
234#define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NOR_FTIM3
235#define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_NOR1_CSPR_EXT
236#define CONFIG_SYS_CSPR2 CONFIG_SYS_NOR1_CSPR
237#define CONFIG_SYS_AMASK2 CONFIG_SYS_NOR_AMASK
238#define CONFIG_SYS_CSOR2 CONFIG_SYS_NOR_CSOR
239#define CONFIG_SYS_CS2_FTIM0 CONFIG_SYS_NOR_FTIM0
240#define CONFIG_SYS_CS2_FTIM1 CONFIG_SYS_NOR_FTIM1
241#define CONFIG_SYS_CS2_FTIM2 CONFIG_SYS_NOR_FTIM2
242#define CONFIG_SYS_CS2_FTIM3 CONFIG_SYS_NOR_FTIM3
243#define CONFIG_SYS_CSPR3_EXT CONFIG_SYS_FPGA_CSPR_EXT
244#define CONFIG_SYS_CSPR3 CONFIG_SYS_FPGA_CSPR
245#define CONFIG_SYS_AMASK3 CONFIG_SYS_FPGA_AMASK
246#define CONFIG_SYS_CSOR3 CONFIG_SYS_FPGA_CSOR
247#define CONFIG_SYS_CS3_FTIM0 CONFIG_SYS_FPGA_FTIM0
248#define CONFIG_SYS_CS3_FTIM1 CONFIG_SYS_FPGA_FTIM1
249#define CONFIG_SYS_CS3_FTIM2 CONFIG_SYS_FPGA_FTIM2
250#define CONFIG_SYS_CS3_FTIM3 CONFIG_SYS_FPGA_FTIM3
251#else
252#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NOR0_CSPR_EXT
253#define CONFIG_SYS_CSPR0 CONFIG_SYS_NOR0_CSPR
254#define CONFIG_SYS_AMASK0 CONFIG_SYS_NOR_AMASK
255#define CONFIG_SYS_CSOR0 CONFIG_SYS_NOR_CSOR
256#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NOR_FTIM0
257#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NOR_FTIM1
258#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NOR_FTIM2
259#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NOR_FTIM3
260#define CONFIG_SYS_CSPR1_EXT CONFIG_SYS_NOR1_CSPR_EXT
261#define CONFIG_SYS_CSPR1 CONFIG_SYS_NOR1_CSPR
262#define CONFIG_SYS_AMASK1 CONFIG_SYS_NOR_AMASK
263#define CONFIG_SYS_CSOR1 CONFIG_SYS_NOR_CSOR
264#define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NOR_FTIM0
265#define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NOR_FTIM1
266#define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NOR_FTIM2
267#define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NOR_FTIM3
268#define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_NAND_CSPR_EXT
269#define CONFIG_SYS_CSPR2 CONFIG_SYS_NAND_CSPR
270#define CONFIG_SYS_AMASK2 CONFIG_SYS_NAND_AMASK
271#define CONFIG_SYS_CSOR2 CONFIG_SYS_NAND_CSOR
272#define CONFIG_SYS_CS2_FTIM0 CONFIG_SYS_NAND_FTIM0
273#define CONFIG_SYS_CS2_FTIM1 CONFIG_SYS_NAND_FTIM1
274#define CONFIG_SYS_CS2_FTIM2 CONFIG_SYS_NAND_FTIM2
275#define CONFIG_SYS_CS2_FTIM3 CONFIG_SYS_NAND_FTIM3
276#define CONFIG_SYS_CSPR3_EXT CONFIG_SYS_FPGA_CSPR_EXT
277#define CONFIG_SYS_CSPR3 CONFIG_SYS_FPGA_CSPR
278#define CONFIG_SYS_AMASK3 CONFIG_SYS_FPGA_AMASK
279#define CONFIG_SYS_CSOR3 CONFIG_SYS_FPGA_CSOR
280#define CONFIG_SYS_CS3_FTIM0 CONFIG_SYS_FPGA_FTIM0
281#define CONFIG_SYS_CS3_FTIM1 CONFIG_SYS_FPGA_FTIM1
282#define CONFIG_SYS_CS3_FTIM2 CONFIG_SYS_FPGA_FTIM2
283#define CONFIG_SYS_CS3_FTIM3 CONFIG_SYS_FPGA_FTIM3
284#endif
Rajesh Bhagat90bde112018-11-05 18:02:48 +0000285#endif
Shaohui Xiedd335672015-11-11 17:58:37 +0800286
287/*
288 * I2C bus multiplexer
289 */
290#define I2C_MUX_PCA_ADDR_PRI 0x77
291#define I2C_MUX_PCA_ADDR_SEC 0x76 /* Secondary multiplexer */
292#define I2C_RETIMER_ADDR 0x18
293#define I2C_MUX_CH_DEFAULT 0x8
294#define I2C_MUX_CH_CH7301 0xC
295#define I2C_MUX_CH5 0xD
296#define I2C_MUX_CH7 0xF
297
298#define I2C_MUX_CH_VOL_MONITOR 0xa
299
300/* Voltage monitor on channel 2*/
301#define I2C_VOL_MONITOR_ADDR 0x40
302#define I2C_VOL_MONITOR_BUS_V_OFFSET 0x2
303#define I2C_VOL_MONITOR_BUS_V_OVF 0x1
304#define I2C_VOL_MONITOR_BUS_V_SHIFT 3
305
Shaohui Xiedd335672015-11-11 17:58:37 +0800306/* The lowest and highest voltage allowed for LS1043AQDS */
307#define VDD_MV_MIN 819
308#define VDD_MV_MAX 1212
309
310/*
311 * Miscellaneous configurable options
312 */
Shaohui Xiedd335672015-11-11 17:58:37 +0800313
Shaohui Xiedd335672015-11-11 17:58:37 +0800314/*
315 * Environment
316 */
Shaohui Xiedd335672015-11-11 17:58:37 +0800317
Aneesh Bansal962021a2016-01-22 16:37:22 +0530318#include <asm/fsl_secure_boot.h>
319
Shaohui Xiedd335672015-11-11 17:58:37 +0800320#endif /* __LS1043AQDS_H__ */