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