]> git.ipfire.org Git - thirdparty/u-boot.git/blobdiff - include/smbios.h
Merge tag 'acpi-next-20240328' of https://source.denx.de/u-boot/custodians/u-boot...
[thirdparty/u-boot.git] / include / smbios.h
index e601283d2939744024763a7bcb7178616ed6e64f..a4fda9df7bd0e96f938c2e249ce025c96a4628cd 100644 (file)
@@ -8,11 +8,11 @@
 #ifndef _SMBIOS_H_
 #define _SMBIOS_H_
 
-#include <dm/ofnode.h>
+#include <linux/types.h>
 
 /* SMBIOS spec version implemented */
 #define SMBIOS_MAJOR_VER       3
-#define SMBIOS_MINOR_VER       0
+#define SMBIOS_MINOR_VER       7
 
 enum {
        SMBIOS_STR_MAX  = 64,   /* Maximum length allowed for a string */
@@ -75,7 +75,7 @@ struct __packed smbios3_entry {
        /** @reserved: reserved */
        u8 reserved;
        /** maximum size of SMBIOS table */
-       u32 max_struct_size;
+       u32 table_maximum_size;
        /** @struct_table_address: 64-bit physical starting address */
        u64 struct_table_address;
 };
@@ -108,6 +108,33 @@ struct __packed smbios_type0 {
        char eos[SMBIOS_STRUCT_EOS_BYTES];
 };
 
+/**
+ * enum smbios_wakeup_type - wake-up type
+ *
+ * These constants are used for the Wake-Up Type field in the SMBIOS
+ * System Information (Type 1) structure.
+ */
+enum smbios_wakeup_type {
+       /** @SMBIOS_WAKEUP_TYPE_RESERVED: Reserved */
+       SMBIOS_WAKEUP_TYPE_RESERVED,
+       /** @SMBIOS_WAKEUP_TYPE_OTHER: Other */
+       SMBIOS_WAKEUP_TYPE_OTHER,
+       /** @SMBIOS_WAKEUP_TYPE_UNKNOWN: Unknown */
+       SMBIOS_WAKEUP_TYPE_UNKNOWN,
+       /** @SMBIOS_WAKEUP_TYPE_APM_TIMER: APM Timer */
+       SMBIOS_WAKEUP_TYPE_APM_TIMER,
+       /** @SMBIOS_WAKEUP_TYPE_MODEM_RING: Modem Ring */
+       SMBIOS_WAKEUP_TYPE_MODEM_RING,
+       /** @SMBIOS_WAKEUP_TYPE_LAN_REMOTE: LAN Remote */
+       SMBIOS_WAKEUP_TYPE_LAN_REMOTE,
+       /** @SMBIOS_WAKEUP_TYPE_POWER_SWITCH: Power Switch */
+       SMBIOS_WAKEUP_TYPE_POWER_SWITCH,
+       /** @SMBIOS_WAKEUP_TYPE_PCI_PME: PCI PME# */
+       SMBIOS_WAKEUP_TYPE_PCI_PME,
+       /** @SMBIOS_WAKEUP_TYPE_AC_POWER_RESTORED: AC Power Restored */
+       SMBIOS_WAKEUP_TYPE_AC_POWER_RESTORED,
+};
+
 struct __packed smbios_type1 {
        u8 type;
        u8 length;
@@ -139,6 +166,7 @@ struct __packed smbios_type2 {
        u8 chassis_location;
        u16 chassis_handle;
        u8 board_type;
+       u8 number_contained_objects;
        char eos[SMBIOS_STRUCT_EOS_BYTES];
 };
 
@@ -254,12 +282,13 @@ static inline void fill_smbios_header(void *table, int type,
  *
  * This writes SMBIOS table at a given address.
  *
- * @addr:      start address to write SMBIOS table. If this is not
- *             16-byte-aligned then it will be aligned before the table is
- *             written.
+ * @addr:      start address to write SMBIOS table, 16-byte-alignment
+ * recommended. Note that while the SMBIOS tables themself have no alignment
+ * requirement, some systems may requires alignment. For example x86 systems
+ * which put tables at f0000 require 16-byte alignment
+ *
  * Return:     end address of SMBIOS table (and start address for next entry)
  *             or NULL in case of an error
- *
  */
 ulong write_smbios_table(ulong addr);
 
@@ -325,10 +354,10 @@ int smbios_update_version_full(void *smbios_tab, const char *version);
  * This function clear the device dependent parameters such as
  * serial number for the measurement.
  *
- * @entry: pointer to a struct smbios_entry
+ * @entry: pointer to a struct smbios3_entry
  * @header: pointer to a struct smbios_header
  */
-void smbios_prepare_measurement(const struct smbios_entry *entry,
+void smbios_prepare_measurement(const struct smbios3_entry *entry,
                                struct smbios_header *header);
 
 #endif /* _SMBIOS_H_ */