path: root/chipset_enable.c
diff options
authorStefan Tauner <>2011-11-08 10:55:54 +0000
committerStefan Tauner <>2011-11-08 10:55:54 +0000
commit50e7c603f7bd56c51b3f5f34ce8e8cd61074bbcf (patch)
tree5aea00e4af9093f6fca3af0f1534ede33ad98f35 /chipset_enable.c
parenta8d838d9d3a0373b51408a2ecb647c320e1aaff9 (diff)
ichspi: add support for Intel Hardware Sequencing
Based on the new opaque programmer framework this patch adds support for Intel Hardware Sequencing on ICH8 and its successors. By default (or when setting the ich_spi_mode option to auto) the module tries to use swseq and only activates hwseq if need be: - if important opcodes are inaccessible due to lockdown - if more than one flash chip is attached. The other options (swseq, hwseq) select the respective mode (if possible). A general description of Hardware Sequencing can be found in this blog entry: Besides adding hwseq this patch also introduces these unrelated changes: - Fix enable_flash_ich_dc_spi to pass ERROR_FATAL from ich_init_spi. The whole error handling looks a bit odd to me, so this patch does change very little. Also, it does not touch the tunnelcreek method, which should be refactored anyway. - Add null-pointer guards to find_opcode and find_preop to matches the other opcode methods better: curopcodes == NULL has some meaning and is actively used/checked in other functions. TODO: adding real documentation when we have a directory for it Corresponding to flashrom svn r1461. Signed-off-by: Stefan Tauner <> Acked-by: Carl-Daniel Hailfinger <>
Diffstat (limited to 'chipset_enable.c')
1 files changed, 7 insertions, 5 deletions
diff --git a/chipset_enable.c b/chipset_enable.c
index 15bd3eb..77e0862 100644
--- a/chipset_enable.c
+++ b/chipset_enable.c
@@ -491,7 +491,7 @@ static int enable_flash_vt8237s_spi(struct pci_dev *dev, const char *name)
static int enable_flash_ich_dc_spi(struct pci_dev *dev, const char *name,
enum ich_chipset ich_generation)
- int ret;
+ int ret, ret_spi;
uint8_t bbs, buc;
uint32_t tmp, gcs;
void *rcrb;
@@ -569,10 +569,12 @@ static int enable_flash_ich_dc_spi(struct pci_dev *dev, const char *name,
/* This adds BUS_SPI */
- if (ich_init_spi(dev, tmp, rcrb, ich_generation) != 0) {
- if (!ret)
- }
+ ret_spi = ich_init_spi(dev, tmp, rcrb, ich_generation);
+ if (ret_spi == ERROR_FATAL)
+ return ret_spi;
+ if (ret || ret_spi)
return ret;
OpenPOWER on IntegriCloud