LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: MPC7447A based board with MV64462 Marvell Discovery III controller
From: Sven Luther @ 2005-10-20 15:37 UTC (permalink / raw)
  To: Mark A. Greer; +Cc: linuxppc-embedded
In-Reply-To: <20051020152157.GB18972@mag.az.mvista.com>

On Thu, Oct 20, 2005 at 08:21:57AM -0700, Mark A. Greer wrote:
> On Thu, Oct 20, 2005 at 05:04:50PM +0200, Sven Luther wrote:
> > Hey, we have code to boot the Freeserv with chrp/Of, need to clean it up and
> > merge it though. Would this be a good thing to submit for mainline inclusion,
> > it is a couple of lines at most, altough there is some reuse of the interrupt
> > controller code i think, which needs some cleanup.
> 
> I don't know what a "Freeserv" is but, sure, push it on up once you're
> happy with it.  The more code the merrier.  :)

It is also known as HPC1, which is the discovery III based freesscale
reference design, as the HPC2 is the tundra based one.

Friendly,

Sven Luther

^ permalink raw reply

* [PATCH] powerpc: Make sure we have an RTC before trying to adjust it
From: Kumar Gala @ 2005-10-20 16:43 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, linuxppc64-dev

Its valid for ppc_md.set_rtc_time to be NULL.  We need to check
that its non-NULL before trying to update the RTC.

Signed-off-by: Kumar K. Gala <kumar.gala@freescale.com>

---
commit e597837e138d9526562a68ec2f3c77a47ce1045e
tree d5f982c7881efe43276b85ece4a371cb66f64ae5
parent de6cc780f1ec6143474219697c249d7266f56120
author Kumar K. Gala <kumar.gala@freescale.com> Thu, 20 Oct 2005 11:35:28 -0500
committer Kumar K. Gala <kumar.gala@freescale.com> Thu, 20 Oct 2005 11:35:28 -0500

 arch/powerpc/kernel/time.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -144,7 +144,7 @@ static __inline__ void timer_check_rtc(v
          * We should have an rtc call that only sets the minutes and
          * seconds like on Intel to avoid problems with non UTC clocks.
          */
-        if (ntp_synced() &&
+        if (ppc_md.set_rtc_time && ntp_synced() &&
 	    xtime.tv_sec - last_rtc_update >= 659 &&
 	    abs((xtime.tv_nsec/1000) - (1000000-1000000/HZ)) < 500000/HZ &&
 	    jiffies - wall_jiffies == 1) {

^ permalink raw reply

* [PATCH] powerpc: some prom.c cleanups
From: Kumar Gala @ 2005-10-20 16:44 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, linuxppc64-dev

On !CONFIG_PPC_MULTIPLATFORM _machine is defined as 0.  This is ok, but
we can't assign a value to _machine then.

We may not have CONFIG_PCI available, so only build in support for
find_parent_pci_resource(), request_OF_resource(), release_OF_resource()
if PCI is enabled.  This is probably not the long term fix but works out
for now.

Make reg_property64 contain 64-bit elements on a 32-bit machine.

Mark the deprecated prom.c functions as __deprecated.

Signed-off-by: Kumar K. Gala <kumar.gala@freescale.com>

---
commit 3f11459b85450aa70da16ab1b1c82ef29498ef1a
tree 8b625ab8868872bf5b909d0d55dd704604858048
parent e597837e138d9526562a68ec2f3c77a47ce1045e
author Kumar K. Gala <kumar.gala@freescale.com> Thu, 20 Oct 2005 11:41:18 -0500
committer Kumar K. Gala <kumar.gala@freescale.com> Thu, 20 Oct 2005 11:41:18 -0500

 arch/powerpc/kernel/prom.c |    4 ++++
 include/asm-powerpc/prom.h |   14 +++++++-------
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1133,8 +1133,10 @@ static int __init early_init_dt_scan_cho
 #ifdef CONFIG_PPC64
 	systemcfg->platform = *prop;
 #else
+#ifdef CONFIG_PPC_MULTIPLATFORM
 	_machine = *prop;
 #endif
+#endif
 
 #ifdef CONFIG_PPC64
 	/* check if iommu is forced on or off */
@@ -1971,6 +1973,7 @@ bus_space_to_resource_flags(unsigned int
 	}
 }
 
+#ifdef CONFIG_PCI
 static struct resource *find_parent_pci_resource(struct pci_dev* pdev,
 						 struct address_range *range)
 {
@@ -2123,3 +2126,4 @@ int release_OF_resource(struct device_no
 	return 0;
 }
 EXPORT_SYMBOL(release_OF_resource);
+#endif /* CONFIG_PCI */
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -104,8 +104,8 @@ struct reg_property32 {
 };
 
 struct reg_property64 {
-	unsigned long address;
-	unsigned long size;
+	u64 address;
+	u64 size;
 };
 
 struct property {
@@ -155,12 +155,12 @@ static inline void set_node_proc_entry(s
 
 
 /* OBSOLETE: Old style node lookup */
-extern struct device_node *find_devices(const char *name);
-extern struct device_node *find_type_devices(const char *type);
-extern struct device_node *find_path_device(const char *path);
-extern struct device_node *find_compatible_devices(const char *type,
+extern __deprecated struct device_node *find_devices(const char *name);
+extern __deprecated struct device_node *find_type_devices(const char *type);
+extern __deprecated struct device_node *find_path_device(const char *path);
+extern __deprecated struct device_node *find_compatible_devices(const char *type,
 						   const char *compat);
-extern struct device_node *find_all_nodes(void);
+extern __deprecated struct device_node *find_all_nodes(void);
 
 /* New style node lookup */
 extern struct device_node *of_find_node_by_name(struct device_node *from,

^ permalink raw reply

* [PATCH][RESEND] powerpc: merge include/asm-ppc*/checksum.h into include/asm-powerpc/checksum.h
From: Kumar Gala @ 2005-10-20 16:44 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, linuxppc64-dev

Signed-off-by: Kumar Gala <kumar.gala@freescale.com>

---
commit 5bb6a54bbcd717339f737eba160b6824ec99cd27
tree b23e814e1546aeceaa58ccfafc714a8cf0a13656
parent 1288b50c0dd4747595c5e73dbff02088d8eeefcc
author Kumar K. Gala <kumar.gala@freescale.com> Wed, 21 Sep 2005 14:10:11 -0500
committer Kumar K. Gala <kumar.gala@freescale.com> Wed, 21 Sep 2005 14:10:11 -0500

 include/asm-powerpc/checksum.h |  132 ++++++++++++++++++++++++++++++++++++++++
 include/asm-ppc/checksum.h     |  107 --------------------------------
 include/asm-ppc64/checksum.h   |  107 --------------------------------
 3 files changed, 132 insertions(+), 214 deletions(-)

diff --git a/include/asm-powerpc/checksum.h b/include/asm-powerpc/checksum.h
new file mode 100644
--- /dev/null
+++ b/include/asm-powerpc/checksum.h
@@ -0,0 +1,132 @@
+#ifndef _ASM_POWERPC_CHECKSUM_H
+#define _ASM_POWERPC_CHECKSUM_H
+
+/*
+ * 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 is a version of ip_compute_csum() optimized for IP headers,
+ * which always checksum on 4 octet boundaries.  ihl is the number
+ * of 32-bit words and is always >= 5.
+ */
+extern unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl);
+
+/*
+ * computes the checksum of the TCP/UDP pseudo-header
+ * returns a 16-bit checksum, already complemented
+ */
+extern unsigned short csum_tcpudp_magic(unsigned long saddr,
+					unsigned long daddr,
+					unsigned short len,
+					unsigned short proto,
+					unsigned int sum);
+
+/*
+ * computes the checksum of a memory block at buff, length len,
+ * and adds in "sum" (32-bit)
+ *
+ * returns a 32-bit number suitable for feeding into itself
+ * or csum_tcpudp_magic
+ *
+ * this function must be called with even lengths, except
+ * for the last fragment, which may be odd
+ *
+ * it's best to have buff aligned on a 32-bit boundary
+ */
+extern unsigned int csum_partial(const unsigned char * buff, int len,
+				 unsigned int sum);
+
+/*
+ * Computes the checksum of a memory block at src, length len,
+ * and adds in "sum" (32-bit), while copying the block to dst.
+ * If an access exception occurs on src or dst, it stores -EFAULT
+ * to *src_err or *dst_err respectively (if that pointer is not
+ * NULL), and, for an error on src, zeroes the rest of dst.
+ *
+ * Like csum_partial, this must be called with even lengths,
+ * except for the last fragment.
+ */
+extern unsigned int csum_partial_copy_generic(const char *src, char *dst,
+					      int len, unsigned int sum,
+					      int *src_err, int *dst_err);
+/*
+ * the same as csum_partial, but copies from src to dst while it
+ * checksums.
+ */
+unsigned int csum_partial_copy_nocheck(const char *src, 
+				       char *dst, 
+				       int len, 
+				       unsigned int sum);
+
+#define csum_partial_copy_from_user(src, dst, len, sum, errp)   \
+        csum_partial_copy_generic((src), (dst), (len), (sum), (errp), NULL)
+
+#define csum_partial_copy_nocheck(src, dst, len, sum)   \
+        csum_partial_copy_generic((src), (dst), (len), (sum), NULL, NULL)
+
+
+/*
+ * turns a 32-bit partial checksum (e.g. from csum_partial) into a
+ * 1's complement 16-bit checksum.
+ */
+static inline unsigned int csum_fold(unsigned int sum)
+{
+	unsigned int tmp;
+
+	/* swap the two 16-bit halves of sum */
+	__asm__("rlwinm %0,%1,16,0,31" : "=r" (tmp) : "r" (sum));
+	/* if there is a carry from adding the two 16-bit halves,
+	   it will carry from the lower half into the upper half,
+	   giving us the correct sum in the upper half. */
+	sum = ~(sum + tmp) >> 16;
+	return sum;
+}
+
+/*
+ * this routine is used for miscellaneous IP-like checksums, mainly
+ * in icmp.c
+ */
+static inline unsigned short ip_compute_csum(unsigned char * buff, int len)
+{
+	return csum_fold(csum_partial(buff, len, 0));
+}
+
+#ifdef __powerpc64__
+static inline u32 csum_tcpudp_nofold(u32 saddr,
+                                     u32 daddr,
+                                     unsigned short len,
+                                     unsigned short proto,
+                                     unsigned int sum)
+{
+	unsigned long s = sum;
+
+	s += saddr;
+	s += daddr;
+	s += (proto << 16) + len;
+	s += (s >> 32);
+	return (u32) s;
+}
+#else
+static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
+						   unsigned long daddr,
+						   unsigned short len,
+						   unsigned short proto,
+						   unsigned int sum)
+{
+    __asm__("\n\
+	addc %0,%0,%1 \n\
+	adde %0,%0,%2 \n\
+	adde %0,%0,%3 \n\
+	addze %0,%0 \n\
+	"
+	: "=r" (sum)
+	: "r" (daddr), "r"(saddr), "r"((proto<<16)+len), "0"(sum));
+    return sum;
+}
+
+#endif
+#endif
diff --git a/include/asm-ppc/checksum.h b/include/asm-ppc/checksum.h
deleted file mode 100644
--- a/include/asm-ppc/checksum.h
+++ /dev/null
@@ -1,107 +0,0 @@
-#ifdef __KERNEL__
-#ifndef _PPC_CHECKSUM_H
-#define _PPC_CHECKSUM_H
-
-
-/*
- * computes the checksum of a memory block at buff, length len,
- * and adds in "sum" (32-bit)
- *
- * returns a 32-bit number suitable for feeding into itself
- * or csum_tcpudp_magic
- *
- * this function must be called with even lengths, except
- * for the last fragment, which may be odd
- *
- * it's best to have buff aligned on a 32-bit boundary
- */
-extern unsigned int csum_partial(const unsigned char * buff, int len,
-				 unsigned int sum);
-
-/*
- * Computes the checksum of a memory block at src, length len,
- * and adds in "sum" (32-bit), while copying the block to dst.
- * If an access exception occurs on src or dst, it stores -EFAULT
- * to *src_err or *dst_err respectively (if that pointer is not
- * NULL), and, for an error on src, zeroes the rest of dst.
- *
- * Like csum_partial, this must be called with even lengths,
- * except for the last fragment.
- */
-extern unsigned int csum_partial_copy_generic(const char *src, char *dst,
-					      int len, unsigned int sum,
-					      int *src_err, int *dst_err);
-
-#define csum_partial_copy_from_user(src, dst, len, sum, errp)	\
-	csum_partial_copy_generic((__force void *)(src), (dst), (len), (sum), (errp), NULL)
-
-/* FIXME: this needs to be written to really do no check -- Cort */
-#define csum_partial_copy_nocheck(src, dst, len, sum)	\
-	csum_partial_copy_generic((src), (dst), (len), (sum), NULL, NULL)
-
-/*
- * turns a 32-bit partial checksum (e.g. from csum_partial) into a
- * 1's complement 16-bit checksum.
- */
-static inline unsigned int csum_fold(unsigned int sum)
-{
-	unsigned int tmp;
-
-	/* swap the two 16-bit halves of sum */
-	__asm__("rlwinm %0,%1,16,0,31" : "=r" (tmp) : "r" (sum));
-	/* if there is a carry from adding the two 16-bit halves,
-	   it will carry from the lower half into the upper half,
-	   giving us the correct sum in the upper half. */
-	sum = ~(sum + tmp) >> 16;
-	return sum;
-}
-
-/*
- * this routine is used for miscellaneous IP-like checksums, mainly
- * in icmp.c
- */
-static inline unsigned short ip_compute_csum(unsigned char * buff, int len)
-{
-	return csum_fold(csum_partial(buff, len, 0));
-}
-
-/*
- * FIXME: I swiped this one from the sparc and made minor modifications.
- * It may not be correct.  -- Cort
- */
-static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
-						   unsigned long daddr,
-						   unsigned short len,
-						   unsigned short proto,
-						   unsigned int sum)
-{
-    __asm__("\n\
-	addc %0,%0,%1 \n\
-	adde %0,%0,%2 \n\
-	adde %0,%0,%3 \n\
-	addze %0,%0 \n\
-	"
-	: "=r" (sum)
-	: "r" (daddr), "r"(saddr), "r"((proto<<16)+len), "0"(sum));
-    return sum;
-}
-
-/*
- * This is a version of ip_compute_csum() optimized for IP headers,
- * which always checksum on 4 octet boundaries.  ihl is the number
- * of 32-bit words and is always >= 5.
- */
-extern unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl);
-
-/*
- * computes the checksum of the TCP/UDP pseudo-header
- * returns a 16-bit checksum, already complemented
- */
-extern unsigned short csum_tcpudp_magic(unsigned long saddr,
-					unsigned long daddr,
-					unsigned short len,
-					unsigned short proto,
-					unsigned int sum);
-
-#endif
-#endif /* __KERNEL__ */
diff --git a/include/asm-ppc64/checksum.h b/include/asm-ppc64/checksum.h
deleted file mode 100644
--- a/include/asm-ppc64/checksum.h
+++ /dev/null
@@ -1,107 +0,0 @@
-#ifndef _PPC64_CHECKSUM_H
-#define _PPC64_CHECKSUM_H
-
-/*
- * 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 is a version of ip_compute_csum() optimized for IP headers,
- * which always checksum on 4 octet boundaries.  ihl is the number
- * of 32-bit words and is always >= 5.
- */
-extern unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl);
-
-/*
- * computes the checksum of the TCP/UDP pseudo-header
- * returns a 16-bit checksum, already complemented
- */
-extern unsigned short csum_tcpudp_magic(unsigned long saddr,
-					unsigned long daddr,
-					unsigned short len,
-					unsigned short proto,
-					unsigned int sum);
-
-/*
- * computes the checksum of a memory block at buff, length len,
- * and adds in "sum" (32-bit)
- *
- * returns a 32-bit number suitable for feeding into itself
- * or csum_tcpudp_magic
- *
- * this function must be called with even lengths, except
- * for the last fragment, which may be odd
- *
- * it's best to have buff aligned on a 32-bit boundary
- */
-extern unsigned int csum_partial(const unsigned char * buff, int len,
-				 unsigned int sum);
-
-/*
- * the same as csum_partial, but copies from src to dst while it
- * checksums
- */
-extern unsigned int csum_partial_copy_generic(const char *src, char *dst,
-					      int len, unsigned int sum,
-					      int *src_err, int *dst_err);
-/*
- * the same as csum_partial, but copies from src to dst while it
- * checksums.
- */
-
-unsigned int csum_partial_copy_nocheck(const char *src, 
-				       char *dst, 
-				       int len, 
-				       unsigned int sum);
-
-/*
- * turns a 32-bit partial checksum (e.g. from csum_partial) into a
- * 1's complement 16-bit checksum.
- */
-static inline unsigned int csum_fold(unsigned int sum)
-{
-	unsigned int tmp;
-
-	/* swap the two 16-bit halves of sum */
-	__asm__("rlwinm %0,%1,16,0,31" : "=r" (tmp) : "r" (sum));
-	/* if there is a carry from adding the two 16-bit halves,
-	   it will carry from the lower half into the upper half,
-	   giving us the correct sum in the upper half. */
-	sum = ~(sum + tmp) >> 16;
-	return sum;
-}
-
-/*
- * this routine is used for miscellaneous IP-like checksums, mainly
- * in icmp.c
- */
-static inline unsigned short ip_compute_csum(unsigned char * buff, int len)
-{
-	return csum_fold(csum_partial(buff, len, 0));
-}
-
-#define csum_partial_copy_from_user(src, dst, len, sum, errp)   \
-        csum_partial_copy_generic((src), (dst), (len), (sum), (errp), NULL)
-
-#define csum_partial_copy_nocheck(src, dst, len, sum)   \
-        csum_partial_copy_generic((src), (dst), (len), (sum), NULL, NULL)
-
-static inline u32 csum_tcpudp_nofold(u32 saddr,
-                                     u32 daddr,
-                                     unsigned short len,
-                                     unsigned short proto,
-                                     unsigned int sum)
-{
-	unsigned long s = sum;
-
-	s += saddr;
-	s += daddr;
-	s += (proto << 16) + len;
-	s += (s >> 32);
-	return (u32) s;
-}
-
-#endif

^ permalink raw reply

* v2.6.13.4 : Bad page state at prep_new_page when booting with quik
From: Marc Zyngier @ 2005-10-20 17:53 UTC (permalink / raw)
  To: linuxppc-dev

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

List,

I finally managed to bring back to life an old Apus 3000/200 (PowerMac
6400 clone, 603e@200, no L2 cache, 144MB RAM). Kernel is vanilla
2.6.13.4, userland is Debian Sarge.

The strange thing is : while the machine boots perfectly with BootX,
it fills the console with messages like this when booted from quik :

Bad page state at prep_new_page (in process 'S70nviboot', page c04301e0)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c00493cc] do_wp_page+0xdc/0x3cc
 [c004a6dc] __handle_mm_fault+0x154/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed

And no, rebooting doesn't help...

The system more or less manages to painfuly boot, still screaming on
the console. But the result is far from being usable.

Again, the very same kernel works perfectly when booted from BootX,
but I'd rather have the machine to stay headless, with serial console
hanging off the terminal server...

Does anyone have a clue, or at least a direction from where to start?

Thanks,

	M.


[-- Attachment #2: log --]
[-- Type: text/plain, Size: 22865 bytes --]


Second-stage QUIK loader
Welcome to quik. mate is good.
\chosen/bootargs = 
boot: ` 
Enter the kernel image name as [device:][partno]/path, where partno is a
number from 0 to 16.  Instead of /path you can type [mm-nn] to specify a
range of disk blocks (512B)
boot: v2.6.13.4
|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/initrd imagename = `, mem_size: 3267524
initrd_start: 

Inode error #2133571404 while loading file `.
initrd image not found....
Starting at 510000, , 9101312
no active packageopening display /valkyrie@F1000000... ok
copying OF device tree...done
Initializing fake screen: valkyrie
Calling quiesce ...
returning 0x00510000 from prom_init
Linux version 2.6.13.4 (maz@strange-fruit) (gcc version 3.3.5 (Debian 1:3.3.5-13)) #2 Sun Oct 16 20:36:15 CEST 2005
Found a OHare mac-io controller, rev: 1, mapped at 0xfdf00000
PowerMac motherboard: Alchemy
Cache coherency enabled for bandit/PSX
Found Bandit PCI host bridge at 0xf2000000. Firmware bus number: 0->0
nvram: OF partition at 0x1800
nvram: XP partition at 0x1300
nvram: NR partition at 0x1400
Built 1 zonelists
Kernel command line: root=/dev/hda6 ro root=/dev/hda6 console=ttyS0 console=tty0 
System has 32 possible interrupts
PID hash table entries: 1024 (order: 10, 16384 bytes)
GMT Delta read from XPRAM: 120 minutes, DST: on
via_calibrate_decr: ticks per jiffy = 10000 (600010 ticks)
Console: colour dummy device 80x25
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 142848k available (2056k kernel code, 1012k data, 140k init, 0k highmem)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
PCI: Probing PCI hardware
SCSI subsystem initialized
Monitor sense value = 0x603
using video mode 6 and color mode 0.
Console: switching to colour frame buffer device 80x30
fb0: valkyrie frame buffer device
Generic RTC Driver v1.07
Macintosh non-volatile memory driver v1.1
pmac_zilog: 0.6 (Benjamin Herrenschmidt <benh@kernel.crashing.org>)
ttyS0 at MMIO 0xf3013020 (irq = 15) is a Z85c30 ESCC - Serial port
ttyS1 at MMIO 0xf3013000 (irq = 16) is a Z85c30 ESCC - Serial port
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
fd0: SWIM3 floppy controller 
loop: loaded (max 8 devices)
PCI: Enabling device 0000:00:0f.0 (0014 -> 0017)
3c59x: Donald Becker and others. www.scyld.com/network/vortex.html
0000:00:0f.0: 3Com PCI 3c905B Cyclone 100baseTx at 0x400. Vers LK1.1.19
MacIO PCI driver attached to OHare chipset
Can't request resource 0 for MacIO device 0.f3000000:ohare
input: Macintosh mouse button emulation
Macintosh CUDA driver v0.5 for Unified ADB.
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
adb: starting probe task...
ide0: no intrs for device /bandit@F2000000/ohare@10/ATA@20000, using 13
ide0: Found Apple OHare ATA controller, bus ID 0, irq 13
ADB keyboard at 2, handler set to 3
Detected ADB keyboard, type ISO, swapping keys.
input: ADB keyboard on adb2:2.05/input
ADB mouse at 3, handler set to 2
input: ADB mouse on adb3:3.01/input
adb: finished probe task...
hda: SAMSUNG WINNER-3 WN32163A (2.1GB), ATA DISK drive
hda: Enabling MultiWord DMA 2
ide0 at 0xca10a000-0xca10a007,0xca10a160 on irq 13
hda: max request size: 128KiB
hda: 4219488 sectors (2160 MB) w/109KiB Cache, CHS=4186/16/63, DMA
hda: cache flushes not supported
 hda: [mac] hda1 hda2 hda3 hda4 hda5 hda6 hda7 hda8 hda9
mesh: configured for synchronous 5 MB/s
mesh: performing initial bus reset...
scsi0 : MESH
mesh: target 3 synchronous at 5.0 MB/s
  Vendor: MATSHITA  Model: CD-ROM CR-506     Rev: 8S05
  Type:   CD-ROM                             ANSI SCSI revision: 02
sr0: scsi-1 drive
Uniform CD-ROM driver Revision: 3.20
Attached scsi generic sg0 at scsi0, channel 0, id 3, lun 0,  type 5
mice: PS/2 mouse device common for all mice
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
kjournald starting.  Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.
Freeing unused kernel memory: 140k init 4k chrp 8k prep
Adding 131064k swap on /dev/hda7.  Priority:-1 extents:1
EXT3 FS on hda6, internal journal
NET: Registered protocol family 10
IPv6 over IPv4 tunneling driver
Bad page state at prep_new_page (in process 'S70nviboot', page c04301e0)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c00493cc] do_wp_page+0xdc/0x3cc
 [c004a6dc] __handle_mm_fault+0x154/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S70nviboot', page c0430200)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c00493cc] do_wp_page+0xdc/0x3cc
 [c004a6dc] __handle_mm_fault+0x154/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S70nviboot', page c0430220)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049fe0] do_anonymous_page+0x74/0x1b8
 [c004a190] do_no_page+0x6c/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S70nviboot', page c0430240)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049fe0] do_anonymous_page+0x74/0x1b8
 [c004a190] do_no_page+0x6c/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S70nviboot', page c0430260)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0039480] find_or_create_page+0xf4/0x108
 [c005c4d8] grow_dev_page+0x30/0x184
 [c005c6c8] __getblk_slow+0x9c/0x15c
 [c005cbd0] __getblk+0x54/0x5c
 [c009cffc] ext3_getblk+0xc0/0x27c
 [c009d1d0] ext3_bread+0x18/0xc0
 [c0099e60] ext3_readdir+0xe8/0x4d4
 [c006ec14] vfs_readdir+0xc8/0xf0
 [c006f1d8] sys_getdents64+0x78/0xe0
 [c00042a0] ret_from_syscall+0x0/0x44
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S70nviboot', page c0430280)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c00493cc] do_wp_page+0xdc/0x3cc
 [c004a6dc] __handle_mm_fault+0x154/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S70nviboot', page c04301c0)
flags:0x00000000 mapping:00000000 mapcount:1 count:0
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c00493cc] do_wp_page+0xdc/0x3cc
 [c004a6dc] __handle_mm_fault+0x154/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c04302a0)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c004a3bc] do_no_page+0x298/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c04302c0)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c004a3bc] do_no_page+0x298/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c04302e0)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049fe0] do_anonymous_page+0x74/0x1b8
 [c004a190] do_no_page+0x6c/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c0430300)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049fe0] do_anonymous_page+0x74/0x1b8
 [c004a190] do_no_page+0x6c/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c0430320)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c004a3bc] do_no_page+0x298/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c0430340)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c004a3bc] do_no_page+0x298/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c0430360)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049fe0] do_anonymous_page+0x74/0x1b8
 [c004a190] do_no_page+0x6c/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c0430380)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049fe0] do_anonymous_page+0x74/0x1b8
 [c004a190] do_no_page+0x6c/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c04303a0)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049600] do_wp_page+0x310/0x3cc
 [c004a6dc] __handle_mm_fault+0x154/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c04303c0)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049fe0] do_anonymous_page+0x74/0x1b8
 [c004a190] do_no_page+0x6c/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'kjournald', page c04303e0)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0039480] find_or_create_page+0xf4/0x108
 [c005c4d8] grow_dev_page+0x30/0x184
 [c005c6c8] __getblk_slow+0x9c/0x15c
 [c005cbd0] __getblk+0x54/0x5c
 [c00b2ea0] journal_get_descriptor_buffer+0x3c/0xa8
 [c00b005c] journal_commit_transaction+0xb88/0xea8
 [c00b2608] kjournald+0xc8/0x1bc
 [c0006cc4] kernel_thread+0x44/0x60
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c0430400)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049fe0] do_anonymous_page+0x74/0x1b8
 [c004a190] do_no_page+0x6c/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'kjournald', page c0430420)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0039480] find_or_create_page+0xf4/0x108
 [c005c4d8] grow_dev_page+0x30/0x184
 [c005c6c8] __getblk_slow+0x9c/0x15c
 [c005cbd0] __getblk+0x54/0x5c
 [c00b2ea0] journal_get_descriptor_buffer+0x3c/0xa8
 [c00af38c] journal_write_commit_record+0x48/0x190
 [c00af9dc] journal_commit_transaction+0x508/0xea8
 [c00b2608] kjournald+0xc8/0x1bc
 [c0006cc4] kernel_thread+0x44/0x60
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c0430440)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049fe0] do_anonymous_page+0x74/0x1b8
 [c004a190] do_no_page+0x6c/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c0430460)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049fe0] do_anonymous_page+0x74/0x1b8
 [c004a190] do_no_page+0x6c/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c0430480)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c000ef48] pte_alloc_one+0x24/0x64
 [c00480b0] pte_alloc_map+0x58/0xb0
 [c00481d4] copy_pte_range+0x44/0x230
 [c004847c] copy_page_range+0xbc/0x118
 [c001590c] copy_mm+0x264/0x388
 [c0016258] copy_process+0x3c4/0xb8c
 [c0016b3c] do_fork+0x6c/0x1cc
 [c0007350] sys_fork+0x4c/0x68
 [c00042a0] ret_from_syscall+0x0/0x44
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'start-stop-daem', page c0430620)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0040c44] __do_page_cache_readahead+0x130/0x168
 [c0040e20] blockable_page_cache_readahead+0x64/0xdc
 [c00410b0] page_cache_readahead+0x140/0x1a4
 [c0039c88] do_generic_mapping_read+0x574/0x57c
 [c0039f84] __generic_file_aio_read+0x1ec/0x220
 [c0039ff4] generic_file_aio_read+0x3c/0x5c
 [c005978c] do_sync_read+0xb8/0x10c
 [c00598a8] vfs_read+0xc8/0x1a0
 [c0065bec] kernel_read+0x40/0x58
 [c0066b1c] do_execve+0xe4/0x220
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'start-stop-daem', page c0430640)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0040c44] __do_page_cache_readahead+0x130/0x168
 [c0040e20] blockable_page_cache_readahead+0x64/0xdc
 [c00410b0] page_cache_readahead+0x140/0x1a4
 [c0039c88] do_generic_mapping_read+0x574/0x57c
 [c0039f84] __generic_file_aio_read+0x1ec/0x220
 [c0039ff4] generic_file_aio_read+0x3c/0x5c
 [c005978c] do_sync_read+0xb8/0x10c
 [c00598a8] vfs_read+0xc8/0x1a0
 [c0065bec] kernel_read+0x40/0x58
 [c0066b1c] do_execve+0xe4/0x220
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'start-stop-daem', page c0430660)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0040c44] __do_page_cache_readahead+0x130/0x168
 [c0040e20] blockable_page_cache_readahead+0x64/0xdc
 [c00410b0] page_cache_readahead+0x140/0x1a4
 [c0039c88] do_generic_mapping_read+0x574/0x57c
 [c0039f84] __generic_file_aio_read+0x1ec/0x220
 [c0039ff4] generic_file_aio_read+0x3c/0x5c
 [c005978c] do_sync_read+0xb8/0x10c
 [c00598a8] vfs_read+0xc8/0x1a0
 [c0065bec] kernel_read+0x40/0x58
 [c0066b1c] do_execve+0xe4/0x220
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'start-stop-daem', page c0430680)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0040c44] __do_page_cache_readahead+0x130/0x168
 [c0040e20] <7>eth0: no IPv6 routers present
blockable_page_cache_readahead+0x64/0xdc
 [c00410b0] page_cache_readahead+0x140/0x1a4
 [c0039c88] do_generic_mapping_read+0x574/0x57c
 [c0039f84] __generic_file_aio_read+0x1ec/0x220
 [c0039ff4] generic_file_aio_read+0x3c/0x5c
 [c005978c] do_sync_read+0xb8/0x10c
 [c00598a8] vfs_read+0xc8/0x1a0
 [c0065bec] kernel_read+0x40/0x58
 [c0066b1c] do_execve+0xe4/0x220
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'start-stop-daem', page c04306a0)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0040c44] __do_page_cache_readahead+0x130/0x168
 [c0040e20] blockable_page_cache_readahead+0x64/0xdc
 [c00410b0] page_cache_readahead+0x140/0x1a4
 [c0039c88] do_generic_mapping_read+0x574/0x57c
 [c0039f84] __generic_file_aio_read+0x1ec/0x220
 [c0039ff4] generic_file_aio_read+0x3c/0x5c
 [c005978c] do_sync_read+0xb8/0x10c
 [c00598a8] vfs_read+0xc8/0x1a0
 [c0065bec] kernel_read+0x40/0x58
 [c0066b1c] do_execve+0xe4/0x220
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'start-stop-daem', page c04306c0)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc

[-- Attachment #3: Type: text/plain, Size: 79 bytes --]


-- 
And if you don't know where you're going, any road will take you there...

^ permalink raw reply

* [PATCH] 85xx PHY Platform Update
From: Andy Fleming @ 2005-10-20 19:50 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linuxppc-embedded

This patch updates the 85xx platform code to support the new PHY Layer.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Kumar Gala <Kumar.gala@freescale.com>


diff --git a/arch/ppc/platforms/85xx/mpc8540_ads.c b/arch/ppc/platforms/85xx/mpc8540_ads.c
--- a/arch/ppc/platforms/85xx/mpc8540_ads.c
+++ b/arch/ppc/platforms/85xx/mpc8540_ads.c
@@ -53,6 +53,10 @@
 
 #include <syslib/ppc85xx_setup.h>
 
+static const char *GFAR_PHY_0 = "phy0:0";
+static const char *GFAR_PHY_1 = "phy0:1";
+static const char *GFAR_PHY_3 = "phy0:3";
+
 /* ************************************************************************
  *
  * Setup the architecture
@@ -64,6 +68,7 @@ mpc8540ads_setup_arch(void)
 	bd_t *binfo = (bd_t *) __res;
 	unsigned int freq;
 	struct gianfar_platform_data *pdata;
+	struct gianfar_mdio_data *mdata;
 
 	/* get the core frequency */
 	freq = binfo->bi_intfreq;
@@ -90,34 +95,35 @@ mpc8540ads_setup_arch(void)
 	invalidate_tlbcam_entry(num_tlbcam_entries - 1);
 #endif
 
+	/* setup the board related info for the MDIO bus */
+	mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC85xx_MDIO);
+
+	mdata->irq[0] = MPC85xx_IRQ_EXT5;
+	mdata->irq[1] = MPC85xx_IRQ_EXT5;
+	mdata->irq[2] = -1;
+	mdata->irq[3] = MPC85xx_IRQ_EXT5;
+	mdata->irq[31] = -1;
+	mdata->paddr += binfo->bi_immr_base;
+
 	/* setup the board related information for the enet controllers */
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
 	if (pdata) {
 		pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 0;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_0;
 		memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
 	}
 
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
 	if (pdata) {
 		pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 1;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_1;
 		memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
 	}
 
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_FEC);
 	if (pdata) {
 		pdata->board_flags = 0;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 3;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_3;
 		memcpy(pdata->mac_addr, binfo->bi_enet2addr, 6);
 	}
 
diff --git a/arch/ppc/platforms/85xx/mpc8560_ads.c b/arch/ppc/platforms/85xx/mpc8560_ads.c
--- a/arch/ppc/platforms/85xx/mpc8560_ads.c
+++ b/arch/ppc/platforms/85xx/mpc8560_ads.c
@@ -57,6 +57,10 @@
 #include <syslib/ppc85xx_setup.h>
 
 
+static const char *GFAR_PHY_0 = "phy0:0";
+static const char *GFAR_PHY_1 = "phy0:1";
+static const char *GFAR_PHY_3 = "phy0:3";
+
 /* ************************************************************************
  *
  * Setup the architecture
@@ -69,6 +73,7 @@ mpc8560ads_setup_arch(void)
 	bd_t *binfo = (bd_t *) __res;
 	unsigned int freq;
 	struct gianfar_platform_data *pdata;
+	struct gianfar_mdio_data *mdata;
 
 	cpm2_reset();
 
@@ -87,24 +92,28 @@ mpc8560ads_setup_arch(void)
 	mpc85xx_setup_hose();
 #endif
 
+	/* setup the board related info for the MDIO bus */
+	mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC85xx_MDIO);
+
+	mdata->irq[0] = MPC85xx_IRQ_EXT5;
+	mdata->irq[1] = MPC85xx_IRQ_EXT5;
+	mdata->irq[2] = -1;
+	mdata->irq[3] = MPC85xx_IRQ_EXT5;
+	mdata->irq[31] = -1;
+	mdata->paddr += binfo->bi_immr_base;
+
 	/* setup the board related information for the enet controllers */
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
 	if (pdata) {
 		pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 0;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_0;
 		memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
 	}
 
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
 	if (pdata) {
 		pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 1;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_1;
 		memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
 	}
 
diff --git a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
--- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
+++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
@@ -395,6 +395,9 @@ mpc85xx_cds_pcibios_fixup(void)
 
 TODC_ALLOC();
 
+static const char *GFAR_PHY_0 = "phy0:0";
+static const char *GFAR_PHY_1 = "phy0:1";
+
 /* ************************************************************************
  *
  * Setup the architecture
@@ -406,6 +409,7 @@ mpc85xx_cds_setup_arch(void)
 	bd_t *binfo = (bd_t *) __res;
 	unsigned int freq;
 	struct gianfar_platform_data *pdata;
+	struct gianfar_mdio_data *mdata;
 
 	/* get the core frequency */
 	freq = binfo->bi_intfreq;
@@ -449,44 +453,42 @@ mpc85xx_cds_setup_arch(void)
 	invalidate_tlbcam_entry(num_tlbcam_entries - 1);
 #endif
 
+	/* setup the board related info for the MDIO bus */
+	mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC85xx_MDIO);
+
+	mdata->irq[0] = MPC85xx_IRQ_EXT5;
+	mdata->irq[1] = MPC85xx_IRQ_EXT5;
+	mdata->irq[2] = -1;
+	mdata->irq[3] = -1;
+	mdata->irq[31] = -1;
+	mdata->paddr += binfo->bi_immr_base;
+
 	/* setup the board related information for the enet controllers */
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
 	if (pdata) {
 		pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 0;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_0;
 		memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
 	}
 
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
 	if (pdata) {
 		pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 1;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_1;
 		memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
 	}
 
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC1);
 	if (pdata) {
 		pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 0;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_0;
 		memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
 	}
 
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC2);
 	if (pdata) {
 		pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 1;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_1;
 		memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
 	}
 
diff --git a/arch/ppc/platforms/85xx/sbc8560.c b/arch/ppc/platforms/85xx/sbc8560.c
--- a/arch/ppc/platforms/85xx/sbc8560.c
+++ b/arch/ppc/platforms/85xx/sbc8560.c
@@ -92,6 +92,9 @@ sbc8560_early_serial_map(void)
 }
 #endif
 
+static const char *GFAR_PHY_25 = "phy0:25";
+static const char *GFAR_PHY_26 = "phy0:26";
+
 /* ************************************************************************
  *
  * Setup the architecture
@@ -103,6 +106,7 @@ sbc8560_setup_arch(void)
 	bd_t *binfo = (bd_t *) __res;
 	unsigned int freq;
 	struct gianfar_platform_data *pdata;
+	struct gianfar_mdio_data *mdata;
 
 	/* get the core frequency */
 	freq = binfo->bi_intfreq;
@@ -127,24 +131,26 @@ sbc8560_setup_arch(void)
 	invalidate_tlbcam_entry(num_tlbcam_entries - 1);
 #endif
 
+	/* setup the board related info for the MDIO bus */
+	mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC85xx_MDIO);
+
+	mdata->irq[25] = MPC85xx_IRQ_EXT6;
+	mdata->irq[26] = MPC85xx_IRQ_EXT7;
+	mdata->irq[31] = -1;
+	mdata->paddr += binfo->bi_immr_base;
+
 	/* setup the board related information for the enet controllers */
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
 	if (pdata) {
 		pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT6;
-		pdata->phyid = 25;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_25;
 		memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
 	}
 
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
 	if (pdata) {
 		pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT7;
-		pdata->phyid = 26;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_26;
 		memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
 	}
 
diff --git a/arch/ppc/platforms/85xx/stx_gp3.c b/arch/ppc/platforms/85xx/stx_gp3.c
--- a/arch/ppc/platforms/85xx/stx_gp3.c
+++ b/arch/ppc/platforms/85xx/stx_gp3.c
@@ -92,6 +92,9 @@ static u8 gp3_openpic_initsenses[] __ini
 	0x0,				/* External 11: */
 };
 
+static const char *GFAR_PHY_2 = "phy0:2";
+static const char *GFAR_PHY_4 = "phy0:4";
+
 /*
  * Setup the architecture
  */
@@ -101,6 +104,7 @@ gp3_setup_arch(void)
 	bd_t *binfo = (bd_t *) __res;
 	unsigned int freq;
 	struct gianfar_platform_data *pdata;
+	struct gianfar_mdio_data *mdata;
 
 	cpm2_reset();
 
@@ -119,23 +123,26 @@ gp3_setup_arch(void)
 	mpc85xx_setup_hose();
 #endif
 
+	/* setup the board related info for the MDIO bus */
+	mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC85xx_MDIO);
+
+	mdata->irq[2] = MPC85xx_IRQ_EXT5;
+	mdata->irq[4] = MPC85xx_IRQ_EXT5;
+	mdata->irq[31] = -1;
+	mdata->paddr += binfo->bi_immr_base;
+
 	/* setup the board related information for the enet controllers */
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
 	if (pdata) {
 	/*	pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; */
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 2;
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_2;
 		memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
 	}
 
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
 	if (pdata) {
 	/*	pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; */
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 4;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_4;
 		memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
 	}
 
diff --git a/arch/ppc/syslib/mpc85xx_devices.c b/arch/ppc/syslib/mpc85xx_devices.c
--- a/arch/ppc/syslib/mpc85xx_devices.c
+++ b/arch/ppc/syslib/mpc85xx_devices.c
@@ -25,19 +25,20 @@
 /* We use offsets for IORESOURCE_MEM since we do not know at compile time
  * what CCSRBAR is, will get fixed up by mach_mpc85xx_fixup
  */
+struct gianfar_mdio_data mpc85xx_mdio_pdata = {
+	.paddr = MPC85xx_MIIM_OFFSET,
+};
 
 static struct gianfar_platform_data mpc85xx_tsec1_pdata = {
 	.device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
 	    FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
 	    FSL_GIANFAR_DEV_HAS_MULTI_INTR,
-	.phy_reg_addr = MPC85xx_ENET1_OFFSET,
 };
 
 static struct gianfar_platform_data mpc85xx_tsec2_pdata = {
 	.device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
 	    FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
 	    FSL_GIANFAR_DEV_HAS_MULTI_INTR,
-	.phy_reg_addr = MPC85xx_ENET1_OFFSET,
 };
 
 static struct gianfar_platform_data mpc85xx_etsec1_pdata = {
@@ -46,7 +47,6 @@ static struct gianfar_platform_data mpc8
 	    FSL_GIANFAR_DEV_HAS_MULTI_INTR |
 	    FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN |
 	    FSL_GIANFAR_DEV_HAS_EXTENDED_HASH,
-	.phy_reg_addr = MPC85xx_ENET1_OFFSET,
 };
 
 static struct gianfar_platform_data mpc85xx_etsec2_pdata = {
@@ -55,7 +55,6 @@ static struct gianfar_platform_data mpc8
 	    FSL_GIANFAR_DEV_HAS_MULTI_INTR |
 	    FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN |
 	    FSL_GIANFAR_DEV_HAS_EXTENDED_HASH,
-	.phy_reg_addr = MPC85xx_ENET1_OFFSET,
 };
 
 static struct gianfar_platform_data mpc85xx_etsec3_pdata = {
@@ -64,7 +63,6 @@ static struct gianfar_platform_data mpc8
 	    FSL_GIANFAR_DEV_HAS_MULTI_INTR |
 	    FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN |
 	    FSL_GIANFAR_DEV_HAS_EXTENDED_HASH,
-	.phy_reg_addr = MPC85xx_ENET1_OFFSET,
 };
 
 static struct gianfar_platform_data mpc85xx_etsec4_pdata = {
@@ -73,11 +71,10 @@ static struct gianfar_platform_data mpc8
 	    FSL_GIANFAR_DEV_HAS_MULTI_INTR |
 	    FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN |
 	    FSL_GIANFAR_DEV_HAS_EXTENDED_HASH,
-	.phy_reg_addr = MPC85xx_ENET1_OFFSET,
 };
 
 static struct gianfar_platform_data mpc85xx_fec_pdata = {
-	.phy_reg_addr = MPC85xx_ENET1_OFFSET,
+	.device_flags = 0,
 };
 
 static struct fsl_i2c_platform_data mpc85xx_fsl_i2c_pdata = {
@@ -718,6 +715,12 @@ struct platform_device ppc_sys_platform_
 				.flags	= IORESOURCE_IRQ,
 			},
 		},
+	},
+	[MPC85xx_MDIO] = {
+		.name = "fsl-gianfar_mdio",
+		.id = 0,
+		.dev.platform_data = &mpc85xx_mdio_pdata,
+		.num_resources = 0,
 	},
 };
 
diff --git a/arch/ppc/syslib/mpc85xx_sys.c b/arch/ppc/syslib/mpc85xx_sys.c
--- a/arch/ppc/syslib/mpc85xx_sys.c
+++ b/arch/ppc/syslib/mpc85xx_sys.c
@@ -24,19 +24,19 @@ struct ppc_sys_spec ppc_sys_specs[] = {
 		.ppc_sys_name	= "8540",
 		.mask 		= 0xFFFF0000,
 		.value 		= 0x80300000,
-		.num_devices	= 10,
+		.num_devices	= 11,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_FEC, MPC85xx_IIC1,
 			MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
-			MPC85xx_PERFMON, MPC85xx_DUART,
+			MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8560",
 		.mask 		= 0xFFFF0000,
 		.value 		= 0x80700000,
-		.num_devices	= 19,
+		.num_devices	= 20,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_IIC1,
@@ -45,14 +45,14 @@ struct ppc_sys_spec ppc_sys_specs[] = {
 			MPC85xx_CPM_SPI, MPC85xx_CPM_I2C, MPC85xx_CPM_SCC1,
 			MPC85xx_CPM_SCC2, MPC85xx_CPM_SCC3, MPC85xx_CPM_SCC4,
 			MPC85xx_CPM_FCC1, MPC85xx_CPM_FCC2, MPC85xx_CPM_FCC3,
-			MPC85xx_CPM_MCC1, MPC85xx_CPM_MCC2,
+			MPC85xx_CPM_MCC1, MPC85xx_CPM_MCC2, MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8541",
 		.mask 		= 0xFFFF0000,
 		.value 		= 0x80720000,
-		.num_devices	= 13,
+		.num_devices	= 14,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_IIC1,
@@ -60,13 +60,14 @@ struct ppc_sys_spec ppc_sys_specs[] = {
 			MPC85xx_PERFMON, MPC85xx_DUART,
 			MPC85xx_CPM_SPI, MPC85xx_CPM_I2C,
 			MPC85xx_CPM_FCC1, MPC85xx_CPM_FCC2,
+			MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8541E",
 		.mask 		= 0xFFFF0000,
 		.value 		= 0x807A0000,
-		.num_devices	= 14,
+		.num_devices	= 15,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_IIC1,
@@ -74,13 +75,14 @@ struct ppc_sys_spec ppc_sys_specs[] = {
 			MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
 			MPC85xx_CPM_SPI, MPC85xx_CPM_I2C,
 			MPC85xx_CPM_FCC1, MPC85xx_CPM_FCC2,
+			MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8555",
 		.mask 		= 0xFFFF0000,
 		.value 		= 0x80710000,
-		.num_devices	= 19,
+		.num_devices	= 20,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_IIC1,
@@ -91,13 +93,14 @@ struct ppc_sys_spec ppc_sys_specs[] = {
 			MPC85xx_CPM_FCC1, MPC85xx_CPM_FCC2,
 			MPC85xx_CPM_SMC1, MPC85xx_CPM_SMC2,
 			MPC85xx_CPM_USB,
+			MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8555E",
 		.mask 		= 0xFFFF0000,
 		.value 		= 0x80790000,
-		.num_devices	= 20,
+		.num_devices	= 21,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_IIC1,
@@ -108,6 +111,7 @@ struct ppc_sys_spec ppc_sys_specs[] = {
 			MPC85xx_CPM_FCC1, MPC85xx_CPM_FCC2,
 			MPC85xx_CPM_SMC1, MPC85xx_CPM_SMC2,
 			MPC85xx_CPM_USB,
+			MPC85xx_MDIO,
 		},
 	},
 	/* SVRs on 8548 rev1.0 matches for 8548/8547/8545 */
@@ -115,104 +119,112 @@ struct ppc_sys_spec ppc_sys_specs[] = {
 		.ppc_sys_name	= "8548E",
 		.mask 		= 0xFFFF00F0,
 		.value 		= 0x80390010,
-		.num_devices	= 13,
+		.num_devices	= 14,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3,
 			MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2,
 			MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
 			MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
+			MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8548",
 		.mask 		= 0xFFFF00F0,
 		.value 		= 0x80310010,
-		.num_devices	= 12,
+		.num_devices	= 13,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3,
 			MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2,
 			MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
 			MPC85xx_PERFMON, MPC85xx_DUART,
+			MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8547E",
 		.mask 		= 0xFFFF00F0,
 		.value 		= 0x80390010,
-		.num_devices	= 13,
+		.num_devices	= 14,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3,
 			MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2,
 			MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
 			MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
+			MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8547",
 		.mask 		= 0xFFFF00F0,
 		.value 		= 0x80310010,
-		.num_devices	= 12,
+		.num_devices	= 13,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3,
 			MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2,
 			MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
 			MPC85xx_PERFMON, MPC85xx_DUART,
+			MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8545E",
 		.mask 		= 0xFFFF00F0,
 		.value 		= 0x80390010,
-		.num_devices	= 11,
+		.num_devices	= 12,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_eTSEC1, MPC85xx_eTSEC2,
 			MPC85xx_IIC1, MPC85xx_IIC2,
 			MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
 			MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
+			MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8545",
 		.mask 		= 0xFFFF00F0,
 		.value 		= 0x80310010,
-		.num_devices	= 10,
+		.num_devices	= 11,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_eTSEC1, MPC85xx_eTSEC2,
 			MPC85xx_IIC1, MPC85xx_IIC2,
 			MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
 			MPC85xx_PERFMON, MPC85xx_DUART,
+			MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8543E",
 		.mask 		= 0xFFFF00F0,
 		.value 		= 0x803A0010,
-		.num_devices	= 11,
+		.num_devices	= 12,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_eTSEC1, MPC85xx_eTSEC2,
 			MPC85xx_IIC1, MPC85xx_IIC2,
 			MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
 			MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
+			MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8543",
 		.mask 		= 0xFFFF00F0,
 		.value 		= 0x80320010,
-		.num_devices	= 10,
+		.num_devices	= 11,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_eTSEC1, MPC85xx_eTSEC2,
 			MPC85xx_IIC1, MPC85xx_IIC2,
 			MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
 			MPC85xx_PERFMON, MPC85xx_DUART,
+			MPC85xx_MDIO,
 		},
 	},
 	{	/* default match */
diff --git a/include/asm-ppc/mpc85xx.h b/include/asm-ppc/mpc85xx.h
--- a/include/asm-ppc/mpc85xx.h
+++ b/include/asm-ppc/mpc85xx.h
@@ -67,6 +67,8 @@ extern unsigned char __res[];
 #define MPC85xx_DMA3_SIZE	(0x00080)
 #define MPC85xx_ENET1_OFFSET	(0x24000)
 #define MPC85xx_ENET1_SIZE	(0x01000)
+#define MPC85xx_MIIM_OFFSET	(0x24520)
+#define MPC85xx_MIIM_SIZE	(0x00018)
 #define MPC85xx_ENET2_OFFSET	(0x25000)
 #define MPC85xx_ENET2_SIZE	(0x01000)
 #define MPC85xx_ENET3_OFFSET	(0x26000)
@@ -132,6 +134,7 @@ enum ppc_sys_devices {
 	MPC85xx_eTSEC3,
 	MPC85xx_eTSEC4,
 	MPC85xx_IIC2,
+	MPC85xx_MDIO,
 };
 
 /* Internal interrupts are all Level Sensitive, and Positive Polarity */
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -47,14 +47,19 @@
 struct gianfar_platform_data {
 	/* device specific information */
 	u32 device_flags;
-	u32 phy_reg_addr;
 
 	/* board specific information */
 	u32 board_flags;
-	u32 phy_flags;
-	u32 phyid;
-	u32 interruptPHY;
+	const char *bus_id;
 	u8 mac_addr[6];
+};
+
+struct gianfar_mdio_data {
+	/* device specific information */
+	u32 paddr;
+
+	/* board specific information */
+	int irq[32];
 };
 
 /* Flags related to gianfar device features */

^ permalink raw reply

* PowerPC/Linux device driver question
From: Madhu Saravana Sibi Govindan @ 2005-10-20 19:56 UTC (permalink / raw)
  To: linuxppc-dev

Hello all,

I'm trying to write a device driver in linux on a PowerPC processor.
The device has been allocated a range of addresses in the physical
address space of the processor (IBM 440GP) - from 0x100000000 -
0x13fffffff. (FYI, the 440GP is a 32 bit processor using 36 physical
addresses, the processor's MMU appends the extra 4 bits to get a
36-bit physical address).

I'm not sure how to request this range of physical memory from the
kernel. I thought I could use ioremap to map this range into the
virtual space, but ioremap takes only an unsigned long as an argument,
which is only 32 bits on 440GP. I don't think I can represent the range of =
my
device with 32 bits.

Could someone tell me how to solve the problem? I want this range of
physical addresses to be associated with my device driver and how do I
do that?

Thanks in advance,
G.Sibi

^ permalink raw reply

* Re: PowerPC/Linux device driver question
From: Matt Porter @ 2005-10-20 20:21 UTC (permalink / raw)
  To: Madhu Saravana Sibi Govindan; +Cc: linuxppc-dev
In-Reply-To: <513a5e60510201256k64c0e4fan1557c28a0bdf920c@mail.gmail.com>

On Thu, Oct 20, 2005 at 02:56:21PM -0500, Madhu Saravana Sibi Govindan wrote:
> I'm not sure how to request this range of physical memory from the
> kernel. I thought I could use ioremap to map this range into the
> virtual space, but ioremap takes only an unsigned long as an argument,
> which is only 32 bits on 440GP. I don't think I can represent the range of my
> device with 32 bits.
> 
> Could someone tell me how to solve the problem? I want this range of
> physical addresses to be associated with my device driver and how do I
> do that?

Use the ppc-specific ioremap64() call. 

-Matt

^ permalink raw reply

* Re: Starting the arch/powerpc merge
From: Paul Mackerras @ 2005-10-20 23:01 UTC (permalink / raw)
  To: Giuliano Pochini, linuxppc-dev, linuxppc64-dev
In-Reply-To: <17221.45591.341270.888791@cargo.ozlabs.ibm.com>

I wrote:

> Not really.  The main thing in the past has been that DRI with 32-bit
> X server and clients would work with a 32-bit kernel but not a 64-bit
> kernel, but that's fixed now.  A 64-bit kernel is faster on most
> lmbench tests.  I guess a 32-bit kernel might end up a little smaller,
> but that's the only possible advantage I can think of.

Oops, sorry, mail system breakage here...

Paul.

^ permalink raw reply

* Re: 8248 SEC
From: Kim Phillips @ 2005-10-20 16:05 UTC (permalink / raw)
  To: Wojciech Kromer; +Cc: linuxppc-embedded
In-Reply-To: <43577838.3070307@dgt.com.pl>

On Thu, 20 Oct 2005 03:58:00 -0700
"Wojciech Kromer" <wojciech.kromer@dgt.com.pl> wrote:

> Is there any driver for security-engine on mpc8248?
> If yes, what can it do? where can I found it?
> 
follow the mpc8272 links at:

http://www.metrowerks.com/MW/Develop/Embedded/Linux/DownloadBSP.htm

Kim
-- 

^ permalink raw reply

* Re: CHRP specifications
From: Hollis Blanchard @ 2005-10-20 23:33 UTC (permalink / raw)
  To: Sven Luther; +Cc: linuxppc-dev
In-Reply-To: <20051020151748.GB27704@localhost.localdomain>

On Oct 20, 2005, at 10:17 AM, Sven Luther wrote:
>
> BTW, anyone know of where to get the CHRP specs in downloadable html 
> or pdf or
> something format. Not the chrp OF bindings, but the real CHRP specs ?

I believe you've seen this before, but the link is still in the same 
place... http://penguinppc.org/otherhw/#chrp

As I recall, though, the CHRP specification mandates such obsolete 
features as an ADB controller, so claiming "CHRP compliance" may not be 
all that special these days. :)

-Hollis

^ permalink raw reply

* RE: How to make mudules on linux-ppc2.6.12
From: JohnsonCheng @ 2005-10-21  3:35 UTC (permalink / raw)
  To: linux-ppc-embedded

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

Dear Andy,

 

Thanks your reply. But I am sorry that it doesn't work on my box.

My kernel had been configured and compiled, and I also modify my Makefile as
following:

 

Obj-m := test.o

All:

  $(MAKE) ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.12.3
SUBDIRS=$(PWD) modules

 

The output message is the same as before, no error message and no test.ko
module.

 

 

Thanks,

Johnson Cheng

 

 

  _____  

From: JohnsonCheng [mailto:JohnsonCheng@qnap.com.tw] 
Sent: Thursday, October 20, 2005 6:57 PM
To: linux-ppc-embedded
Subject: How to make mudules on linux-ppc2.6.12

 

Dear All,

 

I just write a "hello world" module code, but I can't compile it for
ppc2.6.12.

My Makefile is list as following:

 

obj-m := test.o

all:

  make ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.12.3
SUBDIR=. modules

 

When I run make, no error message output, but I find no test.ko modules. The
output message is list as following:

 

make ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.1

2.3 SUBDIR=. modules

make[1]: Entering directory `/root/linux-2.6.12.3'

  CHK     include/linux/version.h

make[2]: `arch/ppc/kernel/asm-offsets.s' is up to date.

  Building modules, stage 2.

  MODPOST

make[1]: Leaving directory `/root/linux-2.6.12.3'

 

Do anyone can give me some help ?

 

Thanks,

Johnson Cheng

 


[-- Attachment #2: Type: text/html, Size: 10925 bytes --]

^ permalink raw reply

* Re: MPC7447A based board with MV64462 Marvell Discovery III controller
From: Kumar Gala @ 2005-10-21  3:50 UTC (permalink / raw)
  To: Sven Luther; +Cc: linuxppc-embedded
In-Reply-To: <20051020150450.GA27704@localhost.localdomain>

> Hey, we have code to boot the Freeserv with chrp/Of, need to clean  
> it up
> and
> merge it though. Would this be a good thing to submit for mainline
> inclusion,
> it is a couple of lines at most, altough there is some reuse of the
> interrupt
> controller code i think, which needs some cleanup.

Is this board available to anyone.  I dont believe Freescale plans on  
offering it.

- kumar

^ permalink raw reply

* Re: How to make mudules on linux-ppc2.6.12
From: White @ 2005-10-21  4:36 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <20051021034237.3B0A46861F@ozlabs.org>

Please try

obj-m += test.o

small case ! :)

good luck

Am Fri, 21 Oct 2005 11:35:51 +0800 schrieb "JohnsonCheng"
<JohnsonCheng@qnap.com.tw> :

> Dear Andy,
> 
>  
> 
> Thanks your reply. But I am sorry that it doesn't work on my box.
> 
> My kernel had been configured and compiled, and I also modify my Makefile as
> following:
> 
>  
> 
> Obj-m := test.o
> 
> All:
> 
>   $(MAKE) ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.12.3
> SUBDIRS=$(PWD) modules
> 
>  
> 
> The output message is the same as before, no error message and no test.ko
> module.
> 
>  
> 
>  
> 
> Thanks,
> 
> Johnson Cheng
> 
>  
> 
>  
> 
>   _____  
> 
> From: JohnsonCheng [mailto:JohnsonCheng@qnap.com.tw] 
> Sent: Thursday, October 20, 2005 6:57 PM
> To: linux-ppc-embedded
> Subject: How to make mudules on linux-ppc2.6.12
> 
>  
> 
> Dear All,
> 
>  
> 
> I just write a "hello world" module code, but I can't compile it for
> ppc2.6.12.
> 
> My Makefile is list as following:
> 
>  
> 
> obj-m := test.o
> 
> all:
> 
>   make ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.12.3
> SUBDIR=. modules
> 
>  
> 
> When I run make, no error message output, but I find no test.ko modules. The
> output message is list as following:
> 
>  
> 
> make ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.1
> 
> 2.3 SUBDIR=. modules
> 
> make[1]: Entering directory `/root/linux-2.6.12.3'
> 
>   CHK     include/linux/version.h
> 
> make[2]: `arch/ppc/kernel/asm-offsets.s' is up to date.
> 
>   Building modules, stage 2.
> 
>   MODPOST
> 
> make[1]: Leaving directory `/root/linux-2.6.12.3'
> 
>  
> 
> Do anyone can give me some help ?
> 
>  
> 
> Thanks,
> 
> Johnson Cheng
> 
>  
> 

^ permalink raw reply

* Re: v2.6.13.4 : Bad page state at prep_new_page when booting with quik
From: Benjamin Herrenschmidt @ 2005-10-21  4:38 UTC (permalink / raw)
  To: maz; +Cc: linuxppc-dev
In-Reply-To: <wrpll0of535.fsf@wild-wind.fr.eu.org>

On Thu, 2005-10-20 at 19:53 +0200, Marc Zyngier wrote:
> List,
> 
> I finally managed to bring back to life an old Apus 3000/200 (PowerMac
> 6400 clone, 603e@200, no L2 cache, 144MB RAM). Kernel is vanilla
> 2.6.13.4, userland is Debian Sarge.
> 
> The strange thing is : while the machine boots perfectly with BootX,
> it fills the console with messages like this when booted from quik :

Well, it definitely looks like something is wrong :) Not sure what's up
at this point. Could be cache coherency not properly enabled on PSX
memory controller by Open Firmware maybe ...

It would be useful if you could dump the memory controller registers
between an OF boot and a BootX boot.

Look at this bit in pmac_setup.c:

	sysctrl_regs = (volatile u32 *) ioremap(0xf8000000, 0x1000);
	ohare_init();

The first line maps those registers, the second line enables the L2
cache on PSX memory controller. (The name "ohare_init() is actually a
bit bogus here, since that has nothing to do with ohare, but we do it in
ohare based machines only... go figure, that's pre-historical code,
certainly predates my involvement here :).

I'd suggest dumping to 8 or so first words of sysctrl_regs and checking
what difference is there.

Then, there is another blob that enables cache coherency on the PCI side
of Bandit/PSX in pmac_pci.c in init_bandit(). But this code seems to be
called for you ...

It could be something else tho ... like some problem with quik...

Ben.

^ permalink raw reply

* RE: How to make mudules on linux-ppc2.6.12
From: JohnsonCheng @ 2005-10-21  4:48 UTC (permalink / raw)
  To: linux-ppc-embedded

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

Thanks for your kindly suggestion. I have found out the problem.

Just do some modification as following:

 

$(MAKE) ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.12.3
M=$(PWD) modules

 

Good Luck.!!

 

 

  _____  

From: JohnsonCheng [mailto:JohnsonCheng@qnap.com.tw] 
Sent: Friday, October 21, 2005 11:36 AM
To: linux-ppc-embedded
Subject: RE: How to make mudules on linux-ppc2.6.12

 

Dear Andy,

 

Thanks your reply. But I am sorry that it doesn't work on my box.

My kernel had been configured and compiled, and I also modify my Makefile as
following:

 

Obj-m := test.o

All:

  $(MAKE) ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.12.3
SUBDIRS=$(PWD) modules

 

The output message is the same as before, no error message and no test.ko
module.

 

 

Thanks,

Johnson Cheng

 

 

  _____  

From: JohnsonCheng [mailto:JohnsonCheng@qnap.com.tw] 
Sent: Thursday, October 20, 2005 6:57 PM
To: linux-ppc-embedded
Subject: How to make mudules on linux-ppc2.6.12

 

Dear All,

 

I just write a "hello world" module code, but I can't compile it for
ppc2.6.12.

My Makefile is list as following:

 

obj-m := test.o

all:

  make ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.12.3
SUBDIR=. modules

 

When I run make, no error message output, but I find no test.ko modules. The
output message is list as following:

 

make ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.1

2.3 SUBDIR=. modules

make[1]: Entering directory `/root/linux-2.6.12.3'

  CHK     include/linux/version.h

make[2]: `arch/ppc/kernel/asm-offsets.s' is up to date.

  Building modules, stage 2.

  MODPOST

make[1]: Leaving directory `/root/linux-2.6.12.3'

 

Do anyone can give me some help ?

 

Thanks,

Johnson Cheng

 


[-- Attachment #2: Type: text/html, Size: 14219 bytes --]

^ permalink raw reply

* status of kexec for ppc on 2.6.10, any gotchas?
From: Christopher Friesen @ 2005-10-21  5:03 UTC (permalink / raw)
  To: Linux Kernel Mailing List, linuxppc-dev


I've been asked to look at kexec for ppc on 2.6.10.  The syscall appears 
to be present, but there seem to be additional patches for 2.6.10-mm at:

http://www.xmission.com/~ebiederm/files/kexec/

Are these patches needed?

I haven't been able to find any current official documentation, although 
I found some old stuff from 2.5 and a writeup at:
 
http://www-128.ibm.com/developerworks/linux/library/l-kexec.html?ca=dgr-lnxw04RebootFast

Is there any official HOWTO on this?  Any issues I should look at in 
particular?

Thanks for any pointers,

Chris

^ permalink raw reply

* Re: CHRP specifications
From: Sven Luther @ 2005-10-21  5:18 UTC (permalink / raw)
  To: Hollis Blanchard; +Cc: linuxppc-dev
In-Reply-To: <f3b993b330f790b539e585aa89c399ab@penguinppc.org>

On Thu, Oct 20, 2005 at 06:33:18PM -0500, Hollis Blanchard wrote:
> On Oct 20, 2005, at 10:17 AM, Sven Luther wrote:
> >
> >BTW, anyone know of where to get the CHRP specs in downloadable html 
> >or pdf or
> >something format. Not the chrp OF bindings, but the real CHRP specs ?
> 
> I believe you've seen this before, but the link is still in the same 
> place... http://penguinppc.org/otherhw/#chrp

ah, yes, remember now,  i even already downloaded it :)

> As I recall, though, the CHRP specification mandates such obsolete 
> features as an ADB controller, so claiming "CHRP compliance" may not be 
> all that special these days. :)

still good for the other features and for documentation.

Friendly,

Sven Luther

^ permalink raw reply

* Re: Starting the arch/powerpc merge
From: Giuliano Pochini @ 2005-10-21  7:19 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, linuxppc64-dev
In-Reply-To: <17221.45591.341270.888791@cargo.ozlabs.ibm.com>


On 06-Oct-2005 Paul Mackerras wrote:

>> Out of curiosity, is there any advantage in using a 32 bits
>> kernel on ppc64 over a 64 bits kernel ?  Speed ?  Complexity ?
>> Compatibility ?  Memory ?
>
> Not really.  The main thing in the past has been that DRI with 32-bit
> X server and clients would work with a 32-bit kernel but not a 64-bit
> kernel, but that's fixed now.  A 64-bit kernel is faster on most
> lmbench tests.  I guess a 32-bit kernel might end up a little smaller,
> but that's the only possible advantage I can think of.

And 32<->64 bits compatibility layer for 32bits apps is not needed,
so maybe they run a bit faster. Well, at this point IMHO 32-on-64
support may be dropped without regrets. Spending time for an useless
thing is - uhm - useless.


> Oops, sorry, mail system breakage here...

My mail wasn't important anyway :))


--
Giuliano.

^ permalink raw reply

* Three-Speed Ethernet support on MPC8560 (CPM2 TSEC)
From: Nathael PAJANI @ 2005-10-21  8:05 UTC (permalink / raw)
  To: linuxppc-embedded

Hi all!

I'm working on a port of linux (2.6.13-2) on an Actis-computer board, 
based on the Freescale MPC8560 Processor.

I solved the problems I had with the init process, and I actually have 
the console (SCC1) and one ethernet controler (FCC3) running.

I will now go on with the Three-Speed Ethernet Controler, and there 
actually seem to be no support for it, but maybe I did not look at the 
right place?

I got another question, about the FCC driver: it uses a "big" structure 
"fcc_enet_t" wich seems to be aimed at stats. This is initialised, but I 
did not find where this is used. Is it?

Thanks.

^ permalink raw reply

* Support for MPC8548 processor
From: Rupesh S @ 2005-10-21  8:38 UTC (permalink / raw)
  To: linuxppc-embedded

Hi

Can anyone help me know if there exists any linux kernel that supports =
MPC8548 processor based boards ?
And if it exists, does the kernel support the PCI Express module that is =
there within MPC8548 ?

Thanks in advance


--
Rupesh S

^ permalink raw reply

* MPC8xx soft-float userspace ...
From: Schaefer-Hutter, Peter @ 2005-10-21  9:31 UTC (permalink / raw)
  To: linuxppc-embedded

Hello!

Due to the fact that the in-kernel FPU emulation looks=20
broken on MPC8xx i want to build a complete soft-float
userspace.

While i was successful in compiling a glibc with -mcpu=3D860
and soft-float (and without memset.S) there's still floating
point in there. Does anybody have some pointers what else
needs to be removed?

TIA and best regards,

 Peter=20

^ permalink raw reply

* kgdb support in Linux 2.6 for 8xx
From: Chris @ 2005-10-21 10:36 UTC (permalink / raw)
  To: linuxppc-embedded

Hi,

It would be nice to be able to do some kernel debugging on my TQM823L 
board running 2.6 (2.6.13.1, to be exact). I have two questions

1. Has anyone got kgdboe working in this configuration? If so, could you 
give me a pointer to a patch?

2. kgdb over serial is lacking the getDebugChar and putDebugChar 
functions that used to be in 8xx_io/uart.c. Has anyone done any work on 
merging them into 2.6?

[OK, that's actually three questions. One just crept in]

Thanks in advance,
Chris

^ permalink raw reply

* Re: status of kexec for ppc on 2.6.10, any gotchas?
From: R Sharada @ 2005-10-21 11:02 UTC (permalink / raw)
  To: Christopher Friesen; +Cc: linuxppc-dev, Linux Kernel Mailing List
In-Reply-To: <435876B8.9000706@nortel.com>


	Kexec support involves kernel level support per architecture and 
a user space kexec-tools.

	Generic kexec kernel support for ppc (ppc32/GameCube) was added 
sometime back by Albert Herranz, and I think they got included in 2.6.10-mm1 
as per:
http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.10/2.6.10-mm1/broken-out/
	 Albert's code was also posted on this site:
http://www.gc-linux.org/down/isobel/kexec/
	ppc64 kexec kernel support was added recently (2.6.12-rc4-mm1)
	Eric's site can be used for downloading the kexec-tools.
	
	You may want to cross post kexec discussion mails to fastboot@osdl.org,
as that is the primary list where all kexec discussions happen.

Hope this helps
Thanks and Regards,
Sharada

On Thu, Oct 20, 2005 at 11:03:52PM -0600, Christopher Friesen wrote:
> 
> I've been asked to look at kexec for ppc on 2.6.10.  The syscall appears 
> to be present, but there seem to be additional patches for 2.6.10-mm at:
> 
> http://www.xmission.com/~ebiederm/files/kexec/
> 
> Are these patches needed?
> 
> I haven't been able to find any current official documentation, although 
> I found some old stuff from 2.5 and a writeup at:
> 
> http://www-128.ibm.com/developerworks/linux/library/l-kexec.html?ca=dgr-lnxw04RebootFast
> 
> Is there any official HOWTO on this?  Any issues I should look at in 
> particular?
> 
> Thanks for any pointers,
> 
> Chris
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
> 

^ permalink raw reply

* Re: kgdb support in Linux 2.6 for 8xx
From: Vitaly Bordug @ 2005-10-21 12:15 UTC (permalink / raw)
  To: Chris; +Cc: linuxppc-embedded list
In-Reply-To: <4358C4AC.2070900@2net.co.uk>

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

Hi!
Chris wrote:
> Hi,
> 
> It would be nice to be able to do some kernel debugging on my TQM823L 
> board running 2.6 (2.6.13.1, to be exact). I have two questions
> 
> 1. Has anyone got kgdboe working in this configuration? If so, could you 
> give me a pointer to a patch?
> 
Not exactly. I have implemented support for KGDB on cpm_uart driven 
boards (most of 8xx use it), but it is only tested on 827x family. 
Anyway, 8xx should work with minimal changes.
> 2. kgdb over serial is lacking the getDebugChar and putDebugChar 
> functions that used to be in 8xx_io/uart.c. Has anyone done any work on 
> merging them into 2.6?
> 
There is a kgdb community project - http://kgdb.sf.net. The attached 
patch  is for this one (it has been submitted but not in the CVS so far).
> [OK, that's actually three questions. One just crept in]
> 
> Thanks in advance,
> Chris
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 
> 


-- 
Sincerely,
Vitaly

[-- Attachment #2: cpm_uart_kgdb.patch --]
[-- Type: text/x-patch, Size: 14395 bytes --]

This add support for KGDB using cpm_uart driver. 
Should work on all the boards utilizing it, tested on 8272ADS.

Index: linux-2.6.13.1/drivers/serial/cpm_uart/Makefile
===================================================================
--- linux-2.6.13.1.orig/drivers/serial/cpm_uart/Makefile
+++ linux-2.6.13.1/drivers/serial/cpm_uart/Makefile
@@ -7,5 +7,6 @@ obj-$(CONFIG_SERIAL_CPM) += cpm_uart.o
 # Select the correct platform objects.
 cpm_uart-objs-$(CONFIG_CPM2)	+= cpm_uart_cpm2.o
 cpm_uart-objs-$(CONFIG_8xx)	+= cpm_uart_cpm1.o
+cpm_uart-objs-$(CONFIG_KGDB)	+= cpm_uart_kgdb.o
 
 cpm_uart-objs	:= cpm_uart_core.o $(cpm_uart-objs-y)
Index: linux-2.6.13.1/drivers/serial/cpm_uart/cpm_uart.h
===================================================================
--- linux-2.6.13.1.orig/drivers/serial/cpm_uart/cpm_uart.h
+++ linux-2.6.13.1/drivers/serial/cpm_uart/cpm_uart.h
@@ -42,6 +42,38 @@
 
 #define SCC_WAIT_CLOSING 100
 
+#ifdef CONFIG_KGDB
+
+/* Speed of the debug UART. */
+#if defined(CONFIG_KGDB_9600BAUD)
+#define KGDB_BAUD B9600
+#elif defined(CONFIG_KGDB_19200BAUD)
+#define KGDB_BAUD B19200
+#elif defined(CONFIG_KGDB_38400BAUD)
+#define KGDB_BAUD B38400
+#elif defined(CONFIG_KGDB_57600BAUD)
+#define KGDB_BAUD B57600
+#else
+#define KGDB_BAUD B115200	/* Start with this if not given */
+#endif
+
+#ifdef CONFIG_KGDB_CPM_UART_SCC1
+#define KGDB_PINFO_INDEX 	UART_SCC1
+#elif CONFIG_KGDB_CPM_UART_SCC2
+#define KGDB_PINFO_INDEX	UART_SCC2
+#elif CONFIG_KGDB_CPM_UART_SCC3
+#define KGDB_PINFO_INDEX	UART_SCC3
+#elif CONFIG_KGDB_CPM_UART_SCC4
+#define KGDB_PINFO_INDEX	UART_SCC4
+#elif CONFIG_KGDB_CPM_UART_SMC1
+#define KGDB_PINFO_INDEX	UART_SMC1
+#elif CONFIG_KGDB_CPM_UART_SMC2
+#define KGDB_PINFO_INDEX	UART_SMC2
+#error The S(M)CC for kgdb console is undefined
+#endif
+
+#endif /* CONFIG_KGDB */
+
 struct uart_cpm_port {
 	struct uart_port	port;
 	u16			rx_nrfifos;
@@ -77,6 +109,9 @@ extern int cpm_uart_port_map[UART_NR];
 extern int cpm_uart_nr;
 extern struct uart_cpm_port cpm_uart_ports[UART_NR];
 
+void cpm_uart_early_write(int index, const char *s, u_int count);
+int cpm_uart_early_setup(int index,int early);
+
 /* these are located in their respective files */
 void cpm_line_cr_cmd(int line, int cmd);
 int cpm_uart_init_portdesc(void);
@@ -90,4 +125,19 @@ void scc2_lineif(struct uart_cpm_port *p
 void scc3_lineif(struct uart_cpm_port *pinfo);
 void scc4_lineif(struct uart_cpm_port *pinfo);
 
+static inline unsigned long cpu2cpm_addr(void *addr)
+{
+	if ((unsigned long)addr >= CPM_ADDR)
+		return (unsigned long)addr;
+	return virt_to_bus(addr);
+}
+
+static inline void *cpm2cpu_addr(unsigned long addr)
+{
+	if (addr >= CPM_ADDR)
+		return (void *)addr;
+	return bus_to_virt(addr);
+}
+
+
 #endif /* CPM_UART_H */
Index: linux-2.6.13.1/drivers/serial/cpm_uart/cpm_uart_core.c
===================================================================
--- linux-2.6.13.1.orig/drivers/serial/cpm_uart/cpm_uart_core.c
+++ linux-2.6.13.1/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -71,20 +71,6 @@ static void cpm_uart_initbd(struct uart_
 
 /**************************************************************/
 
-static inline unsigned long cpu2cpm_addr(void *addr)
-{
-	if ((unsigned long)addr >= CPM_ADDR)
-		return (unsigned long)addr;
-	return virt_to_bus(addr);
-}
-
-static inline void *cpm2cpu_addr(unsigned long addr)
-{
-	if (addr >= CPM_ADDR)
-		return (void *)addr;
-	return bus_to_virt(addr);
-}
-
 /*
  * Check, if transmit buffers are processed
 */
@@ -992,22 +978,17 @@ struct uart_cpm_port cpm_uart_ports[UART
 	},
 };
 
-#ifdef CONFIG_SERIAL_CPM_CONSOLE
-/*
- *	Print a string to the serial port trying not to disturb
- *	any possible real use of the port...
- *
- *	Note that this is called with interrupts already disabled
- */
-static void cpm_uart_console_write(struct console *co, const char *s,
+void cpm_uart_early_write(int index, const char *s,
 				   u_int count)
 {
-	struct uart_cpm_port *pinfo =
-	    &cpm_uart_ports[cpm_uart_port_map[co->index]];
+	struct uart_cpm_port *pinfo;
 	unsigned int i;
 	volatile cbd_t *bdp, *bdbase;
 	volatile unsigned char *cp;
 
+	BUG_ON(index>UART_NR);
+	pinfo = &cpm_uart_ports[index];
+
 	/* Get the address of the host memory buffer.
 	 */
 	bdp = pinfo->tx_cur;
@@ -1071,36 +1052,16 @@ static void cpm_uart_console_write(struc
 	pinfo->tx_cur = (volatile cbd_t *) bdp;
 }
 
-/*
- * Setup console. Be careful is called early !
- */
-static int __init cpm_uart_console_setup(struct console *co, char *options)
+int cpm_uart_early_setup(int index, int early)
 {
+	int ret;
 	struct uart_port *port;
 	struct uart_cpm_port *pinfo;
-	int baud = 38400;
-	int bits = 8;
-	int parity = 'n';
-	int flow = 'n';
-	int ret;
 
+	BUG_ON(index>UART_NR);
 	port =
-	    (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]];
+	    (struct uart_port *)&cpm_uart_ports[index];
 	pinfo = (struct uart_cpm_port *)port;
-
-	pinfo->flags |= FLAG_CONSOLE;
-
-	if (options) {
-		uart_parse_options(options, &baud, &parity, &bits, &flow);
-	} else {
-		bd_t *bd = (bd_t *) __res;
-
-		if (bd->bi_baudrate)
-			baud = bd->bi_baudrate;
-		else
-			baud = 9600;
-	}
-
 	/*
 	 * Setup any port IO, connect any baud rate generators,
 	 * etc.  This is expected to be handled by board
@@ -1108,7 +1069,6 @@ static int __init cpm_uart_console_setup
 	 */
 	if (pinfo->set_lineif)
 		pinfo->set_lineif(pinfo);
-
 	if (IS_SMC(pinfo)) {
 		pinfo->smcp->smc_smcm &= ~(SMCM_RX | SMCM_TX);
 		pinfo->smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
@@ -1116,8 +1076,7 @@ static int __init cpm_uart_console_setup
 		pinfo->sccp->scc_sccm &= ~(UART_SCCM_TX | UART_SCCM_RX);
 		pinfo->sccp->scc_gsmrl &= ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);
 	}
-
-	ret = cpm_uart_allocbuf(pinfo, 1);
+	ret = cpm_uart_allocbuf(pinfo, early);
 
 	if (ret)
 		return ret;
@@ -1129,6 +1088,56 @@ static int __init cpm_uart_console_setup
 	else
 		cpm_uart_init_scc(pinfo);
 
+	return 0;
+}
+
+#ifdef CONFIG_SERIAL_CPM_CONSOLE
+/*
+ *	Print a string to the serial port trying not to disturb
+ *	any possible real use of the port...
+ *
+ *	Note that this is called with interrupts already disabled
+ */
+
+static void cpm_uart_console_write(struct console *co, const char *s,
+				   u_int count)
+{
+	cpm_uart_early_write(cpm_uart_port_map[co->index],s,count);
+}
+
+/*
+ * Setup console. Be careful is called early !
+ */
+static int __init cpm_uart_console_setup(struct console *co, char *options)
+{
+	struct uart_port *port;
+	struct uart_cpm_port *pinfo;
+	int baud = 115200;
+	int bits = 8;
+	int parity = 'n';
+	int flow = 'n';
+	int ret;
+
+	port =
+	    (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]];
+	pinfo = (struct uart_cpm_port *)port;
+
+	pinfo->flags |= FLAG_CONSOLE;
+
+	if (options) {
+		uart_parse_options(options, &baud, &parity, &bits, &flow);
+	} else {
+		bd_t *bd = (bd_t *) __res;
+
+		if (bd->bi_baudrate)
+			baud = bd->bi_baudrate;
+		else
+			baud = 9600;
+	}
+
+	ret = cpm_uart_early_setup(cpm_uart_port_map[co->index], 1);
+	if(ret)
+		return ret;
 	uart_set_options(port, co, baud, parity, bits, flow);
 
 	return 0;
@@ -1190,6 +1199,10 @@ static int __init cpm_uart_init(void)
 
 	for (i = 0; i < cpm_uart_nr; i++) {
 		int con = cpm_uart_port_map[i];
+
+		/* We are not interested in ports yet utilized by kgdb */
+		if(con == KGDB_PINFO_INDEX)
+			continue;
 		cpm_uart_ports[con].port.line = i;
 		cpm_uart_ports[con].port.flags = UPF_BOOT_AUTOCONF;
 		uart_add_one_port(&cpm_reg, &cpm_uart_ports[con].port);
Index: linux-2.6.13.1/drivers/serial/cpm_uart/cpm_uart_cpm2.c
===================================================================
--- linux-2.6.13.1.orig/drivers/serial/cpm_uart/cpm_uart_cpm2.c
+++ linux-2.6.13.1/drivers/serial/cpm_uart/cpm_uart_cpm2.c
@@ -252,6 +252,10 @@ int cpm_uart_init_portdesc(void)
 {
 	pr_debug("CPM uart[-]:init portdesc\n");
 
+	/* Check if we have called this yet. This may happen if early kgdb
+	breakpoint is on */
+	if(cpm_uart_nr)
+		return 0;
 	cpm_uart_nr = 0;
 #ifdef CONFIG_SERIAL_CPM_SMC1
 	cpm_uart_ports[UART_SMC1].smcp = (smc_t *) & cpm2_immr->im_smc[0];
Index: linux-2.6.13.1/lib/Kconfig.debug
===================================================================
--- linux-2.6.13.1.orig/lib/Kconfig.debug
+++ linux-2.6.13.1/lib/Kconfig.debug
@@ -196,6 +196,7 @@ choice
 	default KGDB_8250_NOMODULE
 	default KGDB_SIBYTE if SIBYTE_SB1xxx_SOC
 	default KGDB_MPSC if SERIAL_MPSC
+	default KGDB_CPM_UART if (8xx || 8260)
 	help
 	  There are a number of different ways in which you can communicate
 	  with KGDB.  The most common is via serial, with the 8250 driver
@@ -221,6 +222,11 @@ config KGDB_8250_NOMODULE
 	  GDB.  This is independent of the normal (SERIAL_8250) driver
 	  for this chipset.
 
+config KGDB_CPM_UART
+ 	bool "KGDB: On CPM UART"
+ 	help
+ 	  Uses CPM UART to communicate with the host GDB.
+
 config KGDBOE_NOMODULE
 	bool "KGDB: On ethernet - in kernel"
 	select KGDBOE
@@ -247,6 +253,62 @@ config KGDB_SIBYTE
 
 endchoice
 
+choice
+ 	prompt "  SCC/SMC for KGDB console"
+ 	depends on KGDB_CPM_UART
+ 	default KGDB_CPM_UART_SCC4 if ADS8272
+
+config KGDB_CPM_UART_SCC1
+ 	bool "Use SCC1 for KGDB"
+ 	depends on SERIAL_CPM_SCC1
+
+config KGDB_CPM_UART_SCC2
+ 	bool "Use SCC2 for KGDB"
+ 	depends on SERIAL_CPM_SCC2
+
+config KGDB_CPM_UART_SCC3
+ 	bool "Use SCC3 for KGDB"
+ 	depends on SERIAL_CPM_SCC3
+
+config KGDB_CPM_UART_SCC4
+ 	bool "Use SCC4 for KGDB"
+ 	depends on SERIAL_CPM_SCC4
+
+config KGDB_CPM_UART_SMC1
+ 	bool "Use SMC1 for KGDB"
+ 	depends on SERIAL_CPM_SMC1
+
+config KGDB_CPM_UART_SMC2
+ 	bool "Use SMC2 for KGDB"
+ 	depends on SERIAL_CPM_SMC2
+
+endchoice
+
+choice
+	depends on KGDB && !KGDB_ETH
+    	prompt "Debug serial port BAUD"
+	default KGDB_115200BAUD
+	help
+	  gdb and the kernel stub need to agree on the baud rate to be
+	  used.  Standard rates from 9600 to 115200 are allowed, and this
+	  may be overridden via the commandline.
+
+config KGDB_9600BAUD
+	bool "9600"
+
+config KGDB_19200BAUD
+	bool "19200"
+
+config KGDB_38400BAUD
+	bool "38400"
+
+config KGDB_57600BAUD
+	bool "57600"
+
+config KGDB_115200BAUD
+	bool "115200"
+endchoice
+
 config KGDBOE
 	tristate "KGDB: On ethernet" if !KGDBOE_NOMODULE
 	depends on m && KGDB_ONLY_MODULES
Index: linux-2.6.13.1/drivers/serial/cpm_uart/cpm_uart_kgdb.c
===================================================================
--- /dev/null
+++ linux-2.6.13.1/drivers/serial/cpm_uart/cpm_uart_kgdb.c
@@ -0,0 +1,191 @@
+/*
+ * drivers/serial/cpm_uart/cpm_uart_kgdb.c
+ *
+ * CPM UART interface for kgdb.
+ *
+ * Author: Vitaly Bordug <vbordug@ru.mvista.com>
+ *
+ * Used some bits from drivers/serial/kgdb_8250.c as a template
+ *
+ * 2005 (c) MontaVista Software, Inc. This file is licensed under
+ * the terms of the GNU General Public License version 2. This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ */
+
+#include <linux/kgdb.h>
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/tty.h>
+#include <linux/serial.h>
+#include <linux/serial_core.h>
+#include <linux/serial_reg.h>
+
+#include <asm/io.h>
+#include <asm/serial.h>		/* For BASE_BAUD and SERIAL_PORT_DFNS */
+
+#include "cpm_uart.h"
+
+#define GDB_BUF_SIZE	512	/* power of 2, please */
+
+
+static char kgdb_buf[GDB_BUF_SIZE], *kgdbp;
+static int kgdb_chars;
+
+/* Forward declarations. */
+
+/*
+ * Receive character from the serial port.  This only works well
+ * before the port is initialize for real use.
+ */
+static int kgdb_wait_key(char *obuf)
+{
+	struct uart_cpm_port *pinfo;
+
+	u_char				c, *cp;
+	volatile	cbd_t		*bdp;
+	int				i;
+
+	pinfo = &cpm_uart_ports[KGDB_PINFO_INDEX];
+
+	/* Get the address of the host memory buffer.
+	 */
+	bdp = pinfo->rx_cur;
+	while (bdp->cbd_sc & BD_SC_EMPTY);
+
+	/* If the buffer address is in the CPM DPRAM, don't
+	 * convert it.
+	 */
+	cp = cpm2cpu_addr(bdp->cbd_bufaddr);
+
+	if (obuf) {
+		i = c = bdp->cbd_datlen;
+		while (i-- > 0)
+		{
+			*obuf++ = *cp++;
+		}
+	} else {
+		c = *cp;
+	}
+	bdp->cbd_sc |= BD_SC_EMPTY;
+
+	if (bdp->cbd_sc & BD_SC_WRAP) {
+		bdp = pinfo->rx_bd_base;
+	} else {
+		bdp++;
+	}
+	pinfo->rx_cur = (cbd_t *)bdp;
+
+	return((int)c);
+}
+
+
+/*
+ * Wait until the interface can accept a char, then write it.
+ */
+static void
+kgdb_put_debug_char(int chr)
+{
+	static char ch[2];
+	ch[0]=(char)chr;
+	cpm_uart_early_write(KGDB_PINFO_INDEX, ch, 1);
+}
+
+
+/*
+ * Get a char if available, return -1 if nothing available.
+ * Empty the receive buffer first, then look at the interface hardware.
+ */
+static int
+kgdb_get_debug_char(void)
+{
+	if (kgdb_chars<=0) {
+		kgdb_chars = kgdb_wait_key(kgdb_buf);
+		kgdbp = kgdb_buf;
+	}
+	kgdb_chars--;
+
+	return (*kgdbp++);
+}
+
+static void termios_set_options(int index,
+		 int baud, int parity, int bits, int flow)
+{
+	struct termios termios;
+	struct uart_port *port;
+	struct uart_cpm_port *pinfo;
+
+	BUG_ON(index>UART_NR);
+
+	port =
+	    (struct uart_port *)&cpm_uart_ports[index];
+	pinfo = (struct uart_cpm_port *)port;
+
+	/*
+	 * Ensure that the serial console lock is initialised
+	 * early.
+	 */
+	spin_lock_init(&port->lock);
+
+	memset(&termios, 0, sizeof(struct termios));
+
+	termios.c_cflag = CREAD | HUPCL | CLOCAL;
+
+	termios.c_cflag |= baud;
+
+	if (bits == 7)
+		termios.c_cflag |= CS7;
+	else
+		termios.c_cflag |= CS8;
+
+	switch (parity) {
+	case 'o': case 'O':
+		termios.c_cflag |= PARODD;
+		/*fall through*/
+	case 'e': case 'E':
+		termios.c_cflag |= PARENB;
+		break;
+	}
+
+	if (flow == 'r')
+		termios.c_cflag |= CRTSCTS;
+
+	port->ops->set_termios(port, &termios, NULL);
+}
+
+/*
+ *  Returns:
+ *	0 on success, 1 on failure.
+ */
+static int kgdb_init(void)
+{
+	struct uart_port *port;
+	struct uart_cpm_port *pinfo;
+
+	int use_bootmem = 0; /* use dma by default */
+
+	if(!cpm_uart_nr)
+	{
+		use_bootmem = 1;
+		cpm_uart_init_portdesc();
+	}
+	port = (struct uart_port *)&cpm_uart_ports[KGDB_PINFO_INDEX];
+	pinfo = (struct uart_cpm_port *)port;
+
+	if (cpm_uart_early_setup(KGDB_PINFO_INDEX, use_bootmem))
+		return 1;
+
+	termios_set_options(KGDB_PINFO_INDEX, KGDB_BAUD,'n',8,'n');
+	pinfo->sccp->scc_sccm |= UART_SCCM_TX;
+	return 0;
+}
+
+
+struct kgdb_io kgdb_io_ops = {
+	.read_char = kgdb_get_debug_char,
+	.write_char = kgdb_put_debug_char,
+	.init = kgdb_init,
+};
+

^ permalink raw reply


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