arm, powerpc: select SYS_GENERIC_BOARD
[platform/kernel/u-boot.git] / include / configs / vf610twr.h
1 /*
2  * Copyright 2013 Freescale Semiconductor, Inc.
3  *
4  * Configuration settings for the Freescale Vybrid vf610twr board.
5  *
6  * SPDX-License-Identifier:     GPL-2.0+
7  */
8
9 #ifndef __CONFIG_H
10 #define __CONFIG_H
11
12 #include <asm/arch/imx-regs.h>
13
14 #define CONFIG_VF610
15
16 #define CONFIG_DISPLAY_CPUINFO
17 #define CONFIG_DISPLAY_BOARDINFO
18
19 #define CONFIG_MACH_TYPE                4146
20
21 #define CONFIG_SKIP_LOWLEVEL_INIT
22
23 /* Enable passing of ATAGs */
24 #define CONFIG_CMDLINE_TAG
25
26 #define CONFIG_CMD_FUSE
27 #ifdef CONFIG_CMD_FUSE
28 #define CONFIG_MXC_OCOTP
29 #endif
30
31 /* Size of malloc() pool */
32 #define CONFIG_SYS_MALLOC_LEN           (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
33
34 #define CONFIG_BOARD_EARLY_INIT_F
35
36 #define CONFIG_FSL_LPUART
37 #define LPUART_BASE                     UART1_BASE
38
39 /* Allow to overwrite serial and ethaddr */
40 #define CONFIG_ENV_OVERWRITE
41 #define CONFIG_SYS_UART_PORT            (1)
42 #define CONFIG_BAUDRATE                 115200
43
44 /* NAND support */
45 #define CONFIG_CMD_NAND
46 #define CONFIG_CMD_NAND_TRIMFFS
47 #define CONFIG_SYS_NAND_ONFI_DETECTION
48
49 #ifdef CONFIG_CMD_NAND
50 #define CONFIG_USE_ARCH_MEMCPY
51 #define CONFIG_SYS_MAX_NAND_DEVICE      1
52 #define CONFIG_SYS_NAND_BASE            NFC_BASE_ADDR
53
54 /* UBI */
55 #define CONFIG_CMD_UBI
56 #define CONFIG_CMD_UBIFS
57 #define CONFIG_RBTREE
58 #define CONFIG_LZO
59
60 /* Dynamic MTD partition support */
61 #define CONFIG_CMD_MTDPARTS
62 #define CONFIG_MTD_PARTITIONS
63 #define CONFIG_MTD_DEVICE
64 #define MTDIDS_DEFAULT                  "nand0=fsl_nfc"
65 #define MTDPARTS_DEFAULT                "mtdparts=fsl_nfc:"             \
66                                         "128k(vf-bcb)ro,"               \
67                                         "1408k(u-boot)ro,"              \
68                                         "512k(u-boot-env),"             \
69                                         "4m(kernel),"                   \
70                                         "512k(fdt),"            \
71                                         "-(rootfs)"
72 #endif
73
74 #define CONFIG_MMC
75 #define CONFIG_FSL_ESDHC
76 #define CONFIG_SYS_FSL_ESDHC_ADDR       0
77 #define CONFIG_SYS_FSL_ESDHC_NUM        1
78
79 #define CONFIG_SYS_FSL_ERRATUM_ESDHC111
80
81 #define CONFIG_CMD_MMC
82 #define CONFIG_GENERIC_MMC
83 #define CONFIG_CMD_FAT
84 #define CONFIG_DOS_PARTITION
85
86 #define CONFIG_CMD_PING
87 #define CONFIG_CMD_DHCP
88 #define CONFIG_CMD_MII
89 #define CONFIG_FEC_MXC
90 #define CONFIG_MII
91 #define IMX_FEC_BASE                    ENET_BASE_ADDR
92 #define CONFIG_FEC_XCV_TYPE             RMII
93 #define CONFIG_FEC_MXC_PHYADDR          0
94 #define CONFIG_PHYLIB
95 #define CONFIG_PHY_MICREL
96
97 /* QSPI Configs*/
98 #define CONFIG_FSL_QSPI
99
100 #ifdef CONFIG_FSL_QSPI
101 #define CONFIG_CMD_SF
102 #define CONFIG_SPI_FLASH_SPANSION
103 #define FSL_QSPI_FLASH_SIZE             (1 << 24)
104 #define FSL_QSPI_FLASH_NUM              2
105 #define CONFIG_SYS_FSL_QSPI_LE
106 #endif
107
108 /* I2C Configs */
109 #define CONFIG_CMD_I2C
110 #define CONFIG_SYS_I2C
111 #define CONFIG_SYS_I2C_MXC
112 #define CONFIG_SYS_I2C_MXC_I2C1         /* enable I2C bus 1 */
113 #define CONFIG_SYS_I2C_MXC_I2C2         /* enable I2C bus 2 */
114 #define CONFIG_SYS_SPD_BUS_NUM          0
115
116 #define CONFIG_BOOTDELAY                3
117
118 #define CONFIG_SYS_LOAD_ADDR            0x82000000
119
120 /* We boot from the gfxRAM area of the OCRAM. */
121 #define CONFIG_SYS_TEXT_BASE            0x3f408000
122 #define CONFIG_BOARD_SIZE_LIMIT         524288
123
124 /*
125  * We do have 128MB of memory on the Vybrid Tower board. Leave the last
126  * 16MB alone to avoid conflicts with Cortex-M4 firmwares running from
127  * DDR3. Hence, limit the memory range for image processing to 112MB
128  * using bootm_size. All of the following must be within this range.
129  * We have the default load at 32MB into DDR (for the kernel), FDT at
130  * 64MB and the ramdisk 512KB above that (allowing for hopefully never
131  * seen large trees). This allows a reasonable split between ramdisk
132  * and kernel size, where the ram disk can be a bit larger.
133  */
134 #define MEM_LAYOUT_ENV_SETTINGS \
135         "bootm_size=0x07000000\0" \
136         "loadaddr=0x82000000\0" \
137         "kernel_addr_r=0x82000000\0" \
138         "fdt_addr=0x84000000\0" \
139         "fdt_addr_r=0x84000000\0" \
140         "rdaddr=0x84080000\0" \
141         "ramdisk_addr_r=0x84080000\0"
142
143 #define CONFIG_EXTRA_ENV_SETTINGS \
144         MEM_LAYOUT_ENV_SETTINGS \
145         "script=boot.scr\0" \
146         "image=zImage\0" \
147         "console=ttyLP1\0" \
148         "fdt_file=vf610-twr.dtb\0" \
149         "boot_fdt=try\0" \
150         "ip_dyn=yes\0" \
151         "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
152         "mmcpart=1\0" \
153         "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
154         "update_sd_firmware_filename=u-boot.imx\0" \
155         "update_sd_firmware=" \
156                 "if test ${ip_dyn} = yes; then " \
157                         "setenv get_cmd dhcp; " \
158                 "else " \
159                         "setenv get_cmd tftp; " \
160                 "fi; " \
161                 "if mmc dev ${mmcdev}; then "   \
162                         "if ${get_cmd} ${update_sd_firmware_filename}; then " \
163                                 "setexpr fw_sz ${filesize} / 0x200; " \
164                                 "setexpr fw_sz ${fw_sz} + 1; "  \
165                                 "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
166                         "fi; "  \
167                 "fi\0" \
168         "mmcargs=setenv bootargs console=${console},${baudrate} " \
169                 "root=${mmcroot}\0" \
170         "loadbootscript=" \
171                 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
172         "bootscript=echo Running bootscript from mmc ...; " \
173                 "source\0" \
174         "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
175         "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
176         "mmcboot=echo Booting from mmc ...; " \
177                 "run mmcargs; " \
178                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
179                         "if run loadfdt; then " \
180                                 "bootz ${loadaddr} - ${fdt_addr}; " \
181                         "else " \
182                                 "if test ${boot_fdt} = try; then " \
183                                         "bootz; " \
184                                 "else " \
185                                         "echo WARN: Cannot load the DT; " \
186                                 "fi; " \
187                         "fi; " \
188                 "else " \
189                         "bootz; " \
190                 "fi;\0" \
191         "netargs=setenv bootargs console=${console},${baudrate} " \
192                 "root=/dev/nfs " \
193         "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
194                 "netboot=echo Booting from net ...; " \
195                 "run netargs; " \
196                 "if test ${ip_dyn} = yes; then " \
197                         "setenv get_cmd dhcp; " \
198                 "else " \
199                         "setenv get_cmd tftp; " \
200                 "fi; " \
201                 "${get_cmd} ${image}; " \
202                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
203                         "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
204                                 "bootz ${loadaddr} - ${fdt_addr}; " \
205                         "else " \
206                                 "if test ${boot_fdt} = try; then " \
207                                         "bootz; " \
208                                 "else " \
209                                         "echo WARN: Cannot load the DT; " \
210                                 "fi; " \
211                         "fi; " \
212                 "else " \
213                         "bootz; " \
214                 "fi;\0"
215
216 #define CONFIG_BOOTCOMMAND \
217            "mmc dev ${mmcdev}; if mmc rescan; then " \
218                    "if run loadbootscript; then " \
219                            "run bootscript; " \
220                    "else " \
221                            "if run loadimage; then " \
222                                    "run mmcboot; " \
223                            "else run netboot; " \
224                            "fi; " \
225                    "fi; " \
226            "else run netboot; fi"
227
228 /* Miscellaneous configurable options */
229 #define CONFIG_SYS_LONGHELP             /* undef to save memory */
230 #define CONFIG_SYS_HUSH_PARSER          /* use "hush" command parser */
231 #define CONFIG_SYS_PROMPT_HUSH_PS2      "> "
232 #undef CONFIG_AUTO_COMPLETE
233 #define CONFIG_SYS_CBSIZE               256     /* Console I/O Buffer Size */
234 #define CONFIG_SYS_PBSIZE               \
235                         (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
236 #define CONFIG_SYS_MAXARGS              16      /* max number of command args */
237 #define CONFIG_SYS_BARGSIZE             CONFIG_SYS_CBSIZE
238
239 #define CONFIG_CMD_MEMTEST
240 #define CONFIG_SYS_MEMTEST_START        0x80010000
241 #define CONFIG_SYS_MEMTEST_END          0x87C00000
242
243 /*
244  * Stack sizes
245  * The stack sizes are set up in start.S using the settings below
246  */
247 #define CONFIG_STACKSIZE                (128 * 1024)    /* regular stack */
248
249 /* Physical memory map */
250 #define CONFIG_NR_DRAM_BANKS            1
251 #define PHYS_SDRAM                      (0x80000000)
252 #define PHYS_SDRAM_SIZE                 (128 * 1024 * 1024)
253
254 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM
255 #define CONFIG_SYS_INIT_RAM_ADDR        IRAM_BASE_ADDR
256 #define CONFIG_SYS_INIT_RAM_SIZE        IRAM_SIZE
257
258 #define CONFIG_SYS_INIT_SP_OFFSET \
259         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
260 #define CONFIG_SYS_INIT_SP_ADDR \
261         (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
262
263 /* FLASH and environment organization */
264 #define CONFIG_SYS_NO_FLASH
265
266 #ifdef CONFIG_ENV_IS_IN_MMC
267 #define CONFIG_ENV_SIZE                 (8 * 1024)
268
269 #define CONFIG_ENV_OFFSET               (12 * 64 * 1024)
270 #define CONFIG_SYS_MMC_ENV_DEV          0
271 #endif
272
273 #ifdef CONFIG_ENV_IS_IN_NAND
274 #define CONFIG_ENV_SIZE                 (64 * 2048)
275 #define CONFIG_ENV_SECT_SIZE            (64 * 2048)
276 #define CONFIG_ENV_RANGE                (512 * 1024)
277 #define CONFIG_ENV_OFFSET               0x180000
278 #endif
279
280 #define CONFIG_OF_LIBFDT
281 #define CONFIG_CMD_BOOTZ
282
283 #endif