1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 2016 Amarula Solutions B.V.
4 * Copyright (C) 2016 Engicam S.r.l.
6 * Configuration settings for the Engicam i.MX6 SOM Starter Kits.
9 #ifndef __IMX6_ENGICAM_CONFIG_H
10 #define __IMX6_ENGICAM_CONFIG_H
12 #include <linux/sizes.h>
13 #include <linux/stringify.h>
14 #include "mx6_common.h"
16 /* Size of malloc() pool */
17 #define CONFIG_SYS_MALLOC_LEN (16 * SZ_1M)
19 /* Total Size of Environment Sector */
22 #ifndef CONFIG_ENV_IS_NOWHERE
23 /* Environment in MMC */
24 # if defined(CONFIG_ENV_IS_IN_MMC)
25 /* Environment in NAND */
29 /* Default environment */
30 #define CONFIG_EXTRA_ENV_SETTINGS \
33 "splashimage=" __stringify(CONFIG_LOADADDR) "\0" \
35 "fit_image=fit.itb\0" \
36 "fdt_high=0xffffffff\0" \
37 "fdt_addr=" FDT_ADDR "\0" \
40 "nandroot=ubi0:rootfs rootfstype=ubifs\0" \
41 "mmcautodetect=yes\0" \
42 "mmcargs=setenv bootargs console=${console},${baudrate} " \
44 "ubiargs=setenv bootargs console=${console},${baudrate} " \
45 "ubi.mtd=5 root=${nandroot} ${mtdparts}\0" \
47 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
48 "bootscript=echo Running bootscript from mmc ...; " \
50 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
51 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
52 "loadfit=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${fit_image}\0" \
53 "altbootcmd=run recoveryboot\0"\
54 "fitboot=echo Booting FIT image from mmc ...; " \
56 "bootm ${loadaddr}\0" \
57 "_mmcboot=run mmcargs; " \
59 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
60 "if run loadfdt; then " \
61 "bootm ${loadaddr} - ${fdt_addr}; " \
63 "if test ${boot_fdt} = try; then " \
66 "echo WARN: Cannot load the DT; " \
72 "mmcboot=echo Booting from mmc ...; " \
73 "if mmc rescan; then " \
74 "if run loadbootscript; then " \
77 "if run loadfit; then " \
80 "if run loadimage; then " \
86 "nandboot=echo Booting from nand ...; " \
87 "if mtdparts; then " \
88 "echo Starting nand boot ...; " \
90 "mtdparts default; " \
93 "nand read ${loadaddr} kernel 0x800000; " \
94 "nand read ${fdt_addr} dtb 0x100000; " \
95 "bootm ${loadaddr} - ${fdt_addr}\0" \
96 "recoveryboot=if test ${modeboot} = mmcboot; then " \
102 #define CONFIG_BOOTCOMMAND "run $modeboot"
104 /* Miscellaneous configurable options */
106 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
107 #define CONFIG_SYS_HZ 1000
110 # define DRAM_OFFSET(x) 0x87##x
111 # define FDT_ADDR __stringify(DRAM_OFFSET(800000))
113 # define DRAM_OFFSET(x) 0x1##x
114 # define FDT_ADDR __stringify(DRAM_OFFSET(8000000))
117 /* Physical Memory Map */
118 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
120 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
121 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
122 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
124 #define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
125 GENERATED_GBL_DATA_SIZE)
126 #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
127 CONFIG_SYS_INIT_SP_OFFSET)
130 #ifdef CONFIG_MXC_UART
132 # define CONFIG_MXC_UART_BASE UART1_BASE
134 # define CONFIG_MXC_UART_BASE UART4_BASE
141 #ifdef CONFIG_NAND_MXS
142 # define CONFIG_SYS_MAX_NAND_DEVICE 1
143 # define CONFIG_SYS_NAND_BASE 0x40000000
144 # define CONFIG_SYS_NAND_5_ADDR_CYCLE
145 # define CONFIG_SYS_NAND_ONFI_DETECTION
146 # define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
147 # define CONFIG_SYS_NAND_U_BOOT_OFFS 0x200000
153 #ifdef CONFIG_SPL_OS_BOOT
154 # define CONFIG_SPL_FS_LOAD_ARGS_NAME "args"
155 # define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage"
156 # define CONFIG_SYS_SPL_ARGS_ADDR 0x18000000
158 /* MMC support: args@1MB kernel@2MB */
159 # define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x800 /* 1MB */
160 # define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512)
161 # define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x1000 /* 2MB */
165 #ifdef CONFIG_VIDEO_IPUV3
166 # define CONFIG_IMX_VIDEO_SKIP
168 # define CONFIG_VIDEO_LOGO
169 # define CONFIG_VIDEO_BMP_LOGO
174 # ifdef CONFIG_ENV_IS_IN_NAND
175 # define CONFIG_SPL_NAND_SUPPORT
177 # define CONFIG_SPL_MMC_SUPPORT
180 # include "imx6_spl.h"
183 #endif /* __IMX6_ENGICAM_CONFIG_H */