mirror of
				https://review.coreboot.org/flashrom.git
				synced 2025-10-31 13:20:42 +01:00 
			
		
		
		
	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 Corresponding to flashrom svn r1435. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
This commit is contained in:
		| @@ -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, | static int enable_flash_ich(struct pci_dev *dev, const char *name, | ||||||
| 			    int bios_cntl) | 			    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 | 	 * 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)) | 	if (old & (1 << 5)) | ||||||
| 		msg_pinfo("WARNING: BIOS region SMM protection is enabled!\n"); | 		msg_pinfo("WARNING: BIOS region SMM protection is enabled!\n"); | ||||||
|  |  | ||||||
| 	new = old | 1; | 	wanted = old | 1; | ||||||
| 	if (new == old) | 	if (wanted == old) | ||||||
| 		return 0; | 		return 0; | ||||||
|  |  | ||||||
| 	rpci_write_byte(dev, bios_cntl, new); | 	rpci_write_byte(dev, bios_cntl, wanted); | ||||||
|  |  | ||||||
| 	if (pci_read_byte(dev, bios_cntl) != new) { | 	if ((new = pci_read_byte(dev, bios_cntl)) != wanted) { | ||||||
| 		msg_pinfo("Setting register 0x%x to 0x%x on %s failed " | 		msg_pinfo("WARNING: Setting 0x%x from 0x%x to 0x%x on %s " | ||||||
| 			  "(WARNING ONLY).\n", bios_cntl, new, name); | 			  "failed. New value is 0x%x.\n", | ||||||
|  | 			  bios_cntl, old, wanted, name, new); | ||||||
| 		return -1; | 		return -1; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Stefan Tauner
					Stefan Tauner