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