summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJulien Viard de Galbert <jviarddegalbert@online.net>2018-02-26 14:42:39 +0100
committerMartin Roth <martinroth@google.com>2018-03-07 21:13:01 +0000
commit4f226414dbf82475ceadbdbb2e04ef92b8fd5d2c (patch)
treed9b5befb8734646fd24c993559c0badb1f3a8fc9 /src
parent9a31dfeb1879b0100aa6a8590dd3e783e6da808c (diff)
downloadcoreboot-4f226414dbf82475ceadbdbb2e04ef92b8fd5d2c.tar.xz
mb/scaleway/tagada: populate smbios information
This is done by overriding the weak functions from smbios.c Some values are hardcoded as they are characteristics of the Tagada system. Other are retrieved from the BMC through the bmcinfo interface. Change-Id: I9b08660c6677864f5c96c66002b35bd05a366053 Signed-off-by: Julien Viard de Galbert <jviarddegalbert@online.net> Reviewed-on: https://review.coreboot.org/23843 Reviewed-by: Martin Roth <martinroth@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/scaleway/tagada/ramstage.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/mainboard/scaleway/tagada/ramstage.c b/src/mainboard/scaleway/tagada/ramstage.c
index 55cd17562e..3ee4a6ebde 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 @@ void mainboard_silicon_init_params(FSPS_UPD *params)
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_feature_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 */
+smbios_board_type smbios_mainboard_board_type(void)
+{
+ return SMBIOS_BOARD_TYPE_SERVER_BLADE;
+}