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