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