1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 2016-2017
4 * Lukasz Majewski, DENX Software Engineering, lukma@denx.de
10 #include "mx6_common.h"
14 #define CONFIG_SYS_UBOOT_BASE (CONFIG_SYS_FLASH_BASE + 0x80000)
15 #define CONFIG_SYS_SPL_ARGS_ADDR 0x18000000
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)
22 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR (0x800)
23 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (0x80)
24 #define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR (0x1000)
25 #define CONFIG_SPL_FS_LOAD_KERNEL_NAME "fitImage"
27 #define CONFIG_MXC_UART_BASE UART1_BASE
29 /* MMC Configuration */
30 #define CONFIG_SYS_FSL_USDHC_NUM 2
31 #define CONFIG_SYS_FSL_ESDHC_ADDR 0
34 #define CONFIG_SYS_FLASH_BASE WEIM_ARB_BASE_ADDR
35 #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT
36 #define CONFIG_SYS_FLASH_EMPTY_INFO
37 #define CONFIG_FLASH_VERIFY
40 #define CONFIG_SYS_MAX_FLASH_BANKS_DETECT 1
41 #define CONFIG_SYS_FLASH_BANKS_LIST { (CONFIG_SYS_FLASH_BASE) }
42 #define CONFIG_SYS_FLASH_BANKS_SIZES { (32 * SZ_1M) }
44 /* Ethernet Configuration */
45 #define IMX_FEC_BASE ENET_BASE_ADDR
46 #define CONFIG_FEC_MXC_PHYADDR 1
48 #define CONFIG_EXTRA_ENV_SETTINGS \
49 "console=ttymxc0,115200 quiet\0" \
50 "fdt_high=0xffffffff\0" \
51 "initrd_high=0xffffffff\0" \
53 "kernelsize=0x300000\0" \
54 "disable_giga=yes\0" \
56 "tftpboot ${loadaddr} ${kernel_file};\0" \
58 "setenv boot_medium nor;" \
59 "setexpr.l _src_sbmr1 *0x020d8004;" \
60 "setexpr _b_medium ${_src_sbmr1} '&' 0x00000040;" \
61 "if test ${_b_medium} = 40; then " \
62 "setenv boot_medium sdcard;" \
64 "kernel_file=fitImage\0" \
66 "echo '#######################';" \
67 "echo '# Factory SDcard Boot #';" \
68 "echo '#######################';" \
70 "setenv mmcfactorydev 0;" \
71 "setenv mmcfactorypart 1;" \
72 "run factory_flash_img;\0" \
74 "setenv kernelnor 0x08180000;" \
75 "setenv bootargs console=${console} " \
76 CONFIG_MTDPARTS_DEFAULT " " \
77 "root=/dev/mmcblk1 rootfstype=ext4 rw rootwait noinitrd;" \
78 "cp.l ${kernelnor} ${loadaddr} ${kernelsize};" \
79 "bootm ${loadaddr};reset;\0" \
81 "echo '#######################';" \
82 "echo '# RECOVERY SWU Boot #';" \
83 "echo '#######################';" \
84 "setenv rootfsloadaddr 0x13000000;" \
85 "setenv swukernelnor 0x08980000;" \
86 "setenv swurootfsnor 0x09180000;" \
87 "setenv bootargs console=${console} " \
88 CONFIG_MTDPARTS_DEFAULT " " \
89 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
90 ":${hostname}::off root=/dev/ram rw;" \
91 "cp.l ${swurootfsnor} ${rootfsloadaddr} 0x200000;" \
92 "cp.l ${swukernelnor} ${loadaddr} ${kernelsize};" \
93 "bootm ${loadaddr} ${rootfsloadaddr};reset;\0" \
95 "echo '#######################';" \
96 "echo '# TFTP Boot #';" \
97 "echo '#######################';" \
98 "if run download_kernel; then " \
99 "setenv bootargs console=${console} " \
100 "root=/dev/mmcblk0p2 rootwait;" \
101 "bootm $loadaddr};reset;" \
104 "if test -n ${recovery_status}; then " \
105 "run boot_recovery;" \
107 "if test ! -n ${boot_medium}; then " \
108 "run get_boot_medium;" \
109 "if test ${boot_medium} = sdcard; then " \
115 "if test ${boot_medium} = tftp; then " \
120 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
124 "load_addr=0x11000000\0" \
125 "uboot_file=u-boot.img\0" \
127 "load_uboot=tftp ${load_addr} ${uboot_file}\0" \
128 "nor_img_addr=0x11000000\0" \
129 "nor_img_file=core-image-lwn-mccmon6.nor\0" \
130 "emmc_img_file=core-image-lwn-mccmon6.ext4\0" \
131 "nor_bank_start=" __stringify(CONFIG_SYS_FLASH_BASE) "\0" \
132 "nor_img_size=0x02000000\0" \
133 "factory_script_file=factory.scr\0" \
134 "factory_load_script=" \
135 "if test -e mmc ${mmcdev}:${mmcfactorypart} " \
136 "${factory_script_file}; then " \
137 "load mmc ${mmcdev}:${mmcfactorypart} " \
138 "${loadaddr} ${factory_script_file};" \
140 "factory_script=echo Running factory script from mmc${mmcdev} ...; " \
141 "source ${loadaddr}\0" \
142 "factory_flash_img="\
143 "echo 'Flash mccmon6 with factory images'; " \
144 "if run factory_load_script; then " \
145 "run factory_script;" \
147 "echo No factory script: ${factory_script_file} found on " \
148 "device ${mmcdev};" \
149 "run factory_nor_img;" \
150 "run factory_eMMC_img;" \
151 "run factory_SPL_falcon_setup;" \
154 "echo 'Update mccmon6 eMMC image'; " \
155 "if load mmc ${mmcdev}:${mmcfactorypart} " \
156 "${loadaddr} ${emmc_img_file}; then " \
157 "setexpr fw_sz ${filesize} / 0x200;" \
158 "setexpr fw_sz ${fw_sz} + 1;" \
159 "mmc dev ${mmcfactorydev};" \
160 "mmc write ${loadaddr} 0x0 ${fw_sz};" \
163 "echo 'Update mccmon6 NOR image'; " \
164 "if load mmc ${mmcdev}:${mmcfactorypart} " \
165 "${nor_img_addr} ${nor_img_file}; then " \
169 "protect off ${nor_bank_start} +${nor_img_size};" \
170 "erase ${nor_bank_start} +${nor_img_size};" \
171 "setexpr nor_img_size ${nor_img_size} / 4; " \
172 "cp.l ${nor_img_addr} ${nor_bank_start} ${nor_img_size}\0" \
173 "factory_SPL_falcon_setup="\
174 "echo 'Write Falcon boot data'; " \
175 "setenv kernelnor 0x08180000;" \
176 "cp.l ${kernelnor} ${loadaddr} ${kernelsize};" \
177 "spl export fdt ${loadaddr};" \
178 "setenv nor_img_addr ${fdtargsaddr};" \
179 "setenv nor_img_size 0x20000;" \
180 "setenv nor_bank_start " \
181 __stringify(CONFIG_CMD_SPL_NOR_OFS)";" \
184 "echo 'Update mccmon6 NOR U-BOOT via TFTP'; " \
185 "setenv nor_img_file u-boot.img; " \
186 "setenv nor_img_size 0x80000; " \
187 "setenv nor_bank_start 0x08080000; " \
188 "if tftpboot ${nor_img_addr} ${nor_img_file}; then " \
192 "echo 'Update mccmon6 NOR fitImage via TFTP'; " \
193 "setenv nor_img_file fitImage; " \
194 "setenv nor_img_size 0x500000; " \
195 "setenv nor_bank_start 0x08180000; " \
196 "if tftpboot ${nor_img_addr} ${nor_img_file}; then " \
200 "echo 'Update mccmon6 NOR image via TFTP'; " \
201 "if tftpboot ${nor_img_addr} ${nor_img_file}; then " \
205 "if tftp ${load_addr} SPL_padded; then " \
206 "erase 0x08000000 +0x20000;" \
207 "cp.b ${load_addr} 0x08000000 0x20000;" \
210 "if mmc dev 1; then " \
211 "if tftp ${load_addr} ${SPL_file}; then " \
212 "setexpr fw_sz ${filesize} / 0x200; " \
213 "setexpr fw_sz ${fw_sz} + 1; " \
214 "mmc write ${load_addr} 0x2 ${fw_sz};" \
218 "if mmc dev 1; then " \
219 "if run load_uboot; then " \
220 "setexpr fw_sz ${filesize} / 0x200; " \
221 "setexpr fw_sz ${fw_sz} + 1; " \
222 "mmc write ${load_addr} 0x8A ${fw_sz};" \
226 /* Physical Memory Map */
227 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
229 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
230 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
231 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
233 #define CONFIG_SYS_INIT_SP_OFFSET \
234 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
235 #define CONFIG_SYS_INIT_SP_ADDR \
236 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
238 /* Environment organization */
240 /* Envs are stored in NOR flash */
242 #endif /* __CONFIG_H * */