LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] [POWERPC] Fix bootwrapper builds with newer gcc versions
From: Gabriel Paubert @ 2008-05-05 11:55 UTC (permalink / raw)
  To: David Miller; +Cc: linuxppc-dev
In-Reply-To: <20080503.005510.88048425.davem@davemloft.net>

On Sat, May 03, 2008 at 12:55:10AM -0700, David Miller wrote:
> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Date: Sat, 03 May 2008 17:50:17 +1000
> 
> > Best would be if we could get those runtime bits linked in the module
> > itself, but I don't know enough about our toolchain to know if that's
> > easy (I suppose everything is always possible :-)
> 
> The only downside is that you'd have N copies of these
> routines, one for every module that emmited the libcalls.

It's probably not as bad as it seems: 

1) it will be smaller than having the saved/restore inlined in every 
function prologue and epilogue

2) as soon as you have ten functions or so that call them, it might
even be smaller than the size of all the trampolines. Unless I'm
mistaken, you would need at least two trampolines for every entry
point that you use in the save/restore routines, which have an entry
point at every instruction boundary or so. That's about 32 bytes
(8 instructions) per set of save/restore functions IIRC.

The ultimate solution might be lo link all these routines at a fixed
large absolute address (between -32M and -1UL) so that you can
call them with a bla instruction. But this requires memory layout
changes which would be quite painful.

	Regards,
	Gabriel

^ permalink raw reply

* Re: [PATCH] [POWERPC] Rework EXC_LEVEL_EXCEPTION_PROLOG code
From: Gabriel Paubert @ 2008-05-05 11:57 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Paul Mackerras, linuxppc-dev
In-Reply-To: <CF55CEE2-CAF5-4728-947E-C1C37E262EDB@kernel.crashing.org>

On Thu, May 01, 2008 at 08:22:08AM -0500, Kumar Gala wrote:
> >>So we have 4 actual exceptions:
> >>* CriticalInput (some external device signaled this.  There are two
> >>concepts of critical.  One is error the other is high priority)
> >>However this would have the same caveats as any ExternalInput  
> >>handler.
> >
> >No, it's worse. It can interrupt code that normally has
> >local_irq_disabled() and thus doesn't expect to be interrupted. That
> >means that everything becomes unsafe including locks etc....
> 
> Fair.  Should local_irq_disable() clear MSR_SE & MSR_BE on classic  
> parts?
> 
> >Note that driver that want to make active use of that probably want  
> >some
> >explicit local_crit_irq_disable/enable functions to be able to  
> >implement
> >some sort of synchronization.
> 
> Or we could just have local_irq_disable -- clear MSR_EE and MSR_CE
> 
> >>* Watchdog - pretty severe if this fires.
> >>
> >>* Debug - user space debug is pretty straight forward.  However we
> >>have features like kprobes that require kernel level support.
> >
> >Which means we have to be extra careful, in fact, I consider it a  
> >design
> >bug of BookE to have made debug be a critical interrupt...
> 
> I consider the whole BookE debug arch a design bug :)

Why only the debug part? :-)

	Gabriel

^ permalink raw reply

* Re: [PATCH] [POWERPC] Rework EXC_LEVEL_EXCEPTION_PROLOG code
From: Benjamin Herrenschmidt @ 2008-05-05 12:06 UTC (permalink / raw)
  To: Gabriel Paubert; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <20080505115729.GB16128@iram.es>


On Mon, 2008-05-05 at 13:57 +0200, Gabriel Paubert wrote:
> > I consider the whole BookE debug arch a design bug :)
> 
> Why only the debug part? :-)

Hehe :-)

At least the old broken 64 bits BookE was ditched before any
implementation was done :-)

Ben.

^ permalink raw reply

* [git pull] Please pull powerpc.git powerpc-next branch
From: Paul Mackerras @ 2008-05-05 12:57 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linuxppc-dev, akpm, linux-kernel

Linus,

This is a pull request where I think these commits can go in 2.6.26
quite safely, but I don't mind if you prefer to leave them until
2.6.27.  There are five commits here that Andrew Morton has sent on to
me: three semaphore to mutex conversions, one that changes a
proc_create call to proc_create_data, and one that adds a new
devm_ioremap_prot function and makes devm_ioremap_release (in
lib/devres.c) available to outside callers.

If you think these should wait until 2.6.27, just let me know.

Thanks,
Paul.

 arch/powerpc/lib/Makefile                |    1 +
 arch/powerpc/lib/devres.c                |   42 ++++++++++++++++++++++++++++++
 arch/powerpc/platforms/pseries/scanlog.c |   19 +-------------
 drivers/macintosh/adb.c                  |   30 +++++++++++----------
 drivers/macintosh/therm_pm72.c           |   31 +++++++++++-----------
 drivers/macintosh/windfarm_smu_sat.c     |   10 ++++---
 include/asm-powerpc/io.h                 |    8 +++++-
 include/linux/io.h                       |    1 +
 lib/devres.c                             |    2 +
 9 files changed, 90 insertions(+), 54 deletions(-)
 create mode 100644 arch/powerpc/lib/devres.c

Daniel Walker (3):
      [POWERPC] macintosh: therm_pm72: driver_lock semaphore to mutex
      [POWERPC] macintosh: windfarm_smu_sat: semaphore to mutex
      [POWERPC] macintosh: ADB driver: adb_handler_sem semaphore to mutex

Denis V. Lunev (1):
      [POWERPC] Assign PDE->data before gluing PDE into /proc tree

Emil Medve (1):
      [POWERPC] devres: Add devm_ioremap_prot()

^ permalink raw reply

* Re: MPC52xx and SPI (native one, NOT psc)
From: Grant Likely @ 2008-05-05 13:55 UTC (permalink / raw)
  To: Fabrizio Garetto; +Cc: linuxppc-dev
In-Reply-To: <ed84ed090805050100y4d33bf05vf6ab9b73ad0547c4@mail.gmail.com>

On Mon, May 5, 2008 at 2:00 AM, Fabrizio Garetto
<fabrizio.garetto@gmail.com> wrote:
> Hello to everyone,
>  I was trying to enable the SPI of a lite5200 board. I've seen that
>  there's something related to this in
>  arch/powerpc/boot/dts/lite5200b.dts
>
>  >spi@f00 {
>  >                       device_type = "spi";
>  >                       compatible = "mpc5200b-spi\0mpc5200-spi";
>  >                       reg = <f00 20>;
>  >                       interrupts = <2 d 0 2 e 0>;
>  >                       interrupt-parent = <&mpc5200_pic>;
>  >               };
>  >
>
>  but I'm not able to find where to enable it in menuconfig. Under
>  device drivers -> Spi support there only the PSC SPI.
>  Where am I wrong?

The device tree describes the hardware; even if there isn't a driver
for it.  The non-PSC SPI does not have a driver right now.

I'm actually working on a driver for it *right now*.  Are you able to
help with testing?

Cheers,
g.

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

^ permalink raw reply

* Re: MPC52xx and SPI (native one, NOT psc)
From: Jon Smirl @ 2008-05-05 14:03 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev, Fabrizio Garetto
In-Reply-To: <fa686aa40805050655j20e617edy9d69f2c351705fd2@mail.gmail.com>

On 5/5/08, Grant Likely <grant.likely@secretlab.ca> wrote:
> On Mon, May 5, 2008 at 2:00 AM, Fabrizio Garetto
>  <fabrizio.garetto@gmail.com> wrote:
>  > Hello to everyone,
>  >  I was trying to enable the SPI of a lite5200 board. I've seen that
>  >  there's something related to this in
>  >  arch/powerpc/boot/dts/lite5200b.dts
>  >
>  >  >spi@f00 {
>  >  >                       device_type = "spi";
>  >  >                       compatible = "mpc5200b-spi\0mpc5200-spi";
>  >  >                       reg = <f00 20>;
>  >  >                       interrupts = <2 d 0 2 e 0>;
>  >  >                       interrupt-parent = <&mpc5200_pic>;
>  >  >               };
>  >  >
>  >
>  >  but I'm not able to find where to enable it in menuconfig. Under
>  >  device drivers -> Spi support there only the PSC SPI.
>  >  Where am I wrong?
>
>
> The device tree describes the hardware; even if there isn't a driver
>  for it.  The non-PSC SPI does not have a driver right now.
>
>  I'm actually working on a driver for it *right now*.  Are you able to
>  help with testing?

Have you tired using an SD card with your new driver?

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


-- 
Jon Smirl
jonsmirl@gmail.com

^ permalink raw reply

* Re: [PATCH 04/56] microblaze_v2: Open firmware files
From: Grant Likely @ 2008-05-05 14:24 UTC (permalink / raw)
  To: monstr
  Cc: linux-arch, Michal Simek, arnd, matthew, microblaze-uclinux,
	linux-kernel, linuxppc-dev, will.newton, John.Linn, john.williams
In-Reply-To: <684c36e5ad3f598e5079e88ec195545c4a7150c2.1209897266.git.monstr@monstr.eu>

On Sun, May 4, 2008 at 5:40 AM,  <monstr@seznam.cz> wrote:
> From: Michal Simek <monstr@monstr.eu>
>
>
>  Signed-off-by: Michal Simek <monstr@monstr.eu>
>  ---
>   arch/microblaze/kernel/prom.c        | 1653 ++++++++++++++++++++++++++++++++++
>   include/asm-microblaze/of_device.h   |   41 +
>   include/asm-microblaze/of_platform.h |   45 +
>   include/asm-microblaze/prom.h        |  311 +++++++

another mostly-clone from arch/powerpc/kernel.  Is anyone working on
moving the guts of this file to a common location?

Cheers,
g.

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

^ permalink raw reply

* Re: How to link a .o with all modules
From: Kumar Gala @ 2008-05-05 14:46 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linuxppc-dev@ozlabs.org list, lkml List
In-Reply-To: <20080504192434.GA23752@uranus.ravnborg.org>


On May 4, 2008, at 2:24 PM, Sam Ravnborg wrote:

> On Sun, May 04, 2008 at 01:22:38PM -0500, Kumar Gala wrote:
>> Sam,
>>
>> We have a case in powerpc in which we want to link some library
>> routines with all module objects.  The routines are intended for
>> handling out-of-line function call register save/restore so having
>> them as EXPORT_SYMBOL() is counter productive (we do also need to  
>> link
>> the same "library" code into the kernel).
>>
>> Any suggestions on how to handle this?
>
> I assume you have the .o file build somewhere as part of the
> normal kernel build.
>
> Then you in
> arch/powerpc/Makefile adds the following assignment:
>
> LDFLAGS_MODULE += arch/powerpc/lib/my_magic_file.o
>
> kbuild will then during the modpost stage link this
> file on all modules.
> To add the same file to the kernel just include it
> in a obj-y += my_magic_file.o
>
> One trap is that my_magic_file.o needs to be built
> for a modules build too.
> I think you need to assign it to always:
>
>   always := my_magic_file.o
>
> to accomplish this.
>
> So in the end we will have:
>
> arch/powerpc/Makefile:
> LDFLAGS_MODULE += arch/powerpc/lib/my_magic_file.o
>
> arch/powerpc/lib/Makefile:
> always := my_magic_file.o
> obj-y += my_magic_file.o
>
>
> Let me know if this does address your question.

The problem is MODPOST complains about undefined symbols:

   MODPOST 24 modules
ERROR: "_restgpr_20_x" [net/key/af_key.ko] undefined!
ERROR: "_restgpr_25_x" [net/key/af_key.ko] undefined!
ERROR: "_restgpr_30_x" [net/key/af_key.ko] undefined!

...

Any ideas on that?

- k

^ permalink raw reply

* [PATCH] IB/ehca: Change function return types to correct type.
From: Stefan Roscher @ 2008-05-05 15:11 UTC (permalink / raw)
  To: Roland Dreier, LinuxPPC-Dev, LKML, OF-EWG; +Cc: fenkes, raisch

Also remove duplicate assignment of local_ca_ack_delay
and change min_t check for local_ca_ack_delay to u8 instead of int.

Signed-off-by: Stefan Roscher <stefan.roscher at de.ibm.com>
---
 drivers/infiniband/hw/ehca/ehca_hca.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/ehca/ehca_hca.c b/drivers/infiniband/hw/ehca/ehca_hca.c
index 2515cbd..bc3b37d 100644
--- a/drivers/infiniband/hw/ehca/ehca_hca.c
+++ b/drivers/infiniband/hw/ehca/ehca_hca.c
@@ -101,7 +101,6 @@ int ehca_query_device(struct ib_device *ibdev, struct ib_device_attr *props)
 	props->max_ee          = limit_uint(rblock->max_rd_ee_context);
 	props->max_rdd         = limit_uint(rblock->max_rd_domain);
 	props->max_fmr         = limit_uint(rblock->max_mr);
-	props->local_ca_ack_delay  = limit_uint(rblock->local_ca_ack_delay);
 	props->max_qp_rd_atom  = limit_uint(rblock->max_rr_qp);
 	props->max_ee_rd_atom  = limit_uint(rblock->max_rr_ee_context);
 	props->max_res_rd_atom = limit_uint(rblock->max_rr_hca);
@@ -115,7 +114,7 @@ int ehca_query_device(struct ib_device *ibdev, struct ib_device_attr *props)
 	}
 
 	props->max_pkeys           = 16;
-	props->local_ca_ack_delay  = limit_uint(rblock->local_ca_ack_delay);
+	props->local_ca_ack_delay  = min_t(u8, rblock->local_ca_ack_delay, 255);
 	props->max_raw_ipv6_qp     = limit_uint(rblock->max_raw_ipv6_qp);
 	props->max_raw_ethy_qp     = limit_uint(rblock->max_raw_ethy_qp);
 	props->max_mcast_grp       = limit_uint(rblock->max_mcast_grp);
@@ -136,7 +135,7 @@ query_device1:
 	return ret;
 }
 
-static int map_mtu(struct ehca_shca *shca, u32 fw_mtu)
+static enum ib_mtu map_mtu(struct ehca_shca *shca, u32 fw_mtu)
 {
 	switch (fw_mtu) {
 	case 0x1:
@@ -156,7 +155,7 @@ static int map_mtu(struct ehca_shca *shca, u32 fw_mtu)
 	}
 }
 
-static int map_number_of_vls(struct ehca_shca *shca, u32 vl_cap)
+static u8 map_number_of_vls(struct ehca_shca *shca, u32 vl_cap)
 {
 	switch (vl_cap) {
 	case 0x1:
-- 
1.5.5

^ permalink raw reply related

* Re: MPC52xx and SPI (native one, NOT psc)
From: Fabrizio Garetto @ 2008-05-05 15:29 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40805050655j20e617edy9d69f2c351705fd2@mail.gmail.com>

Yes, please, I'll appreciate very much.

Currently I'm working of 2.6.22 kernel version, but I can test it on
the 2.6.24 as well.
I've found also this patch that should enable the native spi on my mpc52xx
http://cba.si/slefika/kernel/patches/mpc5200-spi.patch

but I've various problems: first of all, if I select to enable that
SPI using menuconfig, the relative CONFIG_SPI_MPC5200=y is saved in
the .config file, but when I start the compilation that setting
disappears and the file is skipped.

Forcing CONFIG_SPI_MPC5200=y by hand I got the following errors:
In file included from include/linux/of_device.h:6,
                 from include/linux/of_platform.h:18,
                 from arch/ppc/include/asm/of_platform.h:15,
                 from drivers/spi/mpc5200_spi.c:24:
include/linux/of.h:39: error: expected identifier or '(' before 'void'
include/linux/of.h:39: error: expected ')' before numeric constant
include/linux/of.h:45: error: expected ')' before 'handle'
include/linux/of.h:54: error: expected identifier or '(' before 'void'
include/linux/of.h:54: error: expected ')' before numeric constant
In file included from drivers/spi/mpc5200_spi.c:24:
arch/ppc/include/asm/of_platform.h:32: error: expected ')' before 'ph'
drivers/spi/mpc5200_spi.c: In function 'mpc5200_spi_txrx':
drivers/spi/mpc5200_spi.c:215: error: implicit declaration of function 'udelay'
drivers/spi/mpc5200_spi.c: In function 'mpc5200_spi_probe':
drivers/spi/mpc5200_spi.c:251: error: implicit declaration of function
'of_address_to_resource'
drivers/spi/mpc5200_spi.c:256: error: implicit declaration of function
'irq_of_parse_and_map'
drivers/spi/mpc5200_spi.c:281: error: implicit declaration of function
'mpc52xx_find_ipb_freq'
make[2]: *** [drivers/spi/mpc5200_spi.o] Error 1
make[1]: *** [drivers/spi] Error 2
make: *** [drivers] Error 2

Regards,
F. Garetto

On Mon, May 5, 2008 at 3:55 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
>
> On Mon, May 5, 2008 at 2:00 AM, Fabrizio Garetto
>  <fabrizio.garetto@gmail.com> wrote:
>  > Hello to everyone,
>  >  I was trying to enable the SPI of a lite5200 board. I've seen that
>  >  there's something related to this in
>  >  arch/powerpc/boot/dts/lite5200b.dts
>  >
>  >  >spi@f00 {
>  >  >                       device_type = "spi";
>  >  >                       compatible = "mpc5200b-spi\0mpc5200-spi";
>  >  >                       reg = <f00 20>;
>  >  >                       interrupts = <2 d 0 2 e 0>;
>  >  >                       interrupt-parent = <&mpc5200_pic>;
>  >  >               };
>  >  >
>  >
>  >  but I'm not able to find where to enable it in menuconfig. Under
>  >  device drivers -> Spi support there only the PSC SPI.
>  >  Where am I wrong?
>
>  The device tree describes the hardware; even if there isn't a driver
>  for it.  The non-PSC SPI does not have a driver right now.
>
>  I'm actually working on a driver for it *right now*.  Are you able to
>  help with testing?
>
>  Cheers,
>  g.
>
>  --
>  Grant Likely, B.Sc., P.Eng.
>  Secret Lab Technologies Ltd.
>

^ permalink raw reply

* Re: [PATCH] add Phytec pcm030 board support
From: Grant Likely @ 2008-05-05 15:59 UTC (permalink / raw)
  To: Sascha Hauer, linuxppc-dev
In-Reply-To: <20080505011607.GA9349@yookeroo.seuss>

On Sun, May 4, 2008 at 7:16 PM, David Gibson
<david@gibson.dropbear.id.au> 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.

^ permalink raw reply

* Re: [PATCH] add Phytec pcm030 board support
From: Jon Smirl @ 2008-05-05 17:01 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: linuxppc-dev
In-Reply-To: <20080425134805.GP6692@pengutronix.de>

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
jonsmirl@gmail.com

^ permalink raw reply related

* Re: [PATCH] add Phytec pcm030 board support
From: Grant Likely @ 2008-05-05 17:08 UTC (permalink / raw)
  To: Jon Smirl; +Cc: linuxppc-dev
In-Reply-To: <9e4733910805051001h2c02fd57yb246091af8bf5a7d@mail.gmail.com>

On Mon, May 5, 2008 at 11:01 AM, Jon Smirl <jonsmirl@gmail.com> 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
>  jonsmirl@gmail.com
>
>
> _______________________________________________
>  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.

^ permalink raw reply

* Re: [git pull] Please pull powerpc.git powerpc-next branch
From: Linus Torvalds @ 2008-05-05 17:19 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, akpm, linux-kernel
In-Reply-To: <18463.1101.341437.600410@cargo.ozlabs.ibm.com>



On Mon, 5 May 2008, Paul Mackerras wrote:
> 
> If you think these should wait until 2.6.27, just let me know.

Well, since you didn't even mention the place to pull from, I guess it can 
wait..

		Linus

^ permalink raw reply

* Re: [PATCH] add Phytec pcm030 board support
From: Jon Smirl @ 2008-05-05 17:22 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40805051008t656e7e11pc469b6a43241c63f@mail.gmail.com>

On 5/5/08, Grant Likely <grant.likely@secretlab.ca> wrote:
> On Mon, May 5, 2008 at 11:01 AM, Jon Smirl <jonsmirl@gmail.com> 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
>  >  jonsmirl@gmail.com
>  >
>  >
>
> > _______________________________________________
>  >  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
jonsmirl@gmail.com

^ permalink raw reply

* Re: [git pull] Please pull powerpc.git powerpc-next branch
From: Kumar Gala @ 2008-05-05 17:40 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linuxppc-dev, akpm, Paul Mackerras, linux-kernel
In-Reply-To: <alpine.LFD.1.10.0805051018550.32269@woody.linux-foundation.org>


On May 5, 2008, at 12:19 PM, Linus Torvalds wrote:

>
>
> On Mon, 5 May 2008, Paul Mackerras wrote:
>>
>> If you think these should wait until 2.6.27, just let me know.
>
> Well, since you didn't even mention the place to pull from, I guess  
> it can
> wait..

Paul's clearly starting to lose it.  First a pull request w/o him  
pushing to his tree.  Now a pull request from the ether.

- k

^ permalink raw reply

* [PATCH 2/4] [POWERPC] Xilinx: Virtex: Enable dcr for MMIO and NATIVE
From: Stephen Neuendorffer @ 2008-05-05 17:56 UTC (permalink / raw)
  To: jwboyer, benh, grant.likely, linuxppc-dev
In-Reply-To: <1210010201-28436-2-git-send-email-stephen.neuendorffer@xilinx.com>

FPGA designs may have need of both MMIO-based and NATIVE-based dcr
interfaces.

Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
 arch/powerpc/platforms/40x/Kconfig |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/40x/Kconfig b/arch/powerpc/platforms/40x/Kconfig
index a9260e2..b8e06df 100644
--- a/arch/powerpc/platforms/40x/Kconfig
+++ b/arch/powerpc/platforms/40x/Kconfig
@@ -123,6 +123,8 @@ config 405GPR
 
 config XILINX_VIRTEX
 	bool
+	select PPC_DCR_MMIO
+	select PPC_DCR_NATIVE
 
 config XILINX_VIRTEX_II_PRO
 	bool
-- 
1.5.3.4-dirty

^ permalink raw reply related

* [PATCH 3/4] [POWERPC] Xilinx: Framebuffer: remove platform device support.
From: Stephen Neuendorffer @ 2008-05-05 17:56 UTC (permalink / raw)
  To: jwboyer, benh, grant.likely, linuxppc-dev
In-Reply-To: <1210010201-28436-3-git-send-email-stephen.neuendorffer@xilinx.com>

With ARCH=ppc going away, we don't really need platform device support
anymore.  In fact it is hard, if we want to use the generic dcr
infrastructure.

Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
 drivers/video/xilinxfb.c |   63 +---------------------------------------------
 1 files changed, 1 insertions(+), 62 deletions(-)

diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index 7b3a842..4d64402 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -31,7 +31,6 @@
 #include <linux/fb.h>
 #include <linux/init.h>
 #include <linux/dma-mapping.h>
-#include <linux/platform_device.h>
 #if defined(CONFIG_OF)
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
@@ -356,56 +355,6 @@ static int xilinxfb_release(struct device *dev)
 }
 
 /* ---------------------------------------------------------------------
- * Platform bus binding
- */
-
-static int
-xilinxfb_platform_probe(struct platform_device *pdev)
-{
-	struct xilinxfb_platform_data *pdata;
-	struct resource *res;
-
-	/* Find the registers address */
-	res = platform_get_resource(pdev, IORESOURCE_IO, 0);
-	if (!res) {
-		dev_err(&pdev->dev, "Couldn't get registers resource\n");
-		return -ENODEV;
-	}
-
-	/* If a pdata structure is provided, then extract the parameters */
-	pdata = &xilinx_fb_default_pdata;
-	if (pdev->dev.platform_data) {
-		pdata = pdev->dev.platform_data;
-		if (!pdata->xres)
-			pdata->xres = xilinx_fb_default_pdata.xres;
-		if (!pdata->yres)
-			pdata->yres = xilinx_fb_default_pdata.yres;
-		if (!pdata->xvirt)
-			pdata->xvirt = xilinx_fb_default_pdata.xvirt;
-		if (!pdata->yvirt)
-			pdata->yvirt = xilinx_fb_default_pdata.yvirt;
-	}
-
-	return xilinxfb_assign(&pdev->dev, res->start, pdata);
-}
-
-static int
-xilinxfb_platform_remove(struct platform_device *pdev)
-{
-	return xilinxfb_release(&pdev->dev);
-}
-
-
-static struct platform_driver xilinxfb_platform_driver = {
-	.probe		= xilinxfb_platform_probe,
-	.remove		= xilinxfb_platform_remove,
-	.driver = {
-		.owner = THIS_MODULE,
-		.name = DRIVER_NAME,
-	},
-};
-
-/* ---------------------------------------------------------------------
  * OF bus binding
  */
 
@@ -500,22 +449,12 @@ static inline void __exit xilinxfb_of_unregister(void) { }
 static int __init
 xilinxfb_init(void)
 {
-	int rc;
-	rc = xilinxfb_of_register();
-	if (rc)
-		return rc;
-
-	rc = platform_driver_register(&xilinxfb_platform_driver);
-	if (rc)
-		xilinxfb_of_unregister();
-
-	return rc;
+	return xilinxfb_of_register();
 }
 
 static void __exit
 xilinxfb_cleanup(void)
 {
-	platform_driver_unregister(&xilinxfb_platform_driver);
 	xilinxfb_of_unregister();
 }
 
-- 
1.5.3.4-dirty

^ permalink raw reply related

* [PATCH 0/4] [v4][POWERPC] refactor dcr code
From: Stephen Neuendorffer @ 2008-05-05 17:56 UTC (permalink / raw)
  To: jwboyer, benh, grant.likely, linuxppc-dev
In-Reply-To: <20080421080353.5d2b3bb9@zod.rchland.ibm.com>

I've modified these patches to include Josh's comments, and also
modified the tft patches to not assume that patches to ARCH=ppc are
made.  This breaks platform_device support and hence ARCH=ppc support.
I'd appreciate it if these patches could get queued up for 2.6.27 (and
hence get built a bit before then), when ARCH=ppc is going away
anyway.

Steve

^ permalink raw reply

* Re: [PATCH 4/4] booting-without-of for Freescale MSI
From: Segher Boessenkool @ 2008-05-05 18:00 UTC (permalink / raw)
  To: Jason Jin; +Cc: linuxppc-dev
In-Reply-To: <1209973634-1699-4-git-send-email-Jason.jin@freescale.com>

> +    - compatible : should be "fsl,MPIC-MSI" for 85xx/86xx cpu,
> +      and "fsl,IPIC-MSI" for 83xx cpu.

Please use a more specific name, "fsl,8599-msi" or similar?

> +    - interrupts : should contain the msi interrupts cascade to the 
> host
> +      interrupt controller.

You should describe that it is one "interrupts" entry per 32 MSIs;
also, it would be nice to say they need "0" as the sense.

> +    - interrupt-parent: should be "&mpic" for 85xx/86xx cpu and 
> "&ipic"
> +      for 83xx cpu.

&Xpic are labels, so something local to specific DTS files; instead, say
that the interrupts are routed to the MPIC/IPIC (it doesn't have to be
via "interrupt-parent", either).


Segher

p.s. On a meta-note, please put the binding doc first in the series, it
makes things easier to review in-order.

^ permalink raw reply

* [PATCH 1/4] [v4][POWERPC] refactor dcr code
From: Stephen Neuendorffer @ 2008-05-05 17:56 UTC (permalink / raw)
  To: jwboyer, benh, grant.likely, linuxppc-dev
In-Reply-To: <1210010201-28436-1-git-send-email-stephen.neuendorffer@xilinx.com>

Previously, dcr support was configured at compile time to either using
MMIO or native dcr instructions.  Although this works for most
platforms, it fails on FPGA platforms:

1) Systems may include more than one dcr bus.
2) Systems may be native dcr capable and still use memory mapped dcr interface.

This patch provides runtime support based on the device trees for the
case where CONFIG_PPC_DCR_MMIO and CONFIG_PPC_DCR_NATIVE are both
selected.  Previously, this was a poorly defined configuration, which
happened to provide NATIVE support.  The runtime selection is made
based on the dcr controller having a 'dcr-access-method' attribute
in the device tree.  If only one of the above options is selected,
then the code uses #defines to select only the used code in order to
avoid introducing overhead in existing usage.

Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>

--

[v4]
Converted flags to be DCR_HOST_*
Added WARN_ON in case someone forgets to call MAP_OK()
Fixed dealing with the dcr-access-method correctly, which was still
	off in the wrong patch.
---
 arch/powerpc/sysdev/dcr.c         |  146 +++++++++++++++++++++++++++++--------
 include/asm-powerpc/dcr-generic.h |   49 ++++++++++++
 include/asm-powerpc/dcr-mmio.h    |   20 +++--
 include/asm-powerpc/dcr-native.h  |   16 +++--
 include/asm-powerpc/dcr.h         |   39 ++++++++++-
 5 files changed, 225 insertions(+), 45 deletions(-)
 create mode 100644 include/asm-powerpc/dcr-generic.h

diff --git a/arch/powerpc/sysdev/dcr.c b/arch/powerpc/sysdev/dcr.c
index 437e48d..6984424 100644
--- a/arch/powerpc/sysdev/dcr.c
+++ b/arch/powerpc/sysdev/dcr.c
@@ -23,6 +23,104 @@
 #include <asm/prom.h>
 #include <asm/dcr.h>
 
+static struct device_node *find_dcr_parent(struct device_node *node)
+{
+	struct device_node *par, *tmp;
+	const u32 *p;
+
+	for (par = of_node_get(node); par;) {
+		if (of_get_property(par, "dcr-controller", NULL))
+			break;
+		p = of_get_property(par, "dcr-parent", NULL);
+		tmp = par;
+		if (p == NULL)
+			par = of_get_parent(par);
+		else
+			par = of_find_node_by_phandle(*p);
+		of_node_put(tmp);
+	}
+	return par;
+}
+
+#if defined(CONFIG_PPC_DCR_NATIVE) && defined(CONFIG_PPC_DCR_MMIO)
+
+bool dcr_map_ok_generic(dcr_host_t host)
+{
+	if (host.type == DCR_HOST_NATIVE)
+		return dcr_map_ok_native(host.host.native);
+	else if (host.type == DCR_HOST_MMIO)
+		return dcr_map_ok_mmio(host.host.mmio);
+	else
+		return 0;
+}
+EXPORT_SYMBOL_GPL(dcr_map_ok_generic);
+
+dcr_host_t dcr_map_generic(struct device_node *dev,
+			   unsigned int dcr_n,
+			   unsigned int dcr_c)
+{
+	dcr_host_t host;
+	struct device_node *dp;
+	const char *prop;
+
+	host.type = DCR_HOST_INVALID;
+
+	dp = find_dcr_parent(dev);
+	if (dp == NULL)
+		return host;
+
+	prop = of_get_property(dp, "dcr-access-method", NULL);
+
+	pr_debug("dcr_map_generic(dcr-access-method = %s)\n", prop);
+
+	if (!strcmp(prop, "native")) {
+		host.type = DCR_HOST_NATIVE;
+		host.host.native = dcr_map_native(dev, dcr_n, dcr_c);
+	} else if (!strcmp(prop, "mmio")) {
+		host.type = DCR_HOST_MMIO;
+		host.host.mmio = dcr_map_mmio(dev, dcr_n, dcr_c);
+	}
+
+	return host;
+}
+EXPORT_SYMBOL_GPL(dcr_map_generic);
+
+void dcr_unmap_generic(dcr_host_t host, unsigned int dcr_c)
+{
+	if (host.type == DCR_HOST_NATIVE)
+		dcr_unmap_native(host.host.native, dcr_c);
+	else if (host.type == DCR_HOST_MMIO)
+		dcr_unmap_mmio(host.host.mmio, dcr_c);
+	else /* host.type == DCR_HOST_INVALID */
+		WARN_ON(true);
+}
+EXPORT_SYMBOL_GPL(dcr_unmap_generic);
+
+u32 dcr_read_generic(dcr_host_t host, unsigned int dcr_n)
+{
+	if (host.type == DCR_HOST_NATIVE)
+		return dcr_read_native(host.host.native, dcr_n);
+	else if (host.type == DCR_HOST_MMIO)
+		return dcr_read_mmio(host.host.mmio, dcr_n);
+	else /* host.type == DCR_HOST_INVALID */
+		WARN_ON(true);
+	return 0;
+}
+EXPORT_SYMBOL_GPL(dcr_read_generic);
+
+void dcr_write_generic(dcr_host_t host, unsigned int dcr_n, u32 value)
+{
+	if (host.type == DCR_HOST_NATIVE)
+		dcr_write_native(host.host.native, dcr_n, value);
+	else if (host.type == DCR_HOST_MMIO)
+		dcr_write_mmio(host.host.mmio, dcr_n, value);
+	else /* host.type == DCR_HOST_INVALID */
+		WARN_ON(true);
+}
+EXPORT_SYMBOL_GPL(dcr_write_generic);
+
+#endif /* defined(CONFIG_PPC_DCR_NATIVE) && defined(CONFIG_PPC_DCR_MMIO) */
+
 unsigned int dcr_resource_start(struct device_node *np, unsigned int index)
 {
 	unsigned int ds;
@@ -47,26 +145,7 @@ unsigned int dcr_resource_len(struct device_node *np, unsigned int index)
 }
 EXPORT_SYMBOL_GPL(dcr_resource_len);
 
-#ifndef CONFIG_PPC_DCR_NATIVE
-
-static struct device_node * find_dcr_parent(struct device_node * node)
-{
-	struct device_node *par, *tmp;
-	const u32 *p;
-
-	for (par = of_node_get(node); par;) {
-		if (of_get_property(par, "dcr-controller", NULL))
-			break;
-		p = of_get_property(par, "dcr-parent", NULL);
-		tmp = par;
-		if (p == NULL)
-			par = of_get_parent(par);
-		else
-			par = of_find_node_by_phandle(*p);
-		of_node_put(tmp);
-	}
-	return par;
-}
+#ifdef CONFIG_PPC_DCR_MMIO
 
 u64 of_translate_dcr_address(struct device_node *dev,
 			     unsigned int dcr_n,
@@ -101,18 +180,19 @@ u64 of_translate_dcr_address(struct device_node *dev,
 	return ret;
 }
 
-dcr_host_t dcr_map(struct device_node *dev, unsigned int dcr_n,
-		   unsigned int dcr_c)
+dcr_host_mmio_t dcr_map_mmio(struct device_node *dev,
+			     unsigned int dcr_n,
+			     unsigned int dcr_c)
 {
-	dcr_host_t ret = { .token = NULL, .stride = 0, .base = dcr_n };
+	dcr_host_mmio_t ret = { .token = NULL, .stride = 0, .base = dcr_n };
 	u64 addr;
 
 	pr_debug("dcr_map(%s, 0x%x, 0x%x)\n",
 		 dev->full_name, dcr_n, dcr_c);
 
 	addr = of_translate_dcr_address(dev, dcr_n, &ret.stride);
-	pr_debug("translates to addr: 0x%lx, stride: 0x%x\n",
-		 addr, ret.stride);
+	pr_debug("translates to addr: 0x%llx, stride: 0x%x\n",
+		 (unsigned long long) addr, ret.stride);
 	if (addr == OF_BAD_ADDR)
 		return ret;
 	pr_debug("mapping 0x%x bytes\n", dcr_c * ret.stride);
@@ -124,11 +204,11 @@ dcr_host_t dcr_map(struct device_node *dev, unsigned int dcr_n,
 	ret.token -= dcr_n * ret.stride;
 	return ret;
 }
-EXPORT_SYMBOL_GPL(dcr_map);
+EXPORT_SYMBOL_GPL(dcr_map_mmio);
 
-void dcr_unmap(dcr_host_t host, unsigned int dcr_c)
+void dcr_unmap_mmio(dcr_host_mmio_t host, unsigned int dcr_c)
 {
-	dcr_host_t h = host;
+	dcr_host_mmio_t h = host;
 
 	if (h.token == NULL)
 		return;
@@ -136,7 +216,11 @@ void dcr_unmap(dcr_host_t host, unsigned int dcr_c)
 	iounmap(h.token);
 	h.token = NULL;
 }
-EXPORT_SYMBOL_GPL(dcr_unmap);
-#else	/* defined(CONFIG_PPC_DCR_NATIVE) */
+EXPORT_SYMBOL_GPL(dcr_unmap_mmio);
+
+#endif /* defined(CONFIG_PPC_DCR_MMIO) */
+
+#ifdef CONFIG_PPC_DCR_NATIVE
 DEFINE_SPINLOCK(dcr_ind_lock);
-#endif	/* !defined(CONFIG_PPC_DCR_NATIVE) */
+#endif	/* defined(CONFIG_PPC_DCR_NATIVE) */
+
diff --git a/include/asm-powerpc/dcr-generic.h b/include/asm-powerpc/dcr-generic.h
new file mode 100644
index 0000000..35b7159
--- /dev/null
+++ b/include/asm-powerpc/dcr-generic.h
@@ -0,0 +1,49 @@
+/*
+ * (c) Copyright 2006 Benjamin Herrenschmidt, IBM Corp.
+ *                    <benh@kernel.crashing.org>
+ *
+ *   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.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ *   the GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program;  if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _ASM_POWERPC_DCR_GENERIC_H
+#define _ASM_POWERPC_DCR_GENERIC_H
+#ifdef __KERNEL__
+#ifndef __ASSEMBLY__
+
+enum host_type_t {DCR_HOST_MMIO, DCR_HOST_NATIVE, DCR_HOST_INVALID};
+
+typedef struct {
+	enum host_type_t type;
+	union {
+		dcr_host_mmio_t mmio;
+		dcr_host_native_t native;
+	} host;
+} dcr_host_t;
+
+extern bool dcr_map_ok_generic(dcr_host_t host);
+
+extern dcr_host_t dcr_map_generic(struct device_node *dev, unsigned int dcr_n,
+			  unsigned int dcr_c);
+extern void dcr_unmap_generic(dcr_host_t host, unsigned int dcr_c);
+
+extern u32 dcr_read_generic(dcr_host_t host, unsigned int dcr_n);
+
+extern void dcr_write_generic(dcr_host_t host, unsigned int dcr_n, u32 value);
+
+#endif /* __ASSEMBLY__ */
+#endif /* __KERNEL__ */
+#endif /* _ASM_POWERPC_DCR_GENERIC_H */
+
+
diff --git a/include/asm-powerpc/dcr-mmio.h b/include/asm-powerpc/dcr-mmio.h
index 08532ff..acd491d 100644
--- a/include/asm-powerpc/dcr-mmio.h
+++ b/include/asm-powerpc/dcr-mmio.h
@@ -27,20 +27,26 @@ typedef struct {
 	void __iomem *token;
 	unsigned int stride;
 	unsigned int base;
-} dcr_host_t;
+} dcr_host_mmio_t;
 
-#define DCR_MAP_OK(host)	((host).token != NULL)
+static inline bool dcr_map_ok_mmio(dcr_host_mmio_t host)
+{
+	return host.token != NULL;
+}
 
-extern dcr_host_t dcr_map(struct device_node *dev, unsigned int dcr_n,
-			  unsigned int dcr_c);
-extern void dcr_unmap(dcr_host_t host, unsigned int dcr_c);
+extern dcr_host_mmio_t dcr_map_mmio(struct device_node *dev,
+				    unsigned int dcr_n,
+				    unsigned int dcr_c);
+extern void dcr_unmap_mmio(dcr_host_mmio_t host, unsigned int dcr_c);
 
-static inline u32 dcr_read(dcr_host_t host, unsigned int dcr_n)
+static inline u32 dcr_read_mmio(dcr_host_mmio_t host, unsigned int dcr_n)
 {
 	return in_be32(host.token + ((host.base + dcr_n) * host.stride));
 }
 
-static inline void dcr_write(dcr_host_t host, unsigned int dcr_n, u32 value)
+static inline void dcr_write_mmio(dcr_host_mmio_t host,
+				  unsigned int dcr_n,
+				  u32 value)
 {
 	out_be32(host.token + ((host.base + dcr_n) * host.stride), value);
 }
diff --git a/include/asm-powerpc/dcr-native.h b/include/asm-powerpc/dcr-native.h
index f8398ce..72d2b72 100644
--- a/include/asm-powerpc/dcr-native.h
+++ b/include/asm-powerpc/dcr-native.h
@@ -26,14 +26,18 @@
 
 typedef struct {
 	unsigned int base;
-} dcr_host_t;
+} dcr_host_native_t;
 
-#define DCR_MAP_OK(host)	(1)
+static inline bool dcr_map_ok_native(dcr_host_native_t host)
+{
+	return 1;
+}
 
-#define dcr_map(dev, dcr_n, dcr_c)	((dcr_host_t){ .base = (dcr_n) })
-#define dcr_unmap(host, dcr_c)		do {} while (0)
-#define dcr_read(host, dcr_n)		mfdcr(dcr_n + host.base)
-#define dcr_write(host, dcr_n, value)	mtdcr(dcr_n + host.base, value)
+#define dcr_map_native(dev, dcr_n, dcr_c) \
+	((dcr_host_native_t){ .base = (dcr_n) })
+#define dcr_unmap_native(host, dcr_c)		do {} while (0)
+#define dcr_read_native(host, dcr_n)		mfdcr(dcr_n + host.base)
+#define dcr_write_native(host, dcr_n, value)	mtdcr(dcr_n + host.base, value)
 
 /* Device Control Registers */
 void __mtdcr(int reg, unsigned int val);
diff --git a/include/asm-powerpc/dcr.h b/include/asm-powerpc/dcr.h
index 9338d50..53b2830 100644
--- a/include/asm-powerpc/dcr.h
+++ b/include/asm-powerpc/dcr.h
@@ -20,14 +20,50 @@
 #ifndef _ASM_POWERPC_DCR_H
 #define _ASM_POWERPC_DCR_H
 #ifdef __KERNEL__
+#ifndef __ASSEMBLY__
 #ifdef CONFIG_PPC_DCR
 
 #ifdef CONFIG_PPC_DCR_NATIVE
 #include <asm/dcr-native.h>
-#else
+#endif
+
+#ifdef CONFIG_PPC_DCR_MMIO
 #include <asm/dcr-mmio.h>
 #endif
 
+
+/* Indirection layer for providing both NATIVE and MMIO support. */
+
+#if defined(CONFIG_PPC_DCR_NATIVE) && defined(CONFIG_PPC_DCR_MMIO)
+
+#include <asm/dcr-generic.h>
+
+#define DCR_MAP_OK(host)	dcr_map_ok_generic(host)
+#define dcr_map(dev, dcr_n, dcr_c) dcr_map_generic(dev, dcr_n, dcr_c)
+#define dcr_unmap(host, dcr_c) dcr_unmap_generic(host, dcr_c)
+#define dcr_read(host, dcr_n) dcr_read_generic(host, dcr_n)
+#define dcr_write(host, dcr_n, value) dcr_write_generic(host, dcr_n, value)
+
+#else
+
+#ifdef CONFIG_PPC_DCR_NATIVE
+typedef dcr_host_native_t dcr_host_t;
+#define DCR_MAP_OK(host)	dcr_map_ok_native(host)
+#define dcr_map(dev, dcr_n, dcr_c) dcr_map_native(dev, dcr_n, dcr_c)
+#define dcr_unmap(host, dcr_c) dcr_unmap_native(host, dcr_c)
+#define dcr_read(host, dcr_n) dcr_read_native(host, dcr_n)
+#define dcr_write(host, dcr_n, value) dcr_write_native(host, dcr_n, value)
+#else
+typedef dcr_host_mmio_t dcr_host_t;
+#define DCR_MAP_OK(host)	dcr_map_ok_mmio(host)
+#define dcr_map(dev, dcr_n, dcr_c) dcr_map_mmio(dev, dcr_n, dcr_c)
+#define dcr_unmap(host, dcr_c) dcr_unmap_mmio(host, dcr_c)
+#define dcr_read(host, dcr_n) dcr_read_mmio(host, dcr_n)
+#define dcr_write(host, dcr_n, value) dcr_write_mmio(host, dcr_n, value)
+#endif
+
+#endif /* defined(CONFIG_PPC_DCR_NATIVE) && defined(CONFIG_PPC_DCR_MMIO) */
+
 /*
  * On CONFIG_PPC_MERGE, we have additional helpers to read the DCR
  * base from the device-tree
@@ -41,5 +77,6 @@ extern unsigned int dcr_resource_len(struct device_node *np,
 #endif /* CONFIG_PPC_MERGE */
 
 #endif /* CONFIG_PPC_DCR */
+#endif /* __ASSEMBLY__ */
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_DCR_H */
-- 
1.5.3.4-dirty

^ permalink raw reply related

* [PATCH] Xilinx: framebuffer: add compatibility for ml507 dvi core.
From: Stephen Neuendorffer @ 2008-05-05 17:59 UTC (permalink / raw)
  To: grant.likely, linuxppc-dev

Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
 drivers/video/xilinxfb.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index 848752e..a82c530 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -396,6 +396,7 @@ static int __devexit xilinxfb_of_remove(struct of_device *op)
 /* Match table for of_platform binding */
 static struct of_device_id xilinxfb_of_match[] __devinitdata = {
 	{ .compatible = "xlnx,plb-tft-cntlr-ref-1.00.a", },
+	{ .compatible = "xlnx,plb-dvi-cntlr-ref-1.00.c", },
 	{},
 };
 MODULE_DEVICE_TABLE(of, xilinxfb_of_match);
-- 
1.5.3.4-dirty

^ permalink raw reply related

* [PATCH 4/4] [POWERPC] Xilinx: Framebuffer: Use dcr infrastructure.
From: Stephen Neuendorffer @ 2008-05-05 17:56 UTC (permalink / raw)
  To: jwboyer, benh, grant.likely, linuxppc-dev
In-Reply-To: <1210010201-28436-4-git-send-email-stephen.neuendorffer@xilinx.com>

This device contains a dcr interface.  Previously, the dcr interface
was assumed to be used in mmio mode, and the register space of the dcr
interface was precomputed and stuffed in the device tree.  This patch
makes use of the new dcr infrastructure to represent the dcr interface
as any other dcr interface in the device tree.  This enables the dcr
interface to be connected directly to a native dcr interface in a
clean way.

In particular, the device tree expected looks like:

			dcr_v29_0: dcr@0 {
				#address-cells = <1>;
				#size-cells = <1>;
				compatible = "xlnx,dcr-v29-1.00.a";
				VGA_FrameBuffer: tft@80 {
					compatible = "xlnx,plb-tft-cntlr-ref-1.00.a";
					dcr-parent = <&opb2dcr_bridge_0>;
					dcr-reg = < 80 2 >;
					xlnx,default-tft-base-addr = <7f>;
					xlnx,dps-init = <1>;
					xlnx,on-init = <1>;
					xlnx,pixclk-is-busclk-divby4 = <1>;
				} ;
			} ;

			opb2dcr_bridge_0: opb2dcr-bridge@40700000 {
				compatible = "xlnx,opb2dcr-bridge-1.00.b";
				dcr-access-method = "mmio";
				dcr-controller ;
				dcr-mmio-range = < 40700000 1000 >;
				dcr-mmio-stride = <4>;
				reg = < 40700000 1000 >;
				xlnx,family = "virtex2p";
			} ;

Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
 drivers/video/xilinxfb.c |   54 +++++++++++++++++-----------------------------
 1 files changed, 20 insertions(+), 34 deletions(-)

diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index 4d64402..848752e 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -37,6 +37,7 @@
 #endif
 #include <asm/io.h>
 #include <linux/xilinxfb.h>
+#include <asm/dcr.h>
 
 #define DRIVER_NAME		"xilinxfb"
 #define DRIVER_DESCRIPTION	"Xilinx TFT LCD frame buffer driver"
@@ -111,8 +112,9 @@ struct xilinxfb_drvdata {
 
 	struct fb_info	info;		/* FB driver info record */
 
-	u32		regs_phys;	/* phys. address of the control registers */
-	u32 __iomem	*regs;		/* virt. address of the control registers */
+	dcr_host_t      dcr_host;
+	unsigned int    dcr_start;
+	unsigned int    dcr_len;
 
 	void		*fb_virt;	/* virt. address of the frame buffer */
 	dma_addr_t	fb_phys;	/* phys. address of the frame buffer */
@@ -135,7 +137,7 @@ struct xilinxfb_drvdata {
  * when it's needed.
  */
 #define xilinx_fb_out_be32(driverdata, offset, val) \
-	out_be32(driverdata->regs + offset, val)
+	dcr_write(driverdata->dcr_host, offset, val)
 
 static int
 xilinx_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue,
@@ -203,7 +205,8 @@ static struct fb_ops xilinxfb_ops =
  * Bus independent setup/teardown
  */
 
-static int xilinxfb_assign(struct device *dev, unsigned long physaddr,
+static int xilinxfb_assign(struct device *dev, dcr_host_t dcr_host,
+			   unsigned int dcr_start, unsigned int dcr_len,
 			   struct xilinxfb_platform_data *pdata)
 {
 	struct xilinxfb_drvdata *drvdata;
@@ -218,21 +221,9 @@ static int xilinxfb_assign(struct device *dev, unsigned long physaddr,
 	}
 	dev_set_drvdata(dev, drvdata);
 
-	/* Map the control registers in */
-	if (!request_mem_region(physaddr, 8, DRIVER_NAME)) {
-		dev_err(dev, "Couldn't lock memory region at 0x%08lX\n",
-			physaddr);
-		rc = -ENODEV;
-		goto err_region;
-	}
-	drvdata->regs_phys = physaddr;
-	drvdata->regs = ioremap(physaddr, 8);
-	if (!drvdata->regs) {
-		dev_err(dev, "Couldn't lock memory region at 0x%08lX\n",
-			physaddr);
-		rc = -ENODEV;
-		goto err_map;
-	}
+	drvdata->dcr_start = dcr_start;
+	drvdata->dcr_len = dcr_len;
+	drvdata->dcr_host = dcr_host;
 
 	/* Allocate the framebuffer memory */
 	if (pdata->fb_phys) {
@@ -247,7 +238,7 @@ static int xilinxfb_assign(struct device *dev, unsigned long physaddr,
 	if (!drvdata->fb_virt) {
 		dev_err(dev, "Could not allocate frame buffer memory\n");
 		rc = -ENOMEM;
-		goto err_fbmem;
+		goto err_region;
 	}
 
 	/* Clear (turn to black) the framebuffer */
@@ -297,7 +288,6 @@ static int xilinxfb_assign(struct device *dev, unsigned long physaddr,
 	}
 
 	/* Put a banner in the log (for DEBUG) */
-	dev_dbg(dev, "regs: phys=%lx, virt=%p\n", physaddr, drvdata->regs);
 	dev_dbg(dev, "fb: phys=%p, virt=%p, size=%x\n",
 		(void*)drvdata->fb_phys, drvdata->fb_virt, fbsize);
 
@@ -313,12 +303,6 @@ err_cmap:
 	/* Turn off the display */
 	xilinx_fb_out_be32(drvdata, REG_CTRL, 0);
 
-err_fbmem:
-	iounmap(drvdata->regs);
-
-err_map:
-	release_mem_region(physaddr, 8);
-
 err_region:
 	kfree(drvdata);
 	dev_set_drvdata(dev, NULL);
@@ -344,9 +328,8 @@ static int xilinxfb_release(struct device *dev)
 
 	/* Turn off the display */
 	xilinx_fb_out_be32(drvdata, REG_CTRL, 0);
-	iounmap(drvdata->regs);
 
-	release_mem_region(drvdata->regs_phys, 8);
+	dcr_unmap(drvdata->dcr_host, drvdata->dcr_len);
 
 	kfree(drvdata);
 	dev_set_drvdata(dev, NULL);
@@ -362,20 +345,23 @@ static int xilinxfb_release(struct device *dev)
 static int __devinit
 xilinxfb_of_probe(struct of_device *op, const struct of_device_id *match)
 {
-	struct resource res;
 	const u32 *prop;
 	struct xilinxfb_platform_data pdata;
 	int size, rc;
+	int start, len;
+	dcr_host_t dcr_host;
 
 	/* Copy with the default pdata (not a ptr reference!) */
 	pdata = xilinx_fb_default_pdata;
 
 	dev_dbg(&op->dev, "xilinxfb_of_probe(%p, %p)\n", op, match);
 
-	rc = of_address_to_resource(op->node, 0, &res);
-	if (rc) {
+	start = dcr_resource_start(op->node, 0);
+	len = dcr_resource_len(op->node, 0);
+	dcr_host = dcr_map(op->node, start, len);
+	if (!DCR_MAP_OK(dcr_host)) {
 		dev_err(&op->dev, "invalid address\n");
-		return rc;
+		return -ENODEV;
 	}
 
 	prop = of_get_property(op->node, "phys-size", &size);
@@ -399,7 +385,7 @@ xilinxfb_of_probe(struct of_device *op, const struct of_device_id *match)
 	if (of_find_property(op->node, "rotate-display", NULL))
 		pdata.rotate_screen = 1;
 
-	return xilinxfb_assign(&op->dev, res.start, &pdata);
+	return xilinxfb_assign(&op->dev, dcr_host, start, len, &pdata);
 }
 
 static int __devexit xilinxfb_of_remove(struct of_device *op)
-- 
1.5.3.4-dirty

^ permalink raw reply related

* Re: [git pull] Please pull powerpc.git powerpc-next branch
From: Linus Torvalds @ 2008-05-05 18:03 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, akpm, Paul Mackerras, linux-kernel
In-Reply-To: <7F696AAE-069D-443A-9511-5CF92F4538EA@kernel.crashing.org>



On Mon, 5 May 2008, Kumar Gala wrote:
> 
> Paul's clearly starting to lose it.  First a pull request w/o him pushing to
> his tree.  Now a pull request from the ether.

Paul, the rumor is that high doses of vitamin B6 may delay the onset of 
Alzheimer, and there is some research into vitamin E helping after you've 
gotten it.

Maybe it's still not too late!

		Linus

^ permalink raw reply

* Re: [PATCH] add Phytec pcm030 board support
From: Segher Boessenkool @ 2008-05-05 18:06 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev
In-Reply-To: <20080505011607.GA9349@yookeroo.seuss>

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

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox