Bruce Griffith (Bruce.Griffith(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3808
-gerrit
commit 17bb6108351b43f5c3d9c95a0e457d6f28adf080
Author: Bruce Griffith <bruce.griffith(a)se-eng.com>
Date: Tue Jul 23 11:50:12 2013 -0600
AMD Hudson/Yangtze: Enable support for SATA port multipliers
This patch sets a bit in the Yangtze/Hudson/Bolton southbridges
to enable the extra protocol necessary to handle port multiplier
chips. This has been turned on during most of Kabini development
without any notable impact. Olive Hill has an optional daughter
board that incorporates Silicon Image Steel Vines chips. This
change has been tested with and without the daughter board. This
change can be regression tested using any Hudson-based motherboard.
Change-Id: Ie87873b093f3e2a6a5c83b96ccb6c898d3e25f72
Signed-off-by: Bruce Griffith <bruce.griffith(a)se-eng.com>
Reviewed-by: Martin Roth <martin.roth(a)se-eng.com>
Reviewed-by: Dave Frodin <dave.frodin(a)se-eng.com>
---
src/southbridge/amd/agesa/hudson/sata.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/src/southbridge/amd/agesa/hudson/sata.c b/src/southbridge/amd/agesa/hudson/sata.c
index bc1cd92..7499370 100644
--- a/src/southbridge/amd/agesa/hudson/sata.c
+++ b/src/southbridge/amd/agesa/hudson/sata.c
@@ -29,7 +29,35 @@
static void sata_init(struct device *dev)
{
-}
+#if IS_ENABLED(CONFIG_SOUTHBRIDGE_AMD_AGESA_YANGTZE)
+ /**************************************
+ * Configure the SATA port multiplier *
+ **************************************/
+ #define BYTE_TO_DWORD_OFFSET(x) (x/4)
+ #define AHCI_BASE_ADDRESS_REG 0x24
+ #define MISC_CONTROL_REG 0x40
+ #define UNLOCK_BIT (1<<0)
+ #define SATA_CAPABILITIES_REG 0xFC
+ #define CFG_CAP_SPM (1<<12)
+
+ volatile u32 *ahci_ptr =
+ (u32*)(pci_read_config32(dev, AHCI_BASE_ADDRESS_REG) & 0xFFFFFF00);
+ u32 temp;
+
+ /* unlock the write-protect */
+ temp = pci_read_config32(dev, MISC_CONTROL_REG);
+ temp |= UNLOCK_BIT;
+ pci_write_config32(dev, MISC_CONTROL_REG, temp);
+
+ /* set the SATA AHCI mode to allow port expanders */
+ *(ahci_ptr + BYTE_TO_DWORD_OFFSET(SATA_CAPABILITIES_REG)) |= CFG_CAP_SPM;
+
+ /* lock the write-protect */
+ temp = pci_read_config32(dev, MISC_CONTROL_REG);
+ temp &= ~UNLOCK_BIT;
+ pci_write_config32(dev, MISC_CONTROL_REG, temp);
+#endif
+};
static struct pci_operations lops_pci = {
/* .set_subsystem = pci_dev_set_subsystem, */
Bruce Griffith (Bruce.Griffith(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3806
-gerrit
commit 6c7cffc6bc29f9c29cf7c6f4a7d126bfbbe632cb
Author: Bruce Griffith <Bruce.Griffith(a)se-eng.com>
Date: Sun Jul 7 02:06:53 2013 -0600
AMD Kabini: Add map_oprom() function for Vendor/Device IDs
Change-Id: I14285f0677003fbf8b9b112207af202658807894
Reviewed-by: Marc Jones <marc.jones(a)se-eng.com>
Signed-off-by: Bruce Griffith <Bruce.Griffith(a)se-eng.com>
Reviewed-by: Bruce Griffith <bruce.griffith(a)se-eng.com>
Tested-by: Bruce Griffith <bruce.griffith(a)se-eng.com>
---
src/northbridge/amd/agesa/family16kb/Kconfig | 7 +++++
src/northbridge/amd/agesa/family16kb/northbridge.c | 32 ++++++++++++++++++++++
2 files changed, 39 insertions(+)
diff --git a/src/northbridge/amd/agesa/family16kb/Kconfig b/src/northbridge/amd/agesa/family16kb/Kconfig
index f39b926..259195b 100644
--- a/src/northbridge/amd/agesa/family16kb/Kconfig
+++ b/src/northbridge/amd/agesa/family16kb/Kconfig
@@ -38,4 +38,11 @@ config MMCONF_BUS_NUMBER
int
default 256
+config VGA_BIOS_ID
+ string
+ default "1002,9830"
+ help
+ The default VGA BIOS PCI vendor/device ID should be set to the
+ result of the map_oprom_vendev() function in northbridge.c.
+
endif
diff --git a/src/northbridge/amd/agesa/family16kb/northbridge.c b/src/northbridge/amd/agesa/family16kb/northbridge.c
index cd37d2f..19886ef 100644
--- a/src/northbridge/amd/agesa/family16kb/northbridge.c
+++ b/src/northbridge/amd/agesa/family16kb/northbridge.c
@@ -1149,3 +1149,35 @@ struct chip_operations northbridge_amd_agesa_family16kb_root_complex_ops = {
CHIP_NAME("AMD FAM16 Root Complex")
.enable_dev = root_complex_enable_dev,
};
+
+/*********************************************************************
+ * Change the vendor / device IDs to match the generic VBIOS header. *
+ *********************************************************************/
+u32 map_oprom_vendev(u32 vendev)
+{
+ u32 new_vendev = vendev;
+
+ switch(vendev) {
+ case 0x10029830:
+ case 0x10029831:
+ case 0x10029832:
+ case 0x10029833:
+ case 0x10029834:
+ case 0x10029835:
+ case 0x10029836:
+ case 0x10029837:
+ case 0x10029838:
+ case 0x10029839:
+ case 0x1002983A:
+ case 0x1002983D:
+ new_vendev = 0x10029830; // This is the default value in AMD-generated VBIOS
+ break;
+ default:
+ break;
+ }
+
+ if (vendev != new_vendev)
+ printk(BIOS_NOTICE, "Mapping PCI device %8x to %8x\n", vendev, new_vendev);
+
+ return new_vendev;
+}