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