Matt DeVillier has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/41040 )
Change subject: mb/purism/librem_skl: select DRIVERS_GENERIC_CBFS_SERIAL ......................................................................
mb/purism/librem_skl: select DRIVERS_GENERIC_CBFS_SERIAL
This driver was previously added for another out-of-tree Librem device, but forgot to switch over the librem_skl boards to use it. Remove duplicate functionality from mainboard.c and delete the empty file.
Test: build/boot Librem 13v2 and verify serial number read from CBFS via dmidecode.
Signed-off-by: Matt DeVillier matt.devillier@puri.sm Change-Id: Ide952197335c6bfbad846c6d6f62be5c4c57e2cb --- M src/mainboard/purism/librem_skl/Kconfig D src/mainboard/purism/librem_skl/mainboard.c 2 files changed, 1 insertion(+), 38 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/41040/1
diff --git a/src/mainboard/purism/librem_skl/Kconfig b/src/mainboard/purism/librem_skl/Kconfig index c1a9aec..9760a2f 100644 --- a/src/mainboard/purism/librem_skl/Kconfig +++ b/src/mainboard/purism/librem_skl/Kconfig @@ -1,6 +1,7 @@ config BOARD_PURISM_BASEBOARD_LIBREM_SKL def_bool n select BOARD_ROMSIZE_KB_16384 + select DRIVERS_GENERIC_CBFS_SERIAL select HAVE_ACPI_RESUME select HAVE_ACPI_TABLES select INTEL_GMA_HAVE_VBT diff --git a/src/mainboard/purism/librem_skl/mainboard.c b/src/mainboard/purism/librem_skl/mainboard.c deleted file mode 100644 index eb28262..0000000 --- a/src/mainboard/purism/librem_skl/mainboard.c +++ /dev/null @@ -1,38 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* This file is part of the coreboot project. */ - -#include <smbios.h> -#include <string.h> -#include <cbfs.h> - -#define MAX_SERIAL_LENGTH 0x100 - -const char *smbios_mainboard_serial_number(void) -{ - static char serial_number[MAX_SERIAL_LENGTH + 1] = {0}; - struct cbfsf file; - - if (serial_number[0] != 0) - return serial_number; - - if (cbfs_boot_locate(&file, "serial_number", NULL) == 0) { - struct region_device cbfs_region; - size_t serial_len; - - cbfs_file_data(&cbfs_region, &file); - - serial_len = region_device_sz(&cbfs_region); - if (serial_len <= MAX_SERIAL_LENGTH) { - if (rdev_readat(&cbfs_region, serial_number, 0, - serial_len) == serial_len) { - serial_number[serial_len] = 0; - return serial_number; - } - } - } - - strncpy(serial_number, CONFIG_MAINBOARD_SERIAL_NUMBER, - MAX_SERIAL_LENGTH); - - return serial_number; -}
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41040 )
Change subject: mb/purism/librem_skl: select DRIVERS_GENERIC_CBFS_SERIAL ......................................................................
Patch Set 1: Code-Review+1
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41040 )
Change subject: mb/purism/librem_skl: select DRIVERS_GENERIC_CBFS_SERIAL ......................................................................
Patch Set 1: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/41040 )
Change subject: mb/purism/librem_skl: select DRIVERS_GENERIC_CBFS_SERIAL ......................................................................
mb/purism/librem_skl: select DRIVERS_GENERIC_CBFS_SERIAL
This driver was previously added for another out-of-tree Librem device, but forgot to switch over the librem_skl boards to use it. Remove duplicate functionality from mainboard.c and delete the empty file.
Test: build/boot Librem 13v2 and verify serial number read from CBFS via dmidecode.
Signed-off-by: Matt DeVillier matt.devillier@puri.sm Change-Id: Ide952197335c6bfbad846c6d6f62be5c4c57e2cb Reviewed-on: https://review.coreboot.org/c/coreboot/+/41040 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Paul Menzel paulepanter@users.sourceforge.net Reviewed-by: Patrick Georgi pgeorgi@google.com --- M src/mainboard/purism/librem_skl/Kconfig D src/mainboard/purism/librem_skl/mainboard.c 2 files changed, 1 insertion(+), 38 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved Paul Menzel: Looks good to me, but someone else must approve
diff --git a/src/mainboard/purism/librem_skl/Kconfig b/src/mainboard/purism/librem_skl/Kconfig index c1a9aec..9760a2f 100644 --- a/src/mainboard/purism/librem_skl/Kconfig +++ b/src/mainboard/purism/librem_skl/Kconfig @@ -1,6 +1,7 @@ config BOARD_PURISM_BASEBOARD_LIBREM_SKL def_bool n select BOARD_ROMSIZE_KB_16384 + select DRIVERS_GENERIC_CBFS_SERIAL select HAVE_ACPI_RESUME select HAVE_ACPI_TABLES select INTEL_GMA_HAVE_VBT diff --git a/src/mainboard/purism/librem_skl/mainboard.c b/src/mainboard/purism/librem_skl/mainboard.c deleted file mode 100644 index eb28262..0000000 --- a/src/mainboard/purism/librem_skl/mainboard.c +++ /dev/null @@ -1,38 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* This file is part of the coreboot project. */ - -#include <smbios.h> -#include <string.h> -#include <cbfs.h> - -#define MAX_SERIAL_LENGTH 0x100 - -const char *smbios_mainboard_serial_number(void) -{ - static char serial_number[MAX_SERIAL_LENGTH + 1] = {0}; - struct cbfsf file; - - if (serial_number[0] != 0) - return serial_number; - - if (cbfs_boot_locate(&file, "serial_number", NULL) == 0) { - struct region_device cbfs_region; - size_t serial_len; - - cbfs_file_data(&cbfs_region, &file); - - serial_len = region_device_sz(&cbfs_region); - if (serial_len <= MAX_SERIAL_LENGTH) { - if (rdev_readat(&cbfs_region, serial_number, 0, - serial_len) == serial_len) { - serial_number[serial_len] = 0; - return serial_number; - } - } - } - - strncpy(serial_number, CONFIG_MAINBOARD_SERIAL_NUMBER, - MAX_SERIAL_LENGTH); - - return serial_number; -}
9elements QA has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41040 )
Change subject: mb/purism/librem_skl: select DRIVERS_GENERIC_CBFS_SERIAL ......................................................................
Patch Set 2:
Automatic boot test returned (PASS/FAIL/TOTAL): 4/0/4 Emulation targets: "QEMU x86 q35/ich9" using payload TianoCore : SUCCESS : https://lava.9esec.io/r/3223 "QEMU x86 q35/ich9" using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/3222 "QEMU x86 i440fx/piix4" using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/3221 "QEMU AArch64" using payload LinuxBoot_u-root_kexec : SUCCESS : https://lava.9esec.io/r/3220
Please note: This test is under development and might not be accurate at all!