183d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */ 2a3eec24aSLukasz Majewski /* 3a3eec24aSLukasz Majewski * Copyright (C) 2017 4a3eec24aSLukasz Majewski * Lukasz Majewski, DENX Software Engineering, lukma@denx.de 5a3eec24aSLukasz Majewski */ 6a3eec24aSLukasz Majewski 7a3eec24aSLukasz Majewski #ifndef __CONFIG_H 8a3eec24aSLukasz Majewski #define __CONFIG_H 9a3eec24aSLukasz Majewski 10a3eec24aSLukasz Majewski #include "mx6_common.h" 11a3eec24aSLukasz Majewski 12a3eec24aSLukasz Majewski /* Falcon Mode */ 13a3eec24aSLukasz Majewski #define CONFIG_CMD_SPL 14a3eec24aSLukasz Majewski #define CONFIG_SYS_SPL_ARGS_ADDR 0x18000000 15a3eec24aSLukasz Majewski #define CONFIG_CMD_SPL_WRITE_SIZE (44 * SZ_1K) 16a3eec24aSLukasz Majewski 17a3eec24aSLukasz Majewski /* Falcon Mode - MMC support */ 18a3eec24aSLukasz Majewski #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x3F00 19a3eec24aSLukasz Majewski #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS \ 20a3eec24aSLukasz Majewski (CONFIG_CMD_SPL_WRITE_SIZE / 512) 21a3eec24aSLukasz Majewski #define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x100 /* 128KiB */ 22a3eec24aSLukasz Majewski 23a3eec24aSLukasz Majewski /* 24a3eec24aSLukasz Majewski * display5 SPI-NOR memory layout 25a3eec24aSLukasz Majewski * 26a3eec24aSLukasz Majewski * The definition can be found in Kconfig's 27a3eec24aSLukasz Majewski * CONFIG_MTDIDS_DEFAULT and CONFIG_MTDPARTS_DEFAULT 28a3eec24aSLukasz Majewski * 29a3eec24aSLukasz Majewski * 0x000000 - 0x020000 : SPI.SPL (128KiB) 30a3eec24aSLukasz Majewski * 0x020000 - 0x120000 : SPI.u-boot (1MiB) 31a3eec24aSLukasz Majewski * 0x120000 - 0x130000 : SPI.u-boot-env1 (64KiB) 32a3eec24aSLukasz Majewski * 0x130000 - 0x140000 : SPI.u-boot-env2 (64KiB) 331fa328f7SLukasz Majewski * 0x140000 - 0x540000 : SPI.swupdate-kernel-FIT (4MiB) 341fa328f7SLukasz Majewski * 0x540000 - 0x1540000 : SPI.swupdate-initramfs (16MiB) 3586d759eaSLukasz Majewski * 0x1540000 - 0x1640000 : SPI.factory (1MiB) 36a3eec24aSLukasz Majewski */ 37a3eec24aSLukasz Majewski 38a3eec24aSLukasz Majewski #ifndef CONFIG_SPL_BUILD 39a3eec24aSLukasz Majewski #define CONFIG_SPI_FLASH_MTD 40a3eec24aSLukasz Majewski #endif 41a3eec24aSLukasz Majewski 42a3eec24aSLukasz Majewski /* Below values are "dummy" - only to avoid build break */ 43a3eec24aSLukasz Majewski #define CONFIG_SYS_SPI_KERNEL_OFFS 0x150000 44a3eec24aSLukasz Majewski #define CONFIG_SYS_SPI_ARGS_OFFS 0x140000 45a3eec24aSLukasz Majewski #define CONFIG_SYS_SPI_ARGS_SIZE 0x10000 46a3eec24aSLukasz Majewski 47a3eec24aSLukasz Majewski #include "imx6_spl.h" 48a3eec24aSLukasz Majewski #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000 49a3eec24aSLukasz Majewski 50a3eec24aSLukasz Majewski #define CONFIG_CMDLINE_TAG 51a3eec24aSLukasz Majewski #define CONFIG_SETUP_MEMORY_TAGS 52a3eec24aSLukasz Majewski #define CONFIG_INITRD_TAG 53a3eec24aSLukasz Majewski #define CONFIG_REVISION_TAG 54a3eec24aSLukasz Majewski 55a3eec24aSLukasz Majewski /* Size of malloc() pool */ 56a3eec24aSLukasz Majewski #define CONFIG_SYS_MALLOC_LEN (16 * 1024 * 1024) 57a3eec24aSLukasz Majewski 58a3eec24aSLukasz Majewski /*#define CONFIG_MXC_UART*/ 59a3eec24aSLukasz Majewski #define CONFIG_MXC_UART_BASE UART5_BASE 60a3eec24aSLukasz Majewski 61a3eec24aSLukasz Majewski /* SPI NOR Flash */ 62a3eec24aSLukasz Majewski 63a3eec24aSLukasz Majewski /* I2C Configs */ 64a3eec24aSLukasz Majewski #define CONFIG_SYS_I2C 65a3eec24aSLukasz Majewski #define CONFIG_SYS_I2C_MXC 66a3eec24aSLukasz Majewski #define CONFIG_SYS_I2C_MXC_I2C1 67a3eec24aSLukasz Majewski #define CONFIG_SYS_I2C_MXC_I2C2 68a3eec24aSLukasz Majewski #define CONFIG_SYS_I2C_MXC_I2C3 69a3eec24aSLukasz Majewski #define CONFIG_I2C_MULTI_BUS 70a3eec24aSLukasz Majewski #define CONFIG_SYS_I2C_SPEED 100000 71a3eec24aSLukasz Majewski #define CONFIG_I2C_EDID 72a3eec24aSLukasz Majewski #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 73a3eec24aSLukasz Majewski 74a3eec24aSLukasz Majewski /* Ethernet */ 75a3eec24aSLukasz Majewski #ifdef CONFIG_FEC_MXC 76a3eec24aSLukasz Majewski #define IMX_FEC_BASE ENET_BASE_ADDR 77a3eec24aSLukasz Majewski #define CONFIG_FEC_XCV_TYPE RGMII 78a3eec24aSLukasz Majewski #define CONFIG_ETHPRIME "FEC" 79a3eec24aSLukasz Majewski #define CONFIG_FEC_MXC_PHYADDR 0 80a3eec24aSLukasz Majewski #endif 81a3eec24aSLukasz Majewski 82a3eec24aSLukasz Majewski /* MMC Configs */ 83a3eec24aSLukasz Majewski #define CONFIG_FSL_USDHC 84a3eec24aSLukasz Majewski #define CONFIG_SYS_FSL_ESDHC_ADDR 0 85a3eec24aSLukasz Majewski #define CONFIG_SYS_FSL_USDHC_NUM 2 86a3eec24aSLukasz Majewski #define CONFIG_SUPPORT_EMMC_BOOT 87a3eec24aSLukasz Majewski 88a3eec24aSLukasz Majewski /* allow to overwrite serial and ethaddr */ 89a3eec24aSLukasz Majewski #define CONFIG_ENV_OVERWRITE 90a3eec24aSLukasz Majewski #define CONFIG_BAUDRATE 115200 91a3eec24aSLukasz Majewski 92a3eec24aSLukasz Majewski #ifndef CONFIG_BOOTCOMMAND 9327aede24SLukasz Majewski #define CONFIG_BOOTCOMMAND "if run check_em_pad; then " \ 9427aede24SLukasz Majewski "run recovery;" \ 9527aede24SLukasz Majewski "else if test ${BOOT_FROM} = FACTORY; then " \ 9613e012f7SLukasz Majewski "run factory_nfs;" \ 9713e012f7SLukasz Majewski "else " \ 9813e012f7SLukasz Majewski "run boot_mmc;" \ 9927aede24SLukasz Majewski "fi;fi" 100a3eec24aSLukasz Majewski #endif 101a3eec24aSLukasz Majewski 102a3eec24aSLukasz Majewski #define PARTS_DEFAULT \ 103a3eec24aSLukasz Majewski /* Linux partitions */ \ 104a3eec24aSLukasz Majewski "partitions=" \ 105a3eec24aSLukasz Majewski "uuid_disk=${uuid_gpt_disk};" \ 106a3eec24aSLukasz Majewski "name=kernel_raw1,start=128K,size=8M,uuid=${uuid_gpt_kernel_raw1};" \ 107a3eec24aSLukasz Majewski "name=rootfs1,size=1528M,uuid=${uuid_gpt_rootfs1};" \ 108a3eec24aSLukasz Majewski "name=kernel_raw2,size=8M,uuid=${uuid_gpt_kernel_raw2};" \ 1099fea1ca0SLukasz Majewski "name=rootfs2,size=512M,uuid=${uuid_gpt_rootfs2};" \ 110a3eec24aSLukasz Majewski "name=data,size=-,uuid=${uuid_gpt_data}\0" 111a3eec24aSLukasz Majewski 112a3eec24aSLukasz Majewski #define SWUPDATE_RECOVERY_PROCEDURE \ 113a3eec24aSLukasz Majewski "echo '#######################';" \ 114a3eec24aSLukasz Majewski "echo '# RECOVERY SWUupdate #';" \ 115a3eec24aSLukasz Majewski "echo '#######################';" \ 1160f05512dSLukasz Majewski "echo '#######################';" \ 1170f05512dSLukasz Majewski "echo '# GPT verify #';" \ 1180f05512dSLukasz Majewski "if gpt verify mmc ${mmcdev} ${partitions}; then " \ 1190f05512dSLukasz Majewski "echo '# OK ! #';" \ 1200f05512dSLukasz Majewski "else " \ 1210f05512dSLukasz Majewski "echo '# FAILED ! #';" \ 1220f05512dSLukasz Majewski "echo '# GPT RESTORATION #';" \ 1230f05512dSLukasz Majewski "gpt write mmc ${mmcdev} ${partitions};" \ 1240f05512dSLukasz Majewski "fi;" \ 1250f05512dSLukasz Majewski "echo '#######################';" \ 126a3eec24aSLukasz Majewski "setenv loadaddr_swu_initramfs 0x14000000;" \ 127a3eec24aSLukasz Majewski "setenv bootargs console=${console} " \ 128a3eec24aSLukasz Majewski "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \ 129a3eec24aSLukasz Majewski ":${hostname}::off root=/dev/ram rw;" \ 130a3eec24aSLukasz Majewski "sf probe;" \ 131a3eec24aSLukasz Majewski "sf read ${loadaddr} swu-kernel;" \ 132a3eec24aSLukasz Majewski "sf read ${loadaddr_swu_initramfs} swu-initramfs;" \ 1331bcbf48fSLukasz Majewski "bootm ${loadaddr} ${loadaddr_swu_initramfs};reset;" 134a3eec24aSLukasz Majewski 135a3eec24aSLukasz Majewski #define SETUP_BOOTARGS \ 136a3eec24aSLukasz Majewski "run set_rootfs_part;" \ 137a3eec24aSLukasz Majewski "setenv bootargs ${bootargs} console=${console} " \ 138a3eec24aSLukasz Majewski "root=/dev/mmcblk${mmcdev}p${rootfs_part} " \ 139a3eec24aSLukasz Majewski "rootwait rootfstype=ext4 rw; " \ 140a3eec24aSLukasz Majewski "run set_kernel_part;" \ 141a3eec24aSLukasz Majewski "part start mmc ${mmcdev} ${kernel_part} lba_start; " \ 142*f008e260SLukasz Majewski "mmc read ${loadaddr} ${lba_start} ${fitImg_fw_sz}; " \ 143a3eec24aSLukasz Majewski "setenv fdt_conf imx6q-${board}-${display}.dtb; " 144a3eec24aSLukasz Majewski 145a3eec24aSLukasz Majewski /* All the numbers are in LBAs */ 146a3eec24aSLukasz Majewski #define __TFTP_UPDATE_KERNEL \ 147a3eec24aSLukasz Majewski "tftp_mmc_fitImg=" \ 148a3eec24aSLukasz Majewski "if test ! -n ${kernel_part}; then " \ 149a3eec24aSLukasz Majewski "setenv kernel_part ${kernel_part_active};" \ 150a3eec24aSLukasz Majewski "fi;" \ 151a3eec24aSLukasz Majewski "if tftp ${loadaddr} ${kernel_file}; then " \ 152a3eec24aSLukasz Majewski "setexpr fw_sz ${filesize} / 0x200; " \ 153a3eec24aSLukasz Majewski "setexpr fw_sz ${fw_sz} + 1; " \ 154a3eec24aSLukasz Majewski "part start mmc ${mmcdev} ${kernel_part} lba_start; " \ 155a3eec24aSLukasz Majewski "mmc write ${loadaddr} ${lba_start} ${fw_sz}; " \ 156a3eec24aSLukasz Majewski "; fi\0" \ 157a3eec24aSLukasz Majewski 158a3eec24aSLukasz Majewski #define TFTP_UPDATE_KERNEL \ 159a3eec24aSLukasz Majewski "setenv kernel_part ${kernel_part_active};" \ 160a3eec24aSLukasz Majewski "run tftp_mmc_fitImg;" \ 161a3eec24aSLukasz Majewski "setenv kernel_part ${kernel_part_backup};" \ 162a3eec24aSLukasz Majewski "run tftp_mmc_fitImg;" \ 163a3eec24aSLukasz Majewski 164a3eec24aSLukasz Majewski #define __TFTP_UPDATE_ROOTFS \ 165a3eec24aSLukasz Majewski "tftp_mmc_rootfs=" \ 166a3eec24aSLukasz Majewski "if test ! -n ${rootfs_part}; then " \ 167a3eec24aSLukasz Majewski "setenv rootfs_part ${rootfs_part_active};" \ 168a3eec24aSLukasz Majewski "fi;" \ 169a3eec24aSLukasz Majewski "if tftp ${loadaddr} ${rootfs_file}; then " \ 170a3eec24aSLukasz Majewski "setexpr fw_sz ${filesize} / 0x200; " \ 171a3eec24aSLukasz Majewski "setexpr fw_sz ${fw_sz} + 1; " \ 172a3eec24aSLukasz Majewski "part start mmc ${mmcdev} ${rootfs_part} lba_start; " \ 173a3eec24aSLukasz Majewski "mmc write ${loadaddr} ${lba_start} ${fw_sz}; " \ 174a3eec24aSLukasz Majewski "; fi\0" \ 175a3eec24aSLukasz Majewski 176a3eec24aSLukasz Majewski #define TFTP_UPDATE_ROOTFS \ 177a3eec24aSLukasz Majewski "setenv rootfs_part ${rootfs_part_active};" \ 178a3eec24aSLukasz Majewski "run tftp_mmc_rootfs;" \ 17918ccca59SLukasz Majewski "run tftp_mmc_rootfs_bkp;" \ 18018ccca59SLukasz Majewski 181a3eec24aSLukasz Majewski 182a3eec24aSLukasz Majewski #define TFTP_UPDATE_RECOVERY_SWU_KERNEL \ 183a3eec24aSLukasz Majewski "tftp_sf_fitImg_SWU=" \ 184a3eec24aSLukasz Majewski "if tftp ${loadaddr} ${kernel_file}; then " \ 185a3eec24aSLukasz Majewski "sf probe;" \ 186a3eec24aSLukasz Majewski "sf erase swu-kernel +${filesize};" \ 187a3eec24aSLukasz Majewski "sf write ${loadaddr} swu-kernel ${filesize};" \ 188a3eec24aSLukasz Majewski "; fi\0" \ 189a3eec24aSLukasz Majewski 190a3eec24aSLukasz Majewski #define TFTP_UPDATE_RECOVERY_SWU_INITRAMFS \ 191b5f4543cSLukasz Majewski "swu_initramfs_file=swupdate-image-display5.ext4.gz.u-boot\0" \ 192a3eec24aSLukasz Majewski "tftp_sf_initramfs_SWU=" \ 193a3eec24aSLukasz Majewski "if tftp ${loadaddr} ${swu_initramfs_file}; then " \ 194a3eec24aSLukasz Majewski "sf probe;" \ 195a3eec24aSLukasz Majewski "sf erase swu-initramfs +${filesize};" \ 196a3eec24aSLukasz Majewski "sf write ${loadaddr} swu-initramfs ${filesize};" \ 197a3eec24aSLukasz Majewski "; fi\0" \ 198a3eec24aSLukasz Majewski 199a3eec24aSLukasz Majewski #define TFTP_UPDATE_BOOTLOADER \ 200a3eec24aSLukasz Majewski "ubootfile=u-boot.img\0" \ 201a3eec24aSLukasz Majewski "ubootfileSPL=SPL\0" \ 202a3eec24aSLukasz Majewski "tftp_sf_uboot=" \ 203a3eec24aSLukasz Majewski "if tftp ${loadaddr} ${ubootfile}; then " \ 204a3eec24aSLukasz Majewski "sf probe;" \ 205a3eec24aSLukasz Majewski "sf erase u-boot +${filesize};" \ 206a3eec24aSLukasz Majewski "sf write ${loadaddr} u-boot ${filesize}" \ 207a3eec24aSLukasz Majewski "; fi\0" \ 208a3eec24aSLukasz Majewski "tftp_sf_SPL=" \ 209a3eec24aSLukasz Majewski "if tftp ${loadaddr} ${ubootfileSPL}; then " \ 210a3eec24aSLukasz Majewski "sf probe;" \ 211a3eec24aSLukasz Majewski "setexpr uboot_SPL_size ${filesize} + 0x400;" \ 212a3eec24aSLukasz Majewski "sf erase 0x0 +${uboot_SPL_size};" \ 213a3eec24aSLukasz Majewski "sf write ${loadaddr} 0x400 ${filesize};" \ 214a3eec24aSLukasz Majewski "fi\0" \ 215a3eec24aSLukasz Majewski 2162f4372a1SLukasz Majewski #define TFTP_UPDATE_SPINOR \ 2172f4372a1SLukasz Majewski "spinorfile=core-image-lwn-display5.spinor\0" \ 2182f4372a1SLukasz Majewski "spinorsize=0x2000000\0" \ 2192f4372a1SLukasz Majewski "tftp_sf_img=" \ 2202f4372a1SLukasz Majewski "if tftp ${loadaddr} ${spinorfile}; then " \ 2212f4372a1SLukasz Majewski "sf probe;" \ 2222f4372a1SLukasz Majewski "sf erase 0x0 ${spinorsize};" \ 2232f4372a1SLukasz Majewski "sf write ${loadaddr} 0x0 ${filesize};" \ 2242f4372a1SLukasz Majewski "fi\0" \ 2252f4372a1SLukasz Majewski 226a3eec24aSLukasz Majewski #define CONFIG_EXTRA_ENV_SETTINGS \ 227a3eec24aSLukasz Majewski PARTS_DEFAULT \ 22827aede24SLukasz Majewski "gpio_recovery=93\0" \ 22927aede24SLukasz Majewski "check_em_pad=gpio input ${gpio_recovery};test $? -eq 0;\0" \ 230a3eec24aSLukasz Majewski "display=tianma-tm070-800x480\0" \ 231a3eec24aSLukasz Majewski "board=display5\0" \ 232a3eec24aSLukasz Majewski "mmcdev=0\0" \ 233a3eec24aSLukasz Majewski "altbootcmd=run recovery\0" \ 234a3eec24aSLukasz Majewski "bootdelay=1\0" \ 235a3eec24aSLukasz Majewski "baudrate=115200\0" \ 236a3eec24aSLukasz Majewski "bootcmd=" CONFIG_BOOTCOMMAND "\0" \ 237a3eec24aSLukasz Majewski "ethact=FEC\0" \ 238a3eec24aSLukasz Majewski "netdev=eth0\0" \ 239a3eec24aSLukasz Majewski "boot_os=y\0" \ 240a3eec24aSLukasz Majewski "hostname=display5\0" \ 241a3eec24aSLukasz Majewski "loadaddr=0x12000000\0" \ 242a3eec24aSLukasz Majewski "fdtaddr=0x12800000\0" \ 2435d925409SLukasz Majewski "console=ttymxc4,115200 quiet cma=256M\0" \ 244a3eec24aSLukasz Majewski "fdtfile=imx6q-display5.dtb\0" \ 245a3eec24aSLukasz Majewski "fdt_high=0xffffffff\0" \ 246a3eec24aSLukasz Majewski "initrd_high=0xffffffff\0" \ 247a3eec24aSLukasz Majewski "kernel_file=fitImage\0" \ 248*f008e260SLukasz Majewski "fitImg_fw_sz=0x2200\0" \ 249a3eec24aSLukasz Majewski "up=run tftp_sf_SPL; run tftp_sf_uboot\0" \ 250a3eec24aSLukasz Majewski "download_kernel=" \ 251a3eec24aSLukasz Majewski "tftpboot ${loadaddr} ${kernel_file};\0" \ 25213e012f7SLukasz Majewski "factory_nfs=" \ 2534864ba7fSLukasz Majewski "setenv ipaddr 192.168.1.102;" \ 2544864ba7fSLukasz Majewski "setenv gatewayip 192.168.1.1;" \ 2554864ba7fSLukasz Majewski "setenv netmask 255.255.255.0;" \ 2564864ba7fSLukasz Majewski "setenv serverip 192.168.1.2;" \ 25713e012f7SLukasz Majewski "echo BOOT: FACTORY (LEG);" \ 25813e012f7SLukasz Majewski "run boot_nfs\0" \ 259a3eec24aSLukasz Majewski "boot_swu_recovery=" SWUPDATE_RECOVERY_PROCEDURE "\0" \ 260a3eec24aSLukasz Majewski "recovery=" \ 261a3eec24aSLukasz Majewski "echo BOOT: RECOVERY: SWU;" \ 262b78e9c4fSLukasz Majewski "run boot_swu_recovery\0" \ 263a3eec24aSLukasz Majewski "boot_tftp=" \ 264a3eec24aSLukasz Majewski "if run download_kernel; then " \ 265a3eec24aSLukasz Majewski "setenv bootargs console=${console} " \ 266a3eec24aSLukasz Majewski "root=/dev/mmcblk0p2 rootwait;" \ 2671bcbf48fSLukasz Majewski "bootm ${loadaddr} - ${fdtaddr};reset;" \ 268a3eec24aSLukasz Majewski "fi\0" \ 269a3eec24aSLukasz Majewski "addip=setenv bootargs ${bootargs} " \ 270a3eec24aSLukasz Majewski "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:" \ 271a3eec24aSLukasz Majewski "${hostname}:eth0:on" \ 272a3eec24aSLukasz Majewski "\0" \ 273a3eec24aSLukasz Majewski "nfsargs=setenv bootargs " \ 274a3eec24aSLukasz Majewski "root=/dev/nfs rw " \ 275a3eec24aSLukasz Majewski "nfsroot=${serverip}:${rootpath},nolock,nfsvers=3" \ 276a3eec24aSLukasz Majewski "\0" \ 277a3eec24aSLukasz Majewski "rootpath=/srv/tftp/DISP5/rootfs\0" \ 278a3eec24aSLukasz Majewski "boot_nfs=" \ 279a3eec24aSLukasz Majewski "if run download_kernel; then " \ 280a3eec24aSLukasz Majewski "run nfsargs;" \ 281a3eec24aSLukasz Majewski "run addip;" \ 282a3eec24aSLukasz Majewski "setenv bootargs ${bootargs} console=${console};" \ 283a3eec24aSLukasz Majewski "setenv fdt_conf imx6q-${board}-${display}.dtb; " \ 2841bcbf48fSLukasz Majewski "bootm ${loadaddr}#conf@${fdt_conf};reset;" \ 285a3eec24aSLukasz Majewski "fi\0" \ 286a3eec24aSLukasz Majewski "falcon_setup=" \ 287a3eec24aSLukasz Majewski "if mmc dev ${mmcdev}; then " \ 288a3eec24aSLukasz Majewski SETUP_BOOTARGS \ 289a3eec24aSLukasz Majewski "spl export fdt ${loadaddr}#conf@${fdt_conf};" \ 290a3eec24aSLukasz Majewski "setexpr fw_sz ${fdtargslen} / 0x200; " \ 291a3eec24aSLukasz Majewski "setexpr fw_sz ${fw_sz} + 1; " \ 292a3eec24aSLukasz Majewski "mmc write ${fdtargsaddr} " \ 293a3eec24aSLukasz Majewski __stringify(CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR)" ${fw_sz}; " \ 294a3eec24aSLukasz Majewski "fi\0" \ 295a3eec24aSLukasz Majewski "boot_mmc=" \ 296a3eec24aSLukasz Majewski "if mmc dev ${mmcdev}; then " \ 297a3eec24aSLukasz Majewski SETUP_BOOTARGS \ 2981bcbf48fSLukasz Majewski "bootm ${loadaddr}#conf@${fdt_conf};reset;" \ 299a3eec24aSLukasz Majewski "fi\0" \ 300a3eec24aSLukasz Majewski "set_kernel_part=" \ 301a3eec24aSLukasz Majewski "if test ${BOOT_FROM} = ACTIVE; then " \ 302a3eec24aSLukasz Majewski "setenv kernel_part ${kernel_part_active};" \ 303a3eec24aSLukasz Majewski "echo BOOT: ACTIVE;" \ 304a3eec24aSLukasz Majewski "else if test ${BOOT_FROM} = BACKUP; then " \ 305a3eec24aSLukasz Majewski "setenv kernel_part ${kernel_part_backup};" \ 306a3eec24aSLukasz Majewski "echo BOOT: BACKUP;" \ 307a3eec24aSLukasz Majewski "else " \ 308a3eec24aSLukasz Majewski "run recovery;" \ 309a3eec24aSLukasz Majewski "fi;fi\0" \ 310a3eec24aSLukasz Majewski "set_rootfs_part=" \ 311a3eec24aSLukasz Majewski "if test ${BOOT_FROM} = ACTIVE; then " \ 312a3eec24aSLukasz Majewski "setenv rootfs_part ${rootfs_part_active};" \ 313a3eec24aSLukasz Majewski "else if test ${BOOT_FROM} = BACKUP; then " \ 314a3eec24aSLukasz Majewski "setenv rootfs_part ${rootfs_part_backup};" \ 315a3eec24aSLukasz Majewski "else " \ 316a3eec24aSLukasz Majewski "run recovery;" \ 317a3eec24aSLukasz Majewski "fi;fi\0" \ 318a3eec24aSLukasz Majewski "BOOT_FROM=ACTIVE\0" \ 319a3eec24aSLukasz Majewski TFTP_UPDATE_BOOTLOADER \ 3202f4372a1SLukasz Majewski TFTP_UPDATE_SPINOR \ 321a3eec24aSLukasz Majewski "kernel_part_active=1\0" \ 322a3eec24aSLukasz Majewski "kernel_part_backup=3\0" \ 323a3eec24aSLukasz Majewski __TFTP_UPDATE_KERNEL \ 324a3eec24aSLukasz Majewski "rootfs_part_active=2\0" \ 325a3eec24aSLukasz Majewski "rootfs_part_backup=4\0" \ 326a3eec24aSLukasz Majewski "rootfs_file=core-image-lwn-display5.ext4\0" \ 327dd4ed88bSLukasz Majewski "rootfs_file_backup=core-image-lwn-backup-display5.ext4\0" \ 328a3eec24aSLukasz Majewski __TFTP_UPDATE_ROOTFS \ 329dd4ed88bSLukasz Majewski "tftp_mmc_rootfs_bkp=" \ 330dd4ed88bSLukasz Majewski "setenv rootfs_part ${rootfs_part_backup};" \ 331dd4ed88bSLukasz Majewski "setenv rootfs_file ${rootfs_file_backup};" \ 332dd4ed88bSLukasz Majewski "run tftp_mmc_rootfs\0" \ 333a3eec24aSLukasz Majewski TFTP_UPDATE_RECOVERY_SWU_KERNEL \ 334a3eec24aSLukasz Majewski TFTP_UPDATE_RECOVERY_SWU_INITRAMFS \ 335a3eec24aSLukasz Majewski "\0" \ 336a3eec24aSLukasz Majewski 337a3eec24aSLukasz Majewski /* Miscellaneous configurable options */ 338a3eec24aSLukasz Majewski #undef CONFIG_SYS_CBSIZE 339a3eec24aSLukasz Majewski #define CONFIG_SYS_CBSIZE 2048 340a3eec24aSLukasz Majewski 341a3eec24aSLukasz Majewski /* Print Buffer Size */ 342a3eec24aSLukasz Majewski #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ 343a3eec24aSLukasz Majewski sizeof(CONFIG_SYS_PROMPT) + 16) 344a3eec24aSLukasz Majewski #define CONFIG_SYS_MAXARGS 32 345a3eec24aSLukasz Majewski #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE 346a3eec24aSLukasz Majewski 347a3eec24aSLukasz Majewski #define CONFIG_STANDALONE_LOAD_ADDR 0x10001000 348a3eec24aSLukasz Majewski #define CONFIG_SYS_HZ 1000 349a3eec24aSLukasz Majewski 350a3eec24aSLukasz Majewski /* Physical Memory Map */ 351a3eec24aSLukasz Majewski #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR 352a3eec24aSLukasz Majewski #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM 353a3eec24aSLukasz Majewski 354a3eec24aSLukasz Majewski #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR 355a3eec24aSLukasz Majewski #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE 356a3eec24aSLukasz Majewski 357a3eec24aSLukasz Majewski #define CONFIG_SYS_INIT_SP_OFFSET \ 358a3eec24aSLukasz Majewski (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) 359a3eec24aSLukasz Majewski #define CONFIG_SYS_INIT_SP_ADDR \ 360a3eec24aSLukasz Majewski (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) 361a3eec24aSLukasz Majewski 362a3eec24aSLukasz Majewski /* Commands */ 363a3eec24aSLukasz Majewski 36476d1d169SLukasz Majewski /* Watchdog */ 36576d1d169SLukasz Majewski #define CONFIG_WATCHDOG_TIMEOUT_MSECS 15000 36676d1d169SLukasz Majewski 367a3eec24aSLukasz Majewski /* ENV config */ 368a3eec24aSLukasz Majewski #ifdef CONFIG_ENV_IS_IN_SPI_FLASH 369a3eec24aSLukasz Majewski #define CONFIG_ENV_SIZE (SZ_64K) 370a3eec24aSLukasz Majewski /* The 0x120000 value corresponds to above SPI-NOR memory MAP */ 371a3eec24aSLukasz Majewski #define CONFIG_ENV_OFFSET (0x120000) 372a3eec24aSLukasz Majewski #define CONFIG_ENV_SECT_SIZE (SZ_64K) 373a3eec24aSLukasz Majewski #define CONFIG_SYS_REDUNDAND_ENVIRONMENT 374a3eec24aSLukasz Majewski #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \ 375a3eec24aSLukasz Majewski CONFIG_ENV_SECT_SIZE) 376a3eec24aSLukasz Majewski #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE 377a3eec24aSLukasz Majewski #endif 378a3eec24aSLukasz Majewski 379a3eec24aSLukasz Majewski #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) 380a3eec24aSLukasz Majewski #endif /* __CONFIG_H */ 381