updated 440SPe support
cover updated 440SPe support
Here is an updated series of patches that add basic support for AMCC's PowerPC 440SPe SoC. With these patches, the kernel will boot and run on the "Yucca" 440SPe eval board, with ethernet, serial and PCI Express in root port mode working (tested with an InfiniBand HCA, naturally ;).
Since my last posting, I've fixed a few bugs (UIC3 interrupt handling being the most notable fix) and implemented basic PCI Express support. I left out the changes required for the old ibm_emac ethernet driver, since I'm assuming Eugene's new driver will be merged, and his tree already has 440SPe support.
I now have all the features I need for the project I'm working on, so I don't expect to be adding much to my port. I will do whatever cleanup, bugfixing and integration is required to get this merged upstream. It looks like 2.6.15 will be opening up soon, so please let me know if there's anything I can do to make merging easier.
I also have a git tree based on Eugene Surovegin's git tree at
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/roland/ppc440spe.git
that contains all of these patches, in case that makes it easier to merge this stuff.
Thanks,
Roland
PATCH 1/4 Allow ERPN for early serial to depend on CPU type
The PowerPC 440SPe supports up to 16 GB of RAM, and therefore its IO registers are at 0x4_xxxx_xxxx instead of being at 0x1_xxxx_xxxx like most other PPC 440 chips. To allow for this, this patch moves the definition of the ERPN used for mapping UART0 from being hard-coded in the head_44x.S assembly code to being defined in ibm44x.h.
---
arch/ppc/kernel/head_44x.S | 4 ++-- include/asm-ppc/ibm44x.h | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-)
applies-to: 191b41b19d91b0893c5699fa3ff5ca984841b7a7 00f2126e653cc45212ae72aa0cac150eff712087
arch/ppc/kernel/head_44x.S +2 -2
@@ -190,8 +190,8 @@ skpinv: addi r4,r4,1 /* Increment */ /* xlat fields */ lis r4,UART0_PHYS_IO_BASE@h /* RPN depends on SoC */ -#ifndef CONFIG_440EP - ori r4,r4,0x0001 /* ERPN is 1 for second 4GB page */ +#ifdef UART0_PHYS_ERPN + ori r4,r4,UART0_PHYS_ERPN /* Add ERPN if above 4GB */ #endif /* attrib fields */
include/asm-ppc/ibm44x.h +6 -1
@@ -34,12 +34,17 @@/* Lowest TLB slot consumed by the default pinned TLBs */ #define PPC44x_LOW_SLOT 63 -/* LS 32-bits of UART0 physical address location for early serial text debug */ +/* +* Least significant 32-bits and extended real page number (ERPN) of +* UART0 physical address location for early serial text debug +*/ #if defined(CONFIG_440SP ) +#define UART0_PHYS_ERPN 1#define UART0_PHYS_IO_BASE 0xf0000200#elif defined(CONFIG_440EP )#define UART0_PHYS_IO_BASE 0xe0000000#else +#define UART0_PHYS_ERPN 1#define UART0_PHYS_IO_BASE 0x40000200#endif
---
0.99.8.GIT
PATCH 2/4 Dump error status for both PLB segments on 440SP
The PowerPC 440SP SoC has two Processor Local Bus (PLB) segments (a high-throughput segment and a low-latency segment). Fix our PLB register definitions to cope with this, and add code to dump the status of both segments when a machine check occurs.
---
arch/ppc/syslib/ibm44x_common.c | 11 +++++++++++ include/asm-ppc/ibm44x.h | 20 +++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletions(-)
applies-to: 7a040884fca44f844bfa3063e93174d52633deda 7ae3c6cee4067379f718576833b4dfecc5a35b86
arch/ppc/syslib/ibm44x_common.c +11 -0
@@ -181,9 +181,20 @@ void __init ibm44x_platform_init(void)/* Called from MachineCheckException */ void platform_machine_check (struct pt_regs *regs) { +#ifdef CONFIG_440SP +printk ("PLB0: BEAR=0x%08x%08x ACR= 0x%08x BESR= 0x%08x%08x\n" , +mfdcr (DCRN_PLB0_BEARH ),mfdcr (DCRN_PLB0_BEARL ), +mfdcr (DCRN_PLB0_ACR ),mfdcr (DCRN_PLB0_BESRH ), +mfdcr (DCRN_PLB0_BESRL )); +printk ("PLB1: BEAR=0x%08x%08x ACR= 0x%08x BESR= 0x%08x%08x\n" , +mfdcr (DCRN_PLB1_BEARH ),mfdcr (DCRN_PLB1_BEARL ), +mfdcr (DCRN_PLB1_ACR ),mfdcr (DCRN_PLB1_BESRH ), +mfdcr (DCRN_PLB1_BESRL )); +#else printk ("PLB0: BEAR=0x%08x%08x ACR= 0x%08x BESR= 0x%08x\n" ,mfdcr (DCRN_PLB0_BEARH ),mfdcr (DCRN_PLB0_BEARL ),mfdcr (DCRN_PLB0_ACR ),mfdcr (DCRN_PLB0_BESR )); +#endif printk ("POB0: BEAR=0x%08x%08x BESR0=0x%08x BESR1=0x%08x\n" ,mfdcr (DCRN_POB0_BEARH ),mfdcr (DCRN_POB0_BEARL ),mfdcr (DCRN_POB0_BESR0 ),mfdcr (DCRN_POB0_BESR1 ));
include/asm-ppc/ibm44x.h +19 -1
@@ -302,13 +302,31 @@#define MALOBISR_CH0 0x80000000 /* EOB channel 1 bit */ #define MALOBISR_CH2 0x40000000/* EOB channel 2 bit */ -/* 440GP/GX PLB Arbiter DCRs */ +#if defined(CONFIG_440SP ) +/* 440SP PLB Arbiter DCRs */ +#define DCRN_PLB_REVID 0x080/* PLB Revision ID */ +#define DCRN_PLB_CCR 0x088/* PLB Crossbar Control */ + +#define DCRN_PLB0_ACR 0x081/* PLB Arbiter Control */ +#define DCRN_PLB0_BESRL 0x082/* PLB Error Status */ +#define DCRN_PLB0_BESRH 0x083/* PLB Error Status */ +#define DCRN_PLB0_BEARL 0x084/* PLB Error Address Low */ +#define DCRN_PLB0_BEARH 0x085/* PLB Error Address High */ + +#define DCRN_PLB1_ACR 0x089/* PLB Arbiter Control */ +#define DCRN_PLB1_BESRL 0x08a/* PLB Error Status */ +#define DCRN_PLB1_BESRH 0x08b/* PLB Error Status */ +#define DCRN_PLB1_BEARL 0x08c/* PLB Error Address Low */ +#define DCRN_PLB1_BEARH 0x08d/* PLB Error Address High */ +#else +* 440GP/GX PLB Arbiter DCRs */#define DCRN_PLB0_REVID 0x082/* PLB Arbiter Revision ID */ #define DCRN_PLB0_ACR 0x083/* PLB Arbiter Control */ #define DCRN_PLB0_BESR 0x084/* PLB Error Status */ #define DCRN_PLB0_BEARL 0x086/* PLB Error Address Low */ #define DCRN_PLB0_BEAR DCRN_PLB0_BEARL/* 40x compatibility */ #define DCRN_PLB0_BEARH 0x087/* PLB Error Address High */ +#endif /* 440GP/GX PLB to OPB bridge DCRs */ #define DCRN_POB0_BESR0 0x090
---
0.99.8.GIT
PATCH 3/4 Add 440SPe support
Add support for the AMCC PowerPC 440SPe SoC, including PCI Express in root port mode.
---
arch/ppc/kernel/cputable.c | 10 + arch/ppc/platforms/4xx/Kconfig | 8 - arch/ppc/platforms/4xx/Makefile | 1 arch/ppc/platforms/4xx/ppc440spe.c | 155 +++++++++++++ arch/ppc/platforms/4xx/ppc440spe.h | 66 +++++ arch/ppc/syslib/Makefile | 1 arch/ppc/syslib/ibm440sp_common.c | 4 arch/ppc/syslib/ibm44x_common.c | 2 arch/ppc/syslib/ppc440spe_pcie.c | 442 ++++++++++++++++++++++++++++++++++++ arch/ppc/syslib/ppc440spe_pcie.h | 149 ++++++++++++ arch/ppc/syslib/ppc4xx_pic.c | 37 +++ include/asm-ppc/ibm44x.h | 55 +++- 12 files changed, 911 insertions(+), 19 deletions(-) create mode 100644 arch/ppc/platforms/4xx/ppc440spe.c create mode 100644 arch/ppc/platforms/4xx/ppc440spe.h create mode 100644 arch/ppc/syslib/ppc440spe_pcie.c create mode 100644 arch/ppc/syslib/ppc440spe_pcie.h
applies-to: 4fd5412aaadbef40224cd63dbdcd102b2eb35309 88f12de483e4b44427ae5652206fccc19186946f
arch/ppc/kernel/cputable.c +10 -0
@@ -972,6 +972,16 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, }, + { /* 440SPe Rev. A */ + .pvr_mask = 0xff000fff, + .pvr_value = 0x53000890, + .cpu_name = "440SPe Rev. A", + .cpu_features = CPU_FTR_SPLIT_ID_CACHE | + CPU_FTR_USE_TB, + .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, + .icache_bsize = 32, + .dcache_bsize = 32, + },#endif /* CONFIG_44x */ #ifdef CONFIG_FSL_BOOKE {/* e200z5 */
arch/ppc/platforms/4xx/Kconfig +6 -2
@@ -124,9 +124,13 @@ config 440SP depends on LUAN default y +config 440SPE + bool + default n + config 440 bool - depends on 440GP || 440SP || 440EP + depends on 440GP || 440SP || 440SPE || 440EP default y config 440A
@@ -168,7 +172,7 @@ config XILINX_OCP config IBM_EMAC4 bool - depends on 440GX || 440SP + depends on 440GX || 440SP || 440SPE default y config BIOS_FIXUP
arch/ppc/platforms/4xx/Makefile +1 -0
@@ -22,6 +22,7 @@ obj-$(CONFIG_440EP) += ibm440ep.o obj-$(CONFIG_440GP) += ibm440gp.o obj-$(CONFIG_440GX) += ibm440gx.o obj-$(CONFIG_440SP) += ibm440sp.o +obj-$(CONFIG_440SPE) += ppc440spe.o obj-$(CONFIG_405EP) += ibm405ep.o obj-$(CONFIG_405GPR) += ibm405gpr.o obj-$(CONFIG_VIRTEX_II_PRO) += virtex-ii_pro.o
arch/ppc/platforms/4xx/ppc440spe.c new file +155 -0
155 lines not on this page · raw message
arch/ppc/platforms/4xx/ppc440spe.h new file +66 -0
66 lines not on this page · raw message
arch/ppc/syslib/Makefile +1 -0
@@ -15,6 +15,7 @@ obj-$(CONFIG_440EP) += ibm440gx_common. obj-$(CONFIG_440GP) += ibm440gp_common.o obj-$(CONFIG_440GX) += ibm440gx_common.o obj-$(CONFIG_440SP) += ibm440gx_common.o ibm440sp_common.o +obj-$(CONFIG_440SPE) += ibm440gx_common.o ibm440sp_common.o ppc440spe_pcie.o ifeq ($(CONFIG_4xx),y) ifeq ($(CONFIG_VIRTEX_II_PRO),y) obj-$(CONFIG_40x) += xilinx_pic.o
arch/ppc/syslib/ibm440sp_common.c +2 -2
@@ -1,7 +1,7 @@/* * arch/ppc/syslib/ibm440sp_common.c * -* PPC440SP system library +* PPC440SP/PPC440SPe system library * * Matt Porter <[email protected]> * Copyright 2002-2005 MontaVista Software Inc.
@@ -35,7 +35,7 @@ unsigned long __init ibm440sp_find_end_ou32 mem_size =0 ;/* Read two bank sizes and sum */ -for (i=0 ; i<2 ; i++) +for (i=0 ; i<MQ0_NUM_BANKS ; i++)switch (mfdcr (DCRN_MQ0_BS0BAS + i) &MQ0_CONFIG_SIZE_MASK ) {case MQ0_CONFIG_SIZE_8M : mem_size += PPC44x_MEM_SIZE_8M;
arch/ppc/syslib/ibm44x_common.c +1 -1
@@ -181,7 +181,7 @@ void __init ibm44x_platform_init(void)/* Called from MachineCheckException */ void platform_machine_check (struct pt_regs *regs) { -#ifdef CONFIG_440SP +#if defined(CONFIG_440SP ) || defined(CONFIG_440SPE ) printk("PLB0: BEAR=0x%08x%08x ACR= 0x%08x BESR= 0x%08x%08x\n", mfdcr(DCRN_PLB0_BEARH), mfdcr(DCRN_PLB0_BEARL), mfdcr(DCRN_PLB0_ACR), mfdcr(DCRN_PLB0_BESRH),
arch/ppc/syslib/ppc440spe_pcie.c new file +442 -0
442 lines not on this page · raw message
arch/ppc/syslib/ppc440spe_pcie.h new file +149 -0
149 lines not on this page · raw message
arch/ppc/syslib/ppc4xx_pic.c +36 -1
@@ -37,6 +37,7 @@ extern unsigned char ppc4xx_uic_ext_irq_#define IRQ_MASK_UICx (irq) (1 << (31 - ((irq) & 0x1f)))#define IRQ_MASK_UIC1 (irq) IRQ_MASK_UICx(irq)#define IRQ_MASK_UIC2 (irq) IRQ_MASK_UICx(irq) +#define IRQ_MASK_UIC3 (irq) IRQ_MASK_UICx(irq)#define UIC_HANDLERS (n) \ static void ppc4xx_uic##n##_enable(unsigned int irq) \
@@ -87,7 +88,38 @@ static void ppc4xx_uic##n##_end(unsigned .end = ppc4xx_uic##n##_end, \ } \ -#if NR_UICS ==3 +#if NR_UICS ==4 +#define ACK_UIC0_PARENT +#define ACK_UIC1_PARENT mtdcr(DCRN_UIC_SR(UIC0), UIC0_UIC1NC); +#define ACK_UIC2_PARENT mtdcr(DCRN_UIC_SR(UIC0), UIC0_UIC2NC); +#define ACK_UIC3_PARENT mtdcr(DCRN_UIC_SR(UIC0), UIC0_UIC3NC); +UIC_HANDLERS (0 ); +UIC_HANDLERS (1 ); +UIC_HANDLERS (2 ); +UIC_HANDLERS (3 ); + +static int ppc4xx_pic_get_irq (struct pt_regs *regs) +{ +u32 uic0 =mfdcr (DCRN_UIC_MSR (UIC0 )); +if (uic0 &UIC0_UIC1NC ) +return 64 -ffs (mfdcr (DCRN_UIC_MSR (UIC1 ))); +else if (uic0 &UIC0_UIC2NC ) +return 96 -ffs (mfdcr (DCRN_UIC_MSR (UIC2 ))); +else if (uic0 &UIC0_UIC3NC ) +return 128 -ffs (mfdcr (DCRN_UIC_MSR (UIC3 ))); +else +return uic0 ?32 -ffs (uic0) :-1 ; +} + +static void __init ppc4xx_pic_impl_init (void ) +{ +/* Enable cascade interrupts in UIC0 */ + ppc_cached_irq_mask[0 ] |=UIC0_UIC1NC |UIC0_UIC2NC |UIC0_UIC3NC ; +mtdcr (DCRN_UIC_SR (UIC0 ),UIC0_UIC1NC |UIC0_UIC2NC |UIC0_UIC3NC ); +mtdcr (DCRN_UIC_ER (UIC0 ), ppc_cached_irq_mask[0 ]); +} + +#elif NR_UICS ==3 #define ACK_UIC0_PARENT mtdcr(DCRN_UIC_SR(UICB), UICB_UIC0NC);#define ACK_UIC1_PARENT mtdcr(DCRN_UIC_SR(UICB), UICB_UIC1NC);#define ACK_UIC2_PARENT mtdcr(DCRN_UIC_SR(UICB), UICB_UIC2NC);
@@ -169,6 +201,9 @@ static struct ppc4xx_uic_impl { { .decl = DECLARE_UIC(1), .base = UIC1 }, #if NR_UICS > 2 { .decl = DECLARE_UIC(2), .base = UIC2 }, +#if NR_UICS > 3 + { .decl = DECLARE_UIC(3), .base = UIC3 }, +#endif #endif #endif };
include/asm-ppc/ibm44x.h +42 -13
140 lines not on this page · raw message
---
0.99.8.GIT
PATCH 4/4 Add Yucca (440SPe eval board) platform
Add support for AMCC PowerPC 440SPe "Yucca" eval board platform.
---
arch/ppc/boot/simple/Makefile | 6 + arch/ppc/platforms/4xx/Kconfig | 11 + arch/ppc/platforms/4xx/Makefile | 1 arch/ppc/platforms/4xx/yucca.c | 420 +++++++++++++++++++++++++++++++++++++++ arch/ppc/platforms/4xx/yucca.h | 111 ++++++++++ arch/ppc/syslib/Makefile | 1 include/asm-ppc/ibm4xx.h | 4 7 files changed, 552 insertions(+), 2 deletions(-) create mode 100644 arch/ppc/platforms/4xx/yucca.c create mode 100644 arch/ppc/platforms/4xx/yucca.h
applies-to: b69675164534e119bbe349478dbeab0c9431826c 68e399cc8c52337dced563bcd344316689312f7f
arch/ppc/boot/simple/Makefile +6 -0
@@ -79,6 +79,12 @@ zimageinitrd-$(CONFIG_LUAN) := zImage.i entrypoint-$(CONFIG_LUAN) := 0x01000000 extra.o-$(CONFIG_LUAN) := pibs.o + zimage-$(CONFIG_YUCCA) := zImage-TREE +zimageinitrd-$(CONFIG_YUCCA) := zImage.initrd-TREE + end-$(CONFIG_YUCCA) := yucca + entrypoint-$(CONFIG_YUCCA) := 0x01000000 + extra.o-$(CONFIG_YUCCA) := pibs.o + zimage-$(CONFIG_OCOTEA) := zImage-TREE zimageinitrd-$(CONFIG_OCOTEA) := zImage.initrd-TREE end-$(CONFIG_OCOTEA) := ocotea
arch/ppc/platforms/4xx/Kconfig +9 -2
@@ -82,6 +82,12 @@ config LUAN help This option enables support for the IBM PPC440SP evaluation board. +config YUCCA + bool "Yucca" + select WANT_EARLY_SERIAL + help + This option enables support for the AMCC PPC440SPe evaluation board. + config OCOTEA bool "Ocotea" select WANT_EARLY_SERIAL
@@ -126,7 +132,8 @@ config 440SP config 440SPE bool - default n + depends on YUCCA + default y config 440 bool
@@ -162,7 +169,7 @@ config BOOKE config IBM_OCP bool - depends on ASH || BAMBOO || BUBINGA || CPCI405 || EBONY || EP405 || LUAN || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT + depends on ASH || BAMBOO || BUBINGA || CPCI405 || EBONY || EP405 || LUAN || YUCCA || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT default y config XILINX_OCP
arch/ppc/platforms/4xx/Makefile +1 -0
@@ -7,6 +7,7 @@ obj-$(CONFIG_EBONY) += ebony.o obj-$(CONFIG_EP405) += ep405.o obj-$(CONFIG_BUBINGA) += bubinga.o obj-$(CONFIG_LUAN) += luan.o +obj-$(CONFIG_YUCCA) += yucca.o obj-$(CONFIG_OCOTEA) += ocotea.o obj-$(CONFIG_REDWOOD_5) += redwood5.o obj-$(CONFIG_REDWOOD_6) += redwood6.o
arch/ppc/platforms/4xx/yucca.c new file +420 -0
420 lines not on this page · raw message
arch/ppc/platforms/4xx/yucca.h new file +111 -0
111 lines not on this page · raw message
arch/ppc/syslib/Makefile +1 -0
@@ -55,6 +55,7 @@ obj-$(CONFIG_GT64260) += gt64260_pic.o obj-$(CONFIG_LOPEC) += i8259.o pci_auto.o todc_time.o obj-$(CONFIG_HDPU) += pci_auto.o obj-$(CONFIG_LUAN) += indirect_pci.o pci_auto.o todc_time.o +obj-$(CONFIG_YUCCA) += indirect_pci.o pci_auto.o todc_time.o obj-$(CONFIG_KATANA) += pci_auto.o obj-$(CONFIG_MV64360) += mv64360_pic.o obj-$(CONFIG_MV64X60) += mv64x60.o mv64x60_win.o indirect_pci.o
include/asm-ppc/ibm4xx.h +4 -0
@@ -97,6 +97,10 @@ void ppc4xx_init(unsigned long r3, unsig#include <platforms/4xx/luan.h> #endif +#if defined(CONFIG_YUCCA ) +#include <platforms/4xx/yucca.h> +#endif +#if defined(CONFIG_OCOTEA )#include <platforms/4xx/ocotea.h> #endif
---
0.99.8.GIT