diff options
author | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2011-09-09 12:46:32 +0000 |
---|---|---|
committer | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2011-09-09 12:46:32 +0000 |
commit | cd2c5a7aa6b183b0f87b6eb2b649e3f6ee49d6a4 (patch) | |
tree | e3982f2ce8401028028566c2f09ed38bc2e8338b /chipset_enable.c | |
parent | e1ea6c076431c2943924c31cb3127330b879e68c (diff) | |
download | flashrom-cd2c5a7aa6b183b0f87b6eb2b649e3f6ee49d6a4.tar.gz |
Revamp the warning of failing to set BIOS write enable in enable_flash_ich
- introduce a new variable 'wanted' that is used instead of 'new'
- use 'new' for the actual value contained in BIOS_CNTL after we tried to write it
- rephrase the warning which now also includes the old and new values besides the wanted one
Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1435 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'chipset_enable.c')
-rw-r--r-- | chipset_enable.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/chipset_enable.c b/chipset_enable.c index d013710..1c7eb31 100644 --- a/chipset_enable.c +++ b/chipset_enable.c @@ -256,7 +256,7 @@ static int enable_flash_piix4(struct pci_dev *dev, const char *name) static int enable_flash_ich(struct pci_dev *dev, const char *name, int bios_cntl) { - uint8_t old, new; + uint8_t old, new, wanted; /* * Note: the ICH0-ICH5 BIOS_CNTL register is actually 16 bit wide, but @@ -280,15 +280,16 @@ static int enable_flash_ich(struct pci_dev *dev, const char *name, if (old & (1 << 5)) msg_pinfo("WARNING: BIOS region SMM protection is enabled!\n"); - new = old | 1; - if (new == old) + wanted = old | 1; + if (wanted == old) return 0; - rpci_write_byte(dev, bios_cntl, new); + rpci_write_byte(dev, bios_cntl, wanted); - if (pci_read_byte(dev, bios_cntl) != new) { - msg_pinfo("Setting register 0x%x to 0x%x on %s failed " - "(WARNING ONLY).\n", bios_cntl, new, name); + if ((new = pci_read_byte(dev, bios_cntl)) != wanted) { + msg_pinfo("WARNING: Setting 0x%x from 0x%x to 0x%x on %s " + "failed. New value is 0x%x.\n", + bios_cntl, old, wanted, name, new); return -1; } |