1489b51daSStefan Roese /* 2489b51daSStefan Roese * Copyright (C) 2016 Stefan Roese <sr@denx.de> 3489b51daSStefan Roese * 4489b51daSStefan Roese * SPDX-License-Identifier: GPL-2.0+ 5489b51daSStefan Roese */ 6489b51daSStefan Roese 7489b51daSStefan Roese /* 8489b51daSStefan Roese * Common options, macros and default environment for all 9489b51daSStefan Roese * theadorable x86 based boards 10489b51daSStefan Roese */ 11489b51daSStefan Roese 12489b51daSStefan Roese #ifndef __THEADORABLE_X86_COMMON_H 13489b51daSStefan Roese #define __THEADORABLE_X86_COMMON_H 14489b51daSStefan Roese 15489b51daSStefan Roese #define CONFIG_SYS_MONITOR_LEN (1 << 20) 16489b51daSStefan Roese 17489b51daSStefan Roese #define CONFIG_PREBOOT 18489b51daSStefan Roese 19489b51daSStefan Roese #define CONFIG_STD_DEVICES_SETTINGS "stdin=serial\0" \ 20489b51daSStefan Roese "stdout=serial\0" \ 21489b51daSStefan Roese "stderr=serial\0" 22489b51daSStefan Roese 23489b51daSStefan Roese #define CONFIG_USB_HOST_ETHER 24489b51daSStefan Roese #define CONFIG_USB_ETHER_ASIX 25489b51daSStefan Roese #define CONFIG_USB_ETHER_SMSC95XX 26489b51daSStefan Roese #define CONFIG_USB_ETHER_MCS7830 27489b51daSStefan Roese #define CONFIG_USB_ETHER_RTL8152 28489b51daSStefan Roese 29489b51daSStefan Roese #define VIDEO_IO_OFFSET 0 30489b51daSStefan Roese #define CONFIG_X86EMU_RAW_IO 31489b51daSStefan Roese #define CONFIG_CMD_BMP 32489b51daSStefan Roese #define CONFIG_BMP_16BPP 33489b51daSStefan Roese 34489b51daSStefan Roese /* Environment settings */ 35489b51daSStefan Roese #define CONFIG_SYS_REDUNDAND_ENVIRONMENT 36489b51daSStefan Roese #undef CONFIG_ENV_SIZE 37489b51daSStefan Roese #define CONFIG_ENV_SIZE 0x2000 38489b51daSStefan Roese #define CONFIG_ENV_SECT_SIZE 0x1000 39489b51daSStefan Roese #define CONFIG_ENV_OFFSET 0x006ec000 40489b51daSStefan Roese #define CONFIG_ENV_OFFSET_REDUND \ 41489b51daSStefan Roese (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) 42489b51daSStefan Roese 43489b51daSStefan Roese #undef CONFIG_BOOTCOMMAND 44489b51daSStefan Roese #undef CONFIG_EXTRA_ENV_SETTINGS 45489b51daSStefan Roese 46489b51daSStefan Roese #define CONFIG_EXTRA_ENV_SETTINGS \ 47489b51daSStefan Roese "tftpdir=" DEF_ENV_TFTPDIR "\0" \ 48489b51daSStefan Roese "eth_init=" DEF_ENV_ETH_INIT "\0" \ 49489b51daSStefan Roese "ubuntu_part=" __stringify(DEF_ENV_UBUNTU_PART) "\0" \ 50489b51daSStefan Roese "yocto_part=" __stringify(DEF_ENV_YOCTO_PART) "\0" \ 51489b51daSStefan Roese "ubuntu_tty=" __stringify(DEF_ENV_UBUNTU_TTY) "\0" \ 52489b51daSStefan Roese "yocto_tty=" __stringify(DEF_ENV_YOCTO_TTY) "\0" \ 53489b51daSStefan Roese "start_eth=if test -n \"${eth_init}\";" \ 54489b51daSStefan Roese "then run eth_init;else sleep 0;fi\0" \ 55489b51daSStefan Roese "kernel-ver=4.8.0-54\0" \ 56489b51daSStefan Roese "boot=zboot 03000000 0 04000000 ${filesize}\0" \ 57489b51daSStefan Roese "mtdparts=mtdparts=intel-spi:4k(descriptor),7084k(me)," \ 58489b51daSStefan Roese "8k(env1),8k(env2),64k(mrc),640k(u-boot)," \ 59489b51daSStefan Roese "64k(vga),-(fsp)\0" \ 60489b51daSStefan Roese "addtty_ubuntu=setenv bootargs ${bootargs} " \ 61489b51daSStefan Roese "console=ttyS${ubuntu_tty},${baudrate}\0" \ 62489b51daSStefan Roese "addtty_yocto=setenv bootargs ${bootargs} " \ 63489b51daSStefan Roese "console=ttyS${yocto_tty},${baudrate}\0" \ 64489b51daSStefan Roese "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \ 65489b51daSStefan Roese "addmisc=setenv bootargs ${bootargs} " \ 66489b51daSStefan Roese "intel-spi.writeable=1 vmalloc=300M " \ 67489b51daSStefan Roese "pci=realloc=on,hpmemsize=0x12000000\0" \ 68489b51daSStefan Roese "bootcmd=if env exists recovery_status;" \ 69489b51daSStefan Roese "then run swupdate;" \ 70489b51daSStefan Roese "else run yocto_boot;run swupdate;" \ 71489b51daSStefan Roese "fi\0" \ 72489b51daSStefan Roese "ubuntu_args=setenv bootargs " \ 73489b51daSStefan Roese "root=/dev/sda${ubuntu_part} ro\0" \ 74489b51daSStefan Roese "ubuntu_args_quiet=setenv bootargs " \ 75489b51daSStefan Roese "root=/dev/sda${ubuntu_part} ro quiet\0" \ 76489b51daSStefan Roese "ubuntu_load=load scsi 0:${ubuntu_part} 03000000 " \ 77489b51daSStefan Roese "/boot/vmlinuz-${kernel-ver}-generic;" \ 78489b51daSStefan Roese "load scsi 0:${ubuntu_part} 04000000 " \ 79489b51daSStefan Roese "/boot/initrd.img-${kernel-ver}-generic\0" \ 80489b51daSStefan Roese "ubuntu_boot=run ubuntu_args_quiet addmtd addmisc " \ 81489b51daSStefan Roese "ubuntu_load boot\0" \ 82489b51daSStefan Roese "ubuntu_boot_console=run ubuntu_args addtty_ubuntu " \ 83489b51daSStefan Roese "addmtd addmisc ubuntu_load boot\0" \ 84489b51daSStefan Roese "net_args=setenv bootargs root=/dev/sda${ubuntu_part} ro\0" \ 85489b51daSStefan Roese "net_boot=run start_eth net_args addtty_yocto addmtd addmisc;" \ 86489b51daSStefan Roese "tftp 03000000 ${tftpdir}/bzImage;" \ 87489b51daSStefan Roese "load scsi 0:${ubuntu_part} 04000000 " \ 88489b51daSStefan Roese "/boot/initrd.img-${kernel-ver}-generic;" \ 89489b51daSStefan Roese "run boot\0" \ 90489b51daSStefan Roese "yocto_args=setenv bootargs root=/dev/sda${yocto_part} " \ 91*f04034cbSStefan Roese "panic=1\0" \ 92489b51daSStefan Roese "yocto_args_fast=setenv bootargs root=/dev/sda${yocto_part} " \ 93489b51daSStefan Roese "quiet panic=1\0" \ 94489b51daSStefan Roese "yocto_boot=run yocto_args addmtd addmisc addtty_yocto;" \ 95489b51daSStefan Roese "if run yocto_load;then zboot 03000000;fi\0" \ 96489b51daSStefan Roese "yocto_boot_fast=run yocto_args_fast addmtd addmisc " \ 97489b51daSStefan Roese "addtty_yocto yocto_load;zboot 03000000\0" \ 98489b51daSStefan Roese "yocto_boot_tftp=run yocto_args addmtd 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" \ 113*f04034cbSStefan 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