Skip to content

Commit

Permalink
On KGPE-D16 boards, ensure linux-kgpe-d16*.config are up-to-date by:
Browse files Browse the repository at this point in the history
	cp config/linux.. ./build/linux*/.config
	cd build/linux*
	make savedefconfig
	cp defconfig ../../config/linux..

Resulting in only linux-kgpe-d16_workstation.config being updated.

For KGPE-D16 workstation boards:
Remove `console=tty0` from `CONFIG_BOOT_KERNEL_ADD` as was blocking Qubes graphical installer (CLI installer was launched).
Comment out `export CONFIG_BOOT_KERNEL_REMOVE="plymouth.ignore-serial-consoles"` to provide a more desktop like experience.

Removed 0001-cpu-x86-smm-Use-PRIxPTR-to-print-uintptr_t.patch as already exists as 0000-cpu-x86-smm-Use-PRIxPTR-to-print-uintptr_t.patch

Added 0020-kgpe-d16_measured-boot-support.patch for coreboot 4.11

Fix TPM errors when microcode is measured by initialising TPM earlier and loading the microcode later.
Thanks to Michał Żygowski <miczyg1> for condition suggestion: `if (CONFIG(MEASURED_BOOT) && CONFIG(LPC_TPM) && boot_cpu())`

Locate bootblock location and size with CBFS API. Credit to: Michał Żygowski <miczyg1>
  • Loading branch information
Tonux599 committed Nov 28, 2020
1 parent 26f60d1 commit d9f9be1
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ export CONFIG_ERROR_BG_COLOR="--background-gradient 0 0 0 150 0 0"
#Dual output to local console (tty0) and OpenBmc (ttyS1)
#export CONFIG_BOOT_KERNEL_ADD="nohz=on console=ttyS1,115200n8 console=tty0"
#Single output to tty0
export CONFIG_BOOT_KERNEL_ADD="nohz=on console=tty0 nouveau.config=NvForcePost=1"
export CONFIG_BOOT_KERNEL_ADD="nohz=on nouveau.config=NvForcePost=1"
#export CONFIG_BOOT_RECOVERY_SERIAL="/dev/ttyS0"
#export CONFIG_BOOT_STATIC_IP=192.168.2.3

export CONFIG_BOOT_REQ_HASH=n
export CONFIG_BOOT_REQ_ROLLBACK=n
export CONFIG_BOOT_KERNEL_REMOVE="plymouth.ignore-serial-consoles"
#export CONFIG_BOOT_KERNEL_REMOVE="plymouth.ignore-serial-consoles"
export CONFIG_BOOT_DEV="/dev/sda1"
export CONFIG_USB_BOOT_DEV="/dev/sdb1"
export CONFIG_FLASHROM_OPTIONS="--force --noverify -p internal"
4 changes: 2 additions & 2 deletions boards/kgpe-d16_workstation/kgpe-d16_workstation.config
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ export CONFIG_ERROR_BG_COLOR="--background-gradient 0 0 0 150 0 0"
#Dual output to local console (tty0) and OpenBmc (ttyS1)
#export CONFIG_BOOT_KERNEL_ADD="nohz=on console=ttyS1,115200n8 console=tty0"
#Single output to tty0
export CONFIG_BOOT_KERNEL_ADD="nohz=on console=tty0 nouveau.config=NvForcePost=1"
export CONFIG_BOOT_KERNEL_ADD="nohz=on nouveau.config=NvForcePost=1"
#export CONFIG_BOOT_RECOVERY_SERIAL="/dev/ttyS0"
#export CONFIG_BOOT_STATIC_IP=192.168.2.3

export CONFIG_BOOT_REQ_HASH=n
export CONFIG_BOOT_REQ_ROLLBACK=n
export CONFIG_BOOT_KERNEL_REMOVE="plymouth.ignore-serial-consoles"
#export CONFIG_BOOT_KERNEL_REMOVE="plymouth.ignore-serial-consoles"
export CONFIG_BOOT_DEV="/dev/sda1"
export CONFIG_USB_BOOT_DEV="/dev/sdb1"
export CONFIG_FLASHROM_OPTIONS="--force --noverify -p internal"
11 changes: 3 additions & 8 deletions config/linux-kgpe-d16_workstation.config
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ CONFIG_KEXEC_FILE=y
CONFIG_PHYSICAL_ALIGN=0x1000000
# CONFIG_MODIFY_LDT_SYSCALL is not set
# CONFIG_SUSPEND is not set
CONFIG_ACPI_VIDEO=y
CONFIG_PCI_MSI=y
# CONFIG_HT_IRQ is not set
CONFIG_PCI_IOV=y
Expand Down Expand Up @@ -179,15 +178,15 @@ CONFIG_I2C_MUX_REG=m
# CONFIG_I2C_HELPER_AUTO is not set
CONFIG_I2C_SLAVE=y
CONFIG_PTP_1588_CLOCK=y
# CONFIG_HWMON is not set
# CONFIG_X86_PKG_TEMP_THERMAL is not set
CONFIG_MFD_SYSCON=y
CONFIG_DRM=y
CONFIG_DRM_RADEON=y
CONFIG_DRM_AMDGPU=y
CONFIG_DRM_NOUVEAU=y
CONFIG_DRM_AST=y
CONFIG_FB_VESA=y
CONFIG_BACKLIGHT_LCD_SUPPORT=y
# CONFIG_LCD_CLASS_DEVICE is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=y
# CONFIG_BACKLIGHT_GENERIC is not set
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_USB=y
Expand All @@ -200,7 +199,6 @@ CONFIG_USB_OHCI_HCD_PLATFORM=m
CONFIG_USB_UHCI_HCD=m
CONFIG_USB_STORAGE=m
CONFIG_RTC_CLASS=y
# CONFIG_X86_PLATFORM_DEVICES is not set
CONFIG_INTEL_IOMMU=y
CONFIG_INTEL_IOMMU_SVM=y
CONFIG_GENERIC_PHY=y
Expand Down Expand Up @@ -324,6 +322,3 @@ CONFIG_CRC8=m
CONFIG_XZ_DEC_TEST=m
CONFIG_CORDIC=m
CONFIG_IRQ_POLL=y
CONFIG_DRM_NOUVEAU=y
CONFIG_DRM_RADEON=y
CONFIG_DRM_AMDGPU=y

This file was deleted.

67 changes: 67 additions & 0 deletions patches/coreboot-4.11/0020-kgpe-d16_measured-boot-support.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
diff --git a/src/mainboard/asus/kgpe-d16/romstage.c b/src/mainboard/asus/kgpe-d16/romstage.c
index 637ec42109..8a92f88375 100644
--- a/src/mainboard/asus/kgpe-d16/romstage.c
+++ b/src/mainboard/asus/kgpe-d16/romstage.c
@@ -46,6 +46,12 @@
#include <cbmem.h>
#include <types.h>

+#include <security/tpm/tss.h>
+#include <security/tpm/tspi.h>
+#include <program_loading.h>
+#include <smp/node.h>
+#include <cbfs.h>
+
#include "cpu/amd/quadcore/quadcore.c"

#define SERIAL_0_DEV PNP_DEV(0x2e, W83667HG_A_SP1)
@@ -547,7 +553,6 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
power_on_reset = 1;

initialize_mca(1, power_on_reset);
- update_microcode(val);

post_code(0x33);

@@ -573,6 +578,13 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
sr5650_early_setup();
sb7xx_51xx_early_setup();

+ if (CONFIG(MEASURED_BOOT) && CONFIG(LPC_TPM) && boot_cpu()) {
+ tpm_setup(0);
+ tlcl_lib_init();
+ }
+
+ update_microcode(val);
+
if (CONFIG(LOGICAL_CPUS)) {
/* Core0 on each node is configured. Now setup any additional cores. */
printk(BIOS_DEBUG, "start_other_cores()\n");
@@ -687,6 +699,17 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
pci_write_config16(PCI_DEV(0, 0x14, 0), 0x54, 0x0707);
pci_write_config16(PCI_DEV(0, 0x14, 0), 0x56, 0x0bb0);
pci_write_config16(PCI_DEV(0, 0x14, 0), 0x5a, 0x0ff0);
+
+ if (CONFIG(MEASURED_BOOT) && CONFIG(LPC_TPM)) {
+ size_t bootblock_size = 0;
+ const void *bootblock = cbfs_boot_map_with_leak("bootblock", 1, &bootblock_size);
+ tlcl_measure(2, bootblock, bootblock_size);
+
+ extern char _romstage, _eromstage;
+ tlcl_measure(2, &_romstage, &_eromstage - &_romstage);
+ }
+
+
}

/**
@@ -718,3 +741,9 @@ BOOL AMD_CB_ManualBUIDSwapList (u8 node, u8 link, const u8 **List)

return 0;
}
+
+void platform_segment_loaded(uintptr_t start, size_t size, int flags)
+{
+ if (CONFIG(MEASURED_BOOT) && !(flags & SEG_NO_MEASURE))
+ tlcl_measure(2, (const void *) start, size);
+}

0 comments on commit d9f9be1

Please sign in to comment.