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) 33a3eec24aSLukasz Majewski * 0x140000 - 0x940000 : SPI.fitImage-recovery (8MiB) 34a3eec24aSLukasz Majewski * 0x940000 - 0xD40000 : SPI.swupdate-kernel-FIT (4MiB) 35a3eec24aSLukasz Majewski * 0xD40000 - 0x1540000 : SPI.swupdate-initramfs (8MiB) 36a3eec24aSLukasz Majewski */ 37a3eec24aSLukasz Majewski 38a3eec24aSLukasz Majewski #ifndef CONFIG_SPL_BUILD 39a3eec24aSLukasz Majewski #define CONFIG_MTD_DEVICE 40a3eec24aSLukasz Majewski #define CONFIG_SPI_FLASH_MTD 41a3eec24aSLukasz Majewski #define CONFIG_MTD_PARTITIONS 42a3eec24aSLukasz Majewski #endif 43a3eec24aSLukasz Majewski 44a3eec24aSLukasz Majewski /* Below values are "dummy" - only to avoid build break */ 45a3eec24aSLukasz Majewski #define CONFIG_SYS_SPI_KERNEL_OFFS 0x150000 46a3eec24aSLukasz Majewski #define CONFIG_SYS_SPI_ARGS_OFFS 0x140000 47a3eec24aSLukasz Majewski #define CONFIG_SYS_SPI_ARGS_SIZE 0x10000 48a3eec24aSLukasz Majewski 49a3eec24aSLukasz Majewski #include "imx6_spl.h" 50a3eec24aSLukasz Majewski #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000 51a3eec24aSLukasz Majewski 52a3eec24aSLukasz Majewski #define CONFIG_CMDLINE_TAG 53a3eec24aSLukasz Majewski #define CONFIG_SETUP_MEMORY_TAGS 54a3eec24aSLukasz Majewski #define CONFIG_INITRD_TAG 55a3eec24aSLukasz Majewski #define CONFIG_REVISION_TAG 56a3eec24aSLukasz Majewski 57a3eec24aSLukasz Majewski /* Size of malloc() pool */ 58a3eec24aSLukasz Majewski #define CONFIG_SYS_MALLOC_LEN (16 * 1024 * 1024) 59a3eec24aSLukasz Majewski #define CONFIG_MISC_INIT_R 60a3eec24aSLukasz Majewski 61a3eec24aSLukasz Majewski /*#define CONFIG_MXC_UART*/ 62a3eec24aSLukasz Majewski #define CONFIG_MXC_UART_BASE UART5_BASE 63a3eec24aSLukasz Majewski 64a3eec24aSLukasz Majewski /* SPI NOR Flash */ 65a3eec24aSLukasz Majewski #ifdef CONFIG_CMD_SF 66a3eec24aSLukasz Majewski #define CONFIG_SF_DEFAULT_BUS 1 67a3eec24aSLukasz Majewski #define CONFIG_SF_DEFAULT_CS (0 | (IMX_GPIO_NR(5, 29) << 8)) 68a3eec24aSLukasz Majewski #define CONFIG_SF_DEFAULT_SPEED 50000000 69a3eec24aSLukasz Majewski #define CONFIG_SF_DEFAULT_MODE SPI_MODE_0 70a3eec24aSLukasz Majewski #endif 71a3eec24aSLukasz Majewski 72a3eec24aSLukasz Majewski /* I2C Configs */ 73a3eec24aSLukasz Majewski #define CONFIG_SYS_I2C 74a3eec24aSLukasz Majewski #define CONFIG_SYS_I2C_MXC 75a3eec24aSLukasz Majewski #define CONFIG_SYS_I2C_MXC_I2C1 76a3eec24aSLukasz Majewski #define CONFIG_SYS_I2C_MXC_I2C2 77a3eec24aSLukasz Majewski #define CONFIG_SYS_I2C_MXC_I2C3 78a3eec24aSLukasz Majewski #define CONFIG_I2C_MULTI_BUS 79a3eec24aSLukasz Majewski #define CONFIG_SYS_I2C_SPEED 100000 80a3eec24aSLukasz Majewski #define CONFIG_I2C_EDID 81a3eec24aSLukasz Majewski #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 82a3eec24aSLukasz Majewski 83a3eec24aSLukasz Majewski /* Ethernet */ 84a3eec24aSLukasz Majewski #ifdef CONFIG_FEC_MXC 85a3eec24aSLukasz Majewski #define IMX_FEC_BASE ENET_BASE_ADDR 86a3eec24aSLukasz Majewski #define CONFIG_FEC_XCV_TYPE RGMII 87a3eec24aSLukasz Majewski #define CONFIG_ETHPRIME "FEC" 88a3eec24aSLukasz Majewski #define CONFIG_FEC_MXC_PHYADDR 0 89a3eec24aSLukasz Majewski #define CONFIG_MII 90a3eec24aSLukasz Majewski #endif 91a3eec24aSLukasz Majewski 92a3eec24aSLukasz Majewski /* MMC Configs */ 93a3eec24aSLukasz Majewski #define CONFIG_FSL_USDHC 94a3eec24aSLukasz Majewski #define CONFIG_SYS_FSL_ESDHC_ADDR 0 95a3eec24aSLukasz Majewski #define CONFIG_SYS_FSL_USDHC_NUM 2 96a3eec24aSLukasz Majewski #define CONFIG_SUPPORT_EMMC_BOOT 97a3eec24aSLukasz Majewski 98a3eec24aSLukasz Majewski /* allow to overwrite serial and ethaddr */ 99a3eec24aSLukasz Majewski #define CONFIG_ENV_OVERWRITE 100a3eec24aSLukasz Majewski #define CONFIG_BAUDRATE 115200 101a3eec24aSLukasz Majewski 102a3eec24aSLukasz Majewski #ifndef CONFIG_BOOTCOMMAND 103*13e012f7SLukasz Majewski #define CONFIG_BOOTCOMMAND "if test ${BOOT_FROM} = FACTORY; then " \ 104*13e012f7SLukasz Majewski "run factory_nfs;" \ 105*13e012f7SLukasz Majewski "else " \ 106*13e012f7SLukasz Majewski "run boot_mmc;" \ 107*13e012f7SLukasz Majewski "fi" 108a3eec24aSLukasz Majewski #endif 109a3eec24aSLukasz Majewski 110a3eec24aSLukasz Majewski #define PARTS_DEFAULT \ 111a3eec24aSLukasz Majewski /* Linux partitions */ \ 112a3eec24aSLukasz Majewski "partitions=" \ 113a3eec24aSLukasz Majewski "uuid_disk=${uuid_gpt_disk};" \ 114a3eec24aSLukasz Majewski "name=kernel_raw1,start=128K,size=8M,uuid=${uuid_gpt_kernel_raw1};" \ 115a3eec24aSLukasz Majewski "name=rootfs1,size=1528M,uuid=${uuid_gpt_rootfs1};" \ 116a3eec24aSLukasz Majewski "name=kernel_raw2,size=8M,uuid=${uuid_gpt_kernel_raw2};" \ 117a3eec24aSLukasz Majewski "name=rootfs2,size=1528M,uuid=${uuid_gpt_rootfs2};" \ 118a3eec24aSLukasz Majewski "name=data,size=-,uuid=${uuid_gpt_data}\0" 119a3eec24aSLukasz Majewski 120a3eec24aSLukasz Majewski #define FACTORY_PROCEDURE \ 121a3eec24aSLukasz Majewski "echo '#######################';" \ 122a3eec24aSLukasz Majewski "echo '# Factory Boot #';" \ 123a3eec24aSLukasz Majewski "echo '#######################';" \ 124a3eec24aSLukasz Majewski "env default -a;" \ 125a3eec24aSLukasz Majewski "saveenv;" \ 126a3eec24aSLukasz Majewski "gpt write mmc ${mmcdev} ${partitions};" \ 127a3eec24aSLukasz Majewski "run tftp_sf_SPL;" \ 128a3eec24aSLukasz Majewski "run tftp_sf_uboot;" \ 129a3eec24aSLukasz Majewski TFTP_UPDATE_KERNEL \ 130a3eec24aSLukasz Majewski "run tftp_sf_fitImg_recovery;" \ 131a3eec24aSLukasz Majewski "run tftp_sf_fitImg_SWU;" \ 132a3eec24aSLukasz Majewski "run tftp_sf_initramfs_SWU;" \ 133a3eec24aSLukasz Majewski TFTP_UPDATE_ROOTFS \ 134a3eec24aSLukasz Majewski "echo '#######################';" \ 135a3eec24aSLukasz Majewski "echo '# END - OK #';" \ 136a3eec24aSLukasz Majewski "echo '#######################';" \ 137a3eec24aSLukasz Majewski "setenv bootcmd 'env default -a; saveenv; run falcon_setup; reset';" \ 138a3eec24aSLukasz Majewski "setenv boot_os 'n';" \ 139a3eec24aSLukasz Majewski "saveenv;" \ 140a3eec24aSLukasz Majewski "reset;" 141a3eec24aSLukasz Majewski 142a3eec24aSLukasz Majewski #define SWUPDATE_RECOVERY_PROCEDURE \ 143a3eec24aSLukasz Majewski "echo '#######################';" \ 144a3eec24aSLukasz Majewski "echo '# RECOVERY SWUupdate #';" \ 145a3eec24aSLukasz Majewski "echo '#######################';" \ 146a3eec24aSLukasz Majewski "setenv loadaddr_swu_initramfs 0x14000000;" \ 147a3eec24aSLukasz Majewski "setenv bootargs console=${console} " \ 148a3eec24aSLukasz Majewski "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \ 149a3eec24aSLukasz Majewski ":${hostname}::off root=/dev/ram rw;" \ 150a3eec24aSLukasz Majewski "sf probe;" \ 151a3eec24aSLukasz Majewski "sf read ${loadaddr} swu-kernel;" \ 152a3eec24aSLukasz Majewski "sf read ${loadaddr_swu_initramfs} swu-initramfs;" \ 153a3eec24aSLukasz Majewski "bootm ${loadaddr} ${loadaddr_swu_initramfs};" 154a3eec24aSLukasz Majewski 155a3eec24aSLukasz Majewski #define KERNEL_RECOVERY_PROCEDURE \ 156a3eec24aSLukasz Majewski "echo '#######################';" \ 157a3eec24aSLukasz Majewski "echo '# RECOVERY KERNEL IMG #';" \ 158a3eec24aSLukasz Majewski "echo '#######################';" \ 159a3eec24aSLukasz Majewski "sf probe;" \ 160a3eec24aSLukasz Majewski "sf read ${loadaddr} lin-recovery;" \ 161a3eec24aSLukasz Majewski "bootm;" 162a3eec24aSLukasz Majewski 163a3eec24aSLukasz Majewski #define SETUP_BOOTARGS \ 164a3eec24aSLukasz Majewski "run set_rootfs_part;" \ 165a3eec24aSLukasz Majewski "setenv bootargs ${bootargs} console=${console} " \ 166a3eec24aSLukasz Majewski "root=/dev/mmcblk${mmcdev}p${rootfs_part} " \ 167a3eec24aSLukasz Majewski "rootwait rootfstype=ext4 rw; " \ 168a3eec24aSLukasz Majewski "run set_kernel_part;" \ 169a3eec24aSLukasz Majewski "part start mmc ${mmcdev} ${kernel_part} lba_start; " \ 170a3eec24aSLukasz Majewski "mmc read ${loadaddr} ${lba_start} 0x2000; " \ 171a3eec24aSLukasz Majewski "setenv fdt_conf imx6q-${board}-${display}.dtb; " 172a3eec24aSLukasz Majewski 173a3eec24aSLukasz Majewski /* All the numbers are in LBAs */ 174a3eec24aSLukasz Majewski #define __TFTP_UPDATE_KERNEL \ 175a3eec24aSLukasz Majewski "tftp_mmc_fitImg=" \ 176a3eec24aSLukasz Majewski "if test ! -n ${kernel_part}; then " \ 177a3eec24aSLukasz Majewski "setenv kernel_part ${kernel_part_active};" \ 178a3eec24aSLukasz Majewski "fi;" \ 179a3eec24aSLukasz Majewski "if tftp ${loadaddr} ${kernel_file}; then " \ 180a3eec24aSLukasz Majewski "setexpr fw_sz ${filesize} / 0x200; " \ 181a3eec24aSLukasz Majewski "setexpr fw_sz ${fw_sz} + 1; " \ 182a3eec24aSLukasz Majewski "part start mmc ${mmcdev} ${kernel_part} lba_start; " \ 183a3eec24aSLukasz Majewski "mmc write ${loadaddr} ${lba_start} ${fw_sz}; " \ 184a3eec24aSLukasz Majewski "; fi\0" \ 185a3eec24aSLukasz Majewski 186a3eec24aSLukasz Majewski #define TFTP_UPDATE_KERNEL \ 187a3eec24aSLukasz Majewski "setenv kernel_part ${kernel_part_active};" \ 188a3eec24aSLukasz Majewski "run tftp_mmc_fitImg;" \ 189a3eec24aSLukasz Majewski "setenv kernel_part ${kernel_part_backup};" \ 190a3eec24aSLukasz Majewski "run tftp_mmc_fitImg;" \ 191a3eec24aSLukasz Majewski 192a3eec24aSLukasz Majewski #define __TFTP_UPDATE_ROOTFS \ 193a3eec24aSLukasz Majewski "tftp_mmc_rootfs=" \ 194a3eec24aSLukasz Majewski "if test ! -n ${rootfs_part}; then " \ 195a3eec24aSLukasz Majewski "setenv rootfs_part ${rootfs_part_active};" \ 196a3eec24aSLukasz Majewski "fi;" \ 197a3eec24aSLukasz Majewski "if tftp ${loadaddr} ${rootfs_file}; then " \ 198a3eec24aSLukasz Majewski "setexpr fw_sz ${filesize} / 0x200; " \ 199a3eec24aSLukasz Majewski "setexpr fw_sz ${fw_sz} + 1; " \ 200a3eec24aSLukasz Majewski "part start mmc ${mmcdev} ${rootfs_part} lba_start; " \ 201a3eec24aSLukasz Majewski "mmc write ${loadaddr} ${lba_start} ${fw_sz}; " \ 202a3eec24aSLukasz Majewski "; fi\0" \ 203a3eec24aSLukasz Majewski 204a3eec24aSLukasz Majewski /* To save some considerable time, we only once download the rootfs image */ 205a3eec24aSLukasz Majewski /* and store it on 'active' and 'backup' rootfs partitions */ 206a3eec24aSLukasz Majewski #define TFTP_UPDATE_ROOTFS \ 207a3eec24aSLukasz Majewski "setenv rootfs_part ${rootfs_part_active};" \ 208a3eec24aSLukasz Majewski "run tftp_mmc_rootfs;" \ 209a3eec24aSLukasz Majewski "part start mmc ${mmcdev} ${rootfs_part_backup} lba_start;" \ 210a3eec24aSLukasz Majewski "mmc write ${loadaddr} ${lba_start} ${fw_sz};" \ 211a3eec24aSLukasz Majewski 212a3eec24aSLukasz Majewski #define TFTP_UPDATE_RECOVERY_SWU_KERNEL \ 213a3eec24aSLukasz Majewski "tftp_sf_fitImg_SWU=" \ 214a3eec24aSLukasz Majewski "if tftp ${loadaddr} ${kernel_file}; then " \ 215a3eec24aSLukasz Majewski "sf probe;" \ 216a3eec24aSLukasz Majewski "sf erase swu-kernel +${filesize};" \ 217a3eec24aSLukasz Majewski "sf write ${loadaddr} swu-kernel ${filesize};" \ 218a3eec24aSLukasz Majewski "; fi\0" \ 219a3eec24aSLukasz Majewski 220a3eec24aSLukasz Majewski #define TFTP_UPDATE_RECOVERY_SWU_INITRAMFS \ 221a3eec24aSLukasz Majewski "swu_initramfs_file=swupdate-image-display5.ext3.gz.u-boot\0" \ 222a3eec24aSLukasz Majewski "tftp_sf_initramfs_SWU=" \ 223a3eec24aSLukasz Majewski "if tftp ${loadaddr} ${swu_initramfs_file}; then " \ 224a3eec24aSLukasz Majewski "sf probe;" \ 225a3eec24aSLukasz Majewski "sf erase swu-initramfs +${filesize};" \ 226a3eec24aSLukasz Majewski "sf write ${loadaddr} swu-initramfs ${filesize};" \ 227a3eec24aSLukasz Majewski "; fi\0" \ 228a3eec24aSLukasz Majewski 229a3eec24aSLukasz Majewski #define TFTP_UPDATE_RECOVERY_KERNEL_INITRAMFS \ 230a3eec24aSLukasz Majewski "kernel_recovery_file=fitImage-initramfs\0" \ 231a3eec24aSLukasz Majewski "tftp_sf_fitImg_recovery=" \ 232a3eec24aSLukasz Majewski "if tftp ${loadaddr} ${kernel_recovery_file}; then " \ 233a3eec24aSLukasz Majewski "sf probe;" \ 234a3eec24aSLukasz Majewski "sf erase lin-recovery +${filesize};" \ 235a3eec24aSLukasz Majewski "sf write ${loadaddr} lin-recovery ${filesize};" \ 236a3eec24aSLukasz Majewski "; fi\0" \ 237a3eec24aSLukasz Majewski 238a3eec24aSLukasz Majewski #define TFTP_UPDATE_BOOTLOADER \ 239a3eec24aSLukasz Majewski "ubootfile=u-boot.img\0" \ 240a3eec24aSLukasz Majewski "ubootfileSPL=SPL\0" \ 241a3eec24aSLukasz Majewski "tftp_sf_uboot=" \ 242a3eec24aSLukasz Majewski "if tftp ${loadaddr} ${ubootfile}; then " \ 243a3eec24aSLukasz Majewski "sf probe;" \ 244a3eec24aSLukasz Majewski "sf erase u-boot +${filesize};" \ 245a3eec24aSLukasz Majewski "sf write ${loadaddr} u-boot ${filesize}" \ 246a3eec24aSLukasz Majewski "; fi\0" \ 247a3eec24aSLukasz Majewski "tftp_sf_SPL=" \ 248a3eec24aSLukasz Majewski "if tftp ${loadaddr} ${ubootfileSPL}; then " \ 249a3eec24aSLukasz Majewski "sf probe;" \ 250a3eec24aSLukasz Majewski "setexpr uboot_SPL_size ${filesize} + 0x400;" \ 251a3eec24aSLukasz Majewski "sf erase 0x0 +${uboot_SPL_size};" \ 252a3eec24aSLukasz Majewski "sf write ${loadaddr} 0x400 ${filesize};" \ 253a3eec24aSLukasz Majewski "fi\0" \ 254a3eec24aSLukasz Majewski 255a3eec24aSLukasz Majewski #define CONFIG_EXTRA_ENV_SETTINGS \ 256a3eec24aSLukasz Majewski PARTS_DEFAULT \ 257a3eec24aSLukasz Majewski "display=tianma-tm070-800x480\0" \ 258a3eec24aSLukasz Majewski "board=display5\0" \ 259a3eec24aSLukasz Majewski "mmcdev=0\0" \ 260a3eec24aSLukasz Majewski "altbootcmd=run recovery\0" \ 261a3eec24aSLukasz Majewski "bootdelay=1\0" \ 262a3eec24aSLukasz Majewski "baudrate=115200\0" \ 263a3eec24aSLukasz Majewski "bootcmd=" CONFIG_BOOTCOMMAND "\0" \ 264a3eec24aSLukasz Majewski "factory=" FACTORY_PROCEDURE "\0" \ 265a3eec24aSLukasz Majewski "bootlimit=3\0" \ 266a3eec24aSLukasz Majewski "ethact=FEC\0" \ 267a3eec24aSLukasz Majewski "netdev=eth0\0" \ 268a3eec24aSLukasz Majewski "boot_os=y\0" \ 269a3eec24aSLukasz Majewski "hostname=display5\0" \ 270a3eec24aSLukasz Majewski "loadaddr=0x12000000\0" \ 271a3eec24aSLukasz Majewski "fdtaddr=0x12800000\0" \ 272a3eec24aSLukasz Majewski "console=ttymxc4,115200 quiet\0" \ 273a3eec24aSLukasz Majewski "fdtfile=imx6q-display5.dtb\0" \ 274a3eec24aSLukasz Majewski "fdt_high=0xffffffff\0" \ 275a3eec24aSLukasz Majewski "initrd_high=0xffffffff\0" \ 276a3eec24aSLukasz Majewski "kernel_file=fitImage\0" \ 277a3eec24aSLukasz Majewski "up=run tftp_sf_SPL; run tftp_sf_uboot\0" \ 278a3eec24aSLukasz Majewski "download_kernel=" \ 279a3eec24aSLukasz Majewski "tftpboot ${loadaddr} ${kernel_file};\0" \ 280*13e012f7SLukasz Majewski "factory_nfs=" \ 281*13e012f7SLukasz Majewski "echo BOOT: FACTORY (LEG);" \ 282*13e012f7SLukasz Majewski "run boot_nfs\0" \ 283a3eec24aSLukasz Majewski "boot_kernel_recovery=" KERNEL_RECOVERY_PROCEDURE "\0" \ 284a3eec24aSLukasz Majewski "boot_swu_recovery=" SWUPDATE_RECOVERY_PROCEDURE "\0" \ 285a3eec24aSLukasz Majewski "recovery=" \ 286a3eec24aSLukasz Majewski "if test ${BOOT_FROM_RECOVERY} = SWU; then " \ 287a3eec24aSLukasz Majewski "echo BOOT: RECOVERY: SWU;" \ 288a3eec24aSLukasz Majewski "run boot_swu_recovery;" \ 289a3eec24aSLukasz Majewski "else " \ 290a3eec24aSLukasz Majewski "echo BOOT: RECOVERY: Linux;" \ 291a3eec24aSLukasz Majewski "run boot_kernel_recovery;" \ 292a3eec24aSLukasz Majewski "fi\0" \ 293a3eec24aSLukasz Majewski "boot_tftp=" \ 294a3eec24aSLukasz Majewski "if run download_kernel; then " \ 295a3eec24aSLukasz Majewski "setenv bootargs console=${console} " \ 296a3eec24aSLukasz Majewski "root=/dev/mmcblk0p2 rootwait;" \ 297a3eec24aSLukasz Majewski "bootm ${loadaddr} - ${fdtaddr};" \ 298a3eec24aSLukasz Majewski "fi\0" \ 299a3eec24aSLukasz Majewski "addip=setenv bootargs ${bootargs} " \ 300a3eec24aSLukasz Majewski "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:" \ 301a3eec24aSLukasz Majewski "${hostname}:eth0:on" \ 302a3eec24aSLukasz Majewski "\0" \ 303a3eec24aSLukasz Majewski "nfsargs=setenv bootargs " \ 304a3eec24aSLukasz Majewski "root=/dev/nfs rw " \ 305a3eec24aSLukasz Majewski "nfsroot=${serverip}:${rootpath},nolock,nfsvers=3" \ 306a3eec24aSLukasz Majewski "\0" \ 307a3eec24aSLukasz Majewski "rootpath=/srv/tftp/DISP5/rootfs\0" \ 308a3eec24aSLukasz Majewski "boot_nfs=" \ 309a3eec24aSLukasz Majewski "if run download_kernel; then " \ 310a3eec24aSLukasz Majewski "run nfsargs;" \ 311a3eec24aSLukasz Majewski "run addip;" \ 312a3eec24aSLukasz Majewski "setenv bootargs ${bootargs} console=${console};" \ 313a3eec24aSLukasz Majewski "setenv fdt_conf imx6q-${board}-${display}.dtb; " \ 314a3eec24aSLukasz Majewski "bootm ${loadaddr}#conf@${fdt_conf};" \ 315a3eec24aSLukasz Majewski "fi\0" \ 316a3eec24aSLukasz Majewski "falcon_setup=" \ 317a3eec24aSLukasz Majewski "if mmc dev ${mmcdev}; then " \ 318a3eec24aSLukasz Majewski SETUP_BOOTARGS \ 319a3eec24aSLukasz Majewski "spl export fdt ${loadaddr}#conf@${fdt_conf};" \ 320a3eec24aSLukasz Majewski "setexpr fw_sz ${fdtargslen} / 0x200; " \ 321a3eec24aSLukasz Majewski "setexpr fw_sz ${fw_sz} + 1; " \ 322a3eec24aSLukasz Majewski "mmc write ${fdtargsaddr} " \ 323a3eec24aSLukasz Majewski __stringify(CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR)" ${fw_sz}; " \ 324a3eec24aSLukasz Majewski "fi\0" \ 325a3eec24aSLukasz Majewski "boot_mmc=" \ 326a3eec24aSLukasz Majewski "if mmc dev ${mmcdev}; then " \ 327a3eec24aSLukasz Majewski SETUP_BOOTARGS \ 328a3eec24aSLukasz Majewski "bootm ${loadaddr}#conf@${fdt_conf};" \ 329a3eec24aSLukasz Majewski "fi\0" \ 330a3eec24aSLukasz Majewski "set_kernel_part=" \ 331a3eec24aSLukasz Majewski "if test ${BOOT_FROM} = ACTIVE; then " \ 332a3eec24aSLukasz Majewski "setenv kernel_part ${kernel_part_active};" \ 333a3eec24aSLukasz Majewski "echo BOOT: ACTIVE;" \ 334a3eec24aSLukasz Majewski "else if test ${BOOT_FROM} = BACKUP; then " \ 335a3eec24aSLukasz Majewski "setenv kernel_part ${kernel_part_backup};" \ 336a3eec24aSLukasz Majewski "echo BOOT: BACKUP;" \ 337a3eec24aSLukasz Majewski "else " \ 338a3eec24aSLukasz Majewski "run recovery;" \ 339a3eec24aSLukasz Majewski "fi;fi\0" \ 340a3eec24aSLukasz Majewski "set_rootfs_part=" \ 341a3eec24aSLukasz Majewski "if test ${BOOT_FROM} = ACTIVE; then " \ 342a3eec24aSLukasz Majewski "setenv rootfs_part ${rootfs_part_active};" \ 343a3eec24aSLukasz Majewski "else if test ${BOOT_FROM} = BACKUP; then " \ 344a3eec24aSLukasz Majewski "setenv rootfs_part ${rootfs_part_backup};" \ 345a3eec24aSLukasz Majewski "else " \ 346a3eec24aSLukasz Majewski "run recovery;" \ 347a3eec24aSLukasz Majewski "fi;fi\0" \ 348a3eec24aSLukasz Majewski "BOOT_FROM=ACTIVE\0" \ 349a3eec24aSLukasz Majewski "BOOT_FROM_RECOVERY=Linux\0" \ 350a3eec24aSLukasz Majewski TFTP_UPDATE_BOOTLOADER \ 351a3eec24aSLukasz Majewski "kernel_part_active=1\0" \ 352a3eec24aSLukasz Majewski "kernel_part_backup=3\0" \ 353a3eec24aSLukasz Majewski __TFTP_UPDATE_KERNEL \ 354a3eec24aSLukasz Majewski "rootfs_part_active=2\0" \ 355a3eec24aSLukasz Majewski "rootfs_part_backup=4\0" \ 356a3eec24aSLukasz Majewski "rootfs_file=core-image-lwn-display5.ext4\0" \ 357a3eec24aSLukasz Majewski __TFTP_UPDATE_ROOTFS \ 358a3eec24aSLukasz Majewski TFTP_UPDATE_RECOVERY_KERNEL_INITRAMFS \ 359a3eec24aSLukasz Majewski TFTP_UPDATE_RECOVERY_SWU_KERNEL \ 360a3eec24aSLukasz Majewski TFTP_UPDATE_RECOVERY_SWU_INITRAMFS \ 361a3eec24aSLukasz Majewski "\0" \ 362a3eec24aSLukasz Majewski 363a3eec24aSLukasz Majewski /* Miscellaneous configurable options */ 364a3eec24aSLukasz Majewski #undef CONFIG_SYS_CBSIZE 365a3eec24aSLukasz Majewski #define CONFIG_SYS_CBSIZE 2048 366a3eec24aSLukasz Majewski 367a3eec24aSLukasz Majewski /* Print Buffer Size */ 368a3eec24aSLukasz Majewski #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ 369a3eec24aSLukasz Majewski sizeof(CONFIG_SYS_PROMPT) + 16) 370a3eec24aSLukasz Majewski #define CONFIG_SYS_MAXARGS 32 371a3eec24aSLukasz Majewski #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE 372a3eec24aSLukasz Majewski 373a3eec24aSLukasz Majewski #define CONFIG_STANDALONE_LOAD_ADDR 0x10001000 374a3eec24aSLukasz Majewski #define CONFIG_SYS_HZ 1000 375a3eec24aSLukasz Majewski 376a3eec24aSLukasz Majewski /* Physical Memory Map */ 377a3eec24aSLukasz Majewski #define CONFIG_NR_DRAM_BANKS 1 378a3eec24aSLukasz Majewski #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR 379a3eec24aSLukasz Majewski #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM 380a3eec24aSLukasz Majewski 381a3eec24aSLukasz Majewski #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR 382a3eec24aSLukasz Majewski #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE 383a3eec24aSLukasz Majewski 384a3eec24aSLukasz Majewski #define CONFIG_SYS_INIT_SP_OFFSET \ 385a3eec24aSLukasz Majewski (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) 386a3eec24aSLukasz Majewski #define CONFIG_SYS_INIT_SP_ADDR \ 387a3eec24aSLukasz Majewski (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) 388a3eec24aSLukasz Majewski 389a3eec24aSLukasz Majewski /* Commands */ 390a3eec24aSLukasz Majewski #define CONFIG_MTD_PARTITIONS 391a3eec24aSLukasz Majewski #define CONFIG_MTD_DEVICE 392a3eec24aSLukasz Majewski 393a3eec24aSLukasz Majewski /* ENV config */ 394a3eec24aSLukasz Majewski #ifdef CONFIG_ENV_IS_IN_SPI_FLASH 395a3eec24aSLukasz Majewski #define CONFIG_ENV_SIZE (SZ_64K) 396a3eec24aSLukasz Majewski /* The 0x120000 value corresponds to above SPI-NOR memory MAP */ 397a3eec24aSLukasz Majewski #define CONFIG_ENV_OFFSET (0x120000) 398a3eec24aSLukasz Majewski #define CONFIG_ENV_SECT_SIZE (SZ_64K) 399a3eec24aSLukasz Majewski #define CONFIG_SYS_REDUNDAND_ENVIRONMENT 400a3eec24aSLukasz Majewski #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \ 401a3eec24aSLukasz Majewski CONFIG_ENV_SECT_SIZE) 402a3eec24aSLukasz Majewski #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE 403a3eec24aSLukasz Majewski 404a3eec24aSLukasz Majewski #define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS 405a3eec24aSLukasz Majewski #define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS 406a3eec24aSLukasz Majewski #define CONFIG_ENV_SPI_MODE CONFIG_SF_DEFAULT_MODE 407a3eec24aSLukasz Majewski #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED 408a3eec24aSLukasz Majewski #endif 409a3eec24aSLukasz Majewski 410a3eec24aSLukasz Majewski #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) 411a3eec24aSLukasz Majewski #endif /* __CONFIG_H */ 412