Line data Source code
1 1 : /*
2 : * Copyright (c) 2024 Intel Corporation
3 : *
4 : * SPDX-License-Identifier: Apache-2.0
5 : */
6 : #ifndef ZEPHYR_INCLUDE_PLATFORM_PLATFORM_H_
7 : #define ZEPHYR_INCLUDE_PLATFORM_PLATFORM_H_
8 :
9 : /**
10 : * @file
11 : * @brief SoC and Board hooks
12 : *
13 : * This header file contains function prototypes for the interfaces between
14 : * Zephyr's architecture and initialization code and SoC/board-specific logic
15 : * that resides under boards/ and soc/
16 : *
17 : * @note These are all standard SoC and board interfaces that are exported from
18 : * SoC/board-specific logic to OS internal logic. These should never be accessed
19 : * directly from application code but may be freely used within the OS.
20 : */
21 :
22 : #if defined(CONFIG_SOC_EARLY_RESET_HOOK) || defined(__DOXYGEN__)
23 : /**
24 : * @brief SoC hook executed before data RAM initialization, at the beginning
25 : * of the reset vector.
26 : *
27 : * This hook is implemented by the SoC and can be used to perform any
28 : * SoC-specific initialization. Refer to :kconfig:option:`SOC_EARLY_RESET_HOOK`
29 : * and relevant architecture zephyr-rtos startup implementation for more details.
30 : */
31 1 : void soc_early_reset_hook(void);
32 : #else
33 : #define soc_early_reset_hook() do { } while (0)
34 : #endif
35 :
36 : #if defined(CONFIG_SOC_RESET_HOOK) || defined(__DOXYGEN__)
37 : /**
38 : * @brief SoC hook executed at the beginning of the reset vector.
39 : *
40 : * This hook is implemented by the SoC and can be used to perform any
41 : * SoC-specific initialization.
42 : */
43 1 : void soc_reset_hook(void);
44 : #else
45 : #define soc_reset_hook() do { } while (0)
46 : #endif
47 :
48 : #if defined(CONFIG_SOC_PREP_HOOK) || defined(__DOXYGEN__)
49 : /**
50 : * @brief SoC hook executed after the reset vector.
51 : *
52 : * This hook is implemented by the SoC and can be used to perform any
53 : * SoC-specific initialization.
54 : */
55 1 : void soc_prep_hook(void);
56 : #else
57 : #define soc_prep_hook() do { } while (0)
58 : #endif
59 :
60 : #if defined(CONFIG_SOC_EARLY_INIT_HOOK) || defined(__DOXYGEN__)
61 : /**
62 : * @brief SoC hook executed before the kernel and devices are initialized.
63 : *
64 : * This hook is implemented by the SoC and can be used to perform any
65 : * SoC-specific initialization.
66 : */
67 1 : void soc_early_init_hook(void);
68 : #else
69 : #define soc_early_init_hook() do { } while (0)
70 : #endif
71 :
72 : #if defined(CONFIG_SOC_LATE_INIT_HOOK) || defined(__DOXYGEN__)
73 : /**
74 : * @brief SoC hook executed after the kernel and devices are initialized.
75 : *
76 : * This hook is implemented by the SoC and can be used to perform any
77 : * SoC-specific initialization.
78 : */
79 1 : void soc_late_init_hook(void);
80 : #else
81 : #define soc_late_init_hook() do { } while (0)
82 : #endif
83 :
84 : #if defined(CONFIG_SOC_PER_CORE_INIT_HOOK) || defined(__DOXYGEN__)
85 : /**
86 : * @brief SoC per-core initialization
87 : *
88 : * This hook is implemented by the SoC and can be used to perform any
89 : * SoC-specific per-core initialization
90 : */
91 1 : void soc_per_core_init_hook(void);
92 : #else
93 : #define soc_per_core_init_hook() do { } while (0)
94 : #endif
95 :
96 : #if defined(CONFIG_BOARD_EARLY_INIT_HOOK) || defined(__DOXYGEN__)
97 : /**
98 : * @brief Board hook executed before the kernel starts.
99 : *
100 : * This is called before the kernel has started. This hook
101 : * is implemented by the board and can be used to perform any board-specific
102 : * initialization.
103 : */
104 1 : void board_early_init_hook(void);
105 : #else
106 : #define board_early_init_hook() do { } while (0)
107 : #endif
108 :
109 : #if defined(CONFIG_BOARD_LATE_INIT_HOOK) || defined(__DOXYGEN__)
110 : /**
111 : * @brief Board hook executed after the kernel starts.
112 : *
113 : * This is called after the kernel has started, but before the main function is
114 : * called. This hook is implemented by the board and can be used to perform
115 : * any board-specific initialization.
116 : */
117 1 : void board_late_init_hook(void);
118 : #else
119 : #define board_late_init_hook() do { } while (0)
120 : #endif
121 :
122 : #endif
|