1 /* SPDX-License-Identifier: GPL-2.0+ */ 2 /* 3 * Copyright (C) 2016 Stefan Roese <sr@denx.de> 4 */ 5 6 /* 7 * Common options, macros and default environment for all 8 * theadorable x86 based boards 9 */ 10 11 #ifndef __THEADORABLE_X86_COMMON_H 12 #define __THEADORABLE_X86_COMMON_H 13 14 #define CONFIG_SYS_MONITOR_LEN (1 << 20) 15 16 #define CONFIG_STD_DEVICES_SETTINGS "stdin=serial\0" \ 17 "stdout=serial\0" \ 18 "stderr=serial\0" 19 20 #define VIDEO_IO_OFFSET 0 21 #define CONFIG_X86EMU_RAW_IO 22 #define CONFIG_CMD_BMP 23 #define CONFIG_BMP_16BPP 24 25 /* Environment settings */ 26 27 #undef CONFIG_BOOTCOMMAND 28 #undef CONFIG_EXTRA_ENV_SETTINGS 29 30 #define CONFIG_EXTRA_ENV_SETTINGS \ 31 "tftpdir=" DEF_ENV_TFTPDIR "\0" \ 32 "eth_init=" DEF_ENV_ETH_INIT "\0" \ 33 "ubuntu_part=" __stringify(DEF_ENV_UBUNTU_PART) "\0" \ 34 "yocto_part=" __stringify(DEF_ENV_YOCTO_PART) "\0" \ 35 "ubuntu_tty=" __stringify(DEF_ENV_UBUNTU_TTY) "\0" \ 36 "yocto_tty=" __stringify(DEF_ENV_YOCTO_TTY) "\0" \ 37 "start_eth=if test -n \"${eth_init}\";" \ 38 "then run eth_init;else sleep 0;fi\0" \ 39 "kernel-ver=4.8.0-54-generic\0" \ 40 "boot=zboot 03000000 0 04000000 ${filesize}\0" \ 41 "mtdparts=mtdparts=intel-spi:4k(descriptor),7084k(me)," \ 42 "8k(env1),8k(env2),64k(mrc),640k(u-boot)," \ 43 "64k(vga),-(fsp)\0" \ 44 "addtty_ubuntu=setenv bootargs ${bootargs} " \ 45 "console=ttyS${ubuntu_tty},${baudrate}\0" \ 46 "addtty_yocto=setenv bootargs ${bootargs} " \ 47 "console=ttyS${yocto_tty},${baudrate}\0" \ 48 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \ 49 "addmisc=setenv bootargs ${bootargs} " \ 50 "intel-spi.writeable=1 vmalloc=300M " \ 51 "pci=realloc=on,hpmemsize=0,hpiosize=0\0" \ 52 "bootcmd=if env exists recovery_status;" \ 53 "then run swupdate;" \ 54 "else run yocto_boot;run swupdate;" \ 55 "fi\0" \ 56 "setroot=part uuid scsi 0:${partnr} uuid;" \ 57 "setenv root PARTUUID=${uuid}\0" \ 58 "setroot_ubuntu=setenv partnr ${ubuntu_part};run setroot\0" \ 59 "setroot_yocto=setenv partnr ${yocto_part};run setroot\0" \ 60 "ubuntu_args=setenv bootargs " \ 61 "root=${root} ro\0" \ 62 "ubuntu_args_quiet=setenv bootargs " \ 63 "root=${root} ro quiet\0" \ 64 "ubuntu_load=load scsi 0:${ubuntu_part} 03000000 " \ 65 "/boot/vmlinuz-${kernel-ver};" \ 66 "load scsi 0:${ubuntu_part} 04000000 " \ 67 "/boot/initrd.img-${kernel-ver}\0" \ 68 "ubuntu_boot=run setroot_ubuntu ubuntu_args_quiet " \ 69 "addmtd addmisc ubuntu_load boot\0" \ 70 "ubuntu_boot_console=run setroot_ubuntu ubuntu_args " \ 71 "addtty_ubuntu addmtd addmisc ubuntu_load boot\0" \ 72 "net_args=setenv bootargs root=${root} ro\0" \ 73 "net_boot=run start_eth setroot_ubuntu net_args " \ 74 "addtty_ubuntu addmtd addmisc;" \ 75 "tftp 03000000 ${tftpdir}/bzImage;" \ 76 "load scsi 0:${ubuntu_part} 04000000 " \ 77 "/boot/initrd.img-${kernel-ver};" \ 78 "run boot\0" \ 79 "yocto_args=setenv bootargs root=${root} " \ 80 "panic=1\0" \ 81 "yocto_args_fast=setenv bootargs root=${root} " \ 82 "quiet panic=1\0" \ 83 "yocto_boot=run setroot_yocto yocto_args addmtd addmisc " \ 84 "addtty_yocto;" \ 85 "if run yocto_load;then zboot 03000000;fi\0" \ 86 "yocto_boot_fast=run setroot_yocto yocto_args_fast addmtd " \ 87 "addmisc addtty_yocto yocto_load;zboot 03000000\0" \ 88 "yocto_boot_tftp=run setroot_yocto yocto_args addmtd " \ 89 "addmisc addtty_yocto " \ 90 "start_eth yocto_load_tftp;zboot 03000000\0" \ 91 "yocto_kernel=bzImage\0" \ 92 "yocto_load=load scsi 0:${yocto_part} 03000000 " \ 93 "/boot/${yocto_kernel}\0" \ 94 "yocto_load_tftp=tftp 03000000 dfi/bzImage\0" \ 95 "swupdate=if env exists swupdate_factory;" \ 96 "then run swupdate_usb;run swupdate_run;" \ 97 "else setenv swupdate_part 2;run swupdate_mmc;" \ 98 "run swupdate_run;setenv swupdate_part 1;" \ 99 "run swupdate_mmc;run swupdate_usb;" \ 100 "run swupdate_run;" \ 101 "fi\0" \ 102 "swupdate-initrd=/boot/swupdate-image-theadorable.ext4.gz\0" \ 103 "swupdate-kernel=/boot/bzImage\0" \ 104 "swupdate_args=setenv bootargs root=/dev/ram rw panic=1\0" \ 105 "swupdate_dev=0\0" \ 106 "swupdate_factory=0\0" \ 107 "swupdate_interface=usb\0" \ 108 "swupdate_kernel=vmlinuz-4.4.0-28-generic\0" \ 109 "swupdate_load=load ${swupdate_interface} ${swupdate_dev}:" \ 110 "${swupdate_part} 03000000 ${swupdate-kernel}" \ 111 " && load ${swupdate_interface} ${swupdate_dev}:" \ 112 "${swupdate_part} 04000000 ${swupdate-initrd}\0" \ 113 "swupdate_mmc=setenv swupdate_interface mmc;" \ 114 "setenv swupdate_dev ${swupdate_mmcdev};" \ 115 "setenv swupdate_part 1;" \ 116 "mmc dev ${swupdate_dev};mmc rescan\0" \ 117 "swupdate_mmcdev=0\0" \ 118 "swupdate_part=1\0" \ 119 "swupdate_run=run swupdate_args addtty_yocto addmtd addmisc;" \ 120 "if run swupdate_load;then run boot;" \ 121 "else echo SWUpdate cannot be started from " \ 122 "${swupdate_interface};" \ 123 "fi\0" \ 124 "swupdate_usb=setenv swupdate_interface usb;" \ 125 "setenv swupdate_dev 0;setenv swupdate_part 1;" \ 126 "usb start\0" \ 127 "logo_tftp=tftp ${loadaddr} ${tftpdir}/logo.bmp;" \ 128 "bmp display ${loadaddr}\0" \ 129 "preboot=scsi scan;load scsi 0:${ubuntu_part} ${loadaddr} " \ 130 "/boot/logo/logo.bmp;bmp display ${loadaddr}\0" \ 131 "rootpath=/tftpboot/theadorable-x86-conga/work/" \ 132 "rootfs-yocto-swupdate-2017-03-29\0" \ 133 "addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:" \ 134 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \ 135 "set_bootargs_nfs=setenv bootargs root=/dev/nfs rw " \ 136 "nfsroot=${serverip}:${rootpath},tcp,nfsvers=3\0" \ 137 "net_nfs=run start_eth set_bootargs_nfs addtty_yocto addip " \ 138 "addmtd addmisc;tftp 03000000 ${tftpdir}/bzImage;" \ 139 "zboot 03000000\0" \ 140 "load_uboot=tftp ${loadaddr} ${tftpdir}/u-boot.rom\0" \ 141 "update_uboot=sf probe;" \ 142 "sf update ${loadaddr} 0 800000;saveenv\0" \ 143 "upd_uboot=run start_eth load_uboot update_uboot\0" 144 145 #endif /* __THEADORABLE_X86_COMMON_H */ 146