coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
vboot.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include <bootmode.h>
4 #include <device/i2c_simple.h>
5 #include <soc/i2c.h>
6 #include <soc/reg_access.h>
7 #include <spi_flash.h>
9 #include <security/vboot/vbnv.h>
10 
11 #include "reg_access.h"
12 #include "gen1.h"
13 #include "gen2.h"
14 
16 {
17  return 0;
18 }
19 
21 {
22  /* Not write protected */
23  return 0;
24 }
25 
27 {
28  const struct reg_script *script;
29 
30  /* Crypto Shield I2C Addresses:
31  *
32  * 0x29: AT97S3204T - TPM 1.2
33  * 0x50: ATAES132 - AES-128
34  * 0x60: ATECC108 - Elliptical Curve
35  * 0x64: ATSHA204 - SHA-256
36  * 0x68: DS3231M - RTC
37  */
38 
39  /* Determine the correct script for the board */
40  if (CONFIG(GALILEO_GEN2))
41  script = gen2_i2c_init;
42  else
43  /* Determine which I2C address is in use */
47 
48  /* Direct the I2C SDA and SCL signals to the Arduino connector */
49  reg_script_run(script);
50 }
51 
53 {
54  const struct reg_script *script;
55 
56  /* Crypto Shield I2C Addresses:
57  *
58  * 0x29: AT97S3204T - TPM 1.2
59  * 0x50: ATAES132 - AES-128
60  * 0x60: ATECC108 - Elliptical Curve
61  * 0x64: ATSHA204 - SHA-256
62  * 0x68: DS3231M - RTC
63  */
64 
65  /* Determine the correct script for the board */
66  if (CONFIG(GALILEO_GEN2))
67  script = gen2_tpm_reset;
68  else
69  /* Determine which I2C address is in use */
73 
74  /* Reset the TPM */
75  reg_script_run(script);
76 }
77 
79 {
80  /* Indicate no failure until RTC failure bits are supported. */
81  return 0;
82 }
#define R_QNC_GPIO_RGLVL_RESUME_WELL
Definition: QuarkNcSocId.h:477
@ CONFIG
Definition: dsi_common.h:201
int get_recovery_mode_switch(void)
HACK: Use Fn-Key as recovery mode switch.
Definition: vboot.c:14
int get_write_protect_state(void)
Only used if CONFIG(CHROMEOS) is set.
Definition: vboot.c:39
#define GALILEO_DETERMINE_IOEXP_SLA_RESUMEWELL_GPIO
Definition: gen1.h:7
static const struct reg_script gen1_i2c_0x20_init[]
Definition: gen1.h:99
static const struct reg_script gen1_tpm_reset_0x21[]
Definition: gen1.h:154
static const struct reg_script gen1_tpm_reset_0x20[]
Definition: gen1.h:141
static const struct reg_script gen1_i2c_0x21_init[]
Definition: gen1.h:120
static const struct reg_script gen2_tpm_reset[]
Definition: gen2.h:89
static const struct reg_script gen2_i2c_init[]
Definition: gen2.h:64
void __weak vboot_platform_prepare_reboot(void)
Definition: vboot.c:52
int vbnv_cmos_failed(void)
Definition: vboot.c:78
void verstage_mainboard_init(void)
Definition: vboot.c:26
void reg_script_run(const struct reg_script *script)
Definition: reg_script.c:700
const struct smm_save_state_ops *legacy_ops __weak
Definition: save_state.c:8
uint32_t reg_legacy_gpio_read(uint32_t reg_address)
Definition: reg_access.c:208