summaryrefslogtreecommitdiff
path: root/ichspi.c
diff options
context:
space:
mode:
authorstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2011-11-13 15:17:10 +0000
committerstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2011-11-13 15:17:10 +0000
commit403fd94d8321e0717f1b52524a050bf6423a27d7 (patch)
treea566034a3539063a27b64dc4a523f0d724404395 /ichspi.c
parent8d6093845b3a37b5a4465235d243fa04747f7323 (diff)
downloadflashrom-403fd94d8321e0717f1b52524a050bf6423a27d7.tar.gz
ichspi: fix ich_init_opcodes() calls in ich_init_spi()
By calling it early ichspi_lock was not set up correctly in accordance with the corresponding register, hence ich_init_opcodes() was always trying to programming the opcodes instead of reading them in from the opmenu in case of a locked down configuration. Thanks to Jonathan A. Kollasch for reporting this bug. Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1464 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'ichspi.c')
-rw-r--r--ichspi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ichspi.c b/ichspi.c
index 79fc143..1ce525f 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -1562,8 +1562,6 @@ int ich_init_spi(struct pci_dev *dev, uint32_t base, void *rcrb,
/* Assign Virtual Address */
ich_spibar = rcrb + spibar_offset;
- ich_init_opcodes();
-
switch (ich_generation) {
case CHIPSET_ICH7:
msg_pdbg("0x00: 0x%04x (SPIS)\n",
@@ -1601,6 +1599,7 @@ int ich_init_spi(struct pci_dev *dev, uint32_t base, void *rcrb,
msg_pinfo("WARNING: SPI Configuration Lockdown activated.\n");
ichspi_lock = 1;
}
+ ich_init_opcodes();
ich_set_bbar(0);
register_spi_programmer(&spi_programmer_ich7);
break;
@@ -1643,6 +1642,7 @@ int ich_init_spi(struct pci_dev *dev, uint32_t base, void *rcrb,
"by the FRAP and FREG registers are NOT in "
"effect. Please note that Protected\n"
"Range (PR) restrictions still apply.\n");
+ ich_init_opcodes();
if (desc_valid) {
tmp2 = mmio_readw(ich_spibar + ICH9_REG_HSFC);