From ilya@total-knowledge.com Mon Aug  1 07:07:36 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 01 Aug 2005 07:07:54 +0100 (BST)
Received: from alpha.total-knowledge.com ([IPv6:::ffff:205.217.158.170]:18139
	"EHLO alpha.total-knowledge.com") by linux-mips.org with ESMTP
	id <S8224832AbVHAGHg>; Mon, 1 Aug 2005 07:07:36 +0100
Received: (qmail 14373 invoked from network); 31 Jul 2005 23:10:37 -0700
Received: from c-24-6-216-150.hsd1.ca.comcast.net (HELO ?192.168.0.238?) (24.6.216.150)
  by alpha.total-knowledge.com with SMTP; 31 Jul 2005 23:10:37 -0700
Message-ID: <42EDBCDD.6000301@total-knowledge.com>
Date:	Sun, 31 Jul 2005 23:10:37 -0700
From:	"Ilya A. Volynets-Evenbakh" <ilya@total-knowledge.com>
Organization: Total Knowledge
User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050723)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: [PATCH] Au1000 Compile fix
Content-Type: multipart/mixed;
 boundary="------------090709020608060104020508"
Return-Path: <ilya@total-knowledge.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8667
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ilya@total-knowledge.com
Precedence: bulk
X-list: linux-mips

This is a multi-part message in MIME format.
--------------090709020608060104020508
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Attached patch fixes compile Au1000 with CONFIG_64BIT_PHYS_ADDR enabled
when gcc-3.4.x is used

-- 
Ilya A. Volynets-Evenbakh
Total Knowledge. CTO
http://www.total-knowledge.com


--------------090709020608060104020508
Content-Type: text/x-patch;
 name="ioremap.h.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ioremap.h.diff"

Index: include/asm-mips/mach-au1x00/ioremap.h
===================================================================
RCS file: /home/cvs/linux/include/asm-mips/mach-au1x00/ioremap.h,v
retrieving revision 1.2
diff -u -r1.2 ioremap.h
--- include/asm-mips/mach-au1x00/ioremap.h	14 Jul 2005 00:17:06 -0000	1.2
+++ include/asm-mips/mach-au1x00/ioremap.h	1 Aug 2005 04:19:04 -0000
@@ -12,7 +12,7 @@
 #include <linux/types.h>
 
 #ifdef CONFIG_64BIT_PHYS_ADDR
-extern inline phys_t __fixup_bigphys_addr(phys_t, phys_t);
+extern phys_t __fixup_bigphys_addr(phys_t, phys_t);
 #else
 static inline phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size)
 {

--------------090709020608060104020508--

From ilya@total-knowledge.com Mon Aug  1 07:13:23 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 01 Aug 2005 07:13:39 +0100 (BST)
Received: from alpha.total-knowledge.com ([IPv6:::ffff:205.217.158.170]:19675
	"EHLO alpha.total-knowledge.com") by linux-mips.org with ESMTP
	id <S8224832AbVHAGNX>; Mon, 1 Aug 2005 07:13:23 +0100
Received: (qmail 14427 invoked from network); 31 Jul 2005 23:16:26 -0700
Received: from c-24-6-216-150.hsd1.ca.comcast.net (HELO ?192.168.0.238?) (24.6.216.150)
  by alpha.total-knowledge.com with SMTP; 31 Jul 2005 23:16:26 -0700
Message-ID: <42EDBE3B.3010503@total-knowledge.com>
Date:	Sun, 31 Jul 2005 23:16:27 -0700
From:	"Ilya A. Volynets-Evenbakh" <ilya@total-knowledge.com>
Organization: Total Knowledge
User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050723)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: Au1000 PCMCIA I/O space?
Content-Type: multipart/mixed;
 boundary="------------080208040607040508030902"
Return-Path: <ilya@total-knowledge.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8668
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ilya@total-knowledge.com
Precedence: bulk
X-list: linux-mips

This is a multi-part message in MIME format.
--------------080208040607040508030902
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Is there any particular reason why Au1000 PCMCIA IO space is not 
included in 36-bit address fixup?
Attached patch fixes it for me, but I'm wondering if there is valid 
reason not to do that.

-- 
Ilya A. Volynets-Evenbakh
Total Knowledge. CTO
http://www.total-knowledge.com


--------------080208040607040508030902
Content-Type: text/x-patch;
 name="pcmcia.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="pcmcia.diff"

Index: arch/mips/au1000/common/setup.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/au1000/common/setup.c,v
retrieving revision 1.25
diff -u -r1.25 setup.c
--- arch/mips/au1000/common/setup.c	11 Jul 2005 10:03:23 -0000	1.25
+++ arch/mips/au1000/common/setup.c	1 Aug 2005 04:18:40 -0000
@@ -179,7 +179,7 @@
 	 * The pseudo address we use is 0xF400 0000. Any address over
 	 * 0xF400 0000 is a pcmcia pseudo address.
 	 */
-	if ((phys_addr >= 0xF4000000) && (phys_addr < 0xFFFFFFFF)) {
+	if ((phys_addr >= 0xF0000000) && (phys_addr < 0xFFFFFFFF)) {
 		return (phys_t)(phys_addr << 4);
 	}
 

--------------080208040607040508030902--

From ppopov@embeddedalley.com Mon Aug  1 07:28:27 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 01 Aug 2005 07:28:46 +0100 (BST)
Received: from smtp003.bizmail.yahoo.com ([IPv6:::ffff:216.136.130.195]:14721
	"HELO smtp003.bizmail.yahoo.com") by linux-mips.org with SMTP
	id <S8224832AbVHAG21>; Mon, 1 Aug 2005 07:28:27 +0100
Received: (qmail 73002 invoked from network); 1 Aug 2005 06:31:30 -0000
Received: from unknown (HELO ?192.168.1.126?) (ppopov@embeddedalley.com@63.194.214.47 with plain)
  by smtp003.bizmail.yahoo.com with SMTP; 1 Aug 2005 06:31:29 -0000
Subject: Re: Au1000 PCMCIA I/O space?
From:	Pete Popov <ppopov@embeddedalley.com>
Reply-To: ppopov@embeddedalley.com
To:	"Ilya A. Volynets-Evenbakh" <ilya@total-knowledge.com>
Cc:	"'linux-mips@linux-mips.org'" <linux-mips@linux-mips.org>
In-Reply-To: <42EDBE3B.3010503@total-knowledge.com>
References: <42EDBE3B.3010503@total-knowledge.com>
Content-Type: text/plain
Organization: Embedded Alley Solutions, Inc
Date:	Sun, 31 Jul 2005 23:31:29 -0700
Message-Id: <1122877889.5014.319.camel@localhost.localdomain>
Mime-Version: 1.0
X-Mailer: Evolution 2.0.4 (2.0.4-4) 
Content-Transfer-Encoding: 7bit
Return-Path: <ppopov@embeddedalley.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8669
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ppopov@embeddedalley.com
Precedence: bulk
X-list: linux-mips

On Sun, 2005-07-31 at 23:16 -0700, Ilya A. Volynets-Evenbakh wrote:
> Is there any particular reason why Au1000 PCMCIA IO space is not 
> included in 36-bit address fixup?
> Attached patch fixes it for me, but I'm wondering if there is valid 
> reason not to do that.

Because it's ioremapped by the au1x pcmcia driver and the driver passes 
the virt address to the pcmcia stack. If this isn't working for you, 
something else is broken.  You only need the fixup when you can't call 
ioremap with the entire 36 bit phys address. For example, the attribute and
common memory space are ioremapped by the "pcmcia stack" in the kernel,
not the low level socket driver over which we have control. Thus, to
work around the fact that you can't easily change the entire pcmcia
stack, you do the fixup thing. 

Unless the pcmcia stack changed, the driver should work as is.

Pete


From ralf@linux-mips.org Mon Aug  1 09:17:48 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 01 Aug 2005 09:18:08 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:33301 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225011AbVHAIRs>; Mon, 1 Aug 2005 09:17:48 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j718Kq4P001901;
	Mon, 1 Aug 2005 09:20:52 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j717pOMh002088;
	Mon, 1 Aug 2005 08:51:24 +0100
Date:	Mon, 1 Aug 2005 08:51:24 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Dominic Sweetman <dom@mips.com>
Cc:	Hiroshi DOYU <Hiroshi_DOYU@montavista.co.jp>,
	linux-mips@linux-mips.org
Subject: Re: how to access structured registers correctly
Message-ID: <20050801075124.GA1972@linux-mips.org>
References: <20050726182531.6341586f.Hiroshi_DOYU@montavista.co.jp> <20050726190643.GD7088@linux-mips.org> <17127.14246.112209.239338@mips.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <17127.14246.112209.239338@mips.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8670
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Wed, Jul 27, 2005 at 08:28:38AM +0100, Dominic Sweetman wrote:

> > > In tx4938, every register access is done by using "volatile" like below.
> > 
> > Linus is right, volatile is a dangerous thing.  If you want to write
> > portable code there's a bunch of things that are not being taken care of
> > by plain C - even though in my opinion foo->somereg = 42 is more
> > readable than writel(somereg, 42).  Among the things the pointer to
> > volatile struct method doesn't catch are endianess conversion that might
> > be necessary on some systems, write merging, dealing with write buffers
> > or completly insane methods of attaching the bus such as the infamous
> > ISA / EISA cage that's attached to the host system through a USB
> > interface.
> 
> Yes, this is far outside the compiler's reach.
> 
> All of which suggests that it would make sense to define a standard function
> which:
> 
> o will produce just one fixed-width write cycle to the destination;
> 
> o will deliver the data ordered so that the MSB of the C value is on
>   the "most significant" bit of the device's data bus, usually the
>   highest numbered bit (this doesn't solve all device endianess
>   issues, but it gives you a well-defined place to start solving them);
> 
> o has a variant which returns only after some indication that the
>   data was delivered;
> 
> The implementation of this function can then conceal the details of
> the CPU and interconnect.
> 
> Such a function should probably not be called "writel()" because that
> sounds like "write long", and "long" is not a fixed-size data type,
> which undermines the promises above...  Tediously, you probably need
> "writei32()", "writei16()", "writei8()"...

Linux has a long tradition of grossly missnaming things, so readw reads
16-bit words, readl reads 32-bit words and readq 64-bit words, that is
each of them operates on just half the quantity a MIPS programmer would
expect. Same for writew, writel and writeq.  Blame the Intel guys for it ;-)

Ranting about grossly missnaming things, the DMA API calls coherent what
MIPS calls non-coherent and vice versa.  I'll stop now, birds are
whistling way to nice behind The Fruit Farm for me to write a good rant
today ;-)

There are ioread8, ioread16, ioread32, iowrite8, iowrite16, iowrite32
already except they're primarily used with I/O busses such as PCI but
that's not really an issue.

   Ralf

From mad@automagically.de Mon Aug  1 09:41:42 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 01 Aug 2005 09:41:57 +0100 (BST)
Received: from moutng.kundenserver.de ([IPv6:::ffff:212.227.126.187]:27382
	"EHLO moutng.kundenserver.de") by linux-mips.org with ESMTP
	id <S8225223AbVHAIlm>; Mon, 1 Aug 2005 09:41:42 +0100
Received: from pD9529032.dip0.t-ipconnect.de [217.82.144.50] (helo=gaspode.madsworld.lan)
	by mrelayeu.kundenserver.de with ESMTP (Nemesis),
	id 0ML2Dk-1DzVug1Fxn-0002ze; Mon, 01 Aug 2005 10:44:46 +0200
Received: from mad by gaspode.madsworld.lan with local (Exim 4.52)
	id 1DzVub-0001Ob-VB; Mon, 01 Aug 2005 10:44:42 +0200
Date:	Mon, 1 Aug 2005 10:44:41 +0200
From:	Markus Dahms <mad@automagically.de>
To:	Mikael Nousiainen <turja@mbnet.fi>
Cc:	linux-mips@linux-mips.org
Subject: Re: New VINO video drivers for Indy
Message-ID: <20050801084441.GA5227@gaspode.automagically.de>
References: <42D4BF49.4040907@mbnet.fi> <20050715110021.GA15740@gaspode.automagically.de> <42D83063.3060505@mbnet.fi> <20050716112745.GA12716@gaspode.automagically.de> <42ED1CBE.4060901@mbnet.fi>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <42ED1CBE.4060901@mbnet.fi>
User-Agent: Mutt/1.5.9i
X-Provags-ID: kundenserver.de abuse@kundenserver.de login:896705dcda322f33ae3752a7fdb3dc09
Return-Path: <mad@automagically.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8671
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: mad@automagically.de
Precedence: bulk
X-list: linux-mips

Mikael Nousiainen wrote:

> Could you provide a sample image ?

http://automagically.de/images/p_indycam_01.jpg
http://automagically.de/images/p_indycam_02.jpg

And (it was hard enough to capture) one with some lines on it:

http://automagically.de/images/p_indycam_03.jpg

These pictures where taken with daylight, some of the colors are a bit
strange[1] (I'll try it artificial light in the evening).

Markus

[1] the cyan looking highlighter on the first picture should really be
    green ;).


From ralf@linux-mips.org Mon Aug  1 11:06:08 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 01 Aug 2005 11:06:23 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:48140 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8224988AbVHAKGI>; Mon, 1 Aug 2005 11:06:08 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j71A99kf008933;
	Mon, 1 Aug 2005 11:09:09 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j71A97Od008932;
	Mon, 1 Aug 2005 11:09:07 +0100
Date:	Mon, 1 Aug 2005 11:09:07 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Hiroshi DOYU <Hiroshi_DOYU@montavista.co.jp>
Cc:	linux-mips@linux-mips.org, mlachwani@mvista.com
Subject: Re: [PATCH 1/1] TX4938: Bugfix for PCI 66MHz of Toshiba RBHMA4500(TX4938)
Message-ID: <20050801100907.GA4205@linux-mips.org>
References: <20050730155310.76cf960d.Hiroshi_DOYU@montavista.co.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050730155310.76cf960d.Hiroshi_DOYU@montavista.co.jp>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8672
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Sat, Jul 30, 2005 at 03:53:10PM +0900, Hiroshi DOYU wrote:

> This patch is against latest cvs.
> Could you review it?

Applied,

  Ralf

From ralf@linux-mips.org Mon Aug  1 11:10:32 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 01 Aug 2005 11:10:47 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:48653 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8224991AbVHAKKc>; Mon, 1 Aug 2005 11:10:32 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j71ADTui009102;
	Mon, 1 Aug 2005 11:13:29 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j71ADSlI009101;
	Mon, 1 Aug 2005 11:13:28 +0100
Date:	Mon, 1 Aug 2005 11:13:28 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
Cc:	linux-mips <linux-mips@linux-mips.org>
Subject: Re: [PATCH 2.6] vr41xx: remove obsolete GIU function call
Message-ID: <20050801101328.GB4205@linux-mips.org>
References: <20050730130452.1b064d36.yuasa@hh.iij4u.or.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050730130452.1b064d36.yuasa@hh.iij4u.or.jp>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8673
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Sat, Jul 30, 2005 at 01:04:52PM +0900, Yoichi Yuasa wrote:

> This patch has removed obsolete GIU function call for vr41xx.
> Please apply this patch.

Thanks, applied,

  Ralf

From ralf@linux-mips.org Mon Aug  1 11:16:32 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 01 Aug 2005 11:17:03 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:56346 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8224991AbVHAKQc>; Mon, 1 Aug 2005 11:16:32 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j71AJX3T009315
	for <linux-mips@linux-mips.org>; Mon, 1 Aug 2005 11:19:33 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j71AJXBH009314
	for linux-mips@linux-mips.org; Mon, 1 Aug 2005 11:19:33 +0100
Date:	Mon, 1 Aug 2005 11:19:33 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	linux-mips@linux-mips.org
Subject: Re: [patch 05/15] Basic MIPS support
Message-ID: <20050801101933.GC4205@linux-mips.org>
References: <resend.4.2972005.trini@kernel.crashing.org> <1.2972005.trini@kernel.crashing.org> <resend.5.2972005.trini@kernel.crashing.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <resend.5.2972005.trini@kernel.crashing.org>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8674
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

Forwarding this as a heads up.  Who cares about kgdb may want to start
working on the necessary bits as the patchset from below will be in 2.6.13.

  Ralf

On Fri, Jul 29, 2005 at 02:19:35PM -0700, Tom Rini wrote:

> CC: Manish Lachwani <mlachwani@mvista.com>, Ralf Baechle <ralf@linux-mips.org>
> This adds basic support to the MIPS architecture as well as support
> specifically for the MIPS Malta and SiByte 1250-SWARM (32 and 64bit), all from
> Manish Lachwani.  This looks like it should work on anything with an
> 8250-compatible uart, and be fairly easy to convert other boards custom uarts
> as needed.
> 
> ---
> 
>  linux-2.6.13-rc3-trini/arch/mips/Kconfig.debug                   |   19 
>  linux-2.6.13-rc3-trini/arch/mips/kernel/Makefile                 |    3 
>  linux-2.6.13-rc3-trini/arch/mips/kernel/irq.c                    |   32 
>  linux-2.6.13-rc3-trini/arch/mips/kernel/kgdb-jmp.c               |   62 
>  linux-2.6.13-rc3-trini/arch/mips/kernel/kgdb-setjmp.S            |   23 
>  linux-2.6.13-rc3-trini/arch/mips/kernel/kgdb.c                   |  292 ++
>  linux-2.6.13-rc3-trini/arch/mips/kernel/kgdb_handler.S           |   58 
>  linux-2.6.13-rc3-trini/arch/mips/kernel/traps.c                  |   26 
>  linux-2.6.13-rc3-trini/arch/mips/mips-boards/generic/Makefile    |    1 
>  linux-2.6.13-rc3-trini/arch/mips/mips-boards/generic/init.c      |   62 
>  linux-2.6.13-rc3-trini/arch/mips/mips-boards/malta/malta_setup.c |    8 
>  linux-2.6.13-rc3-trini/arch/mips/mm/extable.c                    |    7 
>  linux-2.6.13-rc3-trini/arch/mips/sibyte/cfe/setup.c              |   14 
>  linux-2.6.13-rc3-trini/arch/mips/sibyte/sb1250/Makefile          |    1 
>  linux-2.6.13-rc3-trini/arch/mips/sibyte/sb1250/irq.c             |   57 
>  linux-2.6.13-rc3-trini/arch/mips/sibyte/sb1250/irq_handler.S     |    2 
>  linux-2.6.13-rc3-trini/arch/mips/sibyte/sb1250/kgdb_sibyte.c     |  164 +
>  linux-2.6.13-rc3-trini/arch/mips/sibyte/swarm/Makefile           |    2 
>  linux-2.6.13-rc3-trini/include/asm-mips/kdebug.h                 |   47 
>  linux-2.6.13-rc3-trini/include/asm-mips/kgdb.h                   |   22 
>  linux-2.6.13-rc3-trini/lib/Kconfig.debug                         |    7 
>  linux-2.6.13-rc3/arch/mips/kernel/gdb-low.S                      |  370 ---
>  linux-2.6.13-rc3/arch/mips/kernel/gdb-stub.c                     | 1091 ----------
>  linux-2.6.13-rc3/arch/mips/sibyte/swarm/dbg_io.c                 |   76 
>  24 files changed, 729 insertions(+), 1717 deletions(-)
> 
> diff -puN arch/mips/Kconfig.debug~mips-lite arch/mips/Kconfig.debug
> --- linux-2.6.13-rc3/arch/mips/Kconfig.debug~mips-lite	2005-07-29 11:55:31.000000000 -0700
> +++ linux-2.6.13-rc3-trini/arch/mips/Kconfig.debug	2005-07-29 11:55:31.000000000 -0700
> @@ -27,25 +27,6 @@ config DEBUG_STACK_USAGE
>  
>  	  This option will slow down process creation somewhat.
>  
> -config KGDB
> -	bool "Remote GDB kernel debugging"
> -	depends on DEBUG_KERNEL
> -	select DEBUG_INFO
> -	help
> -	  If you say Y here, it will be possible to remotely debug the MIPS
> -	  kernel using gdb. This enlarges your kernel image disk size by
> -	  several megabytes and requires a machine with more than 16 MB,
> -	  better 32 MB RAM to avoid excessive linking time. This is only
> -	  useful for kernel hackers. If unsure, say N.
> -
> -config GDB_CONSOLE
> -	bool "Console output to GDB"
> -	depends on KGDB
> -	help
> -	  If you are using GDB for remote debugging over a serial port and
> -	  would like kernel messages to be formatted into GDB $O packets so
> -	  that GDB prints them as program output, say 'Y'.
> -
>  config SB1XXX_CORELIS
>  	bool "Corelis Debugger"
>  	depends on SIBYTE_SB1xxx_SOC
> diff -L arch/mips/kernel/gdb-low.S -puN arch/mips/kernel/gdb-low.S~mips-lite /dev/null
> --- linux-2.6.13-rc3/arch/mips/kernel/gdb-low.S
> +++ /dev/null	2005-07-25 10:57:32.312383000 -0700
> @@ -1,370 +0,0 @@
> -/*
> - * gdb-low.S contains the low-level trap handler for the GDB stub.
> - *
> - * Copyright (C) 1995 Andreas Busse
> - */
> -#include <linux/config.h>
> -#include <linux/sys.h>
> -
> -#include <asm/asm.h>
> -#include <asm/errno.h>
> -#include <asm/mipsregs.h>
> -#include <asm/regdef.h>
> -#include <asm/stackframe.h>
> -#include <asm/gdb-stub.h>
> -
> -#ifdef CONFIG_MIPS32
> -#define DMFC0	mfc0
> -#define DMTC0	mtc0
> -#define LDC1	lwc1
> -#define SDC1	lwc1
> -#endif
> -#ifdef CONFIG_MIPS64
> -#define DMFC0	dmfc0
> -#define DMTC0	dmtc0
> -#define LDC1	ldc1
> -#define SDC1	ldc1
> -#endif
> -
> -/*
> - * [jsun] We reserves about 2x GDB_FR_SIZE in stack.  The lower (addressed)
> - * part is used to store registers and passed to exception handler.
> - * The upper part is reserved for "call func" feature where gdb client
> - * saves some of the regs, setups call frame and passes args.
> - *
> - * A trace shows about 200 bytes are used to store about half of all regs.
> - * The rest should be big enough for frame setup and passing args.
> - */
> -
> -/*
> - * The low level trap handler
> - */
> -		.align 	5
> -		NESTED(trap_low, GDB_FR_SIZE, sp)
> - 		.set	noat
> -		.set 	noreorder
> -
> -		mfc0	k0, CP0_STATUS
> -		sll	k0, 3     		/* extract cu0 bit */
> -		bltz	k0, 1f
> -		move	k1, sp
> -
> -		/*
> -		 * Called from user mode, go somewhere else.
> -		 */
> -		lui	k1, %hi(saved_vectors)
> -		mfc0	k0, CP0_CAUSE
> -		andi	k0, k0, 0x7c
> -		add	k1, k1, k0
> -		lw	k0, %lo(saved_vectors)(k1)
> -		jr	k0
> -		nop
> -1:
> -		move	k0, sp
> -		subu	sp, k1, GDB_FR_SIZE*2	# see comment above
> -		LONG_S	k0, GDB_FR_REG29(sp)
> -		LONG_S	$2, GDB_FR_REG2(sp)
> -
> -/*
> - * First save the CP0 and special registers
> - */
> -
> -		mfc0	v0, CP0_STATUS
> -		LONG_S	v0, GDB_FR_STATUS(sp)
> -		mfc0	v0, CP0_CAUSE
> -		LONG_S	v0, GDB_FR_CAUSE(sp)
> -		DMFC0	v0, CP0_EPC
> -		LONG_S	v0, GDB_FR_EPC(sp)
> -		DMFC0	v0, CP0_BADVADDR
> -		LONG_S	v0, GDB_FR_BADVADDR(sp)
> -		mfhi	v0
> -		LONG_S	v0, GDB_FR_HI(sp)
> -		mflo	v0
> -		LONG_S	v0, GDB_FR_LO(sp)
> -
> -/*
> - * Now the integer registers
> - */
> -
> -		LONG_S	zero, GDB_FR_REG0(sp)		/* I know... */
> -		LONG_S	$1, GDB_FR_REG1(sp)
> -		/* v0 already saved */
> -		LONG_S	$3, GDB_FR_REG3(sp)
> -		LONG_S	$4, GDB_FR_REG4(sp)
> -		LONG_S	$5, GDB_FR_REG5(sp)
> -		LONG_S	$6, GDB_FR_REG6(sp)
> -		LONG_S	$7, GDB_FR_REG7(sp)
> -		LONG_S	$8, GDB_FR_REG8(sp)
> -		LONG_S	$9, GDB_FR_REG9(sp)
> -		LONG_S	$10, GDB_FR_REG10(sp)
> -		LONG_S	$11, GDB_FR_REG11(sp)
> -		LONG_S	$12, GDB_FR_REG12(sp)
> -		LONG_S	$13, GDB_FR_REG13(sp)
> -		LONG_S	$14, GDB_FR_REG14(sp)
> -		LONG_S	$15, GDB_FR_REG15(sp)
> -		LONG_S	$16, GDB_FR_REG16(sp)
> -		LONG_S	$17, GDB_FR_REG17(sp)
> -		LONG_S	$18, GDB_FR_REG18(sp)
> -		LONG_S	$19, GDB_FR_REG19(sp)
> -		LONG_S	$20, GDB_FR_REG20(sp)
> -		LONG_S	$21, GDB_FR_REG21(sp)
> -		LONG_S	$22, GDB_FR_REG22(sp)
> -		LONG_S	$23, GDB_FR_REG23(sp)
> -		LONG_S	$24, GDB_FR_REG24(sp)
> -		LONG_S	$25, GDB_FR_REG25(sp)
> -		LONG_S	$26, GDB_FR_REG26(sp)
> -		LONG_S	$27, GDB_FR_REG27(sp)
> -		LONG_S	$28, GDB_FR_REG28(sp)
> -		/* sp already saved */
> -		LONG_S	$30, GDB_FR_REG30(sp)
> -		LONG_S	$31, GDB_FR_REG31(sp)
> -
> -		CLI				/* disable interrupts */
> -
> -/*
> - * Followed by the floating point registers
> - */
> -		mfc0	v0, CP0_STATUS		/* FPU enabled? */
> -		srl	v0, v0, 16
> -		andi	v0, v0, (ST0_CU1 >> 16)
> -
> -		beqz	v0,2f			/* disabled, skip */
> -		 nop
> -
> -		SDC1	$0, GDB_FR_FPR0(sp)
> -		SDC1	$1, GDB_FR_FPR1(sp)
> -		SDC1	$2, GDB_FR_FPR2(sp)
> -		SDC1	$3, GDB_FR_FPR3(sp)
> -		SDC1	$4, GDB_FR_FPR4(sp)
> -		SDC1	$5, GDB_FR_FPR5(sp)
> -		SDC1	$6, GDB_FR_FPR6(sp)
> -		SDC1	$7, GDB_FR_FPR7(sp)
> -		SDC1	$8, GDB_FR_FPR8(sp)
> -		SDC1	$9, GDB_FR_FPR9(sp)
> -		SDC1	$10, GDB_FR_FPR10(sp)
> -		SDC1	$11, GDB_FR_FPR11(sp)
> -		SDC1	$12, GDB_FR_FPR12(sp)
> -		SDC1	$13, GDB_FR_FPR13(sp)
> -		SDC1	$14, GDB_FR_FPR14(sp)
> -		SDC1	$15, GDB_FR_FPR15(sp)
> -		SDC1	$16, GDB_FR_FPR16(sp)
> -		SDC1	$17, GDB_FR_FPR17(sp)
> -		SDC1	$18, GDB_FR_FPR18(sp)
> -		SDC1	$19, GDB_FR_FPR19(sp)
> -		SDC1	$20, GDB_FR_FPR20(sp)
> -		SDC1	$21, GDB_FR_FPR21(sp)
> -		SDC1	$22, GDB_FR_FPR22(sp)
> -		SDC1	$23, GDB_FR_FPR23(sp)
> -		SDC1	$24, GDB_FR_FPR24(sp)
> -		SDC1	$25, GDB_FR_FPR25(sp)
> -		SDC1	$26, GDB_FR_FPR26(sp)
> -		SDC1	$27, GDB_FR_FPR27(sp)
> -		SDC1	$28, GDB_FR_FPR28(sp)
> -		SDC1	$29, GDB_FR_FPR29(sp)
> -		SDC1	$30, GDB_FR_FPR30(sp)
> -		SDC1	$31, GDB_FR_FPR31(sp)
> -
> -/*
> - * FPU control registers
> - */
> -
> -		cfc1	v0, CP1_STATUS
> -		LONG_S	v0, GDB_FR_FSR(sp)
> -		cfc1	v0, CP1_REVISION
> -		LONG_S	v0, GDB_FR_FIR(sp)
> -
> -/*
> - * Current stack frame ptr
> - */
> -
> -2:
> -		LONG_S	sp, GDB_FR_FRP(sp)
> -
> -/*
> - * CP0 registers (R4000/R4400 unused registers skipped)
> - */
> -
> -		mfc0	v0, CP0_INDEX
> -		LONG_S	v0, GDB_FR_CP0_INDEX(sp)
> -		mfc0	v0, CP0_RANDOM
> -		LONG_S	v0, GDB_FR_CP0_RANDOM(sp)
> -		DMFC0	v0, CP0_ENTRYLO0
> -		LONG_S	v0, GDB_FR_CP0_ENTRYLO0(sp)
> -		DMFC0	v0, CP0_ENTRYLO1
> -		LONG_S	v0, GDB_FR_CP0_ENTRYLO1(sp)
> -		DMFC0	v0, CP0_CONTEXT
> -		LONG_S	v0, GDB_FR_CP0_CONTEXT(sp)
> -		mfc0	v0, CP0_PAGEMASK
> -		LONG_S	v0, GDB_FR_CP0_PAGEMASK(sp)
> -		mfc0	v0, CP0_WIRED
> -		LONG_S	v0, GDB_FR_CP0_WIRED(sp)
> -		DMFC0	v0, CP0_ENTRYHI
> -		LONG_S	v0, GDB_FR_CP0_ENTRYHI(sp)
> -		mfc0	v0, CP0_PRID
> -		LONG_S	v0, GDB_FR_CP0_PRID(sp)
> -
> -		.set	at
> -
> -/*
> - * Continue with the higher level handler
> - */
> -
> -		move	a0,sp
> -
> -		jal	handle_exception
> -		 nop
> -
> -/*
> - * Restore all writable registers, in reverse order
> - */
> -
> -		.set	noat
> -
> -		LONG_L	v0, GDB_FR_CP0_ENTRYHI(sp)
> -		LONG_L	v1, GDB_FR_CP0_WIRED(sp)
> -		DMTC0	v0, CP0_ENTRYHI
> -		mtc0	v1, CP0_WIRED
> -		LONG_L	v0, GDB_FR_CP0_PAGEMASK(sp)
> -		LONG_L	v1, GDB_FR_CP0_ENTRYLO1(sp)
> -		mtc0	v0, CP0_PAGEMASK
> -		DMTC0	v1, CP0_ENTRYLO1
> -		LONG_L	v0, GDB_FR_CP0_ENTRYLO0(sp)
> -		LONG_L	v1, GDB_FR_CP0_INDEX(sp)
> -		DMTC0	v0, CP0_ENTRYLO0
> -		LONG_L	v0, GDB_FR_CP0_CONTEXT(sp)
> -		mtc0	v1, CP0_INDEX
> -		DMTC0	v0, CP0_CONTEXT
> -
> -
> -/*
> - * Next, the floating point registers
> - */
> -		mfc0	v0, CP0_STATUS		/* check if the FPU is enabled */
> -		srl	v0, v0, 16
> -		andi	v0, v0, (ST0_CU1 >> 16)
> -
> -		beqz	v0, 3f			/* disabled, skip */
> -		 nop
> -
> -		LDC1	$31, GDB_FR_FPR31(sp)
> -		LDC1	$30, GDB_FR_FPR30(sp)
> -		LDC1	$29, GDB_FR_FPR29(sp)
> -		LDC1	$28, GDB_FR_FPR28(sp)
> -		LDC1	$27, GDB_FR_FPR27(sp)
> -		LDC1	$26, GDB_FR_FPR26(sp)
> -		LDC1	$25, GDB_FR_FPR25(sp)
> -		LDC1	$24, GDB_FR_FPR24(sp)
> -		LDC1	$23, GDB_FR_FPR23(sp)
> -		LDC1	$22, GDB_FR_FPR22(sp)
> -		LDC1	$21, GDB_FR_FPR21(sp)
> -		LDC1	$20, GDB_FR_FPR20(sp)
> -		LDC1	$19, GDB_FR_FPR19(sp)
> -		LDC1	$18, GDB_FR_FPR18(sp)
> -		LDC1	$17, GDB_FR_FPR17(sp)
> -		LDC1	$16, GDB_FR_FPR16(sp)
> -		LDC1	$15, GDB_FR_FPR15(sp)
> -		LDC1	$14, GDB_FR_FPR14(sp)
> -		LDC1	$13, GDB_FR_FPR13(sp)
> -		LDC1	$12, GDB_FR_FPR12(sp)
> -		LDC1	$11, GDB_FR_FPR11(sp)
> -		LDC1	$10, GDB_FR_FPR10(sp)
> -		LDC1	$9, GDB_FR_FPR9(sp)
> -		LDC1	$8, GDB_FR_FPR8(sp)
> -		LDC1	$7, GDB_FR_FPR7(sp)
> -		LDC1	$6, GDB_FR_FPR6(sp)
> -		LDC1	$5, GDB_FR_FPR5(sp)
> -		LDC1	$4, GDB_FR_FPR4(sp)
> -		LDC1	$3, GDB_FR_FPR3(sp)
> -		LDC1	$2, GDB_FR_FPR2(sp)
> -		LDC1	$1, GDB_FR_FPR1(sp)
> -		LDC1	$0, GDB_FR_FPR0(sp)
> -
> -/*
> - * Now the CP0 and integer registers
> - */
> -
> -3:
> -		mfc0	t0, CP0_STATUS
> -		ori	t0, 0x1f
> -		xori	t0, 0x1f
> -		mtc0	t0, CP0_STATUS
> -
> -		LONG_L	v0, GDB_FR_STATUS(sp)
> -		LONG_L	v1, GDB_FR_EPC(sp)
> -		mtc0	v0, CP0_STATUS
> -		DMTC0	v1, CP0_EPC
> -		LONG_L	v0, GDB_FR_HI(sp)
> -		LONG_L	v1, GDB_FR_LO(sp)
> -		mthi	v0
> -		mtlo	v1
> -		LONG_L	$31, GDB_FR_REG31(sp)
> -		LONG_L	$30, GDB_FR_REG30(sp)
> -		LONG_L	$28, GDB_FR_REG28(sp)
> -		LONG_L	$27, GDB_FR_REG27(sp)
> -		LONG_L	$26, GDB_FR_REG26(sp)
> -		LONG_L	$25, GDB_FR_REG25(sp)
> -		LONG_L	$24, GDB_FR_REG24(sp)
> -		LONG_L	$23, GDB_FR_REG23(sp)
> -		LONG_L	$22, GDB_FR_REG22(sp)
> -		LONG_L	$21, GDB_FR_REG21(sp)
> -		LONG_L	$20, GDB_FR_REG20(sp)
> -		LONG_L	$19, GDB_FR_REG19(sp)
> -		LONG_L	$18, GDB_FR_REG18(sp)
> -		LONG_L	$17, GDB_FR_REG17(sp)
> -		LONG_L	$16, GDB_FR_REG16(sp)
> -		LONG_L	$15, GDB_FR_REG15(sp)
> -		LONG_L	$14, GDB_FR_REG14(sp)
> -		LONG_L	$13, GDB_FR_REG13(sp)
> -		LONG_L	$12, GDB_FR_REG12(sp)
> -		LONG_L	$11, GDB_FR_REG11(sp)
> -		LONG_L	$10, GDB_FR_REG10(sp)
> -		LONG_L	$9, GDB_FR_REG9(sp)
> -		LONG_L	$8, GDB_FR_REG8(sp)
> -		LONG_L	$7, GDB_FR_REG7(sp)
> -		LONG_L	$6, GDB_FR_REG6(sp)
> -		LONG_L	$5, GDB_FR_REG5(sp)
> -		LONG_L	$4, GDB_FR_REG4(sp)
> -		LONG_L	$3, GDB_FR_REG3(sp)
> -		LONG_L	$2, GDB_FR_REG2(sp)
> -		LONG_L	$1, GDB_FR_REG1(sp)
> -#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
> -		LONG_L	k0, GDB_FR_EPC(sp)
> -		LONG_L	$29, GDB_FR_REG29(sp)		/* Deallocate stack */
> -		jr	k0
> -		rfe
> -#else
> -		LONG_L	sp, GDB_FR_REG29(sp)		/* Deallocate stack */
> -
> -		.set	mips3
> -		eret
> -		.set	mips0
> -#endif
> -		.set	at
> -		.set	reorder
> -		END(trap_low)
> -
> -LEAF(kgdb_read_byte)
> -4:		lb	t0, (a0)
> -		sb	t0, (a1)
> -		li	v0, 0
> -		jr	ra
> -		.section __ex_table,"a"
> -		PTR	4b, kgdbfault
> -		.previous
> -		END(kgdb_read_byte)
> -
> -LEAF(kgdb_write_byte)
> -5:		sb	a0, (a1)
> -		li	v0, 0
> -		jr	ra
> -		.section __ex_table,"a"
> -		PTR	5b, kgdbfault
> -		.previous
> -		END(kgdb_write_byte)
> -
> -		.type	kgdbfault@function
> -		.ent	kgdbfault
> -
> -kgdbfault:	li	v0, -EFAULT
> -		jr	ra
> -		.end	kgdbfault
> diff -L arch/mips/kernel/gdb-stub.c -puN arch/mips/kernel/gdb-stub.c~mips-lite /dev/null
> --- linux-2.6.13-rc3/arch/mips/kernel/gdb-stub.c
> +++ /dev/null	2005-07-25 10:57:32.312383000 -0700
> @@ -1,1091 +0,0 @@
> -/*
> - *  arch/mips/kernel/gdb-stub.c
> - *
> - *  Originally written by Glenn Engel, Lake Stevens Instrument Division
> - *
> - *  Contributed by HP Systems
> - *
> - *  Modified for SPARC by Stu Grossman, Cygnus Support.
> - *
> - *  Modified for Linux/MIPS (and MIPS in general) by Andreas Busse
> - *  Send complaints, suggestions etc. to <andy@waldorf-gmbh.de>
> - *
> - *  Copyright (C) 1995 Andreas Busse
> - *
> - *  Copyright (C) 2003 MontaVista Software Inc.
> - *  Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
> - */
> -
> -/*
> - *  To enable debugger support, two things need to happen.  One, a
> - *  call to set_debug_traps() is necessary in order to allow any breakpoints
> - *  or error conditions to be properly intercepted and reported to gdb.
> - *  Two, a breakpoint needs to be generated to begin communication.  This
> - *  is most easily accomplished by a call to breakpoint().  Breakpoint()
> - *  simulates a breakpoint by executing a BREAK instruction.
> - *
> - *
> - *    The following gdb commands are supported:
> - *
> - * command          function                               Return value
> - *
> - *    g             return the value of the CPU registers  hex data or ENN
> - *    G             set the value of the CPU registers     OK or ENN
> - *
> - *    mAA..AA,LLLL  Read LLLL bytes at address AA..AA      hex data or ENN
> - *    MAA..AA,LLLL: Write LLLL bytes at address AA.AA      OK or ENN
> - *
> - *    c             Resume at current address              SNN   ( signal NN)
> - *    cAA..AA       Continue at address AA..AA             SNN
> - *
> - *    s             Step one instruction                   SNN
> - *    sAA..AA       Step one instruction from AA..AA       SNN
> - *
> - *    k             kill
> - *
> - *    ?             What was the last sigval ?             SNN   (signal NN)
> - *
> - *    bBB..BB	    Set baud rate to BB..BB		   OK or BNN, then sets
> - *							   baud rate
> - *
> - * All commands and responses are sent with a packet which includes a
> - * checksum.  A packet consists of
> - *
> - * $<packet info>#<checksum>.
> - *
> - * where
> - * <packet info> :: <characters representing the command or response>
> - * <checksum>    :: < two hex digits computed as modulo 256 sum of <packetinfo>>
> - *
> - * When a packet is received, it is first acknowledged with either '+' or '-'.
> - * '+' indicates a successful transfer.  '-' indicates a failed transfer.
> - *
> - * Example:
> - *
> - * Host:                  Reply:
> - * $m0,10#2a               +$00010203040506070809101112131415#42
> - *
> - *
> - *  ==============
> - *  MORE EXAMPLES:
> - *  ==============
> - *
> - *  For reference -- the following are the steps that one
> - *  company took (RidgeRun Inc) to get remote gdb debugging
> - *  going. In this scenario the host machine was a PC and the
> - *  target platform was a Galileo EVB64120A MIPS evaluation
> - *  board.
> - *
> - *  Step 1:
> - *  First download gdb-5.0.tar.gz from the internet.
> - *  and then build/install the package.
> - *
> - *  Example:
> - *    $ tar zxf gdb-5.0.tar.gz
> - *    $ cd gdb-5.0
> - *    $ ./configure --target=mips-linux-elf
> - *    $ make
> - *    $ install
> - *    $ which mips-linux-elf-gdb
> - *    /usr/local/bin/mips-linux-elf-gdb
> - *
> - *  Step 2:
> - *  Configure linux for remote debugging and build it.
> - *
> - *  Example:
> - *    $ cd ~/linux
> - *    $ make menuconfig <go to "Kernel Hacking" and turn on remote debugging>
> - *    $ make
> - *
> - *  Step 3:
> - *  Download the kernel to the remote target and start
> - *  the kernel running. It will promptly halt and wait
> - *  for the host gdb session to connect. It does this
> - *  since the "Kernel Hacking" option has defined
> - *  CONFIG_KGDB which in turn enables your calls
> - *  to:
> - *     set_debug_traps();
> - *     breakpoint();
> - *
> - *  Step 4:
> - *  Start the gdb session on the host.
> - *
> - *  Example:
> - *    $ mips-linux-elf-gdb vmlinux
> - *    (gdb) set remotebaud 115200
> - *    (gdb) target remote /dev/ttyS1
> - *    ...at this point you are connected to
> - *       the remote target and can use gdb
> - *       in the normal fasion. Setting
> - *       breakpoints, single stepping,
> - *       printing variables, etc.
> - */
> -#include <linux/config.h>
> -#include <linux/string.h>
> -#include <linux/kernel.h>
> -#include <linux/signal.h>
> -#include <linux/sched.h>
> -#include <linux/mm.h>
> -#include <linux/console.h>
> -#include <linux/init.h>
> -#include <linux/smp.h>
> -#include <linux/spinlock.h>
> -#include <linux/slab.h>
> -#include <linux/reboot.h>
> -
> -#include <asm/asm.h>
> -#include <asm/cacheflush.h>
> -#include <asm/mipsregs.h>
> -#include <asm/pgtable.h>
> -#include <asm/system.h>
> -#include <asm/gdb-stub.h>
> -#include <asm/inst.h>
> -
> -/*
> - * external low-level support routines
> - */
> -
> -extern int putDebugChar(char c);    /* write a single character      */
> -extern char getDebugChar(void);     /* read and return a single char */
> -extern void trap_low(void);
> -
> -/*
> - * breakpoint and test functions
> - */
> -extern void breakpoint(void);
> -extern void breakinst(void);
> -extern void async_breakpoint(void);
> -extern void async_breakinst(void);
> -extern void adel(void);
> -
> -/*
> - * local prototypes
> - */
> -
> -static void getpacket(char *buffer);
> -static void putpacket(char *buffer);
> -static int computeSignal(int tt);
> -static int hex(unsigned char ch);
> -static int hexToInt(char **ptr, int *intValue);
> -static int hexToLong(char **ptr, long *longValue);
> -static unsigned char *mem2hex(char *mem, char *buf, int count, int may_fault);
> -void handle_exception(struct gdb_regs *regs);
> -
> -int kgdb_enabled;
> -
> -/*
> - * spin locks for smp case
> - */
> -static spinlock_t kgdb_lock = SPIN_LOCK_UNLOCKED;
> -static spinlock_t kgdb_cpulock[NR_CPUS] = { [0 ... NR_CPUS-1] = SPIN_LOCK_UNLOCKED};
> -
> -/*
> - * BUFMAX defines the maximum number of characters in inbound/outbound buffers
> - * at least NUMREGBYTES*2 are needed for register packets
> - */
> -#define BUFMAX 2048
> -
> -static char input_buffer[BUFMAX];
> -static char output_buffer[BUFMAX];
> -static int initialized;	/* !0 means we've been initialized */
> -static int kgdb_started;
> -static const char hexchars[]="0123456789abcdef";
> -
> -/* Used to prevent crashes in memory access.  Note that they'll crash anyway if
> -   we haven't set up fault handlers yet... */
> -int kgdb_read_byte(unsigned char *address, unsigned char *dest);
> -int kgdb_write_byte(unsigned char val, unsigned char *dest);
> -
> -/*
> - * Convert ch from a hex digit to an int
> - */
> -static int hex(unsigned char ch)
> -{
> -	if (ch >= 'a' && ch <= 'f')
> -		return ch-'a'+10;
> -	if (ch >= '0' && ch <= '9')
> -		return ch-'0';
> -	if (ch >= 'A' && ch <= 'F')
> -		return ch-'A'+10;
> -	return -1;
> -}
> -
> -/*
> - * scan for the sequence $<data>#<checksum>
> - */
> -static void getpacket(char *buffer)
> -{
> -	unsigned char checksum;
> -	unsigned char xmitcsum;
> -	int i;
> -	int count;
> -	unsigned char ch;
> -
> -	do {
> -		/*
> -		 * wait around for the start character,
> -		 * ignore all other characters
> -		 */
> -		while ((ch = (getDebugChar() & 0x7f)) != '$') ;
> -
> -		checksum = 0;
> -		xmitcsum = -1;
> -		count = 0;
> -
> -		/*
> -		 * now, read until a # or end of buffer is found
> -		 */
> -		while (count < BUFMAX) {
> -			ch = getDebugChar();
> -			if (ch == '#')
> -				break;
> -			checksum = checksum + ch;
> -			buffer[count] = ch;
> -			count = count + 1;
> -		}
> -
> -		if (count >= BUFMAX)
> -			continue;
> -
> -		buffer[count] = 0;
> -
> -		if (ch == '#') {
> -			xmitcsum = hex(getDebugChar() & 0x7f) << 4;
> -			xmitcsum |= hex(getDebugChar() & 0x7f);
> -
> -			if (checksum != xmitcsum)
> -				putDebugChar('-');	/* failed checksum */
> -			else {
> -				putDebugChar('+'); /* successful transfer */
> -
> -				/*
> -				 * if a sequence char is present,
> -				 * reply the sequence ID
> -				 */
> -				if (buffer[2] == ':') {
> -					putDebugChar(buffer[0]);
> -					putDebugChar(buffer[1]);
> -
> -					/*
> -					 * remove sequence chars from buffer
> -					 */
> -					count = strlen(buffer);
> -					for (i=3; i <= count; i++)
> -						buffer[i-3] = buffer[i];
> -				}
> -			}
> -		}
> -	}
> -	while (checksum != xmitcsum);
> -}
> -
> -/*
> - * send the packet in buffer.
> - */
> -static void putpacket(char *buffer)
> -{
> -	unsigned char checksum;
> -	int count;
> -	unsigned char ch;
> -
> -	/*
> -	 * $<packet info>#<checksum>.
> -	 */
> -
> -	do {
> -		putDebugChar('$');
> -		checksum = 0;
> -		count = 0;
> -
> -		while ((ch = buffer[count]) != 0) {
> -			if (!(putDebugChar(ch)))
> -				return;
> -			checksum += ch;
> -			count += 1;
> -		}
> -
> -		putDebugChar('#');
> -		putDebugChar(hexchars[checksum >> 4]);
> -		putDebugChar(hexchars[checksum & 0xf]);
> -
> -	}
> -	while ((getDebugChar() & 0x7f) != '+');
> -}
> -
> -
> -/*
> - * Convert the memory pointed to by mem into hex, placing result in buf.
> - * Return a pointer to the last char put in buf (null), in case of mem fault,
> - * return 0.
> - * may_fault is non-zero if we are reading from arbitrary memory, but is currently
> - * not used.
> - */
> -static unsigned char *mem2hex(char *mem, char *buf, int count, int may_fault)
> -{
> -	unsigned char ch;
> -
> -	while (count-- > 0) {
> -		if (kgdb_read_byte(mem++, &ch) != 0)
> -			return 0;
> -		*buf++ = hexchars[ch >> 4];
> -		*buf++ = hexchars[ch & 0xf];
> -	}
> -
> -	*buf = 0;
> -
> -	return buf;
> -}
> -
> -/*
> - * convert the hex array pointed to by buf into binary to be placed in mem
> - * return a pointer to the character AFTER the last byte written
> - * may_fault is non-zero if we are reading from arbitrary memory, but is currently
> - * not used.
> - */
> -static char *hex2mem(char *buf, char *mem, int count, int binary, int may_fault)
> -{
> -	int i;
> -	unsigned char ch;
> -
> -	for (i=0; i<count; i++)
> -	{
> -		if (binary) {
> -			ch = *buf++;
> -			if (ch == 0x7d)
> -				ch = 0x20 ^ *buf++;
> -		}
> -		else {
> -			ch = hex(*buf++) << 4;
> -			ch |= hex(*buf++);
> -		}
> -		if (kgdb_write_byte(ch, mem++) != 0)
> -			return 0;
> -	}
> -
> -	return mem;
> -}
> -
> -/*
> - * This table contains the mapping between SPARC hardware trap types, and
> - * signals, which are primarily what GDB understands.  It also indicates
> - * which hardware traps we need to commandeer when initializing the stub.
> - */
> -static struct hard_trap_info {
> -	unsigned char tt;		/* Trap type code for MIPS R3xxx and R4xxx */
> -	unsigned char signo;		/* Signal that we map this trap into */
> -} hard_trap_info[] = {
> -	{ 6, SIGBUS },			/* instruction bus error */
> -	{ 7, SIGBUS },			/* data bus error */
> -	{ 9, SIGTRAP },			/* break */
> -	{ 10, SIGILL },			/* reserved instruction */
> -/*	{ 11, SIGILL },		*/	/* CPU unusable */
> -	{ 12, SIGFPE },			/* overflow */
> -	{ 13, SIGTRAP },		/* trap */
> -	{ 14, SIGSEGV },		/* virtual instruction cache coherency */
> -	{ 15, SIGFPE },			/* floating point exception */
> -	{ 23, SIGSEGV },		/* watch */
> -	{ 31, SIGSEGV },		/* virtual data cache coherency */
> -	{ 0, 0}				/* Must be last */
> -};
> -
> -/* Save the normal trap handlers for user-mode traps. */
> -void *saved_vectors[32];
> -
> -/*
> - * Set up exception handlers for tracing and breakpoints
> - */
> -void set_debug_traps(void)
> -{
> -	struct hard_trap_info *ht;
> -	unsigned long flags;
> -	unsigned char c;
> -
> -	local_irq_save(flags);
> -	for (ht = hard_trap_info; ht->tt && ht->signo; ht++)
> -		saved_vectors[ht->tt] = set_except_vector(ht->tt, trap_low);
> -
> -	putDebugChar('+'); /* 'hello world' */
> -	/*
> -	 * In case GDB is started before us, ack any packets
> -	 * (presumably "$?#xx") sitting there.
> -	 */
> -	while((c = getDebugChar()) != '$');
> -	while((c = getDebugChar()) != '#');
> -	c = getDebugChar(); /* eat first csum byte */
> -	c = getDebugChar(); /* eat second csum byte */
> -	putDebugChar('+'); /* ack it */
> -
> -	initialized = 1;
> -	local_irq_restore(flags);
> -}
> -
> -void restore_debug_traps(void)
> -{
> -	struct hard_trap_info *ht;
> -	unsigned long flags;
> -
> -	local_irq_save(flags);
> -	for (ht = hard_trap_info; ht->tt && ht->signo; ht++)
> -		set_except_vector(ht->tt, saved_vectors[ht->tt]);
> -	local_irq_restore(flags);
> -}
> -
> -/*
> - * Convert the MIPS hardware trap type code to a Unix signal number.
> - */
> -static int computeSignal(int tt)
> -{
> -	struct hard_trap_info *ht;
> -
> -	for (ht = hard_trap_info; ht->tt && ht->signo; ht++)
> -		if (ht->tt == tt)
> -			return ht->signo;
> -
> -	return SIGHUP;		/* default for things we don't know about */
> -}
> -
> -/*
> - * While we find nice hex chars, build an int.
> - * Return number of chars processed.
> - */
> -static int hexToInt(char **ptr, int *intValue)
> -{
> -	int numChars = 0;
> -	int hexValue;
> -
> -	*intValue = 0;
> -
> -	while (**ptr) {
> -		hexValue = hex(**ptr);
> -		if (hexValue < 0)
> -			break;
> -
> -		*intValue = (*intValue << 4) | hexValue;
> -		numChars ++;
> -
> -		(*ptr)++;
> -	}
> -
> -	return (numChars);
> -}
> -
> -static int hexToLong(char **ptr, long *longValue)
> -{
> -	int numChars = 0;
> -	int hexValue;
> -
> -	*longValue = 0;
> -
> -	while (**ptr) {
> -		hexValue = hex(**ptr);
> -		if (hexValue < 0)
> -			break;
> -
> -		*longValue = (*longValue << 4) | hexValue;
> -		numChars ++;
> -
> -		(*ptr)++;
> -	}
> -
> -	return numChars;
> -}
> -
> -
> -#if 0
> -/*
> - * Print registers (on target console)
> - * Used only to debug the stub...
> - */
> -void show_gdbregs(struct gdb_regs * regs)
> -{
> -	/*
> -	 * Saved main processor registers
> -	 */
> -	printk("$0 : %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
> -	       regs->reg0, regs->reg1, regs->reg2, regs->reg3,
> -               regs->reg4, regs->reg5, regs->reg6, regs->reg7);
> -	printk("$8 : %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
> -	       regs->reg8, regs->reg9, regs->reg10, regs->reg11,
> -               regs->reg12, regs->reg13, regs->reg14, regs->reg15);
> -	printk("$16: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
> -	       regs->reg16, regs->reg17, regs->reg18, regs->reg19,
> -               regs->reg20, regs->reg21, regs->reg22, regs->reg23);
> -	printk("$24: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
> -	       regs->reg24, regs->reg25, regs->reg26, regs->reg27,
> -	       regs->reg28, regs->reg29, regs->reg30, regs->reg31);
> -
> -	/*
> -	 * Saved cp0 registers
> -	 */
> -	printk("epc  : %08lx\nStatus: %08lx\nCause : %08lx\n",
> -	       regs->cp0_epc, regs->cp0_status, regs->cp0_cause);
> -}
> -#endif /* dead code */
> -
> -/*
> - * We single-step by setting breakpoints. When an exception
> - * is handled, we need to restore the instructions hoisted
> - * when the breakpoints were set.
> - *
> - * This is where we save the original instructions.
> - */
> -static struct gdb_bp_save {
> -	unsigned long addr;
> -	unsigned int val;
> -} step_bp[2];
> -
> -#define BP 0x0000000d  /* break opcode */
> -
> -/*
> - * Set breakpoint instructions for single stepping.
> - */
> -static void single_step(struct gdb_regs *regs)
> -{
> -	union mips_instruction insn;
> -	unsigned long targ;
> -	int is_branch, is_cond, i;
> -
> -	targ = regs->cp0_epc;
> -	insn.word = *(unsigned int *)targ;
> -	is_branch = is_cond = 0;
> -
> -	switch (insn.i_format.opcode) {
> -	/*
> -	 * jr and jalr are in r_format format.
> -	 */
> -	case spec_op:
> -		switch (insn.r_format.func) {
> -		case jalr_op:
> -		case jr_op:
> -			targ = *(&regs->reg0 + insn.r_format.rs);
> -			is_branch = 1;
> -			break;
> -		}
> -		break;
> -
> -	/*
> -	 * This group contains:
> -	 * bltz_op, bgez_op, bltzl_op, bgezl_op,
> -	 * bltzal_op, bgezal_op, bltzall_op, bgezall_op.
> -	 */
> -	case bcond_op:
> -		is_branch = is_cond = 1;
> -		targ += 4 + (insn.i_format.simmediate << 2);
> -		break;
> -
> -	/*
> -	 * These are unconditional and in j_format.
> -	 */
> -	case jal_op:
> -	case j_op:
> -		is_branch = 1;
> -		targ += 4;
> -		targ >>= 28;
> -		targ <<= 28;
> -		targ |= (insn.j_format.target << 2);
> -		break;
> -
> -	/*
> -	 * These are conditional.
> -	 */
> -	case beq_op:
> -	case beql_op:
> -	case bne_op:
> -	case bnel_op:
> -	case blez_op:
> -	case blezl_op:
> -	case bgtz_op:
> -	case bgtzl_op:
> -	case cop0_op:
> -	case cop1_op:
> -	case cop2_op:
> -	case cop1x_op:
> -		is_branch = is_cond = 1;
> -		targ += 4 + (insn.i_format.simmediate << 2);
> -		break;
> -	}
> -
> -	if (is_branch) {
> -		i = 0;
> -		if (is_cond && targ != (regs->cp0_epc + 8)) {
> -			step_bp[i].addr = regs->cp0_epc + 8;
> -			step_bp[i++].val = *(unsigned *)(regs->cp0_epc + 8);
> -			*(unsigned *)(regs->cp0_epc + 8) = BP;
> -		}
> -		step_bp[i].addr = targ;
> -		step_bp[i].val  = *(unsigned *)targ;
> -		*(unsigned *)targ = BP;
> -	} else {
> -		step_bp[0].addr = regs->cp0_epc + 4;
> -		step_bp[0].val  = *(unsigned *)(regs->cp0_epc + 4);
> -		*(unsigned *)(regs->cp0_epc + 4) = BP;
> -	}
> -}
> -
> -/*
> - *  If asynchronously interrupted by gdb, then we need to set a breakpoint
> - *  at the interrupted instruction so that we wind up stopped with a
> - *  reasonable stack frame.
> - */
> -static struct gdb_bp_save async_bp;
> -
> -/*
> - * Swap the interrupted EPC with our asynchronous breakpoint routine.
> - * This is safer than stuffing the breakpoint in-place, since no cache
> - * flushes (or resulting smp_call_functions) are required.  The
> - * assumption is that only one CPU will be handling asynchronous bp's,
> - * and only one can be active at a time.
> - */
> -extern spinlock_t smp_call_lock;
> -void set_async_breakpoint(unsigned long *epc)
> -{
> -	/* skip breaking into userland */
> -	if ((*epc & 0x80000000) == 0)
> -		return;
> -
> -	/* avoid deadlock if someone is make IPC */
> -	if (spin_is_locked(&smp_call_lock))
> -		return;
> -
> -	async_bp.addr = *epc;
> -	*epc = (unsigned long)async_breakpoint;
> -}
> -
> -void kgdb_wait(void *arg)
> -{
> -	unsigned flags;
> -	int cpu = smp_processor_id();
> -
> -	local_irq_save(flags);
> -
> -	spin_lock(&kgdb_cpulock[cpu]);
> -	spin_unlock(&kgdb_cpulock[cpu]);
> -
> -	local_irq_restore(flags);
> -}
> -
> -
> -/*
> - * This function does all command processing for interfacing to gdb.  It
> - * returns 1 if you should skip the instruction at the trap address, 0
> - * otherwise.
> - */
> -void handle_exception (struct gdb_regs *regs)
> -{
> -	int trap;			/* Trap type */
> -	int sigval;
> -	long addr;
> -	int length;
> -	char *ptr;
> -	unsigned long *stack;
> -	int i;
> -	int bflag = 0;
> -
> -	kgdb_started = 1;
> -
> -	/*
> -	 * acquire the big kgdb spinlock
> -	 */
> -	if (!spin_trylock(&kgdb_lock)) {
> -		/* 
> -		 * some other CPU has the lock, we should go back to 
> -		 * receive the gdb_wait IPC
> -		 */
> -		return;
> -	}
> -
> -	/*
> -	 * If we're in async_breakpoint(), restore the real EPC from
> -	 * the breakpoint.
> -	 */
> -	if (regs->cp0_epc == (unsigned long)async_breakinst) {
> -		regs->cp0_epc = async_bp.addr;
> -		async_bp.addr = 0;
> -	}
> -
> -	/* 
> -	 * acquire the CPU spinlocks
> -	 */
> -	for (i = num_online_cpus()-1; i >= 0; i--)
> -		if (spin_trylock(&kgdb_cpulock[i]) == 0)
> -			panic("kgdb: couldn't get cpulock %d\n", i);
> -
> -	/*
> -	 * force other cpus to enter kgdb
> -	 */
> -	smp_call_function(kgdb_wait, NULL, 0, 0);
> -
> -	/*
> -	 * If we're in breakpoint() increment the PC
> -	 */
> -	trap = (regs->cp0_cause & 0x7c) >> 2;
> -	if (trap == 9 && regs->cp0_epc == (unsigned long)breakinst)
> -		regs->cp0_epc += 4;
> -
> -	/*
> -	 * If we were single_stepping, restore the opcodes hoisted
> -	 * for the breakpoint[s].
> -	 */
> -	if (step_bp[0].addr) {
> -		*(unsigned *)step_bp[0].addr = step_bp[0].val;
> -		step_bp[0].addr = 0;
> -
> -		if (step_bp[1].addr) {
> -			*(unsigned *)step_bp[1].addr = step_bp[1].val;
> -			step_bp[1].addr = 0;
> -		}
> -	}
> -
> -	stack = (long *)regs->reg29;			/* stack ptr */
> -	sigval = computeSignal(trap);
> -
> -	/*
> -	 * reply to host that an exception has occurred
> -	 */
> -	ptr = output_buffer;
> -
> -	/*
> -	 * Send trap type (converted to signal)
> -	 */
> -	*ptr++ = 'T';
> -	*ptr++ = hexchars[sigval >> 4];
> -	*ptr++ = hexchars[sigval & 0xf];
> -
> -	/*
> -	 * Send Error PC
> -	 */
> -	*ptr++ = hexchars[REG_EPC >> 4];
> -	*ptr++ = hexchars[REG_EPC & 0xf];
> -	*ptr++ = ':';
> -	ptr = mem2hex((char *)&regs->cp0_epc, ptr, sizeof(long), 0);
> -	*ptr++ = ';';
> -
> -	/*
> -	 * Send frame pointer
> -	 */
> -	*ptr++ = hexchars[REG_FP >> 4];
> -	*ptr++ = hexchars[REG_FP & 0xf];
> -	*ptr++ = ':';
> -	ptr = mem2hex((char *)&regs->reg30, ptr, sizeof(long), 0);
> -	*ptr++ = ';';
> -
> -	/*
> -	 * Send stack pointer
> -	 */
> -	*ptr++ = hexchars[REG_SP >> 4];
> -	*ptr++ = hexchars[REG_SP & 0xf];
> -	*ptr++ = ':';
> -	ptr = mem2hex((char *)&regs->reg29, ptr, sizeof(long), 0);
> -	*ptr++ = ';';
> -
> -	*ptr++ = 0;
> -	putpacket(output_buffer);	/* send it off... */
> -
> -	/*
> -	 * Wait for input from remote GDB
> -	 */
> -	while (1) {
> -		output_buffer[0] = 0;
> -		getpacket(input_buffer);
> -
> -		switch (input_buffer[0])
> -		{
> -		case '?':
> -			output_buffer[0] = 'S';
> -			output_buffer[1] = hexchars[sigval >> 4];
> -			output_buffer[2] = hexchars[sigval & 0xf];
> -			output_buffer[3] = 0;
> -			break;
> -
> -		/*
> -		 * Detach debugger; let CPU run
> -		 */
> -		case 'D':
> -			putpacket(output_buffer);
> -			goto finish_kgdb;
> -			break;
> -
> -		case 'd':
> -			/* toggle debug flag */
> -			break;
> -
> -		/*
> -		 * Return the value of the CPU registers
> -		 */
> -		case 'g':
> -			ptr = output_buffer;
> -			ptr = mem2hex((char *)&regs->reg0, ptr, 32*sizeof(long), 0); /* r0...r31 */
> -			ptr = mem2hex((char *)&regs->cp0_status, ptr, 6*sizeof(long), 0); /* cp0 */
> -			ptr = mem2hex((char *)&regs->fpr0, ptr, 32*sizeof(long), 0); /* f0...31 */
> -			ptr = mem2hex((char *)&regs->cp1_fsr, ptr, 2*sizeof(long), 0); /* cp1 */
> -			ptr = mem2hex((char *)&regs->frame_ptr, ptr, 2*sizeof(long), 0); /* frp */
> -			ptr = mem2hex((char *)&regs->cp0_index, ptr, 16*sizeof(long), 0); /* cp0 */
> -			break;
> -
> -		/*
> -		 * set the value of the CPU registers - return OK
> -		 */
> -		case 'G':
> -		{
> -			ptr = &input_buffer[1];
> -			hex2mem(ptr, (char *)&regs->reg0, 32*sizeof(long), 0, 0);
> -			ptr += 32*(2*sizeof(long));
> -			hex2mem(ptr, (char *)&regs->cp0_status, 6*sizeof(long), 0, 0);
> -			ptr += 6*(2*sizeof(long));
> -			hex2mem(ptr, (char *)&regs->fpr0, 32*sizeof(long), 0, 0);
> -			ptr += 32*(2*sizeof(long));
> -			hex2mem(ptr, (char *)&regs->cp1_fsr, 2*sizeof(long), 0, 0);
> -			ptr += 2*(2*sizeof(long));
> -			hex2mem(ptr, (char *)&regs->frame_ptr, 2*sizeof(long), 0, 0);
> -			ptr += 2*(2*sizeof(long));
> -			hex2mem(ptr, (char *)&regs->cp0_index, 16*sizeof(long), 0, 0);
> -			strcpy(output_buffer,"OK");
> -		 }
> -		break;
> -
> -		/*
> -		 * mAA..AA,LLLL  Read LLLL bytes at address AA..AA
> -		 */
> -		case 'm':
> -			ptr = &input_buffer[1];
> -
> -			if (hexToLong(&ptr, &addr)
> -				&& *ptr++ == ','
> -				&& hexToInt(&ptr, &length)) {
> -				if (mem2hex((char *)addr, output_buffer, length, 1))
> -					break;
> -				strcpy (output_buffer, "E03");
> -			} else
> -				strcpy(output_buffer,"E01");
> -			break;
> -
> -		/*
> -		 * XAA..AA,LLLL: Write LLLL escaped binary bytes at address AA.AA
> -		 */
> -		case 'X':
> -			bflag = 1;
> -			/* fall through */
> -
> -		/*
> -		 * MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK
> -		 */
> -		case 'M':
> -			ptr = &input_buffer[1];
> -
> -			if (hexToLong(&ptr, &addr)
> -				&& *ptr++ == ','
> -				&& hexToInt(&ptr, &length)
> -				&& *ptr++ == ':') {
> -				if (hex2mem(ptr, (char *)addr, length, bflag, 1))
> -					strcpy(output_buffer, "OK");
> -				else
> -					strcpy(output_buffer, "E03");
> -			}
> -			else
> -				strcpy(output_buffer, "E02");
> -			break;
> -
> -		/*
> -		 * cAA..AA    Continue at address AA..AA(optional)
> -		 */
> -		case 'c':
> -			/* try to read optional parameter, pc unchanged if no parm */
> -
> -			ptr = &input_buffer[1];
> -			if (hexToLong(&ptr, &addr))
> -				regs->cp0_epc = addr;
> -	  
> -			goto exit_kgdb_exception;
> -			break;
> -
> -		/*
> -		 * kill the program; let us try to restart the machine
> -		 * Reset the whole machine.
> -		 */
> -		case 'k':
> -		case 'r':
> -			machine_restart("kgdb restarts machine");
> -			break;
> -
> -		/*
> -		 * Step to next instruction
> -		 */
> -		case 's':
> -			/*
> -			 * There is no single step insn in the MIPS ISA, so we
> -			 * use breakpoints and continue, instead.
> -			 */
> -			single_step(regs);
> -			goto exit_kgdb_exception;
> -			/* NOTREACHED */
> -			break;
> -
> -		/*
> -		 * Set baud rate (bBB)
> -		 * FIXME: Needs to be written
> -		 */
> -		case 'b':
> -		{
> -#if 0
> -			int baudrate;
> -			extern void set_timer_3();
> -
> -			ptr = &input_buffer[1];
> -			if (!hexToInt(&ptr, &baudrate))
> -			{
> -				strcpy(output_buffer,"B01");
> -				break;
> -			}
> -
> -			/* Convert baud rate to uart clock divider */
> -
> -			switch (baudrate)
> -			{
> -				case 38400:
> -					baudrate = 16;
> -					break;
> -				case 19200:
> -					baudrate = 33;
> -					break;
> -				case 9600:
> -					baudrate = 65;
> -					break;
> -				default:
> -					baudrate = 0;
> -					strcpy(output_buffer,"B02");
> -					goto x1;
> -			}
> -
> -			if (baudrate) {
> -				putpacket("OK");	/* Ack before changing speed */
> -				set_timer_3(baudrate); /* Set it */
> -			}
> -#endif
> -		}
> -		break;
> -
> -		}			/* switch */
> -
> -		/*
> -		 * reply to the request
> -		 */
> -
> -		putpacket(output_buffer);
> -
> -	} /* while */
> -
> -	return;
> -
> -finish_kgdb:
> -	restore_debug_traps();
> -
> -exit_kgdb_exception:
> -	/* release locks so other CPUs can go */
> -	for (i = num_online_cpus()-1; i >= 0; i--)
> -		spin_unlock(&kgdb_cpulock[i]);
> -	spin_unlock(&kgdb_lock);
> -
> -	__flush_cache_all();
> -	return;
> -}
> -
> -/*
> - * This function will generate a breakpoint exception.  It is used at the
> - * beginning of a program to sync up with a debugger and can be used
> - * otherwise as a quick means to stop program execution and "break" into
> - * the debugger.
> - */
> -void breakpoint(void)
> -{
> -	if (!initialized)
> -		return;
> -
> -	__asm__ __volatile__(
> -			".globl	breakinst\n\t" 
> -			".set\tnoreorder\n\t"
> -			"nop\n"
> -			"breakinst:\tbreak\n\t"
> -			"nop\n\t"
> -			".set\treorder"
> -			);
> -}
> -
> -/* Nothing but the break; don't pollute any registers */
> -void async_breakpoint(void)
> -{
> -	__asm__ __volatile__(
> -			".globl	async_breakinst\n\t" 
> -			".set\tnoreorder\n\t"
> -			"nop\n"
> -			"async_breakinst:\tbreak\n\t"
> -			"nop\n\t"
> -			".set\treorder"
> -			);
> -}
> -
> -void adel(void)
> -{
> -	__asm__ __volatile__(
> -			".globl\tadel\n\t"
> -			"lui\t$8,0x8000\n\t"
> -			"lw\t$9,1($8)\n\t"
> -			);
> -}
> -
> -/*
> - * malloc is needed by gdb client in "call func()", even a private one
> - * will make gdb happy
> - */
> -static void *malloc(size_t size)
> -{
> -	return kmalloc(size, GFP_ATOMIC);
> -}
> -
> -static void free(void *where)
> -{
> -	kfree(where);
> -}
> -
> -#ifdef CONFIG_GDB_CONSOLE
> -
> -void gdb_putsn(const char *str, int l)
> -{
> -	char outbuf[18];
> -
> -	if (!kgdb_started)
> -		return;
> -
> -	outbuf[0]='O';
> -
> -	while(l) {
> -		int i = (l>8)?8:l;
> -		mem2hex((char *)str, &outbuf[1], i, 0);
> -		outbuf[(i*2)+1]=0;
> -		putpacket(outbuf);
> -		str += i;
> -		l -= i;
> -	}
> -}
> -
> -static void gdb_console_write(struct console *con, const char *s, unsigned n)
> -{
> -	gdb_putsn(s, n);
> -}
> -
> -static struct console gdb_console = {
> -	.name	= "gdb",
> -	.write	= gdb_console_write,
> -	.flags	= CON_PRINTBUFFER,
> -	.index	= -1
> -};
> -
> -static int __init register_gdb_console(void)
> -{
> -	register_console(&gdb_console);
> -
> -	return 0;
> -}
> -
> -console_initcall(register_gdb_console);
> -
> -#endif
> diff -puN arch/mips/kernel/irq.c~mips-lite arch/mips/kernel/irq.c
> --- linux-2.6.13-rc3/arch/mips/kernel/irq.c~mips-lite	2005-07-29 11:55:31.000000000 -0700
> +++ linux-2.6.13-rc3-trini/arch/mips/kernel/irq.c	2005-07-29 11:55:31.000000000 -0700
> @@ -26,6 +26,10 @@
>  #include <asm/atomic.h>
>  #include <asm/system.h>
>  #include <asm/uaccess.h>
> +#include <asm/kgdb.h>
> +
> +/* Keep track of if we've done certain initialization already or not. */
> +int kgdb_early_setup;
>  
>  /*
>   * 'what should we do if we get a hw irq event on an illegal vector'.
> @@ -103,23 +107,13 @@ skip:
>  	return 0;
>  }
>  
> -#ifdef CONFIG_KGDB
> -extern void breakpoint(void);
> -extern void set_debug_traps(void);
> -
> -static int kgdb_flag = 1;
> -static int __init nokgdb(char *str)
> -{
> -	kgdb_flag = 0;
> -	return 1;
> -}
> -__setup("nokgdb", nokgdb);
> -#endif
> -
>  void __init init_IRQ(void)
>  {
>  	int i;
>  
> +	if (kgdb_early_setup)
> +		return;
> +
>  	for (i = 0; i < NR_IRQS; i++) {
>  		irq_desc[i].status  = IRQ_DISABLED;
>  		irq_desc[i].action  = NULL;
> @@ -129,12 +123,12 @@ void __init init_IRQ(void)
>  	}
>  
>  	arch_init_irq();
> -
>  #ifdef CONFIG_KGDB
> -	if (kgdb_flag) {
> -		printk("Wait for gdb client connection ...\n");
> -		set_debug_traps();
> -		breakpoint();
> -	}
> +	/*
> +	 * We have been called before kgdb_arch_init(). Hence,
> +	 * we dont want the traps to be reinitialized
> +	 */
> +	if (kgdb_early_setup == 0)
> +		kgdb_early_setup = 1;
>  #endif
>  }
> diff -puN /dev/null arch/mips/kernel/kgdb.c
> --- /dev/null	2005-07-25 10:57:32.312383000 -0700
> +++ linux-2.6.13-rc3-trini/arch/mips/kernel/kgdb.c	2005-07-29 11:55:31.000000000 -0700
> @@ -0,0 +1,292 @@
> +/*
> + * arch/mips/kernel/kgdb.c
> + *
> + *  Originally written by Glenn Engel, Lake Stevens Instrument Division
> + *
> + *  Contributed by HP Systems
> + *
> + *  Modified for SPARC by Stu Grossman, Cygnus Support.
> + *
> + *  Modified for Linux/MIPS (and MIPS in general) by Andreas Busse
> + *  Send complaints, suggestions etc. to <andy@waldorf-gmbh.de>
> + *
> + *  Copyright (C) 1995 Andreas Busse
> + *
> + *  Copyright (C) 2003 MontaVista Software Inc.
> + *  Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
> + *
> + *  Copyright (C) 2004-2005 MontaVista Software Inc.
> + *  Author: Manish Lachwani, mlachwani@mvista.com or manish@koffee-break.com
> + *
> + *  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/string.h>
> +#include <linux/kernel.h>
> +#include <linux/sched.h>
> +#include <linux/smp.h>
> +#include <linux/spinlock.h>
> +#include <linux/delay.h>
> +#include <asm/system.h>
> +#include <asm/ptrace.h>		/* for linux pt_regs struct */
> +#include <linux/kgdb.h>
> +#include <linux/init.h>
> +#include <asm/inst.h>
> +#include <asm/gdb-stub.h>
> +#include <asm/cacheflush.h>
> +#include <asm/kdebug.h>
> +
> +static struct hard_trap_info {
> +	unsigned char tt;	/* Trap type code for MIPS R3xxx and R4xxx */
> +	unsigned char signo;	/* Signal that we map this trap into */
> +} hard_trap_info[] = {
> +	{ 6, SIGBUS },		/* instruction bus error */
> +	{ 7, SIGBUS },		/* data bus error */
> +	{ 9, SIGTRAP },		/* break */
> +/*	{ 11, SIGILL },	*/	/* CPU unusable */
> +	{ 12, SIGFPE },		/* overflow */
> +	{ 13, SIGTRAP },	/* trap */
> +	{ 14, SIGSEGV },	/* virtual instruction cache coherency */
> +	{ 15, SIGFPE },		/* floating point exception */
> +	{ 23, SIGSEGV },	/* watch */
> +	{ 31, SIGSEGV },	/* virtual data cache coherency */
> +	{ 0, 0}			/* Must be last */
> +};
> +
> +/* Save the normal trap handlers for user-mode traps. */
> +void *saved_vectors[32];
> +
> +extern void trap_low(void);
> +extern void breakinst(void);
> +extern void init_IRQ(void);
> +
> +void kgdb_call_nmi_hook(void *ignored)
> +{
> +	kgdb_nmihook(smp_processor_id(), (void *)0);
> +}
> +
> +void kgdb_roundup_cpus(unsigned long flags)
> +{
> +	local_irq_restore(flags);
> +	smp_call_function(kgdb_call_nmi_hook, 0, 0, 0);
> +	local_irq_save(flags);
> +}
> +
> +static int compute_signal(int tt)
> +{
> +	struct hard_trap_info *ht;
> +
> +	for (ht = hard_trap_info; ht->tt && ht->signo; ht++)
> +		if (ht->tt == tt)
> +			return ht->signo;
> +
> +	return SIGHUP;		/* default for things we don't know about */
> +}
> +
> +/*
> + * Set up exception handlers for tracing and breakpoints
> + */
> +void handle_exception(struct pt_regs *regs)
> +{
> +	int trap = (regs->cp0_cause & 0x7c) >> 2;
> +
> +	if (atomic_read(&debugger_active))
> +		kgdb_nmihook(smp_processor_id(), regs);
> +
> +	if (atomic_read(&kgdb_setting_breakpoint))
> +		if ((trap == 9) && (regs->cp0_epc == (unsigned long)breakinst))
> +			regs->cp0_epc += 4;
> +
> +	kgdb_handle_exception(0, compute_signal(trap), 0, regs);
> +
> +	/* In SMP mode, __flush_cache_all does IPI */
> +	__flush_cache_all();
> +}
> +
> +void set_debug_traps(void)
> +{
> +	struct hard_trap_info *ht;
> +	unsigned long flags;
> +
> +	local_irq_save(flags);
> +
> +	for (ht = hard_trap_info; ht->tt && ht->signo; ht++)
> +		saved_vectors[ht->tt] = set_except_vector(ht->tt, trap_low);
> +
> +	local_irq_restore(flags);
> +}
> +
> +#if 0
> +/* This should be called before we exit kgdb_handle_exception() I believe.
> + * -- Tom
> + */
> +void restore_debug_traps(void)
> +{
> +	struct hard_trap_info *ht;
> +	unsigned long flags;
> +
> +	local_irq_save(flags);
> +	for (ht = hard_trap_info; ht->tt && ht->signo; ht++)
> +		set_except_vector(ht->tt, saved_vectors[ht->tt]);
> +	local_irq_restore(flags);
> +}
> +#endif
> +
> +void regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs)
> +{
> +	int reg = 0;
> +	unsigned long *ptr = gdb_regs;
> +
> +	for (reg = 0; reg < 32; reg++)
> +		*(ptr++) = regs->regs[reg];
> +
> +	*(ptr++) = regs->cp0_status;
> +	*(ptr++) = regs->lo;
> +	*(ptr++) = regs->hi;
> +	*(ptr++) = regs->cp0_badvaddr;
> +	*(ptr++) = regs->cp0_cause;
> +	*(ptr++) = regs->cp0_epc;
> +
> +	return;
> +}
> +
> +void gdb_regs_to_regs(unsigned long *gdb_regs, struct pt_regs *regs)
> +{
> +	int reg = 0;
> +	unsigned long *ptr = gdb_regs;
> +
> +	for (reg = 0; reg < 32; reg++)
> +		regs->regs[reg] = *(ptr++);
> +
> +	regs->cp0_status = *(ptr++);
> +	regs->lo = *(ptr++);
> +	regs->hi = *(ptr++);
> +	regs->cp0_badvaddr = *(ptr++);
> +	regs->cp0_cause = *(ptr++);
> +	regs->cp0_epc = *(ptr++);
> +
> +	return;
> +}
> +
> +/*
> + * Similar to regs_to_gdb_regs() except that process is sleeping and so
> + * we may not be able to get all the info.
> + */
> +void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p)
> +{
> +	int reg = 0;
> +	struct thread_info *ti = p->thread_info;
> +	unsigned long ksp = (unsigned long)ti + THREAD_SIZE - 32;
> +	struct pt_regs *regs = (struct pt_regs *)ksp - 1;
> +	unsigned long *ptr = gdb_regs;
> +
> +	for (reg = 0; reg < 16; reg++)
> +		*(ptr++) = regs->regs[reg];
> +
> +	/* S0 - S7 */
> +	for (reg = 16; reg < 24; reg++)
> +		*(ptr++) = regs->regs[reg];
> +
> +	for (reg = 24; reg < 28; reg++)
> +		*(ptr++) = 0;
> +
> +	/* GP, SP, FP, RA */
> +	for (reg = 28; reg < 32; reg++)
> +		*(ptr++) = regs->regs[reg];
> +
> +	*(ptr++) = regs->cp0_status;
> +	*(ptr++) = regs->lo;
> +	*(ptr++) = regs->hi;
> +	*(ptr++) = regs->cp0_badvaddr;
> +	*(ptr++) = regs->cp0_cause;
> +	*(ptr++) = regs->cp0_epc;
> +
> +	return;
> +}
> +
> +/*
> + * Calls linux_debug_hook before the kernel dies. If KGDB is enabled,
> + * then try to fall into the debugger
> + */
> +static int kgdb_mips_notify(struct notifier_block *self, unsigned long cmd,
> +			    void *ptr)
> +{
> +	struct die_args *args = (struct die_args *)ptr;
> +	struct pt_regs *regs = args->regs;
> +	int trap = (regs->cp0_cause & 0x7c) >> 2;
> +
> +	/* See if KGDB is interested. */
> +	if (user_mode(regs))
> +		/* Userpace events, ignore. */
> +		return NOTIFY_DONE;
> +
> +	kgdb_handle_exception(trap, compute_signal(trap), 0, regs);
> +	return NOTIFY_OK;
> +}
> +
> +static struct notifier_block kgdb_notifier = {
> +	.notifier_call = kgdb_mips_notify,
> +};
> +
> +/*
> + * Handle the 's' and 'c' commands
> + */
> +int kgdb_arch_handle_exception(int vector, int signo, int err_code,
> +			       char *remcom_in_buffer, char *remcom_out_buffer,
> +			       struct pt_regs *regs)
> +{
> +	char *ptr;
> +	unsigned long address;
> +	int cpu = smp_processor_id();
> +
> +	switch (remcom_in_buffer[0]) {
> +	case 's':
> +	case 'c':
> +		/* handle the optional parameter */
> +		ptr = &remcom_in_buffer[1];
> +		if (kgdb_hex2long(&ptr, &address))
> +			regs->cp0_epc = address;
> +
> +		atomic_set(&cpu_doing_single_step, -1);
> +		if (remcom_in_buffer[0] == 's')
> +			if (kgdb_contthread)
> +				atomic_set(&cpu_doing_single_step, cpu);
> +
> +		return 0;
> +	}
> +
> +	return -1;
> +}
> +
> +struct kgdb_arch arch_kgdb_ops = {
> +#ifdef CONFIG_CPU_LITTLE_ENDIAN
> +	.gdb_bpt_instr = {0xd},
> +#else
> +	.gdb_bpt_instr = {0x00, 0x00, 0x00, 0x0d},
> +#endif
> +};
> +
> +/*
> + * We use kgdb_early_setup so that functions we need to call now don't
> + * cause trouble when called again later.
> + */
> +int kgdb_arch_init(void)
> +{
> +	/* Board-specifics. */
> +	/* Force some calls to happen earlier. */
> +	if (kgdb_early_setup == 0) {
> +		trap_init();
> +		init_IRQ();
> +		kgdb_early_setup = 1;
> +	}
> +
> +	/* Set our traps. */
> +	/* This needs to be done more finely grained again, paired in
> +	 * a before/after in kgdb_handle_exception(...) -- Tom */
> +	set_debug_traps();
> +	notifier_chain_register(&mips_die_chain, &kgdb_notifier);
> +
> +	return 0;
> +}
> diff -puN /dev/null arch/mips/kernel/kgdb_handler.S
> --- /dev/null	2005-07-25 10:57:32.312383000 -0700
> +++ linux-2.6.13-rc3-trini/arch/mips/kernel/kgdb_handler.S	2005-07-29 11:55:31.000000000 -0700
> @@ -0,0 +1,58 @@
> +/*
> + * arch/mips/kernel/kgdb_handler.S
> + *
> + * Copyright (C) 2004 MontaVista Software Inc.
> + * Author: Manish Lachwani, mlachwani@mvista.com or manish@koffee-break.com
> + *
> + * This file is licensed under the terms of the GNU General Public
> + * version 2. This program is licensed "as is" without any warranty of any
> + * kind, whether express or implied.
> + */
> +
> +/*
> + * Trap Handler for the new KGDB framework. The main KGDB handler is
> + * handle_exception that will be called from here
> + *
> + */
> +
> +#include <linux/config.h>
> +#include <linux/sys.h>
> +
> +#include <asm/asm.h>
> +#include <asm/errno.h>
> +#include <asm/mipsregs.h>
> +#include <asm/regdef.h>
> +#include <asm/stackframe.h>
> +
> +	.align  5
> +	NESTED(trap_low, PT_SIZE, sp)
> +		.set    noat
> +		.set	noreorder
> +		SAVE_ALL
> +		/*
> +		 * Check for privileged instructions in user mode. For
> +		 * this, check the cu0 bit in the CPU status register.
> +		 */
> +		mfc0	k0, CP0_STATUS
> +		sll	k0, 3
> +		bltz	k0, 1f
> +		move	k1, sp
> +
> +		/*
> +		 * GDB userland from within KGDB. If a user mode address
> +		 * then jump to the saved exception handler
> +		 */
> +		lui	k1, %hi(saved_vectors)
> +		mfc0	k0, CP0_CAUSE
> +		andi	k0, k0, 0x7c
> +		add	k1, k1, k0
> +		lw	k0, %lo(saved_vectors)(k1)
> +		jr	k0
> +		nop
> +1:
> +		.set    at
> +		.set	reorder
> +		move    a0, sp
> +		jal     handle_exception
> +		j       ret_from_exception
> +	END(trap_low)
> diff -puN /dev/null arch/mips/kernel/kgdb-jmp.c
> --- /dev/null	2005-07-25 10:57:32.312383000 -0700
> +++ linux-2.6.13-rc3-trini/arch/mips/kernel/kgdb-jmp.c	2005-07-29 11:55:31.000000000 -0700
> @@ -0,0 +1,62 @@
> +/*
> + * arch/mips/kernel/kgdb-jmp.c
> + *
> + * Save and restore system registers so that within a limited frame we
> + * may have a fault and "jump back" to a known safe location.
> + *
> + * Author: Tom Rini <trini@kernel.crashing.org>
> + *
> + * Cribbed from glibc, which carries the following:
> + * Copyright (C) 1996, 1997, 2000, 2002, 2003 Free Software Foundation, Inc.
> + * Copyright (C) 2005 by MontaVista Software.
> + *
> + * This file is licensed under the terms of the GNU General Public License
> + * version 2. This program as licensed "as is" without any warranty of
> + * any kind, whether express or implied.
> + */
> +
> +#include <linux/kgdb.h>
> +#include <asm/interrupt.h>
> +
> +int kgdb_fault_setjmp_aux(unsigned long *curr_context, int sp, int fp)
> +{
> +	__asm__ __volatile__("sw $gp, %0" : : "m" (curr_context[0]));
> +	__asm__ __volatile__("sw $16, %0" : : "m" (curr_context[1]));
> +	__asm__ __volatile__("sw $17, %0" : : "m" (curr_context[2]));
> +	__asm__ __volatile__("sw $18, %0" : : "m" (curr_context[3]));
> +	__asm__ __volatile__("sw $19, %0" : : "m" (curr_context[4]));
> +	__asm__ __volatile__("sw $20, %0" : : "m" (curr_context[5]));
> +	__asm__ __volatile__("sw $21, %0" : : "m" (curr_context[6]));
> +	__asm__ __volatile__("sw $22, %0" : : "m" (curr_context[7]));
> +	__asm__ __volatile__("sw $23, %0" : : "m" (curr_context[8]));
> +	__asm__ __volatile__("sw $31, %0" : : "m" (curr_context[9]));
> +	curr_context[10] = (long *)sp;
> +	curr_context[11] = (long *)fp;
> +
> +	return 0;
> +}
> +
> +void kgdb_fault_longjmp(unsigned long *curr_context)
> +{
> +	unsigned long sp_val, fp_val;
> +
> +	__asm__ __volatile__("lw $gp, %0" : : "m" (curr_context[0]));
> +	__asm__ __volatile__("lw $16, %0" : : "m" (curr_context[1]));
> +	__asm__ __volatile__("lw $17, %0" : : "m" (curr_context[2]));
> +	__asm__ __volatile__("lw $18, %0" : : "m" (curr_context[3]));
> +	__asm__ __volatile__("lw $19, %0" : : "m" (curr_context[4]));
> +	__asm__ __volatile__("lw $20, %0" : : "m" (curr_context[5]));
> +	__asm__ __volatile__("lw $21, %0" : : "m" (curr_context[6]));
> +	__asm__ __volatile__("lw $22, %0" : : "m" (curr_context[7]));
> +	__asm__ __volatile__("lw $23, %0" : : "m" (curr_context[8]));
> +	__asm__ __volatile__("lw $25, %0" : : "m" (curr_context[9]));
> +	sp_val = curr_context[10];
> +	fp_val = curr_context[11];
> +	__asm__ __volatile__("lw $29, %0\n\t"
> +			      "lw $30, %1\n\t" : : "m" (sp_val), "m" (fp_val));
> +
> +	__asm__ __volatile__("li $2, 1");
> +	__asm__ __volatile__("jr $25");
> +
> +	for (;;);
> +}
> diff -puN /dev/null arch/mips/kernel/kgdb-setjmp.S
> --- /dev/null	2005-07-25 10:57:32.312383000 -0700
> +++ linux-2.6.13-rc3-trini/arch/mips/kernel/kgdb-setjmp.S	2005-07-29 11:55:31.000000000 -0700
> @@ -0,0 +1,23 @@
> +/*
> + * arch/mips/kernel/kgdb-jmp.c
> + *
> + * Save and restore system registers so that within a limited frame we
> + * may have a fault and "jump back" to a known safe location.
> + *
> + * Copyright (C) 2005 by MontaVista Software.
> + *
> + * This file is licensed under the terms of the GNU General Public License
> + * version 2. This program as licensed "as is" without any warranty of
> + * any kind, whether express or implied.
> + */
> +
> +#include <asm/asm.h>
> +#include <asm/mipsregs.h>
> +#include <asm/regdef.h>
> +#include <asm/stackframe.h>
> +
> +ENTRY (kgdb_fault_setjmp)
> +	move    a1, sp
> +	move	a2, fp
> +	j	kgdb_fault_setjmp_aux
> +	.end	kgdb_fault_setjmp
> diff -puN arch/mips/kernel/Makefile~mips-lite arch/mips/kernel/Makefile
> --- linux-2.6.13-rc3/arch/mips/kernel/Makefile~mips-lite	2005-07-29 11:55:31.000000000 -0700
> +++ linux-2.6.13-rc3-trini/arch/mips/kernel/Makefile	2005-07-29 11:55:31.000000000 -0700
> @@ -52,7 +52,8 @@ obj-$(CONFIG_MIPS32_COMPAT)	+= ioctl32.o
>  obj-$(CONFIG_MIPS32_N32)	+= binfmt_elfn32.o scall64-n32.o signal_n32.o
>  obj-$(CONFIG_MIPS32_O32)	+= binfmt_elfo32.o scall64-o32.o ptrace32.o
>  
> -obj-$(CONFIG_KGDB)		+= gdb-low.o gdb-stub.o
> +obj-$(CONFIG_KGDB)		+= kgdb_handler.o kgdb.o kgdb-jmp.o	\
> +					kgdb-setjmp.o
>  obj-$(CONFIG_PROC_FS)		+= proc.o
>  
>  obj-$(CONFIG_MIPS64)		+= cpu-bugs64.o
> diff -puN arch/mips/kernel/traps.c~mips-lite arch/mips/kernel/traps.c
> --- linux-2.6.13-rc3/arch/mips/kernel/traps.c~mips-lite	2005-07-29 11:55:31.000000000 -0700
> +++ linux-2.6.13-rc3-trini/arch/mips/kernel/traps.c	2005-07-29 11:55:31.000000000 -0700
> @@ -10,6 +10,8 @@
>   * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
>   * Copyright (C) 2000, 01 MIPS Technologies, Inc.
>   * Copyright (C) 2002, 2003, 2004  Maciej W. Rozycki
> + *
> + * KGDB specific changes - Manish Lachwani (mlachwani@mvista.com)
>   */
>  #include <linux/config.h>
>  #include <linux/init.h>
> @@ -20,6 +22,7 @@
>  #include <linux/smp_lock.h>
>  #include <linux/spinlock.h>
>  #include <linux/kallsyms.h>
> +#include <linux/kgdb.h>
>  
>  #include <asm/bootinfo.h>
>  #include <asm/branch.h>
> @@ -37,6 +40,7 @@
>  #include <asm/mmu_context.h>
>  #include <asm/watch.h>
>  #include <asm/types.h>
> +#include <asm/kdebug.h>
>  
>  extern asmlinkage void handle_tlbm(void);
>  extern asmlinkage void handle_tlbl(void);
> @@ -69,6 +73,21 @@ int (*board_be_handler)(struct pt_regs *
>   */
>  #define MODULE_RANGE (8*1024*1024)
>  
> +struct notifier_block *mips_die_chain;
> +static spinlock_t die_notifier_lock = SPIN_LOCK_UNLOCKED;
> +
> +int register_die_notifier(struct notifier_block *nb)
> +{
> +	int err = 0;
> +	unsigned long flags;
> +
> +	spin_lock_irqsave(&die_notifier_lock, flags);
> +	err = notifier_chain_register(&mips_die_chain, nb);
> +	spin_unlock_irqrestore(&die_notifier_lock, flags);
> +
> +	return err;
> +}
> +
>  /*
>   * This routine abuses get_user()/put_user() to reference pointers
>   * with at least a bit of error checking ...
> @@ -271,8 +290,10 @@ NORET_TYPE void __die(const char * str, 
>  void __die_if_kernel(const char * str, struct pt_regs * regs,
>  		     const char * file, const char * func, unsigned long line)
>  {
> -	if (!user_mode(regs))
> +	if (!user_mode(regs)) {
> +		notify_die(DIE_TRAP, (char *)str, regs, 0);
>  		__die(str, regs, file, func, line);
> +	}
>  }
>  
>  extern const struct exception_table_entry __start___dbe_table[];
> @@ -958,6 +979,9 @@ void __init trap_init(void)
>  	extern char except_vec4;
>  	unsigned long i;
>  
> +	if (kgdb_early_setup)
> +		return;	/* Already done */
> +
>  	per_cpu_trap_init();
>  
>  	/*
> diff -puN arch/mips/mips-boards/generic/init.c~mips-lite arch/mips/mips-boards/generic/init.c
> --- linux-2.6.13-rc3/arch/mips/mips-boards/generic/init.c~mips-lite	2005-07-29 11:55:31.000000000 -0700
> +++ linux-2.6.13-rc3-trini/arch/mips/mips-boards/generic/init.c	2005-07-29 11:55:31.000000000 -0700
> @@ -35,15 +35,6 @@
>  #include <asm/mips-boards/malta.h>
>  #endif
>  
> -#ifdef CONFIG_KGDB
> -extern int rs_kgdb_hook(int, int);
> -extern int rs_putDebugChar(char);
> -extern char rs_getDebugChar(void);
> -extern int saa9730_kgdb_hook(int);
> -extern int saa9730_putDebugChar(char);
> -extern char saa9730_getDebugChar(void);
> -#endif
> -
>  int prom_argc;
>  int *_prom_argv, *_prom_envp;
>  
> @@ -170,59 +161,6 @@ static void __init console_config(void)
>  }
>  #endif
>  
> -#ifdef CONFIG_KGDB
> -void __init kgdb_config (void)
> -{
> -	extern int (*generic_putDebugChar)(char);
> -	extern char (*generic_getDebugChar)(void);
> -	char *argptr;
> -	int line, speed;
> -
> -	argptr = prom_getcmdline();
> -	if ((argptr = strstr(argptr, "kgdb=ttyS")) != NULL) {
> -		argptr += strlen("kgdb=ttyS");
> -		if (*argptr != '0' && *argptr != '1')
> -			printk("KGDB: Unknown serial line /dev/ttyS%c, "
> -			       "falling back to /dev/ttyS1\n", *argptr);
> -		line = *argptr == '0' ? 0 : 1;
> -		printk("KGDB: Using serial line /dev/ttyS%d for session\n", line);
> -
> -		speed = 0;
> -		if (*++argptr == ',')
> -		{
> -			int c;
> -			while ((c = *++argptr) && ('0' <= c && c <= '9'))
> -				speed = speed * 10 + c - '0';
> -		}
> -#ifdef CONFIG_MIPS_ATLAS
> -		if (line == 1) {
> -			speed = saa9730_kgdb_hook(speed);
> -			generic_putDebugChar = saa9730_putDebugChar;
> -			generic_getDebugChar = saa9730_getDebugChar;
> -		}
> -		else 
> -#endif
> -		{
> -			speed = rs_kgdb_hook(line, speed);
> -			generic_putDebugChar = rs_putDebugChar;
> -			generic_getDebugChar = rs_getDebugChar;
> -		}
> -
> -		prom_printf("KGDB: Using serial line /dev/ttyS%d at %d for session, "
> -			    "please connect your debugger\n", line ? 1 : 0, speed);
> -
> -		{
> -			char *s;
> -			for (s = "Please connect GDB to this port\r\n"; *s; )
> -				generic_putDebugChar (*s++);
> -		}
> -
> -		kgdb_enabled = 1;
> -		/* Breakpoint is invoked after interrupts are initialised */
> -	}
> -}
> -#endif
> -
>  void __init prom_init(void)
>  {
>  	prom_argc = fw_arg0;
> diff -puN arch/mips/mips-boards/generic/Makefile~mips-lite arch/mips/mips-boards/generic/Makefile
> --- linux-2.6.13-rc3/arch/mips/mips-boards/generic/Makefile~mips-lite	2005-07-29 11:55:31.000000000 -0700
> +++ linux-2.6.13-rc3-trini/arch/mips/mips-boards/generic/Makefile	2005-07-29 11:55:31.000000000 -0700
> @@ -21,6 +21,5 @@
>  obj-y				:= mipsIRQ.o reset.o display.o init.o memory.o \
>  				   printf.o cmdline.o time.o
>  obj-$(CONFIG_PCI)		+= pci.o
> -obj-$(CONFIG_KGDB)		+= gdb_hook.o
>  
>  EXTRA_AFLAGS := $(CFLAGS)
> diff -puN arch/mips/mips-boards/malta/malta_setup.c~mips-lite arch/mips/mips-boards/malta/malta_setup.c
> --- linux-2.6.13-rc3/arch/mips/mips-boards/malta/malta_setup.c~mips-lite	2005-07-29 11:55:31.000000000 -0700
> +++ linux-2.6.13-rc3-trini/arch/mips/mips-boards/malta/malta_setup.c	2005-07-29 11:55:31.000000000 -0700
> @@ -48,10 +48,6 @@ extern void mips_time_init(void);
>  extern void mips_timer_setup(struct irqaction *irq);
>  extern unsigned long mips_rtc_get_time(void);
>  
> -#ifdef CONFIG_KGDB
> -extern void kgdb_config(void);
> -#endif
> -
>  struct resource standard_io_resources[] = {
>  	{ "dma1", 0x00, 0x1f, IORESOURCE_BUSY },
>  	{ "timer", 0x40, 0x5f, IORESOURCE_BUSY },
> @@ -124,10 +120,6 @@ static int __init malta_setup(void)
>  	 */
>  	enable_dma(4);
>  
> -#ifdef CONFIG_KGDB
> -	kgdb_config ();
> -#endif
> -
>  	if ((mips_revision_corid == MIPS_REVISION_CORID_BONITO64) ||
>  	    (mips_revision_corid == MIPS_REVISION_CORID_CORE_20K) ||
>  	    (mips_revision_corid == MIPS_REVISION_CORID_CORE_EMUL_BON)) {
> diff -puN arch/mips/mm/extable.c~mips-lite arch/mips/mm/extable.c
> --- linux-2.6.13-rc3/arch/mips/mm/extable.c~mips-lite	2005-07-29 11:55:31.000000000 -0700
> +++ linux-2.6.13-rc3-trini/arch/mips/mm/extable.c	2005-07-29 11:55:31.000000000 -0700
> @@ -3,6 +3,7 @@
>   */
>  #include <linux/module.h>
>  #include <linux/spinlock.h>
> +#include <linux/kgdb.h>
>  #include <asm/branch.h>
>  #include <asm/uaccess.h>
>  
> @@ -16,6 +17,12 @@ int fixup_exception(struct pt_regs *regs
>  
>  		return 1;
>  	}
> +#ifdef CONFIG_KGDB
> +	if (atomic_read(&debugger_active) && kgdb_may_fault)
> +		/* Restore our previous state. */
> +		kgdb_fault_longjmp(kgdb_fault_jmp_regs);
> +		/* Not reached. */
> +#endif
>  
>  	return 0;
>  }
> diff -puN arch/mips/sibyte/cfe/setup.c~mips-lite arch/mips/sibyte/cfe/setup.c
> --- linux-2.6.13-rc3/arch/mips/sibyte/cfe/setup.c~mips-lite	2005-07-29 11:55:31.000000000 -0700
> +++ linux-2.6.13-rc3-trini/arch/mips/sibyte/cfe/setup.c	2005-07-29 11:55:31.000000000 -0700
> @@ -58,10 +58,6 @@ int cfe_cons_handle;
>  extern unsigned long initrd_start, initrd_end;
>  #endif
>  
> -#ifdef CONFIG_KGDB
> -extern int kgdb_port;
> -#endif
> -
>  static void ATTRIB_NORET cfe_linux_exit(void *arg)
>  {
>  	int warm = *(int *)arg;
> @@ -242,9 +238,6 @@ void __init prom_init(void)
>  	int argc = fw_arg0;
>  	char **envp = (char **) fw_arg2;
>  	int *prom_vec = (int *) fw_arg3;
> -#ifdef CONFIG_KGDB
> -	char *arg;
> -#endif
>  
>  	_machine_restart   = cfe_linux_restart;
>  	_machine_halt      = cfe_linux_halt;
> @@ -308,13 +301,6 @@ void __init prom_init(void)
>  		}
>  	}
>  
> -#ifdef CONFIG_KGDB
> -	if ((arg = strstr(arcs_cmdline,"kgdb=duart")) != NULL)
> -		kgdb_port = (arg[10] == '0') ? 0 : 1;
> -	else
> -		kgdb_port = 1;
> -#endif
> -
>  #ifdef CONFIG_BLK_DEV_INITRD
>  	{
>  		char *ptr;
> diff -puN arch/mips/sibyte/sb1250/irq.c~mips-lite arch/mips/sibyte/sb1250/irq.c
> --- linux-2.6.13-rc3/arch/mips/sibyte/sb1250/irq.c~mips-lite	2005-07-29 11:55:31.000000000 -0700
> +++ linux-2.6.13-rc3-trini/arch/mips/sibyte/sb1250/irq.c	2005-07-29 11:55:31.000000000 -0700
> @@ -31,6 +31,7 @@
>  #include <asm/system.h>
>  #include <asm/ptrace.h>
>  #include <asm/io.h>
> +#include <asm/kgdb.h>
>  
>  #include <asm/sibyte/sb1250_regs.h>
>  #include <asm/sibyte/sb1250_int.h>
> @@ -60,16 +61,6 @@ static void sb1250_set_affinity(unsigned
>  extern unsigned long ldt_eoi_space;
>  #endif
>  
> -#ifdef CONFIG_KGDB
> -static int kgdb_irq;
> -
> -/* Default to UART1 */
> -int kgdb_port = 1;
> -#ifdef CONFIG_SIBYTE_SB1250_DUART
> -extern char sb1250_duart_present[];
> -#endif
> -#endif
> -
>  static struct hw_interrupt_type sb1250_irq_type = {
>  	"SB1250-IMR",
>  	startup_sb1250_irq,
> @@ -338,6 +329,11 @@ void __init arch_init_irq(void)
>  	unsigned int imask = STATUSF_IP4 | STATUSF_IP3 | STATUSF_IP2 |
>  		STATUSF_IP1 | STATUSF_IP0;
>  
> +#ifdef CONFIG_KGDB
> +	if (kgdb_early_setup)
> +		return;
> +#endif
> +
>  	/* Default everything to IP2 */
>  	for (i = 0; i < SB1250_NR_IRQS; i++) {	/* was I0 */
>  		bus_writeq(IMR_IP2_VAL,
> @@ -387,45 +383,4 @@ void __init arch_init_irq(void)
>  	/* Enable necessary IPs, disable the rest */
>  	change_c0_status(ST0_IM, imask);
>  	set_except_vector(0, sb1250_irq_handler);
> -
> -#ifdef CONFIG_KGDB
> -	if (kgdb_flag) {
> -		kgdb_irq = K_INT_UART_0 + kgdb_port;
> -
> -#ifdef CONFIG_SIBYTE_SB1250_DUART	
> -		sb1250_duart_present[kgdb_port] = 0;
> -#endif
> -		/* Setup uart 1 settings, mapper */
> -		bus_writeq(M_DUART_IMR_BRK, IOADDR(A_DUART_IMRREG(kgdb_port)));
> -
> -		sb1250_steal_irq(kgdb_irq);
> -		bus_writeq(IMR_IP6_VAL,
> -			   IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) +
> -				  (kgdb_irq<<3)));
> -		sb1250_unmask_irq(0, kgdb_irq);
> -	}
> -#endif
>  }
> -
> -#ifdef CONFIG_KGDB
> -
> -#include <linux/delay.h>
> -
> -#define duart_out(reg, val)     csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port,reg)))
> -#define duart_in(reg)           csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port,reg)))
> -
> -void sb1250_kgdb_interrupt(struct pt_regs *regs)
> -{
> -	/*
> -	 * Clear break-change status (allow some time for the remote
> -	 * host to stop the break, since we would see another
> -	 * interrupt on the end-of-break too)
> -	 */
> -	kstat_this_cpu.irqs[kgdb_irq]++;
> -	mdelay(500);
> -	duart_out(R_DUART_CMD, V_DUART_MISC_CMD_RESET_BREAK_INT |
> -				M_DUART_RX_EN | M_DUART_TX_EN);
> -	set_async_breakpoint(&regs->cp0_epc);
> -}
> -
> -#endif 	/* CONFIG_KGDB */
> diff -puN arch/mips/sibyte/sb1250/irq_handler.S~mips-lite arch/mips/sibyte/sb1250/irq_handler.S
> --- linux-2.6.13-rc3/arch/mips/sibyte/sb1250/irq_handler.S~mips-lite	2005-07-29 11:55:31.000000000 -0700
> +++ linux-2.6.13-rc3-trini/arch/mips/sibyte/sb1250/irq_handler.S	2005-07-29 11:55:31.000000000 -0700
> @@ -102,7 +102,7 @@
>  2:
>  #endif
>  
> -#ifdef CONFIG_KGDB
> +#ifdef CONFIG_KGDB_SIBYTE
>  	/* KGDB (uart 1) interrupt is routed to IP[6] */
>  	andi	t1, s0, CAUSEF_IP6
>  	beqz	t1, 1f
> diff -puN /dev/null arch/mips/sibyte/sb1250/kgdb_sibyte.c
> --- /dev/null	2005-07-25 10:57:32.312383000 -0700
> +++ linux-2.6.13-rc3-trini/arch/mips/sibyte/sb1250/kgdb_sibyte.c	2005-07-29 11:55:31.000000000 -0700
> @@ -0,0 +1,164 @@
> +/*
> + * arch/mips/sibyte/sb1250/kgdb_sibyte.c
> + *
> + * Author: Manish Lachwani, mlachwani@mvista.com or manish@koffee-break.com
> + *
> + * 2004 (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.
> + */
> +
> +/*
> + * Support for KGDB on the Broadcom Sibyte. The SWARM board
> + * for example does not have a 8250/16550 compatible serial
> + * port. Hence, we need to have a driver for the serial
> + * ports to handle KGDB.  This board needs nothing in addition
> + * to what is normally provided by the gdb portion of the stub.
> + */
> +
> +#include <linux/delay.h>
> +#include <linux/kernel_stat.h>
> +#include <linux/init.h>
> +#include <linux/kgdb.h>
> +
> +#include <asm/io.h>
> +#include <asm/sibyte/sb1250.h>
> +#include <asm/sibyte/sb1250_regs.h>
> +#include <asm/sibyte/sb1250_uart.h>
> +#include <asm/sibyte/sb1250_int.h>
> +#include <asm/addrspace.h>
> +
> +int kgdb_port = 1;
> +static int kgdb_irq;
> +
> +extern char sb1250_duart_present[];
> +extern int sb1250_steal_irq(int irq);
> +
> +/* Forward declarations. */
> +static void kgdbsibyte_init_duart(void);
> +static int kgdb_init_io(void);
> +
> +#define IMR_IP6_VAL	K_INT_MAP_I4
> +#define	duart_out(reg, val)	csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port,reg)))
> +#define duart_in(reg)		csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port,reg)))
> +
> +static void kgdb_swarm_write_char(int c)
> +{
> +	while ((duart_in(R_DUART_STATUS) & M_DUART_TX_RDY) == 0) ;
> +	duart_out(R_DUART_TX_HOLD, c);
> +}
> +
> +static int kgdb_swarm_read_char(void)
> +{
> +	int ret_char;
> +	unsigned int status;
> +
> +	status = duart_in(R_DUART_STATUS);
> +	while ((status & M_DUART_RX_RDY) == 0) {
> +		status = duart_in(R_DUART_STATUS);
> +	}
> +
> +	/*
> +	 * Check for framing error
> +	 */
> +	if (status & M_DUART_FRM_ERR) {
> +		kgdbsibyte_init_duart();
> +		kgdb_swarm_write_char('-');
> +		return '-';
> +	}
> +
> +	ret_char = duart_in(R_DUART_RX_HOLD);
> +
> +	return ret_char;
> +}
> +
> +void sb1250_kgdb_interrupt(struct pt_regs *regs)
> +{
> +	int kgdb_irq = K_INT_UART_0 + kgdb_port;
> +	/*
> +	 * Clear break-change status (allow some time for the remote
> +	 * host to stop the break, since we would see another
> +	 * interrupt on the end-of-break too)
> +	 */
> +	kstat_this_cpu.irqs[kgdb_irq]++;
> +	mdelay(500);
> +	duart_out(R_DUART_CMD, V_DUART_MISC_CMD_RESET_BREAK_INT |
> +		  M_DUART_RX_EN | M_DUART_TX_EN);
> +	if (kgdb_io_ops.init != kgdb_init_io) {
> +		/* Throw away the data if another I/O routine is
> +		 * active.
> +		 */
> +		unsigned int status;
> +
> +		status = duart_in(R_DUART_STATUS);
> +		while ((status & M_DUART_RX_RDY) == 0) {
> +			status = duart_in(R_DUART_STATUS);
> +		}
> +		/*
> +		 * Check for framing error
> +		 */
> +		if (status & M_DUART_FRM_ERR) {
> +			kgdbsibyte_init_duart();
> +		}
> +		duart_in(R_DUART_RX_HOLD);
> +	} else
> +		breakpoint();
> +
> +}
> +
> +/*
> + * We use port #1 and we set it for 115200 BAUD, 8n1.
> + */
> +static void kgdbsibyte_init_duart(void)
> +{
> +	/* Set 8n1. */
> +	duart_out(R_DUART_MODE_REG_1,
> +		  V_DUART_BITS_PER_CHAR_8 | V_DUART_PARITY_MODE_NONE);
> +	duart_out(R_DUART_MODE_REG_2, M_DUART_STOP_BIT_LEN_1);
> +	/* Set baud rate of 115200. */
> +	duart_out(R_DUART_CLK_SEL, V_DUART_BAUD_RATE(115200));
> +	/* Enable rx and tx */
> +	duart_out(R_DUART_CMD, M_DUART_RX_EN | M_DUART_TX_EN);
> +}
> +
> +static int kgdb_init_io(void)
> +{
> +#ifdef CONFIG_SIBYTE_SB1250_DUART
> +	sb1250_duart_present[kgdb_port] = 0;
> +#endif
> +
> +	kgdbsibyte_init_duart();
> +
> +	return 0;
> +}
> +
> +/*
> + * Hookup our IRQ line.  We will already have been initialized a
> + * this point.
> + */
> +static void __init kgdbsibyte_hookup_irq(void)
> +{
> +	/* Steal the IRQ. */
> +	kgdb_irq = K_INT_UART_0 + kgdb_port;
> +
> +	/* Setup uart 1 settings, mapper */
> +	__raw_writeq(M_DUART_IMR_BRK, IOADDR(A_DUART_IMRREG(kgdb_port)));
> +
> +	sb1250_steal_irq(kgdb_irq);
> +
> +	__raw_writeq(IMR_IP6_VAL,
> +		     IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) +
> +			    (kgdb_irq << 3)));
> +
> +	sb1250_unmask_irq(0, kgdb_irq);
> +}
> +
> +struct kgdb_io kgdb_io_ops = {
> +	.read_char = kgdb_swarm_read_char,
> +	.write_char = kgdb_swarm_write_char,
> +	.init = kgdb_init_io,
> +	.late_init = kgdbsibyte_hookup_irq,
> +	.pre_exception = NULL,
> +	.post_exception = NULL
> +};
> diff -puN arch/mips/sibyte/sb1250/Makefile~mips-lite arch/mips/sibyte/sb1250/Makefile
> --- linux-2.6.13-rc3/arch/mips/sibyte/sb1250/Makefile~mips-lite	2005-07-29 11:55:31.000000000 -0700
> +++ linux-2.6.13-rc3-trini/arch/mips/sibyte/sb1250/Makefile	2005-07-29 11:55:31.000000000 -0700
> @@ -4,5 +4,6 @@ obj-$(CONFIG_SMP)			+= smp.o
>  obj-$(CONFIG_SIBYTE_TBPROF)		+= bcm1250_tbprof.o
>  obj-$(CONFIG_SIBYTE_STANDALONE)		+= prom.o
>  obj-$(CONFIG_SIBYTE_BUS_WATCHER)	+= bus_watcher.o
> +obj-$(CONFIG_KGDB_SIBYTE)		+= kgdb_sibyte.o
>  
>  EXTRA_AFLAGS := $(CFLAGS)
> diff -L arch/mips/sibyte/swarm/dbg_io.c -puN arch/mips/sibyte/swarm/dbg_io.c~mips-lite /dev/null
> --- linux-2.6.13-rc3/arch/mips/sibyte/swarm/dbg_io.c
> +++ /dev/null	2005-07-25 10:57:32.312383000 -0700
> @@ -1,76 +0,0 @@
> -/*
> - * kgdb debug routines for SiByte boards.
> - *
> - * Copyright (C) 2001 MontaVista Software Inc.
> - * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
> - *
> - * 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.
> - *
> - */
> -
> -/* -------------------- BEGINNING OF CONFIG --------------------- */
> -
> -#include <linux/delay.h>
> -#include <asm/io.h>
> -#include <asm/sibyte/sb1250.h>
> -#include <asm/sibyte/sb1250_regs.h>
> -#include <asm/sibyte/sb1250_uart.h>
> -#include <asm/sibyte/sb1250_int.h>
> -#include <asm/addrspace.h>
> -
> -/*
> - * We use the second serial port for kgdb traffic.
> - * 	115200, 8, N, 1.
> - */
> -
> -#define	BAUD_RATE		115200
> -#define	CLK_DIVISOR		V_DUART_BAUD_RATE(BAUD_RATE)
> -#define	DATA_BITS		V_DUART_BITS_PER_CHAR_8		/* or 7    */
> -#define	PARITY			V_DUART_PARITY_MODE_NONE	/* or even */
> -#define	STOP_BITS		M_DUART_STOP_BIT_LEN_1		/* or 2    */
> -
> -static int duart_initialized = 0;	/* 0: need to be init'ed by kgdb */
> -
> -/* -------------------- END OF CONFIG --------------------- */
> -extern int kgdb_port;
> -
> -#define	duart_out(reg, val)	csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port,reg)))
> -#define duart_in(reg)		csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port,reg)))
> -
> -void putDebugChar(unsigned char c);
> -unsigned char getDebugChar(void);
> -static void
> -duart_init(int clk_divisor, int data, int parity, int stop)
> -{
> -	duart_out(R_DUART_MODE_REG_1, data | parity);
> -	duart_out(R_DUART_MODE_REG_2, stop);
> -	duart_out(R_DUART_CLK_SEL, clk_divisor);
> -
> -	duart_out(R_DUART_CMD, M_DUART_RX_EN | M_DUART_TX_EN);	/* enable rx and tx */
> -}
> -
> -void
> -putDebugChar(unsigned char c)
> -{
> -	if (!duart_initialized) {
> -		duart_initialized = 1;
> -		duart_init(CLK_DIVISOR, DATA_BITS, PARITY, STOP_BITS);
> -	}
> -	while ((duart_in(R_DUART_STATUS) & M_DUART_TX_RDY) == 0);
> -	duart_out(R_DUART_TX_HOLD, c);
> -}
> -
> -unsigned char
> -getDebugChar(void)
> -{
> -	if (!duart_initialized) {
> -		duart_initialized = 1;
> -		duart_init(CLK_DIVISOR, DATA_BITS, PARITY, STOP_BITS);
> -	}
> -	while ((duart_in(R_DUART_STATUS) & M_DUART_RX_RDY) == 0) ;
> -	return duart_in(R_DUART_RX_HOLD);
> -}
> -
> diff -puN arch/mips/sibyte/swarm/Makefile~mips-lite arch/mips/sibyte/swarm/Makefile
> --- linux-2.6.13-rc3/arch/mips/sibyte/swarm/Makefile~mips-lite	2005-07-29 11:55:31.000000000 -0700
> +++ linux-2.6.13-rc3-trini/arch/mips/sibyte/swarm/Makefile	2005-07-29 11:55:31.000000000 -0700
> @@ -1,3 +1 @@
>  lib-y				= setup.o rtc_xicor1241.o rtc_m41t81.o
> -
> -lib-$(CONFIG_KGDB)		+= dbg_io.o
> diff -puN /dev/null include/asm-mips/kdebug.h
> --- /dev/null	2005-07-25 10:57:32.312383000 -0700
> +++ linux-2.6.13-rc3-trini/include/asm-mips/kdebug.h	2005-07-29 11:55:31.000000000 -0700
> @@ -0,0 +1,47 @@
> +/*
> + *
> + * Copyright (C) 2004  MontaVista Software Inc.
> + * Author: Manish Lachwani, mlachwani@mvista.com or manish@koffee-break.com
> + *
> + * 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.
> + *
> + */
> +#ifndef _MIPS_KDEBUG_H
> +#define _MIPS_KDEBUG_H
> +
> +#include <linux/notifier.h>
> +
> +struct pt_regs;
> +
> +struct die_args {
> +	struct pt_regs *regs;
> +	const char *str;
> +	long err;
> +};
> +
> +int register_die_notifier(struct notifier_block *nb);
> +extern struct notifier_block *mips_die_chain;
> +
> +enum die_val {
> +	DIE_OOPS = 1,
> +	DIE_PANIC,
> +	DIE_DIE,
> +	DIE_KERNELDEBUG,
> +	DIE_TRAP,
> +	DIE_PAGE_FAULT,
> +};
> +
> +/*
> + * trap number can be computed from regs and signr can be computed using
> + * compute_signal()
> + */
> +static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err)
> +{
> +	struct die_args args = { .regs=regs, .str=str, .err=err };
> +	return notifier_call_chain(&mips_die_chain, val, &args);
> +}
> +
> +#endif /* _MIPS_KDEBUG_H */
> diff -puN /dev/null include/asm-mips/kgdb.h
> --- /dev/null	2005-07-25 10:57:32.312383000 -0700
> +++ linux-2.6.13-rc3-trini/include/asm-mips/kgdb.h	2005-07-29 12:48:10.000000000 -0700
> @@ -0,0 +1,22 @@
> +#ifdef __KERNEL__
> +#ifndef _ASM_KGDB_H_
> +#define _ASM_KGDB_H_
> +
> +#define BUFMAX			2048
> +#define NUMREGBYTES		(90*sizeof(long))
> +#define NUMCRITREGBYTES		(12*sizeof(long))
> +#define BREAK_INSTR_SIZE	4
> +#define BREAKPOINT()		__asm__ __volatile__(		\
> +					".globl breakinst\n\t"	\
> +					".set\tnoreorder\n\t"	\
> +					"nop\n"			\
> +					"breakinst:\tbreak\n\t"	\
> +					"nop\n\t"		\
> +					".set\treorder")
> +#define CHECK_EXCEPTION_STACK()	1
> +#define CACHE_FLUSH_IS_SAFE	0
> +
> +extern int kgdb_early_setup;
> +
> +#endif				/* _ASM_KGDB_H_ */
> +#endif				/* __KERNEL__ */
> diff -puN lib/Kconfig.debug~mips-lite lib/Kconfig.debug
> --- linux-2.6.13-rc3/lib/Kconfig.debug~mips-lite	2005-07-29 11:55:31.000000000 -0700
> +++ linux-2.6.13-rc3-trini/lib/Kconfig.debug	2005-07-29 13:23:57.000000000 -0700
> @@ -163,7 +163,7 @@ config FRAME_POINTER
>  
>  config KGDB
>  	bool "KGDB: kernel debugging with remote gdb"
> -	depends on DEBUG_KERNEL && (X86 || ((!SMP || BROKEN) && (PPC32)))
> +	depends on DEBUG_KERNEL && (X86 || MIPS32 || ((!SMP || BROKEN) && PPC32))
>  	help
>  	  If you say Y here, it will be possible to remotely debug the
>  	  kernel using gdb. It is strongly suggested that you enable
> @@ -189,6 +189,7 @@ choice
>  	prompt "Method for KGDB communication"
>  	depends on KGDB
>  	default KGDB_ONLY_MODULES
> +	default KGDB_SIBYTE if SIBYTE_SB1xxx_SOC
>  	default KGDB_MPSC if SERIAL_MPSC
>  	help
>  	  There are a number of different ways in which you can communicate
> @@ -222,6 +223,10 @@ config KGDB_MPSC
>  	  Controller (MPSC) channel. Note that the GT64260A is not
>  	  supported.
>  
> +config KGDB_SIBYTE
> +	bool "KGDB: On the Broadcom SWARM serial port"
> +	depends on MIPS && SIBYTE_SB1xxx_SOC
> +
>  endchoice
>  
>  config KGDB_8250
> _

From hch@lst.de Mon Aug  1 11:21:38 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 01 Aug 2005 11:21:54 +0100 (BST)
Received: from verein.lst.de ([IPv6:::ffff:213.95.11.210]:11950 "EHLO
	mail.lst.de") by linux-mips.org with ESMTP id <S8224991AbVHAKVi>;
	Mon, 1 Aug 2005 11:21:38 +0100
Received: from verein.lst.de (localhost [127.0.0.1])
	by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id j71AOg6t010517
	(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO);
	Mon, 1 Aug 2005 12:24:43 +0200
Received: (from hch@localhost)
	by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id j71AOgcU010515;
	Mon, 1 Aug 2005 12:24:42 +0200
Date:	Mon, 1 Aug 2005 12:24:42 +0200
From:	Christoph Hellwig <hch@lst.de>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org
Subject: Re: [patch 05/15] Basic MIPS support
Message-ID: <20050801102442.GA10361@lst.de>
References: <resend.4.2972005.trini@kernel.crashing.org> <1.2972005.trini@kernel.crashing.org> <resend.5.2972005.trini@kernel.crashing.org> <20050801101933.GC4205@linux-mips.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050801101933.GC4205@linux-mips.org>
User-Agent: Mutt/1.3.28i
X-Scanned-By: MIMEDefang 2.39
Return-Path: <hch@lst.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8675
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: hch@lst.de
Precedence: bulk
X-list: linux-mips

On Mon, Aug 01, 2005 at 11:19:33AM +0100, Ralf Baechle wrote:
> Forwarding this as a heads up.  Who cares about kgdb may want to start
> working on the necessary bits as the patchset from below will be in 2.6.13.

I doubt it'll be in 2.6.13..


From yuasa@hh.iij4u.or.jp Mon Aug  1 16:32:40 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 01 Aug 2005 16:32:55 +0100 (BST)
Received: from mo01.iij4u.or.jp ([IPv6:::ffff:210.130.0.20]:24556 "EHLO
	mo01.iij4u.or.jp") by linux-mips.org with ESMTP id <S8225307AbVHAPcg>;
	Mon, 1 Aug 2005 16:32:36 +0100
Received: MO(mo01)id j71FZeI3005271; Tue, 2 Aug 2005 00:35:40 +0900 (JST)
Received: MDO(mdo00) id j71FZdfc029425; Tue, 2 Aug 2005 00:35:40 +0900 (JST)
Received: from stratos (h009.p499.iij4u.or.jp [210.149.243.9])
	by mbox.iij4u.or.jp (4U-MR/mbox00) id j71FZcOJ025783
	(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT);
	Tue, 2 Aug 2005 00:35:39 +0900 (JST)
Date:	Tue, 2 Aug 2005 00:35:38 +0900
From:	Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	yuasa@hh.iij4u.or.jp, linux-mips <linux-mips@linux-mips.org>
Subject: [PATCH 2.6] vr41xx: fix spurious IRQ problem
Message-Id: <20050802003538.6b6e6abc.yuasa@hh.iij4u.or.jp>
X-Mailer: Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yuasa@hh.iij4u.or.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8677
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: yuasa@hh.iij4u.or.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 967
Lines: 36

Hi Ralf,

This patch has fixed spurious IRQ problem about vr41xx.
Please apply this patch.

Yoichi

Signed-off-by: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>

diff -urN -X dontdiff a-orig/arch/mips/vr41xx/common/irq.c a/arch/mips/vr41xx/common/irq.c
--- a-orig/arch/mips/vr41xx/common/irq.c	2005-07-12 01:04:42.000000000 +0900
+++ a/arch/mips/vr41xx/common/irq.c	2005-07-31 21:07:17.000000000 +0900
@@ -62,6 +62,7 @@
 asmlinkage void irq_dispatch(unsigned int irq, struct pt_regs *regs)
 {
 	irq_cascade_t *cascade;
+	irq_desc_t *desc;
 
 	if (irq >= NR_IRQS) {
 		atomic_inc(&irq_err_count);
@@ -70,11 +71,15 @@
 
 	cascade = irq_cascade + irq;
 	if (cascade->get_irq != NULL) {
+		unsigned int source_irq = irq;
+		desc = irq_desc + source_irq;
+		desc->handler->ack(source_irq);
 		irq = cascade->get_irq(irq, regs);
 		if (irq < 0)
 			atomic_inc(&irq_err_count);
 		else
 			irq_dispatch(irq, regs);
+		desc->handler->end(source_irq);
 	} else
 		do_IRQ(irq, regs);
 }

From ralf@linux-mips.org Mon Aug  1 16:37:13 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 01 Aug 2005 16:37:31 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:62477 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225307AbVHAPhN>; Mon, 1 Aug 2005 16:37:13 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j71FeC6e020165;
	Mon, 1 Aug 2005 16:40:12 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j71FeBKY020158;
	Mon, 1 Aug 2005 16:40:11 +0100
Date:	Mon, 1 Aug 2005 16:40:11 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
Cc:	linux-mips <linux-mips@linux-mips.org>
Subject: Re: [PATCH 2.6] vr41xx: fix spurious IRQ problem
Message-ID: <20050801154011.GE4205@linux-mips.org>
References: <20050802003538.6b6e6abc.yuasa@hh.iij4u.or.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050802003538.6b6e6abc.yuasa@hh.iij4u.or.jp>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8678
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 166
Lines: 8

On Tue, Aug 02, 2005 at 12:35:38AM +0900, Yoichi Yuasa wrote:

> This patch has fixed spurious IRQ problem about vr41xx.
> Please apply this patch.

Applied,

  Ralf

From rolfliu@gmail.com Mon Aug  1 18:13:15 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 01 Aug 2005 18:13:30 +0100 (BST)
Received: from wproxy.gmail.com ([IPv6:::ffff:64.233.184.192]:55859 "EHLO
	wproxy.gmail.com") by linux-mips.org with ESMTP id <S8225307AbVHARNP> convert rfc822-to-8bit;
	Mon, 1 Aug 2005 18:13:15 +0100
Received: by wproxy.gmail.com with SMTP id i22so1166761wra
        for <linux-mips@linux-mips.org>; Mon, 01 Aug 2005 10:16:15 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:from:reply-to:to:subject:cc:mime-version:content-type:content-transfer-encoding:content-disposition;
        b=X8ISKrYJuhKMQqS1O2zu5FmGusFYRhV1BqG/cmfyu+gf4vmv/SORUBzeTr1oi03cXPBJVSc/nWIcAaEMD35gJASCswLqW+UvIrtQFUXmr94tlwi+h07MIX9LGNTK5pqh5b4F9C5ZeyLvenvJ1X8CnGq6y8ZI9T5h8vMfvzY+yL4=
Received: by 10.54.52.27 with SMTP id z27mr3014215wrz;
        Mon, 01 Aug 2005 10:16:15 -0700 (PDT)
Received: by 10.54.71.11 with HTTP; Mon, 1 Aug 2005 10:16:15 -0700 (PDT)
Message-ID: <2db32b720508011016537604a@mail.gmail.com>
Date:	Mon, 1 Aug 2005 10:16:15 -0700
From:	rolf liu <rolfliu@gmail.com>
Reply-To: rolf liu <rolfliu@gmail.com>
To:	linux-mips@linux-mips.org
Subject: Kernel complaining, "eth0: Too much work in interrupt, status 8401"
Cc:	rolf liu <rolfliu@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8BIT
Content-Disposition: inline
Return-Path: <rolfliu@gmail.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8679
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: rolfliu@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 191
Lines: 5

I am running linux 2.6.12 on db1550. It seems there are no many
network traffic except a few ssh sessions. Now kernel often complains
"eth0: Too much work in interrupt, status 8401".

thanks

From turja@mbnet.fi Mon Aug  1 19:39:36 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 01 Aug 2005 19:40:00 +0100 (BST)
Received: from fep18.inet.fi ([IPv6:::ffff:194.251.242.243]:60307 "EHLO
	fep18.inet.fi") by linux-mips.org with ESMTP id <S8225976AbVHASjg>;
	Mon, 1 Aug 2005 19:39:36 +0100
Received: from [127.0.0.1] ([80.223.109.59]) by fep18.inet.fi with ESMTP
          id <20050801184239.QBRN14797.fep18.inet.fi@[127.0.0.1]>;
          Mon, 1 Aug 2005 21:42:39 +0300
Message-ID: <42EE6D23.4010800@mbnet.fi>
Date:	Mon, 01 Aug 2005 21:42:43 +0300
From:	Mikael Nousiainen <turja@mbnet.fi>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	Markus Dahms <mad@automagically.de>
CC:	linux-mips@linux-mips.org
Subject: Re: New VINO video drivers for Indy
References: <42D4BF49.4040907@mbnet.fi> <20050715110021.GA15740@gaspode.automagically.de> <42D83063.3060505@mbnet.fi> <20050716112745.GA12716@gaspode.automagically.de> <42ED1CBE.4060901@mbnet.fi> <20050801084441.GA5227@gaspode.automagically.de>
In-Reply-To: <20050801084441.GA5227@gaspode.automagically.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <turja@mbnet.fi>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8680
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: turja@mbnet.fi
Precedence: bulk
X-list: linux-mips
Content-Length: 1302
Lines: 56

Markus Dahms wrote:

>Mikael Nousiainen wrote:
>
>  
>
>>Could you provide a sample image ?
>>    
>>
>
>http://automagically.de/images/p_indycam_01.jpg
>http://automagically.de/images/p_indycam_02.jpg
>  
>
Everything seems to be ok with these...

>And (it was hard enough to capture) one with some lines on it:
>
>http://automagically.de/images/p_indycam_03.jpg
>  
>
The image is fuzzy because the camera has moved just after the first 
field for the image
has been captured, before capturing the second field (every other line).

The two black lines in the center of the image are the real problem as I 
have no
idea what causes them to appear. As you can easily check, the "missing 
content" is found
from the beginning of the same line.

>These pictures where taken with daylight, some of the colors are a bit
>strange[1] (I'll try it artificial light in the evening).
>
>Markus
>
>[1] the cyan looking highlighter on the first picture should really be
>    green ;).
>
>  
>
Yep, I've noticed same kind of behaviour with my indycam as it does not 
reproduce
blue colors correctly (blue is very weak always).
I've also heard that the camera is designed to be used in fluorescent 
light so
problems with colors seem to be a nice "feature" of the camera... :)

Thanks for the samples.

>
>
>  
>



From ilya@total-knowledge.com Mon Aug  1 20:05:52 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 01 Aug 2005 20:06:11 +0100 (BST)
Received: from [IPv6:::ffff:67.115.118.5] ([IPv6:::ffff:67.115.118.5]:3855
	"EHLO us0exb05.us.sonicwall.com") by linux-mips.org with ESMTP
	id <S8225929AbVHATFw>; Mon, 1 Aug 2005 20:05:52 +0100
Received: from us0exb02.us.sonicwall.com ([10.50.128.202]) by us0exb05.us.sonicwall.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Mon, 1 Aug 2005 12:08:52 -0700
Received: from [10.0.15.99] ([10.0.15.99]) by us0exb02.us.sonicwall.com with Microsoft SMTPSVC(5.0.2195.6713);
	 Mon, 1 Aug 2005 12:08:51 -0700
Message-ID: <42EE7343.9020209@total-knowledge.com>
Date:	Mon, 01 Aug 2005 12:08:51 -0700
From:	"Ilya A. Volynets-Evenbakh" <ilya@total-knowledge.com>
Organization: Total Knowledge
User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050723)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	ppopov@embeddedalley.com
CC:	"'linux-mips@linux-mips.org'" <linux-mips@linux-mips.org>
Subject: Re: Au1000 PCMCIA I/O space?
References: <42EDBE3B.3010503@total-knowledge.com> <1122877889.5014.319.camel@localhost.localdomain>
In-Reply-To: <1122877889.5014.319.camel@localhost.localdomain>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 01 Aug 2005 19:08:51.0755 (UTC) FILETIME=[743C97B0:01C596CC]
Return-Path: <ilya@total-knowledge.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8681
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ilya@total-knowledge.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1264
Lines: 40

Hmm, I see. I'm not really using PCMCIA driver - I just have
IDE interface hanging off of PCMCIA controller of Au1000, so
I had to do something similar to drivers/ide/mips/swarm.c.
Thus since I can pass addresses directly to ioremap, I'm OK
anyways.


Pete Popov wrote:

>On Sun, 2005-07-31 at 23:16 -0700, Ilya A. Volynets-Evenbakh wrote:
>  
>
>>Is there any particular reason why Au1000 PCMCIA IO space is not 
>>included in 36-bit address fixup?
>>Attached patch fixes it for me, but I'm wondering if there is valid 
>>reason not to do that.
>>    
>>
>
>Because it's ioremapped by the au1x pcmcia driver and the driver passes 
>the virt address to the pcmcia stack. If this isn't working for you, 
>something else is broken.  You only need the fixup when you can't call 
>ioremap with the entire 36 bit phys address. For example, the attribute and
>common memory space are ioremapped by the "pcmcia stack" in the kernel,
>not the low level socket driver over which we have control. Thus, to
>work around the fact that you can't easily change the entire pcmcia
>stack, you do the fixup thing. 
>
>Unless the pcmcia stack changed, the driver should work as is.
>
>Pete
>
>  
>

-- 
Ilya A. Volynets-Evenbakh
Total Knowledge. CTO
http://www.total-knowledge.com


From rolfliu@gmail.com Tue Aug  2 06:08:16 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 02 Aug 2005 06:08:35 +0100 (BST)
Received: from wproxy.gmail.com ([IPv6:::ffff:64.233.184.207]:16399 "EHLO
	wproxy.gmail.com") by linux-mips.org with ESMTP id <S8224837AbVHBFIQ> convert rfc822-to-8bit;
	Tue, 2 Aug 2005 06:08:16 +0100
Received: by wproxy.gmail.com with SMTP id i22so1285674wra
        for <linux-mips@linux-mips.org>; Mon, 01 Aug 2005 22:11:21 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:from:reply-to:to:subject:cc:mime-version:content-type:content-transfer-encoding:content-disposition;
        b=PRAuzcEQiqqxCZGfQ/4SxPu/tAk1mdUVKwRDWumIPcy4bSF3zHUUVmL2n/cM0XBHsD/nQrDrMbZRWJGb2zOywlzCL76FTuxb76sSjBLo+d+y7gd7En8XDWFnyDkR0o7ZisrYKZUGA84uJjh+x5qz3Ch0L9w7LQR33SqDE9q5zWg=
Received: by 10.54.35.54 with SMTP id i54mr3445557wri;
        Mon, 01 Aug 2005 22:11:21 -0700 (PDT)
Received: by 10.54.71.11 with HTTP; Mon, 1 Aug 2005 22:11:21 -0700 (PDT)
Message-ID: <2db32b7205080122114c1b5f07@mail.gmail.com>
Date:	Mon, 1 Aug 2005 22:11:21 -0700
From:	rolf liu <rolfliu@gmail.com>
Reply-To: rolf liu <rolfliu@gmail.com>
To:	linux-mips@linux-mips.org
Subject: Is X Windows working on db1550 Now?
Cc:	rolf liu <rolfliu@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8BIT
Content-Disposition: inline
Return-Path: <rolfliu@gmail.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8682
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: rolfliu@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 215
Lines: 5

Even though running x on db1550 could be slow, still want to try it
for fun. is the x windows already running on db1550? I saw there is a
frame buffer driver for db board. Not sure if it can support the x ?

thanks

From dan@embeddedalley.com Tue Aug  2 13:55:21 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 02 Aug 2005 13:55:37 +0100 (BST)
Received: from embeddededge.com ([IPv6:::ffff:209.113.146.155]:24077 "EHLO
	penguin.netx4.com") by linux-mips.org with ESMTP
	id <S8225327AbVHBMzV>; Tue, 2 Aug 2005 13:55:21 +0100
Received: from [192.168.253.28] (tibook.embeddededge.com [192.168.253.28])
	by penguin.netx4.com (8.12.8/8.12.9) with ESMTP id j72CgbmN005162;
	Tue, 2 Aug 2005 08:42:37 -0400
In-Reply-To: <2db32b7205080122114c1b5f07@mail.gmail.com>
References: <2db32b7205080122114c1b5f07@mail.gmail.com>
Mime-Version: 1.0 (Apple Message framework v622)
Content-Type: text/plain; charset=US-ASCII; format=flowed
Message-Id: <84b6c5684b91af184b4837b9d82120e8@embeddedalley.com>
Content-Transfer-Encoding: 7bit
Cc:	linux-mips@linux-mips.org
From:	Dan Malek <dan@embeddedalley.com>
Subject: Re: Is X Windows working on db1550 Now?
Date:	Tue, 2 Aug 2005 08:58:53 -0400
To:	rolf liu <rolfliu@gmail.com>
X-Mailer: Apple Mail (2.622)
Return-Path: <dan@embeddedalley.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8683
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dan@embeddedalley.com
Precedence: bulk
X-list: linux-mips
Content-Length: 556
Lines: 23


On Aug 2, 2005, at 1:11 AM, rolf liu wrote:

> Even though running x on db1550 could be slow, still want to try it
> for fun. is the x windows already running on db1550?

The db1550 doesn't have a frame buffer, you would have to
attach some PCI graphics card.

> .... I saw there is a
> frame buffer driver for db board.

For the db1100, with it's internal frame buffer.

>  Not sure if it can support the x ?

I've run the MIPS binaries that are floating around the 'net
on the Au1500 with a SM501 PCI controller.  Performance
was quite good.


	-- Dan


From andreas@strodl.org Tue Aug  2 14:01:41 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 02 Aug 2005 14:02:00 +0100 (BST)
Received: from mail.void.at ([IPv6:::ffff:212.88.181.19]:32444 "EHLO
	mail.void.at") by linux-mips.org with ESMTP id <S8225327AbVHBNBl>;
	Tue, 2 Aug 2005 14:01:41 +0100
Received: from bademeister.void.at ([212.88.172.176] helo=[172.16.0.150])
	by mail.void.at with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32)
	(Exim 4.52)
	id 1DzwRE-0005b7-HZ
	for linux-mips@linux-mips.org; Tue, 02 Aug 2005 15:04:09 +0200
Message-ID: <42EF6E86.9040302@strodl.org>
Date:	Tue, 02 Aug 2005 15:00:54 +0200
From:	Andreas Strodl <andreas@strodl.org>
User-Agent: Debian Thunderbird 1.0.2 (X11/20050602)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: IDE problem
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-mail.void.at-MailScanner: Found to be clean
X-MailScanner-From: andreas@strodl.org
Return-Path: <andreas@strodl.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8684
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: andreas@strodl.org
Precedence: bulk
X-list: linux-mips
Content-Length: 6088
Lines: 173

Hi,

I'm using the kernel version 2.4.31 (-r2_4_31) from the CVS.

The plattform is a MIPS Toshiba JMR3927CF with an IDE PCI chipset CMD649.

The problem is that the IDE chipset CMD649 is detected but the hardisk
that is connected
via this IDE channel is not detected. The system boots direct from a
flash so I can paste
/proc entries too.

Note:
#define PCIBIOS_MIN_IO          0x8000  /* reserve regacy I/O space */
#define PCIBIOS_MIN_MEM     0x0000
This settings are used for this board.

dmesg Output:
CPU revision is: 00002242
Primary instruction cache 8kB, linesize 16 bytes
Primary data cache 4kB, linesize 16 bytes
Linux version 2.4.31 (andi@diesel) (gcc version egcs-2.91.66 19990314
(egcs-1.1.2 release)) #16 Die Aug 2 14:28:16 CEST 2005
TX3927 -- CRIR:39270040 CCFG:0006b039 PCFG:007c1000
TX3927 PCIC -- DID:000a VID:102f RID:07 Arbiter:Internal
TX39XX D-Cache WriteBack (CWF) .
Determined physical RAM map:
 memory: 01ffff00 @ 00000000 (usable)
On node 0 totalpages: 8191
zone(0): 4096 pages.
zone(1): 4095 pages.
zone(2): 0 pages.
Kernel command line: rw root=/dev/ramdisk console=ttyS0,115200
S3511A: 05 08 02 02 0d 15 31
Calibrating delay loop... 132.30 BogoMIPS
Memory: 25596k/32764k available (1965k kernel code, 7168k reserved, 247k
data, 108k init, 0k highmem)
Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
Inode cache hash table entries: 2048 (order: 2, 16384 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
Checking for 'wait' instruction...  available.
POSIX conformance testing by UNIFIX
PCI: Probing PCI hardware
PCI: IO 0x00000000-0x00ffffff MEM 0x08000000-0x0fffffff
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
URL log initialization
Starting kswapd
VFS: Disk quotas vdquot_6.5.1
Journalled Block Device driver loaded
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis
Communications AB.
Squashfs 2.1 (released 2004/12/10) (C) 2002-2004 Phillip Lougher
Power: function of power button was initialised
pty: 256 Unix98 ptys configured
TXx927 Serial driver version 0.21
ttyS00 at 0xfffef300 (irq = 22) is a TXx927 SIO
ttyS01 at 0xfffef400 (irq = 23) is a TXx927 SIO
loop: loaded (max 8 devices)
8139too Fast Ethernet driver 0.9.26
eth0: RealTek RTL8139 at 0x8000, 00:e3:d8:ec:ea:d8, IRQ 16
eth1: RealTek RTL8139 at 0x8400, 00:b7:a2:01:be:a2, IRQ 17
Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
CMD649: IDE controller at PCI slot 00:0e.0
CMD649: chipset revision 2
CMD649: 100% native mode on irq 18
    ide0: BM-DMA at 0x8800-0x8807, BIOS settings: hda:pio, hdb:pio
    ide1: BM-DMA at 0x8808-0x880f, BIOS settings: hdc:pio, hdd:pio
VFS: Mounted root (squashfs filesystem) readonly.
Freeing unused kernel memory: 108k freed


# cat /proc/ioports
00008000-000080ff : PCI device 10ec:8139
  00008000-000080ff : 8139too
00008400-000084ff : PCI device 10ec:8139
  00008400-000084ff : 8139too
00008800-0000880f : PCI device 1095:0649
  00008800-00008807 : ide0
  00008808-0000880f : ide1
00008c00-00008c07 : PCI device 1095:0649
00009000-00009007 : PCI device 1095:0649
00009400-00009403 : PCI device 1095:0649
00009800-00009803 : PCI device 1095:0649

# cat /proc/interrupts
           CPU0
 16:          0      tx3927_irq  eth0
 17:          9      tx3927_irq  eth1
 21:          0      tx3927_irq  power
 22:        534      tx3927_irq  serial_txx927
 29:     102227      tx3927_irq  timer

ERR:          0

# cat /proc/ide/drivers
ide-disk version 1.17
ide-default version 0.9.newide

# cat /proc/ide/cmd64x


Controller: 0
CMD649 Chipset.
--------------- Primary Channel ---------------- Secondary Channel
-------------
                 enabled                          enabled
--------------- drive0 --------- drive1 -------- drive0 ----------
drive1 ------
DMA enabled:    no               no              no                no
DMA Mode:        PIO(?)           PIO(?)          PIO(?)            PIO(?)
PIO Mode:       ?                ?               ?                 ?
                polling                          polling
                clear                            clear
                enabled                          enabled

# cat /proc/pci
PCI devices found:
  Bus  0, device  12, function  0:
    Class 0200: PCI device 10ec:8139 (rev 16).
      IRQ 16.
      Master Capable.  Latency=64.  Min Gnt=32.Max Lat=64.
      I/O at 0x8000 [0x80ff].
      Non-prefetchable 32 bit memory at 0x8082000 [0x80820ff].
  Bus  0, device  13, function  0:
    Class 0200: PCI device 10ec:8139 (rev 16).
      IRQ 17.
      Master Capable.  Latency=64.  Min Gnt=32.Max Lat=64.
      I/O at 0x8400 [0x84ff].
      Non-prefetchable 32 bit memory at 0x8082400 [0x80824ff].
  Bus  0, device  14, function  0:
    Class 0101: PCI device 1095:0649 (rev 2).
      IRQ 18.
      Master Capable.  Latency=64.  Min Gnt=2.Max Lat=4.
      I/O at 0x8c00 [0x8c07].
      I/O at 0x9400 [0x9403].
      I/O at 0x9000 [0x9007].
      I/O at 0x9800 [0x9803].
      I/O at 0x8800 [0x880f].
  Bus  0, device  15, function  0:
    Class 0c03: PCI device 1131:1561 (rev 48).
      IRQ 19.
      Master Capable.  Latency=64.  Min Gnt=1.Max Lat=42.
      Non-prefetchable 32 bit memory at 0x8080000 [0x8080fff].
  Bus  0, device  15, function  1:
    Class 0c03: PCI device 1131:1561 (rev 48).
      IRQ 19.
      Master Capable.  Latency=64.  Min Gnt=1.Max Lat=42.
      Non-prefetchable 32 bit memory at 0x8081000 [0x8081fff].
  Bus  0, device  15, function  2:
    Class 0c03: PCI device 1131:1562 (rev 48).
      IRQ 19.
      Master Capable.  Latency=64.  Min Gnt=2.Max Lat=16.
      Non-prefetchable 32 bit memory at 0x8082800 [0x80828ff].
#


I also found out, that drive->present in do_probe in
drivers/ide/ide-probe.c is 0
so I will not be detected, right?

Any Ideas

Best regards

Andrew



From chuck@theptrgroup.com Tue Aug  2 20:38:02 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 02 Aug 2005 20:38:26 +0100 (BST)
Received: from pop-siberian.atl.sa.earthlink.net ([IPv6:::ffff:207.69.195.71]:30197
	"EHLO pop-siberian.atl.sa.earthlink.net") by linux-mips.org
	with ESMTP id <S8225744AbVHBTiC>; Tue, 2 Aug 2005 20:38:02 +0100
Received: from hh1121185.direcpc.com ([206.71.121.185] helo=squidward)
	by pop-siberian.atl.sa.earthlink.net with smtp (Exim 3.36 #10)
	id 1E02dT-0006LJ-00; Tue, 02 Aug 2005 15:41:13 -0400
From:	"Chuck Meade" <chuck@ThePTRGroup.com>
To:	<linux-mips@linux-mips.org>
Cc:	"Chuck Meade" <chuck@ThePTRGroup.com>
Subject: looking for an Ocelot-III target
Date:	Tue, 2 Aug 2005 15:41:22 -0400
Message-ID: <IIEEICKJLNEPBBDJICNGKEDOIFAA.chuck@ThePTRGroup.com>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Importance: Normal
Return-Path: <chuck@theptrgroup.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8685
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: chuck@ThePTRGroup.com
Precedence: bulk
X-list: linux-mips
Content-Length: 166
Lines: 10

Hi Guys,

We need an Ocelot-III target, and have been told they are sold out.
Does anyone out there have an Ocelot-III for sale?

Thanks,
Chuck Meade
The PTR Group



From mips@joshuawise.com Wed Aug  3 15:13:15 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 03 Aug 2005 15:13:35 +0100 (BST)
Received: from static-151-204-232-50.bos.east.verizon.net ([IPv6:::ffff:151.204.232.50]:16820
	"EHLO mail2.sicortex.com") by linux-mips.org with ESMTP
	id <S8225438AbVHCONP>; Wed, 3 Aug 2005 15:13:15 +0100
Received: from ws118.sicortex.com (ws118.sicortex.com [10.0.0.118])
	by mail2.sicortex.com (Postfix) with ESMTP id E207D1BFF0E;
	Wed,  3 Aug 2005 10:16:28 -0400 (EDT)
From:	Joshua Wise <mips@joshuawise.com>
To:	linux-mips@linux-mips.org
Subject: SMP badness on 5kc
Date:	Wed, 3 Aug 2005 10:16:27 -0400
User-Agent: KMail/1.8
Cc:	ralf@linux-mips.org
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200508031016.28227.mips@joshuawise.com>
Return-Path: <mips@joshuawise.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8686
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: mips@joshuawise.com
Precedence: bulk
X-list: linux-mips
Content-Length: 10906
Lines: 250

Hi all,

I have been setting up a simulation of a multiprocessor 5kc board that my 
company is developing using gxemul, and I've come across a few problems with 
the MIPS SMP support.

The first issue that I came across was that 5kc does not have an scache, and 
hence r4k_blast_scache will be null, and hence local_r4k_flush_icache_range 
crashes the system with a kernel NULL dereference. (Actually, that happens 
early enough that it drops back into YAMON, without even giving me a kernel 
panic.) Strangely enough, this only happens on SMP... My solution for this 
was to put a switch statement like the one in local_r4k___flush_cache_all 
into local_r4k_flush_icache_range around the if 
(!cpu_icache_snoops_remote_store). This seemed to cause the crash to stop 
happening.

My second issue, unresolved to date, is that we are calling 
on_each_cpu(local_r4k___flush_cache_all) (called from r4k_flush_cache_all) 
while interrupts are disabled. This doesn't happen while we are bringing up 
CPUs 0 or 1 -- it seems to only happen when bringing up CPU2. This causes a 
"badness" message, followed by either a lot of oopses, or a deadlock. Below 
my sig is a boot log from serial, complete with debug messages written by the 
Sirius Cybernetics Corporation. :)

 I'm not quite sure what to make of this, but I am willing to do any 
diagnostics that you need. On request, I can also post my implementations of 
the prom_ functions, although they're pretty straightforward -- they map 
almost directly to gxemul's fake mp device.

Thanks,
joshua

wise@ws118:~/gxemul-<Our Machine>> ./gxemul @gxemul.conf
GXemul-<Our Machine>   Copyright (C) 2003-2005  Anders Gavare
Read the source code and/or documentation for other Copyright messages.

Creating emulation from configfile "gxemul.conf":
    name: "<Our Machine> Simulation"
    machine "<Our Machine>":
        memory: 64 MB

        ***  NOT starting bintrans, as gxemul was compiled without such 
support!

        cpu0 .. cpu5: 5Kc (I+D = 32+32 KB)
        device  0 at 0x0010000000: cons [console]
        device  1 at 0x0011000000: mp
        device  2 at 0x0015000000: ns16550 [emarg serial]
        device  3 at 0x001fc00010: prid
        machine: <Our Machine>
        loading vmlinux.srec:
            SREC "arch/mips/boot/vmlinux.srec"
            entry point 0x802ca000
            0x1fa9f1 bytes loaded
        loading System.map:
            6724 symbols
        loading 0x80400000:initrd.mips:
            RAW: 0x400000 bytes @ 0x80400000
        loading 0x9fc00000:yamon.bin:
            RAW: 0xd9470 bytes @ 0x9fc00000
        starting cpu0 at 0xffffffff9fc00000
-------------------------------------------------------------------------------

CPU BOARD <Our Machine> RAM RAM_HILO RAM_TEST CLEAR COPYTEXT COPYDATA STACK 
INFO CINFO FIRSTC

Environment default switch is in the 'on' position. The environment
has been set to default values. If the switch is not set to 'off',
the environment will be cleared at every reset.

Please set the switch to the 'off' position or type Ctrl-C to continue.

YAMON> go 802ca000
Linux version 2.6.12-rc6<Our CPU>-trunk (wise@ws118) (gcc version 3.4.4) #168 
SMP Wed Aug 3 09:41:47 EDT 2005
CPU revision is: 00018101
FPU revision is: 00038110
Determined physical RAM map:
 memory: 0000000000001000 @ 0000000000000000 (reserved)
 memory: 00000000000ff000 @ 0000000000001000 (ROM data)
 memory: 0000000000218000 @ 0000000000100000 (reserved)
 memory: 0000000003ce8000 @ 0000000000318000 (usable)
On node 0 totalpages: 16384
  DMA zone: 16384 pages, LIFO batch:7
  Normal zone: 0 pages, LIFO batch:1
  HighMem zone: 0 pages, LIFO batch:1
Built 1 zonelists
I am running on a <Our Company> <Our Machine>!
Kernel command line:  console=ttyS0,38400n8r
Primary instruction cache 32kB, physically tagged, 2-way, linesize 32 bytes.
Primary data cache 32kB, 2-way, linesize 32 bytes.
About to flush all cache on CPU 0
R4K cache flush time! (0)
Synthesized TLB refill handler (36 instructions).
Synthesized TLB load handler fastpath (50 instructions).
Synthesized TLB store handler fastpath (50 instructions).
Synthesized TLB modify handler fastpath (49 instructions).
Cache parity protection enabled
PID hash table entries: 512 (order: 9, 16384 bytes)
CPU frequency 8.00 MHz
Using 4.000 MHz high precision timer.
Dentry cache hash table entries: 16384 (order: 5, 131072 bytes)
Inode-cache hash table entries: 8192 (order: 4, 65536 bytes)
Memory: 60924k/62368k available (1450k kernel code, 1304k reserved, 378k data, 
208k init, 0k highmem)
Calibrating delay loop... 8.19 BogoMIPS (lpj=4096)
Mount-cache hash table entries: 256
Checking for 'wait' instruction...  available.
Checking for the multiply/shift bug... no.
Checking for the daddi bug... no.
Checking for the daddiu bug... no.
Detected 5 available secondary CPU(s)
CPU 1 started.....
CPU revision is: 00018101
FPU revision is: 00038110
Primary instruction cache 32kB, physically tagged, 2-way, linesize 32 bytes.
Primary data cache 32kB, 2-way, linesize 32 bytes.
About to flush all cache on CPU 1
R4K cache flush time! (1)
Synthesized TLB refill handler (36 instructions).
Calibrating delay loop... 8.19 BogoMIPS (lpj=4096)
Finishing init on cpu 1...CPU frequency 8.00 MHz
done
IPI send 0->1: 1
IPI on 1: 1 -- Reschedule myself? Why, certainly!
IPI send 0->1: 1
IPI on 1: 1 -- Reschedule myself? Why, certainly!
CPU 2 started.....
CPU revision is: 00018101
FPU revision is: 00038110
Primary instruction cache 32kB, physically tagged, 2-way, linesize 32 bytes.
Primary data cache 32kB, 2-way, linesize 32 bytes.
About to flush all cache on CPU 2
R4K cache flush time! (2)
SMP_CALL_FUNCTION on CPU 2: I am calling: ffffffff801255a0
Badness in smp_call_function at arch/mips/kernel/smp.c:150
Call Trace:
 [<ffffffff8010bca8>] smp_call_function+0x250/0x258
 [<ffffffff80141924>] printk+0x2c/0x38
 [<ffffffff801256b4>] r4k___flush_cache_all+0x44/0x70
 [<ffffffff80141924>] printk+0x2c/0x38
 [<ffffffff801255a0>] local_r4k___flush_cache_all+0x0/0xd0
 [<ffffffff801256c8>] r4k___flush_cache_all+0x58/0x70
 [<ffffffff802df55c>] ld_mmu_r4xx0+0xc54/0x1ab0
 [<ffffffff802d9c4c>] per_cpu_trap_init+0x1ac/0x1d0
 [<ffffffff8010b9a4>] start_secondary+0x24/0xd8

IPI send 2->0: 2
IPI on 0: 2 -- IPI on 1: 2 -- IPI send 2->1: 2
Call a function? I'd love to!
SMP_CALL_FUNCTION on CPU 2: I am calling: ffffffff80125ef0
Badness in smp_call_function at arch/mips/kernel/smp.c:150
Call Trace:
 [<ffffffff8010bca8>] smp_call_function+0x250/0x258
 [<ffffffff80125ef0>] local_r4k_flush_icache_range+0x0/0x280
 [<ffffffff801261b0>] r4k_flush_icache_range+0x40/0x58
 [<ffffffff802e1934>] build_clear_page+0x144c/0x1e88
 [<ffffffff802df5d0>] ld_mmu_r4xx0+0xcc8/0x1ab0
 [<ffffffff802d9c4c>] Call a function? I'd love to!
per_cpu_trap_init+0x1ac/0x1d0
 [<ffffffff8010b9a4>] start_secondary+0x24/0xd8

IPI send 2->0: 2
IPI send 2->1: 2
IPI on 1: 2 -- Call a function? I'd love to!
[ cpu0: warning: LOW reference vaddr=0x00000000, exception TLBL, 
pc=ffffffff80300a84 <vm_area_cachep+0x4> ]
CPU 0 Unable to hand<1>CPU 0 Unable to handle kernel paging request at virtual 
address 0000000000000000, epc == ffffffff80300a84, <4>ra == fffffffBadness 
in<4> smp_call_function at arch/mips/kernel/smp.c:150
Call Trace:
 [<ffffffff8010bca8>] smp_call_function+0x250/0x258
 [<ffffffff8010bbac>] smp_call_function+0x154/0x258
 [<ffffffff80125ef0>] local_r4k_flush_icache_range+0x0/0x280
 [<ffffffff801261b0>] r4k_flush_icache_range+0x40/0x58
 [<ffffffff802e4f94>] build_copy_page+0x2c24/0x3490
 [<ffffffff801261b8>] r4k_flush_icache_range+0x48/0x58
 [<ffffffff802d9c4c>] Oopsper_cpu_trap_init+0x1ac/0x1d0
 [<ffffffff8010b9a4>] start_secondary+0x24/0xd8

IPI send 2->0: 2
IPI send 2->1: 2
IPI on 1: 2 -- Call a function? I'd love to!
 in arch/mips/mm/fault.c::do_page_fault, line 167[#1]:
Cpu 0
Synthesized TLB refill handler (36 instructions).
SMP_CALL_FUNCTION on CPU 2: I am calling: ffffffff80125ef0
Badness in smp_call_function at arch/mips/kernel/smp.c:150
Call Trace:
 [<ffffffff8010bca8>] smp_call_function+0x250/0x258
 [<ffffffff80125ef0>] local_r4k_flush_icache_range+0x0/0x280
 [<ffffffff801261b0>] r4k_flush_icache_range+0x40/0x58
 [<ffffffff802dd50c>] build_tlb_refill_handler+0x3f4/0x15e8
 [<ffffffff8010b9a4>] start_secondary+0x24/0xd8

IPI send 2->0: 2
IPI send 2->1: 2
IPI on 1: 2 -- Call a function? I'd love to!
Calibrating delay loop... $ 0   : 0000000000000000 ffffffff80300000 
0000000000010000 0000000000010000
$ 4   : 9800000000333e10 ffffffff801261b0 0000000000000001 0000000000000004
$ 8   : 0000000000000004 0000000000000f11 000000000000000a ffffffff80300f43
$12   : ffffffffffffffff ffffffff80301337 0000000000000002 ffffffff802754e0
$16   : ffffffff803008a8 000000001400fce0 0000000000000002 0000000000000002
$20   : ffffffff802ffef8 0000000000000000 0000000000000000 0000000000000000
$24   : 0000000000000000 0000000000000020
$28   : 9800000000330000 9800000000333e10 0000000000000000 ffffffff801261b8
Hi    : 0000000000000004
Lo    : 189374bc6a7f0000
epc   : ffffffff80300a84 0xffffffff80300a84     Not tainted
ra    : ffffffff801261b8 r4k_flush_icache_range+0x48/0x58
Status: 1400fce2    KX SX UX KERNEL EXL
Cause : 0000c008
BadVA : 0000000000000000
PrId  : 00018101
Modules linked in:
Process swapper (pid: 1, threadinfo=9800000000330000, task=980000000032d778)
Stack : 0000000000004000 ffffffff80101abc 0000000000000000 ffffffff802ff520
        0000000000000188 0000000000000000 0000000000000002 0000000000000002
        0000000000001000 004189374bc6a7f0 ffffffff802fff40 0000000000000963
        000000000000000a ffffffff80300f3d ffffffffffffffff ffffffff80301337
        0000000000000002 ffffffff802754e0 0000000000000002 0000000000000002
        0000000000000002 0000000000000002 ffffffff802ffef8 0000000000000000
        0000000000000000 0000000000000000 0000000000000000 0000000000000020
        0000000000000000 ffffffff80141924 9800000000330000 9800000000333f50
        0000000000000000 ffffffff802da64c 000000001400fce3 0000000000000199
        99999999999c0000 9800000000374000 0000000000004000 ffffffff802da6f4
        ...
Call Trace:
 [<ffffffff80101abc>] mipsIRQ+0x15c/0x1c0
 [<ffffffff80141924>] printk+0x2c/0x38
 [<ffffffff802da64c>] __cpu_up+0x3c/0x188
 [<ffffffff802da6f4>] __cpu_up+0xe4/0x188
 [<ffffffff802ea0e4>] cpu_up+0x15c/0x270
 [<ffffffff802ea0d0>] cpu_up+0x148/0x270
 [<ffffffff80100e80>] init+0x9a8/0xa78
 [<ffffffff801044a8>] kernel_thread_helper+0x10/0x18
 [<ffffffff80104498>] kernel_thread_helper+0x0/0x18


Code: 00000000  00000000  011638a0 <98000000> 01163aa0  98000000  011639a0  
98000000  01163ba0
IPI on 0: 2 -- Call a function? I'd love to!
IPI on 0: 2 -- Call a function? I'd love to!
IPI on 0: 2 -- Call a function? I'd love to!
Kernel panic - not syncing: Aiee, killing interrupt handler!
 SMP_CALL_FUNCTION on CPU 0: I am calling: ffffffff8010bd78
IPI send 0->1: 2
IPI on 1: 2 -- Call a function? I'd love to!
        

From ralf@linux-mips.org Wed Aug  3 17:35:07 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 03 Aug 2005 17:35:23 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:61726 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225361AbVHCQfH>; Wed, 3 Aug 2005 17:35:07 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j73GcK2H010307;
	Wed, 3 Aug 2005 17:38:20 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j73GcKOP010306;
	Wed, 3 Aug 2005 17:38:20 +0100
Date:	Wed, 3 Aug 2005 17:38:20 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Joshua Wise <mips@joshuawise.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: SMP badness on 5kc
Message-ID: <20050803163820.GA3530@linux-mips.org>
References: <200508031016.28227.mips@joshuawise.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200508031016.28227.mips@joshuawise.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8687
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 2340
Lines: 49

On Wed, Aug 03, 2005 at 10:16:27AM -0400, Joshua Wise wrote:

> I have been setting up a simulation of a multiprocessor 5kc board that my 
> company is developing using gxemul, and I've come across a few problems with 
> the MIPS SMP support.

The 5Kc has no cache coherency, so I don't see how it could be done other
than by offloading that into software - which performancewise I would
expect to be an unatractive solution.  Well, there's always the option of
disabling caches which is the easiest way but probably even slower.

> The first issue that I came across was that 5kc does not have an scache, and 
> hence r4k_blast_scache will be null, and hence local_r4k_flush_icache_range 
> crashes the system with a kernel NULL dereference. (Actually, that happens 
> early enough that it drops back into YAMON, without even giving me a kernel 
> panic.) Strangely enough, this only happens on SMP... My solution for this 
> was to put a switch statement like the one in local_r4k___flush_cache_all 
> into local_r4k_flush_icache_range around the if 
> (!cpu_icache_snoops_remote_store). This seemed to cause the crash to stop 
> happening.

That is acutally somewhat similar to another problem somebody found
recently for a uniprocessor configuration.  The whole second level cache
flushing thing only really is needed at all if a system has such a cache
at all, so something like:

  if (!cpu_icache_snoops_remote_store && cpu_has_sc) {
     [...]
  }

would be sensible.  Well, there's no cpu_has_sc but cpu_scache_line_size()
would serve the same purpose.

> My second issue, unresolved to date, is that we are calling 
> on_each_cpu(local_r4k___flush_cache_all) (called from r4k_flush_cache_all) 
> while interrupts are disabled. This doesn't happen while we are bringing up 
> CPUs 0 or 1 -- it seems to only happen when bringing up CPU2. This causes a 
> "badness" message, followed by either a lot of oopses, or a deadlock. Below 
> my sig is a boot log from serial, complete with debug messages written by the 
> Sirius Cybernetics Corporation. :)

Who were the first to be shot when the great revolution came, says the
Hitchhiker's Guide to The Galaxy ;-)

I recently modified the code to avoid such SMP cacheflushes during startup.
As it turned out only a local_* flush was needed which nicely dealt with
the warnings.

  Ralf

From djohnson@sw.starentnetworks.com Wed Aug  3 19:13:59 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 03 Aug 2005 19:14:18 +0100 (BST)
Received: from pasta.sw.starentnetworks.com ([IPv6:::ffff:12.33.234.10]:43991
	"EHLO pasta.sw.starentnetworks.com") by linux-mips.org with ESMTP
	id <S8225540AbVHCSN7>; Wed, 3 Aug 2005 19:13:59 +0100
Received: from cortez.sw.starentnetworks.com (cortez.sw.starentnetworks.com [12.33.233.12])
	by pasta.sw.starentnetworks.com (Postfix) with ESMTP id 538981496D7
	for <linux-mips@linux-mips.org>; Wed,  3 Aug 2005 14:17:08 -0400 (EDT)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <17137.2596.203177.705324@cortez.sw.starentnetworks.com>
Date:	Wed, 3 Aug 2005 14:17:08 -0400
From:	Dave Johnson <djohnson+linuxmips@sw.starentnetworks.com>
To:	linux-mips@linux-mips.org
Subject: modules fail to load for 64bit kernel with 32bit ELF format
X-Mailer: VM 7.07 under 21.4 (patch 6) "Common Lisp" XEmacs Lucid
Return-Path: <djohnson@sw.starentnetworks.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8688
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: djohnson+linuxmips@sw.starentnetworks.com
Precedence: bulk
X-list: linux-mips
Content-Length: 691
Lines: 23


Building for 64bit kernel with 32bit ELF format produces the correct
object files for loading, but attempting to load them produces
ENOEXEC.

This is because the object file is failing ELF header checks in
load_module().

Elf_Ehdr in include/asm-mips/module.h is being defined as Elf64_Ehdr
based on CONFIG_MIPS64 instead of CONFIG_BUILD_ELF64.

elf_check_arch() also needs some fixing in include/asm-mips/elf.h as
it too is invoked from load_module(), however elf_check_arch() is also
used in binfmt_elf*.c.

Simply changing the defines produces loads of warnings due to casting
pointers around in module.c. Any suggestions on the best way to fix
this?

-- 
Dave Johnson
Starent Networks


From ths@networkno.de Wed Aug  3 21:18:43 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 03 Aug 2005 21:19:01 +0100 (BST)
Received: from mx02.qsc.de ([IPv6:::ffff:213.148.130.14]:49827 "EHLO
	mx02.qsc.de") by linux-mips.org with ESMTP id <S8225548AbVHCUSn>;
	Wed, 3 Aug 2005 21:18:43 +0100
Received: from port-195-158-168-34.dynamic.qsc.de ([195.158.168.34] helo=hattusa.textio)
	by mx02.qsc.de with esmtp (Exim 3.35 #1)
	id 1E0PkQ-00036d-00; Wed, 03 Aug 2005 22:21:54 +0200
Received: from ths by hattusa.textio with local (Exim 4.52)
	id 1E0PkQ-0007vk-LJ; Wed, 03 Aug 2005 22:21:54 +0200
Date:	Wed, 3 Aug 2005 22:21:54 +0200
To:	Dave Johnson <djohnson+linuxmips@sw.starentnetworks.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: modules fail to load for 64bit kernel with 32bit ELF format
Message-ID: <20050803202154.GS29782@hattusa.textio>
References: <17137.2596.203177.705324@cortez.sw.starentnetworks.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <17137.2596.203177.705324@cortez.sw.starentnetworks.com>
User-Agent: Mutt/1.5.9i
From:	Thiemo Seufer <ths@networkno.de>
Return-Path: <ths@networkno.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8689
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ths@networkno.de
Precedence: bulk
X-list: linux-mips
Content-Length: 838
Lines: 25

Dave Johnson wrote:
> 
> Building for 64bit kernel with 32bit ELF format produces the correct
> object files for loading, but attempting to load them produces
> ENOEXEC.
> 
> This is because the object file is failing ELF header checks in
> load_module().
> 
> Elf_Ehdr in include/asm-mips/module.h is being defined as Elf64_Ehdr
> based on CONFIG_MIPS64 instead of CONFIG_BUILD_ELF64.
> 
> elf_check_arch() also needs some fixing in include/asm-mips/elf.h as
> it too is invoked from load_module(), however elf_check_arch() is also
> used in binfmt_elf*.c.
> 
> Simply changing the defines produces loads of warnings due to casting
> pointers around in module.c. Any suggestions on the best way to fix
> this?

The plan is to obsolete 64bit kernel in 32bit ELF and use 64bit ELF
with gcc -msym32 to get a similiar optimization.


Thiemo

From singh.inpreet@netsity.com Thu Aug  4 07:28:13 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 04 Aug 2005 07:28:29 +0100 (BST)
Received: from smtp.netsity.com ([IPv6:::ffff:61.246.47.138]:9228 "EHLO
	mail.netsity.com") by linux-mips.org with ESMTP id <S8225576AbVHDG2N>;
	Thu, 4 Aug 2005 07:28:13 +0100
Received: from INPREET ([192.168.103.60]) by mail.netsity.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13)
	id P9F564GY; Thu, 4 Aug 2005 12:01:40 +0530
Message-ID: <011b01c598be$2c373170$3c67a8c0@netsity.com>
From:	"inpreet" <singh.inpreet@netsity.com>
To:	<linux-mips@linux-mips.org>
Subject: Ramdisk image at boot time
Date:	Thu, 4 Aug 2005 12:01:40 +0530
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="----=_NextPart_000_0117_01C598EC.45D2E4C0"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4927.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200
Return-Path: <singh.inpreet@netsity.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8690
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: singh.inpreet@netsity.com
Precedence: bulk
X-list: linux-mips
Content-Length: 25477
Lines: 755

This is a multi-part message in MIME format.

------=_NextPart_000_0117_01C598EC.45D2E4C0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_001_0118_01C598EC.45D2E4C0"


------=_NextPart_001_0118_01C598EC.45D2E4C0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello,

I got your id from forum site and I know you are the one who can guide =
me thru this problem. I hope that you won't mind doing that.
I am tring to unable bootsplash image at boot time on embedded device =
which runs on MIPS processor and use YAMON as bootloader. I am attaching =
a build script which detects initrd.tar.gz and embedded it to ramdisk. =
But now when I am booting kernel ramdisk is unable to detect initrd =
image. I am saving initrd.splash, which is bootup image in /boot =
directory and making its initrd.tar.gz. While booting I am giving kernel =
parameters
kernel : go be000000 root=3D/dev/ram0 rw init=3D/linuxrc console=3Dtty1 =
video=3Dau1100fb:panel:640x480_crt initrd=3D/boot/initrd.splash
I also save this initrd.tar.gz as ramdisk.gz at arch/mips/ramdisk/ =
directory.
What step I am missing to let kernel detect splash image at boot time?

Regards
Inpreet Singh

------=_NextPart_001_0118_01C598EC.45D2E4C0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3700.6699" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>
<DIV><FONT face=3DVerdana size=3D2>Hello,</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>I got your id from forum site and I =
know you are=20
the one who can guide me thru this problem. I hope that you won't mind =
doing=20
that.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>I am tring to unable bootsplash image =
at boot=20
time on embedded device which runs on MIPS processor and use YAMON as=20
bootloader. I am attaching a build script which detects initrd.tar.gz =
and=20
embedded it to ramdisk. But now when I am booting kernel ramdisk is =
unable to=20
detect initrd image. I am saving initrd.splash, which is bootup image in =
/boot=20
directory and making its initrd.tar.gz. While booting I am giving kernel =

parameters</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2><STRONG>kernel : </STRONG>go be000000 =

root=3D/dev/ram0 rw init=3D/linuxrc console=3Dtty1 =
video=3Dau1100fb:panel:640x480_crt=20
initrd=3D/boot/initrd.splash</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>I also save this initrd.tar.gz as =
ramdisk.gz at=20
arch/mips/ramdisk/ directory.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>What step I am missing to let kernel =
detect=20
splash image at boot time?</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Regards<BR>Inpreet=20
Singh</FONT></DIV></DIV></BODY></HTML>

------=_NextPart_001_0118_01C598EC.45D2E4C0--

------=_NextPart_000_0117_01C598EC.45D2E4C0
Content-Type: application/octet-stream;
	name="build.sh"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="build.sh"

#!/bin/sh=0A=
=0A=
# ###################################################################=0A=
#=0A=
# build.sh=0A=
#=0A=
# Script to build the Linux Launchpad for Aurora AA1100 development=0A=
# board.=0A=
#=0A=
# *** THIS SCRIPT MUST BE RUN FROM ITS INSTALLED LOCATION	***=0A=
#=0A=
# It creates 2 environments under the 'images' directory in sub-=0A=
# directories 'nfs-mount' and 'flash-mount'.  The first is for=0A=
# development purposes and is intended for its kernel to be downloaded=0A=
# from the host machine and also for the root filesystem to be mounted=0A=
# remotely via nfs from the remote machine.=0A=
#=0A=
# The second environment is intended to be loaded onto the target=0A=
# hardware as a final customer image.  The kernel should be downloaded=0A=
# once to the on-board flash and the 'start' variable in YAMON set to=0A=
# boot from flash. The filesystem is intended to be loaded onto the=0A=
# PCMCIA CF card and includes a script to check if any particular boot=0A=
# is the first and if networking has been enabled etc.=0A=
#=0A=
# This script can create both environments or either one independently.=0A=
# It accepts options of ALL [-a], NFS [-n] or FLASH [-f]. ALL is default.=0A=
# ./build.sh -h for usage instructions.=0A=
#=0A=
# ###################################################################=0A=
=0A=
PASSWD_FILE=3D/tmp/$$=0A=
=0A=
CWD=3D`pwd`=0A=
CURR_PATH=3D`echo $PATH`=0A=
=0A=
NFS_IMAGE_DIR=3D${CWD}/images/nfs-mount=0A=
NFS_FS=3D${NFS_IMAGE_DIR}/filesystem=0A=
=0A=
FLASH_IMAGE_DIR=3D${CWD}/images/flash-mount=0A=
FLASH_FS=3D${FLASH_IMAGE_DIR}/filesystem=0A=
FLASH_FS_IMG=3D${FLASH_IMAGE_DIR}/rootfs.img=0A=
=0A=
INITRD_FS=3D${FLASH_IMAGE_DIR}/initrdfs=0A=
INITRD_IMG=3D/tmp/initrd=0A=
TMP_MNT=3D/tmp/mnt=0A=
=0A=
PREBUILT_BINARIES=3D$CWD/prebuilt-binaries=0A=
CONFIG=3D${CWD}/config-files=0A=
LINUX=3D${CWD}/linux-2.4.21=0A=
BUSYBOX=3D${CWD}/busybox/busybox-1.00-pre4=0A=
=0A=
trap 'cleanup' 0 1 9 15=0A=
=0A=
# ###################################################################=0A=
# cleanup	Unmounts & deletes temporary files / directories=0A=
# ###################################################################=0A=
function cleanup () {=0A=
	MOUNT=3D`mount | grep ${TMP_MNT}`=0A=
	if [ "$MOUNT" !=3D "" ];	then=0A=
		sudo -S umount ${TMP_MNT} < ${PASSWD_FILE};=0A=
	fi=0A=
	rm -rf ${PASSWD_FILE} ${INITRD_IMG}.gz ${INITRD_IMG}=0A=
	if [ -d ${TMP_MNT} ]; then=0A=
		rmdir ${TMP_MNT}=0A=
	fi=0A=
}=0A=
=0A=
# ###################################################################=0A=
# usage		Prints usage information=0A=
# ###################################################################=0A=
function usage () {=0A=
	echo=0A=
	echo=0A=
	echo "This script automates the build of the Linux Launchpad software"=0A=
	echo "It will output two environments to the directories:"=0A=
	echo "${NFS_IMAGE_DIR}"=0A=
	echo "and"=0A=
	echo "${FLASH_IMAGE_DIR}."=0A=
	echo "The first directory will contain an environment suitable for =
development"=0A=
	echo "purposes where the kernel is downloaded to the onboard RAM via =
tftp and the"=0A=
	echo "filesystem can be mounted remotely using nfs."=0A=
	echo=0A=
	echo "The second directory will contain an environment suitable for =
storing"=0A=
	echo "on the target board PCMCIA CF card. The kernel will be configured"=0A=
	echo "for storing on the on-board flash (remember to erase it via YAMON"=0A=
	echo "before downloading the kernel).  This environment will also =
contain a file"=0A=
	echo "called rootfs.img.  This is a 30 MB root file system image that =
can be"=0A=
	echo "written directly to the PCMCIA CF."=0A=
	echo=0A=
	echo "Usage: build.sh 	[-a] Build both environments [DEFAULT]"=0A=
	echo "			[-n] Build the NFS environment only"=0A=
	echo "			[-f] Build the FLASH environment only"=0A=
	echo=0A=
	exit 0=0A=
}=0A=
=0A=
# ###################################################################=0A=
# get_passwd		Retrieves the user's password=0A=
# PARAMS		NONE=0A=
# ###################################################################=0A=
function get_passwd () {=0A=
	echo=0A=
	echo "Some parts of this build script need root privileges to install =
correct permissions."=0A=
	echo "The script uses the sudo command at the appropriate points in the =
installation."=0A=
	echo "In order for sudo to operate correctly you must enter your user =
password at the prompt."=0A=
	echo "You also need to ensure that sudo 'knows' about your user name by =
having a valid"=0A=
	echo "entry in your 'sudoers' file."=0A=
	echo "For a brief howto see sudo-howto.txt in the doc directory, or see =
'man visudo' for"=0A=
	echo "further details."=0A=
	echo=0A=
	echo -n "Please enter your password or <CR> to exit: "=0A=
	read -s PASS=0A=
	echo=0A=
=0A=
	if [ "$PASS" =3D "" ]; then=0A=
	        echo Script exiting=0A=
	        exit 1=0A=
	fi=0A=
=0A=
	echo $PASS > $PASSWD_FILE=0A=
	chmod 600 $PASSWD_FILE=0A=
}=0A=
=0A=
# ###################################################################=0A=
# build_kernel	Builds the kernel!=0A=
# PARAMS	$1 The location of a .config file=0A=
#		$2 String specifying the type of kernel [NFS | FLASH]=0A=
# ###################################################################=0A=
function build_kernel () {=0A=
=0A=
	if [ "$2" =3D "NFS" ]; then=0A=
		IMG=3DzImage=0A=
	else=0A=
		IMG=3DzImage.flash=0A=
	fi=0A=
=0A=
	cd ${LINUX}=0A=
	make mrproper=0A=
	cp $1 .config=0A=
	if ! make oldconfig=0A=
	then=0A=
		echo "Error configuring $2 kernel"=0A=
		exit 1=0A=
	fi=0A=
	if ! make dep=0A=
	then=0A=
		echo "Error creating dependancies for $2 kernel"=0A=
		exit 1=0A=
	fi=0A=
	if ! make $IMG=0A=
	then=0A=
		echo "Error compiling $2 kernel"=0A=
		exit 1=0A=
	fi=0A=
=0A=
	if ! make modules=0A=
	then=0A=
		echo "Error making $2 kernel modules"=0A=
		exit 1=0A=
	fi=0A=
=0A=
	cd ${CWD}=0A=
}=0A=
=0A=
# ###################################################################=0A=
# make_modules	Use this to create kernel modules without building the=0A=
#		entire kernel.=0A=
# PARAMS	$1 The location of a kernel .config file=0A=
# ###################################################################=0A=
function make_modules () {=0A=
	cd ${LINUX}=0A=
	make mrproper=0A=
	cp $1 .config=0A=
	if ! make oldconfig=0A=
	then=0A=
		echo "Error configuring $2 kernel modules"=0A=
		exit 1=0A=
	fi=0A=
	if ! make modules=0A=
	then=0A=
		echo "Error making $2 kernel modules"=0A=
		exit 1=0A=
	fi=0A=
	cd ${CWD}=0A=
}=0A=
=0A=
# ###################################################################=0A=
# install_modules	Installs kernel modules to the specified dir=0A=
# PARAMS		$1 The root install directory=0A=
# ###################################################################=0A=
function install_modules () {=0A=
	INSTALL_PATH=3D$1=0A=
=0A=
	export INSTALL_MOD_PATH=3D${INSTALL_PATH}=0A=
	cd ${LINUX}=0A=
	if ! sudo -S make modules_install < ${PASSWD_FILE}=0A=
	then=0A=
		echo "Error installing the kernel modules to ${INSTALL_PATH}"=0A=
		exit 1=0A=
	fi=0A=
	cd ${CWD}=0A=
}=0A=
=0A=
# ###################################################################=0A=
# create_devices	Creates the required device nodes for a root=0A=
#			filesystem.=0A=
# PARAMS		$1 The root of the filesystem=0A=
# ###################################################################=0A=
function create_devices () {=0A=
	DST=3D$1=0A=
=0A=
	sudo -S mknod ${DST}/dev/mem     c 1  1 < ${PASSWD_FILE}=0A=
	sudo -S mknod ${DST}/dev/kmem    c 1  2 < ${PASSWD_FILE}=0A=
	sudo -S mknod -m 666 ${DST}/dev/null    c 1  3 < ${PASSWD_FILE}=0A=
	sudo -S mknod ${DST}/dev/port    c 1  4 < ${PASSWD_FILE}=0A=
	sudo -S mknod ${DST}/dev/zero    c 1  5 < ${PASSWD_FILE}=0A=
	sudo -S mknod ${DST}/dev/full    c 1  7 < ${PASSWD_FILE}=0A=
	sudo -S mknod ${DST}/dev/random  c 1  8 < ${PASSWD_FILE}=0A=
	sudo -S mknod ${DST}/dev/urandom c 1  9 < ${PASSWD_FILE}=0A=
	sudo -S mknod ${DST}/dev/aio     c 1  10 < ${PASSWD_FILE}=0A=
=0A=
	sudo -S mknod ${DST}/dev/ram0    b 1  0 < ${PASSWD_FILE}=0A=
	sudo -S mknod ${DST}/dev/ram1    b 1  1 < ${PASSWD_FILE}=0A=
=0A=
	sudo -S mknod ${DST}/dev/tty0    c 4  0 < ${PASSWD_FILE}=0A=
	sudo -S mknod ${DST}/dev/tty1    c 4  1 < ${PASSWD_FILE}=0A=
	sudo -S mknod ${DST}/dev/tty2    c 4  2 < ${PASSWD_FILE}=0A=
	sudo -S mknod ${DST}/dev/tty3    c 4  3 < ${PASSWD_FILE}=0A=
=0A=
	sudo -S mknod ${DST}/dev/tty     c 5  0 < ${PASSWD_FILE}=0A=
	sudo -S mknod ${DST}/dev/console c 5  1 < ${PASSWD_FILE}=0A=
=0A=
	sudo -S mknod ${DST}/dev/ptmx    c 5  2 < ${PASSWD_FILE}=0A=
	sudo -S mkdir ${DST}/dev/pts < ${PASSWD_FILE}=0A=
=0A=
	sudo -S mknod ${DST}/dev/ttyS0   c 4 64 < ${PASSWD_FILE}=0A=
	sudo -S mknod ${DST}/dev/ttyS1   c 4 65 < ${PASSWD_FILE}=0A=
	sudo -S mknod ${DST}/dev/ttyS2   c 4 66 < ${PASSWD_FILE}=0A=
=0A=
	# Frame Buffer device=0A=
	sudo -S mknod ${DST}/dev/fb0 c 29 0 < ${PASSWD_FILE}=0A=
=0A=
	# A - D device nodes=0A=
	for i in 0 1 2 3=0A=
	do=0A=
		sudo -S mknod ${DST}/dev/ad$i c 60 $i < ${PASSWD_FILE}=0A=
	done=0A=
=0A=
	# IDE hda=0A=
	sudo -S mknod -m 640 ${DST}/dev/hda b 3 0 < ${PASSWD_FILE}=0A=
	for i in 1 2 3=0A=
	do=0A=
		sudo -S mknod ${DST}/dev/hda$i b 3 $i < ${PASSWD_FILE}=0A=
	done=0A=
}=0A=
=0A=
# ###################################################################=0A=
# build_busybox		Builds and installs busybox=0A=
# PARAMS		$1 Location of a busybox .config file=0A=
# 			$2 The install directory=0A=
#			$3 String specifying the type of build [NFS | FLASH]=0A=
# ###################################################################=0A=
function build_busybox () {=0A=
=0A=
	export PATH=3D/opt/toolchains/uclibc-crosstools-1.0.0/bin:$PATH=0A=
	cd ${BUSYBOX}=0A=
	make distclean=0A=
	cp $1 .config=0A=
	if ! make oldconfig=0A=
	then=0A=
		echo "Error configuring $3 BUSYBOX"=0A=
		exit 1=0A=
	fi=0A=
=0A=
	if ! make=0A=
	then=0A=
		echo "Error building $3 BUSYBOX"=0A=
		exit 1=0A=
	fi=0A=
=0A=
	if ! make install=0A=
	then=0A=
		echo "Error installing $3 BUSYBOX"=0A=
		exit 1=0A=
	fi=0A=
	sudo -S cp -Rd _install/* $2 < ${PASSWD_FILE}=0A=
	sudo -S chmod u+s ${2}/bin/busybox < ${PASSWD_FILE}=0A=
=0A=
	export PATH=3D${CURR_PATH}=0A=
	cd ${CWD}=0A=
}=0A=
=0A=
# ###################################################################=0A=
# create_root_filesystem	Create a root filesystem=0A=
# PARAMS			$1 Where to create the filesystem=0A=
# ###################################################################=0A=
function create_root_filesystem () {=0A=
	DST=3D$1=0A=
=0A=
	mkdir -p ${DST}=0A=
=0A=
	# Create some required empty directories=0A=
	(cd ${DST}; sudo -S tar xzvpf $PREBUILT_BINARIES/skeleton.tar.gz < =
$PASSWD_FILE)=0A=
=0A=
	# Create the root etc directory=0A=
	(cd ${DST}; sudo -S tar xzvpf $PREBUILT_BINARIES/etc-root.tar.gz < =
$PASSWD_FILE)=0A=
=0A=
	#Create the http daemon root directory=0A=
	(cd ${DST}; sudo -S tar xzvpf $PREBUILT_BINARIES/www.tar.gz < =
$PASSWD_FILE)=0A=
=0A=
	# Create the /lib symlink & libraries=0A=
	(cd ${DST}; sudo -S tar xzvpf $PREBUILT_BINARIES/lib.tar.gz < =
$PASSWD_FILE)=0A=
=0A=
	# Copy the pcmcia card services binaries=0A=
	(cd ${DST}; sudo -S tar xzvpf $PREBUILT_BINARIES/pcmcia.tar.gz < =
$PASSWD_FILE)=0A=
=0A=
	# Copy the gdbserver binary=0A=
	(cd ${DST}; sudo -S tar xzvpf $PREBUILT_BINARIES/gdb.tar.gz < =
$PASSWD_FILE)=0A=
=0A=
	# Copy the ftpd binary=0A=
	(cd ${DST}; sudo -S tar xzvpf $PREBUILT_BINARIES/ftpd.tar.gz < =
$PASSWD_FILE)=0A=
=0A=
	# Create some device nodes=0A=
	create_devices ${DST}=0A=
=0A=
}=0A=
=0A=
# ###################################################################=0A=
# create_initrd_filesystem	Creates a trim filesystem for the ramdisk=0A=
# PARAMS			NONE=0A=
# ###################################################################=0A=
function create_initrd_filesystem () {=0A=
=0A=
	mkdir -p ${INITRD_FS}=0A=
=0A=
	# Create some required empty directories=0A=
	(cd ${INITRD_FS}; sudo -S tar xzvpf $PREBUILT_BINARIES/skeleton.tar.gz =
< $PASSWD_FILE)=0A=
=0A=
	# We need to have compiled the kernel modules first to install them into=0A=
	# the initrd image, which is then compiled into the kernel ...=0A=
	make_modules ${CONFIG}/kernel.config.initrd FLASH=0A=
	install_modules ${INITRD_FS}=0A=
=0A=
	# Copy the pcmcia card services binaries=0A=
	(cd ${INITRD_FS}; sudo -S tar xzvpf $PREBUILT_BINARIES/pcmcia.tar.gz < =
$PASSWD_FILE)=0A=
=0A=
	# Copy the initrd specific files=0A=
	(cd ${INITRD_FS}; sudo -S tar xzvpf $PREBUILT_BINARIES/initrd.tar.gz < =
$PASSWD_FILE)=0A=
=0A=
	# Create required device nodes=0A=
	sudo -S mknod ${INITRD_FS}/dev/console c 5 1 < $PASSWD_FILE=0A=
	sudo -S mknod ${INITRD_FS}/dev/hda b 3 0 < $PASSWD_FILE=0A=
	for index in 1 2=0A=
	do=0A=
		sudo -S mknod ${INITRD_FS}/dev/hda$index b 3 $index < $PASSWD_FILE=0A=
	done=0A=
}=0A=
=0A=
# ###################################################################=0A=
# create_initrd_img	Creates an image of the ramdisk filesystem=0A=
# 			The image is stored in /tmp/${INITRD_IMG}.gz=0A=
#			It must be built before the FLASH kernel as=0A=
#			the kernel build will expect it to be there.=0A=
# PARAMS		NONE=0A=
# ###################################################################=0A=
function create_initrd_img () {=0A=
=0A=
	if [ ! -d ${INITRD_FS} ]; then=0A=
		echo "No initrd filesystem [directory filesystem]"=0A=
		return=0A=
	fi=0A=
=0A=
	sudo -S rm -f ${INITRD_IMG}.gz ${INITRD_IMG} < ${PASSWD_FILE}=0A=
	dd if=3D/dev/zero of=3D${INITRD_IMG} bs=3D1k count=3D4096=0A=
	/sbin/mke2fs -F -m0 -b 1024 ${INITRD_IMG}=0A=
	/sbin/tune2fs -c 0 -i 0 ${INITRD_IMG}=0A=
=0A=
	mkdir -p ${TMP_MNT}=0A=
	sudo -S mount -t ext2 ${INITRD_IMG} ${TMP_MNT} -o loop < ${PASSWD_FILE}=0A=
	(cd ${INITRD_FS}; sudo -S sh -c "find . -print | cpio -p ${TMP_MNT}/" < =
${PASSWD_FILE})=0A=
=0A=
	sudo -S umount ${TMP_MNT} < ${PASSWD_FILE}=0A=
	gzip -v9 ${INITRD_IMG}=0A=
}=0A=
=0A=
# ###################################################################=0A=
# create_rootfs_img	Creates an image of the root FLASH filesystem=0A=
#			30MB in size. The image can then be written=0A=
#			directly to the PCMCIA CF card.=0A=
# PARAMS		NONE=0A=
# ###################################################################=0A=
function create_rootfs_img () {=0A=
	# Create and format a new image=0A=
	rm -f ${FLASH_FS_IMG}=0A=
	touch ${FLASH_FS_IMG}=0A=
	dd if=3D/dev/zero of=3D${FLASH_FS_IMG} bs=3D1k count=3D30720=0A=
	/sbin/mke2fs -F ${FLASH_FS_IMG}=0A=
	/sbin/tune2fs -c 0 -i 0 ${FLASH_FS_IMG}=0A=
=0A=
	# Ensure the temp mount point is available=0A=
	mkdir -p ${TMP_MNT}=0A=
=0A=
	sudo -S mount -t ext2 ${FLASH_FS_IMG} ${TMP_MNT} -o loop < =
${PASSWD_FILE}=0A=
	(cd ${FLASH_FS}; sudo -S sh -c "find . -print | cpio -p ${TMP_MNT}/" < =
${PASSWD_FILE})=0A=
=0A=
	sudo -S umount ${TMP_MNT} < ${PASSWD_FILE}=0A=
}=0A=
=0A=
# ###################################################################=0A=
# create_nfs_readme	Creates an explanatory README file in the NFS=0A=
#			image directory=0A=
# ###################################################################=0A=
function create_nfs_readme () {=0A=
	cat > ${NFS_IMAGE_DIR}/README <<-EOF=0A=
=0A=
		This file descibes the contents of the nfs image directory.=0A=
		=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
=0A=
		This environment enables the kernel to be downloaded & booted via tftp =
on=0A=
		each re-boot and to mount the filesystem remotely via nfs and is =
provided=0A=
		mainly as an aid to development.=0A=
=0A=
		aa1100.srec -=0A=
		An srec version of the kernel, suitable for loading into the target =
board=0A=
		memory using YAMON.=0A=
		I.E. at the YAMON prompt:=0A=
		setenv bootfile aa1100.srec=0A=
		load -r=0A=
=0A=
		./filesystem -=0A=
		The root filesystem to be mounted via nfs.  This should be copied to =
the=0A=
		nfs export directory on the host machine (i.e. /exports/rootimg).=0A=
=0A=
		A sample bootstring for YAMON to run this kernel:=0A=
		go . root=3D/dev/nfs rw nfsroot=3D192.150.92.119:/exports/rootimg \\=0A=
		ip=3D192.150.92.239:::255.255.255.0:guest19::off =
console=3DttyS0,115200 \\=0A=
		video=3Dau1100fb:panel:640x480_CRT=0A=
=0A=
		See bootstring.txt for more examples.=0A=
=0A=
	EOF=0A=
}=0A=
=0A=
# ###################################################################=0A=
# create_flash_readme	Creates an explanatory README in the flash=0A=
#			image directory=0A=
# ###################################################################=0A=
function create_flash_readme () {=0A=
	cat > ${FLASH_IMAGE_DIR}/README <<-EOF=0A=
=0A=
		This file descibes the contents of the flash image directory.=0A=
		=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
=0A=
		This environment is suitable for loading onto customers' boards.=0A=
=0A=
		aa1100.flash.srec -=0A=
		An srec version of the kernel, suitable for loading into the on-board =
flash=0A=
		memory (not PCMCIA CF) using YAMON.=0A=
		I.E. At the YAMON prompt:=0A=
		Erase 6MB at the start of the operating system partition:=0A=
		erase 1e000000 600000=0A=
=0A=
		Download the kernel image to the on-board flash:=0A=
		setenv bootfile aa1100.flash.srec=0A=
		load -r=0A=
=0A=
		./filesystem -=0A=
		The root filesystem to be copied to the PCMCIA CF card.=0A=
		This can be achieved in two ways either by using the filesystem image=0A=
		(see rootfs.img below) or by using a CF reader.  When using a CF reader=0A=
		on your host machine execute the following commands as root to create a=0A=
		filesystem on the CF card and copy the contents of ./filesystem to it:=0A=
=0A=
		(Assuming your CF reader is at /dev/sd1)=0A=
		mke2fs /dev/sd1=0A=
		cd ./filesystem=0A=
		mount -t ext2 /dev/sd1 /mnt/usb=0A=
		find . -print | cpio -p /mnt/usb=0A=
		umount /mnt/usb=0A=
=0A=
		./initrdfs -=0A=
		The initrd filesystem. This is provided only for reference as a =
compressed=0A=
		image of this filesystem is built into the kernel image.=0A=
=0A=
		rootfs.img -=0A=
		An image of the root filesystem in sub-directory 'filesystem'.=0A=
		This image can be written directly to the PCMCIA CF either from the =
host=0A=
		system (eg. via a USB CF reader) or from the target board itself (eg. =
running=0A=
		an nfs mounted filesystem):=0A=
		From the host -		dd if=3Drootfs.img of=3D/dev/sda1 bs=3D1k=0A=
		From the target -	dd if=3Drootfs.img of=3D/dev/hda1 bs=3D1k=0A=
		** Make sure you get the output device correct or you run the risk of =
destroying=0A=
		** your current installation of Linux.=0A=
=0A=
		To run this kernel version directly from the on-board flash the 'start'=0A=
		variable in YAMON must be set to a suitable bootstring.=0A=
		I.E. At the YAMON prompt:=0A=
		Set the environment variable=0A=
		setenv start "go be000000 root=3D/dev/ram0 init=3D/linuxrc rw \\=0A=
		console=3Dtty \\=0A=
		video=3Dau1100fb:panel:640x480_CRT"=0A=
=0A=
		See bootstring.txt for more examples.=0A=
=0A=
	EOF=0A=
}=0A=
=0A=
=0A=
#########################################################################=
########=0A=
#										#=0A=
#			MAIN SCRIPT STARTS HERE					#=0A=
#										#=0A=
#########################################################################=
########=0A=
=0A=
# Default option is ALL=0A=
OPT=3D"ALL"=0A=
=0A=
while getopts ":afnh" opt; do=0A=
	case $opt in=0A=
		a ) OPT=3D"ALL" ;;=0A=
		f ) OPT=3D"FLASH" ;;=0A=
		n ) OPT=3D"NFS" ;;=0A=
		h ) usage ;;=0A=
		\?) echo "Unknown option: -h for usage"; exit 1 ;;=0A=
	esac=0A=
done=0A=
=0A=
# Get the user's password=0A=
#=0A=
get_passwd=0A=
=0A=
# ############=0A=
# NFS image=0A=
# ############=0A=
=0A=
if [ "$OPT" =3D "ALL" ] || [ "$OPT" =3D "NFS" ]; then=0A=
=0A=
	sudo -S rm -rf ${NFS_IMAGE_DIR} < ${PASSWD_FILE}=0A=
	mkdir -p ${NFS_IMAGE_DIR}=0A=
=0A=
	# Create the kernel suitable for nfs download=0A=
	#=0A=
	build_kernel ${CONFIG}/kernel.config.nfs NFS=0A=
	cp ${LINUX}/arch/mips/zboot/images/aa1100.srec ${NFS_IMAGE_DIR}/=0A=
=0A=
	# Creating the NFS file system=0A=
	#=0A=
	create_root_filesystem ${NFS_FS}=0A=
=0A=
	# Install the kernel modules=0A=
	install_modules ${NFS_FS}=0A=
=0A=
	# Create the /etc nfs specific files.=0A=
	(cd ${NFS_FS}; sudo -S tar xzvpf $PREBUILT_BINARIES/etc-nfsroot.tar.gz =
< $PASSWD_FILE)=0A=
=0A=
	# Build busybox=0A=
	build_busybox ${CONFIG}/busybox.config.root ${NFS_FS} ROOT=0A=
=0A=
	create_nfs_readme=0A=
fi=0A=
=0A=
# ############=0A=
# CF image=0A=
# ############=0A=
=0A=
if [ "$OPT" =3D "ALL" ] || [ "$OPT" =3D "FLASH" ]; then=0A=
=0A=
	sudo -S rm -rf ${FLASH_IMAGE_DIR} < ${PASSWD_FILE}=0A=
	mkdir -p ${FLASH_IMAGE_DIR}=0A=
=0A=
	# Create the root filesystem for the pcmcia CF card.=0A=
	#=0A=
	create_root_filesystem ${FLASH_FS}=0A=
=0A=
	if [ "$OPT" =3D "ALL" ]; then=0A=
		# The busybox install is identical for the nfs root and the compact =
flash root=0A=
		# filesystems so we do not have to build it again just install it =
elsewhere=0A=
		sudo -S cp -Rd ${BUSYBOX}/_install/* ${FLASH_FS} < ${PASSWD_FILE}=0A=
		sudo -S chmod u+s ${FLASH_FS}/bin/busybox < ${PASSWD_FILE}=0A=
	else=0A=
		# Build busybox=0A=
		build_busybox ${CONFIG}/busybox.config.root ${FLASH_FS} FLASH_ROOT=0A=
	fi=0A=
=0A=
	# Create the /etc flash root specific files=0A=
	(cd ${FLASH_FS}; sudo -S tar xzvf =
$PREBUILT_BINARIES/etc-flashroot.tar.gz < $PASSWD_FILE)=0A=
=0A=
	# Create the ramdisk filesystem=0A=
	create_initrd_filesystem=0A=
=0A=
	# Build the trimmed busybox initrd version=0A=
	build_busybox ${CONFIG}/busybox.config.initrd ${INITRD_FS} INITRD=0A=
=0A=
	# Create the ramdisk image=0A=
	create_initrd_img=0A=
=0A=
	# Create the kernel containing a ram disk image=0A=
	#=0A=
	build_kernel ${CONFIG}/kernel.config.initrd FLASH=0A=
	cp ${LINUX}/arch/mips/zboot/images/aa1100.flash.srec ${FLASH_IMAGE_DIR}/=0A=
=0A=
	# Install the modules to the root filesystem=0A=
	install_modules ${FLASH_FS}=0A=
=0A=
	# Create an image of the root filesystem suitable for 'dd'ing onto the =
CF card=0A=
	create_rootfs_img=0A=
=0A=
	create_flash_readme=0A=
fi=0A=
=0A=
echo=0A=
echo "Linux Launchpad for Aurora AA1100 build complete."=0A=
echo=0A=
=0A=
=0A=
=0A=
=0A=

------=_NextPart_000_0117_01C598EC.45D2E4C0--


From colin@realtek.com.tw Thu Aug  4 11:49:15 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 04 Aug 2005 11:49:34 +0100 (BST)
Received: from mf2.realtek.com.tw ([IPv6:::ffff:220.128.56.22]:28941 "EHLO
	mf2.realtek.com.tw") by linux-mips.org with ESMTP
	id <S8225624AbVHDKtP>; Thu, 4 Aug 2005 11:49:15 +0100
Received: from msx.realtek.com.tw (unverified [172.21.1.77]) by mf2.realtek.com.tw
 (Clearswift SMTPRS 5.1.4) with ESMTP id <T728ee9041fdc80381613d4@mf2.realtek.com.tw> for <linux-mips@linux-mips.org>;
 Thu, 4 Aug 2005 17:18:27 +0800
Received: from rtpdii3098 ([172.21.98.16])
          by msx.realtek.com.tw (Lotus Domino Release 6.5.3)
          with ESMTP id 2005080417162317-215319 ;
          Thu, 4 Aug 2005 17:16:23 +0800 
Message-ID: <009b01c598d5$2ede3e20$106215ac@realtek.com.tw>
From:	"colin" <colin@realtek.com.tw>
To:	<linux-mips@linux-mips.org>
Subject: Compiling uClibc with MIPS SDE6
Date:	Thu, 4 Aug 2005 17:16:23 +0800
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
X-MIMETrack: Itemize by SMTP Server on msx/Realtek(Release 6.5.3|September 14, 2004) at
 2005/08/04 =?Bog5?B?pFWkyCAwNToxNjoyMw==?=,
	Serialize by Router on msx/Realtek(Release 6.5.3|September 14, 2004) at
 2005/08/04 =?Bog5?B?pFWkyCAwNToxNjoyNA==?=,
	Serialize complete at 2005/08/04 =?Bog5?B?pFWkyCAwNToxNjoyNA==?=
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset="big5"
Return-Path: <colin@realtek.com.tw>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8691
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: colin@realtek.com.tw
Precedence: bulk
X-list: linux-mips
Content-Length: 401
Lines: 12


Hi there,
I encounter a problem when compiling uClibc with SDE6. If compiling with
debug information enabled, the output executable file of busybox is about
the same with the one that is compiled with SDE5, but uClibc libraries are
over 10 times the size of the ones that are compiled with SDE5. I am
wondering if it is because GCC 3.4.4 of SDE6 has changed some parameters
setting?

Regards,
Colin


From nigel@mips.com Thu Aug  4 12:09:51 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 04 Aug 2005 12:10:09 +0100 (BST)
Received: from alg145.algor.co.uk ([IPv6:::ffff:62.254.210.145]:60933 "EHLO
	dmz.algor.co.uk") by linux-mips.org with ESMTP id <S8225716AbVHDLJv>;
	Thu, 4 Aug 2005 12:09:51 +0100
Received: from alg158.algor.co.uk ([62.254.210.158] helo=olympia.mips.com)
	by dmz.algor.co.uk with esmtp (Exim 3.35 #1 (Debian))
	id 1E0duu-0005zh-00; Thu, 04 Aug 2005 12:29:40 +0100
Received: from highbury.mips.com ([192.168.192.236])
	by olympia.mips.com with esmtp (Exim 3.36 #1 (Debian))
	id 1E0deE-0000GQ-00; Thu, 04 Aug 2005 12:12:26 +0100
Message-ID: <42F1F81A.6020002@mips.com>
Date:	Thu, 04 Aug 2005 12:12:26 +0100
From:	Nigel Stephens <nigel@mips.com>
Organization: MIPS Technologies
User-Agent: Debian Thunderbird 1.0.2 (X11/20050331)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	colin <colin@realtek.com.tw>
CC:	linux-mips@linux-mips.org
Subject: Re: Compiling uClibc with MIPS SDE6
References: <009b01c598d5$2ede3e20$106215ac@realtek.com.tw>
In-Reply-To: <009b01c598d5$2ede3e20$106215ac@realtek.com.tw>
Content-Type: text/plain; charset=Big5
Content-Transfer-Encoding: 7bit
X-MTUK-Scanner:	Found to be clean
X-MTUK-SpamCheck: not spam (whitelisted), SpamAssassin (score=-3.815,
	required 4, AWL, BAYES_00, XENO_CONTENT)
Return-Path: <nigel@mips.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8692
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: nigel@mips.com
Precedence: bulk
X-list: linux-mips
Content-Length: 944
Lines: 28



colin wrote:

>Hi there,
>I encounter a problem when compiling uClibc with SDE6. If compiling with
>debug information enabled, the output executable file of busybox is about
>the same with the one that is compiled with SDE5, but uClibc libraries are
>over 10 times the size of the ones that are compiled with SDE5. I am
>wondering if it is because GCC 3.4.4 of SDE6 has changed some parameters
>setting?
>
>  
>

SDE 6 uses Dwarf-2 debug data, whereas SDE 5 used Stabs. That may
explain the difference.

Nigel

-- 
                         Nigel Stephens         Mailto:nigel@mips.com
    _    _ ____  ___     MIPS Technologies      Phone.: +44 1223 706200
    |\  /|||___)(___     The Fruit Farm         Direct: +44 1223 706207
    | \/ |||    ____)    Ely Road, Chittering   Fax...: +44 1223 706250
     TECHNOLOGIES UK     Cambridge CB5 9PH      Cell..: +44 7976 686470
                         England                http://www.mips.com


From colin@realtek.com.tw Thu Aug  4 17:10:31 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 04 Aug 2005 17:10:53 +0100 (BST)
Received: from mf2.realtek.com.tw ([IPv6:::ffff:220.128.56.22]:51725 "EHLO
	mf2.realtek.com.tw") by linux-mips.org with ESMTP
	id <S8225727AbVHDQKb>; Thu, 4 Aug 2005 17:10:31 +0100
Received: from msx.realtek.com.tw (unverified [172.21.1.77]) by mf2.realtek.com.tw
 (Clearswift SMTPRS 5.1.4) with ESMTP id <T728f87e055dc80381613d4@mf2.realtek.com.tw>;
 Thu, 4 Aug 2005 20:11:58 +0800
Received: from rtpdii3098 ([172.21.98.16])
          by msx.realtek.com.tw (Lotus Domino Release 6.5.3)
          with ESMTP id 2005080420095332-217928 ;
          Thu, 4 Aug 2005 20:09:53 +0800 
Message-ID: <00b401c598ed$6be49220$106215ac@realtek.com.tw>
From:	"colin" <colin@realtek.com.tw>
To:	"Nigel Stephens" <nigel@mips.com>
Cc:	<linux-mips@linux-mips.org>
References: <009b01c598d5$2ede3e20$106215ac@realtek.com.tw> <42F1F81A.6020002@mips.com>
Subject: Re: Compiling uClibc with MIPS SDE6
Date:	Thu, 4 Aug 2005 20:09:53 +0800
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
X-MIMETrack: Itemize by SMTP Server on msx/Realtek(Release 6.5.3|September 14, 2004) at
 2005/08/04 =?Bog5?B?pFWkyCAwODowOTo1Mw==?=,
	Serialize by Router on msx/Realtek(Release 6.5.3|September 14, 2004) at
 2005/08/04 =?Bog5?B?pFWkyCAwODowOTo1NQ==?=,
	Serialize complete at 2005/08/04 =?Bog5?B?pFWkyCAwODowOTo1NQ==?=
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset="big5"
Return-Path: <colin@realtek.com.tw>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8693
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: colin@realtek.com.tw
Precedence: bulk
X-list: linux-mips
Content-Length: 1563
Lines: 53


Hi Nigel,
I had already noticed this difference.
But why the application with debug information is not so big, whereas the
libraries are?
And the SDE 6 document says that using -gstabs flag can make it compile with
STABS debug format.
I replaced -g3 with -gstabs flag when compiling uClibc, but it cannot
compile successfully.

Regards,
Colin



----- Original Message ----- 
From: "Nigel Stephens" <nigel@mips.com>
To: "colin" <colin@realtek.com.tw>
Cc: <linux-mips@linux-mips.org>
Sent: Thursday, August 04, 2005 7:12 PM
Subject: Re: Compiling uClibc with MIPS SDE6


>
>
> colin wrote:
>
> >Hi there,
> >I encounter a problem when compiling uClibc with SDE6. If compiling with
> >debug information enabled, the output executable file of busybox is about
> >the same with the one that is compiled with SDE5, but uClibc libraries
are
> >over 10 times the size of the ones that are compiled with SDE5. I am
> >wondering if it is because GCC 3.4.4 of SDE6 has changed some parameters
> >setting?
> >
> >
> >
>
> SDE 6 uses Dwarf-2 debug data, whereas SDE 5 used Stabs. That may
> explain the difference.
>
> Nigel
>
> -- 
>                          Nigel Stephens         Mailto:nigel@mips.com
>     _    _ ____  ___     MIPS Technologies      Phone.: +44 1223 706200
>     |\  /|||___)(___     The Fruit Farm         Direct: +44 1223 706207
>     | \/ |||    ____)    Ely Road, Chittering   Fax...: +44 1223 706250
>      TECHNOLOGIES UK     Cambridge CB5 9PH      Cell..: +44 7976 686470
>                          England                http://www.mips.com
>


From singh.inpreet@netsity.com Fri Aug  5 10:54:32 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 05 Aug 2005 10:54:50 +0100 (BST)
Received: from smtp.netsity.com ([IPv6:::ffff:61.246.47.138]:36357 "EHLO
	mail.netsity.com") by linux-mips.org with ESMTP id <S8225507AbVHEJyc>;
	Fri, 5 Aug 2005 10:54:32 +0100
Received: from INPREET ([192.168.103.60]) by mail.netsity.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13)
	id QJTZH2K2; Fri, 5 Aug 2005 15:28:10 +0530
Message-ID: <01a901c599a4$2f855280$3c67a8c0@netsity.com>
From:	"inpreet" <singh.inpreet@netsity.com>
To:	<linux-mips@linux-mips.org>
Subject: Ramdisk issue please help!!!
Date:	Fri, 5 Aug 2005 15:28:10 +0530
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_01A6_01C599D2.493418A0"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4927.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200
Return-Path: <singh.inpreet@netsity.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8694
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: singh.inpreet@netsity.com
Precedence: bulk
X-list: linux-mips
Content-Length: 17091
Lines: 418

This is a multi-part message in MIME format.

------=_NextPart_000_01A6_01C599D2.493418A0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello,

I am trying to build ramdisk image and launch bootsplash image at boot =
time.=20
Steps I followed:
1. get splash image initrd.splash using splash binary.
2. dd if=3D/dev/zero of=3Dinitrd bs=3D1k count=3D4096
        /sbin/mke2fs -F -m0 -b 1024 initrd
        /sbin/tune2fs -c 0 -i 0 initrd
        mount -t ext2 initrd /mnt/user -o loop=20
3. cd /mnt/user
4. mkdir /boot
5. cp /home/user/initrd.splash /boot
6. umount /mnt/user
7. gzip -v9 initrd
8. results in initrd.gz

Now while compiling kernel image I am embedding initrd.gz into it. Here =
is what I am doing
***************System.map**************
=20
802f9000 D _binary__tmp_initrd_gz_start
802f9000 D __rd_start
803d250c D _binary__tmp_initrd_gz_end
803d3000 A __bss_start
803d3000 A _edata
=20
***********RAM DISK MAKE FILE************
=20
O_FORMAT =3D $(shell $(OBJDUMP) -i | head -2 | grep elf32)
img =3D $(CONFIG_EMBEDDED_RAMDISK_IMAGE)
ramdisk.o: $(subst ",,$(img)) ld.script
        echo "O_FORMAT:  " $(O_FORMAT)
        $(LD) -T ld.script -b binary --oformat $(O_FORMAT) -o $@ $(img)

include $(TOPDIR)/Rules.make
=20
***********RAM DISK ld.script file********************
=20
OUTPUT_ARCH(mips)
SECTIONS
{
  .initrd :
  {
       *(.data)
  }
}
**********************************************
I am using YAMON bootloader. While booting I am passing following =
parameters to kernel:
start        (R/W)  go be000000 initrd=3D/boot/initrd.splash rw =
init=3D/linuxrc console=3Dtty1 video=3Dau1100fb:panel:640x480_crt =
splash=3Dsilent

************************dmesg result***************
CPU revision is: 02030204
Primary instruction cache 16kB, physically tagged, 4-way, linesize 32 =
bytes.
Primary data cache 16kB 4-way, linesize 32 bytes.
Linux version 2.4.21 (@node) (gcc version 3.2) #1 Fri Aug 5 13:08:44 IST =
2005
DSP Design Aurora AA1100
Determined physical RAM map:
 memory: 04000000 @ 00000000 (usable)
Initial ramdisk at: 0x802f9000 (892928 bytes)
On node 0 totalpages: 16384
zone(0): 16384 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: initrd=3D/boot/initrd.splash rw init=3D/linuxrc =
console=3Dtty1 video=3Dau1100fb:panel:640x480_crt splash=3Dsilent =
usb_ohci=3Dbase:0x10100000,len:0x100000,irq:26
fb: calling au1100fb setup<6>au110fb: setup called
au1100fb: Panel 0 640x480_CRT
bootsplash: silent mode.
calculating r4koff... 003c6ef5(3960565)
CPU frequency 396.06 MHz
Console: colour dummy device 80x25
Calibrating delay loop... 395.67 BogoMIPS
Memory: 59824k/65536k available (1788k kernel code, 5712k reserved, 988k =
data, 96k init, 0k highmem)
Dentry cache hash table entries: 8192 (order: 4, 65536 bytes)
Inode cache hash table entries: 4096 (order: 3, 32768 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer-cache hash table entries: 4096 (order: 2, 16384 bytes)
Page-cache hash table entries: 16384 (order: 4, 65536 bytes)
Checking for 'wait' instruction...  available.
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Journalled Block Device driver loaded
bootsplash 3.0.9-2003/09/08: looking for picture... no good signature =
found.
Console: switching to colour frame buffer device 80x30
fb0: Au1100 LCD frame buffer device
pty: 256 Unix98 ptys configured
aa1100_ad: registered
aa1100_ad: baudrate =3D 1523307 Hz
Serial driver version 1.01 (2001-02-08) with no serial options enabled
ttyS00 at 0xb1100000 (irq =3D 0) is a 16550
ttyS01 at 0xb1200000 (irq =3D 1) is a 16550
ttyS02 at 0xb1400000 (irq =3D 3) is a 16550
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
au1000eth.c:1.4 ppopov@mvista.com
eth0: Au1x Ethernet found at 0xb0500000, irq 28
eth0: LSI 80227 10/100 BaseT PHY at phy address 0
eth0: Using LSI 80227 10/100 BaseT PHY as default
Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4
ide: Assuming 50MHz system bus speed for PIO modes; override with =
idebus=3Dxx
ide0: ports already in use, skipping probe
ide1: ports already in use, skipping probe
ide2: ports already in use, skipping probe
ide3: ports already in use, skipping probe
ide4: ports already in use, skipping probe
ide5: ports already in use, skipping probe
au1100 flash: probing 32-bit flash bus
 Amd/Fujitsu Extended Query Table v1.3 at 0x0040
number of CFI chips: 1
cfi_cmdset_0002: Disabling fast programming due to code brokenness.
Creating 3 MTD partitions on "AU1100 flash":
0x00000000-0x01c00000 : "Operating System"
0x01c00000-0x01fc0000 : "YAMON"
0x01fc0000-0x02000000 : "Yamon env variables"
usb.c: registered new driver hub
host/usb-ohci.c: USB OHCI at membase 0xb0100000, IRQ 26
host/usb-ohci.c: usb-builtin, non-PCI OHCI
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
usb.c: registered new driver hid
hid-core.c: v1.8.1 Andreas Gal, Vojtech Pavlik <vojtech@suse.cz>
hid-core.c: USB HID support drivers
mice: PS/2 mouse device common for all mice
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 4096 bind 8192)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
RAMDISK: Compressed image found at block 0
Freeing initrd memory: 872k freed
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 96k freed
Algorithmics/MIPS FPU Emulator v1.5
Linux Kernel Card Services 3.1.22
  options:  [pci]

Au1x00 PCMCIA (CS release 3.1.22)
hub.c: new USB device builtin-2, assigned address 2
input0: USB HID v1.10 Keyboard [SEJIN SEJIN USB Mini Keyboard] on =
usb1:2.0
Trying to free nonexistent resource <c0010000-c001000f>
hda: SanDisk SDCFB-32, CFA DISK drive
ide1: ports already in use, skipping probe
ide2: ports already in use, skipping probe
ide3: ports already in use, skipping probe
ide4: ports already in use, skipping probe
ide5: ports already in use, skipping probe
ide0 at 0xc0010000-0xc0010007,0xc001000e on irq 39
hda: attached ide-disk driver.
hda: task_no_data_intr: status=3D0x51 { DriveReady SeekComplete Error }
hda: task_no_data_intr: error=3D0x04 { DriveStatusError }
hda: 62720 sectors (32 MB) w/1KiB Cache, CHS=3D490/4/32
Partition check:
 hda: hda1
ide_cs: hda: Vcc =3D 3.3, Vpp =3D 0.0
 hda: hda1
 hda: hda1
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
eth0: link up
eth0: going to full duplex
*********************************************************
while booting it still complaining that haven't found the initrd.splash =
file. which actually loads splash screen.
=20
=20
Please help where is the problem, Which step I am doing wrong?

------=_NextPart_000_01A6_01C599D2.493418A0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3700.6699" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>
<DIV><FONT face=3DVerdana size=3D2>Hello,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>I am trying to build ramdisk image =
and launch=20
bootsplash image at boot time. </FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>Steps I followed:</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>1. get splash image initrd.splash =
using splash=20
binary.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>2. dd if=3D/dev/zero of=3Dinitrd =
bs=3D1k=20
count=3D4096<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /sbin/mke2fs =
-F -m0 -b=20
1024 initrd</FONT></DIV>
<DIV><FONT face=3DVerdana =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
/sbin/tune2fs -c 0 -i 0 initrd</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
mount -t=20
ext2&nbsp;initrd&nbsp;/mnt/user -o loop </FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>3. cd /mnt/user</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>4. mkdir /boot</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>5. cp /home/user/initrd.splash =
/boot</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>6. umount /mnt/user</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>7. gzip -v9 initrd</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>8. results in initrd.gz</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Now&nbsp;while compiling kernel image =
I am=20
embedding initrd.gz into it. Here is what I am doing</FONT></DIV>
<DIV><FONT face=3DVerdana=20
size=3D2>***************System.map**************</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>802f9000 D=20
_binary__tmp_initrd_gz_start<BR>802f9000 D __rd_start<BR>803d250c D=20
_binary__tmp_initrd_gz_end<BR>803d3000 A __bss_start<BR>803d3000 A=20
_edata</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>***********RAM DISK MAKE=20
FILE************</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>O_FORMAT =3D $(shell $(OBJDUMP) -i | =
head -2 | grep=20
elf32)<BR>img =3D $(CONFIG_EMBEDDED_RAMDISK_IMAGE)<BR>ramdisk.o: $(subst =

",,$(img)) ld.script<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo=20
"O_FORMAT:&nbsp; " =
$(O_FORMAT)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
$(LD) -T ld.script -b binary --oformat $(O_FORMAT) -o $@ =
$(img)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>include =
$(TOPDIR)/Rules.make</FONT></DIV>
<DIV></FONT><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>***********RAM DISK ld.script=20
file********************</FONT></DIV></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana =
size=3D2>OUTPUT_ARCH(mips)<BR>SECTIONS<BR>{<BR>&nbsp;=20
.initrd :<BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
*(.data)<BR>&nbsp;=20
}<BR>}</FONT></DIV>
<DIV><FONT face=3DVerdana=20
size=3D2>**********************************************</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>I am using YAMON =
bootloader.&nbsp;While booting I=20
am passing following parameters to kernel:</FONT></DIV>
<DIV><FONT face=3DVerdana =
size=3D2>start&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
(R/W)&nbsp; go be000000 initrd=3D/boot/initrd.splash rw init=3D/linuxrc =
console=3Dtty1=20
video=3Dau1100fb:panel:640x480_crt splash=3Dsilent<BR></DIV></FONT>
<DIV><FONT face=3DVerdana size=3D2>************************dmesg=20
result***************</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>CPU revision is: 02030204<BR>Primary =
instruction=20
cache 16kB, physically tagged, 4-way, linesize 32 bytes.<BR>Primary data =
cache=20
16kB 4-way, linesize 32 bytes.<BR>Linux version 2.4.21 (@node) (gcc =
version 3.2)=20
#1 Fri Aug 5 13:08:44 IST 2005<BR>DSP Design Aurora AA1100<BR>Determined =

physical RAM map:<BR>&nbsp;memory: 04000000 @ 00000000 =
(usable)<BR>Initial=20
ramdisk at: 0x802f9000 (892928 bytes)<BR>On node 0 totalpages: =
16384<BR>zone(0):=20
16384 pages.<BR>zone(1): 0 pages.<BR>zone(2): 0 pages.<BR>Kernel command =
line:=20
initrd=3D/boot/initrd.splash rw init=3D/linuxrc console=3Dtty1=20
video=3Dau1100fb:panel:640x480_crt splash=3Dsilent=20
usb_ohci=3Dbase:0x10100000,len:0x100000,irq:26<BR>fb: calling au1100fb=20
setup&lt;6&gt;au110fb: setup called<BR>au1100fb: Panel 0=20
640x480_CRT<BR>bootsplash: silent mode.<BR>calculating r4koff...=20
003c6ef5(3960565)<BR>CPU frequency 396.06 MHz<BR>Console: colour dummy =
device=20
80x25<BR>Calibrating delay loop... 395.67 BogoMIPS<BR>Memory: =
59824k/65536k=20
available (1788k kernel code, 5712k reserved, 988k data, 96k init, 0k=20
highmem)<BR>Dentry cache hash table entries: 8192 (order: 4, 65536=20
bytes)<BR>Inode cache hash table entries: 4096 (order: 3, 32768 =
bytes)<BR>Mount=20
cache hash table entries: 512 (order: 0, 4096 bytes)<BR>Buffer-cache =
hash table=20
entries: 4096 (order: 2, 16384 bytes)<BR>Page-cache hash table entries: =
16384=20
(order: 4, 65536 bytes)<BR>Checking for 'wait' instruction...&nbsp;=20
available.<BR>POSIX conformance testing by UNIFIX<BR>Linux NET4.0 for =
Linux=20
2.4<BR>Based upon Swansea University Computer Society =
NET3.039<BR>Initializing=20
RT netlink socket<BR>Starting kswapd<BR>Journalled Block Device driver=20
loaded<BR>bootsplash 3.0.9-2003/09/08: looking for picture... no good =
signature=20
found.<BR>Console: switching to colour frame buffer device 80x30<BR>fb0: =
Au1100=20
LCD frame buffer device<BR>pty: 256 Unix98 ptys configured<BR>aa1100_ad: =

registered<BR>aa1100_ad: baudrate =3D 1523307 Hz<BR>Serial driver =
version 1.01=20
(2001-02-08) with no serial options enabled<BR>ttyS00 at 0xb1100000 (irq =
=3D 0) is=20
a 16550<BR>ttyS01 at 0xb1200000 (irq =3D 1) is a 16550<BR>ttyS02 at =
0xb1400000=20
(irq =3D 3) is a 16550<BR>RAMDISK driver initialized: 16 RAM disks of =
4096K size=20
1024 blocksize<BR>loop: loaded (max 8 devices)<BR>au1000eth.c:1.4 <A=20
href=3D"mailto:ppopov@mvista.com">ppopov@mvista.com</A><BR>eth0: Au1x =
Ethernet=20
found at 0xb0500000, irq 28<BR>eth0: LSI 80227 10/100 BaseT PHY at phy =
address=20
0<BR>eth0: Using LSI 80227 10/100 BaseT PHY as default<BR>Uniform =
Multi-Platform=20
E-IDE driver Revision: 7.00beta4-2.4<BR>ide: Assuming 50MHz system bus =
speed for=20
PIO modes; override with idebus=3Dxx<BR>ide0: ports already in use, =
skipping=20
probe<BR>ide1: ports already in use, skipping probe<BR>ide2: ports =
already in=20
use, skipping probe<BR>ide3: ports already in use, skipping =
probe<BR>ide4: ports=20
already in use, skipping probe<BR>ide5: ports already in use, skipping=20
probe<BR>au1100 flash: probing 32-bit flash bus<BR>&nbsp;Amd/Fujitsu =
Extended=20
Query Table v1.3 at 0x0040<BR>number of CFI chips: 1<BR>cfi_cmdset_0002: =

Disabling fast programming due to code brokenness.<BR>Creating 3 MTD =
partitions=20
on "AU1100 flash":<BR>0x00000000-0x01c00000 : "Operating=20
System"<BR>0x01c00000-0x01fc0000 : "YAMON"<BR>0x01fc0000-0x02000000 : =
"Yamon env=20
variables"<BR>usb.c: registered new driver hub<BR>host/usb-ohci.c: USB =
OHCI at=20
membase 0xb0100000, IRQ 26<BR>host/usb-ohci.c: usb-builtin, non-PCI=20
OHCI<BR>usb.c: new USB bus registered, assigned bus number 1<BR>hub.c: =
USB hub=20
found<BR>hub.c: 2 ports detected<BR>usb.c: registered new driver=20
hid<BR>hid-core.c: v1.8.1 Andreas Gal, Vojtech Pavlik &lt;<A=20
href=3D"mailto:vojtech@suse.cz">vojtech@suse.cz</A>&gt;<BR>hid-core.c: =
USB HID=20
support drivers<BR>mice: PS/2 mouse device common for all mice<BR>NET4: =
Linux=20
TCP/IP 1.0 for NET4.0<BR>IP Protocols: ICMP, UDP, TCP, IGMP<BR>IP: =
routing cache=20
hash table of 512 buckets, 4Kbytes<BR>TCP: Hash tables configured =
(established=20
4096 bind 8192)<BR>NET4: Unix domain sockets 1.0/SMP for Linux=20
NET4.0.<BR>RAMDISK: Compressed image found at block 0<BR>Freeing initrd =
memory:=20
872k freed<BR>VFS: Mounted root (ext2 filesystem).<BR>Freeing unused =
kernel=20
memory: 96k freed<BR>Algorithmics/MIPS FPU Emulator v1.5<BR>Linux Kernel =
Card=20
Services 3.1.22<BR>&nbsp; options:&nbsp; [pci]</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Au1x00 PCMCIA (CS release =
3.1.22)<BR>hub.c: new=20
USB device builtin-2, assigned address 2<BR>input0: USB HID v1.10 =
Keyboard=20
[SEJIN SEJIN USB Mini Keyboard] on usb1:2.0<BR>Trying to free =
nonexistent=20
resource &lt;c0010000-c001000f&gt;<BR>hda: SanDisk SDCFB-32, CFA DISK=20
drive<BR>ide1: ports already in use, skipping probe<BR>ide2: ports =
already in=20
use, skipping probe<BR>ide3: ports already in use, skipping =
probe<BR>ide4: ports=20
already in use, skipping probe<BR>ide5: ports already in use, skipping=20
probe<BR>ide0 at 0xc0010000-0xc0010007,0xc001000e on irq 39<BR>hda: =
attached=20
ide-disk driver.<BR>hda: task_no_data_intr: status=3D0x51 { DriveReady=20
SeekComplete Error }<BR>hda: task_no_data_intr: error=3D0x04 { =
DriveStatusError=20
}<BR>hda: 62720 sectors (32 MB) w/1KiB Cache, =
CHS=3D490/4/32<BR>Partition=20
check:<BR>&nbsp;hda: hda1<BR>ide_cs: hda: Vcc =3D 3.3, Vpp =3D =
0.0<BR>&nbsp;hda:=20
hda1<BR>&nbsp;hda: hda1<BR>EXT2-fs warning: mounting unchecked fs, =
running=20
e2fsck is recommended<BR>eth0: link up<BR>eth0: going to full=20
duplex</FONT></DIV>
<DIV><FONT face=3DVerdana=20
size=3D2>*********************************************************</FONT>=
</DIV>
<DIV><FONT face=3DVerdana size=3D2>while booting it still complaining =
that haven't=20
found the initrd.splash file. which actually loads splash =
screen.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Please help where is the problem, =
Which step I am=20
doing wrong?</FONT></DIV></DIV></BODY></HTML>

------=_NextPart_000_01A6_01C599D2.493418A0--


From anemo@mba.ocn.ne.jp Fri Aug  5 14:47:30 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 05 Aug 2005 14:47:49 +0100 (BST)
Received: from mba.ocn.ne.jp ([IPv6:::ffff:210.190.142.172]:2550 "HELO
	smtp.mba.ocn.ne.jp") by linux-mips.org with SMTP
	id <S8225609AbVHENra>; Fri, 5 Aug 2005 14:47:30 +0100
Received: from localhost (p4173-ipad204funabasi.chiba.ocn.ne.jp [222.146.91.173])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 101B8859B; Fri,  5 Aug 2005 22:51:00 +0900 (JST)
Date:	Fri, 05 Aug 2005 22:58:05 +0900 (JST)
Message-Id: <20050805.225805.25908929.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: include/asm-mips/pci.h fix
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
X-Fingerprint: 6ACA 1623 39BD 9A94 9B1A  B746 CA77 FE94 2874 D52F
X-Pgp-Public-Key: http://wwwkeys.pgp.net/pks/lookup?op=get&search=0x2874D52F
X-Mailer: Mew version 3.3 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8695
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 1191
Lines: 33

Currently pci_unmap_addr(), etc. are always defined as nop.  It should
be defined when pci_unmap_single is not a nop.  Here is a patch.

diff -ur linux-mips/include/asm-mips/pci.h linux/include/asm-mips/pci.h
--- linux-mips/include/asm-mips/pci.h	2005-07-26 22:14:07.000000000 +0900
+++ linux/include/asm-mips/pci.h	2005-08-05 22:33:14.000000000 +0900
@@ -94,7 +94,7 @@
  */
 extern unsigned int PCI_DMA_BUS_IS_PHYS;
 
-#ifdef CONFIG_MAPPED_DMA_IO
+#ifndef CONFIG_DMA_COHERENT
 
 /* pci_unmap_{single,page} is not a nop, thus... */
 #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)	dma_addr_t ADDR_NAME;
@@ -104,7 +104,7 @@
 #define pci_unmap_len(PTR, LEN_NAME)		((PTR)->LEN_NAME)
 #define pci_unmap_len_set(PTR, LEN_NAME, VAL)	(((PTR)->LEN_NAME) = (VAL))
 
-#else /* CONFIG_MAPPED_DMA_IO  */
+#else /* CONFIG_DMA_COHERENT  */
 
 /* pci_unmap_{page,single} is a nop so... */
 #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
@@ -114,7 +114,7 @@
 #define pci_unmap_len(PTR, LEN_NAME)		(0)
 #define pci_unmap_len_set(PTR, LEN_NAME, VAL)	do { } while (0)
 
-#endif /* CONFIG_MAPPED_DMA_IO  */
+#endif /* CONFIG_DMA_COHERENT  */
 
 /* This is always fine. */
 #define pci_dac_dma_supported(pci_dev, mask)	(1)

From alec@artcoms.ru Fri Aug  5 15:17:02 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 05 Aug 2005 15:17:17 +0100 (BST)
Received: from mail.spb.artcoms.ru ([IPv6:::ffff:82.114.120.253]:31372 "EHLO
	mrelay.spb.artcoms.ru") by linux-mips.org with ESMTP
	id <S8225750AbVHEORC>; Fri, 5 Aug 2005 15:17:02 +0100
Received: from localhost (localhost.localdomain [127.0.0.1])
	by mrelay.spb.artcoms.ru (Postfix) with ESMTP
	id A3F0B132F3; Fri,  5 Aug 2005 18:20:34 +0400 (MSD)
Received: from mrelay.spb.artcoms.ru ([127.0.0.1])
 by localhost (megera.artcoms.ru [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 09127-08; Fri,  5 Aug 2005 18:20:34 +0400 (MSD)
Received: from ALEC (unknown [192.168.249.108])
	by mrelay.spb.artcoms.ru (Postfix) with SMTP
	id 8609B132EF; Fri,  5 Aug 2005 18:20:34 +0400 (MSD)
Message-ID: <013601c599c9$1fe2ca40$6cf9a8c0@ALEC>
Reply-To: "Alexander Voropay" <alec@artcoms.ru>
From:	"Alexander Voropay" <alec@artcoms.ru>
To:	"inpreet" <singh.inpreet@netsity.com>, <linux-mips@linux-mips.org>
References: <01a901c599a4$2f855280$3c67a8c0@netsity.com>
Subject: Re: Ramdisk issue please help!!!
Date:	Fri, 5 Aug 2005 18:22:31 +0400
Organization: Art Communications
MIME-Version: 1.0
Content-Type: text/plain;
	format=flowed;
	charset="ISO-8859-1";
	reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-Virus-Scanned: by amavisd-new at spb.artcoms.ru
Return-Path: <alec@artcoms.ru>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8696
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: alec@artcoms.ru
Precedence: bulk
X-list: linux-mips
Content-Length: 1251
Lines: 46

"inpreet" <singh.inpreet@netsity.com> wrote:

>I am trying to build ramdisk image and launch bootsplash image at boot time. 
>Steps I followed:
>1. get splash image initrd.splash using splash binary.
...
>8. results in initrd.gz
>
>Now while compiling kernel image I am embedding initrd.gz into it. Here is what I am doing

 You don't need nothing special for *embedded *, not external "MIPS initrd" on a 2.4 kernels.
It works just fine from the CVS.

1) Prepare your "ramdisk.img" with EXT2FS/other FS
2) gzip it.
3) Put this "ramdisk.gz" into the  arch/mips/ramdisk/
4) Enable in the configfile :

CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_INITRD=y

CONFIG_EMBEDDED_RAMDISK=y
CONFIG_EMBEDDED_RAMDISK_IMAGE="ramdisk.gz"

5) make . Kernel build system will find this image automagically.

6) Run this kernel (vmlinux) without a "root=" parameter.

There is example of my kernel bootlog:

...
Determined physical RAM map:
 memory: 01800000 @ 00000000 (usable)
Initial ramdisk at: 0x801b1000 (593920 bytes)
...
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
...
RAMDISK: Compressed image found at block 0
Freeing initrd memory: 580k freed
VFS: Mounted root (ext2 filesystem) readonly.
...

root FS is mouned now as /dev/ram0

--
-=AV=-

From tnt@246tNt.com Fri Aug  5 20:35:06 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 05 Aug 2005 20:35:24 +0100 (BST)
Received: from outmx002.isp.belgacom.be ([IPv6:::ffff:195.238.3.52]:20176 "EHLO
	outmx002.isp.belgacom.be") by linux-mips.org with ESMTP
	id <S8225281AbVHETfG>; Fri, 5 Aug 2005 20:35:06 +0100
Received: from outmx002.isp.belgacom.be (localhost [127.0.0.1])
        by outmx002.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with ESMTP id j75JcdFr020253
        for <linux-mips@linux-mips.org>; Fri, 5 Aug 2005 21:38:39 +0200
        (envelope-from <tnt@246tNt.com>)
Received: from ayanami.246tNt.com (64-90.244.81.adsl.skynet.be [81.244.90.64])
        by outmx002.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with ESMTP id j75JcaZr020244
        for <linux-mips@linux-mips.org>; Fri, 5 Aug 2005 21:38:37 +0200
        (envelope-from <tnt@246tNt.com>)
Received: from [10.0.0.245] (246tNt-laptop.lan.ayanami.246tNt.com [10.0.0.245])
	by ayanami.246tNt.com (Postfix) with ESMTP id 793EE1CAC0D
	for <linux-mips@linux-mips.org>; Fri,  5 Aug 2005 21:38:29 +0200 (CEST)
Message-ID: <42F3C05E.7060002@246tNt.com>
Date:	Fri, 05 Aug 2005 21:39:10 +0200
From:	Sylvain Munaut <tnt@246tNt.com>
User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050610)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: AMD Au1100 problems (USB & Ethernet)
X-Enigmail-Version: 0.90.0.0
X-Enigmail-Supports: pgp-inline, pgp-mime
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Return-Path: <tnt@246tNt.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8697
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: tnt@246tNt.com
Precedence: bulk
X-list: linux-mips
Content-Length: 2947
Lines: 103

Hello,

I've been trying to adapt linux ( the HEAD CVS version ) to a
custom board based around a Au1100. To be more precise, the board
use a "cpu module" (CSB650 from Cogent
http://www.cogcomp.com/csb_csb650.htm ) that's placed on a custom PCB.


I've compiled and booted a kernel sucessfully, I see the message on the
serial console. It's in Big Endian mode since the boot loaded on the
card is big endian only and I could manage to get it to switch to little
endian ...

Now, let's go on with the problems :

 * About USB. First time I tried, it just hung but I quicly found out
that it was because I didn't route the 48Mhz clock to USB module. After
that, I had to slightly adapt the ohci bus glue to enable the OHCI big
endian mode. After that, when a USB stick is inserted, it gets detected,
I can mount it and read small files. But when I try to read bigger files
( just 1 or 2 MB ), I get stuff like :

[4294743.146000] usb 1-1: reset full speed USB device using au1xxx-ohci
and address 2

[4294743.618000] usb 1-1: reset full speed USB device using au1xxx-ohci
and address 2

[4294743.891000] usb 1-1: reset full speed USB device using au1xxx-ohci
and address 2

[4294744.151000] usb 1-1: reset full speed USB device using au1xxx-ohci
and address 2

[4294744.328000] au1xxx-ohci au1xxx-ohci.0: bad entry       4b


[4294744.346000] au1xxx-ohci au1xxx-ohci.0: bad entry ac450000


[4294744.363000] au1xxx-ohci au1xxx-ohci.0: bad entry 8f820014


[4294744.381000] au1xxx-ohci au1xxx-ohci.0: bad entry 38210001


[4294744.495000] hub 1-0:1.0: port 1 disabled by hub (EMI?),
re-enabling...

[4294744.515000] usb 1-1: USB disconnect, address 2


[4294745.532000] au1xxx-ohci au1xxx-ohci.0: IRQ INTR_SF lossage


[4294745.532000] usb 1-1: sg_complete, unlink --> -19


[4294745.532000] usb 1-1: sg_complete, unlink --> -19




Which means absolutly nothing to me ;( Has anyone got a clue ?
I can't say for sure it's not hardware but the cpu module is used by
others and on the base board, it's just a couple of differential pair
with 90ohm differential impedance, nothing more ...


 * About ethernet : It works, I have a network access. However I have
two kind of errors. On the RX side, I get quite a lot of "rx miss"
errors (when au1x00_eth debug is on). About 5% of packets are dropped.
That's not _too_ much of a problem as log as it doesn't increase. But
what can that be due too ?

A more annoying problem is that I get a lot of :
[  506.397000] NETDEV WATCHDOG: eth0: transmit timed out


[  506.412000] eth0: au1000_tx_timeout: dev=8048b400

theses are quite comment when  I transmitt a lot
                         and they completly ruin the transmission
(_real_ slow !).

Heres is some stats from ifconfig :

          RX packets:50496 errors:76 dropped:76 overruns:0 frame:0


          TX packets:49573 errors:47 dropped:0 overruns:0 carrier:74





Any insight / suggestion is appreciated, I'm getting desperate ;)


	Sylvain




From ppopov@embeddedalley.com Fri Aug  5 20:44:06 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 05 Aug 2005 20:44:25 +0100 (BST)
Received: from smtp004.bizmail.sc5.yahoo.com ([IPv6:::ffff:66.163.175.81]:22670
	"HELO smtp004.bizmail.sc5.yahoo.com") by linux-mips.org with SMTP
	id <S8225806AbVHEToG>; Fri, 5 Aug 2005 20:44:06 +0100
Received: (qmail 75115 invoked from network); 5 Aug 2005 19:47:38 -0000
Received: from unknown (HELO ?192.168.1.106?) (ppopov@embeddedalley.com@71.128.175.242 with plain)
  by smtp004.bizmail.sc5.yahoo.com with SMTP; 5 Aug 2005 19:47:37 -0000
Subject: Re: AMD Au1100 problems (USB & Ethernet)
From:	Pete Popov <ppopov@embeddedalley.com>
Reply-To: ppopov@embeddedalley.com
To:	Sylvain Munaut <tnt@246tNt.com>
Cc:	"'linux-mips@linux-mips.org'" <linux-mips@linux-mips.org>
In-Reply-To: <42F3C05E.7060002@246tNt.com>
References: <42F3C05E.7060002@246tNt.com>
Content-Type: text/plain
Organization: Embedded Alley Solutions, Inc
Date:	Fri, 05 Aug 2005 12:47:32 -0700
Message-Id: <1123271252.19992.189.camel@localhost.localdomain>
Mime-Version: 1.0
X-Mailer: Evolution 2.0.4 (2.0.4-4) 
Content-Transfer-Encoding: 7bit
Return-Path: <ppopov@embeddedalley.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8698
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ppopov@embeddedalley.com
Precedence: bulk
X-list: linux-mips
Content-Length: 3340
Lines: 113


I'm guessing the ethernet problems are hardware/board related. Take a
look at the PHY and make sure it's working OK.

Pete


On Fri, 2005-08-05 at 21:39 +0200, Sylvain Munaut wrote:
> Hello,
> 
> I've been trying to adapt linux ( the HEAD CVS version ) to a
> custom board based around a Au1100. To be more precise, the board
> use a "cpu module" (CSB650 from Cogent
> http://www.cogcomp.com/csb_csb650.htm ) that's placed on a custom PCB.
> 
> 
> I've compiled and booted a kernel sucessfully, I see the message on the
> serial console. It's in Big Endian mode since the boot loaded on the
> card is big endian only and I could manage to get it to switch to little
> endian ...
> 
> Now, let's go on with the problems :
> 
>  * About USB. First time I tried, it just hung but I quicly found out
> that it was because I didn't route the 48Mhz clock to USB module. After
> that, I had to slightly adapt the ohci bus glue to enable the OHCI big
> endian mode. After that, when a USB stick is inserted, it gets detected,
> I can mount it and read small files. But when I try to read bigger files
> ( just 1 or 2 MB ), I get stuff like :
> 
> [4294743.146000] usb 1-1: reset full speed USB device using au1xxx-ohci
> and address 2
> 
> [4294743.618000] usb 1-1: reset full speed USB device using au1xxx-ohci
> and address 2
> 
> [4294743.891000] usb 1-1: reset full speed USB device using au1xxx-ohci
> and address 2
> 
> [4294744.151000] usb 1-1: reset full speed USB device using au1xxx-ohci
> and address 2
> 
> [4294744.328000] au1xxx-ohci au1xxx-ohci.0: bad entry       4b
> 
> 
> [4294744.346000] au1xxx-ohci au1xxx-ohci.0: bad entry ac450000
> 
> 
> [4294744.363000] au1xxx-ohci au1xxx-ohci.0: bad entry 8f820014
> 
> 
> [4294744.381000] au1xxx-ohci au1xxx-ohci.0: bad entry 38210001
> 
> 
> [4294744.495000] hub 1-0:1.0: port 1 disabled by hub (EMI?),
> re-enabling...
> 
> [4294744.515000] usb 1-1: USB disconnect, address 2
> 
> 
> [4294745.532000] au1xxx-ohci au1xxx-ohci.0: IRQ INTR_SF lossage
> 
> 
> [4294745.532000] usb 1-1: sg_complete, unlink --> -19
> 
> 
> [4294745.532000] usb 1-1: sg_complete, unlink --> -19
> 
> 
> 
> 
> Which means absolutly nothing to me ;( Has anyone got a clue ?
> I can't say for sure it's not hardware but the cpu module is used by
> others and on the base board, it's just a couple of differential pair
> with 90ohm differential impedance, nothing more ...
> 
> 
>  * About ethernet : It works, I have a network access. However I have
> two kind of errors. On the RX side, I get quite a lot of "rx miss"
> errors (when au1x00_eth debug is on). About 5% of packets are dropped.
> That's not _too_ much of a problem as log as it doesn't increase. But
> what can that be due too ?
> 
> A more annoying problem is that I get a lot of :
> [  506.397000] NETDEV WATCHDOG: eth0: transmit timed out
> 
> 
> [  506.412000] eth0: au1000_tx_timeout: dev=8048b400
> 
> theses are quite comment when  I transmitt a lot
>                          and they completly ruin the transmission
> (_real_ slow !).
> 
> Heres is some stats from ifconfig :
> 
>           RX packets:50496 errors:76 dropped:76 overruns:0 frame:0
> 
> 
>           TX packets:49573 errors:47 dropped:0 overruns:0 carrier:74
> 
> 
> 
> 
> 
> Any insight / suggestion is appreciated, I'm getting desperate ;)
> 
> 
> 	Sylvain
> 
> 
> 
> 


From ppopov@embeddedalley.com Fri Aug  5 21:07:14 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 05 Aug 2005 21:07:30 +0100 (BST)
Received: from smtp005.bizmail.sc5.yahoo.com ([IPv6:::ffff:66.163.175.82]:34192
	"HELO smtp005.bizmail.sc5.yahoo.com") by linux-mips.org with SMTP
	id <S8225806AbVHEUHO>; Fri, 5 Aug 2005 21:07:14 +0100
Received: (qmail 56331 invoked from network); 5 Aug 2005 20:10:46 -0000
Received: from unknown (HELO ?192.168.1.106?) (ppopov@embeddedalley.com@71.128.175.242 with plain)
  by smtp005.bizmail.sc5.yahoo.com with SMTP; 5 Aug 2005 20:10:45 -0000
Subject: Re: AMD Au1100 problems (USB & Ethernet)
From:	Pete Popov <ppopov@embeddedalley.com>
Reply-To: ppopov@embeddedalley.com
To:	Michael Kelly <mike@cogcomp.com>
Cc:	Sylvain Munaut <tnt@246tNt.com>,
	"'linux-mips@linux-mips.org'" <linux-mips@linux-mips.org>
In-Reply-To: <6.2.0.14.2.20050805155414.044a0f00@mail.cogcomp.com>
References: <42F3C05E.7060002@246tNt.com>
	 <1123271252.19992.189.camel@localhost.localdomain>
	 <6.2.0.14.2.20050805155414.044a0f00@mail.cogcomp.com>
Content-Type: text/plain
Organization: Embedded Alley Solutions, Inc
Date:	Fri, 05 Aug 2005 13:10:40 -0700
Message-Id: <1123272640.19992.199.camel@localhost.localdomain>
Mime-Version: 1.0
X-Mailer: Evolution 2.0.4 (2.0.4-4) 
Content-Transfer-Encoding: 7bit
Return-Path: <ppopov@embeddedalley.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8699
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ppopov@embeddedalley.com
Precedence: bulk
X-list: linux-mips
Content-Length: 807
Lines: 21

On Fri, 2005-08-05 at 15:58 -0400, Michael Kelly wrote:
> The error count is less than .15%, not 5%.  This does not seem excessive.
> So, the question is what are these errors exactly.  We have done internal
> testing, but there is no way to test with every cable and switch/hub 
> combination.

Of course. I'm sure the CPU module itself is fine. I took a look at the
picture and it looks like the PHY is external so I'm guessing it's on
their custom PCB.

> If you could determine the actual errors (such as CRC, collision, etc) then we
> can try to determine where the errors are coming from.  It may very well be
> HW, but it is a bit too early to make such a broad statement without more
> information.

Well, could be just a cable issue, hub, etc, but I'll put that in the HW
bucket as well :)

Pete



From tnt@246tNt.com Fri Aug  5 22:02:05 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 05 Aug 2005 22:02:21 +0100 (BST)
Received: from outmx026.isp.belgacom.be ([IPv6:::ffff:195.238.2.91]:5250 "EHLO
	outmx026.isp.belgacom.be") by linux-mips.org with ESMTP
	id <S8225792AbVHEVCF>; Fri, 5 Aug 2005 22:02:05 +0100
Received: from outmx026.isp.belgacom.be (localhost [127.0.0.1])
        by outmx026.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with ESMTP id j75L5UYg018317
        for <linux-mips@linux-mips.org>; Fri, 5 Aug 2005 23:05:30 +0200
        (envelope-from <tnt@246tNt.com>)
Received: from ayanami.246tNt.com (82-135.245.81.adsl.skynet.be [81.245.135.82])
        by outmx026.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with ESMTP id j75L5PCb018262;
	Fri, 5 Aug 2005 23:05:25 +0200
        (envelope-from <tnt@246tNt.com>)
Received: from [10.0.0.245] (246tNt-laptop.lan.ayanami.246tNt.com [10.0.0.245])
	by ayanami.246tNt.com (Postfix) with ESMTP
	id B0E941CAC1C; Fri,  5 Aug 2005 23:05:17 +0200 (CEST)
Message-ID: <42F3D4B7.6040905@246tNt.com>
Date:	Fri, 05 Aug 2005 23:05:59 +0200
From:	Sylvain Munaut <tnt@246tNt.com>
User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050610)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	ppopov@embeddedalley.com
Cc:	Michael Kelly <mike@cogcomp.com>,
	"'linux-mips@linux-mips.org'" <linux-mips@linux-mips.org>
Subject: Re: AMD Au1100 problems (USB & Ethernet)
References: <42F3C05E.7060002@246tNt.com>	 <1123271252.19992.189.camel@localhost.localdomain>	 <6.2.0.14.2.20050805155414.044a0f00@mail.cogcomp.com> <1123272640.19992.199.camel@localhost.localdomain>
In-Reply-To: <1123272640.19992.199.camel@localhost.localdomain>
X-Enigmail-Version: 0.90.0.0
X-Enigmail-Supports: pgp-inline, pgp-mime
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Return-Path: <tnt@246tNt.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8700
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: tnt@246tNt.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1421
Lines: 38

Pete Popov wrote:
> On Fri, 2005-08-05 at 15:58 -0400, Michael Kelly wrote:
> 
>>The error count is less than .15%, not 5%.  This does not seem excessive.
>>So, the question is what are these errors exactly.  We have done internal
>>testing, but there is no way to test with every cable and switch/hub 
>>combination.

Yes, on that particular count because I mainly testing TX on that
particular boot (so the RX are mainly small acks). But when testing
heavy receive with big packets, it can climbs up.

> Of course. I'm sure the CPU module itself is fine. I took a look at the
> picture and it looks like the PHY is external so I'm guessing it's on
> their custom PCB.
> 

The PHY is on the CPU module itself, it's a BCM5221.


>>If you could determine the actual errors (such as CRC, collision, etc) then we
>>can try to determine where the errors are coming from.  It may very well be
>>HW, but it is a bit too early to make such a broad statement without more
>>information.
> 
> 
> Well, could be just a cable issue, hub, etc, but I'll put that in the HW
> bucket as well :)

The RX errors are reported as "rx miss" (RX_MISSED_FRAME set) which is
described as "Internal FIFO overrun". Maybe those are just OK and it's
just that it can't wistand full 100Mbps (the module is connected on a
10/100/1000 switch and the server is gigabit).

The TX errors are time-out, how can I find more details about that ?


	Sylvain

From ppopov@embeddedalley.com Fri Aug  5 22:11:07 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 05 Aug 2005 22:11:24 +0100 (BST)
Received: from smtp005.bizmail.sc5.yahoo.com ([IPv6:::ffff:66.163.175.82]:29543
	"HELO smtp005.bizmail.sc5.yahoo.com") by linux-mips.org with SMTP
	id <S8225792AbVHEVLH>; Fri, 5 Aug 2005 22:11:07 +0100
Received: (qmail 400 invoked from network); 5 Aug 2005 21:14:40 -0000
Received: from unknown (HELO ?192.168.1.106?) (ppopov@embeddedalley.com@71.128.175.242 with plain)
  by smtp005.bizmail.sc5.yahoo.com with SMTP; 5 Aug 2005 21:14:40 -0000
Subject: Re: AMD Au1100 problems (USB & Ethernet)
From:	Pete Popov <ppopov@embeddedalley.com>
Reply-To: ppopov@embeddedalley.com
To:	Sylvain Munaut <tnt@246tNt.com>
Cc:	Michael Kelly <mike@cogcomp.com>,
	"'linux-mips@linux-mips.org'" <linux-mips@linux-mips.org>
In-Reply-To: <42F3D4B7.6040905@246tNt.com>
References: <42F3C05E.7060002@246tNt.com>
	 <1123271252.19992.189.camel@localhost.localdomain>
	 <6.2.0.14.2.20050805155414.044a0f00@mail.cogcomp.com>
	 <1123272640.19992.199.camel@localhost.localdomain>
	 <42F3D4B7.6040905@246tNt.com>
Content-Type: text/plain
Organization: Embedded Alley Solutions, Inc
Date:	Fri, 05 Aug 2005 14:14:34 -0700
Message-Id: <1123276474.23193.6.camel@localhost.localdomain>
Mime-Version: 1.0
X-Mailer: Evolution 2.0.4 (2.0.4-4) 
Content-Transfer-Encoding: 7bit
Return-Path: <ppopov@embeddedalley.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8701
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ppopov@embeddedalley.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1258
Lines: 35


> The PHY is on the CPU module itself, it's a BCM5221.

I see.

> >>If you could determine the actual errors (such as CRC, collision, etc) then we
> >>can try to determine where the errors are coming from.  It may very well be
> >>HW, but it is a bit too early to make such a broad statement without more
> >>information.
> > 
> > 
> > Well, could be just a cable issue, hub, etc, but I'll put that in the HW
> > bucket as well :)
> 
> The RX errors are reported as "rx miss" (RX_MISSED_FRAME set) which is
> described as "Internal FIFO overrun". Maybe those are just OK and it's
> just that it can't wistand full 100Mbps (the module is connected on a
> 10/100/1000 switch and the server is gigabit).

No, I don't think that's normal.

> The TX errors are time-out, how can I find more details about that ?

If possible, eliminate the gig switch by replacing it with a small
10/100 switch. If the problems go away, then that's a big clue.

Take a look at what the bcm phy is auto-negotiating and make sure it
matches what the switch thinks it has negotiated. Although, the tx
timeouts should have nothing to do with mismatched auto negotiation...
but I see there are a bunch of "carrier" errors.

You of course tried a different cable, just in case?

Pete


From tnt@246tNt.com Sat Aug  6 11:38:42 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 06 Aug 2005 11:38:59 +0100 (BST)
Received: from outmx021.isp.belgacom.be ([IPv6:::ffff:195.238.2.202]:11917
	"EHLO outmx021.isp.belgacom.be") by linux-mips.org with ESMTP
	id <S8224971AbVHFKim>; Sat, 6 Aug 2005 11:38:42 +0100
Received: from outmx021.isp.belgacom.be (localhost [127.0.0.1])
        by outmx021.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with ESMTP id j76AgInG032257
        for <linux-mips@linux-mips.org>; Sat, 6 Aug 2005 12:42:18 +0200
        (envelope-from <tnt@246tNt.com>)
Received: from ayanami.246tNt.com (82-135.245.81.adsl.skynet.be [81.245.135.82])
        by outmx021.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with ESMTP id j76AgFP9032224
        for <linux-mips@linux-mips.org>; Sat, 6 Aug 2005 12:42:15 +0200
        (envelope-from <tnt@246tNt.com>)
Received: from [10.0.0.245] (246tNt-laptop.lan.ayanami.246tNt.com [10.0.0.245])
	by ayanami.246tNt.com (Postfix) with ESMTP id AA7EC1CAC5D
	for <linux-mips@linux-mips.org>; Sat,  6 Aug 2005 12:42:07 +0200 (CEST)
Message-ID: <42F4942A.7060006@246tNt.com>
Date:	Sat, 06 Aug 2005 12:42:50 +0200
From:	Sylvain Munaut <tnt@246tNt.com>
User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050610)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: Re: AMD Au1100 problems (USB & Ethernet)
References: <42F3C05E.7060002@246tNt.com>	 <1123271252.19992.189.camel@localhost.localdomain>	 <6.2.0.14.2.20050805155414.044a0f00@mail.cogcomp.com>	 <1123272640.19992.199.camel@localhost.localdomain>	 <42F3D4B7.6040905@246tNt.com> <1123276474.23193.6.camel@localhost.localdomain>
In-Reply-To: <1123276474.23193.6.camel@localhost.localdomain>
X-Enigmail-Version: 0.90.0.0
X-Enigmail-Supports: pgp-inline, pgp-mime
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Return-Path: <tnt@246tNt.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8702
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: tnt@246tNt.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1524
Lines: 43

Pete Popov wrote:

>>The RX errors are reported as "rx miss" (RX_MISSED_FRAME set) which is
>>described as "Internal FIFO overrun". Maybe those are just OK and it's
>>just that it can't wistand full 100Mbps (the module is connected on a
>>10/100/1000 switch and the server is gigabit).
> 
> No, I don't think that's normal.

Maybe it has something to do with initialisation that I don't do
properly. The bootloader is uMon, not YaMon so maybe something is
execpted to be setup that I don't know of.


>>The TX errors are time-out, how can I find more details about that ?
> 
> 
> If possible, eliminate the gig switch by replacing it with a small
> 10/100 switch. If the problems go away, then that's a big clue.

I don't habe a 10/100 switch but I tried on a 10/100 Hub and the results
are quite the same. I just have a few "rx runt" error more that are due
to the hub.

> Take a look at what the bcm phy is auto-negotiating and make sure it
> matches what the switch thinks it has negotiated. Although, the tx
> timeouts should have nothing to do with mismatched auto negotiation...
> but I see there are a bunch of "carrier" errors.

Phy reports 100Mbps half duplex with the hub and 100Mbps full duplex
with the switch, which looks correct.

btw, It seems that after a timeout error, the au1000_timer isn't
restored correctly ( I put a printk in it and before the errors, it
prints every sec, and never after ).

> You of course tried a different cable, just in case?

Sure, with 3 differents cables in fact.


	Sylvain


From redhatter@gentoo.org Sat Aug  6 13:48:12 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 06 Aug 2005 13:48:34 +0100 (BST)
Received: from 202-47-55-78.adsl.gil.com.au ([IPv6:::ffff:202.47.55.78]:17347
	"EHLO longlandclan.hopto.org") by linux-mips.org with ESMTP
	id <S8224990AbVHFMsM>; Sat, 6 Aug 2005 13:48:12 +0100
Received: (qmail 5740 invoked by uid 210); 6 Aug 2005 22:51:41 +1000
Received: from 10.0.0.251 by www (envelope-from <redhatter@gentoo.org>, uid 201) with qmail-scanner-1.25st 
 (spamassassin: 3.0.2. perlscan: 1.25st.  
 Clear:RC:1(10.0.0.251):. 
 Processed in 0.110896 secs); 06 Aug 2005 12:51:41 -0000
Received: from beast.redhatters.home (HELO ?10.0.0.251?) (10.0.0.251)
  by 192.168.5.1 with SMTP; 6 Aug 2005 22:51:41 +1000
Message-ID: <42F4B25B.6040708@gentoo.org>
Date:	Sat, 06 Aug 2005 22:51:39 +1000
From:	Stuart Longland <redhatter@gentoo.org>
Organization: Gentoo Foundation
User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
CC:	cobalt@colonel-panic.org
Subject: netconsole support on Cobalt systems... Anyone tried it?
X-Enigmail-Version: 0.91.0.0
OpenPGP: id=63264AB9;
	url=http://dev.gentoo.org/~redhatter/gpgkey.asc
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="------------enigEDB531620BB9790F172F6628"
Return-Path: <redhatter@gentoo.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8703
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: redhatter@gentoo.org
Precedence: bulk
X-list: linux-mips
Content-Length: 2432
Lines: 62

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigEDB531620BB9790F172F6628
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Hi All,

I've been tinkering with my Qube2 tonight, seeing if I can get
netconsole running.  I'd like to get this running for two reasons:

(1) I've only got one null-modem cable, which usually is plugged into my
Indigo2 Impact -- I'd like to leave it where it is if possible.
(2) I'd like to improve support for the Qube 2700, which lacks such
interfaces.

I've looked around on the web, but haven't found a great deal of
material that explains how one uses it.  The best resource thus far has
been the linux/documentation/network/netconsole.txt file, as well as a
crash dump[1] from an AMD64, which shows netconsole in action.

I tried booting with `netconsole=9877@10.0.0.1/eth0,9876@10.0.0.254/` on
the kernel command line, without success.  The system continues to
boot[2], but only outputting to the serial console.

Has anyone here, tried using netconsole on Cobalt hardware?  Has anybody
played with netconsole on _any_ hardware?

Regards,
-- 
 ____                   _             Stuart Longland (a.k.a Redhatter)
/  _ \   ___    ___  __| |__  __   __ Gentoo Linux/MIPS Cobalt and Docs
- (_) \ /   \  ;   \(__   __)/  \ /  \                        Developer
 \    //  O _| / /\ \  | |  | /\ | /\ |
 /   / \   /__| /  \ \ | |  | \/ | \/ |
(___/   \____/|_;  |_| \_/   \__/ \__/ http://dev.gentoo.org/~redhatter

Footnotes,
1. http://mjt.nysv.org/kernelbugfest/netconsole_panic_2.6.12.2

2. I was using my WinCE/MIPS-based[3] PDA, which happens to have a
crippled version of "HyperTerminal".  Unfortunately, it lacks any
ability to capture the text... but otherwise, turns my PDA into a very
convenient portable VT100. :-)

3. I'd like to get Linux working on this thing sometime... see my next
post, which I'll write in a moment. :-)

--------------enigEDB531620BB9790F172F6628
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

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

iD8DBQFC9LJeuarJ1mMmSrkRAsIMAJsH1IcRr1Yqlj3mT/RP4mzoSQyXOQCfWOCI
ZF0olppPJaN2qmIX7Zr+xt0=
=Wswj
-----END PGP SIGNATURE-----

--------------enigEDB531620BB9790F172F6628--

From redhatter@gentoo.org Sat Aug  6 14:04:19 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 06 Aug 2005 14:04:37 +0100 (BST)
Received: from 202-47-55-78.adsl.gil.com.au ([IPv6:::ffff:202.47.55.78]:59321
	"EHLO longlandclan.hopto.org") by linux-mips.org with ESMTP
	id <S8224990AbVHFNET>; Sat, 6 Aug 2005 14:04:19 +0100
Received: (qmail 5979 invoked by uid 210); 6 Aug 2005 23:07:29 +1000
Received: from 10.0.0.251 by www (envelope-from <redhatter@gentoo.org>, uid 201) with qmail-scanner-1.25st 
 (spamassassin: 3.0.2. perlscan: 1.25st.  
 Clear:RC:1(10.0.0.251):. 
 Processed in 0.09711 secs); 06 Aug 2005 13:07:29 -0000
Received: from beast.redhatters.home (HELO ?10.0.0.251?) (10.0.0.251)
  by 192.168.5.1 with SMTP; 6 Aug 2005 23:07:29 +1000
Message-ID: <42F4B60F.3070402@gentoo.org>
Date:	Sat, 06 Aug 2005 23:07:27 +1000
From:	Stuart Longland <redhatter@gentoo.org>
Organization: Gentoo Foundation
User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: Linux on the Sharp Mobilion PRO PV5000A?
X-Enigmail-Version: 0.91.0.0
OpenPGP: id=63264AB9;
	url=http://dev.gentoo.org/~redhatter/gpgkey.asc
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="------------enigDEF8329372B3149AE5FA879A"
Return-Path: <redhatter@gentoo.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8704
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: redhatter@gentoo.org
Precedence: bulk
X-list: linux-mips
Content-Length: 2085
Lines: 53

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigDEF8329372B3149AE5FA879A
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Hi All,

I've recently acquired a new toy, a Sharp PDA.  From what I've read on
the NetBSD/hpcmips website, and other places, it's based around a
Toshiba TX3922 129MHz CPU and has 32MB RAM.

I've done some research, and it looks like this machine may, be a cousin
of the Philips Velo.  I'm yet to pull mine apart (which I'll have to do
at some point, to fix a dickey power socket), so I can't be sure what
hardware mine has.

Anyway, what I was going to ask, is has anyone tried Linux or NetBSD on
this system?  If someone's already started work on porting, then I'd
like to assist where I can, no point in two of us duplicating efforts :-).

I've put some stuff up on the wiki[1], about what I know on the device.
 I'll possibly look into getting some sort of WinCE/MIPS dev environment
set up, so that I can compile apps to explore the hardware on the
device, but I'd be interested to hear if anyone has attempted a port to
such a device.

Regards,
-- 
 ____                   _             Stuart Longland (a.k.a Redhatter)
/  _ \   ___    ___  __| |__  __   __ Gentoo Linux/MIPS Cobalt and Docs
- (_) \ /   \  ;   \(__   __)/  \ /  \                        Developer
 \    //  O _| / /\ \  | |  | /\ | /\ |
 /   / \   /__| /  \ \ | |  | \/ | \/ |
(___/   \____/|_;  |_| \_/   \__/ \__/ http://dev.gentoo.org/~redhatter

Footnotes:
1. http://www.linux-mips.org/wiki/Sharp_Mobilion_Pro_PV5000A

--------------enigDEF8329372B3149AE5FA879A
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

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

iD8DBQFC9LYSuarJ1mMmSrkRAkOjAJ0Vp+awWHAmV75aZpZQ9MFtyPsaOwCdHuP8
aa0ecOUawY94GebDaihfrwY=
=JCMH
-----END PGP SIGNATURE-----

--------------enigDEF8329372B3149AE5FA879A--

From yuasa@hh.iij4u.or.jp Sat Aug  6 14:55:40 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 06 Aug 2005 14:56:05 +0100 (BST)
Received: from mo00.iij4u.or.jp ([IPv6:::ffff:210.130.0.19]:2261 "EHLO
	mo00.iij4u.or.jp") by linux-mips.org with ESMTP id <S8225877AbVHFNzk>;
	Sat, 6 Aug 2005 14:55:40 +0100
Received: MO(mo00)id j76DxEHM022201; Sat, 6 Aug 2005 22:59:14 +0900 (JST)
Received: MDO(mdo00) id j76DxD4K004376; Sat, 6 Aug 2005 22:59:14 +0900 (JST)
Received: from stratos (h009.p499.iij4u.or.jp [210.149.243.9])
	by mbox.iij4u.or.jp (4U-MR/mbox01) id j76DxCsp010789
	(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT);
	Sat, 6 Aug 2005 22:59:13 +0900 (JST)
Date:	Sat, 6 Aug 2005 22:59:11 +0900
From:	Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
To:	Stuart Longland <redhatter@gentoo.org>
Cc:	linux-mips@linux-mips.org
Subject: Re: Linux on the Sharp Mobilion PRO PV5000A?
Message-Id: <20050806225911.5cc0ed63.yuasa@hh.iij4u.or.jp>
In-Reply-To: <42F4B60F.3070402@gentoo.org>
References: <42F4B60F.3070402@gentoo.org>
X-Mailer: Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yuasa@hh.iij4u.or.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8705
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: yuasa@hh.iij4u.or.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 1226
Lines: 34

Hi,

On Sat, 06 Aug 2005 23:07:27 +1000
Stuart Longland <redhatter@gentoo.org> wrote:

> Hi All,
> 
> I've recently acquired a new toy, a Sharp PDA.  From what I've read on
> the NetBSD/hpcmips website, and other places, it's based around a
> Toshiba TX3922 129MHz CPU and has 32MB RAM.

This is old information about TX3922.

http://www.sikigami.com/~fuku/linux-telios/index-en.html

I don't know that Telios and PV5000A are the same.

> I've done some research, and it looks like this machine may, be a cousin
> of the Philips Velo.  I'm yet to pull mine apart (which I'll have to do
> at some point, to fix a dickey power socket), so I can't be sure what
> hardware mine has.
> 
> Anyway, what I was going to ask, is has anyone tried Linux or NetBSD on
> this system?  If someone's already started work on porting, then I'd
> like to assist where I can, no point in two of us duplicating efforts :-).
> 
> I've put some stuff up on the wiki[1], about what I know on the device.
>  I'll possibly look into getting some sort of WinCE/MIPS dev environment
> set up, so that I can compile apps to explore the hardware on the
> device, but I'd be interested to hear if anyone has attempted a port to
> such a device.
> 

Yoichi

From tbm@cyrius.com Sun Aug  7 11:27:52 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 07 Aug 2005 11:28:10 +0100 (BST)
Received: from sorrow.cyrius.com ([IPv6:::ffff:65.19.161.204]:19461 "EHLO
	sorrow.cyrius.com") by linux-mips.org with ESMTP
	id <S8224784AbVHGK1w>; Sun, 7 Aug 2005 11:27:52 +0100
Received: by sorrow.cyrius.com (Postfix, from userid 10)
	id B560764D54; Sun,  7 Aug 2005 10:31:32 +0000 (UTC)
Received: by deprecation.cyrius.com (Postfix, from userid 1000)
	id F18D88441; Sun,  7 Aug 2005 11:31:23 +0100 (BST)
Date:	Sun, 7 Aug 2005 11:31:23 +0100
From:	Martin Michlmayr <tbm@cyrius.com>
To:	linux-mips@linux-mips.org
Subject: Re: Linux on the Sharp Mobilion PRO PV5000A?
Message-ID: <20050807103123.GC25175@deprecation.cyrius.com>
References: <42F4B60F.3070402@gentoo.org> <20050806225911.5cc0ed63.yuasa@hh.iij4u.or.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050806225911.5cc0ed63.yuasa@hh.iij4u.or.jp>
User-Agent: Mutt/1.5.9i
Return-Path: <tbm@cyrius.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8706
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: tbm@cyrius.com
Precedence: bulk
X-list: linux-mips
Content-Length: 370
Lines: 12

* Yoichi Yuasa <yuasa@hh.iij4u.or.jp> [2005-08-06 22:59]:
> This is old information about TX3922.
> 
> http://www.sikigami.com/~fuku/linux-telios/index-en.html
> 
> I don't know that Telios and PV5000A are the same.

I'm fairly sure they aren't.  If I remember correctly, the companion
chip PLUM2 was only used in the Telios.
-- 
Martin Michlmayr
http://www.cyrius.com/

From redhatter@gentoo.org Sun Aug  7 13:39:42 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 07 Aug 2005 13:40:01 +0100 (BST)
Received: from 202-47-55-78.adsl.gil.com.au ([IPv6:::ffff:202.47.55.78]:61569
	"EHLO longlandclan.hopto.org") by linux-mips.org with ESMTP
	id <S8224943AbVHGMjm>; Sun, 7 Aug 2005 13:39:42 +0100
Received: (qmail 21500 invoked by uid 210); 7 Aug 2005 22:43:15 +1000
Received: from 10.0.0.251 by www (envelope-from <redhatter@gentoo.org>, uid 201) with qmail-scanner-1.25st 
 (spamassassin: 3.0.2. perlscan: 1.25st.  
 Clear:RC:1(10.0.0.251):. 
 Processed in 0.097349 secs); 07 Aug 2005 12:43:15 -0000
Received: from beast.redhatters.home (HELO ?10.0.0.251?) (10.0.0.251)
  by 192.168.5.1 with SMTP; 7 Aug 2005 22:43:15 +1000
Message-ID: <42F601E1.1050707@gentoo.org>
Date:	Sun, 07 Aug 2005 22:43:13 +1000
From:	Stuart Longland <redhatter@gentoo.org>
Organization: Gentoo Foundation
User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: Re: Linux on the Sharp Mobilion PRO PV5000A?
References: <42F4B60F.3070402@gentoo.org> <20050806225911.5cc0ed63.yuasa@hh.iij4u.or.jp> <20050807103123.GC25175@deprecation.cyrius.com>
In-Reply-To: <20050807103123.GC25175@deprecation.cyrius.com>
X-Enigmail-Version: 0.91.0.0
OpenPGP: id=63264AB9;
	url=http://dev.gentoo.org/~redhatter/gpgkey.asc
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="------------enigFACCFBDCC86888B9C1991756"
Return-Path: <redhatter@gentoo.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8707
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: redhatter@gentoo.org
Precedence: bulk
X-list: linux-mips
Content-Length: 2189
Lines: 57

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigFACCFBDCC86888B9C1991756
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Martin Michlmayr wrote:
> * Yoichi Yuasa <yuasa@hh.iij4u.or.jp> [2005-08-06 22:59]:
> 
>>This is old information about TX3922.
>>
>>http://www.sikigami.com/~fuku/linux-telios/index-en.html
>>
>>I don't know that Telios and PV5000A are the same.
> 
> 
> I'm fairly sure they aren't.  If I remember correctly, the companion
> chip PLUM2 was only used in the Telios.

Well... I actually pulled mine apart tonight.
http://www.linux-mips.org/wiki/Sharp_Mobilion_Pro_PV5000A#A_look_inside

My primary objective was to fix a wobbly power socket... but I also took
the time to take snaps of the board & its chips.  In putting the unit
back together again though, it seems I now have some spare screws...
oddly enough, WinCE seems to boot & run ever so slightly faster.

You could say I've made it more efficient by removing parts -- but I
don't think screws count :-)

I'll have to google some of the ICs... I actually thought this would be
using the Philips Poseidon SoC, but no, there's not a single chip with
"Philips" written on it anywhere.  It's mostly Toshiba circuitry -- one
will be responsible for I/O, I know that much. :-)

-- 
 ____                   _             Stuart Longland (a.k.a Redhatter)
/  _ \   ___    ___  __| |__  __   __ Gentoo Linux/MIPS Cobalt and Docs
- (_) \ /   \  ;   \(__   __)/  \ /  \                        Developer
 \    //  O _| / /\ \  | |  | /\ | /\ |
 /   / \   /__| /  \ \ | |  | \/ | \/ |
(___/   \____/|_;  |_| \_/   \__/ \__/ http://dev.gentoo.org/~redhatter

--------------enigFACCFBDCC86888B9C1991756
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

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

iD8DBQFC9gHluarJ1mMmSrkRAvTQAJ4jf9U4QSuUKIpz/4AohQibgRld+QCfRaON
x7YFVg9Qt+hLa9R8Ajnbpfo=
=aY8F
-----END PGP SIGNATURE-----

--------------enigFACCFBDCC86888B9C1991756--

From bunk@stusta.de Sun Aug  7 16:39:22 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 07 Aug 2005 16:39:39 +0100 (BST)
Received: from mailout.stusta.mhn.de ([IPv6:::ffff:141.84.69.5]:27908 "HELO
	mailout.stusta.mhn.de") by linux-mips.org with SMTP
	id <S8224972AbVHGPjW>; Sun, 7 Aug 2005 16:39:22 +0100
Received: (qmail 23315 invoked from network); 7 Aug 2005 15:43:01 -0000
Received: from r063144.stusta.swh.mhn.de (10.150.63.144)
  by mailout.stusta.mhn.de with SMTP; 7 Aug 2005 15:43:01 -0000
Received: by r063144.stusta.swh.mhn.de (Postfix, from userid 1000)
	id DB0C5BB57D; Sun,  7 Aug 2005 17:43:00 +0200 (CEST)
Date:	Sun, 7 Aug 2005 17:43:00 +0200
From:	Adrian Bunk <bunk@stusta.de>
To:	Andrew Morton <akpm@osdl.org>, Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-kernel@vger.kernel.org, linux-mips@linux-mips.org
Subject: [-mm patch] more vr4181 removal
Message-ID: <20050807154300.GC3513@stusta.de>
References: <20050807014214.45968af3.akpm@osdl.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050807014214.45968af3.akpm@osdl.org>
User-Agent: Mutt/1.5.9i
Return-Path: <bunk@stusta.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8708
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: bunk@stusta.de
Precedence: bulk
X-list: linux-mips
Content-Length: 2839
Lines: 90

On Sun, Aug 07, 2005 at 01:42:14AM -0700, Andrew Morton wrote:
>...
> Changes since 2.6.13-rc4-mm1:
>...
> +mips-remove-vr4181-support.patch
>...
>  MIPS stuff
>...



Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 arch/mips/Kconfig            |   12 +-----------
 arch/mips/Makefile           |    7 -------
 arch/mips/kernel/cpu-probe.c |    6 ------
 3 files changed, 1 insertion(+), 24 deletions(-)

--- linux-2.6.13-rc5-mm1-full/arch/mips/Kconfig.old	2005-08-07 17:31:12.000000000 +0200
+++ linux-2.6.13-rc5-mm1-full/arch/mips/Kconfig	2005-08-07 17:32:04.000000000 +0200
@@ -445,11 +445,6 @@
 	depends on DDB5477
 	default 0
 
-config NEC_OSPREY
-	bool "Support for NEC Osprey board"
-	select DMA_NONCOHERENT
-	select IRQ_CPU
-
 config SGI_IP22
 	bool "Support for SGI IP22 (Indy/Indigo2)"
 	select ARC
@@ -974,7 +969,7 @@
 
 config CPU_LITTLE_ENDIAN
 	bool "Generate little endian code"
-	default y if ACER_PICA_61 || CASIO_E55 || DDB5074 || DDB5476 || DDB5477 || MACH_DECSTATION || IBM_WORKPAD || LASAT || MIPS_COBALT || MIPS_ITE8172 || MIPS_IVR || SOC_AU1X00 || NEC_OSPREY || OLIVETTI_M700 || SNI_RM200_PCI || VICTOR_MPC30X || ZAO_CAPCELLA
+	default y if ACER_PICA_61 || CASIO_E55 || DDB5074 || DDB5476 || DDB5477 || MACH_DECSTATION || IBM_WORKPAD || LASAT || MIPS_COBALT || MIPS_ITE8172 || MIPS_IVR || SOC_AU1X00 || OLIVETTI_M700 || SNI_RM200_PCI || VICTOR_MPC30X || ZAO_CAPCELLA
 	default n if MIPS_EV64120 || MIPS_EV96100 || MOMENCO_OCELOT || MOMENCO_OCELOT_G || SGI_IP22 || SGI_IP27 || SGI_IP32 || TOSHIBA_JMR3927
 	help
 	  Some MIPS machines can be configured for either little or big endian
@@ -1091,11 +1086,6 @@
 config HAVE_STD_PC_SERIAL_PORT
 	bool
 
-config VR4181
-	bool
-	depends on NEC_OSPREY
-	default y
-
 config ARC_CONSOLE
 	bool "ARC console support"
 	depends on SGI_IP22 || SNI_RM200_PCI
--- linux-2.6.13-rc5-mm1-full/arch/mips/Makefile.old	2005-08-07 17:32:19.000000000 +0200
+++ linux-2.6.13-rc5-mm1-full/arch/mips/Makefile	2005-08-07 17:32:30.000000000 +0200
@@ -469,13 +469,6 @@
 load-$(CONFIG_LASAT)		+= 0xffffffff80000000
 
 #
-# NEC Osprey (vr4181) board
-#
-core-$(CONFIG_NEC_OSPREY)	+= arch/mips/vr4181/common/ \
-				   arch/mips/vr4181/osprey/
-load-$(CONFIG_NEC_OSPREY)	+= 0xffffffff80002000
-
-#
 # Common VR41xx
 #
 core-$(CONFIG_MACH_VR41XX)	+= arch/mips/vr41xx/common/
--- linux-2.6.13-rc5-mm1-full/arch/mips/kernel/cpu-probe.c.old	2005-08-07 17:32:45.000000000 +0200
+++ linux-2.6.13-rc5-mm1-full/arch/mips/kernel/cpu-probe.c	2005-08-07 17:33:46.000000000 +0200
@@ -229,15 +229,9 @@
 		break;
 	case PRID_IMP_VR41XX:
 		switch (c->processor_id & 0xf0) {
-#ifndef CONFIG_VR4181
 		case PRID_REV_VR4111:
 			c->cputype = CPU_VR4111;
 			break;
-#else
-		case PRID_REV_VR4181:
-			c->cputype = CPU_VR4181;
-			break;
-#endif
 		case PRID_REV_VR4121:
 			c->cputype = CPU_VR4121;
 			break;


From alec@artcoms.ru Sun Aug  7 16:41:11 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 07 Aug 2005 16:41:30 +0100 (BST)
Received: from mail.spb.artcoms.ru ([IPv6:::ffff:82.114.120.253]:37558 "EHLO
	mrelay.spb.artcoms.ru") by linux-mips.org with ESMTP
	id <S8224975AbVHGPlL>; Sun, 7 Aug 2005 16:41:11 +0100
Received: from localhost (localhost.localdomain [127.0.0.1])
	by mrelay.spb.artcoms.ru (Postfix) with ESMTP
	id 49923132F5; Sun,  7 Aug 2005 19:44:51 +0400 (MSD)
Received: from mrelay.spb.artcoms.ru ([127.0.0.1])
 by localhost (megera.artcoms.ru [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 19696-10; Sun,  7 Aug 2005 19:44:51 +0400 (MSD)
Received: from ALEC (unknown [192.168.249.108])
	by mrelay.spb.artcoms.ru (Postfix) with SMTP
	id 297AD132F3; Sun,  7 Aug 2005 19:44:51 +0400 (MSD)
Message-ID: <016101c59b67$3b4a9ed0$6cf9a8c0@ALEC>
Reply-To: "Alexander Voropay" <alec@artcoms.ru>
From:	"Alexander Voropay" <alec@artcoms.ru>
To:	"Stuart Longland" <redhatter@gentoo.org>,
	<linux-mips@linux-mips.org>
Cc:	<cobalt@colonel-panic.org>
References: <42F4B25B.6040708@gentoo.org>
Subject: Re: netconsole support on Cobalt systems... Anyone tried it?
Date:	Sun, 7 Aug 2005 19:42:57 +0400
Organization: Art Communications
MIME-Version: 1.0
Content-Type: text/plain;
	format=flowed;
	charset="UTF-8";
	reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-Virus-Scanned: by amavisd-new at spb.artcoms.ru
Return-Path: <alec@artcoms.ru>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8709
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: alec@artcoms.ru
Precedence: bulk
X-list: linux-mips
Content-Length: 271
Lines: 11

"Stuart Longland" <redhatter@gentoo.org> wrote:

>Has anyone here, tried using netconsole on Cobalt hardware?  Has anybody
>played with netconsole on _any_ hardware?

 Contains an example of udp-console :
http://www.linux.it/~rubini/docs/sercons/sercons.html


--
-=AV=-

From wd@denx.de Sun Aug  7 18:09:44 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 07 Aug 2005 18:09:59 +0100 (BST)
Received: from mailout05.sul.t-online.com ([IPv6:::ffff:194.25.134.82]:17347
	"EHLO mailout05.sul.t-online.com") by linux-mips.org with ESMTP
	id <S8224983AbVHGRJo>; Sun, 7 Aug 2005 18:09:44 +0100
Received: from fwd28.aul.t-online.de 
	by mailout05.sul.t-online.com with smtp 
	id 1E1oiF-00073j-03; Sun, 07 Aug 2005 19:13:27 +0200
Received: from denx.de (S+QIpEZ1Zei9WXFka6c1DcE7YtrnAp1lXqMepafn5HkSC55aahdi8M@[84.150.87.222]) by fwd28.sul.t-online.de
	with esmtp id 1E1oiB-1SBDQu0; Sun, 7 Aug 2005 19:13:23 +0200
Received: from atlas.denx.de (atlas.denx.de [10.0.0.14])
	by denx.de (Postfix) with ESMTP
	id 789DA42A8A; Sun,  7 Aug 2005 19:13:22 +0200 (MEST)
Received: from atlas.denx.de (localhost.localdomain [127.0.0.1])
	by atlas.denx.de (Postfix) with ESMTP id 2AC0C353BF9;
	Sun,  7 Aug 2005 19:13:22 +0200 (MEST)
To:	Stuart Longland <redhatter@gentoo.org>
Cc:	linux-mips@linux-mips.org, cobalt@colonel-panic.org
From:	Wolfgang Denk <wd@denx.de>
Subject: Re: netconsole support on Cobalt systems... Anyone tried it? 
Mime-version: 1.0
Content-type: text/plain; charset=ISO-8859-1
Content-transfer-encoding: 8bit
In-reply-to: Your message of "Sat, 06 Aug 2005 22:51:39 +1000."
             <42F4B25B.6040708@gentoo.org> 
Date:	Sun, 07 Aug 2005 19:13:22 +0200
Message-Id: <20050807171322.2AC0C353BF9@atlas.denx.de>
X-ID:	S+QIpEZ1Zei9WXFka6c1DcE7YtrnAp1lXqMepafn5HkSC55aahdi8M@t-dialin.net
X-TOI-MSGID: a9f11f48-fe08-41c9-9ab4-c75fd7f66770
Return-Path: <wd@denx.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8710
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: wd@denx.de
Precedence: bulk
X-list: linux-mips
Content-Length: 1040
Lines: 27

In message <42F4B25B.6040708@gentoo.org> you wrote:
>
> I've been tinkering with my Qube2 tonight, seeing if I can get
> netconsole running.  I'd like to get this running for two reasons:
...
> I've looked around on the web, but haven't found a great deal of
> material that explains how one uses it.  The best resource thus far has

See "doc/README.NetConsole" in the U-Boot source tree  (ok,  this  is
more  about  U-Boot's implementation but it also contains a few hints
about the Linux part).

> Has anyone here, tried using netconsole on Cobalt hardware?  Has anybody
> played with netconsole on _any_ hardware?

We use netconsole  for  Linux  in  several  projects  (all  PowerPC),
usually in combination with netconsole in U-Boot.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
The rule on staying alive as a program manager is to give 'em a  num-
ber or give 'em a date, but never give 'em both at once.

From basicmark@yahoo.com Mon Aug  8 23:43:32 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 08 Aug 2005 23:43:52 +0100 (BST)
Received: from web30311.mail.mud.yahoo.com ([IPv6:::ffff:68.142.201.229]:6531
	"HELO web30311.mail.mud.yahoo.com") by linux-mips.org with SMTP
	id <S8225197AbVHHWnc>; Mon, 8 Aug 2005 23:43:32 +0100
Received: (qmail 25828 invoked by uid 60001); 8 Aug 2005 22:47:19 -0000
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
  s=s1024; d=yahoo.com;
  h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding;
  b=IQ0TpBYAehWf8m5sOYQRPlubBNjg4NrBo4K2bCNQWTbxRG7sMZkYaD3moUH2KI5bfSQ95xd6ZfBeKx9tNDvjPkwJ21Ltfr83XOQAn8DCM6iuZJ4i5LbZjoDXSufoO9ln0SQwoFK6JmuSz3AkpP2hJNnNKe+mgPeUR9o0KtObGA8=  ;
Message-ID: <20050808224719.25826.qmail@web30311.mail.mud.yahoo.com>
Received: from [62.253.64.19] by web30311.mail.mud.yahoo.com via HTTP; Mon, 08 Aug 2005 23:47:19 BST
Date:	Mon, 8 Aug 2005 23:47:19 +0100 (BST)
From:	Mark Underwood <basicmark@yahoo.com>
Subject: Re: Linux 2.6.11.5 on R3912 problems
To:	Mark Underwood <basicmark@yahoo.com>,
	LKML <linux-kernel@vger.kernel.org>,
	'Linux/MIPS Development' <linux-mips@linux-mips.org>
In-Reply-To: <20050718201429.82565.qmail@web30312.mail.mud.yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Return-Path: <basicmark@yahoo.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8711
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: basicmark@yahoo.com
Precedence: bulk
X-list: linux-mips
Content-Length: 4924
Lines: 163

OK. Fixed this one myself :-), I had misunderstood the
MIPS timer stuff and thus the kernel wasn't
scheduling.

Mark

--- Mark Underwood <basicmark@yahoo.com> wrote:

> Hi,
> 
> I have now been trying to get Linux 2.6.11.5 (built
> with gcc 3.3.3 and binutils 2.15.91.0.2) up and
> running on my Helio PDA, a MIPS R3912 based ASSP
> (the
> emulator to be exact) and have been stuck at the
> last
> step for a while now :-(. 
> 
> The kernel runs up fine, the problem starts when
> init
> is started. Bellow is my kernel log up to freeing
> init.
> 
> Uncompressing
> Linux............................................
> done, booting the kernel.
> done decompressing kernel.
> e_entry: 8016b000, e_ehsize: 52, e_phentsize 32,
> e_phnum 2,
> e_shentsize 40, e_shnum 25
> copying 0x10c320 bytes from file offset 0x80 to
> address 0x80040000
> zeroing from 8014c320 to to 8014c320, 0x0 bytes
> copying 0x36084 bytes from file offset 0x10e000 to
> address 0x8014e000
> zeroing from 80184084 to to 80198b58, 0x14ad4 bytes
> done loading kernel, about to jump in!
> mips_machgroup 0x00000017, mips_machtype 0x00000000
> arcs_cmdline: root=1f01 console=ttyS0,115200n8
> Linux version 2.6.11.5 (mark@stargate) (gcc version
> 3.3.3) #297 Mon Jul 18 20:19
> :39 UTC 2005
> V nasty hack. The Emulator doesn't report which
> subset
> of the TX39 family it bel
> ongs to :,-(. I hope the hardware does!
> Forcing cpu type to CPU_TX3912
> CPU revision is: 00002200
> Determined physical RAM map:
>  memory: 00267000 @ 00199000 (usable)
>  memory: 00400000 @ 02000000 (usable)
>  memory: 00200000 @ 9fc00000 (ROM data)
> Built 1 zonelists
> Kernel command line: root=1f01
> console=ttyS0,115200n8
> Primary instruction cache 1kB, linesize 16 bytes
> Primary data cache 1kB, linesize 4 bytes
> Synthesized TLB handler (17 instructions).
> Synthesized TLB load handler fastpath (37
> instructions).
> Synthesized TLB store handler fastpath (37
> instructions).
> Synthesized TLB modify handler fastpath (29
> instructions).
> PID hash table entries: 256 (order: 8, 4096 bytes)
> r39xx_set_termios
> Dentry cache hash table entries: 8192 (order: 3,
> 32768
> bytes)
> Inode-cache hash table entries: 4096 (order: 2,
> 16384
> bytes)
> Memory: 6168k/6556k available (981k kernel code,
> 348k
> reserved, 212k data, 104k
> init, 0k highmem)
> Mount-cache hash table entries: 512 (order: 0, 4096
> bytes)
> Checking for 'wait' instruction...  unavailable.
> cpu_wait = 0x0
> Linux NoNET1.0 for Linux 2.6
> schedule = 0x801327f8. ret = 0
> Can't analyze prologue code at 80133ea0
> schedule_timeout = 0x80133ea0. ret = -1
> sleep_on = 0x8013395c. ret = 0
> sleep_on_timeout = 0x80133a54. ret = 0
> wait_for_completion = 0x80133148. ret = 0
> Serial: r39xx internal UART driver $
> r39xx_config_port
> r39xx_request_port
> ttyS0 at MMIO 0x0r39xx_type
>  (irq = 74) is a R39XX
> io scheduler noop registered
> io scheduler anticipatory registered
> io scheduler deadline registered
> io scheduler cfq registered
> RAMDISK driver initialized: 16 RAM disks of 4096K
> size
> 1024 blocksize
> loop: loaded (max 8 devices)
> Helio Boot ROM: 0x00200000 at 0x9fc00000
> helio_mtd_map.virt 0x9fc00000
> Helio Boot ROM: probing for ROM
> Creating 2 MTD partitions on "Helio Boot ROM":
> 0x00000000-0x00097eec : "Bootloader + Kernel"
> mtd: Giving out device 0 to Bootloader + Kernel
> 0x00097eec-0x0013deec : "cramfs Filesystem"
> mtd: Giving out device 1 to cramfs Filesystem
> block2mtd: version $Revision: 1.23 $
> VFS: Mounted root (cramfs filesystem) readonly.
> Freeing unused kernel memory: 104k freed
> 
> I have had to write a UART driver so I thought the
> problem might be with that so I put lots of debug in
> tty layer, serial_core and my driver to see what was
> going on. After doing this and changing the
> interrupt
> handler (int-handler.S) I saw the echo that I had
> put
> in my inittab.
> So I started to remove debug and found it stopped
> working. The strange thing is that it stops before
> it
> gets as far as sending the echo from inittab.
> If I don’t have enough debug the kernel stops just
> before printing out:
> 
> Algorithmics/MIPS FPU Emulator v1.5
> 
> When I connect to the emulator with GDB and look at
> the registers I find the CPU is still running and is
> in cpu_idle.
> I wondered if it might be a timer/task scheduler
> related problem but as it gets passed the bogomips
> calculation the timer must be working.
> 
> Any help would be great as I have been stuck here
> for
> a while.
> 
> Many Thanks,
> 
> Mark
> 
> 
> 
> 		
>
___________________________________________________________
> 
> How much free photo storage do you get? Store your
> holiday 
> snaps for FREE with Yahoo! Photos
> http://uk.photos.yahoo.com
> 
> 



		
___________________________________________________________ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com

From yuasa@hh.iij4u.or.jp Tue Aug  9 16:05:13 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 09 Aug 2005 16:05:32 +0100 (BST)
Received: from mo00.iij4u.or.jp ([IPv6:::ffff:210.130.0.19]:6655 "EHLO
	mo00.iij4u.or.jp") by linux-mips.org with ESMTP id <S8225201AbVHIPFN>;
	Tue, 9 Aug 2005 16:05:13 +0100
Received: MO(mo00)id j79F92ZZ026512; Wed, 10 Aug 2005 00:09:02 +0900 (JST)
Received: MDO(mdo00) id j79F92iQ027005; Wed, 10 Aug 2005 00:09:02 +0900 (JST)
Received: from stratos (h009.p499.iij4u.or.jp [210.149.243.9])
	by mbox.iij4u.or.jp (4U-MR/mbox01) id j79F90AK007159
	(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT);
	Wed, 10 Aug 2005 00:09:01 +0900 (JST)
Date:	Wed, 10 Aug 2005 00:08:59 +0900
From:	Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	yuasa@hh.iij4u.or.jp, linux-mips <linux-mips@linux-mips.org>
Subject: [PATCH 2.6][1/2] vr41xx: combine TB0225 with TB0229
Message-Id: <20050810000859.7458588b.yuasa@hh.iij4u.or.jp>
X-Mailer: Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yuasa@hh.iij4u.or.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8712
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: yuasa@hh.iij4u.or.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 3297
Lines: 98

Hi Ralf,

This patch has combined TB0225 with TB0229 in arch/mips/vr41xx/Kconfig.
Please apply this patch.

Yoichi

Signed-off-by: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>

diff -urN -X dontdiff a-orig/arch/mips/Makefile a/arch/mips/Makefile
--- a-orig/arch/mips/Makefile	2005-07-30 01:10:26.000000000 +0900
+++ a/arch/mips/Makefile	2005-08-09 23:35:48.000000000 +0900
@@ -554,14 +554,9 @@
 load-$(CONFIG_CASIO_E55)	+= 0xffffffff80004000
 
 #
-# TANBAC TB0226 Mbase (VR4131)
+# TANBAC TB0225 VR4131 Multi-chip module/TB0229 VR4131DIMM (VR4131)
 #
-load-$(CONFIG_TANBAC_TB0226)	+= 0xffffffff80000000
-
-#
-# TANBAC TB0229 VR4131DIMM (VR4131)
-#
-load-$(CONFIG_TANBAC_TB0229)	+= 0xffffffff80000000
+load-$(CONFIG_TANBAC_TB022X)	+= 0xffffffff80000000
 
 #
 # Common Philips PNX8550
diff -urN -X dontdiff a-orig/arch/mips/vr41xx/Kconfig a/arch/mips/vr41xx/Kconfig
--- a-orig/arch/mips/vr41xx/Kconfig	2005-07-16 04:16:55.000000000 +0900
+++ a/arch/mips/vr41xx/Kconfig	2005-08-09 23:58:10.000000000 +0900
@@ -38,8 +38,8 @@
 	select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
 	select SYS_SUPPORTS_LITTLE_ENDIAN
 
-config TANBAC_TB0226
-	bool "Support for TANBAC TB0226 (Mbase)"
+config TANBAC_TB022X
+	bool "Support for TANBAC TB0225 (VR4131 multichip module) and TB0229 (VR4131DIMM)"
 	depends on MACH_VR41XX
 	select DMA_NONCOHERENT
 	select HW_HAS_PCI
@@ -48,22 +48,19 @@
 	select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
 	select SYS_SUPPORTS_LITTLE_ENDIAN
 	help
-	  The TANBAC TB0226 (Mbase) is a MIPS-based platform manufactured by
-	  TANBAC.  Please refer to <http://www.tanbac.co.jp/> about Mbase.
+	  The TANBAC TB0225 (VR4131 multichip module) and TB0229 (VR4131DIMM)
+	  are MIPS-based platforms manufactured by TANBAC.
+	  Please refer to <http://www.tanbac.co.jp/> about
+	  VR4131 Multi-chip module and VR4131DIMM.
 
-config TANBAC_TB0229
-	bool "Support for TANBAC TB0229 (VR4131DIMM)"
-	depends on MACH_VR41XX
-	select DMA_NONCOHERENT
-	select HW_HAS_PCI
-	select IRQ_CPU
-	select SYS_SUPPORTS_32BIT_KERNEL
-	select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
-	select SYS_SUPPORTS_LITTLE_ENDIAN
+config TANBAC_TB0226
+	bool "Support for TANBAC TB0226 (Mbase)"
+	depends on TANBAC_TB022X
+	select PCI
+	select PCI_VR41XX
 	help
-	  The TANBAC TB0229 (VR4131DIMM) is a MIPS-based platform manufactured
-	  by TANBAC.  Please refer to <http://www.tanbac.co.jp/> about
-	  VR4131DIMM.
+	  The TANBAC TB0226 (Mbase) is a MIPS-based platform manufactured by
+	  TANBAC.  Please refer to <http://www.tanbac.co.jp/> about Mbase.
 
 config VICTOR_MPC30X
 	bool "Support for Victor MP-C303/304"
diff -urN -X dontdiff a-orig/drivers/char/Kconfig a/drivers/char/Kconfig
--- a-orig/drivers/char/Kconfig	2005-08-03 19:23:09.000000000 +0900
+++ a/drivers/char/Kconfig	2005-08-09 23:37:29.000000000 +0900
@@ -886,8 +886,14 @@
 	  module will be called sonypi.
 
 config TANBAC_TB0219
-	tristate "TANBAC TB0219 base board support"
-	depends TANBAC_TB0229
+	tristate "TANBAC TB0219 (VR4131DIMM-EK) Evaluation board support"
+	depends TANBAC_TB022X
+	select PCI
+	select PCI_VR41XX
+	help
+	  The TANBAC TB0219 (VR4131DIMM-EK) is a Evaluation board for VR4131DIMM
+	  manufactured by TANBAC.
+	  Please refer to <http://www.tanbac.co.jp/> about VR4131DIMM-EK.
 
 
 menu "Ftape, the floppy tape device driver"


From yuasa@hh.iij4u.or.jp Tue Aug  9 16:08:04 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 09 Aug 2005 16:08:23 +0100 (BST)
Received: from mo00.iij4u.or.jp ([IPv6:::ffff:210.130.0.19]:44799 "EHLO
	mo00.iij4u.or.jp") by linux-mips.org with ESMTP id <S8225201AbVHIPIE>;
	Tue, 9 Aug 2005 16:08:04 +0100
Received: MO(mo00)id j79FBviA026943; Wed, 10 Aug 2005 00:11:57 +0900 (JST)
Received: MDO(mdo00) id j79FBvf8027045; Wed, 10 Aug 2005 00:11:57 +0900 (JST)
Received: from stratos (h009.p499.iij4u.or.jp [210.149.243.9])
	by mbox.iij4u.or.jp (4U-MR/mbox01) id j79FBu33007428
	(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT);
	Wed, 10 Aug 2005 00:11:56 +0900 (JST)
Date:	Wed, 10 Aug 2005 00:11:55 +0900
From:	Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	yuasa@hh.iij4u.or.jp, linux-mips <linux-mips@linux-mips.org>
Subject: [PATCH 2.6][2/2] vr41xx: update GIU function call for TB0226
Message-Id: <20050810001155.1d65f9e8.yuasa@hh.iij4u.or.jp>
X-Mailer: Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yuasa@hh.iij4u.or.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8713
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: yuasa@hh.iij4u.or.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 3083
Lines: 100

Hi Ralf,

This patch has updated vr41xx GIU function call for TB0226.
Please apply this patch.

Yoichi

Signed-off-by: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>

diff -urN -X dontdiff a-orig/arch/mips/pci/fixup-tb0226.c a/arch/mips/pci/fixup-tb0226.c
--- a-orig/arch/mips/pci/fixup-tb0226.c	2004-11-01 01:07:33.000000000 +0900
+++ a/arch/mips/pci/fixup-tb0226.c	2005-08-10 00:00:20.000000000 +0900
@@ -1,7 +1,7 @@
 /*
  *  fixup-tb0226.c, The TANBAC TB0226 specific PCI fixups.
  *
- *  Copyright (C) 2002-2004  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
+ *  Copyright (C) 2002-2005  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
  *
  *  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
@@ -20,6 +20,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 
+#include <asm/vr41xx/giu.h>
 #include <asm/vr41xx/tb0226.h>
 
 int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
@@ -29,42 +30,42 @@
 	switch (slot) {
 	case 12:
 		vr41xx_set_irq_trigger(GD82559_1_PIN,
-				       TRIGGER_LEVEL,
-				       SIGNAL_THROUGH);
-		vr41xx_set_irq_level(GD82559_1_PIN, LEVEL_LOW);
+				       IRQ_TRIGGER_LEVEL,
+				       IRQ_SIGNAL_THROUGH);
+		vr41xx_set_irq_level(GD82559_1_PIN, IRQ_LEVEL_LOW);
 		irq = GD82559_1_IRQ;
 		break;
 	case 13:
 		vr41xx_set_irq_trigger(GD82559_2_PIN,
-				       TRIGGER_LEVEL,
-				       SIGNAL_THROUGH);
-		vr41xx_set_irq_level(GD82559_2_PIN, LEVEL_LOW);
+				       IRQ_TRIGGER_LEVEL,
+				       IRQ_SIGNAL_THROUGH);
+		vr41xx_set_irq_level(GD82559_2_PIN, IRQ_LEVEL_LOW);
 		irq = GD82559_2_IRQ;
 		break;
 	case 14:
 		switch (pin) {
 		case 1:
 			vr41xx_set_irq_trigger(UPD720100_INTA_PIN,
-					       TRIGGER_LEVEL,
-					       SIGNAL_THROUGH);
+					       IRQ_TRIGGER_LEVEL,
+					       IRQ_SIGNAL_THROUGH);
 			vr41xx_set_irq_level(UPD720100_INTA_PIN,
-					     LEVEL_LOW);
+					     IRQ_LEVEL_LOW);
 			irq = UPD720100_INTA_IRQ;
 			break;
 		case 2:
 			vr41xx_set_irq_trigger(UPD720100_INTB_PIN,
-					       TRIGGER_LEVEL,
-					       SIGNAL_THROUGH);
+					       IRQ_TRIGGER_LEVEL,
+					       IRQ_SIGNAL_THROUGH);
 			vr41xx_set_irq_level(UPD720100_INTB_PIN,
-					     LEVEL_LOW);
+					     IRQ_LEVEL_LOW);
 			irq = UPD720100_INTB_IRQ;
 			break;
 		case 3:
 			vr41xx_set_irq_trigger(UPD720100_INTC_PIN,
-					       TRIGGER_LEVEL,
-					       SIGNAL_THROUGH);
+					       IRQ_TRIGGER_LEVEL,
+					       IRQ_SIGNAL_THROUGH);
 			vr41xx_set_irq_level(UPD720100_INTC_PIN,
-					     LEVEL_LOW);
+					     IRQ_LEVEL_LOW);
 			irq = UPD720100_INTC_IRQ;
 			break;
 		default:
diff -urN -X dontdiff a-orig/arch/mips/vr41xx/Kconfig a/arch/mips/vr41xx/Kconfig
--- a-orig/arch/mips/vr41xx/Kconfig	2005-08-10 00:00:09.000000000 +0900
+++ a/arch/mips/vr41xx/Kconfig	2005-08-10 00:00:20.000000000 +0900
@@ -58,6 +58,7 @@
 	depends on TANBAC_TB022X
 	select PCI
 	select PCI_VR41XX
+	select GPIO_VR41XX
 	help
 	  The TANBAC TB0226 (Mbase) is a MIPS-based platform manufactured by
 	  TANBAC.  Please refer to <http://www.tanbac.co.jp/> about Mbase.



From mickylu@gmail.com Wed Aug 10 10:06:50 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 10 Aug 2005 10:07:12 +0100 (BST)
Received: from wproxy.gmail.com ([IPv6:::ffff:64.233.184.192]:42692 "EHLO
	wproxy.gmail.com") by linux-mips.org with ESMTP id <S8224991AbVHJJGu> convert rfc822-to-8bit;
	Wed, 10 Aug 2005 10:06:50 +0100
Received: by wproxy.gmail.com with SMTP id 70so93623wra
        for <linux-mips@linux-mips.org>; Wed, 10 Aug 2005 02:10:47 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition;
        b=XDzDFzX3SYXNaiQRFi1L5GHlksmW5mHacxrQ4JKS2yYvnsYFx5OHPl3AI7sqclpHWVUf8/4ue1kMiDys9/hahbE4lMQ4aMmJFBviK1Btl+z8aUy8wgabhFYQSuITe2EcLAwp4ErqpYX/OYpcp/i0hH1t3P3nXqp5Jw0rrMi34PI=
Received: by 10.54.30.60 with SMTP id d60mr318301wrd;
        Wed, 10 Aug 2005 02:10:47 -0700 (PDT)
Received: by 10.54.114.15 with HTTP; Wed, 10 Aug 2005 02:10:47 -0700 (PDT)
Message-ID: <c5511aaf05081002102c439fc3@mail.gmail.com>
Date:	Wed, 10 Aug 2005 17:10:47 +0800
From:	light lu <mickylu@gmail.com>
To:	linux-mips@linux-mips.org
Subject: Kernel 2.4.21 on BCM4780
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8BIT
Content-Disposition: inline
Return-Path: <mickylu@gmail.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8714
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: mickylu@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 6378
Lines: 154

Could anybody give me some advice on kernel 2.4.21 on BCM4780 porting?
 Thanks very much.

--Light


The console log is ,

CFE> boot -z -addr=0x80001000 -max=0x800000 -tftp 192.168.1.3:vmlinuz-2.4.21
Loader:raw Filesys:tftp Dev:eth0 File:192.168.1.3:vmlinuz-2.4.21 Options:(null)
Loading: .... 2232320 bytes read
Entry at 0x80001000
Closing network.
Starting program at 0x80001000
CPU revision is: 00029006
Primary instruction cache 16kB, physically tagged, 2-way, linesize 16 bytes.
Primary data cache 16kB 2-way, linesize 16 bytes.
Linux version 2.4.21 (lightlu@light.deb) (gcc version 3.0 20010422 (prerelease)5
BCM47XX ChipID = 0x4704, RevisionID = 8, Options = 0x2
Determined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
User-defined physical RAM map:
 memory: 01800000 @ 00000000 (usable)
On node 0 totalpages: 6144
zone(0): 6144 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/mtdblock5 noinitrd console=ttyS0,115200 mem=24M
CPU: BCM4704 rev 8 at 264 MHz
Calibrating delay loop... 263.78 BogoMIPS
Memory: 21868k/24576k available (1961k kernel code, 2708k reserved, 120k data, )
Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
Inode cache hash table entries: 2048 (order: 2, 16384 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
Checking for 'wait' instruction...  unavailable.
POSIX conformance testing by UNIFIX
PCI: Fixing up bus 0
PCI: Fixing up bridge
PCI: Fixing up bus 1
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Reserved instruction in kernel code in traps.c::do_ri, line 652:
$0 : 00000000 8027b000 8000c240 80210974 8027a000 ba2e8ba3 81006d14 c0000000
$8 : c0000000 8022b160 ffffffe0 00000018 8027424c fffffffb 0000000a 4e4d4c4b
$16: 8027a000 80205c00 80208000 00000000 00000020 0000c000 00000010 80205c00
$24: 00000008 00000001                   80268000 80269eb8 00000000 80026030
Hi : fffff892
Lo : 0000027a
epc  : 8000c244    Not tainted
Status: 1000fc03
Cause : 00000028
Process swapper (pid: 1, stackpage=80268000)
Stack:    8000178c 8002ef3c 00000000 fffffff4 c000c000 802012b0 8000178c
 00000000 8002f1ec 80041700 00000020 00000010 00000010 00000010 c0000000
 80205c00 c000c000 fffffff4 003fffff 8002f9c8 c0000000 8001294c 80235200
 802012b0 8000178c 43464531 00000020 00000010 00000010 00000010 00000000
 800642bc 00000020 000001f2 000007df 00000010 000007df 801f6198 802011e8
 801f6914 ...
Call Trace:   [<8000178c>] [<8002ef3c>] [<8000178c>] [<8002f1ec>] [<80041700>]
 [<8002f9c8>] [<8001294c>] [<8000178c>] [<800642bc>] [<801b7d54>] [<800238a4>]
 [<801d9e84>] [<8000178c>] [<8000179c>] [<80003274>] [<8001294c>] [<80003264>]
 [<8001453c>] [<800763f0>] [<80036a58>] [<800774c8>] [<80077794>]

Code: 00000000  00000000  24811000 <bc8d0000> ac800000  ac800004  ac800008  ac8
Kernel panic: Attempted to kill init!



ksymoops 2.4.11 on i686 2.6.8-1-686.  Options used
     -v vmlinux (specified)
     -k /proc/ksyms (default)
     -l /proc/modules (default)
     -o /lib/modules/2.6.8-1-686/ (default)
     -m System.map (specified)
     -t elf32-littlemips -a mips

Error (regular_file): read_ksyms stat /proc/ksyms failed
No modules in ksyms, skipping objects
No ksyms, skipping lsmod
$0 : 00000000 8027b000 8000c240 80210974 8027a000 ba2e8ba3 81006d14 c0000000
$8 : c0000000 8022b160 ffffffe0 00000018 8027424c fffffffb 0000000a 4e4d4c4b
$16: 8027a000 80205c00 80208000 00000000 00000020 0000c000 00000010 80205c00
$24: 00000008 00000001                   80268000 80269eb8 00000000 80026030
Hi : fffff892
Lo : 0000027a
epc  : 8000c244    Not tainted
Status: 1000fc03
Cause : 00000028
Process swapper (pid: 1, stackpage=80268000)
Stack:    8000178c 8002ef3c 00000000 fffffff4 c000c000 802012b0 8000178c
 00000000 8002f1ec 80041700 00000020 00000010 00000010 00000010 c0000000
 80205c00 c000c000 fffffff4 003fffff 8002f9c8 c0000000 8001294c 80235200
 802012b0 8000178c 43464531 00000020 00000010 00000010 00000010 00000000
 800642bc 00000020 000001f2 000007df 00000010 000007df 801f6198 802011e8
 801f6914 ...
Call Trace:   [<8000178c>] [<8002ef3c>] [<8000178c>] [<8002f1ec>] [<80041700>]
 [<8002f9c8>] [<8001294c>] [<8000178c>] [<800642bc>] [<801b7d54>] [<800238a4>]
 [<801d9e84>] [<8000178c>] [<8000179c>] [<80003274>] [<8001294c>] [<80003264>]
 [<8001453c>] [<800763f0>] [<80036a58>] [<800774c8>] [<80077794>]
Code: 00000000  00000000  24811000 <bc8d0000> ac800000  ac800004  ac800008  ac8
Error (Oops_code_values): invalid value 0xac8 in Code line, must be 2,
4, 8 or 16 digits, value ignored


>>$2; 8000c240 <r4k_clear_page32_d16+0/3c>
>>$3; 80210974 <contig_page_data+0/33c>
>>$9; 8022b160 <vmlist+0/10>
>>$17; 80205c00 <swapper_pg_dir+c00/1000>
>>$18; 80208000 <invalid_pte_table+0/1000>
>>$23; 80205c00 <swapper_pg_dir+c00/1000>
>>$28; 80268000 <_end+7f50/????>
>>$31; 80026030 <pte_alloc+cc/114>

>>PC;  8000c244 <r4k_clear_page32_d16+4/3c>   <=====

Trace; 8000178c <init+0/194>
Trace; 8002ef3c <get_vm_area+24/104>
Trace; 8000178c <init+0/194>
Trace; 8002f1ec <__vmalloc+130/2b4>
Trace; 80041700 <get_sb_nodev+30/e4>
Trace; 8002f9c8 <kmem_cache_create+e0/4c0>
Trace; 8001294c <kernel_thread+48/68>
Trace; 8000178c <init+0/194>
Trace; 800642bc <cramfs_uncompress_init+64/a8>
Trace; 801b7d54 <tvecs+7a4/9e0>
Trace; 800238a4 <start_context_thread+30/4c>
Trace; 801d9e84 <ohci_pci_ids+4bc8/5ad4>
Trace; 8000178c <init+0/194>
Trace; 8000179c <init+10/194>
Trace; 80003274 <arch_kernel_thread+44/74>
Trace; 8001294c <kernel_thread+48/68>
Trace; 80003264 <arch_kernel_thread+34/74>
Trace; 8001453c <release_console_sem+84/178>
Trace; 800763f0 <devfs_dealloc_devnum+14c/1c8>
Trace; 80036a58 <badness+98/110>
Trace; 800774c8 <parse_options+ec/61c>
Trace; 80077794 <parse_options+3b8/61c>

Code;  8000c238 <mips32_flush_cache_all_pc+c8/d0>
00000000 <_PC>:
Code;  8000c240 <r4k_clear_page32_d16+0/3c>
   8:   24811000  addiu   at,a0,4096
Code;  8000c244 <r4k_clear_page32_d16+4/3c>   <=====
   c:   bc8d0000  0xbc8d0000   <=====
Code;  8000c248 <r4k_clear_page32_d16+8/3c>
  10:   ac800000  sw      zero,0(a0)
Code;  8000c24c <r4k_clear_page32_d16+c/3c>
  14:   ac800004  sw      zero,4(a0)
Code;  8000c250 <r4k_clear_page32_d16+10/3c>
  18:   ac800008  sw      zero,8(a0)

From greg.weeks@timesys.com Wed Aug 10 14:36:36 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 10 Aug 2005 14:36:51 +0100 (BST)
Received: from mail.timesys.com ([IPv6:::ffff:65.117.135.102]:17851 "EHLO
	exchange.timesys.com") by linux-mips.org with ESMTP
	id <S8225228AbVHJNgg>; Wed, 10 Aug 2005 14:36:36 +0100
Received: from [192.168.2.27] ([192.168.2.27]) by exchange.timesys.com with Microsoft SMTPSVC(5.0.2195.6713);
	 Wed, 10 Aug 2005 09:30:28 -0400
Message-ID: <42FA03D4.5060400@timesys.com>
Date:	Wed, 10 Aug 2005 09:40:36 -0400
From:	Greg Weeks <greg.weeks@timesys.com>
User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: 24K malta
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 10 Aug 2005 13:30:28.0890 (UTC) FILETIME=[AC80FFA0:01C59DAF]
Return-Path: <greg.weeks@timesys.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8715
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: greg.weeks@timesys.com
Precedence: bulk
X-list: linux-mips
Content-Length: 619
Lines: 17

I'm seeing something strange on a 24K malta and I'm wondering if anyone 
else has ran into something like it.

This is a 2.6.12 based kernel. I've not had a chance to try the current 
CVS yet. The last time I checked the current CVS didn't boot as is on a 
4Kc malta so I've not been keeping current with CVS.

When I try a simple

strace ls

I either hang or seg fault on a 24Kc or 24Kec processor, but a 4Kc or 
4Kec works. If I turn off the cache on the 24K it works as well. Without 
cache it's unbearably slow of course. This is the same exact build of 
the kernel and root file system for all boards.

Greg Weeks

From ralf@linux-mips.org Wed Aug 10 14:58:46 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 10 Aug 2005 14:59:02 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:32778 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225233AbVHJN6q>; Wed, 10 Aug 2005 14:58:46 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7AE2iSv012086;
	Wed, 10 Aug 2005 15:02:44 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7AE2hWl012085;
	Wed, 10 Aug 2005 15:02:43 +0100
Date:	Wed, 10 Aug 2005 15:02:43 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Greg Weeks <greg.weeks@timesys.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: 24K malta
Message-ID: <20050810140243.GD2840@linux-mips.org>
References: <42FA03D4.5060400@timesys.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <42FA03D4.5060400@timesys.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8716
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 762
Lines: 21

On Wed, Aug 10, 2005 at 09:40:36AM -0400, Greg Weeks wrote:

> I'm seeing something strange on a 24K malta and I'm wondering if anyone 
> else has ran into something like it.
> 
> This is a 2.6.12 based kernel. I've not had a chance to try the current 
> CVS yet. The last time I checked the current CVS didn't boot as is on a 
> 4Kc malta so I've not been keeping current with CVS.
> 
> When I try a simple
> 
> strace ls
> 
> I either hang or seg fault on a 24Kc or 24Kec processor, but a 4Kc or 
> 4Kec works. If I turn off the cache on the 24K it works as well. Without 
> cache it's unbearably slow of course. This is the same exact build of 
> the kernel and root file system for all boards.

I cannot reproduce this problem on 24KEc Malta, sorry.

  Ralf

From greg.weeks@timesys.com Wed Aug 10 15:09:48 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 10 Aug 2005 15:10:07 +0100 (BST)
Received: from mail.timesys.com ([IPv6:::ffff:65.117.135.102]:9303 "EHLO
	exchange.timesys.com") by linux-mips.org with ESMTP
	id <S8225228AbVHJOJs>; Wed, 10 Aug 2005 15:09:48 +0100
Received: from [192.168.2.27] ([192.168.2.27]) by exchange.timesys.com with Microsoft SMTPSVC(5.0.2195.6713);
	 Wed, 10 Aug 2005 10:03:42 -0400
Message-ID: <42FA0B9E.4030900@timesys.com>
Date:	Wed, 10 Aug 2005 10:13:50 -0400
From:	Greg Weeks <greg.weeks@timesys.com>
User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	Ralf Baechle <ralf@linux-mips.org>
CC:	linux-mips@linux-mips.org
Subject: Re: 24K malta
References: <42FA03D4.5060400@timesys.com> <20050810140243.GD2840@linux-mips.org>
In-Reply-To: <20050810140243.GD2840@linux-mips.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 10 Aug 2005 14:03:42.0421 (UTC) FILETIME=[50BDB050:01C59DB4]
Return-Path: <greg.weeks@timesys.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8717
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: greg.weeks@timesys.com
Precedence: bulk
X-list: linux-mips
Content-Length: 870
Lines: 32

Ralf Baechle wrote:

>On Wed, Aug 10, 2005 at 09:40:36AM -0400, Greg Weeks wrote:
>
>  
>
>>I'm seeing something strange on a 24K malta and I'm wondering if anyone 
>>else has ran into something like it.
>>
>>This is a 2.6.12 based kernel. I've not had a chance to try the current 
>>CVS yet. The last time I checked the current CVS didn't boot as is on a 
>>4Kc malta so I've not been keeping current with CVS.
>>
>>When I try a simple
>>
>>strace ls
>>
>>I either hang or seg fault on a 24Kc or 24Kec processor, but a 4Kc or 
>>4Kec works. If I turn off the cache on the 24K it works as well. Without 
>>cache it's unbearably slow of course. This is the same exact build of 
>>the kernel and root file system for all boards.
>>    
>>
>
>I cannot reproduce this problem on 24KEc Malta, sorry.
>  
>
Good. That means it's something in my old tree.

Thanks.

Greg Weeks

From greg.weeks@timesys.com Wed Aug 10 15:41:35 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 10 Aug 2005 15:41:54 +0100 (BST)
Received: from mail.timesys.com ([IPv6:::ffff:65.117.135.102]:28143 "EHLO
	exchange.timesys.com") by linux-mips.org with ESMTP
	id <S8225234AbVHJOlf>; Wed, 10 Aug 2005 15:41:35 +0100
Received: from [192.168.2.27] ([192.168.2.27]) by exchange.timesys.com with Microsoft SMTPSVC(5.0.2195.6713);
	 Wed, 10 Aug 2005 10:35:29 -0400
Message-ID: <42FA1311.4060903@timesys.com>
Date:	Wed, 10 Aug 2005 10:45:37 -0400
From:	Greg Weeks <greg.weeks@timesys.com>
User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	Ralf Baechle <ralf@linux-mips.org>
CC:	linux-mips@linux-mips.org
Subject: Re: 24K malta
References: <42FA03D4.5060400@timesys.com> <20050810140243.GD2840@linux-mips.org> <42FA0B9E.4030900@timesys.com>
In-Reply-To: <42FA0B9E.4030900@timesys.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 10 Aug 2005 14:35:29.0687 (UTC) FILETIME=[C18F6270:01C59DB8]
Return-Path: <greg.weeks@timesys.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8718
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: greg.weeks@timesys.com
Precedence: bulk
X-list: linux-mips
Content-Length: 239
Lines: 10

Current CVS fails to build the malta_defconfig with:


scripts/kconfig/mconf arch/mips/Kconfig
arch/mips/Kconfig:690: can't open file "arch/mips/tx4938/Kconfig"
make[1]: *** [menuconfig] Error 1
make: *** [menuconfig] Error 2


Greg Weeks

From ralf@linux-mips.org Wed Aug 10 15:45:49 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 10 Aug 2005 15:46:04 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:34581 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225234AbVHJOpt>; Wed, 10 Aug 2005 15:45:49 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7AEnmGG013673;
	Wed, 10 Aug 2005 15:49:48 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7AEnlxL013672;
	Wed, 10 Aug 2005 15:49:47 +0100
Date:	Wed, 10 Aug 2005 15:49:47 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Greg Weeks <greg.weeks@timesys.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: 24K malta
Message-ID: <20050810144947.GE2840@linux-mips.org>
References: <42FA03D4.5060400@timesys.com> <20050810140243.GD2840@linux-mips.org> <42FA0B9E.4030900@timesys.com> <42FA1311.4060903@timesys.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <42FA1311.4060903@timesys.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8719
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 386
Lines: 13

On Wed, Aug 10, 2005 at 10:45:37AM -0400, Greg Weeks wrote:

> Current CVS fails to build the malta_defconfig with:
> 
> 
> scripts/kconfig/mconf arch/mips/Kconfig
> arch/mips/Kconfig:690: can't open file "arch/mips/tx4938/Kconfig"
> make[1]: *** [menuconfig] Error 1
> make: *** [menuconfig] Error 2

CVS pilot error.  cvs -q update -d -P and don't forget to bitch about it ;)

  Ralf

From greg.weeks@timesys.com Wed Aug 10 15:56:38 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 10 Aug 2005 15:56:54 +0100 (BST)
Received: from mail.timesys.com ([IPv6:::ffff:65.117.135.102]:43302 "EHLO
	exchange.timesys.com") by linux-mips.org with ESMTP
	id <S8225234AbVHJO4i>; Wed, 10 Aug 2005 15:56:38 +0100
Received: from [192.168.2.27] ([192.168.2.27]) by exchange.timesys.com with Microsoft SMTPSVC(5.0.2195.6713);
	 Wed, 10 Aug 2005 10:50:32 -0400
Message-ID: <42FA1698.2060104@timesys.com>
Date:	Wed, 10 Aug 2005 11:00:40 -0400
From:	Greg Weeks <greg.weeks@timesys.com>
User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	Ralf Baechle <ralf@linux-mips.org>
CC:	linux-mips@linux-mips.org
Subject: Re: 24K malta
References: <42FA03D4.5060400@timesys.com> <20050810140243.GD2840@linux-mips.org> <42FA0B9E.4030900@timesys.com> <42FA1311.4060903@timesys.com> <20050810144947.GE2840@linux-mips.org>
In-Reply-To: <20050810144947.GE2840@linux-mips.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 10 Aug 2005 14:50:32.0578 (UTC) FILETIME=[DBB99E20:01C59DBA]
Return-Path: <greg.weeks@timesys.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8720
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: greg.weeks@timesys.com
Precedence: bulk
X-list: linux-mips
Content-Length: 816
Lines: 32

Ralf Baechle wrote:

>On Wed, Aug 10, 2005 at 10:45:37AM -0400, Greg Weeks wrote:
>
>  
>
>>Current CVS fails to build the malta_defconfig with:
>>
>>
>>scripts/kconfig/mconf arch/mips/Kconfig
>>arch/mips/Kconfig:690: can't open file "arch/mips/tx4938/Kconfig"
>>make[1]: *** [menuconfig] Error 1
>>make: *** [menuconfig] Error 2
>>    
>>
>
>CVS pilot error.  cvs -q update -d -P and don't forget to bitch about it ;)
>
>  
>
Would bitching about it do any good? I expect I'd just get told to stick 
it in my .cvsrc which is what I just did.

Now I get this:

  AS      arch/mips/kernel/r4k_switch.o
  CC      arch/mips/kernel/vpe.o
{standard input}: Assembler messages:
{standard input}:1329: Error: unrecognized opcode `mftc0 $7,$2,4'
{standard input}:1333: Error: unrecognized opcode `mftc0 $6,$2,1'

Greg Weeks

From ths@networkno.de Wed Aug 10 15:58:40 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 10 Aug 2005 15:58:55 +0100 (BST)
Received: from mx02.qsc.de ([IPv6:::ffff:213.148.130.14]:52196 "EHLO
	mx02.qsc.de") by linux-mips.org with ESMTP id <S8225240AbVHJO6k>;
	Wed, 10 Aug 2005 15:58:40 +0100
Received: from port-195-158-169-137.dynamic.qsc.de ([195.158.169.137] helo=hattusa.textio)
	by mx02.qsc.de with esmtp (Exim 3.35 #1)
	id 1E2s6A-0002J9-00; Wed, 10 Aug 2005 17:02:30 +0200
Received: from ths by hattusa.textio with local (Exim 4.52)
	id 1E2s6A-0003Jb-9a; Wed, 10 Aug 2005 17:02:30 +0200
Date:	Wed, 10 Aug 2005 17:02:30 +0200
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	Greg Weeks <greg.weeks@timesys.com>, linux-mips@linux-mips.org
Subject: Re: 24K malta
Message-ID: <20050810150230.GC1638@hattusa.textio>
References: <42FA03D4.5060400@timesys.com> <20050810140243.GD2840@linux-mips.org> <42FA0B9E.4030900@timesys.com> <42FA1311.4060903@timesys.com> <20050810144947.GE2840@linux-mips.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050810144947.GE2840@linux-mips.org>
User-Agent: Mutt/1.5.9i
From:	Thiemo Seufer <ths@networkno.de>
Return-Path: <ths@networkno.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8721
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ths@networkno.de
Precedence: bulk
X-list: linux-mips
Content-Length: 613
Lines: 25

Ralf Baechle wrote:
> On Wed, Aug 10, 2005 at 10:45:37AM -0400, Greg Weeks wrote:
> 
> > Current CVS fails to build the malta_defconfig with:
> > 
> > 
> > scripts/kconfig/mconf arch/mips/Kconfig
> > arch/mips/Kconfig:690: can't open file "arch/mips/tx4938/Kconfig"
> > make[1]: *** [menuconfig] Error 1
> > make: *** [menuconfig] Error 2
> 
> CVS pilot error.  cvs -q update -d -P and don't forget to bitch about it ;)

The CVS authors should have made some sane global defaults. I use this
~/.cvsrc to make it less annoying:

hattusa:~$ cat .cvsrc
cvs -qz9
diff -upNR
rdiff -uR
update -dPR
checkout -P


Thiemo

From ralf@linux-mips.org Wed Aug 10 16:05:36 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 10 Aug 2005 16:05:55 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:14089 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225244AbVHJPFg>; Wed, 10 Aug 2005 16:05:36 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7AF9ZgR014407;
	Wed, 10 Aug 2005 16:09:35 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7AF9Yq9014406;
	Wed, 10 Aug 2005 16:09:34 +0100
Date:	Wed, 10 Aug 2005 16:09:34 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Greg Weeks <greg.weeks@timesys.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: 24K malta
Message-ID: <20050810150934.GF2840@linux-mips.org>
References: <42FA03D4.5060400@timesys.com> <20050810140243.GD2840@linux-mips.org> <42FA0B9E.4030900@timesys.com> <42FA1311.4060903@timesys.com> <20050810144947.GE2840@linux-mips.org> <42FA1698.2060104@timesys.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <42FA1698.2060104@timesys.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8722
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 527
Lines: 15

On Wed, Aug 10, 2005 at 11:00:40AM -0400, Greg Weeks wrote:

> Now I get this:
> 
>  AS      arch/mips/kernel/r4k_switch.o
>  CC      arch/mips/kernel/vpe.o
> {standard input}: Assembler messages:
> {standard input}:1329: Error: unrecognized opcode `mftc0 $7,$2,4'
> {standard input}:1333: Error: unrecognized opcode `mftc0 $6,$2,1'

You have CONFIG_MT enabled but your binutils don't support these new
instructions yet.  Since you're using 4K and 24K CPUs only ATM I think
you should simply disable CONFIG_MT for now.

  Ralf

From greg.weeks@timesys.com Wed Aug 10 16:10:05 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 10 Aug 2005 16:10:21 +0100 (BST)
Received: from mail.timesys.com ([IPv6:::ffff:65.117.135.102]:15734 "EHLO
	exchange.timesys.com") by linux-mips.org with ESMTP
	id <S8225244AbVHJPKE>; Wed, 10 Aug 2005 16:10:04 +0100
Received: from [192.168.2.27] ([192.168.2.27]) by exchange.timesys.com with Microsoft SMTPSVC(5.0.2195.6713);
	 Wed, 10 Aug 2005 11:03:59 -0400
Message-ID: <42FA19BF.7040208@timesys.com>
Date:	Wed, 10 Aug 2005 11:14:07 -0400
From:	Greg Weeks <greg.weeks@timesys.com>
User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	Ralf Baechle <ralf@linux-mips.org>
CC:	linux-mips@linux-mips.org
Subject: Re: 24K malta
References: <42FA03D4.5060400@timesys.com> <20050810140243.GD2840@linux-mips.org> <42FA0B9E.4030900@timesys.com> <42FA1311.4060903@timesys.com> <20050810144947.GE2840@linux-mips.org> <42FA1698.2060104@timesys.com> <20050810150934.GF2840@linux-mips.org>
In-Reply-To: <20050810150934.GF2840@linux-mips.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 10 Aug 2005 15:03:59.0218 (UTC) FILETIME=[BC851D20:01C59DBC]
Return-Path: <greg.weeks@timesys.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8723
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: greg.weeks@timesys.com
Precedence: bulk
X-list: linux-mips
Content-Length: 919
Lines: 33

Ralf Baechle wrote:

>On Wed, Aug 10, 2005 at 11:00:40AM -0400, Greg Weeks wrote:
>
>  
>
>>Now I get this:
>>
>> AS      arch/mips/kernel/r4k_switch.o
>> CC      arch/mips/kernel/vpe.o
>>{standard input}: Assembler messages:
>>{standard input}:1329: Error: unrecognized opcode `mftc0 $7,$2,4'
>>{standard input}:1333: Error: unrecognized opcode `mftc0 $6,$2,1'
>>    
>>
>
>You have CONFIG_MT enabled but your binutils don't support these new
>instructions yet.  Since you're using 4K and 24K CPUs only ATM I think
>you should simply disable CONFIG_MT for now.
>
>  
>
Just turning off the vpe loading support got me past this one. I don't 
think I have CONFIG_MT set.

[gweeks@tanith linux-8-10-05]$ grep CONFIG_MT .config
# CONFIG_MTD is not set
[gweeks@tanith linux-8-10-05]$ cd arch/mips/configs/
[gweeks@tanith configs]$ grep CONFIG_MT malta_defconfig
# CONFIG_MTD is not set
[gweeks@tanith configs]$

Greg Weeks

From ralf@linux-mips.org Wed Aug 10 16:11:41 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 10 Aug 2005 16:12:00 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:6152 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225244AbVHJPLl>; Wed, 10 Aug 2005 16:11:41 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7AFFeqT014628;
	Wed, 10 Aug 2005 16:15:40 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7AFFdI1014627;
	Wed, 10 Aug 2005 16:15:39 +0100
Date:	Wed, 10 Aug 2005 16:15:39 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Greg Weeks <greg.weeks@timesys.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: 24K malta
Message-ID: <20050810151539.GG2840@linux-mips.org>
References: <42FA03D4.5060400@timesys.com> <20050810140243.GD2840@linux-mips.org> <42FA0B9E.4030900@timesys.com> <42FA1311.4060903@timesys.com> <20050810144947.GE2840@linux-mips.org> <42FA1698.2060104@timesys.com> <20050810150934.GF2840@linux-mips.org> <42FA19BF.7040208@timesys.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <42FA19BF.7040208@timesys.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8724
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 412
Lines: 14

On Wed, Aug 10, 2005 at 11:14:07AM -0400, Greg Weeks wrote:

> >You have CONFIG_MT enabled but your binutils don't support these new
> >instructions yet.  Since you're using 4K and 24K CPUs only ATM I think
> >you should simply disable CONFIG_MT for now.
> >
> > 
> >
> Just turning off the vpe loading support got me past this one. I don't 
> think I have CONFIG_MT set.

Sorry, I meant CONFIG_MIPS_MT.

  Ralf

From tmnousia@twilight.cs.hut.fi Wed Aug 10 16:27:28 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 10 Aug 2005 16:28:05 +0100 (BST)
Received: from twilight.cs.hut.fi ([IPv6:::ffff:130.233.40.5]:37537 "EHLO
	twilight.cs.hut.fi") by linux-mips.org with ESMTP
	id <S8225248AbVHJP12>; Wed, 10 Aug 2005 16:27:28 +0100
Received: by twilight.cs.hut.fi (Postfix, from userid 60001)
	id DF29A2D73; Wed, 10 Aug 2005 18:31:24 +0300 (EEST)
Received: from kekkonen.cs.hut.fi (kekkonen.cs.hut.fi [130.233.41.50])
	by twilight.cs.hut.fi (Postfix) with ESMTP id 23F832D71
	for <linux-mips@linux-mips.org>; Wed, 10 Aug 2005 18:31:19 +0300 (EEST)
Received: (from tmnousia@localhost)
	by kekkonen.cs.hut.fi (8.11.7p1+Sun/8.10.2) id j7AFVIH01521;
	Wed, 10 Aug 2005 18:31:18 +0300 (EEST)
Date:	Wed, 10 Aug 2005 18:31:18 +0300 (EEST)
From:	turja@mbnet.fi
X-X-Sender: tmnousia@kekkonen.cs.hut.fi
Reply-To: turja@mbnet.fi
To:	linux-mips@linux-mips.org
Subject: [PATCH] New Indy VINO video drivers
Message-ID: <Pine.GSO.4.58.0508101819430.788@kekkonen.cs.hut.fi>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Return-Path: <tmnousia@twilight.cs.hut.fi>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8725
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: turja@mbnet.fi
Precedence: bulk
X-list: linux-mips
Content-Length: 144449
Lines: 5740

The patch is against the current HEAD and it contains the new VINO video
drivers for 2.6 kernels.

More information can be found from: http://www.mbnet.fi/~turja/vino/

Mikael Nousiainen


diff -urN a/drivers/media/video/indycam.c b/drivers/media/video/indycam.c
--- a/drivers/media/video/indycam.c	1970-01-01 02:00:00.000000000 +0200
+++ b/drivers/media/video/indycam.c	2005-08-10 17:49:40.000000000 +0300
@@ -0,0 +1,412 @@
+/*
+ *  indycam.c - Silicon Graphics IndyCam digital camera driver
+ *
+ *  Copyright (C) 2003 Ladislav Michl <ladis@linux-mips.org>
+ *  Copyright (C) 2004,2005 Mikael Nousiainen <tmnousia@cc.hut.fi>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/errno.h>
+#include <linux/fs.h>
+#include <linux/kernel.h>
+#include <linux/major.h>
+#include <linux/slab.h>
+#include <linux/mm.h>
+#include <linux/sched.h>
+
+#include <linux/videodev.h>
+/* IndyCam decodes stream of photons into digital image representation ;-) */
+#include <linux/video_decoder.h>
+#include <linux/i2c.h>
+
+#include "indycam.h"
+
+//#define INDYCAM_DEBUG
+
+#define INDYCAM_MODULE_VERSION "0.0.3"
+
+MODULE_DESCRIPTION("SGI IndyCam driver");
+MODULE_VERSION(INDYCAM_MODULE_VERSION);
+MODULE_AUTHOR("Mikael Nousiainen <tmnousia@cc.hut.fi>");
+MODULE_LICENSE("GPL");
+
+#ifdef INDYCAM_DEBUG
+#define dprintk(x...) printk("IndyCam: " x);
+#define indycam_regdump(client) indycam_regdump_debug(client)
+#else
+#define dprintk(x...)
+#define indycam_regdump(client)
+#endif
+
+#define VINO_ADAPTER	(I2C_ALGO_SGI | I2C_HW_SGI_VINO)
+
+struct indycam {
+	struct i2c_client *client;
+	int version;
+};
+
+static struct i2c_driver i2c_driver_indycam;
+
+static const unsigned char initseq[] = {
+	INDYCAM_CONTROL_AGCENA,		/* INDYCAM_CONTROL */
+	INDYCAM_SHUTTER_DEFAULT,	/* INDYCAM_SHUTTER */
+	INDYCAM_GAIN_DEFAULT,		/* INDYCAM_GAIN */
+	0x00,				/* INDYCAM_BRIGHTNESS (read-only) */
+	INDYCAM_RED_BALANCE_DEFAULT,	/* INDYCAM_RED_BALANCE */
+	INDYCAM_BLUE_BALANCE_DEFAULT,	/* INDYCAM_BLUE_BALANCE */
+	INDYCAM_RED_SATURATION_DEFAULT,	/* INDYCAM_RED_SATURATION */
+	INDYCAM_BLUE_SATURATION_DEFAULT,/* INDYCAM_BLUE_SATURATION */
+};
+
+/* IndyCam register handling */
+
+static int indycam_read_reg(struct i2c_client *client, unsigned char reg,
+			     unsigned char *value)
+{
+	int ret;
+
+	if (reg == INDYCAM_RESET) {
+		dprintk("indycam_read_reg(): "
+			"skipping write-only register %d\n", reg);
+		*value = 0;
+		return 0;
+	}
+
+	ret = i2c_smbus_read_byte_data(client, reg);
+	if (ret < 0) {
+		printk(KERN_ERR "IndyCam: indycam_read_reg(): read failed, "
+		       "register = 0x%02x\n", reg);
+		return ret;
+	}
+
+	*value = (unsigned char)ret;
+
+	return 0;
+}
+
+static int indycam_write_reg(struct i2c_client *client, unsigned char reg,
+			     unsigned char value)
+{
+	int err;
+
+	if ((reg == INDYCAM_BRIGHTNESS)
+	    || (reg == INDYCAM_VERSION)) {
+		dprintk("indycam_write_reg(): "
+			"skipping read-only register %d\n", reg);
+		return 0;
+	}
+
+	dprintk("Writing Reg %d = 0x%02x\n", reg, value);
+	err = i2c_smbus_write_byte_data(client, reg, value);
+	if (err) {
+		printk(KERN_ERR "IndyCam: indycam_write_reg(): write failed, "
+		       "register = 0x%02x, value = 0x%02x\n", reg, value);
+	}
+	return err;
+}
+
+static int indycam_write_block(struct i2c_client *client, unsigned char reg,
+				unsigned char length, unsigned char *data)
+{
+	unsigned char i;
+	int err;
+
+	for (i = reg; i < length; i++) {
+		err = indycam_write_reg(client, reg + i, data[i]);
+		if (err)
+			return err;
+	}
+
+	return 0;
+}
+
+/* Helper functions */
+
+#ifdef INDYCAM_DEBUG
+static void indycam_regdump_debug(struct i2c_client *client)
+{
+	int i;
+	unsigned char val;
+
+	for (i = 0; i < 9; i++) {
+		indycam_read_reg(client, i, &val);
+		dprintk("Reg %d = 0x%02x\n", i, val);
+	}
+}
+#endif
+
+static int indycam_get_controls(struct i2c_client *client,
+				struct indycam_control *ctrl)
+{
+	unsigned char ctrl_reg;
+
+	indycam_read_reg(client, INDYCAM_CONTROL, &ctrl_reg);
+	ctrl->agc = (ctrl_reg & INDYCAM_CONTROL_AGCENA)
+		? INDYCAM_VALUE_ENABLED
+		: INDYCAM_VALUE_DISABLED;
+	ctrl->awb = (ctrl_reg & INDYCAM_CONTROL_AWBCTL)
+		? INDYCAM_VALUE_ENABLED
+		: INDYCAM_VALUE_DISABLED;
+	indycam_read_reg(client, INDYCAM_SHUTTER,
+			 (unsigned char *)&ctrl->shutter);
+	indycam_read_reg(client, INDYCAM_GAIN,
+			 (unsigned char *)&ctrl->gain);
+	indycam_read_reg(client, INDYCAM_RED_BALANCE,
+			 (unsigned char *)&ctrl->red_balance);
+	indycam_read_reg(client, INDYCAM_BLUE_BALANCE,
+			 (unsigned char *)&ctrl->blue_balance);
+	indycam_read_reg(client, INDYCAM_RED_SATURATION,
+			 (unsigned char *)&ctrl->red_saturation);
+	indycam_read_reg(client, INDYCAM_BLUE_SATURATION,
+			 (unsigned char *)&ctrl->blue_saturation);
+	indycam_read_reg(client, INDYCAM_GAMMA,
+			 (unsigned char *)&ctrl->gamma);
+
+	return 0;
+}
+
+static int indycam_set_controls(struct i2c_client *client,
+				struct indycam_control *ctrl)
+{
+	unsigned char ctrl_reg;
+
+	indycam_read_reg(client, INDYCAM_CONTROL, &ctrl_reg);
+	if (ctrl->agc != INDYCAM_VALUE_UNCHANGED) {
+		if (ctrl->agc)
+			ctrl_reg |= INDYCAM_CONTROL_AGCENA;
+		else
+			ctrl_reg &= ~INDYCAM_CONTROL_AGCENA;
+	}
+	if (ctrl->awb != INDYCAM_VALUE_UNCHANGED) {
+		if (ctrl->awb)
+			ctrl_reg |= INDYCAM_CONTROL_AWBCTL;
+		else
+			ctrl_reg &= ~INDYCAM_CONTROL_AWBCTL;
+	}
+	indycam_write_reg(client, INDYCAM_CONTROL, ctrl_reg);
+
+	if (ctrl->shutter >= 0)
+		indycam_write_reg(client, INDYCAM_SHUTTER, ctrl->shutter);
+	if (ctrl->gain >= 0)
+		indycam_write_reg(client, INDYCAM_GAIN, ctrl->gain);
+	if (ctrl->red_balance >= 0)
+		indycam_write_reg(client, INDYCAM_RED_BALANCE,
+				  ctrl->red_balance);
+	if (ctrl->blue_balance >= 0)
+		indycam_write_reg(client, INDYCAM_BLUE_BALANCE,
+				  ctrl->blue_balance);
+	if (ctrl->red_saturation >= 0)
+		indycam_write_reg(client, INDYCAM_RED_SATURATION,
+				  ctrl->red_saturation);
+	if (ctrl->blue_saturation >= 0)
+		indycam_write_reg(client, INDYCAM_BLUE_SATURATION,
+				  ctrl->blue_saturation);
+	if (ctrl->gamma >= 0)
+		indycam_write_reg(client, INDYCAM_GAMMA, ctrl->gamma);
+
+	return 0;
+}
+
+/* I2C-interface */
+
+static int indycam_attach(struct i2c_adapter *adap, int addr, int kind)
+{
+	int err = 0;
+	struct indycam *camera;
+	struct i2c_client *client;
+
+	printk(KERN_INFO "SGI IndyCam driver version %s\n",
+	       INDYCAM_MODULE_VERSION);
+
+	client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
+	if (!client)
+		return -ENOMEM;
+	camera = kmalloc(sizeof(struct indycam), GFP_KERNEL);
+	if (!camera) {
+		err = -ENOMEM;
+		goto out_free_client;
+	}
+
+	memset(client, 0, sizeof(struct i2c_client));
+	memset(camera, 0, sizeof(struct indycam));
+
+	client->addr = addr;
+	client->adapter = adap;
+	client->driver = &i2c_driver_indycam;
+	client->flags = 0;
+	strcpy(client->name, "IndyCam client");
+	i2c_set_clientdata(client, camera);
+
+	camera->client = client;
+
+	err = i2c_attach_client(client);
+	if (err)
+		goto out_free_camera;
+
+	camera->version = i2c_smbus_read_byte_data(client, INDYCAM_VERSION);
+	if (camera->version != CAMERA_VERSION_INDY &&
+	    camera->version != CAMERA_VERSION_MOOSE) {
+		err = -ENODEV;
+		goto out_detach_client;
+	}
+	printk(KERN_INFO "IndyCam v%d.%d detected\n",
+	       INDYCAM_VERSION_MAJOR(camera->version),
+	       INDYCAM_VERSION_MINOR(camera->version));
+
+	indycam_regdump(client);
+
+	// initialize
+	err = indycam_write_block(client, 0, sizeof(initseq),
+				  (unsigned char *)&initseq);
+	if (err) {
+		printk(KERN_ERR "IndyCam initalization failed\n");
+		err = -EIO;
+		goto out_detach_client;
+	}
+
+	indycam_regdump(client);
+
+	// white balance
+	err = indycam_write_reg(client, INDYCAM_CONTROL,
+			  INDYCAM_CONTROL_AGCENA | INDYCAM_CONTROL_AWBCTL);
+	if (err) {
+		printk(KERN_ERR "IndyCam white balance "
+		       "initialization failed\n");
+		err = -EIO;
+		goto out_detach_client;
+	}
+
+	indycam_regdump(client);
+
+	printk(KERN_INFO "IndyCam initialized\n");
+
+	return 0;
+
+out_detach_client:
+	i2c_detach_client(client);
+out_free_camera:
+	kfree(camera);
+out_free_client:
+	kfree(client);
+	return err;
+}
+
+static int indycam_probe(struct i2c_adapter *adap)
+{
+	/* Indy specific crap */
+	if (adap->id == VINO_ADAPTER)
+		return indycam_attach(adap, INDYCAM_ADDR, 0);
+	/* Feel free to add probe here :-) */
+	return -ENODEV;
+}
+
+static int indycam_detach(struct i2c_client *client)
+{
+	struct indycam *camera = i2c_get_clientdata(client);
+
+	i2c_detach_client(client);
+	kfree(camera);
+	kfree(client);
+	return 0;
+}
+
+static int indycam_command(struct i2c_client *client, unsigned int cmd,
+			   void *arg)
+{
+	// struct indycam *camera = i2c_get_clientdata(client);
+
+	/* The old video_decoder interface just isn't enough,
+	 * so we'll use some custom commands. */
+	switch (cmd) {
+	case DECODER_GET_CAPABILITIES: {
+		struct video_decoder_capability *cap = arg;
+
+		cap->flags  = VIDEO_DECODER_NTSC;
+		cap->inputs = 1;
+		cap->outputs = 1;
+		break;
+	}
+	case DECODER_GET_STATUS: {
+		int *iarg = arg;
+
+		*iarg = DECODER_STATUS_GOOD | DECODER_STATUS_NTSC |
+			DECODER_STATUS_COLOR;
+		break;
+	}
+	case DECODER_SET_NORM: {
+		int *iarg = arg;
+
+		switch (*iarg) {
+		case VIDEO_MODE_NTSC:
+			break;
+		default:
+			return -EINVAL;
+		}
+		break;
+	}
+	case DECODER_SET_INPUT:	{
+		int *iarg = arg;
+
+		if (*iarg != 0)
+			return -EINVAL;
+		break;
+	}
+	case DECODER_SET_OUTPUT: {
+		int *iarg = arg;
+
+		if (*iarg != 0)
+			return -EINVAL;
+		break;
+	}
+	case DECODER_ENABLE_OUTPUT: {
+		/* Always enabled */
+		break;
+	}
+	case DECODER_SET_PICTURE: {
+		// struct video_picture *pic = arg;
+		/* TODO: convert values for indycam_set_controls() */
+		break;
+	}
+	case DECODER_INDYCAM_GET_CONTROLS: {
+		struct indycam_control *ctrl = arg;
+		indycam_get_controls(client, ctrl);
+	}
+	case DECODER_INDYCAM_SET_CONTROLS: {
+		struct indycam_control *ctrl = arg;
+		indycam_set_controls(client, ctrl);
+	}
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static struct i2c_driver i2c_driver_indycam = {
+	.owner		= THIS_MODULE,
+	.name 		= "indycam",
+	.id 		= I2C_DRIVERID_INDYCAM,
+	.flags 		= I2C_DF_NOTIFY,
+	.attach_adapter = indycam_probe,
+	.detach_client 	= indycam_detach,
+	.command 	= indycam_command,
+};
+
+static int __init indycam_init(void)
+{
+	return i2c_add_driver(&i2c_driver_indycam);
+}
+
+static void __exit indycam_exit(void)
+{
+	i2c_del_driver(&i2c_driver_indycam);
+}
+
+module_init(indycam_init);
+module_exit(indycam_exit);
diff -urN a/drivers/media/video/indycam.h b/drivers/media/video/indycam.h
--- a/drivers/media/video/indycam.h	1970-01-01 02:00:00.000000000 +0200
+++ b/drivers/media/video/indycam.h	2005-08-10 17:49:43.000000000 +0300
@@ -0,0 +1,112 @@
+/*
+ *  indycam.h - Silicon Graphics IndyCam digital camera driver
+ *
+ *  Copyright (C) 2003 Ladislav Michl <ladis@linux-mips.org>
+ *  Copyright (C) 2004,2005 Mikael Nousiainen <tmnousia@cc.hut.fi>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#ifndef _INDYCAM_H_
+#define _INDYCAM_H_
+
+/* I2C address for the Guinness Camera */
+#define INDYCAM_ADDR			0x56
+
+/* Camera version */
+#define CAMERA_VERSION_INDY		0x10	/* v1.0 */
+#define CAMERA_VERSION_MOOSE		0x12	/* v1.2 */
+#define INDYCAM_VERSION_MAJOR(x)	(((x) & 0xf0) >> 4)
+#define INDYCAM_VERSION_MINOR(x)	((x) & 0x0f)
+
+/* Register bus addresses */
+#define INDYCAM_CONTROL			0x00
+#define INDYCAM_SHUTTER			0x01
+#define INDYCAM_GAIN			0x02
+#define INDYCAM_BRIGHTNESS		0x03 /* read-only */
+#define INDYCAM_RED_BALANCE		0x04
+#define INDYCAM_BLUE_BALANCE		0x05
+#define INDYCAM_RED_SATURATION		0x06
+#define INDYCAM_BLUE_SATURATION		0x07
+#define INDYCAM_GAMMA			0x08
+#define INDYCAM_VERSION			0x0e /* read-only */
+#define INDYCAM_RESET			0x0f /* write-only */
+
+#define INDYCAM_LED			0x46
+#define INDYCAM_ORIENTATION		0x47
+#define INDYCAM_BUTTON			0x48
+
+/* Field definitions of registers */
+#define INDYCAM_CONTROL_AGCENA		(1<<0) /* automatic gain control */
+#define INDYCAM_CONTROL_AWBCTL		(1<<1) /* automatic white balance */
+						/* 2-3 are reserved */
+#define INDYCAM_CONTROL_EVNFLD		(1<<4)	/* read-only */
+
+#define INDYCAM_SHUTTER_10000		0x02	/* 1/10000 second */
+#define INDYCAM_SHUTTER_4000		0x04	/* 1/4000 second */
+#define INDYCAM_SHUTTER_2000		0x08	/* 1/2000 second */
+#define INDYCAM_SHUTTER_1000		0x10	/* 1/1000 second */
+#define INDYCAM_SHUTTER_500		0x20	/* 1/500 second */
+#define INDYCAM_SHUTTER_250		0x3f	/* 1/250 second */
+#define INDYCAM_SHUTTER_125		0x7e	/* 1/125 second */
+#define INDYCAM_SHUTTER_100		0x9e	/* 1/100 second */
+#define INDYCAM_SHUTTER_60		0x00	/* 1/60 second */
+
+#define INDYCAM_LED_ACTIVE			0x10
+#define INDYCAM_LED_INACTIVE			0x30
+#define INDYCAM_ORIENTATION_BOTTOM_TO_TOP	0x40
+#define INDYCAM_BUTTON_RELEASED			0x10
+
+#define INDYCAM_SHUTTER_MIN		0x00
+#define INDYCAM_SHUTTER_MAX		0xff
+#define INDYCAM_GAIN_MIN                0x00
+#define INDYCAM_GAIN_MAX                0xff
+#define INDYCAM_RED_BALANCE_MIN 	0x00 /* the effect is the opposite? */
+#define INDYCAM_RED_BALANCE_MAX 	0xff
+#define INDYCAM_BLUE_BALANCE_MIN        0x00 /* the effect is the opposite? */
+#define INDYCAM_BLUE_BALANCE_MAX        0xff
+#define INDYCAM_RED_SATURATION_MIN      0x00
+#define INDYCAM_RED_SATURATION_MAX      0xff
+#define INDYCAM_BLUE_SATURATION_MIN	0x00
+#define INDYCAM_BLUE_SATURATION_MAX	0xff
+#define INDYCAM_GAMMA_MIN		0x00
+#define INDYCAM_GAMMA_MAX		0xff
+
+/* Driver interface definitions */
+
+#define INDYCAM_VALUE_ENABLED		1
+#define INDYCAM_VALUE_DISABLED		0
+#define INDYCAM_VALUE_UNCHANGED		-1
+
+/* When setting controls, a value of -1 leaves the control unchanged. */
+struct indycam_control {
+	int agc;	/* boolean */
+	int awb;	/* boolean */
+	int shutter;
+	int gain;
+	int red_balance;
+	int blue_balance;
+	int red_saturation;
+	int blue_saturation;
+	int gamma;
+};
+
+#define	DECODER_INDYCAM_GET_CONTROLS	_IOR('d', 193, struct indycam_control)
+#define	DECODER_INDYCAM_SET_CONTROLS	_IOW('d', 194, struct indycam_control)
+
+/* Default values for controls */
+
+#define INDYCAM_AGC_DEFAULT		INDYCAM_VALUE_ENABLED
+#define INDYCAM_AWB_DEFAULT		INDYCAM_VALUE_ENABLED
+
+#define INDYCAM_SHUTTER_DEFAULT		INDYCAM_SHUTTER_60
+#define INDYCAM_GAIN_DEFAULT		0x80
+#define INDYCAM_RED_BALANCE_DEFAULT	0x18
+#define INDYCAM_BLUE_BALANCE_DEFAULT	0xa4
+#define INDYCAM_RED_SATURATION_DEFAULT	0x80
+#define INDYCAM_BLUE_SATURATION_DEFAULT	0xc0
+#define INDYCAM_GAMMA_DEFAULT		0x80
+
+#endif
diff -urN a/drivers/media/video/Makefile b/drivers/media/video/Makefile
--- a/drivers/media/video/Makefile	2005-07-11 23:47:19.000000000 +0300
+++ b/drivers/media/video/Makefile	2005-08-10 17:39:54.000000000 +0300
@@ -29,7 +29,7 @@
 obj-$(CONFIG_VIDEO_ZORAN) += zr36067.o videocodec.o
 obj-$(CONFIG_VIDEO_PMS) += pms.o
 obj-$(CONFIG_VIDEO_PLANB) += planb.o
-obj-$(CONFIG_VIDEO_VINO) += vino.o
+obj-$(CONFIG_VIDEO_VINO) += vino.o saa7191.o indycam.o
 obj-$(CONFIG_VIDEO_STRADIS) += stradis.o
 obj-$(CONFIG_VIDEO_CPIA) += cpia.o
 obj-$(CONFIG_VIDEO_CPIA_PP) += cpia_pp.o
diff -urN a/drivers/media/video/saa7191.c b/drivers/media/video/saa7191.c
--- a/drivers/media/video/saa7191.c	1970-01-01 02:00:00.000000000 +0200
+++ b/drivers/media/video/saa7191.c	2005-08-10 17:49:40.000000000 +0300
@@ -0,0 +1,512 @@
+/*
+ *  saa7191.c - Philips SAA7191 video decoder driver
+ *
+ *  Copyright (C) 2003 Ladislav Michl <ladis@linux-mips.org>
+ *  Copyright (C) 2004,2005 Mikael Nousiainen <tmnousia@cc.hut.fi>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/errno.h>
+#include <linux/fs.h>
+#include <linux/kernel.h>
+#include <linux/major.h>
+#include <linux/slab.h>
+#include <linux/mm.h>
+#include <linux/sched.h>
+
+#include <linux/videodev.h>
+#include <linux/video_decoder.h>
+#include <linux/i2c.h>
+
+#include "saa7191.h"
+
+#define SAA7191_MODULE_VERSION "0.0.3"
+
+MODULE_DESCRIPTION("Philips SAA7191 video decoder driver");
+MODULE_VERSION(SAA7191_MODULE_VERSION);
+MODULE_AUTHOR("Mikael Nousiainen <tmnousia@cc.hut.fi>");
+MODULE_LICENSE("GPL");
+
+#define VINO_ADAPTER	(I2C_ALGO_SGI | I2C_HW_SGI_VINO)
+
+struct saa7191 {
+	struct i2c_client *client;
+
+	/* the register values are stored here as the actual
+	 * I2C-registers are write-only */
+	unsigned char reg[25];
+
+	unsigned char norm;
+	unsigned char input;
+};
+
+static struct i2c_driver i2c_driver_saa7191;
+
+static const unsigned char initseq[] = {
+	0,	/* Subaddress */
+	0x50,	/* SAA7191_REG_IDEL */
+	0x30,	/* SAA7191_REG_HSYB */
+	0x00,	/* SAA7191_REG_HSYS */
+	0xe8,	/* SAA7191_REG_HCLB */
+	0xb6,	/* SAA7191_REG_HCLS */
+	0xf4,	/* SAA7191_REG_HPHI */
+	0x01,	/* SAA7191_REG_LUMA - chrominance trap active (CVBS) */
+	0x00,	/* SAA7191_REG_HUEC */
+	0xf8,	/* SAA7191_REG_CKTQ */
+	0xf8,	/* SAA7191_REG_CKTS */
+	0x90,	/* SAA7191_REG_PLSE */
+	0x90,	/* SAA7191_REG_SESE */
+	0x00,	/* SAA7191_REG_GAIN */
+	0x0c,	/* SAA7191_REG_STDC - not SECAM, slow time constant */
+	0x78,	/* SAA7191_REG_IOCK - chrominance from CVBS, GPSW1 & 2 off */
+	0x99,	/* SAA7191_REG_CTL3 - automatic field detection */
+	0x00,	/* SAA7191_REG_CTL4 */
+	0x2c,	/* SAA7191_REG_CHCV */
+	0x00,	/* unused */
+	0x00,	/* unused */
+	0x34,	/* SAA7191_REG_HS6B */
+	0x0a,	/* SAA7191_REG_HS6S */
+	0xf4,	/* SAA7191_REG_HC6B */
+	0xce,	/* SAA7191_REG_HC6S */
+	0xf4,	/* SAA7191_REG_HP6I */
+};
+
+/* SAA7191 register handling */
+
+static unsigned char saa7191_read_reg(struct i2c_client *client,
+				      unsigned char reg)
+{
+	return ((struct saa7191 *)i2c_get_clientdata(client))->reg[reg];
+}
+
+static int saa7191_read_status(struct i2c_client *client,
+			       unsigned char *value)
+{
+	int ret;
+
+	ret = i2c_master_recv(client, value, 1);
+	if (ret < 0) {
+		printk(KERN_ERR "SAA7191: saa7191_read_status(): read failed");
+		return ret;
+	}
+
+	return 0;
+}
+
+
+static int saa7191_write_reg(struct i2c_client *client, unsigned char reg,
+			     unsigned char value)
+{
+
+	((struct saa7191 *)i2c_get_clientdata(client))->reg[reg] = value;
+	return i2c_smbus_write_byte_data(client, reg, value);
+}
+
+/* the first byte of data must be the first subaddress number (register) */
+static int saa7191_write_block(struct i2c_client *client,
+			       unsigned char length, unsigned char *data)
+{
+	int i;
+	int ret;
+
+	struct saa7191 *decoder = (struct saa7191 *)i2c_get_clientdata(client);
+	for (i = 0; i < (length - 1); i++) {
+		decoder->reg[data[0] + i] = data[i + 1];
+	}
+
+	ret = i2c_master_send(client, data, length);
+	if (ret < 0) {
+		printk(KERN_ERR "SAA7191: saa7191_write_block(): "
+		       "write failed");
+		return ret;
+	}
+
+	return 0;
+}
+
+/* Helper functions */
+
+static int saa7191_set_input(struct i2c_client *client, int input)
+{
+	unsigned char luma = saa7191_read_reg(client, SAA7191_REG_LUMA);
+	unsigned char iock = saa7191_read_reg(client, SAA7191_REG_IOCK);
+	int err;
+
+	switch (input) {
+	case SAA7191_INPUT_COMPOSITE: /* Set Composite input */
+		iock &= ~(SAA7191_IOCK_CHRS | SAA7191_IOCK_GPSW1
+			  | SAA7191_IOCK_GPSW2);
+		/* Chrominance trap active */
+		luma &= ~SAA7191_LUMA_BYPS;
+		break;
+	case SAA7191_INPUT_SVIDEO: /* Set S-Video input */
+		iock |= SAA7191_IOCK_CHRS | SAA7191_IOCK_GPSW2;
+		/* Chrominance trap bypassed */
+		luma |= SAA7191_LUMA_BYPS;
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	err = saa7191_write_reg(client, SAA7191_REG_LUMA, luma);
+	if (err)
+		return -EIO;
+	err = saa7191_write_reg(client, SAA7191_REG_IOCK, iock);
+	if (err)
+		return -EIO;
+
+	return 0;
+}
+
+static int saa7191_set_norm(struct i2c_client *client, int norm)
+{
+	struct saa7191 *decoder = i2c_get_clientdata(client);
+	unsigned char stdc = saa7191_read_reg(client, SAA7191_REG_STDC);
+	unsigned char ctl3 = saa7191_read_reg(client, SAA7191_REG_CTL3);
+	unsigned char chcv = saa7191_read_reg(client, SAA7191_REG_CHCV);
+	int err;
+
+	switch(norm) {
+	case SAA7191_NORM_AUTO: {
+		unsigned char status;
+
+		// does status depend on current norm ?
+		if (saa7191_read_status(client, &status))
+			return -EIO;
+
+		stdc &= ~SAA7191_STDC_SECS;
+		ctl3 &= ~SAA7191_CTL3_FSEL;
+		ctl3 |= SAA7191_CTL3_AUFD;
+		chcv = (status & SAA7191_STATUS_FIDT)
+			       ? SAA7191_CHCV_NTSC : SAA7191_CHCV_PAL;
+		break;
+	}
+	case SAA7191_NORM_PAL:
+		stdc &= ~SAA7191_STDC_SECS;
+		ctl3 &= ~(SAA7191_CTL3_AUFD | SAA7191_CTL3_FSEL);
+		chcv = SAA7191_CHCV_PAL;
+		break;
+	case SAA7191_NORM_NTSC:
+		stdc &= ~SAA7191_STDC_SECS;
+		ctl3 &= ~SAA7191_CTL3_AUFD;
+		ctl3 |= SAA7191_CTL3_FSEL;
+		chcv = SAA7191_CHCV_NTSC;
+		break;
+	case SAA7191_NORM_SECAM:
+		stdc |= SAA7191_STDC_SECS;
+		ctl3 &= ~(SAA7191_CTL3_AUFD | SAA7191_CTL3_FSEL);
+		chcv = SAA7191_CHCV_PAL;
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	err = saa7191_write_reg(client, SAA7191_REG_CTL3, ctl3);
+	if (err)
+		return -EIO;
+	err = saa7191_write_reg(client, SAA7191_REG_STDC, stdc);
+	if (err)
+		return -EIO;
+	err = saa7191_write_reg(client, SAA7191_REG_CHCV, chcv);
+	if (err)
+		return -EIO;
+
+	decoder->norm = norm;
+
+	return 0;
+}
+
+static int saa7191_get_controls(struct i2c_client *client,
+				struct saa7191_control *ctrl)
+{
+	unsigned char hue = saa7191_read_reg(client, SAA7191_REG_HUEC);
+	unsigned char stdc = saa7191_read_reg(client, SAA7191_REG_STDC);
+
+	if (hue < 0x80) {
+		hue += 0x80;
+	} else {
+		hue -= 0x80;
+	}
+	ctrl->hue = hue;
+
+	ctrl->vtrc = (stdc & SAA7191_STDC_VTRC)
+		? SAA7191_VALUE_ENABLED : SAA7191_VALUE_DISABLED;
+
+	return 0;
+}
+
+static int saa7191_set_controls(struct i2c_client *client,
+				struct saa7191_control *ctrl)
+{
+	int err;
+
+	if (ctrl->hue >= 0) {
+		unsigned char hue = ctrl->hue & 0xff;
+		if (hue < 0x80) {
+			hue += 0x80;
+		} else {
+			hue -= 0x80;
+		}
+		err = saa7191_write_reg(client, SAA7191_REG_HUEC, hue);
+		if (err)
+			return -EIO;
+	}
+	if (ctrl->vtrc >= 0) {
+		unsigned char stdc =
+			saa7191_read_reg(client, SAA7191_REG_STDC);
+
+		if (ctrl->vtrc) {
+			stdc |= SAA7191_STDC_VTRC;
+		} else {
+			stdc &= ~SAA7191_STDC_VTRC;
+		}
+
+		err = saa7191_write_reg(client, SAA7191_REG_STDC, stdc);
+		if (err)
+			return -EIO;
+	}
+
+	return 0;
+}
+
+/* I2C-interface */
+
+static int saa7191_attach(struct i2c_adapter *adap, int addr, int kind)
+{
+	int err = 0;
+	struct saa7191 *decoder;
+	struct i2c_client *client;
+
+	printk(KERN_INFO "Philips SAA7191 driver version %s\n",
+	       SAA7191_MODULE_VERSION);
+
+	client = kmalloc(sizeof(*client), GFP_KERNEL);
+	if (!client)
+		return -ENOMEM;
+	decoder = kmalloc(sizeof(*decoder), GFP_KERNEL);
+	if (!decoder) {
+		err = -ENOMEM;
+		goto out_free_client;
+	}
+
+	memset(client, 0, sizeof(struct i2c_client));
+	memset(decoder, 0, sizeof(struct saa7191));
+
+	client->addr = addr;
+	client->adapter = adap;
+	client->driver = &i2c_driver_saa7191;
+	client->flags = 0;
+	strcpy(client->name, "saa7191 client");
+	i2c_set_clientdata(client, decoder);
+
+	decoder->client = client;
+
+	err = i2c_attach_client(client);
+	if (err)
+		goto out_free_decoder;
+
+	decoder->input = SAA7191_INPUT_COMPOSITE;
+	decoder->norm = SAA7191_NORM_AUTO;
+
+	err = saa7191_write_block(client, sizeof(initseq),
+				  (unsigned char *)initseq);
+	if (err) {
+		printk(KERN_ERR "SAA7191 initialization failed\n");
+		goto out_detach_client;
+	}
+
+	printk(KERN_INFO "SAA7191 initialized\n");
+
+	return 0;
+
+out_detach_client:
+	i2c_detach_client(client);
+out_free_decoder:
+	kfree(decoder);
+out_free_client:
+	kfree(client);
+	return err;
+}
+
+static int saa7191_probe(struct i2c_adapter *adap)
+{
+	/* Always connected to VINO */
+	if (adap->id == VINO_ADAPTER)
+		return saa7191_attach(adap, SAA7191_ADDR, 0);
+	/* Feel free to add probe here :-) */
+	return -ENODEV;
+}
+
+static int saa7191_detach(struct i2c_client *client)
+{
+	struct saa7191 *decoder = i2c_get_clientdata(client);
+
+	i2c_detach_client(client);
+	kfree(decoder);
+	kfree(client);
+	return 0;
+}
+
+static int saa7191_command(struct i2c_client *client, unsigned int cmd,
+			   void *arg)
+{
+	struct saa7191 *decoder = i2c_get_clientdata(client);
+
+	switch (cmd) {
+	case DECODER_GET_CAPABILITIES: {
+		struct video_decoder_capability *cap = arg;
+
+		cap->flags  = VIDEO_DECODER_PAL | VIDEO_DECODER_NTSC |
+			      VIDEO_DECODER_SECAM | VIDEO_DECODER_AUTO;
+		cap->inputs = (client->adapter->id == VINO_ADAPTER) ? 2 : 1;
+		cap->outputs = 1;
+		break;
+	}
+	case DECODER_GET_STATUS: {
+		int *iarg = arg;
+		unsigned char status;
+		int res = 0;
+
+		if (saa7191_read_status(client, &status)) {
+			return -EIO;
+		}
+		if ((status & SAA7191_STATUS_HLCK) == 0)
+			res |= DECODER_STATUS_GOOD;
+		if (status & SAA7191_STATUS_CODE)
+			res |= DECODER_STATUS_COLOR;
+		switch (decoder->norm) {
+		case SAA7191_NORM_NTSC:
+			res |= DECODER_STATUS_NTSC;
+			break;
+		case SAA7191_NORM_PAL:
+			res |= DECODER_STATUS_PAL;
+			break;
+		case SAA7191_NORM_SECAM:
+			res |= DECODER_STATUS_SECAM;
+			break;
+		case SAA7191_NORM_AUTO:
+		default:
+			if (status & SAA7191_STATUS_FIDT)
+				res |= DECODER_STATUS_NTSC;
+			else
+				res |= DECODER_STATUS_PAL;
+			break;
+		}
+		*iarg = res;
+		break;
+	}
+	case DECODER_SET_NORM: {
+		int *iarg = arg;
+
+		switch (*iarg) {
+		case VIDEO_MODE_AUTO:
+			return saa7191_set_norm(client, SAA7191_NORM_AUTO);
+		case VIDEO_MODE_PAL:
+			return saa7191_set_norm(client, SAA7191_NORM_PAL);
+		case VIDEO_MODE_NTSC:
+			return saa7191_set_norm(client, SAA7191_NORM_NTSC);
+		case VIDEO_MODE_SECAM:
+			return saa7191_set_norm(client, SAA7191_NORM_SECAM);
+		default:
+			return -EINVAL;
+		}
+		break;
+	}
+	case DECODER_SET_INPUT:	{
+		int *iarg = arg;
+
+		switch (client->adapter->id) {
+		case VINO_ADAPTER:
+			return saa7191_set_input(client, *iarg);
+		default:
+			if (*iarg != 0)
+				return -EINVAL;
+		}
+		break;
+	}
+	case DECODER_SET_OUTPUT: {
+		int *iarg = arg;
+
+		/* not much choice of outputs */
+		if (*iarg != 0)
+			return -EINVAL;
+		break;
+	}
+	case DECODER_ENABLE_OUTPUT: {
+		/* Always enabled */
+		break;
+	}
+	case DECODER_SET_PICTURE: {
+		struct video_picture *pic = arg;
+		unsigned val;
+		int err;
+
+		val = (pic->hue >> 8) - 0x80;
+		err = saa7191_write_reg(client, SAA7191_REG_HUEC, val);
+		if (err)
+			return -EIO;
+		break;
+	}
+	case DECODER_SAA7191_GET_STATUS: {
+		struct saa7191_status *status = arg;
+		unsigned char status_reg;
+
+		if (saa7191_read_status(client, &status_reg))
+			return -EIO;
+		status->signal = ((status_reg & SAA7191_STATUS_HLCK) == 0)
+			? SAA7191_VALUE_ENABLED : SAA7191_VALUE_DISABLED;
+		status->ntsc = (status_reg & SAA7191_STATUS_FIDT)
+			? SAA7191_VALUE_ENABLED : SAA7191_VALUE_DISABLED;
+		status->color = (status_reg & SAA7191_STATUS_CODE)
+			? SAA7191_VALUE_ENABLED : SAA7191_VALUE_DISABLED;
+
+		status->input = decoder->input;
+		status->norm = decoder->norm;
+	}
+	case DECODER_SAA7191_SET_NORM: {
+		int *norm = arg;
+		return saa7191_set_norm(client, *norm);
+	}
+	case DECODER_SAA7191_GET_CONTROLS: {
+		struct saa7191_control *ctrl = arg;
+		return saa7191_get_controls(client, ctrl);
+	}
+	case DECODER_SAA7191_SET_CONTROLS: {
+		struct saa7191_control *ctrl = arg;
+		return saa7191_set_controls(client, ctrl);
+	}
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static struct i2c_driver i2c_driver_saa7191 = {
+	.owner		= THIS_MODULE,
+	.name 		= "saa7191",
+	.id 		= I2C_DRIVERID_SAA7191,
+	.flags 		= I2C_DF_NOTIFY,
+	.attach_adapter = saa7191_probe,
+	.detach_client 	= saa7191_detach,
+	.command 	= saa7191_command
+};
+
+static int saa7191_init(void)
+{
+	return i2c_add_driver(&i2c_driver_saa7191);
+}
+
+static void saa7191_exit(void)
+{
+	i2c_del_driver(&i2c_driver_saa7191);
+}
+
+module_init(saa7191_init);
+module_exit(saa7191_exit);
diff -urN a/drivers/media/video/saa7191.h b/drivers/media/video/saa7191.h
--- a/drivers/media/video/saa7191.h	1970-01-01 02:00:00.000000000 +0200
+++ b/drivers/media/video/saa7191.h	2005-08-10 17:49:43.000000000 +0300
@@ -0,0 +1,139 @@
+/*
+ *  saa7191.h - Philips SAA7191 video decoder driver
+ *
+ *  Copyright (C) 2003 Ladislav Michl <ladis@linux-mips.org>
+ *  Copyright (C) 2004,2005 Mikael Nousiainen <tmnousia@cc.hut.fi>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#ifndef _SAA7191_H_
+#define _SAA7191_H_
+
+/* Philips SAA7191 DMSD I2C bus address */
+#define SAA7191_ADDR		0x8a
+
+/* Register subaddresses. */
+#define SAA7191_REG_IDEL	0x00
+#define SAA7191_REG_HSYB	0x01
+#define SAA7191_REG_HSYS	0x02
+#define SAA7191_REG_HCLB	0x03
+#define SAA7191_REG_HCLS	0x04
+#define SAA7191_REG_HPHI	0x05
+#define SAA7191_REG_LUMA	0x06
+#define SAA7191_REG_HUEC	0x07
+#define SAA7191_REG_CKTQ	0x08
+#define SAA7191_REG_CKTS	0x09
+#define SAA7191_REG_PLSE	0x0a
+#define SAA7191_REG_SESE	0x0b
+#define SAA7191_REG_GAIN	0x0c
+#define SAA7191_REG_STDC	0x0d
+#define SAA7191_REG_IOCK	0x0e
+#define SAA7191_REG_CTL3	0x0f
+#define SAA7191_REG_CTL4	0x10
+#define SAA7191_REG_CHCV	0x11
+#define SAA7191_REG_HS6B	0x14
+#define SAA7191_REG_HS6S	0x15
+#define SAA7191_REG_HC6B	0x16
+#define SAA7191_REG_HC6S	0x17
+#define SAA7191_REG_HP6I	0x18
+#define SAA7191_REG_STATUS	0xff	/* not really a subaddress */
+
+/* Status Register definitions */
+#define SAA7191_STATUS_CODE	0x01	/* color detected flag */
+#define SAA7191_STATUS_FIDT	0x20	/* format type NTSC/PAL */
+#define SAA7191_STATUS_HLCK	0x40	/* PLL unlocked/locked */
+#define SAA7191_STATUS_STTC	0x80	/* tv/vtr time constant */
+
+/* Luminance Control Register definitions */
+#define SAA7191_LUMA_BYPS	0x80
+
+/* Chroma Gain Control Settings Register definitions */
+/* 0=automatic colour-killer enabled, 1=forced colour on */
+#define SAA7191_GAIN_COLO	0x80
+
+/* Standard/Mode Control Register definitions */
+/* tv/vtr mode bit: 0=TV mode (slow time constant),
+ * 1=VTR mode (fast time constant) */
+#define SAA7191_STDC_VTRC	0x80
+/* SECAM mode bit: 0=other standards, 1=SECAM */
+#define SAA7191_STDC_SECS	0x01
+/* the bit fields above must be or'd with this value */
+#define SAA7191_STDC_VALUE	0x0c
+
+/* I/O and Clock Control Register definitions */
+/* horizontal clock PLL: 0=PLL closed,
+ * 1=PLL circuit open and horizontal freq fixed */
+#define SAA7191_IOCK_HPLL	0x80
+/* S-VHS bit (chrominance from CVBS or from chrominance input):
+ * 0=controlled by BYPS-bit, 1=from chrominance input */
+#define SAA7191_IOCK_CHRS	0x04
+/* general purpose switch 2
+ * VINO-specific: 0=used with CVBS, 1=used with S-Video */
+#define SAA7191_IOCK_GPSW2	0x02
+/* general purpose switch 1 */
+/* VINO-specific: 0=always, 1=not used!*/
+#define SAA7191_IOCK_GPSW1	0x01
+
+/* Miscellaneous Control #1 Register definitions */
+/* automatic field detection (50/60Hz standard) */
+#define SAA7191_CTL3_AUFD	0x80
+/* field select: (if AUFD=0)
+ * 0=50Hz (625 lines), 1=60Hz (525 lines) */
+#define SAA7191_CTL3_FSEL	0x40
+/* the bit fields above must be or'd with this value */
+#define SAA7191_CTL3_VALUE	0x19
+
+/* Chrominance Gain Control Register definitions
+ * (nominal value for UV CCIR level) */
+#define SAA7191_CHCV_NTSC	0x2c
+#define SAA7191_CHCV_PAL	0x59
+
+/* Driver interface definitions */
+#define SAA7191_INPUT_COMPOSITE	0
+#define SAA7191_INPUT_SVIDEO	1
+
+#define SAA7191_NORM_AUTO	0
+#define SAA7191_NORM_PAL	1
+#define SAA7191_NORM_NTSC	2
+#define SAA7191_NORM_SECAM	3
+
+#define SAA7191_VALUE_ENABLED		1
+#define SAA7191_VALUE_DISABLED		0
+#define SAA7191_VALUE_UNCHANGED		-1
+
+struct saa7191_status {
+	/* 0=no signal, 1=signal active*/
+	int signal;
+	/* 0=50hz (pal) signal, 1=60hz (ntsc) signal */
+	int ntsc;
+	/* 0=no color detected, 1=color detected */
+	int color;
+
+	/* current SAA7191_INPUT_ */
+	int input;
+	/* current SAA7191_NORM_ */
+	int norm;
+};
+
+#define SAA7191_HUE_MIN		0x00
+#define SAA7191_HUE_MAX		0xff
+#define SAA7191_HUE_DEFAULT	0x80
+
+#define SAA7191_VTRC_MIN	0x00
+#define SAA7191_VTRC_MAX	0x01
+#define SAA7191_VTRC_DEFAULT	0x00
+
+struct saa7191_control {
+	int hue;
+	int vtrc;
+};
+
+#define	DECODER_SAA7191_GET_STATUS	_IOR('d', 195, struct saa7191_status)
+#define	DECODER_SAA7191_SET_NORM	_IOW('d', 196, int)
+#define	DECODER_SAA7191_GET_CONTROLS	_IOR('d', 197, struct saa7191_control)
+#define	DECODER_SAA7191_SET_CONTROLS	_IOW('d', 198, struct saa7191_control)
+
+#endif
diff -urN a/drivers/media/video/vino.c b/drivers/media/video/vino.c
--- a/drivers/media/video/vino.c	2005-07-10 13:29:01.000000000 +0300
+++ b/drivers/media/video/vino.c	2005-08-10 17:49:40.000000000 +0300
@@ -1,80 +1,606 @@
 /*
- * (incomplete) Driver for the VINO (Video In No Out) system found in SGI Indys.
- *
+ * Driver for the VINO (Video In No Out) system found in SGI Indys.
+ *
  * This file is subject to the terms and conditions of the GNU General Public
  * License version 2 as published by the Free Software Foundation.
  *
+ * Copyright (C) 2004,2005 Mikael Nousiainen <tmnousia@cc.hut.fi>
+ *
+ * Based on the previous version of the driver for 2.4 kernels by:
  * Copyright (C) 2003 Ladislav Michl <ladis@linux-mips.org>
  */

-#include <linux/module.h>
+/*
+ * TODO:
+ * - remove "hacks" from memory allocation code and implement nopage()
+ * - check decimation, calculating and reporting image size when
+ *   using decimation
+ * - check vino_acquire_input(), vino_set_input() and channel
+ *   ownership handling
+ * - report VINO error-interrupts via ioctls ?
+ * - implement picture controls (all implemented?)
+ * - use macros for boolean values (?)
+ * - implement user mode buffers and overlay (?)
+ */
+
 #include <linux/init.h>
-#include <linux/types.h>
-#include <linux/mm.h>
-#include <linux/slab.h>
-#include <linux/wrapper.h>
-#include <linux/errno.h>
-#include <linux/irq.h>
+#include <linux/module.h>
 #include <linux/delay.h>
-#include <linux/videodev.h>
+#include <linux/errno.h>
+#include <linux/fs.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/interrupt.h>
+#include <linux/dma-mapping.h>
+#include <linux/time.h>
+#include <linux/moduleparam.h>
+
+#ifdef CONFIG_KMOD
+#include <linux/kmod.h>
+#endif
+
 #include <linux/i2c.h>
 #include <linux/i2c-algo-sgi.h>

-#include <asm/addrspace.h>
-#include <asm/system.h>
-#include <asm/bootinfo.h>
-#include <asm/pgtable.h>
+#include <linux/videodev.h>
+#include <linux/videodev2.h>
+#include <linux/video_decoder.h>
+
 #include <asm/paccess.h>
 #include <asm/io.h>
 #include <asm/sgi/ip22.h>
-#include <asm/sgi/hpc3.h>
 #include <asm/sgi/mc.h>

 #include "vino.h"
+#include "saa7191.h"
+#include "indycam.h"
+
+/* Uncomment the following line to get lots and lots of (mostly useless)
+ * debug info.
+ * Note that the debug output also slows down the driver significantly */
+// #define VINO_DEBUG
+
+#define VINO_MODULE_VERSION "0.0.3"
+#define VINO_VERSION_CODE KERNEL_VERSION(0, 0, 3)
+
+MODULE_DESCRIPTION("SGI VINO Video4Linux2 driver");
+MODULE_VERSION(VINO_MODULE_VERSION);
+MODULE_AUTHOR("Mikael Nousiainen <tmnousia@cc.hut.fi>");
+MODULE_LICENSE("GPL");
+
+#define mem_map_reserve(p) set_bit(PG_reserved, &((p)->flags))
+#define mem_map_unreserve(p) clear_bit(PG_reserved, &((p)->flags))

-/* debugging? */
-#if 1
-#define DEBUG(x...)     printk(x);
+#ifdef VINO_DEBUG
+#define dprintk(x...) printk("VINO: " x);
 #else
-#define DEBUG(x...)
+#define dprintk(x...)
 #endif

+#define VINO_NO_CHANNEL			0
+#define VINO_CHANNEL_A			1
+#define VINO_CHANNEL_B			2
+
+#define VINO_PAL_WIDTH			768
+#define VINO_PAL_HEIGHT			576
+#define VINO_NTSC_WIDTH			640
+#define VINO_NTSC_HEIGHT		480
+
+#define VINO_MIN_WIDTH			32
+#define VINO_MIN_HEIGHT			32
+
+#define VINO_CLIPPING_START_ODD_D1	1
+#define VINO_CLIPPING_START_ODD_PAL	1
+#define VINO_CLIPPING_START_ODD_NTSC	1
+
+#define VINO_CLIPPING_START_EVEN_D1	2
+#define VINO_CLIPPING_START_EVEN_PAL	2
+#define VINO_CLIPPING_START_EVEN_NTSC	2
+
+#define VINO_INPUT_CHANNEL_COUNT	3
+
+#define VINO_INPUT_NONE			-1
+#define VINO_INPUT_COMPOSITE		0
+#define VINO_INPUT_SVIDEO		1
+#define VINO_INPUT_D1			2
+
+#define VINO_PAGE_RATIO			(PAGE_SIZE / VINO_PAGE_SIZE)
+
+#define VINO_FIFO_THRESHOLD_DEFAULT	512
+
+/*#define VINO_FRAMEBUFFER_SIZE		(VINO_PAL_WIDTH * VINO_PAL_HEIGHT * 4 \
+  + 2 * PAGE_SIZE)*/
+#define VINO_FRAMEBUFFER_SIZE		((VINO_PAL_WIDTH \
+					  * VINO_PAL_HEIGHT * 4 \
+					  + 3 * PAGE_SIZE) & ~(PAGE_SIZE - 1))
+
+#define VINO_FRAMEBUFFER_MAX_COUNT	8
+
+#define VINO_FRAMEBUFFER_UNUSED		0
+#define VINO_FRAMEBUFFER_IN_USE		1
+#define VINO_FRAMEBUFFER_READY		2
+
+#define VINO_QUEUE_ERROR		-1
+#define VINO_QUEUE_MAGIC		0x20050125

-/* VINO ASIC registers */
-struct sgi_vino *vino;
+#define VINO_MEMORY_NONE		0
+#define VINO_MEMORY_MMAP		1
+#define VINO_MEMORY_USERPTR		2

-static const char *vinostr = "VINO IndyCam/TV";
-static int threshold_a = 512;
-static int threshold_b = 512;
-
-struct vino_device {
-	struct video_device vdev;
-#define VINO_CHAN_A		1
-#define VINO_CHAN_B		2
-	int chan;
+#define VINO_DUMMY_DESC_COUNT		4
+#define VINO_DESC_FETCH_DELAY		5	/* microseconds */
+
+/* the number is the index for vino_data_formats */
+#define VINO_DATA_FMT_NONE		-1
+#define VINO_DATA_FMT_GREY		0
+#define VINO_DATA_FMT_RGB332		1
+#define VINO_DATA_FMT_RGB32		2
+#define VINO_DATA_FMT_YUV		3
+//#define VINO_DATA_FMT_RGB24		4
+
+#define VINO_DATA_FMT_COUNT		4
+
+#define VINO_DATA_NORM_NONE		-1
+#define VINO_DATA_NORM_NTSC		0
+#define VINO_DATA_NORM_PAL		1
+#define VINO_DATA_NORM_SECAM		2
+#define VINO_DATA_NORM_D1		3
+/* The following is a special entry that can be used to
+ * autodetect the norm. */
+#define VINO_DATA_NORM_AUTO		0xff
+
+#define VINO_DATA_NORM_COUNT		4
+
+/* Internal data structure definitions */
+
+struct vino_input {
+	char *name;
+	v4l2_std_id std;
+};
+
+struct vino_clipping {
+	unsigned int left, right, top, bottom;
+};
+
+struct vino_data_format {
+	/* the description */
+	char *description;
+	/* bytes per pixel */
+	unsigned int bpp;
+	/* V4L2 fourcc code */
+	__u32 pixelformat;
+	/* V4L2 colorspace (duh!) */
+	enum v4l2_colorspace colorspace;
+};
+
+struct vino_data_norm {
+	char *description;
+	unsigned int width, height;
+	struct vino_clipping odd;
+	struct vino_clipping even;
+
+	v4l2_std_id std;
+	unsigned int fps_min, fps_max;
+	__u32 framelines;
+};
+
+struct vino_descriptor_table {
+	/* the number of PAGE_SIZE sized pages in the buffer */
+	unsigned int page_count;
+	/* virtual (kmalloc'd) pointers to the actual data
+	 * (in PAGE_SIZE chunks, used with mmap streaming) */
+	unsigned long *virtual;
+
+	/* cpu address for the VINO descriptor table
+	 * (contains DMA addresses, VINO_PAGE_SIZE chunks) */
+	unsigned long *dma_cpu;
+	/* dma address for the VINO descriptor table
+	 * (contains DMA addresses, VINO_PAGE_SIZE chunks) */
+	dma_addr_t dma;
+};
+
+struct vino_framebuffer {
+	/* identifier nubmer */
+	unsigned int id;
+	/* the length of the whole buffer */
+	unsigned int size;
+	/* the length of actual data in buffer */
+	unsigned int data_size;
+	/* the data format */
+	unsigned int data_format;
+	/* the state of buffer data */
+	unsigned int state;
+	/* is the buffer mapped in user space? */
+	unsigned int map_count;
+	/* memory offset for mmap() */
+	unsigned int offset;
+	/* frame counter */
+	unsigned int frame_counter;
+	/* timestamp (written when image capture finishes) */
+	struct timeval timestamp;
+
+	struct vino_descriptor_table desc_table;
+
+	spinlock_t state_lock;
+};
+
+struct vino_framebuffer_fifo {
+	unsigned int length;
+
+	unsigned int used;
+	unsigned int head;
+	unsigned int tail;
+
+	unsigned int data[VINO_FRAMEBUFFER_MAX_COUNT];
+};
+
+struct vino_framebuffer_queue {
+	unsigned int magic;
+
+	/* VINO_MEMORY_NONE, VINO_MEMORY_MMAP or VINO_MEMORY_USERPTR */
+	unsigned int type;
+	unsigned int length;
+
+	/* data field of in and out contain index numbers for buffer */
+	struct vino_framebuffer_fifo in;
+	struct vino_framebuffer_fifo out;
+
+	struct vino_framebuffer *buffer[VINO_FRAMEBUFFER_MAX_COUNT];
+
+	spinlock_t queue_lock;
+	struct semaphore queue_sem;
+	wait_queue_head_t frame_wait_queue;
+};
+
+struct vino_channel_settings {
+	unsigned int channel;
+
+	int input;
+	unsigned int data_format;
+	unsigned int data_norm;
+	struct vino_clipping clipping;
+	unsigned int decimation;
+	unsigned int line_size;
+	unsigned int alpha;
+	unsigned int fps;
+	unsigned int framert_reg;
+
+	unsigned int fifo_threshold;
+
+	struct vino_framebuffer_queue fb_queue;
+
+	/* number of the current field */
+	unsigned int field;
+
+	/* read in progress */
+	int reading;
+	/* streaming is active */
+	int streaming;
+	/* the driver is currently processing the queue */
+	int capturing;
+
+	struct semaphore sem;
+	spinlock_t capture_lock;
+
+	unsigned int users;
+
+	/* V4L support */
+	struct video_device *v4l_device;
 };

 struct vino_client {
+	/* the channel which owns this client:
+	 * VINO_NO_CHANNEL, VINO_CHANNEL_A or VINO_CHANNEL_B */
+	unsigned int owner;
 	struct i2c_client *driver;
-	int owner;
 };

-struct vino_video {
-	struct vino_device chA;
-	struct vino_device chB;
+struct vino_settings {
+	struct vino_channel_settings a;
+	struct vino_channel_settings b;

 	struct vino_client decoder;
 	struct vino_client camera;

-	struct semaphore input_lock;
+	/* a lock for vino register access */
+	spinlock_t vino_lock;
+	/* a lock for channel input changes */
+	spinlock_t input_lock;

-	/* Loaded into VINO descriptors to clear End Of Descriptors table
-	 * interupt condition */
 	unsigned long dummy_page;
-	unsigned int dummy_buf[4] __attribute__((aligned(8)));
+	struct vino_descriptor_table dummy_desc_table;
+};
+
+/* Module parameters */
+
+/*
+ * Using vino_pixel_conversion the ARGB32-format pixels supplied
+ * by the VINO chip can be converted to more common formats
+ * like RGBA32 (or probably RGB24 in the future). This way we
+ * can give out data that can be specified correctly with
+ * the V4L2-definitions.
+ *
+ * The pixel format is specified as RGBA32 when no conversion
+ * is used.
+ *
+ * Note that this only affects the 32-bit bit depth.
+ *
+ * Use non-zero value to enable conversion.
+ */
+static int vino_pixel_conversion = 0;
+module_param_named(pixelconv, vino_pixel_conversion, int, 0);
+MODULE_PARM_DESC(pixelconv,
+		 "enable pixel conversion (non-zero value enables)");
+
+/* Internal data structures */
+
+static struct sgi_vino *vino;
+
+static struct vino_settings *vino_drvdata;
+
+static const char *vino_driver_name = "vino";
+static const char *vino_driver_description = "SGI VINO";
+static const char *vino_bus_name = "GIO64 bus";
+static const char *vino_v4l_device_name_a = "SGI VINO Channel A";
+static const char *vino_v4l_device_name_b = "SGI VINO Channel B";
+
+static const struct vino_input vino_inputs[] = {
+	{
+		.name		= "Composite",
+		.std		= V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM,
+	},{
+		.name		= "S-Video",
+		.std		= V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM,
+	},{
+		.name		= "D1 (IndyCam)",
+		.std		= V4L2_STD_NTSC,
+	}
+};
+
+static const struct vino_data_format vino_data_formats[] = {
+	{
+		.description	= "8-bit greyscale",
+		.bpp		= 1,
+		.pixelformat	= V4L2_PIX_FMT_GREY,
+		.colorspace	= V4L2_COLORSPACE_SMPTE170M,
+	},{
+		.description	= "8-bit dithered RGB 3-3-2",
+		.bpp		= 1,
+		.pixelformat	= V4L2_PIX_FMT_RGB332,
+		.colorspace	= V4L2_COLORSPACE_SRGB,
+	},{
+		.description	= "32-bit RGB",
+		.bpp		= 4,
+		.pixelformat	= V4L2_PIX_FMT_RGB32,
+		.colorspace	= V4L2_COLORSPACE_SRGB,
+	},{
+		.description	= "YUV 4:2:2",
+		.bpp		= 4,
+		.pixelformat	= V4L2_PIX_FMT_YUYV, // XXX: swapped?
+		.colorspace	= V4L2_COLORSPACE_SMPTE170M,
+	}/*,{
+		.description	= "24-bit RGB",
+		.bpp		= 3,
+		.pixelformat	= V4L2_PIX_FMT_RGB24,
+		.colorspace	= V4L2_COLORSPACE_SRGB,
+		}*/
+};
+
+static const struct vino_data_norm vino_data_norms[] = {
+	{
+		.description	= "NTSC",
+		.std		= V4L2_STD_NTSC,
+		.fps_min	= 6,
+		.fps_max	= 30,
+		.framelines	= 525,
+		.width		= VINO_NTSC_WIDTH,
+		.height		= VINO_NTSC_HEIGHT,
+		.odd		= {
+			.top 	= VINO_CLIPPING_START_ODD_NTSC,
+			.left 	= 0,
+			.bottom	= VINO_CLIPPING_START_ODD_NTSC
+			+ VINO_NTSC_HEIGHT / 2 - 1,
+			.right 	= VINO_NTSC_WIDTH,
+		},
+		.even		= {
+			.top 	= VINO_CLIPPING_START_EVEN_NTSC,
+			.left 	= 0,
+			.bottom	= VINO_CLIPPING_START_EVEN_NTSC
+			+ VINO_NTSC_HEIGHT / 2 - 1,
+			.right 	= VINO_NTSC_WIDTH,
+		},
+	},{
+		.description	= "PAL",
+		.std		= V4L2_STD_PAL,
+		.fps_min	= 5,
+		.fps_max	= 25,
+		.framelines	= 625,
+		.width		= VINO_PAL_WIDTH,
+		.height		= VINO_PAL_HEIGHT,
+		.odd		= {
+			.top 	= VINO_CLIPPING_START_ODD_PAL,
+			.left 	= 0,
+			.bottom	= VINO_CLIPPING_START_ODD_PAL
+			+ VINO_PAL_HEIGHT / 2 - 1,
+			.right 	= VINO_PAL_WIDTH,
+		},
+		.even		= {
+			.top 	= VINO_CLIPPING_START_EVEN_PAL,
+			.left 	= 0,
+			.bottom	= VINO_CLIPPING_START_EVEN_PAL
+			+ VINO_PAL_HEIGHT / 2 - 1,
+			.right 	= VINO_PAL_WIDTH,
+		},
+	},{
+		.description	= "SECAM",
+		.std		= V4L2_STD_SECAM,
+		.fps_min	= 5,
+		.fps_max	= 25,
+		.framelines	= 625,
+		.width		= VINO_PAL_WIDTH,
+		.height		= VINO_PAL_HEIGHT,
+		.odd		= {
+			.top 	= VINO_CLIPPING_START_ODD_PAL,
+			.left 	= 0,
+			.bottom	= VINO_CLIPPING_START_ODD_PAL
+			+ VINO_PAL_HEIGHT / 2 - 1,
+			.right 	= VINO_PAL_WIDTH,
+		},
+		.even		= {
+			.top 	= VINO_CLIPPING_START_EVEN_PAL,
+			.left 	= 0,
+			.bottom	= VINO_CLIPPING_START_EVEN_PAL
+			+ VINO_PAL_HEIGHT / 2 - 1,
+			.right 	= VINO_PAL_WIDTH,
+		},
+	},{
+		.description	= "NTSC (D1 input)",
+		.std		= V4L2_STD_NTSC,
+		.fps_min	= 6,
+		.fps_max	= 30,
+		.framelines	= 525,
+		.width		= VINO_NTSC_WIDTH,
+		.height		= VINO_NTSC_HEIGHT,
+		.odd		= {
+			.top 	= VINO_CLIPPING_START_ODD_D1,
+			.left 	= 0,
+			.bottom	= VINO_CLIPPING_START_ODD_D1
+			+ VINO_NTSC_HEIGHT / 2 - 1,
+			.right 	= VINO_NTSC_WIDTH,
+		},
+		.even		= {
+			.top 	= VINO_CLIPPING_START_EVEN_D1,
+			.left 	= 0,
+			.bottom	= VINO_CLIPPING_START_EVEN_D1
+			+ VINO_NTSC_HEIGHT / 2 - 1,
+			.right 	= VINO_NTSC_WIDTH,
+		},
+	}
+};
+
+#define VINO_INDYCAM_V4L2_CONTROL_COUNT		9
+
+struct v4l2_queryctrl vino_indycam_v4l2_controls[] = {
+	{
+		.id = V4L2_CID_AUTOGAIN,
+		.type = V4L2_CTRL_TYPE_BOOLEAN,
+		.name = "Automatic Gain Control",
+		.minimum = 0,
+		.maximum = 1,
+		.step = 1,
+		.default_value = INDYCAM_AGC_DEFAULT,
+		.flags = 0,
+		.reserved = { 0, 0 },
+	},{
+		.id = V4L2_CID_AUTO_WHITE_BALANCE,
+		.type = V4L2_CTRL_TYPE_BOOLEAN,
+		.name = "Automatic White Balance",
+		.minimum = 0,
+		.maximum = 1,
+		.step = 1,
+		.default_value = INDYCAM_AWB_DEFAULT,
+		.flags = 0,
+		.reserved = { 0, 0 },
+	},{
+		.id = V4L2_CID_GAIN,
+		.type = V4L2_CTRL_TYPE_INTEGER,
+		.name = "Gain",
+		.minimum = INDYCAM_GAIN_MIN,
+		.maximum = INDYCAM_GAIN_MAX,
+		.step = 1,
+		.default_value = INDYCAM_GAIN_DEFAULT,
+		.flags = 0,
+		.reserved = { 0, 0 },
+	},{
+		.id = V4L2_CID_PRIVATE_BASE,
+		.type = V4L2_CTRL_TYPE_INTEGER,
+		.name = "Red Saturation",
+		.minimum = INDYCAM_RED_SATURATION_MIN,
+		.maximum = INDYCAM_RED_SATURATION_MAX,
+		.step = 1,
+		.default_value = INDYCAM_RED_SATURATION_DEFAULT,
+		.flags = 0,
+		.reserved = { 0, 0 },
+	},{
+		.id = V4L2_CID_PRIVATE_BASE + 1,
+		.type = V4L2_CTRL_TYPE_INTEGER,
+		.name = "Blue Saturation",
+		.minimum = INDYCAM_BLUE_SATURATION_MIN,
+		.maximum = INDYCAM_BLUE_SATURATION_MAX,
+		.step = 1,
+		.default_value = INDYCAM_BLUE_SATURATION_DEFAULT,
+		.flags = 0,
+		.reserved = { 0, 0 },
+	},{
+		.id = V4L2_CID_RED_BALANCE,
+		.type = V4L2_CTRL_TYPE_INTEGER,
+		.name = "Red Balance",
+		.minimum = INDYCAM_RED_BALANCE_MIN,
+		.maximum = INDYCAM_RED_BALANCE_MAX,
+		.step = 1,
+		.default_value = INDYCAM_RED_BALANCE_DEFAULT,
+		.flags = 0,
+		.reserved = { 0, 0 },
+	},{
+		.id = V4L2_CID_BLUE_BALANCE,
+		.type = V4L2_CTRL_TYPE_INTEGER,
+		.name = "Blue Balance",
+		.minimum = INDYCAM_BLUE_BALANCE_MIN,
+		.maximum = INDYCAM_BLUE_BALANCE_MAX,
+		.step = 1,
+		.default_value = INDYCAM_BLUE_BALANCE_DEFAULT,
+		.flags = 0,
+		.reserved = { 0, 0 },
+	},{
+		.id = V4L2_CID_EXPOSURE,
+		.type = V4L2_CTRL_TYPE_INTEGER,
+		.name = "Shutter Control",
+		.minimum = INDYCAM_SHUTTER_MIN,
+		.maximum = INDYCAM_SHUTTER_MAX,
+		.step = 1,
+		.default_value = INDYCAM_SHUTTER_DEFAULT,
+		.flags = 0,
+		.reserved = { 0, 0 },
+	},{
+		.id = V4L2_CID_GAMMA,
+		.type = V4L2_CTRL_TYPE_INTEGER,
+		.name = "Gamma",
+		.minimum = INDYCAM_GAMMA_MIN,
+		.maximum = INDYCAM_GAMMA_MAX,
+		.step = 1,
+		.default_value = INDYCAM_GAMMA_DEFAULT,
+		.flags = 0,
+		.reserved = { 0, 0 },
+	}
+};
+
+#define VINO_SAA7191_V4L2_CONTROL_COUNT		2
+
+struct v4l2_queryctrl vino_saa7191_v4l2_controls[] = {
+	{
+		.id = V4L2_CID_HUE,
+		.type = V4L2_CTRL_TYPE_INTEGER,
+		.name = "Hue",
+		.minimum = SAA7191_HUE_MIN,
+		.maximum = SAA7191_HUE_MAX,
+		.step = 1,
+		.default_value = SAA7191_HUE_DEFAULT,
+		.flags = 0,
+		.reserved = { 0, 0 },
+	},{
+		.id = V4L2_CID_PRIVATE_BASE,
+		.type = V4L2_CTRL_TYPE_BOOLEAN,
+		.name = "VTR Time Constant",
+		.minimum = SAA7191_VTRC_MIN,
+		.maximum = SAA7191_VTRC_MAX,
+		.step = 1,
+		.default_value = SAA7191_VTRC_DEFAULT,
+		.flags = 0,
+		.reserved = { 0, 0 },
+	}
 };

-static struct vino_video *Vino;
+/* VINO I2C bus functions */

 unsigned i2c_vino_getctrl(void *data)
 {
@@ -112,49 +638,49 @@
  */
 static int i2c_vino_client_reg(struct i2c_client *client)
 {
-	int res = 0;
+	int ret = 0;

-	down(&Vino->input_lock);
+	spin_lock(&vino_drvdata->input_lock);
 	switch (client->driver->id) {
 	case I2C_DRIVERID_SAA7191:
-		if (Vino->decoder.driver)
-			res = -EBUSY;
+		if (vino_drvdata->decoder.driver)
+			ret = -EBUSY;
 		else
-			Vino->decoder.driver = client;
+			vino_drvdata->decoder.driver = client;
 		break;
 	case I2C_DRIVERID_INDYCAM:
-		if (Vino->camera.driver)
-			res = -EBUSY;
+		if (vino_drvdata->camera.driver)
+			ret = -EBUSY;
 		else
-			Vino->camera.driver = client;
+			vino_drvdata->camera.driver = client;
 		break;
 	default:
-		res = -ENODEV;
+		ret = -ENODEV;
 	}
-	up(&Vino->input_lock);
+	spin_unlock(&vino_drvdata->input_lock);

-	return res;
+	return ret;
 }

 static int i2c_vino_client_unreg(struct i2c_client *client)
 {
-	int res = 0;
-
-	down(&Vino->input_lock);
-	if (client == Vino->decoder.driver) {
-		if (Vino->decoder.owner)
-			res = -EBUSY;
+	int ret = 0;
+
+	spin_lock(&vino_drvdata->input_lock);
+	if (client == vino_drvdata->decoder.driver) {
+		if (vino_drvdata->decoder.owner != VINO_NO_CHANNEL)
+			ret = -EBUSY;
 		else
-			Vino->decoder.driver = NULL;
-	} else if (client == Vino->camera.driver) {
-		if (Vino->camera.owner)
-			res = -EBUSY;
+			vino_drvdata->decoder.driver = NULL;
+	} else if (client == vino_drvdata->camera.driver) {
+		if (vino_drvdata->camera.owner != VINO_NO_CHANNEL)
+			ret = -EBUSY;
 		else
-			Vino->camera.driver = NULL;
+			vino_drvdata->camera.driver = NULL;
 	}
-	up(&Vino->input_lock);
+	spin_unlock(&vino_drvdata->input_lock);

-	return res;
+	return ret;
 }

 static struct i2c_adapter vino_i2c_adapter =
@@ -176,172 +702,3591 @@
 	return i2c_sgi_del_bus(&vino_i2c_adapter);
 }

+static int i2c_camera_command(unsigned int cmd, void *arg)
+{
+	return vino_drvdata->camera.driver->
+		driver->command(vino_drvdata->camera.driver,
+				cmd, arg);
+}
+
+static int i2c_decoder_command(unsigned int cmd, void *arg)
+{
+	return vino_drvdata->decoder.driver->
+		driver->command(vino_drvdata->decoder.driver,
+				cmd, arg);
+}
+
+/* VINO framebuffer/DMA descriptor management */
+
+static void vino_free_buffer_with_count(struct vino_framebuffer *fb,
+					       unsigned int count)
+{
+	unsigned int i;
+
+	dprintk("vino_free_buffer_with_count(): count = %d\n", count);
+
+	for (i = 0; i < count; i++) {
+		mem_map_unreserve(virt_to_page(fb->desc_table.virtual[i]));
+		dma_unmap_single(NULL,
+				 fb->desc_table.dma_cpu[VINO_PAGE_RATIO * i],
+				 PAGE_SIZE, DMA_FROM_DEVICE);
+		free_page(fb->desc_table.virtual[i]);
+	}
+
+	dma_free_coherent(NULL,
+			  VINO_PAGE_RATIO * (fb->desc_table.page_count + 4) *
+			  sizeof(dma_addr_t), (void *)fb->desc_table.dma_cpu,
+			  fb->desc_table.dma);
+	kfree(fb->desc_table.virtual);
+
+	memset(fb, 0, sizeof(struct vino_framebuffer));
+}
+
+static void vino_free_buffer(struct vino_framebuffer *fb)
+{
+	vino_free_buffer_with_count(fb, fb->desc_table.page_count);
+}

-static void vino_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static int vino_allocate_buffer(struct vino_framebuffer *fb,
+				unsigned int size)
 {
+	unsigned int count, i, j;
+	int ret = 0;
+
+	dprintk("vino_allocate_buffer():\n");
+
+	if (size < 1)
+		return -EINVAL;
+
+	memset(fb, 0, sizeof(struct vino_framebuffer));
+
+	count = ((size / PAGE_SIZE) + 4) & ~3;
+
+	dprintk("vino_allocate_buffer(): size = %d, count = %d\n",
+		size, count);
+
+	/* allocate memory for table with virtual (page) addresses */
+	fb->desc_table.virtual = (unsigned long *)
+		kmalloc(count * sizeof(unsigned long), GFP_KERNEL);
+	if (!fb->desc_table.virtual)
+		return -ENOMEM;
+
+	/* allocate memory for table with dma addresses
+	 * (has space for four extra descriptors) */
+	fb->desc_table.dma_cpu =
+		dma_alloc_coherent(NULL, VINO_PAGE_RATIO * (count + 4) *
+				   sizeof(dma_addr_t), &fb->desc_table.dma,
+				   GFP_KERNEL | GFP_DMA);
+	if (!fb->desc_table.dma_cpu) {
+		ret = -ENOMEM;
+		goto out_free_virtual;
+	}
+
+	/* allocate pages for the buffer and acquire the according
+	 * dma addresses */
+	for (i = 0; i < count; i++) {
+		dma_addr_t dma_data_addr;
+
+		fb->desc_table.virtual[i] =
+			get_zeroed_page(GFP_KERNEL | GFP_DMA);
+		if (!fb->desc_table.virtual[i]) {
+			ret = -ENOBUFS;
+			break;
+		}
+
+		dma_data_addr =
+			dma_map_single(NULL,
+				       (void *)fb->desc_table.virtual[i],
+				       PAGE_SIZE, DMA_FROM_DEVICE);
+
+		for (j = 0; j < VINO_PAGE_RATIO; j++) {
+			fb->desc_table.dma_cpu[VINO_PAGE_RATIO * i + j] =
+				dma_data_addr + VINO_PAGE_SIZE * j;
+		}
+
+		mem_map_reserve(virt_to_page(fb->desc_table.virtual[i]));
+	}
+
+	/* page_count needs to be set anyway, because the descriptor table has
+	 * been allocated according to this number */
+	fb->desc_table.page_count = count;
+
+	if (ret) {
+		/* the descriptor with index i doesn't contain
+		 * a valid address yet */
+		vino_free_buffer_with_count(fb, i);
+		return ret;
+	}
+
+	//fb->size = size;
+	fb->size = count * PAGE_SIZE;
+	fb->data_format = VINO_DATA_FMT_NONE;
+
+	/* set the dma stop-bit for the last (count+1)th descriptor */
+	fb->desc_table.dma_cpu[VINO_PAGE_RATIO * count] = VINO_DESC_STOP;
+	return 0;
+
+ out_free_virtual:
+	kfree(fb->desc_table.virtual);
+	return ret;
 }

-static int vino_open(struct video_device *dev, int flags)
+#if 0
+/* user buffers not fully implemented yet */
+static int vino_prepare_user_buffer(struct vino_framebuffer *fb,
+				     void *user,
+				     unsigned int size)
 {
-	struct vino_device *videv = (struct vino_device *)dev;
+	unsigned int count, i, j;
+	int ret = 0;
+
+	dprintk("vino_prepare_user_buffer():\n");
+
+	if (size < 1)
+		return -EINVAL;
+
+	memset(fb, 0, sizeof(struct vino_framebuffer));
+
+	count = ((size / PAGE_SIZE)) & ~3;
+
+	dprintk("vino_prepare_user_buffer(): size = %d, count = %d\n",
+		size, count);
+
+	/* allocate memory for table with virtual (page) addresses */
+	fb->desc_table.virtual = (unsigned long *)
+		kmalloc(count * sizeof(unsigned long), GFP_KERNEL);
+	if (!fb->desc_table.virtual)
+		return -ENOMEM;
+
+	/* allocate memory for table with dma addresses
+	 * (has space for four extra descriptors) */
+	fb->desc_table.dma_cpu =
+		dma_alloc_coherent(NULL, VINO_PAGE_RATIO * (count + 4) *
+				   sizeof(dma_addr_t), &fb->desc_table.dma,
+				   GFP_KERNEL | GFP_DMA);
+	if (!fb->desc_table.dma_cpu) {
+		ret = -ENOMEM;
+		goto out_free_virtual;
+	}
+
+	/* allocate pages for the buffer and acquire the according
+	 * dma addresses */
+	for (i = 0; i < count; i++) {
+		dma_addr_t dma_data_addr;
+
+		fb->desc_table.virtual[i] =
+			get_zeroed_page(GFP_KERNEL | GFP_DMA);
+		if (!fb->desc_table.virtual[i]) {
+			ret = -ENOBUFS;
+			break;
+		}
+
+		dma_data_addr =
+			dma_map_single(NULL,
+				       (void *)fb->desc_table.virtual[i],
+				       PAGE_SIZE, DMA_FROM_DEVICE);
+
+		for (j = 0; j < VINO_PAGE_RATIO; j++) {
+			fb->desc_table.dma_cpu[VINO_PAGE_RATIO * i + j] =
+				dma_data_addr + VINO_PAGE_SIZE * j;
+		}
+
+		mem_map_reserve(virt_to_page(fb->desc_table.virtual[i]));
+	}
+
+	/* page_count needs to be set anyway, because the descriptor table has
+	 * been allocated according to this number */
+	fb->desc_table.page_count = count;
+
+	if (ret) {
+		/* the descriptor with index i doesn't contain
+		 * a valid address yet */
+		vino_free_buffer_with_count(fb, i);
+		return ret;
+	}
+
+	//fb->size = size;
+	fb->size = count * PAGE_SIZE;

+	/* set the dma stop-bit for the last (count+1)th descriptor */
+	fb->desc_table.dma_cpu[VINO_PAGE_RATIO * count] = VINO_DESC_STOP;
 	return 0;
+
+ out_free_virtual:
+	kfree(fb->desc_table.virtual);
+	return ret;
 }
+#endif

-static void vino_close(struct video_device *dev)
+static void vino_sync_buffer(struct vino_framebuffer *fb)
 {
-	struct vino_device *videv = (struct vino_device *)dev;
+	int i;
+
+	dprintk("vino_sync_buffer():\n");
+
+	for (i = 0; i < fb->desc_table.page_count; i++)
+		dma_sync_single(NULL,
+				fb->desc_table.dma_cpu[VINO_PAGE_RATIO * i],
+				PAGE_SIZE, DMA_FROM_DEVICE);
 }

-static int vino_mmap(struct video_device *dev, const char *adr,
-		     unsigned long size)
+/* Framebuffer fifo functions (need to be locked externally) */
+
+static void vino_fifo_init(struct vino_framebuffer_fifo *f,
+			   unsigned int length)
 {
-	struct vino_device *videv = (struct vino_device *)dev;
+	f->length = 0;
+	f->used = 0;
+	f->head = 0;
+	f->tail = 0;

-	return -EINVAL;
+	if (length > VINO_FRAMEBUFFER_MAX_COUNT)
+		length = VINO_FRAMEBUFFER_MAX_COUNT;
+
+	f->length = length;
 }

-static int vino_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
+/* returns true/false */
+static int vino_fifo_has_id(struct vino_framebuffer_fifo *f, unsigned int id)
 {
-	struct vino_device *videv = (struct vino_device *)dev;
+	unsigned int i;
+	for (i = f->head; i == (f->tail - 1); i = (i + 1) % f->length) {
+		if (f->data[i] == id)
+			return 1;
+	}

-	return -EINVAL;
+	return 0;
 }

-static const struct video_device vino_device = {
-	.owner		= THIS_MODULE,
-	.type		= VID_TYPE_CAPTURE | VID_TYPE_SUBCAPTURE,
-	.hardware	= VID_HARDWARE_VINO,
-	.name		= "VINO",
-	.open		= vino_open,
-	.close		= vino_close,
-	.ioctl		= vino_ioctl,
-	.mmap		= vino_mmap,
-};
+/* returns true/false */
+static int vino_fifo_full(struct vino_framebuffer_fifo *f)
+{
+	return (f->used == f->length);
+}

-static int __init vino_init(void)
+static unsigned int vino_fifo_get_used(struct vino_framebuffer_fifo *f)
 {
-	unsigned long rev;
-	int i, ret = 0;
+	return f->used;
+}

-	/* VINO is Indy specific beast */
-	if (ip22_is_fullhouse())
-		return -ENODEV;
+static int vino_fifo_enqueue(struct vino_framebuffer_fifo *f, unsigned int id)
+{
+	if (id >= f->length) {
+		return VINO_QUEUE_ERROR;
+	}

-	/*
-	 * VINO is in the EISA address space, so the sysid register will tell
-	 * us if the EISA_PRESENT pin on MC has been pulled low.
-	 *
-	 * If EISA_PRESENT is not set we definitely don't have a VINO equiped
-	 * system.
-	 */
-	if (!(sgimc->systemid & SGIMC_SYSID_EPRESENT)) {
-		printk(KERN_ERR "VINO not found\n");
-		return -ENODEV;
+	if (vino_fifo_has_id(f, id)) {
+		return VINO_QUEUE_ERROR;
 	}

-	vino = (struct sgi_vino *)ioremap(VINO_BASE, sizeof(struct sgi_vino));
-	if (!vino)
-		return -EIO;
+	if (f->used < f->length) {
+		f->data[f->tail] = id;
+		f->tail = (f->tail + 1) % f->length;
+		f->used++;
+	} else {
+		return VINO_QUEUE_ERROR;
+	}

-	/* Okay, once we know that VINO is present we'll read its revision
-	 * safe way. One never knows... */
-	if (get_dbe(rev, &(vino->rev_id))) {
-		printk(KERN_ERR "VINO: failed to read revision register\n");
-		ret = -ENODEV;
-		goto out_unmap;
+	return 0;
+}
+
+static int vino_fifo_peek(struct vino_framebuffer_fifo *f, unsigned int *id)
+{
+	if (f->used > 0) {
+		*id = f->data[f->head];
+	} else {
+		return VINO_QUEUE_ERROR;
 	}
-	if (VINO_ID_VALUE(rev) != VINO_CHIP_ID) {
-		printk(KERN_ERR "VINO is not VINO (Rev/ID: 0x%04lx)\n", rev);
-		ret = -ENODEV;
-		goto out_unmap;
+
+	return 0;
+}
+
+static int vino_fifo_dequeue(struct vino_framebuffer_fifo *f, unsigned int *id)
+{
+	if (f->used > 0) {
+		*id = f->data[f->head];
+		f->head = (f->head + 1) % f->length;
+		f->used--;
+	} else {
+		return VINO_QUEUE_ERROR;
 	}
-	printk(KERN_INFO "VINO Rev: 0x%02lx\n", VINO_REV_NUM(rev));

-	Vino = (struct vino_video *)
-		kmalloc(sizeof(struct vino_video), GFP_KERNEL);
-	if (!Vino) {
-		ret = -ENOMEM;
-		goto out_unmap;
+	return 0;
+}
+
+/* Framebuffer queue functions */
+
+/* execute with queue_lock locked */
+static void vino_queue_free_with_count(struct vino_framebuffer_queue *q,
+				       unsigned int length)
+{
+	unsigned int i;
+
+	q->length = 0;
+	memset(&q->in, 0, sizeof(struct vino_framebuffer_fifo));
+	memset(&q->out, 0, sizeof(struct vino_framebuffer_fifo));
+	for (i = 0; i < length; i++) {
+		dprintk("vino_queue_free_with_count(): freeing buffer %d\n",
+			i);
+		vino_free_buffer(q->buffer[i]);
+		kfree(q->buffer[i]);
 	}

-	Vino->dummy_page = get_zeroed_page(GFP_KERNEL | GFP_DMA);
-	if (!Vino->dummy_page) {
-		ret = -ENOMEM;
-		goto out_free_vino;
+	q->type = VINO_MEMORY_NONE;
+	q->magic = 0;
+}
+
+static void vino_queue_free(struct vino_framebuffer_queue *q)
+{
+	dprintk("vino_queue_free():\n");
+
+	if (q->magic != VINO_QUEUE_MAGIC)
+		return;
+	if (q->type != VINO_MEMORY_MMAP)
+		return;
+
+	down(&q->queue_sem);
+
+	vino_queue_free_with_count(q, q->length);
+
+	up(&q->queue_sem);
+}
+
+static int vino_queue_init(struct vino_framebuffer_queue *q,
+			   unsigned int *length)
+{
+	unsigned int i;
+	int ret = 0;
+
+	dprintk("vino_queue_init(): length = %d\n", *length);
+
+	if (q->magic == VINO_QUEUE_MAGIC) {
+		dprintk("vino_queue_init(): queue already initialized!\n");
+		return -EINVAL;
 	}
-	for (i = 0; i < 4; i++)
-		Vino->dummy_buf[i] = PHYSADDR(Vino->dummy_page);

-	vino->control = 0;
-	/* prevent VINO from throwing spurious interrupts */
-	vino->a.next_4_desc = PHYSADDR(Vino->dummy_buf);
-	vino->b.next_4_desc = PHYSADDR(Vino->dummy_buf);
-	udelay(5);
-	vino->intr_status = 0;
-        /* set threshold level */
-        vino->a.fifo_thres = threshold_a;
-	vino->b.fifo_thres = threshold_b;
+	if (q->type != VINO_MEMORY_NONE) {
+		dprintk("vino_queue_init(): queue already initialized!\n");
+		return -EINVAL;
+	}

-	init_MUTEX(&Vino->input_lock);
+	if (*length < 1)
+		return -EINVAL;

-	if (request_irq(SGI_VINO_IRQ, vino_interrupt, 0, vinostr, NULL)) {
-		printk(KERN_ERR "VINO: irq%02d registration failed\n",
-		       SGI_VINO_IRQ);
-		ret = -EAGAIN;
-		goto out_free_page;
+	down(&q->queue_sem);
+
+	if (*length > VINO_FRAMEBUFFER_MAX_COUNT)
+		*length = VINO_FRAMEBUFFER_MAX_COUNT;
+
+	q->length = 0;
+
+	for (i = 0; i < *length; i++) {
+		dprintk("vino_queue_init(): allocating buffer %d\n", i);
+		q->buffer[i] = kmalloc(sizeof(struct vino_framebuffer),
+				       GFP_KERNEL);
+		if (!q->buffer[i]) {
+			dprintk("vino_queue_init(): kmalloc() failed\n");
+			ret = -ENOMEM;
+			break;
+		}
+
+		ret = vino_allocate_buffer(q->buffer[i],
+					   VINO_FRAMEBUFFER_SIZE);
+		if (ret) {
+			kfree(q->buffer[i]);
+			dprintk("vino_queue_init(): "
+				"vino_allocate_buffer() failed\n");
+			break;
+		}
+
+		q->buffer[i]->id = i;
+		if (i > 0) {
+			q->buffer[i]->offset = q->buffer[i - 1]->offset +
+				q->buffer[i - 1]->size;
+		} else {
+			q->buffer[i]->offset = 0;
+		}
+
+		spin_lock_init(&q->buffer[i]->state_lock);
+
+		dprintk("vino_queue_init(): buffer = %d, offset = %d, "
+			"size = %d\n", i, q->buffer[i]->offset,
+			q->buffer[i]->size);
 	}

-	ret = vino_i2c_add_bus();
 	if (ret) {
-		printk(KERN_ERR "VINO: I2C bus registration failed\n");
-		goto out_free_irq;
+		vino_queue_free_with_count(q, i);
+		*length = 0;
+	} else {
+		q->length = *length;
+		vino_fifo_init(&q->in, q->length);
+		vino_fifo_init(&q->out, q->length);
+		q->type = VINO_MEMORY_MMAP;
+		q->magic = VINO_QUEUE_MAGIC;
 	}

-	if (video_register_device(&Vino->chA.vdev, VFL_TYPE_GRABBER, -1) < 0) {
-		printk("%s, chnl %d: device registration failed.\n",
-			Vino->chA.vdev.name, Vino->chA.chan);
-		ret = -EINVAL;
-		goto out_i2c_del_bus;
+	up(&q->queue_sem);
+
+	return ret;
+}
+
+static struct vino_framebuffer *vino_queue_add(struct
+					       vino_framebuffer_queue *q,
+					       unsigned int id)
+{
+	struct vino_framebuffer *ret = NULL;
+	unsigned int total;
+	unsigned long flags;
+
+	dprintk("vino_queue_add(): id = %d\n", id);
+
+	if (q->magic != VINO_QUEUE_MAGIC) {
+		return ret;
 	}
-	if (video_register_device(&Vino->chB.vdev, VFL_TYPE_GRABBER, -1) < 0) {
-		printk("%s, chnl %d: device registration failed.\n",
-			Vino->chB.vdev.name, Vino->chB.chan);
-		ret = -EINVAL;
-		goto out_unregister_vdev;
+
+	spin_lock_irqsave(&q->queue_lock, flags);
+
+	if (q->length == 0)
+		goto out;
+
+	if (id >= q->length)
+		goto out;
+
+	/* not needed?: if (vino_fifo_full(&q->out)) {
+		goto out;
+		}*/
+	/* check that outgoing queue isn't already full
+	 * (or that it won't become full) */
+	total = vino_fifo_get_used(&q->in) +
+		vino_fifo_get_used(&q->out);
+	if (total >= q->length)
+		goto out;
+
+	if (vino_fifo_enqueue(&q->in, id))
+		goto out;
+
+	ret = q->buffer[id];
+
+out:
+	spin_unlock_irqrestore(&q->queue_lock, flags);
+
+	return ret;
+}
+
+static struct vino_framebuffer *vino_queue_transfer(struct
+						    vino_framebuffer_queue *q)
+{
+	struct vino_framebuffer *ret = NULL;
+	struct vino_framebuffer *fb;
+	int id;
+	unsigned long flags;
+
+	dprintk("vino_queue_transfer():\n");
+
+	if (q->magic != VINO_QUEUE_MAGIC) {
+		return ret;
 	}

-	return 0;
+	spin_lock_irqsave(&q->queue_lock, flags);
+
+	if (q->length == 0)
+		goto out;
+
+	// now this actually removes an entry from the incoming queue
+	if (vino_fifo_dequeue(&q->in, &id)) {
+		goto out;
+	}

-out_unregister_vdev:
-	video_unregister_device(&Vino->chA.vdev);
-out_i2c_del_bus:
-	vino_i2c_del_bus();
-out_free_irq:
-	free_irq(SGI_VINO_IRQ, NULL);
-out_free_page:
-	free_page(Vino->dummy_page);
-out_free_vino:
-	kfree(Vino);
-out_unmap:
-	iounmap(vino);
+	dprintk("vino_queue_transfer(): id = %d\n", id);
+	fb = q->buffer[id];
+
+	// we have already checked that the outgoing queue is not full, but...
+	if (vino_fifo_enqueue(&q->out, id)) {
+		printk(KERN_ERR "vino_queue_transfer(): "
+		       "outgoing queue is full, this shouldn't happen!\n");
+		goto out;
+	}
+
+	ret = fb;
+out:
+	spin_unlock_irqrestore(&q->queue_lock, flags);

 	return ret;
 }

-static void __exit vino_exit(void)
+/* returns true/false */
+static int vino_queue_incoming_contains(struct vino_framebuffer_queue *q,
+					unsigned int id)
 {
-	video_unregister_device(&Vino->chA.vdev);
-	video_unregister_device(&Vino->chB.vdev);
-	vino_i2c_del_bus();
-	free_irq(SGI_VINO_IRQ, NULL);
-	free_page(Vino->dummy_page);
-	kfree(Vino);
-	iounmap(vino);
+	int ret = 0;
+	unsigned long flags;
+
+	if (q->magic != VINO_QUEUE_MAGIC) {
+		return ret;
+	}
+
+	spin_lock_irqsave(&q->queue_lock, flags);
+
+	if (q->length == 0)
+		goto out;
+
+	ret = vino_fifo_has_id(&q->in, id);
+
+out:
+	spin_unlock_irqrestore(&q->queue_lock, flags);
+
+	return ret;
 }

-module_init(vino_init);
-module_exit(vino_exit);
+/* returns true/false */
+static int vino_queue_outgoing_contains(struct vino_framebuffer_queue *q,
+					unsigned int id)
+{
+	int ret = 0;
+	unsigned long flags;
+
+	if (q->magic != VINO_QUEUE_MAGIC) {
+		return ret;
+	}
+
+	spin_lock_irqsave(&q->queue_lock, flags);

-MODULE_DESCRIPTION("Video4Linux driver for SGI Indy VINO (IndyCam)");
-MODULE_LICENSE("GPL");
+	if (q->length == 0)
+		goto out;
+
+	ret = vino_fifo_has_id(&q->out, id);
+
+out:
+	spin_unlock_irqrestore(&q->queue_lock, flags);
+
+	return ret;
+}
+
+static int vino_queue_get_incoming(struct vino_framebuffer_queue *q,
+				   unsigned int *used)
+{
+	int ret = 0;
+	unsigned long flags;
+
+	if (q->magic != VINO_QUEUE_MAGIC) {
+		return VINO_QUEUE_ERROR;
+	}
+
+	spin_lock_irqsave(&q->queue_lock, flags);
+
+	if (q->length == 0) {
+		ret = VINO_QUEUE_ERROR;
+		goto out;
+	}
+
+	*used = vino_fifo_get_used(&q->in);
+
+out:
+	spin_unlock_irqrestore(&q->queue_lock, flags);
+
+	return ret;
+}
+
+static int vino_queue_get_outgoing(struct vino_framebuffer_queue *q,
+				   unsigned int *used)
+{
+	int ret = 0;
+	unsigned long flags;
+
+	if (q->magic != VINO_QUEUE_MAGIC) {
+		return VINO_QUEUE_ERROR;
+	}
+
+	spin_lock_irqsave(&q->queue_lock, flags);
+
+	if (q->length == 0) {
+		ret = VINO_QUEUE_ERROR;
+		goto out;
+	}
+
+	*used = vino_fifo_get_used(&q->out);
+
+out:
+	spin_unlock_irqrestore(&q->queue_lock, flags);
+
+	return ret;
+}
+
+static int vino_queue_get_total(struct vino_framebuffer_queue *q,
+				unsigned int *total)
+{
+	int ret = 0;
+	unsigned long flags;
+
+	if (q->magic != VINO_QUEUE_MAGIC) {
+		return VINO_QUEUE_ERROR;
+	}
+
+	spin_lock_irqsave(&q->queue_lock, flags);
+
+	if (q->length == 0) {
+		ret = VINO_QUEUE_ERROR;
+		goto out;
+	}
+
+	*total = vino_fifo_get_used(&q->in) +
+		vino_fifo_get_used(&q->out);
+
+out:
+	spin_unlock_irqrestore(&q->queue_lock, flags);
+
+	return ret;
+}
+
+static struct vino_framebuffer *vino_queue_peek(struct
+						vino_framebuffer_queue *q,
+						unsigned int *id)
+{
+	struct vino_framebuffer *ret = NULL;
+	unsigned long flags;
+
+	if (q->magic != VINO_QUEUE_MAGIC) {
+		return ret;
+	}
+
+	spin_lock_irqsave(&q->queue_lock, flags);
+
+	if (q->length == 0)
+		goto out;
+
+	if (vino_fifo_peek(&q->in, id)) {
+		goto out;
+	}
+
+	ret = q->buffer[*id];
+out:
+	spin_unlock_irqrestore(&q->queue_lock, flags);
+
+	return ret;
+}
+
+static struct vino_framebuffer *vino_queue_remove(struct
+						  vino_framebuffer_queue *q,
+						  unsigned int *id)
+{
+	struct vino_framebuffer *ret = NULL;
+	unsigned long flags;
+	dprintk("vino_queue_remove():\n");
+
+	if (q->magic != VINO_QUEUE_MAGIC) {
+		return ret;
+	}
+
+	spin_lock_irqsave(&q->queue_lock, flags);
+
+	if (q->length == 0)
+		goto out;
+
+	if (vino_fifo_dequeue(&q->out, id)) {
+		goto out;
+	}
+
+	dprintk("vino_queue_remove(): id = %d\n", *id);
+	ret = q->buffer[*id];
+out:
+	spin_unlock_irqrestore(&q->queue_lock, flags);
+
+	return ret;
+}
+
+static struct
+vino_framebuffer *vino_queue_get_buffer(struct vino_framebuffer_queue *q,
+					unsigned int id)
+{
+	struct vino_framebuffer *ret = NULL;
+	unsigned long flags;
+
+	if (q->magic != VINO_QUEUE_MAGIC) {
+		return ret;
+	}
+
+	spin_lock_irqsave(&q->queue_lock, flags);
+
+	if (q->length == 0)
+		goto out;
+
+	if (id >= q->length)
+		goto out;
+
+	ret = q->buffer[id];
+ out:
+	spin_unlock_irqrestore(&q->queue_lock, flags);
+
+	return ret;
+}
+
+static unsigned int vino_queue_get_length(struct vino_framebuffer_queue *q)
+{
+	unsigned int length = 0;
+	unsigned long flags;
+
+	if (q->magic != VINO_QUEUE_MAGIC) {
+		return length;
+	}
+
+	spin_lock_irqsave(&q->queue_lock, flags);
+	length = q->length;
+	spin_unlock_irqrestore(&q->queue_lock, flags);
+
+	return length;
+}
+
+static int vino_queue_has_mapped_buffers(struct vino_framebuffer_queue *q)
+{
+	unsigned int i;
+	int ret = 0;
+	unsigned long flags;
+
+	if (q->magic != VINO_QUEUE_MAGIC) {
+		return ret;
+	}
+
+	spin_lock_irqsave(&q->queue_lock, flags);
+	for (i = 0; i < q->length; i++) {
+		if (q->buffer[i]->map_count > 0) {
+			ret = 1;
+			break;
+		}
+	}
+	spin_unlock_irqrestore(&q->queue_lock, flags);
+
+	return ret;
+}
+
+/* VINO functions */
+
+/* execute with input_lock locked */
+static void vino_update_line_size(struct vino_channel_settings *vcs)
+{
+	unsigned int w = vcs->clipping.right - vcs->clipping.left;
+	unsigned int d = vcs->decimation;
+	unsigned int bpp = vino_data_formats[vcs->data_format].bpp;
+        unsigned int lsize;
+
+	dprintk("update_line_size(): before: w = %d, d = %d, "
+		"line_size = %d\n", w, d, vcs->line_size);
+        /* line size must be multiple of 8 bytes */
+	lsize = (bpp * (w / d)) & ~7;
+	w = (lsize / bpp) * d;
+
+	vcs->clipping.right = vcs->clipping.left + w;
+	vcs->line_size = lsize;
+	dprintk("update_line_size(): after: w = %d, d = %d, "
+		"line_size = %d\n", w, d, vcs->line_size);
+}
+
+/* execute with input_lock locked */
+static void vino_set_clipping(struct vino_channel_settings *vcs,
+			      unsigned int x, unsigned int y,
+			      unsigned int w, unsigned int h)
+{
+	unsigned int maxwidth, maxheight;
+	unsigned int d;
+
+	maxwidth = vino_data_norms[vcs->data_norm].width;
+	maxheight = vino_data_norms[vcs->data_norm].height;
+	d = vcs->decimation;
+
+	y &= ~1;	/* odd/even fields */
+
+	if (x > maxwidth) {
+		x = 0;
+	}
+	if (y > maxheight) {
+		y = 0;
+	}
+
+	if (((w / d) < VINO_MIN_WIDTH)
+	    || ((h / d) < VINO_MIN_HEIGHT)) {
+		w = VINO_MIN_WIDTH * d;
+		h = VINO_MIN_HEIGHT * d;
+	}
+
+	if ((x + w) > maxwidth) {
+		w = maxwidth - x;
+		if ((w / d) < VINO_MIN_WIDTH)
+			x = maxwidth - VINO_MIN_WIDTH * d;
+	}
+	if ((y + h) > maxheight) {
+		h = maxheight - y;
+		if ((h / d) < VINO_MIN_HEIGHT)
+			y = maxheight - VINO_MIN_HEIGHT * d;
+	}
+
+	vcs->clipping.left = x;
+	vcs->clipping.top = y;
+	vcs->clipping.right = x + w;
+	vcs->clipping.bottom = y + h;
+
+	vino_update_line_size(vcs);
+
+	dprintk("clipping %d, %d, %d, %d / %d - %d\n",
+		vcs->clipping.left, vcs->clipping.top, vcs->clipping.right,
+		vcs->clipping.bottom, vcs->decimation, vcs->line_size);
+}
+
+/* execute with input_lock locked */
+static void vino_set_default_clipping(struct vino_channel_settings *vcs)
+{
+	vino_set_clipping(vcs, 0, 0, vino_data_norms[vcs->data_norm].width,
+			  vino_data_norms[vcs->data_norm].height);
+}
+
+/* execute with input_lock locked */
+static void vino_set_scaling(struct vino_channel_settings *vcs,
+			     unsigned int w, unsigned int h)
+{
+	unsigned int x, y, curw, curh, d;
+
+	x = vcs->clipping.left;
+	y = vcs->clipping.top;
+	curw = vcs->clipping.right - vcs->clipping.left;
+	curh = vcs->clipping.bottom - vcs->clipping.top;
+
+	d = max(curw / w, curh / h);
+
+	dprintk("scaling w: %d, h: %d, curw: %d, curh: %d, d: %d\n",
+		w, h, curw, curh, d);
+
+	if (d < 1) {
+		d = 1;
+	}
+	if (d > 8) {
+		d = 8;
+	}
+
+	vcs->decimation = d;
+	vino_set_clipping(vcs, x, y, w * d, h * d);
+
+	dprintk("scaling %d, %d, %d, %d / %d - %d\n", vcs->clipping.left,
+		vcs->clipping.top, vcs->clipping.right, vcs->clipping.bottom,
+		vcs->decimation, vcs->line_size);
+}
+
+/* execute with input_lock locked */
+static void vino_reset_scaling(struct vino_channel_settings *vcs)
+{
+	vino_set_scaling(vcs, vcs->clipping.right - vcs->clipping.left,
+			 vcs->clipping.bottom - vcs->clipping.top);
+}
+
+/* execute with input_lock locked */
+static void vino_set_framerate(struct vino_channel_settings *vcs,
+			       unsigned int fps)
+{
+	unsigned int mask;
+
+	switch (vcs->data_norm) {
+	case VINO_DATA_NORM_NTSC:
+	case VINO_DATA_NORM_D1:
+		fps = (unsigned int)(fps / 6) * 6; // FIXME: round!
+
+		if (fps < vino_data_norms[vcs->data_norm].fps_min)
+			fps = vino_data_norms[vcs->data_norm].fps_min;
+		if (fps > vino_data_norms[vcs->data_norm].fps_max)
+			fps = vino_data_norms[vcs->data_norm].fps_max;
+
+		switch (fps) {
+		case 6:
+			mask = 0x003;
+			break;
+		case 12:
+			mask = 0x0c3;
+			break;
+		case 18:
+			mask = 0x333;
+			break;
+		case 24:
+			mask = 0x3ff;
+			break;
+		case 30:
+			mask = 0xfff;
+			break;
+		default:
+			mask = VINO_FRAMERT_FULL;
+		}
+		vcs->framert_reg = VINO_FRAMERT_RT(mask);
+		break;
+	case VINO_DATA_NORM_PAL:
+	case VINO_DATA_NORM_SECAM:
+		fps = (unsigned int)(fps / 5) * 5; // FIXME: round!
+
+		if (fps < vino_data_norms[vcs->data_norm].fps_min)
+			fps = vino_data_norms[vcs->data_norm].fps_min;
+		if (fps > vino_data_norms[vcs->data_norm].fps_max)
+			fps = vino_data_norms[vcs->data_norm].fps_max;
+
+		switch (fps) {
+		case 5:
+			mask = 0x003;
+			break;
+		case 10:
+			mask = 0x0c3;
+			break;
+		case 15:
+			mask = 0x333;
+			break;
+		case 20:
+			mask = 0x0ff;
+			break;
+		case 25:
+			mask = 0x3ff;
+			break;
+		default:
+			mask = VINO_FRAMERT_FULL;
+		}
+		vcs->framert_reg = VINO_FRAMERT_RT(mask) | VINO_FRAMERT_PAL;
+		break;
+	}
+
+	vcs->fps = fps;
+}
+
+/* execute with input_lock locked */
+static void vino_set_default_framerate(struct vino_channel_settings *vcs)
+{
+	vino_set_framerate(vcs, vino_data_norms[vcs->data_norm].fps_max);
+}
+
+/*
+ * Prepare VINO for DMA transfer...
+ * (execute only with vino_lock and input_lock locked)
+ */
+static int vino_dma_setup(struct vino_channel_settings *vcs,
+			  struct vino_framebuffer *fb)
+{
+	u32 ctrl, intr;
+	struct sgi_vino_channel *ch;
+	const struct vino_data_norm *norm;
+
+	dprintk("vino_dma_setup():\n");
+
+	vcs->field = 0;
+	fb->frame_counter = 0;
+
+	ch = (vcs->channel == VINO_CHANNEL_A) ? &vino->a : &vino->b;
+	norm = &vino_data_norms[vcs->data_norm];
+
+	ch->page_index = 0;
+	ch->line_count = 0;
+
+	/* VINO line size register is set 8 bytes less than actual */
+	ch->line_size = vcs->line_size - 8;
+
+	/* let VINO know where to transfer data */
+	ch->start_desc_tbl = fb->desc_table.dma;
+	ch->next_4_desc = fb->desc_table.dma;
+
+	/* give vino time to fetch the first four descriptors, 5 usec
+	 * should be more than enough time */
+	udelay(VINO_DESC_FETCH_DELAY);
+
+	/* set the alpha register */
+	ch->alpha = vcs->alpha;
+
+	/* set clipping registers */
+	ch->clip_start = VINO_CLIP_ODD(norm->odd.top + vcs->clipping.top / 2) |
+		VINO_CLIP_EVEN(norm->even.top +
+			       vcs->clipping.top / 2) |
+		VINO_CLIP_X(vcs->clipping.left);
+	ch->clip_end = VINO_CLIP_ODD(norm->odd.top +
+				     vcs->clipping.bottom / 2 - 1) |
+		VINO_CLIP_EVEN(norm->even.top +
+			       vcs->clipping.bottom / 2 - 1) |
+		VINO_CLIP_X(vcs->clipping.right);
+	/* FIXME: end-of-field bug workaround
+		       VINO_CLIP_X(VINO_PAL_WIDTH);
+	 */
+
+	/* set the size of actual content in the buffer (DECIMATION !) */
+	fb->data_size = ((vcs->clipping.right - vcs->clipping.left) /
+			 vcs->decimation) *
+		((vcs->clipping.bottom - vcs->clipping.top) /
+		 vcs->decimation) *
+		vino_data_formats[vcs->data_format].bpp;
+
+	ch->frame_rate = vcs->framert_reg;
+
+	ctrl = vino->control;
+	intr = vino->intr_status;
+
+	if (vcs->channel == VINO_CHANNEL_A) {
+		/* All interrupt conditions for this channel was cleared
+		 * so clear the interrupt status register and enable
+		 * interrupts */
+		intr &=	~VINO_INTSTAT_A;
+		ctrl |= VINO_CTRL_A_INT;
+
+		/* enable synchronization */
+		ctrl |= VINO_CTRL_A_SYNC_ENBL;
+
+		/* enable frame assembly */
+		ctrl |= VINO_CTRL_A_INTERLEAVE_ENBL;
+
+		/* set decimation used */
+		if (vcs->decimation < 2)
+			ctrl &= ~VINO_CTRL_A_DEC_ENBL;
+		else {
+			ctrl |= VINO_CTRL_A_DEC_ENBL;
+			ctrl &= ~VINO_CTRL_A_DEC_SCALE_MASK;
+			ctrl |= (vcs->decimation - 1) <<
+				VINO_CTRL_A_DEC_SCALE_SHIFT;
+		}
+
+		/* select input interface */
+		if (vcs->input == VINO_INPUT_D1)
+			ctrl |= VINO_CTRL_A_SELECT;
+		else
+			ctrl &= ~VINO_CTRL_A_SELECT;
+
+		/* palette */
+		ctrl &= ~(VINO_CTRL_A_LUMA_ONLY | VINO_CTRL_A_RGB |
+			  VINO_CTRL_A_DITHER);
+	} else {
+		intr &= ~VINO_INTSTAT_B;
+		ctrl |= VINO_CTRL_B_INT;
+
+		ctrl |= VINO_CTRL_B_SYNC_ENBL;
+		ctrl |= VINO_CTRL_B_INTERLEAVE_ENBL;
+
+		if (vcs->decimation < 2)
+			ctrl &= ~VINO_CTRL_B_DEC_ENBL;
+		else {
+			ctrl |= VINO_CTRL_B_DEC_ENBL;
+			ctrl &= ~VINO_CTRL_B_DEC_SCALE_MASK;
+			ctrl |= (vcs->decimation - 1) <<
+				VINO_CTRL_B_DEC_SCALE_SHIFT;
+
+		}
+		if (vcs->input == VINO_INPUT_D1)
+			ctrl |= VINO_CTRL_B_SELECT;
+		else
+			ctrl &= ~VINO_CTRL_B_SELECT;
+
+		ctrl &= ~(VINO_CTRL_B_LUMA_ONLY | VINO_CTRL_B_RGB |
+			  VINO_CTRL_B_DITHER);
+	}
+
+	/* set palette */
+	fb->data_format = vcs->data_format;
+
+	switch (vcs->data_format) {
+		case VINO_DATA_FMT_GREY:
+			ctrl |= (vcs->channel == VINO_CHANNEL_A) ?
+				VINO_CTRL_A_LUMA_ONLY : VINO_CTRL_B_LUMA_ONLY;
+			break;
+		case VINO_DATA_FMT_RGB32:
+			ctrl |= (vcs->channel == VINO_CHANNEL_A) ?
+				VINO_CTRL_A_RGB : VINO_CTRL_B_RGB;
+			break;
+		case VINO_DATA_FMT_YUV:
+			/* nothing needs to be done */
+			break;
+		case VINO_DATA_FMT_RGB332:
+			ctrl |= (vcs->channel == VINO_CHANNEL_A) ?
+				VINO_CTRL_A_RGB | VINO_CTRL_A_DITHER :
+				VINO_CTRL_B_RGB | VINO_CTRL_B_DITHER;
+			break;
+	}
+
+	vino->intr_status = intr;
+	vino->control = ctrl;
+
+	return 0;
+}
+
+/* (execute only with vino_lock locked) */
+static void vino_dma_start(struct vino_channel_settings *vcs)
+{
+	u32 ctrl = vino->control;
+
+	dprintk("vino_dma_start():\n");
+	ctrl |= (vcs->channel == VINO_CHANNEL_A) ?
+		VINO_CTRL_A_DMA_ENBL : VINO_CTRL_B_DMA_ENBL;
+	vino->control = ctrl;
+}
+
+/* (execute only with vino_lock locked) */
+static void vino_dma_stop(struct vino_channel_settings *vcs)
+{
+	u32 ctrl = vino->control;
+
+	ctrl &= (vcs->channel == VINO_CHANNEL_A) ?
+		~VINO_CTRL_A_DMA_ENBL : ~VINO_CTRL_B_DMA_ENBL;
+	vino->control = ctrl;
+	dprintk("vino_dma_stop():\n");
+}
+
+/*
+ * Load dummy page to descriptor registers. This prevents generating of
+ * spurious interrupts. (execute only with vino_lock locked)
+ */
+static void vino_clear_interrupt(struct vino_channel_settings *vcs)
+{
+	struct sgi_vino_channel *ch;
+
+	ch = (vcs->channel == VINO_CHANNEL_A) ? &vino->a : &vino->b;
+
+	ch->page_index = 0;
+	ch->line_count = 0;
+
+	ch->start_desc_tbl = vino_drvdata->dummy_desc_table.dma;
+	ch->next_4_desc = vino_drvdata->dummy_desc_table.dma;
+
+	udelay(VINO_DESC_FETCH_DELAY);
+	dprintk("channel %c clear interrupt condition\n",
+	       (vcs->channel == VINO_CHANNEL_A) ? 'A':'B');
+}
+
+static int vino_capture(struct vino_channel_settings *vcs,
+			struct vino_framebuffer *fb)
+{
+	int err = 0;
+	unsigned long flags, flags2;
+
+	spin_lock_irqsave(&fb->state_lock, flags);
+
+	if (fb->state == VINO_FRAMEBUFFER_IN_USE)
+		err = -EBUSY;
+	fb->state = VINO_FRAMEBUFFER_IN_USE;
+
+	spin_unlock_irqrestore(&fb->state_lock, flags);
+
+	if (err)
+		return err;
+
+	spin_lock_irqsave(&vino_drvdata->vino_lock, flags);
+	spin_lock_irqsave(&vino_drvdata->input_lock, flags2);
+
+	vino_dma_setup(vcs, fb);
+	vino_dma_start(vcs);
+
+	spin_unlock_irqrestore(&vino_drvdata->input_lock, flags2);
+	spin_unlock_irqrestore(&vino_drvdata->vino_lock, flags);
+
+	return err;
+}
+
+static
+struct vino_framebuffer *vino_capture_enqueue(struct
+					      vino_channel_settings *vcs,
+					      unsigned int index)
+{
+	struct vino_framebuffer *fb;
+	unsigned long flags;
+
+	dprintk("vino_capture_enqueue():\n");
+
+	spin_lock_irqsave(&vcs->capture_lock, flags);
+
+	fb = vino_queue_add(&vcs->fb_queue, index);
+	if (fb == NULL) {
+		dprintk("vino_capture_enqueue(): vino_queue_add() failed, "
+			"queue full?\n");
+		goto out;
+	}
+out:
+	spin_unlock_irqrestore(&vcs->capture_lock, flags);
+
+	return fb;
+}
+
+static int vino_capture_next(struct vino_channel_settings *vcs, int start)
+{
+	struct vino_framebuffer *fb;
+	unsigned int incoming, id;
+	int err = 0;
+	unsigned long flags, flags2;
+
+	dprintk("vino_capture_next():\n");
+
+	spin_lock_irqsave(&vcs->capture_lock, flags);
+
+	if (start) {
+		/* start capture only if capture isn't in progress already */
+		if (vcs->capturing) {
+			spin_unlock_irqrestore(&vcs->capture_lock, flags);
+			return 0;
+		}
+
+	} else {
+		/* capture next frame:
+		 * stop capture if capturing is not set */
+		if (!vcs->capturing) {
+			spin_unlock_irqrestore(&vcs->capture_lock, flags);
+			return 0;
+		}
+	}
+
+	err = vino_queue_get_incoming(&vcs->fb_queue, &incoming);
+	if (err) {
+		dprintk("vino_capture_next(): vino_queue_get_incoming() "
+			"failed\n");
+		err = -EINVAL;
+		goto out;
+	}
+	if (incoming == 0) {
+		dprintk("vino_capture_next(): no buffers available\n");
+		goto out;
+	}
+
+	fb = vino_queue_peek(&vcs->fb_queue, &id);
+	if (fb == NULL) {
+		dprintk("vino_capture_next(): vino_queue_peek() failed\n");
+		err = -EINVAL;
+		goto out;
+	}
+
+	spin_lock_irqsave(&fb->state_lock, flags2);
+	fb->state = VINO_FRAMEBUFFER_UNUSED;
+	spin_unlock_irqrestore(&fb->state_lock, flags2);
+
+	if (start) {
+		vcs->capturing = 1;
+	}
+
+	spin_unlock_irqrestore(&vcs->capture_lock, flags);
+
+	err = vino_capture(vcs, fb);
+
+	return err;
+
+out:
+	vcs->capturing = 0;
+	spin_unlock_irqrestore(&vcs->capture_lock, flags);
+
+	return err;
+}
+
+static int vino_is_capturing(struct vino_channel_settings *vcs)
+{
+	int ret;
+	unsigned long flags;
+
+	spin_lock_irqsave(&vcs->capture_lock, flags);
+
+	ret = vcs->capturing;
+
+	spin_unlock_irqrestore(&vcs->capture_lock, flags);
+
+	return ret;
+}
+
+/* waits until a frame is captured */
+static int vino_wait_for_frame(struct vino_channel_settings *vcs)
+{
+	wait_queue_t wait;
+	int err = 0;
+
+	dprintk("vino_wait_for_frame():\n");
+
+	init_waitqueue_entry(&wait, current);
+	/* add ourselves into wait queue */
+	add_wait_queue(&vcs->fb_queue.frame_wait_queue, &wait);
+	/* and set current state */
+	set_current_state(TASK_INTERRUPTIBLE);
+
+	/* to ensure that schedule_timeout will return immediately
+	 * if VINO interrupt was triggred meanwhile */
+	schedule_timeout(HZ / 10);
+
+	if (signal_pending(current))
+		err = -EINTR;
+
+	remove_wait_queue(&vcs->fb_queue.frame_wait_queue, &wait);
+
+	dprintk("vino_wait_for_frame(): waiting for frame %s\n",
+		err ? "failed" : "ok");
+
+	return err;
+}
+
+/* the function assumes that PAGE_SIZE % 4 == 0 */
+static void vino_convert_to_rgba(struct vino_framebuffer *fb) {
+	unsigned char *pageptr;
+	unsigned int page, i;
+	unsigned char a;
+
+	for (page = 0; page < fb->desc_table.page_count; page++) {
+		pageptr = (unsigned char *)fb->desc_table.virtual[page];
+
+		for (i = 0; i < PAGE_SIZE; i += 4) {
+			a = pageptr[0];
+			pageptr[0] = pageptr[3];
+			pageptr[1] = pageptr[2];
+			pageptr[2] = pageptr[1];
+			pageptr[3] = a;
+			pageptr += 4;
+		}
+	}
+}
+
+/* checks if the buffer is in correct state and syncs data */
+static int vino_check_buffer(struct vino_channel_settings *vcs,
+			     struct vino_framebuffer *fb)
+{
+	int err = 0;
+	unsigned long flags;
+
+	dprintk("vino_check_buffer():\n");
+
+	spin_lock_irqsave(&fb->state_lock, flags);
+	switch (fb->state) {
+	case VINO_FRAMEBUFFER_IN_USE:
+		err = -EIO;
+		break;
+	case VINO_FRAMEBUFFER_READY:
+		vino_sync_buffer(fb);
+		fb->state = VINO_FRAMEBUFFER_UNUSED;
+		break;
+	default:
+		err = -EINVAL;
+	}
+	spin_unlock_irqrestore(&fb->state_lock, flags);
+
+	if (!err) {
+		if (vino_pixel_conversion
+		    && (fb->data_format == VINO_DATA_FMT_RGB32)) {
+			vino_convert_to_rgba(fb);
+		}
+	} else if (err && (err != -EINVAL)) {
+		dprintk("vino_check_buffer(): buffer not ready\n");
+
+		spin_lock_irqsave(&vino_drvdata->vino_lock, flags);
+		vino_dma_stop(vcs);
+		vino_clear_interrupt(vcs);
+		spin_unlock_irqrestore(&vino_drvdata->vino_lock, flags);
+	}
+
+	return err;
+}
+
+/* forcefully terminates capture */
+static void vino_capture_stop(struct vino_channel_settings *vcs)
+{
+	unsigned int incoming = 0, outgoing = 0, id;
+	unsigned long flags, flags2;
+
+	dprintk("vino_capture_stop():\n");
+
+	spin_lock_irqsave(&vcs->capture_lock, flags);
+	/* unset capturing to stop queue processing */
+	vcs->capturing = 0;
+
+	spin_lock_irqsave(&vino_drvdata->vino_lock, flags2);
+
+	vino_dma_stop(vcs);
+	vino_clear_interrupt(vcs);
+
+	spin_unlock_irqrestore(&vino_drvdata->vino_lock, flags2);
+
+	/* remove all items from the queue */
+	if (vino_queue_get_incoming(&vcs->fb_queue, &incoming)) {
+		dprintk("vino_capture_stop(): "
+			"vino_queue_get_incoming() failed\n");
+		goto out;
+	}
+	while (incoming > 0) {
+		vino_queue_transfer(&vcs->fb_queue);
+
+		if (vino_queue_get_incoming(&vcs->fb_queue, &incoming)) {
+			dprintk("vino_capture_stop(): "
+				"vino_queue_get_incoming() failed\n");
+			goto out;
+		}
+	}
+
+	if (vino_queue_get_outgoing(&vcs->fb_queue, &outgoing)) {
+		dprintk("vino_capture_stop(): "
+			"vino_queue_get_outgoing() failed\n");
+		goto out;
+	}
+	while (outgoing > 0) {
+		vino_queue_remove(&vcs->fb_queue, &id);
+
+		if (vino_queue_get_outgoing(&vcs->fb_queue, &outgoing)) {
+			dprintk("vino_capture_stop(): "
+				"vino_queue_get_outgoing() failed\n");
+			goto out;
+		}
+	}
+
+out:
+	spin_unlock_irqrestore(&vcs->capture_lock, flags);
+}
+
+static int vino_capture_failed(struct vino_channel_settings *vcs)
+{
+	struct vino_framebuffer *fb;
+	unsigned long flags;
+	unsigned int i;
+	int ret;
+
+	dprintk("vino_capture_failed():\n");
+
+	spin_lock_irqsave(&vino_drvdata->vino_lock, flags);
+
+	vino_dma_stop(vcs);
+	vino_clear_interrupt(vcs);
+
+	spin_unlock_irqrestore(&vino_drvdata->vino_lock, flags);
+
+	ret = vino_queue_get_incoming(&vcs->fb_queue, &i);
+	if (ret == VINO_QUEUE_ERROR) {
+		dprintk("vino_queue_get_incoming() failed\n");
+		return -EINVAL;
+	}
+	if (i == 0) {
+		/* no buffers to process */
+		return 0;
+	}
+
+	fb = vino_queue_peek(&vcs->fb_queue, &i);
+	if (fb == NULL) {
+		dprintk("vino_queue_peek() failed\n");
+		return -EINVAL;
+	}
+
+	spin_lock_irqsave(&fb->state_lock, flags);
+	if (fb->state == VINO_FRAMEBUFFER_IN_USE) {
+		fb->state = VINO_FRAMEBUFFER_UNUSED;
+		vino_queue_transfer(&vcs->fb_queue);
+		vino_queue_remove(&vcs->fb_queue, &i);
+		/* we should actually discard the newest frame,
+		 * but who cares ... */
+	}
+	spin_unlock_irqrestore(&fb->state_lock, flags);
+
+	return 0;
+}
+
+static void vino_frame_done(struct vino_channel_settings *vcs,
+			    unsigned int fc)
+{
+	struct vino_framebuffer *fb;
+	unsigned long flags;
+
+	spin_lock_irqsave(&vcs->capture_lock, flags);
+	fb = vino_queue_transfer(&vcs->fb_queue);
+	if (!fb) {
+		spin_unlock_irqrestore(&vcs->capture_lock, flags);
+		dprintk("vino_frame_done(): vino_queue_transfer() failed!\n");
+		return;
+	}
+	spin_unlock_irqrestore(&vcs->capture_lock, flags);
+
+	fb->frame_counter = fc;
+	do_gettimeofday(&fb->timestamp);
+
+	spin_lock_irqsave(&fb->state_lock, flags);
+	if (fb->state == VINO_FRAMEBUFFER_IN_USE)
+		fb->state = VINO_FRAMEBUFFER_READY;
+	spin_unlock_irqrestore(&fb->state_lock, flags);
+
+	wake_up(&vcs->fb_queue.frame_wait_queue);
+
+	vino_capture_next(vcs, 0);
+}
+
+static irqreturn_t vino_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	u32 intr;
+	unsigned int fc_a, fc_b;
+	int done_a = 0;
+	int done_b = 0;
+
+	spin_lock(&vino_drvdata->vino_lock);
+
+	intr = vino->intr_status;
+	fc_a = vino->a.field_counter / 2;
+	fc_b = vino->b.field_counter / 2;
+
+	// TODO: handle error-interrupts in some special way ?
+
+ 	if (intr & VINO_INTSTAT_A) {
+		if (intr & VINO_INTSTAT_A_EOF) {
+			vino_drvdata->a.field++;
+			if (vino_drvdata->a.field > 1) {
+				vino_dma_stop(&vino_drvdata->a);
+				vino_clear_interrupt(&vino_drvdata->a);
+				vino_drvdata->a.field = 0;
+				done_a = 1;
+			}
+			dprintk("intr: channel A end-of-field interrupt: "
+				"%04x\n", intr);
+		} else {
+			vino_dma_stop(&vino_drvdata->a);
+			vino_clear_interrupt(&vino_drvdata->a);
+			done_a = 1;
+			dprintk("channel A error interrupt: %04x\n", intr);
+		}
+	}
+	if (intr & VINO_INTSTAT_B) {
+		if (intr & VINO_INTSTAT_B_EOF) {
+			vino_drvdata->b.field++;
+			if (vino_drvdata->b.field > 1) {
+				vino_dma_stop(&vino_drvdata->b);
+				vino_clear_interrupt(&vino_drvdata->b);
+				vino_drvdata->b.field = 0;
+				done_b = 1;
+			}
+			dprintk("intr: channel B end-of-field interrupt: "
+				"%04x\n", intr);
+		} else {
+			vino_dma_stop(&vino_drvdata->b);
+			vino_clear_interrupt(&vino_drvdata->b);
+			done_b = 1;
+			dprintk("channel B error interrupt: %04x\n", intr);
+		}
+	}
+
+	/* always remember to clear interrupt status */
+	vino->intr_status = ~intr;
+
+	spin_unlock(&vino_drvdata->vino_lock);
+
+	if (done_a) {
+		vino_frame_done(&vino_drvdata->a, fc_a);
+		dprintk("channel A frame done, interrupt: %d\n", intr);
+	}
+	if (done_b) {
+		vino_frame_done(&vino_drvdata->b, fc_b);
+		dprintk("channel B frame done, interrupt: %d\n", intr);
+	}
+
+	return IRQ_HANDLED;
+}
+
+/* VINO video input management */
+
+static int vino_get_saa7191_input(int input)
+{
+	switch (input) {
+	case VINO_INPUT_COMPOSITE:
+		return SAA7191_INPUT_COMPOSITE;
+	case VINO_INPUT_SVIDEO:
+		return SAA7191_INPUT_SVIDEO;
+	default:
+		printk(KERN_ERR "VINO: vino_get_saa7191_input(): "
+		       "invalid input!\n");
+		return -1;
+	}
+}
+
+static int vino_get_saa7191_norm(int norm)
+{
+	switch (norm) {
+	case VINO_DATA_NORM_AUTO:
+		return SAA7191_NORM_AUTO;
+	case VINO_DATA_NORM_PAL:
+		return SAA7191_NORM_PAL;
+	case VINO_DATA_NORM_NTSC:
+		return SAA7191_NORM_NTSC;
+	case VINO_DATA_NORM_SECAM:
+		return SAA7191_NORM_SECAM;
+	default:
+		printk(KERN_ERR "VINO: vino_get_saa7191_norm(): "
+		       "invalid norm!\n");
+		return -1;
+	}
+}
+
+/* execute with input_lock locked */
+static int vino_is_input_owner(struct vino_channel_settings *vcs)
+{
+	switch(vcs->input) {
+	case VINO_INPUT_COMPOSITE:
+	case VINO_INPUT_SVIDEO:
+		return (vino_drvdata->decoder.owner == vcs->channel);
+	case VINO_INPUT_D1:
+		return (vino_drvdata->camera.owner == vcs->channel);
+	default:
+		return 0;
+	}
+}
+
+static int vino_acquire_input(struct vino_channel_settings *vcs)
+{
+	int ret = 0;
+
+	dprintk("vino_acquire_input():\n");
+
+	spin_lock(&vino_drvdata->input_lock);
+
+	/* First try D1 and then SAA7191 */
+	if (vino_drvdata->camera.driver
+	    && (vino_drvdata->camera.owner == VINO_NO_CHANNEL)) {
+		if (i2c_use_client(vino_drvdata->camera.driver)) {
+			ret = -ENODEV;
+			goto out;
+		}
+
+		vino_drvdata->camera.owner = vcs->channel;
+		vcs->input = VINO_INPUT_D1;
+		vcs->data_norm = VINO_DATA_NORM_D1;
+	} else if (vino_drvdata->decoder.driver
+		   && (vino_drvdata->decoder.owner == VINO_NO_CHANNEL)) {
+		int saa7191_input;
+		int saa7191_norm;
+
+		if (i2c_use_client(vino_drvdata->decoder.driver)) {
+			ret = -ENODEV;
+			goto out;
+		}
+
+		vino_drvdata->decoder.owner = vcs->channel;
+		vcs->input = VINO_INPUT_COMPOSITE;
+		vcs->data_norm = VINO_DATA_NORM_PAL;
+
+		saa7191_input = vino_get_saa7191_input(vcs->input);
+		i2c_decoder_command(DECODER_SET_INPUT, &saa7191_input);
+
+		saa7191_norm = vino_get_saa7191_norm(vcs->data_norm);
+		i2c_decoder_command(DECODER_SAA7191_SET_NORM, &saa7191_norm);
+	} else {
+		vcs->input = (vcs->channel == VINO_CHANNEL_A) ?
+			vino_drvdata->b.input : vino_drvdata->a.input;
+		vcs->data_norm = (vcs->channel == VINO_CHANNEL_A) ?
+			vino_drvdata->b.data_norm : vino_drvdata->a.data_norm;
+	}
+
+	if (vcs->input == VINO_INPUT_NONE) {
+		ret = -ENODEV;
+		goto out;
+	}
+
+	if (vino_is_input_owner(vcs)) {
+		vino_set_default_clipping(vcs);
+		vino_set_default_framerate(vcs);
+	}
+
+	dprintk("vino_acquire_input(): %s\n", vino_inputs[vcs->input].name);
+
+out:
+	spin_unlock(&vino_drvdata->input_lock);
+
+	return ret;
+}
+
+static int vino_set_input(struct vino_channel_settings *vcs, int input)
+{
+	struct vino_channel_settings *vcs2 = (vcs->channel == VINO_CHANNEL_A) ?
+		&vino_drvdata->b : &vino_drvdata->a;
+	int ret = 0;
+
+	dprintk("vino_set_input():\n");
+
+	spin_lock(&vino_drvdata->input_lock);
+
+	if (vcs->input == input)
+		goto out;
+
+	switch(input) {
+	case VINO_INPUT_COMPOSITE:
+	case VINO_INPUT_SVIDEO:
+		if (!vino_drvdata->decoder.driver) {
+			ret = -EINVAL;
+			goto out;
+		}
+
+		if (vino_drvdata->decoder.owner == VINO_NO_CHANNEL) {
+			if (i2c_use_client(vino_drvdata->decoder.driver)) {
+				ret = -ENODEV;
+				goto out;
+			}
+			vino_drvdata->decoder.owner = vcs->channel;
+		}
+
+		if (vino_drvdata->decoder.owner == vcs->channel) {
+			int saa7191_input;
+			int saa7191_norm;
+
+			vcs->input = input;
+			vcs->data_norm = VINO_DATA_NORM_PAL;
+
+			saa7191_input = vino_get_saa7191_input(vcs->input);
+			i2c_decoder_command(DECODER_SET_INPUT, &saa7191_input);
+			saa7191_norm = vino_get_saa7191_norm(vcs->data_norm);
+			i2c_decoder_command(DECODER_SAA7191_SET_NORM,
+					    &saa7191_norm);
+		} else {
+			if (vcs2->input != input) {
+				ret = -EBUSY;
+				goto out;
+			}
+
+			vcs->input = input;
+			vcs->data_norm = vcs2->data_norm;
+		}
+
+		if (vino_drvdata->camera.owner == vcs->channel) {
+			/* Transfer the ownership or release the input */
+			if (vcs2->input == VINO_INPUT_D1) {
+				vino_drvdata->camera.owner = vcs2->channel;
+			} else {
+				i2c_release_client(vino_drvdata->
+						   camera.driver);
+				vino_drvdata->camera.owner = VINO_NO_CHANNEL;
+			}
+		}
+		break;
+	case VINO_INPUT_D1:
+		if (!vino_drvdata->camera.driver) {
+			ret = -EINVAL;
+			goto out;
+		}
+
+		if (vino_drvdata->camera.owner == VINO_NO_CHANNEL) {
+			if (i2c_use_client(vino_drvdata->camera.driver)) {
+				ret = -ENODEV;
+				goto out;
+			}
+			vino_drvdata->camera.owner = vcs->channel;
+		}
+
+		if (vino_drvdata->decoder.owner == vcs->channel) {
+			/* Transfer the ownership or release the input */
+			if ((vcs2->input == VINO_INPUT_COMPOSITE) ||
+				 (vcs2->input == VINO_INPUT_SVIDEO)) {
+				vino_drvdata->decoder.owner = vcs2->channel;
+			} else {
+				i2c_release_client(vino_drvdata->
+						   decoder.driver);
+				vino_drvdata->decoder.owner = VINO_NO_CHANNEL;
+			}
+		}
+
+		vcs->input = input;
+		vcs->data_norm = VINO_DATA_NORM_D1;
+		break;
+	default:
+		ret = -EINVAL;
+		goto out;
+	}
+
+	vino_set_default_clipping(vcs);
+	vino_set_default_framerate(vcs);
+
+	dprintk("vino_set_input(): %s\n", vino_inputs[vcs->input].name);
+
+out:
+	spin_unlock(&vino_drvdata->input_lock);
+
+	return ret;
+}
+
+static void vino_release_input(struct vino_channel_settings *vcs)
+{
+	struct vino_channel_settings *vcs2 = (vcs->channel == VINO_CHANNEL_A) ?
+		&vino_drvdata->b : &vino_drvdata->a;
+
+	dprintk("vino_release_input():\n");
+
+	spin_lock(&vino_drvdata->input_lock);
+
+	/* Release ownership of the channel
+	 * and if the other channel takes input from
+	 * the same source, transfer the ownership */
+	if (vino_drvdata->camera.owner == vcs->channel) {
+		if (vcs2->input == VINO_INPUT_D1) {
+			vino_drvdata->camera.owner = vcs2->channel;
+		} else {
+			i2c_release_client(vino_drvdata->camera.driver);
+			vino_drvdata->camera.owner = VINO_NO_CHANNEL;
+		}
+	} else if (vino_drvdata->decoder.owner == vcs->channel) {
+		if ((vcs2->input == VINO_INPUT_COMPOSITE) ||
+			 (vcs2->input == VINO_INPUT_SVIDEO)) {
+			vino_drvdata->decoder.owner = vcs2->channel;
+		} else {
+			i2c_release_client(vino_drvdata->decoder.driver);
+			vino_drvdata->decoder.owner = VINO_NO_CHANNEL;
+		}
+	}
+	vcs->input = VINO_INPUT_NONE;
+
+	spin_unlock(&vino_drvdata->input_lock);
+}
+
+/* execute with input_lock locked */
+static int vino_set_data_norm(struct vino_channel_settings *vcs,
+			      unsigned int data_norm)
+{
+	int saa7191_norm;
+
+	switch (vcs->input) {
+	case VINO_INPUT_D1:
+		/* only one "norm" supported */
+		if (data_norm != VINO_DATA_NORM_D1)
+			return -EINVAL;
+		break;
+	case VINO_INPUT_COMPOSITE:
+	case VINO_INPUT_SVIDEO:
+
+		saa7191_norm = vino_get_saa7191_norm(data_norm);
+
+		i2c_decoder_command(DECODER_SAA7191_SET_NORM, &saa7191_norm);
+		vcs->data_norm = data_norm;
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+/* V4L2 helper functions */
+
+static int vino_find_data_format(__u32 pixelformat)
+{
+	int i;
+
+	for (i = 0; i < VINO_DATA_FMT_COUNT; i++) {
+		if (vino_data_formats[i].pixelformat == pixelformat)
+			return i;
+	}
+
+	return VINO_DATA_FMT_NONE;
+}
+
+static int vino_enum_data_norm(struct vino_channel_settings *vcs, __u32 index)
+{
+	int data_norm = VINO_DATA_NORM_NONE;
+
+	spin_lock(&vino_drvdata->input_lock);
+	switch(vcs->input) {
+	case VINO_INPUT_COMPOSITE:
+	case VINO_INPUT_SVIDEO:
+		if (index == 0) {
+			data_norm = VINO_DATA_NORM_PAL;
+		} else if (index == 1) {
+			data_norm = VINO_DATA_NORM_NTSC;
+		} else if (index == 2) {
+			data_norm = VINO_DATA_NORM_SECAM;
+		}
+		break;
+	case VINO_INPUT_D1:
+		if (index == 0) {
+			data_norm = VINO_DATA_NORM_D1;
+		}
+		break;
+	}
+	spin_unlock(&vino_drvdata->input_lock);
+
+	return data_norm;
+}
+
+static int vino_enum_input(struct vino_channel_settings *vcs, __u32 index)
+{
+	int input = VINO_INPUT_NONE;
+
+	spin_lock(&vino_drvdata->input_lock);
+	if (vino_drvdata->decoder.driver && vino_drvdata->camera.driver) {
+		switch (index) {
+		case 0:
+			input = VINO_INPUT_COMPOSITE;
+			break;
+		case 1:
+			input = VINO_INPUT_SVIDEO;
+			break;
+		case 2:
+			input = VINO_INPUT_D1;
+			break;
+		}
+	} else if (vino_drvdata->decoder.driver) {
+		switch (index) {
+		case 0:
+			input = VINO_INPUT_COMPOSITE;
+			break;
+		case 1:
+			input = VINO_INPUT_SVIDEO;
+			break;
+		}
+	} else if (vino_drvdata->camera.driver) {
+		switch (index) {
+		case 0:
+			input = VINO_INPUT_D1;
+			break;
+		}
+	}
+	spin_unlock(&vino_drvdata->input_lock);
+
+	return input;
+}
+
+/* execute with input_lock locked */
+static __u32 vino_find_input_index(struct vino_channel_settings *vcs)
+{
+	__u32 index = 0;
+	// FIXME: detect when no inputs available
+
+	if (vino_drvdata->decoder.driver && vino_drvdata->camera.driver) {
+		switch (vcs->input) {
+		case VINO_INPUT_COMPOSITE:
+			index = 0;
+			break;
+		case VINO_INPUT_SVIDEO:
+			index = 1;
+			break;
+		case VINO_INPUT_D1:
+			index = 2;
+			break;
+		}
+	} else if (vino_drvdata->decoder.driver) {
+		switch (vcs->input) {
+		case VINO_INPUT_COMPOSITE:
+			index = 0;
+			break;
+		case VINO_INPUT_SVIDEO:
+			index = 1;
+			break;
+		}
+	} else if (vino_drvdata->camera.driver) {
+		switch (vcs->input) {
+		case VINO_INPUT_D1:
+			index = 0;
+			break;
+		}
+	}
+
+	return index;
+}
+
+/* V4L2 ioctls */
+
+static void vino_v4l2_querycap(struct v4l2_capability *cap)
+{
+	memset(cap, 0, sizeof(struct v4l2_capability));
+
+	strcpy(cap->driver, vino_driver_name);
+	strcpy(cap->card, vino_driver_description);
+	strcpy(cap->bus_info, vino_bus_name);
+	cap->version = VINO_VERSION_CODE;
+	cap->capabilities =
+		V4L2_CAP_VIDEO_CAPTURE |
+		V4L2_CAP_STREAMING;
+	// V4L2_CAP_OVERLAY, V4L2_CAP_READWRITE
+}
+
+static int vino_v4l2_enuminput(struct vino_channel_settings *vcs,
+			       struct v4l2_input *i)
+{
+	__u32 index = i->index;
+	int input;
+	dprintk("requested index = %d\n", index);
+
+	input = vino_enum_input(vcs, index);
+	if (input == VINO_INPUT_NONE)
+		return -EINVAL;
+
+	memset(i, 0, sizeof(struct v4l2_input));
+
+	i->index = index;
+	i->type = V4L2_INPUT_TYPE_CAMERA;
+	i->std = vino_inputs[input].std;
+	strcpy(i->name, vino_inputs[input].name);
+
+	if ((input == VINO_INPUT_COMPOSITE)
+	    || (input == VINO_INPUT_SVIDEO)) {
+		struct saa7191_status status;
+		i2c_decoder_command(DECODER_SAA7191_GET_STATUS, &status);
+		i->status |= status.signal ? 0 : V4L2_IN_ST_NO_SIGNAL;
+		i->status |= status.color ? 0 : V4L2_IN_ST_NO_COLOR;
+	}
+
+	return 0;
+}
+
+static int vino_v4l2_g_input(struct vino_channel_settings *vcs,
+			     struct v4l2_input *i)
+{
+	__u32 index;
+	int input;
+
+	spin_lock(&vino_drvdata->input_lock);
+	input = vcs->input;
+	index = vino_find_input_index(vcs);
+	spin_unlock(&vino_drvdata->input_lock);
+
+	dprintk("input = %d\n", input);
+
+	if (input == VINO_INPUT_NONE) {
+		return -EINVAL;
+	}
+
+	memset(i, 0, sizeof(struct v4l2_input));
+
+	i->index = index;
+	i->type = V4L2_INPUT_TYPE_CAMERA;
+	i->std = vino_inputs[input].std;
+	strcpy(i->name, vino_inputs[input].name);
+
+	return 0;
+}
+
+static int vino_v4l2_s_input(struct vino_channel_settings *vcs,
+			     struct v4l2_input *i)
+{
+	int input;
+	dprintk("requested input = %d\n", i->index);
+
+	input = vino_enum_input(vcs, i->index);
+	if (input == VINO_INPUT_NONE)
+		return -EINVAL;
+
+	return vino_set_input(vcs, input);
+}
+
+static int vino_v4l2_enumstd(struct vino_channel_settings *vcs,
+			     struct v4l2_standard *s)
+{
+	int index = s->index;
+	int data_norm = vino_enum_data_norm(vcs, index);
+	dprintk("standard index = %d\n", index);
+
+	if (data_norm == VINO_DATA_NORM_NONE)
+		return -EINVAL;
+
+	dprintk("standard name = %s\n",
+	       vino_data_norms[data_norm].description);
+
+	memset(s, 0, sizeof(struct v4l2_standard));
+	s->index = index;
+
+	s->id = vino_data_norms[data_norm].std;
+	s->frameperiod.numerator = 1;
+	s->frameperiod.denominator =
+		vino_data_norms[data_norm].fps_max;
+	s->framelines =
+		vino_data_norms[data_norm].framelines;
+	strcpy(s->name,
+	       vino_data_norms[data_norm].description);
+
+	return 0;
+}
+
+static int vino_v4l2_g_std(struct vino_channel_settings *vcs,
+			   v4l2_std_id *std)
+{
+	spin_lock(&vino_drvdata->input_lock);
+	dprintk("current standard = %d\n", vcs->data_norm);
+	*std = vino_data_norms[vcs->data_norm].std;
+	spin_unlock(&vino_drvdata->input_lock);
+
+	return 0;
+}
+
+static int vino_v4l2_s_std(struct vino_channel_settings *vcs,
+			   v4l2_std_id *std)
+{
+	int ret = 0;
+
+	spin_lock(&vino_drvdata->input_lock);
+
+	/* check if the standard is valid for the current input */
+	if (vino_is_input_owner(vcs)
+	    && (vino_inputs[vcs->input].std & (*std))) {
+		dprintk("standard accepted\n");
+
+		/* change the video norm for SAA7191
+		 * and accept NTSC for D1 (do nothing) */
+
+		if (vcs->input == VINO_INPUT_D1)
+			goto out;
+
+		if ((*std) & V4L2_STD_PAL) {
+			vino_set_data_norm(vcs, VINO_DATA_NORM_PAL);
+			vcs->data_norm = VINO_DATA_NORM_PAL;
+		} else if ((*std) & V4L2_STD_NTSC) {
+			vino_set_data_norm(vcs, VINO_DATA_NORM_NTSC);
+			vcs->data_norm = VINO_DATA_NORM_NTSC;
+		} else if ((*std) & V4L2_STD_SECAM) {
+			vino_set_data_norm(vcs, VINO_DATA_NORM_SECAM);
+			vcs->data_norm = VINO_DATA_NORM_SECAM;
+		} else {
+			ret = -EINVAL;
+		}
+	} else {
+		ret = -EINVAL;
+	}
+
+out:
+	spin_unlock(&vino_drvdata->input_lock);
+
+	return ret;
+}
+
+static int vino_v4l2_enum_fmt(struct vino_channel_settings *vcs,
+			      struct v4l2_fmtdesc *fd)
+{
+	enum v4l2_buf_type type = fd->type;
+	int index = fd->index;
+	dprintk("format index = %d\n", index);
+
+	switch (fd->type) {
+	case V4L2_BUF_TYPE_VIDEO_CAPTURE:
+		if ((fd->index < 0) ||
+		    (fd->index >= VINO_DATA_FMT_COUNT))
+			return -EINVAL;
+		dprintk("format name = %s\n",
+		       vino_data_formats[index].description);
+
+		memset(fd, 0, sizeof(struct v4l2_fmtdesc));
+		fd->index = index;
+		fd->type = type;
+		fd->pixelformat = vino_data_formats[index].pixelformat;
+		strcpy(fd->description, vino_data_formats[index].description);
+		break;
+	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int vino_v4l2_try_fmt(struct vino_channel_settings *vcs,
+			     struct v4l2_format *f)
+{
+	struct vino_channel_settings tempvcs;
+
+	switch (f->type) {
+	case V4L2_BUF_TYPE_VIDEO_CAPTURE: {
+		struct v4l2_pix_format *pf = &f->fmt.pix;
+
+		dprintk("requested: w = %d, h = %d\n",
+		       pf->width, pf->height);
+
+		spin_lock(&vino_drvdata->input_lock);
+		memcpy(&tempvcs, vcs, sizeof(struct vino_channel_settings));
+		spin_unlock(&vino_drvdata->input_lock);
+
+		tempvcs.data_format = vino_find_data_format(pf->pixelformat);
+		if (tempvcs.data_format == VINO_DATA_FMT_NONE) {
+			tempvcs.data_format = VINO_DATA_FMT_RGB32;
+			pf->pixelformat =
+				vino_data_formats[tempvcs.data_format].
+				pixelformat;
+		}
+
+		/* data format must be set before clipping/scaling */
+		vino_set_scaling(&tempvcs, pf->width, pf->height);
+
+		dprintk("data format = %s\n",
+		       vino_data_formats[tempvcs.data_format].description);
+
+		pf->width = (tempvcs.clipping.right - tempvcs.clipping.left) /
+			tempvcs.decimation;
+		pf->height = (tempvcs.clipping.bottom - tempvcs.clipping.top) /
+			tempvcs.decimation;
+
+		pf->field = V4L2_FIELD_INTERLACED;
+		pf->bytesperline = tempvcs.line_size;
+		pf->sizeimage = tempvcs.line_size *
+			(tempvcs.clipping.bottom - tempvcs.clipping.top) /
+			tempvcs.decimation;
+		pf->colorspace =
+			vino_data_formats[tempvcs.data_format].colorspace;
+
+		pf->priv = 0;
+		break;
+	}
+	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int vino_v4l2_g_fmt(struct vino_channel_settings *vcs,
+			   struct v4l2_format *f)
+{
+	switch (f->type) {
+	case V4L2_BUF_TYPE_VIDEO_CAPTURE: {
+		struct v4l2_pix_format *pf = &f->fmt.pix;
+		spin_lock(&vino_drvdata->input_lock);
+
+		pf->width = (vcs->clipping.right - vcs->clipping.left) /
+			vcs->decimation;
+		pf->height = (vcs->clipping.bottom - vcs->clipping.top) /
+			vcs->decimation;
+		pf->pixelformat =
+			vino_data_formats[vcs->data_format].pixelformat;
+
+		pf->field = V4L2_FIELD_INTERLACED;
+		pf->bytesperline = vcs->line_size;
+		pf->sizeimage = vcs->line_size *
+			(vcs->clipping.bottom - vcs->clipping.top) /
+			vcs->decimation;
+		pf->colorspace =
+			vino_data_formats[vcs->data_format].colorspace;
+
+		pf->priv = 0;
+
+		spin_unlock(&vino_drvdata->input_lock);
+		break;
+	}
+	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int vino_v4l2_s_fmt(struct vino_channel_settings *vcs,
+			   struct v4l2_format *f)
+{
+	int data_format;
+
+	switch (f->type) {
+	case V4L2_BUF_TYPE_VIDEO_CAPTURE: {
+		struct v4l2_pix_format *pf = &f->fmt.pix;
+		spin_lock(&vino_drvdata->input_lock);
+
+		if (!vino_is_input_owner(vcs)) {
+			spin_unlock(&vino_drvdata->input_lock);
+			return -EINVAL;
+		}
+
+		data_format = vino_find_data_format(pf->pixelformat);
+		if (data_format == VINO_DATA_FMT_NONE) {
+			vcs->data_format = VINO_DATA_FMT_RGB32;
+			pf->pixelformat =
+				vino_data_formats[vcs->data_format].
+				pixelformat;
+		} else {
+			vcs->data_format = data_format;
+		}
+
+		/* data format must be set before clipping/scaling */
+		vino_set_scaling(vcs, pf->width, pf->height);
+
+		dprintk("data format = %s\n",
+		       vino_data_formats[vcs->data_format].description);
+
+		pf->width = vcs->clipping.right - vcs->clipping.left;
+		pf->height = vcs->clipping.bottom - vcs->clipping.top;
+
+		pf->field = V4L2_FIELD_INTERLACED;
+		pf->bytesperline = vcs->line_size;
+		pf->sizeimage = vcs->line_size *
+			(vcs->clipping.bottom - vcs->clipping.top) /
+			vcs->decimation;
+		pf->colorspace =
+			vino_data_formats[vcs->data_format].colorspace;
+
+		pf->priv = 0;
+
+		spin_unlock(&vino_drvdata->input_lock);
+		break;
+	}
+	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int vino_v4l2_cropcap(struct vino_channel_settings *vcs,
+			     struct v4l2_cropcap *ccap)
+{
+	const struct vino_data_norm *norm;
+
+	switch (ccap->type) {
+	case V4L2_BUF_TYPE_VIDEO_CAPTURE:
+		spin_lock(&vino_drvdata->input_lock);
+		norm = &vino_data_norms[vcs->data_norm];
+		spin_unlock(&vino_drvdata->input_lock);
+
+		ccap->bounds.left = 0;
+		ccap->bounds.top = 0;
+		ccap->bounds.width = norm->width;
+		ccap->bounds.height = norm->height;
+		memcpy(&ccap->defrect, &ccap->bounds,
+		       sizeof(struct v4l2_rect));
+
+		ccap->pixelaspect.numerator = 1;
+		ccap->pixelaspect.denominator = 1;
+		break;
+	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int vino_v4l2_g_crop(struct vino_channel_settings *vcs,
+			    struct v4l2_crop *c)
+{
+	switch (c->type) {
+	case V4L2_BUF_TYPE_VIDEO_CAPTURE:
+		spin_lock(&vino_drvdata->input_lock);
+
+		c->c.left = vcs->clipping.left;
+		c->c.top = vcs->clipping.top;
+		c->c.width = vcs->clipping.right - vcs->clipping.left;
+		c->c.height = vcs->clipping.bottom - vcs->clipping.top;
+
+		spin_unlock(&vino_drvdata->input_lock);
+		break;
+	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int vino_v4l2_s_crop(struct vino_channel_settings *vcs,
+			    struct v4l2_crop *c)
+{
+	switch (c->type) {
+	case V4L2_BUF_TYPE_VIDEO_CAPTURE:
+		spin_lock(&vino_drvdata->input_lock);
+
+		if (!vino_is_input_owner(vcs)) {
+			spin_unlock(&vino_drvdata->input_lock);
+			return -EINVAL;
+		}
+		vino_set_clipping(vcs, c->c.left, c->c.top,
+				  c->c.width, c->c.height);
+
+		spin_unlock(&vino_drvdata->input_lock);
+		break;
+	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int vino_v4l2_g_parm(struct vino_channel_settings *vcs,
+			    struct v4l2_streamparm *sp)
+{
+	switch (sp->type) {
+	case V4L2_BUF_TYPE_VIDEO_CAPTURE: {
+		struct v4l2_captureparm *cp = &sp->parm.capture;
+		memset(cp, 0, sizeof(struct v4l2_captureparm));
+
+		cp->capability = V4L2_CAP_TIMEPERFRAME;
+		cp->timeperframe.numerator = 1;
+
+		spin_lock(&vino_drvdata->input_lock);
+		cp->timeperframe.denominator = vcs->fps;
+		spin_unlock(&vino_drvdata->input_lock);
+
+		// TODO: cp->readbuffers = xxx;
+		break;
+	}
+	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int vino_v4l2_s_parm(struct vino_channel_settings *vcs,
+			    struct v4l2_streamparm *sp)
+{
+	switch (sp->type) {
+	case V4L2_BUF_TYPE_VIDEO_CAPTURE: {
+		struct v4l2_captureparm *cp = &sp->parm.capture;
+
+		spin_lock(&vino_drvdata->input_lock);
+		if (!vino_is_input_owner(vcs)) {
+			spin_unlock(&vino_drvdata->input_lock);
+			return -EINVAL;
+		}
+
+		if ((cp->timeperframe.numerator == 0) ||
+		    (cp->timeperframe.denominator == 0)) {
+			/* reset framerate */
+			vino_set_default_framerate(vcs);
+		} else {
+			vino_set_framerate(vcs, cp->timeperframe.denominator /
+					   cp->timeperframe.numerator);
+		}
+		spin_unlock(&vino_drvdata->input_lock);
+
+		// TODO: set buffers according to cp->readbuffers
+		break;
+	}
+	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int vino_v4l2_reqbufs(struct vino_channel_settings *vcs,
+			     struct v4l2_requestbuffers *rb)
+{
+	if (vcs->reading)
+		return -EBUSY;
+
+	switch (rb->type) {
+	case V4L2_BUF_TYPE_VIDEO_CAPTURE: {
+		// TODO: check queue type
+		if (rb->memory != V4L2_MEMORY_MMAP) {
+			dprintk("type not mmap\n");
+			return -EINVAL;
+		}
+
+		if (vino_is_capturing(vcs)) {
+			dprintk("busy, capturing\n");
+			return -EBUSY;
+		}
+
+		dprintk("count = %d\n", rb->count);
+		if (rb->count > 0) {
+			if (vino_queue_has_mapped_buffers(&vcs->fb_queue)) {
+				dprintk("busy, buffers still mapped\n");
+				return -EBUSY;
+			} else {
+				vino_queue_free(&vcs->fb_queue);
+				vino_queue_init(&vcs->fb_queue, &rb->count);
+			}
+		} else {
+			vino_capture_stop(vcs);
+			vino_queue_free(&vcs->fb_queue);
+		}
+		break;
+	}
+	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static void vino_v4l2_get_buffer_status(struct vino_channel_settings *vcs,
+					struct vino_framebuffer *fb,
+					struct v4l2_buffer *b)
+{
+	if (vino_queue_outgoing_contains(&vcs->fb_queue,
+					 fb->id)) {
+		b->flags &= ~V4L2_BUF_FLAG_QUEUED;
+		b->flags |= V4L2_BUF_FLAG_DONE;
+	} else if (vino_queue_incoming_contains(&vcs->fb_queue,
+				       fb->id)) {
+		b->flags &= ~V4L2_BUF_FLAG_DONE;
+		b->flags |= V4L2_BUF_FLAG_QUEUED;
+	} else {
+		b->flags &= ~(V4L2_BUF_FLAG_DONE |
+			      V4L2_BUF_FLAG_QUEUED);
+	}
+
+	b->flags &= ~(V4L2_BUF_FLAG_TIMECODE);
+
+	if (fb->map_count > 0)
+		b->flags |= V4L2_BUF_FLAG_MAPPED;
+
+	b->index = fb->id;
+	b->memory = (vcs->fb_queue.type == VINO_MEMORY_MMAP) ?
+		V4L2_MEMORY_MMAP : V4L2_MEMORY_USERPTR;
+	b->m.offset = fb->offset;
+	b->bytesused = fb->data_size;
+	b->length = fb->size;
+	b->field = V4L2_FIELD_INTERLACED;
+	b->sequence = fb->frame_counter;
+	memcpy(&b->timestamp, &fb->timestamp,
+	       sizeof(struct timeval));
+	// b->input ?
+
+	dprintk("buffer %d: length = %d, bytesused = %d, offset = %d\n",
+		fb->id, fb->size, fb->data_size, fb->offset);
+}
+
+static int vino_v4l2_querybuf(struct vino_channel_settings *vcs,
+			      struct v4l2_buffer *b)
+{
+	if (vcs->reading)
+		return -EBUSY;
+
+	switch (b->type) {
+	case V4L2_BUF_TYPE_VIDEO_CAPTURE: {
+		struct vino_framebuffer *fb;
+
+		// TODO: check queue type
+		if (b->index >= vino_queue_get_length(&vcs->fb_queue)) {
+			dprintk("invalid index = %d\n",
+			       b->index);
+			return -EINVAL;
+		}
+
+		fb = vino_queue_get_buffer(&vcs->fb_queue,
+					   b->index);
+		if (fb == NULL) {
+			dprintk("vino_queue_get_buffer() failed");
+			return -EINVAL;
+		}
+
+		vino_v4l2_get_buffer_status(vcs, fb, b);
+		break;
+	}
+	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int vino_v4l2_qbuf(struct vino_channel_settings *vcs,
+			  struct v4l2_buffer *b)
+{
+	if (vcs->reading)
+		return -EBUSY;
+
+	switch (b->type) {
+	case V4L2_BUF_TYPE_VIDEO_CAPTURE: {
+		struct vino_framebuffer *fb;
+		int ret;
+
+		// TODO: check queue type
+		if (b->memory != V4L2_MEMORY_MMAP) {
+			dprintk("type not mmap\n");
+			return -EINVAL;
+		}
+
+		fb = vino_capture_enqueue(vcs, b->index);
+		if (fb == NULL)
+			return -EINVAL;
+
+		vino_v4l2_get_buffer_status(vcs, fb, b);
+
+		if (vcs->streaming) {
+			ret = vino_capture_next(vcs, 1);
+			if (ret)
+				return ret;
+		}
+		break;
+	}
+	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int vino_v4l2_dqbuf(struct vino_channel_settings *vcs,
+			   struct v4l2_buffer *b,
+			   unsigned int nonblocking)
+{
+	if (vcs->reading)
+		return -EBUSY;
+
+	switch (b->type) {
+	case V4L2_BUF_TYPE_VIDEO_CAPTURE: {
+		struct vino_framebuffer *fb;
+		unsigned int incoming, outgoing;
+		int err;
+
+		// TODO: check queue type
+
+		err = vino_queue_get_incoming(&vcs->fb_queue, &incoming);
+		if (err) {
+			dprintk("vino_queue_get_incoming() failed\n");
+			return -EIO;
+		}
+		err = vino_queue_get_outgoing(&vcs->fb_queue, &outgoing);
+		if (err) {
+			dprintk("vino_queue_get_outgoing() failed\n");
+			return -EIO;
+		}
+
+		dprintk("incoming = %d, outgoing = %d\n", incoming, outgoing);
+
+		if (outgoing == 0) {
+			if (incoming == 0) {
+				dprintk("no incoming or outgoing buffers\n");
+				return -EINVAL;
+			}
+			if (nonblocking) {
+				dprintk("non-blocking I/O was selected and "
+					"there are no buffers to dequeue\n");
+				return -EAGAIN;
+			}
+
+			err = vino_wait_for_frame(vcs);
+			if (err) {
+				err = vino_wait_for_frame(vcs);
+				if (err) {
+					/* interrupted */
+					vino_capture_failed(vcs);
+					return -EIO;
+				}
+			}
+		}
+
+		fb = vino_queue_remove(&vcs->fb_queue, &b->index);
+		if (fb == NULL) {
+			dprintk("vino_queue_remove() failed\n");
+			return -EINVAL;
+		}
+
+		err = vino_check_buffer(vcs, fb);
+		if (err)
+			return -EIO;
+
+		vino_v4l2_get_buffer_status(vcs, fb, b);
+		break;
+	}
+	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int vino_v4l2_streamon(struct vino_channel_settings *vcs)
+{
+	unsigned int incoming;
+	int ret;
+	if (vcs->reading)
+		return -EBUSY;
+
+	if (vcs->streaming)
+		return 0;
+
+	// TODO: check queue type
+
+	if (vino_queue_get_length(&vcs->fb_queue) < 1) {
+		dprintk("no buffers allocated\n");
+		return -EINVAL;
+	}
+
+	ret = vino_queue_get_incoming(&vcs->fb_queue, &incoming);
+	if (ret) {
+		dprintk("vino_queue_get_incoming() failed\n");
+		return -EINVAL;
+	}
+
+	vcs->streaming = 1;
+
+	if (incoming > 0) {
+		ret = vino_capture_next(vcs, 1);
+		if (ret) {
+			vcs->streaming = 0;
+
+			dprintk("couldn't start capture\n");
+			return -EINVAL;
+		}
+	}
+
+	return 0;
+}
+
+static int vino_v4l2_streamoff(struct vino_channel_settings *vcs)
+{
+	if (vcs->reading)
+		return -EBUSY;
+
+	if (!vcs->streaming)
+		return 0;
+
+	vino_capture_stop(vcs);
+	vcs->streaming = 0;
+
+	return 0;
+}
+
+static int vino_v4l2_queryctrl(struct vino_channel_settings *vcs,
+			       struct v4l2_queryctrl *queryctrl)
+{
+	int i;
+	int err = 0;
+
+	spin_lock(&vino_drvdata->input_lock);
+
+	switch (vcs->input) {
+	case VINO_INPUT_D1:
+		for (i = 0; i < VINO_INDYCAM_V4L2_CONTROL_COUNT; i++) {
+			if (vino_indycam_v4l2_controls[i].id ==
+			    queryctrl->id) {
+				memcpy(queryctrl,
+				       &vino_indycam_v4l2_controls[i],
+				       sizeof(struct v4l2_queryctrl));
+				goto found;
+			}
+		}
+
+		err =  -EINVAL;
+		break;
+	case VINO_INPUT_COMPOSITE:
+	case VINO_INPUT_SVIDEO:
+		for (i = 0; i < VINO_SAA7191_V4L2_CONTROL_COUNT; i++) {
+			if (vino_saa7191_v4l2_controls[i].id ==
+			    queryctrl->id) {
+				memcpy(queryctrl,
+				       &vino_saa7191_v4l2_controls[i],
+				       sizeof(struct v4l2_queryctrl));
+				goto found;
+			}
+		}
+
+		err =  -EINVAL;
+		break;
+	default:
+		err =  -EINVAL;
+	}
+
+ found:
+	spin_unlock(&vino_drvdata->input_lock);
+
+	return err;
+}
+
+static int vino_v4l2_g_ctrl(struct vino_channel_settings *vcs,
+			    struct v4l2_control *control)
+{
+	struct indycam_control indycam_ctrl;
+	struct saa7191_control saa7191_ctrl;
+	int err = 0;
+
+	spin_lock(&vino_drvdata->input_lock);
+
+	switch (vcs->input) {
+	case VINO_INPUT_D1:
+		i2c_camera_command(DECODER_INDYCAM_GET_CONTROLS,
+				   &indycam_ctrl);
+
+		switch(control->id) {
+		case V4L2_CID_AUTOGAIN:
+			control->value = indycam_ctrl.agc;
+			break;
+		case V4L2_CID_AUTO_WHITE_BALANCE:
+			control->value = indycam_ctrl.awb;
+			break;
+		case V4L2_CID_GAIN:
+			control->value = indycam_ctrl.gain;
+			break;
+		case V4L2_CID_PRIVATE_BASE:
+			control->value = indycam_ctrl.red_saturation;
+			break;
+		case V4L2_CID_PRIVATE_BASE + 1:
+			control->value = indycam_ctrl.blue_saturation;
+			break;
+		case V4L2_CID_RED_BALANCE:
+			control->value = indycam_ctrl.red_balance;
+			break;
+		case V4L2_CID_BLUE_BALANCE:
+			control->value = indycam_ctrl.blue_balance;
+			break;
+		case V4L2_CID_EXPOSURE:
+			control->value = indycam_ctrl.shutter;
+			break;
+		case V4L2_CID_GAMMA:
+			control->value = indycam_ctrl.gamma;
+			break;
+		default:
+			err = -EINVAL;
+		}
+		break;
+	case VINO_INPUT_COMPOSITE:
+	case VINO_INPUT_SVIDEO:
+		i2c_decoder_command(DECODER_SAA7191_GET_CONTROLS,
+				   &saa7191_ctrl);
+
+		switch(control->id) {
+		case V4L2_CID_HUE:
+			control->value = saa7191_ctrl.hue;
+			break;
+		case V4L2_CID_PRIVATE_BASE:
+			control->value = saa7191_ctrl.vtrc;
+			break;
+		default:
+			err = -EINVAL;
+		}
+		break;
+	default:
+		err =  -EINVAL;
+	}
+
+	spin_unlock(&vino_drvdata->input_lock);
+
+	return err;
+}
+
+static int vino_v4l2_s_ctrl(struct vino_channel_settings *vcs,
+			    struct v4l2_control *control)
+{
+	struct indycam_control indycam_ctrl;
+	struct saa7191_control saa7191_ctrl;
+	int i;
+	int err = 0;
+
+	spin_lock(&vino_drvdata->input_lock);
+
+	switch (vcs->input) {
+	case VINO_INPUT_D1:
+		for (i = 0; i < VINO_INDYCAM_V4L2_CONTROL_COUNT; i++) {
+			if (vino_indycam_v4l2_controls[i].id ==
+			    control->id) {
+				if ((control->value >=
+				     vino_indycam_v4l2_controls[i].minimum)
+				    && (control->value <=
+					vino_indycam_v4l2_controls[i].
+					maximum)) {
+					goto ok1;
+				} else {
+					err = -ERANGE;
+					goto error;
+				}
+			}
+		}
+		err = -EINVAL;
+		goto error;
+
+ok1:
+		indycam_ctrl.agc = INDYCAM_VALUE_UNCHANGED;
+		indycam_ctrl.awb = INDYCAM_VALUE_UNCHANGED;
+		indycam_ctrl.shutter = INDYCAM_VALUE_UNCHANGED;
+		indycam_ctrl.gain = INDYCAM_VALUE_UNCHANGED;
+		indycam_ctrl.red_balance = INDYCAM_VALUE_UNCHANGED;
+		indycam_ctrl.blue_balance = INDYCAM_VALUE_UNCHANGED;
+		indycam_ctrl.red_saturation = INDYCAM_VALUE_UNCHANGED;
+		indycam_ctrl.blue_saturation = INDYCAM_VALUE_UNCHANGED;
+		indycam_ctrl.gamma = INDYCAM_VALUE_UNCHANGED;
+
+		switch(control->id) {
+		case V4L2_CID_AUTOGAIN:
+			indycam_ctrl.agc = control->value;
+			break;
+		case V4L2_CID_AUTO_WHITE_BALANCE:
+			indycam_ctrl.awb = control->value;
+			break;
+		case V4L2_CID_GAIN:
+			indycam_ctrl.gain = control->value;
+			break;
+		case V4L2_CID_PRIVATE_BASE:
+			indycam_ctrl.red_saturation = control->value;
+			break;
+		case V4L2_CID_PRIVATE_BASE + 1:
+			indycam_ctrl.blue_saturation = control->value;
+			break;
+		case V4L2_CID_RED_BALANCE:
+			indycam_ctrl.red_balance = control->value;
+			break;
+		case V4L2_CID_BLUE_BALANCE:
+			indycam_ctrl.blue_balance = control->value;
+			break;
+		case V4L2_CID_EXPOSURE:
+			indycam_ctrl.shutter = control->value;
+			break;
+		case V4L2_CID_GAMMA:
+			indycam_ctrl.gamma = control->value;
+			break;
+		default:
+			err =  -EINVAL;
+		}
+
+		if (!err)
+			i2c_camera_command(DECODER_INDYCAM_SET_CONTROLS,
+					   &indycam_ctrl);
+		break;
+	case VINO_INPUT_COMPOSITE:
+	case VINO_INPUT_SVIDEO:
+		for (i = 0; i < VINO_SAA7191_V4L2_CONTROL_COUNT; i++) {
+			if (vino_saa7191_v4l2_controls[i].id ==
+			    control->id) {
+				if ((control->value >=
+				     vino_saa7191_v4l2_controls[i].minimum)
+				    && (control->value <=
+					vino_saa7191_v4l2_controls[i].
+					maximum)) {
+					goto ok2;
+				} else {
+					err = -ERANGE;
+					goto error;
+				}
+			}
+		}
+		err = -EINVAL;
+		goto error;
+
+ok2:
+		saa7191_ctrl.hue = SAA7191_VALUE_UNCHANGED;
+		saa7191_ctrl.vtrc = SAA7191_VALUE_UNCHANGED;
+
+		switch(control->id) {
+		case V4L2_CID_HUE:
+			saa7191_ctrl.hue = control->value;
+			break;
+		case V4L2_CID_PRIVATE_BASE:
+			saa7191_ctrl.vtrc = control->value;
+			break;
+		default:
+			err =  -EINVAL;
+		}
+
+		if (!err)
+			i2c_decoder_command(DECODER_SAA7191_SET_CONTROLS,
+					    &saa7191_ctrl);
+		break;
+	default:
+		err =  -EINVAL;
+	}
+
+error:
+	spin_unlock(&vino_drvdata->input_lock);
+
+	return err;
+}
+
+/* File operations */
+
+static int vino_open(struct inode *inode, struct file *file)
+{
+	struct video_device *dev = video_devdata(file);
+	struct vino_channel_settings *vcs = video_get_drvdata(dev);
+	int ret = 0;
+	dprintk("open(): channel = %c\n",
+	       (vcs->channel == VINO_CHANNEL_A) ? 'A' : 'B');
+
+	down(&vcs->sem);
+
+	if (vcs->users) {
+		dprintk("open(): driver busy\n");
+		ret = -EBUSY;
+		goto out;
+	}
+
+	ret = vino_acquire_input(vcs);
+	if (ret) {
+		dprintk("open(): vino_acquire_input() failed\n");
+		goto out;
+	}
+
+	vcs->users++;
+
+ out:
+	up(&vcs->sem);
+
+	dprintk("open(): %s!\n", ret ? "failed" : "complete");
+
+	return ret;
+}
+
+static int vino_close(struct inode *inode, struct file *file)
+{
+	struct video_device *dev = video_devdata(file);
+	struct vino_channel_settings *vcs = video_get_drvdata(dev);
+	dprintk("close():\n");
+
+	down(&vcs->sem);
+
+	vcs->users--;
+
+	if (!vcs->users) {
+		vino_release_input(vcs);
+
+		/* stop DMA and free buffers */
+		vino_capture_stop(vcs);
+		vino_queue_free(&vcs->fb_queue);
+	}
+
+	up(&vcs->sem);
+
+	return 0;
+}
+
+static void vino_vm_open(struct vm_area_struct *vma)
+{
+	struct vino_framebuffer *fb = vma->vm_private_data;
+
+	fb->map_count++;
+	dprintk("vino_vm_open(): count = %d\n", fb->map_count);
+}
+
+static void vino_vm_close(struct vm_area_struct *vma)
+{
+	struct vino_framebuffer *fb = vma->vm_private_data;
+
+	fb->map_count--;
+	dprintk("vino_vm_close(): count = %d\n", fb->map_count);
+}
+
+static struct vm_operations_struct vino_vm_ops = {
+	.open	= vino_vm_open,
+	.close	= vino_vm_close,
+};
+
+static int vino_mmap(struct file *file, struct vm_area_struct *vma)
+{
+	struct video_device *dev = video_devdata(file);
+	struct vino_channel_settings *vcs = video_get_drvdata(dev);
+
+	unsigned long start = vma->vm_start;
+	unsigned long size = vma->vm_end - vma->vm_start;
+	unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
+
+	struct vino_framebuffer *fb = NULL;
+	unsigned int i, length;
+	int ret = 0;
+
+	dprintk("mmap():\n");
+
+	// TODO: reject mmap if already mapped
+
+	if (down_interruptible(&vcs->sem))
+		return -EINTR;
+
+	if (vcs->reading) {
+		ret = -EBUSY;
+		goto out;
+	}
+
+	// TODO: check queue type
+
+	if (!(vma->vm_flags & VM_WRITE)) {
+		dprintk("mmap(): app bug: PROT_WRITE please\n");
+		ret = -EINVAL;
+		goto out;
+	}
+	if (!(vma->vm_flags & VM_SHARED)) {
+		dprintk("mmap(): app bug: MAP_SHARED please\n");
+		ret = -EINVAL;
+		goto out;
+	}
+
+	/* find the correct buffer using offset */
+	length = vino_queue_get_length(&vcs->fb_queue);
+	if (length == 0) {
+		dprintk("mmap(): queue not initialized\n");
+		ret = -EINVAL;
+		goto out;
+	}
+
+	for (i = 0; i < length; i++) {
+		fb = vino_queue_get_buffer(&vcs->fb_queue, i);
+		if (fb == NULL) {
+			dprintk("mmap(): vino_queue_get_buffer() failed\n");
+			ret = -EINVAL;
+			goto out;
+		}
+
+		if (fb->offset == offset)
+			goto found;
+	}
+
+	dprintk("mmap(): invalid offset = %lu\n", offset);
+	ret = -EINVAL;
+	goto out;
+
+found:
+	dprintk("mmap(): buffer = %d\n", i);
+
+	if (size > (fb->desc_table.page_count * PAGE_SIZE)) {
+		dprintk("mmap(): failed: size = %lu > %lu\n",
+			size, fb->desc_table.page_count * PAGE_SIZE);
+		ret = -EINVAL;
+		goto out;
+	}
+
+	for (i = 0; i < fb->desc_table.page_count; i++) {
+		unsigned long pfn =
+			virt_to_phys((void *)fb->desc_table.virtual[i]) >>
+			PAGE_SHIFT;
+
+		if (size < PAGE_SIZE)
+			break;
+
+		// protection was: PAGE_READONLY
+		if (remap_pfn_range(vma, start, pfn, PAGE_SIZE,
+				    vma->vm_page_prot)) {
+			dprintk("mmap(): remap_pfn_range() failed\n");
+			ret = -EAGAIN;
+			goto out;
+		}
+
+		start += PAGE_SIZE;
+		size -= PAGE_SIZE;
+	}
+
+	fb->map_count = 1;
+
+	vma->vm_flags |= VM_DONTEXPAND | VM_RESERVED;
+	vma->vm_flags &= ~VM_IO;
+	vma->vm_private_data = fb;
+	vma->vm_file = file;
+	vma->vm_ops = &vino_vm_ops;
+
+out:
+	up(&vcs->sem);
+
+	return ret;
+}
+
+static unsigned int vino_poll(struct file *file, poll_table *pt)
+{
+	struct video_device *dev = video_devdata(file);
+	struct vino_channel_settings *vcs = video_get_drvdata(dev);
+	unsigned int outgoing;
+	unsigned int ret = 0;
+
+	// lock mutex (?)
+	// TODO: this has to be corrected for different read modes
+
+	dprintk("poll():\n");
+
+	if (vino_queue_get_outgoing(&vcs->fb_queue, &outgoing)) {
+		dprintk("poll(): vino_queue_get_outgoing() failed\n");
+		ret = POLLERR;
+		goto error;
+	}
+	if (outgoing > 0)
+		goto over;
+
+	poll_wait(file, &vcs->fb_queue.frame_wait_queue, pt);
+
+	if (vino_queue_get_outgoing(&vcs->fb_queue, &outgoing)) {
+		dprintk("poll(): vino_queue_get_outgoing() failed\n");
+		ret = POLLERR;
+		goto error;
+	}
+
+over:
+	dprintk("poll(): data %savailable\n",
+		(outgoing > 0) ? "" : "not ");
+	if (outgoing > 0) {
+		ret = POLLIN | POLLRDNORM;
+	}
+
+error:
+
+	return ret;
+}
+
+static int vino_do_ioctl(struct inode *inode, struct file *file,
+		      unsigned int cmd, void *arg)
+{
+	struct video_device *dev = video_devdata(file);
+	struct vino_channel_settings *vcs = video_get_drvdata(dev);
+
+	switch (_IOC_TYPE(cmd)) {
+	case 'v':
+		dprintk("ioctl(): V4L1 unsupported (0x%08x)\n", cmd);
+		break;
+	case 'V':
+		dprintk("ioctl(): V4L2 %s (0x%08x)\n",
+			v4l2_ioctl_names[_IOC_NR(cmd)], cmd);
+		break;
+	default:
+		dprintk("ioctl(): unsupported command 0x%08x\n", cmd);
+	}
+
+	switch (cmd) {
+	/* TODO: V4L1 interface (use compatibility layer?) */
+	/* V4L2 interface */
+	case VIDIOC_QUERYCAP: {
+		vino_v4l2_querycap(arg);
+		break;
+	}
+	case VIDIOC_ENUMINPUT: {
+		return vino_v4l2_enuminput(vcs, arg);
+	}
+	case VIDIOC_G_INPUT: {
+		return vino_v4l2_g_input(vcs, arg);
+	}
+	case VIDIOC_S_INPUT: {
+		return vino_v4l2_s_input(vcs, arg);
+	}
+	case VIDIOC_ENUMSTD: {
+		return vino_v4l2_enumstd(vcs, arg);
+	}
+	case VIDIOC_G_STD: {
+		return vino_v4l2_g_std(vcs, arg);
+	}
+	case VIDIOC_S_STD: {
+		return vino_v4l2_s_std(vcs, arg);
+	}
+	case VIDIOC_ENUM_FMT: {
+		return vino_v4l2_enum_fmt(vcs, arg);
+	}
+	case VIDIOC_TRY_FMT: {
+		return vino_v4l2_try_fmt(vcs, arg);
+	}
+	case VIDIOC_G_FMT: {
+		return vino_v4l2_g_fmt(vcs, arg);
+	}
+	case VIDIOC_S_FMT: {
+		return vino_v4l2_s_fmt(vcs, arg);
+	}
+	case VIDIOC_CROPCAP: {
+		return vino_v4l2_cropcap(vcs, arg);
+	}
+	case VIDIOC_G_CROP: {
+		return vino_v4l2_g_crop(vcs, arg);
+	}
+	case VIDIOC_S_CROP: {
+		return vino_v4l2_s_crop(vcs, arg);
+	}
+	case VIDIOC_G_PARM: {
+		return vino_v4l2_g_parm(vcs, arg);
+	}
+	case VIDIOC_S_PARM: {
+		return vino_v4l2_s_parm(vcs, arg);
+	}
+	case VIDIOC_REQBUFS: {
+		return vino_v4l2_reqbufs(vcs, arg);
+	}
+	case VIDIOC_QUERYBUF: {
+		return vino_v4l2_querybuf(vcs, arg);
+	}
+	case VIDIOC_QBUF: {
+		return vino_v4l2_qbuf(vcs, arg);
+	}
+	case VIDIOC_DQBUF: {
+		return vino_v4l2_dqbuf(vcs, arg, file->f_flags & O_NONBLOCK);
+	}
+	case VIDIOC_STREAMON: {
+		return vino_v4l2_streamon(vcs);
+	}
+	case VIDIOC_STREAMOFF: {
+		return vino_v4l2_streamoff(vcs);
+	}
+	case VIDIOC_QUERYCTRL: {
+		return vino_v4l2_queryctrl(vcs, arg);
+	}
+	case VIDIOC_G_CTRL: {
+		return vino_v4l2_g_ctrl(vcs, arg);
+	}
+	case VIDIOC_S_CTRL: {
+		return vino_v4l2_s_ctrl(vcs, arg);
+	}
+	default:
+		return -ENOIOCTLCMD;
+	}
+
+	return 0;
+}
+
+static int vino_ioctl(struct inode *inode, struct file *file,
+		      unsigned int cmd, unsigned long arg)
+{
+	struct video_device *dev = video_devdata(file);
+	struct vino_channel_settings *vcs = video_get_drvdata(dev);
+	int ret;
+
+	if (down_interruptible(&vcs->sem))
+		return -EINTR;
+
+	ret = video_usercopy(inode, file, cmd, arg, vino_do_ioctl);
+
+	up(&vcs->sem);
+
+	return ret;
+}
+
+/* Initialization and cleanup */
+
+// __initdata
+static int vino_init_stage = 0;
+
+static struct file_operations vino_fops = {
+	.owner		= THIS_MODULE,
+	.open		= vino_open,
+	.release	= vino_close,
+	.ioctl		= vino_ioctl,
+	.mmap		= vino_mmap,
+	.poll		= vino_poll,
+	.llseek		= no_llseek,
+};
+
+static struct video_device v4l_device_template = {
+	.name		= "NOT SET",
+	//.type		= VID_TYPE_CAPTURE | VID_TYPE_SUBCAPTURE |
+	//	VID_TYPE_CLIPPING | VID_TYPE_SCALES, VID_TYPE_OVERLAY
+	.hardware	= VID_HARDWARE_VINO,
+	.fops		= &vino_fops,
+	.minor		= -1,
+};
+
+static void vino_module_cleanup(int stage)
+{
+	switch(stage) {
+	case 10:
+		video_unregister_device(vino_drvdata->b.v4l_device);
+		vino_drvdata->b.v4l_device = NULL;
+	case 9:
+		video_unregister_device(vino_drvdata->a.v4l_device);
+		vino_drvdata->a.v4l_device = NULL;
+	case 8:
+		vino_i2c_del_bus();
+	case 7:
+		free_irq(SGI_VINO_IRQ, NULL);
+	case 6:
+		if (vino_drvdata->b.v4l_device) {
+			video_device_release(vino_drvdata->b.v4l_device);
+			vino_drvdata->b.v4l_device = NULL;
+		}
+	case 5:
+		if (vino_drvdata->a.v4l_device) {
+			video_device_release(vino_drvdata->a.v4l_device);
+			vino_drvdata->a.v4l_device = NULL;
+		}
+	case 4:
+		/* all entries in dma_cpu dummy table have the same address */
+		dma_unmap_single(NULL,
+				 vino_drvdata->dummy_desc_table.dma_cpu[0],
+				 PAGE_SIZE, DMA_FROM_DEVICE);
+		dma_free_coherent(NULL, VINO_DUMMY_DESC_COUNT
+				  * sizeof(dma_addr_t),
+				  (void *)vino_drvdata->
+				  dummy_desc_table.dma_cpu,
+				  vino_drvdata->dummy_desc_table.dma);
+	case 3:
+		free_page(vino_drvdata->dummy_page);
+	case 2:
+		kfree(vino_drvdata);
+	case 1:
+		iounmap(vino);
+	case 0:
+		break;
+	default:
+		dprintk("vino_module_cleanup(): invalid cleanup stage = %d\n",
+			stage);
+	}
+}
+
+static int vino_probe(void)
+{
+	unsigned long rev_id;
+
+	if (ip22_is_fullhouse()) {
+		printk(KERN_ERR "VINO doesn't exist in IP22 Fullhouse\n");
+		return -ENODEV;
+	}
+
+	if (!(sgimc->systemid & SGIMC_SYSID_EPRESENT)) {
+		printk(KERN_ERR "VINO is not found (EISA BUS not present)\n");
+		return -ENODEV;
+	}
+
+	vino = (struct sgi_vino *)ioremap(VINO_BASE, sizeof(struct sgi_vino));
+	if (!vino) {
+		printk(KERN_ERR "VINO: ioremap() failed\n");
+		return -EIO;
+	}
+	vino_init_stage++;
+
+	if (get_dbe(rev_id, &(vino->rev_id))) {
+		printk(KERN_ERR "Failed to read VINO revision register\n");
+		vino_module_cleanup(vino_init_stage);
+		return -ENODEV;
+	}
+
+	if (VINO_ID_VALUE(rev_id) != VINO_CHIP_ID) {
+		printk(KERN_ERR "Unknown VINO chip ID (Rev/ID: 0x%02lx)\n",
+		       rev_id);
+		vino_module_cleanup(vino_init_stage);
+		return -ENODEV;
+	}
+
+	printk(KERN_INFO "VINO with chip ID %ld, revision %ld found\n",
+	       VINO_ID_VALUE(rev_id), VINO_REV_NUM(rev_id));
+
+	return 0;
+}
+
+static int vino_init(void)
+{
+	dma_addr_t dma_dummy_address;
+	int i;
+
+	vino_drvdata = (struct vino_settings *)
+		kmalloc(sizeof(struct vino_settings), GFP_KERNEL);
+	if (!vino_drvdata) {
+		vino_module_cleanup(vino_init_stage);
+		return -ENOMEM;
+	}
+	memset(vino_drvdata, 0, sizeof(struct vino_settings));
+	vino_init_stage++;
+
+	/* create a dummy dma descriptor */
+	vino_drvdata->dummy_page = get_zeroed_page(GFP_KERNEL | GFP_DMA);
+	if (!vino_drvdata->dummy_page) {
+		vino_module_cleanup(vino_init_stage);
+		return -ENOMEM;
+	}
+	vino_init_stage++;
+
+	// TODO: use page_count in dummy_desc_table
+
+	vino_drvdata->dummy_desc_table.dma_cpu =
+		dma_alloc_coherent(NULL,
+		VINO_DUMMY_DESC_COUNT * sizeof(dma_addr_t),
+		&vino_drvdata->dummy_desc_table.dma,
+		GFP_KERNEL | GFP_DMA);
+	if (!vino_drvdata->dummy_desc_table.dma_cpu) {
+		vino_module_cleanup(vino_init_stage);
+		return -ENOMEM;
+	}
+	vino_init_stage++;
+
+	dma_dummy_address = dma_map_single(NULL,
+					   (void *)vino_drvdata->dummy_page,
+					PAGE_SIZE, DMA_FROM_DEVICE);
+	for (i = 0; i < VINO_DUMMY_DESC_COUNT; i++) {
+		vino_drvdata->dummy_desc_table.dma_cpu[i] = dma_dummy_address;
+	}
+
+	/* initialize VINO */
+
+	vino->control = 0;
+	vino->a.next_4_desc = vino_drvdata->dummy_desc_table.dma;
+	vino->b.next_4_desc = vino_drvdata->dummy_desc_table.dma;
+	udelay(VINO_DESC_FETCH_DELAY);
+
+	vino->intr_status = 0;
+
+	vino->a.fifo_thres = VINO_FIFO_THRESHOLD_DEFAULT;
+	vino->b.fifo_thres = VINO_FIFO_THRESHOLD_DEFAULT;
+
+	return 0;
+}
+
+static int vino_init_channel_settings(struct vino_channel_settings *vcs,
+				 unsigned int channel, const char *name)
+{
+	vcs->channel = channel;
+	vcs->input = VINO_INPUT_NONE;
+	vcs->alpha = 0;
+	vcs->users = 0;
+	vcs->data_format = VINO_DATA_FMT_GREY;
+	vcs->data_norm = VINO_DATA_NORM_NTSC;
+	vcs->decimation = 1;
+	vino_set_default_clipping(vcs);
+	vino_set_default_framerate(vcs);
+
+	vcs->capturing = 0;
+
+	init_MUTEX(&vcs->sem);
+	spin_lock_init(&vcs->capture_lock);
+
+	init_MUTEX(&vcs->fb_queue.queue_sem);
+	spin_lock_init(&vcs->fb_queue.queue_lock);
+	init_waitqueue_head(&vcs->fb_queue.frame_wait_queue);
+
+	vcs->v4l_device = video_device_alloc();
+	if (!vcs->v4l_device) {
+		vino_module_cleanup(vino_init_stage);
+		return -ENOMEM;
+	}
+	vino_init_stage++;
+
+	memcpy(vcs->v4l_device, &v4l_device_template,
+	       sizeof(struct video_device));
+	strcpy(vcs->v4l_device->name, name);
+	vcs->v4l_device->release = video_device_release;
+
+	video_set_drvdata(vcs->v4l_device, vcs);
+
+	return 0;
+}
+
+static int __init vino_module_init(void)
+{
+	int ret;
+
+	printk(KERN_INFO "SGI VINO driver version %s\n",
+	       VINO_MODULE_VERSION);
+
+	ret = vino_probe();
+	if (ret)
+		return ret;
+
+	ret = vino_init();
+	if (ret)
+		return ret;
+
+	/* initialize data structures */
+
+	spin_lock_init(&vino_drvdata->vino_lock);
+	spin_lock_init(&vino_drvdata->input_lock);
+
+	ret = vino_init_channel_settings(&vino_drvdata->a, VINO_CHANNEL_A,
+				    vino_v4l_device_name_a);
+	if (ret)
+		return ret;
+
+	ret = vino_init_channel_settings(&vino_drvdata->b, VINO_CHANNEL_B,
+				    vino_v4l_device_name_b);
+	if (ret)
+		return ret;
+
+	/* initialize hardware and register V4L devices */
+
+	ret = request_irq(SGI_VINO_IRQ, vino_interrupt, 0,
+		vino_driver_description, NULL);
+	if (ret) {
+		printk(KERN_ERR "VINO: requesting IRQ %02d failed\n",
+		       SGI_VINO_IRQ);
+		vino_module_cleanup(vino_init_stage);
+		return -EAGAIN;
+	}
+	vino_init_stage++;
+
+	ret = vino_i2c_add_bus();
+	if (ret) {
+		printk(KERN_ERR "VINO I2C bus registration failed\n");
+		vino_module_cleanup(vino_init_stage);
+		return ret;
+	}
+	vino_init_stage++;
+
+	ret = video_register_device(vino_drvdata->a.v4l_device,
+				    VFL_TYPE_GRABBER, -1);
+	if (ret < 0) {
+		printk(KERN_ERR "VINO channel A Video4Linux-device "
+		       "registration failed\n");
+		vino_module_cleanup(vino_init_stage);
+		return -EINVAL;
+	}
+	vino_init_stage++;
+
+	ret = video_register_device(vino_drvdata->b.v4l_device,
+				    VFL_TYPE_GRABBER, -1);
+	if (ret < 0) {
+		printk(KERN_ERR "VINO channel B Video4Linux-device "
+		       "registration failed\n");
+		vino_module_cleanup(vino_init_stage);
+		return -EINVAL;
+	}
+	vino_init_stage++;
+
+#if defined(CONFIG_KMOD) && defined(MODULE)
+	request_module("saa7191");
+	request_module("indycam");
+#endif
+
+	dprintk("init complete!\n");
+
+	return 0;
+}
+
+static void __exit vino_module_exit(void)
+{
+	dprintk("exiting, stage = %d ...\n", vino_init_stage);
+	vino_module_cleanup(vino_init_stage);
+	dprintk("cleanup complete, exit!\n");
+}
+
+module_init(vino_module_init);
+module_exit(vino_module_exit);
diff -urN a/drivers/media/video/vino.h b/drivers/media/video/vino.h
--- a/drivers/media/video/vino.h	2003-10-09 12:44:30.000000000 +0300
+++ b/drivers/media/video/vino.h	2005-08-10 17:49:43.000000000 +0300
@@ -1,13 +1,19 @@
 /*
+ * Driver for the VINO (Video In No Out) system found in SGI Indys.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
  * Copyright (C) 1999 Ulf Karlsson <ulfc@bun.falkenberg.se>
  * Copyright (C) 2003 Ladislav Michl <ladis@linux-mips.org>
  */

-#ifndef VINO_H
-#define VINO_H
+#ifndef _VINO_H_
+#define _VINO_H_

 #define VINO_BASE	0x00080000	/* Vino is in the EISA address space,
 					 * but it is not an EISA bus card */
+#define VINO_PAGE_SIZE	4096

 struct sgi_vino_channel {
 	u32 _pad_alpha;
@@ -21,8 +27,9 @@
 	u32 _pad_clip_end;
 	volatile u32 clip_end;

+#define VINO_FRAMERT_FULL	0xfff
 #define VINO_FRAMERT_PAL	(1<<0)			/* 0=NTSC 1=PAL */
-#define VINO_FRAMERT_RT(x)	(((x) & 0x1fff) << 1)	/* bits 1:12 */
+#define VINO_FRAMERT_RT(x)	(((x) & 0xfff) << 1)	/* bits 1:12 */
 	u32 _pad_frame_rate;
 	volatile u32 frame_rate;

@@ -67,18 +74,18 @@
 	volatile u32 rev_id;

 #define VINO_CTRL_LITTLE_ENDIAN		(1<<0)
-#define VINO_CTRL_A_FIELD_TRANS_INT	(1<<1)	/* Field transferred int */
-#define VINO_CTRL_A_FIFO_OF_INT		(1<<2)	/* FIFO overflow int */
-#define VINO_CTRL_A_END_DESC_TBL_INT	(1<<3)	/* End of desc table int */
-#define VINO_CTRL_A_INT			(VINO_CTRL_A_FIELD_TRANS_INT | \
-					 VINO_CTRL_A_FIFO_OF_INT | \
-					 VINO_CTRL_A_END_DESC_TBL_INT)
-#define VINO_CTRL_B_FIELD_TRANS_INT	(1<<4)	/* Field transferred int */
-#define VINO_CTRL_B_FIFO_OF_INT		(1<<5)	/* FIFO overflow int */
-#define VINO_CTRL_B_END_DESC_TBL_INT	(1<<6)	/* End of desc table int */
-#define VINO_CTRL_B_INT			(VINO_CTRL_B_FIELD_TRANS_INT | \
-					 VINO_CTRL_B_FIFO_OF_INT | \
-					 VINO_CTRL_B_END_DESC_TBL_INT)
+#define VINO_CTRL_A_EOF_INT		(1<<1)	/* Field transferred int */
+#define VINO_CTRL_A_FIFO_INT		(1<<2)	/* FIFO overflow int */
+#define VINO_CTRL_A_EOD_INT		(1<<3)	/* End of desc table int */
+#define VINO_CTRL_A_INT			(VINO_CTRL_A_EOF_INT | \
+					 VINO_CTRL_A_FIFO_INT | \
+					 VINO_CTRL_A_EOD_INT)
+#define VINO_CTRL_B_EOF_INT		(1<<4)	/* Field transferred int */
+#define VINO_CTRL_B_FIFO_INT		(1<<5)	/* FIFO overflow int */
+#define VINO_CTRL_B_EOD_INT		(1<<6)	/* End of desc table int */
+#define VINO_CTRL_B_INT			(VINO_CTRL_B_EOF_INT | \
+					 VINO_CTRL_B_FIFO_INT | \
+					 VINO_CTRL_B_EOD_INT)
 #define VINO_CTRL_A_DMA_ENBL		(1<<7)
 #define VINO_CTRL_A_INTERLEAVE_ENBL	(1<<8)
 #define VINO_CTRL_A_SYNC_ENBL		(1<<9)
@@ -104,18 +111,18 @@
 	u32 _pad_control;
 	volatile u32 control;

-#define VINO_INTSTAT_A_FIELD_TRANS	(1<<0)	/* Field transferred int */
-#define VINO_INTSTAT_A_FIFO_OF		(1<<1)	/* FIFO overflow int */
-#define VINO_INTSTAT_A_END_DESC_TBL	(1<<2)	/* End of desc table int */
-#define VINO_INTSTAT_A			(VINO_INTSTAT_A_FIELD_TRANS | \
-					 VINO_INTSTAT_A_FIFO_OF | \
-					 VINO_INTSTAT_A_END_DESC_TBL)
-#define VINO_INTSTAT_B_FIELD_TRANS	(1<<3)	/* Field transferred int */
-#define VINO_INTSTAT_B_FIFO_OF		(1<<4)	/* FIFO overflow int */
-#define VINO_INTSTAT_B_END_DESC_TBL	(1<<5)	/* End of desc table int */
-#define VINO_INTSTAT_B			(VINO_INTSTAT_B_FIELD_TRANS | \
-					 VINO_INTSTAT_B_FIFO_OF | \
-					 VINO_INTSTAT_B_END_DESC_TBL)
+#define VINO_INTSTAT_A_EOF		(1<<0)	/* Field transferred int */
+#define VINO_INTSTAT_A_FIFO		(1<<1)	/* FIFO overflow int */
+#define VINO_INTSTAT_A_EOD		(1<<2)	/* End of desc table int */
+#define VINO_INTSTAT_A			(VINO_INTSTAT_A_EOF | \
+					 VINO_INTSTAT_A_FIFO | \
+					 VINO_INTSTAT_A_EOD)
+#define VINO_INTSTAT_B_EOF		(1<<3)	/* Field transferred int */
+#define VINO_INTSTAT_B_FIFO		(1<<4)	/* FIFO overflow int */
+#define VINO_INTSTAT_B_EOD		(1<<5)	/* End of desc table int */
+#define VINO_INTSTAT_B			(VINO_INTSTAT_B_EOF | \
+					 VINO_INTSTAT_B_FIFO | \
+					 VINO_INTSTAT_B_EOD)
 	u32 _pad_intr_status;
 	volatile u32 intr_status;


From ralf@linux-mips.org Wed Aug 10 18:47:20 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 10 Aug 2005 18:47:42 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:59677 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225253AbVHJRrU>; Wed, 10 Aug 2005 18:47:20 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7AHpJpR020807;
	Wed, 10 Aug 2005 18:51:20 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7AHpJ0N020806;
	Wed, 10 Aug 2005 18:51:19 +0100
Date:	Wed, 10 Aug 2005 18:51:19 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	turja@mbnet.fi
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] New Indy VINO video drivers
Message-ID: <20050810175119.GI2840@linux-mips.org>
References: <Pine.GSO.4.58.0508101819430.788@kekkonen.cs.hut.fi>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <Pine.GSO.4.58.0508101819430.788@kekkonen.cs.hut.fi>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8726
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 267
Lines: 10

On Wed, Aug 10, 2005 at 06:31:18PM +0300, turja@mbnet.fi wrote:

> The patch is against the current HEAD and it contains the new VINO video
> drivers for 2.6 kernels.
> 
> More information can be found from: http://www.mbnet.fi/~turja/vino/

Thanks, applied.

  Ralf

From greg.weeks@timesys.com Wed Aug 10 18:55:59 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 10 Aug 2005 18:56:16 +0100 (BST)
Received: from mail.timesys.com ([IPv6:::ffff:65.117.135.102]:2937 "EHLO
	exchange.timesys.com") by linux-mips.org with ESMTP
	id <S8225253AbVHJRz7>; Wed, 10 Aug 2005 18:55:59 +0100
Received: from [192.168.2.27] ([192.168.2.27]) by exchange.timesys.com with Microsoft SMTPSVC(5.0.2195.6713);
	 Wed, 10 Aug 2005 13:49:54 -0400
Message-ID: <42FA40A2.6010400@timesys.com>
Date:	Wed, 10 Aug 2005 14:00:02 -0400
From:	Greg Weeks <greg.weeks@timesys.com>
User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
CC:	linux-mips@linux-mips.org
Subject: Re: 24K malta
References: <42FA03D4.5060400@timesys.com>
In-Reply-To: <42FA03D4.5060400@timesys.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 10 Aug 2005 17:49:54.0515 (UTC) FILETIME=[EA56E230:01C59DD3]
To:	unlisted-recipients:; (no To-header on input)
Return-Path: <greg.weeks@timesys.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8727
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: greg.weeks@timesys.com
Precedence: bulk
X-list: linux-mips
Content-Length: 913
Lines: 25

Greg Weeks wrote:

> I'm seeing something strange on a 24K malta and I'm wondering if 
> anyone else has ran into something like it.
>
> This is a 2.6.12 based kernel. I've not had a chance to try the 
> current CVS yet. The last time I checked the current CVS didn't boot 
> as is on a 4Kc malta so I've not been keeping current with CVS.
>
> When I try a simple
>
> strace ls
>
> I either hang or seg fault on a 24Kc or 24Kec processor, but a 4Kc or 
> 4Kec works. If I turn off the cache on the 24K it works as well. 
> Without cache it's unbearably slow of course. This is the same exact 
> build of the kernel and root file system for all boards.

The memcpy prefetch bug is still there for malta, so I had to build 
another kernel. This is with a CVS sync from this morning.

The first strace ls works now, but the second time I do it it hangs. 
Kill -9 frees it up and the board isn't hanging.

Greg Weeks

From real.psyence@gmail.com Wed Aug 10 20:13:49 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 10 Aug 2005 20:14:10 +0100 (BST)
Received: from rproxy.gmail.com ([IPv6:::ffff:64.233.170.194]:38779 "EHLO
	rproxy.gmail.com") by linux-mips.org with ESMTP id <S8225252AbVHJTNt> convert rfc822-to-8bit;
	Wed, 10 Aug 2005 20:13:49 +0100
Received: by rproxy.gmail.com with SMTP id c16so159622rne
        for <linux-mips@linux-mips.org>; Wed, 10 Aug 2005 12:17:53 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition;
        b=b56+78VZUaDzbjwvD/KnC4DQMLxXBnos68dgjm95G+kqtX4ep1tOgu1eOV7Bgbq9To0M+0mGNNLbJ9ldiPj4zLUSQscJipsOsOwxieVTViMdYMb4BpT0MvDkcL50fr9Rgj4TVtOw9QMbZUCBdtbt6J3KEH9S5EjA2EvUxIAHm5o=
Received: by 10.38.207.73 with SMTP id e73mr342367rng;
        Wed, 10 Aug 2005 12:17:53 -0700 (PDT)
Received: by 10.39.1.62 with HTTP; Wed, 10 Aug 2005 12:17:53 -0700 (PDT)
Message-ID: <dbce9302050810121728becc46@mail.gmail.com>
Date:	Wed, 10 Aug 2005 15:17:53 -0400
From:	David Cummings <real.psyence@gmail.com>
To:	linux-mips@linux-mips.org
Subject: shmem
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8BIT
Content-Disposition: inline
Return-Path: <real.psyence@gmail.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8732
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: real.psyence@gmail.com
Precedence: bulk
X-list: linux-mips

Hey, 
    I've run into a couple of programs that either when configuring or
running cannot allocate shared memory, or detect that it is available.
Is there an easy way to test whether or not it's available? should it
be mounted in a special way? Thanks for any info, my info is below.
kernel config:
http://davec.churchofthedollar.com/BigTom.config
output of mount:
   /dev/sda1 on / type ext3 (rw,noatime)
   proc on /proc type proc (rw)
   sysfs on /sys type sysfs (rw)
   udev on /dev type tmpfs (rw,nosuid)
   devpts on /dev/pts type devpts (rw)
   /dev/sda2 on /var type reiserfs (rw,noatime,notail)
   /dev/sda3 on /usr type reiserfs (rw,noatime)
   /dev/sda4 on /home type reiserfs (rw,noatime)
   shm on /dev/shm type tmpfs (rw,noexec,nosuid,nodev)

Thanks very much, 
-Dave
-- 
The way that can be named is not the Way.

From mips@joshuawise.com Wed Aug 10 20:32:50 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 10 Aug 2005 20:33:07 +0100 (BST)
Received: from static-151-204-232-50.bos.east.verizon.net ([IPv6:::ffff:151.204.232.50]:56279
	"EHLO mail2.sicortex.com") by linux-mips.org with ESMTP
	id <S8225252AbVHJTcu>; Wed, 10 Aug 2005 20:32:50 +0100
Received: from gs104.sicortex.com (gs104.sicortex.com [10.0.1.104])
	by mail2.sicortex.com (Postfix) with ESMTP id 601101BF211
	for <linux-mips@linux-mips.org>; Wed, 10 Aug 2005 15:36:44 -0400 (EDT)
From:	Joshua Wise <mips@joshuawise.com>
To:	linux-mips@linux-mips.org
Subject: SMP spinlocks forever while doing a put_user
Date:	Wed, 10 Aug 2005 15:36:43 -0400
User-Agent: KMail/1.8.1
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200508101536.43605.mips@joshuawise.com>
Return-Path: <mips@joshuawise.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8733
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: mips@joshuawise.com
Precedence: bulk
X-list: linux-mips

So I've been doing some research into SMP on MIPS as I mentioned a while back, 
and as I think I mentioned, I've run into issues with put_user, well, not 
putting. In particular, I found that it was engaging in the classic SMP 
pastime of sitting in a spinlock forever, doing nothing.

My current configuration is one emulated 5kc with 64mb of emulated RAM. After 
adding some preliminary support to GXemul so that it can act as a GDB server, 
I managed to dig up the following backtrace before my crummy GDB server 
implementation blew up:

(gdb) bt
#0  0xffffffff8027f4b8 in _spin_lock (lock=0x3af0) at spinlock.h:60
#1  0xffffffff80194bac in handle_mm_fault (mm=0x3a80, vma=0x310948, 
address=64321698660352, write_access=0) at mm/memory.c:2029
Cannot access memory at address 0x81b758
(gdb)

In particular, line 2029 is the spinlock within the following snippet of code:
        /*
         * We need the page table lock to synchronize with kswapd
         * and the SMP-safe atomic PTE updates.
         */
        pgd = pgd_offset(mm, address);
        spin_lock(&mm->page_table_lock);

I'm not sure where this is being held that I'm not seeing it. I guess I should 
probably enable spinlock debugging, although I've tried that once in the past 
and gotten a total of zero spinlock-debug related messages. I'll give it 
another shot, in case I selected the wrong option or some such.

Does anyone have any insight as to what's going on here?

Thanks in advance,
joshua

From mips@joshuawise.com Wed Aug 10 20:39:29 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 10 Aug 2005 20:39:48 +0100 (BST)
Received: from static-151-204-232-50.bos.east.verizon.net ([IPv6:::ffff:151.204.232.50]:39640
	"EHLO mail2.sicortex.com") by linux-mips.org with ESMTP
	id <S8225252AbVHJTj3>; Wed, 10 Aug 2005 20:39:29 +0100
Received: from gs104.sicortex.com (gs104.sicortex.com [10.0.1.104])
	by mail2.sicortex.com (Postfix) with ESMTP id 9CC091BF211
	for <linux-mips@linux-mips.org>; Wed, 10 Aug 2005 15:43:28 -0400 (EDT)
From:	Joshua Wise <mips@joshuawise.com>
To:	linux-mips@linux-mips.org
Subject: Re: SMP spinlocks forever while doing a put_user
Date:	Wed, 10 Aug 2005 15:43:27 -0400
User-Agent: KMail/1.8.1
References: <200508101536.43605.mips@joshuawise.com>
In-Reply-To: <200508101536.43605.mips@joshuawise.com>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200508101543.28175.mips@joshuawise.com>
Return-Path: <mips@joshuawise.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8734
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: mips@joshuawise.com
Precedence: bulk
X-list: linux-mips

> I'm not sure where this is being held that I'm not seeing it. I guess I
> should probably enable spinlock debugging, although I've tried that once in
> the past and gotten a total of zero spinlock-debug related messages. I'll
> give it another shot, in case I selected the wrong option or some such.
It appears that spinlock debugging was, in fact, already enabled.

joshua

From jaypee@hotpop.com Thu Aug 11 09:31:25 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 11 Aug 2005 09:31:43 +0100 (BST)
Received: from smtp-out.hotpop.com ([IPv6:::ffff:38.113.3.71]:37003 "EHLO
	smtp-out.hotpop.com") by linux-mips.org with ESMTP
	id <S8225243AbVHKIbY> convert rfc822-to-8bit; Thu, 11 Aug 2005 09:31:24 +0100
Received: from hotpop.com (kubrick.hotpop.com [38.113.3.103])
	by smtp-out.hotpop.com (Postfix) with SMTP id C138617AD637
	for <linux-mips@linux-mips.org>; Thu, 11 Aug 2005 08:35:17 +0000 (UTC)
Received: from cavan (unknown [62.253.252.7])
	by smtp-3.hotpop.com (Postfix) with ESMTP
	id 0C21917ADC57; Thu, 11 Aug 2005 08:35:16 +0000 (UTC)
Date:	Thu, 11 Aug 2005 08:35:29 +0000
From:	jaypee@hotpop.com
Subject: Au1xxx ethernet race condition?
To:	linux-mips <linux-mips@linux-mips.org>
Cc:	tnt@246tNt.com
X-Mailer: Balsa 2.3.3
Message-Id: <1123749337l.30285l.5l@cavan>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; DelSp=Yes; Format=Flowed
Content-Disposition: inline
Content-Transfer-Encoding: 8BIT
X-HotPOP: -----------------------------------------------
                   Sent By HotPOP.com FREE Email
             Get your FREE POP email at www.HotPOP.com
          -----------------------------------------------
Return-Path: <jaypee@hotpop.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8735
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: jaypee@hotpop.com
Precedence: bulk
X-list: linux-mips

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

While preforming network soak test on our au1550 based board, I noticed
lots of netdev timeout messages.

If I increased the ETH_TX_TIMEOUT to 5*HZ from HZ/4, I can see that  
traffic does stop until the watchdog barks.

However if I print out the TX DMA status at this stage all the buffers
are ready to use.

My theory as to why this occurs is that in au1000_tx there is a race  
condition.

If a tx_done interrupt for the last tx buffer occurs between reading  
buff_stat (line 1905, au1000_eth.c) and calling netif_stop_queue then
the queue won't get woken until the watchdog barks.

I inserted a local_irq_save() at line 1903 and a local_irq_restore()
at line 1915 and that seems to have fixed the problem. (Been running
for half an hour with no netdev timeouts).

I'm sure this is overkill. Can anyone else confirm?
a) they see the problem
b) that there is a better solution

As an aside, the network stack for the 2.6 kernel is pretty slow, as  
large 32k udp pckts don't use anywhere near the amount of cycles that  
1.5k udp pckts do.
Suggests to me that it is the udp/ip path that is the bottleneck.


Just had a look at the mailing list and it looks like sylvain is
having a similar problem. Can you try this fix and see if it removes
your netdev tx timeouts sylvain?

thankx

- -- 
mailto:jaypee@hotpop.com
http://www.jaypee.org.uk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFC+w3ZZDxnKy3oOpYRAsPKAKCe5R6qBsmMDyBY1w/MvoL1CvabvwCdEz9g
xFXbK05i7hD0PAYwotk2+u0=
=W7tS
-----END PGP SIGNATURE-----




From jerry@wicomtechnologies.com Thu Aug 11 10:01:31 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 11 Aug 2005 10:01:46 +0100 (BST)
Received: from smtp.wicomtechnologies.com ([IPv6:::ffff:195.234.214.162]:8149
	"EHLO smtp.wicomtechnologies.com") by linux-mips.org with ESMTP
	id <S8225244AbVHKJBb>; Thu, 11 Aug 2005 10:01:31 +0100
Received: from [192.168.0.24] (wcm-24.wicom.kiev.ua [192.168.0.24] (may be forged))
	by smtp.wicomtechnologies.com (8.12.10/8.12.10) with ESMTP id j7B95TlG033027;
	Thu, 11 Aug 2005 12:05:29 +0300 (EEST)
	(envelope-from jerry@wicomtechnologies.com)
Date:	Thu, 11 Aug 2005 12:05:27 +0300
From:	Jerry <jerry@wicomtechnologies.com>
X-Mailer: The Bat! (v3.51.10) Professional
Reply-To: Jerry <jerry@wicomtechnologies.com>
X-Priority: 3 (Normal)
Message-ID: <1905543925.20050811120527@wicomtechnologies.com>
To:	jaypee@hotpop.com
CC:	linux-mips@linux-mips.org
Subject: Re: Au1xxx ethernet race condition?
In-Reply-To: <1123749337l.30285l.5l@cavan>
References: <1123749337l.30285l.5l@cavan>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <jerry@wicomtechnologies.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8736
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: jerry@wicomtechnologies.com
Precedence: bulk
X-list: linux-mips

>[In reply to "Au1xxx ethernet race condition?" from jaypee@hotpop.com <jaypee@hotpop.com> to linux-mips <linux-mips@linux-mips.org>  11.08.2005 11:35]

> I'm sure this is overkill. Can anyone else confirm?
> a) they see the problem
> b) that there is a better solution

> As an aside, the network stack for the 2.6 kernel is pretty slow, as  
> large 32k udp pckts don't use anywhere near the amount of cycles that
> 1.5k udp pckts do.
> Suggests to me that it is the udp/ip path that is the bottleneck.

We are dealing with au1200 and there are some problems around
at least with udp timeouts and maybe low perfomance. But it
seems to be driver problems (occurs both in 2.4 and 2.6) besides
au1200 does not use au1000_eth.c

Maybe your problem is somewhere else, and maybe it is completely
different.



   ()_()
 -( ^,^ )- -[21398845]- -<The Bat! 3.51.10>- -<11.08.2005 11:47>-
  (") (")


From ralf@linux-mips.org Thu Aug 11 10:11:01 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 11 Aug 2005 10:11:18 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:21785 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225244AbVHKJLB>; Thu, 11 Aug 2005 10:11:01 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7B9EnQd001901;
	Thu, 11 Aug 2005 10:15:03 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7AJEtwq002399;
	Wed, 10 Aug 2005 20:14:55 +0100
Date:	Wed, 10 Aug 2005 20:14:55 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Greg Weeks <greg.weeks@timesys.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: 24K malta
Message-ID: <20050810191455.GA2393@linux-mips.org>
References: <42FA03D4.5060400@timesys.com> <20050810140243.GD2840@linux-mips.org> <42FA0B9E.4030900@timesys.com> <42FA1311.4060903@timesys.com> <20050810144947.GE2840@linux-mips.org> <42FA1698.2060104@timesys.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <42FA1698.2060104@timesys.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8737
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Wed, Aug 10, 2005 at 11:00:40AM -0400, Greg Weeks wrote:

> >CVS pilot error.  cvs -q update -d -P and don't forget to bitch about it ;)
> >
> > 
> >
> Would bitching about it do any good? I expect I'd just get told to stick 
> it in my .cvsrc which is what I just did.

Well, cvs's defaults seem to have been choosen following the principle
of maximum surprise and you're by far not the first to get traped by
that ...

  Ralf

From jaypee@hotpop.com Thu Aug 11 10:21:03 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 11 Aug 2005 10:21:24 +0100 (BST)
Received: from smtp-out.hotpop.com ([IPv6:::ffff:38.113.3.61]:10198 "EHLO
	smtp-out.hotpop.com") by linux-mips.org with ESMTP
	id <S8225244AbVHKJVD> convert rfc822-to-8bit; Thu, 11 Aug 2005 10:21:03 +0100
Received: from hotpop.com (kubrick.hotpop.com [38.113.3.103])
	by smtp-out.hotpop.com (Postfix) with SMTP id 9949A156C07B
	for <linux-mips@linux-mips.org>; Thu, 11 Aug 2005 09:24:58 +0000 (UTC)
Received: from cavan (unknown [62.253.252.7])
	by smtp-3.hotpop.com (Postfix) with ESMTP
	id D35FE17ADC0B; Thu, 11 Aug 2005 09:24:55 +0000 (UTC)
Date:	Thu, 11 Aug 2005 09:25:20 +0000
From:	jaypee@hotpop.com
Subject: Re: Au1xxx ethernet race condition?
To:	Jerry <jerry@wicomtechnologies.com>,
	linux-mips <linux-mips@linux-mips.org>
References: <1123749337l.30285l.5l@cavan>
	<1905543925.20050811120527@wicomtechnologies.com>
In-Reply-To: <1905543925.20050811120527@wicomtechnologies.com> (from
	jerry@wicomtechnologies.com on Thu Aug 11 10:05:27 2005)
X-Mailer: Balsa 2.3.3
Message-Id: <1123752323l.30285l.7l@cavan>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; DelSp=Yes; Format=Flowed
Content-Disposition: inline
Content-Transfer-Encoding: 8BIT
X-HotPOP: -----------------------------------------------
                   Sent By HotPOP.com FREE Email
             Get your FREE POP email at www.HotPOP.com
          -----------------------------------------------
Return-Path: <jaypee@hotpop.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8738
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: jaypee@hotpop.com
Precedence: bulk
X-list: linux-mips

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

> 
> We are dealing with au1200 and there are some problems around
> at least with udp timeouts and maybe low perfomance. But it
> seems to be driver problems (occurs both in 2.4 and 2.6) besides
> au1200 does not use au1000_eth.c
> 
> Maybe your problem is somewhere else, and maybe it is completely
> different.
> 

Agreed, I don't think au1000_eth.c is a problem as far throughput goes.


- -- 
mailto:jaypee@hotpop.com
http://www.jaypee.org.uk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD4DBQFC+xmDZDxnKy3oOpYRAkAGAJjZLla7TN9Mcny1o9H/QAoJQpfiAKCFUDmU
eOfmPvEPqbMgtpZxmK9Npg==
=IrC3
-----END PGP SIGNATURE-----




From jaypee@hotpop.com Thu Aug 11 10:23:52 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 11 Aug 2005 10:24:14 +0100 (BST)
Received: from smtp-out.hotpop.com ([IPv6:::ffff:38.113.3.71]:2274 "EHLO
	smtp-out.hotpop.com") by linux-mips.org with ESMTP
	id <S8225244AbVHKJXw> convert rfc822-to-8bit; Thu, 11 Aug 2005 10:23:52 +0100
Received: from hotpop.com (kubrick.hotpop.com [38.113.3.103])
	by smtp-out.hotpop.com (Postfix) with SMTP id 0DE4817ADC81
	for <linux-mips@linux-mips.org>; Thu, 11 Aug 2005 09:27:46 +0000 (UTC)
Received: from cavan (unknown [62.253.252.7])
	by smtp-3.hotpop.com (Postfix) with ESMTP id 16B6517ADC01
	for <linux-mips@linux-mips.org>; Thu, 11 Aug 2005 09:27:45 +0000 (UTC)
Date:	Thu, 11 Aug 2005 09:28:05 +0000
From:	jaypee@hotpop.com
Reply-To: linux-mips <linux-mips@linux-mips.org>
Subject: Re: Au1xxx ethernet race condition?
To:	linux-mips <linux-mips@linux-mips.org>
References: <1123749337l.30285l.5l@cavan>
In-Reply-To: <1123749337l.30285l.5l@cavan> (from jaypee@hotpop.com on Thu
	Aug 11 09:35:29 2005)
X-Mailer: Balsa 2.3.3
Message-Id: <1123752487l.30285l.8l@cavan>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; DelSp=Yes; Format=Flowed
Content-Disposition: inline
Content-Transfer-Encoding: 8BIT
X-HotPOP: -----------------------------------------------
                   Sent By HotPOP.com FREE Email
             Get your FREE POP email at www.HotPOP.com
          -----------------------------------------------
Return-Path: <jaypee@hotpop.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8739
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: jaypee@hotpop.com
Precedence: bulk
X-list: linux-mips

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

On 11/08/05 09:35:29, jaypee@hotpop.com wrote:
> 
> My theory as to why this occurs is that in au1000_tx there is a race
> condition.
> 
> If a tx_done interrupt for the last tx buffer occurs between reading
> buff_stat (line 1905, au1000_eth.c) and calling netif_stop_queue then
> the queue won't get woken until the watchdog barks.
> 
> I inserted a local_irq_save() at line 1903 and a local_irq_restore()
> at line 1915 and that seems to have fixed the problem. (Been running
> for half an hour with no netdev timeouts).
> 

Oh you'll need to turn WARN_ON off or you'll get lots of
Badness in local_bh_enable warnings.

- -- 
mailto:jaypee@hotpop.com
http://www.jaypee.org.uk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFC+xonZDxnKy3oOpYRApzaAKDVDqkfKA/gDXo9N6Kq2twilUVy2gCfWDRK
2qsrUN51BEFqtfXwLih7QhE=
=jbjw
-----END PGP SIGNATURE-----




From ka0ttic@gentoo.org Thu Aug 11 16:37:20 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 11 Aug 2005 16:37:41 +0100 (BST)
Received: from ms-smtp-01-smtplb.tampabay.rr.com ([IPv6:::ffff:65.32.5.131]:53150
	"EHLO ms-smtp-01.tampabay.rr.com") by linux-mips.org with ESMTP
	id <S8225297AbVHKPhU>; Thu, 11 Aug 2005 16:37:20 +0100
Received: from [192.168.1.50] (57.85.118.70.cfl.res.rr.com [70.118.85.57])
	by ms-smtp-01.tampabay.rr.com (8.12.10/8.12.7) with ESMTP id j7BFfPEg010255
	for <linux-mips@linux-mips.org>; Thu, 11 Aug 2005 11:41:27 -0400 (EDT)
Message-ID: <42FB71D4.9040408@gentoo.org>
Date:	Thu, 11 Aug 2005 11:42:12 -0400
From:	Aaron Walker <ka0ttic@gentoo.org>
User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050807)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: IP30 hang on warm boot
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: Symantec AntiVirus Scan Engine
Return-Path: <ka0ttic@gentoo.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8740
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ka0ttic@gentoo.org
Precedence: bulk
X-list: linux-mips

Gentoo has been running flawlessly on this IP30 for the last month I've had it,
except for one thing.  I've noticed that when I reboot, it hangs at the below
denoted spot:

<dmesg>
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
loop: loaded (max 8 devices)


 >>> HANGS HERE


IOC3 SuperIO: registered IOC3 at 900000001f600000, IRQ 12 (chip 0).
ttyS0 at IOC3 0x1f620178 (irq = 64) is a 16550A
ttyS1 at IOC3 0x1f620170 (irq = 65) is a 16550A
Found DS2502 NIC registration number 21:e5:b0:02:00:00, CRC 9b.
Ethernet address is 08:00:69:13:6f:e1.
eth0: link up, 100Mbps, full-duplex, lpa 0x01E1
eth0: Using PHY 1, vendor 0x15f42, model 2, rev 3.
eth0: IOC3 SSRAM has 128 kbyte.
qla1280: QLA1040 found on PCI bus 0, dev 0
PCI: Enabling device 0000:00:00.0 (0006 -> 0007)
</dmesg>

This happens every single warm boot, and never on a cold boot.  This box is
running gentoo's mips-sources-2.6.12 kernel (l-m.org cvs 20050703).  I've 
posted the actual config[1] if it helps.

[1] http://dev.gentoo.org/~ka0ttic/mips/ip30/ip30-config

Thanks
-- 
Science and religion are in full accord but science and faith are in complete
discord.

Aaron Walker <ka0ttic@gentoo.org>
[ BSD | commonbox | cron | cvs-utils | mips | netmon | shell-tools | vim ]

From sskowron@ET.PUT.Poznan.PL Thu Aug 11 17:16:41 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 11 Aug 2005 17:17:04 +0100 (BST)
Received: from corvus.et.put.poznan.pl ([IPv6:::ffff:150.254.11.9]:1263 "EHLO
	corvus.et.put.poznan.pl") by linux-mips.org with ESMTP
	id <S8225305AbVHKQQl>; Thu, 11 Aug 2005 17:16:41 +0100
Received: from corvus (corvus.et.put.poznan.pl [150.254.11.9])
	by corvus.et.put.poznan.pl (8.11.6+Sun/8.11.6) with ESMTP id j7BGKnn09765;
	Thu, 11 Aug 2005 18:20:50 +0200 (MET DST)
Received: from helios.et.put.poznan.pl ([150.254.29.65])
	by corvus.et.put.poznan.pl (MailMonitor for SMTP v1.2.2 ) ;
	Thu, 11 Aug 2005 18:20:44 +0200 (MET DST)
Received: from localhost (sskowron@localhost)
	by helios.et.put.poznan.pl (8.11.6+Sun/8.11.6) with ESMTP id j7BGKgS11110;
	Thu, 11 Aug 2005 18:20:42 +0200 (MET DST)
X-Authentication-Warning: helios.et.put.poznan.pl: sskowron owned process doing -bs
Date:	Thu, 11 Aug 2005 18:20:42 +0200 (MET DST)
From:	Stanislaw Skowronek <sskowron@ET.PUT.Poznan.PL>
To:	Aaron Walker <ka0ttic@gentoo.org>
cc:	linux-mips@linux-mips.org
Subject: Re: IP30 hang on warm boot
In-Reply-To: <42FB71D4.9040408@gentoo.org>
Message-ID: <Pine.GSO.4.10.10508111814210.10659-100000@helios.et.put.poznan.pl>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Return-Path: <sskowron@ET.PUT.Poznan.PL>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8741
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sskowron@ET.PUT.Poznan.PL
Precedence: bulk
X-list: linux-mips

Hello,

Try the current (R25) Octane patches at
http://www.linux-mips.org/~skylark/.

The IOC3 support code has been in for a massive overhaul since the gentoo
sources have been done by `K. Also, the PCI code is completely new. And
ALSA supports many more features of the RAD1.

I hope you will be pleasantly surprised,

Stanislaw Skowronek

--<=>--
  "I wish for that night-time
   To last for a lifetime.
   The darkness around me
   Shores of a solar sea."



From ka0ttic@gentoo.org Thu Aug 11 17:26:51 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 11 Aug 2005 17:27:11 +0100 (BST)
Received: from ms-smtp-02-smtplb.tampabay.rr.com ([IPv6:::ffff:65.32.5.132]:61402
	"EHLO ms-smtp-02.tampabay.rr.com") by linux-mips.org with ESMTP
	id <S8225308AbVHKQ0v>; Thu, 11 Aug 2005 17:26:51 +0100
Received: from [192.168.1.50] (57.85.118.70.cfl.res.rr.com [70.118.85.57])
	by ms-smtp-02.tampabay.rr.com (8.12.10/8.12.7) with ESMTP id j7BGUrb6019379;
	Thu, 11 Aug 2005 12:30:54 -0400 (EDT)
Message-ID: <42FB7D69.3080402@gentoo.org>
Date:	Thu, 11 Aug 2005 12:31:37 -0400
From:	Aaron Walker <ka0ttic@gentoo.org>
User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050807)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	Stanislaw Skowronek <sskowron@ET.PUT.Poznan.PL>
CC:	linux-mips@linux-mips.org
Subject: Re: IP30 hang on warm boot
References: <Pine.GSO.4.10.10508111814210.10659-100000@helios.et.put.poznan.pl>
In-Reply-To: <Pine.GSO.4.10.10508111814210.10659-100000@helios.et.put.poznan.pl>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: Symantec AntiVirus Scan Engine
Return-Path: <ka0ttic@gentoo.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8742
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ka0ttic@gentoo.org
Precedence: bulk
X-list: linux-mips

Stanislaw Skowronek wrote:

> The IOC3 support code has been in for a massive overhaul since the gentoo
> sources have been done by `K. Also, the PCI code is completely new. And
> ALSA supports many more features of the RAD1.

Sweet. Thanks.
-- 
I smell a wumpus.

Aaron Walker <ka0ttic@gentoo.org>
[ BSD | commonbox | cron | cvs-utils | mips | netmon | shell-tools | vim ]

From dannyhsdad@gmail.com Thu Aug 11 18:15:03 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 11 Aug 2005 18:15:25 +0100 (BST)
Received: from zproxy.gmail.com ([IPv6:::ffff:64.233.162.200]:22129 "EHLO
	zproxy.gmail.com") by linux-mips.org with ESMTP id <S8225322AbVHKRPD>;
	Thu, 11 Aug 2005 18:15:03 +0100
Received: by zproxy.gmail.com with SMTP id 13so317901nzn
        for <linux-mips@linux-mips.org>; Thu, 11 Aug 2005 10:19:08 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:from:to:subject:mime-version:content-type;
        b=dtZXvtFAuDyN753Kx6znIxkMEdouRFnSAh/U0kZA+a0zOSxrMhy8L0DXQoRuNKiHJ9+e2pOBDAp3H5sgKvu7x21T5+F41y28VOO3fFMB0I5Q94LF1kxlbsusQKL+/Rat58AcufMN+9o4KuIivRqFnxAlaZes5mmv/G/+LKdqHk0=
Received: by 10.36.75.13 with SMTP id x13mr1638372nza;
        Thu, 11 Aug 2005 10:19:08 -0700 (PDT)
Received: by 10.36.65.8 with HTTP; Thu, 11 Aug 2005 10:19:08 -0700 (PDT)
Message-ID: <1634a4f105081110194fe8603d@mail.gmail.com>
Date:	Thu, 11 Aug 2005 12:19:08 -0500
From:	Danny Home Educator <dannyhsdad@gmail.com>
To:	linux-mips@linux-mips.org
Subject: QEMU and mips linux
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_1028_20557494.1123780748244"
Return-Path: <dannyhsdad@gmail.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8743
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dannyhsdad@gmail.com
Precedence: bulk
X-list: linux-mips

------=_Part_1028_20557494.1123780748244
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

I've gotten the binutils and gcc per chain tools directions (except for=20
mips-unknown-linux-gnu i.e., 32 bit version of the compiler, etc.) and buil=
t=20
my own mips cross compiler (I'm on Linux/x86). Then I got the kernel source=
=20
from CVS and in the make menuconfig, all I did was change the machine=20
selection to be QEMU and CPU selection to be R4x00.

Then I hand edited the .config to enable CONFIG_CROSSCOMPILE and then I=20
built the kernel:

make CROSS_COMPILE=3Dmips-unknown-linux-gnu-

And then I got compile failure with:

LD init/built-in.o
LD .tmp_vmlinux1
arch/mips/kernel/built-in.o: In function `show_cpuinfo':
proc.c:(.text+0x9c88): undefined reference to `get_system_type'
proc.c:(.text+0x9c88): relocation truncated to fit: R_MIPS_26 against=20
`get_system_type'
make: *** [.tmp_vmlinux1] Error 1


I then edited arch/mips/qemu/q-setup.c to add:

9,14d8
< const char *get_system_type(void)
< {
< return "QEMU MIPS";
< }
<
<

And I was able to build vmlinux. I've gotten qemu-0.7.1, created blank=20
bios.bin file and when I try to run it, I get:

% qemu-system-mips -kernel vmlinux -m 16 -nographic
(qemu) mips_r4k_init: start
mips_r4k_init: load BIOS '/usr/local/share/qemu/mips_bios.bin' size 131072

And hangs there.

Has anyone else tried qemu with the latest mips linux? Thanks.

------=_Part_1028_20557494.1123780748244
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

I've gotten the binutils and gcc per chain tools directions (except for
mips-unknown-linux-gnu i.e., 32 bit version of the compiler, etc.) and
built my own mips cross compiler (I'm on Linux/x86).&nbsp; Then I got
the kernel source from CVS and in the make menuconfig, all I did was
change the machine selection to be QEMU and CPU selection to be R4x00.<br>
<br>
Then I hand edited the .config to enable CONFIG_CROSSCOMPILE and then I bui=
lt the kernel:<br>
<br>
make CROSS_COMPILE=3Dmips-unknown-linux-gnu-<br>
<br>
And then I got compile failure with:<br>
<br>
&nbsp; LD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; init/built-in.o<br>
&nbsp; LD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .tmp_vmlinux1<br>
arch/mips/kernel/built-in.o: In function `show_cpuinfo':<br>
proc.c:(.text+0x9c88): undefined reference to `get_system_type'<br>
proc.c:(.text+0x9c88): relocation truncated to fit: R_MIPS_26 against `get_=
system_type'<br>
make: *** [.tmp_vmlinux1] Error 1<br>
<br>
<br>
I then edited arch/mips/qemu/q-setup.c to add:<br>
<br>
9,14d8<br>
&lt; const char *get_system_type(void)<br>
&lt; {<br>
&lt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return &quot;QEMU MIPS&quot;;<br>
&lt; }<br>
&lt;<br>
&lt;<br>
<br>
And I was able to build vmlinux.&nbsp; I've gotten qemu-0.7.1, created blan=
k bios.bin file and when I try to run it, I get:<br>
<br>
% qemu-system-mips -kernel vmlinux -m 16 -nographic<br>
(qemu) mips_r4k_init: start<br>
mips_r4k_init: load BIOS '/usr/local/share/qemu/mips_bios.bin' size 131072<=
br>
<br>
And hangs there.<br>
<br>
Has anyone else tried qemu with the latest mips linux?&nbsp; Thanks.<br>

------=_Part_1028_20557494.1123780748244--

From ralf@linux-mips.org Thu Aug 11 18:37:29 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 11 Aug 2005 18:38:04 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:52237 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225323AbVHKRh2>; Thu, 11 Aug 2005 18:37:28 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7BHfTS8028117;
	Thu, 11 Aug 2005 18:41:29 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7BHfSLC028111;
	Thu, 11 Aug 2005 18:41:28 +0100
Date:	Thu, 11 Aug 2005 18:41:28 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Danny Home Educator <dannyhsdad@gmail.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: QEMU and mips linux
Message-ID: <20050811174128.GA31760@linux-mips.org>
References: <1634a4f105081110194fe8603d@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1634a4f105081110194fe8603d@mail.gmail.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8744
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Thu, Aug 11, 2005 at 12:19:08PM -0500, Danny Home Educator wrote:

> I've gotten the binutils and gcc per chain tools directions (except for 
> mips-unknown-linux-gnu i.e., 32 bit version of the compiler, etc.) and built 
> my own mips cross compiler (I'm on Linux/x86). Then I got the kernel source 
> from CVS and in the make menuconfig, all I did was change the machine 
> selection to be QEMU and CPU selection to be R4x00.
> 
> Then I hand edited the .config to enable CONFIG_CROSSCOMPILE and then I 
> built the kernel:
> 
> make CROSS_COMPILE=mips-unknown-linux-gnu-
> 
> And then I got compile failure with:
> 
> LD init/built-in.o
> LD .tmp_vmlinux1
> arch/mips/kernel/built-in.o: In function `show_cpuinfo':
> proc.c:(.text+0x9c88): undefined reference to `get_system_type'
> proc.c:(.text+0x9c88): relocation truncated to fit: R_MIPS_26 against 
> `get_system_type'
> make: *** [.tmp_vmlinux1] Error 1
> 
> 
> I then edited arch/mips/qemu/q-setup.c to add:
> 
> 9,14d8
> < const char *get_system_type(void)
> < {
> < return "QEMU MIPS";
> < }
> <
> <

My bad.  I've so far compiled it with procfs disabled.  Will fix.

> And I was able to build vmlinux. I've gotten qemu-0.7.1, created blank 
> bios.bin file and when I try to run it, I get:
> 
> % qemu-system-mips -kernel vmlinux -m 16 -nographic
> (qemu) mips_r4k_init: start
> mips_r4k_init: load BIOS '/usr/local/share/qemu/mips_bios.bin' size 131072
> 
> And hangs there.
> 
> Has anyone else tried qemu with the latest mips linux? Thanks.

You need to enable serial console and add -append console=ttyS0 to the
Qemu options.  That all won't help you too much because the emulator will
hang on the first instruction in user mode.

  Ralf

From ralf@linux-mips.org Fri Aug 12 17:48:05 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 12 Aug 2005 17:48:20 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:61463 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225348AbVHLQsF>; Fri, 12 Aug 2005 17:48:05 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7CGqEbb030216;
	Fri, 12 Aug 2005 17:52:14 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7CGqDN1030215;
	Fri, 12 Aug 2005 17:52:13 +0100
Date:	Fri, 12 Aug 2005 17:52:13 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
Cc:	linux-mips <linux-mips@linux-mips.org>
Subject: Re: [PATCH 2.6][1/2] vr41xx: combine TB0225 with TB0229
Message-ID: <20050812165213.GA30204@linux-mips.org>
References: <20050810000859.7458588b.yuasa@hh.iij4u.or.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050810000859.7458588b.yuasa@hh.iij4u.or.jp>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8745
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Wed, Aug 10, 2005 at 12:08:59AM +0900, Yoichi Yuasa wrote:

> This patch has combined TB0225 with TB0229 in arch/mips/vr41xx/Kconfig.
> Please apply this patch.

Applied,

  Ralf

From ralf@linux-mips.org Fri Aug 12 17:58:14 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 12 Aug 2005 17:58:28 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:54540 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225329AbVHLQ6O>; Fri, 12 Aug 2005 17:58:14 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7CH2NPv032301;
	Fri, 12 Aug 2005 18:02:23 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7CH2Nm7032300;
	Fri, 12 Aug 2005 18:02:23 +0100
Date:	Fri, 12 Aug 2005 18:02:23 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
Cc:	linux-mips <linux-mips@linux-mips.org>
Subject: Re: [PATCH 2.6][2/2] vr41xx: update GIU function call for TB0226
Message-ID: <20050812170223.GA30247@linux-mips.org>
References: <20050810001155.1d65f9e8.yuasa@hh.iij4u.or.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050810001155.1d65f9e8.yuasa@hh.iij4u.or.jp>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8746
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Wed, Aug 10, 2005 at 12:11:55AM +0900, Yoichi Yuasa wrote:

> This patch has updated vr41xx GIU function call for TB0226.
> Please apply this patch.

Thanks, applied.

  Ralf

From colin@realtek.com.tw Mon Aug 15 03:51:40 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 15 Aug 2005 03:51:59 +0100 (BST)
Received: from mf2.realtek.com.tw ([IPv6:::ffff:220.128.56.22]:28944 "EHLO
	mf2.realtek.com.tw") by linux-mips.org with ESMTP
	id <S8225760AbVHOCvk>; Mon, 15 Aug 2005 03:51:40 +0100
Received: from msx.realtek.com.tw (unverified [172.21.1.77]) by mf2.realtek.com.tw
 (Clearswift SMTPRS 5.1.4) with ESMTP id <T72c632d8addc80381610fc@mf2.realtek.com.tw> for <linux-mips@linux-mips.org>;
 Mon, 15 Aug 2005 10:58:12 +0800
Received: from rtpdii3098 ([172.21.98.16])
          by msx.realtek.com.tw (Lotus Domino Release 6.5.3)
          with ESMTP id 2005081510560561-11568 ;
          Mon, 15 Aug 2005 10:56:05 +0800 
Message-ID: <006c01c5a144$e12c92d0$106215ac@realtek.com.tw>
From:	"colin" <colin@realtek.com.tw>
To:	<linux-mips@linux-mips.org>
Subject: Pthread problem in pthread_create() in uClibc
Date:	Mon, 15 Aug 2005 10:56:05 +0800
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
X-MIMETrack: Itemize by SMTP Server on msx/Realtek(Release 6.5.3|September 14, 2004) at
 2005/08/15 =?Bog5?B?pFekyCAxMDo1NjowNQ==?=,
	Serialize by Router on msx/Realtek(Release 6.5.3|September 14, 2004) at
 2005/08/15 =?Bog5?B?pFekyCAxMDo1NjowNw==?=,
	Serialize complete at 2005/08/15 =?Bog5?B?pFekyCAxMDo1NjowNw==?=
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset="big5"
Return-Path: <colin@realtek.com.tw>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8747
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: colin@realtek.com.tw
Precedence: bulk
X-list: linux-mips


Hi there,
We have encountered a pthread problem in pthread_create().
Our system is "MIPS Linux kernel 2.6.11 with uClibc 0.9.27". We need to know
if the problem is in Linux kernel or in uClibc.

When calling pthread_create(), it will fail at the line "suspend(self);".
I found that many people have encounter the same problem, but I havn't seen
any solution.
    http://www.uclibc.org/lists/uclibc/2003-April/006031.html
    http://www.uclibc.org/lists/uclibc/2004-June/009271.html
    http://www.uclibc.org/lists/uclibc/2003-July/006570.html

Here is the error message when I use gdbserver to debug it:
    "Cannot access memory at address 0x411104"

There is no this problem in "X86 Linux kernel 2.6.11 with uClibc 0.9.27".
Therefore, we need to know if this problem is because of that the MIPS Linux
kernel has some different thread behaviors from X86 Linux Kernel?

Regards,
Colin




From ralf@linux-mips.org Mon Aug 15 12:02:58 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 15 Aug 2005 12:03:15 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:27164 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225877AbVHOLC6>; Mon, 15 Aug 2005 12:02:58 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7FB7Pkr011968;
	Mon, 15 Aug 2005 12:07:25 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7FB7Pqa011967;
	Mon, 15 Aug 2005 12:07:25 +0100
Date:	Mon, 15 Aug 2005 12:07:25 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Danny Home Educator <dannyhsdad@gmail.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: QEMU and mips linux
Message-ID: <20050815110725.GC2727@linux-mips.org>
References: <1634a4f105081110194fe8603d@mail.gmail.com> <20050811174128.GA31760@linux-mips.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050811174128.GA31760@linux-mips.org>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8748
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Thu, Aug 11, 2005 at 06:41:28PM +0100, Ralf Baechle wrote:

> > % qemu-system-mips -kernel vmlinux -m 16 -nographic
> > (qemu) mips_r4k_init: start
> > mips_r4k_init: load BIOS '/usr/local/share/qemu/mips_bios.bin' size 131072
> > 
> > And hangs there.
> > 
> > Has anyone else tried qemu with the latest mips linux? Thanks.
> 
> You need to enable serial console and add -append console=ttyS0 to the
> Qemu options.  That all won't help you too much because the emulator will
> hang on the first instruction in user mode.

Qemu as of before the weekend which needed slight tweaks to compile was
haning just in the BogoMIPS loop.  With minor fixes it's now getting
beyond that point and sometimes running trivial userspace code ok.

  Ralf

From ralf@linux-mips.org Mon Aug 15 15:55:29 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 15 Aug 2005 15:55:45 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:20486 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225944AbVHOOz3>; Mon, 15 Aug 2005 15:55:29 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7FExx8C027807;
	Mon, 15 Aug 2005 15:59:59 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7FExwaq027806;
	Mon, 15 Aug 2005 15:59:58 +0100
Date:	Mon, 15 Aug 2005 15:59:57 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	linux-mips@linux-mips.org
Subject: Re: include/asm-mips/pci.h fix
Message-ID: <20050815145957.GD2727@linux-mips.org>
References: <20050805.225805.25908929.anemo@mba.ocn.ne.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050805.225805.25908929.anemo@mba.ocn.ne.jp>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8749
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Fri, Aug 05, 2005 at 10:58:05PM +0900, Atsushi Nemoto wrote:

> Currently pci_unmap_addr(), etc. are always defined as nop.  It should
> be defined when pci_unmap_single is not a nop.  Here is a patch.
> 
> diff -ur linux-mips/include/asm-mips/pci.h linux/include/asm-mips/pci.h
> --- linux-mips/include/asm-mips/pci.h	2005-07-26 22:14:07.000000000 +0900
> +++ linux/include/asm-mips/pci.h	2005-08-05 22:33:14.000000000 +0900
> @@ -94,7 +94,7 @@
>   */
>  extern unsigned int PCI_DMA_BUS_IS_PHYS;
>  
> -#ifdef CONFIG_MAPPED_DMA_IO

Almost correct, this be enabled for any variant of non-coherent DMA, so
I'm going to checkin a different patch.

Thanks,

  Ralf

From nacc@us.ibm.com Mon Aug 15 19:10:00 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 15 Aug 2005 19:10:21 +0100 (BST)
Received: from e5.ny.us.ibm.com ([IPv6:::ffff:32.97.182.145]:7637 "EHLO
	e5.ny.us.ibm.com") by linux-mips.org with ESMTP id <S8225256AbVHOSJ7>;
	Mon, 15 Aug 2005 19:09:59 +0100
Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234])
	by e5.ny.us.ibm.com (8.12.11/8.12.11) with ESMTP id j7FIEUME028482;
	Mon, 15 Aug 2005 14:14:30 -0400
Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64])
	by d01relay02.pok.ibm.com (8.12.10/NCO/VERS6.7) with ESMTP id j7FIEUos259450;
	Mon, 15 Aug 2005 14:14:30 -0400
Received: from d01av04.pok.ibm.com (loopback [127.0.0.1])
	by d01av04.pok.ibm.com (8.12.11/8.13.3) with ESMTP id j7FIEU3l010809;
	Mon, 15 Aug 2005 14:14:30 -0400
Received: from joust (dyn9047017070.beaverton.ibm.com [9.47.17.70] (may be forged))
	by d01av04.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j7FIEUAa010777;
	Mon, 15 Aug 2005 14:14:30 -0400
Received: by joust (Postfix, from userid 1000)
	id 4D91D4F8AA; Mon, 15 Aug 2005 11:14:29 -0700 (PDT)
Date:	Mon, 15 Aug 2005 11:14:29 -0700
From:	Nishanth Aravamudan <nacc@us.ibm.com>
To:	ralf@linux-mips.org
Cc:	akpm@osdl.org, linux-mips@linux-mips.org
Subject: [-mm PATCH 11/32] mips: fix-up schedule_timeout() usage
Message-ID: <20050815181429.GN2854@us.ibm.com>
References: <20050815180514.GC2854@us.ibm.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050815180514.GC2854@us.ibm.com>
X-Operating-System: Linux 2.6.12 (i686)
User-Agent: Mutt/1.5.9i
Return-Path: <nacc@us.ibm.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8750
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: nacc@us.ibm.com
Precedence: bulk
X-list: linux-mips

Description: Use schedule_timeout_interruptible() instead of
set_current_state()/schedule_timeout() to reduce kernel size. Also,
replace custom timespectojiffies() function with globally availabe
timespec_to_jiffies().

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>

---

 arch/mips/kernel/irixsig.c |   17 ++---------------
 arch/mips/kernel/sysirix.c |    3 +--
 2 files changed, 3 insertions(+), 17 deletions(-)

diff -urpN 2.6.13-rc5-mm1/arch/mips/kernel/irixsig.c 2.6.13-rc5-mm1-dev/arch/mips/kernel/irixsig.c
--- 2.6.13-rc5-mm1/arch/mips/kernel/irixsig.c	2005-08-07 09:57:44.000000000 -0700
+++ 2.6.13-rc5-mm1-dev/arch/mips/kernel/irixsig.c	2005-08-11 15:43:36.000000000 -0700
@@ -441,18 +441,6 @@ struct irix5_siginfo {
 	} stuff;
 };
 
-static inline unsigned long timespectojiffies(struct timespec *value)
-{
-	unsigned long sec = (unsigned) value->tv_sec;
-	long nsec = value->tv_nsec;
-
-	if (sec > (LONG_MAX / HZ))
-		return LONG_MAX;
-	nsec += 1000000000L / HZ - 1;
-	nsec /= 1000000000L / HZ;
-	return HZ * sec + nsec;
-}
-
 asmlinkage int irix_sigpoll_sys(unsigned long *set, struct irix5_siginfo *info,
 				struct timespec *tp)
 {
@@ -490,14 +478,13 @@ asmlinkage int irix_sigpoll_sys(unsigned
 			error = -EINVAL;
 			goto out;
 		}
-		expire = timespectojiffies(tp)+(tp->tv_sec||tp->tv_nsec);
+		expire = timespec_to_jiffies(tp) + (tp->tv_sec||tp->tv_nsec);
 	}
 
 	while(1) {
 		long tmp = 0;
 
-		current->state = TASK_INTERRUPTIBLE;
-		expire = schedule_timeout(expire);
+		expire = schedule_timeout_interruptible(expire);
 
 		for (i=0; i<=4; i++)
 			tmp |= (current->pending.signal.sig[i] & kset.sig[i]);
diff -urpN 2.6.13-rc5-mm1/arch/mips/kernel/sysirix.c 2.6.13-rc5-mm1-dev/arch/mips/kernel/sysirix.c
--- 2.6.13-rc5-mm1/arch/mips/kernel/sysirix.c	2005-08-07 09:57:22.000000000 -0700
+++ 2.6.13-rc5-mm1-dev/arch/mips/kernel/sysirix.c	2005-08-11 15:46:57.000000000 -0700
@@ -1035,8 +1029,7 @@ bad:
 
 asmlinkage int irix_sginap(int ticks)
 {
-	current->state = TASK_INTERRUPTIBLE;
-	schedule_timeout(ticks);
+	schedule_timeout_interruptible(ticks);
 	return 0;
 }
 

From safiudeen@vsolve.org Tue Aug 16 07:54:04 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 16 Aug 2005 07:54:23 +0100 (BST)
Received: from forward-dummy3.hsphere.cc ([IPv6:::ffff:216.157.144.3]:22485
	"HELO forward.hsphere.cc") by linux-mips.org with SMTP
	id <S8225254AbVHPGyE>; Tue, 16 Aug 2005 07:54:04 +0100
Received: (qmail 53377 invoked from network); 16 Aug 2005 06:58:54 -0000
Received: from mail3.hsphere.cc (216.157.145.23)
  by forward.hsphere.cc with SMTP; 16 Aug 2005 06:58:54 -0000
Received: (qmail 10578 invoked by uid 399); 16 Aug 2005 06:58:41 -0000
Received: from unknown (HELO ?192.168.0.5?) (safiudeen@vsolve.org@220.247.243.183)
  by mail3.hsphere.cc with SMTP; 16 Aug 2005 06:58:40 -0000
Message-ID: <43019107.20902@vsolve.org>
Date:	Tue, 16 Aug 2005 13:08:55 +0600
From:	safiudeen <safiudeen@vsolve.org>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040805 Netscape/7.2
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: Au1100 static bus interface..
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <safiudeen@vsolve.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8751
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: safiudeen@vsolve.org
Precedence: bulk
X-list: linux-mips

Hello,
I am trying to interface TLC16C550C(externel UART chip) for DB1100 
(using it's daughter card connector for IO interfcae).
After we configure the static bus controller for requred chip select, we 
use au_readl,au_writel port I/O functions.When the TLC16C550 is present, 
it the test read/write look like working, but even when TLC16C550C is 
not connected, read/write operations look like working.I think we have 
to configure the I/O base address properly.
Following are the configureation of static buss controller uased for 
this test.

CPU Chip enable-2 ( Daugter card  chip select is generated using au1100 
ce2(LOW),addr-28(HIGH),addr27(HIGH), and addr26(LOW) )
Therefore we selected the following  base address
 physical base address 0xD 1800 0000   ( D - for DTY encoding for I/O 
device)

Chip select controll registers setting as follows

 first 3 bit of mem_setcfg2 ( 0xB4001020 ) was set to 001 (DTY encoding)
mem_staddr2 (0xB4001028) was set to 0x11803FFF

vitual base address was obtained using ioremap function as follows
   
    base_addrs=(u32)ioremap(0xD18000000,0x1000); to get 32 bit address

when do read/write opreation on base_addr, it generate requred chip 
select (Daughter card CS) .But  even the TLC16C550C is not connected , 
read/write operation works as the TLC16C550 is connected. what I guis is 
address wrongly maped or some wrong in chip slect configarations.

If anyone has done interfacing externel peripheral to au1100 static bus 
controller please help me in this regards
Thanx
Safiudeen. TS



From safiudeen@hotmail.com Tue Aug 16 08:02:25 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 16 Aug 2005 08:02:45 +0100 (BST)
Received: from bay14-f21.bay14.hotmail.com ([IPv6:::ffff:64.4.49.21]:58148
	"EHLO hotmail.com") by linux-mips.org with ESMTP
	id <S8225298AbVHPHCZ>; Tue, 16 Aug 2005 08:02:25 +0100
Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;
	 Tue, 16 Aug 2005 00:06:58 -0700
Message-ID: <BAY14-F21B9D01D66A919BA51E5A7ADB00@phx.gbl>
Received: from 220.247.243.183 by by14fd.bay14.hotmail.msn.com with HTTP;
	Tue, 16 Aug 2005 07:06:58 GMT
X-Originating-IP: [220.247.243.183]
X-Originating-Email: [safiudeen@hotmail.com]
X-Sender: safiudeen@hotmail.com
From:	"safiudeen Ts" <safiudeen@hotmail.com>
To:	linux-mips@linux-mips.org
Subject: Au1100 static bus interface..
Date:	Tue, 16 Aug 2005 07:06:58 +0000
Mime-Version: 1.0
Content-Type: text/plain; format=flowed
X-OriginalArrivalTime: 16 Aug 2005 07:06:58.0912 (UTC) FILETIME=[17F77E00:01C5A231]
Return-Path: <safiudeen@hotmail.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8752
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: safiudeen@hotmail.com
Precedence: bulk
X-list: linux-mips

Hello,
I am trying to interface TLC16C550C(externel UART chip) for DB1100 (using 
it's daughter card connector for IO interfcae).
After we configure the static bus controller for requred chip select, we use 
au_readl,au_writel port I/O functions.When the TLC16C550 is present, it the 
test read/write look like working, but even when TLC16C550C is not 
connected, read/write operations look like working.I think we have to 
configure the I/O base address properly.
Following are the configureation of static buss controller uased for this 
test.

CPU Chip enable-2 ( Daugter card  chip select is generated using au1100 
ce2(LOW),addr-28(HIGH),addr27(HIGH), and addr26(LOW) )
Therefore we selected the following  base address
physical base address 0xD 1800 0000   ( D - for DTY encoding for I/O device)

Chip select controll registers setting as follows

first 3 bit of mem_setcfg2 ( 0xB4001020 ) was set to 001 (DTY encoding)
mem_staddr2 (0xB4001028) was set to 0x11803FFF

vitual base address was obtained using ioremap function as follows
     base_addrs=(u32)ioremap(0xD18000000,0x1000); to get 32 bit address

when do read/write opreation on base_addr, it generate requred chip select 
(Daughter card CS) .But  even the TLC16C550C is not connected , read/write 
operation works as the TLC16C550 is connected. what I guis is address 
wrongly maped or some wrong in chip slect configarations.

If anyone has done interfacing externel peripheral to au1100 static bus 
controller please help me in this regards
Thanx
Safiudeen. TS

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


From david.sanchez@lexbox.fr Tue Aug 16 10:09:12 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 16 Aug 2005 10:09:34 +0100 (BST)
Received: from laf31-5-82-235-130-100.fbx.proxad.net ([IPv6:::ffff:82.235.130.100]:38890
	"EHLO lexbox.fr") by linux-mips.org with ESMTP id <S8225970AbVHPJJM> convert rfc822-to-8bit;
	Tue, 16 Aug 2005 10:09:12 +0100
Subject: DB AU1550 and safeXcel DMA burst problem
Date:	Tue, 16 Aug 2005 11:11:40 +0200
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 8BIT
Message-ID: <17AB476A04B7C842887E0EB1F268111E026ED5@xpserver.intra.lexbox.org>
X-MS-Has-Attach: 
Content-class: urn:content-classes:message
X-MS-TNEF-Correlator: 
X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0
Thread-Topic: DB AU1550 and safeXcel DMA burst problem
thread-index: AcWiQoMIn9Tw9AzoTo2mhR3Tif7Ebg==
From:	"David Sanchez" <david.sanchez@lexbox.fr>
To:	<linux-mips@linux-mips.org>
Return-Path: <david.sanchez@lexbox.fr>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8753
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: david.sanchez@lexbox.fr
Precedence: bulk
X-list: linux-mips

Hi, 

I'm using the Security Engine of the DB AU1550 to compute SHA1 on files.

All is working fine but if I use a DMA burst greater than 8 words the
resulting SHA1 is incorrect !

Do you have the same behaviour ? Do you have an explanation of such a
behaviour ? Is it a HW bug ?

Thanks,

David



From tmnousia@twilight.cs.hut.fi Tue Aug 16 16:22:39 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 16 Aug 2005 16:23:16 +0100 (BST)
Received: from twilight.cs.hut.fi ([IPv6:::ffff:130.233.40.5]:51864 "EHLO
	twilight.cs.hut.fi") by linux-mips.org with ESMTP
	id <S8225988AbVHPPWj>; Tue, 16 Aug 2005 16:22:39 +0100
Received: by twilight.cs.hut.fi (Postfix, from userid 60001)
	id 9F3D62CDD; Tue, 16 Aug 2005 18:27:08 +0300 (EEST)
Received: from kekkonen.cs.hut.fi (kekkonen.cs.hut.fi [130.233.41.50])
	by twilight.cs.hut.fi (Postfix) with ESMTP id 1F5812CD6
	for <linux-mips@linux-mips.org>; Tue, 16 Aug 2005 18:27:06 +0300 (EEST)
Received: (from tmnousia@localhost)
	by kekkonen.cs.hut.fi (8.11.7p1+Sun/8.10.2) id j7GFR5q22548;
	Tue, 16 Aug 2005 18:27:05 +0300 (EEST)
Date:	Tue, 16 Aug 2005 18:27:05 +0300 (EEST)
From:	turja@mbnet.fi
X-X-Sender: tmnousia@kekkonen.cs.hut.fi
Reply-To: turja@mbnet.fi
To:	linux-mips@linux-mips.org
Subject: [PATCH] SGI Indy VINO video driver 0.0.4
Message-ID: <Pine.GSO.4.58.0508161703460.17458@kekkonen.cs.hut.fi>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Return-Path: <tmnousia@twilight.cs.hut.fi>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8754
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: turja@mbnet.fi
Precedence: bulk
X-list: linux-mips


The patch includes many bugfixes and auto-detection
of video standards has been implemented.

More information: http://www.mbnet.fi/~turja/vino/


Mikael Nousiainen


diff -urN a/drivers/media/video/indycam.c b/drivers/media/video/indycam.c
--- a/drivers/media/video/indycam.c	2005-08-16 16:31:19.000000000 +0300
+++ b/drivers/media/video/indycam.c	2005-08-16 16:32:17.000000000 +0300
@@ -27,15 +27,15 @@

 #include "indycam.h"

-//#define INDYCAM_DEBUG
-
-#define INDYCAM_MODULE_VERSION "0.0.3"
+#define INDYCAM_MODULE_VERSION "0.0.4"

 MODULE_DESCRIPTION("SGI IndyCam driver");
 MODULE_VERSION(INDYCAM_MODULE_VERSION);
 MODULE_AUTHOR("Mikael Nousiainen <tmnousia@cc.hut.fi>");
 MODULE_LICENSE("GPL");

+// #define INDYCAM_DEBUG
+
 #ifdef INDYCAM_DEBUG
 #define dprintk(x...) printk("IndyCam: " x);
 #define indycam_regdump(client) indycam_regdump_debug(client)
@@ -153,8 +153,12 @@
 	ctrl->awb = (ctrl_reg & INDYCAM_CONTROL_AWBCTL)
 		? INDYCAM_VALUE_ENABLED
 		: INDYCAM_VALUE_DISABLED;
+
 	indycam_read_reg(client, INDYCAM_SHUTTER,
 			 (unsigned char *)&ctrl->shutter);
+	ctrl->shutter = (ctrl->shutter == 0x00) ?
+		0xff : (ctrl->shutter - 1);
+
 	indycam_read_reg(client, INDYCAM_GAIN,
 			 (unsigned char *)&ctrl->gain);
 	indycam_read_reg(client, INDYCAM_RED_BALANCE,
@@ -191,8 +195,11 @@
 	}
 	indycam_write_reg(client, INDYCAM_CONTROL, ctrl_reg);

-	if (ctrl->shutter >= 0)
-		indycam_write_reg(client, INDYCAM_SHUTTER, ctrl->shutter);
+	if (ctrl->shutter >= 0) {
+		unsigned char shutter_reg = (ctrl->shutter == 0xff) ?
+			0x00 : (ctrl->shutter + 1);
+		indycam_write_reg(client, INDYCAM_SHUTTER, shutter_reg);
+	}
 	if (ctrl->gain >= 0)
 		indycam_write_reg(client, INDYCAM_GAIN, ctrl->gain);
 	if (ctrl->red_balance >= 0)
@@ -375,11 +382,11 @@
 	}
 	case DECODER_INDYCAM_GET_CONTROLS: {
 		struct indycam_control *ctrl = arg;
-		indycam_get_controls(client, ctrl);
+		return indycam_get_controls(client, ctrl);
 	}
 	case DECODER_INDYCAM_SET_CONTROLS: {
 		struct indycam_control *ctrl = arg;
-		indycam_set_controls(client, ctrl);
+		return indycam_set_controls(client, ctrl);
 	}
 	default:
 		return -EINVAL;
diff -urN a/drivers/media/video/indycam.h b/drivers/media/video/indycam.h
--- a/drivers/media/video/indycam.h	2005-08-16 16:31:19.000000000 +0300
+++ b/drivers/media/video/indycam.h	2005-08-16 16:32:17.000000000 +0300
@@ -101,7 +101,7 @@
 #define INDYCAM_AGC_DEFAULT		INDYCAM_VALUE_ENABLED
 #define INDYCAM_AWB_DEFAULT		INDYCAM_VALUE_ENABLED

-#define INDYCAM_SHUTTER_DEFAULT		INDYCAM_SHUTTER_60
+#define INDYCAM_SHUTTER_DEFAULT		0xff
 #define INDYCAM_GAIN_DEFAULT		0x80
 #define INDYCAM_RED_BALANCE_DEFAULT	0x18
 #define INDYCAM_BLUE_BALANCE_DEFAULT	0xa4
diff -urN a/drivers/media/video/saa7191.c b/drivers/media/video/saa7191.c
--- a/drivers/media/video/saa7191.c	2005-08-16 16:31:19.000000000 +0300
+++ b/drivers/media/video/saa7191.c	2005-08-16 16:32:17.000000000 +0300
@@ -26,14 +26,25 @@

 #include "saa7191.h"

-#define SAA7191_MODULE_VERSION "0.0.3"
+#define SAA7191_MODULE_VERSION	"0.0.4"

 MODULE_DESCRIPTION("Philips SAA7191 video decoder driver");
 MODULE_VERSION(SAA7191_MODULE_VERSION);
 MODULE_AUTHOR("Mikael Nousiainen <tmnousia@cc.hut.fi>");
 MODULE_LICENSE("GPL");

-#define VINO_ADAPTER	(I2C_ALGO_SGI | I2C_HW_SGI_VINO)
+// #define SAA7191_DEBUG
+
+#ifdef SAA7191_DEBUG
+#define dprintk(x...) printk("SAA7191: " x);
+#else
+#define dprintk(x...)
+#endif
+
+#define VINO_ADAPTER		(I2C_ALGO_SGI | I2C_HW_SGI_VINO)
+
+#define SAA7191_SYNC_COUNT	30
+#define SAA7191_SYNC_DELAY	100	/* milliseconds */

 struct saa7191 {
 	struct i2c_client *client;
@@ -42,20 +53,25 @@
 	 * I2C-registers are write-only */
 	unsigned char reg[25];

-	unsigned char norm;
-	unsigned char input;
+	int input;
+	int norm;
 };

 static struct i2c_driver i2c_driver_saa7191;

 static const unsigned char initseq[] = {
 	0,	/* Subaddress */
+
 	0x50,	/* SAA7191_REG_IDEL */
+
+	/* 50hz signal timing */
 	0x30,	/* SAA7191_REG_HSYB */
 	0x00,	/* SAA7191_REG_HSYS */
 	0xe8,	/* SAA7191_REG_HCLB */
 	0xb6,	/* SAA7191_REG_HCLS */
 	0xf4,	/* SAA7191_REG_HPHI */
+
+	/* control */
 	0x01,	/* SAA7191_REG_LUMA - chrominance trap active (CVBS) */
 	0x00,	/* SAA7191_REG_HUEC */
 	0xf8,	/* SAA7191_REG_CKTQ */
@@ -70,6 +86,8 @@
 	0x2c,	/* SAA7191_REG_CHCV */
 	0x00,	/* unused */
 	0x00,	/* unused */
+
+	/* 60hz signal timing */
 	0x34,	/* SAA7191_REG_HS6B */
 	0x0a,	/* SAA7191_REG_HS6S */
 	0xf4,	/* SAA7191_REG_HC6B */
@@ -92,7 +110,7 @@

 	ret = i2c_master_recv(client, value, 1);
 	if (ret < 0) {
-		printk(KERN_ERR "SAA7191: saa7191_read_status(): read failed");
+		printk(KERN_ERR "SAA7191: saa7191_read_status(): read failed\n");
 		return ret;
 	}

@@ -123,7 +141,7 @@
 	ret = i2c_master_send(client, data, length);
 	if (ret < 0) {
 		printk(KERN_ERR "SAA7191: saa7191_write_block(): "
-		       "write failed");
+		       "write failed\n");
 		return ret;
 	}

@@ -134,6 +152,7 @@

 static int saa7191_set_input(struct i2c_client *client, int input)
 {
+	struct saa7191 *decoder = i2c_get_clientdata(client);
 	unsigned char luma = saa7191_read_reg(client, SAA7191_REG_LUMA);
 	unsigned char iock = saa7191_read_reg(client, SAA7191_REG_IOCK);
 	int err;
@@ -161,6 +180,8 @@
 	if (err)
 		return -EIO;

+	decoder->input = input;
+
 	return 0;
 }

@@ -173,20 +194,6 @@
 	int err;

 	switch(norm) {
-	case SAA7191_NORM_AUTO: {
-		unsigned char status;
-
-		// does status depend on current norm ?
-		if (saa7191_read_status(client, &status))
-			return -EIO;
-
-		stdc &= ~SAA7191_STDC_SECS;
-		ctl3 &= ~SAA7191_CTL3_FSEL;
-		ctl3 |= SAA7191_CTL3_AUFD;
-		chcv = (status & SAA7191_STATUS_FIDT)
-			       ? SAA7191_CHCV_NTSC : SAA7191_CHCV_PAL;
-		break;
-	}
 	case SAA7191_NORM_PAL:
 		stdc &= ~SAA7191_STDC_SECS;
 		ctl3 &= ~(SAA7191_CTL3_AUFD | SAA7191_CTL3_FSEL);
@@ -219,9 +226,186 @@

 	decoder->norm = norm;

+	dprintk("ctl3: %02x stdc: %02x chcv: %02x\n", ctl3,
+		stdc, chcv);
+	dprintk("norm: %d\n", norm);
+
 	return 0;
 }

+static int saa7191_wait_for_signal(struct i2c_client *client,
+				   unsigned char *status)
+{
+	int i = 0;
+
+	dprintk("Checking for signal...\n");
+
+	for (i = 0; i < SAA7191_SYNC_COUNT; i++) {
+		if (saa7191_read_status(client, status))
+			return -EIO;
+
+		if (((*status) & SAA7191_STATUS_HLCK) == 0) {
+			dprintk("Signal found\n");
+			return 0;
+		}
+
+		msleep(SAA7191_SYNC_DELAY);
+	}
+
+	dprintk("No signal\n");
+
+	return -EBUSY;
+}
+
+static int saa7191_autodetect_norm_extended(struct i2c_client *client)
+{
+	unsigned char stdc = saa7191_read_reg(client, SAA7191_REG_STDC);
+	unsigned char ctl3 = saa7191_read_reg(client, SAA7191_REG_CTL3);
+	unsigned char status;
+	int err = 0;
+
+	dprintk("SAA7191 extended signal auto-detection...\n");
+
+	stdc &= ~SAA7191_STDC_SECS;
+	ctl3 &= ~(SAA7191_CTL3_FSEL);
+
+	err = saa7191_write_reg(client, SAA7191_REG_STDC, stdc);
+	if (err) {
+		err = -EIO;
+		goto out;
+	}
+	err = saa7191_write_reg(client, SAA7191_REG_CTL3, ctl3);
+	if (err) {
+		err = -EIO;
+		goto out;
+	}
+
+	ctl3 |= SAA7191_CTL3_AUFD;
+	err = saa7191_write_reg(client, SAA7191_REG_CTL3, ctl3);
+	if (err) {
+		err = -EIO;
+		goto out;
+	}
+
+	msleep(SAA7191_SYNC_DELAY);
+
+	err = saa7191_wait_for_signal(client, &status);
+	if (err)
+		goto out;
+
+	if (status & SAA7191_STATUS_FIDT) {
+		/* 60hz signal -> NTSC */
+		dprintk("60hz signal: NTSC\n");
+		return saa7191_set_norm(client, SAA7191_NORM_NTSC);
+	}
+
+	/* 50hz signal */
+	dprintk("50hz signal: Trying PAL...\n");
+
+	/* try PAL first */
+	err = saa7191_set_norm(client, SAA7191_NORM_PAL);
+	if (err)
+		goto out;
+
+	msleep(SAA7191_SYNC_DELAY);
+
+	err = saa7191_wait_for_signal(client, &status);
+	if (err)
+		goto out;
+
+	/* not 50hz ? */
+	if (status & SAA7191_STATUS_FIDT) {
+		dprintk("No 50hz signal\n");
+		err = -EAGAIN;
+		goto out;
+	}
+
+	if (status & SAA7191_STATUS_CODE) {
+		dprintk("PAL\n");
+		return 0;
+	}
+
+	dprintk("No color detected with PAL - Trying SECAM...\n");
+
+	/* no color detected ? -> try SECAM */
+	err = saa7191_set_norm(client,
+			       SAA7191_NORM_SECAM);
+	if (err)
+		goto out;
+
+	msleep(SAA7191_SYNC_DELAY);
+
+	err = saa7191_wait_for_signal(client, &status);
+	if (err)
+		goto out;
+
+	/* not 50hz ? */
+	if (status & SAA7191_STATUS_FIDT) {
+		dprintk("No 50hz signal\n");
+		err = -EAGAIN;
+		goto out;
+	}
+
+	if (status & SAA7191_STATUS_CODE) {
+		/* Color detected -> SECAM */
+		dprintk("SECAM\n");
+		return 0;
+	}
+
+	dprintk("No color detected with SECAM - Going back to PAL.\n");
+
+	/* still no color detected ?
+	 * -> set norm back to PAL */
+	err = saa7191_set_norm(client,
+			       SAA7191_NORM_PAL);
+	if (err)
+		goto out;
+
+out:
+	ctl3 = saa7191_read_reg(client, SAA7191_REG_CTL3);
+	if (ctl3 & SAA7191_CTL3_AUFD) {
+		ctl3 &= ~(SAA7191_CTL3_AUFD);
+		err = saa7191_write_reg(client, SAA7191_REG_CTL3, ctl3);
+		if (err) {
+			err = -EIO;
+		}
+	}
+
+	return err;
+}
+
+static int saa7191_autodetect_norm(struct i2c_client *client)
+{
+	unsigned char status;
+
+	dprintk("SAA7191 signal auto-detection...\n");
+
+	dprintk("Reading status...\n");
+
+	if (saa7191_read_status(client, &status))
+		return -EIO;
+
+	dprintk("Checking for signal...\n");
+
+	/* no signal ? */
+	if (status & SAA7191_STATUS_HLCK) {
+		dprintk("No signal\n");
+		return -EBUSY;
+	}
+
+	dprintk("Signal found\n");
+
+	if (status & SAA7191_STATUS_FIDT) {
+		/* 60hz signal -> NTSC */
+		dprintk("NTSC\n");
+		return saa7191_set_norm(client, SAA7191_NORM_NTSC);
+	} else {
+		/* 50hz signal -> PAL */
+		dprintk("PAL\n");
+		return saa7191_set_norm(client, SAA7191_NORM_PAL);
+	}
+}
+
 static int saa7191_get_controls(struct i2c_client *client,
 				struct saa7191_control *ctrl)
 {
@@ -311,9 +495,6 @@
 	if (err)
 		goto out_free_decoder;

-	decoder->input = SAA7191_INPUT_COMPOSITE;
-	decoder->norm = SAA7191_NORM_AUTO;
-
 	err = saa7191_write_block(client, sizeof(initseq),
 				  (unsigned char *)initseq);
 	if (err) {
@@ -323,6 +504,20 @@

 	printk(KERN_INFO "SAA7191 initialized\n");

+	decoder->input = SAA7191_INPUT_COMPOSITE;
+	decoder->norm = SAA7191_NORM_AUTO;
+
+	err = saa7191_autodetect_norm(client);
+	if (err == -EBUSY) {
+		printk(KERN_INFO "SAA7191: No signal\n");
+	} else if (err) {
+		printk(KERN_ERR "SAA7191: Signal detection failed\n");
+	} else {
+		printk(KERN_INFO "SAA7191: %s signal detected\n",
+		       (decoder->norm == SAA7191_NORM_PAL) ?
+		       "PAL" : "NTSC");
+	}
+
 	return 0;

 out_detach_client:
@@ -406,7 +601,7 @@

 		switch (*iarg) {
 		case VIDEO_MODE_AUTO:
-			return saa7191_set_norm(client, SAA7191_NORM_AUTO);
+			return saa7191_autodetect_norm(client);
 		case VIDEO_MODE_PAL:
 			return saa7191_set_norm(client, SAA7191_NORM_PAL);
 		case VIDEO_MODE_NTSC:
@@ -448,9 +643,11 @@
 		int err;

 		val = (pic->hue >> 8) - 0x80;
+
 		err = saa7191_write_reg(client, SAA7191_REG_HUEC, val);
 		if (err)
 			return -EIO;
+
 		break;
 	}
 	case DECODER_SAA7191_GET_STATUS: {
@@ -459,19 +656,30 @@

 		if (saa7191_read_status(client, &status_reg))
 			return -EIO;
+
 		status->signal = ((status_reg & SAA7191_STATUS_HLCK) == 0)
 			? SAA7191_VALUE_ENABLED : SAA7191_VALUE_DISABLED;
-		status->ntsc = (status_reg & SAA7191_STATUS_FIDT)
+		status->signal_60hz = (status_reg & SAA7191_STATUS_FIDT)
 			? SAA7191_VALUE_ENABLED : SAA7191_VALUE_DISABLED;
 		status->color = (status_reg & SAA7191_STATUS_CODE)
 			? SAA7191_VALUE_ENABLED : SAA7191_VALUE_DISABLED;

 		status->input = decoder->input;
 		status->norm = decoder->norm;
+
+		break;
 	}
 	case DECODER_SAA7191_SET_NORM: {
 		int *norm = arg;
-		return saa7191_set_norm(client, *norm);
+
+		switch (*norm) {
+		case SAA7191_NORM_AUTO:
+			return saa7191_autodetect_norm(client);
+		case SAA7191_NORM_AUTO_EXT:
+			return saa7191_autodetect_norm_extended(client);
+		default:
+			return saa7191_set_norm(client, *norm);
+		}
 	}
 	case DECODER_SAA7191_GET_CONTROLS: {
 		struct saa7191_control *ctrl = arg;
diff -urN a/drivers/media/video/saa7191.h b/drivers/media/video/saa7191.h
--- a/drivers/media/video/saa7191.h	2005-08-16 16:31:19.000000000 +0300
+++ b/drivers/media/video/saa7191.h	2005-08-16 16:32:17.000000000 +0300
@@ -99,16 +99,17 @@
 #define SAA7191_NORM_PAL	1
 #define SAA7191_NORM_NTSC	2
 #define SAA7191_NORM_SECAM	3
+#define SAA7191_NORM_AUTO_EXT	4	/* extended auto-detection */

 #define SAA7191_VALUE_ENABLED		1
 #define SAA7191_VALUE_DISABLED		0
 #define SAA7191_VALUE_UNCHANGED		-1

 struct saa7191_status {
-	/* 0=no signal, 1=signal active*/
+	/* 0=no signal, 1=signal detected */
 	int signal;
 	/* 0=50hz (pal) signal, 1=60hz (ntsc) signal */
-	int ntsc;
+	int signal_60hz;
 	/* 0=no color detected, 1=color detected */
 	int color;

diff -urN a/drivers/media/video/vino.c b/drivers/media/video/vino.c
--- a/drivers/media/video/vino.c	2005-08-16 16:31:20.000000000 +0300
+++ b/drivers/media/video/vino.c	2005-08-16 16:32:17.000000000 +0300
@@ -12,15 +12,11 @@

 /*
  * TODO:
- * - remove "hacks" from memory allocation code and implement nopage()
+ * - remove "mark pages reserved-hacks" from memory allocation code
+ *   and implement nopage()
  * - check decimation, calculating and reporting image size when
  *   using decimation
- * - check vino_acquire_input(), vino_set_input() and channel
- *   ownership handling
- * - report VINO error-interrupts via ioctls ?
- * - implement picture controls (all implemented?)
- * - use macros for boolean values (?)
- * - implement user mode buffers and overlay (?)
+ * - implement read(), user mode buffers and overlay (?)
  */

 #include <linux/init.h>
@@ -59,9 +55,10 @@
  * debug info.
  * Note that the debug output also slows down the driver significantly */
 // #define VINO_DEBUG
+// #define VINO_DEBUG_INT

-#define VINO_MODULE_VERSION "0.0.3"
-#define VINO_VERSION_CODE KERNEL_VERSION(0, 0, 3)
+#define VINO_MODULE_VERSION "0.0.4"
+#define VINO_VERSION_CODE KERNEL_VERSION(0, 0, 4)

 MODULE_DESCRIPTION("SGI VINO Video4Linux2 driver");
 MODULE_VERSION(VINO_MODULE_VERSION);
@@ -90,15 +87,16 @@
 #define VINO_MIN_HEIGHT			32

 #define VINO_CLIPPING_START_ODD_D1	1
-#define VINO_CLIPPING_START_ODD_PAL	1
-#define VINO_CLIPPING_START_ODD_NTSC	1
+#define VINO_CLIPPING_START_ODD_PAL	15
+#define VINO_CLIPPING_START_ODD_NTSC	12

-#define VINO_CLIPPING_START_EVEN_D1	2
-#define VINO_CLIPPING_START_EVEN_PAL	2
-#define VINO_CLIPPING_START_EVEN_NTSC	2
+#define VINO_CLIPPING_START_EVEN_D1	1
+#define VINO_CLIPPING_START_EVEN_PAL	15
+#define VINO_CLIPPING_START_EVEN_NTSC	12

 #define VINO_INPUT_CHANNEL_COUNT	3

+/* the number is the index for vino_inputs */
 #define VINO_INPUT_NONE			-1
 #define VINO_INPUT_COMPOSITE		0
 #define VINO_INPUT_SVIDEO		1
@@ -106,15 +104,13 @@

 #define VINO_PAGE_RATIO			(PAGE_SIZE / VINO_PAGE_SIZE)

-#define VINO_FIFO_THRESHOLD_DEFAULT	512
+#define VINO_FIFO_THRESHOLD_DEFAULT	16

-/*#define VINO_FRAMEBUFFER_SIZE		(VINO_PAL_WIDTH * VINO_PAL_HEIGHT * 4 \
-  + 2 * PAGE_SIZE)*/
 #define VINO_FRAMEBUFFER_SIZE		((VINO_PAL_WIDTH \
 					  * VINO_PAL_HEIGHT * 4 \
 					  + 3 * PAGE_SIZE) & ~(PAGE_SIZE - 1))

-#define VINO_FRAMEBUFFER_MAX_COUNT	8
+#define VINO_FRAMEBUFFER_COUNT_MAX	8

 #define VINO_FRAMEBUFFER_UNUSED		0
 #define VINO_FRAMEBUFFER_IN_USE		1
@@ -130,24 +126,27 @@
 #define VINO_DUMMY_DESC_COUNT		4
 #define VINO_DESC_FETCH_DELAY		5	/* microseconds */

+#define VINO_MAX_FRAME_SKIP_COUNT	128
+
 /* the number is the index for vino_data_formats */
 #define VINO_DATA_FMT_NONE		-1
 #define VINO_DATA_FMT_GREY		0
 #define VINO_DATA_FMT_RGB332		1
 #define VINO_DATA_FMT_RGB32		2
 #define VINO_DATA_FMT_YUV		3
-//#define VINO_DATA_FMT_RGB24		4

 #define VINO_DATA_FMT_COUNT		4

+/* the number is the index for vino_data_norms */
 #define VINO_DATA_NORM_NONE		-1
 #define VINO_DATA_NORM_NTSC		0
 #define VINO_DATA_NORM_PAL		1
 #define VINO_DATA_NORM_SECAM		2
 #define VINO_DATA_NORM_D1		3
-/* The following is a special entry that can be used to
+/* The following are special entries that can be used to
  * autodetect the norm. */
-#define VINO_DATA_NORM_AUTO		0xff
+#define VINO_DATA_NORM_AUTO		0xfe
+#define VINO_DATA_NORM_AUTO_EXT		0xff

 #define VINO_DATA_NORM_COUNT		4

@@ -231,7 +230,7 @@
 	unsigned int head;
 	unsigned int tail;

-	unsigned int data[VINO_FRAMEBUFFER_MAX_COUNT];
+	unsigned int data[VINO_FRAMEBUFFER_COUNT_MAX];
 };

 struct vino_framebuffer_queue {
@@ -245,13 +244,20 @@
 	struct vino_framebuffer_fifo in;
 	struct vino_framebuffer_fifo out;

-	struct vino_framebuffer *buffer[VINO_FRAMEBUFFER_MAX_COUNT];
+	struct vino_framebuffer *buffer[VINO_FRAMEBUFFER_COUNT_MAX];

 	spinlock_t queue_lock;
 	struct semaphore queue_sem;
 	wait_queue_head_t frame_wait_queue;
 };

+struct vino_interrupt_data {
+	struct timeval timestamp;
+	unsigned int frame_counter;
+	unsigned int skip_count;
+	unsigned int skip;
+};
+
 struct vino_channel_settings {
 	unsigned int channel;

@@ -284,6 +290,8 @@

 	unsigned int users;

+	struct vino_interrupt_data int_data;
+
 	/* V4L support */
 	struct video_device *v4l_device;
 };
@@ -314,7 +322,7 @@
 /* Module parameters */

 /*
- * Using vino_pixel_conversion the ARGB32-format pixels supplied
+ * Using vino_pixel_conversion the ABGR32-format pixels supplied
  * by the VINO chip can be converted to more common formats
  * like RGBA32 (or probably RGB24 in the future). This way we
  * can give out data that can be specified correctly with
@@ -328,7 +336,9 @@
  * Use non-zero value to enable conversion.
  */
 static int vino_pixel_conversion = 0;
+
 module_param_named(pixelconv, vino_pixel_conversion, int, 0);
+
 MODULE_PARM_DESC(pixelconv,
 		 "enable pixel conversion (non-zero value enables)");

@@ -344,15 +354,22 @@
 static const char *vino_v4l_device_name_a = "SGI VINO Channel A";
 static const char *vino_v4l_device_name_b = "SGI VINO Channel B";

+static void vino_capture_tasklet(unsigned long channel);
+
+DECLARE_TASKLET(vino_tasklet_a, vino_capture_tasklet, VINO_CHANNEL_A);
+DECLARE_TASKLET(vino_tasklet_b, vino_capture_tasklet, VINO_CHANNEL_B);
+
 static const struct vino_input vino_inputs[] = {
 	{
 		.name		= "Composite",
-		.std		= V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM,
+		.std		= V4L2_STD_NTSC | V4L2_STD_PAL
+		| V4L2_STD_SECAM,
 	},{
 		.name		= "S-Video",
-		.std		= V4L2_STD_NTSC | V4L2_STD_PAL | V4L2_STD_SECAM,
+		.std		= V4L2_STD_NTSC | V4L2_STD_PAL
+		| V4L2_STD_SECAM,
 	},{
-		.name		= "D1 (IndyCam)",
+		.name		= "D1/IndyCam",
 		.std		= V4L2_STD_NTSC,
 	}
 };
@@ -375,15 +392,10 @@
 		.colorspace	= V4L2_COLORSPACE_SRGB,
 	},{
 		.description	= "YUV 4:2:2",
-		.bpp		= 4,
+		.bpp		= 2,
 		.pixelformat	= V4L2_PIX_FMT_YUYV, // XXX: swapped?
 		.colorspace	= V4L2_COLORSPACE_SMPTE170M,
-	}/*,{
-		.description	= "24-bit RGB",
-		.bpp		= 3,
-		.pixelformat	= V4L2_PIX_FMT_RGB24,
-		.colorspace	= V4L2_COLORSPACE_SRGB,
-		}*/
+	}
 };

 static const struct vino_data_norm vino_data_norms[] = {
@@ -454,7 +466,7 @@
 			.right 	= VINO_PAL_WIDTH,
 		},
 	},{
-		.description	= "NTSC (D1 input)",
+		.description	= "NTSC/D1",
 		.std		= V4L2_STD_NTSC,
 		.fps_min	= 6,
 		.fps_max	= 30,
@@ -638,9 +650,10 @@
  */
 static int i2c_vino_client_reg(struct i2c_client *client)
 {
+	unsigned long flags;
 	int ret = 0;

-	spin_lock(&vino_drvdata->input_lock);
+	spin_lock_irqsave(&vino_drvdata->input_lock, flags);
 	switch (client->driver->id) {
 	case I2C_DRIVERID_SAA7191:
 		if (vino_drvdata->decoder.driver)
@@ -657,16 +670,17 @@
 	default:
 		ret = -ENODEV;
 	}
-	spin_unlock(&vino_drvdata->input_lock);
+	spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);

 	return ret;
 }

 static int i2c_vino_client_unreg(struct i2c_client *client)
 {
+	unsigned long flags;
 	int ret = 0;

-	spin_lock(&vino_drvdata->input_lock);
+	spin_lock_irqsave(&vino_drvdata->input_lock, flags);
 	if (client == vino_drvdata->decoder.driver) {
 		if (vino_drvdata->decoder.owner != VINO_NO_CHANNEL)
 			ret = -EBUSY;
@@ -678,7 +692,7 @@
 		else
 			vino_drvdata->camera.driver = NULL;
 	}
-	spin_unlock(&vino_drvdata->input_lock);
+	spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);

 	return ret;
 }
@@ -932,7 +946,7 @@

 /* Framebuffer fifo functions (need to be locked externally) */

-static void vino_fifo_init(struct vino_framebuffer_fifo *f,
+static inline void vino_fifo_init(struct vino_framebuffer_fifo *f,
 			   unsigned int length)
 {
 	f->length = 0;
@@ -940,16 +954,18 @@
 	f->head = 0;
 	f->tail = 0;

-	if (length > VINO_FRAMEBUFFER_MAX_COUNT)
-		length = VINO_FRAMEBUFFER_MAX_COUNT;
+	if (length > VINO_FRAMEBUFFER_COUNT_MAX)
+		length = VINO_FRAMEBUFFER_COUNT_MAX;

 	f->length = length;
 }

 /* returns true/false */
-static int vino_fifo_has_id(struct vino_framebuffer_fifo *f, unsigned int id)
+static inline int vino_fifo_has_id(struct vino_framebuffer_fifo *f,
+				   unsigned int id)
 {
 	unsigned int i;
+
 	for (i = f->head; i == (f->tail - 1); i = (i + 1) % f->length) {
 		if (f->data[i] == id)
 			return 1;
@@ -958,13 +974,15 @@
 	return 0;
 }

+#if 0
 /* returns true/false */
-static int vino_fifo_full(struct vino_framebuffer_fifo *f)
+static inline int vino_fifo_full(struct vino_framebuffer_fifo *f)
 {
 	return (f->used == f->length);
 }
+#endif

-static unsigned int vino_fifo_get_used(struct vino_framebuffer_fifo *f)
+static inline unsigned int vino_fifo_get_used(struct vino_framebuffer_fifo *f)
 {
 	return f->used;
 }
@@ -1075,8 +1093,8 @@

 	down(&q->queue_sem);

-	if (*length > VINO_FRAMEBUFFER_MAX_COUNT)
-		*length = VINO_FRAMEBUFFER_MAX_COUNT;
+	if (*length > VINO_FRAMEBUFFER_COUNT_MAX)
+		*length = VINO_FRAMEBUFFER_COUNT_MAX;

 	q->length = 0;

@@ -1312,6 +1330,7 @@
 	return ret;
 }

+#if 0
 static int vino_queue_get_total(struct vino_framebuffer_queue *q,
 				unsigned int *total)
 {
@@ -1337,6 +1356,7 @@

 	return ret;
 }
+#endif

 static struct vino_framebuffer *vino_queue_peek(struct
 						vino_framebuffer_queue *q,
@@ -1470,12 +1490,14 @@

 	dprintk("update_line_size(): before: w = %d, d = %d, "
 		"line_size = %d\n", w, d, vcs->line_size);
+
         /* line size must be multiple of 8 bytes */
 	lsize = (bpp * (w / d)) & ~7;
 	w = (lsize / bpp) * d;

 	vcs->clipping.right = vcs->clipping.left + w;
 	vcs->line_size = lsize;
+
 	dprintk("update_line_size(): after: w = %d, d = %d, "
 		"line_size = %d\n", w, d, vcs->line_size);
 }
@@ -1531,7 +1553,7 @@
 }

 /* execute with input_lock locked */
-static void vino_set_default_clipping(struct vino_channel_settings *vcs)
+static inline void vino_set_default_clipping(struct vino_channel_settings *vcs)
 {
 	vino_set_clipping(vcs, 0, 0, vino_data_norms[vcs->data_norm].width,
 			  vino_data_norms[vcs->data_norm].height);
@@ -1555,8 +1577,7 @@

 	if (d < 1) {
 		d = 1;
-	}
-	if (d > 8) {
+	} else if (d > 8) {
 		d = 8;
 	}

@@ -1569,7 +1590,7 @@
 }

 /* execute with input_lock locked */
-static void vino_reset_scaling(struct vino_channel_settings *vcs)
+static inline void vino_set_default_scaling(struct vino_channel_settings *vcs)
 {
 	vino_set_scaling(vcs, vcs->clipping.right - vcs->clipping.left,
 			 vcs->clipping.bottom - vcs->clipping.top);
@@ -1648,7 +1669,8 @@
 }

 /* execute with input_lock locked */
-static void vino_set_default_framerate(struct vino_channel_settings *vcs)
+static inline void vino_set_default_framerate(struct
+					      vino_channel_settings *vcs)
 {
 	vino_set_framerate(vcs, vino_data_norms[vcs->data_norm].fps_max);
 }
@@ -1686,6 +1708,9 @@
 	 * should be more than enough time */
 	udelay(VINO_DESC_FETCH_DELAY);

+	dprintk("vino_dma_setup(): start desc = %08x, next 4 desc = %08x\n",
+		ch->start_desc_tbl, ch->next_4_desc);
+
 	/* set the alpha register */
 	ch->alpha = vcs->alpha;

@@ -1699,9 +1724,6 @@
 		VINO_CLIP_EVEN(norm->even.top +
 			       vcs->clipping.bottom / 2 - 1) |
 		VINO_CLIP_X(vcs->clipping.right);
-	/* FIXME: end-of-field bug workaround
-		       VINO_CLIP_X(VINO_PAL_WIDTH);
-	 */

 	/* set the size of actual content in the buffer (DECIMATION !) */
 	fb->data_size = ((vcs->clipping.right - vcs->clipping.left) /
@@ -1801,7 +1823,7 @@
 }

 /* (execute only with vino_lock locked) */
-static void vino_dma_start(struct vino_channel_settings *vcs)
+static inline void vino_dma_start(struct vino_channel_settings *vcs)
 {
 	u32 ctrl = vino->control;

@@ -1812,12 +1834,14 @@
 }

 /* (execute only with vino_lock locked) */
-static void vino_dma_stop(struct vino_channel_settings *vcs)
+static inline void vino_dma_stop(struct vino_channel_settings *vcs)
 {
 	u32 ctrl = vino->control;

 	ctrl &= (vcs->channel == VINO_CHANNEL_A) ?
 		~VINO_CTRL_A_DMA_ENBL : ~VINO_CTRL_B_DMA_ENBL;
+	ctrl &= (vcs->channel == VINO_CHANNEL_A) ?
+		~VINO_CTRL_A_INT : ~VINO_CTRL_B_INT;
 	vino->control = ctrl;
 	dprintk("vino_dma_stop():\n");
 }
@@ -1901,7 +1925,7 @@
 	struct vino_framebuffer *fb;
 	unsigned int incoming, id;
 	int err = 0;
-	unsigned long flags, flags2;
+	unsigned long flags;

 	dprintk("vino_capture_next():\n");

@@ -1942,10 +1966,6 @@
 		goto out;
 	}

-	spin_lock_irqsave(&fb->state_lock, flags2);
-	fb->state = VINO_FRAMEBUFFER_UNUSED;
-	spin_unlock_irqrestore(&fb->state_lock, flags2);
-
 	if (start) {
 		vcs->capturing = 1;
 	}
@@ -1963,7 +1983,7 @@
 	return err;
 }

-static int vino_is_capturing(struct vino_channel_settings *vcs)
+static inline int vino_is_capturing(struct vino_channel_settings *vcs)
 {
 	int ret;
 	unsigned long flags;
@@ -2120,6 +2140,7 @@
 	spin_unlock_irqrestore(&vcs->capture_lock, flags);
 }

+#if 0
 static int vino_capture_failed(struct vino_channel_settings *vcs)
 {
 	struct vino_framebuffer *fb;
@@ -2164,9 +2185,31 @@

 	return 0;
 }
+#endif
+
+static void vino_skip_frame(struct vino_channel_settings *vcs)
+{
+	struct vino_framebuffer *fb;
+	unsigned long flags;
+	unsigned int id;
+
+	spin_lock_irqsave(&vcs->capture_lock, flags);
+	fb = vino_queue_peek(&vcs->fb_queue, &id);
+	if (!fb) {
+		spin_unlock_irqrestore(&vcs->capture_lock, flags);
+		dprintk("vino_skip_frame(): vino_queue_peek() failed!\n");
+		return;
+	}
+	spin_unlock_irqrestore(&vcs->capture_lock, flags);
+
+	spin_lock_irqsave(&fb->state_lock, flags);
+	fb->state = VINO_FRAMEBUFFER_UNUSED;
+	spin_unlock_irqrestore(&fb->state_lock, flags);
+
+	vino_capture_next(vcs, 0);
+}

-static void vino_frame_done(struct vino_channel_settings *vcs,
-			    unsigned int fc)
+static void vino_frame_done(struct vino_channel_settings *vcs)
 {
 	struct vino_framebuffer *fb;
 	unsigned long flags;
@@ -2180,8 +2223,9 @@
 	}
 	spin_unlock_irqrestore(&vcs->capture_lock, flags);

-	fb->frame_counter = fc;
-	do_gettimeofday(&fb->timestamp);
+	fb->frame_counter = vcs->int_data.frame_counter;
+	memcpy(&fb->timestamp, &vcs->int_data.timestamp,
+	       sizeof(struct timeval));

 	spin_lock_irqsave(&fb->state_lock, flags);
 	if (fb->state == VINO_FRAMEBUFFER_IN_USE)
@@ -2193,72 +2237,175 @@
 	vino_capture_next(vcs, 0);
 }

+static void vino_capture_tasklet(unsigned long channel) {
+	struct vino_channel_settings *vcs;
+
+	vcs = (channel == VINO_CHANNEL_A)
+		? &vino_drvdata->a : &vino_drvdata->b;
+
+	if (vcs->int_data.skip)
+		vcs->int_data.skip_count++;
+
+	if (vcs->int_data.skip && (vcs->int_data.skip_count
+				   <= VINO_MAX_FRAME_SKIP_COUNT)) {
+		vino_skip_frame(vcs);
+	} else {
+		vcs->int_data.skip_count = 0;
+		vino_frame_done(vcs);
+	}
+}
+
 static irqreturn_t vino_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	u32 intr;
+	u32 ctrl, intr;
 	unsigned int fc_a, fc_b;
-	int done_a = 0;
-	int done_b = 0;
+	int handled_a = 0, skip_a = 0, done_a = 0;
+	int handled_b = 0, skip_b = 0, done_b = 0;

-	spin_lock(&vino_drvdata->vino_lock);
-
-	intr = vino->intr_status;
-	fc_a = vino->a.field_counter / 2;
-	fc_b = vino->b.field_counter / 2;
+#ifdef VINO_DEBUG_INT
+	int loop = 0;
+	unsigned int line_count = vino->a.line_count,
+		page_index = vino->a.page_index,
+		field_counter = vino->a.field_counter,
+		start_desc_tbl = vino->a.start_desc_tbl,
+		next_4_desc = vino->a.next_4_desc;
+	unsigned int line_count_2,
+		page_index_2,
+		field_counter_2,
+		start_desc_tbl_2,
+		next_4_desc_2;
+#endif

-	// TODO: handle error-interrupts in some special way ?
+	spin_lock(&vino_drvdata->vino_lock);

- 	if (intr & VINO_INTSTAT_A) {
-		if (intr & VINO_INTSTAT_A_EOF) {
-			vino_drvdata->a.field++;
-			if (vino_drvdata->a.field > 1) {
+	while ((intr = vino->intr_status)) {
+		fc_a = vino->a.field_counter >> 1;
+		fc_b = vino->b.field_counter >> 1;
+
+		/* handle error-interrupts in some special way ?
+		 * --> skips frames */
+		if (intr & VINO_INTSTAT_A) {
+			if (intr & VINO_INTSTAT_A_EOF) {
+				vino_drvdata->a.field++;
+				if (vino_drvdata->a.field > 1) {
+					vino_dma_stop(&vino_drvdata->a);
+					vino_clear_interrupt(&vino_drvdata->a);
+					vino_drvdata->a.field = 0;
+					done_a = 1;
+				} else {
+					if (vino->a.page_index
+					    != vino_drvdata->a.line_size) {
+						vino->a.line_count = 0;
+						vino->a.page_index =
+							vino_drvdata->
+							a.line_size;
+						vino->a.next_4_desc =
+							vino->a.start_desc_tbl;
+					}
+				}
+				dprintk("channel A end-of-field "
+					"interrupt: %04x\n", intr);
+			} else {
 				vino_dma_stop(&vino_drvdata->a);
 				vino_clear_interrupt(&vino_drvdata->a);
 				vino_drvdata->a.field = 0;
-				done_a = 1;
+				skip_a = 1;
+				dprintk("channel A error interrupt: %04x\n",
+					intr);
 			}
-			dprintk("intr: channel A end-of-field interrupt: "
-				"%04x\n", intr);
-		} else {
-			vino_dma_stop(&vino_drvdata->a);
-			vino_clear_interrupt(&vino_drvdata->a);
-			done_a = 1;
-			dprintk("channel A error interrupt: %04x\n", intr);
+
+#ifdef VINO_DEBUG_INT
+			line_count_2 = vino->a.line_count;
+			page_index_2 = vino->a.page_index;
+			field_counter_2 = vino->a.field_counter;
+			start_desc_tbl_2 = vino->a.start_desc_tbl;
+			next_4_desc_2 = vino->a.next_4_desc;
+
+			printk("intr = %04x, loop = %d, field = %d\n",
+			       intr, loop, vino_drvdata->a.field);
+			printk("1- line count = %04d, page index = %04d, "
+			       "start = %08x, next = %08x\n"
+			       "   fieldc = %d, framec = %d\n",
+			       line_count, page_index, start_desc_tbl,
+			       next_4_desc, field_counter, fc_a);
+			printk("12-line count = %04d, page index = %04d, "
+			       "   start = %08x, next = %08x\n",
+			       line_count_2, page_index_2, start_desc_tbl_2,
+			       next_4_desc_2);
+
+			if (done_a)
+				printk("\n");
+#endif
 		}
-	}
-	if (intr & VINO_INTSTAT_B) {
-		if (intr & VINO_INTSTAT_B_EOF) {
-			vino_drvdata->b.field++;
-			if (vino_drvdata->b.field > 1) {
+
+		if (intr & VINO_INTSTAT_B) {
+			if (intr & VINO_INTSTAT_B_EOF) {
+				vino_drvdata->b.field++;
+				if (vino_drvdata->b.field > 1) {
+					vino_dma_stop(&vino_drvdata->b);
+					vino_clear_interrupt(&vino_drvdata->b);
+					vino_drvdata->b.field = 0;
+					done_b = 1;
+				}
+				dprintk("channel B end-of-field "
+					"interrupt: %04x\n", intr);
+			} else {
 				vino_dma_stop(&vino_drvdata->b);
 				vino_clear_interrupt(&vino_drvdata->b);
 				vino_drvdata->b.field = 0;
-				done_b = 1;
+				skip_b = 1;
+				dprintk("channel B error interrupt: %04x\n",
+					intr);
 			}
-			dprintk("intr: channel B end-of-field interrupt: "
-				"%04x\n", intr);
-		} else {
-			vino_dma_stop(&vino_drvdata->b);
-			vino_clear_interrupt(&vino_drvdata->b);
-			done_b = 1;
-			dprintk("channel B error interrupt: %04x\n", intr);
 		}
-	}

-	/* always remember to clear interrupt status */
-	vino->intr_status = ~intr;
+		/* Always remember to clear interrupt status.
+		 * Disable VINO interrupts while we do this. */
+		ctrl = vino->control;
+		vino->control = ctrl & ~(VINO_CTRL_A_INT | VINO_CTRL_B_INT);
+		vino->intr_status = ~intr;
+		vino->control = ctrl;
+
+		spin_unlock(&vino_drvdata->vino_lock);
+
+		if ((!handled_a) && (done_a || skip_a)) {
+			if (!skip_a) {
+				do_gettimeofday(&vino_drvdata->
+						a.int_data.timestamp);
+				vino_drvdata->a.int_data.frame_counter = fc_a;
+			}
+			vino_drvdata->a.int_data.skip = skip_a;

-	spin_unlock(&vino_drvdata->vino_lock);
+			dprintk("channel A %s, interrupt: %d\n",
+				skip_a ? "skipping frame" : "frame done",
+				intr);
+			tasklet_hi_schedule(&vino_tasklet_a);
+			handled_a = 1;
+		}
+
+		if ((!handled_b) && (done_b || skip_b)) {
+			if (!skip_b) {
+				do_gettimeofday(&vino_drvdata->
+						b.int_data.timestamp);
+				vino_drvdata->b.int_data.frame_counter = fc_b;
+			}
+			vino_drvdata->b.int_data.skip = skip_b;
+
+			dprintk("channel B %s, interrupt: %d\n",
+				skip_b ? "skipping frame" : "frame done",
+				intr);
+			tasklet_hi_schedule(&vino_tasklet_b);
+			handled_b = 1;
+		}

-	if (done_a) {
-		vino_frame_done(&vino_drvdata->a, fc_a);
-		dprintk("channel A frame done, interrupt: %d\n", intr);
-	}
-	if (done_b) {
-		vino_frame_done(&vino_drvdata->b, fc_b);
-		dprintk("channel B frame done, interrupt: %d\n", intr);
+#ifdef VINO_DEBUG_INT
+		loop++;
+#endif
+		spin_lock(&vino_drvdata->vino_lock);
 	}

+	spin_unlock(&vino_drvdata->vino_lock);
+
 	return IRQ_HANDLED;
 }

@@ -2278,11 +2425,13 @@
 	}
 }

-static int vino_get_saa7191_norm(int norm)
+static int vino_get_saa7191_norm(unsigned int data_norm)
 {
-	switch (norm) {
+	switch (data_norm) {
 	case VINO_DATA_NORM_AUTO:
 		return SAA7191_NORM_AUTO;
+	case VINO_DATA_NORM_AUTO_EXT:
+		return SAA7191_NORM_AUTO_EXT;
 	case VINO_DATA_NORM_PAL:
 		return SAA7191_NORM_PAL;
 	case VINO_DATA_NORM_NTSC:
@@ -2296,6 +2445,57 @@
 	}
 }

+static int vino_get_from_saa7191_norm(int saa7191_norm)
+{
+	switch (saa7191_norm) {
+	case SAA7191_NORM_PAL:
+		return VINO_DATA_NORM_PAL;
+	case SAA7191_NORM_NTSC:
+		return VINO_DATA_NORM_NTSC;
+	case SAA7191_NORM_SECAM:
+		return VINO_DATA_NORM_SECAM;
+	default:
+		printk(KERN_ERR "VINO: vino_get_from_saa7191_norm(): "
+		       "invalid norm!\n");
+		return VINO_DATA_NORM_NONE;
+	}
+}
+
+static int vino_saa7191_set_norm(unsigned int *data_norm)
+{
+	int saa7191_norm, new_data_norm;
+	int err = 0;
+
+	saa7191_norm = vino_get_saa7191_norm(*data_norm);
+
+	err = i2c_decoder_command(DECODER_SAA7191_SET_NORM,
+				  &saa7191_norm);
+	if (err)
+		goto out;
+
+	if ((*data_norm == VINO_DATA_NORM_AUTO)
+	    || (*data_norm == VINO_DATA_NORM_AUTO_EXT)) {
+		struct saa7191_status status;
+
+		err = i2c_decoder_command(DECODER_SAA7191_GET_STATUS,
+					  &status);
+		if (err)
+			goto out;
+
+		new_data_norm =
+			vino_get_from_saa7191_norm(status.norm);
+		if (new_data_norm == VINO_DATA_NORM_NONE) {
+			err = -EINVAL;
+			goto out;
+		}
+
+		*data_norm = (unsigned int)new_data_norm;
+	}
+
+out:
+	return err;
+}
+
 /* execute with input_lock locked */
 static int vino_is_input_owner(struct vino_channel_settings *vcs)
 {
@@ -2312,11 +2512,12 @@

 static int vino_acquire_input(struct vino_channel_settings *vcs)
 {
+	unsigned long flags;
 	int ret = 0;

 	dprintk("vino_acquire_input():\n");

-	spin_lock(&vino_drvdata->input_lock);
+	spin_lock_irqsave(&vino_drvdata->input_lock, flags);

 	/* First try D1 and then SAA7191 */
 	if (vino_drvdata->camera.driver
@@ -2331,23 +2532,48 @@
 		vcs->data_norm = VINO_DATA_NORM_D1;
 	} else if (vino_drvdata->decoder.driver
 		   && (vino_drvdata->decoder.owner == VINO_NO_CHANNEL)) {
+		int input, data_norm;
 		int saa7191_input;
-		int saa7191_norm;

 		if (i2c_use_client(vino_drvdata->decoder.driver)) {
 			ret = -ENODEV;
 			goto out;
 		}

-		vino_drvdata->decoder.owner = vcs->channel;
-		vcs->input = VINO_INPUT_COMPOSITE;
-		vcs->data_norm = VINO_DATA_NORM_PAL;
+		input = VINO_INPUT_COMPOSITE;

-		saa7191_input = vino_get_saa7191_input(vcs->input);
-		i2c_decoder_command(DECODER_SET_INPUT, &saa7191_input);
-
-		saa7191_norm = vino_get_saa7191_norm(vcs->data_norm);
-		i2c_decoder_command(DECODER_SAA7191_SET_NORM, &saa7191_norm);
+		saa7191_input = vino_get_saa7191_input(input);
+		ret = i2c_decoder_command(DECODER_SET_INPUT,
+					  &saa7191_input);
+		if (ret) {
+			ret = -EINVAL;
+			goto out;
+		}
+
+		spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);
+
+		/* Don't hold spinlocks while auto-detecting norm
+		 * as it may take a while... */
+
+		data_norm = VINO_DATA_NORM_AUTO_EXT;
+
+		ret = vino_saa7191_set_norm(&data_norm);
+		if ((ret == -EBUSY) || (ret == -EAGAIN)) {
+			data_norm = VINO_DATA_NORM_PAL;
+			ret = vino_saa7191_set_norm(&data_norm);
+		}
+
+		spin_lock_irqsave(&vino_drvdata->input_lock, flags);
+
+		if (ret) {
+			ret = -EINVAL;
+			goto out;
+		}
+
+		vino_drvdata->decoder.owner = vcs->channel;
+
+		vcs->input = input;
+		vcs->data_norm = data_norm;
 	} else {
 		vcs->input = (vcs->channel == VINO_CHANNEL_A) ?
 			vino_drvdata->b.input : vino_drvdata->a.input;
@@ -2362,13 +2588,14 @@

 	if (vino_is_input_owner(vcs)) {
 		vino_set_default_clipping(vcs);
+		vino_set_default_scaling(vcs);
 		vino_set_default_framerate(vcs);
 	}

 	dprintk("vino_acquire_input(): %s\n", vino_inputs[vcs->input].name);

 out:
-	spin_unlock(&vino_drvdata->input_lock);
+	spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);

 	return ret;
 }
@@ -2377,16 +2604,17 @@
 {
 	struct vino_channel_settings *vcs2 = (vcs->channel == VINO_CHANNEL_A) ?
 		&vino_drvdata->b : &vino_drvdata->a;
+	unsigned long flags;
 	int ret = 0;

 	dprintk("vino_set_input():\n");

-	spin_lock(&vino_drvdata->input_lock);
+	spin_lock_irqsave(&vino_drvdata->input_lock, flags);

 	if (vcs->input == input)
 		goto out;

-	switch(input) {
+	switch (input) {
 	case VINO_INPUT_COMPOSITE:
 	case VINO_INPUT_SVIDEO:
 		if (!vino_drvdata->decoder.driver) {
@@ -2403,17 +2631,41 @@
 		}

 		if (vino_drvdata->decoder.owner == vcs->channel) {
+			int data_norm;
 			int saa7191_input;
-			int saa7191_norm;

-			vcs->input = input;
-			vcs->data_norm = VINO_DATA_NORM_PAL;
+			saa7191_input = vino_get_saa7191_input(input);
+			ret = i2c_decoder_command(DECODER_SET_INPUT,
+						  &saa7191_input);
+			if (ret) {
+				vino_drvdata->decoder.owner = VINO_NO_CHANNEL;
+				ret = -EINVAL;
+				goto out;
+			}
+
+			spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);
+
+			/* Don't hold spinlocks while auto-detecting norm
+			 * as it may take a while... */
+
+			data_norm = VINO_DATA_NORM_AUTO_EXT;
+
+			ret = vino_saa7191_set_norm(&data_norm);
+			if ((ret  == -EBUSY) || (ret == -EAGAIN)) {
+				data_norm = VINO_DATA_NORM_PAL;
+				ret = vino_saa7191_set_norm(&data_norm);
+			}
+
+			spin_lock_irqsave(&vino_drvdata->input_lock, flags);
+
+			if (ret) {
+				vino_drvdata->decoder.owner = VINO_NO_CHANNEL;
+				ret = -EINVAL;
+				goto out;
+			}

-			saa7191_input = vino_get_saa7191_input(vcs->input);
-			i2c_decoder_command(DECODER_SET_INPUT, &saa7191_input);
-			saa7191_norm = vino_get_saa7191_norm(vcs->data_norm);
-			i2c_decoder_command(DECODER_SAA7191_SET_NORM,
-					    &saa7191_norm);
+			vcs->input = input;
+			vcs->data_norm = data_norm;
 		} else {
 			if (vcs2->input != input) {
 				ret = -EBUSY;
@@ -2469,13 +2721,16 @@
 		goto out;
 	}

-	vino_set_default_clipping(vcs);
-	vino_set_default_framerate(vcs);
+	if (vino_is_input_owner(vcs)) {
+		vino_set_default_clipping(vcs);
+		vino_set_default_scaling(vcs);
+		vino_set_default_framerate(vcs);
+	}

 	dprintk("vino_set_input(): %s\n", vino_inputs[vcs->input].name);

 out:
-	spin_unlock(&vino_drvdata->input_lock);
+	spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);

 	return ret;
 }
@@ -2484,10 +2739,11 @@
 {
 	struct vino_channel_settings *vcs2 = (vcs->channel == VINO_CHANNEL_A) ?
 		&vino_drvdata->b : &vino_drvdata->a;
+	unsigned long flags;

 	dprintk("vino_release_input():\n");

-	spin_lock(&vino_drvdata->input_lock);
+	spin_lock_irqsave(&vino_drvdata->input_lock, flags);

 	/* Release ownership of the channel
 	 * and if the other channel takes input from
@@ -2510,34 +2766,61 @@
 	}
 	vcs->input = VINO_INPUT_NONE;

-	spin_unlock(&vino_drvdata->input_lock);
+	spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);
 }

 /* execute with input_lock locked */
 static int vino_set_data_norm(struct vino_channel_settings *vcs,
-			      unsigned int data_norm)
+			      unsigned int data_norm,
+			      unsigned long *flags)
 {
-	int saa7191_norm;
+	int err = 0;
+
+	if (data_norm == vcs->data_norm)
+		return 0;

 	switch (vcs->input) {
 	case VINO_INPUT_D1:
 		/* only one "norm" supported */
-		if (data_norm != VINO_DATA_NORM_D1)
+		if ((data_norm != VINO_DATA_NORM_D1)
+		    && (data_norm != VINO_DATA_NORM_AUTO)
+		    && (data_norm != VINO_DATA_NORM_AUTO_EXT))
 			return -EINVAL;
 		break;
 	case VINO_INPUT_COMPOSITE:
-	case VINO_INPUT_SVIDEO:
+	case VINO_INPUT_SVIDEO: {
+		if ((data_norm != VINO_DATA_NORM_PAL)
+		    && (data_norm != VINO_DATA_NORM_NTSC)
+		    && (data_norm != VINO_DATA_NORM_SECAM)
+		    && (data_norm != VINO_DATA_NORM_AUTO)
+		    && (data_norm != VINO_DATA_NORM_AUTO_EXT))
+			return -EINVAL;
+
+		spin_unlock_irqrestore(&vino_drvdata->input_lock, *flags);
+
+		/* Don't hold spinlocks while setting norm
+		 * as it may take a while... */

-		saa7191_norm = vino_get_saa7191_norm(data_norm);
+		err = vino_saa7191_set_norm(&data_norm);
+
+		spin_lock_irqsave(&vino_drvdata->input_lock, *flags);
+
+		if (err)
+			goto out;

-		i2c_decoder_command(DECODER_SAA7191_SET_NORM, &saa7191_norm);
 		vcs->data_norm = data_norm;
+
+		vino_set_default_clipping(vcs);
+		vino_set_default_scaling(vcs);
+		vino_set_default_framerate(vcs);
 		break;
+	}
 	default:
 		return -EINVAL;
 	}

-	return 0;
+out:
+	return err;
 }

 /* V4L2 helper functions */
@@ -2557,8 +2840,9 @@
 static int vino_enum_data_norm(struct vino_channel_settings *vcs, __u32 index)
 {
 	int data_norm = VINO_DATA_NORM_NONE;
+	unsigned long flags;

-	spin_lock(&vino_drvdata->input_lock);
+	spin_lock_irqsave(&vino_drvdata->input_lock, flags);
 	switch(vcs->input) {
 	case VINO_INPUT_COMPOSITE:
 	case VINO_INPUT_SVIDEO:
@@ -2576,7 +2860,7 @@
 		}
 		break;
 	}
-	spin_unlock(&vino_drvdata->input_lock);
+	spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);

 	return data_norm;
 }
@@ -2584,8 +2868,9 @@
 static int vino_enum_input(struct vino_channel_settings *vcs, __u32 index)
 {
 	int input = VINO_INPUT_NONE;
+	unsigned long flags;

-	spin_lock(&vino_drvdata->input_lock);
+	spin_lock_irqsave(&vino_drvdata->input_lock, flags);
 	if (vino_drvdata->decoder.driver && vino_drvdata->camera.driver) {
 		switch (index) {
 		case 0:
@@ -2614,7 +2899,7 @@
 			break;
 		}
 	}
-	spin_unlock(&vino_drvdata->input_lock);
+	spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);

 	return input;
 }
@@ -2707,11 +2992,12 @@
 {
 	__u32 index;
 	int input;
+	unsigned long flags;

-	spin_lock(&vino_drvdata->input_lock);
+	spin_lock_irqsave(&vino_drvdata->input_lock, flags);
 	input = vcs->input;
 	index = vino_find_input_index(vcs);
-	spin_unlock(&vino_drvdata->input_lock);
+	spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);

 	dprintk("input = %d\n", input);

@@ -2746,7 +3032,9 @@
 			     struct v4l2_standard *s)
 {
 	int index = s->index;
-	int data_norm = vino_enum_data_norm(vcs, index);
+	int data_norm;
+
+	data_norm = vino_enum_data_norm(vcs, index);
 	dprintk("standard index = %d\n", index);

 	if (data_norm == VINO_DATA_NORM_NONE)
@@ -2770,13 +3058,55 @@
 	return 0;
 }

+static int vino_v4l2_querystd(struct vino_channel_settings *vcs,
+			      v4l2_std_id *std)
+{
+	unsigned long flags;
+	int err = 0;
+
+	spin_lock_irqsave(&vino_drvdata->input_lock, flags);
+
+	switch (vcs->input) {
+	case VINO_INPUT_D1:
+		*std = vino_inputs[vcs->input].std;
+		break;
+	case VINO_INPUT_COMPOSITE:
+	case VINO_INPUT_SVIDEO: {
+		struct saa7191_status status;
+
+		i2c_decoder_command(DECODER_SAA7191_GET_STATUS, &status);
+
+		if (status.signal) {
+			if (status.signal_60hz) {
+				*std = V4L2_STD_NTSC;
+			} else {
+				*std = V4L2_STD_PAL | V4L2_STD_SECAM;
+			}
+		} else {
+			*std = vino_inputs[vcs->input].std;
+		}
+		break;
+	}
+	default:
+		err = -EINVAL;
+	}
+
+	spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);
+
+	return err;
+}
+
 static int vino_v4l2_g_std(struct vino_channel_settings *vcs,
 			   v4l2_std_id *std)
 {
-	spin_lock(&vino_drvdata->input_lock);
-	dprintk("current standard = %d\n", vcs->data_norm);
+	unsigned long flags;
+
+	spin_lock_irqsave(&vino_drvdata->input_lock, flags);
+
 	*std = vino_data_norms[vcs->data_norm].std;
-	spin_unlock(&vino_drvdata->input_lock);
+	dprintk("current standard = %d\n", vcs->data_norm);
+
+	spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);

 	return 0;
 }
@@ -2784,13 +3114,18 @@
 static int vino_v4l2_s_std(struct vino_channel_settings *vcs,
 			   v4l2_std_id *std)
 {
+	unsigned long flags;
 	int ret = 0;

-	spin_lock(&vino_drvdata->input_lock);
+	spin_lock_irqsave(&vino_drvdata->input_lock, flags);
+
+	if (!vino_is_input_owner(vcs)) {
+		ret = -EBUSY;
+		goto out;
+	}

 	/* check if the standard is valid for the current input */
-	if (vino_is_input_owner(vcs)
-	    && (vino_inputs[vcs->input].std & (*std))) {
+	if ((*std) & vino_inputs[vcs->input].std) {
 		dprintk("standard accepted\n");

 		/* change the video norm for SAA7191
@@ -2799,24 +3134,33 @@
 		if (vcs->input == VINO_INPUT_D1)
 			goto out;

-		if ((*std) & V4L2_STD_PAL) {
-			vino_set_data_norm(vcs, VINO_DATA_NORM_PAL);
-			vcs->data_norm = VINO_DATA_NORM_PAL;
+		if (((*std) & V4L2_STD_PAL)
+		    && ((*std) & V4L2_STD_NTSC)
+		    && ((*std) & V4L2_STD_SECAM)) {
+			ret = vino_set_data_norm(vcs, VINO_DATA_NORM_AUTO_EXT,
+						 &flags);
+		} else if ((*std) & V4L2_STD_PAL) {
+			ret = vino_set_data_norm(vcs, VINO_DATA_NORM_PAL,
+						 &flags);
 		} else if ((*std) & V4L2_STD_NTSC) {
-			vino_set_data_norm(vcs, VINO_DATA_NORM_NTSC);
-			vcs->data_norm = VINO_DATA_NORM_NTSC;
+			ret = vino_set_data_norm(vcs, VINO_DATA_NORM_NTSC,
+						 &flags);
 		} else if ((*std) & V4L2_STD_SECAM) {
-			vino_set_data_norm(vcs, VINO_DATA_NORM_SECAM);
-			vcs->data_norm = VINO_DATA_NORM_SECAM;
+			ret = vino_set_data_norm(vcs, VINO_DATA_NORM_SECAM,
+						 &flags);
 		} else {
 			ret = -EINVAL;
 		}
+
+		if (ret) {
+			ret = -EINVAL;
+		}
 	} else {
 		ret = -EINVAL;
 	}

 out:
-	spin_unlock(&vino_drvdata->input_lock);
+	spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);

 	return ret;
 }
@@ -2854,6 +3198,7 @@
 			     struct v4l2_format *f)
 {
 	struct vino_channel_settings tempvcs;
+	unsigned long flags;

 	switch (f->type) {
 	case V4L2_BUF_TYPE_VIDEO_CAPTURE: {
@@ -2862,9 +3207,9 @@
 		dprintk("requested: w = %d, h = %d\n",
 		       pf->width, pf->height);

-		spin_lock(&vino_drvdata->input_lock);
+		spin_lock_irqsave(&vino_drvdata->input_lock, flags);
 		memcpy(&tempvcs, vcs, sizeof(struct vino_channel_settings));
-		spin_unlock(&vino_drvdata->input_lock);
+		spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);

 		tempvcs.data_format = vino_find_data_format(pf->pixelformat);
 		if (tempvcs.data_format == VINO_DATA_FMT_NONE) {
@@ -2907,10 +3252,13 @@
 static int vino_v4l2_g_fmt(struct vino_channel_settings *vcs,
 			   struct v4l2_format *f)
 {
+	unsigned long flags;
+
 	switch (f->type) {
 	case V4L2_BUF_TYPE_VIDEO_CAPTURE: {
 		struct v4l2_pix_format *pf = &f->fmt.pix;
-		spin_lock(&vino_drvdata->input_lock);
+
+		spin_lock_irqsave(&vino_drvdata->input_lock, flags);

 		pf->width = (vcs->clipping.right - vcs->clipping.left) /
 			vcs->decimation;
@@ -2929,7 +3277,7 @@

 		pf->priv = 0;

-		spin_unlock(&vino_drvdata->input_lock);
+		spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);
 		break;
 	}
 	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
@@ -2944,18 +3292,22 @@
 			   struct v4l2_format *f)
 {
 	int data_format;
+	unsigned long flags;

 	switch (f->type) {
 	case V4L2_BUF_TYPE_VIDEO_CAPTURE: {
 		struct v4l2_pix_format *pf = &f->fmt.pix;
-		spin_lock(&vino_drvdata->input_lock);
+
+		spin_lock_irqsave(&vino_drvdata->input_lock, flags);

 		if (!vino_is_input_owner(vcs)) {
-			spin_unlock(&vino_drvdata->input_lock);
-			return -EINVAL;
+			spin_unlock_irqrestore(&vino_drvdata->input_lock,
+					       flags);
+			return -EBUSY;
 		}

 		data_format = vino_find_data_format(pf->pixelformat);
+
 		if (data_format == VINO_DATA_FMT_NONE) {
 			vcs->data_format = VINO_DATA_FMT_RGB32;
 			pf->pixelformat =
@@ -2984,7 +3336,7 @@

 		pf->priv = 0;

-		spin_unlock(&vino_drvdata->input_lock);
+		spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);
 		break;
 	}
 	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
@@ -2999,12 +3351,15 @@
 			     struct v4l2_cropcap *ccap)
 {
 	const struct vino_data_norm *norm;
+	unsigned long flags;

 	switch (ccap->type) {
 	case V4L2_BUF_TYPE_VIDEO_CAPTURE:
-		spin_lock(&vino_drvdata->input_lock);
+		spin_lock_irqsave(&vino_drvdata->input_lock, flags);
+
 		norm = &vino_data_norms[vcs->data_norm];
-		spin_unlock(&vino_drvdata->input_lock);
+
+		spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);

 		ccap->bounds.left = 0;
 		ccap->bounds.top = 0;
@@ -3027,16 +3382,18 @@
 static int vino_v4l2_g_crop(struct vino_channel_settings *vcs,
 			    struct v4l2_crop *c)
 {
+	unsigned long flags;
+
 	switch (c->type) {
 	case V4L2_BUF_TYPE_VIDEO_CAPTURE:
-		spin_lock(&vino_drvdata->input_lock);
+		spin_lock_irqsave(&vino_drvdata->input_lock, flags);

 		c->c.left = vcs->clipping.left;
 		c->c.top = vcs->clipping.top;
 		c->c.width = vcs->clipping.right - vcs->clipping.left;
 		c->c.height = vcs->clipping.bottom - vcs->clipping.top;

-		spin_unlock(&vino_drvdata->input_lock);
+		spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);
 		break;
 	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
 	default:
@@ -3049,18 +3406,21 @@
 static int vino_v4l2_s_crop(struct vino_channel_settings *vcs,
 			    struct v4l2_crop *c)
 {
+	unsigned long flags;
+
 	switch (c->type) {
 	case V4L2_BUF_TYPE_VIDEO_CAPTURE:
-		spin_lock(&vino_drvdata->input_lock);
+		spin_lock_irqsave(&vino_drvdata->input_lock, flags);

 		if (!vino_is_input_owner(vcs)) {
-			spin_unlock(&vino_drvdata->input_lock);
-			return -EINVAL;
+			spin_unlock_irqrestore(&vino_drvdata->input_lock,
+					       flags);
+			return -EBUSY;
 		}
 		vino_set_clipping(vcs, c->c.left, c->c.top,
 				  c->c.width, c->c.height);

-		spin_unlock(&vino_drvdata->input_lock);
+		spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);
 		break;
 	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
 	default:
@@ -3073,6 +3433,8 @@
 static int vino_v4l2_g_parm(struct vino_channel_settings *vcs,
 			    struct v4l2_streamparm *sp)
 {
+	unsigned long flags;
+
 	switch (sp->type) {
 	case V4L2_BUF_TYPE_VIDEO_CAPTURE: {
 		struct v4l2_captureparm *cp = &sp->parm.capture;
@@ -3081,9 +3443,11 @@
 		cp->capability = V4L2_CAP_TIMEPERFRAME;
 		cp->timeperframe.numerator = 1;

-		spin_lock(&vino_drvdata->input_lock);
+		spin_lock_irqsave(&vino_drvdata->input_lock, flags);
+
 		cp->timeperframe.denominator = vcs->fps;
-		spin_unlock(&vino_drvdata->input_lock);
+
+		spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);

 		// TODO: cp->readbuffers = xxx;
 		break;
@@ -3099,14 +3463,18 @@
 static int vino_v4l2_s_parm(struct vino_channel_settings *vcs,
 			    struct v4l2_streamparm *sp)
 {
+	unsigned long flags;
+
 	switch (sp->type) {
 	case V4L2_BUF_TYPE_VIDEO_CAPTURE: {
 		struct v4l2_captureparm *cp = &sp->parm.capture;

-		spin_lock(&vino_drvdata->input_lock);
+		spin_lock_irqsave(&vino_drvdata->input_lock, flags);
+
 		if (!vino_is_input_owner(vcs)) {
-			spin_unlock(&vino_drvdata->input_lock);
-			return -EINVAL;
+			spin_unlock_irqrestore(&vino_drvdata->input_lock,
+					       flags);
+			return -EBUSY;
 		}

 		if ((cp->timeperframe.numerator == 0) ||
@@ -3117,7 +3485,8 @@
 			vino_set_framerate(vcs, cp->timeperframe.denominator /
 					   cp->timeperframe.numerator);
 		}
-		spin_unlock(&vino_drvdata->input_lock);
+
+		spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);

 		// TODO: set buffers according to cp->readbuffers
 		break;
@@ -3301,12 +3670,12 @@
 		err = vino_queue_get_incoming(&vcs->fb_queue, &incoming);
 		if (err) {
 			dprintk("vino_queue_get_incoming() failed\n");
-			return -EIO;
+			return -EINVAL;
 		}
 		err = vino_queue_get_outgoing(&vcs->fb_queue, &outgoing);
 		if (err) {
 			dprintk("vino_queue_get_outgoing() failed\n");
-			return -EIO;
+			return -EINVAL;
 		}

 		dprintk("incoming = %d, outgoing = %d\n", incoming, outgoing);
@@ -3326,8 +3695,10 @@
 			if (err) {
 				err = vino_wait_for_frame(vcs);
 				if (err) {
-					/* interrupted */
-					vino_capture_failed(vcs);
+					/* interrupted or
+					 * no frames captured because
+					 * of frame skipping */
+					// vino_capture_failed(vcs);
 					return -EIO;
 				}
 			}
@@ -3340,10 +3711,12 @@
 		}

 		err = vino_check_buffer(vcs, fb);
+
+		vino_v4l2_get_buffer_status(vcs, fb, b);
+
 		if (err)
 			return -EIO;

-		vino_v4l2_get_buffer_status(vcs, fb, b);
 		break;
 	}
 	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
@@ -3409,10 +3782,11 @@
 static int vino_v4l2_queryctrl(struct vino_channel_settings *vcs,
 			       struct v4l2_queryctrl *queryctrl)
 {
+	unsigned long flags;
 	int i;
 	int err = 0;

-	spin_lock(&vino_drvdata->input_lock);
+	spin_lock_irqsave(&vino_drvdata->input_lock, flags);

 	switch (vcs->input) {
 	case VINO_INPUT_D1:
@@ -3447,7 +3821,7 @@
 	}

  found:
-	spin_unlock(&vino_drvdata->input_lock);
+	spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);

 	return err;
 }
@@ -3455,16 +3829,21 @@
 static int vino_v4l2_g_ctrl(struct vino_channel_settings *vcs,
 			    struct v4l2_control *control)
 {
-	struct indycam_control indycam_ctrl;
-	struct saa7191_control saa7191_ctrl;
+	unsigned long flags;
 	int err = 0;

-	spin_lock(&vino_drvdata->input_lock);
+	spin_lock_irqsave(&vino_drvdata->input_lock, flags);

 	switch (vcs->input) {
-	case VINO_INPUT_D1:
-		i2c_camera_command(DECODER_INDYCAM_GET_CONTROLS,
-				   &indycam_ctrl);
+	case VINO_INPUT_D1: {
+		struct indycam_control indycam_ctrl;
+
+		err = i2c_camera_command(DECODER_INDYCAM_GET_CONTROLS,
+					 &indycam_ctrl);
+		if (err) {
+			err = -EINVAL;
+			goto out;
+		}

 		switch(control->id) {
 		case V4L2_CID_AUTOGAIN:
@@ -3498,10 +3877,17 @@
 			err = -EINVAL;
 		}
 		break;
+	}
 	case VINO_INPUT_COMPOSITE:
-	case VINO_INPUT_SVIDEO:
-		i2c_decoder_command(DECODER_SAA7191_GET_CONTROLS,
-				   &saa7191_ctrl);
+	case VINO_INPUT_SVIDEO: {
+		struct saa7191_control saa7191_ctrl;
+
+		err = i2c_decoder_command(DECODER_SAA7191_GET_CONTROLS,
+					  &saa7191_ctrl);
+		if (err) {
+			err = -EINVAL;
+			goto out;
+		}

 		switch(control->id) {
 		case V4L2_CID_HUE:
@@ -3514,11 +3900,13 @@
 			err = -EINVAL;
 		}
 		break;
+	}
 	default:
 		err =  -EINVAL;
 	}

-	spin_unlock(&vino_drvdata->input_lock);
+out:
+	spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);

 	return err;
 }
@@ -3526,15 +3914,21 @@
 static int vino_v4l2_s_ctrl(struct vino_channel_settings *vcs,
 			    struct v4l2_control *control)
 {
-	struct indycam_control indycam_ctrl;
-	struct saa7191_control saa7191_ctrl;
+	unsigned long flags;
 	int i;
 	int err = 0;

-	spin_lock(&vino_drvdata->input_lock);
+	spin_lock_irqsave(&vino_drvdata->input_lock, flags);
+
+	if (!vino_is_input_owner(vcs)) {
+		err = -EBUSY;
+		goto out;
+	}

 	switch (vcs->input) {
-	case VINO_INPUT_D1:
+	case VINO_INPUT_D1: {
+		struct indycam_control indycam_ctrl;
+
 		for (i = 0; i < VINO_INDYCAM_V4L2_CONTROL_COUNT; i++) {
 			if (vino_indycam_v4l2_controls[i].id ==
 			    control->id) {
@@ -3546,12 +3940,12 @@
 					goto ok1;
 				} else {
 					err = -ERANGE;
-					goto error;
+					goto out;
 				}
 			}
 		}
 		err = -EINVAL;
-		goto error;
+		goto out;

 ok1:
 		indycam_ctrl.agc = INDYCAM_VALUE_UNCHANGED;
@@ -3594,14 +3988,19 @@
 			break;
 		default:
 			err =  -EINVAL;
+			goto out;
 		}

-		if (!err)
-			i2c_camera_command(DECODER_INDYCAM_SET_CONTROLS,
-					   &indycam_ctrl);
+		err = i2c_camera_command(DECODER_INDYCAM_SET_CONTROLS,
+					 &indycam_ctrl);
+		if (err)
+			err = -EINVAL;
 		break;
+	}
 	case VINO_INPUT_COMPOSITE:
-	case VINO_INPUT_SVIDEO:
+	case VINO_INPUT_SVIDEO: {
+		struct saa7191_control saa7191_ctrl;
+
 		for (i = 0; i < VINO_SAA7191_V4L2_CONTROL_COUNT; i++) {
 			if (vino_saa7191_v4l2_controls[i].id ==
 			    control->id) {
@@ -3613,12 +4012,12 @@
 					goto ok2;
 				} else {
 					err = -ERANGE;
-					goto error;
+					goto out;
 				}
 			}
 		}
 		err = -EINVAL;
-		goto error;
+		goto out;

 ok2:
 		saa7191_ctrl.hue = SAA7191_VALUE_UNCHANGED;
@@ -3633,18 +4032,21 @@
 			break;
 		default:
 			err =  -EINVAL;
+			goto out;
 		}

-		if (!err)
-			i2c_decoder_command(DECODER_SAA7191_SET_CONTROLS,
-					    &saa7191_ctrl);
+		err = i2c_decoder_command(DECODER_SAA7191_SET_CONTROLS,
+					  &saa7191_ctrl);
+		if (err)
+			err = -EINVAL;
 		break;
+	}
 	default:
 		err =  -EINVAL;
 	}

-error:
-	spin_unlock(&vino_drvdata->input_lock);
+out:
+	spin_unlock_irqrestore(&vino_drvdata->input_lock, flags);

 	return err;
 }
@@ -3864,9 +4266,9 @@
 over:
 	dprintk("poll(): data %savailable\n",
 		(outgoing > 0) ? "" : "not ");
-	if (outgoing > 0) {
+
+	if (outgoing > 0)
 		ret = POLLIN | POLLRDNORM;
-	}

 error:

@@ -3879,6 +4281,7 @@
 	struct video_device *dev = video_devdata(file);
 	struct vino_channel_settings *vcs = video_get_drvdata(dev);

+#ifdef VINO_DEBUG
 	switch (_IOC_TYPE(cmd)) {
 	case 'v':
 		dprintk("ioctl(): V4L1 unsupported (0x%08x)\n", cmd);
@@ -3890,9 +4293,9 @@
 	default:
 		dprintk("ioctl(): unsupported command 0x%08x\n", cmd);
 	}
+#endif

 	switch (cmd) {
-	/* TODO: V4L1 interface (use compatibility layer?) */
 	/* V4L2 interface */
 	case VIDIOC_QUERYCAP: {
 		vino_v4l2_querycap(arg);
@@ -3910,6 +4313,9 @@
 	case VIDIOC_ENUMSTD: {
 		return vino_v4l2_enumstd(vcs, arg);
 	}
+	case VIDIOC_QUERYSTD: {
+		return vino_v4l2_querystd(vcs, arg);
+	}
 	case VIDIOC_G_STD: {
 		return vino_v4l2_g_std(vcs, arg);
 	}
@@ -4099,8 +4505,7 @@
 		return -ENODEV;
 	}

-	printk(KERN_INFO "VINO with chip ID %ld, revision %ld found\n",
-	       VINO_ID_VALUE(rev_id), VINO_REV_NUM(rev_id));
+	printk(KERN_INFO "VINO revision %ld found\n", VINO_REV_NUM(rev_id));

 	return 0;
 }

From tmnousia@twilight.cs.hut.fi Tue Aug 16 16:25:06 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 16 Aug 2005 16:25:24 +0100 (BST)
Received: from twilight.cs.hut.fi ([IPv6:::ffff:130.233.40.5]:59544 "EHLO
	twilight.cs.hut.fi") by linux-mips.org with ESMTP
	id <S8225989AbVHPPZG>; Tue, 16 Aug 2005 16:25:06 +0100
Received: by twilight.cs.hut.fi (Postfix, from userid 60001)
	id 152802CD6; Tue, 16 Aug 2005 18:29:42 +0300 (EEST)
Received: from kekkonen.cs.hut.fi (kekkonen.cs.hut.fi [130.233.41.50])
	by twilight.cs.hut.fi (Postfix) with ESMTP id C17032CD6
	for <linux-mips@linux-mips.org>; Tue, 16 Aug 2005 18:29:41 +0300 (EEST)
Received: (from tmnousia@localhost)
	by kekkonen.cs.hut.fi (8.11.7p1+Sun/8.10.2) id j7GFTfx22595;
	Tue, 16 Aug 2005 18:29:41 +0300 (EEST)
Date:	Tue, 16 Aug 2005 18:29:41 +0300 (EEST)
From:	turja@mbnet.fi
X-X-Sender: tmnousia@kekkonen.cs.hut.fi
Reply-To: turja@mbnet.fi
To:	linux-mips@linux-mips.org
Subject: SGI Indy VINO video driver 0.0.4
Message-ID: <Pine.GSO.4.58.0508161827130.17458@kekkonen.cs.hut.fi>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Return-Path: <tmnousia@twilight.cs.hut.fi>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8755
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: turja@mbnet.fi
Precedence: bulk
X-list: linux-mips

A new version of the driver has been released.

Please upgrade older versions as some very serious bugs have
been fixed now.

http://www.mbnet.fi/~turja/vino/


Mikael Nousiainen


From adi@broadcom.com Wed Aug 17 04:01:36 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 17 Aug 2005 04:01:56 +0100 (BST)
Received: from mms3.broadcom.com ([IPv6:::ffff:216.31.210.19]:36113 "EHLO
	MMS3.broadcom.com") by linux-mips.org with ESMTP
	id <S8226016AbVHQDBg>; Wed, 17 Aug 2005 04:01:36 +0100
Received: from 10.10.64.121 by MMS3.broadcom.com with SMTP (Broadcom
 SMTP Relay (Email Firewall v6.1.0)); Tue, 16 Aug 2005 20:05:35 -0700
X-Server-Uuid: 35E76369-CF33-4172-911A-D1698BD5E887
Received: from mail-irva-8.broadcom.com ([10.10.64.221]) by
 mail-irva-1.broadcom.com (Post.Office MTA v3.5.3 release 223 ID#
 0-72233U7200L2200S0V35) with ESMTP id com for
 <linux-mips@linux-mips.org>; Tue, 16 Aug 2005 20:06:10 -0700
Received: from mon-irva-10.broadcom.com (mon-irva-10.broadcom.com
 [10.10.64.171]) by mail-irva-8.broadcom.com (MOS 3.5.6-GR) with ESMTP
 id BPG11840; Tue, 16 Aug 2005 20:06:10 -0700 (PDT)
Received: from mail-sj1-5.sj.broadcom.com (mail-sj1-5.sj.broadcom.com
 [10.16.128.236]) by mon-irva-10.broadcom.com (8.9.1/8.9.1) with ESMTP
 id UAA24004 for <linux-mips@linux-mips.org>; Tue, 16 Aug 2005 20:06:10
 -0700 (PDT)
Received: from localhost.localdomain (ldt-sj3-054 [10.21.3.41]) by
 mail-sj1-5.sj.broadcom.com (8.12.9/8.12.9/SSF) with ESMTP id
 j7H368ov005277 for <linux-mips@linux-mips.org>; Tue, 16 Aug 2005
 20:06:09 -0700 (PDT)
Received: (from adi@localhost) by localhost.localdomain (8.11.6/8.9.3)
 id j7H368p16025 for linux-mips@linux-mips.org; Tue, 16 Aug 2005
 20:06:08 -0700
Date:	Tue, 16 Aug 2005 20:06:08 -0700
From:	"Andrew Isaacson" <adi@broadcom.com>
To:	linux-mips@linux-mips.org
Subject: [PATCH] casts in TLB macros
Message-ID: <20050817030608.GM24444@broadcom.com>
MIME-Version: 1.0
User-Agent: Mutt/1.4.2.1i
X-WSS-ID: 6F1C76F50B04317880-01-01
Content-Type: text/plain;
 charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Return-Path: <adi@broadcom.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8756
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: adi@broadcom.com
Precedence: bulk
X-list: linux-mips

Fix three cases where macro arguments are not parenthesized, leading to
incorrect operator precedence when called with an expression as the
argument.  This causes incorrect evaluation of
    write_c0_entrylo0(pte_val(*ptep++) >> 6)
when pte_t is 64 bits - the pte value is cast to (unsigned int) first,
then the shift is done, losing the top 32 bits.

Also, this does not add an extra set of parentheses surrounding the
(cast)(value) pair, as there's no danger of precedence problems to avoid
given the high precedence of the cast operator and that this is the
terminal macro in this macro trail.

Signed-off-by: Andrew Isaacson <adi@broadcom.com>

 include/asm-mips/pgtable-32.h |    2 +-

Index: linux-2.6.13-rc5/include/asm-mips/mipsregs.h
===================================================================
--- linux-2.6.13-rc5.orig/include/asm-mips/mipsregs.h	2005-07-14 10:47:59.000000000 -0700
+++ linux-2.6.13-rc5/include/asm-mips/mipsregs.h	2005-08-16 19:44:47.000000000 -0700
@@ -693,13 +693,13 @@
 	if (sel == 0)							\
 		__asm__ __volatile__(					\
 			"mtc0\t%z0, " #register "\n\t"			\
-			: : "Jr" ((unsigned int)value));		\
+			: : "Jr" (unsigned int)(value));		\
 	else								\
 		__asm__ __volatile__(					\
 			".set\tmips32\n\t"				\
 			"mtc0\t%z0, " #register ", " #sel "\n\t"	\
 			".set\tmips0"					\
-			: : "Jr" ((unsigned int)value));		\
+			: : "Jr" (unsigned int)(value));		\
 } while (0)
 
 #define __write_64bit_c0_register(register, sel, value)			\
@@ -748,7 +748,7 @@
 do {									\
 	__asm__ __volatile__(						\
 		"ctc0\t%z0, " #register "\n\t"				\
-		: : "Jr" ((unsigned int)value));			\
+		: : "Jr" (unsigned int)(value));			\
 } while (0)
 
 /*


From adi@broadcom.com Wed Aug 17 07:08:06 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 17 Aug 2005 07:08:34 +0100 (BST)
Received: from mms1.broadcom.com ([IPv6:::ffff:216.31.210.17]:51727 "EHLO
	MMS1.broadcom.com") by linux-mips.org with ESMTP
	id <S8224790AbVHQGIG>; Wed, 17 Aug 2005 07:08:06 +0100
Received: from 10.10.64.121 by MMS1.broadcom.com with SMTP (Broadcom
 SMTP Relay (Email Firewall v6.1.0)); Tue, 16 Aug 2005 23:12:28 -0700
X-Server-Uuid: 146C3151-C1DE-4F71-9D02-C3BE503878DD
Received: from mail-irva-8.broadcom.com ([10.10.64.221]) by
 mail-irva-1.broadcom.com (Post.Office MTA v3.5.3 release 223 ID#
 0-72233U7200L2200S0V35) with ESMTP id com for
 <linux-mips@linux-mips.org>; Tue, 16 Aug 2005 23:12:33 -0700
Received: from mon-irva-10.broadcom.com (mon-irva-10.broadcom.com
 [10.10.64.171]) by mail-irva-8.broadcom.com (MOS 3.5.6-GR) with ESMTP
 id BPG37336; Tue, 16 Aug 2005 23:12:33 -0700 (PDT)
Received: from mail-sj1-5.sj.broadcom.com (mail-sj1-5.sj.broadcom.com
 [10.16.128.236]) by mon-irva-10.broadcom.com (8.9.1/8.9.1) with ESMTP
 id XAA15801 for <linux-mips@linux-mips.org>; Tue, 16 Aug 2005 23:12:33
 -0700 (PDT)
Received: from localhost.localdomain (ldt-sj3-054 [10.21.3.41]) by
 mail-sj1-5.sj.broadcom.com (8.12.9/8.12.9/SSF) with ESMTP id
 j7H6CWov007705 for <linux-mips@linux-mips.org>; Tue, 16 Aug 2005
 23:12:32 -0700 (PDT)
Received: (from adi@localhost) by localhost.localdomain (8.11.6/8.9.3)
 id j7H6CW716499 for linux-mips@linux-mips.org; Tue, 16 Aug 2005
 23:12:32 -0700
Date:	Tue, 16 Aug 2005 23:12:32 -0700
From:	"Andrew Isaacson" <adi@broadcom.com>
To:	linux-mips@linux-mips.org
Subject: [PATCH] fix pfn_pte for 64BIT_PHYS_ADDR
Message-ID: <20050817061232.GN24444@broadcom.com>
MIME-Version: 1.0
User-Agent: Mutt/1.4.2.1i
X-WSS-ID: 6F1C0AC626C3649460-01-01
Content-Type: text/plain;
 charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Return-Path: <adi@broadcom.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8757
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: adi@broadcom.com
Precedence: bulk
X-list: linux-mips

On CONFIG_64BIT_PHYS_ADDR, pfn always fits in 'unsigned long', but
pfn<<PAGE_SHIFT sometimes extends beyond.  The pte is big enough to hold
'long long', but the shift in pfn_pte() needs to do its calculation with
enough bits to hold the result.

Signed-off-by: Andrew Isaacson <adi@broadcom.com>

Index: lmo-1480/include/asm-mips/pgtable-32.h
===================================================================
--- lmo-1480.orig/include/asm-mips/pgtable-32.h	2005-08-16 23:00:19.000000000 -0700
+++ lmo-1480/include/asm-mips/pgtable-32.h	2005-08-16 23:01:39.000000000 -0700
@@ -137,7 +137,7 @@
 #define pfn_pte(pfn, prot)	__pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot))
 #else
 #define pte_pfn(x)		((unsigned long)((x).pte >> PAGE_SHIFT))
-#define pfn_pte(pfn, prot)	__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
+#define pfn_pte(pfn, prot)	__pte(((unsigned long long)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
 #endif
 #endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) */
 


From macro@linux-mips.org Wed Aug 17 10:57:34 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 17 Aug 2005 10:57:53 +0100 (BST)
Received: from pollux.ds.pg.gda.pl ([IPv6:::ffff:153.19.208.7]:16650 "EHLO
	pollux.ds.pg.gda.pl") by linux-mips.org with ESMTP
	id <S8224982AbVHQJ5e>; Wed, 17 Aug 2005 10:57:34 +0100
Received: from localhost (localhost [127.0.0.1])
	by pollux.ds.pg.gda.pl (Postfix) with ESMTP
	id 61E2BE1C69; Wed, 17 Aug 2005 12:02:17 +0200 (CEST)
Received: from pollux.ds.pg.gda.pl ([127.0.0.1])
 by localhost (pollux [127.0.0.1]) (amavisd-new, port 10024) with ESMTP
 id 16612-10; Wed, 17 Aug 2005 12:02:17 +0200 (CEST)
Received: from piorun.ds.pg.gda.pl (piorun.ds.pg.gda.pl [153.19.208.8])
	by pollux.ds.pg.gda.pl (Postfix) with ESMTP
	id EA191E1C63; Wed, 17 Aug 2005 12:02:16 +0200 (CEST)
Received: from blysk.ds.pg.gda.pl (macro@blysk.ds.pg.gda.pl [153.19.208.6])
	by piorun.ds.pg.gda.pl (8.13.3/8.13.1) with ESMTP id j7HA2IeU022419;
	Wed, 17 Aug 2005 12:02:19 +0200
Date:	Wed, 17 Aug 2005 11:02:23 +0100 (BST)
From:	"Maciej W. Rozycki" <macro@linux-mips.org>
To:	Andrew Isaacson <adi@broadcom.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] casts in TLB macros
In-Reply-To: <20050817030608.GM24444@broadcom.com>
Message-ID: <Pine.LNX.4.61L.0508171053150.10940@blysk.ds.pg.gda.pl>
References: <20050817030608.GM24444@broadcom.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Virus-Scanned: ClamAV 0.85.1/1027/Wed Aug 17 01:44:00 2005 on piorun.ds.pg.gda.pl
X-Virus-Status:	Clean
X-Virus-Scanned: by amavisd-new at pollux.ds.pg.gda.pl
Return-Path: <macro@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8758
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: macro@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Tue, 16 Aug 2005, Andrew Isaacson wrote:

> @@ -748,7 +748,7 @@
>  do {									\
>  	__asm__ __volatile__(						\
>  		"ctc0\t%z0, " #register "\n\t"				\
> -		: : "Jr" ((unsigned int)value));			\
> +		: : "Jr" (unsigned int)(value));			\
>  } while (0)
>  
>  /*

 I'm surprised it works, but please don't drop the outer brackets in asm 
operands anyway.  Otherwise it's an obvious fix, thanks.

  Maciej

From ralf@linux-mips.org Wed Aug 17 11:03:52 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 17 Aug 2005 11:04:07 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:11034 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225005AbVHQKDw>; Wed, 17 Aug 2005 11:03:52 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7HA8V15004584;
	Wed, 17 Aug 2005 11:08:31 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7HA8Uma004583;
	Wed, 17 Aug 2005 11:08:30 +0100
Date:	Wed, 17 Aug 2005 11:08:30 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Andrew Isaacson <adi@broadcom.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] casts in TLB macros
Message-ID: <20050817100830.GA2667@linux-mips.org>
References: <20050817030608.GM24444@broadcom.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050817030608.GM24444@broadcom.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8759
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Tue, Aug 16, 2005 at 08:06:08PM -0700, Andrew Isaacson wrote:

> Fix three cases where macro arguments are not parenthesized, leading to
> incorrect operator precedence when called with an expression as the
> argument.  This causes incorrect evaluation of
>     write_c0_entrylo0(pte_val(*ptep++) >> 6)
> when pte_t is 64 bits - the pte value is cast to (unsigned int) first,
> then the shift is done, losing the top 32 bits.
> 
> Also, this does not add an extra set of parentheses surrounding the
> (cast)(value) pair, as there's no danger of precedence problems to avoid
> given the high precedence of the cast operator and that this is the
> terminal macro in this macro trail.

Thanks, applied,

  Ralf

From ralf@linux-mips.org Wed Aug 17 11:12:20 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 17 Aug 2005 11:12:38 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:4614 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8224982AbVHQKMU>; Wed, 17 Aug 2005 11:12:20 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7HAGrLR004894;
	Wed, 17 Aug 2005 11:16:53 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7HAGrgV004893;
	Wed, 17 Aug 2005 11:16:53 +0100
Date:	Wed, 17 Aug 2005 11:16:53 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Andrew Isaacson <adi@broadcom.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] fix pfn_pte for 64BIT_PHYS_ADDR
Message-ID: <20050817101653.GB2667@linux-mips.org>
References: <20050817061232.GN24444@broadcom.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050817061232.GN24444@broadcom.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8760
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Tue, Aug 16, 2005 at 11:12:32PM -0700, Andrew Isaacson wrote:

> On CONFIG_64BIT_PHYS_ADDR, pfn always fits in 'unsigned long', but
> pfn<<PAGE_SHIFT sometimes extends beyond.  The pte is big enough to hold
> 'long long', but the shift in pfn_pte() needs to do its calculation with
> enough bits to hold the result.

Thanks, applied also.

  Ralf

From adi@broadcom.com Wed Aug 17 17:26:31 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 17 Aug 2005 17:26:55 +0100 (BST)
Received: from mms2.broadcom.com ([IPv6:::ffff:216.31.210.18]:4110 "EHLO
	MMS2.broadcom.com") by linux-mips.org with ESMTP
	id <S8224771AbVHQQ0b>; Wed, 17 Aug 2005 17:26:31 +0100
Received: from 10.10.64.121 by MMS2.broadcom.com with SMTP (Broadcom
 SMTP Relay (Email Firewall v6.1.0)); Wed, 17 Aug 2005 09:30:52 -0700
X-Server-Uuid: 1F20ACF3-9CAF-44F7-AB47-F294E2D5B4EA
Received: from mail-irva-8.broadcom.com ([10.10.64.221]) by
 mail-irva-1.broadcom.com (Post.Office MTA v3.5.3 release 223 ID#
 0-72233U7200L2200S0V35) with ESMTP id com; Wed, 17 Aug 2005 09:30:50
 -0700
Received: from mon-irva-10.broadcom.com (mon-irva-10.broadcom.com
 [10.10.64.171]) by mail-irva-8.broadcom.com (MOS 3.5.6-GR) with ESMTP
 id BPI09130; Wed, 17 Aug 2005 09:30:04 -0700 (PDT)
Received: from mail-sj1-5.sj.broadcom.com (mail-sj1-5.sj.broadcom.com
 [10.16.128.236]) by mon-irva-10.broadcom.com (8.9.1/8.9.1) with ESMTP
 id JAA16963; Wed, 17 Aug 2005 09:30:03 -0700 (PDT)
Received: from localhost.localdomain (ldt-sj3-054 [10.21.3.41]) by
 mail-sj1-5.sj.broadcom.com (8.12.9/8.12.9/SSF) with ESMTP id
 j7HGU2ov021905; Wed, 17 Aug 2005 09:30:03 -0700 (PDT)
Received: (from adi@localhost) by localhost.localdomain (8.11.6/8.9.3)
 id j7HGU2w17245; Wed, 17 Aug 2005 09:30:02 -0700
Date:	Wed, 17 Aug 2005 09:30:02 -0700
From:	"Andrew Isaacson" <adi@broadcom.com>
To:	"Ralf Baechle" <ralf@linux-mips.org>
cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] casts in TLB macros
Message-ID: <20050817163002.GO24444@broadcom.com>
References: <20050817030608.GM24444@broadcom.com>
 <20050817100830.GA2667@linux-mips.org>
MIME-Version: 1.0
In-Reply-To: <20050817100830.GA2667@linux-mips.org>
User-Agent: Mutt/1.4.2.1i
X-WSS-ID: 6F1DB9B629O4554240-01-01
Content-Type: text/plain;
 charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Return-Path: <adi@broadcom.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8761
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: adi@broadcom.com
Precedence: bulk
X-list: linux-mips

On Wed, Aug 17, 2005 at 11:08:30AM +0100, Ralf Baechle wrote:
> On Tue, Aug 16, 2005 at 08:06:08PM -0700, Andrew Isaacson wrote:
> 
> > Fix three cases where macro arguments are not parenthesized, leading to
> > incorrect operator precedence when called with an expression as the
> > argument.  This causes incorrect evaluation of
> >     write_c0_entrylo0(pte_val(*ptep++) >> 6)
> > when pte_t is 64 bits - the pte value is cast to (unsigned int) first,
> > then the shift is done, losing the top 32 bits.
> > 
> > Also, this does not add an extra set of parentheses surrounding the
> > (cast)(value) pair, as there's no danger of precedence problems to avoid
> > given the high precedence of the cast operator and that this is the
> > terminal macro in this macro trail.
> 
> Thanks, applied,

Thank *you* for being smarter than me about the parenthesis...

(The patch I sent out was lacking the outer parens, and I used the
following plan for world domination:
1. notice problem, cut patch
2. go to dinner
3. test compile something unrelated by accident
4. send patch to mailing list
5. profit!)

-andy


From ralf@linux-mips.org Wed Aug 17 17:39:50 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 17 Aug 2005 17:40:12 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:5649 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8224771AbVHQQju>; Wed, 17 Aug 2005 17:39:50 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7HGiTlI018352;
	Wed, 17 Aug 2005 17:44:29 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7HGiSNM018351;
	Wed, 17 Aug 2005 17:44:28 +0100
Date:	Wed, 17 Aug 2005 17:44:28 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Andrew Isaacson <adi@broadcom.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] casts in TLB macros
Message-ID: <20050817164428.GD2667@linux-mips.org>
References: <20050817030608.GM24444@broadcom.com> <20050817100830.GA2667@linux-mips.org> <20050817163002.GO24444@broadcom.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050817163002.GO24444@broadcom.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8762
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Wed, Aug 17, 2005 at 09:30:02AM -0700, Andrew Isaacson wrote:

> (The patch I sent out was lacking the outer parens, and I used the
> following plan for world domination:
> 1. notice problem, cut patch
> 2. go to dinner
> 3. test compile something unrelated by accident
> 4. send patch to mailing list
> 5. profit!)

5) reminds me of Clausen Profit System Online, see
http://members.optusnet.com.au/clausen/profit/

  Ralf

From Joshua.Wise@sicortex.com Wed Aug 17 18:16:59 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 17 Aug 2005 18:17:46 +0100 (BST)
Received: from static-151-204-232-50.bos.east.verizon.net ([IPv6:::ffff:151.204.232.50]:63382
	"EHLO mail2.sicortex.com") by linux-mips.org with ESMTP
	id <S8226023AbVHQRQ6>; Wed, 17 Aug 2005 18:16:58 +0100
Received: from gs104.sicortex.com (gs104.sicortex.com [10.0.1.104])
	by mail2.sicortex.com (Postfix) with ESMTP id 2D6AB1BF33F;
	Wed, 17 Aug 2005 13:21:22 -0400 (EDT)
From:	Joshua Wise <Joshua.Wise@sicortex.com>
Organization: SiCortex
To:	Stephen Hemminger <shemminger@osdl.org>
Subject: Re: NAPI poll routine happens in interrupt context?
Date:	Wed, 17 Aug 2005 13:21:18 -0400
User-Agent: KMail/1.8.1
Cc:	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mips@linux-mips.org, Aaron Brooks <aaron.brooks@sicortex.com>
References: <200508170932.10441.Joshua.Wise@sicortex.com> <20050817094317.3437607e@dxpl.pdx.osdl.net>
In-Reply-To: <20050817094317.3437607e@dxpl.pdx.osdl.net>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200508171321.20094.Joshua.Wise@sicortex.com>
Return-Path: <Joshua.Wise@sicortex.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8763
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: Joshua.Wise@sicortex.com
Precedence: bulk
X-list: linux-mips

On Wednesday 17 August 2005 12:43, Stephen Hemminger wrote:
> You will get more response to network issues on netdev@vger.kernel.org
Okay. Thanks.

> NAPI poll is usually called from softirq context.  This means that
> hardware interrupts are enabled, but it is not in a thread context that
> can sleep.
Okay. I wasn't aware of quite how it was "supposed" to be.

> You shouldn't be calling things that could sleep! If you are it
> is a bug.
I guess I'd better track down this bug, then :)

> Harald Welte is working on a generic virtual Ethernet device, perhaps
> you could collaborate with him.
I assume he is on this mailing list?

> The bug is that ipv6 is doing an operation to handle MIB statistics and
> the MIPS architecture math routines seem to need to sleep.
> Previous versions of SNMP code may have done atomic operations, but
> current 2.6 code uses per-cpu variables.
> Also, there is no might sleep in the current 2.6 MIPS code either
> so the problem is probably fixed if you use current 2.6.12 or later
> kernel.
Hm -- I am using 2.6.13-rc2.
Here is a new trace, showing the same issue with IPv4:

Debug: sleeping function called from invalid context at 
arch/mips/math-emu/dsemul.c:137 
in_atomic():1, irqs_disabled():0
Call Trace:
 [<ffffffff801406e0>] __might_sleep+0x180/0x198 (kernel/sched.c:5223)
 [<ffffffff80101930>] mipsIRQ+0x130/0x1e0 (arch/mips/sc1000/mipsIRQ.S:95)
 [<ffffffff802860fc>] ip_rcv+0x9c/0x7b0 (net/ipv4/ip_input.c:381)
 [<ffffffff80140428>] do_dsemulret+0x68/0x1a0 
(arch/mips/math-emu/dsemul.c:137)
 [<ffffffff8010b3a4>] do_ade+0x24/0x550 (arch/mips/kernel/unaligned.c:506)
 [<ffffffff80102964>] handle_adel_int+0x3c/0x58 (arch/mips/kernel/genex.S:281)
 [<ffffffff80268260>] netif_receive_skb+0x1b0/0x2e0 (net/core/dev.c:1646)
 [<ffffffff80286100>] ip_rcv+0xa0/0x7b0 (net/ipv4/ip_input.c:394)
 [<ffffffff8014da5c>] printk+0x2c/0x38 (kernel/printk.c:515)
 [<ffffffff80268260>] netif_receive_skb+0x1b0/0x2e0 (net/core/dev.c:1646)
 [<ffffffff802573c8>] lanlan_poll+0x3e0/0x440 (drivers/net/lanlan.c:246)
etc, etc.

CC:'ing to linux-mips for obvious reasons. This seems to stem from an 
unaligned access. If this is no longer appropriate for linux-kernel, feel 
free to stop CCing to there, and I will follow.

Thanks,
joshua

From ralf@linux-mips.org Wed Aug 17 19:13:54 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 17 Aug 2005 19:14:10 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:16915 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8226040AbVHQSNy>; Wed, 17 Aug 2005 19:13:54 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7HIIcMg024010;
	Wed, 17 Aug 2005 19:18:38 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7HIIZMn023998;
	Wed, 17 Aug 2005 19:18:35 +0100
Date:	Wed, 17 Aug 2005 19:18:35 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Joshua Wise <Joshua.Wise@sicortex.com>
Cc:	Stephen Hemminger <shemminger@osdl.org>, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mips@linux-mips.org,
	Aaron Brooks <aaron.brooks@sicortex.com>
Subject: Re: NAPI poll routine happens in interrupt context?
Message-ID: <20050817181835.GE2667@linux-mips.org>
References: <200508170932.10441.Joshua.Wise@sicortex.com> <20050817094317.3437607e@dxpl.pdx.osdl.net> <200508171321.20094.Joshua.Wise@sicortex.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200508171321.20094.Joshua.Wise@sicortex.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8764
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Wed, Aug 17, 2005 at 01:21:18PM -0400, Joshua Wise wrote:

> > The bug is that ipv6 is doing an operation to handle MIB statistics and
> > the MIPS architecture math routines seem to need to sleep.

Except nothing in the network stack is using fp - the use of FP inside the
MIPS kernel is not supported in any way.  What happend is probably the
fetching of the opcode of the instruction in the branch delay slot of
the unaligned instruction emulator blew up because it uses a get_user which
again calls might_sleep and that won't exactly work if not called from
process context.

  Ralf

From Joshua.Wise@sicortex.com Wed Aug 17 20:38:27 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 17 Aug 2005 20:38:43 +0100 (BST)
Received: from static-151-204-232-50.bos.east.verizon.net ([IPv6:::ffff:151.204.232.50]:35754
	"EHLO mail2.sicortex.com") by linux-mips.org with ESMTP
	id <S8226059AbVHQTi1>; Wed, 17 Aug 2005 20:38:27 +0100
Received: from gs104.sicortex.com (gs104.sicortex.com [10.0.1.104])
	by mail2.sicortex.com (Postfix) with ESMTP id E8A6B1BF33F;
	Wed, 17 Aug 2005 15:43:09 -0400 (EDT)
From:	Joshua Wise <Joshua.Wise@sicortex.com>
Organization: SiCortex
To:	linux-mips@linux-mips.org
Subject: synchronize_rcu() hangs in simulated mips environment
Date:	Wed, 17 Aug 2005 15:43:09 -0400
User-Agent: KMail/1.8.1
Cc:	Aaron Brooks <aaron.brooks@sicortex.com>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200508171543.09295.Joshua.Wise@sicortex.com>
Return-Path: <Joshua.Wise@sicortex.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8765
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: Joshua.Wise@sicortex.com
Precedence: bulk
X-list: linux-mips

Hi all,

I'm again bringing up the network on my simulator, and I've found that if I 
run with more than one CPU in my simulation (if I have CONFIG_SMP enabled), 
synchronize_rcu() just hangs, as I never get a cpu_quiet() call.

I've attached boot log chunks from various parts of boot time to the bottom of 
this mail. I'm curious as to whether the fault is in my emulator, or in the 
kernel, or in my additions to the kernel... On IRC, Ralf initially suggested 
that it could be an emulator fault, but I'm not sure where such a fault would 
be.

Thanks,
joshua

Here is how a good boot looks:
lan-lan.c 0.01: Joshua Wise <Joshua.Wise@SiCortex.com>
emu0: lan-lan found at 0xef0000000.
emu0: loaded successfully
NET: Registered protocol family 2
Sock_register done
Base protocols done
Socketside stuff done
inet_register_protosw(80343aa0)
spinlock: inetsw lock
got it
list done
spin unlock
synchronize net
net synch:
Synchronizing RCU...
Calling...
Waiting...
CPU quiet: 0
Awake
Done!
net synch done
ok
inet_register_protosw(80343ad0)
spinlock: inetsw lock
got it
list done

However, a failing boot looks like this:
Starting CPU #1...
CPU revision is: 00018101
FPU revision is: 00038110
Primary instruction cache 32kB, physically tagged, 2-way, linesize 32 bytes.
Primary data cache 32kB, 2-way, linesize 32 bytes.
Synthesized TLB refill handler (36 instructions).
CPU frequency 8.00 MHz
CPU #1 init complete.
Brought up 2 CPUs
checking if image is initramfs...it isn't (bad gzip magic numbers); looks like 
an initrd
Freeing initrd memory: 4096k freed
NET: Registered protocol family 16
CPU quiet: 0
rtc: IRQ 8 is not free.
i8042.c: i8042 controller self test timeout.
Trying to free nonexistent resource <00000060-0000006f>
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
ttyS0 at MMIO 0x0 (irq = 2) is a 16450
ttyS1 at I/O 0x2f8 (irq = 3) is a 16450
ttyS2 at I/O 0x3e8 (irq = 4) is a 16450
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 18432K size 1024 blocksize
loop: loaded (max 8 devices)
lan-lan.c 0.01: Joshua Wise <Joshua.Wise@SiCortex.com>
emu0: lan-lan found at 0xef0000000.
emu0: loaded successfully
NET: Registered protocol family 2
Sock_register done
Base protocols done
Socketside stuff done
inet_register_protosw(80343aa0)
spinlock: inetsw lock
got it
list done
spin unlock
synchronize net
net synch:
Synchronizing RCU...
Calling...
Waiting...
<hang>

From spodstavin@ru.mvista.com Thu Aug 18 09:49:55 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 18 Aug 2005 09:50:18 +0100 (BST)
Received: from RT-soft-1.Moscow.itn.ru ([IPv6:::ffff:80.240.96.90]:36967 "EHLO
	buildserver.ru.mvista.com") by linux-mips.org with ESMTP
	id <S8225207AbVHRItz>; Thu, 18 Aug 2005 09:49:55 +0100
Received: from 192.168.1.133 ([10.150.0.9])
	by buildserver.ru.mvista.com (8.11.6/8.11.6) with ESMTP id j7I8sit19225;
	Thu, 18 Aug 2005 13:54:45 +0500
Subject: a patch for generic MIPS RTC
From:	Sergey Podstavin <spodstavin@ru.mvista.com>
Reply-To: spodstavin@ru.mvista.com
To:	linux-mips <linux-mips@linux-mips.org>
Cc:	Ralf Baechle <ralf@linux-mips.org>
Content-Type: multipart/mixed; boundary="=-jWNDXCryGAwurHmkZsnW"
Organization: MontaVista
Date:	Thu, 18 Aug 2005 12:54:50 +0400
Message-Id: <1124355290.5441.45.camel@localhost.localdomain>
Mime-Version: 1.0
X-Mailer: Evolution 2.0.2 (2.0.2-3) 
Return-Path: <spodstavin@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8766
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: spodstavin@ru.mvista.com
Precedence: bulk
X-list: linux-mips


--=-jWNDXCryGAwurHmkZsnW
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi!

genrtc doesn't work as a module because functions for module defined in
wrong place. Most architectures define these functions in <asm/rtc.h>,
so make MIPS follow their example.
It makes the generic MIPS RTC working as a module for MIPS.

Best wishes,
Sergey Podstavin

--=-jWNDXCryGAwurHmkZsnW
Content-Disposition: attachment; filename=fix_genrtc_as_a_module.patch
Content-Type: text/x-patch; name=fix_genrtc_as_a_module.patch; charset=UTF-8
Content-Transfer-Encoding: 7bit

Source: MontaVista Software, Inc. Sergey Podstavin <spodstavin@ru.mvista.com>
Type: Defect Fix
Disposition: submit to linux-mips@linux-mips.org
Description:
    genrtc doesn't work as a module because functions for module defined in wrong place.	
Most architectures define these functions in <asm/rtc.h>, so make MIPS follow their example.

Signed-off-by: Tom Rini <trini@kernel.crashing.org>
Signed-off-by: Sergey Podstavin <spodstavin@ru.mvista.com>

Index: linux/arch/mips/kernel/genrtc.c
===================================================================
--- linux.orig/arch/mips/kernel/genrtc.c
+++ linux/arch/mips/kernel/genrtc.c
@@ -1,64 +1 @@
-/*
- * A glue layer that provides RTC read/write to drivers/char/genrtc.c driver
- * based on MIPS internal RTC routines.  It does take care locking
- * issues so that we are SMP/Preemption safe.
- *
- * Copyright (C) 2004 MontaVista Software Inc.
- * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
- *
- * Please read the COPYING file for all license details.
- */
-
-#include <linux/spinlock.h>
-
-#include <asm/rtc.h>
-#include <asm/time.h>
-
-static DEFINE_SPINLOCK(mips_rtc_lock);
-
-unsigned int get_rtc_time(struct rtc_time *time)
-{
-	unsigned long nowtime;
-
-	spin_lock(&mips_rtc_lock);
-	nowtime = rtc_get_time();
-	to_tm(nowtime, time);
-	time->tm_year -= 1900;
-	spin_unlock(&mips_rtc_lock);
-
-	return RTC_24H;
-}
-
-int set_rtc_time(struct rtc_time *time)
-{
-	unsigned long nowtime;
-	int ret;
-
-	spin_lock(&mips_rtc_lock);
-	nowtime = mktime(time->tm_year+1900, time->tm_mon+1,
-			time->tm_mday, time->tm_hour, time->tm_min,
-			time->tm_sec);
-	ret = rtc_set_time(nowtime);
-	spin_unlock(&mips_rtc_lock);
-
-	return ret;
-}
-
-unsigned int get_rtc_ss(void)
-{
-	struct rtc_time h;
-
-	get_rtc_time(&h);
-	return h.tm_sec;
-}
-
-int get_rtc_pll(struct rtc_pll_info *pll)
-{
-	return -EINVAL;
-}
-
-int set_rtc_pll(struct rtc_pll_info *pll)
-{
-	return -EINVAL;
-}
 
Index: linux/arch/mips/kernel/Makefile
===================================================================
--- linux.orig/arch/mips/kernel/Makefile
+++ linux/arch/mips/kernel/Makefile
@@ -57,8 +57,6 @@
 
 obj-$(CONFIG_64BIT)		+= cpu-bugs64.o
 
-obj-$(CONFIG_GEN_RTC)		+= genrtc.o
-
 CFLAGS_cpu-bugs64.o	= $(shell if $(CC) $(CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
 CFLAGS_ioctl32.o	+= -Ifs/
 
Index: linux/include/asm-mips/rtc.h
===================================================================
--- linux.orig/include/asm-mips/rtc.h
+++ linux/include/asm-mips/rtc.h
@@ -14,7 +14,9 @@
 
 #ifdef __KERNEL__
 
+#include <linux/spinlock.h>
 #include <linux/rtc.h>
+#include <asm/time.h>
 
 #define RTC_PIE 0x40            /* periodic interrupt enable */
 #define RTC_AIE 0x20            /* alarm interrupt enable */
@@ -33,5 +35,52 @@
 int get_rtc_pll(struct rtc_pll_info *pll);
 int set_rtc_pll(struct rtc_pll_info *pll);
 
+static DEFINE_SPINLOCK(mips_rtc_lock);
+
+static inline unsigned int get_rtc_time(struct rtc_time *time)
+{
+	unsigned long nowtime;
+
+	spin_lock(&mips_rtc_lock);
+	nowtime = rtc_get_time();
+	to_tm(nowtime, time);
+	time->tm_year -= 1900;
+	spin_unlock(&mips_rtc_lock);
+
+	return RTC_24H;
+}
+
+static inline int set_rtc_time(struct rtc_time *time)
+{
+	unsigned long nowtime;
+	int ret;
+
+	spin_lock(&mips_rtc_lock);
+	nowtime = mktime(time->tm_year+1900, time->tm_mon+1,
+			time->tm_mday, time->tm_hour, time->tm_min,
+			time->tm_sec);
+	ret = rtc_set_time(nowtime);
+	spin_unlock(&mips_rtc_lock);
+
+	return ret;
+}
+
+static inline unsigned int get_rtc_ss(void)
+{
+	struct rtc_time h;
+
+	get_rtc_time(&h);
+	return h.tm_sec;
+}
+
+static inline int get_rtc_pll(struct rtc_pll_info *pll)
+{
+	return -EINVAL;
+}
+
+static inline int set_rtc_pll(struct rtc_pll_info *pll)
+{
+	return -EINVAL;
+}
 #endif
 #endif

--=-jWNDXCryGAwurHmkZsnW--


From mohanlaljangir@hotmail.com Thu Aug 18 12:11:13 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 18 Aug 2005 12:11:32 +0100 (BST)
Received: from bay18-dav11.bay18.hotmail.com ([IPv6:::ffff:65.54.187.191]:54849
	"EHLO hotmail.com") by linux-mips.org with ESMTP
	id <S8225213AbVHRLLN>; Thu, 18 Aug 2005 12:11:13 +0100
Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;
	 Thu, 18 Aug 2005 04:16:00 -0700
Message-ID: <BAY18-DAV1144F0C7D384449D254D6BD2B20@phx.gbl>
Received: from 210.118.108.254 by BAY18-DAV11.phx.gbl with DAV;
	Thu, 18 Aug 2005 11:15:59 +0000
X-Originating-IP: [210.118.108.254]
X-Originating-Email: [mohanlaljangir@hotmail.com]
X-Sender: mohanlaljangir@hotmail.com
From:	"mohanlal jangir" <mohanlaljangir@hotmail.com>
To:	<linux-mips@linux-mips.org>
Subject: NPTL info needed
Date:	Thu, 18 Aug 2005 16:41:25 +0530
MIME-Version: 1.0
Content-Type: text/plain;
	format=flowed;
	charset="iso-8859-1";
	reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2180
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-OriginalArrivalTime: 18 Aug 2005 11:16:00.0094 (UTC) FILETIME=[366E6FE0:01C5A3E6]
Return-Path: <mohanlaljangir@hotmail.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8767
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: mohanlaljangir@hotmail.com
Precedence: bulk
X-list: linux-mips

Does Linux 2.6 have NPTL support for MIPS architecture? A line at 
http://www.linux-mips.org/wiki/NPTL says "Currently NPTL for Linux/MIPS is 
work in progress". Where can I get NPTL source? Do I need new/patched 
compiler and glibc to compile NPTL source? If yes, what are the patches and 
where can I find them?

Regards,
Mohanlal

From yuasa@hh.iij4u.or.jp Thu Aug 18 15:21:35 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 18 Aug 2005 15:21:59 +0100 (BST)
Received: from mo00.iij4u.or.jp ([IPv6:::ffff:210.130.0.19]:47832 "EHLO
	mo00.iij4u.or.jp") by linux-mips.org with ESMTP id <S8225987AbVHROVf>;
	Thu, 18 Aug 2005 15:21:35 +0100
Received: MO(mo00)id j7IEQNDc009714; Thu, 18 Aug 2005 23:26:23 +0900 (JST)
Received: MDO(mdo01) id j7IEQMj5008845; Thu, 18 Aug 2005 23:26:23 +0900 (JST)
Received: from stratos (h009.p499.iij4u.or.jp [210.149.243.9])
	by mbox.iij4u.or.jp (4U-MR/mbox01) id j7IEQLfC027414
	(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT);
	Thu, 18 Aug 2005 23:26:22 +0900 (JST)
Date:	Thu, 18 Aug 2005 23:26:20 +0900
From:	Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	yuasa@hh.iij4u.or.jp, linux-mips <linux-mips@linux-mips.org>
Subject: [PATCH 2.6] vr41xx: add Mini-ITX DIMM Base support
Message-Id: <20050818232620.05d169a8.yuasa@hh.iij4u.or.jp>
X-Mailer: Sylpheed version 1.0.5 (GTK+ 1.2.10; i486-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yuasa@hh.iij4u.or.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8768
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: yuasa@hh.iij4u.or.jp
Precedence: bulk
X-list: linux-mips

Hi Ralf,

This patch has added TANBAC Mini-ITX DIMM Base(TB0287) support.
Please apply this patch.

Yoichi

Signed-off-by: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>

diff -urN -X dontdiff a-orig/arch/mips/configs/tb0287_defconfig a/arch/mips/configs/tb0287_defconfig
--- a-orig/arch/mips/configs/tb0287_defconfig	1970-01-01 09:00:00.000000000 +0900
+++ a/arch/mips/configs/tb0287_defconfig	2005-08-18 23:21:10.000000000 +0900
@@ -0,0 +1,1028 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.13-rc6
+# Thu Aug 18 23:20:57 2005
+#
+CONFIG_MIPS=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+# CONFIG_HOTPLUG is not set
+CONFIG_KOBJECT_UEVENT=y
+# CONFIG_IKCONFIG is not set
+CONFIG_EMBEDDED=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SHMEM=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_KMOD=y
+
+#
+# Machine selection
+#
+# CONFIG_MIPS_MTX1 is not set
+# CONFIG_MIPS_BOSPORUS is not set
+# CONFIG_MIPS_PB1000 is not set
+# CONFIG_MIPS_PB1100 is not set
+# CONFIG_MIPS_PB1500 is not set
+# CONFIG_MIPS_PB1550 is not set
+# CONFIG_MIPS_PB1200 is not set
+# CONFIG_MIPS_DB1000 is not set
+# CONFIG_MIPS_DB1100 is not set
+# CONFIG_MIPS_DB1500 is not set
+# CONFIG_MIPS_DB1550 is not set
+# CONFIG_MIPS_DB1200 is not set
+# CONFIG_MIPS_MIRAGE is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_MACH_DECSTATION is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_MIPS_SEAD is not set
+# CONFIG_MOMENCO_JAGUAR_ATX is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_MOMENCO_OCELOT_3 is not set
+# CONFIG_MOMENCO_OCELOT_C is not set
+# CONFIG_MOMENCO_OCELOT_G is not set
+# CONFIG_MIPS_XXS1500 is not set
+# CONFIG_PNX8550_V2PCI is not set
+# CONFIG_PNX8550_JBS is not set
+# CONFIG_DDB5074 is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
+CONFIG_MACH_VR41XX=y
+# CONFIG_PMC_YOSEMITE is not set
+# CONFIG_QEMU is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP32 is not set
+# CONFIG_SIBYTE_SWARM is not set
+# CONFIG_SIBYTE_SENTOSA is not set
+# CONFIG_SIBYTE_RHONE is not set
+# CONFIG_SIBYTE_CARMEL is not set
+# CONFIG_SIBYTE_PTSWARM is not set
+# CONFIG_SIBYTE_LITTLESUR is not set
+# CONFIG_SIBYTE_CRHINE is not set
+# CONFIG_SIBYTE_CRHONE is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_TOSHIBA_JMR3927 is not set
+# CONFIG_TOSHIBA_RBTX4927 is not set
+# CONFIG_TOSHIBA_RBTX4938 is not set
+# CONFIG_NEC_CMBVR4133 is not set
+# CONFIG_CASIO_E55 is not set
+# CONFIG_IBM_WORKPAD is not set
+CONFIG_TANBAC_TB022X=y
+# CONFIG_TANBAC_TB0226 is not set
+CONFIG_TANBAC_TB0287=y
+# CONFIG_VICTOR_MPC30X is not set
+# CONFIG_ZAO_CAPCELLA is not set
+CONFIG_PCI_VR41XX=y
+# CONFIG_VRC4173 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_HAVE_DEC_LOCK=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_IRQ_CPU=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+
+#
+# CPU selection
+#
+# CONFIG_CPU_MIPS32_R1 is not set
+# CONFIG_CPU_MIPS32_R2 is not set
+# CONFIG_CPU_MIPS64_R1 is not set
+# CONFIG_CPU_MIPS64_R2 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+CONFIG_CPU_VR41XX=y
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+# CONFIG_CPU_SB1 is not set
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
+
+#
+# Kernel type
+#
+CONFIG_32BIT=y
+# CONFIG_64BIT is not set
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+# CONFIG_MIPS_MT is not set
+# CONFIG_CPU_ADVANCED is not set
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+
+#
+# Bus options (PCI, PCMCIA, EISA, ISA, TC)
+#
+CONFIG_HW_HAS_PCI=y
+CONFIG_PCI=y
+# CONFIG_PCI_LEGACY_PROC is not set
+CONFIG_PCI_NAMES=y
+CONFIG_MMU=y
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+CONFIG_TRAD_SIGNALS=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=m
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+# CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set
+CONFIG_IP_ROUTE_VERBOSE=y
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+# CONFIG_NET_IPGRE_BROADCAST is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+CONFIG_INET_TUNNEL=m
+CONFIG_IP_TCPDIAG=y
+# CONFIG_IP_TCPDIAG_IPV6 is not set
+CONFIG_TCP_CONG_ADVANCED=y
+
+#
+# TCP congestion control
+#
+CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+# CONFIG_TCP_CONG_HSTCP is not set
+# CONFIG_TCP_CONG_HYBLA is not set
+# CONFIG_TCP_CONG_VEGAS is not set
+# CONFIG_TCP_CONG_SCALABLE is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETFILTER 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
+# CONFIG_NET_SCHED is not set
+# CONFIG_NET_CLS_ROUTE is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER 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_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+CONFIG_BLK_DEV_NBD=m
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+# CONFIG_BLK_DEV_INITRD is not set
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CDROM_PKTCDVD is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+# CONFIG_BLK_DEV_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+CONFIG_BLK_DEV_IDEPCI=y
+# CONFIG_IDEPCI_SHARE_IRQ is not set
+# CONFIG_BLK_DEV_OFFBOARD is not set
+# CONFIG_BLK_DEV_GENERIC is not set
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# CONFIG_IDEDMA_PCI_AUTO is not set
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+# CONFIG_BLK_DEV_CMD64X is not set
+# CONFIG_BLK_DEV_TRIFLEX is not set
+# CONFIG_BLK_DEV_CY82C693 is not set
+# CONFIG_BLK_DEV_CS5520 is not set
+# CONFIG_BLK_DEV_CS5530 is not set
+# CONFIG_BLK_DEV_HPT34X is not set
+# CONFIG_BLK_DEV_HPT366 is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+# CONFIG_BLK_DEV_PIIX is not set
+# CONFIG_BLK_DEV_IT821X is not set
+# CONFIG_BLK_DEV_NS87415 is not set
+# CONFIG_BLK_DEV_PDC202XX_OLD is not set
+# CONFIG_BLK_DEV_PDC202XX_NEW is not set
+# CONFIG_BLK_DEV_SVWKS is not set
+CONFIG_BLK_DEV_SIIMAGE=y
+# CONFIG_BLK_DEV_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+# CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_IDEDMA_AUTO is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+CONFIG_SCSI=y
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI Transport Attributes
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_MEGARAID_NEWGEN is not set
+# CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_SCSI_SATA is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR is not set
+# CONFIG_SCSI_QLOGIC_FC is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+CONFIG_SCSI_QLA2XXX=y
+# CONFIG_SCSI_QLA21XX is not set
+# CONFIG_SCSI_QLA22XX is not set
+# CONFIG_SCSI_QLA2300 is not set
+# CONFIG_SCSI_QLA2322 is not set
+# CONFIG_SCSI_QLA6312 is not set
+# CONFIG_SCSI_QLA24XX is not set
+# CONFIG_SCSI_LPFC is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+# CONFIG_FUSION_SPI is not set
+# CONFIG_FUSION_FC is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+CONFIG_IEEE1394=m
+
+#
+# Subsystem Options
+#
+# CONFIG_IEEE1394_VERBOSEDEBUG is not set
+# CONFIG_IEEE1394_OUI_DB is not set
+CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y
+CONFIG_IEEE1394_CONFIG_ROM_IP1394=y
+# CONFIG_IEEE1394_EXPORT_FULL_API is not set
+
+#
+# Device Drivers
+#
+
+#
+# Texas Instruments PCILynx requires I2C
+#
+CONFIG_IEEE1394_OHCI1394=m
+
+#
+# Protocol Drivers
+#
+CONFIG_IEEE1394_VIDEO1394=m
+CONFIG_IEEE1394_SBP2=m
+# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
+CONFIG_IEEE1394_ETH1394=m
+CONFIG_IEEE1394_DV1394=m
+CONFIG_IEEE1394_RAWIO=m
+CONFIG_IEEE1394_CMP=m
+CONFIG_IEEE1394_AMDTP=m
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_PCI is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+CONFIG_R8169=y
+# CONFIG_R8169_NAPI is not set
+# CONFIG_SKGE is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_VR41XX=y
+CONFIG_SERIAL_VR41XX_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_RTC is not set
+# CONFIG_GEN_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_TANBAC_TB0219 is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_DRM is not set
+CONFIG_GPIO_VR41XX=y
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+# CONFIG_I2C_SENSOR is not set
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+# CONFIG_HWMON 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
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+# CONFIG_USB_DEVICEFS is not set
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=m
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+# CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_OHCI_HCD=m
+# CONFIG_USB_OHCI_BIG_ENDIAN is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_UHCI_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_BLUETOOTH_TTY is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=m
+CONFIG_USB_HIDINPUT=y
+# CONFIG_HID_FF is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+# CONFIG_USB_AIPTEK is not set
+# CONFIG_USB_WACOM is not set
+# CONFIG_USB_ACECAD is not set
+# CONFIG_USB_KBTAB is not set
+# CONFIG_USB_POWERMATE is not set
+# CONFIG_USB_MTOUCH is not set
+# CONFIG_USB_ITMTOUCH is not set
+# CONFIG_USB_EGALAX is not set
+# CONFIG_USB_XPAD is not set
+# CONFIG_USB_ATI_REMOTE is not set
+# CONFIG_USB_KEYSPAN_REMOTE is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB Multimedia devices
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETKIT is not set
+# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_SISUSBVGA is not set
+# CONFIG_USB_LD is not set
+
+#
+# USB DSL modem support
+#
+
+#
+# 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
+
+#
+# SN Devices
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP 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
+# CONFIG_FS_POSIX_ACL is not set
+
+#
+# XFS support
+#
+CONFIG_XFS_FS=y
+# CONFIG_XFS_RT is not set
+CONFIG_XFS_QUOTA=y
+# CONFIG_XFS_SECURITY is not set
+CONFIG_XFS_POSIX_ACL=y
+# CONFIG_MINIX_FS is not set
+CONFIG_ROMFS_FS=m
+CONFIG_INOTIFY=y
+# CONFIG_QUOTA is not set
+CONFIG_QUOTACTL=y
+# CONFIG_DNOTIFY is not set
+# CONFIG_AUTOFS_FS is not set
+CONFIG_AUTOFS4_FS=y
+
+#
+# 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_DEVPTS_FS_XATTR=y
+CONFIG_DEVPTS_FS_SECURITY=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_XATTR 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=m
+# 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=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 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 is not set
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_CROSSCOMPILE=y
+CONFIG_CMDLINE="mem=64M console=ttyVR0,115200 ip=any root=/dev/nfs"
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+CONFIG_KEYS_DEBUG_PROC_KEYS=y
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+# CONFIG_CRC_CCITT is not set
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=m
diff -urN -X dontdiff a-orig/arch/mips/pci/Makefile a/arch/mips/pci/Makefile
--- a-orig/arch/mips/pci/Makefile	2005-07-26 23:37:04.000000000 +0900
+++ a/arch/mips/pci/Makefile	2005-08-18 23:08:21.000000000 +0900
@@ -49,6 +49,7 @@
 obj-$(CONFIG_SNI_RM200_PCI)	+= fixup-sni.o ops-sni.o
 obj-$(CONFIG_TANBAC_TB0219)	+= fixup-tb0219.o
 obj-$(CONFIG_TANBAC_TB0226)	+= fixup-tb0226.o
+obj-$(CONFIG_TANBAC_TB0287)	+= fixup-tb0287.o
 obj-$(CONFIG_TOSHIBA_JMR3927)	+= fixup-jmr3927.o pci-jmr3927.o
 obj-$(CONFIG_TOSHIBA_RBTX4927)	+= fixup-rbtx4927.o ops-tx4927.o
 obj-$(CONFIG_TOSHIBA_RBTX4938)	+= fixup-tx4938.o ops-tx4938.o
diff -urN -X dontdiff a-orig/arch/mips/pci/fixup-tb0287.c a/arch/mips/pci/fixup-tb0287.c
--- a-orig/arch/mips/pci/fixup-tb0287.c	1970-01-01 09:00:00.000000000 +0900
+++ a/arch/mips/pci/fixup-tb0287.c	2005-08-18 23:08:21.000000000 +0900
@@ -0,0 +1,65 @@
+/*
+ *  fixup-tb0287.c, The TANBAC TB0287 specific PCI fixups.
+ *
+ *  Copyright (C) 2005  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#include <linux/init.h>
+#include <linux/pci.h>
+
+#include <asm/vr41xx/tb0287.h>
+
+int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+	unsigned char bus;
+	int irq = -1;
+
+	bus = dev->bus->number;
+	if (bus == 0) {
+		switch (slot) {
+		case 16:
+			irq = TB0287_SM501_IRQ;
+			break;
+		case 17:
+			irq = TB0287_SIL680A_IRQ;
+			break;
+		default:
+			break;
+		}
+	} else if (bus == 1) {
+		switch (PCI_SLOT(dev->devfn)) {
+		case 0:
+			irq = TB0287_PCI_SLOT_IRQ;
+			break;
+		case 2:
+		case 3:
+			irq = TB0287_RTL8110_IRQ;
+			break;
+		default:
+			break;
+		}
+	} else if (bus > 1) {
+		irq = TB0287_PCI_SLOT_IRQ;
+	}
+
+	return irq;
+}
+
+/* Do platform specific device initialization at pci_enable_device() time */
+int pcibios_plat_dev_init(struct pci_dev *dev)
+{
+	return 0;
+}
diff -urN -X dontdiff a-orig/arch/mips/vr41xx/Kconfig a/arch/mips/vr41xx/Kconfig
--- a-orig/arch/mips/vr41xx/Kconfig	2005-08-13 09:43:00.000000000 +0900
+++ a/arch/mips/vr41xx/Kconfig	2005-08-18 23:14:54.000000000 +0900
@@ -63,6 +63,16 @@
 	  The TANBAC TB0226 (Mbase) is a MIPS-based platform manufactured by
 	  TANBAC.  Please refer to <http://www.tanbac.co.jp/> about Mbase.
 
+config TANBAC_TB0287
+	bool "Support for TANBAC Mini-ITX DIMM base(TB0287)"
+	depends on TANBAC_TB022X
+	select PCI
+	select PCI_VR41XX
+	select GPIO_VR41XX
+	help
+	  The TANBAC Mini-ITX DIMM base(TB0287) is a MIPS-based platform manufactured by TANBAC.
+	  Please refer to <http://www.tanbac.co.jp/> about Mini-ITX DIMM base.
+
 config VICTOR_MPC30X
 	bool "Support for Victor MP-C303/304"
 	depends on MACH_VR41XX
diff -urN -X dontdiff a-orig/include/asm-mips/vr41xx/tb0287.h a/include/asm-mips/vr41xx/tb0287.h
--- a-orig/include/asm-mips/vr41xx/tb0287.h	1970-01-01 09:00:00.000000000 +0900
+++ a/include/asm-mips/vr41xx/tb0287.h	2005-08-18 23:08:21.000000000 +0900
@@ -0,0 +1,45 @@
+/*
+ *  tb0287.h, Include file for TANBAC TB0287 mini-ITX board.
+ *  
+ *  Copyright (C) 2005  Media Lab Inc. <ito@mlb.co.jp>
+ *
+ *  This code is largely based on tb0219.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 program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#ifndef __TANBAC_TB0287_H
+#define __TANBAC_TB0287_H
+
+#include <asm/vr41xx/vr41xx.h>
+
+/*
+ * General-Purpose I/O Pin Number
+ */
+#define TB0287_PCI_SLOT_PIN		2
+#define TB0287_SM501_PIN		3
+#define TB0287_POWER_OFF_PIN		4
+#define TB0287_R2045_CE_PIN		6
+#define TB0287_SIL680A_PIN		8
+#define TB0287_RTL8110_PIN		13
+
+/*
+ * Interrupt Number
+ */
+#define TB0287_PCI_SLOT_IRQ		GIU_IRQ(TB0287_PCI_SLOT_PIN)
+#define TB0287_SM501_IRQ		GIU_IRQ(TB0287_SM501_PIN)
+#define TB0287_SIL680A_IRQ		GIU_IRQ(TB0287_SIL680A_PIN)
+#define TB0287_RTL8110_IRQ		GIU_IRQ(TB0287_RTL8110_PIN)
+
+#endif /* __TANBAC_TB0287_H */



From suryya@alumnux.com Thu Aug 18 15:22:40 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 18 Aug 2005 15:22:59 +0100 (BST)
Received: from ppp124-190.pppcal.vsnl.net.in ([IPv6:::ffff:203.197.124.190]:56593
	"EHLO alumnux.com") by linux-mips.org with ESMTP
	id <S8225216AbVHROWk>; Thu, 18 Aug 2005 15:22:40 +0100
Received: from [192.168.10.150] ([192.168.10.150])
	by alumnux.com (8.9.3/8.9.3) with ESMTP id UAA13711;
	Thu, 18 Aug 2005 20:17:20 +0530
Subject: how to build ramdisk along with kernel-2.6.10
From:	Suryya Kumar Jana <suryya@alumnux.com>
Reply-To: suryya@alumnux.com
To:	linux-mips@linux-mips.org
Cc:	suryya <suryya@alumnux.com>
Content-Type: multipart/alternative; boundary="=-0oHGyCAQzSKZ3YsdKrvJ"
Organization: Alumnus Softeware Limited
Message-Id: <1124375652.4863.571.camel@getafix>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) 
Date:	18 Aug 2005 20:04:12 +0530
Return-Path: <suryya@alumnux.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8769
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: suryya@alumnux.com
Precedence: bulk
X-list: linux-mips


--=-0oHGyCAQzSKZ3YsdKrvJ
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi
I would like to port linux-2.6.10 into a mips broad.
I'm able to build the kernel. But when try to boot the kernel for the
broad, it gives some errors given bellow. 
Probable it wants the ramdisk but is not getting. Could any body guide
me to solve this?

With the Best Regards
suryya
 
<2>initrd overwritten (0x%08lx < 0x%08lx) - disabling it.
<7>Calling initcall 0x%ppreemption imbalancedisabled interruptserror in
initcall at 0x%p: returned with %s
                                                                                                                             
/init/dev/console/sbin/init/etc/init/bin/init/bin/shNo init found.  Try
passing init= option to kernel.Warning: unable to open an initial
console.
early_parm_test: %s
(null)early_setup_test: %s
Linux version 2.6.10-TSB20041227 (root@getafix) (gcc version 3.2.3 (CELF
20031024)) #27 Thu Aug 18 12:43:15 IST 2005
/sys/block/%s/dev%u:%u/sys/block/%s/range/syssysfs/dev/nfsram/root
readonlyVFS: Mounted root (%s filesystem)%s.
VFS: Unable to mount root fs on %sVFS: Cannot open root device "%s" or
%s
Please append a correct "root=" boot option
/dev/root<5>VFS: Insert %s and press ENTER
/dev/console./<5>RAMDISK: Couldn't find valid RAM disk image starting at
%d.
<5>RAMDISK: ext2 filesystem found at block %d
<5>RAMDISK: Minix filesystem found at block %d
<5>RAMDISK: cramfs filesystem found at block %d
<5>RAMDISK: romfs filesystem found at block %d
<5>RAMDISK: Compressed image found at block %d
|/-\/dev/ramRAMDISK: image too big! (%dKiB/%ldKiB)
..................................................
..................................................
..................................................

--=-0oHGyCAQzSKZ3YsdKrvJ
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/1.1.8">
</HEAD>
<BODY>
Hi<BR>
I would like to port linux-2.6.10 into a mips broad.<BR>
I'm able to build the kernel. But when try to boot the kernel for the broad, it gives some errors given bellow. <BR>
Probable it wants the ramdisk but is not getting. Could any body guide me to solve this?<BR>
<BR>
With the Best Regards<BR>
suryya<BR>
 <BR>
&lt;2&gt;initrd overwritten (0x%08lx &lt; 0x%08lx) - disabling it.<BR>
&lt;7&gt;Calling initcall 0x%ppreemption imbalancedisabled interruptserror in initcall at 0x%p: returned with %s<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>
/init/dev/console/sbin/init/etc/init/bin/init/bin/shNo init found.&nbsp; Try passing init= option to kernel.Warning: unable to open an initial console.<BR>
early_parm_test: %s<BR>
(null)early_setup_test: %s<BR>
Linux version 2.6.10-TSB20041227 (root@getafix) (gcc version 3.2.3 (CELF 20031024)) #27 Thu Aug 18 12:43:15 IST 2005<BR>
/sys/block/%s/dev%u:%u/sys/block/%s/range/syssysfs/dev/nfsram/root readonlyVFS: Mounted root (%s filesystem)%s.<BR>
VFS: Unable to mount root fs on %sVFS: Cannot open root device &quot;%s&quot; or %s<BR>
Please append a correct &quot;root=&quot; boot option<BR>
/dev/root&lt;5&gt;VFS: Insert %s and press ENTER<BR>
/dev/console./&lt;5&gt;RAMDISK: Couldn't find valid RAM disk image starting at %d.<BR>
&lt;5&gt;RAMDISK: ext2 filesystem found at block %d<BR>
&lt;5&gt;RAMDISK: Minix filesystem found at block %d<BR>
&lt;5&gt;RAMDISK: cramfs filesystem found at block %d<BR>
&lt;5&gt;RAMDISK: romfs filesystem found at block %d<BR>
&lt;5&gt;RAMDISK: Compressed image found at block %d<BR>
|/-\/dev/ramRAMDISK: image too big! (%dKiB/%ldKiB)<BR>
..................................................<BR>
..................................................<BR>
..................................................
</BODY>
</HTML>

--=-0oHGyCAQzSKZ3YsdKrvJ--


From mark.e.mason@broadcom.com Thu Aug 18 17:35:43 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 18 Aug 2005 17:36:04 +0100 (BST)
Received: from mms2.broadcom.com ([IPv6:::ffff:216.31.210.18]:46861 "EHLO
	MMS2.broadcom.com") by linux-mips.org with ESMTP
	id <S8226020AbVHRQfn>; Thu, 18 Aug 2005 17:35:43 +0100
Received: from 10.10.64.121 by MMS2.broadcom.com with SMTP (Broadcom
 SMTP Relay (Email Firewall v6.1.0)); Thu, 18 Aug 2005 09:40:20 -0700
X-Server-Uuid: 1F20ACF3-9CAF-44F7-AB47-F294E2D5B4EA
Received: from mail-irva-8.broadcom.com ([10.10.64.221]) by
 mail-irva-1.broadcom.com (Post.Office MTA v3.5.3 release 223 ID#
 0-72233U7200L2200S0V35) with ESMTP id com for
 <linux-mips@linux-mips.org>; Thu, 18 Aug 2005 09:40:18 -0700
Received: from mon-irva-10.broadcom.com (mon-irva-10.broadcom.com
 [10.10.64.171]) by mail-irva-8.broadcom.com (MOS 3.5.6-GR) with ESMTP
 id BPP15244; Thu, 18 Aug 2005 09:40:17 -0700 (PDT)
Received: from nt-sjca-0740.brcm.ad.broadcom.com (
 nt-sjca-0740.sj.broadcom.com [10.16.192.49]) by
 mon-irva-10.broadcom.com (8.9.1/8.9.1) with ESMTP id JAA06769 for
 <linux-mips@linux-mips.org>; Thu, 18 Aug 2005 09:40:16 -0700 (PDT)
Received: from NT-SJCA-0750.brcm.ad.broadcom.com ([10.16.192.220]) by
 nt-sjca-0740.brcm.ad.broadcom.com with Microsoft SMTPSVC(6.0.3790.211);
 Thu, 18 Aug 2005 09:40:16 -0700
Received: from [10.240.253.79] ([10.240.253.79]) by
 NT-SJCA-0750.brcm.ad.broadcom.com with Microsoft SMTPSVC(6.0.3790.211);
 Thu, 18 Aug 2005 09:40:16 -0700
Message-ID: <4304B9D4.4030804@broadcom.com>
Date:	Thu, 18 Aug 2005 09:39:48 -0700
From:	"Mark Mason" <mason@broadcom.com>
User-Agent: Mozilla Thunderbird 1.0.6-1.1.fc4 (X11/20050720)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: A patch for arch/mips/mm/cache.c
X-OriginalArrivalTime: 18 Aug 2005 16:40:16.0588 (UTC)
 FILETIME=[8367D0C0:01C5A413]
X-WSS-ID: 6F1A667E29O4867814-01-01
Content-Type: multipart/mixed;
 boundary=------------090108060601040505090701
Return-Path: <mark.e.mason@broadcom.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8770
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: mason@broadcom.com
Precedence: bulk
X-list: linux-mips

This is a multi-part message in MIME format.
--------------090108060601040505090701
Content-Type: text/plain;
 charset=iso-8859-1;
 format=flowed
Content-Transfer-Encoding: 7bit

Hello all,

The following patch to cache.c rearranges the logic in cpu_cache_init() 
somewhat to make the detection of the processor via the 
current_cpu_data.cputype take precedence over the cpu_has_4ktlb test.  
This seems to make sense, as the cputype test is significantly more 
specific than the 4ktlb test.  It also arranges for the panic() to 
happen if the 4ktlb test fails as well (the old version would fail 
silently).

It also happens to fix things so that the SB1/swarm starts booting 
again....  ;)

Please consider this for inclusion.

Thanks,
Mark



--------------090108060601040505090701
Content-Type: text/x-patch;
 name=cpu_cache_init.patch
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename=cpu_cache_init.patch

Index: cache.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/mm/cache.c,v
retrieving revision 1.21
diff -u -r1.21 cache.c
--- cache.c	6 Jul 2005 12:08:14 -0000	1.21
+++ cache.c	18 Aug 2005 16:33:31 -0000
@@ -114,16 +114,7 @@
 
 void __init cpu_cache_init(void)
 {
-	if (cpu_has_4ktlb) {
-#if defined(CONFIG_CPU_R4X00)  || defined(CONFIG_CPU_VR41XX) || \
-    defined(CONFIG_CPU_R4300)  || defined(CONFIG_CPU_R5000)  || \
-    defined(CONFIG_CPU_NEVADA) || defined(CONFIG_CPU_R5432)  || \
-    defined(CONFIG_CPU_R5500)  || defined(CONFIG_CPU_MIPS32_R1) || \
-    defined(CONFIG_CPU_MIPS64_R1) || defined(CONFIG_CPU_TX49XX) || \
-    defined(CONFIG_CPU_RM7000) || defined(CONFIG_CPU_RM9000)
-		ld_mmu_r4xx0();
-#endif
-	} else switch (current_cpu_data.cputype) {
+	switch (current_cpu_data.cputype) {
 #ifdef CONFIG_CPU_R3000
 	case CPU_R2000:
 	case CPU_R3000:
@@ -156,6 +147,17 @@
 		break;
 
 	default:
+		if (cpu_has_4ktlb) {
+#if defined(CONFIG_CPU_R4X00)  || defined(CONFIG_CPU_VR41XX) || \
+    defined(CONFIG_CPU_R4300)  || defined(CONFIG_CPU_R5000)  || \
+    defined(CONFIG_CPU_NEVADA) || defined(CONFIG_CPU_R5432)  || \
+    defined(CONFIG_CPU_R5500)  || defined(CONFIG_CPU_MIPS32_R1) || \
+    defined(CONFIG_CPU_MIPS64_R1) || defined(CONFIG_CPU_TX49XX) || \
+    defined(CONFIG_CPU_RM7000) || defined(CONFIG_CPU_RM9000)
+			ld_mmu_r4xx0();
+			break;
+#endif
+		}
 		panic("Yeee, unsupported cache architecture.");
 	}
 }

--------------090108060601040505090701--


From ttruong@broadcom.com Thu Aug 18 19:00:21 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 18 Aug 2005 19:00:43 +0100 (BST)
Received: from mms3.broadcom.com ([IPv6:::ffff:216.31.210.19]:25104 "EHLO
	MMS3.broadcom.com") by linux-mips.org with ESMTP
	id <S8226022AbVHRSAV>; Thu, 18 Aug 2005 19:00:21 +0100
Received: from 10.10.64.121 by MMS3.broadcom.com with SMTP (Broadcom
 SMTP Relay (Email Firewall v6.1.0)); Thu, 18 Aug 2005 11:04:48 -0700
X-Server-Uuid: 35E76369-CF33-4172-911A-D1698BD5E887
Received: from mail-irva-8.broadcom.com ([10.10.64.221]) by
 mail-irva-1.broadcom.com (Post.Office MTA v3.5.3 release 223 ID#
 0-72233U7200L2200S0V35) with ESMTP id com; Thu, 18 Aug 2005 11:04:56
 -0700
Received: from mon-irva-10.broadcom.com (mon-irva-10.broadcom.com
 [10.10.64.171]) by mail-irva-8.broadcom.com (MOS 3.5.6-GR) with ESMTP
 id BPP36181; Thu, 18 Aug 2005 11:04:51 -0700 (PDT)
Received: from pcirvcttruong2 (dhcp-10-3-136-70.broadcom.com
 [10.3.136.70]) by mon-irva-10.broadcom.com (8.9.1/8.9.1) with ESMTP id
 LAA04568; Thu, 18 Aug 2005 11:04:51 -0700 (PDT)
Message-ID: <200508181804.LAA04568@mon-irva-10.broadcom.com>
From:	"Ton Truong" <ttruong@broadcom.com>
To:	"'mohanlal jangir'" <mohanlaljangir@hotmail.com>,
	linux-mips@linux-mips.org
Subject: RE: NPTL info needed
Date:	Thu, 18 Aug 2005 11:04:48 -0700
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook, Build 11.0.6353
In-Reply-To: <BAY18-DAV1144F0C7D384449D254D6BD2B20@phx.gbl>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
Thread-Index: AcWj5mfYfk2EzcMbQ2epzk0+UdjolQAOGQuw
X-WSS-ID: 6F1A124A0B04803701-01-01
Content-Type: text/plain;
 charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <ttruong@broadcom.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8771
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ttruong@broadcom.com
Precedence: bulk
X-list: linux-mips

 Daniel Jacobowitz announced support for MIPS NPTL a while back (Apr 05),
complete with patch set for toolchain and kernel.  Check kernel.org archive
for that.

A uClibc port is being done by Steve Hill and infos can be found here:

http://www.realitydiluted.com/nptl-uclibc/

HTH,

/?TT

-----Original Message-----
From: linux-mips-bounce@linux-mips.org
[mailto:linux-mips-bounce@linux-mips.org] On Behalf Of mohanlal jangir
Sent: Thursday, August 18, 2005 4:11 AM
To: linux-mips@linux-mips.org
Subject: NPTL info needed

Does Linux 2.6 have NPTL support for MIPS architecture? A line at 
http://www.linux-mips.org/wiki/NPTL says "Currently NPTL for Linux/MIPS is 
work in progress". Where can I get NPTL source? Do I need new/patched 
compiler and glibc to compile NPTL source? If yes, what are the patches and 
where can I find them?

Regards,
Mohanlal






From mlachwani@mvista.com Thu Aug 18 19:18:05 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 18 Aug 2005 19:18:27 +0100 (BST)
Received: from gateway-1237.mvista.com ([IPv6:::ffff:12.44.186.158]:57326 "EHLO
	hermes.mvista.com") by linux-mips.org with ESMTP
	id <S8226022AbVHRSSF>; Thu, 18 Aug 2005 19:18:05 +0100
Received: from mvista.com (prometheus.mvista.com [10.0.0.139])
	by hermes.mvista.com (Postfix) with ESMTP
	id E5DB519E79; Thu, 18 Aug 2005 11:22:57 -0700 (PDT)
Message-ID: <4304D201.2060306@mvista.com>
Date:	Thu, 18 Aug 2005 11:22:57 -0700
From:	mlachwani <mlachwani@mvista.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.2) Gecko/20040308
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	Ton Truong <ttruong@broadcom.com>
Cc:	'mohanlal jangir' <mohanlaljangir@hotmail.com>,
	linux-mips@linux-mips.org
Subject: Re: NPTL info needed
References: <200508181804.LAA04568@mon-irva-10.broadcom.com>
In-Reply-To: <200508181804.LAA04568@mon-irva-10.broadcom.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <mlachwani@mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8772
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: mlachwani@mvista.com
Precedence: bulk
X-list: linux-mips

This may help:

http://www.linux-mips.org/archives/linux-mips/2005-03/msg00088.html

Thanks
Manish Lachwani

Ton Truong wrote:

> Daniel Jacobowitz announced support for MIPS NPTL a while back (Apr 05),
>complete with patch set for toolchain and kernel.  Check kernel.org archive
>for that.
>
>A uClibc port is being done by Steve Hill and infos can be found here:
>
>http://www.realitydiluted.com/nptl-uclibc/
>
>HTH,
>
>/?TT
>
>-----Original Message-----
>From: linux-mips-bounce@linux-mips.org
>[mailto:linux-mips-bounce@linux-mips.org] On Behalf Of mohanlal jangir
>Sent: Thursday, August 18, 2005 4:11 AM
>To: linux-mips@linux-mips.org
>Subject: NPTL info needed
>
>Does Linux 2.6 have NPTL support for MIPS architecture? A line at 
>http://www.linux-mips.org/wiki/NPTL says "Currently NPTL for Linux/MIPS is 
>work in progress". Where can I get NPTL source? Do I need new/patched 
>compiler and glibc to compile NPTL source? If yes, what are the patches and 
>where can I find them?
>
>Regards,
>Mohanlal
>
>
>
>
>
>
>  
>



From mohanlaljangir@hotmail.com Fri Aug 19 15:02:37 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 19 Aug 2005 15:02:58 +0100 (BST)
Received: from bay18-dav2.bay18.hotmail.com ([IPv6:::ffff:65.54.187.182]:10785
	"EHLO hotmail.com") by linux-mips.org with ESMTP
	id <S8224836AbVHSOCg>; Fri, 19 Aug 2005 15:02:36 +0100
Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;
	 Fri, 19 Aug 2005 07:07:30 -0700
Message-ID: <BAY18-DAV2A05369EA8C7D91990C16D2B50@phx.gbl>
Received: from 210.118.108.254 by BAY18-DAV2.phx.gbl with DAV;
	Fri, 19 Aug 2005 14:07:30 +0000
X-Originating-IP: [210.118.108.254]
X-Originating-Email: [mohanlaljangir@hotmail.com]
X-Sender: mohanlaljangir@hotmail.com
From:	"mohanlal jangir" <mohanlaljangir@hotmail.com>
To:	"mlachwani" <mlachwani@mvista.com>
Cc:	<linux-mips@linux-mips.org>
References: <200508181804.LAA04568@mon-irva-10.broadcom.com> <4304D201.2060306@mvista.com>
Subject: Re: NPTL info needed
Date:	Fri, 19 Aug 2005 19:32:51 +0530
MIME-Version: 1.0
Content-Type: text/plain;
	format=flowed;
	charset="iso-8859-1";
	reply-type=response
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-OriginalArrivalTime: 19 Aug 2005 14:07:30.0689 (UTC) FILETIME=[56845F10:01C5A4C7]
Return-Path: <mohanlaljangir@hotmail.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8773
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: mohanlaljangir@hotmail.com
Precedence: bulk
X-list: linux-mips

> This may help:
>
> http://www.linux-mips.org/archives/linux-mips/2005-03/msg00088.html
>
> Thanks
> Manish Lachwani
>

Hi Manish,
Thanks for your help. I tried to apply this patch on Linux-2.6.10 and many 
hunks failed. Could you tell me which kernel version this patch should be 
applied? Also do I need to apply any patch to gcc, glibc sources (and build 
a new toolchain)?

Regards,
Mohanlal 

From fthain@telegraphics.com.au Sat Aug 20 05:25:16 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 20 Aug 2005 05:25:34 +0100 (BST)
Received: from loopy.telegraphics.com.au ([IPv6:::ffff:202.45.126.152]:33207
	"EHLO loopy.telegraphics.com.au") by linux-mips.org with ESMTP
	id <S8224808AbVHTEZQ>; Sat, 20 Aug 2005 05:25:16 +0100
Received: by loopy.telegraphics.com.au (Postfix, from userid 1001)
	id 6D36FC989D; Sat, 20 Aug 2005 14:30:12 +1000 (EST)
Received: from localhost (localhost [127.0.0.1])
	by loopy.telegraphics.com.au (Postfix) with ESMTP id 6686EC969E;
	Sat, 20 Aug 2005 14:30:12 +1000 (EST)
Date:	Sat, 20 Aug 2005 14:30:12 +1000 (EST)
From:	Finn Thain <fthain@telegraphics.com.au>
To:	Jeff Garzik <jgarzik@pobox.com>,
	Roman Zippel <zippel@linux-m68k.org>
Cc:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Ralf Baechle <ralf@linux-mips.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Linux/m68k <linux-m68k@vger.kernel.org>,
	Linux/m68k on Mac <linux-mac68k@mac.linux-m68k.org>,
	Linux MIPS <linux-mips@linux-mips.org>,
	Linux net <linux-net@vger.kernel.org>
Subject: Re: [PATCH] macsonic/jazzsonic drivers update (part 2)
In-Reply-To: <Pine.LNX.4.61.0507130122220.4355@loopy.telegraphics.com.au>
Message-ID: <Pine.LNX.4.63.0508201406350.3539@loopy.telegraphics.com.au>
References: <200503070210.j272ARii023023@hera.kernel.org>
 <Pine.LNX.4.62.0503221807160.20753@numbat.sonytel.be> <20050323100139.GB8813@linux-mips.org>
 <Pine.LNX.4.61.0506121454410.1470@loopy.telegraphics.com.au>
 <20050615114158.GA9411@linux-mips.org> <Pine.LNX.4.61.0506152220460.22046@loopy.telegraphics.com.au>
 <20050615142717.GD9411@linux-mips.org> <Pine.LNX.4.61.0506160218310.24328@loopy.telegraphics.com.au>
 <Pine.LNX.4.61.0506160336410.24908@loopy.telegraphics.com.au>
 <20050616092257.GE5202@linux-mips.org> <Pine.LNX.4.61.0506162129450.31164@loopy.telegraphics.com.au>
 <Pine.LNX.4.61.0506270227510.1015@loopy.telegraphics.com.au>
 <42BEEC32.7040807@pobox.com> <Pine.LNX.4.61.0507130122220.4355@loopy.telegraphics.com.au>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Return-Path: <fthain@telegraphics.com.au>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8774
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: fthain@telegraphics.com.au
Precedence: bulk
X-list: linux-mips



On Wed, 13 Jul 2005, Finn Thain wrote:

> On Sun, 26 Jun 2005, Jeff Garzik wrote:
> 
> > Patch looks OK to me.  Comments:
> > 
> > 1) Either Geert or Ralf can merge this, with my ACK.
> > 
> > 2) Would be nice to get it tested on the machines you list as untested.
> > 
> > 3) [possible problem in driver, not your changes] I wonder if IRQ_HANDLED is
> > ever returned for shared interrupts?  I don't know enough about the platform
> > interrupt architecture to answer this question.
> > 
> > 4) Remove casts to/from void.  This is especially noticable in all the casts
> > of the netdev_priv() return value.
> >
> > 5) If it doesn't cause too much patch noise, consider using enums rather than
> > #defines, for numeric constants.  This gives the compiler more type
> > information and makes the symbols visible in a debugger.  This is a
> > -maintainer preference- issue overall, so don't sweat it if you disagree.
> 
> 
> This patch removes the unecessary void* casts introduced in the first patch.

Update:

The two patches referred to above have been tested on Jazz MIPS and
ack'd off-list by Thomas Bogendorfer. He also added the cosmetic change below.

I think this is ready to be merged (Jeff?)

Roman, is your m68k DMA implementation ready for commit? Thomas will take 
care of the Jazz one.

Thanks

-f


Acked-off: by Thomas Bogendoerfer <tsbogend@alpha.franken.de>


--- jazzsonic.c.orig	2005-08-18 23:15:24.067805832 +0200
+++ jazzsonic.c	2005-08-18 23:18:15.895684024 +0200
@@ -123,7 +123,7 @@
 	if (sonic_debug  &&  version_printed++ == 0)
 		printk(version);
 
-	printk("%s: Sonic ethernet found at 0x%08lx, ", lp->device->bus_id, dev->base_addr);
+	printk(KERN_INFO "%s: Sonic ethernet found at 0x%08lx, ", lp->device->bus_id, dev->base_addr);
 
 	/*
 	 * Put the sonic into software reset, then
@@ -238,7 +238,7 @@
 	if (err)
 		goto out1;
 
-	printk(KERN_INFO "%s: MAC ", dev->name);
+	printk("%s: MAC ", dev->name);
 	for (i = 0; i < 6; i++) {
 		printk("%2.2x", dev->dev_addr[i]);
 		if (i < 5)



From jgarzik@pobox.com Sat Aug 20 05:45:28 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 20 Aug 2005 05:45:47 +0100 (BST)
Received: from mail.dvmed.net ([IPv6:::ffff:216.237.124.58]:1504 "EHLO
	mail.dvmed.net") by linux-mips.org with ESMTP id <S8224808AbVHTEp2>;
	Sat, 20 Aug 2005 05:45:28 +0100
Received: from cpe-069-134-188-146.nc.res.rr.com ([69.134.188.146] helo=[10.10.10.88])
	by mail.dvmed.net with esmtpsa (Exim 4.52 #1 (Red Hat Linux))
	id 1E6LJE-0002gZ-7h; Sat, 20 Aug 2005 04:50:21 +0000
Message-ID: <4306B689.6050705@pobox.com>
Date:	Sat, 20 Aug 2005 00:50:17 -0400
From:	Jeff Garzik <jgarzik@pobox.com>
User-Agent: Mozilla Thunderbird 1.0.6-1.1.fc4 (X11/20050720)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	Finn Thain <fthain@telegraphics.com.au>
CC:	Roman Zippel <zippel@linux-m68k.org>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Ralf Baechle <ralf@linux-mips.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Linux/m68k <linux-m68k@vger.kernel.org>,
	Linux/m68k on Mac <linux-mac68k@mac.linux-m68k.org>,
	Linux MIPS <linux-mips@linux-mips.org>,
	Linux net <linux-net@vger.kernel.org>
Subject: Re: [PATCH] macsonic/jazzsonic drivers update (part 2)
References: <200503070210.j272ARii023023@hera.kernel.org> <Pine.LNX.4.62.0503221807160.20753@numbat.sonytel.be> <20050323100139.GB8813@linux-mips.org> <Pine.LNX.4.61.0506121454410.1470@loopy.telegraphics.com.au> <20050615114158.GA9411@linux-mips.org> <Pine.LNX.4.61.0506152220460.22046@loopy.telegraphics.com.au> <20050615142717.GD9411@linux-mips.org> <Pine.LNX.4.61.0506160218310.24328@loopy.telegraphics.com.au> <Pine.LNX.4.61.0506160336410.24908@loopy.telegraphics.com.au> <20050616092257.GE5202@linux-mips.org> <Pine.LNX.4.61.0506162129450.31164@loopy.telegraphics.com.au> <Pine.LNX.4.61.0506270227510.1015@loopy.telegraphics.com.au> <42BEEC32.7040807@pobox.com> <Pine.LNX.4.61.0507130122220.4355@loopy.telegraphics.com.au> <Pine.LNX.4.63.0508201406350.3539@loopy.telegraphics.com.au>
In-Reply-To: <Pine.LNX.4.63.0508201406350.3539@loopy.telegraphics.com.au>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <jgarzik@pobox.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8775
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: jgarzik@pobox.com
Precedence: bulk
X-list: linux-mips

Finn Thain wrote:
> 
> On Wed, 13 Jul 2005, Finn Thain wrote:
> 
> 
>>On Sun, 26 Jun 2005, Jeff Garzik wrote:
>>
>>
>>>Patch looks OK to me.  Comments:
>>>
>>>1) Either Geert or Ralf can merge this, with my ACK.
>>>
>>>2) Would be nice to get it tested on the machines you list as untested.
>>>
>>>3) [possible problem in driver, not your changes] I wonder if IRQ_HANDLED is
>>>ever returned for shared interrupts?  I don't know enough about the platform
>>>interrupt architecture to answer this question.
>>>
>>>4) Remove casts to/from void.  This is especially noticable in all the casts
>>>of the netdev_priv() return value.
>>>
>>>5) If it doesn't cause too much patch noise, consider using enums rather than
>>>#defines, for numeric constants.  This gives the compiler more type
>>>information and makes the symbols visible in a debugger.  This is a
>>>-maintainer preference- issue overall, so don't sweat it if you disagree.
>>
>>
>>This patch removes the unecessary void* casts introduced in the first patch.
> 
> 
> Update:
> 
> The two patches referred to above have been tested on Jazz MIPS and
> ack'd off-list by Thomas Bogendorfer. He also added the cosmetic change below.
> 
> I think this is ready to be merged (Jeff?)
> 
> Roman, is your m68k DMA implementation ready for commit? Thomas will take 
> care of the Jazz one.

Can you please resend with full description and sign-off list?

i.e. rule #6 of

	http://linux.yyz.us/patch-format.html

Regards,

	Jeff




From fthain@telegraphics.com.au Sat Aug 20 06:48:23 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 20 Aug 2005 06:49:00 +0100 (BST)
Received: from loopy.telegraphics.com.au ([IPv6:::ffff:202.45.126.152]:44459
	"EHLO loopy.telegraphics.com.au") by linux-mips.org with ESMTP
	id <S8224909AbVHTFsX>; Sat, 20 Aug 2005 06:48:23 +0100
Received: by loopy.telegraphics.com.au (Postfix, from userid 1001)
	id 77B46C9740; Sat, 20 Aug 2005 15:53:22 +1000 (EST)
Received: from localhost (localhost [127.0.0.1])
	by loopy.telegraphics.com.au (Postfix) with ESMTP id 73B102A9C4;
	Sat, 20 Aug 2005 15:53:22 +1000 (EST)
Date:	Sat, 20 Aug 2005 15:53:22 +1000 (EST)
From:	Finn Thain <fthain@telegraphics.com.au>
To:	Jeff Garzik <jgarzik@pobox.com>
Cc:	Roman Zippel <zippel@linux-m68k.org>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Ralf Baechle <ralf@linux-mips.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Linux/m68k <linux-m68k@vger.kernel.org>,
	Linux/m68k on Mac <linux-mac68k@mac.linux-m68k.org>,
	Linux MIPS <linux-mips@linux-mips.org>,
	Linux net <linux-net@vger.kernel.org>
Subject: Re: [PATCH 1/1 RESEND] macsonic/jazzsonic network drivers update
In-Reply-To: <4306B689.6050705@pobox.com>
Message-ID: <Pine.LNX.4.63.0508201521410.3539@loopy.telegraphics.com.au>
References: <200503070210.j272ARii023023@hera.kernel.org>
 <Pine.LNX.4.62.0503221807160.20753@numbat.sonytel.be> <20050323100139.GB8813@linux-mips.org>
 <Pine.LNX.4.61.0506121454410.1470@loopy.telegraphics.com.au>
 <20050615114158.GA9411@linux-mips.org> <Pine.LNX.4.61.0506152220460.22046@loopy.telegraphics.com.au>
 <20050615142717.GD9411@linux-mips.org> <Pine.LNX.4.61.0506160218310.24328@loopy.telegraphics.com.au>
 <Pine.LNX.4.61.0506160336410.24908@loopy.telegraphics.com.au>
 <20050616092257.GE5202@linux-mips.org> <Pine.LNX.4.61.0506162129450.31164@loopy.telegraphics.com.au>
 <Pine.LNX.4.61.0506270227510.1015@loopy.telegraphics.com.au>
 <42BEEC32.7040807@pobox.com> <Pine.LNX.4.61.0507130122220.4355@loopy.telegraphics.com.au>
 <Pine.LNX.4.63.0508201406350.3539@loopy.telegraphics.com.au>
 <4306B689.6050705@pobox.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Return-Path: <fthain@telegraphics.com.au>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8776
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: fthain@telegraphics.com.au
Precedence: bulk
X-list: linux-mips


The purpose of this patch:

- Adopt the DMA API (jazzsonic, macsonic & core driver).

- Adopt the driver model (macsonic).

This part was cribbed from jazzsonic. As a consequence, macsonic once 
again works as a module. Driver model is also used by the DMA calls.

- Support 16 bit cards (macsonic & core driver, also affects jazzsonic)

This code was adapted from the mac68k linux 2.2 kernel, where it has 
languished for a long time.

- Support more 32-bit mac cards (macsonic)

Also from mac68k repo.

- Zero-copy buffer handling (core driver)

Provides a nice performance improvement. The new algorithm incidentally 
helped to replace the old Jazz DMA code.

The patch was tested on a variety of macs (several 32-bit quadra built-in 
NICs, a 16-bit LC PDS NIC and a 16-bit comm-slot NIC), and also on MIPS 
Jazz.

This patch combines the three previous patches in this thread.


Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Acked-by: Jeff Garzik <jgarzik@pobox.com>



--- orig/drivers/net/Space.c	Sun Jul 10 22:11:34 2005
+++ linux/drivers/net/Space.c	Sun Jul 10 22:11:46 2005
@@ -87,7 +87,6 @@
 extern struct net_device *tc515_probe(int unit);
 extern struct net_device *lance_probe(int unit);
 extern struct net_device *mace_probe(int unit);
-extern struct net_device *macsonic_probe(int unit);
 extern struct net_device *mac8390_probe(int unit);
 extern struct net_device *mac89x0_probe(int unit);
 extern struct net_device *mc32_probe(int unit);
@@ -289,9 +288,6 @@
 #endif
 #ifdef CONFIG_MACMACE		/* Mac 68k Quadra AV builtin Ethernet */
 	{mace_probe, 0},
-#endif
-#ifdef CONFIG_MACSONIC		/* Mac SONIC-based Ethernet of all sorts */ 
-	{macsonic_probe, 0},
 #endif
 #ifdef CONFIG_MAC8390           /* NuBus NS8390-based cards */
 	{mac8390_probe, 0},
--- orig/drivers/net/jazzsonic.c	Sun Jul 10 22:11:34 2005
+++ linux/drivers/net/jazzsonic.c	Sun Jul 10 22:22:39 2005
@@ -1,5 +1,10 @@
 /*
- * sonic.c
+ * jazzsonic.c
+ *
+ * (C) 2005 Finn Thain
+ *
+ * Converted to DMA API, and (from the mac68k project) introduced
+ * dhd's support for 16-bit cards.
  *
  * (C) 1996,1998 by Thomas Bogendoerfer (tsbogend@alpha.franken.de)
  * 
@@ -28,8 +33,8 @@
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
-#include <linux/bitops.h>
 #include <linux/device.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/bootinfo.h>
 #include <asm/system.h>
@@ -44,22 +49,20 @@
 
 #define SONIC_MEM_SIZE	0x100
 
-#define SREGS_PAD(n)    u16 n;
-
 #include "sonic.h"
 
 /*
  * Macros to access SONIC registers
  */
-#define SONIC_READ(reg) (*((volatile unsigned int *)base_addr+reg))
+#define SONIC_READ(reg) (*((volatile unsigned int *)dev->base_addr+reg))
 
 #define SONIC_WRITE(reg,val)						\
 do {									\
-	*((volatile unsigned int *)base_addr+(reg)) = (val);		\
+	*((volatile unsigned int *)dev->base_addr+(reg)) = (val);		\
 } while (0)
 
 
-/* use 0 for production, 1 for verification, >2 for debug */
+/* use 0 for production, 1 for verification, >1 for debug */
 #ifdef SONIC_DEBUG
 static unsigned int sonic_debug = SONIC_DEBUG;
 #else 
@@ -85,18 +88,18 @@
 	0xffff			/* end of list */
 };
 
-static int __init sonic_probe1(struct net_device *dev, unsigned long base_addr,
-                               unsigned int irq)
+static int __init sonic_probe1(struct net_device *dev)
 {
 	static unsigned version_printed;
 	unsigned int silicon_revision;
 	unsigned int val;
-	struct sonic_local *lp;
+	struct sonic_local *lp = netdev_priv(dev);
 	int err = -ENODEV;
 	int i;
 
-	if (!request_mem_region(base_addr, SONIC_MEM_SIZE, jazz_sonic_string))
+	if (!request_mem_region(dev->base_addr, SONIC_MEM_SIZE, jazz_sonic_string))
 		return -EBUSY;
+
 	/*
 	 * get the Silicon Revision ID. If this is one of the known
 	 * one assume that we found a SONIC ethernet controller at
@@ -120,11 +123,7 @@
 	if (sonic_debug  &&  version_printed++ == 0)
 		printk(version);
 
-	printk("%s: Sonic ethernet found at 0x%08lx, ", dev->name, base_addr);
-
-	/* Fill in the 'dev' fields. */
-	dev->base_addr = base_addr;
-	dev->irq = irq;
+	printk(KERN_INFO "%s: Sonic ethernet found at 0x%08lx, ", lp->device->bus_id, dev->base_addr);
 
 	/*
 	 * Put the sonic into software reset, then
@@ -138,84 +137,44 @@
 		dev->dev_addr[i*2+1] = val >> 8;
 	}
 
-	printk("HW Address ");
-	for (i = 0; i < 6; i++) {
-		printk("%2.2x", dev->dev_addr[i]);
-		if (i<5)
-			printk(":");
-	}
-
-	printk(" IRQ %d\n", irq);
-
 	err = -ENOMEM;
     
 	/* Initialize the device structure. */
-	if (dev->priv == NULL) {
-		/*
-		 * the memory be located in the same 64kb segment
-		 */
-		lp = NULL;
-		i = 0;
-		do {
-			lp = kmalloc(sizeof(*lp), GFP_KERNEL);
-			if ((unsigned long) lp >> 16
-			    != ((unsigned long)lp + sizeof(*lp) ) >> 16) {
-				/* FIXME, free the memory later */
-				kfree(lp);
-				lp = NULL;
-			}
-		} while (lp == NULL && i++ < 20);
-
-		if (lp == NULL) {
-			printk("%s: couldn't allocate memory for descriptors\n",
-			       dev->name);
-			goto out;
-		}
 
-		memset(lp, 0, sizeof(struct sonic_local));
-
-		/* get the virtual dma address */
-		lp->cda_laddr = vdma_alloc(CPHYSADDR(lp),sizeof(*lp));
-		if (lp->cda_laddr == ~0UL) {
-			printk("%s: couldn't get DMA page entry for "
-			       "descriptors\n", dev->name);
-			goto out1;
-		}
-
-		lp->tda_laddr = lp->cda_laddr + sizeof (lp->cda);
-		lp->rra_laddr = lp->tda_laddr + sizeof (lp->tda);
-		lp->rda_laddr = lp->rra_laddr + sizeof (lp->rra);
-	
-		/* allocate receive buffer area */
-		/* FIXME, maybe we should use skbs */
-		lp->rba = kmalloc(SONIC_NUM_RRS * SONIC_RBSIZE, GFP_KERNEL);
-		if (!lp->rba) {
-			printk("%s: couldn't allocate receive buffers\n",
-			       dev->name);
-			goto out2;
-		}
+	lp->dma_bitmode = SONIC_BITMODE32;
 
-		/* get virtual dma address */
-		lp->rba_laddr = vdma_alloc(CPHYSADDR(lp->rba),
-		                           SONIC_NUM_RRS * SONIC_RBSIZE);
-		if (lp->rba_laddr == ~0UL) {
-			printk("%s: couldn't get DMA page entry for receive "
-			       "buffers\n",dev->name);
-			goto out3;
-		}
-
-		/* now convert pointer to KSEG1 pointer */
-		lp->rba = (char *)KSEG1ADDR(lp->rba);
-		flush_cache_all();
-		dev->priv = (struct sonic_local *)KSEG1ADDR(lp);
+	/* Allocate the entire chunk of memory for the descriptors.
+           Note that this cannot cross a 64K boundary. */
+	if ((lp->descriptors = dma_alloc_coherent(lp->device,
+				SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode),
+				&lp->descriptors_laddr, GFP_KERNEL)) == NULL) {
+		printk(KERN_ERR "%s: couldn't alloc DMA memory for descriptors.\n", lp->device->bus_id);
+		goto out;
 	}
 
-	lp = (struct sonic_local *)dev->priv;
+	/* Now set up the pointers to point to the appropriate places */
+	lp->cda = lp->descriptors;
+	lp->tda = lp->cda + (SIZEOF_SONIC_CDA
+	                     * SONIC_BUS_SCALE(lp->dma_bitmode));
+	lp->rda = lp->tda + (SIZEOF_SONIC_TD * SONIC_NUM_TDS
+	                     * SONIC_BUS_SCALE(lp->dma_bitmode));
+	lp->rra = lp->rda + (SIZEOF_SONIC_RD * SONIC_NUM_RDS
+	                     * SONIC_BUS_SCALE(lp->dma_bitmode));
+
+	lp->cda_laddr = lp->descriptors_laddr;
+	lp->tda_laddr = lp->cda_laddr + (SIZEOF_SONIC_CDA
+	                     * SONIC_BUS_SCALE(lp->dma_bitmode));
+	lp->rda_laddr = lp->tda_laddr + (SIZEOF_SONIC_TD * SONIC_NUM_TDS
+	                     * SONIC_BUS_SCALE(lp->dma_bitmode));
+	lp->rra_laddr = lp->rda_laddr + (SIZEOF_SONIC_RD * SONIC_NUM_RDS
+	                     * SONIC_BUS_SCALE(lp->dma_bitmode));
+
 	dev->open = sonic_open;
 	dev->stop = sonic_close;
 	dev->hard_start_xmit = sonic_send_packet;
-	dev->get_stats	= sonic_get_stats;
+	dev->get_stats = sonic_get_stats;
 	dev->set_multicast_list = &sonic_multicast_list;
+	dev->tx_timeout = sonic_tx_timeout;
 	dev->watchdog_timeo = TX_TIMEOUT;
 
 	/*
@@ -226,14 +185,8 @@
 	SONIC_WRITE(SONIC_MPT,0xffff);
 
 	return 0;
-out3:
-	kfree(lp->rba);
-out2:
-	vdma_free(lp->cda_laddr);
-out1:
-	kfree(lp);
 out:
-	release_region(base_addr, SONIC_MEM_SIZE);
+	release_region(dev->base_addr, SONIC_MEM_SIZE);
 	return err;
 }
 
@@ -245,7 +198,6 @@
 {
 	struct net_device *dev;
 	struct sonic_local *lp;
-	unsigned long base_addr;
 	int err = 0;
 	int i;
 
@@ -255,21 +207,26 @@
 	if (mips_machgroup != MACH_GROUP_JAZZ)
 		return -ENODEV;
 
-	dev = alloc_etherdev(0);
+	dev = alloc_etherdev(sizeof(struct sonic_local));
 	if (!dev)
 		return -ENOMEM;
 
+	lp = netdev_priv(dev);
+	lp->device = device;
+	SET_NETDEV_DEV(dev, device);
+ 	SET_MODULE_OWNER(dev);
+
 	netdev_boot_setup_check(dev);
-	base_addr = dev->base_addr;
 
-	if (base_addr >= KSEG0)	{ /* Check a single specified location. */
-		err = sonic_probe1(dev, base_addr, dev->irq);
-	} else if (base_addr != 0) { /* Don't probe at all. */
+	if (dev->base_addr >= KSEG0) { /* Check a single specified location. */
+		err = sonic_probe1(dev);
+	} else if (dev->base_addr != 0) { /* Don't probe at all. */
 		err = -ENXIO;
 	} else {
 		for (i = 0; sonic_portlist[i].port; i++) {
-			int io = sonic_portlist[i].port;
-			if (sonic_probe1(dev, io, sonic_portlist[i].irq) == 0)
+			dev->base_addr = sonic_portlist[i].port;
+			dev->irq = sonic_portlist[i].irq;
+			if (sonic_probe1(dev) == 0)
 				break;
 		}
 		if (!sonic_portlist[i].port)
@@ -281,14 +238,17 @@
 	if (err)
 		goto out1;
 
+	printk("%s: MAC ", dev->name);
+	for (i = 0; i < 6; i++) {
+		printk("%2.2x", dev->dev_addr[i]);
+		if (i < 5)
+			printk(":");
+	}
+	printk(" IRQ %d\n", dev->irq);
+
 	return 0;
 
 out1:
-	lp = dev->priv;
-	vdma_free(lp->rba_laddr);
-	kfree(lp->rba);
-	vdma_free(lp->cda_laddr);
-	kfree(lp);
 	release_region(dev->base_addr, SONIC_MEM_SIZE);
 out:
 	free_netdev(dev);
@@ -296,21 +256,22 @@
 	return err;
 }
 
-/*
- *      SONIC uses a normal IRQ
- */
-#define sonic_request_irq       request_irq
-#define sonic_free_irq          free_irq
+MODULE_DESCRIPTION("Jazz SONIC ethernet driver");
+module_param(sonic_debug, int, 0);
+MODULE_PARM_DESC(sonic_debug, "jazzsonic debug level (1-4)");
 
-#define sonic_chiptomem(x)      KSEG1ADDR(vdma_log2phys(x))
+#define SONIC_IRQ_FLAG SA_INTERRUPT
 
 #include "sonic.c"
 
 static int __devexit jazz_sonic_device_remove (struct device *device)
 {
 	struct net_device *dev = device->driver_data;
+	struct sonic_local* lp = netdev_priv(dev);
 
 	unregister_netdev (dev);
+	dma_free_coherent(lp->device, SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode),
+	                  lp->descriptors, lp->descriptors_laddr);
 	release_region (dev->base_addr, SONIC_MEM_SIZE);
 	free_netdev (dev);
 
@@ -323,7 +284,7 @@
 	.probe	= jazz_sonic_probe,
 	.remove	= __devexit_p(jazz_sonic_device_remove),
 };
-                                                                                
+
 static void jazz_sonic_platform_release (struct device *device)
 {
 	struct platform_device *pldev;
@@ -336,10 +297,11 @@
 static int __init jazz_sonic_init_module(void)
 {
 	struct platform_device *pldev;
+	int err;
 
-	if (driver_register(&jazz_sonic_driver)) {
+	if ((err = driver_register(&jazz_sonic_driver))) {
 		printk(KERN_ERR "Driver registration failed\n");
-		return -ENOMEM;
+		return err;
 	}
 
 	jazz_sonic_device = NULL;
--- orig/drivers/net/macsonic.c	Sun Jul 10 22:11:34 2005
+++ linux/drivers/net/macsonic.c	Sun Jul 10 22:23:06 2005
@@ -1,6 +1,12 @@
 /*
  * macsonic.c
  *
+ * (C) 2005 Finn Thain
+ *
+ * Converted to DMA API, converted to unified driver model, made it work as
+ * a module again, and from the mac68k project, introduced more 32-bit cards
+ * and dhd's support for 16-bit cards.
+ *
  * (C) 1998 Alan Cox
  *
  * Debugging Andreas Ehliar, Michael Schmitz
@@ -26,8 +32,8 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/types.h>
-#include <linux/ctype.h>
 #include <linux/fcntl.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
@@ -41,8 +47,8 @@
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
-#include <linux/module.h>
-#include <linux/bitops.h>
+#include <linux/device.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/bootinfo.h>
 #include <asm/system.h>
@@ -54,25 +60,28 @@
 #include <asm/macints.h>
 #include <asm/mac_via.h>
 
-#define SREGS_PAD(n)    u16 n;
+static char mac_sonic_string[] = "macsonic";
+static struct platform_device *mac_sonic_device;
 
 #include "sonic.h"
 
-#define SONIC_READ(reg) \
-	nubus_readl(base_addr+(reg))
-#define SONIC_WRITE(reg,val) \
-	nubus_writel((val), base_addr+(reg))
-#define sonic_read(dev, reg) \
-	nubus_readl((dev)->base_addr+(reg))
-#define sonic_write(dev, reg, val) \
-	nubus_writel((val), (dev)->base_addr+(reg))
-
+/* These should basically be bus-size and endian independent (since
+   the SONIC is at least smart enough that it uses the same endianness
+   as the host, unlike certain less enlightened Macintosh NICs) */
+#define SONIC_READ(reg) (nubus_readw(dev->base_addr + (reg * 4) \
+	      + lp->reg_offset))
+#define SONIC_WRITE(reg,val) (nubus_writew(val, dev->base_addr + (reg * 4) \
+	      + lp->reg_offset))
+
+/* use 0 for production, 1 for verification, >1 for debug */
+#ifdef SONIC_DEBUG
+static unsigned int sonic_debug = SONIC_DEBUG;
+#else 
+static unsigned int sonic_debug = 1;
+#endif
 
-static int sonic_debug;
 static int sonic_version_printed;
 
-static int reg_offset;
-
 extern int mac_onboard_sonic_probe(struct net_device* dev);
 extern int mac_nubus_sonic_probe(struct net_device* dev);
 
@@ -108,40 +117,6 @@
 
 #define SONIC_READ_PROM(addr) nubus_readb(prom_addr+addr)
 
-struct net_device * __init macsonic_probe(int unit)
-{
-	struct net_device *dev = alloc_etherdev(0);
-	int err;
-
-	if (!dev)
-		return ERR_PTR(-ENOMEM);
-
-	if (unit >= 0)
-		sprintf(dev->name, "eth%d", unit);
-
- 	SET_MODULE_OWNER(dev);
-
-	/* This will catch fatal stuff like -ENOMEM as well as success */
-	err = mac_onboard_sonic_probe(dev);
-	if (err == 0)
-		goto found;
-	if (err != -ENODEV)
-		goto out;
-	err = mac_nubus_sonic_probe(dev);
-	if (err)
-		goto out;
-found:
-	err = register_netdev(dev);
-	if (err)
-		goto out1;
-	return dev;
-out1:
-	kfree(dev->priv);
-out:
-	free_netdev(dev);
-	return ERR_PTR(err);
-}
-
 /*
  * For reversing the PROM address
  */
@@ -160,103 +135,55 @@
 
 int __init macsonic_init(struct net_device* dev)
 {
-	struct sonic_local* lp = NULL;
-	int i;
+	struct sonic_local* lp = netdev_priv(dev);
 
 	/* Allocate the entire chunk of memory for the descriptors.
            Note that this cannot cross a 64K boundary. */
-	for (i = 0; i < 20; i++) {
-		unsigned long desc_base, desc_top;
-		if((lp = kmalloc(sizeof(struct sonic_local), GFP_KERNEL | GFP_DMA)) == NULL) {
-			printk(KERN_ERR "%s: couldn't allocate descriptor buffers\n", dev->name);
-			return -ENOMEM;
-		}
-
-		desc_base = (unsigned long) lp;
-		desc_top = desc_base + sizeof(struct sonic_local);
-		if ((desc_top & 0xffff) >= (desc_base & 0xffff))
-			break;
-		/* Hmm. try again (FIXME: does this actually work?) */
-		kfree(lp);
-		printk(KERN_DEBUG
-		       "%s: didn't get continguous chunk [%08lx - %08lx], trying again\n",
-		       dev->name, desc_base, desc_top);
-	}
-
-	if (lp == NULL) {
-		printk(KERN_ERR "%s: tried 20 times to allocate descriptor buffers, giving up.\n",
-		       dev->name);
+	if ((lp->descriptors = dma_alloc_coherent(lp->device,
+	            SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode),
+	            &lp->descriptors_laddr, GFP_KERNEL)) == NULL) {
+		printk(KERN_ERR "%s: couldn't alloc DMA memory for descriptors.\n", lp->device->bus_id);
 		return -ENOMEM;
-	}		       
-
-	dev->priv = lp;
-
-#if 0
-	/* this code is only here as a curiousity...   mainly, where the 
-	   fuck did SONIC_BUS_SCALE come from, and what was it supposed
-	   to do?  the normal allocation works great for 32 bit stuffs..  */
+	}
 
 	/* Now set up the pointers to point to the appropriate places */
-	lp->cda = lp->sonic_desc;
-	lp->tda = lp->cda + (SIZEOF_SONIC_CDA * SONIC_BUS_SCALE(lp->dma_bitmode));
+	lp->cda = lp->descriptors;
+	lp->tda = lp->cda + (SIZEOF_SONIC_CDA
+	                     * SONIC_BUS_SCALE(lp->dma_bitmode));
 	lp->rda = lp->tda + (SIZEOF_SONIC_TD * SONIC_NUM_TDS
-			     * SONIC_BUS_SCALE(lp->dma_bitmode));
+	                     * SONIC_BUS_SCALE(lp->dma_bitmode));
 	lp->rra = lp->rda + (SIZEOF_SONIC_RD * SONIC_NUM_RDS
-			     * SONIC_BUS_SCALE(lp->dma_bitmode));
+	                     * SONIC_BUS_SCALE(lp->dma_bitmode));
 
-#endif
-	
-	memset(lp, 0, sizeof(struct sonic_local));
-
-	lp->cda_laddr = (unsigned int)&(lp->cda);
-	lp->tda_laddr = (unsigned int)lp->tda;
-	lp->rra_laddr = (unsigned int)lp->rra;
-	lp->rda_laddr = (unsigned int)lp->rda;
-
-	/* FIXME, maybe we should use skbs */
-	if ((lp->rba = (char *)
-	     kmalloc(SONIC_NUM_RRS * SONIC_RBSIZE, GFP_KERNEL | GFP_DMA)) == NULL) {
-		printk(KERN_ERR "%s: couldn't allocate receive buffers\n", dev->name);
-		dev->priv = NULL;
-		kfree(lp);
-		return -ENOMEM;
-	}
-
-	lp->rba_laddr = (unsigned int)lp->rba;
-
-	{
-		int rs, ds;
-
-		/* almost always 12*4096, but let's not take chances */
-		rs = ((SONIC_NUM_RRS * SONIC_RBSIZE + 4095) / 4096) * 4096;
-		/* almost always under a page, but let's not take chances */
-		ds = ((sizeof(struct sonic_local) + 4095) / 4096) * 4096;
-		kernel_set_cachemode(lp->rba, rs, IOMAP_NOCACHE_SER);
-		kernel_set_cachemode(lp, ds, IOMAP_NOCACHE_SER);
-	}
-	
-#if 0
-	flush_cache_all();
-#endif
+	lp->cda_laddr = lp->descriptors_laddr;
+	lp->tda_laddr = lp->cda_laddr + (SIZEOF_SONIC_CDA
+	                     * SONIC_BUS_SCALE(lp->dma_bitmode));
+	lp->rda_laddr = lp->tda_laddr + (SIZEOF_SONIC_TD * SONIC_NUM_TDS
+	                     * SONIC_BUS_SCALE(lp->dma_bitmode));
+	lp->rra_laddr = lp->rda_laddr + (SIZEOF_SONIC_RD * SONIC_NUM_RDS
+	                     * SONIC_BUS_SCALE(lp->dma_bitmode));
 
 	dev->open = sonic_open;
 	dev->stop = sonic_close;
 	dev->hard_start_xmit = sonic_send_packet;
 	dev->get_stats = sonic_get_stats;
 	dev->set_multicast_list = &sonic_multicast_list;
+	dev->tx_timeout = sonic_tx_timeout;
+	dev->watchdog_timeo = TX_TIMEOUT;
 
 	/*
 	 * clear tally counter
 	 */
-	sonic_write(dev, SONIC_CRCT, 0xffff);
-	sonic_write(dev, SONIC_FAET, 0xffff);
-	sonic_write(dev, SONIC_MPT, 0xffff);
+	SONIC_WRITE(SONIC_CRCT, 0xffff);
+	SONIC_WRITE(SONIC_FAET, 0xffff);
+	SONIC_WRITE(SONIC_MPT, 0xffff);
 
 	return 0;
 }
 
 int __init mac_onboard_sonic_ethernet_addr(struct net_device* dev)
 {
+	struct sonic_local *lp = netdev_priv(dev);
 	const int prom_addr = ONBOARD_SONIC_PROM_BASE;
 	int i;
 
@@ -270,6 +197,7 @@
 	   why this is so. */
 	if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) &&
 	    memcmp(dev->dev_addr, "\x00\xA0\x40", 3) &&
+	    memcmp(dev->dev_addr, "\x00\x80\x19", 3) &&
 	    memcmp(dev->dev_addr, "\x00\x05\x02", 3))
 		bit_reverse_addr(dev->dev_addr);
 	else
@@ -281,22 +209,23 @@
            the card... */
 	if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) &&
 	    memcmp(dev->dev_addr, "\x00\xA0\x40", 3) &&
+	    memcmp(dev->dev_addr, "\x00\x80\x19", 3) &&
 	    memcmp(dev->dev_addr, "\x00\x05\x02", 3))
 	{
 		unsigned short val;
 
 		printk(KERN_INFO "macsonic: PROM seems to be wrong, trying CAM entry 15\n");
 		
-		sonic_write(dev, SONIC_CMD, SONIC_CR_RST);
-		sonic_write(dev, SONIC_CEP, 15);
+		SONIC_WRITE(SONIC_CMD, SONIC_CR_RST);
+		SONIC_WRITE(SONIC_CEP, 15);
 
-		val = sonic_read(dev, SONIC_CAP2);
+		val = SONIC_READ(SONIC_CAP2);
 		dev->dev_addr[5] = val >> 8;
 		dev->dev_addr[4] = val & 0xff;
-		val = sonic_read(dev, SONIC_CAP1);
+		val = SONIC_READ(SONIC_CAP1);
 		dev->dev_addr[3] = val >> 8;
 		dev->dev_addr[2] = val & 0xff;
-		val = sonic_read(dev, SONIC_CAP0);
+		val = SONIC_READ(SONIC_CAP0);
 		dev->dev_addr[1] = val >> 8;
 		dev->dev_addr[0] = val & 0xff;
 		
@@ -311,6 +240,7 @@
 
 	if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) &&
 	    memcmp(dev->dev_addr, "\x00\xA0\x40", 3) &&
+	    memcmp(dev->dev_addr, "\x00\x80\x19", 3) &&
 	    memcmp(dev->dev_addr, "\x00\x05\x02", 3))
 	{
 		/*
@@ -325,8 +255,9 @@
 {
 	/* Bwahahaha */
 	static int once_is_more_than_enough;
-	int i;
-	int dma_bitmode;
+	struct sonic_local* lp = netdev_priv(dev);
+	int sr;
+	int commslot = 0;
 	
 	if (once_is_more_than_enough)
 		return -ENODEV;
@@ -335,20 +266,18 @@
 	if (!MACH_IS_MAC)
 		return -ENODEV;
 
-	printk(KERN_INFO "Checking for internal Macintosh ethernet (SONIC).. ");
-
 	if (macintosh_config->ether_type != MAC_ETHER_SONIC)
-	{
-		printk("none.\n");
 		return -ENODEV;
-	}
-
+	
+	printk(KERN_INFO "Checking for internal Macintosh ethernet (SONIC).. ");
+	
 	/* Bogus probing, on the models which may or may not have
 	   Ethernet (BTW, the Ethernet *is* always at the same
 	   address, and nothing else lives there, at least if Apple's
 	   documentation is to be believed) */
 	if (macintosh_config->ident == MAC_MODEL_Q630 ||
 	    macintosh_config->ident == MAC_MODEL_P588 ||
+	    macintosh_config->ident == MAC_MODEL_P575 ||
 	    macintosh_config->ident == MAC_MODEL_C610) {
 		unsigned long flags;
 		int card_present;
@@ -361,13 +290,13 @@
 			printk("none.\n");
 			return -ENODEV;
 		}
+		commslot = 1;
 	}
 
 	printk("yes\n");	
 
-	/* Danger!  My arms are flailing wildly!  You *must* set this
-           before using sonic_read() */
-
+	/* Danger!  My arms are flailing wildly!  You *must* set lp->reg_offset
+	 * and dev->base_addr before using SONIC_READ() or SONIC_WRITE() */
 	dev->base_addr = ONBOARD_SONIC_REGISTERS;
 	if (via_alt_mapping)
 		dev->irq = IRQ_AUTO_3;
@@ -379,84 +308,66 @@
 		sonic_version_printed = 1;
 	}
 	printk(KERN_INFO "%s: onboard / comm-slot SONIC at 0x%08lx\n",
-	       dev->name, dev->base_addr);
-
-	/* Now do a song and dance routine in an attempt to determine
-           the bus width */
+	       lp->device->bus_id, dev->base_addr);
 
 	/* The PowerBook's SONIC is 16 bit always. */
 	if (macintosh_config->ident == MAC_MODEL_PB520) {
-		reg_offset = 0;
-		dma_bitmode = 0;
-	} else if (macintosh_config->ident == MAC_MODEL_C610) {
-		reg_offset = 0;
-		dma_bitmode = 1;
-	} else {
+		lp->reg_offset = 0;
+		lp->dma_bitmode = SONIC_BITMODE16;
+		sr = SONIC_READ(SONIC_SR);
+	} else if (commslot) {
 		/* Some of the comm-slot cards are 16 bit.  But some
-                   of them are not.  The 32-bit cards use offset 2 and
-                   pad with zeroes or sometimes ones (I think...)
-                   Therefore, if we try offset 0 and get a silicon
-                   revision of 0, we assume 16 bit. */
-		int sr;
-
-		/* Technically this is not necessary since we zeroed
-                   it above */
-		reg_offset = 0;
-		dma_bitmode = 0;
-		sr = sonic_read(dev, SONIC_SR);
-		if (sr == 0 || sr == 0xffff) {
-			reg_offset = 2;
-			/* 83932 is 0x0004, 83934 is 0x0100 or 0x0101 */
-			sr = sonic_read(dev, SONIC_SR);
-			dma_bitmode = 1;
-			
+		   of them are not.  The 32-bit cards use offset 2 and
+		   have known revisions, we try reading the revision
+		   register at offset 2, if we don't get a known revision
+		   we assume 16 bit at offset 0.  */
+		lp->reg_offset = 2;
+		lp->dma_bitmode = SONIC_BITMODE16;
+
+		sr = SONIC_READ(SONIC_SR);
+		if (sr == 0x0004 || sr == 0x0006 || sr == 0x0100 || sr == 0x0101) 
+			/* 83932 is 0x0004 or 0x0006, 83934 is 0x0100 or 0x0101 */
+			lp->dma_bitmode = SONIC_BITMODE32;
+		else {
+			lp->dma_bitmode = SONIC_BITMODE16;
+			lp->reg_offset = 0;
+			sr = SONIC_READ(SONIC_SR);
 		}
-		printk(KERN_INFO
-		       "%s: revision 0x%04x, using %d bit DMA and register offset %d\n",
-		       dev->name, sr, dma_bitmode?32:16, reg_offset);
-	}
-	
+	} else {
+		/* All onboard cards are at offset 2 with 32 bit DMA. */
+		lp->reg_offset = 2;
+		lp->dma_bitmode = SONIC_BITMODE32;
+		sr = SONIC_READ(SONIC_SR);
+	}
+	printk(KERN_INFO
+	       "%s: revision 0x%04x, using %d bit DMA and register offset %d\n",
+	       lp->device->bus_id, sr, lp->dma_bitmode?32:16, lp->reg_offset);
+
+#if 0 /* This is sometimes useful to find out how MacOS configured the card. */
+	printk(KERN_INFO "%s: DCR: 0x%04x, DCR2: 0x%04x\n", lp->device->bus_id,
+	       SONIC_READ(SONIC_DCR) & 0xffff, SONIC_READ(SONIC_DCR2) & 0xffff);
+#endif
 
-	/* this carries my sincere apologies -- by the time I got to updating
-	   the driver, support for "reg_offsets" appeares nowhere in the sonic
-	   code, going back for over a year.  Fortunately, my Mac does't seem
-	   to use whatever this was.
-
-	   If you know how this is supposed to be implemented, either fix it,
-	   or contact me (sammy@oh.verio.com) to explain what it is. --Sam */
-	   
-	if(reg_offset) {
-		printk("%s: register offset unsupported.  please fix this if you know what it is.\n", dev->name);
-		return -ENODEV;
-	}
-	
 	/* Software reset, then initialize control registers. */
-	sonic_write(dev, SONIC_CMD, SONIC_CR_RST);
-	sonic_write(dev, SONIC_DCR, SONIC_DCR_BMS |
-		    SONIC_DCR_RFT1 | SONIC_DCR_TFT0 | SONIC_DCR_EXBUS |
-		    (dma_bitmode ? SONIC_DCR_DW : 0));
+	SONIC_WRITE(SONIC_CMD, SONIC_CR_RST);
+
+	SONIC_WRITE(SONIC_DCR, SONIC_DCR_EXBUS | SONIC_DCR_BMS |
+	                       SONIC_DCR_RFT1  | SONIC_DCR_TFT0 |
+	                       (lp->dma_bitmode ? SONIC_DCR_DW : 0));
 
 	/* This *must* be written back to in order to restore the
-           extended programmable output bits */
-	sonic_write(dev, SONIC_DCR2, 0);
+	 * extended programmable output bits, as it may not have been
+	 * initialised since the hardware reset. */
+	SONIC_WRITE(SONIC_DCR2, 0);
 
 	/* Clear *and* disable interrupts to be on the safe side */
-	sonic_write(dev, SONIC_ISR,0x7fff);
-	sonic_write(dev, SONIC_IMR,0);
+	SONIC_WRITE(SONIC_IMR, 0);
+	SONIC_WRITE(SONIC_ISR, 0x7fff);
 
 	/* Now look for the MAC address. */
 	if (mac_onboard_sonic_ethernet_addr(dev) != 0)
 		return -ENODEV;
 
-	printk(KERN_INFO "MAC ");
-	for (i = 0; i < 6; i++) {
-		printk("%2.2x", dev->dev_addr[i]);
-		if (i < 5)
-			printk(":");
-	}
-
-	printk(" IRQ %d\n", dev->irq);
-
 	/* Shared init code */
 	return macsonic_init(dev);
 }
@@ -468,8 +379,10 @@
 	int i;
 	for(i = 0; i < 6; i++)
 		dev->dev_addr[i] = SONIC_READ_PROM(i);
-	/* For now we are going to assume that they're all bit-reversed */
-	bit_reverse_addr(dev->dev_addr);
+
+	/* Some of the addresses are bit-reversed */
+	if (id != MACSONIC_DAYNA)
+		bit_reverse_addr(dev->dev_addr);
 
 	return 0;
 }
@@ -487,6 +400,15 @@
 		else
 			return MACSONIC_APPLE;
 	}
+	
+	if (ndev->dr_hw == NUBUS_DRHW_SMC9194 &&
+	    ndev->dr_sw == NUBUS_DRSW_DAYNA)
+		return MACSONIC_DAYNA;
+	
+	if (ndev->dr_hw == NUBUS_DRHW_SONIC_LC &&
+	    ndev->dr_sw == 0) { /* huh? */
+		return MACSONIC_APPLE16;
+	}
 	return -1;
 }
 
@@ -494,12 +416,12 @@
 {
 	static int slots;
 	struct nubus_dev* ndev = NULL;
+	struct sonic_local* lp = netdev_priv(dev);
 	unsigned long base_addr, prom_addr;
 	u16 sonic_dcr;
-	int id;
-	int i;
-	int dma_bitmode;
-
+	int id = -1;
+	int reg_offset, dma_bitmode;
+	
 	/* Find the first SONIC that hasn't been initialized already */
 	while ((ndev = nubus_find_type(NUBUS_CAT_NETWORK,
 				       NUBUS_TYPE_ETHERNET, ndev)) != NULL)
@@ -521,51 +443,52 @@
 	case MACSONIC_DUODOCK:
 		base_addr = ndev->board->slot_addr + DUODOCK_SONIC_REGISTERS;
 		prom_addr = ndev->board->slot_addr + DUODOCK_SONIC_PROM_BASE;
-		sonic_dcr = SONIC_DCR_EXBUS | SONIC_DCR_RFT0 | SONIC_DCR_RFT1
-			| SONIC_DCR_TFT0;
+		sonic_dcr = SONIC_DCR_EXBUS | SONIC_DCR_RFT0 | SONIC_DCR_RFT1 |
+		            SONIC_DCR_TFT0;
 		reg_offset = 2;
-		dma_bitmode = 1;
+		dma_bitmode = SONIC_BITMODE32;
 		break;
 	case MACSONIC_APPLE:
 		base_addr = ndev->board->slot_addr + APPLE_SONIC_REGISTERS;
 		prom_addr = ndev->board->slot_addr + APPLE_SONIC_PROM_BASE;
 		sonic_dcr = SONIC_DCR_BMS | SONIC_DCR_RFT1 | SONIC_DCR_TFT0;
 		reg_offset = 0;
-		dma_bitmode = 1;
+		dma_bitmode = SONIC_BITMODE32;
 		break;
 	case MACSONIC_APPLE16:
 		base_addr = ndev->board->slot_addr + APPLE_SONIC_REGISTERS;
 		prom_addr = ndev->board->slot_addr + APPLE_SONIC_PROM_BASE;
-		sonic_dcr = SONIC_DCR_EXBUS
- 			| SONIC_DCR_RFT1 | SONIC_DCR_TFT0
-			| SONIC_DCR_PO1 | SONIC_DCR_BMS; 
+		sonic_dcr = SONIC_DCR_EXBUS | SONIC_DCR_RFT1 | SONIC_DCR_TFT0 |
+		            SONIC_DCR_PO1 | SONIC_DCR_BMS; 
 		reg_offset = 0;
-		dma_bitmode = 0;
+		dma_bitmode = SONIC_BITMODE16;
 		break;
 	case MACSONIC_DAYNALINK:
 		base_addr = ndev->board->slot_addr + APPLE_SONIC_REGISTERS;
 		prom_addr = ndev->board->slot_addr + DAYNALINK_PROM_BASE;
-		sonic_dcr = SONIC_DCR_RFT1 | SONIC_DCR_TFT0
-			| SONIC_DCR_PO1 | SONIC_DCR_BMS; 
+		sonic_dcr = SONIC_DCR_RFT1 | SONIC_DCR_TFT0 |
+		            SONIC_DCR_PO1 | SONIC_DCR_BMS; 
 		reg_offset = 0;
-		dma_bitmode = 0;
+		dma_bitmode = SONIC_BITMODE16;
 		break;
 	case MACSONIC_DAYNA:
 		base_addr = ndev->board->slot_addr + DAYNA_SONIC_REGISTERS;
 		prom_addr = ndev->board->slot_addr + DAYNA_SONIC_MAC_ADDR;
-		sonic_dcr = SONIC_DCR_BMS
-			| SONIC_DCR_RFT1 | SONIC_DCR_TFT0 | SONIC_DCR_PO1;
+		sonic_dcr = SONIC_DCR_BMS |
+		            SONIC_DCR_RFT1 | SONIC_DCR_TFT0 | SONIC_DCR_PO1;
 		reg_offset = 0;
-		dma_bitmode = 0;
+		dma_bitmode = SONIC_BITMODE16;
 		break;
 	default:
 		printk(KERN_ERR "macsonic: WTF, id is %d\n", id);
 		return -ENODEV;
 	}
 
-	/* Danger!  My arms are flailing wildly!  You *must* set this
-           before using sonic_read() */
+	/* Danger!  My arms are flailing wildly!  You *must* set lp->reg_offset
+	 * and dev->base_addr before using SONIC_READ() or SONIC_WRITE() */
 	dev->base_addr = base_addr;
+	lp->reg_offset = reg_offset;
+	lp->dma_bitmode = dma_bitmode;
 	dev->irq = SLOT2IRQ(ndev->board->slot);
 
 	if (!sonic_version_printed) {
@@ -573,29 +496,66 @@
 		sonic_version_printed = 1;
 	}
 	printk(KERN_INFO "%s: %s in slot %X\n",
-	       dev->name, ndev->board->name, ndev->board->slot);
+	       lp->device->bus_id, ndev->board->name, ndev->board->slot);
 	printk(KERN_INFO "%s: revision 0x%04x, using %d bit DMA and register offset %d\n",
-	       dev->name, sonic_read(dev, SONIC_SR), dma_bitmode?32:16, reg_offset);
+	       lp->device->bus_id, SONIC_READ(SONIC_SR), dma_bitmode?32:16, reg_offset);
 
-	if(reg_offset) {
-		printk("%s: register offset unsupported.  please fix this if you know what it is.\n", dev->name);
-		return -ENODEV;
-	}
+#if 0 /* This is sometimes useful to find out how MacOS configured the card. */
+	printk(KERN_INFO "%s: DCR: 0x%04x, DCR2: 0x%04x\n", lp->device->bus_id,
+	       SONIC_READ(SONIC_DCR) & 0xffff, SONIC_READ(SONIC_DCR2) & 0xffff);
+#endif
 
 	/* Software reset, then initialize control registers. */
-	sonic_write(dev, SONIC_CMD, SONIC_CR_RST);
-	sonic_write(dev, SONIC_DCR, sonic_dcr
-		    | (dma_bitmode ? SONIC_DCR_DW : 0));
+	SONIC_WRITE(SONIC_CMD, SONIC_CR_RST);
+	SONIC_WRITE(SONIC_DCR, sonic_dcr | (dma_bitmode ? SONIC_DCR_DW : 0));
+	/* This *must* be written back to in order to restore the
+	 * extended programmable output bits, since it may not have been
+	 * initialised since the hardware reset. */
+	SONIC_WRITE(SONIC_DCR2, 0);
 
 	/* Clear *and* disable interrupts to be on the safe side */
-	sonic_write(dev, SONIC_ISR,0x7fff);
-	sonic_write(dev, SONIC_IMR,0);
+	SONIC_WRITE(SONIC_IMR, 0);
+	SONIC_WRITE(SONIC_ISR, 0x7fff);
 
 	/* Now look for the MAC address. */
 	if (mac_nubus_sonic_ethernet_addr(dev, prom_addr, id) != 0)
 		return -ENODEV;
 
-	printk(KERN_INFO "MAC ");
+	/* Shared init code */
+	return macsonic_init(dev);
+}
+
+static int __init mac_sonic_probe(struct device *device)
+{
+	struct net_device *dev;
+	struct sonic_local *lp;
+	int err;
+	int i;
+
+	dev = alloc_etherdev(sizeof(struct sonic_local));
+	if (!dev)
+		return -ENOMEM;
+
+	lp = netdev_priv(dev);
+	lp->device = device;
+	SET_NETDEV_DEV(dev, device);
+ 	SET_MODULE_OWNER(dev);
+
+	/* This will catch fatal stuff like -ENOMEM as well as success */
+	err = mac_onboard_sonic_probe(dev);
+	if (err == 0)
+		goto found;
+	if (err != -ENODEV)
+		goto out;
+	err = mac_nubus_sonic_probe(dev);
+	if (err)
+		goto out;
+found:
+	err = register_netdev(dev);
+	if (err)
+		goto out;
+
+	printk("%s: MAC ", dev->name);
 	for (i = 0; i < 6; i++) {
 		printk("%2.2x", dev->dev_addr[i]);
 		if (i < 5)
@@ -603,55 +563,95 @@
 	}
 	printk(" IRQ %d\n", dev->irq);
 
-	/* Shared init code */
-	return macsonic_init(dev);
-}
+	return 0;
 
-#ifdef MODULE
-static struct net_device *dev_macsonic;
+out:
+	free_netdev(dev);
+
+	return err;
+}
 
-MODULE_PARM(sonic_debug, "i");
+MODULE_DESCRIPTION("Macintosh SONIC ethernet driver");
+module_param(sonic_debug, int, 0);
 MODULE_PARM_DESC(sonic_debug, "macsonic debug level (1-4)");
 
-int
-init_module(void)
+#define SONIC_IRQ_FLAG IRQ_FLG_FAST
+
+#include "sonic.c"
+
+static int __devexit mac_sonic_device_remove (struct device *device)
 {
-        dev_macsonic = macsonic_probe(-1);
-	if (IS_ERR(dev_macsonic)) {
-                printk(KERN_WARNING "macsonic.c: No card found\n");
-		return PTR_ERR(dev_macsonic);
-	}
+	struct net_device *dev = device->driver_data;
+	struct sonic_local* lp = netdev_priv(dev);
+
+	unregister_netdev (dev);
+	dma_free_coherent(lp->device, SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode),
+	                  lp->descriptors, lp->descriptors_laddr);
+	free_netdev (dev);
+
 	return 0;
 }
 
-void
-cleanup_module(void)
+static struct device_driver mac_sonic_driver = {
+	.name   = mac_sonic_string,
+	.bus    = &platform_bus_type,
+	.probe  = mac_sonic_probe,
+	.remove = __devexit_p(mac_sonic_device_remove),
+};
+
+static void mac_sonic_platform_release(struct device *device)
 {
-	unregister_netdev(dev_macsonic);
-	kfree(dev_macsonic->priv);
-	free_netdev(dev_macsonic);
+	struct platform_device *pldev;
+
+	/* free device */
+	pldev = to_platform_device (device);
+	kfree (pldev);
 }
-#endif /* MODULE */
 
+static int __init mac_sonic_init_module(void)
+{
+	struct platform_device *pldev;
+	int err;
+
+	if ((err = driver_register(&mac_sonic_driver))) {
+		printk(KERN_ERR "Driver registration failed\n");
+		return err;
+	}
 
-#define vdma_alloc(foo, bar) ((u32)foo)
-#define vdma_free(baz)
-#define sonic_chiptomem(bat) (bat)
-#define PHYSADDR(quux) (quux)
-#define CPHYSADDR(quux) (quux)
+	mac_sonic_device = NULL;
 
-#define sonic_request_irq       request_irq
-#define sonic_free_irq          free_irq
+	if (!(pldev = kmalloc (sizeof (*pldev), GFP_KERNEL))) {
+		goto out_unregister;
+	}
 
-#include "sonic.c"
+	memset(pldev, 0, sizeof (*pldev));
+	pldev->name		= mac_sonic_string;
+	pldev->id		= 0;
+	pldev->dev.release	= mac_sonic_platform_release;
+	mac_sonic_device	= pldev;
 
-/*
- * Local variables:
- *  compile-command: "m68k-linux-gcc -D__KERNEL__ -I../../include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -ffixed-a2 -DMODULE -DMODVERSIONS -include ../../include/linux/modversions.h   -c -o macsonic.o macsonic.c"
- *  version-control: t
- *  kept-new-versions: 5
- *  c-indent-level: 8
- *  tab-width: 8
- * End:
- *
- */
+	if (platform_device_register (pldev)) {
+		kfree(pldev);
+		mac_sonic_device = NULL;
+	}
+
+	return 0;
+
+out_unregister:
+	platform_device_unregister(pldev);
+
+	return -ENOMEM;
+}
+
+static void __exit mac_sonic_cleanup_module(void)
+{
+	driver_unregister(&mac_sonic_driver);
+
+	if (mac_sonic_device) {
+		platform_device_unregister(mac_sonic_device);
+		mac_sonic_device = NULL;
+	}
+}
+
+module_init(mac_sonic_init_module);
+module_exit(mac_sonic_cleanup_module);
--- orig/drivers/net/sonic.c	Sun Jul 10 22:11:34 2005
+++ linux/drivers/net/sonic.c	Sun Jul 10 22:26:14 2005
@@ -1,6 +1,11 @@
 /*
  * sonic.c
  *
+ * (C) 2005 Finn Thain
+ *
+ * Converted to DMA API, added zero-copy buffer handling, and
+ * (from the mac68k project) introduced dhd's support for 16-bit cards.
+ *
  * (C) 1996,1998 by Thomas Bogendoerfer (tsbogend@alpha.franken.de)
  * 
  * This driver is based on work from Andreas Busse, but most of
@@ -9,12 +14,23 @@
  * (C) 1995 by Andreas Busse (andy@waldorf-gmbh.de)
  *
  *    Core code included by system sonic drivers
+ *
+ * And... partially rewritten again by David Huggins-Daines in order
+ * to cope with screwed up Macintosh NICs that may or may not use
+ * 16-bit DMA.
+ *
+ * (C) 1999 David Huggins-Daines <dhd@debian.org>
+ *
  */
 
 /*
  * Sources: Olivetti M700-10 Risc Personal Computer hardware handbook,
  * National Semiconductors data sheet for the DP83932B Sonic Ethernet
  * controller, and the files "8390.c" and "skeleton.c" in this directory.
+ *
+ * Additional sources: Nat Semi data sheet for the DP83932C and Nat Semi
+ * Application Note AN-746, the files "lance.c" and "ibmlana.c". See also
+ * the NetBSD file "sys/arch/mac68k/dev/if_sn.c".
  */
 
 
@@ -28,6 +44,9 @@
  */
 static int sonic_open(struct net_device *dev)
 {
+	struct sonic_local *lp = netdev_priv(dev);
+	int i;
+	
 	if (sonic_debug > 2)
 		printk("sonic_open: initializing sonic driver.\n");
 
@@ -40,14 +59,59 @@
  * This means that during execution of the handler interrupt are disabled
  * covering another bug otherwise corrupting data.  This doesn't mean
  * this glue works ok under all situations.
+ *
+ * Note (dhd): this also appears to prevent lockups on the Macintrash
+ * when more than one Ethernet card is installed (knock on wood)
+ *
+ * Note (fthain): whether the above is still true is anyones guess. Certainly
+ * the buffer handling algorithms will not tolerate re-entrance without some
+ * mutual exclusion added. Anyway, the memcpy has now been eliminated from the
+ * rx code to make this a faster "fast interrupt".
  */
-//    if (sonic_request_irq(dev->irq, &sonic_interrupt, 0, "sonic", dev)) {
-	if (sonic_request_irq(dev->irq, &sonic_interrupt, SA_INTERRUPT,
-	                      "sonic", dev)) {
-		printk("\n%s: unable to get IRQ %d .\n", dev->name, dev->irq);
+	if (request_irq(dev->irq, &sonic_interrupt, SONIC_IRQ_FLAG, "sonic", dev)) {
+		printk(KERN_ERR "\n%s: unable to get IRQ %d .\n", dev->name, dev->irq);
 		return -EAGAIN;
 	}
 
+	for (i = 0; i < SONIC_NUM_RRS; i++) {
+		struct sk_buff *skb = dev_alloc_skb(SONIC_RBSIZE + 2);
+		if (skb == NULL) {
+			while(i > 0) { /* free any that were allocated successfully */
+				i--;
+				dev_kfree_skb(lp->rx_skb[i]);
+				lp->rx_skb[i] = NULL;
+			}
+			printk(KERN_ERR "%s: couldn't allocate receive buffers\n",
+			       dev->name);
+			return -ENOMEM;
+		}
+		skb->dev = dev;
+		/* align IP header unless DMA requires otherwise */
+		if (SONIC_BUS_SCALE(lp->dma_bitmode) == 2)
+			skb_reserve(skb, 2);
+		lp->rx_skb[i] = skb;
+	}
+
+	for (i = 0; i < SONIC_NUM_RRS; i++) {
+		dma_addr_t laddr = dma_map_single(lp->device, skb_put(lp->rx_skb[i], SONIC_RBSIZE),
+		                                  SONIC_RBSIZE, DMA_FROM_DEVICE);
+		if (!laddr) {
+			while(i > 0) { /* free any that were mapped successfully */
+				i--;
+				dma_unmap_single(lp->device, lp->rx_laddr[i], SONIC_RBSIZE, DMA_FROM_DEVICE);
+				lp->rx_laddr[i] = (dma_addr_t)0;
+			}
+			for (i = 0; i < SONIC_NUM_RRS; i++) {
+				dev_kfree_skb(lp->rx_skb[i]);
+				lp->rx_skb[i] = NULL;
+			}
+			printk(KERN_ERR "%s: couldn't map rx DMA buffers\n",
+			       dev->name);
+			return -ENOMEM;
+		}
+		lp->rx_laddr[i] = laddr;
+	}
+
 	/*
 	 * Initialize the SONIC
 	 */
@@ -67,7 +131,8 @@
  */
 static int sonic_close(struct net_device *dev)
 {
-	unsigned int base_addr = dev->base_addr;
+	struct sonic_local *lp = netdev_priv(dev);
+	int i;
 
 	if (sonic_debug > 2)
 		printk("sonic_close\n");
@@ -77,20 +142,56 @@
 	/*
 	 * stop the SONIC, disable interrupts
 	 */
-	SONIC_WRITE(SONIC_ISR, 0x7fff);
 	SONIC_WRITE(SONIC_IMR, 0);
+	SONIC_WRITE(SONIC_ISR, 0x7fff);
 	SONIC_WRITE(SONIC_CMD, SONIC_CR_RST);
 
-	sonic_free_irq(dev->irq, dev);	/* release the IRQ */
+	/* unmap and free skbs that haven't been transmitted */
+	for (i = 0; i < SONIC_NUM_TDS; i++) {
+		if(lp->tx_laddr[i]) {
+			dma_unmap_single(lp->device, lp->tx_laddr[i], lp->tx_len[i], DMA_TO_DEVICE);
+			lp->tx_laddr[i] = (dma_addr_t)0;
+		}
+		if(lp->tx_skb[i]) {
+			dev_kfree_skb(lp->tx_skb[i]);
+			lp->tx_skb[i] = NULL;
+		}
+	}
+
+	/* unmap and free the receive buffers */
+	for (i = 0; i < SONIC_NUM_RRS; i++) {
+		if(lp->rx_laddr[i]) {
+			dma_unmap_single(lp->device, lp->rx_laddr[i], SONIC_RBSIZE, DMA_FROM_DEVICE);
+			lp->rx_laddr[i] = (dma_addr_t)0;
+		}
+		if(lp->rx_skb[i]) {
+			dev_kfree_skb(lp->rx_skb[i]);
+			lp->rx_skb[i] = NULL;
+		}
+	}
+
+	free_irq(dev->irq, dev);	/* release the IRQ */
 
 	return 0;
 }
 
 static void sonic_tx_timeout(struct net_device *dev)
 {
-	struct sonic_local *lp = (struct sonic_local *) dev->priv;
-	printk("%s: transmit timed out.\n", dev->name);
-
+	struct sonic_local *lp = netdev_priv(dev);
+	int i;
+	/* Stop the interrupts for this */
+	SONIC_WRITE(SONIC_IMR, 0);
+	/* We could resend the original skbs. Easier to re-initialise. */
+	for (i = 0; i < SONIC_NUM_TDS; i++) {
+		if(lp->tx_laddr[i]) {
+			dma_unmap_single(lp->device, lp->tx_laddr[i], lp->tx_len[i], DMA_TO_DEVICE);
+			lp->tx_laddr[i] = (dma_addr_t)0;
+		}
+		if(lp->tx_skb[i]) {
+			dev_kfree_skb(lp->tx_skb[i]);
+			lp->tx_skb[i] = NULL;
+		}
+	}
 	/* Try to restart the adaptor. */
 	sonic_init(dev);
 	lp->stats.tx_errors++;
@@ -100,60 +201,92 @@
 
 /*
  * transmit packet
+ *
+ * Appends new TD during transmission thus avoiding any TX interrupts
+ * until we run out of TDs.
+ * This routine interacts closely with the ISR in that it may,
+ *   set tx_skb[i]
+ *   reset the status flags of the new TD
+ *   set and reset EOL flags
+ *   stop the tx queue
+ * The ISR interacts with this routine in various ways. It may,
+ *   reset tx_skb[i]
+ *   test the EOL and status flags of the TDs
+ *   wake the tx queue
+ * Concurrently with all of this, the SONIC is potentially writing to
+ * the status flags of the TDs.
+ * Until some mutual exclusion is added, this code will not work with SMP. However,
+ * MIPS Jazz machines and m68k Macs were all uni-processor machines.
  */
+
 static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev)
 {
-	struct sonic_local *lp = (struct sonic_local *) dev->priv;
-	unsigned int base_addr = dev->base_addr;
-	unsigned int laddr;
-	int entry, length;
-
-	netif_stop_queue(dev);
+	struct sonic_local *lp = netdev_priv(dev);
+	dma_addr_t laddr;
+	int length;
+	int entry = lp->next_tx;
 
 	if (sonic_debug > 2)
 		printk("sonic_send_packet: skb=%p, dev=%p\n", skb, dev);
 
+	length = skb->len;
+	if (length < ETH_ZLEN) {
+		skb = skb_padto(skb, ETH_ZLEN);
+		if (skb == NULL)
+			return 0;
+		length = ETH_ZLEN;
+	}
+
 	/*
 	 * Map the packet data into the logical DMA address space
 	 */
-	if ((laddr = vdma_alloc(CPHYSADDR(skb->data), skb->len)) == ~0UL) {
-		printk("%s: no VDMA entry for transmit available.\n",
-		       dev->name);
+
+	laddr = dma_map_single(lp->device, skb->data, length, DMA_TO_DEVICE);
+	if (!laddr) {
+		printk(KERN_ERR "%s: failed to map tx DMA buffer.\n", dev->name);
 		dev_kfree_skb(skb);
-		netif_start_queue(dev);
 		return 1;
 	}
-	entry = lp->cur_tx & SONIC_TDS_MASK;
-	lp->tx_laddr[entry] = laddr;
-	lp->tx_skb[entry] = skb;
-
-	length = (skb->len < ETH_ZLEN) ? ETH_ZLEN : skb->len;
-	flush_cache_all();
+   
+	sonic_tda_put(dev, entry, SONIC_TD_STATUS, 0);       /* clear status */
+	sonic_tda_put(dev, entry, SONIC_TD_FRAG_COUNT, 1);   /* single fragment */
+	sonic_tda_put(dev, entry, SONIC_TD_PKTSIZE, length); /* length of packet */
+	sonic_tda_put(dev, entry, SONIC_TD_FRAG_PTR_L, laddr & 0xffff);
+	sonic_tda_put(dev, entry, SONIC_TD_FRAG_PTR_H, laddr >> 16);
+	sonic_tda_put(dev, entry, SONIC_TD_FRAG_SIZE, length);
+	sonic_tda_put(dev, entry, SONIC_TD_LINK,
+		sonic_tda_get(dev, entry, SONIC_TD_LINK) | SONIC_EOL);
 
 	/*
-	 * Setup the transmit descriptor and issue the transmit command.
+	 * Must set tx_skb[entry] only after clearing status, and
+	 * before clearing EOL and before stopping queue
 	 */
-	lp->tda[entry].tx_status = 0;	/* clear status */
-	lp->tda[entry].tx_frag_count = 1;	/* single fragment */
-	lp->tda[entry].tx_pktsize = length;	/* length of packet */
-	lp->tda[entry].tx_frag_ptr_l = laddr & 0xffff;
-	lp->tda[entry].tx_frag_ptr_h = laddr >> 16;
-	lp->tda[entry].tx_frag_size = length;
-	lp->cur_tx++;
-	lp->stats.tx_bytes += length;
+	wmb();
+	lp->tx_len[entry] = length;
+	lp->tx_laddr[entry] = laddr;
+	lp->tx_skb[entry] = skb;
+
+	wmb();
+	sonic_tda_put(dev, lp->eol_tx, SONIC_TD_LINK,
+				  sonic_tda_get(dev, lp->eol_tx, SONIC_TD_LINK) & ~SONIC_EOL);
+	lp->eol_tx = entry;
+
+	lp->next_tx = (entry + 1) & SONIC_TDS_MASK;
+	if (lp->tx_skb[lp->next_tx] != NULL) {
+		/* The ring is full, the ISR has yet to process the next TD. */
+		if (sonic_debug > 3)
+			printk("%s: stopping queue\n", dev->name);
+		netif_stop_queue(dev);
+		/* after this packet, wait for ISR to free up some TDAs */
+	} else netif_start_queue(dev);
 
 	if (sonic_debug > 2)
-		printk("sonic_send_packet: issueing Tx command\n");
+		printk("sonic_send_packet: issuing Tx command\n");
 
 	SONIC_WRITE(SONIC_CMD, SONIC_CR_TXP);
 
 	dev->trans_start = jiffies;
 
-	if (lp->cur_tx < lp->dirty_tx + SONIC_NUM_TDS)
-		netif_start_queue(dev);
-	else
-		lp->tx_full = 1;
-
 	return 0;
 }
 
@@ -164,175 +297,199 @@
 static irqreturn_t sonic_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = (struct net_device *) dev_id;
-	unsigned int base_addr = dev->base_addr;
-	struct sonic_local *lp;
+	struct sonic_local *lp = netdev_priv(dev);
 	int status;
 
 	if (dev == NULL) {
-		printk("sonic_interrupt: irq %d for unknown device.\n", irq);
+		printk(KERN_ERR "sonic_interrupt: irq %d for unknown device.\n", irq);
 		return IRQ_NONE;
 	}
 
-	lp = (struct sonic_local *) dev->priv;
-
-	status = SONIC_READ(SONIC_ISR);
-	SONIC_WRITE(SONIC_ISR, 0x7fff);	/* clear all bits */
-
-	if (sonic_debug > 2)
-		printk("sonic_interrupt: ISR=%x\n", status);
-
-	if (status & SONIC_INT_PKTRX) {
-		sonic_rx(dev);	/* got packet(s) */
-	}
-
-	if (status & SONIC_INT_TXDN) {
-		int dirty_tx = lp->dirty_tx;
+	if (!(status = SONIC_READ(SONIC_ISR) & SONIC_IMR_DEFAULT))
+		return IRQ_NONE;
 
-		while (dirty_tx < lp->cur_tx) {
-			int entry = dirty_tx & SONIC_TDS_MASK;
-			int status = lp->tda[entry].tx_status;
+	do {
+		if (status & SONIC_INT_PKTRX) {
+			if (sonic_debug > 2)
+				printk("%s: packet rx\n", dev->name);
+			sonic_rx(dev);	/* got packet(s) */
+			SONIC_WRITE(SONIC_ISR, SONIC_INT_PKTRX); /* clear the interrupt */
+		}
 
-			if (sonic_debug > 3)
-				printk
-				    ("sonic_interrupt: status %d, cur_tx %d, dirty_tx %d\n",
-				     status, lp->cur_tx, lp->dirty_tx);
+		if (status & SONIC_INT_TXDN) {
+			int entry = lp->cur_tx;
+			int td_status;
+			int freed_some = 0;
+
+			/* At this point, cur_tx is the index of a TD that is one of:
+			 *   unallocated/freed                          (status set   & tx_skb[entry] clear)
+			 *   allocated and sent                         (status set   & tx_skb[entry] set  )
+			 *   allocated and not yet sent                 (status clear & tx_skb[entry] set  )
+			 *   still being allocated by sonic_send_packet (status clear & tx_skb[entry] clear)
+			 */
 
-			if (status == 0) {
-				/* It still hasn't been Txed, kick the sonic again */
-				SONIC_WRITE(SONIC_CMD, SONIC_CR_TXP);
-				break;
-			}
+			if (sonic_debug > 2)
+				printk("%s: tx done\n", dev->name);
 
-			/* put back EOL and free descriptor */
-			lp->tda[entry].tx_frag_count = 0;
-			lp->tda[entry].tx_status = 0;
-
-			if (status & 0x0001)
-				lp->stats.tx_packets++;
-			else {
-				lp->stats.tx_errors++;
-				if (status & 0x0642)
-					lp->stats.tx_aborted_errors++;
-				if (status & 0x0180)
-					lp->stats.tx_carrier_errors++;
-				if (status & 0x0020)
-					lp->stats.tx_window_errors++;
-				if (status & 0x0004)
-					lp->stats.tx_fifo_errors++;
-			}
+			while (lp->tx_skb[entry] != NULL) {
+				if ((td_status = sonic_tda_get(dev, entry, SONIC_TD_STATUS)) == 0)
+					break;
+
+				if (td_status & 0x0001) {
+					lp->stats.tx_packets++;
+					lp->stats.tx_bytes += sonic_tda_get(dev, entry, SONIC_TD_PKTSIZE);
+				} else {
+					lp->stats.tx_errors++;
+					if (td_status & 0x0642)
+						lp->stats.tx_aborted_errors++;
+					if (td_status & 0x0180)
+						lp->stats.tx_carrier_errors++;
+					if (td_status & 0x0020)
+						lp->stats.tx_window_errors++;
+					if (td_status & 0x0004)
+						lp->stats.tx_fifo_errors++;
+				}
 
-			/* We must free the original skb */
-			if (lp->tx_skb[entry]) {
+				/* We must free the original skb */
 				dev_kfree_skb_irq(lp->tx_skb[entry]);
-				lp->tx_skb[entry] = 0;
+				lp->tx_skb[entry] = NULL;
+				/* and unmap DMA buffer */
+				dma_unmap_single(lp->device, lp->tx_laddr[entry], lp->tx_len[entry], DMA_TO_DEVICE);
+				lp->tx_laddr[entry] = (dma_addr_t)0;
+				freed_some = 1;
+
+				if (sonic_tda_get(dev, entry, SONIC_TD_LINK) & SONIC_EOL) {
+					entry = (entry + 1) & SONIC_TDS_MASK;
+					break;
+				}
+				entry = (entry + 1) & SONIC_TDS_MASK;
 			}
-			/* and the VDMA address */
-			vdma_free(lp->tx_laddr[entry]);
-			dirty_tx++;
-		}
 
-		if (lp->tx_full
-		    && dirty_tx + SONIC_NUM_TDS > lp->cur_tx + 2) {
-			/* The ring is no longer full, clear tbusy. */
-			lp->tx_full = 0;
-			netif_wake_queue(dev);
+			if (freed_some || lp->tx_skb[entry] == NULL)
+				netif_wake_queue(dev);  /* The ring is no longer full */
+			lp->cur_tx = entry;
+			SONIC_WRITE(SONIC_ISR, SONIC_INT_TXDN); /* clear the interrupt */
 		}
 
-		lp->dirty_tx = dirty_tx;
-	}
+		/*
+		 * check error conditions
+		 */
+		if (status & SONIC_INT_RFO) {
+			if (sonic_debug > 1)
+				printk("%s: rx fifo overrun\n", dev->name);
+			lp->stats.rx_fifo_errors++;
+			SONIC_WRITE(SONIC_ISR, SONIC_INT_RFO); /* clear the interrupt */
+		}
+		if (status & SONIC_INT_RDE) {
+			if (sonic_debug > 1)
+				printk("%s: rx descriptors exhausted\n", dev->name);
+			lp->stats.rx_dropped++;
+			SONIC_WRITE(SONIC_ISR, SONIC_INT_RDE); /* clear the interrupt */
+		}
+		if (status & SONIC_INT_RBAE) {
+			if (sonic_debug > 1)
+				printk("%s: rx buffer area exceeded\n", dev->name);
+			lp->stats.rx_dropped++;
+			SONIC_WRITE(SONIC_ISR, SONIC_INT_RBAE); /* clear the interrupt */
+		}
 
-	/*
-	 * check error conditions
-	 */
-	if (status & SONIC_INT_RFO) {
-		printk("%s: receive fifo underrun\n", dev->name);
-		lp->stats.rx_fifo_errors++;
-	}
-	if (status & SONIC_INT_RDE) {
-		printk("%s: receive descriptors exhausted\n", dev->name);
-		lp->stats.rx_dropped++;
-	}
-	if (status & SONIC_INT_RBE) {
-		printk("%s: receive buffer exhausted\n", dev->name);
-		lp->stats.rx_dropped++;
-	}
-	if (status & SONIC_INT_RBAE) {
-		printk("%s: receive buffer area exhausted\n", dev->name);
-		lp->stats.rx_dropped++;
-	}
+		/* counter overruns; all counters are 16bit wide */
+		if (status & SONIC_INT_FAE) {
+			lp->stats.rx_frame_errors += 65536;
+			SONIC_WRITE(SONIC_ISR, SONIC_INT_FAE); /* clear the interrupt */
+		}
+		if (status & SONIC_INT_CRC) {
+			lp->stats.rx_crc_errors += 65536;
+			SONIC_WRITE(SONIC_ISR, SONIC_INT_CRC); /* clear the interrupt */
+		}
+		if (status & SONIC_INT_MP) {
+			lp->stats.rx_missed_errors += 65536;
+			SONIC_WRITE(SONIC_ISR, SONIC_INT_MP); /* clear the interrupt */
+		}
 
-	/* counter overruns; all counters are 16bit wide */
-	if (status & SONIC_INT_FAE)
-		lp->stats.rx_frame_errors += 65536;
-	if (status & SONIC_INT_CRC)
-		lp->stats.rx_crc_errors += 65536;
-	if (status & SONIC_INT_MP)
-		lp->stats.rx_missed_errors += 65536;
+		/* transmit error */
+		if (status & SONIC_INT_TXER) {
+			if ((SONIC_READ(SONIC_TCR) & SONIC_TCR_FU) && (sonic_debug > 2))
+				printk(KERN_ERR "%s: tx fifo underrun\n", dev->name);
+			SONIC_WRITE(SONIC_ISR, SONIC_INT_TXER); /* clear the interrupt */
+		}
 
-	/* transmit error */
-	if (status & SONIC_INT_TXER)
-		lp->stats.tx_errors++;
+		/* bus retry */
+		if (status & SONIC_INT_BR) {
+			printk(KERN_ERR "%s: Bus retry occurred! Device interrupt disabled.\n",
+				dev->name);
+			/* ... to help debug DMA problems causing endless interrupts. */
+			/* Bounce the eth interface to turn on the interrupt again. */
+			SONIC_WRITE(SONIC_IMR, 0);
+			SONIC_WRITE(SONIC_ISR, SONIC_INT_BR); /* clear the interrupt */
+		}
 
-	/*
-	 * clear interrupt bits and return
-	 */
-	SONIC_WRITE(SONIC_ISR, status);
+		/* load CAM done */
+		if (status & SONIC_INT_LCD)
+			SONIC_WRITE(SONIC_ISR, SONIC_INT_LCD); /* clear the interrupt */
+	} while((status = SONIC_READ(SONIC_ISR) & SONIC_IMR_DEFAULT));
 	return IRQ_HANDLED;
 }
 
 /*
- * We have a good packet(s), get it/them out of the buffers.
+ * We have a good packet(s), pass it/them up the network stack.
  */
 static void sonic_rx(struct net_device *dev)
 {
-	unsigned int base_addr = dev->base_addr;
-	struct sonic_local *lp = (struct sonic_local *) dev->priv;
-	sonic_rd_t *rd = &lp->rda[lp->cur_rx & SONIC_RDS_MASK];
+	struct sonic_local *lp = netdev_priv(dev);
 	int status;
+	int entry = lp->cur_rx;
 
-	while (rd->in_use == 0) {
-		struct sk_buff *skb;
+	while (sonic_rda_get(dev, entry, SONIC_RD_IN_USE) == 0) {
+		struct sk_buff *used_skb;
+		struct sk_buff *new_skb;
+		dma_addr_t new_laddr;
+		u16 bufadr_l;
+		u16 bufadr_h;
 		int pkt_len;
-		unsigned char *pkt_ptr;
 
-		status = rd->rx_status;
-		if (sonic_debug > 3)
-			printk("status %x, cur_rx %d, cur_rra %x\n",
-			       status, lp->cur_rx, lp->cur_rra);
+		status = sonic_rda_get(dev, entry, SONIC_RD_STATUS);
 		if (status & SONIC_RCR_PRX) {
-			pkt_len = rd->rx_pktlen;
-			pkt_ptr =
-			    (char *)
-			    sonic_chiptomem((rd->rx_pktptr_h << 16) +
-					    rd->rx_pktptr_l);
-
-			if (sonic_debug > 3)
-				printk
-				    ("pktptr %p (rba %p) h:%x l:%x, bsize h:%x l:%x\n",
-				     pkt_ptr, lp->rba, rd->rx_pktptr_h,
-				     rd->rx_pktptr_l,
-				     SONIC_READ(SONIC_RBWC1),
-				     SONIC_READ(SONIC_RBWC0));
-
 			/* Malloc up new buffer. */
-			skb = dev_alloc_skb(pkt_len + 2);
-			if (skb == NULL) {
-				printk
-				    ("%s: Memory squeeze, dropping packet.\n",
-				     dev->name);
+			new_skb = dev_alloc_skb(SONIC_RBSIZE + 2);
+			if (new_skb == NULL) {
+				printk(KERN_ERR "%s: Memory squeeze, dropping packet.\n", dev->name);
 				lp->stats.rx_dropped++;
 				break;
 			}
-			skb->dev = dev;
-			skb_reserve(skb, 2);	/* 16 byte align */
-			skb_put(skb, pkt_len);	/* Make room */
-			eth_copy_and_sum(skb, pkt_ptr, pkt_len, 0);
-			skb->protocol = eth_type_trans(skb, dev);
-			netif_rx(skb);	/* pass the packet to upper layers */
+			new_skb->dev = dev;
+			/* provide 16 byte IP header alignment unless DMA requires otherwise */
+			if(SONIC_BUS_SCALE(lp->dma_bitmode) == 2)
+				skb_reserve(new_skb, 2); 
+
+			new_laddr = dma_map_single(lp->device, skb_put(new_skb, SONIC_RBSIZE),
+		                               SONIC_RBSIZE, DMA_FROM_DEVICE);
+			if (!new_laddr) {
+				dev_kfree_skb(new_skb);
+				printk(KERN_ERR "%s: Failed to map rx buffer, dropping packet.\n", dev->name);
+				lp->stats.rx_dropped++;
+				break;
+			}
+
+			/* now we have a new skb to replace it, pass the used one up the stack */
+			dma_unmap_single(lp->device, lp->rx_laddr[entry], SONIC_RBSIZE, DMA_FROM_DEVICE);
+			used_skb = lp->rx_skb[entry];
+			pkt_len = sonic_rda_get(dev, entry, SONIC_RD_PKTLEN);
+			skb_trim(used_skb, pkt_len);
+			used_skb->protocol = eth_type_trans(used_skb, dev);
+			netif_rx(used_skb);
 			dev->last_rx = jiffies;
 			lp->stats.rx_packets++;
 			lp->stats.rx_bytes += pkt_len;
 
+			/* and insert the new skb */
+			lp->rx_laddr[entry] = new_laddr;
+			lp->rx_skb[entry] = new_skb;
+
+			bufadr_l = (unsigned long)new_laddr & 0xffff;
+			bufadr_h = (unsigned long)new_laddr >> 16;
+			sonic_rra_put(dev, entry, SONIC_RR_BUFADR_L, bufadr_l);
+			sonic_rra_put(dev, entry, SONIC_RR_BUFADR_H, bufadr_h);
 		} else {
 			/* This should only happen, if we enable accepting broken packets. */
 			lp->stats.rx_errors++;
@@ -341,29 +498,35 @@
 			if (status & SONIC_RCR_CRCR)
 				lp->stats.rx_crc_errors++;
 		}
-
-		rd->in_use = 1;
-		rd = &lp->rda[(++lp->cur_rx) & SONIC_RDS_MASK];
-		/* now give back the buffer to the receive buffer area */
 		if (status & SONIC_RCR_LPKT) {
 			/*
-			 * this was the last packet out of the current receice buffer
+			 * this was the last packet out of the current receive buffer
 			 * give the buffer back to the SONIC
 			 */
-			lp->cur_rra += sizeof(sonic_rr_t);
-			if (lp->cur_rra >
-			    (lp->rra_laddr +
-			     (SONIC_NUM_RRS -
-			      1) * sizeof(sonic_rr_t))) lp->cur_rra =
-				    lp->rra_laddr;
-			SONIC_WRITE(SONIC_RWP, lp->cur_rra & 0xffff);
+			lp->cur_rwp += SIZEOF_SONIC_RR * SONIC_BUS_SCALE(lp->dma_bitmode);
+			if (lp->cur_rwp >= lp->rra_end) lp->cur_rwp = lp->rra_laddr & 0xffff;
+			SONIC_WRITE(SONIC_RWP, lp->cur_rwp);
+			if (SONIC_READ(SONIC_ISR) & SONIC_INT_RBE) {
+				if (sonic_debug > 2)
+					printk("%s: rx buffer exhausted\n", dev->name);
+				SONIC_WRITE(SONIC_ISR, SONIC_INT_RBE); /* clear the flag */
+			}
 		} else
-			printk
-			    ("%s: rx desc without RCR_LPKT. Shouldn't happen !?\n",
+			printk(KERN_ERR "%s: rx desc without RCR_LPKT. Shouldn't happen !?\n",
 			     dev->name);
+		/*
+		 * give back the descriptor
+		 */
+		sonic_rda_put(dev, entry, SONIC_RD_LINK,
+			sonic_rda_get(dev, entry, SONIC_RD_LINK) | SONIC_EOL);
+		sonic_rda_put(dev, entry, SONIC_RD_IN_USE, 1);
+		sonic_rda_put(dev, lp->eol_rx, SONIC_RD_LINK,
+			sonic_rda_get(dev, lp->eol_rx, SONIC_RD_LINK) & ~SONIC_EOL);
+		lp->eol_rx = entry;
+		lp->cur_rx = entry = (entry + 1) & SONIC_RDS_MASK;
 	}
 	/*
-	 * If any worth-while packets have been received, dev_rint()
+	 * If any worth-while packets have been received, netif_rx()
 	 * has done a mark_bh(NET_BH) for us and will work on them
 	 * when we get to the bottom-half routine.
 	 */
@@ -376,8 +539,7 @@
  */
 static struct net_device_stats *sonic_get_stats(struct net_device *dev)
 {
-	struct sonic_local *lp = (struct sonic_local *) dev->priv;
-	unsigned int base_addr = dev->base_addr;
+	struct sonic_local *lp = netdev_priv(dev);
 
 	/* read the tally counter from the SONIC and reset them */
 	lp->stats.rx_crc_errors += SONIC_READ(SONIC_CRCT);
@@ -396,8 +558,7 @@
  */
 static void sonic_multicast_list(struct net_device *dev)
 {
-	struct sonic_local *lp = (struct sonic_local *) dev->priv;
-	unsigned int base_addr = dev->base_addr;
+	struct sonic_local *lp = netdev_priv(dev);
 	unsigned int rcr;
 	struct dev_mc_list *dmi = dev->mc_list;
 	unsigned char *addr;
@@ -413,20 +574,15 @@
 			rcr |= SONIC_RCR_AMC;
 		} else {
 			if (sonic_debug > 2)
-				printk
-				    ("sonic_multicast_list: mc_count %d\n",
-				     dev->mc_count);
-			lp->cda.cam_enable = 1;	/* always enable our own address */
+				printk("sonic_multicast_list: mc_count %d\n", dev->mc_count);
+			sonic_set_cam_enable(dev, 1);  /* always enable our own address */
 			for (i = 1; i <= dev->mc_count; i++) {
 				addr = dmi->dmi_addr;
 				dmi = dmi->next;
-				lp->cda.cam_desc[i].cam_cap0 =
-				    addr[1] << 8 | addr[0];
-				lp->cda.cam_desc[i].cam_cap1 =
-				    addr[3] << 8 | addr[2];
-				lp->cda.cam_desc[i].cam_cap2 =
-				    addr[5] << 8 | addr[4];
-				lp->cda.cam_enable |= (1 << i);
+				sonic_cda_put(dev, i, SONIC_CD_CAP0, addr[1] << 8 | addr[0]);
+				sonic_cda_put(dev, i, SONIC_CD_CAP1, addr[3] << 8 | addr[2]);
+				sonic_cda_put(dev, i, SONIC_CD_CAP2, addr[5] << 8 | addr[4]);
+				sonic_set_cam_enable(dev, sonic_get_cam_enable(dev) | (1 << i));
 			}
 			SONIC_WRITE(SONIC_CDC, 16);
 			/* issue Load CAM command */
@@ -447,19 +603,16 @@
  */
 static int sonic_init(struct net_device *dev)
 {
-	unsigned int base_addr = dev->base_addr;
 	unsigned int cmd;
-	struct sonic_local *lp = (struct sonic_local *) dev->priv;
-	unsigned int rra_start;
-	unsigned int rra_end;
+	struct sonic_local *lp = netdev_priv(dev);
 	int i;
 
 	/*
 	 * put the Sonic into software-reset mode and
 	 * disable all interrupts
 	 */
-	SONIC_WRITE(SONIC_ISR, 0x7fff);
 	SONIC_WRITE(SONIC_IMR, 0);
+	SONIC_WRITE(SONIC_ISR, 0x7fff);
 	SONIC_WRITE(SONIC_CMD, SONIC_CR_RST);
 
 	/*
@@ -475,34 +628,32 @@
 	if (sonic_debug > 2)
 		printk("sonic_init: initialize receive resource area\n");
 
-	rra_start = lp->rra_laddr & 0xffff;
-	rra_end =
-	    (rra_start + (SONIC_NUM_RRS * sizeof(sonic_rr_t))) & 0xffff;
-
 	for (i = 0; i < SONIC_NUM_RRS; i++) {
-		lp->rra[i].rx_bufadr_l =
-		    (lp->rba_laddr + i * SONIC_RBSIZE) & 0xffff;
-		lp->rra[i].rx_bufadr_h =
-		    (lp->rba_laddr + i * SONIC_RBSIZE) >> 16;
-		lp->rra[i].rx_bufsize_l = SONIC_RBSIZE >> 1;
-		lp->rra[i].rx_bufsize_h = 0;
+		u16 bufadr_l = (unsigned long)lp->rx_laddr[i] & 0xffff;
+		u16 bufadr_h = (unsigned long)lp->rx_laddr[i] >> 16;
+		sonic_rra_put(dev, i, SONIC_RR_BUFADR_L, bufadr_l);
+		sonic_rra_put(dev, i, SONIC_RR_BUFADR_H, bufadr_h);
+		sonic_rra_put(dev, i, SONIC_RR_BUFSIZE_L, SONIC_RBSIZE >> 1);
+		sonic_rra_put(dev, i, SONIC_RR_BUFSIZE_H, 0);
 	}
 
 	/* initialize all RRA registers */
-	SONIC_WRITE(SONIC_RSA, rra_start);
-	SONIC_WRITE(SONIC_REA, rra_end);
-	SONIC_WRITE(SONIC_RRP, rra_start);
-	SONIC_WRITE(SONIC_RWP, rra_end);
+	lp->rra_end = (lp->rra_laddr + SONIC_NUM_RRS * SIZEOF_SONIC_RR *
+					SONIC_BUS_SCALE(lp->dma_bitmode)) & 0xffff;
+	lp->cur_rwp = (lp->rra_laddr + (SONIC_NUM_RRS - 1) * SIZEOF_SONIC_RR *
+					SONIC_BUS_SCALE(lp->dma_bitmode)) & 0xffff;
+  
+	SONIC_WRITE(SONIC_RSA, lp->rra_laddr & 0xffff);
+	SONIC_WRITE(SONIC_REA, lp->rra_end);
+	SONIC_WRITE(SONIC_RRP, lp->rra_laddr & 0xffff);
+	SONIC_WRITE(SONIC_RWP, lp->cur_rwp);
 	SONIC_WRITE(SONIC_URRA, lp->rra_laddr >> 16);
-	SONIC_WRITE(SONIC_EOBC, (SONIC_RBSIZE - 2) >> 1);
-
-	lp->cur_rra =
-	    lp->rra_laddr + (SONIC_NUM_RRS - 1) * sizeof(sonic_rr_t);
+	SONIC_WRITE(SONIC_EOBC, (SONIC_RBSIZE >> 1) - (lp->dma_bitmode ? 2 : 1));
 
 	/* load the resource pointers */
 	if (sonic_debug > 3)
-		printk("sonic_init: issueing RRRA command\n");
-
+		printk("sonic_init: issuing RRRA command\n");
+  
 	SONIC_WRITE(SONIC_CMD, SONIC_CR_RRRA);
 	i = 0;
 	while (i++ < 100) {
@@ -511,27 +662,30 @@
 	}
 
 	if (sonic_debug > 2)
-		printk("sonic_init: status=%x\n", SONIC_READ(SONIC_CMD));
-
+		printk("sonic_init: status=%x i=%d\n", SONIC_READ(SONIC_CMD), i);
+    
 	/*
 	 * Initialize the receive descriptors so that they
 	 * become a circular linked list, ie. let the last
 	 * descriptor point to the first again.
 	 */
 	if (sonic_debug > 2)
-		printk("sonic_init: initialize receive descriptors\n");
-	for (i = 0; i < SONIC_NUM_RDS; i++) {
-		lp->rda[i].rx_status = 0;
-		lp->rda[i].rx_pktlen = 0;
-		lp->rda[i].rx_pktptr_l = 0;
-		lp->rda[i].rx_pktptr_h = 0;
-		lp->rda[i].rx_seqno = 0;
-		lp->rda[i].in_use = 1;
-		lp->rda[i].link =
-		    lp->rda_laddr + (i + 1) * sizeof(sonic_rd_t);
+		printk("sonic_init: initialize receive descriptors\n");      
+	for (i=0; i<SONIC_NUM_RDS; i++) {
+		sonic_rda_put(dev, i, SONIC_RD_STATUS, 0);
+		sonic_rda_put(dev, i, SONIC_RD_PKTLEN, 0);
+		sonic_rda_put(dev, i, SONIC_RD_PKTPTR_L, 0);
+		sonic_rda_put(dev, i, SONIC_RD_PKTPTR_H, 0);
+		sonic_rda_put(dev, i, SONIC_RD_SEQNO, 0);
+		sonic_rda_put(dev, i, SONIC_RD_IN_USE, 1);
+		sonic_rda_put(dev, i, SONIC_RD_LINK,
+			lp->rda_laddr +
+			((i+1) * SIZEOF_SONIC_RD * SONIC_BUS_SCALE(lp->dma_bitmode)));
 	}
 	/* fix last descriptor */
-	lp->rda[SONIC_NUM_RDS - 1].link = lp->rda_laddr;
+	sonic_rda_put(dev, SONIC_NUM_RDS - 1, SONIC_RD_LINK,
+		(lp->rda_laddr & 0xffff) | SONIC_EOL);
+	lp->eol_rx = SONIC_NUM_RDS - 1;
 	lp->cur_rx = 0;
 	SONIC_WRITE(SONIC_URDA, lp->rda_laddr >> 16);
 	SONIC_WRITE(SONIC_CRDA, lp->rda_laddr & 0xffff);
@@ -542,34 +696,34 @@
 	if (sonic_debug > 2)
 		printk("sonic_init: initialize transmit descriptors\n");
 	for (i = 0; i < SONIC_NUM_TDS; i++) {
-		lp->tda[i].tx_status = 0;
-		lp->tda[i].tx_config = 0;
-		lp->tda[i].tx_pktsize = 0;
-		lp->tda[i].tx_frag_count = 0;
-		lp->tda[i].link =
-		    (lp->tda_laddr +
-		     (i + 1) * sizeof(sonic_td_t)) | SONIC_END_OF_LINKS;
+		sonic_tda_put(dev, i, SONIC_TD_STATUS, 0);
+		sonic_tda_put(dev, i, SONIC_TD_CONFIG, 0);
+		sonic_tda_put(dev, i, SONIC_TD_PKTSIZE, 0);
+		sonic_tda_put(dev, i, SONIC_TD_FRAG_COUNT, 0);
+		sonic_tda_put(dev, i, SONIC_TD_LINK,
+			(lp->tda_laddr & 0xffff) +
+			(i + 1) * SIZEOF_SONIC_TD * SONIC_BUS_SCALE(lp->dma_bitmode));
+		lp->tx_skb[i] = NULL;
 	}
-	lp->tda[SONIC_NUM_TDS - 1].link =
-	    (lp->tda_laddr & 0xffff) | SONIC_END_OF_LINKS;
+	/* fix last descriptor */
+	sonic_tda_put(dev, SONIC_NUM_TDS - 1, SONIC_TD_LINK,
+		(lp->tda_laddr & 0xffff));
 
 	SONIC_WRITE(SONIC_UTDA, lp->tda_laddr >> 16);
 	SONIC_WRITE(SONIC_CTDA, lp->tda_laddr & 0xffff);
-	lp->cur_tx = lp->dirty_tx = 0;
-
+	lp->cur_tx = lp->next_tx = 0;
+	lp->eol_tx = SONIC_NUM_TDS - 1;
+    
 	/*
 	 * put our own address to CAM desc[0]
 	 */
-	lp->cda.cam_desc[0].cam_cap0 =
-	    dev->dev_addr[1] << 8 | dev->dev_addr[0];
-	lp->cda.cam_desc[0].cam_cap1 =
-	    dev->dev_addr[3] << 8 | dev->dev_addr[2];
-	lp->cda.cam_desc[0].cam_cap2 =
-	    dev->dev_addr[5] << 8 | dev->dev_addr[4];
-	lp->cda.cam_enable = 1;
+	sonic_cda_put(dev, 0, SONIC_CD_CAP0, dev->dev_addr[1] << 8 | dev->dev_addr[0]);
+	sonic_cda_put(dev, 0, SONIC_CD_CAP1, dev->dev_addr[3] << 8 | dev->dev_addr[2]);
+	sonic_cda_put(dev, 0, SONIC_CD_CAP2, dev->dev_addr[5] << 8 | dev->dev_addr[4]);
+	sonic_set_cam_enable(dev, 1);
 
 	for (i = 0; i < 16; i++)
-		lp->cda.cam_desc[i].cam_entry_pointer = i;
+		sonic_cda_put(dev, i, SONIC_CD_ENTRY_POINTER, i);
 
 	/*
 	 * initialize CAM registers
@@ -588,8 +742,8 @@
 			break;
 	}
 	if (sonic_debug > 2) {
-		printk("sonic_init: CMD=%x, ISR=%x\n",
-		       SONIC_READ(SONIC_CMD), SONIC_READ(SONIC_ISR));
+		printk("sonic_init: CMD=%x, ISR=%x\n, i=%d",
+		       SONIC_READ(SONIC_CMD), SONIC_READ(SONIC_ISR), i);
 	}
 
 	/*
@@ -604,7 +758,7 @@
 
 	cmd = SONIC_READ(SONIC_CMD);
 	if ((cmd & SONIC_CR_RXEN) == 0 || (cmd & SONIC_CR_STP) == 0)
-		printk("sonic_init: failed, status=%x\n", cmd);
+		printk(KERN_ERR "sonic_init: failed, status=%x\n", cmd);
 
 	if (sonic_debug > 2)
 		printk("sonic_init: new status=%x\n",
--- orig/drivers/net/sonic.h	Sun Jul 10 22:11:34 2005
+++ linux/drivers/net/sonic.h	Sun Jul 10 22:11:46 2005
@@ -1,5 +1,5 @@
 /*
- * Helpfile for sonic.c
+ * Header file for sonic.c
  *
  * (C) Waldorf Electronics, Germany
  * Written by Andreas Busse
@@ -9,10 +9,16 @@
  * and pad structure members must be exchanged. Also, the structures
  * need to be changed accordingly to the bus size. 
  *
- * 981229 MSch:	did just that for the 68k Mac port (32 bit, big endian),
- *		see CONFIG_MACSONIC branch below.
+ * 981229 MSch:	did just that for the 68k Mac port (32 bit, big endian)
  *
+ * 990611 David Huggins-Daines <dhd@debian.org>: This machine abstraction
+ * does not cope with 16-bit bus sizes very well.  Therefore I have
+ * rewritten it with ugly macros and evil inlines.
+ *
+ * 050625 Finn Thain: introduced more 32-bit cards and dhd's support
+ *        for 16-bit cards (from the mac68k project).
  */
+
 #ifndef SONIC_H
 #define SONIC_H
 
@@ -83,6 +89,7 @@
 /*
  * Error counters
  */
+
 #define SONIC_CRCT              0x2c
 #define SONIC_FAET              0x2d
 #define SONIC_MPT               0x2e
@@ -182,14 +189,14 @@
 
 #define SONIC_INT_BR		0x4000
 #define SONIC_INT_HBL		0x2000
-#define SONIC_INT_LCD           0x1000
-#define SONIC_INT_PINT          0x0800
-#define SONIC_INT_PKTRX         0x0400
-#define SONIC_INT_TXDN          0x0200
-#define SONIC_INT_TXER          0x0100
-#define SONIC_INT_TC            0x0080
-#define SONIC_INT_RDE           0x0040
-#define SONIC_INT_RBE           0x0020
+#define SONIC_INT_LCD		0x1000
+#define SONIC_INT_PINT		0x0800
+#define SONIC_INT_PKTRX		0x0400
+#define SONIC_INT_TXDN		0x0200
+#define SONIC_INT_TXER		0x0100
+#define SONIC_INT_TC		0x0080
+#define SONIC_INT_RDE		0x0040
+#define SONIC_INT_RBE		0x0020
 #define SONIC_INT_RBAE		0x0010
 #define SONIC_INT_CRC		0x0008
 #define SONIC_INT_FAE		0x0004
@@ -201,224 +208,61 @@
  * The interrupts we allow.
  */
 
-#define SONIC_IMR_DEFAULT	(SONIC_INT_BR | \
-				SONIC_INT_LCD | \
-                                SONIC_INT_PINT | \
+#define SONIC_IMR_DEFAULT     ( SONIC_INT_BR | \
+                                SONIC_INT_LCD | \
+                                SONIC_INT_RFO | \
                                 SONIC_INT_PKTRX | \
                                 SONIC_INT_TXDN | \
                                 SONIC_INT_TXER | \
                                 SONIC_INT_RDE | \
-                                SONIC_INT_RBE | \
                                 SONIC_INT_RBAE | \
                                 SONIC_INT_CRC | \
                                 SONIC_INT_FAE | \
                                 SONIC_INT_MP)
 
 
-#define	SONIC_END_OF_LINKS	0x0001
-
-
-#ifdef CONFIG_MACSONIC
-/*
- * Big endian like structures on 680x0 Macs
- */
-
-typedef struct {
-	u32 rx_bufadr_l;	/* receive buffer ptr */
-	u32 rx_bufadr_h;
-
-	u32 rx_bufsize_l;	/* no. of words in the receive buffer */
-	u32 rx_bufsize_h;
-} sonic_rr_t;
-
-/*
- * Sonic receive descriptor. Receive descriptors are
- * kept in a linked list of these structures.
- */
-
-typedef struct {
-	SREGS_PAD(pad0);
-	u16 rx_status;		/* status after reception of a packet */
-	 SREGS_PAD(pad1);
-	u16 rx_pktlen;		/* length of the packet incl. CRC */
-
-	/*
-	 * Pointers to the location in the receive buffer area (RBA)
-	 * where the packet resides. A packet is always received into
-	 * a contiguous piece of memory.
-	 */
-	 SREGS_PAD(pad2);
-	u16 rx_pktptr_l;
-	 SREGS_PAD(pad3);
-	u16 rx_pktptr_h;
-
-	 SREGS_PAD(pad4);
-	u16 rx_seqno;		/* sequence no. */
-
-	 SREGS_PAD(pad5);
-	u16 link;		/* link to next RDD (end if EOL bit set) */
-
-	/*
-	 * Owner of this descriptor, 0= driver, 1=sonic
-	 */
-
-	 SREGS_PAD(pad6);
-	u16 in_use;
-
-	caddr_t rda_next;	/* pointer to next RD */
-} sonic_rd_t;
-
-
-/*
- * Describes a Transmit Descriptor
- */
-typedef struct {
-	SREGS_PAD(pad0);
-	u16 tx_status;		/* status after transmission of a packet */
-	 SREGS_PAD(pad1);
-	u16 tx_config;		/* transmit configuration for this packet */
-	 SREGS_PAD(pad2);
-	u16 tx_pktsize;		/* size of the packet to be transmitted */
-	 SREGS_PAD(pad3);
-	u16 tx_frag_count;	/* no. of fragments */
-
-	 SREGS_PAD(pad4);
-	u16 tx_frag_ptr_l;
-	 SREGS_PAD(pad5);
-	u16 tx_frag_ptr_h;
-	 SREGS_PAD(pad6);
-	u16 tx_frag_size;
-
-	 SREGS_PAD(pad7);
-	u16 link;		/* ptr to next descriptor */
-} sonic_td_t;
-
-
-/*
- * Describes an entry in the CAM Descriptor Area.
- */
-
-typedef struct {
-	SREGS_PAD(pad0);
-	u16 cam_entry_pointer;
-	 SREGS_PAD(pad1);
-	u16 cam_cap0;
-	 SREGS_PAD(pad2);
-	u16 cam_cap1;
-	 SREGS_PAD(pad3);
-	u16 cam_cap2;
-} sonic_cd_t;
-
+#define SONIC_EOL       0x0001
 #define CAM_DESCRIPTORS 16
 
+/* Offsets in the various DMA buffers accessed by the SONIC */
 
-typedef struct {
-	sonic_cd_t cam_desc[CAM_DESCRIPTORS];
-	 SREGS_PAD(pad);
-	u16 cam_enable;
-} sonic_cda_t;
-
-#else				/* original declarations, little endian 32 bit */
-
-/*
- * structure definitions
- */
-
-typedef struct {
-	u32 rx_bufadr_l;	/* receive buffer ptr */
-	u32 rx_bufadr_h;
-
-	u32 rx_bufsize_l;	/* no. of words in the receive buffer */
-	u32 rx_bufsize_h;
-} sonic_rr_t;
-
-/*
- * Sonic receive descriptor. Receive descriptors are
- * kept in a linked list of these structures.
- */
-
-typedef struct {
-	u16 rx_status;		/* status after reception of a packet */
-	 SREGS_PAD(pad0);
-	u16 rx_pktlen;		/* length of the packet incl. CRC */
-	 SREGS_PAD(pad1);
-
-	/*
-	 * Pointers to the location in the receive buffer area (RBA)
-	 * where the packet resides. A packet is always received into
-	 * a contiguous piece of memory.
-	 */
-	u16 rx_pktptr_l;
-	 SREGS_PAD(pad2);
-	u16 rx_pktptr_h;
-	 SREGS_PAD(pad3);
-
-	u16 rx_seqno;		/* sequence no. */
-	 SREGS_PAD(pad4);
-
-	u16 link;		/* link to next RDD (end if EOL bit set) */
-	 SREGS_PAD(pad5);
-
-	/*
-	 * Owner of this descriptor, 0= driver, 1=sonic
-	 */
-
-	u16 in_use;
-	 SREGS_PAD(pad6);
-
-	caddr_t rda_next;	/* pointer to next RD */
-} sonic_rd_t;
-
-
-/*
- * Describes a Transmit Descriptor
- */
-typedef struct {
-	u16 tx_status;		/* status after transmission of a packet */
-	 SREGS_PAD(pad0);
-	u16 tx_config;		/* transmit configuration for this packet */
-	 SREGS_PAD(pad1);
-	u16 tx_pktsize;		/* size of the packet to be transmitted */
-	 SREGS_PAD(pad2);
-	u16 tx_frag_count;	/* no. of fragments */
-	 SREGS_PAD(pad3);
-
-	u16 tx_frag_ptr_l;
-	 SREGS_PAD(pad4);
-	u16 tx_frag_ptr_h;
-	 SREGS_PAD(pad5);
-	u16 tx_frag_size;
-	 SREGS_PAD(pad6);
-
-	u16 link;		/* ptr to next descriptor */
-	 SREGS_PAD(pad7);
-} sonic_td_t;
-
-
-/*
- * Describes an entry in the CAM Descriptor Area.
- */
-
-typedef struct {
-	u16 cam_entry_pointer;
-	 SREGS_PAD(pad0);
-	u16 cam_cap0;
-	 SREGS_PAD(pad1);
-	u16 cam_cap1;
-	 SREGS_PAD(pad2);
-	u16 cam_cap2;
-	 SREGS_PAD(pad3);
-} sonic_cd_t;
-
-#define CAM_DESCRIPTORS 16
+#define SONIC_BITMODE16 0
+#define SONIC_BITMODE32 1
+#define SONIC_BUS_SCALE(bitmode) ((bitmode) ? 4 : 2)
+/* Note!  These are all measured in bus-size units, so use SONIC_BUS_SCALE */
+#define SIZEOF_SONIC_RR 4
+#define SONIC_RR_BUFADR_L  0
+#define SONIC_RR_BUFADR_H  1
+#define SONIC_RR_BUFSIZE_L 2
+#define SONIC_RR_BUFSIZE_H 3
+
+#define SIZEOF_SONIC_RD 7
+#define SONIC_RD_STATUS   0
+#define SONIC_RD_PKTLEN   1
+#define SONIC_RD_PKTPTR_L 2
+#define SONIC_RD_PKTPTR_H 3
+#define SONIC_RD_SEQNO    4
+#define SONIC_RD_LINK     5
+#define SONIC_RD_IN_USE   6
+
+#define SIZEOF_SONIC_TD 8
+#define SONIC_TD_STATUS       0
+#define SONIC_TD_CONFIG       1
+#define SONIC_TD_PKTSIZE      2
+#define SONIC_TD_FRAG_COUNT   3
+#define SONIC_TD_FRAG_PTR_L   4
+#define SONIC_TD_FRAG_PTR_H   5
+#define SONIC_TD_FRAG_SIZE    6
+#define SONIC_TD_LINK         7
+
+#define SIZEOF_SONIC_CD 4
+#define SONIC_CD_ENTRY_POINTER 0
+#define SONIC_CD_CAP0          1
+#define SONIC_CD_CAP1          2
+#define SONIC_CD_CAP2          3
 
-
-typedef struct {
-	sonic_cd_t cam_desc[CAM_DESCRIPTORS];
-	u16 cam_enable;
-	 SREGS_PAD(pad);
-} sonic_cda_t;
-#endif				/* endianness */
+#define SIZEOF_SONIC_CDA ((CAM_DESCRIPTORS * SIZEOF_SONIC_CD) + 1)
+#define SONIC_CDA_CAM_ENABLE   (CAM_DESCRIPTORS * SIZEOF_SONIC_CD)
 
 /*
  * Some tunables for the buffer areas. Power of 2 is required
@@ -426,44 +270,60 @@
  *
  * MSch: use more buffer space for the slow m68k Macs!
  */
-#ifdef CONFIG_MACSONIC
-#define SONIC_NUM_RRS    32	/* number of receive resources */
-#define SONIC_NUM_RDS    SONIC_NUM_RRS	/* number of receive descriptors */
-#define SONIC_NUM_TDS    32	/* number of transmit descriptors */
-#else
-#define SONIC_NUM_RRS    16	/* number of receive resources */
-#define SONIC_NUM_RDS    SONIC_NUM_RRS	/* number of receive descriptors */
-#define SONIC_NUM_TDS    16	/* number of transmit descriptors */
-#endif
-#define SONIC_RBSIZE   1520	/* size of one resource buffer */
-
-#define SONIC_RDS_MASK   (SONIC_NUM_RDS-1)
-#define SONIC_TDS_MASK   (SONIC_NUM_TDS-1)
-
+#define SONIC_NUM_RRS   16            /* number of receive resources */
+#define SONIC_NUM_RDS   SONIC_NUM_RRS /* number of receive descriptors */
+#define SONIC_NUM_TDS   16            /* number of transmit descriptors */
+
+#define SONIC_RDS_MASK  (SONIC_NUM_RDS-1)
+#define SONIC_TDS_MASK  (SONIC_NUM_TDS-1)
+
+#define SONIC_RBSIZE	1520          /* size of one resource buffer */
+
+/* Again, measured in bus size units! */
+#define SIZEOF_SONIC_DESC (SIZEOF_SONIC_CDA	\
+	+ (SIZEOF_SONIC_TD * SONIC_NUM_TDS)	\
+	+ (SIZEOF_SONIC_RD * SONIC_NUM_RDS)	\
+	+ (SIZEOF_SONIC_RR * SONIC_NUM_RRS))
 
 /* Information that need to be kept for each board. */
 struct sonic_local {
-	sonic_cda_t cda;	/* virtual CPU address of CDA */
-	sonic_td_t tda[SONIC_NUM_TDS];	/* transmit descriptor area */
-	sonic_rr_t rra[SONIC_NUM_RRS];	/* receive resource area */
-	sonic_rd_t rda[SONIC_NUM_RDS];	/* receive descriptor area */
-	struct sk_buff *tx_skb[SONIC_NUM_TDS];	/* skbuffs for packets to transmit */
-	unsigned int tx_laddr[SONIC_NUM_TDS];	/* logical DMA address fro skbuffs */
-	unsigned char *rba;	/* start of receive buffer areas */
-	unsigned int cda_laddr;	/* logical DMA address of CDA */
-	unsigned int tda_laddr;	/* logical DMA address of TDA */
-	unsigned int rra_laddr;	/* logical DMA address of RRA */
-	unsigned int rda_laddr;	/* logical DMA address of RDA */
-	unsigned int rba_laddr;	/* logical DMA address of RBA */
-	unsigned int cur_rra;	/* current indexes to resource areas */
+	/* Bus size.  0 == 16 bits, 1 == 32 bits. */
+	int dma_bitmode;
+	/* Register offset within the longword (independent of endianness,
+	   and varies from one type of Macintosh SONIC to another
+	   (Aarrgh)) */
+	int reg_offset;
+	void *descriptors;
+	/* Crud.  These areas have to be within the same 64K.  Therefore
+       we allocate a desriptors page, and point these to places within it. */
+	void *cda;  /* CAM descriptor area */
+	void *tda;  /* Transmit descriptor area */
+	void *rra;  /* Receive resource area */
+	void *rda;  /* Receive descriptor area */
+	struct sk_buff* volatile rx_skb[SONIC_NUM_RRS];	/* packets to be received */
+	struct sk_buff* volatile tx_skb[SONIC_NUM_TDS];	/* packets to be transmitted */
+	unsigned int tx_len[SONIC_NUM_TDS]; /* lengths of tx DMA mappings */
+	/* Logical DMA addresses on MIPS, bus addresses on m68k
+	 * (so "laddr" is a bit misleading) */
+	dma_addr_t descriptors_laddr;
+	u32 cda_laddr;              /* logical DMA address of CDA */
+	u32 tda_laddr;              /* logical DMA address of TDA */
+	u32 rra_laddr;              /* logical DMA address of RRA */
+	u32 rda_laddr;              /* logical DMA address of RDA */
+	dma_addr_t rx_laddr[SONIC_NUM_RRS]; /* logical DMA addresses of rx skbuffs */
+	dma_addr_t tx_laddr[SONIC_NUM_TDS]; /* logical DMA addresses of tx skbuffs */
+	unsigned int rra_end;
+	unsigned int cur_rwp;
 	unsigned int cur_rx;
-	unsigned int cur_tx;
-	unsigned int dirty_tx;	/* last unacked transmit packet */
-	char tx_full;
+	unsigned int cur_tx;           /* first unacked transmit packet */
+	unsigned int eol_rx;
+	unsigned int eol_tx;           /* last unacked transmit packet */
+	unsigned int next_tx;          /* next free TD */
+	struct device *device;         /* generic device */
 	struct net_device_stats stats;
 };
 
-#define TX_TIMEOUT 6
+#define TX_TIMEOUT (3 * HZ)
 
 /* Index to functions, as function prototypes. */
 
@@ -476,6 +336,114 @@
 static void sonic_multicast_list(struct net_device *dev);
 static int sonic_init(struct net_device *dev);
 static void sonic_tx_timeout(struct net_device *dev);
+
+/* Internal inlines for reading/writing DMA buffers.  Note that bus
+   size and endianness matter here, whereas they don't for registers,
+   as far as we can tell. */
+/* OpenBSD calls this "SWO".  I'd like to think that sonic_buf_put()
+   is a much better name. */
+static inline void sonic_buf_put(void* base, int bitmode,
+				 int offset, __u16 val)
+{
+	if (bitmode)
+#ifdef __BIG_ENDIAN
+		((__u16 *) base + (offset*2))[1] = val;
+#else
+		((__u16 *) base + (offset*2))[0] = val;
+#endif
+	else
+	 	((__u16 *) base)[offset] = val;
+}
+
+static inline __u16 sonic_buf_get(void* base, int bitmode,
+				  int offset)
+{
+	if (bitmode)
+#ifdef __BIG_ENDIAN
+		return ((volatile __u16 *) base + (offset*2))[1];
+#else
+		return ((volatile __u16 *) base + (offset*2))[0];
+#endif
+	else
+		return ((volatile __u16 *) base)[offset];
+}
+
+/* Inlines that you should actually use for reading/writing DMA buffers */
+static inline void sonic_cda_put(struct net_device* dev, int entry,
+				 int offset, __u16 val)
+{
+	struct sonic_local* lp = (struct sonic_local *) dev->priv;
+	sonic_buf_put(lp->cda, lp->dma_bitmode,
+		      (entry * SIZEOF_SONIC_CD) + offset, val);
+}
+
+static inline __u16 sonic_cda_get(struct net_device* dev, int entry,
+				  int offset)
+{
+	struct sonic_local* lp = (struct sonic_local *) dev->priv;
+	return sonic_buf_get(lp->cda, lp->dma_bitmode,
+			     (entry * SIZEOF_SONIC_CD) + offset);
+}
+
+static inline void sonic_set_cam_enable(struct net_device* dev, __u16 val)
+{
+	struct sonic_local* lp = (struct sonic_local *) dev->priv;
+	sonic_buf_put(lp->cda, lp->dma_bitmode, SONIC_CDA_CAM_ENABLE, val);
+}
+
+static inline __u16 sonic_get_cam_enable(struct net_device* dev)
+{
+	struct sonic_local* lp = (struct sonic_local *) dev->priv;
+	return sonic_buf_get(lp->cda, lp->dma_bitmode, SONIC_CDA_CAM_ENABLE);
+}
+
+static inline void sonic_tda_put(struct net_device* dev, int entry,
+				 int offset, __u16 val)
+{
+	struct sonic_local* lp = (struct sonic_local *) dev->priv;
+	sonic_buf_put(lp->tda, lp->dma_bitmode,
+		      (entry * SIZEOF_SONIC_TD) + offset, val);
+}
+
+static inline __u16 sonic_tda_get(struct net_device* dev, int entry,
+				  int offset)
+{
+	struct sonic_local* lp = (struct sonic_local *) dev->priv;
+	return sonic_buf_get(lp->tda, lp->dma_bitmode,
+			     (entry * SIZEOF_SONIC_TD) + offset);
+}
+
+static inline void sonic_rda_put(struct net_device* dev, int entry,
+				 int offset, __u16 val)
+{
+	struct sonic_local* lp = (struct sonic_local *) dev->priv;
+	sonic_buf_put(lp->rda, lp->dma_bitmode,
+		      (entry * SIZEOF_SONIC_RD) + offset, val);
+}
+
+static inline __u16 sonic_rda_get(struct net_device* dev, int entry,
+				  int offset)
+{
+	struct sonic_local* lp = (struct sonic_local *) dev->priv;
+	return sonic_buf_get(lp->rda, lp->dma_bitmode,
+			     (entry * SIZEOF_SONIC_RD) + offset);
+}
+
+static inline void sonic_rra_put(struct net_device* dev, int entry,
+				 int offset, __u16 val)
+{
+	struct sonic_local* lp = (struct sonic_local *) dev->priv;
+	sonic_buf_put(lp->rra, lp->dma_bitmode,
+		      (entry * SIZEOF_SONIC_RR) + offset, val);
+}
+
+static inline __u16 sonic_rra_get(struct net_device* dev, int entry,
+				  int offset)
+{
+	struct sonic_local* lp = (struct sonic_local *) dev->priv;
+	return sonic_buf_get(lp->rra, lp->dma_bitmode,
+			     (entry * SIZEOF_SONIC_RR) + offset);
+}
 
 static const char *version =
     "sonic.c:v0.92 20.9.98 tsbogend@alpha.franken.de\n";

From sjhill@realitydiluted.com Sun Aug 21 20:29:43 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 21 Aug 2005 20:30:14 +0100 (BST)
Received: from eth13.com-link.com ([IPv6:::ffff:208.242.241.164]:7820 "EHLO
	real.realitydiluted.com") by linux-mips.org with ESMTP
	id <S8225322AbVHUT3m>; Sun, 21 Aug 2005 20:29:42 +0100
Received: from localhost ([127.0.0.1])
	by real.realitydiluted.com with esmtp (Exim 4.50 #1 (Debian))
	id 1E6uf0-0007tr-N0; Sun, 21 Aug 2005 13:35:10 -0500
Message-ID: <4308D75D.3090205@realitydiluted.com>
Date:	Sun, 21 Aug 2005 14:34:53 -0500
From:	"Steven J. Hill" <sjhill@realitydiluted.com>
User-Agent: Debian Thunderbird 1.0.6 (X11/20050802)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	mohanlal jangir <mohanlaljangir@hotmail.com>
CC:	linux-mips@linux-mips.org
Subject: Re: NPTL info needed
References: <200508181804.LAA04568@mon-irva-10.broadcom.com> <4304D201.2060306@mvista.com> <BAY18-DAV2A05369EA8C7D91990C16D2B50@phx.gbl>
In-Reply-To: <BAY18-DAV2A05369EA8C7D91990C16D2B50@phx.gbl>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sjhill@realitydiluted.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8777
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sjhill@realitydiluted.com
Precedence: bulk
X-list: linux-mips

mohanlal jangir wrote:
>
> Thanks for your help. I tried to apply this patch on Linux-2.6.10 and 
> many hunks failed. Could you tell me which kernel version this patch 
> should be applied? Also do I need to apply any patch to gcc, glibc 
> sources (and build a new toolchain)?
>
Mohanlal,

If you are wanting to work with NPTL and MIPS, please use the latest
Linux version from the Linux/MIPS cvs tree. The latest releases of
binutils-2.16.x contain NPTL support for MIPS. You will need to use
the HEAD of gcc cvs and the HEAD of glibc cvs in order to get the
MIPS NPTL support. Please note that NO backport of NPTL will be done
to versions of GCC older than 4.1.0. Have fun.

-Steve

From cw@f00f.org Sun Aug 21 20:56:45 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 21 Aug 2005 20:57:02 +0100 (BST)
Received: from ylpvm29-ext.prodigy.net ([IPv6:::ffff:207.115.57.60]:65460 "EHLO
	ylpvm29.prodigy.net") by linux-mips.org with ESMTP
	id <S8225322AbVHUT4p>; Sun, 21 Aug 2005 20:56:45 +0100
Received: from pimout3-ext.prodigy.net (pimout3-int.prodigy.net [207.115.4.218])
	by ylpvm29.prodigy.net (8.12.10 outbound/8.12.10) with ESMTP id j7LK1o4w019800
	for <linux-mips@linux-mips.org>; Sun, 21 Aug 2005 16:01:51 -0400
X-ORBL:	[63.205.185.3]
Received: from stupidest.org (adsl-63-205-185-3.dsl.snfc21.pacbell.net [63.205.185.3])
	by pimout3-ext.prodigy.net (8.13.4 outbound domainkey aix/8.13.4) with ESMTP id j7LK1pgi165638;
	Sun, 21 Aug 2005 16:01:52 -0400
Received: by taniwha.stupidest.org (Postfix, from userid 38689)
	id 5DE65528F22; Sun, 21 Aug 2005 13:01:51 -0700 (PDT)
Date:	Sun, 21 Aug 2005 13:01:51 -0700
From:	Chris Wedgwood <cw@f00f.org>
To:	"Steven J. Hill" <sjhill@realitydiluted.com>
Cc:	mohanlal jangir <mohanlaljangir@hotmail.com>,
	linux-mips@linux-mips.org
Subject: Re: NPTL info needed
Message-ID: <20050821200151.GA23815@taniwha.stupidest.org>
References: <200508181804.LAA04568@mon-irva-10.broadcom.com> <4304D201.2060306@mvista.com> <BAY18-DAV2A05369EA8C7D91990C16D2B50@phx.gbl> <4308D75D.3090205@realitydiluted.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4308D75D.3090205@realitydiluted.com>
Return-Path: <cw@f00f.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8778
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: cw@f00f.org
Precedence: bulk
X-list: linux-mips

On Sun, Aug 21, 2005 at 02:34:53PM -0500, Steven J. Hill wrote:

> If you are wanting to work with NPTL and MIPS, please use the latest
> Linux version from the Linux/MIPS cvs tree. The latest releases of
> binutils-2.16.x contain NPTL support for MIPS. You will need to use
> the HEAD of gcc cvs and the HEAD of glibc cvs in order to get the
> MIPS NPTL support. Please note that NO backport of NPTL will be done
> to versions of GCC older than 4.1.0. Have fun.

How stable is GCC is head?  Hostorically thre have been periods of
time when gcc itself wasn't stable or the code it produce wasn't
stable.

From macro@linux-mips.org Mon Aug 22 10:17:56 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 22 Aug 2005 10:18:12 +0100 (BST)
Received: from pollux.ds.pg.gda.pl ([IPv6:::ffff:153.19.208.7]:30739 "EHLO
	pollux.ds.pg.gda.pl") by linux-mips.org with ESMTP
	id <S8225341AbVHVJR4>; Mon, 22 Aug 2005 10:17:56 +0100
Received: from localhost (localhost [127.0.0.1])
	by pollux.ds.pg.gda.pl (Postfix) with ESMTP
	id 8C62EF59B2; Mon, 22 Aug 2005 11:17:55 +0200 (CEST)
Received: from pollux.ds.pg.gda.pl ([127.0.0.1])
 by localhost (pollux [127.0.0.1]) (amavisd-new, port 10024) with ESMTP
 id 01286-05; Mon, 22 Aug 2005 11:17:55 +0200 (CEST)
Received: from piorun.ds.pg.gda.pl (piorun.ds.pg.gda.pl [153.19.208.8])
	by pollux.ds.pg.gda.pl (Postfix) with ESMTP
	id 47469F5949; Mon, 22 Aug 2005 11:17:55 +0200 (CEST)
Received: from blysk.ds.pg.gda.pl (macro@blysk.ds.pg.gda.pl [153.19.208.6])
	by piorun.ds.pg.gda.pl (8.13.3/8.13.1) with ESMTP id j7M9Hvav022393;
	Mon, 22 Aug 2005 11:17:57 +0200
Date:	Mon, 22 Aug 2005 10:18:01 +0100 (BST)
From:	"Maciej W. Rozycki" <macro@linux-mips.org>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org
Subject: Re: CVS Update@linux-mips.org: linux
In-Reply-To: <20050820142723Z8225252-3678+7060@linux-mips.org>
Message-ID: <Pine.LNX.4.61L.0508221013180.26914@blysk.ds.pg.gda.pl>
References: <20050820142723Z8225252-3678+7060@linux-mips.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Virus-Scanned: ClamAV version 0.85.1, clamav-milter version 0.85 on piorun.ds.pg.gda.pl
X-Virus-Status:	Clean
X-Virus-Scanned: by amavisd-new at pollux.ds.pg.gda.pl
Return-Path: <macro@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8779
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: macro@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Sat, 20 Aug 2005 ralf@linux-mips.org wrote:

> Modified files:
> 	arch/mips/kernel: irq_cpu.c 
> 
> Log message:
> 	MT bulletproofing; MT also uses the software interrupts.

 Well, since they use a different controller structure and different 
functions, the user-visible name should be different too, shouldn't it?  
To be original ;-) -- how about "MIPS-MT"?

  Maciej

From ralf@linux-mips.org Mon Aug 22 11:20:57 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 22 Aug 2005 11:21:13 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:31005 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225341AbVHVKU5>; Mon, 22 Aug 2005 11:20:57 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7MAQAf4006262;
	Mon, 22 Aug 2005 11:26:10 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7MAQAdB006261;
	Mon, 22 Aug 2005 11:26:10 +0100
Date:	Mon, 22 Aug 2005 11:26:10 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	"Maciej W. Rozycki" <macro@linux-mips.org>
Cc:	linux-mips@linux-mips.org
Subject: Re: CVS Update@linux-mips.org: linux
Message-ID: <20050822102610.GB3780@linux-mips.org>
References: <20050820142723Z8225252-3678+7060@linux-mips.org> <Pine.LNX.4.61L.0508221013180.26914@blysk.ds.pg.gda.pl>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <Pine.LNX.4.61L.0508221013180.26914@blysk.ds.pg.gda.pl>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8780
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Mon, Aug 22, 2005 at 10:18:01AM +0100, Maciej W. Rozycki wrote:

> > Log message:
> > 	MT bulletproofing; MT also uses the software interrupts.
> 
>  Well, since they use a different controller structure and different 
> functions, the user-visible name should be different too, shouldn't it?  
> To be original ;-) -- how about "MIPS-MT"?

Thought about but then it's still hammering at the same old bits which
now just have received a different use.

  Ralf

From macro@linux-mips.org Mon Aug 22 12:44:28 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 22 Aug 2005 12:44:48 +0100 (BST)
Received: from pollux.ds.pg.gda.pl ([IPv6:::ffff:153.19.208.7]:32531 "EHLO
	pollux.ds.pg.gda.pl") by linux-mips.org with ESMTP
	id <S8225357AbVHVLo2>; Mon, 22 Aug 2005 12:44:28 +0100
Received: from localhost (localhost [127.0.0.1])
	by pollux.ds.pg.gda.pl (Postfix) with ESMTP
	id 656BEE1C99; Mon, 22 Aug 2005 13:49:43 +0200 (CEST)
Received: from pollux.ds.pg.gda.pl ([127.0.0.1])
 by localhost (pollux [127.0.0.1]) (amavisd-new, port 10024) with ESMTP
 id 13737-06; Mon, 22 Aug 2005 13:49:43 +0200 (CEST)
Received: from piorun.ds.pg.gda.pl (piorun.ds.pg.gda.pl [153.19.208.8])
	by pollux.ds.pg.gda.pl (Postfix) with ESMTP
	id 2BBC4E1C82; Mon, 22 Aug 2005 13:49:43 +0200 (CEST)
Received: from blysk.ds.pg.gda.pl (macro@blysk.ds.pg.gda.pl [153.19.208.6])
	by piorun.ds.pg.gda.pl (8.13.3/8.13.1) with ESMTP id j7MBnkbf027909;
	Mon, 22 Aug 2005 13:49:46 +0200
Date:	Mon, 22 Aug 2005 12:49:52 +0100 (BST)
From:	"Maciej W. Rozycki" <macro@linux-mips.org>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org
Subject: Re: CVS Update@linux-mips.org: linux
In-Reply-To: <20050822102610.GB3780@linux-mips.org>
Message-ID: <Pine.LNX.4.61L.0508221242540.26914@blysk.ds.pg.gda.pl>
References: <20050820142723Z8225252-3678+7060@linux-mips.org>
 <Pine.LNX.4.61L.0508221013180.26914@blysk.ds.pg.gda.pl>
 <20050822102610.GB3780@linux-mips.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Virus-Scanned: ClamAV version 0.85.1, clamav-milter version 0.85 on piorun.ds.pg.gda.pl
X-Virus-Status:	Clean
X-Virus-Scanned: by amavisd-new at pollux.ds.pg.gda.pl
Return-Path: <macro@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8781
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: macro@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Mon, 22 Aug 2005, Ralf Baechle wrote:

> >  Well, since they use a different controller structure and different 
> > functions, the user-visible name should be different too, shouldn't it?  
> > To be original ;-) -- how about "MIPS-MT"?
> 
> Thought about but then it's still hammering at the same old bits which
> now just have received a different use.

 Using another structure is enough for justification -- it's a different 
"controller".  Similarly the two variations of interrupts handled in 
arch/mips/dec/ioasic-irq.c are almost the same (the difference is even 
smaller than here), but using separate structures made me use different 
names.

  Maciej

From adrian@suse.de Mon Aug 22 13:06:58 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 22 Aug 2005 13:07:15 +0100 (BST)
Received: from ns2.suse.de ([IPv6:::ffff:195.135.220.15]:63118 "EHLO
	mx2.suse.de") by linux-mips.org with ESMTP id <S8225357AbVHVMG6>;
	Mon, 22 Aug 2005 13:06:58 +0100
Received: from Relay1.suse.de (mail2.suse.de [195.135.221.8])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx2.suse.de (Postfix) with ESMTP id 655C01D3BC
	for <linux-mips@linux-mips.org>; Mon, 22 Aug 2005 14:12:06 +0200 (CEST)
Received: from g209.suse.de (g209.suse.de [10.10.103.209])
	by Relay1.suse.de (Postfix) with ESMTP id 5D5EBA4B7
	for <linux-mips@linux-mips.org>; Mon, 22 Aug 2005 14:12:06 +0200 (CEST)
From:	Adrian Schroeter <adrian@suse.de>
Organization: SuSE AG
To:	linux-mips@linux-mips.org
Subject: Free 20" SGI monitors with W3 connectors
Date:	Mon, 22 Aug 2005 14:12:05 +0200
User-Agent: KMail/1.8.2
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200508221412.05607.adrian@suse.de>
Return-Path: <adrian@suse.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8782
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: adrian@suse.de
Precedence: bulk
X-list: linux-mips

Hi,

I do have 2 SGI monitors 20" with W3 connector (the standard monitors for 
Indy / Indigo2) sitting in my room and taking their room :)

Everyone who want to have them AND comes to Nuernberg/Germany to get them is 
welcome. I will NOT send them. But you may ask, if I do appear near your 
hometown in Germany in the next month ;)

The monitors will get hurt heavily otherwise, please rescue them ...

bye
adrian
-- 

Adrian Schroeter
SuSE AG,  Maxfeldstr. 5, 90409 Nuernberg, Germany
email: adrian@suse.de


From sjhill@realitydiluted.com Mon Aug 22 17:54:03 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 22 Aug 2005 17:54:21 +0100 (BST)
Received: from eth13.com-link.com ([IPv6:::ffff:208.242.241.164]:15769 "EHLO
	real.realitydiluted.com") by linux-mips.org with ESMTP
	id <S8225344AbVHVQyD>; Mon, 22 Aug 2005 17:54:03 +0100
Received: from localhost ([127.0.0.1])
	by real.realitydiluted.com with esmtp (Exim 4.50 #1 (Debian))
	id 1E7Ehw-0008Ld-Er; Mon, 22 Aug 2005 10:59:32 -0500
Message-ID: <430A0463.4070004@realitydiluted.com>
Date:	Mon, 22 Aug 2005 11:59:15 -0500
From:	"Steven J. Hill" <sjhill@realitydiluted.com>
User-Agent: Debian Thunderbird 1.0.6 (X11/20050802)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	Chris Wedgwood <cw@f00f.org>
CC:	mohanlal jangir <mohanlaljangir@hotmail.com>,
	linux-mips@linux-mips.org
Subject: Re: NPTL info needed
References: <200508181804.LAA04568@mon-irva-10.broadcom.com> <4304D201.2060306@mvista.com> <BAY18-DAV2A05369EA8C7D91990C16D2B50@phx.gbl> <4308D75D.3090205@realitydiluted.com> <20050821200151.GA23815@taniwha.stupidest.org>
In-Reply-To: <20050821200151.GA23815@taniwha.stupidest.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sjhill@realitydiluted.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8783
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sjhill@realitydiluted.com
Precedence: bulk
X-list: linux-mips

Chris Wedgwood wrote:
> 
> How stable is GCC is head?  Hostorically thre have been periods of
> time when gcc itself wasn't stable or the code it produce wasn't
> stable.
>
The last working GCC 4.1.0 I checked out was on 20050604. I have yet
to get a cross build to work with uClibc. glibc-based toolchains seem
to work okay, but yes, GCC 4.1.0 is a piece of ****.

-Steve

From hjl@lucon.org Mon Aug 22 20:55:42 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 22 Aug 2005 20:56:04 +0100 (BST)
Received: from smtp112.sbc.mail.mud.yahoo.com ([IPv6:::ffff:68.142.198.211]:29554
	"HELO smtp112.sbc.mail.mud.yahoo.com") by linux-mips.org with SMTP
	id <S8225344AbVHVTzm>; Mon, 22 Aug 2005 20:55:42 +0100
Received: (qmail 53560 invoked from network); 22 Aug 2005 20:00:56 -0000
Received: from unknown (HELO lucon.org) (hjjean@sbcglobal.net@67.122.70.18 with login)
  by smtp112.sbc.mail.mud.yahoo.com with SMTP; 22 Aug 2005 20:00:55 -0000
Received: by lucon.org (Postfix, from userid 1000)
	id 9F56F97BE3; Mon, 22 Aug 2005 13:00:53 -0700 (PDT)
Date:	Mon, 22 Aug 2005 13:00:53 -0700
From:	"H. J. Lu" <hjl@lucon.org>
To:	linux-gcc@vger.kernel.org,
	GNU C Library <libc-alpha@sources.redhat.com>,
	gcc@gcc.gnu.org
Cc:	Mat Hostetter <mat@lcs.mit.edu>, Warner Losh <imp@village.org>,
	linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>,
	Linas Vepstas <linas@linas.org>
Subject: The Linux binutils 2.16.91.0.3 is released
Message-ID: <20050822200053.GA29154@lucon.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.4.1i
Return-Path: <hjl@lucon.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8784
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: hjl@lucon.org
Precedence: bulk
X-list: linux-mips

This is the beta release of binutils 2.16.91.0.3 for Linux, which is
based on binutils 2005 0821 in CVS on sources.redhat.com plus various
changes. It is purely for Linux.

The new i386/x86_64 assemblers no longer accept instructions for moving
between a segment register and a 32bit memory location, i.e.,

	movl (%eax),%ds
	movl %ds,(%eax)

To generate instructions for moving between a segment register and a
16bit memory location without the 16bit operand size prefix, 0x66,

	mov (%eax),%ds
	mov %ds,(%eax)

should be used. It will work with both new and old assemblers. The
assembler starting from 2.16.90.0.1 will also support

	movw (%eax),%ds
	movw %ds,(%eax)

without the 0x66 prefix. Patches for 2.4 and 2.6 Linux kernels are
available at

http://www.kernel.org/pub/linux/devel/binutils/linux-2.4-seg-4.patch
http://www.kernel.org/pub/linux/devel/binutils/linux-2.6-seg-5.patch

The ia64 assembler is now defaulted to tune for Itanium 2 processors.
To build a kernel for Itanium 1 processors, you will need to add

ifeq ($(CONFIG_ITANIUM),y)
	CFLAGS += -Wa,-mtune=itanium1
	AFLAGS += -Wa,-mtune=itanium1
endif

to arch/ia64/Makefile in your kernel source tree.

Please report any bugs related to binutils 2.16.91.0.3 to hjl@lucon.org

and

http://www.sourceware.org/bugzilla/

If you don't use

# rpmbuild -ta binutils-xx.xx.xx.xx.xx.tar.bz2

to compile the Linux binutils, please read patches/README in source
tree to apply Linux patches if there are any.

Changes from binutils 2.16.91.0.2:

1. Update from binutils 2005 0821.
2. Support x86-64 medium model.
3. Fix "objdump -S --adjust-vma=xxx" (PR 1179).
4. Reduce R_IA64_NONE relocations from R_IA64_LDXMOV relaxation.
5. Fix x86 linker regression for dosemu.
6. Add "readelf -t/--section-details" to display section details.
7. Fix "as -al=file" regression (PR 1118).

Changes from binutils 2.16.91.0.1:

1. Update from binutils 2005 0720.
2. Add Intel VMX support.
3. Add AMD SVME support.
4. Add x86-64 new relocations for medium model.
5. Fix a PIE regression (PR 975).
6. Fix an x86_64 signed 32bit displacement regression.
7. Fix PPC PLT (PR 1004). 
8. Improve empty section removal.

Changes from binutils 2.16.90.0.3:

1. Update from binutils 2005 0622.
2. Fix a linker versioning bug exposed by gcc 4 (PR 1022/1023/1025).
3. Optimize ia64 br->brl relaxation (PR 834).
4. Improve linker empty section removal.
5. Fix DWARF 2 line number reporting (PR 990).
6. Fix DWARF 2 line number reporting regression on assembly file (PR
1000).

Changes from binutils 2.16.90.0.2:

1. Update from binutils 2005 0510.
2. Update ia64 assembler to support comdat group section generated by
gcc 4 (PR 940).
3. Fix a linker crash on bad input (PR 939).
4. Fix a sh64 assembler regression (PR 936).
5. Support linker script on executable (PR 882).
6. Fix the linker -pie regression (PR 878).
7. Fix an x86_64 disassembler bug (PR 843).
8. Fix a PPC linker regression.
9. Misc speed up.

Changes from binutils 2.16.90.0.1:

1. Update from binutils 2005 0429.
2. Fix an ELF linker regression (PR 815).
3. Fix an empty section removal related bug.
4. Fix an ia64 linker regression (PR 855).
5. Don't allow local symbol to be equated common/undefined symbols (PR
857).
6. Fix the ia64 linker to handle local dynamic symbol error reporting.
7. Make non-debugging reference to discarded section an error (PR 858).
8. Support Sparc/TLS.
9. Support rpm build with newer rpm.
10. Fix an alpha linker regression.
11. Fix the non-gcc build regression.

Changes from binutils 2.15.94.0.2.2:

1. Update from binutils 2005 0408.
2. The i386/x86_64 assemblers no longer accept instructions for moving
between a segment register and a 32bit memory location.
3. The x86_64 assembler now allows movq between a segment register and
a 64bit general purpose register.
4. 20x Speed up linker for input files with >64K sections.
5. Properly report ia64 linker relaxation failures.
6. Support tuning ia64 assembler for Itanium 2 processors.
7. Linker will remove empty unused output sections.
8. Add -N to readelf to display full section names.
9. Fix the ia64 linker to support linkonce text sections without unwind
sections.
10. More unwind directive checkings in the ia64 assembler.
11. Speed up linker with wildcard handling.
12. Fix readelf to properly dump .debug_ranges and .debug_loc sections.

Changes from binutils 2.15.94.0.2:

1. Fix greater than 64K section support in linker.
2. Properly handle i386 and x86_64 protected symbols in linker.
3. Fix readelf for LEB128 on 64bit hosts.
4. Speed up readelf for section group process.
5. Include ia64 texinfo pages.
6. Change ia64 assembler to check hint.b for Montecito.
7. Improve relaxation failure report in ia64 linker.
8. Fix ia64 linker to allow relax backward branch in the same section.

Changes from binutils 2.15.94.0.1:

1. Update from binutils 2004 1220.
2. Fix strip for TLS symbol references.

Changes from binutils 2.15.92.0.2:

1. Update from binutils 2004 1121.
2. Put ia64 .ctors/.dtors sections next to small data section for
Intel ia64 compiler.
3. Fix -Bdynamic/-Bstatic handling for linker script.
4. Provide more information on relocation overflow.
5. Add --sort-section to linker.
6. Support icc 8.1 unwind info in readelf.
7. Fix the infinite loop bug on bad input in the ia64 assembler.
8. Fix ia64 SECREL relocation in linker.
9. Fix a section group memory leak in readelf.

Changes from binutils 2.15.91.0.2:

1. Update from binutils 2004 0927.
2. Work around a section header bug in Intel ia64 compiler.
3. Fix an unwind directive bug in the ia64 assembler.
4. Fix various PPC bugs.
5. Update ARM support.
6. Fix an x86-64 linker warning while building Linux kernel.

Changes from binutils 2.15.91.0.1:

1. Update from binutils 2004 0727.
2. Fix the x86_64 linker to prevent non-PIC code in shared library.
3. Fix the ia64 linker to warn the relotable files which can't be
relaxed.
4. Fix the comdat group support. Allow mix single-member comdat group
with linkonce section.
5. Added --add-needed/--no-add-needed options to linker.
6. Fix the SHF_LINK_ORDER support.
7. Fix the ia64 assembler for multiple sections with the same name and
SHT_IA_64_UNWIND sections.
8. Fix the ia64 assembler for merge section and relaxation.

Changes from binutils 2.15.90.0.3:

1. Update from binutils 2004 0527.
2. Fix -x auto option in the ia64 assembler.
3. Add the AR check in the ia64 assembler.
4. Fix the section group support.
5. Add a new -z relro linker option.
6. Fix an exception section placement bug in linker.
7. Add .serialize.data and .serialize.instruction to the ia64
assembler.

Changes from binutils 2.15.90.0.2:

1. Update from binutils 2004 0415.
2. Fix the linker for weak undefined symbol handling.
3. Fix the ELF/Sparc and ELF/Sparc64 linker for statically linking PIC
code.

Changes from binutils 2.15.90.0.1.1:

1. Update from binutils 2004 0412.
2. Add --as-needed/--no-as-needed to linker.
3. Fix -z defs in linker.
4. Always reserve the memory for ia64 dynamic linker.
5. Fix a race condition in ia64 lazy binding.

Changes from binutils 2.15.90.0.1:

1. Fixed an ia64 assembler bug.
2. Install the assembler man page.

Changes from binutils 2.14.90.0.8:

1. Update from binutils 2004 0303.
2. Fixed linker for undefined symbols with non-default visibility.
3. Sped up linker weakdef symbol handling.
4. Fixed mixing ELF32 and ELF64 object files in archive.
5. Added ia64 linker brl optimization.
6. Fixed ia64 linker to disallow invalid dynamic relocations.
7. Fixed DT_TEXTREL handling in ia64 linker.
8. Fixed alignment handling in ia64 assembler.
9. Improved ia64 assembler unwind table handling. 

Changes from binutils 2.14.90.0.7:

1. Update from binutils 2004 0114.
2. Fixed an ia64 assembler unwind table bug. 
3. Better handle IPF linker relaxation overflow.
4. Fixed misc PPC bugs.

Changes from binutils 2.14.90.0.6:

1. Update from binutils 2003 1029.
2. Allow type changes for undefined symbols.
3. Fix EH frame optimization.
4. Fix the check for undefined versioned symbol with wildcard.
5. Support generating code for Itanium.
6. Detect and warn bad symbol index.
7. Update IPF assemebler DV check.

Changes from binutils 2.14.90.0.5:

1. Update from binutils 2003 0820.
2. No longer use section names for ELF section types nor flags.
3. Fix some ELF/IA64 linker bugs.
4. Fix some ELF/ppc bugs.
5. Add archive support to readelf.

Changes from binutils 2.14.90.0.4.1:

1. Update from binutils 2003 0722.
2. Fix an ELF/mips linker bug.
3. Fix an ELF/hpppa linker bug.
4. Fix an ELF/ia64 assembler bug.
5. Fix a linkonce support with C++ debug.
6. A new working C++ demangler.
7. Various alpha, mips, ia64, ... bug fixes.
8. Support for the current gcc and glibc.

Changes from binutils 2.14.90.0.4:
 
1. Fix an ia64 assembler hint@pause bug.
2. Support Intel Prescott New Instructions.

Changes from binutils 2.14.90.0.3:

1. Work around the brain dead libtool.

Changes from binutils 2.14.90.0.2:

1. Update from binutils 2003 0523.
2. Fix 2 ELF visibility bugs.
3. Fix ELF/ppc linker bugs.

Changes from binutils 2.14.90.0.1:

1. Update from binutils 2003 0515.
2. Fix various ELF visibility bugs.
3. Fix some ia64 linker bugs.
4. Add more IAS compatibilities to ia64 assembler.

Changes from binutils 2.13.90.0.20:

1. Update from binutils 2003 0505.
2. Fix various ELF visibility bugs.
3. Fix some ia64 linker bugs.
4. Fix some ia64 assembler bugs.
5. Add some IAS compatibilities to ia64 assembler.
6. Fix ELF common symbol alignment.
7. Fix ELF weak symbol handling.

Changes from binutils 2.13.90.0.18:

1. Update from binutils 2003 0319.
2. Fix an ia64 linker brl relaxation bug.
3. Fix some ELF/ppc linker bugs.

Changes from binutils 2.13.90.0.16:

1. Update from binutils 2003 0121.
2. Fix an ia64 gas bug.
3. Fix some TLS bugs.
4. Fix some ELF/ppc bugs.
5. Fix an ELF/m68k bug.

2. Include /usr/bin/c++filt.
Changes from binutils 2.13.90.0.14:

1. Update from binutils 2002 1126.
2. Include /usr/bin/c++filt.
3. Fix "ld -r" with execption handling.

Changes from binutils 2.13.90.0.10:

1. Update from binutils 2002 1114.
2. Fix ELF/alpha bugs.
3. Fix an ELF/i386 assembler bug.

Changes from binutils 2.13.90.0.4:

1. Update from binutils 2002 1010.
2. More ELF/PPC linker bug fixes.
3. Fix an ELF/alpha linker bug.
4. Fix an ELF/sparc linker bug to support Solaris.
5. More TLS updates.

Changes from binutils 2.13.90.0.3:

1. Update from binutils 2002 0814.
2. Fix symbol versioning bugs for gcc 3.2.
3. Fix mips gas.

Changes from binutils 2.13.90.0.2:

1. Update from binutils 2002 0809.
2. Fix a mips gas compatibility bug.
3. Fix an x86 TLS bfd bug.
4. Fix an x86 PIC gas bug.
5. Improve symbol versioning support.

The file list:

1. binutils-2.16.91.0.3.tar.bz2. Source code.
2. binutils-2.16.91.0.2-2.16.91.0.3.diff.bz2. Patch against the
   previous beta source code.
3. binutils-2.16.91.0.3-1.i386.rpm. IA-32 binary RPM for RedHat EL 3.
4. binutils-2.16.91.0.3-1.ia64.rpm. IA-64 binary RPM for RedHat EL 3.
5. binutils-2.16.91.0.3-1.x86_64.rpm. X64_64 binary RPM for RedHat
   EL 3.

There is no separate source rpm. You can do

# rpmbuild -ta binutils-2.16.91.0.3.tar.bz2

to create both binary and source rpms.

The primary sites for the beta Linux binutils are:

1. http://www.kernel.org/pub/linux/devel/binutils/

Thanks.


H.J. Lu
hjl@lucon.org
08/22/2005

From djohnson@sw.starentnetworks.com Mon Aug 22 22:03:13 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 22 Aug 2005 22:03:28 +0100 (BST)
Received: from pasta.sw.starentnetworks.com ([IPv6:::ffff:12.33.234.10]:13960
	"EHLO pasta.sw.starentnetworks.com") by linux-mips.org with ESMTP
	id <S8225373AbVHVVDN>; Mon, 22 Aug 2005 22:03:13 +0100
Received: from cortez.sw.starentnetworks.com (cortez.sw.starentnetworks.com [12.33.233.12])
	by pasta.sw.starentnetworks.com (Postfix) with ESMTP
	id 55D6F149734; Mon, 22 Aug 2005 17:08:20 -0400 (EDT)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <17162.16068.212165.340275@cortez.sw.starentnetworks.com>
Date:	Mon, 22 Aug 2005 17:08:20 -0400
From:	Dave Johnson <djohnson+linuxmips@sw.starentnetworks.com>
To:	Daniel Jacobowitz <dan@debian.org>,
	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org
Subject: gdb gets confused with o32 core files, WANT_COMPAT_REG_H needed?
X-Mailer: VM 7.07 under 21.4 (patch 6) "Common Lisp" XEmacs Lucid
Return-Path: <djohnson@sw.starentnetworks.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8785
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: djohnson+linuxmips@sw.starentnetworks.com
Precedence: bulk
X-list: linux-mips


I've been trying to fix core file support for 64bit kernel with o32
userspace (working against 2.6.12 cvs tag).

After applying the patch posted on 13 Feb 2005 from Daniel Jacobowitz
to fix binfmt_elfo32.c (any reason this didn't make it into CVS?),
I still ran into trouble with gdb not understanding the NT_PRSTATUS
header in the core file.

While Dan's fix makes the kernel use elf32 definitions, gdb was still
getting confused by pr_reg contained in the core file.

Dan's definition of ELF_CORE_COPY_REGS in binfmt_elfo32.c is copying
the registers using EF_R0 as 0 not 6 producing results into offset 0
through 37 not 6 through 43 as gdb expects for 32bit core files.

Below patch (applied after Dan's patch) writes the registers at offset
6 making gdb much happier.

-- 
Dave Johnson
Starent Networks


=======================

Fix o32 core files under 64bit kernel to use correct register
offset in NT_PRSTATUS

Signed-off-by: Dave Johnson <djohnson+linuxmips@sw.starentnetworks.com>

===== arch/mips/kernel/binfmt_elfo32.c 1.7 vs edited =====
--- 1.7/arch/mips/kernel/binfmt_elfo32.c	2005-08-20 12:30:12 -04:00
+++ edited/arch/mips/kernel/binfmt_elfo32.c	2005-08-22 16:09:59 -04:00
@@ -51,6 +51,7 @@
 #define TASK32_SIZE		0x7fff8000UL
 #undef ELF_ET_DYN_BASE
 #define ELF_ET_DYN_BASE         (TASK32_SIZE / 3 * 2)
+#define WANT_COMPAT_REG_H
 
 #include <asm/processor.h>
 #include <linux/module.h>
===== include/asm-mips/reg.h 1.1 vs edited =====
--- 1.1/include/asm-mips/reg.h	2005-02-02 11:39:14 -05:00
+++ edited/include/asm-mips/reg.h	2005-08-22 15:55:04 -04:00
@@ -70,7 +70,7 @@
 
 #endif
 
-#if CONFIG_MIPS64
+#if defined(CONFIG_MIPS64) && !defined(WANT_COMPAT_REG_H)
 
 #define EF_R0			 0
 #define EF_R1			 1


From vilas_tharakan@yahoo.com Mon Aug 22 22:45:50 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 22 Aug 2005 22:46:11 +0100 (BST)
Received: from web42206.mail.yahoo.com ([IPv6:::ffff:66.218.93.207]:41657 "HELO
	web42206.mail.yahoo.com") by linux-mips.org with SMTP
	id <S8225364AbVHVVpu>; Mon, 22 Aug 2005 22:45:50 +0100
Received: (qmail 19804 invoked by uid 60001); 22 Aug 2005 21:51:04 -0000
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
  s=s1024; d=yahoo.com;
  h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding;
  b=EtypWN5Bsb46cKMDIN2gon3hE17nKe7K7uoNDNSsITN17YWV/klj7zYxnVeWdPf80WUarUIisVVWADW/DYS/b52s+hZfdANqLncU2kx5/gmd23SNT45dTtKlz+QmldUS/R3a71CdoebvDGeYzQQRhNBZ7XM0UTiY7A55XNIjSJY=  ;
Message-ID: <20050822215104.19802.qmail@web42206.mail.yahoo.com>
Received: from [134.244.53.32] by web42206.mail.yahoo.com via HTTP; Mon, 22 Aug 2005 14:51:04 PDT
Date:	Mon, 22 Aug 2005 14:51:04 -0700 (PDT)
From:	Vilas Tharakan <vilas_tharakan@yahoo.com>
Subject: ERROR regarding undefined reference to `__rpc_thread_svc_fdset'
To:	linux-mips@linux-mips.org
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="0-583335098-1124747464=:16246"
Content-Transfer-Encoding: 8bit
Return-Path: <vilas_tharakan@yahoo.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8786
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: vilas_tharakan@yahoo.com
Precedence: bulk
X-list: linux-mips

--0-583335098-1124747464=:16246
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hi,
I am able to build my object files and the shared library fine (libpublication.so in my case).
when i try to link my executeable against the library libpublication.so, i am getting undefined reference to `__rpc_thread_svc_fdset' error.
One noticeable thing is when i do a nm on libpublication.so, i get the function name
`__rpc_thread_svc_fdset' as __rpc_thread_svc_fdset@@GLIBC_2.2.5
DO any know how can i resolve this issue.
regards
vilas
 

		
---------------------------------
 Start your day with Yahoo! - make it your home page 
--0-583335098-1124747464=:16246
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

<DIV>Hi,</DIV>
<DIV>I am able to build my object files and the shared library fine (libpublication.so in my case).</DIV>
<DIV>when i try to link my executeable against the library libpublication.so, i am getting undefined reference to `__rpc_thread_svc_fdset' error.</DIV>
<DIV>One noticeable thing is when i do a nm on libpublication.so, i get the function name</DIV>
<DIV>`__rpc_thread_svc_fdset' as <A href="mailto:__rpc_thread_svc_fdset@@GLIBC_2.2.5">__rpc_thread_svc_fdset@@GLIBC_2.2.5</A></DIV>
<DIV>DO any know how can i resolve this issue.</DIV>
<DIV>regards</DIV>
<DIV>vilas</DIV>
<DIV>&nbsp;</DIV><p>
		<hr size=1> <a href="http://us.rd.yahoo.com/evt=34442/*http://www.yahoo.com/r/hs">Start your day with Yahoo! - make it your home page </a>
--0-583335098-1124747464=:16246--

From Brian.Knittel@powertv.com Tue Aug 23 01:55:11 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 23 Aug 2005 01:55:30 +0100 (BST)
Received: from mask.powertv.com ([IPv6:::ffff:12.146.136.163]:60287 "EHLO
	hqmail01.powertv.com") by linux-mips.org with ESMTP
	id <S8225385AbVHWAzL>; Tue, 23 Aug 2005 01:55:11 +0100
X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0
content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="utf-8"
Content-Transfer-Encoding: base64
Subject: What is the state of  KDB on MIPS?
Date:	Mon, 22 Aug 2005 18:00:27 -0700
Message-ID: <762C0A863A7674478671627FEAF5848105AF9151@hqmail01.powertv.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: What is the state of  KDB on MIPS?
Thread-Index: AcWnfgzdE/lW8rVCT/m95+wNPa/iEQ==
From:	"Knittel, Brian" <Brian.Knittel@powertv.com>
To:	<linux-mips@linux-mips.org>
Return-Path: <Brian.Knittel@powertv.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8787
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: Brian.Knittel@powertv.com
Precedence: bulk
X-list: linux-mips

VGhlcmUgYXJlIGEgY291cGxlIG9mIHJlZmVyZW5jZXMgdG8gS0RCIGluIHRoZSBhcmNoaXZlLCBi
dXQgbm90aGluZyByZWNlbnQuIFdoYXQgaXMgdGhlIHN0YXRlIG9mIEtEQiBvbiBNSVBTPw0KIA0K
VGhhbmtzLA0KLS1Ccmlhbg0K

From jgarzik@pobox.com Tue Aug 23 06:27:24 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 23 Aug 2005 06:27:50 +0100 (BST)
Received: from mail.dvmed.net ([IPv6:::ffff:216.237.124.58]:21385 "EHLO
	mail.dvmed.net") by linux-mips.org with ESMTP id <S8224914AbVHWF1Y>;
	Tue, 23 Aug 2005 06:27:24 +0100
Received: from cpe-069-134-188-146.nc.res.rr.com ([69.134.188.146] helo=[10.10.10.88])
	by mail.dvmed.net with esmtpsa (Exim 4.52 #1 (Red Hat Linux))
	id 1E7ROl-0004TA-N8; Tue, 23 Aug 2005 05:32:36 +0000
Message-ID: <430AB4F0.1060904@pobox.com>
Date:	Tue, 23 Aug 2005 01:32:32 -0400
From:	Jeff Garzik <jgarzik@pobox.com>
User-Agent: Mozilla Thunderbird 1.0.6-1.1.fc4 (X11/20050720)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	Finn Thain <fthain@telegraphics.com.au>
CC:	Roman Zippel <zippel@linux-m68k.org>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Ralf Baechle <ralf@linux-mips.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Linux/m68k <linux-m68k@vger.kernel.org>,
	Linux/m68k on Mac <linux-mac68k@mac.linux-m68k.org>,
	Linux MIPS <linux-mips@linux-mips.org>,
	Linux net <linux-net@vger.kernel.org>
Subject: Re: [PATCH 1/1 RESEND] macsonic/jazzsonic network drivers update
References: <200503070210.j272ARii023023@hera.kernel.org> <Pine.LNX.4.62.0503221807160.20753@numbat.sonytel.be> <20050323100139.GB8813@linux-mips.org> <Pine.LNX.4.61.0506121454410.1470@loopy.telegraphics.com.au> <20050615114158.GA9411@linux-mips.org> <Pine.LNX.4.61.0506152220460.22046@loopy.telegraphics.com.au> <20050615142717.GD9411@linux-mips.org> <Pine.LNX.4.61.0506160218310.24328@loopy.telegraphics.com.au> <Pine.LNX.4.61.0506160336410.24908@loopy.telegraphics.com.au> <20050616092257.GE5202@linux-mips.org> <Pine.LNX.4.61.0506162129450.31164@loopy.telegraphics.com.au> <Pine.LNX.4.61.0506270227510.1015@loopy.telegraphics.com.au> <42BEEC32.7040807@pobox.com> <Pine.LNX.4.61.0507130122220.4355@loopy.telegraphics.com.au> <Pine.LNX.4.63.0508201406350.3539@loopy.telegraphics.com.au> <4306B689.6050705@pobox.com> <Pine.LNX.4.63.0508201521410.3539@loopy.telegraphics.com.au>
In-Reply-To: <Pine.LNX.4.63.0508201521410.3539@loopy.telegraphics.com.au>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <jgarzik@pobox.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8788
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: jgarzik@pobox.com
Precedence: bulk
X-list: linux-mips

applied


From spodstavin@ru.mvista.com Tue Aug 23 09:22:32 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 23 Aug 2005 09:22:49 +0100 (BST)
Received: from RT-soft-1.Moscow.itn.ru ([IPv6:::ffff:80.240.96.90]:1668 "EHLO
	buildserver.ru.mvista.com") by linux-mips.org with ESMTP
	id <S8224808AbVHWIWc>; Tue, 23 Aug 2005 09:22:32 +0100
Received: from 192.168.1.133 ([10.150.0.9])
	by buildserver.ru.mvista.com (8.11.6/8.11.6) with ESMTP id j7N8Rot29561;
	Tue, 23 Aug 2005 13:27:51 +0500
Subject: Re: What is the state of  KDB on MIPS?
From:	Sergey Podstavin <spodstavin@ru.mvista.com>
Reply-To: spodstavin@ru.mvista.com
To:	"Knittel, Brian" <Brian.Knittel@powertv.com>
Cc:	linux-mips <linux-mips@linux-mips.org>
In-Reply-To: <762C0A863A7674478671627FEAF5848105AF9151@hqmail01.powertv.com>
References: <762C0A863A7674478671627FEAF5848105AF9151@hqmail01.powertv.com>
Content-Type: text/plain
Organization: MontaVista
Date:	Tue, 23 Aug 2005 12:28:03 +0400
Message-Id: <1124785684.5499.28.camel@localhost.localdomain>
Mime-Version: 1.0
X-Mailer: Evolution 2.0.2 (2.0.2-3) 
Content-Transfer-Encoding: 7bit
Return-Path: <spodstavin@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8789
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: spodstavin@ru.mvista.com
Precedence: bulk
X-list: linux-mips

It works fine, I'm using it on NEC VR5701

Best wishes,
Sergey Podstavin.

On Mon, 2005-08-22 at 18:00 -0700, Knittel, Brian wrote:
> There are a couple of references to KDB in the archive, but nothing recent. What is the state of KDB on MIPS?
>  
> Thanks,
> --Brian
> 
> 


From bryan.althouse@3phoenix.com Tue Aug 23 15:02:00 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 23 Aug 2005 15:02:17 +0100 (BST)
Received: from rwcrmhc12.comcast.net ([IPv6:::ffff:204.127.198.43]:37367 "EHLO
	rwcrmhc12.comcast.net") by linux-mips.org with ESMTP
	id <S8225393AbVHWOB7>; Tue, 23 Aug 2005 15:01:59 +0100
Received: from ba3pi (pcp0010731669pcs.howard01.md.comcast.net[69.243.71.130])
          by comcast.net (rwcrmhc12) with SMTP
          id <2005082314071501400q9m8ke>; Tue, 23 Aug 2005 14:07:16 +0000
From:	"Bryan Althouse" <bryan.althouse@3phoenix.com>
To:	<linux-mips@linux-mips.org>
Subject: custom ide driver causes "Badness in smp_call_function"
Date:	Tue, 23 Aug 2005 10:07:02 -0400
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_008F_01C5A7CA.68D6B0E0"
X-Mailer: Microsoft Office Outlook, Build 11.0.6353
Thread-Index: AcWn6+8Url8jVLf9TUGrSIXTM5IkDQ==
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-Id: <20050823140159Z8225393-3678+7283@linux-mips.org>
Return-Path: <bryan.althouse@3phoenix.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8790
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: bryan.althouse@3phoenix.com
Precedence: bulk
X-list: linux-mips

This is a multi-part message in MIME format.

------=_NextPart_000_008F_01C5A7CA.68D6B0E0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi all,

I have added a compact flash disk onto the local bus of an rm9224 mips
processor.  We are using an FPGA as an IDE host adaptor.  Our driver works
great when the kernel is compiled for a single processor.  But if SMP
support is enabled, the kernel dies with: 
            .
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
Ide:  Assuming 50MHz system bus speed for PIO modes; override with
idebuss=xx
Badness in smp_call_function at arch/mips/kernel/smp.c:149
Call Trace:
 [<ffffffff8010aff8>] smp_call_function+0x1f8/0x200
 [<ffffffff8032adb0>] schedule+0x950/0xa08
 [<ffffffff8010b9f8>] local_rm9k_perfcounter_irq_startup+0x0/0x68
 [<ffffffff8010baa8>] rm9k_perfcounter_irq_startup+0x48/0x68
 [<ffffffff801658b8>] probe_irq_on+0x2b8/0x2e8
 [<ffffffff80146c00>] del_singleshot_timer_sync+0x38/0x50
 [<ffffffff8028e510>] try_to_identify+0x180/0x190
 [<ffffffff80147d88>] process_timeout+0x0/0x8
 [<ffffffff8028e66c>] do_probe+0x14c/0x338
 [<ffffffff8028e57c>] do_probe+0x5c/0x338
 [<ffffffff8028ec40>] wait_hwif_ready+0x178/0x180
 [<ffffffff8028f230>] probe_hwif+0x508/0x6e8
 [<ffffffff8028eec8>] probe_hwif+0x1a0/0x6e8
 [<ffffffff8028f42c>] probe_hwif_init_with_fixup+0x1c/0xe8
 [<ffffffff8029435c>] ide_3P_init+0xb4/0x118
 [<ffffffff80294324>] ide_3P_init+0x7c/0x118
 [<ffffffff8023d100>] idr_get_new+0x18/0x50
etc. 

Does anyone know what sort of bug could cause problems with SMP, but would
work fine otherwise?  I could supply my driver code if anyone is interested.
Thanks!

Bryan
 

------=_NextPart_000_008F_01C5A7CA.68D6B0E0
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.5.7036.0">
<TITLE>custom ide driver causes &quot;Badness in =
smp_call_function&quot;</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">Hi =
all,</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us"></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">I</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial"> have added a compact flash =
disk onto the local bus of a</FONT></SPAN><SPAN =
LANG=3D"en-us"></SPAN><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">n</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial"> rm9224 mips =
processor.&nbsp; We are using an FPGA as an IDE host</FONT></SPAN><SPAN =
LANG=3D"en-us"></SPAN><SPAN LANG=3D"en-us"> <FONT SIZE=3D2 =
FACE=3D"Arial">adaptor</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">.</FONT></SPAN><SPAN =
LANG=3D"en-us"></SPAN><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp; Our</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial"></FONT></SPAN><SPAN =
LANG=3D"en-us"></SPAN><SPAN LANG=3D"en-us"> <FONT SIZE=3D2 =
FACE=3D"Arial">driver works great when the kernel is compiled for =
a</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN LANG=3D"en-us"> <FONT =
SIZE=3D2 FACE=3D"Arial">single</FONT></SPAN><SPAN =
LANG=3D"en-us"></SPAN><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial"></FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us"> <FONT SIZE=3D2 FACE=3D"Arial">processor.&nbsp; But if =
SMP support is enabled,</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us"> <FONT SIZE=3D2 FACE=3D"Arial">the kernel dies with: =
</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN LANG=3D"en-us"> =
<FONT SIZE=3D2 FACE=3D"Arial">&#8230;</FONT></SPAN><SPAN =
LANG=3D"en-us"></SPAN><SPAN LANG=3D"en-us"></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">Uniform Multi-Platform E-IDE driver Revision: =
7.00alpha2</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">Ide:&nbsp; Assuming 50MHz system bus speed for PIO modes; =
override with idebuss=3Dxx</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">Badness in smp_call_function at =
arch/mips/kernel/smp.c:149</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">Call =
Trace:</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;[&lt;ffffffff8010aff8&gt;] =
smp_call_function+0x1f8/0x200</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;[&lt;ffffffff8032adb0&gt;] =
schedule+0x950/0xa08</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;[&lt;ffffffff8010b9f8&gt;] =
local_rm9k_perfcounter_irq_startup+0x0/0x68</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;[&lt;ffffffff8010baa8&gt;] =
rm9k_perfcounter_irq_startup+0x48/0x68</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;[&lt;ffffffff801658b8&gt;] =
probe_irq_on+0x2b8/0x2e8</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;[&lt;ffffffff80146c00&gt;] =
del_singleshot_timer_sync+0x38/0x50</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;[&lt;ffffffff8028e510&gt;] =
try_to_identify+0x180/0x190</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;[&lt;ffffffff80147d88&gt;] =
process_timeout+0x0/0x8</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;[&lt;ffffffff8028e66c&gt;] =
do_probe+0x14c/0x338</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;[&lt;ffffffff8028e57c&gt;] =
do_probe+0x5c/0x338</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;[&lt;ffffffff8028ec40&gt;] =
wait_hwif_ready+0x178/0x180</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;[&lt;ffffffff8028f230&gt;] =
probe_hwif+0x508/0x6e8</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;[&lt;ffffffff8028eec8&gt;] =
probe_hwif+0x1a0/0x6e8</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;[&lt;ffffffff8028f42c&gt;] =
probe_hwif_init_with_fixup+0x1c/0xe8</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;[&lt;ffffffff8029435c&gt;] =
ide_3P_init+0xb4/0x118</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;[&lt;ffffffff80294324&gt;] =
ide_3P_init+0x7c/0x118</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;[&lt;ffffffff8023d100&gt;] =
idr_get_new+0x18/0x50</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us"></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">etc</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">&#8230;</FONT></SPAN><SPAN =
LANG=3D"en-us"></SPAN><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial"></FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us"> </SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">Does =
anyone know what sort of bug could cause problems with SMP, but would =
work fine otherwise?&nbsp; I could supply my driver code if anyone =
is</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN LANG=3D"en-us"> <FONT =
SIZE=3D2 FACE=3D"Arial">interested</FONT></SPAN><SPAN =
LANG=3D"en-us"></SPAN><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">.</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; =
Thanks!</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">Bryan</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us"></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial"></FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us">&nbsp;</SPAN></P>

</BODY>
</HTML>
------=_NextPart_000_008F_01C5A7CA.68D6B0E0--


From greg.weeks@timesys.com Wed Aug 24 13:20:07 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 24 Aug 2005 13:20:22 +0100 (BST)
Received: from mail.timesys.com ([IPv6:::ffff:65.117.135.102]:35719 "EHLO
	exchange.timesys.com") by linux-mips.org with ESMTP
	id <S8224991AbVHXMUH>; Wed, 24 Aug 2005 13:20:07 +0100
Received: from [192.168.2.27] ([192.168.2.27]) by exchange.timesys.com with Microsoft SMTPSVC(5.0.2195.6713);
	 Wed, 24 Aug 2005 08:25:08 -0400
Message-ID: <430C673E.4070502@timesys.com>
Date:	Wed, 24 Aug 2005 08:25:34 -0400
From:	Greg Weeks <greg.weeks@timesys.com>
User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	Ralf Baechle <ralf@linux-mips.org>
CC:	linux-mips@linux-mips.org
Subject: Re: 24K malta
References: <42FA03D4.5060400@timesys.com> <20050810140243.GD2840@linux-mips.org>
In-Reply-To: <20050810140243.GD2840@linux-mips.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 24 Aug 2005 12:25:08.0703 (UTC) FILETIME=[DDAC6EF0:01C5A8A6]
Return-Path: <greg.weeks@timesys.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8791
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: greg.weeks@timesys.com
Precedence: bulk
X-list: linux-mips

Ralf Baechle wrote:

>On Wed, Aug 10, 2005 at 09:40:36AM -0400, Greg Weeks wrote:
>
>  
>
>>I'm seeing something strange on a 24K malta and I'm wondering if anyone 
>>else has ran into something like it.
>>
>>This is a 2.6.12 based kernel. I've not had a chance to try the current 
>>CVS yet. The last time I checked the current CVS didn't boot as is on a 
>>4Kc malta so I've not been keeping current with CVS.
>>
>>When I try a simple
>>
>>strace ls
>>
>>I either hang or seg fault on a 24Kc or 24Kec processor, but a 4Kc or 
>>4Kec works. If I turn off the cache on the 24K it works as well. Without 
>>cache it's unbearably slow of course. This is the same exact build of 
>>the kernel and root file system for all boards.
>>    
>>
>
>I cannot reproduce this problem on 24KEc Malta, sorry.
>  
>
What patch are you using to get current CVS to boot on a malta? I've 
been disabling prefetch in memcpy, but if you're doing something else I 
want to try that. About 1 out of 3 "strace ls" either hangs or seg 
faults on me still.

Greg Weeks

From ralf@linux-mips.org Wed Aug 24 14:29:58 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 24 Aug 2005 14:30:16 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:59400 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8224991AbVHXN36>; Wed, 24 Aug 2005 14:29:58 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7ODZOWg009120;
	Wed, 24 Aug 2005 14:35:24 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7ODZO5K009119;
	Wed, 24 Aug 2005 14:35:24 +0100
Date:	Wed, 24 Aug 2005 14:35:24 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Greg Weeks <greg.weeks@timesys.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: 24K malta
Message-ID: <20050824133524.GA6065@linux-mips.org>
References: <42FA03D4.5060400@timesys.com> <20050810140243.GD2840@linux-mips.org> <430C673E.4070502@timesys.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <430C673E.4070502@timesys.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8792
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Wed, Aug 24, 2005 at 08:25:34AM -0400, Greg Weeks wrote:

> >I cannot reproduce this problem on 24KEc Malta, sorry.
> > 
> >
> What patch are you using to get current CVS to boot on a malta? I've 
> been disabling prefetch in memcpy, but if you're doing something else I 
> want to try that. About 1 out of 3 "strace ls" either hangs or seg 
> faults on me still.

I've disabled prefetching entirely in arch/mips/Kconfig and I'm using a
24Kc, not a 24KEc, stock gcc 3.4 & binutils 2.16 and it's running quite
nicely for me.

  Ralf

From ralf@linux-mips.org Wed Aug 24 16:19:27 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 24 Aug 2005 16:19:43 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:61212 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225256AbVHXPT1>; Wed, 24 Aug 2005 16:19:27 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7OFOjkg011953;
	Wed, 24 Aug 2005 16:24:45 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7OFOjbo011952;
	Wed, 24 Aug 2005 16:24:45 +0100
Date:	Wed, 24 Aug 2005 16:24:44 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Bryan Althouse <bryan.althouse@3phoenix.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: custom ide driver causes "Badness in smp_call_function"
Message-ID: <20050824152444.GE2783@linux-mips.org>
References: <20050823140159Z8225393-3678+7283@linux-mips.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050823140159Z8225393-3678+7283@linux-mips.org>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8793
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Tue, Aug 23, 2005 at 10:07:02AM -0400, Bryan Althouse wrote:

> I have added a compact flash disk onto the local bus of an rm9224 mips
> processor.  We are using an FPGA as an IDE host adaptor.  Our driver works
> great when the kernel is compiled for a single processor.  But if SMP
> support is enabled, the kernel dies with: 
>             .
> Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
> Ide:  Assuming 50MHz system bus speed for PIO modes; override with
> idebuss=xx
> Badness in smp_call_function at arch/mips/kernel/smp.c:149

That's just a rather drastically looking warning, btw.

> Call Trace:
>  [<ffffffff8010aff8>] smp_call_function+0x1f8/0x200
>  [<ffffffff8032adb0>] schedule+0x950/0xa08
>  [<ffffffff8010b9f8>] local_rm9k_perfcounter_irq_startup+0x0/0x68
>  [<ffffffff8010baa8>] rm9k_perfcounter_irq_startup+0x48/0x68
>  [<ffffffff801658b8>] probe_irq_on+0x2b8/0x2e8
>  [<ffffffff80146c00>] del_singleshot_timer_sync+0x38/0x50
>  [<ffffffff8028e510>] try_to_identify+0x180/0x190
>  [<ffffffff80147d88>] process_timeout+0x0/0x8
>  [<ffffffff8028e66c>] do_probe+0x14c/0x338
>  [<ffffffff8028e57c>] do_probe+0x5c/0x338
>  [<ffffffff8028ec40>] wait_hwif_ready+0x178/0x180
>  [<ffffffff8028f230>] probe_hwif+0x508/0x6e8
>  [<ffffffff8028eec8>] probe_hwif+0x1a0/0x6e8
>  [<ffffffff8028f42c>] probe_hwif_init_with_fixup+0x1c/0xe8
>  [<ffffffff8029435c>] ide_3P_init+0xb4/0x118
>  [<ffffffff80294324>] ide_3P_init+0x7c/0x118
>  [<ffffffff8023d100>] idr_get_new+0x18/0x50
> etc. 
> 
> Does anyone know what sort of bug could cause problems with SMP, but would
> work fine otherwise?  I could supply my driver code if anyone is interested.
> Thanks!

Your driver is probably fine.  The problem is that doing PIO may result in
cache aliases and that requires a cache flush.  Normally that's not
terribly hard to do - but in your case an SMP cacheflush is needed which
in turn requires smp_call_function to be used and that one again may
deadlock if called with interrupts disabled.  See also
include/asm-mips/mach-generic/ide.h.

So until we have a better implementation I suggest try to avoid the use
of ide_inb() etc. with interrupts disabled.

  Ralf

From anemo@mba.ocn.ne.jp Wed Aug 24 16:22:07 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 24 Aug 2005 16:22:23 +0100 (BST)
Received: from mba.ocn.ne.jp ([IPv6:::ffff:210.190.142.172]:63982 "HELO
	smtp.mba.ocn.ne.jp") by linux-mips.org with SMTP
	id <S8225256AbVHXPWH>; Wed, 24 Aug 2005 16:22:07 +0100
Received: from localhost (p8216-ipad209funabasi.chiba.ocn.ne.jp [58.88.119.216])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id ECD2C2362; Thu, 25 Aug 2005 00:27:36 +0900 (JST)
Date:	Thu, 25 Aug 2005 00:35:48 +0900 (JST)
Message-Id: <20050825.003548.41199755.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: 64bit unaligned access on 32bit kernel
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
X-Fingerprint: 6ACA 1623 39BD 9A94 9B1A  B746 CA77 FE94 2874 D52F
X-Pgp-Public-Key: http://wwwkeys.pgp.net/pks/lookup?op=get&search=0x2874D52F
X-Mailer: Mew version 3.3 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8794
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips

MIPS kernel has been using asm-generic/unaligned.h since 2.6.12-rc2.
But the generic unaligned.h is not suitable for 32bit kernel because
it uses 'unsigned long' for 64bit values.

How about this fix?

diff -u linux-mips/include/asm-generic/unaligned.h linux/include/asm-generic/unaligned.h
--- linux-mips/include/asm-generic/unaligned.h	2005-05-28 00:40:52.000000000 +0900
+++ linux/include/asm-generic/unaligned.h	2005-08-25 00:26:14.359013720 +0900
@@ -18,7 +18,7 @@
 #define get_unaligned(ptr) \
 	((__typeof__(*(ptr)))__get_unaligned((ptr), sizeof(*(ptr))))
 #define put_unaligned(x,ptr) \
-	__put_unaligned((unsigned long)(x), (ptr), sizeof(*(ptr)))
+	__put_unaligned((__u64)(x), (ptr), sizeof(*(ptr)))
 
 /*
  * This function doesn't actually exist.  The idea is that when
@@ -36,19 +36,19 @@
  * Elemental unaligned loads 
  */
 
-static inline unsigned long __uldq(const __u64 *addr)
+static inline __u64 __uldq(const __u64 *addr)
 {
 	const struct __una_u64 *ptr = (const struct __una_u64 *) addr;
 	return ptr->x;
 }
 
-static inline unsigned long __uldl(const __u32 *addr)
+static inline __u64 __uldl(const __u32 *addr)
 {
 	const struct __una_u32 *ptr = (const struct __una_u32 *) addr;
 	return ptr->x;
 }
 
-static inline unsigned long __uldw(const __u16 *addr)
+static inline __u64 __uldw(const __u16 *addr)
 {
 	const struct __una_u16 *ptr = (const struct __una_u16 *) addr;
 	return ptr->x;
@@ -78,7 +78,7 @@
 
 #define __get_unaligned(ptr, size) ({		\
 	const void *__gu_p = ptr;		\
-	unsigned long val;			\
+	__u64 val;				\
 	switch (size) {				\
 	case 1:					\
 		val = *(const __u8 *)__gu_p;	\

From galak@freescale.com Wed Aug 24 17:49:05 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 24 Aug 2005 17:49:26 +0100 (BST)
Received: from de01egw02.freescale.net ([IPv6:::ffff:192.88.165.103]:36333
	"EHLO de01egw02.freescale.net") by linux-mips.org with ESMTP
	id <S8225288AbVHXQtF>; Wed, 24 Aug 2005 17:49:05 +0100
Received: from de01smr01.am.mot.com (de01smr01.freescale.net [10.208.0.31])
	by de01egw02.freescale.net (8.12.11/de01egw02) with ESMTP id j7OGx4Zt022303;
	Wed, 24 Aug 2005 09:59:05 -0700 (MST)
Received: from postal.somerset.sps.mot.com ([163.12.132.5])
	by de01smr01.am.mot.com (8.13.1/8.13.0) with ESMTP id j7OH1UuB013925;
	Wed, 24 Aug 2005 12:01:31 -0500 (CDT)
Received: from nylon.am.freescale.net (nylon.sps.mot.com [10.82.19.8])
	by postal.somerset.sps.mot.com (8.11.0/8.11.0) with ESMTP id j7OGsTD05090;
	Wed, 24 Aug 2005 11:54:29 -0500 (CDT)
Received: from nylon.am.freescale.net (localhost.localdomain [127.0.0.1])
	by nylon.am.freescale.net (8.12.11/8.11.0) with ESMTP id j7OGsTBW024012;
	Wed, 24 Aug 2005 11:54:29 -0500
Received: from localhost (galak@localhost)
	by nylon.am.freescale.net (8.12.11/8.12.11/Submit) with ESMTP id j7OGsRPe024009;
	Wed, 24 Aug 2005 11:54:28 -0500
X-Authentication-Warning: nylon.am.freescale.net: galak owned process doing -bs
Date:	Wed, 24 Aug 2005 11:54:27 -0500 (CDT)
From:	Kumar Gala <galak@freescale.com>
X-X-Sender: galak@nylon.am.freescale.net
To:	linux-kernel@vger.kernel.org
cc:	Andrew Morton <akpm@osdl.org>, ralf@linux-mips.org,
	linux-mips@linux-mips.org
Subject: [PATCH 06/15] mips: remove use of asm/segment.h
In-Reply-To: <Pine.LNX.4.61.0508241139100.23956@nylon.am.freescale.net>
Message-ID: <Pine.LNX.4.61.0508241153260.23956@nylon.am.freescale.net>
References: <Pine.LNX.4.61.0508241139100.23956@nylon.am.freescale.net>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Return-Path: <galak@freescale.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8795
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: galak@freescale.com
Precedence: bulk
X-list: linux-mips

Removed MIPS architecture specific users of asm/segment.h and
asm-mips/segment.h itself

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

---
commit 8f20e153d5d5c3efd95835e814fae7b3ccbfcd08
tree 17e9ae88b3fe1762302179a4ea08e61360805a29
parent 503a812c1f9cef08e6f96b2b2cf1f32bbfef2bc6
author Kumar K. Gala <kumar.gala@freescale.com> Wed, 24 Aug 2005 10:59:09 -0500
committer Kumar K. Gala <kumar.gala@freescale.com> Wed, 24 Aug 2005 10:59:09 -0500

 arch/mips/au1000/db1x00/mirage_ts.c |    1 -
 include/asm-mips/segment.h          |    6 ------
 2 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/arch/mips/au1000/db1x00/mirage_ts.c b/arch/mips/au1000/db1x00/mirage_ts.c
--- a/arch/mips/au1000/db1x00/mirage_ts.c
+++ b/arch/mips/au1000/db1x00/mirage_ts.c
@@ -44,7 +44,6 @@
 #include <linux/smp_lock.h>
 #include <linux/wait.h>
 
-#include <asm/segment.h>
 #include <asm/irq.h>
 #include <asm/uaccess.h>
 #include <asm/delay.h>
diff --git a/include/asm-mips/segment.h b/include/asm-mips/segment.h
deleted file mode 100644
--- a/include/asm-mips/segment.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_SEGMENT_H
-#define _ASM_SEGMENT_H
-
-/* Only here because we have some old header files that expect it.. */
-
-#endif /* _ASM_SEGMENT_H */

From ralf@linux-mips.org Wed Aug 24 17:57:35 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 24 Aug 2005 17:57:52 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:54036 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225411AbVHXQ5f>; Wed, 24 Aug 2005 17:57:35 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7OH30K5007721;
	Wed, 24 Aug 2005 18:03:00 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7OH2xmY007720;
	Wed, 24 Aug 2005 18:02:59 +0100
Date:	Wed, 24 Aug 2005 18:02:59 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Kumar Gala <galak@freescale.com>
Cc:	linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
	linux-mips@linux-mips.org
Subject: Re: [PATCH 06/15] mips: remove use of asm/segment.h
Message-ID: <20050824170259.GF2783@linux-mips.org>
References: <Pine.LNX.4.61.0508241139100.23956@nylon.am.freescale.net> <Pine.LNX.4.61.0508241153260.23956@nylon.am.freescale.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <Pine.LNX.4.61.0508241153260.23956@nylon.am.freescale.net>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8796
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Wed, Aug 24, 2005 at 11:54:27AM -0500, Kumar Gala wrote:

> Removed MIPS architecture specific users of asm/segment.h and
> asm-mips/segment.h itself

Thanks, applied.

  Ralf

From bruno.randolf@4g-systems.biz Wed Aug 24 18:03:25 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 24 Aug 2005 18:03:46 +0100 (BST)
Received: from grey.subnet.at ([IPv6:::ffff:193.170.141.20]:2565 "EHLO
	grey.subnet.at") by linux-mips.org with ESMTP id <S8225411AbVHXRDZ>;
	Wed, 24 Aug 2005 18:03:25 +0100
Received: from ip6-localhost ([193.170.141.4]) by grey.subnet.at ; Wed, 24 Aug 2005 19:08:54 +0200
From:	Bruno Randolf <bruno.randolf@4g-systems.biz>
To:	linux-mips@linux-mips.org
Subject: au1000 pci_ops clear errors
Date:	Wed, 24 Aug 2005 19:05:44 +0200
User-Agent: KMail/1.8.1
Organization: 4G Systems
MIME-Version: 1.0
Content-Type: multipart/signed;
  boundary="nextPart4374168.4qLdzKYEyK";
  protocol="application/pgp-signature";
  micalg=pgp-sha1
Content-Transfer-Encoding: 7bit
Message-Id: <200508241905.48376.bruno.randolf@4g-systems.biz>
X-Rcpt-To: <linux-mips@linux-mips.org>
Return-Path: <bruno.randolf@4g-systems.biz>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8797
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: bruno.randolf@4g-systems.biz
Precedence: bulk
X-list: linux-mips

--nextPart4374168.4qLdzKYEyK
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

hello!

what do you think about the following patch to clear PCI errors in config=20
accesses on the au1000 CPUs? if an error like "parity error" occurred and t=
he=20
error is not cleared, all following config accesses will be reported as=20
errors (0xffffffff) too.

the diff is against 2.4.27 but the same thing is missing in 2.6 as well, i=
=20
believe.

greetings,
bruno

=2D-- linux/arch/mips/au1000/common/pci_ops.c.orig        2005-08-24=20
17:36:25.000000000 +0200
+++ linux/arch/mips/au1000/common/pci_ops.c     2005-08-24 17:37:38.0000000=
00=20
+0200
@@ -259,7 +259,11 @@
                *data =3D 0xffffffff;
                error =3D -1;
        } else if ((status >> 28) & 0xf) {
=2D               DBG("PCI ERR detected: status %x\n", status);
+               DBG("PCI ERR detected: device %d, status %x\n", device,=20
((status >> 28) & 0xf));
+
+               /* clear errors */
+               au_writel(status & 0xf000ffff, Au1500_PCI_STATCMD);
+
                *data =3D 0xffffffff;
                error =3D -1;
        }

--nextPart4374168.4qLdzKYEyK
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQBDDKjsfg2jtUL97G4RApjqAJ48rMR+Cb7LP1v4AgYt3J92+9u7zwCgoi0z
M2UdauI0GT+aRwOc/Iq+1rQ=
=JMtW
-----END PGP SIGNATURE-----

--nextPart4374168.4qLdzKYEyK--

From mark.e.mason@broadcom.com Wed Aug 24 18:40:44 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 24 Aug 2005 18:41:00 +0100 (BST)
Received: from mms2.broadcom.com ([IPv6:::ffff:216.31.210.18]:46094 "EHLO
	MMS2.broadcom.com") by linux-mips.org with ESMTP
	id <S8225421AbVHXRko>; Wed, 24 Aug 2005 18:40:44 +0100
Received: from 10.10.64.121 by MMS2.broadcom.com with SMTP (Broadcom
 SMTP Relay (Email Firewall v6.1.0)); Wed, 24 Aug 2005 10:45:52 -0700
X-Server-Uuid: 1F20ACF3-9CAF-44F7-AB47-F294E2D5B4EA
Received: from mail-irva-8.broadcom.com ([10.10.64.221]) by
 mail-irva-1.broadcom.com (Post.Office MTA v3.5.3 release 223 ID#
 0-72233U7200L2200S0V35) with ESMTP id com for
 <linux-mips@linux-mips.org>; Wed, 24 Aug 2005 10:45:50 -0700
Received: from mon-irva-10.broadcom.com (mon-irva-10.broadcom.com
 [10.10.64.171]) by mail-irva-8.broadcom.com (MOS 3.5.6-GR) with ESMTP
 id BQQ54061; Wed, 24 Aug 2005 10:45:18 -0700 (PDT)
Received: from nt-sjca-0740.brcm.ad.broadcom.com (
 nt-sjca-0740.sj.broadcom.com [10.16.192.49]) by
 mon-irva-10.broadcom.com (8.9.1/8.9.1) with ESMTP id KAA16998 for
 <linux-mips@linux-mips.org>; Wed, 24 Aug 2005 10:45:17 -0700 (PDT)
Received: from NT-SJCA-0750.brcm.ad.broadcom.com ([10.16.192.220]) by
 nt-sjca-0740.brcm.ad.broadcom.com with Microsoft SMTPSVC(6.0.3790.211);
 Wed, 24 Aug 2005 10:45:17 -0700
Received: from [127.0.0.1] ([10.27.253.8]) by
 NT-SJCA-0750.brcm.ad.broadcom.com with Microsoft SMTPSVC(6.0.3790.211);
 Wed, 24 Aug 2005 10:45:16 -0700
Message-ID: <430CB229.1000405@broadcom.com>
Date:	Wed, 24 Aug 2005 10:45:13 -0700
From:	"Mark Mason" <mason@broadcom.com>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: Patch to arch/mips/sibyte/sb1250/irq.c
X-OriginalArrivalTime: 24 Aug 2005 17:45:17.0210 (UTC)
 FILETIME=[96D5FFA0:01C5A8D3]
X-WSS-ID: 6F126DDA1NK1432906-01-01
Content-Type: multipart/mixed;
 boundary=------------090000050301070100020606
Return-Path: <mark.e.mason@broadcom.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8798
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: mason@broadcom.com
Precedence: bulk
X-list: linux-mips

This is a multi-part message in MIME format.
--------------090000050301070100020606
Content-Type: text/plain;
 charset=iso-8859-1;
 format=flowed
Content-Transfer-Encoding: 7bit

Hello all,

Attached is a patch to the sb1250 version of irq.c to fix compilation 
warnings (and make the code more correct).

Change sb1250_set_affinity() to use the proper datatype and access 
macros for the cpu mask.

Thanks,
Mark



--------------090000050301070100020606
Content-Type: text/plain;
 name=irq-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename=irq-patch

Index: arch/mips/sibyte/sb1250/irq.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/sibyte/sb1250/irq.c,v
retrieving revision 1.34
diff -u -p -r1.34 irq.c
--- arch/mips/sibyte/sb1250/irq.c	11 Jul 2005 10:03:30 -0000	1.34
+++ arch/mips/sibyte/sb1250/irq.c	24 Aug 2005 17:33:33 -0000
@@ -53,7 +53,7 @@ static void disable_sb1250_irq(unsigned 
 static unsigned int startup_sb1250_irq(unsigned int irq);
 static void ack_sb1250_irq(unsigned int irq);
 #ifdef CONFIG_SMP
-static void sb1250_set_affinity(unsigned int irq, unsigned long mask);
+static void sb1250_set_affinity(unsigned int irq, cpumask_t mask);
 #endif
 
 #ifdef CONFIG_SIBYTE_HAS_LDT
@@ -117,26 +117,19 @@ void sb1250_unmask_irq(int cpu, int irq)
 }
 
 #ifdef CONFIG_SMP
-static void sb1250_set_affinity(unsigned int irq, unsigned long mask)
+static void sb1250_set_affinity(unsigned int irq, cpumask_t mask)
 {
-	int i = 0, old_cpu, cpu, int_on;
+	int i = 0, old_cpu, cpu, int_on, weight;
 	u64 cur_ints;
 	irq_desc_t *desc = irq_desc + irq;
 	unsigned long flags;
 
-	while (mask) {
-		if (mask & 1) {
-			mask >>= 1;
-			break;
-		}
-		mask >>= 1;
-		i++;
-	}
-
-	if (mask) {
+	weight = cpus_weight(mask);
+	if (weight > 1) {
 		printk("attempted to set irq affinity for irq %d to multiple CPUs\n", irq);
 		return;
-	}
+	} else if (weight != 0)
+		i = first_cpu(mask);
 
 	/* Convert logical CPU to physical CPU */
 	cpu = cpu_logical_map(i);

--------------090000050301070100020606--


From colin@realtek.com.tw Thu Aug 25 12:50:58 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 25 Aug 2005 12:51:16 +0100 (BST)
Received: from mf2.realtek.com.tw ([IPv6:::ffff:220.128.56.22]:28424 "EHLO
	mf2.realtek.com.tw") by linux-mips.org with ESMTP
	id <S8225257AbVHYLu6>; Thu, 25 Aug 2005 12:50:58 +0100
Received: from msx.realtek.com.tw (unverified [172.21.1.77]) by mf2.realtek.com.tw
 (Clearswift SMTPRS 5.1.4) with ESMTP id <T72fba0ee27dc8038163f8@mf2.realtek.com.tw> for <linux-mips@linux-mips.org>;
 Thu, 25 Aug 2005 19:58:19 +0800
Received: from rtpdii3098 ([172.21.98.16])
          by msx.realtek.com.tw (Lotus Domino Release 6.5.3)
          with ESMTP id 2005082519561182-14053 ;
          Thu, 25 Aug 2005 19:56:11 +0800 
Message-ID: <008e01c5a96b$fce24810$106215ac@realtek.com.tw>
From:	"colin" <colin@realtek.com.tw>
To:	<linux-mips@linux-mips.org>
Subject: Please suggest one PCI VGA card for Malta board
Date:	Thu, 25 Aug 2005 19:56:11 +0800
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
X-MIMETrack: Itemize by SMTP Server on msx/Realtek(Release 6.5.3|September 14, 2004) at
 2005/08/25 =?Bog5?B?pFWkyCAwNzo1NjoxMg==?=,
	Serialize by Router on msx/Realtek(Release 6.5.3|September 14, 2004) at
 2005/08/25 =?Bog5?B?pFWkyCAwNzo1NjoxMg==?=,
	Serialize complete at 2005/08/25 =?Bog5?B?pFWkyCAwNzo1NjoxMg==?=
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset="big5"
Return-Path: <colin@realtek.com.tw>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8799
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: colin@realtek.com.tw
Precedence: bulk
X-list: linux-mips


Hi there,
We want to use frame buffer on Malta board to see the video display of our
application.
Therefore, we need one vga card that can be used on Malta board with Linux
2.6.11 "without modifying driver".
Could you suggest us a "common" vga card that can easily do that?

Thanks & regards,
Colin


From kevink@mips.com Thu Aug 25 13:25:56 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 25 Aug 2005 13:26:13 +0100 (BST)
Received: from 209-232-97-206.ded.pacbell.net ([IPv6:::ffff:209.232.97.206]:6023
	"EHLO dns0.mips.com") by linux-mips.org with ESMTP
	id <S8225257AbVHYMZ4>; Thu, 25 Aug 2005 13:25:56 +0100
Received: from mercury.mips.com (sbcns-dmz [209.232.97.193])
	by dns0.mips.com (8.12.11/8.12.11) with ESMTP id j7PCVOkC001471;
	Thu, 25 Aug 2005 05:31:25 -0700 (PDT)
Received: from [192.168.236.16] (grendel [192.168.236.16])
	by mercury.mips.com (8.12.9/8.12.11) with ESMTP id j7PCVOvU020259;
	Thu, 25 Aug 2005 05:31:24 -0700 (PDT)
Message-ID: <430DBB61.2020104@mips.com>
Date:	Thu, 25 Aug 2005 14:36:49 +0200
From:	"Kevin D. Kissell" <kevink@mips.com>
User-Agent: Mozilla Thunderbird 0.9 (X11/20041103)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	colin <colin@realtek.com.tw>
CC:	linux-mips@linux-mips.org
Subject: Re: Please suggest one PCI VGA card for Malta board
References: <008e01c5a96b$fce24810$106215ac@realtek.com.tw>
In-Reply-To: <008e01c5a96b$fce24810$106215ac@realtek.com.tw>
Content-Type: text/plain; charset=Big5
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.39
Return-Path: <kevink@mips.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8800
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: kevink@mips.com
Precedence: bulk
X-list: linux-mips

colin wrote:
> Hi there,
> We want to use frame buffer on Malta board to see the video display of our
> application.
> Therefore, we need one vga card that can be used on Malta board with Linux
> 2.6.11 "without modifying driver".
> Could you suggest us a "common" vga card that can easily do that?

I had some reasonable luck with a Matrox Millenium G450 PCI,
but only when running with a "real" CPU on the Malta.   It
seemed to have problems when working with a CoreFPGA2 module,
and since I didn't need it for the work I was doing with
the FPGA, I pulled it out instead of debugging the problem,
which might have been something really simple and stupid.

			Kevin K.

From hellokishore@gmail.com Thu Aug 25 14:52:21 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 25 Aug 2005 14:52:38 +0100 (BST)
Received: from zproxy.gmail.com ([IPv6:::ffff:64.233.162.195]:27620 "EHLO
	zproxy.gmail.com") by linux-mips.org with ESMTP id <S8225257AbVHYNwV>;
	Thu, 25 Aug 2005 14:52:21 +0100
Received: by zproxy.gmail.com with SMTP id 14so225143nzn
        for <linux-mips@linux-mips.org>; Thu, 25 Aug 2005 06:57:48 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:from:to:subject:mime-version:content-type;
        b=kz0/9U2akH5e4O1AN949O7j//QzIRbP7kxJWtNi/tiTEwsqzayjg49pU1C0hdRAvp59rTgiuhhGIsA3k5qO1YvNPmNONd9xE58345x/dmgH8azUJfanqbIGw2TxIQIdIGm6qdv9OU7Mf6IKx4AO4oHf4LLU2aUX2n0njuiSCtRg=
Received: by 10.37.18.4 with SMTP id v4mr85936nzi;
        Thu, 25 Aug 2005 06:57:48 -0700 (PDT)
Received: by 10.36.50.18 with HTTP; Thu, 25 Aug 2005 06:57:48 -0700 (PDT)
Message-ID: <f07e6e050825065756c3ac27@mail.gmail.com>
Date:	Thu, 25 Aug 2005 19:57:48 +0600
From:	Kishore K <hellokishore@gmail.com>
To:	"linux-mips@linux-mips.org" <linux-mips@linux-mips.org>
Subject: Preemption patch for 2.4.26 - mips
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_3127_27407513.1124978268690"
Return-Path: <hellokishore@gmail.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8801
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: hellokishore@gmail.com
Precedence: bulk
X-list: linux-mips

------=_Part_3127_27407513.1124978268690
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

When I try to compile 2.4.26 kernel with the pre-emption patch from
(http://www.kernel.org/pub/linux/kernel/people/rml/preempt-kernel/v2.4/)
for malta board based on MIPS 4kc, compilation fails with the
following error.

[kishorek@blrn0092 linux-2.4.26]$ make vmlinux.srec
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o
scripts/split-include scripts/split-include.c
scripts/split-include include/linux/autoconf.h include/config
mips-linux-gcc -D__KERNEL__ -I/home/kishorek/linux-2.4.26/include
-Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing
-fno-common -fomit-frame-pointer -I
/home/kishorek/linux-2.4.26/include/asm/gcc -G 0 -mno-abicalls
-fno-pic -pipe  -finline-limit=3D100000 -mabi=3D32 -march=3Dmips32 -mips32
-Wa,-32 -Wa,-march=3Dmips32 -Wa,-mips32 -Wa,--trap =20
-DKBUILD_BASENAME=3Dmain -c -o init/main.o init/main.c
In file included from /home/kishorek/linux-2.4.26/include/linux/fs.h:200,
                 from
/home/kishorek/linux-2.4.26/include/linux/capability.h:17,           =20
    from /home/kishorek/linux-2.4.26/include/linux/binfmts.h:5,
                 from /home/kishorek/linux-2.4.26/include/linux/sched.h:9,
                 from /home/kishorek/linux-2.4.26/include/linux/mm.h:4,
                 from /home/kishorek/linux-2.4.26/include/linux/slab.h:14,
                 from /home/kishorek/linux-2.4.26/include/linux/proc_fs.h:5=
,
                 from init/main.c:15:
/home/kishorek/linux-2.4.26/include/asm/semaphore.h: In function
`down_trylock':/home/kishorek/linux-2.4.26/include/asm/semaphore.h:230:
error: `current' undeclared (first use in this function)
/home/kishorek/linux-2.4.26/include/asm/semaphore.h:230: error: (Each
undeclared identifier is reported only once
/home/kishorek/linux-2.4.26/include/asm/semaphore.h:230: error: for
each function it appears in.)
/home/kishorek/linux-2.4.26/include/asm/semaphore.h:243: warning:
implicit declaration of function `preempt_schedule'
/home/kishorek/linux-2.4.26/include/asm/semaphore.h: In function `up':
/home/kishorek/linux-2.4.26/include/asm/semaphore.h:266: error:
`current' undeclared (first use in this function)
In file included from /home/kishorek/linux-2.4.26/include/linux/mm.h:4,
                 from /home/kishorek/linux-2.4.26/include/linux/slab.h:14,
                 from /home/kishorek/linux-2.4.26/include/linux/proc_fs.h:5=
,
                 from init/main.c:15:
/home/kishorek/linux-2.4.26/include/linux/sched.h: At top level:
/home/kishorek/linux-2.4.26/include/linux/sched.h:152: warning: type
mismatch with previous implicit declaration
/home/kishorek/linux-2.4.26/include/asm/semaphore.h:273: warning:
previous implicit declaration of `preempt_schedule'
/home/kishorek/linux-2.4.26/include/linux/sched.h:152: warning:
`preempt_schedule' was previously implicitly declared to return `int'
In file included from /home/kishorek/linux-2.4.26/include/linux/sched.h:586=
,
                 from /home/kishorek/linux-2.4.26/include/linux/mm.h:4,
                 from /home/kishorek/linux-2.4.26/include/linux/slab.h:14,
                 from /home/kishorek/linux-2.4.26/include/linux/proc_fs.h:5=
,
                 from init/main.c:15:
/home/kishorek/linux-2.4.26/include/asm/current.h:15: error: `current'
used prior to declaration
make: *** [init/main.o] Error 1

May I know, if any of you tried the pre-emption patch for 2.4.26 on
mips platform. If so, please let me know the changes to be done or any
other patch needs to be applied.

Here are the details of my toolchain
gcc 3.3.6, binutils: 2.14.90.0.8, uclibc-0.9.27
Kernel configuration file is enclosed along with this mail.=20

TIA,
--kishore

------=_Part_3127_27407513.1124978268690
Content-Type: application/octet-stream; name="config"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="config"

IwojIEF1dG9tYXRpY2FsbHkgZ2VuZXJhdGVkIG1ha2UgY29uZmlnOiBkb24ndCBlZGl0CiMKQ09O
RklHX01JUFM9eQpDT05GSUdfTUlQUzMyPXkKIyBDT05GSUdfTUlQUzY0IGlzIG5vdCBzZXQKCiMK
IyBDb2RlIG1hdHVyaXR5IGxldmVsIG9wdGlvbnMKIwpDT05GSUdfRVhQRVJJTUVOVEFMPXkKCiMK
IyBMb2FkYWJsZSBtb2R1bGUgc3VwcG9ydAojCkNPTkZJR19NT0RVTEVTPXkKQ09ORklHX01PRFZF
UlNJT05TPXkKQ09ORklHX0tNT0Q9eQoKIwojIE1hY2hpbmUgc2VsZWN0aW9uCiMKIyBDT05GSUdf
QUNFUl9QSUNBXzYxIGlzIG5vdCBzZXQKIyBDT05GSUdfTUlQU19CT1NQT1JVUyBpcyBub3Qgc2V0
CiMgQ09ORklHX01JUFNfTUlSQUdFIGlzIG5vdCBzZXQKIyBDT05GSUdfTUlQU19EQjEwMDAgaXMg
bm90IHNldAojIENPTkZJR19NSVBTX0RCMTEwMCBpcyBub3Qgc2V0CiMgQ09ORklHX01JUFNfREIx
NTAwIGlzIG5vdCBzZXQKIyBDT05GSUdfTUlQU19QQjEwMDAgaXMgbm90IHNldAojIENPTkZJR19N
SVBTX1BCMTEwMCBpcyBub3Qgc2V0CiMgQ09ORklHX01JUFNfUEIxNTAwIGlzIG5vdCBzZXQKIyBD
T05GSUdfTUlQU19IWURST0dFTjMgaXMgbm90IHNldAojIENPTkZJR19NSVBTX1BCMTU1MCBpcyBu
b3Qgc2V0CiMgQ09ORklHX01JUFNfWFhTMTUwMCBpcyBub3Qgc2V0CiMgQ09ORklHX01JUFNfTVRY
MSBpcyBub3Qgc2V0CiMgQ09ORklHX0NPR0VOVF9DU0IyNTAgaXMgbm90IHNldAojIENPTkZJR19C
QUdFVF9NSVBTIGlzIG5vdCBzZXQKIyBDT05GSUdfQ0FTSU9fRTU1IGlzIG5vdCBzZXQKIyBDT05G
SUdfTUlQU19DT0JBTFQgaXMgbm90IHNldAojIENPTkZJR19ERUNTVEFUSU9OIGlzIG5vdCBzZXQK
IyBDT05GSUdfTUlQU19FVjY0MTIwIGlzIG5vdCBzZXQKIyBDT05GSUdfTUlQU19FVjk2MTAwIGlz
IG5vdCBzZXQKIyBDT05GSUdfTUlQU19JVlIgaXMgbm90IHNldAojIENPTkZJR19IUF9MQVNFUkpF
VCBpcyBub3Qgc2V0CiMgQ09ORklHX0lCTV9XT1JLUEFEIGlzIG5vdCBzZXQKIyBDT05GSUdfTEFT
QVQgaXMgbm90IHNldAojIENPTkZJR19NSVBTX0lURTgxNzIgaXMgbm90IHNldAojIENPTkZJR19N
SVBTX0FUTEFTIGlzIG5vdCBzZXQKIyBDT05GSUdfTUlQU19NQUdOVU1fNDAwMCBpcyBub3Qgc2V0
CkNPTkZJR19NSVBTX01BTFRBPXkKIyBDT05GSUdfTUlQU19TRUFEIGlzIG5vdCBzZXQKIyBDT05G
SUdfTU9NRU5DT19PQ0VMT1QgaXMgbm90IHNldAojIENPTkZJR19NT01FTkNPX09DRUxPVF9HIGlz
IG5vdCBzZXQKIyBDT05GSUdfTU9NRU5DT19PQ0VMT1RfQyBpcyBub3Qgc2V0CiMgQ09ORklHX01P
TUVOQ09fSkFHVUFSX0FUWCBpcyBub3Qgc2V0CiMgQ09ORklHX1BNQ19ZT1NFTUlURSBpcyBub3Qg
c2V0CiMgQ09ORklHX0REQjUwNzQgaXMgbm90IHNldAojIENPTkZJR19EREI1NDc2IGlzIG5vdCBz
ZXQKIyBDT05GSUdfRERCNTQ3NyBpcyBub3Qgc2V0CiMgQ09ORklHX05FQ19PU1BSRVkgaXMgbm90
IHNldAojIENPTkZJR19ORUNfRUFHTEUgaXMgbm90IHNldAojIENPTkZJR19PTElWRVRUSV9NNzAw
IGlzIG5vdCBzZXQKIyBDT05GSUdfTklOTyBpcyBub3Qgc2V0CiMgQ09ORklHX1NHSV9JUDIyIGlz
IG5vdCBzZXQKIyBDT05GSUdfU0dJX0lQMjcgaXMgbm90IHNldAojIENPTkZJR19TSUJZVEVfU0Ix
eHh4X1NPQyBpcyBub3Qgc2V0CiMgQ09ORklHX1NOSV9STTIwMF9QQ0kgaXMgbm90IHNldAojIENP
TkZJR19UQU5CQUNfVEIwMjI2IGlzIG5vdCBzZXQKIyBDT05GSUdfVEFOQkFDX1RCMDIyOSBpcyBu
b3Qgc2V0CiMgQ09ORklHX1RPU0hJQkFfSk1SMzkyNyBpcyBub3Qgc2V0CiMgQ09ORklHX1RPU0hJ
QkFfUkJUWDQ5MjcgaXMgbm90IHNldAojIENPTkZJR19WSUNUT1JfTVBDMzBYIGlzIG5vdCBzZXQK
IyBDT05GSUdfWkFPX0NBUENFTExBIGlzIG5vdCBzZXQKIyBDT05GSUdfSElHSE1FTSBpcyBub3Qg
c2V0CkNPTkZJR19SV1NFTV9HRU5FUklDX1NQSU5MT0NLPXkKIyBDT05GSUdfUldTRU1fWENIR0FE
RF9BTEdPUklUSE0gaXMgbm90IHNldApDT05GSUdfQk9PVF9FTEYzMj15CkNPTkZJR19IQVZFX1NU
RF9QQ19TRVJJQUxfUE9SVD15CkNPTkZJR19JODI1OT15CkNPTkZJR19NSVBTX0JPTklUTzY0PXkK
Q09ORklHX01JUFNfR1Q2NDEyMD15CkNPTkZJR19NSVBTX01TQz15CkNPTkZJR19MMV9DQUNIRV9T
SElGVD01CkNPTkZJR19ORVdfVElNRV9DPXkKQ09ORklHX05PTkNPSEVSRU5UX0lPPXkKQ09ORklH
X1NXQVBfSU9fU1BBQ0VfVz15CkNPTkZJR19TV0FQX0lPX1NQQUNFX0w9eQpDT05GSUdfUENfS0VZ
Qj15CkNPTkZJR19QQ0k9eQojIENPTkZJR19NSVBTX0FVMTAwMCBpcyBub3Qgc2V0CgojCiMgQ1BV
IHNlbGVjdGlvbgojCkNPTkZJR19DUFVfTUlQUzMyPXkKIyBDT05GSUdfQ1BVX01JUFM2NCBpcyBu
b3Qgc2V0CiMgQ09ORklHX0NQVV9SMzAwMCBpcyBub3Qgc2V0CiMgQ09ORklHX0NQVV9UWDM5WFgg
aXMgbm90IHNldAojIENPTkZJR19DUFVfVlI0MVhYIGlzIG5vdCBzZXQKIyBDT05GSUdfQ1BVX1I0
MzAwIGlzIG5vdCBzZXQKIyBDT05GSUdfQ1BVX1I0WDAwIGlzIG5vdCBzZXQKIyBDT05GSUdfQ1BV
X1RYNDlYWCBpcyBub3Qgc2V0CiMgQ09ORklHX0NQVV9SNTAwMCBpcyBub3Qgc2V0CiMgQ09ORklH
X0NQVV9SNTQzMiBpcyBub3Qgc2V0CiMgQ09ORklHX0NQVV9SNjAwMCBpcyBub3Qgc2V0CiMgQ09O
RklHX0NQVV9ORVZBREEgaXMgbm90IHNldAojIENPTkZJR19DUFVfUjgwMDAgaXMgbm90IHNldAoj
IENPTkZJR19DUFVfUjEwMDAwIGlzIG5vdCBzZXQKIyBDT05GSUdfQ1BVX1JNNzAwMCBpcyBub3Qg
c2V0CiMgQ09ORklHX0NQVV9STTkwMDAgaXMgbm90IHNldAojIENPTkZJR19DUFVfU0IxIGlzIG5v
dCBzZXQKQ09ORklHX1BBR0VfU0laRV80S0I9eQojIENPTkZJR19QQUdFX1NJWkVfMTZLQiBpcyBu
b3Qgc2V0CiMgQ09ORklHX1BBR0VfU0laRV82NEtCIGlzIG5vdCBzZXQKQ09ORklHX0NQVV9IQVNf
UFJFRkVUQ0g9eQojIENPTkZJR19WVEFHX0lDQUNIRSBpcyBub3Qgc2V0CiMgQ09ORklHXzY0QklU
X1BIWVNfQUREUiBpcyBub3Qgc2V0CiMgQ09ORklHX0NQVV9BRFZBTkNFRCBpcyBub3Qgc2V0CkNP
TkZJR19DUFVfSEFTX0xMU0M9eQojIENPTkZJR19DUFVfSEFTX0xMRFNDRCBpcyBub3Qgc2V0CiMg
Q09ORklHX0NQVV9IQVNfV0IgaXMgbm90IHNldApDT05GSUdfQ1BVX0hBU19TWU5DPXkKCiMKIyBH
ZW5lcmFsIHNldHVwCiMKIyBDT05GSUdfQ1BVX0xJVFRMRV9FTkRJQU4gaXMgbm90IHNldAojIENP
TkZJR19CSU5GTVRfSVJJWCBpcyBub3Qgc2V0CkNPTkZJR19ORVQ9eQojIENPTkZJR19QQ0lfTkFN
RVMgaXMgbm90IHNldAojIENPTkZJR19JU0EgaXMgbm90IHNldAojIENPTkZJR19UQyBpcyBub3Qg
c2V0CiMgQ09ORklHX01DQSBpcyBub3Qgc2V0CiMgQ09ORklHX1NCVVMgaXMgbm90IHNldAojIENP
TkZJR19IT1RQTFVHIGlzIG5vdCBzZXQKIyBDT05GSUdfUENNQ0lBIGlzIG5vdCBzZXQKIyBDT05G
SUdfSE9UUExVR19QQ0kgaXMgbm90IHNldApDT05GSUdfUFJFRU1QVD15CiMgQ09ORklHX1NZU1ZJ
UEMgaXMgbm90IHNldAojIENPTkZJR19CU0RfUFJPQ0VTU19BQ0NUIGlzIG5vdCBzZXQKQ09ORklH
X1NZU0NUTD15CkNPTkZJR19LQ09SRV9FTEY9eQojIENPTkZJR19LQ09SRV9BT1VUIGlzIG5vdCBz
ZXQKIyBDT05GSUdfQklORk1UX0FPVVQgaXMgbm90IHNldApDT05GSUdfQklORk1UX0VMRj15CiMg
Q09ORklHX01JUFMzMl9DT01QQVQgaXMgbm90IHNldAojIENPTkZJR19NSVBTMzJfTzMyIGlzIG5v
dCBzZXQKIyBDT05GSUdfTUlQUzMyX04zMiBpcyBub3Qgc2V0CiMgQ09ORklHX0JJTkZNVF9FTEYz
MiBpcyBub3Qgc2V0CiMgQ09ORklHX0JJTkZNVF9NSVNDIGlzIG5vdCBzZXQKIyBDT05GSUdfT09N
X0tJTExFUiBpcyBub3Qgc2V0CgojCiMgTWVtb3J5IFRlY2hub2xvZ3kgRGV2aWNlcyAoTVREKQoj
CiMgQ09ORklHX01URCBpcyBub3Qgc2V0CgojCiMgUGFyYWxsZWwgcG9ydCBzdXBwb3J0CiMKIyBD
T05GSUdfUEFSUE9SVCBpcyBub3Qgc2V0CgojCiMgUGx1ZyBhbmQgUGxheSBjb25maWd1cmF0aW9u
CiMKIyBDT05GSUdfUE5QIGlzIG5vdCBzZXQKIyBDT05GSUdfSVNBUE5QIGlzIG5vdCBzZXQKCiMK
IyBCbG9jayBkZXZpY2VzCiMKIyBDT05GSUdfQkxLX0RFVl9GRCBpcyBub3Qgc2V0CiMgQ09ORklH
X0JMS19ERVZfWEQgaXMgbm90IHNldAojIENPTkZJR19QQVJJREUgaXMgbm90IHNldAojIENPTkZJ
R19CTEtfQ1BRX0RBIGlzIG5vdCBzZXQKIyBDT05GSUdfQkxLX0NQUV9DSVNTX0RBIGlzIG5vdCBz
ZXQKIyBDT05GSUdfQ0lTU19TQ1NJX1RBUEUgaXMgbm90IHNldAojIENPTkZJR19DSVNTX01PTklU
T1JfVEhSRUFEIGlzIG5vdCBzZXQKIyBDT05GSUdfQkxLX0RFVl9EQUM5NjAgaXMgbm90IHNldAoj
IENPTkZJR19CTEtfREVWX1VNRU0gaXMgbm90IHNldApDT05GSUdfQkxLX0RFVl9MT09QPXkKIyBD
T05GSUdfQkxLX0RFVl9OQkQgaXMgbm90IHNldAojIENPTkZJR19CTEtfREVWX1JBTSBpcyBub3Qg
c2V0CiMgQ09ORklHX0JMS19ERVZfSU5JVFJEIGlzIG5vdCBzZXQKIyBDT05GSUdfQkxLX1NUQVRT
IGlzIG5vdCBzZXQKCiMKIyBNdWx0aS1kZXZpY2Ugc3VwcG9ydCAoUkFJRCBhbmQgTFZNKQojCiMg
Q09ORklHX01EIGlzIG5vdCBzZXQKIyBDT05GSUdfQkxLX0RFVl9NRCBpcyBub3Qgc2V0CiMgQ09O
RklHX01EX0xJTkVBUiBpcyBub3Qgc2V0CiMgQ09ORklHX01EX1JBSUQwIGlzIG5vdCBzZXQKIyBD
T05GSUdfTURfUkFJRDEgaXMgbm90IHNldAojIENPTkZJR19NRF9SQUlENSBpcyBub3Qgc2V0CiMg
Q09ORklHX01EX01VTFRJUEFUSCBpcyBub3Qgc2V0CiMgQ09ORklHX0JMS19ERVZfTFZNIGlzIG5v
dCBzZXQKCiMKIyBOZXR3b3JraW5nIG9wdGlvbnMKIwpDT05GSUdfUEFDS0VUPXkKIyBDT05GSUdf
UEFDS0VUX01NQVAgaXMgbm90IHNldAojIENPTkZJR19ORVRMSU5LX0RFViBpcyBub3Qgc2V0CkNP
TkZJR19ORVRGSUxURVI9eQojIENPTkZJR19ORVRGSUxURVJfREVCVUcgaXMgbm90IHNldAojIENP
TkZJR19GSUxURVIgaXMgbm90IHNldApDT05GSUdfVU5JWD15CkNPTkZJR19JTkVUPXkKQ09ORklH
X0lQX01VTFRJQ0FTVD15CkNPTkZJR19JUF9BRFZBTkNFRF9ST1VURVI9eQpDT05GSUdfSVBfTVVM
VElQTEVfVEFCTEVTPXkKQ09ORklHX0lQX1JPVVRFX0ZXTUFSSz15CkNPTkZJR19JUF9ST1VURV9O
QVQ9eQpDT05GSUdfSVBfUk9VVEVfTVVMVElQQVRIPXkKQ09ORklHX0lQX1JPVVRFX1RPUz15CiMg
Q09ORklHX0lQX1JPVVRFX1ZFUkJPU0UgaXMgbm90IHNldApDT05GSUdfSVBfUE5QPXkKQ09ORklH
X0lQX1BOUF9ESENQPXkKIyBDT05GSUdfSVBfUE5QX0JPT1RQIGlzIG5vdCBzZXQKIyBDT05GSUdf
SVBfUE5QX1JBUlAgaXMgbm90IHNldApDT05GSUdfTkVUX0lQSVA9bQpDT05GSUdfTkVUX0lQR1JF
PW0KQ09ORklHX05FVF9JUEdSRV9CUk9BRENBU1Q9eQojIENPTkZJR19JUF9NUk9VVEUgaXMgbm90
IHNldAojIENPTkZJR19BUlBEIGlzIG5vdCBzZXQKIyBDT05GSUdfSU5FVF9FQ04gaXMgbm90IHNl
dAojIENPTkZJR19TWU5fQ09PS0lFUyBpcyBub3Qgc2V0CgojCiMgICBJUDogTmV0ZmlsdGVyIENv
bmZpZ3VyYXRpb24KIwpDT05GSUdfSVBfTkZfQ09OTlRSQUNLPXkKQ09ORklHX0lQX05GX0ZUUD15
CiMgQ09ORklHX0lQX05GX0FNQU5EQSBpcyBub3Qgc2V0CiMgQ09ORklHX0lQX05GX1RGVFAgaXMg
bm90IHNldApDT05GSUdfSVBfTkZfSVJDPXkKQ09ORklHX0lQX05GX1FVRVVFPXkKQ09ORklHX0lQ
X05GX0lQVEFCTEVTPXkKQ09ORklHX0lQX05GX01BVENIX0xJTUlUPXkKQ09ORklHX0lQX05GX01B
VENIX01BQz15CkNPTkZJR19JUF9ORl9NQVRDSF9QS1RUWVBFPXkKQ09ORklHX0lQX05GX01BVENI
X01BUks9eQpDT05GSUdfSVBfTkZfTUFUQ0hfTVVMVElQT1JUPXkKQ09ORklHX0lQX05GX01BVENI
X1RPUz15CiMgQ09ORklHX0lQX05GX01BVENIX1JFQ0VOVCBpcyBub3Qgc2V0CkNPTkZJR19JUF9O
Rl9NQVRDSF9FQ049eQpDT05GSUdfSVBfTkZfTUFUQ0hfRFNDUD15CkNPTkZJR19JUF9ORl9NQVRD
SF9BSF9FU1A9eQpDT05GSUdfSVBfTkZfTUFUQ0hfTEVOR1RIPXkKQ09ORklHX0lQX05GX01BVENI
X1RUTD15CkNPTkZJR19JUF9ORl9NQVRDSF9UQ1BNU1M9eQpDT05GSUdfSVBfTkZfTUFUQ0hfSEVM
UEVSPXkKQ09ORklHX0lQX05GX01BVENIX1NUQVRFPXkKQ09ORklHX0lQX05GX01BVENIX0NPTk5U
UkFDSz15CkNPTkZJR19JUF9ORl9NQVRDSF9VTkNMRUFOPXkKQ09ORklHX0lQX05GX01BVENIX09X
TkVSPXkKQ09ORklHX0lQX05GX0ZJTFRFUj15CkNPTkZJR19JUF9ORl9UQVJHRVRfUkVKRUNUPXkK
Q09ORklHX0lQX05GX1RBUkdFVF9NSVJST1I9eQpDT05GSUdfSVBfTkZfTkFUPXkKQ09ORklHX0lQ
X05GX05BVF9ORUVERUQ9eQpDT05GSUdfSVBfTkZfVEFSR0VUX01BU1FVRVJBREU9eQpDT05GSUdf
SVBfTkZfVEFSR0VUX1JFRElSRUNUPXkKIyBDT05GSUdfSVBfTkZfTkFUX0xPQ0FMIGlzIG5vdCBz
ZXQKQ09ORklHX0lQX05GX05BVF9TTk1QX0JBU0lDPXkKQ09ORklHX0lQX05GX05BVF9JUkM9eQpD
T05GSUdfSVBfTkZfTkFUX0ZUUD15CkNPTkZJR19JUF9ORl9NQU5HTEU9eQpDT05GSUdfSVBfTkZf
VEFSR0VUX1RPUz15CkNPTkZJR19JUF9ORl9UQVJHRVRfRUNOPXkKQ09ORklHX0lQX05GX1RBUkdF
VF9EU0NQPXkKQ09ORklHX0lQX05GX1RBUkdFVF9NQVJLPXkKQ09ORklHX0lQX05GX1RBUkdFVF9M
T0c9eQpDT05GSUdfSVBfTkZfVEFSR0VUX1VMT0c9eQpDT05GSUdfSVBfTkZfVEFSR0VUX1RDUE1T
Uz15CiMgQ09ORklHX0lQX05GX0FSUFRBQkxFUyBpcyBub3Qgc2V0CgojCiMgICBJUDogVmlydHVh
bCBTZXJ2ZXIgQ29uZmlndXJhdGlvbgojCiMgQ09ORklHX0lQX1ZTIGlzIG5vdCBzZXQKIyBDT05G
SUdfSVBWNiBpcyBub3Qgc2V0CiMgQ09ORklHX0tIVFRQRCBpcyBub3Qgc2V0CgojCiMgICAgU0NU
UCBDb25maWd1cmF0aW9uIChFWFBFUklNRU5UQUwpCiMKIyBDT05GSUdfSVBfU0NUUCBpcyBub3Qg
c2V0CkNPTkZJR19BVE09eQpDT05GSUdfQVRNX0NMSVA9eQpDT05GSUdfQVRNX0NMSVBfTk9fSUNN
UD15CiMgQ09ORklHX0FUTV9MQU5FIGlzIG5vdCBzZXQKQ09ORklHX0FUTV9CUjI2ODQ9eQojIENP
TkZJR19BVE1fQlIyNjg0X0lQRklMVEVSIGlzIG5vdCBzZXQKIyBDT05GSUdfVkxBTl84MDIxUSBp
cyBub3Qgc2V0CgojCiMgIAojCiMgQ09ORklHX0lQWCBpcyBub3Qgc2V0CiMgQ09ORklHX0FUQUxL
IGlzIG5vdCBzZXQKCiMKIyBBcHBsZXRhbGsgZGV2aWNlcwojCiMgQ09ORklHX0RFVl9BUFBMRVRB
TEsgaXMgbm90IHNldAojIENPTkZJR19ERUNORVQgaXMgbm90IHNldApDT05GSUdfQlJJREdFPXkK
IyBDT05GSUdfWDI1IGlzIG5vdCBzZXQKIyBDT05GSUdfTEFQQiBpcyBub3Qgc2V0CiMgQ09ORklH
X0xMQyBpcyBub3Qgc2V0CiMgQ09ORklHX05FVF9ESVZFUlQgaXMgbm90IHNldAojIENPTkZJR19F
Q09ORVQgaXMgbm90IHNldAojIENPTkZJR19XQU5fUk9VVEVSIGlzIG5vdCBzZXQKIyBDT05GSUdf
TkVUX0ZBU1RST1VURSBpcyBub3Qgc2V0CiMgQ09ORklHX05FVF9IV19GTE9XQ09OVFJPTCBpcyBu
b3Qgc2V0CgojCiMgUW9TIGFuZC9vciBmYWlyIHF1ZXVlaW5nCiMKQ09ORklHX05FVF9TQ0hFRD15
CkNPTkZJR19ORVRfU0NIX0NCUT15CkNPTkZJR19ORVRfU0NIX0hUQj15CiMgQ09ORklHX05FVF9T
Q0hfQ1NaIGlzIG5vdCBzZXQKIyBDT05GSUdfTkVUX1NDSF9IRlNDIGlzIG5vdCBzZXQKIyBDT05G
SUdfTkVUX1NDSF9BVE0gaXMgbm90IHNldApDT05GSUdfTkVUX1NDSF9QUklPPXkKQ09ORklHX05F
VF9TQ0hfUkVEPXkKIyBDT05GSUdfTkVUX1NDSF9TRlEgaXMgbm90IHNldAojIENPTkZJR19ORVRf
U0NIX1RFUUwgaXMgbm90IHNldAojIENPTkZJR19ORVRfU0NIX1RCRiBpcyBub3Qgc2V0CiMgQ09O
RklHX05FVF9TQ0hfR1JFRCBpcyBub3Qgc2V0CiMgQ09ORklHX05FVF9TQ0hfREVMQVkgaXMgbm90
IHNldApDT05GSUdfTkVUX1NDSF9EU01BUks9eQpDT05GSUdfTkVUX1NDSF9JTkdSRVNTPXkKQ09O
RklHX05FVF9RT1M9eQpDT05GSUdfTkVUX0VTVElNQVRPUj15CkNPTkZJR19ORVRfQ0xTPXkKQ09O
RklHX05FVF9DTFNfVENJTkRFWD15CkNPTkZJR19ORVRfQ0xTX1JPVVRFND15CkNPTkZJR19ORVRf
Q0xTX1JPVVRFPXkKQ09ORklHX05FVF9DTFNfRlc9eQpDT05GSUdfTkVUX0NMU19VMzI9eQojIENP
TkZJR19ORVRfQ0xTX1JTVlAgaXMgbm90IHNldAojIENPTkZJR19ORVRfQ0xTX1JTVlA2IGlzIG5v
dCBzZXQKQ09ORklHX05FVF9DTFNfUE9MSUNFPXkKCiMKIyBOZXR3b3JrIHRlc3RpbmcKIwojIENP
TkZJR19ORVRfUEtUR0VOIGlzIG5vdCBzZXQKCiMKIyBUZWxlcGhvbnkgU3VwcG9ydAojCiMgQ09O
RklHX1BIT05FIGlzIG5vdCBzZXQKIyBDT05GSUdfUEhPTkVfSVhKIGlzIG5vdCBzZXQKIyBDT05G
SUdfUEhPTkVfSVhKX1BDTUNJQSBpcyBub3Qgc2V0CgojCiMgQVRBL0lERS9NRk0vUkxMIHN1cHBv
cnQKIwojIENPTkZJR19JREUgaXMgbm90IHNldAojIENPTkZJR19CTEtfREVWX0hEIGlzIG5vdCBz
ZXQKCiMKIyBTQ1NJIHN1cHBvcnQKIwojIENPTkZJR19TQ1NJIGlzIG5vdCBzZXQKCiMKIyBGdXNp
b24gTVBUIGRldmljZSBzdXBwb3J0CiMKIyBDT05GSUdfRlVTSU9OIGlzIG5vdCBzZXQKIyBDT05G
SUdfRlVTSU9OX0JPT1QgaXMgbm90IHNldAojIENPTkZJR19GVVNJT05fSVNFTlNFIGlzIG5vdCBz
ZXQKIyBDT05GSUdfRlVTSU9OX0NUTCBpcyBub3Qgc2V0CiMgQ09ORklHX0ZVU0lPTl9MQU4gaXMg
bm90IHNldAoKIwojIElFRUUgMTM5NCAoRmlyZVdpcmUpIHN1cHBvcnQgKEVYUEVSSU1FTlRBTCkK
IwojIENPTkZJR19JRUVFMTM5NCBpcyBub3Qgc2V0CgojCiMgSTJPIGRldmljZSBzdXBwb3J0CiMK
IyBDT05GSUdfSTJPIGlzIG5vdCBzZXQKIyBDT05GSUdfSTJPX1BDSSBpcyBub3Qgc2V0CiMgQ09O
RklHX0kyT19CTE9DSyBpcyBub3Qgc2V0CiMgQ09ORklHX0kyT19MQU4gaXMgbm90IHNldAojIENP
TkZJR19JMk9fU0NTSSBpcyBub3Qgc2V0CiMgQ09ORklHX0kyT19QUk9DIGlzIG5vdCBzZXQKCiMK
IyBOZXR3b3JrIGRldmljZSBzdXBwb3J0CiMKQ09ORklHX05FVERFVklDRVM9eQoKIwojIEFSQ25l
dCBkZXZpY2VzCiMKIyBDT05GSUdfQVJDTkVUIGlzIG5vdCBzZXQKQ09ORklHX0RVTU1ZPXkKIyBD
T05GSUdfQk9ORElORyBpcyBub3Qgc2V0CiMgQ09ORklHX0VRVUFMSVpFUiBpcyBub3Qgc2V0CiMg
Q09ORklHX1RVTiBpcyBub3Qgc2V0CiMgQ09ORklHX0VUSEVSVEFQIGlzIG5vdCBzZXQKCiMKIyBF
dGhlcm5ldCAoMTAgb3IgMTAwTWJpdCkKIwpDT05GSUdfTkVUX0VUSEVSTkVUPXkKIyBDT05GSUdf
U1VOTEFOQ0UgaXMgbm90IHNldAojIENPTkZJR19IQVBQWU1FQUwgaXMgbm90IHNldAojIENPTkZJ
R19TVU5CTUFDIGlzIG5vdCBzZXQKIyBDT05GSUdfU1VOUUUgaXMgbm90IHNldAojIENPTkZJR19T
VU5HRU0gaXMgbm90IHNldAojIENPTkZJR19ORVRfVkVORE9SXzNDT00gaXMgbm90IHNldAojIENP
TkZJR19MQU5DRSBpcyBub3Qgc2V0CiMgQ09ORklHX05FVF9WRU5ET1JfU01DIGlzIG5vdCBzZXQK
IyBDT05GSUdfTkVUX1ZFTkRPUl9SQUNBTCBpcyBub3Qgc2V0CiMgQ09ORklHX0hQMTAwIGlzIG5v
dCBzZXQKIyBDT05GSUdfTkVUX0lTQSBpcyBub3Qgc2V0CkNPTkZJR19ORVRfUENJPXkKQ09ORklH
X1BDTkVUMzI9eQojIENPTkZJR19BTUQ4MTExX0VUSCBpcyBub3Qgc2V0CiMgQ09ORklHX0FEQVBU
RUNfU1RBUkZJUkUgaXMgbm90IHNldAojIENPTkZJR19BUFJJQ09UIGlzIG5vdCBzZXQKIyBDT05G
SUdfQjQ0IGlzIG5vdCBzZXQKIyBDT05GSUdfQ1M4OXgwIGlzIG5vdCBzZXQKIyBDT05GSUdfVFVM
SVAgaXMgbm90IHNldAojIENPTkZJR19ERTRYNSBpcyBub3Qgc2V0CiMgQ09ORklHX0RHUlMgaXMg
bm90IHNldAojIENPTkZJR19ETTkxMDIgaXMgbm90IHNldApDT05GSUdfRUVQUk8xMDA9bQojIENP
TkZJR19FRVBSTzEwMF9QSU8gaXMgbm90IHNldAojIENPTkZJR19FMTAwIGlzIG5vdCBzZXQKIyBD
T05GSUdfTE5FMzkwIGlzIG5vdCBzZXQKIyBDT05GSUdfRkVBTE5YIGlzIG5vdCBzZXQKIyBDT05G
SUdfTkFUU0VNSSBpcyBub3Qgc2V0CiMgQ09ORklHX05FMktfUENJIGlzIG5vdCBzZXQKIyBDT05G
SUdfRk9SQ0VERVRIIGlzIG5vdCBzZXQKIyBDT05GSUdfTkUzMjEwIGlzIG5vdCBzZXQKIyBDT05G
SUdfRVMzMjEwIGlzIG5vdCBzZXQKIyBDT05GSUdfODEzOUNQIGlzIG5vdCBzZXQKIyBDT05GSUdf
ODEzOVRPTyBpcyBub3Qgc2V0CiMgQ09ORklHXzgxMzlUT09fUElPIGlzIG5vdCBzZXQKIyBDT05G
SUdfODEzOVRPT19UVU5FX1RXSVNURVIgaXMgbm90IHNldAojIENPTkZJR184MTM5VE9PXzgxMjkg
aXMgbm90IHNldAojIENPTkZJR184MTM5X09MRF9SWF9SRVNFVCBpcyBub3Qgc2V0CiMgQ09ORklH
X1NJUzkwMCBpcyBub3Qgc2V0CiMgQ09ORklHX0VQSUMxMDAgaXMgbm90IHNldAojIENPTkZJR19T
VU5EQU5DRSBpcyBub3Qgc2V0CiMgQ09ORklHX1NVTkRBTkNFX01NSU8gaXMgbm90IHNldAojIENP
TkZJR19UTEFOIGlzIG5vdCBzZXQKIyBDT05GSUdfVklBX1JISU5FIGlzIG5vdCBzZXQKIyBDT05G
SUdfVklBX1JISU5FX01NSU8gaXMgbm90IHNldAojIENPTkZJR19XSU5CT05EXzg0MCBpcyBub3Qg
c2V0CiMgQ09ORklHX0xBTl9TQUE5NzMwIGlzIG5vdCBzZXQKIyBDT05GSUdfTkVUX1BPQ0tFVCBp
cyBub3Qgc2V0CgojCiMgRXRoZXJuZXQgKDEwMDAgTWJpdCkKIwojIENPTkZJR19BQ0VOSUMgaXMg
bm90IHNldAojIENPTkZJR19ETDJLIGlzIG5vdCBzZXQKIyBDT05GSUdfRTEwMDAgaXMgbm90IHNl
dAojIENPTkZJR19NWVJJX1NCVVMgaXMgbm90IHNldAojIENPTkZJR19OUzgzODIwIGlzIG5vdCBz
ZXQKIyBDT05GSUdfSEFNQUNISSBpcyBub3Qgc2V0CiMgQ09ORklHX1lFTExPV0ZJTiBpcyBub3Qg
c2V0CiMgQ09ORklHX1I4MTY5IGlzIG5vdCBzZXQKIyBDT05GSUdfU0s5OExJTiBpcyBub3Qgc2V0
CiMgQ09ORklHX1RJR09OMyBpcyBub3Qgc2V0CiMgQ09ORklHX0ZEREkgaXMgbm90IHNldAojIENP
TkZJR19ISVBQSSBpcyBub3Qgc2V0CiMgQ09ORklHX1BMSVAgaXMgbm90IHNldApDT05GSUdfUFBQ
PXkKIyBDT05GSUdfUFBQX01VTFRJTElOSyBpcyBub3Qgc2V0CiMgQ09ORklHX1BQUF9GSUxURVIg
aXMgbm90IHNldAojIENPTkZJR19QUFBfQVNZTkMgaXMgbm90IHNldApDT05GSUdfUFBQX1NZTkNf
VFRZPXkKQ09ORklHX1BQUF9ERUZMQVRFPXkKIyBDT05GSUdfUFBQX0JTRENPTVAgaXMgbm90IHNl
dApDT05GSUdfUFBQT0U9eQpDT05GSUdfUFBQT0FUTT15CiMgQ09ORklHX1NMSVAgaXMgbm90IHNl
dAoKIwojIFdpcmVsZXNzIExBTiAobm9uLWhhbXJhZGlvKQojCiMgQ09ORklHX05FVF9SQURJTyBp
cyBub3Qgc2V0CgojCiMgVG9rZW4gUmluZyBkZXZpY2VzCiMKIyBDT05GSUdfVFIgaXMgbm90IHNl
dAojIENPTkZJR19ORVRfRkMgaXMgbm90IHNldAojIENPTkZJR19SQ1BDSSBpcyBub3Qgc2V0CiMg
Q09ORklHX1NIQVBFUiBpcyBub3Qgc2V0CgojCiMgV2FuIGludGVyZmFjZXMKIwojIENPTkZJR19X
QU4gaXMgbm90IHNldAoKIwojIEFUTSBkcml2ZXJzCiMKIyBDT05GSUdfQVRNX1RDUCBpcyBub3Qg
c2V0CiMgQ09ORklHX0FUTV9MQU5BSSBpcyBub3Qgc2V0CiMgQ09ORklHX0FUTV9FTkkgaXMgbm90
IHNldAojIENPTkZJR19BVE1fRklSRVNUUkVBTSBpcyBub3Qgc2V0CiMgQ09ORklHX0FUTV9aQVRN
IGlzIG5vdCBzZXQKQ09ORklHX0FUTV9OSUNTVEFSPW0KQ09ORklHX0FUTV9OSUNTVEFSX1VTRV9T
VU5JPXkKQ09ORklHX0FUTV9OSUNTVEFSX1VTRV9JRFQ3NzEwNT15CiMgQ09ORklHX0FUTV9JRFQ3
NzI1MiBpcyBub3Qgc2V0CiMgQ09ORklHX0FUTV9BTUJBU1NBRE9SIGlzIG5vdCBzZXQKIyBDT05G
SUdfQVRNX0hPUklaT04gaXMgbm90IHNldAojIENPTkZJR19BVE1fSUEgaXMgbm90IHNldAojIENP
TkZJR19BVE1fRk9SRTIwMEVfTUFZQkUgaXMgbm90IHNldAojIENPTkZJR19BVE1fSEUgaXMgbm90
IHNldAoKIwojIEFtYXRldXIgUmFkaW8gc3VwcG9ydAojCiMgQ09ORklHX0hBTVJBRElPIGlzIG5v
dCBzZXQKCiMKIyBJckRBIChpbmZyYXJlZCkgc3VwcG9ydAojCiMgQ09ORklHX0lSREEgaXMgbm90
IHNldAoKIwojIElTRE4gc3Vic3lzdGVtCiMKIyBDT05GSUdfSVNETiBpcyBub3Qgc2V0CgojCiMg
SW5wdXQgY29yZSBzdXBwb3J0CiMKIyBDT05GSUdfSU5QVVQgaXMgbm90IHNldAojIENPTkZJR19J
TlBVVF9LRVlCREVWIGlzIG5vdCBzZXQKIyBDT05GSUdfSU5QVVRfTU9VU0VERVYgaXMgbm90IHNl
dAojIENPTkZJR19JTlBVVF9KT1lERVYgaXMgbm90IHNldAojIENPTkZJR19JTlBVVF9FVkRFViBp
cyBub3Qgc2V0CiMgQ09ORklHX0lOUFVUX1VJTlBVVCBpcyBub3Qgc2V0CgojCiMgQ2hhcmFjdGVy
IGRldmljZXMKIwojIENPTkZJR19WVCBpcyBub3Qgc2V0CkNPTkZJR19TRVJJQUw9eQpDT05GSUdf
U0VSSUFMX0NPTlNPTEU9eQojIENPTkZJR19TRVJJQUxfRVhURU5ERUQgaXMgbm90IHNldAojIENP
TkZJR19TRVJJQUxfTk9OU1RBTkRBUkQgaXMgbm90IHNldApDT05GSUdfVU5JWDk4X1BUWVM9eQpD
T05GSUdfVU5JWDk4X1BUWV9DT1VOVD0zMgoKIwojIEkyQyBzdXBwb3J0CiMKIyBDT05GSUdfSTJD
IGlzIG5vdCBzZXQKCiMKIyBNaWNlCiMKIyBDT05GSUdfQlVTTU9VU0UgaXMgbm90IHNldAojIENP
TkZJR19NT1VTRSBpcyBub3Qgc2V0CgojCiMgSm95c3RpY2tzCiMKIyBDT05GSUdfSU5QVVRfR0FN
RVBPUlQgaXMgbm90IHNldAoKIwojIElucHV0IGNvcmUgc3VwcG9ydCBpcyBuZWVkZWQgZm9yIGdh
bWVwb3J0cwojCgojCiMgSW5wdXQgY29yZSBzdXBwb3J0IGlzIG5lZWRlZCBmb3Igam95c3RpY2tz
CiMKIyBDT05GSUdfUUlDMDJfVEFQRSBpcyBub3Qgc2V0CiMgQ09ORklHX0lQTUlfSEFORExFUiBp
cyBub3Qgc2V0CiMgQ09ORklHX0lQTUlfUEFOSUNfRVZFTlQgaXMgbm90IHNldAojIENPTkZJR19J
UE1JX0RFVklDRV9JTlRFUkZBQ0UgaXMgbm90IHNldAojIENPTkZJR19JUE1JX0tDUyBpcyBub3Qg
c2V0CiMgQ09ORklHX0lQTUlfV0FUQ0hET0cgaXMgbm90IHNldAoKIwojIFdhdGNoZG9nIENhcmRz
CiMKIyBDT05GSUdfV0FUQ0hET0cgaXMgbm90IHNldAojIENPTkZJR19TQ3gyMDAgaXMgbm90IHNl
dAojIENPTkZJR19TQ3gyMDBfR1BJTyBpcyBub3Qgc2V0CiMgQ09ORklHX0FNRF9QTTc2OCBpcyBu
b3Qgc2V0CiMgQ09ORklHX05WUkFNIGlzIG5vdCBzZXQKQ09ORklHX1JUQz15CiMgQ09ORklHX01J
UFNfUlRDIGlzIG5vdCBzZXQKIyBDT05GSUdfRFRMSyBpcyBub3Qgc2V0CiMgQ09ORklHX1IzOTY0
IGlzIG5vdCBzZXQKIyBDT05GSUdfQVBQTElDT00gaXMgbm90IHNldAoKIwojIEZ0YXBlLCB0aGUg
ZmxvcHB5IHRhcGUgZGV2aWNlIGRyaXZlcgojCiMgQ09ORklHX0ZUQVBFIGlzIG5vdCBzZXQKIyBD
T05GSUdfQUdQIGlzIG5vdCBzZXQKCiMKIyBEaXJlY3QgUmVuZGVyaW5nIE1hbmFnZXIgKFhGcmVl
ODYgRFJJIHN1cHBvcnQpCiMKIyBDT05GSUdfRFJNIGlzIG5vdCBzZXQKCiMKIyBGaWxlIHN5c3Rl
bXMKIwojIENPTkZJR19RVU9UQSBpcyBub3Qgc2V0CiMgQ09ORklHX1FGTVRfVjIgaXMgbm90IHNl
dAojIENPTkZJR19BVVRPRlNfRlMgaXMgbm90IHNldApDT05GSUdfQVVUT0ZTNF9GUz1tCiMgQ09O
RklHX1JFSVNFUkZTX0ZTIGlzIG5vdCBzZXQKIyBDT05GSUdfUkVJU0VSRlNfQ0hFQ0sgaXMgbm90
IHNldAojIENPTkZJR19SRUlTRVJGU19QUk9DX0lORk8gaXMgbm90IHNldAojIENPTkZJR19BREZT
X0ZTIGlzIG5vdCBzZXQKIyBDT05GSUdfQURGU19GU19SVyBpcyBub3Qgc2V0CiMgQ09ORklHX0FG
RlNfRlMgaXMgbm90IHNldAojIENPTkZJR19IRlNfRlMgaXMgbm90IHNldAojIENPTkZJR19IRlNQ
TFVTX0ZTIGlzIG5vdCBzZXQKIyBDT05GSUdfQkVGU19GUyBpcyBub3Qgc2V0CiMgQ09ORklHX0JF
RlNfREVCVUcgaXMgbm90IHNldAojIENPTkZJR19CRlNfRlMgaXMgbm90IHNldAojIENPTkZJR19F
WFQzX0ZTIGlzIG5vdCBzZXQKIyBDT05GSUdfSkJEIGlzIG5vdCBzZXQKIyBDT05GSUdfSkJEX0RF
QlVHIGlzIG5vdCBzZXQKIyBDT05GSUdfRkFUX0ZTIGlzIG5vdCBzZXQKIyBDT05GSUdfTVNET1Nf
RlMgaXMgbm90IHNldAojIENPTkZJR19VTVNET1NfRlMgaXMgbm90IHNldAojIENPTkZJR19WRkFU
X0ZTIGlzIG5vdCBzZXQKIyBDT05GSUdfRUZTX0ZTIGlzIG5vdCBzZXQKIyBDT05GSUdfSkZGU19G
UyBpcyBub3Qgc2V0CiMgQ09ORklHX0pGRlMyX0ZTIGlzIG5vdCBzZXQKQ09ORklHX0NSQU1GUz15
CiMgQ09ORklHX1RNUEZTIGlzIG5vdCBzZXQKQ09ORklHX1JBTUZTPXkKIyBDT05GSUdfSVNPOTY2
MF9GUyBpcyBub3Qgc2V0CiMgQ09ORklHX0pPTElFVCBpcyBub3Qgc2V0CiMgQ09ORklHX1pJU09G
UyBpcyBub3Qgc2V0CiMgQ09ORklHX0pGU19GUyBpcyBub3Qgc2V0CiMgQ09ORklHX0pGU19ERUJV
RyBpcyBub3Qgc2V0CiMgQ09ORklHX0pGU19TVEFUSVNUSUNTIGlzIG5vdCBzZXQKIyBDT05GSUdf
TUlOSVhfRlMgaXMgbm90IHNldAojIENPTkZJR19WWEZTX0ZTIGlzIG5vdCBzZXQKIyBDT05GSUdf
TlRGU19GUyBpcyBub3Qgc2V0CiMgQ09ORklHX05URlNfUlcgaXMgbm90IHNldAojIENPTkZJR19I
UEZTX0ZTIGlzIG5vdCBzZXQKQ09ORklHX1BST0NfRlM9eQojIENPTkZJR19ERVZGU19GUyBpcyBu
b3Qgc2V0CiMgQ09ORklHX0RFVkZTX01PVU5UIGlzIG5vdCBzZXQKIyBDT05GSUdfREVWRlNfREVC
VUcgaXMgbm90IHNldApDT05GSUdfREVWUFRTX0ZTPXkKIyBDT05GSUdfUU5YNEZTX0ZTIGlzIG5v
dCBzZXQKIyBDT05GSUdfUU5YNEZTX1JXIGlzIG5vdCBzZXQKIyBDT05GSUdfUk9NRlNfRlMgaXMg
bm90IHNldApDT05GSUdfRVhUMl9GUz15CiMgQ09ORklHX1NZU1ZfRlMgaXMgbm90IHNldAojIENP
TkZJR19VREZfRlMgaXMgbm90IHNldAojIENPTkZJR19VREZfUlcgaXMgbm90IHNldAojIENPTkZJ
R19VRlNfRlMgaXMgbm90IHNldAojIENPTkZJR19VRlNfRlNfV1JJVEUgaXMgbm90IHNldAojIENP
TkZJR19YRlNfRlMgaXMgbm90IHNldAojIENPTkZJR19YRlNfUVVPVEEgaXMgbm90IHNldAojIENP
TkZJR19YRlNfUlQgaXMgbm90IHNldAojIENPTkZJR19YRlNfVFJBQ0UgaXMgbm90IHNldAojIENP
TkZJR19YRlNfREVCVUcgaXMgbm90IHNldAoKIwojIE5ldHdvcmsgRmlsZSBTeXN0ZW1zCiMKIyBD
T05GSUdfQ09EQV9GUyBpcyBub3Qgc2V0CiMgQ09ORklHX0lOVEVSTUVaWk9fRlMgaXMgbm90IHNl
dApDT05GSUdfTkZTX0ZTPXkKQ09ORklHX05GU19WMz15CiMgQ09ORklHX05GU19ESVJFQ1RJTyBp
cyBub3Qgc2V0CiMgQ09ORklHX1JPT1RfTkZTIGlzIG5vdCBzZXQKIyBDT05GSUdfTkZTRCBpcyBu
b3Qgc2V0CiMgQ09ORklHX05GU0RfVjMgaXMgbm90IHNldAojIENPTkZJR19ORlNEX1RDUCBpcyBu
b3Qgc2V0CkNPTkZJR19TVU5SUEM9eQpDT05GSUdfTE9DS0Q9eQpDT05GSUdfTE9DS0RfVjQ9eQoj
IENPTkZJR19TTUJfRlMgaXMgbm90IHNldAojIENPTkZJR19OQ1BfRlMgaXMgbm90IHNldAojIENP
TkZJR19OQ1BGU19QQUNLRVRfU0lHTklORyBpcyBub3Qgc2V0CiMgQ09ORklHX05DUEZTX0lPQ1RM
X0xPQ0tJTkcgaXMgbm90IHNldAojIENPTkZJR19OQ1BGU19TVFJPTkcgaXMgbm90IHNldAojIENP
TkZJR19OQ1BGU19ORlNfTlMgaXMgbm90IHNldAojIENPTkZJR19OQ1BGU19PUzJfTlMgaXMgbm90
IHNldAojIENPTkZJR19OQ1BGU19TTUFMTERPUyBpcyBub3Qgc2V0CiMgQ09ORklHX05DUEZTX05M
UyBpcyBub3Qgc2V0CiMgQ09ORklHX05DUEZTX0VYVFJBUyBpcyBub3Qgc2V0CiMgQ09ORklHX1pJ
U09GU19GUyBpcyBub3Qgc2V0CgojCiMgUGFydGl0aW9uIFR5cGVzCiMKIyBDT05GSUdfUEFSVElU
SU9OX0FEVkFOQ0VEIGlzIG5vdCBzZXQKQ09ORklHX01TRE9TX1BBUlRJVElPTj15CiMgQ09ORklH
X1NNQl9OTFMgaXMgbm90IHNldAojIENPTkZJR19OTFMgaXMgbm90IHNldAoKIwojIE11bHRpbWVk
aWEgZGV2aWNlcwojCiMgQ09ORklHX1ZJREVPX0RFViBpcyBub3Qgc2V0CgojCiMgU291bmQKIwoj
IENPTkZJR19TT1VORCBpcyBub3Qgc2V0CgojCiMgVVNCIHN1cHBvcnQKIwpDT05GSUdfVVNCPXkK
IyBDT05GSUdfVVNCX0RFQlVHIGlzIG5vdCBzZXQKCiMKIyBNaXNjZWxsYW5lb3VzIFVTQiBvcHRp
b25zCiMKQ09ORklHX1VTQl9ERVZJQ0VGUz15CiMgQ09ORklHX1VTQl9CQU5EV0lEVEggaXMgbm90
IHNldAoKIwojIFVTQiBIb3N0IENvbnRyb2xsZXIgRHJpdmVycwojCiMgQ09ORklHX1VTQl9FSENJ
X0hDRCBpcyBub3Qgc2V0CkNPTkZJR19VU0JfVUhDSV9BTFQ9eQojIENPTkZJR19VU0JfT0hDSSBp
cyBub3Qgc2V0CgojCiMgVVNCIERldmljZSBDbGFzcyBkcml2ZXJzCiMKIyBDT05GSUdfVVNCX0FV
RElPIGlzIG5vdCBzZXQKIyBDT05GSUdfVVNCX0VNSTI2IGlzIG5vdCBzZXQKIyBDT05GSUdfVVNC
X0JMVUVUT09USCBpcyBub3Qgc2V0CiMgQ09ORklHX1VTQl9NSURJIGlzIG5vdCBzZXQKCiMKIyAg
IFNDU0kgc3VwcG9ydCBpcyBuZWVkZWQgZm9yIFVTQiBTdG9yYWdlCiMKIyBDT05GSUdfVVNCX1NU
T1JBR0UgaXMgbm90IHNldAojIENPTkZJR19VU0JfU1RPUkFHRV9ERUJVRyBpcyBub3Qgc2V0CiMg
Q09ORklHX1VTQl9TVE9SQUdFX0RBVEFGQUIgaXMgbm90IHNldAojIENPTkZJR19VU0JfU1RPUkFH
RV9GUkVFQ09NIGlzIG5vdCBzZXQKIyBDT05GSUdfVVNCX1NUT1JBR0VfSVNEMjAwIGlzIG5vdCBz
ZXQKIyBDT05GSUdfVVNCX1NUT1JBR0VfRFBDTSBpcyBub3Qgc2V0CiMgQ09ORklHX1VTQl9TVE9S
QUdFX0hQODIwMGUgaXMgbm90IHNldAojIENPTkZJR19VU0JfU1RPUkFHRV9TRERSMDkgaXMgbm90
IHNldAojIENPTkZJR19VU0JfU1RPUkFHRV9TRERSNTUgaXMgbm90IHNldAojIENPTkZJR19VU0Jf
U1RPUkFHRV9KVU1QU0hPVCBpcyBub3Qgc2V0CiMgQ09ORklHX1VTQl9BQ00gaXMgbm90IHNldApD
T05GSUdfVVNCX1BSSU5URVI9eQoKIwojIFVTQiBIdW1hbiBJbnRlcmZhY2UgRGV2aWNlcyAoSElE
KQojCiMgQ09ORklHX1VTQl9ISUQgaXMgbm90IHNldAoKIwojICAgICBJbnB1dCBjb3JlIHN1cHBv
cnQgaXMgbmVlZGVkIGZvciBVU0IgSElEIGlucHV0IGxheWVyIG9yIEhJREJQIHN1cHBvcnQKIwoj
IENPTkZJR19VU0JfSElESU5QVVQgaXMgbm90IHNldAojIENPTkZJR19VU0JfSElEREVWIGlzIG5v
dCBzZXQKIyBDT05GSUdfVVNCX0tCRCBpcyBub3Qgc2V0CiMgQ09ORklHX1VTQl9NT1VTRSBpcyBu
b3Qgc2V0CiMgQ09ORklHX1VTQl9BSVBURUsgaXMgbm90IHNldAojIENPTkZJR19VU0JfV0FDT00g
aXMgbm90IHNldAojIENPTkZJR19VU0JfS0JUQUIgaXMgbm90IHNldAojIENPTkZJR19VU0JfUE9X
RVJNQVRFIGlzIG5vdCBzZXQKCiMKIyBVU0IgSW1hZ2luZyBkZXZpY2VzCiMKIyBDT05GSUdfVVNC
X0RDMlhYIGlzIG5vdCBzZXQKIyBDT05GSUdfVVNCX01EQzgwMCBpcyBub3Qgc2V0CiMgQ09ORklH
X1VTQl9TQ0FOTkVSIGlzIG5vdCBzZXQKIyBDT05GSUdfVVNCX01JQ1JPVEVLIGlzIG5vdCBzZXQK
IyBDT05GSUdfVVNCX0hQVVNCU0NTSSBpcyBub3Qgc2V0CgojCiMgVVNCIE11bHRpbWVkaWEgZGV2
aWNlcwojCgojCiMgICBWaWRlbzRMaW51eCBzdXBwb3J0IGlzIG5lZWRlZCBmb3IgVVNCIE11bHRp
bWVkaWEgZGV2aWNlIHN1cHBvcnQKIwoKIwojIFVTQiBOZXR3b3JrIGFkYXB0b3JzCiMKIyBDT05G
SUdfVVNCX1BFR0FTVVMgaXMgbm90IHNldAojIENPTkZJR19VU0JfUlRMODE1MCBpcyBub3Qgc2V0
CiMgQ09ORklHX1VTQl9LQVdFVEggaXMgbm90IHNldAojIENPTkZJR19VU0JfQ0FUQyBpcyBub3Qg
c2V0CiMgQ09ORklHX1VTQl9DRENFVEhFUiBpcyBub3Qgc2V0CiMgQ09ORklHX1VTQl9VU0JORVQg
aXMgbm90IHNldAoKIwojIFVTQiBwb3J0IGRyaXZlcnMKIwojIENPTkZJR19VU0JfVVNTNzIwIGlz
IG5vdCBzZXQKCiMKIyBVU0IgU2VyaWFsIENvbnZlcnRlciBzdXBwb3J0CiMKIyBDT05GSUdfVVNC
X1NFUklBTCBpcyBub3Qgc2V0CgojCiMgVVNCIE1pc2NlbGxhbmVvdXMgZHJpdmVycwojCiMgQ09O
RklHX1VTQl9SSU81MDAgaXMgbm90IHNldAojIENPTkZJR19VU0JfQVVFUlNXQUxEIGlzIG5vdCBz
ZXQKIyBDT05GSUdfVVNCX1RJR0wgaXMgbm90IHNldAojIENPTkZJR19VU0JfQlJMVkdFUiBpcyBu
b3Qgc2V0CiMgQ09ORklHX1VTQl9MQ0QgaXMgbm90IHNldAojIENPTkZJR19VU0JfU1BFRURUT1VD
SCBpcyBub3Qgc2V0CgojCiMgU3VwcG9ydCBmb3IgVVNCIGdhZGdldHMKIwojIENPTkZJR19VU0Jf
R0FER0VUIGlzIG5vdCBzZXQKCiMKIyBCbHVldG9vdGggc3VwcG9ydAojCiMgQ09ORklHX0JMVUVa
IGlzIG5vdCBzZXQKCiMKIyBLZXJuZWwgaGFja2luZwojCkNPTkZJR19DUk9TU0NPTVBJTEU9eQoj
IENPTkZJR19SVU5USU1FX0RFQlVHIGlzIG5vdCBzZXQKIyBDT05GSUdfS0dEQiBpcyBub3Qgc2V0
CiMgQ09ORklHX0dEQl9DT05TT0xFIGlzIG5vdCBzZXQKIyBDT05GSUdfREVCVUdfSU5GTyBpcyBu
b3Qgc2V0CiMgQ09ORklHX01BR0lDX1NZU1JRIGlzIG5vdCBzZXQKIyBDT05GSUdfTUlQU19VTkNB
Q0hFRCBpcyBub3Qgc2V0CkNPTkZJR19MT0dfQlVGX1NISUZUPTAKCiMKIyBDcnlwdG9ncmFwaGlj
IG9wdGlvbnMKIwojIENPTkZJR19DUllQVE8gaXMgbm90IHNldAoKIwojIExpYnJhcnkgcm91dGlu
ZXMKIwojIENPTkZJR19DUkMzMiBpcyBub3Qgc2V0CkNPTkZJR19aTElCX0lORkxBVEU9eQpDT05G
SUdfWkxJQl9ERUZMQVRFPXkK
------=_Part_3127_27407513.1124978268690--

From yuasa@hh.iij4u.or.jp Thu Aug 25 15:41:06 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 25 Aug 2005 15:41:26 +0100 (BST)
Received: from mo01.iij4u.or.jp ([IPv6:::ffff:210.130.0.20]:39900 "EHLO
	mo01.iij4u.or.jp") by linux-mips.org with ESMTP id <S8225330AbVHYOlG>;
	Thu, 25 Aug 2005 15:41:06 +0100
Received: MO(mo01)id j7PEke45003499; Thu, 25 Aug 2005 23:46:40 +0900 (JST)
Received: MDO(mdo00) id j7PEkdK7024650; Thu, 25 Aug 2005 23:46:40 +0900 (JST)
Received: from stratos (h009.p499.iij4u.or.jp [210.149.243.9])
	by mbox.iij4u.or.jp (4U-MR/mbox00) id j7PEkcsT011685
	(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT);
	Thu, 25 Aug 2005 23:46:39 +0900 (JST)
Date:	Thu, 25 Aug 2005 23:46:37 +0900
From:	Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	yuasa@hh.iij4u.or.jp, linux-mips <linux-mips@linux-mips.org>
Subject: [PATH 2.6] vr41xx: remove timex.h
Message-Id: <20050825234637.27fe3f35.yuasa@hh.iij4u.or.jp>
X-Mailer: Sylpheed version 1.0.5 (GTK+ 1.2.10; i486-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yuasa@hh.iij4u.or.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8802
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: yuasa@hh.iij4u.or.jp
Precedence: bulk
X-list: linux-mips

Hi Ralf,

vr41xx doesn't need mach-vr41xx/timex.h.
This patch has removed mach-vr41xx/timex.h.
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>

diff -urN -X dontdiff a-orig/include/asm-mips/mach-vr41xx/timex.h a/include/asm-mips/mach-vr41xx/timex.h
--- a-orig/include/asm-mips/mach-vr41xx/timex.h	2003-12-02 04:32:01.000000000 +0900
+++ a/include/asm-mips/mach-vr41xx/timex.h	1970-01-01 09:00:00.000000000 +0900
@@ -1,18 +0,0 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2003 by Ralf Baechle
- */
-/*
- * Changes:
- *  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
- *  - CLOCK_TICK_RATE is changed into 32768 from 6144000.
- */
-#ifndef __ASM_MACH_VR41XX_TIMEX_H
-#define __ASM_MACH_VR41XX_TIMEX_H
-
-#define CLOCK_TICK_RATE		32768
-
-#endif /* __ASM_MACH_VR41XX_TIMEX_H */

From bryan.althouse@3phoenix.com Thu Aug 25 16:21:31 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 25 Aug 2005 16:21:50 +0100 (BST)
Received: from rwcrmhc11.comcast.net ([IPv6:::ffff:204.127.198.35]:22430 "EHLO
	rwcrmhc11.comcast.net") by linux-mips.org with ESMTP
	id <S8225298AbVHYPVb>; Thu, 25 Aug 2005 16:21:31 +0100
Received: from ba3pi (pcp0010731669pcs.howard01.md.comcast.net[69.243.71.130])
          by comcast.net (rwcrmhc11) with SMTP
          id <200508251526590130063f7oe>; Thu, 25 Aug 2005 15:26:59 +0000
From:	"Bryan Althouse" <bryan.althouse@3phoenix.com>
To:	"'Ralf Baechle'" <ralf@linux-mips.org>
Cc:	<linux-mips@linux-mips.org>
Subject: RE: custom ide driver causes "Badness in smp_call_function"
Date:	Thu, 25 Aug 2005 11:26:58 -0400
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook, Build 11.0.6353
Thread-Index: AcWov/o2tje51yNZRMqC6qvo2vU/0gAyUQrg
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
In-Reply-To: <20050824152444.GE2783@linux-mips.org>
Message-Id: <20050825152131Z8225298-3678+7482@linux-mips.org>
Return-Path: <bryan.althouse@3phoenix.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8803
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: bryan.althouse@3phoenix.com
Precedence: bulk
X-list: linux-mips

Ralf,

Thank you for your help.  
I'm doing MMIO, not PIO, but it looks like your assessment is still valid.
I've been searching for places where ide MMIO is performed with interrupts
disabled.  I got excited when I found these lines in probe_hwif() of
ide-probe.c:

   irqd = hwif->irq;
   if (irqd)
        disable_irq(hwif->irq);

I was not initializing hwif->irq in my driver, so probably the interrupts
were being disabled here, and subsequent lines were causing the SMP badness.
I added the line "hwif->irq = 0" to my driver.  Interrupts are no longer
disabled here, but still I get the SMP badness.  I'll keep looking for other
places where the interrupts might be disabled.  

Does anyone know if the mips/swarm.c driver has this problem with SMP?
Thanks!
  
Bryan


From ralf@linux-mips.org Thu Aug 25 16:26:50 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 25 Aug 2005 16:27:07 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:53533 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225298AbVHYP0u>; Thu, 25 Aug 2005 16:26:50 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7PFWKJw009079;
	Thu, 25 Aug 2005 16:32:20 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7PFWJEd009078;
	Thu, 25 Aug 2005 16:32:19 +0100
Date:	Thu, 25 Aug 2005 16:32:19 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Kishore K <hellokishore@gmail.com>
Cc:	"linux-mips@linux-mips.org" <linux-mips@linux-mips.org>
Subject: Re: Preemption patch for 2.4.26 - mips
Message-ID: <20050825153219.GB2731@linux-mips.org>
References: <f07e6e050825065756c3ac27@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <f07e6e050825065756c3ac27@mail.gmail.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8804
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Thu, Aug 25, 2005 at 07:57:48PM +0600, Kishore K wrote:

> When I try to compile 2.4.26 kernel with the pre-emption patch from
> (http://www.kernel.org/pub/linux/kernel/people/rml/preempt-kernel/v2.4/)
> for malta board based on MIPS 4kc, compilation fails with the
> following error.

Straight Kernel.org kernels don't work for MIPS nor do the mentioned
patches.

  Ralf

From ralf@linux-mips.org Thu Aug 25 16:37:28 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 25 Aug 2005 16:37:49 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:31517 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225298AbVHYPh2>; Thu, 25 Aug 2005 16:37:28 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7PFgnBe009413;
	Thu, 25 Aug 2005 16:42:49 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7PFgnco009412;
	Thu, 25 Aug 2005 16:42:49 +0100
Date:	Thu, 25 Aug 2005 16:42:49 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Bryan Althouse <bryan.althouse@3phoenix.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: custom ide driver causes "Badness in smp_call_function"
Message-ID: <20050825154249.GC2731@linux-mips.org>
References: <20050824152444.GE2783@linux-mips.org> <20050825152131Z8225298-3678+7482@linux-mips.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050825152131Z8225298-3678+7482@linux-mips.org>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8805
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Thu, Aug 25, 2005 at 11:26:58AM -0400, Bryan Althouse wrote:
> From:	"Bryan Althouse" <bryan.althouse@3phoenix.com>
> To:	"'Ralf Baechle'" <ralf@linux-mips.org>
> Cc:	<linux-mips@linux-mips.org>
> Subject: RE: custom ide driver causes "Badness in smp_call_function"
> Date:	Thu, 25 Aug 2005 11:26:58 -0400
> Content-Type: text/plain;
> 	charset="us-ascii"
> 
> Ralf,
> 
> Thank you for your help.  
> I'm doing MMIO, not PIO, but it looks like your assessment is still valid.

... which still is programmed io ...

> I've been searching for places where ide MMIO is performed with interrupts
> disabled.  I got excited when I found these lines in probe_hwif() of
> ide-probe.c:
> 
>    irqd = hwif->irq;
>    if (irqd)
>         disable_irq(hwif->irq);
> 
> I was not initializing hwif->irq in my driver, so probably the interrupts
> were being disabled here, and subsequent lines were causing the SMP badness.
> I added the line "hwif->irq = 0" to my driver.  Interrupts are no longer
> disabled here, but still I get the SMP badness.  I'll keep looking for other
> places where the interrupts might be disabled.  
> 
> Does anyone know if the mips/swarm.c driver has this problem with SMP?
> Thanks!

No, SB1 has sane caches.

  Ralf

From herbert@13thfloor.at Thu Aug 25 16:54:33 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 25 Aug 2005 16:54:49 +0100 (BST)
Received: from MAIL.13thfloor.at ([IPv6:::ffff:212.16.62.50]:12489 "EHLO
	mail.13thfloor.at") by linux-mips.org with ESMTP
	id <S8225439AbVHYPyd>; Thu, 25 Aug 2005 16:54:33 +0100
Received: by mail.13thfloor.at (Postfix, from userid 1001)
	id A4DB13FC3F; Thu, 25 Aug 2005 18:00:07 +0200 (CEST)
Date:	Thu, 25 Aug 2005 18:00:07 +0200
From:	Herbert Poetzl <herbert@13thfloor.at>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	Kishore K <hellokishore@gmail.com>,
	"linux-mips@linux-mips.org" <linux-mips@linux-mips.org>
Subject: Re: Preemption patch for 2.4.26 - mips
Message-ID: <20050825160007.GA24413@MAIL.13thfloor.at>
References: <f07e6e050825065756c3ac27@mail.gmail.com> <20050825153219.GB2731@linux-mips.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050825153219.GB2731@linux-mips.org>
User-Agent: Mutt/1.5.6i
Return-Path: <herbert@13thfloor.at>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8806
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: herbert@13thfloor.at
Precedence: bulk
X-list: linux-mips

On Thu, Aug 25, 2005 at 04:32:19PM +0100, Ralf Baechle wrote:
> On Thu, Aug 25, 2005 at 07:57:48PM +0600, Kishore K wrote:
> 
> > When I try to compile 2.4.26 kernel with the pre-emption patch from
> > (http://www.kernel.org/pub/linux/kernel/people/rml/preempt-kernel/v2.4/)
> > for malta board based on MIPS 4kc, compilation fails with the
> > following error.
> 
> Straight Kernel.org kernels don't work for MIPS 

any reason why that is so?
is it planned to make at least 2.6.x work for MIPS?
does it make sense to help there?

TIA,
Herbert

> nor do the mentioned patches.

> 
>   Ralf

From bryan.althouse@3phoenix.com Thu Aug 25 22:12:18 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 25 Aug 2005 22:12:33 +0100 (BST)
Received: from rwcrmhc12.comcast.net ([IPv6:::ffff:204.127.198.43]:14753 "EHLO
	rwcrmhc12.comcast.net") by linux-mips.org with ESMTP
	id <S8225471AbVHYVMS>; Thu, 25 Aug 2005 22:12:18 +0100
Received: from ba3pi (pcp0010731669pcs.howard01.md.comcast.net[69.243.71.130])
          by comcast.net (rwcrmhc12) with SMTP
          id <2005082521174901400kkekge>; Thu, 25 Aug 2005 21:17:50 +0000
From:	"Bryan Althouse" <bryan.althouse@3phoenix.com>
To:	"'Ralf Baechle'" <ralf@linux-mips.org>
Cc:	<linux-mips@linux-mips.org>
Subject: RE: custom ide driver causes "Badness in smp_call_function"
Date:	Thu, 25 Aug 2005 17:17:48 -0400
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook, Build 11.0.6353
Thread-Index: AcWpi6yG5OnXfWlpRq2rlFKyrGwD5AALSfIg
In-Reply-To: <20050825154249.GC2731@linux-mips.org>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-Id: <20050825211218Z8225471-3678+7505@linux-mips.org>
Return-Path: <bryan.althouse@3phoenix.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8807
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: bryan.althouse@3phoenix.com
Precedence: bulk
X-list: linux-mips


Here are some observations...  

If I change the line "hwif->irq = 0" in my driver to "hwif->irq = 5", my SMP
kernel no longer experiences SMP badness.  Instead, I get many lines like
"hda: lost interrupt", and the drive is not usable.  If I compile the kernel
without SMP, the drive works properly as before.  I tried irq = 5 because I
noticed that /proc/interrupts indicated that ide0 was being probed at 5.
With the SMP kernel, /proc/interrupts shows a count of 0 for ide0.  My
non-SMP kernel shows a count that increments when the drive is being used
(as expected).

Bryan  


From ppopov@embeddedalley.com Thu Aug 25 22:45:53 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 25 Aug 2005 22:46:12 +0100 (BST)
Received: from smtp102.biz.mail.mud.yahoo.com ([IPv6:::ffff:68.142.200.237]:34726
	"HELO smtp102.biz.mail.mud.yahoo.com") by linux-mips.org with SMTP
	id <S8225474AbVHYVpx>; Thu, 25 Aug 2005 22:45:53 +0100
Received: (qmail 45725 invoked from network); 25 Aug 2005 21:51:26 -0000
Received: from unknown (HELO ?192.168.1.101?) (ppopov@embeddedalley.com@71.128.175.242 with plain)
  by smtp102.biz.mail.mud.yahoo.com with SMTP; 25 Aug 2005 21:51:26 -0000
Subject: patch / rfc
From:	Pete Popov <ppopov@embeddedalley.com>
Reply-To: ppopov@embeddedalley.com
To:	"'linux-mips@linux-mips.org'" <linux-mips@linux-mips.org>
Content-Type: text/plain
Organization: Embedded Alley Solutions, Inc
Date:	Thu, 25 Aug 2005 14:51:21 -0700
Message-Id: <1125006681.14435.1065.camel@localhost.localdomain>
Mime-Version: 1.0
X-Mailer: Evolution 2.0.4 (2.0.4-4) 
Content-Transfer-Encoding: 7bit
Return-Path: <ppopov@embeddedalley.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8808
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ppopov@embeddedalley.com
Precedence: bulk
X-list: linux-mips


This is an experimental (though tested) patch for early ioremap support
on mips, before mem_init runs. Something like this is only needed on
certain SoCs that have all of their I/O on high addresses such that they
can't me ioremapped through kseg1.

I think the CONFIG_64 stuff needs to removed since we don't need it. The
patch was tested on a MIPS32 CPU only. Some of the significant changes:

- trap_init() became early_trap_init() since too much stuff happens
there that is needed to support early ioremap. The old trap_init() is
now empty.

- added plat_setup_late() call. All ports would need to add that call,
or at least a placeholder. Early ioremap is possible only at that point.
However, most of the code in each plat_setup() can be moved to
plat_setup_late()

diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/kernel/setup.c linux-2.6-dev/arch/mips/kernel/setup.c
--- linux-2.6-orig/arch/mips/kernel/setup.c	2005-08-24 17:12:31.000000000 -0700
+++ linux-2.6-dev/arch/mips/kernel/setup.c	2005-08-25 10:56:40.000000000 -0700
@@ -42,7 +42,10 @@
 #include <asm/sections.h>
 #include <asm/setup.h>
 #include <asm/system.h>
+#include <asm/traps.h>
+#include <asm/io.h>
 
+int init_bootmem_done;
 struct cpuinfo_mips cpu_data[NR_CPUS] __read_mostly;
 
 EXPORT_SYMBOL(cpu_data);
@@ -417,6 +420,8 @@
 
 	/* Reserve the bootmap memory.  */
 	reserve_bootmem(PFN_PHYS(first_usable_pfn), bootmap_size);
+
+	init_bootmem_done = 1;
 #endif /* CONFIG_SGI_IP27 */
 
 #ifdef CONFIG_BLK_DEV_INITRD
@@ -511,7 +516,23 @@
 #undef MAXMEM
 #undef MAXMEM_PFN
 
+void __init early_ioremap_init(void)
+{
+#ifdef CONFIG_64BIT
+	ioremap_base = (VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE);
+#else
+#ifdef CONFIG_HIGHMEM
+	ioremap_base = (PKMAP_BASE-2*PAGE_SIZE);
+#else
+	ioremap_base = (FIXADDR_START-2*PAGE_SIZE);
+#endif
+#endif /* CONFIG_64BIT */
+
+	ioremap_bot = ioremap_base;
+}
+
 extern void plat_setup(void);
+extern void plat_setup_late(void);
 
 void __init setup_arch(char **cmdline_p)
 {
@@ -540,6 +561,11 @@
 	sparse_init();
 	paging_init();
 	resource_init();
+
+	early_trap_init();
+	early_ioremap_init();
+
+	plat_setup_late();	/* safe to do early ioremap */
 }
 
 int __init fpu_disable(char *s)
diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/kernel/traps.c linux-2.6-dev/arch/mips/kernel/traps.c
--- linux-2.6-orig/arch/mips/kernel/traps.c	2005-08-24 17:12:32.000000000 -0700
+++ linux-2.6-dev/arch/mips/kernel/traps.c	2005-08-25 00:39:39.000000000 -0700
@@ -1239,6 +1238,10 @@
 
 void __init trap_init(void)
 {
+}
+
+void __init early_trap_init(void)
+{
 	extern char except_vec3_generic, except_vec3_r4000;
 	extern char except_vec4;
 	unsigned long i;
diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/mm/init.c linux-2.6-dev/arch/mips/mm/init.c
--- linux-2.6-orig/arch/mips/mm/init.c	2005-08-10 18:15:55.000000000 -0700
+++ linux-2.6-dev/arch/mips/mm/init.c	2005-08-25 00:39:40.000000000 -0700
@@ -47,6 +47,8 @@
  * don't have to care about aliases on other CPUs.
  */
 unsigned long empty_zero_page, zero_page_mask;
+int mem_init_done;
+extern int init_bootmem_done;
 
 /*
  * Not static inline because used by IP27 special magic initialization code
@@ -200,6 +202,17 @@
 	return 0;
 }
 
+void __init *early_get_page(void)
+{
+	void *p;
+	if (init_bootmem_done) {
+		p = alloc_bootmem_pages(PAGE_SIZE);
+	} else {
+		p = NULL;
+	}
+	return p;
+}
+
 void __init mem_init(void)
 {
 	unsigned long codesize, reservedpages, datasize, initsize;
@@ -258,6 +271,8 @@
 	       datasize >> 10,
 	       initsize >> 10,
 	       (unsigned long) (totalhigh_pages << (PAGE_SHIFT-10)));
+
+	mem_init_done = 1;
 }
 #endif /* !CONFIG_NEED_MULTIPLE_NODES */
 
diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/mm/ioremap.c linux-2.6-dev/arch/mips/mm/ioremap.c
--- linux-2.6-orig/arch/mips/mm/ioremap.c	2005-08-10 18:15:55.000000000 -0700
+++ linux-2.6-dev/arch/mips/mm/ioremap.c	2005-08-25 13:35:25.045624752 -0700
@@ -15,6 +15,8 @@
 #include <asm/io.h>
 #include <asm/tlbflush.h>
 
+extern int mem_init_done;
+
 static inline void remap_area_pte(pte_t * pte, unsigned long address,
 	phys_t size, phys_t phys_addr, unsigned long flags)
 {
@@ -141,8 +143,9 @@
 
 	/*
 	 * Don't allow anybody to remap normal RAM that we're using..
+	 * mem_init() sets high_memory so only do the check after that.
 	 */
-	if (phys_addr < virt_to_phys(high_memory)) {
+	if (mem_init_done && (phys_addr < virt_to_phys(high_memory))) {
 		char *t_addr, *t_end;
 		struct page *page;
 
@@ -164,12 +167,18 @@
 	/*
 	 * Ok, go for it..
 	 */
-	area = get_vm_area(size, VM_IOREMAP);
-	if (!area)
-		return NULL;
-	addr = area->addr;
+	if (mem_init_done) {
+		area = get_vm_area(size, VM_IOREMAP);
+		if (!area)
+			return NULL;
+		addr = area->addr;
+	}
+	else {
+		addr = (void *)(ioremap_bot -= size);
+	}
 	if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) {
-		vunmap(addr);
+		if (mem_init_done)
+			vunmap(addr);
 		return NULL;
 	}
 
@@ -185,13 +194,15 @@
 	if (IS_KSEG1(addr))
 		return;
 
-	p = remove_vm_area((void *) (PAGE_MASK & (unsigned long __force) addr));
-	if (!p) {
-		printk(KERN_ERR "iounmap: bad address %p\n", addr);
-		return;
-	}
+	if ((unsigned long) addr < ioremap_bot) {
+		p = remove_vm_area((void *) (PAGE_MASK & (unsigned long __force) addr));
+		if (!p) {
+			printk(KERN_ERR "iounmap: bad address %p\n", addr);
+			return;
+		}
 
-        kfree(p);
+		kfree(p);
+	}
 }
 
 EXPORT_SYMBOL(__ioremap);
diff -Naur --exclude=CVS linux-2.6-orig/arch/mips/mm/pgtable-32.c linux-2.6-dev/arch/mips/mm/pgtable-32.c
--- linux-2.6-orig/arch/mips/mm/pgtable-32.c	2005-08-10 18:15:56.000000000 -0700
+++ linux-2.6-dev/arch/mips/mm/pgtable-32.c	2005-08-23 00:46:14.000000000 -0700
@@ -13,6 +13,9 @@
 #include <asm/fixmap.h>
 #include <asm/pgtable.h>
 
+unsigned long ioremap_base;
+unsigned long ioremap_bot;
+
 void pgd_init(unsigned long page)
 {
 	unsigned long *p = (unsigned long *) page;
diff -Naur --exclude=CVS linux-2.6-orig/include/asm-mips/io.h linux-2.6-dev/include/asm-mips/io.h
--- linux-2.6-orig/include/asm-mips/io.h	2005-08-10 18:22:04.000000000 -0700
+++ linux-2.6-dev/include/asm-mips/io.h	2005-08-25 13:35:31.000000000 -0700
@@ -637,4 +637,6 @@
  */
 #define xlate_dev_kmem_ptr(p)	p
 
+extern void early_ioremap_init(void);
+
 #endif /* _ASM_IO_H */
diff -Naur --exclude=CVS linux-2.6-orig/include/asm-mips/pgalloc.h linux-2.6-dev/include/asm-mips/pgalloc.h
--- linux-2.6-orig/include/asm-mips/pgalloc.h	2005-08-10 18:22:02.000000000 -0700
+++ linux-2.6-dev/include/asm-mips/pgalloc.h	2005-08-25 01:49:04.000000000 -0700
@@ -67,8 +67,17 @@
 	unsigned long address)
 {
 	pte_t *pte;
+	extern int mem_init_done;
+	extern void *early_get_page(void);
 
-	pte = (pte_t *) __get_free_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, PTE_ORDER);
+	if (mem_init_done) {
+		pte = (pte_t *) __get_free_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, PTE_ORDER);
+	} else {
+		pte = (pte_t *)early_get_page();
+		if (pte) {
+			clear_page(pte);
+		}
+	}
 
 	return pte;
 }
diff -Naur --exclude=CVS linux-2.6-orig/include/asm-mips/pgtable-32.h linux-2.6-dev/include/asm-mips/pgtable-32.h
--- linux-2.6-orig/include/asm-mips/pgtable-32.h	2005-08-25 13:02:30.000000000 -0700
+++ linux-2.6-dev/include/asm-mips/pgtable-32.h	2005-08-25 01:49:04.000000000 -0700
@@ -19,6 +19,8 @@
 
 #include <asm-generic/pgtable-nopmd.h>
 
+extern unsigned long ioremap_bot, ioremap_base;
+
 /*
  * - add_wired_entry() add a fixed TLB entry, and move wired register
  */
@@ -74,13 +76,9 @@
 #define USER_PTRS_PER_PGD	(0x80000000UL/PGDIR_SIZE)
 #define FIRST_USER_ADDRESS	0
 
-#define VMALLOC_START     MAP_BASE
+#define VMALLOC_START	MAP_BASE
 
-#ifdef CONFIG_HIGHMEM
-# define VMALLOC_END	(PKMAP_BASE-2*PAGE_SIZE)
-#else
-# define VMALLOC_END	(FIXADDR_START-2*PAGE_SIZE)
-#endif
+#define VMALLOC_END	ioremap_bot
 
 #ifdef CONFIG_64BIT_PHYS_ADDR
 #define pte_ERROR(e) \
diff -Naur --exclude=CVS linux-2.6-orig/include/asm-mips/traps.h linux-2.6-dev/include/asm-mips/traps.h
--- linux-2.6-orig/include/asm-mips/traps.h	2005-08-10 18:22:04.000000000 -0700
+++ linux-2.6-dev/include/asm-mips/traps.h	2005-08-25 10:56:01.000000000 -0700
@@ -24,4 +24,6 @@
 extern void (*board_nmi_handler_setup)(void);
 extern void (*board_ejtag_handler_setup)(void);
 
+extern void early_trap_init(void);
+
 #endif /* _ASM_TRAPS_H */



From jsun@junsun.net Fri Aug 26 00:45:26 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 26 Aug 2005 00:45:44 +0100 (BST)
Received: from [IPv6:::ffff:66.29.16.26] ([IPv6:::ffff:66.29.16.26]:54028 "EHLO
	junsun.net") by linux-mips.org with ESMTP id <S8225479AbVHYXp0>;
	Fri, 26 Aug 2005 00:45:26 +0100
Received: from gw.junsun.net (adsl-69-227-52-159.dsl.pltn13.pacbell.net [69.227.52.159])
	by junsun.net (8.13.1/8.13.1) with ESMTP id j7PNmfLm028550;
	Thu, 25 Aug 2005 16:48:41 -0700
Received: from gw.junsun.net (gw.junsun.net [127.0.0.1])
	by gw.junsun.net (8.13.1/8.13.1) with ESMTP id j7PNomWj010560;
	Thu, 25 Aug 2005 16:50:48 -0700
Received: (from jsun@localhost)
	by gw.junsun.net (8.13.1/8.13.1/Submit) id j7PNolwH010557;
	Thu, 25 Aug 2005 16:50:47 -0700
Date:	Thu, 25 Aug 2005 16:50:47 -0700
From:	Jun Sun <jsun@junsun.net>
To:	Kishore K <hellokishore@gmail.com>
Cc:	"linux-mips@linux-mips.org" <linux-mips@linux-mips.org>
Subject: Re: Preemption patch for 2.4.26 - mips
Message-ID: <20050825235047.GC10406@gw.junsun.net>
References: <f07e6e050825065756c3ac27@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <f07e6e050825065756c3ac27@mail.gmail.com>
User-Agent: Mutt/1.4.1i
Return-Path: <jsun@junsun.net>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8809
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: jsun@junsun.net
Precedence: bulk
X-list: linux-mips


You might be interested in an earlier patch I made for 2.4.21 against
MIPS CVS tree.

http://linux.junsun.net/patches/oss.sgi.com/experimental/030304-b.preempt-mips.patch

Jun

On Thu, Aug 25, 2005 at 07:57:48PM +0600, Kishore K wrote:
> When I try to compile 2.4.26 kernel with the pre-emption patch from
> (http://www.kernel.org/pub/linux/kernel/people/rml/preempt-kernel/v2.4/)
> for malta board based on MIPS 4kc, compilation fails with the
> following error.
> 
> [kishorek@blrn0092 linux-2.4.26]$ make vmlinux.srec
> gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o
> scripts/split-include scripts/split-include.c
> scripts/split-include include/linux/autoconf.h include/config
> mips-linux-gcc -D__KERNEL__ -I/home/kishorek/linux-2.4.26/include
> -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing
> -fno-common -fomit-frame-pointer -I
> /home/kishorek/linux-2.4.26/include/asm/gcc -G 0 -mno-abicalls
> -fno-pic -pipe  -finline-limit=100000 -mabi=32 -march=mips32 -mips32
> -Wa,-32 -Wa,-march=mips32 -Wa,-mips32 -Wa,--trap  
> -DKBUILD_BASENAME=main -c -o init/main.o init/main.c
> In file included from /home/kishorek/linux-2.4.26/include/linux/fs.h:200,
>                  from
> /home/kishorek/linux-2.4.26/include/linux/capability.h:17,            
>     from /home/kishorek/linux-2.4.26/include/linux/binfmts.h:5,
>                  from /home/kishorek/linux-2.4.26/include/linux/sched.h:9,
>                  from /home/kishorek/linux-2.4.26/include/linux/mm.h:4,
>                  from /home/kishorek/linux-2.4.26/include/linux/slab.h:14,
>                  from /home/kishorek/linux-2.4.26/include/linux/proc_fs.h:5,
>                  from init/main.c:15:
> /home/kishorek/linux-2.4.26/include/asm/semaphore.h: In function
> `down_trylock':/home/kishorek/linux-2.4.26/include/asm/semaphore.h:230:
> error: `current' undeclared (first use in this function)
> /home/kishorek/linux-2.4.26/include/asm/semaphore.h:230: error: (Each
> undeclared identifier is reported only once
> /home/kishorek/linux-2.4.26/include/asm/semaphore.h:230: error: for
> each function it appears in.)
> /home/kishorek/linux-2.4.26/include/asm/semaphore.h:243: warning:
> implicit declaration of function `preempt_schedule'
> /home/kishorek/linux-2.4.26/include/asm/semaphore.h: In function `up':
> /home/kishorek/linux-2.4.26/include/asm/semaphore.h:266: error:
> `current' undeclared (first use in this function)
> In file included from /home/kishorek/linux-2.4.26/include/linux/mm.h:4,
>                  from /home/kishorek/linux-2.4.26/include/linux/slab.h:14,
>                  from /home/kishorek/linux-2.4.26/include/linux/proc_fs.h:5,
>                  from init/main.c:15:
> /home/kishorek/linux-2.4.26/include/linux/sched.h: At top level:
> /home/kishorek/linux-2.4.26/include/linux/sched.h:152: warning: type
> mismatch with previous implicit declaration
> /home/kishorek/linux-2.4.26/include/asm/semaphore.h:273: warning:
> previous implicit declaration of `preempt_schedule'
> /home/kishorek/linux-2.4.26/include/linux/sched.h:152: warning:
> `preempt_schedule' was previously implicitly declared to return `int'
> In file included from /home/kishorek/linux-2.4.26/include/linux/sched.h:586,
>                  from /home/kishorek/linux-2.4.26/include/linux/mm.h:4,
>                  from /home/kishorek/linux-2.4.26/include/linux/slab.h:14,
>                  from /home/kishorek/linux-2.4.26/include/linux/proc_fs.h:5,
>                  from init/main.c:15:
> /home/kishorek/linux-2.4.26/include/asm/current.h:15: error: `current'
> used prior to declaration
> make: *** [init/main.o] Error 1
> 
> May I know, if any of you tried the pre-emption patch for 2.4.26 on
> mips platform. If so, please let me know the changes to be done or any
> other patch needs to be applied.
> 
> Here are the details of my toolchain
> gcc 3.3.6, binutils: 2.14.90.0.8, uclibc-0.9.27
> Kernel configuration file is enclosed along with this mail. 
> 
> TIA,
> --kishore



From unfarco@tiscali.it Fri Aug 26 09:38:11 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 26 Aug 2005 09:38:32 +0100 (BST)
Received: from [IPv6:::ffff:62.13.170.159] ([IPv6:::ffff:62.13.170.159]:47114
	"EHLO mail.h3g.it") by linux-mips.org with ESMTP
	id <S8224975AbVHZIiL>; Fri, 26 Aug 2005 09:38:11 +0100
Received: from MIEXC05.h3g.it ([10.215.31.110]) by mail.h3g.it with Microsoft SMTPSVC(6.0.3790.0);
	 Fri, 26 Aug 2005 10:44:29 +0200
Received: from [10.212.33.13] ([10.212.33.13]) by MIEXC05.h3g.it with Microsoft SMTPSVC(5.0.2195.6713);
	 Fri, 26 Aug 2005 10:43:47 +0200
Message-ID: <430ED658.6050008@tiscali.it>
Date:	Fri, 26 Aug 2005 10:44:08 +0200
From:	Piccio <unfarco@tiscali.it>
User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: problem making kernel from CVS
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 26 Aug 2005 08:43:47.0942 (UTC) FILETIME=[468CA060:01C5AA1A]
Return-Path: <unfarco@tiscali.it>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8811
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: unfarco@tiscali.it
Precedence: bulk
X-list: linux-mips
Content-Length: 936
Lines: 31

Hello all,

I'm getting the following error building the kernel from latest CVS (at 
the end, I think), on a R5000 O2.
I can send the kernel config, if needed.

Some ideas?
Thanks

Massimo



  CHK     include/linux/compile.h
  UPD     include/linux/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1
arch/mips/kernel/built-in.o(.text+0x2a10): In function `$L3':
: undefined reference to `atomic_lock'
arch/mips/kernel/built-in.o(.text+0x2a18): In function `$L3':
: undefined reference to `atomic_lock'
arch/mips/kernel/built-in.o(.text+0x2b40): In function `$L21':
: undefined reference to `atomic_lock'
arch/mips/kernel/built-in.o(.text+0x2a1c): In function `$L3':
: undefined reference to `atomic_lock'
arch/mips/kernel/built-in.o(.text+0x2a3c): In function `$L3':
: undefined reference to `atomic_lock'
arch/mips/kernel/built-in.o(.text+0x2a44): more undefined references to 
`atomic_lock' follow


From bskris@gmail.com Fri Aug 26 12:56:25 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 26 Aug 2005 12:56:42 +0100 (BST)
Received: from zproxy.gmail.com ([IPv6:::ffff:64.233.162.203]:32077 "EHLO
	zproxy.gmail.com") by linux-mips.org with ESMTP id <S8224979AbVHZL4Z> convert rfc822-to-8bit;
	Fri, 26 Aug 2005 12:56:25 +0100
Received: by zproxy.gmail.com with SMTP id 13so335454nzn
        for <linux-mips@linux-mips.org>; Fri, 26 Aug 2005 05:01:59 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition;
        b=Rluk/g3PjW7MOBaFY9JRLl8URD8E2HB9u+6GVJPnBQB5XIlXhmM4cv52wLjuPPYVpg5EHmfudXJL9TPmdhE+I2Aq+ID6Gpnt3er6paBL/Lei6jL/j0oN0jlcgsXDFopoVPlCDuXJM2YpBXDTeUr1Ru5J46p879dFkfsXSuR9Gi8=
Received: by 10.36.220.37 with SMTP id s37mr234720nzg;
        Fri, 26 Aug 2005 05:01:59 -0700 (PDT)
Received: by 10.36.220.72 with HTTP; Fri, 26 Aug 2005 05:01:59 -0700 (PDT)
Message-ID: <1943a41305082605013432e6f8@mail.gmail.com>
Date:	Fri, 26 Aug 2005 17:31:59 +0530
From:	Krishna B S <bskris@gmail.com>
To:	linux-mips@linux-mips.org
Subject: Selection of 2.4.31 from CVS?
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8BIT
Content-Disposition: inline
Return-Path: <bskris@gmail.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8812
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: bskris@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 431
Lines: 15

Hi All,

I am looking for building a toolchain based on Linux-MIPS kernel for a
MIPS 4Kc board. When I look at CVS Weekly Snapshots
(http://www.longlandclan.hopto.org/~stuartl/mips-linux/sources/), I
find many versions of 2.4.31 for use.

Which one should I consider for my usage? Is there any thumb rule for
selecting a stable version of 2.4.31 from the CVS? Which CVS tag
should I use for 2.4.31?

Please help.

Regards,
Krishna

From macro@linux-mips.org Fri Aug 26 14:09:51 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 26 Aug 2005 14:10:08 +0100 (BST)
Received: from pollux.ds.pg.gda.pl ([IPv6:::ffff:153.19.208.7]:48402 "EHLO
	pollux.ds.pg.gda.pl") by linux-mips.org with ESMTP
	id <S8224979AbVHZNJv>; Fri, 26 Aug 2005 14:09:51 +0100
Received: from localhost (localhost [127.0.0.1])
	by pollux.ds.pg.gda.pl (Postfix) with ESMTP
	id E7B84F59A9; Fri, 26 Aug 2005 15:09:54 +0200 (CEST)
Received: from pollux.ds.pg.gda.pl ([127.0.0.1])
 by localhost (pollux [127.0.0.1]) (amavisd-new, port 10024) with ESMTP
 id 11235-04; Fri, 26 Aug 2005 15:09:54 +0200 (CEST)
Received: from piorun.ds.pg.gda.pl (piorun.ds.pg.gda.pl [153.19.208.8])
	by pollux.ds.pg.gda.pl (Postfix) with ESMTP
	id A1145F59A1; Fri, 26 Aug 2005 15:09:54 +0200 (CEST)
Received: from blysk.ds.pg.gda.pl (macro@blysk.ds.pg.gda.pl [153.19.208.6])
	by piorun.ds.pg.gda.pl (8.13.3/8.13.1) with ESMTP id j7QD9v7o027366;
	Fri, 26 Aug 2005 15:09:58 +0200
Date:	Fri, 26 Aug 2005 14:10:05 +0100 (BST)
From:	"Maciej W. Rozycki" <macro@linux-mips.org>
To:	Pete Popov <ppopov@embeddedalley.com>
Cc:	"'linux-mips@linux-mips.org'" <linux-mips@linux-mips.org>
Subject: Re: patch / rfc
In-Reply-To: <1125006681.14435.1065.camel@localhost.localdomain>
Message-ID: <Pine.LNX.4.61L.0508261340460.9561@blysk.ds.pg.gda.pl>
References: <1125006681.14435.1065.camel@localhost.localdomain>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Virus-Scanned: ClamAV 0.85.1/1042/Fri Aug 26 10:00:27 2005 on piorun.ds.pg.gda.pl
X-Virus-Status:	Clean
X-Virus-Scanned: by amavisd-new at pollux.ds.pg.gda.pl
Return-Path: <macro@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8813
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: macro@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 2194
Lines: 55

On Thu, 25 Aug 2005, Pete Popov wrote:

> This is an experimental (though tested) patch for early ioremap support
> on mips, before mem_init runs. Something like this is only needed on
> certain SoCs that have all of their I/O on high addresses such that they
> can't me ioremapped through kseg1.

 Hmm, wouldn't a temporary large page and a wired TLB entry be an easier 
solution?  Somebody designing these SoCs must have taken such an approach 
into account when deciding to put I/O devices outside the space that's 
directly accessible through unmapped spaces, so I'd expect them all to be 
reachable in a single page of the largest size supported by a given 
implementation.  Especially as not all software is expected to implement 
fully-featured page management.  This entry would of course be no longer 
available after the final paging setup (TLBs tend to be too small for 
entries to be wasted).

> I think the CONFIG_64 stuff needs to removed since we don't need it. The
> patch was tested on a MIPS32 CPU only. Some of the significant changes:

 Well, MIPS64 has XPHYS, so there is no need for going through paging for 
ioremap() at all.

> - trap_init() became early_trap_init() since too much stuff happens
> there that is needed to support early ioremap. The old trap_init() is
> now empty.

 That just provides a strong suggestion considering an alternative 
approach, such as one proposed above is not a bad idea -- this changes the 
order subsystems are initialized for the MIPS platform, which makes it 
different from all the others and therefore problematic.

> - added plat_setup_late() call. All ports would need to add that call,
> or at least a placeholder. Early ioremap is possible only at that point.
> However, most of the code in each plat_setup() can be moved to
> plat_setup_late()

 Which means it should rather be a function pointer initialized somewhere 
earlier, possibly in plat_setup() and then:

static void __init null_plat_setup_late(void) { }
void (*plat_setup_late)(void) __initdata = null_plat_setup_late;
[...]
	plat_setup_late()

or:

void (*plat_setup_late)(void);
[...]
	if (plat_setup_late)
		plat_setup_late()

or something like that.

  Maciej

From ralf@linux-mips.org Fri Aug 26 15:05:16 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 26 Aug 2005 15:05:32 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:25607 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8224979AbVHZOFQ>; Fri, 26 Aug 2005 15:05:16 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7QEAm33010523;
	Fri, 26 Aug 2005 15:10:48 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7QEAl0w010522;
	Fri, 26 Aug 2005 15:10:47 +0100
Date:	Fri, 26 Aug 2005 15:10:47 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Bryan Althouse <bryan.althouse@3phoenix.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: custom ide driver causes "Badness in smp_call_function"
Message-ID: <20050826141047.GA8777@linux-mips.org>
References: <20050825154249.GC2731@linux-mips.org> <20050825211218Z8225471-3678+7505@linux-mips.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050825211218Z8225471-3678+7505@linux-mips.org>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8814
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 1846
Lines: 51

On Thu, Aug 25, 2005 at 05:17:48PM -0400, Bryan Althouse wrote:

> If I change the line "hwif->irq = 0" in my driver to "hwif->irq = 5", my SMP
> kernel no longer experiences SMP badness.  Instead, I get many lines like
> "hda: lost interrupt", and the drive is not usable.  If I compile the kernel
> without SMP, the drive works properly as before.  I tried irq = 5 because I
> noticed that /proc/interrupts indicated that ide0 was being probed at 5.
> With the SMP kernel, /proc/interrupts shows a count of 0 for ide0.  My
> non-SMP kernel shows a count that increments when the drive is being used
> (as expected).

Try this patch below and let me know.  I would also like to ask those
people who used to suffer from aliases with IDE PIO to try this patch.

  Ralf

Index: include/asm-mips/mach-generic/ide.h
===================================================================
RCS file: /home/cvs/linux/include/asm-mips/mach-generic/ide.h,v
retrieving revision 1.9
diff -u -r1.9 ide.h
--- include/asm-mips/mach-generic/ide.h	19 Apr 2005 12:26:59 -0000	1.9
+++ include/asm-mips/mach-generic/ide.h	26 Aug 2005 14:04:38 -0000
@@ -19,6 +19,7 @@
 #include <linux/pci.h>
 #include <linux/stddef.h>
 #include <asm/processor.h>
+#include <asm/cacheflush.h>
 
 #ifndef MAX_HWIFS
 # ifdef CONFIG_BLK_DEV_IDEPCI
@@ -105,12 +106,14 @@
 
 /* MIPS port and memory-mapped I/O string operations.  */
 
-static inline void __ide_flush_dcache_range(unsigned long addr, unsigned long size)
+static inline void __ide_flush_dcache_range(unsigned long addr,
+	unsigned long size)
 {
-	if (cpu_has_dc_aliases) {
-		unsigned long end = addr + size;
-		for (; addr < end; addr += PAGE_SIZE)
-			flush_dcache_page(virt_to_page(addr));
+	unsigned long end = addr + size;
+
+	while (addr < end) {
+		SetPageDcacheDirty(virt_to_page(addr));
+		addr += PAGE_SIZE;
 	}
 }
 

From hellokishore@gmail.com Fri Aug 26 15:12:05 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 26 Aug 2005 15:12:21 +0100 (BST)
Received: from zproxy.gmail.com ([IPv6:::ffff:64.233.162.200]:57021 "EHLO
	zproxy.gmail.com") by linux-mips.org with ESMTP id <S8224979AbVHZOMF> convert rfc822-to-8bit;
	Fri, 26 Aug 2005 15:12:05 +0100
Received: by zproxy.gmail.com with SMTP id 14so375944nzn
        for <linux-mips@linux-mips.org>; Fri, 26 Aug 2005 07:17:44 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references;
        b=mfv6CfpvdmpKdzOgD35L6+OyPkCYA0AAJOg3eXMj0fSHzKVykJ9+tDLOJPzC/KkuwvNJNdN3bKsFdEFotWIKXh7NpKkaJ/t9Z0Gzqahdn6X/eNkHqEs+HZpbJkMuRyNMVxmSkoMHfVsACxV5LDUR7IJ4EIpfTu4BCPFr9C5BdXE=
Received: by 10.36.42.2 with SMTP id p2mr245213nzp;
        Fri, 26 Aug 2005 07:17:44 -0700 (PDT)
Received: by 10.36.50.18 with HTTP; Fri, 26 Aug 2005 07:17:43 -0700 (PDT)
Message-ID: <f07e6e0508260717428bbdd0@mail.gmail.com>
Date:	Fri, 26 Aug 2005 20:17:43 +0600
From:	Kishore K <hellokishore@gmail.com>
To:	Ralf Baechle <ralf@linux-mips.org>
Subject: Re: Preemption patch for 2.4.26 - mips
Cc:	"linux-mips@linux-mips.org" <linux-mips@linux-mips.org>
In-Reply-To: <20050825153219.GB2731@linux-mips.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8BIT
Content-Disposition: inline
References: <f07e6e050825065756c3ac27@mail.gmail.com>
	 <20050825153219.GB2731@linux-mips.org>
Return-Path: <hellokishore@gmail.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8815
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: hellokishore@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 319
Lines: 9

On 8/25/05, Ralf Baechle <ralf@linux-mips.org> wrote:
> Straight Kernel.org kernels don't work for MIPS nor do the mentioned
> patches.
> 
I could bring up the malta board with vanilla linux kernels (2.4.25 -
2.4.31) from kernel.org. Just curious to know, what extra features we
get from linux-mips kernels?

--kishore

From ralf@linux-mips.org Fri Aug 26 15:42:22 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 26 Aug 2005 15:42:41 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:16392 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8224974AbVHZOmW>; Fri, 26 Aug 2005 15:42:22 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7QEm0oY011825;
	Fri, 26 Aug 2005 15:48:00 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7QEm0rJ011824;
	Fri, 26 Aug 2005 15:48:00 +0100
Date:	Fri, 26 Aug 2005 15:47:59 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Kishore K <hellokishore@gmail.com>
Cc:	"linux-mips@linux-mips.org" <linux-mips@linux-mips.org>
Subject: Re: Preemption patch for 2.4.26 - mips
Message-ID: <20050826144759.GA2712@linux-mips.org>
References: <f07e6e050825065756c3ac27@mail.gmail.com> <20050825153219.GB2731@linux-mips.org> <f07e6e0508260717428bbdd0@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <f07e6e0508260717428bbdd0@mail.gmail.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8816
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 641
Lines: 16

On Fri, Aug 26, 2005 at 08:17:43PM +0600, Kishore K wrote:

> On 8/25/05, Ralf Baechle <ralf@linux-mips.org> wrote:
> > Straight Kernel.org kernels don't work for MIPS nor do the mentioned
> > patches.
> > 
> I could bring up the malta board with vanilla linux kernels (2.4.25 -
> 2.4.31) from kernel.org. Just curious to know, what extra features we
> get from linux-mips kernels?

Generally the MIPS code in kernel.org is simply lagging far behind
linux-mips.org and is not tested at all on MIPS.  There are also various
bits in 2.4 that were necessary for some platforms but which for the one
or other reason won't wasn't merged.

  Ralf

From bryan.althouse@3phoenix.com Fri Aug 26 15:53:03 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 26 Aug 2005 15:53:18 +0100 (BST)
Received: from rwcrmhc14.comcast.net ([IPv6:::ffff:204.127.198.54]:33190 "EHLO
	rwcrmhc12.comcast.net") by linux-mips.org with ESMTP
	id <S8224974AbVHZOxD>; Fri, 26 Aug 2005 15:53:03 +0100
Received: from ba3pi (pcp0010731669pcs.howard01.md.comcast.net[69.243.71.130])
          by comcast.net (rwcrmhc14) with SMTP
          id <2005082614584001400hfrvde>; Fri, 26 Aug 2005 14:58:41 +0000
From:	"Bryan Althouse" <bryan.althouse@3phoenix.com>
To:	"'Ralf Baechle'" <ralf@linux-mips.org>
Cc:	<linux-mips@linux-mips.org>
Subject: RE: custom ide driver causes "Badness in smp_call_function"
Date:	Fri, 26 Aug 2005 10:58:40 -0400
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook, Build 11.0.6353
Thread-Index: AcWqR/nIHNFE/tghSraa2RLTN9Py/gABmxaA
In-Reply-To: <20050826141047.GA8777@linux-mips.org>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-Id: <20050826145303Z8224974-3678+7581@linux-mips.org>
Return-Path: <bryan.althouse@3phoenix.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8817
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: bryan.althouse@3phoenix.com
Precedence: bulk
X-list: linux-mips
Content-Length: 66
Lines: 6

Ralf,

The patch doesn't seem to make any difference. :(

Bryan 


From alan@lxorguk.ukuu.org.uk Fri Aug 26 16:13:06 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 26 Aug 2005 16:13:24 +0100 (BST)
Received: from clock-tower.bc.nu ([IPv6:::ffff:81.2.110.250]:48055 "EHLO
	lxorguk.ukuu.org.uk") by linux-mips.org with ESMTP
	id <S8224974AbVHZPNG>; Fri, 26 Aug 2005 16:13:06 +0100
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by lxorguk.ukuu.org.uk (8.13.4/8.13.4) with ESMTP id j7QFlX6Q007340;
	Fri, 26 Aug 2005 16:47:34 +0100
Received: (from alan@localhost)
	by localhost.localdomain (8.13.4/8.13.4/Submit) id j7QFlXad007339;
	Fri, 26 Aug 2005 16:47:33 +0100
X-Authentication-Warning: localhost.localdomain: alan set sender to alan@lxorguk.ukuu.org.uk using -f
Subject: RE: custom ide driver causes "Badness in smp_call_function"
From:	Alan Cox <alan@lxorguk.ukuu.org.uk>
To:	Bryan Althouse <bryan.althouse@3phoenix.com>
Cc:	linux-mips@linux-mips.org, "'Ralf Baechle'" <ralf@linux-mips.org>
In-Reply-To: <20050826145303Z8224974-3678+7581@linux-mips.org>
References: <20050826145303Z8224974-3678+7581@linux-mips.org>
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Date:	Fri, 26 Aug 2005 16:47:24 +0100
Message-Id: <1125071244.7298.2.camel@localhost.localdomain>
Mime-Version: 1.0
X-Mailer: Evolution 2.2.2 (2.2.2-5) 
Return-Path: <alan@lxorguk.ukuu.org.uk>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8818
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: alan@lxorguk.ukuu.org.uk
Precedence: bulk
X-list: linux-mips
Content-Length: 707
Lines: 24

On Gwe, 2005-08-26 at 10:58 -0400, Bryan Althouse wrote: 
> Ralf,
> 
> The patch doesn't seem to make any difference. :(

Assuming your hardware is sane another approach might be to force
drive->unmask = 1. That will mean that PIO mode is running with
interrupts enabled which should avoid the problem.

Add a .fixup handler to your driver (assuming you are using a recent
2.6.x) and in the handler do something like this:

+void ide_unmask_interrupts(ide_hwif_t *hwif)
+{
+       int i;
+       for (i = 0; i < 2; i++) {
+               ide_drive_t *drive = &hwif->drives[i];
+               if(drive->present)
+                       drive->unmask = 1;
+       }
+}

hopefully that will be early enough.


From ppopov@embeddedalley.com Fri Aug 26 16:19:32 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 26 Aug 2005 16:19:55 +0100 (BST)
Received: from smtp101.biz.mail.mud.yahoo.com ([IPv6:::ffff:68.142.200.236]:41348
	"HELO smtp101.biz.mail.mud.yahoo.com") by linux-mips.org with SMTP
	id <S8224980AbVHZPTb>; Fri, 26 Aug 2005 16:19:31 +0100
Received: (qmail 78643 invoked from network); 26 Aug 2005 15:25:03 -0000
Received: from unknown (HELO ?192.168.1.101?) (ppopov@embeddedalley.com@63.194.214.47 with plain)
  by smtp101.biz.mail.mud.yahoo.com with SMTP; 26 Aug 2005 15:25:03 -0000
Subject: Re: patch / rfc
From:	Pete Popov <ppopov@embeddedalley.com>
Reply-To: ppopov@embeddedalley.com
To:	"Maciej W. Rozycki" <macro@linux-mips.org>
Cc:	"'linux-mips@linux-mips.org'" <linux-mips@linux-mips.org>
In-Reply-To: <Pine.LNX.4.61L.0508261340460.9561@blysk.ds.pg.gda.pl>
References: <1125006681.14435.1065.camel@localhost.localdomain>
	 <Pine.LNX.4.61L.0508261340460.9561@blysk.ds.pg.gda.pl>
Content-Type: text/plain
Organization: Embedded Alley Solutions, Inc
Date:	Fri, 26 Aug 2005 08:24:57 -0700
Message-Id: <1125069898.14435.1215.camel@localhost.localdomain>
Mime-Version: 1.0
X-Mailer: Evolution 2.0.4 (2.0.4-4) 
Content-Transfer-Encoding: 7bit
Return-Path: <ppopov@embeddedalley.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8819
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ppopov@embeddedalley.com
Precedence: bulk
X-list: linux-mips
Content-Length: 3038
Lines: 82

On Fri, 2005-08-26 at 14:10 +0100, Maciej W. Rozycki wrote:
> On Thu, 25 Aug 2005, Pete Popov wrote:
> 
> > This is an experimental (though tested) patch for early ioremap support
> > on mips, before mem_init runs. Something like this is only needed on
> > certain SoCs that have all of their I/O on high addresses such that they
> > can't me ioremapped through kseg1.
> 
>  Hmm, wouldn't a temporary large page and a wired TLB entry be an easier 
> solution?  

Yes, you can do that. It's just not as nice and the problem is that you
either have to remember these wired mappings, flush them later, and
properly ioremap them, or forever use up a few tlbs.

> Somebody designing these SoCs must have taken such an approach 
> into account when deciding to put I/O devices outside the space that's 
> directly accessible through unmapped spaces, so I'd expect them all to be 
> reachable in a single page of the largest size supported by a given 
> implementation.  

They may or may not be reachable with a single tlb. I've twice now seen
new SoCs with a huge I/O address range. There may or may not be a good
reason for this but we are not always hired early enough to change the
design.

> Especially as not all software is expected to implement 
> fully-featured page management.  This entry would of course be no longer 
> available after the final paging setup (TLBs tend to be too small for 
> entries to be wasted).

Right.

> > I think the CONFIG_64 stuff needs to removed since we don't need it. The
> > patch was tested on a MIPS32 CPU only. Some of the significant changes:
> 
>  Well, MIPS64 has XPHYS, so there is no need for going through paging for 
> ioremap() at all.

Right. I can easily change that.

> > - trap_init() became early_trap_init() since too much stuff happens
> > there that is needed to support early ioremap. The old trap_init() is
> > now empty.
> 
>  That just provides a strong suggestion considering an alternative 
> approach, such as one proposed above is not a bad idea -- this changes the 
> order subsystems are initialized for the MIPS platform, which makes it 
> different from all the others and therefore problematic.

Well, yes and no. On PowerPC, they do all this ahead of trap_init so
their trap_init is empty as well. Looking at the code, I just don't see
any reason why we can't do that init earlier.

> > - added plat_setup_late() call. All ports would need to add that call,
> > or at least a placeholder. Early ioremap is possible only at that point.
> > However, most of the code in each plat_setup() can be moved to
> > plat_setup_late()
> 
>  Which means it should rather be a function pointer initialized somewhere 
> earlier, possibly in plat_setup() and then:
> 
> static void __init null_plat_setup_late(void) { }
> void (*plat_setup_late)(void) __initdata = null_plat_setup_late;
> [...]
> 	plat_setup_late()
> 
> or:
> 
> void (*plat_setup_late)(void);
> [...]
> 	if (plat_setup_late)
> 		plat_setup_late()
> 
> or something like that.

Sure, we can do that.

Thanks,

Pete


From ddaney@avtrex.com Fri Aug 26 16:37:20 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 26 Aug 2005 16:37:44 +0100 (BST)
Received: from adsl-67-116-42-147.dsl.sntc01.pacbell.net ([IPv6:::ffff:67.116.42.147]:23066
	"EHLO avtrex.com") by linux-mips.org with ESMTP id <S8224974AbVHZPhU>;
	Fri, 26 Aug 2005 16:37:20 +0100
Received: from [192.168.7.26] ([192.168.7.3]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Fri, 26 Aug 2005 08:43:01 -0700
Message-ID: <430F3885.4010901@avtrex.com>
Date:	Fri, 26 Aug 2005 08:43:01 -0700
From:	David Daney <ddaney@avtrex.com>
User-Agent: Mozilla Thunderbird 1.0.6-1.1.fc3 (X11/20050720)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	Krishna B S <bskris@gmail.com>
CC:	linux-mips@linux-mips.org
Subject: Re: Selection of 2.4.31 from CVS?
References: <1943a41305082605013432e6f8@mail.gmail.com>
In-Reply-To: <1943a41305082605013432e6f8@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 26 Aug 2005 15:43:01.0520 (UTC) FILETIME=[D7400900:01C5AA54]
Return-Path: <ddaney@avtrex.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8820
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ddaney@avtrex.com
Precedence: bulk
X-list: linux-mips
Content-Length: 711
Lines: 25

I always use the 'linux_2_4' tag.  It is the HEAD of the 2.4.x kernels. 
  Since 2.4.x has been in deep maintenance mode for quite some time now, 
it is likely that the head of the branch is the best available.

David Daney.


Krishna B S wrote:
> Hi All,
> 
> I am looking for building a toolchain based on Linux-MIPS kernel for a
> MIPS 4Kc board. When I look at CVS Weekly Snapshots
> (http://www.longlandclan.hopto.org/~stuartl/mips-linux/sources/), I
> find many versions of 2.4.31 for use.
> 
> Which one should I consider for my usage? Is there any thumb rule for
> selecting a stable version of 2.4.31 from the CVS? Which CVS tag
> should I use for 2.4.31?
> 
> Please help.
> 
> Regards,
> Krishna
> 


From dan@embeddededge.com Fri Aug 26 16:41:57 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 26 Aug 2005 16:42:16 +0100 (BST)
Received: from embeddededge.com ([IPv6:::ffff:209.113.146.155]:41744 "EHLO
	penguin.netx4.com") by linux-mips.org with ESMTP
	id <S8224974AbVHZPl5>; Fri, 26 Aug 2005 16:41:57 +0100
Received: from [192.168.253.28] (tibook.embeddededge.com [192.168.253.28])
	by penguin.netx4.com (8.12.8/8.12.9) with ESMTP id j7QFT7KW020449;
	Fri, 26 Aug 2005 11:29:07 -0400
In-Reply-To: <1125069898.14435.1215.camel@localhost.localdomain>
References: <1125006681.14435.1065.camel@localhost.localdomain> <Pine.LNX.4.61L.0508261340460.9561@blysk.ds.pg.gda.pl> <1125069898.14435.1215.camel@localhost.localdomain>
Mime-Version: 1.0 (Apple Message framework v622)
Content-Type: text/plain; charset=US-ASCII; format=flowed
Message-Id: <0cc66f0b0b5afa994744547699f687bf@embeddededge.com>
Content-Transfer-Encoding: 7bit
Cc:	"Maciej W. Rozycki" <macro@linux-mips.org>,
	"'linux-mips@linux-mips.org'" <linux-mips@linux-mips.org>
From:	Dan Malek <dan@embeddededge.com>
Subject: Re: patch / rfc
Date:	Fri, 26 Aug 2005 11:47:36 -0400
To:	ppopov@embeddedalley.com
X-Mailer: Apple Mail (2.622)
Return-Path: <dan@embeddededge.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8821
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dan@embeddededge.com
Precedence: bulk
X-list: linux-mips
Content-Length: 996
Lines: 33


On Aug 26, 2005, at 11:24 AM, Pete Popov wrote:

>> void (*plat_setup_late)(void);
>> [...]
>> 	if (plat_setup_late)
>> 		plat_setup_late()
>>
>> or something like that.
>
> Sure, we can do that.

If you do this, I suggest using another PowerPC-ism.  They
have a ppc_md data structure that is filled with indirect function
pointers to machine dependent functions.  We could create
a mips_md that does this same thing.  The reason I like this
is it collects all machine dependent information in a single
place, so it's easy to see what functions/data are available
and what you may need to do.  It's also clear when used
that anything in this structure is a machine/board dependent
function.  In the proper places, you then do what is shown above:

	if (mips_md.plat_setup_late)
		mips_md.plat_setup_late();

Your earliest machine dependent set up can then fill this in
based upon board options, or you can statically set it up if
you need it even earlier and change it later.

Thanks.

	-- Dan


From macro@linux-mips.org Fri Aug 26 16:56:07 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 26 Aug 2005 16:56:24 +0100 (BST)
Received: from pollux.ds.pg.gda.pl ([IPv6:::ffff:153.19.208.7]:29456 "EHLO
	pollux.ds.pg.gda.pl") by linux-mips.org with ESMTP
	id <S8224974AbVHZP4H>; Fri, 26 Aug 2005 16:56:07 +0100
Received: from localhost (localhost [127.0.0.1])
	by pollux.ds.pg.gda.pl (Postfix) with ESMTP
	id A86DAF59CE; Fri, 26 Aug 2005 17:52:51 +0200 (CEST)
Received: from pollux.ds.pg.gda.pl ([127.0.0.1])
 by localhost (pollux [127.0.0.1]) (amavisd-new, port 10024) with ESMTP
 id 06006-03; Fri, 26 Aug 2005 17:52:51 +0200 (CEST)
Received: from piorun.ds.pg.gda.pl (piorun.ds.pg.gda.pl [153.19.208.8])
	by pollux.ds.pg.gda.pl (Postfix) with ESMTP
	id 7B69AF59CD; Fri, 26 Aug 2005 17:52:51 +0200 (CEST)
Received: from blysk.ds.pg.gda.pl (macro@blysk.ds.pg.gda.pl [153.19.208.6])
	by piorun.ds.pg.gda.pl (8.13.3/8.13.1) with ESMTP id j7QFqtP4001270;
	Fri, 26 Aug 2005 17:52:55 +0200
Date:	Fri, 26 Aug 2005 16:53:04 +0100 (BST)
From:	"Maciej W. Rozycki" <macro@linux-mips.org>
To:	Dan Malek <dan@embeddededge.com>
Cc:	ppopov@embeddedalley.com,
	"'linux-mips@linux-mips.org'" <linux-mips@linux-mips.org>
Subject: Re: patch / rfc
In-Reply-To: <0cc66f0b0b5afa994744547699f687bf@embeddededge.com>
Message-ID: <Pine.LNX.4.61L.0508261650360.9561@blysk.ds.pg.gda.pl>
References: <1125006681.14435.1065.camel@localhost.localdomain>
 <Pine.LNX.4.61L.0508261340460.9561@blysk.ds.pg.gda.pl>
 <1125069898.14435.1215.camel@localhost.localdomain>
 <0cc66f0b0b5afa994744547699f687bf@embeddededge.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Virus-Scanned: ClamAV 0.85.1/1042/Fri Aug 26 10:00:27 2005 on piorun.ds.pg.gda.pl
X-Virus-Status:	Clean
X-Virus-Scanned: by amavisd-new at pollux.ds.pg.gda.pl
Return-Path: <macro@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8822
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: macro@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 817
Lines: 17

On Fri, 26 Aug 2005, Dan Malek wrote:

> If you do this, I suggest using another PowerPC-ism.  They
> have a ppc_md data structure that is filled with indirect function
> pointers to machine dependent functions.  We could create
> a mips_md that does this same thing.  The reason I like this
> is it collects all machine dependent information in a single
> place, so it's easy to see what functions/data are available
> and what you may need to do.  It's also clear when used
> that anything in this structure is a machine/board dependent
> function.  In the proper places, you then do what is shown above:

 Well, that's actually Alpha-ism, which has been that port since 1998 or 
so and is a long-term plan for our multi-platform support too. :-)  If you 
want to implement it right now, please go ahead!

  Maciej

From ralf@linux-mips.org Fri Aug 26 17:23:00 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 26 Aug 2005 17:23:18 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:41483 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8224979AbVHZQXA>; Fri, 26 Aug 2005 17:23:00 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7QGSX9m015302;
	Fri, 26 Aug 2005 17:28:33 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7QGSWrR015301;
	Fri, 26 Aug 2005 17:28:32 +0100
Date:	Fri, 26 Aug 2005 17:28:32 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Bryan Althouse <bryan.althouse@3phoenix.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: custom ide driver causes "Badness in smp_call_function"
Message-ID: <20050826162832.GB2712@linux-mips.org>
References: <20050826141047.GA8777@linux-mips.org> <20050826145303Z8224974-3678+7581@linux-mips.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050826145303Z8224974-3678+7581@linux-mips.org>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8823
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 232
Lines: 8

On Fri, Aug 26, 2005 at 10:58:40AM -0400, Bryan Althouse wrote:

> The patch doesn't seem to make any difference. :(

To clarify, the patch wasn't meant to resolve your interrupt problems but
the SMP cacheflush issues only.

  Ralf

From bryan.althouse@3phoenix.com Fri Aug 26 17:30:50 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 26 Aug 2005 17:31:08 +0100 (BST)
Received: from rwcrmhc14.comcast.net ([IPv6:::ffff:204.127.198.54]:47248 "EHLO
	rwcrmhc12.comcast.net") by linux-mips.org with ESMTP
	id <S8224979AbVHZQau>; Fri, 26 Aug 2005 17:30:50 +0100
Received: from ba3pi (pcp0010731669pcs.howard01.md.comcast.net[69.243.71.130])
          by comcast.net (rwcrmhc14) with SMTP
          id <2005082616362701400hfmq0e>; Fri, 26 Aug 2005 16:36:27 +0000
From:	"Bryan Althouse" <bryan.althouse@3phoenix.com>
To:	"'Ralf Baechle'" <ralf@linux-mips.org>
Cc:	<linux-mips@linux-mips.org>
Subject: RE: custom ide driver causes "Badness in smp_call_function"
Date:	Fri, 26 Aug 2005 12:36:26 -0400
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook, Build 11.0.6353
Thread-Index: AcWqWzeC/+HCp/FoTVCO9YZvOG8WzwAAFvxA
In-Reply-To: <20050826162832.GB2712@linux-mips.org>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-Id: <20050826163050Z8224979-3678+7593@linux-mips.org>
Return-Path: <bryan.althouse@3phoenix.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8824
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: bryan.althouse@3phoenix.com
Precedence: bulk
X-list: linux-mips
Content-Length: 544
Lines: 20

I still get the SMP badness when hwif->irq is set to 0 in my driver.

Bryan

-----Original Message-----
From: Ralf Baechle [mailto:ralf@linux-mips.org] 
Sent: Friday, August 26, 2005 12:29 PM
To: Bryan Althouse
Cc: linux-mips@linux-mips.org
Subject: Re: custom ide driver causes "Badness in smp_call_function"

On Fri, Aug 26, 2005 at 10:58:40AM -0400, Bryan Althouse wrote:

> The patch doesn't seem to make any difference. :(

To clarify, the patch wasn't meant to resolve your interrupt problems but
the SMP cacheflush issues only.

  Ralf


From dan@embeddededge.com Fri Aug 26 17:32:55 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 26 Aug 2005 17:33:13 +0100 (BST)
Received: from embeddededge.com ([IPv6:::ffff:209.113.146.155]:45328 "EHLO
	penguin.netx4.com") by linux-mips.org with ESMTP
	id <S8224979AbVHZQcz>; Fri, 26 Aug 2005 17:32:55 +0100
Received: from [192.168.253.28] (tibook.embeddededge.com [192.168.253.28])
	by penguin.netx4.com (8.12.8/8.12.9) with ESMTP id j7QGK8KW020511;
	Fri, 26 Aug 2005 12:20:08 -0400
In-Reply-To: <Pine.LNX.4.61L.0508261650360.9561@blysk.ds.pg.gda.pl>
References: <1125006681.14435.1065.camel@localhost.localdomain> <Pine.LNX.4.61L.0508261340460.9561@blysk.ds.pg.gda.pl> <1125069898.14435.1215.camel@localhost.localdomain> <0cc66f0b0b5afa994744547699f687bf@embeddededge.com> <Pine.LNX.4.61L.0508261650360.9561@blysk.ds.pg.gda.pl>
Mime-Version: 1.0 (Apple Message framework v622)
Content-Type: text/plain; charset=US-ASCII; format=flowed
Message-Id: <93aa2cdfbce4075295b5221de3e6b936@embeddededge.com>
Content-Transfer-Encoding: 7bit
Cc:	ppopov@embeddedalley.com,
	"'linux-mips@linux-mips.org'" <linux-mips@linux-mips.org>
From:	Dan Malek <dan@embeddededge.com>
Subject: Re: patch / rfc
Date:	Fri, 26 Aug 2005 12:38:38 -0400
To:	"Maciej W. Rozycki" <macro@linux-mips.org>
X-Mailer: Apple Mail (2.622)
Return-Path: <dan@embeddededge.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8825
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dan@embeddededge.com
Precedence: bulk
X-list: linux-mips
Content-Length: 376
Lines: 16


On Aug 26, 2005, at 11:53 AM, Maciej W. Rozycki wrote:

>  Well, that's actually Alpha-ism, which has been that port since 1998 
> or
> so and is a long-term plan for our multi-platform support too. :-)  If 
> you
> want to implement it right now, please go ahead!

If that's acceptable, I'll get started on it and it's something that
will grow over time.

Thanks.

	-- Dan


From ralf@linux-mips.org Fri Aug 26 17:35:43 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 26 Aug 2005 17:36:02 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:34572 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8224984AbVHZQfn>; Fri, 26 Aug 2005 17:35:43 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7QGfGRT015776;
	Fri, 26 Aug 2005 17:41:16 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7QGfFHh015775;
	Fri, 26 Aug 2005 17:41:15 +0100
Date:	Fri, 26 Aug 2005 17:41:15 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Bryan Althouse <bryan.althouse@3phoenix.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: custom ide driver causes "Badness in smp_call_function"
Message-ID: <20050826164115.GC2712@linux-mips.org>
References: <20050826162832.GB2712@linux-mips.org> <20050826163050Z8224979-3678+7593@linux-mips.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050826163050Z8224979-3678+7593@linux-mips.org>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8826
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 339
Lines: 9

On Fri, Aug 26, 2005 at 12:36:26PM -0400, Bryan Althouse wrote:

> I still get the SMP badness when hwif->irq is set to 0 in my driver.

Interesting.  That implies smp_call_function is called through a different
path on your system that on mine here.  Doesn't invalidate the patch,
just means some extra debugging work for you ;-)

  Ralf

From bryan.althouse@3phoenix.com Fri Aug 26 19:00:08 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 26 Aug 2005 19:00:26 +0100 (BST)
Received: from rwcrmhc11.comcast.net ([IPv6:::ffff:204.127.198.35]:30854 "EHLO
	rwcrmhc11.comcast.net") by linux-mips.org with ESMTP
	id <S8224984AbVHZSAI>; Fri, 26 Aug 2005 19:00:08 +0100
Received: from ba3pi (pcp0010731669pcs.howard01.md.comcast.net[69.243.71.130])
          by comcast.net (rwcrmhc11) with SMTP
          id <200508261805440130060joce>; Fri, 26 Aug 2005 18:05:44 +0000
From:	"Bryan Althouse" <bryan.althouse@3phoenix.com>
Cc:	<linux-mips@linux-mips.org>
Subject: RE: custom ide driver causes "Badness in smp_call_function"
Date:	Fri, 26 Aug 2005 14:05:43 -0400
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook, Build 11.0.6353
Thread-Index: AcWqUXV7nhNPHZleS2iU5erhy9yRrQAFfx5g
In-Reply-To: <1125071244.7298.2.camel@localhost.localdomain>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-Id: <20050826180008Z8224984-3678+7604@linux-mips.org>
To:	unlisted-recipients:; (no To-header on input)
Return-Path: <bryan.althouse@3phoenix.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8827
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: bryan.althouse@3phoenix.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1434
Lines: 48

Alan,

Thanks for your suggestion.
I'm not sure how to write a .fixup handler.  I did some Googling, but got
nowhere.  I looked through drivers/ide to see what drive->unmask was doing.
I found this in ide-io.c:
     if (drive->unmask)
          local_irq_enable();
And this in ide-taskfile.c:
     if (!drive->unmask)
          local_irq_disable();
I modified both of these files so that execution would be as if unmask = 1.
This resulted in no change of behavior.

Bryan  

-----Original Message-----
From: Alan Cox [mailto:alan@lxorguk.ukuu.org.uk] 
Sent: Friday, August 26, 2005 11:47 AM
To: Bryan Althouse
Cc: linux-mips@linux-mips.org; 'Ralf Baechle'
Subject: RE: custom ide driver causes "Badness in smp_call_function"

On Gwe, 2005-08-26 at 10:58 -0400, Bryan Althouse wrote: 
> Ralf,
> 
> The patch doesn't seem to make any difference. :(

Assuming your hardware is sane another approach might be to force
drive->unmask = 1. That will mean that PIO mode is running with
interrupts enabled which should avoid the problem.

Add a .fixup handler to your driver (assuming you are using a recent
2.6.x) and in the handler do something like this:

+void ide_unmask_interrupts(ide_hwif_t *hwif)
+{
+       int i;
+       for (i = 0; i < 2; i++) {
+               ide_drive_t *drive = &hwif->drives[i];
+               if(drive->present)
+                       drive->unmask = 1;
+       }
+}

hopefully that will be early enough.



From linux-mips-bounce@linux-mips.org Fri Aug 26 19:12:01 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 26 Aug 2005 19:12:20 +0100 (BST)
Received: from laf31-5-82-235-130-100.fbx.proxad.net ([IPv6:::ffff:82.235.130.100]:23548
	"EHLO lexbox.fr") by linux-mips.org with ESMTP id <S8224984AbVHZSMB>;
	Fri, 26 Aug 2005 19:12:01 +0100
Received: from mail pickup service by lexbox.fr with Microsoft SMTPSVC;
	 Fri, 26 Aug 2005 20:16:10 +0200
Delivered-To: lexbox.fr-david.sanchez@lexbox.fr
From:	"Bryan Althouse" <bryan.althouse@3phoenix.com>
Cc:	<linux-mips@linux-mips.org>
Subject: RE: custom ide driver causes "Badness in smp_call_function"
Message-ID: <000501c5aa6a$3beadc30$0300a8c0@intra.lexbox.org>
Date:	Fri, 26 Aug 2005 20:16:09 +0200
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook, Build 11.0.6353
thread-index: AcWqUXV7nhNPHZleS2iU5erhy9yRrQAFfx5g
In-Reply-To: <1125071244.7298.2.camel@localhost.localdomain>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.181
To:	<unlisted-recipients:>,
	<no To-header on input>,
	"IMB Recipient 1" <mspop3connector.david.sanchez@lexbox.fr>
X-archive-position: 8827
X-ecartis-version: Ecartis v1.0.0
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-original-sender: bryan.althouse@3phoenix.com
Precedence: bulk
X-list:	linux-mips
X-OriginalArrivalTime: 26 Aug 2005 18:16:10.0343 (UTC) FILETIME=[3C372770:01C5AA6A]
Return-Path: <linux-mips-bounce@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8828
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: bryan.althouse@3phoenix.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1437
Lines: 51

Alan,

Thanks for your suggestion.
I'm not sure how to write a .fixup handler.  I did some Googling, but got
nowhere.  I looked through drivers/ide to see what drive->unmask was doing.
I found this in ide-io.c:
     if (drive->unmask)
          local_irq_enable();
And this in ide-taskfile.c:
     if (!drive->unmask)
          local_irq_disable();
I modified both of these files so that execution would be as if unmask = 1.
This resulted in no change of behavior.

Bryan  

-----Original Message-----
From: Alan Cox [mailto:alan@lxorguk.ukuu.org.uk] 
Sent: Friday, August 26, 2005 11:47 AM
To: Bryan Althouse
Cc: linux-mips@linux-mips.org; 'Ralf Baechle'
Subject: RE: custom ide driver causes "Badness in smp_call_function"

On Gwe, 2005-08-26 at 10:58 -0400, Bryan Althouse wrote: 
> Ralf,
> 
> The patch doesn't seem to make any difference. :(

Assuming your hardware is sane another approach might be to force
drive->unmask = 1. That will mean that PIO mode is running with
interrupts enabled which should avoid the problem.

Add a .fixup handler to your driver (assuming you are using a recent
2.6.x) and in the handler do something like this:

+void ide_unmask_interrupts(ide_hwif_t *hwif)
+{
+       int i;
+       for (i = 0; i < 2; i++) {
+               ide_drive_t *drive = &hwif->drives[i];
+               if(drive->present)
+                       drive->unmask = 1;
+       }
+}

hopefully that will be early enough.






From redhatter@gentoo.org Sat Aug 27 14:31:40 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 27 Aug 2005 14:31:58 +0100 (BST)
Received: from 202-47-55-78.adsl.gil.com.au ([IPv6:::ffff:202.47.55.78]:45246
	"EHLO longlandclan.hopto.org") by linux-mips.org with ESMTP
	id <S8225006AbVH0Nbk>; Sat, 27 Aug 2005 14:31:40 +0100
Received: (qmail 11495 invoked by uid 210); 27 Aug 2005 23:37:19 +1000
Received: from 10.0.0.251 by www (envelope-from <redhatter@gentoo.org>, uid 201) with qmail-scanner-1.25st 
 (spamassassin: 3.0.2. perlscan: 1.25st.  
 Clear:RC:1(10.0.0.251):. 
 Processed in 0.205289 secs); 27 Aug 2005 13:37:19 -0000
Received: from beast.redhatters.home (HELO ?10.0.0.251?) (10.0.0.251)
  by 192.168.5.1 with SMTP; 27 Aug 2005 23:37:19 +1000
Message-ID: <43106C91.4070002@gentoo.org>
Date:	Sat, 27 Aug 2005 23:37:21 +1000
From:	Stuart Longland <redhatter@gentoo.org>
Organization: Gentoo Foundation
User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	Krishna B S <bskris@gmail.com>
CC:	linux-mips@linux-mips.org
Subject: Re: Selection of 2.4.31 from CVS?
References: <1943a41305082605013432e6f8@mail.gmail.com>
In-Reply-To: <1943a41305082605013432e6f8@mail.gmail.com>
X-Enigmail-Version: 0.91.0.0
OpenPGP: id=63264AB9;
	url=http://dev.gentoo.org/~redhatter/gpgkey.asc
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="------------enig83B0CE9E4A31CE94170490E4"
Return-Path: <redhatter@gentoo.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8829
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: redhatter@gentoo.org
Precedence: bulk
X-list: linux-mips
Content-Length: 2158
Lines: 54

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig83B0CE9E4A31CE94170490E4
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Krishna B S wrote:
> Hi All,
> 
> I am looking for building a toolchain based on Linux-MIPS kernel for a
> MIPS 4Kc board. When I look at CVS Weekly Snapshots
> (http://www.longlandclan.hopto.org/~stuartl/mips-linux/sources/), I
> find many versions of 2.4.31 for use.
> 
> Which one should I consider for my usage? Is there any thumb rule for
> selecting a stable version of 2.4.31 from the CVS? Which CVS tag
> should I use for 2.4.31?

These are all just created on a weekly basis via a cron job on my
server.  Unless there have been CVS commits in the meantime to the
kernel 2.4 branch, then they should be practically identical.

My script is too dumb to realise this, however, and so creates a new
tarball of 2.4.31 each week regardless.  One of these days I'll probably
start pruning out the stale versions there, but for the moment, there's
plenty of space.

I should also point out, that server is hosted on my ADSL connection, so
you won't get wonderful download speeds.  If you can, using rsync or CVS
direct to ftp.linux-mips.org is preferrable over downloading off this
server.  ;-)

-- 
 ____                   _             Stuart Longland (a.k.a Redhatter)
/  _ \   ___    ___  __| |__  __   __ Gentoo Linux/MIPS Cobalt and Docs
- (_) \ /   \  ;   \(__   __)/  \ /  \                        Developer
 \    //  O _| / /\ \  | |  | /\ | /\ |
 /   / \   /__| /  \ \ | |  | \/ | \/ |
(___/   \____/|_;  |_| \_/   \__/ \__/ http://dev.gentoo.org/~redhatter

--------------enig83B0CE9E4A31CE94170490E4
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

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

iD8DBQFDEGyUuarJ1mMmSrkRAjHrAJ9sqKn3j6KBbKhMr6TfK5C0B7QlQgCggAvG
nJfysdqVV2DFNqHb/LE2BnY=
=kGK3
-----END PGP SIGNATURE-----

--------------enig83B0CE9E4A31CE94170490E4--

From anemo@mba.ocn.ne.jp Sat Aug 27 14:51:22 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 27 Aug 2005 14:51:37 +0100 (BST)
Received: from mba.ocn.ne.jp ([IPv6:::ffff:210.190.142.172]:42198 "HELO
	smtp.mba.ocn.ne.jp") by linux-mips.org with SMTP
	id <S8224982AbVH0NvW>; Sat, 27 Aug 2005 14:51:22 +0100
Received: from localhost (p7002-ipad11funabasi.chiba.ocn.ne.jp [219.162.42.2])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id EBE3B84F3; Sat, 27 Aug 2005 22:57:07 +0900 (JST)
Date:	Sat, 27 Aug 2005 22:57:40 +0900 (JST)
Message-Id: <20050827.225740.07645519.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: Re: 64bit unaligned access on 32bit kernel
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <20050825.003548.41199755.anemo@mba.ocn.ne.jp>
References: <20050825.003548.41199755.anemo@mba.ocn.ne.jp>
X-Fingerprint: 6ACA 1623 39BD 9A94 9B1A  B746 CA77 FE94 2874 D52F
X-Pgp-Public-Key: http://wwwkeys.pgp.net/pks/lookup?op=get&search=0x2874D52F
X-Mailer: Mew version 3.3 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8830
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 521
Lines: 13

>>>>> On Thu, 25 Aug 2005 00:35:48 +0900 (JST), Atsushi Nemoto <anemo@mba.ocn.ne.jp> said:

anemo> MIPS kernel has been using asm-generic/unaligned.h since
anemo> 2.6.12-rc2.  But the generic unaligned.h is not suitable for
anemo> 32bit kernel because it uses 'unsigned long' for 64bit values.

FYI, I found this problem while debugging why usbhid does not work
with 2.6.12 kernel (though it worked with 2.6.11) on big endian
platform.  The usbhid use put_unaligned/get_unaligned for __u64
variables.

---
Atsushi Nemoto

From anemo@mba.ocn.ne.jp Sat Aug 27 15:47:46 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 27 Aug 2005 15:48:05 +0100 (BST)
Received: from mba.ocn.ne.jp ([IPv6:::ffff:210.190.142.172]:46287 "HELO
	smtp.mba.ocn.ne.jp") by linux-mips.org with SMTP
	id <S8225006AbVH0Orq>; Sat, 27 Aug 2005 15:47:46 +0100
Received: from localhost (p7002-ipad11funabasi.chiba.ocn.ne.jp [219.162.42.2])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id D050D8549; Sat, 27 Aug 2005 23:53:34 +0900 (JST)
Date:	Sat, 27 Aug 2005 23:54:07 +0900 (JST)
Message-Id: <20050827.235407.126142848.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: Re: 64bit unaligned access on 32bit kernel
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <20050827.225740.07645519.anemo@mba.ocn.ne.jp>
References: <20050825.003548.41199755.anemo@mba.ocn.ne.jp>
	<20050827.225740.07645519.anemo@mba.ocn.ne.jp>
X-Fingerprint: 6ACA 1623 39BD 9A94 9B1A  B746 CA77 FE94 2874 D52F
X-Pgp-Public-Key: http://wwwkeys.pgp.net/pks/lookup?op=get&search=0x2874D52F
X-Mailer: Mew version 3.3 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8831
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 438
Lines: 12

>>>>> On Thu, 25 Aug 2005 00:35:48 +0900 (JST), Atsushi Nemoto <anemo@mba.ocn.ne.jp> said:

anemo> MIPS kernel has been using asm-generic/unaligned.h since
anemo> 2.6.12-rc2.  But the generic unaligned.h is not suitable for
anemo> 32bit kernel because it uses 'unsigned long' for 64bit values.

Since This is not MIPS specific, I report it to a bugzilla on kernel.org.

http://bugzilla.kernel.org/show_bug.cgi?id=5138

---
Atsushi Nemoto

From drow@nevyn.them.org Sun Aug 28 16:39:48 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 28 Aug 2005 16:40:08 +0100 (BST)
Received: from nevyn.them.org ([IPv6:::ffff:66.93.172.17]:21962 "EHLO
	nevyn.them.org") by linux-mips.org with ESMTP id <S8225197AbVH1Pjs>;
	Sun, 28 Aug 2005 16:39:48 +0100
Received: from drow by nevyn.them.org with local (Exim 4.52)
	id 1E9PLf-0006su-GT; Sun, 28 Aug 2005 11:45:31 -0400
Date:	Sun, 28 Aug 2005 11:45:31 -0400
From:	Daniel Jacobowitz <dan@debian.org>
To:	Dave Johnson <djohnson+linuxmips@sw.starentnetworks.com>
Cc:	Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
Subject: Re: gdb gets confused with o32 core files, WANT_COMPAT_REG_H needed?
Message-ID: <20050828154530.GA26423@nevyn.them.org>
References: <17162.16068.212165.340275@cortez.sw.starentnetworks.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <17162.16068.212165.340275@cortez.sw.starentnetworks.com>
User-Agent: Mutt/1.5.8i
Return-Path: <drow@nevyn.them.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8832
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dan@debian.org
Precedence: bulk
X-list: linux-mips
Content-Length: 1032
Lines: 27

On Mon, Aug 22, 2005 at 05:08:20PM -0400, Dave Johnson wrote:
> 
> I've been trying to fix core file support for 64bit kernel with o32
> userspace (working against 2.6.12 cvs tag).
> 
> After applying the patch posted on 13 Feb 2005 from Daniel Jacobowitz
> to fix binfmt_elfo32.c (any reason this didn't make it into CVS?),
> I still ran into trouble with gdb not understanding the NT_PRSTATUS
> header in the core file.
> 
> While Dan's fix makes the kernel use elf32 definitions, gdb was still
> getting confused by pr_reg contained in the core file.
> 
> Dan's definition of ELF_CORE_COPY_REGS in binfmt_elfo32.c is copying
> the registers using EF_R0 as 0 not 6 producing results into offset 0
> through 37 not 6 through 43 as gdb expects for 32bit core files.
> 
> Below patch (applied after Dan's patch) writes the registers at offset
> 6 making gdb much happier.

FYI, this has all been rearranged since - it did this correctly at the
time.  I don't know why the patch was dropped.


-- 
Daniel Jacobowitz
CodeSourcery, LLC

From sjhill@realitydiluted.com Tue Aug 30 06:05:00 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 30 Aug 2005 06:05:15 +0100 (BST)
Received: from eth13.com-link.com ([IPv6:::ffff:208.242.241.164]:14517 "EHLO
	real.realitydiluted.com") by linux-mips.org with ESMTP
	id <S8225003AbVH3FFA>; Tue, 30 Aug 2005 06:05:00 +0100
Received: from localhost ([127.0.0.1])
	by real.realitydiluted.com with esmtp (Exim 4.50 #1 (Debian))
	id 1E9xT0-0002TS-Pl; Mon, 29 Aug 2005 23:11:22 -0500
Message-ID: <4313EA65.7090306@realitydiluted.com>
Date:	Tue, 30 Aug 2005 00:11:01 -0500
From:	"Steven J. Hill" <sjhill@realitydiluted.com>
User-Agent: Debian Thunderbird 1.0.6 (X11/20050802)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	uclibc@uclibc.org, linux-mips@linux-mips.org
Subject: NPTL uClibc status update...
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sjhill@realitydiluted.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8833
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sjhill@realitydiluted.com
Precedence: bulk
X-list: linux-mips
Content-Length: 755
Lines: 16

Greetings.

Now that I have all my work up to date and checked in, I thought I would
give a brief status of NPTL. With the latest from 'uClibc-nptl' branch,
binutils-2.16.1 and gcc-4.1.0-20050604 a complete NPTL toolchain can be
built. This toolchain can also compile an entire buildroot. Granted, the
binaries will not run, but this means that the new NPTL libraries are
properly exporting all the symbols necessary for applications to build
and weak symbols interactions are doing what they should.

I am currently now building static test programs from glibc for uClibc to
get TLS binaries for MIPS working. Don't expect a lot of activity in the
upcoming days as I will be debugging all the problems with TLS on MIPS.
Thanks for your patience.

-Steve

From ralf@linux-mips.org Tue Aug 30 11:34:57 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 30 Aug 2005 11:35:18 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:34070 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225224AbVH3Ke5>; Tue, 30 Aug 2005 11:34:57 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7UAew9s004916;
	Tue, 30 Aug 2005 11:40:58 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7UAeuDp004915;
	Tue, 30 Aug 2005 11:40:56 +0100
Date:	Tue, 30 Aug 2005 11:40:56 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Andrew Morton <akpm@osdl.org>, Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	linux-mips@linux-mips.org
Subject: [PATCH] 64bit unaligned access on 32bit kernel
Message-ID: <20050830104056.GA4710@linux-mips.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8834
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 1686
Lines: 54

I've rewriten Atushi's fix for the 64-bit put_unaligned on 32-bit systems
bug to generate more efficient code.

This case has buzilla URL http://bugzilla.kernel.org/show_bug.cgi?id=5138.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

diff -u -r1.3 unaligned.h
--- suckage/include/asm-generic/unaligned.h 19 May 2005 12:08:41 -0000
+++ suckage/include/asm-generic/unaligned.h 30 Aug 2005 10:28:23 -0000
@@ -16,9 +16,9 @@
  * The main single-value unaligned transfer routines.
  */
 #define get_unaligned(ptr) \
-	((__typeof__(*(ptr)))__get_unaligned((ptr), sizeof(*(ptr))))
+	__get_unaligned((ptr), sizeof(*(ptr)))
 #define put_unaligned(x,ptr) \
-	__put_unaligned((unsigned long)(x), (ptr), sizeof(*(ptr)))
+	__put_unaligned((__u64)(x), (ptr), sizeof(*(ptr)))
 
 /*
  * This function doesn't actually exist.  The idea is that when
@@ -36,19 +36,19 @@
  * Elemental unaligned loads 
  */
 
-static inline unsigned long __uldq(const __u64 *addr)
+static inline __u64 __uldq(const __u64 *addr)
 {
 	const struct __una_u64 *ptr = (const struct __una_u64 *) addr;
 	return ptr->x;
 }
 
-static inline unsigned long __uldl(const __u32 *addr)
+static inline __u32 __uldl(const __u32 *addr)
 {
 	const struct __una_u32 *ptr = (const struct __una_u32 *) addr;
 	return ptr->x;
 }
 
-static inline unsigned long __uldw(const __u16 *addr)
+static inline __u16 __uldw(const __u16 *addr)
 {
 	const struct __una_u16 *ptr = (const struct __una_u16 *) addr;
 	return ptr->x;
@@ -78,7 +78,7 @@
 
 #define __get_unaligned(ptr, size) ({		\
 	const void *__gu_p = ptr;		\
-	unsigned long val;			\
+	__typeof__(*(ptr)) val;			\
 	switch (size) {				\
 	case 1:					\
 		val = *(const __u8 *)__gu_p;	\

From anemo@mba.ocn.ne.jp Tue Aug 30 17:35:47 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 30 Aug 2005 17:36:44 +0100 (BST)
Received: from mba.ocn.ne.jp ([IPv6:::ffff:210.190.142.172]:41180 "HELO
	smtp.mba.ocn.ne.jp") by linux-mips.org with SMTP
	id <S8225321AbVH3Qfr>; Tue, 30 Aug 2005 17:35:47 +0100
Received: from localhost (p2237-ipad27funabasi.chiba.ocn.ne.jp [220.107.193.237])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 5810584DA; Wed, 31 Aug 2005 01:41:53 +0900 (JST)
Date:	Wed, 31 Aug 2005 01:42:36 +0900 (JST)
Message-Id: <20050831.014236.122253682.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: pcibios_bus_to_resource prototype.
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
X-Fingerprint: 6ACA 1623 39BD 9A94 9B1A  B746 CA77 FE94 2874 D52F
X-Pgp-Public-Key: http://wwwkeys.pgp.net/pks/lookup?op=get&search=0x2874D52F
X-Mailer: Mew version 3.3 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8835
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 743
Lines: 19

MIPS lacks pcibios_bus_to_resource prototype which is new on 2.6.13.

Index: include/asm-mips/pci.h
===================================================================
RCS file: /home/cvs/linux/include/asm-mips/pci.h,v
retrieving revision 1.63
diff -u -r1.63 pci.h
--- include/asm-mips/pci.h	15 Aug 2005 15:16:56 -0000	1.63
+++ include/asm-mips/pci.h	30 Aug 2005 16:31:55 -0000
@@ -143,6 +143,9 @@
 extern void pcibios_resource_to_bus(struct pci_dev *dev,
 	struct pci_bus_region *region, struct resource *res);
 
+extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
+				    struct pci_bus_region *region);
+
 #ifdef CONFIG_PCI_DOMAINS
 
 #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index

From ralf@linux-mips.org Tue Aug 30 17:46:09 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 30 Aug 2005 17:46:26 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:50706 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225329AbVH3QqI>; Tue, 30 Aug 2005 17:46:08 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7UGqDAG017218;
	Tue, 30 Aug 2005 17:52:13 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7UGqDHL017217;
	Tue, 30 Aug 2005 17:52:13 +0100
Date:	Tue, 30 Aug 2005 17:52:13 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	linux-mips@linux-mips.org
Subject: Re: pcibios_bus_to_resource prototype.
Message-ID: <20050830165213.GF2605@linux-mips.org>
References: <20050831.014236.122253682.anemo@mba.ocn.ne.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050831.014236.122253682.anemo@mba.ocn.ne.jp>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8836
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 163
Lines: 7

On Wed, Aug 31, 2005 at 01:42:36AM +0900, Atsushi Nemoto wrote:

> MIPS lacks pcibios_bus_to_resource prototype which is new on 2.6.13.

Applied.  Thanks,

  Ralf

From turja@mbnet.fi Wed Aug 31 14:20:06 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 31 Aug 2005 14:20:28 +0100 (BST)
Received: from fep16.inet.fi ([IPv6:::ffff:194.251.242.241]:10459 "EHLO
	fep16.inet.fi") by linux-mips.org with ESMTP id <S8225326AbVHaNUG>;
	Wed, 31 Aug 2005 14:20:06 +0100
Received: from [127.0.0.1] ([80.223.109.59]) by fep16.inet.fi with ESMTP
          id <20050831132618.OBUA26717.fep16.inet.fi@[127.0.0.1]>
          for <linux-mips@linux-mips.org>; Wed, 31 Aug 2005 16:26:18 +0300
Message-ID: <4315B006.8090508@mbnet.fi>
Date:	Wed, 31 Aug 2005 16:26:30 +0300
From:	Mikael Nousiainen <turja@mbnet.fi>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: SGI Indy VINO video driver version 0.0.5
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <turja@mbnet.fi>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8837
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: turja@mbnet.fi
Precedence: bulk
X-list: linux-mips
Content-Length: 294
Lines: 12

A new version of the VINO drivers has been released (again... :)
This is probably the final version of the driver as almost everything 
that's needed is now implemented.

I've also made a nice test application for viewing captured video.

http://www.mbnet.fi/~turja/vino/


Mikael Nousiainen



From djd20@kent.ac.uk Wed Aug 31 14:51:29 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 31 Aug 2005 14:51:56 +0100 (BST)
Received: from mx5.kent.ac.uk ([IPv6:::ffff:129.12.21.36]:2488 "EHLO
	mx5.kent.ac.uk") by linux-mips.org with ESMTP id <S8225373AbVHaNv3>;
	Wed, 31 Aug 2005 14:51:29 +0100
Received: from apophis.ukc.ac.uk ([129.12.4.11])
	by mx5.kent.ac.uk with esmtps (TLSv1:AES256-SHA:256)
	(Exim 4.44)
	id 1EAT5s-0006b2-6B
	for linux-mips@linux-mips.org; Wed, 31 Aug 2005 14:57:36 +0100
Received: from myrtle.ukc.ac.uk ([129.12.3.176] ident=exim)
	by apophis.ukc.ac.uk with esmtps (TLSv1:AES256-SHA:256)
	(Exim 4.50)
	id 1EAT5s-0006lc-2Q
	for linux-mips@linux-mips.org; Wed, 31 Aug 2005 14:57:36 +0100
Received: from fingerpoken.ukc.ac.uk ([129.12.16.14])
	by myrtle.ukc.ac.uk with esmtp (Exim 4.50)
	id 1EAT5r-0000Fp-Tu
	for linux-mips@linux-mips.org; Wed, 31 Aug 2005 14:57:35 +0100
From:	Damian Dimmich <djd20@kent.ac.uk>
To:	linux-mips@linux-mips.org
Subject: compiling kernel 2.6.13
Date:	Wed, 31 Aug 2005 14:59:46 +0100
User-Agent: KMail/1.7.2
MIME-Version: 1.0
Content-Type: Multipart/Mixed;
  boundary="Boundary-00=_TfbFDyhkIifKgj5"
Message-Id: <200508311459.47273.djd20@kent.ac.uk>
X-UKC-Mail-System: No virus detected
X-UKC-SpamCheck: 
X-UKC-MailScanner-From:	djd20@kent.ac.uk
Return-Path: <djd20@kent.ac.uk>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8838
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: djd20@kent.ac.uk
Precedence: bulk
X-list: linux-mips
Content-Length: 3802
Lines: 117

--Boundary-00=_TfbFDyhkIifKgj5
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hello,

I had some trouble compiling 2.6.13 for the mips architecture.  I encountered 
two errors:

1)

In the file include/asm-mips/thread_info.h TIF_32BIT was undefined.

I added the following two lines which showed up in parisc and ppc64 's 
thread-info's.  Don't know if these values are correct or if this actually 
works.  It just gets it to compile...
#define TIF_32BIT               5       /* 32 bit binary */
#define _TIF_32BIT              (1<<TIF_32BIT)

The error was in drivers/input/evdev.c which includes 
include/asm-mips/thread_info.h

The error was:
 CC [M]  drivers/input/evdev.o
drivers/input/evdev.c: In function `evdev_write':
drivers/input/evdev.c:193: error: `TIF_32BIT' undeclared (first use in this 
function)
drivers/input/evdev.c:193: error: (Each undeclared identifier is reported only 
once
drivers/input/evdev.c:193: error: for each function it appears in.)
drivers/input/evdev.c: In function `evdev_read':
drivers/input/evdev.c:254: error: `TIF_32BIT' undeclared (first use in this 
function)


2)

When linking .tmp_vmlinux1, KSEG1ADDR and KSEG1 where reported as undefined 
and linking failed. 
 LD      .tmp_vmlinux1
arch/mips/sgi-ip22/built-in.o(.text+0x2854): In function `ip22_eisa_intr':
: undefined reference to `KSEG1ADDR'
arch/mips/sgi-ip22/built-in.o(.text+0x2864): In function `ip22_eisa_intr':
: undefined reference to `KSEG1ADDR'
arch/mips/sgi-ip22/built-in.o(.text+0x2870): In function `ip22_eisa_intr':
: undefined reference to `KSEG1ADDR'
arch/mips/sgi-ip22/built-in.o(.text+0x28ac): In function `ip22_eisa_intr':
: undefined reference to `KSEG1ADDR'
arch/mips/sgi-ip22/built-in.o(.text+0x28c0): In function `ip22_eisa_intr':
: undefined reference to `KSEG1ADDR'
arch/mips/sgi-ip22/built-in.o(.text+0x293c): more undefined references to 
`KSEG1ADDR' follow
make: *** [.tmp_vmlinux1] Error 1


I fixed this by adding the lines:
#define KSEG1ADDR(a)  (CPHYSADDR(a) | KSEG1)
#define KSEG1     0xa0000000
at the top of the file arch/mips/sgi-ip22/ip22-eisa.c
These are copied from include/asm/addrspace.h

I found it quite strange that it only failed when linking the kernel and not 
earlier.  The file asm/addrspace.h is included in ip22-eisa.c

eisa support is enabled and i'm compiling a 64 bit kernel.
gcc is: 
Reading specs from /usr/mips/lib/gcc-lib/mips-linux/3.3.3/specs
Configured with: ../configure --prefix=/usr/mips --exec-prefix=/usr/mips 
--target=mips-linux --enable-shared --disable-nls --disable-multilib 
--enable-languages=c,c++,ada,f77,objc
Thread model: posix
gcc version 3.3.3 (Debian)


Cheers,
Damian

--Boundary-00=_TfbFDyhkIifKgj5
Content-Type: text/x-diff;
  charset="us-ascii";
  name="ip22-eisa.c.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="ip22-eisa.c.patch"

34c34,35
< #include <asm/addrspace.h>
---
> //#include <asm/addrspace.h>
> #include <asm-mips/addrspace.h>
39a41,45
> //Force redefine.. seems to fail to find it when linking kernel itself.
> //This is probably no good..
> #define KSEG1ADDR(a)	(CPHYSADDR(a) | KSEG1)
> #define KSEG1     0xa0000000
> 

--Boundary-00=_TfbFDyhkIifKgj5
Content-Type: text/x-diff;
  charset="us-ascii";
  name="asm-mips.thread_info.h.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="asm-mips.thread_info.h.patch"

38a39,45
> /*Copied these from parisc and ppc64 - don't know any better.  TIF_32BIT was 
>  * undefined when compiling for mips in drivers/input/evdev.c I do not 
>  * understand this code.  Just guessing...*/
> #define TIF_32BIT               5       /* 32 bit binary */
> #define _TIF_32BIT              (1<<TIF_32BIT)
> 
> 

--Boundary-00=_TfbFDyhkIifKgj5--

From ralf@linux-mips.org Wed Aug 31 15:56:57 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 31 Aug 2005 15:57:15 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:28182 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225326AbVHaO45>; Wed, 31 Aug 2005 15:56:57 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7VF2ues007079;
	Wed, 31 Aug 2005 16:02:56 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7VF2upm007078;
	Wed, 31 Aug 2005 16:02:56 +0100
Date:	Wed, 31 Aug 2005 16:02:56 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Damian Dimmich <djd20@kent.ac.uk>
Cc:	linux-mips@linux-mips.org
Subject: Re: compiling kernel 2.6.13
Message-ID: <20050831150256.GC3377@linux-mips.org>
References: <200508311459.47273.djd20@kent.ac.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200508311459.47273.djd20@kent.ac.uk>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8839
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 2705
Lines: 72

On Wed, Aug 31, 2005 at 02:59:46PM +0100, Damian Dimmich wrote:

> I had some trouble compiling 2.6.13 for the mips architecture.  I encountered 
> two errors:
> 
> 1)
> 
> In the file include/asm-mips/thread_info.h TIF_32BIT was undefined.
> 
> I added the following two lines which showed up in parisc and ppc64 's 
> thread-info's.  Don't know if these values are correct or if this actually 
> works.  It just gets it to compile...
> #define TIF_32BIT               5       /* 32 bit binary */
> #define _TIF_32BIT              (1<<TIF_32BIT)
> 
> The error was in drivers/input/evdev.c which includes 
> include/asm-mips/thread_info.h
> 
> The error was:
>  CC [M]  drivers/input/evdev.o
> drivers/input/evdev.c: In function `evdev_write':
> drivers/input/evdev.c:193: error: `TIF_32BIT' undeclared (first use in this 
> function)
> drivers/input/evdev.c:193: error: (Each undeclared identifier is reported only 
> once
> drivers/input/evdev.c:193: error: for each function it appears in.)
> drivers/input/evdev.c: In function `evdev_read':
> drivers/input/evdev.c:254: error: `TIF_32BIT' undeclared (first use in this 
> function)

That driver's 32-bit compatibility is totally broken, I'm afraid.  It'll
be easy to kludge though ...

> 2)
> 
> When linking .tmp_vmlinux1, KSEG1ADDR and KSEG1 where reported as undefined 
> and linking failed. 
>  LD      .tmp_vmlinux1
> arch/mips/sgi-ip22/built-in.o(.text+0x2854): In function `ip22_eisa_intr':
> : undefined reference to `KSEG1ADDR'
> arch/mips/sgi-ip22/built-in.o(.text+0x2864): In function `ip22_eisa_intr':
> : undefined reference to `KSEG1ADDR'
> arch/mips/sgi-ip22/built-in.o(.text+0x2870): In function `ip22_eisa_intr':
> : undefined reference to `KSEG1ADDR'
> arch/mips/sgi-ip22/built-in.o(.text+0x28ac): In function `ip22_eisa_intr':
> : undefined reference to `KSEG1ADDR'
> arch/mips/sgi-ip22/built-in.o(.text+0x28c0): In function `ip22_eisa_intr':
> : undefined reference to `KSEG1ADDR'
> arch/mips/sgi-ip22/built-in.o(.text+0x293c): more undefined references to 
> `KSEG1ADDR' follow
> make: *** [.tmp_vmlinux1] Error 1
> 
> 
> I fixed this by adding the lines:
> #define KSEG1ADDR(a)  (CPHYSADDR(a) | KSEG1)
> #define KSEG1     0xa0000000
> at the top of the file arch/mips/sgi-ip22/ip22-eisa.c
> These are copied from include/asm/addrspace.h
> 
> I found it quite strange that it only failed when linking the kernel and not 
> earlier.  The file asm/addrspace.h is included in ip22-eisa.c
> 
> eisa support is enabled and i'm compiling a 64 bit kernel.

Daring.  Hardly anybody is using EISA on that machine and even less so on
64-bit, expect to find bugs.

> gcc version 3.3.3 (Debian)

Should be a safe choice of compiler.

  Ralf

From ths@networkno.de Wed Aug 31 16:06:13 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 31 Aug 2005 16:06:31 +0100 (BST)
Received: from mx01.qsc.de ([IPv6:::ffff:213.148.129.14]:49349 "EHLO
	mx01.qsc.de") by linux-mips.org with ESMTP id <S8225548AbVHaPGN>;
	Wed, 31 Aug 2005 16:06:13 +0100
Received: from port-195-158-167-225.dynamic.qsc.de ([195.158.167.225] helo=hattusa.textio)
	by mx01.qsc.de with esmtp (Exim 3.35 #1)
	id 1EAUGE-0005jr-00; Wed, 31 Aug 2005 17:12:22 +0200
Received: from ths by hattusa.textio with local (Exim 4.52)
	id 1EAUGF-0005J9-Dq; Wed, 31 Aug 2005 17:12:23 +0200
Date:	Wed, 31 Aug 2005 17:12:23 +0200
To:	Damian Dimmich <djd20@kent.ac.uk>
Cc:	linux-mips@linux-mips.org
Subject: Re: compiling kernel 2.6.13
Message-ID: <20050831151223.GV21717@hattusa.textio>
References: <200508311459.47273.djd20@kent.ac.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200508311459.47273.djd20@kent.ac.uk>
User-Agent: Mutt/1.5.10i
From:	Thiemo Seufer <ths@networkno.de>
Return-Path: <ths@networkno.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8840
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ths@networkno.de
Precedence: bulk
X-list: linux-mips
Content-Length: 1505
Lines: 37

Damian Dimmich wrote:
[snip]
> When linking .tmp_vmlinux1, KSEG1ADDR and KSEG1 where reported as undefined 
> and linking failed. 
>  LD      .tmp_vmlinux1
> arch/mips/sgi-ip22/built-in.o(.text+0x2854): In function `ip22_eisa_intr':
> : undefined reference to `KSEG1ADDR'
> arch/mips/sgi-ip22/built-in.o(.text+0x2864): In function `ip22_eisa_intr':
> : undefined reference to `KSEG1ADDR'
> arch/mips/sgi-ip22/built-in.o(.text+0x2870): In function `ip22_eisa_intr':
> : undefined reference to `KSEG1ADDR'
> arch/mips/sgi-ip22/built-in.o(.text+0x28ac): In function `ip22_eisa_intr':
> : undefined reference to `KSEG1ADDR'
> arch/mips/sgi-ip22/built-in.o(.text+0x28c0): In function `ip22_eisa_intr':
> : undefined reference to `KSEG1ADDR'
> arch/mips/sgi-ip22/built-in.o(.text+0x293c): more undefined references to 
> `KSEG1ADDR' follow
> make: *** [.tmp_vmlinux1] Error 1
> 
> 
> I fixed this by adding the lines:
> #define KSEG1ADDR(a)  (CPHYSADDR(a) | KSEG1)
> #define KSEG1     0xa0000000
> at the top of the file arch/mips/sgi-ip22/ip22-eisa.c
> These are copied from include/asm/addrspace.h
> 
> I found it quite strange that it only failed when linking the kernel and not 
> earlier.  The file asm/addrspace.h is included in ip22-eisa.c
> 
> eisa support is enabled and i'm compiling a 64 bit kernel.

You could try the patch in http://people.debian.org/~ths/foo/ip22-eisa.diff
which fixes that problem. I don't have the hardware to test it, and so far
nobody else cared to tell me if works.


Thiemo

From ralf@linux-mips.org Wed Aug 31 16:19:34 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 31 Aug 2005 16:19:54 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:36883 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225326AbVHaPTe>; Wed, 31 Aug 2005 16:19:34 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7VFPbe6007894;
	Wed, 31 Aug 2005 16:25:37 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7VFPb8G007893;
	Wed, 31 Aug 2005 16:25:37 +0100
Date:	Wed, 31 Aug 2005 16:25:37 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Thiemo Seufer <ths@networkno.de>
Cc:	Damian Dimmich <djd20@kent.ac.uk>, linux-mips@linux-mips.org
Subject: Re: compiling kernel 2.6.13
Message-ID: <20050831152537.GE3377@linux-mips.org>
References: <200508311459.47273.djd20@kent.ac.uk> <20050831151223.GV21717@hattusa.textio>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050831151223.GV21717@hattusa.textio>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8841
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 437
Lines: 11

On Wed, Aug 31, 2005 at 05:12:23PM +0200, Thiemo Seufer wrote:

> You could try the patch in http://people.debian.org/~ths/foo/ip22-eisa.diff
> which fixes that problem. I don't have the hardware to test it, and so far
> nobody else cared to tell me if works.

At least it looks like an improvment and since it's probably save to
consider the current IP22 EISA code as broken I wouldn't mind if you want
to check this one in ...

  Ralf

From geoman@gentoo.org Wed Aug 31 16:24:29 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 31 Aug 2005 16:24:48 +0100 (BST)
Received: from lennier.cc.vt.edu ([IPv6:::ffff:198.82.162.213]:41448 "EHLO
	lennier.cc.vt.edu") by linux-mips.org with ESMTP
	id <S8225326AbVHaPY2>; Wed, 31 Aug 2005 16:24:28 +0100
Received: from zidane.cc.vt.edu (IDENT:mirapoint@evil-zidane.cc.vt.edu [10.1.1.13])
	by lennier.cc.vt.edu (8.12.11/8.12.11) with ESMTP id j7VFUdb1016285
	for <linux-mips@linux-mips.org>; Wed, 31 Aug 2005 11:30:39 -0400
Received: from [128.173.184.73] (gs4073.geos.vt.edu [128.173.184.73])
	by zidane.cc.vt.edu (MOS 3.6.4-CR)
	with ESMTP id DYB20572;
	Wed, 31 Aug 2005 11:30:37 -0400 (EDT)
Message-ID: <4315CD1C.80203@gentoo.org>
Date:	Wed, 31 Aug 2005 11:30:36 -0400
From:	"Stephen P. Becker" <geoman@gentoo.org>
User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050807)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	"'Linux/MIPS Development'" <linux-mips@linux-mips.org>
Subject: Re: compiling kernel 2.6.13
References: <200508311459.47273.djd20@kent.ac.uk> <20050831150256.GC3377@linux-mips.org>
In-Reply-To: <20050831150256.GC3377@linux-mips.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <geoman@gentoo.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8842
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: geoman@gentoo.org
Precedence: bulk
X-list: linux-mips
Content-Length: 524
Lines: 13

>>eisa support is enabled and i'm compiling a 64 bit kernel.
> 
> 
> Daring.  Hardly anybody is using EISA on that machine and even less so on
> 64-bit, expect to find bugs.

Furthermore, 64-bit kernels are somewhat broken on ip22 right now. 
Something is wrong with memory allocation, and it really screws a lot of 
things up.  Off the top of my head, you won't be able to turn on swap, 
mount a ricerfs partition, or dd large blocks from /dev/zero.  You would 
be much better of sticking with 32-bit at this time.

-Steve

From ralf@linux-mips.org Wed Aug 31 16:29:01 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 31 Aug 2005 16:29:21 +0100 (BST)
Received: from extgw-uk.mips.com ([IPv6:::ffff:62.254.210.129]:63518 "EHLO
	bacchus.net.dhis.org") by linux-mips.org with ESMTP
	id <S8225326AbVHaP3B>; Wed, 31 Aug 2005 16:29:01 +0100
Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1])
	by bacchus.net.dhis.org (8.13.4/8.13.1) with ESMTP id j7VFZAgM008235;
	Wed, 31 Aug 2005 16:35:10 +0100
Received: (from ralf@localhost)
	by dea.linux-mips.net (8.13.4/8.13.4/Submit) id j7VFZAHk008234;
	Wed, 31 Aug 2005 16:35:10 +0100
Date:	Wed, 31 Aug 2005 16:35:10 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	"Stephen P. Becker" <geoman@gentoo.org>
Cc:	"'Linux/MIPS Development'" <linux-mips@linux-mips.org>
Subject: Re: compiling kernel 2.6.13
Message-ID: <20050831153509.GF3377@linux-mips.org>
References: <200508311459.47273.djd20@kent.ac.uk> <20050831150256.GC3377@linux-mips.org> <4315CD1C.80203@gentoo.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4315CD1C.80203@gentoo.org>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8843
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 581
Lines: 14

On Wed, Aug 31, 2005 at 11:30:36AM -0400, Stephen P. Becker wrote:

> >Daring.  Hardly anybody is using EISA on that machine and even less so on
> >64-bit, expect to find bugs.
> 
> Furthermore, 64-bit kernels are somewhat broken on ip22 right now. 
> Something is wrong with memory allocation, and it really screws a lot of 
> things up.  Off the top of my head, you won't be able to turn on swap, 
> mount a ricerfs partition, or dd large blocks from /dev/zero.  You would 
> be much better of sticking with 32-bit at this time.

But that seems an IP22-specific problem.

  Ralf

From ths@networkno.de Wed Aug 31 16:49:15 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 31 Aug 2005 16:49:32 +0100 (BST)
Received: from mx01.qsc.de ([IPv6:::ffff:213.148.129.14]:52438 "EHLO
	mx01.qsc.de") by linux-mips.org with ESMTP id <S8225326AbVHaPtP>;
	Wed, 31 Aug 2005 16:49:15 +0100
Received: from port-195-158-167-225.dynamic.qsc.de ([195.158.167.225] helo=hattusa.textio)
	by mx01.qsc.de with esmtp (Exim 3.35 #1)
	id 1EAUvt-0007JX-00; Wed, 31 Aug 2005 17:55:25 +0200
Received: from ths by hattusa.textio with local (Exim 4.52)
	id 1EAUvu-0005WE-Ht; Wed, 31 Aug 2005 17:55:26 +0200
Date:	Wed, 31 Aug 2005 17:55:26 +0200
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	"Stephen P. Becker" <geoman@gentoo.org>,
	'Linux/MIPS Development' <linux-mips@linux-mips.org>
Subject: Re: compiling kernel 2.6.13
Message-ID: <20050831155526.GW21717@hattusa.textio>
References: <200508311459.47273.djd20@kent.ac.uk> <20050831150256.GC3377@linux-mips.org> <4315CD1C.80203@gentoo.org> <20050831153509.GF3377@linux-mips.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050831153509.GF3377@linux-mips.org>
User-Agent: Mutt/1.5.10i
From:	Thiemo Seufer <ths@networkno.de>
Return-Path: <ths@networkno.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8844
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ths@networkno.de
Precedence: bulk
X-list: linux-mips
Content-Length: 734
Lines: 19

Ralf Baechle wrote:
> On Wed, Aug 31, 2005 at 11:30:36AM -0400, Stephen P. Becker wrote:
> 
> > >Daring.  Hardly anybody is using EISA on that machine and even less so on
> > >64-bit, expect to find bugs.
> > 
> > Furthermore, 64-bit kernels are somewhat broken on ip22 right now. 
> > Something is wrong with memory allocation, and it really screws a lot of 
> > things up.  Off the top of my head, you won't be able to turn on swap, 
> > mount a ricerfs partition, or dd large blocks from /dev/zero.  You would 
> > be much better of sticking with 32-bit at this time.
> 
> But that seems an IP22-specific problem.

I _think_ it hits every 64bit kernel which uses mappings in CKSEG0.
Do you know a system where this works?


Thiemo

From ths@networkno.de Wed Aug 31 17:04:34 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 31 Aug 2005 17:04:54 +0100 (BST)
Received: from mx01.qsc.de ([IPv6:::ffff:213.148.129.14]:2268 "EHLO
	mx01.qsc.de") by linux-mips.org with ESMTP id <S8225554AbVHaQEe>;
	Wed, 31 Aug 2005 17:04:34 +0100
Received: from port-195-158-167-225.dynamic.qsc.de ([195.158.167.225] helo=hattusa.textio)
	by mx01.qsc.de with esmtp (Exim 3.35 #1)
	id 1EAVAj-00004z-00; Wed, 31 Aug 2005 18:10:45 +0200
Received: from ths by hattusa.textio with local (Exim 4.52)
	id 1EAVAl-0005jG-2D; Wed, 31 Aug 2005 18:10:47 +0200
Date:	Wed, 31 Aug 2005 18:10:47 +0200
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org
Subject: Re: compiling kernel 2.6.13
Message-ID: <20050831161046.GY21717@hattusa.textio>
References: <200508311459.47273.djd20@kent.ac.uk> <20050831151223.GV21717@hattusa.textio> <20050831152537.GE3377@linux-mips.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050831152537.GE3377@linux-mips.org>
User-Agent: Mutt/1.5.10i
From:	Thiemo Seufer <ths@networkno.de>
Return-Path: <ths@networkno.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8845
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ths@networkno.de
Precedence: bulk
X-list: linux-mips
Content-Length: 488
Lines: 15

Ralf Baechle wrote:
> On Wed, Aug 31, 2005 at 05:12:23PM +0200, Thiemo Seufer wrote:
> 
> > You could try the patch in http://people.debian.org/~ths/foo/ip22-eisa.diff
> > which fixes that problem. I don't have the hardware to test it, and so far
> > nobody else cared to tell me if works.
> 
> At least it looks like an improvment and since it's probably save to
> consider the current IP22 EISA code as broken I wouldn't mind if you want
> to check this one in ...

Committed.


Thiemo

From anemo@mba.ocn.ne.jp Wed Aug 31 17:08:51 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 31 Aug 2005 17:09:07 +0100 (BST)
Received: from mba.ocn.ne.jp ([IPv6:::ffff:210.190.142.172]:50912 "HELO
	smtp.mba.ocn.ne.jp") by linux-mips.org with SMTP
	id <S8225555AbVHaQIv>; Wed, 31 Aug 2005 17:08:51 +0100
Received: from localhost (p8037-ipad31funabasi.chiba.ocn.ne.jp [221.189.132.37])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 398983DA6; Thu,  1 Sep 2005 01:15:04 +0900 (JST)
Date:	Thu, 01 Sep 2005 01:15:51 +0900 (JST)
Message-Id: <20050901.011551.96687558.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: setup_frame and variants
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
X-Fingerprint: 6ACA 1623 39BD 9A94 9B1A  B746 CA77 FE94 2874 D52F
X-Pgp-Public-Key: http://wwwkeys.pgp.net/pks/lookup?op=get&search=0x2874D52F
X-Mailer: Mew version 3.3 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8846
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 2131
Lines: 69

Now setup_frame and variants return int.  Here is a patch for
remaining bits.


Index: arch/mips/kernel/signal.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/kernel/signal.c,v
retrieving revision 1.92
diff -u -r1.92 signal.c
--- arch/mips/kernel/signal.c	11 Jul 2005 20:46:28 -0000	1.92
+++ arch/mips/kernel/signal.c	31 Aug 2005 14:35:17 -0000
@@ -384,9 +384,6 @@
 	return 0;
 }
 
-extern void setup_rt_frame_n32(struct k_sigaction * ka,
-	struct pt_regs *regs, int signr, sigset_t *set, siginfo_t *info);
-
 static inline int handle_signal(unsigned long sig, siginfo_t *info,
 	struct k_sigaction *ka, sigset_t *oldset, struct pt_regs *regs)
 {
Index: arch/mips/kernel/signal32.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/kernel/signal32.c,v
retrieving revision 1.33
diff -u -r1.33 signal32.c
--- arch/mips/kernel/signal32.c	11 Jul 2005 20:46:28 -0000	1.33
+++ arch/mips/kernel/signal32.c	31 Aug 2005 14:35:18 -0000
@@ -647,8 +647,8 @@
 	return (void *)((sp - frame_size) & ALMASK);
 }
 
-void setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
-			       int signr, sigset_t *set)
+int setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
+			      int signr, sigset_t *set)
 {
 	struct sigframe *frame;
 	int err = 0;
@@ -694,13 +694,14 @@
 	       current->comm, current->pid,
 	       frame, regs->cp0_epc, frame->sf_code);
 #endif
-        return;
+        return 1;
 
 give_sigsegv:
 	force_sigsegv(signr, current);
+	return 0;
 }
 
-void setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs, int signr,	sigset_t *set, siginfo_t *info)
+int setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs, int signr,	sigset_t *set, siginfo_t *info)
 {
 	struct rt_sigframe32 *frame;
 	int err = 0;
@@ -763,10 +764,11 @@
 	       current->comm, current->pid,
 	       frame, regs->cp0_epc, frame->rs_code);
 #endif
-	return;
+	return 1;
 
 give_sigsegv:
 	force_sigsegv(signr, current);
+	return 0;
 }
 
 static inline int handle_signal(unsigned long sig, siginfo_t *info,

From ladis@linux-mips.org Wed Aug 31 17:11:50 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 31 Aug 2005 17:12:06 +0100 (BST)
Received: from smtp.seznam.cz ([IPv6:::ffff:212.80.76.43]:51870 "HELO
	smtp.seznam.cz") by linux-mips.org with SMTP id <S8225555AbVHaQLu>;
	Wed, 31 Aug 2005 17:11:50 +0100
Received: (qmail 14226 invoked from network); 31 Aug 2005 15:42:30 -0000
Received: from unknown (HELO orphique) (Ladislav.Michl@62.77.73.201)
  by cetus.go.seznam.cz with ESMTPA; 31 Aug 2005 15:42:30 -0000
Received: from ladis by orphique with local (Exim 3.36 #1 (Debian))
	id 1EAUjQ-0005pm-00; Wed, 31 Aug 2005 17:42:32 +0200
Date:	Wed, 31 Aug 2005 17:42:32 +0200
To:	Thiemo Seufer <ths@networkno.de>
Cc:	Damian Dimmich <djd20@kent.ac.uk>, linux-mips@linux-mips.org
Subject: Re: compiling kernel 2.6.13
Message-ID: <20050831154232.GA22174@orphique>
References: <200508311459.47273.djd20@kent.ac.uk> <20050831151223.GV21717@hattusa.textio>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050831151223.GV21717@hattusa.textio>
User-Agent: Mutt/1.5.9i
From:	Ladislav Michl <ladis@linux-mips.org>
Return-Path: <ladis@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8847
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ladis@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 620
Lines: 14

On Wed, Aug 31, 2005 at 05:12:23PM +0200, Thiemo Seufer wrote:
[snip]
> You could try the patch in http://people.debian.org/~ths/foo/ip22-eisa.diff
> which fixes that problem. I don't have the hardware to test it, and so far
> nobody else cared to tell me if works.

Yet another patch is laying here almost two years without any attention:
ftp://ftp.linux-mips.org/pub/linux/mips/people/ladis/eisa.diff

It is against some ancient 2.4 kernel (do we still about it?) and at least
shows how to use common 8259A code to handle interrupts. Perhaps we
could do the same in 2.6 and use new EISA code in drivers/eisa ?

	ladis

From anemo@mba.ocn.ne.jp Wed Aug 31 17:15:47 2005
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 31 Aug 2005 17:16:02 +0100 (BST)
Received: from mba.ocn.ne.jp ([IPv6:::ffff:210.190.142.172]:54985 "HELO
	smtp.mba.ocn.ne.jp") by linux-mips.org with SMTP
	id <S8225555AbVHaQPr>; Wed, 31 Aug 2005 17:15:47 +0100
Received: from localhost (p8037-ipad31funabasi.chiba.ocn.ne.jp [221.189.132.37])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 51CBE84C0; Thu,  1 Sep 2005 01:22:01 +0900 (JST)
Date:	Thu, 01 Sep 2005 01:22:47 +0900 (JST)
Message-Id: <20050901.012247.36920050.anemo@mba.ocn.ne.jp>
To:	ths@networkno.de
Cc:	ralf@linux-mips.org, geoman@gentoo.org, linux-mips@linux-mips.org
Subject: Re: compiling kernel 2.6.13
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <20050831155526.GW21717@hattusa.textio>
References: <4315CD1C.80203@gentoo.org>
	<20050831153509.GF3377@linux-mips.org>
	<20050831155526.GW21717@hattusa.textio>
X-Fingerprint: 6ACA 1623 39BD 9A94 9B1A  B746 CA77 FE94 2874 D52F
X-Pgp-Public-Key: http://wwwkeys.pgp.net/pks/lookup?op=get&search=0x2874D52F
X-Mailer: Mew version 3.3 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 8848
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 624
Lines: 21

>>>>> On Wed, 31 Aug 2005 17:55:26 +0200, Thiemo Seufer <ths@networkno.de> said:
>> But that seems an IP22-specific problem.

ths> I _think_ it hits every 64bit kernel which uses mappings in
ths> CKSEG0.  Do you know a system where this works?

Though I do not have IP22, I think this line in mach-ip22/space.h is
inappropriate.

#define MAP_BASE		0xffffffffc0000000

It will make VMALLOC_END in pgtabe-64.h overflow.

#define VMALLOC_START		MAP_BASE
#define VMALLOC_END	\
	(VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE)

Shoule we use 0xc000000000000000 as MAP_BASE for IP22 ?

---
Atsushi Nemoto

