Re: [PATCH] add Phytec pcm030 board support

2008-05-06 Thread Stephen Rothwell
On Tue, 6 May 2008 07:51:55 +0200 Segher Boessenkool [EMAIL PROTECTED] wrote:

  OLPC? check?
 
 No check.  The kernel hardly uses the device tree at all, there.

oh, OK.

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


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

Re: [PATCH] add Phytec pcm030 board support

2008-05-06 Thread Sascha Hauer
On Mon, May 05, 2008 at 01:22:40PM -0400, Jon Smirl wrote:
 On 5/5/08, Grant Likely [EMAIL PROTECTED] wrote:
  On Mon, May 5, 2008 at 11:01 AM, Jon Smirl [EMAIL PROTECTED] wrote:
Did this get fixed somehow? I used to need this to boot a pcm030.
 
 
  I'm sorry; I'm at a lost as to context.  Are you asking for this patch
   to be applied?  Or are you asking if this has been addressed in
   another way?
 
 Sascha said the pcm030 was working with the simple dts. I always
 needed that patch to get a pcm030 to boot. Sasha's company wrote the
 patch. I'm just wondering how it got handled, do we still need the
 patch or did he come up with some other solution.

Yes, it is working with the simple dts except for the flash support. For
this we need the Flash description in the oftree.

   
 diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
 index 272872d..c982adc 100644
 --- a/fs/jffs2/scan.c
 +++ b/fs/jffs2/scan.c
 @@ -16,6 +16,7 @@
  #include linux/pagemap.h
  #include linux/crc32.h
  #include linux/compiler.h
 +#include asm/io.h
  #include nodelist.h
  #include summary.h
  #include debug.h
 @@ -505,7 +506,7 @@ static int jffs2_scan_eraseblock (struct
 jffs2_sb_info *c, struct jffs2_eraseblo
sumptr = kmalloc(sumlen, 
  GFP_KERNEL);
if (!sumptr)
return -ENOMEM;
 -   memcpy(sumptr + sumlen -
 buf_len, buf + buf_size - buf_len, buf_len);
 +   memcpy_fromio(sumptr + sumlen
 - buf_len, buf + buf_size - buf_len, buf_len);
}
if (buf_len  sumlen) {
/* Need to read more so that
 the entire summary node is present */
 @@ -1035,7 +1036,7 @@ static int jffs2_scan_dirent_node(struct
 jffs2_sb_info *c, struct jffs2_eraseblo
if (!fd) {
return -ENOMEM;
}
 -   memcpy(fd-name, rd-name, checkedlen);
 +   memcpy_fromio(fd-name, rd-name, checkedlen);

This patch is needed because memcpy uses unaligned accesses whereas
memcpy_fromio only uses aligned accesses on the io side. See this
thread: http://ozlabs.org/pipermail/linuxppc-embedded/2006-April/022544.html


-- 
Pengutronix e.K. - Linux Solutions for Science and Industry
---
Kontakt-Informationen finden Sie im Header dieser Mail oder
auf der Webseite - http://www.pengutronix.de/impressum/ -
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] add Phytec pcm030 board support

2008-05-06 Thread Jon Smirl
On 5/6/08, Sascha Hauer [EMAIL PROTECTED] wrote:
 On Mon, May 05, 2008 at 01:22:40PM -0400, Jon Smirl wrote:
   On 5/5/08, Grant Likely [EMAIL PROTECTED] wrote:
On Mon, May 5, 2008 at 11:01 AM, Jon Smirl [EMAIL PROTECTED] wrote:
  Did this get fixed somehow? I used to need this to boot a pcm030.
   
   
I'm sorry; I'm at a lost as to context.  Are you asking for this patch
 to be applied?  Or are you asking if this has been addressed in
 another way?
  
   Sascha said the pcm030 was working with the simple dts. I always
   needed that patch to get a pcm030 to boot. Sasha's company wrote the
   patch. I'm just wondering how it got handled, do we still need the
   patch or did he come up with some other solution.


 Yes, it is working with the simple dts except for the flash support. For
  this we need the Flash description in the oftree.


 
   diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
   index 272872d..c982adc 100644
   --- a/fs/jffs2/scan.c
   +++ b/fs/jffs2/scan.c
   @@ -16,6 +16,7 @@
#include linux/pagemap.h
#include linux/crc32.h
#include linux/compiler.h
   +#include asm/io.h
#include nodelist.h
#include summary.h
#include debug.h
   @@ -505,7 +506,7 @@ static int jffs2_scan_eraseblock (struct
   jffs2_sb_info *c, struct jffs2_eraseblo
  sumptr = kmalloc(sumlen, 
 GFP_KERNEL);
  if (!sumptr)
  return -ENOMEM;
   -   memcpy(sumptr + sumlen -
   buf_len, buf + buf_size - buf_len, buf_len);
   +   memcpy_fromio(sumptr + sumlen
   - buf_len, buf + buf_size - buf_len, buf_len);
  }
  if (buf_len  sumlen) {
  /* Need to read more so that
   the entire summary node is present */
   @@ -1035,7 +1036,7 @@ static int jffs2_scan_dirent_node(struct
   jffs2_sb_info *c, struct jffs2_eraseblo
  if (!fd) {
  return -ENOMEM;
  }
   -   memcpy(fd-name, rd-name, checkedlen);
   +   memcpy_fromio(fd-name, rd-name, checkedlen);


 This patch is needed because memcpy uses unaligned accesses whereas
  memcpy_fromio only uses aligned accesses on the io side. See this
  thread: http://ozlabs.org/pipermail/linuxppc-embedded/2006-April/022544.html

Can you submit it for inclusion? That's the last thing needed to boot
a pcm030 on a standard kernel, right?

-- 
Jon Smirl
[EMAIL PROTECTED]
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] add Phytec pcm030 board support

2008-05-05 Thread Grant Likely
On Sun, May 4, 2008 at 7:16 PM, David Gibson
[EMAIL PROTECTED] wrote:
 On Fri, Apr 25, 2008 at 03:48:05PM +0200, Sascha Hauer wrote:
   Add board support for the Phytec pcm030 mpc5200b based board. It
   does not need any platform specific fixups and as such is handled
   as a mpc5200 simple platform.

  Those still whingeing about how horrible and hard and tedious the new
  world of device trees is, take note.  We've certainly had some
  teething problems as we all figure out how to use the device tree
  properly.  But this is the payoff: support for a new board added with
  one text file.  It's only going to get more common.

/me hands David a beer.

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


Re: [PATCH] add Phytec pcm030 board support

2008-05-05 Thread Jon Smirl
Did this get fixed somehow? I used to need this to boot a pcm030.

diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index 272872d..c982adc 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -16,6 +16,7 @@
 #include linux/pagemap.h
 #include linux/crc32.h
 #include linux/compiler.h
+#include asm/io.h
 #include nodelist.h
 #include summary.h
 #include debug.h
@@ -505,7 +506,7 @@ static int jffs2_scan_eraseblock (struct
jffs2_sb_info *c, struct jffs2_eraseblo
sumptr = kmalloc(sumlen, GFP_KERNEL);
if (!sumptr)
return -ENOMEM;
-   memcpy(sumptr + sumlen -
buf_len, buf + buf_size - buf_len, buf_len);
+   memcpy_fromio(sumptr + sumlen
- buf_len, buf + buf_size - buf_len, buf_len);
}
if (buf_len  sumlen) {
/* Need to read more so that
the entire summary node is present */
@@ -1035,7 +1036,7 @@ static int jffs2_scan_dirent_node(struct
jffs2_sb_info *c, struct jffs2_eraseblo
if (!fd) {
return -ENOMEM;
}
-   memcpy(fd-name, rd-name, checkedlen);
+   memcpy_fromio(fd-name, rd-name, checkedlen);
fd-name[checkedlen] = 0;

crc = crc32(0, fd-name, rd-nsize);
~

-- 
Jon Smirl
[EMAIL PROTECTED]
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] add Phytec pcm030 board support

2008-05-05 Thread Grant Likely
On Mon, May 5, 2008 at 11:01 AM, Jon Smirl [EMAIL PROTECTED] wrote:
 Did this get fixed somehow? I used to need this to boot a pcm030.

I'm sorry; I'm at a lost as to context.  Are you asking for this patch
to be applied?  Or are you asking if this has been addressed in
another way?

Cheers,
g.


  diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
  index 272872d..c982adc 100644
  --- a/fs/jffs2/scan.c
  +++ b/fs/jffs2/scan.c
  @@ -16,6 +16,7 @@
   #include linux/pagemap.h
   #include linux/crc32.h
   #include linux/compiler.h
  +#include asm/io.h
   #include nodelist.h
   #include summary.h
   #include debug.h
  @@ -505,7 +506,7 @@ static int jffs2_scan_eraseblock (struct
  jffs2_sb_info *c, struct jffs2_eraseblo
 sumptr = kmalloc(sumlen, GFP_KERNEL);
 if (!sumptr)
 return -ENOMEM;
  -   memcpy(sumptr + sumlen -
  buf_len, buf + buf_size - buf_len, buf_len);
  +   memcpy_fromio(sumptr + sumlen
  - buf_len, buf + buf_size - buf_len, buf_len);
 }
 if (buf_len  sumlen) {
 /* Need to read more so that
  the entire summary node is present */
  @@ -1035,7 +1036,7 @@ static int jffs2_scan_dirent_node(struct
  jffs2_sb_info *c, struct jffs2_eraseblo
 if (!fd) {
 return -ENOMEM;
 }
  -   memcpy(fd-name, rd-name, checkedlen);
  +   memcpy_fromio(fd-name, rd-name, checkedlen);
 fd-name[checkedlen] = 0;

 crc = crc32(0, fd-name, rd-nsize);
  ~

  --
  Jon Smirl
  [EMAIL PROTECTED]


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




-- 
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


Re: [PATCH] add Phytec pcm030 board support

2008-05-05 Thread Jon Smirl
On 5/5/08, Grant Likely [EMAIL PROTECTED] wrote:
 On Mon, May 5, 2008 at 11:01 AM, Jon Smirl [EMAIL PROTECTED] wrote:
   Did this get fixed somehow? I used to need this to boot a pcm030.


 I'm sorry; I'm at a lost as to context.  Are you asking for this patch
  to be applied?  Or are you asking if this has been addressed in
  another way?

Sascha said the pcm030 was working with the simple dts. I always
needed that patch to get a pcm030 to boot. Sasha's company wrote the
patch. I'm just wondering how it got handled, do we still need the
patch or did he come up with some other solution.



  Cheers,

 g.

  
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index 272872d..c982adc 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -16,6 +16,7 @@
 #include linux/pagemap.h
 #include linux/crc32.h
 #include linux/compiler.h
+#include asm/io.h
 #include nodelist.h
 #include summary.h
 #include debug.h
@@ -505,7 +506,7 @@ static int jffs2_scan_eraseblock (struct
jffs2_sb_info *c, struct jffs2_eraseblo
   sumptr = kmalloc(sumlen, 
 GFP_KERNEL);
   if (!sumptr)
   return -ENOMEM;
-   memcpy(sumptr + sumlen -
buf_len, buf + buf_size - buf_len, buf_len);
+   memcpy_fromio(sumptr + sumlen
- buf_len, buf + buf_size - buf_len, buf_len);
   }
   if (buf_len  sumlen) {
   /* Need to read more so that
the entire summary node is present */
@@ -1035,7 +1036,7 @@ static int jffs2_scan_dirent_node(struct
jffs2_sb_info *c, struct jffs2_eraseblo
   if (!fd) {
   return -ENOMEM;
   }
-   memcpy(fd-name, rd-name, checkedlen);
+   memcpy_fromio(fd-name, rd-name, checkedlen);
   fd-name[checkedlen] = 0;
  
   crc = crc32(0, fd-name, rd-nsize);
~
  
--
Jon Smirl
[EMAIL PROTECTED]
  
  

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




 --
  Grant Likely, B.Sc., P.Eng.
  Secret Lab Technologies Ltd.



-- 
Jon Smirl
[EMAIL PROTECTED]
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] add Phytec pcm030 board support

2008-05-05 Thread Segher Boessenkool

Add board support for the Phytec pcm030 mpc5200b based board. It
does not need any platform specific fixups and as such is handled
as a mpc5200 simple platform.


Those still whingeing about how horrible and hard and tedious the new
world of device trees is, take note.  We've certainly had some
teething problems as we all figure out how to use the device tree
properly.  But this is the payoff: support for a new board added with
one text file.  It's only going to get more common.


/me imagines a world where every sane device (not just PowerPC)
uses OF device trees...

Oh well, back to reality.


Segher

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


Re: [PATCH] add Phytec pcm030 board support

2008-05-05 Thread Grant Likely
On Mon, May 5, 2008 at 12:06 PM, Segher Boessenkool
[EMAIL PROTECTED] wrote:

 
   Add board support for the Phytec pcm030 mpc5200b based board. It
   does not need any platform specific fixups and as such is handled
   as a mpc5200 simple platform.
  
 
  Those still whingeing about how horrible and hard and tedious the new
  world of device trees is, take note.  We've certainly had some
  teething problems as we all figure out how to use the device tree
  properly.  But this is the payoff: support for a new board added with
  one text file.  It's only going to get more common.
 

  /me imagines a world where every sane device (not just PowerPC)
  uses OF device trees...

PowerPC? check.
Sparc? check.
Microblaze? check.

its just a matter of taking them out one at a time.  :-P

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


Re: [PATCH] add Phytec pcm030 board support

2008-05-05 Thread Stephen Rothwell
On Mon, 5 May 2008 13:38:30 -0600 Grant Likely [EMAIL PROTECTED] wrote:

 PowerPC? check.
 Sparc? check.
 Microblaze? check.

OLPC? check?

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


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

Re: [PATCH] add Phytec pcm030 board support

2008-05-05 Thread Segher Boessenkool

PowerPC? check.
Sparc? check.
Microblaze? check.


OLPC? check?


No check.  The kernel hardly uses the device tree at all, there.


Segher

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


Re: [PATCH] add Phytec pcm030 board support

2008-05-04 Thread David Gibson
On Fri, Apr 25, 2008 at 03:48:05PM +0200, Sascha Hauer wrote:
 Add board support for the Phytec pcm030 mpc5200b based board. It
 does not need any platform specific fixups and as such is handled
 as a mpc5200 simple platform.

Those still whingeing about how horrible and hard and tedious the new
world of device trees is, take note.  We've certainly had some
teething problems as we all figure out how to use the device tree
properly.  But this is the payoff: support for a new board added with
one text file.  It's only going to get more common.

-- 
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


[PATCH] add Phytec pcm030 board support

2008-04-25 Thread Sascha Hauer
Add board support for the Phytec pcm030 mpc5200b based board. It
does not need any platform specific fixups and as such is handled
as a mpc5200 simple platform.

Signed-off-by: Sascha Hauer [EMAIL PROTECTED]

---
 arch/powerpc/boot/dts/pcm030.dts |  363 
 arch/powerpc/configs/52xx/pcm030_defconfig   | 1109 +++
 arch/powerpc/platforms/52xx/mpc5200_simple.c |1 
 3 files changed, 1473 insertions(+)

Index: linux-2.6-powerpc/arch/powerpc/boot/dts/pcm030.dts
===
--- /dev/null
+++ linux-2.6-powerpc/arch/powerpc/boot/dts/pcm030.dts
@@ -0,0 +1,363 @@
+/*
+ * phyCORE-MPC5200B-tiny (pcm030) board Device Tree Source
+ *
+ * Copyright 2006 Pengutronix
+ * Sascha Hauer [EMAIL PROTECTED]
+ * Copyright 2007 Pengutronix
+ * Juergen Beisert [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 = phytec,pcm030;
+   compatible = phytec,pcm030;
+   #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 = 32;
+   i-cache-line-size = 32;
+   d-cache-size = 0x4000;/* L1, 16K  */
+   i-cache-size = 0x4000;/* L1, 16K  */
+   timebase-frequency = 0;   /* From Bootloader  */
+   bus-frequency = 0;/* From Bootloader  */
+   clock-frequency = 0;  /* From Bootloader  */
+   };
+   };
+
+   memory {
+   device_type = memory;
+   reg = 0x 0x0400;  /* 64MB */
+   };
+
+   [EMAIL PROTECTED] {
+   #address-cells = 1;
+   #size-cells = 1;
+   compatible = fsl,mpc5200b-immr;
+   ranges = 0x0 0xf000 0xc000;
+   bus-frequency = 0;/* From bootloader */
+   system-frequency = 0; /* From bootloader */
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,mpc5200b-cdm,fsl,mpc5200-cdm;
+   reg = 0x200 0x38;
+   };
+
+   mpc5200_pic: [EMAIL PROTECTED] {
+   /* 5200 interrupts are encoded into two levels; */
+   interrupt-controller;
+   #interrupt-cells = 3;
+   device_type = interrupt-controller;
+   compatible = fsl,mpc5200b-pic,fsl,mpc5200-pic;
+   reg = 0x500 0x80;
+   };
+
+   [EMAIL PROTECTED] { /* General Purpose Timer */
+   compatible = fsl,mpc5200b-gpt,fsl,mpc5200-gpt;
+   cell-index = 0;
+   reg = 0x600 0x10;
+   interrupts = 0x1 0x9 0x0;
+   interrupt-parent = mpc5200_pic;
+   fsl,has-wdt;
+   };
+
+   [EMAIL PROTECTED] { /* General Purpose Timer */
+   compatible = fsl,mpc5200b-gpt,fsl,mpc5200-gpt;
+   cell-index = 1;
+   reg = 0x610 0x10;
+   interrupts = 0x1 0xa 0x0;
+   interrupt-parent = mpc5200_pic;
+   };
+
+   gpt2: [EMAIL PROTECTED] { /* General Purpose Timer in GPIO mode 
*/
+   compatible = 
fsl,mpc5200b-gpt-gpio,fsl,mpc5200-gpt-gpio;
+   cell-index = 2;
+   reg = 0x620 0x10;
+   interrupts = 0x1 0xb 0x0;
+   interrupt-parent = mpc5200_pic;
+   gpio-controller;
+   #gpio-cells = 2;
+   };
+
+   gpt3: [EMAIL PROTECTED] { /* General Purpose Timer in GPIO mode 
*/
+   compatible = 
fsl,mpc5200b-gpt-gpio,fsl,mpc5200-gpt-gpio;
+   cell-index = 3;
+   reg = 0x630 0x10;
+   interrupts = 0x1 0xc 0x0;
+   interrupt-parent = mpc5200_pic;
+   gpio-controller;
+   #gpio-cells = 2;
+   };
+
+   gpt4: [EMAIL PROTECTED] { /* General Purpose Timer in GPIO mode 
*/
+   compatible = 
fsl,mpc5200b-gpt-gpio,fsl,mpc5200-gpt-gpio;
+   cell-index = 4;
+   reg = 0x640 0x10;
+   interrupts = 0x1 0xd 0x0;
+