2 * Copyright (C) 2014 Eukréa Electromatique
3 * Author: Eric Bénard <eric@eukrea.com>
5 * Configuration settings for the Embest RIoTboard
7 * based on mx6*sabre*.h which are :
8 * Copyright (C) 2012 Freescale Semiconductor, Inc.
10 * SPDX-License-Identifier: GPL-2.0+
13 #ifndef __RIOTBOARD_CONFIG_H
14 #define __RIOTBOARD_CONFIG_H
16 #include <asm/arch/imx-regs.h>
17 #include <asm/imx-common/gpio.h>
19 #include "mx6_common.h"
20 #include <linux/sizes.h>
22 #define CONFIG_MXC_UART_BASE UART2_BASE
23 #define CONFIG_CONSOLE_DEV "ttymxc0"
24 #define CONFIG_MMCROOT "/dev/mmcblk1p2"
26 #define PHYS_SDRAM_SIZE (1u * 1024 * 1024 * 1024)
30 #define CONFIG_DISPLAY_CPUINFO
31 #define CONFIG_DISPLAY_BOARDINFO
33 #define CONFIG_CMDLINE_TAG
34 #define CONFIG_SETUP_MEMORY_TAGS
35 #define CONFIG_INITRD_TAG
36 #define CONFIG_REVISION_TAG
38 /* Size of malloc() pool */
39 #define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M)
41 #define CONFIG_BOARD_EARLY_INIT_F
42 #define CONFIG_BOARD_LATE_INIT
43 #define CONFIG_MXC_GPIO
45 #define CONFIG_MXC_UART
47 #define CONFIG_CMD_FUSE
48 #ifdef CONFIG_CMD_FUSE
49 #define CONFIG_MXC_OCOTP
53 #define CONFIG_CMD_I2C
54 #define CONFIG_SYS_I2C
55 #define CONFIG_SYS_I2C_MXC
56 #define CONFIG_SYS_I2C_SPEED 100000
59 #define CONFIG_CMD_USB
60 #define CONFIG_USB_EHCI
61 #define CONFIG_USB_EHCI_MX6
62 #define CONFIG_USB_STORAGE
63 #define CONFIG_USB_HOST_ETHER
64 #define CONFIG_USB_ETHER_ASIX
65 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
66 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
67 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
68 #define CONFIG_MXC_USB_FLAGS 0
71 #define CONFIG_FSL_ESDHC
72 #define CONFIG_FSL_USDHC
73 #define CONFIG_SYS_FSL_ESDHC_ADDR 0
76 #define CONFIG_CMD_MMC
77 #define CONFIG_GENERIC_MMC
78 #define CONFIG_BOUNCE_BUFFER
79 #define CONFIG_CMD_EXT2
80 #define CONFIG_CMD_FAT
81 #define CONFIG_DOS_PARTITION
83 #define CONFIG_CMD_PING
84 #define CONFIG_CMD_DHCP
85 #define CONFIG_CMD_MII
86 #define CONFIG_CMD_NET
87 #define CONFIG_FEC_MXC
89 #define IMX_FEC_BASE ENET_BASE_ADDR
90 #define CONFIG_FEC_XCV_TYPE RGMII
91 #define CONFIG_ETHPRIME "FEC"
92 #define CONFIG_FEC_MXC_PHYADDR 4
95 #define CONFIG_PHY_ATHEROS
99 #define CONFIG_SPI_FLASH
100 #define CONFIG_SPI_FLASH_SST
101 #define CONFIG_MXC_SPI
102 #define CONFIG_SF_DEFAULT_BUS 0
103 #define CONFIG_SF_DEFAULT_CS (0 | (IMX_GPIO_NR(2, 30) << 8))
104 #define CONFIG_SF_DEFAULT_SPEED 20000000
105 #define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
108 /* allow to overwrite serial and ethaddr */
109 #define CONFIG_ENV_OVERWRITE
110 #define CONFIG_CONS_INDEX 1
111 #define CONFIG_BAUDRATE 115200
113 /* Command definition */
114 #include <config_cmd_default.h>
116 #define CONFIG_CMD_BMODE
117 #define CONFIG_CMD_BOOTZ
118 #define CONFIG_CMD_SETEXPR
119 #undef CONFIG_CMD_IMLS
121 #define CONFIG_BOOTDELAY 1
123 #define CONFIG_LOADADDR 0x12000000
124 #define CONFIG_SYS_TEXT_BASE 0x17800000
126 #ifdef CONFIG_SUPPORT_EMMC_BOOT
129 "update_emmc_firmware=" \
130 "if test ${ip_dyn} = yes; then " \
131 "setenv get_cmd dhcp; " \
133 "setenv get_cmd tftp; " \
135 "if ${get_cmd} ${update_sd_firmware_filename}; then " \
136 "if mmc dev ${emmcdev}; then " \
137 "setexpr fw_sz ${filesize} / 0x200; " \
138 "setexpr fw_sz ${fw_sz} + 1; " \
139 "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
148 "update_spi_firmware=" \
149 "if test ${ip_dyn} = yes; then " \
150 "setenv get_cmd dhcp; " \
152 "setenv get_cmd tftp; " \
154 "if ${get_cmd} ${update_spi_firmware_filename}; then " \
155 "if sf probe; then " \
156 "sf erase 0 0xc0000; " \
157 "sf write ${loadaddr} 0x400 ${filesize}; " \
164 #define CONFIG_EXTRA_ENV_SETTINGS \
165 "script=boot.scr\0" \
167 "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
168 "fdt_addr=0x18000000\0" \
171 "console=" CONFIG_CONSOLE_DEV "\0" \
172 "fdt_high=0xffffffff\0" \
173 "initrd_high=0xffffffff\0" \
174 "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
176 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
177 "update_sd_firmware=" \
178 "if test ${ip_dyn} = yes; then " \
179 "setenv get_cmd dhcp; " \
181 "setenv get_cmd tftp; " \
183 "if mmc dev ${mmcdev}; then " \
184 "if ${get_cmd} ${update_sd_firmware_filename}; then " \
185 "setexpr fw_sz ${filesize} / 0x200; " \
186 "setexpr fw_sz ${fw_sz} + 1; " \
187 "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
192 "mmcargs=setenv bootargs console=${console},${baudrate} " \
193 "root=${mmcroot}\0" \
195 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
196 "bootscript=echo Running bootscript from mmc ...; " \
198 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
199 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
200 "mmcboot=echo Booting from mmc ...; " \
202 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
203 "if run loadfdt; then " \
204 "bootz ${loadaddr} - ${fdt_addr}; " \
206 "if test ${boot_fdt} = try; then " \
209 "echo WARN: Cannot load the DT; " \
215 "netargs=setenv bootargs console=${console},${baudrate} " \
217 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
218 "netboot=echo Booting from net ...; " \
220 "if test ${ip_dyn} = yes; then " \
221 "setenv get_cmd dhcp; " \
223 "setenv get_cmd tftp; " \
225 "${get_cmd} ${image}; " \
226 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
227 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
228 "bootz ${loadaddr} - ${fdt_addr}; " \
230 "if test ${boot_fdt} = try; then " \
233 "echo WARN: Cannot load the DT; " \
240 #define CONFIG_BOOTCOMMAND \
241 "mmc dev ${mmcdev};" \
242 "if mmc rescan; then " \
243 "if run loadbootscript; then " \
246 "if run loadimage; then " \
248 "else run netboot; " \
251 "else run netboot; fi"
253 #define CONFIG_ARP_TIMEOUT 200UL
255 /* Miscellaneous configurable options */
256 #define CONFIG_SYS_LONGHELP
257 #define CONFIG_SYS_HUSH_PARSER
258 #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
259 #define CONFIG_AUTO_COMPLETE
260 #define CONFIG_SYS_CBSIZE 256
262 /* Print Buffer Size */
263 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
264 #define CONFIG_SYS_MAXARGS 16
265 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
267 #define CONFIG_SYS_MEMTEST_START 0x10000000
268 #define CONFIG_SYS_MEMTEST_END 0x10010000
269 #define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000
271 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
273 #define CONFIG_CMDLINE_EDITING
274 #define CONFIG_STACKSIZE (128 * 1024)
276 /* Physical Memory Map */
277 #define CONFIG_NR_DRAM_BANKS 1
278 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
280 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
281 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
282 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
284 #define CONFIG_SYS_INIT_SP_OFFSET \
285 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
286 #define CONFIG_SYS_INIT_SP_ADDR \
287 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
289 /* FLASH and environment organization */
290 #define CONFIG_SYS_NO_FLASH
292 #define CONFIG_ENV_SIZE (8 * 1024)
294 #if defined(CONFIG_ENV_IS_IN_MMC)
296 #define CONFIG_DEFAULT_FDT_FILE "imx6s-riotboard.dtb"
297 #define CONFIG_SYS_FSL_USDHC_NUM 3
298 #define CONFIG_SYS_MMC_ENV_DEV 2 /* SDHC4 */
299 #define CONFIG_ENV_OFFSET (6 * 64 * 1024)
300 #define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */
301 #elif defined(CONFIG_ENV_IS_IN_SPI_FLASH)
303 #define CONFIG_DEFAULT_FDT_FILE "imx6q-marsboard.dtb"
304 #define CONFIG_SYS_FSL_USDHC_NUM 2
305 #define CONFIG_ENV_OFFSET (768 * 1024)
306 #define CONFIG_ENV_SECT_SIZE (8 * 1024)
307 #define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS
308 #define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS
309 #define CONFIG_ENV_SPI_MODE CONFIG_SF_DEFAULT_MODE
310 #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
313 #define CONFIG_OF_LIBFDT
315 #ifndef CONFIG_SYS_DCACHE_OFF
316 #define CONFIG_CMD_CACHE
321 #define CONFIG_VIDEO_IPUV3
322 #define CONFIG_CFB_CONSOLE
323 #define CONFIG_VGA_AS_SINGLE_DEVICE
324 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
325 #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
326 #define CONFIG_VIDEO_BMP_RLE8
327 #define CONFIG_SPLASH_SCREEN
328 #define CONFIG_SPLASH_SCREEN_ALIGN
329 #define CONFIG_BMP_16BPP
330 #define CONFIG_VIDEO_LOGO
331 #define CONFIG_VIDEO_BMP_LOGO
332 #define CONFIG_IPUV3_CLK 260000000
333 #define CONFIG_IMX_HDMI
334 #define CONFIG_IMX_VIDEO_SKIP
336 #endif /* __RIOTBOARD_CONFIG_H */