Wim Vervoorn has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38753 )
Change subject: mb/facebook/monolith: Use serial number and UUID from VPD ......................................................................
mb/facebook/monolith: Use serial number and UUID from VPD
The serial number and UUID returned by DMI are retrieved from VPD.
The solution supports a 16 character "serial_number" and a 36 character "UUID" string.
BUG=N/A TEST=tested on monolith
Change-Id: I0b6ce769cfa81a1e248a35f6149b7d1bbcf1f836 Signed-off-by: Wim Vervoorn wvervoorn@eltan.com --- M src/mainboard/facebook/monolith/ramstage.c 1 file changed, 35 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/53/38753/1
diff --git a/src/mainboard/facebook/monolith/ramstage.c b/src/mainboard/facebook/monolith/ramstage.c index bed1049..3e46b85 100644 --- a/src/mainboard/facebook/monolith/ramstage.c +++ b/src/mainboard/facebook/monolith/ramstage.c @@ -14,7 +14,14 @@ * GNU General Public License for more details. */
+#include <stdint.h> +#include <console/console.h> +#include <drivers/vpd/vpd.h> +#include <lib.h> +#include <smbios.h> #include <soc/ramstage.h> +#include <uuid.h> + #include "gpio.h"
void mainboard_silicon_init_params(FSP_SIL_UPD *params) @@ -24,3 +31,31 @@ gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table)); params->CdClock = 3; } + +#define VPD_KEY_SERIAL "serial_number" +#define VPD_KEY_UUID "UUID" +#define VPD_SERIAL_LEN 17 + +const char *smbios_system_serial_number(void) +{ + static char serial[VPD_SERIAL_LEN]; + + if (vpd_gets(VPD_KEY_SERIAL, serial, VPD_SERIAL_LEN, VPD_RO)) + return serial; + + printk(BIOS_ERR, "serial_number could not be read or invalid.\n"); + return ""; +} + +void smbios_system_set_uuid(u8 *uuid) +{ + static char vpd_uuid_string[UUID_STRLEN+1]; + + if (vpd_gets(VPD_KEY_UUID, vpd_uuid_string, UUID_STRLEN+1, VPD_RO)) { + if (parse_uuid(uuid, vpd_uuid_string)) + memset(uuid, 0, UUID_LEN); + else + return; + } + printk(BIOS_ERR, "UUID could not be read or invalid.\n"); +}
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38753 )
Change subject: mb/facebook/monolith: Use serial number and UUID from VPD ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/38753/1/src/mainboard/facebook/mono... File src/mainboard/facebook/monolith/ramstage.c:
https://review.coreboot.org/c/coreboot/+/38753/1/src/mainboard/facebook/mono... PS1, Line 57: else Statements should start on a tabstop
Frans Hendriks has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38753 )
Change subject: mb/facebook/monolith: Use serial number and UUID from VPD ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/38753/1/src/mainboard/facebook/mono... File src/mainboard/facebook/monolith/ramstage.c:
https://review.coreboot.org/c/coreboot/+/38753/1/src/mainboard/facebook/mono... PS1, Line 57: else
Statements should start on a tabstop
suggest: Use same handling in smbios_system_serial_number() and smbios_system_set_uuid()
if (vpd_gets(VPD_KEY_UUID, vpd_uuid_string, UUID_STRLEN+1, VPD_RO)) { if (!parse_uuid(uuid, vpd_uuid_string)) return; } memset(uuid, 0, UUID_LEN); printk(BIOS_ERR, "UUID could not be read or invalid.\n");
Hello Frans Hendriks, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/38753
to look at the new patch set (#2).
Change subject: mb/facebook/monolith: Use serial number and UUID from VPD ......................................................................
mb/facebook/monolith: Use serial number and UUID from VPD
The serial number and UUID returned by DMI are retrieved from VPD.
The solution supports a 16 character "serial_number" and a 36 character "UUID" string.
BUG=N/A TEST=tested on monolith
Change-Id: I0b6ce769cfa81a1e248a35f6149b7d1bbcf1f836 Signed-off-by: Wim Vervoorn wvervoorn@eltan.com --- M src/mainboard/facebook/monolith/ramstage.c 1 file changed, 34 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/53/38753/2
Wim Vervoorn has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38753 )
Change subject: mb/facebook/monolith: Use serial number and UUID from VPD ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/38753/1/src/mainboard/facebook/mono... File src/mainboard/facebook/monolith/ramstage.c:
https://review.coreboot.org/c/coreboot/+/38753/1/src/mainboard/facebook/mono... PS1, Line 57: else
suggest: Use same handling in smbios_system_serial_number() and smbios_system_set_uuid() […]
Done
Frans Hendriks has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38753 )
Change subject: mb/facebook/monolith: Use serial number and UUID from VPD ......................................................................
Patch Set 2: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/38753 )
Change subject: mb/facebook/monolith: Use serial number and UUID from VPD ......................................................................
mb/facebook/monolith: Use serial number and UUID from VPD
The serial number and UUID returned by DMI are retrieved from VPD.
The solution supports a 16 character "serial_number" and a 36 character "UUID" string.
BUG=N/A TEST=tested on monolith
Change-Id: I0b6ce769cfa81a1e248a35f6149b7d1bbcf1f836 Signed-off-by: Wim Vervoorn wvervoorn@eltan.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/38753 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Frans Hendriks fhendriks@eltan.com --- M src/mainboard/facebook/monolith/ramstage.c 1 file changed, 34 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Frans Hendriks: Looks good to me, approved
diff --git a/src/mainboard/facebook/monolith/ramstage.c b/src/mainboard/facebook/monolith/ramstage.c index bed1049..05cbf31 100644 --- a/src/mainboard/facebook/monolith/ramstage.c +++ b/src/mainboard/facebook/monolith/ramstage.c @@ -14,7 +14,14 @@ * GNU General Public License for more details. */
+#include <stdint.h> +#include <console/console.h> +#include <drivers/vpd/vpd.h> +#include <lib.h> +#include <smbios.h> #include <soc/ramstage.h> +#include <uuid.h> + #include "gpio.h"
void mainboard_silicon_init_params(FSP_SIL_UPD *params) @@ -24,3 +31,30 @@ gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table)); params->CdClock = 3; } + +#define VPD_KEY_SERIAL "serial_number" +#define VPD_KEY_UUID "UUID" +#define VPD_SERIAL_LEN 17 + +const char *smbios_system_serial_number(void) +{ + static char serial[VPD_SERIAL_LEN]; + + if (vpd_gets(VPD_KEY_SERIAL, serial, VPD_SERIAL_LEN, VPD_RO)) + return serial; + + printk(BIOS_ERR, "serial_number could not be read or invalid.\n"); + return ""; +} + +void smbios_system_set_uuid(u8 *uuid) +{ + static char vpd_uuid_string[UUID_STRLEN+1]; + + if (vpd_gets(VPD_KEY_UUID, vpd_uuid_string, UUID_STRLEN+1, VPD_RO)) + if (!parse_uuid(uuid, vpd_uuid_string)) + return; + + memset(uuid, 0, UUID_LEN); + printk(BIOS_ERR, "UUID could not be read or invalid.\n"); +}
9elements QA has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38753 )
Change subject: mb/facebook/monolith: Use serial number and UUID from VPD ......................................................................
Patch Set 3:
Automatic boot test returned (PASS/FAIL/TOTAL): 3/0/3 Emulation targets: EMULATION_QEMU_X86_Q35 using payload TianoCore : SUCCESS : https://lava.9esec.io/r/687 EMULATION_QEMU_X86_Q35 using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/686 EMULATION_QEMU_X86_I440FX using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/685
Please note: This test is under development and might not be accurate at all!