Skip to contentSkip to conversation

riscv: dmi: Add SMBIOS/DMI support

PATCH Applied Haibo Xu 6 participants 8 messages Mar 18, 2024 – Jun 27, 2024

Subsystems (2)

v2 of 3 Applied 1/1 Latest is v3 →

lore
Share & tools
lore

Haibo Xu

author
#0 lore raw

PATCH v2 1/1 riscv: dmi: Add SMBIOS/DMI support

Enable the dmi driver for riscv which would allow access the SMBIOS info through some userspace file(/sys/firmware/dmi/*).

The change was based on that of arm64 and has been verified by dmidecode tool.

---
Changes since v1
- Change to use memremap/memunmap for dmi_(early)_remap/unmap definition(suggested by Ard)
- Minor clean up for comments (Ard)

---
 arch/riscv/Kconfig                   | 11 +++++++++++
 arch/riscv/include/asm/dmi.h         | 24 ++++++++++++++++++++++++
 drivers/firmware/efi/riscv-runtime.c | 13 +++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 arch/riscv/include/asm/dmi.h
arch/riscv/Kconfig +11 -0
index 8ebafe337eac..3639151cb4ef 100644
@@ -952,6 +952,17 @@ config EFI
 	  allow the kernel to be booted as an EFI application. This
 	  is only useful on systems that have UEFI firmware.
 
+config DMI
+	bool "Enable support for SMBIOS (DMI) tables"
+	depends on EFI
+	default y
+	help
+	  This enables SMBIOS/DMI feature for systems.
+
+	  This option is only useful on systems that have UEFI firmware.
+	  However, even with this option, the resultant kernel should
+	  continue to boot on existing non-UEFI platforms.
+
 config CC_HAVE_STACKPROTECTOR_TLS
 	def_bool $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=tp -mstack-protector-guard-offset=0)
 
arch/riscv/include/asm/dmi.h new file +24 -0
new file mode 100644
index 000000000000..ca7cce557ef7
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2024 Intel Corporation
+ *
+ * based on arch/arm64/include/asm/dmi.h
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#ifndef __ASM_DMI_H
+#define __ASM_DMI_H
+
+#include <linux/io.h>
+#include <linux/slab.h>
+
+#define dmi_early_remap(x, l)		memremap(x, l, MEMREMAP_WB)
+#define dmi_early_unmap(x, l)		memunmap(x)
+#define dmi_remap(x, l)			memremap(x, l, MEMREMAP_WB)
+#define dmi_unmap(x)			memunmap(x)
+#define dmi_alloc(l)			kzalloc(l, GFP_KERNEL)
+
+#endif
drivers/firmware/efi/riscv-runtime.c +13 -0
index 09525fb5c240..c3bfb9e77e02 100644
@@ -152,3 +152,16 @@ void arch_efi_call_virt_teardown(void)
 {
 	efi_virtmap_unload();
 }
+
+static int __init riscv_dmi_init(void)
+{
+	/*
+	 * On riscv, DMI depends on UEFI, and dmi_setup() needs to
+	 * be called early because dmi_id_init(), which is an arch_initcall
+	 * itself, depends on dmi_scan_machine() having been called already.
+	 */
+	dmi_setup();
+
+	return 0;
+}
+core_initcall(riscv_dmi_init);
Signature · 1 line
2.34.1
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 8 lines · Haibo Xu

Enable the dmi driver for riscv which would allow access the SMBIOS info through some userspace file(/sys/firmware/dmi/*).

The change was based on that of arm64 and has been verified by dmidecode tool.

Quoted 88 lines

---
Changes since v1
- Change to use memremap/memunmap for dmi_(early)_remap/unmap definition(suggested by Ard)
- Minor clean up for comments (Ard)

---
 arch/riscv/Kconfig                   | 11 +++++++++++
 arch/riscv/include/asm/dmi.h         | 24 ++++++++++++++++++++++++
 drivers/firmware/efi/riscv-runtime.c | 13 +++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 arch/riscv/include/asm/dmi.h
arch/riscv/Kconfig +11 -0
index 8ebafe337eac..3639151cb4ef 100644
@@ -952,6 +952,17 @@ config EFI
          allow the kernel to be booted as an EFI application. This
          is only useful on systems that have UEFI firmware.
 
+config DMI
+       bool "Enable support for SMBIOS (DMI) tables"
+       depends on EFI
+       default y
+       help
+         This enables SMBIOS/DMI feature for systems.
+
+         This option is only useful on systems that have UEFI firmware.
+         However, even with this option, the resultant kernel should
+         continue to boot on existing non-UEFI platforms.
+
 config CC_HAVE_STACKPROTECTOR_TLS
        def_bool $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=tp -mstack-protector-guard-offset=0)
 
arch/riscv/include/asm/dmi.h new file +24 -0
new file mode 100644
index 000000000000..ca7cce557ef7
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2024 Intel Corporation
+ *
+ * based on arch/arm64/include/asm/dmi.h
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#ifndef __ASM_DMI_H
+#define __ASM_DMI_H
+
+#include <linux/io.h>
+#include <linux/slab.h>
+
+#define dmi_early_remap(x, l)          memremap(x, l, MEMREMAP_WB)
+#define dmi_early_unmap(x, l)          memunmap(x)
+#define dmi_remap(x, l)                        memremap(x, l, MEMREMAP_WB)
+#define dmi_unmap(x)                   memunmap(x)
+#define dmi_alloc(l)                   kzalloc(l, GFP_KERNEL)
+
+#endif
drivers/firmware/efi/riscv-runtime.c +13 -1
index 09525fb5c240..c3bfb9e77e02 100644
@@ -152,3 +152,16 @@ void arch_efi_call_virt_teardown(void)
 {
        efi_virtmap_unload();
 }
+
+static int __init riscv_dmi_init(void)
+{
+       /*
+        * On riscv, DMI depends on UEFI, and dmi_setup() needs to
+        * be called early because dmi_id_init(), which is an arch_initcall
+        * itself, depends on dmi_scan_machine() having been called already.
+        */
+       dmi_setup();
+
+       return 0;
+}
+core_initcall(riscv_dmi_init);
--

2.34.1

Reviewed-by on v2 1/1
#2 lore raw
In reply to Haibo Xu
Quoted 82 lines · Haibo Xu

Enable the dmi driver for riscv which would allow access the SMBIOS info through some userspace file(/sys/firmware/dmi/*).

The change was based on that of arm64 and has been verified by dmidecode tool.

---
Changes since v1
- Change to use memremap/memunmap for dmi_(early)_remap/unmap definition(suggested by Ard)
- Minor clean up for comments (Ard)

---
  arch/riscv/Kconfig                   | 11 +++++++++++
  arch/riscv/include/asm/dmi.h         | 24 ++++++++++++++++++++++++
  drivers/firmware/efi/riscv-runtime.c | 13 +++++++++++++
  3 files changed, 48 insertions(+)

create mode 100644 arch/riscv/include/asm/dmi.h

arch/riscv/Kconfig +11 -0
index 8ebafe337eac..3639151cb4ef 100644
@@ -952,6 +952,17 @@ config EFI
  	  allow the kernel to be booted as an EFI application. This
  	  is only useful on systems that have UEFI firmware.
 
+config DMI
+	bool "Enable support for SMBIOS (DMI) tables"
+	depends on EFI
+	default y
+	help
+	  This enables SMBIOS/DMI feature for systems.
+
+	  This option is only useful on systems that have UEFI firmware.
+	  However, even with this option, the resultant kernel should
+	  continue to boot on existing non-UEFI platforms.
+
  config CC_HAVE_STACKPROTECTOR_TLS
  	def_bool $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=tp -mstack-protector-guard-offset=0)
 
arch/riscv/include/asm/dmi.h new file +24 -0
new file mode 100644
index 000000000000..ca7cce557ef7
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2024 Intel Corporation
+ *
+ * based on arch/arm64/include/asm/dmi.h
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#ifndef __ASM_DMI_H
+#define __ASM_DMI_H
+
+#include <linux/io.h>
+#include <linux/slab.h>
+
+#define dmi_early_remap(x, l)		memremap(x, l, MEMREMAP_WB)
+#define dmi_early_unmap(x, l)		memunmap(x)
+#define dmi_remap(x, l)			memremap(x, l, MEMREMAP_WB)
+#define dmi_unmap(x)			memunmap(x)
+#define dmi_alloc(l)			kzalloc(l, GFP_KERNEL)
+
+#endif
drivers/firmware/efi/riscv-runtime.c +3 -0
index 09525fb5c240..c3bfb9e77e02 100644
@@ -152,3 +152,16 @@ void arch_efi_call_virt_teardown(void)
  {
  	efi_virtmap_unload();
  }
+
+static int __init riscv_dmi_init(void)
+{

drivers/firmware/efi/riscv-runtime.c void arch_efi_call_virt_teardown(void) · line 167

Quoted 10 lines
drivers/firmware/efi/riscv-runtime.c +10 -0
+	/*
+	 * On riscv, DMI depends on UEFI, and dmi_setup() needs to
+	 * be called early because dmi_id_init(), which is an arch_initcall
+	 * itself, depends on dmi_scan_machine() having been called already.
+	 */
+	dmi_setup();
+
+	return 0;
+}
+core_initcall(riscv_dmi_init);
#3 lore raw

Hi @Palmer,

Could you please let me know whether this patch was OK for the next RISC-V PULL?

Thanks,
Haibo

Quoted 96 lines · Atish Patra
Quoted 82 lines · Haibo Xu

Enable the dmi driver for riscv which would allow access the SMBIOS info through some userspace file(/sys/firmware/dmi/*).

The change was based on that of arm64 and has been verified by dmidecode tool.

---
Changes since v1
- Change to use memremap/memunmap for dmi_(early)_remap/unmap definition(suggested by Ard)
- Minor clean up for comments (Ard)

---
  arch/riscv/Kconfig                   | 11 +++++++++++
  arch/riscv/include/asm/dmi.h         | 24 ++++++++++++++++++++++++
  drivers/firmware/efi/riscv-runtime.c | 13 +++++++++++++
  3 files changed, 48 insertions(+)

create mode 100644 arch/riscv/include/asm/dmi.h

arch/riscv/Kconfig +11 -0
index 8ebafe337eac..3639151cb4ef 100644
@@ -952,6 +952,17 @@ config EFI
        allow the kernel to be booted as an EFI application. This
        is only useful on systems that have UEFI firmware.
 
+config DMI
+     bool "Enable support for SMBIOS (DMI) tables"
+     depends on EFI
+     default y
+     help
+       This enables SMBIOS/DMI feature for systems.
+
+       This option is only useful on systems that have UEFI firmware.
+       However, even with this option, the resultant kernel should
+       continue to boot on existing non-UEFI platforms.
+
  config CC_HAVE_STACKPROTECTOR_TLS
      def_bool $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=tp -mstack-protector-guard-offset=0)
 
arch/riscv/include/asm/dmi.h new file +24 -0
new file mode 100644
index 000000000000..ca7cce557ef7
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2024 Intel Corporation
+ *
+ * based on arch/arm64/include/asm/dmi.h
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#ifndef __ASM_DMI_H
+#define __ASM_DMI_H
+
+#include <linux/io.h>
+#include <linux/slab.h>
+
+#define dmi_early_remap(x, l)                memremap(x, l, MEMREMAP_WB)
+#define dmi_early_unmap(x, l)                memunmap(x)
+#define dmi_remap(x, l)                      memremap(x, l, MEMREMAP_WB)
+#define dmi_unmap(x)                 memunmap(x)
+#define dmi_alloc(l)                 kzalloc(l, GFP_KERNEL)
+
+#endif
drivers/firmware/efi/riscv-runtime.c +3 -0
index 09525fb5c240..c3bfb9e77e02 100644
@@ -152,3 +152,16 @@ void arch_efi_call_virt_teardown(void)
  {
      efi_virtmap_unload();
  }
+
+static int __init riscv_dmi_init(void)
+{

drivers/firmware/efi/riscv-runtime.c void arch_efi_call_virt_teardown(void) · line 167

Quoted 10 lines
drivers/firmware/efi/riscv-runtime.c +10 -0
+     /*
+      * On riscv, DMI depends on UEFI, and dmi_setup() needs to
+      * be called early because dmi_id_init(), which is an arch_initcall
+      * itself, depends on dmi_scan_machine() having been called already.
+      */
+     dmi_setup();
+
+     return 0;
+}
+core_initcall(riscv_dmi_init);
#4 lore raw

kindly ping!

Any more comments on this patch?

Thanks,
Haibo

Quoted 105 lines · Haibo Xu

Hi @Palmer,

Could you please let me know whether this patch was OK for the next RISC-V PULL?

Thanks,
Haibo

Quoted 96 lines · Atish Patra
Quoted 82 lines · Haibo Xu

Enable the dmi driver for riscv which would allow access the SMBIOS info through some userspace file(/sys/firmware/dmi/*).

The change was based on that of arm64 and has been verified by dmidecode tool.

---
Changes since v1
- Change to use memremap/memunmap for dmi_(early)_remap/unmap definition(suggested by Ard)
- Minor clean up for comments (Ard)

---
  arch/riscv/Kconfig                   | 11 +++++++++++
  arch/riscv/include/asm/dmi.h         | 24 ++++++++++++++++++++++++
  drivers/firmware/efi/riscv-runtime.c | 13 +++++++++++++
  3 files changed, 48 insertions(+)

create mode 100644 arch/riscv/include/asm/dmi.h

arch/riscv/Kconfig +11 -0
index 8ebafe337eac..3639151cb4ef 100644
@@ -952,6 +952,17 @@ config EFI
        allow the kernel to be booted as an EFI application. This
        is only useful on systems that have UEFI firmware.
 
+config DMI
+     bool "Enable support for SMBIOS (DMI) tables"
+     depends on EFI
+     default y
+     help
+       This enables SMBIOS/DMI feature for systems.
+
+       This option is only useful on systems that have UEFI firmware.
+       However, even with this option, the resultant kernel should
+       continue to boot on existing non-UEFI platforms.
+
  config CC_HAVE_STACKPROTECTOR_TLS
      def_bool $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=tp -mstack-protector-guard-offset=0)
 
arch/riscv/include/asm/dmi.h new file +24 -0
new file mode 100644
index 000000000000..ca7cce557ef7
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2024 Intel Corporation
+ *
+ * based on arch/arm64/include/asm/dmi.h
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#ifndef __ASM_DMI_H
+#define __ASM_DMI_H
+
+#include <linux/io.h>
+#include <linux/slab.h>
+
+#define dmi_early_remap(x, l)                memremap(x, l, MEMREMAP_WB)
+#define dmi_early_unmap(x, l)                memunmap(x)
+#define dmi_remap(x, l)                      memremap(x, l, MEMREMAP_WB)
+#define dmi_unmap(x)                 memunmap(x)
+#define dmi_alloc(l)                 kzalloc(l, GFP_KERNEL)
+
+#endif
drivers/firmware/efi/riscv-runtime.c +3 -0
index 09525fb5c240..c3bfb9e77e02 100644
@@ -152,3 +152,16 @@ void arch_efi_call_virt_teardown(void)
  {
      efi_virtmap_unload();
  }
+
+static int __init riscv_dmi_init(void)
+{

drivers/firmware/efi/riscv-runtime.c void arch_efi_call_virt_teardown(void) · line 167

Quoted 10 lines
drivers/firmware/efi/riscv-runtime.c +10 -0
+     /*
+      * On riscv, DMI depends on UEFI, and dmi_setup() needs to
+      * be called early because dmi_id_init(), which is an arch_initcall
+      * itself, depends on dmi_scan_machine() having been called already.
+      */
+     dmi_setup();
+
+     return 0;
+}
+core_initcall(riscv_dmi_init);
maintainer
#5 lore raw
Quoted 3 lines · On Sun, 26 May 2024 02:17:40 PDT (-0700), [email protected] wrote:

kindly ping!

Any more comments on this patch?

Sorry I dropped the ball on this one, it's queued up for staging and should show up on for-next assuming it passes the tests.

Quoted 110 lines

Thanks,
Haibo

Quoted 105 lines · Haibo Xu

Hi @Palmer,

Could you please let me know whether this patch was OK for the next RISC-V PULL?

Thanks,
Haibo

Quoted 96 lines · Atish Patra
Quoted 82 lines · Haibo Xu

Enable the dmi driver for riscv which would allow access the SMBIOS info through some userspace file(/sys/firmware/dmi/*).

The change was based on that of arm64 and has been verified by dmidecode tool.

---
Changes since v1
- Change to use memremap/memunmap for dmi_(early)_remap/unmap definition(suggested by Ard)
- Minor clean up for comments (Ard)

---
  arch/riscv/Kconfig                   | 11 +++++++++++
  arch/riscv/include/asm/dmi.h         | 24 ++++++++++++++++++++++++
  drivers/firmware/efi/riscv-runtime.c | 13 +++++++++++++
  3 files changed, 48 insertions(+)

create mode 100644 arch/riscv/include/asm/dmi.h

arch/riscv/Kconfig +11 -0
index 8ebafe337eac..3639151cb4ef 100644
@@ -952,6 +952,17 @@ config EFI
        allow the kernel to be booted as an EFI application. This
        is only useful on systems that have UEFI firmware.
 
+config DMI
+     bool "Enable support for SMBIOS (DMI) tables"
+     depends on EFI
+     default y
+     help
+       This enables SMBIOS/DMI feature for systems.
+
+       This option is only useful on systems that have UEFI firmware.
+       However, even with this option, the resultant kernel should
+       continue to boot on existing non-UEFI platforms.
+
  config CC_HAVE_STACKPROTECTOR_TLS
      def_bool $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=tp -mstack-protector-guard-offset=0)
 
arch/riscv/include/asm/dmi.h new file +24 -0
new file mode 100644
index 000000000000..ca7cce557ef7
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2024 Intel Corporation
+ *
+ * based on arch/arm64/include/asm/dmi.h
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#ifndef __ASM_DMI_H
+#define __ASM_DMI_H
+
+#include <linux/io.h>
+#include <linux/slab.h>
+
+#define dmi_early_remap(x, l)                memremap(x, l, MEMREMAP_WB)
+#define dmi_early_unmap(x, l)                memunmap(x)
+#define dmi_remap(x, l)                      memremap(x, l, MEMREMAP_WB)
+#define dmi_unmap(x)                 memunmap(x)
+#define dmi_alloc(l)                 kzalloc(l, GFP_KERNEL)
+
+#endif
drivers/firmware/efi/riscv-runtime.c +3 -0
index 09525fb5c240..c3bfb9e77e02 100644
@@ -152,3 +152,16 @@ void arch_efi_call_virt_teardown(void)
  {
      efi_virtmap_unload();
  }
+
+static int __init riscv_dmi_init(void)
+{

drivers/firmware/efi/riscv-runtime.c void arch_efi_call_virt_teardown(void) · line 167

Quoted 10 lines
drivers/firmware/efi/riscv-runtime.c +10 -0
+     /*
+      * On riscv, DMI depends on UEFI, and dmi_setup() needs to
+      * be called early because dmi_id_init(), which is an arch_initcall
+      * itself, depends on dmi_scan_machine() having been called already.
+      */
+     dmi_setup();
+
+     return 0;
+}
+core_initcall(riscv_dmi_init);
#6 lore raw
Quoted 9 lines · Palmer Dabbelt
Quoted 3 lines · On Sun, 26 May 2024 02:17:40 PDT (-0700), [email protected] wrote:

kindly ping!

Any more comments on this patch?

Sorry I dropped the ball on this one, it's queued up for staging and should show up on for-next assuming it passes the tests.

Thanks!

Quoted 110 lines
Quoted 110 lines

Thanks,
Haibo

Quoted 105 lines · Haibo Xu

Hi @Palmer,

Could you please let me know whether this patch was OK for the next RISC-V PULL?

Thanks,
Haibo

Quoted 96 lines · Atish Patra
Quoted 82 lines · Haibo Xu

Enable the dmi driver for riscv which would allow access the SMBIOS info through some userspace file(/sys/firmware/dmi/*).

The change was based on that of arm64 and has been verified by dmidecode tool.

---
Changes since v1
- Change to use memremap/memunmap for dmi_(early)_remap/unmap definition(suggested by Ard)
- Minor clean up for comments (Ard)

---
  arch/riscv/Kconfig                   | 11 +++++++++++
  arch/riscv/include/asm/dmi.h         | 24 ++++++++++++++++++++++++
  drivers/firmware/efi/riscv-runtime.c | 13 +++++++++++++
  3 files changed, 48 insertions(+)

create mode 100644 arch/riscv/include/asm/dmi.h

arch/riscv/Kconfig +11 -0
index 8ebafe337eac..3639151cb4ef 100644
@@ -952,6 +952,17 @@ config EFI
        allow the kernel to be booted as an EFI application. This
        is only useful on systems that have UEFI firmware.
 
+config DMI
+     bool "Enable support for SMBIOS (DMI) tables"
+     depends on EFI
+     default y
+     help
+       This enables SMBIOS/DMI feature for systems.
+
+       This option is only useful on systems that have UEFI firmware.
+       However, even with this option, the resultant kernel should
+       continue to boot on existing non-UEFI platforms.
+
  config CC_HAVE_STACKPROTECTOR_TLS
      def_bool $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=tp -mstack-protector-guard-offset=0)
 
arch/riscv/include/asm/dmi.h new file +24 -0
new file mode 100644
index 000000000000..ca7cce557ef7
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2024 Intel Corporation
+ *
+ * based on arch/arm64/include/asm/dmi.h
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#ifndef __ASM_DMI_H
+#define __ASM_DMI_H
+
+#include <linux/io.h>
+#include <linux/slab.h>
+
+#define dmi_early_remap(x, l)                memremap(x, l, MEMREMAP_WB)
+#define dmi_early_unmap(x, l)                memunmap(x)
+#define dmi_remap(x, l)                      memremap(x, l, MEMREMAP_WB)
+#define dmi_unmap(x)                 memunmap(x)
+#define dmi_alloc(l)                 kzalloc(l, GFP_KERNEL)
+
+#endif
drivers/firmware/efi/riscv-runtime.c +3 -0
index 09525fb5c240..c3bfb9e77e02 100644
@@ -152,3 +152,16 @@ void arch_efi_call_virt_teardown(void)
  {
      efi_virtmap_unload();
  }
+
+static int __init riscv_dmi_init(void)
+{

drivers/firmware/efi/riscv-runtime.c void arch_efi_call_virt_teardown(void) · line 167

Quoted 10 lines
drivers/firmware/efi/riscv-runtime.c +10 -0
+     /*
+      * On riscv, DMI depends on UEFI, and dmi_setup() needs to
+      * be called early because dmi_id_init(), which is an arch_initcall
+      * itself, depends on dmi_scan_machine() having been called already.
+      */
+     dmi_setup();
+
+     return 0;
+}
+core_initcall(riscv_dmi_init);
#7 lore raw
In reply to Haibo Xu
This patch was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:

Hello:

This patch was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:

Quoted 9 lines · On Mon, 18 Mar 2024 10:09:16 +0800 you wrote:

Enable the dmi driver for riscv which would allow access the SMBIOS info through some userspace file(/sys/firmware/dmi/*).

The change was based on that of arm64 and has been verified by dmidecode tool.

[...]

Here is the summary with links:
- [v2] riscv: dmi: Add SMBIOS/DMI support

    https://git.kernel.org/riscv/c/d6ecd188937f

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html