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