summaryrefslogtreecommitdiff
path: root/drivers/sysinfo
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/sysinfo')
-rw-r--r--drivers/sysinfo/Kconfig8
-rw-r--r--drivers/sysinfo/Makefile1
-rw-r--r--drivers/sysinfo/smbios.c24
3 files changed, 33 insertions, 0 deletions
diff --git a/drivers/sysinfo/Kconfig b/drivers/sysinfo/Kconfig
index 39141500a0..85c1e81e41 100644
--- a/drivers/sysinfo/Kconfig
+++ b/drivers/sysinfo/Kconfig
@@ -22,4 +22,12 @@ config SYSINFO_SANDBOX
help
Support querying device information for the Sandbox boards.
+config SYSINFO_SMBIOS
+ bool "Provide a default sysinfo driver for SMBIOS information"
+ help
+ Some boards want to specify the manufacturer or product name but do
+ not need to have their own sysinfo driver. This includes a default
+ one which provides a way to specify this SMBIOS information in the
+ devicetree, without needing any board-specific functionality.
+
endif
diff --git a/drivers/sysinfo/Makefile b/drivers/sysinfo/Makefile
index aecf0b0d47..6d04fcba1d 100644
--- a/drivers/sysinfo/Makefile
+++ b/drivers/sysinfo/Makefile
@@ -5,3 +5,4 @@
obj-y += sysinfo-uclass.o
obj-$(CONFIG_SYSINFO_GAZERBEAM) += gazerbeam.o
obj-$(CONFIG_SYSINFO_SANDBOX) += sandbox.o
+obj-$(CONFIG_SYSINFO_SMBIOS) += smbios.o
diff --git a/drivers/sysinfo/smbios.c b/drivers/sysinfo/smbios.c
new file mode 100644
index 0000000000..80ebd1921d
--- /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,
+};