1Dom0 kernel and ramdisk modules
2================================
3
4Xen is passed the dom0 kernel and initrd via a reference in the /chosen
5node of the device tree.
6
7Each node contains the following properties:
8
9- compatible
10
11	Must always include at least the generic compatiblity string:
12
13		"multiboot,module"
14
15	Optionally a more specific compatible string may be used in
16	addition to the above. One of:
17
18	- "multiboot,kernel"	-- the dom0 kernel
19	- "multiboot,ramdisk"	-- the dom0 ramdisk
20	- "xen,xsm-policy"	-- XSM policy blob
21
22	It is normally recommended to include a more specific
23	compatible string (if one applies) in addition to the generic
24	string (which must always be present).
25
26	Xen will assume that the first module which lacks a more
27	specific compatible string is a "multiboot,kernel".
28
29	Xen will examine each module, starting from the second
30	module that lacks a specific compatible string.  Xen will
31	check each such module for the XSM Magic number:
32
33	- For a module which has the XSM Magic number: it will be
34	  treated by Xen as if its compatible string was
35	  "xen,xsm-policy";
36
37	- For a module which does not have the XSM Magic: the second
38	  module lacking a compatible string will be treated by Xen as
39	  if its compatible string was "multiboot,ramdisk"; for the
40	  third and subsequent modules which lack a specific
41	  compatible string, Xen will not apply any special treatment.
42
43	This means if the ramdisk module is present and does not have the
44	compatible string "multiboot,ramdisk", then it must always be the
45	second module.
46
47	Note: This XSM Magic detection behavior was introduced by Xen 4.7.
48	Xen 4.6 (and downwards) still requires the XSM module to have the
49	compatible string "xen,xsm-policy".
50
51	Xen 4.4 supported a different set of legacy compatible strings
52	which remain supported such that systems supporting both 4.4
53	and later can use a single DTB.
54
55	- "xen,multiboot-module" equivalent to "multiboot,module"
56	- "xen,linux-zimage"     equivalent to "multiboot,kernel"
57	- "xen,linux-initrd"     equivalent to "multiboot,ramdisk"
58
59	For compatibility with Xen 4.4 the more specific "xen,linux-*"
60	names are non-optional and must be included.
61
62- reg
63
64	Specifies the physical address of the module in RAM and the
65	length of the module.
66
67- bootargs (optional)
68
69	Command line associated with this module. See below for the
70	priority of this field vs. other mechanisms of specifying the
71	bootargs for the kernel.
72
73Examples
74========
75
76A boot module of unspecified type:
77
78	module@0xc0000000 {
79		compatible = "multiboot,module";
80		reg = <0xc0000000 0x1234>;
81		bootargs = "...";
82	};
83
84A boot module containing a ramdisk:
85
86	module@0xd0000000 {
87		compatible = "multiboot,ramdisk", "multiboot,module";
88		reg = <0xd0000000 0x5678>;
89	};
90
91The previous examples are compatible with Xen 4.5+ only.
92
93To be compatible with Xen 4.4 as well use the legacy names:
94
95	module@0xd0000000 {
96		compatible = "xen,linux-initrd", "xen,multiboot-module";
97		reg = <0xd0000000 0x5678>;
98	};
99
100Command lines
101=============
102
103Xen also checks for properties directly under /chosen to find suitable command
104lines for Xen and Dom0. The logic is the following:
105
106 - If xen,xen-bootargs is present, it will be used for Xen.
107 - If xen,dom0-bootargs is present, it will be used for Dom0.
108 - If xen,xen-bootargs is _not_ present, but xen,dom0-bootargs is,
109   bootargs will be used for Xen.
110 - If a kernel boot module is present and has a bootargs property then
111   the top-level bootargs will used for Xen.
112 - If no Xen specific properties are present, bootargs is for Dom0.
113 - If xen,xen-bootargs is present, but xen,dom0-bootargs is missing,
114   bootargs will be used for Dom0.
115
116Most of these cases is to make booting with Xen-unaware bootloaders easier.
117For those you would hardcode the Xen commandline in the DTB under
118/chosen/xen,xen-bootargs and would let the bootloader set the Dom0 command
119line by writing bootargs (as for native Linux).
120A Xen-aware bootloader would set xen,xen-bootargs for Xen, xen,dom0-bootargs
121for Dom0 and bootargs for native Linux.
122