blob: d65143240b6459244b1d81ace0956aa1c90537c1 [file] [log] [blame]
Stefan Roese5d6050f2014-12-10 10:15:23 +01001/*
2 * Copyright (C) 2014, Barco (www.barco.com)
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#ifndef __PLATINUM_CONFIG_H__
8#define __PLATINUM_CONFIG_H__
9
Stefan Roese5d6050f2014-12-10 10:15:23 +010010/* SPL */
11#define CONFIG_SPL_NAND_SUPPORT
12#define CONFIG_SPL_MMC_SUPPORT
13
14/* Location in NAND to read U-Boot from */
15#define CONFIG_SYS_NAND_U_BOOT_OFFS (14 * 1024 * 1024)
16
17#include "imx6_spl.h" /* common IMX6 SPL configuration */
18#include "mx6_common.h"
Stefan Roese5d6050f2014-12-10 10:15:23 +010019
20/*
21 * Console configuration
22 */
23
Stefan Roese5d6050f2014-12-10 10:15:23 +010024#define CONFIG_CMD_BMODE
25#define CONFIG_CMD_DHCP
Stefan Roese5d6050f2014-12-10 10:15:23 +010026#define CONFIG_CMD_I2C
Stefan Roese5d6050f2014-12-10 10:15:23 +010027#define CONFIG_CMD_MII
Stefan Roese5d6050f2014-12-10 10:15:23 +010028#define CONFIG_CMD_MTDPARTS
29#define CONFIG_CMD_NAND
30#define CONFIG_CMD_NAND_TRIMFFS
Stefan Roese5d6050f2014-12-10 10:15:23 +010031#define CONFIG_CMD_PING
32#define CONFIG_CMD_TIME
33#define CONFIG_CMD_UBI
34#define CONFIG_CMD_UBIFS
35#define CONFIG_CMD_USB
36
37/*
38 * Hardware configuration
39 */
40
Stefan Roese5d6050f2014-12-10 10:15:23 +010041/* UART config */
42#define CONFIG_MXC_UART
43#define CONFIG_MXC_UART_BASE UART1_BASE
Stefan Roese5d6050f2014-12-10 10:15:23 +010044
45/* I2C config */
46#define CONFIG_SYS_I2C
47#define CONFIG_SYS_I2C_MXC
York Sunf8cb1012015-03-20 10:20:40 -070048#define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */
Stefan Roese5d6050f2014-12-10 10:15:23 +010049#define CONFIG_SYS_I2C_SPEED 100000
50
51/* MMC config */
Stefan Roese5d6050f2014-12-10 10:15:23 +010052#define CONFIG_SYS_FSL_ESDHC_ADDR 0
53#define CONFIG_SYS_FSL_USDHC_NUM 1
Stefan Roese5d6050f2014-12-10 10:15:23 +010054
55/* Ethernet config */
56#define CONFIG_FEC_MXC
57#define CONFIG_MII
58#define IMX_FEC_BASE ENET_BASE_ADDR
59
60#define CONFIG_PHYLIB
61
62/* USB config */
63#define CONFIG_USB_EHCI
64#define CONFIG_USB_EHCI_MX6
65#define CONFIG_USB_STORAGE
66#define CONFIG_MXC_USB_PORT 1
67#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
68#define CONFIG_MXC_USB_FLAGS 0
69
70/* Memory config */
71#define CONFIG_NR_DRAM_BANKS 1
72#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
73#ifndef PHYS_SDRAM_SIZE
74#define PHYS_SDRAM_SIZE (1024 << 20)
75#endif
76
77#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
78#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
79#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
80
81#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
82 GENERATED_GBL_DATA_SIZE)
83#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
84 CONFIG_SYS_INIT_SP_OFFSET)
85
86#define CONFIG_SYS_MALLOC_LEN (16 * 1024 * 1024)
87
Stefan Roese5d6050f2014-12-10 10:15:23 +010088#ifdef CONFIG_CMD_NAND
89
90/* NAND config */
91#define CONFIG_NAND_MXS
92#ifndef CONFIG_SYS_NAND_MAX_CHIPS
93#define CONFIG_SYS_NAND_MAX_CHIPS 2
94#endif
95#define CONFIG_SYS_MAX_NAND_DEVICE 1
96#define CONFIG_SYS_NAND_BASE 0x40000000
97#define CONFIG_SYS_NAND_5_ADDR_CYCLE
98#define CONFIG_SYS_NAND_ONFI_DETECTION
99
100/* DMA config, needed for GPMI/MXS NAND support */
101#define CONFIG_APBH_DMA
102#define CONFIG_APBH_DMA_BURST
103#define CONFIG_APBH_DMA_BURST8
104
Stefan Roese5d6050f2014-12-10 10:15:23 +0100105/* Environment in NAND */
106#define CONFIG_ENV_IS_IN_NAND
107#define CONFIG_ENV_OFFSET (16 << 20)
108#define CONFIG_ENV_SECT_SIZE (128 << 10)
109#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
110#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + (512 << 10))
111#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
112
113#else /* CONFIG_CMD_NAND */
114
115/* Environment in MMC */
116#define CONFIG_ENV_SIZE (8 << 10)
117#define CONFIG_ENV_IS_IN_MMC
118#define CONFIG_ENV_OFFSET (6 * 64 * 1024)
119#define CONFIG_SYS_MMC_ENV_DEV 0
120
121#endif /* CONFIG_CMD_NAND */
122
123/*
124 * U-Boot configuration
125 */
126
Stefan Roese5d6050f2014-12-10 10:15:23 +0100127/* Board startup config */
128#define CONFIG_BOARD_EARLY_INIT_F
129#define CONFIG_MISC_INIT_R
130
Stefan Roese5d6050f2014-12-10 10:15:23 +0100131#define CONFIG_SYS_MEMTEST_START PHYS_SDRAM
132#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + \
133 PHYS_SDRAM_SIZE - (12 << 20))
134
Stefan Roese5d6050f2014-12-10 10:15:23 +0100135#define CONFIG_BOOTCOMMAND "run bootubi_scr"
136
137/* Miscellaneous configurable options */
Stefan Roese5d6050f2014-12-10 10:15:23 +0100138#define CONFIG_PREBOOT
139
Stefan Roese5d6050f2014-12-10 10:15:23 +0100140/* Print Buffer Size */
141#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
142 sizeof(CONFIG_SYS_PROMPT) + 16)
Stefan Roese5d6050f2014-12-10 10:15:23 +0100143
Stefan Roese5d6050f2014-12-10 10:15:23 +0100144/* MTD/UBI/UBIFS config */
145#define CONFIG_LZO
146#define CONFIG_MTD_DEVICE
147#define CONFIG_MTD_PARTITIONS
148#define CONFIG_RBTREE
149
150#if (CONFIG_SYS_NAND_MAX_CHIPS == 1)
151#define MTDIDS_DEFAULT "nand0=gpmi-nand"
152#define MTDPARTS_DEFAULT "mtdparts=gpmi-nand:14M(spl),2M(uboot)," \
153 "512k(env1),512k(env2),-(ubi)"
154#elif (CONFIG_SYS_NAND_MAX_CHIPS == 2)
155#define MTDIDS_DEFAULT "nand0=gpmi-nand"
156#define MTDPARTS_DEFAULT "mtdparts=gpmi-nand:14M(spl),2M(uboot)," \
157 "512k(env1),512k(env2),495M(ubi0)," \
158 "14M(res0),2M(res1)," \
159 "512k(res2),512k(res3),-(ubi1)"
160#endif
161
Stefan Roese5d6050f2014-12-10 10:15:23 +0100162/*
163 * Environment configuration
164 */
165
166#if (CONFIG_SYS_NAND_MAX_CHIPS == 1)
167#define CONFIG_COMMON_ENV_UBI \
168 "setubipartition=env set ubipartition ubi\0" \
169 "setubirfs=env set ubirfs $ubipartition:rootfs$boot_vol\0"
170#elif (CONFIG_SYS_NAND_MAX_CHIPS == 2)
171#define CONFIG_COMMON_ENV_UBI \
172 "setubipartition=env set ubipartition ubi$boot_vol\0" \
173 "setubirfs=env set ubirfs ubi0:rootfs\0"
174#endif
175
176#define CONFIG_COMMON_ENV_MISC \
177 "user=user\0" \
178 "project="CONFIG_PLATINUM_PROJECT"\0" \
179 "uimage=uImage\0" \
180 "dtb="CONFIG_PLATINUM_CPU"-platinum-"CONFIG_PLATINUM_PROJECT".dtb\0" \
181 "serverip=serverip\0" \
182 "memaddrlinux=0x10800000\0" \
183 "memaddrsrc=0x11000000\0" \
184 "memaddrdtb=0x12000000\0" \
185 "console=ttymxc0\0" \
186 "baudrate=115200\0" \
187 "boot_scr=boot.uboot\0" \
188 "boot_vol=0\0" \
189 "mtdids="MTDIDS_DEFAULT"\0" \
190 "mtdparts="MTDPARTS_DEFAULT"\0" \
191 "mmcfs=ext2\0" \
192 "mmcrootpart=1\0" \
193 \
194 "setnfspath=env set nfspath /home/nfs/$user/$project/root\0" \
195 "settftpfilelinux=env set tftpfilelinux $user/$project/$uimage\0" \
196 "settftpfiledtb=env set tftpfiledtb $user/$project/$dtb\0" \
197 "setubifilelinux=env set ubifilelinux boot/$uimage\0" \
198 "setubipfiledtb=env set ubifiledtb boot/$dtb\0" \
199 "setmmcrootdev=env set mmcrootdev /dev/mmcblk0p$mmcrootpart\0" \
200 "setmmcfilelinux=env set mmcfilelinux /boot/$uimage\0" \
201 "setmmcfiledtb=env set mmcfiledtb /boot/$dtb\0" \
202 \
203 "loadtftpkernel=dhcp $memaddrlinux $tftpfilelinux\0" \
204 "loadtftpdtb=dhcp $memaddrdtb $tftpfiledtb\0" \
205 "loadubikernel=ubifsload $memaddrlinux $ubifilelinux\0" \
206 "loadubidtb=ubifsload $memaddrdtb $ubifiledtb\0" \
207 "loadmmckernel=${mmcfs}load mmc 0:$mmcrootpart $memaddrlinux " \
208 "$mmcfilelinux\0" \
209 "loadmmcdtb=${mmcfs}load mmc 0:$mmcrootpart $memaddrdtb " \
210 "$mmcfiledtb\0" \
211 \
212 "ubipart=ubi part $ubipartition\0" \
213 "ubimount=ubifsmount $ubirfs\0" \
214 \
215 "setbootargscommon=env set bootargs $bootargs " \
216 "console=$console,$baudrate enable_wait_mode=off\0" \
217 "setbootargsmtd=env set bootargs $bootargs $mtdparts\0" \
218 "setbootargsdhcp=env set bootargs $bootargs ip=dhcp\0" \
219 "setbootargsubirfs=env set bootargs $bootargs " \
220 "ubi.mtd=$ubipartition root=$ubirfs rootfstype=ubifs\0" \
221 "setbootargsnfsrfs=env set bootargs $bootargs root=/dev/nfs " \
222 "nfsroot=$serverip:$nfspath,v3,tcp\0" \
223 "setbootargsmmcrfs=env set bootargs $bootargs " \
224 "root=$mmcrootdev rootwait rw\0" \
225 \
226 "bootnet=run settftpfilelinux settftpfiledtb setnfspath " \
227 "setbootargscommon setbootargsmtd setbootargsdhcp " \
228 "setbootargsnfsrfs;" \
229 "run loadtftpkernel loadtftpdtb;" \
230 "bootm $memaddrlinux - $memaddrdtb\0" \
231 "bootnet_ubirfs=run settftpfilelinux settftpfiledtb;" \
232 "run setubipartition setubirfs;" \
233 "run setbootargscommon setbootargsmtd " \
234 "setbootargsubirfs;" \
235 "run loadtftpkernel loadtftpdtb;" \
236 "bootm $memaddrlinux - $memaddrdtb\0" \
237 "bootubi=run setubipartition setubirfs setubifilelinux " \
238 "setubipfiledtb;" \
239 "run setbootargscommon setbootargsmtd " \
240 "setbootargsubirfs;" \
241 "run ubipart ubimount loadubikernel loadubidtb;" \
242 "bootm $memaddrlinux - $memaddrdtb\0" \
243 "bootubi_scr=run setubipartition setubirfs;" \
244 "run ubipart ubimount;" \
245 "if ubifsload ${memaddrsrc} boot/${boot_scr}; " \
246 "then source ${memaddrsrc}; else run bootubi; fi\0" \
247 "bootmmc=run setmmcrootdev setmmcfilelinux setmmcfiledtb " \
248 "setbootargscommon setbootargsmmcrfs;" \
249 "run loadmmckernel loadmmcdtb;" \
250 "bootm $memaddrlinux - $memaddrdtb\0" \
251 \
252 "bootcmd="CONFIG_BOOTCOMMAND"\0"
253
254#define CONFIG_COMMON_ENV_SETTINGS CONFIG_COMMON_ENV_MISC \
255 CONFIG_COMMON_ENV_UBI
256#endif /* __PLATINUM_CONFIG_H__ */