MMCONF_SUPPORT: Drop redundant logging

Resource is actually stored even before read_resources, but
that's where we currently log this resource.

For Intel, use PCI config register offset as the resource
index, while AMD side uses MSR address.

Change-Id: I6eeef1883c5d1ee5bbcebd1731c0e356af3fd781
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/17696
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
diff --git a/src/northbridge/amd/agesa/family10/northbridge.c b/src/northbridge/amd/agesa/family10/northbridge.c
index 00799a5..a50e09b 100644
--- a/src/northbridge/amd/agesa/family10/northbridge.c
+++ b/src/northbridge/amd/agesa/family10/northbridge.c
@@ -537,11 +537,6 @@
 			assign_resources(bus);
 		}
 	}
-
-	res = find_resource(dev, 0xc0010058);
-	if (res) {
-		report_resource_stored(dev, res, " <mmconfig>");
-	}
 }
 
 static void mcf0_control_init(struct device *dev)
diff --git a/src/northbridge/amd/agesa/family12/northbridge.c b/src/northbridge/amd/agesa/family12/northbridge.c
index e7363f6..e3541e1 100644
--- a/src/northbridge/amd/agesa/family12/northbridge.c
+++ b/src/northbridge/amd/agesa/family12/northbridge.c
@@ -662,13 +662,9 @@
 
 static void cpu_bus_set_resources(device_t dev)
 {
-	struct resource *resource = find_resource(dev, 0xc0010058);
-
 	printk(BIOS_DEBUG, "\nFam12h - northbridge.c - %s - Start.\n",__func__);
-	if (resource) {
-		report_resource_stored(dev, resource, " <mmconfig>");
-	}
 	pci_dev_set_resources(dev);
+
 	printk(BIOS_DEBUG, "Fam12h - northbridge.c - %s - End.\n",__func__);
 }
 
diff --git a/src/northbridge/amd/agesa/family14/northbridge.c b/src/northbridge/amd/agesa/family14/northbridge.c
index d66e83a..15bb1aa 100644
--- a/src/northbridge/amd/agesa/family14/northbridge.c
+++ b/src/northbridge/amd/agesa/family14/northbridge.c
@@ -412,12 +412,6 @@
 			assign_resources(bus);
 		}
 	}
-
-	/* Print the MMCONF region if it has been reserved. */
-	res = find_resource(dev, 0xc0010058);
-	if (res) {
-		report_resource_stored(dev, res, " <mmconfig>");
-	}
 }
 
 /* Domain/Root Complex related code */
diff --git a/src/northbridge/amd/agesa/family15/northbridge.c b/src/northbridge/amd/agesa/family15/northbridge.c
index 77ac720..9cfaed9 100644
--- a/src/northbridge/amd/agesa/family15/northbridge.c
+++ b/src/northbridge/amd/agesa/family15/northbridge.c
@@ -429,12 +429,6 @@
 			assign_resources(bus);
 		}
 	}
-
-	/* Print the MMCONF region if it has been reserved. */
-	res = find_resource(dev, 0xc0010058);
-	if (res) {
-		report_resource_stored(dev, res, " <mmconfig>");
-	}
 }
 
 static void scan_chains(device_t dev)
diff --git a/src/northbridge/amd/agesa/family15rl/northbridge.c b/src/northbridge/amd/agesa/family15rl/northbridge.c
index d4970ef..d003be5 100644
--- a/src/northbridge/amd/agesa/family15rl/northbridge.c
+++ b/src/northbridge/amd/agesa/family15rl/northbridge.c
@@ -429,12 +429,6 @@
 			assign_resources(bus);
 		}
 	}
-
-	/* Print the MMCONF region if it has been reserved. */
-	res = find_resource(dev, 0xc0010058);
-	if (res) {
-		report_resource_stored(dev, res, " <mmconfig>");
-	}
 }
 
 static unsigned long acpi_fill_hest(acpi_hest_t *hest)
diff --git a/src/northbridge/amd/agesa/family15tn/northbridge.c b/src/northbridge/amd/agesa/family15tn/northbridge.c
index 7d36b13..2f05334 100644
--- a/src/northbridge/amd/agesa/family15tn/northbridge.c
+++ b/src/northbridge/amd/agesa/family15tn/northbridge.c
@@ -428,12 +428,6 @@
 			assign_resources(bus);
 		}
 	}
-
-	/* Print the MMCONF region if it has been reserved. */
-	res = find_resource(dev, 0xc0010058);
-	if (res) {
-		report_resource_stored(dev, res, " <mmconfig>");
-	}
 }
 
 
diff --git a/src/northbridge/amd/agesa/family16kb/northbridge.c b/src/northbridge/amd/agesa/family16kb/northbridge.c
index 641487f..28a4f91 100644
--- a/src/northbridge/amd/agesa/family16kb/northbridge.c
+++ b/src/northbridge/amd/agesa/family16kb/northbridge.c
@@ -428,12 +428,6 @@
 			assign_resources(bus);
 		}
 	}
-
-	/* Print the MMCONF region if it has been reserved. */
-	res = find_resource(dev, 0xc0010058);
-	if (res) {
-		report_resource_stored(dev, res, " <mmconfig>");
-	}
 }
 
 
diff --git a/src/northbridge/amd/amdfam10/northbridge.c b/src/northbridge/amd/amdfam10/northbridge.c
index 43480d2..8d1d498 100644
--- a/src/northbridge/amd/amdfam10/northbridge.c
+++ b/src/northbridge/amd/amdfam10/northbridge.c
@@ -1957,10 +1957,6 @@
 
 static void cpu_bus_set_resources(struct device *dev)
 {
-	struct resource *resource = find_resource(dev, 0xc0010058);
-	if (resource) {
-		report_resource_stored(dev, resource, " <mmconfig>");
-	}
 	pci_dev_set_resources(dev);
 }
 
diff --git a/src/northbridge/amd/pi/00630F01/northbridge.c b/src/northbridge/amd/pi/00630F01/northbridge.c
index f863c73..a83ff0e 100644
--- a/src/northbridge/amd/pi/00630F01/northbridge.c
+++ b/src/northbridge/amd/pi/00630F01/northbridge.c
@@ -431,12 +431,6 @@
 			assign_resources(bus);
 		}
 	}
-
-	/* Print the MMCONF region if it has been reserved. */
-	res = find_resource(dev, 0xc0010058);
-	if (res) {
-		report_resource_stored(dev, res, " <mmconfig>");
-	}
 }
 
 static unsigned long acpi_fill_hest(acpi_hest_t *hest)
diff --git a/src/northbridge/amd/pi/00660F01/northbridge.c b/src/northbridge/amd/pi/00660F01/northbridge.c
index 941c39a..be748e8 100644
--- a/src/northbridge/amd/pi/00660F01/northbridge.c
+++ b/src/northbridge/amd/pi/00660F01/northbridge.c
@@ -1094,10 +1094,6 @@
 
 static void cpu_bus_set_resources(device_t dev)
 {
-	struct resource *resource = find_resource(dev, 0xc0010058);
-	if (resource) {
-		report_resource_stored(dev, resource, " <mmconfig>");
-	}
 	pci_dev_set_resources(dev);
 }
 
diff --git a/src/northbridge/amd/pi/00670F00/northbridge.c b/src/northbridge/amd/pi/00670F00/northbridge.c
index b258aeda..ae847d2 100644
--- a/src/northbridge/amd/pi/00670F00/northbridge.c
+++ b/src/northbridge/amd/pi/00670F00/northbridge.c
@@ -1095,10 +1095,6 @@
 
 static void cpu_bus_set_resources(device_t dev)
 {
-	struct resource *resource = find_resource(dev, 0xc0010058);
-	if (resource) {
-		report_resource_stored(dev, resource, " <mmconfig>");
-	}
 	pci_dev_set_resources(dev);
 }
 
diff --git a/src/northbridge/amd/pi/00730F01/northbridge.c b/src/northbridge/amd/pi/00730F01/northbridge.c
index dbb4181..58fb47a 100644
--- a/src/northbridge/amd/pi/00730F01/northbridge.c
+++ b/src/northbridge/amd/pi/00730F01/northbridge.c
@@ -1114,10 +1114,6 @@
 
 static void cpu_bus_set_resources(device_t dev)
 {
-	struct resource *resource = find_resource(dev, 0xc0010058);
-	if (resource) {
-		report_resource_stored(dev, resource, " <mmconfig>");
-	}
 	pci_dev_set_resources(dev);
 }
 
diff --git a/src/northbridge/intel/fsp_sandybridge/northbridge.c b/src/northbridge/intel/fsp_sandybridge/northbridge.c
index c9f6e1c..92a4365 100644
--- a/src/northbridge/intel/fsp_sandybridge/northbridge.c
+++ b/src/northbridge/intel/fsp_sandybridge/northbridge.c
@@ -244,28 +244,13 @@
 
 	pci_dev_read_resources(dev);
 
-	/* We use 0xcf as an unused index for our PCIe bar so that we find it again */
 	buses = get_pcie_bar(&pcie_config_base);
 	if (buses) {
-		struct resource *resource = new_resource(dev, 0xcf);
+		struct resource *resource = new_resource(dev, PCIEXBAR);
 		mmconf_resource_init(resource, pcie_config_base, buses);
 	}
 }
 
-static void mc_set_resources(device_t dev)
-{
-	struct resource *resource;
-
-	/* Report the PCIe BAR */
-	resource = find_resource(dev, 0xcf);
-	if (resource) {
-		report_resource_stored(dev, resource, "<mmconfig>");
-	}
-
-	/* And call the normal set_resources */
-	pci_dev_set_resources(dev);
-}
-
 static void intel_set_subsystem(device_t dev, unsigned vendor, unsigned device)
 {
 	if (!vendor || !device) {
@@ -319,7 +304,7 @@
 
 static struct device_operations mc_ops = {
 	.read_resources   = mc_read_resources,
-	.set_resources    = mc_set_resources,
+	.set_resources    = pci_dev_set_resources,
 	.enable_resources = pci_dev_enable_resources,
 	.init             = northbridge_init,
 	.scan_bus         = 0,
diff --git a/src/northbridge/intel/i3100/northbridge.c b/src/northbridge/intel/i3100/northbridge.c
index 4549f85..d5eb8a6 100644
--- a/src/northbridge/intel/i3100/northbridge.c
+++ b/src/northbridge/intel/i3100/northbridge.c
@@ -138,18 +138,7 @@
 {
 	pci_dev_read_resources(dev);
 
-	mmconf_resource(dev, 0xcf);
-}
-
-static void mc_set_resources(device_t dev)
-{
-	struct resource *resource;
-
-	resource = find_resource(dev, 0xcf);
-	if (resource) {
-		report_resource_stored(dev, resource, "<mmconfig>");
-	}
-	pci_dev_set_resources(dev);
+	mmconf_resource(dev, EXPECBASE);
 }
 
 static void intel_set_subsystem(device_t dev, unsigned vendor, unsigned device)
@@ -188,7 +177,7 @@
 
 static struct device_operations mc_ops = {
 	.read_resources   = mc_read_resources,
-	.set_resources    = mc_set_resources,
+	.set_resources    = pci_dev_set_resources,
 	.enable_resources = pci_dev_enable_resources,
 	.init             = 0,
 	.scan_bus         = 0,
diff --git a/src/northbridge/intel/i945/northbridge.c b/src/northbridge/intel/i945/northbridge.c
index c027bec..6226a63 100644
--- a/src/northbridge/intel/i945/northbridge.c
+++ b/src/northbridge/intel/i945/northbridge.c
@@ -157,28 +157,13 @@
 
 	pci_dev_read_resources(dev);
 
-	/* We use 0xcf as an unused index for our PCIe bar so that we find it again */
 	buses = get_pcie_bar(&pcie_config_base);
 	if (buses) {
-		struct resource *resource = new_resource(dev, 0xcf);
+		struct resource *resource = new_resource(dev, PCIEXBAR);
 		mmconf_resource_init(resource, pcie_config_base, buses);
 	}
 }
 
-static void mc_set_resources(device_t dev)
-{
-	struct resource *resource;
-
-	/* Report the PCIe BAR */
-	resource = find_resource(dev, 0xcf);
-	if (resource) {
-		report_resource_stored(dev, resource, "<mmconfig>");
-	}
-
-	/* And call the normal set_resources */
-	pci_dev_set_resources(dev);
-}
-
 static void intel_set_subsystem(device_t dev, unsigned vendor, unsigned device)
 {
 	if (!vendor || !device) {
@@ -216,7 +201,7 @@
 
 static struct device_operations mc_ops = {
 	.read_resources   = mc_read_resources,
-	.set_resources    = mc_set_resources,
+	.set_resources    = pci_dev_set_resources,
 	.enable_resources = pci_dev_enable_resources,
 	.acpi_fill_ssdt_generator = generate_cpu_entries,
 #if CONFIG_HAVE_ACPI_RESUME
diff --git a/src/northbridge/intel/sandybridge/northbridge.c b/src/northbridge/intel/sandybridge/northbridge.c
index 7f7c842..71dd802 100644
--- a/src/northbridge/intel/sandybridge/northbridge.c
+++ b/src/northbridge/intel/sandybridge/northbridge.c
@@ -264,28 +264,13 @@
 
 	pci_dev_read_resources(dev);
 
-	/* We use 0xcf as an unused index for our PCIe bar so that we find it again */
 	buses = get_pcie_bar(&pcie_config_base);
 	if (buses) {
-		struct resource *resource = new_resource(dev, 0xcf);
+		struct resource *resource = new_resource(dev, PCIEXBAR);
 		mmconf_resource_init(resource, pcie_config_base, buses);
 	}
 }
 
-static void mc_set_resources(device_t dev)
-{
-	struct resource *resource;
-
-	/* Report the PCIe BAR */
-	resource = find_resource(dev, 0xcf);
-	if (resource) {
-		report_resource_stored(dev, resource, "<mmconfig>");
-	}
-
-	/* And call the normal set_resources */
-	pci_dev_set_resources(dev);
-}
-
 static void intel_set_subsystem(device_t dev, unsigned vendor, unsigned device)
 {
 	if (!vendor || !device) {
@@ -474,7 +459,7 @@
 
 static struct device_operations mc_ops = {
 	.read_resources   = mc_read_resources,
-	.set_resources    = mc_set_resources,
+	.set_resources    = pci_dev_set_resources,
 	.enable_resources = pci_dev_enable_resources,
 	.init             = northbridge_init,
 	.scan_bus         = 0,
diff --git a/src/soc/intel/sch/northbridge.c b/src/soc/intel/sch/northbridge.c
index 2d39490..0bc840d 100644
--- a/src/soc/intel/sch/northbridge.c
+++ b/src/soc/intel/sch/northbridge.c
@@ -201,19 +201,6 @@
 	}
 }
 
-static void mc_set_resources(device_t dev)
-{
-	struct resource *resource;
-
-	/* Report the PCIe BAR. */
-	resource = find_resource(dev, 0xcf);
-	if (resource)
-		report_resource_stored(dev, resource, "<mmconfig>");
-
-	/* And call the normal set_resources. */
-	pci_dev_set_resources(dev);
-}
-
 static void intel_set_subsystem(device_t dev, unsigned vendor, unsigned device)
 {
 	if (!vendor || !device) {
@@ -231,7 +218,7 @@
 
 static struct device_operations mc_ops = {
 	.read_resources		= mc_read_resources,
-	.set_resources		= mc_set_resources,
+	.set_resources		= pci_dev_set_resources,
 	.enable_resources	= pci_dev_enable_resources,
 	.acpi_fill_ssdt_generator = generate_cpu_entries,
 	.scan_bus		= 0,