summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2012-04-20 18:27:23 +0000
committerGerrit <chrome-bot@google.com>2012-04-25 17:42:59 -0700
commit9e84c43e53980d862bba2fbb1095dd8793020743 (patch)
tree4f58b0e30f82b86cb08a8dcc488a8338e53b6f66
parent15350ddaccdf14e7e274463db97b72c47a73b10b (diff)
Provide alternative config for netbooting
This change allows to build a customized u-boot image, which includes networking capabilities, provides diagnostic commands and supports command line editing. These features are necessary to facilitate the factory flow. This image needs to be clearly distinguishable by ChromeOS. This is achieved by modifying the value presented by the BINF.3 ACPI object. To build this modified image one needs to add BUILD_FACTORY_IMAGE=1 to the make invocation line. BUG=chrome-os-partner:7952 TEST=manual . build the new firmware image as follows: USE='pcserial factory-mode' emerge-link chromeos-u-boot \ chromeos-coreboot chromeos-bootimage . program the new image on the Link target with ChromeOS installed on the SSD and restart it . observe the target stop at u-boot command prompt (boot >) . connect the target to an Ethernet network with a DHCP server using a USB Ethernet dongle . run the following commands at the u-boot prompt boot > usb start (Re)start USB... USB: Register 203007 NbrPorts 7 USB EHCI 1.00 Register 20400b NbrPorts 11 USB EHCI 1.00 8 USB Device(s) found scanning bus for storage devices... 0 Storage Device(s) found scanning bus for ethernet devices... 1 Ethernet Device(s) found boot > dhcp Waiting for Ethernet connection... done. BOOTP broadcast 1 BOOTP broadcast 2 [a few warnings of unsupported DHCP options] DHCP client bound to address 172.22.75.25 Using asx0 device TFTP from server 172.16.255.7; our IP address is 172.22.75.25; sending through gateway 172.22.75.254 Filename 'pxelinux.0'. Load address: 0x100000 Loading: ## done Bytes transferred = 15840 (3de0 hex) boot > . start ChromeOS on the target by issuing vboot_twostop . once ChromeOS boots check the mainfw_type crossystem reported value localhost ~ # echo $(crossystem mainfw_type) netboot localhost ~ # Change-Id: I1c50517754b6b5f773e432b9adec4b290f303e6f Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/21071 Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
-rw-r--r--board/chromebook-x86/coreboot/config.mk3
-rw-r--r--include/configs/coreboot.h16
-rw-r--r--lib/chromeos/crossystem_data.c4
3 files changed, 19 insertions, 4 deletions
diff --git a/board/chromebook-x86/coreboot/config.mk b/board/chromebook-x86/coreboot/config.mk
index 857ee8c4b9..627d4cfaf2 100644
--- a/board/chromebook-x86/coreboot/config.mk
+++ b/board/chromebook-x86/coreboot/config.mk
@@ -36,3 +36,6 @@
HOSTCFLAGS_autoconf.mk.dep = -Wno-variadic-macros
LD := $(LD).bfd
+ifdef BUILD_FACTORY_IMAGE
+PLATFORM_CPPFLAGS += -DFACTORY_IMAGE
+endif
diff --git a/include/configs/coreboot.h b/include/configs/coreboot.h
index fd2c0ccf9f..939c79a7ff 100644
--- a/include/configs/coreboot.h
+++ b/include/configs/coreboot.h
@@ -33,10 +33,19 @@
*/
#define CONFIG_SYS_COREBOOT
#define CONFIG_SHOW_BOOT_PROGRESS
-#define BUILD_CMD_LINE_STUFF 0
#define BUILD_IDE_STUFF 0
-#define BUILD_NETWORK_STUFF 0
-#define BUILD_PART_FS_STUFF 0
+
+#ifdef FACTORY_IMAGE
+#define BUILD_CMD_LINE_STUFF 1
+#define BUILD_NETWORK_STUFF 1
+#define BUILD_PART_FS_STUFF 1
+#define CONFIG_BOOTDELAY -1
+#else
+#define BUILD_CMD_LINE_STUFF 0
+#define BUILD_NETWORK_STUFF 0
+#define BUILD_PART_FS_STUFF 0
+#define CONFIG_BOOTDELAY 0
+#endif
/* FDT support */
#define CONFIG_OF_LIBFDT /* Device tree support */
@@ -333,7 +342,6 @@
/* Boot options */
-#define CONFIG_BOOTDELAY 0 /* -1 to disable auto boot */
#define CONFIG_ZERO_BOOTDELAY_CHECK
#define CONFIG_BOOTARGS ""
diff --git a/lib/chromeos/crossystem_data.c b/lib/chromeos/crossystem_data.c
index df387c1484..f719a29fee 100644
--- a/lib/chromeos/crossystem_data.c
+++ b/lib/chromeos/crossystem_data.c
@@ -305,7 +305,11 @@ int crossystem_data_update_acpi(crossystem_data_t *cdata)
len = min(ID_LEN, sizeof(acpi_table->vbt6));
memcpy(acpi_table->vbt6, cdata->readonly_firmware_id, len);
+#ifdef FACTORY_IMAGE
+ acpi_table->vbt7 = 3; /* '3' means 'netboot' to crossystem */
+#else
acpi_table->vbt7 = cdata->firmware_type;
+#endif
acpi_table->vbt8 = RECOVERY_REASON_NONE;
acpi_table->vbt9 = cdata->fmap_offset;