Chromebooks/550 Chromebook Build HOWTO

From coreboot
Jump to: navigation, search

Prerequisites

It should be noted that you will no longer be able to boot ChromeOS if you build and flash a Coreboot firmware using this method.

This assumes you have the Chromebook in developer mode and have disabled the ROM write-protect by enabling the jumper, as per the Chromebooks page.

You will need another machine with a suitable Linux distribution and tool-chain loaded. This was tested with Fedora 19.

It's a good idea to make a copy of the existing ROM to external media using
$ sudo flashrom -r bios.bin
beforehand, from the Crosh shell.

Patching Coreboot

As a normal user do
$ git clone http://review.coreboot.org/p/coreboot
and then cd into the coreboot directory. Next we have to apply a couple of patches to allow the newer system-agent binary to work:
$ git fetch http://review.coreboot.org/coreboot refs/changes/31/3831/1 && git checkout FETCH_HEAD
And add an extra field, so all the memory is recognised, to src/mainboard/samsung/lumpy/romstage.c at line 168:
$ max_ddr3_freq: 1333,
In src/mainboard/samsung/lumpy/Kconfig remove
$         select CHROMEOS
Save the following text to “patch” in the coreboot directory:
diff --git a/src/vendorcode/google/chromeos/gnvs.h b/src/vendorcode/google/chrom
index 00fe443..5384423 100644
--- a/src/vendorcode/google/chromeos/gnvs.h
+++ b/src/vendorcode/google/chromeos/gnvs.h
@@ -61,9 +61,13 @@ typedef struct {
                                // dbe
 } __attribute__((packed)) chromeos_acpi_t;
 
+#if CONFIG_CHROMEOS
 extern chromeos_acpi_t *vboot_data;
 void chromeos_init_vboot(chromeos_acpi_t *chromeos);
 void chromeos_set_me_hash(u32*, int);
 void acpi_get_vdat_info(uint64_t *vdat_addr, uint32_t *vdat_size);
+#else
+static inline void chromeos_init_vboot(chromeos_acpi_t *chromeos) {}
+#endif
 
 #endif
Then apply it with
$ patch -p1 < patch

Compiling Coreboot

Run
$ make menuconfig

Apply the following options:

  • Uncheck Compress ramstage with LZMA
  • Uncheck Include the coreboot .config file into the ROM image
  • Check Allow use of binary-only repository
  • Change Mainboard Vendor to Samsung, which should automatically change the mainboard to “Lumpy”
  • Check Mark graphics memory as write-combining.
  • Check Enable VMX for virtualization
  • Check Allow for caching system ROM.
  • Check Add a System Agent binary
  • Check Add a VGA BIOS image.
  • Change the binary path to 3rdparty/mainboard/$(MAINBOARDDIR)/snm_2130_coreboot.bin
  • Uncheck Serial port console output
  • Check Use onboard VGA as primary video device
  • Change SeaBIOS version to “master”
  • Uncheck Use LZMA compression for payloads


Then, in order to enable a boot menu key the Chromebook actually has, edit lines 416 to 422 of build/seabios/src/boot.c to read:
printf("nPress ESC for boot menu.nn");
 
u32 menutime = romfile_loadint("etc/boot-menu-wait", DEFAULT_BOOTMENU_WAIT);
 enable_bootsplash();
 int scan_code = get_keystroke(menutime);
 disable_bootsplash();
 if (scan_code != 0x01)
Run "make" again. Then, assuming everything built, write the file to the ROM on the Chromebook in Crosh:
$ sudo flashrom -w coreboot.rom

You will now be able to boot from any standard USB installation media.

If anything is wrong you now have a brick. But, it's okay. If you purchase a Bus Pirate, Bus Pirate probe cable, and Pomona 5250 SOIC clip you can recover.

--Jlewis (talk) 15:38, 5 August 2013 (UTC)