1# Kernel init hook options 2 3# Copyright (c) 2024 Intel Corporation 4# SPDX-License-Identifier: Apache-2.0 5 6 7menu "SoC and Board Hooks" 8 9config SOC_EARLY_RESET_HOOK 10 bool "Run SoC-specific early reset hook" 11 help 12 Run a SoC-specific hook early in the reset/startup code (__start). 13 A custom hook soc_early_reset_hook() will be executed at the beginning 14 of the architecture-specific startup code, after hardware has been 15 configured (as required by CONFIG_INIT_ARCH_HW_AT_BOOT) but before 16 architecture's own resume logic. 17 18 Returning from this hook is not mandatory: it can be used to implement 19 special logic to resume execution in some scenarios (for example, when 20 a bootloader is used). 21 22 The stack pointer register should be considered as not initialized upon 23 call to this hook. In particular, this means that the hook is NOT allowed 24 to "push" any data using this stack pointer value. However, the hook may 25 use an implementation-specific area as stack if desired; in such case, 26 the original value of the stack pointer needs not to be "restored" before 27 returning control to the hook's caller. 28 29 Additional constraints may be imposed on the hook by the architecture. 30 31config SOC_RESET_HOOK 32 bool "Run SoC-specific reset hook" 33 help 34 Run a SoC-specific hook in the reset/startup code (__start). 35 36 A custom hook soc_reset_hook() will be executed near the beginning 37 of the architecture-specific startup code, after hardware has been 38 configured (as required by CONFIG_INIT_ARCH_HW_AT_BOOT), a stack 39 pointer has been loaded and the architecture's own resume logic 40 has executed (if CONFIG_PM_S2RAM is enabled). Because this hook 41 runs after the resume logic, it is not called when the system 42 resumes from a suspend-to-RAM power state. 43 44config SOC_PREP_HOOK 45 bool "Run early SoC preparation hook" 46 help 47 Run an early SoC preparation hook. 48 49 A custom hook soc_prep_hook() is executed at the beginning of the 50 c prep code (prep_c). soc_prep_hook() must be implemented by the SoC. 51 52config SOC_EARLY_INIT_HOOK 53 bool "Run early SoC hook" 54 help 55 Run an early SoC initialization hook. 56 57 A custom SoC hook soc_early_init_hook() is executed before the kernel and 58 devices are initialized 59 60config SOC_LATE_INIT_HOOK 61 bool "Run late SoC hook" 62 help 63 Run a late SoC initialization hook. 64 65 A custom SoC hook soc_late_init_hook() is executed after the kernel and 66 devices are initialized 67 68config SOC_PER_CORE_INIT_HOOK 69 bool "Run SoC per-core initialization hook" 70 help 71 Run an SoC initialization hook for every core 72 73 A custom SoC hook soc_per_core_init_hook() is executeds at the end of 74 arch_kernel_init() for the primary core, and at the end of arch_secondary_cpu_init() 75 for secondary cores. 76 77config BOARD_EARLY_INIT_HOOK 78 bool "Run early board hook" 79 help 80 Run an early board initialization hook. 81 82 A custom board hook board_early_init_hook() is executed before the kernel and 83 devices are initialized 84 85config BOARD_LATE_INIT_HOOK 86 bool "Run late board hook" 87 help 88 Run a late board initialization hook. 89 90 A custom board hook board_late_init_hook() is executed after the kernel and 91 devices are initialized 92 93endmenu 94