Boot Sequence

The Vita main application processor is a Cortex A9 MPcore. It implements ARM TrustZone for execution in both a non-secure world and a sandboxed Secure World.

Boot ROM
It is likely the the F00D processor (MeP Core) is the actual secure boot device rather than the ARM CPU. The F00D processor likely is Toshiba MEP based and is the first secure device ("first loader") to start on the Vita. Once it starts it likely maps the eMMC and directly reads in the second_loader.enp or second_loader.enp_ from the eMMC. This is in the native load format of the F00D bootrom. There are likely 2 layers of encryption. First it decrypts the per-console layer that was added during the install. After that it will decrypt the factory-encrypted layer then begin execution.

The second_loader is primarily responsible for preparing the ARM processor. It initializes DRAM and decrypts kernel_boot_loader.self into DRAM. The kernel_boot_loader.self contains both the secure world bootloader and kernel, as well as the non-secure boot loader. At this point the kprx_auth_sm.self and prog_rvk.srvk are both loaded into DRAM.

Finally, the second_loader resets itself with a pointer to the secure_kernel.enp or enp_. The F00D processor then restarts and loads the secure_kernel.enp in and again decrypts the per-console layer that was added by the install, and the factory layer. At this point the F00D processor secure kernel is prepared and it resets the ARM CPU at 0x40000000. This triggers the ARM secure boot process to begin.

Secure Kernel
The bootloader decompressed the ARZL secure kernel, loads it and sets up the VBAR and MVBAR. It then decompresses the ARZL non-secure bootloader and sets NS in SCR and jumps into non-secure bootloader. See Secure Bootloader for more information.

SceKblForKernel
The non-secure bootloader contains an embedded and likely stripped version of SceSysmem, SceKernelModulemgr, SceSblSmschedProxy, and some core drivers. The non-secure bootloader sets up the eMMC device (again) and loads.

ScePsp2BootConfig
This kernel module does not export any libraries. It only has a module init function that has a hard coded list of core kernel modules (ex: sysmem.skprx) which are loaded with calls back into SceKblForKernel. Once the core initialization is done, the next module to run is SceSysStateMgr.

SceSysStateMgr
This kernel module also does not export any libraries. Its init function first loads all the bootfs modules. Then it decrypts  and parses the System Configuration Script to load the remaining modules and finally either SceSafemode or SceShell.

Boot Partition
The boot partition is SLB2 formatted. It contains entries these files:

System Configuration Script
once decryption is a UTF-8 text file that is parsed by SceSysStateMgr. It is a very simple script format.

Comments
Comments start out with, as an example, here's the header of 1.69 psp2config.skprx
 * 1) PSP2 System Configuration for Release
 * 2) [NOTICE]
 * 3) This configuration is only for kernel_boot_loader_release.self.
 * 1) [NOTICE]
 * 2) This configuration is only for kernel_boot_loader_release.self.
 * 1) This configuration is only for kernel_boot_loader_release.self.

Conditionals
Conditionals start with  and end with. There are certain conditional constants defined in SceSysStateMgr. A table of known conditionals is below.

Example: if SAFE_MODE spawn	os0:ue/safemode.self end endif

Load
will load the kernel module at.

possibly stands for "test load." Possibly used in development units to load to module to dedicated devkit RAM.

Example: load	os0:kd/ngs.skprx

Spawn
will spawn an app and continue processing the script in the background.

will spawn an app and wait for it to exit before continuing processing the script.

is used to spawn. Specify a paramater to pass.

Known param constants:

Example: if UPDATE_MODE if UD0_EXIST spawn ud0:PSP2UPDATE/psp2swu.self else spawn ur0:PSP2UPDATE/psp2swu.self endif end endif

End
will end script processing

Boot Debug Checkpoint Codes
During the boot sequence, the various bootloaders will update a GPIO register specifying the progress into boot. This can be used to debug where in the boot process something fails.

GPIO
The GPIO registers are registered at  (turn off bits) and   (turn on bits). On PDEL units, this maps to the LED lights.

Suspend and Resume
Upon suspension, context is written to memory and a syscon command is issued to save the context pointer as well as other information (for example, if it should restart into update mode). When resuming, the boot process is the same as cold boot up until the secure kernel loader. After secure kernel loads, instead of decompressing and jumping to the non-secure kernel loader, it restores the saved context and returns to the kernel resume code.