summaryrefslogtreecommitdiff
path: root/drivers/sysinfo/smbios.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-11-05 06:32:11 -0700
committerBin Meng <bmeng.cn@gmail.com>2020-11-06 10:18:20 +0800
commit44c74bdd5828c885b97a1518b9d85239a1020c6c (patch)
tree93c7b4344741ebde63b5e143dbc10ee75d4dba35 /drivers/sysinfo/smbios.c
parentf96965315489fcb7fc9df8fe4da0137150bb3826 (diff)
sysinfo: Provide a default driver to set SMBIOS values
Some boards want to specify the manufacturer or product name but do not need to have their own sysinfo driver. Add a default driver which provides a way to specify this SMBIOS information in the devicetree, without needing any board-specific functionality. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/sysinfo/smbios.c')
-rw-r--r--drivers/sysinfo/smbios.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/sysinfo/smbios.c b/drivers/sysinfo/smbios.c
new file mode 100644
index 00000000000..80ebd1921d8
--- /dev/null
+++ b/drivers/sysinfo/smbios.c
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2020 Google LLC
+ * Written by Simon Glass <sjg@chromium.org>
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <sysinfo.h>
+
+static const struct udevice_id sysinfo_smbios_ids[] = {
+ { .compatible = "u-boot,sysinfo-smbios" },
+ { /* sentinel */ }
+};
+
+static const struct sysinfo_ops sysinfo_smbios_ops = {
+};
+
+U_BOOT_DRIVER(sysinfo_smbios) = {
+ .name = "sysinfo_smbios",
+ .id = UCLASS_SYSINFO,
+ .of_match = sysinfo_smbios_ids,
+ .ops = &sysinfo_smbios_ops,
+};