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)
17 * Below defines are set but NOT really used since we by
18 * design force U-Boot run when we boot in development
19 * mode from SD card (SD2)
21 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR (0x800)
22 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (0x80)
24 #define CONFIG_MXC_UART_BASE UART1_BASE
26 /* MMC Configuration */
27 #define CONFIG_SYS_FSL_USDHC_NUM 2
28 #define CONFIG_SYS_FSL_ESDHC_ADDR 0
31 #define CONFIG_SYS_FLASH_BASE WEIM_ARB_BASE_ADDR
32 #define CONFIG_SYS_FLASH_EMPTY_INFO
33 #define CONFIG_FLASH_VERIFY
36 #define CONFIG_SYS_FLASH_BANKS_LIST { (CONFIG_SYS_FLASH_BASE) }
37 #define CONFIG_SYS_FLASH_BANKS_SIZES { (32 * SZ_1M) }
39 /* Ethernet Configuration */
40 #define CONFIG_FEC_MXC_PHYADDR 1
42 #define CONFIG_EXTRA_ENV_SETTINGS \
43 "console=ttymxc0,115200 quiet\0" \
44 "fdt_high=0xffffffff\0" \
45 "initrd_high=0xffffffff\0" \
47 "kernelsize=0x300000\0" \
48 "disable_giga=yes\0" \
50 "tftpboot ${loadaddr} ${kernel_file};\0" \
52 "setenv boot_medium nor;" \
53 "setexpr.l _src_sbmr1 *0x020d8004;" \
54 "setexpr _b_medium ${_src_sbmr1} '&' 0x00000040;" \
55 "if test ${_b_medium} = 40; then " \
56 "setenv boot_medium sdcard;" \
58 "kernel_file=fitImage\0" \
60 "echo '#######################';" \
61 "echo '# Factory SDcard Boot #';" \
62 "echo '#######################';" \
64 "setenv mmcfactorydev 0;" \
65 "setenv mmcfactorypart 1;" \
66 "run factory_flash_img;\0" \
68 "setenv kernelnor 0x08180000;" \
69 "setenv bootargs console=${console} " \
70 CONFIG_MTDPARTS_DEFAULT " " \
71 "root=/dev/mmcblk1 rootfstype=ext4 rw rootwait noinitrd;" \
72 "cp.l ${kernelnor} ${loadaddr} ${kernelsize};" \
73 "bootm ${loadaddr};reset;\0" \
75 "echo '#######################';" \
76 "echo '# RECOVERY SWU Boot #';" \
77 "echo '#######################';" \
78 "setenv rootfsloadaddr 0x13000000;" \
79 "setenv swukernelnor 0x08980000;" \
80 "setenv swurootfsnor 0x09180000;" \
81 "setenv bootargs console=${console} " \
82 CONFIG_MTDPARTS_DEFAULT " " \
83 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
84 ":${hostname}::off root=/dev/ram rw;" \
85 "cp.l ${swurootfsnor} ${rootfsloadaddr} 0x200000;" \
86 "cp.l ${swukernelnor} ${loadaddr} ${kernelsize};" \
87 "bootm ${loadaddr} ${rootfsloadaddr};reset;\0" \
89 "echo '#######################';" \
90 "echo '# TFTP Boot #';" \
91 "echo '#######################';" \
92 "if run download_kernel; then " \
93 "setenv bootargs console=${console} " \
94 "root=/dev/mmcblk0p2 rootwait;" \
95 "bootm $loadaddr};reset;" \
98 "if test -n ${recovery_status}; then " \
99 "run boot_recovery;" \
101 "if test ! -n ${boot_medium}; then " \
102 "run get_boot_medium;" \
103 "if test ${boot_medium} = sdcard; then " \
109 "if test ${boot_medium} = tftp; then " \
114 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
118 "load_addr=0x11000000\0" \
119 "uboot_file=u-boot.img\0" \
121 "load_uboot=tftp ${load_addr} ${uboot_file}\0" \
122 "nor_img_addr=0x11000000\0" \
123 "nor_img_file=core-image-lwn-mccmon6.nor\0" \
124 "emmc_img_file=core-image-lwn-mccmon6.ext4\0" \
125 "nor_bank_start=" __stringify(CONFIG_SYS_FLASH_BASE) "\0" \
126 "nor_img_size=0x02000000\0" \
127 "factory_script_file=factory.scr\0" \
128 "factory_load_script=" \
129 "if test -e mmc ${mmcdev}:${mmcfactorypart} " \
130 "${factory_script_file}; then " \
131 "load mmc ${mmcdev}:${mmcfactorypart} " \
132 "${loadaddr} ${factory_script_file};" \
134 "factory_script=echo Running factory script from mmc${mmcdev} ...; " \
135 "source ${loadaddr}\0" \
136 "factory_flash_img="\
137 "echo 'Flash mccmon6 with factory images'; " \
138 "if run factory_load_script; then " \
139 "run factory_script;" \
141 "echo No factory script: ${factory_script_file} found on " \
142 "device ${mmcdev};" \
143 "run factory_nor_img;" \
144 "run factory_eMMC_img;" \
145 "run factory_SPL_falcon_setup;" \
148 "echo 'Update mccmon6 eMMC image'; " \
149 "if load mmc ${mmcdev}:${mmcfactorypart} " \
150 "${loadaddr} ${emmc_img_file}; then " \
151 "setexpr fw_sz ${filesize} / 0x200;" \
152 "setexpr fw_sz ${fw_sz} + 1;" \
153 "mmc dev ${mmcfactorydev};" \
154 "mmc write ${loadaddr} 0x0 ${fw_sz};" \
157 "echo 'Update mccmon6 NOR image'; " \
158 "if load mmc ${mmcdev}:${mmcfactorypart} " \
159 "${nor_img_addr} ${nor_img_file}; then " \
163 "protect off ${nor_bank_start} +${nor_img_size};" \
164 "erase ${nor_bank_start} +${nor_img_size};" \
165 "setexpr nor_img_size ${nor_img_size} / 4; " \
166 "cp.l ${nor_img_addr} ${nor_bank_start} ${nor_img_size}\0" \
167 "factory_SPL_falcon_setup="\
168 "echo 'Write Falcon boot data'; " \
169 "setenv kernelnor 0x08180000;" \
170 "cp.l ${kernelnor} ${loadaddr} ${kernelsize};" \
171 "spl export fdt ${loadaddr};" \
172 "setenv nor_img_addr ${fdtargsaddr};" \
173 "setenv nor_img_size 0x20000;" \
174 "setenv nor_bank_start " \
175 __stringify(CONFIG_CMD_SPL_NOR_OFS)";" \
178 "echo 'Update mccmon6 NOR U-BOOT via TFTP'; " \
179 "setenv nor_img_file u-boot.img; " \
180 "setenv nor_img_size 0x80000; " \
181 "setenv nor_bank_start 0x08080000; " \
182 "if tftpboot ${nor_img_addr} ${nor_img_file}; then " \
186 "echo 'Update mccmon6 NOR fitImage via TFTP'; " \
187 "setenv nor_img_file fitImage; " \
188 "setenv nor_img_size 0x500000; " \
189 "setenv nor_bank_start 0x08180000; " \
190 "if tftpboot ${nor_img_addr} ${nor_img_file}; then " \
194 "echo 'Update mccmon6 NOR image via TFTP'; " \
195 "if tftpboot ${nor_img_addr} ${nor_img_file}; then " \
199 "if tftp ${load_addr} SPL_padded; then " \
200 "erase 0x08000000 +0x20000;" \
201 "cp.b ${load_addr} 0x08000000 0x20000;" \
204 "if mmc dev 1; then " \
205 "if tftp ${load_addr} ${SPL_file}; then " \
206 "setexpr fw_sz ${filesize} / 0x200; " \
207 "setexpr fw_sz ${fw_sz} + 1; " \
208 "mmc write ${load_addr} 0x2 ${fw_sz};" \
212 "if mmc dev 1; then " \
213 "if run load_uboot; then " \
214 "setexpr fw_sz ${filesize} / 0x200; " \
215 "setexpr fw_sz ${fw_sz} + 1; " \
216 "mmc write ${load_addr} 0x8A ${fw_sz};" \
220 /* Physical Memory Map */
221 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
223 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
224 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
225 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
227 /* Environment organization */
229 /* Envs are stored in NOR flash */
231 #endif /* __CONFIG_H * */