Skip to content

Commit 4418482

Browse files
committed
dt: Remove booting-without-of.rst
booting-without-of.rst is an ancient document that first outlined Flattened DeviceTree on PowerPC initially. The DT world has evolved a lot in the 15 years since and booting-without-of.rst is pretty stale. The name of the document itself is confusing if you don't understand the evolution from real 'OpenFirmware'. Most of what booting-without-of.rst contains is now in the DT specification (which evolved out of the ePAPR). The few things that weren't documented in the DT specification are now. All that remains is the boot entry details, so let's move these to arch specific documents. The exception is arm which already has the same details documented. Cc: Frank Rowand <[email protected]> Cc: Mauro Carvalho Chehab <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Thomas Bogendoerfer <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Yoshinori Sato <[email protected]> Cc: Rich Felker <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Acked-by: Benjamin Herrenschmidt <[email protected]> Acked-by: Borislav Petkov <[email protected]> Acked-by: Michael Ellerman <[email protected]> (powerpc) Signed-off-by: Rob Herring <[email protected]>
1 parent 588614b commit 4418482

File tree

10 files changed

+175
-1586
lines changed

10 files changed

+175
-1586
lines changed

Documentation/devicetree/booting-without-of.rst

Lines changed: 0 additions & 1585 deletions
This file was deleted.

Documentation/devicetree/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ Open Firmware and Device Tree
1515
overlay-notes
1616

1717
bindings/index
18-
booting-without-of

Documentation/mips/booting.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
BMIPS DeviceTree Booting
4+
------------------------
5+
6+
Some bootloaders only support a single entry point, at the start of the
7+
kernel image. Other bootloaders will jump to the ELF start address.
8+
Both schemes are supported; CONFIG_BOOT_RAW=y and CONFIG_NO_EXCEPT_FILL=y,
9+
so the first instruction immediately jumps to kernel_entry().
10+
11+
Similar to the arch/arm case (b), a DT-aware bootloader is expected to
12+
set up the following registers:
13+
14+
a0 : 0
15+
16+
a1 : 0xffffffff
17+
18+
a2 : Physical pointer to the device tree block (defined in chapter
19+
II) in RAM. The device tree can be located anywhere in the first
20+
512MB of the physical address space (0x00000000 - 0x1fffffff),
21+
aligned on a 64 bit boundary.
22+
23+
Legacy bootloaders do not use this convention, and they do not pass in a
24+
DT block. In this case, Linux will look for a builtin DTB, selected via
25+
CONFIG_DT_*.
26+
27+
This convention is defined for 32-bit systems only, as there are not
28+
currently any 64-bit BMIPS implementations.

Documentation/mips/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ MIPS-specific Documentation
88
:maxdepth: 2
99
:numbered:
1010

11+
booting
1112
ingenic-tcu
1213

1314
.. only:: subproject and html

Documentation/powerpc/booting.rst

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
DeviceTree Booting
4+
------------------
5+
6+
During the development of the Linux/ppc64 kernel, and more specifically, the
7+
addition of new platform types outside of the old IBM pSeries/iSeries pair, it
8+
was decided to enforce some strict rules regarding the kernel entry and
9+
bootloader <-> kernel interfaces, in order to avoid the degeneration that had
10+
become the ppc32 kernel entry point and the way a new platform should be added
11+
to the kernel. The legacy iSeries platform breaks those rules as it predates
12+
this scheme, but no new board support will be accepted in the main tree that
13+
doesn't follow them properly. In addition, since the advent of the arch/powerpc
14+
merged architecture for ppc32 and ppc64, new 32-bit platforms and 32-bit
15+
platforms which move into arch/powerpc will be required to use these rules as
16+
well.
17+
18+
The main requirement that will be defined in more detail below is the presence
19+
of a device-tree whose format is defined after Open Firmware specification.
20+
However, in order to make life easier to embedded board vendors, the kernel
21+
doesn't require the device-tree to represent every device in the system and only
22+
requires some nodes and properties to be present. For example, the kernel does
23+
not require you to create a node for every PCI device in the system. It is a
24+
requirement to have a node for PCI host bridges in order to provide interrupt
25+
routing information and memory/IO ranges, among others. It is also recommended
26+
to define nodes for on chip devices and other buses that don't specifically fit
27+
in an existing OF specification. This creates a great flexibility in the way the
28+
kernel can then probe those and match drivers to device, without having to hard
29+
code all sorts of tables. It also makes it more flexible for board vendors to do
30+
minor hardware upgrades without significantly impacting the kernel code or
31+
cluttering it with special cases.
32+
33+
34+
Entry point
35+
~~~~~~~~~~~
36+
37+
There is one single entry point to the kernel, at the start
38+
of the kernel image. That entry point supports two calling
39+
conventions:
40+
41+
a) Boot from Open Firmware. If your firmware is compatible
42+
with Open Firmware (IEEE 1275) or provides an OF compatible
43+
client interface API (support for "interpret" callback of
44+
forth words isn't required), you can enter the kernel with:
45+
46+
r5 : OF callback pointer as defined by IEEE 1275
47+
bindings to powerpc. Only the 32-bit client interface
48+
is currently supported
49+
50+
r3, r4 : address & length of an initrd if any or 0
51+
52+
The MMU is either on or off; the kernel will run the
53+
trampoline located in arch/powerpc/kernel/prom_init.c to
54+
extract the device-tree and other information from open
55+
firmware and build a flattened device-tree as described
56+
in b). prom_init() will then re-enter the kernel using
57+
the second method. This trampoline code runs in the
58+
context of the firmware, which is supposed to handle all
59+
exceptions during that time.
60+
61+
b) Direct entry with a flattened device-tree block. This entry
62+
point is called by a) after the OF trampoline and can also be
63+
called directly by a bootloader that does not support the Open
64+
Firmware client interface. It is also used by "kexec" to
65+
implement "hot" booting of a new kernel from a previous
66+
running one. This method is what I will describe in more
67+
details in this document, as method a) is simply standard Open
68+
Firmware, and thus should be implemented according to the
69+
various standard documents defining it and its binding to the
70+
PowerPC platform. The entry point definition then becomes:
71+
72+
r3 : physical pointer to the device-tree block
73+
(defined in chapter II) in RAM
74+
75+
r4 : physical pointer to the kernel itself. This is
76+
used by the assembly code to properly disable the MMU
77+
in case you are entering the kernel with MMU enabled
78+
and a non-1:1 mapping.
79+
80+
r5 : NULL (as to differentiate with method a)
81+
82+
Note about SMP entry: Either your firmware puts your other
83+
CPUs in some sleep loop or spin loop in ROM where you can get
84+
them out via a soft reset or some other means, in which case
85+
you don't need to care, or you'll have to enter the kernel
86+
with all CPUs. The way to do that with method b) will be
87+
described in a later revision of this document.
88+
89+
Board supports (platforms) are not exclusive config options. An
90+
arbitrary set of board supports can be built in a single kernel
91+
image. The kernel will "know" what set of functions to use for a
92+
given platform based on the content of the device-tree. Thus, you
93+
should:
94+
95+
a) add your platform support as a _boolean_ option in
96+
arch/powerpc/Kconfig, following the example of PPC_PSERIES,
97+
PPC_PMAC and PPC_MAPLE. The later is probably a good
98+
example of a board support to start from.
99+
100+
b) create your main platform file as
101+
"arch/powerpc/platforms/myplatform/myboard_setup.c" and add it
102+
to the Makefile under the condition of your ``CONFIG_``
103+
option. This file will define a structure of type "ppc_md"
104+
containing the various callbacks that the generic code will
105+
use to get to your platform specific code
106+
107+
A kernel image may support multiple platforms, but only if the
108+
platforms feature the same core architecture. A single kernel build
109+
cannot support both configurations with Book E and configurations
110+
with classic Powerpc architectures.

Documentation/powerpc/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ powerpc
77
.. toctree::
88
:maxdepth: 1
99

10+
booting
1011
bootwrapper
1112
cpu_families
1213
cpu_features

Documentation/sh/booting.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
DeviceTree Booting
4+
------------------
5+
6+
Device-tree compatible SH bootloaders are expected to provide the physical
7+
address of the device tree blob in r4. Since legacy bootloaders did not
8+
guarantee any particular initial register state, kernels built to
9+
inter-operate with old bootloaders must either use a builtin DTB or
10+
select a legacy board option (something other than CONFIG_SH_DEVICE_TREE)
11+
that does not use device tree. Support for the latter is being phased out
12+
in favor of device tree.

Documentation/sh/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ SuperH Interfaces Guide
77
.. toctree::
88
:maxdepth: 1
99

10+
booting
1011
new-machine
1112
register-banks
1213

Documentation/x86/booting-dt.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
DeviceTree Booting
4+
------------------
5+
6+
There is one single 32bit entry point to the kernel at code32_start,
7+
the decompressor (the real mode entry point goes to the same 32bit
8+
entry point once it switched into protected mode). That entry point
9+
supports one calling convention which is documented in
10+
Documentation/x86/boot.rst
11+
The physical pointer to the device-tree block is passed via setup_data
12+
which requires at least boot protocol 2.09.
13+
The type filed is defined as
14+
15+
#define SETUP_DTB 2
16+
17+
This device-tree is used as an extension to the "boot page". As such it
18+
does not parse / consider data which is already covered by the boot
19+
page. This includes memory size, reserved ranges, command line arguments
20+
or initrd address. It simply holds information which can not be retrieved
21+
otherwise like interrupt routing or a list of devices behind an I2C bus.

Documentation/x86/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ x86-specific Documentation
99
:numbered:
1010

1111
boot
12+
booting-dt
1213
topology
1314
exception-tables
1415
kernel-stacks

0 commit comments

Comments
 (0)