|  | # Kernel init hook options | 
|  |  | 
|  | # Copyright (c) 2024 Intel Corporation | 
|  | # SPDX-License-Identifier: Apache-2.0 | 
|  |  | 
|  |  | 
|  | menu "SoC and Board Hooks" | 
|  |  | 
|  | config SOC_EARLY_RESET_HOOK | 
|  | bool "Run SoC-specific early reset hook" | 
|  | help | 
|  | Run a SoC-specific hook early in the reset/startup code (__start). | 
|  | A custom hook soc_early_reset_hook() will be executed at the beginning | 
|  | of the architecture-specific startup code, after hardware has been | 
|  | configured (as required by CONFIG_INIT_ARCH_HW_AT_BOOT) but before | 
|  | architecture's own resume logic. | 
|  |  | 
|  | Returning from this hook is not mandatory: it can be used to implement | 
|  | special logic to resume execution in some scenarios (for example, when | 
|  | a bootloader is used). | 
|  |  | 
|  | The stack pointer register should be considered as not initialized upon | 
|  | call to this hook. In particular, this means that the hook is NOT allowed | 
|  | to "push" any data using this stack pointer value. However, the hook may | 
|  | use an implementation-specific area as stack if desired; in such case, | 
|  | the original value of the stack pointer needs not to be "restored" before | 
|  | returning control to the hook's caller. | 
|  |  | 
|  | Additional constraints may be imposed on the hook by the architecture. | 
|  |  | 
|  | config SOC_RESET_HOOK | 
|  | bool "Run SoC-specific reset hook" | 
|  | help | 
|  | Run a SoC-specific hook in the reset/startup code (__start). | 
|  |  | 
|  | A custom hook soc_reset_hook() will be executed near the beginning | 
|  | of the architecture-specific startup code, after hardware has been | 
|  | configured (as required by CONFIG_INIT_ARCH_HW_AT_BOOT), a stack | 
|  | pointer has been loaded and the architecture's own resume logic | 
|  | has executed (if CONFIG_PM_S2RAM is enabled). Because this hook | 
|  | runs after the resume logic, it is not called when the system | 
|  | resumes from a suspend-to-RAM power state. | 
|  |  | 
|  | config SOC_PREP_HOOK | 
|  | bool "Run early SoC preparation hook" | 
|  | help | 
|  | Run an early SoC preparation hook. | 
|  |  | 
|  | A custom hook soc_prep_hook() is executed at the beginning of the | 
|  | c prep code (prep_c). soc_prep_hook() must be implemented by the SoC. | 
|  |  | 
|  | config SOC_EARLY_INIT_HOOK | 
|  | bool "Run early SoC hook" | 
|  | help | 
|  | Run an early SoC initialization hook. | 
|  |  | 
|  | A custom SoC hook soc_early_init_hook() is executed before the kernel and | 
|  | devices are initialized | 
|  |  | 
|  | config SOC_LATE_INIT_HOOK | 
|  | bool "Run late SoC hook" | 
|  | help | 
|  | Run a late SoC initialization hook. | 
|  |  | 
|  | A custom SoC hook soc_late_init_hook() is executed after the kernel and | 
|  | devices are initialized | 
|  |  | 
|  | config SOC_PER_CORE_INIT_HOOK | 
|  | bool "Run SoC per-core initialization hook" | 
|  | help | 
|  | Run an SoC initialization hook for every core | 
|  |  | 
|  | A custom SoC hook soc_per_core_init_hook() is executeds at the end of | 
|  | arch_kernel_init() for the primary core, and at the end of arch_secondary_cpu_init() | 
|  | for secondary cores. | 
|  |  | 
|  | config BOARD_EARLY_INIT_HOOK | 
|  | bool "Run early board hook" | 
|  | help | 
|  | Run an early board initialization hook. | 
|  |  | 
|  | A custom board hook board_early_init_hook() is executed before the kernel and | 
|  | devices are initialized | 
|  |  | 
|  | config BOARD_LATE_INIT_HOOK | 
|  | bool "Run late board hook" | 
|  | help | 
|  | Run a late board initialization hook. | 
|  |  | 
|  | A custom board hook board_late_init_hook() is executed after the kernel and | 
|  | devices are initialized | 
|  |  | 
|  | endmenu |