[PATCH 1/2] Added support for PRTLVT based boards (MPC5121)

2008-06-12 Thread David Jander
 Made MPC5121_ADS board support generic:
 Renamed arch/powerpc/platforms/512x/mpc5121_ads.c and added list of supported
 boards.
 For both MPC5121 ADS or PRTLVT support, just select "MPC5121_GENERIC" and use
 the corresponding device-tree.

Signed-off-by: David Jander <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/dts/prtlvt.dts   |  272 
 arch/powerpc/platforms/512x/Kconfig|   14 +-
 arch/powerpc/platforms/512x/Makefile   |2 +-
 .../512x/{mpc5121_ads.c => mpc5121_generic.c}  |   38 ++-
 4 files changed, 307 insertions(+), 19 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/prtlvt.dts
 rename arch/powerpc/platforms/512x/{mpc5121_ads.c => mpc5121_generic.c} (73%)

diff --git a/arch/powerpc/boot/dts/prtlvt.dts b/arch/powerpc/boot/dts/prtlvt.dts
new file mode 100644
index 000..a011c8c
--- /dev/null
+++ b/arch/powerpc/boot/dts/prtlvt.dts
@@ -0,0 +1,272 @@
+/*
+ * Device tree source for PRTLVT based boards, base on:
+ * MPC5121E MDS Device Tree Source
+ *
+ * Copyright 2007 Freescale Semiconductor Inc.
+ * Copyright 2008 Protonic Holland
+ *
+ * This program is free software; you can redistribute  it and/or 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.
+ */
+
+ /* compile with: ./dtc -p 10240 -R 20 -I dts -o prtlvt.dtb -O dtb -b 0 
dts/prtlvt.dts */
+
+/dts-v1/;
+
+/ {
+   model = "prtlvt";
+   compatible = "prt,prtlvt";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   PowerPC,[EMAIL PROTECTED] {
+   device_type = "cpu";
+   reg = <0>;
+   d-cache-line-size = <0x20>; // 32 bytes
+   i-cache-line-size = <0x20>; // 32 bytes
+   d-cache-size = <0x8000>;// L1, 32K
+   i-cache-size = <0x8000>;// L1, 32K
+   timebase-frequency = <5000>;// 50 MHz (csb/4)
+   bus-frequency = <2>;// 200 MHz csb bus
+   clock-frequency = <4>;  // 400 MHz ppc core
+   };
+   };
+
+   memory {
+   device_type = "memory";
+   reg = <0x 0x1000>;  // 256MB at 0
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = "amd,s29gl256n", "cfi-flash";
+   reg = <0xfe00 0x0200>;
+   bank-width = <2>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   [EMAIL PROTECTED] {
+   label = "rootfs";
+   reg = <0x 0x0180>;
+   };
+   [EMAIL PROTECTED] {
+   label ="config0";
+   reg = <0x0180 0x0020>;
+   };
+   [EMAIL PROTECTED] {
+   label ="config1";
+   reg = <0x01a0 0x0020>;
+   };
+   [EMAIL PROTECTED] {
+   label ="kernel";
+   reg = <0x01c0 0x002e>;
+   };
+   [EMAIL PROTECTED] {
+   label ="devicetree";
+   reg = <0x01ee 0x0002>;
+   };
+   [EMAIL PROTECTED] {
+   label ="uboot";
+   reg = <0x01f0 0x0010>;
+   };
+   };
+   
+   [EMAIL PROTECTED] {
+   compatible = "fsl,mpc5121-immr", "simple-bus";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   #interrupt-cells = <2>;
+   ranges = <0x0 0x8000 0x40>;
+   reg = <0x8000 0x40>;
+   bus-frequency = <6600>; // 66 MHz ips bus
+
+
+   // IPIC
+   // interrupts cell = 
+   // sense values match linux IORESOURCE_IRQ_* defines:
+   // sense == 8: Level, low assertion
+   // sense == 2: Edge, high-to-low change
+   //
+   ipic: [EMAIL PROTECTED] {
+   compatible = "fsl,mpc5121-ipic", "fsl,ipic";
+   interrupt-controller;
+   #address-cells = <0>;
+   #interrupt-cells = <2>;
+   reg = <0xc00 0x100>;
+   };
+
+   // 512x PSCs are not 52xx PSCs compatible
+   // PSC0 serial port aka ttyPSC0
+   [EMAIL PROTECTED] {
+   device_type = "serial";
+   compatible = "fsl,mpc5121-psc-uart";
+   port-number = <0>;
+   cell-index = <0>;
+   reg = <0x11000

Re: [PATCH 1/2] Added support for PRTLVT based boards (MPC5121)

2008-06-12 Thread Grant Likely
Looking even better.  Just a few more comments.  I'll probably be able
to pick up the next one for inclusion in 2.6.27.

On Thu, Jun 12, 2008 at 5:44 AM, David Jander <[EMAIL PROTECTED]> wrote:
>  Made MPC5121_ADS board support generic:
>  Renamed arch/powerpc/platforms/512x/mpc5121_ads.c and added list of supported
>  boards.
>  For both MPC5121 ADS or PRTLVT support, just select "MPC5121_GENERIC" and use
>  the corresponding device-tree.
>
> Signed-off-by: David Jander <[EMAIL PROTECTED]>
> ---
>  arch/powerpc/boot/dts/prtlvt.dts   |  272 
> 
>  arch/powerpc/platforms/512x/Kconfig|   14 +-
>  arch/powerpc/platforms/512x/Makefile   |2 +-
>  .../512x/{mpc5121_ads.c => mpc5121_generic.c}  |   38 ++-
>  4 files changed, 307 insertions(+), 19 deletions(-)
>  create mode 100644 arch/powerpc/boot/dts/prtlvt.dts
>  rename arch/powerpc/platforms/512x/{mpc5121_ads.c => mpc5121_generic.c} (73%)
>
> diff --git a/arch/powerpc/boot/dts/prtlvt.dts 
> b/arch/powerpc/boot/dts/prtlvt.dts
> new file mode 100644
> index 000..a011c8c
> --- /dev/null
> +++ b/arch/powerpc/boot/dts/prtlvt.dts
> @@ -0,0 +1,272 @@
> +/*
> + * Device tree source for PRTLVT based boards, base on:
> + * MPC5121E MDS Device Tree Source
> + *
> + * Copyright 2007 Freescale Semiconductor Inc.
> + * Copyright 2008 Protonic Holland
> + *
> + * This program is free software; you can redistribute  it and/or 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.
> + */
> +
> + /* compile with: ./dtc -p 10240 -R 20 -I dts -o prtlvt.dtb -O dtb -b 0 
> dts/prtlvt.dts */
> +
> +/dts-v1/;
> +
> +/ {
> +   model = "prtlvt";
> +   compatible = "prt,prtlvt";
> +   #address-cells = <1>;
> +   #size-cells = <1>;
> +
> +   cpus {
> +   #address-cells = <1>;
> +   #size-cells = <0>;
> +
> +   PowerPC,[EMAIL PROTECTED] {
> +   device_type = "cpu";
> +   reg = <0>;
> +   d-cache-line-size = <0x20>; // 32 bytes
> +   i-cache-line-size = <0x20>; // 32 bytes
> +   d-cache-size = <0x8000>;// L1, 32K
> +   i-cache-size = <0x8000>;// L1, 32K
> +   timebase-frequency = <5000>;// 50 MHz (csb/4)
> +   bus-frequency = <2>;// 200 MHz csb bus
> +   clock-frequency = <4>;  // 400 MHz ppc core
> +   };
> +   };
> +
> +   memory {
> +   device_type = "memory";
> +   reg = <0x 0x1000>;  // 256MB at 0
> +   };
> +
> +   [EMAIL PROTECTED] {

There should probably be a node to describe the local bus that the
flash is attached to and this flash node should be a child of the bus.

> +   compatible = "amd,s29gl256n", "cfi-flash";
> +   reg = <0xfe00 0x0200>;
> +   bank-width = <2>;
> +   #address-cells = <1>;
> +   #size-cells = <1>;
> +   [EMAIL PROTECTED] {
> +   label = "rootfs";
> +   reg = <0x 0x0180>;
> +   };
> +   [EMAIL PROTECTED] {
> +   label ="config0";
> +   reg = <0x0180 0x0020>;
> +   };
> +   [EMAIL PROTECTED] {
> +   label ="config1";
> +   reg = <0x01a0 0x0020>;
> +   };
> +   [EMAIL PROTECTED] {
> +   label ="kernel";
> +   reg = <0x01c0 0x002e>;
> +   };
> +   [EMAIL PROTECTED] {
> +   label ="devicetree";
> +   reg = <0x01ee 0x0002>;
> +   };
> +   [EMAIL PROTECTED] {
> +   label ="uboot";
> +   reg = <0x01f0 0x0010>;
> +   };
> +   };

I'm still not all that keen on encoding the partition information into
the 'stock' device tree included with the kernel as it is more of a
configuration description that is more properly supplied by the
bootloader.  This is a debate that has been going back and forth over
the last few months, so there isn't a solid concensus yet, but my
preference is to remove or comment out the partition information for
now.

> +   [EMAIL PROTECTED] {
> +   compatible = "fsl,mpc5121-i2c-ctrl";
> +   reg = <0x1760 0x8>;
> +   };
> +
> +   [EMAIL PROTECTED] {

(nitpick) There is a recommended practice that says node names should
be generic as much as possible, so I think this should probably be
[EMAIL PROTECTED]  The compatib

Re: [PATCH 1/2] Added support for PRTLVT based boards (MPC5121)

2008-06-12 Thread David Gibson
On Thu, Jun 12, 2008 at 08:10:47AM -0600, Grant Likely wrote:
[snip]
> > +   [EMAIL PROTECTED] {
> > +   compatible = "fsl,mpc5121-i2c-ctrl";
> > +   reg = <0x1760 0x8>;
> > +   };
> > +
> > +   [EMAIL PROTECTED] {
> 
> (nitpick) There is a recommended practice that says node names should
> be generic as much as possible, so I think this should probably be
> [EMAIL PROTECTED]  The compatible value is fine.

If this is a video display device, the recommended generic name is
"[EMAIL PROTECTED]", not "[EMAIL PROTECTED]".

-- 
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
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/2] Added support for PRTLVT based boards (MPC5121)

2008-06-12 Thread Grant Likely
On Thu, Jun 12, 2008 at 10:19 PM, David Gibson
<[EMAIL PROTECTED]> wrote:
> On Thu, Jun 12, 2008 at 08:10:47AM -0600, Grant Likely wrote:
> [snip]
>> > +   [EMAIL PROTECTED] {
>> > +   compatible = "fsl,mpc5121-i2c-ctrl";
>> > +   reg = <0x1760 0x8>;
>> > +   };
>> > +
>> > +   [EMAIL PROTECTED] {
>>
>> (nitpick) There is a recommended practice that says node names should
>> be generic as much as possible, so I think this should probably be
>> [EMAIL PROTECTED]  The compatible value is fine.
>
> If this is a video display device, the recommended generic name is
> "[EMAIL PROTECTED]", not "[EMAIL PROTECTED]".

heh; oops.  I should know better and I stand corrected.  :-)

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev