xref: /linux/Documentation/ABI/testing/sysfs-firmware-dmi-entries (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
1863ef5baSIvan KhoronzhukWhat:		/sys/firmware/dmi/entries/
2863ef5baSIvan KhoronzhukDate:		February 2011
3863ef5baSIvan KhoronzhukContact:	Mike Waychison <mikew@google.com>
4863ef5baSIvan KhoronzhukDescription:
5*94483490SArd Biesheuvel		Many machines' firmware (x86 and arm64) export DMI /
6863ef5baSIvan Khoronzhuk		SMBIOS tables to the operating system.  Getting at this
7863ef5baSIvan Khoronzhuk		information is often valuable to userland, especially in
8863ef5baSIvan Khoronzhuk		cases where there are OEM extensions used.
9863ef5baSIvan Khoronzhuk
10863ef5baSIvan Khoronzhuk		The kernel itself does not rely on the majority of the
11863ef5baSIvan Khoronzhuk		information in these tables being correct.  It equally
12863ef5baSIvan Khoronzhuk		cannot ensure that the data as exported to userland is
13863ef5baSIvan Khoronzhuk		without error either.
14863ef5baSIvan Khoronzhuk
15863ef5baSIvan Khoronzhuk		DMI is structured as a large table of entries, where
16863ef5baSIvan Khoronzhuk		each entry has a common header indicating the type and
17863ef5baSIvan Khoronzhuk		length of the entry, as well as a firmware-provided
18863ef5baSIvan Khoronzhuk		'handle' that is supposed to be unique amongst all
19863ef5baSIvan Khoronzhuk		entries.
20863ef5baSIvan Khoronzhuk
21863ef5baSIvan Khoronzhuk		Some entries are required by the specification, but many
22863ef5baSIvan Khoronzhuk		others are optional.  In general though, users should
23863ef5baSIvan Khoronzhuk		never expect to find a specific entry type on their
24863ef5baSIvan Khoronzhuk		system unless they know for certain what their firmware
25863ef5baSIvan Khoronzhuk		is doing.  Machine to machine experiences will vary.
26863ef5baSIvan Khoronzhuk
27863ef5baSIvan Khoronzhuk		Multiple entries of the same type are allowed.  In order
28863ef5baSIvan Khoronzhuk		to handle these duplicate entry types, each entry is
29863ef5baSIvan Khoronzhuk		assigned by the operating system an 'instance', which is
30863ef5baSIvan Khoronzhuk		derived from an entry type's ordinal position.  That is
31863ef5baSIvan Khoronzhuk		to say, if there are 'N' multiple entries with the same type
32863ef5baSIvan Khoronzhuk		'T' in the DMI tables (adjacent or spread apart, it
33863ef5baSIvan Khoronzhuk		doesn't matter), they will be represented in sysfs as
34863ef5baSIvan Khoronzhuk		entries "T-0" through "T-(N-1)":
35863ef5baSIvan Khoronzhuk
3634433332SMauro Carvalho Chehab		Example entry directories::
37863ef5baSIvan Khoronzhuk
38863ef5baSIvan Khoronzhuk			/sys/firmware/dmi/entries/17-0
39863ef5baSIvan Khoronzhuk			/sys/firmware/dmi/entries/17-1
40863ef5baSIvan Khoronzhuk			/sys/firmware/dmi/entries/17-2
41863ef5baSIvan Khoronzhuk			/sys/firmware/dmi/entries/17-3
42863ef5baSIvan Khoronzhuk			...
43863ef5baSIvan Khoronzhuk
44863ef5baSIvan Khoronzhuk		Instance numbers are used in lieu of the firmware
45863ef5baSIvan Khoronzhuk		assigned entry handles as the kernel itself makes no
46863ef5baSIvan Khoronzhuk		guarantees that handles as exported are unique, and
47863ef5baSIvan Khoronzhuk		there are likely firmware images that get this wrong in
48863ef5baSIvan Khoronzhuk		the wild.
49863ef5baSIvan Khoronzhuk
50863ef5baSIvan Khoronzhuk		Each DMI entry in sysfs has the common header values
51863ef5baSIvan Khoronzhuk		exported as attributes:
52863ef5baSIvan Khoronzhuk
5334433332SMauro Carvalho Chehab		========  =================================================
5434433332SMauro Carvalho Chehab		handle	  The 16bit 'handle' that is assigned to this
55863ef5baSIvan Khoronzhuk			  entry by the firmware.  This handle may be
56863ef5baSIvan Khoronzhuk			  referred to by other entries.
5734433332SMauro Carvalho Chehab		length	  The length of the entry, as presented in the
58863ef5baSIvan Khoronzhuk			  entry itself.  Note that this is _not the
59863ef5baSIvan Khoronzhuk			  total count of bytes associated with the
6034433332SMauro Carvalho Chehab			  entry.  This value represents the length of
61863ef5baSIvan Khoronzhuk			  the "formatted" portion of the entry.  This
62863ef5baSIvan Khoronzhuk			  "formatted" region is sometimes followed by
63863ef5baSIvan Khoronzhuk			  the "unformatted" region composed of nul
64863ef5baSIvan Khoronzhuk			  terminated strings, with termination signalled
65863ef5baSIvan Khoronzhuk			  by a two nul characters in series.
6634433332SMauro Carvalho Chehab		raw	  The raw bytes of the entry. This includes the
67863ef5baSIvan Khoronzhuk			  "formatted" portion of the entry, the
68863ef5baSIvan Khoronzhuk			  "unformatted" strings portion of the entry,
69863ef5baSIvan Khoronzhuk			  and the two terminating nul characters.
7034433332SMauro Carvalho Chehab		type	  The type of the entry.  This value is the same
71863ef5baSIvan Khoronzhuk			  as found in the directory name.  It indicates
72863ef5baSIvan Khoronzhuk			  how the rest of the entry should be interpreted.
7334433332SMauro Carvalho Chehab		instance  The instance ordinal of the entry for the
74863ef5baSIvan Khoronzhuk			  given type.  This value is the same as found
75863ef5baSIvan Khoronzhuk			  in the parent directory name.
7634433332SMauro Carvalho Chehab		position  The ordinal position (zero-based) of the entry
77863ef5baSIvan Khoronzhuk			  within the entirety of the DMI entry table.
7834433332SMauro Carvalho Chehab		========  =================================================
79863ef5baSIvan Khoronzhuk
8034433332SMauro Carvalho Chehab		**Entry Specialization**
81863ef5baSIvan Khoronzhuk
82863ef5baSIvan Khoronzhuk		Some entry types may have other information available in
83863ef5baSIvan Khoronzhuk		sysfs.  Not all types are specialized.
84863ef5baSIvan Khoronzhuk
8534433332SMauro Carvalho Chehab		**Type 15 - System Event Log**
86863ef5baSIvan Khoronzhuk
87863ef5baSIvan Khoronzhuk		This entry allows the firmware to export a log of
88863ef5baSIvan Khoronzhuk		events the system has taken.  This information is
89863ef5baSIvan Khoronzhuk		typically backed by nvram, but the implementation
90863ef5baSIvan Khoronzhuk		details are abstracted by this table.  This entry's data
9134433332SMauro Carvalho Chehab		is exported in the directory::
92863ef5baSIvan Khoronzhuk
93863ef5baSIvan Khoronzhuk		  /sys/firmware/dmi/entries/15-0/system_event_log
94863ef5baSIvan Khoronzhuk
95863ef5baSIvan Khoronzhuk		and has the following attributes (documented in the
96863ef5baSIvan Khoronzhuk		SMBIOS / DMI specification under "System Event Log (Type 15)":
97863ef5baSIvan Khoronzhuk
9834433332SMauro Carvalho Chehab		- area_length
9934433332SMauro Carvalho Chehab		- header_start_offset
10034433332SMauro Carvalho Chehab		- data_start_offset
10134433332SMauro Carvalho Chehab		- access_method
10234433332SMauro Carvalho Chehab		- status
10334433332SMauro Carvalho Chehab		- change_token
10434433332SMauro Carvalho Chehab		- access_method_address
10534433332SMauro Carvalho Chehab		- header_format
10634433332SMauro Carvalho Chehab		- per_log_type_descriptor_length
10734433332SMauro Carvalho Chehab		- type_descriptors_supported_count
108863ef5baSIvan Khoronzhuk
109863ef5baSIvan Khoronzhuk		As well, the kernel exports the binary attribute:
110863ef5baSIvan Khoronzhuk
11134433332SMauro Carvalho Chehab		=============	  ====================================
11234433332SMauro Carvalho Chehab		raw_event_log	  The raw binary bits of the event log
113863ef5baSIvan Khoronzhuk				  as described by the DMI entry.
11434433332SMauro Carvalho Chehab		=============	  ====================================
115