blob: f34f5187eeee9b8ff7799b50cd630e16a94a326f [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Priyanka Jain8b1a60e2013-10-18 17:19:06 +05302/*
Tom Rini10e47792018-05-06 17:58:06 -04003 * Copyright 2014 Freescale Semiconductor, Inc.
4 */
Priyanka Jain8b1a60e2013-10-18 17:19:06 +05305
6#ifndef __CONFIG_H
7#define __CONFIG_H
8
9/*
vijay rai27cdc772014-03-31 11:46:34 +053010 * T104x RDB board configuration file
Priyanka Jain8b1a60e2013-10-18 17:19:06 +053011 */
Prabhakar Kushwahac4c10d12014-10-29 22:33:09 +053012#include <asm/config_mpc85xx.h>
13
Priyanka Jain8b1a60e2013-10-18 17:19:06 +053014#ifdef CONFIG_RAMBOOT_PBL
Sumit Gargafaca2a2016-07-14 12:27:52 -040015
16#ifndef CONFIG_SECURE_BOOT
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +053017#define CONFIG_SYS_FSL_PBL_PBI $(SRCTREE)/board/freescale/t104xrdb/t104x_pbi.cfg
Sumit Gargafaca2a2016-07-14 12:27:52 -040018#else
19#define CONFIG_SYS_FSL_PBL_PBI \
20 $(SRCTREE)/board/freescale/t104xrdb/t104x_pbi_sb.cfg
21#endif
22
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +053023#define CONFIG_SPL_FLUSH_IMAGE
24#define CONFIG_SPL_TARGET "u-boot-with-spl.bin"
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +053025#define CONFIG_SPL_TEXT_BASE 0xFFFD8000
26#define CONFIG_SPL_PAD_TO 0x40000
27#define CONFIG_SPL_MAX_SIZE 0x28000
28#ifdef CONFIG_SPL_BUILD
29#define CONFIG_SPL_SKIP_RELOCATE
30#define CONFIG_SPL_COMMON_INIT_DDR
31#define CONFIG_SYS_CCSR_DO_NOT_RELOCATE
Priyanka Jain8b1a60e2013-10-18 17:19:06 +053032#endif
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +053033#define RESET_VECTOR_OFFSET 0x27FFC
34#define BOOT_PAGE_OFFSET 0x27000
35
36#ifdef CONFIG_NAND
Sumit Gargafaca2a2016-07-14 12:27:52 -040037#ifdef CONFIG_SECURE_BOOT
38#define CONFIG_U_BOOT_HDR_SIZE (16 << 10)
39/*
40 * HDR would be appended at end of image and copied to DDR along
41 * with U-Boot image.
42 */
43#define CONFIG_SYS_NAND_U_BOOT_SIZE ((768 << 10) + \
44 CONFIG_U_BOOT_HDR_SIZE)
45#else
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +053046#define CONFIG_SYS_NAND_U_BOOT_SIZE (768 << 10)
Sumit Gargafaca2a2016-07-14 12:27:52 -040047#endif
Tang Yuantian25ccd5d2014-07-23 17:27:53 +080048#define CONFIG_SYS_NAND_U_BOOT_DST 0x30000000
49#define CONFIG_SYS_NAND_U_BOOT_START 0x30000000
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +053050#define CONFIG_SYS_NAND_U_BOOT_OFFS (256 << 10)
51#define CONFIG_SYS_LDSCRIPT "arch/powerpc/cpu/mpc85xx/u-boot-nand.lds"
York Sun37cdf5d2016-11-18 13:31:27 -080052#ifdef CONFIG_TARGET_T1040RDB
Zhao Qiang55107dc2016-09-08 12:55:32 +080053#define CONFIG_SYS_FSL_PBL_RCW \
54$(SRCTREE)/board/freescale/t104xrdb/t1040_nand_rcw.cfg
55#endif
York Sune9c8dcf2016-11-18 13:44:00 -080056#ifdef CONFIG_TARGET_T1042RDB_PI
Zhao Qiang55107dc2016-09-08 12:55:32 +080057#define CONFIG_SYS_FSL_PBL_RCW \
58$(SRCTREE)/board/freescale/t104xrdb/t1042_pi_nand_rcw.cfg
59#endif
York Sun5e471552016-11-21 11:08:49 -080060#ifdef CONFIG_TARGET_T1042RDB
Zhao Qiang55107dc2016-09-08 12:55:32 +080061#define CONFIG_SYS_FSL_PBL_RCW \
62$(SRCTREE)/board/freescale/t104xrdb/t1042_nand_rcw.cfg
63#endif
York Sun2c156012016-11-21 10:46:53 -080064#ifdef CONFIG_TARGET_T1040D4RDB
Zhao Qiang55107dc2016-09-08 12:55:32 +080065#define CONFIG_SYS_FSL_PBL_RCW \
66$(SRCTREE)/board/freescale/t104xrdb/t1040d4_nand_rcw.cfg
67#endif
York Sund08610d2016-11-21 11:04:34 -080068#ifdef CONFIG_TARGET_T1042D4RDB
Zhao Qiang55107dc2016-09-08 12:55:32 +080069#define CONFIG_SYS_FSL_PBL_RCW \
70$(SRCTREE)/board/freescale/t104xrdb/t1042d4_nand_rcw.cfg
71#endif
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +053072#define CONFIG_SPL_NAND_BOOT
73#endif
74
75#ifdef CONFIG_SPIFLASH
Tang Yuantian25ccd5d2014-07-23 17:27:53 +080076#define CONFIG_RESET_VECTOR_ADDRESS 0x30000FFC
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +053077#define CONFIG_SPL_SPI_FLASH_MINIMAL
78#define CONFIG_SYS_SPI_FLASH_U_BOOT_SIZE (768 << 10)
Tang Yuantian25ccd5d2014-07-23 17:27:53 +080079#define CONFIG_SYS_SPI_FLASH_U_BOOT_DST (0x30000000)
80#define CONFIG_SYS_SPI_FLASH_U_BOOT_START (0x30000000)
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +053081#define CONFIG_SYS_SPI_FLASH_U_BOOT_OFFS (256 << 10)
82#define CONFIG_SYS_LDSCRIPT "arch/powerpc/cpu/mpc85xx/u-boot.lds"
83#ifndef CONFIG_SPL_BUILD
84#define CONFIG_SYS_MPC85XX_NO_RESETVEC
85#endif
York Sun37cdf5d2016-11-18 13:31:27 -080086#ifdef CONFIG_TARGET_T1040RDB
Zhao Qiang55107dc2016-09-08 12:55:32 +080087#define CONFIG_SYS_FSL_PBL_RCW \
88$(SRCTREE)/board/freescale/t104xrdb/t1040_spi_rcw.cfg
89#endif
York Sune9c8dcf2016-11-18 13:44:00 -080090#ifdef CONFIG_TARGET_T1042RDB_PI
Zhao Qiang55107dc2016-09-08 12:55:32 +080091#define CONFIG_SYS_FSL_PBL_RCW \
92$(SRCTREE)/board/freescale/t104xrdb/t1042_pi_spi_rcw.cfg
93#endif
York Sun5e471552016-11-21 11:08:49 -080094#ifdef CONFIG_TARGET_T1042RDB
Zhao Qiang55107dc2016-09-08 12:55:32 +080095#define CONFIG_SYS_FSL_PBL_RCW \
96$(SRCTREE)/board/freescale/t104xrdb/t1042_spi_rcw.cfg
97#endif
York Sun2c156012016-11-21 10:46:53 -080098#ifdef CONFIG_TARGET_T1040D4RDB
Zhao Qiang55107dc2016-09-08 12:55:32 +080099#define CONFIG_SYS_FSL_PBL_RCW \
100$(SRCTREE)/board/freescale/t104xrdb/t1040d4_spi_rcw.cfg
101#endif
York Sund08610d2016-11-21 11:04:34 -0800102#ifdef CONFIG_TARGET_T1042D4RDB
Zhao Qiang55107dc2016-09-08 12:55:32 +0800103#define CONFIG_SYS_FSL_PBL_RCW \
104$(SRCTREE)/board/freescale/t104xrdb/t1042d4_spi_rcw.cfg
105#endif
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +0530106#define CONFIG_SPL_SPI_BOOT
107#endif
108
109#ifdef CONFIG_SDCARD
Tang Yuantian25ccd5d2014-07-23 17:27:53 +0800110#define CONFIG_RESET_VECTOR_ADDRESS 0x30000FFC
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +0530111#define CONFIG_SYS_MMC_U_BOOT_SIZE (768 << 10)
Tang Yuantian25ccd5d2014-07-23 17:27:53 +0800112#define CONFIG_SYS_MMC_U_BOOT_DST (0x30000000)
113#define CONFIG_SYS_MMC_U_BOOT_START (0x30000000)
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +0530114#define CONFIG_SYS_MMC_U_BOOT_OFFS (260 << 10)
115#define CONFIG_SYS_LDSCRIPT "arch/powerpc/cpu/mpc85xx/u-boot.lds"
116#ifndef CONFIG_SPL_BUILD
117#define CONFIG_SYS_MPC85XX_NO_RESETVEC
118#endif
York Sun37cdf5d2016-11-18 13:31:27 -0800119#ifdef CONFIG_TARGET_T1040RDB
Zhao Qiang55107dc2016-09-08 12:55:32 +0800120#define CONFIG_SYS_FSL_PBL_RCW \
121$(SRCTREE)/board/freescale/t104xrdb/t1040_sd_rcw.cfg
122#endif
York Sune9c8dcf2016-11-18 13:44:00 -0800123#ifdef CONFIG_TARGET_T1042RDB_PI
Zhao Qiang55107dc2016-09-08 12:55:32 +0800124#define CONFIG_SYS_FSL_PBL_RCW \
125$(SRCTREE)/board/freescale/t104xrdb/t1042_pi_sd_rcw.cfg
126#endif
York Sun5e471552016-11-21 11:08:49 -0800127#ifdef CONFIG_TARGET_T1042RDB
Zhao Qiang55107dc2016-09-08 12:55:32 +0800128#define CONFIG_SYS_FSL_PBL_RCW \
129$(SRCTREE)/board/freescale/t104xrdb/t1042_sd_rcw.cfg
130#endif
York Sun2c156012016-11-21 10:46:53 -0800131#ifdef CONFIG_TARGET_T1040D4RDB
Zhao Qiang55107dc2016-09-08 12:55:32 +0800132#define CONFIG_SYS_FSL_PBL_RCW \
133$(SRCTREE)/board/freescale/t104xrdb/t1040d4_sd_rcw.cfg
134#endif
York Sund08610d2016-11-21 11:04:34 -0800135#ifdef CONFIG_TARGET_T1042D4RDB
Zhao Qiang55107dc2016-09-08 12:55:32 +0800136#define CONFIG_SYS_FSL_PBL_RCW \
137$(SRCTREE)/board/freescale/t104xrdb/t1042d4_sd_rcw.cfg
138#endif
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +0530139#define CONFIG_SPL_MMC_BOOT
140#endif
141
142#endif
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530143
144/* High Level Configuration Options */
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530145#define CONFIG_SYS_BOOK3E_HV /* Category E.HV supported */
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530146#define CONFIG_MP /* support multiple processors */
147
Tang Yuantian856b5f32014-04-17 15:33:45 +0800148/* support deep sleep */
149#define CONFIG_DEEP_SLEEP
Tang Yuantian856b5f32014-04-17 15:33:45 +0800150
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530151#ifndef CONFIG_RESET_VECTOR_ADDRESS
152#define CONFIG_RESET_VECTOR_ADDRESS 0xeffffffc
153#endif
154
155#define CONFIG_SYS_FSL_CPC /* Corenet Platform Cache */
York Sunfe845072016-12-28 08:43:45 -0800156#define CONFIG_SYS_NUM_CPC CONFIG_SYS_NUM_DDR_CTLRS
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530157#define CONFIG_PCI_INDIRECT_BRIDGE
Robert P. J. Daya8099812016-05-03 19:52:49 -0400158#define CONFIG_PCIE1 /* PCIE controller 1 */
159#define CONFIG_PCIE2 /* PCIE controller 2 */
160#define CONFIG_PCIE3 /* PCIE controller 3 */
161#define CONFIG_PCIE4 /* PCIE controller 4 */
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530162
163#define CONFIG_FSL_PCI_INIT /* Use common FSL init code */
164#define CONFIG_SYS_PCI_64BIT /* enable 64-bit PCI resources */
165
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530166#define CONFIG_ENV_OVERWRITE
167
Masahiro Yamada8cea9b52017-02-11 22:43:54 +0900168#ifdef CONFIG_MTD_NOR_FLASH
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530169#define CONFIG_FLASH_CFI_DRIVER
170#define CONFIG_SYS_FLASH_CFI
171#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
172#endif
173
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530174#if defined(CONFIG_SPIFLASH)
175#define CONFIG_SYS_EXTRA_ENV_RELOC
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530176#define CONFIG_ENV_SIZE 0x2000 /* 8KB */
177#define CONFIG_ENV_OFFSET 0x100000 /* 1MB */
178#define CONFIG_ENV_SECT_SIZE 0x10000
179#elif defined(CONFIG_SDCARD)
180#define CONFIG_SYS_EXTRA_ENV_RELOC
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530181#define CONFIG_SYS_MMC_ENV_DEV 0
182#define CONFIG_ENV_SIZE 0x2000
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +0530183#define CONFIG_ENV_OFFSET (512 * 0x800)
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530184#elif defined(CONFIG_NAND)
Sumit Gargafaca2a2016-07-14 12:27:52 -0400185#ifdef CONFIG_SECURE_BOOT
186#define CONFIG_RAMBOOT_NAND
187#define CONFIG_BOOTSCRIPT_COPY_RAM
188#endif
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530189#define CONFIG_SYS_EXTRA_ENV_RELOC
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +0530190#define CONFIG_ENV_SIZE 0x2000
Prabhakar Kushwahaf2036562014-01-14 11:34:26 +0530191#define CONFIG_ENV_OFFSET (3 * CONFIG_SYS_NAND_BLOCK_SIZE)
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530192#else
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530193#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SECT_SIZE)
194#define CONFIG_ENV_SIZE 0x2000
195#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K (one sector) */
196#endif
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530197
198#define CONFIG_SYS_CLK_FREQ 100000000
199#define CONFIG_DDR_CLK_FREQ 66666666
200
201/*
202 * These can be toggled for performance analysis, otherwise use default.
203 */
204#define CONFIG_SYS_CACHE_STASHING
205#define CONFIG_BACKSIDE_L2_CACHE
206#define CONFIG_SYS_INIT_L2CSR0 L2CSR0_L2E
207#define CONFIG_BTB /* toggle branch predition */
208#define CONFIG_DDR_ECC
209#ifdef CONFIG_DDR_ECC
210#define CONFIG_ECC_INIT_VIA_DDRCONTROLLER
211#define CONFIG_MEM_INIT_VALUE 0xdeadbeef
212#endif
213
214#define CONFIG_ENABLE_36BIT_PHYS
215
216#define CONFIG_ADDR_MAP
217#define CONFIG_SYS_NUM_ADDR_MAP 64 /* number of TLB1 entries */
218
219#define CONFIG_SYS_MEMTEST_START 0x00200000 /* memtest works on */
220#define CONFIG_SYS_MEMTEST_END 0x00400000
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530221
222/*
223 * Config the L3 Cache as L3 SRAM
224 */
225#define CONFIG_SYS_INIT_L3_ADDR 0xFFFC0000
Sumit Gargafaca2a2016-07-14 12:27:52 -0400226/*
227 * For Secure Boot CONFIG_SYS_INIT_L3_ADDR will be redefined and hence
228 * Physical address (CONFIG_SYS_INIT_L3_ADDR) and virtual address
229 * (CONFIG_SYS_INIT_L3_VADDR) will be different.
230 */
231#define CONFIG_SYS_INIT_L3_VADDR 0xFFFC0000
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +0530232#define CONFIG_SYS_L3_SIZE 256 << 10
Sumit Gargafaca2a2016-07-14 12:27:52 -0400233#define CONFIG_SPL_GD_ADDR (CONFIG_SYS_INIT_L3_VADDR + 32 * 1024)
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +0530234#ifdef CONFIG_RAMBOOT_PBL
235#define CONFIG_ENV_ADDR (CONFIG_SPL_GD_ADDR + 4 * 1024)
236#endif
237#define CONFIG_SPL_RELOC_MALLOC_ADDR (CONFIG_SPL_GD_ADDR + 12 * 1024)
238#define CONFIG_SPL_RELOC_MALLOC_SIZE (30 << 10)
239#define CONFIG_SPL_RELOC_STACK (CONFIG_SPL_GD_ADDR + 64 * 1024)
240#define CONFIG_SPL_RELOC_STACK_SIZE (22 << 10)
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530241
242#define CONFIG_SYS_DCSRBAR 0xf0000000
243#define CONFIG_SYS_DCSRBAR_PHYS 0xf00000000ull
244
245/*
246 * DDR Setup
247 */
248#define CONFIG_VERY_BIG_RAM
249#define CONFIG_SYS_DDR_SDRAM_BASE 0x00000000
250#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE
251
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530252#define CONFIG_DIMM_SLOTS_PER_CTLR 1
Priyanka Jain37e7f6a2014-02-26 09:38:37 +0530253#define CONFIG_CHIP_SELECTS_PER_CTRL (2 * CONFIG_DIMM_SLOTS_PER_CTLR)
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530254
255#define CONFIG_DDR_SPD
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530256
257#define CONFIG_SYS_SPD_BUS_NUM 0
258#define SPD_EEPROM_ADDRESS 0x51
259
260#define CONFIG_SYS_SDRAM_SIZE 4096 /* for fixed parameter use */
261
262/*
263 * IFC Definitions
264 */
265#define CONFIG_SYS_FLASH_BASE 0xe8000000
266#define CONFIG_SYS_FLASH_BASE_PHYS (0xf00000000ull | CONFIG_SYS_FLASH_BASE)
267
268#define CONFIG_SYS_NOR_CSPR_EXT (0xf)
269#define CONFIG_SYS_NOR_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE) | \
270 CSPR_PORT_SIZE_16 | \
271 CSPR_MSEL_NOR | \
272 CSPR_V)
273#define CONFIG_SYS_NOR_AMASK IFC_AMASK(128*1024*1024)
Sandeep Singh4fb16a12014-06-05 18:49:57 +0530274
275/*
276 * TDM Definition
277 */
278#define T1040_TDM_QUIRK_CCSR_BASE 0xfe000000
279
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530280/* NOR Flash Timing Params */
281#define CONFIG_SYS_NOR_CSOR CSOR_NAND_TRHZ_80
282#define CONFIG_SYS_NOR_FTIM0 (FTIM0_NOR_TACSE(0x4) | \
283 FTIM0_NOR_TEADC(0x5) | \
284 FTIM0_NOR_TEAHC(0x5))
285#define CONFIG_SYS_NOR_FTIM1 (FTIM1_NOR_TACO(0x35) | \
286 FTIM1_NOR_TRAD_NOR(0x1A) |\
287 FTIM1_NOR_TSEQRAD_NOR(0x13))
288#define CONFIG_SYS_NOR_FTIM2 (FTIM2_NOR_TCS(0x4) | \
289 FTIM2_NOR_TCH(0x4) | \
290 FTIM2_NOR_TWPH(0x0E) | \
291 FTIM2_NOR_TWP(0x1c))
292#define CONFIG_SYS_NOR_FTIM3 0x0
293
294#define CONFIG_SYS_FLASH_QUIET_TEST
295#define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */
296
297#define CONFIG_SYS_MAX_FLASH_BANKS 2 /* number of banks */
298#define CONFIG_SYS_MAX_FLASH_SECT 1024 /* sectors per device */
299#define CONFIG_SYS_FLASH_ERASE_TOUT 60000 /* Flash Erase Timeout (ms) */
300#define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (ms) */
301
302#define CONFIG_SYS_FLASH_EMPTY_INFO
303#define CONFIG_SYS_FLASH_BANKS_LIST {CONFIG_SYS_FLASH_BASE_PHYS}
304
305/* CPLD on IFC */
Prabhakar Kushwahae5e66332014-04-03 16:50:05 +0530306#define CPLD_LBMAP_MASK 0x3F
307#define CPLD_BANK_SEL_MASK 0x07
308#define CPLD_BANK_OVERRIDE 0x40
309#define CPLD_LBMAP_ALTBANK 0x44 /* BANK OR | BANK 4 */
310#define CPLD_LBMAP_DFLTBANK 0x40 /* BANK OR | BANK0 */
311#define CPLD_LBMAP_RESET 0xFF
312#define CPLD_LBMAP_SHIFT 0x03
Priyanka Jaine7597fe2015-06-05 15:29:02 +0530313
York Sune9c8dcf2016-11-18 13:44:00 -0800314#if defined(CONFIG_TARGET_T1042RDB_PI)
Jason Jindd6377a2014-03-19 10:47:56 +0800315#define CPLD_DIU_SEL_DFP 0x80
York Sund08610d2016-11-21 11:04:34 -0800316#elif defined(CONFIG_TARGET_T1042D4RDB)
Priyanka Jaine7597fe2015-06-05 15:29:02 +0530317#define CPLD_DIU_SEL_DFP 0xc0
Jason Jindd6377a2014-03-19 10:47:56 +0800318#endif
Prabhakar Kushwahae5e66332014-04-03 16:50:05 +0530319
York Sun2c156012016-11-21 10:46:53 -0800320#if defined(CONFIG_TARGET_T1040D4RDB)
Priyanka Jaine7597fe2015-06-05 15:29:02 +0530321#define CPLD_INT_MASK_ALL 0xFF
322#define CPLD_INT_MASK_THERM 0x80
323#define CPLD_INT_MASK_DVI_DFP 0x40
324#define CPLD_INT_MASK_QSGMII1 0x20
325#define CPLD_INT_MASK_QSGMII2 0x10
326#define CPLD_INT_MASK_SGMI1 0x08
327#define CPLD_INT_MASK_SGMI2 0x04
328#define CPLD_INT_MASK_TDMR1 0x02
329#define CPLD_INT_MASK_TDMR2 0x01
330#endif
331
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530332#define CONFIG_SYS_CPLD_BASE 0xffdf0000
333#define CONFIG_SYS_CPLD_BASE_PHYS (0xf00000000ull | CONFIG_SYS_CPLD_BASE)
Priyanka Jain9495ef32014-01-27 14:07:11 +0530334#define CONFIG_SYS_CSPR2_EXT (0xf)
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530335#define CONFIG_SYS_CSPR2 (CSPR_PHYS_ADDR(CONFIG_SYS_CPLD_BASE_PHYS) \
336 | CSPR_PORT_SIZE_8 \
337 | CSPR_MSEL_GPCM \
338 | CSPR_V)
339#define CONFIG_SYS_AMASK2 IFC_AMASK(64*1024)
340#define CONFIG_SYS_CSOR2 0x0
341/* CPLD Timing parameters for IFC CS2 */
342#define CONFIG_SYS_CS2_FTIM0 (FTIM0_GPCM_TACSE(0x0e) | \
343 FTIM0_GPCM_TEADC(0x0e) | \
344 FTIM0_GPCM_TEAHC(0x0e))
345#define CONFIG_SYS_CS2_FTIM1 (FTIM1_GPCM_TACO(0x0e) | \
346 FTIM1_GPCM_TRAD(0x1f))
347#define CONFIG_SYS_CS2_FTIM2 (FTIM2_GPCM_TCS(0x0e) | \
Shaohui Xiec2bc4602014-06-26 14:41:33 +0800348 FTIM2_GPCM_TCH(0x8) | \
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530349 FTIM2_GPCM_TWP(0x1f))
350#define CONFIG_SYS_CS2_FTIM3 0x0
351
352/* NAND Flash on IFC */
353#define CONFIG_NAND_FSL_IFC
354#define CONFIG_SYS_NAND_BASE 0xff800000
355#define CONFIG_SYS_NAND_BASE_PHYS (0xf00000000ull | CONFIG_SYS_NAND_BASE)
356
357#define CONFIG_SYS_NAND_CSPR_EXT (0xf)
358#define CONFIG_SYS_NAND_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
359 | CSPR_PORT_SIZE_8 /* Port Size = 8 bit */ \
360 | CSPR_MSEL_NAND /* MSEL = NAND */ \
361 | CSPR_V)
362#define CONFIG_SYS_NAND_AMASK IFC_AMASK(64*1024)
363
364#define CONFIG_SYS_NAND_CSOR (CSOR_NAND_ECC_ENC_EN /* ECC on encode */ \
365 | CSOR_NAND_ECC_DEC_EN /* ECC on decode */ \
366 | CSOR_NAND_ECC_MODE_4 /* 4-bit ECC */ \
367 | CSOR_NAND_RAL_3 /* RAL = 3Byes */ \
368 | CSOR_NAND_PGS_4K /* Page Size = 4K */ \
369 | CSOR_NAND_SPRZ_224/* Spare size = 224 */ \
370 | CSOR_NAND_PB(64)) /*Pages Per Block = 64*/
371
372#define CONFIG_SYS_NAND_ONFI_DETECTION
373
374/* ONFI NAND Flash mode0 Timing Params */
375#define CONFIG_SYS_NAND_FTIM0 (FTIM0_NAND_TCCST(0x07) | \
376 FTIM0_NAND_TWP(0x18) | \
377 FTIM0_NAND_TWCHT(0x07) | \
378 FTIM0_NAND_TWH(0x0a))
379#define CONFIG_SYS_NAND_FTIM1 (FTIM1_NAND_TADLE(0x32) | \
380 FTIM1_NAND_TWBE(0x39) | \
381 FTIM1_NAND_TRR(0x0e) | \
382 FTIM1_NAND_TRP(0x18))
383#define CONFIG_SYS_NAND_FTIM2 (FTIM2_NAND_TRAD(0x0f) | \
384 FTIM2_NAND_TREH(0x0a) | \
385 FTIM2_NAND_TWHRE(0x1e))
386#define CONFIG_SYS_NAND_FTIM3 0x0
387
388#define CONFIG_SYS_NAND_DDR_LAW 11
389#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
390#define CONFIG_SYS_MAX_NAND_DEVICE 1
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530391
392#define CONFIG_SYS_NAND_BLOCK_SIZE (512 * 1024)
393
394#if defined(CONFIG_NAND)
395#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NAND_CSPR_EXT
396#define CONFIG_SYS_CSPR0 CONFIG_SYS_NAND_CSPR
397#define CONFIG_SYS_AMASK0 CONFIG_SYS_NAND_AMASK
398#define CONFIG_SYS_CSOR0 CONFIG_SYS_NAND_CSOR
399#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NAND_FTIM0
400#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NAND_FTIM1
401#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NAND_FTIM2
402#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NAND_FTIM3
403#define CONFIG_SYS_CSPR1_EXT CONFIG_SYS_NOR_CSPR_EXT
404#define CONFIG_SYS_CSPR1 CONFIG_SYS_NOR_CSPR
405#define CONFIG_SYS_AMASK1 CONFIG_SYS_NOR_AMASK
406#define CONFIG_SYS_CSOR1 CONFIG_SYS_NOR_CSOR
407#define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NOR_FTIM0
408#define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NOR_FTIM1
409#define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NOR_FTIM2
410#define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NOR_FTIM3
411#else
412#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NOR_CSPR_EXT
413#define CONFIG_SYS_CSPR0 CONFIG_SYS_NOR_CSPR
414#define CONFIG_SYS_AMASK0 CONFIG_SYS_NOR_AMASK
415#define CONFIG_SYS_CSOR0 CONFIG_SYS_NOR_CSOR
416#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NOR_FTIM0
417#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NOR_FTIM1
418#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NOR_FTIM2
419#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NOR_FTIM3
420#define CONFIG_SYS_CSPR1_EXT CONFIG_SYS_NAND_CSPR_EXT
421#define CONFIG_SYS_CSPR1 CONFIG_SYS_NAND_CSPR
422#define CONFIG_SYS_AMASK1 CONFIG_SYS_NAND_AMASK
423#define CONFIG_SYS_CSOR1 CONFIG_SYS_NAND_CSOR
424#define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NAND_FTIM0
425#define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NAND_FTIM1
426#define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NAND_FTIM2
427#define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NAND_FTIM3
428#endif
429
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +0530430#ifdef CONFIG_SPL_BUILD
431#define CONFIG_SYS_MONITOR_BASE CONFIG_SPL_TEXT_BASE
432#else
433#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
434#endif
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530435
436#if defined(CONFIG_RAMBOOT_PBL)
437#define CONFIG_SYS_RAMBOOT
438#endif
439
Prabhakar Kushwahac4c10d12014-10-29 22:33:09 +0530440#ifdef CONFIG_SYS_FSL_ERRATUM_A008044
441#if defined(CONFIG_NAND)
442#define CONFIG_A008044_WORKAROUND
443#endif
444#endif
445
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530446#define CONFIG_MISC_INIT_R
447
448#define CONFIG_HWCONFIG
449
450/* define to use L1 as initial stack */
451#define CONFIG_L1_INIT_RAM
452#define CONFIG_SYS_INIT_RAM_LOCK
453#define CONFIG_SYS_INIT_RAM_ADDR 0xfdd00000 /* Initial L1 address */
454#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH 0xf
York Sunee7b4832015-08-17 13:31:51 -0700455#define CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW 0xfe03c000
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530456/* The assembler doesn't like typecast */
457#define CONFIG_SYS_INIT_RAM_ADDR_PHYS \
458 ((CONFIG_SYS_INIT_RAM_ADDR_PHYS_HIGH * 1ull << 32) | \
459 CONFIG_SYS_INIT_RAM_ADDR_PHYS_LOW)
460#define CONFIG_SYS_INIT_RAM_SIZE 0x00004000
461
462#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
463 GENERATED_GBL_DATA_SIZE)
464#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
465
Prabhakar Kushwahaf4027312014-03-31 15:31:48 +0530466#define CONFIG_SYS_MONITOR_LEN (768 * 1024)
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530467#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
468
469/* Serial Port - controlled on board with jumper J8
470 * open - index 2
471 * shorted - index 1
472 */
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530473#define CONFIG_SYS_NS16550_SERIAL
474#define CONFIG_SYS_NS16550_REG_SIZE 1
475#define CONFIG_SYS_NS16550_CLK (get_bus_freq(0)/2)
476
477#define CONFIG_SYS_BAUDRATE_TABLE \
478 {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
479
480#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_CCSRBAR+0x11C500)
481#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_CCSRBAR+0x11C600)
482#define CONFIG_SYS_NS16550_COM3 (CONFIG_SYS_CCSRBAR+0x11D500)
483#define CONFIG_SYS_NS16550_COM4 (CONFIG_SYS_CCSRBAR+0x11D600)
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530484
York Sund08610d2016-11-21 11:04:34 -0800485#if defined(CONFIG_TARGET_T1042RDB_PI) || defined(CONFIG_TARGET_T1042D4RDB)
Jason Jindd6377a2014-03-19 10:47:56 +0800486/* Video */
487#define CONFIG_FSL_DIU_FB
488
489#ifdef CONFIG_FSL_DIU_FB
490#define CONFIG_FSL_DIU_CH7301
491#define CONFIG_SYS_DIU_ADDR (CONFIG_SYS_CCSRBAR + 0x180000)
Jason Jindd6377a2014-03-19 10:47:56 +0800492#define CONFIG_VIDEO_LOGO
493#define CONFIG_VIDEO_BMP_LOGO
494#endif
495#endif
496
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530497/* I2C */
498#define CONFIG_SYS_I2C
499#define CONFIG_SYS_I2C_FSL /* Use FSL common I2C driver */
500#define CONFIG_SYS_FSL_I2C_SPEED 400000 /* I2C speed in Hz */
Shengzhou Liuf7ce8952014-07-07 12:17:47 +0800501#define CONFIG_SYS_FSL_I2C2_SPEED 400000
502#define CONFIG_SYS_FSL_I2C3_SPEED 400000
503#define CONFIG_SYS_FSL_I2C4_SPEED 400000
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530504#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530505#define CONFIG_SYS_FSL_I2C2_SLAVE 0x7F
Shengzhou Liuf7ce8952014-07-07 12:17:47 +0800506#define CONFIG_SYS_FSL_I2C3_SLAVE 0x7F
507#define CONFIG_SYS_FSL_I2C4_SLAVE 0x7F
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530508#define CONFIG_SYS_FSL_I2C_OFFSET 0x118000
Shengzhou Liuf7ce8952014-07-07 12:17:47 +0800509#define CONFIG_SYS_FSL_I2C2_OFFSET 0x118100
510#define CONFIG_SYS_FSL_I2C3_OFFSET 0x119000
511#define CONFIG_SYS_FSL_I2C4_OFFSET 0x119100
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530512
513/* I2C bus multiplexer */
514#define I2C_MUX_PCA_ADDR 0x70
515#define I2C_MUX_CH_DEFAULT 0x8
vijay rai27cdc772014-03-31 11:46:34 +0530516
York Sun097aa602016-11-21 11:25:26 -0800517#if defined(CONFIG_TARGET_T1042RDB_PI) || \
518 defined(CONFIG_TARGET_T1040D4RDB) || \
519 defined(CONFIG_TARGET_T1042D4RDB)
Jason Jindd6377a2014-03-19 10:47:56 +0800520/* LDI/DVI Encoder for display */
521#define CONFIG_SYS_I2C_LDI_ADDR 0x38
522#define CONFIG_SYS_I2C_DVI_ADDR 0x75
523
vijay rai27cdc772014-03-31 11:46:34 +0530524/*
525 * RTC configuration
526 */
527#define RTC
528#define CONFIG_RTC_DS1337 1
529#define CONFIG_SYS_I2C_RTC_ADDR 0x68
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530530
vijay rai27cdc772014-03-31 11:46:34 +0530531/*DVI encoder*/
532#define CONFIG_HDMI_ENCODER_I2C_ADDR 0x75
533#endif
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530534
535/*
536 * eSPI - Enhanced SPI
537 */
Zhiqiang Hou4223c3d2014-09-17 17:37:44 +0800538#define CONFIG_SPI_FLASH_BAR
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530539#define CONFIG_SF_DEFAULT_SPEED 10000000
540#define CONFIG_SF_DEFAULT_MODE 0
Priyanka Jain9495ef32014-01-27 14:07:11 +0530541#define CONFIG_ENV_SPI_BUS 0
542#define CONFIG_ENV_SPI_CS 0
543#define CONFIG_ENV_SPI_MAX_HZ 10000000
544#define CONFIG_ENV_SPI_MODE 0
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530545
546/*
547 * General PCI
548 * Memory space is mapped 1-1, but I/O space must start from 0.
549 */
550
551#ifdef CONFIG_PCI
552/* controller 1, direct to uli, tgtid 3, Base address 20000 */
553#ifdef CONFIG_PCIE1
554#define CONFIG_SYS_PCIE1_MEM_VIRT 0x80000000
555#define CONFIG_SYS_PCIE1_MEM_BUS 0xe0000000
556#define CONFIG_SYS_PCIE1_MEM_PHYS 0xc00000000ull
557#define CONFIG_SYS_PCIE1_MEM_SIZE 0x10000000 /* 256M */
558#define CONFIG_SYS_PCIE1_IO_VIRT 0xf8000000
559#define CONFIG_SYS_PCIE1_IO_BUS 0x00000000
560#define CONFIG_SYS_PCIE1_IO_PHYS 0xff8000000ull
561#define CONFIG_SYS_PCIE1_IO_SIZE 0x00010000 /* 64k */
562#endif
563
564/* controller 2, Slot 2, tgtid 2, Base address 201000 */
565#ifdef CONFIG_PCIE2
566#define CONFIG_SYS_PCIE2_MEM_VIRT 0x90000000
567#define CONFIG_SYS_PCIE2_MEM_BUS 0xe0000000
568#define CONFIG_SYS_PCIE2_MEM_PHYS 0xc10000000ull
569#define CONFIG_SYS_PCIE2_MEM_SIZE 0x10000000 /* 256M */
570#define CONFIG_SYS_PCIE2_IO_VIRT 0xf8010000
571#define CONFIG_SYS_PCIE2_IO_BUS 0x00000000
572#define CONFIG_SYS_PCIE2_IO_PHYS 0xff8010000ull
573#define CONFIG_SYS_PCIE2_IO_SIZE 0x00010000 /* 64k */
574#endif
575
576/* controller 3, Slot 1, tgtid 1, Base address 202000 */
577#ifdef CONFIG_PCIE3
578#define CONFIG_SYS_PCIE3_MEM_VIRT 0xa0000000
579#define CONFIG_SYS_PCIE3_MEM_BUS 0xe0000000
580#define CONFIG_SYS_PCIE3_MEM_PHYS 0xc20000000ull
581#define CONFIG_SYS_PCIE3_MEM_SIZE 0x10000000 /* 256M */
582#define CONFIG_SYS_PCIE3_IO_VIRT 0xf8020000
583#define CONFIG_SYS_PCIE3_IO_BUS 0x00000000
584#define CONFIG_SYS_PCIE3_IO_PHYS 0xff8020000ull
585#define CONFIG_SYS_PCIE3_IO_SIZE 0x00010000 /* 64k */
586#endif
587
588/* controller 4, Base address 203000 */
589#ifdef CONFIG_PCIE4
590#define CONFIG_SYS_PCIE4_MEM_VIRT 0xb0000000
591#define CONFIG_SYS_PCIE4_MEM_BUS 0xe0000000
592#define CONFIG_SYS_PCIE4_MEM_PHYS 0xc30000000ull
593#define CONFIG_SYS_PCIE4_MEM_SIZE 0x10000000 /* 256M */
594#define CONFIG_SYS_PCIE4_IO_VIRT 0xf8030000
595#define CONFIG_SYS_PCIE4_IO_BUS 0x00000000
596#define CONFIG_SYS_PCIE4_IO_PHYS 0xff8030000ull
597#define CONFIG_SYS_PCIE4_IO_SIZE 0x00010000 /* 64k */
598#endif
599
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530600#define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530601#endif /* CONFIG_PCI */
602
603/* SATA */
604#define CONFIG_FSL_SATA_V2
605#ifdef CONFIG_FSL_SATA_V2
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530606#define CONFIG_SYS_SATA_MAX_DEVICE 1
607#define CONFIG_SATA1
608#define CONFIG_SYS_SATA1 CONFIG_SYS_MPC85xx_SATA1_ADDR
609#define CONFIG_SYS_SATA1_FLAGS FLAGS_DMA
610
611#define CONFIG_LBA48
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530612#endif
613
614/*
615* USB
616*/
617#define CONFIG_HAS_FSL_DR_USB
618
619#ifdef CONFIG_HAS_FSL_DR_USB
Tom Riniceed5d22017-05-12 22:33:27 -0400620#ifdef CONFIG_USB_EHCI_HCD
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530621#define CONFIG_USB_EHCI_FSL
622#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
Ran Wang99aafe42017-11-27 10:51:54 +0800623#define CONFIG_EHCI_DESC_BIG_ENDIAN
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530624#endif
625#endif
626
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530627#ifdef CONFIG_MMC
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530628#define CONFIG_SYS_FSL_ESDHC_ADDR CONFIG_SYS_MPC85xx_ESDHC_ADDR
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530629#endif
630
631/* Qman/Bman */
632#ifndef CONFIG_NOBQFMAN
Jeffrey Ladouceurf9c39742014-12-03 18:08:43 -0500633#define CONFIG_SYS_BMAN_NUM_PORTALS 10
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530634#define CONFIG_SYS_BMAN_MEM_BASE 0xf4000000
635#define CONFIG_SYS_BMAN_MEM_PHYS 0xff4000000ull
636#define CONFIG_SYS_BMAN_MEM_SIZE 0x02000000
Jeffrey Ladouceurff2c6462014-12-08 14:54:01 -0500637#define CONFIG_SYS_BMAN_SP_CENA_SIZE 0x4000
638#define CONFIG_SYS_BMAN_SP_CINH_SIZE 0x1000
639#define CONFIG_SYS_BMAN_CENA_BASE CONFIG_SYS_BMAN_MEM_BASE
640#define CONFIG_SYS_BMAN_CENA_SIZE (CONFIG_SYS_BMAN_MEM_SIZE >> 1)
641#define CONFIG_SYS_BMAN_CINH_BASE (CONFIG_SYS_BMAN_MEM_BASE + \
642 CONFIG_SYS_BMAN_CENA_SIZE)
643#define CONFIG_SYS_BMAN_CINH_SIZE (CONFIG_SYS_BMAN_MEM_SIZE >> 1)
644#define CONFIG_SYS_BMAN_SWP_ISDR_REG 0xE08
Jeffrey Ladouceurf9c39742014-12-03 18:08:43 -0500645#define CONFIG_SYS_QMAN_NUM_PORTALS 10
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530646#define CONFIG_SYS_QMAN_MEM_BASE 0xf6000000
647#define CONFIG_SYS_QMAN_MEM_PHYS 0xff6000000ull
648#define CONFIG_SYS_QMAN_MEM_SIZE 0x02000000
Jeffrey Ladouceurff2c6462014-12-08 14:54:01 -0500649#define CONFIG_SYS_QMAN_SP_CENA_SIZE 0x4000
650#define CONFIG_SYS_QMAN_SP_CINH_SIZE 0x1000
651#define CONFIG_SYS_QMAN_CENA_BASE CONFIG_SYS_QMAN_MEM_BASE
652#define CONFIG_SYS_QMAN_CENA_SIZE (CONFIG_SYS_QMAN_MEM_SIZE >> 1)
653#define CONFIG_SYS_QMAN_CINH_BASE (CONFIG_SYS_QMAN_MEM_BASE + \
654 CONFIG_SYS_QMAN_CENA_SIZE)
655#define CONFIG_SYS_QMAN_CINH_SIZE (CONFIG_SYS_QMAN_MEM_SIZE >> 1)
656#define CONFIG_SYS_QMAN_SWP_ISDR_REG 0xE08
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530657
658#define CONFIG_SYS_DPAA_FMAN
659#define CONFIG_SYS_DPAA_PME
660
Zhao Qiang3c494242014-03-14 10:11:03 +0800661#define CONFIG_QE
662#define CONFIG_U_QE
663
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530664/* Default address of microcode for the Linux Fman driver */
665#if defined(CONFIG_SPIFLASH)
666/*
667 * env is stored at 0x100000, sector size is 0x10000, ucode is stored after
668 * env, so we got 0x110000.
669 */
670#define CONFIG_SYS_QE_FW_IN_SPIFLASH
Zhao Qiang83a90842014-03-21 16:21:44 +0800671#define CONFIG_SYS_FMAN_FW_ADDR 0x110000
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530672#elif defined(CONFIG_SDCARD)
673/*
674 * PBL SD boot image should stored at 0x1000(8 blocks), the size of the image is
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +0530675 * about 1MB (2048 blocks), Env is stored after the image, and the env size is
676 * 0x2000 (16 blocks), 8 + 2048 + 16 = 2072, enlarge it to 2080.
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530677 */
678#define CONFIG_SYS_QE_FMAN_FW_IN_MMC
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +0530679#define CONFIG_SYS_FMAN_FW_ADDR (512 * 0x820)
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530680#elif defined(CONFIG_NAND)
681#define CONFIG_SYS_QE_FMAN_FW_IN_NAND
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +0530682#define CONFIG_SYS_FMAN_FW_ADDR (5 * CONFIG_SYS_NAND_BLOCK_SIZE)
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530683#else
684#define CONFIG_SYS_QE_FMAN_FW_IN_NOR
Zhao Qiang83a90842014-03-21 16:21:44 +0800685#define CONFIG_SYS_FMAN_FW_ADDR 0xEFF00000
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +0530686#endif
687
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +0530688#if defined(CONFIG_SPIFLASH)
689#define CONFIG_SYS_QE_FW_ADDR 0x130000
690#elif defined(CONFIG_SDCARD)
691#define CONFIG_SYS_QE_FW_ADDR (512 * 0x920)
692#elif defined(CONFIG_NAND)
693#define CONFIG_SYS_QE_FW_ADDR (7 * CONFIG_SYS_NAND_BLOCK_SIZE)
694#else
Zhao Qiang3c494242014-03-14 10:11:03 +0800695#define CONFIG_SYS_QE_FW_ADDR 0xEFF10000
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530696#endif
Prabhakar Kushwahac8d8e1a2014-04-08 19:13:56 +0530697
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530698#define CONFIG_SYS_QE_FMAN_FW_LENGTH 0x10000
699#define CONFIG_SYS_FDT_PAD (0x3000 + CONFIG_SYS_QE_FMAN_FW_LENGTH)
700#endif /* CONFIG_NOBQFMAN */
701
702#ifdef CONFIG_SYS_DPAA_FMAN
703#define CONFIG_FMAN_ENET
704#define CONFIG_PHY_VITESSE
705#define CONFIG_PHY_REALTEK
706#endif
707
708#ifdef CONFIG_FMAN_ENET
York Sun5e471552016-11-21 11:08:49 -0800709#if defined(CONFIG_TARGET_T1040RDB) || defined(CONFIG_TARGET_T1042RDB)
Priyanka Jaine7597fe2015-06-05 15:29:02 +0530710#define CONFIG_SYS_SGMII1_PHY_ADDR 0x03
York Sun2c156012016-11-21 10:46:53 -0800711#elif defined(CONFIG_TARGET_T1040D4RDB)
Codrin Ciubotariud456ea12015-10-12 16:33:13 +0300712#define CONFIG_SYS_SGMII1_PHY_ADDR 0x01
York Sund08610d2016-11-21 11:04:34 -0800713#elif defined(CONFIG_TARGET_T1042D4RDB)
Priyanka Jaine7597fe2015-06-05 15:29:02 +0530714#define CONFIG_SYS_SGMII1_PHY_ADDR 0x02
715#define CONFIG_SYS_SGMII2_PHY_ADDR 0x03
716#define CONFIG_SYS_SGMII3_PHY_ADDR 0x01
717#endif
718
York Sun097aa602016-11-21 11:25:26 -0800719#if defined(CONFIG_TARGET_T1040D4RDB) || defined(CONFIG_TARGET_T1042D4RDB)
Priyanka Jaine7597fe2015-06-05 15:29:02 +0530720#define CONFIG_SYS_RGMII1_PHY_ADDR 0x04
721#define CONFIG_SYS_RGMII2_PHY_ADDR 0x05
722#else
723#define CONFIG_SYS_RGMII1_PHY_ADDR 0x01
724#define CONFIG_SYS_RGMII2_PHY_ADDR 0x02
vijay rai27cdc772014-03-31 11:46:34 +0530725#endif
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530726
Codrin Ciubotariub29e5e22015-01-21 11:54:12 +0200727/* Enable VSC9953 L2 Switch driver on T1040 SoC */
York Sun37cdf5d2016-11-18 13:31:27 -0800728#if defined(CONFIG_TARGET_T1040RDB) || defined(CONFIG_TARGET_T1040D4RDB)
Codrin Ciubotariub29e5e22015-01-21 11:54:12 +0200729#define CONFIG_VSC9953
York Sun37cdf5d2016-11-18 13:31:27 -0800730#ifdef CONFIG_TARGET_T1040RDB
Codrin Ciubotariub29e5e22015-01-21 11:54:12 +0200731#define CONFIG_SYS_FM1_QSGMII11_PHY_ADDR 0x04
732#define CONFIG_SYS_FM1_QSGMII21_PHY_ADDR 0x08
Priyanka Jaine7597fe2015-06-05 15:29:02 +0530733#else
734#define CONFIG_SYS_FM1_QSGMII11_PHY_ADDR 0x08
735#define CONFIG_SYS_FM1_QSGMII21_PHY_ADDR 0x0c
736#endif
Codrin Ciubotariub29e5e22015-01-21 11:54:12 +0200737#endif
738
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530739#define CONFIG_MII /* MII PHY management */
Priyanka Jain29b426b2014-01-30 11:30:04 +0530740#define CONFIG_ETHPRIME "FM1@DTSEC4"
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530741#endif
742
743/*
744 * Environment
745 */
746#define CONFIG_LOADS_ECHO /* echo on for serial download */
747#define CONFIG_SYS_LOADS_BAUD_CHANGE /* allow baudrate change */
748
749/*
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530750 * Miscellaneous configurable options
751 */
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530752#define CONFIG_SYS_LOAD_ADDR 0x2000000 /* default load address */
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530753
754/*
755 * For booting Linux, the board info and command line data
756 * have to be in the first 64 MB of memory, since this is
757 * the maximum mapped by the Linux kernel during initialization.
758 */
759#define CONFIG_SYS_BOOTMAPSZ (64 << 20) /* Initial map for Linux*/
760#define CONFIG_SYS_BOOTM_LEN (64 << 20) /* Increase max gunzip size */
761
762#ifdef CONFIG_CMD_KGDB
763#define CONFIG_KGDB_BAUDRATE 230400 /* speed to run kgdb serial port */
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530764#endif
765
766/*
Prabhakar Kushwaha3d1b4bf2014-04-02 17:26:23 +0530767 * Dynamic MTD Partition support with mtdparts
768 */
Masahiro Yamada8cea9b52017-02-11 22:43:54 +0900769#ifdef CONFIG_MTD_NOR_FLASH
Prabhakar Kushwaha3d1b4bf2014-04-02 17:26:23 +0530770#define CONFIG_MTD_DEVICE
771#define CONFIG_MTD_PARTITIONS
Prabhakar Kushwaha3d1b4bf2014-04-02 17:26:23 +0530772#define CONFIG_FLASH_CFI_MTD
Prabhakar Kushwaha3d1b4bf2014-04-02 17:26:23 +0530773#endif
774
775/*
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530776 * Environment Configuration
777 */
778#define CONFIG_ROOTPATH "/opt/nfsroot"
779#define CONFIG_BOOTFILE "uImage"
780#define CONFIG_UBOOTPATH "u-boot.bin" /* U-Boot image on TFTP server*/
781
782/* default location for tftp and bootm */
783#define CONFIG_LOADADDR 1000000
784
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530785#define __USB_PHY_TYPE utmi
vijay rai6eb8e0c2014-08-19 12:46:53 +0530786#define RAMDISKFILE "t104xrdb/ramdisk.uboot"
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530787
York Sun37cdf5d2016-11-18 13:31:27 -0800788#ifdef CONFIG_TARGET_T1040RDB
vijay rai27cdc772014-03-31 11:46:34 +0530789#define FDTFILE "t1040rdb/t1040rdb.dtb"
York Sune9c8dcf2016-11-18 13:44:00 -0800790#elif defined(CONFIG_TARGET_T1042RDB_PI)
vijay rai6eb8e0c2014-08-19 12:46:53 +0530791#define FDTFILE "t1042rdb_pi/t1042rdb_pi.dtb"
York Sun5e471552016-11-21 11:08:49 -0800792#elif defined(CONFIG_TARGET_T1042RDB)
vijay rai6eb8e0c2014-08-19 12:46:53 +0530793#define FDTFILE "t1042rdb/t1042rdb.dtb"
York Sun2c156012016-11-21 10:46:53 -0800794#elif defined(CONFIG_TARGET_T1040D4RDB)
Priyanka Jaine7597fe2015-06-05 15:29:02 +0530795#define FDTFILE "t1042rdb/t1040d4rdb.dtb"
York Sund08610d2016-11-21 11:04:34 -0800796#elif defined(CONFIG_TARGET_T1042D4RDB)
Priyanka Jaine7597fe2015-06-05 15:29:02 +0530797#define FDTFILE "t1042rdb/t1042d4rdb.dtb"
vijay rai27cdc772014-03-31 11:46:34 +0530798#endif
799
Jason Jindd6377a2014-03-19 10:47:56 +0800800#ifdef CONFIG_FSL_DIU_FB
801#define DIU_ENVIRONMENT "video-mode=fslfb:1024x768-32@60,monitor=dvi"
802#else
803#define DIU_ENVIRONMENT
804#endif
805
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530806#define CONFIG_EXTRA_ENV_SETTINGS \
Priyanka Jain9495ef32014-01-27 14:07:11 +0530807 "hwconfig=fsl_ddr:bank_intlv=cs0_cs1;" \
808 "usb1:dr_mode=host,phy_type=" __stringify(__USB_PHY_TYPE) ";"\
809 "usb2:dr_mode=host,phy_type=" __stringify(__USB_PHY_TYPE) "\0"\
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530810 "netdev=eth0\0" \
Jason Jindd6377a2014-03-19 10:47:56 +0800811 "video-mode=" __stringify(DIU_ENVIRONMENT) "\0" \
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530812 "uboot=" __stringify(CONFIG_UBOOTPATH) "\0" \
813 "ubootaddr=" __stringify(CONFIG_SYS_TEXT_BASE) "\0" \
814 "tftpflash=tftpboot $loadaddr $uboot && " \
815 "protect off $ubootaddr +$filesize && " \
816 "erase $ubootaddr +$filesize && " \
817 "cp.b $loadaddr $ubootaddr $filesize && " \
818 "protect on $ubootaddr +$filesize && " \
819 "cmp.b $loadaddr $ubootaddr $filesize\0" \
820 "consoledev=ttyS0\0" \
821 "ramdiskaddr=2000000\0" \
vijay rai27cdc772014-03-31 11:46:34 +0530822 "ramdiskfile=" __stringify(RAMDISKFILE) "\0" \
Scott Woodb7f4b852016-07-19 17:52:06 -0500823 "fdtaddr=1e00000\0" \
vijay rai27cdc772014-03-31 11:46:34 +0530824 "fdtfile=" __stringify(FDTFILE) "\0" \
Kim Phillips1dedccc2014-05-14 19:33:45 -0500825 "bdev=sda3\0"
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530826
827#define CONFIG_LINUX \
828 "setenv bootargs root=/dev/ram rw " \
829 "console=$consoledev,$baudrate $othbootargs;" \
830 "setenv ramdiskaddr 0x02000000;" \
831 "setenv fdtaddr 0x00c00000;" \
832 "setenv loadaddr 0x1000000;" \
833 "bootm $loadaddr $ramdiskaddr $fdtaddr"
834
835#define CONFIG_HDBOOT \
836 "setenv bootargs root=/dev/$bdev rw " \
837 "console=$consoledev,$baudrate $othbootargs;" \
838 "tftp $loadaddr $bootfile;" \
839 "tftp $fdtaddr $fdtfile;" \
840 "bootm $loadaddr - $fdtaddr"
841
842#define CONFIG_NFSBOOTCOMMAND \
843 "setenv bootargs root=/dev/nfs rw " \
844 "nfsroot=$serverip:$rootpath " \
845 "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
846 "console=$consoledev,$baudrate $othbootargs;" \
847 "tftp $loadaddr $bootfile;" \
848 "tftp $fdtaddr $fdtfile;" \
849 "bootm $loadaddr - $fdtaddr"
850
851#define CONFIG_RAMBOOTCOMMAND \
852 "setenv bootargs root=/dev/ram rw " \
853 "console=$consoledev,$baudrate $othbootargs;" \
854 "tftp $ramdiskaddr $ramdiskfile;" \
855 "tftp $loadaddr $bootfile;" \
856 "tftp $fdtaddr $fdtfile;" \
857 "bootm $loadaddr $ramdiskaddr $fdtaddr"
858
859#define CONFIG_BOOTCOMMAND CONFIG_LINUX
860
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530861#include <asm/fsl_secure_boot.h>
Aneesh Bansal962021a2016-01-22 16:37:22 +0530862
Priyanka Jain8b1a60e2013-10-18 17:19:06 +0530863#endif /* __CONFIG_H */