* [PATCH 12/14] 85xx/mpc85xx_ds, ads, cds: move .pci_exclude_device setting to machine definitions
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
In-Reply-To: <1311065631-3429-1-git-send-email-dbaryshkov@gmail.com>
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/85xx/mpc85xx_ads.c | 5 +++--
arch/powerpc/platforms/85xx/mpc85xx_cds.c | 5 ++---
arch/powerpc/platforms/85xx/mpc85xx_ds.c | 5 +++--
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index 3b2c9bb..2483929 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -200,8 +200,6 @@ static void __init mpc85xx_ads_setup_arch(void)
#ifdef CONFIG_PCI
for_each_compatible_node(np, "pci", "fsl,mpc8540-pci")
fsl_add_bridge(np, 1);
-
- ppc_md.pci_exclude_device = mpc85xx_exclude_device;
#endif
}
@@ -254,6 +252,9 @@ define_machine(mpc85xx_ads) {
.probe = mpc85xx_ads_probe,
.setup_arch = mpc85xx_ads_setup_arch,
.init_IRQ = mpc85xx_ads_pic_init,
+#ifdef CONFIG_PCI
+ .pci_exclude_device = mpc85xx_exclude_device,
+#endif
.show_cpuinfo = mpc85xx_ads_show_cpuinfo,
.get_irq = mpic_get_irq,
.restart = fsl_rstcr_restart,
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 6299a2a..e209c23 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -297,9 +297,6 @@ static void __init mpc85xx_cds_setup_arch(void)
fsl_add_bridge(np, 0);
}
}
-
- ppc_md.pci_irq_fixup = mpc85xx_cds_pci_irq_fixup;
- ppc_md.pci_exclude_device = mpc85xx_exclude_device;
#endif
}
@@ -355,6 +352,8 @@ define_machine(mpc85xx_cds) {
#ifdef CONFIG_PCI
.restart = mpc85xx_cds_restart,
.pcibios_fixup_bus = fsl_pcibios_fixup_bus,
+ .pci_irq_fixup = mpc85xx_cds_pci_irq_fixup,
+ .pci_exclude_device = mpc85xx_exclude_device,
#else
.restart = fsl_rstcr_restart,
#endif
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index c7b97f7..53bf07d 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -182,8 +182,6 @@ static void __init mpc85xx_ds_setup_arch(void)
hose->dma_window_size);
}
}
-
- ppc_md.pci_exclude_device = mpc85xx_exclude_device;
#endif
#ifdef CONFIG_SMP
@@ -279,6 +277,7 @@ define_machine(mpc8544_ds) {
.init_IRQ = mpc85xx_ds_pic_init,
#ifdef CONFIG_PCI
.pcibios_fixup_bus = fsl_pcibios_fixup_bus,
+ .pci_exclude_device = mpc85xx_exclude_device,
#endif
.get_irq = mpic_get_irq,
.restart = fsl_rstcr_restart,
@@ -293,6 +292,7 @@ define_machine(mpc8572_ds) {
.init_IRQ = mpc85xx_ds_pic_init,
#ifdef CONFIG_PCI
.pcibios_fixup_bus = fsl_pcibios_fixup_bus,
+ .pci_exclude_device = mpc85xx_exclude_device,
#endif
.get_irq = mpic_get_irq,
.restart = fsl_rstcr_restart,
@@ -307,6 +307,7 @@ define_machine(p2020_ds) {
.init_IRQ = mpc85xx_ds_pic_init,
#ifdef CONFIG_PCI
.pcibios_fixup_bus = fsl_pcibios_fixup_bus,
+ .pci_exclude_device = mpc85xx_exclude_device,
#endif
.get_irq = mpic_get_irq,
.restart = fsl_rstcr_restart,
--
1.7.2.5
^ permalink raw reply related
* [PATCH 11/14] 85xx: merge 32-bit QorIQ with DPA boards support
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
In-Reply-To: <1311065631-3429-1-git-send-email-dbaryshkov@gmail.com>
Board support files for p4080ds, p3041ds and p2040rdb don't differ at
all (all differencies are hidden in dts files). So merge them into
single board file containing all necessary stuff.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/85xx/Kconfig | 32 +------
arch/powerpc/platforms/85xx/Makefile | 4 +-
arch/powerpc/platforms/85xx/p2040_rdb.c | 88 -------------------
arch/powerpc/platforms/85xx/p3041_ds.c | 90 --------------------
.../platforms/85xx/{p4080_ds.c => qoriq_dpa_ds.c} | 24 +++--
5 files changed, 20 insertions(+), 218 deletions(-)
delete mode 100644 arch/powerpc/platforms/85xx/p2040_rdb.c
delete mode 100644 arch/powerpc/platforms/85xx/p3041_ds.c
rename arch/powerpc/platforms/85xx/{p4080_ds.c => qoriq_dpa_ds.c} (72%)
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index 498534c..7b9c042 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -171,8 +171,8 @@ config SBC8560
help
This option enables support for the Wind River SBC8560 board
-config P2040_RDB
- bool "Freescale P2040 RDB"
+config QORIQ_DPA_DS
+ bool "Freescale QorIQ with DPA development systems"
select DEFAULT_UIMAGE
select PPC_E500MC
select PHYS_64BIT
@@ -181,31 +181,9 @@ config P2040_RDB
select HAS_RAPIDIO
select PPC_EPAPR_HV_PIC
help
- This option enables support for the P2040 RDB board
-
-config P3041_DS
- bool "Freescale P3041 DS"
- select DEFAULT_UIMAGE
- select PPC_E500MC
- select PHYS_64BIT
- select SWIOTLB
- select MPC8xxx_GPIO
- select HAS_RAPIDIO
- select PPC_EPAPR_HV_PIC
- help
- This option enables support for the P3041 DS board
-
-config P4080_DS
- bool "Freescale P4080 DS"
- select DEFAULT_UIMAGE
- select PPC_E500MC
- select PHYS_64BIT
- select SWIOTLB
- select MPC8xxx_GPIO
- select HAS_RAPIDIO
- select PPC_EPAPR_HV_PIC
- help
- This option enables support for the P4080 DS board
+ This option enables support for the Freescale boards
+ based on the QorIQ CPU with DPA: P2040 RDB, P3041 DS and
+ P4080 DS boards
endif # PPC32
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
index a971b32..43b2162 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -13,9 +13,7 @@ obj-$(CONFIG_MPC85xx_RDB) += mpc85xx_rdb.o
obj-$(CONFIG_P1010_RDB) += p1010rdb.o
obj-$(CONFIG_P1022_DS) += p1022_ds.o
obj-$(CONFIG_P1023_RDS) += p1023_rds.o
-obj-$(CONFIG_P2040_RDB) += p2040_rdb.o corenet_ds.o
-obj-$(CONFIG_P3041_DS) += p3041_ds.o corenet_ds.o
-obj-$(CONFIG_P4080_DS) += p4080_ds.o corenet_ds.o
+obj-$(CONFIG_QORIQ_DPA_DS) += qoriq_dpa_ds.o corenet_ds.o
obj-$(CONFIG_P5020_DS) += p5020_ds.o corenet_ds.o
obj-$(CONFIG_STX_GP3) += stx_gp3.o
obj-$(CONFIG_TQM85xx) += tqm85xx.o
diff --git a/arch/powerpc/platforms/85xx/p2040_rdb.c b/arch/powerpc/platforms/85xx/p2040_rdb.c
deleted file mode 100644
index 32b56ac..0000000
--- a/arch/powerpc/platforms/85xx/p2040_rdb.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * P2040 RDB Setup
- *
- * Copyright 2011 Freescale Semiconductor Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- */
-
-#include <linux/kernel.h>
-#include <linux/pci.h>
-#include <linux/kdev_t.h>
-#include <linux/delay.h>
-#include <linux/interrupt.h>
-#include <linux/phy.h>
-
-#include <asm/system.h>
-#include <asm/time.h>
-#include <asm/machdep.h>
-#include <asm/pci-bridge.h>
-#include <mm/mmu_decl.h>
-#include <asm/prom.h>
-#include <asm/udbg.h>
-#include <asm/mpic.h>
-
-#include <linux/of_platform.h>
-#include <sysdev/fsl_soc.h>
-#include <sysdev/fsl_pci.h>
-#include <asm/ehv_pic.h>
-
-#include "corenet_ds.h"
-
-/*
- * Called very early, device-tree isn't unflattened
- */
-static int __init p2040_rdb_probe(void)
-{
- unsigned long root = of_get_flat_dt_root();
-#ifdef CONFIG_SMP
- extern struct smp_ops_t smp_85xx_ops;
-#endif
-
- if (of_flat_dt_is_compatible(root, "fsl,P2040RDB"))
- return 1;
-
- /* Check if we're running under the Freescale hypervisor */
- if (of_flat_dt_is_compatible(root, "fsl,P2040RDB-hv")) {
- ppc_md.init_IRQ = ehv_pic_init;
- ppc_md.get_irq = ehv_pic_get_irq;
- ppc_md.restart = fsl_hv_restart;
- ppc_md.power_off = fsl_hv_halt;
- ppc_md.halt = fsl_hv_halt;
-#ifdef CONFIG_SMP
- /*
- * Disable the timebase sync operations because we can't write
- * to the timebase registers under the hypervisor.
- */
- smp_85xx_ops.give_timebase = NULL;
- smp_85xx_ops.take_timebase = NULL;
-#endif
- return 1;
- }
-
- return 0;
-}
-
-define_machine(p2040_rdb) {
- .name = "P2040 RDB",
- .probe = p2040_rdb_probe,
- .setup_arch = corenet_ds_setup_arch,
- .init_IRQ = corenet_ds_pic_init,
-#ifdef CONFIG_PCI
- .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
-#endif
- .get_irq = mpic_get_coreint_irq,
- .restart = fsl_rstcr_restart,
- .calibrate_decr = generic_calibrate_decr,
- .progress = udbg_progress,
- .power_save = e500_idle,
-};
-
-machine_device_initcall(p2040_rdb, corenet_ds_publish_devices);
-
-#ifdef CONFIG_SWIOTLB
-machine_arch_initcall(p2040_rdb, swiotlb_setup_bus_notifier);
-#endif
diff --git a/arch/powerpc/platforms/85xx/p3041_ds.c b/arch/powerpc/platforms/85xx/p3041_ds.c
deleted file mode 100644
index 96d99a3..0000000
--- a/arch/powerpc/platforms/85xx/p3041_ds.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * P3041 DS Setup
- *
- * Maintained by Kumar Gala (see MAINTAINERS for contact information)
- *
- * Copyright 2009-2010 Freescale Semiconductor Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- */
-
-#include <linux/kernel.h>
-#include <linux/pci.h>
-#include <linux/kdev_t.h>
-#include <linux/delay.h>
-#include <linux/interrupt.h>
-#include <linux/phy.h>
-
-#include <asm/system.h>
-#include <asm/time.h>
-#include <asm/machdep.h>
-#include <asm/pci-bridge.h>
-#include <mm/mmu_decl.h>
-#include <asm/prom.h>
-#include <asm/udbg.h>
-#include <asm/mpic.h>
-
-#include <linux/of_platform.h>
-#include <sysdev/fsl_soc.h>
-#include <sysdev/fsl_pci.h>
-#include <asm/ehv_pic.h>
-
-#include "corenet_ds.h"
-
-/*
- * Called very early, device-tree isn't unflattened
- */
-static int __init p3041_ds_probe(void)
-{
- unsigned long root = of_get_flat_dt_root();
-#ifdef CONFIG_SMP
- extern struct smp_ops_t smp_85xx_ops;
-#endif
-
- if (of_flat_dt_is_compatible(root, "fsl,P3041DS"))
- return 1;
-
- /* Check if we're running under the Freescale hypervisor */
- if (of_flat_dt_is_compatible(root, "fsl,P3041DS-hv")) {
- ppc_md.init_IRQ = ehv_pic_init;
- ppc_md.get_irq = ehv_pic_get_irq;
- ppc_md.restart = fsl_hv_restart;
- ppc_md.power_off = fsl_hv_halt;
- ppc_md.halt = fsl_hv_halt;
-#ifdef CONFIG_SMP
- /*
- * Disable the timebase sync operations because we can't write
- * to the timebase registers under the hypervisor.
- */
- smp_85xx_ops.give_timebase = NULL;
- smp_85xx_ops.take_timebase = NULL;
-#endif
- return 1;
- }
-
- return 0;
-}
-
-define_machine(p3041_ds) {
- .name = "P3041 DS",
- .probe = p3041_ds_probe,
- .setup_arch = corenet_ds_setup_arch,
- .init_IRQ = corenet_ds_pic_init,
-#ifdef CONFIG_PCI
- .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
-#endif
- .get_irq = mpic_get_coreint_irq,
- .restart = fsl_rstcr_restart,
- .calibrate_decr = generic_calibrate_decr,
- .progress = udbg_progress,
- .power_save = e500_idle,
-};
-
-machine_device_initcall(p3041_ds, corenet_ds_publish_devices);
-
-#ifdef CONFIG_SWIOTLB
-machine_arch_initcall(p3041_ds, swiotlb_setup_bus_notifier);
-#endif
diff --git a/arch/powerpc/platforms/85xx/p4080_ds.c b/arch/powerpc/platforms/85xx/qoriq_dpa_ds.c
similarity index 72%
rename from arch/powerpc/platforms/85xx/p4080_ds.c
rename to arch/powerpc/platforms/85xx/qoriq_dpa_ds.c
index d1b21d7..2f5eaea 100644
--- a/arch/powerpc/platforms/85xx/p4080_ds.c
+++ b/arch/powerpc/platforms/85xx/qoriq_dpa_ds.c
@@ -1,9 +1,9 @@
/*
- * P4080 DS Setup
+ * Setup for Freescale boards based on QorIQ with DPA
*
* Maintained by Kumar Gala (see MAINTAINERS for contact information)
*
- * Copyright 2009 Freescale Semiconductor Inc.
+ * Copyright 2009-2011 Freescale Semiconductor Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -36,18 +36,22 @@
/*
* Called very early, device-tree isn't unflattened
*/
-static int __init p4080_ds_probe(void)
+static int __init qoriq_dpa_probe(void)
{
unsigned long root = of_get_flat_dt_root();
#ifdef CONFIG_SMP
extern struct smp_ops_t smp_85xx_ops;
#endif
- if (of_flat_dt_is_compatible(root, "fsl,P4080DS"))
+ if (of_flat_dt_is_compatible(root, "fsl,P2040RDB") ||
+ of_flat_dt_is_compatible(root, "fsl,P3041DS") ||
+ of_flat_dt_is_compatible(root, "fsl,P4080DS")) {
return 1;
/* Check if we're running under the Freescale hypervisor */
- if (of_flat_dt_is_compatible(root, "fsl,P4080DS-hv")) {
+ if (of_flat_dt_is_compatible(root, "fsl,P2040RDB-hv") ||
+ of_flat_dt_is_compatible(root, "fsl,P3041DS-hv") ||
+ of_flat_dt_is_compatible(root, "fsl,P4080DS-hv")) {
ppc_md.init_IRQ = ehv_pic_init;
ppc_md.get_irq = ehv_pic_get_irq;
ppc_md.restart = fsl_hv_restart;
@@ -67,9 +71,9 @@ static int __init p4080_ds_probe(void)
return 0;
}
-define_machine(p4080_ds) {
- .name = "P4080 DS",
- .probe = p4080_ds_probe,
+define_machine(qoriq_dpa) {
+ .name = "QorIQ with DPA DS",
+ .probe = qoriq_dpa_probe,
.setup_arch = corenet_ds_setup_arch,
.init_IRQ = corenet_ds_pic_init,
#ifdef CONFIG_PCI
@@ -82,7 +86,7 @@ define_machine(p4080_ds) {
.power_save = e500_idle,
};
-machine_device_initcall(p4080_ds, corenet_ds_publish_devices);
+machine_device_initcall(qoriq_dpa, corenet_ds_publish_devices);
#ifdef CONFIG_SWIOTLB
-machine_arch_initcall(p4080_ds, swiotlb_setup_bus_notifier);
+machine_arch_initcall(qoriq_dpa, swiotlb_setup_bus_notifier);
#endif
--
1.7.2.5
^ permalink raw reply related
* [PATCH 09/14] 85xx/sbc8548: read hardware revision when it's required for first time
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
In-Reply-To: <1311065631-3429-1-git-send-email-dbaryshkov@gmail.com>
Currently sbc8548 reads hardware revision during bootup. To simplify
things read it when it's first required when the kernel is up and
running.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/85xx/sbc8548.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/sbc8548.c b/arch/powerpc/platforms/85xx/sbc8548.c
index ecdd8c0..2eeb376 100644
--- a/arch/powerpc/platforms/85xx/sbc8548.c
+++ b/arch/powerpc/platforms/85xx/sbc8548.c
@@ -49,7 +49,7 @@
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
-static int sbc_rev;
+static int sbc_rev = -EINVAL;
static void __init sbc8548_pic_init(void)
{
@@ -82,7 +82,7 @@ static void __init sbc8548_pic_init(void)
}
/* Extract the HW Rev from the EPLD on the board */
-static int __init sbc8548_hw_rev(void)
+static int sbc8548_hw_rev(void)
{
struct device_node *np;
struct resource res;
@@ -130,7 +130,6 @@ static void __init sbc8548_setup_arch(void)
}
}
#endif
- sbc_rev = sbc8548_hw_rev();
}
static void sbc8548_show_cpuinfo(struct seq_file *m)
@@ -140,6 +139,9 @@ static void sbc8548_show_cpuinfo(struct seq_file *m)
pvid = mfspr(SPRN_PVR);
svid = mfspr(SPRN_SVR);
+ if (sbc_rev == -EINVAL)
+ sbc_rev = sbc8548_hw_rev();
+
seq_printf(m, "Vendor\t\t: Wind River\n");
seq_printf(m, "Machine\t\t: SBC8548 v%d\n", sbc_rev);
seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
--
1.7.2.5
^ permalink raw reply related
* [PATCH 10/14] 85xx/mpc85xx_rdb: merge p1020_rdb and p2020_rdb machine entries
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
In-Reply-To: <1311065631-3429-1-git-send-email-dbaryshkov@gmail.com>
p1020_rdb and p2020_rdb machine entries bear no in-kernel differencies
other than dt compatible strings. Merge them into single machine entry
named mpc85xx_rdb
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 40 ++++++----------------------
1 files changed, 9 insertions(+), 31 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
index 088f30b..7a3a37b 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
@@ -120,47 +120,25 @@ static int __init mpc85xxrdb_publish_devices(void)
{
return of_platform_bus_probe(NULL, mpc85xxrdb_ids, NULL);
}
-machine_device_initcall(p2020_rdb, mpc85xxrdb_publish_devices);
-machine_device_initcall(p1020_rdb, mpc85xxrdb_publish_devices);
+machine_device_initcall(mpc85xx_rdb, mpc85xxrdb_publish_devices);
/*
* Called very early, device-tree isn't unflattened
*/
-static int __init p2020_rdb_probe(void)
+static int __init mpc85xx_rdb_probe(void)
{
unsigned long root = of_get_flat_dt_root();
- if (of_flat_dt_is_compatible(root, "fsl,P2020RDB"))
+ if (of_flat_dt_is_compatible(root, "fsl,P1020RDB") ||
+ of_flat_dt_is_compatible(root, "fsl,P2020RDB")) {
return 1;
- return 0;
+ } else
+ return 0;
}
-static int __init p1020_rdb_probe(void)
-{
- unsigned long root = of_get_flat_dt_root();
-
- if (of_flat_dt_is_compatible(root, "fsl,P1020RDB"))
- return 1;
- return 0;
-}
-
-define_machine(p2020_rdb) {
- .name = "P2020 RDB",
- .probe = p2020_rdb_probe,
- .setup_arch = mpc85xx_rdb_setup_arch,
- .init_IRQ = mpc85xx_rdb_pic_init,
-#ifdef CONFIG_PCI
- .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
-#endif
- .get_irq = mpic_get_irq,
- .restart = fsl_rstcr_restart,
- .calibrate_decr = generic_calibrate_decr,
- .progress = udbg_progress,
-};
-
-define_machine(p1020_rdb) {
- .name = "P1020 RDB",
- .probe = p1020_rdb_probe,
+define_machine(mpc85xx_rdb) {
+ .name = "MPC85xx RDB",
+ .probe = mpc85xx_rdb_probe,
.setup_arch = mpc85xx_rdb_setup_arch,
.init_IRQ = mpc85xx_rdb_pic_init,
#ifdef CONFIG_PCI
--
1.7.2.5
^ permalink raw reply related
* [PATCH 07/14] 85xx/ksi8560: declare that localbus is compatbile with simple-bus
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
In-Reply-To: <1311065631-3429-1-git-send-email-dbaryshkov@gmail.com>
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/boot/dts/ksi8560.dts | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/boot/dts/ksi8560.dts b/arch/powerpc/boot/dts/ksi8560.dts
index bdb7fc0..296c572 100644
--- a/arch/powerpc/boot/dts/ksi8560.dts
+++ b/arch/powerpc/boot/dts/ksi8560.dts
@@ -306,7 +306,7 @@
localbus@fdf05000 {
#address-cells = <2>;
#size-cells = <1>;
- compatible = "fsl,mpc8560-localbus";
+ compatible = "fsl,mpc8560-localbus", "simple-bus";
reg = <0xfdf05000 0x68>;
ranges = <0x0 0x0 0xe0000000 0x00800000
--
1.7.2.5
^ permalink raw reply related
* [PATCH 08/14] 85xx/sbc8560: declare that localbus is compatbile with simple-bus
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
In-Reply-To: <1311065631-3429-1-git-send-email-dbaryshkov@gmail.com>
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/boot/dts/sbc8560.dts | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/boot/dts/sbc8560.dts b/arch/powerpc/boot/dts/sbc8560.dts
index 9e13ed8..72078eb 100644
--- a/arch/powerpc/boot/dts/sbc8560.dts
+++ b/arch/powerpc/boot/dts/sbc8560.dts
@@ -331,7 +331,7 @@
};
localbus@ff705000 {
- compatible = "fsl,mpc8560-localbus";
+ compatible = "fsl,mpc8560-localbus", "simple-bus";
#address-cells = <2>;
#size-cells = <1>;
reg = <0xff705000 0x100>; // BRx, ORx, etc.
--
1.7.2.5
^ permalink raw reply related
* [PATCH 04/14] 83xx/mpc834x_itx: drop pq2pro-localbus-specific code
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
In-Reply-To: <1311065631-3429-1-git-send-email-dbaryshkov@gmail.com>
As localbus on mpc8349e-mitx now provides simple-bus compatibility, we
can drop code asking for pq2pro-localbus devices on mpc834x_itx boards.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/83xx/mpc834x_itx.c | 12 +-----------
1 files changed, 1 insertions(+), 11 deletions(-)
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index c853f66..d9ea7b7 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -39,17 +39,7 @@
#include "mpc83xx.h"
-static struct of_device_id __initdata mpc834x_itx_ids[] = {
- { .compatible = "fsl,pq2pro-localbus", },
- {},
-};
-
-static int __init mpc834x_itx_declare_of_platform_devices(void)
-{
- mpc83xx_declare_of_platform_devices();
- return of_platform_bus_probe(NULL, mpc834x_itx_ids, NULL);
-}
-machine_device_initcall(mpc834x_itx, mpc834x_itx_declare_of_platform_devices);
+machine_device_initcall(mpc834x_itx, mpc83xx_declare_of_platform_devices);
/* ************************************************************************
*
--
1.7.2.5
^ permalink raw reply related
* [PATCH 06/14] 85xx/sbc8560: correct compilation if CONFIG_PHYS_ADDR_T_64BIT is set
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
In-Reply-To: <1311065631-3429-1-git-send-email-dbaryshkov@gmail.com>
If CONFIG_PHYS_ADDR_T_64BIT is set, compilation of sbc8560 fails with
the following error:
arch/powerpc/platforms/85xx/sbc8560.c: In function ‘sbc8560_bdrstcr_init’:
arch/powerpc/platforms/85xx/sbc8560.c:286: error: format ‘%x’ expects type ‘unsigned int’, but argument 2 has type ‘resource_size_t’
Fix that by using %pR format instead of just printing the start of
resource.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/85xx/sbc8560.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/sbc8560.c b/arch/powerpc/platforms/85xx/sbc8560.c
index d2dfd46..678f5a8 100644
--- a/arch/powerpc/platforms/85xx/sbc8560.c
+++ b/arch/powerpc/platforms/85xx/sbc8560.c
@@ -283,7 +283,7 @@ static int __init sbc8560_bdrstcr_init(void)
of_address_to_resource(np, 0, &res);
- printk(KERN_INFO "sbc8560: Found BRSTCR at i/o 0x%x\n", res.start);
+ printk(KERN_INFO "sbc8560: Found BRSTCR at %pR\n", &res);
brstcr = ioremap(res.start, res.end - res.start);
if(!brstcr)
--
1.7.2.5
^ permalink raw reply related
* [PATCH 05/14] 83xx: headers cleanup
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
In-Reply-To: <1311065631-3429-1-git-send-email-dbaryshkov@gmail.com>
Drop lots of unused headers after board files merge/splitup
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/83xx/asp834x.c | 2 -
arch/powerpc/platforms/83xx/km83xx.c | 24 +------------------
arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c | 5 ----
arch/powerpc/platforms/83xx/misc.c | 1 -
arch/powerpc/platforms/83xx/mpc830x_rdb.c | 5 +--
arch/powerpc/platforms/83xx/mpc831x_rdb.c | 2 -
arch/powerpc/platforms/83xx/mpc832x_mds.c | 30 ------------------------
arch/powerpc/platforms/83xx/mpc832x_rdb.c | 11 --------
arch/powerpc/platforms/83xx/mpc834x_itx.c | 20 ----------------
arch/powerpc/platforms/83xx/mpc834x_mds.c | 20 ----------------
arch/powerpc/platforms/83xx/mpc836x_mds.c | 29 -----------------------
arch/powerpc/platforms/83xx/mpc836x_rdk.c | 8 +-----
arch/powerpc/platforms/83xx/mpc837x_mds.c | 4 ---
arch/powerpc/platforms/83xx/mpc837x_rdb.c | 2 -
arch/powerpc/platforms/83xx/sbc834x.c | 20 ----------------
arch/powerpc/platforms/83xx/suspend.c | 8 ------
arch/powerpc/platforms/83xx/usb.c | 8 ------
17 files changed, 4 insertions(+), 195 deletions(-)
diff --git a/arch/powerpc/platforms/83xx/asp834x.c b/arch/powerpc/platforms/83xx/asp834x.c
index 464ea8e..a7c0188 100644
--- a/arch/powerpc/platforms/83xx/asp834x.c
+++ b/arch/powerpc/platforms/83xx/asp834x.c
@@ -14,10 +14,8 @@
* option) any later version.
*/
-#include <linux/pci.h>
#include <linux/of_platform.h>
-#include <asm/time.h>
#include <asm/ipic.h>
#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c
index b9aaa50..e6c70e3 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -11,35 +11,13 @@
* option) any later version.
*/
-#include <linux/stddef.h>
#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-#include <linux/reboot.h>
#include <linux/pci.h>
-#include <linux/kdev_t.h>
-#include <linux/major.h>
-#include <linux/console.h>
-#include <linux/delay.h>
-#include <linux/seq_file.h>
-#include <linux/root_dev.h>
-#include <linux/initrd.h>
-#include <linux/of_platform.h>
-#include <linux/of_device.h>
-
-#include <asm/system.h>
-#include <asm/atomic.h>
-#include <asm/time.h>
-#include <asm/io.h>
-#include <asm/machdep.h>
+
#include <asm/ipic.h>
-#include <asm/irq.h>
-#include <asm/prom.h>
#include <asm/udbg.h>
-#include <sysdev/fsl_soc.h>
-#include <sysdev/fsl_pci.h>
#include <asm/qe.h>
-#include <asm/qe_ic.h>
+#include <sysdev/fsl_pci.h>
#include "mpc83xx.h"
diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
index 70798ac..f47aac2 100644
--- a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
+++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
@@ -11,17 +11,12 @@
* (at your option) any later version.
*/
-#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/device.h>
-#include <linux/mutex.h>
#include <linux/i2c.h>
-#include <linux/gpio.h>
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/slab.h>
-#include <asm/prom.h>
#include <asm/machdep.h>
/*
diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c
index cd65f5a..ae61e10 100644
--- a/arch/powerpc/platforms/83xx/misc.c
+++ b/arch/powerpc/platforms/83xx/misc.c
@@ -9,7 +9,6 @@
* option) any later version.
*/
-#include <linux/stddef.h>
#include <linux/kernel.h>
#include <linux/of_platform.h>
diff --git a/arch/powerpc/platforms/83xx/mpc830x_rdb.c b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
index ef595f1..6e4783d 100644
--- a/arch/powerpc/platforms/83xx/mpc830x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
@@ -14,12 +14,11 @@
*/
#include <linux/pci.h>
-#include <linux/of_platform.h>
-#include <asm/time.h>
+
#include <asm/ipic.h>
#include <asm/udbg.h>
#include <sysdev/fsl_pci.h>
-#include <sysdev/fsl_soc.h>
+
#include "mpc83xx.h"
/*
diff --git a/arch/powerpc/platforms/83xx/mpc831x_rdb.c b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
index ce87406..ac38b14 100644
--- a/arch/powerpc/platforms/83xx/mpc831x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
@@ -14,9 +14,7 @@
*/
#include <linux/pci.h>
-#include <linux/of_platform.h>
-#include <asm/time.h>
#include <asm/ipic.h>
#include <asm/udbg.h>
#include <sysdev/fsl_pci.h>
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index 8ee1440..bea4d0c 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -10,45 +10,15 @@
* option) any later version.
*/
-#include <linux/stddef.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-#include <linux/reboot.h>
#include <linux/pci.h>
-#include <linux/kdev_t.h>
-#include <linux/major.h>
-#include <linux/console.h>
-#include <linux/delay.h>
-#include <linux/seq_file.h>
-#include <linux/root_dev.h>
-#include <linux/initrd.h>
-#include <linux/of_platform.h>
-#include <linux/of_device.h>
-
-#include <asm/system.h>
-#include <asm/atomic.h>
-#include <asm/time.h>
-#include <asm/io.h>
-#include <asm/machdep.h>
+
#include <asm/ipic.h>
-#include <asm/irq.h>
-#include <asm/prom.h>
#include <asm/udbg.h>
-#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
#include <asm/qe.h>
-#include <asm/qe_ic.h>
#include "mpc83xx.h"
-#undef DEBUG
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
/* ************************************************************************
*
* Setup the architecture
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index c10d0c4..8672d41 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -15,30 +15,19 @@
*/
#include <linux/pci.h>
-#include <linux/interrupt.h>
#include <linux/spi/spi.h>
#include <linux/spi/mmc_spi.h>
#include <linux/mmc/host.h>
-#include <linux/of_platform.h>
#include <linux/fsl_devices.h>
-#include <asm/time.h>
#include <asm/ipic.h>
#include <asm/udbg.h>
#include <asm/qe.h>
-#include <asm/qe_ic.h>
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
#include "mpc83xx.h"
-#undef DEBUG
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
#ifdef CONFIG_QUICC_ENGINE
static int __init of_fsl_spi_probe(char *type, char *compatible, u32 sysclk,
struct spi_board_info *board_infos,
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index d9ea7b7..53e403b 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -11,30 +11,10 @@
* option) any later version.
*/
-#include <linux/stddef.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-#include <linux/reboot.h>
#include <linux/pci.h>
-#include <linux/kdev_t.h>
-#include <linux/major.h>
-#include <linux/console.h>
-#include <linux/delay.h>
-#include <linux/seq_file.h>
-#include <linux/root_dev.h>
-#include <linux/of_platform.h>
-#include <asm/system.h>
-#include <asm/atomic.h>
-#include <asm/time.h>
-#include <asm/io.h>
-#include <asm/machdep.h>
#include <asm/ipic.h>
-#include <asm/irq.h>
-#include <asm/prom.h>
#include <asm/udbg.h>
-#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
#include "mpc83xx.h"
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index 381e94e..6aedff9 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -11,30 +11,10 @@
* option) any later version.
*/
-#include <linux/stddef.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-#include <linux/reboot.h>
#include <linux/pci.h>
-#include <linux/kdev_t.h>
-#include <linux/major.h>
-#include <linux/console.h>
-#include <linux/delay.h>
-#include <linux/seq_file.h>
-#include <linux/root_dev.h>
-#include <linux/of_platform.h>
-#include <asm/system.h>
-#include <asm/atomic.h>
-#include <asm/time.h>
-#include <asm/io.h>
-#include <asm/machdep.h>
#include <asm/ipic.h>
-#include <asm/irq.h>
-#include <asm/prom.h>
#include <asm/udbg.h>
-#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
#include "mpc83xx.h"
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 1b90701..c9624b5 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -16,31 +16,9 @@
* option) any later version.
*/
-#include <linux/stddef.h>
-#include <linux/kernel.h>
-#include <linux/compiler.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-#include <linux/reboot.h>
#include <linux/pci.h>
-#include <linux/kdev_t.h>
-#include <linux/major.h>
-#include <linux/console.h>
-#include <linux/delay.h>
-#include <linux/seq_file.h>
-#include <linux/root_dev.h>
-#include <linux/initrd.h>
-#include <linux/of_platform.h>
-#include <linux/of_device.h>
-
-#include <asm/system.h>
-#include <asm/atomic.h>
-#include <asm/time.h>
-#include <asm/io.h>
-#include <asm/machdep.h>
+
#include <asm/ipic.h>
-#include <asm/irq.h>
-#include <asm/prom.h>
#include <asm/udbg.h>
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
@@ -50,13 +28,6 @@
#include "mpc83xx.h"
-#undef DEBUG
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
/* ************************************************************************
*
* Setup the architecture
diff --git a/arch/powerpc/platforms/83xx/mpc836x_rdk.c b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
index 2563174..cafb0c6 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_rdk.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
@@ -12,17 +12,11 @@
* option) any later version.
*/
-#include <linux/kernel.h>
#include <linux/pci.h>
-#include <linux/of_platform.h>
-#include <linux/io.h>
-#include <asm/prom.h>
-#include <asm/time.h>
+
#include <asm/ipic.h>
#include <asm/udbg.h>
#include <asm/qe.h>
-#include <asm/qe_ic.h>
-#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
#include "mpc83xx.h"
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index 7463183..fe76bd7 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -12,13 +12,9 @@
*/
#include <linux/pci.h>
-#include <linux/of.h>
-#include <linux/of_platform.h>
-#include <asm/time.h>
#include <asm/ipic.h>
#include <asm/udbg.h>
-#include <asm/prom.h>
#include <sysdev/fsl_pci.h>
#include "mpc83xx.h"
diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
index a4a5336..a6e649e 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
@@ -12,9 +12,7 @@
*/
#include <linux/pci.h>
-#include <linux/of_platform.h>
-#include <asm/time.h>
#include <asm/ipic.h>
#include <asm/udbg.h>
#include <sysdev/fsl_soc.h>
diff --git a/arch/powerpc/platforms/83xx/sbc834x.c b/arch/powerpc/platforms/83xx/sbc834x.c
index 3d98bd9..ea02022 100644
--- a/arch/powerpc/platforms/83xx/sbc834x.c
+++ b/arch/powerpc/platforms/83xx/sbc834x.c
@@ -13,30 +13,10 @@
* option) any later version.
*/
-#include <linux/stddef.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-#include <linux/reboot.h>
#include <linux/pci.h>
-#include <linux/kdev_t.h>
-#include <linux/major.h>
-#include <linux/console.h>
-#include <linux/delay.h>
-#include <linux/seq_file.h>
-#include <linux/root_dev.h>
-#include <linux/of_platform.h>
-#include <asm/system.h>
-#include <asm/atomic.h>
-#include <asm/time.h>
-#include <asm/io.h>
-#include <asm/machdep.h>
#include <asm/ipic.h>
-#include <asm/irq.h>
-#include <asm/prom.h>
#include <asm/udbg.h>
-#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
#include "mpc83xx.h"
diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c
index 104faa8..d0c814a 100644
--- a/arch/powerpc/platforms/83xx/suspend.c
+++ b/arch/powerpc/platforms/83xx/suspend.c
@@ -10,21 +10,13 @@
* by the Free Software Foundation.
*/
-#include <linux/init.h>
-#include <linux/pm.h>
-#include <linux/types.h>
-#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/wait.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include <linux/suspend.h>
-#include <linux/fsl_devices.h>
#include <linux/of_platform.h>
-#include <asm/reg.h>
-#include <asm/io.h>
-#include <asm/time.h>
#include <asm/mpc6xx.h>
#include <sysdev/fsl_soc.h>
diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c
index 2c64164..b2fda49 100644
--- a/arch/powerpc/platforms/83xx/usb.c
+++ b/arch/powerpc/platforms/83xx/usb.c
@@ -10,14 +10,6 @@
* option) any later version.
*/
-
-#include <linux/stddef.h>
-#include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/of.h>
-
-#include <asm/io.h>
-#include <asm/prom.h>
#include <sysdev/fsl_soc.h>
#include "mpc83xx.h"
--
1.7.2.5
^ permalink raw reply related
* [PATCH 03/14] mpc8349emitx: mark localbus as compatible with simple-bus
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
In-Reply-To: <1311065631-3429-1-git-send-email-dbaryshkov@gmail.com>
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/boot/dts/mpc8349emitx.dts | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts b/arch/powerpc/boot/dts/mpc8349emitx.dts
index b53d1df..505dc84 100644
--- a/arch/powerpc/boot/dts/mpc8349emitx.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitx.dts
@@ -390,7 +390,8 @@
#address-cells = <2>;
#size-cells = <1>;
compatible = "fsl,mpc8349e-localbus",
- "fsl,pq2pro-localbus";
+ "fsl,pq2pro-localbus",
+ "simple-bus";
reg = <0xe0005000 0xd8>;
ranges = <0x0 0x0 0xfe000000 0x1000000 /* flash */
0x1 0x0 0xf8000000 0x20000 /* VSC 7385 */
--
1.7.2.5
^ permalink raw reply related
* [PATCH 02/14] 83xx: consolidate of_platform_bus_probe calls
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
In-Reply-To: <1311065631-3429-1-git-send-email-dbaryshkov@gmail.com>
83xx board files have a lot of duplication in
*_declare_of_platform_devices() functions. Merge that into a single
function common to most of the boards.
The only leftover is mpc834x_itx.c board file which explicitly asks for
fsl,pq2pro-localbus, as corresponding bindings don't provide
"simple-bus" compatibility in localbus node.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/83xx/asp834x.c | 15 +--------------
arch/powerpc/platforms/83xx/km83xx.c | 18 +-----------------
arch/powerpc/platforms/83xx/misc.c | 17 +++++++++++++++++
arch/powerpc/platforms/83xx/mpc830x_rdb.c | 13 +------------
arch/powerpc/platforms/83xx/mpc831x_rdb.c | 14 +-------------
arch/powerpc/platforms/83xx/mpc832x_mds.c | 18 +-----------------
arch/powerpc/platforms/83xx/mpc832x_rdb.c | 18 +-----------------
arch/powerpc/platforms/83xx/mpc834x_itx.c | 3 +--
arch/powerpc/platforms/83xx/mpc834x_mds.c | 15 +--------------
arch/powerpc/platforms/83xx/mpc836x_mds.c | 18 +-----------------
arch/powerpc/platforms/83xx/mpc836x_rdk.c | 11 +----------
arch/powerpc/platforms/83xx/mpc837x_mds.c | 17 +----------------
arch/powerpc/platforms/83xx/mpc837x_rdb.c | 18 +-----------------
arch/powerpc/platforms/83xx/mpc83xx.h | 1 +
arch/powerpc/platforms/83xx/sbc834x.c | 15 +--------------
15 files changed, 31 insertions(+), 180 deletions(-)
diff --git a/arch/powerpc/platforms/83xx/asp834x.c b/arch/powerpc/platforms/83xx/asp834x.c
index 90b6c06..464ea8e 100644
--- a/arch/powerpc/platforms/83xx/asp834x.c
+++ b/arch/powerpc/platforms/83xx/asp834x.c
@@ -36,20 +36,7 @@ static void __init asp834x_setup_arch(void)
mpc834x_usb_cfg();
}
-static struct __initdata of_device_id asp8347_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- {},
-};
-
-static int __init asp8347_declare_of_platform_devices(void)
-{
- of_platform_bus_probe(NULL, asp8347_ids, NULL);
- return 0;
-}
-machine_device_initcall(asp834x, asp8347_declare_of_platform_devices);
+machine_device_initcall(asp834x, mpc83xx_declare_of_platform_devices);
/*
* Called very early, MMU is off, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c
index 71ba863..b9aaa50 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -122,23 +122,7 @@ static void __init mpc83xx_km_setup_arch(void)
#endif /* CONFIG_QUICC_ENGINE */
}
-static struct of_device_id kmpbec83xx_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .type = "qe", },
- { .compatible = "fsl,qe", },
- {},
-};
-
-static int __init kmeter_declare_of_platform_devices(void)
-{
- /* Publish the QE devices */
- of_platform_bus_probe(NULL, kmpbec83xx_ids, NULL);
-
- return 0;
-}
-machine_device_initcall(mpc83xx_km, kmeter_declare_of_platform_devices);
+machine_device_initcall(mpc83xx_km, mpc83xx_declare_of_platform_devices);
/* list of the supported boards */
static char *board[] __initdata = {
diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c
index 95f2274..cd65f5a 100644
--- a/arch/powerpc/platforms/83xx/misc.c
+++ b/arch/powerpc/platforms/83xx/misc.c
@@ -111,3 +111,20 @@ void __init mpc83xx_both_init_IRQ(void)
mpc83xx_qe_init_IRQ();
}
#endif /* CONFIG_QUICC_ENGINE */
+
+static struct of_device_id __initdata of_bus_ids[] = {
+ { .type = "soc", },
+ { .compatible = "soc", },
+ { .compatible = "simple-bus" },
+ { .compatible = "gianfar" },
+ { .compatible = "gpio-leds", },
+ { .type = "qe", },
+ { .compatible = "fsl,qe", },
+ {},
+};
+
+int __init mpc83xx_declare_of_platform_devices(void)
+{
+ of_platform_bus_probe(NULL, of_bus_ids, NULL);
+ return 0;
+}
diff --git a/arch/powerpc/platforms/83xx/mpc830x_rdb.c b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
index b453c15..ef595f1 100644
--- a/arch/powerpc/platforms/83xx/mpc830x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
@@ -56,18 +56,7 @@ static int __init mpc830x_rdb_probe(void)
return of_flat_dt_match(of_get_flat_dt_root(), board);
}
-static struct of_device_id __initdata of_bus_ids[] = {
- { .compatible = "simple-bus" },
- { .compatible = "gianfar" },
- {},
-};
-
-static int __init declare_of_platform_devices(void)
-{
- of_platform_bus_probe(NULL, of_bus_ids, NULL);
- return 0;
-}
-machine_device_initcall(mpc830x_rdb, declare_of_platform_devices);
+machine_device_initcall(mpc830x_rdb, mpc83xx_declare_of_platform_devices);
define_machine(mpc830x_rdb) {
.name = "MPC830x RDB",
diff --git a/arch/powerpc/platforms/83xx/mpc831x_rdb.c b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
index 386bde8..ce87406 100644
--- a/arch/powerpc/platforms/83xx/mpc831x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
@@ -58,19 +58,7 @@ static int __init mpc831x_rdb_probe(void)
return of_flat_dt_match(of_get_flat_dt_root(), board);
}
-static struct of_device_id __initdata of_bus_ids[] = {
- { .compatible = "simple-bus" },
- { .compatible = "gianfar" },
- { .compatible = "gpio-leds", },
- {},
-};
-
-static int __init declare_of_platform_devices(void)
-{
- of_platform_bus_probe(NULL, of_bus_ids, NULL);
- return 0;
-}
-machine_device_initcall(mpc831x_rdb, declare_of_platform_devices);
+machine_device_initcall(mpc831x_rdb, mpc83xx_declare_of_platform_devices);
define_machine(mpc831x_rdb) {
.name = "MPC831x RDB",
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index 85c120c..8ee1440 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -101,23 +101,7 @@ static void __init mpc832x_sys_setup_arch(void)
#endif /* CONFIG_QUICC_ENGINE */
}
-static struct of_device_id mpc832x_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .type = "qe", },
- { .compatible = "fsl,qe", },
- {},
-};
-
-static int __init mpc832x_declare_of_platform_devices(void)
-{
- /* Publish the QE devices */
- of_platform_bus_probe(NULL, mpc832x_ids, NULL);
-
- return 0;
-}
-machine_device_initcall(mpc832x_mds, mpc832x_declare_of_platform_devices);
+machine_device_initcall(mpc832x_mds, mpc83xx_declare_of_platform_devices);
/*
* Called very early, MMU is off, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index 03d015d..c10d0c4 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -218,23 +218,7 @@ static void __init mpc832x_rdb_setup_arch(void)
#endif /* CONFIG_QUICC_ENGINE */
}
-static struct of_device_id mpc832x_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .type = "qe", },
- { .compatible = "fsl,qe", },
- {},
-};
-
-static int __init mpc832x_declare_of_platform_devices(void)
-{
- /* Publish the QE devices */
- of_platform_bus_probe(NULL, mpc832x_ids, NULL);
-
- return 0;
-}
-machine_device_initcall(mpc832x_rdb, mpc832x_declare_of_platform_devices);
+machine_device_initcall(mpc832x_rdb, mpc83xx_declare_of_platform_devices);
/*
* Called very early, MMU is off, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index 2e2dc73..c853f66 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -41,13 +41,12 @@
static struct of_device_id __initdata mpc834x_itx_ids[] = {
{ .compatible = "fsl,pq2pro-localbus", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
{},
};
static int __init mpc834x_itx_declare_of_platform_devices(void)
{
+ mpc83xx_declare_of_platform_devices();
return of_platform_bus_probe(NULL, mpc834x_itx_ids, NULL);
}
machine_device_initcall(mpc834x_itx, mpc834x_itx_declare_of_platform_devices);
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index 94702e6..381e94e 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -92,20 +92,7 @@ static void __init mpc834x_mds_setup_arch(void)
mpc834xemds_usb_cfg();
}
-static struct of_device_id mpc834x_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- {},
-};
-
-static int __init mpc834x_declare_of_platform_devices(void)
-{
- of_platform_bus_probe(NULL, mpc834x_ids, NULL);
- return 0;
-}
-machine_device_initcall(mpc834x_mds, mpc834x_declare_of_platform_devices);
+machine_device_initcall(mpc834x_mds, mpc83xx_declare_of_platform_devices);
/*
* Called very early, MMU is off, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index a968d78..1b90701 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -144,23 +144,7 @@ static void __init mpc836x_mds_setup_arch(void)
#endif /* CONFIG_QUICC_ENGINE */
}
-static struct of_device_id mpc836x_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .type = "qe", },
- { .compatible = "fsl,qe", },
- {},
-};
-
-static int __init mpc836x_declare_of_platform_devices(void)
-{
- /* Publish the QE devices */
- of_platform_bus_probe(NULL, mpc836x_ids, NULL);
-
- return 0;
-}
-machine_device_initcall(mpc836x_mds, mpc836x_declare_of_platform_devices);
+machine_device_initcall(mpc836x_mds, mpc83xx_declare_of_platform_devices);
#ifdef CONFIG_QE_USB
static int __init mpc836x_usb_cfg(void)
diff --git a/arch/powerpc/platforms/83xx/mpc836x_rdk.c b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
index e4d3a75..2563174 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_rdk.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
@@ -27,16 +27,7 @@
#include "mpc83xx.h"
-static struct of_device_id __initdata mpc836x_rdk_ids[] = {
- { .compatible = "simple-bus", },
- {},
-};
-
-static int __init mpc836x_rdk_declare_of_platform_devices(void)
-{
- return of_platform_bus_probe(NULL, mpc836x_rdk_ids, NULL);
-}
-machine_device_initcall(mpc836x_rdk, mpc836x_rdk_declare_of_platform_devices);
+machine_device_initcall(mpc836x_rdk, mpc83xx_declare_of_platform_devices);
static void __init mpc836x_rdk_setup_arch(void)
{
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index 3be7f3a..7463183 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -95,22 +95,7 @@ static void __init mpc837x_mds_setup_arch(void)
mpc837xmds_usb_cfg();
}
-static struct of_device_id mpc837x_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- {},
-};
-
-static int __init mpc837x_declare_of_platform_devices(void)
-{
- /* Publish platform_device */
- of_platform_bus_probe(NULL, mpc837x_ids, NULL);
-
- return 0;
-}
-machine_device_initcall(mpc837x_mds, mpc837x_declare_of_platform_devices);
+machine_device_initcall(mpc837x_mds, mpc83xx_declare_of_platform_devices);
/*
* Called very early, MMU is off, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
index eebfd81..a4a5336 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
@@ -67,23 +67,7 @@ static void __init mpc837x_rdb_setup_arch(void)
mpc837x_rdb_sd_cfg();
}
-static struct of_device_id mpc837x_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- { .compatible = "gpio-leds", },
- {},
-};
-
-static int __init mpc837x_declare_of_platform_devices(void)
-{
- /* Publish platform_device */
- of_platform_bus_probe(NULL, mpc837x_ids, NULL);
-
- return 0;
-}
-machine_device_initcall(mpc837x_rdb, mpc837x_declare_of_platform_devices);
+machine_device_initcall(mpc837x_rdb, mpc83xx_declare_of_platform_devices);
static const char *board[] __initdata = {
"fsl,mpc8377rdb",
diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h
index 9d77ddb..039ffa3 100644
--- a/arch/powerpc/platforms/83xx/mpc83xx.h
+++ b/arch/powerpc/platforms/83xx/mpc83xx.h
@@ -79,5 +79,6 @@ static inline void __init mpc83xx_qe_init_IRQ(void) {}
#define mpc83xx_both_init_IRQ mpc83xx_ipic_init_IRQ
#endif /* CONFIG_QUICC_ENGINE */
+extern int mpc83xx_declare_of_platform_devices(void);
#endif /* __MPC83XX_H__ */
diff --git a/arch/powerpc/platforms/83xx/sbc834x.c b/arch/powerpc/platforms/83xx/sbc834x.c
index 205a28d..3d98bd9 100644
--- a/arch/powerpc/platforms/83xx/sbc834x.c
+++ b/arch/powerpc/platforms/83xx/sbc834x.c
@@ -62,20 +62,7 @@ static void __init sbc834x_setup_arch(void)
}
-static struct __initdata of_device_id sbc834x_ids[] = {
- { .type = "soc", },
- { .compatible = "soc", },
- { .compatible = "simple-bus", },
- { .compatible = "gianfar", },
- {},
-};
-
-static int __init sbc834x_declare_of_platform_devices(void)
-{
- of_platform_bus_probe(NULL, sbc834x_ids, NULL);
- return 0;
-}
-machine_device_initcall(sbc834x, sbc834x_declare_of_platform_devices);
+machine_device_initcall(sbc834x, mpc83xx_declare_of_platform_devices);
/*
* Called very early, MMU is off, device-tree isn't unflattened
--
1.7.2.5
^ permalink raw reply related
* [PATCH 01/14] 83xx: consolidate init_IRQ functions
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
In-Reply-To: <1311065631-3429-1-git-send-email-dbaryshkov@gmail.com>
On mpc83xx platform nearly all _init_IRQ functions look alike. They either
just setup ipic, or setup ipic and QE PIC. Separate this to special functions
to be either referenced from ppc_md, or called from board file.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/powerpc/platforms/83xx/asp834x.c | 20 +------------
arch/powerpc/platforms/83xx/km83xx.c | 33 +--------------------
arch/powerpc/platforms/83xx/misc.c | 46 +++++++++++++++++++++++++++++
arch/powerpc/platforms/83xx/mpc830x_rdb.c | 18 +----------
arch/powerpc/platforms/83xx/mpc831x_rdb.c | 18 +----------
arch/powerpc/platforms/83xx/mpc832x_mds.c | 30 +------------------
arch/powerpc/platforms/83xx/mpc832x_rdb.c | 31 +-------------------
arch/powerpc/platforms/83xx/mpc834x_itx.c | 18 +----------
arch/powerpc/platforms/83xx/mpc834x_mds.c | 18 +----------
arch/powerpc/platforms/83xx/mpc836x_mds.c | 30 +------------------
arch/powerpc/platforms/83xx/mpc836x_rdk.c | 28 +-----------------
arch/powerpc/platforms/83xx/mpc837x_mds.c | 18 +----------
arch/powerpc/platforms/83xx/mpc837x_rdb.c | 18 +----------
arch/powerpc/platforms/83xx/mpc83xx.h | 9 +++++
arch/powerpc/platforms/83xx/sbc834x.c | 20 +------------
15 files changed, 68 insertions(+), 287 deletions(-)
diff --git a/arch/powerpc/platforms/83xx/asp834x.c b/arch/powerpc/platforms/83xx/asp834x.c
index aa0d84d..90b6c06 100644
--- a/arch/powerpc/platforms/83xx/asp834x.c
+++ b/arch/powerpc/platforms/83xx/asp834x.c
@@ -36,24 +36,6 @@ static void __init asp834x_setup_arch(void)
mpc834x_usb_cfg();
}
-static void __init asp834x_init_IRQ(void)
-{
- struct device_node *np;
-
- np = of_find_node_by_type(NULL, "ipic");
- if (!np)
- return;
-
- ipic_init(np, 0);
-
- of_node_put(np);
-
- /* Initialize the default interrupt mapping priorities,
- * in case the boot rom changed something on us.
- */
- ipic_set_default_priority();
-}
-
static struct __initdata of_device_id asp8347_ids[] = {
{ .type = "soc", },
{ .compatible = "soc", },
@@ -82,7 +64,7 @@ define_machine(asp834x) {
.name = "ASP8347E",
.probe = asp834x_probe,
.setup_arch = asp834x_setup_arch,
- .init_IRQ = asp834x_init_IRQ,
+ .init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c
index a2b9b9e..71ba863 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -140,37 +140,6 @@ static int __init kmeter_declare_of_platform_devices(void)
}
machine_device_initcall(mpc83xx_km, kmeter_declare_of_platform_devices);
-static void __init mpc83xx_km_init_IRQ(void)
-{
- struct device_node *np;
-
- np = of_find_compatible_node(NULL, NULL, "fsl,pq2pro-pic");
- if (!np) {
- np = of_find_node_by_type(NULL, "ipic");
- if (!np)
- return;
- }
-
- ipic_init(np, 0);
-
- /* Initialize the default interrupt mapping priorities,
- * in case the boot rom changed something on us.
- */
- ipic_set_default_priority();
- of_node_put(np);
-
-#ifdef CONFIG_QUICC_ENGINE
- np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
- if (!np) {
- np = of_find_node_by_type(NULL, "qeic");
- if (!np)
- return;
- }
- qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
- of_node_put(np);
-#endif /* CONFIG_QUICC_ENGINE */
-}
-
/* list of the supported boards */
static char *board[] __initdata = {
"Keymile,KMETER1",
@@ -198,7 +167,7 @@ define_machine(mpc83xx_km) {
.name = "mpc83xx-km-platform",
.probe = mpc83xx_km_probe,
.setup_arch = mpc83xx_km_setup_arch,
- .init_IRQ = mpc83xx_km_init_IRQ,
+ .init_IRQ = mpc83xx_both_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c
index f01806c..95f2274 100644
--- a/arch/powerpc/platforms/83xx/misc.c
+++ b/arch/powerpc/platforms/83xx/misc.c
@@ -11,9 +11,12 @@
#include <linux/stddef.h>
#include <linux/kernel.h>
+#include <linux/of_platform.h>
#include <asm/io.h>
#include <asm/hw_irq.h>
+#include <asm/ipic.h>
+#include <asm/qe_ic.h>
#include <sysdev/fsl_soc.h>
#include "mpc83xx.h"
@@ -65,3 +68,46 @@ long __init mpc83xx_time_init(void)
return 0;
}
+
+void __init mpc83xx_ipic_init_IRQ(void)
+{
+ struct device_node *np;
+
+ /* looking for fsl,pq2pro-pic which is asl compatible with fsl,ipic */
+ np = of_find_compatible_node(NULL, NULL, "fsl,ipic");
+ if (!np)
+ np = of_find_node_by_type(NULL, "ipic");
+ if (!np)
+ return;
+
+ ipic_init(np, 0);
+
+ of_node_put(np);
+
+ /* Initialize the default interrupt mapping priorities,
+ * in case the boot rom changed something on us.
+ */
+ ipic_set_default_priority();
+}
+
+#ifdef CONFIG_QUICC_ENGINE
+void __init mpc83xx_qe_init_IRQ(void)
+{
+ struct device_node *np;
+
+ np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
+ if (!np) {
+ np = of_find_node_by_type(NULL, "qeic");
+ if (!np)
+ return;
+ }
+ qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
+ of_node_put(np);
+}
+
+void __init mpc83xx_both_init_IRQ(void)
+{
+ mpc83xx_ipic_init_IRQ();
+ mpc83xx_qe_init_IRQ();
+}
+#endif /* CONFIG_QUICC_ENGINE */
diff --git a/arch/powerpc/platforms/83xx/mpc830x_rdb.c b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
index d0c4e15..b453c15 100644
--- a/arch/powerpc/platforms/83xx/mpc830x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
@@ -41,22 +41,6 @@ static void __init mpc830x_rdb_setup_arch(void)
mpc831x_usb_cfg();
}
-static void __init mpc830x_rdb_init_IRQ(void)
-{
- struct device_node *np;
-
- np = of_find_node_by_type(NULL, "ipic");
- if (!np)
- return;
-
- ipic_init(np, 0);
-
- /* Initialize the default interrupt mapping priorities,
- * in case the boot rom changed something on us.
- */
- ipic_set_default_priority();
-}
-
static const char *board[] __initdata = {
"MPC8308RDB",
"fsl,mpc8308rdb",
@@ -89,7 +73,7 @@ define_machine(mpc830x_rdb) {
.name = "MPC830x RDB",
.probe = mpc830x_rdb_probe,
.setup_arch = mpc830x_rdb_setup_arch,
- .init_IRQ = mpc830x_rdb_init_IRQ,
+ .init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc831x_rdb.c b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
index f859ead..386bde8 100644
--- a/arch/powerpc/platforms/83xx/mpc831x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
@@ -44,22 +44,6 @@ static void __init mpc831x_rdb_setup_arch(void)
mpc831x_usb_cfg();
}
-static void __init mpc831x_rdb_init_IRQ(void)
-{
- struct device_node *np;
-
- np = of_find_node_by_type(NULL, "ipic");
- if (!np)
- return;
-
- ipic_init(np, 0);
-
- /* Initialize the default interrupt mapping priorities,
- * in case the boot rom changed something on us.
- */
- ipic_set_default_priority();
-}
-
static const char *board[] __initdata = {
"MPC8313ERDB",
"fsl,mpc8315erdb",
@@ -92,7 +76,7 @@ define_machine(mpc831x_rdb) {
.name = "MPC831x RDB",
.probe = mpc831x_rdb_probe,
.setup_arch = mpc831x_rdb_setup_arch,
- .init_IRQ = mpc831x_rdb_init_IRQ,
+ .init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index ec0b401b..85c120c 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -119,34 +119,6 @@ static int __init mpc832x_declare_of_platform_devices(void)
}
machine_device_initcall(mpc832x_mds, mpc832x_declare_of_platform_devices);
-static void __init mpc832x_sys_init_IRQ(void)
-{
- struct device_node *np;
-
- np = of_find_node_by_type(NULL, "ipic");
- if (!np)
- return;
-
- ipic_init(np, 0);
-
- /* Initialize the default interrupt mapping priorities,
- * in case the boot rom changed something on us.
- */
- ipic_set_default_priority();
- of_node_put(np);
-
-#ifdef CONFIG_QUICC_ENGINE
- np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
- if (!np) {
- np = of_find_node_by_type(NULL, "qeic");
- if (!np)
- return;
- }
- qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
- of_node_put(np);
-#endif /* CONFIG_QUICC_ENGINE */
-}
-
/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
@@ -161,7 +133,7 @@ define_machine(mpc832x_mds) {
.name = "MPC832x MDS",
.probe = mpc832x_sys_probe,
.setup_arch = mpc832x_sys_setup_arch,
- .init_IRQ = mpc832x_sys_init_IRQ,
+ .init_IRQ = mpc83xx_both_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index 17f9974..03d015d 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -236,35 +236,6 @@ static int __init mpc832x_declare_of_platform_devices(void)
}
machine_device_initcall(mpc832x_rdb, mpc832x_declare_of_platform_devices);
-static void __init mpc832x_rdb_init_IRQ(void)
-{
-
- struct device_node *np;
-
- np = of_find_node_by_type(NULL, "ipic");
- if (!np)
- return;
-
- ipic_init(np, 0);
-
- /* Initialize the default interrupt mapping priorities,
- * in case the boot rom changed something on us.
- */
- ipic_set_default_priority();
- of_node_put(np);
-
-#ifdef CONFIG_QUICC_ENGINE
- np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
- if (!np) {
- np = of_find_node_by_type(NULL, "qeic");
- if (!np)
- return;
- }
- qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
- of_node_put(np);
-#endif /* CONFIG_QUICC_ENGINE */
-}
-
/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
@@ -279,7 +250,7 @@ define_machine(mpc832x_rdb) {
.name = "MPC832x RDB",
.probe = mpc832x_rdb_probe,
.setup_arch = mpc832x_rdb_setup_arch,
- .init_IRQ = mpc832x_rdb_init_IRQ,
+ .init_IRQ = mpc83xx_both_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index 81e44fa..2e2dc73 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -74,22 +74,6 @@ static void __init mpc834x_itx_setup_arch(void)
mpc834x_usb_cfg();
}
-static void __init mpc834x_itx_init_IRQ(void)
-{
- struct device_node *np;
-
- np = of_find_node_by_type(NULL, "ipic");
- if (!np)
- return;
-
- ipic_init(np, 0);
-
- /* Initialize the default interrupt mapping priorities,
- * in case the boot rom changed something on us.
- */
- ipic_set_default_priority();
-}
-
/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
@@ -104,7 +88,7 @@ define_machine(mpc834x_itx) {
.name = "MPC834x ITX",
.probe = mpc834x_itx_probe,
.setup_arch = mpc834x_itx_setup_arch,
- .init_IRQ = mpc834x_itx_init_IRQ,
+ .init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index d0a634b..94702e6 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -92,22 +92,6 @@ static void __init mpc834x_mds_setup_arch(void)
mpc834xemds_usb_cfg();
}
-static void __init mpc834x_mds_init_IRQ(void)
-{
- struct device_node *np;
-
- np = of_find_node_by_type(NULL, "ipic");
- if (!np)
- return;
-
- ipic_init(np, 0);
-
- /* Initialize the default interrupt mapping priorities,
- * in case the boot rom changed something on us.
- */
- ipic_set_default_priority();
-}
-
static struct of_device_id mpc834x_ids[] = {
{ .type = "soc", },
{ .compatible = "soc", },
@@ -137,7 +121,7 @@ define_machine(mpc834x_mds) {
.name = "MPC834x MDS",
.probe = mpc834x_mds_probe,
.setup_arch = mpc834x_mds_setup_arch,
- .init_IRQ = mpc834x_mds_init_IRQ,
+ .init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 09e9d6f..a968d78 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -226,34 +226,6 @@ err:
machine_arch_initcall(mpc836x_mds, mpc836x_usb_cfg);
#endif /* CONFIG_QE_USB */
-static void __init mpc836x_mds_init_IRQ(void)
-{
- struct device_node *np;
-
- np = of_find_node_by_type(NULL, "ipic");
- if (!np)
- return;
-
- ipic_init(np, 0);
-
- /* Initialize the default interrupt mapping priorities,
- * in case the boot rom changed something on us.
- */
- ipic_set_default_priority();
- of_node_put(np);
-
-#ifdef CONFIG_QUICC_ENGINE
- np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
- if (!np) {
- np = of_find_node_by_type(NULL, "qeic");
- if (!np)
- return;
- }
- qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
- of_node_put(np);
-#endif /* CONFIG_QUICC_ENGINE */
-}
-
/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
@@ -268,7 +240,7 @@ define_machine(mpc836x_mds) {
.name = "MPC836x MDS",
.probe = mpc836x_mds_probe,
.setup_arch = mpc836x_mds_setup_arch,
- .init_IRQ = mpc836x_mds_init_IRQ,
+ .init_IRQ = mpc83xx_both_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc836x_rdk.c b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
index b0090aa..e4d3a75 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_rdk.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
@@ -56,32 +56,6 @@ static void __init mpc836x_rdk_setup_arch(void)
#endif
}
-static void __init mpc836x_rdk_init_IRQ(void)
-{
- struct device_node *np;
-
- np = of_find_compatible_node(NULL, NULL, "fsl,ipic");
- if (!np)
- return;
-
- ipic_init(np, 0);
-
- /*
- * Initialize the default interrupt mapping priorities,
- * in case the boot rom changed something on us.
- */
- ipic_set_default_priority();
- of_node_put(np);
-#ifdef CONFIG_QUICC_ENGINE
- np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
- if (!np)
- return;
-
- qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
- of_node_put(np);
-#endif
-}
-
/*
* Called very early, MMU is off, device-tree isn't unflattened.
*/
@@ -96,7 +70,7 @@ define_machine(mpc836x_rdk) {
.name = "MPC836x RDK",
.probe = mpc836x_rdk_probe,
.setup_arch = mpc836x_rdk_setup_arch,
- .init_IRQ = mpc836x_rdk_init_IRQ,
+ .init_IRQ = mpc83xx_both_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index 8306832..3be7f3a 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -112,22 +112,6 @@ static int __init mpc837x_declare_of_platform_devices(void)
}
machine_device_initcall(mpc837x_mds, mpc837x_declare_of_platform_devices);
-static void __init mpc837x_mds_init_IRQ(void)
-{
- struct device_node *np;
-
- np = of_find_compatible_node(NULL, NULL, "fsl,ipic");
- if (!np)
- return;
-
- ipic_init(np, 0);
-
- /* Initialize the default interrupt mapping priorities,
- * in case the boot rom changed something on us.
- */
- ipic_set_default_priority();
-}
-
/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
@@ -142,7 +126,7 @@ define_machine(mpc837x_mds) {
.name = "MPC837x MDS",
.probe = mpc837x_mds_probe,
.setup_arch = mpc837x_mds_setup_arch,
- .init_IRQ = mpc837x_mds_init_IRQ,
+ .init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
index 7bafbf2..eebfd81 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
@@ -85,22 +85,6 @@ static int __init mpc837x_declare_of_platform_devices(void)
}
machine_device_initcall(mpc837x_rdb, mpc837x_declare_of_platform_devices);
-static void __init mpc837x_rdb_init_IRQ(void)
-{
- struct device_node *np;
-
- np = of_find_compatible_node(NULL, NULL, "fsl,ipic");
- if (!np)
- return;
-
- ipic_init(np, 0);
-
- /* Initialize the default interrupt mapping priorities,
- * in case the boot rom changed something on us.
- */
- ipic_set_default_priority();
-}
-
static const char *board[] __initdata = {
"fsl,mpc8377rdb",
"fsl,mpc8378rdb",
@@ -121,7 +105,7 @@ define_machine(mpc837x_rdb) {
.name = "MPC837x RDB/WLAN",
.probe = mpc837x_rdb_probe,
.setup_arch = mpc837x_rdb_setup_arch,
- .init_IRQ = mpc837x_rdb_init_IRQ,
+ .init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h
index 82a4345..9d77ddb 100644
--- a/arch/powerpc/platforms/83xx/mpc83xx.h
+++ b/arch/powerpc/platforms/83xx/mpc83xx.h
@@ -70,5 +70,14 @@ extern long mpc83xx_time_init(void);
extern int mpc837x_usb_cfg(void);
extern int mpc834x_usb_cfg(void);
extern int mpc831x_usb_cfg(void);
+extern void mpc83xx_ipic_init_IRQ(void);
+#ifdef CONFIG_QUICC_ENGINE
+extern void mpc83xx_qe_init_IRQ(void);
+extern void mpc83xx_both_init_IRQ(void);
+#else
+static inline void __init mpc83xx_qe_init_IRQ(void) {}
+#define mpc83xx_both_init_IRQ mpc83xx_ipic_init_IRQ
+#endif /* CONFIG_QUICC_ENGINE */
+
#endif /* __MPC83XX_H__ */
diff --git a/arch/powerpc/platforms/83xx/sbc834x.c b/arch/powerpc/platforms/83xx/sbc834x.c
index 49023db..205a28d 100644
--- a/arch/powerpc/platforms/83xx/sbc834x.c
+++ b/arch/powerpc/platforms/83xx/sbc834x.c
@@ -62,24 +62,6 @@ static void __init sbc834x_setup_arch(void)
}
-static void __init sbc834x_init_IRQ(void)
-{
- struct device_node *np;
-
- np = of_find_node_by_type(NULL, "ipic");
- if (!np)
- return;
-
- ipic_init(np, 0);
-
- /* Initialize the default interrupt mapping priorities,
- * in case the boot rom changed something on us.
- */
- ipic_set_default_priority();
-
- of_node_put(np);
-}
-
static struct __initdata of_device_id sbc834x_ids[] = {
{ .type = "soc", },
{ .compatible = "soc", },
@@ -109,7 +91,7 @@ define_machine(sbc834x) {
.name = "SBC834x",
.probe = sbc834x_probe,
.setup_arch = sbc834x_setup_arch,
- .init_IRQ = sbc834x_init_IRQ,
+ .init_IRQ = mpc83xx_ipic_init_IRQ,
.get_irq = ipic_get_irq,
.restart = mpc83xx_restart,
.time_init = mpc83xx_time_init,
--
1.7.2.5
^ permalink raw reply related
* [PATCH 00/14] Consolidation of 83xx/85xx board files
From: Dmitry Eremin-Solenikov @ 2011-07-19 8:53 UTC (permalink / raw)
To: Linux PPC Development; +Cc: Paul Mackerras
I think it's already too late for this merge window, so this should stay
for 3.2 merge window. Board files for mpc83xx platforms show lots of common
code. Same goes for mpc85xx boards. This patchset is an initial attempt
to merge some (most) of the common code. Based on the tree by Kumar Gala.
The following changes since commit 6471fc6630a507fd54fdaceceee1ddaf3c917cde:
powerpc: Dont require a dma_ops struct to set dma mask (2011-07-08 00:21:36 -0500)
Dmitry Eremin-Solenikov (14):
83xx: consolidate init_IRQ functions
83xx: consolidate of_platform_bus_probe calls
mpc8349emitx: mark localbus as compatible with simple-bus
83xx/mpc834x_itx: drop pq2pro-localbus-specific code
83xx: headers cleanup
85xx/sbc8560: correct compilation if CONFIG_PHYS_ADDR_T_64BIT is set
85xx/ksi8560: declare that localbus is compatbile with simple-bus
85xx/sbc8560: declare that localbus is compatbile with simple-bus
85xx/sbc8548: read hardware revision when it's required for first time
85xx/mpc85xx_rdb: merge p1020_rdb and p2020_rdb machine entries
85xx: merge 32-bit QorIQ with DPA boards support
85xx/mpc85xx_ds,ads,cds: move .pci_exclude_device setting to machine definitions
85xx: consolidate of_platform_bus_probe calls
85xx: separate cpm2 pic init
arch/powerpc/boot/dts/ksi8560.dts | 2 +-
arch/powerpc/boot/dts/mpc8349emitx.dts | 3 +-
arch/powerpc/boot/dts/sbc8560.dts | 2 +-
arch/powerpc/platforms/83xx/asp834x.c | 37 +--------
arch/powerpc/platforms/83xx/km83xx.c | 77 +----------------
arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c | 5 -
arch/powerpc/platforms/83xx/misc.c | 64 ++++++++++++++-
arch/powerpc/platforms/83xx/mpc830x_rdb.c | 36 +-------
arch/powerpc/platforms/83xx/mpc831x_rdb.c | 34 +-------
arch/powerpc/platforms/83xx/mpc832x_mds.c | 80 +-----------------
arch/powerpc/platforms/83xx/mpc832x_rdb.c | 60 +-------------
arch/powerpc/platforms/83xx/mpc834x_itx.c | 51 +-----------
arch/powerpc/platforms/83xx/mpc834x_mds.c | 53 +-----------
arch/powerpc/platforms/83xx/mpc836x_mds.c | 79 +-----------------
arch/powerpc/platforms/83xx/mpc836x_rdk.c | 47 +----------
arch/powerpc/platforms/83xx/mpc837x_mds.c | 39 +--------
arch/powerpc/platforms/83xx/mpc837x_rdb.c | 38 +--------
arch/powerpc/platforms/83xx/mpc83xx.h | 10 ++
arch/powerpc/platforms/83xx/sbc834x.c | 55 +------------
arch/powerpc/platforms/83xx/suspend.c | 8 --
arch/powerpc/platforms/83xx/usb.c | 8 --
arch/powerpc/platforms/85xx/Kconfig | 32 +------
arch/powerpc/platforms/85xx/Makefile | 6 +-
arch/powerpc/platforms/85xx/ksi8560.c | 46 +----------
arch/powerpc/platforms/85xx/mpc8536_ds.c | 16 +---
arch/powerpc/platforms/85xx/mpc85xx.h | 11 +++
arch/powerpc/platforms/85xx/mpc85xx_ads.c | 57 ++-----------
arch/powerpc/platforms/85xx/mpc85xx_cds.c | 21 +----
arch/powerpc/platforms/85xx/mpc85xx_common.c | 65 ++++++++++++++
arch/powerpc/platforms/85xx/mpc85xx_ds.c | 25 ++----
arch/powerpc/platforms/85xx/mpc85xx_mds.c | 46 +---------
arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 54 +++----------
arch/powerpc/platforms/85xx/p1022_ds.c | 7 +-
arch/powerpc/platforms/85xx/p2040_rdb.c | 88 --------------------
arch/powerpc/platforms/85xx/p4080_ds.c | 88 --------------------
.../platforms/85xx/{p3041_ds.c => qoriq_dpa_ds.c} | 26 +++---
arch/powerpc/platforms/85xx/sbc8548.c | 26 ++----
arch/powerpc/platforms/85xx/sbc8560.c | 52 +-----------
arch/powerpc/platforms/85xx/socrates.c | 13 +---
arch/powerpc/platforms/85xx/stx_gp3.c | 16 +---
arch/powerpc/platforms/85xx/tqm85xx.c | 51 +-----------
arch/powerpc/platforms/85xx/xes_mpc85xx.c | 20 +----
42 files changed, 278 insertions(+), 1276 deletions(-)
create mode 100644 arch/powerpc/platforms/85xx/mpc85xx.h
create mode 100644 arch/powerpc/platforms/85xx/mpc85xx_common.c
delete mode 100644 arch/powerpc/platforms/85xx/p2040_rdb.c
delete mode 100644 arch/powerpc/platforms/85xx/p4080_ds.c
rename arch/powerpc/platforms/85xx/{p3041_ds.c => qoriq_dpa_ds.c} (72%)
^ permalink raw reply
* RE: [RFC/PATCH] mm/futex: Fix futex writes on archs with SW trackingof dirty & young
From: Benjamin Herrenschmidt @ 2011-07-19 8:45 UTC (permalink / raw)
To: David Laight
Cc: tony.luck, Peter Zijlstra, Shan Hai, Peter Zijlstra, linux-kernel,
cmetcalf, dhowells, paulus, tglx, walken, linuxppc-dev, akpm
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6D8ADFF@saturn3.aculab.com>
On Tue, 2011-07-19 at 09:26 +0100, David Laight wrote:
> > Got it, if the fault_in_user_writeable() is designed to catch the
> > exact same write permission fault problem we discuss here, so
> > your patch fixed that very nicely, we should fixup it by directly
> > calling handle_mm_fault like what you did because we are for sure
> > to know what just happened(permission violation), its not necessary
> > to check what's happened by calling gup-->follow_page, and
> > further the follow_page failed to report the fault :-)
>
> One thought I've had - and I don't know enough about the data
> area in use to know if it is a problem - is what happens if
> a different cpu faults on the same user page and has already
> marked it 'valid' between the fault happening and the fault
> handler looking at the page tables to find out why.
> If any of the memory areas are shared, it might be that the
> PTE (etc) might already show the page a writable by the
> time the fault handler is looking at them - this might confuse it!
The same way handle_mm_fault() deals with two CPUs faulting on the same
page at the same time :-)
All the necessary locking is in there, handle_mm_fault() and friends
will walk the page tables, take the PTE lock, will notice it's already
been all fixed up (well that it doesn't need to do a page fault at
least), will then call ptep_set_access_flags() which will itself notice
there's nothing to do ... etc
So all you'll hit is the spurious fault TLB invalidate in the write
case, which is necessary on some archs (well, we think it is tho I don't
know which archs really :-)
Cheers,
Ben.
^ permalink raw reply
* Re: [RFC/PATCH] mm/futex: Fix futex writes on archs with SW trackingof dirty & young
From: Shan Hai @ 2011-07-19 8:45 UTC (permalink / raw)
To: David Laight
Cc: tony.luck, Peter Zijlstra, Peter Zijlstra, linux-kernel, cmetcalf,
dhowells, paulus, tglx, walken, linuxppc-dev, akpm
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6D8ADFF@saturn3.aculab.com>
On 07/19/2011 04:26 PM, David Laight wrote:
>
>> Got it, if the fault_in_user_writeable() is designed to catch the
>> exact same write permission fault problem we discuss here, so
>> your patch fixed that very nicely, we should fixup it by directly
>> calling handle_mm_fault like what you did because we are for sure
>> to know what just happened(permission violation), its not necessary
>> to check what's happened by calling gup-->follow_page, and
>> further the follow_page failed to report the fault :-)
> One thought I've had - and I don't know enough about the data
> area in use to know if it is a problem - is what happens if
> a different cpu faults on the same user page and has already
> marked it 'valid' between the fault happening and the fault
> handler looking at the page tables to find out why.
> If any of the memory areas are shared, it might be that the
> PTE (etc) might already show the page a writable by the
> time the fault handler is looking at them - this might confuse it!
>
There is no problem at all if you mean *valid* by page present
and writable, because when the fault_in_user_writeable()
is called, the pte to the shared page was already setup by
demand paging and pte.present and pte.write was set, and the
reason why the fault was taken is that because of violation of
permission on present and writable user page occurred on sw
dirty/young tracking architectures.
Thanks
Shan Hai
> David
>
>
^ permalink raw reply
* Re: [PATCH] powerpc/5200: add GPIO functions for simple interrupt GPIOs
From: Anatolij Gustschin @ 2011-07-19 8:39 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, Detlev Zundel
In-Reply-To: <20110715200801.GJ2833@ponder.secretlab.ca>
On Fri, 15 Jul 2011 14:08:01 -0600
Grant Likely <grant.likely@secretlab.ca> wrote:
> On Sat, Jul 09, 2011 at 12:14:09PM +0200, Anatolij Gustschin wrote:
> > On Wed, 6 Jul 2011 11:52:45 -0600
> > Grant Likely <grant.likely@secretlab.ca> wrote:
> >
> > > On Mon, May 23, 2011 at 11:25:30AM +0200, Anatolij Gustschin wrote:
> > > > The mpc52xx_gpio driver currently supports 8 wakeup GPIOs and 32
> > > > simple GPIOs. Extend it to also support GPIO function of 8 simple
> > > > interrupt GPIOs controlled in the standard GPIO register module.
> > > >
> > > > Signed-off-by: Anatolij Gustschin <agust@denx.de>
> > > > ---
> > > > arch/powerpc/platforms/52xx/mpc52xx_gpio.c | 117 ++++++++++++++++++++++++++++
> > >
> > > I don't want to merge more open coded MMIO gpio driver code. This whole driver really needs to be converted to use GENERIC_GPIO.
> >
> > I'm not sure I understand what you mean. Do you mean
> > the conversion to drop of_mm_* stuff?
>
> No, I mean conversion to use the generic gpio register access
> functions instead of creating new ones.
Could you please explain which functions exactly should be
generalized? All functions (32-bit gpio register access and
8-bit gpio register access for wakeup and simple interrupt gpio
registers) by providing an access function and doing all
simple/wakeup/simple-interrupt gpio specific stuff in it? Or only
providing generic functions for 8-bit gpio registers and use them
for both wakeup and simple-interrupt gpios? Which struct should be
used for register offset calculation in accessors then? Should a
generic 8-bit gpio register description struct be added for this
purpose? Or some defines for generic register offsets? How to
differentiate between shadow registers for wakeup and simple-
interrupt gpios in generic accessors? By adding a type field
to mpc52xx_gpiochip struct and checking for it in generic
accessors?
Thanks,
Anatolij
^ permalink raw reply
* RE: [RFC/PATCH] mm/futex: Fix futex writes on archs with SW trackingof dirty & young
From: David Laight @ 2011-07-19 8:26 UTC (permalink / raw)
To: Shan Hai, Benjamin Herrenschmidt
Cc: tony.luck, Peter Zijlstra, Peter Zijlstra, linux-kernel, cmetcalf,
dhowells, paulus, tglx, walken, linuxppc-dev, akpm
In-Reply-To: <4E253F40.2010104@gmail.com>
=20
> Got it, if the fault_in_user_writeable() is designed to catch the
> exact same write permission fault problem we discuss here, so
> your patch fixed that very nicely, we should fixup it by directly
> calling handle_mm_fault like what you did because we are for sure
> to know what just happened(permission violation), its not necessary
> to check what's happened by calling gup-->follow_page, and
> further the follow_page failed to report the fault :-)
One thought I've had - and I don't know enough about the data
area in use to know if it is a problem - is what happens if
a different cpu faults on the same user page and has already
marked it 'valid' between the fault happening and the fault
handler looking at the page tables to find out why.
If any of the memory areas are shared, it might be that the
PTE (etc) might already show the page a writable by the
time the fault handler is looking at them - this might confuse it!
David
^ permalink raw reply
* Re: [RFC/PATCH] mm/futex: Fix futex writes on archs with SW tracking of dirty & young
From: Shan Hai @ 2011-07-19 8:24 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: tony.luck, Peter Zijlstra, Peter Zijlstra, linux-kernel, cmetcalf,
dhowells, paulus, tglx, walken, linuxppc-dev, akpm
In-Reply-To: <1311061575.25044.406.camel@pasglop>
On 07/19/2011 03:46 PM, Benjamin Herrenschmidt wrote:
> On Tue, 2011-07-19 at 13:38 +0800, Shan Hai wrote:
>
>> What you said is another path, that is futex_wake_op(),
>> but what about futex_lock_pi in which my test case failed?
>> your patch will call handle_mm_fault on every futex contention
>> in the futex_lock_pi path.
>>
>> futex_lock_pi()
>> ret = futex_lock_pi_atomic(uaddr, hb,&q.key,&q.pi_state, current, 0);
>> case -EFAULT:
>> goto uaddr_faulted;
>>
>> ...
>> uaddr_faulted:
>> ret = fault_in_user_writeable(uaddr);
> Euh ... and how do we get to uaddr_faulted ? You may have missed the
> return statement right before it :-)
>
> From what I can tell we only get there as a result of -EFAULT from
> futex_lock_pi_atomic() which is exactly the case we are trying to
> cover.
>
Got it, if the fault_in_user_writeable() is designed to catch the
exact same write permission fault problem we discuss here, so
your patch fixed that very nicely, we should fixup it by directly
calling handle_mm_fault like what you did because we are for sure
to know what just happened(permission violation), its not necessary
to check what's happened by calling gup-->follow_page, and
further the follow_page failed to report the fault :-)
Thanks
Shan Hai
> .../...
>>>> "[PATCH 1/1] Fixup write permission of TLB on powerpc e500 core"?
>>>> (I will fix the stupid errors in my original patch if the concept
>>>> is acceptable)
>>>> in this way we could decrease the overhead of handle_mm_fault
>>>> in the path which does not need write permission fixup.
>>> Which overhead ? gup does handle_mm_fault() as well if needed.
>> it does it *if needed*, and this requirement is rare in my opinion.
> And how does gup figure out of it's needed ? By walking down the page
> tables in follow_page... what does handle_mm_fault do ? walk down the
> page tables...
>
> The main (if not the only) relevant difference here, is going to be the
> spurious fault TLB invaliate for writes ... which is a nop on x86....
> and needed in all the cases we care about (and if it's not needed, then
> it's up to the arch to nop it out, we should probably do it on powerpc
> too ... but that's un unrelated discussion).
>
> Cheers,
> Ben.
>
>> Thanks
>> Shan Hai
>>
>>> What I do is I replace what is arguably an abuse of gup() in the case
>>> where a fixup -is- needed with a dedicated function designed to perform
>>> the said fixup ... and do it properly which gup() didn't :-)
>>>
>>> Cheers,
>>> Ben.
>>>
>>>> Thanks
>>>> Shan Hai
>>>>> Cheers,
>>>>> Ben.
>>>>>
>>>>> diff --git a/include/linux/mm.h b/include/linux/mm.h
>>>>> index 9670f71..1036614 100644
>>>>> --- a/include/linux/mm.h
>>>>> +++ b/include/linux/mm.h
>>>>> @@ -985,6 +985,8 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
>>>>> int get_user_pages_fast(unsigned long start, int nr_pages, int write,
>>>>> struct page **pages);
>>>>> struct page *get_dump_page(unsigned long addr);
>>>>> +extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
>>>>> + unsigned long address, unsigned int fault_flags);
>>>>>
>>>>> extern int try_to_release_page(struct page * page, gfp_t gfp_mask);
>>>>> extern void do_invalidatepage(struct page *page, unsigned long offset);
>>>>> diff --git a/kernel/futex.c b/kernel/futex.c
>>>>> index fe28dc2..7a0a4ed 100644
>>>>> --- a/kernel/futex.c
>>>>> +++ b/kernel/futex.c
>>>>> @@ -355,8 +355,8 @@ static int fault_in_user_writeable(u32 __user *uaddr)
>>>>> int ret;
>>>>>
>>>>> down_read(&mm->mmap_sem);
>>>>> - ret = get_user_pages(current, mm, (unsigned long)uaddr,
>>>>> - 1, 1, 0, NULL, NULL);
>>>>> + ret = fixup_user_fault(current, mm, (unsigned long)uaddr,
>>>>> + FAULT_FLAG_WRITE);
>>>>> up_read(&mm->mmap_sem);
>>>>>
>>>>> return ret< 0 ? ret : 0;
>>>>> diff --git a/mm/memory.c b/mm/memory.c
>>>>> index 40b7531..b967fb0 100644
>>>>> --- a/mm/memory.c
>>>>> +++ b/mm/memory.c
>>>>> @@ -1815,7 +1815,64 @@ next_page:
>>>>> }
>>>>> EXPORT_SYMBOL(__get_user_pages);
>>>>>
>>>>> -/**
>>>>> +/*
>>>>> + * fixup_user_fault() - manually resolve a user page fault
>>>>> + * @tsk: the task_struct to use for page fault accounting, or
>>>>> + * NULL if faults are not to be recorded.
>>>>> + * @mm: mm_struct of target mm
>>>>> + * @address: user address
>>>>> + * @fault_flags:flags to pass down to handle_mm_fault()
>>>>> + *
>>>>> + * This is meant to be called in the specific scenario where for
>>>>> + * locking reasons we try to access user memory in atomic context
>>>>> + * (within a pagefault_disable() section), this returns -EFAULT,
>>>>> + * and we want to resolve the user fault before trying again.
>>>>> + *
>>>>> + * Typically this is meant to be used by the futex code.
>>>>> + *
>>>>> + * The main difference with get_user_pages() is that this function
>>>>> + * will unconditionally call handle_mm_fault() which will in turn
>>>>> + * perform all the necessary SW fixup of the dirty and young bits
>>>>> + * in the PTE, while handle_mm_fault() only guarantees to update
>>>>> + * these in the struct page.
>>>>> + *
>>>>> + * This is important for some architectures where those bits also
>>>>> + * gate the access permission to the page because their are
>>>>> + * maintained in software. On such architecture, gup() will not
>>>>> + * be enough to make a subsequent access succeed.
>>>>> + *
>>>>> + * This should be called with the mm_sem held for read.
>>>>> + */
>>>>> +int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
>>>>> + unsigned long address, unsigned int fault_flags)
>>>>> +{
>>>>> + struct vm_area_struct *vma;
>>>>> + int ret;
>>>>> +
>>>>> + vma = find_extend_vma(mm, address);
>>>>> + if (!vma || address< vma->vm_start)
>>>>> + return -EFAULT;
>>>>> +
>>>>> + ret = handle_mm_fault(mm, vma, address, fault_flags);
>>>>> + if (ret& VM_FAULT_ERROR) {
>>>>> + if (ret& VM_FAULT_OOM)
>>>>> + return -ENOMEM;
>>>>> + if (ret& (VM_FAULT_HWPOISON | VM_FAULT_HWPOISON_LARGE))
>>>>> + return -EHWPOISON;
>>>>> + if (ret& VM_FAULT_SIGBUS)
>>>>> + return -EFAULT;
>>>>> + BUG();
>>>>> + }
>>>>> + if (tsk) {
>>>>> + if (ret& VM_FAULT_MAJOR)
>>>>> + tsk->maj_flt++;
>>>>> + else
>>>>> + tsk->min_flt++;
>>>>> + }
>>>>> + return 0;
>>>>> +}
>>>>> +
>>>>> +/*
>>>>> * get_user_pages() - pin user pages in memory
>>>>> * @tsk: the task_struct to use for page fault accounting, or
>>>>> * NULL if faults are not to be recorded.
>>>>>
>>>>>
>>>> --
>>>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>>>> the body of a message to majordomo@vger.kernel.org
>>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>> Please read the FAQ at http://www.tux.org/lkml/
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply
* Re: [PATCH v2] net: filter: BPF 'JIT' compiler for PPC64
From: Benjamin Herrenschmidt @ 2011-07-19 7:55 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, linuxppc-dev, Matt Evans
In-Reply-To: <1311058260.16961.12.camel@edumazet-laptop>
On Tue, 2011-07-19 at 08:51 +0200, Eric Dumazet wrote:
> > + case BPF_S_ANC_CPU:
> > +#ifdef CONFIG_SMP
> > + /*
> > + * PACA ptr is r13:
> > + * raw_smp_processor_id() = local_paca->paca_index
> > + */
>
> This could break if one day linux supports more than 65536 cpus :)
>
> > + PPC_LHZ_OFFS(r_A, 13,
> > + offsetof(struct paca_struct, paca_index));
> > +#else
> > + PPC_LI(r_A, 0);
> > +#endif
> > + break;
As would our implementation of raw_smp_processor_id() and our
spinlocks :-) I don't think we need to fix that -now- but you are
welcome to add something like a
BUILD_BUG_ON(sizeof(local_paca->paca_index) != 2); as a reminder :-)
Cheers,
Ben.
^ permalink raw reply
* Re: [RFC/PATCH] mm/futex: Fix futex writes on archs with SW tracking of dirty & young
From: Benjamin Herrenschmidt @ 2011-07-19 7:46 UTC (permalink / raw)
To: Shan Hai
Cc: tony.luck, Peter Zijlstra, Peter Zijlstra, linux-kernel, cmetcalf,
dhowells, paulus, tglx, walken, linuxppc-dev, akpm
In-Reply-To: <4E25185F.1050605@gmail.com>
On Tue, 2011-07-19 at 13:38 +0800, Shan Hai wrote:
> What you said is another path, that is futex_wake_op(),
> but what about futex_lock_pi in which my test case failed?
> your patch will call handle_mm_fault on every futex contention
> in the futex_lock_pi path.
>
> futex_lock_pi()
> ret = futex_lock_pi_atomic(uaddr, hb, &q.key, &q.pi_state, current, 0);
> case -EFAULT:
> goto uaddr_faulted;
>
> ...
> uaddr_faulted:
> ret = fault_in_user_writeable(uaddr);
Euh ... and how do we get to uaddr_faulted ? You may have missed the
return statement right before it :-)
>From what I can tell we only get there as a result of -EFAULT from
futex_lock_pi_atomic() which is exactly the case we are trying to
cover.
.../...
> >> "[PATCH 1/1] Fixup write permission of TLB on powerpc e500 core"?
> >> (I will fix the stupid errors in my original patch if the concept
> >> is acceptable)
> >> in this way we could decrease the overhead of handle_mm_fault
> >> in the path which does not need write permission fixup.
> > Which overhead ? gup does handle_mm_fault() as well if needed.
>
> it does it *if needed*, and this requirement is rare in my opinion.
And how does gup figure out of it's needed ? By walking down the page
tables in follow_page... what does handle_mm_fault do ? walk down the
page tables...
The main (if not the only) relevant difference here, is going to be the
spurious fault TLB invaliate for writes ... which is a nop on x86....
and needed in all the cases we care about (and if it's not needed, then
it's up to the arch to nop it out, we should probably do it on powerpc
too ... but that's un unrelated discussion).
Cheers,
Ben.
> Thanks
> Shan Hai
>
> > What I do is I replace what is arguably an abuse of gup() in the case
> > where a fixup -is- needed with a dedicated function designed to perform
> > the said fixup ... and do it properly which gup() didn't :-)
> >
> > Cheers,
> > Ben.
> >
> >> Thanks
> >> Shan Hai
> >>> Cheers,
> >>> Ben.
> >>>
> >>> diff --git a/include/linux/mm.h b/include/linux/mm.h
> >>> index 9670f71..1036614 100644
> >>> --- a/include/linux/mm.h
> >>> +++ b/include/linux/mm.h
> >>> @@ -985,6 +985,8 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
> >>> int get_user_pages_fast(unsigned long start, int nr_pages, int write,
> >>> struct page **pages);
> >>> struct page *get_dump_page(unsigned long addr);
> >>> +extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
> >>> + unsigned long address, unsigned int fault_flags);
> >>>
> >>> extern int try_to_release_page(struct page * page, gfp_t gfp_mask);
> >>> extern void do_invalidatepage(struct page *page, unsigned long offset);
> >>> diff --git a/kernel/futex.c b/kernel/futex.c
> >>> index fe28dc2..7a0a4ed 100644
> >>> --- a/kernel/futex.c
> >>> +++ b/kernel/futex.c
> >>> @@ -355,8 +355,8 @@ static int fault_in_user_writeable(u32 __user *uaddr)
> >>> int ret;
> >>>
> >>> down_read(&mm->mmap_sem);
> >>> - ret = get_user_pages(current, mm, (unsigned long)uaddr,
> >>> - 1, 1, 0, NULL, NULL);
> >>> + ret = fixup_user_fault(current, mm, (unsigned long)uaddr,
> >>> + FAULT_FLAG_WRITE);
> >>> up_read(&mm->mmap_sem);
> >>>
> >>> return ret< 0 ? ret : 0;
> >>> diff --git a/mm/memory.c b/mm/memory.c
> >>> index 40b7531..b967fb0 100644
> >>> --- a/mm/memory.c
> >>> +++ b/mm/memory.c
> >>> @@ -1815,7 +1815,64 @@ next_page:
> >>> }
> >>> EXPORT_SYMBOL(__get_user_pages);
> >>>
> >>> -/**
> >>> +/*
> >>> + * fixup_user_fault() - manually resolve a user page fault
> >>> + * @tsk: the task_struct to use for page fault accounting, or
> >>> + * NULL if faults are not to be recorded.
> >>> + * @mm: mm_struct of target mm
> >>> + * @address: user address
> >>> + * @fault_flags:flags to pass down to handle_mm_fault()
> >>> + *
> >>> + * This is meant to be called in the specific scenario where for
> >>> + * locking reasons we try to access user memory in atomic context
> >>> + * (within a pagefault_disable() section), this returns -EFAULT,
> >>> + * and we want to resolve the user fault before trying again.
> >>> + *
> >>> + * Typically this is meant to be used by the futex code.
> >>> + *
> >>> + * The main difference with get_user_pages() is that this function
> >>> + * will unconditionally call handle_mm_fault() which will in turn
> >>> + * perform all the necessary SW fixup of the dirty and young bits
> >>> + * in the PTE, while handle_mm_fault() only guarantees to update
> >>> + * these in the struct page.
> >>> + *
> >>> + * This is important for some architectures where those bits also
> >>> + * gate the access permission to the page because their are
> >>> + * maintained in software. On such architecture, gup() will not
> >>> + * be enough to make a subsequent access succeed.
> >>> + *
> >>> + * This should be called with the mm_sem held for read.
> >>> + */
> >>> +int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
> >>> + unsigned long address, unsigned int fault_flags)
> >>> +{
> >>> + struct vm_area_struct *vma;
> >>> + int ret;
> >>> +
> >>> + vma = find_extend_vma(mm, address);
> >>> + if (!vma || address< vma->vm_start)
> >>> + return -EFAULT;
> >>> +
> >>> + ret = handle_mm_fault(mm, vma, address, fault_flags);
> >>> + if (ret& VM_FAULT_ERROR) {
> >>> + if (ret& VM_FAULT_OOM)
> >>> + return -ENOMEM;
> >>> + if (ret& (VM_FAULT_HWPOISON | VM_FAULT_HWPOISON_LARGE))
> >>> + return -EHWPOISON;
> >>> + if (ret& VM_FAULT_SIGBUS)
> >>> + return -EFAULT;
> >>> + BUG();
> >>> + }
> >>> + if (tsk) {
> >>> + if (ret& VM_FAULT_MAJOR)
> >>> + tsk->maj_flt++;
> >>> + else
> >>> + tsk->min_flt++;
> >>> + }
> >>> + return 0;
> >>> +}
> >>> +
> >>> +/*
> >>> * get_user_pages() - pin user pages in memory
> >>> * @tsk: the task_struct to use for page fault accounting, or
> >>> * NULL if faults are not to be recorded.
> >>>
> >>>
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> >> the body of a message to majordomo@vger.kernel.org
> >> More majordomo info at http://vger.kernel.org/majordomo-info.html
> >> Please read the FAQ at http://www.tux.org/lkml/
> >
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply
* Re: [PATCH v2] net: filter: BPF 'JIT' compiler for PPC64
From: Matt Evans @ 2011-07-19 7:23 UTC (permalink / raw)
To: Kumar Gala; +Cc: netdev, linuxppc-dev
In-Reply-To: <CBA05A49-86F1-40FF-9244-0E4D29EBBA48@kernel.crashing.org>
On 19/07/11 17:17, Kumar Gala wrote:
>
> On Jul 19, 2011, at 2:06 AM, Matt Evans wrote:
>
>> On 19/07/11 16:59, Kumar Gala wrote:
>>>
>>> On Jul 18, 2011, at 9:13 PM, Matt Evans wrote:
>>>
>>>> [snip]
>>>>
>>>> V2: Removed some cut/paste woe in setting SEEN_X even on writes.
>>>> Merci for le review, Eric!
>>>>
>>>> arch/powerpc/Kconfig | 1 +
>>>> arch/powerpc/Makefile | 3 +-
>>>> arch/powerpc/include/asm/ppc-opcode.h | 40 ++
>>>> arch/powerpc/net/Makefile | 4 +
>>>> arch/powerpc/net/bpf_jit.S | 138 +++++++
>>>
>>> can we rename to bpf_jit_64.S, since this doesn't work on PPC32.
>>>
>>>> arch/powerpc/net/bpf_jit.h | 227 +++++++++++
>>>> arch/powerpc/net/bpf_jit_comp.c | 690 +++++++++++++++++++++++++++++++++
>>>
>>> same here, or split between bpf_jit_comp.c (shared between ppc32 & ppc64) and
>>> bpf_jit_comp_64.c
>>
>> A reasonable suggestion -- bpf_jit_64.S certainly. I think it may not be worth
>> splitting bpf_jit_comp.c until we support both tho? (I'm thinking
>> bpf_jit_comp_{32,64}.c would just house the stackframe generation code which is
>> the main difference, plus compile-time switched macros for the odd LD vs LWZ.)
>
> If its most 64-bit specific than just go with bpf_jit_comp_64.c for now. We can refactor later.
Nah, other way round -- it's almost all agnostic but with a couple of functions
that I was recommending moving out to a _64.c and _32.c later, leaving the bulk
still in bpf_jit_comp.c.
Matt
^ permalink raw reply
* Re: [PATCH v2] net: filter: BPF 'JIT' compiler for PPC64
From: Kumar Gala @ 2011-07-19 7:17 UTC (permalink / raw)
To: Matt Evans; +Cc: netdev, linuxppc-dev
In-Reply-To: <4E252CFE.4070408@ozlabs.org>
On Jul 19, 2011, at 2:06 AM, Matt Evans wrote:
> On 19/07/11 16:59, Kumar Gala wrote:
>>=20
>> On Jul 18, 2011, at 9:13 PM, Matt Evans wrote:
>>=20
>>> An implementation of a code generator for BPF programs to speed up =
packet
>>> filtering on PPC64, inspired by Eric Dumazet's x86-64 version.
>>>=20
>>> Filter code is generated as an ABI-compliant function in =
module_alloc()'d mem
>>> with stackframe & prologue/epilogue generated if required (simple =
filters don't
>>> need anything more than an li/blr). The filter's local variables, =
M[], live in
>>> registers. Supports all BPF opcodes, although "complicated" loads =
from negative
>>> packet offsets (e.g. SKF_LL_OFF) are not yet supported.
>>>=20
>>> There are a couple of further optimisations left for future work; =
many-pass
>>> assembly with branch-reach reduction and a register allocator to =
push M[]
>>> variables into volatile registers would improve the code quality =
further.
>>>=20
>>> This currently supports big-endian 64-bit PowerPC only (but is =
fairly simple
>>> to port to PPC32 or LE!).
>>>=20
>>> Enabled in the same way as x86-64:
>>>=20
>>> echo 1 > /proc/sys/net/core/bpf_jit_enable
>>>=20
>>> Or, enabled with extra debug output:
>>>=20
>>> echo 2 > /proc/sys/net/core/bpf_jit_enable
>>>=20
>>> Signed-off-by: Matt Evans <matt@ozlabs.org>
>>> ---
>>>=20
>>> V2: Removed some cut/paste woe in setting SEEN_X even on writes.
>>> Merci for le review, Eric!
>>>=20
>>> arch/powerpc/Kconfig | 1 +
>>> arch/powerpc/Makefile | 3 +-
>>> arch/powerpc/include/asm/ppc-opcode.h | 40 ++
>>> arch/powerpc/net/Makefile | 4 +
>>> arch/powerpc/net/bpf_jit.S | 138 +++++++
>>=20
>> can we rename to bpf_jit_64.S, since this doesn't work on PPC32.
>>=20
>>> arch/powerpc/net/bpf_jit.h | 227 +++++++++++
>>> arch/powerpc/net/bpf_jit_comp.c | 690 =
+++++++++++++++++++++++++++++++++
>>=20
>> same here, or split between bpf_jit_comp.c (shared between ppc32 & =
ppc64) and
>> bpf_jit_comp_64.c
>=20
> A reasonable suggestion -- bpf_jit_64.S certainly. I think it may not =
be worth
> splitting bpf_jit_comp.c until we support both tho? (I'm thinking
> bpf_jit_comp_{32,64}.c would just house the stackframe generation code =
which is
> the main difference, plus compile-time switched macros for the odd LD =
vs LWZ.)
If its most 64-bit specific than just go with bpf_jit_comp_64.c for now. =
We can refactor later.
>=20
> Sorry it's not 32bit-friendly just yet (I knew you'd ask, hehe), I've =
postponed
> that for when I get a mo :-)
:)
^ permalink raw reply
* Re: [PATCH v2] net: filter: BPF 'JIT' compiler for PPC64
From: Matt Evans @ 2011-07-19 7:06 UTC (permalink / raw)
To: Kumar Gala; +Cc: netdev, linuxppc-dev
In-Reply-To: <51978BAA-10A1-483D-B551-CCC2B69C72EA@kernel.crashing.org>
On 19/07/11 16:59, Kumar Gala wrote:
>
> On Jul 18, 2011, at 9:13 PM, Matt Evans wrote:
>
>> An implementation of a code generator for BPF programs to speed up packet
>> filtering on PPC64, inspired by Eric Dumazet's x86-64 version.
>>
>> Filter code is generated as an ABI-compliant function in module_alloc()'d mem
>> with stackframe & prologue/epilogue generated if required (simple filters don't
>> need anything more than an li/blr). The filter's local variables, M[], live in
>> registers. Supports all BPF opcodes, although "complicated" loads from negative
>> packet offsets (e.g. SKF_LL_OFF) are not yet supported.
>>
>> There are a couple of further optimisations left for future work; many-pass
>> assembly with branch-reach reduction and a register allocator to push M[]
>> variables into volatile registers would improve the code quality further.
>>
>> This currently supports big-endian 64-bit PowerPC only (but is fairly simple
>> to port to PPC32 or LE!).
>>
>> Enabled in the same way as x86-64:
>>
>> echo 1 > /proc/sys/net/core/bpf_jit_enable
>>
>> Or, enabled with extra debug output:
>>
>> echo 2 > /proc/sys/net/core/bpf_jit_enable
>>
>> Signed-off-by: Matt Evans <matt@ozlabs.org>
>> ---
>>
>> V2: Removed some cut/paste woe in setting SEEN_X even on writes.
>> Merci for le review, Eric!
>>
>> arch/powerpc/Kconfig | 1 +
>> arch/powerpc/Makefile | 3 +-
>> arch/powerpc/include/asm/ppc-opcode.h | 40 ++
>> arch/powerpc/net/Makefile | 4 +
>> arch/powerpc/net/bpf_jit.S | 138 +++++++
>
> can we rename to bpf_jit_64.S, since this doesn't work on PPC32.
>
>> arch/powerpc/net/bpf_jit.h | 227 +++++++++++
>> arch/powerpc/net/bpf_jit_comp.c | 690 +++++++++++++++++++++++++++++++++
>
> same here, or split between bpf_jit_comp.c (shared between ppc32 & ppc64) and
> bpf_jit_comp_64.c
A reasonable suggestion -- bpf_jit_64.S certainly. I think it may not be worth
splitting bpf_jit_comp.c until we support both tho? (I'm thinking
bpf_jit_comp_{32,64}.c would just house the stackframe generation code which is
the main difference, plus compile-time switched macros for the odd LD vs LWZ.)
Sorry it's not 32bit-friendly just yet (I knew you'd ask, hehe), I've postponed
that for when I get a mo :-)
Cheers,
Matt
^ permalink raw reply
* Re: [PATCH v2] net: filter: BPF 'JIT' compiler for PPC64
From: Kumar Gala @ 2011-07-19 6:59 UTC (permalink / raw)
To: Matt Evans; +Cc: netdev, linuxppc-dev
In-Reply-To: <4E24E867.9050909@ozlabs.org>
On Jul 18, 2011, at 9:13 PM, Matt Evans wrote:
> An implementation of a code generator for BPF programs to speed up =
packet
> filtering on PPC64, inspired by Eric Dumazet's x86-64 version.
>=20
> Filter code is generated as an ABI-compliant function in =
module_alloc()'d mem
> with stackframe & prologue/epilogue generated if required (simple =
filters don't
> need anything more than an li/blr). The filter's local variables, =
M[], live in
> registers. Supports all BPF opcodes, although "complicated" loads =
from negative
> packet offsets (e.g. SKF_LL_OFF) are not yet supported.
>=20
> There are a couple of further optimisations left for future work; =
many-pass
> assembly with branch-reach reduction and a register allocator to push =
M[]
> variables into volatile registers would improve the code quality =
further.
>=20
> This currently supports big-endian 64-bit PowerPC only (but is fairly =
simple
> to port to PPC32 or LE!).
>=20
> Enabled in the same way as x86-64:
>=20
> echo 1 > /proc/sys/net/core/bpf_jit_enable
>=20
> Or, enabled with extra debug output:
>=20
> echo 2 > /proc/sys/net/core/bpf_jit_enable
>=20
> Signed-off-by: Matt Evans <matt@ozlabs.org>
> ---
>=20
> V2: Removed some cut/paste woe in setting SEEN_X even on writes.
> Merci for le review, Eric!
>=20
> arch/powerpc/Kconfig | 1 +
> arch/powerpc/Makefile | 3 +-
> arch/powerpc/include/asm/ppc-opcode.h | 40 ++
> arch/powerpc/net/Makefile | 4 +
> arch/powerpc/net/bpf_jit.S | 138 +++++++
can we rename to bpf_jit_64.S, since this doesn't work on PPC32.
> arch/powerpc/net/bpf_jit.h | 227 +++++++++++
> arch/powerpc/net/bpf_jit_comp.c | 690 =
+++++++++++++++++++++++++++++++++
same here, or split between bpf_jit_comp.c (shared between ppc32 & =
ppc64) and bpf_jit_comp_64.c
- k
^ permalink raw reply
* Re: [PATCH v2] net: filter: BPF 'JIT' compiler for PPC64
From: Eric Dumazet @ 2011-07-19 6:51 UTC (permalink / raw)
To: Matt Evans; +Cc: netdev, linuxppc-dev
In-Reply-To: <4E24E867.9050909@ozlabs.org>
Le mardi 19 juillet 2011 à 12:13 +1000, Matt Evans a écrit :
> An implementation of a code generator for BPF programs to speed up packet
> filtering on PPC64, inspired by Eric Dumazet's x86-64 version.
>
> Filter code is generated as an ABI-compliant function in module_alloc()'d mem
> with stackframe & prologue/epilogue generated if required (simple filters don't
> need anything more than an li/blr). The filter's local variables, M[], live in
> registers. Supports all BPF opcodes, although "complicated" loads from negative
> packet offsets (e.g. SKF_LL_OFF) are not yet supported.
>
> There are a couple of further optimisations left for future work; many-pass
> assembly with branch-reach reduction and a register allocator to push M[]
> variables into volatile registers would improve the code quality further.
>
> This currently supports big-endian 64-bit PowerPC only (but is fairly simple
> to port to PPC32 or LE!).
>
> Enabled in the same way as x86-64:
>
> echo 1 > /proc/sys/net/core/bpf_jit_enable
>
> Or, enabled with extra debug output:
>
> echo 2 > /proc/sys/net/core/bpf_jit_enable
>
> Signed-off-by: Matt Evans <matt@ozlabs.org>
> ---
>
> V2: Removed some cut/paste woe in setting SEEN_X even on writes.
> Merci for le review, Eric!
>
> arch/powerpc/Kconfig | 1 +
> arch/powerpc/Makefile | 3 +-
> arch/powerpc/include/asm/ppc-opcode.h | 40 ++
> arch/powerpc/net/Makefile | 4 +
> arch/powerpc/net/bpf_jit.S | 138 +++++++
> arch/powerpc/net/bpf_jit.h | 227 +++++++++++
> arch/powerpc/net/bpf_jit_comp.c | 690 +++++++++++++++++++++++++++++++++
> 7 files changed, 1102 insertions(+), 1 deletions(-)
>
> + case BPF_S_ANC_CPU:
> +#ifdef CONFIG_SMP
> + /*
> + * PACA ptr is r13:
> + * raw_smp_processor_id() = local_paca->paca_index
> + */
This could break if one day linux supports more than 65536 cpus :)
> + PPC_LHZ_OFFS(r_A, 13,
> + offsetof(struct paca_struct, paca_index));
> +#else
> + PPC_LI(r_A, 0);
> +#endif
> + break;
> +
> +
> + case BPF_S_LDX_B_MSH:
> + /*
> + * x86 version drops packet (RET 0) when K<0, whereas
> + * interpreter does allow K<0 (__load_pointer, special
> + * ancillary data).
> + */
Hmm, thanks I'll take a look at this.
> + func = sk_load_byte_msh;
> + goto common_load;
> + break;
> +
> + /*** Jump and branches ***/
> + default:
> + /* The filter contains something cruel & unusual.
> + * We don't handle it, but also there shouldn't be
> + * anything missing from our list.
> + */
> + pr_err("BPF filter opcode %04x (@%d) unsupported\n",
> + filter[i].code, i);
You should at least ratelimit this message ?
On x86_64 I chose to silently fall back to interpretor for a "complex
filter" or "unsupported opcode".
> + return -ENOTSUPP;
> + }
> +
> + }
> + /* Set end-of-body-code address for exit. */
> + addrs[i] = ctx->idx * 4;
> +
> + return 0;
> +}
> +
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox