.../bindings/firmware/linux,smbios-table.yaml | 26 +++++++++ drivers/firmware/dmi_scan.c | 58 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 Documentation/devicetree/bindings/firmware/linux,smbios-table.yaml
From: Adriana Nicolae <adriana@arista.com>
Some bootloaders like U-boot, particularly for the ARM architecture,
provide SMBIOS/DMI tables at a specific memory address. However, these
systems often do not boot using a full UEFI environment, which means the
kernel's standard EFI DMI scanner cannot find these tables.
This series adds support for the kernel to find these tables by
reading the associated property from the Device Tree /chosen node. The
bootloader can specify the physical addresses using "linux,smbios3-table".
The first patch introduces the device tree binding documentation for this
new ABI, and the second patch implements the driver logic in dmi_scan.c.
Changes in v3:
- Removed linux,smbios-table property, only keep the SMBIOSv3 property
(Patch 1/2).
- Search DT for linux,smbios3-table only, removed the code searching
for the previous property (Patch 2/2).
Changes in v2:
- Add missing Device Tree binding documentation (Patch 1/2).
- Split the original patch into a 2-part series (binding + driver).
- (No functional changes to the driver code in patch 2/2).
Adriana Nicolae (2):
dt-bindings: firmware: Add binding for SMBIOS /chosen properties
drivers: firmware: dmi_scan: Add support for reading SMBIOS from DT
.../bindings/firmware/linux,smbios-table.yaml | 26 +++++++++
drivers/firmware/dmi_scan.c | 58 +++++++++++++++++++
2 files changed, 84 insertions(+)
create mode 100644 Documentation/devicetree/bindings/firmware/linux,smbios-table.yaml
--
2.51.0
Some bootloaders like U-boot, particularly for the ARM architecture,
provide SMBIOS/DMI tables at a specific memory address. However, these
systems often do not boot using a full UEFI environment, which means the
kernel's standard EFI DMI scanner cannot find these tables.
This series adds support for the kernel to find these tables by
reading the associated property from the Device Tree /chosen node. The
bootloader can specify the physical addresses using the property
"linux,smbios3-entrypoint".
The first patch introduces the device tree binding documentation for this
new ABI, and the second patch implements the driver logic in dmi_scan.c.
Changes in v4:
- Renamed linux,smbios3-table.yaml file, removed mention of ARM/ARM64
(Patch 1/2).
- Drop the second definition of dmi_scan_from_dt() and fold checking
for CONFIG_OF (Patch 2/2).
- Drop unnecessary goto on the success case (Patch 2/2).
- Replace magic number for entrypoint size with SMBIOS3_ENTRY_POINT_SIZE
definition (Patch 2/2).
Changes in v3:
- Removed linux,smbios-table property, only keep the SMBIOSv3 property
(Patch 1/2).
- Search DT for linux,smbios3-table only, removed the code searching
for the previous property (Patch 2/2).
Changes in v2:
- Add missing Device Tree binding documentation (Patch 1/2).
- Split the original patch into a 2-part series (binding + driver).
- (No functional changes to the driver code in patch 2/2).
adriana (2):
dt-bindings: firmware: Add binding for SMBIOS /chosen properties
drivers: firmware: dmi_scan: Add support for reading SMBIOS from DT
.../firmware/linux,smbios3-entrypoint.yaml | 25 +++++++++
drivers/firmware/dmi_scan.c | 54 +++++++++++++++++++
2 files changed, 79 insertions(+)
create mode 100644 Documentation/devicetree/bindings/firmware/linux,smbios3-entrypoint.yaml
--
2.51.0
Some bootloaders like U-boot, particularly for the ARM architecture,
provide SMBIOS/DMI tables at a specific memory address. However, these
systems often do not boot using a full UEFI environment, which means the
kernel's standard EFI DMI scanner cannot find these tables.
This series adds support for the kernel to find these tables by
reading the associated property from the Device Tree /chosen node. The
bootloader can specify the physical addresses using the property
"smbios3-entrypoint".
This patch implements the driver logic in dmi_scan.c.
Changes in v5:
- Removed linux,smbios3-entrypoint.yaml file and the first patch.
- Renamed property to "smbios3-entrypoint".
Changes in v4:
- Renamed linux,smbios3-table.yaml file, removed mention of ARM/ARM64
(Patch 1/2).
- Drop the second definition of dmi_scan_from_dt() and fold checking
for CONFIG_OF (Patch 2/2).
- Drop unnecessary goto on the success case (Patch 2/2).
- Replace magic number for entrypoint size with SMBIOS3_ENTRY_POINT_SIZE
definition (Patch 2/2).
Changes in v3:
- Removed linux,smbios-table property, only keep the SMBIOSv3 property
(Patch 1/2).
- Search DT for linux,smbios3-table only, removed the code searching
for the previous property (Patch 2/2).
Changes in v2:
- Add missing Device Tree binding documentation (Patch 1/2).
- Split the original patch into a 2-part series (binding + driver).
- (No functional changes to the driver code in patch 2/2).
adriana (1):
drivers: firmware: dmi_scan: Add support for reading SMBIOS from DT
drivers/firmware/dmi_scan.c | 54 +++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
--
2.51.0
On Fri, Oct 31, 2025 at 04:59:16AM -0700, adriana wrote: > Some bootloaders like U-boot, particularly for the ARM architecture, > provide SMBIOS/DMI tables at a specific memory address. However, these > systems often do not boot using a full UEFI environment, which means the > kernel's standard EFI DMI scanner cannot find these tables. > > This series adds support for the kernel to find these tables by > reading the associated property from the Device Tree /chosen node. The > bootloader can specify the physical addresses using the property > "smbios3-entrypoint". > > This patch implements the driver logic in dmi_scan.c. > > Changes in v5: > - Removed linux,smbios3-entrypoint.yaml file and the first patch. > - Renamed property to "smbios3-entrypoint". Please stop sending new versions as a reply to the old one. > > Changes in v4: > - Renamed linux,smbios3-table.yaml file, removed mention of ARM/ARM64 > (Patch 1/2). > - Drop the second definition of dmi_scan_from_dt() and fold checking > for CONFIG_OF (Patch 2/2). > - Drop unnecessary goto on the success case (Patch 2/2). > - Replace magic number for entrypoint size with SMBIOS3_ENTRY_POINT_SIZE > definition (Patch 2/2). > > Changes in v3: > - Removed linux,smbios-table property, only keep the SMBIOSv3 property > (Patch 1/2). > - Search DT for linux,smbios3-table only, removed the code searching > for the previous property (Patch 2/2). > > Changes in v2: > - Add missing Device Tree binding documentation (Patch 1/2). > - Split the original patch into a 2-part series (binding + driver). > - (No functional changes to the driver code in patch 2/2). > > adriana (1): > drivers: firmware: dmi_scan: Add support for reading SMBIOS from DT > > drivers/firmware/dmi_scan.c | 54 +++++++++++++++++++++++++++++++++++++ > 1 file changed, 54 insertions(+) > > -- > 2.51.0 > >
Some bootloaders provide SMBIOS/DMI tables at a specific memory address,
particularly on non-EFI ARM platforms. The kernel's standard EFI DMI
scanner cannot find these tables.
This patch adds a fallback mechanism to the DMI scanner to read the
physical address of the SMBIOS3 entry point from the device tree.
This scan is performed only if the standard EFI check fails.
Signed-off-by: adriana <adriana@arista.com>
---
drivers/firmware/dmi_scan.c | 54 +++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 70d39adf50dc..82f1848e79fd 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -10,10 +10,12 @@
#include <linux/random.h>
#include <asm/dmi.h>
#include <linux/unaligned.h>
+#include <linux/of.h>
#ifndef SMBIOS_ENTRY_POINT_SCAN_START
#define SMBIOS_ENTRY_POINT_SCAN_START 0xF0000
#endif
+#define SMBIOS3_ENTRY_POINT_SIZE 32
struct kobject *dmi_kobj;
EXPORT_SYMBOL_GPL(dmi_kobj);
@@ -670,6 +672,51 @@ static int __init dmi_smbios3_present(const u8 *buf)
return 1;
}
+/**
+ * dmi_scan_from_dt - Find SMBIOS3 entrypoint address via Device Tree
+ *
+ * Checks if the bootloader has passed the physical address of the
+ * SMBIOS3 entrypoint structure via the "smbios3-entrypoint" property
+ * in the /chosen node.
+ * Returns true if a valid entrypoint is found.
+ */
+static bool __init dmi_scan_from_dt(void)
+{
+ struct device_node *chosen;
+ const __be64 *prop;
+ char buf[SMBIOS3_ENTRY_POINT_SIZE];
+ void __iomem *p;
+ bool dmi_available = false;
+ u64 addr;
+ int len;
+
+ if(!IS_ENABLED(CONFIG_OF))
+ return false;
+
+ chosen = of_find_node_by_path("/chosen");
+ if (!chosen)
+ return false;
+
+ prop = of_get_property(chosen, "smbios3-entrypoint", &len);
+ if (prop && len >= sizeof(u64)) {
+ addr = be64_to_cpup(prop);
+
+ p = dmi_early_remap(addr, SMBIOS3_ENTRY_POINT_SIZE);
+ if (!p)
+ goto out;
+
+ memcpy_fromio(buf, p, sizeof(buf));
+ dmi_early_unmap(p, SMBIOS3_ENTRY_POINT_SIZE);
+
+ if (!dmi_smbios3_present(buf))
+ dmi_available = true;
+ }
+
+out:
+ of_node_put(chosen);
+ return dmi_available;
+}
+
static void __init dmi_scan_machine(void)
{
char __iomem *p, *q;
@@ -718,6 +765,13 @@ static void __init dmi_scan_machine(void)
dmi_available = 1;
return;
}
+ } else if (dmi_scan_from_dt()) {
+ /*
+ * If EFI is not present or failed, try getting SMBIOS3
+ * entrypoint from the Device Tree.
+ */
+ dmi_available = 1;
+ return;
} else if (IS_ENABLED(CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK)) {
p = dmi_early_remap(SMBIOS_ENTRY_POINT_SCAN_START, 0x10000);
if (p == NULL)
--
2.51.0
On Fri, 31 Oct 2025 at 11:10, adriana <adriana@arista.com> wrote: > > Some bootloaders like U-boot, particularly for the ARM architecture, > provide SMBIOS/DMI tables at a specific memory address. However, these > systems often do not boot using a full UEFI environment, which means the > kernel's standard EFI DMI scanner cannot find these tables. > > This series adds support for the kernel to find these tables by > reading the associated property from the Device Tree /chosen node. The > bootloader can specify the physical addresses using the property > "linux,smbios3-entrypoint". > > The first patch introduces the device tree binding documentation for this > new ABI, and the second patch implements the driver logic in dmi_scan.c. > > Changes in v4: > - Renamed linux,smbios3-table.yaml file, removed mention of ARM/ARM64 > (Patch 1/2). > - Drop the second definition of dmi_scan_from_dt() and fold checking > for CONFIG_OF (Patch 2/2). > - Drop unnecessary goto on the success case (Patch 2/2). > - Replace magic number for entrypoint size with SMBIOS3_ENTRY_POINT_SIZE > definition (Patch 2/2). > > Changes in v3: > - Removed linux,smbios-table property, only keep the SMBIOSv3 property > (Patch 1/2). > - Search DT for linux,smbios3-table only, removed the code searching > for the previous property (Patch 2/2). > > Changes in v2: > - Add missing Device Tree binding documentation (Patch 1/2). > - Split the original patch into a 2-part series (binding + driver). > - (No functional changes to the driver code in patch 2/2). > > adriana (2): > dt-bindings: firmware: Add binding for SMBIOS /chosen properties > drivers: firmware: dmi_scan: Add support for reading SMBIOS from DT > For the series, Reviewed-by: Ard Biesheuvel <ardb@kernel.org> I can take the second patch, but bindings need to go in separately IIRC. Rob? > .../firmware/linux,smbios3-entrypoint.yaml | 25 +++++++++ > drivers/firmware/dmi_scan.c | 54 +++++++++++++++++++ > 2 files changed, 79 insertions(+) > create mode 100644 Documentation/devicetree/bindings/firmware/linux,smbios3-entrypoint.yaml > > -- > 2.51.0 >
On Fri, 31 Oct 2025 at 12:17, Ard Biesheuvel <ardb@kernel.org> wrote: > > On Fri, 31 Oct 2025 at 11:10, adriana <adriana@arista.com> wrote: > > > > Some bootloaders like U-boot, particularly for the ARM architecture, > > provide SMBIOS/DMI tables at a specific memory address. However, these > > systems often do not boot using a full UEFI environment, which means the > > kernel's standard EFI DMI scanner cannot find these tables. > > > > This series adds support for the kernel to find these tables by > > reading the associated property from the Device Tree /chosen node. The > > bootloader can specify the physical addresses using the property > > "linux,smbios3-entrypoint". > > > > The first patch introduces the device tree binding documentation for this > > new ABI, and the second patch implements the driver logic in dmi_scan.c. > > > > Changes in v4: > > - Renamed linux,smbios3-table.yaml file, removed mention of ARM/ARM64 > > (Patch 1/2). > > - Drop the second definition of dmi_scan_from_dt() and fold checking > > for CONFIG_OF (Patch 2/2). > > - Drop unnecessary goto on the success case (Patch 2/2). > > - Replace magic number for entrypoint size with SMBIOS3_ENTRY_POINT_SIZE > > definition (Patch 2/2). > > > > Changes in v3: > > - Removed linux,smbios-table property, only keep the SMBIOSv3 property > > (Patch 1/2). > > - Search DT for linux,smbios3-table only, removed the code searching > > for the previous property (Patch 2/2). > > > > Changes in v2: > > - Add missing Device Tree binding documentation (Patch 1/2). > > - Split the original patch into a 2-part series (binding + driver). > > - (No functional changes to the driver code in patch 2/2). > > > > adriana (2): > > dt-bindings: firmware: Add binding for SMBIOS /chosen properties > > drivers: firmware: dmi_scan: Add support for reading SMBIOS from DT > > > > For the series, > > Reviewed-by: Ard Biesheuvel <ardb@kernel.org> > > I can take the second patch, but bindings need to go in separately IIRC. > > Rob? Feel free to add Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Cheers /Ilias > > > > .../firmware/linux,smbios3-entrypoint.yaml | 25 +++++++++ > > drivers/firmware/dmi_scan.c | 54 +++++++++++++++++++ > > 2 files changed, 79 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/firmware/linux,smbios3-entrypoint.yaml > > > > -- > > 2.51.0 > >
Signed-off-by: adriana <adriana@arista.com>
---
.../firmware/linux,smbios3-entrypoint.yaml | 25 +++++++++++++++++++
1 file changed, 25 insertions(+)
create mode 100644 Documentation/devicetree/bindings/firmware/linux,smbios3-entrypoint.yaml
diff --git a/Documentation/devicetree/bindings/firmware/linux,smbios3-entrypoint.yaml b/Documentation/devicetree/bindings/firmware/linux,smbios3-entrypoint.yaml
new file mode 100644
index 000000000000..4d1521c685ff
--- /dev/null
+++ b/Documentation/devicetree/bindings/firmware/linux,smbios3-entrypoint.yaml
@@ -0,0 +1,25 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2025 Arista Networks
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/firmware/linux,smbios3-entrypoint.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Memory location for SMBIOS entry point
+
+description: |
+ This property is used in the /chosen node to pass the physical address
+ of SMBIOS (System Management BIOS) or DMI (Desktop Management Interface)
+ tables from firmware to the kernel. This is typically used on non-EFI.
+
+maintainers:
+ - Adriana Nicolae <adriana@arista.com>
+ - Rob Herring <robh+dt@kernel.org>
+
+properties:
+ linux,smbios3-entrypoint:
+ $ref: /schemas/types.yaml#/definitions/uint64
+ description:
+ The 64-bit physical address of the SMBIOSv3 entry point structure.
+
+additionalProperties: true
--
2.51.0
On Fri, Oct 31, 2025 at 5:10 AM adriana <adriana@arista.com> wrote: > > Signed-off-by: adriana <adriana@arista.com> > --- > .../firmware/linux,smbios3-entrypoint.yaml | 25 +++++++++++++++++++ > 1 file changed, 25 insertions(+) > create mode 100644 Documentation/devicetree/bindings/firmware/linux,smbios3-entrypoint.yaml > > diff --git a/Documentation/devicetree/bindings/firmware/linux,smbios3-entrypoint.yaml b/Documentation/devicetree/bindings/firmware/linux,smbios3-entrypoint.yaml > new file mode 100644 > index 000000000000..4d1521c685ff > --- /dev/null > +++ b/Documentation/devicetree/bindings/firmware/linux,smbios3-entrypoint.yaml > @@ -0,0 +1,25 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +# Copyright 2025 Arista Networks > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/firmware/linux,smbios3-entrypoint.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Memory location for SMBIOS entry point > + > +description: | > + This property is used in the /chosen node to pass the physical address > + of SMBIOS (System Management BIOS) or DMI (Desktop Management Interface) > + tables from firmware to the kernel. This is typically used on non-EFI. > + > +maintainers: > + - Adriana Nicolae <adriana@arista.com> > + - Rob Herring <robh+dt@kernel.org> > + > +properties: > + linux,smbios3-entrypoint: > + $ref: /schemas/types.yaml#/definitions/uint64 > + description: > + The 64-bit physical address of the SMBIOSv3 entry point structure. This needs to go in the chosen binding instead: https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/chosen.yaml
On Fri, Oct 31, 2025 at 6:15 AM Rob Herring <robh@kernel.org> wrote: > > On Fri, Oct 31, 2025 at 5:10 AM adriana <adriana@arista.com> wrote: > > > > Signed-off-by: adriana <adriana@arista.com> > > --- > > .../firmware/linux,smbios3-entrypoint.yaml | 25 +++++++++++++++++++ > > 1 file changed, 25 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/firmware/linux,smbios3-entrypoint.yaml > > > > diff --git a/Documentation/devicetree/bindings/firmware/linux,smbios3-entrypoint.yaml b/Documentation/devicetree/bindings/firmware/linux,smbios3-entrypoint.yaml > > new file mode 100644 > > index 000000000000..4d1521c685ff > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/firmware/linux,smbios3-entrypoint.yaml > > @@ -0,0 +1,25 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > +# Copyright 2025 Arista Networks > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/firmware/linux,smbios3-entrypoint.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Memory location for SMBIOS entry point > > + > > +description: | > > + This property is used in the /chosen node to pass the physical address > > + of SMBIOS (System Management BIOS) or DMI (Desktop Management Interface) > > + tables from firmware to the kernel. This is typically used on non-EFI. > > + > > +maintainers: > > + - Adriana Nicolae <adriana@arista.com> > > + - Rob Herring <robh+dt@kernel.org> > > + > > +properties: > > + linux,smbios3-entrypoint: > > + $ref: /schemas/types.yaml#/definitions/uint64 > > + description: > > + The 64-bit physical address of the SMBIOSv3 entry point structure. > > This needs to go in the chosen binding instead: > > https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/chosen.yaml Also, drop the 'linux,' prefix as SMBIOS is not a linux invention. Rob
On Fri, Oct 31, 2025 at 1:43 PM Rob Herring <robh@kernel.org> wrote: > > On Fri, Oct 31, 2025 at 6:15 AM Rob Herring <robh@kernel.org> wrote: > > > > On Fri, Oct 31, 2025 at 5:10 AM adriana <adriana@arista.com> wrote: > > > > > > Signed-off-by: adriana <adriana@arista.com> > > > --- > > > .../firmware/linux,smbios3-entrypoint.yaml | 25 +++++++++++++++++++ > > > 1 file changed, 25 insertions(+) > > > create mode 100644 Documentation/devicetree/bindings/firmware/linux,smbios3-entrypoint.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/firmware/linux,smbios3-entrypoint.yaml b/Documentation/devicetree/bindings/firmware/linux,smbios3-entrypoint.yaml > > > new file mode 100644 > > > index 000000000000..4d1521c685ff > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/firmware/linux,smbios3-entrypoint.yaml > > > @@ -0,0 +1,25 @@ > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > > +# Copyright 2025 Arista Networks > > > +%YAML 1.2 > > > +--- > > > +$id: http://devicetree.org/schemas/firmware/linux,smbios3-entrypoint.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: Memory location for SMBIOS entry point > > > + > > > +description: | > > > + This property is used in the /chosen node to pass the physical address > > > + of SMBIOS (System Management BIOS) or DMI (Desktop Management Interface) > > > + tables from firmware to the kernel. This is typically used on non-EFI. > > > + > > > +maintainers: > > > + - Adriana Nicolae <adriana@arista.com> > > > + - Rob Herring <robh+dt@kernel.org> > > > + > > > +properties: > > > + linux,smbios3-entrypoint: > > > + $ref: /schemas/types.yaml#/definitions/uint64 > > > + description: > > > + The 64-bit physical address of the SMBIOSv3 entry point structure. > > > > This needs to go in the chosen binding instead: > > > > https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/chosen.yaml > > Also, drop the 'linux,' prefix as SMBIOS is not a linux invention. Thanks! I've renamed it to "smbios3-entrypoint" and opened a separate PR for the binding: https://github.com/devicetree-org/dt-schema/pull/177 > > Rob
Some bootloaders provide SMBIOS/DMI tables at a specific memory address,
particularly on non-EFI ARM platforms. The kernel's standard EFI DMI
scanner cannot find these tables.
This patch adds a fallback mechanism to the DMI scanner to read the
physical address of the SMBIOS3 entry point from the device tree.
This scan is performed only if the standard EFI check fails.
Signed-off-by: adriana <adriana@arista.com>
---
drivers/firmware/dmi_scan.c | 54 +++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 70d39adf50dc..c29ca98f09b5 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -10,10 +10,12 @@
#include <linux/random.h>
#include <asm/dmi.h>
#include <linux/unaligned.h>
+#include <linux/of.h>
#ifndef SMBIOS_ENTRY_POINT_SCAN_START
#define SMBIOS_ENTRY_POINT_SCAN_START 0xF0000
#endif
+#define SMBIOS3_ENTRY_POINT_SIZE 32
struct kobject *dmi_kobj;
EXPORT_SYMBOL_GPL(dmi_kobj);
@@ -670,6 +672,51 @@ static int __init dmi_smbios3_present(const u8 *buf)
return 1;
}
+/**
+ * dmi_scan_from_dt - Find SMBIOS3 entrypoint address via Device Tree
+ *
+ * Checks if the bootloader has passed the physical address of the
+ * SMBIOS3 entrypoint structure via the "linux,smbios3-entrypoint"
+ * property in the /chosen node.
+ * Returns true if a valid entrypoint is found.
+ */
+static bool __init dmi_scan_from_dt(void)
+{
+ struct device_node *chosen;
+ const __be64 *prop;
+ char buf[SMBIOS3_ENTRY_POINT_SIZE];
+ void __iomem *p;
+ bool dmi_available = false;
+ u64 addr;
+ int len;
+
+ if(!IS_ENABLED(CONFIG_OF))
+ return false;
+
+ chosen = of_find_node_by_path("/chosen");
+ if (!chosen)
+ return false;
+
+ prop = of_get_property(chosen, "linux,smbios3-entrypoint", &len);
+ if (prop && len >= sizeof(u64)) {
+ addr = be64_to_cpup(prop);
+
+ p = dmi_early_remap(addr, SMBIOS3_ENTRY_POINT_SIZE);
+ if (!p)
+ goto out;
+
+ memcpy_fromio(buf, p, sizeof(buf));
+ dmi_early_unmap(p, SMBIOS3_ENTRY_POINT_SIZE);
+
+ if (!dmi_smbios3_present(buf))
+ dmi_available = true;
+ }
+
+out:
+ of_node_put(chosen);
+ return dmi_available;
+}
+
static void __init dmi_scan_machine(void)
{
char __iomem *p, *q;
@@ -718,6 +765,13 @@ static void __init dmi_scan_machine(void)
dmi_available = 1;
return;
}
+ } else if (dmi_scan_from_dt()) {
+ /*
+ * If EFI is not present or failed, try getting SMBIOS3
+ * entrypoint from the Device Tree.
+ */
+ dmi_available = 1;
+ return;
} else if (IS_ENABLED(CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK)) {
p = dmi_early_remap(SMBIOS_ENTRY_POINT_SCAN_START, 0x10000);
if (p == NULL)
--
2.51.0
© 2016 - 2026 Red Hat, Inc.