Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Pcengines trenchboot 4.11.x #374

Open
wants to merge 70 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
fd357cf
TrenchBoot development environment setup
pietrushnic May 10, 2019
fc89a93
use GRUB2 based on master branch
pietrushnic May 10, 2019
c8efb9d
configs: add slaunch module to apu2.tb config
pietrushnic May 12, 2019
d89c202
grub.cfg: use isar generated kernel and NFS to boot, execute slaunch
pietrushnic May 12, 2019
d7aeb66
grub.cfg: add linux debugging
pietrushnic May 12, 2019
0a04888
configs: use most recent TrenchBoot related code for GRUB2
pietrushnic Jul 12, 2019
8f06a8b
grub.cfg: correct location of kernel and slaunch command
pietrushnic Jul 12, 2019
d5e4efc
grub.cfg: load lz
pietrushnic Jul 19, 2019
9b9721e
grub.cfg: change from isar to custom bzImage
pietrushnic Jul 20, 2019
249f1d1
configs: update GRUB commit for apu2 TrenchBoot
pietrushnic Jul 23, 2019
2f7b6ef
grub.cfg: update for kernel and initrd in CBFS, bump GRUB commit
krystian-hebel Aug 21, 2019
4a42cc9
src/security/vboot/vboot_logic.c: force recovery mode when no RW part…
miczyg1 Sep 23, 2019
f41f939
payloads/external/landing-zone: add landing-zone submodule
miczyg1 Sep 23, 2019
eb38d17
payloads/external/GRUB2/Kconfig: prepare integration for lzheader and…
miczyg1 Sep 23, 2019
4f32f6e
payloads/external/Makefile.inc: build lz_header when TrenchBoot DRTM …
miczyg1 Sep 23, 2019
4a29ca9
configs/config.pcengines_apu2.tb: update miniconfig for trenchboot
miczyg1 Sep 23, 2019
3438292
.gitmodules: cleanup wrong entry
miczyg1 Sep 23, 2019
c862a57
payloads/external/GRUB2/Kconfig: remove paths to initrd and kernel
miczyg1 Sep 24, 2019
ea8ae65
payloads/external/Makefile.inc: integrate build of Linux kernel and u…
miczyg1 Sep 24, 2019
abff797
payloads/external/linux: add defconfig and Makefile for PSEC demo
miczyg1 Sep 24, 2019
0577378
payloads/external/u-root: add u-root project directory nad Makefile
miczyg1 Sep 24, 2019
c246d37
src/mainboard/pcengines/apu2/board.fmd: add simple FMD file for measu…
miczyg1 Sep 24, 2019
daa6fe0
.gitignore: add new payloads to gitignore
miczyg1 Sep 24, 2019
deba1de
configs/config.pcengines_apu2.tb: update miniconfig
miczyg1 Sep 24, 2019
103c3be
payloads/external/u-root/Makefile: fix build rule
miczyg1 Sep 24, 2019
b2ea1c7
WIP: mods to seamlessly run xen from /dev/sda1
pietrushnic Sep 28, 2019
aebd60a
payloads/external/Makefile.inc: fix typo in u-root rule
miczyg1 Sep 28, 2019
a7de6b4
payloads/external/u-root/Makefile: change repo to 3mdeb
miczyg1 Sep 28, 2019
99a376b
payloads/Makefile.inc: extend payloads list with linux and u-root
miczyg1 Sep 28, 2019
e8d99e9
payloads/external/u-root/Makefile: patch the uinit file
miczyg1 Sep 28, 2019
c0c7062
payloads/external/u-root/0001-examples-uinit-uinit.go-automate-Xen-la…
miczyg1 Sep 28, 2019
122a80d
payloads/external/u-root/Makefile: do not use fork
miczyg1 Sep 28, 2019
4b10d5c
payloads/linux: fix cleanup issues
pietrushnic Sep 28, 2019
ceada1b
payoloads/u-root: used 3mdeb/uinit
pietrushnic Sep 28, 2019
9c3868d
payloads/external/linux/Makefile: use rebased Linux with SHA256
miczyg1 Oct 26, 2019
8003100
payloads/external/linux/linux_defconfig-5.1: add defconfig for Linux 5.1
miczyg1 Oct 26, 2019
26ee8af
configs/config.pcengines_apu2.tb: bump to v4.10.0.2
miczyg1 Oct 26, 2019
f55075e
payloads/external/landing-zone: use SHA256 to extend PCR 17
miczyg1 Oct 26, 2019
ac29075
payloads/external/landing-zone: use only SHA256 for TPM2.0
miczyg1 Oct 26, 2019
32a8fb8
payloads/external/u-root: fix u-root compilation by correctly definin…
pietrushnic Dec 5, 2019
0543bbe
landing-zone: change submodule to add_sha256 hash
pietrushnic Feb 17, 2020
e4e0686
gitmodules: add landing-zone
pietrushnic Feb 17, 2020
cda35d2
payloads/external/GRUB2: correct Makefile to use revision provided in…
pietrushnic Feb 18, 2020
4d6b592
configs: add GRIB2 revision to apu2.tb config
pietrushnic Feb 18, 2020
35be2fc
src/security/vboot/vboot_logic.c: fix reference bug
pietrushnic Feb 18, 2020
d7f7797
payloads/external/GRUB2: add support for GRUB 2.04 compilation
pietrushnic May 12, 2019
d174fac
payloads/external/GRUB2: fix building from scratch procedure
pietrushnic Jul 12, 2019
4c8204e
payloads/external/landing-zone: add landing-zone submodule
miczyg1 Sep 23, 2019
ff5ba51
.gitmodules: cleanup wrong entry
miczyg1 Sep 23, 2019
2cc448c
payloads/external/{landing-zone,GRUB2}: update branches
krystian-hebel Jan 29, 2020
9962962
nb/amd/pi/00730F01/northbridge: refactor IVRS
miczyg1 Jan 29, 2020
a9f8ec2
Merge pull request #369 from pcengines/refactored_ivrs
miczyg1 Feb 18, 2020
3d9b7af
src/arch/x86/include/arch/acpi.h: add IVHD type 11h definitions
miczyg1 Feb 19, 2020
9eebf64
src/northbridge/amd/pi/00730F01/northbridge.c: extend IVRS with IVHD …
miczyg1 Feb 19, 2020
70de5ed
src/mainboard/pcengines/apu2: enable IOMMU by default
miczyg1 Feb 19, 2020
d62f21e
Merge pull request #375 from pcengines/ivrs_ivhd_11
miczyg1 Feb 20, 2020
d84023e
drivers/pc80/tpm/tis.c: set correct HID/CID for TPM2 accordign to TCG…
miczyg1 Mar 19, 2020
73f3ace
payloads/external/sortbootorder/Makefile: fix sortbootorder checkout
miczyg1 Mar 19, 2020
cebbb35
payloads/external/sortbootorder/Makefile: sue project_dir where appro…
miczyg1 Mar 19, 2020
8ef5d29
nb/amd/pi/00730F01/northbridge.c: init GNB IOAPIC
miczyg1 Mar 19, 2020
db3ce28
nb/amd/pi/00730F01/state_machine.c: unhardcode IOAPIC2 address
miczyg1 Mar 19, 2020
7070f60
Merge pull request #383 from pcengines/tpm2_ssdt_fix
miczyg1 Mar 19, 2020
e5b8921
mb/pcengines/apu2: add PCIe slots resets and enable PM capabilities
miczyg1 Mar 19, 2020
d0ff1a7
mb/pcengines/apu2/mptable.c: add GNB IOAPIC to MP Table
miczyg1 Mar 19, 2020
b7d8210
Merge pull request #384 from pcengines/gnb_fixes
miczyg1 Mar 27, 2020
f790dfa
payloads/iPXE: add repo URL and branch name for fork with LZ support
krystian-hebel Mar 19, 2020
706166c
configs: add config for TrenchBoot over iPXE
krystian-hebel Mar 19, 2020
d73c727
Merge pull request #405 from pcengines/ipxe_landing_zone
miczyg1 Jun 1, 2020
8461282
payloads/GRUB2: update repository URL and branch name
krystian-hebel Jun 5, 2020
b5588c4
Merge pull request #408 from pcengines/new_grub_repo
miczyg1 Jun 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ payloads/external/U-Boot/u-boot/
payloads/external/Memtest86Plus/memtest86plus/
payloads/external/iPXE/ipxe/
payloads/external/sortbootorder/sortbootorder
payloads/external/linux/linux/
payloads/external/u-root/uroot/
util/crossgcc/acpica-unix-*/
util/crossgcc/binutils-*/
util/crossgcc/build-*BINUTILS/
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@
url = https://review.coreboot.org/amd_blobs.git
update = none
ignore = dirty
[submodule "payloads/external/landing-zone"]
path = payloads/external/landing-zone
url = https://github.com/TrenchBoot/landing-zone.git

14 changes: 14 additions & 0 deletions configs/config.pcengines_apu2.tb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CONFIG_LOCALVERSION="v4.10.0.2"
CONFIG_VENDOR_PCENGINES=y
CONFIG_FMDFILE="$(top)/src/mainboard/$(CONFIG_MAINBOARD_DIR)/board.fmd"
CONFIG_VBOOT=y
CONFIG_BOARD_PCENGINES_APU2=y
CONFIG_NO_GFX_INIT=y
CONFIG_VBOOT_MEASURED_BOOT=y
CONFIG_USER_TPM2=y
CONFIG_PAYLOAD_GRUB2=y
CONFIG_GRUB2_REVISION=y
CONFIG_GRUB2_INCLUDE_RUNTIME_CONFIG_FILE=y
CONFIG_GRUB2_TRENCHBOOT_DRTM=y
CONFIG_GRUB2_INCLUDE_UROOT=y
CONFIG_GRUB2_REVISION_ID="origin/trenchboot_support_2.04"
23 changes: 23 additions & 0 deletions configs/config.pcengines_apu2_tb_ipxe
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
CONFIG_LOCALVERSION="v4.11.0.1"
CONFIG_VENDOR_PCENGINES=y
CONFIG_PAYLOAD_CONFIGFILE="$(top)/src/mainboard/$(MAINBOARDDIR)/seabios_config"
CONFIG_BOARD_PCENGINES_APU2=y
CONFIG_PXE_ROM_ID="8086,157b"
CONFIG_NO_GFX_INIT=y
CONFIG_USER_TPM2=y
CONFIG_DEFAULT_CONSOLE_LOGLEVEL_1=y
CONFIG_SEABIOS_REVISION=y
CONFIG_SEABIOS_REVISION_ID="rel-1.12.1.3"
CONFIG_SEABIOS_BOOTORDER_FILE="$(top)/src/mainboard/$(MAINBOARDDIR)/variants/$(CONFIG_VARIANT_DIR)/bootorder"
CONFIG_SEABIOS_DEBUG_LEVEL=0
CONFIG_PXE=y
CONFIG_BUILD_IPXE=y
CONFIG_IPXE_LZ=y
# CONFIG_PXE_SERIAL_CONSOLE is not set
CONFIG_PXE_CUSTOM_BUILD_ID="12345678"
CONFIG_PXE_ADD_SCRIPT=y
CONFIG_PXE_SCRIPT="payloads/external/iPXE/menu.ipxe"
CONFIG_MEMTEST_SECONDARY_PAYLOAD=y
CONFIG_SORTBOOTORDER_SECONDARY_PAYLOAD=y
CONFIG_MEMTEST_REVISION=y
CONFIG_MEMTEST_REVISION_ID="0bd34c22604660e4283316331f3e7bf8a3863753"
10 changes: 10 additions & 0 deletions grub.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set debug=linux
serial --speed=115200 --word=8 --parity=no --stop=1
terminal_input --append serial
terminal_output --append serial

linux (cbfsdisk)/bzImage console=ttyS0,115200 earlyprintk=serial,ttyS0,115200
initrd (cbfsdisk)/initrd
slaunch skinit
slaunch_module (cbfsdisk)/lz_header
boot
2 changes: 2 additions & 0 deletions payloads/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ payloads/external/tianocore \
payloads/external/GRUB2 \
payloads/external/LinuxBoot \
payloads/external/Yabits \
payloads/external/linux \
payloads/external/u-root \

payloads/coreinfo/build/coreinfo.elf coreinfo:
$(MAKE) -C payloads/coreinfo defaultbuild
Expand Down
16 changes: 16 additions & 0 deletions payloads/external/GRUB2/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ endchoice
config GRUB2_REVISION_ID
string "Insert a commit's SHA-1 or a branch name"
depends on GRUB2_REVISION
default "origin/move_header" if GRUB2_TRENCHBOOT_DRTM
default "origin/master"
help
The commit's SHA-1 or branch name of the revision to use.

config GRUB2_EXTRA_MODULES
string "Extra modules to include in GRUB image"
default "slaunch" if GRUB2_TRENCHBOOT_DRTM
help
Space-separated list of additional modules to include. Few common
ones:
Expand Down Expand Up @@ -71,4 +73,18 @@ config GRUB2_RUNTIME_CONFIG_FILE
help
The path of the GRUB2 runtime configuration file to be added to CBFS.

config GRUB2_TRENCHBOOT_DRTM
bool "Add TrenchBoot DRTM support"
depends on PAYLOAD_GRUB2
default n
help
Enable Trenchboot DRTM extensions in GRUB2 and build LandingZone binary that will be included in CBFS.

config GRUB2_INCLUDE_UROOT
bool "Include u-root binaries"
depends on GRUB2_TRENCHBOOT_DRTM
default no
help
Include Linux kernel with u-root initrd.

endif
34 changes: 22 additions & 12 deletions payloads/external/GRUB2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,41 @@ NAME-$(CONFIG_GRUB2_MASTER)=HEAD
NAME-$(CONFIG_GRUB2_REVISION)=$(CONFIG_GRUB2_REVISION_ID)
NAME-$(CONFIG_GRUB2_STABLE)=2.04

project_git_repo=https://git.savannah.gnu.org/git/grub.git/
project_git_repo=https://github.com/3mdeb/grub.git
project_dir=grub2

unexport HOSTCC CC LD OBJCOPY STRIP
MAKEOVERRIDES :=

all: grub2

checkout:
echo " GIT GRUB2 $(NAME-y)"
test -d $(project_dir) || git clone $(project_git_repo) $(project_dir)
git -C $(project_dir) fetch
ifeq ("$(shell test -d $(project_dir) && \
(git -C $(project_dir) status --ignored=no --untracked-files=no --porcelain))",)
git -C $(project_dir) checkout -f $(TAG-y)
else
echo "WARNING: index/tree not clean, skipping update / force checkout."
echo " Checkout manually with `git -C $(project_dir) checkout -f`."
clone:
echo " Cloning GRUB2 from Git"
git clone $(project_git_repo) $(project_dir)

fetch: clone
ifeq ($(TAG-y),)
echo "Error: The specified tag is invalid"
ifeq ($(CONFIG_GRUB2_REVISION),y)
echo "Error: There is no revision specified for GRUB2"
false
endif
false
endif
cd grub2; git show $(TAG-y) >/dev/null 2>&1 ; if [ $$? -ne 0 ] || \
[ "$(TAG-y)" = "origin/master" ]; then \
echo " Fetching new commits from the GRUB2 git repo"; \
git fetch; fi

checkout: fetch
echo " Checking out GRUB2 revision $(TAG-y)"
cd grub2; git checkout master; git branch -D coreboot 2>/dev/null; git checkout -b coreboot $(TAG-y)

grub2/build/config.h: $(CONFIG_DEP) | checkout
echo " CONFIG GRUB2 $(NAME-y)"
rm -rf grub2/build
mkdir grub2/build
cd grub2 && ./bootstrap ; ./autogen.sh
cd grub2 && ./bootstrap && ./autogen.sh
cd grub2/build && ../configure CC="$(HOSTCC)" LD="$(LD)" \
FREETYPE="pkg-config freetype2" BUILD_FREETYPE="pkg-config freetype2" \
TARGET_CC="$(CC)" TARGET_OBJCOPY="$(OBJCOPY)" TARGET_STRIP="$(STRIP)" \
Expand Down
33 changes: 33 additions & 0 deletions payloads/external/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,40 @@ grub2: $(obj)/config.h
CONFIG_GRUB2_REVISION_ID=$(CONFIG_GRUB2_REVISION_ID) \
CONFIG_GRUB2_EXTRA_MODULES=$(CONFIG_GRUB2_EXTRA_MODULES)

lzheader:
$(MAKE) -C payloads/external/landing-zone \
CC="$(HOSTCC)"

linux:
$(MAKE) -C payloads/external/linux

uroot:
$(MAKE) -C payloads/external/u-root

payloads/external/GRUB2/grub2/build/default_payload.elf: grub2

ifneq ($(CONFIG_GRUB2_TRENCHBOOT_DRTM),)
payloads/external/landing-zone/lz_header.bin: lzheader
cbfs-files-y += lz_header
lz_header-file := payloads/external/landing-zone/lz_header.bin
lz_header-type := raw
endif

ifneq ($(CONFIG_GRUB2_INCLUDE_UROOT),)
payloads/external/linux/linux/bzImage: linux
payloads/external/u-root/uroot/initramfs.cpio.lzma: uroot

cbfs-files-y += bzImage
bzImage-file := payloads/external/linux/linux/bzImage
bzImage-type := raw
bzImage-compression := none

cbfs-files-y += initrd
initrd-file := payloads/external/u-root/uroot/initramfs.cpio.lzma
initrd-type := raw
initrd-compression := none
endif

# U-Boot

payloads/external/U-Boot/u-boot/u-boot-dtb.bin u-boot: $(DOTCONFIG)
Expand Down Expand Up @@ -321,6 +353,7 @@ payloads/external/iPXE/ipxe/ipxe.rom ipxe: $(DOTCONFIG) $(PXE_CONFIG_SCRIPT)
PXE_ROM_PCI_ID=$(PXE_ROM_PCI_ID) \
CONFIG_IPXE_MASTER=$(CONFIG_IPXE_MASTER) \
CONFIG_IPXE_STABLE=$(CONFIG_IPXE_STABLE) \
CONFIG_IPXE_LZ=$(CONFIG_IPXE_LZ) \
CONSOLE_SERIAL=$(IPXE_SERIAL_CONSOLE) \
IPXE_UART=$(IPXE_UART) \
CONFIG_TTYS0_BAUD=$(CONFIG_TTYS0_BAUD) \
Expand Down
5 changes: 5 additions & 0 deletions payloads/external/iPXE/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ config IPXE_MASTER
help
Newest iPXE version.

config IPXE_LZ
bool "landing_zone"
help
iPXE with support for TrenchBoot's Landing Zone.

endchoice

config PXE_ROM_FILE
Expand Down
5 changes: 5 additions & 0 deletions payloads/external/iPXE/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@ STABLE_COMMIT_ID=ebf2eaf515e46abd43bc798e7e4ba77bfe529218

TAG-$(CONFIG_IPXE_MASTER)=origin/master
TAG-$(CONFIG_IPXE_STABLE)=$(STABLE_COMMIT_ID)
TAG-$(CONFIG_IPXE_LZ)=origin/landing_zone

project_name=iPXE
project_dir=ipxe
ifeq ($(CONFIG_IPXE_LZ),y)
project_git_repo=https://github.com/3mdeb/ipxe.git
else
project_git_repo=https://git.ipxe.org/ipxe.git
endif

unexport KCONFIG_AUTOHEADER
unexport KCONFIG_AUTOCONFIG
Expand Down
1 change: 1 addition & 0 deletions payloads/external/landing-zone
Submodule landing-zone added at 3312de
46 changes: 46 additions & 0 deletions payloads/external/linux/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
##
## This file is part of the coreboot project.
##
## Copyright (C) 2016 Google Inc.
##
## 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; version 2 of the License.
##
## 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.
##

project_name=Linux
project_dir=$(CURDIR)/linux
project_git_repo=https://github.com/3mdeb/linux-stable.git
project_git_branch=linux-sl-5.1-sha2-amd

unexport $(COREBOOT_EXPORTS)

all: build

$(project_dir):
echo " Cloning $(project_name) from Git"
git clone $(project_git_repo) $(project_dir) --depth=1 -b $(project_git_branch)

build: $(project_dir)
echo " MAKE $(project_name)"
cp $(CURDIR)/linux_defconfig-5.1 $(project_dir)/.config
$(MAKE) -C $(project_dir) olddefconfig V=1
$(MAKE) -C $(project_dir) bzImage V=1
cp $(project_dir)/arch/x86/boot/bzImage $(project_dir)/bzImage

clean:
test -d $(project_dir) && rm $(project_dir)/bzImage || exit 0
test -d $(project_dir) && $(MAKE) -C $(project_dir) clean || exit 0

distclean:
rm -rf $(project_dir)

print-repo-info:
echo "$(project_git_repo) $(project_dir)"

.PHONY: all build clean distclean print-repo-info
Loading