coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
bootblock.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <arch/exception.h>
4 #include <console/console.h>
5 #include <delay.h>
6 #include <program_loading.h>
7 #include <symbols.h>
8 #include <timestamp.h>
9 #include <soc/bootblock.h>
10 
11 __attribute__((weak)) void bootblock_mainboard_early_init(void) { /* no-op */ }
12 __attribute__((weak)) void bootblock_soc_early_init(void) { /* do nothing */ }
13 __attribute__((weak)) void bootblock_soc_init(void) { /* do nothing */ }
14 __attribute__((weak)) void bootblock_mainboard_init(void) { /* do nothing */ }
15 
16 /* C code entry point for the boot block */
17 void bootblock_main(const uint64_t reg_x0,
18  const uint64_t reg_pc)
19 {
20  init_timer();
21 
22  /* Initialize timestamps if we have TIMESTAMP region in memlayout.ld. */
23  if (CONFIG(COLLECT_TIMESTAMPS) && REGION_SIZE(timestamp) > 0)
25 
28 
29  if (CONFIG(BOOTBLOCK_CONSOLE)) {
30  console_init();
32 
33  if (reg_x0)
35  "BOOTBLOCK: RST Boot Failure Code %lld\n",
36  reg_x0);
37  }
38 
41 
42  run_romstage();
43 }
void exception_init(void)
Definition: exception.c:120
#define printk(level,...)
Definition: stdlib.h:16
void bootblock_soc_early_init(void)
Definition: bootblock.c:20
void bootblock_soc_init(void)
Definition: bootblock.c:27
@ CONFIG
Definition: dsi_common.h:201
#define REGION_SIZE(name)
Definition: symbols.h:10
void console_init(void)
Definition: init.c:49
__weak void bootblock_mainboard_init(void)
Definition: bootblock.c:19
__weak void bootblock_mainboard_early_init(void)
Definition: bootblock.c:16
void timestamp_init(uint64_t base)
Definition: timestamp.c:146
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
Definition: loglevel.h:72
__weak void init_timer(void)
Definition: arch_timer.c:12
void run_romstage(void)
Definition: prog_loaders.c:18
void bootblock_main(const uint64_t reg_x0, const uint64_t reg_pc)
Definition: bootblock.c:17
unsigned long long uint64_t
Definition: stdint.h:17
#define timestamp_get()
Workaround for guard combination above.
Definition: timestamp.h:52