powerpc/85xx: introduce corenet_generic machine
Subsystems (2)
v2 cover powerpc/85xx: introduce corenet_generic machine
v2:
- Fold the original patch 2 into patch 1.
- Update the patch 1 according to Scott and Kumar's comments.
- Introduce a new patch to rename the corenet_ds.c to corenet_generic.c.
v1:
This patch series introduces a common machine to support p2041rdb, p3041ds, p4080ds, p5020ds, p5040ds, t4240qds and b4qds to avoid the code duplication. Boot test on p5020ds and p4080ds.
Kevin Hao (2):
powerpc/85xx: introduce corenet_generic machine powerpc/85xx: rename the corenet_ds.c to corenet_generic.c
arch/powerpc/platforms/85xx/Kconfig | 10 ++ arch/powerpc/platforms/85xx/Makefile | 8 +- arch/powerpc/platforms/85xx/b4_qds.c | 97 -------------- arch/powerpc/platforms/85xx/corenet_ds.c | 96 -------------- arch/powerpc/platforms/85xx/corenet_ds.h | 19 --- arch/powerpc/platforms/85xx/corenet_generic.c | 182 ++++++++++++++++++++++++++ arch/powerpc/platforms/85xx/p2041_rdb.c | 87 ------------ arch/powerpc/platforms/85xx/p3041_ds.c | 89 ------------- arch/powerpc/platforms/85xx/p4080_ds.c | 87 ------------ arch/powerpc/platforms/85xx/p5020_ds.c | 93 ------------- arch/powerpc/platforms/85xx/p5040_ds.c | 84 ------------ arch/powerpc/platforms/85xx/t4240_qds.c | 93 ------------- 12 files changed, 193 insertions(+), 752 deletions(-) delete mode 100644 arch/powerpc/platforms/85xx/b4_qds.c delete mode 100644 arch/powerpc/platforms/85xx/corenet_ds.c delete mode 100644 arch/powerpc/platforms/85xx/corenet_ds.h create mode 100644 arch/powerpc/platforms/85xx/corenet_generic.c delete mode 100644 arch/powerpc/platforms/85xx/p2041_rdb.c delete mode 100644 arch/powerpc/platforms/85xx/p3041_ds.c delete mode 100644 arch/powerpc/platforms/85xx/p4080_ds.c delete mode 100644 arch/powerpc/platforms/85xx/p5020_ds.c delete mode 100644 arch/powerpc/platforms/85xx/p5040_ds.c delete mode 100644 arch/powerpc/platforms/85xx/t4240_qds.c
Signature · 1 line
1.8.3.1
PATCH v2 1/2 powerpc/85xx: introduce corenet_generic machine
In the current kernel, the board files for p2041rdb, p3041ds, p4080ds, p5020ds, p5040ds, t4240qds and b4qds are almost the same except the machine name. So this introduces a cornet_generic machine to support all these boards to avoid the code duplication.
With these changes the file corenet_ds.h becomes useless. Just delete it.
---
v2:
- Fix the typo in subject.
- Fold the original patch 2 into this one.
- Change the machine name from "CORENET GENERIC" to "CORENET Generic".
v1:
- This patch is based on http://patchwork.ozlabs.org/patch/274390/
arch/powerpc/platforms/85xx/Kconfig | 10 ++++ arch/powerpc/platforms/85xx/Makefile | 8 +-- arch/powerpc/platforms/85xx/b4_qds.c | 97 -------------------------------- arch/powerpc/platforms/85xx/corenet_ds.c | 86 ++++++++++++++++++++++++++++ arch/powerpc/platforms/85xx/corenet_ds.h | 19 ------- arch/powerpc/platforms/85xx/p2041_rdb.c | 87 ---------------------------- arch/powerpc/platforms/85xx/p3041_ds.c | 89 ----------------------------- arch/powerpc/platforms/85xx/p4080_ds.c | 87 ---------------------------- arch/powerpc/platforms/85xx/p5020_ds.c | 93 ------------------------------ arch/powerpc/platforms/85xx/p5040_ds.c | 84 --------------------------- arch/powerpc/platforms/85xx/t4240_qds.c | 93 ------------------------------ 11 files changed, 97 insertions(+), 656 deletions(-) delete mode 100644 arch/powerpc/platforms/85xx/b4_qds.c delete mode 100644 arch/powerpc/platforms/85xx/corenet_ds.h delete mode 100644 arch/powerpc/platforms/85xx/p2041_rdb.c delete mode 100644 arch/powerpc/platforms/85xx/p3041_ds.c delete mode 100644 arch/powerpc/platforms/85xx/p4080_ds.c delete mode 100644 arch/powerpc/platforms/85xx/p5020_ds.c delete mode 100644 arch/powerpc/platforms/85xx/p5040_ds.c delete mode 100644 arch/powerpc/platforms/85xx/t4240_qds.c
arch/powerpc/platforms/85xx/Kconfig +10 -0
@@ -228,6 +228,7 @@ config P2041_RDB select GPIO_MPC8XXX select HAS_RAPIDIO select PPC_EPAPR_HV_PIC + select CORENET_GENERIC help This option enables support for the P2041 RDB board
@@ -241,6 +242,7 @@ config P3041_DS select GPIO_MPC8XXX select HAS_RAPIDIO select PPC_EPAPR_HV_PIC + select CORENET_GENERIC help This option enables support for the P3041 DS board
@@ -254,6 +256,7 @@ config P4080_DS select GPIO_MPC8XXX select HAS_RAPIDIO select PPC_EPAPR_HV_PIC + select CORENET_GENERIC help This option enables support for the P4080 DS board
@@ -278,6 +281,7 @@ config P5020_DS select GPIO_MPC8XXX select HAS_RAPIDIO select PPC_EPAPR_HV_PIC + select CORENET_GENERIC help This option enables support for the P5020 DS board
@@ -292,6 +296,7 @@ config P5040_DS select GPIO_MPC8XXX select HAS_RAPIDIO select PPC_EPAPR_HV_PIC + select CORENET_GENERIC help This option enables support for the P5040 DS board
@@ -323,6 +328,7 @@ config T4240_QDS select GPIO_MPC8XXX select HAS_RAPIDIO select PPC_EPAPR_HV_PIC + select CORENET_GENERIC help This option enables support for the T4240 QDS board
@@ -337,6 +343,7 @@ config B4_QDS select ARCH_REQUIRE_GPIOLIB select HAS_RAPIDIO select PPC_EPAPR_HV_PIC + select CORENET_GENERIC help This option enables support for the B4 QDS board The B4 application development system B4 QDS is a complete
@@ -348,3 +355,6 @@ endif # FSL_SOC_BOOKE config TQM85xx bool + +config CORENET_GENERIC + bool
arch/powerpc/platforms/85xx/Makefile +1 -7
@@ -18,13 +18,7 @@ obj-$(CONFIG_P1010_RDB) += p1010rdb.o obj-$(CONFIG_P1022_DS) += p1022_ds.o obj-$(CONFIG_P1022_RDK) += p1022_rdk.o obj-$(CONFIG_P1023_RDS) += p1023_rds.o -obj-$(CONFIG_P2041_RDB) += p2041_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_P5020_DS) += p5020_ds.o corenet_ds.o -obj-$(CONFIG_P5040_DS) += p5040_ds.o corenet_ds.o -obj-$(CONFIG_T4240_QDS) += t4240_qds.o corenet_ds.o -obj-$(CONFIG_B4_QDS) += b4_qds.o corenet_ds.o +obj-$(CONFIG_CORENET_GENERIC) += corenet_ds.o obj-$(CONFIG_STX_GP3) += stx_gp3.o obj-$(CONFIG_TQM85xx) += tqm85xx.o obj-$(CONFIG_SBC8548) += sbc8548.o
arch/powerpc/platforms/85xx/b4_qds.c deleted +0 -97
97 lines not on this page · raw message
arch/powerpc/platforms/85xx/corenet_ds.c +86 -0
95 lines not on this page · raw message
arch/powerpc/platforms/85xx/corenet_ds.h deleted +0 -19
@@ -1,19 +0,0 @@ -/* -* Corenet based SoC DS Setup -* -* Copyright 2009 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 version 2 as -* published by the Free Software Foundation. -* -*/ - -#ifndef CORENET_DS_H -#define CORENET_DS_H - -extern void __init corenet_ds_pic_init (void ); -extern void __init corenet_ds_setup_arch (void ); -extern int __init corenet_ds_publish_devices (void ); - -#endif
arch/powerpc/platforms/85xx/p2041_rdb.c deleted +0 -87
87 lines not on this page · raw message
arch/powerpc/platforms/85xx/p3041_ds.c deleted +0 -89
89 lines not on this page · raw message
arch/powerpc/platforms/85xx/p4080_ds.c deleted +0 -87
87 lines not on this page · raw message
arch/powerpc/platforms/85xx/p5020_ds.c deleted +0 -93
93 lines not on this page · raw message
arch/powerpc/platforms/85xx/p5040_ds.c deleted +0 -84
84 lines not on this page · raw message
arch/powerpc/platforms/85xx/t4240_qds.c deleted +0 -93
93 lines not on this page · raw message
Signature · 1 line
1.8.3.1
Quoted 8 lines · Kevin Hao
In the current kernel, the board files for p2041rdb, p3041ds, p4080ds, p5020ds, p5040ds, t4240qds and b4qds are almost the same except the machine name. So this introduces a
cornet_genericmachine to support all these boards to avoid the code duplication.With these changes the file
corenet_ds.hbecomes useless. Just delete it.
Quoted 6 lines
Signed-off-by Kevin Hao <[email protected]>---
v2:
- Fix the typo in subject.
- Fold the original patch 2 into this one.
- Change the machine name from "CORENET GENERIC" to "CORENET Generic".
CoreNet shouldn't be allcaps either.
Quoted 21 lines
arch/powerpc/platforms/85xx/Kconfig +2
-0@@ -228,6 +228,7 @@ config P2041_RDB select GPIO_MPC8XXX select HAS_RAPIDIO select PPC_EPAPR_HV_PIC + select CORENET_GENERIC help This option enables support for the P2041 RDB board@@ -241,6 +242,7 @@ config P3041_DS select GPIO_MPC8XXX select HAS_RAPIDIO select PPC_EPAPR_HV_PIC + select CORENET_GENERIC help This option enables support for the P3041 DS board
arch/powerpc/platforms/85xx/Kconfig config P4080_DS · line 261
Quoted 6 lines
arch/powerpc/platforms/85xx/Kconfig +1
-0@@ -254,6 +256,7 @@ config P4080_DS select GPIO_MPC8XXX select HAS_RAPIDIO select PPC_EPAPR_HV_PIC + select CORENET_GENERIC help This option enables support for the P4080 DS board
As discussed earlier, I'd prefer if this were combined into one kconfig option. The help text can list boards that are known to work with it.
-Scott
Quoted 9 lines · Scott Wood
Quoted 8 lines · Kevin Hao
In the current kernel, the board files for p2041rdb, p3041ds, p4080ds, p5020ds, p5040ds, t4240qds and b4qds are almost the same except the machine name. So this introduces a
cornet_genericmachine to support all these boards to avoid the code duplication.With these changes the file
corenet_ds.hbecomes useless. Just delete it.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Kevin Hao <[email protected]>---
v2:
- Fix the typo in subject.
- Fold the original patch 2 into this one.
- Change the machine name from "CORENET GENERIC" to "CORENET Generic".CoreNet shouldn't be allcaps either.
OK. Will change it to "CoreNet Generic".
Quoted 21 lines
Quoted 21 lines
arch/powerpc/platforms/85xx/Kconfig +2
-0@@ -228,6 +228,7 @@ config P2041_RDB select GPIO_MPC8XXX select HAS_RAPIDIO select PPC_EPAPR_HV_PIC + select CORENET_GENERIC help This option enables support for the P2041 RDB board@@ -241,6 +242,7 @@ config P3041_DS select GPIO_MPC8XXX select HAS_RAPIDIO select PPC_EPAPR_HV_PIC + select CORENET_GENERIC help This option enables support for the P3041 DS board
Quoted 10 lines
arch/powerpc/platforms/85xx/Kconfig config P4080_DS · line 261
Quoted 7 lines
arch/powerpc/platforms/85xx/Kconfig +1
-0@@ -254,6 +256,7 @@ config P4080_DS select GPIO_MPC8XXX select HAS_RAPIDIO select PPC_EPAPR_HV_PIC + select CORENET_GENERIC help This option enables support for the P4080 DS boardAs discussed earlier, I'd prefer if this were combined into one kconfig option. The help text can list boards that are known to work with it.
OK, will do.
Thanks,
Kevin
Quoted 5 lines
-Scott
PATCH v2 2/2 powerpc/85xx: rename the corenet_ds.c to corenet_generic.c
In reply to Kevin HaoThis file is also used by some RDB and QDS boards. So the name seems not so accurate. Rename it to corenet_generic.c. Also update the function names in this file according to the change.
---
A new patch in v2.
arch/powerpc/platforms/85xx/Makefile | 2 +-
.../platforms/85xx/{corenet_ds.c => corenet_generic.c} | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
rename arch/powerpc/platforms/85xx/{corenet_ds.c => corenet_generic.c} (93%)arch/powerpc/platforms/85xx/Makefile +1 -1
@@ -18,7 +18,7 @@ obj-$(CONFIG_P1010_RDB) += p1010rdb.o obj-$(CONFIG_P1022_DS) += p1022_ds.o obj-$(CONFIG_P1022_RDK) += p1022_rdk.o obj-$(CONFIG_P1023_RDS) += p1023_rds.o -obj-$(CONFIG_CORENET_GENERIC) += corenet_ds.o +obj-$(CONFIG_CORENET_GENERIC) += corenet_generic.o obj-$(CONFIG_STX_GP3) += stx_gp3.o obj-$(CONFIG_TQM85xx) += tqm85xx.o obj-$(CONFIG_SBC8548) += sbc8548.o
arch/powerpc/platforms/85xx/corenet_generic.c renamed from arch/powerpc/platforms/85xx/corenet_ds.c +6 -6
@@ -32,7 +32,7 @@#include <sysdev/fsl_pci.h> #include "smp.h" -void __init corenet_ds_pic_init (void ) +void __init corenet_gen_pic_init (void ) {struct mpic *mpic; unsigned int flags = MPIC_BIG_ENDIAN | MPIC_SINGLE_DEST_CPU |
@@ -50,7 +50,7 @@ void __init corenet_ds_pic_init(void)/* * Setup the architecture */ -void __init corenet_ds_setup_arch (void ) +void __init corenet_gen_setup_arch (void ) {mpc85xx_smp_init ();
@@ -91,7 +91,7 @@ static const struct of_device_id of_device_ids[] = { {} }; -int __init corenet_ds_publish_devices (void ) +int __init corenet_gen_publish_devices (void ) {return of_platform_bus_probe (NULL , of_device_ids,NULL ); }
@@ -159,8 +159,8 @@ static int __init corenet_generic_probe(void)define_machine (corenet_generic) { .name = "CORENET Generic", .probe = corenet_generic_probe, - .setup_arch = corenet_ds_setup_arch, - .init_IRQ = corenet_ds_pic_init, + .setup_arch = corenet_gen_setup_arch, + .init_IRQ = corenet_gen_pic_init, #ifdef CONFIG_PCI .pcibios_fixup_bus = fsl_pcibios_fixup_bus, #endif
@@ -175,7 +175,7 @@ define_machine(corenet_generic) {#endif }; -machine_arch_initcall (corenet_generic, corenet_ds_publish_devices); +machine_arch_initcall (corenet_generic, corenet_gen_publish_devices);#ifdef CONFIG_SWIOTLB machine_arch_initcall (corenet_generic, swiotlb_setup_bus_notifier);
Signature · 1 line
1.8.3.1