mpc82xx: Embedded Planet EP8248E support
Subsystems (2)
PATCH 2/3 mpc82xx: Embedded Planet EP8248E support
This board is also resold by Freescale under the names "QUICCStart MPC8248 Evaluation System" and "CWH-PPC-8248N-VE".
--- arch/powerpc/boot/Makefile | 3 +- arch/powerpc/boot/dts/ep8248e.dts | 193 +++++++ arch/powerpc/boot/ep8248e.c | 55 ++ arch/powerpc/boot/wrapper | 2 +- arch/powerpc/configs/ep8248e_defconfig | 864 ++++++++++++++++++++++++++++++++ arch/powerpc/platforms/82xx/Kconfig | 13 + arch/powerpc/platforms/82xx/Makefile | 1 + arch/powerpc/platforms/82xx/ep8248e.c | 321 ++++++++++++ include/asm-powerpc/mpc8260.h | 1 + 9 files changed, 1451 insertions(+), 2 deletions(-) create mode 100644 arch/powerpc/boot/dts/ep8248e.dts create mode 100644 arch/powerpc/boot/ep8248e.c create mode 100644 arch/powerpc/configs/ep8248e_defconfig create mode 100644 arch/powerpc/platforms/82xx/ep8248e.c
arch/powerpc/boot/Makefile +2 -1
@@ -56,7 +56,7 @@ src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \ 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 redboot-8xx.c + fixed-head.S ep88xc.c cuboot-hpc2.c redboot-8xx.c ep8248e.c src-boot := $(src-wlib) $(src-plat) empty.c src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -151,6 +151,7 @@ ifneq ($(CONFIG_DEVICE_TREE),"") image-$(CONFIG_PPC_8xx) += cuImage.8xx image-$(CONFIG_PPC_EP88XC) += zImage.ep88xc image-$(CONFIG_8260) += cuImage.pq2 +image-$(CONFIG_EP8248E) += zImage.ep8248e image-$(CONFIG_PPC_MPC52xx) += cuImage.52xx image-$(CONFIG_PPC_83xx) += cuImage.83xx image-$(CONFIG_PPC_85xx) += cuImage.85xx
arch/powerpc/boot/dts/ep8248e.dts new file +193 -0
193 lines not on this page · raw message
arch/powerpc/boot/ep8248e.c new file +55 -0
55 lines not on this page · raw message
arch/powerpc/boot/wrapper +1 -1
@@ -168,7 +168,7 @@ ps3) ksection=.kernel:vmlinux.bin isection=.kernel:initrd ;; -ep88xc|redboot*) +ep88xc|ep8248e|redboot*) platformo="$object/fixed-head.o $object/$platform.o" binary=y ;;
arch/powerpc/configs/ep8248e_defconfig new file +864 -0
864 lines not on this page · raw message
arch/powerpc/platforms/82xx/Kconfig +13 -0
@@ -26,6 +26,19 @@ config PQ2FADS help This option enables support for the PQ2FADS board +config EP8248E + bool "Embedded Planet EP8248E (a.k.a. CWH-PPC-8248N-VE)" + select 8272 + select 8260 + select FSL_SOC + select PPC_CPM_NEW_BINDING + select MDIO_BITBANG + help + This enables support for the Embedded Planet EP8248E board. + + This board is also resold by Freescale as the QUICCStart + MPC8248 Evaluation System and/or the CWH-PPC-8248N-VE. + endchoice config PQ2ADS
arch/powerpc/platforms/82xx/Makefile +1 -0
@@ -5,3 +5,4 @@ obj-$(CONFIG_MPC8272_ADS) += mpc8272_ads.o obj-$(CONFIG_CPM2) += pq2.o obj-$(CONFIG_PQ2_ADS_PCI_PIC) += pq2ads-pci-pic.o obj-$(CONFIG_PQ2FADS) += pq2fads.o +obj-$(CONFIG_EP8248E) += ep8248e.o
arch/powerpc/platforms/82xx/ep8248e.c new file +321 -0
321 lines not on this page · raw message
include/asm-powerpc/mpc8260.h +1 -0
@@ -8,6 +8,7 @@#ifndef __ASM_POWERPC_MPC8260_H__#define __ASM_POWERPC_MPC8260_H__ +#define MPC82XX_BCR_PLDP 0x00800000/* Pipeline Maximum Depth */ #ifdef CONFIG_8260
Signature · 1 line
1.5.3.7
arch/powerpc/platforms/82xx/ep8248e.c line 119
Quoted 12 lines · On Tue, 11 Dec 2007 15:22:47 -0600 Scott Wood <[email protected]> wrote:
+++
b/arch/powerpc/platforms/82xx/ep8248e.carch/powerpc/platforms/82xx/ep8248e.c new file +10
-0+ +static int __devinit ep8248e_mdio_probe (struct of_device *ofdev, +const struct of_device_id *match) +{ +struct mii_bus *bus; +struct resource res; +int ret, i; + +if (of_get_parent (ofdev->node) != ep8248e_bcsr_node) +return -ENODEV ;
You need to do of_node_put() on the result of of_get_parent().
Quoted 1 line
+static struct
cpm_pinep8248_pins[] = {
Should this be const?
Quoted 10 lines
arch/powerpc/platforms/82xx/ep8248e.c new file +10
-0+static void __init ep8248_setup_arch (void ) +{ +if (ppc_md.progress) + ppc_md.progress ("ep8248_setup_arch()" ,0 ); + +cpm2_reset (); + +/* When this is set, snooping CPM DMA from RAM causes +* machine checks. See erratum SIU18. +*/
arch/powerpc/platforms/82xx/ep8248e.c line 266
Quoted 10 lines
arch/powerpc/platforms/82xx/ep8248e.c new file +10
-0+clrbits32 (&cpm2_immr->im_siu_conf.siu_82xx.sc_bcr,MPC82XX_BCR_PLDP ); + + ep8248e_bcsr_node = +of_find_compatible_node (NULL ,NULL ,"fsl,ep8248e-bcsr" ); +if (!ep8248e_bcsr_node) { +printk (KERN_ERR "No bcsr in device tree\n" ); +return ; + } + + ep8248e_bcsr =of_iomap (ep8248e_bcsr_node,0 );
of_node_put(ep8248e_bcsr_node;
arch/powerpc/platforms/82xx/ep8248e.c line 308
Quoted 4 lines
arch/powerpc/platforms/82xx/ep8248e.c new file +4
-0+static int __init ep8248_probe (void ) +{ +unsigned long root =of_get_flat_dt_root (); +return of_flat_dt_is_compatible (root,"fsl,ep8248e" );
Again you should include asm/prom.h
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Quoted 3 lines · Stephen Rothwell
arch/powerpc/platforms/82xx/ep8248e.c line 266
Quoted 1 line
arch/powerpc/platforms/82xx/ep8248e.c new file +1
-0+ ep8248e_bcsr =of_iomap (ep8248e_bcsr_node,0 );of_node_put(ep8248e_bcsr_node;
No, because we hold on to the node for later use in ep8248e_mdio_probe().
BTW, is there any actual node removal done that justifies dealing with refcounts everywhere?
-Scot
Quoted 7 lines · On Wed, 12 Dec 2007 16:48:24 -0600 Scott Wood <[email protected]> wrote:
Quoted 3 lines · Stephen Rothwell
arch/powerpc/platforms/82xx/ep8248e.c line 266
Quoted 1 line
arch/powerpc/platforms/82xx/ep8248e.c new file +1
-0+ ep8248e_bcsr =of_iomap (ep8248e_bcsr_node,0 );of_node_put(ep8248e_bcsr_node;
No, because we hold on to the node for later use in
ep8248e_mdio_probe().
Sorry, you are right, I didn't notice that it was global ...
Quoted 2 lines
BTW, is there any actual node removal done that justifies dealing with refcounts everywhere?
In the hotplug code. So I guess it is not very relevant to you, but it is a pain to retrofit this stuff if it does become important more widely.
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Quoted 36 lines · Scott Wood
This board is also resold by Freescale under the names "QUICCStart MPC8248 Evaluation System" and "CWH-PPC-8248N-VE".
Signed-off-by Scott Wood <[email protected]>---
arch/powerpc/boot/Makefile | 3 +- arch/powerpc/boot/dts/ep8248e.dts | 193 +++++++ arch/powerpc/boot/ep8248e.c | 55 ++ arch/powerpc/boot/wrapper | 2 +- arch/powerpc/configs/ep8248e_defconfig | 864 +++++++++++++++++++++++ +++++++++ arch/powerpc/platforms/82xx/Kconfig | 13 + arch/powerpc/platforms/82xx/Makefile | 1 + arch/powerpc/platforms/82xx/ep8248e.c | 321 ++++++++++++ include/asm-powerpc/mpc8260.h | 1 + 9 files changed, 1451 insertions(+), 2 deletions(-)create mode 100644
arch/powerpc/boot/dts/ep8248e.dtscreate mode 100644arch/powerpc/boot/ep8248e.ccreate mode 100644arch/powerpc/configs/ep8248e_defconfigcreate mode 100644arch/powerpc/platforms/82xx/ep8248e.carch/powerpc/boot/dts/ep8248e.dts new file +2
-0@@ -0,0 +1,193 @@ +/* + * Device Tree for the Embedded Planet EP8248E board runningPlanetCore.
+ *
+ * Copyright 2007 Freescale Semiconductor Inc.
+ *
+ * This program is free software; you can redistribute it and/or
Quoted 8 lines
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.
+ */
+
Can we make this a /dts-v1/; since its new.
arch/powerpc/boot/dts/ep8248e.dts line 16
Quoted 6 lines
arch/powerpc/boot/dts/ep8248e.dts new file +5
-0+/ { + model = "EP8248E"; + compatible = "fsl,ep8248e"; + #address-cells = <1>; + #size-cells = <1>;
Add a aliases { } and can we use that instead of linux,network-index and linux,planetcore-label.
Quoted 168 lines
arch/powerpc/boot/dts/ep8248e.dts new file +77
-0+ + cpus { + #address-cells = <1>; + #size-cells = <0>; + + PowerPC,8248@0 { + device_type = "cpu"; + reg = <0>; + d-cache-line-size = <d#32>; + i-cache-line-size = <d#32>; + d-cache-size = <d#16384>; + i-cache-size = <d#16384>; + timebase-frequency = <0>; + clock-frequency = <0>; + }; + }; + + localbus { + compatible = "fsl,ep8248e-localbus", + "fsl,mpc8248-localbus", + "fsl,pq2-localbus"; + #address-cells = <2>; + #size-cells = <1>; + reg = <f0010100 40>; + + ranges = <0 0 fc000000 04000000 + 1 0 fa000000 00008000>; + + flash@0,3800000 { + compatible = "cfi-flash"; + reg = <0 3800000 800000>; + bank-width = <4>; + device-width = <2>; + }; + + bcsr@1,0 { + #address-cells = <2>; + #size-cells = <1>; + reg = <1 0 10>; + compatible = "fsl,ep8248e-bcsr"; + ranges; + + mdio { + device_type = "mdio"; + compatible = "fsl,ep8248e-mdio-bitbang"; + #address-cells = <1>; + #size-cells = <0>; + reg = <1 8 1>; + + PHY0: ethernet-phy@0 { + interrupt-parent = <&PIC>; + reg = <0>; + device_type = "ethernet-phy"; + }; + + PHY1: ethernet-phy@1 { + interrupt-parent = <&PIC>; + reg = <1>; + device_type = "ethernet-phy"; + }; + }; + }; + }; + + memory { + device_type = "memory"; + reg = <0 0>; + }; + + soc@f0000000 { + #address-cells = <1>; + #size-cells = <1>; + device_type = "soc"; + compatible = "fsl,mpc8248", "fsl,pq2-soc"; + ranges = <00000000 f0000000 00053000>; + + // Temporary -- will go away once kernel uses ranges for
get_immrbase().arch/powerpc/boot/dts/ep8248e.dts new file +90
-0+ reg = <f0000000 00053000>; + + cpm@119c0 { + #address-cells = <1>; + #size-cells = <1>; + #interrupt-cells = <2>; + compatible = "fsl,mpc8248-cpm", "fsl,cpm2"; + reg = <119c0 30>; + ranges; + + muram { + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 10000>; + + data@0 { + compatible = "fsl,cpm-muram-data"; + reg = <0 1100 1140 ec0 9800 800>; + }; + }; + + brg@119f0 { + compatible = "fsl,mpc8272-brg", + "fsl,cpm2-brg", + "fsl,cpm-brg"; + reg = <119f0 10 115f0 10>; + }; + + /* Monitor port/SMC1 */ + serial@11a80 { + device_type = "serial"; + compatible = "fsl,mpc8248-smc-uart", + "fsl,cpm2-smc-uart"; + reg = <11a80 20 1100 40>; + interrupts = <4 8>; + interrupt-parent = <&PIC>; + fsl,cpm-brg = <7>; + fsl,cpm-command = <1d000000>; + linux,planetcore-label = "SMC1"; + }; + + /* "Serial" port/SCC1 */ + serial@11a00 { + device_type = "serial"; + compatible = "fsl,mpc8248-scc-uart", + "fsl,cpm2-scc-uart"; + reg = <11a00 20 8000 100>; + interrupts = <28 8>; + interrupt-parent = <&PIC>; + fsl,cpm-brg = <1>; + fsl,cpm-command = <00800000>; + linux,planetcore-label = "SCC1"; + }; + + ethernet@11300 { + device_type = "network"; + compatible = "fsl,mpc8248-fcc-enet", + "fsl,cpm2-fcc-enet"; + reg = <11300 20 8400 100 11390 1>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <20 8>; + interrupt-parent = <&PIC>; + phy-handle = <&PHY0>; + linux,network-index = <0>; + fsl,cpm-command = <12000300>; + }; + + ethernet@11320 { + device_type = "network"; + compatible = "fsl,mpc8248-fcc-enet", + "fsl,cpm2-fcc-enet"; + reg = <11320 20 8500 100 113b0 1>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <21 8>; + interrupt-parent = <&PIC>; + phy-handle = <&PHY1>; + linux,network-index = <1>; + fsl,cpm-command = <16200300>; + }; + + usb@11b60 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,mpc8248-usb", + "fsl,cpm2-usb"; + reg = <11b60 18 8b00 100>; + interrupt-parent = <&PIC>; + interrupts = <b 8>; + fsl,cpm-command = <2e600000>; + };
arch/powerpc/boot/dts/ep8248e.dts line 193
Quoted 10 lines
arch/powerpc/boot/dts/ep8248e.dts new file +10
-0+ }; + + PIC: interrupt-controller@10c00 { + #interrupt-cells = <2>; + interrupt-controller; + reg = <10c00 80>; + compatible = "fsl,mpc8248-pic", "fsl,pq2-pic"; + }; + }; +};
- k
Quoted 1 line · Kumar Gala
Can we make this a /dts-v1/; since its new.
It's not really new; it's just been collecting dust for a while. :-P
Are there any tools to autoconvert (preferably without losing comments)?
Quoted 8 lines
arch/powerpc/boot/dts/ep8248e.dts line 16
Quoted 5 lines
arch/powerpc/boot/dts/ep8248e.dts new file +5
-0+/ { + model = "EP8248E"; + compatible = "fsl,ep8248e"; + #address-cells = <1>; + #size-cells = <1>;Add a aliases { } and can we use that instead of linux,network-index and linux,planetcore-label.
I don't see any support in the current bootwrapper for aliases.
-Scott
Quoted 4 lines · Scott Wood
Quoted 1 line · Kumar Gala
Can we make this a /dts-v1/; since its new.
It's not really new; it's just been collecting dust for a while. :-P
Its new to us on the list :P
Quoted 1 line
Are there any tools to autoconvert (preferably without losing comments)?
Not sure of jon had a perl script or something.
Quoted 10 lines
Quoted 8 lines
arch/powerpc/boot/dts/ep8248e.dts line 16
Quoted 5 lines
arch/powerpc/boot/dts/ep8248e.dts new file +5
-0+/ { + model = "EP8248E"; + compatible = "fsl,ep8248e"; + #address-cells = <1>; + #size-cells = <1>;Add a aliases { } and can we use that instead of linux,network-index and linux,planetcore-label.
I don't see any support in the current bootwrapper for aliases.
Yeah, I was hoping you'd code something up :)
- k
Quoted 9 lines · Kumar Gala
Quoted 4 lines · Scott Wood
Quoted 1 line · Kumar Gala
Can we make this a /dts-v1/; since its new.
It's not really new; it's just been collecting dust for a while. :-P
Its new to us on the list :P
I thought it got sent out at least once a long time ago...
In any case, I thought that one of the main reasons for the version tag is so that the whole world doesn't have to switch at once?
Quoted 3 lines
Quoted 1 line
Are there any tools to autoconvert (preferably without losing comments)?
Not sure of jon had a perl script or something.
Jon, anything?
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
arch/powerpc/boot/dts/ep8248e.dts new file +5
-0+/ { + model = "EP8248E"; + compatible = "fsl,ep8248e"; + #address-cells = <1>; + #size-cells = <1>;
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Add a aliases { } and can we use that instead of linux,network-index and linux,planetcore-label.
I don't see any support in the current bootwrapper for aliases.
Yeah, I was hoping you'd code something up :)
I'll leave that to those who actually care about using aliases. :-)
-Scott
Quoted 4 lines · Kumar Gala
Quoted 2 lines
Are there any tools to autoconvert (preferably without losing comments)?
Not sure of jon had a perl script or something.
No, I don't. It's hard to tell what should conceptually remain hex, and what might need to be decimalized. Sure, hard lists of properties could be done and all...
One can do a "-I dts -O dts" and get it all converted to /dts-v1/, but with comments dropped on the floor.
Sorry.
jdl
Quoted 7 lines · Scott Wood
Quoted 1 line · Kumar Gala
Can we make this a /dts-v1/; since its new.
It's not really new; it's just been collecting dust for a while. :-P
Are there any tools to autoconvert (preferably without losing comments)?
dtc itself can convert, but it will lose comments, alas. There's not really any reasonable way it can be changed to preserve comments.
dtc -I dts -O dts foo.dts
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
On Tue, Dec 11, 2007 at 03:22:47PM -0600, Scott Wood wrote:
[snip]
Quoted 17 lines
arch/powerpc/boot/dts/ep8248e.dts new file +17
-0+ bcsr@1,0 { + #address-cells = <2>; + #size-cells = <1>; + reg = <1 0 10>; + compatible = "fsl,ep8248e-bcsr"; + ranges; + + mdio { + device_type = "mdio"; + compatible = "fsl,ep8248e-mdio-bitbang"; + #address-cells = <1>; + #size-cells = <0>; + reg = <1 8 1>; + + PHY0: ethernet-phy@0 { + interrupt-parent = <&PIC>; + reg = <0>;
arch/powerpc/boot/dts/ep8248e.dts line 78
Quoted 10 lines
arch/powerpc/boot/dts/ep8248e.dts new file +10
-0+ device_type = "ethernet-phy"; + }; + + PHY1: ethernet-phy@1 { + interrupt-parent = <&PIC>; + reg = <1>; + device_type = "ethernet-phy"; + }; + }; + };
This mdio-under-bcsr arrangement is a bit strange. Can you explain what's going on here?
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Quoted 2 lines · David Gibson
This mdio-under-bcsr arrangement is a bit strange. Can you explain what's going on here?
It's pretty much what it looks like; MDIO is connected to a couple pins that are controlled by some bits in the BCSR.
-Scott