183d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */ 2489b51daSStefan Roese /* 3489b51daSStefan Roese * Copyright (C) 2016 Stefan Roese <sr@denx.de> 4489b51daSStefan Roese */ 5489b51daSStefan Roese 6489b51daSStefan Roese /* 7489b51daSStefan Roese * Common options, macros and default environment for all 8489b51daSStefan Roese * theadorable x86 based boards 9489b51daSStefan Roese */ 10489b51daSStefan Roese 11489b51daSStefan Roese #ifndef __THEADORABLE_X86_COMMON_H 12489b51daSStefan Roese #define __THEADORABLE_X86_COMMON_H 13489b51daSStefan Roese 14489b51daSStefan Roese #define CONFIG_SYS_MONITOR_LEN (1 << 20) 15489b51daSStefan Roese 16489b51daSStefan Roese #define CONFIG_PREBOOT 17489b51daSStefan Roese 18489b51daSStefan Roese #define CONFIG_STD_DEVICES_SETTINGS "stdin=serial\0" \ 19489b51daSStefan Roese "stdout=serial\0" \ 20489b51daSStefan Roese "stderr=serial\0" 21489b51daSStefan Roese 22489b51daSStefan Roese #define VIDEO_IO_OFFSET 0 23489b51daSStefan Roese #define CONFIG_X86EMU_RAW_IO 24489b51daSStefan Roese #define CONFIG_CMD_BMP 25489b51daSStefan Roese #define CONFIG_BMP_16BPP 26489b51daSStefan Roese 27489b51daSStefan Roese /* Environment settings */ 28489b51daSStefan Roese #define CONFIG_SYS_REDUNDAND_ENVIRONMENT 29489b51daSStefan Roese #undef CONFIG_ENV_SIZE 30489b51daSStefan Roese #define CONFIG_ENV_SIZE 0x2000 31489b51daSStefan Roese #define CONFIG_ENV_SECT_SIZE 0x1000 32489b51daSStefan Roese #define CONFIG_ENV_OFFSET 0x006ec000 33489b51daSStefan Roese #define CONFIG_ENV_OFFSET_REDUND \ 34489b51daSStefan Roese (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) 35489b51daSStefan Roese 36489b51daSStefan Roese #undef CONFIG_BOOTCOMMAND 37489b51daSStefan Roese #undef CONFIG_EXTRA_ENV_SETTINGS 38489b51daSStefan Roese 39489b51daSStefan Roese #define CONFIG_EXTRA_ENV_SETTINGS \ 40489b51daSStefan Roese "tftpdir=" DEF_ENV_TFTPDIR "\0" \ 41489b51daSStefan Roese "eth_init=" DEF_ENV_ETH_INIT "\0" \ 42489b51daSStefan Roese "ubuntu_part=" __stringify(DEF_ENV_UBUNTU_PART) "\0" \ 43489b51daSStefan Roese "yocto_part=" __stringify(DEF_ENV_YOCTO_PART) "\0" \ 44489b51daSStefan Roese "ubuntu_tty=" __stringify(DEF_ENV_UBUNTU_TTY) "\0" \ 45489b51daSStefan Roese "yocto_tty=" __stringify(DEF_ENV_YOCTO_TTY) "\0" \ 46489b51daSStefan Roese "start_eth=if test -n \"${eth_init}\";" \ 47489b51daSStefan Roese "then run eth_init;else sleep 0;fi\0" \ 4870e6c8c6SStefan Roese "kernel-ver=4.8.0-54-generic\0" \ 49489b51daSStefan Roese "boot=zboot 03000000 0 04000000 ${filesize}\0" \ 50489b51daSStefan Roese "mtdparts=mtdparts=intel-spi:4k(descriptor),7084k(me)," \ 51489b51daSStefan Roese "8k(env1),8k(env2),64k(mrc),640k(u-boot)," \ 52489b51daSStefan Roese "64k(vga),-(fsp)\0" \ 53489b51daSStefan Roese "addtty_ubuntu=setenv bootargs ${bootargs} " \ 54489b51daSStefan Roese "console=ttyS${ubuntu_tty},${baudrate}\0" \ 55489b51daSStefan Roese "addtty_yocto=setenv bootargs ${bootargs} " \ 56489b51daSStefan Roese "console=ttyS${yocto_tty},${baudrate}\0" \ 57489b51daSStefan Roese "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \ 58489b51daSStefan Roese "addmisc=setenv bootargs ${bootargs} " \ 59489b51daSStefan Roese "intel-spi.writeable=1 vmalloc=300M " \ 600ca4405fSStefan Roese "pci=realloc=on,hpmemsize=0,hpiosize=0\0" \ 61489b51daSStefan Roese "bootcmd=if env exists recovery_status;" \ 62489b51daSStefan Roese "then run swupdate;" \ 63489b51daSStefan Roese "else run yocto_boot;run swupdate;" \ 64489b51daSStefan Roese "fi\0" \ 65*6e1c943fSStefan Roese "setroot=part uuid scsi 0:${partnr} uuid;" \ 66*6e1c943fSStefan Roese "setenv root PARTUUID=${uuid}\0" \ 67*6e1c943fSStefan Roese "setroot_ubuntu=setenv partnr ${ubuntu_part};run setroot\0" \ 68*6e1c943fSStefan Roese "setroot_yocto=setenv partnr ${yocto_part};run setroot\0" \ 69489b51daSStefan Roese "ubuntu_args=setenv bootargs " \ 70*6e1c943fSStefan Roese "root=${root} ro\0" \ 71489b51daSStefan Roese "ubuntu_args_quiet=setenv bootargs " \ 72*6e1c943fSStefan Roese "root=${root} ro quiet\0" \ 73489b51daSStefan Roese "ubuntu_load=load scsi 0:${ubuntu_part} 03000000 " \ 7470e6c8c6SStefan Roese "/boot/vmlinuz-${kernel-ver};" \ 75489b51daSStefan Roese "load scsi 0:${ubuntu_part} 04000000 " \ 7670e6c8c6SStefan Roese "/boot/initrd.img-${kernel-ver}\0" \ 77*6e1c943fSStefan Roese "ubuntu_boot=run setroot_ubuntu ubuntu_args_quiet " \ 78489b51daSStefan Roese "addmtd addmisc ubuntu_load boot\0" \ 79*6e1c943fSStefan Roese "ubuntu_boot_console=run setroot_ubuntu ubuntu_args " \ 80*6e1c943fSStefan Roese "addtty_ubuntu addmtd addmisc ubuntu_load boot\0" \ 81*6e1c943fSStefan Roese "net_args=setenv bootargs root=${root} ro\0" \ 82*6e1c943fSStefan Roese "net_boot=run start_eth setroot_ubuntu net_args " \ 83*6e1c943fSStefan Roese "addtty_ubuntu addmtd addmisc;" \ 84489b51daSStefan Roese "tftp 03000000 ${tftpdir}/bzImage;" \ 85489b51daSStefan Roese "load scsi 0:${ubuntu_part} 04000000 " \ 8670e6c8c6SStefan Roese "/boot/initrd.img-${kernel-ver};" \ 87489b51daSStefan Roese "run boot\0" \ 88*6e1c943fSStefan Roese "yocto_args=setenv bootargs root=${root} " \ 89f04034cbSStefan Roese "panic=1\0" \ 90*6e1c943fSStefan Roese "yocto_args_fast=setenv bootargs root=${root} " \ 91489b51daSStefan Roese "quiet panic=1\0" \ 92*6e1c943fSStefan Roese "yocto_boot=run setroot_yocto yocto_args addmtd addmisc " \ 93*6e1c943fSStefan Roese "addtty_yocto;" \ 94489b51daSStefan Roese "if run yocto_load;then zboot 03000000;fi\0" \ 95*6e1c943fSStefan Roese "yocto_boot_fast=run setroot_yocto yocto_args_fast addmtd " \ 96*6e1c943fSStefan Roese "addmisc addtty_yocto yocto_load;zboot 03000000\0" \ 97*6e1c943fSStefan Roese "yocto_boot_tftp=run setroot_yocto yocto_args addmtd " \ 98*6e1c943fSStefan Roese "addmisc addtty_yocto " \ 99489b51daSStefan Roese "start_eth yocto_load_tftp;zboot 03000000\0" \ 100489b51daSStefan Roese "yocto_kernel=bzImage\0" \ 101489b51daSStefan Roese "yocto_load=load scsi 0:${yocto_part} 03000000 " \ 102489b51daSStefan Roese "/boot/${yocto_kernel}\0" \ 103489b51daSStefan Roese "yocto_load_tftp=tftp 03000000 dfi/bzImage\0" \ 104489b51daSStefan Roese "swupdate=if env exists swupdate_factory;" \ 105489b51daSStefan Roese "then run swupdate_usb;run swupdate_run;" \ 106489b51daSStefan Roese "else setenv swupdate_part 2;run swupdate_mmc;" \ 107489b51daSStefan Roese "run swupdate_run;setenv swupdate_part 1;" \ 108489b51daSStefan Roese "run swupdate_mmc;run swupdate_usb;" \ 109489b51daSStefan Roese "run swupdate_run;" \ 110489b51daSStefan Roese "fi\0" \ 111489b51daSStefan Roese "swupdate-initrd=/boot/swupdate-image-theadorable.ext4.gz\0" \ 112489b51daSStefan Roese "swupdate-kernel=/boot/bzImage\0" \ 113f04034cbSStefan Roese "swupdate_args=setenv bootargs root=/dev/ram rw panic=1\0" \ 114489b51daSStefan Roese "swupdate_dev=0\0" \ 115489b51daSStefan Roese "swupdate_factory=0\0" \ 116489b51daSStefan Roese "swupdate_interface=usb\0" \ 117489b51daSStefan Roese "swupdate_kernel=vmlinuz-4.4.0-28-generic\0" \ 118489b51daSStefan Roese "swupdate_load=load ${swupdate_interface} ${swupdate_dev}:" \ 119489b51daSStefan Roese "${swupdate_part} 03000000 ${swupdate-kernel}" \ 120489b51daSStefan Roese " && load ${swupdate_interface} ${swupdate_dev}:" \ 121489b51daSStefan Roese "${swupdate_part} 04000000 ${swupdate-initrd}\0" \ 122489b51daSStefan Roese "swupdate_mmc=setenv swupdate_interface mmc;" \ 123489b51daSStefan Roese "setenv swupdate_dev ${swupdate_mmcdev};" \ 124489b51daSStefan Roese "setenv swupdate_part 1;" \ 125489b51daSStefan Roese "mmc dev ${swupdate_dev};mmc rescan\0" \ 126489b51daSStefan Roese "swupdate_mmcdev=0\0" \ 127489b51daSStefan Roese "swupdate_part=1\0" \ 128489b51daSStefan Roese "swupdate_run=run swupdate_args addtty_yocto addmtd addmisc;" \ 129489b51daSStefan Roese "if run swupdate_load;then run boot;" \ 130489b51daSStefan Roese "else echo SWUpdate cannot be started from " \ 131489b51daSStefan Roese "${swupdate_interface};" \ 132489b51daSStefan Roese "fi\0" \ 133489b51daSStefan Roese "swupdate_usb=setenv swupdate_interface usb;" \ 134489b51daSStefan Roese "setenv swupdate_dev 0;setenv swupdate_part 1;" \ 135489b51daSStefan Roese "usb start\0" \ 136489b51daSStefan Roese "logo_tftp=tftp ${loadaddr} ${tftpdir}/logo.bmp;" \ 137489b51daSStefan Roese "bmp display ${loadaddr}\0" \ 138489b51daSStefan Roese "preboot=scsi scan;load scsi 0:${ubuntu_part} ${loadaddr} " \ 139489b51daSStefan Roese "/boot/logo/logo.bmp;bmp display ${loadaddr}\0" \ 140489b51daSStefan Roese "rootpath=/tftpboot/theadorable-x86-conga/work/" \ 141489b51daSStefan Roese "rootfs-yocto-swupdate-2017-03-29\0" \ 142489b51daSStefan Roese "addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:" \ 143489b51daSStefan Roese "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \ 144489b51daSStefan Roese "set_bootargs_nfs=setenv bootargs root=/dev/nfs rw " \ 145489b51daSStefan Roese "nfsroot=${serverip}:${rootpath},tcp,nfsvers=3\0" \ 146489b51daSStefan Roese "net_nfs=run start_eth set_bootargs_nfs addtty_yocto addip " \ 147489b51daSStefan Roese "addmtd addmisc;tftp 03000000 ${tftpdir}/bzImage;" \ 148489b51daSStefan Roese "zboot 03000000\0" \ 149489b51daSStefan Roese "load_uboot=tftp ${loadaddr} ${tftpdir}/u-boot.rom\0" \ 150489b51daSStefan Roese "update_uboot=sf probe;" \ 151489b51daSStefan Roese "sf update ${loadaddr} 0 800000;saveenv\0" \ 152489b51daSStefan Roese "upd_uboot=run start_eth load_uboot update_uboot\0" 153489b51daSStefan Roese 154489b51daSStefan Roese #endif /* __THEADORABLE_X86_COMMON_H */ 155