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 /*
4  * Derived from Cavium's BSD-3 Clause OCTEONTX-SDK-6.2.0.
5  */
6 
7 #include <commonlib/helpers.h>
8 #include <soc/bootblock.h>
9 #include <soc/sysreg.h>
10 #include <soc/timer.h>
11 #include <libbdk-arch/bdk-asm.h>
12 
13 static void init_sysreg(void)
14 {
15  /* The defaults for write buffer timeouts are poor */
16  u64 cvmmemctl0;
17  BDK_MRS(s3_0_c11_c0_4, cvmmemctl0);
18  cvmmemctl0 |= AP_CVMMEMCTL0_EL1_WBFTONSHENA |
20  BDK_MSR(s3_0_c11_c0_4, cvmmemctl0);
21 }
22 
24 {
25 }
26 
28 {
29  /* initialize system registers */
30  init_sysreg();
31 
32  /* Set watchdog to 5 seconds timeout */
33  watchdog_set(0, 5000);
34  watchdog_poke(0);
35 
36  /* TODO: additional clock init? */
37 }
#define AP_CVMMEMCTL0_EL1_WBFTONSHENA
Definition: sysreg.h:39
#define AP_CVMMEMCTL0_EL1_WBFTOMRGCLRENA
Definition: sysreg.h:40
void bootblock_soc_early_init(void)
Definition: bootblock.c:20
void bootblock_soc_init(void)
Definition: bootblock.c:27
static void init_sysreg(void)
Definition: bootblock.c:13
void watchdog_poke(const size_t index)
Signal the watchdog that we are still running.
Definition: timer.c:174
void watchdog_set(const size_t index, unsigned int timeout_ms)
Setup the watchdog to expire in timeout_ms milliseconds.
Definition: timer.c:137
uint64_t u64
Definition: stdint.h:54