xref: /freebsd/sys/contrib/device-tree/Bindings/chosen.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel VadotThe chosen node
2*c66ec88fSEmmanuel Vadot---------------
3*c66ec88fSEmmanuel Vadot
4*c66ec88fSEmmanuel VadotThe chosen node does not represent a real device, but serves as a place
5*c66ec88fSEmmanuel Vadotfor passing data between firmware and the operating system, like boot
6*c66ec88fSEmmanuel Vadotarguments. Data in the chosen node does not represent the hardware.
7*c66ec88fSEmmanuel Vadot
8*c66ec88fSEmmanuel VadotThe following properties are recognized:
9*c66ec88fSEmmanuel Vadot
10*c66ec88fSEmmanuel Vadot
11*c66ec88fSEmmanuel Vadotkaslr-seed
12*c66ec88fSEmmanuel Vadot-----------
13*c66ec88fSEmmanuel Vadot
14*c66ec88fSEmmanuel VadotThis property is used when booting with CONFIG_RANDOMIZE_BASE as the
15*c66ec88fSEmmanuel Vadotentropy used to randomize the kernel image base address location. Since
16*c66ec88fSEmmanuel Vadotit is used directly, this value is intended only for KASLR, and should
17*c66ec88fSEmmanuel Vadotnot be used for other purposes (as it may leak information about KASLR
18*c66ec88fSEmmanuel Vadotoffsets). It is parsed as a u64 value, e.g.
19*c66ec88fSEmmanuel Vadot
20*c66ec88fSEmmanuel Vadot/ {
21*c66ec88fSEmmanuel Vadot	chosen {
22*c66ec88fSEmmanuel Vadot		kaslr-seed = <0xfeedbeef 0xc0def00d>;
23*c66ec88fSEmmanuel Vadot	};
24*c66ec88fSEmmanuel Vadot};
25*c66ec88fSEmmanuel Vadot
26*c66ec88fSEmmanuel VadotNote that if this property is set from UEFI (or a bootloader in EFI
27*c66ec88fSEmmanuel Vadotmode) when EFI_RNG_PROTOCOL is supported, it will be overwritten by
28*c66ec88fSEmmanuel Vadotthe Linux EFI stub (which will populate the property itself, using
29*c66ec88fSEmmanuel VadotEFI_RNG_PROTOCOL).
30*c66ec88fSEmmanuel Vadot
31*c66ec88fSEmmanuel Vadotstdout-path
32*c66ec88fSEmmanuel Vadot-----------
33*c66ec88fSEmmanuel Vadot
34*c66ec88fSEmmanuel VadotDevice trees may specify the device to be used for boot console output
35*c66ec88fSEmmanuel Vadotwith a stdout-path property under /chosen, as described in the Devicetree
36*c66ec88fSEmmanuel VadotSpecification, e.g.
37*c66ec88fSEmmanuel Vadot
38*c66ec88fSEmmanuel Vadot/ {
39*c66ec88fSEmmanuel Vadot	chosen {
40*c66ec88fSEmmanuel Vadot		stdout-path = "/serial@f00:115200";
41*c66ec88fSEmmanuel Vadot	};
42*c66ec88fSEmmanuel Vadot
43*c66ec88fSEmmanuel Vadot	serial@f00 {
44*c66ec88fSEmmanuel Vadot		compatible = "vendor,some-uart";
45*c66ec88fSEmmanuel Vadot		reg = <0xf00 0x10>;
46*c66ec88fSEmmanuel Vadot	};
47*c66ec88fSEmmanuel Vadot};
48*c66ec88fSEmmanuel Vadot
49*c66ec88fSEmmanuel VadotIf the character ":" is present in the value, this terminates the path.
50*c66ec88fSEmmanuel VadotThe meaning of any characters following the ":" is device-specific, and
51*c66ec88fSEmmanuel Vadotmust be specified in the relevant binding documentation.
52*c66ec88fSEmmanuel Vadot
53*c66ec88fSEmmanuel VadotFor UART devices, the preferred binding is a string in the form:
54*c66ec88fSEmmanuel Vadot
55*c66ec88fSEmmanuel Vadot	<baud>{<parity>{<bits>{<flow>}}}
56*c66ec88fSEmmanuel Vadot
57*c66ec88fSEmmanuel Vadotwhere
58*c66ec88fSEmmanuel Vadot
59*c66ec88fSEmmanuel Vadot	baud	- baud rate in decimal
60*c66ec88fSEmmanuel Vadot	parity	- 'n' (none), 'o', (odd) or 'e' (even)
61*c66ec88fSEmmanuel Vadot	bits	- number of data bits
62*c66ec88fSEmmanuel Vadot	flow	- 'r' (rts)
63*c66ec88fSEmmanuel Vadot
64*c66ec88fSEmmanuel VadotFor example: 115200n8r
65*c66ec88fSEmmanuel Vadot
66*c66ec88fSEmmanuel VadotImplementation note: Linux will look for the property "linux,stdout-path" or
67*c66ec88fSEmmanuel Vadoton PowerPC "stdout" if "stdout-path" is not found.  However, the
68*c66ec88fSEmmanuel Vadot"linux,stdout-path" and "stdout" properties are deprecated. New platforms
69*c66ec88fSEmmanuel Vadotshould only use the "stdout-path" property.
70*c66ec88fSEmmanuel Vadot
71*c66ec88fSEmmanuel Vadotlinux,booted-from-kexec
72*c66ec88fSEmmanuel Vadot-----------------------
73*c66ec88fSEmmanuel Vadot
74*c66ec88fSEmmanuel VadotThis property is set (currently only on PowerPC, and only needed on
75*c66ec88fSEmmanuel Vadotbook3e) by some versions of kexec-tools to tell the new kernel that it
76*c66ec88fSEmmanuel Vadotis being booted by kexec, as the booting environment may differ (e.g.
77*c66ec88fSEmmanuel Vadota different secondary CPU release mechanism)
78*c66ec88fSEmmanuel Vadot
79*c66ec88fSEmmanuel Vadotlinux,usable-memory-range
80*c66ec88fSEmmanuel Vadot-------------------------
81*c66ec88fSEmmanuel Vadot
82*c66ec88fSEmmanuel VadotThis property (arm64 only) holds a base address and size, describing a
83*c66ec88fSEmmanuel Vadotlimited region in which memory may be considered available for use by
84*c66ec88fSEmmanuel Vadotthe kernel. Memory outside of this range is not available for use.
85*c66ec88fSEmmanuel Vadot
86*c66ec88fSEmmanuel VadotThis property describes a limitation: memory within this range is only
87*c66ec88fSEmmanuel Vadotvalid when also described through another mechanism that the kernel
88*c66ec88fSEmmanuel Vadotwould otherwise use to determine available memory (e.g. memory nodes
89*c66ec88fSEmmanuel Vadotor the EFI memory map). Valid memory may be sparse within the range.
90*c66ec88fSEmmanuel Vadote.g.
91*c66ec88fSEmmanuel Vadot
92*c66ec88fSEmmanuel Vadot/ {
93*c66ec88fSEmmanuel Vadot	chosen {
94*c66ec88fSEmmanuel Vadot		linux,usable-memory-range = <0x9 0xf0000000 0x0 0x10000000>;
95*c66ec88fSEmmanuel Vadot	};
96*c66ec88fSEmmanuel Vadot};
97*c66ec88fSEmmanuel Vadot
98*c66ec88fSEmmanuel VadotThe main usage is for crash dump kernel to identify its own usable
99*c66ec88fSEmmanuel Vadotmemory and exclude, at its boot time, any other memory areas that are
100*c66ec88fSEmmanuel Vadotpart of the panicked kernel's memory.
101*c66ec88fSEmmanuel Vadot
102*c66ec88fSEmmanuel VadotWhile this property does not represent a real hardware, the address
103*c66ec88fSEmmanuel Vadotand the size are expressed in #address-cells and #size-cells,
104*c66ec88fSEmmanuel Vadotrespectively, of the root node.
105*c66ec88fSEmmanuel Vadot
106*c66ec88fSEmmanuel Vadotlinux,elfcorehdr
107*c66ec88fSEmmanuel Vadot----------------
108*c66ec88fSEmmanuel Vadot
109*c66ec88fSEmmanuel VadotThis property (currently used only on arm64) holds the memory range,
110*c66ec88fSEmmanuel Vadotthe address and the size, of the elf core header which mainly describes
111*c66ec88fSEmmanuel Vadotthe panicked kernel's memory layout as PT_LOAD segments of elf format.
112*c66ec88fSEmmanuel Vadote.g.
113*c66ec88fSEmmanuel Vadot
114*c66ec88fSEmmanuel Vadot/ {
115*c66ec88fSEmmanuel Vadot	chosen {
116*c66ec88fSEmmanuel Vadot		linux,elfcorehdr = <0x9 0xfffff000 0x0 0x800>;
117*c66ec88fSEmmanuel Vadot	};
118*c66ec88fSEmmanuel Vadot};
119*c66ec88fSEmmanuel Vadot
120*c66ec88fSEmmanuel VadotWhile this property does not represent a real hardware, the address
121*c66ec88fSEmmanuel Vadotand the size are expressed in #address-cells and #size-cells,
122*c66ec88fSEmmanuel Vadotrespectively, of the root node.
123*c66ec88fSEmmanuel Vadot
124*c66ec88fSEmmanuel Vadotlinux,initrd-start and linux,initrd-end
125*c66ec88fSEmmanuel Vadot---------------------------------------
126*c66ec88fSEmmanuel Vadot
127*c66ec88fSEmmanuel VadotThese properties hold the physical start and end address of an initrd that's
128*c66ec88fSEmmanuel Vadotloaded by the bootloader. Note that linux,initrd-start is inclusive, but
129*c66ec88fSEmmanuel Vadotlinux,initrd-end is exclusive.
130*c66ec88fSEmmanuel Vadote.g.
131*c66ec88fSEmmanuel Vadot
132*c66ec88fSEmmanuel Vadot/ {
133*c66ec88fSEmmanuel Vadot	chosen {
134*c66ec88fSEmmanuel Vadot		linux,initrd-start = <0x82000000>;
135*c66ec88fSEmmanuel Vadot		linux,initrd-end = <0x82800000>;
136*c66ec88fSEmmanuel Vadot	};
137*c66ec88fSEmmanuel Vadot};
138