xref: /openbmc/linux/Documentation/ABI/stable/sysfs-firmware-efi-vars (revision cdd38c5f1ce4398ec58fec95904b75824daab7b5)
154fad532SMike WaychisonWhat:		/sys/firmware/efi/vars
254fad532SMike WaychisonDate:		April 2004
354fad532SMike WaychisonContact:	Matt Domsch <Matt_Domsch@dell.com>
454fad532SMike WaychisonDescription:
554fad532SMike Waychison		This directory exposes interfaces for interactive with
654fad532SMike Waychison		EFI variables.  For more information on EFI variables,
754fad532SMike Waychison		see 'Variable Services' in the UEFI specification
854fad532SMike Waychison		(section 7.2 in specification version 2.3 Errata D).
954fad532SMike Waychison
1054fad532SMike Waychison		In summary, EFI variables are named, and are classified
1154fad532SMike Waychison		into separate namespaces through the use of a vendor
1254fad532SMike Waychison		GUID.  They also have an arbitrary binary value
1354fad532SMike Waychison		associated with them.
1454fad532SMike Waychison
1554fad532SMike Waychison		The efivars module enumerates these variables and
1654fad532SMike Waychison		creates a separate directory for each one found.  Each
1754fad532SMike Waychison		directory has a name of the form "<key>-<vendor guid>"
1854fad532SMike Waychison		and contains the following files:
1954fad532SMike Waychison
20*98913408SMauro Carvalho Chehab		=============== ========================================
2154fad532SMike Waychison		attributes:	A read-only text file enumerating the
2254fad532SMike Waychison				EFI variable flags.  Potential values
2354fad532SMike Waychison				include:
2454fad532SMike Waychison
2554fad532SMike Waychison				EFI_VARIABLE_NON_VOLATILE
2654fad532SMike Waychison				EFI_VARIABLE_BOOTSERVICE_ACCESS
2754fad532SMike Waychison				EFI_VARIABLE_RUNTIME_ACCESS
2854fad532SMike Waychison				EFI_VARIABLE_HARDWARE_ERROR_RECORD
2954fad532SMike Waychison				EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS
3054fad532SMike Waychison
3154fad532SMike Waychison				See the EFI documentation for an
3254fad532SMike Waychison				explanation of each of these variables.
3354fad532SMike Waychison
3454fad532SMike Waychison		data:		A read-only binary file that can be read
3554fad532SMike Waychison				to attain the value of the EFI variable
3654fad532SMike Waychison
3754fad532SMike Waychison		guid:		The vendor GUID of the variable.  This
3854fad532SMike Waychison				should always match the GUID in the
3954fad532SMike Waychison				variable's name.
4054fad532SMike Waychison
4154fad532SMike Waychison		raw_var:	A binary file that can be read to obtain
4254fad532SMike Waychison				a structure that contains everything
4354fad532SMike Waychison				there is to know about the variable.
4454fad532SMike Waychison				For structure definition see "struct
4554fad532SMike Waychison				efi_variable" in the kernel sources.
4654fad532SMike Waychison
4754fad532SMike Waychison				This file can also be written to in
4854fad532SMike Waychison				order to update the value of a variable.
4954fad532SMike Waychison				For this to work however, all fields of
5054fad532SMike Waychison				the "struct efi_variable" passed must
5154fad532SMike Waychison				match byte for byte with the structure
5254fad532SMike Waychison				read out of the file, save for the value
5354fad532SMike Waychison				portion.
5454fad532SMike Waychison
5554fad532SMike Waychison				**Note** the efi_variable structure
5654fad532SMike Waychison				read/written with this file contains a
5754fad532SMike Waychison				'long' type that may change widths
5854fad532SMike Waychison				depending on your underlying
5954fad532SMike Waychison				architecture.
6054fad532SMike Waychison
6154fad532SMike Waychison		size:		As ASCII representation of the size of
6254fad532SMike Waychison				the variable's value.
63*98913408SMauro Carvalho Chehab		=============== ========================================
6454fad532SMike Waychison
6554fad532SMike Waychison
6654fad532SMike Waychison		In addition, two other magic binary files are provided
6754fad532SMike Waychison		in the top-level directory and are used for adding and
6854fad532SMike Waychison		removing variables:
6954fad532SMike Waychison
70*98913408SMauro Carvalho Chehab		=============== ========================================
7154fad532SMike Waychison		new_var:	Takes a "struct efi_variable" and
7254fad532SMike Waychison				instructs the EFI firmware to create a
7354fad532SMike Waychison				new variable.
7454fad532SMike Waychison
7554fad532SMike Waychison		del_var:	Takes a "struct efi_variable" and
7654fad532SMike Waychison				instructs the EFI firmware to remove any
7754fad532SMike Waychison				variable that has a matching vendor GUID
7854fad532SMike Waychison				and variable key name.
79*98913408SMauro Carvalho Chehab		=============== ========================================
80