Re: [PATCH] [8xx] powerpc: Add support for the MPC852 based mgsuvd board from keymile.

2008-08-29 Thread Kumar Gala


On Jun 14, 2008, at 2:02 PM, Heiko Schocher wrote:


here the updated patch for the mgsuvd board.

[powerpc]  add support for the MPC852 based mgsuvd board from
  keymile to arch/powerpc. Supported SMC1 (serial console),
  SCC3 Ethernet (10Mbps hdx).

Signed-off-by: Heiko Schocher [EMAIL PROTECTED]
---
arch/powerpc/boot/dts/mgsuvd.dts  |  163 ++
arch/powerpc/configs/mgsuvd_defconfig |  872  
+

arch/powerpc/platforms/8xx/Kconfig|6 +
arch/powerpc/platforms/8xx/Makefile   |1 +
arch/powerpc/platforms/8xx/mgsuvd.c   |   92 
5 files changed, 1134 insertions(+), 0 deletions(-)
create mode 100644 arch/powerpc/boot/dts/mgsuvd.dts
create mode 100644 arch/powerpc/configs/mgsuvd_defconfig
create mode 100644 arch/powerpc/platforms/8xx/mgsuvd.c




applied to powerpc-next.

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


Re: [PATCH] [8xx] powerpc: Add support for the MPC852 based mgsuvd board from keymile.

2008-06-14 Thread Stephen Rothwell
Hi Heiko,

On Fri, 13 Jun 2008 21:56:00 +0200 Heiko Schocher [EMAIL PROTECTED] wrote:

 +++ b/arch/powerpc/platforms/8xx/mgsuvd.c
 @@ -0,0 +1,93 @@
 +/* arch/powerpc/platforms/8xx/mgsuvd.c

We have stopped putting file names in files.

 +#include linux/ioport.h
 +#include linux/device.h
 +#include linux/of_platform.h
 +
 +#include asm/io.h
 +#include asm/machdep.h
 +#include asm/processor.h
 +#include asm/system.h
 +#include asm/cpm1.h
 +#include asm/fs_pd.h

I am petty sure you don't need to include linux/device.h, but you should
include asm/prom.h for the flat device tree accessors.

Also, we don't put a space between a function name and the opening
parenthesis.

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


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

Re: [PATCH] [8xx] powerpc: Add support for the MPC852 based mgsuvd board from keymile.

2008-06-14 Thread Heiko Schocher
Hello Stephen,

Stephen Rothwell wrote:
 On Fri, 13 Jun 2008 21:56:00 +0200 Heiko Schocher [EMAIL PROTECTED] wrote:
 +++ b/arch/powerpc/platforms/8xx/mgsuvd.c
 @@ -0,0 +1,93 @@
 +/* arch/powerpc/platforms/8xx/mgsuvd.c
 
 We have stopped putting file names in files.
 
 +#include linux/ioport.h
 +#include linux/device.h
 +#include linux/of_platform.h
 +
 +#include asm/io.h
 +#include asm/machdep.h
 +#include asm/processor.h
 +#include asm/system.h
 +#include asm/cpm1.h
 +#include asm/fs_pd.h
 
 I am petty sure you don't need to include linux/device.h, but you should
 include asm/prom.h for the flat device tree accessors.
 
 Also, we don't put a space between a function name and the opening
 parenthesis.

Argh, you are right!

here the updated patch for the mgsuvd board.

[powerpc]  add support for the MPC852 based mgsuvd board from
   keymile to arch/powerpc. Supported SMC1 (serial console),
   SCC3 Ethernet (10Mbps hdx).

Signed-off-by: Heiko Schocher [EMAIL PROTECTED]
---
 arch/powerpc/boot/dts/mgsuvd.dts  |  163 ++
 arch/powerpc/configs/mgsuvd_defconfig |  872 +
 arch/powerpc/platforms/8xx/Kconfig|6 +
 arch/powerpc/platforms/8xx/Makefile   |1 +
 arch/powerpc/platforms/8xx/mgsuvd.c   |   92 
 5 files changed, 1134 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/mgsuvd.dts
 create mode 100644 arch/powerpc/configs/mgsuvd_defconfig
 create mode 100644 arch/powerpc/platforms/8xx/mgsuvd.c

diff --git a/arch/powerpc/boot/dts/mgsuvd.dts b/arch/powerpc/boot/dts/mgsuvd.dts
new file mode 100644
index 000..f78d5de
--- /dev/null
+++ b/arch/powerpc/boot/dts/mgsuvd.dts
@@ -0,0 +1,163 @@
+/*
+ * MGSUVD Device Tree Source
+ *
+ * Copyright 2008 DENX Software Engineering GmbH
+ * Heiko Schocher [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.
+ */
+
+/dts-v1/;
+/ {
+   model = MGSUVD;
+   compatible = keymile,mgsuvd;
+   #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 = 16;
+   i-cache-line-size = 16;
+   d-cache-size = 8192;
+   i-cache-size = 8192;
+   timebase-frequency = 0;   /* Filled in by u-boot 
*/
+   bus-frequency = 0;/* Filled in by u-boot 
*/
+   clock-frequency = 0;  /* Filled in by u-boot 
*/
+   interrupts = 15 2;/* decrementer 
interrupt */
+   interrupt-parent = PIC;
+   };
+   };
+
+   memory {
+   device_type = memory;
+   reg =  0x400;  /* Filled in by u-boot */
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,mpc852-localbus, fsl,pq1-localbus, 
simple-bus;
+   #address-cells = 2;
+   #size-cells = 1;
+   reg = 0xfff00100 0x40;
+
+   ranges = 0 0 0xf000 0x0100;  /* Filled in by u-boot */
+
+   [EMAIL PROTECTED],0 {
+   compatible = cfi-flash;
+   reg = 0 0 0x100;
+   #address-cells = 1;
+   #size-cells = 1;
+   bank-width = 1;
+   device-width = 1;
+   [EMAIL PROTECTED] {
+   label = u-boot;
+   reg = 0 0x8;
+   };
+   [EMAIL PROTECTED] {
+   label = env;
+   reg = 0x8 0x2;
+   };
+   [EMAIL PROTECTED] {
+   label = kernel;
+   reg = 0xa 0x1e;
+   };
+   [EMAIL PROTECTED] {
+   label = dtb;
+   reg = 0x28 0x2;
+   };
+   [EMAIL PROTECTED] {
+   label = root;
+   reg = 0x2a 0x50;
+   };
+   [EMAIL PROTECTED] {
+   label = user;
+   reg = 0x7a 0x86;
+   };
+   };
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,mpc852, fsl,pq1-soc, simple-bus;
+   #address-cells = 1;
+   #size-cells = 1;
+  

Re: [PATCH] [8xx] powerpc: Add support for the MPC852 based mgsuvd board from keymile.

2008-06-14 Thread Stephen Rothwell
On Sat, 14 Jun 2008 21:02:04 +0200 Heiko Schocher [EMAIL PROTECTED] wrote:

 [powerpc]  add support for the MPC852 based mgsuvd board from
keymile to arch/powerpc. Supported SMC1 (serial console),
SCC3 Ethernet (10Mbps hdx).
 
 Signed-off-by: Heiko Schocher [EMAIL PROTECTED]

Reviewed-by: Stephen Rothwell [EMAIL PROTECTED] Structure/syntax of
Kconfig, Makefile, mgsuvd.c

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


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

Re: [PATCH] [8xx] powerpc: Add support for the MPC852 based mgsuvd board from keymile.

2008-06-13 Thread Heiko Schocher
Hello Scott,

here comes the updated version for the mgsuvd port with your
suggested changes:

[powerpc] add support for the MPC852 based mgsuvd board from
keymile to arch/powerpc. Supported SMC1 (serial console),
SCC3 Ethernet (10Mbps hdx).

Signed-off-by: Heiko Schocher [EMAIL PROTECTED]
---
 arch/powerpc/boot/dts/mgsuvd.dts  |  163 ++
 arch/powerpc/configs/mgsuvd_defconfig |  872 +
 arch/powerpc/platforms/8xx/Kconfig|6 +
 arch/powerpc/platforms/8xx/Makefile   |1 +
 arch/powerpc/platforms/8xx/mgsuvd.c   |   93 
 5 files changed, 1135 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/mgsuvd.dts
 create mode 100644 arch/powerpc/configs/mgsuvd_defconfig
 create mode 100644 arch/powerpc/platforms/8xx/mgsuvd.c

diff --git a/arch/powerpc/boot/dts/mgsuvd.dts b/arch/powerpc/boot/dts/mgsuvd.dts
new file mode 100644
index 000..4b05346
--- /dev/null
+++ b/arch/powerpc/boot/dts/mgsuvd.dts
@@ -0,0 +1,163 @@
+/*
+ * MGSUVD Device Tree Source
+ *
+ * Copyright 2008 DENX Software Engineering GmbH
+ * Heiko Schocher [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.
+ */
+
+/dts-v1/;
+/ {
+   model = MGSUVD;
+   compatible = keymile,mgsuvd;
+   #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 = 16;
+   i-cache-line-size = 16;
+   d-cache-size = 8192;
+   i-cache-size = 8192;
+   timebase-frequency = 0;   /* Filled in by u-boot 
*/
+   bus-frequency = 0;/* Filled in by u-boot 
*/
+   clock-frequency = 0;  /* Filled in by u-boot 
*/
+   interrupts = 15 2;/* decrementer 
interrupt */
+   interrupt-parent = PIC;
+   };
+   };
+
+   memory {
+   device_type = memory;
+   reg =  0x400;  /* Filled in by u-boot */
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,pq1-localbus;
+   #address-cells = 2;
+   #size-cells = 1;
+   reg = 0xfff00100 0x40;
+
+   ranges = 0 0 0xf000 0x0100;  /* Filled in by u-boot */
+
+   [EMAIL PROTECTED],0 {
+   compatible = cfi-flash;
+   reg = 0 0 0x100;
+   #address-cells = 1;
+   #size-cells = 1;
+   bank-width = 1;
+   device-width = 1;
+   [EMAIL PROTECTED] {
+   label = u-boot;
+   reg = 0 0x8;
+   };
+   [EMAIL PROTECTED] {
+   label = env;
+   reg = 0x8 0x2;
+   };
+   [EMAIL PROTECTED] {
+   label = kernel;
+   reg = 0xa 0x1e;
+   };
+   [EMAIL PROTECTED] {
+   label = dtb;
+   reg = 0x28 0x2;
+   };
+   [EMAIL PROTECTED] {
+   label = root;
+   reg = 0x2a 0x50;
+   };
+   [EMAIL PROTECTED] {
+   label = user;
+   reg = 0x7a 0x86;
+   };
+   };
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,mpc852, simple-bus, fsl,pq1-soc;
+   #address-cells = 1;
+   #size-cells = 1;
+   device_type = soc;
+   ranges = 0 0xfff0 0x4000;
+
+   PIC: [EMAIL PROTECTED] {
+   interrupt-controller;
+   #interrupt-cells = 2;
+   reg = 0 24;
+   compatible = fsl,pq1-pic;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 1;
+   compatible = fsl,mpc852-cpm, simple-bus, fsl,cpm1;
+   interrupts = 0;   /* cpm error interrupt */
+   interrupt-parent = CPM_PIC;
+   reg = 0x9c0 10;
+   ranges;
+
+   

Re: [PATCH] [8xx] powerpc: Add support for the MPC852 based mgsuvd board from keymile.

2008-06-13 Thread Scott Wood

Heiko Schocher wrote:

+   [EMAIL PROTECTED] {
+   compatible = fsl,pq1-localbus;


fsl,mpc852-localbus, fsl,pq1-localbus, simple-bus;


+   [EMAIL PROTECTED] {
+   compatible = fsl,mpc852, simple-bus, fsl,pq1-soc;


simple-bus should come last, since it's the most generic.


+   #address-cells = 1;
+   #size-cells = 1;
+   device_type = soc;
+   ranges = 0 0xfff0 0x4000;
+
+   PIC: [EMAIL PROTECTED] {
+   interrupt-controller;
+   #interrupt-cells = 2;
+   reg = 0 24;
+   compatible = fsl,pq1-pic;


fsl,mpc852-pic, fsl,pq1-pic;

In general, a chip-specific name should be listed first, so the driver 
can easily apply workarounds if needed.  See the existing 8xx device 
trees for examples.


-Scott

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


Re: [PATCH] [8xx] powerpc: Add support for the MPC852 based mgsuvd board from keymile.

2008-06-13 Thread Heiko Schocher
Hello Scott,

here the next try for the mgsuvd board:

[powerpc]  add support for the MPC852 based mgsuvd board from
   keymile to arch/powerpc. Supported SMC1 (serial console),
   SCC3 Ethernet (10Mbps hdx).

Signed-off-by: Heiko Schocher [EMAIL PROTECTED]
---
 arch/powerpc/boot/dts/mgsuvd.dts  |  163 ++
 arch/powerpc/configs/mgsuvd_defconfig |  872 +
 arch/powerpc/platforms/8xx/Kconfig|6 +
 arch/powerpc/platforms/8xx/Makefile   |1 +
 arch/powerpc/platforms/8xx/mgsuvd.c   |   93 
 5 files changed, 1135 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/mgsuvd.dts
 create mode 100644 arch/powerpc/configs/mgsuvd_defconfig
 create mode 100644 arch/powerpc/platforms/8xx/mgsuvd.c

diff --git a/arch/powerpc/boot/dts/mgsuvd.dts b/arch/powerpc/boot/dts/mgsuvd.dts
new file mode 100644
index 000..f78d5de
--- /dev/null
+++ b/arch/powerpc/boot/dts/mgsuvd.dts
@@ -0,0 +1,163 @@
+/*
+ * MGSUVD Device Tree Source
+ *
+ * Copyright 2008 DENX Software Engineering GmbH
+ * Heiko Schocher [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.
+ */
+
+/dts-v1/;
+/ {
+   model = MGSUVD;
+   compatible = keymile,mgsuvd;
+   #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 = 16;
+   i-cache-line-size = 16;
+   d-cache-size = 8192;
+   i-cache-size = 8192;
+   timebase-frequency = 0;   /* Filled in by u-boot 
*/
+   bus-frequency = 0;/* Filled in by u-boot 
*/
+   clock-frequency = 0;  /* Filled in by u-boot 
*/
+   interrupts = 15 2;/* decrementer 
interrupt */
+   interrupt-parent = PIC;
+   };
+   };
+
+   memory {
+   device_type = memory;
+   reg =  0x400;  /* Filled in by u-boot */
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,mpc852-localbus, fsl,pq1-localbus, 
simple-bus;
+   #address-cells = 2;
+   #size-cells = 1;
+   reg = 0xfff00100 0x40;
+
+   ranges = 0 0 0xf000 0x0100;  /* Filled in by u-boot */
+
+   [EMAIL PROTECTED],0 {
+   compatible = cfi-flash;
+   reg = 0 0 0x100;
+   #address-cells = 1;
+   #size-cells = 1;
+   bank-width = 1;
+   device-width = 1;
+   [EMAIL PROTECTED] {
+   label = u-boot;
+   reg = 0 0x8;
+   };
+   [EMAIL PROTECTED] {
+   label = env;
+   reg = 0x8 0x2;
+   };
+   [EMAIL PROTECTED] {
+   label = kernel;
+   reg = 0xa 0x1e;
+   };
+   [EMAIL PROTECTED] {
+   label = dtb;
+   reg = 0x28 0x2;
+   };
+   [EMAIL PROTECTED] {
+   label = root;
+   reg = 0x2a 0x50;
+   };
+   [EMAIL PROTECTED] {
+   label = user;
+   reg = 0x7a 0x86;
+   };
+   };
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,mpc852, fsl,pq1-soc, simple-bus;
+   #address-cells = 1;
+   #size-cells = 1;
+   device_type = soc;
+   ranges = 0 0xfff0 0x4000;
+
+   PIC: [EMAIL PROTECTED] {
+   interrupt-controller;
+   #interrupt-cells = 2;
+   reg = 0 24;
+   compatible = fsl,mpc852-pic, fsl,pq1-pic;
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 1;
+   compatible = fsl,mpc852-cpm, fsl,cpm1, simple-bus;
+   interrupts = 0;   /* cpm error interrupt */
+   interrupt-parent = CPM_PIC;
+   reg = 0x9c0 10;
+   

Re: [PATCH] [8xx] powerpc: Add support for the MPC852 based mgsuvd board from keymile.

2008-06-12 Thread Scott Wood
On Thu, Jun 12, 2008 at 04:32:47AM +0400, Vitaly Bordug wrote:
 + interrupts = 0x0f 2;  /* decrementer 
 interrupt */

Interrupts should probably be decimal.

 + compatible = fsl,cpm1;

compatible = fsl,mpc852-cpm, fsl,cpm1.

 + command-proc = 0x9c0;

This is obsolete; there should be no remaining code that refers to it.

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

The muram node itself should also have a compatible (fsl,cpm-muram).

 + clock-frequency = 0x3ef1480;

clock-frequency should be decimal (or better, filled in by u-boot).

 + CPM_PIC: [EMAIL PROTECTED] {
 + interrupt-controller;
 + #interrupt-cells = 1;
 + interrupts = 5 2 0 2 0x20 2;
 + interrupt-parent = PIC;
 + reg = 0x930 0x20;
 + compatible = fsl,cpm1-pic;

fsl,mpc852-cpm-pic, fsl,cpm1-pic.
Likewise elsewhere.

 + /* MON-1 */
 + [EMAIL PROTECTED] {
 + device_type = serial;
 + compatible = cpm_uart,
 +  fsl,cpm1-smc-uart;
 + model = SMC;
 + device-id = 1;
 + reg = 0xa80 0x10 0x3fc0 0x40;
 + interrupts = 4;
 + interrupt-parent = CPM_PIC;
 + fsl,cpm-brg = 1;
 + fsl,cpm-command = 0x0090;
 + current-speed = 0; /* Filled in by u-boot */
 + };
 +
 + [EMAIL PROTECTED] {
 + device_type = network;
 + compatible = fs_enet,
 +  fsl,cpm1-scc-enet;
 + model = SCC;
 + device-id = 3;

The cpm_uart and fs_enet compatible values, as well as the device-id
property and this usage of the model property, are obsolete and there should
be no code remaining that references it.

 + reg = 0xa40 0x18 0x3e00 0xb0;
 + mac-address = [ 00 00 00 00 00 00 ];  /* Filled 
 in by u-boot */

Should be local-mac-address.

 + fixed-link = 0 0 0x0a 0 0;

We should move the documentation for this out of the gianfar-specific
section of booting-without-of.txt.  Speed should be decimal.

 +config PPC_MGSUVD
 + bool MGSUVD
 + select CPM1
 + select PPC_CPM_NEW_BINDING

No need to explicitly select PPC_CPM_NEW_BINDING any more.

 +struct cpm_pin {
 + int port, pin, flags;
 +};

Only one tab, please.

 +static __initdata struct of_device_id of_bus_ids[] = {
 + { .name = soc, },
 + { .name = cpm, },
 + { .name = localbus, },
 + {},
 +};

Replace these with { .compatible = simple-bus }, and add simple-bus to the
dts where appropriate.

 +static int __init declare_of_platform_devices(void)
 +{
 + of_platform_bus_probe (NULL, of_bus_ids, NULL);
 + return 0;
 +}
 +machine_device_initcall(mgsuvd, declare_of_platform_devices);
 +
 +static int __init mgsuvd_probe(void)
 +{
 + unsigned long root = of_get_flat_dt_root ();
 + return of_flat_dt_is_compatible (root, keymile,mgsuvd);
 +}

No space between a function name and the arguments -- this isn't u-boot. :-)

 +define_machine(mgsuvd) {
 + .name   = MGSUVD,
 + .probe  = mgsuvd_probe,
 + .setup_arch = mgsuvd_setup_arch,
 + .init_IRQ   = mpc8xx_pics_init,
 + .get_irq= mpc8xx_get_irq,
 + .restart= mpc8xx_restart,
 + .calibrate_decr = mpc8xx_calibrate_decr,
 + .set_rtc_time   = mpc8xx_set_rtc_time,
 + .get_rtc_time   = mpc8xx_get_rtc_time,
 +};

This tab-alignment will look like hell if viewed with another tab size...

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