blob: 210927f4de005d2876680f403efbd64f4f2dae2a [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Stefan Roese7f2b1ec2014-12-10 10:15:23 +01002/*
3 * Copyright (C) 2014, Barco (www.barco.com)
Stefan Roese7f2b1ec2014-12-10 10:15:23 +01004 */
5
6#ifndef __PLATINUM_CONFIG_H__
7#define __PLATINUM_CONFIG_H__
8
Stefan Roese7f2b1ec2014-12-10 10:15:23 +01009/* SPL */
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010010
11/* Location in NAND to read U-Boot from */
12#define CONFIG_SYS_NAND_U_BOOT_OFFS (14 * 1024 * 1024)
13
14#include "imx6_spl.h" /* common IMX6 SPL configuration */
15#include "mx6_common.h"
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010016
17/*
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010018 * Hardware configuration
19 */
20
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010021/* UART config */
22#define CONFIG_MXC_UART
23#define CONFIG_MXC_UART_BASE UART1_BASE
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010024
25/* I2C config */
26#define CONFIG_SYS_I2C
27#define CONFIG_SYS_I2C_MXC
Albert ARIBAUD \\(3ADEV\\)eb943872015-09-21 22:43:38 +020028#define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */
29#define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */
York Sunf1a52162015-03-20 10:20:40 -070030#define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010031#define CONFIG_SYS_I2C_SPEED 100000
32
33/* MMC config */
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010034#define CONFIG_SYS_FSL_ESDHC_ADDR 0
35#define CONFIG_SYS_FSL_USDHC_NUM 1
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010036
37/* Ethernet config */
38#define CONFIG_FEC_MXC
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010039#define IMX_FEC_BASE ENET_BASE_ADDR
40
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010041/* USB config */
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010042#define CONFIG_MXC_USB_PORT 1
43#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
44#define CONFIG_MXC_USB_FLAGS 0
45
46/* Memory config */
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010047#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
48#ifndef PHYS_SDRAM_SIZE
49#define PHYS_SDRAM_SIZE (1024 << 20)
50#endif
51
52#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
53#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
54#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
55
56#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
57 GENERATED_GBL_DATA_SIZE)
58#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
59 CONFIG_SYS_INIT_SP_OFFSET)
60
61#define CONFIG_SYS_MALLOC_LEN (16 * 1024 * 1024)
62
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010063#ifdef CONFIG_CMD_NAND
64
65/* NAND config */
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010066#ifndef CONFIG_SYS_NAND_MAX_CHIPS
67#define CONFIG_SYS_NAND_MAX_CHIPS 2
68#endif
69#define CONFIG_SYS_MAX_NAND_DEVICE 1
70#define CONFIG_SYS_NAND_BASE 0x40000000
71#define CONFIG_SYS_NAND_5_ADDR_CYCLE
72#define CONFIG_SYS_NAND_ONFI_DETECTION
73
74/* DMA config, needed for GPMI/MXS NAND support */
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010075
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010076/* Environment in NAND */
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010077
78#else /* CONFIG_CMD_NAND */
79
80/* Environment in MMC */
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010081#define CONFIG_SYS_MMC_ENV_DEV 0
82
83#endif /* CONFIG_CMD_NAND */
84
85/*
86 * U-Boot configuration
87 */
88
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010089/* Board startup config */
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010090
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010091#define CONFIG_SYS_MEMTEST_START PHYS_SDRAM
92#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + \
93 PHYS_SDRAM_SIZE - (12 << 20))
94
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010095#define CONFIG_BOOTCOMMAND "run bootubi_scr"
96
97/* Miscellaneous configurable options */
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010098
Stefan Roese7f2b1ec2014-12-10 10:15:23 +010099/* MTD/UBI/UBIFS config */
Stefan Roese7f2b1ec2014-12-10 10:15:23 +0100100
Stefan Roese7f2b1ec2014-12-10 10:15:23 +0100101/*
102 * Environment configuration
103 */
104
105#if (CONFIG_SYS_NAND_MAX_CHIPS == 1)
106#define CONFIG_COMMON_ENV_UBI \
107 "setubipartition=env set ubipartition ubi\0" \
108 "setubirfs=env set ubirfs $ubipartition:rootfs$boot_vol\0"
109#elif (CONFIG_SYS_NAND_MAX_CHIPS == 2)
110#define CONFIG_COMMON_ENV_UBI \
111 "setubipartition=env set ubipartition ubi$boot_vol\0" \
112 "setubirfs=env set ubirfs ubi0:rootfs\0"
113#endif
114
115#define CONFIG_COMMON_ENV_MISC \
116 "user=user\0" \
117 "project="CONFIG_PLATINUM_PROJECT"\0" \
118 "uimage=uImage\0" \
119 "dtb="CONFIG_PLATINUM_CPU"-platinum-"CONFIG_PLATINUM_PROJECT".dtb\0" \
120 "serverip=serverip\0" \
121 "memaddrlinux=0x10800000\0" \
122 "memaddrsrc=0x11000000\0" \
123 "memaddrdtb=0x12000000\0" \
124 "console=ttymxc0\0" \
125 "baudrate=115200\0" \
126 "boot_scr=boot.uboot\0" \
127 "boot_vol=0\0" \
Tom Rini5ad8e112017-10-22 17:55:07 -0400128 "mtdids="CONFIG_MTDIDS_DEFAULT"\0" \
129 "mtdparts="CONFIG_MTDPARTS_DEFAULT"\0" \
Stefan Roese7f2b1ec2014-12-10 10:15:23 +0100130 "mmcfs=ext2\0" \
131 "mmcrootpart=1\0" \
132 \
133 "setnfspath=env set nfspath /home/nfs/$user/$project/root\0" \
134 "settftpfilelinux=env set tftpfilelinux $user/$project/$uimage\0" \
135 "settftpfiledtb=env set tftpfiledtb $user/$project/$dtb\0" \
136 "setubifilelinux=env set ubifilelinux boot/$uimage\0" \
137 "setubipfiledtb=env set ubifiledtb boot/$dtb\0" \
138 "setmmcrootdev=env set mmcrootdev /dev/mmcblk0p$mmcrootpart\0" \
139 "setmmcfilelinux=env set mmcfilelinux /boot/$uimage\0" \
140 "setmmcfiledtb=env set mmcfiledtb /boot/$dtb\0" \
141 \
142 "loadtftpkernel=dhcp $memaddrlinux $tftpfilelinux\0" \
143 "loadtftpdtb=dhcp $memaddrdtb $tftpfiledtb\0" \
144 "loadubikernel=ubifsload $memaddrlinux $ubifilelinux\0" \
145 "loadubidtb=ubifsload $memaddrdtb $ubifiledtb\0" \
146 "loadmmckernel=${mmcfs}load mmc 0:$mmcrootpart $memaddrlinux " \
147 "$mmcfilelinux\0" \
148 "loadmmcdtb=${mmcfs}load mmc 0:$mmcrootpart $memaddrdtb " \
149 "$mmcfiledtb\0" \
150 \
151 "ubipart=ubi part $ubipartition\0" \
152 "ubimount=ubifsmount $ubirfs\0" \
153 \
154 "setbootargscommon=env set bootargs $bootargs " \
155 "console=$console,$baudrate enable_wait_mode=off\0" \
156 "setbootargsmtd=env set bootargs $bootargs $mtdparts\0" \
157 "setbootargsdhcp=env set bootargs $bootargs ip=dhcp\0" \
158 "setbootargsubirfs=env set bootargs $bootargs " \
159 "ubi.mtd=$ubipartition root=$ubirfs rootfstype=ubifs\0" \
160 "setbootargsnfsrfs=env set bootargs $bootargs root=/dev/nfs " \
161 "nfsroot=$serverip:$nfspath,v3,tcp\0" \
162 "setbootargsmmcrfs=env set bootargs $bootargs " \
163 "root=$mmcrootdev rootwait rw\0" \
164 \
165 "bootnet=run settftpfilelinux settftpfiledtb setnfspath " \
166 "setbootargscommon setbootargsmtd setbootargsdhcp " \
167 "setbootargsnfsrfs;" \
168 "run loadtftpkernel loadtftpdtb;" \
169 "bootm $memaddrlinux - $memaddrdtb\0" \
170 "bootnet_ubirfs=run settftpfilelinux settftpfiledtb;" \
171 "run setubipartition setubirfs;" \
172 "run setbootargscommon setbootargsmtd " \
173 "setbootargsubirfs;" \
174 "run loadtftpkernel loadtftpdtb;" \
175 "bootm $memaddrlinux - $memaddrdtb\0" \
176 "bootubi=run setubipartition setubirfs setubifilelinux " \
177 "setubipfiledtb;" \
178 "run setbootargscommon setbootargsmtd " \
179 "setbootargsubirfs;" \
180 "run ubipart ubimount loadubikernel loadubidtb;" \
181 "bootm $memaddrlinux - $memaddrdtb\0" \
182 "bootubi_scr=run setubipartition setubirfs;" \
183 "run ubipart ubimount;" \
184 "if ubifsload ${memaddrsrc} boot/${boot_scr}; " \
185 "then source ${memaddrsrc}; else run bootubi; fi\0" \
186 "bootmmc=run setmmcrootdev setmmcfilelinux setmmcfiledtb " \
187 "setbootargscommon setbootargsmmcrfs;" \
188 "run loadmmckernel loadmmcdtb;" \
189 "bootm $memaddrlinux - $memaddrdtb\0" \
190 \
191 "bootcmd="CONFIG_BOOTCOMMAND"\0"
192
193#define CONFIG_COMMON_ENV_SETTINGS CONFIG_COMMON_ENV_MISC \
194 CONFIG_COMMON_ENV_UBI
195#endif /* __PLATINUM_CONFIG_H__ */