aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/arm64/booting.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/arm64/booting.txt')
-rw-r--r--Documentation/arm64/booting.txt51
1 files changed, 43 insertions, 8 deletions
diff --git a/Documentation/arm64/booting.txt b/Documentation/arm64/booting.txt
index 37fc4f632176..f3c05b5f9f08 100644
--- a/Documentation/arm64/booting.txt
+++ b/Documentation/arm64/booting.txt
@@ -72,27 +72,54 @@ The decompressed kernel image contains a 64-byte header as follows:
72 72
73 u32 code0; /* Executable code */ 73 u32 code0; /* Executable code */
74 u32 code1; /* Executable code */ 74 u32 code1; /* Executable code */
75 u64 text_offset; /* Image load offset */ 75 u64 text_offset; /* Image load offset, little endian */
76 u64 res0 = 0; /* reserved */ 76 u64 image_size; /* Effective Image size, little endian */
77 u64 res1 = 0; /* reserved */ 77 u64 flags; /* kernel flags, little endian */
78 u64 res2 = 0; /* reserved */ 78 u64 res2 = 0; /* reserved */
79 u64 res3 = 0; /* reserved */ 79 u64 res3 = 0; /* reserved */
80 u64 res4 = 0; /* reserved */ 80 u64 res4 = 0; /* reserved */
81 u32 magic = 0x644d5241; /* Magic number, little endian, "ARM\x64" */ 81 u32 magic = 0x644d5241; /* Magic number, little endian, "ARM\x64" */
82 u32 res5 = 0; /* reserved */ 82 u32 res5; /* reserved (used for PE COFF offset) */
83 83
84 84
85Header notes: 85Header notes:
86 86
87- As of v3.17, all fields are little endian unless stated otherwise.
88
87- code0/code1 are responsible for branching to stext. 89- code0/code1 are responsible for branching to stext.
90
88- when booting through EFI, code0/code1 are initially skipped. 91- when booting through EFI, code0/code1 are initially skipped.
89 res5 is an offset to the PE header and the PE header has the EFI 92 res5 is an offset to the PE header and the PE header has the EFI
90 entry point (efi_stub_entry). When the stub has done its work, it 93 entry point (efi_stub_entry). When the stub has done its work, it
91 jumps to code0 to resume the normal boot process. 94 jumps to code0 to resume the normal boot process.
92 95
93The image must be placed at the specified offset (currently 0x80000) 96- Prior to v3.17, the endianness of text_offset was not specified. In
94from the start of the system RAM and called there. The start of the 97 these cases image_size is zero and text_offset is 0x80000 in the
95system RAM must be aligned to 2MB. 98 endianness of the kernel. Where image_size is non-zero image_size is
99 little-endian and must be respected. Where image_size is zero,
100 text_offset can be assumed to be 0x80000.
101
102- The flags field (introduced in v3.17) is a little-endian 64-bit field
103 composed as follows:
104 Bit 0: Kernel endianness. 1 if BE, 0 if LE.
105 Bits 1-63: Reserved.
106
107- When image_size is zero, a bootloader should attempt to keep as much
108 memory as possible free for use by the kernel immediately after the
109 end of the kernel image. The amount of space required will vary
110 depending on selected features, and is effectively unbound.
111
112The Image must be placed text_offset bytes from a 2MB aligned base
113address near the start of usable system RAM and called there. Memory
114below that base address is currently unusable by Linux, and therefore it
115is strongly recommended that this location is the start of system RAM.
116At least image_size bytes from the start of the image must be free for
117use by the kernel.
118
119Any memory described to the kernel (even that below the 2MB aligned base
120address) which is not marked as reserved from the kernel e.g. with a
121memreserve region in the device tree) will be considered as available to
122the kernel.
96 123
97Before jumping into the kernel, the following conditions must be met: 124Before jumping into the kernel, the following conditions must be met:
98 125
@@ -141,6 +168,14 @@ Before jumping into the kernel, the following conditions must be met:
141 the kernel image will be entered must be initialised by software at a 168 the kernel image will be entered must be initialised by software at a
142 higher exception level to prevent execution in an UNKNOWN state. 169 higher exception level to prevent execution in an UNKNOWN state.
143 170
171 For systems with a GICv3 interrupt controller:
172 - If EL3 is present:
173 ICC_SRE_EL3.Enable (bit 3) must be initialiased to 0b1.
174 ICC_SRE_EL3.SRE (bit 0) must be initialised to 0b1.
175 - If the kernel is entered at EL1:
176 ICC.SRE_EL2.Enable (bit 3) must be initialised to 0b1
177 ICC_SRE_EL2.SRE (bit 0) must be initialised to 0b1.
178
144The requirements described above for CPU mode, caches, MMUs, architected 179The requirements described above for CPU mode, caches, MMUs, architected
145timers, coherency and system registers apply to all CPUs. All CPUs must 180timers, coherency and system registers apply to all CPUs. All CPUs must
146enter the kernel in the same exception level. 181enter the kernel in the same exception level.