]> Git Repo - u-boot.git/blame - doc/README.chromium
Merge tag 'mmc-1-16-2020' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmc
[u-boot.git] / doc / README.chromium
CommitLineData
9d73e85a
SG
1Chromium OS Support in U-Boot
2=============================
c9af6673 3
9d73e85a
SG
4Introduction
5------------
c9af6673 6
9d73e85a
SG
7This describes how to use U-Boot with Chromium OS. Several options are
8available:
c9af6673 9
9d73e85a
SG
10 - Running U-Boot from the 'altfw' feature, which is available on selected
11 Chromebooks from 2019 onwards (initially Grunt). Press '1' from the
12 developer-mode screen to get into U-Boot. See here for details:
13 https://sites.google.com/a/chromium.org/dev/chromium-os/poking-around-your-chrome-os-device?pli=1
c9af6673 14
9d73e85a
SG
15 - Running U-Boot from the disk partition. This involves signing U-Boot and
16 placing it on the disk, for booting as a 'kernel'. See
17 README.chromium-chainload for information on this. This is the only
18 option on non-U-Boot Chromebooks from 2013 to 2018 and is somewhat
19 more involved.
c9af6673 20
9d73e85a
SG
21 - Running U-Boot with Chromium OS verified boot. This allows U-Boot to be
22 used instead of either or both of depthcharge (a bootloader which forked
23 from U-Boot in 2013) and coreboot. See below for more information on
24 this.
c9af6673 25
c9af6673 26
9d73e85a
SG
27U-Boot with Chromium OS verified boot
28-------------------------------------
c9af6673 29
9d73e85a 30To obtain:
c9af6673 31
9d73e85a
SG
32 git clone https://github.com/sglass68/u-boot.git
33 cd u-boot
34 git checkout cros-master
c9af6673 35
1b96da67
SG
36 cd ..
37 git clone https://chromium.googlesource.com/chromiumos/platform/vboot_reference
38 cd vboot_reference
39 git checkout 45964294
40 # futility: updater: Correct output version for Snow
41
9d73e85a 42To build for sandbox:
c9af6673 43
9d73e85a 44 UB=/tmp/b/chromeos_sandbox # U-Boot build directory
1b96da67
SG
45 cd u-boot
46 make O=$UB chromeos_sandbox_defconfig
47 make O=$UB -j20 -s VBOOT_SOURCE=/path/to/vboot_reference \
9d73e85a 48 MAKEFLAGS_VBOOT=DEBUG=1 QUIET=1
c9af6673 49
9d73e85a 50Replace sandbox with another supported target.
c9af6673 51
9d73e85a
SG
52This produces $UB/image.bin which contains the firmware binaries in a SPI
53flash image.
c9af6673 54
9d73e85a 55To run on sandbox:
c9af6673 56
9d73e85a
SG
57 $UB/tpl/u-boot-tpl -d $UB/u-boot.dtb.out \
58 -L6 -c "host bind 0 $CROS/src/build/images/cheza/latest/chromiumos_image.bin; vboot go auto" \
59 -l -w -s state.dtb -r
c9af6673 60
9d73e85a
SG
61To run on other boards:
62 Install image.bin in the SPI flash of your device
63 Boot your system
c9af6673 64
c9af6673 65
9d73e85a
SG
66Sandbox
67-------
c9af6673 68
9d73e85a
SG
69Most Chromium OS development with U-Boot is undertaken using sandbox. There is
70a sandbox target available (chromeos_sandbox) which allows running U-Boot on
71a Linux machine completion with emulations of the display, TPM, disk, etc.
c9af6673 72
9d73e85a
SG
73Running sandbox starts TPL, which contains the first phase of vboot, providing
74a device tree and binding a Chromium OS disk image for use to find kernels
75(any Chromium OS image will do). It also saves driver state between U-Boot
76phases into state.dtb and will automatically ensure that memory is shared
77between all phases. TPL will jump to SPL and then on to U-Boot proper.
c9af6673 78
9d73e85a 79It is possible to run with debugging on, e.g.
c9af6673 80
9d73e85a 81 gdb --args $UB/tpl/u-boot-tpl -d ....
c9af6673 82
9d73e85a
SG
83Breakpoints can be set in any U-Boot phase. Overall this is a good debugging
84environment for new verified-boot features.
c9af6673 85
c9af6673 86
9d73e85a
SG
87Samus
88-----
c9af6673 89
9d73e85a
SG
90Basic support is available for samus, using the chromeos_samus target. If you
91have an em100, use:
c9af6673 92
9d73e85a 93 sudo em100 -s -c W25Q128FW -d $UB/image.bin -t -r
c9af6673 94
9d73e85a 95to write the image and then boot samus (Power-Refresh).
c9af6673 96
c9af6673 97
9d73e85a
SG
98Boot flow
99---------
c9af6673 100
9d73e85a
SG
101Verified boot starts in TPL, which selects the A or B SPL, which in turn selects
102the A or B U-Boot. Then this jumps to the selected kernel. If anything goes
103wrong, the device reboots and the recovery SPL and U-Boot are used instead.
c9af6673 104
9d73e85a 105More details are available here:
c9af6673 106
9d73e85a 107 https://www.chromium.org/chromium-os/chromiumos-design-docs/firmware-boot-and-recovery
c9af6673 108
c9af6673 109
9d73e85a
SG
110New uclasses
111------------
c9af6673 112
9d73e85a 113Several uclasses are provided in cros/:
fe67eacc 114
9d73e85a
SG
115 UCLASS_CROS_AUX_FW Chrome OS auxiliary firmware
116 UCLASS_CROS_FWSTORE Chrome OS firmware storage
117 UCLASS_CROS_NVDATA Chrome OS non-volatile data device
118 UCLASS_CROS_VBOOT_EC Chrome OS vboot EC operations
119 UCLASS_CROS_VBOOT_FLAG Chrome OS verified boot flag
fe67eacc 120
9d73e85a 121The existing UCLASS_CROS_EC is also used.
fe67eacc 122
fe67eacc 123
9d73e85a
SG
124Commands
125--------
fe67eacc 126
9d73e85a
SG
127A new 'vboot' command is provided to run particular vboot stages. The most
128useful command is 'vboot go auto', which continues where the last stage left
129off.
fe67eacc 130
9d73e85a
SG
131Note that TPL and SPL do not supports commands as yet, so the vboot code is
132called directly from the SPL boot devices (BOOT_DEVICE_CROS_VBOOT). See
133cros_load_image_tpl() and cros_load_image_spl() which both call
134vboot_run_auto().
fe67eacc 135
fe67eacc 136
9d73e85a
SG
137Config options
138--------------
fe67eacc 139
9d73e85a
SG
140The main option is CONFIG_CHROMEOS, which enables a wide array of other options
141so that the required features are present.
fe67eacc 142
fe67eacc 143
9d73e85a
SG
144Device-tree config
145------------------
fe67eacc 146
9d73e85a
SG
147Various options are available which control the operation of verified boot.
148See cros/dts/bindings/config.txt for details. Most config is handled at run-
149time, although build-time config (with Kconfig) could also be added fairly
150easily.
fe67eacc 151
fe67eacc 152
9d73e85a
SG
153Porting to other hardware
154-------------------------
fe67eacc 155
9d73e85a
SG
156A basic port to samus (Chromebook Pixel 2015) is in a basic working state,
157using the chromeos_samus target. Patches will likely be forthcoming in early
1582019. Ports to an ARM board and coreboot (for x86 Chromebooks) are in the
159dreaming state.
fe67eacc 160
fe67eacc 161
9d73e85a
SG
162Tests
163-----
fe67eacc 164
9d73e85a
SG
165Chromium OS firmware has a very limited set of tests. The tests that originally
166existed in U-Boot were not brought over to coreboot or depthcharge.
c9af6673 167
9d73e85a
SG
168The U-Boot tests ('make check') do operate, but at present there are no
169Chromium OS tests available. These will hopefully come together over time. Of
170course the above sandbox feature provides a sort of functional test and can
171detecte problems that affect the flow or particular vboot features.
c9af6673 172
c9af6673 173
9d73e85a
SG
174TO DO
175-----
c9af6673 176
9d73e85a
SG
177- Support for booting from coreboot (patches expected March 2019)
178- Support for booting from an ARM board, e.g. bob
c9af6673 179
c9af6673 180
9d73e85a
SG
181Simon Glass
182[email protected]
1837 October 2018
This page took 0.15197 seconds and 4 git commands to generate.