]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
f4b7532f JT |
2 | /* |
3 | * Copyright (C) 2016 Amarula Solutions B.V. | |
4 | * Copyright (C) 2016 Engicam S.r.l. | |
5 | * | |
0e689a61 | 6 | * Configuration settings for the Engicam i.MX6 SOM Starter Kits. |
f4b7532f JT |
7 | */ |
8 | ||
0e689a61 JT |
9 | #ifndef __IMX6_ENGICAM_CONFIG_H |
10 | #define __IMX6_ENGICAM_CONFIG_H | |
f4b7532f JT |
11 | |
12 | #include <linux/sizes.h> | |
1af3c7f4 | 13 | #include <linux/stringify.h> |
f4b7532f JT |
14 | #include "mx6_common.h" |
15 | ||
16 | /* Size of malloc() pool */ | |
17 | #define CONFIG_SYS_MALLOC_LEN (16 * SZ_1M) | |
18 | ||
19 | /* Total Size of Environment Sector */ | |
f4b7532f | 20 | |
f4b7532f JT |
21 | /* Environment */ |
22 | #ifndef CONFIG_ENV_IS_NOWHERE | |
23 | /* Environment in MMC */ | |
24 | # if defined(CONFIG_ENV_IS_IN_MMC) | |
023ff2f7 | 25 | /* Environment in NAND */ |
f4b7532f JT |
26 | # endif |
27 | #endif | |
28 | ||
29 | /* Default environment */ | |
30 | #define CONFIG_EXTRA_ENV_SETTINGS \ | |
31 | "script=boot.scr\0" \ | |
3713571c | 32 | "splashpos=m,m\0" \ |
e80aa8b0 | 33 | "splashimage=" __stringify(CONFIG_LOADADDR) "\0" \ |
bfd96402 | 34 | "image=uImage\0" \ |
66d1d687 | 35 | "fit_image=fit.itb\0" \ |
f4b7532f | 36 | "fdt_high=0xffffffff\0" \ |
5ed7d31a | 37 | "fdt_addr=" FDT_ADDR "\0" \ |
f4b7532f | 38 | "boot_fdt=try\0" \ |
f4b7532f | 39 | "mmcpart=1\0" \ |
ddd90660 | 40 | "nandroot=ubi0:rootfs rootfstype=ubifs\0" \ |
f4b7532f JT |
41 | "mmcautodetect=yes\0" \ |
42 | "mmcargs=setenv bootargs console=${console},${baudrate} " \ | |
43 | "root=${mmcroot}\0" \ | |
ddd90660 JT |
44 | "ubiargs=setenv bootargs console=${console},${baudrate} " \ |
45 | "ubi.mtd=5 root=${nandroot} ${mtdparts}\0" \ | |
f4b7532f JT |
46 | "loadbootscript=" \ |
47 | "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ | |
48 | "bootscript=echo Running bootscript from mmc ...; " \ | |
49 | "source\0" \ | |
50 | "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ | |
51 | "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ | |
66d1d687 | 52 | "loadfit=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${fit_image}\0" \ |
b1f8242e | 53 | "altbootcmd=run recoveryboot\0"\ |
66d1d687 JT |
54 | "fitboot=echo Booting FIT image from mmc ...; " \ |
55 | "run mmcargs; " \ | |
56 | "bootm ${loadaddr}\0" \ | |
98f56610 | 57 | "_mmcboot=run mmcargs; " \ |
f4b7532f JT |
58 | "run mmcargs; " \ |
59 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ | |
60 | "if run loadfdt; then " \ | |
bfd96402 | 61 | "bootm ${loadaddr} - ${fdt_addr}; " \ |
f4b7532f JT |
62 | "else " \ |
63 | "if test ${boot_fdt} = try; then " \ | |
bfd96402 | 64 | "bootm; " \ |
f4b7532f JT |
65 | "else " \ |
66 | "echo WARN: Cannot load the DT; " \ | |
67 | "fi; " \ | |
68 | "fi; " \ | |
69 | "else " \ | |
bfd96402 | 70 | "bootm; " \ |
ddd90660 | 71 | "fi\0" \ |
98f56610 JT |
72 | "mmcboot=echo Booting from mmc ...; " \ |
73 | "if mmc rescan; then " \ | |
74 | "if run loadbootscript; then " \ | |
75 | "run bootscript; " \ | |
76 | "else " \ | |
77 | "if run loadfit; then " \ | |
78 | "run fitboot; " \ | |
79 | "else " \ | |
80 | "if run loadimage; then " \ | |
81 | "run _mmcboot; " \ | |
82 | "fi; " \ | |
83 | "fi; " \ | |
84 | "fi; " \ | |
85 | "fi\0" \ | |
ddd90660 JT |
86 | "nandboot=echo Booting from nand ...; " \ |
87 | "if mtdparts; then " \ | |
88 | "echo Starting nand boot ...; " \ | |
89 | "else " \ | |
90 | "mtdparts default; " \ | |
91 | "fi; " \ | |
92 | "run ubiargs; " \ | |
93 | "nand read ${loadaddr} kernel 0x800000; " \ | |
94 | "nand read ${fdt_addr} dtb 0x100000; " \ | |
b1f8242e JT |
95 | "bootm ${loadaddr} - ${fdt_addr}\0" \ |
96 | "recoveryboot=if test ${modeboot} = mmcboot; then " \ | |
97 | "run mmcboot; " \ | |
98 | "else " \ | |
99 | "run nandboot; " \ | |
100 | "fi\0" | |
f4b7532f | 101 | |
98f56610 | 102 | #define CONFIG_BOOTCOMMAND "run $modeboot" |
f4b7532f JT |
103 | |
104 | /* Miscellaneous configurable options */ | |
f4b7532f JT |
105 | |
106 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR | |
107 | #define CONFIG_SYS_HZ 1000 | |
108 | ||
0e689a61 JT |
109 | #ifdef CONFIG_MX6UL |
110 | # define DRAM_OFFSET(x) 0x87##x | |
111 | # define FDT_ADDR __stringify(DRAM_OFFSET(800000)) | |
112 | #else | |
113 | # define DRAM_OFFSET(x) 0x1##x | |
114 | # define FDT_ADDR __stringify(DRAM_OFFSET(8000000)) | |
115 | #endif | |
5ed7d31a | 116 | |
f4b7532f | 117 | /* Physical Memory Map */ |
f4b7532f JT |
118 | #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR |
119 | ||
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 | |
123 | ||
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) | |
128 | ||
129 | /* UART */ | |
130 | #ifdef CONFIG_MXC_UART | |
0e689a61 JT |
131 | # ifdef CONFIG_MX6UL |
132 | # define CONFIG_MXC_UART_BASE UART1_BASE | |
133 | # else | |
134 | # define CONFIG_MXC_UART_BASE UART4_BASE | |
135 | # endif | |
f4b7532f JT |
136 | #endif |
137 | ||
138 | /* MMC */ | |
f4b7532f | 139 | |
023ff2f7 JT |
140 | /* NAND */ |
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 | |
148 | ||
310db71d | 149 | /* MTD device */ |
023ff2f7 JT |
150 | #endif |
151 | ||
63af4b0a JT |
152 | /* Falcon Mode */ |
153 | #ifdef CONFIG_SPL_OS_BOOT | |
154 | # define CONFIG_SPL_FS_LOAD_ARGS_NAME "args" | |
155 | # define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage" | |
63af4b0a | 156 | # define CONFIG_SYS_SPL_ARGS_ADDR 0x18000000 |
63af4b0a JT |
157 | |
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 */ | |
162 | #endif | |
163 | ||
ca7463c9 JT |
164 | /* Framebuffer */ |
165 | #ifdef CONFIG_VIDEO_IPUV3 | |
ca7463c9 JT |
166 | # define CONFIG_IMX_VIDEO_SKIP |
167 | ||
ca7463c9 JT |
168 | # define CONFIG_VIDEO_LOGO |
169 | # define CONFIG_VIDEO_BMP_LOGO | |
170 | #endif | |
171 | ||
f4b7532f JT |
172 | /* SPL */ |
173 | #ifdef CONFIG_SPL | |
c282eae0 | 174 | # ifdef CONFIG_ENV_IS_IN_NAND |
023ff2f7 JT |
175 | # define CONFIG_SPL_NAND_SUPPORT |
176 | # else | |
177 | # define CONFIG_SPL_MMC_SUPPORT | |
178 | # endif | |
179 | ||
f4b7532f JT |
180 | # include "imx6_spl.h" |
181 | #endif | |
182 | ||
0e689a61 | 183 | #endif /* __IMX6_ENGICAM_CONFIG_H */ |