LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 6/7] MPIC MSI allocator
From: Benjamin Herrenschmidt @ 2007-04-24  9:51 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: Olof Johansson, linuxppc-dev, linux-pci
In-Reply-To: <dbba27bc913250681a57be91605e25f2@kernel.crashing.org>

On Tue, 2007-04-24 at 11:44 +0200, Segher Boessenkool wrote:
> >> First-gen G5's need that just as well, they just don't
> >> have such interrupts on the default system configuration,
> >> as far as I remember.
> >
> > They didn't have an HT APIC or if they had one, they didn't enable it
> > (they probably did in the tunnel).
> 
> Yes, the two HT APICs on the tunnel were enabled.
> 
> > They didn't use the U3 MPIC as an HT
> > IRQ master, thus it's irrelevant.
> 
> They did for the plugin PCI-X slots (well, it's chained
> to another MPIC, but you still need the workaround).

No you didn't. The slots IRQ lines were physically routed to GPIOs on
the southbridge MPIC. The -only- thing the northbridge MPIC was useful
for was the NB internal interrupts (like the i2c one).

> > Anyway, there is no point in this
> > discussion :-)
> 
> Yeah, the new name for CONFIG_BROKEN_U3 is fine
> no matter what :-)
> 
> 
> Segher

^ permalink raw reply

* Re: MPC885 hang in a lwarx/stwcx insn crossing a page boundary
From: Joakim Tjernlund @ 2007-04-24 10:06 UTC (permalink / raw)
  To: hs; +Cc: linuxppc-embedded
In-Reply-To: <1177394147.6353.30.camel@Zeus.EmbLux>

On Tue, 2007-04-24 at 07:55 +0200, Heiko Schocher wrote:
> Hello,
>=20
> I have a MPC885 and a running 2.6.16 kernel on it. I use the CPU15
> Errata Patch from
> (http://ozlabs.org/pipermail/linuxppc-dev/2007-April/033789.html)
>=20
> Now if a lwarx/stwcx insn crossing a page boundary, the CPU hangs in
> an endless loop, because the reservation allocated from the lwarx gets
> cleared in the case of a tlb miss. And the CPU15 workaround =
invalidates
> the tlbs around the page we're faulting in, so we cause a nasty =
infinite
> loop. I started a service request at Freescale, and they are searching
> why a tlbie clears the reservation or under which circumstances this
> appears.
>=20
> Without the CPU15 Errata patch it runs fine, but i can reproduce the
> CPU15 Bug, so I need the or some CPU15 Errata patch ...
>=20
> I also have a running 2.4.24-pre2 Kernel on this board, with the same
> CPU15 Errata patch, and there the hang doesnt occur!! Some ideas where
> the differences between 2.4.24-pre2 and 2.6.16 are?
>=20
> I also didnt get this hang in userspace with the 2.6.16er Kernel.
>=20
> So I see at the moment the following possibilities:
>=20
> a) patching the gcc, so that the CPU15 Errata is no more necessary
>    My favorit.
>=20
> b) upgrade the CPU15 Bug like in the MPC885 Errata Sheet from =
Freescale
>    (I think this is to much code for in an Exceptionhandler ...)
>=20
> c) I made before every lwarcx a ".align" so that the insn is on one
>    page. This is actually running without seeing problems on the =
board.
>    But it is a "errata" for the "errata" ...
>=20
> d) ...
>=20
> Some suggestions, ideas? Especially, why the hang doesnt occur with a
> 2.4.24-pre2 kernel?

A guess:
The TLB Miss handler changed for the case when "Level 1 entry" is null.
2.6 will force a TLB Error to happen, but 2.4 will(at least used to)
bail out via DataAccess.

 Jocke

>=20
> thanks
> Heiko

^ permalink raw reply

* Re: [PATCH] generic check_legacy_ioport
From: Olaf Hering @ 2007-04-24 11:25 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1177376000.14873.38.camel@localhost.localdomain>

On Tue, Apr 24, Benjamin Herrenschmidt wrote:

> Ok, I like the aproach, but why the heck those ifdef's ? Can't you just
> remove them ?

Just to keep it small for .configs without floppy, PS/2 etc. I can
remove it.

> > +	if (np) {
> > +		of_node_put(np);
> >  		return 0;
> 
> And also check now if the parent is "isa". Just to be sure. If a
> platform won't match that, then it will need it's own
> check_legacy_ioport which is fine with me.

Do you think a device_type fdc, i8042 or ipmi will appear outside an isa
node?

> To be totally correct, we should -also- check if the port number fits in
> the the actual "reg" property but I'm not sure I can be bothered :-)

Why all this complexity? Its there mainly to match a class of boards,
not to match a specific device configuration.

Thats how it may look finally, currently only compile tested.

int check_legacy_ioport(unsigned long base_port)
{
        struct device_node *parent, *np = NULL;
        int ret = -ENODEV;

        switch(base_port) {
        case I8042_DATA_REG:
                np = of_find_node_by_type(NULL, "8042");
                break;
        case FDC_BASE: /* FDC1 */
                np = of_find_node_by_type(NULL, "fdc");
                break;
        case 0xca2:
        case 0xca9:
        case 0xe4:
                np = of_find_node_by_type(NULL, "ipmi");
                break;
#ifdef CONFIG_PPC_PREP
        case _PIDXR:
        case _PNPWRP:
        case PNPBIOS_BASE:
                /* implement me */
#endif
        default:
                break;
        }
        if (np) {
                parent = of_get_parent(np);
                if (parent) {
                        ret = strcmp(parent->type, "isa");
                        of_node_put(parent);
                }
                of_node_put(np);
        }
        return ret;
}

^ permalink raw reply

* arch/powerpc for lite5200b
From: Pradyumna Sampath @ 2007-04-24 11:31 UTC (permalink / raw)
  To: linuxppc-embedded

Hi Everyone,

I have been trying to get the linux-2.6.20-rt3 for arch/powerpc to
boot on my lite5200b. Here are the things that I have tried so far. I
have a custom board based on the lite5200b and then the evaluation
board too.

- I have a working 2.6.16-rt29 kernel compiled using ARCH=ppc for both
these boards.

- I tried the default configs for lite5200 for both the custom board
and the EVB. Both hang at "Transferring control to Linux (at address
00000000) ..."

- I downloaded roberts
http://www.pengutronix.de/oselas/bsp/phytec/index_en.html#phyCORE-MPC5200B-tiny
patches, but still ended up with the same result.

I read ( http://www.nabble.com/Re%3A-MPC52xx-support-rework-for-2.6.20-p7568655.html
)  that the arch/powerpc port for lite5200 works right out of the box.
Am I doing something wrong ?

The one thing I am yet to try is to do a git checkout from
git.secretlabs.ca. Unfortunately thanks to some internal firewalling
policies I still have not been able to do that.

Thanks in advance
regards
prady

^ permalink raw reply

* Re: [PATCH] ib_core: Add missing device link to class device
From: Joachim Fenkes @ 2007-04-24 12:06 UTC (permalink / raw)
  To: Roland Dreier; +Cc: LinuxPPC-Dev, LKML, OF-General
In-Reply-To: <ada7is27vdv.fsf@cisco.com>

Roland Dreier <rdreier@cisco.com> wrote on 23.04.2007 21:17:48:

> Hmm, I have links like this on my system already:
> 
> the patch actually looks sane but I don't understand why it's needed.
> Could you explain?

I had a look at the kernel code -- currently, all device drivers except
ehca do this by themselves:

cxgb3:
1110         dev->ibdev.dma_device = &(dev->rdev.rnic_info.pdev->dev);
1111         dev->ibdev.class_dev.dev = &(dev->rdev.rnic_info.pdev->dev);

amso1100:
798         dev->ibdev.dma_device = &dev->pcidev->dev;
799         dev->ibdev.class_dev.dev = &dev->pcidev->dev;

ipath:
1559         dev->dma_device = &dd->pcidev->dev;
1560         dev->class_dev.dev = dev->dma_device;

mthca:
1295         dev->ib_dev.dma_device           = &dev->pdev->dev;
1296         dev->ib_dev.class_dev.dev        = &dev->pdev->dev;

So I think it makes a lot of sense to put the class_dev.dev assignment
into generic ib_core code instead of repeating it in all the drivers.
The respective lines could move out of the drivers in the future but
won't hurt anyone until then.

What's your take on this?

Cheers,
  Joachim

---
Joachim Fenkes  --  eHCA Linux Driver Developer and Hardware Tamer
IBM Deutschland Entwicklung GmbH  --  Dept. 3627 (I/O Firmware Dev. 2)
Schoenaicher Strasse 220  --  71032 Boeblingen  --  Germany
eMail: fenkes@de.ibm.com  --  Phone: +49 7031 16 1239 

^ permalink raw reply

* Re: [PATCH] eHCA: Add "Modify Port" verb
From: Joachim Fenkes @ 2007-04-24 12:25 UTC (permalink / raw)
  To: Roland Dreier; +Cc: LinuxPPC-Dev, LKML, OF-General
In-Reply-To: <ada3b2q7v9t.fsf@cisco.com>

Roland Dreier <rdreier@cisco.com> wrote on 23.04.2007 21:20:14:

>  > +   if (hipz_h_query_port(shca->ipz_hca_handle, port, rblock) != 
H_SUCCESS) {
>  > +      ehca_err(&shca->ib_device, "Can't query port properties");
>  > +      ret = -EINVAL;
>  > +      goto modify_port1;
>  > +   }
>  > +
>  > +   cap = (rblock->capability_mask | props->set_port_cap_mask)
>  > +      & ~props->clr_port_cap_mask;
>  > +
>  > +   hret = hipz_h_modify_port(shca->ipz_hca_handle, port,
>  > +              cap, props->init_type, port_modify_mask);
> 
> Is this thread-safe?  What if two different bits are set at the same
> time from two different threads?  It seems that both calls could get
> the same result from hipz_h_query_port(), and then the second call to
> hipz_h_modify_port() would overwrite the first call.

Yes, you're so right.
 
> You could look at the implementation in mthca to see the locking I
> used there.

I'll do that, thanks for the hint!

Joachim

---
Joachim Fenkes  --  eHCA Linux Driver Developer and Hardware Tamer
IBM Deutschland Entwicklung GmbH  --  Dept. 3627 (I/O Firmware Dev. 2)
Schoenaicher Strasse 220  --  71032 Boeblingen  --  Germany
eMail: fenkes@de.ibm.com  --  Phone: +49 7031 16 1239 

^ permalink raw reply

* [PATCH 1/6] Start split out of common open firmware code
From: Stephen Rothwell @ 2007-04-24 12:32 UTC (permalink / raw)
  To: David S. Miller, paulus; +Cc: ppc-dev
In-Reply-To: <20070412153424.bf3957f4.sfr@canb.auug.org.au>

This creates drivers/openfw/base.c (depending on CONFIG_OPENFW) and puts
the first trivially common bits from the prom.c files into it.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/Kconfig       |    3 ++
 arch/powerpc/kernel/prom.c |   42 ----------------------------
 arch/sparc/Kconfig         |    3 ++
 arch/sparc/kernel/prom.c   |   42 ----------------------------
 arch/sparc64/Kconfig       |    3 ++
 arch/sparc64/kernel/prom.c |   42 ----------------------------
 drivers/Makefile           |    1 +
 drivers/openfw/Makefile    |    1 +
 drivers/openfw/base.c      |   65 ++++++++++++++++++++++++++++++++++++++++++++
 include/asm-powerpc/prom.h |    3 ++
 include/asm-sparc/prom.h   |    3 ++
 include/asm-sparc64/prom.h |    3 ++
 12 files changed, 85 insertions(+), 126 deletions(-)
 create mode 100644 drivers/openfw/Makefile
 create mode 100644 drivers/openfw/base.c

The only difference with this one is to use drivers/openfw/
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 740892a..dea4892 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -99,6 +99,9 @@ config ARCH_MAY_HAVE_PC_FDC
 config PPC_OF
 	def_bool y
 
+config OPENFW
+	def_bool y
+
 config PPC_UDBG_16550
 	bool
 	default n
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index caef555..d701e89 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1042,36 +1042,6 @@ void __init early_init_devtree(void *params)
 
 #undef printk
 
-int of_n_addr_cells(struct device_node* np)
-{
-	const int *ip;
-	do {
-		if (np->parent)
-			np = np->parent;
-		ip = of_get_property(np, "#address-cells", NULL);
-		if (ip != NULL)
-			return *ip;
-	} while (np->parent);
-	/* No #address-cells property for the root node, default to 1 */
-	return 1;
-}
-EXPORT_SYMBOL(of_n_addr_cells);
-
-int of_n_size_cells(struct device_node* np)
-{
-	const int* ip;
-	do {
-		if (np->parent)
-			np = np->parent;
-		ip = of_get_property(np, "#size-cells", NULL);
-		if (ip != NULL)
-			return *ip;
-	} while (np->parent);
-	/* No #size-cells property for the root node, default to 1 */
-	return 1;
-}
-EXPORT_SYMBOL(of_n_size_cells);
-
 /** Checks if the given "compat" string matches one of the strings in
  * the device's "compatible" property
  */
@@ -1529,18 +1499,6 @@ struct property *of_find_property(const struct device_node *np,
 EXPORT_SYMBOL(of_find_property);
 
 /*
- * Find a property with a given name for a given node
- * and return the value.
- */
-const void *of_get_property(const struct device_node *np, const char *name,
-			 int *lenp)
-{
-	struct property *pp = of_find_property(np,name,lenp);
-	return pp ? pp->value : NULL;
-}
-EXPORT_SYMBOL(of_get_property);
-
-/*
  * Add a property to a node
  */
 int prom_add_property(struct device_node* np, struct property* prop)
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index bd992c0..e8be7a1 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -21,6 +21,9 @@ config GENERIC_ISA_DMA
 	bool
 	default y
 
+config OPENFW
+	def_bool y
+
 source "init/Kconfig"
 
 menu "General machine setup"
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
index eed140b..ac3f3c2 100644
--- a/arch/sparc/kernel/prom.c
+++ b/arch/sparc/kernel/prom.c
@@ -168,18 +168,6 @@ struct property *of_find_property(const struct device_node *np,
 }
 EXPORT_SYMBOL(of_find_property);
 
-/*
- * Find a property with a given name for a given node
- * and return the value.
- */
-const void *of_get_property(const struct device_node *np, const char *name,
-			    int *lenp)
-{
-	struct property *pp = of_find_property(np,name,lenp);
-	return pp ? pp->value : NULL;
-}
-EXPORT_SYMBOL(of_get_property);
-
 int of_getintprop_default(struct device_node *np, const char *name, int def)
 {
 	struct property *prop;
@@ -193,36 +181,6 @@ int of_getintprop_default(struct device_node *np, const char *name, int def)
 }
 EXPORT_SYMBOL(of_getintprop_default);
 
-int of_n_addr_cells(struct device_node *np)
-{
-	const int* ip;
-	do {
-		if (np->parent)
-			np = np->parent;
-		ip = of_get_property(np, "#address-cells", NULL);
-		if (ip != NULL)
-			return *ip;
-	} while (np->parent);
-	/* No #address-cells property for the root node, default to 2 */
-	return 2;
-}
-EXPORT_SYMBOL(of_n_addr_cells);
-
-int of_n_size_cells(struct device_node *np)
-{
-	const int* ip;
-	do {
-		if (np->parent)
-			np = np->parent;
-		ip = of_get_property(np, "#size-cells", NULL);
-		if (ip != NULL)
-			return *ip;
-	} while (np->parent);
-	/* No #size-cells property for the root node, default to 1 */
-	return 1;
-}
-EXPORT_SYMBOL(of_n_size_cells);
-
 int of_set_property(struct device_node *dp, const char *name, void *val, int len)
 {
 	struct property **prevp;
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 590a41b..1b52ab1 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -58,6 +58,9 @@ config AUDIT_ARCH
 	bool
 	default y
 
+config OPENFW
+	def_bool y
+
 choice
 	prompt "Kernel page size"
 	default SPARC64_PAGE_SIZE_8KB
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index 5e1fcd0..7ef5488 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -172,18 +172,6 @@ struct property *of_find_property(const struct device_node *np,
 }
 EXPORT_SYMBOL(of_find_property);
 
-/*
- * Find a property with a given name for a given node
- * and return the value.
- */
-const void *of_get_property(const struct device_node *np, const char *name,
-		      int *lenp)
-{
-	struct property *pp = of_find_property(np,name,lenp);
-	return pp ? pp->value : NULL;
-}
-EXPORT_SYMBOL(of_get_property);
-
 int of_getintprop_default(struct device_node *np, const char *name, int def)
 {
 	struct property *prop;
@@ -197,36 +185,6 @@ int of_getintprop_default(struct device_node *np, const char *name, int def)
 }
 EXPORT_SYMBOL(of_getintprop_default);
 
-int of_n_addr_cells(struct device_node *np)
-{
-	const int* ip;
-	do {
-		if (np->parent)
-			np = np->parent;
-		ip = of_get_property(np, "#address-cells", NULL);
-		if (ip != NULL)
-			return *ip;
-	} while (np->parent);
-	/* No #address-cells property for the root node, default to 2 */
-	return 2;
-}
-EXPORT_SYMBOL(of_n_addr_cells);
-
-int of_n_size_cells(struct device_node *np)
-{
-	const int* ip;
-	do {
-		if (np->parent)
-			np = np->parent;
-		ip = of_get_property(np, "#size-cells", NULL);
-		if (ip != NULL)
-			return *ip;
-	} while (np->parent);
-	/* No #size-cells property for the root node, default to 1 */
-	return 1;
-}
-EXPORT_SYMBOL(of_n_size_cells);
-
 int of_set_property(struct device_node *dp, const char *name, void *val, int len)
 {
 	struct property **prevp;
diff --git a/drivers/Makefile b/drivers/Makefile
index 3a718f5..ffaf094 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -81,3 +81,4 @@ obj-$(CONFIG_GENERIC_TIME)	+= clocksource/
 obj-$(CONFIG_DMA_ENGINE)	+= dma/
 obj-$(CONFIG_HID)		+= hid/
 obj-$(CONFIG_PPC_PS3)		+= ps3/
+obj-$(CONFIG_OPENFW)		+= openfw/
diff --git a/drivers/openfw/Makefile b/drivers/openfw/Makefile
new file mode 100644
index 0000000..cddbe84
--- /dev/null
+++ b/drivers/openfw/Makefile
@@ -0,0 +1 @@
+obj-y = base.o
diff --git a/drivers/openfw/base.c b/drivers/openfw/base.c
new file mode 100644
index 0000000..04a8cc2
--- /dev/null
+++ b/drivers/openfw/base.c
@@ -0,0 +1,65 @@
+/*
+ * Procedures for creating, accessing and interpreting the device tree.
+ *
+ * Paul Mackerras	August 1996.
+ * Copyright (C) 1996-2005 Paul Mackerras.
+ *
+ *  Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner.
+ *    {engebret|bergner}@us.ibm.com
+ *
+ *  Adapted for sparc and sparc64 by David S. Miller davem@davemloft.net
+ *
+ *  Reconsolidated from arch/x/kernel/prom.c by Stephen Rothwell.
+ *
+ *      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.
+ */
+#include <linux/module.h>
+#include <linux/openfw.h>
+
+int of_n_addr_cells(struct device_node *np)
+{
+	const int *ip;
+
+	do {
+		if (np->parent)
+			np = np->parent;
+		ip = of_get_property(np, "#address-cells", NULL);
+		if (ip)
+			return *ip;
+	} while (np->parent);
+	/* No #address-cells property for the root node */
+	return OF_ROOT_NODE_ADDR_CELLS_DEFAULT;
+}
+EXPORT_SYMBOL(of_n_addr_cells);
+
+int of_n_size_cells(struct device_node *np)
+{
+	const int *ip;
+
+	do {
+		if (np->parent)
+			np = np->parent;
+		ip = of_get_property(np, "#size-cells", NULL);
+		if (ip)
+			return *ip;
+	} while (np->parent);
+	/* No #size-cells property for the root node */
+	return OF_ROOT_NODE_SIZE_CELLS_DEFAULT;
+}
+EXPORT_SYMBOL(of_n_size_cells);
+
+/*
+ * Find a property with a given name for a given node
+ * and return the value.
+ */
+const void *of_get_property(const struct device_node *np, const char *name,
+			 int *lenp)
+{
+	struct property *pp = of_find_property(np, name, lenp);
+
+	return pp ? pp->value : NULL;
+}
+EXPORT_SYMBOL(of_get_property);
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 5a36186..30cea54 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -21,6 +21,9 @@
 #include <asm/irq.h>
 #include <asm/atomic.h>
 
+#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT	1
+#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT	1
+
 /* Definitions used by the flattened device tree */
 #define OF_DT_HEADER		0xd00dfeed	/* marker */
 #define OF_DT_BEGIN_NODE	0x1		/* Start of node, full name */
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
index 5188852..411018d 100644
--- a/include/asm-sparc/prom.h
+++ b/include/asm-sparc/prom.h
@@ -20,6 +20,9 @@
 #include <linux/proc_fs.h>
 #include <asm/atomic.h>
 
+#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT	2
+#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT	1
+
 typedef u32 phandle;
 typedef u32 ihandle;
 
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
index b1557c0..1097e66 100644
--- a/include/asm-sparc64/prom.h
+++ b/include/asm-sparc64/prom.h
@@ -20,6 +20,9 @@
 #include <linux/proc_fs.h>
 #include <asm/atomic.h>
 
+#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT	2
+#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT	1
+
 typedef u32 phandle;
 typedef u32 ihandle;
 
-- 
1.5.1.2

^ permalink raw reply related

* [PATCH 2/6] Consolidate of_device_is_compatible
From: Stephen Rothwell @ 2007-04-24 12:38 UTC (permalink / raw)
  To: David S. Miller, paulus; +Cc: ppc-dev
In-Reply-To: <20070424223245.78f4fdfb.sfr@canb.auug.org.au>

The only difference here is that Sparc uses strncmp to match compatibility
names while PowerPC uses strncasecmp.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/kernel/prom.c |   25 -------------------------
 arch/sparc/kernel/prom.c   |   21 ---------------------
 arch/sparc64/kernel/prom.c |   21 ---------------------
 drivers/openfw/base.c      |   24 ++++++++++++++++++++++++
 include/asm-powerpc/prom.h |    2 ++
 include/asm-sparc/prom.h   |    2 ++
 include/asm-sparc64/prom.h |    2 ++
 7 files changed, 30 insertions(+), 67 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index d701e89..723df55 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1042,31 +1042,6 @@ void __init early_init_devtree(void *params)
 
 #undef printk
 
-/** Checks if the given "compat" string matches one of the strings in
- * the device's "compatible" property
- */
-int of_device_is_compatible(const struct device_node *device,
-		const char *compat)
-{
-	const char* cp;
-	int cplen, l;
-
-	cp = of_get_property(device, "compatible", &cplen);
-	if (cp == NULL)
-		return 0;
-	while (cplen > 0) {
-		if (strncasecmp(cp, compat, strlen(compat)) == 0)
-			return 1;
-		l = strlen(cp) + 1;
-		cp += l;
-		cplen -= l;
-	}
-
-	return 0;
-}
-EXPORT_SYMBOL(of_device_is_compatible);
-
-
 /**
  * Indicates whether the root node has a given value in its
  * compatible property.
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
index ac3f3c2..f2ce0d4 100644
--- a/arch/sparc/kernel/prom.c
+++ b/arch/sparc/kernel/prom.c
@@ -32,27 +32,6 @@ static struct device_node *allnodes;
  */
 static DEFINE_RWLOCK(devtree_lock);
 
-int of_device_is_compatible(const struct device_node *device,
-			    const char *compat)
-{
-	const char* cp;
-	int cplen, l;
-
-	cp = of_get_property(device, "compatible", &cplen);
-	if (cp == NULL)
-		return 0;
-	while (cplen > 0) {
-		if (strncmp(cp, compat, strlen(compat)) == 0)
-			return 1;
-		l = strlen(cp) + 1;
-		cp += l;
-		cplen -= l;
-	}
-
-	return 0;
-}
-EXPORT_SYMBOL(of_device_is_compatible);
-
 struct device_node *of_get_parent(const struct device_node *node)
 {
 	struct device_node *np;
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index 7ef5488..d6dd972 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -36,27 +36,6 @@ static struct device_node *allnodes;
  */
 static DEFINE_RWLOCK(devtree_lock);
 
-int of_device_is_compatible(const struct device_node *device,
-			    const char *compat)
-{
-	const char* cp;
-	int cplen, l;
-
-	cp = of_get_property(device, "compatible", &cplen);
-	if (cp == NULL)
-		return 0;
-	while (cplen > 0) {
-		if (strncmp(cp, compat, strlen(compat)) == 0)
-			return 1;
-		l = strlen(cp) + 1;
-		cp += l;
-		cplen -= l;
-	}
-
-	return 0;
-}
-EXPORT_SYMBOL(of_device_is_compatible);
-
 struct device_node *of_get_parent(const struct device_node *node)
 {
 	struct device_node *np;
diff --git a/drivers/openfw/base.c b/drivers/openfw/base.c
index 04a8cc2..0751313 100644
--- a/drivers/openfw/base.c
+++ b/drivers/openfw/base.c
@@ -63,3 +63,27 @@ const void *of_get_property(const struct device_node *np, const char *name,
 	return pp ? pp->value : NULL;
 }
 EXPORT_SYMBOL(of_get_property);
+
+/** Checks if the given "compat" string matches one of the strings in
+ * the device's "compatible" property
+ */
+int of_device_is_compatible(const struct device_node *device,
+		const char *compat)
+{
+	const char* cp;
+	int cplen, l;
+
+	cp = of_get_property(device, "compatible", &cplen);
+	if (cp == NULL)
+		return 0;
+	while (cplen > 0) {
+		if (of_compat_cmp(cp, compat, strlen(compat)) == 0)
+			return 1;
+		l = strlen(cp) + 1;
+		cp += l;
+		cplen -= l;
+	}
+
+	return 0;
+}
+EXPORT_SYMBOL(of_device_is_compatible);
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 30cea54..1f3e8cd 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -24,6 +24,8 @@
 #define OF_ROOT_NODE_ADDR_CELLS_DEFAULT	1
 #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT	1
 
+#define of_compat_cmp(s1, s2, l)	strncasecmp((s1), (s2), (l))
+
 /* Definitions used by the flattened device tree */
 #define OF_DT_HEADER		0xd00dfeed	/* marker */
 #define OF_DT_BEGIN_NODE	0x1		/* Start of node, full name */
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
index 411018d..cc049fd 100644
--- a/include/asm-sparc/prom.h
+++ b/include/asm-sparc/prom.h
@@ -23,6 +23,8 @@
 #define OF_ROOT_NODE_ADDR_CELLS_DEFAULT	2
 #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT	1
 
+#define of_compat_cmp(s1, s2, l)	strncmp((s1), (s2), (l))
+
 typedef u32 phandle;
 typedef u32 ihandle;
 
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
index 1097e66..843f9e8 100644
--- a/include/asm-sparc64/prom.h
+++ b/include/asm-sparc64/prom.h
@@ -23,6 +23,8 @@
 #define OF_ROOT_NODE_ADDR_CELLS_DEFAULT	2
 #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT	1
 
+#define of_compat_cmp(s1, s2, l)	strncmp((s1), (s2), (l))
+
 typedef u32 phandle;
 typedef u32 ihandle;
 
-- 
1.5.1.2

^ permalink raw reply related

* [PATCH 3/6] Consolidate of_find_property
From: Stephen Rothwell @ 2007-04-24 12:39 UTC (permalink / raw)
  To: David S. Miller, paulus; +Cc: ppc-dev
In-Reply-To: <20070424223245.78f4fdfb.sfr@canb.auug.org.au>

The only change here is that a readlock is taken while the property list
is being traversed on Sparc where it was not taken previously.

Also, Sparc uses strcasecmp to compare property names while PowerPC
uses strcmp.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/kernel/prom.c |   24 +-----------------------
 arch/sparc/kernel/prom.c   |   22 +---------------------
 arch/sparc64/kernel/prom.c |   22 +---------------------
 drivers/openfw/base.c      |   26 ++++++++++++++++++++++++++
 include/asm-powerpc/prom.h |    1 +
 include/asm-sparc/prom.h   |    1 +
 include/asm-sparc64/prom.h |    1 +
 7 files changed, 32 insertions(+), 65 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 723df55..939d5e4 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -79,10 +79,7 @@ struct boot_param_header *initial_boot_params;
 
 static struct device_node *allnodes = NULL;
 
-/* use when traversing tree through the allnext, child, sibling,
- * or parent members of struct device_node.
- */
-static DEFINE_RWLOCK(devtree_lock);
+extern rwlock_t devtree_lock;	/* temporary while merging */
 
 /* export that to outside world */
 struct device_node *of_chosen;
@@ -1454,25 +1451,6 @@ static int __init prom_reconfig_setup(void)
 __initcall(prom_reconfig_setup);
 #endif
 
-struct property *of_find_property(const struct device_node *np,
-				  const char *name,
-				  int *lenp)
-{
-	struct property *pp;
-
-	read_lock(&devtree_lock);
-	for (pp = np->properties; pp != 0; pp = pp->next)
-		if (strcmp(pp->name, name) == 0) {
-			if (lenp != 0)
-				*lenp = pp->length;
-			break;
-		}
-	read_unlock(&devtree_lock);
-
-	return pp;
-}
-EXPORT_SYMBOL(of_find_property);
-
 /*
  * Add a property to a node
  */
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
index f2ce0d4..0f5aab4 100644
--- a/arch/sparc/kernel/prom.c
+++ b/arch/sparc/kernel/prom.c
@@ -27,10 +27,7 @@
 
 static struct device_node *allnodes;
 
-/* use when traversing tree through the allnext, child, sibling,
- * or parent members of struct device_node.
- */
-static DEFINE_RWLOCK(devtree_lock);
+extern rwlock_t devtree_lock;	/* temporary while merging */
 
 struct device_node *of_get_parent(const struct device_node *node)
 {
@@ -130,23 +127,6 @@ struct device_node *of_find_compatible_node(struct device_node *from,
 }
 EXPORT_SYMBOL(of_find_compatible_node);
 
-struct property *of_find_property(const struct device_node *np,
-				  const char *name,
-				  int *lenp)
-{
-	struct property *pp;
-
-	for (pp = np->properties; pp != 0; pp = pp->next) {
-		if (strcasecmp(pp->name, name) == 0) {
-			if (lenp != 0)
-				*lenp = pp->length;
-			break;
-		}
-	}
-	return pp;
-}
-EXPORT_SYMBOL(of_find_property);
-
 int of_getintprop_default(struct device_node *np, const char *name, int def)
 {
 	struct property *prop;
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index d6dd972..c759660 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -31,10 +31,7 @@
 
 static struct device_node *allnodes;
 
-/* use when traversing tree through the allnext, child, sibling,
- * or parent members of struct device_node.
- */
-static DEFINE_RWLOCK(devtree_lock);
+extern rwlock_t devtree_lock;	/* temporary while merging */
 
 struct device_node *of_get_parent(const struct device_node *node)
 {
@@ -134,23 +131,6 @@ struct device_node *of_find_compatible_node(struct device_node *from,
 }
 EXPORT_SYMBOL(of_find_compatible_node);
 
-struct property *of_find_property(const struct device_node *np,
-				  const char *name,
-				  int *lenp)
-{
-	struct property *pp;
-
-	for (pp = np->properties; pp != 0; pp = pp->next) {
-		if (strcasecmp(pp->name, name) == 0) {
-			if (lenp != 0)
-				*lenp = pp->length;
-			break;
-		}
-	}
-	return pp;
-}
-EXPORT_SYMBOL(of_find_property);
-
 int of_getintprop_default(struct device_node *np, const char *name, int def)
 {
 	struct property *prop;
diff --git a/drivers/openfw/base.c b/drivers/openfw/base.c
index 0751313..2597d29 100644
--- a/drivers/openfw/base.c
+++ b/drivers/openfw/base.c
@@ -18,6 +18,12 @@
  */
 #include <linux/module.h>
 #include <linux/openfw.h>
+#include <linux/spinlock.h>
+
+/* use when traversing tree through the allnext, child, sibling,
+ * or parent members of struct device_node.
+ */
+DEFINE_RWLOCK(devtree_lock);
 
 int of_n_addr_cells(struct device_node *np)
 {
@@ -51,6 +57,26 @@ int of_n_size_cells(struct device_node *np)
 }
 EXPORT_SYMBOL(of_n_size_cells);
 
+struct property *of_find_property(const struct device_node *np,
+				  const char *name,
+				  int *lenp)
+{
+	struct property *pp;
+
+	read_lock(&devtree_lock);
+	for (pp = np->properties; pp != 0; pp = pp->next) {
+		if (of_prop_cmp(pp->name, name) == 0) {
+			if (lenp != 0)
+				*lenp = pp->length;
+			break;
+		}
+	}
+	read_unlock(&devtree_lock);
+
+	return pp;
+}
+EXPORT_SYMBOL(of_find_property);
+
 /*
  * Find a property with a given name for a given node
  * and return the value.
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 1f3e8cd..a0679be 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -25,6 +25,7 @@
 #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT	1
 
 #define of_compat_cmp(s1, s2, l)	strncasecmp((s1), (s2), (l))
+#define of_prop_cmp(s1, s2)		strcmp((s1), (s2))
 
 /* Definitions used by the flattened device tree */
 #define OF_DT_HEADER		0xd00dfeed	/* marker */
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
index cc049fd..d3dc05b 100644
--- a/include/asm-sparc/prom.h
+++ b/include/asm-sparc/prom.h
@@ -24,6 +24,7 @@
 #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT	1
 
 #define of_compat_cmp(s1, s2, l)	strncmp((s1), (s2), (l))
+#define of_prop_cmp(s1, s2)		strcasecmp((s1), (s2))
 
 typedef u32 phandle;
 typedef u32 ihandle;
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
index 843f9e8..a1b64e7 100644
--- a/include/asm-sparc64/prom.h
+++ b/include/asm-sparc64/prom.h
@@ -24,6 +24,7 @@
 #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT	1
 
 #define of_compat_cmp(s1, s2, l)	strncmp((s1), (s2), (l))
+#define of_prop_cmp(s1, s2)		strcasecmp((s1), (s2))
 
 typedef u32 phandle;
 typedef u32 ihandle;
-- 
1.5.1.2

^ permalink raw reply related

* [PATCH 4/6] Consolidate of_get_parent
From: Stephen Rothwell @ 2007-04-24 12:40 UTC (permalink / raw)
  To: David S. Miller, paulus; +Cc: ppc-dev
In-Reply-To: <20070424223245.78f4fdfb.sfr@canb.auug.org.au>

This requires creating dummy of_node_{get,put} routines for sparc and
sparc64.  It also adds a readlocal around the parent accesses.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/kernel/prom.c |   21 ---------------------
 arch/sparc/kernel/prom.c   |   13 -------------
 arch/sparc64/kernel/prom.c |   13 -------------
 drivers/openfw/base.c      |   21 +++++++++++++++++++++
 include/asm-sparc/prom.h   |    9 +++++++++
 include/asm-sparc64/prom.h |    9 +++++++++
 6 files changed, 39 insertions(+), 47 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 939d5e4..55e67ca 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1225,27 +1225,6 @@ struct device_node *of_find_all_nodes(struct device_node *prev)
 EXPORT_SYMBOL(of_find_all_nodes);
 
 /**
- *	of_get_parent - Get a node's parent if any
- *	@node:	Node to get parent
- *
- *	Returns a node pointer with refcount incremented, use
- *	of_node_put() on it when done.
- */
-struct device_node *of_get_parent(const struct device_node *node)
-{
-	struct device_node *np;
-
-	if (!node)
-		return NULL;
-
-	read_lock(&devtree_lock);
-	np = of_node_get(node->parent);
-	read_unlock(&devtree_lock);
-	return np;
-}
-EXPORT_SYMBOL(of_get_parent);
-
-/**
  *	of_get_next_child - Iterate a node childs
  *	@node:	parent node
  *	@prev:	previous child of the parent node, or NULL to get first
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
index 0f5aab4..b378715 100644
--- a/arch/sparc/kernel/prom.c
+++ b/arch/sparc/kernel/prom.c
@@ -29,19 +29,6 @@ static struct device_node *allnodes;
 
 extern rwlock_t devtree_lock;	/* temporary while merging */
 
-struct device_node *of_get_parent(const struct device_node *node)
-{
-	struct device_node *np;
-
-	if (!node)
-		return NULL;
-
-	np = node->parent;
-
-	return np;
-}
-EXPORT_SYMBOL(of_get_parent);
-
 struct device_node *of_get_next_child(const struct device_node *node,
 	struct device_node *prev)
 {
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index c759660..f876079 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -33,19 +33,6 @@ static struct device_node *allnodes;
 
 extern rwlock_t devtree_lock;	/* temporary while merging */
 
-struct device_node *of_get_parent(const struct device_node *node)
-{
-	struct device_node *np;
-
-	if (!node)
-		return NULL;
-
-	np = node->parent;
-
-	return np;
-}
-EXPORT_SYMBOL(of_get_parent);
-
 struct device_node *of_get_next_child(const struct device_node *node,
 	struct device_node *prev)
 {
diff --git a/drivers/openfw/base.c b/drivers/openfw/base.c
index 2597d29..3fc02de 100644
--- a/drivers/openfw/base.c
+++ b/drivers/openfw/base.c
@@ -113,3 +113,24 @@ int of_device_is_compatible(const struct device_node *device,
 	return 0;
 }
 EXPORT_SYMBOL(of_device_is_compatible);
+
+/**
+ *	of_get_parent - Get a node's parent if any
+ *	@node:	Node to get parent
+ *
+ *	Returns a node pointer with refcount incremented, use
+ *	of_node_put() on it when done.
+ */
+struct device_node *of_get_parent(const struct device_node *node)
+{
+	struct device_node *np;
+
+	if (!node)
+		return NULL;
+
+	read_lock(&devtree_lock);
+	np = of_node_get(node->parent);
+	read_unlock(&devtree_lock);
+	return np;
+}
+EXPORT_SYMBOL(of_get_parent);
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
index d3dc05b..4621af6 100644
--- a/include/asm-sparc/prom.h
+++ b/include/asm-sparc/prom.h
@@ -66,6 +66,15 @@ extern int of_getintprop_default(struct device_node *np,
 
 extern void prom_build_devicetree(void);
 
+/* Dummy ref counting routines - to be implemented later */
+static inline struct device_node *of_node_get(struct device_node *node)
+{
+	return node;
+}
+static inline void of_node_put(struct device_node *node)
+{
+}
+
 /*
  * NB:  This is here while we transition from using asm/prom.h
  * to linux/openfw.h
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
index a1b64e7..c36b884 100644
--- a/include/asm-sparc64/prom.h
+++ b/include/asm-sparc64/prom.h
@@ -74,6 +74,15 @@ extern int of_getintprop_default(struct device_node *np,
 
 extern void prom_build_devicetree(void);
 
+/* Dummy ref counting routines - to be implemented later */
+static inline struct device_node *of_node_get(struct device_node *node)
+{
+	return node;
+}
+static inline void of_node_put(struct device_node *node)
+{
+}
+
 /*
  * NB:  This is here while we transition from using asm/prom.h
  * to linux/openfw.h
-- 
1.5.1.2

^ permalink raw reply related

* [PATCH 5/6] Consolidate of_get_next_child
From: Stephen Rothwell @ 2007-04-24 12:42 UTC (permalink / raw)
  To: David S. Miller, paulus; +Cc: ppc-dev
In-Reply-To: <20070424223245.78f4fdfb.sfr@canb.auug.org.au>

This adds a readlock around the child/next accesses on Sparc.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/kernel/prom.c |   24 ------------------------
 arch/sparc/kernel/prom.c   |   14 --------------
 arch/sparc64/kernel/prom.c |   14 --------------
 drivers/openfw/base.c      |   24 ++++++++++++++++++++++++
 4 files changed, 24 insertions(+), 52 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 55e67ca..90901e4 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1225,30 +1225,6 @@ struct device_node *of_find_all_nodes(struct device_node *prev)
 EXPORT_SYMBOL(of_find_all_nodes);
 
 /**
- *	of_get_next_child - Iterate a node childs
- *	@node:	parent node
- *	@prev:	previous child of the parent node, or NULL to get first
- *
- *	Returns a node pointer with refcount incremented, use
- *	of_node_put() on it when done.
- */
-struct device_node *of_get_next_child(const struct device_node *node,
-	struct device_node *prev)
-{
-	struct device_node *next;
-
-	read_lock(&devtree_lock);
-	next = prev ? prev->sibling : node->child;
-	for (; next != 0; next = next->sibling)
-		if (of_node_get(next))
-			break;
-	of_node_put(prev);
-	read_unlock(&devtree_lock);
-	return next;
-}
-EXPORT_SYMBOL(of_get_next_child);
-
-/**
  *	of_node_get - Increment refcount of a node
  *	@node:	Node to inc refcount, NULL is supported to
  *		simplify writing of callers
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
index b378715..3f8ccfa 100644
--- a/arch/sparc/kernel/prom.c
+++ b/arch/sparc/kernel/prom.c
@@ -29,20 +29,6 @@ static struct device_node *allnodes;
 
 extern rwlock_t devtree_lock;	/* temporary while merging */
 
-struct device_node *of_get_next_child(const struct device_node *node,
-	struct device_node *prev)
-{
-	struct device_node *next;
-
-	next = prev ? prev->sibling : node->child;
-	for (; next != 0; next = next->sibling) {
-		break;
-	}
-
-	return next;
-}
-EXPORT_SYMBOL(of_get_next_child);
-
 struct device_node *of_find_node_by_path(const char *path)
 {
 	struct device_node *np = allnodes;
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index f876079..be3b958 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -33,20 +33,6 @@ static struct device_node *allnodes;
 
 extern rwlock_t devtree_lock;	/* temporary while merging */
 
-struct device_node *of_get_next_child(const struct device_node *node,
-	struct device_node *prev)
-{
-	struct device_node *next;
-
-	next = prev ? prev->sibling : node->child;
-	for (; next != 0; next = next->sibling) {
-		break;
-	}
-
-	return next;
-}
-EXPORT_SYMBOL(of_get_next_child);
-
 struct device_node *of_find_node_by_path(const char *path)
 {
 	struct device_node *np = allnodes;
diff --git a/drivers/openfw/base.c b/drivers/openfw/base.c
index 3fc02de..60f7bd4 100644
--- a/drivers/openfw/base.c
+++ b/drivers/openfw/base.c
@@ -134,3 +134,27 @@ struct device_node *of_get_parent(const struct device_node *node)
 	return np;
 }
 EXPORT_SYMBOL(of_get_parent);
+
+/**
+ *	of_get_next_child - Iterate a node childs
+ *	@node:	parent node
+ *	@prev:	previous child of the parent node, or NULL to get first
+ *
+ *	Returns a node pointer with refcount incremented, use
+ *	of_node_put() on it when done.
+ */
+struct device_node *of_get_next_child(const struct device_node *node,
+	struct device_node *prev)
+{
+	struct device_node *next;
+
+	read_lock(&devtree_lock);
+	next = prev ? prev->sibling : node->child;
+	for (; next; next = next->sibling)
+		if (of_node_get(next))
+			break;
+	of_node_put(prev);
+	read_unlock(&devtree_lock);
+	return next;
+}
+EXPORT_SYMBOL(of_get_next_child);
-- 
1.5.1.2

^ permalink raw reply related

* [PATCH 6/6] Consolidate of_find_node_by routines
From: Stephen Rothwell @ 2007-04-24 12:43 UTC (permalink / raw)
  To: David S. Miller, paulus; +Cc: ppc-dev
In-Reply-To: <20070424223245.78f4fdfb.sfr@canb.auug.org.au>

This consolidates the routines of_find_node_by_path, of_find_node_by_name,
of_find_node_by_type and of_find_compatible_device.  Again, the comparison
of strings are done differently by Sparc and PowerPC and also these add
readlocks around the iterations.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/kernel/prom.c |  113 +-------------------------------------------
 arch/sparc/kernel/prom.c   |   61 +-----------------------
 arch/sparc64/kernel/prom.c |   61 +-----------------------
 drivers/openfw/base.c      |  114 ++++++++++++++++++++++++++++++++++++++++++++
 include/asm-powerpc/prom.h |    1 +
 include/asm-sparc/prom.h   |    1 +
 include/asm-sparc64/prom.h |    1 +
 7 files changed, 120 insertions(+), 232 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 90901e4..fc64bcb 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -77,7 +77,7 @@ static struct boot_param_header *initial_boot_params __initdata;
 struct boot_param_header *initial_boot_params;
 #endif
 
-static struct device_node *allnodes = NULL;
+extern struct device_node *allnodes;	/* temporary while merging */
 
 extern rwlock_t devtree_lock;	/* temporary while merging */
 
@@ -1068,117 +1068,6 @@ EXPORT_SYMBOL(machine_is_compatible);
  *
  *******/
 
-/**
- *	of_find_node_by_name - Find a node by its "name" property
- *	@from:	The node to start searching from or NULL, the node
- *		you pass will not be searched, only the next one
- *		will; typically, you pass what the previous call
- *		returned. of_node_put() will be called on it
- *	@name:	The name string to match against
- *
- *	Returns a node pointer with refcount incremented, use
- *	of_node_put() on it when done.
- */
-struct device_node *of_find_node_by_name(struct device_node *from,
-	const char *name)
-{
-	struct device_node *np;
-
-	read_lock(&devtree_lock);
-	np = from ? from->allnext : allnodes;
-	for (; np != NULL; np = np->allnext)
-		if (np->name != NULL && strcasecmp(np->name, name) == 0
-		    && of_node_get(np))
-			break;
-	of_node_put(from);
-	read_unlock(&devtree_lock);
-	return np;
-}
-EXPORT_SYMBOL(of_find_node_by_name);
-
-/**
- *	of_find_node_by_type - Find a node by its "device_type" property
- *	@from:	The node to start searching from or NULL, the node
- *		you pass will not be searched, only the next one
- *		will; typically, you pass what the previous call
- *		returned. of_node_put() will be called on it
- *	@name:	The type string to match against
- *
- *	Returns a node pointer with refcount incremented, use
- *	of_node_put() on it when done.
- */
-struct device_node *of_find_node_by_type(struct device_node *from,
-	const char *type)
-{
-	struct device_node *np;
-
-	read_lock(&devtree_lock);
-	np = from ? from->allnext : allnodes;
-	for (; np != 0; np = np->allnext)
-		if (np->type != 0 && strcasecmp(np->type, type) == 0
-		    && of_node_get(np))
-			break;
-	of_node_put(from);
-	read_unlock(&devtree_lock);
-	return np;
-}
-EXPORT_SYMBOL(of_find_node_by_type);
-
-/**
- *	of_find_compatible_node - Find a node based on type and one of the
- *                                tokens in its "compatible" property
- *	@from:		The node to start searching from or NULL, the node
- *			you pass will not be searched, only the next one
- *			will; typically, you pass what the previous call
- *			returned. of_node_put() will be called on it
- *	@type:		The type string to match "device_type" or NULL to ignore
- *	@compatible:	The string to match to one of the tokens in the device
- *			"compatible" list.
- *
- *	Returns a node pointer with refcount incremented, use
- *	of_node_put() on it when done.
- */
-struct device_node *of_find_compatible_node(struct device_node *from,
-	const char *type, const char *compatible)
-{
-	struct device_node *np;
-
-	read_lock(&devtree_lock);
-	np = from ? from->allnext : allnodes;
-	for (; np != 0; np = np->allnext) {
-		if (type != NULL
-		    && !(np->type != 0 && strcasecmp(np->type, type) == 0))
-			continue;
-		if (of_device_is_compatible(np, compatible) && of_node_get(np))
-			break;
-	}
-	of_node_put(from);
-	read_unlock(&devtree_lock);
-	return np;
-}
-EXPORT_SYMBOL(of_find_compatible_node);
-
-/**
- *	of_find_node_by_path - Find a node matching a full OF path
- *	@path:	The full path to match
- *
- *	Returns a node pointer with refcount incremented, use
- *	of_node_put() on it when done.
- */
-struct device_node *of_find_node_by_path(const char *path)
-{
-	struct device_node *np = allnodes;
-
-	read_lock(&devtree_lock);
-	for (; np != 0; np = np->allnext) {
-		if (np->full_name != 0 && strcasecmp(np->full_name, path) == 0
-		    && of_node_get(np))
-			break;
-	}
-	read_unlock(&devtree_lock);
-	return np;
-}
-EXPORT_SYMBOL(of_find_node_by_path);
 
 /**
  *	of_find_node_by_phandle - Find a node given a phandle
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
index 3f8ccfa..012f983 100644
--- a/arch/sparc/kernel/prom.c
+++ b/arch/sparc/kernel/prom.c
@@ -25,23 +25,10 @@
 #include <asm/prom.h>
 #include <asm/oplib.h>
 
-static struct device_node *allnodes;
+extern struct device_node *allnodes;	/* temporary while merging */
 
 extern rwlock_t devtree_lock;	/* temporary while merging */
 
-struct device_node *of_find_node_by_path(const char *path)
-{
-	struct device_node *np = allnodes;
-
-	for (; np != 0; np = np->allnext) {
-		if (np->full_name != 0 && strcmp(np->full_name, path) == 0)
-			break;
-	}
-
-	return np;
-}
-EXPORT_SYMBOL(of_find_node_by_path);
-
 struct device_node *of_find_node_by_phandle(phandle handle)
 {
 	struct device_node *np;
@@ -54,52 +41,6 @@ struct device_node *of_find_node_by_phandle(phandle handle)
 }
 EXPORT_SYMBOL(of_find_node_by_phandle);
 
-struct device_node *of_find_node_by_name(struct device_node *from,
-	const char *name)
-{
-	struct device_node *np;
-
-	np = from ? from->allnext : allnodes;
-	for (; np != NULL; np = np->allnext)
-		if (np->name != NULL && strcmp(np->name, name) == 0)
-			break;
-
-	return np;
-}
-EXPORT_SYMBOL(of_find_node_by_name);
-
-struct device_node *of_find_node_by_type(struct device_node *from,
-	const char *type)
-{
-	struct device_node *np;
-
-	np = from ? from->allnext : allnodes;
-	for (; np != 0; np = np->allnext)
-		if (np->type != 0 && strcmp(np->type, type) == 0)
-			break;
-
-	return np;
-}
-EXPORT_SYMBOL(of_find_node_by_type);
-
-struct device_node *of_find_compatible_node(struct device_node *from,
-	const char *type, const char *compatible)
-{
-	struct device_node *np;
-
-	np = from ? from->allnext : allnodes;
-	for (; np != 0; np = np->allnext) {
-		if (type != NULL
-		    && !(np->type != 0 && strcmp(np->type, type) == 0))
-			continue;
-		if (of_device_is_compatible(np, compatible))
-			break;
-	}
-
-	return np;
-}
-EXPORT_SYMBOL(of_find_compatible_node);
-
 int of_getintprop_default(struct device_node *np, const char *name, int def)
 {
 	struct property *prop;
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index be3b958..ae2065c 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -29,23 +29,10 @@
 #include <asm/asi.h>
 #include <asm/upa.h>
 
-static struct device_node *allnodes;
+extern struct device_node *allnodes;	/* temporary while merging */
 
 extern rwlock_t devtree_lock;	/* temporary while merging */
 
-struct device_node *of_find_node_by_path(const char *path)
-{
-	struct device_node *np = allnodes;
-
-	for (; np != 0; np = np->allnext) {
-		if (np->full_name != 0 && strcmp(np->full_name, path) == 0)
-			break;
-	}
-
-	return np;
-}
-EXPORT_SYMBOL(of_find_node_by_path);
-
 struct device_node *of_find_node_by_phandle(phandle handle)
 {
 	struct device_node *np;
@@ -58,52 +45,6 @@ struct device_node *of_find_node_by_phandle(phandle handle)
 }
 EXPORT_SYMBOL(of_find_node_by_phandle);
 
-struct device_node *of_find_node_by_name(struct device_node *from,
-	const char *name)
-{
-	struct device_node *np;
-
-	np = from ? from->allnext : allnodes;
-	for (; np != NULL; np = np->allnext)
-		if (np->name != NULL && strcmp(np->name, name) == 0)
-			break;
-
-	return np;
-}
-EXPORT_SYMBOL(of_find_node_by_name);
-
-struct device_node *of_find_node_by_type(struct device_node *from,
-	const char *type)
-{
-	struct device_node *np;
-
-	np = from ? from->allnext : allnodes;
-	for (; np != 0; np = np->allnext)
-		if (np->type != 0 && strcmp(np->type, type) == 0)
-			break;
-
-	return np;
-}
-EXPORT_SYMBOL(of_find_node_by_type);
-
-struct device_node *of_find_compatible_node(struct device_node *from,
-	const char *type, const char *compatible)
-{
-	struct device_node *np;
-
-	np = from ? from->allnext : allnodes;
-	for (; np != 0; np = np->allnext) {
-		if (type != NULL
-		    && !(np->type != 0 && strcmp(np->type, type) == 0))
-			continue;
-		if (of_device_is_compatible(np, compatible))
-			break;
-	}
-
-	return np;
-}
-EXPORT_SYMBOL(of_find_compatible_node);
-
 int of_getintprop_default(struct device_node *np, const char *name, int def)
 {
 	struct property *prop;
diff --git a/drivers/openfw/base.c b/drivers/openfw/base.c
index 60f7bd4..bb66e48 100644
--- a/drivers/openfw/base.c
+++ b/drivers/openfw/base.c
@@ -20,6 +20,8 @@
 #include <linux/openfw.h>
 #include <linux/spinlock.h>
 
+struct device_node *allnodes;
+
 /* use when traversing tree through the allnext, child, sibling,
  * or parent members of struct device_node.
  */
@@ -158,3 +160,115 @@ struct device_node *of_get_next_child(const struct device_node *node,
 	return next;
 }
 EXPORT_SYMBOL(of_get_next_child);
+
+/**
+ *	of_find_node_by_path - Find a node matching a full OF path
+ *	@path:	The full path to match
+ *
+ *	Returns a node pointer with refcount incremented, use
+ *	of_node_put() on it when done.
+ */
+struct device_node *of_find_node_by_path(const char *path)
+{
+	struct device_node *np = allnodes;
+
+	read_lock(&devtree_lock);
+	for (; np; np = np->allnext) {
+		if (np->full_name && (of_node_cmp(np->full_name, path) == 0)
+		    && of_node_get(np))
+			break;
+	}
+	read_unlock(&devtree_lock);
+	return np;
+}
+EXPORT_SYMBOL(of_find_node_by_path);
+
+/**
+ *	of_find_node_by_name - Find a node by its "name" property
+ *	@from:	The node to start searching from or NULL, the node
+ *		you pass will not be searched, only the next one
+ *		will; typically, you pass what the previous call
+ *		returned. of_node_put() will be called on it
+ *	@name:	The name string to match against
+ *
+ *	Returns a node pointer with refcount incremented, use
+ *	of_node_put() on it when done.
+ */
+struct device_node *of_find_node_by_name(struct device_node *from,
+	const char *name)
+{
+	struct device_node *np;
+
+	read_lock(&devtree_lock);
+	np = from ? from->allnext : allnodes;
+	for (; np; np = np->allnext)
+		if (np->name && (of_node_cmp(np->name, name) == 0)
+		    && of_node_get(np))
+			break;
+	of_node_put(from);
+	read_unlock(&devtree_lock);
+	return np;
+}
+EXPORT_SYMBOL(of_find_node_by_name);
+
+/**
+ *	of_find_node_by_type - Find a node by its "device_type" property
+ *	@from:	The node to start searching from or NULL, the node
+ *		you pass will not be searched, only the next one
+ *		will; typically, you pass what the previous call
+ *		returned. of_node_put() will be called on it
+ *	@name:	The type string to match against
+ *
+ *	Returns a node pointer with refcount incremented, use
+ *	of_node_put() on it when done.
+ */
+struct device_node *of_find_node_by_type(struct device_node *from,
+	const char *type)
+{
+	struct device_node *np;
+
+	read_lock(&devtree_lock);
+	np = from ? from->allnext : allnodes;
+	for (; np; np = np->allnext)
+		if (np->type && (of_node_cmp(np->type, type) == 0)
+		    && of_node_get(np))
+			break;
+	of_node_put(from);
+	read_unlock(&devtree_lock);
+	return np;
+}
+EXPORT_SYMBOL(of_find_node_by_type);
+
+/**
+ *	of_find_compatible_node - Find a node based on type and one of the
+ *                                tokens in its "compatible" property
+ *	@from:		The node to start searching from or NULL, the node
+ *			you pass will not be searched, only the next one
+ *			will; typically, you pass what the previous call
+ *			returned. of_node_put() will be called on it
+ *	@type:		The type string to match "device_type" or NULL to ignore
+ *	@compatible:	The string to match to one of the tokens in the device
+ *			"compatible" list.
+ *
+ *	Returns a node pointer with refcount incremented, use
+ *	of_node_put() on it when done.
+ */
+struct device_node *of_find_compatible_node(struct device_node *from,
+	const char *type, const char *compatible)
+{
+	struct device_node *np;
+
+	read_lock(&devtree_lock);
+	np = from ? from->allnext : allnodes;
+	for (; np; np = np->allnext) {
+		if (type
+		    && !(np->type && (of_node_cmp(np->type, type) == 0)))
+			continue;
+		if (of_device_is_compatible(np, compatible) && of_node_get(np))
+			break;
+	}
+	of_node_put(from);
+	read_unlock(&devtree_lock);
+	return np;
+}
+EXPORT_SYMBOL(of_find_compatible_node);
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index a0679be..d0ff917 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -26,6 +26,7 @@
 
 #define of_compat_cmp(s1, s2, l)	strncasecmp((s1), (s2), (l))
 #define of_prop_cmp(s1, s2)		strcmp((s1), (s2))
+#define of_node_cmp(s1, s2)		strcasecmp((s1), (s2))
 
 /* Definitions used by the flattened device tree */
 #define OF_DT_HEADER		0xd00dfeed	/* marker */
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
index 4621af6..92919ac 100644
--- a/include/asm-sparc/prom.h
+++ b/include/asm-sparc/prom.h
@@ -25,6 +25,7 @@
 
 #define of_compat_cmp(s1, s2, l)	strncmp((s1), (s2), (l))
 #define of_prop_cmp(s1, s2)		strcasecmp((s1), (s2))
+#define of_node_cmp(s1, s2)		strcmp((s1), (s2))
 
 typedef u32 phandle;
 typedef u32 ihandle;
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
index c36b884..d2123c2 100644
--- a/include/asm-sparc64/prom.h
+++ b/include/asm-sparc64/prom.h
@@ -25,6 +25,7 @@
 
 #define of_compat_cmp(s1, s2, l)	strncmp((s1), (s2), (l))
 #define of_prop_cmp(s1, s2)		strcasecmp((s1), (s2))
+#define of_node_cmp(s1, s2)		strcmp((s1), (s2))
 
 typedef u32 phandle;
 typedef u32 ihandle;
-- 
1.5.1.2

^ permalink raw reply related

* 2.6 Kernel , Xilinx Virtex and PPC 405 On chip memory controllers ( DSOCM and ISOCM )
From: Mohammad Sadegh Sadri @ 2007-04-24 12:52 UTC (permalink / raw)
  To: Linux PPC Linux PPC


Hi all,

Just a very simple question about the 2.6 kerenl,

suppose that in my base system I have included 8kbytes of memory for DS OCM=
 and 8K for IS OCM,
I have generated the proper xparameters.h and copied it into kernel

Now I want to know if kernel will use this portion of memory during it's op=
eration?
Does this increase performance?

thanks

_________________________________________________________________
Explore the seven wonders of the world
http://search.msn.com/results.aspx?q=3D7+wonders+world&mkt=3Den-US&form=3DQ=
BRE=

^ permalink raw reply

* Re: [PATCH 1/6] Start split out of common open firmware code
From: Segher Boessenkool @ 2007-04-24 13:27 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: ppc-dev, paulus, David S. Miller
In-Reply-To: <20070424223245.78f4fdfb.sfr@canb.auug.org.au>

> +int of_n_addr_cells(struct device_node *np)
> +{
> +	const int *ip;
> +
> +	do {
> +		if (np->parent)
> +			np = np->parent;
> +		ip = of_get_property(np, "#address-cells", NULL);
> +		if (ip)
> +			return *ip;
> +	} while (np->parent);
> +	/* No #address-cells property for the root node */
> +	return OF_ROOT_NODE_ADDR_CELLS_DEFAULT;
> +}
> +EXPORT_SYMBOL(of_n_addr_cells);

While I realise your patch is just moving stuff around,
can this be fixed please?  A missing "#address-cells"
property means "two cells", not "inherit from parent".
The few platforms with a broken tree should just be
fixed (patch the tree in the bootwrapper, or perhaps
_do_ use this workaround, but only on the affected
platforms).

> +int of_n_size_cells(struct device_node *np)

Same here (the default is one cell though).

> --- a/include/asm-powerpc/prom.h
> +++ b/include/asm-powerpc/prom.h
> @@ -21,6 +21,9 @@
>  #include <asm/irq.h>
>  #include <asm/atomic.h>
>
> +#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT	1
> +#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT	1

Even worse!

> --- a/include/asm-sparc/prom.h
> +++ b/include/asm-sparc/prom.h
> @@ -20,6 +20,9 @@
>  #include <linux/proc_fs.h>
>  #include <asm/atomic.h>
>
> +#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT	2
> +#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT	1

Those are the defaults for all nodes, not just the
root node.


Segher

^ permalink raw reply

* Re: [PATCH 2/6] Consolidate of_device_is_compatible
From: Segher Boessenkool @ 2007-04-24 13:36 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: ppc-dev, paulus, David S. Miller
In-Reply-To: <20070424223812.2842f3f2.sfr@canb.auug.org.au>

> The only difference here is that Sparc uses strncmp to match 
> compatibility
> names while PowerPC uses strncasecmp.

The sparc behaviour is correct here (not that the powerpc
behaviour hurts much, but...)

Perhaps add a note about this?


Segher

^ permalink raw reply

* Re: Using Xilinx Framebuffer on ML405 and 2.6.20.4
From: Grant Likely @ 2007-04-24 13:38 UTC (permalink / raw)
  To: Peter Mendham; +Cc: linuxppc-embedded
In-Reply-To: <462DCA31.4060009@computing.dundee.ac.uk>

On 4/24/07, Peter Mendham <petermendham@computing.dundee.ac.uk> wrote:
> Dear all,
>
> I am wanting to use the Xilinx TFT controller from the ML403/5 reference
> project (probably from ML300 as well) under a 2.6.20.4 kernel.  I have
> Grant Likely's patchset applied in which there is a platform device
> entry for the framebuffer.  Does anyone know if there is mainline
> support for the Xilinx-style framebuffer?  If so, how do I enable it?  I
> have included framebuffer support in my kernel build, but I assume I
> need a driver also? Any tips greatly appreciated.

Heh, I've got a driver.  I just haven't published it yet.  Give me a few days...

g.

-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: [PATCH 3/6] Consolidate of_find_property
From: Segher Boessenkool @ 2007-04-24 13:41 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: ppc-dev, paulus, David S. Miller
In-Reply-To: <20070424223930.1dab0e28.sfr@canb.auug.org.au>

> Also, Sparc uses strcasecmp to compare property names while PowerPC
> uses strcmp.

Property names aren't supposed to contain uppercase
characters.  I can swing both ways on which of strcmp()
or strcasecmp() is better, but there seems no reason
to do this differently on each platform.

Let me repeat this isn't an argument against your
patch -- indeed, it is probably better to keep the
status quo as the first merging step; I'm just
pointing out stuff that should be fixed in some
follow up.


Segher

^ permalink raw reply

* Re: zImage.elf loads but does not start
From: Mirek23 @ 2007-04-24 13:42 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <528646bc0704231035g6a1ac904wc6b9b7b77afd1037@mail.gmail.com>


Thanks for the suggestions. I have changed the command line argument:
console:ttl0 -> ttyUL0 and kernel has booted up to the point to mount the
root file system.

I have set up the kernel to mount the root file systems via the nfs. I have
started the nfs server on the remote pc.
Unfortunately the kernel did not mount the nfs root file system. The strange
thing is that during booting the kernel I did not see any entry which refers
to the TEMAC driver (which I have enabled in the kernel). 

I have noticed that in the drivers/net/xilinx_temac directory there is a
file xtemac_g.c. It creates the global variable (a table) which contains all
fo the definitions to configure TEMAC interface. All of the definitions used
in the xtemac_g.c file come from xparameters_ml403.h. The strange thing is
that this xtemac_g.c is not include in the Makefile to be compiled. 

I have incluede that file to the Makefile in order to use the TEMAC config
parameters but when booting the kernel I did not find any diffrence
compering to the driver which was originaly built without the xtemac_g.c

The kernel boots as following:

loaded at:     00400000 004F9138
board data at: 004F7120 004F7138
relocated to:  004040B8 004040D0
zimage at:     00404E45 004F6D1F
avail ram:     004FA000 04000000

Linux/PPC load: console=ttyUL0,9600 root=/dev/nfs rw
nfsroot=129.129.130.106:/opt/eldk41/ppc_4xx,tcp
ip=129.129.129.29:255.255.255.0:LM200:eth0:off panic=1

Uncompressing Linux...done.
Now booting the kernel
[    0.000000] Linux version 2.6.21-rc6-gd4bba4bf-dirty (root@pc5215) (gcc
version 4.0.2) #8 Tue Apr 24 14:51:35 CEST 2007
[    0.000000] Xilinx ML403 Reference System (Virtex-4 FX)
[    0.000000] Zone PFN ranges:
[    0.000000]   DMA             0 ->    16384
[    0.000000]   Normal      16384 ->    16384
[    0.000000] early_node_map[1] active PFN ranges
[    0.000000]     0:        0 ->    16384
[    0.000000] Built 1 zonelists.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyUL0,9600 root=/dev/nfs rw
nfsroot=129.129.130.106:/opt/eldk41/ppc_4xx,tcp
ip=129.129.129.29:255.255.255.0:LM200:eth0:off panic=1
[    0.000000] Xilinx INTC #0 at 0x41200000 mapped to 0xFDFFF000
[    0.000000] PID hash table entries: 256 (order: 8, 1024 bytes)
[    0.000418] Console: colour dummy device 80x25
[    0.001487] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.003212] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.034378] Memory: 62720k available (1568k kernel code, 512k data, 96k
init, 0k highmem)
[    0.121194] Mount-cache hash table entries: 512
[    0.129484] NET: Registered protocol family 16
[    0.162553] NET: Registered protocol family 2
[    0.196706] IP route cache hash table entries: 1024 (order: 0, 4096
bytes)
[    0.197898] TCP established hash table entries: 2048 (order: 2, 16384
bytes)
[    0.198605] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[    0.199040] TCP: Hash tables configured (established 2048 bind 2048)
[    0.199126] TCP reno registered
[    0.219619] io scheduler noop registered
[    0.219727] io scheduler anticipatory registered (default)
[    0.219807] io scheduler deadline registered
[    0.220367] io scheduler cfq registered
[    0.321949] uartlite.0: ttyUL0 at MMIO 0x40600003 (irq = 0) is a uartlite
[    2.254924] RAMDISK driver initialized: 1 RAM disks of 8192K size 1024
blocksize
[    2.346633] tun: Universal TUN/TAP device driver, 1.6
[    2.407407] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[    2.485482] mice: PS/2 mouse device common for all mice
[    2.548404] TCP cubic registered
[    2.587334] NET: Registered protocol family 1
[    2.639671] NET: Registered protocol family 17
[    3.197934] IP-Config: No network devices available.
[    3.259979] Looking up port of RPC 100003/2 on 129.129.130.106
[    3.331237] Root-NFS: Unable to get nfsd port number from server, using
default
[    3.419194] Looking up port of RPC 100005/1 on 129.129.130.106
[    3.490204] Root-NFS: Unable to get mountd port number from server, using
default
[    3.581337] Root-NFS: Server returned error -5 while mounting
/opt/eldk41/ppc_4xx
[    3.671568] VFS: Unable to mount root fs via NFS, trying floppy.
[    3.747080] VFS: Cannot open root device "nfs" or unknown-block(2,0)
[    3.823496] Please append a correct "root=" boot option
[    3.886242] Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(2,0)
[    3.985551] Rebooting in 1 seconds..<NULL>



Would you have any idea why it did not recognise the TEMAC interface and how
to configure the kernel that it recognises the network device.

Mirek

-- 
View this message in context: http://www.nabble.com/zImage.elf-loads-but-not-starts-tf3607582.html#a10161229
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply

* Re: Using Xilinx Framebuffer on ML405 and 2.6.20.4
From: Peter Mendham @ 2007-04-24 13:46 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-embedded
In-Reply-To: <528646bc0704240638m4c9dd04dlaaef0e8cdb57af53@mail.gmail.com>

Grant Likely wrote:
> Heh, I've got a driver.  I just haven't published it yet.  Give me a 
> few days...
Fantastic.  I'm happy to be on the front line of alpha testing if that's 
any help.

No worries with a few day's delay though, I'm trying to fit the TFT 
controller into with my design with a TEMAC in it and I'm having some 
serious issues meeting timing requirements.  The SystemACE controller 
just gives up the ghost loading the kernel image.  If you or anyone else 
has any tips on how to get designs that fail timing to work I'd love to 
hear them.  The other thing is a sanity check: I've assumed the reason 
the SystemACE controller is giving up is a bus mess-up caused by 
timing.  Any better ideas?

-- Peter

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.

^ permalink raw reply

* Re: Using Xilinx Framebuffer on ML405 and 2.6.20.4
From: Andrei Konovalov @ 2007-04-24 13:58 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-embedded
In-Reply-To: <528646bc0704240638m4c9dd04dlaaef0e8cdb57af53@mail.gmail.com>

Grant Likely wrote:
> On 4/24/07, Peter Mendham <petermendham@computing.dundee.ac.uk> wrote:
>> Dear all,
>>
>> I am wanting to use the Xilinx TFT controller from the ML403/5 reference
>> project (probably from ML300 as well) under a 2.6.20.4 kernel.  I have
>> Grant Likely's patchset applied in which there is a platform device
>> entry for the framebuffer.  Does anyone know if there is mainline
>> support for the Xilinx-style framebuffer?  If so, how do I enable it?  I
>> have included framebuffer support in my kernel build, but I assume I
>> need a driver also? Any tips greatly appreciated.
> 
> Heh, I've got a driver.  I just haven't published it yet.  Give me a few days...
> 
> g.
> 

We have one too :)

^ permalink raw reply

* [PATCH] Xilinx framebuffer device driver
From: Andrei Konovalov @ 2007-04-24 13:59 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: Rick Moleres

[-- Attachment #1: Type: text/plain, Size: 575 bytes --]

Add support for the video controller IP block included into Xilinx ML300 and
ML403 reference designs.

Signed-off-by: Andrei Konovalov <akonovalov@ru.mvista.com>
---

This patch relies on the "Patchset to establish sanity in Xilinx Virtex support" by Gran Likely to have
the frame buffer device registered on the platform bus. Without this patchset one needs to fill in
the struct platform_device and make sure platform_device_register() is called elsewhere.

Reviews and comments are welcome.

Would be nice to get this driver into mainline for the 2.6.22.

Thanks,
Andrei


[-- Attachment #2: ppc32-xilinx_fb.patch --]
[-- Type: text/x-patch, Size: 11377 bytes --]

Add support for the video controller IP block included into Xilinx ML300 and
ML403 reference designs.

 drivers/video/Kconfig    |   15 +
 drivers/video/Makefile   |    1 
 drivers/video/xilinxfb.c |  358 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 374 insertions(+)

Index: linux-2.6.20/drivers/video/Kconfig
===================================================================
--- linux-2.6.20.orig/drivers/video/Kconfig
+++ linux-2.6.20/drivers/video/Kconfig
@@ -1633,6 +1633,21 @@ config FB_PS3_DEFAULT_SIZE_M
 	  The default value can be overridden on the kernel command line
 	  using the "ps3fb" option (e.g. "ps3fb=9M");
 
+config FB_XILINX
+	tristate "Xilinx frame buffer support"
+	depends on FB && XILINX_VIRTEX
+	select FB_CFB_FILLRECT
+	select FB_CFB_COPYAREA
+	select FB_CFB_IMAGEBLIT
+	---help---
+	  Include support for the Xilinx ML300/ML403 reference design
+	  framebuffer. ML300 carries a 640*480 LCD display on the board,
+	  ML403 uses a standard DB15 VGA connector.
+
+config FB_XILINX_ROTATE
+	bool "Rotate display"
+	depends on FB_XILINX
+
 config FB_VIRTUAL
 	tristate "Virtual Frame Buffer support (ONLY FOR TESTING!)"
 	depends on FB
Index: linux-2.6.20/drivers/video/Makefile
===================================================================
--- linux-2.6.20.orig/drivers/video/Makefile
+++ linux-2.6.20/drivers/video/Makefile
@@ -99,6 +99,7 @@ obj-$(CONFIG_FB_PNX4008_DUM_RGB)  += pnx
 obj-$(CONFIG_FB_IBM_GXT4500)	  += gxt4500.o
 obj-$(CONFIG_FB_PS3)		  += ps3fb.o
 obj-$(CONFIG_FB_SM501)            += sm501fb.o
+obj-$(CONFIG_FB_XILINX)           += xilinxfb.o
 
 # Platform or fallback drivers go here
 obj-$(CONFIG_FB_VESA)             += vesafb.o
Index: linux-2.6.20/drivers/video/xilinxfb.c
===================================================================
--- /dev/null
+++ linux-2.6.20/drivers/video/xilinxfb.c
@@ -0,0 +1,358 @@
+/*
+ * xilinxfb.c
+ *
+ * Xilinx TFT LCD frame buffer driver
+ *
+ * Author: MontaVista Software, Inc.
+ *         source@mvista.com
+ *
+ * 2002-2007 (c) MontaVista Software, Inc.  This file is licensed under the
+ * terms of the GNU General Public License version 2.  This program is licensed
+ * "as is" without any warranty of any kind, whether express or implied.
+ */
+
+/*
+ * This driver was based on au1100fb.c by MontaVista rewritten for 2.6
+ * by Embedded Alley Solutions <source@embeddedalley.com>, which in turn
+ * was based on skeletonfb.c, Skeleton for a frame buffer device by
+ * Geert Uytterhoeven.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/version.h>
+#include <linux/errno.h>
+#include <linux/string.h>
+#include <linux/mm.h>
+#include <linux/fb.h>
+#include <linux/init.h>
+#include <linux/dma-mapping.h>
+#include <linux/platform_device.h>
+
+#include <asm/io.h>
+
+#define DRIVER_NAME		"xilinxfb"
+#define DRIVER_DESCRIPTION	"Xilinx TFT LCD frame buffer driver"
+
+/*
+ * The interface to the framebuffer is nice and simple.  There are two
+ * control registers.  The first tells the LCD interface where in memory
+ * the frame buffer is (only the 11 most significant bits are used, so
+ * don't start thinking about scrolling).  The second allows the LCD to
+ * be turned on or off as well as rotated 180 degrees.
+ */
+#define NUM_REGS	2
+#define REG_FB_ADDR	0
+#define REG_CTRL	1
+#define REG_CTRL_ENABLE	 0x0001
+#define REG_CTRL_ROTATE	 0x0002
+#if defined(CONFIG_FB_XILINX_ROTATE)
+#define REG_CTRL_DEFAULT (REG_CTRL_ENABLE | REG_CTRL_ROTATE)
+#else
+#define REG_CTRL_DEFAULT (REG_CTRL_ENABLE)
+#endif				/* CONFIG_FB_XILINX_ROTATE */
+
+/*
+ * The hardware only handles a single mode: 640x480 24 bit true
+ * color. Each pixel gets a word (32 bits) of memory.  Within each word,
+ * the 8 most significant bits are ignored, the next 8 bits are the red
+ * level, the next 8 bits are the green level and the 8 least
+ * significant bits are the blue level.  Each row of the LCD uses 1024
+ * words, but only the first 640 pixels are displayed with the other 384
+ * words being ignored.  There are 480 rows.
+ */
+#define BYTES_PER_PIXEL	4
+#define BITS_PER_PIXEL	(BYTES_PER_PIXEL * 8)
+#define XRES		640
+#define YRES		480
+#define XRES_VIRTUAL	1024
+#define YRES_VIRTUAL	YRES
+#define LINE_LENGTH	(XRES_VIRTUAL * BYTES_PER_PIXEL)
+#define FB_SIZE		(YRES_VIRTUAL * LINE_LENGTH)
+
+#define PALETTE_ENTRIES_NO	16	/* passed to fb_alloc_cmap() */
+
+/*
+ * Here are the default fb_fix_screeninfo and fb_var_screeninfo structures
+ */
+static struct fb_fix_screeninfo xilinx_fb_fix __initdata = {
+	.id =		"Xilinx",
+	.type =		FB_TYPE_PACKED_PIXELS,
+	.visual =	FB_VISUAL_TRUECOLOR,
+	.smem_len =	FB_SIZE,
+	.line_length =	LINE_LENGTH,
+	.accel =	FB_ACCEL_NONE
+};
+
+static struct fb_var_screeninfo xilinx_fb_var __initdata = {
+	.xres =			XRES,
+	.yres =			YRES,
+	.xres_virtual =		XRES_VIRTUAL,
+	.yres_virtual =		YRES_VIRTUAL,
+
+	.bits_per_pixel =	BITS_PER_PIXEL,
+
+	.red =		{ 16, 8, 0 },
+	.green =	{ 8, 8, 0 },
+	.blue =		{ 0, 8, 0 },
+	.transp =	{ 0, 0, 0 },
+
+	.activate =	FB_ACTIVATE_NOW,
+	.height = 	99,	/* in mm of NEC NL6448BC20-08 on ML300 */
+	.width =	132	/* in mm of NEC NL6448BC20-08 on ML300 */
+};
+
+struct xilinxfb_drvdata {
+
+	struct fb_info	info;		/* FB driver info record */
+
+	unsigned long	regs_phys;	/* phys. address of the control registers */
+	u32 		*regs;		/* virt. address of the control registers */
+
+	unsigned char	*fb_virt;	/* virt. address of the frame buffer */
+	dma_addr_t	fb_phys;	/* phys. address of the frame buffer */
+
+	u32		pseudo_palette[16];	/* Fake palette of 16 colors */
+};
+
+#define to_xilinxfb_drvdata(_info) \
+	container_of(_info, struct xilinxfb_drvdata, info)
+
+static int
+xilinx_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue,
+	unsigned transp, struct fb_info *fbi)
+{
+	u32 *palette = fbi->pseudo_palette;
+
+	if (regno >= PALETTE_ENTRIES_NO)
+		return -EINVAL;
+
+	if (fbi->var.grayscale) {
+		/* Convert color to grayscale.
+		 * grayscale = 0.30*R + 0.59*G + 0.11*B */
+		red = green = blue =
+			(red * 77 + green * 151 + blue * 28 + 127) >> 8;
+	}
+
+	/* fbi->fix.visual is always FB_VISUAL_TRUECOLOR */
+
+	/* We only handle 8 bits of each color. */
+	red >>= 8;
+	green >>= 8;
+	blue >>= 8;
+	palette[regno] = (red << 16) | (green << 8) | blue;
+
+	return 0;
+}
+
+static int
+xilinx_fb_blank(int blank_mode, struct fb_info *fbi)
+{
+	struct xilinxfb_drvdata *drvdata = to_xilinxfb_drvdata(fbi);
+
+	switch (blank_mode) {
+	case VESA_NO_BLANKING:
+		/* turn on panel */
+		out_be32(drvdata->regs + REG_CTRL, REG_CTRL_DEFAULT);
+		break;
+
+	case VESA_VSYNC_SUSPEND:
+	case VESA_HSYNC_SUSPEND:
+	case VESA_POWERDOWN:
+		/* turn off panel */
+		out_be32(drvdata->regs + REG_CTRL, 0);
+	default:
+		break;
+
+	}
+	return 0; /* success */
+}
+
+static int
+xilinx_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *fbi)
+{
+	if (var->xoffset != 0 || var->yoffset != 0)
+		return -EINVAL;
+
+	return 0;
+}
+
+static struct fb_ops xilinxfb_ops =
+{
+	.owner			= THIS_MODULE,
+	.fb_setcolreg		= xilinx_fb_setcolreg,
+	.fb_blank		= xilinx_fb_blank,
+	.fb_pan_display		= xilinx_fb_pan_display,
+	.fb_fillrect		= cfb_fillrect,
+	.fb_copyarea		= cfb_copyarea,
+	.fb_imageblit		= cfb_imageblit,
+};
+
+/* === The device driver === */
+
+static int
+xilinxfb_drv_probe(struct device *dev)
+{
+	struct xilinxfb_drvdata *drvdata;
+	struct resource *regs_res;
+	int retval;
+
+	if (!dev)
+		return -EINVAL;
+
+	drvdata = kmalloc(sizeof(struct xilinxfb_drvdata), GFP_KERNEL);
+	if (!drvdata) {
+		printk(KERN_ERR "Couldn't allocate device private record\n");
+		return -ENOMEM;
+	}
+	memset((void*)drvdata, 0, sizeof(struct xilinxfb_drvdata));
+	dev_set_drvdata(dev, (void *)drvdata);
+
+	/* Map the control registers in */
+	regs_res = platform_get_resource(to_platform_device(dev),
+			IORESOURCE_IO, 0);
+	if (!regs_res || (regs_res->end - regs_res->start + 1 < 8)) {
+		printk(KERN_ERR "Couldn't get registers resource\n");
+		retval = -EFAULT;
+		goto failed1;
+	}
+
+	if (!request_mem_region(regs_res->start, 8, DRIVER_NAME)) {
+		printk(KERN_ERR "Couldn't lock memory region at 0x%08lX\n",
+			regs_res->start);
+		retval = -EBUSY;
+		goto failed1;
+	}
+
+	drvdata->regs_phys = regs_res->start;
+	drvdata->regs = (u32 *) ioremap(regs_res->start, 8);
+
+	/* Allocate the framebuffer memory */
+	drvdata->fb_virt = dma_alloc_coherent(dev, PAGE_ALIGN(FB_SIZE),
+				&drvdata->fb_phys, GFP_KERNEL);
+	if (!drvdata->fb_virt) {
+		printk(KERN_ERR "Could not allocate frame buffer memory\n");
+		retval = -ENOMEM;
+		goto failed2;
+	}
+
+	/* Clear (turn to black) the framebuffer */
+	memset((void *) drvdata->fb_virt, 0, FB_SIZE);
+
+	/* Tell the hardware where the frame buffer is */
+	out_be32(drvdata->regs + REG_FB_ADDR, drvdata->fb_phys);
+
+	/* Turn on the display */
+	out_be32(drvdata->regs + REG_CTRL, REG_CTRL_DEFAULT);
+
+	/* Fill struct fb_info */
+	drvdata->info.screen_base = drvdata->fb_virt;
+	drvdata->info.fbops = &xilinxfb_ops;
+	drvdata->info.fix = xilinx_fb_fix;
+	drvdata->info.fix.smem_start = drvdata->fb_phys;
+	drvdata->info.pseudo_palette = drvdata->pseudo_palette;
+
+	if (fb_alloc_cmap(&drvdata->info.cmap, PALETTE_ENTRIES_NO, 0) < 0) {
+		printk(KERN_ERR "Fail to allocate colormap (%d entries)\n",
+			PALETTE_ENTRIES_NO);
+		retval = -EFAULT;
+		goto failed3;
+	}
+
+	drvdata->info.flags = FBINFO_DEFAULT;
+	drvdata->info.var = xilinx_fb_var;
+
+	/* Register new frame buffer */
+	if (register_framebuffer(&drvdata->info) < 0) {
+		printk(KERN_ERR "Could not register frame buffer\n");
+		retval = -EINVAL;
+		goto failed4;
+	}
+
+	return 0;	/* success */
+
+failed4:
+	fb_dealloc_cmap(&drvdata->info.cmap);
+
+failed3:
+	dma_free_coherent(dev, PAGE_ALIGN(FB_SIZE), drvdata->fb_virt,
+		drvdata->fb_phys);
+
+	/* Turn off the display */
+	out_be32(drvdata->regs + REG_CTRL, 0);
+	iounmap(drvdata->regs);
+
+failed2:
+	release_mem_region(regs_res->start, 8);
+
+failed1:
+	kfree(drvdata);
+	dev_set_drvdata(dev, NULL);
+
+	return retval;
+}
+
+static int
+xilinxfb_drv_remove(struct device *dev)
+{
+	struct xilinxfb_drvdata *drvdata;
+
+	if (!dev)
+		return -ENODEV;
+
+	drvdata = (struct xilinxfb_drvdata *) dev_get_drvdata(dev);
+
+#if !defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_LOGO)
+	xilinx_fb_blank(VESA_POWERDOWN, &drvdata->info);
+#endif
+
+	unregister_framebuffer(&drvdata->info);
+
+	fb_dealloc_cmap(&drvdata->info.cmap);
+
+	dma_free_coherent(dev, PAGE_ALIGN(FB_SIZE), drvdata->fb_virt,
+		drvdata->fb_phys);
+
+	/* Turn off the display */
+	out_be32(drvdata->regs + REG_CTRL, 0);
+	iounmap(drvdata->regs);
+
+	release_mem_region(drvdata->regs_phys, 8);
+
+	kfree(drvdata);
+	dev_set_drvdata(dev, NULL);
+
+	return 0;
+}
+
+
+static struct device_driver xilinxfb_driver = {
+	.name		= DRIVER_NAME,
+	.bus		= &platform_bus_type,
+
+	.probe		= xilinxfb_drv_probe,
+	.remove		= xilinxfb_drv_remove
+};
+
+static int __init
+xilinxfb_init(void)
+{
+	/*
+	 * No kernel boot options used,
+	 * so we just need to register the driver
+	 */
+	return driver_register(&xilinxfb_driver);
+}
+
+static void __exit
+xilinxfb_cleanup(void)
+{
+	driver_unregister(&xilinxfb_driver);
+}
+
+module_init(xilinxfb_init);
+module_exit(xilinxfb_cleanup);
+
+MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>");
+MODULE_DESCRIPTION(DRIVER_DESCRIPTION);
+MODULE_LICENSE("GPL");

^ permalink raw reply

* Re: Using Xilinx Framebuffer on ML405 and 2.6.20.4
From: Peter Mendham @ 2007-04-24 13:54 UTC (permalink / raw)
  To: Andrei Konovalov; +Cc: linuxppc-embedded
In-Reply-To: <462E0CF5.4060402@ru.mvista.com>

Andrei Konovalov wrote:
> Grant Likely wrote:
>> On 4/24/07, Peter Mendham <petermendham@computing.dundee.ac.uk> wrote:
>>> Dear all,
>>>
>>> I am wanting to use the Xilinx TFT controller from the ML403/5 
>>> reference
>>> project (probably from ML300 as well) under a 2.6.20.4 kernel.  I have
>>> Grant Likely's patchset applied in which there is a platform device
>>> entry for the framebuffer.  Does anyone know if there is mainline
>>> support for the Xilinx-style framebuffer?  If so, how do I enable 
>>> it?  I
>>> have included framebuffer support in my kernel build, but I assume I
>>> need a driver also? Any tips greatly appreciated.
>>
>> Heh, I've got a driver.  I just haven't published it yet.  Give me a 
>> few days...
>>
>> g.
>>
>
> We have one too :)
>
Do you have a patch that I can apply to a mainline kernel to include the 
driver?

Thanks,
-- Peter


-- 
------------------------------------------
Dr Peter Mendham
------------------------------------------
Space Systems Research Group
School of Computing, University of Dundee
Dundee, Scotland, DD1 1HN, UK
------------------------------------------
e: petermendham@computing.dundee.ac.uk
t: +44 (0)1382 386729
f: +44 (0)1382 388838
------------------------------------------


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.

^ permalink raw reply

* Re: 2.6 Kernel , Xilinx Virtex and PPC 405 On chip memory controllers ( DSOCM and ISOCM )
From: Grant Likely @ 2007-04-24 13:55 UTC (permalink / raw)
  To: Mohammad Sadegh Sadri; +Cc: Linux PPC Linux PPC
In-Reply-To: <BAY115-W4BC24E5FE6C3B6EB88C72B24A0@phx.gbl>

On 4/24/07, Mohammad Sadegh Sadri <mamsadegh@hotmail.com> wrote:
>
> suppose that in my base system I have included 8kbytes of memory for DS OCM and 8K for IS OCM,
> I have generated the proper xparameters.h and copied it into kernel
>
> Now I want to know if kernel will use this portion of memory during it's operation?
> Does this increase performance?

No, it won't use that memory as general purpose RAM.  You can make use
of it in device drivers (ie. for DMA space), but you'll need to write
the code to support it.

Cheers,
g.

-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: [PATCH] Xilinx framebuffer device driver
From: Peter Mendham @ 2007-04-24 14:41 UTC (permalink / raw)
  To: Andrei Konovalov; +Cc: Rick Moleres, linuxppc-embedded
In-Reply-To: <462E0D5C.1090105@ru.mvista.com>

Andrei Konovalov wrote:
> Add support for the video controller IP block included into Xilinx 
> ML300 and
> ML403 reference designs.
>
> Signed-off-by: Andrei Konovalov <akonovalov@ru.mvista.com>
> ---
>
> This patch relies on the "Patchset to establish sanity in Xilinx 
> Virtex support" by Gran Likely to have
> the frame buffer device registered on the platform bus. Without this 
> patchset one needs to fill in
> the struct platform_device and make sure platform_device_register() is 
> called elsewhere.
>
> Reviews and comments are welcome.
Thanks, that's great.  I've built it into my latest kernel and as soon 
as I can get the hardware to work I'll test it out.  Watch this space :)
-- Peter


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.

^ permalink raw reply

* RE: [PATCH 4/6] Consolidate of_get_parent
From: Loeliger Jon-LOELIGER @ 2007-04-24 14:42 UTC (permalink / raw)
  To: Stephen Rothwell, David S. Miller, paulus; +Cc: ppc-dev
In-Reply-To: <20070424224040.6f0fe143.sfr@canb.auug.org.au>


> This requires creating dummy of_node_{get,put} routines for sparc and
> sparc64.  It also adds a readlocal around the parent accesses.
>=20
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>

Perhaps a read lock?

jdl

^ 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