summaryrefslogtreecommitdiff
path: root/src/southbridge/amd
diff options
context:
space:
mode:
authorTimothy Pearson <tpearson@raptorengineeringinc.com>2015-06-09 19:34:16 -0500
committerStefan Reinauer <stefan.reinauer@coreboot.org>2015-11-11 02:07:42 +0100
commitf89a05ed9f7307df32ef5fa1fd558db7f594c269 (patch)
treedaa6f2126e9bcafc890d48f7e95805ba401bd09c /src/southbridge/amd
parent2b206775fa5e956772b54295a563c5a69e2117b6 (diff)
southbridge/amd/sb700: Indicate iSATA/eSATA port type
Change-Id: I8ee757d07c82c151b36def6b709163ff144d244f Signed-off-by: Timothy Pearson <tpearson@raptorengineeringinc.com> Reviewed-on: http://review.coreboot.org/11984 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/southbridge/amd')
-rw-r--r--src/southbridge/amd/sb700/sata.c19
-rw-r--r--src/southbridge/amd/sb700/sb700.h1
2 files changed, 20 insertions, 0 deletions
diff --git a/src/southbridge/amd/sb700/sata.c b/src/southbridge/amd/sb700/sata.c
index 72c1de8ae8..fdf32c780e 100644
--- a/src/southbridge/amd/sb700/sata.c
+++ b/src/southbridge/amd/sb700/sata.c
@@ -74,6 +74,23 @@ void __attribute__((weak)) sb7xx_51xx_setup_sata_phys(struct device *dev)
pci_write_config16(dev, 0xaa, 0xA07A);
}
+/* This function can be overloaded in mainboard.c */
+void __attribute__((weak)) sb7xx_51xx_setup_sata_port_indication(void *sata_bar5)
+{
+ uint32_t dword;
+
+ /* RPR7.9 Program Port Indication Registers */
+ dword = read32(sata_bar5 + 0xf8);
+ dword &= ~(0x3f << 12); /* Ports 0 and 1 are eSATA */
+ dword |= (0x3 << 12);
+ dword &= ~0x3f;
+ write32(sata_bar5 + 0xf8, dword);
+
+ dword = read32(sata_bar5 + 0xfc);
+ dword |= 0x1 << 20; /* At least one eSATA port is present */
+ write32(sata_bar5 + 0xfc, dword);
+}
+
static void sata_init(struct device *dev)
{
u8 byte;
@@ -244,7 +261,9 @@ static void sata_init(struct device *dev)
/* Program the watchdog counter to 0x10 */
byte = 0x10;
pci_write_config8(dev, 0x46, byte);
+
sb7xx_51xx_setup_sata_phys(dev);
+ sb7xx_51xx_setup_sata_port_indication(sata_bar5);
/* Enable the I/O, MM, BusMaster access for SATA */
byte = pci_read_config8(dev, 0x4);
diff --git a/src/southbridge/amd/sb700/sb700.h b/src/southbridge/amd/sb700/sb700.h
index e2f5cf08ad..a610267561 100644
--- a/src/southbridge/amd/sb700/sb700.h
+++ b/src/southbridge/amd/sb700/sb700.h
@@ -69,6 +69,7 @@ void sb7xx_51xx_before_pci_init(void);
#include <device/pci.h>
/* allow override in mainboard.c */
void sb7xx_51xx_setup_sata_phys(struct device *dev);
+void sb7xx_51xx_setup_sata_port_indication(void *sata_bar5);
#endif