commit 6955a5907f087d6fb6184c004e26825cb6f245a8 parent 0f222604054cdb3f7a73eeb07b8b074932383c8c Author: Roberto Vargas <roberto.vargas@arm.com> Date: Fri, 26 Apr 2019 15:09:16 +0100 Merge "DESIGN: Add some info about system initialization" Diffstat:
M | doc/DESIGN | | | 34 | +++++++++++++++++++++++++++++++++- |
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/doc/DESIGN b/doc/DESIGN @@ -165,7 +165,39 @@ This is where the test framework lives. There are 5 types of tests. 2) System initialization ------------------------ -TBD +The native target begins execution in rom-crt.s. This is the cold +boot entrypoint of the ROM firmware. + +The idea is to do as much of the initialization process within the C +environment. + +In crt.s the following steps are performed: + + - Set up vector table + - Set up initial stack for entry to the C environment + - Clear BSS + - Call main() + +The main() function performs the following actions: + + - Initialize the machine structure by calling imach() + - Initialize the device driver subsystem by calling idev() + - Enable interrupts + - Populate initial namespace + - Print some diagnostic information + - Drop into the debug language interface + +The imach() function will populate the struct mach structure with the +stack pointer location and size, as well as the environment variable +location and size. + +Environment variables are used to pass information between images +within the same exception level. + +The trapframe is populated for initial exit to the lower exception +level. The key registers are SP, ELR and SPSR. + +At the end of imach() the instruction and data caches are invalidated. 3) RMC handling flow --------------------