coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
debug_feature.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
4 #include <console/console.h>
5 #include <spi_flash.h>
6 
7 #define SI_DESC_OEM_SECTION_OFFSET 0xF00
8 #define PRE_MEM_FEATURE_CTRL_OFFSET SI_DESC_OEM_SECTION_OFFSET
9 #define PRE_MEM_FEATURE_CTRL_SZ 64
10 #define SI_DESC_REGION_SZ 4096
11 
12 struct pre_mem_ft {
13  uint8_t cse_fw_update_disable; /* Byte location: 0xF00 */
15 };
16 
17 static struct pre_mem_ft pre_mem_debug;
18 
19 _Static_assert(sizeof(struct pre_mem_ft) % 64 == 0 && sizeof(struct pre_mem_ft) <= 256,
20  "sizeof(struct pre_mem_ft) must be a multiple of 64 bytes and up to 256 bytes");
21 
23 {
24  printk(BIOS_DEBUG, "rt_debug: pre_mem_debug.cse_fw_update_disable=%d\n",
26 
28 }
29 
31 {
34  printk(BIOS_ERR, "Failed to read Descriptor Region from SPI Flash\n");
35  return 1;
36  }
37  return 0;
38 }
const struct spi_flash * boot_device_spi_flash(void)
#define printk(level,...)
Definition: stdlib.h:16
_Static_assert(sizeof(struct pre_mem_ft) % 64==0 &&sizeof(struct pre_mem_ft)<=256, "sizeof(struct pre_mem_ft) must be a multiple of 64 bytes and up to 256 bytes")
#define PRE_MEM_FEATURE_CTRL_SZ
Definition: debug_feature.c:9
#define PRE_MEM_FEATURE_CTRL_OFFSET
Definition: debug_feature.c:8
static struct pre_mem_ft pre_mem_debug
Definition: debug_feature.c:17
bool is_debug_cse_fw_update_disable(void)
Definition: debug_feature.c:22
uint8_t pre_mem_debug_init(void)
Definition: debug_feature.c:30
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
Definition: loglevel.h:72
int spi_flash_read(const struct spi_flash *flash, u32 offset, size_t len, void *buf)
Definition: spi_flash.c:531
unsigned char uint8_t
Definition: stdint.h:8
uint8_t reserved[63]
Definition: debug_feature.c:14
uint8_t cse_fw_update_disable
Definition: debug_feature.c:13