Hello Mike Banon,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/31944
to review the following change.
Change subject: G505S AtomBIOS ROMs: known good binaries with a script to check their SHA256
......................................................................
G505S AtomBIOS ROMs: known good binaries with a script to check their SHA256
This change is a mirror for the known good AMD Lenovo G505S AtomBIOS ROMs from
this repository - https://github.com/g505s-opensource-researcher/g505s-atombios
AtomBIOS ROMs are required to enable the integrated and discrete VGA adapters,
however to add the discrete GPU support you will also need to apply these patches:
https://review.coreboot.org/c/coreboot/+/31929
G505S dGPU support: scripts for applying the unofficial (not-merged-yet) patches
Here are the SHA256 checksums for these AtomBIOS ROMs:
6104e6989ea3f494d7bfa30573bf38e830f1068bab9980caec5e890e0ccbfced
./pci1002,990b.rom - for integrated GPU (iGPU) HD-8650G
6052b5def3fda2a93f6c4d55ec91b819429e212e26cdb8e0fcca54599c9c92ed
./pci1002,6663.rom - for discrete GPU (dGPU) HD-8570M
15d74515332bc512de66e0dc910d8600aeb134bf715bbc34a4faac0257f4a0dc
./pci1002,6665.rom - for discrete GPU (dGPU) R5-M230
Save to ./coreboot/ then run ./extract_atombios_roms.sh and ./check... . Could
analyze these ROMs with AtomDis - https://cgit.freedesktop.org/~mhopf/AtomDis/
pci1002,990b.rom (for iGPU HD-8650G) has been taken from G505S with R5-M230, and
despite the tiny voltage difference - it's working great for all G505S versions.
https://mail.coreboot.org/hyperkitty/list/coreboot@coreboot.org/thread/
GZNWISLFHUTYN6C7RTWSQUMJIFOUHMED/
Signed-off-by: Mike Banon <mikebdp2(a)gmail.com>
Change-Id: I0cb38927e3f5ae0f0850ca8bc79be791c51ae503
---
A check_atombios_roms.sh
A extract_atombios_roms.sh
A pci1002,6663.rom.txt
A pci1002,6665.rom.txt
A pci1002,990b.rom.txt
A sha256sums_atombios_correct.txt
6 files changed, 8,082 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/44/31944/1
--
To view, visit https://review.coreboot.org/c/coreboot/+/31944
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I0cb38927e3f5ae0f0850ca8bc79be791c51ae503
Gerrit-Change-Number: 31944
Gerrit-PatchSet: 1
Gerrit-Owner: mikeb mikeb <mikebdp2(a)gmail.com>
Gerrit-Reviewer: Mike Banon <mikebdp2(a)gmail.com>
Gerrit-MessageType: newchange
Hello Mike Banon,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/31357
to review the following change.
Change subject: src/mainboard/lenovo/g505s: Disable SeaBIOS options not supported by hardware
......................................................................
src/mainboard/lenovo/g505s: Disable SeaBIOS options not supported by hardware
G505S does not have any SAS or NVMe controllers and could not have a TPM,
so it makes sense to disable the related SeaBIOS options for this laptop.
Signed-off-by: Mike Banon <mikebdp2(a)gmail.com>
Change-Id: I5b2ee6403d7d2298725729d8d833e37627a4f202
---
M src/mainboard/lenovo/g505s/Kconfig
A src/mainboard/lenovo/g505s/config_seabios
2 files changed, 10 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/57/31357/1
diff --git a/src/mainboard/lenovo/g505s/Kconfig b/src/mainboard/lenovo/g505s/Kconfig
index 883ef27..71ab909 100644
--- a/src/mainboard/lenovo/g505s/Kconfig
+++ b/src/mainboard/lenovo/g505s/Kconfig
@@ -55,4 +55,8 @@
string
default "1002,990b"
+config PAYLOAD_CONFIGFILE
+ string
+ default "$(top)/src/mainboard/$(MAINBOARDDIR)/config_seabios" if PAYLOAD_SEABIOS
+
endif # BOARD_LENOVO_G505S
diff --git a/src/mainboard/lenovo/g505s/config_seabios b/src/mainboard/lenovo/g505s/config_seabios
new file mode 100644
index 0000000..8d3957b
--- /dev/null
+++ b/src/mainboard/lenovo/g505s/config_seabios
@@ -0,0 +1,6 @@
+#
+# SeaBIOS custom configuration for Lenovo G505S
+#
+# CONFIG_MEGASAS is not set
+# CONFIG_NVME is not set
+# CONFIG_TCGBIOS is not set
--
To view, visit https://review.coreboot.org/c/coreboot/+/31357
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I5b2ee6403d7d2298725729d8d833e37627a4f202
Gerrit-Change-Number: 31357
Gerrit-PatchSet: 1
Gerrit-Owner: mikeb mikeb <mikebdp2(a)gmail.com>
Gerrit-Reviewer: Mike Banon <mikebdp2(a)gmail.com>
Gerrit-MessageType: newchange
Keith Short has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31800
Change subject: security/vboot: Add VBNV flags to save the Cr50 recovery switch state
......................................................................
security/vboot: Add VBNV flags to save the Cr50 recovery switch state
Add flags to save the Cr50 recovery switch state. This ensures that the
Cr50 recovery switch state is only read during verstage.
BUG=b:123360379
BRANCH=none
TEST=build coreboot on sarien and arcada. Test normal boot and recovery
boot on arcada - confirm that that tpm transaction errors are gone.
Change-Id: Id30a7b203e5aac8631971eb102986427b8362a71
Signed-off-by: Keith Short <keithshort(a)chromium.org>
---
M src/mainboard/google/sarien/chromeos.c
M src/security/vboot/vbnv.c
M src/security/vboot/vbnv.h
M src/security/vboot/vbnv_layout.h
4 files changed, 71 insertions(+), 20 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/00/31800/1
diff --git a/src/mainboard/google/sarien/chromeos.c b/src/mainboard/google/sarien/chromeos.c
index 1e363fd..308b682 100644
--- a/src/mainboard/google/sarien/chromeos.c
+++ b/src/mainboard/google/sarien/chromeos.c
@@ -20,18 +20,12 @@
#include <variant/gpio.h>
#include <vendorcode/google/chromeos/chromeos.h>
#include <security/tpm/tss.h>
+#include <security/vboot/vbnv.h>
#include <device/device.h>
#include <intelblocks/pmclib.h>
#include <soc/pmc.h>
#include <soc/pci_devs.h>
-enum rec_mode_state {
- REC_MODE_UNINITIALIZED,
- REC_MODE_NOT_REQUESTED,
- REC_MODE_REQUESTED,
-};
-static enum rec_mode_state saved_rec_mode;
-
void fill_lb_gpios(struct lb_gpios *gpios)
{
struct lb_gpio chromeos_gpios[] = {
@@ -84,30 +78,33 @@
int get_recovery_mode_switch(void)
{
- enum rec_mode_state state = saved_rec_mode;
+ int rec_switch;
uint8_t recovery_button_state = 0;
- /* Check the global variable first. */
- if (state == REC_MODE_NOT_REQUESTED)
- return 0;
- else if (state == REC_MODE_REQUESTED)
- return 1;
+ /*
+ * Only verstage performs a real check of the Cr50 recovery switch.
+ * The recovery switch state is cleared on the first access by the AP
+ * so there's no point in querying the Cr50 at later stages. All other
+ * stages use the state saved in VBNV.
+ */
+ if (!ENV_VERSTAGE &&
+ !get_recovery_switch_from_vbnv(&rec_switch))
+ return rec_switch;
- state = REC_MODE_NOT_REQUESTED;
+ rec_switch = 0;
/* Read state from the GPIO controlled by servo. */
if (cros_get_gpio_value(CROS_GPIO_REC))
- state = REC_MODE_REQUESTED;
+ rec_switch = 1;
/* Read one-time recovery request from cr50. */
else if (tlcl_cr50_get_recovery_button(&recovery_button_state)
== TPM_SUCCESS)
- state = recovery_button_state ?
- REC_MODE_REQUESTED : REC_MODE_NOT_REQUESTED;
+ rec_switch = !!recovery_button_state;
/* Store the state in case this is called again in verstage. */
- saved_rec_mode = state;
+ set_recovery_switch_into_vbnv(rec_switch);
- return state == REC_MODE_REQUESTED;
+ return rec_switch;
}
int get_lid_switch(void)
diff --git a/src/security/vboot/vbnv.c b/src/security/vboot/vbnv.c
index 636e5e3..8156fc5 100644
--- a/src/security/vboot/vbnv.c
+++ b/src/security/vboot/vbnv.c
@@ -140,6 +140,42 @@
return vbnv_data(RECOVERY_OFFSET);
}
+/* Save the recovery switch state into VBNV. */
+void set_recovery_switch_into_vbnv(int recovery_switch)
+{
+ uint8_t vbnv_copy[VBOOT_VBNV_BLOCK_SIZE];
+
+ read_vbnv(vbnv_copy);
+
+ vbnv_copy[MISC_FLAGS_OFFSET] |= MISC_FLAGS_RECOVERY_SWITCH_VALID_MASK;
+ if (recovery_switch)
+ vbnv_copy[MISC_FLAGS_OFFSET] |=
+ MISC_FLAGS_RECOVERY_SWITCH_STATE_MASK;
+ else
+ vbnv_copy[MISC_FLAGS_OFFSET] &=
+ ~MISC_FLAGS_RECOVERY_SWITCH_STATE_MASK;
+
+ vbnv_copy[CRC_OFFSET] = crc8_vbnv(vbnv_copy, CRC_OFFSET);
+
+ save_vbnv(vbnv_copy);
+}
+
+/* Read the recovery switch state from VBNV. */
+int get_recovery_switch_from_vbnv(int *recovery_switch)
+{
+ uint8_t misc_flags;
+ vbnv_setup();
+ misc_flags = vbnv_data(MISC_FLAGS_OFFSET);
+
+ if (!(misc_flags & MISC_FLAGS_RECOVERY_SWITCH_VALID_MASK))
+ return -1;
+
+ *recovery_switch =
+ !!(misc_flags & MISC_FLAGS_RECOVERY_SWITCH_STATE_MASK);
+
+ return 0;
+}
+
/* Read the BOOT_OPROM_NEEDED flag from VBNV. */
int vboot_wants_oprom(void)
{
diff --git a/src/security/vboot/vbnv.h b/src/security/vboot/vbnv.h
index c8e689f..367a376 100644
--- a/src/security/vboot/vbnv.h
+++ b/src/security/vboot/vbnv.h
@@ -25,6 +25,22 @@
void regen_vbnv_crc(uint8_t *vbnv_copy);
int get_recovery_mode_from_vbnv(void);
void set_recovery_mode_into_vbnv(int recovery_reason);
+
+/**
+ * Save the recovery switch state into VBNV
+ *
+ * @param recovery_switch Current state of the recovery switch.
+ */
+void set_recovery_switch_into_vbnv(int recovery_switch);
+/**
+ * Get the recovery switch date from VBNV
+ *
+ * @param recovery_switch On success, set to the saved recovery switch state.
+ *
+ * @return 0 on success, !=0 if recovery switch state not saved.
+ */
+int get_recovery_switch_from_vbnv(int *recovery_switch);
+
int vboot_wants_oprom(void);
/* Read the USB Device Controller(UDC) enable flag from VBNV. */
diff --git a/src/security/vboot/vbnv_layout.h b/src/security/vboot/vbnv_layout.h
index a9326e4..322fcf7 100644
--- a/src/security/vboot/vbnv_layout.h
+++ b/src/security/vboot/vbnv_layout.h
@@ -43,7 +43,9 @@
#define DEV_ENABLE_UDC 0x40
#define MISC_FLAGS_OFFSET 8
-#define MISC_FLAGS_BATTERY_CUTOFF_MASK 0x08
+#define MISC_FLAGS_BATTERY_CUTOFF_MASK 0x08
+#define MISC_FLAGS_RECOVERY_SWITCH_VALID_MASK 0x10
+#define MISC_FLAGS_RECOVERY_SWITCH_STATE_MASK 0x20
#define KERNEL_FIELD_OFFSET 11
#define CRC_OFFSET 15
--
To view, visit https://review.coreboot.org/c/coreboot/+/31800
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Id30a7b203e5aac8631971eb102986427b8362a71
Gerrit-Change-Number: 31800
Gerrit-PatchSet: 1
Gerrit-Owner: Keith Short <keithshort(a)chromium.org>
Gerrit-MessageType: newchange
Keith Short has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31801
Change subject: mainboard/sarien: Save the Cr50 recovery switch state in VBNV
......................................................................
mainboard/sarien: Save the Cr50 recovery switch state in VBNV
Update sarien so the Cr50 recovery switch is only read during verstage
and save the recovery switch state to VBNV.
BUG=b:123360379
BRANCH=none
TEST=build coreboot on sarien and arcada. Test normal boot and recovery
boot on arcada - confirm that that tpm transaction errors are gone.
Change-Id: Iadf0cec651b3a26ceebadfeb637e189805c328bf
Signed-off-by: Keith Short <keithshort(a)chromium.org>
---
M src/mainboard/google/sarien/chromeos.c
1 file changed, 16 insertions(+), 19 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/01/31801/1
diff --git a/src/mainboard/google/sarien/chromeos.c b/src/mainboard/google/sarien/chromeos.c
index 1e363fd..308b682 100644
--- a/src/mainboard/google/sarien/chromeos.c
+++ b/src/mainboard/google/sarien/chromeos.c
@@ -20,18 +20,12 @@
#include <variant/gpio.h>
#include <vendorcode/google/chromeos/chromeos.h>
#include <security/tpm/tss.h>
+#include <security/vboot/vbnv.h>
#include <device/device.h>
#include <intelblocks/pmclib.h>
#include <soc/pmc.h>
#include <soc/pci_devs.h>
-enum rec_mode_state {
- REC_MODE_UNINITIALIZED,
- REC_MODE_NOT_REQUESTED,
- REC_MODE_REQUESTED,
-};
-static enum rec_mode_state saved_rec_mode;
-
void fill_lb_gpios(struct lb_gpios *gpios)
{
struct lb_gpio chromeos_gpios[] = {
@@ -84,30 +78,33 @@
int get_recovery_mode_switch(void)
{
- enum rec_mode_state state = saved_rec_mode;
+ int rec_switch;
uint8_t recovery_button_state = 0;
- /* Check the global variable first. */
- if (state == REC_MODE_NOT_REQUESTED)
- return 0;
- else if (state == REC_MODE_REQUESTED)
- return 1;
+ /*
+ * Only verstage performs a real check of the Cr50 recovery switch.
+ * The recovery switch state is cleared on the first access by the AP
+ * so there's no point in querying the Cr50 at later stages. All other
+ * stages use the state saved in VBNV.
+ */
+ if (!ENV_VERSTAGE &&
+ !get_recovery_switch_from_vbnv(&rec_switch))
+ return rec_switch;
- state = REC_MODE_NOT_REQUESTED;
+ rec_switch = 0;
/* Read state from the GPIO controlled by servo. */
if (cros_get_gpio_value(CROS_GPIO_REC))
- state = REC_MODE_REQUESTED;
+ rec_switch = 1;
/* Read one-time recovery request from cr50. */
else if (tlcl_cr50_get_recovery_button(&recovery_button_state)
== TPM_SUCCESS)
- state = recovery_button_state ?
- REC_MODE_REQUESTED : REC_MODE_NOT_REQUESTED;
+ rec_switch = !!recovery_button_state;
/* Store the state in case this is called again in verstage. */
- saved_rec_mode = state;
+ set_recovery_switch_into_vbnv(rec_switch);
- return state == REC_MODE_REQUESTED;
+ return rec_switch;
}
int get_lid_switch(void)
--
To view, visit https://review.coreboot.org/c/coreboot/+/31801
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iadf0cec651b3a26ceebadfeb637e189805c328bf
Gerrit-Change-Number: 31801
Gerrit-PatchSet: 1
Gerrit-Owner: Keith Short <keithshort(a)chromium.org>
Gerrit-MessageType: newchange
Piotr Kleinschmidt has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33146
Change subject: Documentation: How to run coreboot on PC Engines APU2
......................................................................
Documentation: How to run coreboot on PC Engines APU2
There is no documentation about running coreboot on apu2 platform,
so now it describes how to do this.
Change-Id: Id1d553c7f7485358960d92e714d50ba0f75b3581
Signed-off-by: Piotr Kleinschmidt <piotr.kleinschmidt(a)3mdeb.com>
---
A Documentation/mainboard/pcengines/apu2.jpg
A Documentation/mainboard/pcengines/apu2.md
A Documentation/mainboard/pcengines/apu2_spi.jpg
3 files changed, 110 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/33146/1
diff --git a/Documentation/mainboard/pcengines/apu2.jpg b/Documentation/mainboard/pcengines/apu2.jpg
new file mode 100644
index 0000000..d221857
--- /dev/null
+++ b/Documentation/mainboard/pcengines/apu2.jpg
Binary files differ
diff --git a/Documentation/mainboard/pcengines/apu2.md b/Documentation/mainboard/pcengines/apu2.md
new file mode 100644
index 0000000..a8aa3d2
--- /dev/null
+++ b/Documentation/mainboard/pcengines/apu2.md
@@ -0,0 +1,110 @@
+# PC Engines APU2
+
+This page describes how to run coreboot on PC Engines APU2 platform.
+
+## Technology
+
+```eval_rst
++------------+---------------------------------------------------------------+
+| CPU | AMD G series GX-412TC |
++------------+---------------------------------------------------------------+
+| CPU core | 1 GHz quad Jaguar core with 64 bit support |
+| | 32K data + 32K instruction cache per core, shared 2MB L2 cache|
++------------+---------------------------------------------------------------+
+| DRAM | 2 or 4 GB DDR3-1333 DRAM |
++------------+---------------------------------------------------------------+
+| Boot | From SD card, USB, mSATA SSD, SATA |
++------------+---------------------------------------------------------------+
+| Power | 6 to 12W of 12V power |
++------------+---------------------------------------------------------------+
+| Firmware | coreboot with support for iPXE and USB boot |
++------------+---------------------------------------------------------------+
+```
+
+## Required proprietary blobs
+
+To build working coreboot image some blobs are needed.
+
+```eval_rst
++-----------------+---------------------------------+---------------------+
+| Binary file | Apply | Required / Optional |
++=====================+=============================+=====================+
+| AmdPubKey.bin | AMD Platform Security Processor | Required |
++-----------------+---------------------------------+---------------------+
+| AGESA.bin | AGESA Platform Initialization | Required |
++-----------------+---------------------------------+---------------------+
+| xhci.bin | AMD XHCI controller | Optional |
++-----------------+---------------------------------+---------------------+
+```
+
+## Flashing coreboot
+
+```eval_rst
++---------------------+--------------------------+
+| Type | Value |
++=====================+==========================+
+| Socketed flash | no |
++---------------------+--------------------------+
+| Model | MX25L1606E |
++---------------------+--------------------------+
+| Size | 2 MiB |
++---------------------+--------------------------+
+| Package | SOP-8 |
++---------------------+--------------------------+
+| Write protection | jumper on WP# pin |
++---------------------+--------------------------+
+| Dual BIOS feature | no |
++---------------------+--------------------------+
+| Internal flashing | Super IO Nuvoton NCT5104D|
++---------------------+--------------------------+
+```
+
+### Internal programming
+
+The SPI flash can be accessed using [flashrom]. It is important to execute
+command with a `-c <chipname>` argument:
+
+ flashrom -p internal -c "MX25L1606E" -w coreboot.rom
+
+### External programming
+
+**IMPORTANT**: When programming SPI flash, first you need to enter apu2 in S5
+(Soft-off) power state. S5 state can be forced by shorting power button pin on
+J2 header.
+
+The external access to flash chip is available through standard SOP-8 clip or
+SOP-8 header next to the flash chip on the board. Notice that not all boards
+have a header soldered down originally. Hence, there could be an empty slot with
+8 eyelets, so you can solder down a header on your own. The SPI flash chip and
+SPI header are marked in the picture below. Also there is SPI header and SPI
+flash pin layout included.
+
+There is no restrictions as to the programmer device. It is only recommended to
+flash firmware without supplying power. External programming can be performed,
+for example using OrangePi and Armbian. You can exploit linux_spi driver which
+provide communication with SPI devices. Example command to program SPI flash
+with OrangePi using linux_spi:
+
+ flashrom -f -w coreboot.rom -p linux_spi:dev=/dev/spidev1.0,spispeed=16000
+
+
+**apu2 platform with marked in SPI header and SPI flash chip**
+
+![][apu2_flash]
+
+**SPI header pin layout**
+
+![][spi_header]
+
+
+## Schematics
+
+PC Engines APU2 platform schematics are available for free on PC Engines
+official site. Depending on the configuration:
+- [apu2b](https://www.pcengines.ch/schema/apu2b.pdf)
+- [apu2c](https://www.pcengines.ch/schema/apu2c.pdf)
+- [apu2d](https://www.pcengines.ch/schema/apu2d.pdf)
+
+[apu2_flash]: apu2.jpg
+[spi_header]: apu2_spi.jpg
+[flashrom]: https://flashrom.org/Flashrom
diff --git a/Documentation/mainboard/pcengines/apu2_spi.jpg b/Documentation/mainboard/pcengines/apu2_spi.jpg
new file mode 100644
index 0000000..f8a5b58
--- /dev/null
+++ b/Documentation/mainboard/pcengines/apu2_spi.jpg
Binary files differ
--
To view, visit https://review.coreboot.org/c/coreboot/+/33146
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Id1d553c7f7485358960d92e714d50ba0f75b3581
Gerrit-Change-Number: 33146
Gerrit-PatchSet: 1
Gerrit-Owner: Piotr Kleinschmidt <piotr.kleinschmidt(a)3mdeb.com>
Gerrit-MessageType: newchange