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_SYS_GENERIC_BOARD
24 #define CONFIG_MXC_UART_BASE UART2_BASE
25 #define CONFIG_CONSOLE_DEV "ttymxc1"
26 #define CONFIG_MMCROOT "/dev/mmcblk1p2"
28 #define PHYS_SDRAM_SIZE (1u * 1024 * 1024 * 1024)
32 #define CONFIG_DISPLAY_CPUINFO
33 #define CONFIG_DISPLAY_BOARDINFO
35 #define CONFIG_CMDLINE_TAG
36 #define CONFIG_SETUP_MEMORY_TAGS
37 #define CONFIG_INITRD_TAG
38 #define CONFIG_REVISION_TAG
40 /* Size of malloc() pool */
41 #define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M)
43 #define CONFIG_BOARD_EARLY_INIT_F
44 #define CONFIG_BOARD_LATE_INIT
45 #define CONFIG_MXC_GPIO
47 #define CONFIG_MXC_UART
49 #define CONFIG_CMD_FUSE
50 #ifdef CONFIG_CMD_FUSE
51 #define CONFIG_MXC_OCOTP
55 #define CONFIG_CMD_I2C
56 #define CONFIG_SYS_I2C
57 #define CONFIG_SYS_I2C_MXC
58 #define CONFIG_SYS_I2C_SPEED 100000
61 #define CONFIG_CMD_USB
62 #define CONFIG_USB_EHCI
63 #define CONFIG_USB_EHCI_MX6
64 #define CONFIG_USB_STORAGE
65 #define CONFIG_USB_HOST_ETHER
66 #define CONFIG_USB_ETHER_ASIX
67 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
68 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
69 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
70 #define CONFIG_MXC_USB_FLAGS 0
73 #define CONFIG_FSL_ESDHC
74 #define CONFIG_FSL_USDHC
75 #define CONFIG_SYS_FSL_ESDHC_ADDR 0
78 #define CONFIG_CMD_MMC
79 #define CONFIG_GENERIC_MMC
80 #define CONFIG_BOUNCE_BUFFER
81 #define CONFIG_CMD_EXT2
82 #define CONFIG_CMD_FAT
83 #define CONFIG_DOS_PARTITION
85 #define CONFIG_CMD_PING
86 #define CONFIG_CMD_DHCP
87 #define CONFIG_CMD_MII
88 #define CONFIG_CMD_NET
89 #define CONFIG_FEC_MXC
91 #define IMX_FEC_BASE ENET_BASE_ADDR
92 #define CONFIG_FEC_XCV_TYPE RGMII
93 #define CONFIG_ETHPRIME "FEC"
94 #define CONFIG_FEC_MXC_PHYADDR 4
97 #define CONFIG_PHY_ATHEROS
101 #define CONFIG_SPI_FLASH
102 #define CONFIG_SPI_FLASH_SST
103 #define CONFIG_MXC_SPI
104 #define CONFIG_SF_DEFAULT_BUS 0
105 #define CONFIG_SF_DEFAULT_CS 0
106 #define CONFIG_SF_DEFAULT_SPEED 20000000
107 #define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
110 /* allow to overwrite serial and ethaddr */
111 #define CONFIG_ENV_OVERWRITE
112 #define CONFIG_CONS_INDEX 1
113 #define CONFIG_BAUDRATE 115200
115 /* Command definition */
116 #include <config_cmd_default.h>
118 #define CONFIG_CMD_BMODE
119 #define CONFIG_CMD_BOOTZ
120 #define CONFIG_CMD_SETEXPR
121 #undef CONFIG_CMD_IMLS
123 #define CONFIG_BOOTDELAY 1
125 #define CONFIG_LOADADDR 0x12000000
126 #define CONFIG_SYS_TEXT_BASE 0x17800000
128 #ifdef CONFIG_SUPPORT_EMMC_BOOT
131 "update_emmc_firmware=" \
132 "if test ${ip_dyn} = yes; then " \
133 "setenv get_cmd dhcp; " \
135 "setenv get_cmd tftp; " \
137 "if ${get_cmd} ${update_sd_firmware_filename}; then " \
138 "if mmc dev ${emmcdev}; then " \
139 "setexpr fw_sz ${filesize} / 0x200; " \
140 "setexpr fw_sz ${fw_sz} + 1; " \
141 "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
150 "update_spi_firmware=" \
151 "if test ${ip_dyn} = yes; then " \
152 "setenv get_cmd dhcp; " \
154 "setenv get_cmd tftp; " \
156 "if ${get_cmd} ${update_spi_firmware_filename}; then " \
157 "if sf probe; then " \
158 "sf erase 0 0xc0000; " \
159 "sf write ${loadaddr} 0x400 ${filesize}; " \
166 #define CONFIG_EXTRA_ENV_SETTINGS \
167 "script=boot.scr\0" \
169 "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
170 "fdt_addr=0x18000000\0" \
173 "console=" CONFIG_CONSOLE_DEV "\0" \
174 "fdt_high=0xffffffff\0" \
175 "initrd_high=0xffffffff\0" \
176 "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
178 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
179 "update_sd_firmware=" \
180 "if test ${ip_dyn} = yes; then " \
181 "setenv get_cmd dhcp; " \
183 "setenv get_cmd tftp; " \
185 "if mmc dev ${mmcdev}; then " \
186 "if ${get_cmd} ${update_sd_firmware_filename}; then " \
187 "setexpr fw_sz ${filesize} / 0x200; " \
188 "setexpr fw_sz ${fw_sz} + 1; " \
189 "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
194 "mmcargs=setenv bootargs console=${console},${baudrate} " \
195 "root=${mmcroot}\0" \
197 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
198 "bootscript=echo Running bootscript from mmc ...; " \
200 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
201 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
202 "mmcboot=echo Booting from mmc ...; " \
204 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
205 "if run loadfdt; then " \
206 "bootz ${loadaddr} - ${fdt_addr}; " \
208 "if test ${boot_fdt} = try; then " \
211 "echo WARN: Cannot load the DT; " \
217 "netargs=setenv bootargs console=${console},${baudrate} " \
219 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
220 "netboot=echo Booting from net ...; " \
222 "if test ${ip_dyn} = yes; then " \
223 "setenv get_cmd dhcp; " \
225 "setenv get_cmd tftp; " \
227 "${get_cmd} ${image}; " \
228 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
229 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
230 "bootz ${loadaddr} - ${fdt_addr}; " \
232 "if test ${boot_fdt} = try; then " \
235 "echo WARN: Cannot load the DT; " \
242 #define CONFIG_BOOTCOMMAND \
243 "mmc dev ${mmcdev};" \
244 "if mmc rescan; then " \
245 "if run loadbootscript; then " \
248 "if run loadimage; then " \
250 "else run netboot; " \
253 "else run netboot; fi"
255 #define CONFIG_ARP_TIMEOUT 200UL
257 /* Miscellaneous configurable options */
258 #define CONFIG_SYS_LONGHELP
259 #define CONFIG_SYS_HUSH_PARSER
260 #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
261 #define CONFIG_AUTO_COMPLETE
262 #define CONFIG_SYS_CBSIZE 256
264 /* Print Buffer Size */
265 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
266 #define CONFIG_SYS_MAXARGS 16
267 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
269 #define CONFIG_SYS_MEMTEST_START 0x10000000
270 #define CONFIG_SYS_MEMTEST_END 0x10010000
271 #define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000
273 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
275 #define CONFIG_CMDLINE_EDITING
276 #define CONFIG_STACKSIZE (128 * 1024)
278 /* Physical Memory Map */
279 #define CONFIG_NR_DRAM_BANKS 1
280 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
282 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
283 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
284 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
286 #define CONFIG_SYS_INIT_SP_OFFSET \
287 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
288 #define CONFIG_SYS_INIT_SP_ADDR \
289 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
291 /* FLASH and environment organization */
292 #define CONFIG_SYS_NO_FLASH
294 #define CONFIG_ENV_SIZE (8 * 1024)
296 #if defined(CONFIG_ENV_IS_IN_MMC)
298 #define CONFIG_DEFAULT_FDT_FILE "imx6dl-riotboard.dtb"
299 #define CONFIG_SYS_FSL_USDHC_NUM 3
300 #define CONFIG_SYS_MMC_ENV_DEV 2 /* SDHC4 */
301 #define CONFIG_ENV_OFFSET (6 * 64 * 1024)
302 #define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */
303 #elif defined(CONFIG_ENV_IS_IN_SPI_FLASH)
305 #define CONFIG_DEFAULT_FDT_FILE "imx6q-marsboard.dtb"
306 #define CONFIG_SYS_FSL_USDHC_NUM 2
307 #define CONFIG_ENV_OFFSET (768 * 1024)
308 #define CONFIG_ENV_SECT_SIZE (8 * 1024)
309 #define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS
310 #define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS
311 #define CONFIG_ENV_SPI_MODE CONFIG_SF_DEFAULT_MODE
312 #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
315 #define CONFIG_OF_LIBFDT
317 #ifndef CONFIG_SYS_DCACHE_OFF
318 #define CONFIG_CMD_CACHE
323 #define CONFIG_VIDEO_IPUV3
324 #define CONFIG_CFB_CONSOLE
325 #define CONFIG_VGA_AS_SINGLE_DEVICE
326 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
327 #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
328 #define CONFIG_VIDEO_BMP_RLE8
329 #define CONFIG_SPLASH_SCREEN
330 #define CONFIG_SPLASH_SCREEN_ALIGN
331 #define CONFIG_BMP_16BPP
332 #define CONFIG_VIDEO_LOGO
333 #define CONFIG_VIDEO_BMP_LOGO
334 #define CONFIG_IPUV3_CLK 260000000
335 #define CONFIG_IMX_HDMI
336 #define CONFIG_IMX_VIDEO_SKIP
338 #endif /* __RIOTBOARD_CONFIG_H */