blob: 4158d15cc0fcd11a3cad2515b54ca1778e5b8d84 [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
40#define CONFIG_SYS_SATA AHCI_BASE_ADDR
41
Shaohui Xiedd335672015-11-11 17:58:37 +080042/*
43 * IFC Definitions
44 */
Qianyu Gong138a36a2016-01-25 15:16:07 +080045#if !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_SD_BOOT_QSPI)
Shaohui Xiedd335672015-11-11 17:58:37 +080046#define CONFIG_SYS_NOR0_CSPR_EXT (0x0)
47#define CONFIG_SYS_NOR0_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS) | \
48 CSPR_PORT_SIZE_16 | \
49 CSPR_MSEL_NOR | \
50 CSPR_V)
51#define CONFIG_SYS_NOR1_CSPR_EXT (0x0)
52#define CONFIG_SYS_NOR1_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS \
53 + 0x8000000) | \
54 CSPR_PORT_SIZE_16 | \
55 CSPR_MSEL_NOR | \
56 CSPR_V)
57#define CONFIG_SYS_NOR_AMASK IFC_AMASK(128 * 1024 * 1024)
58
59#define CONFIG_SYS_NOR_CSOR (CSOR_NOR_ADM_SHIFT(4) | \
60 CSOR_NOR_TRHZ_80)
61#define CONFIG_SYS_NOR_FTIM0 (FTIM0_NOR_TACSE(0x4) | \
62 FTIM0_NOR_TEADC(0x5) | \
63 FTIM0_NOR_TEAHC(0x5))
64#define CONFIG_SYS_NOR_FTIM1 (FTIM1_NOR_TACO(0x35) | \
65 FTIM1_NOR_TRAD_NOR(0x1a) | \
66 FTIM1_NOR_TSEQRAD_NOR(0x13))
67#define CONFIG_SYS_NOR_FTIM2 (FTIM2_NOR_TCS(0x4) | \
68 FTIM2_NOR_TCH(0x4) | \
69 FTIM2_NOR_TWPH(0xe) | \
70 FTIM2_NOR_TWP(0x1c))
71#define CONFIG_SYS_NOR_FTIM3 0
72
Shaohui Xiedd335672015-11-11 17:58:37 +080073#define CONFIG_SYS_FLASH_BANKS_LIST {CONFIG_SYS_FLASH_BASE_PHYS, \
74 CONFIG_SYS_FLASH_BASE_PHYS + 0x8000000}
75
Shaohui Xiedd335672015-11-11 17:58:37 +080076#define CONFIG_SYS_WRITE_SWAPPED_DATA
77
78/*
79 * NAND Flash Definitions
80 */
Shaohui Xiedd335672015-11-11 17:58:37 +080081
82#define CONFIG_SYS_NAND_BASE 0x7e800000
83#define CONFIG_SYS_NAND_BASE_PHYS CONFIG_SYS_NAND_BASE
84
85#define CONFIG_SYS_NAND_CSPR_EXT (0x0)
86
87#define CONFIG_SYS_NAND_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
88 | CSPR_PORT_SIZE_8 \
89 | CSPR_MSEL_NAND \
90 | CSPR_V)
91#define CONFIG_SYS_NAND_AMASK IFC_AMASK(64*1024)
92#define CONFIG_SYS_NAND_CSOR (CSOR_NAND_ECC_ENC_EN /* ECC on encode */ \
93 | CSOR_NAND_ECC_DEC_EN /* ECC on decode */ \
94 | CSOR_NAND_ECC_MODE_4 /* 4-bit ECC */ \
95 | CSOR_NAND_RAL_3 /* RAL = 3 Bytes */ \
96 | CSOR_NAND_PGS_2K /* Page Size = 2K */ \
97 | CSOR_NAND_SPRZ_64 /* Spare size = 64 */ \
98 | CSOR_NAND_PB(64)) /* 64 Pages Per Block */
99
Shaohui Xiedd335672015-11-11 17:58:37 +0800100#define CONFIG_SYS_NAND_FTIM0 (FTIM0_NAND_TCCST(0x7) | \
101 FTIM0_NAND_TWP(0x18) | \
102 FTIM0_NAND_TWCHT(0x7) | \
103 FTIM0_NAND_TWH(0xa))
104#define CONFIG_SYS_NAND_FTIM1 (FTIM1_NAND_TADLE(0x32) | \
105 FTIM1_NAND_TWBE(0x39) | \
106 FTIM1_NAND_TRR(0xe) | \
107 FTIM1_NAND_TRP(0x18))
108#define CONFIG_SYS_NAND_FTIM2 (FTIM2_NAND_TRAD(0xf) | \
109 FTIM2_NAND_TREH(0xa) | \
110 FTIM2_NAND_TWHRE(0x1e))
111#define CONFIG_SYS_NAND_FTIM3 0x0
112
113#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
114#define CONFIG_SYS_MAX_NAND_DEVICE 1
115#define CONFIG_MTD_NAND_VERIFY_WRITE
Gong Qianyu760df892016-01-25 15:16:06 +0800116#endif
Shaohui Xiedd335672015-11-11 17:58:37 +0800117
118#ifdef CONFIG_NAND_BOOT
Shaohui Xiedd335672015-11-11 17:58:37 +0800119#define CONFIG_SYS_NAND_U_BOOT_SIZE (640 << 10)
120#endif
121
Rajesh Bhagat90bde112018-11-05 18:02:48 +0000122#if defined(CONFIG_TFABOOT) || \
123 defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
Gong Qianyu760df892016-01-25 15:16:06 +0800124#endif
125
Shaohui Xiedd335672015-11-11 17:58:37 +0800126/*
127 * QIXIS Definitions
128 */
Shaohui Xiedd335672015-11-11 17:58:37 +0800129
130#ifdef CONFIG_FSL_QIXIS
131#define QIXIS_BASE 0x7fb00000
132#define QIXIS_BASE_PHYS QIXIS_BASE
133#define CONFIG_SYS_I2C_FPGA_ADDR 0x66
134#define QIXIS_LBMAP_SWITCH 6
135#define QIXIS_LBMAP_MASK 0x0f
136#define QIXIS_LBMAP_SHIFT 0
137#define QIXIS_LBMAP_DFLTBANK 0x00
138#define QIXIS_LBMAP_ALTBANK 0x04
Gong Qianyu9da2c672015-12-31 18:29:04 +0800139#define QIXIS_LBMAP_NAND 0x09
140#define QIXIS_LBMAP_SD 0x00
Gong Qianyu760df892016-01-25 15:16:06 +0800141#define QIXIS_LBMAP_SD_QSPI 0xff
Qianyu Gong138a36a2016-01-25 15:16:07 +0800142#define QIXIS_LBMAP_QSPI 0xff
Gong Qianyu9da2c672015-12-31 18:29:04 +0800143#define QIXIS_RCW_SRC_NAND 0x106
144#define QIXIS_RCW_SRC_SD 0x040
Qianyu Gong138a36a2016-01-25 15:16:07 +0800145#define QIXIS_RCW_SRC_QSPI 0x045
Gong Qianyu4ce7be02015-12-31 18:29:03 +0800146#define QIXIS_RST_CTL_RESET 0x41
Shaohui Xiedd335672015-11-11 17:58:37 +0800147#define QIXIS_RCFG_CTL_RECONFIG_IDLE 0x20
148#define QIXIS_RCFG_CTL_RECONFIG_START 0x21
149#define QIXIS_RCFG_CTL_WATCHDOG_ENBLE 0x08
150
151#define CONFIG_SYS_FPGA_CSPR_EXT (0x0)
152#define CONFIG_SYS_FPGA_CSPR (CSPR_PHYS_ADDR(QIXIS_BASE_PHYS) | \
153 CSPR_PORT_SIZE_8 | \
154 CSPR_MSEL_GPCM | \
155 CSPR_V)
156#define CONFIG_SYS_FPGA_AMASK IFC_AMASK(64 * 1024)
157#define CONFIG_SYS_FPGA_CSOR (CSOR_NOR_ADM_SHIFT(4) | \
158 CSOR_NOR_NOR_MODE_AVD_NOR | \
159 CSOR_NOR_TRHZ_80)
160
161/*
162 * QIXIS Timing parameters for IFC GPCM
163 */
164#define CONFIG_SYS_FPGA_FTIM0 (FTIM0_GPCM_TACSE(0xc) | \
165 FTIM0_GPCM_TEADC(0x20) | \
166 FTIM0_GPCM_TEAHC(0x10))
167#define CONFIG_SYS_FPGA_FTIM1 (FTIM1_GPCM_TACO(0x50) | \
168 FTIM1_GPCM_TRAD(0x1f))
169#define CONFIG_SYS_FPGA_FTIM2 (FTIM2_GPCM_TCS(0x8) | \
170 FTIM2_GPCM_TCH(0x8) | \
171 FTIM2_GPCM_TWP(0xf0))
172#define CONFIG_SYS_FPGA_FTIM3 0x0
173#endif
174
Rajesh Bhagat90bde112018-11-05 18:02:48 +0000175#ifdef CONFIG_TFABOOT
176#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NOR0_CSPR_EXT
177#define CONFIG_SYS_CSPR0 CONFIG_SYS_NOR0_CSPR
178#define CONFIG_SYS_AMASK0 CONFIG_SYS_NOR_AMASK
179#define CONFIG_SYS_CSOR0 CONFIG_SYS_NOR_CSOR
180#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NOR_FTIM0
181#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NOR_FTIM1
182#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NOR_FTIM2
183#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NOR_FTIM3
184#define CONFIG_SYS_CSPR1_EXT CONFIG_SYS_NOR1_CSPR_EXT
185#define CONFIG_SYS_CSPR1 CONFIG_SYS_NOR1_CSPR
186#define CONFIG_SYS_AMASK1 CONFIG_SYS_NOR_AMASK
187#define CONFIG_SYS_CSOR1 CONFIG_SYS_NOR_CSOR
188#define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NOR_FTIM0
189#define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NOR_FTIM1
190#define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NOR_FTIM2
191#define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NOR_FTIM3
192#define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_NAND_CSPR_EXT
193#define CONFIG_SYS_CSPR2 CONFIG_SYS_NAND_CSPR
194#define CONFIG_SYS_AMASK2 CONFIG_SYS_NAND_AMASK
195#define CONFIG_SYS_CSOR2 CONFIG_SYS_NAND_CSOR
196#define CONFIG_SYS_CS2_FTIM0 CONFIG_SYS_NAND_FTIM0
197#define CONFIG_SYS_CS2_FTIM1 CONFIG_SYS_NAND_FTIM1
198#define CONFIG_SYS_CS2_FTIM2 CONFIG_SYS_NAND_FTIM2
199#define CONFIG_SYS_CS2_FTIM3 CONFIG_SYS_NAND_FTIM3
200#define CONFIG_SYS_CSPR3_EXT CONFIG_SYS_FPGA_CSPR_EXT
201#define CONFIG_SYS_CSPR3 CONFIG_SYS_FPGA_CSPR
202#define CONFIG_SYS_AMASK3 CONFIG_SYS_FPGA_AMASK
203#define CONFIG_SYS_CSOR3 CONFIG_SYS_FPGA_CSOR
204#define CONFIG_SYS_CS3_FTIM0 CONFIG_SYS_FPGA_FTIM0
205#define CONFIG_SYS_CS3_FTIM1 CONFIG_SYS_FPGA_FTIM1
206#define CONFIG_SYS_CS3_FTIM2 CONFIG_SYS_FPGA_FTIM2
207#define CONFIG_SYS_CS3_FTIM3 CONFIG_SYS_FPGA_FTIM3
208#else
Shaohui Xiedd335672015-11-11 17:58:37 +0800209#ifdef CONFIG_NAND_BOOT
210#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NAND_CSPR_EXT
211#define CONFIG_SYS_CSPR0 CONFIG_SYS_NAND_CSPR
212#define CONFIG_SYS_AMASK0 CONFIG_SYS_NAND_AMASK
213#define CONFIG_SYS_CSOR0 CONFIG_SYS_NAND_CSOR
214#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NAND_FTIM0
215#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NAND_FTIM1
216#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NAND_FTIM2
217#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NAND_FTIM3
218#define CONFIG_SYS_CSPR1_EXT CONFIG_SYS_NOR0_CSPR_EXT
219#define CONFIG_SYS_CSPR1 CONFIG_SYS_NOR0_CSPR
220#define CONFIG_SYS_AMASK1 CONFIG_SYS_NOR_AMASK
221#define CONFIG_SYS_CSOR1 CONFIG_SYS_NOR_CSOR
222#define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NOR_FTIM0
223#define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NOR_FTIM1
224#define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NOR_FTIM2
225#define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NOR_FTIM3
226#define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_NOR1_CSPR_EXT
227#define CONFIG_SYS_CSPR2 CONFIG_SYS_NOR1_CSPR
228#define CONFIG_SYS_AMASK2 CONFIG_SYS_NOR_AMASK
229#define CONFIG_SYS_CSOR2 CONFIG_SYS_NOR_CSOR
230#define CONFIG_SYS_CS2_FTIM0 CONFIG_SYS_NOR_FTIM0
231#define CONFIG_SYS_CS2_FTIM1 CONFIG_SYS_NOR_FTIM1
232#define CONFIG_SYS_CS2_FTIM2 CONFIG_SYS_NOR_FTIM2
233#define CONFIG_SYS_CS2_FTIM3 CONFIG_SYS_NOR_FTIM3
234#define CONFIG_SYS_CSPR3_EXT CONFIG_SYS_FPGA_CSPR_EXT
235#define CONFIG_SYS_CSPR3 CONFIG_SYS_FPGA_CSPR
236#define CONFIG_SYS_AMASK3 CONFIG_SYS_FPGA_AMASK
237#define CONFIG_SYS_CSOR3 CONFIG_SYS_FPGA_CSOR
238#define CONFIG_SYS_CS3_FTIM0 CONFIG_SYS_FPGA_FTIM0
239#define CONFIG_SYS_CS3_FTIM1 CONFIG_SYS_FPGA_FTIM1
240#define CONFIG_SYS_CS3_FTIM2 CONFIG_SYS_FPGA_FTIM2
241#define CONFIG_SYS_CS3_FTIM3 CONFIG_SYS_FPGA_FTIM3
242#else
243#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NOR0_CSPR_EXT
244#define CONFIG_SYS_CSPR0 CONFIG_SYS_NOR0_CSPR
245#define CONFIG_SYS_AMASK0 CONFIG_SYS_NOR_AMASK
246#define CONFIG_SYS_CSOR0 CONFIG_SYS_NOR_CSOR
247#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NOR_FTIM0
248#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NOR_FTIM1
249#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NOR_FTIM2
250#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NOR_FTIM3
251#define CONFIG_SYS_CSPR1_EXT CONFIG_SYS_NOR1_CSPR_EXT
252#define CONFIG_SYS_CSPR1 CONFIG_SYS_NOR1_CSPR
253#define CONFIG_SYS_AMASK1 CONFIG_SYS_NOR_AMASK
254#define CONFIG_SYS_CSOR1 CONFIG_SYS_NOR_CSOR
255#define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NOR_FTIM0
256#define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NOR_FTIM1
257#define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NOR_FTIM2
258#define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NOR_FTIM3
259#define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_NAND_CSPR_EXT
260#define CONFIG_SYS_CSPR2 CONFIG_SYS_NAND_CSPR
261#define CONFIG_SYS_AMASK2 CONFIG_SYS_NAND_AMASK
262#define CONFIG_SYS_CSOR2 CONFIG_SYS_NAND_CSOR
263#define CONFIG_SYS_CS2_FTIM0 CONFIG_SYS_NAND_FTIM0
264#define CONFIG_SYS_CS2_FTIM1 CONFIG_SYS_NAND_FTIM1
265#define CONFIG_SYS_CS2_FTIM2 CONFIG_SYS_NAND_FTIM2
266#define CONFIG_SYS_CS2_FTIM3 CONFIG_SYS_NAND_FTIM3
267#define CONFIG_SYS_CSPR3_EXT CONFIG_SYS_FPGA_CSPR_EXT
268#define CONFIG_SYS_CSPR3 CONFIG_SYS_FPGA_CSPR
269#define CONFIG_SYS_AMASK3 CONFIG_SYS_FPGA_AMASK
270#define CONFIG_SYS_CSOR3 CONFIG_SYS_FPGA_CSOR
271#define CONFIG_SYS_CS3_FTIM0 CONFIG_SYS_FPGA_FTIM0
272#define CONFIG_SYS_CS3_FTIM1 CONFIG_SYS_FPGA_FTIM1
273#define CONFIG_SYS_CS3_FTIM2 CONFIG_SYS_FPGA_FTIM2
274#define CONFIG_SYS_CS3_FTIM3 CONFIG_SYS_FPGA_FTIM3
275#endif
Rajesh Bhagat90bde112018-11-05 18:02:48 +0000276#endif
Shaohui Xiedd335672015-11-11 17:58:37 +0800277
278/*
279 * I2C bus multiplexer
280 */
281#define I2C_MUX_PCA_ADDR_PRI 0x77
282#define I2C_MUX_PCA_ADDR_SEC 0x76 /* Secondary multiplexer */
283#define I2C_RETIMER_ADDR 0x18
284#define I2C_MUX_CH_DEFAULT 0x8
285#define I2C_MUX_CH_CH7301 0xC
286#define I2C_MUX_CH5 0xD
287#define I2C_MUX_CH7 0xF
288
289#define I2C_MUX_CH_VOL_MONITOR 0xa
290
291/* Voltage monitor on channel 2*/
292#define I2C_VOL_MONITOR_ADDR 0x40
293#define I2C_VOL_MONITOR_BUS_V_OFFSET 0x2
294#define I2C_VOL_MONITOR_BUS_V_OVF 0x1
295#define I2C_VOL_MONITOR_BUS_V_SHIFT 3
296
Shaohui Xiedd335672015-11-11 17:58:37 +0800297/* The lowest and highest voltage allowed for LS1043AQDS */
298#define VDD_MV_MIN 819
299#define VDD_MV_MAX 1212
300
301/*
302 * Miscellaneous configurable options
303 */
Shaohui Xiedd335672015-11-11 17:58:37 +0800304
Shaohui Xiedd335672015-11-11 17:58:37 +0800305/*
306 * Environment
307 */
Shaohui Xiedd335672015-11-11 17:58:37 +0800308
Aneesh Bansal962021a2016-01-22 16:37:22 +0530309#include <asm/fsl_secure_boot.h>
310
Shaohui Xiedd335672015-11-11 17:58:37 +0800311#endif /* __LS1043AQDS_H__ */