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