[coreboot-gerrit] Change in coreboot[master]: mb/scaleway/tagada: populate smbios information
Julien Viard de Galbert (Code Review)
gerrit at coreboot.org
Thu Feb 22 16:44:48 CET 2018
Julien Viard de Galbert has uploaded this change for review. ( https://review.coreboot.org/23843
Change subject: mb/scaleway/tagada: populate smbios information
......................................................................
mb/scaleway/tagada: populate smbios information
Change-Id: I9b08660c6677864f5c96c66002b35bd05a366053
Signed-off-by: Julien Viard de Galbert <jviarddegalbert at online.net>
---
M src/mainboard/scaleway/tagada/ramstage.c
1 file changed, 57 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/43/23843/1
diff --git a/src/mainboard/scaleway/tagada/ramstage.c b/src/mainboard/scaleway/tagada/ramstage.c
index 55cd175..a56a95e 100644
--- a/src/mainboard/scaleway/tagada/ramstage.c
+++ b/src/mainboard/scaleway/tagada/ramstage.c
@@ -15,9 +15,11 @@
*
*/
+#include <string.h>
#include <console/console.h>
#include <fsp/api.h>
#include <soc/ramstage.h>
+#include <smbios.h>
#include "bmcinfo.h"
@@ -29,3 +31,58 @@
if (bmcinfo_disable_nic1())
params->FspsConfig.PcdEnableGbE = 2; // disable lan 1 only
}
+
+/* Override smbios_mainboard_serial_number to retrieve it from BMC */
+const char *smbios_mainboard_serial_number(void)
+{
+ const char *bmc_serial = bmcinfo_serial();
+ if (bmc_serial)
+ return bmc_serial;
+ return CONFIG_MAINBOARD_SERIAL_NUMBER;
+}
+
+/* Override smbios_mainboard_set_uuid */
+void smbios_mainboard_set_uuid(u8 *uuid)
+{
+ const u8 *bmc_uuid = bmcinfo_uuid();
+ if (bmc_uuid)
+ memcpy(uuid, bmc_uuid, 16);
+ /* leave all zero */
+}
+
+/* Override smbios_mainboard_version */
+const char *smbios_mainboard_version(void)
+{
+ const int hwRev = bmcinfo_hwrev();
+ switch (hwRev) {
+ case 0:
+ return "Z0";
+ case 1:
+ return "A0";
+ case 2:
+ return "A1";
+ }
+ return "";
+}
+
+/* Override smbios_mainboard_features_flags */
+u8 smbios_mainboard_features_flags(void)
+{
+ return 0xc;
+}
+
+/* Override smbios_mainboard_location_in_chassis */
+const char *smbios_mainboard_location_in_chassis(void)
+{
+ static char location[4] = "n/a";
+ int slot = bmcinfo_slot();
+ if (slot >= 0)
+ snprintf(location, 4, "N%d", slot);
+ return location;
+}
+
+/* Override smbios_mainboard_board_type */
+u8 smbios_mainboard_board_type(void)
+{
+ return 0x3;
+}
--
To view, visit https://review.coreboot.org/23843
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b08660c6677864f5c96c66002b35bd05a366053
Gerrit-Change-Number: 23843
Gerrit-PatchSet: 1
Gerrit-Owner: Julien Viard de Galbert <jviarddegalbert at online.net>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180222/e009148c/attachment.html>
More information about the coreboot-gerrit
mailing list