blob: 41e7f53bd57ee157e67725e2eba9d4aee09113e3 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Li Yang5f999732011-07-26 09:50:46 -05002/*
3 * Copyright 2010-2011 Freescale Semiconductor, Inc.
Biwen Lib0939dd2020-05-01 20:04:01 +08004 * Copyright 2020 NXP
Li Yang5f999732011-07-26 09:50:46 -05005 */
6
7/*
8 * QorIQ RDB boards configuration file
9 */
10#ifndef __CONFIG_H
11#define __CONFIG_H
12
Simon Glassfb64e362020-05-10 11:40:09 -060013#include <linux/stringify.h>
14
York Sun443108bf2016-11-17 13:52:44 -080015#if defined(CONFIG_TARGET_P1020RDB_PC)
Li Yang5f999732011-07-26 09:50:46 -050016#define CONFIG_SLIC
17#define __SW_BOOT_MASK 0x03
18#define __SW_BOOT_NOR 0x5c
19#define __SW_BOOT_SPI 0x1c
20#define __SW_BOOT_SD 0x9c
21#define __SW_BOOT_NAND 0xec
22#define __SW_BOOT_PCIE 0x6c
Pali Rohár108bfdc2022-04-07 12:16:22 +020023#define __SW_NOR_BANK_MASK 0xfd
24#define __SW_NOR_BANK_UP 0x00
25#define __SW_NOR_BANK_LO 0x02
Pali Rohár6037f902022-04-25 16:50:43 +020026#define __SW_BOOT_NOR_BANK_UP 0x5c /* (__SW_BOOT_NOR | __SW_NOR_BANK_UP) */
27#define __SW_BOOT_NOR_BANK_LO 0x5e /* (__SW_BOOT_NOR | __SW_NOR_BANK_LO) */
28#define __SW_BOOT_NOR_BANK_MASK 0x01 /* (__SW_BOOT_MASK & __SW_NOR_BANK_MASK) */
Li Yang5f999732011-07-26 09:50:46 -050029#endif
30
Haijun.Zhanga434d0a2013-06-28 10:47:09 +080031/*
32 * P1020RDB-PD board has user selectable switches for evaluating different
33 * frequency and boot options for the P1020 device. The table that
34 * follow describe the available options. The front six binary number was in
35 * accordance with SW3[1:6].
36 * 111101 533 533 267 667 NOR Core0 boot; Core1 hold-off
37 * 101101 667 667 333 667 NOR Core0 boot; Core1 hold-off
38 * 011001 800 800 400 667 NOR Core0 boot; Core1 hold-off
39 * 001001 800 800 400 667 SD/MMC Core0 boot; Core1 hold-off
40 * 001101 800 800 400 667 SPI Core0 boot; Core1 hold-off
41 * 010001 800 800 400 667 NAND Core0 boot; Core1 hold-off
42 * 011101 800 800 400 667 PCIe-2 Core0 boot; Core1 hold-off
43 */
York Sun06732382016-11-17 13:53:33 -080044#if defined(CONFIG_TARGET_P1020RDB_PD)
Haijun.Zhanga434d0a2013-06-28 10:47:09 +080045#define CONFIG_SLIC
46#define __SW_BOOT_MASK 0x03
47#define __SW_BOOT_NOR 0x64
48#define __SW_BOOT_SPI 0x34
49#define __SW_BOOT_SD 0x24
50#define __SW_BOOT_NAND 0x44
51#define __SW_BOOT_PCIE 0x74
Pali Rohár108bfdc2022-04-07 12:16:22 +020052#define __SW_NOR_BANK_MASK 0xfd
53#define __SW_NOR_BANK_UP 0x00
54#define __SW_NOR_BANK_LO 0x02
Pali Rohár6037f902022-04-25 16:50:43 +020055#define __SW_BOOT_NOR_BANK_UP 0x64 /* (__SW_BOOT_NOR | __SW_NOR_BANK_UP) */
56#define __SW_BOOT_NOR_BANK_LO 0x66 /* (__SW_BOOT_NOR | __SW_NOR_BANK_LO) */
57#define __SW_BOOT_NOR_BANK_MASK 0x01 /* (__SW_BOOT_MASK & __SW_NOR_BANK_MASK) */
Yangbo Lu140b2bb2014-10-16 10:58:55 +080058/*
59 * Dynamic MTD Partition support with mtdparts
60 */
Haijun.Zhanga434d0a2013-06-28 10:47:09 +080061#endif
62
York Sun9c01ff22016-11-17 14:19:18 -080063#if defined(CONFIG_TARGET_P2020RDB)
Li Yang5f999732011-07-26 09:50:46 -050064#define __SW_BOOT_MASK 0x03
65#define __SW_BOOT_NOR 0xc8
66#define __SW_BOOT_SPI 0x28
Pali Rohár521973b2022-04-07 12:16:15 +020067#define __SW_BOOT_SD 0x68
68#define __SW_BOOT_SD2 0x18
Li Yang5f999732011-07-26 09:50:46 -050069#define __SW_BOOT_NAND 0xe8
70#define __SW_BOOT_PCIE 0xa8
Pali Rohár108bfdc2022-04-07 12:16:22 +020071#define __SW_NOR_BANK_MASK 0xfd
72#define __SW_NOR_BANK_UP 0x00
73#define __SW_NOR_BANK_LO 0x02
Pali Rohár6037f902022-04-25 16:50:43 +020074#define __SW_BOOT_NOR_BANK_UP 0xc8 /* (__SW_BOOT_NOR | __SW_NOR_BANK_UP) */
75#define __SW_BOOT_NOR_BANK_LO 0xca /* (__SW_BOOT_NOR | __SW_NOR_BANK_LO) */
76#define __SW_BOOT_NOR_BANK_MASK 0x01 /* (__SW_BOOT_MASK & __SW_NOR_BANK_MASK) */
Yangbo Lu140b2bb2014-10-16 10:58:55 +080077/*
78 * Dynamic MTD Partition support with mtdparts
79 */
Li Yang5f999732011-07-26 09:50:46 -050080#endif
81
82#ifdef CONFIG_SDCARD
Tom Rini6a5dccc2022-11-16 13:10:41 -050083#define CFG_SYS_MMC_U_BOOT_SIZE (768 << 10)
84#define CFG_SYS_MMC_U_BOOT_DST CONFIG_TEXT_BASE
85#define CFG_SYS_MMC_U_BOOT_START CONFIG_TEXT_BASE
Pali Rohár78cc13c2022-08-01 14:50:12 +020086#ifdef CONFIG_FSL_PREPBL_ESDHC_BOOT_SECTOR
Tom Rini6a5dccc2022-11-16 13:10:41 -050087#define CFG_SYS_MMC_U_BOOT_OFFS (CONFIG_SPL_PAD_TO - CONFIG_FSL_PREPBL_ESDHC_BOOT_SECTOR_DATA*512)
Pali Rohár78cc13c2022-08-01 14:50:12 +020088#else
Tom Rini6a5dccc2022-11-16 13:10:41 -050089#define CFG_SYS_MMC_U_BOOT_OFFS CONFIG_SPL_PAD_TO
Pali Rohár78cc13c2022-08-01 14:50:12 +020090#endif
Tom Rinia73788c2021-09-22 14:50:37 -040091#elif defined(CONFIG_SPIFLASH)
Tom Rini6a5dccc2022-11-16 13:10:41 -050092#define CFG_SYS_SPI_FLASH_U_BOOT_SIZE (768 << 10)
93#define CFG_SYS_SPI_FLASH_U_BOOT_DST CONFIG_TEXT_BASE
94#define CFG_SYS_SPI_FLASH_U_BOOT_START CONFIG_TEXT_BASE
95#define CFG_SYS_SPI_FLASH_U_BOOT_OFFS CONFIG_SPL_PAD_TO
Tom Rinia73788c2021-09-22 14:50:37 -040096#elif defined(CONFIG_MTD_RAW_NAND)
Ying Zhangb8b404d2013-09-06 17:30:58 +080097#ifdef CONFIG_TPL_BUILD
Tom Rinib4213492022-11-12 17:36:51 -050098#define CFG_SYS_NAND_U_BOOT_SIZE (832 << 10)
99#define CFG_SYS_NAND_U_BOOT_DST (0x11000000)
100#define CFG_SYS_NAND_U_BOOT_START (0x11000000)
Ying Zhangb8b404d2013-09-06 17:30:58 +0800101#elif defined(CONFIG_SPL_BUILD)
Tom Rinib4213492022-11-12 17:36:51 -0500102#define CFG_SYS_NAND_U_BOOT_SIZE (128 << 10)
103#define CFG_SYS_NAND_U_BOOT_DST 0xf8f80000
104#define CFG_SYS_NAND_U_BOOT_START 0xf8f80000
Ying Zhangb8b404d2013-09-06 17:30:58 +0800105#endif /* not CONFIG_TPL_BUILD */
Li Yang5f999732011-07-26 09:50:46 -0500106#endif
107
Li Yang5f999732011-07-26 09:50:46 -0500108#ifndef CONFIG_RESET_VECTOR_ADDRESS
109#define CONFIG_RESET_VECTOR_ADDRESS 0xeffffffc
110#endif
111
Tom Rini6a5dccc2022-11-16 13:10:41 -0500112#define CFG_SYS_CCSRBAR 0xffe00000
113#define CFG_SYS_CCSRBAR_PHYS_LOW CFG_SYS_CCSRBAR
Li Yang5f999732011-07-26 09:50:46 -0500114
Li Yang5f999732011-07-26 09:50:46 -0500115/* DDR Setup */
Li Yang5f999732011-07-26 09:50:46 -0500116#define SPD_EEPROM_ADDRESS 0x52
Li Yang5f999732011-07-26 09:50:46 -0500117
Priyanka Jainb1d24412020-09-21 11:56:39 +0530118#if defined(CONFIG_TARGET_P1020RDB_PD)
Tom Rinibb4dd962022-11-16 13:10:37 -0500119#define CFG_SYS_SDRAM_SIZE_LAW LAW_SIZE_2G
Li Yang5f999732011-07-26 09:50:46 -0500120#else
Tom Rinibb4dd962022-11-16 13:10:37 -0500121#define CFG_SYS_SDRAM_SIZE_LAW LAW_SIZE_1G
Li Yang5f999732011-07-26 09:50:46 -0500122#endif
Tom Rinibb4dd962022-11-16 13:10:37 -0500123#define CFG_SYS_SDRAM_SIZE (1u << (CFG_SYS_SDRAM_SIZE_LAW - 19))
Tom Rini6a5dccc2022-11-16 13:10:41 -0500124#define CFG_SYS_DDR_SDRAM_BASE 0x00000000
125#define CFG_SYS_SDRAM_BASE CFG_SYS_DDR_SDRAM_BASE
Li Yang5f999732011-07-26 09:50:46 -0500126
Li Yang5f999732011-07-26 09:50:46 -0500127/* Default settings for DDR3 */
York Sun9c01ff22016-11-17 14:19:18 -0800128#ifndef CONFIG_TARGET_P2020RDB
Tom Rini6a5dccc2022-11-16 13:10:41 -0500129#define CFG_SYS_DDR_CS0_BNDS 0x0000003f
130#define CFG_SYS_DDR_CS0_CONFIG 0x80014302
131#define CFG_SYS_DDR_CS0_CONFIG_2 0x00000000
132#define CFG_SYS_DDR_CS1_BNDS 0x0040007f
133#define CFG_SYS_DDR_CS1_CONFIG 0x80014302
134#define CFG_SYS_DDR_CS1_CONFIG_2 0x00000000
Li Yang5f999732011-07-26 09:50:46 -0500135
Tom Rini6a5dccc2022-11-16 13:10:41 -0500136#define CFG_SYS_DDR_INIT_ADDR 0x00000000
137#define CFG_SYS_DDR_INIT_EXT_ADDR 0x00000000
138#define CFG_SYS_DDR_MODE_CONTROL 0x00000000
Li Yang5f999732011-07-26 09:50:46 -0500139
Tom Rini6a5dccc2022-11-16 13:10:41 -0500140#define CFG_SYS_DDR_ZQ_CONTROL 0x89080600
141#define CFG_SYS_DDR_WRLVL_CONTROL 0x8655A608
142#define CFG_SYS_DDR_SR_CNTR 0x00000000
143#define CFG_SYS_DDR_RCW_1 0x00000000
144#define CFG_SYS_DDR_RCW_2 0x00000000
145#define CFG_SYS_DDR_CONTROL 0xC70C0000 /* Type = DDR3 */
146#define CFG_SYS_DDR_CONTROL_2 0x04401050
147#define CFG_SYS_DDR_TIMING_4 0x00220001
148#define CFG_SYS_DDR_TIMING_5 0x03402400
Li Yang5f999732011-07-26 09:50:46 -0500149
Tom Rini6a5dccc2022-11-16 13:10:41 -0500150#define CFG_SYS_DDR_TIMING_3 0x00020000
151#define CFG_SYS_DDR_TIMING_0 0x00330004
152#define CFG_SYS_DDR_TIMING_1 0x6f6B4846
153#define CFG_SYS_DDR_TIMING_2 0x0FA8C8CF
154#define CFG_SYS_DDR_CLK_CTRL 0x03000000
155#define CFG_SYS_DDR_MODE_1 0x40461520
156#define CFG_SYS_DDR_MODE_2 0x8000c000
157#define CFG_SYS_DDR_INTERVAL 0x0C300000
Li Yang5f999732011-07-26 09:50:46 -0500158#endif
159
Li Yang5f999732011-07-26 09:50:46 -0500160/*
161 * Memory map
162 *
Scott Wood5e621872012-10-02 19:35:18 -0500163 * 0x0000_0000 0x7fff_ffff DDR Up to 2GB cacheable
Li Yang5f999732011-07-26 09:50:46 -0500164 * 0x8000_0000 0xdfff_ffff PCI Express Mem 1.5G non-cacheable(PCIe * 3)
Scott Wood5e621872012-10-02 19:35:18 -0500165 * 0xec00_0000 0xefff_ffff NOR flash Up to 64M non-cacheable CS0/1
Scott Wood03fedda2012-10-12 18:02:24 -0500166 * 0xf8f8_0000 0xf8ff_ffff L2 SRAM Up to 512K cacheable
167 * (early boot only)
Scott Wood5e621872012-10-02 19:35:18 -0500168 * 0xff80_0000 0xff80_7fff NAND flash 32K non-cacheable CS1/0
Scott Wood5e621872012-10-02 19:35:18 -0500169 * 0xffa0_0000 0xffaf_ffff CPLD 1M non-cacheable CS3
170 * 0xffb0_0000 0xffbf_ffff VSC7385 switch 1M non-cacheable CS2
Li Yang5f999732011-07-26 09:50:46 -0500171 * 0xffc0_0000 0xffc3_ffff PCI IO range 256k non-cacheable
Scott Wood5e621872012-10-02 19:35:18 -0500172 * 0xffd0_0000 0xffd0_3fff L1 for stack 16K cacheable
Scott Wood5e621872012-10-02 19:35:18 -0500173 * 0xffe0_0000 0xffef_ffff CCSR 1M non-cacheable
Li Yang5f999732011-07-26 09:50:46 -0500174 */
175
Li Yang5f999732011-07-26 09:50:46 -0500176/*
177 * Local Bus Definitions
178 */
Priyanka Jainb1d24412020-09-21 11:56:39 +0530179#if defined(CONFIG_TARGET_P1020RDB_PD)
Tom Rini6a5dccc2022-11-16 13:10:41 -0500180#define CFG_SYS_FLASH_BASE 0xec000000
Li Yang5f999732011-07-26 09:50:46 -0500181#else
Tom Rini6a5dccc2022-11-16 13:10:41 -0500182#define CFG_SYS_FLASH_BASE 0xef000000
Li Yang5f999732011-07-26 09:50:46 -0500183#endif
184
Li Yang5f999732011-07-26 09:50:46 -0500185#ifdef CONFIG_PHYS_64BIT
Tom Rini6a5dccc2022-11-16 13:10:41 -0500186#define CFG_SYS_FLASH_BASE_PHYS (0xf00000000ull | CFG_SYS_FLASH_BASE)
Li Yang5f999732011-07-26 09:50:46 -0500187#else
Tom Rini6a5dccc2022-11-16 13:10:41 -0500188#define CFG_SYS_FLASH_BASE_PHYS CFG_SYS_FLASH_BASE
Li Yang5f999732011-07-26 09:50:46 -0500189#endif
190
Tom Rini772592c2022-12-04 10:03:54 -0500191#define CFG_FLASH_BR_PRELIM (BR_PHYS_ADDR(CFG_SYS_FLASH_BASE_PHYS) \
Li Yang5f999732011-07-26 09:50:46 -0500192 | BR_PS_16 | BR_V)
193
Tom Rinia4912f22022-12-04 10:03:55 -0500194#define CFG_FLASH_OR_PRELIM 0xfc000ff7
Li Yang5f999732011-07-26 09:50:46 -0500195
Tom Rini6a5dccc2022-11-16 13:10:41 -0500196#define CFG_SYS_FLASH_BANKS_LIST {CFG_SYS_FLASH_BASE_PHYS}
Li Yang5f999732011-07-26 09:50:46 -0500197
Li Yang5f999732011-07-26 09:50:46 -0500198/* Nand Flash */
199#ifdef CONFIG_NAND_FSL_ELBC
Tom Rinib4213492022-11-12 17:36:51 -0500200#define CFG_SYS_NAND_BASE 0xff800000
Li Yang5f999732011-07-26 09:50:46 -0500201#ifdef CONFIG_PHYS_64BIT
Tom Rinib4213492022-11-12 17:36:51 -0500202#define CFG_SYS_NAND_BASE_PHYS 0xfff800000ull
Li Yang5f999732011-07-26 09:50:46 -0500203#else
Tom Rinib4213492022-11-12 17:36:51 -0500204#define CFG_SYS_NAND_BASE_PHYS CFG_SYS_NAND_BASE
Li Yang5f999732011-07-26 09:50:46 -0500205#endif
206
Tom Rinib4213492022-11-12 17:36:51 -0500207#define CFG_SYS_NAND_BASE_LIST { CFG_SYS_NAND_BASE }
Li Yang5f999732011-07-26 09:50:46 -0500208
Tom Rinib4213492022-11-12 17:36:51 -0500209#define CFG_SYS_NAND_BR_PRELIM (BR_PHYS_ADDR(CFG_SYS_NAND_BASE_PHYS) \
Li Yang5f999732011-07-26 09:50:46 -0500210 | (2<<BR_DECC_SHIFT) /* Use HW ECC */ \
211 | BR_PS_8 /* Port Size = 8 bit */ \
212 | BR_MS_FCM /* MSEL = FCM */ \
213 | BR_V) /* valid */
York Sun06732382016-11-17 13:53:33 -0800214#if defined(CONFIG_TARGET_P1020RDB_PD)
Tom Rinib4213492022-11-12 17:36:51 -0500215#define CFG_SYS_NAND_OR_PRELIM (OR_AM_32KB \
Haijun.Zhanga434d0a2013-06-28 10:47:09 +0800216 | OR_FCM_PGS /* Large Page*/ \
217 | OR_FCM_CSCT \
218 | OR_FCM_CST \
219 | OR_FCM_CHT \
220 | OR_FCM_SCY_1 \
221 | OR_FCM_TRLX \
222 | OR_FCM_EHTR)
223#else
Tom Rinib4213492022-11-12 17:36:51 -0500224#define CFG_SYS_NAND_OR_PRELIM (OR_AM_32KB /* small page */ \
Li Yang5f999732011-07-26 09:50:46 -0500225 | OR_FCM_CSCT \
226 | OR_FCM_CST \
227 | OR_FCM_CHT \
228 | OR_FCM_SCY_1 \
229 | OR_FCM_TRLX \
230 | OR_FCM_EHTR)
Haijun.Zhanga434d0a2013-06-28 10:47:09 +0800231#endif
Li Yang5f999732011-07-26 09:50:46 -0500232#endif /* CONFIG_NAND_FSL_ELBC */
233
Tom Rini6a5dccc2022-11-16 13:10:41 -0500234#define CFG_SYS_INIT_RAM_ADDR 0xffd00000 /* stack in RAM */
Li Yang5f999732011-07-26 09:50:46 -0500235#ifdef CONFIG_PHYS_64BIT
Tom Rini6a5dccc2022-11-16 13:10:41 -0500236#define CFG_SYS_INIT_RAM_ADDR_PHYS_HIGH 0xf
237#define CFG_SYS_INIT_RAM_ADDR_PHYS_LOW CFG_SYS_INIT_RAM_ADDR
Li Yang5f999732011-07-26 09:50:46 -0500238/* The assembler doesn't like typecast */
Tom Rini6a5dccc2022-11-16 13:10:41 -0500239#define CFG_SYS_INIT_RAM_ADDR_PHYS \
240 ((CFG_SYS_INIT_RAM_ADDR_PHYS_HIGH * 1ull << 32) | \
241 CFG_SYS_INIT_RAM_ADDR_PHYS_LOW)
Li Yang5f999732011-07-26 09:50:46 -0500242#else
243/* Initial L1 address */
Tom Rini6a5dccc2022-11-16 13:10:41 -0500244#define CFG_SYS_INIT_RAM_ADDR_PHYS CFG_SYS_INIT_RAM_ADDR
245#define CFG_SYS_INIT_RAM_ADDR_PHYS_HIGH 0
246#define CFG_SYS_INIT_RAM_ADDR_PHYS_LOW CFG_SYS_INIT_RAM_ADDR_PHYS
Li Yang5f999732011-07-26 09:50:46 -0500247#endif
248/* Size of used area in RAM */
Tom Rini6a5dccc2022-11-16 13:10:41 -0500249#define CFG_SYS_INIT_RAM_SIZE 0x00004000
Li Yang5f999732011-07-26 09:50:46 -0500250
Tom Rini6a5dccc2022-11-16 13:10:41 -0500251#define CFG_SYS_INIT_SP_OFFSET (CFG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
Li Yang5f999732011-07-26 09:50:46 -0500252
Tom Rini6a5dccc2022-11-16 13:10:41 -0500253#define CFG_SYS_CPLD_BASE 0xffa00000
Li Yang5f999732011-07-26 09:50:46 -0500254#ifdef CONFIG_PHYS_64BIT
Tom Rini6a5dccc2022-11-16 13:10:41 -0500255#define CFG_SYS_CPLD_BASE_PHYS 0xfffa00000ull
Li Yang5f999732011-07-26 09:50:46 -0500256#else
Tom Rini6a5dccc2022-11-16 13:10:41 -0500257#define CFG_SYS_CPLD_BASE_PHYS CFG_SYS_CPLD_BASE
Li Yang5f999732011-07-26 09:50:46 -0500258#endif
259/* CPLD config size: 1Mb */
Li Yang5f999732011-07-26 09:50:46 -0500260
Li Yang5f999732011-07-26 09:50:46 -0500261/* Vsc7385 switch */
262#ifdef CONFIG_VSC7385_ENET
Pali Rohár3cac1972022-04-07 12:16:20 +0200263#define __VSCFW_ADDR "vscfw_addr=ef000000\0"
Tom Rini6a5dccc2022-11-16 13:10:41 -0500264#define CFG_SYS_VSC7385_BASE 0xffb00000
Li Yang5f999732011-07-26 09:50:46 -0500265
266#ifdef CONFIG_PHYS_64BIT
Tom Rini6a5dccc2022-11-16 13:10:41 -0500267#define CFG_SYS_VSC7385_BASE_PHYS 0xfffb00000ull
Li Yang5f999732011-07-26 09:50:46 -0500268#else
Tom Rini6a5dccc2022-11-16 13:10:41 -0500269#define CFG_SYS_VSC7385_BASE_PHYS CFG_SYS_VSC7385_BASE
Li Yang5f999732011-07-26 09:50:46 -0500270#endif
271
Li Yang5f999732011-07-26 09:50:46 -0500272/* The size of the VSC7385 firmware image */
273#define CONFIG_VSC7385_IMAGE_SIZE 8192
274#endif
275
Pali Rohár3cac1972022-04-07 12:16:20 +0200276#ifndef __VSCFW_ADDR
277#define __VSCFW_ADDR ""
278#endif
279
Ying Zhang28027d72013-09-06 17:30:56 +0800280/*
281 * Config the L2 Cache as L2 SRAM
282*/
283#if defined(CONFIG_SPL_BUILD)
Ying Zhangf74fd4e2013-09-06 17:30:57 +0800284#if defined(CONFIG_SDCARD) || defined(CONFIG_SPIFLASH)
Tom Rini6a5dccc2022-11-16 13:10:41 -0500285#define CFG_SYS_INIT_L2_ADDR 0xf8f80000
286#define CFG_SYS_INIT_L2_ADDR_PHYS CFG_SYS_INIT_L2_ADDR
287#define CFG_SYS_INIT_L2_END (CFG_SYS_INIT_L2_ADDR + CONFIG_SYS_L2_SIZE)
Miquel Raynald0935362019-10-03 19:50:03 +0200288#elif defined(CONFIG_MTD_RAW_NAND)
Ying Zhangb8b404d2013-09-06 17:30:58 +0800289#ifdef CONFIG_TPL_BUILD
Tom Rini6a5dccc2022-11-16 13:10:41 -0500290#define CFG_SYS_INIT_L2_ADDR 0xf8f80000
291#define CFG_SYS_INIT_L2_ADDR_PHYS CFG_SYS_INIT_L2_ADDR
292#define CFG_SYS_INIT_L2_END (CFG_SYS_INIT_L2_ADDR + CONFIG_SYS_L2_SIZE)
Ying Zhangb8b404d2013-09-06 17:30:58 +0800293#else
Tom Rini6a5dccc2022-11-16 13:10:41 -0500294#define CFG_SYS_INIT_L2_ADDR 0xf8f80000
295#define CFG_SYS_INIT_L2_ADDR_PHYS CFG_SYS_INIT_L2_ADDR
296#define CFG_SYS_INIT_L2_END (CFG_SYS_INIT_L2_ADDR + CONFIG_SYS_L2_SIZE)
Ying Zhangb8b404d2013-09-06 17:30:58 +0800297#endif /* CONFIG_TPL_BUILD */
Ying Zhang28027d72013-09-06 17:30:56 +0800298#endif
299#endif
300
Li Yang5f999732011-07-26 09:50:46 -0500301/* Serial Port - controlled on board with jumper J8
302 * open - index 2
303 * shorted - index 1
304 */
Tom Rinidf6a2152022-11-16 13:10:28 -0500305#define CFG_SYS_NS16550_CLK get_bus_freq(0)
Li Yang5f999732011-07-26 09:50:46 -0500306
Tom Rini6a5dccc2022-11-16 13:10:41 -0500307#define CFG_SYS_BAUDRATE_TABLE \
Li Yang5f999732011-07-26 09:50:46 -0500308 {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
309
Tom Rini6a5dccc2022-11-16 13:10:41 -0500310#define CFG_SYS_NS16550_COM1 (CFG_SYS_CCSRBAR+0x4500)
311#define CFG_SYS_NS16550_COM2 (CFG_SYS_CCSRBAR+0x4600)
Li Yang5f999732011-07-26 09:50:46 -0500312
Li Yang5f999732011-07-26 09:50:46 -0500313/* I2C */
Igor Opaniukf7c91762021-02-09 13:52:45 +0200314#if !CONFIG_IS_ENABLED(DM_I2C)
Tom Rini6a5dccc2022-11-16 13:10:41 -0500315#define CFG_SYS_I2C_NOPROBES { {0, 0x29} }
Biwen Lib0939dd2020-05-01 20:04:01 +0800316#endif
317
Li Yang5f999732011-07-26 09:50:46 -0500318/*
319 * I2C2 EEPROM
320 */
Li Yang5f999732011-07-26 09:50:46 -0500321
Tom Rini6a5dccc2022-11-16 13:10:41 -0500322#define CFG_SYS_I2C_RTC_ADDR 0x68
323#define CFG_SYS_I2C_PCA9557_ADDR 0x18
Li Yang5f999732011-07-26 09:50:46 -0500324
325/* enable read and write access to EEPROM */
Li Yang5f999732011-07-26 09:50:46 -0500326
Li Yang5f999732011-07-26 09:50:46 -0500327#if defined(CONFIG_PCI)
328/*
329 * General PCI
330 * Memory space is mapped 1-1, but I/O space must start from 0.
331 */
332
333/* controller 2, direct to uli, tgtid 2, Base address 9000 */
Tom Rini56af6592022-11-16 13:10:33 -0500334#define CFG_SYS_PCIE2_MEM_VIRT 0xa0000000
Li Yang5f999732011-07-26 09:50:46 -0500335#ifdef CONFIG_PHYS_64BIT
Tom Rini56af6592022-11-16 13:10:33 -0500336#define CFG_SYS_PCIE2_MEM_PHYS 0xc20000000ull
Li Yang5f999732011-07-26 09:50:46 -0500337#else
Tom Rini56af6592022-11-16 13:10:33 -0500338#define CFG_SYS_PCIE2_MEM_PHYS 0xa0000000
Li Yang5f999732011-07-26 09:50:46 -0500339#endif
Tom Rini56af6592022-11-16 13:10:33 -0500340#define CFG_SYS_PCIE2_IO_VIRT 0xffc10000
Li Yang5f999732011-07-26 09:50:46 -0500341#ifdef CONFIG_PHYS_64BIT
Tom Rini56af6592022-11-16 13:10:33 -0500342#define CFG_SYS_PCIE2_IO_PHYS 0xfffc10000ull
Li Yang5f999732011-07-26 09:50:46 -0500343#else
Tom Rini56af6592022-11-16 13:10:33 -0500344#define CFG_SYS_PCIE2_IO_PHYS 0xffc10000
Li Yang5f999732011-07-26 09:50:46 -0500345#endif
Li Yang5f999732011-07-26 09:50:46 -0500346
347/* controller 1, Slot 2, tgtid 1, Base address a000 */
Tom Rini56af6592022-11-16 13:10:33 -0500348#define CFG_SYS_PCIE1_MEM_VIRT 0x80000000
Li Yang5f999732011-07-26 09:50:46 -0500349#ifdef CONFIG_PHYS_64BIT
Tom Rini56af6592022-11-16 13:10:33 -0500350#define CFG_SYS_PCIE1_MEM_PHYS 0xc00000000ull
Li Yang5f999732011-07-26 09:50:46 -0500351#else
Tom Rini56af6592022-11-16 13:10:33 -0500352#define CFG_SYS_PCIE1_MEM_PHYS 0x80000000
Li Yang5f999732011-07-26 09:50:46 -0500353#endif
Tom Rini56af6592022-11-16 13:10:33 -0500354#define CFG_SYS_PCIE1_IO_VIRT 0xffc00000
Li Yang5f999732011-07-26 09:50:46 -0500355#ifdef CONFIG_PHYS_64BIT
Tom Rini56af6592022-11-16 13:10:33 -0500356#define CFG_SYS_PCIE1_IO_PHYS 0xfffc00000ull
Li Yang5f999732011-07-26 09:50:46 -0500357#else
Tom Rini56af6592022-11-16 13:10:33 -0500358#define CFG_SYS_PCIE1_IO_PHYS 0xffc00000
Li Yang5f999732011-07-26 09:50:46 -0500359#endif
Li Yang5f999732011-07-26 09:50:46 -0500360#endif /* CONFIG_PCI */
361
Li Yang5f999732011-07-26 09:50:46 -0500362/*
363 * Environment
364 */
Tom Rini5989fd42022-06-20 08:07:42 -0400365#if defined(CONFIG_MTD_RAW_NAND)
Ying Zhangb8b404d2013-09-06 17:30:58 +0800366#ifdef CONFIG_TPL_BUILD
Tom Rini6a5dccc2022-11-16 13:10:41 -0500367#define SPL_ENV_ADDR (CFG_SYS_INIT_L2_ADDR + (160 << 10))
Ying Zhangb8b404d2013-09-06 17:30:58 +0800368#endif
Li Yang5f999732011-07-26 09:50:46 -0500369#endif
370
Li Yang5f999732011-07-26 09:50:46 -0500371/*
Li Yang5f999732011-07-26 09:50:46 -0500372 * USB
373 */
Li Yang5f999732011-07-26 09:50:46 -0500374
Li Yang5f999732011-07-26 09:50:46 -0500375#ifdef CONFIG_MMC
Tom Rini376b88a2022-10-28 20:27:13 -0400376#define CFG_SYS_FSL_ESDHC_ADDR CFG_SYS_MPC85xx_ESDHC_ADDR
Li Yang5f999732011-07-26 09:50:46 -0500377#endif
378
Li Yang5f999732011-07-26 09:50:46 -0500379/*
380 * Miscellaneous configurable options
381 */
Li Yang5f999732011-07-26 09:50:46 -0500382
383/*
384 * For booting Linux, the board info and command line data
385 * have to be in the first 64 MB of memory, since this is
386 * the maximum mapped by the Linux kernel during initialization.
387 */
Tom Rini6a5dccc2022-11-16 13:10:41 -0500388#define CFG_SYS_BOOTMAPSZ (64 << 20) /* Initial Memory for Linux*/
Li Yang5f999732011-07-26 09:50:46 -0500389
Li Yang5f999732011-07-26 09:50:46 -0500390/*
391 * Environment Configuration
392 */
Li Yang5f999732011-07-26 09:50:46 -0500393
Pali Roháredbaa2e2022-05-26 10:52:27 +0200394#include "p1_p2_bootsrc.h"
Li Yang5f999732011-07-26 09:50:46 -0500395
Tom Rinic9edebe2022-12-04 10:03:50 -0500396#define CFG_EXTRA_ENV_SETTINGS \
Li Yang5f999732011-07-26 09:50:46 -0500397"netdev=eth0\0" \
Tom Rini1479a832022-12-02 16:42:27 -0500398"uboot=" CONFIG_UBOOTPATH "\0" \
Li Yang5f999732011-07-26 09:50:46 -0500399"loadaddr=1000000\0" \
400"bootfile=uImage\0" \
401"tftpflash=tftpboot $loadaddr $uboot; " \
Simon Glass72cc5382022-10-20 18:22:39 -0600402 "protect off " __stringify(CONFIG_TEXT_BASE) " +$filesize; " \
403 "erase " __stringify(CONFIG_TEXT_BASE) " +$filesize; " \
404 "cp.b $loadaddr " __stringify(CONFIG_TEXT_BASE) " $filesize; " \
405 "protect on " __stringify(CONFIG_TEXT_BASE) " +$filesize; " \
406 "cmp.b $loadaddr " __stringify(CONFIG_TEXT_BASE) " $filesize\0" \
Li Yang5f999732011-07-26 09:50:46 -0500407"hwconfig=usb1:dr_mode=host,phy_type=ulpi\0" \
408"consoledev=ttyS0\0" \
409"ramdiskaddr=2000000\0" \
410"ramdiskfile=rootfs.ext2.gz.uboot\0" \
Scott Woodb7f4b852016-07-19 17:52:06 -0500411"fdtaddr=1e00000\0" \
Li Yang5f999732011-07-26 09:50:46 -0500412"bdev=sda1\0" \
413"jffs2nor=mtdblock3\0" \
414"norbootaddr=ef080000\0" \
415"norfdtaddr=ef040000\0" \
416"jffs2nand=mtdblock9\0" \
417"nandbootaddr=100000\0" \
418"nandfdtaddr=80000\0" \
419"ramdisk_size=120000\0" \
Pali Rohár3cac1972022-04-07 12:16:20 +0200420__VSCFW_ADDR \
Pali Roháredbaa2e2022-05-26 10:52:27 +0200421MAP_NOR_LO_CMD(map_lowernorbank) \
422MAP_NOR_UP_CMD(map_uppernorbank) \
423RST_NOR_CMD(norboot) \
Pali Rohár6037f902022-04-25 16:50:43 +0200424RST_NOR_LO_CMD(norlowerboot) \
425RST_NOR_UP_CMD(norupperboot) \
Pali Roháredbaa2e2022-05-26 10:52:27 +0200426RST_SPI_CMD(spiboot) \
427RST_SD_CMD(sdboot) \
Pali Rohár6037f902022-04-25 16:50:43 +0200428RST_SD2_CMD(sd2boot) \
Pali Roháredbaa2e2022-05-26 10:52:27 +0200429RST_NAND_CMD(nandboot) \
430RST_PCIE_CMD(pciboot) \
Pali Rohár6037f902022-04-25 16:50:43 +0200431RST_DEF_CMD(defboot) \
Pali Roháredbaa2e2022-05-26 10:52:27 +0200432""
Li Yang5f999732011-07-26 09:50:46 -0500433
Li Yang5f999732011-07-26 09:50:46 -0500434#endif /* __CONFIG_H */