summaryrefslogtreecommitdiff
path: root/sb600spi.c
diff options
context:
space:
mode:
authorRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>2017-03-22 14:08:31 +0100
committerDavid Hendricks <david.hendricks@gmail.com>2017-09-17 18:03:42 +0000
commit7b629bcde47e18d094e496fb8ae537272ead0998 (patch)
tree3c44a9d573fb61ca483054a845722e051558aefd /sb600spi.c
parent8681df128708a548e64865bb6fd8f6cd957e061d (diff)
downloadflashrom-git-7b629bcde47e18d094e496fb8ae537272ead0998.tar.gz
sb600spi: Add support for Merlin Falcon Chipset
This patch has been tested on a board similar to AMD Bettong. 00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:790b] (rev 4a) 00:14.3 ISA bridge [0601]: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge [1022:790e] (rev 11) root@qt5022-fglrx:~# ./flashrom -p internal -w kk.rom flashrom v0.9.9-unknown on Linux 4.10.0-qtec-standard (x86_64) flashrom is free software, get the source code at https://flashrom.org Calibrating delay loop... OK. coreboot table found at 0x9ffd6000. Found chipset "AMD FP4". Enabling flash write... OK. Found Micron/Numonyx/ST flash chip "N25Q128..1E" (16384 kB, SPI) mapped at physical address 0x00000000ff000000. Reading old flash chip contents... done. Erasing and writing flash chip... Erase/write done. Verifying flash... VERIFIED. Change-Id: I66a240ebc8382cc7e5156686045aee1a9d03fe6d Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Reviewed-on: https://review.coreboot.org/21429 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Diffstat (limited to 'sb600spi.c')
-rw-r--r--sb600spi.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/sb600spi.c b/sb600spi.c
index 6bd56798..68f8d8ac 100644
--- a/sb600spi.c
+++ b/sb600spi.c
@@ -149,6 +149,23 @@ static void determine_generation(struct pci_dev *dev)
"Please report this to flashrom@flashrom.org and include this log and\n"
"the output of lspci -nnvx, thanks!.\n", rev);
}
+ } else if (dev->device_id == 0x790e) {
+ struct pci_dev *smbus_dev = pci_dev_find(0x1022, 0x790B);
+ if (smbus_dev == NULL) {
+ msg_pdbg("No SMBus device with ID 1022:790B found.\n");
+ return;
+ }
+ uint8_t rev = pci_read_byte(smbus_dev, PCI_REVISION_ID);
+ if (rev == 0x4a) {
+ amd_gen = CHIPSET_YANGTZE;
+ msg_pdbg("Yangtze detected.\n");
+ } else {
+ msg_pwarn("FCH device found but SMBus revision 0x%02x does not match known values.\n"
+ "Please report this to flashrom@flashrom.org and include this log and\n"
+ "the output of lspci -nnvx, thanks!.\n", rev);
+ }
+
+
#endif
} else
msg_pwarn("%s: Unknown LPC device %" PRIx16 ":%" PRIx16 ".\n"
@@ -646,12 +663,13 @@ int sb600_probe_spi(struct pci_dev *dev)
/* Look for the SMBus device. */
smbus_dev = pci_dev_find(0x1002, 0x4385);
- if (!smbus_dev) {
+ if (!smbus_dev)
smbus_dev = pci_dev_find(0x1022, 0x780b); /* AMD FCH */
- if (!smbus_dev) {
- msg_perr("ERROR: SMBus device not found. Not enabling SPI.\n");
- return ERROR_NONFATAL;
- }
+ if (!smbus_dev)
+ smbus_dev = pci_dev_find(0x1022, 0x790b); /* AMD FP4 */
+ if (!smbus_dev) {
+ msg_perr("ERROR: SMBus device not found. Not enabling SPI.\n");
+ return ERROR_NONFATAL;
}
/* Note about the bit tests below: If a bit is zero, the GPIO is SPI. */