Move Cell platform code to arch/powerpc
Subsystems (2)
RFC PATCH 1/1 Move Cell platform code to arch/powerpc
Move all files from arch/ppc64/kernel/bpa_* to arch/powerpc/platforms/cell,
I would like to see a patch like this go into 2.6.14, for multiple reasons:
- The marketing folks have changed the names and we are no longer supposed to refer to Cell as 'BPA' or 'Broadband Processor Architecture'. The platform is officially known as 'Cell Broadband Engine Architecture', while the CPU is the 'Cell Broadband Engine'.
- We are now moving all platforms into arch/powerpc/platforms and someone has to start so we get a template for the other architectures to follow.
- It would be a big mess for me to maintain my own patches on top of file names that are different from mainline during the 2.6.14 freeze.
My impression is that Cell is a good target for moving first, because I have to move it anyway and the number of users is extremely low, so it doesn't cause too much harm if we screw up. What thing that makes moving Cell relatively easy is that it only supports 64 bit and only a single hardware configuration so far.
I have tested this a bit on Cell and also done compile-only test for the other platforms, but it doesn't really make any changes to the code itself.
Please comment on wether this is what everybody like the merge process be like.
--
arch/powerpc/platforms/cell/Makefile | 1 arch/ppc64/kernel/Makefile | 5 arch/powerpc/platforms/cell/pic.c | 269 ++++++++++++++++++++++ arch/ppc64/kernel/bpa_iic.c | 270 ---------------------- include/asm-powerpc/cell-pic.h | 62 +++++ arch/ppc64/kernel/bpa_iic.h | 62 ----- arch/powerpc/platforms/cell/iommu.c | 377 +++++++++++++++++++++++++++++++ arch/ppc64/kernel/bpa_iommu.c | 377 ------------------------------- arch/powerpc/platforms/cell/iommu.h | 65 +++++ arch/ppc64/kernel/bpa_iommu.h | 65 ----- arch/powerpc/platforms/cell/nvram.c | 118 +++++++++ arch/ppc64/kernel/bpa_nvram.c | 118 --------- arch/powerpc/platforms/cell/setup.c | 138 +++++++++++ arch/ppc64/kernel/bpa_setup.c | 140 ----------- arch/powerpc/platforms/cell/spider-pic.c | 190 +++++++++++++++ arch/ppc64/kernel/spider-pic.c | 191 --------------- arch/ppc64/Kconfig | 10 arch/ppc64/kernel/cpu_setup_power4.S | 2 arch/ppc64/kernel/cputable.c | 6 arch/ppc64/kernel/irq.c | 2 arch/ppc64/kernel/pSeries_smp.c | 4 arch/ppc64/kernel/setup.c | 8 arch/ppc64/kernel/traps.c | 4 include/asm-ppc64/nvram.h | 2 include/asm-ppc64/processor.h | 7 25 files changed, 1248 insertions(+), 1245 deletions(-)
arch/powerpc/platforms/cell/Makefile +1 -0
@@ -0,0 +1 @@ +obj-y += iommu.o nvram.o setup.o pic.o spider-pic.o
arch/powerpc/platforms/cell/iommu.c +377 -0
377 lines not on this page · raw message
arch/powerpc/platforms/cell/iommu.h +65 -0
65 lines not on this page · raw message
arch/powerpc/platforms/cell/nvram.c +118 -0
118 lines not on this page · raw message
arch/powerpc/platforms/cell/pic.c +269 -0
269 lines not on this page · raw message
arch/powerpc/platforms/cell/setup.c +138 -0
138 lines not on this page · raw message
arch/powerpc/platforms/cell/spider-pic.c +190 -0
190 lines not on this page · raw message
arch/ppc64/Kconfig +8 -2
@@ -77,10 +77,16 @@ config PPC_PSERIES bool " IBM pSeries & new iSeries" default y -config PPC_BPA - bool " Broadband Processor Architecture" +config PPC_CELL + bool " Cell Broadband Engine Architecture" depends on PPC_MULTIPLATFORM +# This is being phased out in the move to arch/powerpc +config PPC_BPA + bool + default y + depends on PPC_CELL + config PPC_PMAC depends on PPC_MULTIPLATFORM bool " Apple G5 based machines"
arch/ppc64/kernel/Makefile +2 -3
@@ -33,8 +33,7 @@ obj-$(CONFIG_PPC_PSERIES) += pSeries_pci pSeries_nvram.o rtasd.o ras.o pSeries_reconfig.o \ pSeries_setup.o pSeries_iommu.o -obj-$(CONFIG_PPC_BPA) += bpa_setup.o bpa_iommu.o bpa_nvram.o \ - bpa_iic.o spider-pic.o +obj-$(CONFIG_PPC_CELL) += ../../powerpc/platforms/cell/ obj-$(CONFIG_KEXEC) += machine_kexec.o obj-$(CONFIG_EEH) += eeh.o
@@ -68,7 +67,7 @@ ifdef CONFIG_SMP obj-$(CONFIG_PPC_PMAC) += pmac_smp.o smp-tbsync.o obj-$(CONFIG_PPC_ISERIES) += iSeries_smp.o obj-$(CONFIG_PPC_PSERIES) += pSeries_smp.o -obj-$(CONFIG_PPC_BPA) += pSeries_smp.o +obj-$(CONFIG_PPC_CELL) += pSeries_smp.o obj-$(CONFIG_PPC_MAPLE) += smp-tbsync.o endif
arch/ppc64/kernel/bpa_iic.c +0 -270
270 lines not on this page · raw message
arch/ppc64/kernel/bpa_iic.h +0 -62
62 lines not on this page · raw message
arch/ppc64/kernel/bpa_iommu.c +0 -377
377 lines not on this page · raw message
arch/ppc64/kernel/bpa_iommu.h +0 -65
65 lines not on this page · raw message
arch/ppc64/kernel/bpa_nvram.c +0 -118
118 lines not on this page · raw message
arch/ppc64/kernel/bpa_setup.c +0 -140
140 lines not on this page · raw message
arch/ppc64/kernel/cpu_setup_power4.S +1 -1
@@ -77,7 +77,7 @@ _GLOBAL(__970_cpu_preinit) _GLOBAL(__setup_cpu_power4) blr -_GLOBAL(__setup_cpu_be) +_GLOBAL(__setup_cpu_cbe) /* Set large page sizes LP=0: 16MB, LP=1: 64KB */ addi r3, 0, 0 ori r3, r3, HID6_LB
arch/ppc64/kernel/cputable.c +3 -3
@@ -34,7 +34,7 @@ EXPORT_SYMBOL(cur_cpu_spec);extern void __setup_cpu_power3 (unsigned long offset,struct cpu_spec * spec);extern void __setup_cpu_power4 (unsigned long offset,struct cpu_spec * spec);extern void __setup_cpu_ppc970 (unsigned long offset,struct cpu_spec * spec); -extern void __setup_cpu_be (unsigned long offset,struct cpu_spec * spec); +extern void __setup_cpu_cbe (unsigned long offset,struct cpu_spec * spec);/* We only set the altivec features if the kernel was compiled with altivec
@@ -218,7 +218,7 @@ struct cpu_spec cpu_specs[] = { {/* BE DD1.x */ .pvr_mask = 0xffff0000, .pvr_value = 0x00700000, - .cpu_name = "Broadband Engine", + .cpu_name = "Cell Broadband Engine", .cpu_features =CPU_FTR_SPLIT_ID_CACHE |CPU_FTR_USE_TB |CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP |
@@ -227,7 +227,7 @@ struct cpu_spec cpu_specs[] = { PPC_FEATURE_HAS_ALTIVEC_COMP, .icache_bsize = 128, .dcache_bsize = 128, - .cpu_setup = __setup_cpu_be, + .cpu_setup = __setup_cpu_cbe, }, { /* default match */ .pvr_mask = 0x00000000,
arch/ppc64/kernel/irq.c +1 -1
@@ -392,7 +392,7 @@ int virt_irq_create_mapping(unsigned intif (ppc64_interrupt_controller ==IC_OPEN_PIC )return real_irq;/* no mapping for openpic (for now) */ -if (ppc64_interrupt_controller ==IC_BPA_IIC ) +if (ppc64_interrupt_controller ==IC_CELL_PIC )return real_irq;/* no mapping for iic either */ /* don't map interrupts < MIN_VIRT_IRQ */
arch/ppc64/kernel/pSeries_smp.c +2 -2
@@ -40,6 +40,7 @@#include <asm/time.h> #include <asm/machdep.h> #include <asm/xics.h> +#include <asm/cell-pic.h> #include <asm/cputable.h> #include <asm/firmware.h> #include <asm/system.h>
@@ -48,7 +49,6 @@#include <asm/pSeries_reconfig.h> #include "mpic.h" -#include "bpa_iic.h" #ifdef DEBUG #define DBG(fmt...) udbg_printf(fmt)
@@ -464,7 +464,7 @@ void __init smp_init_pSeries(void)break ;#endif #ifdef CONFIG_BPA_IIC -case IC_BPA_IIC : +case IC_CELL_PIC : smp_ops = &bpa_iic_smp_ops;break ;#endif
arch/ppc64/kernel/setup.c +4 -4
@@ -343,7 +343,7 @@ static void __init setup_cpu_maps(void)extern struct machdep_calls pSeries_md;extern struct machdep_calls pmac_md;extern struct machdep_calls maple_md; -extern struct machdep_calls bpa_md; +extern struct machdep_calls cell_md;/* Ultimately, stuff them in an elf section like initcalls... */ static struct machdep_calls __initdata *machines[] = {
@@ -356,9 +356,9 @@ static struct machdep_calls __initdata *#ifdef CONFIG_PPC_MAPLE &maple_md,#endif /* CONFIG_PPC_MAPLE */ -#ifdef CONFIG_PPC_BPA - &bpa_md, -#endif +#ifdef CONFIG_PPC_CELL + &cell_md, +#endif /* CONFIG_PPC_CELL */NULL };
arch/ppc64/kernel/spider-pic.c +0 -191
191 lines not on this page · raw message
arch/ppc64/kernel/traps.c +2 -2
@@ -126,8 +126,8 @@ int die(const char *str, struct pt_regsprintk ("POWERMAC " ); nl =1 ;break ; -case PLATFORM_BPA : -printk ("BPA " ); +case PLATFORM_CELL : +printk ("CBEA " ); nl =1 ;break ; }
include/asm-powerpc/cell-pic.h +62 -0
62 lines not on this page · raw message
include/asm-ppc64/nvram.h +1 -1
@@ -70,7 +70,7 @@ extern struct nvram_partition *nvram_finextern int pSeries_nvram_init (void );extern int pmac_nvram_init (void ); -extern int bpa_nvram_init (void ); +extern int cell_nvram_init (void );/* PowerMac specific nvram stuffs */
include/asm-ppc64/processor.h +4 -3
@@ -269,7 +269,7 @@#define PV_630 0x0040#define PV_630p 0x0041#define PV_970MP 0x0044 -#define PV_BE 0x0070 +#define PV_CBE 0x0070/* Platforms supported by PPC64 */ #define PLATFORM_PSERIES 0x0100
@@ -278,7 +278,8 @@#define PLATFORM_LPAR 0x0001#define PLATFORM_POWERMAC 0x0400#define PLATFORM_MAPLE 0x0500 -#define PLATFORM_BPA 0x1000 +#define PLATFORM_CELL 0x1000 +#define PLATFORM_BPA PLATFORM_CELL/* Compatibility with drivers coming from PPC32 world */ #define _machine (systemcfg->platform)
@@ -290,7 +291,7 @@#define IC_INVALID 0#define IC_OPEN_PIC 1#define IC_PPC_XIC 2 -#define IC_BPA_IIC 3 +#define IC_CELL_PIC 3#define XGLUE (a,b) a##b#define GLUE (a,b) XGLUE(a,b)
Quoted 26 lines · Arnd Bergmann
Move all files from
arch/ppc64/kernel/bpa_*toarch/powerpc/platforms/cell,I would like to see a patch like this go into 2.6.14, for multiple reasons:
- The marketing folks have changed the names and we are no longer supposed
to refer to Cell as 'BPA' or 'Broadband Processor Architecture'. The platform is officially known as 'Cell Broadband Engine
Architecture',
while the CPU is the 'Cell Broadband Engine'.- We are now moving all platforms into
arch/powerpc/platformsand someone
has to start so we get a template for the other architectures to
follow.- It would be a big mess for me to maintain my own patches on top of file
names that are different from mainline during the 2.6.14 freeze.My impression is that Cell is a good target for moving first, because I have to move it anyway and the number of users is extremely low, so it doesn't cause too much harm if we screw up. What thing that makes moving Cell relatively easy is that it only supports 64 bit and only a single hardware configuration so far.
Quoted 5 lines
I have tested this a bit on Cell and also done compile-only test for the other platforms, but it doesn't really make any changes to the code itself.
Please comment on wether this is what everybody like the merge process be like.
I'm not 100% sure if this is the right time for introducing a platform into arch/powerpc. My concern is around that fact that we have not tried to move any "code" from arch/ppc or arch/ppc64 into arch/powerpc and so havent figured out how we are going to do that will not breaking arch/ppc & arch/ppc64. By introducing cell this way we create a dependency between ppc64 and powerpc that might constrain decisions we want to make.
Quoted 19 lines
Signed-off-by Arnd Bergmann <[email protected]>--
arch/powerpc/platforms/cell/Makefile | 1 arch/ppc64/kernel/Makefile | 5 arch/powerpc/platforms/cell/pic.c | 269 +++++++++++++++++++ +++ arch/ppc64/kernel/bpa_iic.c | 270 ---------------------- include/asm-powerpc/cell-pic.h | 62 +++++ arch/ppc64/kernel/bpa_iic.h | 62 ----- arch/powerpc/platforms/cell/iommu.c | 377 +++++++++++++++++++ ++++++++++++ arch/ppc64/kernel/bpa_iommu.c | 377 ------------------------------- arch/powerpc/platforms/cell/iommu.h | 65 +++++ arch/ppc64/kernel/bpa_iommu.h | 65 ----- arch/powerpc/platforms/cell/nvram.c | 118 +++++++++ arch/ppc64/kernel/bpa_nvram.c | 118 ---------
Should pic, iommu, and nvram really be in arch/powerpc/sysdev/
Also, since your renaming things any chance there is a better name for iic? (just wondering since its way to similar to what some people use for I2C).
Quoted 14 lines
arch/powerpc/platforms/cell/setup.c | 138 +++++++++++ arch/ppc64/kernel/bpa_setup.c | 140 ----------- arch/powerpc/platforms/cell/spider-pic.c | 190 +++++++++++++++ arch/ppc64/kernel/spider-pic.c | 191 --------------- arch/ppc64/Kconfig | 10 arch/ppc64/kernel/cpu_setup_power4.S | 2 arch/ppc64/kernel/cputable.c | 6 arch/ppc64/kernel/irq.c | 2 arch/ppc64/kernel/pSeries_smp.c | 4 arch/ppc64/kernel/setup.c | 8 arch/ppc64/kernel/traps.c | 4 include/asm-ppc64/nvram.h | 2 include/asm-ppc64/processor.h | 7 25 files changed, 1248 insertions(+), 1245 deletions(-)
Quoted 7 lines · Kumar Gala
I'm not 100% sure if this is the right time for introducing a platform into
arch/powerpc. My concern is around that fact that we have not tried to move any "code" fromarch/ppcorarch/ppc64intoarch/powerpcand so havent figured out how we are going to do that will not breakingarch/ppc&arch/ppc64. By introducing cell this way we create a dependency between ppc64 and powerpc that might constrain decisions we want to make.
I understand that there are good reasons for merging all the headers first and only then start with the architecture code, that also was my idea at first.
At least from the Kbuild side, it should not cause trouble to refer to different architecture directories from arch/ppc64/kernel/Makefile, that does not introduce any strong dependency.
For the code itself, we probably need to make substantial changes at some point, e.g. when we merge arch/powerpc/kernel/setup.c. However, I don't think it makes much difference wether that is done while the code resides in arch/ppc64 or arch/powerpc.
Quoted 16 lines
Quoted 15 lines
Signed-off-by Arnd Bergmann <[email protected]>--
arch/powerpc/platforms/cell/Makefile | 1 arch/ppc64/kernel/Makefile | 5 arch/powerpc/platforms/cell/pic.c | 269 ++++++++++++++++++++++ arch/ppc64/kernel/bpa_iic.c | 270 ---------------------- include/asm-powerpc/cell-pic.h | 62 +++++ arch/ppc64/kernel/bpa_iic.h | 62 ----- arch/powerpc/platforms/cell/iommu.c | 377 +++++++++++++++++++++++++++++++ arch/ppc64/kernel/bpa_iommu.c | 377 ------------------------------- arch/powerpc/platforms/cell/iommu.h | 65 +++++ arch/ppc64/kernel/bpa_iommu.h | 65 ----- arch/powerpc/platforms/cell/nvram.c | 118 +++++++++ arch/ppc64/kernel/bpa_nvram.c | 118 ---------
Quoted 1 line
Should pic, iommu, and nvram really be in
arch/powerpc/sysdev/
The pic and iommu are defined in the CBE Architecture documents and different from all others, so I would prefer to keep them here. Both the internal interrupt controller (IIC) and the IO page tables are part of the CPU itself, so you will always see them together with Cell based hardware.
For nvram, you are probably right that it belongs to a more generic place, as I just wrote in my reply to Murali.
With regard to the arch/powerpc/sysdev/ location for putting the drivers, I'm not sure if we should first find a better definition of what goes in there. I remember that some people did not like the current split between arch/ppc/kernel and arch/ppc/syslib.
Do you think of arch/powerpc/sysdev/ as a different thing from the current syslib (e.g. stuff using include/linux/sysdev.h), or just a different name for the same thing?
Quoted 3 lines
Also, since your renaming things any chance there is a better name for iic? (just wondering since its way to similar to what some people use for I2C).
Yes, Ben has expressed the same concern to me, therefore I have renamed the file to 'pic' instead of 'iic'. However, the architecture is very specifically calling it IIC, so my idea was to keep the identifiers with that name, hoping that this does not cause trouble when the files are clearly marked as belonging to one specific platform.
If you have a better idea for naming it, I can change it of course.
Arnd <><