Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2017 |
| 4 | * Lukasz Majewski, DENX Software Engineering, lukma@denx.de |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef __CONFIG_H |
| 8 | #define __CONFIG_H |
| 9 | |
| 10 | #include "mx6_common.h" |
| 11 | |
| 12 | /* Falcon Mode */ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 13 | #define CONFIG_SYS_SPL_ARGS_ADDR 0x18000000 |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 14 | |
| 15 | /* Falcon Mode - MMC support */ |
| 16 | #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x3F00 |
| 17 | #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS \ |
| 18 | (CONFIG_CMD_SPL_WRITE_SIZE / 512) |
| 19 | #define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x100 /* 128KiB */ |
| 20 | |
| 21 | /* |
| 22 | * display5 SPI-NOR memory layout |
| 23 | * |
| 24 | * The definition can be found in Kconfig's |
| 25 | * CONFIG_MTDIDS_DEFAULT and CONFIG_MTDPARTS_DEFAULT |
| 26 | * |
| 27 | * 0x000000 - 0x020000 : SPI.SPL (128KiB) |
| 28 | * 0x020000 - 0x120000 : SPI.u-boot (1MiB) |
| 29 | * 0x120000 - 0x130000 : SPI.u-boot-env1 (64KiB) |
| 30 | * 0x130000 - 0x140000 : SPI.u-boot-env2 (64KiB) |
Lukasz Majewski | a3d18cd | 2020-05-13 17:45:15 +0200 | [diff] [blame] | 31 | * 0x140000 - 0x740000 : SPI.swupdate-kernel-FIT (6MiB) |
| 32 | * 0x740000 - 0x1B40000 : SPI.swupdate-initramfs (20MiB) |
| 33 | * 0x1B40000 - 0x1F00000 : SPI.reserved (3840KiB) |
| 34 | * 0x1F00000 - 0x2000000 : SPI.factory (1MiB) |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 35 | */ |
| 36 | |
Lukasz Majewski | 7505605 | 2019-09-03 16:38:43 +0200 | [diff] [blame] | 37 | /* SPI Flash Configs */ |
| 38 | #if defined(CONFIG_SPL_BUILD) |
| 39 | #undef CONFIG_DM_SPI |
| 40 | #undef CONFIG_DM_SPI_FLASH |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 41 | #endif |
| 42 | |
| 43 | /* Below values are "dummy" - only to avoid build break */ |
| 44 | #define CONFIG_SYS_SPI_KERNEL_OFFS 0x150000 |
| 45 | #define CONFIG_SYS_SPI_ARGS_OFFS 0x140000 |
| 46 | #define CONFIG_SYS_SPI_ARGS_SIZE 0x10000 |
| 47 | |
| 48 | #include "imx6_spl.h" |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 49 | |
| 50 | #define CONFIG_CMDLINE_TAG |
| 51 | #define CONFIG_SETUP_MEMORY_TAGS |
| 52 | #define CONFIG_INITRD_TAG |
| 53 | #define CONFIG_REVISION_TAG |
| 54 | |
| 55 | /* Size of malloc() pool */ |
| 56 | #define CONFIG_SYS_MALLOC_LEN (16 * 1024 * 1024) |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 57 | |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 58 | #define CONFIG_MXC_UART_BASE UART5_BASE |
| 59 | |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 60 | /* I2C Configs */ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 61 | #define CONFIG_I2C_MULTI_BUS |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 62 | |
| 63 | /* MMC Configs */ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 64 | #define CONFIG_SYS_FSL_ESDHC_ADDR 0 |
| 65 | #define CONFIG_SYS_FSL_USDHC_NUM 2 |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 66 | |
| 67 | /* allow to overwrite serial and ethaddr */ |
| 68 | #define CONFIG_ENV_OVERWRITE |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 69 | |
| 70 | #ifndef CONFIG_BOOTCOMMAND |
Lukasz Majewski | d7e065a | 2018-05-11 16:51:08 +0200 | [diff] [blame] | 71 | #define CONFIG_BOOTCOMMAND "if run check_em_pad; then " \ |
| 72 | "run recovery;" \ |
| 73 | "else if test ${BOOT_FROM} = FACTORY; then " \ |
Lukasz Majewski | 48ef474 | 2018-05-11 16:50:59 +0200 | [diff] [blame] | 74 | "run factory_nfs;" \ |
| 75 | "else " \ |
| 76 | "run boot_mmc;" \ |
Lukasz Majewski | d7e065a | 2018-05-11 16:51:08 +0200 | [diff] [blame] | 77 | "fi;fi" |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 78 | #endif |
| 79 | |
| 80 | #define PARTS_DEFAULT \ |
| 81 | /* Linux partitions */ \ |
| 82 | "partitions=" \ |
| 83 | "uuid_disk=${uuid_gpt_disk};" \ |
| 84 | "name=kernel_raw1,start=128K,size=8M,uuid=${uuid_gpt_kernel_raw1};" \ |
| 85 | "name=rootfs1,size=1528M,uuid=${uuid_gpt_rootfs1};" \ |
| 86 | "name=kernel_raw2,size=8M,uuid=${uuid_gpt_kernel_raw2};" \ |
Lukasz Majewski | 6d46ce0 | 2018-05-11 16:51:16 +0200 | [diff] [blame] | 87 | "name=rootfs2,size=512M,uuid=${uuid_gpt_rootfs2};" \ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 88 | "name=data,size=-,uuid=${uuid_gpt_data}\0" |
| 89 | |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 90 | #define SWUPDATE_RECOVERY_PROCEDURE \ |
| 91 | "echo '#######################';" \ |
| 92 | "echo '# RECOVERY SWUupdate #';" \ |
| 93 | "echo '#######################';" \ |
Lukasz Majewski | ac6fb1e | 2018-05-11 16:51:18 +0200 | [diff] [blame] | 94 | "echo '#######################';" \ |
| 95 | "echo '# GPT verify #';" \ |
| 96 | "if gpt verify mmc ${mmcdev} ${partitions}; then " \ |
| 97 | "echo '# OK ! #';" \ |
| 98 | "else " \ |
| 99 | "echo '# FAILED ! #';" \ |
| 100 | "echo '# GPT RESTORATION #';" \ |
| 101 | "gpt write mmc ${mmcdev} ${partitions};" \ |
| 102 | "fi;" \ |
| 103 | "echo '#######################';" \ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 104 | "setenv loadaddr_swu_initramfs 0x14000000;" \ |
| 105 | "setenv bootargs console=${console} " \ |
| 106 | "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \ |
| 107 | ":${hostname}::off root=/dev/ram rw;" \ |
| 108 | "sf probe;" \ |
| 109 | "sf read ${loadaddr} swu-kernel;" \ |
| 110 | "sf read ${loadaddr_swu_initramfs} swu-initramfs;" \ |
Lukasz Majewski | 37bf203 | 2018-05-11 16:51:04 +0200 | [diff] [blame] | 111 | "bootm ${loadaddr} ${loadaddr_swu_initramfs};reset;" |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 112 | |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 113 | #define SETUP_BOOTARGS \ |
| 114 | "run set_rootfs_part;" \ |
| 115 | "setenv bootargs ${bootargs} console=${console} " \ |
| 116 | "root=/dev/mmcblk${mmcdev}p${rootfs_part} " \ |
| 117 | "rootwait rootfstype=ext4 rw; " \ |
| 118 | "run set_kernel_part;" \ |
| 119 | "part start mmc ${mmcdev} ${kernel_part} lba_start; " \ |
Lukasz Majewski | f1b7c77 | 2018-08-18 22:22:07 +0200 | [diff] [blame] | 120 | "mmc read ${loadaddr} ${lba_start} ${fitImg_fw_sz}; " \ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 121 | "setenv fdt_conf imx6q-${board}-${display}.dtb; " |
| 122 | |
| 123 | /* All the numbers are in LBAs */ |
| 124 | #define __TFTP_UPDATE_KERNEL \ |
| 125 | "tftp_mmc_fitImg=" \ |
| 126 | "if test ! -n ${kernel_part}; then " \ |
| 127 | "setenv kernel_part ${kernel_part_active};" \ |
| 128 | "fi;" \ |
| 129 | "if tftp ${loadaddr} ${kernel_file}; then " \ |
| 130 | "setexpr fw_sz ${filesize} / 0x200; " \ |
| 131 | "setexpr fw_sz ${fw_sz} + 1; " \ |
| 132 | "part start mmc ${mmcdev} ${kernel_part} lba_start; " \ |
| 133 | "mmc write ${loadaddr} ${lba_start} ${fw_sz}; " \ |
| 134 | "; fi\0" \ |
| 135 | |
| 136 | #define TFTP_UPDATE_KERNEL \ |
| 137 | "setenv kernel_part ${kernel_part_active};" \ |
| 138 | "run tftp_mmc_fitImg;" \ |
| 139 | "setenv kernel_part ${kernel_part_backup};" \ |
| 140 | "run tftp_mmc_fitImg;" \ |
| 141 | |
| 142 | #define __TFTP_UPDATE_ROOTFS \ |
| 143 | "tftp_mmc_rootfs=" \ |
| 144 | "if test ! -n ${rootfs_part}; then " \ |
| 145 | "setenv rootfs_part ${rootfs_part_active};" \ |
| 146 | "fi;" \ |
| 147 | "if tftp ${loadaddr} ${rootfs_file}; then " \ |
| 148 | "setexpr fw_sz ${filesize} / 0x200; " \ |
| 149 | "setexpr fw_sz ${fw_sz} + 1; " \ |
| 150 | "part start mmc ${mmcdev} ${rootfs_part} lba_start; " \ |
| 151 | "mmc write ${loadaddr} ${lba_start} ${fw_sz}; " \ |
| 152 | "; fi\0" \ |
| 153 | |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 154 | #define TFTP_UPDATE_ROOTFS \ |
| 155 | "setenv rootfs_part ${rootfs_part_active};" \ |
| 156 | "run tftp_mmc_rootfs;" \ |
Lukasz Majewski | a2a603e | 2018-05-11 16:51:11 +0200 | [diff] [blame] | 157 | "run tftp_mmc_rootfs_bkp;" \ |
| 158 | |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 159 | |
| 160 | #define TFTP_UPDATE_RECOVERY_SWU_KERNEL \ |
| 161 | "tftp_sf_fitImg_SWU=" \ |
| 162 | "if tftp ${loadaddr} ${kernel_file}; then " \ |
| 163 | "sf probe;" \ |
| 164 | "sf erase swu-kernel +${filesize};" \ |
| 165 | "sf write ${loadaddr} swu-kernel ${filesize};" \ |
| 166 | "; fi\0" \ |
| 167 | |
| 168 | #define TFTP_UPDATE_RECOVERY_SWU_INITRAMFS \ |
Lukasz Majewski | a1d657f | 2018-05-11 16:51:12 +0200 | [diff] [blame] | 169 | "swu_initramfs_file=swupdate-image-display5.ext4.gz.u-boot\0" \ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 170 | "tftp_sf_initramfs_SWU=" \ |
| 171 | "if tftp ${loadaddr} ${swu_initramfs_file}; then " \ |
| 172 | "sf probe;" \ |
| 173 | "sf erase swu-initramfs +${filesize};" \ |
| 174 | "sf write ${loadaddr} swu-initramfs ${filesize};" \ |
| 175 | "; fi\0" \ |
| 176 | |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 177 | #define TFTP_UPDATE_BOOTLOADER \ |
| 178 | "ubootfile=u-boot.img\0" \ |
| 179 | "ubootfileSPL=SPL\0" \ |
| 180 | "tftp_sf_uboot=" \ |
| 181 | "if tftp ${loadaddr} ${ubootfile}; then " \ |
| 182 | "sf probe;" \ |
| 183 | "sf erase u-boot +${filesize};" \ |
| 184 | "sf write ${loadaddr} u-boot ${filesize}" \ |
| 185 | "; fi\0" \ |
| 186 | "tftp_sf_SPL=" \ |
| 187 | "if tftp ${loadaddr} ${ubootfileSPL}; then " \ |
| 188 | "sf probe;" \ |
| 189 | "setexpr uboot_SPL_size ${filesize} + 0x400;" \ |
| 190 | "sf erase 0x0 +${uboot_SPL_size};" \ |
| 191 | "sf write ${loadaddr} 0x400 ${filesize};" \ |
| 192 | "fi\0" \ |
| 193 | |
Lukasz Majewski | bac6fe7 | 2018-05-11 16:51:02 +0200 | [diff] [blame] | 194 | #define TFTP_UPDATE_SPINOR \ |
| 195 | "spinorfile=core-image-lwn-display5.spinor\0" \ |
| 196 | "spinorsize=0x2000000\0" \ |
| 197 | "tftp_sf_img=" \ |
| 198 | "if tftp ${loadaddr} ${spinorfile}; then " \ |
| 199 | "sf probe;" \ |
| 200 | "sf erase 0x0 ${spinorsize};" \ |
| 201 | "sf write ${loadaddr} 0x0 ${filesize};" \ |
| 202 | "fi\0" \ |
| 203 | |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 204 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 205 | PARTS_DEFAULT \ |
Lukasz Majewski | d7e065a | 2018-05-11 16:51:08 +0200 | [diff] [blame] | 206 | "gpio_recovery=93\0" \ |
| 207 | "check_em_pad=gpio input ${gpio_recovery};test $? -eq 0;\0" \ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 208 | "display=tianma-tm070-800x480\0" \ |
| 209 | "board=display5\0" \ |
| 210 | "mmcdev=0\0" \ |
| 211 | "altbootcmd=run recovery\0" \ |
| 212 | "bootdelay=1\0" \ |
| 213 | "baudrate=115200\0" \ |
| 214 | "bootcmd=" CONFIG_BOOTCOMMAND "\0" \ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 215 | "ethact=FEC\0" \ |
| 216 | "netdev=eth0\0" \ |
| 217 | "boot_os=y\0" \ |
| 218 | "hostname=display5\0" \ |
| 219 | "loadaddr=0x12000000\0" \ |
| 220 | "fdtaddr=0x12800000\0" \ |
Lukasz Majewski | 248698e | 2018-05-11 16:51:15 +0200 | [diff] [blame] | 221 | "console=ttymxc4,115200 quiet cma=256M\0" \ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 222 | "fdtfile=imx6q-display5.dtb\0" \ |
| 223 | "fdt_high=0xffffffff\0" \ |
| 224 | "initrd_high=0xffffffff\0" \ |
| 225 | "kernel_file=fitImage\0" \ |
Lukasz Majewski | f1b7c77 | 2018-08-18 22:22:07 +0200 | [diff] [blame] | 226 | "fitImg_fw_sz=0x2200\0" \ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 227 | "up=run tftp_sf_SPL; run tftp_sf_uboot\0" \ |
| 228 | "download_kernel=" \ |
| 229 | "tftpboot ${loadaddr} ${kernel_file};\0" \ |
Lukasz Majewski | 48ef474 | 2018-05-11 16:50:59 +0200 | [diff] [blame] | 230 | "factory_nfs=" \ |
Lukasz Majewski | f4ad68a | 2018-05-11 16:51:00 +0200 | [diff] [blame] | 231 | "setenv ipaddr 192.168.1.102;" \ |
| 232 | "setenv gatewayip 192.168.1.1;" \ |
| 233 | "setenv netmask 255.255.255.0;" \ |
| 234 | "setenv serverip 192.168.1.2;" \ |
Lukasz Majewski | 48ef474 | 2018-05-11 16:50:59 +0200 | [diff] [blame] | 235 | "echo BOOT: FACTORY (LEG);" \ |
| 236 | "run boot_nfs\0" \ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 237 | "boot_swu_recovery=" SWUPDATE_RECOVERY_PROCEDURE "\0" \ |
| 238 | "recovery=" \ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 239 | "echo BOOT: RECOVERY: SWU;" \ |
Lukasz Majewski | b259fff | 2018-05-11 16:51:05 +0200 | [diff] [blame] | 240 | "run boot_swu_recovery\0" \ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 241 | "boot_tftp=" \ |
| 242 | "if run download_kernel; then " \ |
| 243 | "setenv bootargs console=${console} " \ |
| 244 | "root=/dev/mmcblk0p2 rootwait;" \ |
Lukasz Majewski | 37bf203 | 2018-05-11 16:51:04 +0200 | [diff] [blame] | 245 | "bootm ${loadaddr} - ${fdtaddr};reset;" \ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 246 | "fi\0" \ |
| 247 | "addip=setenv bootargs ${bootargs} " \ |
| 248 | "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:" \ |
| 249 | "${hostname}:eth0:on" \ |
| 250 | "\0" \ |
| 251 | "nfsargs=setenv bootargs " \ |
| 252 | "root=/dev/nfs rw " \ |
| 253 | "nfsroot=${serverip}:${rootpath},nolock,nfsvers=3" \ |
| 254 | "\0" \ |
| 255 | "rootpath=/srv/tftp/DISP5/rootfs\0" \ |
| 256 | "boot_nfs=" \ |
| 257 | "if run download_kernel; then " \ |
| 258 | "run nfsargs;" \ |
| 259 | "run addip;" \ |
| 260 | "setenv bootargs ${bootargs} console=${console};" \ |
| 261 | "setenv fdt_conf imx6q-${board}-${display}.dtb; " \ |
Lukasz Majewski | 37bf203 | 2018-05-11 16:51:04 +0200 | [diff] [blame] | 262 | "bootm ${loadaddr}#conf@${fdt_conf};reset;" \ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 263 | "fi\0" \ |
| 264 | "falcon_setup=" \ |
| 265 | "if mmc dev ${mmcdev}; then " \ |
| 266 | SETUP_BOOTARGS \ |
| 267 | "spl export fdt ${loadaddr}#conf@${fdt_conf};" \ |
| 268 | "setexpr fw_sz ${fdtargslen} / 0x200; " \ |
| 269 | "setexpr fw_sz ${fw_sz} + 1; " \ |
| 270 | "mmc write ${fdtargsaddr} " \ |
| 271 | __stringify(CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR)" ${fw_sz}; " \ |
| 272 | "fi\0" \ |
| 273 | "boot_mmc=" \ |
| 274 | "if mmc dev ${mmcdev}; then " \ |
| 275 | SETUP_BOOTARGS \ |
Lukasz Majewski | 37bf203 | 2018-05-11 16:51:04 +0200 | [diff] [blame] | 276 | "bootm ${loadaddr}#conf@${fdt_conf};reset;" \ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 277 | "fi\0" \ |
| 278 | "set_kernel_part=" \ |
| 279 | "if test ${BOOT_FROM} = ACTIVE; then " \ |
| 280 | "setenv kernel_part ${kernel_part_active};" \ |
| 281 | "echo BOOT: ACTIVE;" \ |
| 282 | "else if test ${BOOT_FROM} = BACKUP; then " \ |
| 283 | "setenv kernel_part ${kernel_part_backup};" \ |
| 284 | "echo BOOT: BACKUP;" \ |
| 285 | "else " \ |
| 286 | "run recovery;" \ |
| 287 | "fi;fi\0" \ |
| 288 | "set_rootfs_part=" \ |
| 289 | "if test ${BOOT_FROM} = ACTIVE; then " \ |
| 290 | "setenv rootfs_part ${rootfs_part_active};" \ |
| 291 | "else if test ${BOOT_FROM} = BACKUP; then " \ |
| 292 | "setenv rootfs_part ${rootfs_part_backup};" \ |
| 293 | "else " \ |
| 294 | "run recovery;" \ |
| 295 | "fi;fi\0" \ |
| 296 | "BOOT_FROM=ACTIVE\0" \ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 297 | TFTP_UPDATE_BOOTLOADER \ |
Lukasz Majewski | bac6fe7 | 2018-05-11 16:51:02 +0200 | [diff] [blame] | 298 | TFTP_UPDATE_SPINOR \ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 299 | "kernel_part_active=1\0" \ |
| 300 | "kernel_part_backup=3\0" \ |
| 301 | __TFTP_UPDATE_KERNEL \ |
| 302 | "rootfs_part_active=2\0" \ |
| 303 | "rootfs_part_backup=4\0" \ |
| 304 | "rootfs_file=core-image-lwn-display5.ext4\0" \ |
Lukasz Majewski | 7fbc636 | 2018-05-11 16:51:10 +0200 | [diff] [blame] | 305 | "rootfs_file_backup=core-image-lwn-backup-display5.ext4\0" \ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 306 | __TFTP_UPDATE_ROOTFS \ |
Lukasz Majewski | 7fbc636 | 2018-05-11 16:51:10 +0200 | [diff] [blame] | 307 | "tftp_mmc_rootfs_bkp=" \ |
| 308 | "setenv rootfs_part ${rootfs_part_backup};" \ |
| 309 | "setenv rootfs_file ${rootfs_file_backup};" \ |
| 310 | "run tftp_mmc_rootfs\0" \ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 311 | TFTP_UPDATE_RECOVERY_SWU_KERNEL \ |
| 312 | TFTP_UPDATE_RECOVERY_SWU_INITRAMFS \ |
| 313 | "\0" \ |
| 314 | |
| 315 | /* Miscellaneous configurable options */ |
| 316 | #undef CONFIG_SYS_CBSIZE |
| 317 | #define CONFIG_SYS_CBSIZE 2048 |
| 318 | |
| 319 | /* Print Buffer Size */ |
| 320 | #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ |
| 321 | sizeof(CONFIG_SYS_PROMPT) + 16) |
| 322 | #define CONFIG_SYS_MAXARGS 32 |
| 323 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE |
| 324 | |
| 325 | #define CONFIG_STANDALONE_LOAD_ADDR 0x10001000 |
| 326 | #define CONFIG_SYS_HZ 1000 |
| 327 | |
| 328 | /* Physical Memory Map */ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 329 | #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR |
| 330 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM |
| 331 | |
| 332 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 333 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE |
| 334 | |
| 335 | #define CONFIG_SYS_INIT_SP_OFFSET \ |
| 336 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
| 337 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 338 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
| 339 | |
Lukasz Majewski | 41b9964 | 2018-05-11 16:51:09 +0200 | [diff] [blame] | 340 | /* Watchdog */ |
Lukasz Majewski | 170d0f9 | 2019-09-03 16:38:45 +0200 | [diff] [blame] | 341 | #if defined(CONFIG_SPL_BUILD) |
| 342 | #undef CONFIG_WDT |
| 343 | #undef CONFIG_WATCHDOG |
| 344 | #define CONFIG_HW_WATCHDOG |
| 345 | #endif |
Lukasz Majewski | 41b9964 | 2018-05-11 16:51:09 +0200 | [diff] [blame] | 346 | |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 347 | /* ENV config */ |
| 348 | #ifdef CONFIG_ENV_IS_IN_SPI_FLASH |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 349 | /* The 0x120000 value corresponds to above SPI-NOR memory MAP */ |
Lukasz Majewski | ce86bf9 | 2017-10-31 17:58:05 +0100 | [diff] [blame] | 350 | #endif |
| 351 | |
| 352 | #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) |
| 353 | #endif /* __CONFIG_H */ |