payloads/edk2: Disable the CPU Timer Lib unless supported
[coreboot.git] / src / mainboard / intel / galileo / vboot.c
blob4a7f424cd2cc3b701f2cc0f3a72b3acb5757427e
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
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>
8 #include <security/vboot/vboot_common.h>
9 #include <security/vboot/vbnv.h>
11 #include "reg_access.h"
12 #include "gen1.h"
13 #include "gen2.h"
15 int get_recovery_mode_switch(void)
17 return 0;
20 int get_write_protect_state(void)
22 /* Not write protected */
23 return 0;
26 void verstage_mainboard_init(void)
28 const struct reg_script *script;
30 /* Crypto Shield I2C Addresses:
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
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 */
44 script = (reg_legacy_gpio_read (R_QNC_GPIO_RGLVL_RESUME_WELL)
45 & GALILEO_DETERMINE_IOEXP_SLA_RESUMEWELL_GPIO)
46 ? gen1_i2c_0x20_init : gen1_i2c_0x21_init;
48 /* Direct the I2C SDA and SCL signals to the Arduino connector */
49 reg_script_run(script);
52 void __weak vboot_platform_prepare_reboot(void)
54 const struct reg_script *script;
56 /* Crypto Shield I2C Addresses:
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
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 */
70 script = (reg_legacy_gpio_read (R_QNC_GPIO_RGLVL_RESUME_WELL)
71 & GALILEO_DETERMINE_IOEXP_SLA_RESUMEWELL_GPIO)
72 ? gen1_tpm_reset_0x20 : gen1_tpm_reset_0x21;
74 /* Reset the TPM */
75 reg_script_run(script);
78 int vbnv_cmos_failed(void)
80 /* Indicate no failure until RTC failure bits are supported. */
81 return 0;