aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/apollolake/romstage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/intel/apollolake/romstage.c')
-rw-r--r--src/soc/intel/apollolake/romstage.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/soc/intel/apollolake/romstage.c b/src/soc/intel/apollolake/romstage.c
index 756e27534a..0c8f1c2de7 100644
--- a/src/soc/intel/apollolake/romstage.c
+++ b/src/soc/intel/apollolake/romstage.c
@@ -21,6 +21,7 @@
#include <arch/io.h>
#include <arch/symbols.h>
#include <assert.h>
+#include <bootmode.h>
#include <cbfs.h>
#include <cbmem.h>
#include <console/console.h>
@@ -37,6 +38,7 @@
#include <soc/pci_devs.h>
#include <soc/pm.h>
#include <soc/romstage.h>
+#include <soc/spi.h>
#include <soc/uart.h>
#include <string.h>
#include <timestamp.h>
@@ -260,3 +262,11 @@ void mainboard_memory_init_params(struct FSPM_UPD *mupd)
{
printk(BIOS_DEBUG, "WEAK: %s/%s called\n", __FILE__, __func__);
}
+
+int get_sw_write_protect_state(void)
+{
+ uint8_t status;
+
+ /* Return unprotected status if status read fails. */
+ return spi_read_status(&status) ? 0 : !!(status & 0x80);
+}