summaryrefslogtreecommitdiff
path: root/include/configs/theadorable-x86-common.h
blob: a9aef12c306d782788dfda397d719b577795aa67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/* SPDX-License-Identifier: GPL-2.0+ */
/*
 * Copyright (C) 2016 Stefan Roese <sr@denx.de>
 */

/*
 * Common options, macros and default environment for all
 * theadorable x86 based boards
 */

#ifndef __THEADORABLE_X86_COMMON_H
#define __THEADORABLE_X86_COMMON_H

#define CONFIG_SYS_MONITOR_LEN		(1 << 20)

#define CONFIG_PREBOOT

#define CONFIG_STD_DEVICES_SETTINGS     "stdin=serial\0" \
					"stdout=serial\0" \
					"stderr=serial\0"

#define VIDEO_IO_OFFSET				0
#define CONFIG_X86EMU_RAW_IO
#define CONFIG_CMD_BMP
#define CONFIG_BMP_16BPP

/* Environment settings */
#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
#undef CONFIG_ENV_SIZE
#define CONFIG_ENV_SIZE			0x2000
#define CONFIG_ENV_SECT_SIZE		0x1000
#define CONFIG_ENV_OFFSET		0x006ec000
#define CONFIG_ENV_OFFSET_REDUND	\
	(CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)

#undef CONFIG_BOOTCOMMAND
#undef CONFIG_EXTRA_ENV_SETTINGS

#define CONFIG_EXTRA_ENV_SETTINGS				\
	"tftpdir=" DEF_ENV_TFTPDIR "\0"				\
	"eth_init=" DEF_ENV_ETH_INIT "\0"			\
	"ubuntu_part=" __stringify(DEF_ENV_UBUNTU_PART) "\0"	\
	"yocto_part=" __stringify(DEF_ENV_YOCTO_PART) "\0"	\
	"ubuntu_tty=" __stringify(DEF_ENV_UBUNTU_TTY) "\0"	\
	"yocto_tty=" __stringify(DEF_ENV_YOCTO_TTY) "\0"	\
	"start_eth=if test -n \"${eth_init}\";"			\
		"then run eth_init;else sleep 0;fi\0"		\
	"kernel-ver=4.8.0-54-generic\0"				\
	"boot=zboot 03000000 0 04000000 ${filesize}\0"		\
	"mtdparts=mtdparts=intel-spi:4k(descriptor),7084k(me)," \
		"8k(env1),8k(env2),64k(mrc),640k(u-boot),"	\
		"64k(vga),-(fsp)\0"				\
	"addtty_ubuntu=setenv bootargs ${bootargs} "		\
		"console=ttyS${ubuntu_tty},${baudrate}\0"	\
	"addtty_yocto=setenv bootargs ${bootargs} "		\
		"console=ttyS${yocto_tty},${baudrate}\0"	\
	"addmtd=setenv bootargs ${bootargs} ${mtdparts}\0"	\
	"addmisc=setenv bootargs ${bootargs} "			\
		"intel-spi.writeable=1 vmalloc=300M "		\
		"pci=realloc=on,hpmemsize=0x12000000,"		\
		"hpmemprefsize=0,hpiosize=0\0"	    		\
	"bootcmd=if env exists recovery_status;"		\
		"then run swupdate;"				\
		"else run yocto_boot;run swupdate;"		\
		"fi\0"						\
	"ubuntu_args=setenv bootargs "				\
		"root=/dev/sda${ubuntu_part} ro\0"		\
	"ubuntu_args_quiet=setenv bootargs "			\
		"root=/dev/sda${ubuntu_part} ro quiet\0"	\
	"ubuntu_load=load scsi 0:${ubuntu_part} 03000000 "	\
		"/boot/vmlinuz-${kernel-ver};"			\
		"load scsi 0:${ubuntu_part} 04000000 "		\
		"/boot/initrd.img-${kernel-ver}\0"		\
	"ubuntu_boot=run ubuntu_args_quiet addmtd addmisc "	\
		"ubuntu_load boot\0"				\
	"ubuntu_boot_console=run ubuntu_args addtty_ubuntu "	\
		"addmtd addmisc ubuntu_load boot\0"		\
	"net_args=setenv bootargs root=/dev/sda${ubuntu_part} ro\0" \
	"net_boot=run start_eth net_args addtty_yocto addmtd addmisc;" \
		"tftp 03000000 ${tftpdir}/bzImage;"		\
		"load scsi 0:${ubuntu_part} 04000000 "		\
		"/boot/initrd.img-${kernel-ver};"		\
		"run boot\0"					\
	"yocto_args=setenv bootargs root=/dev/sda${yocto_part} " \
		"panic=1\0"				\
	"yocto_args_fast=setenv bootargs root=/dev/sda${yocto_part} " \
		"quiet panic=1\0"				\
	"yocto_boot=run yocto_args addmtd addmisc addtty_yocto;" \
		"if run yocto_load;then zboot 03000000;fi\0"	\
	"yocto_boot_fast=run yocto_args_fast addmtd addmisc "	\
		"addtty_yocto yocto_load;zboot 03000000\0"	\
	"yocto_boot_tftp=run yocto_args addmtd addmisc addtty_yocto " \
		"start_eth yocto_load_tftp;zboot 03000000\0"	\
	"yocto_kernel=bzImage\0"				\
	"yocto_load=load scsi 0:${yocto_part} 03000000 "	\
		"/boot/${yocto_kernel}\0"			\
	"yocto_load_tftp=tftp 03000000 dfi/bzImage\0"		\
	"swupdate=if env exists swupdate_factory;"		\
		"then run swupdate_usb;run swupdate_run;"	\
		"else setenv swupdate_part 2;run swupdate_mmc;" \
			"run swupdate_run;setenv swupdate_part 1;" \
			"run swupdate_mmc;run swupdate_usb;"	\
			"run swupdate_run;"			\
		"fi\0"						\
	"swupdate-initrd=/boot/swupdate-image-theadorable.ext4.gz\0" \
	"swupdate-kernel=/boot/bzImage\0"			\
	"swupdate_args=setenv bootargs root=/dev/ram rw panic=1\0" \
	"swupdate_dev=0\0"					\
	"swupdate_factory=0\0"					\
	"swupdate_interface=usb\0"				\
	"swupdate_kernel=vmlinuz-4.4.0-28-generic\0"		\
	"swupdate_load=load ${swupdate_interface} ${swupdate_dev}:" \
		"${swupdate_part} 03000000 ${swupdate-kernel}"	\
		" && load ${swupdate_interface} ${swupdate_dev}:" \
		"${swupdate_part} 04000000 ${swupdate-initrd}\0" \
	"swupdate_mmc=setenv swupdate_interface mmc;"		\
		"setenv swupdate_dev ${swupdate_mmcdev};"	\
		"setenv swupdate_part 1;"			\
		"mmc dev ${swupdate_dev};mmc rescan\0"		\
	"swupdate_mmcdev=0\0"					\
	"swupdate_part=1\0"					\
	"swupdate_run=run swupdate_args addtty_yocto addmtd addmisc;" \
		"if run swupdate_load;then run boot;"		\
		"else echo SWUpdate cannot be started from "	\
		"${swupdate_interface};"			\
		"fi\0"						\
	"swupdate_usb=setenv swupdate_interface usb;"		\
		"setenv swupdate_dev 0;setenv swupdate_part 1;"	\
		"usb start\0"					\
	"logo_tftp=tftp ${loadaddr} ${tftpdir}/logo.bmp;"	\
		"bmp display ${loadaddr}\0"			\
	"preboot=scsi scan;load scsi 0:${ubuntu_part} ${loadaddr} " \
		"/boot/logo/logo.bmp;bmp display ${loadaddr}\0" \
	"rootpath=/tftpboot/theadorable-x86-conga/work/"	\
		"rootfs-yocto-swupdate-2017-03-29\0"		\
	"addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:" \
		"${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
	"set_bootargs_nfs=setenv bootargs root=/dev/nfs rw "	\
		"nfsroot=${serverip}:${rootpath},tcp,nfsvers=3\0" \
	"net_nfs=run start_eth set_bootargs_nfs addtty_yocto addip " \
		"addmtd addmisc;tftp 03000000 ${tftpdir}/bzImage;" \
		"zboot 03000000\0"				\
	"load_uboot=tftp ${loadaddr} ${tftpdir}/u-boot.rom\0"	\
	"update_uboot=sf probe;"				\
		"sf update ${loadaddr} 0 800000;saveenv\0"	\
	"upd_uboot=run start_eth load_uboot update_uboot\0"

#endif /* __THEADORABLE_X86_COMMON_H */