1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 #include <device/i2c_simple.h>
6 #include <soc/reg_access.h>
8 #include <security/vboot/vboot_common.h>
9 #include <security/vboot/vbnv.h>
11 #include "reg_access.h"
15 int get_recovery_mode_switch(void)
20 int get_write_protect_state(void)
22 /* Not write protected */
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
39 /* Determine the correct script for the board */
40 if (CONFIG(GALILEO_GEN2
))
41 script
= gen2_i2c_init
;
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
65 /* Determine the correct script for the board */
66 if (CONFIG(GALILEO_GEN2
))
67 script
= gen2_tpm_reset
;
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
;
75 reg_script_run(script
);
78 int vbnv_cmos_failed(void)
80 /* Indicate no failure until RTC failure bits are supported. */