* [PATCH 02/18] powerpc/{powernv,pseries}: Move PHB discovery
2020-11-03 4:35 [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
@ 2020-11-03 4:35 ` Oliver O'Halloran
2020-11-03 4:35 ` [PATCH 03/18] powerpc/maple: " Oliver O'Halloran
` (17 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: Oliver O'Halloran @ 2020-11-03 4:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Oliver O'Halloran
Make powernv and pseries use ppc_mc.discover_phbs. These two platforms need
to be done together because they both depends on pci_dn's being created
from the DT. The pci_dn contains a pointer to the relevant pci_controller
so they need to be created after the pci_controller structures are
available, but before and before PCI devices are scanned. Currently this
ordering is provided by initcalls and the sequence is:
1. PHBs are discovered (setup_arch) (early boot, pre-initcalls)
2. pci_dn are created from the unflattended DT (core initcall)
3. PHBs are scanned pcibios_init() (subsys initcall)
The new ppc_md.discover_phbs() function is also a core_initcall so we can't
guarantee ordering between the creations of pci_controllers and the
creation of pci_dn's which require a pci_controller. We could use the
postcore, or core_sync initcall levels, but it's cleaner to just move the
pci_dn setup into the per-PHB inits which occur inside of .discover_phb()
for these platforms. This brings the boot-time path in line with the PHB
hotplug path that is used for pseries DLPAR operations too.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
arch/powerpc/kernel/pci_dn.c | 22 ----------------------
arch/powerpc/platforms/powernv/pci-ioda.c | 3 +++
arch/powerpc/platforms/powernv/setup.c | 4 +---
arch/powerpc/platforms/pseries/setup.c | 7 +++++--
4 files changed, 9 insertions(+), 27 deletions(-)
diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c
index 54e240597fd9..61571ae23953 100644
--- a/arch/powerpc/kernel/pci_dn.c
+++ b/arch/powerpc/kernel/pci_dn.c
@@ -481,28 +481,6 @@ void pci_devs_phb_init_dynamic(struct pci_controller *phb)
pci_traverse_device_nodes(dn, add_pdn, phb);
}
-/**
- * pci_devs_phb_init - Initialize phbs and pci devs under them.
- *
- * This routine walks over all phb's (pci-host bridges) on the
- * system, and sets up assorted pci-related structures
- * (including pci info in the device node structs) for each
- * pci device found underneath. This routine runs once,
- * early in the boot sequence.
- */
-static int __init pci_devs_phb_init(void)
-{
- struct pci_controller *phb, *tmp;
-
- /* This must be done first so the device nodes have valid pci info! */
- list_for_each_entry_safe(phb, tmp, &hose_list, list_node)
- pci_devs_phb_init_dynamic(phb);
-
- return 0;
-}
-
-core_initcall(pci_devs_phb_init);
-
static void pci_dev_pdn_setup(struct pci_dev *pdev)
{
struct pci_dn *pdn;
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 2b4ceb5e6ce4..d6815f03fee3 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -3176,6 +3176,9 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
/* Remove M64 resource if we can't configure it successfully */
if (!phb->init_m64 || phb->init_m64(phb))
hose->mem_resources[1].flags = 0;
+
+ /* create pci_dn's for DT nodes under this PHB */
+ pci_devs_phb_init_dynamic(hose);
}
void __init pnv_pci_init_ioda2_phb(struct device_node *np)
diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
index 9acaa0f131b9..92f5fa827909 100644
--- a/arch/powerpc/platforms/powernv/setup.c
+++ b/arch/powerpc/platforms/powernv/setup.c
@@ -162,9 +162,6 @@ static void __init pnv_setup_arch(void)
/* Initialize SMP */
pnv_smp_init();
- /* Setup PCI */
- pnv_pci_init();
-
/* Setup RTC and NVRAM callbacks */
if (firmware_has_feature(FW_FEATURE_OPAL))
opal_nvram_init();
@@ -524,6 +521,7 @@ define_machine(powernv) {
.init_IRQ = pnv_init_IRQ,
.show_cpuinfo = pnv_show_cpuinfo,
.get_proc_freq = pnv_get_proc_freq,
+ .discover_phbs = pnv_pci_init,
.progress = pnv_progress,
.machine_shutdown = pnv_shutdown,
.power_save = NULL,
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 633c45ec406d..e88b30d4b6cd 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -463,7 +463,7 @@ void pseries_little_endian_exceptions(void)
}
#endif
-static void __init find_and_init_phbs(void)
+static void __init pSeries_discover_phbs(void)
{
struct device_node *node;
struct pci_controller *phb;
@@ -481,6 +481,9 @@ static void __init find_and_init_phbs(void)
pci_process_bridge_OF_ranges(phb, node, 0);
isa_bridge_find_early(phb);
phb->controller_ops = pseries_pci_controller_ops;
+
+ /* create pci_dn's for DT nodes under this PHB */
+ pci_devs_phb_init_dynamic(phb);
}
of_node_put(root);
@@ -777,7 +780,6 @@ static void __init pSeries_setup_arch(void)
/* Find and initialize PCI host bridges */
init_pci_config_tokens();
- find_and_init_phbs();
of_reconfig_notifier_register(&pci_dn_reconfig_nb);
pSeries_nvram_init();
@@ -1041,6 +1043,7 @@ define_machine(pseries) {
.init_IRQ = pseries_init_irq,
.show_cpuinfo = pSeries_show_cpuinfo,
.log_error = pSeries_log_error,
+ .discover_phbs = pSeries_discover_phbs,
.pcibios_fixup = pSeries_final_fixup,
.restart = rtas_restart,
.halt = rtas_halt,
--
2.26.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 03/18] powerpc/maple: Move PHB discovery
2020-11-03 4:35 [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
2020-11-03 4:35 ` [PATCH 02/18] powerpc/{powernv,pseries}: Move PHB discovery Oliver O'Halloran
@ 2020-11-03 4:35 ` Oliver O'Halloran
2020-11-03 4:35 ` [PATCH 04/18] powerpc/512x: " Oliver O'Halloran
` (16 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: Oliver O'Halloran @ 2020-11-03 4:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Oliver O'Halloran
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
arch/powerpc/platforms/maple/setup.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index f7e66a2005b4..4e9ad5bf3efb 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -179,9 +179,6 @@ static void __init maple_setup_arch(void)
#ifdef CONFIG_SMP
smp_ops = &maple_smp_ops;
#endif
- /* Lookup PCI hosts */
- maple_pci_init();
-
maple_use_rtas_reboot_and_halt_if_present();
printk(KERN_DEBUG "Using native/NAP idle loop\n");
@@ -351,6 +348,7 @@ define_machine(maple) {
.name = "Maple",
.probe = maple_probe,
.setup_arch = maple_setup_arch,
+ .discover_phbs = maple_pci_init,
.init_IRQ = maple_init_IRQ,
.pci_irq_fixup = maple_pci_irq_fixup,
.pci_get_legacy_ide_irq = maple_pci_get_legacy_ide_irq,
--
2.26.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 04/18] powerpc/512x: Move PHB discovery
2020-11-03 4:35 [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
2020-11-03 4:35 ` [PATCH 02/18] powerpc/{powernv,pseries}: Move PHB discovery Oliver O'Halloran
2020-11-03 4:35 ` [PATCH 03/18] powerpc/maple: " Oliver O'Halloran
@ 2020-11-03 4:35 ` Oliver O'Halloran
2020-11-03 4:35 ` [PATCH 05/18] powerpc/52xx/efika: " Oliver O'Halloran
` (15 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: Oliver O'Halloran @ 2020-11-03 4:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Oliver O'Halloran
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
only compile tested
---
arch/powerpc/platforms/512x/mpc5121_ads.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/platforms/512x/mpc5121_ads.c b/arch/powerpc/platforms/512x/mpc5121_ads.c
index 6303fbfc4e4f..9d030c2e0004 100644
--- a/arch/powerpc/platforms/512x/mpc5121_ads.c
+++ b/arch/powerpc/platforms/512x/mpc5121_ads.c
@@ -24,21 +24,23 @@
static void __init mpc5121_ads_setup_arch(void)
{
-#ifdef CONFIG_PCI
- struct device_node *np;
-#endif
printk(KERN_INFO "MPC5121 ADS board from Freescale Semiconductor\n");
/*
* cpld regs are needed early
*/
mpc5121_ads_cpld_map();
+ mpc512x_setup_arch();
+}
+
+static void __init mpc5121_ads_setup_pci(void)
+{
#ifdef CONFIG_PCI
+ struct device_node *np;
+
for_each_compatible_node(np, "pci", "fsl,mpc5121-pci")
mpc83xx_add_bridge(np);
#endif
-
- mpc512x_setup_arch();
}
static void __init mpc5121_ads_init_IRQ(void)
@@ -64,6 +66,7 @@ define_machine(mpc5121_ads) {
.name = "MPC5121 ADS",
.probe = mpc5121_ads_probe,
.setup_arch = mpc5121_ads_setup_arch,
+ .discover_phbs = mpc5121_ads_setup_pci,
.init = mpc512x_init,
.init_IRQ = mpc5121_ads_init_IRQ,
.get_irq = ipic_get_irq,
--
2.26.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 05/18] powerpc/52xx/efika: Move PHB discovery
2020-11-03 4:35 [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (2 preceding siblings ...)
2020-11-03 4:35 ` [PATCH 04/18] powerpc/512x: " Oliver O'Halloran
@ 2020-11-03 4:35 ` Oliver O'Halloran
2020-11-03 4:35 ` [PATCH 06/18] powerpc/52xx/lite5200: " Oliver O'Halloran
` (14 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: Oliver O'Halloran @ 2020-11-03 4:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Oliver O'Halloran
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
compile tested with mpc5200_defconfig
---
arch/powerpc/platforms/52xx/efika.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c
index 4514a6f7458a..3b7d70d71692 100644
--- a/arch/powerpc/platforms/52xx/efika.c
+++ b/arch/powerpc/platforms/52xx/efika.c
@@ -185,8 +185,6 @@ static void __init efika_setup_arch(void)
/* Map important registers from the internal memory map */
mpc52xx_map_common_devices();
- efika_pcisetup();
-
#ifdef CONFIG_PM
mpc52xx_suspend.board_suspend_prepare = efika_suspend_prepare;
mpc52xx_pm_init();
@@ -218,6 +216,7 @@ define_machine(efika)
.name = EFIKA_PLATFORM_NAME,
.probe = efika_probe,
.setup_arch = efika_setup_arch,
+ .discover_phbs = efika_pcisetup,
.init = mpc52xx_declare_of_platform_devices,
.show_cpuinfo = efika_show_cpuinfo,
.init_IRQ = mpc52xx_init_irq,
--
2.26.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 06/18] powerpc/52xx/lite5200: Move PHB discovery
2020-11-03 4:35 [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (3 preceding siblings ...)
2020-11-03 4:35 ` [PATCH 05/18] powerpc/52xx/efika: " Oliver O'Halloran
@ 2020-11-03 4:35 ` Oliver O'Halloran
2020-11-03 4:35 ` [PATCH 07/18] powerpc/52xx/media5200: " Oliver O'Halloran
` (13 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: Oliver O'Halloran @ 2020-11-03 4:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Oliver O'Halloran
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
compile tested with 52xx/lite5200b_defconfig
---
arch/powerpc/platforms/52xx/lite5200.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c
index 3181aac08225..04cc97397095 100644
--- a/arch/powerpc/platforms/52xx/lite5200.c
+++ b/arch/powerpc/platforms/52xx/lite5200.c
@@ -165,8 +165,6 @@ static void __init lite5200_setup_arch(void)
mpc52xx_suspend.board_resume_finish = lite5200_resume_finish;
lite5200_pm_init();
#endif
-
- mpc52xx_setup_pci();
}
static const char * const board[] __initconst = {
@@ -187,6 +185,7 @@ define_machine(lite5200) {
.name = "lite5200",
.probe = lite5200_probe,
.setup_arch = lite5200_setup_arch,
+ .discover_phbs = mpc52xx_setup_pci,
.init = mpc52xx_declare_of_platform_devices,
.init_IRQ = mpc52xx_init_irq,
.get_irq = mpc52xx_get_irq,
--
2.26.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 07/18] powerpc/52xx/media5200: Move PHB discovery
2020-11-03 4:35 [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (4 preceding siblings ...)
2020-11-03 4:35 ` [PATCH 06/18] powerpc/52xx/lite5200: " Oliver O'Halloran
@ 2020-11-03 4:35 ` Oliver O'Halloran
2020-11-03 4:35 ` [PATCH 08/18] powerpc/52xx/mpc5200_simple: " Oliver O'Halloran
` (12 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: Oliver O'Halloran @ 2020-11-03 4:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Oliver O'Halloran
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
arch/powerpc/platforms/52xx/media5200.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/52xx/media5200.c b/arch/powerpc/platforms/52xx/media5200.c
index 07c5bc4ed0b5..efb8bdecbcc7 100644
--- a/arch/powerpc/platforms/52xx/media5200.c
+++ b/arch/powerpc/platforms/52xx/media5200.c
@@ -202,8 +202,6 @@ static void __init media5200_setup_arch(void)
/* Some mpc5200 & mpc5200b related configuration */
mpc5200_setup_xlb_arbiter();
- mpc52xx_setup_pci();
-
np = of_find_matching_node(NULL, mpc5200_gpio_ids);
gpio = of_iomap(np, 0);
of_node_put(np);
@@ -244,6 +242,7 @@ define_machine(media5200_platform) {
.name = "media5200-platform",
.probe = media5200_probe,
.setup_arch = media5200_setup_arch,
+ .discover_phbs = mpc52xx_setup_pci,
.init = mpc52xx_declare_of_platform_devices,
.init_IRQ = media5200_init_irq,
.get_irq = mpc52xx_get_irq,
--
2.26.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 08/18] powerpc/52xx/mpc5200_simple: Move PHB discovery
2020-11-03 4:35 [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (5 preceding siblings ...)
2020-11-03 4:35 ` [PATCH 07/18] powerpc/52xx/media5200: " Oliver O'Halloran
@ 2020-11-03 4:35 ` Oliver O'Halloran
2020-11-03 4:35 ` [PATCH 09/18] powerpc/82xx/*: " Oliver O'Halloran
` (11 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: Oliver O'Halloran @ 2020-11-03 4:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Oliver O'Halloran
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
arch/powerpc/platforms/52xx/mpc5200_simple.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/52xx/mpc5200_simple.c b/arch/powerpc/platforms/52xx/mpc5200_simple.c
index 2d01e9b2e779..b9f5675b0a1d 100644
--- a/arch/powerpc/platforms/52xx/mpc5200_simple.c
+++ b/arch/powerpc/platforms/52xx/mpc5200_simple.c
@@ -40,8 +40,6 @@ static void __init mpc5200_simple_setup_arch(void)
/* Some mpc5200 & mpc5200b related configuration */
mpc5200_setup_xlb_arbiter();
-
- mpc52xx_setup_pci();
}
/* list of the supported boards */
@@ -73,6 +71,7 @@ define_machine(mpc5200_simple_platform) {
.name = "mpc5200-simple-platform",
.probe = mpc5200_simple_probe,
.setup_arch = mpc5200_simple_setup_arch,
+ .discover_phbs = mpc52xx_setup_pci,
.init = mpc52xx_declare_of_platform_devices,
.init_IRQ = mpc52xx_init_irq,
.get_irq = mpc52xx_get_irq,
--
2.26.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 09/18] powerpc/82xx/*: Move PHB discovery
2020-11-03 4:35 [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (6 preceding siblings ...)
2020-11-03 4:35 ` [PATCH 08/18] powerpc/52xx/mpc5200_simple: " Oliver O'Halloran
@ 2020-11-03 4:35 ` Oliver O'Halloran
2020-11-03 4:35 ` [PATCH 10/18] powerpc/83xx: " Oliver O'Halloran
` (10 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: Oliver O'Halloran @ 2020-11-03 4:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Oliver O'Halloran
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
compile tested with pq2fads_defconfig
---
arch/powerpc/platforms/82xx/mpc8272_ads.c | 2 +-
arch/powerpc/platforms/82xx/pq2fads.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/82xx/mpc8272_ads.c b/arch/powerpc/platforms/82xx/mpc8272_ads.c
index 3fe1a6593280..0b5b9dec16d5 100644
--- a/arch/powerpc/platforms/82xx/mpc8272_ads.c
+++ b/arch/powerpc/platforms/82xx/mpc8272_ads.c
@@ -171,7 +171,6 @@ static void __init mpc8272_ads_setup_arch(void)
iounmap(bcsr);
init_ioports();
- pq2_init_pci();
if (ppc_md.progress)
ppc_md.progress("mpc8272_ads_setup_arch(), finish", 0);
@@ -205,6 +204,7 @@ define_machine(mpc8272_ads)
.name = "Freescale MPC8272 ADS",
.probe = mpc8272_ads_probe,
.setup_arch = mpc8272_ads_setup_arch,
+ .discover_phbs = pq2_init_pci,
.init_IRQ = mpc8272_ads_pic_init,
.get_irq = cpm2_get_irq,
.calibrate_decr = generic_calibrate_decr,
diff --git a/arch/powerpc/platforms/82xx/pq2fads.c b/arch/powerpc/platforms/82xx/pq2fads.c
index a74082140718..ac9113d524af 100644
--- a/arch/powerpc/platforms/82xx/pq2fads.c
+++ b/arch/powerpc/platforms/82xx/pq2fads.c
@@ -150,8 +150,6 @@ static void __init pq2fads_setup_arch(void)
/* Enable external IRQs */
clrbits32(&cpm2_immr->im_siu_conf.siu_82xx.sc_siumcr, 0x0c000000);
- pq2_init_pci();
-
if (ppc_md.progress)
ppc_md.progress("pq2fads_setup_arch(), finish", 0);
}
@@ -184,6 +182,7 @@ define_machine(pq2fads)
.name = "Freescale PQ2FADS",
.probe = pq2fads_probe,
.setup_arch = pq2fads_setup_arch,
+ .discover_phbs = pq2_init_pci,
.init_IRQ = pq2fads_pic_init,
.get_irq = cpm2_get_irq,
.calibrate_decr = generic_calibrate_decr,
--
2.26.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 10/18] powerpc/83xx: Move PHB discovery
2020-11-03 4:35 [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (7 preceding siblings ...)
2020-11-03 4:35 ` [PATCH 09/18] powerpc/82xx/*: " Oliver O'Halloran
@ 2020-11-03 4:35 ` Oliver O'Halloran
2020-11-03 4:35 ` [PATCH 11/18] powerpc/amigaone: " Oliver O'Halloran
` (9 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: Oliver O'Halloran @ 2020-11-03 4:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Oliver O'Halloran
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
compile tested with mpc83xx_defconfig
---
arch/powerpc/platforms/83xx/asp834x.c | 1 +
arch/powerpc/platforms/83xx/km83xx.c | 1 +
arch/powerpc/platforms/83xx/misc.c | 2 --
arch/powerpc/platforms/83xx/mpc830x_rdb.c | 1 +
arch/powerpc/platforms/83xx/mpc831x_rdb.c | 1 +
arch/powerpc/platforms/83xx/mpc832x_mds.c | 1 +
arch/powerpc/platforms/83xx/mpc832x_rdb.c | 1 +
arch/powerpc/platforms/83xx/mpc834x_itx.c | 1 +
arch/powerpc/platforms/83xx/mpc834x_mds.c | 1 +
arch/powerpc/platforms/83xx/mpc836x_mds.c | 1 +
arch/powerpc/platforms/83xx/mpc836x_rdk.c | 1 +
arch/powerpc/platforms/83xx/mpc837x_mds.c | 1 +
arch/powerpc/platforms/83xx/mpc837x_rdb.c | 1 +
13 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/83xx/asp834x.c b/arch/powerpc/platforms/83xx/asp834x.c
index 28474876f41b..68061c2a57c1 100644
--- a/arch/powerpc/platforms/83xx/asp834x.c
+++ b/arch/powerpc/platforms/83xx/asp834x.c
@@ -44,6 +44,7 @@ define_machine(asp834x) {
.name = "ASP8347E",
.probe = asp834x_probe,
.setup_arch = asp834x_setup_arch,
+ .discover_phbs = mpc83xx_setup_pci,
.init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c
index bcdc2c203ec9..108e1e4d2683 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -180,6 +180,7 @@ define_machine(mpc83xx_km) {
.name = "mpc83xx-km-platform",
.probe = mpc83xx_km_probe,
.setup_arch = mpc83xx_km_setup_arch,
+ .discover_phbs = mpc83xx_setup_pci,
.init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c
index a952e91db3ee..3285dabcf923 100644
--- a/arch/powerpc/platforms/83xx/misc.c
+++ b/arch/powerpc/platforms/83xx/misc.c
@@ -132,8 +132,6 @@ void __init mpc83xx_setup_arch(void)
setbat(-1, va, immrbase, immrsize, PAGE_KERNEL_NCG);
update_bats();
}
-
- mpc83xx_setup_pci();
}
int machine_check_83xx(struct pt_regs *regs)
diff --git a/arch/powerpc/platforms/83xx/mpc830x_rdb.c b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
index 51426e88ec67..956d4389effa 100644
--- a/arch/powerpc/platforms/83xx/mpc830x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
@@ -48,6 +48,7 @@ define_machine(mpc830x_rdb) {
.name = "MPC830x RDB",
.probe = mpc830x_rdb_probe,
.setup_arch = mpc830x_rdb_setup_arch,
+ .discover_phbs = mpc83xx_setup_pci,
.init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
diff --git a/arch/powerpc/platforms/83xx/mpc831x_rdb.c b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
index 5ccd57a48492..3b578f080e3b 100644
--- a/arch/powerpc/platforms/83xx/mpc831x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
@@ -48,6 +48,7 @@ define_machine(mpc831x_rdb) {
.name = "MPC831x RDB",
.probe = mpc831x_rdb_probe,
.setup_arch = mpc831x_rdb_setup_arch,
+ .discover_phbs = mpc83xx_setup_pci,
.init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index 6fa5402ebf20..850d566ef900 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -101,6 +101,7 @@ define_machine(mpc832x_mds) {
.name = "MPC832x MDS",
.probe = mpc832x_sys_probe,
.setup_arch = mpc832x_sys_setup_arch,
+ .discover_phbs = mpc83xx_setup_pci,
.init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index 622c625d5ce4..b6133a237a70 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -219,6 +219,7 @@ define_machine(mpc832x_rdb) {
.name = "MPC832x RDB",
.probe = mpc832x_rdb_probe,
.setup_arch = mpc832x_rdb_setup_arch,
+ .discover_phbs = mpc83xx_setup_pci,
.init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index ebfd139bca20..9630f3aa4d9c 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -70,6 +70,7 @@ define_machine(mpc834x_itx) {
.name = "MPC834x ITX",
.probe = mpc834x_itx_probe,
.setup_arch = mpc834x_itx_setup_arch,
+ .discover_phbs = mpc83xx_setup_pci,
.init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index 356228e35279..6d91bdce0a18 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -91,6 +91,7 @@ define_machine(mpc834x_mds) {
.name = "MPC834x MDS",
.probe = mpc834x_mds_probe,
.setup_arch = mpc834x_mds_setup_arch,
+ .discover_phbs = mpc83xx_setup_pci,
.init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 90d9cbfae659..da4cf52cb55b 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -201,6 +201,7 @@ define_machine(mpc836x_mds) {
.name = "MPC836x MDS",
.probe = mpc836x_mds_probe,
.setup_arch = mpc836x_mds_setup_arch,
+ .discover_phbs = mpc83xx_setup_pci,
.init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
diff --git a/arch/powerpc/platforms/83xx/mpc836x_rdk.c b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
index b4aac2cde849..3427ad0d9d38 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_rdk.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
@@ -41,6 +41,7 @@ define_machine(mpc836x_rdk) {
.name = "MPC836x RDK",
.probe = mpc836x_rdk_probe,
.setup_arch = mpc836x_rdk_setup_arch,
+ .discover_phbs = mpc83xx_setup_pci,
.init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index 9d3721c965be..f28d166ea7db 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -93,6 +93,7 @@ define_machine(mpc837x_mds) {
.name = "MPC837x MDS",
.probe = mpc837x_mds_probe,
.setup_arch = mpc837x_mds_setup_arch,
+ .discover_phbs = mpc83xx_setup_pci,
.init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
index 7c45f7ac2607..7fb7684c256b 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
@@ -73,6 +73,7 @@ define_machine(mpc837x_rdb) {
.name = "MPC837x RDB/WLAN",
.probe = mpc837x_rdb_probe,
.setup_arch = mpc837x_rdb_setup_arch,
+ .discover_phbs = mpc83xx_setup_pci,
.init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
--
2.26.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 11/18] powerpc/amigaone: Move PHB discovery
2020-11-03 4:35 [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (8 preceding siblings ...)
2020-11-03 4:35 ` [PATCH 10/18] powerpc/83xx: " Oliver O'Halloran
@ 2020-11-03 4:35 ` Oliver O'Halloran
2020-11-03 4:35 ` [PATCH 12/18] powerpc/chrp: " Oliver O'Halloran
` (8 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: Oliver O'Halloran @ 2020-11-03 4:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Oliver O'Halloran
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
compile tested with amigaone_defconfig
---
arch/powerpc/platforms/amigaone/setup.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/amigaone/setup.c b/arch/powerpc/platforms/amigaone/setup.c
index f5d0bf999759..b25ddf39dd43 100644
--- a/arch/powerpc/platforms/amigaone/setup.c
+++ b/arch/powerpc/platforms/amigaone/setup.c
@@ -65,6 +65,12 @@ static int __init amigaone_add_bridge(struct device_node *dev)
}
void __init amigaone_setup_arch(void)
+{
+ if (ppc_md.progress)
+ ppc_md.progress("Linux/PPC "UTS_RELEASE"\n", 0);
+}
+
+void __init amigaone_discover_phbs(void)
{
struct device_node *np;
int phb = -ENODEV;
@@ -74,9 +80,6 @@ void __init amigaone_setup_arch(void)
phb = amigaone_add_bridge(np);
BUG_ON(phb != 0);
-
- if (ppc_md.progress)
- ppc_md.progress("Linux/PPC "UTS_RELEASE"\n", 0);
}
void __init amigaone_init_IRQ(void)
@@ -159,6 +162,7 @@ define_machine(amigaone) {
.name = "AmigaOne",
.probe = amigaone_probe,
.setup_arch = amigaone_setup_arch,
+ .discover_phbs = amigaone_discover_phbs,
.show_cpuinfo = amigaone_show_cpuinfo,
.init_IRQ = amigaone_init_IRQ,
.restart = amigaone_restart,
--
2.26.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 12/18] powerpc/chrp: Move PHB discovery
2020-11-03 4:35 [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (9 preceding siblings ...)
2020-11-03 4:35 ` [PATCH 11/18] powerpc/amigaone: " Oliver O'Halloran
@ 2020-11-03 4:35 ` Oliver O'Halloran
2020-11-03 4:35 ` [PATCH 13/18] powerpc/embedded6xx/holly: " Oliver O'Halloran
` (7 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: Oliver O'Halloran @ 2020-11-03 4:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Oliver O'Halloran
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
compile tested with chrp32_defconfig
---
arch/powerpc/platforms/chrp/pci.c | 8 ++++++++
arch/powerpc/platforms/chrp/setup.c | 12 +-----------
2 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
index b2c2bf35b76c..8c421dc78b28 100644
--- a/arch/powerpc/platforms/chrp/pci.c
+++ b/arch/powerpc/platforms/chrp/pci.c
@@ -314,6 +314,14 @@ chrp_find_bridges(void)
}
}
of_node_put(root);
+
+ /*
+ * "Temporary" fixes for PCI devices.
+ * -- Geert
+ */
+ hydra_init(); /* Mac I/O */
+
+ pci_create_OF_bus_map();
}
/* SL82C105 IDE Control/Status Register */
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index c45435aa5e36..3cfc382841e5 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -334,22 +334,11 @@ static void __init chrp_setup_arch(void)
/* On pegasos, enable the L2 cache if not already done by OF */
pegasos_set_l2cr();
- /* Lookup PCI host bridges */
- chrp_find_bridges();
-
- /*
- * Temporary fixes for PCI devices.
- * -- Geert
- */
- hydra_init(); /* Mac I/O */
-
/*
* Fix the Super I/O configuration
*/
sio_init();
- pci_create_OF_bus_map();
-
/*
* Print the banner, then scroll down so boot progress
* can be printed. -- Cort
@@ -582,6 +571,7 @@ define_machine(chrp) {
.name = "CHRP",
.probe = chrp_probe,
.setup_arch = chrp_setup_arch,
+ .discover_phbs = chrp_find_bridges,
.init = chrp_init2,
.show_cpuinfo = chrp_show_cpuinfo,
.init_IRQ = chrp_init_IRQ,
--
2.26.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 13/18] powerpc/embedded6xx/holly: Move PHB discovery
2020-11-03 4:35 [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (10 preceding siblings ...)
2020-11-03 4:35 ` [PATCH 12/18] powerpc/chrp: " Oliver O'Halloran
@ 2020-11-03 4:35 ` Oliver O'Halloran
2020-11-03 4:35 ` [PATCH 14/18] powerpc/embedded6xx/linkstation: " Oliver O'Halloran
` (6 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: Oliver O'Halloran @ 2020-11-03 4:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Oliver O'Halloran
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
compile tested with holly_defconfig
---
arch/powerpc/platforms/embedded6xx/holly.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/embedded6xx/holly.c b/arch/powerpc/platforms/embedded6xx/holly.c
index d8f2e2c737bb..53065d564161 100644
--- a/arch/powerpc/platforms/embedded6xx/holly.c
+++ b/arch/powerpc/platforms/embedded6xx/holly.c
@@ -108,15 +108,13 @@ static void holly_remap_bridge(void)
tsi108_write_reg(TSI108_PCI_P2O_BAR2, 0x0);
}
-static void __init holly_setup_arch(void)
+static void __init holly_init_pci(void)
{
struct device_node *np;
if (ppc_md.progress)
ppc_md.progress("holly_setup_arch():set_bridge", 0);
- tsi108_csr_vir_base = get_vir_csrbase();
-
/* setup PCI host bridge */
holly_remap_bridge();
@@ -127,6 +125,11 @@ static void __init holly_setup_arch(void)
ppc_md.pci_exclude_device = holly_exclude_device;
if (ppc_md.progress)
ppc_md.progress("tsi108: resources set", 0x100);
+}
+
+static void __init holly_setup_arch(void)
+{
+ tsi108_csr_vir_base = get_vir_csrbase();
printk(KERN_INFO "PPC750GX/CL Platform\n");
}
@@ -259,6 +262,7 @@ define_machine(holly){
.name = "PPC750 GX/CL TSI",
.probe = holly_probe,
.setup_arch = holly_setup_arch,
+ .discover_phbs = holly_init_pci,
.init_IRQ = holly_init_IRQ,
.show_cpuinfo = holly_show_cpuinfo,
.get_irq = mpic_get_irq,
--
2.26.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 14/18] powerpc/embedded6xx/linkstation: Move PHB discovery
2020-11-03 4:35 [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (11 preceding siblings ...)
2020-11-03 4:35 ` [PATCH 13/18] powerpc/embedded6xx/holly: " Oliver O'Halloran
@ 2020-11-03 4:35 ` Oliver O'Halloran
2020-11-03 4:35 ` [PATCH 15/18] powerpc/embedded6xx/mpc7448: " Oliver O'Halloran
` (5 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: Oliver O'Halloran @ 2020-11-03 4:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Oliver O'Halloran
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
compile tested with linkstation_defconfig
---
arch/powerpc/platforms/embedded6xx/linkstation.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/embedded6xx/linkstation.c b/arch/powerpc/platforms/embedded6xx/linkstation.c
index f514d5d28cd4..eb8342e7f84e 100644
--- a/arch/powerpc/platforms/embedded6xx/linkstation.c
+++ b/arch/powerpc/platforms/embedded6xx/linkstation.c
@@ -63,15 +63,18 @@ static int __init linkstation_add_bridge(struct device_node *dev)
}
static void __init linkstation_setup_arch(void)
+{
+ printk(KERN_INFO "BUFFALO Network Attached Storage Series\n");
+ printk(KERN_INFO "(C) 2002-2005 BUFFALO INC.\n");
+}
+
+static void __init linkstation_setup_pci(void)
{
struct device_node *np;
/* Lookup PCI host bridges */
for_each_compatible_node(np, "pci", "mpc10x-pci")
linkstation_add_bridge(np);
-
- printk(KERN_INFO "BUFFALO Network Attached Storage Series\n");
- printk(KERN_INFO "(C) 2002-2005 BUFFALO INC.\n");
}
/*
@@ -153,6 +156,7 @@ define_machine(linkstation){
.name = "Buffalo Linkstation",
.probe = linkstation_probe,
.setup_arch = linkstation_setup_arch,
+ .discover_phbs = linkstation_setup_pci,
.init_IRQ = linkstation_init_IRQ,
.show_cpuinfo = linkstation_show_cpuinfo,
.get_irq = mpic_get_irq,
--
2.26.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 15/18] powerpc/embedded6xx/mpc7448: Move PHB discovery
2020-11-03 4:35 [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (12 preceding siblings ...)
2020-11-03 4:35 ` [PATCH 14/18] powerpc/embedded6xx/linkstation: " Oliver O'Halloran
@ 2020-11-03 4:35 ` Oliver O'Halloran
2020-11-03 4:35 ` [PATCH 16/18] powerpc/embedded6xx/mve5100: " Oliver O'Halloran
` (4 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: Oliver O'Halloran @ 2020-11-03 4:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Oliver O'Halloran
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
compile tested with mpc7448_hpc2_defconfig
---
arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
index b95c3380d2b5..5565647dc879 100644
--- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
+++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
@@ -58,16 +58,14 @@ int mpc7448_hpc2_exclude_device(struct pci_controller *hose,
return PCIBIOS_SUCCESSFUL;
}
-static void __init mpc7448_hpc2_setup_arch(void)
+static void __init mpc7448_hpc2_setup_pci(void)
{
+#ifdef CONFIG_PCI
struct device_node *np;
if (ppc_md.progress)
- ppc_md.progress("mpc7448_hpc2_setup_arch():set_bridge", 0);
-
- tsi108_csr_vir_base = get_vir_csrbase();
+ ppc_md.progress("mpc7448_hpc2_setup_pci():set_bridge", 0);
/* setup PCI host bridge */
-#ifdef CONFIG_PCI
for_each_compatible_node(np, "pci", "tsi108-pci")
tsi108_setup_pci(np, MPC7448HPC2_PCI_CFG_PHYS, 0);
@@ -75,6 +73,11 @@ static void __init mpc7448_hpc2_setup_arch(void)
if (ppc_md.progress)
ppc_md.progress("tsi108: resources set", 0x100);
#endif
+}
+
+static void __init mpc7448_hpc2_setup_arch(void)
+{
+ tsi108_csr_vir_base = get_vir_csrbase();
printk(KERN_INFO "MPC7448HPC2 (TAIGA) Platform\n");
printk(KERN_INFO
@@ -181,6 +184,7 @@ define_machine(mpc7448_hpc2){
.name = "MPC7448 HPC2",
.probe = mpc7448_hpc2_probe,
.setup_arch = mpc7448_hpc2_setup_arch,
+ .discover_phbs = mpc7448_hpc2_setup_pci,
.init_IRQ = mpc7448_hpc2_init_IRQ,
.show_cpuinfo = mpc7448_hpc2_show_cpuinfo,
.get_irq = mpic_get_irq,
--
2.26.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 16/18] powerpc/embedded6xx/mve5100: Move PHB discovery
2020-11-03 4:35 [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (13 preceding siblings ...)
2020-11-03 4:35 ` [PATCH 15/18] powerpc/embedded6xx/mpc7448: " Oliver O'Halloran
@ 2020-11-03 4:35 ` Oliver O'Halloran
2020-11-03 4:35 ` [PATCH 17/18] powerpc/pasemi: " Oliver O'Halloran
` (3 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: Oliver O'Halloran @ 2020-11-03 4:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Oliver O'Halloran
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
compile tested with mvme5100_defconfig
---
arch/powerpc/platforms/embedded6xx/mvme5100.c | 13 ++++++++-----
arch/powerpc/platforms/embedded6xx/storcenter.c | 8 ++++++--
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/platforms/embedded6xx/mvme5100.c b/arch/powerpc/platforms/embedded6xx/mvme5100.c
index 1cd488daa0bf..c06a0490d157 100644
--- a/arch/powerpc/platforms/embedded6xx/mvme5100.c
+++ b/arch/powerpc/platforms/embedded6xx/mvme5100.c
@@ -154,17 +154,19 @@ static const struct of_device_id mvme5100_of_bus_ids[] __initconst = {
*/
static void __init mvme5100_setup_arch(void)
{
- struct device_node *np;
-
if (ppc_md.progress)
ppc_md.progress("mvme5100_setup_arch()", 0);
- for_each_compatible_node(np, "pci", "hawk-pci")
- mvme5100_add_bridge(np);
-
restart = ioremap(BOARD_MODRST_REG, 4);
}
+static void __init mvme5100_setup_pci(void)
+{
+ struct device_node *np;
+
+ for_each_compatible_node(np, "pci", "hawk-pci")
+ mvme5100_add_bridge(np);
+}
static void mvme5100_show_cpuinfo(struct seq_file *m)
{
@@ -205,6 +207,7 @@ define_machine(mvme5100) {
.name = "MVME5100",
.probe = mvme5100_probe,
.setup_arch = mvme5100_setup_arch,
+ .discover_phbs = mvme5100_setup_pci,
.init_IRQ = mvme5100_pic_init,
.show_cpuinfo = mvme5100_show_cpuinfo,
.get_irq = mpic_get_irq,
diff --git a/arch/powerpc/platforms/embedded6xx/storcenter.c b/arch/powerpc/platforms/embedded6xx/storcenter.c
index e346ddcef45e..e188b90f7016 100644
--- a/arch/powerpc/platforms/embedded6xx/storcenter.c
+++ b/arch/powerpc/platforms/embedded6xx/storcenter.c
@@ -65,14 +65,17 @@ static int __init storcenter_add_bridge(struct device_node *dev)
}
static void __init storcenter_setup_arch(void)
+{
+ printk(KERN_INFO "IOMEGA StorCenter\n");
+}
+
+static void __init storcenter_setup_pci(void)
{
struct device_node *np;
/* Lookup PCI host bridges */
for_each_compatible_node(np, "pci", "mpc10x-pci")
storcenter_add_bridge(np);
-
- printk(KERN_INFO "IOMEGA StorCenter\n");
}
/*
@@ -117,6 +120,7 @@ define_machine(storcenter){
.name = "IOMEGA StorCenter",
.probe = storcenter_probe,
.setup_arch = storcenter_setup_arch,
+ .discover_phbs = storcenter_setup_pci,
.init_IRQ = storcenter_init_IRQ,
.get_irq = mpic_get_irq,
.restart = storcenter_restart,
--
2.26.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 17/18] powerpc/pasemi: Move PHB discovery
2020-11-03 4:35 [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (14 preceding siblings ...)
2020-11-03 4:35 ` [PATCH 16/18] powerpc/embedded6xx/mve5100: " Oliver O'Halloran
@ 2020-11-03 4:35 ` Oliver O'Halloran
2020-11-03 4:35 ` [PATCH 18/18] powerpc/powermac: " Oliver O'Halloran
` (2 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: Oliver O'Halloran @ 2020-11-03 4:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Oliver O'Halloran
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
compile tested with pasemi_defconfig
---
arch/powerpc/platforms/pasemi/setup.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index b612474f8f8e..376797eb7894 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -144,8 +144,6 @@ static void __init pas_setup_arch(void)
/* Setup SMP callback */
smp_ops = &pas_smp_ops;
#endif
- /* Lookup PCI hosts */
- pas_pci_init();
/* Remap SDC register for doing reset */
/* XXXOJN This should maybe come out of the device tree */
@@ -446,6 +444,7 @@ define_machine(pasemi) {
.name = "PA Semi PWRficient",
.probe = pas_probe,
.setup_arch = pas_setup_arch,
+ .discover_phbs = pas_pci_init,
.init_IRQ = pas_init_IRQ,
.get_irq = mpic_get_irq,
.restart = pas_restart,
--
2.26.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 18/18] powerpc/powermac: Move PHB discovery
2020-11-03 4:35 [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (15 preceding siblings ...)
2020-11-03 4:35 ` [PATCH 17/18] powerpc/pasemi: " Oliver O'Halloran
@ 2020-11-03 4:35 ` Oliver O'Halloran
2020-11-04 4:07 ` [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() kernel test robot
2021-02-10 12:57 ` Michael Ellerman
18 siblings, 0 replies; 20+ messages in thread
From: Oliver O'Halloran @ 2020-11-03 4:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Oliver O'Halloran
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
compile tested with pmac32_defconfig and g5_defconfig
---
arch/powerpc/platforms/powermac/setup.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 2e2cc0c75d87..86aee3f2483f 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -298,9 +298,6 @@ static void __init pmac_setup_arch(void)
of_node_put(ic);
}
- /* Lookup PCI hosts */
- pmac_pci_init();
-
#ifdef CONFIG_PPC32
ohare_init();
l2cr_init();
@@ -600,6 +597,7 @@ define_machine(powermac) {
.name = "PowerMac",
.probe = pmac_probe,
.setup_arch = pmac_setup_arch,
+ .discover_phbs = pmac_pci_init,
.show_cpuinfo = pmac_show_cpuinfo,
.init_IRQ = pmac_pic_init,
.get_irq = NULL, /* changed later */
--
2.26.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs()
2020-11-03 4:35 [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (16 preceding siblings ...)
2020-11-03 4:35 ` [PATCH 18/18] powerpc/powermac: " Oliver O'Halloran
@ 2020-11-04 4:07 ` kernel test robot
2021-02-10 12:57 ` Michael Ellerman
18 siblings, 0 replies; 20+ messages in thread
From: kernel test robot @ 2020-11-04 4:07 UTC (permalink / raw)
To: Oliver O'Halloran, linuxppc-dev
Cc: clang-built-linux, Oliver O'Halloran, kbuild-all, Paul Mackerras
[-- Attachment #1: Type: text/plain, Size: 2261 bytes --]
Hi Oliver,
I love your patch! Perhaps something to improve:
[auto build test WARNING on powerpc/next]
[also build test WARNING on v5.10-rc2 next-20201103]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Oliver-O-Halloran/powerpc-pci-Add-ppc_md-discover_phbs/20201103-130935
base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc64-randconfig-r024-20201103 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 1fcd5d5655e29f85e12b402e32974f207cfedf32)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://github.com/0day-ci/linux/commit/76dcfc8e7ec9ceaee251e156ffe07140bf1f1a5d
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Oliver-O-Halloran/powerpc-pci-Add-ppc_md-discover_phbs/20201103-130935
git checkout 76dcfc8e7ec9ceaee251e156ffe07140bf1f1a5d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> arch/powerpc/kernel/pci-common.c:1630:12: warning: no previous prototype for function 'discover_phbs' [-Wmissing-prototypes]
int __init discover_phbs(void)
^
arch/powerpc/kernel/pci-common.c:1630:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int __init discover_phbs(void)
^
static
1 warning generated.
vim +/discover_phbs +1630 arch/powerpc/kernel/pci-common.c
1628
1629
> 1630 int __init discover_phbs(void)
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34042 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs()
2020-11-03 4:35 [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (17 preceding siblings ...)
2020-11-04 4:07 ` [PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() kernel test robot
@ 2021-02-10 12:57 ` Michael Ellerman
18 siblings, 0 replies; 20+ messages in thread
From: Michael Ellerman @ 2021-02-10 12:57 UTC (permalink / raw)
To: linuxppc-dev, Oliver O'Halloran; +Cc: Paul Mackerras
On Tue, 3 Nov 2020 15:35:06 +1100, Oliver O'Halloran wrote:
> On many powerpc platforms the discovery and initalisation of
> pci_controllers (PHBs) happens inside of setup_arch(). This is very early
> in boot (pre-initcalls) and means that we're initialising the PHB long
> before many basic kernel services (slab allocator, debugfs, a real ioremap)
> are available.
>
> On PowerNV this causes an additional problem since we map the PHB registers
> with ioremap(). As of commit d538aadc2718 ("powerpc/ioremap: warn on early
> use of ioremap()") a warning is printed because we're using the "incorrect"
> API to setup and MMIO mapping in searly boot. The kernel does provide
> early_ioremap(), but that is not intended to create long-lived MMIO
> mappings and a seperate warning is printed by generic code if
> early_ioremap() mappings are "leaked."
>
> [...]
Applied to powerpc/next.
[01/18] powerpc/pci: Add ppc_md.discover_phbs()
https://git.kernel.org/powerpc/c/5537fcb319d016ce387f818dd774179bc03217f5
[02/18] powerpc/pci: Move PHB discovery for PCI_DN using platforms
https://git.kernel.org/powerpc/c/fbbefb320214db14c3e740fce98e2c95c9d0669b
[03/18] powerpc/maple: Move PHB discovery
(squashed into 2)
[04/18] powerpc/512x: Move PHB discovery
https://git.kernel.org/powerpc/c/893586ec949d3e48573a585c26bf04998fea6e1f
[05/18] powerpc/52xx/efika: Move PHB discovery
https://git.kernel.org/powerpc/c/eab3166f4eac384b48ebd2ed7b61dc465c1912cf
[06/18] powerpc/52xx/lite5200: Move PHB discovery
https://git.kernel.org/powerpc/c/e0bf9de2242a31a8f79015376ed08c4efe74774a
[07/18] powerpc/52xx/media5200: Move PHB discovery
https://git.kernel.org/powerpc/c/ba5087622a0f11c8d3c6587392ebc70f96503e51
[08/18] powerpc/52xx/mpc5200_simple: Move PHB discovery
https://git.kernel.org/powerpc/c/a760cfd9cfa2193961d7e599f46fbfe2498c400a
[09/18] powerpc/82xx/*: Move PHB discovery
https://git.kernel.org/powerpc/c/3c82a6aecd367bbbe7876c406cd3e12b5b0e4204
[10/18] powerpc/83xx: Move PHB discovery
https://git.kernel.org/powerpc/c/83f84041ff1cf6c23fc38861218af2d4ca2d9b38
[11/18] powerpc/amigaone: Move PHB discovery
https://git.kernel.org/powerpc/c/053d58c870298d62b9c5154672ef2f1684c4ea43
[12/18] powerpc/chrp: Move PHB discovery
https://git.kernel.org/powerpc/c/407d418f2fd4c20aa8ca1cf4168a414d77766852
[13/18] powerpc/embedded6xx/holly: Move PHB discovery
https://git.kernel.org/powerpc/c/08c4738254b87117c69816d8033dd25f38185f92
[14/18] powerpc/embedded6xx/linkstation: Move PHB discovery
https://git.kernel.org/powerpc/c/daa6c24780c15f4abcb76a9d426142beff9f62c6
[15/18] powerpc/embedded6xx/mpc7448: Move PHB discovery
https://git.kernel.org/powerpc/c/748770aeb44108ecb4e09d273e7718611cd60a98
[16/18] powerpc/embedded6xx/mve5100: Move PHB discovery
https://git.kernel.org/powerpc/c/d20a864f434b277b245ac6508920d90a48f6155d
[17/18] powerpc/pasemi: Move PHB discovery
https://git.kernel.org/powerpc/c/c144bc719234500e292c0545de99822bd8a78a6b
[18/18] powerpc/powermac: Move PHB discovery
(squashed into 2)
cheers
^ permalink raw reply [flat|nested] 20+ messages in thread