summaryrefslogtreecommitdiffstats
path: root/Documentation/ABI/testing/sysfs-firmware-qemu_fw_cfg
blob: e9e58d4ea60aba17c0cfb54c09c7d686bd3af071 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
What:		/sys/firmware/qemu_fw_cfg/
Date:		August 2015
Contact:	Gabriel Somlo <somlo@cmu.edu>
Description:
		Several different architectures supported by QEMU (x86, arm,
		sun4*, ppc/mac) are provisioned with a firmware configuration
		(fw_cfg) device, originally intended as a way for the host to
		provide configuration data to the guest firmware. Starting
		with QEMU v2.4, arbitrary fw_cfg file entries may be specified
		by the user on the command line, which makes fw_cfg additionally
		useful as an out-of-band, asynchronous mechanism for providing
		configuration data to the guest userspace.

		The authoritative guest-side hardware interface documentation
		to the fw_cfg device can be found in "docs/specs/fw_cfg.txt"
		in the QEMU source tree.

		=== SysFS fw_cfg Interface ===

		The fw_cfg sysfs interface described in this document is only
		intended to display discoverable blobs (i.e., those registered
		with the file directory), as there is no way to determine the
		presence or size of "legacy" blobs (with selector keys between
		0x0002 and 0x0018) programmatically.

		All fw_cfg information is shown under:

			/sys/firmware/qemu_fw_cfg/

		The only legacy blob displayed is the fw_cfg device revision:

			/sys/firmware/qemu_fw_cfg/rev

		--- Discoverable fw_cfg blobs by selector key ---

		All discoverable blobs listed in the fw_cfg file directory are
		displayed as entries named after their unique selector key
		value, e.g.:

			/sys/firmware/qemu_fw_cfg/by_key/32
			/sys/firmware/qemu_fw_cfg/by_key/33
			/sys/firmware/qemu_fw_cfg/by_key/34
			...

		Each such fw_cfg sysfs entry has the following values exported
		as attributes:

		name  	: The 56-byte nul-terminated ASCII string used as the
			  blob's 'file name' in the fw_cfg directory.
		size  	: The length of the blob, as given in the fw_cfg
			  directory.
		key	: The value of the blob's selector key as given in the
			  fw_cfg directory. This value is the same as used in
			  the parent directory name.
		raw	: The raw bytes of the blob, obtained by selecting the
			  entry via the control register, and reading a number
			  of bytes equal to the blob size from the data
			  register.