]> git.ipfire.org Git - thirdparty/u-boot.git/blob - include/configs/mccmon6.h
spl: Convert SYS_MMCSD_RAW_MODE_KERNEL_SECTOR to Kconfig
[thirdparty/u-boot.git] / include / configs / mccmon6.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3 * Copyright (C) 2016-2017
4 * Lukasz Majewski, DENX Software Engineering, lukma@denx.de
5 */
6
7 #ifndef __CONFIG_H
8 #define __CONFIG_H
9
10 #include "mx6_common.h"
11
12 #include "imx6_spl.h"
13
14 #define CONFIG_SYS_UBOOT_BASE (CONFIG_SYS_FLASH_BASE + 0x80000)
15 #define CONFIG_SYS_SPL_ARGS_ADDR 0x18000000
16
17 /*
18 * Below defines are set but NOT really used since we by
19 * design force U-Boot run when we boot in development
20 * mode from SD card (SD2)
21 */
22 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR (0x800)
23 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (0x80)
24 #define CONFIG_SPL_FS_LOAD_KERNEL_NAME "fitImage"
25
26 #define CONFIG_MXC_UART_BASE UART1_BASE
27
28 /* MMC Configuration */
29 #define CONFIG_SYS_FSL_USDHC_NUM 2
30 #define CONFIG_SYS_FSL_ESDHC_ADDR 0
31
32 /* NOR 16-bit mode */
33 #define CONFIG_SYS_FLASH_BASE WEIM_ARB_BASE_ADDR
34 #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT
35 #define CONFIG_SYS_FLASH_EMPTY_INFO
36 #define CONFIG_FLASH_VERIFY
37
38 /* NOR Flash MTD */
39 #define CONFIG_SYS_MAX_FLASH_BANKS_DETECT 1
40 #define CONFIG_SYS_FLASH_BANKS_LIST { (CONFIG_SYS_FLASH_BASE) }
41 #define CONFIG_SYS_FLASH_BANKS_SIZES { (32 * SZ_1M) }
42
43 /* Ethernet Configuration */
44 #define IMX_FEC_BASE ENET_BASE_ADDR
45 #define CONFIG_FEC_MXC_PHYADDR 1
46
47 #define CONFIG_EXTRA_ENV_SETTINGS \
48 "console=ttymxc0,115200 quiet\0" \
49 "fdt_high=0xffffffff\0" \
50 "initrd_high=0xffffffff\0" \
51 "boot_os=yes\0" \
52 "kernelsize=0x300000\0" \
53 "disable_giga=yes\0" \
54 "download_kernel=" \
55 "tftpboot ${loadaddr} ${kernel_file};\0" \
56 "get_boot_medium=" \
57 "setenv boot_medium nor;" \
58 "setexpr.l _src_sbmr1 *0x020d8004;" \
59 "setexpr _b_medium ${_src_sbmr1} '&' 0x00000040;" \
60 "if test ${_b_medium} = 40; then " \
61 "setenv boot_medium sdcard;" \
62 "fi\0" \
63 "kernel_file=fitImage\0" \
64 "boot_sd=" \
65 "echo '#######################';" \
66 "echo '# Factory SDcard Boot #';" \
67 "echo '#######################';" \
68 "setenv mmcdev 1;" \
69 "setenv mmcfactorydev 0;" \
70 "setenv mmcfactorypart 1;" \
71 "run factory_flash_img;\0" \
72 "boot_nor=" \
73 "setenv kernelnor 0x08180000;" \
74 "setenv bootargs console=${console} " \
75 CONFIG_MTDPARTS_DEFAULT " " \
76 "root=/dev/mmcblk1 rootfstype=ext4 rw rootwait noinitrd;" \
77 "cp.l ${kernelnor} ${loadaddr} ${kernelsize};" \
78 "bootm ${loadaddr};reset;\0" \
79 "boot_recovery=" \
80 "echo '#######################';" \
81 "echo '# RECOVERY SWU Boot #';" \
82 "echo '#######################';" \
83 "setenv rootfsloadaddr 0x13000000;" \
84 "setenv swukernelnor 0x08980000;" \
85 "setenv swurootfsnor 0x09180000;" \
86 "setenv bootargs console=${console} " \
87 CONFIG_MTDPARTS_DEFAULT " " \
88 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
89 ":${hostname}::off root=/dev/ram rw;" \
90 "cp.l ${swurootfsnor} ${rootfsloadaddr} 0x200000;" \
91 "cp.l ${swukernelnor} ${loadaddr} ${kernelsize};" \
92 "bootm ${loadaddr} ${rootfsloadaddr};reset;\0" \
93 "boot_tftp=" \
94 "echo '#######################';" \
95 "echo '# TFTP Boot #';" \
96 "echo '#######################';" \
97 "if run download_kernel; then " \
98 "setenv bootargs console=${console} " \
99 "root=/dev/mmcblk0p2 rootwait;" \
100 "bootm $loadaddr};reset;" \
101 "fi\0" \
102 "bootcmd=" \
103 "if test -n ${recovery_status}; then " \
104 "run boot_recovery;" \
105 "else " \
106 "if test ! -n ${boot_medium}; then " \
107 "run get_boot_medium;" \
108 "if test ${boot_medium} = sdcard; then " \
109 "run boot_sd;" \
110 "else " \
111 "run boot_nor;" \
112 "fi;" \
113 "else " \
114 "if test ${boot_medium} = tftp; then " \
115 "run boot_tftp;" \
116 "fi;" \
117 "fi;" \
118 "fi\0" \
119 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
120 "bootdev=1\0" \
121 "bootpart=1\0" \
122 "netdev=eth0\0" \
123 "load_addr=0x11000000\0" \
124 "uboot_file=u-boot.img\0" \
125 "SPL_file=SPL\0" \
126 "load_uboot=tftp ${load_addr} ${uboot_file}\0" \
127 "nor_img_addr=0x11000000\0" \
128 "nor_img_file=core-image-lwn-mccmon6.nor\0" \
129 "emmc_img_file=core-image-lwn-mccmon6.ext4\0" \
130 "nor_bank_start=" __stringify(CONFIG_SYS_FLASH_BASE) "\0" \
131 "nor_img_size=0x02000000\0" \
132 "factory_script_file=factory.scr\0" \
133 "factory_load_script=" \
134 "if test -e mmc ${mmcdev}:${mmcfactorypart} " \
135 "${factory_script_file}; then " \
136 "load mmc ${mmcdev}:${mmcfactorypart} " \
137 "${loadaddr} ${factory_script_file};" \
138 "fi\0" \
139 "factory_script=echo Running factory script from mmc${mmcdev} ...; " \
140 "source ${loadaddr}\0" \
141 "factory_flash_img="\
142 "echo 'Flash mccmon6 with factory images'; " \
143 "if run factory_load_script; then " \
144 "run factory_script;" \
145 "else " \
146 "echo No factory script: ${factory_script_file} found on " \
147 "device ${mmcdev};" \
148 "run factory_nor_img;" \
149 "run factory_eMMC_img;" \
150 "run factory_SPL_falcon_setup;" \
151 "fi\0" \
152 "factory_eMMC_img="\
153 "echo 'Update mccmon6 eMMC image'; " \
154 "if load mmc ${mmcdev}:${mmcfactorypart} " \
155 "${loadaddr} ${emmc_img_file}; then " \
156 "setexpr fw_sz ${filesize} / 0x200;" \
157 "setexpr fw_sz ${fw_sz} + 1;" \
158 "mmc dev ${mmcfactorydev};" \
159 "mmc write ${loadaddr} 0x0 ${fw_sz};" \
160 "fi\0" \
161 "factory_nor_img="\
162 "echo 'Update mccmon6 NOR image'; " \
163 "if load mmc ${mmcdev}:${mmcfactorypart} " \
164 "${nor_img_addr} ${nor_img_file}; then " \
165 "run nor_update;" \
166 "fi\0" \
167 "nor_update=" \
168 "protect off ${nor_bank_start} +${nor_img_size};" \
169 "erase ${nor_bank_start} +${nor_img_size};" \
170 "setexpr nor_img_size ${nor_img_size} / 4; " \
171 "cp.l ${nor_img_addr} ${nor_bank_start} ${nor_img_size}\0" \
172 "factory_SPL_falcon_setup="\
173 "echo 'Write Falcon boot data'; " \
174 "setenv kernelnor 0x08180000;" \
175 "cp.l ${kernelnor} ${loadaddr} ${kernelsize};" \
176 "spl export fdt ${loadaddr};" \
177 "setenv nor_img_addr ${fdtargsaddr};" \
178 "setenv nor_img_size 0x20000;" \
179 "setenv nor_bank_start " \
180 __stringify(CONFIG_CMD_SPL_NOR_OFS)";" \
181 "run nor_update\0" \
182 "tftp_nor_uboot="\
183 "echo 'Update mccmon6 NOR U-BOOT via TFTP'; " \
184 "setenv nor_img_file u-boot.img; " \
185 "setenv nor_img_size 0x80000; " \
186 "setenv nor_bank_start 0x08080000; " \
187 "if tftpboot ${nor_img_addr} ${nor_img_file}; then " \
188 "run nor_update;" \
189 "fi\0" \
190 "tftp_nor_fitImg="\
191 "echo 'Update mccmon6 NOR fitImage via TFTP'; " \
192 "setenv nor_img_file fitImage; " \
193 "setenv nor_img_size 0x500000; " \
194 "setenv nor_bank_start 0x08180000; " \
195 "if tftpboot ${nor_img_addr} ${nor_img_file}; then " \
196 "run nor_update;" \
197 "fi\0" \
198 "tftp_nor_img="\
199 "echo 'Update mccmon6 NOR image via TFTP'; " \
200 "if tftpboot ${nor_img_addr} ${nor_img_file}; then " \
201 "run nor_update;" \
202 "fi\0" \
203 "tftp_nor_SPL="\
204 "if tftp ${load_addr} SPL_padded; then " \
205 "erase 0x08000000 +0x20000;" \
206 "cp.b ${load_addr} 0x08000000 0x20000;" \
207 "fi;\0" \
208 "tftp_sd_SPL="\
209 "if mmc dev 1; then " \
210 "if tftp ${load_addr} ${SPL_file}; then " \
211 "setexpr fw_sz ${filesize} / 0x200; " \
212 "setexpr fw_sz ${fw_sz} + 1; " \
213 "mmc write ${load_addr} 0x2 ${fw_sz};" \
214 "fi;" \
215 "fi;\0" \
216 "tftp_sd_uboot="\
217 "if mmc dev 1; then " \
218 "if run load_uboot; then " \
219 "setexpr fw_sz ${filesize} / 0x200; " \
220 "setexpr fw_sz ${fw_sz} + 1; " \
221 "mmc write ${load_addr} 0x8A ${fw_sz};" \
222 "fi;" \
223 "fi;\0"
224
225 /* Physical Memory Map */
226 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
227
228 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
229 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
230 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
231
232 #define CONFIG_SYS_INIT_SP_OFFSET \
233 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
234 #define CONFIG_SYS_INIT_SP_ADDR \
235 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
236
237 /* Environment organization */
238
239 /* Envs are stored in NOR flash */
240
241 #endif /* __CONFIG_H * */