Re: [RFC] Modifying i2c-core to support alias driver names compatible with device trees

2007-11-07 Thread Jon Smirl
After contemplating the vast amounts of feedback I received on the
first version of this patch I reworked it to reduce it's impact. This
version can go in without changing any existing drivers in the kernel.

Currently i2c uses a driver_name/type pair to handle drivers which
support more than one device. This version leaves driver_name/type
alone and create a parallel, alternative naming scheme - aliases. When
the grand merge to remove legacy style i2c drivers happens, the
driver_name/type scheme can be removed and converted to use the alias
strings.

If we can get agreement on this patch, I'll post a new version of the
i2c-mpc.c rewrite patch.

Extend i2c-core to support lists of device tree compatible names when
matching drivers

From: Jon Smirl <[EMAIL PROTECTED]>


---

 arch/powerpc/sysdev/fsl_soc.c |   46 ++---
 drivers/i2c/i2c-core.c|   16 +-
 drivers/rtc/rtc-ds1307.c  |   14 
 drivers/rtc/rtc-ds1374.c  |1 +
 drivers/rtc/rtc-pcf8563.c |1 +
 drivers/rtc/rtc-rs5c372.c |   18 +---
 include/linux/i2c.h   |   13 +---
 7 files changed, 63 insertions(+), 46 deletions(-)


diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 3ace747..cb95a72 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -320,48 +320,12 @@ arch_initcall(gfar_of_init);

 #ifdef CONFIG_I2C_BOARDINFO
 #include 
-struct i2c_driver_device {
-   char*of_device;
-   char*i2c_driver;
-   char*i2c_type;
-};
-
-static struct i2c_driver_device i2c_devices[] __initdata = {
-   {"ricoh,rs5c372a", "rtc-rs5c372", "rs5c372a",},
-   {"ricoh,rs5c372b", "rtc-rs5c372", "rs5c372b",},
-   {"ricoh,rv5c386",  "rtc-rs5c372", "rv5c386",},
-   {"ricoh,rv5c387a", "rtc-rs5c372", "rv5c387a",},
-   {"dallas,ds1307",  "rtc-ds1307",  "ds1307",},
-   {"dallas,ds1337",  "rtc-ds1307",  "ds1337",},
-   {"dallas,ds1338",  "rtc-ds1307",  "ds1338",},
-   {"dallas,ds1339",  "rtc-ds1307",  "ds1339",},
-   {"dallas,ds1340",  "rtc-ds1307",  "ds1340",},
-   {"stm,m41t00", "rtc-ds1307",  "m41t00"},
-   {"dallas,ds1374",  "rtc-ds1374",  "rtc-ds1374",},
-};
-
-static int __init of_find_i2c_driver(struct device_node *node,
-struct i2c_board_info *info)
-{
-   int i;
-
-   for (i = 0; i < ARRAY_SIZE(i2c_devices); i++) {
-   if (!of_device_is_compatible(node, i2c_devices[i].of_device))
-   continue;
-   if (strlcpy(info->driver_name, i2c_devices[i].i2c_driver,
-   KOBJ_NAME_LEN) >= KOBJ_NAME_LEN ||
-   strlcpy(info->type, i2c_devices[i].i2c_type,
-   I2C_NAME_SIZE) >= I2C_NAME_SIZE)
-   return -ENOMEM;
-   return 0;
-   }
-   return -ENODEV;
-}

 static void __init of_register_i2c_devices(struct device_node *adap_node,
   int bus_num)
 {
struct device_node *node = NULL;
+   const char *compatible;

while ((node = of_get_next_child(adap_node, node))) {
struct i2c_board_info info = {};
@@ -378,9 +342,13 @@ static void __init of_register_i2c_devices(struct
device_node *adap_node,
if (info.irq == NO_IRQ)
info.irq = -1;

-   if (of_find_i2c_driver(node, &info) < 0)
+   compatible = of_get_property(node, "compatible", &len);
+   if (!compatible) {
+   printk(KERN_WARNING "i2c-mpc.c: invalid entry, missing 
compatible
attribute\n");
continue;
-
+   }
+   strncpy(info.name, compatible, sizeof(info.name));
+   
info.addr = *addr;

i2c_register_board_info(bus_num, &info, 1);
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 1a4e8dc..8b49860 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -51,6 +51,7 @@ static int i2c_device_match(struct device *dev,
struct device_driver *drv)
 {
struct i2c_client   *client = to_i2c_client(dev);
struct i2c_driver   *driver = to_i2c_driver(drv);
+   char const **alias;

/* make legacy i2c drivers bypass driver model probing entirely;
 * such drivers scan each i2c adapter/bus themselves.
@@ -61,7 +62,20 @@ static int i2c_device_match(struct device *dev,
struct device_driver *drv)
/* new style drivers use the same kind of driver matching policy
 * as platform devices or SPI:  compare device and driver IDs.
 */
-   return strcmp(client->driver_name, drv->name) == 0;
+   if (strcmp(client->driver_name, drv->name) == 0)
+   return true;
+   
+   /* Match against arrary of alias device tree names. When a match
+* is found change the refere

Re: Merge dtc

2007-11-07 Thread David Gibson
On Fri, Oct 19, 2007 at 08:42:49PM +0200, Sam Ravnborg wrote:
> Hi David.
> 
> > > Give me a day or two then I shall give it a try and see what I can
> > > do about it.  I will use the previsous posted URL as basis if you do
> > > not tell me otherwise.
> > 
> > Thank you.  The previous URL should be fine, I've made no changes
> > since then.
> 
> I decided to go for a kbuild specific version integrated
> in boot/Makefile.
> This is much more readable because this syntax is explicit.
> We do not favour 3 levels of variabls to avoid rewriting the same
> filename two times.

Well, yes, on consideration the substitutions in Makefile.dtc are a
bit over-involved.  Although I still find describing its dozen or so
lines as unreadable when set next to the intricate wonders of Kbuild a
little...  bemusing.

> I have tested the change only with a O=.. crosscompile build.
> 
> I have tested the patch with and without DTC_GENPARSER=1.
> It does not rebuild if not needed and is OK with -j10 builds.
> 
> Please consider this version in favour of your old version.

Ok.  I'll use this version in my next spin; except for adding one
dependency you missed, and removing one which should never have been
there (unneccessary #include, which I've already fixed in dtc
upstream).

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[1/4] Merge dtc and libfdt upstream source

2007-11-07 Thread David Gibson
This very large patch incorporates a copy of dtc (including libfdt)
into the kernel source, in arch/powerpc/boot/dtc-src.  This patch only
imports the upstream sources verbatim, later patches are needed to
actually link it into the kernel Makefiles and use the embedded code
during the kernel build.

Signed-off-by: David Gibson <[EMAIL PROTECTED]>

---
 arch/powerpc/boot/dtc-src/Makefile.dtc |   25 
 arch/powerpc/boot/dtc-src/checks.c |  460 
 arch/powerpc/boot/dtc-src/data.c   |  351 +++
 arch/powerpc/boot/dtc-src/dtc-lexer.l  |  341 +++
 arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped  | 2184 +
 arch/powerpc/boot/dtc-src/dtc-parser.tab.c_shipped | 1925 ++
 arch/powerpc/boot/dtc-src/dtc-parser.tab.h_shipped |  110 +
 arch/powerpc/boot/dtc-src/dtc-parser.y |  304 ++
 arch/powerpc/boot/dtc-src/dtc.c|  240 ++
 arch/powerpc/boot/dtc-src/dtc.h|  253 ++
 arch/powerpc/boot/dtc-src/flattree.c   |  959 +
 arch/powerpc/boot/dtc-src/fstree.c |   94 
 arch/powerpc/boot/dtc-src/libfdt/Makefile.libfdt   |   14 
 arch/powerpc/boot/dtc-src/libfdt/fdt.c |  156 +
 arch/powerpc/boot/dtc-src/libfdt/fdt.h |   60 
 arch/powerpc/boot/dtc-src/libfdt/fdt_ro.c  |  562 +
 arch/powerpc/boot/dtc-src/libfdt/fdt_rw.c  |  447 
 arch/powerpc/boot/dtc-src/libfdt/fdt_strerror.c|   96 
 arch/powerpc/boot/dtc-src/libfdt/fdt_sw.c  |  258 ++
 arch/powerpc/boot/dtc-src/libfdt/fdt_wip.c |  144 +
 arch/powerpc/boot/dtc-src/libfdt/libfdt.h  |  593 +
 arch/powerpc/boot/dtc-src/libfdt/libfdt_internal.h |   89 
 arch/powerpc/boot/dtc-src/livetree.c   |  350 +++
 arch/powerpc/boot/dtc-src/srcpos.c |  105 +
 arch/powerpc/boot/dtc-src/srcpos.h |   75 
 arch/powerpc/boot/dtc-src/treesource.c |  236 ++
 arch/powerpc/boot/dtc-src/version_gen.h|1 
 27 files changed, 10432 insertions(+)

Much too big for the list.  Full patch at
http://ozlabs.org/~dgibson/home/merge-dtc.patch

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 3/4] Use embedded libfdt in the bootwrapper

2007-11-07 Thread David Gibson
This patch incorporates libfdt (from the source embedded in an earlier
patch) into the wrapper.a library used by the bootwrapper.  This
includes adding a libfdt_env.h file, which the libfdt sources need in
order to integrate into the bootwrapper environment, and a
libfdt-wrapper.c which provides glue to connect the bootwrappers
abstract device tree callbacks to the libfdt functions.

In addition, this patch changes the various wrapper and platform files
to use libfdt functions instead of the older flatdevtree.c library.

Signed-off-by: David Gibson <[EMAIL PROTECTED]>

---
 arch/powerpc/boot/Makefile  |4 
 arch/powerpc/boot/bamboo.c  |2 
 arch/powerpc/boot/cuboot-52xx.c |2 
 arch/powerpc/boot/cuboot-83xx.c |2 
 arch/powerpc/boot/cuboot-85xx.c |2 
 arch/powerpc/boot/cuboot-8xx.c  |2 
 arch/powerpc/boot/cuboot-hpc2.c |2 
 arch/powerpc/boot/cuboot-pq2.c  |2 
 arch/powerpc/boot/cuboot-sequoia.c  |2 
 arch/powerpc/boot/ebony.c   |2 
 arch/powerpc/boot/ep88xc.c  |2 
 arch/powerpc/boot/holly.c   |2 
 arch/powerpc/boot/libfdt-wrapper.c  |  167 
 arch/powerpc/boot/libfdt_env.h  |   17 +++
 arch/powerpc/boot/ops.h |1 
 arch/powerpc/boot/prpmc2800.c   |3 
 arch/powerpc/boot/ps3.c |2 
 arch/powerpc/boot/treeboot-walnut.c |2 
 18 files changed, 202 insertions(+), 16 deletions(-)

Index: working-2.6/arch/powerpc/boot/Makefile
===
--- working-2.6.orig/arch/powerpc/boot/Makefile 2007-11-08 13:51:38.0 
+1100
+++ working-2.6/arch/powerpc/boot/Makefile  2007-11-08 13:54:41.0 
+1100
@@ -33,7 +33,7 @@ ifeq ($(call cc-option-yn, -fstack-prote
 BOOTCFLAGS += -fno-stack-protector
 endif
 
-BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj)
+BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj) -I$(src)/dtc-src/libfdt
 
 $(obj)/4xx.o: BOOTCFLAGS += -mcpu=440
 $(obj)/ebony.o: BOOTCFLAGS += -mcpu=440
@@ -46,7 +46,9 @@ zliblinuxheader := zlib.h zconf.h zutil.
 $(addprefix $(obj)/,$(zlib) gunzip_util.o main.o): \
$(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix 
$(obj)/,$(zlibheader))
 
+src-libfdt := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
 src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
+   $(addprefix dtc-src/libfdt/,$(src-libfdt)) libfdt-wrapper.c \
ns16550.c serial.c simple_alloc.c div64.S util.S \
gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \
4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \
Index: working-2.6/arch/powerpc/boot/libfdt_env.h
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ working-2.6/arch/powerpc/boot/libfdt_env.h  2007-11-08 13:54:41.0 
+1100
@@ -0,0 +1,17 @@
+#ifndef _ARCH_POWERPC_BOOT_LIBFDT_ENV_H
+#define _ARCH_POWERPC_BOOT_LIBFDT_ENV_H
+
+#include 
+#include 
+
+typedef u32 uint32_t;
+typedef u64 uint64_t;
+
+#define fdt16_to_cpu(x)(x)
+#define cpu_to_fdt16(x)(x)
+#define fdt32_to_cpu(x)(x)
+#define cpu_to_fdt32(x)(x)
+#define fdt64_to_cpu(x)(x)
+#define cpu_to_fdt64(x)(x)
+
+#endif /* _ARCH_POWERPC_BOOT_LIBFDT_ENV_H */
Index: working-2.6/arch/powerpc/boot/bamboo.c
===
--- working-2.6.orig/arch/powerpc/boot/bamboo.c 2007-11-08 13:45:19.0 
+1100
+++ working-2.6/arch/powerpc/boot/bamboo.c  2007-11-08 13:54:41.0 
+1100
@@ -42,6 +42,6 @@ void bamboo_init(void *mac0, void *mac1)
platform_ops.exit = ibm44x_dbcr_reset;
bamboo_mac0 = mac0;
bamboo_mac1 = mac1;
-   ft_init(_dtb_start, 0, 32);
+   fdt_init(_dtb_start);
serial_console_init();
 }
Index: working-2.6/arch/powerpc/boot/cuboot-52xx.c
===
--- working-2.6.orig/arch/powerpc/boot/cuboot-52xx.c2007-11-08 
13:45:19.0 +1100
+++ working-2.6/arch/powerpc/boot/cuboot-52xx.c 2007-11-08 13:54:41.0 
+1100
@@ -53,7 +53,7 @@ void platform_init(unsigned long r3, uns
unsigned long r6, unsigned long r7)
 {
CUBOOT_INIT();
-   ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
+   fdt_init(_dtb_start);
serial_console_init();
platform_ops.fixups = platform_fixups;
 }
Index: working-2.6/arch/powerpc/boot/cuboot-83xx.c
===
--- working-2.6.orig/arch/powerpc/boot/cuboot-83xx.c2007-11-08 
13:45:19.0 +1100
+++ working-2.6/arch/powerpc/boot/cuboot-83xx.c 2007-11-08 13:54:41.0 
+1100
@@ -52,7 +52,7 @@ void platform_init(unsigned long r3, uns

[PATCH 4/4] Kill flatdevtree.c

2007-11-07 Thread David Gibson
Now that earlier patches have switched the bootwrapper to using libfdt
for device tree manipulation, this patch removes the now unused
flatdevtree.c and related files.

Signed-off-by: David Gibson <[EMAIL PROTECTED]>

---
 arch/powerpc/boot/Makefile   |2 
 arch/powerpc/boot/flatdevtree.c  | 1036 ---
 arch/powerpc/boot/flatdevtree.h  |  113 ---
 arch/powerpc/boot/flatdevtree_misc.c |   79 --
 arch/powerpc/boot/main.c |1 
 arch/powerpc/boot/ops.h  |1 
 6 files changed, 1 insertion(+), 1231 deletions(-)

Index: working-2.6/arch/powerpc/boot/Makefile
===
--- working-2.6.orig/arch/powerpc/boot/Makefile 2007-11-05 13:32:17.0 
+1100
+++ working-2.6/arch/powerpc/boot/Makefile  2007-11-05 13:36:07.0 
+1100
@@ -47,7 +47,7 @@ $(addprefix $(obj)/,$(zlib) gunzip_util.
$(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix 
$(obj)/,$(zlibheader))
 
 src-libfdt := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
-src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
+src-wlib := string.S crt0.S stdio.c main.c \
$(addprefix dtc-src/libfdt/,$(src-libfdt)) libfdt-wrapper.c \
ns16550.c serial.c simple_alloc.c div64.S util.S \
gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \
Index: working-2.6/arch/powerpc/boot/flatdevtree.c
===
--- working-2.6.orig/arch/powerpc/boot/flatdevtree.c2007-10-22 
13:55:50.0 +1000
+++ /dev/null   1970-01-01 00:00:00.0 +
@@ -1,1036 +0,0 @@
-/*
- * 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, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- * Copyright Pantelis Antoniou 2006
- * Copyright (C) IBM Corporation 2006
- *
- * Authors: Pantelis Antoniou <[EMAIL PROTECTED]>
- * Hollis Blanchard <[EMAIL PROTECTED]>
- * Mark A. Greer <[EMAIL PROTECTED]>
- * Paul Mackerras <[EMAIL PROTECTED]>
- */
-
-#include 
-#include 
-#include "flatdevtree.h"
-#include "flatdevtree_env.h"
-
-#define _ALIGN(x, al)  (((x) + (al) - 1) & ~((al) - 1))
-
-static char *ft_root_node(struct ft_cxt *cxt)
-{
-   return cxt->rgn[FT_STRUCT].start;
-}
-
-/* Routines for keeping node ptrs returned by ft_find_device current */
-/* First entry not used b/c it would return 0 and be taken as NULL/error */
-static void *ft_get_phandle(struct ft_cxt *cxt, char *node)
-{
-   unsigned int i;
-
-   if (!node)
-   return NULL;
-
-   for (i = 1; i < cxt->nodes_used; i++)   /* already there? */
-   if (cxt->node_tbl[i] == node)
-   return (void *)i;
-
-   if (cxt->nodes_used < cxt->node_max) {
-   cxt->node_tbl[cxt->nodes_used] = node;
-   return (void *)cxt->nodes_used++;
-   }
-
-   return NULL;
-}
-
-static char *ft_node_ph2node(struct ft_cxt *cxt, const void *phandle)
-{
-   unsigned int i = (unsigned int)phandle;
-
-   if (i < cxt->nodes_used)
-   return cxt->node_tbl[i];
-   return NULL;
-}
-
-static void ft_node_update_before(struct ft_cxt *cxt, char *addr, int shift)
-{
-   unsigned int i;
-
-   if (shift == 0)
-   return;
-
-   for (i = 1; i < cxt->nodes_used; i++)
-   if (cxt->node_tbl[i] < addr)
-   cxt->node_tbl[i] += shift;
-}
-
-static void ft_node_update_after(struct ft_cxt *cxt, char *addr, int shift)
-{
-   unsigned int i;
-
-   if (shift == 0)
-   return;
-
-   for (i = 1; i < cxt->nodes_used; i++)
-   if (cxt->node_tbl[i] >= addr)
-   cxt->node_tbl[i] += shift;
-}
-
-/* Struct used to return info from ft_next() */
-struct ft_atom {
-   u32 tag;
-   const char *name;
-   void *data;
-   u32 size;
-};
-
-/* Set ptrs to current one's info; return addr of next one */
-static char *ft_next(struct ft_cxt *cxt, char *p, struct ft_atom *ret)
-{
-   u32 sz;
-
-   if (p >= cxt->rgn[FT_STRUCT].start + cxt->rgn[FT_STRUCT].size)
-   return NULL;
-
-   ret->tag = be32_to_cpu(*(u32 *) p);
-   p += 4;
-
-   switch (ret->tag) { /* Tag */
-   case OF_DT_BEGIN_NODE:
-   

[PATCH 2/4] Use embedded dtc in kernel builds

2007-11-07 Thread David Gibson
This patch alters the kernel makefiles to build dtc from the sources
embedded in the previous patch.  It also changes the
arch/powerpc/boot/wrapper script to use the embedded dtc, rather than
expecting a copy of dtc already installed on the system.

Signed-off-by: David Gibson <[EMAIL PROTECTED]>

---
 arch/powerpc/boot/Makefile |   41 ++---
 arch/powerpc/boot/wrapper  |2 +-
 2 files changed, 39 insertions(+), 4 deletions(-)

Index: working-2.6/arch/powerpc/boot/Makefile
===
--- working-2.6.orig/arch/powerpc/boot/Makefile 2007-11-08 13:45:57.0 
+1100
+++ working-2.6/arch/powerpc/boot/Makefile  2007-11-08 13:51:38.0 
+1100
@@ -108,17 +108,52 @@ $(patsubst %.S,%.o, $(filter %.S, $(src-
 $(obj)/wrapper.a: $(obj-wlib) FORCE
$(call if_changed,bootar)
 
-hostprogs-y:= addnote addRamDisk hack-coff mktree
+hostprogs-y:= addnote addRamDisk hack-coff mktree dtc
 
 targets+= $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a)
 extra-y:= $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
   $(obj)/zImage.lds $(obj)/zImage.coff.lds 
$(obj)/zImage.ps3.lds
 
 wrapper:=$(srctree)/$(src)/wrapper
-wrapperbits:= $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \
+wrapperbits:= $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree dtc) 
\
$(wrapper) FORCE
 
 #
+# Bits for building dtc
+# DTC_GENPARSER  := 1# Uncomment to rebuild flex/bison output
+
+dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o srcpos.o 
checks.o
+dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o
+dtc-objs := $(addprefix dtc-src/, $(dtc-objs))
+
+# prerequisites on generated files needs to be explicit
+$(obj)/dtc-src/dtc-parser.tab.o: $(obj)/dtc-src/dtc-parser.tab.c 
$(obj)/dtc-src/dtc-parser.tab.h
+$(obj)/dtc-src/dtc-lexer.lex.o:  $(obj)/dtc-src/dtc-lexer.lex.c 
$(obj)/dtc-src/dtc-parser.tab.h
+
+HOSTCFLAGS += -I$(src)/dtc-src/libfdt/
+
+targets += dtc-src/dtc-parser.tab.c
+targets += dtc-src/dtc-lexer.lex.c
+
+ifdef DTC_GENPARSER
+BISON = bison
+FLEX = flex
+
+quiet_cmd_bison = BISON   $@
+  cmd_bison = $(BISON) -o$@ -d $<; cp $@ [EMAIL PROTECTED]
+quiet_cmd_flex = FLEX$@
+  cmd_flex = $(FLEX) -o$@ $<; cp $@ [EMAIL PROTECTED]
+
+$(obj)/dtc-src/dtc-parser.tab.c: $(src)/dtc-src/dtc-parser.y FORCE
+ $(call if_changed,bison)
+
+$(obj)/dtc-src/dtc-parser.tab.h: $(obj)/dtc-src/dtc-parser.tab.c
+
+$(obj)/dtc-src/dtc-lexer.lex.c: $(src)/dtc-src/dtc-lexer.l FORCE
+ $(call if_changed,flex)
+endif
+
+#
 # Bits for building various flavours of zImage
 
 ifneq ($(CROSS32_COMPILE),)
@@ -236,7 +271,7 @@ install: $(CONFIGURE) $(addprefix $(obj)
 
 # anything not in $(targets)
 clean-files += $(image-) $(initrd-) zImage zImage.initrd cuImage.* treeImage.* 
\
-   otheros.bld
+   otheros.bld $(dtc-clean-files)
 
 # clean up files cached by wrapper
 clean-kernel := vmlinux.strip vmlinux.bin
Index: working-2.6/arch/powerpc/boot/wrapper
===
--- working-2.6.orig/arch/powerpc/boot/wrapper  2007-11-08 13:45:57.0 
+1100
+++ working-2.6/arch/powerpc/boot/wrapper   2007-11-08 13:46:21.0 
+1100
@@ -111,7 +111,7 @@ if [ -n "$dts" ]; then
 if [ -z "$dtb" ]; then
dtb="$platform.dtb"
 fi
-dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts" || exit 1
+$object/dtc -O dtb -o "$dtb" -b 0 "$dts" || exit 1
 fi
 
 if [ -z "$kernel" ]; then
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[0/4] Embed dtc and libfdt in the kernel

2007-11-07 Thread David Gibson
Here's the latest spin of my patch to embed and use dtc in the kernel
source, rather than relying on it as an external dependency.  In
addition, this adds patches to use the libfdt from the embedded copy
of dtc in the bootwrapper, in preference to the less flexible
flatdevtree.c library.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH (2.6.25) 1/2] hibernation: clean up Kconfig

2007-11-07 Thread Paul Mackerras
Johannes Berg writes:

> This cleans up the hibernation Kconfig and removes the need to
> declare centrally which architectures support hibernation. All
> architectures that currently support hibernation are modified
> accordingly.

Acked-by: Paul Mackerras <[EMAIL PROTECTED]>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH (2.6.25) 2/2] suspend: clean up Kconfig

2007-11-07 Thread Paul Mackerras
Johannes Berg writes:

> This cleans up the suspend Kconfig and removes the need to
> declare centrally which architectures support suspend. All
> architectures that currently support suspend are modified
> accordingly.

Acked-by: Paul Mackerras <[EMAIL PROTECTED]>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: mm snapshot broken-out-2007-11-06-02-32 build failure - !CONFIG_PPC_ISERIES

2007-11-07 Thread Tony Breeds
On Thu, Nov 08, 2007 at 02:27:07AM +0530, Kamalesh Babulal wrote:
> Hi Andrew,
> 
> The kernel build fails with randconfig, with following error
> 
>   CC  arch/powerpc/platforms/celleb/setup.o
> arch/powerpc/platforms/celleb/setup.c:151: error: ‘generic_calibrate_decr’ 
> undeclared here (not in a function)
> make[2]: *** [arch/powerpc/platforms/celleb/setup.o] Error 1
> make[1]: *** [arch/powerpc/platforms/celleb] Error 2
> make: *** [arch/powerpc/platforms] Error 2


I think you need this patch:
http://patchwork.ozlabs.org/linuxppc/patch?q=Tony%20Breeds&id=14462

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

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

Re: [RFC] Modifying i2c-core to support alias driver names compatible with device trees

2007-11-07 Thread Jon Smirl
On 11/7/07, Stephen Rothwell <[EMAIL PROTECTED]> wrote:
> On Tue, 6 Nov 2007 15:39:42 -0500 "Jon Smirl" <[EMAIL PROTECTED]> wrote:
> >
> > It was requested to split this code out into a separate thread
> >
> > This code modifies the i2c-core to support lists of alias names in the
> > chip drivers.
> > For example: .aliases = (char const
> > *[]){"ricoh,rs5c372a","ricoh,rs5c372b","ricoh,rv5c386","ricoh,rv5c387a",
> > 0},
>
> You should not need the (char const *[]) casts at all.

That is what I thought but the compiler complains without it. I tried
everything I could think of to get rid of it.

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


[PATCH 3/3] powerpc: mv64x60 - Aesthetic fixups for bootwrapper code

2007-11-07 Thread Mark A. Greer
From: Mark A. Greer <[EMAIL PROTECTED]>

Specify locations when initializing arrays.  This has already been done
for one array so may as well do it for them all.

Signed-off-by: Mark A. Greer <[EMAIL PROTECTED]>

---
I don't know if this one is worth the bother (it is a little anal)
but it keeps things consistent.  I'm happy with or without it.

 arch/powerpc/boot/mv64x60.c |   72 +-
 1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/arch/powerpc/boot/mv64x60.c b/arch/powerpc/boot/mv64x60.c
index c3f..d207a0b 100644
--- a/arch/powerpc/boot/mv64x60.c
+++ b/arch/powerpc/boot/mv64x60.c
@@ -174,11 +174,11 @@ struct {
u32 addr;
u32 data;
 } static mv64x60_pci_cfgio[2] = {
-   { /* hose 0 */
+   [0] = { /* hose 0 */
.addr   = 0xcf8,
.data   = 0xcfc,
},
-   { /* hose 1 */
+   [1] = { /* hose 1 */
.addr   = 0xc78,
.data   = 0xc7c,
}
@@ -201,76 +201,76 @@ void mv64x60_cfg_write(u8 *bridge_base, u8 hose, u8 bus, 
u8 devfn, u8 offset,
 
 /* I/O ctlr -> system memory setup */
 static struct mv64x60_mem_win mv64x60_cpu2mem[MV64x60_CPU2MEM_WINDOWS] = {
-   {
+   [0] = {
.lo = MV64x60_CPU2MEM_0_BASE,
.size   = MV64x60_CPU2MEM_0_SIZE,
},
-   {
+   [1] = {
.lo = MV64x60_CPU2MEM_1_BASE,
.size   = MV64x60_CPU2MEM_1_SIZE,
},
-   {
+   [2] = {
.lo = MV64x60_CPU2MEM_2_BASE,
.size   = MV64x60_CPU2MEM_2_SIZE,
},
-   {
+   [3] = {
.lo = MV64x60_CPU2MEM_3_BASE,
.size   = MV64x60_CPU2MEM_3_SIZE,
},
 };
 
 static struct mv64x60_mem_win mv64x60_enet2mem[MV64x60_CPU2MEM_WINDOWS] = {
-   {
+   [0] = {
.lo = MV64x60_ENET2MEM_0_BASE,
.size   = MV64x60_ENET2MEM_0_SIZE,
},
-   {
+   [1] = {
.lo = MV64x60_ENET2MEM_1_BASE,
.size   = MV64x60_ENET2MEM_1_SIZE,
},
-   {
+   [2] = {
.lo = MV64x60_ENET2MEM_2_BASE,
.size   = MV64x60_ENET2MEM_2_SIZE,
},
-   {
+   [3] = {
.lo = MV64x60_ENET2MEM_3_BASE,
.size   = MV64x60_ENET2MEM_3_SIZE,
},
 };
 
 static struct mv64x60_mem_win mv64x60_mpsc2mem[MV64x60_CPU2MEM_WINDOWS] = {
-   {
+   [0] = {
.lo = MV64x60_MPSC2MEM_0_BASE,
.size   = MV64x60_MPSC2MEM_0_SIZE,
},
-   {
+   [1] = {
.lo = MV64x60_MPSC2MEM_1_BASE,
.size   = MV64x60_MPSC2MEM_1_SIZE,
},
-   {
+   [2] = {
.lo = MV64x60_MPSC2MEM_2_BASE,
.size   = MV64x60_MPSC2MEM_2_SIZE,
},
-   {
+   [3] = {
.lo = MV64x60_MPSC2MEM_3_BASE,
.size   = MV64x60_MPSC2MEM_3_SIZE,
},
 };
 
 static struct mv64x60_mem_win mv64x60_idma2mem[MV64x60_CPU2MEM_WINDOWS] = {
-   {
+   [0] = {
.lo = MV64x60_IDMA2MEM_0_BASE,
.size   = MV64x60_IDMA2MEM_0_SIZE,
},
-   {
+   [1] = {
.lo = MV64x60_IDMA2MEM_1_BASE,
.size   = MV64x60_IDMA2MEM_1_SIZE,
},
-   {
+   [2] = {
.lo = MV64x60_IDMA2MEM_2_BASE,
.size   = MV64x60_IDMA2MEM_2_SIZE,
},
-   {
+   [3] = {
.lo = MV64x60_IDMA2MEM_3_BASE,
.size   = MV64x60_IDMA2MEM_3_SIZE,
},
@@ -338,7 +338,7 @@ void mv64x60_config_ctlr_windows(u8 *bridge_base, u8 
*bridge_pbase,
 
 /* PCI MEM -> system memory, et. al. setup */
 static struct mv64x60_pci_win mv64x60_pci2mem[2][MV64x60_CPU2MEM_WINDOWS] = {
-   { /* hose 0 */
+   [0] = { /* hose 0 */
[0] = {
.fcn= 0,
.hi = 0x14,
@@ -364,7 +364,7 @@ static struct mv64x60_pci_win 
mv64x60_pci2mem[2][MV64x60_CPU2MEM_WINDOWS] = {
.size   = MV64x60_PCI02MEM_3_SIZE,
},
},
-   { /* hose 1 */
+   [1] = { /* hose 1 */
[0] = {
.fcn= 0,
.hi = 0x94,
@@ -394,45 +394,45 @@ static struct mv64x60_pci_win 
mv64x60_pci2mem[2][MV64x60_CPU2MEM_WINDOWS] = {
 
 static struct
 mv64x60_mem_win mv64x60_pci_acc[2][MV64x60_PCI_ACC_CNTL_WINDOWS] = {
-   { /* hose 0 */
-   {
+   [0] = { /* hose 0 */
+   [0] = {
.hi = MV64x60_PCI0_ACC_CNTL_0_BASE_HI,
.lo = MV64x60_PCI0_ACC_CNTL_0_BASE_LO,
.size   = MV64x60_PCI0_ACC_CNTL_0_SIZE,
},
-   {
+   [1] = {
.hi = MV64x60_PCI0_ACC_CNTL_1_BASE_HI

[PATCH 2/3] powerpc: prpmc2800 - Use new mv64x60_config_pci_windows() interface

2007-11-07 Thread Mark A. Greer
From: Mark A. Greer <[EMAIL PROTECTED]>

Make the prpmc2800 bootwrapper code use the new interface to
mv64x60_config_pci_windows().  With that change, some minor code
rearrangement is possible to make things neater.

Signed-off-by: Mark A. Greer <[EMAIL PROTECTED]>

---
 arch/powerpc/boot/prpmc2800.c |   20 +---
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/arch/powerpc/boot/prpmc2800.c b/arch/powerpc/boot/prpmc2800.c
index 9614e1d..d72400d 100644
--- a/arch/powerpc/boot/prpmc2800.c
+++ b/arch/powerpc/boot/prpmc2800.c
@@ -315,7 +315,7 @@ static struct prpmc2800_board_info *prpmc2800_get_bip(void)
return bip;
 }
 
-static void prpmc2800_bridge_setup(u32 mem_size)
+static void prpmc2800_bridge_setup(void)
 {
u32 i, v[12], enables, acc_bits;
u32 pci_base_hi, pci_base_lo, size, buf[2];
@@ -340,8 +340,7 @@ static void prpmc2800_bridge_setup(u32 mem_size)
| MV64x60_PCI_ACC_CNTL_RDSIZE_256_BYTES;
 
mv64x60_config_ctlr_windows(bridge_base, bridge_pbase, is_coherent);
-   mv64x60_config_pci_windows(bridge_base, bridge_pbase, 0, 0, mem_size,
-   acc_bits);
+   mv64x60_config_pci_windows(bridge_base, bridge_pbase, 0, 0, acc_bits);
 
/* Get the cpu -> pci i/o & mem mappings from the device tree */
devp = finddevice("/mv64x60/[EMAIL PROTECTED]");
@@ -397,20 +396,19 @@ static void prpmc2800_bridge_setup(u32 mem_size)
 
 static void prpmc2800_fixups(void)
 {
-   u32 v[2], l, mem_size;
+   u32 v[2], l;
int rc;
void *devp;
char model[BOARD_MODEL_MAX];
struct prpmc2800_board_info *bip;
 
-   bip = prpmc2800_get_bip(); /* Get board info based on VPD */
-
-   mem_size = (bip) ? bip->mem_size : mv64x60_get_mem_size(bridge_base);
-   prpmc2800_bridge_setup(mem_size); /* Do necessary bridge setup */
+   prpmc2800_bridge_setup(); /* Do necessary bridge setup */
 
-   /* If the VPD doesn't match what we know about, just use the
+   /*
+* If the VPD doesn't match what we know about, just use the
 * defaults already in the device tree.
 */
+   bip = prpmc2800_get_bip(); /* Get board info based on VPD */
if (!bip)
return;
 
@@ -439,8 +437,8 @@ static void prpmc2800_fixups(void)
devp = finddevice("/memory");
if (devp == NULL)
fatal("Error: Missing /memory device tree node\n\r");
-   v[0] = 0;
-   v[1] = bip->mem_size;
+   v[0] = 0; /* Take min of DT's mem size and what mem ctlr is setup for */
+   v[1] = min(mv64x60_get_mem_size(bridge_base), bip->mem_size);
setprop(devp, "reg", v, sizeof(v));
 
/* Update /mv64x60/model, if this is a mv64362 */
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 1/3] powerpc: mv64x60 - Fix PCI MEM->System Mem window setup

2007-11-07 Thread Mark A. Greer
From: Mark A. Greer <[EMAIL PROTECTED]>

The Marvell mv64x60 line of host bridges just don't like
PCI MEM->System Memory windows setups that don't match
the CPU->System Memory window setups.  For example, if there
is 1GB of System Memory and 2 CPU->System Memory windows set up
for 512MB each, then there had better be 2 PCI->System Memory
windows set up for 512MB each as well.

This restriction was documented in early versions of the bridge
but isn't supposed to apply to recent versions.  It seems as though
it still applies to recent versions as well.

mv64x60_config_pci_windows() is now changed to make the windows match
as described above.

Signed-off-by: Mark A. Greer <[EMAIL PROTECTED]>

---
 arch/powerpc/boot/mv64x60.c |  133 --
 arch/powerpc/boot/mv64x60.h |2 
 2 files changed, 96 insertions(+), 39 deletions(-)

diff --git a/arch/powerpc/boot/mv64x60.c b/arch/powerpc/boot/mv64x60.c
index b432594..c3f 100644
--- a/arch/powerpc/boot/mv64x60.c
+++ b/arch/powerpc/boot/mv64x60.c
@@ -92,6 +92,9 @@
 
 #define MV64x60_PCI0_BAR_ENABLE0x0c3c
 #define MV64x60_PCI02MEM_0_SIZE0x0c08
+#define MV64x60_PCI02MEM_1_SIZE0x0d08
+#define MV64x60_PCI02MEM_2_SIZE0x0c0c
+#define MV64x60_PCI02MEM_3_SIZE0x0d0c
 #define MV64x60_PCI0_ACC_CNTL_0_BASE_LO0x1e00
 #define MV64x60_PCI0_ACC_CNTL_0_BASE_HI0x1e04
 #define MV64x60_PCI0_ACC_CNTL_0_SIZE   0x1e08
@@ -113,6 +116,9 @@
 
 #define MV64x60_PCI1_BAR_ENABLE0x0cbc
 #define MV64x60_PCI12MEM_0_SIZE0x0c88
+#define MV64x60_PCI12MEM_1_SIZE0x0d88
+#define MV64x60_PCI12MEM_2_SIZE0x0c8c
+#define MV64x60_PCI12MEM_3_SIZE0x0d8c
 #define MV64x60_PCI1_ACC_CNTL_0_BASE_LO0x1e80
 #define MV64x60_PCI1_ACC_CNTL_0_BASE_HI0x1e84
 #define MV64x60_PCI1_ACC_CNTL_0_SIZE   0x1e88
@@ -331,18 +337,58 @@ void mv64x60_config_ctlr_windows(u8 *bridge_base, u8 
*bridge_pbase,
 }
 
 /* PCI MEM -> system memory, et. al. setup */
-static struct mv64x60_pci_win mv64x60_pci2mem[2] = {
+static struct mv64x60_pci_win mv64x60_pci2mem[2][MV64x60_CPU2MEM_WINDOWS] = {
{ /* hose 0 */
-   .fcn= 0,
-   .hi = 0x14,
-   .lo = 0x10,
-   .size   = MV64x60_PCI02MEM_0_SIZE,
+   [0] = {
+   .fcn= 0,
+   .hi = 0x14,
+   .lo = 0x10,
+   .size   = MV64x60_PCI02MEM_0_SIZE,
+   },
+   [1] = {
+   .fcn= 0,
+   .hi = 0x1c,
+   .lo = 0x18,
+   .size   = MV64x60_PCI02MEM_1_SIZE,
+   },
+   [2] = {
+   .fcn= 1,
+   .hi = 0x14,
+   .lo = 0x10,
+   .size   = MV64x60_PCI02MEM_2_SIZE,
+   },
+   [3] = {
+   .fcn= 1,
+   .hi = 0x1c,
+   .lo = 0x18,
+   .size   = MV64x60_PCI02MEM_3_SIZE,
+   },
},
{ /* hose 1 */
-   .fcn= 0,
-   .hi = 0x94,
-   .lo = 0x90,
-   .size   = MV64x60_PCI12MEM_0_SIZE,
+   [0] = {
+   .fcn= 0,
+   .hi = 0x94,
+   .lo = 0x90,
+   .size   = MV64x60_PCI12MEM_0_SIZE,
+   },
+   [1] = {
+   .fcn= 0,
+   .hi = 0x9c,
+   .lo = 0x98,
+   .size   = MV64x60_PCI12MEM_1_SIZE,
+   },
+   [2] = {
+   .fcn= 1,
+   .hi = 0x94,
+   .lo = 0x90,
+   .size   = MV64x60_PCI12MEM_2_SIZE,
+   },
+   [3] = {
+   .fcn= 1,
+   .hi = 0x9c,
+   .lo = 0x98,
+   .size   = MV64x60_PCI12MEM_3_SIZE,
+   },
},
 };
 
@@ -394,70 +440,81 @@ mv64x60_mem_win 
mv64x60_pci_acc[2][MV64x60_PCI_ACC_CNTL_WINDOWS] = {
},
 };
 
-static struct mv64x60_mem_win mv64x60_pci2reg[2] = {
-   {
+static struct mv64x60_pci_win mv64x60_pci2reg[2] = {
+   { /* hose 0 */
+   .fcn= 0,
.hi = 0x24,
.lo = 0x20,
.size   = 0,
},
-   {
+   { /* hose 1 */
+   .fcn= 0,
.hi = 0xa4,
.lo = 0xa0,
.size   = 0,

Re: [RFC] Modifying i2c-core to support alias driver names compatible with device trees

2007-11-07 Thread Stephen Rothwell
On Tue, 6 Nov 2007 15:39:42 -0500 "Jon Smirl" <[EMAIL PROTECTED]> wrote:
>
> It was requested to split this code out into a separate thread
> 
> This code modifies the i2c-core to support lists of alias names in the
> chip drivers.
> For example: .aliases = (char const
> *[]){"ricoh,rs5c372a","ricoh,rs5c372b","ricoh,rv5c386","ricoh,rv5c387a",
> 0},

You should not need the (char const *[]) casts at all.

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


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

Re: mpc5200, sysctl table check failed

2007-11-07 Thread Jon Smirl
I think whatever is broken in my FEC code is exposing a different bug
in some timeout code that is not normally run. Something to do with
the swap thread being unable to get to the swap device maybe?

Can anyone tell me where this Oops is coming from? It is the same oops
as the previous one, but the stacks are different.

I am getting it after a random number of retries of:
nfs: server 192.168.1.4 not responding, still trying
nfs: server 192.168.1.4 not responding, still trying
nfs: server 192.168.1.4 not responding, still trying
nfs: server 192.168.1.4 not responding, still trying
nfs: server 192.168.1.4 not responding, still trying
nfs: server 192.168.1.4 not responding, still trying

Using current git head.

Unable to handle kernel paging request for data at address 0x001b
Faulting instruction address: 0xc0027288
Oops: Kernel access of bad area, sig: 11 [#1]
pcm030
Modules linked in:
NIP: c0027288 LR: c0027284 CTR: c00274c4
REGS: c031bd80 TRAP: 0300   Not tainted  (2.6.24-rc2-efika-g34082a7d-dirty)
MSR: 1032   CR: 2828  XER: 
DAR: 001b, DSISR: 2000
TASK = c02fa570[0] 'swapper' THREAD: c031a000
GPR00: 03ff c031be30 c02fa570 c032e9a8 001b 0001 c032 c032
GPR08: c02febd8 c032e9a8 4000  248e3746 ffef 03ffe000 
GPR16: 0001  007ffc00   03ff8838  0004
GPR24:   c032341c c032 c031a000 0001 c032e9a0 001b
NIP [c0027288] cascade+0x74/0x9c
LR [c0027284] cascade+0x70/0x9c
Call Trace:
[c031be30] [c0018c94] __update_rq_clock+0x20/0x124 (unreliable)
[c031be60] [c002753c] run_timer_softirq+0x78/0x1b4
[c031be90] [c00234cc] __do_softirq+0x64/0xd4
[c031beb0] [c0006144] do_softirq+0x40/0x58
[c031bec0] [c0023378] irq_exit+0x38/0x48
[c031bed0] [c000d178] timer_interrupt+0x164/0x180
[c031bee0] [c000fe64] ret_from_except+0x0/0x14
--- Exception: 901 at cpu_idle+0x88/0xd0
LR = cpu_idle+0x88/0xd0
[c031bfa0] [c0009038] cpu_idle+0xcc/0xd0 (unreliable)
[c031bfb0] [c024aa30] rest_init+0x50/0x60
[c031bfc0] [c02d19c4] start_kernel+0x298/0x2ac
[c031bff0] [3438] 0x3438
Instruction dump:
80810008 83e4 482c 80040014 543c 7c00f278 3160 7d2b0110
0f09 7fc3f378 4bfffecd 7fe4fb78 <83ff> 38010008 7f84 409effd0
Kernel panic - not syncing: Fatal exception in interrupt
Rebooting in 180 seconds..


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


Re[2]: [PATCH] [PPC 44x] L2-cache synchronization for ppc44x

2007-11-07 Thread Yuri Tikhonov

 Hi Ben,


On 08.11.2007, 2:19:33 you wrote:
> On Thu, 2007-11-08 at 02:12 +0300, Yuri Tikhonov wrote:
>> This is the updated patch for support synchronization of L2-Cache with
>> the external memory on the ppc44x-based platforms.
>> 
>>  Differencies against the previous patch-set:
>> - remove L2_CACHE config option;
>> - introduce the ppc machdep to invalidate L2 cache lines;
>> - some code clean-up.

> Can you tell me more about how this cache operates ? I don't quite
> understand why you would invalidate it on bidirectional DMAs rather than
> flush it to memory (unless you get your terminology wrong) and why you
> wouldn't flush it on transfers to the device.. Unless it is a
> write-through cache ?

 Yes, the ppc44x Level2 cache has the write-through design, so no need to do 
any kind of l2_flush.

 As far as the DMA_BIDIRECTIONAL case is concerned flush_dcache_range() flushes 
the data over the following path: L1->L2->RAM, but invalidates L1 only, and  L2 
remains invalid. Since in the BIDIRECTIONAL case DMA may update the data in RAM 
- we have to invalidate L2-cache manually, so that CPU may read new data 
transmitted by DMA right from RAM rather than old ones stuck in L2 due to 
flush_dcache().


Regards,
 Yuri 

-- 
Yuri Tikhonov, Senior Software Engineer
Emcraft Systems, www.emcraft.com

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


Re: [PATCH] DTC: Polish up the DTS Version 1 implementation.

2007-11-07 Thread David Gibson
On Wed, Nov 07, 2007 at 08:14:29AM -0600, Jon Loeliger wrote:
> So, like, the other day David Gibson mumbled:
> > On Tue, Nov 06, 2007 at 04:19:19PM -0600, Jon Loeliger wrote:
> > > From: Jon Loeliger <[EMAIL PROTECTED]>
> > > 
> > > Fixes BYTESTRING lexing.
> > > Allows -O dts output to be emitted in a given (1) format version.
> > 
> > Ok... I'd actually be more inclined to remove the option and just have
> > -Odts *always* use the newer version.
> 
> You didn't read the code. :-)  That's what it does!
> There is no option, it is just parameterized in the code.
> It _always_ forward re-writes as the latest version.

Yes, I know, but I don't think it's even worth having the unused
internal parameterization.

> > Having dtc be able to convert dts versions forward is easy and
> > useful.
> 
> Oh, I see.  Thank you.
> 
> > > This patch is directly on top of your prior two patches.
> > > Lemme know what you think.
> > 
> > On top of my two dts-v1 patches that is, I assume?
> 
> Right.
> 
> > Ow... that's rather embarrassing, that I didn't even notice I'd
> > totally broken bytestrings.  Really must add some bytestrings to
> > test_tree1.dts so this actually gets checked by the testsuite.
> 
> I ran my "old versus new DTC" comparison script and found it. :-)

Heh, we should fold that into the testsuite, too.

> > Not really related changes, but whatever..
> 
> Uh, yeah.  Leftoverish.  Sorry.
> 
> 
> > > +/*
> > > + * bits is unused, but it should be 32 or 64 as needed.
> > > + *
> > > + * FIXME: However, with bits == 64, ((1ULL << bits) - 1)
> > > + * overflows before you can actually do the range test.
> > > + */
> > >  unsigned long long eval_literal(const char *s, int base, int bits)
> > >  {
> > >   unsigned long long val;
> > > @@ -317,9 +323,10 @@ unsigned long long eval_literal(const char *s, int 
> > > base, int bits)
> > >   val = strtoull(s, &e, base);
> > >   if (*e)
> > >   yyerror("bad characters in literal");
> > > - else if ((errno == ERANGE) || (val > ((1ULL << bits)-1)))
> > > + else if (errno == ERANGE)
> > >   yyerror("literal out of range");
> > >   else if (errno != 0)
> > >   yyerror("bad literal");
> > > +
> > 
> > Ok.. I don't understand why you've pulled out the range checking
> > against bits here.
> 
> Because it wasn't working, as explained in the comment I added.
> Specifically, (1< the value 0.

Ah...

Well, I assumed (1ULL << 64) would equal 0, which is why the
comparison has the (-1) - I was expecting for bits == 64 it would end
up being against -1, i.e. 0x.  This appears to work on
the systems I've been using.

But I just remembered that (x << n) has undefined behaviour in C when
n >= word size.  So I guess (1 << 64) is just returning garbage - I
suspect I didn't catch it because I've been building with -O0 for
gdb-ability, which might change the behaviour of corner cases like
that.

So I guess we need
else if ((errno == ERANGE)
 || ((bits < 64) && (val >= (1ULL << bits

[snip]
> > > -static void write_propval_bytes(FILE *f, struct data val)
> > > +static void write_propval_bytes(FILE *f, struct data val, int 
> > > dts_version)
> > >  {
> > >   void *propend = val.val + val.len;
> > >   char *bp = val.val;
> > >  
> > >   fprintf(f, " = [");
> > >   for (;;) {
> > > - fprintf(f, "%02hhx", *bp++);
> > > + if (dts_version == 0) {
> > > + fprintf(f, "%02hhx", *bp++);
> > > + } else {
> > > + fprintf(f, "0x%02hhx", *bp++);
> > > + }
> > 
> > Uh.. not quite right.  My patch (intentionally) leaves bytestrings as
> > pure hex, without 0x.
> 
> Ugh.  That seems inconsistent and wrong to me.

Well... depends on how you think about it.  If you think of [] as a
list of really small integers, then it's inconsistent.  But, if you
think of [] as a way of doing really long hex literals..

> > We can argue about whether that's a good idea,
> > if you like,
> 
> And in the blue corner, touting consistent hex forms, ...

And in the red, compact bytestring representations.

No, seriously, the inconsistency bothers me too.  But so does the fact
that using 0x in the bytestring would double the minimum size for
representing bytestrings, somewhat changing the flavour of [] as well
(because spaces are no longer optional).  I'm looking for a killer
argument one way or the other, but I haven't found it yet.

> > but in any case input and output should match.
> 
> Oops.  That they should.
> 
> > To avoid this sort of problem, I suggest before we apply the dts-v1
> > transition, we apply the patch I'm working on (I'll try to get it out
> > today), which adds a bunch of extra testcases checking that using dtc
> > to go dtb->dts->dtb preserves everything.
> 
> Yeah, I've been doing that too...  Sounds good.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
 

Re: [PATCH] [PPC 44x] L2-cache synchronization for ppc44x

2007-11-07 Thread Benjamin Herrenschmidt

On Thu, 2007-11-08 at 02:12 +0300, Yuri Tikhonov wrote:
> This is the updated patch for support synchronization of L2-Cache with the 
> external memory on the ppc44x-based platforms.
> 
>  Differencies against the previous patch-set:
> - remove L2_CACHE config option;
> - introduce the ppc machdep to invalidate L2 cache lines;
> - some code clean-up.

Can you tell me more about how this cache operates ? I don't quite
understand why you would invalidate it on bidirectional DMAs rather than
flush it to memory (unless you get your terminology wrong) and why you
wouldn't flush it on transfers to the device.. Unless it is a
write-through cache ?

Ben.

> Signed-off-by: Yuri Tikhonov <[EMAIL PROTECTED]>
> Signed-off-by: Pavel Kolesnikov <[EMAIL PROTECTED]>
> 
> --
> diff --git a/arch/powerpc/lib/dma-noncoherent.c 
> b/arch/powerpc/lib/dma-noncoherent.c
> index 1947380..b06f05c 100644
> --- a/arch/powerpc/lib/dma-noncoherent.c
> +++ b/arch/powerpc/lib/dma-noncoherent.c
> @@ -31,6 +31,7 @@
>  #include 
>  
>  #include 
> +#include 
>  
>  /*
>   * This address range defaults to a value that is safe for all
> @@ -186,6 +187,8 @@ __dma_alloc_coherent(size_t size, dma_addr_t *handle, 
> gfp_t gfp)
>   unsigned long kaddr = (unsigned long)page_address(page);
>   memset(page_address(page), 0, size);
>   flush_dcache_range(kaddr, kaddr + size);
> + if (ppc_md.l2cache_inv_range)
> + ppc_md.l2cache_inv_range(__pa(kaddr), __pa(kaddr + 
> size));
>   }
>  
>   /*
> @@ -351,12 +354,16 @@ void __dma_sync(void *vaddr, size_t size, int direction)
>   BUG();
>   case DMA_FROM_DEVICE:   /* invalidate only */
>   invalidate_dcache_range(start, end);
> + if (ppc_md.l2cache_inv_range)
> + ppc_md.l2cache_inv_range(__pa(start), __pa(end));
>   break;
>   case DMA_TO_DEVICE: /* writeback only */
>   clean_dcache_range(start, end);
>   break;
>   case DMA_BIDIRECTIONAL: /* writeback and invalidate */
>   flush_dcache_range(start, end);
> + if (ppc_md.l2cache_inv_range)
> + ppc_md.l2cache_inv_range(__pa(start), __pa(end));
>   break;
>   }
>  }
> diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
> index 46cf8fa..31c9149 100644
> --- a/arch/ppc/kernel/misc.S
> +++ b/arch/ppc/kernel/misc.S
> @@ -25,6 +25,10 @@
>  #include 
>  #include 
>  
> +#ifdef CONFIG_44x
> +#include 
> +#endif
> +
>  #ifdef CONFIG_8xx
>  #define ISYNC_8xx isync
>  #else
> @@ -386,6 +390,35 @@ END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
>   sync/* additional sync needed on g4 */
>   isync
>   blr
> +
> +#if defined(CONFIG_44x)
> +/*
> + * Invalidate the Level-2 cache lines corresponded to the address
> + * range.
> + *
> + * invalidate_l2cache_range(unsigned long start, unsigned long stop)
> + */
> +_GLOBAL(invalidate_l2cache_range)
> + li  r5,PPC44X_L2_CACHE_BYTES-1  /* align on L2-cache line */
> + andcr3,r3,r5
> + subfr4,r3,r4
> + add r4,r4,r5
> + srwi.   r4,r4,PPC44X_L2_CACHE_SHIFT
> + mtctr   r4
> +
> + lis r4, L2C_CMD_INV>>16
> +1:   mtdcr   DCRN_L2C0_ADDR,r3   /* write address to invalidate */
> + mtdcr   DCRN_L2C0_CMD,r4/* issue the Invalidate cmd */
> +
> +2:   mfdcr   r5,DCRN_L2C0_SR /* wait for complete */
> + andis.  r5,r5,L2C_CMD_CLR>>16
> + beq 2b
> +
> + addir3,r3,PPC44X_L2_CACHE_BYTES /* next address to invalidate */
> + bdnz1b
> + blr
> +#endif
> +
>  /*
>   * Write any modified data cache blocks out to memory.
>   * Does not invalidate the corresponding cache lines (especially for
> diff --git a/arch/ppc/syslib/ibm440gx_common.c 
> b/arch/ppc/syslib/ibm440gx_common.c
> index 6b1a801..64c663f 100644
> --- a/arch/ppc/syslib/ibm440gx_common.c
> +++ b/arch/ppc/syslib/ibm440gx_common.c
> @@ -12,6 +12,8 @@
>   */
>  #include 
>  #include 
> +#include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -201,6 +203,7 @@ void __init ibm440gx_l2c_enable(void){
>  
>   asm volatile ("sync; isync" ::: "memory");
>   local_irq_restore(flags);
> + ppc_md.l2cache_inv_range = invalidate_l2cache_range;
>  }
>  
>  /* Disable L2 cache */
> diff --git a/include/asm-powerpc/cacheflush.h 
> b/include/asm-powerpc/cacheflush.h
> index ba667a3..bdebfaa 100644
> --- a/include/asm-powerpc/cacheflush.h
> +++ b/include/asm-powerpc/cacheflush.h
> @@ -49,6 +49,7 @@ extern void flush_dcache_range(unsigned long start, 
> unsigned long stop);
>  #ifdef CONFIG_PPC32
>  extern void clean_dcache_range(unsigned long start, unsigned long stop);
>  extern void invalidate_dcache_range(unsigned long start, unsigned long stop);
> +extern void invalidate_l2cache_range(unsigned long start, unsigned long 
> stop);
>  #endif /* CONFIG_PPC32 */
>  #ifdef CONFIG_PPC64

[PATCH] [PPC 44x] L2-cache synchronization for ppc44x

2007-11-07 Thread Yuri Tikhonov

 This is the updated patch for support synchronization of L2-Cache with the 
external memory on the ppc44x-based platforms.

 Differencies against the previous patch-set:
- remove L2_CACHE config option;
- introduce the ppc machdep to invalidate L2 cache lines;
- some code clean-up.

Signed-off-by: Yuri Tikhonov <[EMAIL PROTECTED]>
Signed-off-by: Pavel Kolesnikov <[EMAIL PROTECTED]>

--
diff --git a/arch/powerpc/lib/dma-noncoherent.c 
b/arch/powerpc/lib/dma-noncoherent.c
index 1947380..b06f05c 100644
--- a/arch/powerpc/lib/dma-noncoherent.c
+++ b/arch/powerpc/lib/dma-noncoherent.c
@@ -31,6 +31,7 @@
 #include 
 
 #include 
+#include 
 
 /*
  * This address range defaults to a value that is safe for all
@@ -186,6 +187,8 @@ __dma_alloc_coherent(size_t size, dma_addr_t *handle, gfp_t 
gfp)
unsigned long kaddr = (unsigned long)page_address(page);
memset(page_address(page), 0, size);
flush_dcache_range(kaddr, kaddr + size);
+   if (ppc_md.l2cache_inv_range)
+   ppc_md.l2cache_inv_range(__pa(kaddr), __pa(kaddr + 
size));
}
 
/*
@@ -351,12 +354,16 @@ void __dma_sync(void *vaddr, size_t size, int direction)
BUG();
case DMA_FROM_DEVICE:   /* invalidate only */
invalidate_dcache_range(start, end);
+   if (ppc_md.l2cache_inv_range)
+   ppc_md.l2cache_inv_range(__pa(start), __pa(end));
break;
case DMA_TO_DEVICE: /* writeback only */
clean_dcache_range(start, end);
break;
case DMA_BIDIRECTIONAL: /* writeback and invalidate */
flush_dcache_range(start, end);
+   if (ppc_md.l2cache_inv_range)
+   ppc_md.l2cache_inv_range(__pa(start), __pa(end));
break;
}
 }
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index 46cf8fa..31c9149 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -25,6 +25,10 @@
 #include 
 #include 
 
+#ifdef CONFIG_44x
+#include 
+#endif
+
 #ifdef CONFIG_8xx
 #define ISYNC_8xx isync
 #else
@@ -386,6 +390,35 @@ END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
sync/* additional sync needed on g4 */
isync
blr
+
+#if defined(CONFIG_44x)
+/*
+ * Invalidate the Level-2 cache lines corresponded to the address
+ * range.
+ *
+ * invalidate_l2cache_range(unsigned long start, unsigned long stop)
+ */
+_GLOBAL(invalidate_l2cache_range)
+   li  r5,PPC44X_L2_CACHE_BYTES-1  /* align on L2-cache line */
+   andcr3,r3,r5
+   subfr4,r3,r4
+   add r4,r4,r5
+   srwi.   r4,r4,PPC44X_L2_CACHE_SHIFT
+   mtctr   r4
+
+   lis r4, L2C_CMD_INV>>16
+1: mtdcr   DCRN_L2C0_ADDR,r3   /* write address to invalidate */
+   mtdcr   DCRN_L2C0_CMD,r4/* issue the Invalidate cmd */
+
+2: mfdcr   r5,DCRN_L2C0_SR /* wait for complete */
+   andis.  r5,r5,L2C_CMD_CLR>>16
+   beq 2b
+
+   addir3,r3,PPC44X_L2_CACHE_BYTES /* next address to invalidate */
+   bdnz1b
+   blr
+#endif
+
 /*
  * Write any modified data cache blocks out to memory.
  * Does not invalidate the corresponding cache lines (especially for
diff --git a/arch/ppc/syslib/ibm440gx_common.c 
b/arch/ppc/syslib/ibm440gx_common.c
index 6b1a801..64c663f 100644
--- a/arch/ppc/syslib/ibm440gx_common.c
+++ b/arch/ppc/syslib/ibm440gx_common.c
@@ -12,6 +12,8 @@
  */
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -201,6 +203,7 @@ void __init ibm440gx_l2c_enable(void){
 
asm volatile ("sync; isync" ::: "memory");
local_irq_restore(flags);
+   ppc_md.l2cache_inv_range = invalidate_l2cache_range;
 }
 
 /* Disable L2 cache */
diff --git a/include/asm-powerpc/cacheflush.h b/include/asm-powerpc/cacheflush.h
index ba667a3..bdebfaa 100644
--- a/include/asm-powerpc/cacheflush.h
+++ b/include/asm-powerpc/cacheflush.h
@@ -49,6 +49,7 @@ extern void flush_dcache_range(unsigned long start, unsigned 
long stop);
 #ifdef CONFIG_PPC32
 extern void clean_dcache_range(unsigned long start, unsigned long stop);
 extern void invalidate_dcache_range(unsigned long start, unsigned long stop);
+extern void invalidate_l2cache_range(unsigned long start, unsigned long stop);
 #endif /* CONFIG_PPC32 */
 #ifdef CONFIG_PPC64
 extern void flush_inval_dcache_range(unsigned long start, unsigned long stop);
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h
index 71c6e7e..754f416 100644
--- a/include/asm-powerpc/machdep.h
+++ b/include/asm-powerpc/machdep.h
@@ -201,6 +201,8 @@ struct machdep_calls {
void(*early_serial_map)(void);
void(*kgdb_map_scc)(void);
 
+   void(*l2cache_inv_range)(unsigned long s, unsigned long e);
+
/*
 * optional PCI "hooks"
 */
diff --git a/i

Re[2]: [PATCH 2/2] [PPC 44x] enable L2-cache for ALPR, Katmai, Ocotea, and Taishan

2007-11-07 Thread Yuri Tikhonov

 Hi Olof,

On 07.11.2007, 7:06:08 you wrote:
...
>> +
>> +config L2_CACHE
>> +   bool "Enable Level-2 Cache"
>> +   depends on NOT_COHERENT_CACHE && (KATMAI || TAISHAN || OCOTEA || 
>> ALPR)
>> +   default y
>> +   help
>> + This option enables L2-cache on ppc44x controllers.
>> + If unsure, say Y.

> That's a very generic config name. Maybe something like PPC_4XX_L2_CACHE?

 Having the ppc_machdep for invalidating L2-cache lines we can avoid 
introducing the new configuration options at all. See below.

> Is there ever a case where a user would NOT want l2 cache enabled (and
> disabled permanently enough to rebuild the kernel instead of giving a
> kernel command line option?)

 Theoretically - yes. Internal SRAM of ppc44x may be used for something else 
than L2 cache. 

 Admittedly, the configuration option was necessary for me to enable or disable 
my L2-cache synchronization routine in the generic dma_sync() function. Per 
your suggestion, now, instead of introducing the new kernel option I initialize 
the L2-cache sync ppc_machdep right in the L2-cache enable routine: thus if the 
user will not enable L2-cache (will not want internal SRAM to act as L2-cache 
and will not call the L2-cache enabling routine) then my new ppc_machdep will 
remain set to zero and will not affect on SRAM used for some specific purposes.

...

>> @@ -567,7 +569,9 @@ void __init platform_init(unsigned long r3, unsigned 
>> long r4,
>>  #ifdef CONFIG_KGDB
>> ppc_md.early_serial_map = alpr_early_serial_map;
>>  #endif
>> +#ifdef CONFIG_L2_CACHE
>> ppc_md.init = alpr_init;
>> +#endif

> Why do you take out the above calls if the new option is selected? Seems
> odd to remove something that worked(?) before.

 Umm.. Quite the contrary, the option selected made these calls avaiable. 
Though it doesn't matter anymore since there is no CONFIG_L2_CACHE option 
anymore (i.e. all the four boards dealt with in this patch-set now have 
L2-cache enabled regardless of configuration, as it was initially).

>> ppc_md.restart = alpr_restart;
>>  }
>>  

...

>> +#ifdef CONFIG_L2_CACHE
>> +static void __init katmai_init(void)
>> +{
>> +   ibm440gx_l2c_setup(&clocks);
>> +}
>> +#endif
>> +
>>  void __init platform_init(unsigned long r3, unsigned long r4,
>>   unsigned long r5, unsigned long r6, unsigned long 
>> r7)
>>  {
>> @@ -599,4 +607,7 @@ void __init platform_init(unsigned long r3, unsigned 
>> long r4,
>> ppc_md.early_serial_map = katmai_early_serial_map;
>>  #endif
>> ppc_md.restart = katmai_restart;
>> +#ifdef CONFIG_L2_CACHE
>> +   ppc_md.init = katmai_init;
>> +#endif

> See comment above. Should the above init be called for all configs, not just
> when L2_CACHE is enabled?

> Also, it looks like the init function is the same on every board. It would
> be better to make a common function instead of duplicating it everywhere.

 Agree, but perhaps it's not the case for the ppc branch. Will do this in the 
powerpc branch as soon as support for these boards will be ported there.. by 
someone :)

Regards,
 Yuri 

-- 
Yuri Tikhonov, Senior Software Engineer
Emcraft Systems, www.emcraft.com

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


Re[2]: [PATCH 1/2] [PPC 4xx] invalidate_l2cache_range() implementation for ppc44x

2007-11-07 Thread Yuri Tikhonov

 Hi Olof,

 Thanks a lot for the feedbacks. Comments below.

On 07.11.2007, 7:04:28 you wrote:

> Hi,

> Some comments below. In general this patch adds #ifdefs in common code,
> that's normally frowned upon.
> It would maybe be better to add a new call to ppc_machdeps and call it
> if set.

 Agree; this looks better indeed. 

> On Wed, Nov 07, 2007 at 01:40:28AM +0300, Yuri Tikhonov wrote:

...

>> +
>>  /*
>>   * Write any modified data cache blocks out to memory.
>>   * Does not invalidate the corresponding cache lines (especially for
>> diff --git a/include/asm-powerpc/cache.h b/include/asm-powerpc/cache.h
>> index 5350704..8a2f9e6 100644
>> --- a/include/asm-powerpc/cache.h
>> +++ b/include/asm-powerpc/cache.h
>> @@ -10,12 +10,14 @@
>>  #define MAX_COPY_PREFETCH  1
>>  #elif defined(CONFIG_PPC32)
>>  #define L1_CACHE_SHIFT 5
>> +#define L2_CACHE_SHIFT 5
>>  #define MAX_COPY_PREFETCH  4
>>  #else /* CONFIG_PPC64 */
>>  #define L1_CACHE_SHIFT 7
>>  #endif
>>  
>>  #defineL1_CACHE_BYTES  (1 << L1_CACHE_SHIFT)
>> +#defineL2_CACHE_BYTES  (1 << L2_CACHE_SHIFT)

> The above looks highly system dependent to me. Should maybe be a part
> of the cache info structures instead, and filled in from the device tree?

 This is the Level-2 cache line parameter. I'll see what can be made here. For 
now I've just renamed these definitions and moved them into the PPC44x-specific 
header.


 Regards,
  Yuri 

-- 
Yuri Tikhonov, Senior Software Engineer
Emcraft Systems, www.emcraft.com

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


Re: [PATCH (2.6.25) 2/2] suspend: clean up Kconfig

2007-11-07 Thread Russell King
On Wed, Nov 07, 2007 at 02:58:00PM +0100, Johannes Berg wrote:
> This cleans up the suspend Kconfig and removes the need to
> declare centrally which architectures support suspend. All
> architectures that currently support suspend are modified
> accordingly.
> 
> Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>
> Cc: Rafael J. Wysocki <[EMAIL PROTECTED]>
> Cc: linuxppc-dev@ozlabs.org
> Cc: [EMAIL PROTECTED]
> Cc: Guennadi Liakhovetski <[EMAIL PROTECTED]>
> Cc: Scott Wood <[EMAIL PROTECTED]>
> Cc: David Howells <[EMAIL PROTECTED]>
> Cc: Ralf Baechle <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Cc: Paul Mundt <[EMAIL PROTECTED]>
> Cc: Bryan Wu <[EMAIL PROTECTED]>

Acked-by: Russell King <[EMAIL PROTECTED]>

> ---
> Architecture maintainers should evaluate whether their
> ARCH_SUSPEND_POSSIBLE symbol should be set only under
> stricter circumstances like I've done for powerpc.
> 
> Always setting it is not usually a problem, however, since the
> infrastructure is only available for use after suspend_set_ops().
> 
>  arch/arm/Kconfig  |3 +++
>  arch/blackfin/Kconfig |4 
>  arch/frv/Kconfig  |5 +
>  arch/i386/Kconfig |4 
>  arch/mips/Kconfig |4 
>  arch/powerpc/Kconfig  |4 
>  arch/sh/Kconfig   |4 
>  arch/x86_64/Kconfig   |3 +++
>  kernel/power/Kconfig  |   21 +++--
>  9 files changed, 34 insertions(+), 18 deletions(-)
> 
> --- everything.orig/arch/i386/Kconfig 2007-11-07 14:45:28.591544215 +0100
> +++ everything/arch/i386/Kconfig  2007-11-07 14:45:28.631515461 +0100
> @@ -1323,3 +1323,7 @@ config KTIME_SCALAR
>  config ARCH_HIBERNATION_POSSIBLE
>   def_bool y
>   depends on !SMP || !X86_VOYAGER
> +
> +config ARCH_SUSPEND_POSSIBLE
> + def_bool y
> + depends on !X86_VOYAGER
> --- everything.orig/arch/x86_64/Kconfig   2007-11-07 14:45:28.591544215 
> +0100
> +++ everything/arch/x86_64/Kconfig2007-11-07 14:45:28.631515461 +0100
> @@ -716,6 +716,9 @@ menu "Power management options"
>  
>  source kernel/power/Kconfig
>  
> +config ARCH_SUSPEND_POSSIBLE
> + def_bool y
> +
>  config ARCH_HIBERNATION_POSSIBLE
>   def_bool y
>  
> --- everything.orig/kernel/power/Kconfig  2007-11-07 14:45:28.591544215 
> +0100
> +++ everything/kernel/power/Kconfig   2007-11-07 14:45:28.641531465 +0100
> @@ -64,7 +64,7 @@ config PM_TRACE
>  config PM_SLEEP_SMP
>   bool
>   depends on SMP
> - depends on SUSPEND_SMP_POSSIBLE || ARCH_HIBERNATION_POSSIBLE
> + depends on ARCH_SUSPEND_POSSIBLE || ARCH_HIBERNATION_POSSIBLE
>   depends on PM_SLEEP
>   select HOTPLUG_CPU
>   default y
> @@ -74,29 +74,14 @@ config PM_SLEEP
>   depends on SUSPEND || HIBERNATION
>   default y
>  
> -config SUSPEND_UP_POSSIBLE
> - bool
> - depends on (X86 && !X86_VOYAGER) || PPC || ARM || BLACKFIN || MIPS \
> -|| SUPERH || FRV
> - depends on !SMP
> - default y
> -
> -config SUSPEND_SMP_POSSIBLE
> - bool
> - depends on (X86 && !X86_VOYAGER) \
> -|| (PPC && (PPC_PSERIES || PPC_PMAC)) || ARM
> - depends on SMP
> - default y
> -
>  config SUSPEND
>   bool "Suspend to RAM and standby"
> - depends on PM
> - depends on SUSPEND_UP_POSSIBLE || SUSPEND_SMP_POSSIBLE
> + depends on PM && ARCH_SUSPEND_POSSIBLE
>   default y
>   ---help---
> Allow the system to enter sleep states in which main memory is
> powered and thus its contents are preserved, such as the
> -   suspend-to-RAM state (i.e. the ACPI S3 state).
> +   suspend-to-RAM state (e.g. the ACPI S3 state).
>  
>  config HIBERNATION
>   bool "Hibernation (aka 'suspend to disk')"
> --- everything.orig/arch/blackfin/Kconfig 2007-11-07 14:44:55.551521971 
> +0100
> +++ everything/arch/blackfin/Kconfig  2007-11-07 14:45:28.641531465 +0100
> @@ -993,6 +993,10 @@ endmenu
>  menu "Power management options"
>  source "kernel/power/Kconfig"
>  
> +config ARCH_SUSPEND_POSSIBLE
> + def_bool y
> + depends on !SMP
> +
>  choice
>   prompt "Select PM Wakeup Event Source"
>   default PM_WAKEUP_GPIO_BY_SIC_IWR
> --- everything.orig/arch/arm/Kconfig  2007-11-07 14:44:55.651522948 +0100
> +++ everything/arch/arm/Kconfig   2007-11-07 14:45:28.641531465 +0100
> @@ -977,6 +977,9 @@ menu "Power management options"
>  
>  source "kernel/power/Kconfig"
>  
> +config ARCH_SUSPEND_POSSIBLE
> + def_bool y
> +
>  endmenu
>  
>  source "net/Kconfig"
> --- everything.orig/arch/mips/Kconfig 2007-11-07 14:44:55.701522460 +0100
> +++ everything/arch/mips/Kconfig  2007-11-07 14:45:28.641531465 +0100
> @@ -1999,6 +1999,10 @@ endmenu
>  
>  menu "Power management options"
>  
> +config ARCH_SUSPEND_POSSIBLE
> + def_bool y
> + depends on !SMP
> +
>  source "kernel/power/Kconfig"
>  
>  endmenu
> --- everything.orig/arch/sh/Kconfig   2007-11-07 14:44:55.801520344 +0100
> +++ everything/arch/sh/Kconfig2007-11-07 14:45:28.651528536 +

[PATCH] ioremap/iounmap issue in yucca_setup_pcie_fpga_rootpoint(); arch/ppc/platforms/4xx/yucca.c

2007-11-07 Thread Roel Kluin
iounmap pcie_reg_fpga_base in default case

Signed-off-by: Roel Kluin <[EMAIL PROTECTED]>
---
diff --git a/arch/ppc/platforms/4xx/yucca.c b/arch/ppc/platforms/4xx/yucca.c
index a83b0ba..66a44ff 100644
--- a/arch/ppc/platforms/4xx/yucca.c
+++ b/arch/ppc/platforms/4xx/yucca.c
@@ -211,6 +211,7 @@ static void __init yucca_setup_pcie_fpga_rootpoint(int port)
break;
 
default:
+   iounmap(pcie_reg_fpga_base);
return;
}
 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] very similar, now in walnut_setup_arch(); arch/ppc/platforms/4xx/walnut.c

2007-11-07 Thread Roel Kluin
iounmap kb_data on error

Signed-off-by: Roel Kluin <[EMAIL PROTECTED]>
---
diff --git a/arch/ppc/platforms/4xx/walnut.c b/arch/ppc/platforms/4xx/walnut.c
index 2f97723..04d3f3f 100644
--- a/arch/ppc/platforms/4xx/walnut.c
+++ b/arch/ppc/platforms/4xx/walnut.c
@@ -81,22 +81,23 @@ walnut_setup_arch(void)
kb_data = ioremap(WALNUT_PS2_BASE, 8);
if (!kb_data) {
printk(KERN_CRIT
   "walnut_setup_arch() kb_data ioremap failed\n");
return;
}
 
kb_cs = kb_data + 1;
 
fpga_status = ioremap(PPC40x_FPGA_BASE, 8);
if (!fpga_status) {
+   iounmap(kb_data);
printk(KERN_CRIT
   "walnut_setup_arch() fpga_status ioremap failed\n");
return;
}
 
fpga_enable = fpga_status + 1;
fpga_polarity = fpga_status + 2;
fpga_trigger = fpga_status + 3;
fpga_brdc = fpga_status + 4;
 
/* split the keyboard and mouse interrupts */
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] another ioremap/iounmap issue in sycamore_setup_arch(); arch/ppc/platforms/4xx/sycamore.c

2007-11-07 Thread Roel Kluin
not yet tested
--
iounmap kb_data on error

Signed-off-by: Roel Kluin <[EMAIL PROTECTED]>
---
diff --git a/arch/ppc/platforms/4xx/sycamore.c 
b/arch/ppc/platforms/4xx/sycamore.c
index 8689f3e..c4ac63d 100644
--- a/arch/ppc/platforms/4xx/sycamore.c
+++ b/arch/ppc/platforms/4xx/sycamore.c
@@ -99,22 +99,23 @@ sycamore_setup_arch(void)
kb_data = ioremap(SYCAMORE_PS2_BASE, 8);
if (!kb_data) {
printk(KERN_CRIT
   "sycamore_setup_arch() kb_data ioremap failed\n");
return;
}
 
kb_cs = kb_data + 1;
 
fpga_status = ioremap(PPC40x_FPGA_BASE, 8);
if (!fpga_status) {
+   iounmap(kb_data);
printk(KERN_CRIT
   "sycamore_setup_arch() fpga_status ioremap failed\n");
return;
}
 
fpga_enable = fpga_status + 1;
fpga_polarity = fpga_status + 2;
fpga_trigger = fpga_status + 3;
fpga_brdc = fpga_status + 4;
 
/* split the keyboard and mouse interrupts */
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] mpc8xx_pic_init(); arch/powerpc/sysdev/mpc8xx_pic.c

2007-11-07 Thread Roel Kluin
Again: untested 
--
iounmap siu_reg on error

Signed-off-by: Roel Kluin <[EMAIL PROTECTED]>
---
diff --git a/arch/powerpc/sysdev/mpc8xx_pic.c b/arch/powerpc/sysdev/mpc8xx_pic.c
index 7aa4ff5..1a51251 100644
--- a/arch/powerpc/sysdev/mpc8xx_pic.c
+++ b/arch/powerpc/sysdev/mpc8xx_pic.c
@@ -177,14 +177,15 @@ int mpc8xx_pic_init(void)
siu_reg = ioremap(res.start, res.end - res.start + 1);
if (siu_reg == NULL)
return -EINVAL;
 
mpc8xx_pic_host = irq_alloc_host(of_node_get(np), IRQ_HOST_MAP_LINEAR,
 64, &mpc8xx_pic_host_ops, 64);
if (mpc8xx_pic_host == NULL) {
+   iounmap(siu_reg);
printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n");
ret = -ENOMEM;
}
 
 out:
of_node_put(np);
return ret;
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH (2.6.25) 2/2] suspend: clean up Kconfig

2007-11-07 Thread Rafael J. Wysocki
On Wednesday, 7 of November 2007, Johannes Berg wrote:
> This cleans up the suspend Kconfig and removes the need to
> declare centrally which architectures support suspend. All
> architectures that currently support suspend are modified
> accordingly.
> 
> Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>

Acked-by: Rafael J. Wysocki <[EMAIL PROTECTED]>

> Cc: linuxppc-dev@ozlabs.org
> Cc: [EMAIL PROTECTED]
> Cc: Guennadi Liakhovetski <[EMAIL PROTECTED]>
> Cc: Scott Wood <[EMAIL PROTECTED]>
> Cc: David Howells <[EMAIL PROTECTED]>
> Cc: Ralf Baechle <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Cc: Paul Mundt <[EMAIL PROTECTED]>
> Cc: Bryan Wu <[EMAIL PROTECTED]>
> Cc: Russell King <[EMAIL PROTECTED]>
> ---
> Architecture maintainers should evaluate whether their
> ARCH_SUSPEND_POSSIBLE symbol should be set only under
> stricter circumstances like I've done for powerpc.
> 
> Always setting it is not usually a problem, however, since the
> infrastructure is only available for use after suspend_set_ops().
> 
>  arch/arm/Kconfig  |3 +++
>  arch/blackfin/Kconfig |4 
>  arch/frv/Kconfig  |5 +
>  arch/i386/Kconfig |4 
>  arch/mips/Kconfig |4 
>  arch/powerpc/Kconfig  |4 
>  arch/sh/Kconfig   |4 
>  arch/x86_64/Kconfig   |3 +++
>  kernel/power/Kconfig  |   21 +++--
>  9 files changed, 34 insertions(+), 18 deletions(-)
> 
> --- everything.orig/arch/i386/Kconfig 2007-11-07 14:45:28.591544215 +0100
> +++ everything/arch/i386/Kconfig  2007-11-07 14:45:28.631515461 +0100
> @@ -1323,3 +1323,7 @@ config KTIME_SCALAR
>  config ARCH_HIBERNATION_POSSIBLE
>   def_bool y
>   depends on !SMP || !X86_VOYAGER
> +
> +config ARCH_SUSPEND_POSSIBLE
> + def_bool y
> + depends on !X86_VOYAGER
> --- everything.orig/arch/x86_64/Kconfig   2007-11-07 14:45:28.591544215 
> +0100
> +++ everything/arch/x86_64/Kconfig2007-11-07 14:45:28.631515461 +0100
> @@ -716,6 +716,9 @@ menu "Power management options"
>  
>  source kernel/power/Kconfig
>  
> +config ARCH_SUSPEND_POSSIBLE
> + def_bool y
> +
>  config ARCH_HIBERNATION_POSSIBLE
>   def_bool y
>  
> --- everything.orig/kernel/power/Kconfig  2007-11-07 14:45:28.591544215 
> +0100
> +++ everything/kernel/power/Kconfig   2007-11-07 14:45:28.641531465 +0100
> @@ -64,7 +64,7 @@ config PM_TRACE
>  config PM_SLEEP_SMP
>   bool
>   depends on SMP
> - depends on SUSPEND_SMP_POSSIBLE || ARCH_HIBERNATION_POSSIBLE
> + depends on ARCH_SUSPEND_POSSIBLE || ARCH_HIBERNATION_POSSIBLE
>   depends on PM_SLEEP
>   select HOTPLUG_CPU
>   default y
> @@ -74,29 +74,14 @@ config PM_SLEEP
>   depends on SUSPEND || HIBERNATION
>   default y
>  
> -config SUSPEND_UP_POSSIBLE
> - bool
> - depends on (X86 && !X86_VOYAGER) || PPC || ARM || BLACKFIN || MIPS \
> -|| SUPERH || FRV
> - depends on !SMP
> - default y
> -
> -config SUSPEND_SMP_POSSIBLE
> - bool
> - depends on (X86 && !X86_VOYAGER) \
> -|| (PPC && (PPC_PSERIES || PPC_PMAC)) || ARM
> - depends on SMP
> - default y
> -
>  config SUSPEND
>   bool "Suspend to RAM and standby"
> - depends on PM
> - depends on SUSPEND_UP_POSSIBLE || SUSPEND_SMP_POSSIBLE
> + depends on PM && ARCH_SUSPEND_POSSIBLE
>   default y
>   ---help---
> Allow the system to enter sleep states in which main memory is
> powered and thus its contents are preserved, such as the
> -   suspend-to-RAM state (i.e. the ACPI S3 state).
> +   suspend-to-RAM state (e.g. the ACPI S3 state).
>  
>  config HIBERNATION
>   bool "Hibernation (aka 'suspend to disk')"
> --- everything.orig/arch/blackfin/Kconfig 2007-11-07 14:44:55.551521971 
> +0100
> +++ everything/arch/blackfin/Kconfig  2007-11-07 14:45:28.641531465 +0100
> @@ -993,6 +993,10 @@ endmenu
>  menu "Power management options"
>  source "kernel/power/Kconfig"
>  
> +config ARCH_SUSPEND_POSSIBLE
> + def_bool y
> + depends on !SMP
> +
>  choice
>   prompt "Select PM Wakeup Event Source"
>   default PM_WAKEUP_GPIO_BY_SIC_IWR
> --- everything.orig/arch/arm/Kconfig  2007-11-07 14:44:55.651522948 +0100
> +++ everything/arch/arm/Kconfig   2007-11-07 14:45:28.641531465 +0100
> @@ -977,6 +977,9 @@ menu "Power management options"
>  
>  source "kernel/power/Kconfig"
>  
> +config ARCH_SUSPEND_POSSIBLE
> + def_bool y
> +
>  endmenu
>  
>  source "net/Kconfig"
> --- everything.orig/arch/mips/Kconfig 2007-11-07 14:44:55.701522460 +0100
> +++ everything/arch/mips/Kconfig  2007-11-07 14:45:28.641531465 +0100
> @@ -1999,6 +1999,10 @@ endmenu
>  
>  menu "Power management options"
>  
> +config ARCH_SUSPEND_POSSIBLE
> + def_bool y
> + depends on !SMP
> +
>  source "kernel/power/Kconfig"
>  
>  endmenu
> --- everything.orig/arch/sh/Kconfig   2007-11-07 14:44:55.801520344 +0100
> +++ everything/arch/sh/Kconfig2007-11-07 14:45:28.651528536 +0100
> @

Re: [PATCH (2.6.25) 1/2] hibernation: clean up Kconfig

2007-11-07 Thread Rafael J. Wysocki
On Wednesday, 7 of November 2007, Johannes Berg wrote:
> This cleans up the hibernation Kconfig and removes the need to
> declare centrally which architectures support hibernation. All
> architectures that currently support hibernation are modified
> accordingly.
> 
> Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>

Acked-by: Rafael J. Wysocki <[EMAIL PROTECTED]>

> Cc: linuxppc-dev@ozlabs.org
> Cc: [EMAIL PROTECTED]
> 
> ---
>  arch/i386/Kconfig|4 
>  arch/powerpc/Kconfig |   14 --
>  arch/x86_64/Kconfig  |3 +++
>  kernel/power/Kconfig |   18 +++---
>  4 files changed, 22 insertions(+), 17 deletions(-)
> 
> --- everything.orig/arch/powerpc/Kconfig  2007-11-07 13:52:14.641523382 
> +0100
> +++ everything/arch/powerpc/Kconfig   2007-11-07 14:29:17.251530543 +0100
> @@ -140,9 +140,19 @@ config DEFAULT_UIMAGE
> Used to allow a board to specify it wants a uImage built by default
>   default n
>  
> -config PPC64_SWSUSP
> +config HIBERNATE_32
>   bool
> - depends on PPC64 && (BROKEN || (PPC_PMAC64 && EXPERIMENTAL))
> + depends on (PPC_PMAC && !SMP) || BROKEN
> + default y
> +
> +config HIBERNATE_64
> + bool
> + depends on BROKEN || (PPC_PMAC64 && EXPERIMENTAL)
> + default y
> +
> +config ARCH_HIBERNATION_POSSIBLE
> + bool
> + depends on (PPC64 && HIBERNATE_64) || (PPC32 && HIBERNATE_32)
>   default y
>  
>  config PPC_DCR_NATIVE
> --- everything.orig/kernel/power/Kconfig  2007-11-07 13:52:14.731524087 
> +0100
> +++ everything/kernel/power/Kconfig   2007-11-07 14:29:17.351531628 +0100
> @@ -63,7 +63,8 @@ config PM_TRACE
>  
>  config PM_SLEEP_SMP
>   bool
> - depends on SUSPEND_SMP_POSSIBLE || HIBERNATION_SMP_POSSIBLE
> + depends on SMP
> + depends on SUSPEND_SMP_POSSIBLE || ARCH_HIBERNATION_POSSIBLE
>   depends on PM_SLEEP
>   select HOTPLUG_CPU
>   default y
> @@ -97,22 +98,9 @@ config SUSPEND
> powered and thus its contents are preserved, such as the
> suspend-to-RAM state (i.e. the ACPI S3 state).
>  
> -config HIBERNATION_UP_POSSIBLE
> - bool
> - depends on X86 || PPC64_SWSUSP || PPC32
> - depends on !SMP
> - default y
> -
> -config HIBERNATION_SMP_POSSIBLE
> - bool
> - depends on (X86 && !X86_VOYAGER) || PPC64_SWSUSP
> - depends on SMP
> - default y
> -
>  config HIBERNATION
>   bool "Hibernation (aka 'suspend to disk')"
> - depends on PM && SWAP
> - depends on HIBERNATION_UP_POSSIBLE || HIBERNATION_SMP_POSSIBLE
> + depends on PM && SWAP && ARCH_HIBERNATION_POSSIBLE
>   ---help---
> Enable the suspend to disk (STD) functionality, which is usually
> called "hibernation" in user interfaces.  STD checkpoints the
> --- everything.orig/arch/i386/Kconfig 2007-11-07 13:54:07.811521157 +0100
> +++ everything/arch/i386/Kconfig  2007-11-07 14:29:16.631526474 +0100
> @@ -1319,3 +1319,7 @@ config X86_TRAMPOLINE
>  config KTIME_SCALAR
>   bool
>   default y
> +
> +config ARCH_HIBERNATION_POSSIBLE
> + def_bool y
> + depends on !SMP || !X86_VOYAGER
> --- everything.orig/arch/x86_64/Kconfig   2007-11-07 13:57:35.091520777 
> +0100
> +++ everything/arch/x86_64/Kconfig2007-11-07 14:29:16.721529458 +0100
> @@ -716,6 +716,9 @@ menu "Power management options"
>  
>  source kernel/power/Kconfig
>  
> +config ARCH_HIBERNATION_POSSIBLE
> + def_bool y
> +
>  config ARCH_HIBERNATION_HEADER
>   bool
>   depends on HIBERNATION
> 



-- 
"Premature optimization is the root of all evil." - Donald Knuth
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


inbalanced ioremap/iounmap? in cpm_pic_init(); arch/powerpc/sysdev/commproc.c

2007-11-07 Thread Roel Kluin
It appears to me that ioremap/iounmap in cpm_pic_init() is imbalanced. I am not
certain about this, nor was the patch tested. please review.
--
fix ioremap/iounmap imbalance

Signed-off-by: Roel Kluin <[EMAIL PROTECTED]>
---
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index f6a6378..7b1dd9c 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -152,13 +152,13 @@ unsigned int cpm_pic_init(void)
cpic_reg = ioremap(res.start, res.end - res.start + 1);
if (cpic_reg == NULL)
goto end;
 
sirq = irq_of_parse_and_map(np, 0);
if (sirq == NO_IRQ)
-   goto end;
+   goto io_out;
 
/* Initialize the CPM interrupt controller. */
hwirq = (unsigned int)irq_map[sirq].hwirq;
out_be32(&cpic_reg->cpic_cicr,
(CICR_SCD_SCC4 | CICR_SCC_SCC3 | CICR_SCB_SCC2 | CICR_SCA_SCC1) |
((hwirq/2) << 13) | CICR_HP_MASK);
@@ -167,13 +167,13 @@ unsigned int cpm_pic_init(void)
 
cpm_pic_host = irq_alloc_host(of_node_get(np), IRQ_HOST_MAP_LINEAR,
  64, &cpm_pic_host_ops, 64);
if (cpm_pic_host == NULL) {
printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n");
sirq = NO_IRQ;
-   goto end;
+   goto io_out;
}
 
/* Install our own error handler. */
np = of_find_compatible_node(NULL, NULL, "fsl,cpm1");
if (np == NULL)
np = of_find_node_by_type(NULL, "cpm");
@@ -187,13 +187,15 @@ unsigned int cpm_pic_init(void)
goto end;
 
if (setup_irq(eirq, &cpm_error_irqaction))
printk(KERN_ERR "Could not allocate CPM error IRQ!");
 
setbits32(&cpic_reg->cpic_cicr, CICR_IEN);
-
+   goto end;
+io_out:
+   iounmap(cpic_reg);
 end:
of_node_put(np);
return sirq;
 }
 
 void __init cpm_reset(void)
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] Read back MSI message in rtas_setup_msi_irqs() so restore works

2007-11-07 Thread Linas Vepstas
On Tue, Oct 23, 2007 at 02:23:44PM +1000, Michael Ellerman wrote:
> There are plans afoot to use pci_restore_msi_state() to restore MSI
> state after a device reset. In order for this to work for the RTAS MSI
> backend, we need to read back the MSI message from config space after
> it has been setup by firmware.
> 
> This should be sufficient for restoring the MSI state after a device
> reset, however we will need to revisit this for suspend to disk if that
> is ever implemented on pseries.
> 
> Signed-off-by: Michael Ellerman <[EMAIL PROTECTED]>
> ---
> 
> Linas, can you test this on your setup with your EEH stuff? I haven't got
> any MSI supporting hardware/firmware combination.

Acked-by: Linas Vepstas <[EMAIL PROTECTED]>

I *finally* was able to get onto some hardware long enough to run this.
And that took a lot of work. Sigh. Yes, this is exactly what I'd wanted.

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


Re: mpc5200, sysctl table check failed

2007-11-07 Thread Jon Smirl
While is was doing "nfs: server 192.168.1.4 not responding, still
trying" it Oops'd.

Oops: Kernel access of bad area, sig: 11 [#1]
pcm030
Modules linked in:
NIP: c01f77a8 LR: c01f778c CTR: 
REGS: c0327c00 TRAP: 0300   Not tainted  (2.6.24-rc2-efika-gf96ef878)
MSR: 9032   CR: 2844  XER: 
DAR: 005f600f, DSISR: 2000
TASK = c0305570[0] 'swapper' THREAD: c0326000
GPR00: 7175655f c0327cb0 c0305570 0119 99b1 c0952000  02e4
GPR08: 0006 0001 c0a80105 c034fb9c 330fa340 ffef 03ffe000 
GPR16: 0001  007ffc00   03ff8838  c0327d50
GPR24: 02d0 05a8 c0330e7c c0921184 c0327d60 0464 c0327d50 005f5f77
NIP [c01f77a8] __ip_route_output_key+0x54/0x8f4
LR [c01f778c] __ip_route_output_key+0x38/0x8f4
Call Trace:
[c0327cb0] [c01f802c] __ip_route_output_key+0x8d8/0x8f4 (unreliable)
[c0327d30] [c01f8064] ip_route_output_flow+0x1c/0x74
[c0327d40] [c0221864] inet_sk_rebuild_header+0xb8/0x2c0
[c0327e10] [c0210558] tcp_retransmit_skb+0x478/0x654
[c0327e40] [c0212efc] tcp_write_timer+0x450/0x670
[c0327e60] [c002c5f4] run_timer_softirq+0x12c/0x1b4
[c0327e90] [c00284d0] __do_softirq+0x64/0xd4
[c0327eb0] [c0006144] do_softirq+0x40/0x58
[c0327ec0] [c002837c] irq_exit+0x38/0x48
[c0327ed0] [c000f758] timer_interrupt+0x164/0x180
[c0327ee0] [c0012444] ret_from_except+0x0/0x14
--- Exception: 901 at cpu_idle+0x88/0xd0
LR = cpu_idle+0x88/0xd0
[c0327fa0] [c0009038] cpu_idle+0xcc/0xd0 (unreliable)
[c0327fb0] [c024fa34] rest_init+0x50/0x60
[c0327fc0] [c02d89c4] start_kernel+0x298/0x2ac
[c0327ff0] [3438] 0x3438
Instruction dump:
54842834 7c042278 4bffe91d 7c7d1b78 4be30dcd 3d20c033 8129e9d8 57bd103a
7ffd482e 3d20c035 3969fb9c 4874 <801f0098> 813c000c 7f804800 40be0054
Kernel panic - not syncing: Fatal exception in interrupt
Rebooting in 180 seconds..





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


Re: mpc5200, sysctl table check failed

2007-11-07 Thread Jon Smirl
On 11/7/07, Grant Likely <[EMAIL PROTECTED]> wrote:
> > Phytec pcm030.c depended on mpc52xx_setup_cpu which got removed. I
> > fixed it up by copying the old version into pcm030.c. There must be
> > more to the fix.
>
> Do "git log arch/powerpc/platforms/52xx" to see the when it got
> removed and why.  You should match that change in your pcm030.c.

Looking at it some more it may be the FEC that is stopping user space
from loading. DHCP gets an address but nfs can't mount my root
partition. The nfs server is working since I can mount it from another
machine. Of course user space won't start if nfs can't read the files.

I clipped out non-net related entries.

DMA: MPC52xx BestComm driver
DMA: MPC52xx BestComm engine @f0001200 ok !
SCSI subsystem initialized
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
audit: initializing netlink socket (disabled)
audit(0.230:1): initialized
mpc52xx MII bus: probed
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
net eth0: attached phy 0 to driver Generic PHY
Sending DHCP requests .<6>PHY: f0003000:00 - Link is Up - 100/Full
., OK
IP-Config: Got DHCP answer from 192.168.1.200, my address is 192.168.1.5
IP-Config: Complete:
  device=eth0, addr=192.168.1.5, mask=255.255.255.0, gw=192.168.1.200,
 host=MPC, domain=home, nis-domain=(none),
 bootserver=192.168.1.200, rootserver=192.168.1.4, rootpath=
Looking up port of RPC 13/3 on 192.168.1.4
Looking up port of RPC 15/3 on 192.168.1.4
VFS: Mounted root (nfs filesystem).
Freeing unused kernel memory: 172k init
nfs: server 192.168.1.4 not responding, still trying
nfs: server 192.168.1.4 not responding, still trying
nfs: server 192.168.1.4 not responding, still trying
nfs: server 192.168.1.4 not responding, still trying
nfs: server 192.168.1.4 not responding, still trying
nfs: server 192.168.1.4 not responding, still trying
nfs: server 192.168.1.4 not responding, still trying
nfs: server 192.168.1.4 not responding, still trying
nfs: server 192.168.1.4 not responding, still trying

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


Re: mm snapshot broken-out-2007-11-06-02-32 build failure - !CONFIG_PPC_ISERIES

2007-11-07 Thread Kamalesh Babulal
Hi Andrew,

The kernel build fails with randconfig, with following error

  CC  arch/powerpc/platforms/celleb/setup.o
arch/powerpc/platforms/celleb/setup.c:151: error: ‘generic_calibrate_decr’ 
undeclared here (not in a function)
make[2]: *** [arch/powerpc/platforms/celleb/setup.o] Error 1
make[1]: *** [arch/powerpc/platforms/celleb] Error 2
make: *** [arch/powerpc/platforms] Error 2

This is caused by the include file asm-powerpc/time.h, where the function
goes missing when the CONFIG_PPC_ISERIES option is disabled.
-- 
Thanks & Regards,
Kamalesh Babulal,
Linux Technology Center,
IBM, ISTL.
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.24-rc1-mm1
# Wed Nov  7 13:39:57 2007
#
CONFIG_PPC64=y

#
# Processor support
#
CONFIG_POWER4_ONLY=y
CONFIG_POWER4=y
CONFIG_TUNE_CELL=y
CONFIG_PPC_FPU=y
# CONFIG_ALTIVEC is not set
CONFIG_PPC_STD_MMU=y
CONFIG_PPC_MM_SLICES=y
# CONFIG_VIRT_CPU_ACCOUNTING is not set
CONFIG_SMP=y
CONFIG_NR_CPUS=32
CONFIG_64BIT=y
CONFIG_WORD_SIZE=64
CONFIG_PPC_MERGE=y
CONFIG_MMU=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_IRQ_PER_CPU=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_ARCH_HAS_ILOG2_U32=y
CONFIG_ARCH_HAS_ILOG2_U64=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_GENERIC_FIND_NEXT_BIT=y
CONFIG_ARCH_NO_VIRT_TO_BUS=y
CONFIG_PPC=y
CONFIG_EARLY_PRINTK=y
CONFIG_COMPAT=y
CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_PPC_OF=y
CONFIG_OF=y
CONFIG_PPC_UDBG_16550=y
# CONFIG_GENERIC_TBSYNC is not set
CONFIG_AUDIT_ARCH=y
CONFIG_GENERIC_BUG=y
# CONFIG_DEFAULT_UIMAGE is not set
# CONFIG_PPC_DCR_NATIVE is not set
# CONFIG_PPC_DCR_MMIO is not set
CONFIG_PPC_OF_PLATFORM_PCI=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"

#
# General setup
#
# CONFIG_EXPERIMENTAL is not set
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_SWAP=y
# CONFIG_SYSVIPC is not set
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
# CONFIG_TASK_XACCT is not set
CONFIG_AUDIT=y
CONFIG_AUDITSYSCALL=y
CONFIG_IKCONFIG=y
# CONFIG_IKCONFIG_PROC is not set
CONFIG_LOG_BUF_SHIFT=15
# CONFIG_CGROUPS is not set
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_FAIR_USER_SCHED=y
# CONFIG_FAIR_CGROUP_SCHED is not set
CONFIG_SYSFS_DEPRECATED=y
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_SYSCTL=y
CONFIG_EMBEDDED=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_EXTRA_PASS=y
# CONFIG_HOTPLUG is not set
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
# CONFIG_BASE_FULL is not set
CONFIG_FUTEX=y
CONFIG_ANON_INODES=y
CONFIG_EPOLL=y
# CONFIG_SIGNALFD is not set
CONFIG_EVENTFD=y
# CONFIG_SHMEM is not set
CONFIG_VM_EVENT_COUNTERS=y
# CONFIG_SLAB is not set
# CONFIG_SLUB is not set
CONFIG_SLOB=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_RT_MUTEXES=y
CONFIG_TINY_SHMEM=y
CONFIG_BASE_SMALL=1
# CONFIG_MODULES is not set
CONFIG_BLOCK=y
CONFIG_BLOCK_COMPAT=y

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
# CONFIG_DEFAULT_AS is not set
# CONFIG_DEFAULT_DEADLINE is not set
CONFIG_DEFAULT_CFQ=y
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="cfq"

#
# Platform support
#
CONFIG_PPC_MULTIPLATFORM=y
# CONFIG_PPC_82xx is not set
# CONFIG_PPC_83xx is not set
# CONFIG_PPC_86xx is not set
# CONFIG_PPC_PSERIES is not set
# CONFIG_PPC_ISERIES is not set
# CONFIG_PPC_MPC52xx is not set
# CONFIG_PPC_MPC5200 is not set
# CONFIG_PPC_PMAC is not set
# CONFIG_PPC_MAPLE is not set
CONFIG_PPC_PASEMI=y

#
# PA Semi PWRficient options
#
# CONFIG_PPC_PASEMI_IOMMU is not set
CONFIG_PPC_CELLEB=y
# CONFIG_PPC_PS3 is not set
CONFIG_PPC_CELL=y
# CONFIG_PPC_CELL_NATIVE is not set
# CONFIG_PPC_IBM_CELL_BLADE is not set

#
# Cell Broadband Engine options
#
# CONFIG_SPU_FS is not set
# CONFIG_SPU_BASE is not set
# CONFIG_PQ2ADS is not set
CONFIG_PPC_NATIVE=y
CONFIG_PPC_UDBG_BEAT=y
CONFIG_MPIC=y
# CONFIG_MPIC_WEIRD is not set
# CONFIG_PPC_I8259 is not set
# CONFIG_U3_DART is not set
# CONFIG_PPC_RTAS is not set
# CONFIG_MMIO_NVRAM is not set
CONFIG_MPIC_BROKEN_REGREAD=y
# CONFIG_PPC_MPC106 is not set
# CONFIG_PPC_970_NAP is not set
CONFIG_PPC_INDIRECT_IO=y
CONFIG_GENERIC_IOMAP=y
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
# CONFIG_CPU_FREQ_DEBUG is not set
CONFIG_CPU_FREQ_STAT=y
# CONFIG_CPU_FREQ_STAT_DETAILS is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y

#
# CPU Frequency drivers
#
# CONFIG_PPC_PASEMI_CPUFREQ is not set
# CONFIG_CPM2 is not set
# CONFIG_FSL_ULI1575 is not 

Re: mpc5200, sysctl table check failed

2007-11-07 Thread Grant Likely
On 11/7/07, Jon Smirl <[EMAIL PROTECTED]> wrote:
> On 11/7/07, Grant Likely <[EMAIL PROTECTED]> wrote:
> > On 11/7/07, Jon Smirl <[EMAIL PROTECTED]> wrote:
> > > I'm porting mpc5200 support for the Phytec pcm030 onto current git
> > > head. When booting I get this:
> > >
> > > sysctl table check failed: /kernel .1 Writable sysctl directory
> > > Call Trace:
> > > [c0817ee0] [c0008034] show_stack+0x50/0x184 (unreliable)
> > > [c0817f00] [c003cfc8] set_fail+0x50/0x68
> > > [c0817f20] [c003d630] sysctl_check_table+0x650/0x6a0
> > > [c0817f50] [c002a9b8] register_sysctl_table+0x64/0xb4
> > > [c0817f70] [c02dee70] register_powersave_nap_sysctl+0x18/0x2c
> > > [c0817f80] [c02d81d0] kernel_init+0xb4/0x270
> > > [c0817ff0] [c0011be0] kernel_thread+0x44/0x60
> > >
> > > What's going on? I get all the way through boot and user space doesn't
> > > start, this is probably why.
> >
> > I see the same thing on the latest git (or at least latest as of last
> > night); except for me I have no problem with userspace starting.  This
> > is on a Xilinx Virtex 405.
>
> Olof's patch fixes it.
> http://patchwork.ozlabs.org/linuxppc/patch?id=14612
>
> Phytec pcm030.c depended on mpc52xx_setup_cpu which got removed. I
> fixed it up by copying the old version into pcm030.c. There must be
> more to the fix.

Do "git log arch/powerpc/platforms/52xx" to see the when it got
removed and why.  You should match that change in your pcm030.c.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
[EMAIL PROTECTED]
(403) 399-0195
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: mpc5200, sysctl table check failed

2007-11-07 Thread Jon Smirl
On 11/7/07, Grant Likely <[EMAIL PROTECTED]> wrote:
> On 11/7/07, Jon Smirl <[EMAIL PROTECTED]> wrote:
> > I'm porting mpc5200 support for the Phytec pcm030 onto current git
> > head. When booting I get this:
> >
> > sysctl table check failed: /kernel .1 Writable sysctl directory
> > Call Trace:
> > [c0817ee0] [c0008034] show_stack+0x50/0x184 (unreliable)
> > [c0817f00] [c003cfc8] set_fail+0x50/0x68
> > [c0817f20] [c003d630] sysctl_check_table+0x650/0x6a0
> > [c0817f50] [c002a9b8] register_sysctl_table+0x64/0xb4
> > [c0817f70] [c02dee70] register_powersave_nap_sysctl+0x18/0x2c
> > [c0817f80] [c02d81d0] kernel_init+0xb4/0x270
> > [c0817ff0] [c0011be0] kernel_thread+0x44/0x60
> >
> > What's going on? I get all the way through boot and user space doesn't
> > start, this is probably why.
>
> I see the same thing on the latest git (or at least latest as of last
> night); except for me I have no problem with userspace starting.  This
> is on a Xilinx Virtex 405.

Olof's patch fixes it.
http://patchwork.ozlabs.org/linuxppc/patch?id=14612

Phytec pcm030.c depended on mpc52xx_setup_cpu which got removed. I
fixed it up by copying the old version into pcm030.c. There must be
more to the fix.

/*
 * Phytec mpc5200b tiny (pcm030) board support
 *
 * Written by: Sascha Hauer <[EMAIL PROTECTED]>
 *
 * Copyright (C) 2006 Pengutronix
 *
 * Description:
 * 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 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#include 

static struct __iomem mpc52xx_gpt *gpt = NULL;

static void __init
mpc52xx_setup_cpu(void)
{
struct mpc52xx_cdm  __iomem *cdm;
struct mpc52xx_xlb  __iomem *xlb;

/* needed for mpc52xx_restart */
gpt = mpc52xx_find_and_map("mpc52xx-gpt");

/* Map zones */
cdm = mpc52xx_find_and_map("mpc5200-cdm");
xlb = mpc52xx_find_and_map("mpc5200-xlb");

if (!cdm || !xlb) {
printk(KERN_ERR __FILE__ ": "
"Error while mapping CDM/XLB during mpc52xx_setup_cpu. "
"Expect some abnormal behavior\n");
goto unmap_regs;
}

/* Use internal 48 Mhz */
out_8(&cdm->ext_48mhz_en, 0x00);
out_8(&cdm->fd_enable, 0x01);
if (in_be32(&cdm->rstcfg) & 0x40)   /* Assumes 33Mhz clock */
out_be16(&cdm->fd_counters, 0x0001);
else
out_be16(&cdm->fd_counters, 0x);

/* Configure the XLB Arbiter priorities */
out_be32(&xlb->master_pri_enable, 0xff);
out_be32(&xlb->master_priority, 0x);

/* Disable XLB pipelining */
/* (cfr errate 292. We could do this only just before ATA PIO
transaction and re-enable it afterwards ...) */
out_be32(&xlb->config, in_be32(&xlb->config) | MPC52xx_XLB_CFG_PLDIS);

/* Unmap zones */
unmap_regs:
if (cdm) iounmap(cdm);
if (xlb) iounmap(xlb);
}

struct mpc52xx_gpio __iomem *mpc52xx_gpio=NULL;
struct mpc52xx_gpio_wkup __iomem *mpc52xx_wkpio=NULL;
EXPORT_SYMBOL(mpc52xx_gpio);
EXPORT_SYMBOL(mpc52xx_wkpio);

/*
 * Map the GPIO relevant register fix and global.
 * They will be used in the Pengutronix' GOIO framework
 * This is very PCM030 specific stuff!
 */
static void __init pcm030_gpio_setup(void)
{
mpc52xx_gpio = mpc52xx_find_and_map("mpc52xx-gpio");
if (mpc52xx_gpio == NULL) {
printk(KERN_ERR "%s: Error while mapping GPIO register for port 
config. "
"Expect some abnormal behavior\n",__FILE__);
goto error;
}

mpc52xx_wkpio = mpc52xx_find_and_map("mpc52xx-gpio-wkup");
if (mpc52xx_wkpio == NULL) {
printk(KERN_ERR "%s: "
"Error while mapping WAKEUP register for port 
config. "
"Expect some abnormal behavior\n",__FILE__);
goto error;
}

return;

error:
if (mpc52xx_gpio != NULL)
iounmap(mpc52xx_gpio);
if (mpc52xx_wkpio != NULL)
iounmap(mpc52xx_wkpio);
}

static void __init pcm030_setup_arch(void)
{
struct device_node *np;

if (ppc_md.progress)
ppc_md.progress("pcm030_setup_arch()", 0);

np = of_find_node_by_type(NULL, "cpu");
if (np) {
unsigned int *fp =
(int *)of_get_property(np, "clock-frequency", NULL);
if (fp != 0)
loops_per_jiffy =

Re: mpc5200, sysctl table check failed

2007-11-07 Thread Grant Likely
On 11/7/07, Jon Smirl <[EMAIL PROTECTED]> wrote:
> I'm porting mpc5200 support for the Phytec pcm030 onto current git
> head. When booting I get this:
>
> sysctl table check failed: /kernel .1 Writable sysctl directory
> Call Trace:
> [c0817ee0] [c0008034] show_stack+0x50/0x184 (unreliable)
> [c0817f00] [c003cfc8] set_fail+0x50/0x68
> [c0817f20] [c003d630] sysctl_check_table+0x650/0x6a0
> [c0817f50] [c002a9b8] register_sysctl_table+0x64/0xb4
> [c0817f70] [c02dee70] register_powersave_nap_sysctl+0x18/0x2c
> [c0817f80] [c02d81d0] kernel_init+0xb4/0x270
> [c0817ff0] [c0011be0] kernel_thread+0x44/0x60
>
> What's going on? I get all the way through boot and user space doesn't
> start, this is probably why.

I see the same thing on the latest git (or at least latest as of last
night); except for me I have no problem with userspace starting.  This
is on a Xilinx Virtex 405.

Cheers,
g.

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


-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
[EMAIL PROTECTED]
(403) 399-0195
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: mpc5200, sysctl table check failed

2007-11-07 Thread Olof Johansson
On Wed, Nov 07, 2007 at 03:24:12PM -0500, Jon Smirl wrote:
> I'm porting mpc5200 support for the Phytec pcm030 onto current git
> head. When booting I get this:
> 
> sysctl table check failed: /kernel .1 Writable sysctl directory
> Call Trace:
> [c0817ee0] [c0008034] show_stack+0x50/0x184 (unreliable)
> [c0817f00] [c003cfc8] set_fail+0x50/0x68
> [c0817f20] [c003d630] sysctl_check_table+0x650/0x6a0
> [c0817f50] [c002a9b8] register_sysctl_table+0x64/0xb4
> [c0817f70] [c02dee70] register_powersave_nap_sysctl+0x18/0x2c
> [c0817f80] [c02d81d0] kernel_init+0xb4/0x270
> [c0817ff0] [c0011be0] kernel_thread+0x44/0x60
> 
> What's going on? I get all the way through boot and user space doesn't
> start, this is probably why.

Hi,

I posted a patch for this yesterday, it's harmless, just a warning.


http://patchwork.ozlabs.org/linuxppc/patch?id=14612

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


mpc5200, sysctl table check failed

2007-11-07 Thread Jon Smirl
I'm porting mpc5200 support for the Phytec pcm030 onto current git
head. When booting I get this:

sysctl table check failed: /kernel .1 Writable sysctl directory
Call Trace:
[c0817ee0] [c0008034] show_stack+0x50/0x184 (unreliable)
[c0817f00] [c003cfc8] set_fail+0x50/0x68
[c0817f20] [c003d630] sysctl_check_table+0x650/0x6a0
[c0817f50] [c002a9b8] register_sysctl_table+0x64/0xb4
[c0817f70] [c02dee70] register_powersave_nap_sysctl+0x18/0x2c
[c0817f80] [c02d81d0] kernel_init+0xb4/0x270
[c0817ff0] [c0011be0] kernel_thread+0x44/0x60

What's going on? I get all the way through boot and user space doesn't
start, this is probably why.


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


[PATCH] powerpc/eeh: make sure warning message is printed.

2007-11-07 Thread Linas Vepstas

Fix old buglet; a warning message should have been printed 
when a hardware reset takes too long. 

Signed-off-by: Linas Vepstas <[EMAIL PROTECTED]>


 arch/powerpc/platforms/pseries/eeh.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.23-rc8-mm1/arch/powerpc/platforms/pseries/eeh.c
===
--- linux-2.6.23-rc8-mm1.orig/arch/powerpc/platforms/pseries/eeh.c  
2007-11-05 16:22:44.0 -0600
+++ linux-2.6.23-rc8-mm1/arch/powerpc/platforms/pseries/eeh.c   2007-11-05 
16:24:17.0 -0600
@@ -325,7 +325,7 @@ eeh_wait_for_slot_status(struct pci_dn *
 
if (rets[2] == 0) return -1; /* permanently unavailable */
 
-   if (max_wait_msecs <= 0) return -1;
+   if (max_wait_msecs <= 0) break;
 
mwait = rets[2];
if (mwait <= 0) {
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] hugetlb: follow_hugetlb_page for write access

2007-11-07 Thread Adam Litke

When calling get_user_pages(), a write flag is passed in by the caller to
indicate if write access is required on the faulted-in pages.  Currently,
follow_hugetlb_page() ignores this flag and always faults pages for
read-only access.  This can cause data corruption because a device driver
that calls get_user_pages() with write set will not expect COW faults to
occur on the returned pages.

This patch passes the write flag down to follow_hugetlb_page() and makes
sure hugetlb_fault() is called with the right write_access parameter.

Signed-off-by: Adam Litke <[EMAIL PROTECTED]>
---

 include/linux/hugetlb.h |2 +-
 mm/hugetlb.c|5 +++--
 mm/memory.c |2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 3a19b03..31fa0a0 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -19,7 +19,7 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct 
*vma)
 int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user 
*, size_t *, loff_t *);
 int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void 
__user *, size_t *, loff_t *);
 int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct 
vm_area_struct *);
-int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct 
page **, struct vm_area_struct **, unsigned long *, int *, int);
+int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct 
page **, struct vm_area_struct **, unsigned long *, int *, int, int);
 void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned 
long);
 void __unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned 
long);
 int hugetlb_prefault(struct address_space *, struct vm_area_struct *);
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index eab8c42..b645985 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -621,7 +621,8 @@ int hugetlb_fault(struct mm_struct *mm, struct 
vm_area_struct *vma,
 
 int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
struct page **pages, struct vm_area_struct **vmas,
-   unsigned long *position, int *length, int i)
+   unsigned long *position, int *length, int i,
+   int write)
 {
unsigned long pfn_offset;
unsigned long vaddr = *position;
@@ -643,7 +644,7 @@ int follow_hugetlb_page(struct mm_struct *mm, struct 
vm_area_struct *vma,
int ret;
 
spin_unlock(&mm->page_table_lock);
-   ret = hugetlb_fault(mm, vma, vaddr, 0);
+   ret = hugetlb_fault(mm, vma, vaddr, write);
spin_lock(&mm->page_table_lock);
if (!(ret & VM_FAULT_ERROR))
continue;
diff --git a/mm/memory.c b/mm/memory.c
index f82b359..1bcd444 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1039,7 +1039,7 @@ int get_user_pages(struct task_struct *tsk, struct 
mm_struct *mm,
 
if (is_vm_hugetlb_page(vma)) {
i = follow_hugetlb_page(mm, vma, pages, vmas,
-   &start, &len, i);
+   &start, &len, i, write);
continue;
}
 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 2/2] IB/ehca: Fix static rate calculation

2007-11-07 Thread Roland Dreier
thanks, applied both patches.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [RFC/PATCH] Fix rtas_ibm_suspend_me bugs

2007-11-07 Thread Nathan Lynch
Nathan Lynch wrote:
> (very rfc for now, no sign-off, needs more testing)
> 
> There are a couple of bugs in the rtas_ibm_suspend_me() and
> rtas_percpu_suspend_me() functions:
> 
> 1.  rtas_ibm_suspend_me() uses on_each_cpu() to invoke
> rtas_percpu_suspend_me() via IPI:
> 
> if (on_each_cpu(rtas_percpu_suspend_me, &data, 1, 0))
> ...
> 
> 'data' is on the stack, and rtas_ibm_suspend_me() takes no measures to
> ensure that all instances of rtas_percpu_suspend_me() are finished
> accessing 'data' before returning.  This can result in the IPI'd cpus
> accessing random stack data and getting stuck in H_JOIN.

Another possible issue is that H_JOIN requires MSR.EE to be off, but
lazy interrupt disabling could conceivably allow that constraint to be
violated if we end up doing H_JOIN on the cpu which calls on_each_cpu().
At least I think so...
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [RFC] Modifying i2c-core to support alias driver names compatible with device trees

2007-11-07 Thread Jon Smirl
On 11/6/07, Jon Smirl <[EMAIL PROTECTED]> wrote:
> This code modifies the i2c-core to support lists of alias names in the
> chip drivers.

Any comments on this code?

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


Re: [PATCH (2.6.25) 2/2] suspend: clean up Kconfig

2007-11-07 Thread Paul Mundt
On Wed, Nov 07, 2007 at 02:58:00PM +0100, Johannes Berg wrote:
> This cleans up the suspend Kconfig and removes the need to
> declare centrally which architectures support suspend. All
> architectures that currently support suspend are modified
> accordingly.
> 
> Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>
> Cc: Rafael J. Wysocki <[EMAIL PROTECTED]>
> Cc: linuxppc-dev@ozlabs.org
> Cc: [EMAIL PROTECTED]
> Cc: Guennadi Liakhovetski <[EMAIL PROTECTED]>
> Cc: Scott Wood <[EMAIL PROTECTED]>
> Cc: David Howells <[EMAIL PROTECTED]>
> Cc: Ralf Baechle <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Cc: Paul Mundt <[EMAIL PROTECTED]>
> Cc: Bryan Wu <[EMAIL PROTECTED]>
> Cc: Russell King <[EMAIL PROTECTED]>
> ---
> Architecture maintainers should evaluate whether their
> ARCH_SUSPEND_POSSIBLE symbol should be set only under
> stricter circumstances like I've done for powerpc.
> 
The SH bits look fine.

Acked-by: Paul Mundt <[EMAIL PROTECTED]>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] [POWERPC] pasemi: Move cpus to hold loop before restart

2007-11-07 Thread Olof Johansson
[POWERPC] pasemi: Move cpus to hold loop before restart

Use smp_send_stop() to move all cpus besides the one executing reboot
into a hold loop, to keep them from being in powersavings mode at the
time of reboot.

Signed-off-by: Olof Johansson <[EMAIL PROTECTED]>

diff --git a/arch/powerpc/platforms/pasemi/setup.c 
b/arch/powerpc/platforms/pasemi/setup.c
index bd85853..14dace7 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -60,6 +60,9 @@ static int num_mce_regs;
 
 static void pas_restart(char *cmd)
 {
+   /* Need to put others cpu in hold loop so they're not sleeping */
+   smp_send_stop();
+   udelay(1);
printk("Restarting...\n");
while (1)
out_le32(reset_reg, 0x600);
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH (2.6.25) 2/2] suspend: clean up Kconfig

2007-11-07 Thread Johannes Berg
This cleans up the suspend Kconfig and removes the need to
declare centrally which architectures support suspend. All
architectures that currently support suspend are modified
accordingly.

Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>
Cc: Rafael J. Wysocki <[EMAIL PROTECTED]>
Cc: linuxppc-dev@ozlabs.org
Cc: [EMAIL PROTECTED]
Cc: Guennadi Liakhovetski <[EMAIL PROTECTED]>
Cc: Scott Wood <[EMAIL PROTECTED]>
Cc: David Howells <[EMAIL PROTECTED]>
Cc: Ralf Baechle <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
Cc: Paul Mundt <[EMAIL PROTECTED]>
Cc: Bryan Wu <[EMAIL PROTECTED]>
Cc: Russell King <[EMAIL PROTECTED]>
---
Architecture maintainers should evaluate whether their
ARCH_SUSPEND_POSSIBLE symbol should be set only under
stricter circumstances like I've done for powerpc.

Always setting it is not usually a problem, however, since the
infrastructure is only available for use after suspend_set_ops().

 arch/arm/Kconfig  |3 +++
 arch/blackfin/Kconfig |4 
 arch/frv/Kconfig  |5 +
 arch/i386/Kconfig |4 
 arch/mips/Kconfig |4 
 arch/powerpc/Kconfig  |4 
 arch/sh/Kconfig   |4 
 arch/x86_64/Kconfig   |3 +++
 kernel/power/Kconfig  |   21 +++--
 9 files changed, 34 insertions(+), 18 deletions(-)

--- everything.orig/arch/i386/Kconfig   2007-11-07 14:45:28.591544215 +0100
+++ everything/arch/i386/Kconfig2007-11-07 14:45:28.631515461 +0100
@@ -1323,3 +1323,7 @@ config KTIME_SCALAR
 config ARCH_HIBERNATION_POSSIBLE
def_bool y
depends on !SMP || !X86_VOYAGER
+
+config ARCH_SUSPEND_POSSIBLE
+   def_bool y
+   depends on !X86_VOYAGER
--- everything.orig/arch/x86_64/Kconfig 2007-11-07 14:45:28.591544215 +0100
+++ everything/arch/x86_64/Kconfig  2007-11-07 14:45:28.631515461 +0100
@@ -716,6 +716,9 @@ menu "Power management options"
 
 source kernel/power/Kconfig
 
+config ARCH_SUSPEND_POSSIBLE
+   def_bool y
+
 config ARCH_HIBERNATION_POSSIBLE
def_bool y
 
--- everything.orig/kernel/power/Kconfig2007-11-07 14:45:28.591544215 
+0100
+++ everything/kernel/power/Kconfig 2007-11-07 14:45:28.641531465 +0100
@@ -64,7 +64,7 @@ config PM_TRACE
 config PM_SLEEP_SMP
bool
depends on SMP
-   depends on SUSPEND_SMP_POSSIBLE || ARCH_HIBERNATION_POSSIBLE
+   depends on ARCH_SUSPEND_POSSIBLE || ARCH_HIBERNATION_POSSIBLE
depends on PM_SLEEP
select HOTPLUG_CPU
default y
@@ -74,29 +74,14 @@ config PM_SLEEP
depends on SUSPEND || HIBERNATION
default y
 
-config SUSPEND_UP_POSSIBLE
-   bool
-   depends on (X86 && !X86_VOYAGER) || PPC || ARM || BLACKFIN || MIPS \
-  || SUPERH || FRV
-   depends on !SMP
-   default y
-
-config SUSPEND_SMP_POSSIBLE
-   bool
-   depends on (X86 && !X86_VOYAGER) \
-  || (PPC && (PPC_PSERIES || PPC_PMAC)) || ARM
-   depends on SMP
-   default y
-
 config SUSPEND
bool "Suspend to RAM and standby"
-   depends on PM
-   depends on SUSPEND_UP_POSSIBLE || SUSPEND_SMP_POSSIBLE
+   depends on PM && ARCH_SUSPEND_POSSIBLE
default y
---help---
  Allow the system to enter sleep states in which main memory is
  powered and thus its contents are preserved, such as the
- suspend-to-RAM state (i.e. the ACPI S3 state).
+ suspend-to-RAM state (e.g. the ACPI S3 state).
 
 config HIBERNATION
bool "Hibernation (aka 'suspend to disk')"
--- everything.orig/arch/blackfin/Kconfig   2007-11-07 14:44:55.551521971 
+0100
+++ everything/arch/blackfin/Kconfig2007-11-07 14:45:28.641531465 +0100
@@ -993,6 +993,10 @@ endmenu
 menu "Power management options"
 source "kernel/power/Kconfig"
 
+config ARCH_SUSPEND_POSSIBLE
+   def_bool y
+   depends on !SMP
+
 choice
prompt "Select PM Wakeup Event Source"
default PM_WAKEUP_GPIO_BY_SIC_IWR
--- everything.orig/arch/arm/Kconfig2007-11-07 14:44:55.651522948 +0100
+++ everything/arch/arm/Kconfig 2007-11-07 14:45:28.641531465 +0100
@@ -977,6 +977,9 @@ menu "Power management options"
 
 source "kernel/power/Kconfig"
 
+config ARCH_SUSPEND_POSSIBLE
+   def_bool y
+
 endmenu
 
 source "net/Kconfig"
--- everything.orig/arch/mips/Kconfig   2007-11-07 14:44:55.701522460 +0100
+++ everything/arch/mips/Kconfig2007-11-07 14:45:28.641531465 +0100
@@ -1999,6 +1999,10 @@ endmenu
 
 menu "Power management options"
 
+config ARCH_SUSPEND_POSSIBLE
+   def_bool y
+   depends on !SMP
+
 source "kernel/power/Kconfig"
 
 endmenu
--- everything.orig/arch/sh/Kconfig 2007-11-07 14:44:55.801520344 +0100
+++ everything/arch/sh/Kconfig  2007-11-07 14:45:28.651528536 +0100
@@ -748,6 +748,10 @@ endmenu
 menu "Power management options (EXPERIMENTAL)"
 depends on EXPERIMENTAL && SYS_SUPPORTS_PM
 
+config ARCH_SUSPEND_POSSIBLE
+   def_bool y
+   depends on !SMP
+
 source kernel/power/Kconfig
 
 endmenu
--- everything.orig/arch/

Re: [PATCH 4/3] Make swsusp_32.S usable for suspend-to-RAM.

2007-11-07 Thread Johannes Berg

> +config PPC32_SUSPEND

> +config PPC32_SWSUSP

> -obj32-$(CONFIG_HIBERNATION) += swsusp_32.o
> +obj32-$(CONFIG_PPC32_SUSPEND)+= swsusp_32.o

I think that's overkill, couldn't it just use CONFIG_PM_SLEEP here? I'm
not sure that was available at the time you posted this patchset though,
so that may well be the reason you didn't use it.

For reference, kernel/power/Kconfig has:

config PM_SLEEP
bool   
depends on SUSPEND || HIBERNATION
default y


johannes


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

[PATCH (2.6.25) 1/2] hibernation: clean up Kconfig

2007-11-07 Thread Johannes Berg
This cleans up the hibernation Kconfig and removes the need to
declare centrally which architectures support hibernation. All
architectures that currently support hibernation are modified
accordingly.

Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>
Cc: Rafael J. Wysocki <[EMAIL PROTECTED]>
Cc: linuxppc-dev@ozlabs.org
Cc: [EMAIL PROTECTED]

---
 arch/i386/Kconfig|4 
 arch/powerpc/Kconfig |   14 --
 arch/x86_64/Kconfig  |3 +++
 kernel/power/Kconfig |   18 +++---
 4 files changed, 22 insertions(+), 17 deletions(-)

--- everything.orig/arch/powerpc/Kconfig2007-11-07 13:52:14.641523382 
+0100
+++ everything/arch/powerpc/Kconfig 2007-11-07 14:29:17.251530543 +0100
@@ -140,9 +140,19 @@ config DEFAULT_UIMAGE
  Used to allow a board to specify it wants a uImage built by default
default n
 
-config PPC64_SWSUSP
+config HIBERNATE_32
bool
-   depends on PPC64 && (BROKEN || (PPC_PMAC64 && EXPERIMENTAL))
+   depends on (PPC_PMAC && !SMP) || BROKEN
+   default y
+
+config HIBERNATE_64
+   bool
+   depends on BROKEN || (PPC_PMAC64 && EXPERIMENTAL)
+   default y
+
+config ARCH_HIBERNATION_POSSIBLE
+   bool
+   depends on (PPC64 && HIBERNATE_64) || (PPC32 && HIBERNATE_32)
default y
 
 config PPC_DCR_NATIVE
--- everything.orig/kernel/power/Kconfig2007-11-07 13:52:14.731524087 
+0100
+++ everything/kernel/power/Kconfig 2007-11-07 14:29:17.351531628 +0100
@@ -63,7 +63,8 @@ config PM_TRACE
 
 config PM_SLEEP_SMP
bool
-   depends on SUSPEND_SMP_POSSIBLE || HIBERNATION_SMP_POSSIBLE
+   depends on SMP
+   depends on SUSPEND_SMP_POSSIBLE || ARCH_HIBERNATION_POSSIBLE
depends on PM_SLEEP
select HOTPLUG_CPU
default y
@@ -97,22 +98,9 @@ config SUSPEND
  powered and thus its contents are preserved, such as the
  suspend-to-RAM state (i.e. the ACPI S3 state).
 
-config HIBERNATION_UP_POSSIBLE
-   bool
-   depends on X86 || PPC64_SWSUSP || PPC32
-   depends on !SMP
-   default y
-
-config HIBERNATION_SMP_POSSIBLE
-   bool
-   depends on (X86 && !X86_VOYAGER) || PPC64_SWSUSP
-   depends on SMP
-   default y
-
 config HIBERNATION
bool "Hibernation (aka 'suspend to disk')"
-   depends on PM && SWAP
-   depends on HIBERNATION_UP_POSSIBLE || HIBERNATION_SMP_POSSIBLE
+   depends on PM && SWAP && ARCH_HIBERNATION_POSSIBLE
---help---
  Enable the suspend to disk (STD) functionality, which is usually
  called "hibernation" in user interfaces.  STD checkpoints the
--- everything.orig/arch/i386/Kconfig   2007-11-07 13:54:07.811521157 +0100
+++ everything/arch/i386/Kconfig2007-11-07 14:29:16.631526474 +0100
@@ -1319,3 +1319,7 @@ config X86_TRAMPOLINE
 config KTIME_SCALAR
bool
default y
+
+config ARCH_HIBERNATION_POSSIBLE
+   def_bool y
+   depends on !SMP || !X86_VOYAGER
--- everything.orig/arch/x86_64/Kconfig 2007-11-07 13:57:35.091520777 +0100
+++ everything/arch/x86_64/Kconfig  2007-11-07 14:29:16.721529458 +0100
@@ -716,6 +716,9 @@ menu "Power management options"
 
 source kernel/power/Kconfig
 
+config ARCH_HIBERNATION_POSSIBLE
+   def_bool y
+
 config ARCH_HIBERNATION_HEADER
bool
depends on HIBERNATION

-- 

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


[PATCH] powerpc swsusp: make altivec code depend on CONFIG_ALTIVEC

2007-11-07 Thread Johannes Berg
This makes the altivec code in swsusp_32.S depend on CONFIG_ALTIVEC to
avoid build failures for systems that don't have altivec. I'm not sure
whether the code will actually work for other systems, but it was merged
for just ppc32 rather than powermac a very long time ago.

Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>
---

--- everything.orig/arch/powerpc/kernel/swsusp_32.S 2007-11-07 
13:27:12.441517359 +0100
+++ everything/arch/powerpc/kernel/swsusp_32.S  2007-11-07 13:27:25.251519911 
+0100
@@ -133,10 +133,12 @@ _GLOBAL(swsusp_arch_suspend)
 /* Resume code */
 _GLOBAL(swsusp_arch_resume)
 
+#ifdef CONFIG_ALTIVEC
/* Stop pending alitvec streams and memory accesses */
 BEGIN_FTR_SECTION
DSSALL
 END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
+#endif
sync
 
/* Disable MSR:DR to make sure we don't take a TLB or


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


Re: 2.6.24-rc1-git15 Kernel build fails on powerpc - Unrecognized opcode: `dssall'

2007-11-07 Thread Johannes Berg

On Wed, 2007-11-07 at 10:38 +0100, Johannes Berg wrote:
> 
> > So that sounds like a Kconfig problem then?  That HIBERATION requires
> > ALITIVEC and yet does not depend on it or set it.
> 
> Yes. I'm guessing that it broke with Rafael's hibernation/suspend
> Kconfig changes but will take a look. I think it used to depend on
> powermac.

Hmm, no, it didn't. I don't feel confident enough that nobody cares
about this code to make these Kconfig changes for 2.6.24.

johannes


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

[PATCH] [POWERPC] pasemi: Don't enter powersaving states from elevated astates

2007-11-07 Thread Olof Johansson
[POWERPC] pasemi: Don't enter powersaving states from elevated astates

When the PWRficient cpus are entered into powersavings states, the
astate is automatically dropped down to 0. While we still restore it
when we come out of idle, it can still cause some weird effects with
respect to performance (especially since it takes a while to ramp up to
higher astates).

So, to avoid this, don't enter power savings when the cpufreq driver
(or user) has set higher astates than 0.

The restore is still required, since there's a chance the astate has
been raised from the other cpu while the idling one was asleep.

Signed-off-by: Olof Johansson <[EMAIL PROTECTED]>

diff --git a/arch/powerpc/platforms/pasemi/cpufreq.c 
b/arch/powerpc/platforms/pasemi/cpufreq.c
index 8caa166..c2e0340 100644
--- a/arch/powerpc/platforms/pasemi/cpufreq.c
+++ b/arch/powerpc/platforms/pasemi/cpufreq.c
@@ -124,6 +124,11 @@ static void set_astate(int cpu, unsigned int astate)
local_irq_restore(flags);
 }
 
+int check_astate(void)
+{
+   return get_cur_astate(hard_smp_processor_id());
+}
+
 void restore_astate(int cpu)
 {
set_astate(cpu, current_astate);
diff --git a/arch/powerpc/platforms/pasemi/pasemi.h 
b/arch/powerpc/platforms/pasemi/pasemi.h
index 516acab..c96127b 100644
--- a/arch/powerpc/platforms/pasemi/pasemi.h
+++ b/arch/powerpc/platforms/pasemi/pasemi.h
@@ -16,8 +16,14 @@ extern void idle_doze(void);
 
 /* Restore astate to last set */
 #ifdef CONFIG_PPC_PASEMI_CPUFREQ
+extern int check_astate(void);
 extern void restore_astate(int cpu);
 #else
+static inline int check_astate(void)
+{
+   /* Always return >0 so we never power save */
+   return 1;
+}
 static inline void restore_astate(int cpu)
 {
 }
diff --git a/arch/powerpc/platforms/pasemi/powersave.S 
b/arch/powerpc/platforms/pasemi/powersave.S
index 6d0fba6..56f45ad 100644
--- a/arch/powerpc/platforms/pasemi/powersave.S
+++ b/arch/powerpc/platforms/pasemi/powersave.S
@@ -62,7 +62,16 @@ sleep_common:
mflrr0
std r0, 16(r1)
stdur1,-64(r1)
+#ifdef CONFIG_PPC_PASEMI_CPUFREQ
+   std r3, 48(r1)
 
+   /* Only do power savings when in astate 0 */
+   bl  .check_astate
+   cmpwi   r3,0
+   bne 1f
+
+   ld  r3, 48(r1)
+#endif
LOAD_REG_IMMEDIATE(r6,MSR_DR|MSR_IR|MSR_ME|MSR_EE)
mfmsr   r4
andcr5,r4,r6
@@ -73,7 +82,7 @@ sleep_common:
 
mtmsrd  r4,0
 
-   addir1,r1,64
+1: addir1,r1,64
ld  r0,16(r1)
mtlrr0
blr
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] DTC: Polish up the DTS Version 1 implementation.

2007-11-07 Thread Jon Loeliger
So, like, the other day David Gibson mumbled:
> On Tue, Nov 06, 2007 at 04:19:19PM -0600, Jon Loeliger wrote:
> > From: Jon Loeliger <[EMAIL PROTECTED]>
> > 
> > Fixes BYTESTRING lexing.
> > Allows -O dts output to be emitted in a given (1) format version.
> 
> Ok... I'd actually be more inclined to remove the option and just have
> -Odts *always* use the newer version.

You didn't read the code. :-)  That's what it does!
There is no option, it is just parameterized in the code.
It _always_ forward re-writes as the latest version.

> Having dtc be able to convert dts versions forward is easy and
> useful.

Oh, I see.  Thank you.

> > This patch is directly on top of your prior two patches.
> > Lemme know what you think.
> 
> On top of my two dts-v1 patches that is, I assume?

Right.

> Ow... that's rather embarrassing, that I didn't even notice I'd
> totally broken bytestrings.  Really must add some bytestrings to
> test_tree1.dts so this actually gets checked by the testsuite.

I ran my "old versus new DTC" comparison script and found it. :-)

> Not really related changes, but whatever..

Uh, yeah.  Leftoverish.  Sorry.


> > +/*
> > + * bits is unused, but it should be 32 or 64 as needed.
> > + *
> > + * FIXME: However, with bits == 64, ((1ULL << bits) - 1)
> > + * overflows before you can actually do the range test.
> > + */
> >  unsigned long long eval_literal(const char *s, int base, int bits)
> >  {
> > unsigned long long val;
> > @@ -317,9 +323,10 @@ unsigned long long eval_literal(const char *s, int 
> > base, int bits)
> > val = strtoull(s, &e, base);
> > if (*e)
> > yyerror("bad characters in literal");
> > -   else if ((errno == ERANGE) || (val > ((1ULL << bits)-1)))
> > +   else if (errno == ERANGE)
> > yyerror("literal out of range");
> > else if (errno != 0)
> > yyerror("bad literal");
> > +
> 
> Ok.. I don't understand why you've pulled out the range checking
> against bits here.

Because it wasn't working, as explained in the comment I added.
Specifically, (1< ((1ULL << bits) - 1)) {
printf("val out of dynamic range\n");
} else {
printf("val is ok with dynamic range
}

if (val > ((1ULL << 64) - 1)) {
printf("val out of static range\n");
} else {
printf("val is ok with static range\n");
}
}
 snip to get foo.c 

Yielding output:

[ snip ]

range at 60 is 0x0fff
range at 61 is 0x1fff
range at 62 is 0x3fff
range at 63 is 0x7fff
range at 64 is 0x
val   is 0xabcd1234
val out of dynamic range
val is ok with static range

This is:

jdl.com 1069 % gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.1.3 --program-suffix=-4.1
--enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug
--enable-mpfr --with-tune=i686 --enable-checking=release
i486-linux-gnu
Thread model: posix
gcc version 4.1.3 20070629 (prerelease) (Debian 4.1.2-13)

Which seems at least reasonable, though perhaps wrong. :-)

> > -static void write_propval_bytes(FILE *f, struct data val)
> > +static void write_propval_bytes(FILE *f, struct data val, int dts_version)
> >  {
> > void *propend = val.val + val.len;
> > char *bp = val.val;
> >  
> > fprintf(f, " = [");
> > for (;;) {
> > -   fprintf(f, "%02hhx", *bp++);
> > +   if (dts_version == 0) {
> > +   fprintf(f, "%02hhx", *bp++);
> > +   } else {
> > +   fprintf(f, "0x%02hhx", *bp++);
> > +   }
> 
> Uh.. not quite right.  My patch (intentionally) leaves bytestrings as
> pure hex, without 0x.

Ugh.  That seems inconsistent and wrong to me.

> We can argue about whether that's a good idea,
> if you like,

And in the blue corner, touting consistent hex forms, ...

> but in any case input and output should match.

Oops.  That they should.

> To avoid this sort of problem, I suggest before we apply the dts-v1
> transition, we apply the patch I'm working on (I'll try to get it out
> today), which adds a bunch of extra testcases checking that using dtc
> to go dtb->dts->dtb preserves everything.

Yeah, I've been doing that too...  Sounds good.

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


[PATCH] Register AC97 Controller Reference with the platform bus

2007-11-07 Thread Grant Likely
From: Joachim Foerster <[EMAIL PROTECTED]>

Add AC97 platform bus registration for Xilinx Virtex platforms.

Signed-off-by: Joachim Foerster <[EMAIL PROTECTED]>
Signed-off-by: Grant Likely <[EMAIL PROTECTED]>
---

Josh, can you please pick up this patch into your .24 queue.  I know it's
arch/ppc, but it is harmless and it is required to get the AC97 device
driver working on Virtex boards.  It's pretty much a bug fix in that regard.

Cheers,
g.

 arch/ppc/syslib/virtex_devices.c |   31 +++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/arch/ppc/syslib/virtex_devices.c b/arch/ppc/syslib/virtex_devices.c
index 96188f8..95ee313 100644
--- a/arch/ppc/syslib/virtex_devices.c
+++ b/arch/ppc/syslib/virtex_devices.c
@@ -169,6 +169,29 @@
}, \
 }
 
+#define XPAR_AC97_CONTROLLER_REFERENCE(num) { \
+   .name = "ml403_ac97cr", \
+   .id = num, \
+   .num_resources = 3, \
+   .resource = (struct resource[]) { \
+   { \
+   .start = XPAR_OPB_AC97_CONTROLLER_REF_##num##_BASEADDR, 
\
+   .end = XPAR_OPB_AC97_CONTROLLER_REF_##num##_HIGHADDR, \
+   .flags = IORESOURCE_MEM, \
+   }, \
+   { \
+   .start = 
XPAR_OPB_INTC_0_OPB_AC97_CONTROLLER_REF_##num##_PLAYBACK_INTERRUPT_INTR, \
+   .end = 
XPAR_OPB_INTC_0_OPB_AC97_CONTROLLER_REF_##num##_PLAYBACK_INTERRUPT_INTR, \
+   .flags = IORESOURCE_IRQ, \
+   }, \
+   { \
+   .start = 
XPAR_OPB_INTC_0_OPB_AC97_CONTROLLER_REF_##num##_RECORD_INTERRUPT_INTR, \
+   .end = 
XPAR_OPB_INTC_0_OPB_AC97_CONTROLLER_REF_##num##_RECORD_INTERRUPT_INTR, \
+   .flags = IORESOURCE_IRQ, \
+   }, \
+   }, \
+}
+
 /* UART 8250 driver platform data table */
 struct plat_serial8250_port virtex_serial_platform_data[] = {
 #if defined(XPAR_UARTNS550_0_BASEADDR)
@@ -303,6 +326,14 @@ struct platform_device virtex_platform_devices[] = {
 #if defined(XPAR_TFT_3_BASEADDR)
XPAR_TFT(3),
 #endif
+
+   /* AC97 Controller Reference instances */
+#if defined(XPAR_OPB_AC97_CONTROLLER_REF_0_BASEADDR)
+   XPAR_AC97_CONTROLLER_REFERENCE(0),
+#endif
+#if defined(XPAR_OPB_AC97_CONTROLLER_REF_1_BASEADDR)
+   XPAR_AC97_CONTROLLER_REFERENCE(1),
+#endif
 };
 
 /* Early serial support functions */

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


[PATCH] autoload snd-powermac via modalias

2007-11-07 Thread Olaf Hering

Autoload snd-powermac on systems without i2s bus by creating a fake
modalias entry. udev/modprobe will use the 'modalias' file from
/sys/devices/pci*/*/*/*:mac-io/*:davbus/ to find a matching module.
Newer systems use snd-aoa, which provides the required modalias already.

Some systems with i2s bus, but without a 'layout-id' property, will not work
with this patch because an fake i2s alias will conflict with snd-aoa.


Signed-off-by: Olaf Hering <[EMAIL PROTECTED]>

---
 sound/ppc/powermac.c |   10 ++
 1 file changed, 10 insertions(+)

--- a/sound/ppc/powermac.c
+++ b/sound/ppc/powermac.c
@@ -174,6 +174,16 @@ static struct platform_driver snd_pmac_d
},
 };
 
+/* for NewWorld AGP (Pismo, CRT iMac) */
+MODULE_ALIAS("of:NdavbusTsoundbusCdavbus");
+/* for OldWorld beige G3 */
+/* for NewWorld PCI (G3 and early G4) */
+MODULE_ALIAS("of:NdavbusTdavbus");
+/* for OldWorld ohare based */
+MODULE_ALIAS("of:NdavbusTsoundbus");
+/* for OldWorld bandit based */
+MODULE_ALIAS("of:NawacsTsound");
+
 static int __init alsa_card_pmac_init(void)
 {
int err;
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] using mii-bitbang on different processor ports - update the booting-without-of.txt-file

2007-11-07 Thread Sergej Stepanov
Am Dienstag, den 06.11.2007, 12:46 -0600 schrieb Scott Wood:
> >  
> > +   The "reg"-property may have also depending on board design
> > +   the following form:
> > +   reg = <10d40 14 10d60 14>;
> > +   In that case the pin for mdio data controlling is on the port C,
> > +   and the pin for mdio clock controlling is on the port D.
> 
> It'd be better to explicitly say that the first resource is mdio, and the
> second resource is mdc, rather than require the reader to know/look up which
> corresponds to 10d40 and which to 10d60.
> 
> -Scott

Ok. What would you say about something like that:
--
If both mdio and mdc controlling pins are on the same processor port,
one resource should be used.
Otherwise, two resources are used: the 1-st - mdio, the 2-nd - mdc.
--
Please, correct me, if it sounds bad.

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


Re: [RFC/PATCH 0/2] powerpc: 64 bits irqtrace / lockdep support

2007-11-07 Thread Johannes Berg

On Tue, 2007-11-06 at 11:36 -0800, Tim Pepper wrote:
> On 10/14/07, Benjamin Herrenschmidt <[EMAIL PROTECTED]> wrote:
> > This is 2 patches, one from Christoph Hellwig that adds the backtrace 
> > support,
> > and one from Johannes Berg modified by me that adds the irq tracing support.
> >
> > This successfully boots a POWER5 pSeries machine. I'm going to run some more
> > tests in the upcoming few days, so this is not an official submission (and 
> > it's
> > too late for .24 merge window anyway) but it's looking good so far.
> 
> FYI: Boots and survives watching /proc/lock_stat during a kernel build
> for me (on a 970 based blade).

Hmm. I should give it another try and see why it breaks for me. Could be
CONFIG_HIBERNATION related maybe.

johannes


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

[PATCH (resend, for 2.6.24)] windfarm: fix windfarm thread freezer interaction

2007-11-07 Thread Johannes Berg
When I fixed the windfarm freezer interaction first in commit
1ed2ddf380e19dafeec2150ca709ef7f4a67cd21, an earlier patch than the one
I came up with after comments was committed. This has come back to haunt
us now because commit d5d8c5976d6adeddb8208c240460411e2198b393 changed
the freezer to no long send signals. Fix it by removing the windfarm
thread's signal logic and restoring the original try_to_freeze().

We could simply revert 1ed2ddf380e19dafeec2150ca709ef7f4a67cd21 now
but I feel that the assertion that no signal is delivered to the
windfarm thread needs not be there.

Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>
Acked-by: Rafael J. Wysocki <[EMAIL PROTECTED]>
---
This fixes a regression: with 2.6.24 hibernation can no longer work
because the windfarm thread never freezes.

 drivers/macintosh/windfarm_core.c |   10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

--- linux-2.6-git.orig/drivers/macintosh/windfarm_core.c2007-10-23 
14:23:02.406437623 +0200
+++ linux-2.6-git/drivers/macintosh/windfarm_core.c 2007-10-23 
14:25:28.745447695 +0200
@@ -94,7 +94,9 @@ static int wf_thread_func(void *data)
DBG("wf: thread started\n");
 
set_freezable();
-   while(!kthread_should_stop()) {
+   while (!kthread_should_stop()) {
+   try_to_freeze();
+
if (time_after_eq(jiffies, next)) {
wf_notify(WF_EVENT_TICK, NULL);
if (wf_overtemp) {
@@ -116,12 +118,6 @@ static int wf_thread_func(void *data)
delay = next - jiffies;
if (delay <= HZ)
schedule_timeout_interruptible(delay);
-
-   /* there should be no non-suspend signal, but oh well */
-   if (signal_pending(current) && !try_to_freeze()) {
-   printk(KERN_WARNING "windfarm: thread got sigl !\n");
-   break;
-   }
}
 
DBG("wf: thread stopped\n");


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


Re: 2.6.24-rc1-git15 Kernel build fails on powerpc - Unrecognized opcode: `dssall'

2007-11-07 Thread Johannes Berg


> So that sounds like a Kconfig problem then?  That HIBERATION requires
> ALITIVEC and yet does not depend on it or set it.

Yes. I'm guessing that it broke with Rafael's hibernation/suspend
Kconfig changes but will take a look. I think it used to depend on
powermac.

johannes


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [ofa-general] Re: problem in follow_hugetlb_page on ppc64 architecture with get_user_pages

2007-11-07 Thread Christoph Raisch

[EMAIL PROTECTED] wrote on 06.11.2007 23:31:19:


> We should cut this down to the bare necessary and fold it into the
> libhugetlbfs testsuite.

Well, this testcase is already pretty close to the bare minimum
what's needed to run IB/RDMA queues.
You can compare this to for example ibv_rc_pingpong in libibverbs...

Maybe it's possible to test this with anything else than IB?

> --
Gruss / Regards
Christoph R

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