aboutsummaryrefslogtreecommitdiff
path: root/projects
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2016-12-23 14:20:24 +0100
committerLeah Rowe <info@minifree.org>2017-01-15 14:24:45 +0000
commit112003a55671ffa5285145280988dc1248b26b08 (patch)
treee103e0f21ac52c28056db6211758217a41b0b3fd /projects
parent3d08effb91acf985bae9c4eb4386937ce7ed92a9 (diff)
downloadlibrebootfr-112003a55671ffa5285145280988dc1248b26b08.tar.gz
librebootfr-112003a55671ffa5285145280988dc1248b26b08.zip
Paper build system initial import into Libreboot
This is the initial import of the Paper build system into Libreboot. It was written as a flexible and painless replacement for the Libreboot build system, allowing to support many different configurations. It currently only supports the following CrOS devices: * Chromebook 13 CB5-311 (nyan big) * Chromebook 14 (nyan blaze) * Chromebook 11 (HiSense) (veyron jerry) * Chromebit CS10 (veyron mickey) * Chromebook Flip C100PA (veyron minnie) * Chromebook C201PA (veyron speedy) The build system also supports building various tools and provides various scripts to ease the installation on CrOS devices. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'projects')
-rwxr-xr-xprojects/cbfstool/cbfstool108
l---------projects/cbfstool/configs/blobs1
l---------projects/cbfstool/configs/blobs-ignore1
l---------projects/cbfstool/configs/blobs-ignore-notes.txt1
-rw-r--r--projects/cbfstool/configs/install2
l---------projects/cbfstool/configs/revision1
l---------projects/cbfstool/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch1
-rwxr-xr-xprojects/cbmem/cbmem107
l---------projects/cbmem/configs/blobs1
l---------projects/cbmem/configs/blobs-ignore1
l---------projects/cbmem/configs/blobs-ignore-notes.txt1
-rw-r--r--projects/cbmem/configs/install1
l---------projects/cbmem/configs/revision1
l---------projects/cbmem/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch1
-rw-r--r--projects/coreboot/configs/blobs54
-rw-r--r--projects/coreboot/configs/blobs-ignore449
-rw-r--r--projects/coreboot/configs/blobs-ignore-notes.txt15
-rw-r--r--projects/coreboot/configs/depthcharge/nyan/arch1
-rw-r--r--projects/coreboot/configs/depthcharge/nyan/big/config7
-rw-r--r--projects/coreboot/configs/depthcharge/nyan/blaze/config12
-rw-r--r--projects/coreboot/configs/depthcharge/nyan/ec1
-rw-r--r--projects/coreboot/configs/depthcharge/nyan/targets2
-rw-r--r--projects/coreboot/configs/depthcharge/targets2
-rw-r--r--projects/coreboot/configs/depthcharge/veyron/arch1
-rw-r--r--projects/coreboot/configs/depthcharge/veyron/jerry/config12
-rw-r--r--projects/coreboot/configs/depthcharge/veyron/jerry/ec1
-rw-r--r--projects/coreboot/configs/depthcharge/veyron/mickey/config5
-rw-r--r--projects/coreboot/configs/depthcharge/veyron/minnie/config7
-rw-r--r--projects/coreboot/configs/depthcharge/veyron/minnie/ec1
-rw-r--r--projects/coreboot/configs/depthcharge/veyron/speedy/config7
-rw-r--r--projects/coreboot/configs/depthcharge/veyron/speedy/ec1
-rw-r--r--projects/coreboot/configs/depthcharge/veyron/targets4
-rw-r--r--projects/coreboot/configs/install1
-rw-r--r--projects/coreboot/configs/revision1
-rw-r--r--projects/coreboot/configs/targets1
-rwxr-xr-xprojects/coreboot/coreboot135
-rw-r--r--projects/coreboot/coreboot-helper38
-rw-r--r--projects/coreboot/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch122
-rw-r--r--projects/coreboot/patches/0002-libpayload-Update-ARM-CrOS-devices-configuration.patch56
-rw-r--r--projects/coreboot/patches/0003-libpayload-Get-current-tick-from-high-register-in-ge.patch32
-rw-r--r--projects/coreboot/patches/0004-libpayload-Enable-USB-HID-in-veyron-configuration.patch27
-rw-r--r--projects/cros-ec/configs/nyan/big/config1
-rw-r--r--projects/cros-ec/configs/nyan/blaze/config1
-rw-r--r--projects/cros-ec/configs/nyan/install2
-rw-r--r--projects/cros-ec/configs/nyan/revision1
-rw-r--r--projects/cros-ec/configs/nyan/targets2
-rw-r--r--projects/cros-ec/configs/targets3
-rw-r--r--projects/cros-ec/configs/tools/install6
-rw-r--r--projects/cros-ec/configs/tools/revision1
-rw-r--r--projects/cros-ec/configs/veyron/install2
-rw-r--r--projects/cros-ec/configs/veyron/jerry/config1
-rw-r--r--projects/cros-ec/configs/veyron/minnie/config1
-rw-r--r--projects/cros-ec/configs/veyron/revision1
-rw-r--r--projects/cros-ec/configs/veyron/speedy/config1
-rw-r--r--projects/cros-ec/configs/veyron/targets3
-rwxr-xr-xprojects/cros-ec/cros-ec136
-rwxr-xr-xprojects/cros-ec/cros-ec-helper22
-rw-r--r--projects/cros-ec/patches/nyan/0001-use-_DEFAULT_SOURCE-for-newer-glibc.patch53
-rw-r--r--projects/cros-ec/patches/nyan/0002-Enforce-compilation-without-system-headers.patch27
-rw-r--r--projects/cros-ec/patches/nyan/0003-Don-t-declare-functions-inline-that-aren-t-always-de.patch28
-rw-r--r--projects/cros-ec/patches/nyan/0004-cortex-m-Use-assembly-exception-handler-and-routine-.patch230
-rw-r--r--projects/cros-ec/patches/veyron/0001-ec-fix-a-clang-warning-by-use-a-unused-variable.patch38
-rw-r--r--projects/cros-ec/patches/veyron/0002-use-_DEFAULT_SOURCE-for-newer-glibc.patch53
-rw-r--r--projects/cros-ec/patches/veyron/0003-Enforce-compilation-without-system-headers.patch44
-rw-r--r--projects/cros-ec/patches/veyron/0004-Don-t-declare-functions-inline-that-aren-t-always-de.patch28
-rw-r--r--projects/cros-ec/patches/veyron/0005-Don-t-include-missing-and-unnecessary-math-header.patch29
-rw-r--r--projects/cros-ec/patches/veyron/0006-cortex-m0-Use-assembly-exception-handlers-for-task-s.patch219
-rwxr-xr-xprojects/cros-scripts/cros-scripts36
-rwxr-xr-xprojects/cros-scripts/install/cros-kernel-prepare155
-rwxr-xr-xprojects/cros-scripts/install/cros-medium-setup313
-rw-r--r--projects/cros-scripts/install/install2
-rw-r--r--projects/cros-tools/configs/projects7
-rwxr-xr-xprojects/cros-tools/cros-tools44
l---------projects/crossgcc/configs/blobs1
l---------projects/crossgcc/configs/blobs-ignore1
l---------projects/crossgcc/configs/blobs-ignore-notes.txt1
-rw-r--r--projects/crossgcc/configs/install1
l---------projects/crossgcc/configs/revision1
-rw-r--r--projects/crossgcc/configs/targets1
-rwxr-xr-xprojects/crossgcc/crossgcc209
-rwxr-xr-xprojects/crossgcc/crossgcc-helper53
l---------projects/crossgcc/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch1
-rw-r--r--projects/depthcharge/configs/install1
-rw-r--r--projects/depthcharge/configs/nyan/arch1
-rw-r--r--projects/depthcharge/configs/revision1
-rw-r--r--projects/depthcharge/configs/targets2
-rw-r--r--projects/depthcharge/configs/veyron/arch1
-rwxr-xr-xprojects/depthcharge/depthcharge108
-rwxr-xr-xprojects/depthcharge/depthcharge-helper26
-rw-r--r--projects/depthcharge/patches/0001-fdt-nonvolatile-context-storage-report-to-mkbp-for-E.patch31
-rw-r--r--projects/depthcharge/patches/0002-Proper-firmware-index-report-for-read-only-boot-path.patch71
-rw-r--r--projects/depthcharge/patches/0003-vboot-Display-callbacks-for-all-screens.patch240
-rw-r--r--projects/depthcharge/patches/0004-mmc-Initialize-clock-variable-in-mmc_recalculate_clo.patch30
-rw-r--r--projects/flashmap/configs/install1
-rw-r--r--projects/flashmap/configs/revision1
-rwxr-xr-xprojects/flashmap/flashmap94
-rw-r--r--projects/flashrom-cros/configs/install1
-rw-r--r--projects/flashrom-cros/configs/revision1
-rwxr-xr-xprojects/flashrom-cros/flashrom-cros106
-rw-r--r--projects/flashrom-cros/patches/0001-programmer.h-Define-ich_generation-after-enum-declar.patch37
-rw-r--r--projects/flashrom/configs/install1
l---------projects/flashrom/configs/lenovobios/revision1
-rw-r--r--projects/flashrom/configs/revision1
-rw-r--r--projects/flashrom/configs/targets2
-rwxr-xr-xprojects/flashrom/flashrom115
-rw-r--r--projects/flashrom/patches/0001-New-laptops-whitelisted-ThinkPad-R400-and-ThinkPad-T.patch28
-rw-r--r--projects/flashrom/patches/0002-Add-whitelist-for-Taurinus-X200-laptop.patch24
-rw-r--r--projects/flashrom/patches/0003-purged-chips.patch354
-rw-r--r--projects/flashrom/patches/lenovobios/0001-Lenovobios-adaptation-for-Macronix-and-SST-chips.patch65
-rw-r--r--projects/hdctools/configs/install6
-rw-r--r--projects/hdctools/configs/revision1
-rwxr-xr-xprojects/hdctools/hdctools100
-rw-r--r--projects/hdctools/patches/0001-Remove-Werror-flag.patch25
-rw-r--r--projects/libpayload/configs/depthcharge/nyan/arch1
-rw-r--r--projects/libpayload/configs/depthcharge/nyan/config1
-rw-r--r--projects/libpayload/configs/depthcharge/targets2
-rw-r--r--projects/libpayload/configs/depthcharge/veyron/arch1
-rw-r--r--projects/libpayload/configs/depthcharge/veyron/config1
-rw-r--r--projects/libpayload/configs/install1
-rw-r--r--projects/libpayload/configs/targets1
-rwxr-xr-xprojects/libpayload/libpayload69
-rwxr-xr-xprojects/libpayload/libpayload-helper27
-rw-r--r--projects/libreboot-all/configs/projects5
-rwxr-xr-xprojects/libreboot-all/libreboot-all44
-rw-r--r--projects/libreboot-bootstrap/install/install1
-rwxr-xr-xprojects/libreboot-bootstrap/install/libreboot-bootstrap182
-rwxr-xr-xprojects/libreboot-bootstrap/libreboot-bootstrap36
-rw-r--r--projects/libreboot-images/configs/projects6
-rw-r--r--projects/libreboot-images/configs/projects-build2
-rwxr-xr-xprojects/libreboot-images/libreboot-images44
-rw-r--r--projects/libreboot-release/install/install1
-rwxr-xr-xprojects/libreboot-release/install/libreboot-release316
-rwxr-xr-xprojects/libreboot-release/libreboot-release38
-rwxr-xr-xprojects/libreboot-sources/libreboot-sources49
-rw-r--r--projects/libreboot-tools/configs/projects4
-rw-r--r--projects/libreboot-tools/configs/projects-download5
l---------projects/libreboot-tools/configs/projects-update1
-rwxr-xr-xprojects/libreboot-tools/libreboot-tools44
-rw-r--r--projects/mosys/configs/install1
-rw-r--r--projects/mosys/configs/revision1
-rwxr-xr-xprojects/mosys/mosys111
-rw-r--r--projects/mosys/patches/0001-Force-the-definition-of-build-tools.patch44
l---------projects/nvramtool/configs/blobs1
l---------projects/nvramtool/configs/blobs-ignore1
l---------projects/nvramtool/configs/blobs-ignore-notes.txt1
-rw-r--r--projects/nvramtool/configs/install1
l---------projects/nvramtool/configs/revision1
-rwxr-xr-xprojects/nvramtool/nvramtool107
l---------projects/nvramtool/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch1
-rw-r--r--projects/vboot/configs/blobs22
-rw-r--r--projects/vboot/configs/blobs-ignore33
-rw-r--r--projects/vboot/configs/blobs-ignore-notes.txt5
-rw-r--r--projects/vboot/configs/revision1
-rw-r--r--projects/vboot/configs/targets2
-rw-r--r--projects/vboot/configs/tools/install5
-rw-r--r--projects/vboot/patches/0001-firmware-Developer-mode-timeout-delay-shortening-dow.patch34
-rw-r--r--projects/vboot/patches/0002-firmware-Text-based-screen-display-in-priority.patch61
-rw-r--r--projects/vboot/patches/0003-firmware-Hold-key-combination-in-developer-mode.patch50
-rw-r--r--projects/vboot/patches/0004-firmware-Screen-blank-and-wait-at-disabled-USB-boot-.patch56
-rw-r--r--projects/vboot/patches/0005-firmware-Separate-screen-and-wait-at-device-informat.patch80
-rw-r--r--projects/vboot/patches/0006-firmware-Localization-keys-removal.patch54
-rw-r--r--projects/vboot/patches/0007-firmware-Pass-VbDisplayInfo-information-structure-to.patch354
-rwxr-xr-xprojects/vboot/vboot147
163 files changed, 6514 insertions, 0 deletions
diff --git a/projects/cbfstool/cbfstool b/projects/cbfstool/cbfstool
new file mode 100755
index 00000000..aa866027
--- /dev/null
+++ b/projects/cbfstool/cbfstool
@@ -0,0 +1,108 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+download() {
+ local repository="coreboot"
+
+ git_project_prepare "$project" "$repository" "$@"
+}
+
+download_check() {
+ local repository="coreboot"
+
+ git_project_prepare_check "$project" "$repository" "$@"
+}
+
+extract() {
+ local repository="coreboot"
+
+ project_extract "$project" "$@"
+}
+
+extract_check() {
+ local repository="coreboot"
+
+ project_extract_check "$project" "$@"
+}
+
+update() {
+ local repository="coreboot"
+
+ project_update_git "$project" "$repository" "$@"
+}
+
+update_check() {
+ local repository="coreboot"
+
+ project_update_check_git "$project" "$repository" "$@"
+}
+
+build() {
+ local repository="coreboot"
+
+ project_sources_directory_missing_empty_error "$project" "$repository" "$@"
+
+ local coreboot_sources_path=$( project_sources_path "$project" "$repository" "$@" )
+ local sources_path="$coreboot_sources_path/util/cbfstool/"
+ local build_path=$( project_build_path "$project" "$@" )
+ local build_util_path=$( dirname "$build_path" )
+
+ local vboot_sources_path=$( project_sources_path "vboot" "vboot" "devices" )
+
+ if git_project_check "$repository"
+ then
+ git_project_checkout "$project" "$repository" "$@"
+ fi
+
+ project_action "checkout" "vboot" "devices"
+
+ mkdir -p "$build_path"
+
+ make -C "$sources_path" objutil="$build_util_path" VBOOT_SOURCE="$vboot_sources_path" -j$TASKS
+}
+
+build_check() {
+ project_build_check "$project" "$@"
+}
+
+install() {
+ project_install "$project" "$@"
+}
+
+install_check() {
+ project_install_check "$project" "$@"
+}
+
+release() {
+ local repository="coreboot"
+
+ project_release_install_archive "$project" "$TOOLS" "$@"
+
+ project_release_sources_git "$project" "$repository" "$@"
+}
+
+release_check() {
+ local repository="coreboot"
+
+ project_release_install_archive_check "$project" "$TOOLS" "$@"
+
+ project_release_check_sources_git "$project" "$repository" "$@"
+}
+
+clean() {
+ project_clean "$project" "$@"
+}
diff --git a/projects/cbfstool/configs/blobs b/projects/cbfstool/configs/blobs
new file mode 120000
index 00000000..8574352d
--- /dev/null
+++ b/projects/cbfstool/configs/blobs
@@ -0,0 +1 @@
+../../coreboot/configs/blobs \ No newline at end of file
diff --git a/projects/cbfstool/configs/blobs-ignore b/projects/cbfstool/configs/blobs-ignore
new file mode 120000
index 00000000..04d6519e
--- /dev/null
+++ b/projects/cbfstool/configs/blobs-ignore
@@ -0,0 +1 @@
+../../coreboot/configs/blobs-ignore \ No newline at end of file
diff --git a/projects/cbfstool/configs/blobs-ignore-notes.txt b/projects/cbfstool/configs/blobs-ignore-notes.txt
new file mode 120000
index 00000000..3f05ba9b
--- /dev/null
+++ b/projects/cbfstool/configs/blobs-ignore-notes.txt
@@ -0,0 +1 @@
+../../coreboot/configs/blobs-ignore-notes.txt \ No newline at end of file
diff --git a/projects/cbfstool/configs/install b/projects/cbfstool/configs/install
new file mode 100644
index 00000000..6157184f
--- /dev/null
+++ b/projects/cbfstool/configs/install
@@ -0,0 +1,2 @@
+cbfstool:cbfstool
+fmaptool:fmaptool
diff --git a/projects/cbfstool/configs/revision b/projects/cbfstool/configs/revision
new file mode 120000
index 00000000..006c3a7a
--- /dev/null
+++ b/projects/cbfstool/configs/revision
@@ -0,0 +1 @@
+../../coreboot/configs/revision \ No newline at end of file
diff --git a/projects/cbfstool/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch b/projects/cbfstool/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch
new file mode 120000
index 00000000..627443a5
--- /dev/null
+++ b/projects/cbfstool/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch
@@ -0,0 +1 @@
+../../coreboot/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch \ No newline at end of file
diff --git a/projects/cbmem/cbmem b/projects/cbmem/cbmem
new file mode 100755
index 00000000..50fcb7d5
--- /dev/null
+++ b/projects/cbmem/cbmem
@@ -0,0 +1,107 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+download() {
+ local repository="coreboot"
+
+ git_project_prepare "$project" "$repository" "$@"
+}
+
+download_check() {
+ local repository="coreboot"
+
+ git_project_prepare_check "$project" "$repository" "$@"
+}
+
+extract() {
+ local repository="coreboot"
+
+ project_extract "$project" "$@"
+}
+
+extract_check() {
+ local repository="coreboot"
+
+ project_extract_check "$project" "$@"
+}
+
+update() {
+ local repository="coreboot"
+
+ project_update_git "$project" "$repository" "$@"
+}
+
+update_check() {
+ local repository="coreboot"
+
+ project_update_check_git "$project" "$repository" "$@"
+}
+
+build() {
+ local repository="coreboot"
+
+ project_sources_directory_missing_empty_error "$project" "$repository" "$@"
+
+ local coreboot_sources_path=$( project_sources_path "$project" "$repository" "$@" )
+ local sources_path="$coreboot_sources_path/util/cbmem/"
+ local build_path=$( project_build_path "$project" "$@" )
+
+ if git_project_check "$repository"
+ then
+ git_project_checkout "$project" "$repository" "$@"
+ fi
+
+ mkdir -p "$build_path"
+
+ make -C "$sources_path" -j$TASKS
+
+ cp "$sources_path/cbmem" "$build_path"
+
+ make -C "$sources_path" "clean"
+}
+
+build_check() {
+ project_build_check "$project" "$@"
+}
+
+install() {
+ project_install "$project" "$@"
+}
+
+install_check() {
+ project_install_check "$project" "$@"
+}
+
+release() {
+ local repository="coreboot"
+
+ project_release_install_archive "$project" "$TOOLS" "$@"
+
+ project_release_sources_git "$project" "$repository" "$@"
+}
+
+release_check() {
+ local repository="coreboot"
+
+ project_release_install_archive_check "$project" "$TOOLS" "$@"
+
+ project_release_check_sources_git "$project" "$repository" "$@"
+}
+
+clean() {
+ project_clean "$project" "$@"
+}
diff --git a/projects/cbmem/configs/blobs b/projects/cbmem/configs/blobs
new file mode 120000
index 00000000..8574352d
--- /dev/null
+++ b/projects/cbmem/configs/blobs
@@ -0,0 +1 @@
+../../coreboot/configs/blobs \ No newline at end of file
diff --git a/projects/cbmem/configs/blobs-ignore b/projects/cbmem/configs/blobs-ignore
new file mode 120000
index 00000000..04d6519e
--- /dev/null
+++ b/projects/cbmem/configs/blobs-ignore
@@ -0,0 +1 @@
+../../coreboot/configs/blobs-ignore \ No newline at end of file
diff --git a/projects/cbmem/configs/blobs-ignore-notes.txt b/projects/cbmem/configs/blobs-ignore-notes.txt
new file mode 120000
index 00000000..3f05ba9b
--- /dev/null
+++ b/projects/cbmem/configs/blobs-ignore-notes.txt
@@ -0,0 +1 @@
+../../coreboot/configs/blobs-ignore-notes.txt \ No newline at end of file
diff --git a/projects/cbmem/configs/install b/projects/cbmem/configs/install
new file mode 100644
index 00000000..0936568b
--- /dev/null
+++ b/projects/cbmem/configs/install
@@ -0,0 +1 @@
+cbmem:cbmem
diff --git a/projects/cbmem/configs/revision b/projects/cbmem/configs/revision
new file mode 120000
index 00000000..006c3a7a
--- /dev/null
+++ b/projects/cbmem/configs/revision
@@ -0,0 +1 @@
+../../coreboot/configs/revision \ No newline at end of file
diff --git a/projects/cbmem/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch b/projects/cbmem/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch
new file mode 120000
index 00000000..627443a5
--- /dev/null
+++ b/projects/cbmem/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch
@@ -0,0 +1 @@
+../../coreboot/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch \ No newline at end of file
diff --git a/projects/coreboot/configs/blobs b/projects/coreboot/configs/blobs
new file mode 100644
index 00000000..80efbe26
--- /dev/null
+++ b/projects/coreboot/configs/blobs
@@ -0,0 +1,54 @@
+src/cpu/dmp/vortex86ex/dmp_kbd_fw_part1.inc
+src/vendorcode/amd/agesa/f10/Proc/CPU/Family/0x10/RevC/F10MicrocodePatch01000085.c
+src/vendorcode/amd/agesa/f10/Proc/CPU/Family/0x10/RevC/F10MicrocodePatch01000086.c
+src/vendorcode/amd/agesa/f10/Proc/CPU/Family/0x10/RevC/F10MicrocodePatch01000098.c
+src/vendorcode/amd/agesa/f10/Proc/CPU/Family/0x10/RevC/F10MicrocodePatch010000b6.c
+src/vendorcode/amd/agesa/f10/Proc/CPU/Family/0x10/RevD/F10MicrocodePatch010000c4.c
+src/vendorcode/amd/agesa/f10/Proc/CPU/Family/0x10/RevD/F10MicrocodePatch010000c5.c
+src/vendorcode/amd/agesa/f12/Proc/CPU/Family/0x10/RevC/F10MicrocodePatch01000085.c
+src/vendorcode/amd/agesa/f12/Proc/CPU/Family/0x10/RevC/F10MicrocodePatch010000c6.c
+src/vendorcode/amd/agesa/f12/Proc/CPU/Family/0x10/RevC/F10MicrocodePatch010000c7.c
+src/vendorcode/amd/agesa/f12/Proc/CPU/Family/0x10/RevC/F10MicrocodePatch010000c8.c
+src/vendorcode/amd/agesa/f12/Proc/CPU/Family/0x10/RevD/F10MicrocodePatch010000c4.c
+src/vendorcode/amd/agesa/f12/Proc/CPU/Family/0x10/RevD/F10MicrocodePatch010000c5.c
+src/vendorcode/amd/agesa/f12/Proc/CPU/Family/0x10/RevE/F10MicrocodePatch010000bf.c
+src/vendorcode/amd/agesa/f12/Proc/CPU/Family/0x12/F12MicrocodePatch03000002.c
+src/vendorcode/amd/agesa/f12/Proc/CPU/Family/0x12/F12MicrocodePatch0300000e.c
+src/vendorcode/amd/agesa/f12/Proc/CPU/Family/0x12/F12MicrocodePatch0300000f.c
+src/vendorcode/amd/agesa/f12/Proc/GNB/Nb/Family/LN/F12NbSmuFirmware.h
+src/vendorcode/amd/agesa/f12/Proc/GNB/PCIe/Family/LN/F12PcieAlibSsdt.h
+src/vendorcode/amd/agesa/f14/Proc/CPU/Family/0x10/RevC/F10MicrocodePatch01000085.c
+src/vendorcode/amd/agesa/f14/Proc/CPU/Family/0x10/RevC/F10MicrocodePatch010000c6.c
+src/vendorcode/amd/agesa/f14/Proc/CPU/Family/0x10/RevC/F10MicrocodePatch010000c7.c
+src/vendorcode/amd/agesa/f14/Proc/CPU/Family/0x10/RevC/F10MicrocodePatch010000c8.c
+src/vendorcode/amd/agesa/f14/Proc/CPU/Family/0x10/RevD/F10MicrocodePatch010000c4.c
+src/vendorcode/amd/agesa/f14/Proc/CPU/Family/0x10/RevD/F10MicrocodePatch010000c5.c
+src/vendorcode/amd/agesa/f14/Proc/CPU/Family/0x10/RevE/F10MicrocodePatch010000bf.c
+src/vendorcode/amd/agesa/f14/Proc/CPU/Family/0x14/F14MicrocodePatch0500000B.c
+src/vendorcode/amd/agesa/f14/Proc/CPU/Family/0x14/F14MicrocodePatch0500001A.c
+src/vendorcode/amd/agesa/f14/Proc/CPU/Family/0x14/F14MicrocodePatch05000029.c
+src/vendorcode/amd/agesa/f14/Proc/CPU/Family/0x14/F14MicrocodePatch05000119.c
+src/vendorcode/amd/agesa/f14/Proc/GNB/Nb/Family/0x14/F14NbSmuFirmware.h
+src/vendorcode/amd/agesa/f14/Proc/GNB/PCIe/Family/0x14/F14PcieAlibSsdt.h
+src/vendorcode/amd/agesa/f15/Proc/CPU/Family/0x10/RevC/F10MicrocodePatch01000085.c
+src/vendorcode/amd/agesa/f15/Proc/CPU/Family/0x10/RevC/F10MicrocodePatch010000c6.c
+src/vendorcode/amd/agesa/f15/Proc/CPU/Family/0x10/RevC/F10MicrocodePatch010000c7.c
+src/vendorcode/amd/agesa/f15/Proc/CPU/Family/0x10/RevC/F10MicrocodePatch010000c8.c
+src/vendorcode/amd/agesa/f15/Proc/CPU/Family/0x10/RevD/F10MicrocodePatch010000c5.c
+src/vendorcode/amd/agesa/f15/Proc/CPU/Family/0x10/RevD/F10MicrocodePatch010000d9.c
+src/vendorcode/amd/agesa/f15/Proc/CPU/Family/0x10/RevE/F10MicrocodePatch010000bf.c
+src/vendorcode/amd/agesa/f15/Proc/CPU/Family/0x15/OR/F15OrMicrocodePatch06000425.c
+src/vendorcode/amd/agesa/f15/Proc/CPU/Family/0x15/OR/F15OrMicrocodePatch0600050D_Enc.c
+src/vendorcode/amd/agesa/f15/Proc/CPU/Family/0x15/OR/F15OrMicrocodePatch06000624_Enc.c
+src/vendorcode/amd/agesa/f15tn/Proc/CPU/Family/0x15/TN/F15TnMicrocodePatch0600110F_Enc.c
+src/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/GnbCacWeightsTN.h
+src/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/GnbSmuFirmwareTN.h
+src/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/PcieAlibSsdtTNFM2.h
+src/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/PcieAlibSsdtTNFS1.h
+src/vendorcode/amd/agesa/f16kb/Proc/CPU/Family/0x16/KB/F16KbId7001MicrocodePatch.c
+src/vendorcode/amd/agesa/f16kb/Proc/GNB/Modules/GnbInitKB/AlibSsdtKB.h
+src/vendorcode/amd/agesa/f16kb/Proc/GNB/Modules/GnbInitKB/excel925.h
+src/vendorcode/amd/agesa/f16kb/Proc/GNB/Modules/GnbInitKB/GnbSamuPatchKB.h
+src/vendorcode/amd/agesa/f16kb/Proc/GNB/Modules/GnbInitKB/GnbSmuFirmwareKB.h
+src/vendorcode/amd/cimx/rd890/HotplugFirmware.h
+src/vendorcode/google/chromeos/build-snow.sh
diff --git a/projects/coreboot/configs/blobs-ignore b/projects/coreboot/configs/blobs-ignore
new file mode 100644
index 00000000..b4fab33c
--- /dev/null
+++ b/projects/coreboot/configs/blobs-ignore
@@ -0,0 +1,449 @@
+Documentation/codeflow.svg
+Documentation/CorebootBuildingGuide.tex
+Documentation/hypertransport.svg
+payloads/external/depthcharge/Kconfig
+payloads/external/FILO/Kconfig
+payloads/external/GRUB2/Kconfig
+payloads/external/SeaBIOS/Kconfig
+payloads/external/U-Boot/Kconfig
+payloads/Kconfig
+payloads/libpayload/curses/PDCurses-3.4/demos/worm.c
+payloads/libpayload/curses/PDCurses-3.4/sdl1/deffont.h
+payloads/libpayload/curses/PDCurses-3.4/sdl1/deficon.h
+payloads/libpayload/curses/PDCurses-3.4/win32/pdckbd.c
+payloads/libpayload/curses/PDCurses-3.4/x11/big_icon.xbm
+payloads/libpayload/curses/PDCurses-3.4/x11/little_icon.xbm
+payloads/libpayload/curses/pdcurses-backend/pdcdisp.c
+payloads/libpayload/curses/PDCurses/demos/worm.c
+payloads/libpayload/curses/PDCurses/sdl1/deffont.h
+payloads/libpayload/curses/PDCurses/sdl1/deficon.h
+payloads/libpayload/curses/PDCurses/win32/pdckbd.c
+payloads/libpayload/curses/PDCurses/x11/big_icon.xbm
+payloads/libpayload/curses/PDCurses/x11/little_icon.xbm
+payloads/libpayload/curses/tinycurses.c
+payloads/libpayload/drivers/keyboard.c
+payloads/libpayload/drivers/usb/usbmsc.c
+payloads/libpayload/tests/cbfs-x86-test.c
+payloads/nvramcui/payload.sh
+src/cpu/allwinner/a10/raminit.c
+src/cpu/amd/family_10h-family_15h/init_cpus.c
+src/cpu/amd/family_10h-family_15h/processor_name.c
+src/cpu/amd/geode_gx2/Kconfig
+src/cpu/amd/geode_lx/cpureginit.c
+src/cpu/amd/geode_lx/Kconfig
+src/cpu/amd/microcode/microcode.c
+src/cpu/amd/model_10xxx/init_cpus.c
+src/cpu/amd/model_10xxx/processor_name.c
+src/cpu/amd/model_fxx/model_fxx_update_microcode.c
+src/cpu/amd/model_fxx/powernow_acpi.c
+src/cpu/intel/fsp_model_206ax/acpi.c
+src/cpu/intel/fsp_model_406dx/acpi.c
+src/cpu/intel/haswell/acpi.c
+src/cpu/intel/microcode/microcode.c
+src/cpu/intel/model_2065x/acpi.c
+src/cpu/intel/model_206ax/acpi.c
+src/cpu/Kconfig
+src/cpu/samsung/exynos5250/update-bl1.sh
+src/cpu/via/nano/update_ucode.c
+src/device/dram/spd_cache.c
+src/device/Kconfig
+src/device/oprom/yabel/interrupt.c
+src/drivers/aspeed/common/ast_dram_tables.h
+src/drivers/aspeed/common/ast_tables.h
+src/drivers/i2c/ww_ring/ww_ring_programs.c
+src/drivers/intel/fsp1_1/car.c
+src/drivers/intel/fsp1_1/fsp_gop.c
+src/drivers/intel/fsp1_1/Kconfig
+src/drivers/intel/fsp1_1/ramstage.c
+src/drivers/intel/fsp2_0/graphics.c
+src/drivers/intel/fsp2_0/Kconfig
+src/drivers/pc80/mc146818rtc.c
+src/drivers/pc80/rtc/mc146818rtc.c
+src/drivers/pc80/vga/vga_palette.c
+src/drivers/siemens/nc_fpga/nc_fpga.c
+src/drivers/xgi/common/vb_setmode.c
+src/drivers/xgi/common/vb_table.h
+src/drivers/xgi/common/XGI_main.h
+src/Kconfig
+src/lib/coreboot_table.c
+src/lib/jpeg.c
+src/lib/tlcl_structures.h
+src/lib/tpm2_tlcl.c
+src/mainboard/adi/rcc-dff/Kconfig
+src/mainboard/advansus/a785e-i/mptable.c
+src/mainboard/amd/bettong/mptable.c
+src/mainboard/amd/bimini_fam10/mptable.c
+src/mainboard/amd/db-ft3b-lc/Memphis_MEM4G16D3EABG.spd.hex
+src/mainboard/amd/dinar/buildOpts.c
+src/mainboard/amd/dinar/Kconfig
+src/mainboard/amd/gardenia/OemCustomize.c
+src/mainboard/amd/inagua/Kconfig
+src/mainboard/amd/lamar/Kconfig
+src/mainboard/amd/olivehill/mptable.c
+src/mainboard/amd/olivehillplus/mptable.c
+src/mainboard/amd/parmer/mptable.c
+src/mainboard/amd/persimmon/Kconfig
+src/mainboard/amd/serengeti_cheetah_fam10/get_bus_conf.c
+src/mainboard/amd/south_station/Kconfig
+src/mainboard/amd/south_station/mptable.c
+src/mainboard/amd/thatcher/mptable.c
+src/mainboard/amd/torpedo/Kconfig
+src/mainboard/amd/torpedo/mptable.c
+src/mainboard/amd/union_station/Kconfig
+src/mainboard/amd/union_station/mptable.c
+src/mainboard/apple/macbookair4_2/early_southbridge.c
+src/mainboard/asrock/e350m1/mptable.c
+src/mainboard/asrock/imb-a180/mptable.c
+src/mainboard/asus/f2a85-m/mptable.c
+src/mainboard/asus/kfsn4-dre/get_bus_conf.c
+src/mainboard/asus/m5a88-v/mptable.c
+src/mainboard/avalue/eax-785e/mptable.c
+src/mainboard/bap/ode_e20XX/BAP_Q7_1066.spd.hex
+src/mainboard/bap/ode_e20XX/BAP_Q7_800.spd.hex
+src/mainboard/bap/ode_e20XX/BAP_Q7.spd.hex
+src/mainboard/bap/ode_e21XX/BAP_Q7_1066.spd.hex
+src/mainboard/bap/ode_e21XX/BAP_Q7_1333.spd.hex
+src/mainboard/bap/ode_e21XX/BAP_Q7_800.spd.hex
+src/mainboard/bap/ode_e21XX/mptable.c
+src/mainboard/digitallogic/adl855pc/irq_tables.c
+src/mainboard/gigabyte/ga-b75m-d3h/romstage.c
+src/mainboard/gigabyte/ga-b75m-d3v/romstage.c
+src/mainboard/gizmosphere/gizmo2/Micron_MT41J128M16JT.spd.hex
+src/mainboard/gizmosphere/gizmo/mptable.c
+src/mainboard/google/auron_paine/spd/spd.c
+src/mainboard/google/auron/spd/Elpida_EDJ4216EFBG.spd.hex
+src/mainboard/google/auron/spd/empty.spd.hex
+src/mainboard/google/auron/spd/Hynix_HMT425S6AFR6A.spd.hex
+src/mainboard/google/auron/spd/Micron_4KTF25664HZ.spd.hex
+src/mainboard/google/auron/spd/spd.c
+src/mainboard/google/bolt/elpida_4Gb_1600_x16.spd.hex
+src/mainboard/google/bolt/micron_4Gb_1600_1.35v_x16.spd.hex
+src/mainboard/google/bolt/romstage.c
+src/mainboard/google/bolt/samsung_4Gb_1600_1.35v_x16.spd.hex
+src/mainboard/google/butterfly/hda_verb.c
+src/mainboard/google/butterfly/mainboard.c
+src/mainboard/google/chell/spd/empty.spd.hex
+src/mainboard/google/chell/spd/hynix_dimm_H9CCNNN8GTMLAR.spd.hex
+src/mainboard/google/chell/spd/hynix_dimm_H9CCNNNBJTMLAR.spd.hex
+src/mainboard/google/chell/spd/hynix_dimm_H9CCNNNCLTMLAR.spd.hex
+src/mainboard/google/chell/spd/samsung_dimm_K4E6E304EB-EGCF.spd.hex
+src/mainboard/google/chell/spd/samsung_dimm_K4E6E304EE-EGCF.spd.hex
+src/mainboard/google/chell/spd/samsung_dimm_K4E8E304EE-EGCF.spd.hex
+src/mainboard/google/chell/spd/spd.c
+src/mainboard/google/cyan/Kconfig
+src/mainboard/google/cyan/spd/hynix_2GiB_dimm_H5TC4G63AFR-PBA.spd.hex
+src/mainboard/google/cyan/spd/hynix_2GiB_dimm_HMT425S6CFR6A_H5TC4G63CFR.spd.hex
+src/mainboard/google/cyan/spd/samsung_2GiB_dimm_K4B4G1646Q-HYK0.spd.hex
+src/mainboard/google/cyan/spd/spd.c
+src/mainboard/google/enguarde/spd/hynix_2GiB_dimm_H5TC4G63AFR-PBA.spd.hex
+src/mainboard/google/enguarde/spd/samsung_1GiB_dimm_K4B2G1646Q-BYK0.spd.hex
+src/mainboard/google/enguarde/spd/micron_1GiB_dimm_MT41K128M16JT-125.spd.hex
+src/mainboard/google/enguarde/spd/samsung_2GiB_dimm_K4B4G1646Q-HYK0.spd.hex
+src/mainboard/google/enguarde/spd/micron_2GiB_dimm_MT41K256M16HA-125.spd.hex
+src/mainboard/google/enguarde/spd/hynix_1GiB_dimm_H5TC2G63FFR-PBA.spd.hex
+src/mainboard/google/eve/spd/hynix_dimm_H9CCNNNBJTALAR.spd.hex
+src/mainboard/google/eve/spd/hynix_dimm_H9CCNNNCLTMLAR.spd.hex
+src/mainboard/google/eve/spd/samsung_dimm_K4E8E324EB.spd.hex
+src/mainboard/google/eve/spd/empty.spd.hex
+src/mainboard/google/eve/spd/samsung_dimm_K4E6E304EB.spd.hex
+src/mainboard/google/eve/spd/samsung_dimm_K4EBE304EB.spd.hex
+src/mainboard/google/eve/spd/hynix_dimm_H9CCNNN8GTALAR.spd.hex
+src/mainboard/google/falco/Elpida_EDJ4216EFBG.spd.hex
+src/mainboard/google/falco/Hynix_HMT425S6AFR6A.spd.hex
+src/mainboard/google/falco/Micron_4KTF25664HZ.spd.hex
+src/mainboard/google/falco/romstage.c
+src/mainboard/google/falco/Samsung_M471B5674QH0.spd.hex
+src/mainboard/google/glados/spd/empty.spd.hex
+src/mainboard/google/glados/spd/hynix_dimm_H9CCNNN8JTBLAR.spd.hex
+src/mainboard/google/glados/spd/hynix_dimm_H9CCNNNBLTALAR.spd.hex
+src/mainboard/google/glados/spd/samsung_dimm_K4E6E304EE-EGCF.spd.hex
+src/mainboard/google/glados/spd/spd.c
+src/mainboard/google/guado/lan.c
+src/mainboard/google/jecht/lan.c
+src/mainboard/google/lars/spd/empty.spd.hex
+src/mainboard/google/lars/spd/hynix_dimm_H9CCNNN8JTBLAR-NUD-1G-1866.spd.hex
+src/mainboard/google/lars/spd/hynix_dimm_H9CCNNNBLTBLAR-NUD-2G-1866.spd.hex
+src/mainboard/google/lars/spd/samsung_dimm_K4E6E304EB-EGCF-2G-1866.spd.hex
+src/mainboard/google/lars/spd/samsung_dimm_K4E8E324EB-EGCF-1G-1866.spd.hex
+src/mainboard/google/lars/spd/spd.c
+src/mainboard/google/link/elpida_4Gb_1600_x16.spd.hex
+src/mainboard/google/link/hda_verb.c
+src/mainboard/google/link/i915.c
+src/mainboard/google/link/micron_4Gb_1600_1.35v_x16.spd.hex
+src/mainboard/google/link/romstage.c
+src/mainboard/google/link/samsung_4Gb_1600_1.35v_x16.spd.hex
+src/mainboard/google/ninja/lan.c
+src/mainboard/google/ninja/romstage.c
+src/mainboard/google/ninja/spd/hynix_1GiB_dimm_H5TC2G63FFR-PBA.spd.hex
+src/mainboard/google/ninja/spd/hynix_2GiB_dimm_H5TC4G63AFR-PBA.spd.hex
+src/mainboard/google/ninja/spd/hynix_2GiB_dimm_H5TC4G63CFR-PBA.spd.hex
+src/mainboard/google/ninja/spd/micron_1GiB_dimm_MT41K128M16JT-125.spd.hex
+src/mainboard/google/ninja/spd/micron_2GiB_dimm_MT41K256M16HA-125.spd.hex
+src/mainboard/google/panther/lan.c
+src/mainboard/google/peach_pit/mainboard.c
+src/mainboard/google/peppy/Elpida_EDJ4216EFBG.spd.hex
+src/mainboard/google/peppy/Hynix_HMT425S6AFR6A.spd.hex
+src/mainboard/google/peppy/Micron_4KTF25664HZ.spd.hex
+src/mainboard/google/peppy/romstage.c
+src/mainboard/google/rambi/romstage.c
+src/mainboard/google/rambi/spd/hynix_1GiB_dimm_H5TC2G63FFR-PBA.spd.hex
+src/mainboard/google/rambi/spd/hynix_2GiB_dimm_H5TC4G63AFR-PBA.spd.hex
+src/mainboard/google/rambi/spd/micron_1GiB_dimm_MT41K128M16JT-125.spd.hex
+src/mainboard/google/rambi/spd/micron_2GiB_dimm_MT41K256M16HA-125.spd.hex
+src/mainboard/google/rikku/lan.c
+src/mainboard/google/rotor/dram_params.c
+src/mainboard/google/samus/romstage.c
+src/mainboard/google/samus/spd/elpida_16.spd.hex
+src/mainboard/google/samus/spd/elpida_4.spd.hex
+src/mainboard/google/samus/spd/elpida_8.spd.hex
+src/mainboard/google/samus/spd/empty.spd.hex
+src/mainboard/google/samus/spd/hynix_16.spd.hex
+src/mainboard/google/samus/spd/hynix_4.spd.hex
+src/mainboard/google/samus/spd/hynix_8.spd.hex
+src/mainboard/google/samus/spd/samsung_4.spd.hex
+src/mainboard/google/samus/spd/samsung_8.spd.hex
+src/mainboard/google/samus/spd/spd.c
+src/mainboard/google/slippy/Hynix_HMT425S6AFR6A.spd.hex
+src/mainboard/google/slippy/Micron_4KTF25664HZ.spd.hex
+src/mainboard/google/slippy/variants/peppy/spd/Micron_4KTF25664HZ.spd.hex
+src/mainboard/google/slippy/variants/peppy/spd/Elpida_EDJ4216EFBG.spd.hex
+src/mainboard/google/slippy/variants/peppy/spd/Hynix_HMT425S6AFR6A.spd.hex
+src/mainboard/google/slippy/variants/falco/spd/Micron_4KTF25664HZ.spd.hex
+src/mainboard/google/slippy/variants/falco/spd/Elpida_EDJ4216EFBG.spd.hex
+src/mainboard/google/slippy/variants/falco/spd/Samsung_M471B5674QH0.spd.hex
+src/mainboard/google/slippy/variants/falco/spd/Hynix_HMT425S6AFR6A.spd.hex
+src/mainboard/google/slippy/variants/leon/spd/Micron_4KTF25664HZ.spd.hex
+src/mainboard/google/slippy/variants/leon/spd/Hynix_HMT425S6AFR6A.spd.hex
+src/mainboard/google/slippy/variants/leon/spd/Samsung_K4B4G1646Q.spd.hex
+src/mainboard/google/slippy/variants/wolf/spd/Micron_4KTF25664HZ.spd.hex
+src/mainboard/google/slippy/variants/wolf/spd/Samsung_K4B4G1646B.spd.hex
+src/mainboard/google/slippy/variants/wolf/spd/Hynix_HMT425S6AFR6A.spd.hex
+src/mainboard/google/slippy/romstage.c
+src/mainboard/google/tidus/lan.c
+src/mainboard/hp/abm/mptable.c
+src/mainboard/hp/dl165_g6_fam10/get_bus_conf.c
+src/mainboard/hp/pavilion_m6_1035dx/mptable.c
+src/mainboard/ibase/mb899/cmos.layout
+src/mainboard/ibase/mb899/superio_hwm.c
+src/mainboard/intel/amenia/romstage.c
+src/mainboard/intel/apollolake_rvp/romstage.c
+src/mainboard/intel/cougar_canyon2/Kconfig
+src/mainboard/intel/kblrvp/spd/hynix_dimm_H9CCNNNBJTMLAR.spd.hex
+src/mainboard/intel/kblrvp/spd/empty.spd.hex
+src/mainboard/intel/kblrvp/spd/rvp3.spd.hex
+src/mainboard/intel/kunimitsu/spd/empty.spd.hex
+src/mainboard/intel/kunimitsu/spd/hynix_dimm_H9CCNNN8JTALAR-NUD-1G-1866.spd.hex
+src/mainboard/intel/kunimitsu/spd/hynix_dimm_H9CCNNN8JTBLAR-NUD-1G-1866.spd.hex
+src/mainboard/intel/kunimitsu/spd/hynix_dimm_H9CCNNNBLTALAR-NUD-2G-1866.spd.hex
+src/mainboard/intel/kunimitsu/spd/hynix_dimm_H9CCNNNBLTBLAR-NUD-2G-1866.spd.hex
+src/mainboard/intel/kunimitsu/spd/mic_dimm_EDF8132A3MA-JD-F-1G-1866.spd.hex
+src/mainboard/intel/kunimitsu/spd/samsung_dimm_K4E6E304EE-EGCF-2G-1866.spd.hex
+src/mainboard/intel/kunimitsu/spd/samsung_dimm_K4E8E304EE-EGCE.spd.hex
+src/mainboard/intel/kunimitsu/spd/samsung_dimm_K4E8E304EE-EGCF-1G-1866.spd.hex
+src/mainboard/intel/kunimitsu/spd/spd.c
+src/mainboard/intel/minnowmax/Kconfig
+src/mainboard/intel/mohonpeak/Kconfig
+src/mainboard/intel/sklrvp/spd/empty.spd.hex
+src/mainboard/intel/sklrvp/spd/rvp3.spd.hex
+src/mainboard/intel/sklrvp/spd/spd.c
+src/mainboard/intel/strago/Kconfig
+src/mainboard/intel/strago/spd/hynix_2GiB_dimm_H5TC4G63AFR-PBA.spd.hex
+src/mainboard/intel/strago/spd/hynix_2GiB_dimm_HMT425S6CFR6A_H5TC4G63CFR.spd.hex
+src/mainboard/intel/strago/spd/samsung_2GiB_dimm_K4B4G1646Q-HYK0.spd.hex
+src/mainboard/intel/strago/spd/spd.c
+src/mainboard/intel/wtm2/i915.c
+src/mainboard/jetway/nf81-t56n-lf/Kconfig
+src/mainboard/kontron/986lcd-m/cmos.layout
+src/mainboard/kontron/986lcd-m/mainboard.c
+src/mainboard/lenovo/g505s/mptable.c
+src/mainboard/lippert/frontrunner-af/Kconfig
+src/mainboard/lippert/frontrunner-af/mptable.c
+src/mainboard/lippert/toucan-af/Kconfig
+src/mainboard/lippert/toucan-af/mptable.c
+src/mainboard/msi/ms7721/mptable.c
+src/mainboard/msi/ms9652_fam10/get_bus_conf.c
+src/mainboard/packardbell/ms2290/mainboard.c
+src/mainboard/pcengines/apu1/Kconfig
+src/mainboard/samsung/lumpy/romstage.c
+src/mainboard/siemens/mc_bdx1/mainboard.c
+src/mainboard/siemens/mc_tcu3/lcd_panel.c
+src/mainboard/siemens/mc_tcu3/mainboard.c
+src/mainboard/siemens/mc_tcu3/modhwinfo.c
+src/mainboard/siemens/mc_tcu3/romstage.c
+src/mainboard/siemens/sitemp_g1p1/cmos.layout
+src/mainboard/supermicro/h8dmr_fam10/get_bus_conf.c
+src/mainboard/supermicro/h8qgi/buildOpts.c
+src/mainboard/supermicro/h8qme_fam10/get_bus_conf.c
+src/mainboard/supermicro/h8scm/buildOpts.c
+src/mainboard/tyan/s2912_fam10/get_bus_conf.c
+src/mainboard/tyan/s4880/irq_tables.c
+src/mainboard/tyan/s4882/irq_tables.c
+src/mainboard/tyan/s8226/buildOpts.c
+src/northbridge/amd/agesa/common/common.c
+src/northbridge/amd/amdk8/acpi.c
+src/northbridge/amd/amdk8/coherent_ht.c
+src/northbridge/amd/amdk8/raminit_test.c
+src/northbridge/amd/amdmct/mct_ddr3/mcttmrl.c
+src/northbridge/amd/amdmct/mct/mctardk3.c
+src/northbridge/amd/amdmct/mct/mctardk4.c
+src/northbridge/amd/amdmct/mct/mcttmrl.c
+src/northbridge/amd/gx2/pll_reset.c
+src/northbridge/amd/pi/00630F01/Kconfig
+src/northbridge/amd/pi/00660F01/Kconfig
+src/northbridge/amd/pi/00730F01/Kconfig
+src/northbridge/intel/fsp_rangeley/fsp/Kconfig
+src/northbridge/intel/fsp_sandybridge/fsp/Kconfig
+src/northbridge/intel/gm45/raminit_rcomp_calibration.c
+src/northbridge/intel/gm45/raminit_read_write_training.c
+src/northbridge/intel/haswell/Kconfig
+src/northbridge/intel/haswell/raminit.c
+src/northbridge/intel/i82830/vga.c
+src/northbridge/intel/i945/raminit.c
+src/northbridge/intel/nehalem/gma.c
+src/northbridge/intel/nehalem/raminit.c
+src/northbridge/intel/nehalem/raminit_tables.c
+src/northbridge/intel/pineview/raminit.c
+src/northbridge/intel/sandybridge/gma.c
+src/northbridge/intel/sandybridge/Kconfig
+src/northbridge/intel/sandybridge/raminit.c
+src/northbridge/intel/sandybridge/raminit_mrc.c
+src/northbridge/intel/sandybridge/raminit_patterns.h
+src/northbridge/intel/x4x/raminit_ddr2.c
+src/northbridge/via/cx700/raminit.c
+src/northbridge/via/vx800/ide.c
+src/northbridge/via/vx800/uma_ram_setting.c
+src/northbridge/via/vx900/sata.c
+src/soc/broadcom/cygnus/ddr_init.c
+src/soc/broadcom/cygnus/ddr_init_table.c
+src/soc/intel/apollolake/Kconfig
+src/soc/intel/apollolake/nhlt.c
+src/soc/intel/baytrail/acpi.c
+src/soc/intel/baytrail/Kconfig
+src/soc/intel/baytrail/romstage/raminit.c
+src/soc/intel/braswell/acpi.c
+src/soc/intel/braswell/gpio.c
+src/soc/intel/braswell/Kconfig
+src/soc/intel/broadwell/acpi.c
+src/soc/intel/broadwell/Kconfig
+src/soc/intel/broadwell/romstage/raminit.c
+src/soc/intel/common/fsp_ramstage.c
+src/soc/intel/common/mma.c
+src/soc/intel/common/vbt.c
+src/soc/intel/fsp_baytrail/acpi.c
+src/soc/intel/fsp_baytrail/fsp/Kconfig
+src/soc/intel/fsp_baytrail/Kconfig
+src/soc/intel/fsp_broadwell_de/fsp/chipset_fsp_util.c
+src/soc/intel/fsp_broadwell_de/fsp/Kconfig
+src/soc/intel/quark/Kconfig
+src/soc/intel/quark/romstage/romstage.c
+src/soc/intel/sch/Kconfig
+src/soc/intel/skylake/Kconfig
+src/soc/intel/skylake/nhlt/dmic.c
+src/soc/intel/skylake/nhlt/max98357.c
+src/soc/intel/skylake/nhlt/nau88l25.c
+src/soc/intel/skylake/nhlt/ssm4567.c
+src/soc/nvidia/tegra210/Kconfig
+src/soc/nvidia/tegra210/mtc.c
+src/soc/qualcomm/ipq40xx/Kconfig
+src/soc/qualcomm/ipq40xx/lcc.c
+src/soc/qualcomm/ipq806x/Kconfig
+src/soc/qualcomm/ipq806x/lcc.c
+src/soc/samsung/exynos5250/clock.c
+src/soc/samsung/exynos5420/clock.c
+src/southbridge/amd/agesa/hudson/Kconfig
+src/southbridge/amd/cimx/sb800/Kconfig
+src/southbridge/amd/pi/hudson/Kconfig
+src/southbridge/intel/bd82x6x/Kconfig
+src/southbridge/intel/bd82x6x/lpc.c
+src/southbridge/intel/common/firmware/Kconfig
+src/southbridge/intel/i82801ix/dmi_setup.c
+src/southbridge/intel/ibexpeak/Kconfig
+src/southbridge/intel/lynxpoint/Kconfig
+src/southbridge/intel/sch/Kconfig
+src/southbridge/nvidia/ck804/early_setup_ss.h
+src/southbridge/nvidia/mcp55/early_setup_ss.h
+src/southbridge/sis/sis966/early_setup_ss.h
+src/southbridge/sis/sis966/early_smbus.c
+src/southbridge/sis/sis966/ide.c
+src/southbridge/sis/sis966/sata.c
+src/southbridge/sis/sis966/usb2.c
+src/southbridge/sis/sis966/usb.c
+src/superio/via/vt1211/vt1211.c
+src/vendorcode/amd/agesa/f10/Proc/CPU/Family/0x10/cpuF10Dmi.c
+src/vendorcode/amd/agesa/f10/Proc/CPU/Family/0x10/cpuF10WheaInitDataTables.c
+src/vendorcode/amd/agesa/f10/Proc/Mem/Main/muc.c
+src/vendorcode/amd/agesa/f12/Proc/CPU/Family/0x10/cpuF10Dmi.c
+src/vendorcode/amd/agesa/f12/Proc/CPU/Family/0x10/cpuF10WheaInitDataTables.c
+src/vendorcode/amd/agesa/f12/Proc/CPU/Family/0x12/cpuF12Dmi.c
+src/vendorcode/amd/agesa/f12/Proc/CPU/Family/0x12/cpuF12WheaInitDataTables.c
+src/vendorcode/amd/agesa/f12/Proc/Fch/Hwm/Family/Hudson2/Hudson2HwmLateService.c
+src/vendorcode/amd/agesa/f12/Proc/GNB/Gfx/Family/LN/F12GfxServices.c
+src/vendorcode/amd/agesa/f12/Proc/Mem/Main/muc.c
+src/vendorcode/amd/agesa/f14/Proc/CPU/Family/0x10/cpuF10Dmi.c
+src/vendorcode/amd/agesa/f14/Proc/CPU/Family/0x10/cpuF10WheaInitDataTables.c
+src/vendorcode/amd/agesa/f14/Proc/Mem/Main/muc.c
+src/vendorcode/amd/agesa/f15/Proc/CPU/Family/0x10/cpuF10Dmi.c
+src/vendorcode/amd/agesa/f15/Proc/CPU/Family/0x10/cpuF10WheaInitDataTables.c
+src/vendorcode/amd/agesa/f15/Proc/CPU/Family/0x15/cpuF15WheaInitDataTables.c
+src/vendorcode/amd/agesa/f15/Proc/Mem/Main/muc.c
+src/vendorcode/amd/agesa/f15/Proc/Mem/Ps/OR/mpor3.c
+src/vendorcode/amd/agesa/f15/Proc/Mem/Tech/DDR3/mtlrdimm3.c
+src/vendorcode/amd/agesa/f15tn/Proc/CPU/Family/0x15/cpuF15WheaInitDataTables.c
+src/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/GfxIntegratedInfoTableTN.c
+src/vendorcode/amd/agesa/f15tn/Proc/GNB/Modules/GnbInitTN/GfxLibTN.c
+src/vendorcode/amd/agesa/f15tn/Proc/Mem/Main/muc.c
+src/vendorcode/amd/agesa/f15tn/Proc/Mem/Ps/TN/mptn3.c
+src/vendorcode/amd/agesa/f15tn/Proc/Mem/Tech/DDR3/mtlrdimm3.c
+src/vendorcode/amd/agesa/f16kb/Proc/CPU/Family/0x16/cpuF16WheaInitDataTables.c
+src/vendorcode/amd/agesa/f16kb/Proc/GNB/Modules/GnbGfxIntTableV3/GfxLibV3.c
+src/vendorcode/amd/agesa/f16kb/Proc/GNB/Modules/GnbInitKB/GnbF1TableKB.c
+src/vendorcode/amd/agesa/f16kb/Proc/Mem/Main/muc.c
+src/vendorcode/amd/agesa/f16kb/Proc/Mem/Ps/KB/mpkb3.c
+src/vendorcode/amd/cimx/sb800/SATA.c
+src/vendorcode/amd/pi/Kconfig
+src/vendorcode/google/chromeos/build-snow
+util/amdtools/example_input/lspci-cb-48G-667MHz-18.2-20090909e
+util/amdtools/example_input/lspci-prop-48G-667MHz-18.2
+util/autoport/readme.md
+util/bimgtool/bimgtool.c
+util/cbfstool/fmd_parser.c_shipped
+util/cbfstool/fmd_scanner.c_shipped
+util/cbfstool/linux_trampoline.c
+util/cbfstool/lz4/lib/lz4.c
+util/crossgcc/patches/binutils-2.25_riscv.patch
+util/crossgcc/patches/gcc-5.2.0_riscv.patch
+util/ifdtool/ifdtool.c
+util/intelmetool/intelmetool.c
+util/ipqheader/createxbl.py
+util/kconfig/zconf.hash.c_shipped
+util/kconfig/zconf.lex.c_shipped
+util/kconfig/zconf.tab.c_shipped
+util/mma/mma_automated_test.sh
+util/mtkheader/gen-bl-img.py
+util/nvidia/cbootimage/src/aes_ref.c
+util/nvramtool/accessors/layout-bin.c
+util/riscvtools/make-spike-elf.sh
+util/rockchip/make_idb.py
+util/romcc/do_tests.sh
+util/romcc/test.sh
+util/romcc/tests/include/linux_console.h
+util/romcc/tests/linux_console.h
+util/romcc/tests/linux_test5.c
+util/romcc/tests/raminit_test6.c
+util/romcc/tests/raminit_test7.c
+util/romcc/tests/simple_test14.c
+util/romcc/tests/simple_test30.c
+util/romcc/tests/simple_test38.c
+util/romcc/tests/simple_test39.c
+util/romcc/tests/simple_test54.c
+util/romcc/tests/simple_test59.c
+util/romcc/tests/simple_test72.c
+util/romcc/tests/simple_test73.c
+util/sconfig/lex.yy.c_shipped
+util/sconfig/sconfig.tab.c_shipped
+util/superiotool/fintek.c
+util/superiotool/ite.c
+util/superiotool/nuvoton.c
+util/superiotool/smsc.c
+util/superiotool/winbond.c
+util/xcompile/xcompile
diff --git a/projects/coreboot/configs/blobs-ignore-notes.txt b/projects/coreboot/configs/blobs-ignore-notes.txt
new file mode 100644
index 00000000..551da4a8
--- /dev/null
+++ b/projects/coreboot/configs/blobs-ignore-notes.txt
@@ -0,0 +1,15 @@
+.spd.hex files - serial presence detect. These are not blobs
+see JEDEC standard or https://en.wikipedia.org/wiki/Serial_presence_detect
+These are added to the nonblobs file
+
+src/northbridge/intel/nehalem/raminit_tables.c"
+src/northbridge/intel/sandybridge/raminit_patterns.h
+These are used by native raminit for the relevant platforms, and are not blobs
+
+"src/southbridge/nvidia/mcp55/early_setup_ss.h" \
+"src/southbridge/nvidia/ck804/early_setup_ss.h" \
+"src/southbridge/sis/sis966/early_setup_ss.h"
+not blobs
+
+The text in this file is CC-BY-SA 4.0 or higher. All contributions to it must
+be made under the same license.
diff --git a/projects/coreboot/configs/depthcharge/nyan/arch b/projects/coreboot/configs/depthcharge/nyan/arch
new file mode 100644
index 00000000..fb05f39d
--- /dev/null
+++ b/projects/coreboot/configs/depthcharge/nyan/arch
@@ -0,0 +1 @@
+arm
diff --git a/projects/coreboot/configs/depthcharge/nyan/big/config b/projects/coreboot/configs/depthcharge/nyan/big/config
new file mode 100644
index 00000000..41b4eeeb
--- /dev/null
+++ b/projects/coreboot/configs/depthcharge/nyan/big/config
@@ -0,0 +1,7 @@
+CONFIG_VENDOR_GOOGLE=y
+CONFIG_BOARD_GOOGLE_NYAN_BIG=y
+CONFIG_CHROMEOS=y
+CONFIG_PAYLOAD_ELF=y
+CONFIG_PAYLOAD_FILE="$(obj)/../depthcharge-nyan-big/depthcharge.elf"
+CONFIG_EC_GOOGLE_CHROMEEC_FIRMWARE_EXTERNAL=y
+CONFIG_EC_GOOGLE_CHROMEEC_FIRMWARE_FILE="$(obj)/../cros-ec-nyan-big/ec.RW.bin"
diff --git a/projects/coreboot/configs/depthcharge/nyan/blaze/config b/projects/coreboot/configs/depthcharge/nyan/blaze/config
new file mode 100644
index 00000000..10814c6e
--- /dev/null
+++ b/projects/coreboot/configs/depthcharge/nyan/blaze/config
@@ -0,0 +1,12 @@
+CONFIG_VENDOR_GOOGLE=y
+CONFIG_BOARD_GOOGLE_NYAN_BLAZE=y
+CONFIG_CHROMEOS=y
+CONFIG_PAYLOAD_ELF=y
+CONFIG_PAYLOAD_FILE="$(obj)/../depthcharge-nyan-blaze/depthcharge.elf"
+CONFIG_EC_GOOGLE_CHROMEEC_FIRMWARE_EXTERNAL=y
+CONFIG_EC_GOOGLE_CHROMEEC_FIRMWARE_FILE="$(obj)/../cros-ec-nyan-blaze/ec.RW.bin"
+CONFIG_GBB_FLAG_ENABLE_ALTERNATE_OS=y
+CONFIG_GBB_FLAG_FORCE_DEV_SWITCH_ON=y
+CONFIG_GBB_FLAG_FORCE_DEV_BOOT_USB=y
+CONFIG_GBB_FLAG_DISABLE_FW_ROLLBACK_CHECK=y
+CONFIG_GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC=y
diff --git a/projects/coreboot/configs/depthcharge/nyan/ec b/projects/coreboot/configs/depthcharge/nyan/ec
new file mode 100644
index 00000000..903761a1
--- /dev/null
+++ b/projects/coreboot/configs/depthcharge/nyan/ec
@@ -0,0 +1 @@
+cros-ec
diff --git a/projects/coreboot/configs/depthcharge/nyan/targets b/projects/coreboot/configs/depthcharge/nyan/targets
new file mode 100644
index 00000000..419aafc5
--- /dev/null
+++ b/projects/coreboot/configs/depthcharge/nyan/targets
@@ -0,0 +1,2 @@
+big
+blaze
diff --git a/projects/coreboot/configs/depthcharge/targets b/projects/coreboot/configs/depthcharge/targets
new file mode 100644
index 00000000..792768c4
--- /dev/null
+++ b/projects/coreboot/configs/depthcharge/targets
@@ -0,0 +1,2 @@
+nyan
+veyron
diff --git a/projects/coreboot/configs/depthcharge/veyron/arch b/projects/coreboot/configs/depthcharge/veyron/arch
new file mode 100644
index 00000000..fb05f39d
--- /dev/null
+++ b/projects/coreboot/configs/depthcharge/veyron/arch
@@ -0,0 +1 @@
+arm
diff --git a/projects/coreboot/configs/depthcharge/veyron/jerry/config b/projects/coreboot/configs/depthcharge/veyron/jerry/config
new file mode 100644
index 00000000..0ef0b86b
--- /dev/null
+++ b/projects/coreboot/configs/depthcharge/veyron/jerry/config
@@ -0,0 +1,12 @@
+CONFIG_VENDOR_GOOGLE=y
+CONFIG_BOARD_GOOGLE_VEYRON_JERRY=y
+CONFIG_CHROMEOS=y
+CONFIG_PAYLOAD_ELF=y
+CONFIG_PAYLOAD_FILE="$(obj)/../depthcharge-veyron-jerry/depthcharge.elf"
+CONFIG_EC_GOOGLE_CHROMEEC_FIRMWARE_EXTERNAL=y
+CONFIG_EC_GOOGLE_CHROMEEC_FIRMWARE_FILE="$(obj)/../cros-ec-veyron-jerry/ec.RW.bin"
+CONFIG_GBB_FLAG_ENABLE_ALTERNATE_OS=y
+CONFIG_GBB_FLAG_FORCE_DEV_SWITCH_ON=y
+CONFIG_GBB_FLAG_FORCE_DEV_BOOT_USB=y
+CONFIG_GBB_FLAG_DISABLE_FW_ROLLBACK_CHECK=y
+CONFIG_GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC=y
diff --git a/projects/coreboot/configs/depthcharge/veyron/jerry/ec b/projects/coreboot/configs/depthcharge/veyron/jerry/ec
new file mode 100644
index 00000000..903761a1
--- /dev/null
+++ b/projects/coreboot/configs/depthcharge/veyron/jerry/ec
@@ -0,0 +1 @@
+cros-ec
diff --git a/projects/coreboot/configs/depthcharge/veyron/mickey/config b/projects/coreboot/configs/depthcharge/veyron/mickey/config
new file mode 100644
index 00000000..764ebdd8
--- /dev/null
+++ b/projects/coreboot/configs/depthcharge/veyron/mickey/config
@@ -0,0 +1,5 @@
+CONFIG_VENDOR_GOOGLE=y
+CONFIG_BOARD_GOOGLE_VEYRON_MICKEY=y
+CONFIG_CHROMEOS=y
+CONFIG_PAYLOAD_ELF=y
+CONFIG_PAYLOAD_FILE="$(obj)/../depthcharge-veyron-mickey/depthcharge.elf"
diff --git a/projects/coreboot/configs/depthcharge/veyron/minnie/config b/projects/coreboot/configs/depthcharge/veyron/minnie/config
new file mode 100644
index 00000000..fc6125fa
--- /dev/null
+++ b/projects/coreboot/configs/depthcharge/veyron/minnie/config
@@ -0,0 +1,7 @@
+CONFIG_VENDOR_GOOGLE=y
+CONFIG_BOARD_GOOGLE_VEYRON_MINNIE=y
+CONFIG_CHROMEOS=y
+CONFIG_PAYLOAD_ELF=y
+CONFIG_PAYLOAD_FILE="$(obj)/../depthcharge-veyron-minnie/depthcharge.elf"
+CONFIG_EC_GOOGLE_CHROMEEC_FIRMWARE_EXTERNAL=y
+CONFIG_EC_GOOGLE_CHROMEEC_FIRMWARE_FILE="$(obj)/../cros-ec-veyron-minnie/ec.RW.bin"
diff --git a/projects/coreboot/configs/depthcharge/veyron/minnie/ec b/projects/coreboot/configs/depthcharge/veyron/minnie/ec
new file mode 100644
index 00000000..903761a1
--- /dev/null
+++ b/projects/coreboot/configs/depthcharge/veyron/minnie/ec
@@ -0,0 +1 @@
+cros-ec
diff --git a/projects/coreboot/configs/depthcharge/veyron/speedy/config b/projects/coreboot/configs/depthcharge/veyron/speedy/config
new file mode 100644
index 00000000..9f45963d
--- /dev/null
+++ b/projects/coreboot/configs/depthcharge/veyron/speedy/config
@@ -0,0 +1,7 @@
+CONFIG_VENDOR_GOOGLE=y
+CONFIG_BOARD_GOOGLE_VEYRON_SPEEDY=y
+CONFIG_CHROMEOS=y
+CONFIG_PAYLOAD_ELF=y
+CONFIG_PAYLOAD_FILE="$(obj)/../depthcharge-veyron-speedy/depthcharge.elf"
+CONFIG_EC_GOOGLE_CHROMEEC_FIRMWARE_EXTERNAL=y
+CONFIG_EC_GOOGLE_CHROMEEC_FIRMWARE_FILE="$(obj)/../cros-ec-veyron-speedy/ec.RW.bin"
diff --git a/projects/coreboot/configs/depthcharge/veyron/speedy/ec b/projects/coreboot/configs/depthcharge/veyron/speedy/ec
new file mode 100644
index 00000000..903761a1
--- /dev/null
+++ b/projects/coreboot/configs/depthcharge/veyron/speedy/ec
@@ -0,0 +1 @@
+cros-ec
diff --git a/projects/coreboot/configs/depthcharge/veyron/targets b/projects/coreboot/configs/depthcharge/veyron/targets
new file mode 100644
index 00000000..e4c9ca9e
--- /dev/null
+++ b/projects/coreboot/configs/depthcharge/veyron/targets
@@ -0,0 +1,4 @@
+jerry
+mickey
+minnie
+speedy
diff --git a/projects/coreboot/configs/install b/projects/coreboot/configs/install
new file mode 100644
index 00000000..bae9991d
--- /dev/null
+++ b/projects/coreboot/configs/install
@@ -0,0 +1 @@
+coreboot.rom:coreboot.rom
diff --git a/projects/coreboot/configs/revision b/projects/coreboot/configs/revision
new file mode 100644
index 00000000..504b1b31
--- /dev/null
+++ b/projects/coreboot/configs/revision
@@ -0,0 +1 @@
+dcd2f17ff47cc1a4b26f253fb11a991cfe4ff6f5
diff --git a/projects/coreboot/configs/targets b/projects/coreboot/configs/targets
new file mode 100644
index 00000000..d7e90413
--- /dev/null
+++ b/projects/coreboot/configs/targets
@@ -0,0 +1 @@
+depthcharge
diff --git a/projects/coreboot/coreboot b/projects/coreboot/coreboot
new file mode 100755
index 00000000..2a414dee
--- /dev/null
+++ b/projects/coreboot/coreboot
@@ -0,0 +1,135 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+arguments() {
+ project_arguments_targets "$project" "$@"
+}
+
+usage() {
+ project_usage_actions "$project"
+ project_usage_arguments "$project" "$@"
+}
+
+download() {
+ local repository=$project
+
+ project_download_git "$project" "$repository" "https://review.coreboot.org/coreboot https://github.com/coreboot/coreboot.git" "$@"
+}
+
+download_check() {
+ local repository=$project
+
+ project_download_check_git "$project" "$repository" "$@"
+}
+
+extract() {
+ project_extract "$project" "$@"
+}
+
+extract_check() {
+ project_extract_check "$project" "$@"
+}
+
+update() {
+ local repository=$project
+
+ project_update_git "$project" "$repository" "$@"
+}
+
+update_check() {
+ local repository=$project
+
+ project_update_check_git "$project" "$repository" "$@"
+}
+
+build() {
+ local payload=$1
+ shift
+
+ local repository=$project
+
+ project_sources_directory_missing_empty_error "$project" "$repository" "$payload" "$@"
+
+ local sources_path=$( project_sources_path "$project" "$repository" "$payload" "$@" )
+ local build_path=$( project_build_path "$project" "$payload" "$@" )
+ local config_path=$( coreboot_config_path "$payload" "$@" )
+
+ local arch=$( coreboot_arch "$payload" "$@" )
+
+ local crossgcc_build_path=$( project_build_path "crossgcc" "$arch" )
+ local crossgcc_bin_path="$crossgcc_build_path/bin/"
+ local vboot_sources_path=$( project_sources_path "vboot" "vboot" "devices" )
+
+ project_action "build" "crossgcc" "$arch"
+
+ if git_project_check "$repository"
+ then
+ git_project_checkout "$project" "$repository" "$payload" "$@"
+ fi
+
+ project_action "checkout" "vboot" "devices"
+
+ project_action "build" "$payload" "$@"
+
+ if coreboot_ec_check "$payload" "$@"
+ then
+ ec=$( coreboot_ec "$payload" "$@" )
+
+ project_action "build" "$ec" "$@"
+ fi
+
+ rm -f "$sources_path/.xcompile"
+
+ mkdir -p "$build_path"
+
+ make -C "$sources_path" obj="$build_path" DOTCONFIG="$build_path/.config" XGCCPATH="$crossgcc_bin_path" BUILD_TIMELESS=1 KERNELVERSION="$VERSION" KBUILD_DEFCONFIG="$config_path" "defconfig"
+ make -C "$sources_path" obj="$build_path" DOTCONFIG="$build_path/.config" XGCCPATH="$crossgcc_bin_path" BUILD_TIMELESS=1 KERNELVERSION="$VERSION" VBOOT_SOURCE="$vboot_sources_path" -j$TASKS
+
+ rm -f "$sources_path/.xcompile"
+}
+
+build_check() {
+ project_build_check "$project" "$@"
+}
+
+install() {
+ project_install "$project" "$@"
+}
+
+install_check() {
+ project_install_check "$project" "$@"
+}
+
+release() {
+ local repository=$project
+
+ project_release_install_archive "$project" "$IMAGES" "$@"
+
+ project_release_sources_git "$project" "$repository" "$@"
+}
+
+release_check() {
+ local repository=$project
+
+ project_release_install_archive_check "$project" "$IMAGES" "$@"
+
+ project_release_check_sources_git "$project" "$repository" "$@"
+}
+
+clean() {
+ project_clean "$project" "$@"
+}
diff --git a/projects/coreboot/coreboot-helper b/projects/coreboot/coreboot-helper
new file mode 100644
index 00000000..b7849373
--- /dev/null
+++ b/projects/coreboot/coreboot-helper
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+DEVICES="devices"
+PAYLOADS="payloads"
+CONFIG="config"
+ARCH="arch"
+EC="ec"
+
+coreboot_arch() {
+ project_file_contents "$project" "$CONFIGS" "$ARCH" "$@"
+}
+
+coreboot_config_path() {
+ project_file_path "$project" "$CONFIGS" "$CONFIG" "$@"
+}
+
+coreboot_ec_check() {
+ project_file_test "$project" "$CONFIGS" "$EC" "$@"
+}
+
+coreboot_ec() {
+ project_file_contents "$project" "$CONFIGS" "$EC" "$@"
+}
diff --git a/projects/coreboot/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch b/projects/coreboot/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch
new file mode 100644
index 00000000..2e46141e
--- /dev/null
+++ b/projects/coreboot/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch
@@ -0,0 +1,122 @@
+From 95248477726f4a866b04a760f68930bc5ebd55ff Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Wed, 20 Jul 2016 16:03:30 +0200
+Subject: [PATCH 1/4] Avoid using git submodules for 3rdparty
+
+This gets rid of git submodules entirely, to avoid the nuisance caused
+by automatically checking them out.
+
+Change-Id: I54de09656bd2dd9c308bd6c8dce554945aa8e535
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ .gitmodules | 20 --------------------
+ 3rdparty/arm-trusted-firmware | 1 -
+ 3rdparty/blobs | 1 -
+ 3rdparty/chromeec | 1 -
+ 3rdparty/libgfxinit | 1 -
+ 3rdparty/libhwbase | 1 -
+ 3rdparty/vboot | 1 -
+ Makefile.inc | 11 -----------
+ 8 files changed, 37 deletions(-)
+ delete mode 160000 3rdparty/arm-trusted-firmware
+ delete mode 160000 3rdparty/blobs
+ delete mode 160000 3rdparty/chromeec
+ delete mode 160000 3rdparty/libgfxinit
+ delete mode 160000 3rdparty/libhwbase
+ delete mode 160000 3rdparty/vboot
+
+diff --git a/.gitmodules b/.gitmodules
+index c3270e6..3a617c7 100644
+--- a/.gitmodules
++++ b/.gitmodules
+@@ -1,23 +1,3 @@
+-[submodule "3rdparty/blobs"]
+- path = 3rdparty/blobs
+- url = ../blobs.git
+- update = none
+- ignore = dirty
+ [submodule "util/nvidia-cbootimage"]
+ path = util/nvidia/cbootimage
+ url = ../nvidia-cbootimage.git
+-[submodule "vboot"]
+- path = 3rdparty/vboot
+- url = ../vboot.git
+-[submodule "arm-trusted-firmware"]
+- path = 3rdparty/arm-trusted-firmware
+- url = ../arm-trusted-firmware.git
+-[submodule "3rdparty/chromeec"]
+- path = 3rdparty/chromeec
+- url = ../chrome-ec.git
+-[submodule "libhwbase"]
+- path = 3rdparty/libhwbase
+- url = ../libhwbase.git
+-[submodule "libgfxinit"]
+- path = 3rdparty/libgfxinit
+- url = ../libgfxinit.git
+diff --git a/3rdparty/arm-trusted-firmware b/3rdparty/arm-trusted-firmware
+deleted file mode 160000
+index bfd9251..0000000
+--- a/3rdparty/arm-trusted-firmware
++++ /dev/null
+@@ -1 +0,0 @@
+-Subproject commit bfd925139fdbc2e87979849907b34843aa326994
+diff --git a/3rdparty/blobs b/3rdparty/blobs
+deleted file mode 160000
+index 8090bdd..0000000
+--- a/3rdparty/blobs
++++ /dev/null
+@@ -1 +0,0 @@
+-Subproject commit 8090bdd59853599e469b7503ea473ca12e8c681b
+diff --git a/3rdparty/chromeec b/3rdparty/chromeec
+deleted file mode 160000
+index ea1a869..0000000
+--- a/3rdparty/chromeec
++++ /dev/null
+@@ -1 +0,0 @@
+-Subproject commit ea1a8699e96425806abdd532d04da254ae093f6e
+diff --git a/3rdparty/libgfxinit b/3rdparty/libgfxinit
+deleted file mode 160000
+index 88a7f17..0000000
+--- a/3rdparty/libgfxinit
++++ /dev/null
+@@ -1 +0,0 @@
+-Subproject commit 88a7f17b7d7a4f8a4d25ef6b87c71236b0862f5d
+diff --git a/3rdparty/libhwbase b/3rdparty/libhwbase
+deleted file mode 160000
+index aab715f..0000000
+--- a/3rdparty/libhwbase
++++ /dev/null
+@@ -1 +0,0 @@
+-Subproject commit aab715f166bf1b54cfbd6982e8df49248ea544d8
+diff --git a/3rdparty/vboot b/3rdparty/vboot
+deleted file mode 160000
+index adfafba..0000000
+--- a/3rdparty/vboot
++++ /dev/null
+@@ -1 +0,0 @@
+-Subproject commit adfafba793684ed92965dfbd86b3fb3463975d8c
+diff --git a/Makefile.inc b/Makefile.inc
+index c5ce30f..919a5d4 100644
+--- a/Makefile.inc
++++ b/Makefile.inc
+@@ -183,17 +183,6 @@ ifeq ($(CONFIG_COVERAGE),y)
+ ramstage-c-ccopts += -fprofile-arcs -ftest-coverage
+ endif
+
+-ifneq ($(UPDATED_SUBMODULES),1)
+-# try to fetch non-optional submodules if the source is under git
+-forgetthis:=$(if $(GIT),$(shell git submodule update --init))
+-ifeq ($(CONFIG_USE_BLOBS),y)
+-# this is necessary because 3rdparty/blobs is update=none, and so is ignored
+-# unless explicitly requested and enabled through --checkout
+-forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/blobs))
+-endif
+-export UPDATED_SUBMODULES:=1
+-endif
+-
+ ramstage-c-deps:=$$(OPTION_TABLE_H)
+ romstage-c-deps:=$$(OPTION_TABLE_H)
+ libverstage-c-deps:=$$(OPTION_TABLE_H)
+--
+2.10.2
+
diff --git a/projects/coreboot/patches/0002-libpayload-Update-ARM-CrOS-devices-configuration.patch b/projects/coreboot/patches/0002-libpayload-Update-ARM-CrOS-devices-configuration.patch
new file mode 100644
index 00000000..88f4013a
--- /dev/null
+++ b/projects/coreboot/patches/0002-libpayload-Update-ARM-CrOS-devices-configuration.patch
@@ -0,0 +1,56 @@
+From fc26e7861ec756614e27a82895b60724a8173757 Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Mon, 19 Dec 2016 18:03:23 +0100
+Subject: [PATCH 2/4] libpayload: Update ARM CrOS devices configuration
+
+This updates the configuration for ARM CrOS devices (nyans and veyrons)
+by using the CHROMEOS Kconfig option, thus reducing the number of
+options to select. It also brings proper serial console support.
+
+Change-Id: Iffc84c44a1d339c5bb575fbaffc40bc2d56bb6cf
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ payloads/libpayload/configs/config.nyan | 10 +++-------
+ payloads/libpayload/configs/config.veyron | 10 +++-------
+ 2 files changed, 6 insertions(+), 14 deletions(-)
+
+diff --git a/payloads/libpayload/configs/config.nyan b/payloads/libpayload/configs/config.nyan
+index 6e593e5..caad2b6 100644
+--- a/payloads/libpayload/configs/config.nyan
++++ b/payloads/libpayload/configs/config.nyan
+@@ -1,10 +1,6 @@
+-CONFIG_LP_GPL=y
++CONFIG_LP_CHROMEOS=y
+ CONFIG_LP_ARCH_ARM=y
+-# CONFIG_LP_CURSES is not set
+-CONFIG_LP_SKIP_CONSOLE_INIT=y
+-CONFIG_LP_COREBOOT_VIDEO_CONSOLE=y
+-# CONFIG_LP_STORAGE is not set
++CONFIG_LP_8250_SERIAL_CONSOLE=y
+ CONFIG_LP_TIMER_TEGRA_1US=y
+-# CONFIG_LP_USB_OHCI is not set
+-# CONFIG_LP_USB_XHCI is not set
++CONFIG_LP_USB_EHCI=y
+ CONFIG_LP_USB_EHCI_HOSTPC_ROOT_HUB_TT=y
+diff --git a/payloads/libpayload/configs/config.veyron b/payloads/libpayload/configs/config.veyron
+index 793907f..e80535c 100644
+--- a/payloads/libpayload/configs/config.veyron
++++ b/payloads/libpayload/configs/config.veyron
+@@ -1,11 +1,7 @@
+-CONFIG_LP_GPL=y
++CONFIG_LP_CHROMEOS=y
+ CONFIG_LP_ARCH_ARM=y
+-# CONFIG_LP_CURSES is not set
+-CONFIG_LP_SKIP_CONSOLE_INIT=y
+-CONFIG_LP_COREBOOT_VIDEO_CONSOLE=y
+-# CONFIG_LP_STORAGE is not set
+-CONFIG_LP_TIMER_RK=y
+-CONFIG_LP_USB=y
++CONFIG_LP_8250_SERIAL_CONSOLE=y
++CONFIG_LP_TIMER_RK3288=y
+ CONFIG_LP_USB_EHCI=y
+ CONFIG_LP_USB_DWC2=y
+ # CONFIG_LP_USB_HID is not set
+--
+2.10.2
+
diff --git a/projects/coreboot/patches/0003-libpayload-Get-current-tick-from-high-register-in-ge.patch b/projects/coreboot/patches/0003-libpayload-Get-current-tick-from-high-register-in-ge.patch
new file mode 100644
index 00000000..4fb09c79
--- /dev/null
+++ b/projects/coreboot/patches/0003-libpayload-Get-current-tick-from-high-register-in-ge.patch
@@ -0,0 +1,32 @@
+From 03a830aad1cdf4325781aa60566bebcf5aa57238 Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Mon, 19 Dec 2016 19:22:39 +0100
+Subject: [PATCH 3/4] libpayload: Get current tick from high register in
+ generic timer
+
+This fixes the generic timer driver to get the current tick from the
+high register, so that comparison with the high count value (obtained
+previously from the same register) has a chance to succeed.
+
+Change-Id: I5ce02bfa15a91ad34641b8e24813a5b7ca790ec3
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ payloads/libpayload/drivers/timer/generic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/payloads/libpayload/drivers/timer/generic.c b/payloads/libpayload/drivers/timer/generic.c
+index 4c06618..ac26f40 100644
+--- a/payloads/libpayload/drivers/timer/generic.c
++++ b/payloads/libpayload/drivers/timer/generic.c
+@@ -53,7 +53,7 @@ uint64_t timer_raw_value(void)
+ do {
+ count_h = readl(phys_to_virt(CONFIG_LP_TIMER_GENERIC_HIGH_REG));
+ count_l = readl(phys_to_virt(CONFIG_LP_TIMER_GENERIC_REG));
+- cur_tick = readl(phys_to_virt(CONFIG_LP_TIMER_GENERIC_REG));
++ cur_tick = readl(phys_to_virt(CONFIG_LP_TIMER_GENERIC_HIGH_REG));
+ } while (cur_tick != count_h);
+
+ return (cur_tick << 32) + count_l;
+--
+2.10.2
+
diff --git a/projects/coreboot/patches/0004-libpayload-Enable-USB-HID-in-veyron-configuration.patch b/projects/coreboot/patches/0004-libpayload-Enable-USB-HID-in-veyron-configuration.patch
new file mode 100644
index 00000000..af00a42d
--- /dev/null
+++ b/projects/coreboot/patches/0004-libpayload-Enable-USB-HID-in-veyron-configuration.patch
@@ -0,0 +1,27 @@
+From 552b999c7b32363cbc51722f33a0de189baf27fe Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Mon, 19 Dec 2016 20:23:44 +0100
+Subject: [PATCH 4/4] libpayload: Enable USB HID in veyron configuration
+
+This enables USB HID support in the veyron config, since it seems to
+work correctly and is needed for interaction with depthcharge on devices
+without an embedded keyboard (such as veyron_jerry).
+
+Change-Id: Icae829e3a132005df17bcb6f7e6f8a190912576d
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ payloads/libpayload/configs/config.veyron | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/payloads/libpayload/configs/config.veyron b/payloads/libpayload/configs/config.veyron
+index e80535c..b643e92 100644
+--- a/payloads/libpayload/configs/config.veyron
++++ b/payloads/libpayload/configs/config.veyron
+@@ -4,4 +4,3 @@ CONFIG_LP_8250_SERIAL_CONSOLE=y
+ CONFIG_LP_TIMER_RK3288=y
+ CONFIG_LP_USB_EHCI=y
+ CONFIG_LP_USB_DWC2=y
+-# CONFIG_LP_USB_HID is not set
+--
+2.10.2
+
diff --git a/projects/cros-ec/configs/nyan/big/config b/projects/cros-ec/configs/nyan/big/config
new file mode 100644
index 00000000..5e6052f6
--- /dev/null
+++ b/projects/cros-ec/configs/nyan/big/config
@@ -0,0 +1 @@
+big
diff --git a/projects/cros-ec/configs/nyan/blaze/config b/projects/cros-ec/configs/nyan/blaze/config
new file mode 100644
index 00000000..a44f5128
--- /dev/null
+++ b/projects/cros-ec/configs/nyan/blaze/config
@@ -0,0 +1 @@
+blaze
diff --git a/projects/cros-ec/configs/nyan/install b/projects/cros-ec/configs/nyan/install
new file mode 100644
index 00000000..e612b9f3
--- /dev/null
+++ b/projects/cros-ec/configs/nyan/install
@@ -0,0 +1,2 @@
+ec.bin:ec.bin
+ec.RW.bin:ec.RW.bin
diff --git a/projects/cros-ec/configs/nyan/revision b/projects/cros-ec/configs/nyan/revision
new file mode 100644
index 00000000..7a809c4c
--- /dev/null
+++ b/projects/cros-ec/configs/nyan/revision
@@ -0,0 +1 @@
+3c5457348e08d8606a8398cc9265cb144ec4baf6
diff --git a/projects/cros-ec/configs/nyan/targets b/projects/cros-ec/configs/nyan/targets
new file mode 100644
index 00000000..419aafc5
--- /dev/null
+++ b/projects/cros-ec/configs/nyan/targets
@@ -0,0 +1,2 @@
+big
+blaze
diff --git a/projects/cros-ec/configs/targets b/projects/cros-ec/configs/targets
new file mode 100644
index 00000000..b646854a
--- /dev/null
+++ b/projects/cros-ec/configs/targets
@@ -0,0 +1,3 @@
+nyan
+tools
+veyron
diff --git a/projects/cros-ec/configs/tools/install b/projects/cros-ec/configs/tools/install
new file mode 100644
index 00000000..2c76ca44
--- /dev/null
+++ b/projects/cros-ec/configs/tools/install
@@ -0,0 +1,6 @@
+util/ectool:ectool
+util/ec_uartd:ec_uartd
+util/iteflash:iteflash
+util/lbcc:lbcc
+util/lbplay:lbplay
+util/stm32mon:stm32mon
diff --git a/projects/cros-ec/configs/tools/revision b/projects/cros-ec/configs/tools/revision
new file mode 100644
index 00000000..79d3a325
--- /dev/null
+++ b/projects/cros-ec/configs/tools/revision
@@ -0,0 +1 @@
+origin/release-R56-9000.B
diff --git a/projects/cros-ec/configs/veyron/install b/projects/cros-ec/configs/veyron/install
new file mode 100644
index 00000000..e612b9f3
--- /dev/null
+++ b/projects/cros-ec/configs/veyron/install
@@ -0,0 +1,2 @@
+ec.bin:ec.bin
+ec.RW.bin:ec.RW.bin
diff --git a/projects/cros-ec/configs/veyron/jerry/config b/projects/cros-ec/configs/veyron/jerry/config
new file mode 100644
index 00000000..7fe60516
--- /dev/null
+++ b/projects/cros-ec/configs/veyron/jerry/config
@@ -0,0 +1 @@
+jerry
diff --git a/projects/cros-ec/configs/veyron/minnie/config b/projects/cros-ec/configs/veyron/minnie/config
new file mode 100644
index 00000000..f4d25895
--- /dev/null
+++ b/projects/cros-ec/configs/veyron/minnie/config
@@ -0,0 +1 @@
+minnie
diff --git a/projects/cros-ec/configs/veyron/revision b/projects/cros-ec/configs/veyron/revision
new file mode 100644
index 00000000..e27b3d1c
--- /dev/null
+++ b/projects/cros-ec/configs/veyron/revision
@@ -0,0 +1 @@
+242f6bd3e6f3b2d0b0e2b764c34fbab2db051189
diff --git a/projects/cros-ec/configs/veyron/speedy/config b/projects/cros-ec/configs/veyron/speedy/config
new file mode 100644
index 00000000..4fe25b6e
--- /dev/null
+++ b/projects/cros-ec/configs/veyron/speedy/config
@@ -0,0 +1 @@
+speedy
diff --git a/projects/cros-ec/configs/veyron/targets b/projects/cros-ec/configs/veyron/targets
new file mode 100644
index 00000000..ddc62a6a
--- /dev/null
+++ b/projects/cros-ec/configs/veyron/targets
@@ -0,0 +1,3 @@
+jerry
+minnie
+speedy
diff --git a/projects/cros-ec/cros-ec b/projects/cros-ec/cros-ec
new file mode 100755
index 00000000..1e90c28e
--- /dev/null
+++ b/projects/cros-ec/cros-ec
@@ -0,0 +1,136 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+arguments() {
+ project_arguments_targets "$project" "$@"
+}
+
+usage() {
+ project_usage_actions "$project"
+ project_usage_arguments "$project" "$@"
+}
+
+download() {
+ local repository=$project
+
+ project_download_git "$project" "$repository" "https://chromium.googlesource.com/chromiumos/platform/ec https://review.coreboot.org/chrome-ec.git https://github.com/coreboot/chrome-ec.git" "$@"
+}
+
+download_check() {
+ local repository=$project
+
+ project_download_check_git "$project" "$repository" "$@"
+}
+
+extract() {
+ project_extract "$project" "$@"
+}
+
+extract_check() {
+ project_extract_check "$project" "$@"
+}
+
+update() {
+ local repository=$project
+
+ project_update_git "$project" "$repository" "$@"
+}
+
+update_check() {
+ local repository=$project
+
+ project_update_check_git "$project" "$repository" "$@"
+}
+
+build() {
+ local target=$1
+
+ local repository=$project
+
+ project_sources_directory_missing_empty_error "$project" "$repository" "$@"
+
+ local sources_path=$( project_sources_path "$project" "$repository" "$@" )
+ local build_path=$( project_build_path "$project" "$@" )
+
+ if git_project_check "$repository"
+ then
+ git_project_checkout "$project" "$repository" "$@"
+ fi
+
+ mkdir -p "$build_path"
+
+ if [ "$target" = "tools" ]
+ then
+ make -C "$sources_path" out="$build_path" HOST_CROSS_COMPILE= -j$TASKS "utils"
+ else
+ local arch="arm"
+
+ local config=$( cros_ec_config "$@" )
+
+ local crossgcc_bin_prefix=$( project_action "prefix" "crossgcc" "$arch" )
+
+ project_action "build" "crossgcc" "$arch"
+
+ make -C "$sources_path" out="$build_path" CROSS_COMPILE="$crossgcc_bin_prefix" HOST_CROSS_COMPILE= BOARD="$config" -j$TASKS
+ fi
+}
+
+build_check() {
+ project_build_check "$project" "$@"
+}
+
+install() {
+ project_install "$project" "$@"
+}
+
+install_check() {
+ project_install_check "$project" "$@"
+}
+
+release() {
+ local target=$1
+
+ local repository=$project
+
+ if [ "$target" = "tools" ]
+ then
+ project_release_install_archive "$project" "$TOOLS" "$@"
+ else
+ project_release_install_archive "$project" "$IMAGES" "$@"
+ fi
+
+ project_release_sources_git "$project" "$repository" "$@"
+}
+
+release_check() {
+ local target=$1
+
+ local repository=$project
+
+ if [ "$target" = "tools" ]
+ then
+ project_release_install_archive_check "$project" "$TOOLS" "$@"
+ else
+ project_release_install_archive_check "$project" "$IMAGES" "$@"
+ fi
+
+ project_release_check_sources_git "$project" "$repository" "$@"
+}
+
+clean() {
+ project_clean "$project" "$@"
+}
diff --git a/projects/cros-ec/cros-ec-helper b/projects/cros-ec/cros-ec-helper
new file mode 100755
index 00000000..abbc869c
--- /dev/null
+++ b/projects/cros-ec/cros-ec-helper
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+CONFIG="config"
+
+cros_ec_config() {
+ project_file_contents "$project" "$CONFIGS" "$CONFIG" "$@"
+}
diff --git a/projects/cros-ec/patches/nyan/0001-use-_DEFAULT_SOURCE-for-newer-glibc.patch b/projects/cros-ec/patches/nyan/0001-use-_DEFAULT_SOURCE-for-newer-glibc.patch
new file mode 100644
index 00000000..ef3d40dc
--- /dev/null
+++ b/projects/cros-ec/patches/nyan/0001-use-_DEFAULT_SOURCE-for-newer-glibc.patch
@@ -0,0 +1,53 @@
+From b98bd2808f4185970781bd4dcca141cbda9b03c6 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@chromium.org>
+Date: Mon, 7 Dec 2015 21:46:13 -0500
+Subject: [PATCH 1/4] use _DEFAULT_SOURCE for newer glibc
+
+Newer versions of glibc have moved to _DEFAULT_SOURCE and away from
+_BSD_SOURCE. Trying to use the BSD define by itself leads to warnings
+which causes build failures.
+
+BRANCH=none
+BUG=None
+TEST=precq still works
+
+Signed-off-by: Mike Frysinger <vapier@chromium.org>
+Change-Id: Ice24b84dc6a540695fc7b76e8f22a4c85c301976
+Reviewed-on: https://chromium-review.googlesource.com/316730
+Reviewed-by: Bill Richardson <wfrichar@chromium.org>
+---
+ util/ec_uartd.c | 3 ++-
+ util/stm32mon.c | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/util/ec_uartd.c b/util/ec_uartd.c
+index fbf4a5e..bfd0642 100644
+--- a/util/ec_uartd.c
++++ b/util/ec_uartd.c
+@@ -11,7 +11,8 @@
+ */
+
+ /* Force header files to define grantpt(), posix_openpt(), cfmakeraw() */
+-#define _BSD_SOURCE
++#define _DEFAULT_SOURCE /* Newer glibc */
++#define _BSD_SOURCE /* Older glibc */
+ #define _XOPEN_SOURCE 600
+ /* Force header file to declare ptsname_r(), etc. */
+ #ifndef _GNU_SOURCE
+diff --git a/util/stm32mon.c b/util/stm32mon.c
+index 2e73bcf..f65cd64 100644
+--- a/util/stm32mon.c
++++ b/util/stm32mon.c
+@@ -6,7 +6,8 @@
+ */
+
+ /* use cfmakeraw() */
+-#define _BSD_SOURCE
++#define _DEFAULT_SOURCE /* Newer glibc */
++#define _BSD_SOURCE /* Older glibc */
+
+ #include <arpa/inet.h>
+ #include <errno.h>
+--
+2.9.0
+
diff --git a/projects/cros-ec/patches/nyan/0002-Enforce-compilation-without-system-headers.patch b/projects/cros-ec/patches/nyan/0002-Enforce-compilation-without-system-headers.patch
new file mode 100644
index 00000000..db747ea9
--- /dev/null
+++ b/projects/cros-ec/patches/nyan/0002-Enforce-compilation-without-system-headers.patch
@@ -0,0 +1,27 @@
+From fd77232c8e9789f5556fc6cc3c694924c1546a41 Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Wed, 20 Jul 2016 16:26:32 +0200
+Subject: [PATCH 2/4] Enforce compilation without system headers
+
+This is based on commit bc404c94b4ab1e6a62e607fd7ef034aa31d6388e
+(Enforce compilation without system headers)
+---
+ Makefile.toolchain | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.toolchain b/Makefile.toolchain
+index dd0ebb2..47991e1 100644
+--- a/Makefile.toolchain
++++ b/Makefile.toolchain
+@@ -19,7 +19,7 @@ BUILDCC?=gcc
+ HOSTCC?=$(HOST_CROSS_COMPILE)gcc
+
+ CFLAGS_WARN=-Wall -Werror -Wundef -Wstrict-prototypes -Wno-trigraphs \
+- -fno-strict-aliasing -fno-common \
++ -fno-strict-aliasing -fno-common -ffreestanding -fno-builtin \
+ -Werror-implicit-function-declaration -Wno-format-security \
+ -fno-delete-null-pointer-checks -Wdeclaration-after-statement \
+ -Wno-pointer-sign -fno-strict-overflow -fconserve-stack
+--
+2.9.0
+
diff --git a/projects/cros-ec/patches/nyan/0003-Don-t-declare-functions-inline-that-aren-t-always-de.patch b/projects/cros-ec/patches/nyan/0003-Don-t-declare-functions-inline-that-aren-t-always-de.patch
new file mode 100644
index 00000000..33f714d8
--- /dev/null
+++ b/projects/cros-ec/patches/nyan/0003-Don-t-declare-functions-inline-that-aren-t-always-de.patch
@@ -0,0 +1,28 @@
+From 9d747549141e710c324968636522e57fe4ba9445 Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Wed, 20 Jul 2016 16:27:05 +0200
+Subject: [PATCH 3/4] Don't declare functions inline that aren't always defined
+ as such
+
+This is based on commit 960cf45b3ffe88e842c27145e7e646d63a89c371
+(Don't declare functions inline that aren't always defined as such)
+---
+ include/task.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/task.h b/include/task.h
+index 00368fb..52827e9 100644
+--- a/include/task.h
++++ b/include/task.h
+@@ -47,7 +47,7 @@ void interrupt_enable(void);
+ /**
+ * Return true if we are in interrupt context.
+ */
+-inline int in_interrupt_context(void);
++int in_interrupt_context(void);
+
+ /**
+ * Set a task event.
+--
+2.9.0
+
diff --git a/projects/cros-ec/patches/nyan/0004-cortex-m-Use-assembly-exception-handler-and-routine-.patch b/projects/cros-ec/patches/nyan/0004-cortex-m-Use-assembly-exception-handler-and-routine-.patch
new file mode 100644
index 00000000..88148eb4
--- /dev/null
+++ b/projects/cros-ec/patches/nyan/0004-cortex-m-Use-assembly-exception-handler-and-routine-.patch
@@ -0,0 +1,230 @@
+From f7d7b22a9e711783c99be55b2c1c437a6808f24d Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Sat, 23 Jul 2016 15:51:58 +0200
+Subject: [PATCH 4/4] cortex-m: Use assembly exception handler and routine for
+ task switching
+
+The way Cortex processors handle exceptions allows writing exception
+routines directly in C, as return from exception is handled by providing
+a special value for the link register.
+
+However, it is not safe to do this when doing context switching. In
+particular, C handlers may push some general-purpose registers that
+are used by the handler and pop them later, even when context switch
+has happened in the meantime. While the processor will restore {r0-r3}
+from the stack when returning from an exception, the C handler code
+may push, use and pop another register, clobbering the value resulting
+from the context switch.
+
+For this reason, it is safer to have assembly routines for exception
+handlers that do context switching.
+
+BUG=chromium:631514
+BRANCH=None
+TEST=Build and run big EC with a recent GCC version
+
+Change-Id: Ia356321021731e6e372af152c962d8f01c065da5
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ core/cortex-m/switch.S | 90 +++++++++++++++++++++++++++++++++++---------------
+ core/cortex-m/task.c | 28 ++++------------
+ 2 files changed, 69 insertions(+), 49 deletions(-)
+
+diff --git a/core/cortex-m/switch.S b/core/cortex-m/switch.S
+index 92c7e51..80a99c8 100644
+--- a/core/cortex-m/switch.S
++++ b/core/cortex-m/switch.S
+@@ -13,6 +13,48 @@
+ .code 16
+
+ /**
++ * Start the task scheduling. r0 is a pointer to task_stack_ready, which is
++ * set to 1 after the task stack is set up.
++ */
++.global __task_start
++.thumb_func
++__task_start:
++ ldr r2,=scratchpad @ area used as dummy thread stack for the first switch
++#ifdef CONFIG_FPU
++ mov r3, #6 @ use : priv. mode / thread stack / floating point on
++#else
++ mov r3, #2 @ use : priv. mode / thread stack / no floating point
++#endif
++ add r2, #17*4 @ put the pointer at the top of the stack
++ mov r1, #0 @ __Schedule parameter : re-schedule nothing
++ msr psp, r2 @ setup a thread stack up to the first context switch
++ mov r2, #1
++ isb @ ensure the write is done
++ msr control, r3
++ mov r3, r0
++ mov r0, #0 @ __Schedule parameter : de-schedule nothing
++ isb @ ensure the write is done
++ str r2, [r3] @ Task scheduling is now active
++ bl __schedule @ execute the task with the highest priority
++ /* we should never return here */
++ mov r0, #1 @ set to EC_ERROR_UNKNOWN
++ bx lr
++
++/**
++ * SVC exception handler
++ */
++.global svc_handler
++.thumb_func
++svc_handler:
++ push {lr} @ save link register
++ bl __svc_handler @ call svc handler helper
++ ldr r3,=current_task @ load the current task's address
++ ldr r1, [r3] @ load the current task
++ cmp r0, r1 @ compare with previous task returned by helper
++ beq svc_handler_return @ return if they are the same
++ /* continue to __switchto to switch to the new task */
++
++/**
+ * Task context switching
+ *
+ * Change the task scheduled after returning from the exception.
+@@ -30,8 +72,6 @@
+ * r0, r1, r2, r3, r12, lr, pc, psr, r4, r5, r6, r7, r8, r9, r10, r11
+ * exception frame <|> additional registers
+ */
+-.global __switchto
+-.thumb_func
+ __switchto:
+ mrs r3, psp @ get the task stack where the context has been saved
+ ldr r2, [r1] @ get the new scheduled task stack pointer
+@@ -39,33 +79,29 @@ __switchto:
+ ldmia r2!, {r4-r11} @ restore r4-r11 for the next task context
+ str r3, [r0] @ save the task stack pointer in its context
+ msr psp, r2 @ set the process stack pointer to exception context
+- bx lr @ return from exception
++
++svc_handler_return:
++ pop {pc} @ return from exception or return to caller
+
+ /**
+- * Start the task scheduling. r0 is a pointer to task_stack_ready, which is
+- * set to 1 after the task stack is set up.
++ * Resched task if needed:
++ * Continue iff a rescheduling event happened or profiling is active,
++ * and we are not called from another exception.
+ */
+-.global __task_start
++.global task_resched_if_needed
+ .thumb_func
+-__task_start:
+- ldr r2,=scratchpad @ area used as dummy thread stack for the first switch
+-#ifdef CONFIG_FPU
+- mov r3, #6 @ use : priv. mode / thread stack / floating point on
+-#else
+- mov r3, #2 @ use : priv. mode / thread stack / no floating point
+-#endif
+- add r2, #17*4 @ put the pointer at the top of the stack
+- mov r1, #0 @ __Schedule parameter : re-schedule nothing
+- msr psp, r2 @ setup a thread stack up to the first context switch
+- mov r2, #1
+- isb @ ensure the write is done
+- msr control, r3
+- mov r3, r0
+- mov r0, #0 @ __Schedule parameter : de-schedule nothing
+- isb @ ensure the write is done
+- str r2, [r3] @ Task scheduling is now active
+- bl __schedule @ execute the task with the highest priority
+- /* we should never return here */
+- mov r0, #1 @ set to EC_ERROR_UNKNOWN
+- bx lr
++task_resched_if_needed:
++ push {lr} @ save link register
++ ldr r3,=need_resched_or_profiling @ load need's address
++ ldr r1, [r3] @ load need
++ cbz r1, task_resched_if_needed_return @ return if there is no need
++ and r0, #0xf @ called from another exception
++ cmp r0, #1 @ check bit
++ beq task_resched_if_needed_return @ return if called from exception
++ movs r1, #0 @ desched nothing
++ movs r0, #0 @ resched nothing
++ bl svc_handler @ re-schedule the highest priority
++ @ task
+
++task_resched_if_needed_return:
++ pop {pc} @ return to caller
+diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c
+index bfb3a9b..9935a28 100644
+--- a/core/cortex-m/task.c
++++ b/core/cortex-m/task.c
+@@ -57,7 +57,6 @@ static uint32_t task_switches; /* Number of times active task changed */
+ static uint32_t irq_dist[CONFIG_IRQ_COUNT]; /* Distribution of IRQ calls */
+ #endif
+
+-extern void __switchto(task_ *from, task_ *to);
+ extern int __task_start(int *task_stack_ready);
+
+ #ifndef CONFIG_LOW_POWER_IDLE
+@@ -124,7 +123,7 @@ uint32_t scratchpad[17+18];
+ uint32_t scratchpad[17];
+ #endif
+
+-static task_ *current_task = (task_ *)scratchpad;
++task_ *current_task = (task_ *)scratchpad;
+
+ /*
+ * Should IRQs chain to svc_handler()? This should be set if either of the
+@@ -137,7 +136,7 @@ static task_ *current_task = (task_ *)scratchpad;
+ * task unblocking. After checking for a task switch, svc_handler() will clear
+ * the flag (unless profiling is also enabled; then the flag remains set).
+ */
+-static int need_resched_or_profiling;
++int need_resched_or_profiling;
+
+ /*
+ * Bitmap of all tasks ready to be run.
+@@ -197,7 +196,7 @@ int task_start_called(void)
+ /**
+ * Scheduling system call
+ */
+-void svc_handler(int desched, task_id_t resched)
++task_ *__svc_handler(int desched, task_id_t resched)
+ {
+ task_ *current, *next;
+ #ifdef CONFIG_TASK_PROFILING
+@@ -264,16 +263,13 @@ void svc_handler(int desched, task_id_t resched)
+ need_resched_or_profiling = 0;
+ #endif
+
+- /* Nothing to do */
+- if (next == current)
+- return;
+-
+ /* Switch to new task */
+ #ifdef CONFIG_TASK_PROFILING
+- task_switches++;
++ if (next != current)
++ task_switches++;
+ #endif
+ current_task = next;
+- __switchto(current, next);
++ return current;
+ }
+
+ void __schedule(int desched, int resched)
+@@ -313,18 +309,6 @@ void task_start_irq_handler(void *excep_return)
+ }
+ #endif
+
+-void task_resched_if_needed(void *excep_return)
+-{
+- /*
+- * Continue iff a rescheduling event happened or profiling is active,
+- * and we are not called from another exception.
+- */
+- if (!need_resched_or_profiling || (((uint32_t)excep_return & 0xf) == 1))
+- return;
+-
+- svc_handler(0, 0);
+-}
+-
+ static uint32_t __wait_evt(int timeout_us, task_id_t resched)
+ {
+ task_ *tsk = current_task;
+--
+2.9.0
+
diff --git a/projects/cros-ec/patches/veyron/0001-ec-fix-a-clang-warning-by-use-a-unused-variable.patch b/projects/cros-ec/patches/veyron/0001-ec-fix-a-clang-warning-by-use-a-unused-variable.patch
new file mode 100644
index 00000000..82d6de83
--- /dev/null
+++ b/projects/cros-ec/patches/veyron/0001-ec-fix-a-clang-warning-by-use-a-unused-variable.patch
@@ -0,0 +1,38 @@
+From 35987639080ef4293bffbc1ce21de4d8a35b41db Mon Sep 17 00:00:00 2001
+From: Yunlian Jiang <yunlian@google.com>
+Date: Mon, 20 Apr 2015 09:38:56 -0700
+Subject: [PATCH 1/6] ec: fix a clang warning by use a unused variable.
+
+This uses the variable 'usage' in an error message to fix a clang
+warning.
+
+BUG=chromium:475960
+TEST=CC=x86_64-cros-linux-gnu-clang emerge-falco ec-devutils
+BRANCH=none
+Signed-off-by: yunlian@chromium.org
+
+Change-Id: Ic5703636040805661c7b81b83fc182e127ceab8c
+Reviewed-on: https://chromium-review.googlesource.com/266404
+Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
+Tested-by: Yunlian Jiang <yunlian@chromium.org>
+Commit-Queue: Yunlian Jiang <yunlian@chromium.org>
+---
+ util/lbcc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util/lbcc.c b/util/lbcc.c
+index b34b21e..953f422 100644
+--- a/util/lbcc.c
++++ b/util/lbcc.c
+@@ -630,7 +630,7 @@ int main(int argc, char *argv[])
+ }
+
+ if (errorcnt) {
+- fprintf(stderr, "\nUsage: %s [options] ...\n\n", progname);
++ fprintf(stderr, usage, progname);
+ exit(1);
+ }
+
+--
+2.9.0
+
diff --git a/projects/cros-ec/patches/veyron/0002-use-_DEFAULT_SOURCE-for-newer-glibc.patch b/projects/cros-ec/patches/veyron/0002-use-_DEFAULT_SOURCE-for-newer-glibc.patch
new file mode 100644
index 00000000..7da2c967
--- /dev/null
+++ b/projects/cros-ec/patches/veyron/0002-use-_DEFAULT_SOURCE-for-newer-glibc.patch
@@ -0,0 +1,53 @@
+From d2f946caf27adf4518cb657da39e296366d0b53f Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@chromium.org>
+Date: Mon, 7 Dec 2015 21:46:13 -0500
+Subject: [PATCH 2/6] use _DEFAULT_SOURCE for newer glibc
+
+Newer versions of glibc have moved to _DEFAULT_SOURCE and away from
+_BSD_SOURCE. Trying to use the BSD define by itself leads to warnings
+which causes build failures.
+
+BRANCH=none
+BUG=None
+TEST=precq still works
+
+Signed-off-by: Mike Frysinger <vapier@chromium.org>
+Change-Id: Ice24b84dc6a540695fc7b76e8f22a4c85c301976
+Reviewed-on: https://chromium-review.googlesource.com/316730
+Reviewed-by: Bill Richardson <wfrichar@chromium.org>
+---
+ util/ec_uartd.c | 3 ++-
+ util/stm32mon.c | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/util/ec_uartd.c b/util/ec_uartd.c
+index 82823c4..678932e 100644
+--- a/util/ec_uartd.c
++++ b/util/ec_uartd.c
+@@ -11,7 +11,8 @@
+ */
+
+ /* Force header files to define grantpt(), posix_openpt(), cfmakeraw() */
+-#define _BSD_SOURCE
++#define _DEFAULT_SOURCE /* Newer glibc */
++#define _BSD_SOURCE /* Older glibc */
+ #define _XOPEN_SOURCE 600
+ /* Force header file to declare ptsname_r(), etc. */
+ #ifndef _GNU_SOURCE
+diff --git a/util/stm32mon.c b/util/stm32mon.c
+index 2de9400..ed1a7ee 100644
+--- a/util/stm32mon.c
++++ b/util/stm32mon.c
+@@ -13,7 +13,8 @@
+ */
+
+ /* use cfmakeraw() */
+-#define _BSD_SOURCE
++#define _DEFAULT_SOURCE /* Newer glibc */
++#define _BSD_SOURCE /* Older glibc */
+
+ #include <arpa/inet.h>
+ #include <errno.h>
+--
+2.9.0
+
diff --git a/projects/cros-ec/patches/veyron/0003-Enforce-compilation-without-system-headers.patch b/projects/cros-ec/patches/veyron/0003-Enforce-compilation-without-system-headers.patch
new file mode 100644
index 00000000..a97aa901
--- /dev/null
+++ b/projects/cros-ec/patches/veyron/0003-Enforce-compilation-without-system-headers.patch
@@ -0,0 +1,44 @@
+From 63bb6f6effbaae9864366588464a7b9354c9a623 Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Wed, 20 Jul 2016 16:26:32 +0200
+Subject: [PATCH 3/6] Enforce compilation without system headers
+
+This is based on commit bc404c94b4ab1e6a62e607fd7ef034aa31d6388e
+(Enforce compilation without system headers)
+---
+ Makefile | 5 +++--
+ Makefile.toolchain | 2 +-
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 01581fb..195ea44 100644
+--- a/Makefile
++++ b/Makefile
+@@ -99,8 +99,9 @@ _rw_size_str:=$(shell echo "CONFIG_FW_RW_SIZE" | $(CPP) $(CPPFLAGS) -P \
+ _rw_size:=$(shell echo "$$(($(_rw_size_str)))")
+
+ # Get RSA key size from board defines
+-_rsa_size:=$(shell echo "CONFIG_RSA_KEY_SIZE" | $(CPP) $(CPPFLAGS) -P \
+- -Ichip/$(CHIP) -Iboard/$(BOARD) -imacros include/rsa.h)
++_rsa_size:=$(shell echo "CONFIG_RSA_KEY_SIZE" | $(CPP) $(CPPFLAGS) \
++ $(CFLAGS_WARN) -P -Ichip/$(CHIP) -Iboard/$(BOARD) \
++ -imacros include/rsa.h)
+ $(eval RSA_KEY_SIZE=$(_rsa_size))
+
+ $(eval BOARD_$(UC_BOARD)=y)
+diff --git a/Makefile.toolchain b/Makefile.toolchain
+index 43f390c..898129c 100644
+--- a/Makefile.toolchain
++++ b/Makefile.toolchain
+@@ -19,7 +19,7 @@ BUILDCC?=gcc
+ HOSTCC?=$(HOST_CROSS_COMPILE)gcc
+
+ CFLAGS_WARN=-Wall -Werror -Wundef -Wstrict-prototypes -Wno-trigraphs \
+- -fno-strict-aliasing -fno-common \
++ -fno-strict-aliasing -fno-common -ffreestanding -fno-builtin \
+ -Werror-implicit-function-declaration -Wno-format-security \
+ -fno-delete-null-pointer-checks -Wdeclaration-after-statement \
+ -Wno-pointer-sign -fno-strict-overflow -fconserve-stack
+--
+2.9.0
+
diff --git a/projects/cros-ec/patches/veyron/0004-Don-t-declare-functions-inline-that-aren-t-always-de.patch b/projects/cros-ec/patches/veyron/0004-Don-t-declare-functions-inline-that-aren-t-always-de.patch
new file mode 100644
index 00000000..f089dbe9
--- /dev/null
+++ b/projects/cros-ec/patches/veyron/0004-Don-t-declare-functions-inline-that-aren-t-always-de.patch
@@ -0,0 +1,28 @@
+From 3515f1d744cbcdb37471e898277aa6b1ddd3d0ee Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Wed, 20 Jul 2016 16:27:05 +0200
+Subject: [PATCH 4/6] Don't declare functions inline that aren't always defined
+ as such
+
+This is based on commit 960cf45b3ffe88e842c27145e7e646d63a89c371
+(Don't declare functions inline that aren't always defined as such)
+---
+ include/task.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/task.h b/include/task.h
+index cb96281..85d5b00 100644
+--- a/include/task.h
++++ b/include/task.h
+@@ -47,7 +47,7 @@ void interrupt_enable(void);
+ /**
+ * Return true if we are in interrupt context.
+ */
+-inline int in_interrupt_context(void);
++int in_interrupt_context(void);
+
+ /**
+ * Set a task event.
+--
+2.9.0
+
diff --git a/projects/cros-ec/patches/veyron/0005-Don-t-include-missing-and-unnecessary-math-header.patch b/projects/cros-ec/patches/veyron/0005-Don-t-include-missing-and-unnecessary-math-header.patch
new file mode 100644
index 00000000..0a099213
--- /dev/null
+++ b/projects/cros-ec/patches/veyron/0005-Don-t-include-missing-and-unnecessary-math-header.patch
@@ -0,0 +1,29 @@
+From 913b2f1265bd7f3ebe6cf4cba92c20c5a423a6c3 Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Tue, 2 Aug 2016 12:05:55 +0200
+Subject: [PATCH 5/6] Don't include missing and unnecessary math header
+
+This removes the inclusion of an unnecessary math header that is neither
+found nor necessary for non-cortex-m ECs.
+
+Change-Id: I56a04178dadedb76f841504fa645e2d43900d25f
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ common/math_util.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/common/math_util.c b/common/math_util.c
+index 120d13d..34a267d 100644
+--- a/common/math_util.c
++++ b/common/math_util.c
+@@ -6,7 +6,6 @@
+ /* Common math functions. */
+
+ #include "common.h"
+-#include "math.h"
+ #include "math_util.h"
+ #include "util.h"
+
+--
+2.9.0
+
diff --git a/projects/cros-ec/patches/veyron/0006-cortex-m0-Use-assembly-exception-handlers-for-task-s.patch b/projects/cros-ec/patches/veyron/0006-cortex-m0-Use-assembly-exception-handlers-for-task-s.patch
new file mode 100644
index 00000000..f0175825
--- /dev/null
+++ b/projects/cros-ec/patches/veyron/0006-cortex-m0-Use-assembly-exception-handlers-for-task-s.patch
@@ -0,0 +1,219 @@
+From 9dd7ae82d3f3fa9dae31a442365e233a0b44cce3 Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Sat, 23 Jul 2016 14:17:32 +0200
+Subject: [PATCH 6/6] cortex-m0: Use assembly exception handlers for task
+ switching
+
+The way Cortex processors handle exceptions allows writing exception
+routines directly in C, as return from exception is handled by providing
+a special value for the link register.
+
+However, it is not safe to do this when doing context switching. In
+particular, C handlers may push some general-purpose registers that
+are used by the handler and pop them later, even when context switch
+has happened in the meantime. While the processor will restore {r0-r3}
+from the stack when returning from an exception, the C handler code
+may push, use and pop another register, such as r4.
+
+It turns out that GCC 4.8 would generally only use r3 in svc_handler and
+pendsv_handler, but newer versions tend to use r4, thus clobbering r4
+that was restored from the context switch and leading up to a fault
+when r4 is used by the task code.
+
+An occurrence of this behaviour takes place with GCC > 4.8 in __wait_evt,
+where "me" is stored in r4, which gets clobbered after an exception
+triggers pendsv_handler. The exception handler uses r4 internally, does
+a context switch and then restores the previous value of r4, which is
+not restored by the processor's internal, thus clobbering r4.
+This ends up with the following assertion failure:
+'tskid < TASK_ID_COUNT' in timer_cancel() at common/timer.c:137
+
+For this reason, it is safer to have assembly routines for exception
+handlers that do context switching.
+
+BUG=chromium:631514
+BRANCH=None
+TEST=Build and run speedy EC with a recent GCC version
+
+Change-Id: Ib068bc12ce2204aee3e0f563efcb94f15aa87013
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ core/cortex-m0/switch.S | 81 ++++++++++++++++++++++++++++++++++---------------
+ core/cortex-m0/task.c | 27 +----------------
+ 2 files changed, 58 insertions(+), 50 deletions(-)
+
+diff --git a/core/cortex-m0/switch.S b/core/cortex-m0/switch.S
+index 95ea29e..d4b47cd 100644
+--- a/core/cortex-m0/switch.S
++++ b/core/cortex-m0/switch.S
+@@ -7,12 +7,52 @@
+
+ #include "config.h"
+
++#define CPU_SCB_ICSR 0xe000ed04
++
+ .text
+
+ .syntax unified
+ .code 16
+
+ /**
++ * Start the task scheduling. r0 is a pointer to task_stack_ready, which is
++ * set to 1 after the task stack is set up.
++ */
++.global __task_start
++.thumb_func
++__task_start:
++ ldr r2,=scratchpad @ area used as dummy thread stack for the first switch
++ movs r3, #2 @ use : priv. mode / thread stack / no floating point
++ adds r2, #17*4 @ put the pointer at the top of the stack
++ movs r1, #0 @ __Schedule parameter : re-schedule nothing
++ msr psp, r2 @ setup a thread stack up to the first context switch
++ movs r2, #1
++ isb @ ensure the write is done
++ msr control, r3
++ movs r3, r0
++ movs r0, #0 @ __Schedule parameter : de-schedule nothing
++ isb @ ensure the write is done
++ str r2, [r3] @ Task scheduling is now active
++ bl __schedule @ execute the task with the highest priority
++ /* we should never return here */
++ movs r0, #1 @ set to EC_ERROR_UNKNOWN
++ bx lr
++
++/**
++ * SVC exception handler
++ */
++.global svc_handler
++.thumb_func
++svc_handler:
++ push {lr} @ save link register
++ bl __svc_handler @ call svc handler helper
++ ldr r3,=current_task @ load the current task's address
++ ldr r1, [r3] @ load the current task
++ cmp r0, r1 @ compare with previous task returned by helper
++ beq svc_handler_return @ return if they are the same
++ /* continue to __switchto to switch to the new task */
++
++/**
+ * Task context switching
+ *
+ * Change the task scheduled after returning from the exception.
+@@ -30,8 +70,6 @@
+ * r8, r9, r10, r11, r4, r5, r6, r7, r0, r1, r2, r3, r12, lr, pc, psr
+ * additional registers <|> exception frame
+ */
+-.global __switchto
+-.thumb_func
+ __switchto:
+ mrs r2, psp @ get the task stack where the context has been saved
+ mov r3, sp
+@@ -53,29 +91,24 @@ __switchto:
+ mov r11, r7
+ ldmia r2!, {r4-r7} @ restore r4-r7 for the next task context
+ msr psp, r2 @ set the process stack pointer to exception context
+- bx lr @ return from exception
++
++svc_handler_return:
++ pop {pc} @ return from exception or return to caller
+
+ /**
+- * Start the task scheduling. r0 is a pointer to task_stack_ready, which is
+- * set to 1 after the task stack is set up.
++ * PendSVC exception handler
+ */
+-.global __task_start
++.global pendsv_handler
+ .thumb_func
+-__task_start:
+- ldr r2,=scratchpad @ area used as dummy thread stack for the first switch
+- movs r3, #2 @ use : priv. mode / thread stack / no floating point
+- adds r2, #17*4 @ put the pointer at the top of the stack
+- movs r1, #0 @ __Schedule parameter : re-schedule nothing
+- msr psp, r2 @ setup a thread stack up to the first context switch
+- movs r2, #1
+- isb @ ensure the write is done
+- msr control, r3
+- movs r3, r0
+- movs r0, #0 @ __Schedule parameter : de-schedule nothing
+- isb @ ensure the write is done
+- str r2, [r3] @ Task scheduling is now active
+- bl __schedule @ execute the task with the highest priority
+- /* we should never return here */
+- movs r0, #1 @ set to EC_ERROR_UNKNOWN
+- bx lr
+-
++pendsv_handler:
++ push {lr} @ save link register
++ ldr r0, =#CPU_SCB_ICSR @ load CPU_SCB_ICSR's address
++ movs r1, #1 @ prepare left shift (1 << 27)
++ lsls r1, #27 @ shift the bit
++ str r1, [r0] @ clear pending flag
++ cpsid i @ ensure we have priority 0 during re-scheduling
++ movs r1, #0 @ desched nothing
++ movs r0, #0 @ resched nothing
++ bl svc_handler @ re-schedule the highest priority task
++ cpsie i @ leave priority 0
++ pop {pc} @ return from exception
+diff --git a/core/cortex-m0/task.c b/core/cortex-m0/task.c
+index e51621b..f96ccf8 100644
+--- a/core/cortex-m0/task.c
++++ b/core/cortex-m0/task.c
+@@ -57,7 +57,6 @@ static uint32_t task_switches; /* Number of times active task changed */
+ static uint32_t irq_dist[CONFIG_IRQ_COUNT]; /* Distribution of IRQ calls */
+ #endif
+
+-extern void __switchto(task_ *from, task_ *to);
+ extern int __task_start(int *task_stack_ready);
+
+ #ifndef CONFIG_LOW_POWER_IDLE
+@@ -120,7 +119,7 @@ uint8_t task_stacks[0
+ /* Reserve space to discard context on first context switch. */
+ uint32_t scratchpad[17];
+
+-static task_ *current_task = (task_ *)scratchpad;
++task_ *current_task = (task_ *)scratchpad;
+
+ /*
+ * Bitmap of all tasks ready to be run.
+@@ -242,18 +241,6 @@ task_ *__svc_handler(int desched, task_id_t resched)
+ return current;
+ }
+
+-void svc_handler(int desched, task_id_t resched)
+-{
+- /*
+- * The layout of the this routine (and the __svc_handler companion one)
+- * ensures that we are getting the right tail call optimization from
+- * the compiler.
+- */
+- task_ *prev = __svc_handler(desched, resched);
+- if (current_task != prev)
+- __switchto(prev, current_task);
+-}
+-
+ void __schedule(int desched, int resched)
+ {
+ register int p0 asm("r0") = desched;
+@@ -262,18 +249,6 @@ void __schedule(int desched, int resched)
+ asm("svc 0" : : "r"(p0), "r"(p1));
+ }
+
+-void pendsv_handler(void)
+-{
+- /* Clear pending flag */
+- CPU_SCB_ICSR = (1 << 27);
+-
+- /* ensure we have priority 0 during re-scheduling */
+- __asm__ __volatile__("cpsid i");
+- /* re-schedule the highest priority task */
+- svc_handler(0, 0);
+- __asm__ __volatile__("cpsie i");
+-}
+-
+ #ifdef CONFIG_TASK_PROFILING
+ void task_start_irq_handler(void *excep_return)
+ {
+--
+2.9.0
+
diff --git a/projects/cros-scripts/cros-scripts b/projects/cros-scripts/cros-scripts
new file mode 100755
index 00000000..4e3bb459
--- /dev/null
+++ b/projects/cros-scripts/cros-scripts
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+install() {
+ project_install "$project"
+}
+
+install_check() {
+ project_install_check "$project"
+}
+
+release() {
+ project_release_install_archive "$project" "$TOOLS"
+}
+
+release_check() {
+ project_release_install_archive_check "$project" "$TOOLS"
+}
+
+clean() {
+ project_clean "$project"
+}
diff --git a/projects/cros-scripts/install/cros-kernel-prepare b/projects/cros-scripts/install/cros-kernel-prepare
new file mode 100755
index 00000000..9a50b0df
--- /dev/null
+++ b/projects/cros-scripts/install/cros-kernel-prepare
@@ -0,0 +1,155 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ARCH="arch"
+CMDLINE="cmdline"
+BOOTLOADER="bootloader"
+KERNEL_ITS="kernel.its"
+KERNEL_FIT="kernel.fit"
+KERNEL_IMAGE="kernel.img"
+
+usage() {
+ printf "$executable [action] [kernel files|kernel image] [medium]\n" >&2
+
+ printf "\nActions:\n" >&2
+ printf " pack - Pack kernel files to a medium-specific image\n" >&2
+ printf " sign - Sign kernel image\n" >&2
+ printf " verify - Very kernel image signatures\n" >&2
+
+ printf "\nMedium:\n" >&2
+ printf " usb - External USB storage\n" >&2
+ printf " mmc - External SD card storage\n" >&2
+ printf " emmc - Internal storage\n" >&2
+
+ printf "\nEnvironment variables:\n" >&2
+ printf " VBOOT_KEYS_PATH - Path to the vboot keys\n" >&2
+ printf " VBOOT_TOOLS_PATH - Path to vboot tools\n" >&2
+}
+
+pack() {
+ local kernel_files_path=$1
+ local medium=$2
+
+ local arch_path="$kernel_files_path/$ARCH"
+ local arch=$( cat "$arch_path" )
+ local cmdline_path="$kernel_files_path/$CMDLINE-$medium"
+ local bootloader_path="$kernel_files_path/$BOOTLOADER"
+ local kernel_its_path="$kernel_files_path/$KERNEL_ITS"
+ local kernel_fit_path="$kernel_files_path/$KERNEL_FIT"
+ local kernel_image_path="$kernel_files_path/$KERNEL_IMAGE"
+
+ mkimage -f "$kernel_its_path" "$kernel_fit_path"
+ futility vbutil_kernel --pack "$kernel_image_path" --version 1 --arch "$arch" --keyblock "$VBOOT_KEYS_PATH/kernel.keyblock" --signprivate "$VBOOT_KEYS_PATH/kernel_data_key.vbprivk" --config "$cmdline_path" --vmlinuz "$kernel_fit_path" --bootloader "$bootloader_path"
+
+ printf "\nPacked kernel image $kernel_image_path\n"
+}
+
+sign() {
+ local kernel_image_path=$1
+
+ futility vbutil_kernel --repack "$kernel_image_path" --version 1 --keyblock "$VBOOT_KEYS_PATH/kernel.keyblock" --signprivate "$VBOOT_KEYS_PATH/kernel_data_key.vbprivk" --oldblob "$kernel_image_path"
+
+ printf "\nSigned kernel image $kernel_image_path\n"
+}
+
+verify() {
+ local kernel_image_path=$1
+
+ futility vbutil_kernel --verify "$kernel_image_path" --signpubkey "$VBOOT_KEYS_PATH/kernel_subkey.vbpubk"
+
+ printf "\nVerified kernel image $kernel_image_path\n"
+}
+
+requirements() {
+ local requirement
+ local requirement_path
+
+ for requirement in "$@"
+ do
+ requirement_path=$( which "$requirement" || true )
+
+ if [ -z "$requirement_path" ]
+ then
+ printf "Missing requirement: $requirement\n" >&2
+ exit 1
+ fi
+ done
+}
+
+setup() {
+ root=$( realpath "$( dirname "$0" )" )
+ executable=$( basename "$0" )
+
+ if ! [ -z "$VBOOT_TOOLS_PATH" ]
+ then
+ PATH="$PATH:$VBOOT_TOOLS_PATH"
+ fi
+
+ if [ -z "$VBOOT_KEYS_PATH" ]
+ then
+ if ! [ -z "$VBOOT_TOOLS_PATH" ] && [ -d "$VBOOT_TOOLS_PATH/devkeys" ]
+ then
+ VBOOT_KEYS_PATH="$VBOOT_TOOLS_PATH/devkeys"
+ else
+ VBOOT_KEYS_PATH="/usr/share/vboot/devkeys"
+ fi
+ fi
+}
+
+cros_media_setup() {
+ local action=$1
+ local kernel_files_path=$2
+ local kernel_image_path=$2
+ local medium=$3
+
+ set -e
+
+ setup "$@"
+
+ if [ -z "$action" ] || [ -z "$kernel_files_path" ] || [ -z "$kernel_image_path" ]
+ then
+ usage
+ exit 1
+ fi
+
+ case $action in
+ "pack")
+ if [ -z "$medium" ]
+ then
+ usage
+ exit 1
+ fi
+
+ requirements "mkimage" "futility"
+ pack "$kernel_files_path" "$medium"
+ ;;
+ "sign")
+ requirements "futility"
+ sign "$kernel_image_path"
+ ;;
+ "verify")
+ requirements "futility"
+ verify "$kernel_image_path"
+ ;;
+ *)
+ usage
+ exit 1
+ ;;
+ esac
+}
+
+cros_media_setup "$@"
diff --git a/projects/cros-scripts/install/cros-medium-setup b/projects/cros-scripts/install/cros-medium-setup
new file mode 100755
index 00000000..1f8c956b
--- /dev/null
+++ b/projects/cros-scripts/install/cros-medium-setup
@@ -0,0 +1,313 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+SYS_BLOCK_PATH="/sys/class/block"
+DEV_PATH="/dev"
+DEVICE="device"
+VENDOR="vendor"
+MODEL="model"
+NAME="name"
+KERNEL_IMAGE="kernel.img"
+KERNEL_MODULES="modules/lib"
+KERNEL_PARTITION_INDEX=1
+ROOTFS_PARTITION_INDEX=2
+
+# Size in blocks (512 kiB)
+GPT_SIZE=34
+KERNEL_SIZE=16384
+
+usage() {
+ printf "$executable [action] [storage] [rootfs tarball|kernel files]\n" >&2
+
+ printf "\nActions:\n" >&2
+ printf " partitions - Setup partitions on storage\n" >&2
+ printf " rootfs - Install rootfs tarball to storage\n" >&2
+ printf " kernel - Install kernel files to storage\n" >&2
+
+ usage_storage
+
+ printf "\nEnvironment variables:\n" >&2
+ printf " KERNEL_PATH - Path to the kernel image\n" >&2
+ printf " VBOOT_TOOLS_PATH - Path to vboot tools\n" >&2
+}
+
+usage_storage() {
+ printf "\nStorage:\n" >&2
+
+ local nodes=$( ls "$SYS_BLOCK_PATH" )
+ local node_path
+ local name
+
+ for node in $nodes
+ do
+ node_path="$DEV_PATH/$node"
+ if ! [ -b "$node_path" ]
+ then
+ continue
+ fi
+
+ name=$( storage_name "$node_path" )
+ if [ -z "$name" ]
+ then
+ continue
+ fi
+
+ printf " $node_path - $name\n" >&2
+ done
+}
+
+storage_affect_confirm() {
+ local storage_path=$1
+
+ local name=$( storage_name "$storage_path" )
+ local confirm
+
+ printf "This is going to affect the following storage:\n"
+ printf " $storage_path - $name\n"
+ printf "Press enter to confirm: "
+
+ read confirm
+}
+
+storage_name() {
+ local storage_path=$1
+
+ local node=$( basename "$storage_path" )
+ local vendor_path="$SYS_BLOCK_PATH/$node/$DEVICE/$VENDOR"
+ local model_path="$SYS_BLOCK_PATH/$node/$DEVICE/$MODEL"
+ local name_path="$SYS_BLOCK_PATH/$node/$DEVICE/$NAME"
+ local vendor
+ local name
+
+ if [ -f "$model_path" ]
+ then
+ name=$( cat "$model_path" )
+ elif [ -f "$name_path" ]
+ then
+ name=$( cat "$name_path" )
+ else
+ return 0
+ fi
+
+ name=$( echo "$name" | sed -e "s/^[[:space:]]*//;s/[[:space:]]*$//" )
+
+ if [ -f "$vendor_path" ]
+ then
+ vendor=$( cat "$vendor_path" )
+ vendor=$( echo "$vendor" | sed -e "s/^[[:space:]]*//;s/[[:space:]]*$//" )
+
+ name="$vendor $name"
+ fi
+
+ echo "$name"
+}
+
+storage_partition_path() {
+ local storage_path=$1
+ local index=$2
+
+ storage_partition_path="$storage_path$index"
+
+ if ! [ -b "$storage_partition_path" ]
+ then
+ storage_partition_path="$storage_path""p$index"
+ fi
+
+ if ! [ -b "$storage_partition_path" ]
+ then
+ return 1
+ fi
+
+ echo "$storage_partition_path"
+}
+
+storage_partition_mount_path() {
+ local storage_partition_path=$1
+
+ local storage_partition_mount_path=$( udisksctl info -b "$storage_partition_path" | grep "MountPoints" | sed "s/.*MountPoints:[[:space:]]*\(.*\)/\1/g" )
+
+ echo "$storage_partition_mount_path"
+}
+
+partitions() {
+ local storage_path=$1
+
+ local storage_rootfs_path
+ local partitions
+ local start
+
+ storage_affect_confirm "$storage_path"
+
+ partitions=$( mount | grep -P "^$storage_path" | sed "s/^\([^[:space:]]*\).*/\1/g" )
+
+ for partition in $partitions
+ do
+ # Partition may already be unmounted.
+ udisksctl unmount -b "$partition" || true
+ done
+
+ ( echo "g" ; echo "w" ) | fdisk "$storage_path"
+
+ cgpt create "$storage_path"
+
+ start=$GPT_SIZE
+ size=$KERNEL_SIZE
+ cgpt add -b "$start" -s "$size" -P 1 -S 1 -t kernel -l kernel "$storage_path"
+
+ start=$(( $start + $size ))
+ size=$( cgpt show "$storage_path" | grep "Sec GPT table" | sed "s/[[:space:]]*\([0-9]*\).*/\1/g" )
+ size=$(( $size - $start ))
+ cgpt add -b "$start" -s "$size" -t rootfs -l rootfs "$storage_path"
+
+ blockdev --rereadpt "$storage_path" || partprobe "$storage_path"
+
+ storage_rootfs_path=$( storage_partition_path "$storage_path" "$ROOTFS_PARTITION_INDEX" )
+
+ mkfs.ext4 -F "$storage_rootfs_path"
+
+ printf "\nSetup partitions on storage $storage_path\n"
+}
+
+rootfs() {
+ local storage_path=$1
+ local rootfs_tarball_path=$2
+
+ local storage_rootfs_path=$( storage_partition_path "$storage_path" "$ROOTFS_PARTITION_INDEX" )
+ local storage_rootfs_mount_path
+
+ storage_affect_confirm "$storage_path"
+
+ # Partition may already be mounted.
+ udisksctl mount -b "$storage_rootfs_path" || true
+
+ storage_rootfs_mount_path=$( storage_partition_mount_path "$storage_rootfs_path" )
+
+ tar -xf "$rootfs_tarball_path" -ps -C "$storage_rootfs_mount_path"
+
+ udisksctl unmount -b "$storage_rootfs_path"
+
+ printf "\nInstalled rootfs on storage $storage_path\n"
+}
+
+kernel() {
+ local storage_path=$1
+ local kernel_files_path=$2
+
+ local storage_kernel_path=$( storage_partition_path "$storage_path" "$KERNEL_PARTITION_INDEX" )
+ local storage_rootfs_path=$( storage_partition_path "$storage_path" "$ROOTFS_PARTITION_INDEX" )
+ local kernel_image_path="$kernel_files_path/$KERNEL_IMAGE"
+ local kernel_modules_path="$kernel_files_path/$KERNEL_MODULES"
+ local storage_rootfs_mount_path
+
+ storage_affect_confirm "$storage_path"
+
+ cat "$kernel_image_path" > "$storage_kernel_path"
+ sync
+
+ # Partition may already be mounted.
+ udisksctl mount -b "$storage_rootfs_path" || true
+
+ storage_rootfs_mount_path=$( storage_partition_mount_path "$storage_rootfs_path" )
+
+ rsync -a --keep-dirlinks "$kernel_modules_path" "$storage_rootfs_mount_path/"
+ sync
+
+ udisksctl unmount -b "$storage_rootfs_path"
+
+ printf "\nInstalled kernel on storage $storage_path\n"
+}
+
+requirements() {
+ local requirement
+ local requirement_path
+
+ for requirement in "$@"
+ do
+ requirement_path=$( which "$requirement" || true )
+
+ if [ -z "$requirement_path" ]
+ then
+ printf "Missing requirement: $requirement\n" >&2
+ exit 1
+ fi
+ done
+}
+
+setup() {
+ root=$( realpath "$( dirname "$0" )" )
+ executable=$( basename "$0" )
+
+ if [ -z "$KERNEL_PATH" ]
+ then
+ KERNEL_PATH=$root
+ fi
+
+ if ! [ -z "$VBOOT_TOOLS_PATH" ]
+ then
+ PATH="$PATH:$VBOOT_TOOLS_PATH"
+ fi
+}
+
+cros_medium_setup() {
+ local action=$1
+ local storage_path=$2
+ local rootfs_tarball_path=$3
+ local kernel_files_path=$3
+
+ set -e
+
+ setup "$@"
+
+ if [ -z "$action" ] || [ -z "$storage_path" ]
+ then
+ usage
+ exit 1
+ fi
+
+ case $action in
+ "partitions")
+ requirements "udisksctl" "fdisk" "cgpt" "mkfs.ext4"
+ partitions "$storage_path"
+ ;;
+ "rootfs")
+ if [ -z "$rootfs_tarball_path" ]
+ then
+ usage
+ exit 1
+ fi
+
+ requirements "udisksctl" "tar"
+ rootfs "$storage_path" "$rootfs_tarball_path"
+ ;;
+ "kernel")
+ if [ -z "$kernel_files_path" ]
+ then
+ usage
+ exit 1
+ fi
+
+ requirements "udisksctl" "rsync"
+ kernel "$storage_path" "$kernel_files_path"
+ ;;
+ *)
+ usage
+ exit 1
+ ;;
+ esac
+}
+
+cros_medium_setup "$@"
diff --git a/projects/cros-scripts/install/install b/projects/cros-scripts/install/install
new file mode 100644
index 00000000..21c4061e
--- /dev/null
+++ b/projects/cros-scripts/install/install
@@ -0,0 +1,2 @@
+cros-kernel-prepare:cros-kernel-prepare
+cros-medium-setup:cros-medium-setup
diff --git a/projects/cros-tools/configs/projects b/projects/cros-tools/configs/projects
new file mode 100644
index 00000000..de1e29ff
--- /dev/null
+++ b/projects/cros-tools/configs/projects
@@ -0,0 +1,7 @@
+cros-scripts
+cros-ec tools
+flashrom-cros
+hdctools
+vboot tools
+flashmap
+mosys
diff --git a/projects/cros-tools/cros-tools b/projects/cros-tools/cros-tools
new file mode 100755
index 00000000..3f0b0e83
--- /dev/null
+++ b/projects/cros-tools/cros-tools
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+download() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+extract() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+update() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+build() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+install() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+release() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+clean() {
+ project_action_projects "$action" "$project" "$@"
+}
diff --git a/projects/crossgcc/configs/blobs b/projects/crossgcc/configs/blobs
new file mode 120000
index 00000000..8574352d
--- /dev/null
+++ b/projects/crossgcc/configs/blobs
@@ -0,0 +1 @@
+../../coreboot/configs/blobs \ No newline at end of file
diff --git a/projects/crossgcc/configs/blobs-ignore b/projects/crossgcc/configs/blobs-ignore
new file mode 120000
index 00000000..04d6519e
--- /dev/null
+++ b/projects/crossgcc/configs/blobs-ignore
@@ -0,0 +1 @@
+../../coreboot/configs/blobs-ignore \ No newline at end of file
diff --git a/projects/crossgcc/configs/blobs-ignore-notes.txt b/projects/crossgcc/configs/blobs-ignore-notes.txt
new file mode 120000
index 00000000..3f05ba9b
--- /dev/null
+++ b/projects/crossgcc/configs/blobs-ignore-notes.txt
@@ -0,0 +1 @@
+../../coreboot/configs/blobs-ignore-notes.txt \ No newline at end of file
diff --git a/projects/crossgcc/configs/install b/projects/crossgcc/configs/install
new file mode 100644
index 00000000..8f4e2632
--- /dev/null
+++ b/projects/crossgcc/configs/install
@@ -0,0 +1 @@
+*:.
diff --git a/projects/crossgcc/configs/revision b/projects/crossgcc/configs/revision
new file mode 120000
index 00000000..006c3a7a
--- /dev/null
+++ b/projects/crossgcc/configs/revision
@@ -0,0 +1 @@
+../../coreboot/configs/revision \ No newline at end of file
diff --git a/projects/crossgcc/configs/targets b/projects/crossgcc/configs/targets
new file mode 100644
index 00000000..fb05f39d
--- /dev/null
+++ b/projects/crossgcc/configs/targets
@@ -0,0 +1 @@
+arm
diff --git a/projects/crossgcc/crossgcc b/projects/crossgcc/crossgcc
new file mode 100755
index 00000000..aa930213
--- /dev/null
+++ b/projects/crossgcc/crossgcc
@@ -0,0 +1,209 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+arguments() {
+ project_arguments_targets "$project" "$@"
+}
+
+usage() {
+ project_usage_actions "$project" "prefix"
+ project_usage_arguments "$project" "$@"
+}
+
+download() {
+ local repository="coreboot"
+
+ git_project_prepare "$project" "$repository" "$@"
+}
+
+download_check() {
+ local repository="coreboot"
+
+ git_project_prepare_check "$project" "$repository" "$@"
+}
+
+extract() {
+ local arguments=$@
+
+ local repository="coreboot"
+ local tarball
+
+ project_extract "$project" "$@"
+
+ crossgcc_tarballs "$@" | while read tarball
+ do
+ local tarball_sources_path=$( crossgcc_tarball_sources_path "$tarball" )
+ local tarball_install_path=$( crossgcc_tarball_install_path "$tarball" "$@" )
+ local tarball_install_directory_path=$( dirname "$tarball_install_path" )
+
+ if [ -f "$tarball_sources_path" ] && ! [ -f "$tarball_install_path" ]
+ then
+ printf "Copying source archive $tarball for $project (with ${arguments:-no argument})\n"
+
+ mkdir -p "$tarball_install_directory_path"
+
+ file_verification_check "$tarball_sources_path"
+ cp "$tarball_sources_path" "$tarball_install_path"
+ fi
+ done
+}
+
+extract_check() {
+ local repository="coreboot"
+ local tarball
+
+ project_extract_check "$project" "$@"
+
+ crossgcc_tarballs "$@" | while read tarball
+ do
+ local tarball_install_path=$( crossgcc_tarball_install_path "$tarball" "$@" )
+
+ test ! -f "$tarball_install_path"
+ done
+}
+
+update() {
+ local arguments=$@
+
+ local repository="coreboot"
+ local tarball
+
+ project_update_git $project $repository $arguments
+
+ crossgcc_tarballs "$@" | while read tarball
+ do
+ local tarball_sources_path=$( crossgcc_tarball_sources_path "$tarball" )
+ local tarball_install_path=$( crossgcc_tarball_install_path "$tarball" "$@" )
+ local tarball_install_directory_path=$( dirname "$tarball_install_path" )
+
+ if [ -f $tarball_sources_path ]
+ then
+ printf "Copying source archive $tarball for $project (with ${arguments:-no argument})\n"
+
+ mkdir -p "$tarball_install_directory_path"
+
+ file_verification_check "$tarball_sources_path"
+ cp "$tarball_sources_path" "$tarball_install_path"
+ fi
+ done
+}
+
+update_check() {
+ local repository="coreboot"
+ local tarball
+
+ project_update_check_git "$project" "$repository" "$@"
+
+ crossgcc_tarballs "$@" | while read tarball
+ do
+ local tarball_sources_path=$( crossgcc_tarball_sources_path "$tarball" "$@" )
+
+ test ! -f "$tarball_sources_path"
+ done
+}
+
+prefix() {
+ local arch=$1
+
+ local build_path=$( project_build_path "$project" "$@" )
+
+ case $arch in
+ "arm")
+ echo "$build_path/bin/arm-eabi-"
+ ;;
+ esac
+}
+
+build() {
+ local arch=$1
+
+ local repository="coreboot"
+
+ project_sources_directory_missing_empty_error "$project" "$repository" "$@"
+
+ local sources_path=$( project_sources_path "$project" "$repository" "$@" )
+ local build_path=$( project_build_path "$project" "$@" )
+
+ if git_project_check "$repository"
+ then
+ git_project_checkout "$project" "$repository" "$@"
+ fi
+
+ mkdir -p "$build_path"
+
+ make -C "$sources_path" CPUS="$TASKS" DEST="$build_path" "crossgcc-$arch"
+}
+
+build_check() {
+ project_build_check "$project" "$@"
+}
+
+install() {
+ project_install "$project" "$@"
+}
+
+install_check() {
+ project_install_check "$project" "$@"
+}
+
+release() {
+ local arguments=$@
+
+ local repository="coreboot"
+ local tarball
+
+ project_release_install_archive "$project" "$TOOLS" "$@"
+
+ project_release_sources_git "$project" "$repository" "$@"
+
+ crossgcc_tarballs "$@" | while read tarball
+ do
+ local tarball_install_path=$( crossgcc_tarball_install_path "$tarball" "$@" )
+ local tarball_release_path=$( crossgcc_tarball_release_path "$tarball" "$@" )
+ local release_path=$( project_release_path "$project" "$SOURCES" "$@" )
+
+ mkdir -p "$release_path"
+
+ if [ -f "$tarball_install_path" ] && ! [ -f "$tarball_release_path" ]
+ then
+ printf "Releasing source archive $tarball for $project (with ${arguments:-no argument})\n"
+
+ cp "$tarball_install_path" "$tarball_release_path"
+ file_verification_create "$tarball_release_path"
+ fi
+ done
+}
+
+release_check() {
+ local repository="coreboot"
+ local tarball
+
+ project_release_install_archive_check "$project" "$TOOLS" "$@"
+
+ project_release_check_sources_git "$project" "$repository" "$@"
+
+ crossgcc_tarballs "$@" | while read tarball
+ do
+ local tarball_release_path=$( crossgcc_tarball_release_path "$tarball" "$@" )
+
+ test -f "$tarball_release_path"
+ done
+}
+
+clean() {
+ project_clean "$project" "$@"
+}
diff --git a/projects/crossgcc/crossgcc-helper b/projects/crossgcc/crossgcc-helper
new file mode 100755
index 00000000..b4979f89
--- /dev/null
+++ b/projects/crossgcc/crossgcc-helper
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+crossgcc_tarballs() {
+ local sources_path=$( project_sources_path "$project" "$repository" "$@" )
+ local install_path="$sources_path/util/crossgcc/tarballs/"
+ local tarballs=$( ls "$sources_path/util/crossgcc/sum" | sed "s/.cksum$//" )
+
+ echo "$tarballs"
+}
+
+crossgcc_tarball_sources_path() {
+ local tarball=$1
+
+ local tarball_sources_path="$root/$SOURCES/$tarball"
+
+ echo "$tarball_sources_path"
+}
+
+crossgcc_tarball_install_path() {
+ local tarball=$1
+ shift
+
+ local sources_path=$( project_sources_path "$project" "$repository" "$@" )
+ local install_path="$sources_path/util/crossgcc/tarballs/"
+ local tarball_install_path="$install_path/$tarball"
+
+ echo "$tarball_install_path"
+}
+
+crossgcc_tarball_release_path() {
+ local tarball=$1
+ shift
+
+ local release_path=$( project_release_path "$project" "$SOURCES" "$@" )
+ local tarball_release_path="$release_path/$tarball"
+
+ echo "$tarball_release_path"
+}
diff --git a/projects/crossgcc/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch b/projects/crossgcc/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch
new file mode 120000
index 00000000..627443a5
--- /dev/null
+++ b/projects/crossgcc/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch
@@ -0,0 +1 @@
+../../coreboot/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch \ No newline at end of file
diff --git a/projects/depthcharge/configs/install b/projects/depthcharge/configs/install
new file mode 100644
index 00000000..2ac6126d
--- /dev/null
+++ b/projects/depthcharge/configs/install
@@ -0,0 +1 @@
+depthcharge.elf:depthcharge.elf
diff --git a/projects/depthcharge/configs/nyan/arch b/projects/depthcharge/configs/nyan/arch
new file mode 100644
index 00000000..fb05f39d
--- /dev/null
+++ b/projects/depthcharge/configs/nyan/arch
@@ -0,0 +1 @@
+arm
diff --git a/projects/depthcharge/configs/revision b/projects/depthcharge/configs/revision
new file mode 100644
index 00000000..4b3eeea8
--- /dev/null
+++ b/projects/depthcharge/configs/revision
@@ -0,0 +1 @@
+91fab799a3e9f9da4e7569ca341f819319d091b0
diff --git a/projects/depthcharge/configs/targets b/projects/depthcharge/configs/targets
new file mode 100644
index 00000000..792768c4
--- /dev/null
+++ b/projects/depthcharge/configs/targets
@@ -0,0 +1,2 @@
+nyan
+veyron
diff --git a/projects/depthcharge/configs/veyron/arch b/projects/depthcharge/configs/veyron/arch
new file mode 100644
index 00000000..fb05f39d
--- /dev/null
+++ b/projects/depthcharge/configs/veyron/arch
@@ -0,0 +1 @@
+arm
diff --git a/projects/depthcharge/depthcharge b/projects/depthcharge/depthcharge
new file mode 100755
index 00000000..ad93bdef
--- /dev/null
+++ b/projects/depthcharge/depthcharge
@@ -0,0 +1,108 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+arguments() {
+ project_arguments_targets "$project" "$@"
+}
+
+usage() {
+ project_usage_actions "$project"
+ project_usage_arguments "$project" "$@"
+}
+
+download() {
+ local repository=$project
+
+ project_download_git "$project" "$repository" "https://chromium.googlesource.com/chromiumos/platform/depthcharge https://review.coreboot.org/depthcharge.git https://github.com/coreboot/depthcharge.git" "$@"
+}
+
+download_check() {
+ local repository=$project
+
+ project_download_check_git "$project" "$repository" "$@"
+}
+
+extract() {
+ project_extract "$project" "$@"
+}
+
+extract_check() {
+ project_extract_check "$project" "$@"
+}
+
+update() {
+ local repository=$project
+
+ project_update_git "$project" "$repository" "$@"
+}
+
+update_check() {
+ local repository=$project
+
+ project_update_check_git "$project" "$repository" "$@"
+}
+
+build() {
+ local repository=$project
+
+ project_sources_directory_missing_empty_error "$project" "$repository" "$@"
+
+ if git_project_check $repository
+ then
+ git_project_checkout "$project" "$repository" "$@"
+ fi
+
+ local sources_path=$( project_sources_path "$project" "$repository" "$@" )
+ local build_path=$( project_build_path "$project" "$@" )
+
+ local libpayload_build_path=$( project_build_path "libpayload" "$project" "$@" )
+ local libpayload_build_install_path="$libpayload_build_path/install"
+ local vboot_sources_path=$( project_sources_path "vboot" "vboot" "devices" )
+
+ local arch=$( depthcharge_arch "$@" )
+ local device=$( depthcharge_device "$@" )
+
+ project_action "build" "crossgcc" "$arch"
+ project_action "build" "libpayload" "$project" "$@"
+
+ project_action "checkout" "vboot" "devices"
+
+ mkdir -p "$build_path"
+
+ make -C "$sources_path" obj="$build_path" DOTCONFIG="$build_path/.config" BOARD="$device" "defconfig"
+ make -C "$sources_path" obj="$build_path" DOTCONFIG="$build_path/.config" LIBPAYLOAD_DIR="$libpayload_build_install_path/libpayload" VB_SOURCE="$vboot_sources_path" -j$TASKS "depthcharge"
+}
+
+build_check() {
+ project_build_check "$project" "$@"
+}
+
+release() {
+ local repository=$project
+
+ project_release_sources_git "$project" "$repository" "$@"
+}
+
+release_check() {
+ local repository=$project
+
+ project_release_check_sources_git "$project" "$repository" "$@"
+}
+
+clean() {
+ project_clean "$project" "$@"
+}
diff --git a/projects/depthcharge/depthcharge-helper b/projects/depthcharge/depthcharge-helper
new file mode 100755
index 00000000..b7e896b3
--- /dev/null
+++ b/projects/depthcharge/depthcharge-helper
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ARCH="arch"
+
+depthcharge_arch() {
+ project_file_contents "$project" "$CONFIGS" "$ARCH" "$@"
+}
+
+depthcharge_device() {
+ arguments_concat "_" "$@"
+}
diff --git a/projects/depthcharge/patches/0001-fdt-nonvolatile-context-storage-report-to-mkbp-for-E.patch b/projects/depthcharge/patches/0001-fdt-nonvolatile-context-storage-report-to-mkbp-for-E.patch
new file mode 100644
index 00000000..e2866f5a
--- /dev/null
+++ b/projects/depthcharge/patches/0001-fdt-nonvolatile-context-storage-report-to-mkbp-for-E.patch
@@ -0,0 +1,31 @@
+From 3003a569ad63a35922984a8c7d1f079cc5cbd960 Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Mon, 10 Aug 2015 20:30:14 +0200
+Subject: [PATCH 1/4] fdt: nonvolatile-context-storage report to mkbp for EC NV
+ storage
+
+This allows old versions of crossystem to detect that it should use mosys to
+access NV storage in case it is stored on the EC.
+
+Change-Id: I78ed64c2002727432def0e132f572a1c5173fa5e
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ src/vboot/crossystem/fdt.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/vboot/crossystem/fdt.c b/src/vboot/crossystem/fdt.c
+index c0b10c0..5cba178 100644
+--- a/src/vboot/crossystem/fdt.c
++++ b/src/vboot/crossystem/fdt.c
+@@ -51,7 +51,7 @@ static int install_crossystem_data(DeviceTreeFixup *fixup, DeviceTree *tree)
+ dt_add_string_prop(node, "nonvolatile-context-storage","nvram");
+ } else if (CONFIG_NV_STORAGE_CROS_EC) {
+ dt_add_string_prop(node,
+- "nonvolatile-context-storage", "cros-ec");
++ "nonvolatile-context-storage", "mkbp");
+ } else if (CONFIG_NV_STORAGE_DISK) {
+ dt_add_string_prop(node, "nonvolatile-context-storage", "disk");
+ dt_add_u32_prop(node, "nonvolatile-context-lba",
+--
+2.10.2
+
diff --git a/projects/depthcharge/patches/0002-Proper-firmware-index-report-for-read-only-boot-path.patch b/projects/depthcharge/patches/0002-Proper-firmware-index-report-for-read-only-boot-path.patch
new file mode 100644
index 00000000..f1435255
--- /dev/null
+++ b/projects/depthcharge/patches/0002-Proper-firmware-index-report-for-read-only-boot-path.patch
@@ -0,0 +1,71 @@
+From fc2f65e964fb9636db35749579c47dde15599f57 Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Mon, 10 Aug 2015 20:24:50 +0200
+Subject: [PATCH 2/4] Proper firmware index report for read-only boot path
+
+When booting from a read-only boot path, the active firmware to report is RO.
+This is detected with the lack of a vboot handoff pointer.
+
+Change-Id: I3b1b5823b4dde7bc4185abe2e29f5d056ef9f09c
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ src/vboot/crossystem/fdt.c | 2 +-
+ src/vboot/firmware_id.c | 6 +++++-
+ src/vboot/firmware_id.h | 1 +
+ 3 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/vboot/crossystem/fdt.c b/src/vboot/crossystem/fdt.c
+index 5cba178..45cad88 100644
+--- a/src/vboot/crossystem/fdt.c
++++ b/src/vboot/crossystem/fdt.c
+@@ -68,7 +68,7 @@ static int install_crossystem_data(DeviceTreeFixup *fixup, DeviceTree *tree)
+ nvstorage_flash_get_blob_size());
+ }
+
+- int fw_index = vdat->firmware_index;
++ int fw_index = get_active_fw_index(vdat);
+ const char *fwid;
+ int fwid_size;
+
+diff --git a/src/vboot/firmware_id.c b/src/vboot/firmware_id.c
+index 82acf91..d625251 100644
+--- a/src/vboot/firmware_id.c
++++ b/src/vboot/firmware_id.c
+@@ -31,6 +31,7 @@ static struct fwid {
+ } fw_fmap_ops[] = {
+ {VDAT_RW_A, "RW_FWID_A", NULL, 0, "RW A: ID NOT FOUND"},
+ {VDAT_RW_B, "RW_FWID_B", NULL, 0, "RW B: ID NOT FOUND"},
++ {VDAT_RO, "RO_FRID", NULL, 0, "RO: ID NOT FOUND"},
+ {VDAT_RECOVERY, "RO_FRID", NULL, 0, "RO: ID NOT FOUND"},
+ };
+
+@@ -125,10 +126,13 @@ static VbSharedDataHeader *get_vdat(void)
+ return NULL;
+ }
+
+-static inline int get_active_fw_index(VbSharedDataHeader *vdat)
++int get_active_fw_index(VbSharedDataHeader *vdat)
+ {
+ int fw_index = VDAT_UNKNOWN;
+
++ if (lib_sysinfo.vboot_handoff == NULL)
++ return VDAT_RO;
++
+ if (vdat)
+ fw_index = vdat->firmware_index;
+
+diff --git a/src/vboot/firmware_id.h b/src/vboot/firmware_id.h
+index 181b2a1..71be302 100644
+--- a/src/vboot/firmware_id.h
++++ b/src/vboot/firmware_id.h
+@@ -44,6 +44,7 @@ int get_rwb_fw_size(void);
+ * Get firmware details for currently active fw type. It looks up vdat,
+ * identifies fw_index and returns appropriate id and size for that index.
+ */
++int get_active_fw_index(VbSharedDataHeader *vdat);
+ const char *get_active_fw_id(void);
+ int get_active_fw_size(void);
+
+--
+2.10.2
+
diff --git a/projects/depthcharge/patches/0003-vboot-Display-callbacks-for-all-screens.patch b/projects/depthcharge/patches/0003-vboot-Display-callbacks-for-all-screens.patch
new file mode 100644
index 00000000..51594b34
--- /dev/null
+++ b/projects/depthcharge/patches/0003-vboot-Display-callbacks-for-all-screens.patch
@@ -0,0 +1,240 @@
+From 1e634ac65fbdd43f35046e08b302d162e5d964d4 Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Tue, 11 Aug 2015 11:22:54 +0200
+Subject: [PATCH 3/4] vboot: Display callbacks for all screens
+
+We don't want to use bitmaps stored in GBB since they recommend the use of non-
+free software (Chrome OS), so this implements a text-based interface instead.
+
+Change-Id: I4927846b385b9fdbb8d90b8dc1cd159472363baa
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ src/vboot/callbacks/display.c | 182 ++++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 166 insertions(+), 16 deletions(-)
+
+diff --git a/src/vboot/callbacks/display.c b/src/vboot/callbacks/display.c
+index bae8043..b4e9958 100644
+--- a/src/vboot/callbacks/display.c
++++ b/src/vboot/callbacks/display.c
+@@ -20,6 +20,7 @@
+ #include <sysinfo.h>
+ #include <vboot_api.h>
+ #include <vboot_struct.h>
++#include <vboot_nvstorage.h>
+
+ #include "base/cleanup_funcs.h"
+ #include "drivers/video/coreboot_fb.h"
+@@ -81,13 +82,15 @@ void print_on_center(const char *msg)
+ print_string(msg);
+ }
+
+-VbError_t VbExDisplayScreen(uint32_t screen_type, uint32_t locale)
++VbError_t VbExDisplayScreen(uint32_t screen_type, uint32_t locale,
++ VbDisplayInfo *info)
+ {
+- const char *msg = NULL;
+-
+- if (vboot_draw_screen(screen_type, locale) == CBGFX_SUCCESS)
+- return VBERROR_SUCCESS;
+-
++ unsigned int rows, cols;
++ const char *fw_id;
++ int fw_index;
++ void *blob = NULL;
++ int size = 0;
++ char *msg;
+ /*
+ * Show the debug messages for development. It is a backup method
+ * when GBB does not contain a full set of bitmaps.
+@@ -98,31 +101,178 @@ VbError_t VbExDisplayScreen(uint32_t screen_type, uint32_t locale)
+ video_console_clear();
+ break;
+ case VB_SCREEN_DEVELOPER_WARNING:
+- msg = "developer mode warning";
++ video_console_clear();
++ video_console_set_cursor(0, 0);
++
++ if (info == NULL)
++ return VBERROR_SUCCESS;
++
++ print_string(
++ "Welcome to developer mode!\n\n"
++ "Useful key combinations:\n"
++ "- Ctrl + H: Hold developer mode\n"
++ "- Ctrl + D: Boot from default medium\n");
++
++ if (info->allow_usb)
++ print_string("- Ctrl + U: Boot from external medium\n");
++
++ if (info->allow_legacy)
++ print_string("- Ctrl + L: Boot from legacy payload\n");
++
++ print_string(
++ "- Ctrl + I: Show device information\n"
++ "- Space: Disable developer mode\n\n"
++ "This screen is shown for 3 seconds (if not held)."
++ "\n\n");
++
++ if (!info->signed_only)
++ print_string(
++ "Warning: this device will boot kernels"
++ " without verifying their signature!"
++ "\n");
++
++ if (info->allow_usb)
++ print_string(
++ "Warning: this device will boot from "
++ "external media!\n");
++
++ if (info->allow_legacy)
++ print_string(
++ "Warning: this device will boot legacy "
++ "payloads!\n");
++
++ if (!info->signed_only || info->allow_usb ||
++ info->allow_legacy)
++ print_string("\n");
++
++ print_string("Default boot medium: ");
++
++ if (info->use_legacy)
++ print_string("legacy payload");
++ else if (info->use_usb)
++ print_string("external");
++ else
++ print_string("internal");
++
++ print_string("\n");
++
++ find_common_params(&blob, &size);
++
++ if (blob != NULL) {
++ VbSharedDataHeader *vdat = (VbSharedDataHeader *) blob;
++ fw_index = get_active_fw_index(vdat);
++ fw_id = get_fw_id(fw_index);
++
++ if (fw_id == NULL)
++ fw_id = "NOT FOUND";
++
++ print_string("Active firmware id: ");
++ print_string(fw_id);
++
++ switch (fw_index) {
++ case VDAT_RW_A:
++ print_string(" (RW A)\n");
++ break;
++ case VDAT_RW_B:
++ print_string(" (RW A)\n");
++ break;
++ case VDAT_RO:
++ print_string(" (RO)\n");
++ break;
++ default:
++ print_string(" (UNKNOWN)\n");
++ break;
++ }
++ }
+ break;
+ case VB_SCREEN_DEVELOPER_EGG:
+- msg = "easter egg";
++ video_console_clear();
++ print_on_center("Free as in Freedom!");
+ break;
+ case VB_SCREEN_RECOVERY_REMOVE:
+- msg = "remove inserted devices";
++ video_console_clear();
++ print_on_center(
++ "Please remove any external media before accessing "
++ "recovery screen.");
+ break;
+ case VB_SCREEN_RECOVERY_INSERT:
+- msg = "insert recovery image";
+- break;
+ case VB_SCREEN_RECOVERY_NO_GOOD:
+- msg = "insert image invalid";
++ video_console_clear();
++ print_string(
++ "Welcome to recovery mode!\n\n"
++ "Useful key combinations:\n"
++ "- Ctrl + D: Enable developer mode (if possible)\n\n");
++
++ if (screen_type == VB_SCREEN_RECOVERY_NO_GOOD)
++ print_on_center(
++ "Invalid recovery media, please instert a "
++ "valid one.");
++ else
++ print_on_center(
++ "Please insert an external recovery media.");
++ break;
++ case VB_SCREEN_RECOVERY_TO_DEV:
++ video_console_clear();
++ video_get_rows_cols(&rows, &cols);
++
++ video_console_set_cursor(0, 0);
++
++ print_string(
++ "Enabling developer mode will allow booting unsigned "
++ "kernels and booting from external media (when enabled "
++ "with crossystem).\n\n"
++ "Developer mode can be disabled via the developer mode "
++ "screen.");
++
++ msg = "Developer mode will be enabled.";
++ video_console_set_cursor((cols - strlen(msg)) / 2, rows / 2);
++ print_string(msg);
++
++ msg = "Press enter to confirm or escape to go back.";
++ video_console_set_cursor((cols - strlen(msg)) / 2,
++ rows / 2 + 2);
++ print_string(msg);
++ break;
++ case VB_SCREEN_DEVELOPER_TO_NORM:
++ video_console_clear();
++ video_get_rows_cols(&rows, &cols);
++
++ video_console_set_cursor(0, 0);
++
++ print_string(
++ "Disabling developer mode will restrict boot to signed "
++ "kernels stored on internal memory only.\n\n"
++ "Developer mode can be enabled again via the recovery "
++ "mode screen.");
++
++ msg = "Developer mode will be disabled.";
++ video_console_set_cursor((cols - strlen(msg)) / 2, rows / 2);
++ print_string(msg);
++
++ msg = "Press enter to confirm or escape to go back.";
++ video_console_set_cursor((cols - strlen(msg)) / 2,
++ rows / 2 + 2);
++ print_string(msg);
+ break;
+ case VB_SCREEN_WAIT:
+- msg = "wait for ec update";
++ video_console_clear();
++ print_on_center("Waiting for EC update...");
++ break;
++ case VB_SCREEN_TO_NORM_CONFIRMED:
++ video_console_clear();
++ print_on_center("Disabling developer mode.");
++ break;
++ case VB_SCREEN_OS_BROKEN:
++ video_console_clear();
++ print_on_center(
++ "Something went wrong and the device cannot boot.\n"
++ "Press Escape + Refresh + Power to access recovery.");
+ break;
+ default:
+ printf("Not a valid screen type: %d.\n", screen_type);
+ return VBERROR_INVALID_SCREEN_INDEX;
+ }
+
+- if (msg)
+- print_on_center(msg);
+-
+ return VBERROR_SUCCESS;
+ }
+
+--
+2.10.2
+
diff --git a/projects/depthcharge/patches/0004-mmc-Initialize-clock-variable-in-mmc_recalculate_clo.patch b/projects/depthcharge/patches/0004-mmc-Initialize-clock-variable-in-mmc_recalculate_clo.patch
new file mode 100644
index 00000000..3b4c5411
--- /dev/null
+++ b/projects/depthcharge/patches/0004-mmc-Initialize-clock-variable-in-mmc_recalculate_clo.patch
@@ -0,0 +1,30 @@
+From 925042a09afb9529b112eff2e4d56bf979ff32ec Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Mon, 19 Dec 2016 14:54:40 +0100
+Subject: [PATCH 4/4] mmc: Initialize clock variable in mmc_recalculate_clock
+
+Initializing the variable before it is used (and set to a proper value)
+avoids triggering a maybe uninitialized compiler warning.
+
+Change-Id: I0f78e534919e892e23fbe6d38bba6e68c408b0c4
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ src/drivers/storage/mmc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/drivers/storage/mmc.c b/src/drivers/storage/mmc.c
+index b877548..54306a1 100644
+--- a/src/drivers/storage/mmc.c
++++ b/src/drivers/storage/mmc.c
+@@ -509,7 +509,7 @@ static void mmc_set_clock(MmcCtrlr *ctrlr, uint32_t clock)
+
+ static void mmc_recalculate_clock(MmcMedia *media)
+ {
+- uint32_t clock;
++ uint32_t clock = 0;
+
+ if (IS_SD(media)) {
+ if (media->caps & MMC_MODE_HS)
+--
+2.10.2
+
diff --git a/projects/flashmap/configs/install b/projects/flashmap/configs/install
new file mode 100644
index 00000000..52f8f9f1
--- /dev/null
+++ b/projects/flashmap/configs/install
@@ -0,0 +1 @@
+lib/libfmap.a:libfmap.a
diff --git a/projects/flashmap/configs/revision b/projects/flashmap/configs/revision
new file mode 100644
index 00000000..79d3a325
--- /dev/null
+++ b/projects/flashmap/configs/revision
@@ -0,0 +1 @@
+origin/release-R56-9000.B
diff --git a/projects/flashmap/flashmap b/projects/flashmap/flashmap
new file mode 100755
index 00000000..0e038ffd
--- /dev/null
+++ b/projects/flashmap/flashmap
@@ -0,0 +1,94 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+download() {
+ local repository=$project
+
+ project_download_git "$project" "$repository" "https://chromium.googlesource.com/chromiumos/third_party/flashmap" "$@"
+}
+
+download_check() {
+ local repository=$project
+
+ project_download_check_git "$project" "$repository" "$@"
+}
+
+extract() {
+ local repository=$project
+
+ project_extract "$project" "$@"
+}
+
+extract_check() {
+ local repository=$project
+
+ project_extract_check "$project" "$@"
+}
+
+update() {
+ local repository=$project
+
+ project_update_git "$project" "$repository" "$@"
+}
+
+update_check() {
+ local repository=$project
+
+ project_update_check_git "$project" "$repository" "$@"
+}
+
+build() {
+ local repository=$project
+
+ project_sources_directory_missing_empty_error "$project" "$repository" "$@"
+
+ local sources_path=$( project_sources_path "$project" "$repository" "$@" )
+ local build_path=$( project_build_path "$project" "$@" )
+
+ if git_project_check "$repository"
+ then
+ git_project_checkout "$project" "$repository" "$@"
+ fi
+
+ mkdir -p "$build_path"
+
+ make -C "$sources_path" -j$TASKS
+
+ cp -r "$sources_path/lib" "$build_path"
+
+ make -C "$sources_path" "clean"
+}
+
+build_check() {
+ project_build_check "$project" "$@"
+}
+
+release() {
+ local repository=$project
+
+ project_release_sources_git "$project" "$repository" "$@"
+}
+
+release_check() {
+ local repository=$project
+
+ project_release_check_sources_git "$project" "$repository" "$@"
+}
+
+clean() {
+ project_clean "$project" "$@"
+}
diff --git a/projects/flashrom-cros/configs/install b/projects/flashrom-cros/configs/install
new file mode 100644
index 00000000..0a129b8a
--- /dev/null
+++ b/projects/flashrom-cros/configs/install
@@ -0,0 +1 @@
+flashrom:flashrom
diff --git a/projects/flashrom-cros/configs/revision b/projects/flashrom-cros/configs/revision
new file mode 100644
index 00000000..79d3a325
--- /dev/null
+++ b/projects/flashrom-cros/configs/revision
@@ -0,0 +1 @@
+origin/release-R56-9000.B
diff --git a/projects/flashrom-cros/flashrom-cros b/projects/flashrom-cros/flashrom-cros
new file mode 100755
index 00000000..7cb14cdf
--- /dev/null
+++ b/projects/flashrom-cros/flashrom-cros
@@ -0,0 +1,106 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+download() {
+ local repository=$project
+
+ project_download_git "$project" "$repository" "https://chromium.googlesource.com/chromiumos/third_party/flashrom" "$@"
+}
+
+download_check() {
+ local repository=$project
+
+ project_download_check_git "$project" "$repository" "$@"
+}
+
+extract() {
+ local repository=$project
+
+ project_extract "$project" "$@"
+}
+
+extract_check() {
+ local repository=$project
+
+ project_extract_check "$project" "$@"
+}
+
+update() {
+ local repository=$project
+
+ project_update_git "$project" "$repository" "$@"
+}
+
+update_check() {
+ local repository=$project
+
+ project_update_check_git "$project" "$repository" "$@"
+}
+
+build() {
+ local repository=$project
+
+ project_sources_directory_missing_empty_error "$project" "$repository" "$@"
+
+ if git_project_check "$repository"
+ then
+ git_project_checkout "$project" "$repository" "$@"
+ fi
+
+ local sources_path=$( project_sources_path "$project" "$repository" "$@" )
+ local build_path=$( project_build_path "$project" "$@" )
+
+ mkdir -p "$build_path"
+
+ make -C "$sources_path" CONFIG_SATAMV="no" NOWARNERROR="yes" NEED_PCI="yes" CONFIG_LINUX_SPI="yes" CONFIG_LINUX_I2C="yes" -j$TASKS
+
+ cp "$sources_path/flashrom" "$build_path"
+
+ make -C "$sources_path" CONFIG_SATAMV="no" NOWARNERROR="yes" NEED_PCI="yes" CONFIG_LINUX_SPI="yes" CONFIG_LINUX_I2C="yes" "clean"
+}
+
+build_check() {
+ project_build_check "$project" "$@"
+}
+
+install() {
+ project_install "$project" "$@"
+}
+
+install_check() {
+ project_install_check "$project" "$@"
+}
+
+release() {
+ local repository=$project
+
+ project_release_install_archive "$project" "$TOOLS" "$@"
+
+ project_release_sources_git "$project" "$repository" "$@"
+}
+
+release_check() {
+ local repository=$project
+
+ project_release_install_archive_check "$project" "$TOOLS" "$@"
+
+ project_release_check_sources_git "$project" "$repository" "$@"
+}
+
+clean() {
+ project_clean "$project" "$@"
+}
diff --git a/projects/flashrom-cros/patches/0001-programmer.h-Define-ich_generation-after-enum-declar.patch b/projects/flashrom-cros/patches/0001-programmer.h-Define-ich_generation-after-enum-declar.patch
new file mode 100644
index 00000000..8b35e9e3
--- /dev/null
+++ b/projects/flashrom-cros/patches/0001-programmer.h-Define-ich_generation-after-enum-declar.patch
@@ -0,0 +1,37 @@
+From f721cdd46196a99dbcc41f0f7ecaf2ee17a147fe Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Wed, 2 Nov 2016 19:16:50 +0100
+Subject: [PATCH] programmer.h: Define ich_generation after enum declaration
+
+This moves the ich_generation definition after the declaration of its
+associated enum.
+
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ programmer.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/programmer.h b/programmer.h
+index 191fb1e..86a695a 100644
+--- a/programmer.h
++++ b/programmer.h
+@@ -275,7 +275,6 @@ int board_flash_enable(const char *vendor, const char *part);
+ /* chipset_enable.c */
+ int chipset_flash_enable(void);
+ int get_target_bus_from_chipset(enum chipbustype *target_bus);
+-enum ich_chipset ich_generation;
+
+ /* processor_enable.c */
+ int processor_flash_enable(void);
+@@ -603,6 +602,8 @@ enum ich_chipset {
+ };
+
+ #if CONFIG_INTERNAL == 1
++enum ich_chipset ich_generation;
++
+ extern uint32_t ichspi_bbar;
+ int ich_init_spi(struct pci_dev *dev, uint32_t base, void *rcrb,
+ enum ich_chipset ich_generation);
+--
+2.10.2
+
diff --git a/projects/flashrom/configs/install b/projects/flashrom/configs/install
new file mode 100644
index 00000000..0a129b8a
--- /dev/null
+++ b/projects/flashrom/configs/install
@@ -0,0 +1 @@
+flashrom:flashrom
diff --git a/projects/flashrom/configs/lenovobios/revision b/projects/flashrom/configs/lenovobios/revision
new file mode 120000
index 00000000..baaf3167
--- /dev/null
+++ b/projects/flashrom/configs/lenovobios/revision
@@ -0,0 +1 @@
+../revision \ No newline at end of file
diff --git a/projects/flashrom/configs/revision b/projects/flashrom/configs/revision
new file mode 100644
index 00000000..7e310bae
--- /dev/null
+++ b/projects/flashrom/configs/revision
@@ -0,0 +1 @@
+0.9.9
diff --git a/projects/flashrom/configs/targets b/projects/flashrom/configs/targets
new file mode 100644
index 00000000..915652d5
--- /dev/null
+++ b/projects/flashrom/configs/targets
@@ -0,0 +1,2 @@
+generic
+lenovobios
diff --git a/projects/flashrom/flashrom b/projects/flashrom/flashrom
new file mode 100755
index 00000000..45f0ffc4
--- /dev/null
+++ b/projects/flashrom/flashrom
@@ -0,0 +1,115 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+arguments() {
+ project_arguments_targets "$project" "$@"
+}
+
+usage() {
+ project_usage_actions "$project"
+ project_usage_arguments "$project" "$@"
+}
+
+download() {
+ local repository=$project
+
+ project_download_git "$project" "$repository" "https://github.com/stefanct/flashrom.git" "$@"
+}
+
+download_check() {
+ local repository=$project
+
+ project_download_check_git "$project" "$repository" "$@"
+}
+
+extract() {
+ local repository=$project
+
+ project_extract "$project" "$@"
+}
+
+extract_check() {
+ local repository=$project
+
+ project_extract_check "$project" "$@"
+}
+
+update() {
+ local repository=$project
+
+ project_update_git "$project" "$repository" "$@"
+}
+
+update_check() {
+ local repository=$project
+
+ project_update_check_git "$project" "$repository" "$@"
+}
+
+build() {
+ local repository=$project
+
+ project_sources_directory_missing_empty_error "$project" "$repository" "$@"
+
+ if git_project_check "$repository"
+ then
+ git_project_checkout "$project" "$repository" "$@"
+ fi
+
+ local sources_path=$( project_sources_path "$project" "$repository" "$@" )
+ local build_path=$( project_build_path "$project" "$@" )
+
+ mkdir -p "$build_path"
+
+ make -C "$sources_path" -j$TASKS
+
+ cp "$sources_path/flashrom" "$build_path"
+
+ make -C "$sources_path" "clean"
+}
+
+build_check() {
+ project_build_check "$project" "$@"
+}
+
+install() {
+ project_install "$project" "$@"
+}
+
+install_check() {
+ project_install_check "$project" "$@"
+}
+
+release() {
+ local repository=$project
+
+ project_release_install_archive "$project" "$TOOLS" "$@"
+
+ project_release_sources_git "$project" "$repository" "$@"
+}
+
+release_check() {
+ local repository=$project
+
+ project_release_install_archive_check "$project" "$TOOLS" "$@"
+
+ project_release_check_sources_git "$project" "$repository" "$@"
+}
+
+clean() {
+ project_clean "$project" "$@"
+}
diff --git a/projects/flashrom/patches/0001-New-laptops-whitelisted-ThinkPad-R400-and-ThinkPad-T.patch b/projects/flashrom/patches/0001-New-laptops-whitelisted-ThinkPad-R400-and-ThinkPad-T.patch
new file mode 100644
index 00000000..f9d51806
--- /dev/null
+++ b/projects/flashrom/patches/0001-New-laptops-whitelisted-ThinkPad-R400-and-ThinkPad-T.patch
@@ -0,0 +1,28 @@
+From 52a0b55c77635dc026793e66d516e3aed335706a Mon Sep 17 00:00:00 2001
+From: Leah Rowe <info@minifree.org>
+Date: Fri, 11 Mar 2016 06:35:03 +0000
+Subject: [PATCH 1/1] New laptops whitelisted: ThinkPad R400 and ThinkPad T500
+
+Support for these laptops was merged in coreboot a while ago, so it makes sense
+for flashrom to whitelist them.
+---
+ board_enable.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/board_enable.c b/board_enable.c
+index 7b152d1..1d56203 100644
+--- a/board_enable.c
++++ b/board_enable.c
+@@ -2427,7 +2427,9 @@ const struct board_match board_matches[] = {
+ {0x8086, 0x7190, 0, 0, 0x8086, 0x7110, 0, 0, "^SE440BX-2$", NULL, NULL, P3, "Intel", "SE440BX-2", 0, NT, intel_piix4_gpo27_lower},
+ {0x1022, 0x7468, 0, 0, 0x1022, 0x7460, 0, 0, NULL, "iwill", "dk8_htx", P3, "IWILL", "DK8-HTX", 0, OK, w83627hf_gpio24_raise_2e},
+ {0x8086, 0x27A0, 0x8086, 0x27a0, 0x8086, 0x27b8, 0x8086, 0x27b8, NULL, "kontron", "986lcd-m", P3, "Kontron", "986LCD-M", 0, OK, board_kontron_986lcd_m},
++ {0x8086, 0x2917, 0x17AA, 0x20F5, 0x8086, 0x2930, 0x17AA, 0x20F9, "^ThinkPad R400", NULL, NULL, P2, "IBM/Lenovo", "ThinkPad R400", 0, OK, p2_whitelist_laptop},
+ {0x8086, 0x2917, 0x17AA, 0x20F5, 0x8086, 0x2930, 0x17AA, 0x20F9, "^ThinkPad T400", NULL, NULL, P2, "IBM/Lenovo", "ThinkPad T400", 0, OK, p2_whitelist_laptop},
++ {0x8086, 0x2917, 0x17AA, 0x20F5, 0x8086, 0x2930, 0x17AA, 0x20F9, "^ThinkPad T500", NULL, NULL, P2, "IBM/Lenovo", "ThinkPad T500", 0, OK, p2_whitelist_laptop},
+ {0x8086, 0x1E22, 0x17AA, 0x21F6, 0x8086, 0x1E55, 0x17AA, 0x21F6, "^ThinkPad T530", NULL, NULL, P2, "IBM/Lenovo", "ThinkPad T530", 0, OK, p2_whitelist_laptop},
+ {0x8086, 0x27a0, 0x17aa, 0x2015, 0x8086, 0x27b9, 0x17aa, 0x2009, "^ThinkPad T60", NULL, NULL, P2, "IBM/Lenovo", "ThinkPad T60", 0, OK, p2_whitelist_laptop},
+ {0x8086, 0x27a0, 0x17aa, 0x2017, 0x8086, 0x27b9, 0x17aa, 0x2009, "^ThinkPad T60", NULL, NULL, P2, "IBM/Lenovo", "ThinkPad T60(s)", 0, OK, p2_whitelist_laptop},
+--
+1.9.1
+
diff --git a/projects/flashrom/patches/0002-Add-whitelist-for-Taurinus-X200-laptop.patch b/projects/flashrom/patches/0002-Add-whitelist-for-Taurinus-X200-laptop.patch
new file mode 100644
index 00000000..0aa0701b
--- /dev/null
+++ b/projects/flashrom/patches/0002-Add-whitelist-for-Taurinus-X200-laptop.patch
@@ -0,0 +1,24 @@
+From b1828512abf58911cfb829cb6a98d4e8dbefadc2 Mon Sep 17 00:00:00 2001
+From: Leah Rowe <info@minifree.org>
+Date: Fri, 11 Mar 2016 06:38:39 +0000
+Subject: [PATCH 1/1] Add whitelist for Taurinus X200 laptop
+
+---
+ board_enable.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/board_enable.c b/board_enable.c
+index 1d56203..a71061c 100644
+--- a/board_enable.c
++++ b/board_enable.c
+@@ -2437,6 +2437,7 @@ const struct board_match board_matches[] = {
+ {0x8086, 0x3B07, 0x17AA, 0x2166, 0x8086, 0x3B30, 0x17AA, 0x2167, "^Lenovo X201", NULL, NULL, P2, "IBM/Lenovo", "ThinkPad X201", 0, OK, p2_whitelist_laptop},
+ {0x8086, 0x1E22, 0x17AA, 0x21FA, 0x8086, 0x1E55, 0x17AA, 0x21FA, "^ThinkPad X230", NULL, NULL, P2, "IBM/Lenovo", "ThinkPad X230", 0, OK, p2_whitelist_laptop},
+ {0x8086, 0x27A0, 0x17AA, 0x2017, 0x8086, 0x27B9, 0x17AA, 0x2009, "^ThinkPad X60", NULL, NULL, P2, "IBM/Lenovo", "ThinkPad X60(s)", 0, OK, p2_whitelist_laptop},
++ {0x8086, 0x2917, 0x17AA, 0x20F5, 0x8086, 0x2930, 0x17AA, 0x20F9, "^Taurinus X200", "Libiquity", "Taurinus X200", P2, "Libiquity", "ThinkPad X200", 0, OK, p2_whitelist_laptop},
+ {0x8086, 0x2411, 0x8086, 0x2411, 0x8086, 0x7125, 0x0e11, 0xb165, NULL, NULL, NULL, P3, "Mitac", "6513WU", 0, OK, board_mitac_6513wu},
+ {0x8086, 0x8186, 0x8086, 0x8186, 0x8086, 0x8800, 0, 0, "^MSC Vertriebs GmbH$", NULL, NULL, P2, "MSC", "Q7-TCTC", 0, OK, p2_not_a_laptop},
+ {0x8086, 0x7190, 0, 0, 0x8086, 0x7110, 0, 0, "^MS-6163 (i440BX)$", NULL, NULL, P3, "MSI", "MS-6163 (MS-6163 Pro)", 0, OK, intel_piix4_gpo14_raise},
+--
+1.9.1
+
diff --git a/projects/flashrom/patches/0003-purged-chips.patch b/projects/flashrom/patches/0003-purged-chips.patch
new file mode 100644
index 00000000..0dc7e2bc
--- /dev/null
+++ b/projects/flashrom/patches/0003-purged-chips.patch
@@ -0,0 +1,354 @@
+From 260f0e096b385c9f53e9a28e79293131a11122a6 Mon Sep 17 00:00:00 2001
+From: Leah Rowe <info@minifree.org>
+Date: Fri, 11 Mar 2016 06:50:50 +0000
+Subject: [PATCH 1/1] purged chips
+
+---
+ flashchips.c | 303 -----------------------------------------------------------
+ 1 file changed, 303 deletions(-)
+
+diff --git a/flashchips.c b/flashchips.c
+index 0fc1b7a..5c94304 100644
+--- a/flashchips.c
++++ b/flashchips.c
+@@ -7451,80 +7451,6 @@ const struct flashchip flashchips[] = {
+
+ {
+ .vendor = "Macronix",
+- .name = "MX25L1605",
+- .bustype = BUS_SPI,
+- .manufacture_id = MACRONIX_ID,
+- .model_id = MACRONIX_MX25L1605,
+- .total_size = 2048,
+- .page_size = 256,
+- .feature_bits = FEATURE_WRSR_WREN,
+- .tested = TEST_OK_PREW,
+- .probe = probe_spi_rdid,
+- .probe_timing = TIMING_ZERO,
+- .block_erasers =
+- {
+- {
+- .eraseblocks = { {64 * 1024, 32} },
+- .block_erase = spi_block_erase_20,
+- }, {
+- .eraseblocks = { {64 * 1024, 32} },
+- .block_erase = spi_block_erase_d8,
+- }, {
+- .eraseblocks = { {2 * 1024 * 1024, 1} },
+- .block_erase = spi_block_erase_60,
+- }, {
+- .eraseblocks = { {2 * 1024 * 1024, 1} },
+- .block_erase = spi_block_erase_c7,
+- },
+- },
+- .printlock = spi_prettyprint_status_register_bp2_srwd, /* bit6: error flag */
+- .unlock = spi_disable_blockprotect,
+- .write = spi_chip_write_256,
+- .read = spi_chip_read, /* Fast read (0x0B) supported */
+- .voltage = {2700, 3600},
+- },
+-
+- {
+- .vendor = "Macronix",
+- .name = "MX25L1605A/MX25L1606E/MX25L1608E",
+- .bustype = BUS_SPI,
+- .manufacture_id = MACRONIX_ID,
+- .model_id = MACRONIX_MX25L1605,
+- .total_size = 2048,
+- .page_size = 256,
+- /* OTP: 64B total; enter 0xB1, exit 0xC1 (MX25L1606E and MX25L1608E only) */
+- .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP,
+- .tested = TEST_OK_PREW,
+- .probe = probe_spi_rdid,
+- .probe_timing = TIMING_ZERO,
+- .block_erasers =
+- {
+- {
+- .eraseblocks = { {4 * 1024, 512} },
+- .block_erase = spi_block_erase_20,
+- }, {
+- .eraseblocks = { {64 * 1024, 32} },
+- .block_erase = spi_block_erase_52,
+- }, {
+- .eraseblocks = { {64 * 1024, 32} },
+- .block_erase = spi_block_erase_d8,
+- }, {
+- .eraseblocks = { {2 * 1024 * 1024, 1} },
+- .block_erase = spi_block_erase_60,
+- }, {
+- .eraseblocks = { {2 * 1024 * 1024, 1} },
+- .block_erase = spi_block_erase_c7,
+- },
+- },
+- .printlock = spi_prettyprint_status_register_bp3_srwd, /* MX25L1605A bp2 only */
+- .unlock = spi_disable_blockprotect_bp3_srwd,
+- .write = spi_chip_write_256,
+- .read = spi_chip_read, /* Fast read (0x0B) supported (MX25L1608E supports dual-I/O read) */
+- .voltage = {2700, 3600},
+- },
+-
+- {
+- .vendor = "Macronix",
+ .name = "MX25L1605D/MX25L1608D/MX25L1673E",
+ .bustype = BUS_SPI,
+ .manufacture_id = MACRONIX_ID,
+@@ -7632,41 +7558,6 @@ const struct flashchip flashchips[] = {
+
+ {
+ .vendor = "Macronix",
+- .name = "MX25L3205(A)",
+- .bustype = BUS_SPI,
+- .manufacture_id = MACRONIX_ID,
+- .model_id = MACRONIX_MX25L3205,
+- .total_size = 4096,
+- .page_size = 256,
+- .feature_bits = FEATURE_WRSR_WREN,
+- .tested = TEST_OK_PREW,
+- .probe = probe_spi_rdid,
+- .probe_timing = TIMING_ZERO,
+- .block_erasers =
+- {
+- {
+- .eraseblocks = { {64 * 1024, 64} },
+- .block_erase = spi_block_erase_20,
+- }, {
+- .eraseblocks = { {64 * 1024, 64} },
+- .block_erase = spi_block_erase_d8,
+- }, {
+- .eraseblocks = { {4 * 1024 * 1024, 1} },
+- .block_erase = spi_block_erase_60,
+- }, {
+- .eraseblocks = { {4 * 1024 * 1024, 1} },
+- .block_erase = spi_block_erase_c7,
+- },
+- },
+- .printlock = spi_prettyprint_status_register_bp2_srwd, /* bit6: error flag */
+- .unlock = spi_disable_blockprotect,
+- .write = spi_chip_write_256,
+- .read = spi_chip_read, /* Fast read (0x0B) supported */
+- .voltage = {2700, 3600},
+- },
+-
+- {
+- .vendor = "Macronix",
+ .name = "MX25L3205D/MX25L3208D",
+ .bustype = BUS_SPI,
+ .manufacture_id = MACRONIX_ID,
+@@ -7703,84 +7594,6 @@ const struct flashchip flashchips[] = {
+
+ {
+ .vendor = "Macronix",
+- .name = "MX25L3206E/MX25L3208E",
+- .bustype = BUS_SPI,
+- .manufacture_id = MACRONIX_ID,
+- .model_id = MACRONIX_MX25L3205,
+- .total_size = 4096,
+- .page_size = 256,
+- /* OTP: 64B total; enter 0xB1, exit 0xC1 */
+- .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP,
+- .tested = TEST_OK_PREW,
+- .probe = probe_spi_rdid,
+- .probe_timing = TIMING_ZERO,
+- .block_erasers =
+- {
+- {
+- .eraseblocks = { {4 * 1024, 1024} },
+- .block_erase = spi_block_erase_20,
+- }, {
+- .eraseblocks = { {64 * 1024, 64} },
+- .block_erase = spi_block_erase_d8,
+- }, {
+- .eraseblocks = { {64 * 1024, 64} },
+- .block_erase = spi_block_erase_52,
+- }, {
+- .eraseblocks = { {4 * 1024 * 1024, 1} },
+- .block_erase = spi_block_erase_60,
+- }, {
+- .eraseblocks = { {4 * 1024 * 1024, 1} },
+- .block_erase = spi_block_erase_c7,
+- },
+- },
+- .printlock = spi_prettyprint_status_register_bp3_srwd,
+- .unlock = spi_disable_blockprotect_bp3_srwd,
+- .write = spi_chip_write_256,
+- .read = spi_chip_read, /* Fast read (0x0B) and dual I/O supported */
+- .voltage = {2700, 3600},
+- },
+-
+- {
+- .vendor = "Macronix",
+- .name = "MX25L3273E",
+- .bustype = BUS_SPI,
+- .manufacture_id = MACRONIX_ID,
+- .model_id = MACRONIX_MX25L3205,
+- .total_size = 4096,
+- .page_size = 256,
+- /* OTP: 64B total; enter 0xB1, exit 0xC1 */
+- .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP,
+- .tested = TEST_OK_PREW,
+- .probe = probe_spi_rdid,
+- .probe_timing = TIMING_ZERO,
+- .block_erasers =
+- {
+- {
+- .eraseblocks = { {4 * 1024, 1024} },
+- .block_erase = spi_block_erase_20,
+- }, {
+- .eraseblocks = { {32 * 1024, 128} },
+- .block_erase = spi_block_erase_52,
+- }, {
+- .eraseblocks = { {64 * 1024, 64} },
+- .block_erase = spi_block_erase_d8,
+- }, {
+- .eraseblocks = { {4 * 1024 * 1024, 1} },
+- .block_erase = spi_block_erase_60,
+- }, {
+- .eraseblocks = { {4 * 1024 * 1024, 1} },
+- .block_erase = spi_block_erase_c7,
+- },
+- },
+- .printlock = spi_prettyprint_status_register_bp3_srwd,
+- .unlock = spi_disable_blockprotect_bp3_srwd,
+- .write = spi_chip_write_256,
+- .read = spi_chip_read, /* Fast read (0x0B) and dual I/O supported */
+- .voltage = {2700, 3600},
+- },
+-
+- {
+- .vendor = "Macronix",
+ .name = "MX25L3235D",
+ .bustype = BUS_SPI,
+ .manufacture_id = MACRONIX_ID,
+@@ -7817,42 +7630,6 @@ const struct flashchip flashchips[] = {
+
+ {
+ .vendor = "Macronix",
+- .name = "MX25L6405",
+- .bustype = BUS_SPI,
+- .manufacture_id = MACRONIX_ID,
+- .model_id = MACRONIX_MX25L6405,
+- .total_size = 8192,
+- .page_size = 256,
+- /* Has an additional 512B EEPROM sector */
+- .feature_bits = FEATURE_WRSR_WREN,
+- .tested = TEST_OK_PREW,
+- .probe = probe_spi_rdid,
+- .probe_timing = TIMING_ZERO,
+- .block_erasers =
+- {
+- {
+- .eraseblocks = { {64 * 1024, 128} },
+- .block_erase = spi_block_erase_20,
+- }, {
+- .eraseblocks = { {64 * 1024, 128} },
+- .block_erase = spi_block_erase_d8,
+- }, {
+- .eraseblocks = { {8 * 1024 * 1024, 1} },
+- .block_erase = spi_block_erase_60,
+- }, {
+- .eraseblocks = { {8 * 1024 * 1024, 1} },
+- .block_erase = spi_block_erase_c7,
+- }
+- },
+- .printlock = spi_prettyprint_status_register_bp3_srwd, /* bit6: error flag */
+- .unlock = spi_disable_blockprotect_bp3_srwd,
+- .write = spi_chip_write_256,
+- .read = spi_chip_read, /* Fast read (0x0B) supported */
+- .voltage = {2700, 3600},
+- },
+-
+- {
+- .vendor = "Macronix",
+ .name = "MX25L6405D",
+ .bustype = BUS_SPI,
+ .manufacture_id = MACRONIX_ID,
+@@ -7889,86 +7666,6 @@ const struct flashchip flashchips[] = {
+
+ {
+ .vendor = "Macronix",
+- .name = "MX25L6406E/MX25L6408E",
+- .bustype = BUS_SPI,
+- .manufacture_id = MACRONIX_ID,
+- .model_id = MACRONIX_MX25L6405,
+- .total_size = 8192,
+- .page_size = 256,
+- /* MX25L6406E supports SFDP */
+- /* OTP: 06E 64B total; enter 0xB1, exit 0xC1 */
+- .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP,
+- .tested = TEST_OK_PREW,
+- .probe = probe_spi_rdid,
+- .probe_timing = TIMING_ZERO,
+- .block_erasers =
+- {
+- {
+- .eraseblocks = { {4 * 1024, 2048} },
+- .block_erase = spi_block_erase_20,
+- }, {
+- .eraseblocks = { {64 * 1024, 128} },
+- .block_erase = spi_block_erase_52,
+- }, {
+- .eraseblocks = { {64 * 1024, 128} },
+- .block_erase = spi_block_erase_d8,
+- }, {
+- .eraseblocks = { {8 * 1024 * 1024, 1} },
+- .block_erase = spi_block_erase_60,
+- }, {
+- .eraseblocks = { {8 * 1024 * 1024, 1} },
+- .block_erase = spi_block_erase_c7,
+- }
+- },
+- .printlock = spi_prettyprint_status_register_bp3_srwd,
+- .unlock = spi_disable_blockprotect_bp3_srwd,
+- .write = spi_chip_write_256,
+- .read = spi_chip_read, /* Fast read (0x0B), dual I/O read supported */
+- .voltage = {2700, 3600},
+- },
+-
+- {
+- .vendor = "Macronix",
+- .name = "MX25L6436E/MX25L6445E/MX25L6465E/MX25L6473E",
+- .bustype = BUS_SPI,
+- .manufacture_id = MACRONIX_ID,
+- .model_id = MACRONIX_MX25L6405,
+- .total_size = 8192,
+- .page_size = 256,
+- /* supports SFDP */
+- /* OTP: 512B total; enter 0xB1, exit 0xC1 */
+- .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP,
+- .tested = TEST_OK_PREW,
+- .probe = probe_spi_rdid,
+- .probe_timing = TIMING_ZERO,
+- .block_erasers =
+- {
+- {
+- .eraseblocks = { {4 * 1024, 2048} },
+- .block_erase = spi_block_erase_20,
+- }, {
+- .eraseblocks = { {32 * 1024, 256} },
+- .block_erase = spi_block_erase_52,
+- }, {
+- .eraseblocks = { {64 * 1024, 128} },
+- .block_erase = spi_block_erase_d8,
+- }, {
+- .eraseblocks = { {8 * 1024 * 1024, 1} },
+- .block_erase = spi_block_erase_60,
+- }, {
+- .eraseblocks = { {8 * 1024 * 1024, 1} },
+- .block_erase = spi_block_erase_c7,
+- }
+- },
+- .printlock = spi_prettyprint_status_register_bp3_srwd, /* bit6 is quad enable */
+- .unlock = spi_disable_blockprotect_bp3_srwd,
+- .write = spi_chip_write_256,
+- .read = spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
+- .voltage = {2700, 3600},
+- },
+-
+- {
+- .vendor = "Macronix",
+ .name = "MX25L12805D",
+ .bustype = BUS_SPI,
+ .manufacture_id = MACRONIX_ID,
+--
+1.9.1
+
diff --git a/projects/flashrom/patches/lenovobios/0001-Lenovobios-adaptation-for-Macronix-and-SST-chips.patch b/projects/flashrom/patches/lenovobios/0001-Lenovobios-adaptation-for-Macronix-and-SST-chips.patch
new file mode 100644
index 00000000..1cb843c9
--- /dev/null
+++ b/projects/flashrom/patches/lenovobios/0001-Lenovobios-adaptation-for-Macronix-and-SST-chips.patch
@@ -0,0 +1,65 @@
+From aa2dd05f61f6ca91212d7f6d4055486af6e01436 Mon Sep 17 00:00:00 2001
+From: Leah Rowe <info@minifree.org>
+Date: Fri, 5 Aug 2016 22:40:49 +0200
+Subject: [PATCH] Lenovobios adaptation for Macronix and SST chips
+
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ flashchips.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/flashchips.c b/flashchips.c
+index e5ea181..f3a017c 100644
+--- a/flashchips.c
++++ b/flashchips.c
+@@ -7454,12 +7454,12 @@ const struct flashchip flashchips[] = {
+ .name = "MX25L1605D/MX25L1608D/MX25L1673E",
+ .bustype = BUS_SPI,
+ .manufacture_id = MACRONIX_ID,
+- .model_id = MACRONIX_MX25L1605,
++ .model_id = 0x14,
+ .total_size = 2048,
+ .page_size = 256,
+ .feature_bits = FEATURE_WRSR_WREN,
+ .tested = TEST_OK_PREW,
+- .probe = probe_spi_rdid,
++ .probe = probe_spi_res1,
+ .probe_timing = TIMING_ZERO,
+ .block_erasers =
+ {
+@@ -9857,7 +9857,7 @@ const struct flashchip flashchips[] = {
+ },
+ .printlock = spi_prettyprint_status_register_bp2_srwd,
+ .unlock = spi_disable_blockprotect,
+- .write = spi_chip_write_256,
++ .write = spi_chip_write_1,
+ .read = spi_chip_read, /* Fast read (0x0B), dual I/O supported */
+ .voltage = {2700, 3600},
+ },
+@@ -12150,12 +12150,12 @@ const struct flashchip flashchips[] = {
+ .name = "SST25VF016B",
+ .bustype = BUS_SPI,
+ .manufacture_id = SST_ID,
+- .model_id = SST_SST25VF016B,
++ .model_id = 0x41,
+ .total_size = 2048,
+ .page_size = 256,
+ .feature_bits = FEATURE_WRSR_EITHER,
+ .tested = TEST_OK_PREW,
+- .probe = probe_spi_rdid,
++ .probe = probe_spi_res2,
+ .probe_timing = TIMING_ZERO,
+ .block_erasers =
+ {
+@@ -12178,7 +12178,7 @@ const struct flashchip flashchips[] = {
+ },
+ .printlock = spi_prettyprint_status_register_sst25vf016,
+ .unlock = spi_disable_blockprotect,
+- .write = spi_aai_write,
++ .write = spi_chip_write_1,
+ .read = spi_chip_read,
+ .voltage = {2700, 3600},
+ },
+--
+2.9.0
+
diff --git a/projects/hdctools/configs/install b/projects/hdctools/configs/install
new file mode 100644
index 00000000..c6c052af
--- /dev/null
+++ b/projects/hdctools/configs/install
@@ -0,0 +1,6 @@
+lib/libftdigpio.so:libftdigpio.so
+lib/libftdii2c.so:libftdii2c.so
+lib/libftdiuart.so:libftdiuart.so
+servo:servo
+src/toad/toad:toad
+usbkm232:usbkm232
diff --git a/projects/hdctools/configs/revision b/projects/hdctools/configs/revision
new file mode 100644
index 00000000..79d3a325
--- /dev/null
+++ b/projects/hdctools/configs/revision
@@ -0,0 +1 @@
+origin/release-R56-9000.B
diff --git a/projects/hdctools/hdctools b/projects/hdctools/hdctools
new file mode 100755
index 00000000..f48b8a1e
--- /dev/null
+++ b/projects/hdctools/hdctools
@@ -0,0 +1,100 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+download() {
+ local repository=$project
+
+ project_download_git "$project" "$repository" "https://chromium.googlesource.com/chromiumos/third_party/hdctools" "$@"
+}
+
+download_check() {
+ local repository=$project
+
+ project_download_check_git "$project" "$repository" "$@"
+}
+
+extract() {
+ local repository=$project
+
+ project_extract "$project" "$@"
+}
+
+extract_check() {
+ local repository=$project
+
+ project_extract_check "$project" "$@"
+}
+
+update() {
+ local repository=$project
+
+ project_update_git "$project" "$repository" "$@"
+}
+
+update_check() {
+ local repository=$project
+
+ project_update_check_git "$project" "$repository" "$@"
+}
+
+build() {
+ local repository=$project
+
+ requirements "tidy"
+
+ project_sources_directory_missing_empty_error "$project" "$repository" "$@"
+
+ local sources_path=$( project_sources_path "$project" "$repository" "$@" )
+ local build_path=$( project_build_path "$project" "$@" )
+
+ if git_project_check "$repository"
+ then
+ git_project_checkout "$project" "$repository" "$@"
+ fi
+
+ mkdir -p "$build_path"
+
+ make -C "$sources_path" HDCTOOLS_BUILD_DIR="$build_path" -j$TASKS
+}
+
+build_check() {
+ project_build_check "$project" "$@"
+}
+
+install() {
+ project_install "$project" "$@"
+}
+
+install_check() {
+ project_install_check "$project" "$@"
+}
+
+release() {
+ local repository=$project
+
+ project_release_sources_git "$project" "$repository" "$@"
+}
+
+release_check() {
+ local repository=$project
+
+ project_release_check_sources_git "$project" "$repository" "$@"
+}
+
+clean() {
+ project_clean "$project" "$@"
+}
diff --git a/projects/hdctools/patches/0001-Remove-Werror-flag.patch b/projects/hdctools/patches/0001-Remove-Werror-flag.patch
new file mode 100644
index 00000000..7ac29d7a
--- /dev/null
+++ b/projects/hdctools/patches/0001-Remove-Werror-flag.patch
@@ -0,0 +1,25 @@
+From 05fde50f4991623525edb6b15340011af53cd31e Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Sun, 20 Nov 2016 15:08:39 +0100
+Subject: [PATCH] Remove Werror flag
+
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ defs/c-Linux.mk | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/defs/c-Linux.mk b/defs/c-Linux.mk
+index c2c3129..4f1bbee 100644
+--- a/defs/c-Linux.mk
++++ b/defs/c-Linux.mk
+@@ -34,7 +34,6 @@ HOSTOS_CWARN = \
+ -Wdeclaration-after-statement \
+ -Wdisabled-optimization \
+ -Wempty-body \
+- -Werror \
+ -Wextra \
+ -Wfloat-equal \
+ -Wformat \
+--
+2.10.2
+
diff --git a/projects/libpayload/configs/depthcharge/nyan/arch b/projects/libpayload/configs/depthcharge/nyan/arch
new file mode 100644
index 00000000..fb05f39d
--- /dev/null
+++ b/projects/libpayload/configs/depthcharge/nyan/arch
@@ -0,0 +1 @@
+arm
diff --git a/projects/libpayload/configs/depthcharge/nyan/config b/projects/libpayload/configs/depthcharge/nyan/config
new file mode 100644
index 00000000..ddbb4f8d
--- /dev/null
+++ b/projects/libpayload/configs/depthcharge/nyan/config
@@ -0,0 +1 @@
+config.nyan
diff --git a/projects/libpayload/configs/depthcharge/targets b/projects/libpayload/configs/depthcharge/targets
new file mode 100644
index 00000000..792768c4
--- /dev/null
+++ b/projects/libpayload/configs/depthcharge/targets
@@ -0,0 +1,2 @@
+nyan
+veyron
diff --git a/projects/libpayload/configs/depthcharge/veyron/arch b/projects/libpayload/configs/depthcharge/veyron/arch
new file mode 100644
index 00000000..fb05f39d
--- /dev/null
+++ b/projects/libpayload/configs/depthcharge/veyron/arch
@@ -0,0 +1 @@
+arm
diff --git a/projects/libpayload/configs/depthcharge/veyron/config b/projects/libpayload/configs/depthcharge/veyron/config
new file mode 100644
index 00000000..2ddc22fb
--- /dev/null
+++ b/projects/libpayload/configs/depthcharge/veyron/config
@@ -0,0 +1 @@
+config.veyron
diff --git a/projects/libpayload/configs/install b/projects/libpayload/configs/install
new file mode 100644
index 00000000..1a513840
--- /dev/null
+++ b/projects/libpayload/configs/install
@@ -0,0 +1 @@
+install/libpayload/*:.
diff --git a/projects/libpayload/configs/targets b/projects/libpayload/configs/targets
new file mode 100644
index 00000000..d7e90413
--- /dev/null
+++ b/projects/libpayload/configs/targets
@@ -0,0 +1 @@
+depthcharge
diff --git a/projects/libpayload/libpayload b/projects/libpayload/libpayload
new file mode 100755
index 00000000..60cc43c9
--- /dev/null
+++ b/projects/libpayload/libpayload
@@ -0,0 +1,69 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+arguments() {
+ project_arguments_targets "$project" "$@"
+}
+
+usage() {
+ project_usage_actions "$project"
+ project_usage_arguments "$project" "$@"
+}
+
+build() {
+ local repository="coreboot"
+
+ project_sources_directory_missing_empty_error "$project" "$repository" "$@"
+
+ if git_project_check $repository
+ then
+ git_project_checkout "$repository" "$repository" "$@"
+ fi
+
+ local coreboot_sources_path=$( project_sources_path "$repository" "$repository" "$@" )
+ local sources_path="$coreboot_sources_path/payloads/libpayload/"
+ local build_path=$( project_build_path "$project" "$@" )
+ local build_install_path="$build_path/install"
+
+ local config=$( libpayload_config "$@" )
+ local config_path="configs/$config"
+
+ local arch=$( libpayload_arch "$@" )
+
+ local crossgcc_build_path=$( project_build_path "crossgcc" "$arch" )
+ local crossgcc_bin_path="$crossgcc_build_path/bin/"
+
+ project_action "build" "crossgcc" "$arch"
+
+ rm -f "$sources_path/.xcompile"
+
+ mkdir -p "$build_path"
+
+ make -C "$sources_path" obj="$build_path" DOTCONFIG="$build_path/.config" XGCCPATH="$crossgcc_bin_path" KBUILD_DEFCONFIG="$config_path" "defconfig"
+ make -C "$sources_path" obj="$build_path" DOTCONFIG="$build_path/.config" XGCCPATH="$crossgcc_bin_path" -j$TASKS
+ make -C "$sources_path" obj="$build_path" DOTCONFIG="$build_path/.config" XGCCPATH="$crossgcc_bin_path" DESTDIR="$build_install_path" "install"
+
+ rm -f "$sources_path/.xcompile"
+}
+
+build_check() {
+ project_build_check "$project" "$@"
+}
+
+clean() {
+ project_clean "$project" "$@"
+}
diff --git a/projects/libpayload/libpayload-helper b/projects/libpayload/libpayload-helper
new file mode 100755
index 00000000..05970932
--- /dev/null
+++ b/projects/libpayload/libpayload-helper
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+CONFIG="config"
+ARCH="arch"
+
+libpayload_arch() {
+ project_file_contents "$project" "$CONFIGS" "$ARCH" "$@"
+}
+
+libpayload_config() {
+ project_file_contents "$project" "$CONFIGS" "$CONFIG" "$@"
+}
diff --git a/projects/libreboot-all/configs/projects b/projects/libreboot-all/configs/projects
new file mode 100644
index 00000000..566e92c1
--- /dev/null
+++ b/projects/libreboot-all/configs/projects
@@ -0,0 +1,5 @@
+libreboot-tools
+libreboot-images
+libreboot-sources
+libreboot-release
+libreboot-bootstrap
diff --git a/projects/libreboot-all/libreboot-all b/projects/libreboot-all/libreboot-all
new file mode 100755
index 00000000..3f0b0e83
--- /dev/null
+++ b/projects/libreboot-all/libreboot-all
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+download() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+extract() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+update() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+build() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+install() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+release() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+clean() {
+ project_action_projects "$action" "$project" "$@"
+}
diff --git a/projects/libreboot-bootstrap/install/install b/projects/libreboot-bootstrap/install/install
new file mode 100644
index 00000000..1992866b
--- /dev/null
+++ b/projects/libreboot-bootstrap/install/install
@@ -0,0 +1 @@
+libreboot-bootstrap:libreboot-bootstrap
diff --git a/projects/libreboot-bootstrap/install/libreboot-bootstrap b/projects/libreboot-bootstrap/install/libreboot-bootstrap
new file mode 100755
index 00000000..422fcd27
--- /dev/null
+++ b/projects/libreboot-bootstrap/install/libreboot-bootstrap
@@ -0,0 +1,182 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+BUILD_SYSTEM="libreboot"
+
+SOURCES="sources"
+
+TAR_XZ="tar.xz"
+SHA256SUM="sha256sum"
+ASC="asc"
+
+usage() {
+ printf "$executable [sources path] (extract path)\n" >&2
+
+ printf "\n When no extract path is provided, sources are extracted in the current\n"
+ printf " directory.\n"
+}
+
+verify_sources() {
+ local sources_path=$1
+
+ local checksum_path
+ local signature_path
+ local archive
+
+ if [ -z "$extract_path" ]
+ then
+ extract_path=$( pwd )
+ fi
+
+ printf "Verifying $BUILD_SYSTEM sources\n"
+
+ archive=$( find $sources_path -name "$BUILD_SYSTEM-sources.$TAR_XZ" || true )
+ if [ -z "$archive" ]
+ then
+ printf "Finding $BUILD_SYSTEM sources archive failed!\n" >&2
+ usage
+ exit 1
+ fi
+
+ checksum_path="$archive.$SHA256SUM"
+ signature_path="$archive.$ASC"
+
+ if [ -f "$checksum_path" ]
+ then
+ (
+ cd "$( dirname "$archive" )"
+ sha256sum -c "$archive.$SHA256SUM"
+ )
+ else
+ printf "Could not verify boostrap checksum!\n" >&2
+ fi
+
+ if [ -f "$signature_path" ]
+ then
+ gpg --armor --verify "$signature_path" "$archive"
+ else
+ printf "Could not verify boostrap signature!\n" >&2
+ fi
+}
+
+extract_sources() {
+ local sources_path=$1
+ local extract_path=$2
+
+ local build_system_path
+ local archive
+
+ if [ -z "$extract_path" ]
+ then
+ extract_path=$( pwd )
+ fi
+
+ build_system_path="$extract_path/$BUILD_SYSTEM"
+
+ if [ -d "$build_system_path" ]
+ then
+ return
+ fi
+
+ printf "Extracting $BUILD_SYSTEM sources from $sources_path to $extract_path\n"
+
+ archive=$( find $sources_path -name "$BUILD_SYSTEM-sources.$TAR_XZ" || true )
+ if [ -z "$archive" ]
+ then
+ printf "Finding $BUILD_SYSTEM sources archive failed!\n" >&2
+ usage
+ exit 1
+ fi
+
+ tar -xf "$archive" -ps -C "$extract_path"
+}
+
+copy_sources() {
+ local sources_path=$1
+ local extract_path=$2
+
+ local build_system_path
+ local build_system_sources_path
+ local archives
+ local file
+
+ if [ -z "$extract_path" ]
+ then
+ extract_path=$( pwd )
+ fi
+
+ build_system_path="$extract_path/$BUILD_SYSTEM"
+ build_system_sources_path="$build_system_path/$SOURCES"
+
+ if ! [ -d "$build_system_path" ]
+ then
+ return
+ fi
+
+ printf "Copying $BUILD_SYSTEM sources from $sources_path to $extract_path\n"
+
+ mkdir -p "$build_system_path/$SOURCES"
+
+ find "$sources_path" -type f -not -name "$BUILD_SYSTEM*" || true | while read file
+ do
+ cp "$file" "$build_system_sources_path"
+ done
+}
+
+requirements() {
+ local requirement
+ local requirement_path
+
+ for requirement in "$@"
+ do
+ requirement_path=$( which "$requirement" || true )
+
+ if [ -z "$requirement_path" ]
+ then
+ printf "Missing requirement: $requirement\n" >&2
+ exit 1
+ fi
+ done
+}
+
+setup() {
+ root=$( realpath "$( dirname "$0" )" )
+ executable=$( basename "$0" )
+}
+
+libreboot_bootstrap() {
+ local sources_path=$1
+ local extract_path=$2
+
+ set -e
+
+ setup "$@"
+
+ if [ -z "$sources_path" ]
+ then
+ usage
+ exit 1
+ fi
+
+ requirements "tar" "sha256sum" "gpg"
+
+ verify_sources "$sources_path"
+ extract_sources "$sources_path" "$extract_path"
+ copy_sources "$sources_path" "$extract_path"
+}
+
+libreboot_bootstrap "$@"
diff --git a/projects/libreboot-bootstrap/libreboot-bootstrap b/projects/libreboot-bootstrap/libreboot-bootstrap
new file mode 100755
index 00000000..f8166d3e
--- /dev/null
+++ b/projects/libreboot-bootstrap/libreboot-bootstrap
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+install() {
+ project_install "$project" "$@"
+}
+
+install_check() {
+ project_install_check "$project" "$@"
+}
+
+release() {
+ project_release_install "$project" "$SOURCES" "$@"
+}
+
+release_check() {
+ project_release_install_check "$project" "$SOURCES" "$@"
+}
+
+clean() {
+ project_clean "$project" "$@"
+}
diff --git a/projects/libreboot-images/configs/projects b/projects/libreboot-images/configs/projects
new file mode 100644
index 00000000..39bcfee9
--- /dev/null
+++ b/projects/libreboot-images/configs/projects
@@ -0,0 +1,6 @@
+coreboot
+crossgcc
+vboot devices
+libpayload
+depthcharge
+cros-ec
diff --git a/projects/libreboot-images/configs/projects-build b/projects/libreboot-images/configs/projects-build
new file mode 100644
index 00000000..9971c96c
--- /dev/null
+++ b/projects/libreboot-images/configs/projects-build
@@ -0,0 +1,2 @@
+coreboot
+cros-ec
diff --git a/projects/libreboot-images/libreboot-images b/projects/libreboot-images/libreboot-images
new file mode 100755
index 00000000..3f0b0e83
--- /dev/null
+++ b/projects/libreboot-images/libreboot-images
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+download() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+extract() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+update() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+build() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+install() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+release() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+clean() {
+ project_action_projects "$action" "$project" "$@"
+}
diff --git a/projects/libreboot-release/install/install b/projects/libreboot-release/install/install
new file mode 100644
index 00000000..c0df84f1
--- /dev/null
+++ b/projects/libreboot-release/install/install
@@ -0,0 +1 @@
+libreboot-release:libreboot-release
diff --git a/projects/libreboot-release/install/libreboot-release b/projects/libreboot-release/install/libreboot-release
new file mode 100755
index 00000000..b210d7d9
--- /dev/null
+++ b/projects/libreboot-release/install/libreboot-release
@@ -0,0 +1,316 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+BUILD_SYSTEM="paper"
+
+SOURCES="sources"
+SYSTEMS="systems"
+IMAGES="images"
+TOOLS="tools"
+
+TAR_XZ="tar.xz"
+SHA256SUM="sha256sum"
+ASC="asc"
+
+usage() {
+ printf "$executable [action] [projects...]\n" >&2
+
+ printf "\nActions:\n" >&2
+ printf " download - Download project files\n" >&2
+ printf " sources - Download project sources\n" >&2
+ printf " verify - Verify project files\n" >&2
+ printf " extract - Extract project files\n" >&2
+ printf " prepare - Download, verify and extract project files\n" >&2
+
+ printf "\nEnvironment variables:\n" >&2
+ printf " MACHINE - Machine architecture to use\n" >&2
+ printf " DOWNLOAD_URL - Base URL to download files from\n" >&2
+}
+
+download() {
+ local project=$1
+
+ local ifs_save
+ local prefix
+ local directory
+ local path
+ local url
+
+ printf "Downloading $project\n"
+
+ for prefix in "$SYSTEMS/$MACHINE" "$IMAGES" "$TOOLS/$MACHINE"
+ do
+ ifs_save=$IFS
+ IFS=$'-'
+
+ directory=""
+
+ for part in $project
+ do
+ if [ -z "$directory" ]
+ then
+ directory="$part"
+ else
+ directory="$directory-$part"
+ fi
+
+ path="$root/$prefix/$directory/$project.$TAR_XZ"
+ url="$DOWNLOAD_URL/$prefix/$directory/$project.$TAR_XZ"
+
+ if wget --quiet --spider "$url"
+ then
+ mkdir -p "$( dirname "$path" )"
+ wget -O "$path" "$url"
+ wget -O "$path.$SHA256SUM" "$url.$SHA256SUM"
+ wget -O "$path.$ASC" "$url.$ASC"
+
+ return 0
+ fi
+ done
+
+ IFS=$ifs_save
+ done
+
+ printf "Could not download $project from $DOWNLOAD_URL\n" >&2
+ return 1
+}
+
+sources() {
+ local project=$1
+
+ local url="$DOWNLOAD_URL/$SOURCES/$project/$project.$TAR_XZ"
+ local path="$root/$SOURCES/$project/$project.$TAR_XZ"
+
+ printf "Downloading $project sources\n"
+
+ if wget --quiet --spider "$url"
+ then
+ mkdir -p "$root/$project"
+ wget -O "$path" "$url"
+ wget -O "$path.$SHA256SUM" "$url.$SHA256SUM"
+ wget -O "$path.$ASC" "$url.$ASC"
+ else
+ printf "Could not download $project sources from $DOWNLOAD_URL\n" >&2
+ return 1
+ fi
+
+}
+
+verify() {
+ local project=$1
+
+ local checksum_path
+ local signature_path
+ local ifs_save
+ local prefix
+ local directory
+ local path
+
+ printf "Verifying $project\n"
+
+ for prefix in "$SYSTEMS/$MACHINE" "$IMAGES" "$TOOLS/$MACHINE"
+ do
+ ifs_save=$IFS
+ IFS=$'-'
+
+ directory=""
+
+ for part in $project
+ do
+ if [ -z "$directory" ]
+ then
+ directory="$part"
+ else
+ directory="$directory-$part"
+ fi
+
+ path="$root/$prefix/$directory/$project.$TAR_XZ"
+
+ if ! [ -f "$path" ]
+ then
+ continue
+ fi
+
+ checksum_path="$path.$SHA256SUM"
+ signature_path="$path.$ASC"
+
+ if [ -f "$checksum_path" ]
+ then
+ (
+ cd "$( dirname "$path" )"
+ sha256sum -c "$project.$TAR_XZ.$SHA256SUM"
+ )
+ else
+ printf "Could not verify $project checksum!\n" >&2
+ fi
+
+ if [ -f "$signature_path" ]
+ then
+ gpg --armor --verify "$signature_path" "$path"
+ else
+ printf "Could not verify $project signature!\n" >&2
+ fi
+
+ return 0
+ done
+
+ IFS=$ifs_save
+ done
+
+ printf "Could not verify $project\n" >&2
+ return 1
+}
+
+extract() {
+ local project=$1
+
+ local extract_path
+ local ifs_save
+ local prefix
+ local directory
+ local path
+
+ printf "Extracting $project\n"
+
+ for prefix in "$SYSTEMS/$MACHINE" "$IMAGES" "$TOOLS/$MACHINE"
+ do
+ ifs_save=$IFS
+ IFS=$'-'
+
+ directory=""
+
+ for part in $project
+ do
+ if [ -z "$directory" ]
+ then
+ directory="$part"
+ else
+ directory="$directory-$part"
+ fi
+
+ path="$root/$prefix/$directory/$project.$TAR_XZ"
+
+ if ! [ -f "$path" ]
+ then
+ continue
+ fi
+
+ if [ "$prefix" = "$SYSTEMS/$MACHINE" ]
+ then
+ printf "Skiping $project extract\n"
+ return 0
+ fi
+
+ extract_path=$( dirname "$path" )
+
+ tar -xf "$path" -ps -C "$extract_path"
+
+ return 0
+ done
+
+ IFS=$ifs_save
+ done
+
+ printf "Could not extract $project\n" >&2
+ return 1
+}
+
+requirements() {
+ local requirement
+ local requirement_path
+
+ for requirement in "$@"
+ do
+ requirement_path=$( which "$requirement" || true )
+
+ if [ -z "$requirement_path" ]
+ then
+ printf "Missing requirement: $requirement\n" >&2
+ exit 1
+ fi
+ done
+}
+
+setup() {
+ root=$( realpath "$( dirname "$0" )" )
+ executable=$( basename "$0" )
+
+ if [ -z "$MACHINE" ]
+ then
+ MACHINE=$( uname -m )
+ fi
+
+ if [ -z "$DOWNLOAD_URL" ]
+ then
+ printf "Missing download URL\n" >&2
+ exit 1
+ fi
+}
+
+libreboot_release() {
+ local action=$1
+ shift
+
+ set -e
+
+ setup "$@"
+
+ if [ -z "$action" ]
+ then
+ usage
+ exit 1
+ fi
+
+ requirements "tar" "sha256sum" "gpg"
+
+ case $action in
+ "download")
+ for project in "$@"
+ do
+ download "$project"
+ done
+ ;;
+ "sources")
+ for project in "$@"
+ do
+ sources "$project"
+ done
+ ;;
+ "verify")
+ for project in "$@"
+ do
+ verify "$project"
+ done
+ ;;
+ "extract")
+ for project in "$@"
+ do
+ extract "$project"
+ done
+ ;;
+ "prepare")
+ for project in "$@"
+ do
+ download "$project"
+ verify "$project"
+ extract "$project"
+ done
+ ;;
+ esac
+}
+
+libreboot_release "$@"
diff --git a/projects/libreboot-release/libreboot-release b/projects/libreboot-release/libreboot-release
new file mode 100755
index 00000000..5c4618a3
--- /dev/null
+++ b/projects/libreboot-release/libreboot-release
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+install() {
+ local install_path=$( project_install_path "$project" "$@" )
+
+ project_install "$project" "$@"
+}
+
+install_check() {
+ project_install_check "$project" "$@"
+}
+
+release() {
+ project_release_install "$project" "$SOURCES" "$@"
+}
+
+release_check() {
+ project_release_install_check "$project" "$SOURCES" "$@"
+}
+
+clean() {
+ project_clean "$project" "$@"
+}
diff --git a/projects/libreboot-sources/libreboot-sources b/projects/libreboot-sources/libreboot-sources
new file mode 100755
index 00000000..99416251
--- /dev/null
+++ b/projects/libreboot-sources/libreboot-sources
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+update() {
+ local repository_path=$root
+
+ git_fetch "$repository_path"
+ git_merge "$repository_path" "$ORIGIN_HEAD"
+}
+
+release() {
+ local archive_path=$( project_release_archive_path "$project" "$SOURCES" "$@" )
+ local sources_path=$root
+
+ echo "$VERSION" > "$sources_path/$DOTVERSION"
+ echo "$SOURCE_DATE_EPOCH" > "$sources_path/$DOTEPOCH"
+
+ if git_check "$sources_path"
+ then
+ git_revision "$sources_path" > "$sources_path/$DOTREVISION"
+ fi
+
+ archive_create "$archive_path" "$sources_path" "$BUILD_SYSTEM"
+ file_verification_create "$archive_path"
+}
+
+release_check() {
+ local archive_path=$( project_release_archive_path "$project" "$SOURCES" "$@" )
+
+ file_exists_check "$archive_path"
+}
+
+clean() {
+ project_clean "$project" "$@"
+}
diff --git a/projects/libreboot-tools/configs/projects b/projects/libreboot-tools/configs/projects
new file mode 100644
index 00000000..4b0eeea4
--- /dev/null
+++ b/projects/libreboot-tools/configs/projects
@@ -0,0 +1,4 @@
+cbfstool
+cbmem
+nvramtool
+cros-tools
diff --git a/projects/libreboot-tools/configs/projects-download b/projects/libreboot-tools/configs/projects-download
new file mode 100644
index 00000000..c7a5d1ac
--- /dev/null
+++ b/projects/libreboot-tools/configs/projects-download
@@ -0,0 +1,5 @@
+coreboot
+cbfstool
+cbmem
+nvramtool
+cros-tools
diff --git a/projects/libreboot-tools/configs/projects-update b/projects/libreboot-tools/configs/projects-update
new file mode 120000
index 00000000..5cacf0c9
--- /dev/null
+++ b/projects/libreboot-tools/configs/projects-update
@@ -0,0 +1 @@
+projects-download \ No newline at end of file
diff --git a/projects/libreboot-tools/libreboot-tools b/projects/libreboot-tools/libreboot-tools
new file mode 100755
index 00000000..3f0b0e83
--- /dev/null
+++ b/projects/libreboot-tools/libreboot-tools
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+download() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+extract() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+update() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+build() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+install() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+release() {
+ project_action_projects "$action" "$project" "$@"
+}
+
+clean() {
+ project_action_projects "$action" "$project" "$@"
+}
diff --git a/projects/mosys/configs/install b/projects/mosys/configs/install
new file mode 100644
index 00000000..9ef89f79
--- /dev/null
+++ b/projects/mosys/configs/install
@@ -0,0 +1 @@
+mosys:mosys
diff --git a/projects/mosys/configs/revision b/projects/mosys/configs/revision
new file mode 100644
index 00000000..79d3a325
--- /dev/null
+++ b/projects/mosys/configs/revision
@@ -0,0 +1 @@
+origin/release-R56-9000.B
diff --git a/projects/mosys/mosys b/projects/mosys/mosys
new file mode 100755
index 00000000..76b9d15b
--- /dev/null
+++ b/projects/mosys/mosys
@@ -0,0 +1,111 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+download() {
+ local repository=$project
+
+ project_download_git "$project" "$repository" "https://chromium.googlesource.com/chromiumos/platform/mosys" "$@"
+}
+
+download_check() {
+ local repository=$project
+
+ project_download_check_git "$project" "$repository" "$@"
+}
+
+extract() {
+ local repository=$project
+
+ project_extract "$project" "$@"
+}
+
+extract_check() {
+ local repository=$project
+
+ project_extract_check "$project" "$@"
+}
+
+update() {
+ local repository=$project
+
+ project_update_git "$project" "$repository" "$@"
+}
+
+update_check() {
+ local repository=$project
+
+ project_update_check_git "$project" "$repository" "$@"
+}
+
+build() {
+ local repository=$project
+
+ project_sources_directory_missing_empty_error "$project" "$repository" "$@"
+
+ local sources_path=$( project_sources_path "$project" "$repository" "$@" )
+ local build_path=$( project_build_path "$project" "$@" )
+
+ local flashmap_build_path=$( project_build_path "flashmap" "$@" )
+
+ if git_project_check "$repository"
+ then
+ git_project_checkout "$project" "$repository" "$@"
+ fi
+
+ project_action "build" "flashmap" "$@"
+
+ mkdir -p "$build_path"
+
+ make -C "$sources_path" objtree="$build_path" "defconfig"
+ make -C "$sources_path" objtree="$build_path" EXTRA_CFLAGS="-I $flashmap_build_path/lib" FMAP_LINKOPT="-I $flashmap_build_path/lib -L $flashmap_build_path/lib -lfmap" -j$TASKS
+
+ cp "$sources_path/mosys" "$build_path"
+
+ make -C "$sources_path" "clean"
+}
+
+build_check() {
+ project_build_check "$project" "$@"
+}
+
+install() {
+ project_install "$project" "$@"
+}
+
+install_check() {
+ project_install_check "$project" "$@"
+}
+
+release() {
+ local repository=$project
+
+ project_release_install_archive "$project" "$TOOLS" "$@"
+
+ project_release_sources_git "$project" "$repository" "$@"
+}
+
+release_check() {
+ local repository=$project
+
+ project_release_install_archive_check "$project" "$TOOLS" "$@"
+
+ project_release_check_sources_git "$project" "$repository" "$@"
+}
+
+clean() {
+ project_clean "$project" "$@"
+}
diff --git a/projects/mosys/patches/0001-Force-the-definition-of-build-tools.patch b/projects/mosys/patches/0001-Force-the-definition-of-build-tools.patch
new file mode 100644
index 00000000..cb5728db
--- /dev/null
+++ b/projects/mosys/patches/0001-Force-the-definition-of-build-tools.patch
@@ -0,0 +1,44 @@
+From f8aa6a0eeaa6ae3fd4dfe2d60118a47a3867c906 Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Wed, 10 Feb 2016 20:44:09 +0100
+Subject: [PATCH] Force the definition of build tools
+
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ Makefile | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index c4cd006..5244242 100644
+--- a/Makefile
++++ b/Makefile
+@@ -264,16 +264,16 @@ include $(srctree)/scripts/Kbuild.include
+
+ # Make variables (CC, etc...)
+
+-AR ?= $(CROSS_COMPILE)ar
+-AS ?= $(CROSS_COMPILE)as
+-CC ?= $(CROSS_COMPILE)gcc
+-CPP ?= $(CC) -E
+-LD ?= $(CROSS_COMPILE)ld
+-NM ?= $(CROSS_COMPILE)nm
+-STRIP ?= $(CROSS_COMPILE)strip
+-OBJCOPY ?= $(CROSS_COMPILE)objcopy
+-OBJDUMP ?= $(CROSS_COMPILE)objdump
+-INSTALL ?= install
++AR := $(CROSS_COMPILE)ar
++AS := $(CROSS_COMPILE)as
++CC := $(CROSS_COMPILE)gcc
++CPP := $(CC) -E
++LD := $(CROSS_COMPILE)ld
++NM := $(CROSS_COMPILE)nm
++STRIP := $(CROSS_COMPILE)strip
++OBJCOPY := $(CROSS_COMPILE)objcopy
++OBJDUMP := $(CROSS_COMPILE)objdump
++INSTALL := install
+ AWK = awk
+ DEPMOD = /sbin/depmod
+ CHECK = sparse
+--
+1.9.1
+
diff --git a/projects/nvramtool/configs/blobs b/projects/nvramtool/configs/blobs
new file mode 120000
index 00000000..8574352d
--- /dev/null
+++ b/projects/nvramtool/configs/blobs
@@ -0,0 +1 @@
+../../coreboot/configs/blobs \ No newline at end of file
diff --git a/projects/nvramtool/configs/blobs-ignore b/projects/nvramtool/configs/blobs-ignore
new file mode 120000
index 00000000..04d6519e
--- /dev/null
+++ b/projects/nvramtool/configs/blobs-ignore
@@ -0,0 +1 @@
+../../coreboot/configs/blobs-ignore \ No newline at end of file
diff --git a/projects/nvramtool/configs/blobs-ignore-notes.txt b/projects/nvramtool/configs/blobs-ignore-notes.txt
new file mode 120000
index 00000000..3f05ba9b
--- /dev/null
+++ b/projects/nvramtool/configs/blobs-ignore-notes.txt
@@ -0,0 +1 @@
+../../coreboot/configs/blobs-ignore-notes.txt \ No newline at end of file
diff --git a/projects/nvramtool/configs/install b/projects/nvramtool/configs/install
new file mode 100644
index 00000000..e75b7ad4
--- /dev/null
+++ b/projects/nvramtool/configs/install
@@ -0,0 +1 @@
+nvramtool:nvramtool
diff --git a/projects/nvramtool/configs/revision b/projects/nvramtool/configs/revision
new file mode 120000
index 00000000..006c3a7a
--- /dev/null
+++ b/projects/nvramtool/configs/revision
@@ -0,0 +1 @@
+../../coreboot/configs/revision \ No newline at end of file
diff --git a/projects/nvramtool/nvramtool b/projects/nvramtool/nvramtool
new file mode 100755
index 00000000..18c2fbe5
--- /dev/null
+++ b/projects/nvramtool/nvramtool
@@ -0,0 +1,107 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+download() {
+ local repository="coreboot"
+
+ git_project_prepare "$project" "$repository" "$@"
+}
+
+download_check() {
+ local repository="coreboot"
+
+ git_project_prepare_check "$project" "$repository" "$@"
+}
+
+extract() {
+ local repository="coreboot"
+
+ project_extract "$project" "$@"
+}
+
+extract_check() {
+ local repository="coreboot"
+
+ project_extract_check "$project" "$@"
+}
+
+update() {
+ local repository="coreboot"
+
+ project_update_git "$project" "$repository" "$@"
+}
+
+update_check() {
+ local repository="coreboot"
+
+ project_update_check_git "$project" "$repository" "$@"
+}
+
+build() {
+ local repository="coreboot"
+
+ project_sources_directory_missing_empty_error "$project" "$repository" "$@"
+
+ local coreboot_sources_path=$( project_sources_path "$project" "$repository" "$@" )
+ local sources_path="$coreboot_sources_path/util/nvramtool/"
+ local build_path=$( project_build_path "$project" "$@" )
+
+ if git_project_check "$repository"
+ then
+ git_project_checkout "$project" "$repository" "$@"
+ fi
+
+ mkdir -p "$build_path"
+
+ make -C "$sources_path" -j$TASKS
+
+ cp "$sources_path/nvramtool" "$build_path"
+
+ make -C "$sources_path" "clean"
+}
+
+build_check() {
+ project_build_check "$project" "$@"
+}
+
+install() {
+ project_install "$project" "$@"
+}
+
+install_check() {
+ project_install_check "$project" "$@"
+}
+
+release() {
+ local repository="coreboot"
+
+ project_release_install_archive "$project" "$TOOLS" "$@"
+
+ project_release_sources_git "$project" "$repository" "$@"
+}
+
+release_check() {
+ local repository="coreboot"
+
+ project_release_install_archive_check "$project" "$TOOLS" "$@"
+
+ project_release_check_sources_git "$project" "$repository" "$@"
+}
+
+clean() {
+ project_clean "$project" "$@"
+}
diff --git a/projects/nvramtool/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch b/projects/nvramtool/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch
new file mode 120000
index 00000000..627443a5
--- /dev/null
+++ b/projects/nvramtool/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch
@@ -0,0 +1 @@
+../../coreboot/patches/0001-Avoid-using-git-submodules-for-3rdparty.patch \ No newline at end of file
diff --git a/projects/vboot/configs/blobs b/projects/vboot/configs/blobs
new file mode 100644
index 00000000..f47d47ff
--- /dev/null
+++ b/projects/vboot/configs/blobs
@@ -0,0 +1,22 @@
+tests/devkeys/firmware_bmpfv.bin
+tests/devkeys-pkc/firmware_bmpfv.bin
+tests/futility/data/bios_link_mp.bin
+tests/futility/data/bios_mario_mp.bin
+tests/futility/data/bios_peppy_mp.bin
+tests/futility/data/bios_zgb_mp.bin
+tests/futility/data/dingdong.signed
+tests/futility/data/dingdong.unsigned
+tests/futility/data/fw_gbb.bin
+tests/futility/data/fw_vblock.bin
+tests/futility/data/hoho.signed
+tests/futility/data/hoho.unsigned
+tests/futility/data/kern_preamble.bin
+tests/futility/data/minimuffin.signed
+tests/futility/data/minimuffin.unsigned
+tests/futility/data/rec_kernel_part.bin
+tests/futility/data/vmlinuz-amd64.bin
+tests/futility/data/vmlinuz-arm.bin
+tests/futility/data/zinger_mp_image.bin
+tests/futility/data/zinger.signed
+tests/futility/data/zinger.unsigned
+tests/preamble_tests
diff --git a/projects/vboot/configs/blobs-ignore b/projects/vboot/configs/blobs-ignore
new file mode 100644
index 00000000..8ce3e957
--- /dev/null
+++ b/projects/vboot/configs/blobs-ignore
@@ -0,0 +1,33 @@
+bdb/sha.c
+bdb/bdb_create.c
+cgpt/cgpt_wrapper.c
+firmware/lib/tpm_lite/include/tlcl_structures.h
+firmware/lib/cgptlib/crc32.c
+firmware/lib/cryptolib/padding.c
+firmware/2lib/2sha512.c
+firmware/2lib/2sha256.c
+firmware/bdb/secrets.c
+futility/cmd_gbb_utility.c
+scripts/image_signing/tag_image.sh
+scripts/image_signing/strip_boot_from_image.sh
+scripts/image_signing/make_dev_ssd.sh
+scripts/image_signing/tofactory.sh
+scripts/image_signing/sign_official_build.sh
+scripts/image_signing/sign_nv_cbootimage.sh
+tests/rsa_padding_test.h
+tests/bdb_sprw_test.c
+tests/crc32_test.c
+tests/vb2_api_tests.c
+tests/sha_test_vectors.h
+tests/gen_preamble_testdata.sh
+tests/load_kernel_tests.sh
+tests/vb21_host_misc_tests.c
+tests/run_vbutil_kernel_arg_tests.sh
+tests/cgptlib_test.c
+tests/vb2_sha_tests.c
+tests/futility/test_file_types.c
+tests/futility/test_file_types.sh
+tests/futility/test_dump_fmap.sh
+tests/testcases/padding_test_vectors.inc
+utility/bmpblk_font.c
+utility/vbutil_what_keys
diff --git a/projects/vboot/configs/blobs-ignore-notes.txt b/projects/vboot/configs/blobs-ignore-notes.txt
new file mode 100644
index 00000000..1999d4f5
--- /dev/null
+++ b/projects/vboot/configs/blobs-ignore-notes.txt
@@ -0,0 +1,5 @@
+./3rdparty/vboot/tests/testcases/padding_test_vectors.inc
+It's not a blob, see tests/rsa_padding_test.h for explanation.
+
+The text in this file is CC-BY-SA 4.0 or higher. All contributions to it must
+be made under the same license.
diff --git a/projects/vboot/configs/revision b/projects/vboot/configs/revision
new file mode 100644
index 00000000..79d3a325
--- /dev/null
+++ b/projects/vboot/configs/revision
@@ -0,0 +1 @@
+origin/release-R56-9000.B
diff --git a/projects/vboot/configs/targets b/projects/vboot/configs/targets
new file mode 100644
index 00000000..858f1915
--- /dev/null
+++ b/projects/vboot/configs/targets
@@ -0,0 +1,2 @@
+devices
+tools
diff --git a/projects/vboot/configs/tools/install b/projects/vboot/configs/tools/install
new file mode 100644
index 00000000..0fe502b5
--- /dev/null
+++ b/projects/vboot/configs/tools/install
@@ -0,0 +1,5 @@
+cgpt/cgpt:cgpt
+futility/futility:futility
+utility/crossystem:crossystem
+utility/tpmc:tpmc
+devkeys:devkeys
diff --git a/projects/vboot/patches/0001-firmware-Developer-mode-timeout-delay-shortening-dow.patch b/projects/vboot/patches/0001-firmware-Developer-mode-timeout-delay-shortening-dow.patch
new file mode 100644
index 00000000..c3e12f63
--- /dev/null
+++ b/projects/vboot/patches/0001-firmware-Developer-mode-timeout-delay-shortening-dow.patch
@@ -0,0 +1,34 @@
+From 0e8e89b19a4e47802ed6ea64a35da77665cc3d3f Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Mon, 10 Aug 2015 20:33:23 +0200
+Subject: [PATCH 1/7] firmware: Developer mode timeout delay shortening (down
+ to 3 seconds)
+
+A timeout delay of 3 seconds, with no bip, is much more appreciable for users.
+
+Change-Id: If4bc879f350a4a0297395077e4f55e89f4fa764d
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ firmware/lib/vboot_audio.c | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/firmware/lib/vboot_audio.c b/firmware/lib/vboot_audio.c
+index 8f31171..7e92dc7 100644
+--- a/firmware/lib/vboot_audio.c
++++ b/firmware/lib/vboot_audio.c
+@@ -30,11 +30,7 @@
+ #define MAX_CUSTOM_DELAY 300000
+
+ /* These are visible externally only to make testing easier */
+-VbDevMusicNote default_notes_[] = { {20000, 0}, /* 20 seconds */
+- {250, 400}, /* two beeps */
+- {250, 0},
+- {250, 400},
+- {9250, 0} }; /* total 30 seconds */
++VbDevMusicNote default_notes_[] = { {3000, 0} }; /* three seconds */
+ uint32_t default_count_ = sizeof(default_notes_) / sizeof(VbDevMusicNote);
+
+ VbDevMusicNote short_notes_[] = { {2000, 0} }; /* two seconds */
+--
+2.10.2
+
diff --git a/projects/vboot/patches/0002-firmware-Text-based-screen-display-in-priority.patch b/projects/vboot/patches/0002-firmware-Text-based-screen-display-in-priority.patch
new file mode 100644
index 00000000..924d19bc
--- /dev/null
+++ b/projects/vboot/patches/0002-firmware-Text-based-screen-display-in-priority.patch
@@ -0,0 +1,61 @@
+From 5f402b9d365dbc17ea68803aeb9a95da01708b9f Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Mon, 10 Aug 2015 22:44:50 +0200
+Subject: [PATCH 2/7] firmware: Text-based screen display in priority
+
+This allows showing text-based screen displays before looking at the GBB bitmaps
+since those encourage the use of non-free software (Chrome OS) and don't display
+enough information to the user.
+
+Change-Id: I1dc454cd5de1cf096a15957832a8114d4f758eac
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ firmware/lib/vboot_display.c | 17 ++++++-----------
+ 1 file changed, 6 insertions(+), 11 deletions(-)
+
+diff --git a/firmware/lib/vboot_display.c b/firmware/lib/vboot_display.c
+index 1abed92..50a2e54 100644
+--- a/firmware/lib/vboot_display.c
++++ b/firmware/lib/vboot_display.c
+@@ -335,20 +335,18 @@ static VbError_t VbDisplayScreenLegacy(VbCommonParams *cparams, uint32_t screen,
+ /* If the screen is blank, turn off the backlight; else turn it on. */
+ VbExDisplayBacklight(VB_SCREEN_BLANK == screen ? 0 : 1);
+
+- /* Look in the GBB first */
+- if (VBERROR_SUCCESS == VbDisplayScreenFromGBB(cparams, screen,
+- vncptr, locale))
++ /* Display default first */
++ if (VBERROR_SUCCESS == VbExDisplayScreen(screen, locale))
+ return VBERROR_SUCCESS;
+
+- /* If screen wasn't in the GBB bitmaps, fall back to a default */
+- return VbExDisplayScreen(screen, locale);
++ /* If default doesn't have anything to show, fall back to GBB bitmaps */
++ return VbDisplayScreenFromGBB(cparams, screen, vncptr, locale);
+ }
+
+ VbError_t VbDisplayScreen(VbCommonParams *cparams, uint32_t screen,
+ int force, VbNvContext *vncptr)
+ {
+ uint32_t locale;
+- GoogleBinaryBlockHeader *gbb = cparams->gbb;
+ VbError_t rv;
+
+ /* If requested screen is the same as the current one, we're done. */
+@@ -358,11 +356,8 @@ VbError_t VbDisplayScreen(VbCommonParams *cparams, uint32_t screen,
+ /* Read the locale last saved */
+ VbNvGet(vncptr, VBNV_LOCALIZATION_INDEX, &locale);
+
+- if (gbb->bmpfv_size == 0)
+- rv = VbExDisplayScreen(screen, locale);
+- else
+- rv = VbDisplayScreenLegacy(cparams, screen, force, vncptr,
+- locale);
++ rv = VbDisplayScreenLegacy(cparams, screen, force, vncptr,
++ locale);
+
+ if (rv == VBERROR_SUCCESS)
+ /* Keep track of the currently displayed screen */
+--
+2.10.2
+
diff --git a/projects/vboot/patches/0003-firmware-Hold-key-combination-in-developer-mode.patch b/projects/vboot/patches/0003-firmware-Hold-key-combination-in-developer-mode.patch
new file mode 100644
index 00000000..3da8642a
--- /dev/null
+++ b/projects/vboot/patches/0003-firmware-Hold-key-combination-in-developer-mode.patch
@@ -0,0 +1,50 @@
+From 78297c1fa4a158047e7bfa8bf0b3435fe498811d Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Mon, 10 Aug 2015 22:59:50 +0200
+Subject: [PATCH 3/7] firmware: Hold key combination in developer mode
+
+This binds the Ctrl + H key combination to hold the developer mode screen.
+
+Change-Id: Ia76080eacd2e5e78b35b83d0f3783bfa5137794a
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ firmware/lib/vboot_api_kernel.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
+index e465fc3..2e31f08 100644
+--- a/firmware/lib/vboot_api_kernel.c
++++ b/firmware/lib/vboot_api_kernel.c
+@@ -308,6 +308,7 @@ VbError_t VbBootDeveloper(VbCommonParams *cparams, LoadKernelParams *p)
+ uint32_t use_legacy = 0;
+ uint32_t default_boot = 0;
+ uint32_t ctrl_d_pressed = 0;
++ uint32_t hold = 0;
+
+ VbAudioContext *audio = 0;
+
+@@ -473,6 +474,12 @@ VbError_t VbBootDeveloper(VbCommonParams *cparams, LoadKernelParams *p)
+ ctrl_d_pressed = 1;
+ goto fallout;
+ break;
++ case 0x08:
++ /* Ctrl+H = hold */
++ VBDEBUG(("VbBootDeveloper() - "
++ "hold developer mode screen\n"));
++ hold = 1;
++ break;
+ case 0x0c:
+ VBDEBUG(("VbBootDeveloper() - "
+ "user pressed Ctrl+L; Try legacy boot\n"));
+@@ -523,7 +530,7 @@ VbError_t VbBootDeveloper(VbCommonParams *cparams, LoadKernelParams *p)
+ VbCheckDisplayKey(cparams, key, &vnc);
+ break;
+ }
+- } while(VbAudioLooping(audio));
++ } while(hold || VbAudioLooping(audio));
+
+ fallout:
+
+--
+2.10.2
+
diff --git a/projects/vboot/patches/0004-firmware-Screen-blank-and-wait-at-disabled-USB-boot-.patch b/projects/vboot/patches/0004-firmware-Screen-blank-and-wait-at-disabled-USB-boot-.patch
new file mode 100644
index 00000000..e61ea0ac
--- /dev/null
+++ b/projects/vboot/patches/0004-firmware-Screen-blank-and-wait-at-disabled-USB-boot-.patch
@@ -0,0 +1,56 @@
+From 4560df9f84e342ef51cf071dccd01e3fb5838a37 Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Mon, 10 Aug 2015 23:13:49 +0200
+Subject: [PATCH 4/7] firmware: Screen blank and wait at disabled USB boot
+ warning
+
+This blanks the screen before showing the disabled USB boot warning.
+It also waits for the user to press any key to come back to the developer mode
+screen.
+
+Change-Id: Ic23f1e0f8d269242a9b7af6941806951016e6eb4
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ firmware/lib/vboot_api_kernel.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
+index 2e31f08..5cf45ec 100644
+--- a/firmware/lib/vboot_api_kernel.c
++++ b/firmware/lib/vboot_api_kernel.c
+@@ -376,6 +376,7 @@ VbError_t VbBootDeveloper(VbCommonParams *cparams, LoadKernelParams *p)
+ }
+ }
+
++developer_mode_screen:
+ /* Show the dev mode warning screen */
+ VbDisplayScreen(cparams, VB_SCREEN_DEVELOPER_WARNING, 0, &vnc);
+
+@@ -498,14 +499,23 @@ VbError_t VbBootDeveloper(VbCommonParams *cparams, LoadKernelParams *p)
+ if (!allow_usb) {
+ VBDEBUG(("VbBootDeveloper() - "
+ "USB booting is disabled\n"));
++
++ VbDisplayScreen(cparams, VB_SCREEN_BLANK, 1,
++ &vnc);
++
+ VbExDisplayDebugInfo(
+ "WARNING: Booting from external media "
+ "(USB/SD) has not been enabled. Refer "
+ "to the developer-mode documentation "
+- "for details.\n");
++ "for details.\n\n"
++ "Press any key to continue.\n\n");
+ VbExBeep(120, 400);
+ VbExSleepMs(120);
+ VbExBeep(120, 400);
++
++ while (!VbExKeyboardRead()) ;
++
++ goto developer_mode_screen;
+ } else {
+ /*
+ * Clear the screen to show we get the Ctrl+U
+--
+2.10.2
+
diff --git a/projects/vboot/patches/0005-firmware-Separate-screen-and-wait-at-device-informat.patch b/projects/vboot/patches/0005-firmware-Separate-screen-and-wait-at-device-informat.patch
new file mode 100644
index 00000000..eacd7559
--- /dev/null
+++ b/projects/vboot/patches/0005-firmware-Separate-screen-and-wait-at-device-informat.patch
@@ -0,0 +1,80 @@
+From 457f2227845335bed16b190499278a887eca3939 Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Mon, 10 Aug 2015 23:53:48 +0200
+Subject: [PATCH 5/7] firmware: Separate screen and wait at device information
+ screen
+
+This blanks the screen (instead of redrawing it) at device information and
+waits for the user to press any key to come back to the developer mode screen.
+
+Change-Id: I16364e69ce5bbaba5689f9f7af29c593ddea8558
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ firmware/lib/vboot_api_kernel.c | 12 ++++++++++++
+ firmware/lib/vboot_display.c | 13 ++++++++-----
+ 2 files changed, 20 insertions(+), 5 deletions(-)
+
+diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
+index 5cf45ec..53ef5c7 100644
+--- a/firmware/lib/vboot_api_kernel.c
++++ b/firmware/lib/vboot_api_kernel.c
+@@ -481,6 +481,18 @@ developer_mode_screen:
+ "hold developer mode screen\n"));
+ hold = 1;
+ break;
++ case 0x09:
++ /* Ctrl+I = device information */
++ VBDEBUG(("VbBootDeveloper() - "
++ "device info\n"));
++
++ hold = 1;
++ VbDisplayDebugInfo(cparams, &vnc);
++
++ while (!VbExKeyboardRead()) ;
++
++ goto developer_mode_screen;
++ break;
+ case 0x0c:
+ VBDEBUG(("VbBootDeveloper() - "
+ "user pressed Ctrl+L; Try legacy boot\n"));
+diff --git a/firmware/lib/vboot_display.c b/firmware/lib/vboot_display.c
+index 50a2e54..6d8ed92 100644
+--- a/firmware/lib/vboot_display.c
++++ b/firmware/lib/vboot_display.c
+@@ -544,7 +544,7 @@ const char *RecoveryReasonString(uint8_t code)
+ return "We have no idea what this means";
+ }
+
+-#define DEBUG_INFO_SIZE 512
++#define DEBUG_INFO_SIZE 768
+
+ VbError_t VbDisplayDebugInfo(VbCommonParams *cparams, VbNvContext *vncptr)
+ {
+@@ -559,8 +559,8 @@ VbError_t VbDisplayDebugInfo(VbCommonParams *cparams, VbNvContext *vncptr)
+ VbError_t ret;
+ uint32_t i;
+
+- /* Redisplay current screen to overwrite any previous debug output */
+- VbDisplayScreen(cparams, disp_current_screen, 1, vncptr);
++ /* Blank screen */
++ VbDisplayScreen(cparams, VB_SCREEN_BLANK, 1, vncptr);
+
+ /* Add hardware ID */
+ VbRegionReadHWID(cparams, hwid, sizeof(hwid));
+@@ -669,8 +669,11 @@ VbError_t VbDisplayDebugInfo(VbCommonParams *cparams, VbNvContext *vncptr)
+ used += StrnAppend(buf + used, sha1sum, DEBUG_INFO_SIZE - used);
+ }
+
+- /* Make sure we finish with a newline */
+- used += StrnAppend(buf + used, "\n", DEBUG_INFO_SIZE - used);
++ /* Make sure we finish with newlines */
++ used += StrnAppend(buf + used, "\n\n", DEBUG_INFO_SIZE - used);
++
++ used += StrnAppend(buf + used, "Press any key to continue\n\n",
++ DEBUG_INFO_SIZE - used);
+
+ /* TODO: add more interesting data:
+ * - Information on current disks */
+--
+2.10.2
+
diff --git a/projects/vboot/patches/0006-firmware-Localization-keys-removal.patch b/projects/vboot/patches/0006-firmware-Localization-keys-removal.patch
new file mode 100644
index 00000000..fe0dd444
--- /dev/null
+++ b/projects/vboot/patches/0006-firmware-Localization-keys-removal.patch
@@ -0,0 +1,54 @@
+From 95a6212c5eef956289ab6a70ba0debb89508ce99 Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Tue, 11 Aug 2015 00:07:18 +0200
+Subject: [PATCH 6/7] firmware: Localization keys removal
+
+Since we're using a text-based interface, binding the arrow keys to localization
+changes has no effect and only makes the screen flicker.
+
+Change-Id: I92dfe63d9d0826217653e29d3f26fb0ab29071f1
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ firmware/lib/vboot_api_kernel.c | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
+index 53ef5c7..e03e042 100644
+--- a/firmware/lib/vboot_api_kernel.c
++++ b/firmware/lib/vboot_api_kernel.c
+@@ -273,7 +273,6 @@ int VbUserConfirms(VbCommonParams *cparams, uint32_t confirm_flags)
+ return 1;
+ }
+ }
+- VbCheckDisplayKey(cparams, key, &vnc);
+ }
+ VbExSleepMs(CONFIRM_KEY_DELAY);
+ }
+@@ -549,7 +548,6 @@ developer_mode_screen:
+ break;
+ default:
+ VBDEBUG(("VbBootDeveloper() - pressed key %d\n", key));
+- VbCheckDisplayKey(cparams, key, &vnc);
+ break;
+ }
+ } while(hold || VbAudioLooping(audio));
+@@ -613,7 +611,6 @@ VbError_t VbBootRecovery(VbCommonParams *cparams, LoadKernelParams *p)
+ VbDisplayScreen(cparams, VB_SCREEN_OS_BROKEN, 0, &vnc);
+ VBDEBUG(("VbBootRecovery() waiting for manual recovery\n"));
+ while (1) {
+- VbCheckDisplayKey(cparams, VbExKeyboardRead(), &vnc);
+ if (VbWantShutdown(cparams->gbb->flags))
+ return VBERROR_SHUTDOWN_REQUESTED;
+ VbExSleepMs(REC_KEY_DELAY);
+@@ -711,8 +708,6 @@ VbError_t VbBootRecovery(VbCommonParams *cparams, LoadKernelParams *p)
+ i = 4;
+ break;
+ }
+- } else {
+- VbCheckDisplayKey(cparams, key, &vnc);
+ }
+ if (VbWantShutdown(cparams->gbb->flags))
+ return VBERROR_SHUTDOWN_REQUESTED;
+--
+2.10.2
+
diff --git a/projects/vboot/patches/0007-firmware-Pass-VbDisplayInfo-information-structure-to.patch b/projects/vboot/patches/0007-firmware-Pass-VbDisplayInfo-information-structure-to.patch
new file mode 100644
index 00000000..7f090b6e
--- /dev/null
+++ b/projects/vboot/patches/0007-firmware-Pass-VbDisplayInfo-information-structure-to.patch
@@ -0,0 +1,354 @@
+From aecef39cda6a70c99bf0caff0452e47ad43a68d8 Mon Sep 17 00:00:00 2001
+From: Paul Kocialkowski <contact@paulk.fr>
+Date: Sun, 10 Jul 2016 23:43:16 +0200
+Subject: [PATCH 7/7] firmware: Pass VbDisplayInfo information structure to
+ VbExDisplayScreen
+
+This provides VbExDisplayScreen with an information structure
+(VbDisplayInfo) that contains various context information for display.
+
+Change-Id: Id9e07bb418f64e9286f07da11314cd63f925e301
+Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
+---
+ firmware/include/vboot_api.h | 12 +++++++++-
+ firmware/lib/include/vboot_display.h | 2 +-
+ firmware/lib/vboot_api_kernel.c | 44 ++++++++++++++++++++++++------------
+ firmware/lib/vboot_display.c | 15 ++++++------
+ firmware/stub/vboot_api_stub.c | 3 ++-
+ tests/vboot_api_devmode_tests.c | 3 ++-
+ tests/vboot_api_kernel2_tests.c | 2 +-
+ tests/vboot_api_kernel3_tests.c | 2 +-
+ 8 files changed, 55 insertions(+), 28 deletions(-)
+
+diff --git a/firmware/include/vboot_api.h b/firmware/include/vboot_api.h
+index 950c1e2..ba53101 100644
+--- a/firmware/include/vboot_api.h
++++ b/firmware/include/vboot_api.h
+@@ -697,6 +697,15 @@ enum VbScreenType_t {
+ VB_SCREEN_OS_BROKEN = 0x208,
+ };
+
++/* Information on display context */
++typedef struct VbDisplayInfo {
++ uint32_t allow_usb;
++ uint32_t allow_legacy;
++ uint32_t use_usb;
++ uint32_t use_legacy;
++ uint32_t signed_only;
++} VbDisplayInfo;
++
+ /**
+ * Initialize and clear the display. Set width and height to the screen
+ * dimensions in pixels.
+@@ -725,7 +734,8 @@ VbError_t VbExDisplaySetDimension(uint32_t width, uint32_t height);
+ * to be simple ASCII text such as "NO GOOD" or "INSERT"; these screens should
+ * only be seen during development.
+ */
+-VbError_t VbExDisplayScreen(uint32_t screen_type, uint32_t locale);
++VbError_t VbExDisplayScreen(uint32_t screen_type, uint32_t locale,
++ VbDisplayInfo *info);
+
+ /**
+ * Write an image to the display, with the upper left corner at the specified
+diff --git a/firmware/lib/include/vboot_display.h b/firmware/lib/include/vboot_display.h
+index 0ab93f0..0574580 100644
+--- a/firmware/lib/include/vboot_display.h
++++ b/firmware/lib/include/vboot_display.h
+@@ -15,7 +15,7 @@
+ VbError_t VbDisplayScreenFromGBB(VbCommonParams *cparams, uint32_t screen,
+ VbNvContext *vncptr, uint32_t locale);
+ VbError_t VbDisplayScreen(VbCommonParams *cparams, uint32_t screen, int force,
+- VbNvContext *vncptr);
++ VbNvContext *vncptr, VbDisplayInfo *info);
+ VbError_t VbDisplayDebugInfo(VbCommonParams *cparams, VbNvContext *vncptr);
+ VbError_t VbCheckDisplayKey(VbCommonParams *cparams, uint32_t key,
+ VbNvContext *vncptr);
+diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
+index e03e042..7dcc754 100644
+--- a/firmware/lib/vboot_api_kernel.c
++++ b/firmware/lib/vboot_api_kernel.c
+@@ -300,11 +300,13 @@ VbError_t VbBootDeveloper(VbCommonParams *cparams, LoadKernelParams *p)
+ VbSharedDataHeader *shared =
+ (VbSharedDataHeader *)cparams->shared_data_blob;
+
++ VbDisplayInfo info;
+ uint32_t allow_usb = 0;
+ uint32_t allow_legacy = 0;
+ uint32_t disable_dev_boot = 0;
+ uint32_t use_usb = 0;
+ uint32_t use_legacy = 0;
++ uint32_t signed_only = 0;
+ uint32_t default_boot = 0;
+ uint32_t ctrl_d_pressed = 0;
+ uint32_t hold = 0;
+@@ -350,10 +352,22 @@ VbError_t VbBootDeveloper(VbCommonParams *cparams, LoadKernelParams *p)
+ }
+ }
+
++ VbNvGet(&vnc, VBNV_DEV_BOOT_SIGNED_ONLY, &signed_only);
++
++ if (fwmp.flags & FWMP_DEV_ENABLE_OFFICIAL_ONLY)
++ signed_only = 1;
++
++ info.allow_usb = allow_usb;
++ info.allow_legacy = allow_legacy;
++ info.use_usb = use_usb;
++ info.use_legacy = use_legacy;
++ info.signed_only = signed_only;
++
+ /* If dev mode is disabled, only allow TONORM */
+ while (disable_dev_boot) {
+ VBDEBUG(("%s() - dev_disable_boot is set.\n", __func__));
+- VbDisplayScreen(cparams, VB_SCREEN_DEVELOPER_TO_NORM, 0, &vnc);
++ VbDisplayScreen(cparams, VB_SCREEN_DEVELOPER_TO_NORM, 0, &vnc,
++ NULL);
+ VbExDisplayDebugInfo(dev_disable_msg);
+
+ /* Ignore space in VbUserConfirms()... */
+@@ -363,7 +377,7 @@ VbError_t VbBootDeveloper(VbCommonParams *cparams, LoadKernelParams *p)
+ VbNvSet(&vnc, VBNV_DISABLE_DEV_REQUEST, 1);
+ VbDisplayScreen(cparams,
+ VB_SCREEN_TO_NORM_CONFIRMED,
+- 0, &vnc);
++ 0, &vnc, NULL);
+ VbExSleepMs(5000);
+ return VBERROR_REBOOT_REQUIRED;
+ case -1:
+@@ -377,7 +391,7 @@ VbError_t VbBootDeveloper(VbCommonParams *cparams, LoadKernelParams *p)
+
+ developer_mode_screen:
+ /* Show the dev mode warning screen */
+- VbDisplayScreen(cparams, VB_SCREEN_DEVELOPER_WARNING, 0, &vnc);
++ VbDisplayScreen(cparams, VB_SCREEN_DEVELOPER_WARNING, 0, &vnc, &info);
+
+ /* Get audio/delay context */
+ audio = VbAudioOpen(cparams);
+@@ -425,7 +439,7 @@ developer_mode_screen:
+ }
+ VbDisplayScreen(cparams,
+ VB_SCREEN_DEVELOPER_TO_NORM,
+- 0, &vnc);
++ 0, &vnc, NULL);
+ /* Ignore space in VbUserConfirms()... */
+ switch (VbUserConfirms(cparams, 0)) {
+ case 1:
+@@ -436,7 +450,7 @@ developer_mode_screen:
+ VbDisplayScreen(
+ cparams,
+ VB_SCREEN_TO_NORM_CONFIRMED,
+- 0, &vnc);
++ 0, &vnc, NULL);
+ VbExSleepMs(5000);
+ return VBERROR_REBOOT_REQUIRED;
+ case -1:
+@@ -450,7 +464,7 @@ developer_mode_screen:
+ VbDisplayScreen(
+ cparams,
+ VB_SCREEN_DEVELOPER_WARNING,
+- 0, &vnc);
++ 0, &vnc, &info);
+ /* Start new countdown */
+ audio = VbAudioOpen(cparams);
+ }
+@@ -512,7 +526,7 @@ developer_mode_screen:
+ "USB booting is disabled\n"));
+
+ VbDisplayScreen(cparams, VB_SCREEN_BLANK, 1,
+- &vnc);
++ &vnc, NULL);
+
+ VbExDisplayDebugInfo(
+ "WARNING: Booting from external media "
+@@ -533,7 +547,7 @@ developer_mode_screen:
+ * key press.
+ */
+ VbDisplayScreen(cparams, VB_SCREEN_BLANK, 0,
+- &vnc);
++ &vnc, NULL);
+ if (VBERROR_SUCCESS == VbTryUsb(cparams, p)) {
+ VbAudioClose(audio);
+ return VBERROR_SUCCESS;
+@@ -542,7 +556,7 @@ developer_mode_screen:
+ VbDisplayScreen(
+ cparams,
+ VB_SCREEN_DEVELOPER_WARNING,
+- 0, &vnc);
++ 0, &vnc, &info);
+ }
+ }
+ break;
+@@ -608,7 +622,7 @@ VbError_t VbBootRecovery(VbCommonParams *cparams, LoadKernelParams *p)
+ shared->recovery_reason));
+ VbSetRecoverySubcode(shared->recovery_reason);
+ VbNvCommit();
+- VbDisplayScreen(cparams, VB_SCREEN_OS_BROKEN, 0, &vnc);
++ VbDisplayScreen(cparams, VB_SCREEN_OS_BROKEN, 0, &vnc, NULL);
+ VBDEBUG(("VbBootRecovery() waiting for manual recovery\n"));
+ while (1) {
+ if (VbWantShutdown(cparams->gbb->flags))
+@@ -637,7 +651,7 @@ VbError_t VbBootRecovery(VbCommonParams *cparams, LoadKernelParams *p)
+ VbDisplayScreen(cparams, VBERROR_NO_DISK_FOUND == retval ?
+ VB_SCREEN_RECOVERY_INSERT :
+ VB_SCREEN_RECOVERY_NO_GOOD,
+- 0, &vnc);
++ 0, &vnc, NULL);
+
+ /*
+ * Scan keyboard more frequently than media, since x86
+@@ -677,7 +691,7 @@ VbError_t VbBootRecovery(VbCommonParams *cparams, LoadKernelParams *p)
+ /* Ask the user to confirm entering dev-mode */
+ VbDisplayScreen(cparams,
+ VB_SCREEN_RECOVERY_TO_DEV,
+- 0, &vnc);
++ 0, &vnc, NULL);
+ /* SPACE means no... */
+ uint32_t vbc_flags =
+ VB_CONFIRM_SPACE_MEANS_NO |
+@@ -839,7 +853,7 @@ static VbError_t EcUpdateImage(int devidx, VbCommonParams *cparams,
+ return VBERROR_VGA_OPROM_MISMATCH;
+ }
+
+- VbDisplayScreen(cparams, VB_SCREEN_WAIT, 0, &vnc);
++ VbDisplayScreen(cparams, VB_SCREEN_WAIT, 0, &vnc, NULL);
+ }
+
+ rv = VbExEcUpdateImage(devidx, select, expected, expected_size);
+@@ -1250,13 +1264,13 @@ VbError_t VbSelectAndLoadKernel(VbCommonParams *cparams,
+ p.boot_flags |= BOOT_FLAG_RECOVERY;
+ retval = VbBootRecovery(cparams, &p);
+ VbExEcEnteringMode(0, VB_EC_RECOVERY);
+- VbDisplayScreen(cparams, VB_SCREEN_BLANK, 0, &vnc);
++ VbDisplayScreen(cparams, VB_SCREEN_BLANK, 0, &vnc, NULL);
+
+ } else if (p.boot_flags & BOOT_FLAG_DEVELOPER) {
+ /* Developer boot */
+ retval = VbBootDeveloper(cparams, &p);
+ VbExEcEnteringMode(0, VB_EC_DEVELOPER);
+- VbDisplayScreen(cparams, VB_SCREEN_BLANK, 0, &vnc);
++ VbDisplayScreen(cparams, VB_SCREEN_BLANK, 0, &vnc, NULL);
+
+ } else {
+ /* Normal boot */
+diff --git a/firmware/lib/vboot_display.c b/firmware/lib/vboot_display.c
+index 6d8ed92..84b7961 100644
+--- a/firmware/lib/vboot_display.c
++++ b/firmware/lib/vboot_display.c
+@@ -321,7 +321,7 @@ VbError_t VbDisplayScreenFromGBB(VbCommonParams *cparams, uint32_t screen,
+ */
+ static VbError_t VbDisplayScreenLegacy(VbCommonParams *cparams, uint32_t screen,
+ int force, VbNvContext *vncptr,
+- uint32_t locale)
++ uint32_t locale, VbDisplayInfo *info)
+ {
+ VbError_t retval;
+
+@@ -336,7 +336,7 @@ static VbError_t VbDisplayScreenLegacy(VbCommonParams *cparams, uint32_t screen,
+ VbExDisplayBacklight(VB_SCREEN_BLANK == screen ? 0 : 1);
+
+ /* Display default first */
+- if (VBERROR_SUCCESS == VbExDisplayScreen(screen, locale))
++ if (VBERROR_SUCCESS == VbExDisplayScreen(screen, locale, info))
+ return VBERROR_SUCCESS;
+
+ /* If default doesn't have anything to show, fall back to GBB bitmaps */
+@@ -344,7 +344,7 @@ static VbError_t VbDisplayScreenLegacy(VbCommonParams *cparams, uint32_t screen,
+ }
+
+ VbError_t VbDisplayScreen(VbCommonParams *cparams, uint32_t screen,
+- int force, VbNvContext *vncptr)
++ int force, VbNvContext *vncptr, VbDisplayInfo *info)
+ {
+ uint32_t locale;
+ VbError_t rv;
+@@ -357,7 +357,7 @@ VbError_t VbDisplayScreen(VbCommonParams *cparams, uint32_t screen,
+ VbNvGet(vncptr, VBNV_LOCALIZATION_INDEX, &locale);
+
+ rv = VbDisplayScreenLegacy(cparams, screen, force, vncptr,
+- locale);
++ locale, info);
+
+ if (rv == VBERROR_SUCCESS)
+ /* Keep track of the currently displayed screen */
+@@ -560,7 +560,7 @@ VbError_t VbDisplayDebugInfo(VbCommonParams *cparams, VbNvContext *vncptr)
+ uint32_t i;
+
+ /* Blank screen */
+- VbDisplayScreen(cparams, VB_SCREEN_BLANK, 1, vncptr);
++ VbDisplayScreen(cparams, VB_SCREEN_BLANK, 1, vncptr, NULL);
+
+ /* Add hardware ID */
+ VbRegionReadHWID(cparams, hwid, sizeof(hwid));
+@@ -725,13 +725,14 @@ VbError_t VbCheckDisplayKey(VbCommonParams *cparams, uint32_t key,
+ #endif
+
+ /* Force redraw of current screen */
+- return VbDisplayScreen(cparams, disp_current_screen, 1, vncptr);
++ return VbDisplayScreen(cparams, disp_current_screen, 1, vncptr,
++ NULL);
+ }
+
+ if (0 == memcmp(MagicBuffer, MAGIC_WORD, MAGIC_WORD_LEN)) {
+ if (VBEASTEREGG)
+ (void)VbDisplayScreen(cparams, disp_current_screen,
+- 1, vncptr);
++ 1, vncptr, NULL);
+ }
+
+ return VBERROR_SUCCESS;
+diff --git a/firmware/stub/vboot_api_stub.c b/firmware/stub/vboot_api_stub.c
+index 717c0f8..c086195 100644
+--- a/firmware/stub/vboot_api_stub.c
++++ b/firmware/stub/vboot_api_stub.c
+@@ -41,7 +41,8 @@ VbError_t VbExDisplaySetDimension(uint32_t width, uint32_t height)
+ return VBERROR_SUCCESS;
+ }
+
+-VbError_t VbExDisplayScreen(uint32_t screen_type, uint32_t locale)
++VbError_t VbExDisplayScreen(uint32_t screen_type, uint32_t locale,
++ VbDisplayInfo *info)
+ {
+ return VBERROR_SUCCESS;
+ }
+diff --git a/tests/vboot_api_devmode_tests.c b/tests/vboot_api_devmode_tests.c
+index abd8e85..6e8afbd 100644
+--- a/tests/vboot_api_devmode_tests.c
++++ b/tests/vboot_api_devmode_tests.c
+@@ -265,7 +265,8 @@ VbError_t VbExBeep(uint32_t msec, uint32_t frequency) {
+ return beep_return;
+ }
+
+-VbError_t VbExDisplayScreen(uint32_t screen_type, uint32_t locale) {
++VbError_t VbExDisplayScreen(uint32_t screen_type, uint32_t locale,
++ VbDisplayInfo *info) {
+ switch(screen_type) {
+ case VB_SCREEN_BLANK:
+ VBDEBUG(("VbExDisplayScreen(BLANK)\n"));
+diff --git a/tests/vboot_api_kernel2_tests.c b/tests/vboot_api_kernel2_tests.c
+index 433933b..d44fc1e 100644
+--- a/tests/vboot_api_kernel2_tests.c
++++ b/tests/vboot_api_kernel2_tests.c
+@@ -185,7 +185,7 @@ uint32_t VbTryLoadKernel(VbCommonParams *cparams, LoadKernelParams *p,
+ }
+
+ VbError_t VbDisplayScreen(VbCommonParams *cparams, uint32_t screen, int force,
+- VbNvContext *vncptr)
++ VbNvContext *vncptr, VbDisplayInfo *info)
+ {
+ if (screens_count < ARRAY_SIZE(screens_displayed))
+ screens_displayed[screens_count++] = screen;
+diff --git a/tests/vboot_api_kernel3_tests.c b/tests/vboot_api_kernel3_tests.c
+index 3eddb73..0403c71 100644
+--- a/tests/vboot_api_kernel3_tests.c
++++ b/tests/vboot_api_kernel3_tests.c
+@@ -195,7 +195,7 @@ VbError_t VbExEcUpdateImage(int devidx, enum VbSelectFirmware_t select,
+ }
+
+ VbError_t VbDisplayScreen(VbCommonParams *cparams, uint32_t screen, int force,
+- VbNvContext *vncptr)
++ VbNvContext *vncptr, VbDisplayInfo *info)
+ {
+ if (screens_count < ARRAY_SIZE(screens_displayed))
+ screens_displayed[screens_count++] = screen;
+--
+2.10.2
+
diff --git a/projects/vboot/vboot b/projects/vboot/vboot
new file mode 100755
index 00000000..2a062023
--- /dev/null
+++ b/projects/vboot/vboot
@@ -0,0 +1,147 @@
+#!/bin/bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+arguments() {
+ project_arguments_targets "$project" "$@"
+}
+
+usage() {
+ project_usage_actions "$project" "checkout"
+ project_usage_arguments "$project" "$@"
+}
+
+download() {
+ local repository=$project
+
+ project_download_git "$project" "$repository" "https://chromium.googlesource.com/chromiumos/platform/vboot_reference https://review.coreboot.org/vboot.git https://github.com/coreboot/vboot.git" "$@"
+}
+
+download_check() {
+ project_download_check_git "$project" "$repository" "$@"
+}
+
+extract() {
+ project_extract "$project" "$@"
+}
+
+extract_check() {
+ project_extract_check "$project" "$@"
+}
+
+update() {
+ local repository=$project
+
+ project_update_git "$project" "$repository" "$@"
+}
+
+update_check() {
+ local repository=$project
+
+ project_update_check_git "$project" "$repository" "$@"
+}
+
+checkout() {
+ local repository=$project
+
+ if git_project_check "$repository"
+ then
+ git_project_checkout "$project" "$repository" "$@"
+ fi
+}
+
+build() {
+ local target=$1
+
+ local repository=$project
+
+ project_sources_directory_missing_empty_error "$project" "$repository" "$@"
+
+ if git_project_check "$repository"
+ then
+ git_project_checkout "$project" "$repository" "$@"
+ fi
+
+ if [ "$target" = "tools" ]
+ then
+ local sources_path=$( project_sources_path "$project" "$repository" "$@" )
+ local build_path=$( project_build_path "$project" "$@" )
+
+ mkdir -p "$build_path"
+
+ make -C "$sources_path" BUILD="$build_path" -j$TASKS "host_stuff"
+ make -C "$sources_path" BUILD="$build_path" -j$TASKS "host_stuff"
+
+ cp -r "$sources_path/tests/devkeys" "$build_path"
+ fi
+}
+
+build_check() {
+ local target=$1
+
+ if [ "$target" = "tools" ]
+ then
+ project_build_check "$project" "$@"
+ fi
+}
+
+install() {
+ local target=$1
+
+ if [ "$target" = "tools" ]
+ then
+ project_install "$project" "$@"
+ fi
+}
+
+install_check() {
+ local target=$1
+
+ if [ "$target" = "tools" ]
+ then
+ project_install_check "$project" "$@"
+ fi
+}
+
+release() {
+ local target=$1
+
+ local repository=$project
+
+ if [ "$target" = "tools" ]
+ then
+ project_release_install_archive "$project" "$TOOLS" "$@"
+ fi
+
+ project_release_sources_git "$project" "$repository" "$@"
+}
+
+release_check() {
+ local target=$1
+
+ local repository=$project
+
+ if [ "$target" = "tools" ]
+ then
+ project_release_install_archive_check "$project" "$TOOLS" "$@"
+ fi
+
+ project_release_check_sources_git "$project" "$repository" "$@"
+}
+
+clean() {
+ project_clean "$project" "$@"
+}