blob: 02d49c3d3407b3692f5199c1686f734365afee92 [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
Ruchika Gupta84e0fb42014-09-29 11:14:35 +053027#define CONFIG_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 */
Prabhakar Kushwahae222b1f2014-01-14 11:34:26 +053055#define CONFIG_RESET_VECTOR_ADDRESS 0x110bfffc
Ruchika Gupta2f439e82011-06-08 22:52:48 -050056#endif
57
Poonam Aggrwal49249e12011-02-09 19:17:53 +000058#ifndef CONFIG_RESET_VECTOR_ADDRESS
59#define CONFIG_RESET_VECTOR_ADDRESS 0xeffffffc
60#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/*
99 * These can be toggled for performance analysis, otherwise use default.
100 */
101#define CONFIG_L2_CACHE /* toggle L2 cache */
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000102
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000103/* DDR Setup */
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000104#define SPD_EEPROM_ADDRESS 0x52
105
106#define CONFIG_MEM_INIT_VALUE 0xDeadBeef
107
108#ifndef __ASSEMBLY__
109extern unsigned long get_sdram_size(void);
110#endif
Tom Riniaa6e94d2022-11-16 13:10:37 -0500111#define CFG_SYS_SDRAM_SIZE get_sdram_size() /* DDR size */
Tom Rini65cc0e22022-11-16 13:10:41 -0500112#define CFG_SYS_DDR_SDRAM_BASE 0x00000000
113#define CFG_SYS_SDRAM_BASE CFG_SYS_DDR_SDRAM_BASE
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000114
Tom Rini65cc0e22022-11-16 13:10:41 -0500115#define CFG_SYS_CCSRBAR 0xffe00000
116#define CFG_SYS_CCSRBAR_PHYS_LOW CFG_SYS_CCSRBAR
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000117
118/*
119 * Memory map
120 *
121 * 0x0000_0000 0x3fff_ffff DDR 1G cacheable
122 * 0x8000_0000 0xbfff_ffff PCI Express Mem 1.5G non-cacheable
123 * 0xffc0_0000 0xffc3_ffff PCI IO range 256k non-cacheable
124 *
125 * Localbus non-cacheable
126 * 0xff80_0000 0xff8f_ffff NAND Flash 1M non-cacheable
127 * 0xffb0_0000 0xffbf_ffff Board CPLD 1M non-cacheable
128 * 0xffd0_0000 0xffd0_3fff L1 for stack 16K Cacheable TLB0
129 * 0xffe0_0000 0xffef_ffff CCSR 1M non-cacheable
130 */
131
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000132/*
133 * IFC Definitions
134 */
135/* NOR Flash on IFC */
Prabhakar Kushwaha0fa934d2013-04-16 13:28:12 +0530136
Tom Rini65cc0e22022-11-16 13:10:41 -0500137#define CFG_SYS_FLASH_BASE 0xee000000
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000138
139#ifdef CONFIG_PHYS_64BIT
Tom Rini65cc0e22022-11-16 13:10:41 -0500140#define CFG_SYS_FLASH_BASE_PHYS (0xf00000000ull | CFG_SYS_FLASH_BASE)
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000141#else
Tom Rini65cc0e22022-11-16 13:10:41 -0500142#define CFG_SYS_FLASH_BASE_PHYS CFG_SYS_FLASH_BASE
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000143#endif
144
Tom Rini65cc0e22022-11-16 13:10:41 -0500145#define CFG_SYS_NOR_CSPR (CSPR_PHYS_ADDR(CFG_SYS_FLASH_BASE_PHYS) | \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000146 CSPR_PORT_SIZE_16 | \
147 CSPR_MSEL_NOR | \
148 CSPR_V)
Tom Rini0ed384f2022-11-16 13:10:25 -0500149#define CFG_SYS_NOR_AMASK IFC_AMASK(32*1024*1024)
150#define CFG_SYS_NOR_CSOR CSOR_NOR_ADM_SHIFT(7)
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000151/* NOR Flash Timing Params */
Tom Rini0ed384f2022-11-16 13:10:25 -0500152#define CFG_SYS_NOR_FTIM0 FTIM0_NOR_TACSE(0x4) | \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000153 FTIM0_NOR_TEADC(0x5) | \
154 FTIM0_NOR_TEAHC(0x5)
Tom Rini0ed384f2022-11-16 13:10:25 -0500155#define CFG_SYS_NOR_FTIM1 FTIM1_NOR_TACO(0x1e) | \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000156 FTIM1_NOR_TRAD_NOR(0x0f)
Tom Rini0ed384f2022-11-16 13:10:25 -0500157#define CFG_SYS_NOR_FTIM2 FTIM2_NOR_TCS(0x4) | \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000158 FTIM2_NOR_TCH(0x4) | \
159 FTIM2_NOR_TWP(0x1c)
Tom Rini0ed384f2022-11-16 13:10:25 -0500160#define CFG_SYS_NOR_FTIM3 0x0
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000161
Tom Rini65cc0e22022-11-16 13:10:41 -0500162#define CFG_SYS_FLASH_BANKS_LIST {CFG_SYS_FLASH_BASE_PHYS}
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000163
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000164/* CFI for NOR Flash */
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000165
166/* NAND Flash on IFC */
Tom Rini4e590942022-11-12 17:36:51 -0500167#define CFG_SYS_NAND_BASE 0xff800000
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000168#ifdef CONFIG_PHYS_64BIT
Tom Rini4e590942022-11-12 17:36:51 -0500169#define CFG_SYS_NAND_BASE_PHYS 0xfff800000ull
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000170#else
Tom Rini4e590942022-11-12 17:36:51 -0500171#define CFG_SYS_NAND_BASE_PHYS CFG_SYS_NAND_BASE
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000172#endif
173
Tom Rini4e590942022-11-12 17:36:51 -0500174#define CFG_SYS_NAND_CSPR (CSPR_PHYS_ADDR(CFG_SYS_NAND_BASE_PHYS) \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000175 | CSPR_PORT_SIZE_8 \
176 | CSPR_MSEL_NAND \
177 | CSPR_V)
Tom Rini4e590942022-11-12 17:36:51 -0500178#define CFG_SYS_NAND_AMASK IFC_AMASK(64*1024)
Shengzhou Liue512c502013-09-13 14:46:03 +0800179
York Sun76016862016-11-16 13:30:06 -0800180#if defined(CONFIG_TARGET_P1010RDB_PA)
Tom Rini4e590942022-11-12 17:36:51 -0500181#define CFG_SYS_NAND_CSOR (CSOR_NAND_ECC_ENC_EN /* ECC on encode */ \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000182 | CSOR_NAND_ECC_DEC_EN /* ECC on decode */ \
183 | CSOR_NAND_ECC_MODE_4 /* 4-bit ECC */ \
184 | CSOR_NAND_RAL_2 /* RAL = 2 Bytes */ \
185 | CSOR_NAND_PGS_512 /* Page Size = 512b */ \
186 | CSOR_NAND_SPRZ_16 /* Spare size = 16 */ \
187 | CSOR_NAND_PB(32)) /* 32 Pages Per Block */
Shengzhou Liue512c502013-09-13 14:46:03 +0800188
York Sun76016862016-11-16 13:30:06 -0800189#elif defined(CONFIG_TARGET_P1010RDB_PB)
Tom Rini4e590942022-11-12 17:36:51 -0500190#define CFG_SYS_NAND_CSOR (CSOR_NAND_ECC_ENC_EN /* ECC on encode */ \
Shengzhou Liue512c502013-09-13 14:46:03 +0800191 | CSOR_NAND_ECC_DEC_EN /* ECC on decode */ \
192 | CSOR_NAND_ECC_MODE_4 /* 4-bit ECC */ \
193 | CSOR_NAND_RAL_3 /* RAL = 3Byes */ \
194 | CSOR_NAND_PGS_4K /* Page Size = 4K */ \
195 | CSOR_NAND_SPRZ_224 /* Spare size = 224 */ \
196 | CSOR_NAND_PB(128)) /*Pages Per Block = 128 */
Shengzhou Liue512c502013-09-13 14:46:03 +0800197#endif
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000198
Tom Rini4e590942022-11-12 17:36:51 -0500199#define CFG_SYS_NAND_BASE_LIST { CFG_SYS_NAND_BASE }
Dipen Dudhatd793e5a2011-07-28 14:47:28 -0500200
York Sun76016862016-11-16 13:30:06 -0800201#if defined(CONFIG_TARGET_P1010RDB_PA)
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000202/* NAND Flash Timing Params */
Tom Rini4e590942022-11-12 17:36:51 -0500203#define CFG_SYS_NAND_FTIM0 FTIM0_NAND_TCCST(0x01) | \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000204 FTIM0_NAND_TWP(0x0C) | \
205 FTIM0_NAND_TWCHT(0x04) | \
206 FTIM0_NAND_TWH(0x05)
Tom Rini4e590942022-11-12 17:36:51 -0500207#define CFG_SYS_NAND_FTIM1 FTIM1_NAND_TADLE(0x1d) | \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000208 FTIM1_NAND_TWBE(0x1d) | \
209 FTIM1_NAND_TRR(0x07) | \
210 FTIM1_NAND_TRP(0x0c)
Tom Rini4e590942022-11-12 17:36:51 -0500211#define CFG_SYS_NAND_FTIM2 FTIM2_NAND_TRAD(0x0c) | \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000212 FTIM2_NAND_TREH(0x05) | \
213 FTIM2_NAND_TWHRE(0x0f)
Tom Rini4e590942022-11-12 17:36:51 -0500214#define CFG_SYS_NAND_FTIM3 FTIM3_NAND_TWW(0x04)
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000215
York Sun76016862016-11-16 13:30:06 -0800216#elif defined(CONFIG_TARGET_P1010RDB_PB)
Shengzhou Liue512c502013-09-13 14:46:03 +0800217/* support MT29F16G08ABABAWP 4k-pagesize 2G-bytes NAND */
218/* ONFI NAND Flash mode0 Timing Params */
Tom Rini4e590942022-11-12 17:36:51 -0500219#define CFG_SYS_NAND_FTIM0 (FTIM0_NAND_TCCST(0x07)| \
Shengzhou Liue512c502013-09-13 14:46:03 +0800220 FTIM0_NAND_TWP(0x18) | \
221 FTIM0_NAND_TWCHT(0x07) | \
222 FTIM0_NAND_TWH(0x0a))
Tom Rini4e590942022-11-12 17:36:51 -0500223#define CFG_SYS_NAND_FTIM1 (FTIM1_NAND_TADLE(0x32)| \
Shengzhou Liue512c502013-09-13 14:46:03 +0800224 FTIM1_NAND_TWBE(0x39) | \
225 FTIM1_NAND_TRR(0x0e) | \
226 FTIM1_NAND_TRP(0x18))
Tom Rini4e590942022-11-12 17:36:51 -0500227#define CFG_SYS_NAND_FTIM2 (FTIM2_NAND_TRAD(0x0f) | \
Shengzhou Liue512c502013-09-13 14:46:03 +0800228 FTIM2_NAND_TREH(0x0a) | \
229 FTIM2_NAND_TWHRE(0x1e))
Tom Rini4e590942022-11-12 17:36:51 -0500230#define CFG_SYS_NAND_FTIM3 0x0
Shengzhou Liue512c502013-09-13 14:46:03 +0800231#endif
232
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000233/* Set up IFC registers for boot location NOR/NAND */
Miquel Raynal88718be2019-10-03 19:50:03 +0200234#if defined(CONFIG_MTD_RAW_NAND) || defined(CONFIG_NAND_SECBOOT)
Tom Rini65cc0e22022-11-16 13:10:41 -0500235#define CFG_SYS_CSPR0 CFG_SYS_NAND_CSPR
236#define CFG_SYS_AMASK0 CFG_SYS_NAND_AMASK
237#define CFG_SYS_CSOR0 CFG_SYS_NAND_CSOR
238#define CFG_SYS_CS0_FTIM0 CFG_SYS_NAND_FTIM0
239#define CFG_SYS_CS0_FTIM1 CFG_SYS_NAND_FTIM1
240#define CFG_SYS_CS0_FTIM2 CFG_SYS_NAND_FTIM2
241#define CFG_SYS_CS0_FTIM3 CFG_SYS_NAND_FTIM3
242#define CFG_SYS_CSPR1 CFG_SYS_NOR_CSPR
243#define CFG_SYS_AMASK1 CFG_SYS_NOR_AMASK
244#define CFG_SYS_CSOR1 CFG_SYS_NOR_CSOR
245#define CFG_SYS_CS1_FTIM0 CFG_SYS_NOR_FTIM0
246#define CFG_SYS_CS1_FTIM1 CFG_SYS_NOR_FTIM1
247#define CFG_SYS_CS1_FTIM2 CFG_SYS_NOR_FTIM2
248#define CFG_SYS_CS1_FTIM3 CFG_SYS_NOR_FTIM3
Dipen Dudhatd793e5a2011-07-28 14:47:28 -0500249#else
Tom Rini65cc0e22022-11-16 13:10:41 -0500250#define CFG_SYS_CSPR0 CFG_SYS_NOR_CSPR
251#define CFG_SYS_AMASK0 CFG_SYS_NOR_AMASK
252#define CFG_SYS_CSOR0 CFG_SYS_NOR_CSOR
253#define CFG_SYS_CS0_FTIM0 CFG_SYS_NOR_FTIM0
254#define CFG_SYS_CS0_FTIM1 CFG_SYS_NOR_FTIM1
255#define CFG_SYS_CS0_FTIM2 CFG_SYS_NOR_FTIM2
256#define CFG_SYS_CS0_FTIM3 CFG_SYS_NOR_FTIM3
257#define CFG_SYS_CSPR1 CFG_SYS_NAND_CSPR
258#define CFG_SYS_AMASK1 CFG_SYS_NAND_AMASK
259#define CFG_SYS_CSOR1 CFG_SYS_NAND_CSOR
260#define CFG_SYS_CS1_FTIM0 CFG_SYS_NAND_FTIM0
261#define CFG_SYS_CS1_FTIM1 CFG_SYS_NAND_FTIM1
262#define CFG_SYS_CS1_FTIM2 CFG_SYS_NAND_FTIM2
263#define CFG_SYS_CS1_FTIM3 CFG_SYS_NAND_FTIM3
Dipen Dudhatd793e5a2011-07-28 14:47:28 -0500264#endif
265
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000266/* CPLD on IFC */
Tom Rini65cc0e22022-11-16 13:10:41 -0500267#define CFG_SYS_CPLD_BASE 0xffb00000
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000268
269#ifdef CONFIG_PHYS_64BIT
Tom Rini65cc0e22022-11-16 13:10:41 -0500270#define CFG_SYS_CPLD_BASE_PHYS 0xfffb00000ull
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000271#else
Tom Rini65cc0e22022-11-16 13:10:41 -0500272#define CFG_SYS_CPLD_BASE_PHYS CFG_SYS_CPLD_BASE
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000273#endif
274
Tom Rini65cc0e22022-11-16 13:10:41 -0500275#define CFG_SYS_CSPR3 (CSPR_PHYS_ADDR(CFG_SYS_CPLD_BASE_PHYS) \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000276 | CSPR_PORT_SIZE_8 \
277 | CSPR_MSEL_GPCM \
278 | CSPR_V)
Tom Rini65cc0e22022-11-16 13:10:41 -0500279#define CFG_SYS_AMASK3 IFC_AMASK(64*1024)
280#define CFG_SYS_CSOR3 0x0
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000281/* CPLD Timing parameters for IFC CS3 */
Tom Rini65cc0e22022-11-16 13:10:41 -0500282#define CFG_SYS_CS3_FTIM0 (FTIM0_GPCM_TACSE(0x0e) | \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000283 FTIM0_GPCM_TEADC(0x0e) | \
284 FTIM0_GPCM_TEAHC(0x0e))
Tom Rini65cc0e22022-11-16 13:10:41 -0500285#define CFG_SYS_CS3_FTIM1 (FTIM1_GPCM_TACO(0x0e) | \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000286 FTIM1_GPCM_TRAD(0x1f))
Tom Rini65cc0e22022-11-16 13:10:41 -0500287#define CFG_SYS_CS3_FTIM2 (FTIM2_GPCM_TCS(0x0e) | \
Shaohui Xiede519162014-06-26 14:41:33 +0800288 FTIM2_GPCM_TCH(0x8) | \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000289 FTIM2_GPCM_TWP(0x1f))
Tom Rini65cc0e22022-11-16 13:10:41 -0500290#define CFG_SYS_CS3_FTIM3 0x0
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000291
Tom Rini65cc0e22022-11-16 13:10:41 -0500292#define CFG_SYS_INIT_RAM_ADDR 0xffd00000 /* stack in RAM */
293#define CFG_SYS_INIT_RAM_SIZE 0x00004000 /* End of used area in RAM */
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000294
Tom Rini65cc0e22022-11-16 13:10:41 -0500295#define CFG_SYS_INIT_SP_OFFSET (CFG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000296
Ying Zhangc9e1f582014-01-24 15:50:09 +0800297/*
298 * Config the L2 Cache as L2 SRAM
299 */
300#if defined(CONFIG_SPL_BUILD)
301#if defined(CONFIG_SDCARD) || defined(CONFIG_SPIFLASH)
Tom Rini65cc0e22022-11-16 13:10:41 -0500302#define CFG_SYS_INIT_L2_ADDR 0xD0000000
303#define CFG_SYS_INIT_L2_ADDR_PHYS CFG_SYS_INIT_L2_ADDR
304#define CFG_SYS_INIT_L2_END (CFG_SYS_INIT_L2_ADDR + CONFIG_SYS_L2_SIZE)
Miquel Raynal88718be2019-10-03 19:50:03 +0200305#elif defined(CONFIG_MTD_RAW_NAND)
Ying Zhangc9e1f582014-01-24 15:50:09 +0800306#ifdef CONFIG_TPL_BUILD
Tom Rini65cc0e22022-11-16 13:10:41 -0500307#define CFG_SYS_INIT_L2_ADDR 0xD0000000
308#define CFG_SYS_INIT_L2_ADDR_PHYS CFG_SYS_INIT_L2_ADDR
309#define CFG_SYS_INIT_L2_END (CFG_SYS_INIT_L2_ADDR + CONFIG_SYS_L2_SIZE)
Ying Zhangc9e1f582014-01-24 15:50:09 +0800310#else
Tom Rini65cc0e22022-11-16 13:10:41 -0500311#define CFG_SYS_INIT_L2_ADDR 0xD0000000
312#define CFG_SYS_INIT_L2_ADDR_PHYS CFG_SYS_INIT_L2_ADDR
313#define CFG_SYS_INIT_L2_END (CFG_SYS_INIT_L2_ADDR + CONFIG_SYS_L2_SIZE)
Ying Zhangc9e1f582014-01-24 15:50:09 +0800314#endif
315#endif
316#endif
317
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000318/* Serial Port */
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000319#undef CONFIG_SERIAL_SOFTWARE_FIFO
Tom Rini91092132022-11-16 13:10:28 -0500320#define CFG_SYS_NS16550_CLK get_bus_freq(0)
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000321
Tom Rini65cc0e22022-11-16 13:10:41 -0500322#define CFG_SYS_BAUDRATE_TABLE \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000323 {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
324
Tom Rini65cc0e22022-11-16 13:10:41 -0500325#define CFG_SYS_NS16550_COM1 (CFG_SYS_CCSRBAR+0x4500)
326#define CFG_SYS_NS16550_COM2 (CFG_SYS_CCSRBAR+0x4600)
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000327
Heiko Schocher00f792e2012-10-24 13:48:22 +0200328/* I2C */
Shengzhou Liuad89da02013-09-13 14:46:02 +0800329#define I2C_PCA9557_ADDR1 0x18
Shengzhou Liue512c502013-09-13 14:46:03 +0800330#define I2C_PCA9557_ADDR2 0x19
Shengzhou Liuad89da02013-09-13 14:46:02 +0800331#define I2C_PCA9557_BUS_NUM 0
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000332
333/* I2C EEPROM */
York Sun76016862016-11-16 13:30:06 -0800334#if defined(CONFIG_TARGET_P1010RDB_PB)
Shengzhou Liue512c502013-09-13 14:46:03 +0800335#define MAX_NUM_PORTS 9 /* for 128Bytes EEPROM */
336#endif
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000337/* enable read and write access to EEPROM */
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000338
339/* RTC */
Tom Rini65cc0e22022-11-16 13:10:41 -0500340#define CFG_SYS_I2C_RTC_ADDR 0x68
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000341
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000342/*
343 * SPI interface will not be available in case of NAND boot SPI CS0 will be
344 * used for SLIC
345 */
Miquel Raynal88718be2019-10-03 19:50:03 +0200346#if !defined(CONFIG_MTD_RAW_NAND) || !defined(CONFIG_NAND_SECBOOT)
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000347/* eSPI - Enhanced SPI */
Dipen Dudhatd793e5a2011-07-28 14:47:28 -0500348#endif
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000349
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000350#ifdef CONFIG_MMC
Tom Rini6cc04542022-10-28 20:27:13 -0400351#define CFG_SYS_FSL_ESDHC_ADDR CFG_SYS_MPC85xx_ESDHC_ADDR
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000352#endif
353
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000354/*
355 * Environment
356 */
Tom Rinid8e84612022-06-20 08:07:42 -0400357#if defined(CONFIG_MTD_RAW_NAND)
Ying Zhangc9e1f582014-01-24 15:50:09 +0800358#ifdef CONFIG_TPL_BUILD
Tom Rini65cc0e22022-11-16 13:10:41 -0500359#define SPL_ENV_ADDR (CFG_SYS_INIT_L2_ADDR + (160 << 10))
Ying Zhangc9e1f582014-01-24 15:50:09 +0800360#endif
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000361#endif
362
Tom Rini8850c5d2017-05-12 22:33:27 -0400363#if defined(CONFIG_MMC) || defined(CONFIG_USB_EHCI_HCD) \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000364 || defined(CONFIG_FSL_SATA)
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000365#endif
366
367/*
368 * Miscellaneous configurable options
369 */
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000370
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000371/*
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000372 * For booting Linux, the board info and command line data
373 * have to be in the first 64 MB of memory, since this is
374 * the maximum mapped by the Linux kernel during initialization.
375 */
Tom Rini65cc0e22022-11-16 13:10:41 -0500376#define CFG_SYS_BOOTMAPSZ (64 << 20) /* Initial Memory map for Linux */
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000377
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000378/*
379 * Environment Configuration
380 */
381
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000382#define CONFIG_EXTRA_ENV_SETTINGS \
Marek Vasut5368c552012-09-23 17:41:24 +0200383 "hwconfig=" __stringify(CONFIG_DEF_HWCONFIG) "\0" \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000384 "netdev=eth0\0" \
Tom Rini54f80dd2022-12-02 16:42:27 -0500385 "uboot=" CONFIG_UBOOTPATH "\0" \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000386 "loadaddr=1000000\0" \
387 "consoledev=ttyS0\0" \
388 "ramdiskaddr=2000000\0" \
389 "ramdiskfile=rootfs.ext2.gz.uboot\0" \
Scott Woodb24a4f62016-07-19 17:52:06 -0500390 "fdtaddr=1e00000\0" \
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000391 "fdtfile=p1010rdb.dtb\0" \
392 "bdev=sda1\0" \
393 "hwconfig=usb1:dr_mode=host,phy_type=utmi\0" \
394 "othbootargs=ramdisk_size=600000\0" \
395 "usbfatboot=setenv bootargs root=/dev/ram rw " \
396 "console=$consoledev,$baudrate $othbootargs; " \
397 "usb start;" \
398 "fatload usb 0:2 $loadaddr $bootfile;" \
399 "fatload usb 0:2 $fdtaddr $fdtfile;" \
400 "fatload usb 0:2 $ramdiskaddr $ramdiskfile;" \
401 "bootm $loadaddr $ramdiskaddr $fdtaddr\0" \
402 "usbext2boot=setenv bootargs root=/dev/ram rw " \
403 "console=$consoledev,$baudrate $othbootargs; " \
404 "usb start;" \
405 "ext2load usb 0:4 $loadaddr $bootfile;" \
406 "ext2load usb 0:4 $fdtaddr $fdtfile;" \
407 "ext2load usb 0:4 $ramdiskaddr $ramdiskfile;" \
Shengzhou Liue512c502013-09-13 14:46:03 +0800408 "bootm $loadaddr $ramdiskaddr $fdtaddr\0" \
Tom Rini028aa092022-02-25 11:19:49 -0500409 BOOTMODE
Shengzhou Liue512c502013-09-13 14:46:03 +0800410
York Sun76016862016-11-16 13:30:06 -0800411#if defined(CONFIG_TARGET_P1010RDB_PA)
Tom Rini028aa092022-02-25 11:19:49 -0500412#define BOOTMODE \
Shengzhou Liue512c502013-09-13 14:46:03 +0800413 "boot_bank0=i2c dev 0; i2c mw 18 1 f1; i2c mw 18 3 f0;" \
414 "mw.b ffb00011 0; mw.b ffb00009 0; reset\0" \
415 "boot_bank1=i2c dev 0; i2c mw 18 1 f1; i2c mw 18 3 f0;" \
416 "mw.b ffb00011 0; mw.b ffb00009 1; reset\0" \
417 "boot_nand=i2c dev 0; i2c mw 18 1 f9; i2c mw 18 3 f0;" \
418 "mw.b ffb00011 0; mw.b ffb00017 1; reset\0"
419
York Sun76016862016-11-16 13:30:06 -0800420#elif defined(CONFIG_TARGET_P1010RDB_PB)
Tom Rini028aa092022-02-25 11:19:49 -0500421#define BOOTMODE \
Shengzhou Liue512c502013-09-13 14:46:03 +0800422 "boot_bank0=i2c dev 0; i2c mw 18 1 fe; i2c mw 18 3 0;" \
423 "i2c mw 19 1 2; i2c mw 19 3 e1; reset\0" \
424 "boot_bank1=i2c dev 0; i2c mw 18 1 fe; i2c mw 18 3 0;" \
425 "i2c mw 19 1 12; i2c mw 19 3 e1; reset\0" \
426 "boot_nand=i2c dev 0; i2c mw 18 1 fc; i2c mw 18 3 0;" \
427 "i2c mw 19 1 8; i2c mw 19 3 f7; reset\0" \
428 "boot_spi=i2c dev 0; i2c mw 18 1 fa; i2c mw 18 3 0;" \
429 "i2c mw 19 1 0; i2c mw 19 3 f7; reset\0" \
430 "boot_sd=i2c dev 0; i2c mw 18 1 f8; i2c mw 18 3 0;" \
431 "i2c mw 19 1 4; i2c mw 19 3 f3; reset\0"
432#endif
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000433
Ruchika Gupta2f439e82011-06-08 22:52:48 -0500434#include <asm/fsl_secure_boot.h>
Ruchika Gupta2f439e82011-06-08 22:52:48 -0500435
Poonam Aggrwal49249e12011-02-09 19:17:53 +0000436#endif /* __CONFIG_H */