Re: [PATCH/RFC] powerpc: DBox2 Board Support

2008-01-02 Thread Scott Wood
On Sat, Dec 22, 2007 at 08:13:31PM +0100, Jochen Friedrich wrote:
 + [EMAIL PROTECTED] {
 + compatible = c-cube,gtx;
 + reg = 40 3000 0 20;
 + interrupts = 2 2;
 + interrupt-parent = PIC;
 + };
 +
 + [EMAIL PROTECTED] {
 + compatible = betaresearch,dbox2-fp;
 + interrupts = 4 2;
 + interrupt-parent = PIC;
 + gpios = 0 e;
 + gpio-parent = CPM1_PIO;
 + };
 +
 + [EMAIL PROTECTED] {
 + compatible = betaresearch,dbox2-fe;
 + interrupts = e 2;
 + interrupt-parent = PIC;
 + };

These unit addresses look wrong.

 + [EMAIL PROTECTED] {
 + compatible = betaresearch,dbox2-cam;
 + reg = 400 2;
 + interrupts = 6 2;
 + interrupt-parent = PIC;
 + gpios = 1 1c 1 1d 1 1e 1 1f;
 + gpio-parent = CPM1_PIO;
 + };
 +
 + [EMAIL PROTECTED] {
 + compatible = betaresearch,dbox2-cam;
 + reg = 404 2;
 + interrupts = 6 2;
 + interrupt-parent = PIC;
 + gpios = 1 1c 1 1d 1 1e 1 1f;
 + gpio-parent = CPM1_PIO;
 + };

Maybe gpios should have a length field?  Or maybe we should just
phandle to a separate node under the gpio controller node.  What happens if
a device sits on two different gpio-parents?

 + [EMAIL PROTECTED] {
 + // Flash also has info about model needed by setup
 + compatible = cfi-flash,
 +  betaresearch,dbox2-config;

What does dbox2-config mean?

 + [EMAIL PROTECTED] {
 + label = Flash without bootloader;
 + reg = 2 7e;
 + };
 + [EMAIL PROTECTED] {
 + label = Complete Flash;
 + reg = 0 80;
 + read-only;
 + };

What is ovpartition?

 + [EMAIL PROTECTED] {
 + device_type = watchdog;
 + compatible = fsl,mpc823-wdt,
 +  fsl,pq1-wdt;
 + reg = 0 10;
 + };

No device_type.

 + [EMAIL PROTECTED] {
 + #address-cells = 1;
 + #size-cells = 1;
 + ranges;
 + reg = 9c0 40;
 + command-proc = 9c0;

command-proc is obsolete.

 + [EMAIL PROTECTED] {
 + #address-cells = 1;
 + #size-cells = 1;
 + ranges = 0 2000 2000;
 +
 + [EMAIL PROTECTED] {
 + compatible = fsl,cpm-muram-data;
 + reg = 0 1c00;
 + };
 + };

Should have compatible of fsl,cpm-muram on the muram node as well, even
though the current code doesn't use it.

 + // Port D is LCD exclusive. Don't export as GPIO
 + CPM1_PIO: [EMAIL PROTECTED] {
 + compatible = fsl,cpm1-pario;
 + reg = 970 180;
 + num-ports = 3;
 + #gpio-cells = 2;
 + };

Why are we doing things differently just because all of the pins on this
port happen to be directed to one device?  If it's because the Linux GPIO
API sucks, then either fix the API, or work around the suckage in software,
not the device tree.

 + [EMAIL PROTECTED] {
 + reg = 970 10;
 + compatible = samsung,ks0713;
 + };

So some driver that matches on samsung,ks0713 has to know the details of the
mpc8xx GPIO registers?

 + [EMAIL PROTECTED] {
 + compatible = fsl,mpc823-brg,
 +  fsl,cpm1-brg,
 +  fsl,cpm-brg;
 + reg = 9f0 10;
 + };

Should have clock-frequency in the brg node.

 + [EMAIL PROTECTED] {
 + compatible = fsl,mpc823-i2c,
 +  fsl,cpm1-i2c,
 +  fsl,cpm-i2c;
 + reg = 860 20 3c80 30;
 + interrupts = 10 3;
 +

Re: [PATCH/RFC] powerpc: DBox2 Board Support

2008-01-02 Thread Jochen Friedrich
Hi Scott,

 These unit addresses look wrong.

I know. These have (hopefully) been fixed in v3.

 What does dbox2-config mean?

I used it to search for the vendor info byte in the flash. It has been moved to 
the boot wrapper in v3.
Later this should all be moved to u-boot, IMHO.

 +[EMAIL PROTECTED] {
 +label = Flash without bootloader;
 +reg = 2 7e;
 +};
 +[EMAIL PROTECTED] {
 +label = Complete Flash;
 +reg = 0 80;
 +read-only;
 +};
 
 What is ovpartition?

Overlay partition. Is there a better way to specify this?

 +// Port D is LCD exclusive. Don't export as GPIO
 +CPM1_PIO: [EMAIL PROTECTED] {
 +compatible = fsl,cpm1-pario;
 +reg = 970 180;
 +num-ports = 3;
 +#gpio-cells = 2;
 +};
 
 Why are we doing things differently just because all of the pins on this
 port happen to be directed to one device?  If it's because the Linux GPIO
 API sucks, then either fix the API, or work around the suckage in software,
 not the device tree.
 
 +[EMAIL PROTECTED] {
 +reg = 970 10;
 +compatible = samsung,ks0713;
 +};
 
 So some driver that matches on samsung,ks0713 has to know the details of the
 mpc8xx GPIO registers?

The GPIO API only has an accessor for 1bit I/O. The LCD, however has for 1bit
control lines and an 8bit port. The GPIO API currently is unable to handle this.

 +[EMAIL PROTECTED] {
 +compatible = fsl,mpc823-i2c,
 + fsl,cpm1-i2c,
 + fsl,cpm-i2c;
 +reg = 860 20 3c80 30;
 +interrupts = 10 3;
 +interrupt-parent = CPM_PIC;
 +fsl,cpm-command = 0010;
 +};
 
 Should have #address-cells and #size-cells.

In the meantime, i use the i2c patches from Jon Smirl and have added
these parameters.

 
 +enum dbox2_mid dbox2_get_mid(void)
 +{
 +return dbox2_manuf_id;
 +}
 +EXPORT_SYMBOL_GPL(dbox2_get_mid);
 
 Honestly, you're claiming derived-work status by calling a function that
 returns an integer, that was read directly from hardware?

Nope. It was a big fat hint not to use this value :). It has been moved to the
device tree in the mean time.

 I'd use separate device trees (I only did this kind of thing in mpc885ads
 because it's dip-switchable), but whatever...

I don't really like having to use different images on different DBoxes. It's
already too much to have two images (there are two different flash layouts).
People tend to brick their box by flashing the wrong image.

 --- a/include/asm-powerpc/mpc8xx.h
 +++ b/include/asm-powerpc/mpc8xx.h
 @@ -23,6 +23,10 @@
 #include platforms/8xx/mpc885ads.h
 #endif

 +#if defined(CONFIG_DBOX2)
 +#include platforms/8xx/dbox2.h
 +#endif
 
 This shouldn't be needed.

Already gone in v3.

 What happens if a device sits on two different gpio-parents?

On the dbox2, there are even stranger devices. One is using iomaped address 
spaces, GPIO and an i2c control interface.
Another one uses GPIO and an i2c control interface. For now, they appear twice 
in the device tree (once under i2c and 
once under localbus or pio). Is there a better way to do this?

[EMAIL PROTECTED] {
[EMAIL PROTECTED],0 {
compatible = betaresearch,dbox2-cam;
reg = 3 0 2 6 0 2;
interrupts = 6 2;
interrupt-parent = PIC;
gpios = 1 1c 1 1d 1 1e 1 1f;
gpio-parent = CPM1_PIO;
};
};
[EMAIL PROTECTED] {
[EMAIL PROTECTED] {
CPM1_PIO: [EMAIL PROTECTED] {
[EMAIL PROTECTED],0 {
compatible = betaresearch,dbox2-fp;
interrupts = 4 2;
interrupt-parent = PIC;
gpios = 0 e;
gpio-parent = CPM1_PIO;
};
};
[EMAIL PROTECTED] {
[EMAIL PROTECTED] {
compatible = betaresearch,dbox2-fp;
reg = 30;
};
[EMAIL PROTECTED] {
compatible = betaresearch,dbox2-cam;
reg = 37;
};  
};
};
};

Thanks,
Jochen
___

Re: [PATCH/RFC] powerpc: DBox2 Board Support

2008-01-02 Thread Scott Wood
Jochen Friedrich wrote:
 +[EMAIL PROTECTED] {
 +label = Flash without bootloader;
 +reg = 2 7e;
 +};
 +[EMAIL PROTECTED] {
 +label = Complete Flash;
 +reg = 0 80;
 +read-only;
 +};

 What is ovpartition?
 
 Overlay partition. Is there a better way to specify this?

Not sure... what will the mtd code do with this?

 +[EMAIL PROTECTED] {
 +reg = 970 10;
 +compatible = samsung,ks0713;
 +};

 So some driver that matches on samsung,ks0713 has to know the details 
 of the
 mpc8xx GPIO registers?
 
 The GPIO API only has an accessor for 1bit I/O. The LCD, however has for 
 1bit
 control lines and an 8bit port. The GPIO API currently is unable to 
 handle this.

Right, but we shouldn't weird up the device tree because of Linux's 
weaknesses.  Ideally, the GPIO API should support wider I/O; in the 
meantime, there should be something in the board file that tells the 
ks0713 driver what to do.

 I'd use separate device trees (I only did this kind of thing in mpc885ads
 because it's dip-switchable), but whatever...
 
 I don't really like having to use different images on different DBoxes. 
 It's
 already too much to have two images (there are two different flash 
 layouts).
 People tend to brick their box by flashing the wrong image.

Fair enough.

 [EMAIL PROTECTED] {
 [EMAIL PROTECTED],0 {
 compatible = betaresearch,dbox2-cam;
 reg = 3 0 2 6 0 2;
 interrupts = 6 2;
 interrupt-parent = PIC;
 gpios = 1 1c 1 1d 1 1e 1 1f;
 gpio-parent = CPM1_PIO;
 };
 };
 [EMAIL PROTECTED] {
 [EMAIL PROTECTED] {
 CPM1_PIO: [EMAIL PROTECTED] {
 [EMAIL PROTECTED],0 {
 compatible = betaresearch,dbox2-fp;
 interrupts = 4 2;
 interrupt-parent = PIC;
 gpios = 0 e;
 gpio-parent = CPM1_PIO;
 };
 };
 [EMAIL PROTECTED] {
 [EMAIL PROTECTED] {
 compatible = betaresearch,dbox2-fp;
 reg = 30;
 };
 [EMAIL PROTECTED] {
 compatible = betaresearch,dbox2-cam;
 reg = 37;
 };   
 };
 };
 };

I'd make the compatible name specific to the interface (e.g. 
betaresearch,dbox2-cam-mmio, betaresearch,dbox2-fp-i2c), use reg 
rather than gpios/gpio-parent, and use phandle linkage between the 
different inteferfaces of a device.  But yes, multiple nodes is the 
sanest way to do it.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH/RFC] powerpc: DBox2 Board Support

2007-12-26 Thread Jochen Friedrich
Hi David,

 +  // Port D is LCD exclusive. Don't export as GPIO
 +  CPM1_PIO: [EMAIL PROTECTED] {
 +  compatible = fsl,cpm1-pario;
 +  reg = 970 180;
 +  num-ports = 3;
 +  #gpio-cells = 2;
 +  };
 +
 +  [EMAIL PROTECTED] {
 +  reg = 970 10;
 +  compatible = samsung,ks0713;
 Is this representing an LCD controller, or the display itself.  Either
 way I'm surprised there's something here in the SoC that has a
 compatible string that's not fsl,something
 It's a LCD controller wired to PortD. PortD is used for four 1bit lines
 and one 8bit bus.
 
 I'm still kind of confused here.  Does the [EMAIL PROTECTED] node above
 represent the PortD controller?  If the LCD controller is accessed
 solely through PortD, then it should be a child of the PortD node.
 
 At present, pio and lcd have overlapping reg resources which is
 certainly wrong.
 

[EMAIL PROTECTED] represent 4 ports (A-D). Ports A-C are used as GPIO lines. 
Port D
is exclusively used for the LCD, but it needs an 8bit accessor. Unfortunately,
the GPIO API doesn't have such an accessor, so the LCD driver needs to access
Port D itself and needs to make sure no other driver can access Port D via the
GPIO API. The representation as child of pio seems reasonable.

Thanks,
Jochen
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH/RFC] powerpc: DBox2 Board Support

2007-12-24 Thread Jochen Friedrich
Hi David,

 +[EMAIL PROTECTED] {
 +compatible = betaresearch,dbox2-localbus;
 
 Is this bus interface really board specific?  I would have thought the
 localbus bridge would have been part of the SoC in which case the
 compatible string should mention the 823 rather than the dbox.
 
 +#address-cells = 1;
 
 It's also usual for these localbus things, to have #address-cells of
 2, with the chipselect explicitly present as the first cell.

The setup of the localbus is already done in the boot loader. However, i'll
recode this to reflect the mapping of addresses to chipselects.

 +#size-cells = 1;
 +reg = 800 1800;
 +
 +ranges = 0 800 1800;
 +
 +[EMAIL PROTECTED] {
 +compatible = c-cube,enx;
 
 What are these mysterious enx, gtx, etc. devices?  Some comments might
 be nice.

Those are mostly devices for video processing (MPEG demux, on screen display, 
MPEG decoder, etc).
Drivers (for ARCH=ppc) are available on cvs.tuxbox.org with GPL license. A work 
in progress port
to ARCH=powerpc is at git://git.bocc.de/dbox2.git.

 +// Port D is LCD exclusive. Don't export as GPIO
 +CPM1_PIO: [EMAIL PROTECTED] {
 +compatible = fsl,cpm1-pario;
 +reg = 970 180;
 +num-ports = 3;
 +#gpio-cells = 2;
 +};
 +
 +[EMAIL PROTECTED] {
 +reg = 970 10;
 +compatible = samsung,ks0713;
 
 Is this representing an LCD controller, or the display itself.  Either
 way I'm surprised there's something here in the SoC that has a
 compatible string that's not fsl,something

It's a LCD controller wired to PortD. PortD is used for four 1bit lines
and one 8bit bus.

Would something like this be better?

CPM1_PIO: [EMAIL PROTECTED] {
compatible = fsl,cpm1-pario;
reg = 970 180;
num-ports = 4;
#gpio-cells = 2;
};

[EMAIL PROTECTED] {
compatible = samsung,ks0713;
gpio-parent = CPM1_PIO;
gpio-port = 3;
}

And then run gpio_request() for all lines on this port in the driver?

Thanks,
Jochen
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH/RFC] powerpc: DBox2 Board Support

2007-12-24 Thread Kumar Gala

 diff --git a/include/asm-powerpc/mpc8xx.h b/include/asm-powerpc/ 
 mpc8xx.h
 index 2be014b..b6fd7d6 100644
 --- a/include/asm-powerpc/mpc8xx.h
 +++ b/include/asm-powerpc/mpc8xx.h
 @@ -23,6 +23,10 @@
 #include platforms/8xx/mpc885ads.h
 #endif

 +#if defined(CONFIG_DBOX2)
 +#include platforms/8xx/dbox2.h
 +#endif
 +
 #ifdef CONFIG_PCMCIA_M8XX
 extern struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops;
 #endif

is this really needed?  if so why.  we should work towards not having  
to do this going forward.

(I cant believe its needed since dbox2.h doesn't seem to have anything  
defined we'd need anywhere else).

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH/RFC] powerpc: DBox2 Board Support

2007-12-24 Thread David Gibson
On Mon, Dec 24, 2007 at 12:01:35PM +0100, Jochen Friedrich wrote:
 Hi David,
 
  +  [EMAIL PROTECTED] {
  +  compatible = betaresearch,dbox2-localbus;
  
  Is this bus interface really board specific?  I would have thought the
  localbus bridge would have been part of the SoC in which case the
  compatible string should mention the 823 rather than the dbox.
  
  +  #address-cells = 1;
  
  It's also usual for these localbus things, to have #address-cells of
  2, with the chipselect explicitly present as the first cell.
 
 The setup of the localbus is already done in the boot loader. However, i'll
 recode this to reflect the mapping of addresses to chipselects.

Sure, that's normal.  But to the greatest extent possible, the device
tree should describe the hardware, not the configuration that's been
set up by the firmware/bootloader.  It's usually not possible to get
all the way there, but encoding the chipselect information this way
gets you closer.  It means that if you later need to adapt the device
tree to the same board with a firmware that does things differently,
only the ranges property should need changing.  Or, if you later
need a kernel port to a version with no-firmware or minimal firmware
that doesn't configure the bus, the necessary information is in the
tree to configure the bridge.

  +  #size-cells = 1;
  +  reg = 800 1800;
  +
  +  ranges = 0 800 1800;
  +
  +  [EMAIL PROTECTED] {
  +  compatible = c-cube,enx;
  
  What are these mysterious enx, gtx, etc. devices?  Some comments might
  be nice.
 
 Those are mostly devices for video processing (MPEG demux, on screen display, 
 MPEG decoder, etc).
 Drivers (for ARCH=ppc) are available on cvs.tuxbox.org with GPL license. A 
 work in progress port
 to ARCH=powerpc is at git://git.bocc.de/dbox2.git.

Ok.  Again, some comments so a casual read of the tree tells you
roughly what they are would be nice.

  +  // Port D is LCD exclusive. Don't export as GPIO
  +  CPM1_PIO: [EMAIL PROTECTED] {
  +  compatible = fsl,cpm1-pario;
  +  reg = 970 180;
  +  num-ports = 3;
  +  #gpio-cells = 2;
  +  };
  +
  +  [EMAIL PROTECTED] {
  +  reg = 970 10;
  +  compatible = samsung,ks0713;
  
  Is this representing an LCD controller, or the display itself.  Either
  way I'm surprised there's something here in the SoC that has a
  compatible string that's not fsl,something
 
 It's a LCD controller wired to PortD. PortD is used for four 1bit lines
 and one 8bit bus.

I'm still kind of confused here.  Does the [EMAIL PROTECTED] node above
represent the PortD controller?  If the LCD controller is accessed
solely through PortD, then it should be a child of the PortD node.

At present, pio and lcd have overlapping reg resources which is
certainly wrong.

-- 
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/RFC] powerpc: DBox2 Board Support

2007-12-23 Thread Stephen Rothwell
On Sat, 22 Dec 2007 20:13:31 +0100 Jochen Friedrich [EMAIL PROTECTED] wrote:

 +++ b/arch/powerpc/platforms/8xx/dbox2.h
 +
 +#include sysdev/fsl_soc.h

Nothing in this header files uses anything in that one, so don't include
it.

 +++ b/arch/powerpc/platforms/8xx/dbox2_setup.c
 +
 +char *dbox2_manuf_name[3] = {

static const.

 + Nokia,
 + Philips,
 + Sagem,
 +};
 +
 +static enum dbox2_mid dbox2_manuf_id;
 +
 +struct cpm_pin {
 + int port, pin, flags;
 +};
 +
 +static struct cpm_pin dbox2_pins[] = {

const?

 +static int __init dbox2_probe(void)
 +{
 + unsigned long root = of_get_flat_dt_root();
 + return of_flat_dt_is_compatible(root, betaresearch,dbox2);

You should include asm/prom.h to use the flattened device tree function.

 +static struct of_device_id __initdata of_bus_ids[] = {

__initdata

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/


pgpAWkHD7bDqZ.pgp
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH/RFC] powerpc: DBox2 Board Support

2007-12-23 Thread David Gibson
On Sat, Dec 22, 2007 at 08:13:31PM +0100, Jochen Friedrich wrote:
 This patch adds device tree source, default config and setup code for
 DBox2 devices.

[snip]
 diff --git a/arch/powerpc/boot/dts/dbox2.dts b/arch/powerpc/boot/dts/dbox2.dts
 new file mode 100644
 index 000..8d91510
 --- /dev/null
 +++ b/arch/powerpc/boot/dts/dbox2.dts
 @@ -0,0 +1,263 @@
 +/*
 + * DBOX2 Device Tree Source
 + *
 + * Copyright 2007 Jochen Friedrich [EMAIL PROTECTED]
 + *
 + * 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.
 + */
 +
 +/ {
 + model = Dbox2;
 + compatible = betaresearch,dbox2;
 + #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 = d#16;
 + i-cache-line-size = d#16;
 + d-cache-size = d#1024;
 + i-cache-size = d#2048;
 + timebase-frequency = 0;
 + bus-frequency = 0;
 + clock-frequency = 0;
 + interrupts = f 2; // decrementer interrupt
 + interrupt-parent = PIC;
 + };
 + };
 +
 + memory {
 + device_type = memory;
 + reg = 0 200;
 + };
 +
 + [EMAIL PROTECTED] {
 + compatible = betaresearch,dbox2-localbus;

Is this bus interface really board specific?  I would have thought the
localbus bridge would have been part of the SoC in which case the
compatible string should mention the 823 rather than the dbox.

 + #address-cells = 1;

It's also usual for these localbus things, to have #address-cells of
2, with the chipselect explicitly present as the first cell.

 + #size-cells = 1;
 + reg = 800 1800;
 +
 + ranges = 0 800 1800;
 +
 + [EMAIL PROTECTED] {
 + compatible = c-cube,enx;

What are these mysterious enx, gtx, etc. devices?  Some comments might
be nice.

[snip]
 + [EMAIL PROTECTED] {
 + // Flash also has info about model needed by setup
 + compatible = cfi-flash,
 +  betaresearch,dbox2-config;

compatible strings should be listed with most specific first, most
general last.  That would put cfi-flash after the dbox2 specific
string, I believe.

[snip]
 + [EMAIL PROTECTED] {
 + compatible = fsl,mpc823,
 +  fsl,pq1-soc;
 + #address-cells = 1;
 + #size-cells = 1;
 + device_type = soc;
 + ranges = 0 ff00 4000;
 + reg = ff00 4000;
 + bus-frequency = 0;
 +
 + PIC: [EMAIL PROTECTED] {
 + interrupt-controller;
 + #address-cells = 0;
 + #interrupt-cells = 2;
 + reg = 0 24;
 + compatible = fsl,mpc823-pic,
 +  fsl,pq1-pic;
 + };
 +
 + [EMAIL PROTECTED] {
 + device_type = watchdog;

Drop this device_type.

 + compatible = fsl,mpc823-wdt,
 +  fsl,pq1-wdt;
 + reg = 0 10;
 + };
 +
 + [EMAIL PROTECTED] {
 + #address-cells = 1;
 + #size-cells = 1;
 + ranges;
 + reg = 9c0 40;
 + command-proc = 9c0;
 + interrupts = 0 2; // cpm error interrupt
 + interrupt-parent = CPM_PIC;
 + compatible = fsl,mpc823-cpm,
 +  fsl,cpm1;
 +
 + [EMAIL PROTECTED] {
 + #address-cells = 1;
 + #size-cells = 1;
 + ranges = 0 2000 2000;
 +
 + [EMAIL PROTECTED] {
 + compatible = fsl,cpm-muram-data;
 + reg = 0 1c00;
 + };
 + };
 +
 + // Port D is LCD exclusive. Don't export as GPIO
 + CPM1_PIO: [EMAIL PROTECTED] {
 + compatible = fsl,cpm1-pario;
 + reg = 970 180;
 + num-ports = 3;
 + #gpio-cells = 2;
 + };
 +
 + [EMAIL PROTECTED] {
 + reg = 

[PATCH/RFC] powerpc: DBox2 Board Support

2007-12-22 Thread Jochen Friedrich
This patch adds device tree source, default config and setup code for
DBox2 devices.

Signed-off-by: Jochen Friedrich [EMAIL PROTECTED]
---
 arch/powerpc/boot/dts/dbox2.dts  |  263 
 arch/powerpc/configs/dbox2_defconfig | 1042 ++
 arch/powerpc/platforms/8xx/Kconfig   |7 +
 arch/powerpc/platforms/8xx/Makefile  |1 +
 arch/powerpc/platforms/8xx/dbox2.h   |   32 +
 arch/powerpc/platforms/8xx/dbox2_setup.c |  225 +++
 include/asm-powerpc/mpc8xx.h |4 +
 7 files changed, 1574 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/dbox2.dts
 create mode 100644 arch/powerpc/configs/dbox2_defconfig
 create mode 100644 arch/powerpc/platforms/8xx/dbox2.h
 create mode 100644 arch/powerpc/platforms/8xx/dbox2_setup.c

diff --git a/arch/powerpc/boot/dts/dbox2.dts b/arch/powerpc/boot/dts/dbox2.dts
new file mode 100644
index 000..8d91510
--- /dev/null
+++ b/arch/powerpc/boot/dts/dbox2.dts
@@ -0,0 +1,263 @@
+/*
+ * DBOX2 Device Tree Source
+ *
+ * Copyright 2007 Jochen Friedrich [EMAIL PROTECTED]
+ *
+ * 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.
+ */
+
+/ {
+   model = Dbox2;
+   compatible = betaresearch,dbox2;
+   #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 = d#16;
+   i-cache-line-size = d#16;
+   d-cache-size = d#1024;
+   i-cache-size = d#2048;
+   timebase-frequency = 0;
+   bus-frequency = 0;
+   clock-frequency = 0;
+   interrupts = f 2; // decrementer interrupt
+   interrupt-parent = PIC;
+   };
+   };
+
+   memory {
+   device_type = memory;
+   reg = 0 200;
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = betaresearch,dbox2-localbus;
+   #address-cells = 1;
+   #size-cells = 1;
+   reg = 800 1800;
+
+   ranges = 0 800 1800;
+
+   [EMAIL PROTECTED] {
+   compatible = c-cube,enx;
+   reg = 0 3400 100 20;
+   interrupts = 2 2;
+   interrupt-parent = PIC;
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = c-cube,gtx;
+   reg = 40 3000 0 20;
+   interrupts = 2 2;
+   interrupt-parent = PIC;
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = betaresearch,dbox2-fp;
+   interrupts = 4 2;
+   interrupt-parent = PIC;
+   gpios = 0 e;
+   gpio-parent = CPM1_PIO;
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = betaresearch,dbox2-fe;
+   interrupts = e 2;
+   interrupt-parent = PIC;
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = c-cube,avia;
+   reg = 200 200;
+   interrupts = 8 2;
+   interrupt-parent = PIC;
+   };
+   [EMAIL PROTECTED] {
+   compatible = betaresearch,dbox2-cam;
+   reg = 400 2;
+   interrupts = 6 2;
+   interrupt-parent = PIC;
+   gpios = 1 1c 1 1d 1 1e 1 1f;
+   gpio-parent = CPM1_PIO;
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = betaresearch,dbox2-cam;
+   reg = 404 2;
+   interrupts = 6 2;
+   interrupt-parent = PIC;
+   gpios = 1 1c 1 1d 1 1e 1 1f;
+   gpio-parent = CPM1_PIO;
+   };
+
+   [EMAIL PROTECTED] {
+   // Flash also has info about model needed by setup
+   compatible = cfi-flash,
+betaresearch,dbox2-config;
+   reg = 800 80;
+   bank-width = 4;
+   device-width = 1;
+   #address-cells = 1;
+   #size-cells = 1;
+   [EMAIL PROTECTED] {
+   label = BR