1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 /*
4 * This file contains entry/exit functions for each stage during coreboot
5 * execution (bootblock entry and ramstage exit will depend on external
6 * loading).
7 *
8 * Entry points should be set in the linker script and honored by CBFS,
9 * so text section layout shouldn't matter. Still, it doesn't hurt to put
10 * stage_entry first (which XXXstage.ld will do automatically through the
11 * .text.stage_entry section created by -ffunction-sections).
12 */
13
14 #include <cbmem.h>
15 #include <arch/stages.h>
16
17 /**
18 * generic stage entry point. override this if board specific code is needed.
19 */
stage_entry(uintptr_t stage_arg)20 __weak void stage_entry(uintptr_t stage_arg)
21 {
22 if (!ENV_ROMSTAGE_OR_BEFORE)
23 _cbmem_top_ptr = stage_arg;
24 main();
25 }
26