EP405 boards support for arch/powerpc
Subsystems (2)
PATCH 8/21 EP405 boards support for arch/powerpc
Brings EP405 support to arch/powerpc. The IRQ routing for the CPLD comes from a device-tree property, PCI is working to the point where I can see the video card, USB device, and south bridge.
This should work with both EP405 and EP405PC.
I've not totally figured out how IRQs are wired on this hardware though, thus at this stage, expect only USB interrupts working, pretty much the same as what arch/ppc did.
Also, the flash, nvram, rtc and temp control still have to be wired.
---
Note about IRQ routing: The doc is very obscure in that area.
I _think_ the SB interrupt on the CPLD is actually the Windond's 8259 output and the NB interrupt is the PCI_A...PCI_D mux in there (which can be implemented as a cascaded controller) but I haven't sorted that out yet. If anybody from Embedded Planet is around, I could use some advice there.
If my deductions are correct, then we would need to wire up the 8259 driver to SB, which should be trivial provided I stick the windbond bridge in the device-tree, or at least part of it, and probably implement a cascaded controller for the PCI IRQ A...D mux thingy, which should also be trivial.
Note also that it tends to lockup during the transition from the boot wrapper to the kernel, before udbg is started. I didn't have a RiscWatch at hand so I haven't yet been able to track that down. It's random though, quite weird. Maybe some stale TLB entries or cache content that isn't cleared properly...
arch/powerpc/boot/4xx.c | 55 +- arch/powerpc/boot/4xx.h | 1 arch/powerpc/boot/Makefile | 3 arch/powerpc/boot/dts/ep405.dts | 221 ++++++++ arch/powerpc/boot/ep405.c | 74 ++ arch/powerpc/boot/treeboot-walnut.c | 49 - arch/powerpc/boot/wrapper | 2 arch/powerpc/configs/ep405_defconfig | 951 +++++++++++++++++++++++++++++++++++ arch/powerpc/platforms/40x/Kconfig | 22 arch/powerpc/platforms/40x/Makefile | 1 arch/powerpc/platforms/40x/ep405.c | 124 ++++ 11 files changed, 1437 insertions(+), 66 deletions(-)
arch/powerpc/boot/Makefile +2 -1
@@ -58,7 +58,7 @@ src-plat := of.c cuboot-52xx.c cuboot-83 cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \ cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c \ - fixed-head.S ep88xc.c cuboot-hpc2.c + fixed-head.S ep88xc.c cuboot-hpc2.c ep405.c src-boot := $(src-wlib) $(src-plat) empty.c src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -189,6 +189,7 @@ image-$(CONFIG_DEFAULT_UIMAGE) += uImag ifneq ($(CONFIG_DEVICE_TREE),"") image-$(CONFIG_PPC_8xx) += cuImage.8xx image-$(CONFIG_PPC_EP88XC) += zImage.ep88xc +image-$(CONFIG_EP405) += zImage.ep405 image-$(CONFIG_8260) += cuImage.pq2 image-$(CONFIG_PPC_MPC52xx) += cuImage.52xx image-$(CONFIG_PPC_83xx) += cuImage.83xx
arch/powerpc/boot/ep405.c new file +74 -0
74 lines not on this page · raw message
arch/powerpc/boot/dts/ep405.dts new file +221 -0
221 lines not on this page · raw message
arch/powerpc/boot/4xx.c +54 -1
70 lines not on this page · raw message
arch/powerpc/boot/treeboot-walnut.c +0 -49
55 lines not on this page · raw message
arch/powerpc/platforms/40x/Kconfig +8 -14
@@ -14,20 +14,14 @@ # help # This option enables support for the CPCI405 board. -#config EP405 -# bool "EP405/EP405PC" -# depends on 40x -# default n -# select 405GP -# help -# This option enables support for the EP405/EP405PC boards. - -#config EP405PC -# bool "EP405PC Support" -# depends on EP405 -# default y -# help -# This option enables support for the extra features of the EP405PC board. +config EP405 + bool "EP405/EP405PC" + depends on 40x + default n + select 405GP + select PCI + help + This option enables support for the EP405/EP405PC boards. config KILAUEA bool "Kilauea"
arch/powerpc/platforms/40x/Makefile +1 -0
@@ -1,3 +1,4 @@ obj-$(CONFIG_KILAUEA) += kilauea.o obj-$(CONFIG_WALNUT) += walnut.o obj-$(CONFIG_XILINX_VIRTEX_GENERIC_BOARD) += virtex.o +obj-$(CONFIG_EP405) += ep405.o
arch/powerpc/platforms/40x/ep405.c new file +124 -0
124 lines not on this page · raw message
arch/powerpc/boot/4xx.h +1 -0
@@ -18,5 +18,6 @@ void ibm40x_dbcr_reset(void);void ibm4xx_quiesce_eth (u32 *emac0,u32 *emac1);void ibm4xx_fixup_ebc_ranges (const char *ebc);void ibm440ep_fixup_clocks (unsigned int sysclk,unsigned int ser_clk); +void ibm405gp_fixup_clocks (unsigned int sysclk,unsigned int ser_clk);#endif /* _POWERPC_BOOT_4XX_H_ */
arch/powerpc/boot/wrapper +1 -1
@@ -168,7 +168,7 @@ ps3) ksection=.kernel:vmlinux.bin isection=.kernel:initrd ;; -ep88xc) +ep88xc|ep405) platformo="$object/fixed-head.o $object/$platform.o" binary=y ;;
arch/powerpc/configs/ep405_defconfig new file +951 -0
951 lines not on this page · raw message
Hi Ben,
Just a couple of trivial things.
Quoted 7 lines · On Fri, 21 Dec 2007 15:39:26 +1100 Benjamin Herrenschmidt…
+++
linux-merge/arch/powerpc/boot/4xx.c2007-12-21 14:19:46.000000000 +1100arch/powerpc/boot/4xx.c +0
-1@@ -179,13 +179,16 @@ void ibm40x_dbcr_reset(void)#define EMAC_RESET 0x20000000void ibm4xx_quiesce_eth (u32 *emac0,u32 *emac1) { -/* Quiesce the MAL and EMAC(s) since PIBS/OpenBIOS don't do this for us */
arch/powerpc/boot/4xx.c void ibm40x_dbcr_reset(void) · line 191
Quoted 10 lines
arch/powerpc/boot/4xx.c +4
-0+/* Quiesce the MAL and EMAC(s) since PIBS/OpenBIOS don't +* do this for us +*/ if (emac0) *emac0 =EMAC_RESET ;if (emac1) *emac1 =EMAC_RESET ;mtdcr (DCRN_MAL0_CFG ,MAL_RESET ); +while (mfdcr (DCRN_MAL0_CFG ) &MAL_RESET ) {};
You need the {} or the ; but not both and please put them indented on the next line so that it is very clear that this is an empty loop.
arch/powerpc/boot/4xx.c void ibm440ep_fixup_clocks(unsigned int · line 332
Quoted 6 lines
arch/powerpc/boot/4xx.c +6
-0+if (cpc0_cr0 &0x80 ) { +/* uart0 uses the external clock */ + uart0 = ser_clk; + }else { + uart0 = cpu / udiv; + }
The braces aren't really needed. (Yes, I noticed that you just moved the code here)
arch/powerpc/boot/4xx.c void ibm440ep_fixup_clocks(unsigned int · line 339
Quoted 6 lines
arch/powerpc/boot/4xx.c +6
-0+if (cpc0_cr0 &0x40 ) { +/* uart1 uses the external clock */ + uart1 = ser_clk; + }else { + uart1 = cpu / udiv; + }
And again.
arch/powerpc/platforms/40x/ep405.c line 51
Quoted 3 lines
+++
linux-merge/arch/powerpc/platforms/40x/ep405.c2007-12-21 14:19:46.000000000 +1100arch/powerpc/platforms/40x/ep405.c new file +2
-0+ +static struct of_device_id ep405_of_bus[] = {
__initdata (preferably) or const
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Quoted 14 lines · Stephen Rothwell
Quoted 14 lines
+++
linux-merge/arch/powerpc/boot/4xx.c2007-12-21 14:19:46.000000000 +1100arch/powerpc/boot/4xx.c +3
-1@@ -179,13 +179,16 @@ void ibm40x_dbcr_reset(void)#define EMAC_RESET 0x20000000void ibm4xx_quiesce_eth (u32 *emac0,u32 *emac1) { -/* Quiesce the MAL and EMAC(s) since PIBS/OpenBIOS don't do this for us */ +/* Quiesce the MAL and EMAC(s) since PIBS/OpenBIOS don't +* do this for us +*/ if (emac0) *emac0 =EMAC_RESET ;if (emac1) *emac1 =EMAC_RESET ;
Quoted 5 lines
arch/powerpc/boot/4xx.c void ibm40x_dbcr_reset(void) · line 191
Quoted 2 lines
arch/powerpc/boot/4xx.c +1
-0mtdcr (DCRN_MAL0_CFG ,MAL_RESET ); +while (mfdcr (DCRN_MAL0_CFG ) &MAL_RESET ) {};You need the {} or the ; but not both and please put them indented on the next line so that it is very clear that this is an empty loop.
Code was copy/pasted from somewhere else... we can always do a fixup later.
Quoted 9 lines
arch/powerpc/boot/4xx.c void ibm440ep_fixup_clocks(unsigned int · line 332
Quoted 6 lines
arch/powerpc/boot/4xx.c +6
-0+if (cpc0_cr0 &0x80 ) { +/* uart0 uses the external clock */ + uart0 = ser_clk; + }else { + uart0 = cpu / udiv; + }The braces aren't really needed. (Yes, I noticed that you just moved the code here)
Yup :-)
Quoted 8 lines
arch/powerpc/boot/4xx.c void ibm440ep_fixup_clocks(unsigned int · line 339
Quoted 6 lines
arch/powerpc/boot/4xx.c +6
-0+if (cpc0_cr0 &0x40 ) { +/* uart1 uses the external clock */ + uart1 = ser_clk; + }else { + uart1 = cpu / udiv; + }And again.
I'd rather do cleanups separately. I won't send new patches until I'm back from vacation so Josh, if you want to fix those little nits up, feel free.
Quoted 5 lines
arch/powerpc/platforms/40x/ep405.c line 51
Quoted 3 lines
+++
linux-merge/arch/powerpc/platforms/40x/ep405.c2007-12-21 14:19:46.000000000 +1100arch/powerpc/platforms/40x/ep405.c new file +2
-0+ +static struct of_device_id ep405_of_bus[] = {
__initdata(preferably) or const
Ben.
Quoted 3 lines · On Sat, 22 Dec 2007 10:24:24 +1100 Stephen Rothwell <[email protected]>…
Hi Ben,
Just a couple of trivial things.
All fair comments. And I realize that everyone is busy and such, but this is the 4th or 5th time these patches have hit the list.
I'm hesitant to let perfection get in the way of good enough at this point. I can always fix these up when I commit.
josh