summaryrefslogtreecommitdiff
path: root/src/southbridge/amd
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2015-02-26 20:47:47 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2015-06-04 11:19:01 +0200
commitd0e212cdce76b42090325f429e7bd78e0b1a9bb5 (patch)
treee4f423a12bcce87ce93f79874df83f517312fbb6 /src/southbridge/amd
parent6ccf119932661eaf63af0ee3a276a6d2f2f27b89 (diff)
devicetree: Discriminate device ops scan_bus()
Use of scan_static_bus() and tree traversals is somewhat convoluted. Start cleaning this up by assigning each path type with separate static scan_bus() function. For ME, SMBus and LPC paths a bus cannot expose bridges, as those would add to the number of encountered PCI buses. Change-Id: I8bb11450516faad4fa33b8f69bce5b9978ec75e5 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/8534 Tested-by: build bot (Jenkins) Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
Diffstat (limited to 'src/southbridge/amd')
-rw-r--r--src/southbridge/amd/agesa/hudson/lpc.c2
-rw-r--r--src/southbridge/amd/agesa/hudson/sm.c2
-rw-r--r--src/southbridge/amd/amd8111/acpi.c2
-rw-r--r--src/southbridge/amd/amd8111/lpc.c2
-rw-r--r--src/southbridge/amd/amd8111/smbus.c2
-rw-r--r--src/southbridge/amd/amd8111/usb.c2
-rw-r--r--src/southbridge/amd/cimx/sb700/late.c2
-rw-r--r--src/southbridge/amd/cimx/sb800/late.c2
-rw-r--r--src/southbridge/amd/cimx/sb900/late.c2
-rw-r--r--src/southbridge/amd/cs5535/cs5535.c1
-rw-r--r--src/southbridge/amd/cs5536/cs5536.c9
-rw-r--r--src/southbridge/amd/pi/hudson/lpc.c2
-rw-r--r--src/southbridge/amd/pi/hudson/sm.c2
-rw-r--r--src/southbridge/amd/sb600/lpc.c2
-rw-r--r--src/southbridge/amd/sb600/sm.c2
-rw-r--r--src/southbridge/amd/sb700/lpc.c2
-rw-r--r--src/southbridge/amd/sb700/sm.c2
-rw-r--r--src/southbridge/amd/sb800/lpc.c2
-rw-r--r--src/southbridge/amd/sb800/sm.c2
19 files changed, 23 insertions, 21 deletions
diff --git a/src/southbridge/amd/agesa/hudson/lpc.c b/src/southbridge/amd/agesa/hudson/lpc.c
index f3a525c638..65cb955047 100644
--- a/src/southbridge/amd/agesa/hudson/lpc.c
+++ b/src/southbridge/amd/agesa/hudson/lpc.c
@@ -333,7 +333,7 @@ static struct device_operations lpc_ops = {
#endif
.enable_resources = hudson_lpc_enable_resources,
.init = lpc_init,
- .scan_bus = scan_static_bus,
+ .scan_bus = scan_lpc_bus,
.ops_pci = &lops_pci,
};
static const struct pci_driver lpc_driver __pci_driver = {
diff --git a/src/southbridge/amd/agesa/hudson/sm.c b/src/southbridge/amd/agesa/hudson/sm.c
index fd8e6adc25..09fbf8ba00 100644
--- a/src/southbridge/amd/agesa/hudson/sm.c
+++ b/src/southbridge/amd/agesa/hudson/sm.c
@@ -163,7 +163,7 @@ static struct device_operations smbus_ops = {
.set_resources = hudson_sm_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = sm_init,
- .scan_bus = scan_static_bus,
+ .scan_bus = scan_smbus,
.ops_pci = &lops_pci,
.ops_smbus_bus = &lops_smbus_bus,
};
diff --git a/src/southbridge/amd/amd8111/acpi.c b/src/southbridge/amd/amd8111/acpi.c
index 6d0ce26aba..396b7c448a 100644
--- a/src/southbridge/amd/amd8111/acpi.c
+++ b/src/southbridge/amd/amd8111/acpi.c
@@ -226,7 +226,7 @@ static struct device_operations acpi_ops = {
.set_resources = pci_dev_set_resources,
.enable_resources = acpi_enable_resources,
.init = acpi_init,
- .scan_bus = scan_static_bus,
+ .scan_bus = scan_smbus,
/* We don't need amd8111_enable, chip ops takes care of it.
* It could be useful if these devices were not
* enabled by default.
diff --git a/src/southbridge/amd/amd8111/lpc.c b/src/southbridge/amd/amd8111/lpc.c
index 2ded0cb2ff..47b9ae7bb6 100644
--- a/src/southbridge/amd/amd8111/lpc.c
+++ b/src/southbridge/amd/amd8111/lpc.c
@@ -151,7 +151,7 @@ static struct device_operations lpc_ops = {
.write_acpi_tables = acpi_write_hpet,
.acpi_fill_ssdt_generator = southbridge_acpi_fill_ssdt_generator,
#endif
- .scan_bus = scan_static_bus,
+ .scan_bus = scan_lpc_bus,
.enable = amd8111_enable,
.ops_pci = &lops_pci,
};
diff --git a/src/southbridge/amd/amd8111/smbus.c b/src/southbridge/amd/amd8111/smbus.c
index 0a0c58dce3..def1377beb 100644
--- a/src/southbridge/amd/amd8111/smbus.c
+++ b/src/southbridge/amd/amd8111/smbus.c
@@ -28,7 +28,7 @@ static struct device_operations smbus_ops = {
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = 0,
- .scan_bus = scan_static_bus,
+ .scan_bus = scan_smbus,
.enable = amd8111_enable,
.ops_pci = &lops_pci,
.ops_smbus_bus = &lops_smbus_bus,
diff --git a/src/southbridge/amd/amd8111/usb.c b/src/southbridge/amd/amd8111/usb.c
index 13dccf435b..feb7793beb 100644
--- a/src/southbridge/amd/amd8111/usb.c
+++ b/src/southbridge/amd/amd8111/usb.c
@@ -25,8 +25,6 @@ static struct device_operations usb_ops = {
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = 0,
- .scan_bus = scan_static_bus,
-// .enable = amd8111_enable,
.ops_pci = &lops_pci,
};
diff --git a/src/southbridge/amd/cimx/sb700/late.c b/src/southbridge/amd/cimx/sb700/late.c
index 4254a5c6d1..cd36faca0c 100644
--- a/src/southbridge/amd/cimx/sb700/late.c
+++ b/src/southbridge/amd/cimx/sb700/late.c
@@ -111,7 +111,7 @@ static struct device_operations lpc_ops = {
.write_acpi_tables = acpi_write_hpet,
#endif
.init = lpc_init,
- .scan_bus = scan_static_bus,
+ .scan_bus = scan_lpc_bus,
.ops_pci = &lops_pci,
};
diff --git a/src/southbridge/amd/cimx/sb800/late.c b/src/southbridge/amd/cimx/sb800/late.c
index 79c2203dfc..0ada673a89 100644
--- a/src/southbridge/amd/cimx/sb800/late.c
+++ b/src/southbridge/amd/cimx/sb800/late.c
@@ -161,7 +161,7 @@ static struct device_operations lpc_ops = {
.write_acpi_tables = acpi_write_hpet,
#endif
.init = lpc_init,
- .scan_bus = scan_static_bus,
+ .scan_bus = scan_lpc_bus,
.ops_pci = &lops_pci,
};
diff --git a/src/southbridge/amd/cimx/sb900/late.c b/src/southbridge/amd/cimx/sb900/late.c
index 7249ec5b96..fbff7dfda0 100644
--- a/src/southbridge/amd/cimx/sb900/late.c
+++ b/src/southbridge/amd/cimx/sb900/late.c
@@ -132,7 +132,7 @@ static struct device_operations lpc_ops = {
#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
.write_acpi_tables = acpi_write_hpet,
#endif
- .scan_bus = scan_static_bus,
+ .scan_bus = scan_lpc_bus,
.ops_pci = &lops_pci,
};
diff --git a/src/southbridge/amd/cs5535/cs5535.c b/src/southbridge/amd/cs5535/cs5535.c
index e66a1e2926..70b8386dfa 100644
--- a/src/southbridge/amd/cs5535/cs5535.c
+++ b/src/southbridge/amd/cs5535/cs5535.c
@@ -94,7 +94,6 @@ static struct device_operations southbridge_ops = {
.enable_resources = pci_dev_enable_resources,
.init = southbridge_init,
.enable = southbridge_enable,
- .scan_bus = scan_static_bus,
};
static const struct pci_driver cs5535_pci_driver __pci_driver = {
diff --git a/src/southbridge/amd/cs5536/cs5536.c b/src/southbridge/amd/cs5536/cs5536.c
index 0db8195584..cece16ddbc 100644
--- a/src/southbridge/amd/cs5536/cs5536.c
+++ b/src/southbridge/amd/cs5536/cs5536.c
@@ -688,13 +688,18 @@ static struct smbus_bus_operations lops_smbus_bus = {
.read_byte = lsmbus_read_byte,
};
+static unsigned int scan_lpc_smbus(device_t dev, unsigned int max)
+{
+ /* FIXME. Do we have mixed LPC/SMBus device node here. */
+ return scan_smbus(dev, max);
+}
+
static struct device_operations southbridge_ops = {
.read_resources = cs5536_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = southbridge_init,
-// .enable = southbridge_enable,
- .scan_bus = scan_static_bus,
+ .scan_bus = scan_lpc_smbus,
.ops_smbus_bus = &lops_smbus_bus,
};
diff --git a/src/southbridge/amd/pi/hudson/lpc.c b/src/southbridge/amd/pi/hudson/lpc.c
index 840ff7acbe..b813d12173 100644
--- a/src/southbridge/amd/pi/hudson/lpc.c
+++ b/src/southbridge/amd/pi/hudson/lpc.c
@@ -340,7 +340,7 @@ static struct device_operations lpc_ops = {
.write_acpi_tables = acpi_write_hpet,
#endif
.init = lpc_init,
- .scan_bus = scan_static_bus,
+ .scan_bus = scan_lpc_bus,
.ops_pci = &lops_pci,
};
static const struct pci_driver lpc_driver __pci_driver = {
diff --git a/src/southbridge/amd/pi/hudson/sm.c b/src/southbridge/amd/pi/hudson/sm.c
index fd8e6adc25..09fbf8ba00 100644
--- a/src/southbridge/amd/pi/hudson/sm.c
+++ b/src/southbridge/amd/pi/hudson/sm.c
@@ -163,7 +163,7 @@ static struct device_operations smbus_ops = {
.set_resources = hudson_sm_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = sm_init,
- .scan_bus = scan_static_bus,
+ .scan_bus = scan_smbus,
.ops_pci = &lops_pci,
.ops_smbus_bus = &lops_smbus_bus,
};
diff --git a/src/southbridge/amd/sb600/lpc.c b/src/southbridge/amd/sb600/lpc.c
index 62c88de6eb..2fb9e227b8 100644
--- a/src/southbridge/amd/sb600/lpc.c
+++ b/src/southbridge/amd/sb600/lpc.c
@@ -242,7 +242,7 @@ static struct device_operations lpc_ops = {
.acpi_fill_ssdt_generator = southbridge_acpi_fill_ssdt_generator,
#endif
.init = lpc_init,
- .scan_bus = scan_static_bus,
+ .scan_bus = scan_lpc_bus,
/* .enable = sb600_enable, */
.ops_pci = &lops_pci,
};
diff --git a/src/southbridge/amd/sb600/sm.c b/src/southbridge/amd/sb600/sm.c
index 0254f830e6..40fde47b8a 100644
--- a/src/southbridge/amd/sb600/sm.c
+++ b/src/southbridge/amd/sb600/sm.c
@@ -361,7 +361,7 @@ static struct device_operations smbus_ops = {
.set_resources = sb600_sm_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = sm_init,
- .scan_bus = scan_static_bus,
+ .scan_bus = scan_smbus,
/* .enable = sb600_enable, */
.ops_pci = &lops_pci,
.ops_smbus_bus = &lops_smbus_bus,
diff --git a/src/southbridge/amd/sb700/lpc.c b/src/southbridge/amd/sb700/lpc.c
index be3c4d6017..94d8dcb02f 100644
--- a/src/southbridge/amd/sb700/lpc.c
+++ b/src/southbridge/amd/sb700/lpc.c
@@ -287,7 +287,7 @@ static struct device_operations lpc_ops = {
.acpi_fill_ssdt_generator = southbridge_acpi_fill_ssdt_generator,
#endif
.init = lpc_init,
- .scan_bus = scan_static_bus,
+ .scan_bus = scan_lpc_bus,
.ops_pci = &lops_pci,
};
static const struct pci_driver lpc_driver __pci_driver = {
diff --git a/src/southbridge/amd/sb700/sm.c b/src/southbridge/amd/sb700/sm.c
index 2a88a80a73..f544c88c03 100644
--- a/src/southbridge/amd/sb700/sm.c
+++ b/src/southbridge/amd/sb700/sm.c
@@ -452,7 +452,7 @@ static struct device_operations smbus_ops = {
.set_resources = sb700_sm_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = sm_init,
- .scan_bus = scan_static_bus,
+ .scan_bus = scan_smbus,
.ops_pci = &lops_pci,
.ops_smbus_bus = &lops_smbus_bus,
};
diff --git a/src/southbridge/amd/sb800/lpc.c b/src/southbridge/amd/sb800/lpc.c
index 5a40a8d8c3..0cd5b3272c 100644
--- a/src/southbridge/amd/sb800/lpc.c
+++ b/src/southbridge/amd/sb800/lpc.c
@@ -254,7 +254,7 @@ static struct device_operations lpc_ops = {
.write_acpi_tables = acpi_write_hpet,
#endif
.init = lpc_init,
- .scan_bus = scan_static_bus,
+ .scan_bus = scan_lpc_bus,
.ops_pci = &lops_pci,
};
static const struct pci_driver lpc_driver __pci_driver = {
diff --git a/src/southbridge/amd/sb800/sm.c b/src/southbridge/amd/sb800/sm.c
index b34cfbd976..1523c60bdf 100644
--- a/src/southbridge/amd/sb800/sm.c
+++ b/src/southbridge/amd/sb800/sm.c
@@ -343,7 +343,7 @@ static struct device_operations smbus_ops = {
.set_resources = sb800_sm_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = sm_init,
- .scan_bus = scan_static_bus,
+ .scan_bus = scan_smbus,
.ops_pci = &lops_pci,
.ops_smbus_bus = &lops_smbus_bus,
};