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