[coreboot] New patch to review for coreboot: e83bf69 Fix AMD UMA for RS780

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Mon Aug 27 19:01:28 CEST 2012


Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1488

-gerrit

commit e83bf69e7a3ba8e1dd7e438781d16af73adff0cf
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Mon Aug 27 20:00:33 2012 +0300

    Fix AMD UMA for RS780
    
    In commit 6b5eb1cc2d1702ff10cd02249d3d861c094f9118 setup of
    UMA memory region was moved to happen at a later state and
    this broke UMA with RS780 southbridge.
    
    Share the TOP_MEM and UMA settings before any of the PCI or CPU
    scanning takes place.
    
    Change-Id: I9cae1fc2948cbccede58d099faf1dfe49e9df303
    Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
 src/northbridge/amd/agesa/family10/northbridge.c   | 16 +++++++++++-----
 src/northbridge/amd/agesa/family12/northbridge.c   | 11 ++++++++---
 src/northbridge/amd/agesa/family14/northbridge.c   | 14 ++++++++++----
 src/northbridge/amd/agesa/family15/northbridge.c   | 11 ++++++++---
 src/northbridge/amd/agesa/family15tn/northbridge.c | 11 ++++++++---
 src/northbridge/amd/amdfam10/northbridge.c         | 11 ++++++++---
 src/northbridge/amd/amdk8/northbridge.c            | 11 ++++++++---
 7 files changed, 61 insertions(+), 24 deletions(-)

diff --git a/src/northbridge/amd/agesa/family10/northbridge.c b/src/northbridge/amd/agesa/family10/northbridge.c
index 4b3859b..c1f3972 100644
--- a/src/northbridge/amd/agesa/family10/northbridge.c
+++ b/src/northbridge/amd/agesa/family10/northbridge.c
@@ -923,11 +923,6 @@ static void amdfam10_domain_set_resources(device_t dev)
 	u32 reset_memhole = 1;
 #endif
 
-	setup_bsp_ramtop();
-#if CONFIG_GFXUMA
-#error Northbridge does not set uma_memory_base or uma_memory_size.
-#endif
-
 #if CONFIG_PCI_64BIT_PREF_MEM
 
 	for (link = dev->link_list; link; link = link->next) {
@@ -1464,6 +1459,17 @@ static struct device_operations cpu_bus_ops = {
 
 static void root_complex_enable_dev(struct device *dev)
 {
+	static int done = 0;
+
+	if (!done) {
+		setup_bsp_ramtop();
+#if CONFIG_GFXUMA
+#error Northbridge does not set uma_memory_base or uma_memory_size.
+		setup_uma_memory();
+#endif
+		done = 1;
+	}
+
 	/* Set the operations if it is a special bus type */
 	if (dev->path.type == DEVICE_PATH_PCI_DOMAIN) {
 		dev->ops = &pci_domain_ops;
diff --git a/src/northbridge/amd/agesa/family12/northbridge.c b/src/northbridge/amd/agesa/family12/northbridge.c
index 6689e71..dc2e7f4 100644
--- a/src/northbridge/amd/agesa/family12/northbridge.c
+++ b/src/northbridge/amd/agesa/family12/northbridge.c
@@ -601,9 +601,6 @@ static void domain_set_resources(device_t dev)
     u32 reset_memhole = 1;
 #endif
 
-	setup_bsp_ramtop();
-	setup_uma_memory();
-
 #if CONFIG_PCI_64BIT_PREF_MEM
 
 printk(BIOS_DEBUG, "adsr - CONFIG_PCI_64BIT_PREF_MEM is true.\n");
@@ -914,6 +911,14 @@ static struct device_operations cpu_bus_ops = {
 static void root_complex_enable_dev(struct device *dev)
 {
     printk(BIOS_DEBUG, "\nFam12h - northbridge.c - root_complex_enable_dev - Start.\n");
+    static int done = 0;
+
+    if (!done) {
+       setup_bsp_ramtop();
+       setup_uma_memory();
+       done = 1;
+    }
+
     /* Set the operations if it is a special bus type */
     if (dev->path.type == DEVICE_PATH_PCI_DOMAIN) {
         dev->ops = &pci_domain_ops;
diff --git a/src/northbridge/amd/agesa/family14/northbridge.c b/src/northbridge/amd/agesa/family14/northbridge.c
index 875dbbb..f696e7f 100644
--- a/src/northbridge/amd/agesa/family14/northbridge.c
+++ b/src/northbridge/amd/agesa/family14/northbridge.c
@@ -564,9 +564,6 @@ static void domain_set_resources(device_t dev)
 	u32 reset_memhole = 1;
 #endif
 
-	setup_bsp_ramtop();
-	setup_uma_memory();
-
 #if CONFIG_PCI_64BIT_PREF_MEM
 
 	printk(BIOS_DEBUG, "adsr - CONFIG_PCI_64BIT_PREF_MEM is true.\n");
@@ -905,7 +902,16 @@ static struct device_operations cpu_bus_ops = {
 	.scan_bus = cpu_bus_scan,
 };
 
-static void root_complex_enable_dev(struct device *dev) {
+static void root_complex_enable_dev(struct device *dev)
+{
+	static int done = 0;
+
+	if (!done) {
+		setup_bsp_ramtop();
+		setup_uma_memory();
+		done = 1;
+	}
+
 	/* Set the operations if it is a special bus type */
 	if (dev->path.type == DEVICE_PATH_PCI_DOMAIN) {
 		dev->ops = &pci_domain_ops;
diff --git a/src/northbridge/amd/agesa/family15/northbridge.c b/src/northbridge/amd/agesa/family15/northbridge.c
index 96cfca2..5f21f41 100644
--- a/src/northbridge/amd/agesa/family15/northbridge.c
+++ b/src/northbridge/amd/agesa/family15/northbridge.c
@@ -673,9 +673,6 @@ static void domain_set_resources(device_t dev)
 	u32 reset_memhole = 1;
 #endif
 
-	setup_bsp_ramtop();
-	setup_uma_memory();
-
 #if CONFIG_PCI_64BIT_PREF_MEM
 
 	for (link = dev->link_list; link; link = link->next) {
@@ -1147,6 +1144,14 @@ static struct device_operations cpu_bus_ops = {
 
 static void root_complex_enable_dev(struct device *dev)
 {
+	static int done = 0;
+
+	if (!done) {
+		setup_bsp_ramtop();
+		setup_uma_memory();
+		done = 1;
+	}
+
 	/* Set the operations if it is a special bus type */
 	if (dev->path.type == DEVICE_PATH_PCI_DOMAIN) {
 		dev->ops = &pci_domain_ops;
diff --git a/src/northbridge/amd/agesa/family15tn/northbridge.c b/src/northbridge/amd/agesa/family15tn/northbridge.c
index fb30277..0ccdd56 100644
--- a/src/northbridge/amd/agesa/family15tn/northbridge.c
+++ b/src/northbridge/amd/agesa/family15tn/northbridge.c
@@ -684,9 +684,6 @@ static void domain_set_resources(device_t dev)
 	u32 reset_memhole = 1;
 #endif
 
-	setup_bsp_ramtop();
-	setup_uma_memory();
-
 #if CONFIG_PCI_64BIT_PREF_MEM
 
 	for (link = dev->link_list; link; link = link->next) {
@@ -1154,6 +1151,14 @@ static struct device_operations cpu_bus_ops = {
 
 static void root_complex_enable_dev(struct device *dev)
 {
+	static int done = 0;
+
+	if (!done) {
+		setup_bsp_ramtop();
+		setup_uma_memory();
+		done = 1;
+	}
+
 	/* Set the operations if it is a special bus type */
 	if (dev->path.type == DEVICE_PATH_PCI_DOMAIN) {
 		dev->ops = &pci_domain_ops;
diff --git a/src/northbridge/amd/amdfam10/northbridge.c b/src/northbridge/amd/amdfam10/northbridge.c
index 865a3bc..883224b 100644
--- a/src/northbridge/amd/amdfam10/northbridge.c
+++ b/src/northbridge/amd/amdfam10/northbridge.c
@@ -888,9 +888,6 @@ static void amdfam10_domain_set_resources(device_t dev)
 	u32 reset_memhole = 1;
 #endif
 
-	setup_bsp_ramtop();
-	setup_uma_memory();
-
 #if CONFIG_PCI_64BIT_PREF_MEM
 
 	for(link = dev->link_list; link; link = link->next) {
@@ -1489,6 +1486,14 @@ static struct device_operations cpu_bus_ops = {
 
 static void root_complex_enable_dev(struct device *dev)
 {
+	static int done = 0;
+
+	if (!done) {
+		setup_bsp_ramtop();
+		setup_uma_memory();
+		done = 1;
+	}
+
 	/* Set the operations if it is a special bus type */
 	if (dev->path.type == DEVICE_PATH_PCI_DOMAIN) {
 		dev->ops = &pci_domain_ops;
diff --git a/src/northbridge/amd/amdk8/northbridge.c b/src/northbridge/amd/amdk8/northbridge.c
index d94ee9a..91e1e5e 100644
--- a/src/northbridge/amd/amdk8/northbridge.c
+++ b/src/northbridge/amd/amdk8/northbridge.c
@@ -884,9 +884,6 @@ static void amdk8_domain_set_resources(device_t dev)
 	u32 reset_memhole = 1;
 #endif
 
-	setup_bsp_ramtop();
-	setup_uma_memory();
-
 #if 0
 	/* Place the IO devices somewhere safe */
 	io = find_resource(dev, 0);
@@ -1378,6 +1375,14 @@ static struct device_operations cpu_bus_ops = {
 
 static void root_complex_enable_dev(struct device *dev)
 {
+	static int done = 0;
+
+	if (!done) {
+		setup_bsp_ramtop();
+		setup_uma_memory();
+		done = 1;
+	}
+
 	/* Set the operations if it is a special bus type */
 	if (dev->path.type == DEVICE_PATH_PCI_DOMAIN) {
 		dev->ops = &pci_domain_ops;




More information about the coreboot mailing list