google/rambi/4.8-1366-g4cafc886195/2018-08-28T15_36_51Z

Test setup:
-----------
- Hardware: Acer CB-131 (gnawty)
- Distribution: Parabola with Linux-libre 4.18.3-gnu-1
  /boot was on an USB key and the rest of the distribution
  was intalled on the internal eMMC

Working:
--------
- Booting on an USB key (with MrChromebox's SeaBIOS[1])
- The display including at boot
- The keyboard (MrChromebox's SeaBIOS[1] is required for that)

Untested or not working:
------------------------
- sound: the sound card seem to be visible with alsamixser -c1
  but I didn't test it.
- touchpad: it was not recognized with Parabola, it might be
  recognized with other distributions[2]
- WiFi: as the internal WiFi card most probably requires a
  nonfree firmware, I used an external USB WiFi card

Not working:
------------
- Boot on the eMMC: it's not visible under with MrChromebox's
  SeaBIOS and untested with other payloads
- Keyboard with stock SeaBIOS

How to build:
-------------
First clone coreboot:
$ git clone https://review.coreboot.org/p/coreboot.git
And get the factory coreboot image for gnawty:
$ cd coreboot/util/chromeos
$ ./crosfirmware.sh gnawty
Then we need to extract some data[3] and nonfree code
$ mkdir -p ../../blobs/nonfree-code/
$ mkdir -p ../../blobs/data/
$ make -C ../ifdtool
$ ../ifdtool/ifdtool -x coreboot-Google_Gnawty.5216.239.109.bin
$ cp flashregion_0_flashdescriptor.bin ../../blobs/data/
$ cp flashregion_2_intel_me.bin ../../blobs/nonfree-code/
$ make -C ../cbfstool/
$ ../cbfstool/cbfstool coreboot-Google_Gnawty.5216.239.109.bin read -r BOOT_STUB -f BOOT_STUB
$ ../cbfstool/cbfstool BOOT_STUB extract -n pci8086,0f31.rom -f ../../blobs/nonfree-code/pci8086,0f31.rom
$ ../cbfstool/cbfstool BOOT_STUB extract -n cpu_microcode_blob.bin -f ../../blobs/nonfree-code/cpu_microcode_blob.bin
$ ../cbfstool/cbfstool BOOT_STUB extract -n mrc.bin -f ../../blobs/nonfree-code/mrc.elf

Then we use this configuration:
$ cd ../../../
$ git clone https://review.coreboot.org/p/board-status.git
$ cp board-status/google/rambi/4.8-1366-g4cafc886195/2018-08-28T15_36_51Z/config.txt coreboot/.config
$ cd ../

Then we need MrChrmebox's SeaBIOS:
$ git clone git://github.com/MrChromebox/SeaBIOS.git mr-chromebox_seabios
$ cd mr-chromebox_seabios
$ git checkout 31e50ca9db071c93c6f5bc40789a4818ea8fda05 -b tested
$ cp configs/.config-byt-coreboot .config
$ make EXTRAVERSION=-MrChromebox-`date +"%Y.%m.%d"`
$ cd ../

For this test I also reduced the CONFIG_DEBUG_LEVEL to 2 instead of 5
in MrChromebox's SeaBIOS configuration.

Then we can build coreboot as usual which typically consist of:
$ cd coreboot
$ make crossgcc-i386
$ make

To install the coreboot image you just built, the first time you
will need to disassemble the laptop and remove the screws.
This will also remove the flash chip write protection at the same time.

The flash chip is located on the bottom of the laptop mainboard.
You then need to connect and external flash programmer and program
the flash chip this way.

Once coreboot has been installed with an installed with an external flash
programmer, it's then easier to update it from the laptop itself.
We then can do that (tested with Parabolaand flashrom 1.0) like that:
$ sudo flashrom -p internal:laptop=force_I_want_a_brick -w build/coreboot.rom

References:
-----------
[1]https://github.com/MrChromebox/SeaBIOS.git
[2]https://bbs.archlinux.org/viewtopic.php?id=202067
[3]The flash descriptor (flashregion_0_flashdescriptor.bin)

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
8 files changed