blob: af0a095dfc8cf29a79f4ed75f2193edbed60fba9 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Stefan Roesecf1eb212017-08-08 11:52:14 +02002/*
3 * Copyright (C) 2016 Stefan Roese <sr@denx.de>
Stefan Roesecf1eb212017-08-08 11:52:14 +02004 */
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
Stefan Roesecf1eb212017-08-08 11:52:14 +020014#define CONFIG_STD_DEVICES_SETTINGS "stdin=serial\0" \
15 "stdout=serial\0" \
16 "stderr=serial\0"
17
Stefan Roesecf1eb212017-08-08 11:52:14 +020018#define VIDEO_IO_OFFSET 0
19#define CONFIG_X86EMU_RAW_IO
Stefan Roesecf1eb212017-08-08 11:52:14 +020020
21/* Environment settings */
Stefan Roesecf1eb212017-08-08 11:52:14 +020022
Stefan Roesecf1eb212017-08-08 11:52:14 +020023#undef CONFIG_EXTRA_ENV_SETTINGS
24
25#define CONFIG_EXTRA_ENV_SETTINGS \
26 "tftpdir=" DEF_ENV_TFTPDIR "\0" \
27 "eth_init=" DEF_ENV_ETH_INIT "\0" \
28 "ubuntu_part=" __stringify(DEF_ENV_UBUNTU_PART) "\0" \
29 "yocto_part=" __stringify(DEF_ENV_YOCTO_PART) "\0" \
30 "ubuntu_tty=" __stringify(DEF_ENV_UBUNTU_TTY) "\0" \
31 "yocto_tty=" __stringify(DEF_ENV_YOCTO_TTY) "\0" \
32 "start_eth=if test -n \"${eth_init}\";" \
33 "then run eth_init;else sleep 0;fi\0" \
Stefan Roese0ca4c0a2017-10-06 09:12:27 +020034 "kernel-ver=4.8.0-54-generic\0" \
Stefan Roesecf1eb212017-08-08 11:52:14 +020035 "boot=zboot 03000000 0 04000000 ${filesize}\0" \
36 "mtdparts=mtdparts=intel-spi:4k(descriptor),7084k(me)," \
37 "8k(env1),8k(env2),64k(mrc),640k(u-boot)," \
38 "64k(vga),-(fsp)\0" \
39 "addtty_ubuntu=setenv bootargs ${bootargs} " \
40 "console=ttyS${ubuntu_tty},${baudrate}\0" \
41 "addtty_yocto=setenv bootargs ${bootargs} " \
42 "console=ttyS${yocto_tty},${baudrate}\0" \
43 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
44 "addmisc=setenv bootargs ${bootargs} " \
45 "intel-spi.writeable=1 vmalloc=300M " \
Stefan Roese104e1112018-10-22 14:07:54 +020046 "pci=realloc=on,hpmemsize=0,hpiosize=0\0" \
Stefan Roesecf1eb212017-08-08 11:52:14 +020047 "bootcmd=if env exists recovery_status;" \
48 "then run swupdate;" \
49 "else run yocto_boot;run swupdate;" \
50 "fi\0" \
Stefan Roesefd58a662018-10-22 14:07:55 +020051 "setroot=part uuid scsi 0:${partnr} uuid;" \
52 "setenv root PARTUUID=${uuid}\0" \
53 "setroot_ubuntu=setenv partnr ${ubuntu_part};run setroot\0" \
54 "setroot_yocto=setenv partnr ${yocto_part};run setroot\0" \
Stefan Roesecf1eb212017-08-08 11:52:14 +020055 "ubuntu_args=setenv bootargs " \
Stefan Roesefd58a662018-10-22 14:07:55 +020056 "root=${root} ro\0" \
Stefan Roesecf1eb212017-08-08 11:52:14 +020057 "ubuntu_args_quiet=setenv bootargs " \
Stefan Roesefd58a662018-10-22 14:07:55 +020058 "root=${root} ro quiet\0" \
Stefan Roesecf1eb212017-08-08 11:52:14 +020059 "ubuntu_load=load scsi 0:${ubuntu_part} 03000000 " \
Stefan Roese0ca4c0a2017-10-06 09:12:27 +020060 "/boot/vmlinuz-${kernel-ver};" \
Stefan Roesecf1eb212017-08-08 11:52:14 +020061 "load scsi 0:${ubuntu_part} 04000000 " \
Stefan Roese0ca4c0a2017-10-06 09:12:27 +020062 "/boot/initrd.img-${kernel-ver}\0" \
Stefan Roesefd58a662018-10-22 14:07:55 +020063 "ubuntu_boot=run setroot_ubuntu ubuntu_args_quiet " \
Stefan Roesecf1eb212017-08-08 11:52:14 +020064 "addmtd addmisc ubuntu_load boot\0" \
Stefan Roesefd58a662018-10-22 14:07:55 +020065 "ubuntu_boot_console=run setroot_ubuntu ubuntu_args " \
66 "addtty_ubuntu addmtd addmisc ubuntu_load boot\0" \
67 "net_args=setenv bootargs root=${root} ro\0" \
68 "net_boot=run start_eth setroot_ubuntu net_args " \
69 "addtty_ubuntu addmtd addmisc;" \
Stefan Roesecf1eb212017-08-08 11:52:14 +020070 "tftp 03000000 ${tftpdir}/bzImage;" \
71 "load scsi 0:${ubuntu_part} 04000000 " \
Stefan Roese0ca4c0a2017-10-06 09:12:27 +020072 "/boot/initrd.img-${kernel-ver};" \
Stefan Roesecf1eb212017-08-08 11:52:14 +020073 "run boot\0" \
Stefan Roesefd58a662018-10-22 14:07:55 +020074 "yocto_args=setenv bootargs root=${root} " \
75 "panic=1\0" \
76 "yocto_args_fast=setenv bootargs root=${root} " \
Stefan Roesecf1eb212017-08-08 11:52:14 +020077 "quiet panic=1\0" \
Stefan Roesefd58a662018-10-22 14:07:55 +020078 "yocto_boot=run setroot_yocto yocto_args addmtd addmisc " \
79 "addtty_yocto;" \
Stefan Roesecf1eb212017-08-08 11:52:14 +020080 "if run yocto_load;then zboot 03000000;fi\0" \
Stefan Roesefd58a662018-10-22 14:07:55 +020081 "yocto_boot_fast=run setroot_yocto yocto_args_fast addmtd " \
82 "addmisc addtty_yocto yocto_load;zboot 03000000\0" \
83 "yocto_boot_tftp=run setroot_yocto yocto_args addmtd " \
84 "addmisc addtty_yocto " \
Stefan Roesecf1eb212017-08-08 11:52:14 +020085 "start_eth yocto_load_tftp;zboot 03000000\0" \
86 "yocto_kernel=bzImage\0" \
87 "yocto_load=load scsi 0:${yocto_part} 03000000 " \
88 "/boot/${yocto_kernel}\0" \
89 "yocto_load_tftp=tftp 03000000 dfi/bzImage\0" \
90 "swupdate=if env exists swupdate_factory;" \
91 "then run swupdate_usb;run swupdate_run;" \
92 "else setenv swupdate_part 2;run swupdate_mmc;" \
93 "run swupdate_run;setenv swupdate_part 1;" \
94 "run swupdate_mmc;run swupdate_usb;" \
95 "run swupdate_run;" \
96 "fi\0" \
97 "swupdate-initrd=/boot/swupdate-image-theadorable.ext4.gz\0" \
98 "swupdate-kernel=/boot/bzImage\0" \
Stefan Roesefa33c002017-08-30 09:40:17 +020099 "swupdate_args=setenv bootargs root=/dev/ram rw panic=1\0" \
Stefan Roesecf1eb212017-08-08 11:52:14 +0200100 "swupdate_dev=0\0" \
101 "swupdate_factory=0\0" \
102 "swupdate_interface=usb\0" \
103 "swupdate_kernel=vmlinuz-4.4.0-28-generic\0" \
104 "swupdate_load=load ${swupdate_interface} ${swupdate_dev}:" \
105 "${swupdate_part} 03000000 ${swupdate-kernel}" \
106 " && load ${swupdate_interface} ${swupdate_dev}:" \
107 "${swupdate_part} 04000000 ${swupdate-initrd}\0" \
108 "swupdate_mmc=setenv swupdate_interface mmc;" \
109 "setenv swupdate_dev ${swupdate_mmcdev};" \
110 "setenv swupdate_part 1;" \
111 "mmc dev ${swupdate_dev};mmc rescan\0" \
112 "swupdate_mmcdev=0\0" \
113 "swupdate_part=1\0" \
114 "swupdate_run=run swupdate_args addtty_yocto addmtd addmisc;" \
115 "if run swupdate_load;then run boot;" \
116 "else echo SWUpdate cannot be started from " \
117 "${swupdate_interface};" \
118 "fi\0" \
119 "swupdate_usb=setenv swupdate_interface usb;" \
120 "setenv swupdate_dev 0;setenv swupdate_part 1;" \
121 "usb start\0" \
122 "logo_tftp=tftp ${loadaddr} ${tftpdir}/logo.bmp;" \
123 "bmp display ${loadaddr}\0" \
124 "preboot=scsi scan;load scsi 0:${ubuntu_part} ${loadaddr} " \
125 "/boot/logo/logo.bmp;bmp display ${loadaddr}\0" \
126 "rootpath=/tftpboot/theadorable-x86-conga/work/" \
127 "rootfs-yocto-swupdate-2017-03-29\0" \
128 "addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:" \
129 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
130 "set_bootargs_nfs=setenv bootargs root=/dev/nfs rw " \
131 "nfsroot=${serverip}:${rootpath},tcp,nfsvers=3\0" \
132 "net_nfs=run start_eth set_bootargs_nfs addtty_yocto addip " \
133 "addmtd addmisc;tftp 03000000 ${tftpdir}/bzImage;" \
134 "zboot 03000000\0" \
135 "load_uboot=tftp ${loadaddr} ${tftpdir}/u-boot.rom\0" \
136 "update_uboot=sf probe;" \
137 "sf update ${loadaddr} 0 800000;saveenv\0" \
138 "upd_uboot=run start_eth load_uboot update_uboot\0"
139
140#endif /* __THEADORABLE_X86_COMMON_H */