* [RFC PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs()
@ 2020-09-24 6:38 Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 02/18] powerpc/{powernv,pseries}: Move PHB discovery Oliver O'Halloran
` (16 more replies)
0 siblings, 17 replies; 19+ messages in thread
From: Oliver O'Halloran @ 2020-09-24 6:38 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Paul Mackerras, Oliver O'Halloran
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."
This is all fixable with dumb hacks like using early_ioremap() to setup
the initial mapping then replacing it with a real ioremap later on in
boot, but it does raise the question: Why the hell are we setting up the
PHB's this early in boot?
The old and wise claim it's due to "hysterical rasins." Aside from amused
grapes there doesn't appear to be any real reason to maintain the current
behaviour. Already most of the newer embedded platforms perform PHB
discovery in an arch_initcall and between the end of setup_arch() and the
start of initcalls none of the generic kernel code does anything PCI
related. On powerpc scanning PHBs occurs in a subsys_initcall so it should
be possible to move the PHB discovery to a core, postcore or arch initcall.
This patch adds the ppc_md.discover_phbs hook and a core_initcall stub that
calls it. The core_initcalls are the earliest to be called so this will
any possibly issues with dependency between initcalls. This isn't just an
academic issue either since on pseries and PowerNV EEH init occurs in an
arch_initcall and depends on the pci_controllers being available, similarly
the creation of pci_dns occurs at core_initcall_sync (i.e. between core and
postcore initcalls). These problems need to be addressed seperately.
Cc: Paul Mackerras <paulus@samba.org>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
arch/powerpc/include/asm/machdep.h | 3 +++
arch/powerpc/kernel/pci-common.c | 10 ++++++++++
2 files changed, 13 insertions(+)
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index a90b892f0bfe..b732dd5722aa 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -59,6 +59,9 @@ struct machdep_calls {
int (*pcibios_root_bridge_prepare)(struct pci_host_bridge
*bridge);
+ /* finds all the pci_controllers present at boot */
+ void (*discover_phbs)(void);
+
/* To setup PHBs when using automatic OF platform driver for PCI */
int (*pci_setup_phb)(struct pci_controller *host);
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index be108616a721..6265e7d1c697 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1625,3 +1625,13 @@ static void fixup_hide_host_resource_fsl(struct pci_dev *dev)
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MOTOROLA, PCI_ANY_ID, fixup_hide_host_resource_fsl);
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_FREESCALE, PCI_ANY_ID, fixup_hide_host_resource_fsl);
+
+
+int __init discover_phbs(void)
+{
+ if (ppc_md.discover_phbs)
+ ppc_md.discover_phbs();
+
+ return 0;
+}
+core_initcall(discover_phbs);
--
2.26.2
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [RFC PATCH 02/18] powerpc/{powernv,pseries}: Move PHB discovery
2020-09-24 6:38 [RFC PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
@ 2020-09-24 6:38 ` Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 03/18] powerpc/maple: " Oliver O'Halloran
` (15 subsequent siblings)
16 siblings, 0 replies; 19+ messages in thread
From: Oliver O'Halloran @ 2020-09-24 6:38 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 023a4f987bb2..987654a08e2e 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -3184,6 +3184,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 7fcb88623081..a4d6d41b1155 100644
--- a/arch/powerpc/platforms/powernv/setup.c
+++ b/arch/powerpc/platforms/powernv/setup.c
@@ -140,9 +140,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();
@@ -500,6 +497,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 2f4ee0a90284..d0bf487fadf5 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);
@@ -771,7 +774,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();
@@ -1035,6 +1037,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] 19+ messages in thread
* [RFC PATCH 03/18] powerpc/maple: Move PHB discovery
2020-09-24 6:38 [RFC PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 02/18] powerpc/{powernv,pseries}: Move PHB discovery Oliver O'Halloran
@ 2020-09-24 6:38 ` Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 04/18] powerpc/512x: " Oliver O'Halloran
` (14 subsequent siblings)
16 siblings, 0 replies; 19+ messages in thread
From: Oliver O'Halloran @ 2020-09-24 6:38 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] 19+ messages in thread
* [RFC PATCH 04/18] powerpc/512x: Move PHB discovery
2020-09-24 6:38 [RFC PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 02/18] powerpc/{powernv,pseries}: Move PHB discovery Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 03/18] powerpc/maple: " Oliver O'Halloran
@ 2020-09-24 6:38 ` Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 05/18] powerpc/52xx/efika: " Oliver O'Halloran
` (13 subsequent siblings)
16 siblings, 0 replies; 19+ messages in thread
From: Oliver O'Halloran @ 2020-09-24 6:38 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] 19+ messages in thread
* [RFC PATCH 05/18] powerpc/52xx/efika: Move PHB discovery
2020-09-24 6:38 [RFC PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (2 preceding siblings ...)
2020-09-24 6:38 ` [RFC PATCH 04/18] powerpc/512x: " Oliver O'Halloran
@ 2020-09-24 6:38 ` Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 06/18] powerpc/52xx/lite5200: " Oliver O'Halloran
` (12 subsequent siblings)
16 siblings, 0 replies; 19+ messages in thread
From: Oliver O'Halloran @ 2020-09-24 6:38 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] 19+ messages in thread
* [RFC PATCH 06/18] powerpc/52xx/lite5200: Move PHB discovery
2020-09-24 6:38 [RFC PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (3 preceding siblings ...)
2020-09-24 6:38 ` [RFC PATCH 05/18] powerpc/52xx/efika: " Oliver O'Halloran
@ 2020-09-24 6:38 ` Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 07/18] powerpc/52xx/media5200: " Oliver O'Halloran
` (11 subsequent siblings)
16 siblings, 0 replies; 19+ messages in thread
From: Oliver O'Halloran @ 2020-09-24 6:38 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] 19+ messages in thread
* [RFC PATCH 07/18] powerpc/52xx/media5200: Move PHB discovery
2020-09-24 6:38 [RFC PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (4 preceding siblings ...)
2020-09-24 6:38 ` [RFC PATCH 06/18] powerpc/52xx/lite5200: " Oliver O'Halloran
@ 2020-09-24 6:38 ` Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 08/18] powerpc/52xx/mpc5200_simple: " Oliver O'Halloran
` (10 subsequent siblings)
16 siblings, 0 replies; 19+ messages in thread
From: Oliver O'Halloran @ 2020-09-24 6:38 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] 19+ messages in thread
* [RFC PATCH 08/18] powerpc/52xx/mpc5200_simple: Move PHB discovery
2020-09-24 6:38 [RFC PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (5 preceding siblings ...)
2020-09-24 6:38 ` [RFC PATCH 07/18] powerpc/52xx/media5200: " Oliver O'Halloran
@ 2020-09-24 6:38 ` Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 09/18] powerpc/82xx/*: " Oliver O'Halloran
` (9 subsequent siblings)
16 siblings, 0 replies; 19+ messages in thread
From: Oliver O'Halloran @ 2020-09-24 6:38 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] 19+ messages in thread
* [RFC PATCH 09/18] powerpc/82xx/*: Move PHB discovery
2020-09-24 6:38 [RFC PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (6 preceding siblings ...)
2020-09-24 6:38 ` [RFC PATCH 08/18] powerpc/52xx/mpc5200_simple: " Oliver O'Halloran
@ 2020-09-24 6:38 ` Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 10/18] powerpc/83xx: " Oliver O'Halloran
` (8 subsequent siblings)
16 siblings, 0 replies; 19+ messages in thread
From: Oliver O'Halloran @ 2020-09-24 6:38 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] 19+ messages in thread
* [RFC PATCH 10/18] powerpc/83xx: Move PHB discovery
2020-09-24 6:38 [RFC PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (7 preceding siblings ...)
2020-09-24 6:38 ` [RFC PATCH 09/18] powerpc/82xx/*: " Oliver O'Halloran
@ 2020-09-24 6:38 ` Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 11/18] powerpc/amigaone: " Oliver O'Halloran
` (7 subsequent siblings)
16 siblings, 0 replies; 19+ messages in thread
From: Oliver O'Halloran @ 2020-09-24 6:38 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] 19+ messages in thread
* [RFC PATCH 11/18] powerpc/amigaone: Move PHB discovery
2020-09-24 6:38 [RFC PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (8 preceding siblings ...)
2020-09-24 6:38 ` [RFC PATCH 10/18] powerpc/83xx: " Oliver O'Halloran
@ 2020-09-24 6:38 ` Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 12/18] powerpc/chrp: " Oliver O'Halloran
` (6 subsequent siblings)
16 siblings, 0 replies; 19+ messages in thread
From: Oliver O'Halloran @ 2020-09-24 6:38 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] 19+ messages in thread
* [RFC PATCH 12/18] powerpc/chrp: Move PHB discovery
2020-09-24 6:38 [RFC PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (9 preceding siblings ...)
2020-09-24 6:38 ` [RFC PATCH 11/18] powerpc/amigaone: " Oliver O'Halloran
@ 2020-09-24 6:38 ` Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 13/18] powerpc/embedded6xx/holly: " Oliver O'Halloran
` (5 subsequent siblings)
16 siblings, 0 replies; 19+ messages in thread
From: Oliver O'Halloran @ 2020-09-24 6:38 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] 19+ messages in thread
* [RFC PATCH 13/18] powerpc/embedded6xx/holly: Move PHB discovery
2020-09-24 6:38 [RFC PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (10 preceding siblings ...)
2020-09-24 6:38 ` [RFC PATCH 12/18] powerpc/chrp: " Oliver O'Halloran
@ 2020-09-24 6:38 ` Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 14/18] powerpc/embedded6xx/linkstation: " Oliver O'Halloran
` (4 subsequent siblings)
16 siblings, 0 replies; 19+ messages in thread
From: Oliver O'Halloran @ 2020-09-24 6:38 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] 19+ messages in thread
* [RFC PATCH 14/18] powerpc/embedded6xx/linkstation: Move PHB discovery
2020-09-24 6:38 [RFC PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (11 preceding siblings ...)
2020-09-24 6:38 ` [RFC PATCH 13/18] powerpc/embedded6xx/holly: " Oliver O'Halloran
@ 2020-09-24 6:38 ` Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 15/18] powerpc/embedded6xx/mpc7448: " Oliver O'Halloran
` (3 subsequent siblings)
16 siblings, 0 replies; 19+ messages in thread
From: Oliver O'Halloran @ 2020-09-24 6:38 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] 19+ messages in thread
* [RFC PATCH 15/18] powerpc/embedded6xx/mpc7448: Move PHB discovery
2020-09-24 6:38 [RFC PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (12 preceding siblings ...)
2020-09-24 6:38 ` [RFC PATCH 14/18] powerpc/embedded6xx/linkstation: " Oliver O'Halloran
@ 2020-09-24 6:38 ` Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 16/18] powerpc/embedded6xx/mve5100: " Oliver O'Halloran
` (2 subsequent siblings)
16 siblings, 0 replies; 19+ messages in thread
From: Oliver O'Halloran @ 2020-09-24 6:38 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 15437abe1f6d..20b727584e40 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
@@ -180,6 +183,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] 19+ messages in thread
* [RFC PATCH 16/18] powerpc/embedded6xx/mve5100: Move PHB discovery
2020-09-24 6:38 [RFC PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (13 preceding siblings ...)
2020-09-24 6:38 ` [RFC PATCH 15/18] powerpc/embedded6xx/mpc7448: " Oliver O'Halloran
@ 2020-09-24 6:38 ` Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 17/18] powerpc/pasemi: " Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 18/18] powerpc/powermac: " Oliver O'Halloran
16 siblings, 0 replies; 19+ messages in thread
From: Oliver O'Halloran @ 2020-09-24 6:38 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 ed1914dd34bb..e8c5de54b0e1 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");
}
/*
@@ -116,6 +119,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] 19+ messages in thread
* [RFC PATCH 17/18] powerpc/pasemi: Move PHB discovery
2020-09-24 6:38 [RFC PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (14 preceding siblings ...)
2020-09-24 6:38 ` [RFC PATCH 16/18] powerpc/embedded6xx/mve5100: " Oliver O'Halloran
@ 2020-09-24 6:38 ` Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 18/18] powerpc/powermac: " Oliver O'Halloran
16 siblings, 0 replies; 19+ messages in thread
From: Oliver O'Halloran @ 2020-09-24 6:38 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] 19+ messages in thread
* [RFC PATCH 18/18] powerpc/powermac: Move PHB discovery
2020-09-24 6:38 [RFC PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
` (15 preceding siblings ...)
2020-09-24 6:38 ` [RFC PATCH 17/18] powerpc/pasemi: " Oliver O'Halloran
@ 2020-09-24 6:38 ` Oliver O'Halloran
2020-09-27 7:25 ` Christophe Leroy
16 siblings, 1 reply; 19+ messages in thread
From: Oliver O'Halloran @ 2020-09-24 6:38 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 f002b0fa69b8..0f8669139a21 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] 19+ messages in thread
* Re: [RFC PATCH 18/18] powerpc/powermac: Move PHB discovery
2020-09-24 6:38 ` [RFC PATCH 18/18] powerpc/powermac: " Oliver O'Halloran
@ 2020-09-27 7:25 ` Christophe Leroy
0 siblings, 0 replies; 19+ messages in thread
From: Christophe Leroy @ 2020-09-27 7:25 UTC (permalink / raw)
To: Oliver O'Halloran, linuxppc-dev
Le 24/09/2020 à 08:38, Oliver O'Halloran a écrit :
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Tested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
This series is a really good step forward to the elimination of
early support for ioremap(), thanks.
Tested with pmac32_defconfig on QEMU MAC99.
Before the series we have 9000 kbytes mapped as early ioremap
ioremap() called early from pmac_feature_init+0xc8/0xac8. Use early_ioremap() instead
ioremap() called early from probe_one_macio+0x170/0x2a8. Use early_ioremap() instead
ioremap() called early from udbg_scc_init+0x1d8/0x494. Use early_ioremap() instead
ioremap() called early from find_via_cuda+0xa8/0x3f8. Use early_ioremap() instead
ioremap() called early from pmac_pci_init+0x214/0x778. Use early_ioremap() instead
ioremap() called early from pmac_pci_init+0x228/0x778. Use early_ioremap() instead
ioremap() called early from pci_process_bridge_OF_ranges+0x158/0x2d0. Use early_ioremap() instead
ioremap() called early from pmac_setup_arch+0x110/0x298. Use early_ioremap() instead
ioremap() called early from pmac_nvram_init+0x144/0x534. Use early_ioremap() instead
* 0xfeb36000..0xff400000 : early ioremap
* 0xf1000000..0xfeb36000 : vmalloc & ioremap
After the series we have 800 kbytes mapped as early ioremap
ioremap() called early from pmac_feature_init+0xc8/0xac8. Use early_ioremap() instead
ioremap() called early from probe_one_macio+0x170/0x2a8. Use early_ioremap() instead
ioremap() called early from udbg_scc_init+0x1d8/0x494. Use early_ioremap() instead
ioremap() called early from find_via_cuda+0xa8/0x3f8. Use early_ioremap() instead
ioremap() called early from pmac_setup_arch+0x10c/0x294. Use early_ioremap() instead
ioremap() called early from pmac_nvram_init+0x144/0x534. Use early_ioremap() instead
* 0xff338000..0xff400000 : early ioremap
* 0xf1000000..0xff338000 : vmalloc & ioremap
Christophe
> ---
> 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 f002b0fa69b8..0f8669139a21 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 */
>
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2020-09-27 7:27 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-24 6:38 [RFC PATCH 01/18] powerpc/pci: Add ppc_md.discover_phbs() Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 02/18] powerpc/{powernv,pseries}: Move PHB discovery Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 03/18] powerpc/maple: " Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 04/18] powerpc/512x: " Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 05/18] powerpc/52xx/efika: " Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 06/18] powerpc/52xx/lite5200: " Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 07/18] powerpc/52xx/media5200: " Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 08/18] powerpc/52xx/mpc5200_simple: " Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 09/18] powerpc/82xx/*: " Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 10/18] powerpc/83xx: " Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 11/18] powerpc/amigaone: " Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 12/18] powerpc/chrp: " Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 13/18] powerpc/embedded6xx/holly: " Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 14/18] powerpc/embedded6xx/linkstation: " Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 15/18] powerpc/embedded6xx/mpc7448: " Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 16/18] powerpc/embedded6xx/mve5100: " Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 17/18] powerpc/pasemi: " Oliver O'Halloran
2020-09-24 6:38 ` [RFC PATCH 18/18] powerpc/powermac: " Oliver O'Halloran
2020-09-27 7:25 ` Christophe Leroy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).