blob: 9efae58ce903c069f944d2c5a37a84adf3db42b0 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Poonam Aggrwal49249e12011-02-09 19:17:53 +00002/*
3 * Copyright 2010-2011 Freescale Semiconductor, Inc.
Biwen Li2703e642020-05-01 20:04:13 +08004 * Copyright 2020 NXP
Poonam Aggrwal49249e12011-02-09 19:17:53 +00005 */
6
7/*
8 * P010 RDB board configuration file
9 */
10
11#ifndef __CONFIG_H
12#define __CONFIG_H
13
Simon Glass1af3c7f2020-05-10 11:40:09 -060014#include <linux/stringify.h>
15
Prabhakar Kushwaha74fa22e2013-04-16 13:27:44 +053016#include <asm/config_mpc85xx.h>
Poonam Aggrwal49249e12011-02-09 19:17:53 +000017
18#ifdef CONFIG_SDCARD
Tom Rini65cc0e22022-11-16 13:10:41 -050019#define CFG_SYS_MMC_U_BOOT_SIZE (512 << 10)
20#define CFG_SYS_MMC_U_BOOT_DST (0x11000000)
21#define CFG_SYS_MMC_U_BOOT_START (0x11000000)
22#define CFG_SYS_MMC_U_BOOT_OFFS (96 << 10)
Poonam Aggrwal49249e12011-02-09 19:17:53 +000023#endif
24
25#ifdef CONFIG_SPIFLASH
Udit Agarwalbef18452019-11-07 16:11:39 +000026#ifdef CONFIG_NXP_ESBC
Tom Rini3db78c82022-12-04 10:13:40 -050027#define CFG_RESET_VECTOR_ADDRESS 0x110bfffc
Ying Zhangc9e1f582014-01-24 15:50:09 +080028#else
Tom Rini65cc0e22022-11-16 13:10:41 -050029#define CFG_SYS_SPI_FLASH_U_BOOT_SIZE (512 << 10)
30#define CFG_SYS_SPI_FLASH_U_BOOT_DST (0x11000000)
31#define CFG_SYS_SPI_FLASH_U_BOOT_START (0x11000000)
32#define CFG_SYS_SPI_FLASH_U_BOOT_OFFS (96 << 10)
Ying Zhangc9e1f582014-01-24 15:50:09 +080033#endif
Poonam Aggrwal49249e12011-02-09 19:17:53 +000034#endif
35
Miquel Raynal88718be2019-10-03 19:50:03 +020036#ifdef CONFIG_MTD_RAW_NAND
Udit Agarwalbef18452019-11-07 16:11:39 +000037#ifdef CONFIG_NXP_ESBC
Tom Rini4e590942022-11-12 17:36:51 -050038#define CFG_SYS_NAND_U_BOOT_SIZE ((768 << 10) - 0x2000)
39#define CFG_SYS_NAND_U_BOOT_DST (0x00200000 - CONFIG_SPL_MAX_SIZE)
40#define CFG_SYS_NAND_U_BOOT_START 0x00200000
Ying Zhangc9e1f582014-01-24 15:50:09 +080041#else
Ying Zhangc9e1f582014-01-24 15:50:09 +080042#ifdef CONFIG_TPL_BUILD
Tom Rini4e590942022-11-12 17:36:51 -050043#define CFG_SYS_NAND_U_BOOT_SIZE (576 << 10)
44#define CFG_SYS_NAND_U_BOOT_DST (0x11000000)
45#define CFG_SYS_NAND_U_BOOT_START (0x11000000)
Ying Zhangc9e1f582014-01-24 15:50:09 +080046#elif defined(CONFIG_SPL_BUILD)
Tom Rini4e590942022-11-12 17:36:51 -050047#define CFG_SYS_NAND_U_BOOT_SIZE (128 << 10)
48#define CFG_SYS_NAND_U_BOOT_DST 0xD0000000
49#define CFG_SYS_NAND_U_BOOT_START 0xD0000000
Dipen Dudhatd793e5a2011-07-28 14:47:28 -050050#endif
Ying Zhangc9e1f582014-01-24 15:50:09 +080051#endif
52#endif
Ruchika Gupta2f439e82011-06-08 22:52:48 -050053
54#ifdef CONFIG_NAND_SECBOOT /* NAND Boot */
Tom Rini3db78c82022-12-04 10:13:40 -050055#define CFG_RESET_VECTOR_ADDRESS 0x110bfffc
Ruchika Gupta2f439e82011-06-08 22:52:48 -050056#endif
57
Tom Rini3db78c82022-12-04 10:13:40 -050058#ifndef CFG_RESET_VECTOR_ADDRESS
59#define CFG_RESET_VECTOR_ADDRESS 0xeffffffc
Poonam Aggrwal49249e12011-02-09 19:17:53 +000060#endif
61
Poonam Aggrwal49249e12011-02-09 19:17:53 +000062/* High Level Configuration Options */
Poonam Aggrwal49249e12011-02-09 19:17:53 +000063
Poonam Aggrwal49249e12011-02-09 19:17:53 +000064#if defined(CONFIG_PCI)
Poonam Aggrwal49249e12011-02-09 19:17:53 +000065/*
66 * PCI Windows
67 * Memory space is mapped 1-1, but I/O space must start from 0.
68 */
69/* controller 1, Slot 1, tgtid 1, Base address a000 */
Tom Riniecc8d422022-11-16 13:10:33 -050070#define CFG_SYS_PCIE1_MEM_VIRT 0x80000000
Poonam Aggrwal49249e12011-02-09 19:17:53 +000071#ifdef CONFIG_PHYS_64BIT
Tom Riniecc8d422022-11-16 13:10:33 -050072#define CFG_SYS_PCIE1_MEM_PHYS 0xc00000000ull
Poonam Aggrwal49249e12011-02-09 19:17:53 +000073#else
Tom Riniecc8d422022-11-16 13:10:33 -050074#define CFG_SYS_PCIE1_MEM_PHYS 0x80000000
Poonam Aggrwal49249e12011-02-09 19:17:53 +000075#endif
Tom Riniecc8d422022-11-16 13:10:33 -050076#define CFG_SYS_PCIE1_IO_VIRT 0xffc00000
Poonam Aggrwal49249e12011-02-09 19:17:53 +000077#ifdef CONFIG_PHYS_64BIT
Tom Riniecc8d422022-11-16 13:10:33 -050078#define CFG_SYS_PCIE1_IO_PHYS 0xfffc00000ull
Poonam Aggrwal49249e12011-02-09 19:17:53 +000079#else
Tom Riniecc8d422022-11-16 13:10:33 -050080#define CFG_SYS_PCIE1_IO_PHYS 0xffc00000
Poonam Aggrwal49249e12011-02-09 19:17:53 +000081#endif
82
83/* controller 2, Slot 2, tgtid 2, Base address 9000 */
Tom Riniecc8d422022-11-16 13:10:33 -050084#define CFG_SYS_PCIE2_MEM_VIRT 0xa0000000
Hou Zhiqiang9de7c762020-05-01 19:06:28 +080085#ifdef CONFIG_PHYS_64BIT
Tom Riniecc8d422022-11-16 13:10:33 -050086#define CFG_SYS_PCIE2_MEM_PHYS 0xc20000000ull
Hou Zhiqiang9de7c762020-05-01 19:06:28 +080087#else
Tom Riniecc8d422022-11-16 13:10:33 -050088#define CFG_SYS_PCIE2_MEM_PHYS 0xa0000000
Hou Zhiqiang9de7c762020-05-01 19:06:28 +080089#endif
Tom Riniecc8d422022-11-16 13:10:33 -050090#define CFG_SYS_PCIE2_IO_VIRT 0xffc10000
Hou Zhiqiang9de7c762020-05-01 19:06:28 +080091#ifdef CONFIG_PHYS_64BIT
Tom Riniecc8d422022-11-16 13:10:33 -050092#define CFG_SYS_PCIE2_IO_PHYS 0xfffc10000ull
Hou Zhiqiang9de7c762020-05-01 19:06:28 +080093#else
Tom Riniecc8d422022-11-16 13:10:33 -050094#define CFG_SYS_PCIE2_IO_PHYS 0xffc10000
Hou Zhiqiang9de7c762020-05-01 19:06:28 +080095#endif
Poonam Aggrwal49249e12011-02-09 19:17:53 +000096#endif
97
Poonam Aggrwal49249e12011-02-09 19:17:53 +000098/* DDR Setup */
Poonam Aggrwal49249e12011-02-09 19:17:53 +000099#define SPD_EEPROM_ADDRESS 0x52
100
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000101#ifndef __ASSEMBLY__
102extern unsigned long get_sdram_size(void);
103#endif
Tom Riniaa6e94d2022-11-16 13:10:37 -0500104#define CFG_SYS_SDRAM_SIZE get_sdram_size() /* DDR size */
Tom Rini65cc0e22022-11-16 13:10:41 -0500105#define CFG_SYS_DDR_SDRAM_BASE 0x00000000
106#define CFG_SYS_SDRAM_BASE CFG_SYS_DDR_SDRAM_BASE
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000107
Tom Rini65cc0e22022-11-16 13:10:41 -0500108#define CFG_SYS_CCSRBAR 0xffe00000
109#define CFG_SYS_CCSRBAR_PHYS_LOW CFG_SYS_CCSRBAR
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000110
111/*
112 * Memory map
113 *
114 * 0x0000_0000 0x3fff_ffff DDR 1G cacheable
115 * 0x8000_0000 0xbfff_ffff PCI Express Mem 1.5G non-cacheable
116 * 0xffc0_0000 0xffc3_ffff PCI IO range 256k non-cacheable
117 *
118 * Localbus non-cacheable
119 * 0xff80_0000 0xff8f_ffff NAND Flash 1M non-cacheable
120 * 0xffb0_0000 0xffbf_ffff Board CPLD 1M non-cacheable
121 * 0xffd0_0000 0xffd0_3fff L1 for stack 16K Cacheable TLB0
122 * 0xffe0_0000 0xffef_ffff CCSR 1M non-cacheable
123 */
124
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000125/*
126 * IFC Definitions
127 */
128/* NOR Flash on IFC */
Prabhakar Kushwaha0fa934d2013-04-16 13:28:12 +0530129
Tom Rini65cc0e22022-11-16 13:10:41 -0500130#define CFG_SYS_FLASH_BASE 0xee000000
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000131
132#ifdef CONFIG_PHYS_64BIT
Tom Rini65cc0e22022-11-16 13:10:41 -0500133#define CFG_SYS_FLASH_BASE_PHYS (0xf00000000ull | CFG_SYS_FLASH_BASE)
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000134#else
Tom Rini65cc0e22022-11-16 13:10:41 -0500135#define CFG_SYS_FLASH_BASE_PHYS CFG_SYS_FLASH_BASE
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000136#endif
137
Tom Rini65cc0e22022-11-16 13:10:41 -0500138#define CFG_SYS_NOR_CSPR (CSPR_PHYS_ADDR(CFG_SYS_FLASH_BASE_PHYS) | \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000139 CSPR_PORT_SIZE_16 | \
140 CSPR_MSEL_NOR | \
141 CSPR_V)
Tom Rini0ed384f2022-11-16 13:10:25 -0500142#define CFG_SYS_NOR_AMASK IFC_AMASK(32*1024*1024)
143#define CFG_SYS_NOR_CSOR CSOR_NOR_ADM_SHIFT(7)
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000144/* NOR Flash Timing Params */
Tom Rini0ed384f2022-11-16 13:10:25 -0500145#define CFG_SYS_NOR_FTIM0 FTIM0_NOR_TACSE(0x4) | \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000146 FTIM0_NOR_TEADC(0x5) | \
147 FTIM0_NOR_TEAHC(0x5)
Tom Rini0ed384f2022-11-16 13:10:25 -0500148#define CFG_SYS_NOR_FTIM1 FTIM1_NOR_TACO(0x1e) | \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000149 FTIM1_NOR_TRAD_NOR(0x0f)
Tom Rini0ed384f2022-11-16 13:10:25 -0500150#define CFG_SYS_NOR_FTIM2 FTIM2_NOR_TCS(0x4) | \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000151 FTIM2_NOR_TCH(0x4) | \
152 FTIM2_NOR_TWP(0x1c)
Tom Rini0ed384f2022-11-16 13:10:25 -0500153#define CFG_SYS_NOR_FTIM3 0x0
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000154
Tom Rini65cc0e22022-11-16 13:10:41 -0500155#define CFG_SYS_FLASH_BANKS_LIST {CFG_SYS_FLASH_BASE_PHYS}
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000156
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000157/* CFI for NOR Flash */
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000158
159/* NAND Flash on IFC */
Tom Rini4e590942022-11-12 17:36:51 -0500160#define CFG_SYS_NAND_BASE 0xff800000
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000161#ifdef CONFIG_PHYS_64BIT
Tom Rini4e590942022-11-12 17:36:51 -0500162#define CFG_SYS_NAND_BASE_PHYS 0xfff800000ull
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000163#else
Tom Rini4e590942022-11-12 17:36:51 -0500164#define CFG_SYS_NAND_BASE_PHYS CFG_SYS_NAND_BASE
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000165#endif
166
Tom Rini4e590942022-11-12 17:36:51 -0500167#define CFG_SYS_NAND_CSPR (CSPR_PHYS_ADDR(CFG_SYS_NAND_BASE_PHYS) \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000168 | CSPR_PORT_SIZE_8 \
169 | CSPR_MSEL_NAND \
170 | CSPR_V)
Tom Rini4e590942022-11-12 17:36:51 -0500171#define CFG_SYS_NAND_AMASK IFC_AMASK(64*1024)
Shengzhou Liue512c502013-09-13 14:46:03 +0800172
York Sun76016862016-11-16 13:30:06 -0800173#if defined(CONFIG_TARGET_P1010RDB_PA)
Tom Rini4e590942022-11-12 17:36:51 -0500174#define CFG_SYS_NAND_CSOR (CSOR_NAND_ECC_ENC_EN /* ECC on encode */ \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000175 | CSOR_NAND_ECC_DEC_EN /* ECC on decode */ \
176 | CSOR_NAND_ECC_MODE_4 /* 4-bit ECC */ \
177 | CSOR_NAND_RAL_2 /* RAL = 2 Bytes */ \
178 | CSOR_NAND_PGS_512 /* Page Size = 512b */ \
179 | CSOR_NAND_SPRZ_16 /* Spare size = 16 */ \
180 | CSOR_NAND_PB(32)) /* 32 Pages Per Block */
Shengzhou Liue512c502013-09-13 14:46:03 +0800181
York Sun76016862016-11-16 13:30:06 -0800182#elif defined(CONFIG_TARGET_P1010RDB_PB)
Tom Rini4e590942022-11-12 17:36:51 -0500183#define CFG_SYS_NAND_CSOR (CSOR_NAND_ECC_ENC_EN /* ECC on encode */ \
Shengzhou Liue512c502013-09-13 14:46:03 +0800184 | CSOR_NAND_ECC_DEC_EN /* ECC on decode */ \
185 | CSOR_NAND_ECC_MODE_4 /* 4-bit ECC */ \
186 | CSOR_NAND_RAL_3 /* RAL = 3Byes */ \
187 | CSOR_NAND_PGS_4K /* Page Size = 4K */ \
188 | CSOR_NAND_SPRZ_224 /* Spare size = 224 */ \
189 | CSOR_NAND_PB(128)) /*Pages Per Block = 128 */
Shengzhou Liue512c502013-09-13 14:46:03 +0800190#endif
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000191
Tom Rini4e590942022-11-12 17:36:51 -0500192#define CFG_SYS_NAND_BASE_LIST { CFG_SYS_NAND_BASE }
Dipen Dudhatd793e5a2011-07-28 14:47:28 -0500193
York Sun76016862016-11-16 13:30:06 -0800194#if defined(CONFIG_TARGET_P1010RDB_PA)
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000195/* NAND Flash Timing Params */
Tom Rini4e590942022-11-12 17:36:51 -0500196#define CFG_SYS_NAND_FTIM0 FTIM0_NAND_TCCST(0x01) | \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000197 FTIM0_NAND_TWP(0x0C) | \
198 FTIM0_NAND_TWCHT(0x04) | \
199 FTIM0_NAND_TWH(0x05)
Tom Rini4e590942022-11-12 17:36:51 -0500200#define CFG_SYS_NAND_FTIM1 FTIM1_NAND_TADLE(0x1d) | \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000201 FTIM1_NAND_TWBE(0x1d) | \
202 FTIM1_NAND_TRR(0x07) | \
203 FTIM1_NAND_TRP(0x0c)
Tom Rini4e590942022-11-12 17:36:51 -0500204#define CFG_SYS_NAND_FTIM2 FTIM2_NAND_TRAD(0x0c) | \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000205 FTIM2_NAND_TREH(0x05) | \
206 FTIM2_NAND_TWHRE(0x0f)
Tom Rini4e590942022-11-12 17:36:51 -0500207#define CFG_SYS_NAND_FTIM3 FTIM3_NAND_TWW(0x04)
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000208
York Sun76016862016-11-16 13:30:06 -0800209#elif defined(CONFIG_TARGET_P1010RDB_PB)
Shengzhou Liue512c502013-09-13 14:46:03 +0800210/* support MT29F16G08ABABAWP 4k-pagesize 2G-bytes NAND */
211/* ONFI NAND Flash mode0 Timing Params */
Tom Rini4e590942022-11-12 17:36:51 -0500212#define CFG_SYS_NAND_FTIM0 (FTIM0_NAND_TCCST(0x07)| \
Shengzhou Liue512c502013-09-13 14:46:03 +0800213 FTIM0_NAND_TWP(0x18) | \
214 FTIM0_NAND_TWCHT(0x07) | \
215 FTIM0_NAND_TWH(0x0a))
Tom Rini4e590942022-11-12 17:36:51 -0500216#define CFG_SYS_NAND_FTIM1 (FTIM1_NAND_TADLE(0x32)| \
Shengzhou Liue512c502013-09-13 14:46:03 +0800217 FTIM1_NAND_TWBE(0x39) | \
218 FTIM1_NAND_TRR(0x0e) | \
219 FTIM1_NAND_TRP(0x18))
Tom Rini4e590942022-11-12 17:36:51 -0500220#define CFG_SYS_NAND_FTIM2 (FTIM2_NAND_TRAD(0x0f) | \
Shengzhou Liue512c502013-09-13 14:46:03 +0800221 FTIM2_NAND_TREH(0x0a) | \
222 FTIM2_NAND_TWHRE(0x1e))
Tom Rini4e590942022-11-12 17:36:51 -0500223#define CFG_SYS_NAND_FTIM3 0x0
Shengzhou Liue512c502013-09-13 14:46:03 +0800224#endif
225
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000226/* Set up IFC registers for boot location NOR/NAND */
Miquel Raynal88718be2019-10-03 19:50:03 +0200227#if defined(CONFIG_MTD_RAW_NAND) || defined(CONFIG_NAND_SECBOOT)
Tom Rini65cc0e22022-11-16 13:10:41 -0500228#define CFG_SYS_CSPR0 CFG_SYS_NAND_CSPR
229#define CFG_SYS_AMASK0 CFG_SYS_NAND_AMASK
230#define CFG_SYS_CSOR0 CFG_SYS_NAND_CSOR
231#define CFG_SYS_CS0_FTIM0 CFG_SYS_NAND_FTIM0
232#define CFG_SYS_CS0_FTIM1 CFG_SYS_NAND_FTIM1
233#define CFG_SYS_CS0_FTIM2 CFG_SYS_NAND_FTIM2
234#define CFG_SYS_CS0_FTIM3 CFG_SYS_NAND_FTIM3
235#define CFG_SYS_CSPR1 CFG_SYS_NOR_CSPR
236#define CFG_SYS_AMASK1 CFG_SYS_NOR_AMASK
237#define CFG_SYS_CSOR1 CFG_SYS_NOR_CSOR
238#define CFG_SYS_CS1_FTIM0 CFG_SYS_NOR_FTIM0
239#define CFG_SYS_CS1_FTIM1 CFG_SYS_NOR_FTIM1
240#define CFG_SYS_CS1_FTIM2 CFG_SYS_NOR_FTIM2
241#define CFG_SYS_CS1_FTIM3 CFG_SYS_NOR_FTIM3
Dipen Dudhatd793e5a2011-07-28 14:47:28 -0500242#else
Tom Rini65cc0e22022-11-16 13:10:41 -0500243#define CFG_SYS_CSPR0 CFG_SYS_NOR_CSPR
244#define CFG_SYS_AMASK0 CFG_SYS_NOR_AMASK
245#define CFG_SYS_CSOR0 CFG_SYS_NOR_CSOR
246#define CFG_SYS_CS0_FTIM0 CFG_SYS_NOR_FTIM0
247#define CFG_SYS_CS0_FTIM1 CFG_SYS_NOR_FTIM1
248#define CFG_SYS_CS0_FTIM2 CFG_SYS_NOR_FTIM2
249#define CFG_SYS_CS0_FTIM3 CFG_SYS_NOR_FTIM3
250#define CFG_SYS_CSPR1 CFG_SYS_NAND_CSPR
251#define CFG_SYS_AMASK1 CFG_SYS_NAND_AMASK
252#define CFG_SYS_CSOR1 CFG_SYS_NAND_CSOR
253#define CFG_SYS_CS1_FTIM0 CFG_SYS_NAND_FTIM0
254#define CFG_SYS_CS1_FTIM1 CFG_SYS_NAND_FTIM1
255#define CFG_SYS_CS1_FTIM2 CFG_SYS_NAND_FTIM2
256#define CFG_SYS_CS1_FTIM3 CFG_SYS_NAND_FTIM3
Dipen Dudhatd793e5a2011-07-28 14:47:28 -0500257#endif
258
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000259/* CPLD on IFC */
Tom Rini65cc0e22022-11-16 13:10:41 -0500260#define CFG_SYS_CPLD_BASE 0xffb00000
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000261
262#ifdef CONFIG_PHYS_64BIT
Tom Rini65cc0e22022-11-16 13:10:41 -0500263#define CFG_SYS_CPLD_BASE_PHYS 0xfffb00000ull
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000264#else
Tom Rini65cc0e22022-11-16 13:10:41 -0500265#define CFG_SYS_CPLD_BASE_PHYS CFG_SYS_CPLD_BASE
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000266#endif
267
Tom Rini65cc0e22022-11-16 13:10:41 -0500268#define CFG_SYS_CSPR3 (CSPR_PHYS_ADDR(CFG_SYS_CPLD_BASE_PHYS) \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000269 | CSPR_PORT_SIZE_8 \
270 | CSPR_MSEL_GPCM \
271 | CSPR_V)
Tom Rini65cc0e22022-11-16 13:10:41 -0500272#define CFG_SYS_AMASK3 IFC_AMASK(64*1024)
273#define CFG_SYS_CSOR3 0x0
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000274/* CPLD Timing parameters for IFC CS3 */
Tom Rini65cc0e22022-11-16 13:10:41 -0500275#define CFG_SYS_CS3_FTIM0 (FTIM0_GPCM_TACSE(0x0e) | \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000276 FTIM0_GPCM_TEADC(0x0e) | \
277 FTIM0_GPCM_TEAHC(0x0e))
Tom Rini65cc0e22022-11-16 13:10:41 -0500278#define CFG_SYS_CS3_FTIM1 (FTIM1_GPCM_TACO(0x0e) | \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000279 FTIM1_GPCM_TRAD(0x1f))
Tom Rini65cc0e22022-11-16 13:10:41 -0500280#define CFG_SYS_CS3_FTIM2 (FTIM2_GPCM_TCS(0x0e) | \
Shaohui Xiede519162014-06-26 14:41:33 +0800281 FTIM2_GPCM_TCH(0x8) | \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000282 FTIM2_GPCM_TWP(0x1f))
Tom Rini65cc0e22022-11-16 13:10:41 -0500283#define CFG_SYS_CS3_FTIM3 0x0
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000284
Tom Rini65cc0e22022-11-16 13:10:41 -0500285#define CFG_SYS_INIT_RAM_ADDR 0xffd00000 /* stack in RAM */
286#define CFG_SYS_INIT_RAM_SIZE 0x00004000 /* End of used area in RAM */
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000287
Tom Rini65cc0e22022-11-16 13:10:41 -0500288#define CFG_SYS_INIT_SP_OFFSET (CFG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000289
Ying Zhangc9e1f582014-01-24 15:50:09 +0800290/*
291 * Config the L2 Cache as L2 SRAM
292 */
293#if defined(CONFIG_SPL_BUILD)
294#if defined(CONFIG_SDCARD) || defined(CONFIG_SPIFLASH)
Tom Rini65cc0e22022-11-16 13:10:41 -0500295#define CFG_SYS_INIT_L2_ADDR 0xD0000000
296#define CFG_SYS_INIT_L2_ADDR_PHYS CFG_SYS_INIT_L2_ADDR
297#define CFG_SYS_INIT_L2_END (CFG_SYS_INIT_L2_ADDR + CONFIG_SYS_L2_SIZE)
Miquel Raynal88718be2019-10-03 19:50:03 +0200298#elif defined(CONFIG_MTD_RAW_NAND)
Ying Zhangc9e1f582014-01-24 15:50:09 +0800299#ifdef CONFIG_TPL_BUILD
Tom Rini65cc0e22022-11-16 13:10:41 -0500300#define CFG_SYS_INIT_L2_ADDR 0xD0000000
301#define CFG_SYS_INIT_L2_ADDR_PHYS CFG_SYS_INIT_L2_ADDR
302#define CFG_SYS_INIT_L2_END (CFG_SYS_INIT_L2_ADDR + CONFIG_SYS_L2_SIZE)
Ying Zhangc9e1f582014-01-24 15:50:09 +0800303#else
Tom Rini65cc0e22022-11-16 13:10:41 -0500304#define CFG_SYS_INIT_L2_ADDR 0xD0000000
305#define CFG_SYS_INIT_L2_ADDR_PHYS CFG_SYS_INIT_L2_ADDR
306#define CFG_SYS_INIT_L2_END (CFG_SYS_INIT_L2_ADDR + CONFIG_SYS_L2_SIZE)
Ying Zhangc9e1f582014-01-24 15:50:09 +0800307#endif
308#endif
309#endif
310
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000311/* Serial Port */
Tom Rini91092132022-11-16 13:10:28 -0500312#define CFG_SYS_NS16550_CLK get_bus_freq(0)
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000313
Tom Rini65cc0e22022-11-16 13:10:41 -0500314#define CFG_SYS_BAUDRATE_TABLE \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000315 {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
316
Tom Rini65cc0e22022-11-16 13:10:41 -0500317#define CFG_SYS_NS16550_COM1 (CFG_SYS_CCSRBAR+0x4500)
318#define CFG_SYS_NS16550_COM2 (CFG_SYS_CCSRBAR+0x4600)
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000319
Heiko Schocher00f792e2012-10-24 13:48:22 +0200320/* I2C */
Shengzhou Liuad89da02013-09-13 14:46:02 +0800321#define I2C_PCA9557_ADDR1 0x18
Shengzhou Liue512c502013-09-13 14:46:03 +0800322#define I2C_PCA9557_ADDR2 0x19
Shengzhou Liuad89da02013-09-13 14:46:02 +0800323#define I2C_PCA9557_BUS_NUM 0
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000324
325/* I2C EEPROM */
York Sun76016862016-11-16 13:30:06 -0800326#if defined(CONFIG_TARGET_P1010RDB_PB)
Shengzhou Liue512c502013-09-13 14:46:03 +0800327#define MAX_NUM_PORTS 9 /* for 128Bytes EEPROM */
328#endif
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000329/* enable read and write access to EEPROM */
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000330
331/* RTC */
Tom Rini65cc0e22022-11-16 13:10:41 -0500332#define CFG_SYS_I2C_RTC_ADDR 0x68
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000333
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000334/*
335 * SPI interface will not be available in case of NAND boot SPI CS0 will be
336 * used for SLIC
337 */
Miquel Raynal88718be2019-10-03 19:50:03 +0200338#if !defined(CONFIG_MTD_RAW_NAND) || !defined(CONFIG_NAND_SECBOOT)
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000339/* eSPI - Enhanced SPI */
Dipen Dudhatd793e5a2011-07-28 14:47:28 -0500340#endif
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000341
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000342#ifdef CONFIG_MMC
Tom Rini6cc04542022-10-28 20:27:13 -0400343#define CFG_SYS_FSL_ESDHC_ADDR CFG_SYS_MPC85xx_ESDHC_ADDR
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000344#endif
345
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000346/*
347 * Environment
348 */
Tom Rinid8e84612022-06-20 08:07:42 -0400349#if defined(CONFIG_MTD_RAW_NAND)
Ying Zhangc9e1f582014-01-24 15:50:09 +0800350#ifdef CONFIG_TPL_BUILD
Tom Rini65cc0e22022-11-16 13:10:41 -0500351#define SPL_ENV_ADDR (CFG_SYS_INIT_L2_ADDR + (160 << 10))
Ying Zhangc9e1f582014-01-24 15:50:09 +0800352#endif
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000353#endif
354
Tom Rini8850c5d2017-05-12 22:33:27 -0400355#if defined(CONFIG_MMC) || defined(CONFIG_USB_EHCI_HCD) \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000356 || defined(CONFIG_FSL_SATA)
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000357#endif
358
359/*
360 * Miscellaneous configurable options
361 */
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000362
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000363/*
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000364 * For booting Linux, the board info and command line data
365 * have to be in the first 64 MB of memory, since this is
366 * the maximum mapped by the Linux kernel during initialization.
367 */
Tom Rini65cc0e22022-11-16 13:10:41 -0500368#define CFG_SYS_BOOTMAPSZ (64 << 20) /* Initial Memory map for Linux */
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000369
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000370/*
371 * Environment Configuration
372 */
373
Tom Rini0613c362022-12-04 10:03:50 -0500374#define CFG_EXTRA_ENV_SETTINGS \
Marek Vasut5368c552012-09-23 17:41:24 +0200375 "hwconfig=" __stringify(CONFIG_DEF_HWCONFIG) "\0" \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000376 "netdev=eth0\0" \
Tom Rini54f80dd2022-12-02 16:42:27 -0500377 "uboot=" CONFIG_UBOOTPATH "\0" \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000378 "loadaddr=1000000\0" \
379 "consoledev=ttyS0\0" \
380 "ramdiskaddr=2000000\0" \
381 "ramdiskfile=rootfs.ext2.gz.uboot\0" \
Scott Woodb24a4f62016-07-19 17:52:06 -0500382 "fdtaddr=1e00000\0" \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000383 "fdtfile=p1010rdb.dtb\0" \
384 "bdev=sda1\0" \
385 "hwconfig=usb1:dr_mode=host,phy_type=utmi\0" \
386 "othbootargs=ramdisk_size=600000\0" \
387 "usbfatboot=setenv bootargs root=/dev/ram rw " \
388 "console=$consoledev,$baudrate $othbootargs; " \
389 "usb start;" \
390 "fatload usb 0:2 $loadaddr $bootfile;" \
391 "fatload usb 0:2 $fdtaddr $fdtfile;" \
392 "fatload usb 0:2 $ramdiskaddr $ramdiskfile;" \
393 "bootm $loadaddr $ramdiskaddr $fdtaddr\0" \
394 "usbext2boot=setenv bootargs root=/dev/ram rw " \
395 "console=$consoledev,$baudrate $othbootargs; " \
396 "usb start;" \
397 "ext2load usb 0:4 $loadaddr $bootfile;" \
398 "ext2load usb 0:4 $fdtaddr $fdtfile;" \
399 "ext2load usb 0:4 $ramdiskaddr $ramdiskfile;" \
Shengzhou Liue512c502013-09-13 14:46:03 +0800400 "bootm $loadaddr $ramdiskaddr $fdtaddr\0" \
Tom Rini028aa092022-02-25 11:19:49 -0500401 BOOTMODE
Shengzhou Liue512c502013-09-13 14:46:03 +0800402
York Sun76016862016-11-16 13:30:06 -0800403#if defined(CONFIG_TARGET_P1010RDB_PA)
Tom Rini028aa092022-02-25 11:19:49 -0500404#define BOOTMODE \
Shengzhou Liue512c502013-09-13 14:46:03 +0800405 "boot_bank0=i2c dev 0; i2c mw 18 1 f1; i2c mw 18 3 f0;" \
406 "mw.b ffb00011 0; mw.b ffb00009 0; reset\0" \
407 "boot_bank1=i2c dev 0; i2c mw 18 1 f1; i2c mw 18 3 f0;" \
408 "mw.b ffb00011 0; mw.b ffb00009 1; reset\0" \
409 "boot_nand=i2c dev 0; i2c mw 18 1 f9; i2c mw 18 3 f0;" \
410 "mw.b ffb00011 0; mw.b ffb00017 1; reset\0"
411
York Sun76016862016-11-16 13:30:06 -0800412#elif defined(CONFIG_TARGET_P1010RDB_PB)
Tom Rini028aa092022-02-25 11:19:49 -0500413#define BOOTMODE \
Shengzhou Liue512c502013-09-13 14:46:03 +0800414 "boot_bank0=i2c dev 0; i2c mw 18 1 fe; i2c mw 18 3 0;" \
415 "i2c mw 19 1 2; i2c mw 19 3 e1; reset\0" \
416 "boot_bank1=i2c dev 0; i2c mw 18 1 fe; i2c mw 18 3 0;" \
417 "i2c mw 19 1 12; i2c mw 19 3 e1; reset\0" \
418 "boot_nand=i2c dev 0; i2c mw 18 1 fc; i2c mw 18 3 0;" \
419 "i2c mw 19 1 8; i2c mw 19 3 f7; reset\0" \
420 "boot_spi=i2c dev 0; i2c mw 18 1 fa; i2c mw 18 3 0;" \
421 "i2c mw 19 1 0; i2c mw 19 3 f7; reset\0" \
422 "boot_sd=i2c dev 0; i2c mw 18 1 f8; i2c mw 18 3 0;" \
423 "i2c mw 19 1 4; i2c mw 19 3 f3; reset\0"
424#endif
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000425
Ruchika Gupta2f439e82011-06-08 22:52:48 -0500426#include <asm/fsl_secure_boot.h>
Ruchika Gupta2f439e82011-06-08 22:52:48 -0500427
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000428#endif /* __CONFIG_H */