LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Problems porting to a custom PPC405GPr board using a vanilla 2.6.10 kernel
From: Niklaus Giger @ 2005-02-26 22:28 UTC (permalink / raw)
  To: linuxppc-embedded

Hi

I would like to port Linux to a custom PPC405GPr board. Its hardware runs=20
vxWorks fine for more than a year.=20

Within a few days I had a working U-boot image, which allows me to download=
=20
via TFTP Linux-kernels.

I started with a vanilla 2.6.10 kernel, added the entries in the=20
arch/ppc/platforms/4xx/Makefile and Kconfig, two file hcu3.c and hcu3.h whi=
ch=20
are very minimal. The board has no PCI and I do not want to add support for=
=20
the CFI-Flashs or the onboard CAN-Chips.=20
Enabling the SERIAL_TEXT_DEBUG I got the following output
## Transferring control to Linux (at address 00000000) ...
id mach(): done
MMU:enter
MMU:hw init
MMU:mapin
MMU:setio
hcu3_map_io
MMU:exit
setup_arch: enter ngng
setup_arch: bootmem
ocp: exit
arch: exit
If I attach a BDI, I get a lot of "- TARGET: target has entered debug mode"=
=20
lines and then
DI>i
    Target state      : debug mode
    Debug entry cause : unconditional debug event
    Current PC        : 0xfffffffc
    Current CR        : 0x00000000
    Current MSR       : 0x00000000
    Current LR        : 0xc019a15c
BDI>               =20
The corresponding line from my System.map are
c0199e20 t free_bootmem_core
c0199ecc t __alloc_bootmem_core
c019a278 t free_all_bootmem_core
c019a4c8 T init_bootmem_node

My board has no RTC. Is this a problem?=20

Should I start with another kernel? Can anybody point me to a known good=20
kernel version for a specific PPC405 board?

Any hint would be greatly appreciated.

Best regards

=2D-=20
Niklaus Giger
Wieshoschet 6
CH-8753 Mollis
Tel. ++41 55 612 20 54 (privat)
Tel. ++41 55 618 64 68 (Gesch=E4ft)

^ permalink raw reply

* Re: [PATCH] ppc32: pmac sleep support update
From: Olaf Hering @ 2005-02-26 11:28 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Andrew Morton, linuxppc-dev list, Linus Torvalds
In-Reply-To: <1106011958.4533.25.camel@gaston>

 On Tue, Jan 18, Benjamin Herrenschmidt wrote:


> +++ linux-work/arch/ppc/platforms/pmac_cache.S	2005-01-18 12:01:49.000000000 +1100

> +	b	__flush_disable_L1

This one is only available for CONFIG_6xx, so g5 32bit users will
scream. (not that I care)

arch/ppc/platforms/built-in.o(.text+0x1228): In function `flush_disable_caches':
: undefined reference to `__flush_disable_L1'

^ permalink raw reply

* Re: [PATCH 2.6.10-rc3][PPC32] Fix Motorola PReP (PowerstackII Utah) PCI IRQ map
From: Sven Luther @ 2005-02-26  6:04 UTC (permalink / raw)
  To: Christian
  Cc: Tom Rini, Meelis Roos, Kernel Mailing List, linuxppc-dev,
	Sven Hartge
In-Reply-To: <421FEF81.2070806@g-house.de>

On Sat, Feb 26, 2005 at 04:39:45AM +0100, Christian wrote:
> Sven Luther wrote:
> >Some backports that i got from the list. The complete list of patches is 
> >at :
> >
> >  http://svn.debian.org/wsvn/kernel/trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/?rev=0&sc=0
> 
> dooh, these websvn patches are giving me a headache.... will have to 
> learn /usr/bin/svn first :-\

Well : 

  svn co svn://svn.debian.org/kernel/trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches

> >--- kernel-source-2.6.8.orig/arch/ppc/platforms/prep_pci.c	2004-12-28
> 
> yes, the prep_pci.c and its irq-mappings. the PowerStackII lines were 
> changed back and forth, and a current 2.6-BK is only different in one 
> line to the patch you mentioned:

I guess the one line is the one for the IDE device, ..., indeed. The one line
in question is to enable the onboard IDE controller, which exist but is
probably not used, since the place on the board where it should be has no
connector soldered. I hear that there is an IDE powerstack II model though, so
...

> http://nerdbynature.de/bits/hal/2.6.11-rc5.patched/powerpc-prep-powerstack-irq_2.6.11-rc5.patch
> 
> unfortunately it did not help either and i'll switch back to vanilla 
> 2.6.8 again and hopefully find out exactly when scsi stopped working.

As i understand leigh's and other post, i believe that this is the fix, but
that other stuff went in too which did break.

> http://nerdbynature.de/bits/hal/2.6.11-rc5/
> http://nerdbynature.de/bits/hal/2.6.11-rc5.patched/

Friendly,

Sven Luther

^ permalink raw reply

* Re: [PATCH 2.6.10-rc3][PPC32] Fix Motorola PReP (PowerstackII Utah) PCI IRQ map
From: Christian @ 2005-02-26  3:39 UTC (permalink / raw)
  To: Sven Luther
  Cc: Tom Rini, Meelis Roos, Sven Hartge, Kernel Mailing List,
	linuxppc-dev
In-Reply-To: <20050225121536.GA20174@pegasos>

Sven Luther wrote:
> Some backports that i got from the list. The complete list of patches is at :
> 
>   http://svn.debian.org/wsvn/kernel/trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/?rev=0&sc=0

dooh, these websvn patches are giving me a headache.... will have to 
learn /usr/bin/svn first :-\


> --- kernel-source-2.6.8.orig/arch/ppc/platforms/prep_pci.c	2004-12-28

yes, the prep_pci.c and its irq-mappings. the PowerStackII lines were 
changed back and forth, and a current 2.6-BK is only different in one 
line to the patch you mentioned:

http://nerdbynature.de/bits/hal/2.6.11-rc5.patched/powerpc-prep-powerstack-irq_2.6.11-rc5.patch

unfortunately it did not help either and i'll switch back to vanilla 
2.6.8 again and hopefully find out exactly when scsi stopped working.

http://nerdbynature.de/bits/hal/2.6.11-rc5/
http://nerdbynature.de/bits/hal/2.6.11-rc5.patched/


thank you for your concern,
Christian.

^ permalink raw reply

* Re: 2.6 4xx GPIO OCP driver?
From: Matt Porter @ 2005-02-26  0:29 UTC (permalink / raw)
  To: Ralph Siemsen; +Cc: ppcembed
In-Reply-To: <421F966D.4060206@rossvideo.com>

On Fri, Feb 25, 2005 at 04:19:41PM -0500, Ralph Siemsen wrote:
> Matt Porter wrote:
> 
> > I didn't bother merging it upstream at one time. It wasn't clear
> > if the driver had any value over just mmaping /dev/mem to bang
> > on the couple gpio registers directly. [...]
> 
> Will that work on the 440 where the devices sit above 4GB mark?  Or must 
> one rely on there being an existing TLB mapping to bring them into 
> 32-bit space?

Ack...that's the one thing we are missing. :-/ I had forgotten
that driver/char/mem.c  calls remap_pfn_range() directly rather
than io_remap_page_range(). Had it called the latter, we'd be OK
since the "bigphys" fixup could take place.  We can fix /dev/mem to
call io_remap_page_range() when on ppc32 && 36-bit phys...other arches
do similar tricks in that driver.

If everybody is happy with mmaping /dev/mem then we can go try that
route.

-Matt

^ permalink raw reply

* Re: 2.6 4xx GPIO OCP driver?
From: Ralph Siemsen @ 2005-02-25 21:19 UTC (permalink / raw)
  To: Matt Porter; +Cc: ppcembed
In-Reply-To: <20050225133055.A28918@cox.net>

Matt Porter wrote:

> I didn't bother merging it upstream at one time. It wasn't clear
> if the driver had any value over just mmaping /dev/mem to bang
> on the couple gpio registers directly. [...]

Will that work on the 440 where the devices sit above 4GB mark?  Or must 
one rely on there being an existing TLB mapping to bring them into 
32-bit space?

-Ralph

^ permalink raw reply

* Re: 2.6 4xx GPIO OCP driver?
From: Travis B. Sawyer @ 2005-02-25 20:51 UTC (permalink / raw)
  To: Matt Porter; +Cc: ppcembed
In-Reply-To: <20050225133055.A28918@cox.net>

Matt Porter wrote:
> On Fri, Feb 25, 2005 at 03:25:04PM -0500, Travis B. Sawyer wrote:
> 
>>Steven Blakeslee wrote:
>>>>In 2.4 we used the drivers/char/ibm_ocp_gpio.c module.  I see 
>>>>no such support in 2.6.10.  I perused the archives, found 
>>>>nothing
>>>I see it.  Drivers/char/ibm_gpio.c in Linux 2.6.10-rc3.
>>
<SNIPPAGE above>
> I didn't bother merging it upstream at one time. It wasn't clear
> if the driver had any value over just mmaping /dev/mem to bang
> on the couple gpio registers directly.

Matt:

Good point, and that'll work for 2.4 also, which means I don't have to 
support different usercode btw the two versions of the kernel.

Thanx,

Travis

^ permalink raw reply

* Re: 2.6 4xx GPIO OCP driver?
From: Matt Porter @ 2005-02-25 20:30 UTC (permalink / raw)
  To: Travis B. Sawyer; +Cc: Steven Blakeslee, ppcembed
In-Reply-To: <421F89A0.8070502@sandburst.com>

On Fri, Feb 25, 2005 at 03:25:04PM -0500, Travis B. Sawyer wrote:
> Steven Blakeslee wrote:
> >>In 2.4 we used the drivers/char/ibm_ocp_gpio.c module.  I see 
> >>no such support in 2.6.10.  I perused the archives, found 
> >>nothing (OBTW: can someone point me to the search engine for 
> >>the list?)
> > 
> > 
> > I see it.  Drivers/char/ibm_gpio.c in Linux 2.6.10-rc3.
> 
> I guess I should be using the linuxppc-2.5 tree instead of straight from
> kernel.org.

I didn't bother merging it upstream at one time. It wasn't clear
if the driver had any value over just mmaping /dev/mem to bang
on the couple gpio registers directly. We can get it in real
2.6 if people really find it more convenient. My only argument
against it is that it's not much of a layer over the trivial
registers and each SoC requires completely different support
since the pin routings are SoC specific.

Anyway, just speak up. ;)

-Matt

^ permalink raw reply

* Re: 2.6 4xx GPIO OCP driver?
From: Travis B. Sawyer @ 2005-02-25 20:25 UTC (permalink / raw)
  To: Steven Blakeslee; +Cc: ppcembed
In-Reply-To: <1628E43D99629C46988BE46087A3FBB91C4AA7@ep-01.EmbeddedPlanet.local>

Steven Blakeslee wrote:
>>In 2.4 we used the drivers/char/ibm_ocp_gpio.c module.  I see 
>>no such support in 2.6.10.  I perused the archives, found 
>>nothing (OBTW: can someone point me to the search engine for 
>>the list?)
> 
> 
> I see it.  Drivers/char/ibm_gpio.c in Linux 2.6.10-rc3.

I guess I should be using the linuxppc-2.5 tree instead of straight from
kernel.org.

Oopsie.

-travis

^ permalink raw reply

* RE: 2.6 4xx GPIO OCP driver?
From: Steven Blakeslee @ 2005-02-25 19:40 UTC (permalink / raw)
  To: tsawyer+linuxppc, ppcembed

> In 2.4 we used the drivers/char/ibm_ocp_gpio.c module.  I see=20
> no such support in 2.6.10.  I perused the archives, found=20
> nothing (OBTW: can someone point me to the search engine for=20
> the list?)

I see it.  Drivers/char/ibm_gpio.c in Linux 2.6.10-rc3.

^ permalink raw reply

* Re: PowerPC4xx Watchdog
From: Takeharu KATO @ 2005-02-25 19:35 UTC (permalink / raw)
  To: Matt Porter; +Cc: ppcembed
In-Reply-To: <20050223142720.C13087@cox.net>

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

Hi Matt

> Are you looking for the old "ppc405 watchdog" driver that simply
> hooked into the generic PPC heartbeat facility? Or are you looking
> for a driver that utilizes the 4xx/booke hardware watchdog facility?
> 
After all, I wrote watch dog driver for PowerPC 4xx using 4xx/book-e 
watchdog facility and generic PPC heartbeat mechanism.

On second thought, I found that these are almost same.
As far as I think generic PPC heartbeat mechanism is more preferable
for embedded systems from memory consumption view at least.

Using generic PPC heartbeat mechanism can make the driver simple and small.
And more, this approach can achieve following profits:

1) The approach may not need modification in low-exception handling routines
(in arch/ppc/kernel/head_XXX).
2) The approach can achieve compatibility with old-driver.

Any way, I attached current version of my patch.
Please take a look on the patch.

P.S.
I found critical interrupt relevant trivial bug in 
arch/ppc/kernel/head_booke.h.
CRITICAL_EXCEPTION macro in the file use transfer_to_handler_full and
ret_from_except_full.
IMHO, The correct code is that this macro should use 
crit_transfer_to_handler, ret_from_crit_exc instead, isn't it?

Regards,

-- 
Takeharu KATO

[-- Attachment #2: ppc4xx_wdt.patch --]
[-- Type: text/plain, Size: 29080 bytes --]

diff -uprN linux-2.6.11-rc4.orig/arch/ppc/kernel/head_44x.S linux-2.6.11-rc4/arch/ppc/kernel/head_44x.S
--- linux-2.6.11-rc4.orig/arch/ppc/kernel/head_44x.S	2005-02-22 12:59:33.000000000 +0900
+++ linux-2.6.11-rc4/arch/ppc/kernel/head_44x.S	2005-02-26 02:48:31.000000000 +0900
@@ -444,8 +444,13 @@ interrupt_base:
 	EXCEPTION(0x1010, FixedIntervalTimer, UnknownException, EXC_XFER_EE)
 
 	/* Watchdog Timer Interrupt */
-	/* TODO: Add watchdog support */
+#if defined(CONFIG_PPC4xx_WATCHDOG) && !defined(CONFIG_PPC4xx_WATCHDOG_COMPAT)
+	CRITICAL_EXCEPTION(0x1020, WatchdogTimer, ppc4xx_wdt_interrupt)
+#else
 	CRITICAL_EXCEPTION(0x1020, WatchdogTimer, UnknownException)
+#endif
+
+
 
 	/* Data TLB Error Interrupt */
 	START_EXCEPTION(DataTLBError)
diff -uprN linux-2.6.11-rc4.orig/arch/ppc/kernel/head_4xx.S linux-2.6.11-rc4/arch/ppc/kernel/head_4xx.S
--- linux-2.6.11-rc4.orig/arch/ppc/kernel/head_4xx.S	2005-02-22 12:59:33.000000000 +0900
+++ linux-2.6.11-rc4/arch/ppc/kernel/head_4xx.S	2005-02-26 02:48:31.000000000 +0900
@@ -477,19 +477,23 @@ label:
 
 #if 0
 /* NOTE:
- * FIT and WDT handlers are not implemented yet.
+ * FIT handlers are not implemented yet.
  */
 
 /* 0x1010 - Fixed Interval Timer (FIT) Exception
 */
 	STND_EXCEPTION(0x1010,	FITException,		UnknownException)
 
+#endif
+
 /* 0x1020 - Watchdog Timer (WDT) Exception
 */
-
+#if defined(CONFIG_PPC4xx_WATCHDOG) && !defined(CONFIG_PPC4xx_WATCHDOG_COMPAT)
+	CRITICAL_EXCEPTION(0x1020, WDTException, ppc4xx_wdt_interrupt)
+#else
 	CRITICAL_EXCEPTION(0x1020, WDTException, UnknownException)
 #endif
-
+	
 /* 0x1100 - Data TLB Miss Exception
  * As the name implies, translation is not in the MMU, so search the
  * page tables and fix it.  The only purpose of this function is to
diff -uprN linux-2.6.11-rc4.orig/arch/ppc/kernel/head_booke.h linux-2.6.11-rc4/arch/ppc/kernel/head_booke.h
--- linux-2.6.11-rc4.orig/arch/ppc/kernel/head_booke.h	2005-02-22 12:59:33.000000000 +0900
+++ linux-2.6.11-rc4/arch/ppc/kernel/head_booke.h	2005-02-26 01:01:11.000000000 +0900
@@ -194,8 +194,8 @@ label:
 	CRITICAL_EXCEPTION_PROLOG;				\
 	addi	r3,r1,STACK_FRAME_OVERHEAD;			\
 	EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
-			  NOCOPY, transfer_to_handler_full, \
-			  ret_from_except_full)
+			  NOCOPY, crit_transfer_to_handler, \
+			  ret_from_crit_exc)
 
 #define MCHECK_EXCEPTION(n, label, hdlr)			\
 	START_EXCEPTION(label);					\
diff -uprN linux-2.6.11-rc4.orig/arch/ppc/syslib/ppc4xx_setup.c linux-2.6.11-rc4/arch/ppc/syslib/ppc4xx_setup.c
--- linux-2.6.11-rc4.orig/arch/ppc/syslib/ppc4xx_setup.c	2005-02-22 12:59:33.000000000 +0900
+++ linux-2.6.11-rc4/arch/ppc/syslib/ppc4xx_setup.c	2005-02-26 01:01:15.000000000 +0900
@@ -48,9 +48,11 @@
 extern void abort(void);
 extern void ppc4xx_find_bridges(void);
 
+#ifdef CONFIG_PPC4xx_WATCHDOG
 extern void ppc4xx_wdt_heartbeat(void);
 extern int wdt_enable;
 extern unsigned long wdt_period;
+#endif  /*  CONFIG_PPC4xx_WATCHDOG  */
 
 /* Global Variables */
 bd_t __res;
@@ -257,7 +259,7 @@ ppc4xx_init(unsigned long r3, unsigned l
 		*(char *) (r7 + KERNELBASE) = 0;
 		strcpy(cmd_line, (char *) (r6 + KERNELBASE));
 	}
-#if defined(CONFIG_PPC405_WDT)
+#ifdef CONFIG_PPC4xx_WATCHDOG
 /* Look for wdt= option on command line */
 	if (strstr(cmd_line, "wdt=")) {
 		int valid_wdt = 0;
@@ -272,7 +274,7 @@ ppc4xx_init(unsigned long r3, unsigned l
 		}
 		wdt_enable = valid_wdt;
 	}
-#endif
+#endif  /*  CONFIG_PPC4xx_WATCHDOG  */
 
 	/* Initialize machine-dependent vectors */
 
@@ -287,9 +289,9 @@ ppc4xx_init(unsigned long r3, unsigned l
 
 	ppc_md.calibrate_decr = ppc4xx_calibrate_decr;
 
-#ifdef CONFIG_PPC405_WDT
+#ifdef CONFIG_PPC4xx_WATCHDOG_COMPAT
 	ppc_md.heartbeat = ppc4xx_wdt_heartbeat;
-#endif
+#endif  /*  CONFIG_PPC4xx_WATCHDOG  */
 	ppc_md.heartbeat_count = 0;
 
 	ppc_md.find_end_of_memory = ppc4xx_find_end_of_memory;
diff -uprN linux-2.6.11-rc4.orig/drivers/char/watchdog/Kconfig linux-2.6.11-rc4/drivers/char/watchdog/Kconfig
--- linux-2.6.11-rc4.orig/drivers/char/watchdog/Kconfig	2005-02-22 12:58:29.000000000 +0900
+++ linux-2.6.11-rc4/drivers/char/watchdog/Kconfig	2005-02-26 02:48:42.000000000 +0900
@@ -346,6 +346,25 @@ config 8xx_WDT
 	tristate "MPC8xx Watchdog Timer"
 	depends on WATCHDOG && 8xx
 
+config PPC4xx_WATCHDOG
+	bool "Watchdog on PowerPC 4xx series"
+	depends on WATCHDOG && 4xx
+	---help---
+	  This is the driver for the hardware watchdog timers present on
+	  PowerPC 4xx series(PPC405GP/GPr,PPC440GP/GX).
+config PPC4xx_WATCHDOG_COMPAT
+	bool "Enable Compatibility with old ppc405 driver."
+	depends on PPC4xx_WATCHDOG
+	---help---
+	  If you want send acks to WDT with timer interrupt, turn on this 
+	  option.
+	  
+          This option changes behaviors of the driver to old ppc405 software 
+	  watch dog driver did. Strictly speaking, it may not have the 
+	  complete compatibility with ppc405 software WDT. It does not
+	  use WDT exception in PowerPC 4xx. 
+
+
 # MIPS Architecture
 
 config INDYDOG
diff -uprN linux-2.6.11-rc4.orig/drivers/char/watchdog/Makefile linux-2.6.11-rc4/drivers/char/watchdog/Makefile
--- linux-2.6.11-rc4.orig/drivers/char/watchdog/Makefile	2005-02-22 12:58:30.000000000 +0900
+++ linux-2.6.11-rc4/drivers/char/watchdog/Makefile	2005-02-26 01:01:20.000000000 +0900
@@ -39,3 +39,4 @@ obj-$(CONFIG_USBPCWATCHDOG) += pcwd_usb.
 obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
 obj-$(CONFIG_IXP2000_WATCHDOG) += ixp2000_wdt.o
 obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o
+obj-$(CONFIG_PPC4xx_WATCHDOG)   += ppc4xx_wdt.o
\ No newline at end of file
diff -uprN linux-2.6.11-rc4.orig/drivers/char/watchdog/ppc4xx_wdt.c linux-2.6.11-rc4/drivers/char/watchdog/ppc4xx_wdt.c
--- linux-2.6.11-rc4.orig/drivers/char/watchdog/ppc4xx_wdt.c	1970-01-01 09:00:00.000000000 +0900
+++ linux-2.6.11-rc4/drivers/char/watchdog/ppc4xx_wdt.c	2005-02-26 02:48:42.000000000 +0900
@@ -0,0 +1,717 @@
+/*
+ *
+ *    Copyright (c) 2004 Fujitsu Limited
+ *
+ *    Module name: ppc4xx_wdt.c
+ *    Author:      Takeharu KATO<kato.takeharu@jp.fujitsu.com>
+ *    Description:
+ *      Watchdog driver for PowerPC 4xx-based processors.
+ *      Derived from drivers/char/watchdog/wdt.c by Alan cox
+ *              and  drivers/char/watchdog/ppc405_wdt.c by Armin Kuster.
+ *
+ *     PPC4xx WDT operation is driverd from Appendix of 
+ *      PowerPC Embedded Processors Application Note
+ *      ``PowerPC 40x Watch Dog Timer'' published from IBM.
+ */
+#include <linux/config.h>
+#include <linux/interrupt.h>
+#include <linux/types.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/fs.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/capability.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+#if defined(CONFIG_440GP)
+#include <syslib/ibm440gp_common.h>
+#endif  /*  CONFIG_440GP  */
+#if defined(CONFIG_440GX)
+#include <syslib/ibm440gx_common.h>
+#endif  /*  CONFIG_440GX  */
+#include "ppc4xx_wdt.h"
+
+/* micro seconds per one milli-second(used to calculatewatchdog 
+ * counter to be set. */
+#define US_PER_MS 1000  
+/*  MHz in Hz  */
+#define MHZ  1000000
+/*
+ * External linkage
+ */
+int wdt_enable=0;                  /* WDT start on boot  */
+int wdt_period = WD_TIMO;          /* Time out in ms(see: ppc4xx_wdt.h) */
+/*
+ * Global variables
+ */
+static int wdt_count = 0;            /* WDT intrrupt counter to be reloaded */
+static volatile int wdt_heartbeat_count = 0;  /* WDT intrrupt counter(compatible mode)*/
+static unsigned long driver_state; /* Driver status (see: ppc4xx_wdt.h) */
+void ppc4xx_wdt_heartbeat(void);
+/*
+ * Internal linkage functions
+ */
+static __inline__ void __ppc4xx_wdt_setup_val(int period,int reset);
+static __inline__ void __ppc4xx_wdt_enable(void);
+static __inline__ void __ppc4xx_wdt_disable(void);
+static __inline__ int  __ppc4xx_wdt_is_enabled(void);
+static __inline__ void __ppc4xx_wdt_clear_int_stat(void);
+static __inline__ void __ppc4xx_wdt_set_timeout(int t);
+#if !defined(CONFIG_PPC4xx_WATCHDOG_COMPAT)
+static unsigned long cpu_clock=0;    /* To store cpu_clock */
+#if defined(CONFIG_40x)
+static __inline__ int  __ppc40x_get_cpu_clock(void);
+#endif  /*  CONFIG_40x  */
+#if defined(CONFIG_44x)
+static __inline__ int  __ppc44x_get_cpu_clock(void);
+#endif  /*  CONFIG_44x  */
+static __inline__ void  __ppc4xx_get_cpu_clock(void);
+#endif  /*  CONFIG_PPC4xx_WATCHDOG_COMPAT  */
+static __inline__ void ppc4xx_wdt_init_device(void);
+static __inline__ int  ppc4xx_wdt_is_enabled(void);
+static __inline__ int  ppc4xx_wdt_start(void);
+static __inline__ int  ppc4xx_wdt_stop(void);
+static __inline__ int  ppc4xx_wdt_ping(void);
+static __inline__ int  ppc4xx_wdt_set_timeout(int t);
+static __inline__ int  ppc4xx_wdt_get_status(int *status);
+static ssize_t ppc4xx_wdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos);
+static int ppc4xx_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,unsigned long arg);
+static int ppc4xx_wdt_open(struct inode *inode, struct file *file);
+static int ppc4xx_wdt_release(struct inode *inode, struct file *file);
+static int ppc4xx_wdt_notify_sys(struct notifier_block *this, unsigned long code,void *unused);
+static int __init ppc4xx_wdt_init(void);
+static void __exit ppc4xx_wdt_exit(void);
+
+#ifdef CONFIG_WATCHDOG_NOWAYOUT
+static int nowayout = 1;
+#else
+static int nowayout = 0;
+#endif
+
+/*
+ *	Watchdog operations on PPC4xx MPU
+ */
+#if !defined(CONFIG_PPC4xx_WATCHDOG_COMPAT)
+#if defined(CONFIG_40x)
+/**
+ *      __ppc40x_get_cpu_clock
+ *      Get CPU clock of PPC405 family
+ */
+static __inline__ int 
+__ppc40x_get_cpu_clock(void)
+{
+  bd_t *bip = &__res;
+
+  return  (bip->bi_tbfreq);
+}
+#endif  /*  CONFIG_40x  */
+
+#if defined(CONFIG_44x)
+/**
+ *      ppc44x_get_cpu_clock
+ *      Get CPU clock of PPC440 family
+ */
+static __inline__ int 
+__ppc44x_get_cpu_clock(void)
+{
+  struct ibm44x_clocks clocks;
+
+  /* Note:
+   * Following functions are assigned in init section.
+   * So we keep cpu_clocks in this module.
+   */
+#if defined(CONFIG_440GX)
+  ibm440gx_get_clocks(&clocks, 33333333, 6 * 1843200);
+#else
+#if defined(CONFIG_440GP)
+  ibm440gp_get_clocks(&clocks, 33333333, 6 * 1843200);
+#endif
+#endif
+  
+  return clocks.cpu;
+}
+#endif  /*  CONFIG_44x  */
+#endif  /*   !CONFIG_PPC4xx_WATCHDOG_COMPAT  */
+/**
+ *      ppc4xx_get_cpu_clock
+ *      Get CPU clock of PPC4xx family
+ */
+#if !defined(CONFIG_PPC4xx_WATCHDOG_COMPAT)
+static __inline__ void
+__ppc4xx_get_cpu_clock(void)
+{
+	if (!cpu_clock)
+#if defined(CONFIG_40x)
+		cpu_clock = __ppc40x_get_cpu_clock();
+#else
+#if defined(CONFIG_44x)
+	        cpu_clock =  __ppc44x_get_cpu_clock();
+#else
+#error "PPC4xx WDT Detect invalid configuration(Unknown CPU)"
+#endif  /*  CONFIG_44x  */
+#endif  /*  CONFIG_40x  */
+  return;
+}
+#else
+#define __ppc4xx_get_cpu_clock() do{}while(0)
+#endif  /*  CONFIG_PPC4xx_WATCHDOG_COMPAT  */
+/**
+ *      __ppc4xx_wdt_setup_val
+ *      Enable 4xx Watchdog, sets up passed in values for TCR[WP],
+ *      TCR[WRC]
+ *   
+ *	@period:	Input Watchdog Period - TCR[WP]
+ *                      0 = 2^17 clocks
+ *                      1 = 2^21 clocks
+ *                      2 = 2^25 clocks
+ *                      3 = 2^29 clocks
+ *      @reset:         Watchdog reset control - TCR[WRC]
+ *                      0 = No reset
+ *                      1 = PPC Core reset only
+ *                      2 = PPC Chip reset
+ *                      3 = System reset
+ *     Note: The meaning of period number is differ PPC440GP from PPC440GX.
+ */
+static __inline__ void
+__ppc4xx_wdt_setup_val(int period,int reset)
+{
+  unsigned long val;
+  
+  /*  Set up TCR  */
+  val=period<<WDT_TCR_WP_SHIFT|reset<<WDT_TCR_WRC_SHIFT|mfspr(SPRN_TCR);
+  /*  Disable WDT  */
+  val &= ~(WDT_TCR_WDT_ENABLE);
+  
+  mtspr(SPRN_TCR,val);
+}
+/**
+ *      __ppc4xx_wdt_enable
+ *      Enable 4xx Watchdog
+ */
+static __inline__ void
+__ppc4xx_wdt_enable(void)
+{
+  mtspr(SPRN_TCR,(mfspr(SPRN_TCR)|WDT_TCR_WDT_ENABLE));
+}
+/**
+ *      __ppc4xx_wdt_disable
+ *      Disable 4xx Watchdog
+ */
+static __inline__ void
+__ppc4xx_wdt_disable(void)
+{
+  mtspr(SPRN_TCR,(mfspr(SPRN_TCR)&(~(WDT_TCR_WDT_ENABLE))));
+}
+/**
+ *      __ppc4xx_wdt_is_enabled
+ *      Check whether 4xx Watchdog is enabled.
+ */
+static __inline__ int
+__ppc4xx_wdt_is_enabled(void)
+{
+  return (mfspr(SPRN_TCR) & WDT_TCR_WDT_ENABLE);
+}
+/**
+ *      __ppc4xx_wdt_clear_init_stat
+ *      Clear interrupt status of PPC4xx Watchdog to ping it.
+ */
+static __inline__ void
+__ppc4xx_wdt_clear_int_stat(void)
+{
+  mtspr(SPRN_TSR, (TSR_ENW|TSR_WIS));
+}
+/**
+ *	__ppc4xx_wdt_set_timeout:
+ *	@t:	the new time out value that needs to be set.
+ *
+ *	Set a new time out value for the watchdog device. 
+ *
+ */
+static __inline__ void
+__ppc4xx_wdt_set_timeout(int t)
+{
+#if !defined(CONFIG_PPC4xx_WATCHDOG_COMPAT)
+  unsigned long tmp;
+  unsigned long div;
+
+  /*  Parameter check must be performed in wdt_set_timeout.  */  
+  ppc4xx_wdt_dbg("clock : %d\n",cpu_clock);
+  tmp=t*US_PER_MS; /*  in us */
+
+  /* Note:
+   * On  PowerPC 4xx processor, WatchDogTimer exception is occur according to
+   * Time Base bit tansition 0 -> 1. In other word, Time Base bit tansition 
+   * 1 -> 0 does not cause the exception. The is the reason why the divisor
+   * as follows should be multiplied by 2.
+   */
+  div=( (WDT_CLK_PER_INT_WP_VAL/(cpu_clock/MHZ)) * 2);
+  ppc4xx_wdt_dbg("div : %lu\n",div);
+  tmp /= div;
+  wdt_count=tmp;
+#else
+  wdt_count=t;  /*  Assume 1ms tick */
+#endif
+  return;
+}
+/*
+ * Driver specific functions
+ */
+/**
+ *	ppc4xx_wdt_heartbeat:
+ *      Ping routine called from kernel.
+ */
+void 
+ppc4xx_wdt_heartbeat(void)
+{
+  /* Disable watchdog */
+  __ppc4xx_wdt_disable();
+
+  /* Write a watchdog value */
+  __ppc4xx_wdt_clear_int_stat();
+  
+  if (!wdt_enable) 
+    goto out;
+
+#if defined(CONFIG_PPC4xx_WATCHDOG_COMPAT)
+  if  (wdt_heartbeat_count > 0)
+    wdt_heartbeat_count--;
+  else
+    panic(ppc4xx_mkmsg("Initiating system reboot.\n"));
+#endif /*  CONFIG_PPC4xx_WATCHDOG_COMPAT  */
+  /* Enable watchdog */
+  __ppc4xx_wdt_enable();
+ out:
+  /*  Reset count  */
+  ppc_md.heartbeat_count = 0;
+}
+/**
+ *	ppc4xx_wdt_interrupt:
+ *      Watchdog interrupt handler.
+ */
+void
+ppc4xx_wdt_interrupt(struct pt_regs *regs)
+{
+  unsigned long status=mfspr(SPRN_TSR);
+  unsigned long flags;
+
+  if (status & (TSR_WIS|TSR_ENW)){
+	  /* Disable watchdog */
+	  __ppc4xx_wdt_disable();
+
+	  __ppc4xx_wdt_clear_int_stat();
+	  local_irq_save(flags);
+#if !defined(CONFIG_PPC4xx_WATCHDOG_COMPAT)
+    if (wdt_heartbeat_count) {
+      --wdt_heartbeat_count;
+    } else {
+#ifdef ONLY_TESTING
+      ppc4xx_wdt_crit("Would Reboot by application failure.\n");
+#else
+#ifdef SOFTWARE_REBOOT
+      ppc4xx_wdt_crit("Initiating system reboot.\n");
+      machine_restart(NULL);
+#else
+      panic(ppc4xx_mkmsg("Initiating system reboot.\n"));
+#endif  /*   SOFTWARE_REBOOT  */
+#endif  /*   ONLY_TESTING  */
+    }   /*  Time out  */
+#endif  /*   !CONFIG_PPC4xx_WATCHDOG_COMPAT  */
+    local_irq_restore(flags);
+    /* Enable watchdog */
+    __ppc4xx_wdt_enable();
+  }
+  return;
+}
+\f
+/*
+ *	Driver Logic functions
+ */
+static __inline__ int
+ppc4xx_wdt_is_enabled(void)
+{
+  return  __ppc4xx_wdt_is_enabled();
+}
+/**
+ *	ppc4xx_wdt_start:
+ *
+ *	Start the watchdog driver.
+ */
+static __inline__ int 
+ppc4xx_wdt_start(void)
+{
+  __ppc4xx_wdt_enable();
+  return 0;
+}
+
+/**
+ *	ppc4xx_wdt_stop:
+ *
+ *	Stop the watchdog driver.
+ */
+static __inline__ int 
+ppc4xx_wdt_stop (void)
+{
+  __ppc4xx_wdt_disable();
+  return 0;
+}
+/**
+ *	ppc4xx_wdt_ping:
+ *
+ *	Reload counter one with the watchdog heartbeat. We don't bother reloading
+ *	the cascade counter.
+ */
+static __inline__ int 
+ppc4xx_wdt_ping(void)
+{
+  /* Disable watchdog */
+  __ppc4xx_wdt_disable();
+  /* Write a watchdog value */
+  __ppc4xx_wdt_clear_int_stat();
+  /*  Reset count  */
+  wdt_heartbeat_count=wdt_count;
+  /* Enable watchdog */
+  __ppc4xx_wdt_enable();
+
+  return 0;
+}
+/**
+ *	ppc4xx_wdt_set_timeout:
+ *	@t:		the new timeout value that needs to be set.
+ *
+ *	Set a new time out value for the watchdog device. 
+ *      If the heartbeat value is incorrect we keep the old value 
+ *      and return -EINVAL. If successfull we
+ *	return 0.
+ */
+static __inline__ int 
+ppc4xx_wdt_set_timeout(int t)
+{
+  if ((t < WDT_HEARTBEAT_MIN) || (t > WDT_HEARTBEAT_MAX))
+    return -EINVAL;
+
+  wdt_period = t;
+  __ppc4xx_wdt_set_timeout(t);
+  wdt_heartbeat_count=wdt_count;
+  ppc4xx_wdt_dbg("The WDT counter set %d.\n",wdt_count);
+
+  return 0;
+}
+
+/**
+ *	ppc4xx_wdt_get_status:
+ *	@status: the new status.
+ *
+ *	Return the enable/disable card status.
+ */
+static __inline__ int 
+ppc4xx_wdt_get_status(int *status)
+{
+  if (wdt_enable)
+	  *status = WDIOS_ENABLECARD;
+  else
+	  *status = WDIOS_DISABLECARD;
+
+  return 0;
+}
+/*
+ *	Kernel Interfaces
+ */
+/**
+ *	ppc4xx_wdt_init_device:
+ *
+ *      Initilize PowerPC 4xx family Watch Dog facility.
+ */
+static void
+ppc4xx_wdt_init_device(void)
+{
+        __ppc4xx_get_cpu_clock();
+	__ppc4xx_wdt_setup_val(WDT_WP,WDT_RESET_NONE);
+}
+/**
+ *	ppc4xx_wdt_write:
+ *	@file: file handle to the watchdog
+ *	@buf: buffer to write (unused as data does not matter here
+ *	@count: count of bytes
+ *	@ppos: pointer to the position to write. No seeks allowed
+ *
+ *	A write to a watchdog device is defined as a keepalive signal. Any
+ *	write of data will do, as we we don't define content meaning expept
+ *      'V' character. It is performed as a sign to set stop-on-close mode.
+ */
+
+static ssize_t 
+ppc4xx_wdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+{
+  size_t i;
+
+    if (!nowayout) {
+      /* In case it was set long ago */
+      clear_bit(WDT_STATE_STOP_ON_CLOSE, &driver_state);
+
+      for (i = 0; i < count; i++) {
+	char c;
+
+	if (get_user(c, buf + i))
+	  return -EFAULT;
+
+	if (c == 'V') {
+	  set_bit(WDT_STATE_STOP_ON_CLOSE, &driver_state);
+	}
+      }
+    }
+    ppc4xx_wdt_ping();
+
+  return count;
+}
+static struct watchdog_info ident = {
+  .options=WDIOF_SETTIMEOUT|WDIOF_KEEPALIVEPING|WDIOF_MAGICCLOSE,
+  .firmware_version =	1,
+  .identity =		"PPC4xx WDT",
+};
+
+/**
+ *	ppc4xx_wdt_ioctl:
+ *	@inode: inode of the device
+ *	@file: file handle to the device
+ *	@cmd: watchdog command
+ *	@arg: argument pointer
+ *
+ */
+static int 
+ppc4xx_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+	unsigned long arg)
+{
+	int new_timeout;
+	int status;
+
+	if (!capable(CAP_SYS_ADMIN))
+		return -EPERM;  /*  It may be too strict manner.  */
+	switch(cmd)
+	{
+	default:
+		return -ENOIOCTLCMD;
+	case WDIOC_GETSUPPORT:
+		if (copy_to_user((struct watchdog_info *)arg, &ident, sizeof(struct watchdog_info)))
+			return -EFAULT;
+		else
+			break;
+	case WDIOC_GETSTATUS:
+		ppc4xx_wdt_get_status(&status);
+		return put_user(status,(int *)arg);
+	case WDIOC_KEEPALIVE:
+		ppc4xx_wdt_ping();
+		break;
+	case WDIOC_SETTIMEOUT:
+		if (get_user(new_timeout, (int *)arg))
+			return -EFAULT;
+		if (ppc4xx_wdt_set_timeout(new_timeout))
+			return -EINVAL;
+		ppc4xx_wdt_ping();
+		break;
+	case WDIOC_GETTIMEOUT:
+		return put_user(wdt_period, (int *)arg);
+	case WDIOC_SETOPTIONS:
+		if (get_user(status, (int *)arg))
+			return -EFAULT;
+		/*  Return -EINVAL when the driver can not figure out 
+		 *  what it should do. Unknown cases are just ignored.
+		 */
+		if ( (status & (WDIOS_DISABLECARD|WDIOS_ENABLECARD)) 
+		     == (WDIOS_DISABLECARD|WDIOS_ENABLECARD) )
+			return -EINVAL;
+		if (status & WDIOS_DISABLECARD) {
+			wdt_enable = 0;
+			ppc4xx_wdt_stop();
+			ppc4xx_wdt_note("Watchdog timer is disabled\n");
+		}
+		if (status & WDIOS_ENABLECARD) {
+			wdt_enable = 1;
+			ppc4xx_wdt_start();
+			ppc4xx_wdt_note("Watchdog timer is enabled\n");
+		}
+		break;
+	}
+	return 0;
+}
+/**
+ *	ppc4xx_wdt_open:
+ *	@inode: inode of device
+ *	@file: file handle to device
+ *
+ *	The watchdog device has been opened. The watchdog device is single
+ *	open and start the WDT timer.
+ */
+static int 
+ppc4xx_wdt_open(struct inode *inode, struct file *file)
+{
+	if (test_and_set_bit(WDT_STATE_OPEN, &driver_state))
+		return -EBUSY;
+	/*
+	 * Activate
+	 */
+	ppc4xx_wdt_start();
+	wdt_enable=1;
+
+	if (nowayout)
+	  set_bit(WDT_STATE_STOP_ON_CLOSE, &driver_state);
+
+	return 0;
+}
+
+/**
+ *	ppc4xx_wdt_release:
+ *	@inode: inode to board
+ *	@file: file handle to board
+ *
+ */
+static int
+ppc4xx_wdt_release(struct inode *inode, struct file *file)
+{
+  if (test_bit(WDT_STATE_STOP_ON_CLOSE, &driver_state)) {
+      ppc4xx_wdt_note("WDT device is stopped.\n");
+    ppc4xx_wdt_stop();
+    wdt_enable=0;
+  } else {
+    if ( (ppc4xx_wdt_is_enabled()) && (!nowayout) ) {
+      ppc4xx_wdt_note("WDT device may be closed unexpectedly.  WDT will not stop!\n");
+      ppc4xx_wdt_ping();
+    }
+  }
+  clear_bit(WDT_STATE_OPEN, &driver_state);
+
+  return 0;
+}
+/**
+ *	notify_sys:
+ *	@this: our notifier block
+ *	@code: the event being reported
+ *	@unused: unused
+ *
+ */
+
+static int 
+ppc4xx_wdt_notify_sys(struct notifier_block *this, unsigned long code,
+	void *unused)
+{
+	if(code==SYS_DOWN || code==SYS_HALT) {
+	  /* Turn the card off */
+	  ppc4xx_wdt_stop();
+	}
+	return NOTIFY_DONE;
+}
+
+static struct file_operations ppc4xx_wdt_fops = {
+	.owner		= THIS_MODULE,
+	.llseek		= no_llseek,
+	.write		= ppc4xx_wdt_write,
+	.ioctl		= ppc4xx_wdt_ioctl,
+	.open		= ppc4xx_wdt_open,
+	.release	= ppc4xx_wdt_release,
+};
+
+static struct miscdevice ppc4xx_wdt_miscdev = {
+	.minor	= WATCHDOG_MINOR,
+	.name	= "watchdog",
+	.fops	= &ppc4xx_wdt_fops,
+};
+
+/*
+ *	The WDT card needs to know about shutdowns in order to
+ *	turn WDT off.
+ */
+
+static struct notifier_block ppc4xx_wdt_notifier = {
+	.notifier_call = ppc4xx_wdt_notify_sys,
+};
+
+/**
+ *	cleanup_module:
+ *
+ *	If your watchdog is set to continue ticking on close and you unload
+ *	it, well it keeps ticking.  You just have to load a new
+ *	module in 60 seconds or reboot.
+ *      This behavior(more over the comments as above) is borrowed from
+ *      Alan cox's driver.
+ */
+
+static void __exit 
+ppc4xx_wdt_exit(void)
+{
+	misc_deregister(&ppc4xx_wdt_miscdev);
+	unregister_reboot_notifier(&ppc4xx_wdt_notifier);
+}
+
+/**
+ * 	ppc4xx_wdt_init:
+ *
+ *	Set up the WDT relevant timer facility. 
+ */
+
+static int __init 
+ppc4xx_wdt_init(void)
+{
+	int ret;
+
+	ret = register_reboot_notifier(&ppc4xx_wdt_notifier);
+	if(ret) {
+	  ppc4xx_wdt_err("Cannot register reboot notifier (err=%d)\n", ret);
+	  return ret;
+	}
+
+	ret = 0;
+	ppc4xx_wdt_init_device();
+	/* Check that the heartbeat value is within it's range ; if not reset to the default */
+	if (ppc4xx_wdt_set_timeout(wdt_period)) {
+	  ppc4xx_wdt_set_timeout(WD_TIMO);
+	  ppc4xx_wdt_info("The heartbeat value must be 0<wdt_period<65536, using %d\n",WD_TIMO);
+	}
+	
+#if defined(CONFIG_PPC4xx_WATCHDOG_COMPAT)
+	{
+		unsigned long flags;
+
+		local_irq_save(flags); /* Prevent timer interrupt */
+		ppc_md.heartbeat_count = 0;	
+		ppc_md.heartbeat=ppc4xx_wdt_heartbeat;
+		local_irq_restore(flags);
+	}
+#endif  /*  CONFIG_PPC4xx_WATCHDOG_COMPAT  */
+
+	ppc4xx_wdt_info("PowerPC 4xx Watchdog Driver. period=%d ms (nowayout=%d)\n",wdt_period, nowayout);
+
+	ret = misc_register(&ppc4xx_wdt_miscdev);
+	if (ret) {
+	  ppc4xx_wdt_err("Cannot register miscdev on minor=%d (err=%d)\n",
+			WATCHDOG_MINOR, ret);
+		goto outmisc;
+	}
+
+	if (wdt_enable) {
+	  ppc4xx_wdt_info("WDT start on boot.\n");
+	  ppc4xx_wdt_start();
+	}
+out:
+	return ret;
+outmisc:
+	unregister_reboot_notifier(&ppc4xx_wdt_notifier);
+#if defined(CONFIG_PPC4xx_WATCHDOG_COMPAT)
+	{
+		unsigned long flags;
+
+		local_irq_save(flags);
+		ppc_md.heartbeat=NULL;
+		ppc_md.heartbeat_count = 0;
+		local_irq_restore(flags);
+	}
+#endif
+	goto out;
+}
+
+module_init(ppc4xx_wdt_init);
+module_exit(ppc4xx_wdt_exit);
+
+MODULE_AUTHOR("Takeharu KATO");
+MODULE_DESCRIPTION("Driver for PPC4xx watchdog cards.");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+MODULE_LICENSE("GPL");
diff -uprN linux-2.6.11-rc4.orig/drivers/char/watchdog/ppc4xx_wdt.h linux-2.6.11-rc4/drivers/char/watchdog/ppc4xx_wdt.h
--- linux-2.6.11-rc4.orig/drivers/char/watchdog/ppc4xx_wdt.h	1970-01-01 09:00:00.000000000 +0900
+++ linux-2.6.11-rc4/drivers/char/watchdog/ppc4xx_wdt.h	2005-02-26 02:48:42.000000000 +0900
@@ -0,0 +1,131 @@
+/*
+ *
+ *    Copyright (c) 2004 Fujitsu Limited
+ *
+ *    Module name: ppc4xx_wdt.h
+ *    Author:      Takeharu KATO<kato.takeharu@jp.fujitsu.com>
+ *    Description:
+ *      Header file for PPC4xx watchdog driver.
+ */
+#ifndef _ARCH_PPC_SYSLIB_PPC4XX_WDT_H
+#define _ARCH_PPC_SYSLIB_PPC4XX_WDT_H
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/ptrace.h>
+#include <linux/watchdog.h>
+
+/*
+ *  Driver behavior flags(bit position)
+ */
+#define WDT_STATE_OPEN                  0   /* driver is opend  */
+#define WDT_STATE_STOP_ON_CLOSE         1   /* Stop with close is expected */
+#define WDT_STATE_COMPAT_MODE           2   /* Monta Vista Linux Comaptible  */
+/*
+ *  For comaptible mode
+ */
+#define WDIOC_GETPERIOD         WDIOC_GETTIMEOUT
+#define WDIOC_SETPERIOD         WDIOC_SETTIMEOUT
+/*
+ * Configurations
+ */
+#define WD_TIMO            60000	/* Default timeout = 60000 ms(1min) */
+#define WDT_HEARTBEAT_MIN  100          /* Minimum timeout = 100 ms */
+#define WDT_HEARTBEAT_MAX  600000       /* Maximum timeout = 600000ms(1hour) */
+#ifdef __KERNEL__
+//#define WDT_DEBUG              /*  Debug switch */
+/*
+ *  Reset type
+ */
+#define WDT_RESET_NONE     0
+#define WDT_RESET_CORE     1
+#define WDT_RESET_CHIP     2
+#define WDT_RESET_SYS      3
+/*
+ *   Bit positions in  TCR register on PPC4xx series.
+ */
+#define WDT_TCR_WP_BIT     1   /*  WP  bit in TCR (bit[0..1])   */
+#define WDT_TCR_WRC_BIT    3   /*  WRC bit in TCR (bit[2..3])   */
+#define WDT_TCR_WIE_BIT    4   /*  WIE bit in TCR (bit[4])      */
+/*
+ *  TCR[WP] relevant definitions
+ */
+#define WDT_TCR_WP_SHIFT       (31 - WDT_TCR_WP_BIT)
+#define WDT_TCR_WRC_SHIFT      (31 - WDT_TCR_WRC_BIT)
+#define WDT_TCR_WIE_SHIFT      (31 - WDT_TCR_WIE_BIT)
+#define WDT_TCR_WDT_ENABLE     (1<<WDT_TCR_WIE_SHIFT)
+/*  MASK value to obatain TCR[WP]  */
+#define WDT_TCR_WP_MASK        (3<<(WDT_TCR_WP_SHIFT))
+
+/*  Watchdog timer periods can be set on PPC4xx cpus. */
+#define WDT_WP0               0
+#define WDT_WP1               1
+#define WDT_WP2               2
+#define WDT_WP3               3
+
+/*  Immediate values of TCR[WP] */
+/*  2^17 clocks period  */
+#define WDT_TCR_WP_VAL0        (0<<(WDT_TCR_WP_SHIFT))
+/*  2^21 clocks period  */
+#define WDT_TCR_WP_VAL1        (1<<(WDT_TCR_WP_SHIFT))
+/*  2^25 clocks period  */
+#define WDT_TCR_WP_VAL2        (2<<(WDT_TCR_WP_SHIFT))
+/*  2^29 clocks period  */
+#define WDT_TCR_WP_VAL3        (3<<(WDT_TCR_WP_SHIFT)) 
+
+/*  Clock periods expressed with power of 2 for each value. */
+#if defined(CONFIG_44x)
+#define WDT_CLK_POW_WP_VAL0  21  /*  2^17 clocks period  */
+#define WDT_CLK_POW_WP_VAL1  25  /*  2^21 clocks period  */
+#define WDT_CLK_POW_WP_VAL2  29  /*  2^25 clocks period  */
+#define WDT_CLK_POW_WP_VAL3  33  /*  2^29 clocks period  */
+#else
+#if defined(CONFIG_40x)
+#define WDT_CLK_POW_WP_VAL0  17  /*  2^17 clocks period  */
+#define WDT_CLK_POW_WP_VAL1  21  /*  2^21 clocks period  */
+#define WDT_CLK_POW_WP_VAL2  25  /*  2^25 clocks period  */
+#define WDT_CLK_POW_WP_VAL3  29  /*  2^29 clocks period  */
+#else
+#error "PPC4xx WDT Detect invalid configuration(Unknown CPU)"
+#endif
+#endif
+/*
+ *  WP relevant values used in our driver.
+ */
+#if !defined(CONFIG_PPC4xx_WATCHDOG_COMPAT)
+#define WDT_WP                 WDT_WP0
+#define WDT_WP_VAL             WDT_TCR_WP_VAL0
+#define WDT_CLK_POW_WP_VAL     WDT_CLK_POW_WP_VAL0
+#define WDT_CLK_PER_INT_WP_VAL ((1UL)<<WDT_CLK_POW_WP_VAL)
+#else
+/*
+ *  WDT period must be more than HZ(Timer ticks)
+ */
+#define WDT_WP                 WDT_WP3
+#define WDT_WP_VAL             WDT_TCR_WP_VAL3
+#define WDT_CLK_POW_WP_VAL     WDT_CLK_POW_WP_VAL3
+#define WDT_CLK_PER_INT_WP_VAL ((1UL)<<WDT_CLK_POW_WP_VAL)
+#endif
+/*
+ *  output messages
+ */
+#define __PPC4xx_WDT_MSG "PPC4xx WDT : "
+#define ppc4xx_mkmsg(str) __PPC4xx_WDT_MSG str
+#define ppc4xx_wdt_info(fmt,arg...) \
+	printk(KERN_INFO __PPC4xx_WDT_MSG fmt,##arg)
+#define ppc4xx_wdt_note(fmt,arg...) \
+	printk(KERN_NOTICE __PPC4xx_WDT_MSG fmt,##arg)
+#define ppc4xx_wdt_err(fmt,arg...) \
+	printk(KERN_ALERT __PPC4xx_WDT_MSG fmt,##arg)
+#define ppc4xx_wdt_crit(fmt,arg...) \
+	printk(KERN_ALERT __PPC4xx_WDT_MSG fmt,##arg)
+#if defined(WDT_DEBUG)
+#define ppc4xx_wdt_dbg(fmt,arg...) \
+	printk(KERN_ALERT __PPC4xx_WDT_MSG fmt,##arg)
+#else
+#define ppc4xx_wdt_dbg(fmt,arg...) \
+        do{}while(0)
+#endif  /*  WDT_DEBUG  */
+
+void ppc4xx_wdt_interrupt(struct pt_regs *regs);
+#endif  /* __KERNEL__  */
+#endif  /*  _ARCH_PPC_SYSLIB_PPC4XX_WDT_H  */

^ permalink raw reply

* 2.6 4xx GPIO OCP driver?
From: Travis B. Sawyer @ 2005-02-25 17:17 UTC (permalink / raw)
  To: ppcembed

Greetings:


I'm working on porting our 'package' of software from a 2.4.x kernel to 2.6.


We use the GPIO on the 440GX for some indications to our user space 
applications (board slot number, other board is present, etc).

In 2.4 we used the drivers/char/ibm_ocp_gpio.c module.  I see no such 
support in 2.6.10.  I perused the archives, found nothing (OBTW: can 
someone point me to the search engine for the list?)

Granted there are many changes in the OCP handling, but I was wondering 
if someone is already working on it, or if I'm going to have to RMO 
(roll my own)/up-port the module.


TIA,

Travis Sawyer

^ permalink raw reply

* Re: Stuck in booting 2.6.10-ac11 on Memec Design FF1152...
From: Jakob Viketoft @ 2005-02-25 15:32 UTC (permalink / raw)
  To: Finn S. Nielsen; +Cc: Linux PPC Embedded list
In-Reply-To: <001b01c51b2d$46378890$0c2ca8c0@FNIBM>

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

Hi Finn!

According to a mail contact we had with the CEO of Mind "this never 
happened" even though several news flashes states that this is 
accomplished. See Andreis mail about the Montavista one. What matters 
however is the powerpc405 which sits at the core of both the Xilinx 
ML300 and Memec FF1152 board and since these are the same (minus a few 
bugs on the Memec side), so is the kernel.

I've resolved the issues I had in my earlier mail and now has an almost 
stock kernel 2.6.11-rc4 running @400Mhz. As you will see, the big 
challenge is about putting together a good initrd to get a useful system. :)

I'm attaching my .config, but be aware that I'm using a fairly 
minimalistic system with debugging only via XMD and printouts on the 
serial port so you might want to take a good look at it before you 
compile. Change the values in 
arch/ppc/platform/4xx/xparameters/xparameters.h to reflect your boards' 
device addresses and comment out devices you do not use.

Hopefully, there will be some more general support for the Xilinx 
Virtex-II Pro++ chips in the kernel, we just need to come up with a good 
plan for it.

Cheers!

	/Jakob

Finn S. Nielsen wrote:
> Hi Jakob,
>  
> I noticed on the embedded powerpc mailing list, that you are working w. 
> linux on the Memec V2P20 FF1152 board.
> I have one too and I'm given the task to get a linux up and running on it...
>  
> What kernel version are you using and where did you get the source ?. It 
> seems to me that in the official source tree, there is only support for 
> the Xilinx ML300 board - or am I missing something ?Montavista and MIND 
> systems say they have a port for the memec board, but if an open source 
> port exists, I'd prefer that.
>  
> Best regards,
>  
> Finn S. Nielsen
> IO Technologies a/s
> Carl Jacobsens Vej 16, opg. 6, 3 sal
> 2500 Valby
> Denmark
> Tlp (direct): +45 36188109
> Fax:. +45 36188101
> Check out our new website: http://www.iotech.dk
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded

[-- Attachment #2: .config --]
[-- Type: text/plain, Size: 11589 bytes --]

#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.11-rc4
# Thu Feb 24 14:48:10 2005
#
CONFIG_MMU=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_HAVE_DEC_LOCK=y
CONFIG_PPC=y
CONFIG_PPC32=y
CONFIG_GENERIC_NVRAM=y

#
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
CONFIG_CLEAN_COMPILE=y
CONFIG_BROKEN_ON_SMP=y

#
# General setup
#
CONFIG_LOCALVERSION="-bitsim"
# CONFIG_SWAP is not set
# CONFIG_SYSVIPC is not set
# CONFIG_POSIX_MQUEUE is not set
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_SYSCTL is not set
# CONFIG_AUDIT is not set
CONFIG_LOG_BUF_SHIFT=14
# CONFIG_HOTPLUG is not set
# CONFIG_KOBJECT_UEVENT is not set
# CONFIG_IKCONFIG is not set
CONFIG_EMBEDDED=y
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_ALL is not set
# CONFIG_KALLSYMS_EXTRA_PASS is not set
CONFIG_FUTEX=y
CONFIG_EPOLL=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
# CONFIG_SHMEM is not set
CONFIG_CC_ALIGN_FUNCTIONS=0
CONFIG_CC_ALIGN_LABELS=0
CONFIG_CC_ALIGN_LOOPS=0
CONFIG_CC_ALIGN_JUMPS=0
CONFIG_TINY_SHMEM=y

#
# Loadable module support
#
CONFIG_MODULES=y
# CONFIG_MODULE_UNLOAD is not set
CONFIG_OBSOLETE_MODPARM=y
CONFIG_MODVERSIONS=y
# CONFIG_MODULE_SRCVERSION_ALL is not set
CONFIG_KMOD=y

#
# Processor
#
# CONFIG_6xx is not set
CONFIG_40x=y
# CONFIG_44x is not set
# CONFIG_POWER3 is not set
# CONFIG_POWER4 is not set
# CONFIG_8xx is not set
# CONFIG_E500 is not set
# CONFIG_MATH_EMULATION is not set
# CONFIG_CPU_FREQ is not set
CONFIG_4xx=y

#
# IBM 4xx options
#
# CONFIG_ASH is not set
# CONFIG_BUBINGA is not set
# CONFIG_CPCI405 is not set
# CONFIG_EP405 is not set
# CONFIG_OAK is not set
# CONFIG_REDWOOD_5 is not set
# CONFIG_REDWOOD_6 is not set
# CONFIG_SYCAMORE is not set
# CONFIG_WALNUT is not set
CONFIG_XILINX_ML300=y
CONFIG_IBM405_ERR77=y
CONFIG_IBM405_ERR51=y
CONFIG_XILINX_OCP=y
CONFIG_VIRTEX_II_PRO=y
CONFIG_EMBEDDEDBOOT=y
# CONFIG_PPC4xx_DMA is not set
CONFIG_PPC_GEN550=y
# CONFIG_PM is not set
CONFIG_UART0_TTYS0=y
# CONFIG_UART0_TTYS1 is not set
CONFIG_NOT_COHERENT_CACHE=y

#
# Platform options
#
# CONFIG_PC_KEYBOARD is not set
# CONFIG_SMP is not set
# CONFIG_PREEMPT is not set
# CONFIG_HIGHMEM is not set
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/ram0 rw init=/linuxrc"

#
# Bus options
#
# CONFIG_PCI is not set
# CONFIG_PCI_DOMAINS is not set

#
# PCCARD (PCMCIA/CardBus) support
#
# CONFIG_PCCARD is not set

#
# PC-card bridges
#

#
# Advanced setup
#
CONFIG_ADVANCED_OPTIONS=y
CONFIG_HIGHMEM_START=0xfe000000
# CONFIG_LOWMEM_SIZE_BOOL is not set
CONFIG_LOWMEM_SIZE=0x30000000
# CONFIG_KERNEL_START_BOOL is not set
CONFIG_KERNEL_START=0xc0000000
# CONFIG_TASK_SIZE_BOOL is not set
CONFIG_TASK_SIZE=0x80000000
# CONFIG_CONSISTENT_START_BOOL is not set
CONFIG_CONSISTENT_START=0xff100000
# CONFIG_CONSISTENT_SIZE_BOOL is not set
CONFIG_CONSISTENT_SIZE=0x00200000
# CONFIG_BOOT_LOAD_BOOL is not set
CONFIG_BOOT_LOAD=0x00400000

#
# Device Drivers
#

#
# Generic Driver Options
#
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
# CONFIG_FW_LOADER is not set
# CONFIG_DEBUG_DRIVER is not set

#
# Memory Technology Devices (MTD)
#
# CONFIG_MTD is not set

#
# Parallel port support
#
# CONFIG_PARPORT is not set

#
# Plug and Play support
#

#
# Block devices
#
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=y
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
# CONFIG_BLK_DEV_NBD is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=1
CONFIG_BLK_DEV_RAM_SIZE=16384
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
# CONFIG_LBD is not set
# CONFIG_CDROM_PKTCDVD is not set

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
# CONFIG_IOSCHED_AS is not set
CONFIG_IOSCHED_DEADLINE=y
# CONFIG_IOSCHED_CFQ is not set
# CONFIG_ATA_OVER_ETH is not set

#
# ATA/ATAPI/MFM/RLL support
#
# CONFIG_IDE is not set

#
# SCSI device support
#
# CONFIG_SCSI is not set

#
# Multi-device support (RAID and LVM)
#
# CONFIG_MD is not set

#
# Fusion MPT device support
#

#
# IEEE 1394 (FireWire) support
#

#
# I2O device support
#

#
# Macintosh device drivers
#

#
# Networking support
#
CONFIG_NET=y

#
# Networking options
#
CONFIG_PACKET=y
CONFIG_PACKET_MMAP=y
CONFIG_NETLINK_DEV=y
CONFIG_UNIX=y
# CONFIG_NET_KEY is not set
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_ROUTE_VERBOSE=y
# CONFIG_IP_PNP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE is not set
# CONFIG_IP_MROUTE is not set
# CONFIG_ARPD is not set
# CONFIG_SYN_COOKIES is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
CONFIG_INET_TUNNEL=y
CONFIG_IP_TCPDIAG=y
# CONFIG_IP_TCPDIAG_IPV6 is not set
# CONFIG_IPV6 is not set
# CONFIG_NETFILTER is not set
CONFIG_XFRM=y
# CONFIG_XFRM_USER is not set

#
# SCTP Configuration (EXPERIMENTAL)
#
# CONFIG_IP_SCTP is not set
# CONFIG_ATM is not set
# CONFIG_BRIDGE is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_NET_DIVERT is not set
# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set

#
# QoS and/or fair queueing
#
# CONFIG_NET_SCHED is not set
# CONFIG_NET_CLS_ROUTE is not set

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_HAMRADIO is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
CONFIG_NETDEVICES=y
# CONFIG_DUMMY is not set
# CONFIG_BONDING is not set
# CONFIG_EQUALIZER is not set
# CONFIG_TUN is not set
# CONFIG_ETHERTAP is not set

#
# Ethernet (10 or 100Mbit)
#
# CONFIG_NET_ETHERNET is not set
# CONFIG_IBM_EMAC is not set

#
# Ethernet (1000 Mbit)
#

#
# Ethernet (10000 Mbit)
#

#
# Token Ring devices
#

#
# Wireless LAN (non-hamradio)
#
# CONFIG_NET_RADIO is not set

#
# Wan interfaces
#
# CONFIG_WAN is not set
# CONFIG_PPP is not set
# CONFIG_SLIP is not set
# CONFIG_SHAPER is not set
# CONFIG_NETCONSOLE is not set

#
# ISDN subsystem
#
# CONFIG_ISDN is not set

#
# Telephony Support
#
# CONFIG_PHONE is not set

#
# Input device support
#
# CONFIG_INPUT is not set

#
# Userland interfaces
#

#
# Input I/O drivers
#
# CONFIG_GAMEPORT is not set
CONFIG_SOUND_GAMEPORT=y
# CONFIG_SERIO is not set
# CONFIG_SERIO_I8042 is not set

#
# Input Device Drivers
#

#
# Character devices
#
# CONFIG_VT is not set
# CONFIG_SERIAL_NONSTANDARD is not set

#
# Serial drivers
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=4
# CONFIG_SERIAL_8250_EXTENDED is not set

#
# Non-8250 serial port support
#
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_UNIX98_PTYS is not set
# CONFIG_LEGACY_PTYS is not set

#
# IPMI
#
# CONFIG_IPMI_HANDLER is not set

#
# Watchdog Cards
#
# CONFIG_WATCHDOG is not set
# CONFIG_NVRAM is not set
# CONFIG_GEN_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set

#
# Ftape, the floppy tape device driver
#
# CONFIG_AGP is not set
# CONFIG_DRM is not set
# CONFIG_RAW_DRIVER is not set

#
# I2C support
#
# CONFIG_I2C is not set

#
# Dallas's 1-wire bus
#
# CONFIG_W1 is not set

#
# Misc devices
#

#
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set

#
# Digital Video Broadcasting Devices
#
# CONFIG_DVB is not set

#
# Graphics support
#
# CONFIG_FB is not set

#
# Sound
#
# CONFIG_SOUND is not set

#
# USB support
#
# CONFIG_USB_ARCH_HAS_HCD is not set
# CONFIG_USB_ARCH_HAS_OHCI is not set

#
# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
#

#
# USB Gadget Support
#
# CONFIG_USB_GADGET is not set

#
# MMC/SD Card support
#
# CONFIG_MMC is not set

#
# InfiniBand support
#
# CONFIG_INFINIBAND is not set

#
# File systems
#
CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set
# CONFIG_EXT3_FS is not set
# CONFIG_JBD is not set
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set

#
# XFS support
#
# CONFIG_XFS_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_ROMFS_FS is not set
# CONFIG_QUOTA is not set
# CONFIG_DNOTIFY is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set

#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
# CONFIG_UDF_FS is not set

#
# DOS/FAT/NT Filesystems
#
# CONFIG_MSDOS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_NTFS_FS is not set

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_SYSFS=y
# CONFIG_DEVFS_FS is not set
# CONFIG_TMPFS is not set
# CONFIG_HUGETLB_PAGE is not set
CONFIG_RAMFS=y

#
# Miscellaneous filesystems
#
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_CRAMFS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set

#
# Network File Systems
#
# CONFIG_NFS_FS is not set
# CONFIG_NFSD is not set
# CONFIG_SMB_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set

#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y

#
# Native Language Support
#
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_CODEPAGE_437 is not set
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
# CONFIG_NLS_CODEPAGE_850 is not set
# CONFIG_NLS_CODEPAGE_852 is not set
# CONFIG_NLS_CODEPAGE_855 is not set
# CONFIG_NLS_CODEPAGE_857 is not set
# CONFIG_NLS_CODEPAGE_860 is not set
# CONFIG_NLS_CODEPAGE_861 is not set
# CONFIG_NLS_CODEPAGE_862 is not set
# CONFIG_NLS_CODEPAGE_863 is not set
# CONFIG_NLS_CODEPAGE_864 is not set
# CONFIG_NLS_CODEPAGE_865 is not set
# CONFIG_NLS_CODEPAGE_866 is not set
# CONFIG_NLS_CODEPAGE_869 is not set
# CONFIG_NLS_CODEPAGE_936 is not set
# CONFIG_NLS_CODEPAGE_950 is not set
# CONFIG_NLS_CODEPAGE_932 is not set
# CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
# CONFIG_NLS_ASCII is not set
CONFIG_NLS_ISO8859_1=y
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
# CONFIG_NLS_ISO8859_4 is not set
# CONFIG_NLS_ISO8859_5 is not set
# CONFIG_NLS_ISO8859_6 is not set
# CONFIG_NLS_ISO8859_7 is not set
# CONFIG_NLS_ISO8859_9 is not set
# CONFIG_NLS_ISO8859_13 is not set
# CONFIG_NLS_ISO8859_14 is not set
# CONFIG_NLS_ISO8859_15 is not set
# CONFIG_NLS_KOI8_R is not set
# CONFIG_NLS_KOI8_U is not set
# CONFIG_NLS_UTF8 is not set

#
# IBM 40x options
#

#
# Library routines
#
# CONFIG_CRC_CCITT is not set
# CONFIG_CRC32 is not set
# CONFIG_LIBCRC32C is not set

#
# Profiling support
#
# CONFIG_PROFILING is not set

#
# Kernel hacking
#
CONFIG_DEBUG_KERNEL=y
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_SCHEDSTATS is not set
# CONFIG_DEBUG_SLAB is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
# CONFIG_DEBUG_KOBJECT is not set
# CONFIG_DEBUG_INFO is not set
# CONFIG_DEBUG_FS is not set
# CONFIG_KGDB is not set
# CONFIG_XMON is not set
# CONFIG_BDI_SWITCH is not set
# CONFIG_SERIAL_TEXT_DEBUG is not set
CONFIG_PPC_OCP=y

#
# Security options
#
# CONFIG_KEYS is not set
# CONFIG_SECURITY is not set

#
# Cryptographic options
#
# CONFIG_CRYPTO is not set

#
# Hardware crypto devices
#

^ permalink raw reply

* Re: ppc32 weirdness with gcc-4.0 in 2.6.11-rc4
From: Mikael Pettersson @ 2005-02-25 14:27 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Linux Kernel list, linuxppc-dev list
In-Reply-To: <16926.63745.143566.413488@alkaid.it.uu.se>

Mikael Pettersson writes:
 > Jakub Jelinek writes:
 >  > On Thu, Feb 24, 2005 at 04:08:47PM +0100, Mikael Pettersson wrote:
 >  > > _However_, the 0k data message is due to a gcc-4.0 bug, and below
 >  > > you'll find a test program which illustrates it.
 >  > 
 >  > http://gcc.gnu.org/PR20196
 > 
 > Jakub's patch to gcc4 solved the mysterious "0k data" message,
 > but my eMac's USB is still dysfunctional. I'll try to look into
 > that next week.

CONFIG_USB_DEBUG gave the following dmesg diff between gcc-3.4.3 and 4.0.0:

@@ -118,6 +118,8 @@
 hub 1-0:1.0: Single TT
 hub 1-0:1.0: TT requires at most 8 FS bit times
 hub 1-0:1.0: power on to power good time: 20ms
+hub 1-0:1.0: hub controller current requirement: 0mA
+hub 1-0:1.0: 500mA bus power budget for children
 hub 1-0:1.0: local power source is good
 hub 1-0:1.0: enabling power on all ports
 ohci_hcd: 2004 Nov 08 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)

There are several more of these diffs, and they are what's eventually
causing USB to label the hub as bus-powered and refuse to connect it.

The root problem is that code like:
    get_status(..., &status);
    cpu_to_le16s(&status);
    if ((status & (1 << BITNO)) == 0) { ... }
gets miscompiled so that the if statement triggers when it shouldn't.

Below is a standalone test program which reproduces the bug.
It does involve some PPC-specific asm(), so the bug may be
in gcc-4.0.0 or it may be in the asm() constraints.

/Mikael

/* gcc4bug2.c
 * Written by Mikael Pettersson <mikpe@csd.uu.se>, 2005-02-25.
 *
 * This program is abstracted from drivers/usb/core/hub.c in
 * the 2.6.11-rc5 Linux kernel sources.
 *
 * With gcc-3.4.3, gcc-3.3.5, or gcc-3.2.3, usb_configure()
 * correctly returns 0.
 *
 * With gcc-4.0.0 20050220, usb_configure() erroneously returns 1.
 * The error occurs at -O1 and higher. -O0 hides the error.
 *
 * All gcc versions were configured for powerpc-unknown-linux-gnu.
 */
#include <stdio.h>

extern __inline__ __attribute__((always_inline))
void st_le16(volatile unsigned short *addr, const unsigned val)
{
    __asm__ __volatile__ ("sthbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr));
}

static __inline__ __attribute__((always_inline))
void swab16s(unsigned short *addr)
{
    st_le16(addr, *addr);
}

unsigned short raw_hubstatus;

void usb_get_status(unsigned short *hubstatusp)
{
    *hubstatusp = raw_hubstatus;
}

int usb_configure(void)
{
    unsigned short hubstatus;

    usb_get_status(&hubstatus);
    swab16s(&hubstatus);
    return (hubstatus & 1) == 0;
}

int main(void)
{
    int ret;

    raw_hubstatus = 0x0300;
    ret = usb_configure();
    if (ret) {
	fprintf(stderr, "gcc bug! usb_configure() returned %d\n", ret);
	return 1;
    } else
	return 0;
}

^ permalink raw reply

* Re: [PATCH 2.6.10-rc3][PPC32] Fix Motorola PReP (PowerstackII Utah) PCI IRQ map
From: Sven Luther @ 2005-02-25 12:15 UTC (permalink / raw)
  To: Christian
  Cc: Tom Rini, Meelis Roos, Kernel Mailing List, linuxppc-dev,
	Sven Hartge
In-Reply-To: <49984.195.126.66.126.1109332744.squirrel@housecafe.dyndns.org>

On Fri, Feb 25, 2005 at 12:59:04PM +0100, Christian wrote:
> On Fri, February 25, 2005 7:36, Sven Luther said:
> > So, now, we need to find out what the problems where, i think it is
> > something that went in between 2.6.8 and 2.6.10, and leigh said he had
> > some ideas.
> 
> may i ask what patches were applied to a vanilla 2.6.8 kernel to build the
> 2.6.8-d-i then?

Some backports that i got from the list. The complete list of patches is at :

  http://svn.debian.org/wsvn/kernel/trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/?rev=0&sc=0

And i guess the one at hand here is : 

  http://svn.debian.org/wsvn/kernel/trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/powerpc-prep-powerstack-irq.dpatch?op=file&rev=0&sc=0

--- kernel-source-2.6.8.orig/arch/ppc/platforms/prep_pci.c	2004-12-28
08:24:07.000000000 +0100
+++ kernel-source-2.6.8/arch/ppc/platforms/prep_pci.c	2005-01-03
11:15:30.604274816 +0100ll lines beginning with `## DP:' are a description of
the patch.
## DP: Description: Fix PReP - motorola powerstack II utah pci irq mapping.
## DP: Patch author: Tom Rini <trini@kernel.crashing.org>
## DP: Upstream status: backport

. $(dirname $0)/DPATCH

@DPATCH@
@@ -115,13 +115,13 @@
 static char Utah_pci_IRQ_map[23] __prepdata =
 {
         0,   /* Slot 0  - unused */
-        0,   /* Slot 1  - unused */
+        4,   /* Slot 1  - IDE - SL82C105 */
         5,   /* Slot 2  - SCSI - NCR825A  */
         0,   /* Slot 3  - unused */
-        1,   /* Slot 4  - Ethernet - DEC2114x */
+        3,   /* Slot 4  - Ethernet - DEC2114x */
         0,   /* Slot 5  - unused */
-        3,   /* Slot 6  - PCI Card slot #1 */
-        4,   /* Slot 7  - PCI Card slot #2 */
+        2,   /* Slot 6  - PCI Card slot #1 */
+        3,   /* Slot 7  - PCI Card slot #2 */
         5,   /* Slot 8  - PCI Card slot #3 */
         5,   /* Slot 9  - PCI Bridge */
              /* added here in case we ever support PCI bridges */

Friendly,

Sven Luther

^ permalink raw reply

* Re: [PATCH 2.6.10-rc3][PPC32] Fix Motorola PReP (PowerstackII Utah) PCI IRQ map
From: Christian @ 2005-02-25 11:59 UTC (permalink / raw)
  To: Sven Luther
  Cc: Tom Rini, Christian Kujau, Meelis Roos, Kernel Mailing List,
	linuxppc-dev, Sven Hartge
In-Reply-To: <20050225063609.GA21244@pegasos>

On Fri, February 25, 2005 7:36, Sven Luther said:
> So, now, we need to find out what the problems where, i think it is
> something that went in between 2.6.8 and 2.6.10, and leigh said he had
> some ideas.

may i ask what patches were applied to a vanilla 2.6.8 kernel to build the
2.6.8-d-i then?

thanks,
Christian.
-- 
make bzImage, not war

^ permalink raw reply

* Re: Stuck in booting 2.6.10-ac11 on Memec Design FF1152...
From: Andrei Konovalov @ 2005-02-25 11:59 UTC (permalink / raw)
  To: Finn S. Nielsen; +Cc: linuxppc-embedded
In-Reply-To: <001b01c51b2d$46378890$0c2ca8c0@FNIBM>

Finn S. Nielsen wrote:
> Hi Jakob,
> 
> I noticed on the embedded powerpc mailing list, that you are working w. linux on the Memec V2P20 FF1152 board.
> I have one too and I'm given the task to get a linux up and running on it...
> 
> What kernel version are you using and where did you get the source ?.
> It seems to me that in the official source tree, there is only support
> for the Xilinx ML300 board - or am I missing something?

If you are speaking about 2.6 then you aren't missing anything.

> Montavista and  MIND systems say they have a port for the memec board, but if an open

MontaVista's code for memec is in linuxppc-2.4 tree.
http://ppc.bkbits.net:8080/linuxppc-2.4/cset@1.1282

We've used 2VP7-FG456 board with the P160 COMM module.


Best rewgards,
Andrei

> source port exists, I'd prefer that.
> 
> Best regards,
> 
> Finn S. Nielsen
> IO Technologies a/s
> Carl Jacobsens Vej 16, opg. 6, 3 sal
> 2500 Valby
> Denmark
> Tlp (direct): +45 36188109
> Fax:. +45 36188101
> Check out our new website: http://www.iotech.dk
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded

^ permalink raw reply

* Stuck in booting 2.6.10-ac11 on Memec Design FF1152...
From: Finn S. Nielsen @ 2005-02-25 11:29 UTC (permalink / raw)
  To: linuxppc-embedded

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

Hi Jakob,

I noticed on the embedded powerpc mailing list, that you are working w. linux on the Memec V2P20 FF1152 board.
I have one too and I'm given the task to get a linux up and running on it...

What kernel version are you using and where did you get the source ?. It seems to me that in the official source tree, there is only support for the Xilinx ML300 board - or am I missing something ?Montavista and MIND systems say they have a port for the memec board, but if an open source port exists, I'd prefer that.

Best regards,

Finn S. Nielsen
IO Technologies a/s
Carl Jacobsens Vej 16, opg. 6, 3 sal
2500 Valby
Denmark
Tlp (direct): +45 36188109
Fax:. +45 36188101
Check out our new website: http://www.iotech.dk

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

^ permalink raw reply

* Re: ppc32 weirdness with gcc-4.0 in 2.6.11-rc4
From: Mikael Pettersson @ 2005-02-25 10:08 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Linux Kernel list, linuxppc-dev list
In-Reply-To: <20050224160139.GF853@devserv.devel.redhat.com>

Jakub Jelinek writes:
 > On Thu, Feb 24, 2005 at 04:08:47PM +0100, Mikael Pettersson wrote:
 > > _However_, the 0k data message is due to a gcc-4.0 bug, and below
 > > you'll find a test program which illustrates it.
 > 
 > http://gcc.gnu.org/PR20196

Jakub's patch to gcc4 solved the mysterious "0k data" message,
but my eMac's USB is still dysfunctional. I'll try to look into
that next week.

/Mikael

^ permalink raw reply

* Re: [PATCH 2.6.10-rc3][PPC32] Fix Motorola PReP (PowerstackII Utah) PCI IRQ map
From: Sven Luther @ 2005-02-25  6:36 UTC (permalink / raw)
  To: Christian Kujau
  Cc: Tom Rini, Meelis Roos, Kernel Mailing List, linuxppc-dev,
	Sven Hartge
In-Reply-To: <421E7033.1030600@g-house.de>

On Fri, Feb 25, 2005 at 01:24:19AM +0100, Christian Kujau wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Sven Luther wrote:
> > 
> > Oh, damn, need to fix my daily builder, should be ok for tomorrow. IN the
> > meanwhile, you can try : 
> > 
> >   http://people.debian.org/~luther/d-i/images/2005-02-23/powerpc/netboot/vmlinuz-prep.initrd
> 
> oh, what fun - it's booting! de4x5 is loading (although i build my kernels
> with a (compiled in) tulip driver). sym53c8xx gets loaded and initializing
> the scsi bus is *not* blocking all other activities as usual.
> 
> here are the logs:
> 
> http://nerdbynature.de/bits/hal/d-i-2005.02.23/  (working 2.6.8 from Sven)
> http://nerdbynature.de/bits/hal/2.6.11-rc3/      (scsi errors)
> 
> (note: i still have no disks attached)

So, now, we need to find out what the problems where, i think it is something
that went in between 2.6.8 and 2.6.10, and leigh said he had some ideas. Leigh
can you elaborate on those ? 

Friendly,

Sven Luther

^ permalink raw reply

* Re: looking for help with scomc/scomd registers on 970
From: Benjamin Herrenschmidt @ 2005-02-25  4:33 UTC (permalink / raw)
  To: Chris Friesen; +Cc: linuxppc-dev list, linuxppc64-dev
In-Reply-To: <421E06B9.2000504@nortel.com>

On Thu, 2005-02-24 at 10:54 -0600, Chris Friesen wrote:
> Not strictly linux related, but I thought someone might know the answer.
> 
> I've got a request from someone that wants to be able to flush the L2 on 
> the 970.
> 
> The user manual has a procedure to do this, but it involves first 
> flipping the cache to direct-mapped mode by setting SCOM register 
> 0x43000 bit 0x8000.  The only thing is, I can't find any linux code that 
> ever touches the SCOM stuff, and the manual has no examples of *reading* 
> from the SCOM area, just writing to it, so I'm not entirely sure how to 
> do that.
> 
> A google search found the following snippet of darwin code:
> 
> 
> lis r8,cFIR ; Get the Core FIR register address
> ori r8,r8,0x8000 ; Set to read data
> sync
> mtspr scomc,r8 ; Request the Core FIR
> mfspr r25,scomd ; Get the source
> mfspr r8,scomc ; Get back the status (we just ignore it)
> sync
> isync	
> 			
> 
> 
> This implies that bit 0x8000 needs to be set to specify a read command, 
> and that we need to read the status after the read.  Does anyone know if 
> this is in fact the case?

I think so. Also, there are some erratas with early 970's where the
stuff is shifted one bit. The Darwin source is a good reference for
that.

> Also, in that code they make reference to early chip revisions that 
> returned scom reads shifted by one bit.  Does anyone know which versions 
> are affected?

I think all non-FX.

Ben.

^ permalink raw reply

* Re: Gigibit ethernet ports on Ocotea + 2.6.10
From: Eugene Surovegin @ 2005-02-25  4:20 UTC (permalink / raw)
  To: Howard, Marc; +Cc: Linuxppc-embedded
In-Reply-To: <91B22F93A880FA48879475E134D6F0BE8E7CB9@CA1EXCLV02.adcorp.kla-tencor.com>

On Thu, Feb 24, 2005 at 06:42:40PM -0800, Howard, Marc wrote:
> console=ttyS0,115200 root=/dev/nfs rw
> nfsroot=192.168.168.108:/projects/targets/ppc_4xx
> ip=192.168.168.111:192.168.168.108:192.168.168.108:255.255.255.0:ppc440:
> :off

You haven't searched archives very hard :). 

Format of ip=... can be found in net/ipv4/ipconfig.c:

/*
 *  Decode any IP configuration options in the "ip=" or "nfsaddrs=" kernel
 *  command line parameter. It consists of option fields separated by colons in
 *  the following order:
 *
 *  <client-ip>:<server-ip>:<gw-ip>:<netmask>:<host name>:<device>:<PROTO>
 *
 *  Any of the fields can be empty which means to use a default value:
 *      <client-ip>     - address given by BOOTP or RARP
 *      <server-ip>     - address of host returning BOOTP or RARP packet
 *      <gw-ip>         - none, or the address returned by BOOTP
 *      <netmask>       - automatically determined from <client-ip>, or the
 *                        one returned by BOOTP
 *      <host name>     - <client-ip> in ASCII notation, or the name returned
 *                        by BOOTP
 *      <device>        - use all available devices
 *      <PROTO>:
 *         off|none         - don't do autoconfig at all (DEFAULT)
 *         on|any           - use any configured protocol
 *         dhcp|bootp|rarp  - use only the specified protocol
 *         both             - use both BOOTP and RARP (not DHCP)
 */


BTW, looks like your ip=.. line is incorrect, you missed <device> 
parameter.

--
Eugene

^ permalink raw reply

* Gigibit ethernet ports on Ocotea + 2.6.10
From: Howard, Marc @ 2005-02-25  2:42 UTC (permalink / raw)
  To: Linuxppc-embedded

Hi,

Are there any patches to 2.6.10 that are needed to make the gigabit
ethernet ports (eth2 and eth3) work on Ocotea?  I can boot on eth2 using
U-Boot and get to the point where linux is (supposedly) making a BOOTP
request (although there is no traffic present on that interface).
According to my archive searching the fixes should already be in there.
Is there a pending patch repository somewhere?

As a side question are there any kernel command line options that would
force eth2 to a fixed IP address?  I'm currently using:

console=3DttyS0,115200 root=3D/dev/nfs rw
nfsroot=3D192.168.168.108:/projects/targets/ppc_4xx
ip=3D192.168.168.111:192.168.168.108:192.168.168.108:255.255.255.0:ppc440=
:
:off

...but this of course doesn't associate eth2 with the desired IP address
(192.168.168.111)

Thanks,

Marc W. Howard

^ permalink raw reply

* Re: [PATCH 2.6.10-rc3][PPC32] Fix Motorola PReP (PowerstackII Utah) PCI IRQ map
From: Christian Kujau @ 2005-02-25  0:24 UTC (permalink / raw)
  To: Sven Luther
  Cc: Tom Rini, Meelis Roos, Sven Hartge, Kernel Mailing List,
	linuxppc-dev
In-Reply-To: <20050224160657.GB11197@pegasos>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sven Luther wrote:
> 
> Oh, damn, need to fix my daily builder, should be ok for tomorrow. IN the
> meanwhile, you can try : 
> 
>   http://people.debian.org/~luther/d-i/images/2005-02-23/powerpc/netboot/vmlinuz-prep.initrd

oh, what fun - it's booting! de4x5 is loading (although i build my kernels
with a (compiled in) tulip driver). sym53c8xx gets loaded and initializing
the scsi bus is *not* blocking all other activities as usual.

here are the logs:

http://nerdbynature.de/bits/hal/d-i-2005.02.23/  (working 2.6.8 from Sven)
http://nerdbynature.de/bits/hal/2.6.11-rc3/      (scsi errors)

(note: i still have no disks attached)

thank you,
Christian.
- --
BOFH excuse #286:

Telecommunications is downgrading.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCHnAz+A7rjkF8z0wRAsxtAJ9DPKaUg9nCWGZKGxqd6sCOtVqu1QCfRyjp
934bVyFtXvuTFYLCgQcAhrI=
=hSxn
-----END PGP SIGNATURE-----

^ permalink raw reply

* Re: [PATCH] Ebony's UBoot awareness
From: Matt Porter @ 2005-02-24 22:27 UTC (permalink / raw)
  To: Shawn Jin; +Cc: ppcembed
In-Reply-To: <c3d0340b05022413437aa5b729@mail.gmail.com>

On Thu, Feb 24, 2005 at 01:43:57PM -0800, Shawn Jin wrote:
> Hi Matt,
> 
> > Can you use the ocotea/luan approach and create an openbios stub
> > in arch/ppc/boot to create the bi_enetaddr infos? The PIBS stub
> > in arch/ppc/boot does this so we can have one path in the platform
> > file that parses the bootinfos.
> 
> I'd like to help if I can follow you. What does PIBS stand for? What
> is the ocotea/luan approach you were talking about? I thought I
> followed the ocotea approach to set up mac addresses.

PIBS is the firmware on all post 440GP ref brds from IBM/AMCC. Take
a look at how both the stock PIBS f/w and U-Boot are supported on
Ocotea by reviewing arch/ppc/boot/simple/pibs.c and
arch/ppc/platforms/4xx/ocotea.c

In this implementation, ocotea.c always expects the enetaddrs in
a birec. Whether they come direct from U-Boot or from some massaging
by the arch/ppc/boot/simple/pibs.c shim doesn't matter. I suggest
following that model which requires creating something like
arch/ppc/boot/simple/openbios.c with a strong symboled load_kernel()
routine that builds the bi-rec for the stock firmware case.

This hides the ugliness in the boot wrapper glue.

-Matt

^ 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