From ralf@linux-mips.org Sat Mar  1 00:02:50 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 01 Mar 2008 00:02:52 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:11976 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28596315AbYCAACu (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 1 Mar 2008 00:02:50 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2102mfN028235;
	Sat, 1 Mar 2008 00:02:49 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2102l4U028233;
	Sat, 1 Mar 2008 00:02:47 GMT
Date:	Sat, 1 Mar 2008 00:02:47 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Thiemo Seufer <ths@networkno.de>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] Fix typo in comment
Message-ID: <20080301000247.GA28191@linux-mips.org>
References: <20080229004347.GA18731@networkno.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080229004347.GA18731@networkno.de>
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18327
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, Feb 29, 2008 at 12:43:47AM +0000, Thiemo Seufer wrote:

Applied.  Thanks,

  Ralf

From ths@networkno.de Mon Mar  3 12:52:34 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 03 Mar 2008 12:52:37 +0000 (GMT)
Received: from relay01.mx.bawue.net ([193.7.176.67]:45245 "EHLO
	relay01.mx.bawue.net") by ftp.linux-mips.org with ESMTP
	id S28601036AbYCCMwe (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 3 Mar 2008 12:52:34 +0000
Received: from lagash (intrt.mips-uk.com [194.74.144.130])
	(using TLSv1 with cipher AES256-SHA (256/256 bits))
	(No client certificate requested)
	by relay01.mx.bawue.net (Postfix) with ESMTP id EC22348918;
	Mon,  3 Mar 2008 13:52:28 +0100 (CET)
Received: from ths by lagash with local (Exim 4.69)
	(envelope-from <ths@networkno.de>)
	id 1JWA9c-0006dX-4M; Mon, 03 Mar 2008 12:52:28 +0000
Date:	Mon, 3 Mar 2008 12:52:28 +0000
From:	Thiemo Seufer <ths@networkno.de>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: Re: [PATCH] Fix PIO IDE on Broadcom SWARM
Message-ID: <20080303125228.GD25396@networkno.de>
References: <20080229013017.GB18731@networkno.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080229013017.GB18731@networkno.de>
User-Agent: Mutt/1.5.17+20080114 (2008-01-14)
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: 18328
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

This patch marks pages tainted by PIO IDE as dirty, instead of trying
to flush them right away. This

a) fixes PIO IDE for systems without dcache aliases (which lacked
   the necessary cache flush so far)
b) improves performance a bit, since some pages may never need a
   cache flush
c) obsoletes local_flush_data_cache_page


Signed-off-by: Thiemo Seufer <ths@networkno.de>
---

Changed to avoid some compiler warnings.


Index: linux.git/include/asm-mips/mach-generic/ide.h
===================================================================
--- linux.git.orig/include/asm-mips/mach-generic/ide.h	2008-03-02 20:15:24.000000000 +0000
+++ linux.git/include/asm-mips/mach-generic/ide.h	2008-03-02 21:52:46.000000000 +0000
@@ -107,107 +107,66 @@
 #endif
 
 /* MIPS port and memory-mapped I/O string operations.  */
-static inline void __ide_flush_prologue(void)
+static inline void __ide_set_pages_dirty(const void *addr, unsigned long size)
 {
-#ifdef CONFIG_SMP
-	if (cpu_has_dc_aliases)
-		preempt_disable();
-#endif
-}
+	unsigned long end = (unsigned long)addr + size;
 
-static inline void __ide_flush_epilogue(void)
-{
-#ifdef CONFIG_SMP
-	if (cpu_has_dc_aliases)
-		preempt_enable();
-#endif
-}
-
-static inline void __ide_flush_dcache_range(unsigned long addr, unsigned long size)
-{
-	if (cpu_has_dc_aliases) {
-		unsigned long end = addr + size;
-
-		while (addr < end) {
-			local_flush_data_cache_page((void *)addr);
-			addr += PAGE_SIZE;
-		}
+	while ((unsigned long)addr < end) {
+		SetPageDcacheDirty(virt_to_page(addr));
+		addr += PAGE_SIZE;
 	}
 }
 
-/*
- * insw() and gang might be called with interrupts disabled, so we can't
- * send IPIs for flushing due to the potencial of deadlocks, see the comment
- * above smp_call_function() in arch/mips/kernel/smp.c.  We work around the
- * problem by disabling preemption so we know we actually perform the flush
- * on the processor that actually has the lines to be flushed which hopefully
- * is even better for performance anyway.
- */
 static inline void __ide_insw(unsigned long port, void *addr,
 	unsigned int count)
 {
-	__ide_flush_prologue();
 	insw(port, addr, count);
-	__ide_flush_dcache_range((unsigned long)addr, count * 2);
-	__ide_flush_epilogue();
+	__ide_set_pages_dirty(addr, count * 2);
 }
 
-static inline void __ide_insl(unsigned long port, void *addr, unsigned int count)
+static inline void __ide_insl(unsigned long port, void *addr,
+	unsigned int count)
 {
-	__ide_flush_prologue();
 	insl(port, addr, count);
-	__ide_flush_dcache_range((unsigned long)addr, count * 4);
-	__ide_flush_epilogue();
+	__ide_set_pages_dirty(addr, count * 4);
 }
 
 static inline void __ide_outsw(unsigned long port, const void *addr,
 	unsigned long count)
 {
-	__ide_flush_prologue();
 	outsw(port, addr, count);
-	__ide_flush_dcache_range((unsigned long)addr, count * 2);
-	__ide_flush_epilogue();
+	__ide_set_pages_dirty(addr, count * 2);
 }
 
 static inline void __ide_outsl(unsigned long port, const void *addr,
 	unsigned long count)
 {
-	__ide_flush_prologue();
 	outsl(port, addr, count);
-	__ide_flush_dcache_range((unsigned long)addr, count * 4);
-	__ide_flush_epilogue();
+	__ide_set_pages_dirty(addr, count * 4);
 }
 
 static inline void __ide_mm_insw(void __iomem *port, void *addr, u32 count)
 {
-	__ide_flush_prologue();
 	readsw(port, addr, count);
-	__ide_flush_dcache_range((unsigned long)addr, count * 2);
-	__ide_flush_epilogue();
+	__ide_set_pages_dirty(addr, count * 2);
 }
 
 static inline void __ide_mm_insl(void __iomem *port, void *addr, u32 count)
 {
-	__ide_flush_prologue();
 	readsl(port, addr, count);
-	__ide_flush_dcache_range((unsigned long)addr, count * 4);
-	__ide_flush_epilogue();
+	__ide_set_pages_dirty(addr, count * 4);
 }
 
 static inline void __ide_mm_outsw(void __iomem *port, void *addr, u32 count)
 {
-	__ide_flush_prologue();
 	writesw(port, addr, count);
-	__ide_flush_dcache_range((unsigned long)addr, count * 2);
-	__ide_flush_epilogue();
+	__ide_set_pages_dirty(addr, count * 2);
 }
 
 static inline void __ide_mm_outsl(void __iomem * port, void *addr, u32 count)
 {
-	__ide_flush_prologue();
 	writesl(port, addr, count);
-	__ide_flush_dcache_range((unsigned long)addr, count * 4);
-	__ide_flush_epilogue();
+	__ide_set_pages_dirty(addr, count * 4);
 }
 
 /* ide_insw calls insw, not __ide_insw.  Why? */
Index: linux.git/arch/mips/mm/c-r3k.c
===================================================================
--- linux.git.orig/arch/mips/mm/c-r3k.c	2008-03-02 20:15:24.000000000 +0000
+++ linux.git/arch/mips/mm/c-r3k.c	2008-03-02 21:42:33.000000000 +0000
@@ -266,10 +266,6 @@
 		r3k_flush_icache_range(kaddr, kaddr + PAGE_SIZE);
 }
 
-static void local_r3k_flush_data_cache_page(void *addr)
-{
-}
-
 static void r3k_flush_data_cache_page(unsigned long addr)
 {
 }
@@ -322,7 +318,6 @@
 	flush_icache_range = r3k_flush_icache_range;
 
 	flush_cache_sigtramp = r3k_flush_cache_sigtramp;
-	local_flush_data_cache_page = local_r3k_flush_data_cache_page;
 	flush_data_cache_page = r3k_flush_data_cache_page;
 
 	_dma_cache_wback_inv = r3k_dma_cache_wback_inv;
Index: linux.git/arch/mips/mm/c-r4k.c
===================================================================
--- linux.git.orig/arch/mips/mm/c-r4k.c	2008-03-02 21:33:29.000000000 +0000
+++ linux.git/arch/mips/mm/c-r4k.c	2008-03-02 21:42:33.000000000 +0000
@@ -1296,7 +1296,6 @@
 
 	flush_cache_sigtramp	= r4k_flush_cache_sigtramp;
 	flush_icache_all	= r4k_flush_icache_all;
-	local_flush_data_cache_page	= local_r4k_flush_data_cache_page;
 	flush_data_cache_page	= r4k_flush_data_cache_page;
 	flush_icache_range	= r4k_flush_icache_range;
 
Index: linux.git/arch/mips/mm/c-tx39.c
===================================================================
--- linux.git.orig/arch/mips/mm/c-tx39.c	2008-03-02 20:15:24.000000000 +0000
+++ linux.git/arch/mips/mm/c-tx39.c	2008-03-02 21:42:33.000000000 +0000
@@ -210,11 +210,6 @@
 		tx39_blast_icache_page_indexed(page);
 }
 
-static void local_tx39_flush_data_cache_page(void * addr)
-{
-	tx39_blast_dcache_page((unsigned long)addr);
-}
-
 static void tx39_flush_data_cache_page(unsigned long addr)
 {
 	tx39_blast_dcache_page(addr);
@@ -352,7 +347,6 @@
 		flush_icache_range	= (void *) tx39h_flush_icache_all;
 
 		flush_cache_sigtramp	= (void *) tx39h_flush_icache_all;
-		local_flush_data_cache_page	= (void *) tx39h_flush_icache_all;
 		flush_data_cache_page	= (void *) tx39h_flush_icache_all;
 
 		_dma_cache_wback_inv	= tx39h_dma_cache_wback_inv;
@@ -377,7 +371,6 @@
 		flush_icache_range = tx39_flush_icache_range;
 
 		flush_cache_sigtramp = tx39_flush_cache_sigtramp;
-		local_flush_data_cache_page = local_tx39_flush_data_cache_page;
 		flush_data_cache_page = tx39_flush_data_cache_page;
 
 		_dma_cache_wback_inv = tx39_dma_cache_wback_inv;
Index: linux.git/arch/mips/mm/cache.c
===================================================================
--- linux.git.orig/arch/mips/mm/cache.c	2008-03-02 20:15:24.000000000 +0000
+++ linux.git/arch/mips/mm/cache.c	2008-03-02 21:42:33.000000000 +0000
@@ -32,11 +32,9 @@
 
 /* MIPS specific cache operations */
 void (*flush_cache_sigtramp)(unsigned long addr);
-void (*local_flush_data_cache_page)(void * addr);
 void (*flush_data_cache_page)(unsigned long addr);
 void (*flush_icache_all)(void);
 
-EXPORT_SYMBOL_GPL(local_flush_data_cache_page);
 EXPORT_SYMBOL(flush_data_cache_page);
 
 #ifdef CONFIG_DMA_NONCOHERENT
Index: linux.git/include/asm-mips/cacheflush.h
===================================================================
--- linux.git.orig/include/asm-mips/cacheflush.h	2008-03-02 20:15:24.000000000 +0000
+++ linux.git/include/asm-mips/cacheflush.h	2008-03-02 21:42:33.000000000 +0000
@@ -76,7 +76,6 @@
 
 extern void (*flush_cache_sigtramp)(unsigned long addr);
 extern void (*flush_icache_all)(void);
-extern void (*local_flush_data_cache_page)(void * addr);
 extern void (*flush_data_cache_page)(unsigned long addr);
 
 /*

From jamesz@modsystems.com Tue Mar  4 00:14:11 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 04 Mar 2008 00:14:13 +0000 (GMT)
Received: from dotcorporate.com ([67.50.105.12]:54975 "EHLO
	dotexchange.dotcorporation.com") by ftp.linux-mips.org with ESMTP
	id S28601221AbYCDAOL (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 4 Mar 2008 00:14:11 +0000
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C87D8C.AABEC29A"
Subject: Re: smp8634 add memory at dram1
Date:	Mon, 3 Mar 2008 16:14:09 -0800
Message-ID: <2D30722FBBDE6749973243F4F01BE984A242CA@dotexchange.dotcorporation.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Re: smp8634 add memory at dram1
Thread-Index: Ach9jKrAm1qYdsZ0S3224VXIW+0Tqg==
From:	"James Zipperer" <jamesz@modsystems.com>
To:	<linux-mips@linux-mips.org>
Return-Path: <jamesz@modsystems.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: 18329
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: jamesz@modsystems.com
Precedence: bulk
X-list: linux-mips

This is a multi-part message in MIME format.

------_=_NextPart_001_01C87D8C.AABEC29A
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

=20
David Kuk" <david.kuk@entone.com <mailto:david.kuk%40entone.com> >
wrote:
> Dear YH
>=20
> I am sorry i have been disturbed by other issues, the memory problem
seems little bit difficult
> to me. In our case, i saw that in prom.c under mips/tango2, the
function prom_init , it shows
> that :
> memcfg_t
> *m=3D(memcfg_t*)KSEG1ADDR(MEM_BASE_dram_controller_0+FM_MEMCFG);=20


> it's seems the kernel has hard coded to point the starting memory to
DRAM controller 0's
> starting address, if now, i have remap 64mb memory at DRAM controller
1 at remap register
> 4, The problem is come, the kernel will ignore any memory before dram
controller 0's starting
> address. Even i have add 0x0c000000--0x10000000 as boot memory, it
still think it's first
> usable pfn is at 0x10000000.=20
>=20
> my solution is 3 steps
>=20
> 1, modify the compiler, let the linux start address moved to
0x0c000000,=20
> 2. modify the YAMON, and map the DRAM 1 controller to remap register4
in YAMON stage
> 3, modify the linux, to set the two piece of memory to the kernel as
boot memory .=20
>=20
> it's this possible, or it have other better solution ?
>=20
> thx a lot for your kindly help !
>=20
>=20
> best wishes
> David
=20
I'm running out of memory in linux on the smp86xx and attempting to
implement this solution.  Did you ever get it to work?  No luck for me
yet.  I'm still a bit unclear why you must switch linux to run off DRAM
1 instead of leaving it on DRAM 0 and adding an additional call to
add_memory_region in prom_init for DRAM 1.  But then again, I haven't
gotten that to work yet either :)
=20
Any info/patches are greatly appreciated.  Thanks!
=20
-James
=20

------_=_NextPart_001_01C87D8C.AABEC29A
Content-Type: text/html;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DProgId content=3DWord.Document>
<meta name=3DGenerator content=3D"Microsoft Word 10">
<meta name=3DOriginator content=3D"Microsoft Word 10">
<link rel=3DFile-List href=3D"cid:filelist.xml@01C87D49.9C9ABB90">
<!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:DoNotRelyOnCSS/>
 </o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:SpellingState>Clean</w:SpellingState>
  <w:GrammarState>Clean</w:GrammarState>
  <w:DocumentKind>DocumentEmail</w:DocumentKind>
  <w:EnvelopeVis/>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]-->
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Courier New";
	mso-fareast-font-family:"Times New Roman";}
span.SpellE
	{mso-style-name:"";
	mso-spl-e:yes;}
span.GramE
	{mso-style-name:"";
	mso-gram-e:yes;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 77.95pt 1.0in 77.95pt;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */=20
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin:0in;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";}
</style>
<![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple =
style=3D'tab-interval:.5in'>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>David <span class=3DSpellE>Kuk</span>&quot; &lt;<a
href=3D"mailto:david.kuk%40entone.com">david.kuk@entone.com</a>&gt; =
wrote:<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; Dear YH<br>
&gt; <o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; I am sorry <span class=3DSpellE>i</span> have been =
disturbed by
other issues, the memory problem seems little bit =
difficult<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; <span class=3DGramE>to</span> me. In our case, <span =
class=3DSpellE>i</span>
saw that in <span class=3DSpellE>prom.c</span> under mips/tango2, the =
function <span
class=3DSpellE>prom_<span class=3DGramE>init</span></span><span =
class=3DGramE> ,</span>
it shows<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; <span class=3DGramE>that =
:</span><o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; <span =
class=3DSpellE>memcfg_t</span><o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; *m<span class=3DGramE>=3D(</span><span =
class=3DSpellE>memcfg_t</span>*)KSEG1ADDR(MEM_BASE_dram_controller_0+FM_M=
EMCFG);
<br style=3D'mso-special-character:line-break'>
<![if !supportLineBreakNewLine]><br =
style=3D'mso-special-character:line-break'>
<![endif]><o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; <span class=3DGramE>it's</span> seems the kernel has hard =
coded to
point the starting memory to DRAM controller =
0's<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; starting address, if now, <span class=3DSpellE>i</span> =
have remap
64mb memory at DRAM controller 1 at remap =
register<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; 4, <span class=3DGramE>The</span> problem is come, the =
kernel will
ignore any memory before dram controller 0's =
starting<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; address. Even <span class=3DSpellE>i</span> have add
0x0c000000--0x10000000 as boot memory, it still think it's =
first<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; <span class=3DGramE>usable</span> <span =
class=3DSpellE>pfn</span> is
at 0x10000000. <br>
&gt; <o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; <span class=3DGramE>my</span> solution is 3 steps<br>
&gt; <o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; 1, modify the compiler, let the <span =
class=3DSpellE>linux</span>
start address moved to 0x0c000000, <o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; 2. <span class=3DGramE>modify</span> the YAMON, and map the =
DRAM 1
controller to remap register4 in YAMON =
stage<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; 3, modify the <span class=3DSpellE>linux</span>, to set the =
two
piece of memory to the kernel as boot <span class=3DGramE>memory =
.</span> <o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; <o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; <span class=3DGramE>it's</span> this possible, or it have =
other
better solution ?<br>
&gt; <o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; thx a lot for your kindly <span class=3DGramE>help =
!</span><o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; <o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; <o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; <span class=3DGramE>best</span> =
wishes<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&gt; David<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt;color:black'><o:p>&nbsp;</o:p></span></font></p=
>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt;color:black'>I'm running out of memory in =
<span
class=3DSpellE>linux</span> on the smp86xx and attempting to implement =
this
solution.<span style=3D'mso-spacerun:yes'>&nbsp; </span>Did you ever get =
it to
work?<span style=3D'mso-spacerun:yes'>&nbsp; </span>No luck for me =
yet.<span
style=3D'mso-spacerun:yes'>&nbsp; </span>I'm still a bit unclear why you =
must
switch <span class=3DSpellE>linux</span> to run off DRAM 1 instead of =
leaving it
on DRAM 0 and adding an additional call to <span =
class=3DSpellE>add_memory_region</span>
in <span class=3DSpellE>prom_init</span> for DRAM 1.<span
style=3D'mso-spacerun:yes'>&nbsp; </span>But then again, I haven't =
gotten that to
work yet either :)<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt;color:black'><o:p>&nbsp;</o:p></span></font></p=
>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt;color:black'>Any info/patches are greatly =
appreciated.<span
style=3D'mso-spacerun:yes'>&nbsp; =
</span>Thanks!<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt;color:black'><o:p>&nbsp;</o:p></span></font></p=
>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt;color:black'>-James<o:p></o:p></span></font></p=
>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt;color:black'><o:p>&nbsp;</o:p></span></font></p=
>

</div>

</body>

</html>
=00
------_=_NextPart_001_01C87D8C.AABEC29A--

From ddaney@avtrex.com Tue Mar  4 00:27:12 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 04 Mar 2008 00:27:14 +0000 (GMT)
Received: from smtp1.dnsmadeeasy.com ([205.234.170.144]:23186 "EHLO
	smtp1.dnsmadeeasy.com") by ftp.linux-mips.org with ESMTP
	id S28601225AbYCDA1M (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 4 Mar 2008 00:27:12 +0000
Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id B6D4031569E;
	Tue,  4 Mar 2008 00:27:17 +0000 (UTC)
X-Authenticated-Name: js.dnsmadeeasy
X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com
Received: from avtrex.com (unknown [67.116.42.147])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP;
	Tue,  4 Mar 2008 00:27:17 +0000 (UTC)
Received: from dl2.hq2.avtrex.com ([192.168.7.26]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Mon, 3 Mar 2008 16:26:57 -0800
Message-ID: <47CC974F.3090306@avtrex.com>
Date:	Mon, 03 Mar 2008 16:26:55 -0800
From:	David Daney <ddaney@avtrex.com>
User-Agent: Thunderbird 2.0.0.12 (X11/20080226)
MIME-Version: 1.0
To:	James Zipperer <jamesz@modsystems.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: smp8634 add memory at dram1
References: <2D30722FBBDE6749973243F4F01BE984A242CA@dotexchange.dotcorporation.com>
In-Reply-To: <2D30722FBBDE6749973243F4F01BE984A242CA@dotexchange.dotcorporation.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 04 Mar 2008 00:26:57.0316 (UTC) FILETIME=[747BD640:01C87D8E]
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: 18330
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

James Zipperer wrote:

> 
>  
> 
> I'm running out of memory in linux on the smp86xx and attempting to 
> implement this solution.  Did you ever get it to work?  No luck for me 
> yet.  I'm still a bit unclear why you must switch linux to run off DRAM 
> 1 instead of leaving it on DRAM 0 and adding an additional call to 
> add_memory_region in prom_init for DRAM 1.  But then again, I haven't 
> gotten that to work yet either :)
> 
>  
> 
> Any info/patches are greatly appreciated.  Thanks!
> 
>  
> 

Typically DRAM 1 must be accessed through the TLB as its address lays 
outside of the 512MB window of KSEG[012].

The best way to make this memory available to Linux may still be up for 
debate.

David Daney

From jamesz@modsystems.com Tue Mar  4 01:59:13 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 04 Mar 2008 01:59:15 +0000 (GMT)
Received: from dotcorporate.com ([67.50.105.12]:30663 "EHLO
	dotexchange.dotcorporation.com") by ftp.linux-mips.org with ESMTP
	id S28601238AbYCDB7N convert rfc822-to-8bit (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 4 Mar 2008 01:59:13 +0000
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 8BIT
Subject: RE: smp8634 add memory at dram1
Date:	Mon, 3 Mar 2008 17:59:11 -0800
Message-ID: <2D30722FBBDE6749973243F4F01BE984A242CB@dotexchange.dotcorporation.com>
In-Reply-To: <47CC974F.3090306@avtrex.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: smp8634 add memory at dram1
Thread-Index: Ach9jncajtrbM7+KS8auCZEQx2hQEQABxn5w
From:	"James Zipperer" <jamesz@modsystems.com>
To:	"David Daney" <ddaney@avtrex.com>
Cc:	<linux-mips@linux-mips.org>
Return-Path: <jamesz@modsystems.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: 18331
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: jamesz@modsystems.com
Precedence: bulk
X-list: linux-mips

> James Zipperer wrote:
>
>> 
>>  
>> 
>> I'm running out of memory in linux on the smp86xx and attempting to 
>> implement this solution.  Did you ever get it to work?  No luck for
me 
>> yet.  I'm still a bit unclear why you must switch linux to run off
DRAM 
>> 1 instead of leaving it on DRAM 0 and adding an additional call to 
>> add_memory_region in prom_init for DRAM 1.  But then again, I haven't

>> gotten that to work yet either :)
>> 
>>  
>> 
>> Any info/patches are greatly appreciated.  Thanks!
>> 
>>  
>> 
>
>Typically DRAM 1 must be accessed through the TLB as its address lays 
>outside of the 512MB window of KSEG[012].
>
>The best way to make this memory available to Linux may still be up for

>debate.
>
>David Daney


I'm sure this is a dumb question due to the fact that my grasp of the
problem is less than acceptable...  

Can remapped addresses (namely CPU_remap[34]_addr) be used for the call
to add_memory_region()?  That would allow the address for DRAM 1 to be
within the 512MB window of KSEG[012].  I'm unclear whether the CPU_remap
addresses count as PHSYICAL or VIRTUAL addresses.  

I'm guessing that my plan won't work since I tried it and it didn't
work.  My results were that the kernel booted but didn't report any
additional memory available via the 'free' command.

Thanks.

-James


From ralf@linux-mips.org Tue Mar  4 09:02:25 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 04 Mar 2008 09:02:27 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:63721 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28601299AbYCDJCZ (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 4 Mar 2008 09:02:25 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2492LSJ030433;
	Tue, 4 Mar 2008 09:02:22 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2492KDF030432;
	Tue, 4 Mar 2008 09:02:20 GMT
Date:	Tue, 4 Mar 2008 09:02:20 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Andrew Morton <akpm@linux-foundation.org>
Cc:	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mips@linux-mips.org
Subject: Re: drivers/net/wireless/b43legacy/ on mips
Message-ID: <20080304090220.GA2875@linux-mips.org>
References: <20080303233651.82c592a4.akpm@linux-foundation.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080303233651.82c592a4.akpm@linux-foundation.org>
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18332
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, Mar 03, 2008 at 11:36:51PM -0800, Andrew Morton wrote:

> ERROR: "__ucmpdi2" [drivers/net/wireless/b43legacy/b43legacy.ko] undefined!
> ERROR: "__ucmpdi2" [drivers/net/wireless/b43/b43.ko] undefined!
> 
> int b43legacy_dma_init(struct b43legacy_wldev *dev)
> {
>         struct b43legacy_dma *dma = &dev->dma;
>         struct b43legacy_dmaring *ring;
>         int err;
>         u64 dmamask;
>         enum b43legacy_dmatype type;
> 
>         dmamask = supported_dma_mask(dev);
>         switch (dmamask) {
>         default:
>                 B43legacy_WARN_ON(1);
>         case DMA_30BIT_MASK:
>                 type = B43legacy_DMA_30BIT;
>                 break;
>         case DMA_32BIT_MASK:
>                 type = B43legacy_DMA_32BIT;
>                 break;
>         case DMA_64BIT_MASK:
>                 type = B43legacy_DMA_64BIT;
>                 break;
>         }
> 
> because some versions of gcc emit a __ucmpdi2 call for switch statements. 

Was this when optimizing for size btw?  It seems gcc is emitting alot more
calls to libgcc when optimizing for size.

> It might be fixable by switching to an open-coded if/compare/else sequence.

It was just a EXPORT_SYMBOL(__ucmpdi2) missing.

> Or maybe my mips compiler (gcc-3.4.5) is just too old..

I'm trying to keep the tools requirements the same as for x86.  So for
32-bit kernels gcc 3.2 is the minimum but 3.2 is broken beyond recovery
for 64-bit code so there a minimum of 3.3 is required.

In practive it is ages that I've last seen a compiler older than gcc 3.4
being used to build a modern kernel for any architecture and 3.2 and 3.3
are a sufficient special case that maybe we should think about deprecating
3.2 and 3.3?

  Ralf

From akpm@linux-foundation.org Tue Mar  4 09:19:40 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 04 Mar 2008 09:19:42 +0000 (GMT)
Received: from smtp1.linux-foundation.org ([140.211.169.13]:39100 "EHLO
	smtp1.linux-foundation.org") by ftp.linux-mips.org with ESMTP
	id S28588208AbYCDJTk (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 4 Mar 2008 09:19:40 +0000
Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55])
	by smtp1.linux-foundation.org (8.14.2/8.14.2/Debian-2build1) with ESMTP id m249JHFf018416
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 4 Mar 2008 01:19:18 -0800
Received: from box (localhost [127.0.0.1])
	by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with SMTP id m249J52w000967;
	Tue, 4 Mar 2008 01:19:06 -0800
Date:	Tue, 4 Mar 2008 01:19:05 -0800
From:	Andrew Morton <akpm@linux-foundation.org>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mips@linux-mips.org
Subject: Re: drivers/net/wireless/b43legacy/ on mips
Message-Id: <20080304011905.22e6e6d9.akpm@linux-foundation.org>
In-Reply-To: <20080304090220.GA2875@linux-mips.org>
References: <20080303233651.82c592a4.akpm@linux-foundation.org>
	<20080304090220.GA2875@linux-mips.org>
X-Mailer: Sylpheed 2.4.1 (GTK+ 2.8.17; x86_64-unknown-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-MIMEDefang-Filter: lf$Revision: 1.188 $
X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13
Return-Path: <akpm@linux-foundation.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: 18333
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: akpm@linux-foundation.org
Precedence: bulk
X-list: linux-mips

On Tue, 4 Mar 2008 09:02:20 +0000 Ralf Baechle <ralf@linux-mips.org> wrote:

> On Mon, Mar 03, 2008 at 11:36:51PM -0800, Andrew Morton wrote:
> 
> > ERROR: "__ucmpdi2" [drivers/net/wireless/b43legacy/b43legacy.ko] undefined!
> > ERROR: "__ucmpdi2" [drivers/net/wireless/b43/b43.ko] undefined!
> > 
> > int b43legacy_dma_init(struct b43legacy_wldev *dev)
> > {
> >         struct b43legacy_dma *dma = &dev->dma;
> >         struct b43legacy_dmaring *ring;
> >         int err;
> >         u64 dmamask;
> >         enum b43legacy_dmatype type;
> > 
> >         dmamask = supported_dma_mask(dev);
> >         switch (dmamask) {
> >         default:
> >                 B43legacy_WARN_ON(1);
> >         case DMA_30BIT_MASK:
> >                 type = B43legacy_DMA_30BIT;
> >                 break;
> >         case DMA_32BIT_MASK:
> >                 type = B43legacy_DMA_32BIT;
> >                 break;
> >         case DMA_64BIT_MASK:
> >                 type = B43legacy_DMA_64BIT;
> >                 break;
> >         }
> > 
> > because some versions of gcc emit a __ucmpdi2 call for switch statements. 
> 
> Was this when optimizing for size btw?

mips allmodconfig.  So: yes.

>  It seems gcc is emitting alot more
> calls to libgcc when optimizing for size.
> 
> > It might be fixable by switching to an open-coded if/compare/else sequence.
> 
> It was just a EXPORT_SYMBOL(__ucmpdi2) missing.

doh.

> > Or maybe my mips compiler (gcc-3.4.5) is just too old..
> 
> I'm trying to keep the tools requirements the same as for x86.  So for
> 32-bit kernels gcc 3.2 is the minimum but 3.2 is broken beyond recovery
> for 64-bit code so there a minimum of 3.3 is required.
> 
> In practive it is ages that I've last seen a compiler older than gcc 3.4
> being used to build a modern kernel for any architecture and 3.2 and 3.3
> are a sufficient special case that maybe we should think about deprecating
> 3.2 and 3.3?

That would make life easier for us.  I don't know what the downstream
implications would be.  I'd need a new cross-compiler, for a start ;)


From jamesz@modsystems.com Tue Mar  4 20:51:06 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 04 Mar 2008 20:51:08 +0000 (GMT)
Received: from dotcorporate.com ([67.50.105.12]:27964 "EHLO
	dotexchange.dotcorporation.com") by ftp.linux-mips.org with ESMTP
	id S28601762AbYCDUvG (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 4 Mar 2008 20:51:06 +0000
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C87E39.76196329"
Subject: RE: smp8634 add memory at dram1
Date:	Tue, 4 Mar 2008 12:51:03 -0800
Message-ID: <2D30722FBBDE6749973243F4F01BE984A242CC@dotexchange.dotcorporation.com>
In-Reply-To: <2D30722FBBDE6749973243F4F01BE984A242CB@dotexchange.dotcorporation.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: smp8634 add memory at dram1
Thread-Index: Ach9jncajtrbM7+KS8auCZEQx2hQEQABxn5wACewQeA=
From:	"James Zipperer" <jamesz@modsystems.com>
To:	"David Daney" <ddaney@avtrex.com>
Cc:	<linux-mips@linux-mips.org>
Return-Path: <jamesz@modsystems.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: 18334
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: jamesz@modsystems.com
Precedence: bulk
X-list: linux-mips

This is a multi-part message in MIME format.

------_=_NextPart_001_01C87E39.76196329
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

James Zipperer wrote:
>>>=20
>>> =20
>>>=20
>>> I'm running out of memory in linux on the smp86xx and attempting to=20
>>> implement this solution.  Did you ever get it to work?  No luck for
me=20
>>> yet.  I'm still a bit unclear why you must switch linux to run off
DRAM=20
>>> 1 instead of leaving it on DRAM 0 and adding an additional call to=20
>>> add_memory_region in prom_init for DRAM 1.  But then again, I
haven't=20
>>> gotten that to work yet either :)
>>>=20
>>> =20
>>>=20
>>> Any info/patches are greatly appreciated.  Thanks!
>>>=20
>>> =20
>>>=20
>>
>>Typically DRAM 1 must be accessed through the TLB as its address lays=20
>>outside of the 512MB window of KSEG[012].
>>
>>The best way to make this memory available to Linux may still be up
for=20
>>debate.
>>
>>David Daney
>>
>
>I'm sure this is a dumb question due to the fact that my grasp of the
>problem is less than acceptable... =20
>
>Can remapped addresses (namely CPU_remap[34]_addr) be used for the call
to >add_memory_region()?  That would allow the address for DRAM 1 to be
within >the 512MB window of KSEG[012].  I'm unclear whether the
CPU_remap addresses >count as PHSYICAL or VIRTUAL addresses. =20
>
>I'm guessing that my plan won't work since I tried it and it didn't
work.  >My results were that the kernel booted but didn't report any
additional >memory available via the 'free' command.
>
>Thanks.
>
>-James

So I think I've got a little better grasp on the problem.  Is the reason
you can't just remap DRAM 1 to 0x08000000 - 0x1000000000 because this is
below the start address of linux 0x10020000?  Can this restriction be
worked around easily?
=20
So as far as I can tell, the options are:
=20
1. YH's proposed solution to use CPU remap registers to map DRAM1 to
0x08000000 - 0x10000000 in the bootloader, make linux run from DRAM1,
and then add_memory_region for DRAM1 and DRAM0.
=20
2. YH's other proposed solution to leave linux running from DRAM0,
enable HIMEM, add_memory_region for DRAM1 using HIMEM, fix HIMEM issues
regarding cache aliasing.
=20
3. Work around adding memory that starts below linux (not sure if this
is even possible).
=20
Are there other options as well?  Thanks!
=20
-James
=20

------_=_NextPart_001_01C87E39.76196329
Content-Type: text/html;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DProgId content=3DWord.Document>
<meta name=3DGenerator content=3D"Microsoft Word 10">
<meta name=3DOriginator content=3D"Microsoft Word 10">
<link rel=3DFile-List href=3D"cid:filelist.xml@01C87DF6.67EB2670">
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
 name=3D"PersonName"/>
<!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:DoNotRelyOnCSS/>
 </o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:SpellingState>Clean</w:SpellingState>
  <w:GrammarState>Clean</w:GrammarState>
  <w:DocumentKind>DocumentEmail</w:DocumentKind>
  <w:EnvelopeVis/>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Courier New";
	mso-fareast-font-family:"Times New Roman";}
span.SpellE
	{mso-style-name:"";
	mso-spl-e:yes;}
span.GramE
	{mso-style-name:"";
	mso-gram-e:yes;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 77.95pt 1.0in 77.95pt;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */=20
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin:0in;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";}
</style>
<![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple =
style=3D'tab-interval:.5in'>

<div class=3DSection1>

<p class=3DMsoPlainText><st1:PersonName><font size=3D2 face=3D"Courier =
New"><span
 style=3D'font-size:10.0pt'>James =
Zipperer</span></font></st1:PersonName> wrote:<o:p></o:p></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;&gt; <o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;&gt;<span style=3D'mso-spacerun:yes'>&nbsp; =
</span><o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;&gt; <o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;&gt; I'm running out of memory in linux on the smp86xx =
and
attempting to <o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;&gt; implement this solution.<span
style=3D'mso-spacerun:yes'>&nbsp; </span>Did you ever get it to =
work?<span
style=3D'mso-spacerun:yes'>&nbsp; </span>No luck for me =
<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;&gt; <span class=3DGramE>yet</span>.<span
style=3D'mso-spacerun:yes'>&nbsp; </span>I'm still a bit unclear why you =
must
switch linux to run off DRAM <o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;&gt; 1 instead of leaving it on DRAM 0 and adding an =
additional
call to <o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;&gt; <span class=3DSpellE><span =
class=3DGramE>add_memory_region</span></span>
in prom_init for DRAM 1.<span style=3D'mso-spacerun:yes'>&nbsp; =
</span>But then
again, I haven't <o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;&gt; gotten that to work yet either =
:)<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;&gt; <o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;&gt;<span style=3D'mso-spacerun:yes'>&nbsp; =
</span><o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;&gt; <o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;&gt; Any info/patches are greatly appreciated.<span
style=3D'mso-spacerun:yes'>&nbsp; =
</span>Thanks!<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;&gt; <o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;&gt;<span style=3D'mso-spacerun:yes'>&nbsp; =
</span><o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;&gt; <o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;Typically DRAM 1 must be accessed through the TLB as its
address <span class=3DGramE>lays</span> <o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;outside of the 512MB window of <span =
class=3DGramE>KSEG[</span>012].<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;The best way to make this memory available to Linux may =
still
be up for <o:p></o:p></span></font></p>

<p class=3DMsoPlainText><span class=3DGramE><font size=3D2 =
face=3D"Courier New"><span
style=3D'font-size:10.0pt'>&gt;&gt;debate.</span></font></span><o:p></o:p=
></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;David Daney<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;&gt;<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;I'm sure this is a dumb question due to the fact that my =
grasp of
the &gt;problem is less than acceptable...<span =
style=3D'mso-spacerun:yes'>&nbsp;
</span><o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;Can remapped addresses (namely CPU_<span =
class=3DGramE>remap[</span>34]_addr)
be used for the call to &gt;<span =
class=3DSpellE>add_memory_region</span>()?<span
style=3D'mso-spacerun:yes'>&nbsp; </span>That would allow the address =
for DRAM 1
to be within &gt;the 512MB window of <span =
class=3DGramE>KSEG[</span>012].<span
style=3D'mso-spacerun:yes'>&nbsp; </span>I'm unclear whether the =
CPU_remap
addresses &gt;count as PHSYICAL or VIRTUAL addresses.<span
style=3D'mso-spacerun:yes'>&nbsp; </span><o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;I'm guessing that my plan won't work since I tried it and it =
didn't
work.<span style=3D'mso-spacerun:yes'>&nbsp; </span>&gt;My results were =
that the
kernel booted but didn't report any additional &gt;memory available via =
the
'free' command.<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;Thanks.<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>&gt;-James<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'><br>
So I think I've got a little better grasp on the problem.<span
style=3D'mso-spacerun:yes'>&nbsp; </span>Is the reason you can't just =
remap DRAM
1 to 0x08000000 - 0x1000000000 because this is below the start address =
of <span
class=3DSpellE>linux</span> 0x10020000?<span =
style=3D'mso-spacerun:yes'>&nbsp;
</span>Can this restriction be worked around =
easily?<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;color:black'><o:p>&nbsp;</o:p></span></font></p=
>

<p class=3DMsoPlainText><font size=3D2 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;color:black'>So as far as I can tell, the =
options are:<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;color:black'><o:p>&nbsp;</o:p></span></font></p=
>

<p class=3DMsoPlainText><font size=3D2 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;color:black'>1. <span =
class=3DSpellE>YH's</span> proposed
solution to use CPU remap registers to map DRAM1 to 0x08000000 - =
0x10000000 in
the <span class=3DSpellE>bootloader</span>, make <span =
class=3DSpellE>linux</span>
run from DRAM1, and then <span class=3DSpellE>add_memory_region</span> =
for DRAM1
and DRAM0.<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;color:black'><o:p>&nbsp;</o:p></span></font></p=
>

<p class=3DMsoPlainText><font size=3D2 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;color:black'>2. <span =
class=3DSpellE>YH's</span> other
proposed solution to leave <span class=3DSpellE>linux</span> running =
from DRAM0,
enable HIMEM, <span class=3DSpellE>add_memory_region</span> for DRAM1 =
using HIMEM,
<span class=3DGramE>fix</span> HIMEM issues regarding cache =
aliasing.<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;color:black'><o:p>&nbsp;</o:p></span></font></p=
>

<p class=3DMsoPlainText><font size=3D2 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;color:black'>3. Work around adding memory that =
starts
below <span class=3DSpellE>linux</span> (not sure if this is even =
possible).<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;color:black'><o:p>&nbsp;</o:p></span></font></p=
>

<p class=3DMsoPlainText><font size=3D2 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;color:black'>Are there other options as =
well?<span
style=3D'mso-spacerun:yes'>&nbsp; =
</span>Thanks!<o:p></o:p></span></font></p>

<p class=3DMsoPlainText><font size=3D2 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;color:black'><o:p>&nbsp;</o:p></span></font></p=
>

<p class=3DMsoPlainText><font size=3D2 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;color:black'>-James<o:p></o:p></span></font></p=
>

<p class=3DMsoPlainText><font size=3D2 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;color:black'><o:p>&nbsp;</o:p></span></font></p=
>

</div>

</body>

</html>
=00
------_=_NextPart_001_01C87E39.76196329--

From opencode@gmx.net Wed Mar  5 12:35:28 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 05 Mar 2008 12:35:31 +0000 (GMT)
Received: from mail.gmx.net ([213.165.64.20]:45187 "HELO mail.gmx.net")
	by ftp.linux-mips.org with SMTP id S20032430AbYCEMf2 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 5 Mar 2008 12:35:28 +0000
Received: (qmail invoked by alias); 05 Mar 2008 12:35:23 -0000
Received: from vpn27.rz.tu-ilmenau.de (EHLO [192.168.1.100]) [141.24.172.27]
  by mail.gmx.net (mp054) with SMTP; 05 Mar 2008 13:35:23 +0100
X-Authenticated: #44099387
X-Provags-ID: V01U2FsdGVkX19LO7FGJo1LqyDCRELHVaQ9xpYxfl0PvDlgFJmUo0
	5SArwd1lD7ZZun
Message-ID: <47CE9388.9050808@gmx.net>
Date:	Wed, 05 Mar 2008 13:35:20 +0100
From:	Andi <opencode@gmx.net>
User-Agent: Thunderbird 2.0.0.12 (X11/20080227)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: Problems booting Linux kernel on Sigma SMP8634 #2
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
Return-Path: <opencode@gmx.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: 18335
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: opencode@gmx.net
Precedence: bulk
X-list: linux-mips

Hey folks,

first of all, sorry for _waisting_ the list with that topic again and again!

this question is related to that one here, posted sooner on this list:
http://www.linux-mips.org/archives/linux-mips/2008-02/msg00032.html

I spent a bit more time on this topic and found out that there is
seriously something going wrong with memory initialization and/or
handling during Linux startup.

I simply add "mem=32m" to the kernel command line, and the kernel runs
longer, at least a bit. However, it than stops with nearly the same
issue: Unable to handle kernel paging request at virtual address, but
different addresses. Tried "16m, 64m" and other values, all behave in
different way. Resulting to a crash at the position w/o any parameter or
 a bit later on.

Since I am not so familiar MIPS and especially the fact that our hard-
and software is more than closed, I am asking you guys to point me where
to spend more time on in order to get this issue fixed and fire up a
kernel on this box.

I am sure there some more guys around using the smp8634. Is it necessary
to load the microcode in order to get the kernel starting up?
Maybe we don't need the audio/video-ucode but irq-handler-ucode looks
very usefull ;-) Do we just have to copy this code at a certain memory
address?


Thank you in advance ...

Regards,
	Andi

From ddaney@avtrex.com Wed Mar  5 17:03:31 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 05 Mar 2008 17:03:33 +0000 (GMT)
Received: from smtp1.dnsmadeeasy.com ([205.234.170.144]:55465 "EHLO
	smtp1.dnsmadeeasy.com") by ftp.linux-mips.org with ESMTP
	id S28602383AbYCERDb (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 5 Mar 2008 17:03:31 +0000
Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id 207183153C9;
	Wed,  5 Mar 2008 17:03:30 +0000 (UTC)
X-Authenticated-Name: js.dnsmadeeasy
X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com
Received: from avtrex.com (unknown [67.116.42.147])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP;
	Wed,  5 Mar 2008 17:03:29 +0000 (UTC)
Received: from dl2.hq2.avtrex.com ([192.168.7.26]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 5 Mar 2008 09:03:15 -0800
Message-ID: <47CED252.20800@avtrex.com>
Date:	Wed, 05 Mar 2008 09:03:14 -0800
From:	David Daney <ddaney@avtrex.com>
User-Agent: Thunderbird 2.0.0.12 (X11/20080226)
MIME-Version: 1.0
To:	Andi <opencode@gmx.net>
Cc:	linux-mips@linux-mips.org
Subject: Re: Problems booting Linux kernel on Sigma SMP8634 #2
References: <47CE9388.9050808@gmx.net>
In-Reply-To: <47CE9388.9050808@gmx.net>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 05 Mar 2008 17:03:15.0676 (UTC) FILETIME=[CD9371C0:01C87EE2]
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: 18336
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

Andi wrote:
> Hey folks,
> 
> first of all, sorry for _waisting_ the list with that topic again and again!
> 
> this question is related to that one here, posted sooner on this list:
> http://www.linux-mips.org/archives/linux-mips/2008-02/msg00032.html
> 
> I spent a bit more time on this topic and found out that there is
> seriously something going wrong with memory initialization and/or
> handling during Linux startup.
> 
> I simply add "mem=32m" to the kernel command line, and the kernel runs
> longer, at least a bit. However, it than stops with nearly the same
> issue: Unable to handle kernel paging request at virtual address, but
> different addresses. Tried "16m, 64m" and other values, all behave in
> different way. Resulting to a crash at the position w/o any parameter or
>  a bit later on.
> 
> Since I am not so familiar MIPS and especially the fact that our hard-
> and software is more than closed, I am asking you guys to point me where
> to spend more time on in order to get this issue fixed and fire up a
> kernel on this box.

I build and successfully run kernels on the 8634 every day, so I don't 
think it is a problem with the 8634 port in general.

You should probably ask for technical support from whomever supplied 
your hardware.  They would know the technical details about how to 
configure the memory controller, the amount and location of the RAM on 
the board, etc.

> 
> I am sure there some more guys around using the smp8634.

Likely there are.  It is used in many blu-ray disk players, among other 
things.

> Is it necessary
> to load the microcode in order to get the kernel starting up?

No.


> Maybe we don't need the audio/video-ucode but irq-handler-ucode looks
> very usefull ;-) Do we just have to copy this code at a certain memory
> address?

N/A, the kernel does not rely on any microcode.

The drivers for the audio/video handling hardware on the 8634 do require 
  microcode, but in many cases it is loaded after the kernel is running. 
  But the microcode is not needed for just running a bare bones kernel.

David Daney


From opencode@gmx.net Wed Mar  5 18:25:26 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 05 Mar 2008 18:25:29 +0000 (GMT)
Received: from mail.gmx.net ([213.165.64.20]:45504 "HELO mail.gmx.net")
	by ftp.linux-mips.org with SMTP id S28603017AbYCESZ0 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 5 Mar 2008 18:25:26 +0000
Received: (qmail invoked by alias); 05 Mar 2008 18:25:20 -0000
Received: from vpn27.rz.tu-ilmenau.de (EHLO [192.168.1.100]) [141.24.172.27]
  by mail.gmx.net (mp047) with SMTP; 05 Mar 2008 19:25:20 +0100
X-Authenticated: #44099387
X-Provags-ID: V01U2FsdGVkX18ywJsmrzYydDPYR/YZLIVkeDgiCCg7zLKa3icl4n
	Z0AsugO2yLUOZ6
Message-ID: <47CEE58C.7020507@gmx.net>
Date:	Wed, 05 Mar 2008 19:25:16 +0100
From:	Andi <opencode@gmx.net>
User-Agent: Thunderbird 2.0.0.12 (X11/20080227)
MIME-Version: 1.0
To:	David Daney <ddaney@avtrex.com>
CC:	linux-mips@linux-mips.org
Subject: Re: Problems booting Linux kernel on Sigma SMP8634 #2
References: <47CE9388.9050808@gmx.net> <47CED252.20800@avtrex.com>
In-Reply-To: <47CED252.20800@avtrex.com>
X-Enigmail-Version: 0.95.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
Return-Path: <opencode@gmx.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: 18337
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: opencode@gmx.net
Precedence: bulk
X-list: linux-mips

Hi,

> I build and successfully run kernels on the 8634 every day, so I don't
> think it is a problem with the 8634 port in general.
> 
> You should probably ask for technical support from whomever supplied
> your hardware.  They would know the technical details about how to
> configure the memory controller, the amount and location of the RAM on
> the board, etc.

Thats right. And I would really like to do so. But unfortunately there
is not much information around about the hardware. Since the box
originally runs a wince system, this project is more like a _free time_
projects of some Linux enthusiasts.

You can get a overview about this here: http://www.t-hack.com/wiki/
There is also a forum, but unfortunately most posts are in German ..

>> I am sure there some more guys around using the smp8634.
> 
> Likely there are.  It is used in many blu-ray disk players, among other
> things.

Ok, there is not much information about the smp8634 out there, which is
really a pity. I know that Sigma is not really interested in publishing
there specifications. Even the gpl part is not published, but I am sure
you already know this :-)

Do you know how to get some more detailed information about the smp8634?

Ok, there are some parts that are not equal, like memory and flash! But
this is a SoC, so most parts are the same.


> N/A, the kernel does not rely on any microcode.

Ok, thanks, so we can cancel this on our todo-list ..



Regards,
	Andi



From dvomlehn@cisco.com Wed Mar  5 22:56:05 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 05 Mar 2008 22:56:08 +0000 (GMT)
Received: from sj-iport-2.cisco.com ([171.71.176.71]:23379 "EHLO
	sj-iport-2.cisco.com") by ftp.linux-mips.org with ESMTP
	id S28602814AbYCEW4F (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 5 Mar 2008 22:56:05 +0000
Received: from sj-dkim-1.cisco.com ([171.71.179.21])
  by sj-iport-2.cisco.com with ESMTP; 05 Mar 2008 14:55:57 -0800
Received: from sj-core-4.cisco.com (sj-core-4.cisco.com [171.68.223.138])
	by sj-dkim-1.cisco.com (8.12.11/8.12.11) with ESMTP id m25Mtv65026063
	for <linux-mips@linux-mips.org>; Wed, 5 Mar 2008 14:55:57 -0800
Received: from cliff.cisco.com (cliff.cisco.com [171.69.11.141])
	by sj-core-4.cisco.com (8.12.10/8.12.6) with ESMTP id m25MtvJt001158
	for <linux-mips@linux-mips.org>; Wed, 5 Mar 2008 22:55:57 GMT
Received: from [127.0.0.1] ([64.100.148.129]) by cliff.cisco.com (8.6.12/8.6.5) with ESMTP id WAA08262 for <linux-mips@linux-mips.org>; Wed, 5 Mar 2008 22:55:56 GMT
Message-ID: <47CF24F4.4010508@cisco.com>
Date:	Wed, 05 Mar 2008 14:55:48 -0800
From:	David VomLehn <dvomlehn@cisco.com>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: Re: Does HIGHMEM work on 32-bit MIPS ports?
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
DKIM-Signature:	v=1; a=rsa-sha256; q=dns/txt; l=2467; t=1204757757; x=1205621757;
	c=relaxed/simple; s=sjdkim1004;
	h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version;
	d=cisco.com; i=dvomlehn@cisco.com;
	z=From:=20David=20VomLehn=20<dvomlehn@cisco.com>
	|Subject:=20Re=3A=20Does=20HIGHMEM=20work=20on=2032-bit=20M
	IPS=20ports?
	|Sender:=20;
	bh=OllSub+IzBFbXhHc8sSRqFbdgkaVoYPay20En0pb9Fc=;
	b=bPgppIffRtg0BHu2mXdw+Y2UEtf0/YMyB5p0tRkmn4F1pZuzKdKdUM5flZ
	DBKHOL0o0aNdz7y8QGBUo28643qv/luzSHjby+oaf46mFEvNgbw1FMMIpb0w
	wly1GBVnBYNwSjswSJayJbYxQPFNMSTZHPTaPw/l5TCYXxJOfRbCU=;
Authentication-Results:	sj-dkim-1; header.From=dvomlehn@cisco.com; dkim=pass (
	sig from cisco.com/sjdkim1004 verified; ); 
Return-Path: <dvomlehn@cisco.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: 18338
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: dvomlehn@cisco.com
Precedence: bulk
X-list: linux-mips

We've made significant progress in getting HIGHMEM to work on our 24K 
processor, but things do not completely work yet. Since I don't yet have 
confidence that we know everything that's going on, I"m not ready to 
submit a full-blown patch, but here's what we've done so far. Please 
send comments/suggestions...

The function __flush_dcache_page (in arch/mips/mm/cache.c) was simply 
returning if the struct page* argument it was given indicated we had a 
page in high memory, so the dcache was never being flushed. This is an 
obvious Bad Thing.

Our first modification was to expand the check for high memory. If the 
page had a temporary mapping, i.e. it was mapped through kmap_atomic(), 
we call flush_data_cache_page(). We then immediately return:

    if (PageHighMem(page)) {
        addr = (unsigned long)kmap_atomic_to_vaddr(page);
        if (addr != 0) {
            flush_data_cache_page(addr);
        }
        return;
    }

(kmap_atomic_to_vaddr() returns the virtual address if the page is 
mapped with kmap_atomic(), otherwise it returns NULL). This change by 
itself is enough to be able to boot with NFS most of the time. I think 
it is not sufficient for permanently mapped kernel pages (those mapped 
with kmap_high()). So, I made two other modifications.

Additional Modification #1: To me, it looks like the return should be 
moved to right after the call to flush_data_cache_page() so that we only 
return immediately for temporary kernel mappings.

The next section of code, which I think already works correctly with 
high memory, is:

    if (mapping && !mapping_mapped(mapping)) {
        SetPageDcacheDirty(page);
        return;
    }

We then have the following:

    addr = (unsigned long) page_address(page);
    flush_data_cache_page(addr);

Additional Modification #2: If the page is in high memory, it may not 
have a kernel mapping, in which case page_address() will return NULL. 
So, I've modified the code to only call flush_data_cache_page() if the 
page_address() doesn't return NULL.

With the two additional modifications above, thing are still not 
completely reliable. So, two questions:

   1. Does what we've done so far make sense?
   2. Since the behavior is still somewhat flaky, I'm still missing
      something. Any suggestions?

-- 
David VomLehn, dvomlehn@cisco.com
The opinions expressed herein are likely mine, but might not be my employer's...



From daniel.j.laird@googlemail.com Thu Mar  6 09:07:22 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Mar 2008 09:07:27 +0000 (GMT)
Received: from wx-out-0506.google.com ([66.249.82.236]:6895 "EHLO
	wx-out-0506.google.com") by ftp.linux-mips.org with ESMTP
	id S28603157AbYCFJHW (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 6 Mar 2008 09:07:22 +0000
Received: by wx-out-0506.google.com with SMTP id h30so2873210wxd.21
        for <linux-mips@linux-mips.org>; Thu, 06 Mar 2008 01:07:18 -0800 (PST)
DKIM-Signature:	v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=googlemail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth;
        bh=bG4q/1JkeVwGOOkFv75OQeEAoITGieQGH2URLbtV0dc=;
        b=rO3wpYXfYP/odyIOV6NMxo5mAbi405L+iHYRNrla0l07uWVS9Ys6TOTShMIX5f+hVnPwBLDTj774uEfZZHb4PVcQwNAvCBdaKROEywsybOQhzn0AMRN5NZSfHpV9eegn4IXaFV1SnRbw4ZRgjz3NFsyVQrJk5/egtIDykDWJQWQ=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=googlemail.com; s=gamma;
        h=message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth;
        b=btB6mKauczjT08NbYtcB5XgCg/mTIasMLDyQkH3jKAnTSWpynmfGEUesDwFzJKIpMXbNiJvqx/UqftoYs9idd/BxVOi3xERND0M3DWYnJJT/mMPS3QZlDfQoezcqXcoBvN8coN+VeLzakUtkryl+sWEo8Rton0285xSGFV9aj2w=
Received: by 10.70.87.5 with SMTP id k5mr4620962wxb.13.1204794438255;
        Thu, 06 Mar 2008 01:07:18 -0800 (PST)
Received: by 10.70.16.20 with HTTP; Thu, 6 Mar 2008 01:07:18 -0800 (PST)
Message-ID: <64660ef00803060107m16fb4a4uc0153ea3c6658b8f@mail.gmail.com>
Date:	Thu, 6 Mar 2008 09:07:18 +0000
From:	"Daniel Laird" <daniel.j.laird@nxp.com>
To:	linux-mips@linux-mips.org
Subject: [PATCH] : Move arch/mips/philips to arch/mips/nxp
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
X-Google-Sender-Auth: 8a54cde7f39d13af
Return-Path: <daniel.j.laird@googlemail.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: 18339
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: daniel.j.laird@nxp.com
Precedence: bulk
X-list: linux-mips

 The following patch moves arch/mips/philips to arch/mips/nxp along
 with the supporting changes:
 This is required before I can start posting new chipset support.

 arch/mips/Kconfig                              |    4
 arch/mips/Makefile                             |   12 -
 arch/mips/kernel/cpu-probe.c                   |   10 -
 arch/mips/nxp/pnx8550/common/Makefile          |   29 +++
 arch/mips/nxp/pnx8550/common/gdb_hook.c        |  109 +++++++++++
 arch/mips/nxp/pnx8550/common/int.c             |  238 +++++++++++++++++++++++++
 arch/mips/nxp/pnx8550/common/pci.c             |  133 +++++++++++++
 arch/mips/nxp/pnx8550/common/platform.c        |  132 +++++++++++++
 arch/mips/nxp/pnx8550/common/proc.c            |  112 +++++++++++
 arch/mips/nxp/pnx8550/common/prom.c            |  129 +++++++++++++
 arch/mips/nxp/pnx8550/common/reset.c           |   49 +++++
 arch/mips/nxp/pnx8550/common/setup.c           |  157 ++++++++++++++++
 arch/mips/nxp/pnx8550/common/time.c            |  150 +++++++++++++++
 arch/mips/nxp/pnx8550/jbs/Makefile             |    4
 arch/mips/nxp/pnx8550/jbs/board_setup.c        |   65 ++++++
 arch/mips/nxp/pnx8550/jbs/init.c               |   53 +++++
 arch/mips/nxp/pnx8550/jbs/irqmap.c             |   36 +++
 arch/mips/nxp/pnx8550/stb810/Makefile          |    4
 arch/mips/nxp/pnx8550/stb810/board_setup.c     |   49 +++++
 arch/mips/nxp/pnx8550/stb810/irqmap.c          |   23 ++
 arch/mips/nxp/pnx8550/stb810/prom_init.c       |   46 ++++
 arch/mips/philips/pnx8550/common/Makefile      |   29 ---
 arch/mips/philips/pnx8550/common/gdb_hook.c    |  109 -----------
 arch/mips/philips/pnx8550/common/int.c         |  238 -------------------------
 arch/mips/philips/pnx8550/common/pci.c         |  133 -------------
 arch/mips/philips/pnx8550/common/platform.c    |  132 -------------
 arch/mips/philips/pnx8550/common/proc.c        |  112 -----------
 arch/mips/philips/pnx8550/common/prom.c        |  129 -------------
 arch/mips/philips/pnx8550/common/reset.c       |   49 -----
 arch/mips/philips/pnx8550/common/setup.c       |  157 ----------------
 arch/mips/philips/pnx8550/common/time.c        |  150 ---------------
 arch/mips/philips/pnx8550/jbs/Makefile         |    4
 arch/mips/philips/pnx8550/jbs/board_setup.c    |   65 ------
 arch/mips/philips/pnx8550/jbs/init.c           |   53 -----
 arch/mips/philips/pnx8550/jbs/irqmap.c         |   36 ---
 arch/mips/philips/pnx8550/stb810/Makefile      |    4
 arch/mips/philips/pnx8550/stb810/board_setup.c |   49 -----
 arch/mips/philips/pnx8550/stb810/irqmap.c      |   23 --
 arch/mips/philips/pnx8550/stb810/prom_init.c   |   46 ----
 include/asm-mips/cpu.h                         |    2
 40 files changed, 1532 insertions(+), 1532 deletions(-)

 Signed-off-by: daniel.j.laird <daniel.j.laird@nxp.com>

diff -urN linux.orig/arch/mips/Kconfig linux/arch/mips/Kconfig
--- linux.orig/arch/mips/Kconfig	2008-03-04 11:08:00.000000000 +0000
+++ linux/arch/mips/Kconfig	2008-03-04 11:13:18.000000000 +0000
@@ -309,12 +309,12 @@
 	select GENERIC_HARDIRQS_NO__DO_IRQ

 config PNX8550_JBS
-	bool "Philips PNX8550 based JBS board"
+	bool "NXP PNX8550 based JBS board"
 	select PNX8550
 	select SYS_SUPPORTS_LITTLE_ENDIAN

 config PNX8550_STB810
-	bool "Philips PNX8550 based STB810 board"
+	bool "NXP PNX8550 based STB810 board"
 	select PNX8550
 	select SYS_SUPPORTS_LITTLE_ENDIAN

diff -urN linux.orig/arch/mips/kernel/cpu-probe.c
linux/arch/mips/kernel/cpu-probe.c
--- linux.orig/arch/mips/kernel/cpu-probe.c	2008-03-04 11:08:00.000000000 +0000
+++ linux/arch/mips/kernel/cpu-probe.c	2008-03-04 11:13:18.000000000 +0000
@@ -778,7 +778,7 @@
 	}
 }

-static inline void cpu_probe_philips(struct cpuinfo_mips *c)
+static inline void cpu_probe_nxp(struct cpuinfo_mips *c)
 {
 	decode_configs(c);
 	switch (c->processor_id & 0xff00) {
@@ -787,7 +787,7 @@
 		c->isa_level = MIPS_CPU_ISA_M32R1;
 		break;
 	default:
-		panic("Unknown Philips Core!"); /* REVISIT: die? */
+		panic("Unknown NXP Core!"); /* REVISIT: die? */
 		break;
 	}
 }
@@ -887,7 +887,7 @@
 	case CPU_SR71000:	name = "Sandcraft SR71000"; break;
 	case CPU_BCM3302:	name = "Broadcom BCM3302"; break;
 	case CPU_BCM4710:	name = "Broadcom BCM4710"; break;
-	case CPU_PR4450:	name = "Philips PR4450"; break;
+	case CPU_PR4450:	name = "NXP PR4450"; break;
 	case CPU_LOONGSON2:	name = "ICT Loongson-2"; break;
 	default:
 		BUG();
@@ -925,8 +925,8 @@
 	case PRID_COMP_SANDCRAFT:
 		cpu_probe_sandcraft(c);
 		break;
- 	case PRID_COMP_PHILIPS:
-		cpu_probe_philips(c);
+ 	case PRID_COMP_NXP:
+		cpu_probe_nxp(c);
 		break;
 	default:
 		c->cputype = CPU_UNKNOWN;
diff -urN linux.orig/arch/mips/Makefile linux/arch/mips/Makefile
--- linux.orig/arch/mips/Makefile	2008-03-04 11:08:00.000000000 +0000
+++ linux/arch/mips/Makefile	2008-03-04 11:13:18.000000000 +0000
@@ -410,21 +410,21 @@
 load-$(CONFIG_TANBAC_TB022X)	+= 0xffffffff80000000

 #
-# Common Philips PNX8550
+# Common NXP PNX8550
 #
-core-$(CONFIG_SOC_PNX8550)	+= arch/mips/philips/pnx8550/common/
+core-$(CONFIG_SOC_PNX8550)	+= arch/mips/nxp/pnx8550/common/
 cflags-$(CONFIG_SOC_PNX8550)	+= -Iinclude/asm-mips/mach-pnx8550

 #
-# Philips PNX8550 JBS board
+# NXP PNX8550 JBS board
 #
-libs-$(CONFIG_PNX8550_JBS)	+= arch/mips/philips/pnx8550/jbs/
+libs-$(CONFIG_PNX8550_JBS)	+= arch/mips/nxp/pnx8550/jbs/
 #cflags-$(CONFIG_PNX8550_JBS)	+= -Iinclude/asm-mips/mach-pnx8550
 load-$(CONFIG_PNX8550_JBS)	+= 0xffffffff80060000

-# Philips PNX8550 STB810 board
+# NXP PNX8550 STB810 board
 #
-libs-$(CONFIG_PNX8550_STB810)	+= arch/mips/philips/pnx8550/stb810/
+libs-$(CONFIG_PNX8550_STB810)	+= arch/mips/nxp/pnx8550/stb810/
 load-$(CONFIG_PNX8550_STB810)	+= 0xffffffff80060000

 # NEC EMMA2RH boards
diff -urN linux.orig/arch/mips/nxp/pnx8550/common/gdb_hook.c
linux/arch/mips/nxp/pnx8550/common/gdb_hook.c
--- linux.orig/arch/mips/nxp/pnx8550/common/gdb_hook.c	1970-01-01
01:00:00.000000000 +0100
+++ linux/arch/mips/nxp/pnx8550/common/gdb_hook.c	2008-03-04
11:13:18.000000000 +0000
@@ -0,0 +1,109 @@
+/*
+ * Carsten Langgaard, carstenl@mips.com
+ * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
+ *
+ * ########################################################################
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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.
+ *
+ * ########################################################################
+ *
+ * This is the interface to the remote debugger stub.
+ *
+ */
+#include <linux/types.h>
+#include <linux/serial.h>
+#include <linux/serialP.h>
+#include <linux/serial_reg.h>
+#include <linux/serial_ip3106.h>
+
+#include <asm/serial.h>
+#include <asm/io.h>
+
+#include <uart.h>
+
+static struct serial_state rs_table[IP3106_NR_PORTS] = {
+};
+static struct async_struct kdb_port_info = {0};
+
+void rs_kgdb_hook(int tty_no)
+{
+	struct serial_state *ser = &rs_table[tty_no];
+
+	kdb_port_info.state = ser;
+	kdb_port_info.magic = SERIAL_MAGIC;
+	kdb_port_info.port  = tty_no;
+	kdb_port_info.flags = ser->flags;
+
+	/*
+	 * Clear all interrupts
+	 */
+	/* Clear all the transmitter FIFO counters (pointer and status) */
+	ip3106_lcr(UART_BASE, tty_no) |= IP3106_UART_LCR_TX_RST;
+	/* Clear all the receiver FIFO counters (pointer and status) */
+	ip3106_lcr(UART_BASE, tty_no) |= IP3106_UART_LCR_RX_RST;
+	/* Clear all interrupts */
+	ip3106_iclr(UART_BASE, tty_no) = IP3106_UART_INT_ALLRX |
+		IP3106_UART_INT_ALLTX;
+
+	/*
+	 * Now, initialize the UART
+	 */
+	ip3106_lcr(UART_BASE, tty_no) = IP3106_UART_LCR_8BIT;
+	ip3106_baud(UART_BASE, tty_no) = 5; // 38400 Baud
+}
+
+int putDebugChar(char c)
+{
+	/* Wait until FIFO not full */
+	while (((ip3106_fifo(UART_BASE, kdb_port_info.port) &
IP3106_UART_FIFO_TXFIFO) >> 16) >= 16)
+		;
+	/* Send one char */
+	ip3106_fifo(UART_BASE, kdb_port_info.port) = c;
+
+	return 1;
+}
+
+char getDebugChar(void)
+{
+	char ch;
+
+	/* Wait until there is a char in the FIFO */
+	while (!((ip3106_fifo(UART_BASE, kdb_port_info.port) &
+					IP3106_UART_FIFO_RXFIFO) >> 8))
+		;
+	/* Read one char */
+	ch = ip3106_fifo(UART_BASE, kdb_port_info.port) &
+		IP3106_UART_FIFO_RBRTHR;
+	/* Advance the RX FIFO read pointer */
+	ip3106_lcr(UART_BASE, kdb_port_info.port) |= IP3106_UART_LCR_RX_NEXT;
+	return (ch);
+}
+
+void rs_disable_debug_interrupts(void)
+{
+	ip3106_ien(UART_BASE, kdb_port_info.port) = 0; /* Disable all interrupts */
+}
+
+void rs_enable_debug_interrupts(void)
+{
+	/* Clear all the transmitter FIFO counters (pointer and status) */
+	ip3106_lcr(UART_BASE, kdb_port_info.port) |= IP3106_UART_LCR_TX_RST;
+	/* Clear all the receiver FIFO counters (pointer and status) */
+	ip3106_lcr(UART_BASE, kdb_port_info.port) |= IP3106_UART_LCR_RX_RST;
+	/* Clear all interrupts */
+	ip3106_iclr(UART_BASE, kdb_port_info.port) = IP3106_UART_INT_ALLRX |
+		IP3106_UART_INT_ALLTX;
+	ip3106_ien(UART_BASE, kdb_port_info.port)  = IP3106_UART_INT_ALLRX;
/* Enable RX interrupts */
+}
diff -urN linux.orig/arch/mips/nxp/pnx8550/common/int.c
linux/arch/mips/nxp/pnx8550/common/int.c
--- linux.orig/arch/mips/nxp/pnx8550/common/int.c	1970-01-01
01:00:00.000000000 +0100
+++ linux/arch/mips/nxp/pnx8550/common/int.c	2008-03-04 11:13:18.000000000 +0000
@@ -0,0 +1,238 @@
+/*
+ *
+ * Copyright (C) 2005 Embedded Alley Solutions, Inc
+ * Ported to 2.6.
+ *
+ * Per Hallsmark, per.hallsmark@mvista.com
+ * Copyright (C) 2000, 2001 MIPS Technologies, Inc.
+ * Copyright (C) 2001 Ralf Baechle
+ *
+ * Cleaned up and bug fixing: Pete Popov, ppopov@embeddedalley.com
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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/compiler.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/interrupt.h>
+#include <linux/kernel_stat.h>
+#include <linux/random.h>
+#include <linux/module.h>
+
+#include <asm/io.h>
+#include <asm/gdb-stub.h>
+#include <int.h>
+#include <uart.h>
+
+/* default prio for interrupts */
+/* first one is a no-no so therefore always prio 0 (disabled) */
+static char gic_prio[PNX8550_INT_GIC_TOTINT] = {
+	0, 1, 1, 1, 1, 15, 1, 1, 1, 1,	//   0 -  9
+	1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	//  10 - 19
+	1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	//  20 - 29
+	1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	//  30 - 39
+	1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	//  40 - 49
+	1, 1, 1, 1, 1, 1, 1, 1, 2, 1,	//  50 - 59
+	1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	//  60 - 69
+	1			//  70
+};
+
+static void hw0_irqdispatch(int irq)
+{
+	/* find out which interrupt */
+	irq = PNX8550_GIC_VECTOR_0 >> 3;
+
+	if (irq == 0) {
+		printk("hw0_irqdispatch: irq 0, spurious interrupt?\n");
+		return;
+	}
+	do_IRQ(PNX8550_INT_GIC_MIN + irq);
+}
+
+
+static void timer_irqdispatch(int irq)
+{
+	irq = (0x01c0 & read_c0_config7()) >> 6;
+
+	if (unlikely(irq == 0)) {
+		printk("timer_irqdispatch: irq 0, spurious interrupt?\n");
+		return;
+	}
+
+	if (irq & 0x1)
+		do_IRQ(PNX8550_INT_TIMER1);
+	if (irq & 0x2)
+		do_IRQ(PNX8550_INT_TIMER2);
+	if (irq & 0x4)
+		do_IRQ(PNX8550_INT_TIMER3);
+}
+
+asmlinkage void plat_irq_dispatch(void)
+{
+	unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
+
+	if (pending & STATUSF_IP2)
+		hw0_irqdispatch(2);
+	else if (pending & STATUSF_IP7) {
+		if (read_c0_config7() & 0x01c0)
+			timer_irqdispatch(7);
+	} else
+		spurious_interrupt();
+}
+
+static inline void modify_cp0_intmask(unsigned clr_mask, unsigned set_mask)
+{
+	unsigned long status = read_c0_status();
+
+	status &= ~((clr_mask & 0xFF) << 8);
+	status |= (set_mask & 0xFF) << 8;
+
+	write_c0_status(status);
+}
+
+static inline void mask_gic_int(unsigned int irq_nr)
+{
+	/* interrupt disabled, bit 26(WE_ENABLE)=1 and bit 16(enable)=0 */
+	PNX8550_GIC_REQ(irq_nr) = 1<<28; /* set priority to 0 */
+}
+
+static inline void unmask_gic_int(unsigned int irq_nr)
+{
+	/* set prio mask to lower four bits and enable interrupt */
+	PNX8550_GIC_REQ(irq_nr) = (1<<26 | 1<<16) | (1<<28) | gic_prio[irq_nr];
+}
+
+static inline void mask_irq(unsigned int irq_nr)
+{
+	if ((PNX8550_INT_CP0_MIN <= irq_nr) && (irq_nr <= PNX8550_INT_CP0_MAX)) {
+		modify_cp0_intmask(1 << irq_nr, 0);
+	} else if ((PNX8550_INT_GIC_MIN <= irq_nr) &&
+		(irq_nr <= PNX8550_INT_GIC_MAX)) {
+		mask_gic_int(irq_nr - PNX8550_INT_GIC_MIN);
+	} else if ((PNX8550_INT_TIMER_MIN <= irq_nr) &&
+		(irq_nr <= PNX8550_INT_TIMER_MAX)) {
+		modify_cp0_intmask(1 << 7, 0);
+	} else {
+		printk("mask_irq: irq %d doesn't exist!\n", irq_nr);
+	}
+}
+
+static inline void unmask_irq(unsigned int irq_nr)
+{
+	if ((PNX8550_INT_CP0_MIN <= irq_nr) && (irq_nr <= PNX8550_INT_CP0_MAX)) {
+		modify_cp0_intmask(0, 1 << irq_nr);
+	} else if ((PNX8550_INT_GIC_MIN <= irq_nr) &&
+		(irq_nr <= PNX8550_INT_GIC_MAX)) {
+		unmask_gic_int(irq_nr - PNX8550_INT_GIC_MIN);
+	} else if ((PNX8550_INT_TIMER_MIN <= irq_nr) &&
+		(irq_nr <= PNX8550_INT_TIMER_MAX)) {
+		modify_cp0_intmask(0, 1 << 7);
+	} else {
+		printk("mask_irq: irq %d doesn't exist!\n", irq_nr);
+	}
+}
+
+int pnx8550_set_gic_priority(int irq, int priority)
+{
+	int gic_irq = irq-PNX8550_INT_GIC_MIN;
+	int prev_priority = PNX8550_GIC_REQ(gic_irq) & 0xf;
+
+        gic_prio[gic_irq] = priority;
+	PNX8550_GIC_REQ(gic_irq) |= (0x10000000 | gic_prio[gic_irq]);
+
+	return prev_priority;
+}
+
+static struct irq_chip level_irq_type = {
+	.name =		"PNX Level IRQ",
+	.ack =		mask_irq,
+	.mask =		mask_irq,
+	.mask_ack =	mask_irq,
+	.unmask =	unmask_irq,
+};
+
+static struct irqaction gic_action = {
+	.handler =	no_action,
+	.flags =	IRQF_DISABLED,
+	.name =		"GIC",
+};
+
+static struct irqaction timer_action = {
+	.handler =	no_action,
+	.flags =	IRQF_DISABLED,
+	.name =		"Timer",
+};
+
+void __init arch_init_irq(void)
+{
+	int i;
+	int configPR;
+
+	for (i = 0; i < PNX8550_INT_CP0_TOTINT; i++) {
+		set_irq_chip_and_handler(i, &level_irq_type, handle_level_irq);
+		mask_irq(i);	/* mask the irq just in case  */
+	}
+
+	/* init of GIC/IPC interrupts */
+	/* should be done before cp0 since cp0 init enables the GIC int */
+	for (i = PNX8550_INT_GIC_MIN; i <= PNX8550_INT_GIC_MAX; i++) {
+		int gic_int_line = i - PNX8550_INT_GIC_MIN;
+		if (gic_int_line == 0 )
+			continue;	// don't fiddle with int 0
+		/*
+		 * enable change of TARGET, ENABLE and ACTIVE_LOW bits
+		 * set TARGET        0 to route through hw0 interrupt
+		 * set ACTIVE_LOW    0 active high  (correct?)
+		 *
+		 * We really should setup an interrupt description table
+		 * to do this nicely.
+		 * Note, PCI INTA is active low on the bus, but inverted
+		 * in the GIC, so to us it's active high.
+		 */
+		PNX8550_GIC_REQ(i - PNX8550_INT_GIC_MIN) = 0x1E000000;
+
+		/* mask/priority is still 0 so we will not get any
+		 * interrupts until it is unmasked */
+
+		set_irq_chip_and_handler(i, &level_irq_type, handle_level_irq);
+	}
+
+	/* Priority level 0 */
+	PNX8550_GIC_PRIMASK_0 = PNX8550_GIC_PRIMASK_1 = 0;
+
+	/* Set int vector table address */
+	PNX8550_GIC_VECTOR_0 = PNX8550_GIC_VECTOR_1 = 0;
+
+	set_irq_chip_and_handler(MIPS_CPU_GIC_IRQ, &level_irq_type,
+				 handle_level_irq);
+	setup_irq(MIPS_CPU_GIC_IRQ, &gic_action);
+
+	/* init of Timer interrupts */
+	for (i = PNX8550_INT_TIMER_MIN; i <= PNX8550_INT_TIMER_MAX; i++)
+		set_irq_chip_and_handler(i, &level_irq_type, handle_level_irq);
+
+	/* Stop Timer 1-3 */
+	configPR = read_c0_config7();
+	configPR |= 0x00000038;
+	write_c0_config7(configPR);
+
+	set_irq_chip_and_handler(MIPS_CPU_TIMER_IRQ, &level_irq_type,
+				 handle_level_irq);
+	setup_irq(MIPS_CPU_TIMER_IRQ, &timer_action);
+}
+
+EXPORT_SYMBOL(pnx8550_set_gic_priority);
diff -urN linux.orig/arch/mips/nxp/pnx8550/common/Makefile
linux/arch/mips/nxp/pnx8550/common/Makefile
--- linux.orig/arch/mips/nxp/pnx8550/common/Makefile	1970-01-01
01:00:00.000000000 +0100
+++ linux/arch/mips/nxp/pnx8550/common/Makefile	2008-03-04
11:13:18.000000000 +0000
@@ -0,0 +1,29 @@
+#
+# Per Hallsmark, per.hallsmark@mvista.com
+#
+# ########################################################################
+#
+# This program is free software; you can distribute it and/or modify it
+# under the terms of the GNU General Public License (Version 2) as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope 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.
+#
+# #######################################################################
+#
+# Makefile for the PNX8550 specific kernel interface routines
+# under Linux.
+#
+
+obj-y := setup.o prom.o int.o reset.o time.o proc.o platform.o
+obj-$(CONFIG_PCI) += pci.o
+obj-$(CONFIG_KGDB) += gdb_hook.o
+
+EXTRA_CFLAGS += -Werror
diff -urN linux.orig/arch/mips/nxp/pnx8550/common/pci.c
linux/arch/mips/nxp/pnx8550/common/pci.c
--- linux.orig/arch/mips/nxp/pnx8550/common/pci.c	1970-01-01
01:00:00.000000000 +0100
+++ linux/arch/mips/nxp/pnx8550/common/pci.c	2008-03-04 11:13:18.000000000 +0000
@@ -0,0 +1,133 @@
+/*
+ *
+ * BRIEF MODULE DESCRIPTION
+ *
+ * Author: source@mvista.com
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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/types.h>
+#include <linux/pci.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+
+#include <pci.h>
+#include <glb.h>
+#include <nand.h>
+
+static struct resource pci_io_resource = {
+	.start	= PNX8550_PCIIO + 0x1000,	/* reserve regacy I/O space */
+	.end	= PNX8550_PCIIO + PNX8550_PCIIO_SIZE,
+	.name	= "pci IO space",
+	.flags	= IORESOURCE_IO
+};
+
+static struct resource pci_mem_resource = {
+	.start	= PNX8550_PCIMEM,
+	.end	= PNX8550_PCIMEM + PNX8550_PCIMEM_SIZE - 1,
+	.name	= "pci memory space",
+	.flags	= IORESOURCE_MEM
+};
+
+extern struct pci_ops pnx8550_pci_ops;
+
+static struct pci_controller pnx8550_controller = {
+	.pci_ops	= &pnx8550_pci_ops,
+	.io_resource	= &pci_io_resource,
+	.mem_resource	= &pci_mem_resource,
+};
+
+/* Return the total size of DRAM-memory, (RANK0 + RANK1) */
+static inline unsigned long get_system_mem_size(void)
+{
+	/* Read IP2031_RANK0_ADDR_LO */
+	unsigned long dram_r0_lo = inl(PCI_BASE | 0x65010);
+	/* Read IP2031_RANK1_ADDR_HI */
+	unsigned long dram_r1_hi = inl(PCI_BASE | 0x65018);
+
+	return dram_r1_hi - dram_r0_lo + 1;
+}
+
+static int __init pnx8550_pci_setup(void)
+{
+	int pci_mem_code;
+	int mem_size = get_system_mem_size() >> 20;
+
+	/* Clear the Global 2 Register, PCI Inta Output Enable Registers
+	   Bit 1:Enable DAC Powerdown
+	  -> 0:DACs are enabled and are working normally
+	     1:DACs are powerdown
+	   Bit 0:Enable of PCI inta output
+	  -> 0 = Disable PCI inta output
+	     1 = Enable PCI inta output
+	*/
+	PNX8550_GLB2_ENAB_INTA_O = 0;
+
+	/* Calc the PCI mem size code */
+	if (mem_size >= 128)
+		pci_mem_code = SIZE_128M;
+	else if (mem_size >= 64)
+		pci_mem_code = SIZE_64M;
+	else if (mem_size >= 32)
+		pci_mem_code = SIZE_32M;
+	else
+		pci_mem_code = SIZE_16M;
+
+	/* Set PCI_XIO registers */
+	outl(pci_mem_resource.start, PCI_BASE | PCI_BASE1_LO);
+	outl(pci_mem_resource.end + 1, PCI_BASE | PCI_BASE1_HI);
+	outl(pci_io_resource.start, PCI_BASE | PCI_BASE2_LO);
+	outl(pci_io_resource.end, PCI_BASE | PCI_BASE2_HI);
+
+	/* Send memory transaction via PCI_BASE2 */
+	outl(0x00000001, PCI_BASE | PCI_IO);
+
+	/* Unlock the setup register */
+	outl(0xca, PCI_BASE | PCI_UNLOCKREG);
+
+	/*
+	 * BAR0 of PNX8550 (pci base 10) must be zero in order for ide
+	 * to work, and in order for bus_to_baddr to work without any
+	 * hacks.
+	 */
+	outl(0x00000000, PCI_BASE | PCI_BASE10);
+
+	/*
+	 *These two bars are set by default or the boot code.
+	 * However, it's safer to set them here so we're not boot
+	 * code dependent.
+	 */
+	outl(0x1be00000, PCI_BASE | PCI_BASE14);  /* PNX MMIO */
+	outl(PNX8550_NAND_BASE_ADDR, PCI_BASE | PCI_BASE18);  /* XIO      */
+
+	outl(PCI_EN_TA |
+	     PCI_EN_PCI2MMI |
+	     PCI_EN_XIO |
+	     PCI_SETUP_BASE18_SIZE(SIZE_32M) |
+	     PCI_SETUP_BASE18_EN |
+	     PCI_SETUP_BASE14_EN |
+	     PCI_SETUP_BASE10_PREF |
+	     PCI_SETUP_BASE10_SIZE(pci_mem_code) |
+	     PCI_SETUP_CFGMANAGE_EN |
+	     PCI_SETUP_PCIARB_EN,
+	     PCI_BASE |
+	     PCI_SETUP);	/* PCI_SETUP */
+	outl(0x00000000, PCI_BASE | PCI_CTRL);	/* PCI_CONTROL */
+
+	register_pci_controller(&pnx8550_controller);
+
+	return 0;
+}
+
+arch_initcall(pnx8550_pci_setup);
diff -urN linux.orig/arch/mips/nxp/pnx8550/common/platform.c
linux/arch/mips/nxp/pnx8550/common/platform.c
--- linux.orig/arch/mips/nxp/pnx8550/common/platform.c	1970-01-01
01:00:00.000000000 +0100
+++ linux/arch/mips/nxp/pnx8550/common/platform.c	2008-03-04
11:13:18.000000000 +0000
@@ -0,0 +1,132 @@
+/*
+ * Platform device support for NXP PNX8550 SoCs
+ *
+ * Copyright 2005, Embedded Alley Solutions, Inc
+ *
+ * Based on arch/mips/au1000/common/platform.c
+ * Platform device support for Au1x00 SoCs.
+ *
+ * Copyright 2004, Matt Porter <mporter@kernel.crashing.org>
+ *
+ * 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/device.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/resource.h>
+#include <linux/serial.h>
+#include <linux/serial_pnx8xxx.h>
+#include <linux/platform_device.h>
+
+#include <int.h>
+#include <usb.h>
+#include <uart.h>
+
+static struct resource pnx8550_usb_ohci_resources[] = {
+	[0] = {
+		.start		= PNX8550_USB_OHCI_OP_BASE,
+		.end		= PNX8550_USB_OHCI_OP_BASE +
+				  PNX8550_USB_OHCI_OP_LEN,
+		.flags		= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start		= PNX8550_INT_USB,
+		.end		= PNX8550_INT_USB,
+		.flags		= IORESOURCE_IRQ,
+	},
+};
+
+static struct resource pnx8550_uart_resources[] = {
+	[0] = {
+		.start		= PNX8550_UART_PORT0,
+		.end		= PNX8550_UART_PORT0 + 0xfff,
+		.flags		= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start		= PNX8550_UART_INT(0),
+		.end		= PNX8550_UART_INT(0),
+		.flags		= IORESOURCE_IRQ,
+	},
+	[2] = {
+		.start		= PNX8550_UART_PORT1,
+		.end		= PNX8550_UART_PORT1 + 0xfff,
+		.flags		= IORESOURCE_MEM,
+	},
+	[3] = {
+		.start		= PNX8550_UART_INT(1),
+		.end		= PNX8550_UART_INT(1),
+		.flags		= IORESOURCE_IRQ,
+	},
+};
+
+struct pnx8xxx_port pnx8xxx_ports[] = {
+	[0] = {
+		.port   = {
+			.type		= PORT_PNX8XXX,
+			.iotype		= UPIO_MEM,
+			.membase	= (void __iomem *)PNX8550_UART_PORT0,
+			.mapbase	= PNX8550_UART_PORT0,
+			.irq		= PNX8550_UART_INT(0),
+			.uartclk	= 3692300,
+			.fifosize	= 16,
+			.flags		= UPF_BOOT_AUTOCONF,
+			.line		= 0,
+		},
+	},
+	[1] = {
+		.port   = {
+			.type		= PORT_PNX8XXX,
+			.iotype		= UPIO_MEM,
+			.membase	= (void __iomem *)PNX8550_UART_PORT1,
+			.mapbase	= PNX8550_UART_PORT1,
+			.irq		= PNX8550_UART_INT(1),
+			.uartclk	= 3692300,
+			.fifosize	= 16,
+			.flags		= UPF_BOOT_AUTOCONF,
+			.line		= 1,
+		},
+	},
+};
+
+/* The dmamask must be set for OHCI to work */
+static u64 ohci_dmamask = ~(u32)0;
+
+static u64 uart_dmamask = ~(u32)0;
+
+static struct platform_device pnx8550_usb_ohci_device = {
+	.name		= "pnx8550-ohci",
+	.id		= -1,
+	.dev = {
+		.dma_mask		= &ohci_dmamask,
+		.coherent_dma_mask	= 0xffffffff,
+	},
+	.num_resources	= ARRAY_SIZE(pnx8550_usb_ohci_resources),
+	.resource	= pnx8550_usb_ohci_resources,
+};
+
+static struct platform_device pnx8550_uart_device = {
+	.name		= "pnx8xxx-uart",
+	.id		= -1,
+	.dev = {
+		.dma_mask		= &uart_dmamask,
+		.coherent_dma_mask	= 0xffffffff,
+		.platform_data = pnx8xxx_ports,
+	},
+	.num_resources	= ARRAY_SIZE(pnx8550_uart_resources),
+	.resource	= pnx8550_uart_resources,
+};
+
+static struct platform_device *pnx8550_platform_devices[] __initdata = {
+	&pnx8550_usb_ohci_device,
+	&pnx8550_uart_device,
+};
+
+static int __init pnx8550_platform_init(void)
+{
+	return platform_add_devices(pnx8550_platform_devices,
+			            ARRAY_SIZE(pnx8550_platform_devices));
+}
+
+arch_initcall(pnx8550_platform_init);
diff -urN linux.orig/arch/mips/nxp/pnx8550/common/proc.c
linux/arch/mips/nxp/pnx8550/common/proc.c
--- linux.orig/arch/mips/nxp/pnx8550/common/proc.c	1970-01-01
01:00:00.000000000 +0100
+++ linux/arch/mips/nxp/pnx8550/common/proc.c	2008-03-04
11:13:18.000000000 +0000
@@ -0,0 +1,112 @@
+/*
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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/proc_fs.h>
+#include <linux/irq.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/interrupt.h>
+#include <linux/kernel_stat.h>
+#include <linux/random.h>
+
+#include <asm/io.h>
+#include <asm/gdb-stub.h>
+#include <int.h>
+#include <uart.h>
+
+
+static int pnx8550_timers_read(char* page, char** start, off_t
offset, int count, int* eof, void* data)
+{
+        int len = 0;
+	int configPR = read_c0_config7();
+
+        if (offset==0) {
+		len += sprintf(&page[len], "Timer:       count,  compare, tc, status\n");
+                len += sprintf(&page[len], "    1: %11i, %8i,  %1i, %s\n",
+			       read_c0_count(), read_c0_compare(),
+			      (configPR>>6)&0x1, ((configPR>>3)&0x1)? "off":"on");
+                len += sprintf(&page[len], "    2: %11i, %8i,  %1i, %s\n",
+			       read_c0_count2(), read_c0_compare2(),
+			      (configPR>>7)&0x1, ((configPR>>4)&0x1)? "off":"on");
+                len += sprintf(&page[len], "    3: %11i, %8i,  %1i, %s\n",
+			       read_c0_count3(), read_c0_compare3(),
+			      (configPR>>8)&0x1, ((configPR>>5)&0x1)? "off":"on");
+        }
+
+        return len;
+}
+
+static int pnx8550_registers_read(char* page, char** start, off_t
offset, int count, int* eof, void* data)
+{
+        int len = 0;
+
+        if (offset==0) {
+                len += sprintf(&page[len], "config1:   %#10.8x\n",
read_c0_config1());
+                len += sprintf(&page[len], "config2:   %#10.8x\n",
read_c0_config2());
+                len += sprintf(&page[len], "config3:   %#10.8x\n",
read_c0_config3());
+                len += sprintf(&page[len], "configPR:  %#10.8x\n",
read_c0_config7());
+                len += sprintf(&page[len], "status:    %#10.8x\n",
read_c0_status());
+                len += sprintf(&page[len], "cause:     %#10.8x\n",
read_c0_cause());
+                len += sprintf(&page[len], "count:     %#10.8x\n",
read_c0_count());
+                len += sprintf(&page[len], "count_2:   %#10.8x\n",
read_c0_count2());
+                len += sprintf(&page[len], "count_3:   %#10.8x\n",
read_c0_count3());
+                len += sprintf(&page[len], "compare:   %#10.8x\n",
read_c0_compare());
+                len += sprintf(&page[len], "compare_2: %#10.8x\n",
read_c0_compare2());
+                len += sprintf(&page[len], "compare_3: %#10.8x\n",
read_c0_compare3());
+        }
+
+        return len;
+}
+
+static struct proc_dir_entry* pnx8550_dir        = NULL;
+static struct proc_dir_entry* pnx8550_timers     = NULL;
+static struct proc_dir_entry* pnx8550_registers  = NULL;
+
+static int pnx8550_proc_init( void )
+{
+
+	// Create /proc/pnx8550
+        pnx8550_dir = proc_mkdir("pnx8550", NULL);
+        if (!pnx8550_dir) {
+                printk(KERN_ERR "Can't create pnx8550 proc dir\n");
+                return -1;
+        }
+
+	// Create /proc/pnx8550/timers
+        pnx8550_timers = create_proc_read_entry(
+		"timers",
+		0,
+		pnx8550_dir,
+		pnx8550_timers_read,
+		NULL);
+
+        if (!pnx8550_timers)
+                printk(KERN_ERR "Can't create pnx8550 timers proc file\n");
+
+	// Create /proc/pnx8550/registers
+        pnx8550_registers = create_proc_read_entry(
+		"registers",
+		0,
+		pnx8550_dir,
+		pnx8550_registers_read,
+		NULL);
+
+        if (!pnx8550_registers)
+                printk(KERN_ERR "Can't create pnx8550 registers proc file\n");
+
+	return 0;
+}
+
+__initcall(pnx8550_proc_init);
diff -urN linux.orig/arch/mips/nxp/pnx8550/common/prom.c
linux/arch/mips/nxp/pnx8550/common/prom.c
--- linux.orig/arch/mips/nxp/pnx8550/common/prom.c	1970-01-01
01:00:00.000000000 +0100
+++ linux/arch/mips/nxp/pnx8550/common/prom.c	2008-03-04
11:13:18.000000000 +0000
@@ -0,0 +1,129 @@
+/*
+ *
+ * Per Hallsmark, per.hallsmark@mvista.com
+ *
+ * Based on jmr3927/common/prom.c
+ *
+ * 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.
+ */
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/string.h>
+#include <linux/serial_pnx8xxx.h>
+
+#include <asm/bootinfo.h>
+#include <uart.h>
+
+/* #define DEBUG_CMDLINE */
+
+extern int prom_argc;
+extern char **prom_argv, **prom_envp;
+
+typedef struct
+{
+    char *name;
+/*    char *val; */
+}t_env_var;
+
+
+char * prom_getcmdline(void)
+{
+	return &(arcs_cmdline[0]);
+}
+
+void __init prom_init_cmdline(void)
+{
+	int i;
+
+	arcs_cmdline[0] = '\0';
+	for (i = 0; i < prom_argc; i++) {
+		strcat(arcs_cmdline, prom_argv[i]);
+		strcat(arcs_cmdline, " ");
+	}
+}
+
+char *prom_getenv(char *envname)
+{
+	/*
+	 * Return a pointer to the given environment variable.
+	 * Environment variables are stored in the form of "memsize=64".
+	 */
+
+	t_env_var *env = (t_env_var *)prom_envp;
+	int i;
+
+	i = strlen(envname);
+
+	while(env->name) {
+		if(strncmp(envname, env->name, i) == 0) {
+			return(env->name + strlen(envname) + 1);
+		}
+		env++;
+	}
+	return(NULL);
+}
+
+inline unsigned char str2hexnum(unsigned char c)
+{
+	if(c >= '0' && c <= '9')
+		return c - '0';
+	if(c >= 'a' && c <= 'f')
+		return c - 'a' + 10;
+	if(c >= 'A' && c <= 'F')
+		return c - 'A' + 10;
+	return 0; /* foo */
+}
+
+inline void str2eaddr(unsigned char *ea, unsigned char *str)
+{
+	int i;
+
+	for(i = 0; i < 6; i++) {
+		unsigned char num;
+
+		if((*str == '.') || (*str == ':'))
+			str++;
+		num = str2hexnum(*str++) << 4;
+		num |= (str2hexnum(*str++));
+		ea[i] = num;
+	}
+}
+
+int get_ethernet_addr(char *ethernet_addr)
+{
+        char *ethaddr_str;
+
+        ethaddr_str = prom_getenv("ethaddr");
+	if (!ethaddr_str) {
+	        printk("ethaddr not set in boot prom\n");
+		return -1;
+	}
+	str2eaddr(ethernet_addr, ethaddr_str);
+	return 0;
+}
+
+void __init prom_free_prom_memory(void)
+{
+}
+
+extern int pnx8550_console_port;
+
+/* used by early printk */
+void prom_putchar(char c)
+{
+	if (pnx8550_console_port != -1) {
+		/* Wait until FIFO not full */
+		while( ((ip3106_fifo(UART_BASE, pnx8550_console_port) &
PNX8XXX_UART_FIFO_TXFIFO) >> 16) >= 16)
+			;
+		/* Send one char */
+		ip3106_fifo(UART_BASE, pnx8550_console_port) = c;
+	}
+}
+
+EXPORT_SYMBOL(prom_getcmdline);
+EXPORT_SYMBOL(get_ethernet_addr);
+EXPORT_SYMBOL(str2eaddr);
diff -urN linux.orig/arch/mips/nxp/pnx8550/common/reset.c
linux/arch/mips/nxp/pnx8550/common/reset.c
--- linux.orig/arch/mips/nxp/pnx8550/common/reset.c	1970-01-01
01:00:00.000000000 +0100
+++ linux/arch/mips/nxp/pnx8550/common/reset.c	2008-03-04
11:13:18.000000000 +0000
@@ -0,0 +1,49 @@
+/*.
+ *
+ * ########################################################################
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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.
+ *
+ * ########################################################################
+ *
+ * Reset the PNX8550 board.
+ *
+ */
+#include <linux/slab.h>
+#include <asm/reboot.h>
+#include <glb.h>
+
+void pnx8550_machine_restart(char *command)
+{
+	char head[] = "************* Machine restart *************";
+	char foot[] = "*******************************************";
+
+	printk("\n\n");
+	printk("%s\n", head);
+	if (command != NULL)
+		printk("* %s\n", command);
+	printk("%s\n", foot);
+
+	PNX8550_RST_CTL = PNX8550_RST_DO_SW_RST;
+}
+
+void pnx8550_machine_halt(void)
+{
+	printk("*** Machine halt. (Not implemented) ***\n");
+}
+
+void pnx8550_machine_power_off(void)
+{
+	printk("*** Machine power off.  (Not implemented) ***\n");
+}
diff -urN linux.orig/arch/mips/nxp/pnx8550/common/setup.c
linux/arch/mips/nxp/pnx8550/common/setup.c
--- linux.orig/arch/mips/nxp/pnx8550/common/setup.c	1970-01-01
01:00:00.000000000 +0100
+++ linux/arch/mips/nxp/pnx8550/common/setup.c	2008-03-04
11:13:18.000000000 +0000
@@ -0,0 +1,157 @@
+/*
+ *
+ * 2.6 port, Embedded Alley Solutions, Inc
+ *
+ *  Based on Per Hallsmark, per.hallsmark@mvista.com
+ *
+ *  This program is free software; you can distribute it and/or modify it
+ *  under the terms of the GNU General Public License (Version 2) as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope 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/sched.h>
+#include <linux/ioport.h>
+#include <linux/irq.h>
+#include <linux/mm.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/serial_pnx8xxx.h>
+#include <linux/pm.h>
+
+#include <asm/cpu.h>
+#include <asm/bootinfo.h>
+#include <asm/irq.h>
+#include <asm/mipsregs.h>
+#include <asm/reboot.h>
+#include <asm/pgtable.h>
+#include <asm/time.h>
+
+#include <glb.h>
+#include <int.h>
+#include <pci.h>
+#include <uart.h>
+#include <nand.h>
+
+extern void __init board_setup(void);
+extern void pnx8550_machine_restart(char *);
+extern void pnx8550_machine_halt(void);
+extern void pnx8550_machine_power_off(void);
+extern struct resource ioport_resource;
+extern struct resource iomem_resource;
+extern void rs_kgdb_hook(int tty_no);
+extern char *prom_getcmdline(void);
+
+struct resource standard_io_resources[] = {
+	{
+		.start	= 0x00,
+		.end	= 0x1f,
+		.name	= "dma1",
+		.flags	= IORESOURCE_BUSY
+	}, {
+		.start	= 0x40,
+		.end	= 0x5f,
+		.name	= "timer",
+		.flags	= IORESOURCE_BUSY
+	}, {
+		.start	= 0x80,
+		.end	= 0x8f,
+		.name	= "dma page reg",
+		.flags	= IORESOURCE_BUSY
+	}, {
+		.start	= 0xc0,
+		.end	= 0xdf,
+		.name	= "dma2",
+		.flags	= IORESOURCE_BUSY
+	},
+};
+
+#define STANDARD_IO_RESOURCES ARRAY_SIZE(standard_io_resources)
+
+extern struct resource pci_io_resource;
+extern struct resource pci_mem_resource;
+
+/* Return the total size of DRAM-memory, (RANK0 + RANK1) */
+unsigned long get_system_mem_size(void)
+{
+	/* Read IP2031_RANK0_ADDR_LO */
+	unsigned long dram_r0_lo = inl(PCI_BASE | 0x65010);
+	/* Read IP2031_RANK1_ADDR_HI */
+	unsigned long dram_r1_hi = inl(PCI_BASE | 0x65018);
+
+	return dram_r1_hi - dram_r0_lo + 1;
+}
+
+int pnx8550_console_port = -1;
+
+void __init plat_mem_setup(void)
+{
+	int i;
+	char* argptr;
+
+	board_setup();  /* board specific setup */
+
+        _machine_restart = pnx8550_machine_restart;
+        _machine_halt = pnx8550_machine_halt;
+        pm_power_off = pnx8550_machine_power_off;
+
+	/* Clear the Global 2 Register, PCI Inta Output Enable Registers
+	   Bit 1:Enable DAC Powerdown
+	  -> 0:DACs are enabled and are working normally
+	     1:DACs are powerdown
+	   Bit 0:Enable of PCI inta output
+	  -> 0 = Disable PCI inta output
+	     1 = Enable PCI inta output
+	*/
+	PNX8550_GLB2_ENAB_INTA_O = 0;
+
+	/* IO/MEM resources. */
+	set_io_port_base(KSEG1);
+	ioport_resource.start = 0;
+	ioport_resource.end = ~0;
+	iomem_resource.start = 0;
+	iomem_resource.end = ~0;
+
+	/* Request I/O space for devices on this board */
+	for (i = 0; i < STANDARD_IO_RESOURCES; i++)
+		request_resource(&ioport_resource, standard_io_resources + i);
+
+	/* Place the Mode Control bit for GPIO pin 16 in primary function */
+	/* Pin 16 is used by UART1, UA1_TX                                */
+	outl((PNX8550_GPIO_MODE_PRIMOP << PNX8550_GPIO_MC_16_BIT) |
+			(PNX8550_GPIO_MODE_PRIMOP << PNX8550_GPIO_MC_17_BIT),
+			PNX8550_GPIO_MC1);
+
+	argptr = prom_getcmdline();
+	if ((argptr = strstr(argptr, "console=ttyS")) != NULL) {
+		argptr += strlen("console=ttyS");
+		pnx8550_console_port = *argptr == '0' ? 0 : 1;
+
+		/* We must initialize the UART (console) before early printk */
+		/* Set LCR to 8-bit and BAUD to 38400 (no 5)                */
+		ip3106_lcr(UART_BASE, pnx8550_console_port) =
+			PNX8XXX_UART_LCR_8BIT;
+		ip3106_baud(UART_BASE, pnx8550_console_port) = 5;
+	}
+
+#ifdef CONFIG_KGDB
+	argptr = prom_getcmdline();
+	if ((argptr = strstr(argptr, "kgdb=ttyS")) != NULL) {
+		int line;
+		argptr += strlen("kgdb=ttyS");
+		line = *argptr == '0' ? 0 : 1;
+		rs_kgdb_hook(line);
+		pr_info("KGDB: Using ttyS%i for session, "
+		        "please connect your debugger\n", line ? 1 : 0);
+	}
+#endif
+	return;
+}
diff -urN linux.orig/arch/mips/nxp/pnx8550/common/time.c
linux/arch/mips/nxp/pnx8550/common/time.c
--- linux.orig/arch/mips/nxp/pnx8550/common/time.c	1970-01-01
01:00:00.000000000 +0100
+++ linux/arch/mips/nxp/pnx8550/common/time.c	2008-03-04
11:13:18.000000000 +0000
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2001, 2002, 2003 MontaVista Software Inc.
+ * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
+ * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org)
+ *
+ * Common time service routines for MIPS machines. See
+ * Documents/MIPS/README.txt.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/param.h>
+#include <linux/time.h>
+#include <linux/timer.h>
+#include <linux/smp.h>
+#include <linux/kernel_stat.h>
+#include <linux/spinlock.h>
+#include <linux/interrupt.h>
+
+#include <asm/bootinfo.h>
+#include <asm/cpu.h>
+#include <asm/time.h>
+#include <asm/hardirq.h>
+#include <asm/div64.h>
+#include <asm/debug.h>
+
+#include <int.h>
+#include <cm.h>
+
+static unsigned long cpj;
+
+static cycle_t hpt_read(void)
+{
+	return read_c0_count2();
+}
+
+static struct clocksource pnx_clocksource = {
+	.name		= "pnx8xxx",
+	.rating		= 200,
+	.read		= hpt_read,
+	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
+};
+
+static irqreturn_t pnx8xxx_timer_interrupt(int irq, void *dev_id)
+{
+	struct clock_event_device *c = dev_id;
+
+	/* clear MATCH, signal the event */
+	c->event_handler(c);
+
+	return IRQ_HANDLED;
+}
+
+static struct irqaction pnx8xxx_timer_irq = {
+	.handler	= pnx8xxx_timer_interrupt,
+	.flags		= IRQF_DISABLED | IRQF_PERCPU,
+	.name		= "pnx8xxx_timer",
+};
+
+static irqreturn_t monotonic_interrupt(int irq, void *dev_id)
+{
+	/* Timer 2 clear interrupt */
+	write_c0_compare2(-1);
+	return IRQ_HANDLED;
+}
+
+static struct irqaction monotonic_irqaction = {
+	.handler = monotonic_interrupt,
+	.flags = IRQF_DISABLED,
+	.name = "Monotonic timer",
+};
+
+static int pnx8xxx_set_next_event(unsigned long delta,
+				struct clock_event_device *evt)
+{
+	write_c0_compare(delta);
+	return 0;
+}
+
+static struct clock_event_device pnx8xxx_clockevent = {
+	.name		= "pnx8xxx_clockevent",
+	.features	= CLOCK_EVT_FEAT_ONESHOT,
+	.set_next_event = pnx8xxx_set_next_event,
+};
+
+static inline void timer_ack(void)
+{
+	write_c0_compare(cpj);
+}
+
+__init void plat_time_init(void)
+{
+	unsigned int configPR;
+	unsigned int n;
+	unsigned int m;
+	unsigned int p;
+	unsigned int pow2p;
+
+	clockevents_register_device(&pnx8xxx_clockevent);
+	clocksource_register(&pnx_clocksource);
+
+	/* Timer 1 start */
+	configPR = read_c0_config7();
+	configPR &= ~0x00000008;
+	write_c0_config7(configPR);
+
+	/* Timer 2 start */
+	configPR = read_c0_config7();
+	configPR &= ~0x00000010;
+	write_c0_config7(configPR);
+
+	/* Timer 3 stop */
+	configPR = read_c0_config7();
+	configPR |= 0x00000020;
+	write_c0_config7(configPR);
+
+
+        /* PLL0 sets MIPS clock (PLL1 <=> TM1, PLL6 <=> TM2, PLL5 <=> mem) */
+        /* (but only if CLK_MIPS_CTL select value [bits 3:1] is 1:  FIXME) */
+
+        n = (PNX8550_CM_PLL0_CTL & PNX8550_CM_PLL_N_MASK) >> 16;
+        m = (PNX8550_CM_PLL0_CTL & PNX8550_CM_PLL_M_MASK) >> 8;
+        p = (PNX8550_CM_PLL0_CTL & PNX8550_CM_PLL_P_MASK) >> 2;
+	pow2p = (1 << p);
+
+	db_assert(m != 0 && pow2p != 0);
+
+        /*
+	 * Compute the frequency as in the PNX8550 User Manual 1.0, p.186
+	 * (a.k.a. 8-10).  Divide by HZ for a timer offset that results in
+	 * HZ timer interrupts per second.
+	 */
+	mips_hpt_frequency = 27UL * ((1000000UL * n)/(m * pow2p));
+	cpj = (mips_hpt_frequency + HZ / 2) / HZ;
+	write_c0_count(0);
+	timer_ack();
+
+	/* Setup Timer 2 */
+	write_c0_count2(0);
+	write_c0_compare2(0xffffffff);
+
+	setup_irq(PNX8550_INT_TIMER1, &pnx8xxx_timer_irq);
+	setup_irq(PNX8550_INT_TIMER2, &monotonic_irqaction);
+}
diff -urN linux.orig/arch/mips/nxp/pnx8550/jbs/board_setup.c
linux/arch/mips/nxp/pnx8550/jbs/board_setup.c
--- linux.orig/arch/mips/nxp/pnx8550/jbs/board_setup.c	1970-01-01
01:00:00.000000000 +0100
+++ linux/arch/mips/nxp/pnx8550/jbs/board_setup.c	2008-03-04
11:13:18.000000000 +0000
@@ -0,0 +1,65 @@
+/*
+ *  JBS Specific board startup routines.
+ *
+ *  Copyright 2005, Embedded Alley Solutions, Inc
+ *
+ *  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  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
+ *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
+ *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
+ *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
+ *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
+ *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *  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.,
+ *  675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/ioport.h>
+#include <linux/mm.h>
+#include <linux/console.h>
+#include <linux/mc146818rtc.h>
+#include <linux/delay.h>
+
+#include <asm/cpu.h>
+#include <asm/bootinfo.h>
+#include <asm/irq.h>
+#include <asm/mipsregs.h>
+#include <asm/reboot.h>
+#include <asm/pgtable.h>
+
+#include <glb.h>
+
+/* CP0 hazard avoidance. */
+#define BARRIER __asm__ __volatile__(".set noreorder\n\t" \
+				     "nop; nop; nop; nop; nop; nop;\n\t" \
+				     ".set reorder\n\t")
+
+void __init board_setup(void)
+{
+	unsigned long config0, configpr;
+
+	config0 = read_c0_config();
+
+	/* clear all three cache coherency fields */
+	config0 &= ~(0x7 | (7<<25) | (7<<28));
+	config0 |= (CONF_CM_DEFAULT | (CONF_CM_DEFAULT<<25) |
+			(CONF_CM_DEFAULT<<28));
+	write_c0_config(config0);
+	BARRIER;
+
+	configpr = read_c0_config7();
+	configpr |= (1<<19); /* enable tlb */
+	write_c0_config7(configpr);
+	BARRIER;
+}
diff -urN linux.orig/arch/mips/nxp/pnx8550/jbs/init.c
linux/arch/mips/nxp/pnx8550/jbs/init.c
--- linux.orig/arch/mips/nxp/pnx8550/jbs/init.c	1970-01-01
01:00:00.000000000 +0100
+++ linux/arch/mips/nxp/pnx8550/jbs/init.c	2008-03-04 11:13:18.000000000 +0000
@@ -0,0 +1,53 @@
+/*
+ *
+ *  Copyright 2005 Embedded Alley Solutions, Inc
+ *  source@embeddedalley.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.
+ *
+ *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
+ *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
+ *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
+ *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
+ *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
+ *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *  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.,
+ *  675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/sched.h>
+#include <linux/bootmem.h>
+#include <asm/addrspace.h>
+#include <asm/bootinfo.h>
+#include <linux/string.h>
+#include <linux/kernel.h>
+
+int prom_argc;
+char **prom_argv, **prom_envp;
+extern void  __init prom_init_cmdline(void);
+extern char *prom_getenv(char *envname);
+
+const char *get_system_type(void)
+{
+	return "NXP PNX8550/JBS";
+}
+
+void __init prom_init(void)
+{
+	unsigned long memsize;
+
+	//memsize = 0x02800000; /* Trimedia uses memory above */
+	memsize = 0x08000000; /* Trimedia uses memory above */
+	add_memory_region(0, memsize, BOOT_MEM_RAM);
+}
diff -urN linux.orig/arch/mips/nxp/pnx8550/jbs/irqmap.c
linux/arch/mips/nxp/pnx8550/jbs/irqmap.c
--- linux.orig/arch/mips/nxp/pnx8550/jbs/irqmap.c	1970-01-01
01:00:00.000000000 +0100
+++ linux/arch/mips/nxp/pnx8550/jbs/irqmap.c	2008-03-04 11:13:18.000000000 +0000
@@ -0,0 +1,36 @@
+/*
+ *  NXP JBS board irqmap.
+ *
+ *  Copyright 2005 Embedded Alley Solutions, Inc
+ *  source@embeddealley.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.
+ *
+ *  THIS  SOFTWARE  IS PROVIDED	  ``AS	IS'' AND   ANY	EXPRESS OR IMPLIED
+ *  WARRANTIES,	  INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
+ *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
+ *  NO	EVENT  SHALL   THE AUTHOR  BE	 LIABLE FOR ANY	  DIRECT, INDIRECT,
+ *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *  NOT LIMITED	  TO, PROCUREMENT OF  SUBSTITUTE GOODS	OR SERVICES; LOSS OF
+ *  USE, DATA,	OR PROFITS; OR	BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ *  ANY THEORY OF LIABILITY, WHETHER IN	 CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *  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.,
+ *  675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/init.h>
+#include <int.h>
+
+char pnx8550_irq_tab[][5] __initdata = {
+	[8]	= { -1, PNX8550_INT_PCI_INTA, 0xff, 0xff, 0xff},
+	[9]	= { -1, PNX8550_INT_PCI_INTA, 0xff, 0xff, 0xff},
+	[17]	= { -1, PNX8550_INT_PCI_INTA, 0xff, 0xff, 0xff},
+};
+
diff -urN linux.orig/arch/mips/nxp/pnx8550/jbs/Makefile
linux/arch/mips/nxp/pnx8550/jbs/Makefile
--- linux.orig/arch/mips/nxp/pnx8550/jbs/Makefile	1970-01-01
01:00:00.000000000 +0100
+++ linux/arch/mips/nxp/pnx8550/jbs/Makefile	2008-03-04 11:13:18.000000000 +0000
@@ -0,0 +1,4 @@
+
+# Makefile for the NXP JBS Board.
+
+lib-y := init.o board_setup.o irqmap.o
diff -urN linux.orig/arch/mips/nxp/pnx8550/stb810/board_setup.c
linux/arch/mips/nxp/pnx8550/stb810/board_setup.c
--- linux.orig/arch/mips/nxp/pnx8550/stb810/board_setup.c	1970-01-01
01:00:00.000000000 +0100
+++ linux/arch/mips/nxp/pnx8550/stb810/board_setup.c	2008-03-04
11:13:18.000000000 +0000
@@ -0,0 +1,49 @@
+/*
+ *  STB810 specific board startup routines.
+ *
+ *  Based on the arch/mips/nxp/pnx8550/jbs/board_setup.c
+ *
+ *  Author: MontaVista Software, Inc.
+ *          source@mvista.com
+ *
+ *  Copyright 2005 MontaVista Software Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License as published by the
+ *  Free Software Foundation; either version 2 of the License, or (at your
+ *  option) any later version.
+ */
+
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/ioport.h>
+#include <linux/mm.h>
+#include <linux/console.h>
+#include <linux/mc146818rtc.h>
+#include <linux/delay.h>
+
+#include <asm/cpu.h>
+#include <asm/bootinfo.h>
+#include <asm/irq.h>
+#include <asm/mipsregs.h>
+#include <asm/reboot.h>
+#include <asm/pgtable.h>
+
+#include <glb.h>
+
+void __init board_setup(void)
+{
+	unsigned long config0, configpr;
+
+	config0 = read_c0_config();
+
+	/* clear all three cache coherency fields */
+	config0 &= ~(0x7 | (7<<25) | (7<<28));
+	config0 |= (CONF_CM_DEFAULT | (CONF_CM_DEFAULT<<25) |
+			(CONF_CM_DEFAULT<<28));
+	write_c0_config(config0);
+
+	configpr = read_c0_config7();
+	configpr |= (1<<19); /* enable tlb */
+	write_c0_config7(configpr);
+}
diff -urN linux.orig/arch/mips/nxp/pnx8550/stb810/irqmap.c
linux/arch/mips/nxp/pnx8550/stb810/irqmap.c
--- linux.orig/arch/mips/nxp/pnx8550/stb810/irqmap.c	1970-01-01
01:00:00.000000000 +0100
+++ linux/arch/mips/nxp/pnx8550/stb810/irqmap.c	2008-03-04
11:13:18.000000000 +0000
@@ -0,0 +1,23 @@
+/*
+ *  NXP STB810 board irqmap.
+ *
+ *  Author: MontaVista Software, Inc.
+ *          source@mvista.com
+ *
+ *  Copyright 2005 MontaVista Software Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License as published by the
+ *  Free Software Foundation; either version 2 of the License, or (at your
+ *  option) any later version.
+ */
+
+#include <linux/init.h>
+#include <int.h>
+
+char pnx8550_irq_tab[][5] __initdata = {
+	[8]	= { -1, PNX8550_INT_PCI_INTA, 0xff, 0xff, 0xff},
+	[9]	= { -1, PNX8550_INT_PCI_INTA, 0xff, 0xff, 0xff},
+	[10]	= { -1, PNX8550_INT_PCI_INTA, 0xff, 0xff, 0xff},
+};
+
diff -urN linux.orig/arch/mips/nxp/pnx8550/stb810/Makefile
linux/arch/mips/nxp/pnx8550/stb810/Makefile
--- linux.orig/arch/mips/nxp/pnx8550/stb810/Makefile	1970-01-01
01:00:00.000000000 +0100
+++ linux/arch/mips/nxp/pnx8550/stb810/Makefile	2008-03-04
11:13:18.000000000 +0000
@@ -0,0 +1,4 @@
+
+# Makefile for the NXP STB810 Board.
+
+lib-y := prom_init.o board_setup.o irqmap.o
diff -urN linux.orig/arch/mips/nxp/pnx8550/stb810/prom_init.c
linux/arch/mips/nxp/pnx8550/stb810/prom_init.c
--- linux.orig/arch/mips/nxp/pnx8550/stb810/prom_init.c	1970-01-01
01:00:00.000000000 +0100
+++ linux/arch/mips/nxp/pnx8550/stb810/prom_init.c	2008-03-04
11:13:18.000000000 +0000
@@ -0,0 +1,46 @@
+/*
+ *  STB810 specific prom routines
+ *
+ *  Author: MontaVista Software, Inc.
+ *          source@mvista.com
+ *
+ *  Copyright 2005 MontaVista Software Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License as published by the
+ *  Free Software Foundation; either version 2 of the License, or (at your
+ *  option) any later version.
+ */
+
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/sched.h>
+#include <linux/bootmem.h>
+#include <asm/addrspace.h>
+#include <asm/bootinfo.h>
+#include <linux/string.h>
+#include <linux/kernel.h>
+
+int prom_argc;
+char **prom_argv, **prom_envp;
+extern void  __init prom_init_cmdline(void);
+extern char *prom_getenv(char *envname);
+
+const char *get_system_type(void)
+{
+	return "NXP PNX8950/STB810";
+}
+
+void __init prom_init(void)
+{
+	unsigned long memsize;
+
+	prom_argc = (int) fw_arg0;
+	prom_argv = (char **) fw_arg1;
+	prom_envp = (char **) fw_arg2;
+
+	prom_init_cmdline();
+
+	memsize = 0x08000000; /* Trimedia uses memory above */
+	add_memory_region(0, memsize, BOOT_MEM_RAM);
+}
diff -urN linux.orig/arch/mips/philips/pnx8550/common/gdb_hook.c
linux/arch/mips/philips/pnx8550/common/gdb_hook.c
--- linux.orig/arch/mips/philips/pnx8550/common/gdb_hook.c	2008-03-04
11:08:00.000000000 +0000
+++ linux/arch/mips/philips/pnx8550/common/gdb_hook.c	1970-01-01
01:00:00.000000000 +0100
@@ -1,109 +0,0 @@
-/*
- * Carsten Langgaard, carstenl@mips.com
- * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
- *
- * ########################################################################
- *
- *  This program is free software; you can distribute it and/or modify it
- *  under the terms of the GNU General Public License (Version 2) as
- *  published by the Free Software Foundation.
- *
- *  This program is distributed in the hope 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.
- *
- * ########################################################################
- *
- * This is the interface to the remote debugger stub.
- *
- */
-#include <linux/types.h>
-#include <linux/serial.h>
-#include <linux/serialP.h>
-#include <linux/serial_reg.h>
-#include <linux/serial_ip3106.h>
-
-#include <asm/serial.h>
-#include <asm/io.h>
-
-#include <uart.h>
-
-static struct serial_state rs_table[IP3106_NR_PORTS] = {
-};
-static struct async_struct kdb_port_info = {0};
-
-void rs_kgdb_hook(int tty_no)
-{
-	struct serial_state *ser = &rs_table[tty_no];
-
-	kdb_port_info.state = ser;
-	kdb_port_info.magic = SERIAL_MAGIC;
-	kdb_port_info.port  = tty_no;
-	kdb_port_info.flags = ser->flags;
-
-	/*
-	 * Clear all interrupts
-	 */
-	/* Clear all the transmitter FIFO counters (pointer and status) */
-	ip3106_lcr(UART_BASE, tty_no) |= IP3106_UART_LCR_TX_RST;
-	/* Clear all the receiver FIFO counters (pointer and status) */
-	ip3106_lcr(UART_BASE, tty_no) |= IP3106_UART_LCR_RX_RST;
-	/* Clear all interrupts */
-	ip3106_iclr(UART_BASE, tty_no) = IP3106_UART_INT_ALLRX |
-		IP3106_UART_INT_ALLTX;
-
-	/*
-	 * Now, initialize the UART
-	 */
-	ip3106_lcr(UART_BASE, tty_no) = IP3106_UART_LCR_8BIT;
-	ip3106_baud(UART_BASE, tty_no) = 5; // 38400 Baud
-}
-
-int putDebugChar(char c)
-{
-	/* Wait until FIFO not full */
-	while (((ip3106_fifo(UART_BASE, kdb_port_info.port) &
IP3106_UART_FIFO_TXFIFO) >> 16) >= 16)
-		;
-	/* Send one char */
-	ip3106_fifo(UART_BASE, kdb_port_info.port) = c;
-
-	return 1;
-}
-
-char getDebugChar(void)
-{
-	char ch;
-
-	/* Wait until there is a char in the FIFO */
-	while (!((ip3106_fifo(UART_BASE, kdb_port_info.port) &
-					IP3106_UART_FIFO_RXFIFO) >> 8))
-		;
-	/* Read one char */
-	ch = ip3106_fifo(UART_BASE, kdb_port_info.port) &
-		IP3106_UART_FIFO_RBRTHR;
-	/* Advance the RX FIFO read pointer */
-	ip3106_lcr(UART_BASE, kdb_port_info.port) |= IP3106_UART_LCR_RX_NEXT;
-	return (ch);
-}
-
-void rs_disable_debug_interrupts(void)
-{
-	ip3106_ien(UART_BASE, kdb_port_info.port) = 0; /* Disable all interrupts */
-}
-
-void rs_enable_debug_interrupts(void)
-{
-	/* Clear all the transmitter FIFO counters (pointer and status) */
-	ip3106_lcr(UART_BASE, kdb_port_info.port) |= IP3106_UART_LCR_TX_RST;
-	/* Clear all the receiver FIFO counters (pointer and status) */
-	ip3106_lcr(UART_BASE, kdb_port_info.port) |= IP3106_UART_LCR_RX_RST;
-	/* Clear all interrupts */
-	ip3106_iclr(UART_BASE, kdb_port_info.port) = IP3106_UART_INT_ALLRX |
-		IP3106_UART_INT_ALLTX;
-	ip3106_ien(UART_BASE, kdb_port_info.port)  = IP3106_UART_INT_ALLRX;
/* Enable RX interrupts */
-}
diff -urN linux.orig/arch/mips/philips/pnx8550/common/int.c
linux/arch/mips/philips/pnx8550/common/int.c
--- linux.orig/arch/mips/philips/pnx8550/common/int.c	2008-03-04
11:08:00.000000000 +0000
+++ linux/arch/mips/philips/pnx8550/common/int.c	1970-01-01
01:00:00.000000000 +0100
@@ -1,238 +0,0 @@
-/*
- *
- * Copyright (C) 2005 Embedded Alley Solutions, Inc
- * Ported to 2.6.
- *
- * Per Hallsmark, per.hallsmark@mvista.com
- * Copyright (C) 2000, 2001 MIPS Technologies, Inc.
- * Copyright (C) 2001 Ralf Baechle
- *
- * Cleaned up and bug fixing: Pete Popov, ppopov@embeddedalley.com
- *
- *  This program is free software; you can distribute it and/or modify it
- *  under the terms of the GNU General Public License (Version 2) as
- *  published by the Free Software Foundation.
- *
- *  This program is distributed in the hope 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/compiler.h>
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/interrupt.h>
-#include <linux/kernel_stat.h>
-#include <linux/random.h>
-#include <linux/module.h>
-
-#include <asm/io.h>
-#include <asm/gdb-stub.h>
-#include <int.h>
-#include <uart.h>
-
-/* default prio for interrupts */
-/* first one is a no-no so therefore always prio 0 (disabled) */
-static char gic_prio[PNX8550_INT_GIC_TOTINT] = {
-	0, 1, 1, 1, 1, 15, 1, 1, 1, 1,	//   0 -  9
-	1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	//  10 - 19
-	1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	//  20 - 29
-	1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	//  30 - 39
-	1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	//  40 - 49
-	1, 1, 1, 1, 1, 1, 1, 1, 2, 1,	//  50 - 59
-	1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	//  60 - 69
-	1			//  70
-};
-
-static void hw0_irqdispatch(int irq)
-{
-	/* find out which interrupt */
-	irq = PNX8550_GIC_VECTOR_0 >> 3;
-
-	if (irq == 0) {
-		printk("hw0_irqdispatch: irq 0, spurious interrupt?\n");
-		return;
-	}
-	do_IRQ(PNX8550_INT_GIC_MIN + irq);
-}
-
-
-static void timer_irqdispatch(int irq)
-{
-	irq = (0x01c0 & read_c0_config7()) >> 6;
-
-	if (unlikely(irq == 0)) {
-		printk("timer_irqdispatch: irq 0, spurious interrupt?\n");
-		return;
-	}
-
-	if (irq & 0x1)
-		do_IRQ(PNX8550_INT_TIMER1);
-	if (irq & 0x2)
-		do_IRQ(PNX8550_INT_TIMER2);
-	if (irq & 0x4)
-		do_IRQ(PNX8550_INT_TIMER3);
-}
-
-asmlinkage void plat_irq_dispatch(void)
-{
-	unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
-
-	if (pending & STATUSF_IP2)
-		hw0_irqdispatch(2);
-	else if (pending & STATUSF_IP7) {
-		if (read_c0_config7() & 0x01c0)
-			timer_irqdispatch(7);
-	} else
-		spurious_interrupt();
-}
-
-static inline void modify_cp0_intmask(unsigned clr_mask, unsigned set_mask)
-{
-	unsigned long status = read_c0_status();
-
-	status &= ~((clr_mask & 0xFF) << 8);
-	status |= (set_mask & 0xFF) << 8;
-
-	write_c0_status(status);
-}
-
-static inline void mask_gic_int(unsigned int irq_nr)
-{
-	/* interrupt disabled, bit 26(WE_ENABLE)=1 and bit 16(enable)=0 */
-	PNX8550_GIC_REQ(irq_nr) = 1<<28; /* set priority to 0 */
-}
-
-static inline void unmask_gic_int(unsigned int irq_nr)
-{
-	/* set prio mask to lower four bits and enable interrupt */
-	PNX8550_GIC_REQ(irq_nr) = (1<<26 | 1<<16) | (1<<28) | gic_prio[irq_nr];
-}
-
-static inline void mask_irq(unsigned int irq_nr)
-{
-	if ((PNX8550_INT_CP0_MIN <= irq_nr) && (irq_nr <= PNX8550_INT_CP0_MAX)) {
-		modify_cp0_intmask(1 << irq_nr, 0);
-	} else if ((PNX8550_INT_GIC_MIN <= irq_nr) &&
-		(irq_nr <= PNX8550_INT_GIC_MAX)) {
-		mask_gic_int(irq_nr - PNX8550_INT_GIC_MIN);
-	} else if ((PNX8550_INT_TIMER_MIN <= irq_nr) &&
-		(irq_nr <= PNX8550_INT_TIMER_MAX)) {
-		modify_cp0_intmask(1 << 7, 0);
-	} else {
-		printk("mask_irq: irq %d doesn't exist!\n", irq_nr);
-	}
-}
-
-static inline void unmask_irq(unsigned int irq_nr)
-{
-	if ((PNX8550_INT_CP0_MIN <= irq_nr) && (irq_nr <= PNX8550_INT_CP0_MAX)) {
-		modify_cp0_intmask(0, 1 << irq_nr);
-	} else if ((PNX8550_INT_GIC_MIN <= irq_nr) &&
-		(irq_nr <= PNX8550_INT_GIC_MAX)) {
-		unmask_gic_int(irq_nr - PNX8550_INT_GIC_MIN);
-	} else if ((PNX8550_INT_TIMER_MIN <= irq_nr) &&
-		(irq_nr <= PNX8550_INT_TIMER_MAX)) {
-		modify_cp0_intmask(0, 1 << 7);
-	} else {
-		printk("mask_irq: irq %d doesn't exist!\n", irq_nr);
-	}
-}
-
-int pnx8550_set_gic_priority(int irq, int priority)
-{
-	int gic_irq = irq-PNX8550_INT_GIC_MIN;
-	int prev_priority = PNX8550_GIC_REQ(gic_irq) & 0xf;
-
-        gic_prio[gic_irq] = priority;
-	PNX8550_GIC_REQ(gic_irq) |= (0x10000000 | gic_prio[gic_irq]);
-
-	return prev_priority;
-}
-
-static struct irq_chip level_irq_type = {
-	.name =		"PNX Level IRQ",
-	.ack =		mask_irq,
-	.mask =		mask_irq,
-	.mask_ack =	mask_irq,
-	.unmask =	unmask_irq,
-};
-
-static struct irqaction gic_action = {
-	.handler =	no_action,
-	.flags =	IRQF_DISABLED,
-	.name =		"GIC",
-};
-
-static struct irqaction timer_action = {
-	.handler =	no_action,
-	.flags =	IRQF_DISABLED,
-	.name =		"Timer",
-};
-
-void __init arch_init_irq(void)
-{
-	int i;
-	int configPR;
-
-	for (i = 0; i < PNX8550_INT_CP0_TOTINT; i++) {
-		set_irq_chip_and_handler(i, &level_irq_type, handle_level_irq);
-		mask_irq(i);	/* mask the irq just in case  */
-	}
-
-	/* init of GIC/IPC interrupts */
-	/* should be done before cp0 since cp0 init enables the GIC int */
-	for (i = PNX8550_INT_GIC_MIN; i <= PNX8550_INT_GIC_MAX; i++) {
-		int gic_int_line = i - PNX8550_INT_GIC_MIN;
-		if (gic_int_line == 0 )
-			continue;	// don't fiddle with int 0
-		/*
-		 * enable change of TARGET, ENABLE and ACTIVE_LOW bits
-		 * set TARGET        0 to route through hw0 interrupt
-		 * set ACTIVE_LOW    0 active high  (correct?)
-		 *
-		 * We really should setup an interrupt description table
-		 * to do this nicely.
-		 * Note, PCI INTA is active low on the bus, but inverted
-		 * in the GIC, so to us it's active high.
-		 */
-		PNX8550_GIC_REQ(i - PNX8550_INT_GIC_MIN) = 0x1E000000;
-
-		/* mask/priority is still 0 so we will not get any
-		 * interrupts until it is unmasked */
-
-		set_irq_chip_and_handler(i, &level_irq_type, handle_level_irq);
-	}
-
-	/* Priority level 0 */
-	PNX8550_GIC_PRIMASK_0 = PNX8550_GIC_PRIMASK_1 = 0;
-
-	/* Set int vector table address */
-	PNX8550_GIC_VECTOR_0 = PNX8550_GIC_VECTOR_1 = 0;
-
-	set_irq_chip_and_handler(MIPS_CPU_GIC_IRQ, &level_irq_type,
-				 handle_level_irq);
-	setup_irq(MIPS_CPU_GIC_IRQ, &gic_action);
-
-	/* init of Timer interrupts */
-	for (i = PNX8550_INT_TIMER_MIN; i <= PNX8550_INT_TIMER_MAX; i++)
-		set_irq_chip_and_handler(i, &level_irq_type, handle_level_irq);
-
-	/* Stop Timer 1-3 */
-	configPR = read_c0_config7();
-	configPR |= 0x00000038;
-	write_c0_config7(configPR);
-
-	set_irq_chip_and_handler(MIPS_CPU_TIMER_IRQ, &level_irq_type,
-				 handle_level_irq);
-	setup_irq(MIPS_CPU_TIMER_IRQ, &timer_action);
-}
-
-EXPORT_SYMBOL(pnx8550_set_gic_priority);
diff -urN linux.orig/arch/mips/philips/pnx8550/common/Makefile
linux/arch/mips/philips/pnx8550/common/Makefile
--- linux.orig/arch/mips/philips/pnx8550/common/Makefile	2008-03-04
11:08:00.000000000 +0000
+++ linux/arch/mips/philips/pnx8550/common/Makefile	1970-01-01
01:00:00.000000000 +0100
@@ -1,29 +0,0 @@
-#
-# Per Hallsmark, per.hallsmark@mvista.com
-#
-# ########################################################################
-#
-# This program is free software; you can distribute it and/or modify it
-# under the terms of the GNU General Public License (Version 2) as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope 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.
-#
-# #######################################################################
-#
-# Makefile for the PNX8550 specific kernel interface routines
-# under Linux.
-#
-
-obj-y := setup.o prom.o int.o reset.o time.o proc.o platform.o
-obj-$(CONFIG_PCI) += pci.o
-obj-$(CONFIG_KGDB) += gdb_hook.o
-
-EXTRA_CFLAGS += -Werror
diff -urN linux.orig/arch/mips/philips/pnx8550/common/pci.c
linux/arch/mips/philips/pnx8550/common/pci.c
--- linux.orig/arch/mips/philips/pnx8550/common/pci.c	2008-03-04
11:08:00.000000000 +0000
+++ linux/arch/mips/philips/pnx8550/common/pci.c	1970-01-01
01:00:00.000000000 +0100
@@ -1,133 +0,0 @@
-/*
- *
- * BRIEF MODULE DESCRIPTION
- *
- * Author: source@mvista.com
- *
- *  This program is free software; you can distribute it and/or modify it
- *  under the terms of the GNU General Public License (Version 2) as
- *  published by the Free Software Foundation.
- *
- *  This program is distributed in the hope 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/types.h>
-#include <linux/pci.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-
-#include <pci.h>
-#include <glb.h>
-#include <nand.h>
-
-static struct resource pci_io_resource = {
-	.start	= PNX8550_PCIIO + 0x1000,	/* reserve regacy I/O space */
-	.end	= PNX8550_PCIIO + PNX8550_PCIIO_SIZE,
-	.name	= "pci IO space",
-	.flags	= IORESOURCE_IO
-};
-
-static struct resource pci_mem_resource = {
-	.start	= PNX8550_PCIMEM,
-	.end	= PNX8550_PCIMEM + PNX8550_PCIMEM_SIZE - 1,
-	.name	= "pci memory space",
-	.flags	= IORESOURCE_MEM
-};
-
-extern struct pci_ops pnx8550_pci_ops;
-
-static struct pci_controller pnx8550_controller = {
-	.pci_ops	= &pnx8550_pci_ops,
-	.io_resource	= &pci_io_resource,
-	.mem_resource	= &pci_mem_resource,
-};
-
-/* Return the total size of DRAM-memory, (RANK0 + RANK1) */
-static inline unsigned long get_system_mem_size(void)
-{
-	/* Read IP2031_RANK0_ADDR_LO */
-	unsigned long dram_r0_lo = inl(PCI_BASE | 0x65010);
-	/* Read IP2031_RANK1_ADDR_HI */
-	unsigned long dram_r1_hi = inl(PCI_BASE | 0x65018);
-
-	return dram_r1_hi - dram_r0_lo + 1;
-}
-
-static int __init pnx8550_pci_setup(void)
-{
-	int pci_mem_code;
-	int mem_size = get_system_mem_size() >> 20;
-
-	/* Clear the Global 2 Register, PCI Inta Output Enable Registers
-	   Bit 1:Enable DAC Powerdown
-	  -> 0:DACs are enabled and are working normally
-	     1:DACs are powerdown
-	   Bit 0:Enable of PCI inta output
-	  -> 0 = Disable PCI inta output
-	     1 = Enable PCI inta output
-	*/
-	PNX8550_GLB2_ENAB_INTA_O = 0;
-
-	/* Calc the PCI mem size code */
-	if (mem_size >= 128)
-		pci_mem_code = SIZE_128M;
-	else if (mem_size >= 64)
-		pci_mem_code = SIZE_64M;
-	else if (mem_size >= 32)
-		pci_mem_code = SIZE_32M;
-	else
-		pci_mem_code = SIZE_16M;
-
-	/* Set PCI_XIO registers */
-	outl(pci_mem_resource.start, PCI_BASE | PCI_BASE1_LO);
-	outl(pci_mem_resource.end + 1, PCI_BASE | PCI_BASE1_HI);
-	outl(pci_io_resource.start, PCI_BASE | PCI_BASE2_LO);
-	outl(pci_io_resource.end, PCI_BASE | PCI_BASE2_HI);
-
-	/* Send memory transaction via PCI_BASE2 */
-	outl(0x00000001, PCI_BASE | PCI_IO);
-
-	/* Unlock the setup register */
-	outl(0xca, PCI_BASE | PCI_UNLOCKREG);
-
-	/*
-	 * BAR0 of PNX8550 (pci base 10) must be zero in order for ide
-	 * to work, and in order for bus_to_baddr to work without any
-	 * hacks.
-	 */
-	outl(0x00000000, PCI_BASE | PCI_BASE10);
-
-	/*
-	 *These two bars are set by default or the boot code.
-	 * However, it's safer to set them here so we're not boot
-	 * code dependent.
-	 */
-	outl(0x1be00000, PCI_BASE | PCI_BASE14);  /* PNX MMIO */
-	outl(PNX8550_NAND_BASE_ADDR, PCI_BASE | PCI_BASE18);  /* XIO      */
-
-	outl(PCI_EN_TA |
-	     PCI_EN_PCI2MMI |
-	     PCI_EN_XIO |
-	     PCI_SETUP_BASE18_SIZE(SIZE_32M) |
-	     PCI_SETUP_BASE18_EN |
-	     PCI_SETUP_BASE14_EN |
-	     PCI_SETUP_BASE10_PREF |
-	     PCI_SETUP_BASE10_SIZE(pci_mem_code) |
-	     PCI_SETUP_CFGMANAGE_EN |
-	     PCI_SETUP_PCIARB_EN,
-	     PCI_BASE |
-	     PCI_SETUP);	/* PCI_SETUP */
-	outl(0x00000000, PCI_BASE | PCI_CTRL);	/* PCI_CONTROL */
-
-	register_pci_controller(&pnx8550_controller);
-
-	return 0;
-}
-
-arch_initcall(pnx8550_pci_setup);
diff -urN linux.orig/arch/mips/philips/pnx8550/common/platform.c
linux/arch/mips/philips/pnx8550/common/platform.c
--- linux.orig/arch/mips/philips/pnx8550/common/platform.c	2008-03-04
11:08:00.000000000 +0000
+++ linux/arch/mips/philips/pnx8550/common/platform.c	1970-01-01
01:00:00.000000000 +0100
@@ -1,132 +0,0 @@
-/*
- * Platform device support for Philips PNX8550 SoCs
- *
- * Copyright 2005, Embedded Alley Solutions, Inc
- *
- * Based on arch/mips/au1000/common/platform.c
- * Platform device support for Au1x00 SoCs.
- *
- * Copyright 2004, Matt Porter <mporter@kernel.crashing.org>
- *
- * 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/device.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/resource.h>
-#include <linux/serial.h>
-#include <linux/serial_pnx8xxx.h>
-#include <linux/platform_device.h>
-
-#include <int.h>
-#include <usb.h>
-#include <uart.h>
-
-static struct resource pnx8550_usb_ohci_resources[] = {
-	[0] = {
-		.start		= PNX8550_USB_OHCI_OP_BASE,
-		.end		= PNX8550_USB_OHCI_OP_BASE +
-				  PNX8550_USB_OHCI_OP_LEN,
-		.flags		= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start		= PNX8550_INT_USB,
-		.end		= PNX8550_INT_USB,
-		.flags		= IORESOURCE_IRQ,
-	},
-};
-
-static struct resource pnx8550_uart_resources[] = {
-	[0] = {
-		.start		= PNX8550_UART_PORT0,
-		.end		= PNX8550_UART_PORT0 + 0xfff,
-		.flags		= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start		= PNX8550_UART_INT(0),
-		.end		= PNX8550_UART_INT(0),
-		.flags		= IORESOURCE_IRQ,
-	},
-	[2] = {
-		.start		= PNX8550_UART_PORT1,
-		.end		= PNX8550_UART_PORT1 + 0xfff,
-		.flags		= IORESOURCE_MEM,
-	},
-	[3] = {
-		.start		= PNX8550_UART_INT(1),
-		.end		= PNX8550_UART_INT(1),
-		.flags		= IORESOURCE_IRQ,
-	},
-};
-
-struct pnx8xxx_port pnx8xxx_ports[] = {
-	[0] = {
-		.port   = {
-			.type		= PORT_PNX8XXX,
-			.iotype		= UPIO_MEM,
-			.membase	= (void __iomem *)PNX8550_UART_PORT0,
-			.mapbase	= PNX8550_UART_PORT0,
-			.irq		= PNX8550_UART_INT(0),
-			.uartclk	= 3692300,
-			.fifosize	= 16,
-			.flags		= UPF_BOOT_AUTOCONF,
-			.line		= 0,
-		},
-	},
-	[1] = {
-		.port   = {
-			.type		= PORT_PNX8XXX,
-			.iotype		= UPIO_MEM,
-			.membase	= (void __iomem *)PNX8550_UART_PORT1,
-			.mapbase	= PNX8550_UART_PORT1,
-			.irq		= PNX8550_UART_INT(1),
-			.uartclk	= 3692300,
-			.fifosize	= 16,
-			.flags		= UPF_BOOT_AUTOCONF,
-			.line		= 1,
-		},
-	},
-};
-
-/* The dmamask must be set for OHCI to work */
-static u64 ohci_dmamask = ~(u32)0;
-
-static u64 uart_dmamask = ~(u32)0;
-
-static struct platform_device pnx8550_usb_ohci_device = {
-	.name		= "pnx8550-ohci",
-	.id		= -1,
-	.dev = {
-		.dma_mask		= &ohci_dmamask,
-		.coherent_dma_mask	= 0xffffffff,
-	},
-	.num_resources	= ARRAY_SIZE(pnx8550_usb_ohci_resources),
-	.resource	= pnx8550_usb_ohci_resources,
-};
-
-static struct platform_device pnx8550_uart_device = {
-	.name		= "pnx8xxx-uart",
-	.id		= -1,
-	.dev = {
-		.dma_mask		= &uart_dmamask,
-		.coherent_dma_mask	= 0xffffffff,
-		.platform_data = pnx8xxx_ports,
-	},
-	.num_resources	= ARRAY_SIZE(pnx8550_uart_resources),
-	.resource	= pnx8550_uart_resources,
-};
-
-static struct platform_device *pnx8550_platform_devices[] __initdata = {
-	&pnx8550_usb_ohci_device,
-	&pnx8550_uart_device,
-};
-
-static int __init pnx8550_platform_init(void)
-{
-	return platform_add_devices(pnx8550_platform_devices,
-			            ARRAY_SIZE(pnx8550_platform_devices));
-}
-
-arch_initcall(pnx8550_platform_init);
diff -urN linux.orig/arch/mips/philips/pnx8550/common/proc.c
linux/arch/mips/philips/pnx8550/common/proc.c
--- linux.orig/arch/mips/philips/pnx8550/common/proc.c	2008-03-04
11:08:00.000000000 +0000
+++ linux/arch/mips/philips/pnx8550/common/proc.c	1970-01-01
01:00:00.000000000 +0100
@@ -1,112 +0,0 @@
-/*
- *  This program is free software; you can distribute it and/or modify it
- *  under the terms of the GNU General Public License (Version 2) as
- *  published by the Free Software Foundation.
- *
- *  This program is distributed in the hope 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/proc_fs.h>
-#include <linux/irq.h>
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/interrupt.h>
-#include <linux/kernel_stat.h>
-#include <linux/random.h>
-
-#include <asm/io.h>
-#include <asm/gdb-stub.h>
-#include <int.h>
-#include <uart.h>
-
-
-static int pnx8550_timers_read(char* page, char** start, off_t
offset, int count, int* eof, void* data)
-{
-        int len = 0;
-	int configPR = read_c0_config7();
-
-        if (offset==0) {
-		len += sprintf(&page[len], "Timer:       count,  compare, tc, status\n");
-                len += sprintf(&page[len], "    1: %11i, %8i,  %1i, %s\n",
-			       read_c0_count(), read_c0_compare(),
-			      (configPR>>6)&0x1, ((configPR>>3)&0x1)? "off":"on");
-                len += sprintf(&page[len], "    2: %11i, %8i,  %1i, %s\n",
-			       read_c0_count2(), read_c0_compare2(),
-			      (configPR>>7)&0x1, ((configPR>>4)&0x1)? "off":"on");
-                len += sprintf(&page[len], "    3: %11i, %8i,  %1i, %s\n",
-			       read_c0_count3(), read_c0_compare3(),
-			      (configPR>>8)&0x1, ((configPR>>5)&0x1)? "off":"on");
-        }
-
-        return len;
-}
-
-static int pnx8550_registers_read(char* page, char** start, off_t
offset, int count, int* eof, void* data)
-{
-        int len = 0;
-
-        if (offset==0) {
-                len += sprintf(&page[len], "config1:   %#10.8x\n",
read_c0_config1());
-                len += sprintf(&page[len], "config2:   %#10.8x\n",
read_c0_config2());
-                len += sprintf(&page[len], "config3:   %#10.8x\n",
read_c0_config3());
-                len += sprintf(&page[len], "configPR:  %#10.8x\n",
read_c0_config7());
-                len += sprintf(&page[len], "status:    %#10.8x\n",
read_c0_status());
-                len += sprintf(&page[len], "cause:     %#10.8x\n",
read_c0_cause());
-                len += sprintf(&page[len], "count:     %#10.8x\n",
read_c0_count());
-                len += sprintf(&page[len], "count_2:   %#10.8x\n",
read_c0_count2());
-                len += sprintf(&page[len], "count_3:   %#10.8x\n",
read_c0_count3());
-                len += sprintf(&page[len], "compare:   %#10.8x\n",
read_c0_compare());
-                len += sprintf(&page[len], "compare_2: %#10.8x\n",
read_c0_compare2());
-                len += sprintf(&page[len], "compare_3: %#10.8x\n",
read_c0_compare3());
-        }
-
-        return len;
-}
-
-static struct proc_dir_entry* pnx8550_dir        = NULL;
-static struct proc_dir_entry* pnx8550_timers     = NULL;
-static struct proc_dir_entry* pnx8550_registers  = NULL;
-
-static int pnx8550_proc_init( void )
-{
-
-	// Create /proc/pnx8550
-        pnx8550_dir = proc_mkdir("pnx8550", NULL);
-        if (!pnx8550_dir) {
-                printk(KERN_ERR "Can't create pnx8550 proc dir\n");
-                return -1;
-        }
-
-	// Create /proc/pnx8550/timers
-        pnx8550_timers = create_proc_read_entry(
-		"timers",
-		0,
-		pnx8550_dir,
-		pnx8550_timers_read,
-		NULL);
-
-        if (!pnx8550_timers)
-                printk(KERN_ERR "Can't create pnx8550 timers proc file\n");
-
-	// Create /proc/pnx8550/registers
-        pnx8550_registers = create_proc_read_entry(
-		"registers",
-		0,
-		pnx8550_dir,
-		pnx8550_registers_read,
-		NULL);
-
-        if (!pnx8550_registers)
-                printk(KERN_ERR "Can't create pnx8550 registers proc file\n");
-
-	return 0;
-}
-
-__initcall(pnx8550_proc_init);
diff -urN linux.orig/arch/mips/philips/pnx8550/common/prom.c
linux/arch/mips/philips/pnx8550/common/prom.c
--- linux.orig/arch/mips/philips/pnx8550/common/prom.c	2008-03-04
11:08:00.000000000 +0000
+++ linux/arch/mips/philips/pnx8550/common/prom.c	1970-01-01
01:00:00.000000000 +0100
@@ -1,129 +0,0 @@
-/*
- *
- * Per Hallsmark, per.hallsmark@mvista.com
- *
- * Based on jmr3927/common/prom.c
- *
- * 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.
- */
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/string.h>
-#include <linux/serial_pnx8xxx.h>
-
-#include <asm/bootinfo.h>
-#include <uart.h>
-
-/* #define DEBUG_CMDLINE */
-
-extern int prom_argc;
-extern char **prom_argv, **prom_envp;
-
-typedef struct
-{
-    char *name;
-/*    char *val; */
-}t_env_var;
-
-
-char * prom_getcmdline(void)
-{
-	return &(arcs_cmdline[0]);
-}
-
-void __init prom_init_cmdline(void)
-{
-	int i;
-
-	arcs_cmdline[0] = '\0';
-	for (i = 0; i < prom_argc; i++) {
-		strcat(arcs_cmdline, prom_argv[i]);
-		strcat(arcs_cmdline, " ");
-	}
-}
-
-char *prom_getenv(char *envname)
-{
-	/*
-	 * Return a pointer to the given environment variable.
-	 * Environment variables are stored in the form of "memsize=64".
-	 */
-
-	t_env_var *env = (t_env_var *)prom_envp;
-	int i;
-
-	i = strlen(envname);
-
-	while(env->name) {
-		if(strncmp(envname, env->name, i) == 0) {
-			return(env->name + strlen(envname) + 1);
-		}
-		env++;
-	}
-	return(NULL);
-}
-
-inline unsigned char str2hexnum(unsigned char c)
-{
-	if(c >= '0' && c <= '9')
-		return c - '0';
-	if(c >= 'a' && c <= 'f')
-		return c - 'a' + 10;
-	if(c >= 'A' && c <= 'F')
-		return c - 'A' + 10;
-	return 0; /* foo */
-}
-
-inline void str2eaddr(unsigned char *ea, unsigned char *str)
-{
-	int i;
-
-	for(i = 0; i < 6; i++) {
-		unsigned char num;
-
-		if((*str == '.') || (*str == ':'))
-			str++;
-		num = str2hexnum(*str++) << 4;
-		num |= (str2hexnum(*str++));
-		ea[i] = num;
-	}
-}
-
-int get_ethernet_addr(char *ethernet_addr)
-{
-        char *ethaddr_str;
-
-        ethaddr_str = prom_getenv("ethaddr");
-	if (!ethaddr_str) {
-	        printk("ethaddr not set in boot prom\n");
-		return -1;
-	}
-	str2eaddr(ethernet_addr, ethaddr_str);
-	return 0;
-}
-
-void __init prom_free_prom_memory(void)
-{
-}
-
-extern int pnx8550_console_port;
-
-/* used by early printk */
-void prom_putchar(char c)
-{
-	if (pnx8550_console_port != -1) {
-		/* Wait until FIFO not full */
-		while( ((ip3106_fifo(UART_BASE, pnx8550_console_port) &
PNX8XXX_UART_FIFO_TXFIFO) >> 16) >= 16)
-			;
-		/* Send one char */
-		ip3106_fifo(UART_BASE, pnx8550_console_port) = c;
-	}
-}
-
-EXPORT_SYMBOL(prom_getcmdline);
-EXPORT_SYMBOL(get_ethernet_addr);
-EXPORT_SYMBOL(str2eaddr);
diff -urN linux.orig/arch/mips/philips/pnx8550/common/reset.c
linux/arch/mips/philips/pnx8550/common/reset.c
--- linux.orig/arch/mips/philips/pnx8550/common/reset.c	2008-03-04
11:08:00.000000000 +0000
+++ linux/arch/mips/philips/pnx8550/common/reset.c	1970-01-01
01:00:00.000000000 +0100
@@ -1,49 +0,0 @@
-/*.
- *
- * ########################################################################
- *
- *  This program is free software; you can distribute it and/or modify it
- *  under the terms of the GNU General Public License (Version 2) as
- *  published by the Free Software Foundation.
- *
- *  This program is distributed in the hope 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.
- *
- * ########################################################################
- *
- * Reset the PNX8550 board.
- *
- */
-#include <linux/slab.h>
-#include <asm/reboot.h>
-#include <glb.h>
-
-void pnx8550_machine_restart(char *command)
-{
-	char head[] = "************* Machine restart *************";
-	char foot[] = "*******************************************";
-
-	printk("\n\n");
-	printk("%s\n", head);
-	if (command != NULL)
-		printk("* %s\n", command);
-	printk("%s\n", foot);
-
-	PNX8550_RST_CTL = PNX8550_RST_DO_SW_RST;
-}
-
-void pnx8550_machine_halt(void)
-{
-	printk("*** Machine halt. (Not implemented) ***\n");
-}
-
-void pnx8550_machine_power_off(void)
-{
-	printk("*** Machine power off.  (Not implemented) ***\n");
-}
diff -urN linux.orig/arch/mips/philips/pnx8550/common/setup.c
linux/arch/mips/philips/pnx8550/common/setup.c
--- linux.orig/arch/mips/philips/pnx8550/common/setup.c	2008-03-04
11:08:00.000000000 +0000
+++ linux/arch/mips/philips/pnx8550/common/setup.c	1970-01-01
01:00:00.000000000 +0100
@@ -1,157 +0,0 @@
-/*
- *
- * 2.6 port, Embedded Alley Solutions, Inc
- *
- *  Based on Per Hallsmark, per.hallsmark@mvista.com
- *
- *  This program is free software; you can distribute it and/or modify it
- *  under the terms of the GNU General Public License (Version 2) as
- *  published by the Free Software Foundation.
- *
- *  This program is distributed in the hope 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/sched.h>
-#include <linux/ioport.h>
-#include <linux/irq.h>
-#include <linux/mm.h>
-#include <linux/delay.h>
-#include <linux/interrupt.h>
-#include <linux/serial_pnx8xxx.h>
-#include <linux/pm.h>
-
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
-#include <asm/time.h>
-
-#include <glb.h>
-#include <int.h>
-#include <pci.h>
-#include <uart.h>
-#include <nand.h>
-
-extern void __init board_setup(void);
-extern void pnx8550_machine_restart(char *);
-extern void pnx8550_machine_halt(void);
-extern void pnx8550_machine_power_off(void);
-extern struct resource ioport_resource;
-extern struct resource iomem_resource;
-extern void rs_kgdb_hook(int tty_no);
-extern char *prom_getcmdline(void);
-
-struct resource standard_io_resources[] = {
-	{
-		.start	= 0x00,
-		.end	= 0x1f,
-		.name	= "dma1",
-		.flags	= IORESOURCE_BUSY
-	}, {
-		.start	= 0x40,
-		.end	= 0x5f,
-		.name	= "timer",
-		.flags	= IORESOURCE_BUSY
-	}, {
-		.start	= 0x80,
-		.end	= 0x8f,
-		.name	= "dma page reg",
-		.flags	= IORESOURCE_BUSY
-	}, {
-		.start	= 0xc0,
-		.end	= 0xdf,
-		.name	= "dma2",
-		.flags	= IORESOURCE_BUSY
-	},
-};
-
-#define STANDARD_IO_RESOURCES ARRAY_SIZE(standard_io_resources)
-
-extern struct resource pci_io_resource;
-extern struct resource pci_mem_resource;
-
-/* Return the total size of DRAM-memory, (RANK0 + RANK1) */
-unsigned long get_system_mem_size(void)
-{
-	/* Read IP2031_RANK0_ADDR_LO */
-	unsigned long dram_r0_lo = inl(PCI_BASE | 0x65010);
-	/* Read IP2031_RANK1_ADDR_HI */
-	unsigned long dram_r1_hi = inl(PCI_BASE | 0x65018);
-
-	return dram_r1_hi - dram_r0_lo + 1;
-}
-
-int pnx8550_console_port = -1;
-
-void __init plat_mem_setup(void)
-{
-	int i;
-	char* argptr;
-
-	board_setup();  /* board specific setup */
-
-        _machine_restart = pnx8550_machine_restart;
-        _machine_halt = pnx8550_machine_halt;
-        pm_power_off = pnx8550_machine_power_off;
-
-	/* Clear the Global 2 Register, PCI Inta Output Enable Registers
-	   Bit 1:Enable DAC Powerdown
-	  -> 0:DACs are enabled and are working normally
-	     1:DACs are powerdown
-	   Bit 0:Enable of PCI inta output
-	  -> 0 = Disable PCI inta output
-	     1 = Enable PCI inta output
-	*/
-	PNX8550_GLB2_ENAB_INTA_O = 0;
-
-	/* IO/MEM resources. */
-	set_io_port_base(KSEG1);
-	ioport_resource.start = 0;
-	ioport_resource.end = ~0;
-	iomem_resource.start = 0;
-	iomem_resource.end = ~0;
-
-	/* Request I/O space for devices on this board */
-	for (i = 0; i < STANDARD_IO_RESOURCES; i++)
-		request_resource(&ioport_resource, standard_io_resources + i);
-
-	/* Place the Mode Control bit for GPIO pin 16 in primary function */
-	/* Pin 16 is used by UART1, UA1_TX                                */
-	outl((PNX8550_GPIO_MODE_PRIMOP << PNX8550_GPIO_MC_16_BIT) |
-			(PNX8550_GPIO_MODE_PRIMOP << PNX8550_GPIO_MC_17_BIT),
-			PNX8550_GPIO_MC1);
-
-	argptr = prom_getcmdline();
-	if ((argptr = strstr(argptr, "console=ttyS")) != NULL) {
-		argptr += strlen("console=ttyS");
-		pnx8550_console_port = *argptr == '0' ? 0 : 1;
-
-		/* We must initialize the UART (console) before early printk */
-		/* Set LCR to 8-bit and BAUD to 38400 (no 5)                */
-		ip3106_lcr(UART_BASE, pnx8550_console_port) =
-			PNX8XXX_UART_LCR_8BIT;
-		ip3106_baud(UART_BASE, pnx8550_console_port) = 5;
-	}
-
-#ifdef CONFIG_KGDB
-	argptr = prom_getcmdline();
-	if ((argptr = strstr(argptr, "kgdb=ttyS")) != NULL) {
-		int line;
-		argptr += strlen("kgdb=ttyS");
-		line = *argptr == '0' ? 0 : 1;
-		rs_kgdb_hook(line);
-		pr_info("KGDB: Using ttyS%i for session, "
-		        "please connect your debugger\n", line ? 1 : 0);
-	}
-#endif
-	return;
-}
diff -urN linux.orig/arch/mips/philips/pnx8550/common/time.c
linux/arch/mips/philips/pnx8550/common/time.c
--- linux.orig/arch/mips/philips/pnx8550/common/time.c	2008-03-04
11:08:00.000000000 +0000
+++ linux/arch/mips/philips/pnx8550/common/time.c	1970-01-01
01:00:00.000000000 +0100
@@ -1,150 +0,0 @@
-/*
- * Copyright 2001, 2002, 2003 MontaVista Software Inc.
- * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
- * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org)
- *
- * Common time service routines for MIPS machines. See
- * Documents/MIPS/README.txt.
- *
- * This program is free software; you can redistribute  it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
- */
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/param.h>
-#include <linux/time.h>
-#include <linux/timer.h>
-#include <linux/smp.h>
-#include <linux/kernel_stat.h>
-#include <linux/spinlock.h>
-#include <linux/interrupt.h>
-
-#include <asm/bootinfo.h>
-#include <asm/cpu.h>
-#include <asm/time.h>
-#include <asm/hardirq.h>
-#include <asm/div64.h>
-#include <asm/debug.h>
-
-#include <int.h>
-#include <cm.h>
-
-static unsigned long cpj;
-
-static cycle_t hpt_read(void)
-{
-	return read_c0_count2();
-}
-
-static struct clocksource pnx_clocksource = {
-	.name		= "pnx8xxx",
-	.rating		= 200,
-	.read		= hpt_read,
-	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
-};
-
-static irqreturn_t pnx8xxx_timer_interrupt(int irq, void *dev_id)
-{
-	struct clock_event_device *c = dev_id;
-
-	/* clear MATCH, signal the event */
-	c->event_handler(c);
-
-	return IRQ_HANDLED;
-}
-
-static struct irqaction pnx8xxx_timer_irq = {
-	.handler	= pnx8xxx_timer_interrupt,
-	.flags		= IRQF_DISABLED | IRQF_PERCPU,
-	.name		= "pnx8xxx_timer",
-};
-
-static irqreturn_t monotonic_interrupt(int irq, void *dev_id)
-{
-	/* Timer 2 clear interrupt */
-	write_c0_compare2(-1);
-	return IRQ_HANDLED;
-}
-
-static struct irqaction monotonic_irqaction = {
-	.handler = monotonic_interrupt,
-	.flags = IRQF_DISABLED,
-	.name = "Monotonic timer",
-};
-
-static int pnx8xxx_set_next_event(unsigned long delta,
-				struct clock_event_device *evt)
-{
-	write_c0_compare(delta);
-	return 0;
-}
-
-static struct clock_event_device pnx8xxx_clockevent = {
-	.name		= "pnx8xxx_clockevent",
-	.features	= CLOCK_EVT_FEAT_ONESHOT,
-	.set_next_event = pnx8xxx_set_next_event,
-};
-
-static inline void timer_ack(void)
-{
-	write_c0_compare(cpj);
-}
-
-__init void plat_time_init(void)
-{
-	unsigned int configPR;
-	unsigned int n;
-	unsigned int m;
-	unsigned int p;
-	unsigned int pow2p;
-
-	clockevents_register_device(&pnx8xxx_clockevent);
-	clocksource_register(&pnx_clocksource);
-
-	/* Timer 1 start */
-	configPR = read_c0_config7();
-	configPR &= ~0x00000008;
-	write_c0_config7(configPR);
-
-	/* Timer 2 start */
-	configPR = read_c0_config7();
-	configPR &= ~0x00000010;
-	write_c0_config7(configPR);
-
-	/* Timer 3 stop */
-	configPR = read_c0_config7();
-	configPR |= 0x00000020;
-	write_c0_config7(configPR);
-
-
-        /* PLL0 sets MIPS clock (PLL1 <=> TM1, PLL6 <=> TM2, PLL5 <=> mem) */
-        /* (but only if CLK_MIPS_CTL select value [bits 3:1] is 1:  FIXME) */
-
-        n = (PNX8550_CM_PLL0_CTL & PNX8550_CM_PLL_N_MASK) >> 16;
-        m = (PNX8550_CM_PLL0_CTL & PNX8550_CM_PLL_M_MASK) >> 8;
-        p = (PNX8550_CM_PLL0_CTL & PNX8550_CM_PLL_P_MASK) >> 2;
-	pow2p = (1 << p);
-
-	db_assert(m != 0 && pow2p != 0);
-
-        /*
-	 * Compute the frequency as in the PNX8550 User Manual 1.0, p.186
-	 * (a.k.a. 8-10).  Divide by HZ for a timer offset that results in
-	 * HZ timer interrupts per second.
-	 */
-	mips_hpt_frequency = 27UL * ((1000000UL * n)/(m * pow2p));
-	cpj = (mips_hpt_frequency + HZ / 2) / HZ;
-	write_c0_count(0);
-	timer_ack();
-
-	/* Setup Timer 2 */
-	write_c0_count2(0);
-	write_c0_compare2(0xffffffff);
-
-	setup_irq(PNX8550_INT_TIMER1, &pnx8xxx_timer_irq);
-	setup_irq(PNX8550_INT_TIMER2, &monotonic_irqaction);
-}
diff -urN linux.orig/arch/mips/philips/pnx8550/jbs/board_setup.c
linux/arch/mips/philips/pnx8550/jbs/board_setup.c
--- linux.orig/arch/mips/philips/pnx8550/jbs/board_setup.c	2008-03-04
11:08:00.000000000 +0000
+++ linux/arch/mips/philips/pnx8550/jbs/board_setup.c	1970-01-01
01:00:00.000000000 +0100
@@ -1,65 +0,0 @@
-/*
- *  JBS Specific board startup routines.
- *
- *  Copyright 2005, Embedded Alley Solutions, Inc
- *
- *  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  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
- *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
- *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  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.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
-#include <linux/mc146818rtc.h>
-#include <linux/delay.h>
-
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
-
-#include <glb.h>
-
-/* CP0 hazard avoidance. */
-#define BARRIER __asm__ __volatile__(".set noreorder\n\t" \
-				     "nop; nop; nop; nop; nop; nop;\n\t" \
-				     ".set reorder\n\t")
-
-void __init board_setup(void)
-{
-	unsigned long config0, configpr;
-
-	config0 = read_c0_config();
-
-	/* clear all three cache coherency fields */
-	config0 &= ~(0x7 | (7<<25) | (7<<28));
-	config0 |= (CONF_CM_DEFAULT | (CONF_CM_DEFAULT<<25) |
-			(CONF_CM_DEFAULT<<28));
-	write_c0_config(config0);
-	BARRIER;
-
-	configpr = read_c0_config7();
-	configpr |= (1<<19); /* enable tlb */
-	write_c0_config7(configpr);
-	BARRIER;
-}
diff -urN linux.orig/arch/mips/philips/pnx8550/jbs/init.c
linux/arch/mips/philips/pnx8550/jbs/init.c
--- linux.orig/arch/mips/philips/pnx8550/jbs/init.c	2008-03-04
11:08:00.000000000 +0000
+++ linux/arch/mips/philips/pnx8550/jbs/init.c	1970-01-01
01:00:00.000000000 +0100
@@ -1,53 +0,0 @@
-/*
- *
- *  Copyright 2005 Embedded Alley Solutions, Inc
- *  source@embeddedalley.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.
- *
- *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
- *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
- *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  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.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <asm/addrspace.h>
-#include <asm/bootinfo.h>
-#include <linux/string.h>
-#include <linux/kernel.h>
-
-int prom_argc;
-char **prom_argv, **prom_envp;
-extern void  __init prom_init_cmdline(void);
-extern char *prom_getenv(char *envname);
-
-const char *get_system_type(void)
-{
-	return "Philips PNX8550/JBS";
-}
-
-void __init prom_init(void)
-{
-	unsigned long memsize;
-
-	//memsize = 0x02800000; /* Trimedia uses memory above */
-	memsize = 0x08000000; /* Trimedia uses memory above */
-	add_memory_region(0, memsize, BOOT_MEM_RAM);
-}
diff -urN linux.orig/arch/mips/philips/pnx8550/jbs/irqmap.c
linux/arch/mips/philips/pnx8550/jbs/irqmap.c
--- linux.orig/arch/mips/philips/pnx8550/jbs/irqmap.c	2008-03-04
11:08:00.000000000 +0000
+++ linux/arch/mips/philips/pnx8550/jbs/irqmap.c	1970-01-01
01:00:00.000000000 +0100
@@ -1,36 +0,0 @@
-/*
- *  Philips JBS board irqmap.
- *
- *  Copyright 2005 Embedded Alley Solutions, Inc
- *  source@embeddealley.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.
- *
- *  THIS  SOFTWARE  IS PROVIDED	  ``AS	IS'' AND   ANY	EXPRESS OR IMPLIED
- *  WARRANTIES,	  INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- *  NO	EVENT  SHALL   THE AUTHOR  BE	 LIABLE FOR ANY	  DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED	  TO, PROCUREMENT OF  SUBSTITUTE GOODS	OR SERVICES; LOSS OF
- *  USE, DATA,	OR PROFITS; OR	BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- *  ANY THEORY OF LIABILITY, WHETHER IN	 CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  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.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <linux/init.h>
-#include <int.h>
-
-char pnx8550_irq_tab[][5] __initdata = {
-	[8]	= { -1, PNX8550_INT_PCI_INTA, 0xff, 0xff, 0xff},
-	[9]	= { -1, PNX8550_INT_PCI_INTA, 0xff, 0xff, 0xff},
-	[17]	= { -1, PNX8550_INT_PCI_INTA, 0xff, 0xff, 0xff},
-};
-
diff -urN linux.orig/arch/mips/philips/pnx8550/jbs/Makefile
linux/arch/mips/philips/pnx8550/jbs/Makefile
--- linux.orig/arch/mips/philips/pnx8550/jbs/Makefile	2008-03-04
11:08:00.000000000 +0000
+++ linux/arch/mips/philips/pnx8550/jbs/Makefile	1970-01-01
01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-
-# Makefile for the Philips JBS Board.
-
-lib-y := init.o board_setup.o irqmap.o
diff -urN linux.orig/arch/mips/philips/pnx8550/stb810/board_setup.c
linux/arch/mips/philips/pnx8550/stb810/board_setup.c
--- linux.orig/arch/mips/philips/pnx8550/stb810/board_setup.c	2008-03-04
11:08:00.000000000 +0000
+++ linux/arch/mips/philips/pnx8550/stb810/board_setup.c	1970-01-01
01:00:00.000000000 +0100
@@ -1,49 +0,0 @@
-/*
- *  STB810 specific board startup routines.
- *
- *  Based on the arch/mips/philips/pnx8550/jbs/board_setup.c
- *
- *  Author: MontaVista Software, Inc.
- *          source@mvista.com
- *
- *  Copyright 2005 MontaVista Software Inc.
- *
- *  This program is free software; you can redistribute it and/or modify it
- *  under the terms of the GNU General Public License as published by the
- *  Free Software Foundation; either version 2 of the License, or (at your
- *  option) any later version.
- */
-
-#include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
-#include <linux/mc146818rtc.h>
-#include <linux/delay.h>
-
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
-
-#include <glb.h>
-
-void __init board_setup(void)
-{
-	unsigned long config0, configpr;
-
-	config0 = read_c0_config();
-
-	/* clear all three cache coherency fields */
-	config0 &= ~(0x7 | (7<<25) | (7<<28));
-	config0 |= (CONF_CM_DEFAULT | (CONF_CM_DEFAULT<<25) |
-			(CONF_CM_DEFAULT<<28));
-	write_c0_config(config0);
-
-	configpr = read_c0_config7();
-	configpr |= (1<<19); /* enable tlb */
-	write_c0_config7(configpr);
-}
diff -urN linux.orig/arch/mips/philips/pnx8550/stb810/irqmap.c
linux/arch/mips/philips/pnx8550/stb810/irqmap.c
--- linux.orig/arch/mips/philips/pnx8550/stb810/irqmap.c	2008-03-04
11:08:00.000000000 +0000
+++ linux/arch/mips/philips/pnx8550/stb810/irqmap.c	1970-01-01
01:00:00.000000000 +0100
@@ -1,23 +0,0 @@
-/*
- *  Philips STB810 board irqmap.
- *
- *  Author: MontaVista Software, Inc.
- *          source@mvista.com
- *
- *  Copyright 2005 MontaVista Software Inc.
- *
- *  This program is free software; you can redistribute it and/or modify it
- *  under the terms of the GNU General Public License as published by the
- *  Free Software Foundation; either version 2 of the License, or (at your
- *  option) any later version.
- */
-
-#include <linux/init.h>
-#include <int.h>
-
-char pnx8550_irq_tab[][5] __initdata = {
-	[8]	= { -1, PNX8550_INT_PCI_INTA, 0xff, 0xff, 0xff},
-	[9]	= { -1, PNX8550_INT_PCI_INTA, 0xff, 0xff, 0xff},
-	[10]	= { -1, PNX8550_INT_PCI_INTA, 0xff, 0xff, 0xff},
-};
-
diff -urN linux.orig/arch/mips/philips/pnx8550/stb810/Makefile
linux/arch/mips/philips/pnx8550/stb810/Makefile
--- linux.orig/arch/mips/philips/pnx8550/stb810/Makefile	2008-03-04
11:08:00.000000000 +0000
+++ linux/arch/mips/philips/pnx8550/stb810/Makefile	1970-01-01
01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-
-# Makefile for the Philips STB810 Board.
-
-lib-y := prom_init.o board_setup.o irqmap.o
diff -urN linux.orig/arch/mips/philips/pnx8550/stb810/prom_init.c
linux/arch/mips/philips/pnx8550/stb810/prom_init.c
--- linux.orig/arch/mips/philips/pnx8550/stb810/prom_init.c	2008-03-04
11:08:00.000000000 +0000
+++ linux/arch/mips/philips/pnx8550/stb810/prom_init.c	1970-01-01
01:00:00.000000000 +0100
@@ -1,46 +0,0 @@
-/*
- *  STB810 specific prom routines
- *
- *  Author: MontaVista Software, Inc.
- *          source@mvista.com
- *
- *  Copyright 2005 MontaVista Software Inc.
- *
- *  This program is free software; you can redistribute it and/or modify it
- *  under the terms of the GNU General Public License as published by the
- *  Free Software Foundation; either version 2 of the License, or (at your
- *  option) any later version.
- */
-
-#include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <asm/addrspace.h>
-#include <asm/bootinfo.h>
-#include <linux/string.h>
-#include <linux/kernel.h>
-
-int prom_argc;
-char **prom_argv, **prom_envp;
-extern void  __init prom_init_cmdline(void);
-extern char *prom_getenv(char *envname);
-
-const char *get_system_type(void)
-{
-	return "Philips PNX8550/STB810";
-}
-
-void __init prom_init(void)
-{
-	unsigned long memsize;
-
-	prom_argc = (int) fw_arg0;
-	prom_argv = (char **) fw_arg1;
-	prom_envp = (char **) fw_arg2;
-
-	prom_init_cmdline();
-
-	memsize = 0x08000000; /* Trimedia uses memory above */
-	add_memory_region(0, memsize, BOOT_MEM_RAM);
-}
diff -urN linux.orig/include/asm-mips/cpu.h linux/include/asm-mips/cpu.h
--- linux.orig/include/asm-mips/cpu.h	2008-03-04 11:08:37.000000000 +0000
+++ linux/include/asm-mips/cpu.h	2008-03-04 11:13:18.000000000 +0000
@@ -29,7 +29,7 @@
 #define PRID_COMP_ALCHEMY	0x030000
 #define PRID_COMP_SIBYTE	0x040000
 #define PRID_COMP_SANDCRAFT	0x050000
-#define PRID_COMP_PHILIPS	0x060000
+#define PRID_COMP_NXP   	0x060000
 #define PRID_COMP_TOSHIBA	0x070000
 #define PRID_COMP_LSI		0x080000
 #define PRID_COMP_LEXRA		0x0b0000

From horms@verge.net.au Thu Mar  6 09:57:41 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Mar 2008 09:57:44 +0000 (GMT)
Received: from koto.vergenet.net ([210.128.90.7]:1927 "EHLO koto.vergenet.net")
	by ftp.linux-mips.org with ESMTP id S28603216AbYCFJ5l (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 6 Mar 2008 09:57:41 +0000
Received: from tabatha.lab.ultramonkey.org (vagw.valinux.co.jp [210.128.90.14])
	by koto.vergenet.net (Postfix) with ESMTP id 37DBE341E2;
	Thu,  6 Mar 2008 18:57:32 +0900 (JST)
Received: by tabatha.lab.ultramonkey.org (Postfix, from userid 7100)
	id B06C0506E4; Thu,  6 Mar 2008 18:57:30 +0900 (JST)
Message-Id: <20080306094759.828031235@vergenet.net>
References: <20080306094637.669665743@vergenet.net>
User-Agent: quilt/0.46-1
Date:	Thu, 06 Mar 2008 18:46:45 +0900
From:	Simon Horman <horms@verge.net.au>
To:	kexec@lists.infradead.org, linux-mips@linux-mips.org
Cc:	Tomasz Chmielewski <mangoo@wpkg.org>,
	Francesco Chiechi <francesco.chiechi@colibre.it>
Subject: [patch 08/12] kexec-tools: mipsel: Remove unused arch_options global variable
Content-Disposition: inline; filename=mips-unused-arch_options.patch
Return-Path: <horms@verge.net.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: 18340
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: horms@verge.net.au
Precedence: bulk
X-list: linux-mips

Signed-off-by: Simon Horman <horms@verge.net.au>

--- 

 kexec/arch/mipsel/kexec-mipsel.c |    3 ---
 1 file changed, 3 deletions(-)

Index: kexec-tools-testing-mips/kexec/arch/mipsel/kexec-mipsel.c
===================================================================
--- kexec-tools-testing-mips.orig/kexec/arch/mipsel/kexec-mipsel.c	2008-03-05 11:27:43.000000000 +0900
+++ kexec-tools-testing-mips/kexec/arch/mipsel/kexec-mipsel.c	2008-03-05 11:27:46.000000000 +0900
@@ -100,9 +100,6 @@ void arch_usage(void)
 {
 }
 
-static struct {
-} arch_options = {
-};
 int arch_process_options(int argc, char **argv)
 {
 	static const struct option options[] = {

-- 

-- 
Horms


From horms@verge.net.au Thu Mar  6 09:58:05 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Mar 2008 09:58:08 +0000 (GMT)
Received: from koto.vergenet.net ([210.128.90.7]:1159 "EHLO koto.vergenet.net")
	by ftp.linux-mips.org with ESMTP id S28603241AbYCFJ5l (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 6 Mar 2008 09:57:41 +0000
Received: from tabatha.lab.ultramonkey.org (vagw.valinux.co.jp [210.128.90.14])
	by koto.vergenet.net (Postfix) with ESMTP id 07D86341E1;
	Thu,  6 Mar 2008 18:57:32 +0900 (JST)
Received: by tabatha.lab.ultramonkey.org (Postfix, from userid 7100)
	id A4B1950687; Thu,  6 Mar 2008 18:57:30 +0900 (JST)
Message-Id: <20080306094759.405831871@vergenet.net>
References: <20080306094637.669665743@vergenet.net>
User-Agent: quilt/0.46-1
Date:	Thu, 06 Mar 2008 18:46:43 +0900
From:	Simon Horman <horms@verge.net.au>
To:	kexec@lists.infradead.org, linux-mips@linux-mips.org
Cc:	Tomasz Chmielewski <mangoo@wpkg.org>,
	Francesco Chiechi <francesco.chiechi@colibre.it>
Subject: [patch 06/12] kexec-tools: mipsel: Remove unused variables from elf_mipsel_load
Content-Disposition: inline; filename=mips-elf_mipsel_load-unused-variables.patch
Return-Path: <horms@verge.net.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: 18341
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: horms@verge.net.au
Precedence: bulk
X-list: linux-mips

Signed-off-by: Simon Horman <horms@verge.net.au>

--- 

 kexec/arch/mipsel/kexec-elf-mipsel.c |    2 --
 1 file changed, 2 deletions(-)

Index: kexec-tools-mips/kexec/arch/mipsel/kexec-elf-mipsel.c
===================================================================
--- kexec-tools-mips.orig/kexec/arch/mipsel/kexec-elf-mipsel.c	2008-02-27 19:17:47.000000000 +0900
+++ kexec-tools-mips/kexec/arch/mipsel/kexec-elf-mipsel.c	2008-02-27 19:17:49.000000000 +0900
@@ -116,9 +116,7 @@ int elf_mipsel_load(int argc, char **arg
 	int command_line_len;
 	unsigned char *setup_start;
 	uint32_t setup_size;
-	int result;
 	int opt;
-	int i;
 #define OPT_APPEND     (OPT_ARCH_MAX+0)
 	static const struct option options[] = {
 		KEXEC_ARCH_OPTIONS

-- 

-- 
Horms


From horms@verge.net.au Thu Mar  6 09:58:29 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Mar 2008 09:58:32 +0000 (GMT)
Received: from koto.vergenet.net ([210.128.90.7]:1415 "EHLO koto.vergenet.net")
	by ftp.linux-mips.org with ESMTP id S28603242AbYCFJ5l (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 6 Mar 2008 09:57:41 +0000
Received: from tabatha.lab.ultramonkey.org (vagw.valinux.co.jp [210.128.90.14])
	by koto.vergenet.net (Postfix) with ESMTP id 9FF91341BD;
	Thu,  6 Mar 2008 18:57:31 +0900 (JST)
Received: by tabatha.lab.ultramonkey.org (Postfix, from userid 7100)
	id 8E338505BC; Thu,  6 Mar 2008 18:57:30 +0900 (JST)
Message-Id: <20080306094758.578257076@vergenet.net>
References: <20080306094637.669665743@vergenet.net>
User-Agent: quilt/0.46-1
Date:	Thu, 06 Mar 2008 18:46:39 +0900
From:	Simon Horman <horms@verge.net.au>
To:	kexec@lists.infradead.org, linux-mips@linux-mips.org,
	Tomasz Chmielewski <mangoo@wpkg.org>
Cc:	Francesco Chiechi <francesco.chiechi@colibre.it>
Subject: [patch 02/12] kexec-tools: mipsel: Remove purgatory/arch/mipsel/include/stdint.h
Content-Disposition: inline; filename=mips-dup_stdint.patch
Return-Path: <horms@verge.net.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: 18342
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: horms@verge.net.au
Precedence: bulk
X-list: linux-mips

Remove purgatory/arch/mipsel/include/stdint.h as it just duplicates
things found in system header files.

Signed-off-by: Simon Horman <horms@verge.net.au>

---

 purgatory/arch/mipsel/include/stdint.h |   16 ----------------
 1 file changed, 16 deletions(-)

Index: kexec-tools-mips/purgatory/arch/mipsel/include/stdint.h
===================================================================
--- kexec-tools-mips.orig/purgatory/arch/mipsel/include/stdint.h	2008-02-27 19:02:34.000000000 +0900
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,16 +0,0 @@
-#ifndef STDINT_H
-#define STDINT_H
-
-typedef unsigned long      size_t;
-
-typedef unsigned char      uint8_t;
-typedef unsigned short     uint16_t;
-typedef unsigned int       uint32_t;
-typedef unsigned long long uint64_t;
-
-typedef signed char        int8_t;
-typedef signed short       int16_t;
-typedef signed int         int32_t;
-typedef signed long long   int64_t;
-
-#endif /* STDINT_H */

-- 

-- 
Horms


From horms@verge.net.au Thu Mar  6 09:58:53 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Mar 2008 09:58:57 +0000 (GMT)
Received: from koto.vergenet.net ([210.128.90.7]:1671 "EHLO koto.vergenet.net")
	by ftp.linux-mips.org with ESMTP id S28603246AbYCFJ5l (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 6 Mar 2008 09:57:41 +0000
Received: from tabatha.lab.ultramonkey.org (vagw.valinux.co.jp [210.128.90.14])
	by koto.vergenet.net (Postfix) with ESMTP id 51EA5341E4;
	Thu,  6 Mar 2008 18:57:31 +0900 (JST)
Received: by tabatha.lab.ultramonkey.org (Postfix, from userid 7100)
	id 8F77A4F8B5; Thu,  6 Mar 2008 18:57:30 +0900 (JST)
Message-Id: <20080306094758.980350354@vergenet.net>
References: <20080306094637.669665743@vergenet.net>
User-Agent: quilt/0.46-1
Date:	Thu, 06 Mar 2008 18:46:41 +0900
From:	Simon Horman <horms@verge.net.au>
To:	kexec@lists.infradead.org, linux-mips@linux-mips.org
Cc:	Tomasz Chmielewski <mangoo@wpkg.org>,
	Francesco Chiechi <francesco.chiechi@colibre.it>
Subject: [patch 04/12] kexec-tools: mipsel: Remove duplication declaration of BOOTLOADER_VERSION
Content-Disposition: inline; filename=mips-duplicate-BOOTLOADER_VERSION.patch
Return-Path: <horms@verge.net.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: 18343
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: horms@verge.net.au
Precedence: bulk
X-list: linux-mips

BOOTLOADER_VERSION is defined in kexec.h

Signed-off-by: Simon Horman <horms@verge.net.au>

--- 

 kexec/arch/mipsel/kexec-elf-mipsel.c |    1 -
 1 file changed, 1 deletion(-)

Index: kexec-tools-mips/kexec/arch/mipsel/kexec-elf-mipsel.c
===================================================================
--- kexec-tools-mips.orig/kexec/arch/mipsel/kexec-elf-mipsel.c	2008-02-27 19:15:41.000000000 +0900
+++ kexec-tools-mips/kexec/arch/mipsel/kexec-elf-mipsel.c	2008-02-27 19:18:10.000000000 +0900
@@ -32,7 +32,6 @@
 static const int probe_debug = 0;
 
 #define BOOTLOADER         "kexec"
-#define BOOTLOADER_VERSION VERSION
 #define MAX_COMMAND_LINE   256
 
 #define UPSZ(X) ((sizeof(X) + 3) & ~3)

-- 

-- 
Horms


From horms@verge.net.au Thu Mar  6 09:59:18 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Mar 2008 09:59:21 +0000 (GMT)
Received: from koto.vergenet.net ([210.128.90.7]:903 "EHLO koto.vergenet.net")
	by ftp.linux-mips.org with ESMTP id S28603247AbYCFJ5m (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 6 Mar 2008 09:57:42 +0000
Received: from tabatha.lab.ultramonkey.org (vagw.valinux.co.jp [210.128.90.14])
	by koto.vergenet.net (Postfix) with ESMTP id B3F65341D4;
	Thu,  6 Mar 2008 18:57:31 +0900 (JST)
Received: by tabatha.lab.ultramonkey.org (Postfix, from userid 7100)
	id 828DF4F763; Thu,  6 Mar 2008 18:57:30 +0900 (JST)
Message-Id: <20080306094758.763268872@vergenet.net>
References: <20080306094637.669665743@vergenet.net>
User-Agent: quilt/0.46-1
Date:	Thu, 06 Mar 2008 18:46:40 +0900
From:	Simon Horman <horms@verge.net.au>
To:	kexec@lists.infradead.org, linux-mips@linux-mips.org
Cc:	Tomasz Chmielewski <mangoo@wpkg.org>,
	Francesco Chiechi <francesco.chiechi@colibre.it>
Subject: [patch 03/12] kexec-tools: mipsel: Update mipsel port for recent build changes
Content-Disposition: inline; filename=mips-build.patch
Return-Path: <horms@verge.net.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: 18344
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: horms@verge.net.au
Precedence: bulk
X-list: linux-mips

Signed-off-by: Simon Horman <horms@verge.net.au>

--- 

 kexec/Makefile                 |    1 +
 kexec/arch/mipsel/Makefile     |   13 +++++++++----
 purgatory/Makefile             |    1 +
 purgatory/arch/mipsel/Makefile |    8 ++++++--
 4 files changed, 17 insertions(+), 6 deletions(-)

Index: kexec-tools-mips/kexec/Makefile
===================================================================
--- kexec-tools-mips.orig/kexec/Makefile	2008-02-27 19:05:29.000000000 +0900
+++ kexec-tools-mips/kexec/Makefile	2008-02-27 19:05:48.000000000 +0900
@@ -33,6 +33,7 @@ include $(srcdir)/kexec/arch/alpha/Makef
 include $(srcdir)/kexec/arch/arm/Makefile
 include $(srcdir)/kexec/arch/i386/Makefile
 include $(srcdir)/kexec/arch/ia64/Makefile
+include $(srcdir)/kexec/arch/mipsel/Makefile
 include $(srcdir)/kexec/arch/ppc/Makefile
 include $(srcdir)/kexec/arch/ppc64/Makefile
 include $(srcdir)/kexec/arch/s390/Makefile
Index: kexec-tools-mips/kexec/arch/mipsel/Makefile
===================================================================
--- kexec-tools-mips.orig/kexec/arch/mipsel/Makefile	2008-02-27 19:07:50.000000000 +0900
+++ kexec-tools-mips/kexec/arch/mipsel/Makefile	2008-02-27 19:13:30.000000000 +0900
@@ -1,7 +1,12 @@
 #
 # kexec mipsel (linux booting linux)
 #
-KEXEC_C_SRCS+= kexec/arch/mipsel/kexec-mipsel.c
-KEXEC_C_SRCS+= kexec/arch/mipsel/kexec-elf-mipsel.c
-KEXEC_C_SRCS+= kexec/arch/mipsel/kexec-elf-rel-mipsel.c
-KEXEC_S_SRCS+= kexec/arch/mipsel/mipsel-setup-simple.S
+mipsel_KEXEC_SRCS =  kexec/arch/mipsel/kexec-mipsel.c
+mipsel_KEXEC_SRCS += kexec/arch/mipsel/kexec-elf-mipsel.c
+mipsel_KEXEC_SRCS += kexec/arch/mipsel/kexec-elf-rel-mipsel.c
+mipsel_KEXEC_SRCS += kexec/arch/mipsel/mipsel-setup-simple.S
+
+dist += kexec/arch/mipsel/Makefile $(mipsel_KEXEC_SRCS)			\
+	kexec/arch/mipsel/kexec-mipsel.h				\
+	kexec/arch/mipsel/include/arch/options.h
+
Index: kexec-tools-mips/purgatory/Makefile
===================================================================
--- kexec-tools-mips.orig/purgatory/Makefile	2008-02-27 19:08:55.000000000 +0900
+++ kexec-tools-mips/purgatory/Makefile	2008-02-27 19:09:05.000000000 +0900
@@ -20,6 +20,7 @@ include $(srcdir)/purgatory/arch/alpha/M
 include $(srcdir)/purgatory/arch/arm/Makefile
 include $(srcdir)/purgatory/arch/i386/Makefile
 include $(srcdir)/purgatory/arch/ia64/Makefile
+include $(srcdir)/purgatory/arch/mipsel/Makefile
 include $(srcdir)/purgatory/arch/ppc/Makefile
 include $(srcdir)/purgatory/arch/ppc64/Makefile
 include $(srcdir)/purgatory/arch/s390/Makefile
Index: kexec-tools-mips/purgatory/arch/mipsel/Makefile
===================================================================
--- kexec-tools-mips.orig/purgatory/arch/mipsel/Makefile	2008-02-27 19:08:55.000000000 +0900
+++ kexec-tools-mips/purgatory/arch/mipsel/Makefile	2008-02-27 19:11:04.000000000 +0900
@@ -2,6 +2,10 @@
 # Purgatory mipsel
 #
 
-PURGATORY_C_SRCS+= purgatory/arch/mipsel/purgatory-mipsel.c
-PURGATORY_C_SRCS+= purgatory/arch/mipsel/console-mipsel.c
+mipsel_PURGATORY_C_SRCS+= purgatory/arch/mipsel/purgatory-mipsel.c
+mipsel_PURGATORY_C_SRCS+= purgatory/arch/mipsel/console-mipsel.c
+
+dist += purgatory/arch/mipsel/Makefile $(mipsel_PURGATORY_C_SRCS)	\
+	purgatory/arch/mipsel/include/limits.h				\
+	purgatory/arch/mipsel/purgatory-mipsel.h
 

-- 

-- 
Horms


From horms@verge.net.au Thu Mar  6 09:59:42 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Mar 2008 09:59:46 +0000 (GMT)
Received: from koto.vergenet.net ([210.128.90.7]:10119 "EHLO koto.vergenet.net")
	by ftp.linux-mips.org with ESMTP id S28603253AbYCFJ5s (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 6 Mar 2008 09:57:48 +0000
Received: from tabatha.lab.ultramonkey.org (vagw.valinux.co.jp [210.128.90.14])
	by koto.vergenet.net (Postfix) with ESMTP id 6AF3C341EB;
	Thu,  6 Mar 2008 18:57:31 +0900 (JST)
Received: by tabatha.lab.ultramonkey.org (Postfix, from userid 7100)
	id AA8AF506A8; Thu,  6 Mar 2008 18:57:30 +0900 (JST)
Message-Id: <20080306094759.628025769@vergenet.net>
References: <20080306094637.669665743@vergenet.net>
User-Agent: quilt/0.46-1
Date:	Thu, 06 Mar 2008 18:46:44 +0900
From:	Simon Horman <horms@verge.net.au>
To:	kexec@lists.infradead.org, linux-mips@linux-mips.org
Cc:	Tomasz Chmielewski <mangoo@wpkg.org>,
	Francesco Chiechi <francesco.chiechi@colibre.it>
Subject: [patch 07/12] kexec-tools: mipsel: Remove unused variables in arch_process_options()
Content-Disposition: inline; filename=mips-arch_process_options-unused-values.patch
Return-Path: <horms@verge.net.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: 18345
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: horms@verge.net.au
Precedence: bulk
X-list: linux-mips

Signed-off-by: Simon Horman <horms@verge.net.au>

--- 

 kexec/arch/mipsel/kexec-mipsel.c |    2 --
 1 file changed, 2 deletions(-)

Index: kexec-tools-mips/kexec/arch/mipsel/kexec-mipsel.c
===================================================================
--- kexec-tools-mips.orig/kexec/arch/mipsel/kexec-mipsel.c	2008-02-27 19:14:03.000000000 +0900
+++ kexec-tools-mips/kexec/arch/mipsel/kexec-mipsel.c	2008-02-27 19:18:15.000000000 +0900
@@ -111,8 +111,6 @@ int arch_process_options(int argc, char 
 	};
 	static const char short_options[] = KEXEC_ARCH_OPT_STR;
 	int opt;
-	unsigned long value;
-	char *end;
 
 	opterr = 0; /* Don't complain about unrecognized options here */
 	while((opt = getopt_long(argc, argv, short_options, options, 0)) != -1) {

-- 

-- 
Horms


From horms@verge.net.au Thu Mar  6 10:00:07 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Mar 2008 10:00:10 +0000 (GMT)
Received: from koto.vergenet.net ([210.128.90.7]:10887 "EHLO koto.vergenet.net")
	by ftp.linux-mips.org with ESMTP id S28603254AbYCFJ5s (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 6 Mar 2008 09:57:48 +0000
Received: from tabatha.lab.ultramonkey.org (vagw.valinux.co.jp [210.128.90.14])
	by koto.vergenet.net (Postfix) with ESMTP id CC5FC341FA;
	Thu,  6 Mar 2008 18:57:32 +0900 (JST)
Received: by tabatha.lab.ultramonkey.org (Postfix, from userid 7100)
	id C3E4A5077B; Thu,  6 Mar 2008 18:57:30 +0900 (JST)
Message-Id: <20080306094800.531036774@vergenet.net>
References: <20080306094637.669665743@vergenet.net>
User-Agent: quilt/0.46-1
Date:	Thu, 06 Mar 2008 18:46:48 +0900
From:	Simon Horman <horms@verge.net.au>
To:	kexec@lists.infradead.org, linux-mips@linux-mips.org
Cc:	Tomasz Chmielewski <mangoo@wpkg.org>,
	Francesco Chiechi <francesco.chiechi@colibre.it>
Subject: [patch 11/12] kexec-tools: mipsel: Fit elf_mipsel_load() into 80 columns
Content-Disposition: inline; filename=elf_mipsel_load-80col.patch
Return-Path: <horms@verge.net.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: 18346
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: horms@verge.net.au
Precedence: bulk
X-list: linux-mips

Signed-off-by: Simon Horman <horms@verge.net.au>

--- 

 kexec/arch/mipsel/kexec-elf-mipsel.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: kexec-tools-testing-mips/kexec/arch/mipsel/kexec-elf-mipsel.c
===================================================================
--- kexec-tools-testing-mips.orig/kexec/arch/mipsel/kexec-elf-mipsel.c	2008-03-05 11:44:06.000000000 +0900
+++ kexec-tools-testing-mips/kexec/arch/mipsel/kexec-elf-mipsel.c	2008-03-05 11:44:06.000000000 +0900
@@ -128,7 +128,8 @@ int elf_mipsel_load(int argc, char **arg
 	static const char short_options[] = KEXEC_ARCH_OPT_STR "d";
 
 	command_line = 0;
-	while ((opt = getopt_long(argc, argv, short_options, options, 0)) != -1) {
+	while ((opt = getopt_long(argc, argv, short_options,
+				  options, 0)) != -1) {
 		switch (opt) {
 		default:
 			/* Ignore core options */

-- 

-- 
Horms


From horms@verge.net.au Thu Mar  6 10:00:32 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Mar 2008 10:00:35 +0000 (GMT)
Received: from koto.vergenet.net ([210.128.90.7]:9863 "EHLO koto.vergenet.net")
	by ftp.linux-mips.org with ESMTP id S28603258AbYCFJ5s (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 6 Mar 2008 09:57:48 +0000
Received: from tabatha.lab.ultramonkey.org (vagw.valinux.co.jp [210.128.90.14])
	by koto.vergenet.net (Postfix) with ESMTP id BA01E341F5;
	Thu,  6 Mar 2008 18:57:32 +0900 (JST)
Received: by tabatha.lab.ultramonkey.org (Postfix, from userid 7100)
	id BD1A950773; Thu,  6 Mar 2008 18:57:30 +0900 (JST)
Message-Id: <20080306094800.249412632@vergenet.net>
References: <20080306094637.669665743@vergenet.net>
User-Agent: quilt/0.46-1
Date:	Thu, 06 Mar 2008 18:46:47 +0900
From:	Simon Horman <horms@verge.net.au>
To:	kexec@lists.infradead.org, linux-mips@linux-mips.org
Cc:	Tomasz Chmielewski <mangoo@wpkg.org>,
	Francesco Chiechi <francesco.chiechi@colibre.it>
Subject: [patch 10/12] kexec-tools: mipsel: Fit elf_mipsel_usage() into 80 columns
Content-Disposition: inline; filename=elf_mipsel_usage-80col.patch
Return-Path: <horms@verge.net.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: 18347
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: horms@verge.net.au
Precedence: bulk
X-list: linux-mips

Signed-off-by: Simon Horman <horms@verge.net.au>

--- 

 kexec/arch/mipsel/kexec-elf-mipsel.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Index: kexec-tools-testing-mips/kexec/arch/mipsel/kexec-elf-mipsel.c
===================================================================
--- kexec-tools-testing-mips.orig/kexec/arch/mipsel/kexec-elf-mipsel.c	2008-03-05 11:12:44.000000000 +0900
+++ kexec-tools-testing-mips/kexec/arch/mipsel/kexec-elf-mipsel.c	2008-03-05 11:18:34.000000000 +0900
@@ -97,10 +97,10 @@ int elf_mipsel_probe(const char *buf, of
 
 void elf_mipsel_usage(void)
 {
-	printf
-	    (
-	     "    --command-line=STRING Set the kernel command line to STRING.  \n"
-	     "    --append=STRING       Set the kernel command line to STRING.  \n");
+	printf("    --command-line=STRING Set the kernel command line to "
+			"STRING.\n"
+	       "    --append=STRING       Set the kernel command line to "
+			"STRING.\n");
 }
 
 int elf_mipsel_load(int argc, char **argv, const char *buf, off_t len,

-- 

-- 
Horms


From horms@verge.net.au Thu Mar  6 10:00:56 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Mar 2008 10:01:00 +0000 (GMT)
Received: from koto.vergenet.net ([210.128.90.7]:11143 "EHLO koto.vergenet.net")
	by ftp.linux-mips.org with ESMTP id S28603260AbYCFJ5s (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 6 Mar 2008 09:57:48 +0000
Received: from tabatha.lab.ultramonkey.org (vagw.valinux.co.jp [210.128.90.14])
	by koto.vergenet.net (Postfix) with ESMTP id D4389341FB;
	Thu,  6 Mar 2008 18:57:32 +0900 (JST)
Received: by tabatha.lab.ultramonkey.org (Postfix, from userid 7100)
	id C9C84507E9; Thu,  6 Mar 2008 18:57:30 +0900 (JST)
Message-Id: <20080306094800.680153069@vergenet.net>
References: <20080306094637.669665743@vergenet.net>
User-Agent: quilt/0.46-1
Date:	Thu, 06 Mar 2008 18:46:49 +0900
From:	Simon Horman <horms@verge.net.au>
To:	kexec@lists.infradead.org, linux-mips@linux-mips.org
Cc:	Tomasz Chmielewski <mangoo@wpkg.org>,
	Francesco Chiechi <francesco.chiechi@colibre.it>
Subject: [patch 12/12] kexec-tools: mipsel: Define OPT_APPEND outside of any function
Content-Disposition: inline; filename=mipsel-opt-defines-outside-of-function.patch
Return-Path: <horms@verge.net.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: 18348
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: horms@verge.net.au
Precedence: bulk
X-list: linux-mips

Signed-off-by: Simon Horman <horms@verge.net.au>

--- 

 kexec/arch/mipsel/kexec-elf-mipsel.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: kexec-tools-testing-mips/kexec/arch/mipsel/kexec-elf-mipsel.c
===================================================================
--- kexec-tools-testing-mips.orig/kexec/arch/mipsel/kexec-elf-mipsel.c	2008-03-06 18:39:51.000000000 +0900
+++ kexec-tools-testing-mips/kexec/arch/mipsel/kexec-elf-mipsel.c	2008-03-06 18:39:51.000000000 +0900
@@ -70,6 +70,8 @@ static struct boot_notes {
 };
 
 
+#define OPT_APPEND	(OPT_ARCH_MAX+0)
+
 int elf_mipsel_probe(const char *buf, off_t len)
 {
 
@@ -117,7 +119,6 @@ int elf_mipsel_load(int argc, char **arg
 	unsigned char *setup_start;
 	uint32_t setup_size;
 	int opt;
-#define OPT_APPEND     (OPT_ARCH_MAX+0)
 	static const struct option options[] = {
 		KEXEC_ARCH_OPTIONS
 		{"command-line", 1, 0, OPT_APPEND},

-- 

-- 
Horms


From horms@verge.net.au Thu Mar  6 10:01:21 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Mar 2008 10:01:25 +0000 (GMT)
Received: from koto.vergenet.net ([210.128.90.7]:10631 "EHLO koto.vergenet.net")
	by ftp.linux-mips.org with ESMTP id S28603255AbYCFJ5s (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 6 Mar 2008 09:57:48 +0000
Received: from tabatha.lab.ultramonkey.org (vagw.valinux.co.jp [210.128.90.14])
	by koto.vergenet.net (Postfix) with ESMTP id A0760341EC;
	Thu,  6 Mar 2008 18:57:32 +0900 (JST)
Received: by tabatha.lab.ultramonkey.org (Postfix, from userid 7100)
	id B63FE506EB; Thu,  6 Mar 2008 18:57:30 +0900 (JST)
Message-Id: <20080306094800.038871930@vergenet.net>
References: <20080306094637.669665743@vergenet.net>
User-Agent: quilt/0.46-1
Date:	Thu, 06 Mar 2008 18:46:46 +0900
From:	Simon Horman <horms@verge.net.au>
To:	kexec@lists.infradead.org, linux-mips@linux-mips.org
Cc:	Tomasz Chmielewski <mangoo@wpkg.org>,
	Francesco Chiechi <francesco.chiechi@colibre.it>
Subject: [patch 09/12] kexec-tools: mipsel: Remove purgatory/arch/mipsel/include/limits.h
Content-Disposition: inline; filename=mips-no-limits.h.patch
Return-Path: <horms@verge.net.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: 18349
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: horms@verge.net.au
Precedence: bulk
X-list: linux-mips

Remove purgatory/arch/mipsel/include/limits.h as it is not needed.

Signed-off-by: Simon Horman <horms@verge.net.au>

--- 

 purgatory/arch/mipsel/include/limits.h |   58 --------------------------------
 1 file changed, 58 deletions(-)

Index: kexec-tools-testing-mips/purgatory/arch/mipsel/include/limits.h
===================================================================
--- kexec-tools-testing-mips.orig/purgatory/arch/mipsel/include/limits.h	2008-03-05 13:59:49.000000000 +0900
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,58 +0,0 @@
-#ifndef LIMITS_H
-#define LIMITS_H       1
-
-
-/* Number of bits in a `char' */
-#define CHAR_BIT       8
-
-/* Minimum and maximum values a `signed char' can hold */
-#define SCHAR_MIN      (-128)
-#define SCHAR_MAX      127
-
-/* Maximum value an `unsigned char' can hold. (Minimum is 0.) */
-#define UCHAR_MAX      255
-
-/* Minimum and maximum values a `char' can hold */
-#define CHAR_MIN       SCHAR_MIN
-#define CHAR_MAX       SCHAR_MAX
-
-/* Minimum and maximum values a `signed short int' can hold */
-#define SHRT_MIN       (-32768)
-#define SHRT_MAX       32767
-
-/* Maximum value an `unsigned short' can hold. (Minimum is 0.) */
-#define USHRT_MAX      65535
-
-
-/* Minimum and maximum values a `signed int' can hold */
-#define INT_MIN                (-INT_MAX - 1)
-#define INT_MAX                2147483647
-
-/* Maximum value an `unsigned int' can hold. (Minimum is 0.) */
-#define UINT_MAX       4294967295U
-
-
-/* Minimum and maximum values a `signed int' can hold */
-#define INT_MIN                (-INT_MAX - 1)
-#define INT_MAX                2147483647
-
-/* Maximum value an `unsigned int' can hold. (Minimum is 0.) */
-#define UINT_MAX       4294967295U
-
-/* Minimum and maximum values a `signed long' can hold */
-#define LONG_MAX       2147483647L
-#define LONG_MIN       (-LONG_MAX - 1L)
-
-/* Maximum value an `unsigned long' can hold. (Minimum is 0.) */
-#define ULONG_MAX      4294967295UL
-
-/* Minimum and maximum values a `signed long long' can hold */
-#define LLONG_MAX      9223372036854775807LL
-#define LLONG_MIN      (-LONG_MAX - 1LL)
-
-
-/* Maximum value an `unsigned long long' can hold. (Minimum is 0.) */
-#define ULLONG_MAX     18446744073709551615ULL
-
-
-#endif /* LIMITS_H */

-- 

-- 
Horms


From horms@verge.net.au Thu Mar  6 10:01:46 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Mar 2008 10:01:50 +0000 (GMT)
Received: from koto.vergenet.net ([210.128.90.7]:10375 "EHLO koto.vergenet.net")
	by ftp.linux-mips.org with ESMTP id S28603252AbYCFJ5s (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 6 Mar 2008 09:57:48 +0000
Received: from tabatha.lab.ultramonkey.org (vagw.valinux.co.jp [210.128.90.14])
	by koto.vergenet.net (Postfix) with ESMTP id 643F9341E7;
	Thu,  6 Mar 2008 18:57:31 +0900 (JST)
Received: by tabatha.lab.ultramonkey.org (Postfix, from userid 7100)
	id 9623750677; Thu,  6 Mar 2008 18:57:30 +0900 (JST)
Message-Id: <20080306094759.186863437@vergenet.net>
References: <20080306094637.669665743@vergenet.net>
User-Agent: quilt/0.46-1
Date:	Thu, 06 Mar 2008 18:46:42 +0900
From:	Simon Horman <horms@verge.net.au>
To:	kexec@lists.infradead.org, linux-mips@linux-mips.org,
	Tomasz Chmielewski <mangoo@wpkg.org>
Cc:	Francesco Chiechi <francesco.chiechi@colibre.it>
Subject: [patch 05/12] kexec-tools: mipsel: Remove #ifdef __MIPSEL__ from kexec/kexec.c
Content-Disposition: inline; filename=mips-no-add_segment_virt.patch
Return-Path: <horms@verge.net.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: 18350
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: horms@verge.net.au
Precedence: bulk
X-list: linux-mips

On all architectures except mipsel add_buffer() expects
add_segment() to work with the virtual address passed.
On mipsel it is expected that add_segment() converts
the virtual address to a physical address first.
add_buffer_virt() is porvided on mipsel for the handful
of cases that don't want the address to be converted.

This patch maintains that behaviour, but without the need for #ifdef
__MIPSEL__ from kexec/kexec.c and much duplicated code.

Signed-off-by: Simon Horman <horms@verge.net.au>

---

 kexec/arch/mipsel/kexec-mipsel.c |   26 +++++++
 kexec/kexec.c                    |  137 +++++++++-----------------------------
 kexec/kexec.h                    |    9 ++
 3 files changed, 71 insertions(+), 101 deletions(-)

Index: kexec-tools-testing-mips/kexec/arch/mipsel/kexec-mipsel.c
===================================================================
--- kexec-tools-testing-mips.orig/kexec/arch/mipsel/kexec-mipsel.c	2008-03-06 18:39:25.000000000 +0900
+++ kexec-tools-testing-mips/kexec/arch/mipsel/kexec-mipsel.c	2008-03-06 18:44:54.000000000 +0900
@@ -165,3 +165,29 @@ int is_crashkernel_mem_reserved(void)
 	return 1;
 }
 
+unsigned long virt_to_phys(unsigned long addr)
+{
+	return addr - 0x80000000;
+}
+
+/*
+ * add_segment() should convert base to a physical address on mipsel,
+ * while the default is just to work with base as is */
+void add_segment(struct kexec_info *info, const void *buf, size_t bufsz,
+		 unsigned long base, size_t memsz)
+{
+	add_segment_phys_virt(info, buf, bufsz, base, memsz, 1);
+}
+
+/*
+ * add_buffer() should convert base to a physical address on mipsel,
+ * while the default is just to work with base as is */
+unsigned long add_buffer(struct kexec_info *info, const void *buf,
+			 unsigned long bufsz, unsigned long memsz,
+			 unsigned long buf_align, unsigned long buf_min,
+			 unsigned long buf_max, int buf_end)
+{
+	return add_buffer_phys_virt(info, buf, bufsz, memsz, buf_align,
+				    buf_min, buf_max, buf_end, 1);
+}
+
Index: kexec-tools-testing-mips/kexec/kexec.c
===================================================================
--- kexec-tools-testing-mips.orig/kexec/kexec.c	2008-03-06 18:39:25.000000000 +0900
+++ kexec-tools-testing-mips/kexec/kexec.c	2008-03-06 18:39:34.000000000 +0900
@@ -44,10 +44,6 @@
 #include "kexec-sha256.h"
 #include <arch/options.h>
 
-#ifdef __MIPSEL__
-#define virt_to_phys(X) ((X) - 0x80000000)
-#endif
-
 unsigned long long mem_min = 0;
 unsigned long long mem_max = ULONG_MAX;
 
@@ -289,16 +285,18 @@ unsigned long locate_hole(struct kexec_i
 	return hole_base;
 }
 
-void add_segment(struct kexec_info *info,
+unsigned long __attribute__((weak)) virt_to_phys(unsigned long addr)
+{
+	abort();
+}
+
+void add_segment_phys_virt(struct kexec_info *info,
 	const void *buf, size_t bufsz,
-	unsigned long base, size_t memsz)
+	unsigned long base, size_t memsz, int phys)
 {
 	unsigned long last;
 	size_t size;
 	int pagesize;
-#ifdef __MIPSEL__
-	unsigned long base_phys;
-#endif
 
 	if (bufsz > memsz) {
 		bufsz = memsz;
@@ -312,9 +310,6 @@ void add_segment(struct kexec_info *info
 	pagesize = getpagesize();
 	memsz = (memsz + (pagesize - 1)) & ~(pagesize - 1);
 
-#ifdef __MIPSEL__
-	base_phys=virt_to_phys(base);
-#endif
 	/* Verify base is pagesize aligned.
 	 * Finding a way to cope with this problem
 	 * is important but for now error so at least
@@ -325,29 +320,20 @@ void add_segment(struct kexec_info *info
 		die("Base address: %x is not page aligned\n", base);
 	}
 
-#ifdef __MIPSEL__
-	last = base_phys + memsz -1;
-	if (!valid_memory_range(info, base_phys, last)) {
-		die("Invalid memory segment %p - %p\n",
-			(void *)base_phys, (void *)last);
-	}
-#else
+	if (phys)
+		base = virt_to_phys(base);
+
 	last = base + memsz -1;
 	if (!valid_memory_range(info, base, last)) {
 		die("Invalid memory segment %p - %p\n",
 			(void *)base, (void *)last);
 	}
-#endif
 
 	size = (info->nr_segments + 1) * sizeof(info->segment[0]);
 	info->segment = xrealloc(info->segment, size);
 	info->segment[info->nr_segments].buf   = buf;
 	info->segment[info->nr_segments].bufsz = bufsz;
-#ifdef __MIPSEL__
-	info->segment[info->nr_segments].mem   = (void *)base_phys;
-#else
 	info->segment[info->nr_segments].mem   = (void *)base;
-#endif
 	info->segment[info->nr_segments].memsz = memsz;
 	info->nr_segments++;
 	if (info->nr_segments > KEXEC_MAX_SEGMENTS) {
@@ -356,61 +342,17 @@ void add_segment(struct kexec_info *info
 	}
 }
 
-#ifdef __MIPSEL__
-void add_segment_virt(struct kexec_info *info,
-	const void *buf, size_t bufsz,
-	unsigned long base, size_t memsz)
+void __attribute__((weak)) add_segment(struct kexec_info *info,
+				       const void *buf, size_t bufsz,
+				       unsigned long base, size_t memsz)
 {
-	unsigned long last;
-	size_t size;
-	int pagesize;
-
-	if (bufsz > memsz) {
-		bufsz = memsz;
-	}
-	/* Forget empty segments */
-	if (memsz == 0) {
-		return;
-	}
-
-	/* Round memsz up to a multiple of pagesize */
-	pagesize = getpagesize();
-	memsz = (memsz + (pagesize - 1)) & ~(pagesize - 1);
-
-	/* Verify base is pagesize aligned.
-	 * Finding a way to cope with this problem
-	 * is important but for now error so at least
-	 * we are not surprised by the code doing the wrong
-	 * thing.
-	 */
-	if (base & (pagesize -1)) {
-		die("Base address: %x is not page aligned\n", base);
-	}
-	
-	last = base + memsz -1;
-	if (!valid_memory_range(info, base, last)) {
-		die("Invalid memory segment %p - %p\n",
-			(void *)base, (void *)last);
-	}
-	
-	size = (info->nr_segments + 1) * sizeof(info->segment[0]);
-	info->segment = xrealloc(info->segment, size);
-	info->segment[info->nr_segments].buf   = buf;
-	info->segment[info->nr_segments].bufsz = bufsz;
-	info->segment[info->nr_segments].mem   = (void *)base;
-	info->segment[info->nr_segments].memsz = memsz;
-	info->nr_segments++;
-	if (info->nr_segments > KEXEC_MAX_SEGMENTS) {
-		fprintf(stderr, "Warning: kernel segment limit reached. "
-			"This will likely fail\n");
-	}
+	return add_segment_phys_virt(info, buf, bufsz, base, memsz, 0);
 }
-#endif
 
-unsigned long add_buffer(struct kexec_info *info,
+unsigned long add_buffer_phys_virt(struct kexec_info *info,
 	const void *buf, unsigned long bufsz, unsigned long memsz,
 	unsigned long buf_align, unsigned long buf_min, unsigned long buf_max,
-	int buf_end)
+	int buf_end, int phys)
 {
 	unsigned long base;
 	int result;
@@ -430,38 +372,31 @@ unsigned long add_buffer(struct kexec_in
 		die("locate_hole failed\n");
 	}
 	
-	add_segment(info, buf, bufsz, base, memsz);
+	add_segment_phys_virt(info, buf, bufsz, base, memsz, phys);
 	return base;
 }
 
-#ifdef __MIPSEL__
-unsigned long add_buffer_virt(struct kexec_info *info,
-	const void *buf, unsigned long bufsz, unsigned long memsz,
-	unsigned long buf_align, unsigned long buf_min, unsigned long buf_max,
-	int buf_end)
+unsigned long add_buffer_virt(struct kexec_info *info, const void *buf,
+			      unsigned long bufsz, unsigned long memsz,
+			      unsigned long buf_align, unsigned long buf_min,
+			      unsigned long buf_max, int buf_end)
+{
+	return add_buffer_phys_virt(info, buf, bufsz, memsz, buf_align,
+				    buf_min, buf_max, buf_end, 0);
+}
+
+unsigned long __attribute__((weak)) add_buffer(struct kexec_info *info,
+					       const void *buf,
+					       unsigned long bufsz,
+					       unsigned long memsz,
+					       unsigned long buf_align,
+					       unsigned long buf_min,
+					       unsigned long buf_max,
+					       int buf_end)
 {
-	unsigned long base;
-	int result;
-	int pagesize;
-
-	result = sort_segments(info);
-	if (result < 0) {
-		die("sort_segments failed\n");
-	}
-
-	/* Round memsz up to a multiple of pagesize */
-	pagesize = getpagesize();
-	memsz = (memsz + (pagesize - 1)) & ~(pagesize - 1);
-
-	base = locate_hole(info, memsz, buf_align, buf_min, buf_max, buf_end);
-	if (base == ULONG_MAX) {
-		die("locate_hole failed\n");
-	}
-
-	add_segment_virt(info, buf, bufsz, base, memsz);
-	return base;
+	return add_buffer_virt(info, buf, bufsz, memsz, buf_align,
+			       buf_min, buf_max, buf_end);
 }
-#endif
 
 char *slurp_file(const char *filename, off_t *r_size)
 {
Index: kexec-tools-testing-mips/kexec/kexec.h
===================================================================
--- kexec-tools-testing-mips.orig/kexec/kexec.h	2008-03-06 18:39:25.000000000 +0900
+++ kexec-tools-testing-mips/kexec/kexec.h	2008-03-06 18:45:53.000000000 +0900
@@ -188,12 +188,24 @@ extern void *xrealloc(void *ptr, size_t 
 extern char *slurp_file(const char *filename, off_t *r_size);
 extern char *slurp_file_len(const char *filename, off_t size);
 extern char *slurp_decompress_file(const char *filename, off_t *r_size);
+extern unsigned long virt_to_phys(unsigned long addr);
 extern void add_segment(struct kexec_info *info,
 	const void *buf, size_t bufsz, unsigned long base, size_t memsz);
+extern void add_segment_phys_virt(struct kexec_info *info,
+	const void *buf, size_t bufsz, unsigned long base, size_t memsz,
+	int phys);
 extern unsigned long add_buffer(struct kexec_info *info,
 	const void *buf, unsigned long bufsz, unsigned long memsz,
 	unsigned long buf_align, unsigned long buf_min, unsigned long buf_max,
 	int buf_end);
+extern unsigned long add_buffer_virt(struct kexec_info *info,
+	const void *buf, unsigned long bufsz, unsigned long memsz,
+	unsigned long buf_align, unsigned long buf_min, unsigned long buf_max,
+	int buf_end);
+extern unsigned long add_buffer_phys_virt(struct kexec_info *info,
+	const void *buf, unsigned long bufsz, unsigned long memsz,
+	unsigned long buf_align, unsigned long buf_min, unsigned long buf_max,
+	int buf_end, int phys);
 
 extern unsigned char purgatory[];
 extern size_t purgatory_size;

-- 

-- 
Horms


From horms@verge.net.au Thu Mar  6 10:02:11 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Mar 2008 10:02:17 +0000 (GMT)
Received: from koto.vergenet.net ([210.128.90.7]:9607 "EHLO koto.vergenet.net")
	by ftp.linux-mips.org with ESMTP id S28603259AbYCFJ5t (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 6 Mar 2008 09:57:49 +0000
Received: from tabatha.lab.ultramonkey.org (vagw.valinux.co.jp [210.128.90.14])
	by koto.vergenet.net (Postfix) with ESMTP id C0802341DA;
	Thu,  6 Mar 2008 18:57:31 +0900 (JST)
Received: by tabatha.lab.ultramonkey.org (Postfix, from userid 7100)
	id 6FEBD4F8FC; Thu,  6 Mar 2008 18:57:30 +0900 (JST)
Message-Id: <20080306094758.339979644@vergenet.net>
References: <20080306094637.669665743@vergenet.net>
User-Agent: quilt/0.46-1
Date:	Thu, 06 Mar 2008 18:46:38 +0900
From:	Simon Horman <horms@verge.net.au>
To:	kexec@lists.infradead.org, linux-mips@linux-mips.org
Cc:	Tomasz Chmielewski <mangoo@wpkg.org>,
	Francesco Chiechi <francesco.chiechi@colibre.it>
Subject: [patch 01/12] kexec-tools: mipsel: mipsel port
Content-Disposition: inline; filename=kexec-mips.patch
Return-Path: <horms@verge.net.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: 18351
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: horms@verge.net.au
Precedence: bulk
X-list: linux-mips

From: Francesco Chiechi <francesco.chiechi@colibre.it>

Hello,

We developed a patch to port kexec-tools to mips arch and included support for 
command line passing through elf boot notes.
We did it for a customer of ours on a specific platform derived from toshiba 
tx4938 (so we think it should work at least for tx4938 evaluation board also).
We would like to contribute it in case somebody else needs it or wants to 
improve it.
This patch works for us but the assembler part in particular, should be 
considered as a starting point because my assembly knowledge is not too deep.

As this is the first time I submit a patch I tried to guess reading tpp.txt if 
this is the right way to submit. Please let me know about any mistakes I may 
have made.

Signed-off-by: Simon Horman <horms@verge.net.au>

--- 

Wed, 27 Feb 2008 19:25:00 +0900
* Simon Horman <horms@verge.net.au>
- Upported to 20080227 release
- Note the #ifdef __MIPSEL__ stuff needs to be moved into kexec/arch/mipsel

Thu, 06 Mar 2008 18:19:22 +0900
* Simon Horman <horms@verge.net.au>
- Use tabs for indentation

 configure.ac                             |    2 
 kexec/arch/mipsel/Makefile               |    7 +
 kexec/arch/mipsel/include/arch/options.h |   11 +
 kexec/arch/mipsel/kexec-elf-mipsel.c     |  184 ++++++++++++++++++++++++++++++
 kexec/arch/mipsel/kexec-elf-rel-mipsel.c |   42 ++++++
 kexec/arch/mipsel/kexec-mipsel.c         |  167 +++++++++++++++++++++++++++
 kexec/arch/mipsel/kexec-mipsel.h         |   17 ++
 kexec/arch/mipsel/mipsel-setup-simple.S  |  110 +++++++++++++++++
 kexec/crashdump.c                        |    1 
 kexec/kexec-syscall.h                    |    3 
 kexec/kexec.c                            |  104 ++++++++++++++++
 purgatory/arch/mipsel/Makefile           |    7 +
 purgatory/arch/mipsel/console-mipsel.c   |    5 
 purgatory/arch/mipsel/include/limits.h   |   58 +++++++++
 purgatory/arch/mipsel/include/stdint.h   |   16 ++
 purgatory/arch/mipsel/purgatory-mipsel.c |    7 +
 purgatory/arch/mipsel/purgatory-mipsel.h |    6 
 17 files changed, 746 insertions(+), 1 deletion(-)

Index: kexec-tools-mips/configure.ac
===================================================================
--- kexec-tools-mips.orig/configure.ac	2008-02-27 18:05:46.000000000 +0900
+++ kexec-tools-mips/configure.ac	2008-02-27 18:05:49.000000000 +0900
@@ -38,7 +38,7 @@ case $target_cpu in
 	sh4|sh4a|sh3|sh )
 		ARCH="sh"
 		;;
-	ia64|x86_64|alpha )
+	ia64|x86_64|alpha|mipsel )
 		ARCH="$target_cpu"
 		;;
 	* )
Index: kexec-tools-mips/kexec/arch/mipsel/Makefile
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-mips/kexec/arch/mipsel/Makefile	2008-02-27 18:05:49.000000000 +0900
@@ -0,0 +1,7 @@
+#
+# kexec mipsel (linux booting linux)
+#
+KEXEC_C_SRCS+= kexec/arch/mipsel/kexec-mipsel.c
+KEXEC_C_SRCS+= kexec/arch/mipsel/kexec-elf-mipsel.c
+KEXEC_C_SRCS+= kexec/arch/mipsel/kexec-elf-rel-mipsel.c
+KEXEC_S_SRCS+= kexec/arch/mipsel/mipsel-setup-simple.S
Index: kexec-tools-mips/kexec/arch/mipsel/include/arch/options.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-mips/kexec/arch/mipsel/include/arch/options.h	2008-02-27 18:05:49.000000000 +0900
@@ -0,0 +1,11 @@
+#ifndef KEXEC_ARCH_MIPS_OPTIONS_H
+#define KEXEC_ARCH_MIPS_OPTIONS_H
+
+#define OPT_ARCH_MAX   (OPT_MAX+0)
+
+#define KEXEC_ARCH_OPTIONS \
+	KEXEC_OPTIONS \
+
+#define KEXEC_ARCH_OPT_STR KEXEC_OPT_STR ""
+
+#endif /* KEXEC_ARCH_MIPS_OPTIONS_H */
Index: kexec-tools-mips/kexec/arch/mipsel/kexec-elf-mipsel.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-mips/kexec/arch/mipsel/kexec-elf-mipsel.c	2008-02-27 18:05:49.000000000 +0900
@@ -0,0 +1,184 @@
+/*
+ * kexec-elf-mipsel.c - kexec Elf loader for mips
+ * Copyright (C) 2007 Francesco Chiechi, Alessandro Rubini
+ * Copyright (C) 2007 Tvblob s.r.l.
+ *
+ * derived from ../ppc/kexec-elf-ppc.c
+ * Copyright (C) 2004 Albert Herranz
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2.  See the file COPYING for more details.
+*/
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <getopt.h>
+#include <elf.h>
+#include <boot/elf_boot.h>
+#include <ip_checksum.h>
+#include "../../kexec.h"
+#include "../../kexec-elf.h"
+#include "kexec-mipsel.h"
+#include <arch/options.h>
+
+static const int probe_debug = 0;
+
+#define BOOTLOADER         "kexec"
+#define BOOTLOADER_VERSION VERSION
+#define MAX_COMMAND_LINE   256
+
+#define UPSZ(X) ((sizeof(X) + 3) & ~3)
+static struct boot_notes {
+	Elf_Bhdr hdr;
+	Elf_Nhdr bl_hdr;
+	unsigned char bl_desc[UPSZ(BOOTLOADER)];
+	Elf_Nhdr blv_hdr;
+	unsigned char blv_desc[UPSZ(BOOTLOADER_VERSION)];
+	Elf_Nhdr cmd_hdr;
+	unsigned char command_line[0];
+} elf_boot_notes = {
+	.hdr = {
+		.b_signature = 0x0E1FB007,
+		.b_size = sizeof(elf_boot_notes),
+		.b_checksum = 0,
+		.b_records = 3,
+	},
+	.bl_hdr = {
+		.n_namesz = 0,
+		.n_descsz = sizeof(BOOTLOADER),
+		.n_type = EBN_BOOTLOADER_NAME,
+	},
+	.bl_desc = BOOTLOADER,
+	.blv_hdr = {
+		.n_namesz = 0,
+		.n_descsz = sizeof(BOOTLOADER_VERSION),
+		.n_type = EBN_BOOTLOADER_VERSION,
+	},
+	.blv_desc = BOOTLOADER_VERSION,
+	.cmd_hdr = {
+		.n_namesz = 0,
+		.n_descsz = 0,
+		.n_type = EBN_COMMAND_LINE,
+	},
+};
+
+
+int elf_mipsel_probe(const char *buf, off_t len)
+{
+
+	struct mem_ehdr ehdr;
+	int result;
+	result = build_elf_exec_info(buf, len, &ehdr, 0);
+	if (result < 0) {
+		goto out;
+	}
+
+	/* Verify the architecuture specific bits */
+	if (ehdr.e_machine != EM_MIPS) {
+		/* for a different architecture */
+		if (probe_debug) {
+			fprintf(stderr, "Not for this architecture.\n");
+		}
+		result = -1;
+		goto out;
+	}
+	result = 0;
+ out:
+	free_elf_info(&ehdr);
+	return result;
+}
+
+void elf_mipsel_usage(void)
+{
+	printf
+	    (
+	     "    --command-line=STRING Set the kernel command line to STRING.  \n"
+	     "    --append=STRING       Set the kernel command line to STRING.  \n");
+}
+
+int elf_mipsel_load(int argc, char **argv, const char *buf, off_t len,
+	struct kexec_info *info)
+{
+	struct mem_ehdr ehdr;
+	char *arg_buf;
+	size_t arg_bytes;
+	unsigned long arg_base;
+	struct boot_notes *notes;
+	size_t note_bytes;
+	const char *command_line;
+	int command_line_len;
+	unsigned char *setup_start;
+	uint32_t setup_size;
+	int result;
+	int opt;
+	int i;
+#define OPT_APPEND     (OPT_ARCH_MAX+0)
+	static const struct option options[] = {
+		KEXEC_ARCH_OPTIONS
+		{"command-line", 1, 0, OPT_APPEND},
+		{"append",       1, 0, OPT_APPEND},
+		{0, 0, 0, 0},
+	};
+
+	static const char short_options[] = KEXEC_ARCH_OPT_STR "d";
+
+	command_line = 0;
+	while ((opt = getopt_long(argc, argv, short_options, options, 0)) != -1) {
+		switch (opt) {
+		default:
+			/* Ignore core options */
+			if (opt < OPT_ARCH_MAX) {
+				break;
+			}
+		case '?':
+			usage();
+			return -1;
+		case OPT_APPEND:
+			command_line = optarg;
+			break;
+		}
+	}
+	command_line_len = 0;
+	setup_simple_regs.spr9 = 0;
+	if (command_line) {
+		command_line_len = strlen(command_line) + 1;
+		setup_simple_regs.spr9 = 2;
+	}
+
+	/* Load the ELF executable */
+	elf_exec_build_load(info, &ehdr, buf, len, 0);
+
+	setup_start = setup_simple_start;
+	setup_size = setup_simple_size;
+	setup_simple_regs.spr8 = ehdr.e_entry;
+
+	note_bytes = sizeof(elf_boot_notes) + ((command_line_len + 3) & ~3);
+	arg_bytes = note_bytes + ((setup_size + 3) & ~3);
+
+	arg_buf = xmalloc(arg_bytes);
+	arg_base = add_buffer_virt(info,
+		 arg_buf, arg_bytes, arg_bytes, 4, 0, elf_max_addr(&ehdr), 1);
+
+	notes = (struct boot_notes *)(arg_buf + ((setup_size + 3) & ~3));
+
+	memcpy(arg_buf, setup_start, setup_size);
+	memcpy(notes, &elf_boot_notes, sizeof(elf_boot_notes));
+	memcpy(notes->command_line, command_line, command_line_len);
+
+	notes->hdr.b_size = note_bytes;
+	notes->cmd_hdr.n_descsz = command_line_len;
+	notes->hdr.b_checksum = compute_ip_checksum(notes, note_bytes);
+
+	info->entry = (void *)arg_base;
+
+	return 0;
+}
+
Index: kexec-tools-mips/kexec/arch/mipsel/kexec-elf-rel-mipsel.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-mips/kexec/arch/mipsel/kexec-elf-rel-mipsel.c	2008-02-27 18:05:49.000000000 +0900
@@ -0,0 +1,42 @@
+/*
+ * kexec-elf-rel-mipsel.c - kexec Elf relocation routines
+ * Copyright (C) 2007 Francesco Chiechi, Alessandro Rubini
+ * Copyright (C) 2007 Tvblob s.r.l.
+ *
+ * derived from ../ppc/kexec-elf-rel-ppc.c
+ * Copyright (C) 2004 Albert Herranz
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2.  See the file COPYING for more details.
+*/
+
+#include <stdio.h>
+#include <elf.h>
+#include "../../kexec.h"
+#include "../../kexec-elf.h"
+
+int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+{
+	if (ehdr->ei_data != ELFDATA2MSB) {
+		return 0;
+	}
+	if (ehdr->ei_class != ELFCLASS32) {
+		return 0;
+	}
+	if (ehdr->e_machine != EM_MIPS) {
+		return 0;
+	}
+	return 1;
+}
+
+void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type,
+	void *location, unsigned long address, unsigned long value)
+{
+	switch(r_type) {
+
+	default:
+		die("Unknown rela relocation: %lu\n", r_type);
+		break;
+	}
+	return;
+}
Index: kexec-tools-mips/kexec/arch/mipsel/kexec-mipsel.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-mips/kexec/arch/mipsel/kexec-mipsel.c	2008-02-27 18:05:49.000000000 +0900
@@ -0,0 +1,167 @@
+/*
+ * kexec-mipsel.c - kexec for mips
+ * Copyright (C) 2007 Francesco Chiechi, Alessandro Rubini
+ * Copyright (C) 2007 Tvblob s.r.l.
+ *
+ * derived from ../ppc/kexec-mipsel.c
+ * Copyright (C) 2004, 2005 Albert Herranz
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2.  See the file COPYING for more details.
+ */
+
+#include <stddef.h>
+#include <stdio.h>
+#include <errno.h>
+#include <stdint.h>
+#include <string.h>
+#include <getopt.h>
+#include <sys/utsname.h>
+#include "../../kexec.h"
+#include "../../kexec-syscall.h"
+#include "kexec-mipsel.h"
+#include <arch/options.h>
+
+#define MAX_MEMORY_RANGES  64
+#define MAX_LINE          160
+static struct memory_range memory_range[MAX_MEMORY_RANGES];
+
+/* Return a sorted list of memory ranges. */
+int get_memory_ranges(struct memory_range **range, int *ranges, unsigned long kexec_flags)
+{
+	int memory_ranges = 0;
+
+#if 1
+	/* this is valid for gemini2 platform based on tx4938
+	 * in our case, /proc/iomem doesn't report ram space
+	 */
+	 memory_range[memory_ranges].start = 0x00000000;
+	 memory_range[memory_ranges].end = 0x04000000;
+	 memory_range[memory_ranges].type = RANGE_RAM;
+	 memory_ranges++;
+#else
+#error Please, fix this for your platform
+	const char iomem[] = "/proc/iomem";
+	char line[MAX_LINE];
+	FILE *fp;
+	unsigned long long start, end;
+	char *str;
+	int type, consumed, count;
+
+	fp = fopen(iomem, "r");
+	if (!fp) {
+		fprintf(stderr, "Cannot open %s: %s\n", iomem, strerror(errno));
+		return -1;
+	}
+	while (fgets(line, sizeof(line), fp) != 0) {
+		if (memory_ranges >= MAX_MEMORY_RANGES)
+			break;
+		count = sscanf(line, "%Lx-%Lx : %n", &start, &end, &consumed);
+		if (count != 2)
+			continue;
+		str = line + consumed;
+		end = end + 1;
+#if 0
+		printf("%016Lx-%016Lx : %s\n", start, end, str);
+#endif
+		if (memcmp(str, "System RAM\n", 11) == 0) {
+			type = RANGE_RAM;
+		} else if (memcmp(str, "reserved\n", 9) == 0) {
+			type = RANGE_RESERVED;
+		} else if (memcmp(str, "ACPI Tables\n", 12) == 0) {
+			type = RANGE_ACPI;
+		} else if (memcmp(str, "ACPI Non-volatile Storage\n", 26) == 0) {
+			type = RANGE_ACPI_NVS;
+		} else {
+			continue;
+		}
+		memory_range[memory_ranges].start = start;
+		memory_range[memory_ranges].end = end;
+		memory_range[memory_ranges].type = type;
+#if 0
+		printf("%016Lx-%016Lx : %x\n", start, end, type);
+#endif
+		memory_ranges++;
+	}
+	fclose(fp);
+#endif
+
+	*range = memory_range;
+	*ranges = memory_ranges;
+	return 0;
+}
+
+struct file_type file_type[] = {
+	{"elf-mipsel", elf_mipsel_probe, elf_mipsel_load, elf_mipsel_usage},
+};
+int file_types = sizeof(file_type) / sizeof(file_type[0]);
+
+void arch_usage(void)
+{
+}
+
+static struct {
+} arch_options = {
+};
+int arch_process_options(int argc, char **argv)
+{
+	static const struct option options[] = {
+		KEXEC_ARCH_OPTIONS
+		{ 0,                    0, NULL, 0 },
+	};
+	static const char short_options[] = KEXEC_ARCH_OPT_STR;
+	int opt;
+	unsigned long value;
+	char *end;
+
+	opterr = 0; /* Don't complain about unrecognized options here */
+	while((opt = getopt_long(argc, argv, short_options, options, 0)) != -1) {
+		switch(opt) {
+		default:
+			break;
+		}
+	}
+	/* Reset getopt for the next pass; called in other source modules */
+	opterr = 1;
+	optind = 1;
+	return 0;
+}
+
+int arch_compat_trampoline(struct kexec_info *info)
+{
+	int result;
+	struct utsname utsname;
+	result = uname(&utsname);
+	if (result < 0) {
+		fprintf(stderr, "uname failed: %s\n",
+			strerror(errno));
+		return -1;
+	}
+	 if (strcmp(utsname.machine, "mips") == 0)
+	 {
+		 /* For compatibility with older patches
+		  * use KEXEC_ARCH_DEFAULT instead of KEXEC_ARCH_MIPS here.
+		  */
+		info->kexec_flags |= KEXEC_ARCH_DEFAULT;
+	 }
+	else {
+		fprintf(stderr, "Unsupported machine type: %s\n",
+			utsname.machine);
+		return -1;
+	}
+	return 0;
+}
+
+void arch_update_purgatory(struct kexec_info *info)
+{
+}
+
+/*
+ * Adding a dummy function, so that build on mipsel will not break.
+ * Need to implement the actual checking code
+ */
+int is_crashkernel_mem_reserved(void)
+{
+	return 1;
+}
+
Index: kexec-tools-mips/kexec/arch/mipsel/kexec-mipsel.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-mips/kexec/arch/mipsel/kexec-mipsel.h	2008-02-27 18:05:49.000000000 +0900
@@ -0,0 +1,17 @@
+#ifndef KEXEC_MIPS_H
+#define KEXEC_MIPS_H
+
+extern unsigned char setup_simple_start[];
+extern uint32_t setup_simple_size;
+
+extern struct {
+	uint32_t spr8;
+	uint32_t spr9;
+} setup_simple_regs;
+
+int elf_mipsel_probe(const char *buf, off_t len);
+int elf_mipsel_load(int argc, char **argv, const char *buf, off_t len,
+	struct kexec_info *info);
+void elf_mipsel_usage(void);
+
+#endif /* KEXEC_MIPS_H */
Index: kexec-tools-mips/kexec/arch/mipsel/mipsel-setup-simple.S
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-mips/kexec/arch/mipsel/mipsel-setup-simple.S	2008-02-27 18:05:49.000000000 +0900
@@ -0,0 +1,110 @@
+/*
+ * mipsel-setup-simple.S - code to execute before kernel to handle command line
+ * Copyright (C) 2007 Francesco Chiechi, Alessandro Rubini
+ * Copyright (C) 2007 Tvblob s.r.l.
+ *
+ * derived from Albert Herranz idea (ppc) adding command line support
+ * (boot_notes structure)
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2.  See the file COPYING for more details.
+ */
+
+/*
+ * Only suitable for platforms booting with MMU turned off.
+ * -- Albert Herranz
+ */
+#include "regdef.h"
+
+/* returns  t0 = relocated address of sym */
+/* modifies t1 t2 */
+/* sym must not be global or this will not work (at least AFAIK up to now) */
+#define RELOC_SYM(sym)                                                 \
+	move    t0,ra;          /* save ra */                           \
+	bal 1f;                                                         \
+1:                                                                     \
+	move    t1,ra;          /* now t1 is 1b (where we are now) */   \
+	move    ra,t0;          /* restore ra */                        \
+	lui     t2,%hi(1b);                                             \
+	ori     t2,t2,%lo(1b);                                          \
+	lui     t0,%hi(sym);                                            \
+	ori     t0,t0,%lo(sym);                                         \
+	sub     t0,t0,t2;       /* t0 = offset between sym and 1b */    \
+	add     t0,t1,t0;       /* t0 = actual address in memory */
+
+	.data
+	.globl setup_simple_start
+setup_simple_start:
+
+	/* should perform here any required setup */
+
+	/* Initialize GOT pointer (verify if needed) */
+	bal     1f
+	nop
+	.word   _GLOBAL_OFFSET_TABLE_
+	1:
+	move    gp, ra
+	lw      t1, 0(ra)
+	move    gp, t1
+
+	/* spr8 relocation */
+	RELOC_SYM(spr8)
+
+	move    t4,t0           // save pointer to kernel start addr
+	lw      t3,0(t0)        // save kernel start address
+
+	/* spr9 relocation */
+	RELOC_SYM(spr9)
+	lw      a0,0(t0)        // load argc
+
+	// this code is to be changed if boot_notes struct changes
+	lw      t2,12(t4)       // t2 is size of boot_notes struct
+	addi    t2,t2,3
+	srl     t2,t2,2
+	sll     v1,t2,2         // v1 = size of boot_notes struct
+				// aligned to word boundary
+
+	addi    t0,t4,0x20      // t0 contains the address of "kexec" string
+	add     v0,t4,v1        // v0 points to last word of boot_notes
+	addi    v0,v0,8         // v0 points to address after boot_notes
+	sw      t0,0(v0)        // store pointer to "kexec" string there
+
+	lw      t2,-8(t0)       // t2 is size of "kexec" string in bytes
+	addi    t2,t2,3
+	srl     t2,t2,2
+	sll     v1,t2,2         // v1 = size of "kexec" string
+				// aligned to word boundary
+	add     t2,t0,v1
+	addi    t0,t2,4         // t0 points to size of version string
+
+	lw      t2,0(t0)        // t2 is size of version string in bytes
+	addi    t2,t2,3
+	srl     t2,t2,2
+	sll     v1,t2,2         // v1 = size of version string
+				// aligned to word boundary
+
+	addi    t0,t0,8         // t0 points to version string
+	add     t0,t0,v1        // t0 points to start of command_line record
+	addi    t0,t0,12        // t0 points command line
+
+	sw      t0,4(v0)        // store pointer to command line
+
+	move    a1,v0           // load argv
+	li      a2,0
+	li      a3,0
+
+	jr      t3
+	nop
+
+	.balign 4
+	.globl setup_simple_regs
+setup_simple_regs:
+spr8:	.long 0x00000000
+spr9:	.long 0x00000000
+
+setup_simple_end:
+
+	.globl setup_simple_size
+setup_simple_size:
+	.long setup_simple_end - setup_simple_start
+
Index: kexec-tools-mips/kexec/crashdump.c
===================================================================
--- kexec-tools-mips.orig/kexec/crashdump.c	2008-02-27 18:05:46.000000000 +0900
+++ kexec-tools-mips/kexec/crashdump.c	2008-02-27 18:05:49.000000000 +0900
@@ -22,6 +22,7 @@
 #include <string.h>
 #include <errno.h>
 #include <limits.h>
+#include <linux/limits.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
Index: kexec-tools-mips/kexec/kexec-syscall.h
===================================================================
--- kexec-tools-mips.orig/kexec/kexec-syscall.h	2008-02-27 18:05:46.000000000 +0900
+++ kexec-tools-mips/kexec/kexec-syscall.h	2008-02-27 18:05:49.000000000 +0900
@@ -49,6 +49,9 @@
 #ifdef __arm__
 #define __NR_kexec_load		__NR_SYSCALL_BASE + 347  
 #endif
+#ifdef __MIPSEL__
+#define __NR_kexec_load                4311
+#endif
 #ifndef __NR_kexec_load
 #error Unknown processor architecture.  Needs a kexec_load syscall number.
 #endif
Index: kexec-tools-mips/kexec/kexec.c
===================================================================
--- kexec-tools-mips.orig/kexec/kexec.c	2008-02-27 18:05:46.000000000 +0900
+++ kexec-tools-mips/kexec/kexec.c	2008-02-27 18:05:49.000000000 +0900
@@ -3,6 +3,8 @@
  *
  * Copyright (C) 2003-2005  Eric Biederman (ebiederm@xmission.com)
  *
+ * Modified (2007-05-15) by Francesco Chiechi to rudely handle mips platform
+ *
  * 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 (version 2 of the License).
@@ -42,6 +44,10 @@
 #include "kexec-sha256.h"
 #include <arch/options.h>
 
+#ifdef __MIPSEL__
+#define virt_to_phys(X) ((X) - 0x80000000)
+#endif
+
 unsigned long long mem_min = 0;
 unsigned long long mem_max = ULONG_MAX;
 
@@ -290,6 +296,74 @@ void add_segment(struct kexec_info *info
 	unsigned long last;
 	size_t size;
 	int pagesize;
+#ifdef __MIPSEL__
+	unsigned long base_phys;
+#endif
+
+	if (bufsz > memsz) {
+		bufsz = memsz;
+	}
+	/* Forget empty segments */
+	if (memsz == 0) {
+		return;
+	}
+
+	/* Round memsz up to a multiple of pagesize */
+	pagesize = getpagesize();
+	memsz = (memsz + (pagesize - 1)) & ~(pagesize - 1);
+
+#ifdef __MIPSEL__
+	base_phys=virt_to_phys(base);
+#endif
+	/* Verify base is pagesize aligned.
+	 * Finding a way to cope with this problem
+	 * is important but for now error so at least
+	 * we are not surprised by the code doing the wrong
+	 * thing.
+	 */
+	if (base & (pagesize -1)) {
+		die("Base address: %x is not page aligned\n", base);
+	}
+
+#ifdef __MIPSEL__
+	last = base_phys + memsz -1;
+	if (!valid_memory_range(info, base_phys, last)) {
+		die("Invalid memory segment %p - %p\n",
+			(void *)base_phys, (void *)last);
+	}
+#else
+	last = base + memsz -1;
+	if (!valid_memory_range(info, base, last)) {
+		die("Invalid memory segment %p - %p\n",
+			(void *)base, (void *)last);
+	}
+#endif
+
+	size = (info->nr_segments + 1) * sizeof(info->segment[0]);
+	info->segment = xrealloc(info->segment, size);
+	info->segment[info->nr_segments].buf   = buf;
+	info->segment[info->nr_segments].bufsz = bufsz;
+#ifdef __MIPSEL__
+	info->segment[info->nr_segments].mem   = (void *)base_phys;
+#else
+	info->segment[info->nr_segments].mem   = (void *)base;
+#endif
+	info->segment[info->nr_segments].memsz = memsz;
+	info->nr_segments++;
+	if (info->nr_segments > KEXEC_MAX_SEGMENTS) {
+		fprintf(stderr, "Warning: kernel segment limit reached. "
+			"This will likely fail\n");
+	}
+}
+
+#ifdef __MIPSEL__
+void add_segment_virt(struct kexec_info *info,
+	const void *buf, size_t bufsz,
+	unsigned long base, size_t memsz)
+{
+	unsigned long last;
+	size_t size;
+	int pagesize;
 
 	if (bufsz > memsz) {
 		bufsz = memsz;
@@ -331,6 +405,7 @@ void add_segment(struct kexec_info *info
 			"This will likely fail\n");
 	}
 }
+#endif
 
 unsigned long add_buffer(struct kexec_info *info,
 	const void *buf, unsigned long bufsz, unsigned long memsz,
@@ -359,6 +434,35 @@ unsigned long add_buffer(struct kexec_in
 	return base;
 }
 
+#ifdef __MIPSEL__
+unsigned long add_buffer_virt(struct kexec_info *info,
+	const void *buf, unsigned long bufsz, unsigned long memsz,
+	unsigned long buf_align, unsigned long buf_min, unsigned long buf_max,
+	int buf_end)
+{
+	unsigned long base;
+	int result;
+	int pagesize;
+
+	result = sort_segments(info);
+	if (result < 0) {
+		die("sort_segments failed\n");
+	}
+
+	/* Round memsz up to a multiple of pagesize */
+	pagesize = getpagesize();
+	memsz = (memsz + (pagesize - 1)) & ~(pagesize - 1);
+
+	base = locate_hole(info, memsz, buf_align, buf_min, buf_max, buf_end);
+	if (base == ULONG_MAX) {
+		die("locate_hole failed\n");
+	}
+
+	add_segment_virt(info, buf, bufsz, base, memsz);
+	return base;
+}
+#endif
+
 char *slurp_file(const char *filename, off_t *r_size)
 {
 	int fd;
Index: kexec-tools-mips/purgatory/arch/mipsel/Makefile
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-mips/purgatory/arch/mipsel/Makefile	2008-02-27 18:05:49.000000000 +0900
@@ -0,0 +1,7 @@
+#
+# Purgatory mipsel
+#
+
+PURGATORY_C_SRCS+= purgatory/arch/mipsel/purgatory-mipsel.c
+PURGATORY_C_SRCS+= purgatory/arch/mipsel/console-mipsel.c
+
Index: kexec-tools-mips/purgatory/arch/mipsel/console-mipsel.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-mips/purgatory/arch/mipsel/console-mipsel.c	2008-02-27 18:05:49.000000000 +0900
@@ -0,0 +1,5 @@
+#include <purgatory.h>
+void putchar(int ch)
+{
+	/* Nothing for now */
+}
Index: kexec-tools-mips/purgatory/arch/mipsel/include/limits.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-mips/purgatory/arch/mipsel/include/limits.h	2008-02-27 18:05:49.000000000 +0900
@@ -0,0 +1,58 @@
+#ifndef LIMITS_H
+#define LIMITS_H       1
+
+
+/* Number of bits in a `char' */
+#define CHAR_BIT       8
+
+/* Minimum and maximum values a `signed char' can hold */
+#define SCHAR_MIN      (-128)
+#define SCHAR_MAX      127
+
+/* Maximum value an `unsigned char' can hold. (Minimum is 0.) */
+#define UCHAR_MAX      255
+
+/* Minimum and maximum values a `char' can hold */
+#define CHAR_MIN       SCHAR_MIN
+#define CHAR_MAX       SCHAR_MAX
+
+/* Minimum and maximum values a `signed short int' can hold */
+#define SHRT_MIN       (-32768)
+#define SHRT_MAX       32767
+
+/* Maximum value an `unsigned short' can hold. (Minimum is 0.) */
+#define USHRT_MAX      65535
+
+
+/* Minimum and maximum values a `signed int' can hold */
+#define INT_MIN                (-INT_MAX - 1)
+#define INT_MAX                2147483647
+
+/* Maximum value an `unsigned int' can hold. (Minimum is 0.) */
+#define UINT_MAX       4294967295U
+
+
+/* Minimum and maximum values a `signed int' can hold */
+#define INT_MIN                (-INT_MAX - 1)
+#define INT_MAX                2147483647
+
+/* Maximum value an `unsigned int' can hold. (Minimum is 0.) */
+#define UINT_MAX       4294967295U
+
+/* Minimum and maximum values a `signed long' can hold */
+#define LONG_MAX       2147483647L
+#define LONG_MIN       (-LONG_MAX - 1L)
+
+/* Maximum value an `unsigned long' can hold. (Minimum is 0.) */
+#define ULONG_MAX      4294967295UL
+
+/* Minimum and maximum values a `signed long long' can hold */
+#define LLONG_MAX      9223372036854775807LL
+#define LLONG_MIN      (-LONG_MAX - 1LL)
+
+
+/* Maximum value an `unsigned long long' can hold. (Minimum is 0.) */
+#define ULLONG_MAX     18446744073709551615ULL
+
+
+#endif /* LIMITS_H */
Index: kexec-tools-mips/purgatory/arch/mipsel/include/stdint.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-mips/purgatory/arch/mipsel/include/stdint.h	2008-02-27 18:05:49.000000000 +0900
@@ -0,0 +1,16 @@
+#ifndef STDINT_H
+#define STDINT_H
+
+typedef unsigned long      size_t;
+
+typedef unsigned char      uint8_t;
+typedef unsigned short     uint16_t;
+typedef unsigned int       uint32_t;
+typedef unsigned long long uint64_t;
+
+typedef signed char        int8_t;
+typedef signed short       int16_t;
+typedef signed int         int32_t;
+typedef signed long long   int64_t;
+
+#endif /* STDINT_H */
Index: kexec-tools-mips/purgatory/arch/mipsel/purgatory-mipsel.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-mips/purgatory/arch/mipsel/purgatory-mipsel.c	2008-02-27 18:05:49.000000000 +0900
@@ -0,0 +1,7 @@
+#include <purgatory.h>
+#include "purgatory-mipsel.h"
+
+void setup_arch(void)
+{
+	/* Nothing for now */
+}
Index: kexec-tools-mips/purgatory/arch/mipsel/purgatory-mipsel.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-mips/purgatory/arch/mipsel/purgatory-mipsel.h	2008-02-27 18:05:49.000000000 +0900
@@ -0,0 +1,6 @@
+#ifndef PURGATORY_MIPSEL_H
+#define PURGATORY_MIPSEL_H
+
+/* nothing yet */
+
+#endif /* PURGATORY_MIPSEL_H */

-- 

-- 
Horms


From horms@verge.net.au Thu Mar  6 10:02:38 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Mar 2008 10:02:42 +0000 (GMT)
Received: from koto.vergenet.net ([210.128.90.7]:15239 "EHLO koto.vergenet.net")
	by ftp.linux-mips.org with ESMTP id S28603250AbYCFJ6K (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 6 Mar 2008 09:58:10 +0000
Received: from tabatha.lab.ultramonkey.org (vagw.valinux.co.jp [210.128.90.14])
	by koto.vergenet.net (Postfix) with ESMTP id B2902341BD;
	Thu,  6 Mar 2008 18:58:03 +0900 (JST)
Received: by tabatha.lab.ultramonkey.org (Postfix, from userid 7100)
	id 9EB944F8B5; Thu,  6 Mar 2008 18:58:03 +0900 (JST)
Message-Id: <20080306094637.669665743@vergenet.net>
User-Agent: quilt/0.46-1
Date:	Thu, 06 Mar 2008 18:46:37 +0900
From:	Simon Horman <horms@verge.net.au>
To:	kexec@lists.infradead.org, linux-mips@linux-mips.org
Cc:	Tomasz Chmielewski <mangoo@wpkg.org>,
	Francesco Chiechi <francesco.chiechi@colibre.it>
Subject: [patch 00/12] Intention to merge mipsel into kexec-tools-testing
Return-Path: <horms@verge.net.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: 18352
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: horms@verge.net.au
Precedence: bulk
X-list: linux-mips

Hi,

Using qemu I have been able to satisfy myself that Francesco Chiechi's
patch to add mipsel to kexec-tools works.

I have upported this patch and made various cosmetic changes too it, as per
this series of patches. I intend to merge these patches.

One thing that clearly needs further work is the handling of the command
line passed to the second kernel. In preamble to his patch Francesco makes
mention that his patch uses elf boot nodes to pass the command line.
Inspection of the code reflects this.

However in my limited understanding this only supports a subset of mipsel
hardware. In particular, I notice that it does not use qemu. I wonder if
ultimately kexec-tools will need a --machine or --boot-protocol parameter
or something of that nature.

-- 
Horms

From learn.mips.linux@gmail.com Thu Mar  6 10:06:30 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Mar 2008 10:06:32 +0000 (GMT)
Received: from ti-out-0910.google.com ([209.85.142.191]:23826 "EHLO
	ti-out-0910.google.com") by ftp.linux-mips.org with ESMTP
	id S28603243AbYCFKGa (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 6 Mar 2008 10:06:30 +0000
Received: by ti-out-0910.google.com with SMTP id j3so2455997tid.20
        for <linux-mips@linux-mips.org>; Thu, 06 Mar 2008 02:06:27 -0800 (PST)
DKIM-Signature:	v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type;
        bh=yzyTJlZxWmvXKsp4OVVyFxBrxkuWU4qbdCbKCc/k+zc=;
        b=Bt4o0yXo9Sh9ymJMtkj5TjbzfF7zmOEE6PVSdVQkT7AjyYO4P+WUZFYoDtseOAYj28NTcsXFEOvD4Ji2ZN/HciVGHDmsuPoMNEDUhwkptjDggvRbcNK/PzLx7k0qSEROa4IJIE9rSpsku0IRSdIEJnhVmRaTkup++cazlLtiLoU=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:to:subject:mime-version:content-type;
        b=syeQ4YXUVKh41UH2eJxMQCd7YXhBI2m+sG8Sn+imT77JP9/ixD/3T5C8gcxVSfmIhTuSWaPXj1GI0NGJLDTG+cTmsB54Nd+fpY+EQSSzBoWeYGBE5L8CepQR1ffJbCntSGZVS221zoktsyVRI7YiBfeq4plUoVaH35ZU61lLD9E=
Received: by 10.150.192.7 with SMTP id p7mr1826730ybf.90.1204797986035;
        Thu, 06 Mar 2008 02:06:26 -0800 (PST)
Received: by 10.151.14.12 with HTTP; Thu, 6 Mar 2008 02:06:26 -0800 (PST)
Message-ID: <56ef64000803060206n44a3b611h831effa4132d33b5@mail.gmail.com>
Date:	Thu, 6 Mar 2008 15:36:26 +0530
From:	"learn linux" <learn.mips.linux@gmail.com>
To:	linux-mips@linux-mips.org
Subject: Need info in booting kernel using JTAG
MIME-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_24066_11345285.1204797986021"
Return-Path: <learn.mips.linux@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: 18353
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: learn.mips.linux@gmail.com
Precedence: bulk
X-list: linux-mips

------=_Part_24066_11345285.1204797986021
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi all,

                 I am beginner to the Linux and JTAG. I have a board using
Infineon's "INCA-IP PSB 21553/PSB 21521 (which has MIPS 4kc core). I want to
boot the linux kernel in JTAG mode. I am using Lauterbach Trace32 tool,
which runs on a windows PC.
    I had gone through the help files provided in Trace 32 itself. It
mentions about the usage of the tool. But I need information about how to
make a setup in such a way that I could boot the kernel in JTAG mode.
Basically I wanted to debug a kernel module.

    Please guide how to make this setup and what are the things that I
should take care in achieving the same.

Thanks in advance,
Sudeep.

------=_Part_24066_11345285.1204797986021
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<span class="ppt" id="_user_linux-mips@linux-mips.org">Hi all,<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
I am beginner to the Linux and JTAG. I have a board using Infineon&#39;s
&quot;INCA-IP PSB 21553/PSB 21521 (which has MIPS 4kc core). I want to boot
the linux kernel in JTAG mode. I am using Lauterbach Trace32 tool,
which runs on a windows PC.<br>
&nbsp;&nbsp;&nbsp; I had gone through the help files provided in Trace
32 itself. It mentions about the usage of the tool. But I need
information about how to make a setup in such a way that I could boot
the kernel in JTAG mode. Basically I wanted to debug a kernel module.<br>
<br>
&nbsp;&nbsp;&nbsp; Please guide how to make this setup and what are the things that I should take care in achieving the same.<br>
<br>
Thanks in advance,<br>
Sudeep.<br>
</span>

------=_Part_24066_11345285.1204797986021--

From ralf@linux-mips.org Thu Mar  6 15:44:17 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Mar 2008 15:44:19 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:44986 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28603659AbYCFPoR (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 6 Mar 2008 15:44:17 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m26FiEAq016037;
	Thu, 6 Mar 2008 15:44:15 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m26FiD34016036;
	Thu, 6 Mar 2008 15:44:13 GMT
Date:	Thu, 6 Mar 2008 15:44:13 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	David VomLehn <dvomlehn@cisco.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: Does HIGHMEM work on 32-bit MIPS ports?
Message-ID: <20080306154413.GA4537@linux-mips.org>
References: <47CF24F4.4010508@cisco.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <47CF24F4.4010508@cisco.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18354
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, Mar 05, 2008 at 02:55:48PM -0800, David VomLehn wrote:

> We've made significant progress in getting HIGHMEM to work on our 24K 
> processor, but things do not completely work yet. Since I don't yet have 
> confidence that we know everything that's going on, I"m not ready to submit 
> a full-blown patch, but here's what we've done so far. Please send 
> comments/suggestions...

Even a work in progress patch would be useful.

> The function __flush_dcache_page (in arch/mips/mm/cache.c) was simply 
> returning if the struct page* argument it was given indicated we had a page 
> in high memory, so the dcache was never being flushed. This is an obvious 
> Bad Thing.

Sort of.  It could be argued that the flushing of highmem pages should
be done on kunmap but I haven't researched that into depth.

> Our first modification was to expand the check for high memory. If the page 
> had a temporary mapping, i.e. it was mapped through kmap_atomic(), we call 
> flush_data_cache_page(). We then immediately return:
>
>    if (PageHighMem(page)) {
>        addr = (unsigned long)kmap_atomic_to_vaddr(page);
>        if (addr != 0) {
>            flush_data_cache_page(addr);
>        }
>        return;
>    }
>
> (kmap_atomic_to_vaddr() returns the virtual address if the page is mapped 
> with kmap_atomic(), otherwise it returns NULL). This change by itself is 
> enough to be able to boot with NFS most of the time. I think it is not 
> sufficient for permanently mapped kernel pages (those mapped with 
> kmap_high()). So, I made two other modifications.
>
> Additional Modification #1: To me, it looks like the return should be moved 
> to right after the call to flush_data_cache_page() so that we only return 
> immediately for temporary kernel mappings.
>
> The next section of code, which I think already works correctly with high 
> memory, is:
>
>    if (mapping && !mapping_mapped(mapping)) {
>        SetPageDcacheDirty(page);
>        return;
>    }
>
> We then have the following:
>
>    addr = (unsigned long) page_address(page);
>    flush_data_cache_page(addr);
>
> Additional Modification #2: If the page is in high memory, it may not have 
> a kernel mapping, in which case page_address() will return NULL. So, I've 
> modified the code to only call flush_data_cache_page() if the 
> page_address() doesn't return NULL.

This assumes that kunmap and kunmap_atomic flush the cache.

> With the two additional modifications above, thing are still not completely 
> reliable. So, two questions:
>
>   1. Does what we've done so far make sense?
>   2. Since the behavior is still somewhat flaky, I'm still missing
>      something. Any suggestions?

copy_user_highpage, copy_to_user_page and copy_from_user_page could use
some review for correctness for the highmem case.

  Ralf

From ralf@linux-mips.org Thu Mar  6 15:50:53 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Mar 2008 15:50:56 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:19130 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28603665AbYCFPux (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 6 Mar 2008 15:50:53 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m26FogJi016362;
	Thu, 6 Mar 2008 15:50:42 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m26FnriU016331;
	Thu, 6 Mar 2008 15:49:53 GMT
Date:	Thu, 6 Mar 2008 15:49:53 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	okumoto@ucsd.edu, linux-mips@linux-mips.org
Subject: Re: Toshiba JMR 3927 working setup?
Message-ID: <20080306154952.GA16097@linux-mips.org>
References: <479A134D.7090206@ucsd.edu> <20080126.140802.126142689.anemo@mba.ocn.ne.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080126.140802.126142689.anemo@mba.ocn.ne.jp>
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18355
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, Jan 26, 2008 at 02:08:02PM +0900, Atsushi Nemoto wrote:

> 
> On Fri, 25 Jan 2008 08:50:21 -0800, Max Okumoto <okumoto@ucsd.edu> wrote:
> > I have a JMR3927 based system and I got it to work with the 2.6.23.14 kernel, but
> > used 0xff0000 instead of 0xff000.  The offset passed in was 0xfffec000 which isn't
> > within the 0xff000000 - 0xff0ff000.
> 
> Thank you for good news.  (and excuse my double fault...)
> 
> Ralf, please apply this to 2.6.23-stable and 2.6.24-stable.

Applied.  Thanks,

  Ralf

From ralf@linux-mips.org Thu Mar  6 16:59:41 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Mar 2008 16:59:43 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:22466 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28603703AbYCFQ7l (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 6 Mar 2008 16:59:41 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m26GxeQ6021242;
	Thu, 6 Mar 2008 16:59:40 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m26Gxdl2021241;
	Thu, 6 Mar 2008 16:59:39 GMT
Date:	Thu, 6 Mar 2008 16:59:39 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Daniel Laird <daniel.j.laird@nxp.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] : Move arch/mips/philips to arch/mips/nxp
Message-ID: <20080306165939.GB16365@linux-mips.org>
References: <64660ef00803060107m16fb4a4uc0153ea3c6658b8f@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <64660ef00803060107m16fb4a4uc0153ea3c6658b8f@mail.gmail.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18356
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, Mar 06, 2008 at 09:07:18AM +0000, Daniel Laird wrote:
> From: Daniel Laird <daniel.j.laird@nxp.com>
> Date: Thu, 6 Mar 2008 09:07:18 +0000
> To: linux-mips@linux-mips.org
> Subject: [PATCH] : Move arch/mips/philips to arch/mips/nxp
> Content-Type: text/plain; charset=ISO-8859-1
> 
>  The following patch moves arch/mips/philips to arch/mips/nxp along
>  with the supporting changes:
>  This is required before I can start posting new chipset support.

There were still a few lines which got linewrapped but that was fortunately
manually fixable.

> @@ -887,7 +887,7 @@
>  	case CPU_SR71000:	name = "Sandcraft SR71000"; break;
>  	case CPU_BCM3302:	name = "Broadcom BCM3302"; break;
>  	case CPU_BCM4710:	name = "Broadcom BCM4710"; break;
> -	case CPU_PR4450:	name = "Philips PR4450"; break;
> +	case CPU_PR4450:	name = "NXP PR4450"; break;
>  	case CPU_LOONGSON2:	name = "ICT Loongson-2"; break;
>  	default:
>  		BUG();

The string changed is returned in /proc/cpuinfo so any change has a
chance of breaking applications.  I know, you'd like to remove the Philips
name but ...  So I applied your patch except this one segment.

  Ralf

From dvomlehn@cisco.com Fri Mar  7 05:02:54 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 07 Mar 2008 05:02:57 +0000 (GMT)
Received: from sj-iport-6.cisco.com ([171.71.176.117]:22802 "EHLO
	sj-iport-6.cisco.com") by ftp.linux-mips.org with ESMTP
	id S28640329AbYCGFCy (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 7 Mar 2008 05:02:54 +0000
Received: from sj-dkim-2.cisco.com ([171.71.179.186])
  by sj-iport-6.cisco.com with ESMTP; 06 Mar 2008 21:02:48 -0800
Received: from sj-core-1.cisco.com (sj-core-1.cisco.com [171.71.177.237])
	by sj-dkim-2.cisco.com (8.12.11/8.12.11) with ESMTP id m2752leP002815;
	Thu, 6 Mar 2008 21:02:47 -0800
Received: from cliff.cisco.com (cliff.cisco.com [171.69.11.141])
	by sj-core-1.cisco.com (8.12.10/8.12.6) with ESMTP id m2752ln1026460;
	Fri, 7 Mar 2008 05:02:47 GMT
Received: from [127.0.0.1] ([64.100.151.191]) by cliff.cisco.com (8.6.12/8.6.5) with ESMTP id FAA25603; Fri, 7 Mar 2008 05:02:44 GMT
Message-ID: <47D0CC6C.3050904@cisco.com>
Date:	Thu, 06 Mar 2008 21:02:36 -0800
From:	David VomLehn <dvomlehn@cisco.com>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
CC:	"dediao@cisco.com; williavi@cisco.com"@cisco.com
Subject: Re: Does HIGHMEM work on 32-bit MIPS ports?
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
DKIM-Signature:	v=1; a=rsa-sha256; q=dns/txt; l=2118; t=1204866168; x=1205730168;
	c=relaxed/simple; s=sjdkim2002;
	h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version;
	d=cisco.com; i=dvomlehn@cisco.com;
	z=From:=20David=20VomLehn=20<dvomlehn@cisco.com>
	|Subject:=20Re=3A=20Does=20HIGHMEM=20work=20on=2032-bit=20M
	IPS=20ports?
	|Sender:=20;
	bh=vykMZiGd2BDF/SNfX7DL76d4c+TOaCzv9REHOxydie0=;
	b=tOjeWIqhXjV6Jx48Ta4UjitY7PoMaN/5WnLkrYuM5raMyZqVvtETwt9w6h
	pMH+OoXKJiR/A/3IbAHvPCX2+oziYwN6rLAhKimOnQfB0o7GauVad/CTeueP
	VHSMHsLdpF;
Authentication-Results:	sj-dkim-2; header.From=dvomlehn@cisco.com; dkim=pass (
	sig from cisco.com/sjdkim2002 verified; ); 
Return-Path: <dvomlehn@cisco.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: 18357
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: dvomlehn@cisco.com
Precedence: bulk
X-list: linux-mips

>> The function __flush_dcache_page (in arch/mips/mm/cache.c) was simply 
>> returning if the struct page* argument it was given indicated we had a 
>> page in high memory, so the dcache was never being flushed. This is an 
>> obvious Bad Thing.
> 
> Sort of.  It could be argued that the flushing of highmem pages should be
> done on kunmap but I haven't researched that into depth.

I find it hard to get my brain around caching, but my expectation is that you
would not normally need to flush the dcache because, with physical tagging, this
all happens automatically. The case where you do need to flush the cache is
where you may do DMA on the memory you mapped, which is only part of why you use
kmap_atomic. So, most of the flushes in kunmap_atomic would be unnecessary.
People expect to have to flush the dcache before doing DMA, so they'd call
flush_dcache_page/__flush_dcache_page.

>> We then have the following:
>>
>>    addr = (unsigned long) page_address(page);
>>    flush_data_cache_page(addr);
>>
>> Additional Modification #2: If the page is in high memory, it may not 
>> have a kernel mapping, in which case page_address() will return NULL. 
>> So, I've modified the code to only call flush_data_cache_page() if the
>> page_address() doesn't return NULL.
> 
> This assumes that kunmap and kunmap_atomic flush the cache.

I think we've already taken care of the kunmap_atomic case above. For the kunmap
case, if you call __flush_dcache_page and page_address returns NULL, then don't
you have to be working with a user-mapped page? If you do DMA from a user-mapped
page, then I don't know how you come up with a virtual address to use to flush
the cache.

> copy_user_highpage, copy_to_user_page and copy_from_user_page could use some review for correctness for the highmem case.

Thanks! I'll look at these, too.

>   Ralf

To me, this is one of the hairiest corners of the the kernel. I appreciate the
time you're taking to respond!

-- 
David VomLehn, dvomlehn@cisco.com
The opinions expressed herein are likely mine, but might not be my employer's...



From ralf@linux-mips.org Fri Mar  7 15:32:57 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 07 Mar 2008 15:32:59 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:53935 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28641573AbYCGPc5 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 7 Mar 2008 15:32:57 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m27FWuaR008878
	for <linux-mips@linux-mips.org>; Fri, 7 Mar 2008 15:32:56 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m27FWu19008877
	for linux-mips@linux-mips.org; Fri, 7 Mar 2008 15:32:56 GMT
Date:	Fri, 7 Mar 2008 15:32:56 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	linux-mips@linux-mips.org
Subject: Cobalt build error
Message-ID: <20080307153256.GA8851@linux-mips.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18358
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

Maybe some Cobalt hacker can sort out these issues in the latest kernel.
I could try to fix the build but don't have any Cobalt kit for testing ...

  Ralf

  CC      drivers/input/misc/cobalt_btns.o
drivers/input/misc/cobalt_btns.c: In function ‘cobalt_buttons_probe’:
drivers/input/misc/cobalt_btns.c:100: error: ‘struct input_dev’ has no member named ‘cdev’
drivers/input/misc/cobalt_btns.c:102: error: ‘struct platform_device’ has no member named ‘keymap’
drivers/input/misc/cobalt_btns.c:103: error: ‘struct platform_device’ has no member named ‘keymap’
drivers/input/misc/cobalt_btns.c:103: error: ‘struct platform_device’ has no member named ‘keymap’
drivers/input/misc/cobalt_btns.c:103: error: ‘struct platform_device’ has no member named ‘keymap’
drivers/input/misc/cobalt_btns.c:103: error: ‘struct platform_device’ has no member named ‘keymap’
drivers/input/misc/cobalt_btns.c:103: warning: type defaults to ‘int’ in declaration of ‘type name’
drivers/input/misc/cobalt_btns.c:103: warning: type defaults to ‘int’ in declaration of ‘type name’
drivers/input/misc/cobalt_btns.c:103: error: size of array ‘type name’ is negative
drivers/input/misc/cobalt_btns.c:108: error: ‘buttons_map’ undeclared (first use in this function)
drivers/input/misc/cobalt_btns.c:108: error: (Each undeclared identifier is reported only once
drivers/input/misc/cobalt_btns.c:108: error: for each function it appears in.)
drivers/input/misc/cobalt_btns.c:108: warning: type defaults to ‘int’ in declaration of ‘type name’
drivers/input/misc/cobalt_btns.c:108: warning: type defaults to ‘int’ in declaration of ‘type name’
drivers/input/misc/cobalt_btns.c:108: error: size of array ‘type name’ is negative
drivers/input/misc/cobalt_btns.c:109: warning: dereferencing ‘void *’ pointer
drivers/input/misc/cobalt_btns.c:109: error: invalid use of void expression
make[1]: *** [drivers/input/misc/cobalt_btns.o] Error 1
make: *** [drivers/input/misc/cobalt_btns.o] Error 2

From yoichi_yuasa@tripeaks.co.jp Sat Mar  8 00:19:54 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 08 Mar 2008 00:19:57 +0000 (GMT)
Received: from mo31.po.2iij.NET ([210.128.50.54]:54532 "EHLO mo31.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S28643179AbYCHATy (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sat, 8 Mar 2008 00:19:54 +0000
Received: by mo.po.2iij.net (mo31) id m280JoZD082221; Sat, 8 Mar 2008 09:19:50 +0900 (JST)
Received: from delta (224.24.30.125.dy.iij4u.or.jp [125.30.24.224])
	by mbox.po.2iij.net (po-mbox305) id m280JmH5025633
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Sat, 8 Mar 2008 09:19:48 +0900
Date:	Sat, 8 Mar 2008 09:19:47 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	yoichi_yuasa@tripeaks.co.jp, linux-mips@linux-mips.org
Subject: Re: Cobalt build error
Message-Id: <20080308091947.4dc7a756.yoichi_yuasa@tripeaks.co.jp>
In-Reply-To: <20080307153256.GA8851@linux-mips.org>
References: <20080307153256.GA8851@linux-mips.org>
Organization: TriPeaks Corporation
X-Mailer: Sylpheed 2.4.5 (GTK+ 2.12.0; i486-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yoichi_yuasa@tripeaks.co.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: 18359
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: yoichi_yuasa@tripeaks.co.jp
Precedence: bulk
X-list: linux-mips

Hi,

On Fri, 7 Mar 2008 15:32:56 +0000
Ralf Baechle <ralf@linux-mips.org> wrote:

> Maybe some Cobalt hacker can sort out these issues in the latest kernel.
> I could try to fix the build but don't have any Cobalt kit for testing ...

I already sent the patch to Dmitry Torokhov.
He said I will apply it.
But, it has not been applied yet.

Yoichi

From tsbogend@alpha.franken.de Sat Mar  8 00:28:58 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 08 Mar 2008 00:29:01 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:53670 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28643159AbYCHA26 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sat, 8 Mar 2008 00:28:58 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JXmvq-0005Wi-00; Sat, 08 Mar 2008 01:28:58 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id 19DE2E31BE; Sat,  8 Mar 2008 01:28:54 +0100 (CET)
Date:	Sat, 8 Mar 2008 01:28:54 +0100
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org
Subject: Re: Cobalt build error
Message-ID: <20080308002854.GA10446@alpha.franken.de>
References: <20080307153256.GA8851@linux-mips.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080307153256.GA8851@linux-mips.org>
User-Agent: Mutt/1.5.13 (2006-08-11)
From:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Return-Path: <tsbogend@alpha.franken.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: 18360
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips

On Fri, Mar 07, 2008 at 03:32:56PM +0000, Ralf Baechle wrote:
> Maybe some Cobalt hacker can sort out these issues in the latest kernel.
> I could try to fix the build but don't have any Cobalt kit for testing ...

the patch below fixes the compile breakage, but is untested ...

Thomas.


Fix breakage introduced by commit b037b08e59633d939d79f1df9c43c6625f8db904

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---

 drivers/input/misc/cobalt_btns.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/input/misc/cobalt_btns.c b/drivers/input/misc/cobalt_btns.c
index 4833b1a..b554047 100644
--- a/drivers/input/misc/cobalt_btns.c
+++ b/drivers/input/misc/cobalt_btns.c
@@ -97,16 +97,15 @@ static int __devinit cobalt_buttons_probe(struct platform_device *pdev)
 	input->name = "Cobalt buttons";
 	input->phys = "cobalt/input0";
 	input->id.bustype = BUS_HOST;
-	input->cdev.dev = &pdev->dev;
 
-	input->keycode = pdev->keymap;
-	input->keycodemax = ARRAY_SIZE(pdev->keymap);
+	input->keycode = bdev->keymap;
+	input->keycodemax = ARRAY_SIZE(bdev->keymap);
 	input->keycodesize = sizeof(unsigned short);
 
 	input_set_capability(input, EV_MSC, MSC_SCAN);
 	__set_bit(EV_KEY, input->evbit);
-	for (i = 0; i < ARRAY_SIZE(buttons_map); i++)
-		__set_bit(input->keycode[i], input->keybit);
+	for (i = 0; i < ARRAY_SIZE(cobalt_map); i++)
+		__set_bit(cobalt_map[i], input->keybit);
 	__clear_bit(KEY_RESERVED, input->keybit);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

From tbm@cyrius.com Sat Mar  8 07:45:04 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 08 Mar 2008 07:45:06 +0000 (GMT)
Received: from sorrow.cyrius.com ([65.19.161.204]:21516 "EHLO
	sorrow.cyrius.com") by ftp.linux-mips.org with ESMTP
	id S28643782AbYCHHpE (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 8 Mar 2008 07:45:04 +0000
Received: by sorrow.cyrius.com (Postfix, from userid 10)
	id 49F84D8D1; Sat,  8 Mar 2008 07:44:57 +0000 (UTC)
Received: by deprecation.cyrius.com (Postfix, from userid 1000)
	id 6443437260A; Sat,  8 Mar 2008 08:44:13 +0100 (CET)
Date:	Sat, 8 Mar 2008 08:44:13 +0100
From:	Martin Michlmayr <tbm@cyrius.com>
To:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Cc:	Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
Subject: Re: Cobalt build error
Message-ID: <20080308074413.GA2581@deprecation.cyrius.com>
References: <20080307153256.GA8851@linux-mips.org> <20080308091947.4dc7a756.yoichi_yuasa@tripeaks.co.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080308091947.4dc7a756.yoichi_yuasa@tripeaks.co.jp>
User-Agent: Mutt/1.5.16 (2007-06-11)
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: 18361
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

* Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> [2008-03-08 09:19]:
> > Maybe some Cobalt hacker can sort out these issues in the latest kernel.
> > I could try to fix the build but don't have any Cobalt kit for testing ...
> 
> I already sent the patch to Dmitry Torokhov.
> He said I will apply it.
> But, it has not been applied yet.

That was quite a while ago, wasn't it?  Maybe you could ping him again
or ask Ralf or Andrew to send the patch to Linus.
-- 
Martin Michlmayr
http://www.cyrius.com/

From yoichi_yuasa@tripeaks.co.jp Sat Mar  8 08:45:57 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 08 Mar 2008 08:46:05 +0000 (GMT)
Received: from mo31.po.2iij.NET ([210.128.50.54]:51779 "EHLO mo31.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S28644323AbYCHIp5 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sat, 8 Mar 2008 08:45:57 +0000
Received: by mo.po.2iij.net (mo31) id m288joOc076462; Sat, 8 Mar 2008 17:45:50 +0900 (JST)
Received: from delta (224.24.30.125.dy.iij4u.or.jp [125.30.24.224])
	by mbox.po.2iij.net (po-mbox303) id m288jmNa004540
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Sat, 8 Mar 2008 17:45:49 +0900
Date:	Sat, 8 Mar 2008 17:45:48 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Ralf Baechle <ralf@linux-mips.org>,
	Martin Michlmayr <tbm@cyrius.com>
Cc:	yoichi_yuasa@tripeaks.co.jp, linux-mips@linux-mips.org
Subject: [PATCH] Input: fix cobalt_btns loadable keymaps support
Message-Id: <20080308174548.c1de590f.yoichi_yuasa@tripeaks.co.jp>
In-Reply-To: <20080308074413.GA2581@deprecation.cyrius.com>
References: <20080307153256.GA8851@linux-mips.org>
	<20080308091947.4dc7a756.yoichi_yuasa@tripeaks.co.jp>
	<20080308074413.GA2581@deprecation.cyrius.com>
Organization: TriPeaks Corporation
X-Mailer: Sylpheed 2.4.5 (GTK+ 2.12.0; i486-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yoichi_yuasa@tripeaks.co.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: 18362
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: yoichi_yuasa@tripeaks.co.jp
Precedence: bulk
X-list: linux-mips

Hi,

On Sat, 8 Mar 2008 08:44:13 +0100
Martin Michlmayr <tbm@cyrius.com> wrote:

> * Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> [2008-03-08 09:19]:
> > > Maybe some Cobalt hacker can sort out these issues in the latest kernel.
> > > I could try to fix the build but don't have any Cobalt kit for testing ...
> > 
> > I already sent the patch to Dmitry Torokhov.
> > He said I will apply it.
> > But, it has not been applied yet.
> 
> That was quite a while ago, wasn't it?  Maybe you could ping him again
> or ask Ralf or Andrew to send the patch to Linus.

I sent a mail to him 10 days ago.
But, there is no reply.

Ralf,
Could you send the patch to Linus?

Yoichi

Fix cobalt_btns loadable keymaps support.

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>

diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/drivers/input/misc/cobalt_btns.c linux/drivers/input/misc/cobalt_btns.c
--- linux-orig/drivers/input/misc/cobalt_btns.c	2008-02-10 20:16:54.621304697 +0900
+++ linux/drivers/input/misc/cobalt_btns.c	2008-02-10 23:02:30.875539556 +0900
@@ -1,7 +1,7 @@
 /*
  *  Cobalt button interface driver.
  *
- *  Copyright (C) 2007  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+ *  Copyright (C) 2007-2008  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.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
@@ -15,7 +15,7 @@
  *
  *  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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <linux/init.h>
 #include <linux/input-polldev.h>
@@ -55,7 +55,7 @@ static void handle_buttons(struct input_
 	status = ~readl(bdev->reg) >> 24;
 
 	for (i = 0; i < ARRAY_SIZE(bdev->keymap); i++) {
-		if (status & (1UL << i)) {
+		if (status & (1U << i)) {
 			if (++bdev->count[i] == BUTTONS_COUNT_THRESHOLD) {
 				input_event(input, EV_MSC, MSC_SCAN, i);
 				input_report_key(input, bdev->keymap[i], 1);
@@ -97,16 +97,16 @@ static int __devinit cobalt_buttons_prob
 	input->name = "Cobalt buttons";
 	input->phys = "cobalt/input0";
 	input->id.bustype = BUS_HOST;
-	input->cdev.dev = &pdev->dev;
+	input->dev.parent = &pdev->dev;
 
-	input->keycode = pdev->keymap;
-	input->keycodemax = ARRAY_SIZE(pdev->keymap);
+	input->keycode = bdev->keymap;
+	input->keycodemax = ARRAY_SIZE(bdev->keymap);
 	input->keycodesize = sizeof(unsigned short);
 
 	input_set_capability(input, EV_MSC, MSC_SCAN);
 	__set_bit(EV_KEY, input->evbit);
-	for (i = 0; i < ARRAY_SIZE(buttons_map); i++)
-		__set_bit(input->keycode[i], input->keybit);
+	for (i = 0; i < ARRAY_SIZE(cobalt_map); i++)
+		__set_bit(bdev->keymap[i], input->keybit);
 	__clear_bit(KEY_RESERVED, input->keybit);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);





From ralf@linux-mips.org Sat Mar  8 16:56:35 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 08 Mar 2008 16:56:37 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:52943 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28645914AbYCHQ4f (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 8 Mar 2008 16:56:35 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m28GuYtX008613;
	Sat, 8 Mar 2008 16:56:34 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m28GuXUl008612;
	Sat, 8 Mar 2008 16:56:33 GMT
Date:	Sat, 8 Mar 2008 16:56:33 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	jgarik@linux-mips.org, Andrew Morton <akpm@linux-foundation.org>,
	netdev@vger.kernel.org, linux-mips@linux-mips.org
Subject: [IOC3] Fix section missmatch
Message-ID: <20080308165633.GA13996@linux-mips.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18363
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

  LD      drivers/net/built-in.o
WARNING: drivers/net/built-in.o(.text+0x3468): Section mismatch in reference fro
m the function ioc3_probe() to the function .devinit.text:ioc3_serial_probe()
The function ioc3_probe() references
the function __devinit ioc3_serial_probe().
This is often because ioc3_probe lacks a __devinit 
annotation or the annotation of ioc3_serial_probe is wrong.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c
index 373f72c..1f25263 100644
--- a/drivers/net/ioc3-eth.c
+++ b/drivers/net/ioc3-eth.c
@@ -1221,7 +1221,8 @@ static void __devinit ioc3_serial_probe(struct pci_dev *pdev, struct ioc3 *ioc3)
 }
 #endif
 
-static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+static int __devinit ioc3_probe(struct pci_dev *pdev,
+	const struct pci_device_id *ent)
 {
 	unsigned int sw_physid1, sw_physid2;
 	struct net_device *dev = NULL;

From ralf@linux-mips.org Sat Mar  8 16:58:35 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 08 Mar 2008 16:58:37 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:465 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28645950AbYCHQ6f (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 8 Mar 2008 16:58:35 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m28GwYXS008674;
	Sat, 8 Mar 2008 16:58:34 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m28GwXcu008663;
	Sat, 8 Mar 2008 16:58:33 GMT
Date:	Sat, 8 Mar 2008 16:58:33 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Jeff Garzik <jeff@garzik.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	netdev@vger.kernel.org, linux-mips@linux-mips.org
Subject: [IOC3] Fix section missmatch
Message-ID: <20080308165833.GA8625@linux-mips.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18364
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

  LD      drivers/net/built-in.o
WARNING: drivers/net/built-in.o(.text+0x3468): Section mismatch in reference fro
m the function ioc3_probe() to the function .devinit.text:ioc3_serial_probe()
The function ioc3_probe() references
the function __devinit ioc3_serial_probe().
This is often because ioc3_probe lacks a __devinit 
annotation or the annotation of ioc3_serial_probe is wrong.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

---
Resend, this time with Jeff's address corrected.

diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c
index 373f72c..1f25263 100644
--- a/drivers/net/ioc3-eth.c
+++ b/drivers/net/ioc3-eth.c
@@ -1221,7 +1221,8 @@ static void __devinit ioc3_serial_probe(struct pci_dev *pdev, struct ioc3 *ioc3)
 }
 #endif
 
-static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+static int __devinit ioc3_probe(struct pci_dev *pdev,
+	const struct pci_device_id *ent)
 {
 	unsigned int sw_physid1, sw_physid2;
 	struct net_device *dev = NULL;

----- End forwarded message -----

  Ralf

From tsbogend@alpha.franken.de Sat Mar  8 18:52:44 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 08 Mar 2008 18:52:46 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:20422 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28646296AbYCHSwo (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sat, 8 Mar 2008 18:52:44 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JY49z-00022v-00; Sat, 08 Mar 2008 19:52:43 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id BA791E31BE; Sat,  8 Mar 2008 19:51:55 +0100 (CET)
From:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: [PATCH] BCM1480: Init pci controller io_map_base
To:	linux-mips@linux-mips.org
cc:	ralf@linux-mips.org
Message-Id: <20080308185155.BA791E31BE@solo.franken.de>
Date:	Sat,  8 Mar 2008 19:51:55 +0100 (CET)
Return-Path: <tsbogend@alpha.franken.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: 18365
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips

BCM1480: Init pci controller io_map_base

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---

 arch/mips/pci/pci-bcm1480.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/mips/pci/pci-bcm1480.c b/arch/mips/pci/pci-bcm1480.c
index 30ed361..ab68c43 100644
--- a/arch/mips/pci/pci-bcm1480.c
+++ b/arch/mips/pci/pci-bcm1480.c
@@ -249,8 +249,9 @@ static int __init bcm1480_pcibios_init(void)
 	 * XXX ehs: Should this happen in PCI Device mode?
 	 */
 
-	set_io_port_base((unsigned long)
-		ioremap(A_BCM1480_PHYS_PCI_IO_MATCH_BYTES, 65536));
+	bcm1480_controller.io_map_base = (unsigned long)
+		ioremap(A_BCM1480_PHYS_PCI_IO_MATCH_BYTES, 65536);
+	set_io_port_base(bcm1480_controller.io_map_base);
 	isa_slot_offset = (unsigned long)
 		ioremap(A_BCM1480_PHYS_PCI_MEM_MATCH_BYTES, 1024*1024);
 

From giuseppe@eppesuigoccas.homedns.org Sun Mar  9 14:36:15 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 09 Mar 2008 14:36:17 +0000 (GMT)
Received: from [79.20.211.194] ([79.20.211.194]:61839 "EHLO
	eppesuigoccas.homedns.org") by ftp.linux-mips.org with ESMTP
	id S28651396AbYCIOgP (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 9 Mar 2008 14:36:15 +0000
Received: from localhost ([127.0.0.1] helo=sgi)
	by eppesuigoccas.homedns.org with smtp (Exim 4.63)
	(envelope-from <giuseppe@eppesuigoccas.homedns.org>)
	id 1JYMd7-00023d-41
	for linux-mips@linux-mips.org; Sun, 09 Mar 2008 15:36:03 +0100
Date:	Sun, 9 Mar 2008 15:35:59 +0100
From:	Giuseppe Sacco <giuseppe@eppesuigoccas.homedns.org>
To:	linux-mips@linux-mips.org
Subject: How to find source of a panic event?
Message-Id: <20080309153559.2d58c9f5.giuseppe@eppesuigoccas.homedns.org>
X-Mailer: Sylpheed version 2.3.0beta5 (GTK+ 2.8.20; mips-unknown-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <giuseppe@eppesuigoccas.homedns.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: 18366
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: giuseppe@eppesuigoccas.homedns.org
Precedence: bulk
X-list: linux-mips

Hi all,
I am testing new kernels on a spare O2. Since I see some strange behaviour, I would like to ask you for a comment on this subject.

What happens is that when the kernel is loaded and then started, the led immediately start blinking red/green and the machine power off after 120 seconds.

Looking at arch/mips/sgi-ip32/ip32-reset.c I found that when setting up the system, a new interrupt is requested, MACEISA_RTC_IRQ, and a notifier_block structure is setup in order to be used when a panic action is triggered. When this happens, the panic action uses the interrupt to wait two minutes and power off the machine.

So I wonder how to find the source calling this panic_action.

Thanks to all,
Giuseppe

From ralf@linux-mips.org Mon Mar 10 16:28:26 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 10 Mar 2008 16:28:29 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:19898 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S20026495AbYCJQ20 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 10 Mar 2008 16:28:26 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2AGSQxt001026;
	Mon, 10 Mar 2008 16:28:26 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2AGSPk8001025;
	Mon, 10 Mar 2008 16:28:25 GMT
Date:	Mon, 10 Mar 2008 16:28:25 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] BCM1480: Init pci controller io_map_base
Message-ID: <20080310162825.GE31420@linux-mips.org>
References: <20080308185155.BA791E31BE@solo.franken.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080308185155.BA791E31BE@solo.franken.de>
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18367
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, Mar 08, 2008 at 07:51:55PM +0100, Thomas Bogendoerfer wrote:

> BCM1480: Init pci controller io_map_base

Thanks, applied.  But this patch only solves the problem for the BCM1480's
native PCI bus.  Support for PCI behind HT still needs to be fixed and I'm
not quite sure where the ports of such devices and busses are getting
mapped to.

  Ralf

From yoichi_yuasa@tripeaks.co.jp Tue Mar 11 23:06:05 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 11 Mar 2008 23:06:08 +0000 (GMT)
Received: from mo31.po.2iij.NET ([210.128.50.54]:53012 "EHLO mo31.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S28578449AbYCKXGF (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 11 Mar 2008 23:06:05 +0000
Received: by mo.po.2iij.net (mo31) id m2BN62YP096078; Wed, 12 Mar 2008 08:06:02 +0900 (JST)
Received: from localhost (65.126.232.202.bf.2iij.net [202.232.126.65])
	by mbox.po.2iij.net (po-mbox301) id m2BN5uFm019082
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Wed, 12 Mar 2008 08:05:56 +0900
Date:	Wed, 12 Mar 2008 08:05:10 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	yoichi_yuasa@tripeaks.co.jp, linux-mips <linux-mips@linux-mips.org>
Subject: [PATCH 2.6.25][MIPS] fix LASAT_CASCADE_IRQ number
Message-Id: <20080312080510.6aef9a0d.yoichi_yuasa@tripeaks.co.jp>
Organization: TriPeaks Corporation
X-Mailer: Sylpheed version 2.3.0beta5 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yoichi_yuasa@tripeaks.co.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: 18368
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: yoichi_yuasa@tripeaks.co.jp
Precedence: bulk
X-list: linux-mips

Hi Ralf,

The patch has fixed LASAT_CASCADE_IRQ number.

This is 2.6.25 stuff.

Yoichi

Fix LASAT_CASCADE_IRQ number.

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>

diff -pruN -X mips/Documentation/dontdiff mips-orig/include/asm-mips/mach-lasat/irq.h mips/include/asm-mips/mach-lasat/irq.h
--- mips-orig/include/asm-mips/mach-lasat/irq.h	2008-01-13 16:43:14.160048268 +0900
+++ mips/include/asm-mips/mach-lasat/irq.h	2008-01-14 21:27:55.180821709 +0900
@@ -1,7 +1,7 @@
 #ifndef _ASM_MACH_LASAT_IRQ_H
 #define _ASM_MACH_LASAT_IRQ_H
 
-#define LASAT_CASCADE_IRQ	(MIPS_CPU_IRQ_BASE + 0)
+#define LASAT_CASCADE_IRQ	(MIPS_CPU_IRQ_BASE + 2)
 
 #define LASAT_IRQ_BASE		8
 #define LASAT_IRQ_END		23

From yoichi_yuasa@tripeaks.co.jp Tue Mar 11 23:06:29 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 11 Mar 2008 23:06:33 +0000 (GMT)
Received: from mo32.po.2iij.NET ([210.128.50.17]:58924 "EHLO mo32.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S28578450AbYCKXGF (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 11 Mar 2008 23:06:05 +0000
Received: by mo.po.2iij.net (mo32) id m2BN6198038928; Wed, 12 Mar 2008 08:06:01 +0900 (JST)
Received: from localhost (65.126.232.202.bf.2iij.net [202.232.126.65])
	by mbox.po.2iij.net (po-mbox302) id m2BN5tIF020874
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Wed, 12 Mar 2008 08:05:55 +0900
Date:	Wed, 12 Mar 2008 08:04:36 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	yoichi_yuasa@tripeaks.co.jp, linux-mips <linux-mips@linux-mips.org>
Subject: [PATCH 2.6.25][MIPS]fix the installation condition of MIPS
 clocksource
Message-Id: <20080312080436.5a0b170a.yoichi_yuasa@tripeaks.co.jp>
Organization: TriPeaks Corporation
X-Mailer: Sylpheed version 2.3.0beta5 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yoichi_yuasa@tripeaks.co.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: 18369
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: yoichi_yuasa@tripeaks.co.jp
Precedence: bulk
X-list: linux-mips

Hi Ralf,

MIPS clocksource has been installed on DEC 5000/200(R3000).
The installation condition of MIPS clocksource is wrong.

This is 2.6.25 stuff.

Yoichi

Fixed the installation condition of MIPS clocksource.

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>

diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/kernel/time.c linux/arch/mips/kernel/time.c
--- linux-orig/arch/mips/kernel/time.c	2008-02-14 12:00:11.592089539 +0900
+++ linux/arch/mips/kernel/time.c	2008-02-14 17:14:42.619488102 +0900
@@ -157,6 +157,6 @@ void __init time_init(void)
 {
 	plat_time_init();
 
-	if (mips_clockevent_init() || !cpu_has_mfc0_count_bug())
+	if (!cpu_has_mfc0_count_bug() && !mips_clockevent_init())
 		init_mips_clocksource();
 }

From technoboy85@gmail.com Wed Mar 12 01:21:32 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 12 Mar 2008 01:21:35 +0000 (GMT)
Received: from smtp-OUT05A.alice.it ([85.33.3.5]:28165 "EHLO
	smtp-OUT05A.alice.it") by ftp.linux-mips.org with ESMTP
	id S28577210AbYCLBVc (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 12 Mar 2008 01:21:32 +0000
Received: from FBCMMO02.fbc.local ([192.168.68.196]) by smtp-OUT05A.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 02:21:30 +0100
Received: from FBCMCL01B03.fbc.local ([192.168.69.84]) by FBCMMO02.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 02:21:26 +0100
Received: from raver.openwrt ([87.11.94.38]) by FBCMCL01B03.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 02:21:26 +0100
From:	Matteo Croce <technoboy85@gmail.com>
To:	linux-mips@linux-mips.org
Subject: [PATCH][MIPS][0/6]: AR7 final
Date:	Wed, 12 Mar 2008 02:21:24 +0100
User-Agent: KMail/1.9.9
X-Face:	0AUq?,0sKh2O65+R5#[nTCS'~}"m)9|g3Tsi=g7A9q69S+=M!BY)=?utf-8?q?Zdmwo2u!i=5CUylx=26=27D+=0A=09=5B7u=26z1=27s=7E=5B=3F+=24=27w?=
 =?utf-8?q?O6+?="'WWcr5Jy,]}8namg8NP:9<E,o^21xGB~/HRhB(u^@
 =?utf-8?q?ZB=2EXLP0swe=0A=09r9M=7EL?=<b1=^'4cv*_N1tNJ$`9Ot*KL/;8oXFdrT@r|-Ki2wCQI"R(X(
 =?utf-8?q?73r=3A=3BmnNPoA2a=5D=7EZ=0A=092n2sUh?=,B|bt;ys*hv.QR>a]{m
Cc:	nico@openwrt.org, nbd@openwrt.org, florian@openwrt.org,
	openwrt-devel@lists.openwrt.org,
	Andrew Morton <akpm@linux-foundation.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200803120221.25044.technoboy85@gmail.com>
X-OriginalArrivalTime: 12 Mar 2008 01:21:26.0564 (UTC) FILETIME=[64697E40:01C883DF]
Return-Path: <technoboy85@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: 18370
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: technoboy85@gmail.com
Precedence: bulk
X-list: linux-mips

I hope this is the last try

Works flawlessy with vanilla 2.6.24

From technoboy85@gmail.com Wed Mar 12 01:25:13 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 12 Mar 2008 01:25:16 +0000 (GMT)
Received: from smtp-out25.alice.it ([85.33.2.25]:44807 "EHLO
	smtp-out25.alice.it") by ftp.linux-mips.org with ESMTP
	id S28577413AbYCLBZN (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 12 Mar 2008 01:25:13 +0000
Received: from FBCMMO02.fbc.local ([192.168.68.196]) by smtp-out25.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 02:25:08 +0100
Received: from FBCMCL01B01.fbc.local ([192.168.69.82]) by FBCMMO02.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 02:25:08 +0100
Received: from raver.openwrt ([87.11.94.38]) by FBCMCL01B01.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 02:25:07 +0100
From:	Matteo Croce <technoboy85@gmail.com>
To:	linux-mips@linux-mips.org
Subject: [PATCH][MIPS][2/6]: AR7 mtd partition map
Date:	Wed, 12 Mar 2008 02:25:06 +0100
User-Agent: KMail/1.9.9
References: <200803120221.25044.technoboy85@gmail.com>
In-Reply-To: <200803120221.25044.technoboy85@gmail.com>
X-Face:	0AUq?,0sKh2O65+R5#[nTCS'~}"m)9|g3Tsi=g7A9q69S+=M!BY)=?utf-8?q?Zdmwo2u!i=5CUylx=26=27D+=0A=09=5B7u=26z1=27s=7E=5B=3F+=24=27w?=
 =?utf-8?q?O6+?="'WWcr5Jy,]}8namg8NP:9<E,o^21xGB~/HRhB(u^@
 =?utf-8?q?ZB=2EXLP0swe=0A=09r9M=7EL?=<b1=^'4cv*_N1tNJ$`9Ot*KL/;8oXFdrT@r|-Ki2wCQI"R(X(
 =?utf-8?q?73r=3A=3BmnNPoA2a=5D=7EZ=0A=092n2sUh?=,B|bt;ys*hv.QR>a]{m
Cc:	Felix Fietkau <nbd@openwrt.org>, Eugene Konev <ejka@imfi.kspu.ru>,
	dwmw2@infradead.org, linux-mtd@lists.infradead.org,
	openwrt-devel@lists.openwrt.org,
	Andrew Morton <akpm@linux-foundation.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200803120225.06990.technoboy85@gmail.com>
X-OriginalArrivalTime: 12 Mar 2008 01:25:07.0832 (UTC) FILETIME=[E84C4F80:01C883DF]
Return-Path: <technoboy85@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: 18371
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: technoboy85@gmail.com
Precedence: bulk
X-list: linux-mips

Signed-off-by: Matteo Croce <technoboy85@gmail.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Eugene Konev <ejka@imfi.kspu.ru>

diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index e850334..eed06d0 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -158,6 +158,12 @@ config MTD_OF_PARTS
 	  the partition map from the children of the flash node,
 	  as described in Documentation/powerpc/booting-without-of.txt.
 
+config MTD_AR7_PARTS
+	tristate "TI AR7 partitioning support"
+	depends on MTD_PARTITIONS
+	---help---
+	  TI AR7 partitioning support
+
 comment "User Modules And Translation Layers"
 
 config MTD_CHAR
diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
index 538e33d..4b77335 100644
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_MTD_CONCAT)	+= mtdconcat.o
 obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o
 obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o
 obj-$(CONFIG_MTD_AFS_PARTS)	+= afs.o
+obj-$(CONFIG_MTD_AR7_PARTS)	+= ar7part.o
 obj-$(CONFIG_MTD_OF_PARTS)      += ofpart.o
 
 # 'Users' - code which presents functionality to userspace.
diff --git a/drivers/mtd/ar7part.c b/drivers/mtd/ar7part.c
new file mode 100644
index 0000000..3d160d4
--- /dev/null
+++ b/drivers/mtd/ar7part.c
@@ -0,0 +1,146 @@
+/*
+ * Copyright (C) 2007 Eugene Konev <ejka@openwrt.org>
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * TI AR7 flash partition table.
+ * Based on ar7 map by Felix Fietkau <nbd@openwrt.org>
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/slab.h>
+
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <linux/bootmem.h>
+#include <linux/magic.h>
+
+#define AR7_PARTS	4
+#define ROOT_OFFSET	0xe0000
+
+#define LOADER_MAGIC1	le32_to_cpu(0xfeedfa42)
+#define LOADER_MAGIC2	le32_to_cpu(0xfeed1281)
+
+struct ar7_bin_rec {
+	unsigned int checksum;
+	unsigned int length;
+	unsigned int address;
+};
+
+static struct mtd_partition ar7_parts[AR7_PARTS];
+
+static int create_mtd_partitions(struct mtd_info *master,
+				 struct mtd_partition **pparts,
+				 unsigned long origin)
+{
+	struct ar7_bin_rec header;
+	unsigned int offset, len;
+	unsigned int pre_size = master->erasesize, post_size = 0;
+	unsigned int root_offset = ROOT_OFFSET;
+
+	int retries = 10;
+
+	ar7_parts[0].name = "loader";
+	ar7_parts[0].offset = 0;
+	ar7_parts[0].size = master->erasesize;
+	ar7_parts[0].mask_flags = MTD_WRITEABLE;
+
+	ar7_parts[1].name = "config";
+	ar7_parts[1].offset = 0;
+	ar7_parts[1].size = master->erasesize;
+	ar7_parts[1].mask_flags = 0;
+
+	do { /* Try 10 blocks starting from master->erasesize */
+		offset = pre_size;
+		master->read(master, offset,
+			sizeof(header), &len, (u8 *)&header);
+		if (!strncmp((char *)&header, "TIENV0.8", 8))
+			ar7_parts[1].offset = pre_size;
+		if (header.checksum == LOADER_MAGIC1)
+			break;
+		if (header.checksum == LOADER_MAGIC2)
+			break;
+		pre_size += master->erasesize;
+	} while (retries--);
+
+	pre_size = offset;
+
+	if (!ar7_parts[1].offset) {
+		ar7_parts[1].offset = master->size - master->erasesize;
+		post_size = master->erasesize;
+	}
+
+	switch (header.checksum) {
+	case LOADER_MAGIC1:
+		while (header.length) {
+			offset += sizeof(header) + header.length;
+			master->read(master, offset, sizeof(header),
+				     &len, (u8 *)&header);
+		}
+		root_offset = offset + sizeof(header) + 4;
+		break;
+	case LOADER_MAGIC2:
+		while (header.length) {
+			offset += sizeof(header) + header.length;
+			master->read(master, offset, sizeof(header),
+				     &len, (u8 *)&header);
+		}
+		root_offset = offset + sizeof(header) + 4 + 0xff;
+		root_offset &= ~(u32)0xff;
+		break;
+	default:
+		printk(KERN_WARNING "Unknown magic: %08x\n", header.checksum);
+		break;
+	}
+
+	master->read(master, root_offset,
+		sizeof(header), &len, (u8 *)&header);
+	if (header.checksum != SQUASHFS_MAGIC) {
+		root_offset += master->erasesize - 1;
+		root_offset &= ~(master->erasesize - 1);
+	}
+
+	ar7_parts[2].name = "linux";
+	ar7_parts[2].offset = pre_size;
+	ar7_parts[2].size = master->size - pre_size - post_size;
+	ar7_parts[2].mask_flags = 0;
+
+	ar7_parts[3].name = "rootfs";
+	ar7_parts[3].offset = root_offset;
+	ar7_parts[3].size = master->size - root_offset - post_size;
+	ar7_parts[3].mask_flags = 0;
+
+	*pparts = ar7_parts;
+	return AR7_PARTS;
+}
+
+static struct mtd_part_parser ar7_parser = {
+	.owner = THIS_MODULE,
+	.parse_fn = create_mtd_partitions,
+	.name = "ar7part",
+};
+
+static int __init ar7_parser_init(void)
+{
+	return register_mtd_parser(&ar7_parser);
+}
+
+module_init(ar7_parser_init);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR(	"Felix Fietkau <nbd@openwrt.org>, "
+		"Eugene Konev <ejka@openwrt.org>");
+MODULE_DESCRIPTION("MTD partitioning for TI AR7");

From technoboy85@gmail.com Wed Mar 12 01:26:50 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 12 Mar 2008 01:26:54 +0000 (GMT)
Received: from smtp-OUT05A.alice.it ([85.33.3.5]:44039 "EHLO
	smtp-OUT05A.alice.it") by ftp.linux-mips.org with ESMTP
	id S28577458AbYCLB0u (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 12 Mar 2008 01:26:50 +0000
Received: from FBCMMO01.fbc.local ([192.168.68.195]) by smtp-OUT05A.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 02:26:48 +0100
Received: from FBCMCL01B05.fbc.local ([192.168.69.86]) by FBCMMO01.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 02:26:44 +0100
Received: from raver.openwrt ([87.11.94.38]) by FBCMCL01B05.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 02:26:43 +0100
From:	Matteo Croce <technoboy85@gmail.com>
To:	linux-mips@linux-mips.org
Subject: [PATCH][MIPS][3/6]: AR7: VLYNQ bus
Date:	Wed, 12 Mar 2008 02:26:42 +0100
User-Agent: KMail/1.9.9
References: <200803120221.25044.technoboy85@gmail.com>
In-Reply-To: <200803120221.25044.technoboy85@gmail.com>
X-Face:	0AUq?,0sKh2O65+R5#[nTCS'~}"m)9|g3Tsi=g7A9q69S+=M!BY)=?utf-8?q?Zdmwo2u!i=5CUylx=26=27D+=0A=09=5B7u=26z1=27s=7E=5B=3F+=24=27w?=
 =?utf-8?q?O6+?="'WWcr5Jy,]}8namg8NP:9<E,o^21xGB~/HRhB(u^@
 =?utf-8?q?ZB=2EXLP0swe=0A=09r9M=7EL?=<b1=^'4cv*_N1tNJ$`9Ot*KL/;8oXFdrT@r|-Ki2wCQI"R(X(
 =?utf-8?q?73r=3A=3BmnNPoA2a=5D=7EZ=0A=092n2sUh?=,B|bt;ys*hv.QR>a]{m
Cc:	Eugene Konev <ejka@imfi.kspu.ru>,
	Andrew Morton <akpm@linux-foundation.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200803120226.42795.technoboy85@gmail.com>
X-OriginalArrivalTime: 12 Mar 2008 01:26:43.0663 (UTC) FILETIME=[216AF5F0:01C883E0]
Return-Path: <technoboy85@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: 18372
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: technoboy85@gmail.com
Precedence: bulk
X-list: linux-mips

Signed-off-by: Matteo Croce <technoboy85@gmail.com>
Signed-off-by: Eugene Konev <ejka@imfi.kspu.ru>

diff --git a/drivers/vlynq/Kconfig b/drivers/vlynq/Kconfig
new file mode 100644
index 0000000..2c8ffe0
--- /dev/null
+++ b/drivers/vlynq/Kconfig
@@ -0,0 +1,13 @@
+menu "TI VLYNQ"
+
+config VLYNQ
+	bool "TI VLYNQ bus support"
+	depends on AR7 && EXPERIMENTAL
+	help
+	  Support for the TI VLYNQ bus
+
+	  The module will be called vlynq
+
+	  If unsure, say N
+
+endmenu
diff --git a/drivers/vlynq/Makefile b/drivers/vlynq/Makefile
new file mode 100644
index 0000000..b3f6114
--- /dev/null
+++ b/drivers/vlynq/Makefile
@@ -0,0 +1,5 @@
+#
+# Makefile for kernel vlynq drivers
+#
+
+obj-$(CONFIG_VLYNQ) += vlynq.o
diff --git a/drivers/vlynq/vlynq.c b/drivers/vlynq/vlynq.c
new file mode 100644
index 0000000..374562c
--- /dev/null
+++ b/drivers/vlynq/vlynq.c
@@ -0,0 +1,670 @@
+/*
+ * Copyright (C) 2006, 2007 OpenWrt.org
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/device.h>
+#include <linux/module.h>
+#include <linux/errno.h>
+#include <linux/platform_device.h>
+#include <linux/interrupt.h>
+#include <linux/device.h>
+#include <linux/io.h>
+
+#include <linux/vlynq.h>
+
+#define VLYNQ_CTRL_PM_ENABLE		0x80000000
+#define VLYNQ_CTRL_CLOCK_INT		0x00008000
+#define VLYNQ_CTRL_CLOCK_DIV(x)		(((x) & 7) << 16)
+#define VLYNQ_CTRL_INT_LOCAL		0x00004000
+#define VLYNQ_CTRL_INT_ENABLE		0x00002000
+#define VLYNQ_CTRL_INT_VECTOR(x)	(((x) & 0x1f) << 8)
+#define VLYNQ_CTRL_INT2CFG		0x00000080
+#define VLYNQ_CTRL_RESET		0x00000001
+
+#define VLYNQ_INT_OFFSET		0x00000014
+#define VLYNQ_REMOTE_OFFSET		0x00000080
+
+#define VLYNQ_STATUS_LINK		0x00000001
+#define VLYNQ_STATUS_LERROR		0x00000080
+#define VLYNQ_STATUS_RERROR		0x00000100
+
+#define VINT_ENABLE			0x00000100
+#define VINT_TYPE_EDGE			0x00000080
+#define VINT_LEVEL_LOW			0x00000040
+#define VINT_VECTOR(x)			((x) & 0x1f)
+#define VINT_OFFSET(irq)		(8 * ((irq) % 4))
+
+#define VLYNQ_AUTONEGO_V2		0x00010000
+
+struct vlynq_regs {
+	u32 revision;
+	u32 control;
+	u32 status;
+	u32 int_prio;
+	u32 int_status;
+	u32 int_pending;
+	u32 int_ptr;
+	u32 tx_offset;
+	struct vlynq_mapping rx_mapping[4];
+	u32 chip;
+	u32 autonego;
+	u32 unused[6];
+	u32 int_device[8];
+} __attribute__ ((packed));
+
+#define vlynq_reg_read(reg) readl(&(reg))
+#define vlynq_reg_write(reg, val)  writel(val, &(reg))
+
+static int __vlynq_enable_device(struct vlynq_device *dev);
+
+#ifdef VLYNQ_DEBUG
+static void vlynq_dump_regs(struct vlynq_device *dev)
+{
+	int i;
+	printk(KERN_DEBUG "VLYNQ local=%p remote=%p\n",
+			dev->local, dev->remote);
+	for (i = 0; i < 32; i++) {
+		printk(KERN_DEBUG "VLYNQ: local %d: %08x\n",
+			i + 1, ((u32 *)dev->local)[i]);
+		printk(KERN_DEBUG "VLYNQ: remote %d: %08x\n",
+			i + 1, ((u32 *)dev->remote)[i]);
+	}
+}
+
+static void vlynq_dump_mem(u32 *base, int count)
+{
+	int i;
+	for (i = 0; i < (count + 3) / 4; i++) {
+		if (i % 4 == 0) printk(KERN_DEBUG "\nMEM[0x%04x]:", i * 4);
+		printk(KERN_DEBUG " 0x%08x", *(base + i));
+	}
+	printk(KERN_DEBUG "\n");
+}
+#endif
+
+int vlynq_linked(struct vlynq_device *dev)
+{
+	int i;
+
+	for (i = 0; i < 100; i++)
+		if (vlynq_reg_read(dev->local->status) & VLYNQ_STATUS_LINK)
+			return 1;
+		else
+			cpu_relax();
+
+	return 0;
+}
+
+static void vlynq_irq_unmask(unsigned int irq)
+{
+	u32 val;
+	struct vlynq_device *dev = get_irq_chip_data(irq);
+	int virq;
+
+	BUG_ON(!dev);
+	virq = irq - dev->irq_start;
+	val = vlynq_reg_read(dev->remote->int_device[virq >> 2]);
+	val |= (VINT_ENABLE | virq) << VINT_OFFSET(virq);
+	vlynq_reg_write(dev->remote->int_device[virq >> 2], val);
+}
+
+static void vlynq_irq_mask(unsigned int irq)
+{
+	u32 val;
+	struct vlynq_device *dev = get_irq_chip_data(irq);
+	int virq;
+
+	BUG_ON(!dev);
+	virq = irq - dev->irq_start;
+	val = vlynq_reg_read(dev->remote->int_device[virq >> 2]);
+	val &= ~(VINT_ENABLE << VINT_OFFSET(virq));
+	vlynq_reg_write(dev->remote->int_device[virq >> 2], val);
+}
+
+static int vlynq_irq_type(unsigned int irq, unsigned int flow_type)
+{
+	u32 val;
+	struct vlynq_device *dev = get_irq_chip_data(irq);
+	int virq;
+
+	BUG_ON(!dev);
+	virq = irq - dev->irq_start;
+	val = vlynq_reg_read(dev->remote->int_device[virq >> 2]);
+	switch (flow_type & IRQ_TYPE_SENSE_MASK) {
+	case IRQ_TYPE_EDGE_RISING:
+	case IRQ_TYPE_EDGE_FALLING:
+	case IRQ_TYPE_EDGE_BOTH:
+		val |= VINT_TYPE_EDGE << VINT_OFFSET(virq);
+		val &= ~(VINT_LEVEL_LOW << VINT_OFFSET(virq));
+		break;
+	case IRQ_TYPE_LEVEL_HIGH:
+		val &= ~(VINT_TYPE_EDGE << VINT_OFFSET(virq));
+		val &= ~(VINT_LEVEL_LOW << VINT_OFFSET(virq));
+		break;
+	case IRQ_TYPE_LEVEL_LOW:
+		val &= ~(VINT_TYPE_EDGE << VINT_OFFSET(virq));
+		val |= VINT_LEVEL_LOW << VINT_OFFSET(virq);
+		break;
+	default:
+		return -EINVAL;
+	}
+	vlynq_reg_write(dev->remote->int_device[virq >> 2], val);
+	return 0;
+}
+
+static void vlynq_local_ack(unsigned int irq)
+{
+	struct vlynq_device *dev = get_irq_chip_data(irq);
+	u32 status = vlynq_reg_read(dev->local->status);
+	if (printk_ratelimit())
+		printk(KERN_DEBUG "%s: local status: 0x%08x\n",
+		       dev->dev.bus_id, status);
+	vlynq_reg_write(dev->local->status, status);
+}
+
+static void vlynq_remote_ack(unsigned int irq)
+{
+	struct vlynq_device *dev = get_irq_chip_data(irq);
+	u32 status = vlynq_reg_read(dev->remote->status);
+	if (printk_ratelimit())
+		printk(KERN_DEBUG "%s: remote status: 0x%08x\n",
+		       dev->dev.bus_id, status);
+	vlynq_reg_write(dev->remote->status, status);
+}
+
+static irqreturn_t vlynq_irq(int irq, void *dev_id)
+{
+	struct vlynq_device *dev = dev_id;
+	u32 status;
+	int virq = 0;
+
+	status = vlynq_reg_read(dev->local->int_status);
+	vlynq_reg_write(dev->local->int_status, status);
+
+	if (unlikely(!status))
+		spurious_interrupt();
+
+	while (status) {
+		if (status & 1)
+			do_IRQ(dev->irq_start + virq);
+		status >>= 1;
+		virq++;
+	}
+
+	return IRQ_HANDLED;
+}
+
+static struct irq_chip vlynq_irq_chip = {
+	.name = "vlynq",
+	.unmask = vlynq_irq_unmask,
+	.mask = vlynq_irq_mask,
+	.set_type = vlynq_irq_type,
+};
+
+static struct irq_chip vlynq_local_chip = {
+	.name = "vlynq local error",
+	.unmask = vlynq_irq_unmask,
+	.mask = vlynq_irq_mask,
+	.ack = vlynq_local_ack,
+};
+
+static struct irq_chip vlynq_remote_chip = {
+	.name = "vlynq local error",
+	.unmask = vlynq_irq_unmask,
+	.mask = vlynq_irq_mask,
+	.ack = vlynq_remote_ack,
+};
+
+static int vlynq_setup_irq(struct vlynq_device *dev)
+{
+	u32 val;
+	int i, virq;
+
+	if (dev->local_irq == dev->remote_irq) {
+		printk(KERN_ERR
+		       "%s: local vlynq irq should be different from remote\n",
+		       dev->dev.bus_id);
+		return -EINVAL;
+	}
+
+	/* Clear local and remote error bits */
+	vlynq_reg_write(dev->local->status, vlynq_reg_read(dev->local->status));
+	vlynq_reg_write(dev->remote->status,
+			vlynq_reg_read(dev->remote->status));
+
+	/* Now setup interrupts */
+	val = VLYNQ_CTRL_INT_VECTOR(dev->local_irq);
+	val |= VLYNQ_CTRL_INT_ENABLE | VLYNQ_CTRL_INT_LOCAL |
+		VLYNQ_CTRL_INT2CFG;
+	val |= vlynq_reg_read(dev->local->control);
+	vlynq_reg_write(dev->local->int_ptr, VLYNQ_INT_OFFSET);
+	vlynq_reg_write(dev->local->control, val);
+
+	val = VLYNQ_CTRL_INT_VECTOR(dev->remote_irq);
+	val |= VLYNQ_CTRL_INT_ENABLE;
+	val |= vlynq_reg_read(dev->remote->control);
+	vlynq_reg_write(dev->remote->int_ptr, VLYNQ_INT_OFFSET);
+	vlynq_reg_write(dev->remote->control, val);
+
+	for (i = dev->irq_start; i <= dev->irq_end; i++) {
+		virq = i - dev->irq_start;
+		if (virq == dev->local_irq) {
+			set_irq_chip_and_handler(i, &vlynq_local_chip,
+						 handle_level_irq);
+			set_irq_chip_data(i, dev);
+		} else if (virq == dev->remote_irq) {
+			set_irq_chip_and_handler(i, &vlynq_remote_chip,
+						 handle_level_irq);
+			set_irq_chip_data(i, dev);
+		} else {
+			set_irq_chip_and_handler(i, &vlynq_irq_chip,
+						 handle_simple_irq);
+			set_irq_chip_data(i, dev);
+			vlynq_reg_write(dev->remote->int_device[virq >> 2], 0);
+		}
+	}
+
+	if (request_irq(dev->irq, vlynq_irq, IRQF_SHARED, "vlynq", dev)) {
+		printk(KERN_ERR "%s: request_irq failed\n", dev->dev.bus_id);
+		return -EAGAIN;
+	}
+
+	return 0;
+}
+
+static void vlynq_device_release(struct device *dev)
+{
+	struct vlynq_device *vdev = to_vlynq_device(dev);
+	kfree(vdev);
+}
+
+static int vlynq_device_match(struct device *dev,
+			      struct device_driver *drv)
+{
+	struct vlynq_device *vdev = to_vlynq_device(dev);
+	struct vlynq_driver *vdrv = to_vlynq_driver(drv);
+	struct plat_vlynq_ops *ops = dev->platform_data;
+	struct vlynq_device_id *ids = vdrv->id_table;
+	u32 id = 0;
+	int result;
+
+	while (ids->id) {
+		vdev->divisor = ids->divisor;
+		result = __vlynq_enable_device(vdev);
+		if (result == 0) {
+			id = vlynq_reg_read(vdev->remote->chip);
+			ops->off(vdev);
+			if (ids->id == id) {
+				vlynq_set_drvdata(vdev, ids);
+				return 1;
+			}
+		}
+		ids++;
+	}
+	return 0;
+}
+
+static int vlynq_device_probe(struct device *dev)
+{
+	struct vlynq_device *vdev = to_vlynq_device(dev);
+	struct vlynq_driver *drv = to_vlynq_driver(dev->driver);
+	struct vlynq_device_id *id = vlynq_get_drvdata(vdev);
+	int result = -ENODEV;
+
+	get_device(dev);
+	if (drv && drv->probe)
+		result = drv->probe(vdev, id);
+	if (result)
+		put_device(dev);
+	return result;
+}
+
+static int vlynq_device_remove(struct device *dev)
+{
+	struct vlynq_driver *drv = to_vlynq_driver(dev->driver);
+	if (drv && drv->remove)
+		drv->remove(to_vlynq_device(dev));
+	put_device(dev);
+	return 0;
+}
+
+int __vlynq_register_driver(struct vlynq_driver *driver, struct module *owner)
+{
+	driver->driver.name = driver->name;
+	driver->driver.bus = &vlynq_bus_type;
+	return driver_register(&driver->driver);
+}
+EXPORT_SYMBOL(__vlynq_register_driver);
+
+void vlynq_unregister_driver(struct vlynq_driver *driver)
+{
+	driver_unregister(&driver->driver);
+}
+EXPORT_SYMBOL(vlynq_unregister_driver);
+
+static int __vlynq_enable_device(struct vlynq_device *dev)
+{
+	int i, result;
+	struct plat_vlynq_ops *ops = dev->dev.platform_data;
+
+	result = ops->on(dev);
+	if (result)
+		return result;
+
+	switch (dev->divisor) {
+	case vlynq_div_auto:
+		/* Only try locally supplied clock, others cause problems */
+		vlynq_reg_write(dev->remote->control, 0);
+		for (i = vlynq_ldiv2; i <= vlynq_ldiv8; i++) {
+			vlynq_reg_write(dev->local->control,
+					VLYNQ_CTRL_CLOCK_INT |
+					VLYNQ_CTRL_CLOCK_DIV(i - vlynq_ldiv1));
+			if (vlynq_linked(dev)) {
+				printk(KERN_DEBUG
+				       "%s: using local clock divisor %d\n",
+				       dev->dev.bus_id, i - vlynq_ldiv1 + 1);
+				dev->divisor = i;
+				return 0;
+			}
+		}
+	case vlynq_ldiv1: case vlynq_ldiv2: case vlynq_ldiv3: case vlynq_ldiv4:
+	case vlynq_ldiv5: case vlynq_ldiv6: case vlynq_ldiv7: case vlynq_ldiv8:
+		vlynq_reg_write(dev->remote->control, 0);
+		vlynq_reg_write(dev->local->control,
+				VLYNQ_CTRL_CLOCK_INT |
+				VLYNQ_CTRL_CLOCK_DIV(dev->divisor -
+						     vlynq_ldiv1));
+		if (vlynq_linked(dev)) {
+			printk(KERN_DEBUG
+			       "%s: using local clock divisor %d\n",
+			       dev->dev.bus_id, dev->divisor - vlynq_ldiv1 + 1);
+			return 0;
+		}
+		break;
+	case vlynq_rdiv1: case vlynq_rdiv2: case vlynq_rdiv3: case vlynq_rdiv4:
+	case vlynq_rdiv5: case vlynq_rdiv6: case vlynq_rdiv7: case vlynq_rdiv8:
+		vlynq_reg_write(dev->local->control, 0);
+		vlynq_reg_write(dev->remote->control,
+				VLYNQ_CTRL_CLOCK_INT |
+				VLYNQ_CTRL_CLOCK_DIV(dev->divisor -
+						     vlynq_rdiv1));
+		if (vlynq_linked(dev)) {
+			printk(KERN_DEBUG
+			       "%s: using remote clock divisor %d\n",
+			       dev->dev.bus_id, dev->divisor - vlynq_rdiv1 + 1);
+			return 0;
+		}
+		break;
+	case vlynq_div_external:
+		vlynq_reg_write(dev->local->control, 0);
+		vlynq_reg_write(dev->remote->control, 0);
+		if (vlynq_linked(dev)) {
+			printk(KERN_DEBUG "%s: using external clock\n",
+			       dev->dev.bus_id);
+			return 0;
+		}
+		break;
+	}
+
+	ops->off(dev);
+	return -ENODEV;
+}
+
+int vlynq_enable_device(struct vlynq_device *dev)
+{
+	struct plat_vlynq_ops *ops = dev->dev.platform_data;
+	int result = -ENODEV;
+
+	result = __vlynq_enable_device(dev);
+	if (result)
+		return result;
+
+	result = vlynq_setup_irq(dev);
+	if (result)
+		ops->off(dev);
+
+	dev->enabled = !result;
+	return result;
+}
+EXPORT_SYMBOL(vlynq_enable_device);
+
+
+void vlynq_disable_device(struct vlynq_device *dev)
+{
+	struct plat_vlynq_ops *ops = dev->dev.platform_data;
+
+	dev->enabled = 0;
+	free_irq(dev->irq, dev);
+	ops->off(dev);
+}
+EXPORT_SYMBOL(vlynq_disable_device);
+
+int vlynq_set_local_mapping(struct vlynq_device *dev, u32 tx_offset,
+			    struct vlynq_mapping *mapping)
+{
+	int i;
+
+	if (!dev->enabled)
+		return -ENXIO;
+
+	vlynq_reg_write(dev->local->tx_offset, tx_offset);
+	for (i = 0; i < 4; i++) {
+		vlynq_reg_write(dev->local->rx_mapping[i].offset,
+							mapping[i].offset);
+		vlynq_reg_write(dev->local->rx_mapping[i].size,
+							mapping[i].size);
+	}
+	return 0;
+}
+EXPORT_SYMBOL(vlynq_set_local_mapping);
+
+int vlynq_set_remote_mapping(struct vlynq_device *dev, u32 tx_offset,
+			     struct vlynq_mapping *mapping)
+{
+	int i;
+
+	if (!dev->enabled)
+		return -ENXIO;
+
+	vlynq_reg_write(dev->remote->tx_offset, tx_offset);
+	for (i = 0; i < 4; i++) {
+		vlynq_reg_write(dev->remote->rx_mapping[i].offset,
+							mapping[i].offset);
+		vlynq_reg_write(dev->remote->rx_mapping[i].size,
+							mapping[i].size);
+	}
+	return 0;
+}
+EXPORT_SYMBOL(vlynq_set_remote_mapping);
+
+int vlynq_set_local_irq(struct vlynq_device *dev, int virq)
+{
+	int irq = dev->irq_start + virq;
+	if (dev->enabled)
+		return -EBUSY;
+
+	if ((irq < dev->irq_start) || (irq > dev->irq_end))
+		return -EINVAL;
+
+	if (virq == dev->remote_irq)
+		return -EINVAL;
+
+	dev->local_irq = virq;
+
+	return 0;
+}
+EXPORT_SYMBOL(vlynq_set_local_irq);
+
+int vlynq_set_remote_irq(struct vlynq_device *dev, int virq)
+{
+	int irq = dev->irq_start + virq;
+	if (dev->enabled)
+		return -EBUSY;
+
+	if ((irq < dev->irq_start) || (irq > dev->irq_end))
+		return -EINVAL;
+
+	if (virq == dev->local_irq)
+		return -EINVAL;
+
+	dev->remote_irq = virq;
+
+	return 0;
+}
+EXPORT_SYMBOL(vlynq_set_remote_irq);
+
+static int vlynq_probe(struct platform_device *pdev)
+{
+	struct vlynq_device *dev;
+	struct resource *regs_res, *mem_res, *irq_res;
+	int len, result;
+
+	regs_res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
+	if (!regs_res)
+		return -ENODEV;
+
+	mem_res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mem");
+	if (!mem_res)
+		return -ENODEV;
+
+	irq_res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "devirq");
+	if (!irq_res)
+		return -ENODEV;
+
+	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+	if (!dev) {
+		printk(KERN_ERR
+		       "vlynq: failed to allocate device structure\n");
+		return -ENOMEM;
+	}
+
+	dev->id = pdev->id;
+	dev->dev.bus = &vlynq_bus_type;
+	dev->dev.parent = &pdev->dev;
+	snprintf(dev->dev.bus_id, BUS_ID_SIZE, "vlynq%d", dev->id);
+	dev->dev.bus_id[BUS_ID_SIZE - 1] = 0;
+	dev->dev.platform_data = pdev->dev.platform_data;
+	dev->dev.release = vlynq_device_release;
+
+	dev->regs_start = regs_res->start;
+	dev->regs_end = regs_res->end;
+	dev->mem_start = mem_res->start;
+	dev->mem_end = mem_res->end;
+
+	len = regs_res->end - regs_res->start;
+	if (!request_mem_region(regs_res->start, len, dev->dev.bus_id)) {
+		printk(KERN_ERR "%s: Can't request vlynq registers\n",
+		       dev->dev.bus_id);
+		result = -ENXIO;
+		goto fail_request;
+	}
+
+	dev->local = ioremap(regs_res->start, len);
+	if (!dev->local) {
+		printk(KERN_ERR "%s: Can't remap vlynq registers\n",
+		       dev->dev.bus_id);
+		result = -ENXIO;
+		goto fail_remap;
+	}
+
+	dev->remote = (struct vlynq_regs *)((void *)dev->local +
+					    VLYNQ_REMOTE_OFFSET);
+
+	dev->irq = platform_get_irq_byname(pdev, "irq");
+	dev->irq_start = irq_res->start;
+	dev->irq_end = irq_res->end;
+	dev->local_irq = dev->irq_end - dev->irq_start;
+	dev->remote_irq = dev->local_irq - 1;
+
+	if (device_register(&dev->dev))
+		goto fail_register;
+	platform_set_drvdata(pdev, dev);
+
+	printk(KERN_INFO "%s: regs 0x%p, irq %d, mem 0x%p\n",
+	       dev->dev.bus_id, (void *)dev->regs_start, dev->irq,
+	       (void *)dev->mem_start);
+
+	return 0;
+
+fail_register:
+	iounmap(dev->local);
+fail_remap:
+fail_request:
+	release_mem_region(regs_res->start, len);
+	kfree(dev);
+	return result;
+}
+
+static int vlynq_remove(struct platform_device *pdev)
+{
+	struct vlynq_device *dev = platform_get_drvdata(pdev);
+
+	device_unregister(&dev->dev);
+	iounmap(dev->local);
+	release_mem_region(dev->regs_start, dev->regs_end - dev->regs_start);
+
+	kfree(dev);
+
+	return 0;
+}
+
+static struct platform_driver vlynq_driver = {
+	.driver.name = "vlynq",
+	.probe = vlynq_probe,
+	.remove = __devexit_p(vlynq_remove),
+};
+
+struct bus_type vlynq_bus_type = {
+	.name = "vlynq",
+	.match = vlynq_device_match,
+	.probe = vlynq_device_probe,
+	.remove = vlynq_device_remove,
+};
+EXPORT_SYMBOL(vlynq_bus_type);
+
+static int __devinit vlynq_init(void)
+{
+	int res = 0;
+
+	res = bus_register(&vlynq_bus_type);
+	if (res)
+		goto fail_bus;
+
+	res = platform_driver_register(&vlynq_driver);
+	if (res)
+		goto fail_platform;
+
+	return 0;
+
+fail_platform:
+	bus_unregister(&vlynq_bus_type);
+fail_bus:
+	return res;
+}
+
+static void __devexit vlynq_exit(void)
+{
+	platform_driver_unregister(&vlynq_driver);
+	bus_unregister(&vlynq_bus_type);
+}
+
+module_init(vlynq_init);
+module_exit(vlynq_exit);
diff --git a/include/linux/vlynq.h b/include/linux/vlynq.h
new file mode 100644
index 0000000..b3f2474
--- /dev/null
+++ b/include/linux/vlynq.h
@@ -0,0 +1,161 @@
+/*
+ * Copyright (C) 2006, 2007 OpenWrt.org
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __VLYNQ_H__
+#define __VLYNQ_H__
+
+#include <linux/device.h>
+#include <linux/module.h>
+#include <linux/types.h>
+
+#define VLYNQ_NUM_IRQS 32
+
+struct vlynq_mapping {
+	u32 size;
+	u32 offset;
+};
+
+enum vlynq_divisor {
+	vlynq_div_auto = 0,
+	vlynq_ldiv1,
+	vlynq_ldiv2,
+	vlynq_ldiv3,
+	vlynq_ldiv4,
+	vlynq_ldiv5,
+	vlynq_ldiv6,
+	vlynq_ldiv7,
+	vlynq_ldiv8,
+	vlynq_rdiv1,
+	vlynq_rdiv2,
+	vlynq_rdiv3,
+	vlynq_rdiv4,
+	vlynq_rdiv5,
+	vlynq_rdiv6,
+	vlynq_rdiv7,
+	vlynq_rdiv8,
+	vlynq_div_external
+};
+
+struct vlynq_device_id {
+	u32 id;
+	enum vlynq_divisor divisor;
+	unsigned long driver_data;
+};
+
+struct vlynq_regs;
+struct vlynq_device {
+	u32 id;
+	int local_irq;
+	int remote_irq;
+	enum vlynq_divisor divisor;
+	u32 regs_start, regs_end;
+	u32 mem_start, mem_end;
+	u32 irq_start, irq_end;
+	int irq;
+	int enabled;
+	struct vlynq_regs *local;
+	struct vlynq_regs *remote;
+	struct device dev;
+};
+
+struct vlynq_driver {
+	char *name;
+	struct vlynq_device_id *id_table;
+	int (*probe)(struct vlynq_device *dev, struct vlynq_device_id *id);
+	void (*remove)(struct vlynq_device *dev);
+	struct device_driver driver;
+};
+
+struct plat_vlynq_ops {
+	int (*on)(struct vlynq_device *dev);
+	void (*off)(struct vlynq_device *dev);
+};
+
+static inline struct vlynq_driver *to_vlynq_driver(struct device_driver *drv)
+{
+	return container_of(drv, struct vlynq_driver, driver);
+}
+
+static inline struct vlynq_device *to_vlynq_device(struct device *device)
+{
+	return container_of(device, struct vlynq_device, dev);
+}
+
+extern struct bus_type vlynq_bus_type;
+
+extern int __vlynq_register_driver(struct vlynq_driver *driver,
+				   struct module *owner);
+
+static inline int vlynq_register_driver(struct vlynq_driver *driver)
+{
+	return __vlynq_register_driver(driver, THIS_MODULE);
+}
+
+static inline void *vlynq_get_drvdata(struct vlynq_device *dev)
+{
+	return dev_get_drvdata(&dev->dev);
+}
+
+static inline void vlynq_set_drvdata(struct vlynq_device *dev, void *data)
+{
+	dev_set_drvdata(&dev->dev, data);
+}
+
+static inline u32 vlynq_mem_start(struct vlynq_device *dev)
+{
+	return dev->mem_start;
+}
+
+static inline u32 vlynq_mem_end(struct vlynq_device *dev)
+{
+	return dev->mem_end;
+}
+
+static inline u32 vlynq_mem_len(struct vlynq_device *dev)
+{
+	return dev->mem_end - dev->mem_start + 1;
+}
+
+static inline int vlynq_virq_to_irq(struct vlynq_device *dev, int virq)
+{
+	int irq = dev->irq_start + virq;
+	if ((irq < dev->irq_start) || (irq > dev->irq_end))
+		return -EINVAL;
+
+	return irq;
+}
+
+static inline int vlynq_irq_to_virq(struct vlynq_device *dev, int irq)
+{
+	if ((irq < dev->irq_start) || (irq > dev->irq_end))
+		return -EINVAL;
+
+	return irq - dev->irq_start;
+}
+
+extern void vlynq_unregister_driver(struct vlynq_driver *driver);
+extern int vlynq_enable_device(struct vlynq_device *dev);
+extern void vlynq_disable_device(struct vlynq_device *dev);
+extern int vlynq_set_local_mapping(struct vlynq_device *dev, u32 tx_offset,
+				   struct vlynq_mapping *mapping);
+extern int vlynq_set_remote_mapping(struct vlynq_device *dev, u32 tx_offset,
+				    struct vlynq_mapping *mapping);
+extern int vlynq_set_local_irq(struct vlynq_device *dev, int virq);
+extern int vlynq_set_remote_irq(struct vlynq_device *dev, int virq);
+
+#endif /* __VLYNQ_H__ */

From technoboy85@gmail.com Wed Mar 12 01:28:45 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 12 Mar 2008 01:28:47 +0000 (GMT)
Received: from smtp-out28.alice.it ([85.33.2.28]:21779 "EHLO
	smtp-out28.alice.it") by ftp.linux-mips.org with ESMTP
	id S28577588AbYCLB2p (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 12 Mar 2008 01:28:45 +0000
Received: from FBCMMO03.fbc.local ([192.168.68.197]) by smtp-out28.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 02:28:40 +0100
Received: from FBCMCL01B07.fbc.local ([192.168.171.45]) by FBCMMO03.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 02:28:39 +0100
Received: from raver.openwrt ([87.11.94.38]) by FBCMCL01B07.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 02:27:11 +0100
From:	Matteo Croce <technoboy85@gmail.com>
To:	linux-mips@linux-mips.org
Subject: [PATCH][MIPS][4/6]: AR7 gpio
Date:	Wed, 12 Mar 2008 02:28:38 +0100
User-Agent: KMail/1.9.9
References: <200803120221.25044.technoboy85@gmail.com>
In-Reply-To: <200803120221.25044.technoboy85@gmail.com>
X-Face:	0AUq?,0sKh2O65+R5#[nTCS'~}"m)9|g3Tsi=g7A9q69S+=M!BY)=?utf-8?q?Zdmwo2u!i=5CUylx=26=27D+=0A=09=5B7u=26z1=27s=7E=5B=3F+=24=27w?=
 =?utf-8?q?O6+?="'WWcr5Jy,]}8namg8NP:9<E,o^21xGB~/HRhB(u^@
 =?utf-8?q?ZB=2EXLP0swe=0A=09r9M=7EL?=<b1=^'4cv*_N1tNJ$`9Ot*KL/;8oXFdrT@r|-Ki2wCQI"R(X(
 =?utf-8?q?73r=3A=3BmnNPoA2a=5D=7EZ=0A=092n2sUh?=,B|bt;ys*hv.QR>a]{m
Cc:	Nicolas Thill <nico@openwrt.org>,
	Andrew Morton <akpm@linux-foundation.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200803120228.38911.technoboy85@gmail.com>
X-OriginalArrivalTime: 12 Mar 2008 01:27:12.0234 (UTC) FILETIME=[32728CA0:01C883E0]
Return-Path: <technoboy85@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: 18373
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: technoboy85@gmail.com
Precedence: bulk
X-list: linux-mips

Signed-off-by: Matteo Croce <technoboy85@gmail.com>
Signed-off-by: Nicolas Thill <nico@openwrt.org>

diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 47c6be8..07677ae 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -913,6 +913,15 @@ config MWAVE
 	  To compile this driver as a module, choose M here: the
 	  module will be called mwave.
 
+config AR7_GPIO
+	tristate "TI AR7 GPIO Support"
+	depends on AR7
+	help
+	  Give userspace access to the GPIO pins on the Texas Instruments AR7 
+	  processors.
+
+	  If compiled as a module, it will be called ar7_gpio.
+
 config SCx200_GPIO
 	tristate "NatSemi SCx200 GPIO Support"
 	depends on SCx200
diff --git a/drivers/char/Makefile b/drivers/char/Makefile
index 5407b76..2f0f787 100644
--- a/drivers/char/Makefile
+++ b/drivers/char/Makefile
@@ -90,6 +90,7 @@ obj-$(CONFIG_COBALT_LCD)	+= lcd.o
 obj-$(CONFIG_PPDEV)		+= ppdev.o
 obj-$(CONFIG_NWBUTTON)		+= nwbutton.o
 obj-$(CONFIG_NWFLASH)		+= nwflash.o
+obj-$(CONFIG_AR7_GPIO)		+= ar7_gpio.o
 obj-$(CONFIG_SCx200_GPIO)	+= scx200_gpio.o
 obj-$(CONFIG_PC8736x_GPIO)	+= pc8736x_gpio.o
 obj-$(CONFIG_NSC_GPIO)		+= nsc_gpio.o
diff --git a/drivers/char/ar7_gpio.c b/drivers/char/ar7_gpio.c
new file mode 100644
index 0000000..16460cd
--- /dev/null
+++ b/drivers/char/ar7_gpio.c
@@ -0,0 +1,158 @@
+/*
+ * Copyright (C) 2007 Nicolas Thill <nico@openwrt.org>
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <linux/device.h>
+#include <linux/fs.h>
+#include <linux/module.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/uaccess.h>
+#include <linux/io.h>
+#include <linux/types.h>
+#include <linux/cdev.h>
+#include <gpio.h>
+
+#define DRVNAME "ar7_gpio"
+#define LONGNAME "TI AR7 GPIOs Driver"
+
+MODULE_AUTHOR("Nicolas Thill <nico@openwrt.org>");
+MODULE_DESCRIPTION(LONGNAME);
+MODULE_LICENSE("GPL");
+
+static int ar7_gpio_major;
+
+static ssize_t ar7_gpio_write(struct file *file, const char __user *buf,
+	size_t len, loff_t *ppos)
+{
+	int pin = iminor(file->f_dentry->d_inode);
+	size_t i;
+
+	for (i = 0; i < len; ++i) {
+		char c;
+		if (get_user(c, buf + i))
+			return -EFAULT;
+		switch (c) {
+		case '0':
+			gpio_set_value(pin, 0);
+			break;
+		case '1':
+			gpio_set_value(pin, 1);
+			break;
+		case 'd':
+		case 'D':
+			ar7_gpio_disable(pin);
+			break;
+		case 'e':
+		case 'E':
+			ar7_gpio_enable(pin);
+			break;
+		case 'i':
+		case 'I':
+		case '<':
+			gpio_direction_input(pin);
+			break;
+		case 'o':
+		case 'O':
+		case '>':
+			gpio_direction_output(pin, 0);
+			break;
+		default:
+			return -EINVAL;
+		}
+	}
+
+	return len;
+}
+
+static ssize_t ar7_gpio_read(struct file *file, char __user *buf,
+	size_t len, loff_t *ppos)
+{
+	int pin = iminor(file->f_dentry->d_inode);
+	int value;
+
+	value = gpio_get_value(pin);
+	if (put_user(value ? '1' : '0', buf))
+		return -EFAULT;
+
+	return 1;
+}
+
+static int ar7_gpio_open(struct inode *inode, struct file *file)
+{
+	int m = iminor(inode);
+
+	if (m >= AR7_GPIO_MAX)
+		return -EINVAL;
+
+	return nonseekable_open(inode, file);
+}
+
+static int ar7_gpio_release(struct inode *inode, struct file *file)
+{
+	return 0;
+}
+
+static const struct file_operations ar7_gpio_fops = {
+	.owner   = THIS_MODULE,
+	.write   = ar7_gpio_write,
+	.read    = ar7_gpio_read,
+	.open    = ar7_gpio_open,
+	.release = ar7_gpio_release,
+	.llseek  = no_llseek,
+};
+
+static struct platform_device *ar7_gpio_device;
+
+static int __init ar7_gpio_init(void)
+{
+	int rc;
+
+	ar7_gpio_device = platform_device_alloc(DRVNAME, -1);
+	if (!ar7_gpio_device)
+		return -ENOMEM;
+
+	rc = platform_device_add(ar7_gpio_device);
+	if (rc < 0)
+		goto out_put;
+
+	rc = register_chrdev(ar7_gpio_major, DRVNAME, &ar7_gpio_fops);
+	if (rc < 0)
+		goto out_put;
+
+	ar7_gpio_major = rc;
+
+	rc = 0;
+
+	goto out;
+
+out_put:
+	platform_device_put(ar7_gpio_device);
+out:
+	return rc;
+}
+
+static void __exit ar7_gpio_exit(void)
+{
+	unregister_chrdev(ar7_gpio_major, DRVNAME);
+	platform_device_unregister(ar7_gpio_device);
+}
+
+module_init(ar7_gpio_init);
+module_exit(ar7_gpio_exit);

From technoboy85@gmail.com Wed Mar 12 01:30:14 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 12 Mar 2008 01:30:16 +0000 (GMT)
Received: from smtp-out112.alice.it ([85.37.17.112]:11280 "EHLO
	smtp-out112.alice.it") by ftp.linux-mips.org with ESMTP
	id S28577701AbYCLBaO (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 12 Mar 2008 01:30:14 +0000
Received: from FBCMMO02.fbc.local ([192.168.68.196]) by smtp-out112.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 02:30:07 +0100
Received: from FBCMCL01B07.fbc.local ([192.168.171.45]) by FBCMMO02.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 02:30:07 +0100
Received: from raver.openwrt ([87.11.94.38]) by FBCMCL01B07.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 02:28:39 +0100
From:	Matteo Croce <technoboy85@gmail.com>
To:	linux-mips@linux-mips.org
Subject: [PATCH][MIPS][5/6]: AR7: serial hack
Date:	Wed, 12 Mar 2008 02:30:06 +0100
User-Agent: KMail/1.9.9
References: <200803120221.25044.technoboy85@gmail.com>
In-Reply-To: <200803120221.25044.technoboy85@gmail.com>
X-Face:	0AUq?,0sKh2O65+R5#[nTCS'~}"m)9|g3Tsi=g7A9q69S+=M!BY)=?utf-8?q?Zdmwo2u!i=5CUylx=26=27D+=0A=09=5B7u=26z1=27s=7E=5B=3F+=24=27w?=
 =?utf-8?q?O6+?="'WWcr5Jy,]}8namg8NP:9<E,o^21xGB~/HRhB(u^@
 =?utf-8?q?ZB=2EXLP0swe=0A=09r9M=7EL?=<b1=^'4cv*_N1tNJ$`9Ot*KL/;8oXFdrT@r|-Ki2wCQI"R(X(
 =?utf-8?q?73r=3A=3BmnNPoA2a=5D=7EZ=0A=092n2sUh?=,B|bt;ys*hv.QR>a]{m
Cc:	Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200803120230.06420.technoboy85@gmail.com>
X-OriginalArrivalTime: 12 Mar 2008 01:28:39.0718 (UTC) FILETIME=[66978C60:01C883E0]
Return-Path: <technoboy85@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: 18374
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: technoboy85@gmail.com
Precedence: bulk
X-list: linux-mips

Ugly but we need it

Signed-off-by: Matteo Croce <technoboy85@gmail.com>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Nicolas Thill <nico@openwrt.org>

diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 77f7a7f..a3a271d 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -267,6 +267,13 @@ static const struct serial8250_config uart_config[] = {
 		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
 		.flags		= UART_CAP_FIFO,
 	},
+	[PORT_AR7] = {
+		.name		= "TI-AR7",
+		.fifo_size	= 16,
+		.tx_loadsz	= 16,
+		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00,
+		.flags		= UART_CAP_FIFO | UART_CAP_AFE,
+	},
 };
 
 #if defined (CONFIG_SERIAL_8250_AU1X00)
@@ -2455,7 +2462,11 @@ static void serial8250_console_putchar(struct uart_port *port, int ch)
 {
 	struct uart_8250_port *up = (struct uart_8250_port *)port;
 
+#ifdef CONFIG_AR7
+	wait_for_xmitr(up, BOTH_EMPTY);
+#else
 	wait_for_xmitr(up, UART_LSR_THRE);
+#endif
 	serial_out(up, UART_TX, ch);
 }
 
diff --git a/include/linux/serialP.h b/include/linux/serialP.h
index e811a61..cf71de9 100644
--- a/include/linux/serialP.h
+++ b/include/linux/serialP.h
@@ -135,6 +135,10 @@ struct rs_multiport_struct {
  * the interrupt line _up_ instead of down, so if we register the IRQ
  * while the UART is in that state, we die in an IRQ storm. */
 #define ALPHA_KLUDGE_MCR (UART_MCR_OUT2)
+#elif defined(CONFIG_AR7)
+/* This is how it is set up by bootloader... */
+#define ALPHA_KLUDGE_MCR (UART_MCR_OUT2 | UART_MCR_OUT1 \
+			| UART_MCR_RTS | UART_MCR_DTR)
 #else
 #define ALPHA_KLUDGE_MCR 0
 #endif
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 289942f..869b6df 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -40,6 +40,7 @@
 #define PORT_NS16550A	14
 #define PORT_XSCALE	15
 #define PORT_RM9000	16	/* PMC-Sierra RM9xxx internal UART */
+#define PORT_AR7	16
 #define PORT_MAX_8250	16	/* max port ID */
 
 /*

From technoboy85@gmail.com Wed Mar 12 01:34:47 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 12 Mar 2008 01:34:49 +0000 (GMT)
Received: from smtp-out26.alice.it ([85.33.2.26]:28944 "EHLO
	smtp-out26.alice.it") by ftp.linux-mips.org with ESMTP
	id S28577827AbYCLBer (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 12 Mar 2008 01:34:47 +0000
Received: from FBCMMO03.fbc.local ([192.168.68.197]) by smtp-out26.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 02:34:41 +0100
Received: from FBCMCL01B03.fbc.local ([192.168.69.84]) by FBCMMO03.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 02:34:41 +0100
Received: from raver.openwrt ([87.11.94.38]) by FBCMCL01B03.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 02:34:41 +0100
From:	Matteo Croce <technoboy85@gmail.com>
To:	linux-mips@linux-mips.org, linux-net@vger.kernel.org
Subject: [PATCH][MIPS][6/6]: AR7 leds
Date:	Wed, 12 Mar 2008 02:34:39 +0100
User-Agent: KMail/1.9.9
References: <200803120221.25044.technoboy85@gmail.com>
In-Reply-To: <200803120221.25044.technoboy85@gmail.com>
X-Face:	0AUq?,0sKh2O65+R5#[nTCS'~}"m)9|g3Tsi=g7A9q69S+=M!BY)=?utf-8?q?Zdmwo2u!i=5CUylx=26=27D+=0A=09=5B7u=26z1=27s=7E=5B=3F+=24=27w?=
 =?utf-8?q?O6+?="'WWcr5Jy,]}8namg8NP:9<E,o^21xGB~/HRhB(u^@
 =?utf-8?q?ZB=2EXLP0swe=0A=09r9M=7EL?=<b1=^'4cv*_N1tNJ$`9Ot*KL/;8oXFdrT@r|-Ki2wCQI"R(X(
 =?utf-8?q?73r=3A=3BmnNPoA2a=5D=7EZ=0A=092n2sUh?=,B|bt;ys*hv.QR>a]{m
Cc:	Eugene Konev <ejka@imfi.kspu.ru>, netdev@vger.kernel.org,
	davem@davemloft.net, kuznet@ms2.inr.ac.ru, pekkas@netcore.fi,
	jmorris@namei.org, yoshfuji@linux-ipv6.org, kaber@coreworks.de,
	Andrew Morton <akpm@linux-foundation.org>,
	Jeff Garzik <jgarzik@pobox.com>,
	Anton Vorontsov <avorontsov@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200803120234.40306.technoboy85@gmail.com>
X-OriginalArrivalTime: 12 Mar 2008 01:34:41.0241 (UTC) FILETIME=[3E139490:01C883E1]
Return-Path: <technoboy85@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: 18375
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: technoboy85@gmail.com
Precedence: bulk
X-list: linux-mips

Signed-off-by: Matteo Croce <technoboy85@gmail.com>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>

diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c
index c85194f..05191b6 100644
--- a/drivers/net/cpmac.c
+++ b/drivers/net/cpmac.c
@@ -1006,23 +1006,10 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
 
 	if (phy_id == PHY_MAX_ADDR) {
 		if (external_switch || dumb_switch) {
-			struct fixed_phy_status status = {};
-
-			mdio_bus_id = 0;
-
-			/*
-			 * FIXME: this should be in the platform code!
-			 * Since there is not platform code at all (that is,
-			 * no mainline users of that driver), place it here
-			 * for now.
-			 */
-			phy_id = 0;
-			status.link = 1;
-			status.duplex = 1;
-			status.speed = 100;
-			fixed_phy_add(PHY_POLL, phy_id, &status);
+			mdio_bus_id = 0; /* fixed phys bus */
+			phy_id = pdev->id;
 		} else {
-			printk(KERN_ERR "cpmac: no PHY present\n");
+			dev_err(&pdev->dev, "no PHY present\n");
 			return -ENODEV;
 		}
 	}

From tsbogend@alpha.franken.de Wed Mar 12 09:32:49 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 12 Mar 2008 09:32:51 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:49831 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28577364AbYCLJct (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 12 Mar 2008 09:32:49 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JZNKG-0002Ia-00; Wed, 12 Mar 2008 10:32:44 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id 16260C2AE5; Wed, 12 Mar 2008 10:31:46 +0100 (CET)
Date:	Wed, 12 Mar 2008 10:31:46 +0100
To:	Matteo Croce <technoboy85@gmail.com>
Cc:	linux-mips@linux-mips.org, Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH][MIPS][5/6]: AR7: serial hack
Message-ID: <20080312093145.GA6270@alpha.franken.de>
References: <200803120221.25044.technoboy85@gmail.com> <200803120230.06420.technoboy85@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200803120230.06420.technoboy85@gmail.com>
User-Agent: Mutt/1.5.13 (2006-08-11)
From:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Return-Path: <tsbogend@alpha.franken.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: 18376
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips

On Wed, Mar 12, 2008 at 02:30:06AM +0100, Matteo Croce wrote:
> Ugly but we need it

why ? I'm running AR7 uarts just like all other 16550.

>  #if defined (CONFIG_SERIAL_8250_AU1X00)
> @@ -2455,7 +2462,11 @@ static void serial8250_console_putchar(struct uart_port *port, int ch)
>  {
>  	struct uart_8250_port *up = (struct uart_8250_port *)port;
>  
> +#ifdef CONFIG_AR7
> +	wait_for_xmitr(up, BOTH_EMPTY);
> +#else
>  	wait_for_xmitr(up, UART_LSR_THRE);
> +#endif
>  	serial_out(up, UART_TX, ch);
>  }

this doesn't make sense. Why don't you check for the port type and
decide, if you need to use the AR7 way or the normal way. This will
for example break 16550 uarts connected via PCI on UR8 devices.

> diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> index 289942f..869b6df 100644
> --- a/include/linux/serial_core.h
> +++ b/include/linux/serial_core.h
> @@ -40,6 +40,7 @@
>  #define PORT_NS16550A	14
>  #define PORT_XSCALE	15
>  #define PORT_RM9000	16	/* PMC-Sierra RM9xxx internal UART */
> +#define PORT_AR7	16

this doesn't look correct.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

From alan@lxorguk.ukuu.org.uk Wed Mar 12 11:38:30 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 12 Mar 2008 11:38:32 +0000 (GMT)
Received: from zux006-051-205.adsl.green.ch ([81.6.51.205]:35390 "EHLO
	the-village.bc.nu") by ftp.linux-mips.org with ESMTP
	id S28578012AbYCLLia (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 12 Mar 2008 11:38:30 +0000
Received: from the-village.bc.nu (localhost.localdomain [127.0.0.1])
	by the-village.bc.nu (8.14.2/8.13.8) with ESMTP id m2CBGVpc008647;
	Wed, 12 Mar 2008 11:16:32 GMT
Date:	Wed, 12 Mar 2008 11:16:29 +0000
From:	Alan Cox <alan@lxorguk.ukuu.org.uk>
To:	Matteo Croce <technoboy85@gmail.com>
Cc:	linux-mips@linux-mips.org, Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH][MIPS][5/6]: AR7: serial hack
Message-ID: <20080312111629.0fa15d9c@the-village.bc.nu>
In-Reply-To: <200803120230.06420.technoboy85@gmail.com>
References: <200803120221.25044.technoboy85@gmail.com>
	<200803120230.06420.technoboy85@gmail.com>
X-Mailer: Claws Mail 3.2.0 (GTK+ 2.12.5; i386-redhat-linux-gnu)
Organization: Red Hat UK Cyf., Amberley Place, 107-111 Peascod Street,
 Windsor, Berkshire, SL4 1TE, Y Deyrnas Gyfunol. Cofrestrwyd yng Nghymru a
 Lloegr o'r rhif cofrestru 3798903
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
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: 18377
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

On Wed, 12 Mar 2008 02:30:06 +0100
Matteo Croce <technoboy85@gmail.com> wrote:

> Ugly but we need it

Too ugly - NAK

However please send an explanation of the problem and lets find a nicer
way to do it or bury it in arch code.


From ralf@linux-mips.org Wed Mar 12 13:45:41 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 12 Mar 2008 13:45:44 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:54754 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28578260AbYCLNpl (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 12 Mar 2008 13:45:41 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2CDjdrH024382;
	Wed, 12 Mar 2008 13:45:39 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2CDjchP024381;
	Wed, 12 Mar 2008 13:45:38 GMT
Date:	Wed, 12 Mar 2008 13:45:38 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Cc:	linux-mips <linux-mips@linux-mips.org>
Subject: Re: [PATCH][MIPS] fix LASAT_CASCADE_IRQ
Message-ID: <20080312134538.GA21020@linux-mips.org>
References: <20080220231153.77d7723a.yoichi_yuasa@tripeaks.co.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080220231153.77d7723a.yoichi_yuasa@tripeaks.co.jp>
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18378
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, Feb 20, 2008 at 11:11:53PM +0900, Yoichi Yuasa wrote:

Applied to linux-2.6.24-stable and master.

Thanks,

  Ralf

From ralf@linux-mips.org Wed Mar 12 14:02:04 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 12 Mar 2008 14:02:06 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:14224 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28579275AbYCLOCE (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 12 Mar 2008 14:02:04 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2CE22wL026091;
	Wed, 12 Mar 2008 14:02:02 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2CE21pb026090;
	Wed, 12 Mar 2008 14:02:01 GMT
Date:	Wed, 12 Mar 2008 14:02:01 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Cc:	linux-mips <linux-mips@linux-mips.org>
Subject: Re: [PATCH][MIPS] fix the installation condition of MIPS
	clocksource
Message-ID: <20080312140201.GA25986@linux-mips.org>
References: <20080218230459.35c2204b.yoichi_yuasa@tripeaks.co.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080218230459.35c2204b.yoichi_yuasa@tripeaks.co.jp>
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18379
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, Feb 18, 2008 at 11:04:59PM +0900, Yoichi Yuasa wrote:

> MIPS clocksource has been installed on DEC 5000/200(R3000).
> The installation condition of MIPS clocksource is wrong.

A bug indeed but I figured it was cleaner to have init_mips_clocksource()
itself check for the presence of an r4k style counter like other
device initialitation functions.  So I went for a different fix for
both 2.6.24 and master.

Thanks for raising the issue,

  Ralf

From yoichi_yuasa@tripeaks.co.jp Wed Mar 12 14:50:09 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 12 Mar 2008 14:50:11 +0000 (GMT)
Received: from mo30.po.2iij.net ([210.128.50.53]:15669 "EHLO mo30.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S28579760AbYCLOuJ (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 12 Mar 2008 14:50:09 +0000
Received: by mo.po.2iij.net (mo30) id m2CEo5MC045702; Wed, 12 Mar 2008 23:50:05 +0900 (JST)
Received: from delta (224.24.30.125.dy.iij4u.or.jp [125.30.24.224])
	by mbox.po.2iij.net (po-mbox304) id m2CEo2dI031739
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Wed, 12 Mar 2008 23:50:03 +0900
Date:	Wed, 12 Mar 2008 23:50:02 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	yoichi_yuasa@tripeaks.co.jp, linux-mips <linux-mips@linux-mips.org>
Subject: [PATCH][MIPS] fix the installation condition of MIPS clocksource
Message-Id: <20080312235002.c717dde3.yoichi_yuasa@tripeaks.co.jp>
In-Reply-To: <20080312140201.GA25986@linux-mips.org>
References: <20080218230459.35c2204b.yoichi_yuasa@tripeaks.co.jp>
	<20080312140201.GA25986@linux-mips.org>
Organization: TriPeaks Corporation
X-Mailer: Sylpheed 2.4.5 (GTK+ 2.12.0; i486-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yoichi_yuasa@tripeaks.co.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: 18380
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: yoichi_yuasa@tripeaks.co.jp
Precedence: bulk
X-list: linux-mips

Hi Ralf,

On Wed, 12 Mar 2008 14:02:01 +0000
Ralf Baechle <ralf@linux-mips.org> wrote:

> On Mon, Feb 18, 2008 at 11:04:59PM +0900, Yoichi Yuasa wrote:
> 
> > MIPS clocksource has been installed on DEC 5000/200(R3000).
> > The installation condition of MIPS clocksource is wrong.
> 
> A bug indeed but I figured it was cleaner to have init_mips_clocksource()
> itself check for the presence of an r4k style counter like other
> device initialitation functions.  So I went for a different fix for
> both 2.6.24 and master.
> 
> Thanks for raising the issue,

I think it has a one more bug.

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>

diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/kernel/time.c linux/arch/mips/kernel/time.c
--- linux-orig/arch/mips/kernel/time.c	2008-03-12 23:42:37.492242141 +0900
+++ linux/arch/mips/kernel/time.c	2008-03-12 23:44:47.819669076 +0900
@@ -157,6 +157,6 @@ void __init time_init(void)
 {
 	plat_time_init();
 
-	if (mips_clockevent_init() || !cpu_has_mfc0_count_bug())
+	if (!mips_clockevent_init() || !cpu_has_mfc0_count_bug())
 		init_mips_clocksource();
 }

From technoboy85@gmail.com Wed Mar 12 18:07:02 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 12 Mar 2008 18:07:04 +0000 (GMT)
Received: from smtp-OUT05A.alice.it ([85.33.3.5]:64274 "EHLO
	smtp-OUT05A.alice.it") by ftp.linux-mips.org with ESMTP
	id S28579904AbYCLSHC (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 12 Mar 2008 18:07:02 +0000
Received: from FBCMMO02.fbc.local ([192.168.68.196]) by smtp-OUT05A.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 19:06:55 +0100
Received: from FBCMCL01B07.fbc.local ([192.168.171.45]) by FBCMMO02.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 19:06:51 +0100
Received: from raver.openwrt ([79.26.114.120]) by FBCMCL01B07.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 19:05:08 +0100
From:	Matteo Croce <technoboy85@gmail.com>
To:	linux-mips@linux-mips.org
Subject: [PATCH][MIPS][1/6]: AR7: core
Date:	Wed, 12 Mar 2008 19:06:25 +0100
User-Agent: KMail/1.9.9
References: <200803120221.25044.technoboy85@gmail.com>
In-Reply-To: <200803120221.25044.technoboy85@gmail.com>
X-Face:	0AUq?,0sKh2O65+R5#[nTCS'~}"m)9|g3Tsi=g7A9q69S+=M!BY)=?utf-8?q?Zdmwo2u!i=5CUylx=26=27D+=0A=09=5B7u=26z1=27s=7E=5B=3F+=24=27w?=
 =?utf-8?q?O6+?="'WWcr5Jy,]}8namg8NP:9<E,o^21xGB~/HRhB(u^@
 =?utf-8?q?ZB=2EXLP0swe=0A=09r9M=7EL?=<b1=^'4cv*_N1tNJ$`9Ot*KL/;8oXFdrT@r|-Ki2wCQI"R(X(
 =?utf-8?q?73r=3A=3BmnNPoA2a=5D=7EZ=0A=092n2sUh?=,B|bt;ys*hv.QR>a]{m
Cc:	Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Eugene Konev <ejka@imfi.kspu.ru>,
	Nicolas Thill <nico@openwrt.org>, ralf@linux-mips.org,
	Andrew Morton <akpm@linux-foundation.org>
MIME-Version: 1.0
Content-Disposition: inline
Message-Id: <200803121906.25546.technoboy85@gmail.com>
X-Length: 66269
Content-Type: Multipart/Mixed;
  boundary="Boundary-00=_huB2HmaONZjU3Vn"
X-OriginalArrivalTime: 12 Mar 2008 18:05:12.0750 (UTC) FILETIME=[9E042CE0:01C8846B]
Return-Path: <technoboy85@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: 18381
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: technoboy85@gmail.com
Precedence: bulk
X-list: linux-mips

--Boundary-00=_huB2HmaONZjU3Vn
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Sorry but the linux-mips mailing list can't accept this patch for unknown reasons.
I'll send a gz file, that will work

--Boundary-00=_huB2HmaONZjU3Vn
Content-Type: application/x-gzip;
  name="core.diff.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	filename="core.diff.gz"

H4sICGUb2EcCA2NvcmUuZGlmZgDsPP1z4kayP+O/YuK8OGBjIwl/rnd9wRi8vMWGQziJ7y6lEmIw
WguJSMK7TrL/++ueD2mEBMabe/eqXmWrEkvTH9PT3dPdM5rBdB98Ot4PJpP90fMbcmPHMQ1IMwwc
St7G1Jn6wSh4Pj364WFmu96BE8wutswsTdsLQtf2Sdt2fep5Lnk74S0/BHPqfwrjgyB8yFNRz/1M
2i6NH+0FeeuPxmvRW4sH6lPyIfDpE3lLPz7aP7iziXvwGM0XB+Eih3/rOoFnR2Q4dT0P2MNrlv/W
2J1MyP7+gxsTu2aHzrQ2c+dR7YMT+BP3gYzybVuuP6afyemJcUjH9YODyfGZfqJNiK5px4eHW/v7
+0Wctvb29gq5/fAD2ddPq8dkD/5vHBJ4d6aB69AtUpqHwWwek23zOYrpjMTPc7oNzWM6sRdeTMzr
jtXpG8YW2doT8jYGJ1t7pVEQeGR7SD/D0Dt+FIeLGfXjCKHbAI6oR52YXPZ6Q6vVbdeNtO3qpmHd
9m6bvfetQet2mAKarR+H1uDwg9JiDprZls7g71azf5c23Pas1s/NVn9otTvdbtpu/tToW52eZfYb
zZbSfG9a7xsm8rBuOn2zblgDPQ9uNQbde6s/6NwOP2Sh5l2/3xsMTatuXHaG1ofW4LbVXYHy4frq
cgWo2xkOuy2rdXvVadyuwLnsXOcQrlu3rUGnaV33O7186/vG4Ao0ZIJ+LeuqZ8Hz1t4WEYa7aTTf
W41u833r5h5MzC3Y8JwpnT2TOU7EKApCMrIjOiYz25nCLIvAGVY58I39SCeuRzM+JxuFC58Y2tnJ
2D44cMaTI8de6cIJ2bIPJwDmxMcnzIvhj15HN/bcUbT/X+Vm77YNyjI7l/fDltVstyqlvXckZRK5
o+eY1pwJrW2Rb2FE8L+9b0mh9wIAXT2kKV9orZSyHO3wpAZoE89+iAoQ9zuu73iLMa3Z0WxfUmzt
eYE9LkDXPk/Ev7NDUBD8A7OBHORb0nBoSPqdZoMc61VyA5wgdD74ixk5BDRi+2PS89wnGscuuTnR
tAM2wKz8zPD/3fjHP5bU8tH+7bfaKuviCAstrAK2fPqJMIxZMKbSuNz0Gv93cHByWD+iwua1MX2q
+QvPyxk6wxaNrVU1MHVV18DQqI5g9HH/mbx5R/4Fjo9h6yBgjxGNF3PxPKOzIHwWL274q3iK3RkV
j3PPjidBKIkf5m4gHh0vcB4PgnX64ChOTm7RvpE2qDNyRhNtA21IrooyDk+PmDZqu1t7ZJc0g/lz
6D5MY1JuVoihaSfZbFfNZDMkYWSQqiKc8A+hPSPwOAkpJVEwiT/ZIT0nz8GCOJBmQzp2YWq4o0VM
CWrDH9cgPsDY3MkzYwSNCxhdSOIpJTENZxEJJuzl+vaOXEPPoe2R/mLkuQ7pQsLxI0pgys2xJZpC
mBlxRkjSRilMIQVpB8DZjt3APyfUBXhInmgYwTsxZCeCY5UEIeNStmMUPiTBHAkrIPEzAXuntAcr
dZAOdUxcn7GfQhqHB2AK4/yE2X1EySKik4VXZTwAm/zUGb7v3Q1J4/ae/NQYDBq3w/tzwI6nAUDp
E+W83Nncc4E1jC20/fgZhsBY3LQGzfdA07jsQEq4h5GQdmd42zJN0u4NSIP0G4Nhp3nXbQxI/27Q
75mtA0JMioJRxmGNpifMWqDMMY2hporS0d+DiSOQ0BuTqf1EwdQOhSAyJjaEjvnzy1ZkXGwv8B/Y
WAE7Vec5cSfED+Iq+RS64DpxkLcvo09tXIUo7BxUyZEOaLb/6IEJTGDQdifAHOq+IKySyyCKEfWm
QYhm6Lq2r9c1nZA7s4HsaixmirhL3gKLxeea67vxwfQiD8BCJyqEgH8vPFoIGlPPfl6CQICv2eNx
GM1thxbAIL4UEMD0hv8YBGBQbUGu5dVSv9u1zN7doNmCuG1+KGmf6ykGli0Kgvm+0x6W9GOFxZ1Z
gHCYItyZlwUIpynCldnPI0ABuFLKRrtV0laDQaJ14EGrXdJXg38eNrqlNZ2DQkr1AvDlfb9hmiXQ
Ho+7RpEIDfP+tmnd9K5aiGdoIvPm8IxhT0/Q4N+pTNACEebr8AoqHc1qdnvND1bnismlrcUAPasD
L8AAU+HQi3CuWm1Wwja7H0o4E5YkzyKiRRFRN47WI6JvIOLhqZYUIVgbQYUZ+zQen9QBkWUl8jsk
zCdY98SY7RZ1gzhx6J2njPuD1lXnR+nBmqZPsh0LeN6BIcINM5T4T4dgWcJeFj7E37H+z/ov58sC
zD21/5u7rspikukcgaJnxbXQ0mjkbNeansWAevxHCTzNjAiACEspl3ibw8YQ54LCWBmTwcf0hVgW
BJJHOj5frf2IqX+FZUaL6Hw11Jkv1kAX0WgNdBzNX5DQeNE/8lZM4k7nx47ZG8CKp3HZ5UYg6nTL
spstvLwHYMHylG+GtLGm3ThfssNx3rec2TjXFsV2zFW9jEp9yXIOicH1H/6pH/2yqeYKbGustZ6x
ZJ9VUG7bJRlcH8q68MQCxgLtHdFFlNAAo/UzLkUt8/7mstctZzAr5yk5+FxKLqNMIXmCqZKD4Lyx
kCSBVoTaQNkOQdoHZ1xmPKrsdVTZ2kPl4bPDcEtQiJRt8hZATK0lBwS0UUklG56Ys5dG8ITopS/w
36cpGrJcRkSg/A4oK4J2BUUIy4/QZ5AvinxPgQvV1BxKos/uDEpQJigurbmssR0+0Jg/73LHrSLr
Em/grinA4OvKyNwq+Vglj1Ws2n+tQuUWgTScHYqENV/ZRTtAGUbewt9jeNjbqyB3BvzIgR8RWDfg
QQA59JFDHyX0EaB8/IAAPaICR1EZR0JqwAQWAfD3kewLGSrnHBc1z/DfoogJixKXFyECsYTjgyY3
eefqgKaPaRNXCLQ9irYv7M+XAqU7tucsvM1UTjLqFhpeUng8m1vgaVX2wNnhkxiCVHkqNWhPvggd
SmAl0aVkhS7FNbmbRq+S6BGA6OFSbknDNSy0xoFAL2g4LFVX0lEWA61TZizeEr1C/viD8LcL9JcK
dwcn8GOoeqlCIPleEK1CdkjawAYq6EYhtR/F7BBTUEiQ6AHXakzLvJEzqZBv5HjkjFOmj1C80IU0
XzJRkFmiO+Gnm/XKqOYhWPqxjLt5Fqzibju319hM+L/txvjjIsKVITBeUPY0YY++80y+G+MK57vx
v/ztqkKkmg2RK6lK1N6uWpd312S7yWL/GzGwN8AuGRx/AbnfpJ2IPhI3TiPGrtDEl6VYmSbzJJ6W
cboIR8dsNXbHoV5lf3hSPIXxohOxuD915xa8ltk4GCpAwNRjr8wYkd3KB7N1rTeurgblxuAEKvtr
k+1Tkj1I5PppJaE0XkfpcEp0JE4NnqeTt2+JUecuJ0KwJrHKKPYFbqsBBtkBdGz4BhuOTjIkhpLr
OGk56QN6nkwmFexIB3eHKVLmw95h+3UOo6uQiwticNdHi1yQQ4MVLCt7UYRdbSPwHGEjVmpMYRlc
JSvKsl32pyqMuDsKgtiB1TK+pNk2DWcwpcbA5ly84iRJcjdXfpsvQWQRg5UbJjzE2b9Q6zgouVMA
r79FFyIUQh5F4h11OcA0ppb/FbCynpAmkSshVRYEGVRAc3G/+p3sb1ct9RCDh8hyGeXcSZYETIBk
CSBZYuH0yY2dKcY5rkP0s6IlOXoEM0mFseKPLGI5GHEKFsBvWNWgajqxDC8oZMgsZAAWyTPImeoF
JriQLuaCkI3ZwKIzzyVTF2aZpDkgVerSIl2dKQrbmjRwWskJQ2YWahXyDua1yqOsMAHzlNELapDW
0NCVyhq+Zbm+g7kuVnMVxr4Y8DtPHGw2oZthPzuYTf/G0qAqxi7LTyiNTt4UQBntPhMPw8m5MhrZ
gSq2olXm4ixpb6TFPAITLYOWK6jSgBP9e8JSkjuV5JMup9IIks3vhRErs6b4z0/j5e7//0/ltLpO
6aqpRatkR9puJzHejqhJ5EcWnkV4aOahG30f7ZHNC5ByZT5ABBRixrZgy/wlzTzA65BVFwGKzH0p
l5rE2k5Ad5RNmTy3cjIlUSwlW4BMmP2xtY5v2meNKoKdHFWKppBl4Ua0MkfwVSz4l8sw6bYgBHut
uEFIZ/bc8gPHdqY0LZGumt0qOays3rKJxCwEXYiVVHklYkVgrOyt3/upNWAVmaFVBXLk/kaDySqm
FWH05S2CojqnaOOa9bLDee1fAIcqkWEEpWq0W9zZK+frsky6y8uGuLzdUSRM0TY7H3IiDbBYI02J
eviNJN/bcsDAD3mlogBbtE8PM0l2v4hGTCApgdyyxc7xSwjf+VB3TzBNJIUo00RRt0W7/0q3wI3r
QfZbsEEDHrTwwYPKwgnOlSZOtnp9YmTMkK7fV+xpvbL0TSvGclnOdh5/eLXPasEKfiKDiZJgiAik
opy/vqpZk4mxAJC98SICIoyQJZeYi1KzkTHhK7Smplql+s68GPwNBCtO3upitnPbxlMppWQ5K/Y4
cAGbLpjhfVFNFwkI3GZUafGvLH8N8cqL+XSZzYeoJJ5czZAOYFX+0dS4L+Up2oj+YylVMWdoq2lD
rjWStIEo7YqyQ8QxtHPCt13wcxN7xk2h2i7xgznZrXF8kakE6yRhQZ851CUvXSO+kkkV+RWd4M41
+eMdX2GljbLpz8hlvCyY8R+WjLmAYLBBMGK7aGxu8Vd3zKeDCAAyymyUgkCgRvTsO+ybdSkpWCVj
uVeNc6f4wyFfQ4gQki8fxeG9HFaSohjWFyVNgURmKtCKUSSfQXmpADTGG12QrBrEy6NYPYzsOFYP
hO8Fy6GgXHoq1wruBbE0U6MZ/9s1mrFpjWZ8XY12urZGM7I1Gv9kAmUKD6r4xOI9Psiwyp6z+yuY
+DkFPjEKfJAU7DlLAWWLoMAnnlPgQVKw54RCVEfd4AHCfDAj7dCNf/vmMvhMTvQTjTR8n34ml2/Y
pIaKDTcrXXZAyIXMgx9YTw8PTxEmkhGfc3g0S2k08eSc/4DHHvjMVmByM1ZX9mJ1sRV7pOCJLCer
q2yu09Pm9BMBt00atI1MutNlttO1AklxqFLStRvTycEA3J+Gl7Nj8SV1k/Ed58dXP6obp7nxJYzX
jU/PjG8/GeBxwfig8t1sfLLmxeHB88nxmVE4uvpm5tOL7Sd7UYdX33R8R8w5r8wu7qr738fkUxA+
4vEoPGMnmqByY+ejJDcMqgkzJ5iNXJ+fkcL1beg+0ZBMF6AncHQIXyEefgTIe/uJIreYa4mdxwIM
m6DTT8PADyAhjgI7HCMfXxypGwfEJY9+8Il8wnNuoEhoYQe6MoU9X1Ng7hQxIlk3FeTI4tMwcrHE
PwJE869hA3NUZbNRvpXbdNkiNf3gkgYFKCwF1zXouXAhqErKxkgaFgvP4YiFpBopd5RQKd6SD1pL
i2e+e5j0gQuEhBF+4ZK0EpDG31LRYiGVNb/GWxHLoRMj05CEfwZhpLlP/ZtpNQltBVpN01PhMSgc
QJqtxFo9TVkCnNGqsi4XWk3cu6akPtSqpJWAF7SayprZL+AFUXFOrbKoITNvosTMcQvchCOyznmx
SBMF2Bqto+djtFny/q8y1J+y1FpT5fZQNrCTKH2wGswZ7NUWe4XJCm32dfHkFQGFqMFEKHRNRMnt
x2UVXBMfIF4dLzYPGCm6jBokFzFKwtc3c2P9q9z4q7SeuvGf0/oGQVx14+Vo/n9snsKZmf8ckj/w
UGyJpOiTlpArhSKuqY3S9UThSVZQg7K8YLvJyhJDQKWFivSZ8s/tvK5Yt/CgIFc3iFgomVDht5/s
0Mfxtzs/37TEVrmyZZv7HvOq7VV1WYuMVixo5dI9OebhjssV5UsYri6b7zt96wTWE7Dcygr9hjSn
1GFFLVaxeAUGB8utSVjfWPRG7DYCcsgmTVWmSsFXq7Rzg3X+dbR1Qbus3qJTMZXz7Ob4ml7UDQr1
O9mXdZeI2JWj/B0i3rzZhSrHPhk7ZxtcIRJMMzeI/rpA9NcFor8uEG16gUi5DVR0iYdNMA4Ue4lO
4EcxcaZ2SHYx3CCGBc4a/xPDEZ5qs24aP/8Cwed3olXJl+QcNkMU+xzlhR+xa+astZph6tkj6in7
zYiBp91U9urXp/1W5/bHRlc5EJ2RCp9+yeJf3pn3KTrvT5zIzJPCQBjGebI6WYe6DYn8eTs9TpA9
DZc9/K0qhOdLltBYM0acrJKERi7vrq3ebfmbokGeiwSbF+v2rttdKQL2BbRrQjreNM1HdNa62Z3Q
M6qN9KMNAjrnqV6PPTXWBvTj6l9h/a+w/ldYz90LBeuHi3nx5dAkpi9d5Qx/xWK84D4nzs+QPkQb
X/UUv1nRa7fN1rCEn2uUy2KNZiuFNBRI8/1t10xBRvYa4qB1LWBlkBSvhjxUSmV8xn0r/ExFtM+H
ZA8B7FnHcyCS2mw1LYUDJ86IqVCeLhGaAylVqbzESKtU8JMcDpHZIhnLQBG2AnTL4uuSUM8SIv/m
6v4SstPTDFnLfKlDQ1Ia+Q5ba0aY0J1l6VovDrEuKesFPa4ZY0J3lh1jv6PQgK1V+96YWdihAuvf
vCDokezwKCvo8CXCY0l4rMmZmHprGe9NV0hZfEMtF9wC6Az+jidhGGJFJcepIHtypj4UKGV1dgAN
awZvPeSEmXtZUATgijl6tEDKtI5g96tgkvtsDb1M8Vp823kVuhAoos6rhXolDQr2ShJYTzv2mPJt
gwI4UuJCOTl9pCDJa36IgyD1Gp/4Ks0i69SdJ3h4PR9LZKjYDnx7hs/b+NNCuKNywDUldkdSOzKY
Asm028l2ijALVHsvCSJ09HphBGGhQCosK1QKWSGZ7WBOVO1hiSYh3BRKMY/isQQ/EKDqktBEUJIk
A24v9bfJDBHFNsvjHr+MwxIN2c9YukK+w3thyo0lnPXZSLxMUik8QLt2/v05aZpfJ82q2f2nhPlK
WV4IHUUi5fnDKySMKpMjm/JeMMm/udvmy92uC2Bf12tBp9ndU2fKNwKxSxYE2YzDuo/tzybxL1lk
Ji2n606EF8dO5bYvsmPHYCCTXbmRPfKUqRux339yPGqHZE59vGvOMGupAtKflqouu7vGPUrFzOHg
rc5lJJVdgcVWoW7Q8ev6zXarqF25Waucv3T56UuXvAXT8zvRfKdCdOEKGZTCwhVCYAnTD92ZHT7j
L9B9H8mTe5Q5BN81B1NYIgDzC697eFd7R81o8kgW4XiWB+tAD6FJLyZ1Alj7LPWD2zAoN2iFH7Z7
qV/47zA5AFbiQqjZLAUVSsL3ZtgPazGHN8Q4slmHH2pLkFTtr8W3HM3iJzTLnRZWeNrKiZ4pO1Zd
FgItQ7/c0sWGwvkvr5yijdM6ucJPnNYn8gIoWy0xtxgHKFtmWKhaaSy+c5Vqq8B4uF8hRoAncsJg
8TCFxTAX73vt+8xE1av5DCDcL7nPko4gs+jiWMtOjjfPUyfHsSXHYnV5OGDFGJn7iM+W6Tj5OUvB
5OJCHMcVvjJfhG6wiKwkNpUTo8IqGJbVj/YD5YbFn2Bj3Y3daG7HzjRjXjWci5gmRq74DVpNNjn2
IqKsxRxqVudGWlISYzte8mlbnT7+3l6NHRMg+JtwoZhfQg0nydUNsoqBwRmAcBpMnXDM9qQ8XJBw
TqrTZi6CrFTQmm1F8Wt2+Z1FCdhoc/H4yNbODp0NNhcTtsr+4kn9he9FPVDTT/y3TpNtpEv2E5Ks
VJX8ZzP+W1xOAR/97OwQEjKeiCcD25sAPXWmHi1GPatyTNP1XJhv5Dq051PXifheEaP5QJ9c/3/a
e9LutnEkPyu/AvG8TiRHckRJvuJ2Xiu2nPi1r5HtdLLpLB8tUbYmukaHY+8k89u3DgAESJCm08lM
76zn9TgUUCgUrkIBqEPsrohf+7NZOBiUxSdM+fQLkoKuZWnf3Amms3k4EgfB6PIyQM04WK2UNNCA
7lZXBfoOFWfktXYwvuyHsnYhmoOBINgZ+r0Ip9dhd+XhgvXhgvU/+4I1foGKigjATdyXq2ku+YbD
+/rjm/RG7vTpuOP33O79cLaNLt1Zn4OJ8+IXm9Mf9Vye/CawrTmSQdjC7p050SFzqZAu7uw5OTK1
HhBx45OnA+hC1N5PiD+QhgpEaw3ygsE7teWFahkvzCLrhOhirXrjNaTW9DPGU5HWCQT5KZyOQA6E
jc9VeOfkzftT+sKs0hOEU7K3NMChel+KCI+UNEyCSvhNAgURoCWJAsFUtoVMZj00li+6Y/mqiCDP
YiCsC0lZj40qYu5ouLaff1Zyi1D2wJRs9GbJstDDbNeREAfOhwGik5tLgKE1itNjxvjoE7pADSo7
wmi+llaWdG7sdn3ehP1peAnzp4g9LqW8MiMjM2ldigV5wfqfh61Dv908LKWSi/uNrwiHWky6tZyX
KZJo97lJoSTKyiWWNLz1i27YyyGWGIgNwWS1sfnw8PmwLz/sy/d7+AwW8zH6g7/f1vzdvOXKnGFQ
GQaTSdpGrFa8D3yh33FjH867zydXt7Oh3LMTm3k47QeDjCx/o7ZaTXn+nYynmS/D8WS1mpx5g9vR
3505g7B7bxkFmpyW7vf6N3DacKoqZTgoNh+oMxScklmW6EJvFHSyp/b6MI0D05WlkTWeAFec6Osb
0rG56GuPVHhsmssEfpiwRCOJY6QMGmV1NFHEMvxr3J4CqsVgvuWkgghcntA/28AQrisv4c9KNPUg
w3ARxKjQJZ+ppkXFKy9VE8piiZAvldjL2OUYljqwveh6kun0qY2qtG5wyVWfVljq8u1vvM5YVSBz
IVQ3ExXD/AFMkqApS7k+QE8Wjt6oxlEatUu80m/KalU2niCwP66DwSJMorTcwOhShhrZo2fxil6Y
al9pvbjF5WJF5HDFClkDVoj00dw4X0T06fmYuOyUs7rXu2taf/NEztUF2Y3J2yVfk6+XkA9yCDRF
smy/NwhmV75Ojr2ugnjKr6sUYANS9o/bLeW7qXVIWWT8iNedN9LMlS68V/jsgonr/F7gfk7VNXcm
w6DjD8afkZgPHyUldNjQ5KBqD3udyCAookhrLxw2d/gWXlJlZZCZ9joRWPhaTtTZn/49vcr99l/t
KmvrZj3862u+pl+B1Pxj2u6ltd37rm1vWPXwrzvbzmvnxwz724P3R391DzxnUfO/18hvWiO/mYJU
rah8TaneVBvRmooWVbXRU4vKVQnyhnsRv2Hh97z7jN0Pmrc0Ql764Hnfc/DqdbMi/vU9Bq/jHLzO
9x08z6tZo9eo5xo9tI36/sN2fvrKOWZoWPY9B8xqMv/6HgNWb7gGDFM9Y8Rc/WpvqCQFOJLk/vq5
34Xj4zaZaX+VLjbEIERFgtlsMQz52Ar/zRb9Oeka4JH5YgyFcLnRswnwTN45Zvjw9YmfWG2a6CDi
45FEvhYmEvhWyiQNcSnXESuzSRjSnJKbencxGYQ3MtvZCygP8X5GSKNd3axDSymIifbIlcn4cziV
SezXbgXJlFpbqLWql1L+eok1pVVc85IV15IVr/d6WfJLXACM9jOzXjhmrZB6mDo1lXVqrxcl8wyz
qeS+UOIfdtjGvUhJ9MG30+KtJWjZzKDFuDmwl4KipE/Ly9KMk3AVgmPRMyFEA9yT5NJS1Co59olb
wuXaFkOdMHPN5sVaQ06h7jBQcwEDJnK0QfSZtXVXk/XUz2guwehmSkD4jip9YpPBjKkzvgqn4Wie
Th3DJbrNXo6aaZr9Zsnhzt7Cy8T3/un+f7WKFnAp51yI1qbVM96foGf0YsnoGiXv5OsbBZ23czT/
yJg1fLeRvjhsHhRvhSVx39UIC/h+bbhjgPM1whqQZCvyjoUNHbWD9t0zuddOpuNJOBWfg1tywMP6
7QsUDfAaEp2eLshD0C0pFMHHCO+vw8487PKt80zczDoBbNawPZfF+OIaFU0Gt2XRHSufQysrK/qp
ticecyVdHTiz1d5vHtCFaCmFv/OdKUL4SBXRV7X4O/A8qXgXCV/N9hlPIdbAwgyM4Bqlo7iHjpel
TAKAY6ltfU6mjPKsr6So85M9n566mudnx0i8+EJpKF0dNk+yNihXA7yUBpy3N6IGeCkN8P4EDSD6
tSQdjUlZ/vL0r38ITUNVfP2WavxZf3Q5CFNqy4vfXK8LFn/T2E1ESfpyjVPHFf8FNbd6SQLY8BMk
S2m4j9/GQUREVZOUulQWJHTgQRU+UYvxOpQ80iuLNIk8qmU2WK3W7lHLZkotZqEQn/5G4dwotp6j
GJy6jBJwcvuW9lxu1BuXqc2ZTCZGFWs5iEp0QJ6WBNCtOUbGLPK53+vnab3VGpTPzUINR6EVNZHm
0/7lJVleLMmkyni0lKNPexf+bJDapZ7dN3EaayZ99RyNqpsFqjkKNO7bbas5pvNdHdIbj3L1yEZ2
j9y3Q1azm9+4Z+s97xua79sMDi/cMVU/RmUz1Mi4HXovfqeOaRXMZW5KDLfiJSTdhEBk0lCW/k1y
0rLodiz+XrFFMQmyFJex5A3RXcKVBEtIh/0RKeRqRRxym4B/alfhTZF+XcVc31wZ7m6eVp++EPzl
6a+a/qrrr8bTF7rMqk5d01/r+mtDf21SGfUedCUqWJ12WPO0qQFf6a8d/bWrv1r6ay+JsPkUfYdX
I6yBhr7QXx391dVfof7qJbEGEVbT7Y0Ze8kZjY1OI+jbEf4lC5f+CPJHHfQBa40QPnL5Um/LMn+h
XJwzH1Y/lvXWDeiIPyxVqy/4P6/2ot54sbq2hFGwAhkBED4i/w6FGXmi6hURW1ksQeZPMP1k4xRh
/MJI5UhXCogPR9dURgeiegz5UrUtHSdr0Gdg+mpii2CNJroU+42AfqrLPvQ/UsgkNcmxc/pwNKh/
pPgVjZJgh11JABzUj1kWSnzUII5iqovxkE2m+3DiWGZfWOOutsHY5RaIg9burECa8SYXoUUtWZSx
nk2hTD836jIS3gTS1UlHVKhU8/lqPKBrzNElnq0Wo2k46NNNJpGBBMdGY+mEQ+zs70aex7AxcTCV
zlBc8X5PfEYbDzxmXSo/rjJiT7/LbotP2seH6BGMjm6KfuoZoSM1PEa6SpZZicwB7gr/Fbmjl8gF
sv9qfOPvHR8tlQyvLHf0rbGrRg4w431rABneXLKouCcJUtLJpEDCxAgoPob6O8OJIgEOYm0YL4xc
mMzZfYV0PXki9FA+ZhaAabIpKgtK7J4eVEBOP7tPY0zRPr05JlRmj+6+Bsn6XvVHonhG9RGQgz0b
esZYGBVOZ/NwKvdva7FLXZotVizqwRwWyZsDtgOyZAI6nUWnSPz6UPsoGXM4RB0YnVFGb0i2r3Kd
hz4Ra1LVI8JU/bgij9rksgcGfiueT4KAjPNgZTjuIxIw+KMzMP0aol/oYkl5yLQRxo/9CYi0+5Ek
YDiUgNLPe9GFpyxqq2ulRGHzPoLDDeJMCIPp4FYe7X0y2Ss+MYvpfQ3lKWNbV4PO3O54NLiVjhbr
NzesKBmIGVm9CUZOV1bCikBzFcx8hvGxSuVa0CDbcw6kDSBH0kvmOG5mkkB3jWUMpWswbZC0yyIH
ZMZweo7htEvHxzPXgPKOXrBG1B5SVqv/C7EjGNnHyeUs9UcL0TVT3iVBwFafu3Bsfe9Zpbou+55I
6YthJ8aOLJoFclfetSb4kgl7L73z7qrHeiu6q8I7selL8zsxORS57Mv7FVvHzex1us0m6KK5YTnR
6Wv0GL6cTcHi+WZykkI6eGgKZdhp/QwNQjPaVvgnxwcHZeOBZQXjujyJP1dbNKAQgf+ATFFpHR3v
tt46qCLf5dbRxyvHH4dX9IEnV5dEpe/uEsMPn/30Zr8xK5t60x/f3f0EuDK6KbuX4p1k91G1HHu4
t7soXw/lmf/moSYXautm5Q8vVHnxYSuvcmkZmEY7nOgEg0HRJZ9leyQk3WyHjQ4l5zQb7oXVTjWP
fQ4jNWxz6rVGLtscl+3wN1rlkmHwHzDNzWsDlGEBBAmM6v4mQMW3ypSnJIIZYzFtgjLtgTIakWbE
k7TfMW13GNf9DXgcxjuMKr8Fz10WNhkmPH/choftdxjZNxnxJA14GNnqJkxI6K9QnAyCDtpcni4Q
R71eVVY8aMSDNjwe2vCsl9GGJ2rayYK9pNO1BsV1wapnHah7JK1Z2AnBAl/BxPvm4fERzOCg0x/0
57ACVlLMdFPtfdh+M8t4BtiRO3vSH6Gv7PsaC2WYvDgNUDJMci+7F5XZfHGR6rQ33drFMGnRfvOa
7/zW0Vn7vdioGqYu4ejavw6mIroLw1s9fV25TOYLW+6rclU26AbDmg+/PuhK2C8wewZWzoHVVVt0
FxVVGL8rNe8KyWWMxkwXIlGN/Y90DR9dJdI1lLxK4avMBHDJkjWsbNXcaDtLc6lrtKNkNM+yU4Xs
zrCLMzppoSqewHbYmfkSQB5eE7eXSb/3EiF7o7vslLWP5svrDx+tW83ORNkiBZ25jNeJX3T+RIG/
Ofgc3M5E/3KEnIgwVD8KHSMJX01cRGojacT1M1Gh7pCh3ye3xc6kzNgQQp7hAB3aO8+ng3BUjGcC
qbAhb4un4infAkHWs2fm1TIUf+wiR1YMjcF7yyn0GLLHKbBU5CBkKyZdmlQq3B9YGVb1Oz9YRLdJ
/Pwzu0Cm0BHKSJ0SpPE0JeCsly6Z9G8zv9ebWfn4Wxlfm4vIUB2l4ZrMJj6tKN5C+VHgbL919La6
srG0ZdHIkJ2rxegTE7ohRovhFn9hREj69NZEZ6aTod/1suajrYdXWF+BkGAud1ffx0CWQedTqAzi
jSphqft4yAtH8+ltrNq7mUUSg5FivJDC+WKpM1no0GVL6nGyViZ9ZOxKnVaHNDpzWqkNhASJcD6/
rerE1SjR04kb/NAR6IRNTriIakWQ2e0sSU+dCoMkF8v6qkP+PXr2WzgYVDAu2UhAS/n+vghdhjLN
YDyGbhaLCUk0lBVcjK+ldS/6E8IZrItJLtm6CXADfiHMPto2ouI9A0G38v3+PHr2RVQ98WXnrH3w
ZedNa+fX0/NDwWnCr+EfT//ZxD9r+GcD/1StP7/jn729H0Dho2dH0Dnbb3H2iUnQn2KPBoI1aQSt
EqPjjpqHre23zYPz1o/prGpaZx3hnyb+wTS/pXvnrc44wD/nKvf36r+qs2rcSzNRBC6Bk5NCoCyG
FyD/Az/lTHP2odgyGAdwPpAS/7a3Ul9ZX/FW/3WdSpPvAv+M9Z85/hnonwH+6eKfEP9Mqbd/CIVG
BTP809c0jNTc5zWygn/q+mtdf1Hu6o8b9l3cafAcEHTRjxsdDKo3uCBVWETtRvn0BGStt/RCI0Sj
urlmxoUw9yraR0zwWDwIs4wWjZDxLSa+wf6LvJHEhEDHk7F8VzGKlmzJz9xTUNoDVru9LXFHIl8M
Kkvoc3u77HZ9FhsBiyHFKlmMEGaJtJZEG3dv9zgpsEo3d4kM9JArxfVYLpGAer6ybTEPeNEDnpKV
E7jLvOU4674De+Yj3SSYzkJfziCSi+FQIOdT3Gso0LBlHUzKkZBRcEpDy5KRbYuiO79kzl39hAdS
q4+v3P1xkRGUhUlT2VoTyr5dveOgMYi1Zp7HHgAtEkwJGufByBh6WbkxdfFyk56Hi0V0ZxjlA6Mu
iZdQOu4eSI1NBKosp1mQNmtQgyvnkmNl2uDJeHaypDERuP5I1ucJ/Ew+eX1VdEh5hmaWuZp4lHkF
MdGIy2q3OhfYQVfS/dLisQnnWuzYuoxHt9gijZ8ClvHLmkwqw3TzLr1R1avsdKlgTWoszQmGCyrE
U3mpp7ylJ0FKAFy2HD8VlGhOqGiw1kqS/5biF+fZfKeM3SEZKBEAPysvo8GJjY7OpXKVl9E4fU0f
BIz6Mx6EPvpr6V8aR+HUN3gfkk6PD1pq7SsMfLvyoVH9qE62F8Giq17GeWsCgXl+Kw94ZXHRn8/0
jx7rL6qjH7MVWOrLE4eiin1+L+GxhKnYXirFVVzshvz6eveVUojJQDcaf7rsXmhtCRz5YO6EVO3f
5gK0LPBTuXnQD8qWM9dIe5x5yyyuCaTPSCVFg+zNGV6KUm/Px4tBEXroCZzoPelKlfBE/spmOCWf
lp+WxIyP7DK5FA3Fsp2TWkAOVj5wSr6CZDWq06f2Mxo3BpeL0bT6BqxU7VqVCXwMhUdP8V7JSBjH
E8KnJbno5PwaPVV4iG6EWadC+ucGF1FzcONpNM2YaKK6ZGrf2TPdHHsYqdNq+afuT52fWDMPWyQD
eBNNPNl5luNISX/sInLdep8qVAWyC7girEC68k2brDb2kmHF4PblFvc7l7jo6n32g+kliJRS0Fou
cYoXuShXDD7B4SUo6dwUYmxIX7dpsfe4fVYc93qzcF4SriAepOaCETkYiGNylFL1dZE9yVvm/oju
6yRy6xoQ3f9eFNUOYdIQvw+U+AlS4h0v5gbiMjsWMoRPuuK/KFJSWWRWwsxTjSf8MAdFiiuPi1F7
sDP8g9M2OixW3/5uuySfIdnnoA3dfqdrI6/IWNlkwZUxm7eru6u2s9bhmdwQ2SW37hMCOXsHs9Ek
x1O1P19mlcagO1z1alX1yoinIPbsTJTJ1UKTrjeE3l1ZWZEEXgcUdw0vObX/p0G0pQCzXL5Y9NBv
pE6E3x+8aq0h1cYAA5nN41UortkhKxSgrHGtFioUoRy6TIV1h1e2+OzVWwwGt+Z5CABLfMsJaKHS
IsNTRZIO9CO/6MHkHRgnqwmnbokJ4FIEi4k+jaBOyBQfFjrT56MB+1iXCqkXsHPQ42AwEqOx9htN
rHlCjO33EXO2gjXOT3+fSn1iK3l5YgkRrv2UpsxivhteLC53ElNGneysOWVPbpjXUeFocksuaSJQ
K0CWlwws45maNJcc79QyPddDdb3R2Oh1azkeqhVWM3ye51kv1f9yl9AP784P785/xnfn5/dzcpj6
kpzhS3EydL7QTkO8JHU80KLH/nv7LzRfdKEjD/aPzt/5b1vt0/3jIzgt7baAg2Nc8taBSsVoF6ig
0ijhvnF2vHsMIzrEB4bPaHpdW1lbqTXIR8pc2xWEN7DiRlHcCiTVkNAMYS4ZQQffK8gjIG1r8gVy
PBzCGncH/OICV8FgnhqOSwGxkxF0K6cg70tB5HV6GZkSAOHTf+QdWum0amGv3aLwayrSiVR2hjT/
9HjvDBZ2SznxiwJfGJgzQg3F223JPN6dBWN9YTSMc7KbdXL8W6utKKf3TSqElYU6ModGVBJfRLGO
pjf1qtlWo1BZRNBKILfaGG3CRvBf1JSb3cKGNKQ4LlZT8NmSw7erwPEqmPuWYeomE53x3VWYdLmn
L53tY6YoSu3carW0tJUWFT6tlJdSqpZZqqZKOWzNNOj5iJ4IS0t3WzfwyYgPMg6dgmok4RLn3Adw
kIlBSpxhGCHAN4VNCIaGIy7xcWmBan6TMQX0gM2eXWqzZ/Ki3Ewv+7htyX30oj+WxWGX4KciucpI
eWdF++yNcxMzAn20jq0TIVruAwFSFTzVHTk60NFRkeIrX0eps1K3TEicmDEwTEKYyTBaYTEQnb71
Q5lwgVzqR7xXUqF/G1wYTv6jfoeyULjYFnV5wzBWwaOKVscl+cGr5ikwMul7MjILlAjwDgcqKC7t
kGkYlRX7xxSS6vHvoyUdCgngcX+kQkVVWPqLNx3M22d2ORfU9SdtsdpKNnIrtuXIxCONgMx/ylyc
NLGSUVErk0uqokQgTP1PRRw4f/9o71gs/YQy7+4L6Jafqo2bsmiH130UGTildgMtV5Gn4oyMIuEV
LK5VjpjYNLwuliyGiBcSln6sucKzdWNJjkieOTg515FjvdpbX7u4yHHkkEhN3dj173DgeNB2fTh1
/Mdqu56GrO26mPAeicxO6bzSdOfQKSupPu7dB5WcR4gfukUl9myKQiZ37USg1+UonGUUZm+9rGLQ
OaJUJk4e0sYrpeYYIO+NOq7l1WTua1UpJVJOFrbJV2q0EFYhfj6fBsjFLMZoZ0nmurnR6FS7aHhQ
X613OpuK9SKPTcebYLqxbGS8Hjoq3QTei//WasB+WbRaxg04vOmE0M7rsDMfT+lOGCYzZ7MvAvFI
FBgIPZ3LQIuzDyPU2JC/tgCEnmbpThVfMrCb0BKpCyuSdDwrhcKyCnMdyjB7FMC9xJ4+pZtJ8QUh
6dxURP+fbJ4jnoiiCu2LMW9wJwSw3mAxu/L7HZCyQFqDDSS0UZeF+bMRWQ1pZP8tdImGjITYk65j
1Qs3+gdd9MWnKgo7RCJfWGY2p97xAm6ORbgnDRwR6XiaGykssG0pNQDq9dUE6ifSlCnC/rcpIM9E
ulEyHa9u6JKj8SSz3I4sJ//H5e41Euo50FIHWC7a8ZuS3co9YE6Vu6bIvSlTc+QrzGf8vzwcqeeP
8UAHGoUZH1v4kp8+B3Za0dIP8VRYnumZ+UIF9Tar4YXnFLcyUJvXvGsPwYIeggU9BAu6M1hQb4Tv
Rz7a4PtvfD965DWS8kX6yQo7Y9n1RHVYh2tidWt0vHbCYAiFgn0eJy5Gm5cD/vXJ/rETfpPggfXL
CpvAWyvqx6u9PVFc9Wqw1OZ4tvJqG/wJ4g8Jpvx+mKiNrgud1QVu8uiN3FkgTClw+soF7tXc4HQF
6yyw5i7AkQqcJTbcJXZ3DpzgQUYFnrNEx13icNc9hF5KF+23/+oCrzVS0Dd3nOTUuL2OEr/turu0
Z1WgHUSkgFcv3ODkT8JZoOckCO/YT1rt1skbUgjDBeQCUdfwkN9w5lOwY8jdcFeBDo13TqCz/IPj
greeDfJmv1Dz0kBoPGu1tGxoyPtCbU0qHuD6RSWZ+XQ8EMoYepZYfQjm7x+dnJ8l2095sN1wZsOR
ubvf5oYnclpHzVcH2GedeK/oS/ACLg1XXo3yaheuvDrlVVdlK/dVdOhky7SjmgIaC7hyvIKnemuH
bggTOJp7LX/n4Hjn1wIcsmps+GJ3/p7Mr62y9GXnvztrHiiAhgKww38ZzvD/4YjoRQna971+TJFe
CSJDK+XYbO2jYRcV1dKdDVLqwKxEKDF/Fkw1Hnm9zoaAfKQlVl7WTk2Mn93ZhH+6PAx6a9Y7S/Jd
gZ+Fkmqs1q7EPEMfwNgfg0OBabFhX4gmqyvesz4+k8lq3ZWavUQH/2StVidmY9EeY9xYdN9nY7nO
i0bfUehJzLTiDMXyNrb0CnESZNRnzpEMsmOuSb7v0518hMt+ZEvz3uhFD2hmR9neXhxtSIIbLnmc
8E6lPMN9jIxMhzwBfcVIrTGazryY6ZUWSc+Y5PIJ2r0tms+xvFw0Ynq19fDVFusuiyjDiDnH4Za/
3t0U5Qnn39WWJ+Kf368xHLDQboqjrY5AcXJEHaHhUqoaj5xdZj3Sp/cXCd7JfrFf5o1usR/h79st
qE3wQ4mNDeJd1EY+qfR5DWWAu29qOMxn2n0K5+bTxlvrdNY2NvLf1Ujc5mVNNfuyZh2PtNN+MBJ7
AQzKYNAXP/c45ZfxJBx9Zo8yLx9ubB5ubP5/3djQScVxbWOkZ717xc88h813ol6LicxW/FutJIGp
bMOgNJUGwUU4QMZkarNE4UWtkiUVimxnPBzCjCcpFVgbTGQjuJghThGeSx0l1kZmMGLfJyUGsUwF
oJON7VbnZcjJ9oky7q8LebVEjJyaGbVqT9ruEQtwG+vBuCGCoxWksPKNzeDDL+uwqYrnQ2nFBR9a
k03VZOxAqmH0hKRoLFCpL9tCgxi7GWSVhcaULhzHogn3RxhMOOeYQrFv7g047RsWhOS2/+W2Nf1N
726V1v7R2+YBF7D2a0VIJFsQzWXdsGSU4nw9IeMq33+O/Jt6JTa3mdzI1DGl0+wZ9q29Nh/T87hr
2iRITcED5RENlozwRG/wbjTAtV6hPoKYTcJOvwcYqUN7ixGN4SyFg8Vjceec7uG3szC+wSqlzV80
i3ZNX0jPOw6JCNN/ikY5p1dqq6wNsoLPf9N+RwqpLyMRO4dIDRMnXaKmzHwC9Wa4ub66nl+gZtTW
46cpTpMgSJVSmM+LvwGvUSILi7SokIqn+D7P31TZiNBJ+cjQaSLcSzvHJ+/3j14vKeFyCKK6YM6G
WrKEFAhAxQ0QxAhVuvh2ehUMw0E4mw1uUV5DwZLt0FS7UdO0Eg6HQW169dx9aqijYlk7GPTEqyDs
XA3CKB6akqBOD311nfrGEqHsjCjrqI1pp4Xa6po5d/wRyDziZxqIl4ljmYks3+GMbRjSxptzc82l
Wq/eW1vv5Z9LErcxmWpr+R7SH05oDye0hxOadULDQCDx01mUpg9Kme4eY+epDINbF6TSJo+MCEzO
pGjJx5ToXX+WzpZUfi7G1Gt0vVr9Hpucxm55Hf6/vs8llLwbosK63mRiWhbVOvy/kdjGHOaoVKIm
xGHQ6Yd/E7+tiPb4f247n/ruigA+qkec9qHZeA6fBpOrfkfqlMc3TLWTnZ40d1qn1paZzIoyd5o7
rOBRiKJrR7kg03Em5AaJ3PMjs3Qy/7B5onM71eiB0pwTrMLG9jfSZmcYTKh14rdQZotJcInGPnOB
QmiVxoxVS2fMXvjSFz1aTUEuYYeZuoeUY4Tm65Z/vLeHmhdA0KZ8MT0/MEDevD81QDwDRFN9yESy
k0Nma1e3s34HJqiqXu0FeAHTh+0P+Ca+ukDz4qP2Zv/1m8PWIb7yt88iOqxkpEQSwsRqhyguQUaN
cT62Aaw2nWdQZj6VwKB2sb55j2tmRm0KMqv/WdwClzst34YUwWLirvgZaOz9QqpX1C1aAksIwahk
j9owb/xXO4ebjfV373wQJJIycTpcBNlurFWr/lvP3z/abb3z92H9vmkdnyBgoeoAe4OqI5kwtUyY
1Ua95u+cVKG+s1a7fX5yRiAmDBDroa+kwzpnmXmn+6/en7V8b3N1LZmJ7W38KtuAuhL7BwdxAqhP
GOD0/dFOovKzd43Nd6ofVKccvU2043AT5rm/g9mnhycJNBYNp/5vx+1fm+3j86PdBCLSoPMBaMfd
oDq06HD/9LS16++fHbzSNSUXe9pw373wkZm6Vz3nyNW9sV5fDQJY3dX6Rb3TCWwTgLSyKYte5pIB
wEatvAFrHv7xqqj+jxZnON2lRsk/hG0lObkEaWm+Jb7KL3++9UioPnt76O82z5r+bmuveX5w5u8d
NF+fFoqQ3G41d8UXBPitvX/W4s/Wu9YO+qZ8JEitH1IOm+8jSPhhAMMvhEejg4q95dEtCBkkFIr8
L0gGxv4inhl7YykqHStrFI7AoayBqRTfbe9VtXhW+J011c2trWTv/vcjSFTcKAWMifOyhjd1H3cP
cmGfAsYT5OWj/wUV7jvomfQAAA==

--Boundary-00=_huB2HmaONZjU3Vn--

From ralf@linux-mips.org Wed Mar 12 19:33:48 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 12 Mar 2008 19:33:51 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:49378 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28580132AbYCLTds (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 12 Mar 2008 19:33:48 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2CJXio1012199;
	Wed, 12 Mar 2008 19:33:44 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2CJXeCN012198;
	Wed, 12 Mar 2008 19:33:40 GMT
Date:	Wed, 12 Mar 2008 19:33:40 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Matteo Croce <technoboy85@gmail.com>
Cc:	linux-mips@linux-mips.org, Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Eugene Konev <ejka@imfi.kspu.ru>,
	Nicolas Thill <nico@openwrt.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH][MIPS][1/6]: AR7: core
Message-ID: <20080312193340.GA10965@linux-mips.org>
References: <200803120221.25044.technoboy85@gmail.com> <200803121906.25546.technoboy85@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200803121906.25546.technoboy85@gmail.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18382
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, Mar 12, 2008 at 07:06:25PM +0100, Matteo Croce wrote:

> Sorry but the linux-mips mailing list can't accept this patch for unknown reasons.
> I'll send a gz file, that will work

to the best I can say without knowing the message ID of the lost mail it
is as if the mail never reached the lmo machine.  I can say for certain
that it didn't end in the spam filter.

  Ralf

From technoboy85@gmail.com Thu Mar 13 00:32:02 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Mar 2008 00:32:04 +0000 (GMT)
Received: from smtp-out25.alice.it ([85.33.2.25]:43535 "EHLO
	smtp-out25.alice.it") by ftp.linux-mips.org with ESMTP
	id S28583128AbYCMAcC (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 13 Mar 2008 00:32:02 +0000
Received: from FBCMMO01.fbc.local ([192.168.68.195]) by smtp-out25.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 13 Mar 2008 01:31:56 +0100
Received: from FBCMCL01B07.fbc.local ([192.168.171.45]) by FBCMMO01.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 13 Mar 2008 01:31:56 +0100
Received: from raver.openwrt ([79.26.114.120]) by FBCMCL01B07.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 13 Mar 2008 01:30:27 +0100
From:	Matteo Croce <technoboy85@gmail.com>
To:	Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH][MIPS][5/6]: AR7: serial hack
Date:	Thu, 13 Mar 2008 01:31:54 +0100
User-Agent: KMail/1.9.9
Cc:	linux-mips@linux-mips.org, Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
References: <200803120221.25044.technoboy85@gmail.com> <200803120230.06420.technoboy85@gmail.com> <20080312111629.0fa15d9c@the-village.bc.nu>
In-Reply-To: <20080312111629.0fa15d9c@the-village.bc.nu>
X-Face:	0AUq?,0sKh2O65+R5#[nTCS'~}"m)9|g3Tsi=g7A9q69S+=M!BY)=?utf-8?q?Zdmwo2u!i=5CUylx=26=27D+=0A=09=5B7u=26z1=27s=7E=5B=3F+=24=27w?=
 =?utf-8?q?O6+?="'WWcr5Jy,]}8namg8NP:9<E,o^21xGB~/HRhB(u^@
 =?utf-8?q?ZB=2EXLP0swe=0A=09r9M=7EL?=<b1=^'4cv*_N1tNJ$`9Ot*KL/;8oXFdrT@r|-Ki2wCQI"R(X(
 =?utf-8?q?73r=3A=3BmnNPoA2a=5D=7EZ=0A=092n2sUh?=,B|bt;ys*hv.QR>a]{m
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200803130131.54570.technoboy85@gmail.com>
X-OriginalArrivalTime: 13 Mar 2008 00:30:27.0500 (UTC) FILETIME=[6F7B1EC0:01C884A1]
Return-Path: <technoboy85@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: 18383
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: technoboy85@gmail.com
Precedence: bulk
X-list: linux-mips

Il Wednesday 12 March 2008 12:16:29 Alan Cox ha scritto:
> On Wed, 12 Mar 2008 02:30:06 +0100
> Matteo Croce <technoboy85@gmail.com> wrote:
> 
> > Ugly but we need it
> 
> Too ugly - NAK
> 
> However please send an explanation of the problem and lets find a nicer
> way to do it or bury it in arch code.
> 
> 

This is my problem:

ffi_cmdset_000: DDisabling erae-ssuspend-progrm ddue to code bokeenness.
cmdlinparrt partition arssing not avaiabll
RedBoo ppartition parsngg not availabl
NET: Rgiistered protocl  family 1
NET: Regsteered protocol ammily 10
IPv6 overIPPv4 tunnelingdriiver
NET: Regsteered protocolfammily 17
FS:: Mounted roo (ssquashfs filessttem) readonly.
Freeing nuused kernel meorry: 120k freed

I'll try to find a nicer way to fix it

From technoboy85@gmail.com Thu Mar 13 00:34:38 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Mar 2008 00:34:41 +0000 (GMT)
Received: from smtp-out113.alice.it ([85.37.17.113]:57349 "EHLO
	smtp-out113.alice.it") by ftp.linux-mips.org with ESMTP
	id S28583159AbYCMAei (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 13 Mar 2008 00:34:38 +0000
Received: from FBCMMO02.fbc.local ([192.168.68.196]) by smtp-out113.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 13 Mar 2008 01:34:33 +0100
Received: from FBCMCL01B01.fbc.local ([192.168.69.82]) by FBCMMO02.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 13 Mar 2008 01:34:32 +0100
Received: from raver.openwrt ([79.26.114.120]) by FBCMCL01B01.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 13 Mar 2008 01:34:31 +0100
From:	Matteo Croce <technoboy85@gmail.com>
To:	linux-mips@linux-mips.org
Subject: Re: [PATCH][MIPS][6/6]: AR7 leds
Date:	Thu, 13 Mar 2008 01:34:30 +0100
User-Agent: KMail/1.9.9
Cc:	linux-net@vger.kernel.org, Eugene Konev <ejka@imfi.kspu.ru>,
	netdev@vger.kernel.org, davem@davemloft.net, kuznet@ms2.inr.ac.ru,
	pekkas@netcore.fi, jmorris@namei.org, yoshfuji@linux-ipv6.org,
	kaber@coreworks.de, Andrew Morton <akpm@linux-foundation.org>,
	Jeff Garzik <jgarzik@pobox.com>,
	Anton Vorontsov <avorontsov@ru.mvista.com>
References: <200803120221.25044.technoboy85@gmail.com> <200803120234.40306.technoboy85@gmail.com>
In-Reply-To: <200803120234.40306.technoboy85@gmail.com>
X-Face:	0AUq?,0sKh2O65+R5#[nTCS'~}"m)9|g3Tsi=g7A9q69S+=M!BY)=?utf-8?q?Zdmwo2u!i=5CUylx=26=27D+=0A=09=5B7u=26z1=27s=7E=5B=3F+=24=27w?=
 =?utf-8?q?O6+?="'WWcr5Jy,]}8namg8NP:9<E,o^21xGB~/HRhB(u^@
 =?utf-8?q?ZB=2EXLP0swe=0A=09r9M=7EL?=<b1=^'4cv*_N1tNJ$`9Ot*KL/;8oXFdrT@r|-Ki2wCQI"R(X(
 =?utf-8?q?73r=3A=3BmnNPoA2a=5D=7EZ=0A=092n2sUh?=,B|bt;ys*hv.QR>a]{m
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200803130134.31002.technoboy85@gmail.com>
X-OriginalArrivalTime: 13 Mar 2008 00:34:31.0844 (UTC) FILETIME=[011F0E40:01C884A2]
Return-Path: <technoboy85@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: 18384
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: technoboy85@gmail.com
Precedence: bulk
X-list: linux-mips

Subject really was: AR7 ethernet

From technoboy85@gmail.com Thu Mar 13 00:39:02 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Mar 2008 00:39:05 +0000 (GMT)
Received: from smtp-out25.alice.it ([85.33.2.25]:46085 "EHLO
	smtp-out25.alice.it") by ftp.linux-mips.org with ESMTP
	id S28583201AbYCMAjC (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 13 Mar 2008 00:39:02 +0000
Received: from FBCMMO02.fbc.local ([192.168.68.196]) by smtp-out25.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 13 Mar 2008 01:38:57 +0100
Received: from FBCMCL01B06.fbc.local ([192.168.69.87]) by FBCMMO02.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 13 Mar 2008 01:38:57 +0100
Received: from raver.openwrt ([79.26.114.120]) by FBCMCL01B06.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 13 Mar 2008 01:38:55 +0100
From:	Matteo Croce <technoboy85@gmail.com>
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: Re: [PATCH][MIPS][5/6]: AR7: serial hack
Date:	Thu, 13 Mar 2008 01:38:55 +0100
User-Agent: KMail/1.9.9
Cc:	linux-mips@linux-mips.org, Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
References: <200803120221.25044.technoboy85@gmail.com> <200803120230.06420.technoboy85@gmail.com> <20080312093145.GA6270@alpha.franken.de>
In-Reply-To: <20080312093145.GA6270@alpha.franken.de>
X-Face:	0AUq?,0sKh2O65+R5#[nTCS'~}"m)9|g3Tsi=g7A9q69S+=M!BY)=?utf-8?q?Zdmwo2u!i=5CUylx=26=27D+=0A=09=5B7u=26z1=27s=7E=5B=3F+=24=27w?=
 =?utf-8?q?O6+?="'WWcr5Jy,]}8namg8NP:9<E,o^21xGB~/HRhB(u^@
 =?utf-8?q?ZB=2EXLP0swe=0A=09r9M=7EL?=<b1=^'4cv*_N1tNJ$`9Ot*KL/;8oXFdrT@r|-Ki2wCQI"R(X(
 =?utf-8?q?73r=3A=3BmnNPoA2a=5D=7EZ=0A=092n2sUh?=,B|bt;ys*hv.QR>a]{m
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200803130138.55582.technoboy85@gmail.com>
X-OriginalArrivalTime: 13 Mar 2008 00:38:56.0013 (UTC) FILETIME=[9E940BD0:01C884A2]
Return-Path: <technoboy85@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: 18385
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: technoboy85@gmail.com
Precedence: bulk
X-list: linux-mips

Il Wednesday 12 March 2008 10:31:46 Thomas Bogendoerfer ha scritto:
> > diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> > index 289942f..869b6df 100644
> > --- a/include/linux/serial_core.h
> > +++ b/include/linux/serial_core.h
> > @@ -40,6 +40,7 @@
> >  #define PORT_NS16550A	14
> >  #define PORT_XSCALE	15
> >  #define PORT_RM9000	16	/* PMC-Sierra RM9xxx internal UART */
> > +#define PORT_AR7	16
> 
> this doesn't look correct.
> 
> Thomas.
> 

Isn't it 16?

From dvomlehn@cisco.com Thu Mar 13 02:31:59 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Mar 2008 02:32:02 +0000 (GMT)
Received: from sj-iport-2.cisco.com ([171.71.176.71]:50249 "EHLO
	sj-iport-2.cisco.com") by ftp.linux-mips.org with ESMTP
	id S28580631AbYCMCb7 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 13 Mar 2008 02:31:59 +0000
Received: from sj-dkim-3.cisco.com ([171.71.179.195])
  by sj-iport-2.cisco.com with ESMTP; 12 Mar 2008 19:31:51 -0700
Received: from sj-core-3.cisco.com (sj-core-3.cisco.com [171.68.223.137])
	by sj-dkim-3.cisco.com (8.12.11/8.12.11) with ESMTP id m2D2Vo3P016677
	for <linux-mips@linux-mips.org>; Wed, 12 Mar 2008 19:31:50 -0700
Received: from cliff.cisco.com (cliff.cisco.com [171.69.11.141])
	by sj-core-3.cisco.com (8.13.8/8.13.8) with ESMTP id m2D2Vo9R026416
	for <linux-mips@linux-mips.org>; Thu, 13 Mar 2008 02:31:50 GMT
Received: from [127.0.0.1] ([64.100.151.68]) by cliff.cisco.com (8.6.12/8.6.5) with ESMTP id CAA15997 for <linux-mips@linux-mips.org>; Thu, 13 Mar 2008 02:31:49 GMT
Message-ID: <47D89211.1020504@cisco.com>
Date:	Wed, 12 Mar 2008 19:31:45 -0700
From:	David VomLehn <dvomlehn@cisco.com>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: [PATCH 2.6.24][MIPS]Work in progress: fix HIGHMEM-enabled dcache
 flushing on 32-bit processor
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
DKIM-Signature:	v=1; a=rsa-sha256; q=dns/txt; l=6178; t=1205375510; x=1206239510;
	c=relaxed/simple; s=sjdkim3002;
	h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version;
	d=cisco.com; i=dvomlehn@cisco.com;
	z=From:=20David=20VomLehn=20<dvomlehn@cisco.com>
	|Subject:=20[PATCH=202.6.24][MIPS]Work=20in=20progress=3A=2
	0fix=20HIGHMEM-enabled=20dcache=0A=20flushing=20on=2032-bit=
	20processor
	|Sender:=20;
	bh=Y/n3TOKq75DuMgg4qyR/Yb1m1CXyHGNqn7R5BgDZ20c=;
	b=AQDqQajAkFd0xRKChiGcbVJBvzUwlVafAKCFJDCb1pCZ808FV0aiYaIuwl
	OadzlZSB2FZhrXznB5o9MT4HfOoczAl2o9WfoTOaOgBZAmvfTWcOm761m6JU
	1gcfiaeaOL;
Authentication-Results:	sj-dkim-3; header.From=dvomlehn@cisco.com; dkim=pass (
	sig from cisco.com/sjdkim3002 verified; ); 
Return-Path: <dvomlehn@cisco.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: 18386
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: dvomlehn@cisco.com
Precedence: bulk
X-list: linux-mips

This patch is a work in progress, per Ralf's suggestion from last week. It is 
intended to fix dcache flushing issues when using HIGHMEM support. We get much 
better results with this patch applied, but I would not characterize our 2.6.24 
port as stable, yet, so there may be other HIGHMEM-related issues.

Any comments welcome. Thanks!

David VomLehn

diff -urN a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
--- a/arch/mips/mm/cache.c	2008-01-24 14:58:37.000000000 -0800
+++ b/arch/mips/mm/cache.c	2008-03-12 19:11:39.000000000 -0700
@@ -19,6 +19,7 @@
  #include <asm/processor.h>
  #include <asm/cpu.h>
  #include <asm/cpu-features.h>
+#include <asm/highmem.h>

  /* Cache operations. */
  void (*flush_cache_all)(void);
@@ -70,10 +71,28 @@
  void __flush_dcache_page(struct page *page)
  {
  	struct address_space *mapping = page_mapping(page);
-	unsigned long addr;
+	void	* addr;

+#ifndef CONFIG_HIGHMEM
  	if (PageHighMem(page))
  		return;
+#endif
+
+	/* If there is a temporary kernel mapping, i.e. if kmap_atomic was
+	 * used to map a page, we only need to flush the page. We can skip
+	 * the other work here because it won't be used in any other way. */
+	if (PageHighMem(page)) {
+		addr = kmap_atomic_to_vaddr(page);
+		if (addr != NULL) {
+			flush_data_cache_page((unsigned long) addr);
+			return;
+		}
+	}
+
+	/* If page_mapping returned a non-NULL value, then the page is not
+	 * in the swap cache and it isn't anonymously mapped. If it's not
+	 * already mapped into user space, we can just set the dirty bit to
+	 * get the cache flushed later, if needed */
  	if (mapping && !mapping_mapped(mapping)) {
  		SetPageDcacheDirty(page);
  		return;
@@ -84,8 +103,10 @@
  	 * case is for exec env/arg pages and those are %99 certainly going to
  	 * get faulted into the tlb (and thus flushed) anyways.
  	 */
-	addr = (unsigned long) page_address(page);
-	flush_data_cache_page(addr);
+	addr = page_address(page);
+	/* If the page is not mapped for kernel access, don't flush it */
+	if (addr != NULL)
+		flush_data_cache_page((unsigned long) addr);
  }

  EXPORT_SYMBOL(__flush_dcache_page);
diff -urN a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c
--- a/arch/mips/mm/highmem.c	2008-01-24 14:58:37.000000000 -0800
+++ b/arch/mips/mm/highmem.c	2008-03-12 18:58:10.000000000 -0700
@@ -25,6 +25,25 @@
  }

  /*
+ * Describes one page->virtual association in kmap_atomic
+ */
+struct kmap_atomic_map {
+	struct list_head list;
+	struct page *page;
+};
+
+/*
+ * Array of linked lists of the mappings currently in use. The array is
+ * indexed by the CPU number, so we don't have to worry about synchronizing
+ * between the CPUs. We can add maps in interrupt handlers, however, so
+ * we will need to block interrupts when manipulating the linked list.
+ */
+static struct kmap_atomic_map_list {
+	struct list_head lh;
+	struct kmap_atomic_map map_pool[KM_TYPE_NR];
+} ____cacheline_aligned_in_smp map_list[NR_CPUS];
+
+/*
   * kmap_atomic/kunmap_atomic is significantly faster than kmap/kunmap because
   * no global lock is needed and because the kmap code must perform a global TLB
   * invalidation when the kmap pool wraps.
@@ -37,6 +56,7 @@
  {
  	enum fixed_addresses idx;
  	unsigned long vaddr;
+	unsigned long flags;

  	/* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */
  	pagefault_disable();
@@ -52,11 +72,18 @@
  	set_pte(kmap_pte-idx, mk_pte(page, kmap_prot));
  	local_flush_tlb_one((unsigned long)vaddr);

+	local_irq_save(flags);
+	map_list[smp_processor_id()].map_pool[type].page = page;
+	list_add(&(map_list[smp_processor_id()].map_pool[type]).list, 
&map_list[smp_processor_id()].lh);
+	local_irq_restore(flags);
+
  	return (void*) vaddr;
  }

  void __kunmap_atomic(void *kvaddr, enum km_type type)
  {
+	unsigned long flags;
+
  #ifdef CONFIG_DEBUG_HIGHMEM
  	unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
  	enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();
@@ -75,8 +102,14 @@
  	 */
  	pte_clear(&init_mm, vaddr, kmap_pte-idx);
  	local_flush_tlb_one(vaddr);
+
+	map_list[smp_processor_id()].map_pool[type].page = NULL;
  #endif

+	local_irq_save(flags);
+	list_del(&(map_list[smp_processor_id()].map_pool[type]).list);
+	local_irq_restore(flags);
+
  	pagefault_enable();
  }

@@ -112,6 +145,40 @@
  	return pte_page(*pte);
  }

+void *kmap_atomic_to_vaddr(struct page *page)
+{
+	unsigned long flags;
+	struct kmap_atomic_map *map;
+	unsigned long vaddr = 0;
+
+	local_irq_save(flags);
+	list_for_each_entry(map, &map_list[smp_processor_id()].lh, list) {
+		if (map->page == page) {
+			vaddr = __fix_to_virt(FIX_KMAP_BEGIN +
+				(map - map_list[smp_processor_id()].map_pool));
+			break;
+		}
+	}
+	local_irq_restore(flags);
+
+	return (void *)vaddr;		
+}
+
+void __init kmap_atomic_init(void)
+{
+	int i, j;
+
+	for (i = 0; i < NR_CPUS; i++) {
+		INIT_LIST_HEAD(&map_list[i].lh);
+#ifdef CONFIG_DEBUG_HIGHMEM
+		for (j = 0; j < KM_TYPE_NR; j++) {
+			INIT_LIST_HEAD(&(map_list[i].map_pool[j]).list);
+			map_list[i].map_pool[j].page = NULL;
+		}
+#endif
+	}
+}
+
  EXPORT_SYMBOL(__kmap);
  EXPORT_SYMBOL(__kunmap);
  EXPORT_SYMBOL(__kmap_atomic);
diff -urN a/arch/mips/mm/init.c b/arch/mips/mm/init.c
--- a/arch/mips/mm/init.c	2008-01-24 14:58:37.000000000 -0800
+++ b/arch/mips/mm/init.c	2008-03-12 19:12:51.000000000 -0700
@@ -354,6 +354,7 @@

  #ifdef CONFIG_HIGHMEM
  	kmap_init();
+	kmap_atomic_init();
  #endif
  	kmap_coherent_init();

diff -urN a/include/asm-mips/highmem.h b/include/asm-mips/highmem.h
--- a/include/asm-mips/highmem.h	2008-01-24 14:58:37.000000000 -0800
+++ b/include/asm-mips/highmem.h	2008-03-12 18:57:22.000000000 -0700
@@ -55,6 +55,9 @@
  extern void *kmap_atomic_pfn(unsigned long pfn, enum km_type type);
  extern struct page *__kmap_atomic_to_page(void *ptr);

+extern void *kmap_atomic_to_vaddr(struct page *page);
+extern void kmap_atomic_init(void);
+
  #define kmap			__kmap
  #define kunmap			__kunmap
  #define kmap_atomic		__kmap_atomic


From Tiejun.Chen@windriver.com Thu Mar 13 05:40:13 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Mar 2008 05:40:15 +0000 (GMT)
Received: from mail.windriver.com ([147.11.1.11]:30907 "EHLO mail.wrs.com")
	by ftp.linux-mips.org with ESMTP id S28581011AbYCMFkN (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Mar 2008 05:40:13 +0000
Received: from ALA-MAIL03.corp.ad.wrs.com (ala-mail03 [147.11.57.144])
	by mail.wrs.com (8.13.6/8.13.6) with ESMTP id m2D5e6QB002803
	for <linux-mips@linux-mips.org>; Wed, 12 Mar 2008 22:40:06 -0700 (PDT)
Received: from ism-mail02.corp.ad.wrs.com ([128.224.200.19]) by ALA-MAIL03.corp.ad.wrs.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 12 Mar 2008 22:40:05 -0700
Received: from [128.224.162.181] ([128.224.162.181]) by ism-mail02.corp.ad.wrs.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 13 Mar 2008 06:40:02 +0100
Message-ID: <47D8BDDC.9010607@windriver.com>
Date:	Thu, 13 Mar 2008 13:38:36 +0800
From:	"tiejun.chen" <tiejun.chen@windriver.com>
User-Agent: Thunderbird 2.0.0.12 (X11/20080227)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: [PATCH] MT-VPE : Fix the usage of kmalloc
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 13 Mar 2008 05:40:03.0147 (UTC) FILETIME=[AF6DE9B0:01C884CC]
Return-Path: <Tiejun.Chen@windriver.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: 18387
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: tiejun.chen@windriver.com
Precedence: bulk
X-list: linux-mips

The return value of kmalloc() should be check, otherwise it is potential
risk.

Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
---
 vpe.c |    4 ++++
 1 file changed, 4 insertions(+)


diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index c06eb81..35767de 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -885,6 +885,10 @@ static int vpe_elfload(struct vpe * v)
        }
 
        v->load_addr = alloc_progmem(mod.core_size);
+#ifndef CONFIG_MIPS_VPE_LOADER_TOM
+       if (!(v->load_addr))
+               return -ENOMEM;
+#endif
        memset(v->load_addr, 0, mod.core_size);
 
        printk("VPE loader: loading to %p\n", v->load_addr);

From tsbogend@alpha.franken.de Thu Mar 13 09:04:55 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Mar 2008 09:04:57 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:62950 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28581691AbYCMJEz (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Mar 2008 09:04:55 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JZjMs-000321-00; Thu, 13 Mar 2008 10:04:54 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id E0416DE5B3; Thu, 13 Mar 2008 09:45:26 +0100 (CET)
Date:	Thu, 13 Mar 2008 09:45:26 +0100
To:	Matteo Croce <technoboy85@gmail.com>
Cc:	linux-mips@linux-mips.org, Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH][MIPS][5/6]: AR7: serial hack
Message-ID: <20080313084526.GA6012@alpha.franken.de>
References: <200803120221.25044.technoboy85@gmail.com> <200803120230.06420.technoboy85@gmail.com> <20080312093145.GA6270@alpha.franken.de> <200803130138.55582.technoboy85@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200803130138.55582.technoboy85@gmail.com>
User-Agent: Mutt/1.5.13 (2006-08-11)
From:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Return-Path: <tsbogend@alpha.franken.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: 18388
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips

On Thu, Mar 13, 2008 at 01:38:55AM +0100, Matteo Croce wrote:
> Il Wednesday 12 March 2008 10:31:46 Thomas Bogendoerfer ha scritto:
> > > diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> > > index 289942f..869b6df 100644
> > > --- a/include/linux/serial_core.h
> > > +++ b/include/linux/serial_core.h
> > > @@ -40,6 +40,7 @@
> > >  #define PORT_NS16550A	14
> > >  #define PORT_XSCALE	15
> > >  #define PORT_RM9000	16	/* PMC-Sierra RM9xxx internal UART */
> > > +#define PORT_AR7	16
> > 
> > this doesn't look correct.
> > 
> > Thomas.
> > 
> 
> Isn't it 16?

PORT_RM9000 is 16, how could PORT_AR7 be 16 as well ? And the 16 for 
PORT_RM9000 is correct in my counting.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

From tsbogend@alpha.franken.de Thu Mar 13 09:05:18 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Mar 2008 09:05:22 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:64486 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28581690AbYCMJEz (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Mar 2008 09:04:55 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JZjMs-000321-01; Thu, 13 Mar 2008 10:04:54 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id 8CFF7DE5B3; Thu, 13 Mar 2008 10:01:09 +0100 (CET)
Date:	Thu, 13 Mar 2008 10:01:09 +0100
To:	Matteo Croce <technoboy85@gmail.com>
Cc:	Alan Cox <alan@lxorguk.ukuu.org.uk>, linux-mips@linux-mips.org,
	Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH][MIPS][5/6]: AR7: serial hack
Message-ID: <20080313090109.GB6012@alpha.franken.de>
References: <200803120221.25044.technoboy85@gmail.com> <200803120230.06420.technoboy85@gmail.com> <20080312111629.0fa15d9c@the-village.bc.nu> <200803130131.54570.technoboy85@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200803130131.54570.technoboy85@gmail.com>
User-Agent: Mutt/1.5.13 (2006-08-11)
From:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Return-Path: <tsbogend@alpha.franken.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: 18389
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips

On Thu, Mar 13, 2008 at 01:31:54AM +0100, Matteo Croce wrote:
> Il Wednesday 12 March 2008 12:16:29 Alan Cox ha scritto:
> > On Wed, 12 Mar 2008 02:30:06 +0100
> > Matteo Croce <technoboy85@gmail.com> wrote:
> > 
> > > Ugly but we need it
> > 
> > Too ugly - NAK
> > 
> > However please send an explanation of the problem and lets find a nicer
> > way to do it or bury it in arch code.
> > 
> > 
> 
> This is my problem:
> 
> ffi_cmdset_000: DDisabling erae-ssuspend-progrm ddue to code bokeenness.
> cmdlinparrt partition arssing not avaiabll
> RedBoo ppartition parsngg not availabl
> NET: Rgiistered protocl  family 1
> NET: Regsteered protocol ammily 10
> IPv6 overIPPv4 tunnelingdriiver
> NET: Regsteered protocolfammily 17
> FS:: Mounted roo (ssquashfs filessttem) readonly.
> Freeing nuused kernel meorry: 120k freed
> 
> I'll try to find a nicer way to fix it

don't use AFE mode and treat it like a normal 16550 (PORT_16550A). You
could also try to use UPIO_MEM32. That's how my console driver
(different OS) works for AR7 without the hack to wait for LSR_TEMP and 
LSR_THRE.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

From opencode@gmx.net Thu Mar 13 10:11:23 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Mar 2008 10:11:26 +0000 (GMT)
Received: from mail.gmx.net ([213.165.64.20]:43737 "HELO mail.gmx.net")
	by ftp.linux-mips.org with SMTP id S28582110AbYCMKLX (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Mar 2008 10:11:23 +0000
Received: (qmail invoked by alias); 13 Mar 2008 10:11:18 -0000
Received: from dslb-088-072-160-137.pools.arcor-ip.net (EHLO [192.168.1.100]) [88.72.160.137]
  by mail.gmx.net (mp031) with SMTP; 13 Mar 2008 11:11:18 +0100
X-Authenticated: #44099387
X-Provags-ID: V01U2FsdGVkX196R68d3fx6t1RXnlzPgA5daTNxwA4CTn0I3TElMe
	a5lwc0xVN3cImX
Message-ID: <47D8FDC5.6030601@gmx.net>
Date:	Thu, 13 Mar 2008 11:11:17 +0100
From:	Andi <opencode@gmx.net>
User-Agent: Thunderbird 2.0.0.12 (X11/20080227)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: Re: Problems booting Linux kernel on Sigma SMP8634 #2
References: <47CE9388.9050808@gmx.net> <47CED252.20800@avtrex.com> <47CEE58C.7020507@gmx.net>
In-Reply-To: <47CEE58C.7020507@gmx.net>
X-Enigmail-Version: 0.95.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
Return-Path: <opencode@gmx.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: 18390
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: opencode@gmx.net
Precedence: bulk
X-list: linux-mips

Hi,

in reply to myself, just in case its useful for somebody else ..
There seems to be a memory limitation for Linux running on the SMP8634!
While giving Linux access to not more than half of the total RAM minus
some (4?) MB the kernel works pretty well!

And even more interesting: one can download the smp8634 kernel sources
for Sony devices on their support pages.

Cheers,
	Andi



Andi wrote:
> Hi,
> 
>> I build and successfully run kernels on the 8634 every day, so I don't
>> think it is a problem with the 8634 port in general.
>>
>> You should probably ask for technical support from whomever supplied
>> your hardware.  They would know the technical details about how to
>> configure the memory controller, the amount and location of the RAM on
>> the board, etc.
> 
> Thats right. And I would really like to do so. But unfortunately there
> is not much information around about the hardware. Since the box
> originally runs a wince system, this project is more like a _free time_
> projects of some Linux enthusiasts.
> 
> You can get a overview about this here: http://www.t-hack.com/wiki/
> There is also a forum, but unfortunately most posts are in German ..
> 
>>> I am sure there some more guys around using the smp8634.
>> Likely there are.  It is used in many blu-ray disk players, among other
>> things.
> 
> Ok, there is not much information about the smp8634 out there, which is
> really a pity. I know that Sigma is not really interested in publishing
> there specifications. Even the gpl part is not published, but I am sure
> you already know this :-)
> 
> Do you know how to get some more detailed information about the smp8634?
> 
> Ok, there are some parts that are not equal, like memory and flash! But
> this is a SoC, so most parts are the same.
> 
> 
>> N/A, the kernel does not rely on any microcode.
> 
> Ok, thanks, so we can cancel this on our todo-list ..
> 
> 
> 
> Regards,
> 	Andi
> 
> 
> 
> 


From ralf@linux-mips.org Thu Mar 13 13:56:18 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Mar 2008 13:56:21 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:18571 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28582490AbYCMN4S (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 13 Mar 2008 13:56:18 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2DDuIax002141
	for <linux-mips@linux-mips.org>; Thu, 13 Mar 2008 13:56:18 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2DDuI0S002140
	for linux-mips@linux-mips.org; Thu, 13 Mar 2008 13:56:18 GMT
Date:	Thu, 13 Mar 2008 13:56:18 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	linux-mips@linux-mips.org
Subject: Alchemy power managment code.
Message-ID: <20080313135618.GA31211@linux-mips.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18391
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

The Alchemy code in arch/mips/au1000/common/power.c is one of the last
remaining users of pm_send_all() which happens to be a nop call because
nothing registers callbacks with pm_register.  So the pm_send_all() calls
can be removed.

Which leaves pm_do_suspend with no sensible code, so it can be removed.
And ripped like this pm_do_sleep looks it it may well no longer be
functioning.

So, anybody still using that stuff, does it provide any useful
functionality?  Does the CPU frequency stuff actually work?

  Ralf

PS: You should hear the engine of my chainsaw warming up ...

From ralf@linux-mips.org Thu Mar 13 15:15:15 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Mar 2008 15:15:17 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:47797 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28583623AbYCMPPP (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 13 Mar 2008 15:15:15 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2DFFEII021367;
	Thu, 13 Mar 2008 15:15:14 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2DFFDG4021366;
	Thu, 13 Mar 2008 15:15:13 GMT
Date:	Thu, 13 Mar 2008 15:15:13 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	"tiejun.chen" <tiejun.chen@windriver.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] MT-VPE : Fix the usage of kmalloc
Message-ID: <20080313151513.GA4368@linux-mips.org>
References: <47D8BDDC.9010607@windriver.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <47D8BDDC.9010607@windriver.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18392
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, Mar 13, 2008 at 01:38:36PM +0800, tiejun.chen wrote:

> The return value of kmalloc() should be check, otherwise it is potential
> risk.
> 
> Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
> ---
>  vpe.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> 
> diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
> index c06eb81..35767de 100644
> --- a/arch/mips/kernel/vpe.c
> +++ b/arch/mips/kernel/vpe.c
> @@ -885,6 +885,10 @@ static int vpe_elfload(struct vpe * v)
>         }
>  
>         v->load_addr = alloc_progmem(mod.core_size);
> +#ifndef CONFIG_MIPS_VPE_LOADER_TOM
> +       if (!(v->load_addr))
> +               return -ENOMEM;
> +#endif

Your mailer converted the tabs into whitespace so the patch doesn't apply.

Anyway, I fixed things in a slightly different way which hopefully
avoids throwing in more #ifdefs and will safe a little code for the
!CONFIG_MIPS_VPE_LOADER_TOM case.

Thanks,

  Ralf

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index eed2dc4..39804c5 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -262,13 +262,21 @@ void dump_mtregs(void)
 /* Find some VPE program space  */
 static void *alloc_progmem(unsigned long len)
 {
+	void *addr;
+
 #ifdef CONFIG_MIPS_VPE_LOADER_TOM
-	/* this means you must tell linux to use less memory than you physically have */
-	return pfn_to_kaddr(max_pfn);
+	/*
+	 * This means you must tell Linux to use less memory than you
+	 * physically have, for example by passing a mem= boot argument.
+	 */
+	addr = pfn_to_kaddr(max_pfn);
+	memset(addr, 0, len);
 #else
-	// simple grab some mem for now
-	return kmalloc(len, GFP_KERNEL);
+	/* simple grab some mem for now */
+	addr = kzalloc(len, GFP_KERNEL);
 #endif
+
+	return addr;
 }
 
 static void release_progmem(void *ptr)
@@ -884,9 +892,10 @@ static int vpe_elfload(struct vpe * v)
 	}
 
 	v->load_addr = alloc_progmem(mod.core_size);
-	memset(v->load_addr, 0, mod.core_size);
+	if (!v->load_addr)
+		return -ENOMEM;
 
-	printk("VPE loader: loading to %p\n", v->load_addr);
+	pr_info("VPE loader: loading to %p\n", v->load_addr);
 
 	if (relocate) {
 		for (i = 0; i < hdr->e_shnum; i++) {

From ncoesel@DEALogic.nl Thu Mar 13 16:17:04 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Mar 2008 16:17:06 +0000 (GMT)
Received: from smtp-vbr11.xs4all.nl ([194.109.24.31]:10767 "EHLO
	smtp-vbr11.xs4all.nl") by ftp.linux-mips.org with ESMTP
	id S28582958AbYCMQRE convert rfc822-to-8bit (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Mar 2008 16:17:04 +0000
Received: from dealogic.nl (a62-251-87-113.adsl.xs4all.nl [62.251.87.113])
	by smtp-vbr11.xs4all.nl (8.13.8/8.13.8) with ESMTP id m2DGH4Qd094869
	for <linux-mips@linux-mips.org>; Thu, 13 Mar 2008 17:17:04 +0100 (CET)
	(envelope-from ncoesel@DEALogic.nl)
Content-class: urn:content-classes:message
Subject: FW: Alchemy power managment code.
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 8BIT
X-MimeOLE: Produced By Microsoft Exchange V6.5
Date:	Thu, 13 Mar 2008 17:16:37 +0100
Message-ID: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF804@dealogicserver.DEALogic.nl>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Alchemy power managment code.
thread-index: AciFEhe6VQdP6xzqSLqyFGOAP4S1YAAAHiBwAATATJA=
From:	"Nico Coesel" <ncoesel@DEALogic.nl>
To:	<linux-mips@linux-mips.org>
X-Virus-Scanned: by XS4ALL Virus Scanner
Return-Path: <ncoesel@DEALogic.nl>
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: 18393
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: ncoesel@DEALogic.nl
Precedence: bulk
X-list: linux-mips

Ralf,
Funny you ask because I tried this yesterday on a AU1100 system with the
2.6.24 kernel (from kernel.org). I'm afraid I must say the kernel
crashes when I enable power management. The reason I want to use power
management is because I need to send the CPU to sleep when the system
shuts down. I hacked power.c and reset.c a bit so au_sleep() is called
when the system is shut down. Perhaps someone can confirm the
powermanagement can be made to work with some fixes (it didn't work with
2.6.21-rc4 either).

The CPU frequency switching stuff isn't very usefull since it is
possible to derive various pheripheral frequencies from it. For
instance, on our board the LCD frequency is derived from the CPU
frequency. The auxilary frequency cannot by divided to provide the
refreshrate we need. So changing the CPU frequency would 'break' our LCD
display.

Nico Coesel 

> -----Oorspronkelijk bericht-----
> Van: linux-mips-bounce@linux-mips.org 
> [mailto:linux-mips-bounce@linux-mips.org] Namens Ralf Baechle
> Verzonden: donderdag 13 maart 2008 14:56
> Aan: linux-mips@linux-mips.org
> Onderwerp: Alchemy power managment code.
> 
> The Alchemy code in arch/mips/au1000/common/power.c is one of the last

> remaining users of pm_send_all() which happens to be a nop call 
> because nothing registers callbacks with pm_register.  So the 
> pm_send_all() calls can be removed.
> 
> Which leaves pm_do_suspend with no sensible code, so it can be 
> removed.
> And ripped like this pm_do_sleep looks it it may well no longer be 
> functioning.
> 
> So, anybody still using that stuff, does it provide any useful 
> functionality?  Does the CPU frequency stuff actually work?
> 
>   Ralf
> 
> PS: You should hear the engine of my chainsaw warming up ...
> 
> 

From sshtylyov@ru.mvista.com Thu Mar 13 16:43:53 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Mar 2008 16:43:55 +0000 (GMT)
Received: from h155.mvista.com ([63.81.120.155]:27268 "EHLO imap.sh.mvista.com")
	by ftp.linux-mips.org with ESMTP id S28583266AbYCMQnx (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Mar 2008 16:43:53 +0000
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id 02D553EC9; Thu, 13 Mar 2008 09:43:50 -0700 (PDT)
Message-ID: <47D95A16.7090708@ru.mvista.com>
Date:	Thu, 13 Mar 2008 19:45:10 +0300
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
X-Accept-Language: ru, en-us, en-gb
MIME-Version: 1.0
To:	Nico Coesel <ncoesel@DEALogic.nl>
Cc:	linux-mips@linux-mips.org
Subject: Re: FW: Alchemy power managment code.
References: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF804@dealogicserver.DEALogic.nl>
In-Reply-To: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF804@dealogicserver.DEALogic.nl>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@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: 18394
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips

Hello.

Nico Coesel wrote:

> Ralf,
> Funny you ask because I tried this yesterday on a AU1100 system with the
> 2.6.24 kernel (from kernel.org). I'm afraid I must say the kernel
> crashes when I enable power management. The reason I want to use power
> management is because I need to send the CPU to sleep when the system
> shuts down. I hacked power.c and reset.c a bit so au_sleep() is called
> when the system is shut down. Perhaps someone can confirm the
> powermanagement can be made to work with some fixes (it didn't work with
> 2.6.21-rc4 either).

    BTW, if you look at sleeper.S you'll find that save_and_sleep() trashes 
registers $1 and $2 because of reusing their stackframe slots to save Status 
and Context CP0 registers:

         sw      $1, PT_R1(sp)
         sw      $2, PT_R2(sp)

         mfc0    k0, CP0_STATUS
         sw      k0, 0x20(sp)		# equals PT_R2
         mfc0    k0, CP0_CONTEXT
         sw      k0, 0x1c(sp)		# equals PT_R1

> Nico Coesel 

WBR, Sergei

From technoboy85@gmail.com Fri Mar 14 15:46:22 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 14 Mar 2008 15:46:25 +0000 (GMT)
Received: from smtp-out114.alice.it ([85.37.17.114]:54282 "EHLO
	smtp-out114.alice.it") by ftp.linux-mips.org with ESMTP
	id S28590671AbYCNPqW (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 14 Mar 2008 15:46:22 +0000
Received: from FBCMMO03.fbc.local ([192.168.68.197]) by smtp-out114.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Fri, 14 Mar 2008 16:46:14 +0100
Received: from FBCMCL01B02.fbc.local ([192.168.69.83]) by FBCMMO03.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Fri, 14 Mar 2008 16:46:13 +0100
Received: from raver.openwrt ([79.26.114.120]) by FBCMCL01B02.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Fri, 14 Mar 2008 16:46:13 +0100
From:	Matteo Croce <technoboy85@gmail.com>
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: Re: [PATCH][MIPS][5/6]: AR7: serial hack
Date:	Fri, 14 Mar 2008 16:46:09 +0100
User-Agent: KMail/1.9.9
Cc:	linux-mips@linux-mips.org, Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
References: <200803120221.25044.technoboy85@gmail.com> <200803130138.55582.technoboy85@gmail.com> <20080313084526.GA6012@alpha.franken.de>
In-Reply-To: <20080313084526.GA6012@alpha.franken.de>
X-Face:	0AUq?,0sKh2O65+R5#[nTCS'~}"m)9|g3Tsi=g7A9q69S+=M!BY)=?utf-8?q?Zdmwo2u!i=5CUylx=26=27D+=0A=09=5B7u=26z1=27s=7E=5B=3F+=24=27w?=
 =?utf-8?q?O6+?="'WWcr5Jy,]}8namg8NP:9<E,o^21xGB~/HRhB(u^@
 =?utf-8?q?ZB=2EXLP0swe=0A=09r9M=7EL?=<b1=^'4cv*_N1tNJ$`9Ot*KL/;8oXFdrT@r|-Ki2wCQI"R(X(
 =?utf-8?q?73r=3A=3BmnNPoA2a=5D=7EZ=0A=092n2sUh?=,B|bt;ys*hv.QR>a]{m
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200803141646.09645.technoboy85@gmail.com>
X-OriginalArrivalTime: 14 Mar 2008 15:46:13.0660 (UTC) FILETIME=[885B85C0:01C885EA]
Return-Path: <technoboy85@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: 18395
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: technoboy85@gmail.com
Precedence: bulk
X-list: linux-mips

Il Thursday 13 March 2008 09:45:26 Thomas Bogendoerfer ha scritto:
> On Thu, Mar 13, 2008 at 01:38:55AM +0100, Matteo Croce wrote:
> > Il Wednesday 12 March 2008 10:31:46 Thomas Bogendoerfer ha scritto:
> > > > diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> > > > index 289942f..869b6df 100644
> > > > --- a/include/linux/serial_core.h
> > > > +++ b/include/linux/serial_core.h
> > > > @@ -40,6 +40,7 @@
> > > >  #define PORT_NS16550A	14
> > > >  #define PORT_XSCALE	15
> > > >  #define PORT_RM9000	16	/* PMC-Sierra RM9xxx internal UART */
> > > > +#define PORT_AR7	16
> > > 
> > > this doesn't look correct.
> > > 
> > > Thomas.
> > > 
> > 
> > Isn't it 16?
> 
> PORT_RM9000 is 16, how could PORT_AR7 be 16 as well ? And the 16 for 
> PORT_RM9000 is correct in my counting.
> 
> Thomas.
> 

This is a bit better

diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 77f7a7f..a3a271d 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -267,6 +267,13 @@ static const struct serial8250_config uart_config[] = {
 		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
 		.flags		= UART_CAP_FIFO,
 	},
+	[PORT_AR7] = {
+		.name		= "TI-AR7",
+		.fifo_size	= 16,
+		.tx_loadsz	= 16,
+		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00,
+		.flags		= UART_CAP_FIFO | UART_CAP_AFE,
+	},
 };
 
 #if defined (CONFIG_SERIAL_8250_AU1X00)
@@ -2455,7 +2462,11 @@ static void serial8250_console_putchar(struct uart_port *port, int ch)
 {
 	struct uart_8250_port *up = (struct uart_8250_port *)port;
 
+#ifdef CONFIG_AR7
+	wait_for_xmitr(up, BOTH_EMPTY);
+#else
 	wait_for_xmitr(up, UART_LSR_THRE);
+#endif
 	serial_out(up, UART_TX, ch);
 }
 
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 289942f..15e76c8 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -40,7 +40,8 @@
 #define PORT_NS16550A	14
 #define PORT_XSCALE	15
 #define PORT_RM9000	16	/* PMC-Sierra RM9xxx internal UART */
-#define PORT_MAX_8250	16	/* max port ID */
+#define PORT_AR7	17
+#define PORT_MAX_8250	17	/* max port ID */
 
 /*
  * ARM specific type numbers.  These are not currently guaranteed


From hjl.tools@gmail.com Fri Mar 14 19:21:01 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 14 Mar 2008 19:21:04 +0000 (GMT)
Received: from ag-out-0708.google.com ([72.14.246.250]:1624 "EHLO
	ag-out-0708.google.com") by ftp.linux-mips.org with ESMTP
	id S28591717AbYCNTVB (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 14 Mar 2008 19:21:01 +0000
Received: by ag-out-0708.google.com with SMTP id 5so6247223agb.7
        for <linux-mips@linux-mips.org>; Fri, 14 Mar 2008 12:20:57 -0700 (PDT)
DKIM-Signature:	v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:received:date:to:subject:message-id:mime-version:content-type:content-disposition:user-agent:from;
        bh=QIh5QUKY0eoQxJhZHiuA5HNKuenYLEGqieJDmRFmdVA=;
        b=mKOUDVhqIag0aBo9NEuhvggSaxlhpHJoR2LbDg9JU7Ga399umd4Lf9LD+2agvxwHfbdyKQHiYPbvEIum9P45TIRcailrp5FXU4hP8aeoQhmehCyY1a6m+r9V5RghJaSOhcs4GA6JxctEQpzCKzqmIiCTYDW11ZnxwnMnrieV5Is=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=date:to:subject:message-id:mime-version:content-type:content-disposition:user-agent:from;
        b=amUUOEhTwJJLX+OzJ64c1MhTELI82VyvDOqU3XcdUJ1Bhah1q0mj7NJstfaz+Uq+Fi7WzCweUD7tNe0/jbmNNiZVOtiVI+pg+BloSrN1ogX0LF+fLIbtJFwYujFUiXfLeOUrE4AB+wKyjI/Mwx+Me535vd5N/LCDn048lL0RDnU=
Received: by 10.100.214.15 with SMTP id m15mr23746469ang.30.1205522456823;
        Fri, 14 Mar 2008 12:20:56 -0700 (PDT)
Received: from lucon.org ( [75.61.137.74])
        by mx.google.com with ESMTPS id d36sm284565and.37.2008.03.14.12.20.46
        (version=TLSv1/SSLv3 cipher=OTHER);
        Fri, 14 Mar 2008 12:20:48 -0700 (PDT)
Received: by lucon.org (Postfix, from userid 500)
	id 382899801BE; Fri, 14 Mar 2008 12:20:44 -0700 (PDT)
Date:	Fri, 14 Mar 2008 12:20:44 -0700
To:	linux-gcc@vger.kernel.org, gcc@gcc.gnu.org,
	GNU C Library <libc-alpha@sourceware.org>,
	Mat Hostetter <mat@lcs.mit.edu>, Warner Losh <imp@village.org>,
	linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>,
	linux-vax@pergamentum.com
Subject: The Linux binutils 2.18.50.0.5 is released
Message-ID: <20080314192044.GA28139@lucon.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.17 (2007-11-01)
From:	"H.J. Lu" <hjl.tools@gmail.com>
Return-Path: <hjl.tools@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: 18396
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.tools@gmail.com
Precedence: bulk
X-list: linux-mips

This is the beta release of binutils 2.18.50.0.5 for Linux, which is
based on binutils 2008 0314 in CVS on sourceware.org plus various
changes. It is purely for Linux.

All relevant patches in patches have been applied to the source tree.
You can take a look at patches/README to see what have been applied and
in what order they have been applied.

Starting from the 2.18.50.0.4 release, the x86 assembler no longer
accepts

	fnstsw %eax

fnstsw stores 16bit into %ax and the upper 16bit of %eax is unchanged.
Please use

	fnstsw %ax

Starting from the 2.17.50.0.4 release, the default output section LMA
(load memory address) has changed for allocatable sections from being
equal to VMA (virtual memory address), to keeping the difference between
LMA and VMA the same as the previous output section in the same region.

For

.data.init_task : { *(.data.init_task) }

LMA of .data.init_task section is equal to its VMA with the old linker.
With the new linker, it depends on the previous output section. You
can use

.data.init_task : AT (ADDR(.data.init_task)) { *(.data.init_task) }

to ensure that LMA of .data.init_task section is always equal to its
VMA. The linker script in the older 2.6 x86-64 kernel depends on the
old behavior.  You can add AT (ADDR(section)) to force LMA of
.data.init_task section equal to its VMA. It will work with both old
and new linkers. The x86-64 kernel linker script in kernel 2.6.13 and
above is OK.

The new x86_64 assembler no longer accepts

	monitor %eax,%ecx,%edx

You should use

	monitor %rax,%ecx,%edx

or
	monitor

which works with both old and new x86_64 assemblers. They should
generate the same opcode.

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.18.50.0.5 to
hjl.tools@gmail.com

and

http://www.sourceware.org/bugzilla/

Changes from binutils 2.18.50.0.4:

1. Update from binutils 2008 0314.
2. Add Intel XSAVE new instruction support.
3. Fix an ia64 linker crash on unsupported TLS relocations.  PR 5913.
4. Fix x86 assembler for gcc 4.3.
5. Fix a linker memory corruption.  PR 5788.
6. Correct linker 64k section support.  PR 5900.
7. Correct hidden, weak and undefined symbol handling. PR 5789.
8. Fix linker for 64bit targets on 32bit hosts.  PR 5303/5755.
9. Fix assembler crash with .set on register.  PR 5543.
10. Fix a typo in linker.  PR 5765.
11. Fix "string -O" infinite loop.  PR 5713.
12. Fix .exitm in assembler.  PR 5895.
13. Fix a linker crash.  PR 5761.
14. Fix various arm bugs.
15. Fix various bfin bugs.
16. Fix various h8 bugs.
17. Fix various ppc bugs.
18. Fix various spu bugs.
19. Fix various xtensa bugs.

Changes from binutils 2.18.50.0.3:

1. Update from binutils 2008 0208.
2. Update readelf/objdump to dump DWARF frame info with machine
register names on x86.
3. Optimize x86-64 assembler to omit REX.W prefix when it is ignored.
4. Add operand size check to x86 assembler.  PR 5534.
5. Add -march=CPU[,+EXTENSION...], -mmnemonic, -msyntax, -mindex-reg,
-mnaked-reg and -mold-gcc options to x86 assembler.
6. Add -Mintel-mnemonic/-Mintel-mnemonic options to x86 disassembler.
7. Update x86 disassembler to handle r12 like rsp in memory operand.
8. Update x86 disassembler to properly support movntq, movntsd,
movntss, movntps, movntpd, movntdq and movntdqa.
9. Update x86 disassembler to support AMD nops.
10. Update x86 disassembler for cvtsi2ss/cvtsi2sd.
11. Fix x86 assembler to support new instructions on 2 different archs.
12. Update linker not to generate incorrect debug info for 64bit target
on 32bit host.  PR 5303.
13. Update ia64 assembler to support new registers in Itanium 9100
series.
14. Fix strip on PT_NOTE segment.  PR 5488.
15. Fix strip/objcopy on HPUX/ia64.  PR 5449.
16. Fix strip/objcopy for EFI.  PR 5307.
17. Remove duplicated sections from objdump for COFF/PE.  PR 5299.
18. Fix a linker corruption.  PR 5522.
19. Fix mingw for 64bit targets.
20. Fix various arm bugs.
21. Fix various fr30 bugs.
22. Fix various frv bugs.
23. Fix various hppa bugs.
24. Fix various m10300 bugs.
25. Fix various m32r bugs.
26. Fix various m68k bugs.
27. Fix various mips bugs.
28. Fix various ppc bugs.
29. Fix various spu bugs.
30. Fix various xtensa bugs.

Changes from binutils 2.18.50.0.2:

1. Update from binutils 2007 1102.
2. Support link in Linux object files on FreeBSD.  PR 4424.
3. Add Intel SMX instruction support to x86 assembler/diasassembler.
4. Fix an objcopy regression where we failed to adjust section
flags.  PR 5233.
5. Improve irregular instruction support in x86 assembler.
6. Improve support for instructions with restricted operands in x86
diasassembler.
7. Fix an x86-64 assembler bug where extra REX byte generated in Intel
mode.  PR 5109.
8. Update .pushsection directive support in assembler.  PRs 5221.
9. Improve linker -z relro support.
10. Add support for generating wide character strings in assembler.
11. Improve relocation process for DWARF debug info in readelf.
12. Add a linker warning for invalid merge section with unterminated
strings.
13. Improve linker support of DWARF debug info for discarded sections
during linker-relaxation.
14. Improve fabs detection.  PR 5147.
15. Improve non-bash support.  PR 5215.
16. Improve support for non-gcc compiler.  PRs 5146/5160.
17. Improve error messages.  PRs 5172/5173/5161/5158/5155/
5121-5126/5129/5131-5137/5143/5142/5078/5089/5090.
18. Fix various cr16 bugs.
19. Fix various m10300 bugs.
20. Fix various mips bugs.
21. Fix various ppc bugs.
22. Fix various xtensa bugs.

Changes from binutils 2.18.50.0.1:

1. Update from binutils 2007 1001.
2. Speed up hash table lookup in linker. 
3. Add -c/--archive-index option to readelf.
4. Fix an readelf crash. PR 5011.
5. Fix an x86 assembler Intel mode bug. PR 5080.
6. Add EIP support in x86 assembler.
7. Add fake index registers, EIZ/RIZ, to x86 assembler/disassembler.
8. Improve x86 assembler error message for truncated values. PR 5026.
9. Remove a COFF assertion in COFF assembler. PR 5035.
10. Add AMD SSE5 support to x86 assembler/disassembler.
11. Fix x86 assembler for extrq/insertq in Intel mode.
12. Fix x86 disassembler for invalid opcodes in 64bit. PR 5072.
13. Fix auto-import in PE-COFF linker.  PR 4844.
14. Correct -z now in ELF linker.
15. Fix a --build-id linker crash.  PR 5025.
16. Improved x86 assembler/disassembler infrastructure for new
instruction support.
17. Fix various m68k bugs.
18. Fix various ppc bugs.
19. Fix various spu bugs.

Changes from binutils 2.17.50.0.18:

1. Update from binutils 2007 0908.
2. Fix an ELF linker for SHT_NOBITS sections.  PR 2864/5006.
3. Improve TLS transition check in i386 and x86-64 linkers.
4. Fix a GD->LE/LD->LE TLS transition bug in i386 and x86-64 linkers.
PR 4918.
5. Update ELF linker to dump segment map when a section can't be allocated
in segment. PR 4909.
6. Clean up x86 disassembler to remove fixups and make it more
table driven.
7. Fix x86 disassember for SSE instructions in Intel mode. PR 4834.
8. Properly handle bss segments in ELF linker.
9. Add --string-dump to readelf.
10. Fix objcopy -R .debug_* --only-keep-debug regression. PR 4888.
11. Change x86 assembler to follow SVME specification.
12. Fix x86 assembler for cmpxchg8b, pextrb and pinsrb in Intel mode.
13. Update x86 assembler to better handle expressions with @GOT suffix.
PR 4079.
14. Properly handle section alignment >= 128 byte for PECOFF.
15. Fix an ELF linker --build-id option crash.  PR 4923.
16. Fix binutils build on HP-UX. PR 4875.
17. Fix a regression of the a.out linker -N option. PR 4515.
18. Update x86 disassembler for invlpg, fxsave, fxrstor, ldmxcsr and
stmxcsr in Intel mode.
19. Fix x86 assembler for SSE4 instructions in Intel mode.
20. Fix various arm bugs.
21. Fix various mips bugs.
22. Fix various ppc bugs.
23. Fix various spu bugs.
24. Fix various xtensa bugs.

Changes from binutils 2.17.50.0.17:

1. Update from binutils 2007 0731.
2. Switching from GPLv2 to GPLv3.
3. Add a new ELF linker option, --build-id, to generate a unique
per-binary identifier embedded in a note section.
4. Remove COFF/x86-64 from PE-COFF/x86-64.
5. Fix a "nm -l" crash on DWARF info. PR 4797.
6. Match symbol type when creating symbol aliase in ELF shared library. 
7. Fix addr2line on relocatable linux kernel. PR 4756.
8. Change disassembler to print addend as signed.
9. Support section alignment from 128 to 8192 bytes for PE-COFF.
10. Add attribute section to ELF linker.
11. Fix ELF linker to meet gABI alignment requirement. PR 4701.
12. Add support for reading in debug information via a .gnu_debuglink
section.
13. Fix string merge for ia64 linker. PR 4590.
14. Add --common to size to display total size for *COM* syms.
15. Fix "strip --strip-unneeded" on relocatable files. PR 4716.
16. Fix "objcopy/strip --only-keep-debug" for SHT_NOTE sections.
17. Fix objdump -S with unit-at-a-time.
18. Properly handle "-shared -pie" in linker. PR 4409.
19. Fix x86 disassembler in Intel mode for various SIMD instruction.
PRs 4667/4834.
20. Update x86-64 assembler to long nop sequence by default.
21. Fix --32 for x86-64 mingw assembler.
22. Fix a memory corruption in assembler.  PR 4722.
22. Properly support 64bit PE-COFF on hosts where long isn't 64bit.
23. Add #line in generated linker source files.
24. Fix linker crash on SIZEOF.  PR 4782.
27. Add CR16 support.
28. Add windmc tool for Windows.
29. Generate x86 instruction/register definitions from ascii tables.
30. Fix strip for Solaris. PR 4712.
31. Fix various mips bugs.
32. Fix various ppc bugs.
33. Fix various spu bugs.
34. Fix various xtensa bugs.

Changes from binutils 2.17.50.0.16:

1. Update from binutils 2007 0615.
2. Preserve section alignment for copy relocation.  PR 4504.
3. Properly fix regression with objcopy --only-keep-debug.  PR 4479.
4. Fix ELF eh frame handling.  PR 4497.
5. Fix ia64 string merge.  PR 4590.
5. Don't use PE target on EFI files nor EFI target on PE files.
6. Speed up linker with many input files.
7. Support cross compiling windres.  PR 2737.
8. Fix various windres bugs.
9. Fix various arms bugs.
10. Fix various m68k bugs.
11. Fix various mips bugs.
12. Fix various ppc bugs.
13. Fix various sparc bugs.
14. Fix various spu bugs.
15. Fix various xtensa bugs.

Changes from binutils 2.17.50.0.15:

1. Update from binutils 2007 0511.
2. Fix objcopy --only-keep-debug and linker multiple BSS sections handling.
PR 4479.
3. Fix "readelf -s -D" for gnu hash.  PR 4476.
4. Fix ia64 linker crash with --unresolved-symbols=ignore-all. PR 4409.
5. Improve crc32 support in x86 assembler/dissassembler.
6. Improve displacement handling in x86 dissassembler. PR 4430.
7. Correct PC relative displacement handling in x86-64 dissassembler for
Intel mode. PR 4429.
8. Fix various PPC bugs.
9. Fix various SPU bugs.
10. Fix various ARM bugs.
11. Fix various m68k bugs.
12. Fix various xtensa bugs.

Changes from binutils 2.17.50.0.14:

1. Update from binutils 2007 0418.
2. Support Intel SSE4 instructions.
3. Fix linker --fatal-warnings for --warn-shared-textrel. PR 4304.
4. Improve linker error message to identify linker script error
location. PR 4090.
5. Fix objcopy to allow removing all sections. PR 4348.
6. Don't print addresses of 32-bit targets as 64-bit values on 64bit
host. PR 4292.
7. Improve checking for corrupted input files. PR 4110.
8. Improve alpha linker performance.
9. Add a new linker option, -l:foo.
10. Fix a PPC linker bug. PR 4267.
11. Misc vxworks bug fixes.
12. Misc SH bug fixes.
13. Misc SPU bug fixes.
14. Misc ARM bug fixes.
15. Misc MIPS bug fixes.
16. Misc xtensa bug fixes.

Changes from binutils 2.17.50.0.13:

1. Update from binutils 2007 0322.
2. Fix >16byte nop padding regression in x86 assembler.
3. Fix x86-64 disassembler for xchg. PR 4218.
4. Optimize opcode for x86-64 xchg.
5. Allow register operand with x86 nop.
6. Properly handle holes between sections for PE-COFF. PR 4210.
7. Print more PE-COFF info for objdump -p.
8. Report missing matching LO16 relocation for HI16 relocation in mips
linker.
9. Use PC-relative relocation for Win64.
10. Fix strip for Solaris. PR 3535.
11. Fix a C++ demangler crash.
12. Some m32c update.
13. Fix misc ARM bugs.

Changes from binutils 2.17.50.0.12:

1. Update from binutils 2007 0315.
2. Add EFI/x86-64 support.
3. Fix ELF linker for relocation against STN_UNDEF. PR 3958.
4. Fix ELF linker for SHT_NOBITS section whose VMA > page size. PR 4144.
5. Make assembler and disassembler consistent for "test %eax,%ebx". PR
4027.
6. Fix i386 32bit address wraparound. PR 3966.
7. Allow Linux/i386 linker to read FreeBSD/i386 object files.
8. Fix ELF linker crash upon use of .gnu.warning.<symbol> sections. PR
3953.
9. Fix ELF linker to issue an error on bad section in segment. PR 4007.
10. Support enabling both x86_64-mingw32 and i386-mingw32. PR 3945.
11. Fix assembler to stabilize .gcc_except_table relaxation. PR 4029.
12. Fix a MIPS linker crash. PR 3852.
13. Fix readelf for h8300-elf. PR 3800.
14. Fix strip for Solaris. PR 3535.
15. Misc xtensa bug fixes.
16. Misc PPC bug fixes.
17. Misc SPU bug fixes.
18. Add support for Toshiba MeP.

Changes from binutils 2.17.50.0.11:

1. Update from binutils 2007 0128.
2. Remove duplicate code in x86 assembler.
3. Fix 32bit and 64bit HPPA/ELF.

Changes from binutils 2.17.50.0.10:

1. Update from binutils 2007 0125.
2. Support environment variables, LD_SYMBOLIC for -Bsymbolic and
LD_SYMBOLIC_FUNCTIONS for -Bsymbolic-functions.
3. Build binutils rpm with LD_SYMBOLIC_FUNCTIONS=1 and reduce PLT
relocations in libfd.so by 84%.
4. Enable sharable sections only for ia32, x86-64 and ia64.
5. Properly handle PT_GNU_RELRO segment for objcopy.

Changes from binutils 2.17.50.0.9:

1. Update from binutils 2007 0122.
2. Implement sharable section proposal for ia32, x86-64 and ia64:

http://groups-beta.google.com/group/generic-abi

3. Implement linker enhancement, -Bsymbolic-functions,
--dynamic-list-cpp-new and --dynamic-list-data.  PR 3831.
4. Implement new linker switch, --default-script=FILE/-dT FILE.
5. Check EI_OSABI when reading ELF files.  PR 3826.
6. Fix x86 assembler error message. PR 3830.
7. Fix a bug in ld testsuite.  PR 1283.
8. Don't include archive64.o for 32bit target.  PR 3631.
9. Support -z max-page-size and -z common-page-size in user provided
linker script.
10. Fix 32bit library support for GNU/kFreeBSD/x86-64.  PR 3843.
11. Fix some bugs in Score assembler. PR 3871.
12. Fix various bugs in ARM assembler. PR 3707 and more.
13. Add Fido support.

Changes from binutils 2.17.50.0.8:

1. Update from binutils 2007 0103.
2. Fix --wrap linker bug.
3. Improve handling ELF binaries generated by foreign ELF linkers.
4. Various ELF M68K bug fixes.
5. Score bug fixes.
6. Don't read past end of archive elements. PR 3704.
7. Improve .eh_frame_hdr section handling.
8. Fix symbol visibility with comdat/linkonce sections in ELF linker.
PR 3666.
9. Fix 4 operand instruction handling in x86 assembler.
10. Properly check the 4th operand in x86 assembler. PR 3712.
11. Fix .cfi_endproc handling in assembler. PR 3607.
12. Various ARM bug fixes.
13. Various PE linker fixes.
14. Improve x86 dissassembler for cmpxchg16b.

Changes from binutils 2.17.50.0.7:

1. Update from binutils 2006 1201.
2. Fix "objcopy --only-keep-debug" crash. PR 3609.
3. Fix various ARM ELF bugs.
4. Fix various xtensa bugs.
5. Update x86 disassembler.

Changes from binutils 2.17.50.0.6:

1. Update from binutils 2006 1127.
2. Properly set ELF output segment address when the first section in
input segment is removed.
3. Better merging of CIEs in linker .eh_frame optimizations.
4. Support .cfi_personality and .cfi_lsda assembler directives.
5. Fix an ARM linker crash. PR 3532.
6. Fix various PPC64 ELF bugs.
7. Mark discarded debug info more thoroughly in linker output.
8. Fix various MIPS ELF bugs.
9. Fix readelf to display program interpreter path > 64 chars. PR 3384.
10. Add support for PowerPC SPU.
11. Properly handle cloned symbols used in relocations in assembler. PR
3469.
12. Update opcode for POPCNT in amdfam10 architecture.

Changes from binutils 2.17.50.0.5:

1. Update from binutils 2006 1020.
2. Don't make debug symbol dynamic. PR 3290.
3. Don't page align empty SHF_ALLOC sections, which leads to very large
executables. PR 3314.
4. Use a different section index for section relative symbols against
removed empty sections.
5. Fix a few ELF EH frame handling bugs.
6. Don't ignore relocation overflow on branches to undefweaks for
x86-64. PR 3283.
7. Rename MNI to SSSE3.
8. Properly append symbol list for --dynamic-list.
lists.
9. Various ARM ELF fixes.
10. Correct 64bit library search path for Linux/x86 linker with 64bit
support.
11. Fix ELF linker to copy OS/PROC specific flags from input section to
output section.
12. Fix DW_FORM_ref_addr handling in linker dwarf reader. PR 3191.
13. Fix ELF indirect symbol handling. PR 3351.
14. Fix PT_GNU_RELRO segment handling for SHF_TLS sections. Don't add
PT_GNU_RELRO segment when there are no relro sections. PR 3281.
15. Various MIPS ELF fixes.
16. Various Sparc ELF fixes.
17. Various Xtensa ELF fixes.

Changes from binutils 2.17.50.0.4:

1. Update from binutils 2006 0927.
2. Fix linker regressions of section address and section relative symbol
with empty output section. PR 3223/3267.
3. Fix "strings -T". PR 3257.
4. Fix "objcopy --only-keep-debug". PR 3262.
5. Add Intell iwmmxt2 support.
6. Fix an x86 disassembler bug. PR 3100.

Changes from binutils 2.17.50.0.3:

1. Update from binutils 2006 0924.
2. Speed up linker on .o files with debug info on linkonce sections.
PR 3111.
3. Added x86-64 PE support.
4. Fix objcopy/strip on .o files with section groups. PR 3181.
5. Fix "ld --hash-style=gnu" crash with gcc 3.4.6. PR 3197.
6. Fix "strip --strip-debug" on .o files generated with
"gcc -feliminate-dwarf2-dups". PR 3186.
7. Fix "ld -r" on .o files generated with "gcc -feliminate-dwarf2-dups".
PR 3249.
8. Add --dynamic-list to linker to make global symbols dynamic.
9. Fix magic number for EFI ia64. PR 3171.
10. Remove PT_NULL segment for "ld -z relro". PR 3015.
11. Make objcopy to perserve the file formats in archive elements.
PR 3110.
12. Optimize x86-64 assembler and fix disassembler for
"add32 mov xx,$eax". PR 3235.
13. Improve linker diagnostics. PR 3107.
14. Fix "ld --sort-section name". PR 3009.
15. Updated an x86 disassembler bug. PR 3000.
16. Various updates for PPC, ARM, MIPS, SH, Xtensa.
17. Added Score support.

Changes from binutils 2.17.50.0.2:

1. Update from binutils 2006 0715.
2. Add --hash-style to ELF linker with DT_GNU_HASH and SHT_GNU_HASH.
3. Fix a visibility bug in ELF linker (PR 2884).
4. Properly fix the i386 TLS linker bug (PR 2513).
5. Add assembler and dissassembler support for Pentium Pro nops.
6. Optimize x86 nops for Pentium Pro and above.
7. Add -march=/-mtune= to x86 assembler.
8. Fix an ELF linker with TLS common symbols.
9. Improve program header allocation in ELF linker.
10. Improve MIPS, M68K and ARM support.
11. Fix an ELF linker crash when reporting alignment change (PR 2735).
12. Remove unused ELF section symbols (PR 2723).
13. Add --localize-hidden to objcopy.
14. Add AMD SSE4a and ABM new instruction support.
15. Properly handle illegal x86 instructions in group 11 (PR 2829).
16. Add "-z max-page-size=" and "-z common-page-size=" to ELF linker.
17. Fix objcopy for .tbss sections.

Changes from binutils 2.17.50.0.1:

1. Update from binutils 2006 0526.
2. Change the x86-64 maximum page size to 2MB.
3. Support --enable-targets=all for 64bit target and host (PR 1485).
4. Properly update CIE/FDE length and align section for .eh_frame
section (PR 2655/2657).
5. Properly handle removed ELF section symbols.
6. Fix an ELF linker regression introduced on 2006-04-21.
7. Fix an segfault in PPC ELF linker (PR 2658).
8. Speed up the ELF linker by caching the result of kept section check.
9. Properly create stabs section for ELF.
10. Preserve ELF program header when copying ELF files.
11. Properly handle ELF SHN_LOPROC/SHN_HIOS when checking section
index (PR 2607).
12. Misc mips updates.
13. Misc arm updates.
14. Misc xtensa updates.
15. Fix an alpha assembler warning (PR 2598).
16. Fix assembler buffer overflow.
17. Properly disassemble sgdt/sidt for x86-64.

Changes from binutils 2.16.91.0.7:

1. Update from binutils 2006 0427.
2. Fix an objcopy regression (PR 2593).
3. Reduce ar memory usage (PR 2467).
4. Allow application specific ELF sections (PR 2537).
5. Fix an i386 TLS linker bug (PR 2513).
6. Speed up ia64 linker by 1300X in some cases (PR 2442).
7. Check illegal immediate register operand in i386 assembler (PR
2533).
8. Fix a strings bug (PR 2584).
9. Better handle corrupted ELF files (PR 2257).
10. Fix a MIPS linker bug (PR 2267).

Changes from binutils 2.16.91.0.6:

1. Update from binutils 2006 0317.
2. Support Intel Merom New Instructions in assembler/disassembler.
3. Support Intel new instructions in Montecito.
4. Fix linker "--as-needed" (PR 2434).
5. Fix linker "-s" regression (PR 2462).
6. Fix REP prefix for string instructions in x86 disassembler
(PR 2428).
7. Fix the weak undefined symbols in PIE (PR 2218).
8. Fix 2 DWARF reader bugs (PRs 2443, 2338).
9. Improve ELF linker error message (PR 2322).
10. Avoid abort with dynamic symbols in >64K sections (PR 2411).
11. Handle mismatched symbol types for executables (PR 2404).
12. Avoid a linker linkonce regression (PR 2342).

Changes from binutils 2.16.91.0.5:

1. Update from binutils 2006 0212.
2. Correct Linux linker search order for DT_NEEDED entries (PR 2290).
3. Fix the x86-64 disassembler for control/debug register moves.
4. Properly handle ELF strip/objcopy with unmodified program header
(PR 2258).
5. Improve ELF linker error handling when there are not enough room for
program headers (PR 2322).
6. Properly handle weak undefined symbols in PIE (PR 2218).
7. Support new i386/x86-64 TLS relocations.
8. Fix addr2line for linux kernel (PR 2096).
9. Fix an assembler memory leak with --statistics.
10. Avoid an ia64 assembler regression (PR 2117).

Changes from binutils 2.16.91.0.4:

1. Update from binutils 2005 1219.
2. Fix a MIPS linker regression (PR 1932).
3. Fix an objcopy bug for ia64 (PR 1991).
4. Fix a linker crash on bad input (PR 2008).
5. Fix 64bit monitor and mwait (PR 1874).

Changes from binutils 2.16.91.0.3:

1. Update from binutils 2005 1111.
2. Fix ELF orphan section handling (PR 1467)
3. Fix ELF section attribute handleing (PR 1487).
4. Fix IA64 unwind info dump for relocatable files. (PR 1436).
5. Add DWARF info dump to objdump.
6. Fix SHF_LINK_ORDER handling (PR 1321).
7. Don't allow "ld --just-symbols" on DSO (PR 1263).
8. Fix a "ld -u" crash on TLS symbol (PR 1301).
9. Fix an IA64 linker crash (PR 1247).
10. Fix a MIPS linker bug (PR 1150).
11. Fix a M68K linker bug (PR 1775).
12. Fix an ELF symbol versioning linker bug (PR 1540).
13. Improve linker error handling (PR 1208).
14. Add new SPARC processors to SunOS for objcopy (PR 1472).
15. Add "@file" to read options from a file.
16. Add assembler weakref support.

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.18.50.0.5.tar.bz2. Source code.
2. binutils-2.18.50.0.4-2.18.50.0.5.diff.bz2. Patch against the
   previous beta source code.
3. binutils-2.18.50.0.5.i686.tar.bz2. IA-32 binary tar ball for RedHat
   EL 4.
4. binutils-2.18.50.0.5.ia64.tar.bz2. IA-64 binary tar ball for RedHat
   EL 4.
5. binutils-2.18.50.0.5.x86_64.tar.bz2. X64_64 binary tar ball for RedHat
   EL 4.

The primary sites for the beta Linux binutils are:

1. http://www.kernel.org/pub/linux/devel/binutils/

Thanks.


H.J. Lu
hjl.tools@gmail.com
03/14/2008

From tsbogend@alpha.franken.de Sat Mar 15 10:42:04 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 15 Mar 2008 10:42:07 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:4004 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28591578AbYCOKmE (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sat, 15 Mar 2008 10:42:04 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JaTpx-0004g3-00; Sat, 15 Mar 2008 11:42:01 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id A5B81C235E; Sat, 15 Mar 2008 11:40:09 +0100 (CET)
Date:	Sat, 15 Mar 2008 11:40:09 +0100
To:	Matteo Croce <technoboy85@gmail.com>
Cc:	linux-mips@linux-mips.org, Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH][MIPS][5/6]: AR7: serial hack
Message-ID: <20080315104009.GA6533@alpha.franken.de>
References: <200803120221.25044.technoboy85@gmail.com> <200803130138.55582.technoboy85@gmail.com> <20080313084526.GA6012@alpha.franken.de> <200803141646.09645.technoboy85@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200803141646.09645.technoboy85@gmail.com>
User-Agent: Mutt/1.5.13 (2006-08-11)
From:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Return-Path: <tsbogend@alpha.franken.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: 18397
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips

On Fri, Mar 14, 2008 at 04:46:09PM +0100, Matteo Croce wrote:
> This is a bit better

is it possible to try without the serial changes first ?

Use 

       uart_port[0].type = PORT_16550A;

in arch/mips/ar7/platform.c.

Does it work ?

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

From tsbogend@alpha.franken.de Sat Mar 15 11:28:57 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 15 Mar 2008 11:29:00 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:23978 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28590947AbYCOL25 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sat, 15 Mar 2008 11:28:57 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JaUZM-0004ow-00; Sat, 15 Mar 2008 12:28:56 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id 55750C2360; Sat, 15 Mar 2008 12:28:51 +0100 (CET)
From:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: [PATCH] check for gcc r10k-cache-barrier support
To:	linux-mips@linux-mips.org
cc:	ralf@linux-mips.org
Message-Id: <20080315112851.55750C2360@solo.franken.de>
Date:	Sat, 15 Mar 2008 12:28:51 +0100 (CET)
Return-Path: <tsbogend@alpha.franken.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: 18398
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips

Check whether gcc supports -mr10-cache-barrier=1 and issue a cleaner
error message if not. This option is needed to build working SGI IP28
kernels.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---

 arch/mips/Makefile |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 72097da..1c62381 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -482,10 +482,13 @@ endif
 # be 16kb aligned or the handling of the current variable will break.
 # Simplified: what IP22 does at 128MB+ in ksegN, IP28 does at 512MB+ in xkphys
 #
-#core-$(CONFIG_SGI_IP28)		+= arch/mips/sgi-ip22/ arch/mips/arc/arc_con.o
+ifdef CONFIG_SGI_IP28
+  ifeq ($(call cc-option-yn,-mr10k-cache-barrier=1), n)
+      $(error gcc doesn't support needed option -mr10k-cache-barrier=1)
+  endif
+endif
 core-$(CONFIG_SGI_IP28)		+= arch/mips/sgi-ip22/
 cflags-$(CONFIG_SGI_IP28)	+= -mr10k-cache-barrier=1 -Iinclude/asm-mips/mach-ip28
-#cflags-$(CONFIG_SGI_IP28)	+= -Iinclude/asm-mips/mach-ip28
 load-$(CONFIG_SGI_IP28)		+= 0xa800000020004000
 
 #

From alan@lxorguk.ukuu.org.uk Sat Mar 15 12:00:34 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 15 Mar 2008 12:00:36 +0000 (GMT)
Received: from outpipe-village-512-1.bc.nu ([81.2.110.250]:20923 "EHLO
	the-village.bc.nu") by ftp.linux-mips.org with ESMTP
	id S28592139AbYCOMAe (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 15 Mar 2008 12:00:34 +0000
Received: from the-village.bc.nu (localhost.localdomain [127.0.0.1])
	by the-village.bc.nu (8.14.2/8.13.8) with ESMTP id m2FBcquB003267;
	Sat, 15 Mar 2008 11:38:52 GMT
Date:	Sat, 15 Mar 2008 11:38:51 +0000
From:	Alan Cox <alan@lxorguk.ukuu.org.uk>
To:	Matteo Croce <technoboy85@gmail.com>
Cc:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	linux-mips@linux-mips.org, Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH][MIPS][5/6]: AR7: serial hack
Message-ID: <20080315113851.6f86acff@the-village.bc.nu>
In-Reply-To: <200803141646.09645.technoboy85@gmail.com>
References: <200803120221.25044.technoboy85@gmail.com>
	<200803130138.55582.technoboy85@gmail.com>
	<20080313084526.GA6012@alpha.franken.de>
	<200803141646.09645.technoboy85@gmail.com>
X-Mailer: Claws Mail 3.2.0 (GTK+ 2.12.5; i386-redhat-linux-gnu)
Organization: Red Hat UK Cyf., Amberley Place, 107-111 Peascod Street,
 Windsor, Berkshire, SL4 1TE, Y Deyrnas Gyfunol. Cofrestrwyd yng Nghymru a
 Lloegr o'r rhif cofrestru 3798903
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
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: 18399
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

> This is a bit better

NAK - especially as there has been a specific response about how to do
this without ifdef hacks in core code.

Alan

From ralf@linux-mips.org Sat Mar 15 14:47:21 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 15 Mar 2008 14:47:23 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:27330 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28593215AbYCOOrV (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 15 Mar 2008 14:47:21 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2FElKum024340;
	Sat, 15 Mar 2008 14:47:20 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2FElKKF024339;
	Sat, 15 Mar 2008 14:47:20 GMT
Date:	Sat, 15 Mar 2008 14:47:20 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] check for gcc r10k-cache-barrier support
Message-ID: <20080315144720.GA22631@linux-mips.org>
References: <20080315112851.55750C2360@solo.franken.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080315112851.55750C2360@solo.franken.de>
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18400
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, Mar 15, 2008 at 12:28:51PM +0100, Thomas Bogendoerfer wrote:

> Check whether gcc supports -mr10-cache-barrier=1 and issue a cleaner
> error message if not. This option is needed to build working SGI IP28
> kernels.

Thanks, applied.

  Ralf

From giuseppe@eppesuigoccas.homedns.org Sun Mar 16 10:49:08 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 16 Mar 2008 10:49:11 +0000 (GMT)
Received: from host194-211-dynamic.20-79-r.retail.telecomitalia.it ([79.20.211.194]:54445
	"EHLO eppesuigoccas.homedns.org") by ftp.linux-mips.org with ESMTP
	id S28596284AbYCPKtI (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 16 Mar 2008 10:49:08 +0000
Received: from router-wag54gp2 ([192.168.1.33] helo=[192.168.2.7])
	by eppesuigoccas.homedns.org with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.63)
	(envelope-from <giuseppe@eppesuigoccas.homedns.org>)
	id 1JaqQE-0003BY-0d
	for linux-mips@linux-mips.org; Sun, 16 Mar 2008 11:49:00 +0100
Subject: new kernel oops in recent kernels
From:	Giuseppe Sacco <giuseppe@eppesuigoccas.homedns.org>
To:	linux-mips@linux-mips.org
Content-Type: text/plain
Organization: Giuseppe Sacco Consulting
Date:	Sun, 16 Mar 2008 11:49:23 +0100
Message-Id: <1205664563.3050.4.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 2.12.3 
Content-Transfer-Encoding: 7bit
Return-Path: <giuseppe@eppesuigoccas.homedns.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: 18401
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: giuseppe@eppesuigoccas.homedns.org
Precedence: bulk
X-list: linux-mips

Hi all,
testing the latest kernels on SGI O2, I found this new kernel oops. It
is there (even if code changed a bit) since 2.6.22, but the oops I
attach here has been produced with kernel from linux-mips.org git of
yesterday night.

I don't know if this is a problem that I should report to this list, or
if I should address a different list. If you have any suggestion, please
let me know.

Thanks a lot,
Giuseppe

CPU 0 Unable to handle kernel paging request at virtual address 0000000000000000, epc == 0000000000000000, ra == 0000000000000000
Oops[#1]:
Cpu 0
$ 0   : 0000000000000000 ffffffff9001fce0 ffffffffffffff86 0000000000000028
$ 4   : 980000000fc01140 0000000000000080 0000000000024000 0000000000000000
$ 8   : 980000000fc54700 0000000000000001 0000000000008000 404000130a0808ff
$12   : 0000000000000008 ffffffff801b8db8 0000000000000000 ffffffff803f0000
$16   : 980000000ff2fa70 980000000c417bb8 980000000c417c20 980000000fdeb610
$20   : 000000007fffffff 980000000f9211a0 980000000fc26000 000000007fa51ecd
$24   : 0000000000000000 ffffffff80074290                                  
$28   : 980000000c414000 980000000c417bb0 0000000000400000 0000000000000000
Hi    : 0000000000000000
Lo    : 003d08dbda057200
epc   : 0000000000000000 0x0     Not tainted
ra    : 0000000000000000 0x0
Status: 9001fce3    KX SX UX KERNEL EXL IE 
Cause : 00000008
BadVA : 0000000000000000
PrId  : 00002321 (R5000)
Modules linked in: parport_pc lp parport ipv6 deflate zlib_deflate ctr twofish twofish_common camellia serpent blowfish des_generic cbc aes_generic xcbc sha25
6_generic sha1_generic crypto_null crypto_blkcipher dm_snapshot dm_mirror dm_mod ehci_hcd ohci_hcd r8169 usbcore sg evdev
Process hald-probe-stor (pid: 1937, threadinfo=980000000c414000, task=980000000ebf47d8)
Stack : 980000000c417be0 980000000c417de0 0800000000000000 980000000c417bb0
        00000008ffffff86 0000000000000000 0200000000000001 000006d600000000
        0000000000000000 980000000c417de0 980000000fdeb610 0000000000000001
        0000000000005326 ffffffff802460b0 0000000070023a00 000000000f9211a0
        ffffffff80490000 ffffffff8024bb84 980000000fc10e80 980000000f80bb28
        0000000000000000 980000000f9210e0 0000010100000001 00000000800d1618
        0000000000000004 980000000fc8f850 000000007fffffff 980000000fde4000
        0000000000005326 000000007fffffff 980000000c407540 980000000f9211a0
        980000000fc26000 000000007fa51ecd ffffffff80245c6c 980000000c407540
        0000000000000000 fffffffffffffdfd 0000000000005326 ffffffff801ad8bc
        ...
Call Trace:
[<ffffffff802460b0>] sr_drive_status+0x50/0xe8
[<ffffffff8024bb84>] cdrom_ioctl+0x5f4/0x1208
[<ffffffff80245c6c>] sr_block_ioctl+0x64/0xe8
[<ffffffff801ad8bc>] compat_blkdev_ioctl+0x7cc/0x18e0
[<ffffffff800d1870>] do_open+0x98/0x310
[<ffffffff800d1d60>] blkdev_open+0x0/0xc0
[<ffffffff800d1da8>] blkdev_open+0x48/0xc0
[<ffffffff8009c444>] __dentry_open+0x114/0x2e0
[<ffffffff8009c740>] do_filp_open+0x48/0x58
[<ffffffff8009c740>] do_filp_open+0x48/0x58
[<ffffffff800def8c>] compat_sys_ioctl+0xf4/0x440
[<ffffffff80019154>] handle_sys+0x114/0x130
[<ffffffff8001fcf3>] fpu_emulator_cop1Handler+0x362/0x2270


Code: (Bad address in epc)
 


From technoboy85@gmail.com Sun Mar 16 15:27:39 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 16 Mar 2008 15:27:42 +0000 (GMT)
Received: from smtp-out28.alice.it ([85.33.2.28]:47634 "EHLO
	smtp-out28.alice.it") by ftp.linux-mips.org with ESMTP
	id S28597101AbYCPP1j (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 16 Mar 2008 15:27:39 +0000
Received: from FBCMMO01.fbc.local ([192.168.68.195]) by smtp-out28.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Sun, 16 Mar 2008 16:27:34 +0100
Received: from FBCMCL01B04.fbc.local ([192.168.69.85]) by FBCMMO01.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Sun, 16 Mar 2008 16:27:33 +0100
Received: from raver.openwrt ([79.19.114.153]) by FBCMCL01B04.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Sun, 16 Mar 2008 16:27:32 +0100
From:	Matteo Croce <technoboy85@gmail.com>
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: Re: [PATCH][MIPS][5/6]: AR7: serial hack
Date:	Sun, 16 Mar 2008 16:27:31 +0100
User-Agent: KMail/1.9.9
Cc:	Alan Cox <alan@lxorguk.ukuu.org.uk>, linux-mips@linux-mips.org,
	Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
References: <200803120221.25044.technoboy85@gmail.com> <200803130131.54570.technoboy85@gmail.com> <20080313090109.GB6012@alpha.franken.de>
In-Reply-To: <20080313090109.GB6012@alpha.franken.de>
X-Face:	0AUq?,0sKh2O65+R5#[nTCS'~}"m)9|g3Tsi=g7A9q69S+=M!BY)=?utf-8?q?Zdmwo2u!i=5CUylx=26=27D+=0A=09=5B7u=26z1=27s=7E=5B=3F+=24=27w?=
 =?utf-8?q?O6+?="'WWcr5Jy,]}8namg8NP:9<E,o^21xGB~/HRhB(u^@
 =?utf-8?q?ZB=2EXLP0swe=0A=09r9M=7EL?=<b1=^'4cv*_N1tNJ$`9Ot*KL/;8oXFdrT@r|-Ki2wCQI"R(X(
 =?utf-8?q?73r=3A=3BmnNPoA2a=5D=7EZ=0A=092n2sUh?=,B|bt;ys*hv.QR>a]{m
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200803161627.31556.technoboy85@gmail.com>
X-OriginalArrivalTime: 16 Mar 2008 15:27:32.0817 (UTC) FILETIME=[411BF410:01C8877A]
Return-Path: <technoboy85@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: 18402
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: technoboy85@gmail.com
Precedence: bulk
X-list: linux-mips

Il Thursday 13 March 2008 10:01:09 Thomas Bogendoerfer ha scritto:
> On Thu, Mar 13, 2008 at 01:31:54AM +0100, Matteo Croce wrote:
> > Il Wednesday 12 March 2008 12:16:29 Alan Cox ha scritto:
> > > On Wed, 12 Mar 2008 02:30:06 +0100
> > > Matteo Croce <technoboy85@gmail.com> wrote:
> > > 
> > > > Ugly but we need it
> > > 
> > > Too ugly - NAK
> > > 
> > > However please send an explanation of the problem and lets find a nicer
> > > way to do it or bury it in arch code.
> > > 
> > > 
> > 
> > This is my problem:
> > 
> > ffi_cmdset_000: DDisabling erae-ssuspend-progrm ddue to code bokeenness.
> > cmdlinparrt partition arssing not avaiabll
> > RedBoo ppartition parsngg not availabl
> > NET: Rgiistered protocl  family 1
> > NET: Regsteered protocol ammily 10
> > IPv6 overIPPv4 tunnelingdriiver
> > NET: Regsteered protocolfammily 17
> > FS:: Mounted roo (ssquashfs filessttem) readonly.
> > Freeing nuused kernel meorry: 120k freed
> > 
> > I'll try to find a nicer way to fix it
> 
> don't use AFE mode and treat it like a normal 16550 (PORT_16550A). You
> could also try to use UPIO_MEM32. That's how my console driver
> (different OS) works for AR7 without the hack to wait for LSR_TEMP and 
> LSR_THRE.
> 
> Thomas.
> 

What about the .fcr field? PORT_16550A uses UART_FCR_R_TRIG_10 while AR7 uses UART_FCR_R_TRIG_00

From technoboy85@gmail.com Sun Mar 16 15:45:25 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 16 Mar 2008 15:45:27 +0000 (GMT)
Received: from smtp-out114.alice.it ([85.37.17.114]:19213 "EHLO
	smtp-out114.alice.it") by ftp.linux-mips.org with ESMTP
	id S28597274AbYCPPpZ (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 16 Mar 2008 15:45:25 +0000
Received: from FBCMMO01.fbc.local ([192.168.68.195]) by smtp-out114.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Sun, 16 Mar 2008 16:45:10 +0100
Received: from FBCMCL01B02.fbc.local ([192.168.69.83]) by FBCMMO01.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Sun, 16 Mar 2008 16:45:10 +0100
Received: from raver.openwrt ([79.19.114.153]) by FBCMCL01B02.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Sun, 16 Mar 2008 16:45:09 +0100
From:	Matteo Croce <technoboy85@gmail.com>
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: Re: [PATCH][MIPS][5/6]: AR7: serial hack
Date:	Sun, 16 Mar 2008 16:45:06 +0100
User-Agent: KMail/1.9.9
Cc:	linux-mips@linux-mips.org, Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
References: <200803120221.25044.technoboy85@gmail.com> <200803141646.09645.technoboy85@gmail.com> <20080315104009.GA6533@alpha.franken.de>
In-Reply-To: <20080315104009.GA6533@alpha.franken.de>
X-Face:	0AUq?,0sKh2O65+R5#[nTCS'~}"m)9|g3Tsi=g7A9q69S+=M!BY)=?utf-8?q?Zdmwo2u!i=5CUylx=26=27D+=0A=09=5B7u=26z1=27s=7E=5B=3F+=24=27w?=
 =?utf-8?q?O6+?="'WWcr5Jy,]}8namg8NP:9<E,o^21xGB~/HRhB(u^@
 =?utf-8?q?ZB=2EXLP0swe=0A=09r9M=7EL?=<b1=^'4cv*_N1tNJ$`9Ot*KL/;8oXFdrT@r|-Ki2wCQI"R(X(
 =?utf-8?q?73r=3A=3BmnNPoA2a=5D=7EZ=0A=092n2sUh?=,B|bt;ys*hv.QR>a]{m
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200803161645.06364.technoboy85@gmail.com>
X-OriginalArrivalTime: 16 Mar 2008 15:45:10.0189 (UTC) FILETIME=[B75A1DD0:01C8877C]
Return-Path: <technoboy85@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: 18403
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: technoboy85@gmail.com
Precedence: bulk
X-list: linux-mips

Il Saturday 15 March 2008 11:40:09 Thomas Bogendoerfer ha scritto:
> On Fri, Mar 14, 2008 at 04:46:09PM +0100, Matteo Croce wrote:
> > This is a bit better
> 
> is it possible to try without the serial changes first ?
> 
> Use 
> 
>        uart_port[0].type = PORT_16550A;
> 
> in arch/mips/ar7/platform.c.
> 
> Does it work ?
> 
> Thomas.
> 

Tried I get teh usual broken serial output:

IP6 oover IPv4 tuneliing driver
NET: eggistered protooll family 17
VFS: Monteed root (squahfss filesystem)reaadonly.

From technoboy85@gmail.com Sun Mar 16 15:49:38 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 16 Mar 2008 15:49:40 +0000 (GMT)
Received: from smtp-out25.alice.it ([85.33.2.25]:4102 "EHLO
	smtp-out25.alice.it") by ftp.linux-mips.org with ESMTP
	id S28597321AbYCPPti (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 16 Mar 2008 15:49:38 +0000
Received: from FBCMMO03.fbc.local ([192.168.68.197]) by smtp-out25.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Sun, 16 Mar 2008 16:49:33 +0100
Received: from FBCMCL01B07.fbc.local ([192.168.171.45]) by FBCMMO03.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Sun, 16 Mar 2008 16:49:33 +0100
Received: from raver.openwrt ([79.19.114.153]) by FBCMCL01B07.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Sun, 16 Mar 2008 16:47:59 +0100
From:	Matteo Croce <technoboy85@gmail.com>
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: Re: [PATCH][MIPS][5/6]: AR7: serial hack
Date:	Sun, 16 Mar 2008 16:49:30 +0100
User-Agent: KMail/1.9.9
Cc:	Alan Cox <alan@lxorguk.ukuu.org.uk>, linux-mips@linux-mips.org,
	Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
References: <200803120221.25044.technoboy85@gmail.com> <200803130131.54570.technoboy85@gmail.com> <20080313090109.GB6012@alpha.franken.de>
In-Reply-To: <20080313090109.GB6012@alpha.franken.de>
X-Face:	0AUq?,0sKh2O65+R5#[nTCS'~}"m)9|g3Tsi=g7A9q69S+=M!BY)=?utf-8?q?Zdmwo2u!i=5CUylx=26=27D+=0A=09=5B7u=26z1=27s=7E=5B=3F+=24=27w?=
 =?utf-8?q?O6+?="'WWcr5Jy,]}8namg8NP:9<E,o^21xGB~/HRhB(u^@
 =?utf-8?q?ZB=2EXLP0swe=0A=09r9M=7EL?=<b1=^'4cv*_N1tNJ$`9Ot*KL/;8oXFdrT@r|-Ki2wCQI"R(X(
 =?utf-8?q?73r=3A=3BmnNPoA2a=5D=7EZ=0A=092n2sUh?=,B|bt;ys*hv.QR>a]{m
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200803161649.30531.technoboy85@gmail.com>
X-OriginalArrivalTime: 16 Mar 2008 15:48:00.0250 (UTC) FILETIME=[1CB75DA0:01C8877D]
Return-Path: <technoboy85@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: 18404
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: technoboy85@gmail.com
Precedence: bulk
X-list: linux-mips

Il Thursday 13 March 2008 10:01:09 Thomas Bogendoerfer ha scritto:
> On Thu, Mar 13, 2008 at 01:31:54AM +0100, Matteo Croce wrote:
> > Il Wednesday 12 March 2008 12:16:29 Alan Cox ha scritto:
> > > On Wed, 12 Mar 2008 02:30:06 +0100
> > > Matteo Croce <technoboy85@gmail.com> wrote:
> > > 
> > > > Ugly but we need it
> > > 
> > > Too ugly - NAK
> > > 
> > > However please send an explanation of the problem and lets find a nicer
> > > way to do it or bury it in arch code.
> > > 
> > > 
> > 
> > This is my problem:
> > 
> > ffi_cmdset_000: DDisabling erae-ssuspend-progrm ddue to code bokeenness.
> > cmdlinparrt partition arssing not avaiabll
> > RedBoo ppartition parsngg not availabl
> > NET: Rgiistered protocl  family 1
> > NET: Regsteered protocol ammily 10
> > IPv6 overIPPv4 tunnelingdriiver
> > NET: Regsteered protocolfammily 17
> > FS:: Mounted roo (ssquashfs filessttem) readonly.
> > Freeing nuused kernel meorry: 120k freed
> > 
> > I'll try to find a nicer way to fix it
> 
> don't use AFE mode and treat it like a normal 16550 (PORT_16550A). You
> could also try to use UPIO_MEM32. That's how my console driver
> (different OS) works for AR7 without the hack to wait for LSR_TEMP and 
> LSR_THRE.
> 
> Thomas.
> 

What do you mean by don't using AFE? Just removing UART_CAP_AFE from the .fcr field?
I've tried but it doesn't work.

I tried also UPIO_MEM32 instead of UPIO_MEM (with PORT_AR7) but it doesn't works

From tsbogend@alpha.franken.de Sun Mar 16 17:14:36 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 16 Mar 2008 17:14:39 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:20643 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28597542AbYCPROg (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sun, 16 Mar 2008 17:14:36 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JawRQ-0006Tt-00; Sun, 16 Mar 2008 18:14:36 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id 18556C226C; Sun, 16 Mar 2008 18:14:16 +0100 (CET)
From:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: [PATCH] BCM1480: Fix PCI/HT IO access
To:	linux-mips@linux-mips.org
cc:	ralf@linux-mips.org
Message-Id: <20080316171416.18556C226C@solo.franken.de>
Date:	Sun, 16 Mar 2008 18:14:16 +0100 (CET)
Return-Path: <tsbogend@alpha.franken.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: 18405
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips

- removed check for enable HT-PCI bridges, because some CFE version
  init only the needed one and scanning works even with disabled HT
  links
- implemented I/O access behind HT PCI busses
- fixed pci_map for IO resource behind PCI bridge

Tested with E100 and Tulip driver.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---

 arch/mips/pci/pci-bcm1480.c   |    6 ++++--
 arch/mips/pci/pci-bcm1480ht.c |   21 +++++++--------------
 2 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/arch/mips/pci/pci-bcm1480.c b/arch/mips/pci/pci-bcm1480.c
index ab68c43..87e2c8f 100644
--- a/arch/mips/pci/pci-bcm1480.c
+++ b/arch/mips/pci/pci-bcm1480.c
@@ -185,8 +185,8 @@ static struct resource bcm1480_mem_resource = {
 
 static struct resource bcm1480_io_resource = {
 	.name	= "BCM1480 PCI I/O",
-	.start	= 0x2c000000UL,
-	.end	= 0x2dffffffUL,
+	.start	= A_BCM1480_PHYS_PCI_IO_MATCH_BYTES,
+	.end	= A_BCM1480_PHYS_PCI_IO_MATCH_BYTES + 0x1ffffffUL,
 	.flags	= IORESOURCE_IO,
 };
 
@@ -194,6 +194,7 @@ struct pci_controller bcm1480_controller = {
 	.pci_ops	= &bcm1480_pci_ops,
 	.mem_resource	= &bcm1480_mem_resource,
 	.io_resource	= &bcm1480_io_resource,
+	.io_offset      = A_BCM1480_PHYS_PCI_IO_MATCH_BYTES,
 };
 
 
@@ -251,6 +252,7 @@ static int __init bcm1480_pcibios_init(void)
 
 	bcm1480_controller.io_map_base = (unsigned long)
 		ioremap(A_BCM1480_PHYS_PCI_IO_MATCH_BYTES, 65536);
+	bcm1480_controller.io_map_base -= bcm1480_controller.io_offset;
 	set_io_port_base(bcm1480_controller.io_map_base);
 	isa_slot_offset = (unsigned long)
 		ioremap(A_BCM1480_PHYS_PCI_MEM_MATCH_BYTES, 1024*1024);
diff --git a/arch/mips/pci/pci-bcm1480ht.c b/arch/mips/pci/pci-bcm1480ht.c
index 005e7fe..f54f454 100644
--- a/arch/mips/pci/pci-bcm1480ht.c
+++ b/arch/mips/pci/pci-bcm1480ht.c
@@ -180,8 +180,8 @@ static struct resource bcm1480ht_mem_resource = {
 
 static struct resource bcm1480ht_io_resource = {
 	.name	= "BCM1480 HT I/O",
-	.start	= 0x00000000UL,
-	.end	= 0x01ffffffUL,
+	.start	= A_BCM1480_PHYS_HT_IO_MATCH_BYTES,
+	.end	= A_BCM1480_PHYS_HT_IO_MATCH_BYTES + 0x01ffffffUL,
 	.flags	= IORESOURCE_IO,
 };
 
@@ -191,29 +191,22 @@ struct pci_controller bcm1480ht_controller = {
 	.io_resource	= &bcm1480ht_io_resource,
 	.index		= 1,
 	.get_busno	= bcm1480ht_pcibios_get_busno,
+	.io_offset      = A_BCM1480_PHYS_HT_IO_MATCH_BYTES,
 };
 
 static int __init bcm1480ht_pcibios_init(void)
 {
-	uint32_t cmdreg;
-
 	ht_cfg_space = ioremap(A_BCM1480_PHYS_HT_CFG_MATCH_BITS, 16*1024*1024);
 
-	/*
-	 * See if the PCI bus has been configured by the firmware.
-	 */
-	cmdreg = READCFG32(CFGOFFSET(0, PCI_DEVFN(PCI_BRIDGE_DEVICE, 0),
-				     PCI_COMMAND));
-	if (!(cmdreg & PCI_COMMAND_MASTER)) {
-		printk("HT: Skipping HT probe. Bus is not initialized.\n");
-		iounmap(ht_cfg_space);
-		return 1; /* XXX */
-	}
+	/* CFE doesn't always init all HT paths, so we always scan */
 	bcm1480ht_bus_status |= PCI_BUS_ENABLED;
 
 	ht_eoi_space = (unsigned long)
 		ioremap(A_BCM1480_PHYS_HT_SPECIAL_MATCH_BYTES,
 			4 * 1024 * 1024);
+	bcm1480ht_controller.io_map_base = (unsigned long)
+		ioremap(A_BCM1480_PHYS_HT_IO_MATCH_BYTES, 65536);
+	bcm1480ht_controller.io_map_base -= bcm1480ht_controller.io_offset;
 
 	register_pci_controller(&bcm1480ht_controller);
 

From giuseppe@eppesuigoccas.homedns.org Sun Mar 16 20:27:53 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 16 Mar 2008 20:27:55 +0000 (GMT)
Received: from host194-211-dynamic.20-79-r.retail.telecomitalia.it ([79.20.211.194]:53904
	"EHLO eppesuigoccas.homedns.org") by ftp.linux-mips.org with ESMTP
	id S20026298AbYCPU1x (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 16 Mar 2008 20:27:53 +0000
Received: from casa ([192.168.2.34])
	by eppesuigoccas.homedns.org with esmtpsa (TLS-1.0:RSA_ARCFOUR_MD5:16)
	(Exim 4.63)
	(envelope-from <giuseppe@eppesuigoccas.homedns.org>)
	id 1JazSJ-0002Gd-Hg
	for linux-mips@linux-mips.org; Sun, 16 Mar 2008 21:27:45 +0100
Subject: Compiler error? [was: Re: new kernel oops in recent kernels]
From:	Giuseppe Sacco <giuseppe@eppesuigoccas.homedns.org>
To:	linux-mips@linux-mips.org
In-Reply-To: <1205664563.3050.4.camel@localhost>
References: <1205664563.3050.4.camel@localhost>
Content-Type: text/plain
Date:	Sun, 16 Mar 2008 21:27:37 +0100
Message-Id: <1205699257.4159.14.camel@casa>
Mime-Version: 1.0
X-Mailer: Evolution 2.6.3 
Content-Transfer-Encoding: 7bit
Return-Path: <giuseppe@eppesuigoccas.homedns.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: 18406
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: giuseppe@eppesuigoccas.homedns.org
Precedence: bulk
X-list: linux-mips

Hi all,
the Oops I reported earlier today, may be related to a problem of the
GNU C compiler, but I do not know MIPS assembly, so I ask for help.

Call Trace of the original oops:

> [<ffffffff802460b0>] sr_drive_status+0x50/0xe8
> [<ffffffff8024bb84>] cdrom_ioctl+0x5f4/0x1208
> [<ffffffff80245c6c>] sr_block_ioctl+0x64/0xe8
> [<ffffffff801ad8bc>] compat_blkdev_ioctl+0x7cc/0x18e0
> [<ffffffff800d1870>] do_open+0x98/0x310
> [<ffffffff800d1d60>] blkdev_open+0x0/0xc0
> [<ffffffff800d1da8>] blkdev_open+0x48/0xc0
> [<ffffffff8009c444>] __dentry_open+0x114/0x2e0
> [<ffffffff8009c740>] do_filp_open+0x48/0x58
> [<ffffffff8009c740>] do_filp_open+0x48/0x58
> [<ffffffff800def8c>] compat_sys_ioctl+0xf4/0x440
> [<ffffffff80019154>] handle_sys+0x114/0x130
> [<ffffffff8001fcf3>] fpu_emulator_cop1Handler+0x362/0x2270

sr_drive_status+0x50 is, in decimal, sr_drive_status+80
The gdb disassable the code as this:

(gdb) disassemble sr_drive_status+0x50
Dump of assembler code for function sr_drive_status:
0xffffffff80246060 <sr_drive_status+0>: daddiu  sp,sp,-32
0xffffffff80246064 <sr_drive_status+4>: lui     v0,0x7fff
0xffffffff80246068 <sr_drive_status+8>: sd      s0,16(sp)
0xffffffff8024606c <sr_drive_status+12>:        sd      ra,24(sp)
0xffffffff80246070 <sr_drive_status+16>:        ori     v0,v0,0xffff
0xffffffff80246074 <sr_drive_status+20>:        move    s0,a0
0xffffffff80246078 <sr_drive_status+24>:        bne     a1,v0,0xffffffff802460e8 <sr_drive_status+136>
0xffffffff8024607c <sr_drive_status+28>:        ld      v1,24(a0)
0xffffffff80246080 <sr_drive_status+32>:        ld      a0,16(v1)
0xffffffff80246084 <sr_drive_status+36>:        jal     0xffffffff80244c70 <sr_test_unit_ready>
0xffffffff80246088 <sr_drive_status+40>:        daddiu  a1,sp,4
0xffffffff8024608c <sr_drive_status+44>:        bnez    v0,0xffffffff802460a8 <sr_drive_status+72>
0xffffffff80246090 <sr_drive_status+48>:        move    a0,s0
0xffffffff80246094 <sr_drive_status+52>:        li      v0,4
0xffffffff80246098 <sr_drive_status+56>:        ld      ra,24(sp)
0xffffffff8024609c <sr_drive_status+60>:        ld      s0,16(sp)
0xffffffff802460a0 <sr_drive_status+64>:        jr      ra
0xffffffff802460a4 <sr_drive_status+68>:        daddiu  sp,sp,32
0xffffffff802460a8 <sr_drive_status+72>:        jal     0xffffffff8024c838 <cdrom_get_media_event>
0xffffffff802460ac <sr_drive_status+76>:        move    a1,sp
0xffffffff802460b0 <sr_drive_status+80>:        bnez    v0,0xffffffff802460fc <sr_drive_status+156>
0xffffffff802460b4 <sr_drive_status+84>:        lhu     v0,0(sp)
0xffffffff802460b8 <sr_drive_status+88>:        sll     v0,v0,0x0
0xffffffff802460bc <sr_drive_status+92>:        andi    v0,v0,0xff
0xffffffff802460c0 <sr_drive_status+96>:        andi    v1,v0,0x2
0xffffffff802460c4 <sr_drive_status+100>:       bnez    v1,0xffffffff80246094 <sr_drive_status+52>
0xffffffff802460c8 <sr_drive_status+104>:       andi    v0,v0,0x1
0xffffffff802460cc <sr_drive_status+108>:       beqz    v0,0xffffffff80246098 <sr_drive_status+56>
0xffffffff802460d0 <sr_drive_status+112>:       li      v0,1
0xffffffff802460d4 <sr_drive_status+116>:       ld      ra,24(sp)

then, I changed the code in sr_drive_status, adding the printk line, as
shown below:

int sr_drive_status(struct cdrom_device_info *cdi, int slot)
{
        struct scsi_cd *cd = cdi->handle;
        struct scsi_sense_hdr sshdr;
        struct media_event_desc med;

        if (CDSL_CURRENT != slot) {
                /* we have no changer support */
                return -EINVAL;
        }
        if (0 == sr_test_unit_ready(cd->device, &sshdr))
                return CDS_DISC_OK;

printk(KERN_INFO "sr_drive_status() cdi=0x%p, cd=0x%p\n", cdi, cd);

        if (!cdrom_get_media_event(cdi, &med)) {
                if (med.media_present)
                        return CDS_DISC_OK;
[...]

and now, I cannot reproduce any oops.

The new assembly code is:

0xffffffff80246060 <sr_drive_status+0>: daddiu  sp,sp,-48
0xffffffff80246064 <sr_drive_status+4>: lui     v0,0x7fff
0xffffffff80246068 <sr_drive_status+8>: sd      s0,16(sp)
0xffffffff8024606c <sr_drive_status+12>:        sd      ra,32(sp)
0xffffffff80246070 <sr_drive_status+16>:        sd      s1,24(sp)
0xffffffff80246074 <sr_drive_status+20>:        ori     v0,v0,0xffff
0xffffffff80246078 <sr_drive_status+24>:        move    s0,a0
0xffffffff8024607c <sr_drive_status+28>:        bne     a1,v0,0xffffffff80246108 <sr_drive_status+168>
0xffffffff80246080 <sr_drive_status+32>:        ld      s1,24(a0)
0xffffffff80246084 <sr_drive_status+36>:        ld      a0,16(s1)
0xffffffff80246088 <sr_drive_status+40>:        jal     0xffffffff80244c70 <sr_test_unit_ready>
0xffffffff8024608c <sr_drive_status+44>:        daddiu  a1,sp,4
0xffffffff80246090 <sr_drive_status+48>:        bnez    v0,0xffffffff802460b0 <sr_drive_status+80>
0xffffffff80246094 <sr_drive_status+52>:        lui     a0,0x803c
0xffffffff80246098 <sr_drive_status+56>:        li      v0,4
0xffffffff8024609c <sr_drive_status+60>:        ld      ra,32(sp)
0xffffffff802460a0 <sr_drive_status+64>:        ld      s1,24(sp)
0xffffffff802460a4 <sr_drive_status+68>:        ld      s0,16(sp)
0xffffffff802460a8 <sr_drive_status+72>:        jr      ra
0xffffffff802460ac <sr_drive_status+76>:        daddiu  sp,sp,48
0xffffffff802460b0 <sr_drive_status+80>:        daddiu  a0,a0,-4560
0xffffffff802460b4 <sr_drive_status+84>:        move    a1,s0
0xffffffff802460b8 <sr_drive_status+88>:        jal     0xffffffff80032ba8 <printk>
0xffffffff802460bc <sr_drive_status+92>:        move    a2,s1
0xffffffff802460c0 <sr_drive_status+96>:        move    a0,s0
0xffffffff802460c4 <sr_drive_status+100>:       jal     0xffffffff8024c858 <cdrom_get_media_event>
0xffffffff802460c8 <sr_drive_status+104>:       move    a1,sp
0xffffffff802460cc <sr_drive_status+108>:       bnez    v0,0xffffffff80246120 <sr_drive_status+192>
0xffffffff802460d0 <sr_drive_status+112>:       lhu     v0,0(sp)

the gcc I am using in versione 4.1.2. Any help is really appreciated.

Thanks,
Giuseppe


From tsbogend@alpha.franken.de Sun Mar 16 23:36:27 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 16 Mar 2008 23:36:29 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:55776 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28599069AbYCPXg1 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sun, 16 Mar 2008 23:36:27 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1Jb2Ow-00081Q-00; Mon, 17 Mar 2008 00:36:26 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id 741F4C2270; Mon, 17 Mar 2008 00:36:19 +0100 (CET)
Date:	Mon, 17 Mar 2008 00:36:19 +0100
To:	Giuseppe Sacco <giuseppe@eppesuigoccas.homedns.org>
Cc:	linux-mips@linux-mips.org
Subject: Re: Compiler error? [was: Re: new kernel oops in recent kernels]
Message-ID: <20080316233619.GA29511@alpha.franken.de>
References: <1205664563.3050.4.camel@localhost> <1205699257.4159.14.camel@casa>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1205699257.4159.14.camel@casa>
User-Agent: Mutt/1.5.13 (2006-08-11)
From:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Return-Path: <tsbogend@alpha.franken.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: 18407
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips

On Sun, Mar 16, 2008 at 09:27:37PM +0100, Giuseppe Sacco wrote:
> the gcc I am using in versione 4.1.2. Any help is really appreciated.

4.2.1 generates nearly the same (reasonable) code. The major difference
between the version with printk and the version without is the size
of the local stack. I guess this prevents killing of *cd.
Could you try the hack below and tell me, if it helps ? This hack
ensures, that the buffer given to the scsi driver is one cache
line big (at least on R5k O2s). If this helps, there are more
places to fix for non-coherent machines...

Thomas.

diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 12f5bae..acb98a8 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -482,7 +482,7 @@ int cdrom_get_media_event(struct cdrom_device_info *cdi,
 			  struct media_event_desc *med)
 {
 	struct packet_command cgc;
-	unsigned char buffer[8];
+	unsigned char buffer[32];
 	struct event_header *eh = (struct event_header *) buffer;
 
 	init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ);




-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

From horms@verge.net.au Mon Mar 17 01:26:01 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 17 Mar 2008 01:26:04 +0000 (GMT)
Received: from koto.vergenet.net ([210.128.90.7]:4243 "EHLO koto.vergenet.net")
	by ftp.linux-mips.org with ESMTP id S28599168AbYCQB0B (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 17 Mar 2008 01:26:01 +0000
Received: from tabatha.lab.ultramonkey.org (vagw.valinux.co.jp [210.128.90.14])
	by koto.vergenet.net (Postfix) with ESMTP id 1D94A341B6;
	Mon, 17 Mar 2008 10:25:50 +0900 (JST)
Received: by tabatha.lab.ultramonkey.org (Postfix, from userid 7100)
	id 3A1D34FA83; Mon, 17 Mar 2008 10:25:49 +0900 (JST)
Subject: [patch] kexec-tools: mips: support big-endian mips (repost)
Date:	Mon, 17 Mar 2008 10:25:43 +0900
To:	kexec@lists.infradead.org, linux-mips@linux-mips.org
Cc:	Tomasz Chmielewski <mangoo@wpkg.org>
From:	Simon Horman <horms@verge.net.au>
Message-Id: <20080317012550.3A1D34FA83@tabatha.lab.ultramonkey.org>
Return-Path: <horms@verge.net.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: 18408
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: horms@verge.net.au
Precedence: bulk
X-list: linux-mips

[ Reposted with correct linux-mips address ]

Hi,

this patch switches the mips support in kexec-tools around a little bit.
All the files and directories containing "mipsel" have been renamed
to contain "mips" instead.

This is kind of consistent with the way that ARCH=mips in the kernel
works for both big and little endian.

After a small amount of tweaking, which is also included in this patch, the
code compiles and works fine for big endian mips as well as small endian
mips. All you need to do is compile using an appropriate compiler.

That is to say, kexec-tools's build system doesn't need to
be told about which endienness the code is being compiled for.

I have added kept mipsel as a supported "architecture" via ./configure,
though its just an alias for mips now. This is consistent with how
other architectures such as sh are treated. But I'm happy to remove
mipsel from ./configure if the mips people want that.

I tested this patch using qemu and the 2.6.24.3 tag of the mips-2.6 git
tree compiled for the qemu machine type for both big and little endian.
The qemu machine type has subsequently been removed, and kexec-tools
needs some work in order to function with qemu - as far as I understand
the way the boot parameters are passed needs to be fixed, likely
in purgatory. However, this is not related to the changes
introduced in this patch.

I intend to merge this patch into kexec-tools-testing if
no alarm bells are sounded.

Signed-off-by: Simon Horman <horms@verge.net.au>

--- 

 configure.ac                             |    5 
 kexec/Makefile                           |    2 
 kexec/arch/mips/Makefile                 |   12 +
 kexec/arch/mips/include/arch/options.h   |   11 +
 kexec/arch/mips/kexec-elf-mips.c         |  183 +++++++++++++++++++++++++++++
 kexec/arch/mips/kexec-elf-rel-mips.c     |   42 ++++++
 kexec/arch/mips/kexec-mips.c             |  188 ++++++++++++++++++++++++++++++
 kexec/arch/mips/kexec-mips.h             |   17 ++
 kexec/arch/mips/mips-setup-simple.S      |  110 +++++++++++++++++
 kexec/arch/mipsel/Makefile               |   12 -
 kexec/arch/mipsel/include/arch/options.h |   11 -
 kexec/arch/mipsel/kexec-elf-mipsel.c     |  183 -----------------------------
 kexec/arch/mipsel/kexec-elf-rel-mipsel.c |   42 ------
 kexec/arch/mipsel/kexec-mipsel.c         |  188 ------------------------------
 kexec/arch/mipsel/kexec-mipsel.h         |   17 --
 kexec/arch/mipsel/mipsel-setup-simple.S  |  110 -----------------
 kexec/kexec-syscall.h                    |    2 
 purgatory/Makefile                       |    2 
 purgatory/arch/mips/Makefile             |   11 +
 purgatory/arch/mips/console-mips.c       |    5 
 purgatory/arch/mips/purgatory-mips.c     |    7 +
 purgatory/arch/mips/purgatory-mips.h     |    6 
 purgatory/arch/mipsel/Makefile           |   11 -
 purgatory/arch/mipsel/console-mipsel.c   |    5 
 purgatory/arch/mipsel/purgatory-mipsel.c |    7 -
 purgatory/arch/mipsel/purgatory-mipsel.h |    6 
 26 files changed, 599 insertions(+), 596 deletions(-)
Index: kexec-tools-testing-mips/configure.ac
===================================================================
--- kexec-tools-testing-mips.orig/configure.ac	2008-03-12 16:03:32.000000000 +0900
+++ kexec-tools-testing-mips/configure.ac	2008-03-12 16:03:40.000000000 +0900
@@ -38,7 +38,10 @@ case $target_cpu in
 	sh4|sh4a|sh3|sh )
 		ARCH="sh"
 		;;
-	ia64|x86_64|alpha|mipsel )
+	mips|mipsel )
+		ARCH="mips"
+		;;
+	ia64|x86_64|alpha )
 		ARCH="$target_cpu"
 		;;
 	* )
Index: kexec-tools-testing-mips/kexec/kexec-syscall.h
===================================================================
--- kexec-tools-testing-mips.orig/kexec/kexec-syscall.h	2008-03-12 16:03:32.000000000 +0900
+++ kexec-tools-testing-mips/kexec/kexec-syscall.h	2008-03-12 16:03:40.000000000 +0900
@@ -49,7 +49,7 @@
 #ifdef __arm__
 #define __NR_kexec_load		__NR_SYSCALL_BASE + 347  
 #endif
-#ifdef __MIPSEL__
+#if defined(__mips__)
 #define __NR_kexec_load                4311
 #endif
 #ifndef __NR_kexec_load
Index: kexec-tools-testing-mips/kexec/Makefile
===================================================================
--- kexec-tools-testing-mips.orig/kexec/Makefile	2008-03-12 16:09:53.000000000 +0900
+++ kexec-tools-testing-mips/kexec/Makefile	2008-03-12 16:10:05.000000000 +0900
@@ -33,7 +33,7 @@ include $(srcdir)/kexec/arch/alpha/Makef
 include $(srcdir)/kexec/arch/arm/Makefile
 include $(srcdir)/kexec/arch/i386/Makefile
 include $(srcdir)/kexec/arch/ia64/Makefile
-include $(srcdir)/kexec/arch/mipsel/Makefile
+include $(srcdir)/kexec/arch/mips/Makefile
 include $(srcdir)/kexec/arch/ppc/Makefile
 include $(srcdir)/kexec/arch/ppc64/Makefile
 include $(srcdir)/kexec/arch/s390/Makefile
Index: kexec-tools-testing-mips/kexec/arch/mips/Makefile
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-testing-mips/kexec/arch/mips/Makefile	2008-03-12 16:07:53.000000000 +0900
@@ -0,0 +1,12 @@
+#
+# kexec mips (linux booting linux)
+#
+mips_KEXEC_SRCS =  kexec/arch/mips/kexec-mips.c
+mips_KEXEC_SRCS += kexec/arch/mips/kexec-elf-mips.c
+mips_KEXEC_SRCS += kexec/arch/mips/kexec-elf-rel-mips.c
+mips_KEXEC_SRCS += kexec/arch/mips/mips-setup-simple.S
+
+dist += kexec/arch/mips/Makefile $(mips_KEXEC_SRCS)			\
+	kexec/arch/mips/kexec-mips.h					\
+	kexec/arch/mips/include/arch/options.h
+
Index: kexec-tools-testing-mips/kexec/arch/mips/include/arch/options.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-testing-mips/kexec/arch/mips/include/arch/options.h	2008-03-12 16:03:32.000000000 +0900
@@ -0,0 +1,11 @@
+#ifndef KEXEC_ARCH_MIPS_OPTIONS_H
+#define KEXEC_ARCH_MIPS_OPTIONS_H
+
+#define OPT_ARCH_MAX   (OPT_MAX+0)
+
+#define KEXEC_ARCH_OPTIONS \
+	KEXEC_OPTIONS \
+
+#define KEXEC_ARCH_OPT_STR KEXEC_OPT_STR ""
+
+#endif /* KEXEC_ARCH_MIPS_OPTIONS_H */
Index: kexec-tools-testing-mips/kexec/arch/mips/kexec-elf-mips.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-testing-mips/kexec/arch/mips/kexec-elf-mips.c	2008-03-12 16:08:22.000000000 +0900
@@ -0,0 +1,183 @@
+/*
+ * kexec-elf-mips.c - kexec Elf loader for mips
+ * Copyright (C) 2007 Francesco Chiechi, Alessandro Rubini
+ * Copyright (C) 2007 Tvblob s.r.l.
+ *
+ * derived from ../ppc/kexec-elf-ppc.c
+ * Copyright (C) 2004 Albert Herranz
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2.  See the file COPYING for more details.
+*/
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <getopt.h>
+#include <elf.h>
+#include <boot/elf_boot.h>
+#include <ip_checksum.h>
+#include "../../kexec.h"
+#include "../../kexec-elf.h"
+#include "kexec-mips.h"
+#include <arch/options.h>
+
+static const int probe_debug = 0;
+
+#define BOOTLOADER         "kexec"
+#define MAX_COMMAND_LINE   256
+
+#define UPSZ(X) ((sizeof(X) + 3) & ~3)
+static struct boot_notes {
+	Elf_Bhdr hdr;
+	Elf_Nhdr bl_hdr;
+	unsigned char bl_desc[UPSZ(BOOTLOADER)];
+	Elf_Nhdr blv_hdr;
+	unsigned char blv_desc[UPSZ(BOOTLOADER_VERSION)];
+	Elf_Nhdr cmd_hdr;
+	unsigned char command_line[0];
+} elf_boot_notes = {
+	.hdr = {
+		.b_signature = 0x0E1FB007,
+		.b_size = sizeof(elf_boot_notes),
+		.b_checksum = 0,
+		.b_records = 3,
+	},
+	.bl_hdr = {
+		.n_namesz = 0,
+		.n_descsz = sizeof(BOOTLOADER),
+		.n_type = EBN_BOOTLOADER_NAME,
+	},
+	.bl_desc = BOOTLOADER,
+	.blv_hdr = {
+		.n_namesz = 0,
+		.n_descsz = sizeof(BOOTLOADER_VERSION),
+		.n_type = EBN_BOOTLOADER_VERSION,
+	},
+	.blv_desc = BOOTLOADER_VERSION,
+	.cmd_hdr = {
+		.n_namesz = 0,
+		.n_descsz = 0,
+		.n_type = EBN_COMMAND_LINE,
+	},
+};
+
+
+#define OPT_APPEND	(OPT_ARCH_MAX+0)
+
+int elf_mips_probe(const char *buf, off_t len)
+{
+
+	struct mem_ehdr ehdr;
+	int result;
+	result = build_elf_exec_info(buf, len, &ehdr, 0);
+	if (result < 0) {
+		goto out;
+	}
+
+	/* Verify the architecuture specific bits */
+	if (ehdr.e_machine != EM_MIPS) {
+		/* for a different architecture */
+		if (probe_debug) {
+			fprintf(stderr, "Not for this architecture.\n");
+		}
+		result = -1;
+		goto out;
+	}
+	result = 0;
+ out:
+	free_elf_info(&ehdr);
+	return result;
+}
+
+void elf_mips_usage(void)
+{
+	printf("    --command-line=STRING Set the kernel command line to "
+			"STRING.\n"
+	       "    --append=STRING       Set the kernel command line to "
+			"STRING.\n");
+}
+
+int elf_mips_load(int argc, char **argv, const char *buf, off_t len,
+	struct kexec_info *info)
+{
+	struct mem_ehdr ehdr;
+	char *arg_buf;
+	size_t arg_bytes;
+	unsigned long arg_base;
+	struct boot_notes *notes;
+	size_t note_bytes;
+	const char *command_line;
+	int command_line_len;
+	unsigned char *setup_start;
+	uint32_t setup_size;
+	int opt;
+	static const struct option options[] = {
+		KEXEC_ARCH_OPTIONS
+		{"command-line", 1, 0, OPT_APPEND},
+		{"append",       1, 0, OPT_APPEND},
+		{0, 0, 0, 0},
+	};
+
+	static const char short_options[] = KEXEC_ARCH_OPT_STR "d";
+
+	command_line = 0;
+	while ((opt = getopt_long(argc, argv, short_options,
+				  options, 0)) != -1) {
+		switch (opt) {
+		default:
+			/* Ignore core options */
+			if (opt < OPT_ARCH_MAX) {
+				break;
+			}
+		case '?':
+			usage();
+			return -1;
+		case OPT_APPEND:
+			command_line = optarg;
+			break;
+		}
+	}
+	command_line_len = 0;
+	setup_simple_regs.spr9 = 0;
+	if (command_line) {
+		command_line_len = strlen(command_line) + 1;
+		setup_simple_regs.spr9 = 2;
+	}
+
+	/* Load the ELF executable */
+	elf_exec_build_load(info, &ehdr, buf, len, 0);
+
+	setup_start = setup_simple_start;
+	setup_size = setup_simple_size;
+	setup_simple_regs.spr8 = ehdr.e_entry;
+
+	note_bytes = sizeof(elf_boot_notes) + ((command_line_len + 3) & ~3);
+	arg_bytes = note_bytes + ((setup_size + 3) & ~3);
+
+	arg_buf = xmalloc(arg_bytes);
+	arg_base = add_buffer_virt(info,
+		 arg_buf, arg_bytes, arg_bytes, 4, 0, elf_max_addr(&ehdr), 1);
+
+	notes = (struct boot_notes *)(arg_buf + ((setup_size + 3) & ~3));
+
+	memcpy(arg_buf, setup_start, setup_size);
+	memcpy(notes, &elf_boot_notes, sizeof(elf_boot_notes));
+	memcpy(notes->command_line, command_line, command_line_len);
+
+	notes->hdr.b_size = note_bytes;
+	notes->cmd_hdr.n_descsz = command_line_len;
+	notes->hdr.b_checksum = compute_ip_checksum(notes, note_bytes);
+
+	info->entry = (void *)arg_base;
+
+	return 0;
+}
+
Index: kexec-tools-testing-mips/kexec/arch/mips/kexec-elf-rel-mips.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-testing-mips/kexec/arch/mips/kexec-elf-rel-mips.c	2008-03-12 16:08:27.000000000 +0900
@@ -0,0 +1,42 @@
+/*
+ * kexec-elf-rel-mips.c - kexec Elf relocation routines
+ * Copyright (C) 2007 Francesco Chiechi, Alessandro Rubini
+ * Copyright (C) 2007 Tvblob s.r.l.
+ *
+ * derived from ../ppc/kexec-elf-rel-ppc.c
+ * Copyright (C) 2004 Albert Herranz
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2.  See the file COPYING for more details.
+*/
+
+#include <stdio.h>
+#include <elf.h>
+#include "../../kexec.h"
+#include "../../kexec-elf.h"
+
+int machine_verify_elf_rel(struct mem_ehdr *ehdr)
+{
+	if (ehdr->ei_data != ELFDATA2MSB) {
+		return 0;
+	}
+	if (ehdr->ei_class != ELFCLASS32) {
+		return 0;
+	}
+	if (ehdr->e_machine != EM_MIPS) {
+		return 0;
+	}
+	return 1;
+}
+
+void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type,
+	void *location, unsigned long address, unsigned long value)
+{
+	switch(r_type) {
+
+	default:
+		die("Unknown rela relocation: %lu\n", r_type);
+		break;
+	}
+	return;
+}
Index: kexec-tools-testing-mips/kexec/arch/mips/kexec-mips.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-testing-mips/kexec/arch/mips/kexec-mips.c	2008-03-12 16:08:47.000000000 +0900
@@ -0,0 +1,188 @@
+/*
+ * kexec-mips.c - kexec for mips
+ * Copyright (C) 2007 Francesco Chiechi, Alessandro Rubini
+ * Copyright (C) 2007 Tvblob s.r.l.
+ *
+ * derived from ../ppc/kexec-mips.c
+ * Copyright (C) 2004, 2005 Albert Herranz
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2.  See the file COPYING for more details.
+ */
+
+#include <stddef.h>
+#include <stdio.h>
+#include <errno.h>
+#include <stdint.h>
+#include <string.h>
+#include <getopt.h>
+#include <sys/utsname.h>
+#include "../../kexec.h"
+#include "../../kexec-syscall.h"
+#include "kexec-mips.h"
+#include <arch/options.h>
+
+#define MAX_MEMORY_RANGES  64
+#define MAX_LINE          160
+static struct memory_range memory_range[MAX_MEMORY_RANGES];
+
+/* Return a sorted list of memory ranges. */
+int get_memory_ranges(struct memory_range **range, int *ranges, unsigned long kexec_flags)
+{
+	int memory_ranges = 0;
+
+#if 1
+	/* this is valid for gemini2 platform based on tx4938
+	 * in our case, /proc/iomem doesn't report ram space
+	 */
+	 memory_range[memory_ranges].start = 0x00000000;
+	 memory_range[memory_ranges].end = 0x04000000;
+	 memory_range[memory_ranges].type = RANGE_RAM;
+	 memory_ranges++;
+#else
+#error Please, fix this for your platform
+	const char iomem[] = "/proc/iomem";
+	char line[MAX_LINE];
+	FILE *fp;
+	unsigned long long start, end;
+	char *str;
+	int type, consumed, count;
+
+	fp = fopen(iomem, "r");
+	if (!fp) {
+		fprintf(stderr, "Cannot open %s: %s\n", iomem, strerror(errno));
+		return -1;
+	}
+	while (fgets(line, sizeof(line), fp) != 0) {
+		if (memory_ranges >= MAX_MEMORY_RANGES)
+			break;
+		count = sscanf(line, "%Lx-%Lx : %n", &start, &end, &consumed);
+		if (count != 2)
+			continue;
+		str = line + consumed;
+		end = end + 1;
+#if 0
+		printf("%016Lx-%016Lx : %s\n", start, end, str);
+#endif
+		if (memcmp(str, "System RAM\n", 11) == 0) {
+			type = RANGE_RAM;
+		} else if (memcmp(str, "reserved\n", 9) == 0) {
+			type = RANGE_RESERVED;
+		} else if (memcmp(str, "ACPI Tables\n", 12) == 0) {
+			type = RANGE_ACPI;
+		} else if (memcmp(str, "ACPI Non-volatile Storage\n", 26) == 0) {
+			type = RANGE_ACPI_NVS;
+		} else {
+			continue;
+		}
+		memory_range[memory_ranges].start = start;
+		memory_range[memory_ranges].end = end;
+		memory_range[memory_ranges].type = type;
+#if 0
+		printf("%016Lx-%016Lx : %x\n", start, end, type);
+#endif
+		memory_ranges++;
+	}
+	fclose(fp);
+#endif
+
+	*range = memory_range;
+	*ranges = memory_ranges;
+	return 0;
+}
+
+struct file_type file_type[] = {
+	{"elf-mips", elf_mips_probe, elf_mips_load, elf_mips_usage},
+};
+int file_types = sizeof(file_type) / sizeof(file_type[0]);
+
+void arch_usage(void)
+{
+}
+
+int arch_process_options(int argc, char **argv)
+{
+	static const struct option options[] = {
+		KEXEC_ARCH_OPTIONS
+		{ 0,                    0, NULL, 0 },
+	};
+	static const char short_options[] = KEXEC_ARCH_OPT_STR;
+	int opt;
+
+	opterr = 0; /* Don't complain about unrecognized options here */
+	while((opt = getopt_long(argc, argv, short_options, options, 0)) != -1) {
+		switch(opt) {
+		default:
+			break;
+		}
+	}
+	/* Reset getopt for the next pass; called in other source modules */
+	opterr = 1;
+	optind = 1;
+	return 0;
+}
+
+int arch_compat_trampoline(struct kexec_info *info)
+{
+	int result;
+	struct utsname utsname;
+	result = uname(&utsname);
+	if (result < 0) {
+		fprintf(stderr, "uname failed: %s\n",
+			strerror(errno));
+		return -1;
+	}
+	 if (strcmp(utsname.machine, "mips") == 0)
+	 {
+		 /* For compatibility with older patches
+		  * use KEXEC_ARCH_DEFAULT instead of KEXEC_ARCH_MIPS here.
+		  */
+		info->kexec_flags |= KEXEC_ARCH_DEFAULT;
+	 }
+	else {
+		fprintf(stderr, "Unsupported machine type: %s\n",
+			utsname.machine);
+		return -1;
+	}
+	return 0;
+}
+
+void arch_update_purgatory(struct kexec_info *info)
+{
+}
+
+/*
+ * Adding a dummy function, so that build on mips will not break.
+ * Need to implement the actual checking code
+ */
+int is_crashkernel_mem_reserved(void)
+{
+	return 1;
+}
+
+unsigned long virt_to_phys(unsigned long addr)
+{
+	return addr - 0x80000000;
+}
+
+/*
+ * add_segment() should convert base to a physical address on mips,
+ * while the default is just to work with base as is */
+void add_segment(struct kexec_info *info, const void *buf, size_t bufsz,
+		 unsigned long base, size_t memsz)
+{
+	add_segment_phys_virt(info, buf, bufsz, base, memsz, 1);
+}
+
+/*
+ * add_buffer() should convert base to a physical address on mips,
+ * while the default is just to work with base as is */
+unsigned long add_buffer(struct kexec_info *info, const void *buf,
+			 unsigned long bufsz, unsigned long memsz,
+			 unsigned long buf_align, unsigned long buf_min,
+			 unsigned long buf_max, int buf_end)
+{
+	return add_buffer_phys_virt(info, buf, bufsz, memsz, buf_align,
+				    buf_min, buf_max, buf_end, 1);
+}
+
Index: kexec-tools-testing-mips/kexec/arch/mips/kexec-mips.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-testing-mips/kexec/arch/mips/kexec-mips.h	2008-03-12 16:08:52.000000000 +0900
@@ -0,0 +1,17 @@
+#ifndef KEXEC_MIPS_H
+#define KEXEC_MIPS_H
+
+extern unsigned char setup_simple_start[];
+extern uint32_t setup_simple_size;
+
+extern struct {
+	uint32_t spr8;
+	uint32_t spr9;
+} setup_simple_regs;
+
+int elf_mips_probe(const char *buf, off_t len);
+int elf_mips_load(int argc, char **argv, const char *buf, off_t len,
+	struct kexec_info *info);
+void elf_mips_usage(void);
+
+#endif /* KEXEC_MIPS_H */
Index: kexec-tools-testing-mips/kexec/arch/mips/mips-setup-simple.S
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-testing-mips/kexec/arch/mips/mips-setup-simple.S	2008-03-12 16:09:09.000000000 +0900
@@ -0,0 +1,110 @@
+/*
+ * mips-setup-simple.S - code to execute before kernel to handle command line
+ * Copyright (C) 2007 Francesco Chiechi, Alessandro Rubini
+ * Copyright (C) 2007 Tvblob s.r.l.
+ *
+ * derived from Albert Herranz idea (ppc) adding command line support
+ * (boot_notes structure)
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2.  See the file COPYING for more details.
+ */
+
+/*
+ * Only suitable for platforms booting with MMU turned off.
+ * -- Albert Herranz
+ */
+#include "regdef.h"
+
+/* returns  t0 = relocated address of sym */
+/* modifies t1 t2 */
+/* sym must not be global or this will not work (at least AFAIK up to now) */
+#define RELOC_SYM(sym)                                                 \
+	move    t0,ra;          /* save ra */                           \
+	bal 1f;                                                         \
+1:                                                                     \
+	move    t1,ra;          /* now t1 is 1b (where we are now) */   \
+	move    ra,t0;          /* restore ra */                        \
+	lui     t2,%hi(1b);                                             \
+	ori     t2,t2,%lo(1b);                                          \
+	lui     t0,%hi(sym);                                            \
+	ori     t0,t0,%lo(sym);                                         \
+	sub     t0,t0,t2;       /* t0 = offset between sym and 1b */    \
+	add     t0,t1,t0;       /* t0 = actual address in memory */
+
+	.data
+	.globl setup_simple_start
+setup_simple_start:
+
+	/* should perform here any required setup */
+
+	/* Initialize GOT pointer (verify if needed) */
+	bal     1f
+	nop
+	.word   _GLOBAL_OFFSET_TABLE_
+	1:
+	move    gp, ra
+	lw      t1, 0(ra)
+	move    gp, t1
+
+	/* spr8 relocation */
+	RELOC_SYM(spr8)
+
+	move    t4,t0           // save pointer to kernel start addr
+	lw      t3,0(t0)        // save kernel start address
+
+	/* spr9 relocation */
+	RELOC_SYM(spr9)
+	lw      a0,0(t0)        // load argc
+
+	// this code is to be changed if boot_notes struct changes
+	lw      t2,12(t4)       // t2 is size of boot_notes struct
+	addi    t2,t2,3
+	srl     t2,t2,2
+	sll     v1,t2,2         // v1 = size of boot_notes struct
+				// aligned to word boundary
+
+	addi    t0,t4,0x20      // t0 contains the address of "kexec" string
+	add     v0,t4,v1        // v0 points to last word of boot_notes
+	addi    v0,v0,8         // v0 points to address after boot_notes
+	sw      t0,0(v0)        // store pointer to "kexec" string there
+
+	lw      t2,-8(t0)       // t2 is size of "kexec" string in bytes
+	addi    t2,t2,3
+	srl     t2,t2,2
+	sll     v1,t2,2         // v1 = size of "kexec" string
+				// aligned to word boundary
+	add     t2,t0,v1
+	addi    t0,t2,4         // t0 points to size of version string
+
+	lw      t2,0(t0)        // t2 is size of version string in bytes
+	addi    t2,t2,3
+	srl     t2,t2,2
+	sll     v1,t2,2         // v1 = size of version string
+				// aligned to word boundary
+
+	addi    t0,t0,8         // t0 points to version string
+	add     t0,t0,v1        // t0 points to start of command_line record
+	addi    t0,t0,12        // t0 points command line
+
+	sw      t0,4(v0)        // store pointer to command line
+
+	move    a1,v0           // load argv
+	li      a2,0
+	li      a3,0
+
+	jr      t3
+	nop
+
+	.balign 4
+	.globl setup_simple_regs
+setup_simple_regs:
+spr8:	.long 0x00000000
+spr9:	.long 0x00000000
+
+setup_simple_end:
+
+	.globl setup_simple_size
+setup_simple_size:
+	.long setup_simple_end - setup_simple_start
+
Index: kexec-tools-testing-mips/kexec/arch/mipsel/Makefile
===================================================================
--- kexec-tools-testing-mips.orig/kexec/arch/mipsel/Makefile	2008-03-12 16:04:20.000000000 +0900
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,12 +0,0 @@
-#
-# kexec mipsel (linux booting linux)
-#
-mipsel_KEXEC_SRCS =  kexec/arch/mipsel/kexec-mipsel.c
-mipsel_KEXEC_SRCS += kexec/arch/mipsel/kexec-elf-mipsel.c
-mipsel_KEXEC_SRCS += kexec/arch/mipsel/kexec-elf-rel-mipsel.c
-mipsel_KEXEC_SRCS += kexec/arch/mipsel/mipsel-setup-simple.S
-
-dist += kexec/arch/mipsel/Makefile $(mipsel_KEXEC_SRCS)			\
-	kexec/arch/mipsel/kexec-mipsel.h				\
-	kexec/arch/mipsel/include/arch/options.h
-
Index: kexec-tools-testing-mips/kexec/arch/mipsel/include/arch/options.h
===================================================================
--- kexec-tools-testing-mips.orig/kexec/arch/mipsel/include/arch/options.h	2008-03-12 16:04:20.000000000 +0900
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,11 +0,0 @@
-#ifndef KEXEC_ARCH_MIPS_OPTIONS_H
-#define KEXEC_ARCH_MIPS_OPTIONS_H
-
-#define OPT_ARCH_MAX   (OPT_MAX+0)
-
-#define KEXEC_ARCH_OPTIONS \
-	KEXEC_OPTIONS \
-
-#define KEXEC_ARCH_OPT_STR KEXEC_OPT_STR ""
-
-#endif /* KEXEC_ARCH_MIPS_OPTIONS_H */
Index: kexec-tools-testing-mips/kexec/arch/mipsel/kexec-elf-mipsel.c
===================================================================
--- kexec-tools-testing-mips.orig/kexec/arch/mipsel/kexec-elf-mipsel.c	2008-03-12 16:04:20.000000000 +0900
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,183 +0,0 @@
-/*
- * kexec-elf-mipsel.c - kexec Elf loader for mips
- * Copyright (C) 2007 Francesco Chiechi, Alessandro Rubini
- * Copyright (C) 2007 Tvblob s.r.l.
- *
- * derived from ../ppc/kexec-elf-ppc.c
- * Copyright (C) 2004 Albert Herranz
- *
- * This source code is licensed under the GNU General Public License,
- * Version 2.  See the file COPYING for more details.
-*/
-
-#define _GNU_SOURCE
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <getopt.h>
-#include <elf.h>
-#include <boot/elf_boot.h>
-#include <ip_checksum.h>
-#include "../../kexec.h"
-#include "../../kexec-elf.h"
-#include "kexec-mipsel.h"
-#include <arch/options.h>
-
-static const int probe_debug = 0;
-
-#define BOOTLOADER         "kexec"
-#define MAX_COMMAND_LINE   256
-
-#define UPSZ(X) ((sizeof(X) + 3) & ~3)
-static struct boot_notes {
-	Elf_Bhdr hdr;
-	Elf_Nhdr bl_hdr;
-	unsigned char bl_desc[UPSZ(BOOTLOADER)];
-	Elf_Nhdr blv_hdr;
-	unsigned char blv_desc[UPSZ(BOOTLOADER_VERSION)];
-	Elf_Nhdr cmd_hdr;
-	unsigned char command_line[0];
-} elf_boot_notes = {
-	.hdr = {
-		.b_signature = 0x0E1FB007,
-		.b_size = sizeof(elf_boot_notes),
-		.b_checksum = 0,
-		.b_records = 3,
-	},
-	.bl_hdr = {
-		.n_namesz = 0,
-		.n_descsz = sizeof(BOOTLOADER),
-		.n_type = EBN_BOOTLOADER_NAME,
-	},
-	.bl_desc = BOOTLOADER,
-	.blv_hdr = {
-		.n_namesz = 0,
-		.n_descsz = sizeof(BOOTLOADER_VERSION),
-		.n_type = EBN_BOOTLOADER_VERSION,
-	},
-	.blv_desc = BOOTLOADER_VERSION,
-	.cmd_hdr = {
-		.n_namesz = 0,
-		.n_descsz = 0,
-		.n_type = EBN_COMMAND_LINE,
-	},
-};
-
-
-#define OPT_APPEND	(OPT_ARCH_MAX+0)
-
-int elf_mipsel_probe(const char *buf, off_t len)
-{
-
-	struct mem_ehdr ehdr;
-	int result;
-	result = build_elf_exec_info(buf, len, &ehdr, 0);
-	if (result < 0) {
-		goto out;
-	}
-
-	/* Verify the architecuture specific bits */
-	if (ehdr.e_machine != EM_MIPS) {
-		/* for a different architecture */
-		if (probe_debug) {
-			fprintf(stderr, "Not for this architecture.\n");
-		}
-		result = -1;
-		goto out;
-	}
-	result = 0;
- out:
-	free_elf_info(&ehdr);
-	return result;
-}
-
-void elf_mipsel_usage(void)
-{
-	printf("    --command-line=STRING Set the kernel command line to "
-			"STRING.\n"
-	       "    --append=STRING       Set the kernel command line to "
-			"STRING.\n");
-}
-
-int elf_mipsel_load(int argc, char **argv, const char *buf, off_t len,
-	struct kexec_info *info)
-{
-	struct mem_ehdr ehdr;
-	char *arg_buf;
-	size_t arg_bytes;
-	unsigned long arg_base;
-	struct boot_notes *notes;
-	size_t note_bytes;
-	const char *command_line;
-	int command_line_len;
-	unsigned char *setup_start;
-	uint32_t setup_size;
-	int opt;
-	static const struct option options[] = {
-		KEXEC_ARCH_OPTIONS
-		{"command-line", 1, 0, OPT_APPEND},
-		{"append",       1, 0, OPT_APPEND},
-		{0, 0, 0, 0},
-	};
-
-	static const char short_options[] = KEXEC_ARCH_OPT_STR "d";
-
-	command_line = 0;
-	while ((opt = getopt_long(argc, argv, short_options,
-				  options, 0)) != -1) {
-		switch (opt) {
-		default:
-			/* Ignore core options */
-			if (opt < OPT_ARCH_MAX) {
-				break;
-			}
-		case '?':
-			usage();
-			return -1;
-		case OPT_APPEND:
-			command_line = optarg;
-			break;
-		}
-	}
-	command_line_len = 0;
-	setup_simple_regs.spr9 = 0;
-	if (command_line) {
-		command_line_len = strlen(command_line) + 1;
-		setup_simple_regs.spr9 = 2;
-	}
-
-	/* Load the ELF executable */
-	elf_exec_build_load(info, &ehdr, buf, len, 0);
-
-	setup_start = setup_simple_start;
-	setup_size = setup_simple_size;
-	setup_simple_regs.spr8 = ehdr.e_entry;
-
-	note_bytes = sizeof(elf_boot_notes) + ((command_line_len + 3) & ~3);
-	arg_bytes = note_bytes + ((setup_size + 3) & ~3);
-
-	arg_buf = xmalloc(arg_bytes);
-	arg_base = add_buffer_virt(info,
-		 arg_buf, arg_bytes, arg_bytes, 4, 0, elf_max_addr(&ehdr), 1);
-
-	notes = (struct boot_notes *)(arg_buf + ((setup_size + 3) & ~3));
-
-	memcpy(arg_buf, setup_start, setup_size);
-	memcpy(notes, &elf_boot_notes, sizeof(elf_boot_notes));
-	memcpy(notes->command_line, command_line, command_line_len);
-
-	notes->hdr.b_size = note_bytes;
-	notes->cmd_hdr.n_descsz = command_line_len;
-	notes->hdr.b_checksum = compute_ip_checksum(notes, note_bytes);
-
-	info->entry = (void *)arg_base;
-
-	return 0;
-}
-
Index: kexec-tools-testing-mips/kexec/arch/mipsel/kexec-elf-rel-mipsel.c
===================================================================
--- kexec-tools-testing-mips.orig/kexec/arch/mipsel/kexec-elf-rel-mipsel.c	2008-03-12 16:04:20.000000000 +0900
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,42 +0,0 @@
-/*
- * kexec-elf-rel-mipsel.c - kexec Elf relocation routines
- * Copyright (C) 2007 Francesco Chiechi, Alessandro Rubini
- * Copyright (C) 2007 Tvblob s.r.l.
- *
- * derived from ../ppc/kexec-elf-rel-ppc.c
- * Copyright (C) 2004 Albert Herranz
- *
- * This source code is licensed under the GNU General Public License,
- * Version 2.  See the file COPYING for more details.
-*/
-
-#include <stdio.h>
-#include <elf.h>
-#include "../../kexec.h"
-#include "../../kexec-elf.h"
-
-int machine_verify_elf_rel(struct mem_ehdr *ehdr)
-{
-	if (ehdr->ei_data != ELFDATA2MSB) {
-		return 0;
-	}
-	if (ehdr->ei_class != ELFCLASS32) {
-		return 0;
-	}
-	if (ehdr->e_machine != EM_MIPS) {
-		return 0;
-	}
-	return 1;
-}
-
-void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type,
-	void *location, unsigned long address, unsigned long value)
-{
-	switch(r_type) {
-
-	default:
-		die("Unknown rela relocation: %lu\n", r_type);
-		break;
-	}
-	return;
-}
Index: kexec-tools-testing-mips/kexec/arch/mipsel/kexec-mipsel.c
===================================================================
--- kexec-tools-testing-mips.orig/kexec/arch/mipsel/kexec-mipsel.c	2008-03-12 16:04:20.000000000 +0900
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,188 +0,0 @@
-/*
- * kexec-mipsel.c - kexec for mips
- * Copyright (C) 2007 Francesco Chiechi, Alessandro Rubini
- * Copyright (C) 2007 Tvblob s.r.l.
- *
- * derived from ../ppc/kexec-mipsel.c
- * Copyright (C) 2004, 2005 Albert Herranz
- *
- * This source code is licensed under the GNU General Public License,
- * Version 2.  See the file COPYING for more details.
- */
-
-#include <stddef.h>
-#include <stdio.h>
-#include <errno.h>
-#include <stdint.h>
-#include <string.h>
-#include <getopt.h>
-#include <sys/utsname.h>
-#include "../../kexec.h"
-#include "../../kexec-syscall.h"
-#include "kexec-mipsel.h"
-#include <arch/options.h>
-
-#define MAX_MEMORY_RANGES  64
-#define MAX_LINE          160
-static struct memory_range memory_range[MAX_MEMORY_RANGES];
-
-/* Return a sorted list of memory ranges. */
-int get_memory_ranges(struct memory_range **range, int *ranges, unsigned long kexec_flags)
-{
-	int memory_ranges = 0;
-
-#if 1
-	/* this is valid for gemini2 platform based on tx4938
-	 * in our case, /proc/iomem doesn't report ram space
-	 */
-	 memory_range[memory_ranges].start = 0x00000000;
-	 memory_range[memory_ranges].end = 0x04000000;
-	 memory_range[memory_ranges].type = RANGE_RAM;
-	 memory_ranges++;
-#else
-#error Please, fix this for your platform
-	const char iomem[] = "/proc/iomem";
-	char line[MAX_LINE];
-	FILE *fp;
-	unsigned long long start, end;
-	char *str;
-	int type, consumed, count;
-
-	fp = fopen(iomem, "r");
-	if (!fp) {
-		fprintf(stderr, "Cannot open %s: %s\n", iomem, strerror(errno));
-		return -1;
-	}
-	while (fgets(line, sizeof(line), fp) != 0) {
-		if (memory_ranges >= MAX_MEMORY_RANGES)
-			break;
-		count = sscanf(line, "%Lx-%Lx : %n", &start, &end, &consumed);
-		if (count != 2)
-			continue;
-		str = line + consumed;
-		end = end + 1;
-#if 0
-		printf("%016Lx-%016Lx : %s\n", start, end, str);
-#endif
-		if (memcmp(str, "System RAM\n", 11) == 0) {
-			type = RANGE_RAM;
-		} else if (memcmp(str, "reserved\n", 9) == 0) {
-			type = RANGE_RESERVED;
-		} else if (memcmp(str, "ACPI Tables\n", 12) == 0) {
-			type = RANGE_ACPI;
-		} else if (memcmp(str, "ACPI Non-volatile Storage\n", 26) == 0) {
-			type = RANGE_ACPI_NVS;
-		} else {
-			continue;
-		}
-		memory_range[memory_ranges].start = start;
-		memory_range[memory_ranges].end = end;
-		memory_range[memory_ranges].type = type;
-#if 0
-		printf("%016Lx-%016Lx : %x\n", start, end, type);
-#endif
-		memory_ranges++;
-	}
-	fclose(fp);
-#endif
-
-	*range = memory_range;
-	*ranges = memory_ranges;
-	return 0;
-}
-
-struct file_type file_type[] = {
-	{"elf-mipsel", elf_mipsel_probe, elf_mipsel_load, elf_mipsel_usage},
-};
-int file_types = sizeof(file_type) / sizeof(file_type[0]);
-
-void arch_usage(void)
-{
-}
-
-int arch_process_options(int argc, char **argv)
-{
-	static const struct option options[] = {
-		KEXEC_ARCH_OPTIONS
-		{ 0,                    0, NULL, 0 },
-	};
-	static const char short_options[] = KEXEC_ARCH_OPT_STR;
-	int opt;
-
-	opterr = 0; /* Don't complain about unrecognized options here */
-	while((opt = getopt_long(argc, argv, short_options, options, 0)) != -1) {
-		switch(opt) {
-		default:
-			break;
-		}
-	}
-	/* Reset getopt for the next pass; called in other source modules */
-	opterr = 1;
-	optind = 1;
-	return 0;
-}
-
-int arch_compat_trampoline(struct kexec_info *info)
-{
-	int result;
-	struct utsname utsname;
-	result = uname(&utsname);
-	if (result < 0) {
-		fprintf(stderr, "uname failed: %s\n",
-			strerror(errno));
-		return -1;
-	}
-	 if (strcmp(utsname.machine, "mips") == 0)
-	 {
-		 /* For compatibility with older patches
-		  * use KEXEC_ARCH_DEFAULT instead of KEXEC_ARCH_MIPS here.
-		  */
-		info->kexec_flags |= KEXEC_ARCH_DEFAULT;
-	 }
-	else {
-		fprintf(stderr, "Unsupported machine type: %s\n",
-			utsname.machine);
-		return -1;
-	}
-	return 0;
-}
-
-void arch_update_purgatory(struct kexec_info *info)
-{
-}
-
-/*
- * Adding a dummy function, so that build on mipsel will not break.
- * Need to implement the actual checking code
- */
-int is_crashkernel_mem_reserved(void)
-{
-	return 1;
-}
-
-unsigned long virt_to_phys(unsigned long addr)
-{
-	return addr - 0x80000000;
-}
-
-/*
- * add_segment() should convert base to a physical address on mipsel,
- * while the default is just to work with base as is */
-void add_segment(struct kexec_info *info, const void *buf, size_t bufsz,
-		 unsigned long base, size_t memsz)
-{
-	add_segment_phys_virt(info, buf, bufsz, base, memsz, 1);
-}
-
-/*
- * add_buffer() should convert base to a physical address on mipsel,
- * while the default is just to work with base as is */
-unsigned long add_buffer(struct kexec_info *info, const void *buf,
-			 unsigned long bufsz, unsigned long memsz,
-			 unsigned long buf_align, unsigned long buf_min,
-			 unsigned long buf_max, int buf_end)
-{
-	return add_buffer_phys_virt(info, buf, bufsz, memsz, buf_align,
-				    buf_min, buf_max, buf_end, 1);
-}
-
Index: kexec-tools-testing-mips/kexec/arch/mipsel/kexec-mipsel.h
===================================================================
--- kexec-tools-testing-mips.orig/kexec/arch/mipsel/kexec-mipsel.h	2008-03-12 16:04:21.000000000 +0900
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,17 +0,0 @@
-#ifndef KEXEC_MIPS_H
-#define KEXEC_MIPS_H
-
-extern unsigned char setup_simple_start[];
-extern uint32_t setup_simple_size;
-
-extern struct {
-	uint32_t spr8;
-	uint32_t spr9;
-} setup_simple_regs;
-
-int elf_mipsel_probe(const char *buf, off_t len);
-int elf_mipsel_load(int argc, char **argv, const char *buf, off_t len,
-	struct kexec_info *info);
-void elf_mipsel_usage(void);
-
-#endif /* KEXEC_MIPS_H */
Index: kexec-tools-testing-mips/kexec/arch/mipsel/mipsel-setup-simple.S
===================================================================
--- kexec-tools-testing-mips.orig/kexec/arch/mipsel/mipsel-setup-simple.S	2008-03-12 16:04:21.000000000 +0900
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,110 +0,0 @@
-/*
- * mipsel-setup-simple.S - code to execute before kernel to handle command line
- * Copyright (C) 2007 Francesco Chiechi, Alessandro Rubini
- * Copyright (C) 2007 Tvblob s.r.l.
- *
- * derived from Albert Herranz idea (ppc) adding command line support
- * (boot_notes structure)
- *
- * This source code is licensed under the GNU General Public License,
- * Version 2.  See the file COPYING for more details.
- */
-
-/*
- * Only suitable for platforms booting with MMU turned off.
- * -- Albert Herranz
- */
-#include "regdef.h"
-
-/* returns  t0 = relocated address of sym */
-/* modifies t1 t2 */
-/* sym must not be global or this will not work (at least AFAIK up to now) */
-#define RELOC_SYM(sym)                                                 \
-	move    t0,ra;          /* save ra */                           \
-	bal 1f;                                                         \
-1:                                                                     \
-	move    t1,ra;          /* now t1 is 1b (where we are now) */   \
-	move    ra,t0;          /* restore ra */                        \
-	lui     t2,%hi(1b);                                             \
-	ori     t2,t2,%lo(1b);                                          \
-	lui     t0,%hi(sym);                                            \
-	ori     t0,t0,%lo(sym);                                         \
-	sub     t0,t0,t2;       /* t0 = offset between sym and 1b */    \
-	add     t0,t1,t0;       /* t0 = actual address in memory */
-
-	.data
-	.globl setup_simple_start
-setup_simple_start:
-
-	/* should perform here any required setup */
-
-	/* Initialize GOT pointer (verify if needed) */
-	bal     1f
-	nop
-	.word   _GLOBAL_OFFSET_TABLE_
-	1:
-	move    gp, ra
-	lw      t1, 0(ra)
-	move    gp, t1
-
-	/* spr8 relocation */
-	RELOC_SYM(spr8)
-
-	move    t4,t0           // save pointer to kernel start addr
-	lw      t3,0(t0)        // save kernel start address
-
-	/* spr9 relocation */
-	RELOC_SYM(spr9)
-	lw      a0,0(t0)        // load argc
-
-	// this code is to be changed if boot_notes struct changes
-	lw      t2,12(t4)       // t2 is size of boot_notes struct
-	addi    t2,t2,3
-	srl     t2,t2,2
-	sll     v1,t2,2         // v1 = size of boot_notes struct
-				// aligned to word boundary
-
-	addi    t0,t4,0x20      // t0 contains the address of "kexec" string
-	add     v0,t4,v1        // v0 points to last word of boot_notes
-	addi    v0,v0,8         // v0 points to address after boot_notes
-	sw      t0,0(v0)        // store pointer to "kexec" string there
-
-	lw      t2,-8(t0)       // t2 is size of "kexec" string in bytes
-	addi    t2,t2,3
-	srl     t2,t2,2
-	sll     v1,t2,2         // v1 = size of "kexec" string
-				// aligned to word boundary
-	add     t2,t0,v1
-	addi    t0,t2,4         // t0 points to size of version string
-
-	lw      t2,0(t0)        // t2 is size of version string in bytes
-	addi    t2,t2,3
-	srl     t2,t2,2
-	sll     v1,t2,2         // v1 = size of version string
-				// aligned to word boundary
-
-	addi    t0,t0,8         // t0 points to version string
-	add     t0,t0,v1        // t0 points to start of command_line record
-	addi    t0,t0,12        // t0 points command line
-
-	sw      t0,4(v0)        // store pointer to command line
-
-	move    a1,v0           // load argv
-	li      a2,0
-	li      a3,0
-
-	jr      t3
-	nop
-
-	.balign 4
-	.globl setup_simple_regs
-setup_simple_regs:
-spr8:	.long 0x00000000
-spr9:	.long 0x00000000
-
-setup_simple_end:
-
-	.globl setup_simple_size
-setup_simple_size:
-	.long setup_simple_end - setup_simple_start
-
Index: kexec-tools-testing-mips/purgatory/Makefile
===================================================================
--- kexec-tools-testing-mips.orig/purgatory/Makefile	2008-03-12 16:25:28.000000000 +0900
+++ kexec-tools-testing-mips/purgatory/Makefile	2008-03-12 16:25:43.000000000 +0900
@@ -20,7 +20,7 @@ include $(srcdir)/purgatory/arch/alpha/M
 include $(srcdir)/purgatory/arch/arm/Makefile
 include $(srcdir)/purgatory/arch/i386/Makefile
 include $(srcdir)/purgatory/arch/ia64/Makefile
-include $(srcdir)/purgatory/arch/mipsel/Makefile
+include $(srcdir)/purgatory/arch/mips/Makefile
 include $(srcdir)/purgatory/arch/ppc/Makefile
 include $(srcdir)/purgatory/arch/ppc64/Makefile
 include $(srcdir)/purgatory/arch/s390/Makefile
Index: kexec-tools-testing-mips/purgatory/arch/mips/Makefile
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-testing-mips/purgatory/arch/mips/Makefile	2008-03-12 16:30:49.000000000 +0900
@@ -0,0 +1,11 @@
+#
+# Purgatory mips
+#
+
+mips_PURGATORY_SRCS+= purgatory/arch/mips/purgatory-mips.c
+mips_PURGATORY_SRCS+= purgatory/arch/mips/console-mips.c
+
+dist += purgatory/arch/mips/Makefile $(mips_PURGATORY_C_SRCS)		\
+	purgatory/arch/mips/include/limits.h				\
+	purgatory/arch/mips/purgatory-mips.h
+
Index: kexec-tools-testing-mips/purgatory/arch/mips/console-mips.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-testing-mips/purgatory/arch/mips/console-mips.c	2008-03-06 18:50:45.000000000 +0900
@@ -0,0 +1,5 @@
+#include <purgatory.h>
+void putchar(int ch)
+{
+	/* Nothing for now */
+}
Index: kexec-tools-testing-mips/purgatory/arch/mips/purgatory-mips.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-testing-mips/purgatory/arch/mips/purgatory-mips.c	2008-03-12 16:26:44.000000000 +0900
@@ -0,0 +1,7 @@
+#include <purgatory.h>
+#include "purgatory-mips.h"
+
+void setup_arch(void)
+{
+	/* Nothing for now */
+}
Index: kexec-tools-testing-mips/purgatory/arch/mips/purgatory-mips.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools-testing-mips/purgatory/arch/mips/purgatory-mips.h	2008-03-06 18:50:45.000000000 +0900
@@ -0,0 +1,6 @@
+#ifndef PURGATORY_MIPSEL_H
+#define PURGATORY_MIPSEL_H
+
+/* nothing yet */
+
+#endif /* PURGATORY_MIPSEL_H */
Index: kexec-tools-testing-mips/purgatory/arch/mipsel/Makefile
===================================================================
--- kexec-tools-testing-mips.orig/purgatory/arch/mipsel/Makefile	2008-03-12 16:12:57.000000000 +0900
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,11 +0,0 @@
-#
-# Purgatory mipsel
-#
-
-mipsel_PURGATORY_C_SRCS+= purgatory/arch/mipsel/purgatory-mipsel.c
-mipsel_PURGATORY_C_SRCS+= purgatory/arch/mipsel/console-mipsel.c
-
-dist += purgatory/arch/mipsel/Makefile $(mipsel_PURGATORY_C_SRCS)	\
-	purgatory/arch/mipsel/include/limits.h				\
-	purgatory/arch/mipsel/purgatory-mipsel.h
-
Index: kexec-tools-testing-mips/purgatory/arch/mipsel/console-mipsel.c
===================================================================
--- kexec-tools-testing-mips.orig/purgatory/arch/mipsel/console-mipsel.c	2008-03-12 16:12:56.000000000 +0900
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,5 +0,0 @@
-#include <purgatory.h>
-void putchar(int ch)
-{
-	/* Nothing for now */
-}
Index: kexec-tools-testing-mips/purgatory/arch/mipsel/purgatory-mipsel.c
===================================================================
--- kexec-tools-testing-mips.orig/purgatory/arch/mipsel/purgatory-mipsel.c	2008-03-12 16:12:58.000000000 +0900
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,7 +0,0 @@
-#include <purgatory.h>
-#include "purgatory-mipsel.h"
-
-void setup_arch(void)
-{
-	/* Nothing for now */
-}
Index: kexec-tools-testing-mips/purgatory/arch/mipsel/purgatory-mipsel.h
===================================================================
--- kexec-tools-testing-mips.orig/purgatory/arch/mipsel/purgatory-mipsel.h	2008-03-12 16:12:59.000000000 +0900
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,6 +0,0 @@
-#ifndef PURGATORY_MIPSEL_H
-#define PURGATORY_MIPSEL_H
-
-/* nothing yet */
-
-#endif /* PURGATORY_MIPSEL_H */

From giuseppe@eppesuigoccas.homedns.org Mon Mar 17 08:05:40 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 17 Mar 2008 08:05:42 +0000 (GMT)
Received: from host194-211-dynamic.20-79-r.retail.telecomitalia.it ([79.20.211.194]:4491
	"EHLO eppesuigoccas.homedns.org") by ftp.linux-mips.org with ESMTP
	id S28599661AbYCQIFk (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 17 Mar 2008 08:05:40 +0000
Received: from router-wag54gp2 ([192.168.1.33] helo=[192.168.2.7])
	by eppesuigoccas.homedns.org with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.63)
	(envelope-from <giuseppe@eppesuigoccas.homedns.org>)
	id 1JbALY-0001GQ-EY; Mon, 17 Mar 2008 09:05:30 +0100
Subject: Re: Compiler error? [was: Re: new kernel oops in recent kernels]
From:	Giuseppe Sacco <giuseppe@eppesuigoccas.homedns.org>
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc:	linux-mips@linux-mips.org
In-Reply-To: <20080316233619.GA29511@alpha.franken.de>
References: <1205664563.3050.4.camel@localhost>
	 <1205699257.4159.14.camel@casa>  <20080316233619.GA29511@alpha.franken.de>
Content-Type: text/plain
Date:	Mon, 17 Mar 2008 09:05:42 +0100
Message-Id: <1205741142.3515.2.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 2.12.3 
Content-Transfer-Encoding: 7bit
Return-Path: <giuseppe@eppesuigoccas.homedns.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: 18409
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: giuseppe@eppesuigoccas.homedns.org
Precedence: bulk
X-list: linux-mips

Hi Thomas,

Il giorno lun, 17/03/2008 alle 00.36 +0100, Thomas Bogendoerfer ha
scritto:
> On Sun, Mar 16, 2008 at 09:27:37PM +0100, Giuseppe Sacco wrote:
> > the gcc I am using in versione 4.1.2. Any help is really appreciated.
> 
> 4.2.1 generates nearly the same (reasonable) code. The major difference
> between the version with printk and the version without is the size
> of the local stack. I guess this prevents killing of *cd.
> Could you try the hack below and tell me, if it helps ? This hack
> ensures, that the buffer given to the scsi driver is one cache
> line big (at least on R5k O2s). If this helps, there are more
> places to fix for non-coherent machines...
[...]

The patch you proposed, that use a larger buffer, does not seems to
trigger the bug.

Thanks,
Giuseppe


From giuseppe@eppesuigoccas.homedns.org Mon Mar 17 09:41:28 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 17 Mar 2008 09:41:30 +0000 (GMT)
Received: from host194-211-dynamic.20-79-r.retail.telecomitalia.it ([79.20.211.194]:38889
	"EHLO eppesuigoccas.homedns.org") by ftp.linux-mips.org with ESMTP
	id S28599305AbYCQJl2 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 17 Mar 2008 09:41:28 +0000
Received: from router-wag54gp2 ([192.168.1.33] helo=[192.168.2.7])
	by eppesuigoccas.homedns.org with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.63)
	(envelope-from <giuseppe@eppesuigoccas.homedns.org>)
	id 1JbBqJ-0004Hl-Mq
	for linux-mips@linux-mips.org; Mon, 17 Mar 2008 10:41:21 +0100
Subject: unexpected irq 71 on ip32
From:	Giuseppe Sacco <giuseppe@eppesuigoccas.homedns.org>
To:	linux-mips@linux-mips.org
Content-Type: text/plain
Date:	Mon, 17 Mar 2008 10:41:44 +0100
Message-Id: <1205746904.3515.37.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 2.12.3 
Content-Transfer-Encoding: 7bit
Return-Path: <giuseppe@eppesuigoccas.homedns.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: 18410
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: giuseppe@eppesuigoccas.homedns.org
Precedence: bulk
X-list: linux-mips

Hi all,
since 2.6.24 I find this message on the console. The message is
displayed very randomly (or, I cannot find any related event), once or
twice a week.

irq 71, desc: ffffffff803fccf0, depth: 1, count: 0, unhandled: 0
->handle_irq():  ffffffff80069510, handle_bad_irq+0x0/0x2c0
->chip(): ffffffff803f6610, 0xffffffff803f6610
->action(): 0000000000000000
  IRQ_DISABLED set
   IRQ_NOPROBE set

from what I understand, this is an irq related to serial line ttyS1. On
this line I have a modem managed by hylafax, but those messages are
displayed even when there is no activity on the modem line.

Bye,
Giuseppe


From tsbogend@alpha.franken.de Mon Mar 17 10:01:32 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 17 Mar 2008 10:01:34 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:22706 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28599841AbYCQKBc (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 17 Mar 2008 10:01:32 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JbC9r-0005FQ-00; Mon, 17 Mar 2008 11:01:31 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id ACE4BC235B; Mon, 17 Mar 2008 11:01:09 +0100 (CET)
Date:	Mon, 17 Mar 2008 11:01:09 +0100
To:	Giuseppe Sacco <giuseppe@eppesuigoccas.homedns.org>
Cc:	linux-mips@linux-mips.org
Subject: Re: unexpected irq 71 on ip32
Message-ID: <20080317100109.GA10140@alpha.franken.de>
References: <1205746904.3515.37.camel@localhost>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1205746904.3515.37.camel@localhost>
User-Agent: Mutt/1.5.13 (2006-08-11)
From:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Return-Path: <tsbogend@alpha.franken.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: 18411
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips

On Mon, Mar 17, 2008 at 10:41:44AM +0100, Giuseppe Sacco wrote:
> from what I understand, this is an irq related to serial line ttyS1. On

not on my O2:

serial8250.0: ttyS0 at MMIO 0x1f390000 (irq = 60) is a 16550A
console [ttyS0] enabled
serial8250.0: ttyS1 at MMIO 0x1f398000 (irq = 66) is a 16550A

Is there something listed for irq 71 in /proc/interrupts ?

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

From giuseppe@eppesuigoccas.homedns.org Mon Mar 17 10:07:04 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 17 Mar 2008 10:07:06 +0000 (GMT)
Received: from host194-211-dynamic.20-79-r.retail.telecomitalia.it ([79.20.211.194]:41170
	"EHLO eppesuigoccas.homedns.org") by ftp.linux-mips.org with ESMTP
	id S28590715AbYCQKHE (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 17 Mar 2008 10:07:04 +0000
Received: from router-wag54gp2 ([192.168.1.33] helo=[192.168.2.7])
	by eppesuigoccas.homedns.org with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.63)
	(envelope-from <giuseppe@eppesuigoccas.homedns.org>)
	id 1JbCF5-00053M-NR
	for linux-mips@linux-mips.org; Mon, 17 Mar 2008 11:06:57 +0100
Subject: Re: unexpected irq 71 on ip32
From:	Giuseppe Sacco <giuseppe@eppesuigoccas.homedns.org>
To:	linux-mips@linux-mips.org
In-Reply-To: <20080317100109.GA10140@alpha.franken.de>
References: <1205746904.3515.37.camel@localhost>
	 <20080317100109.GA10140@alpha.franken.de>
Content-Type: text/plain
Date:	Mon, 17 Mar 2008 11:07:20 +0100
Message-Id: <1205748440.3515.56.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 2.12.3 
Content-Transfer-Encoding: 7bit
Return-Path: <giuseppe@eppesuigoccas.homedns.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: 18412
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: giuseppe@eppesuigoccas.homedns.org
Precedence: bulk
X-list: linux-mips

Hi Thomas,

Il giorno lun, 17/03/2008 alle 11.01 +0100, Thomas Bogendoerfer ha
scritto:
> On Mon, Mar 17, 2008 at 10:41:44AM +0100, Giuseppe Sacco wrote:
> > from what I understand, this is an irq related to serial line ttyS1. On

my understanding is due to:

$ grep 71 arch/mips/sgi-ip32/*irq*
arch/mips/sgi-ip32/ip32-irq.c: * 26-31 -> 66-71 Serial 2 (28 E)

> not on my O2:
> 
> serial8250.0: ttyS0 at MMIO 0x1f390000 (irq = 60) is a 16550A
> console [ttyS0] enabled
> serial8250.0: ttyS1 at MMIO 0x1f398000 (irq = 66) is a 16550A
> 
> Is there something listed for irq 71 in /proc/interrupts ?

nope:
giuseppe@sgi:~$ cat /proc/interrupts 
           CPU0       
  7:    1949649            MIPS  timer
 11:     106073       IP32 MACE  SGI O2 Fast Ethernet
 15:          0       IP32 MACE  MACE PCI error
 16:     487646   IP32 MACE PCI  aic7xxx
 17:         15   IP32 MACE PCI  aic7xxx
 18:          0   IP32 MACE PCI  ohci_hcd:usb1
 21:          0   IP32 MACE PCI  ohci_hcd:usb2
 22:      62066   IP32 MACE PCI  ehci_hcd:usb3, eth100
 28:          0      IP32 CRIME  CRIME CPU error
 29:          1      IP32 CRIME  CRIME memory error
 48:          0   IP32 MACE ISA  rtc
 49:         10   IP32 MACE ISA  PS2 port
 51:        133   IP32 MACE ISA  PS2 port
 60:        133   IP32 MACE ISA  serial

ERR:          0

Bye,
Giuseppe


From tsbogend@alpha.franken.de Mon Mar 17 10:08:20 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 17 Mar 2008 10:08:22 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:11955 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28590715AbYCQKIU (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 17 Mar 2008 10:08:20 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JbCGS-0007Fo-00; Mon, 17 Mar 2008 11:08:20 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id 6D357C235C; Mon, 17 Mar 2008 11:08:15 +0100 (CET)
Date:	Mon, 17 Mar 2008 11:08:15 +0100
To:	Giuseppe Sacco <giuseppe@eppesuigoccas.homedns.org>
Cc:	linux-mips@linux-mips.org
Subject: Re: unexpected irq 71 on ip32
Message-ID: <20080317100815.GA10179@alpha.franken.de>
References: <1205746904.3515.37.camel@localhost>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1205746904.3515.37.camel@localhost>
User-Agent: Mutt/1.5.13 (2006-08-11)
From:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Return-Path: <tsbogend@alpha.franken.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: 18413
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips

On Mon, Mar 17, 2008 at 10:41:44AM +0100, Giuseppe Sacco wrote:
> from what I understand, this is an irq related to serial line ttyS1. On

I had a closer look, and it's related to ttyS1. Looks like the DMA
interface for serial (probably RX DMA overrun). I'll have a look
later, why we don't ignore this interrupt.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

From jeff@garzik.org Mon Mar 17 12:13:30 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 17 Mar 2008 12:13:32 +0000 (GMT)
Received: from srv5.dvmed.net ([207.36.208.214]:18920 "EHLO mail.dvmed.net")
	by ftp.linux-mips.org with ESMTP id S28599971AbYCQMNa (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 17 Mar 2008 12:13:30 +0000
Received: from cpe-069-134-071-233.nc.res.rr.com ([69.134.71.233] helo=core.yyz.us)
	by mail.dvmed.net with esmtpsa (Exim 4.68 #1 (Red Hat Linux))
	id 1JbEDY-0006Mp-2o; Mon, 17 Mar 2008 12:13:28 +0000
Message-ID: <47DE6067.6070500@garzik.org>
Date:	Mon, 17 Mar 2008 08:13:27 -0400
From:	Jeff Garzik <jeff@garzik.org>
User-Agent: Thunderbird 2.0.0.12 (X11/20080226)
MIME-Version: 1.0
To:	Ralf Baechle <ralf@linux-mips.org>
CC:	Andrew Morton <akpm@linux-foundation.org>, netdev@vger.kernel.org,
	linux-mips@linux-mips.org
Subject: Re: [IOC3] Fix section missmatch
References: <20080308165833.GA8625@linux-mips.org>
In-Reply-To: <20080308165833.GA8625@linux-mips.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <jeff@garzik.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: 18414
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: jeff@garzik.org
Precedence: bulk
X-list: linux-mips

Ralf Baechle wrote:
>   LD      drivers/net/built-in.o
> WARNING: drivers/net/built-in.o(.text+0x3468): Section mismatch in reference fro
> m the function ioc3_probe() to the function .devinit.text:ioc3_serial_probe()
> The function ioc3_probe() references
> the function __devinit ioc3_serial_probe().
> This is often because ioc3_probe lacks a __devinit 
> annotation or the annotation of ioc3_serial_probe is wrong.
> 
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> 
> ---
> Resend, this time with Jeff's address corrected.

applied



From ralf@linux-mips.org Mon Mar 17 13:05:21 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 17 Mar 2008 13:05:23 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:53190 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28600158AbYCQNFV (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 17 Mar 2008 13:05:21 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2HD5K9m015952;
	Mon, 17 Mar 2008 13:05:21 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2HD5Jmv015951;
	Mon, 17 Mar 2008 13:05:19 GMT
Date:	Mon, 17 Mar 2008 13:05:19 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Cc:	linux-mips <linux-mips@linux-mips.org>
Subject: Re: [PATCH][MIPS] fix the installation condition of MIPS
	clocksource
Message-ID: <20080317130519.GA15629@linux-mips.org>
References: <20080218230459.35c2204b.yoichi_yuasa@tripeaks.co.jp> <20080312140201.GA25986@linux-mips.org> <20080312235002.c717dde3.yoichi_yuasa@tripeaks.co.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080312235002.c717dde3.yoichi_yuasa@tripeaks.co.jp>
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18415
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, Mar 12, 2008 at 11:50:02PM +0900, Yoichi Yuasa wrote:

> I think it has a one more bug.

Applied.

  Ralf

From ralf@linux-mips.org Mon Mar 17 13:12:38 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 17 Mar 2008 13:12:40 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:32912 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28600179AbYCQNMi (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 17 Mar 2008 13:12:38 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2HDCSP6016610;
	Mon, 17 Mar 2008 13:12:28 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2HDCMOP016588;
	Mon, 17 Mar 2008 13:12:22 GMT
Date:	Mon, 17 Mar 2008 13:12:22 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] BCM1480: Fix PCI/HT IO access
Message-ID: <20080317131105.GA15625@linux-mips.org>
References: <20080316171416.18556C226C@solo.franken.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080316171416.18556C226C@solo.franken.de>
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18416
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 Sun, Mar 16, 2008 at 06:14:16PM +0100, Thomas Bogendoerfer wrote:

> - removed check for enable HT-PCI bridges, because some CFE version
>   init only the needed one and scanning works even with disabled HT
>   links
> - implemented I/O access behind HT PCI busses
> - fixed pci_map for IO resource behind PCI bridge
> 
> Tested with E100 and Tulip driver.

Thanks, applied.

  Ralf

From ralf@linux-mips.org Mon Mar 17 14:18:29 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 17 Mar 2008 14:18:31 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:35274 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28600482AbYCQOS3 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 17 Mar 2008 14:18:29 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2HEIS3k026273;
	Mon, 17 Mar 2008 14:18:29 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2HEISSQ026272;
	Mon, 17 Mar 2008 14:18:28 GMT
Date:	Mon, 17 Mar 2008 14:18:28 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Giuseppe Sacco <giuseppe@eppesuigoccas.homedns.org>
Cc:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	linux-mips@linux-mips.org
Subject: Re: Compiler error? [was: Re: new kernel oops in recent kernels]
Message-ID: <20080317141828.GA25798@linux-mips.org>
References: <1205664563.3050.4.camel@localhost> <1205699257.4159.14.camel@casa> <20080316233619.GA29511@alpha.franken.de> <1205741142.3515.2.camel@localhost>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1205741142.3515.2.camel@localhost>
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18417
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, Mar 17, 2008 at 09:05:42AM +0100, Giuseppe Sacco wrote:

> The patch you proposed, that use a larger buffer, does not seems to
> trigger the bug.

It may help but doesn't have a chance to be accepted upstream.  So
this is no more than an useful litmus test.

  Ralf

From tsbogend@alpha.franken.de Mon Mar 17 14:32:27 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 17 Mar 2008 14:32:29 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:64468 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28600504AbYCQOc1 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 17 Mar 2008 14:32:27 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JbGO0-0004QJ-00; Mon, 17 Mar 2008 15:32:24 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id E4361C2360; Mon, 17 Mar 2008 15:32:15 +0100 (CET)
Date:	Mon, 17 Mar 2008 15:32:15 +0100
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	Giuseppe Sacco <giuseppe@eppesuigoccas.homedns.org>,
	linux-mips@linux-mips.org
Subject: Re: Compiler error? [was: Re: new kernel oops in recent kernels]
Message-ID: <20080317143215.GA11497@alpha.franken.de>
References: <1205664563.3050.4.camel@localhost> <1205699257.4159.14.camel@casa> <20080316233619.GA29511@alpha.franken.de> <1205741142.3515.2.camel@localhost> <20080317141828.GA25798@linux-mips.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080317141828.GA25798@linux-mips.org>
User-Agent: Mutt/1.5.13 (2006-08-11)
From:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Return-Path: <tsbogend@alpha.franken.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: 18418
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips

On Mon, Mar 17, 2008 at 02:18:28PM +0000, Ralf Baechle wrote:
> On Mon, Mar 17, 2008 at 09:05:42AM +0100, Giuseppe Sacco wrote:
> 
> > The patch you proposed, that use a larger buffer, does not seems to
> > trigger the bug.
> 
> It may help but doesn't have a chance to be accepted upstream.  So
> this is no more than an useful litmus test.

sure, that's why I called it a hack. It was just to make sure, that I'm
on the right track.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

From yoichi_yuasa@tripeaks.co.jp Mon Mar 17 14:50:12 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 17 Mar 2008 14:50:14 +0000 (GMT)
Received: from mo31.po.2iij.NET ([210.128.50.54]:9741 "EHLO mo31.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S28600547AbYCQOuM (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 17 Mar 2008 14:50:12 +0000
Received: by mo.po.2iij.net (mo31) id m2HEo86q009421; Mon, 17 Mar 2008 23:50:08 +0900 (JST)
Received: from delta (61.25.30.125.dy.iij4u.or.jp [125.30.25.61])
	by mbox.po.2iij.net (po-mbox300) id m2HEo2eM019042
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Mon, 17 Mar 2008 23:50:03 +0900
Date:	Mon, 17 Mar 2008 23:49:42 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	yoichi_yuasa@tripeaks.co.jp, linux-mips <linux-mips@linux-mips.org>
Subject: [PATCH 2/2][MIPS] add irq_disable_hazard() before
 c0_compare_int_pending()
Message-Id: <20080317234942.37ebfcee.yoichi_yuasa@tripeaks.co.jp>
In-Reply-To: <20080317234740.705a8a34.yoichi_yuasa@tripeaks.co.jp>
References: <20080317234740.705a8a34.yoichi_yuasa@tripeaks.co.jp>
Organization: TriPeaks Corporation
X-Mailer: Sylpheed 2.4.5 (GTK+ 2.12.0; i486-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yoichi_yuasa@tripeaks.co.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: 18419
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: yoichi_yuasa@tripeaks.co.jp
Precedence: bulk
X-list: linux-mips

Add irq_disable_hazard() before c0_compare_int_pending().

VR41xx sometime fails at this point.
It can be fix this patch.

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>

diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/kernel/cevt-r4k.c linux/arch/mips/kernel/cevt-r4k.c
--- linux-orig/arch/mips/kernel/cevt-r4k.c	2008-03-12 16:37:31.317624763 +0900
+++ linux/arch/mips/kernel/cevt-r4k.c	2008-03-12 16:37:39.894113510 +0900
@@ -205,6 +205,7 @@ static int c0_compare_int_usable(void)
 	while ((int)(read_c0_count() - cnt) <= 0)
 		;	/* Wait for expiry  */
 
+	irq_disable_hazard();
 	if (!c0_compare_int_pending())
 		return 0;
 

From yoichi_yuasa@tripeaks.co.jp Mon Mar 17 14:50:35 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 17 Mar 2008 14:50:38 +0000 (GMT)
Received: from mo30.po.2iij.NET ([210.128.50.53]:63043 "EHLO mo30.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S28600548AbYCQOuM (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 17 Mar 2008 14:50:12 +0000
Received: by mo.po.2iij.net (mo30) id m2HEo8Mx051564; Mon, 17 Mar 2008 23:50:08 +0900 (JST)
Received: from delta (61.25.30.125.dy.iij4u.or.jp [125.30.25.61])
	by mbox.po.2iij.net (po-mbox304) id m2HEo13C025665
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Mon, 17 Mar 2008 23:50:01 +0900
Date:	Mon, 17 Mar 2008 23:47:40 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	yoichi_yuasa@tripeaks.co.jp, linux-mips <linux-mips@linux-mips.org>
Subject: [PATCH 1/2][MIPS] replace c0_compare acknowledge by c0_timer_ack()
Message-Id: <20080317234740.705a8a34.yoichi_yuasa@tripeaks.co.jp>
Organization: TriPeaks Corporation
X-Mailer: Sylpheed 2.4.5 (GTK+ 2.12.0; i486-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yoichi_yuasa@tripeaks.co.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: 18420
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: yoichi_yuasa@tripeaks.co.jp
Precedence: bulk
X-list: linux-mips

VR41xx, CP0 hazard is necessary between read_c0_count() and write_c0_compare().
However, the problem can be solved by replacing this by c0_timer_ack(). 

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>

diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/kernel/cevt-r4k.c linux/arch/mips/kernel/cevt-r4k.c
--- linux-orig/arch/mips/kernel/cevt-r4k.c	2008-03-11 10:10:09.453835304 +0900
+++ linux/arch/mips/kernel/cevt-r4k.c	2008-03-12 16:35:42.911447048 +0900
@@ -186,7 +186,7 @@ static int c0_compare_int_usable(void)
 	 * IP7 already pending?  Try to clear it by acking the timer.
 	 */
 	if (c0_compare_int_pending()) {
-		write_c0_compare(read_c0_count());
+		c0_timer_ack();
 		irq_disable_hazard();
 		if (c0_compare_int_pending())
 			return 0;
@@ -198,7 +198,7 @@ static int c0_compare_int_usable(void)
 		write_c0_compare(cnt);
 		irq_disable_hazard();
 		if ((int)(read_c0_count() - cnt) < 0)
-		    break;
+			break;
 		/* increase delta if the timer was already expired */
 	}
 
@@ -208,7 +208,7 @@ static int c0_compare_int_usable(void)
 	if (!c0_compare_int_pending())
 		return 0;
 
-	write_c0_compare(read_c0_count());
+	c0_timer_ack();
 	irq_disable_hazard();
 	if (c0_compare_int_pending())
 		return 0;

From ralf@linux-mips.org Mon Mar 17 16:16:57 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 17 Mar 2008 16:16:59 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:64656 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28600819AbYCQQQ5 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 17 Mar 2008 16:16:57 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2HGGgre028837;
	Mon, 17 Mar 2008 16:16:52 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2HGGZkt028836;
	Mon, 17 Mar 2008 16:16:35 GMT
Date:	Mon, 17 Mar 2008 16:16:35 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Cc:	linux-mips <linux-mips@linux-mips.org>
Subject: Re: [PATCH 1/2][MIPS] replace c0_compare acknowledge by
	c0_timer_ack()
Message-ID: <20080317161635.GA25549@linux-mips.org>
References: <20080317234740.705a8a34.yoichi_yuasa@tripeaks.co.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080317234740.705a8a34.yoichi_yuasa@tripeaks.co.jp>
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18421
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, Mar 17, 2008 at 11:47:40PM +0900, Yoichi Yuasa wrote:

> VR41xx, CP0 hazard is necessary between read_c0_count() and write_c0_compare().

Interesting.  I wonder why you need this patch but nobody else?

  Ralf

From yoichi_yuasa@tripeaks.co.jp Tue Mar 18 04:47:25 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Mar 2008 04:47:27 +0000 (GMT)
Received: from mo31.po.2iij.NET ([210.128.50.54]:24343 "EHLO mo31.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S28603871AbYCRErZ (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 18 Mar 2008 04:47:25 +0000
Received: by mo.po.2iij.net (mo31) id m2I4lLTk064335; Tue, 18 Mar 2008 13:47:21 +0900 (JST)
Received: from localhost (65.126.232.202.bf.2iij.net [202.232.126.65])
	by mbox.po.2iij.net (po-mbox301) id m2I4lJ40005091
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Tue, 18 Mar 2008 13:47:19 +0900
Message-Id: <200803180447.m2I4lJ40005091@po-mbox301.hop.2iij.net>
Date:	Tue, 18 Mar 2008 13:47:20 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	yoichi_yuasa@tripeaks.co.jp, linux-mips <linux-mips@linux-mips.org>
Subject: Re: [PATCH 1/2][MIPS] replace c0_compare acknowledge by
 c0_timer_ack()
In-Reply-To: <20080317161635.GA25549@linux-mips.org>
References: <20080317234740.705a8a34.yoichi_yuasa@tripeaks.co.jp>
	<20080317161635.GA25549@linux-mips.org>
Organization: TriPeaks Corporation
X-Mailer: Sylpheed version 2.3.0beta5 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yoichi_yuasa@tripeaks.co.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: 18422
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: yoichi_yuasa@tripeaks.co.jp
Precedence: bulk
X-list: linux-mips

Hi Ralf,

On Mon, 17 Mar 2008 16:16:35 +0000
Ralf Baechle <ralf@linux-mips.org> wrote:

> On Mon, Mar 17, 2008 at 11:47:40PM +0900, Yoichi Yuasa wrote:
> 
> > VR41xx, CP0 hazard is necessary between read_c0_count() and write_c0_compare().
> 
> Interesting.  I wonder why you need this patch but nobody else?

Three NOP are necessary on the TB0287(VR4131 board).

Yoichi

From kaminaga@sm.sony.co.jp Tue Mar 18 06:52:28 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Mar 2008 06:52:30 +0000 (GMT)
Received: from ms4.Sony.CO.JP ([211.125.136.198]:5766 "EHLO ms4.sony.co.jp")
	by ftp.linux-mips.org with ESMTP id S28604064AbYCRGw2 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 18 Mar 2008 06:52:28 +0000
Received: from mta5.sony.co.jp (mta5.Sony.CO.JP [137.153.71.6])
 by ms4.sony.co.jp (R8/Sony) with ESMTP id m2I6qFwm003207
 for <linux-mips@linux-mips.org>; Tue, 18 Mar 2008 15:52:15 +0900 (JST)
Received: from mta5.sony.co.jp (localhost [127.0.0.1])
 by mta5.sony.co.jp (R8/Sony) with ESMTP id m2I6qFdw014273
 for <linux-mips@linux-mips.org>; Tue, 18 Mar 2008 15:52:15 +0900 (JST)
Received: from smail1.sm.sony.co.jp (smail1.sm.sony.co.jp [43.11.253.1])
 by mta5.sony.co.jp (R8/Sony) with ESMTP id m2I6qFXm014268
 for <linux-mips@linux-mips.org>; Tue, 18 Mar 2008 15:52:15 +0900 (JST)
Received: from imail.sm.sony.co.jp (imail.sm.sony.co.jp [43.4.141.32]) by smail1.sm.sony.co.jp (8.11.6p2/8.11.6) with ESMTP id m2I6qFP01703 for <linux-mips@linux-mips.org>; Tue, 18 Mar 2008 15:52:15 +0900 (JST)
Received: from localhost (tidal.sm.sony.co.jp [43.4.145.112])
	by imail.sm.sony.co.jp (8.12.11/3.7W) with ESMTP id m2I6qDr3015696
	for <linux-mips@linux-mips.org>; Tue, 18 Mar 2008 15:52:13 +0900 (JST)
Date:	Tue, 18 Mar 2008 15:47:01 +0900 (JST)
Message-Id: <20080318.154701.74743177.kaminaga@sm.sony.co.jp>
To:	linux-mips@linux-mips.org
Subject: MIPS prelink question
From:	Hiroki Kaminaga <kaminaga@sm.sony.co.jp>
X-Mailer: Mew version 4.2 on Emacs 21.2 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <kaminaga@sm.sony.co.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: 18423
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: kaminaga@sm.sony.co.jp
Precedence: bulk
X-list: linux-mips


Hi!

I'm not sure if this is the right ML to ask, but since I've found
discussion about MIPS prelink here, I'm posting here...

In the below thread, patch for MIPS prelink was posted.
http://www.linux-mips.org/archives/linux-mips/2006-11/msg00034.html

I've tried this patch, but I got below error when I tried to do prelink.

	No space in ELF segment table to add new ELF segment

On the montavista pro 5.0 note, I found that they have fixed above
prelink error, but I could not find the patch. Could someone give
me pointer to address this issue?


Thanks in Advance,


(Hiroki Kaminaga)
t
--

From ths@networkno.de Tue Mar 18 11:19:43 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Mar 2008 11:19:46 +0000 (GMT)
Received: from relay01.mx.bawue.net ([193.7.176.67]:53683 "EHLO
	relay01.mx.bawue.net") by ftp.linux-mips.org with ESMTP
	id S28604729AbYCRLTn (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 18 Mar 2008 11:19:43 +0000
Received: from lagash (intrt.mips-uk.com [194.74.144.130])
	(using TLSv1 with cipher AES256-SHA (256/256 bits))
	(No client certificate requested)
	by relay01.mx.bawue.net (Postfix) with ESMTP id E3A6148916;
	Tue, 18 Mar 2008 12:19:36 +0100 (CET)
Received: from ths by lagash with local (Exim 4.69)
	(envelope-from <ths@networkno.de>)
	id 1JbZqd-0004Er-1I; Tue, 18 Mar 2008 11:19:15 +0000
Date:	Tue, 18 Mar 2008 11:19:15 +0000
From:	Thiemo Seufer <ths@networkno.de>
To:	Hiroki Kaminaga <kaminaga@sm.sony.co.jp>
Cc:	linux-mips@linux-mips.org
Subject: Re: MIPS prelink question
Message-ID: <20080318111914.GH26619@networkno.de>
References: <20080318.154701.74743177.kaminaga@sm.sony.co.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080318.154701.74743177.kaminaga@sm.sony.co.jp>
User-Agent: Mutt/1.5.17+20080114 (2008-01-14)
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: 18424
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

Hiroki Kaminaga wrote:
> 
> Hi!
> 
> I'm not sure if this is the right ML to ask, but since I've found
> discussion about MIPS prelink here, I'm posting here...

The binutils list would be a better place.

> In the below thread, patch for MIPS prelink was posted.
> http://www.linux-mips.org/archives/linux-mips/2006-11/msg00034.html
> 
> I've tried this patch, but I got below error when I tried to do prelink.
> 
> 	No space in ELF segment table to add new ELF segment

A bit more of the output would help with isolating the problem.
Anyway, IIRC there are two effects which cause this error:
 - Linking in binary objects which were built by a toolchain without
   prelink support, probably one of the compiler-internal startup files.
 - Use of an older version on binutils (from the time when the prelink
   patches went in), which still had a few issues with handling the
   additional segment.

> On the montavista pro 5.0 note, I found that they have fixed above
> prelink error, but I could not find the patch. Could someone give
> me pointer to address this issue?

I believe binutils 2.18 works fine WRT prelinking. I don't remember
the particular patches to watch out for, though.


Thiemo

From drow@false.org Tue Mar 18 12:33:34 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Mar 2008 12:33:36 +0000 (GMT)
Received: from NaN.false.org ([208.75.86.248]:59032 "EHLO nan.false.org")
	by ftp.linux-mips.org with ESMTP id S28604810AbYCRMde (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 18 Mar 2008 12:33:34 +0000
Received: from nan.false.org (localhost [127.0.0.1])
	by nan.false.org (Postfix) with ESMTP id D0F13983BF;
	Tue, 18 Mar 2008 12:33:32 +0000 (GMT)
Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55])
	by nan.false.org (Postfix) with ESMTP id 7EC489802B;
	Tue, 18 Mar 2008 12:33:32 +0000 (GMT)
Received: from drow by caradoc.them.org with local (Exim 4.69)
	(envelope-from <drow@caradoc.them.org>)
	id 1Jbb0U-0004hL-Vj; Tue, 18 Mar 2008 08:33:31 -0400
Date:	Tue, 18 Mar 2008 08:33:30 -0400
From:	Daniel Jacobowitz <dan@debian.org>
To:	Hiroki Kaminaga <kaminaga@sm.sony.co.jp>
Cc:	linux-mips@linux-mips.org
Subject: Re: MIPS prelink question
Message-ID: <20080318123330.GA18036@caradoc.them.org>
References: <20080318.154701.74743177.kaminaga@sm.sony.co.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080318.154701.74743177.kaminaga@sm.sony.co.jp>
User-Agent: Mutt/1.5.17 (2007-12-11)
Return-Path: <drow@false.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: 18425
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

On Tue, Mar 18, 2008 at 03:47:01PM +0900, Hiroki Kaminaga wrote:
> 
> Hi!
> 
> I'm not sure if this is the right ML to ask, but since I've found
> discussion about MIPS prelink here, I'm posting here...
> 
> In the below thread, patch for MIPS prelink was posted.
> http://www.linux-mips.org/archives/linux-mips/2006-11/msg00034.html
> 
> I've tried this patch, but I got below error when I tried to do prelink.
> 
> 	No space in ELF segment table to add new ELF segment
> 
> On the montavista pro 5.0 note, I found that they have fixed above
> prelink error, but I could not find the patch. Could someone give
> me pointer to address this issue?

It should be in their prelink source package.  Or here:

  http://sourceware.org/ml/prelink/2007-q4/msg00001.html

-- 
Daniel Jacobowitz
CodeSourcery

From ralf@linux-mips.org Tue Mar 18 13:27:10 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Mar 2008 13:27:12 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:6619 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28639340AbYCRN1K (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 18 Mar 2008 13:27:10 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2IDRAqA013484;
	Tue, 18 Mar 2008 13:27:10 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2IDR9vc013483;
	Tue, 18 Mar 2008 13:27:09 GMT
Date:	Tue, 18 Mar 2008 13:27:09 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Cc:	linux-mips <linux-mips@linux-mips.org>
Subject: Re: [PATCH 1/2][MIPS] replace c0_compare acknowledge by
	c0_timer_ack()
Message-ID: <20080318132709.GC11382@linux-mips.org>
References: <20080317234740.705a8a34.yoichi_yuasa@tripeaks.co.jp> <20080317161635.GA25549@linux-mips.org> <200803180447.m2I4lJ40005091@po-mbox301.hop.2iij.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200803180447.m2I4lJ40005091@po-mbox301.hop.2iij.net>
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18426
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, Mar 18, 2008 at 01:47:20PM +0900, Yoichi Yuasa wrote:

> On Mon, 17 Mar 2008 16:16:35 +0000
> Ralf Baechle <ralf@linux-mips.org> wrote:
> 
> > On Mon, Mar 17, 2008 at 11:47:40PM +0900, Yoichi Yuasa wrote:
> > 
> > > VR41xx, CP0 hazard is necessary between read_c0_count() and write_c0_compare().
> > 
> > Interesting.  I wonder why you need this patch but nobody else?
> 
> Three NOP are necessary on the TB0287(VR4131 board).

That much was obvious from your patch.  I was more wondering about this
change:

-               write_c0_compare(read_c0_count());
+               c0_timer_ack();

c0_timer_ack is defined as

static void c0_timer_ack(void)
{
        write_c0_compare(read_c0_compare());
}

so your patch does a functional change there - even though it should not
actually matter.  So I was wondering if for some reason you need that
change.

Just interested - it looks a bit cleaner so I'm leaning to apply this
change anyway.

  Ralf

From tsbogend@alpha.franken.de Tue Mar 18 13:30:28 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Mar 2008 13:30:31 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:6289 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28639346AbYCRNa2 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 18 Mar 2008 13:30:28 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1Jbbta-0007vs-00; Tue, 18 Mar 2008 14:30:26 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id 7294EC2783; Tue, 18 Mar 2008 14:30:15 +0100 (CET)
Date:	Tue, 18 Mar 2008 14:30:15 +0100
To:	Matteo Croce <technoboy85@gmail.com>
Cc:	linux-mips@linux-mips.org, Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH][MIPS][5/6]: AR7: serial hack
Message-ID: <20080318133015.GA7239@alpha.franken.de>
References: <200803120221.25044.technoboy85@gmail.com> <200803141646.09645.technoboy85@gmail.com> <20080315104009.GA6533@alpha.franken.de> <200803161645.06364.technoboy85@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200803161645.06364.technoboy85@gmail.com>
User-Agent: Mutt/1.5.13 (2006-08-11)
From:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Return-Path: <tsbogend@alpha.franken.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: 18427
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips

On Sun, Mar 16, 2008 at 04:45:06PM +0100, Matteo Croce wrote:
> Il Saturday 15 March 2008 11:40:09 Thomas Bogendoerfer ha scritto:
> > On Fri, Mar 14, 2008 at 04:46:09PM +0100, Matteo Croce wrote:
> > > This is a bit better
> > 
> > is it possible to try without the serial changes first ?
> > 
> > Use 
> > 
> >        uart_port[0].type = PORT_16550A;
> > 
> > in arch/mips/ar7/platform.c.
> > 
> > Does it work ?
> > 
> 
> Tried I get teh usual broken serial output:

I just checked the latest AR7/UR8 source, I have, and they don't need
special hacks. This is a 2.6.10 based tree. At that time there was
no serial8250_console_putchar(), console output was done via
serial8250_console_write() without any helper. Before writing to 
the UART_TX, wait_for_xmitr() is called. And this wait_for_xmitr() does
check for BOTH_EMPTY.

Is there a good reason, why we don't check for BOTH_EMPTY in
serial8250_console_putchar() ? To match the 2.6.10 behaviour we
would need that and this would fix the AR7 case without any
special handling.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

From sshtylyov@ru.mvista.com Tue Mar 18 13:42:28 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Mar 2008 13:42:30 +0000 (GMT)
Received: from h155.mvista.com ([63.81.120.155]:30834 "EHLO imap.sh.mvista.com")
	by ftp.linux-mips.org with ESMTP id S28639409AbYCRNm1 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 18 Mar 2008 13:42:27 +0000
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id DDB5F3EC9; Tue, 18 Mar 2008 06:42:20 -0700 (PDT)
Message-ID: <47DFC710.5060907@ru.mvista.com>
Date:	Tue, 18 Mar 2008 16:43:44 +0300
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
X-Accept-Language: ru, en-us, en-gb
MIME-Version: 1.0
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc:	Matteo Croce <technoboy85@gmail.com>, linux-mips@linux-mips.org,
	Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH][MIPS][5/6]: AR7: serial hack
References: <200803120221.25044.technoboy85@gmail.com> <200803141646.09645.technoboy85@gmail.com> <20080315104009.GA6533@alpha.franken.de> <200803161645.06364.technoboy85@gmail.com> <20080318133015.GA7239@alpha.franken.de>
In-Reply-To: <20080318133015.GA7239@alpha.franken.de>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@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: 18428
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips

Hello.

Thomas Bogendoerfer wrote:

>>Il Saturday 15 March 2008 11:40:09 Thomas Bogendoerfer ha scritto:

>>>On Fri, Mar 14, 2008 at 04:46:09PM +0100, Matteo Croce wrote:

>>>>This is a bit better

>>>is it possible to try without the serial changes first ?

>>>Use 

>>>       uart_port[0].type = PORT_16550A;

>>>in arch/mips/ar7/platform.c.

>>>Does it work ?

>>Tried I get teh usual broken serial output:

> I just checked the latest AR7/UR8 source, I have, and they don't need
> special hacks. This is a 2.6.10 based tree. At that time there was
> no serial8250_console_putchar(), console output was done via
> serial8250_console_write() without any helper. Before writing to 
> the UART_TX, wait_for_xmitr() is called. And this wait_for_xmitr() does
> check for BOTH_EMPTY.

> Is there a good reason, why we don't check for BOTH_EMPTY in
> serial8250_console_putchar() ?

    I guess transmission will be slower if you check both THRE and TSRE 
conditions.

> To match the 2.6.10 behaviour we
> would need that and this would fix the AR7 case without any
> special handling.

    AR7 case seems to be the case of bad hardware, and so require special 
handling...

> Thomas.

WBR, Sergei

From sshtylyov@ru.mvista.com Tue Mar 18 13:48:38 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Mar 2008 13:48:40 +0000 (GMT)
Received: from h155.mvista.com ([63.81.120.155]:49778 "EHLO imap.sh.mvista.com")
	by ftp.linux-mips.org with ESMTP id S28639424AbYCRNsh (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 18 Mar 2008 13:48:37 +0000
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id A547B3ECA; Tue, 18 Mar 2008 06:48:34 -0700 (PDT)
Message-ID: <47DFC886.40307@ru.mvista.com>
Date:	Tue, 18 Mar 2008 16:49:58 +0300
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
X-Accept-Language: ru, en-us, en-gb
MIME-Version: 1.0
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc:	Matteo Croce <technoboy85@gmail.com>, linux-mips@linux-mips.org,
	Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH][MIPS][5/6]: AR7: serial hack
References: <200803120221.25044.technoboy85@gmail.com> <200803141646.09645.technoboy85@gmail.com> <20080315104009.GA6533@alpha.franken.de> <200803161645.06364.technoboy85@gmail.com> <20080318133015.GA7239@alpha.franken.de> <47DFC710.5060907@ru.mvista.com>
In-Reply-To: <47DFC710.5060907@ru.mvista.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@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: 18429
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips

Hi, I wrote:

>>>>> This is a bit better

>>>> is it possible to try without the serial changes first ?

>>>> Use 

>>>>       uart_port[0].type = PORT_16550A;

>>>> in arch/mips/ar7/platform.c.

>>>> Does it work ?

>>> Tried I get teh usual broken serial output:

>> I just checked the latest AR7/UR8 source, I have, and they don't need
>> special hacks. This is a 2.6.10 based tree. At that time there was
>> no serial8250_console_putchar(), console output was done via
>> serial8250_console_write() without any helper. Before writing to the 
>> UART_TX, wait_for_xmitr() is called. And this wait_for_xmitr() does
>> check for BOTH_EMPTY.

>> Is there a good reason, why we don't check for BOTH_EMPTY in
>> serial8250_console_putchar() ?

>    I guess transmission will be slower if you check both THRE and TSRE 
> conditions.

    ... and since TX FIFO is in use, it must be even worse since you're only 
able to load TX FIFO in the short time slots while TX shift register is empty 
-- quite possibly that this condition will turn to virtually no TX FIFO as 
these slots my be to short. BTW, does turning off TX FIFO help?

WBR, Sergei

From alan@lxorguk.ukuu.org.uk Tue Mar 18 14:17:04 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Mar 2008 14:17:06 +0000 (GMT)
Received: from [81.2.110.250] ([81.2.110.250]:62629 "EHLO lxorguk.ukuu.org.uk")
	by ftp.linux-mips.org with ESMTP id S28639539AbYCRORE (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 18 Mar 2008 14:17:04 +0000
Received: from core (localhost.localdomain [127.0.0.1])
	by lxorguk.ukuu.org.uk (8.14.2/8.14.2) with ESMTP id m2IE1YwO016315;
	Tue, 18 Mar 2008 14:01:34 GMT
Date:	Tue, 18 Mar 2008 14:01:33 +0000
From:	Alan Cox <alan@lxorguk.ukuu.org.uk>
To:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Cc:	Matteo Croce <technoboy85@gmail.com>, linux-mips@linux-mips.org,
	Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH][MIPS][5/6]: AR7: serial hack
Message-ID: <20080318140133.3d41fd87@core>
In-Reply-To: <20080318133015.GA7239@alpha.franken.de>
References: <200803120221.25044.technoboy85@gmail.com>
	<200803141646.09645.technoboy85@gmail.com>
	<20080315104009.GA6533@alpha.franken.de>
	<200803161645.06364.technoboy85@gmail.com>
	<20080318133015.GA7239@alpha.franken.de>
X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.5; x86_64-redhat-linux-gnu)
Organization: Red Hat UK Cyf., Amberley Place, 107-111 Peascod Street,
 Windsor, Berkshire, SL4 1TE, Y Deyrnas Gyfunol. Cofrestrwyd yng Nghymru a
 Lloegr o'r rhif cofrestru 3798903
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
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: 18430
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

> Is there a good reason, why we don't check for BOTH_EMPTY in
> serial8250_console_putchar() ? To match the 2.6.10 behaviour we

A very good one - we have at least 1 byte of FIFO and the serial-ethernet
magic console devices also use that fifo emptying entirely to deduce when
to send a new packet.

> would need that and this would fix the AR7 case without any
> special handling.

If the AR7 is an 8250 why does it need special handling? and indeed why
does serial work on it except for console - or does that fail too.

From tsbogend@alpha.franken.de Tue Mar 18 15:28:59 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Mar 2008 15:29:01 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:40096 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28639633AbYCRP27 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 18 Mar 2008 15:28:59 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JbdkI-00013A-00; Tue, 18 Mar 2008 16:28:58 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id 0E87EC27B4; Tue, 18 Mar 2008 16:28:40 +0100 (CET)
Date:	Tue, 18 Mar 2008 16:28:39 +0100
To:	Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc:	Matteo Croce <technoboy85@gmail.com>, linux-mips@linux-mips.org,
	Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH][MIPS][5/6]: AR7: serial hack
Message-ID: <20080318152839.GA7765@alpha.franken.de>
References: <200803120221.25044.technoboy85@gmail.com> <200803141646.09645.technoboy85@gmail.com> <20080315104009.GA6533@alpha.franken.de> <200803161645.06364.technoboy85@gmail.com> <20080318133015.GA7239@alpha.franken.de> <20080318140133.3d41fd87@core>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080318140133.3d41fd87@core>
User-Agent: Mutt/1.5.13 (2006-08-11)
From:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Return-Path: <tsbogend@alpha.franken.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: 18431
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips

On Tue, Mar 18, 2008 at 02:01:33PM +0000, Alan Cox wrote:
> > Is there a good reason, why we don't check for BOTH_EMPTY in
> > serial8250_console_putchar() ? To match the 2.6.10 behaviour we
> 
> A very good one - we have at least 1 byte of FIFO and the serial-ethernet
> magic console devices also use that fifo emptying entirely to deduce when
> to send a new packet.

ok, now I understand.

> > would need that and this would fix the AR7 case without any
> > special handling.
> 
> If the AR7 is an 8250 why does it need special handling? and indeed why
> does serial work on it except for console - or does that fail too.

well TI calls it a 16550A and I still wonder about the reported
problems. Looks like I need to dig a little bit deeper...

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

From ncoesel@DEALogic.nl Tue Mar 18 15:48:58 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Mar 2008 15:49:00 +0000 (GMT)
Received: from smtp-vbr13.xs4all.nl ([194.109.24.33]:29714 "EHLO
	smtp-vbr13.xs4all.nl") by ftp.linux-mips.org with ESMTP
	id S28605145AbYCRPs6 convert rfc822-to-8bit (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 18 Mar 2008 15:48:58 +0000
Received: from dealogic.nl (a62-251-87-113.adsl.xs4all.nl [62.251.87.113])
	by smtp-vbr13.xs4all.nl (8.13.8/8.13.8) with ESMTP id m2IFmgQx036926
	for <linux-mips@linux-mips.org>; Tue, 18 Mar 2008 16:48:58 +0100 (CET)
	(envelope-from ncoesel@DEALogic.nl)
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Subject: RE: [PATCH][MIPS][5/6]: AR7: serial hack
Content-Transfer-Encoding: 8BIT
X-MimeOLE: Produced By Microsoft Exchange V6.5
Date:	Tue, 18 Mar 2008 16:40:23 +0100
Message-ID: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF85B@dealogicserver.DEALogic.nl>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [PATCH][MIPS][5/6]: AR7: serial hack
thread-index: AciJAs+MVV6DKv8GQWiw9FA8wJZFjgACykIw
From:	"Nico Coesel" <ncoesel@DEALogic.nl>
To:	<linux-mips@linux-mips.org>
X-Virus-Scanned: by XS4ALL Virus Scanner
Return-Path: <ncoesel@DEALogic.nl>
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: 18432
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: ncoesel@DEALogic.nl
Precedence: bulk
X-list: linux-mips

Hello all,
I didn't follow the entire discussion, but I might have similar problems
on the AU1100 SoC. The AU1100 also has 16550 style serial ports. The
serial console doesn't work even though I specify console=/dev/ttyS0 on
the kernel command line. Once a getty is started, the serial port is
active and working fine.

Nico

> -----Oorspronkelijk bericht-----
> Van: linux-mips-bounce@linux-mips.org 
> [mailto:linux-mips-bounce@linux-mips.org] Namens Alan Cox
> Verzonden: dinsdag 18 maart 2008 15:02
> Aan: Thomas Bogendoerfer
> CC: Matteo Croce; linux-mips@linux-mips.org; Florian 
> Fainelli; Felix Fietkau; Nicolas Thill; 
> linux-serial@vger.kernel.org; Andrew Morton
> Onderwerp: Re: [PATCH][MIPS][5/6]: AR7: serial hack
> 
> > Is there a good reason, why we don't check for BOTH_EMPTY in
> > serial8250_console_putchar() ? To match the 2.6.10 behaviour we
> 
> A very good one - we have at least 1 byte of FIFO and the 
> serial-ethernet magic console devices also use that fifo 
> emptying entirely to deduce when to send a new packet.
> 
> > would need that and this would fix the AR7 case without any special 
> > handling.
> 
> If the AR7 is an 8250 why does it need special handling? and 
> indeed why does serial work on it except for console - or 
> does that fail too.
> 
> 

From sshtylyov@ru.mvista.com Tue Mar 18 16:42:21 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Mar 2008 16:42:23 +0000 (GMT)
Received: from h155.mvista.com ([63.81.120.155]:27512 "EHLO imap.sh.mvista.com")
	by ftp.linux-mips.org with ESMTP id S28605406AbYCRQmV (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 18 Mar 2008 16:42:21 +0000
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id 1D01F3ECA; Tue, 18 Mar 2008 09:42:19 -0700 (PDT)
Message-ID: <47DFF13B.5060108@ru.mvista.com>
Date:	Tue, 18 Mar 2008 19:43:39 +0300
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
X-Accept-Language: ru, en-us, en-gb
MIME-Version: 1.0
To:	Nico Coesel <ncoesel@DEALogic.nl>
Cc:	linux-mips@linux-mips.org
Subject: Serial console on Au1100 
References: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF85B@dealogicserver.DEALogic.nl>
In-Reply-To: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF85B@dealogicserver.DEALogic.nl>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@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: 18433
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips

Hello.

Nico Coesel wrote:

> Hello all,
> I didn't follow the entire discussion, but I might have similar problems
> on the AU1100 SoC. The AU1100 also has 16550 style serial ports. The
> serial console doesn't work even though I specify console=/dev/ttyS0 on
> the kernel command line. Once a getty is started, the serial port is
> active and working fine.

    This is not at all related to the discussed issue, so I've changed the 
subject. The console works like charm (seemingly for everybody, which kernel 
version are you using?

> Nico

WBR, Sergei

From tsbogend@alpha.franken.de Tue Mar 18 21:48:01 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Mar 2008 21:48:04 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:4051 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28640765AbYCRVsB (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 18 Mar 2008 21:48:01 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1Jbjf6-0002n7-00; Tue, 18 Mar 2008 22:48:00 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id D7E77C2816; Tue, 18 Mar 2008 22:47:56 +0100 (CET)
From:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: [PATCH] IP28: switch to "normal" mode after PROM no longer needed
To:	linux-mips@linux-mips.org
cc:	ralf@linux-mips.org
Message-Id: <20080318214756.D7E77C2816@solo.franken.de>
Date:	Tue, 18 Mar 2008 22:47:56 +0100 (CET)
Return-Path: <tsbogend@alpha.franken.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: 18434
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips

SGI-IP28 is running in so called slow mode, when kernel is started
from the PROM. PROM calls must be done in slow mode otherwise the
PROM will issue an error. To get better memory performance we now
switch to normal mode, when the PROM is no longer needed.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---

 arch/mips/sgi-ip22/ip22-mc.c |   26 ++++++++++++++++++++++++++
 include/asm-mips/barrier.h   |   14 ++++++++++++++
 2 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/arch/mips/sgi-ip22/ip22-mc.c b/arch/mips/sgi-ip22/ip22-mc.c
index 3f35d63..5268ac1 100644
--- a/arch/mips/sgi-ip22/ip22-mc.c
+++ b/arch/mips/sgi-ip22/ip22-mc.c
@@ -208,4 +208,30 @@ void __init sgimc_init(void)
 void __init prom_meminit(void) {}
 void __init prom_free_prom_memory(void)
 {
+#ifdef CONFIG_SGI_IP28
+	u32 mconfig1;
+	unsigned long flags;
+	spinlock_t lock;
+
+	/*
+	 * because ARCS accesses memory uncached we wait until ARCS
+	 * isn't needed any longer, before we switch from slow to
+	 * normal mode
+	 */
+	spin_lock_irqsave(&lock, flags);
+	mconfig1 = sgimc->mconfig1;
+	/* map ECC register */
+	sgimc->mconfig1 = (mconfig1 & 0xffff0000) | 0x2060;
+	iob();
+	/* switch to normal mode */
+	*(unsigned long *)PHYS_TO_XKSEG_UNCACHED(0x60000000) = 0;
+	iob();
+	/* reduce WR_COL */
+	sgimc->cmacc = (sgimc->cmacc & ~0xf) | 4;
+	iob();
+	/* restore old config */
+	sgimc->mconfig1 = mconfig1;
+	iob();
+	spin_unlock_irqrestore(&lock, flags);
+#endif
 }
diff --git a/include/asm-mips/barrier.h b/include/asm-mips/barrier.h
index 9d8cfbb..8e9ac31 100644
--- a/include/asm-mips/barrier.h
+++ b/include/asm-mips/barrier.h
@@ -92,11 +92,25 @@
 #define fast_wmb()	__sync()
 #define fast_rmb()	__sync()
 #define fast_mb()	__sync()
+#ifdef CONFIG_SGI_IP28
+#define fast_iob()				\
+	__asm__ __volatile__(			\
+		".set	push\n\t"		\
+		".set	noreorder\n\t"		\
+		"lw	$0,%0\n\t"		\
+		"sync\n\t"			\
+		"lw	$0,%0\n\t"		\
+		".set	pop"			\
+		: /* no output */		\
+		: "m" (*(int *)CKSEG1ADDR(0x1fa00004)) \
+		: "memory")
+#else
 #define fast_iob()				\
 	do {					\
 		__sync();			\
 		__fast_iob();			\
 	} while (0)
+#endif
 
 #ifdef CONFIG_CPU_HAS_WB
 

From yoichi_yuasa@tripeaks.co.jp Tue Mar 18 22:52:12 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Mar 2008 22:52:14 +0000 (GMT)
Received: from mo31.po.2iij.NET ([210.128.50.54]:8727 "EHLO mo31.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S28640958AbYCRWwM (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 18 Mar 2008 22:52:12 +0000
Received: by mo.po.2iij.net (mo31) id m2IMpm89043647; Wed, 19 Mar 2008 07:51:48 +0900 (JST)
Received: from localhost (65.126.232.202.bf.2iij.net [202.232.126.65])
	by mbox.po.2iij.net (po-mbox303) id m2IMphMF024820
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Wed, 19 Mar 2008 07:51:43 +0900
Message-Id: <200803182251.m2IMphMF024820@po-mbox303.hop.2iij.net>
Date:	Wed, 19 Mar 2008 07:51:01 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	yoichi_yuasa@tripeaks.co.jp,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-mips <linux-mips@linux-mips.org>
Subject: [PATCH 2/2] add  VR41xx SIU setup for serial console
Organization: TriPeaks Corporation
X-Mailer: Sylpheed version 2.3.0beta5 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yoichi_yuasa@tripeaks.co.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: 18435
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: yoichi_yuasa@tripeaks.co.jp
Precedence: bulk
X-list: linux-mips

Add VR41xx SIU setup for serial console.

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>

diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/vr41xx/common/init.c linux/arch/mips/vr41xx/common/init.c
--- linux-orig/arch/mips/vr41xx/common/init.c	2008-03-12 17:03:15.200969168 +0900
+++ linux/arch/mips/vr41xx/common/init.c	2008-03-12 17:03:38.574609820 +0900
@@ -1,7 +1,7 @@
 /*
  *  init.c, Common initialization routines for NEC VR4100 series.
  *
- *  Copyright (C) 2003-2005  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+ *  Copyright (C) 2003-2008  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.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
@@ -53,6 +53,8 @@ void __init plat_time_init(void)
 void __init plat_mem_setup(void)
 {
 	iomem_resource_init();
+
+	vr41xx_siu_setup();
 }
 
 void __init prom_init(void)
diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/vr41xx/common/siu.c linux/arch/mips/vr41xx/common/siu.c
--- linux-orig/arch/mips/vr41xx/common/siu.c	2008-03-12 17:03:15.200969168 +0900
+++ linux/arch/mips/vr41xx/common/siu.c	2008-03-12 17:05:49.337802432 +0900
@@ -1,7 +1,7 @@
 /*
  *  NEC VR4100 series SIU platform device.
  *
- *  Copyright (C) 2007  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+ *  Copyright (C) 2007-2008  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.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
@@ -118,3 +118,37 @@ err_free_device:
 	return retval;
 }
 device_initcall(vr41xx_siu_add);
+
+void __init vr41xx_siu_setup(void)
+{
+	struct uart_port port;
+	struct resource *res;
+	unsigned int *type;
+	int i;
+
+	switch (current_cpu_type()) {
+	case CPU_VR4111:
+	case CPU_VR4121:
+		type = siu_type1_ports;
+		res = siu_type1_resource;
+		break;
+	case CPU_VR4122:
+	case CPU_VR4131:
+	case CPU_VR4133:
+		type = siu_type2_ports;
+		res = siu_type2_resource;
+		break;
+	default:
+		return;
+	}
+
+	for (i = 0; i < SIU_PORTS_MAX; i++) {
+		port.line = i;
+		port.type = type[i];
+		if (port.type == PORT_UNKNOWN)
+			break;
+		port.mapbase = res[i].start;
+		port.membase = (unsigned char __iomem *)KSEG1ADDR(res[i].start);
+		vr41xx_siu_early_setup(&port);
+	}
+}
diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/include/asm-mips/vr41xx/vr41xx.h linux/include/asm-mips/vr41xx/vr41xx.h
--- linux-orig/include/asm-mips/vr41xx/vr41xx.h	2008-03-12 17:04:01.248560582 +0900
+++ linux/include/asm-mips/vr41xx/vr41xx.h	2008-03-12 17:03:38.730540709 +0900
@@ -7,7 +7,7 @@
  * Copyright (C) 2001, 2002 Paul Mundt
  * Copyright (C) 2002 MontaVista Software, Inc.
  * Copyright (C) 2002 TimeSys Corp.
- * Copyright (C) 2003-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+ * Copyright (C) 2003-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.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
@@ -143,4 +143,10 @@ extern void vr41xx_disable_csiint(uint16
 extern void vr41xx_enable_bcuint(void);
 extern void vr41xx_disable_bcuint(void);
 
+#ifdef CONFIG_SERIAL_VR41XX_CONSOLE
+extern void vr41xx_siu_setup(void);
+#else
+static inline void vr41xx_siu_setup(void) {}
+#endif
+
 #endif /* __NEC_VR41XX_H */
diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/include/asm-mips/vr41xx/siu.h linux/include/asm-mips/vr41xx/siu.h
--- linux-orig/include/asm-mips/vr41xx/siu.h	2008-03-12 17:04:01.248560582 +0900
+++ linux/include/asm-mips/vr41xx/siu.h	2008-03-12 17:03:38.730540709 +0900
@@ -1,7 +1,7 @@
 /*
  *  Include file for NEC VR4100 series Serial Interface Unit.
  *
- *  Copyright (C) 2005  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+ *  Copyright (C) 2005-2008  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.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
@@ -49,4 +49,10 @@ typedef enum {
 
 extern void vr41xx_select_irda_module(irda_module_t module, irda_speed_t speed);
 
+#ifdef CONFIG_SERIAL_VR41XX_CONSOLE
+extern void vr41xx_siu_early_setup(struct uart_port *port);
+#else
+static inline void vr41xx_siu_early_setup(struct uart_port *port) {}
+#endif
+
 #endif /* __NEC_VR41XX_SIU_H */

From yoichi_yuasa@tripeaks.co.jp Tue Mar 18 22:52:35 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Mar 2008 22:52:38 +0000 (GMT)
Received: from mo30.po.2iij.net ([210.128.50.53]:5192 "EHLO mo30.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S28640956AbYCRWwM (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 18 Mar 2008 22:52:12 +0000
Received: by mo.po.2iij.net (mo30) id m2IMpm4m080801; Wed, 19 Mar 2008 07:51:48 +0900 (JST)
Received: from localhost (65.126.232.202.bf.2iij.net [202.232.126.65])
	by mbox.po.2iij.net (po-mbox302) id m2IMphhQ013534
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Wed, 19 Mar 2008 07:51:43 +0900
Message-Id: <200803182251.m2IMphhQ013534@po-mbox302.po.2iij.net>
Date:	Wed, 19 Mar 2008 07:49:57 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Andrew Morton <akpm@linux-foundation.org>
Cc:	yoichi_yuasa@tripeaks.co.jp, Ralf Baechle <ralf@linux-mips.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-mips <linux-mips@linux-mips.org>
Subject: [PATCH 1/2] add vr41xx_siu_early_setup() for serial console
Organization: TriPeaks Corporation
X-Mailer: Sylpheed version 2.3.0beta5 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yoichi_yuasa@tripeaks.co.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: 18436
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: yoichi_yuasa@tripeaks.co.jp
Precedence: bulk
X-list: linux-mips

Add vr41xx_siu_early_setup() for serial console

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>

diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/drivers/serial/vr41xx_siu.c linux/drivers/serial/vr41xx_siu.c
--- linux-orig/drivers/serial/vr41xx_siu.c	2008-03-12 17:03:43.420462106 +0900
+++ linux/drivers/serial/vr41xx_siu.c	2008-03-12 17:03:38.730540709 +0900
@@ -1,7 +1,7 @@
 /*
  *  Driver for NEC VR4100 series Serial Interface Unit.
  *
- *  Copyright (C) 2004-2007  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+ *  Copyright (C) 2004-2008  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
  *
  *  Based on drivers/serial/8250.c, by Russell King.
  *
@@ -840,6 +840,19 @@ static int __devinit siu_console_init(vo
 
 console_initcall(siu_console_init);
 
+void __init vr41xx_siu_early_setup(struct uart_port *port)
+{
+	if (port->type == PORT_UNKNOWN)
+		return;
+
+	siu_uart_ports[port->line].line = port->line;
+	siu_uart_ports[port->line].type = port->type;
+	siu_uart_ports[port->line].uartclk = SIU_BAUD_BASE * 16;
+	siu_uart_ports[port->line].mapbase = port->mapbase;
+	siu_uart_ports[port->line].mapbase = port->mapbase;
+	siu_uart_ports[port->line].ops = &siu_uart_ops;
+}
+
 #define SERIAL_VR41XX_CONSOLE	&siu_console
 #else
 #define SERIAL_VR41XX_CONSOLE	NULL

From kaminaga@sm.sony.co.jp Wed Mar 19 05:27:44 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 19 Mar 2008 05:27:46 +0000 (GMT)
Received: from ms4.Sony.CO.JP ([211.125.136.198]:36315 "EHLO ms4.sony.co.jp")
	by ftp.linux-mips.org with ESMTP id S20021514AbYCSF1o (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 19 Mar 2008 05:27:44 +0000
Received: from mta7.sony.co.jp (mta7.Sony.CO.JP [137.153.71.12])
 by ms4.sony.co.jp (R8/Sony) with ESMTP id m2J5QqeD000321;
 Wed, 19 Mar 2008 14:26:52 +0900 (JST)
Received: from mta7.sony.co.jp (localhost [127.0.0.1])
 by mta7.sony.co.jp (R8/Sony) with ESMTP id m2J5QqdB017166;
 Wed, 19 Mar 2008 14:26:52 +0900 (JST)
Received: from smail1.sm.sony.co.jp (smail1.sm.sony.co.jp [43.11.253.1])
 by mta7.sony.co.jp (R8/Sony) with ESMTP id m2J5Qq7r017162;
 Wed, 19 Mar 2008 14:26:52 +0900 (JST)
Received: from imail.sm.sony.co.jp (imail.sm.sony.co.jp [43.4.141.32]) by smail1.sm.sony.co.jp (8.11.6p2/8.11.6) with ESMTP id m2J5QrP20678; Wed, 19 Mar 2008 14:26:53 +0900 (JST)
Received: from localhost (tidal.sm.sony.co.jp [43.4.145.112])
	by imail.sm.sony.co.jp (8.12.11/3.7W) with ESMTP id m2J5QrhM006176;
	Wed, 19 Mar 2008 14:26:53 +0900 (JST)
Date:	Wed, 19 Mar 2008 14:21:40 +0900 (JST)
Message-Id: <20080319.142140.21932743.kaminaga@sm.sony.co.jp>
To:	dan@debian.org
Cc:	linux-mips@linux-mips.org, kaminaga@sm.sony.co.jp
Subject: Re: MIPS prelink question
From:	Hiroki Kaminaga <kaminaga@sm.sony.co.jp>
In-Reply-To: <20080318123330.GA18036@caradoc.them.org>
References: <20080318.154701.74743177.kaminaga@sm.sony.co.jp>
	<20080318123330.GA18036@caradoc.them.org>
X-Mailer: Mew version 4.2 on Emacs 21.2 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <kaminaga@sm.sony.co.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: 18437
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: kaminaga@sm.sony.co.jp
Precedence: bulk
X-list: linux-mips


Hi!

> It should be in their prelink source package.  Or here:
> 
>   http://sourceware.org/ml/prelink/2007-q4/msg00001.html

Thank you very mauch for pointer. I'll try this out and tell you
the result!


(Hiroki Kaminaga)
t
--

From yoichi_yuasa@tripeaks.co.jp Wed Mar 19 07:38:49 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 19 Mar 2008 07:38:51 +0000 (GMT)
Received: from mo31.po.2iij.NET ([210.128.50.54]:62260 "EHLO mo31.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S20021872AbYCSHit (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 19 Mar 2008 07:38:49 +0000
Received: by mo.po.2iij.net (mo31) id m2J7cjRB077153; Wed, 19 Mar 2008 16:38:45 +0900 (JST)
Received: from localhost (65.126.232.202.bf.2iij.net [202.232.126.65])
	by mbox.po.2iij.net (po-mbox304) id m2J7choL017852
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Wed, 19 Mar 2008 16:38:44 +0900
Message-Id: <200803190738.m2J7choL017852@po-mbox304.hop.2iij.net>
Date:	Wed, 19 Mar 2008 16:38:47 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	yoichi_yuasa@tripeaks.co.jp, linux-mips <linux-mips@linux-mips.org>
Subject: [PATCH][MIPS] add CP0 hazard to CP0 compare register accesses
In-Reply-To: <20080318132709.GC11382@linux-mips.org>
References: <20080317234740.705a8a34.yoichi_yuasa@tripeaks.co.jp>
	<20080317161635.GA25549@linux-mips.org>
	<200803180447.m2I4lJ40005091@po-mbox301.hop.2iij.net>
	<20080318132709.GC11382@linux-mips.org>
Organization: TriPeaks Corporation
X-Mailer: Sylpheed version 2.3.0beta5 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yoichi_yuasa@tripeaks.co.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: 18438
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: yoichi_yuasa@tripeaks.co.jp
Precedence: bulk
X-list: linux-mips

Hi,

On Tue, 18 Mar 2008 13:27:09 +0000
Ralf Baechle <ralf@linux-mips.org> wrote:

> On Tue, Mar 18, 2008 at 01:47:20PM +0900, Yoichi Yuasa wrote:
> 
> > On Mon, 17 Mar 2008 16:16:35 +0000
> > Ralf Baechle <ralf@linux-mips.org> wrote:
> > 
> > > On Mon, Mar 17, 2008 at 11:47:40PM +0900, Yoichi Yuasa wrote:
> > > 
> > > > VR41xx, CP0 hazard is necessary between read_c0_count() and write_c0_compare().
> > > 
> > > Interesting.  I wonder why you need this patch but nobody else?
> > 
> > Three NOP are necessary on the TB0287(VR4131 board).
> 
> That much was obvious from your patch.  I was more wondering about this
> change:
> 
> -               write_c0_compare(read_c0_count());
> +               c0_timer_ack();
> 
> c0_timer_ack is defined as
> 
> static void c0_timer_ack(void)
> {
>         write_c0_compare(read_c0_compare());
> }
> 
> so your patch does a functional change there - even though it should not
> actually matter.  So I was wondering if for some reason you need that
> change.

OK, update my patch.
Two patches have been brought together in one.

How about this?

VR41xx, CP0 hazard is necessary between read_c0_count() and write_c0_compare()
(or read_c0_cause()).

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>

diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/kernel/cevt-r4k.c linux/arch/mips/kernel/cevt-r4k.c
--- linux-orig/arch/mips/kernel/cevt-r4k.c	2008-03-19 11:35:53.017749179 +0900
+++ linux/arch/mips/kernel/cevt-r4k.c	2008-03-19 16:31:29.617938142 +0900
@@ -186,7 +186,9 @@ static int c0_compare_int_usable(void)
 	 * IP7 already pending?  Try to clear it by acking the timer.
 	 */
 	if (c0_compare_int_pending()) {
-		write_c0_compare(read_c0_count());
+		cnt = read_c0_count();
+		back_to_back_c0_hazard();
+		write_c0_compare(cnt);
 		irq_disable_hazard();
 		if (c0_compare_int_pending())
 			return 0;
@@ -205,10 +207,13 @@ static int c0_compare_int_usable(void)
 	while ((int)(read_c0_count() - cnt) <= 0)
 		;	/* Wait for expiry  */
 
+	back_to_back_c0_hazard();
 	if (!c0_compare_int_pending())
 		return 0;
 
-	write_c0_compare(read_c0_count());
+	cnt = read_c0_count();
+	back_to_back_c0_hazard();
+	write_c0_compare(cnt);
 	irq_disable_hazard();
 	if (c0_compare_int_pending())
 		return 0;

From kaminaga@sm.sony.co.jp Wed Mar 19 08:59:39 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 19 Mar 2008 08:59:46 +0000 (GMT)
Received: from ms5.Sony.CO.JP ([211.125.136.201]:10152 "EHLO ms5.sony.co.jp")
	by ftp.linux-mips.org with ESMTP id S20022164AbYCSI7j (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 19 Mar 2008 08:59:39 +0000
Received: from mta6.sony.co.jp (mta6.Sony.CO.JP [137.153.71.9])
 by ms5.sony.co.jp (R8/Sony) with ESMTP id m2J8wg6A018220;
 Wed, 19 Mar 2008 17:58:42 +0900 (JST)
Received: from mta6.sony.co.jp (localhost [127.0.0.1])
 by mta6.sony.co.jp (R8/Sony) with ESMTP id m2J8wgU3007933;
 Wed, 19 Mar 2008 17:58:42 +0900 (JST)
Received: from smail1.sm.sony.co.jp (smail1.sm.sony.co.jp [43.11.253.1])
 by mta6.sony.co.jp (R8/Sony) with ESMTP id m2J8wfrt007917;
 Wed, 19 Mar 2008 17:58:42 +0900 (JST)
Received: from imail.sm.sony.co.jp (imail.sm.sony.co.jp [43.4.141.32]) by smail1.sm.sony.co.jp (8.11.6p2/8.11.6) with ESMTP id m2J8wgP19517; Wed, 19 Mar 2008 17:58:42 +0900 (JST)
Received: from localhost (tidal.sm.sony.co.jp [43.4.145.112])
	by imail.sm.sony.co.jp (8.12.11/3.7W) with ESMTP id m2J8wgVA018495;
	Wed, 19 Mar 2008 17:58:42 +0900 (JST)
Date:	Wed, 19 Mar 2008 17:53:28 +0900 (JST)
Message-Id: <20080319.175328.28780867.kaminaga@sm.sony.co.jp>
To:	dan@debian.org
Cc:	linux-mips@linux-mips.org, kaminaga@sm.sony.co.jp
Subject: Re: MIPS prelink question
From:	Hiroki Kaminaga <kaminaga@sm.sony.co.jp>
In-Reply-To: <20080319.142140.21932743.kaminaga@sm.sony.co.jp>
References: <20080318.154701.74743177.kaminaga@sm.sony.co.jp>
	<20080318123330.GA18036@caradoc.them.org>
	<20080319.142140.21932743.kaminaga@sm.sony.co.jp>
X-Mailer: Mew version 4.2 on Emacs 21.2 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <kaminaga@sm.sony.co.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: 18439
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: kaminaga@sm.sony.co.jp
Precedence: bulk
X-list: linux-mips


> > It should be in their prelink source package.  Or here:
> > 
> >   http://sourceware.org/ml/prelink/2007-q4/msg00001.html
> 
> Thank you very mauch for pointer. I'll try this out and tell you
> the result!

With the patch from above URL, I'm now getting the working prelink!
Thanks a million!


(Hiroki Kaminaga)
t
--

From ncoesel@DEALogic.nl Wed Mar 19 09:35:30 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 19 Mar 2008 09:35:32 +0000 (GMT)
Received: from smtp-vbr6.xs4all.nl ([194.109.24.26]:29446 "EHLO
	smtp-vbr6.xs4all.nl") by ftp.linux-mips.org with ESMTP
	id S20022308AbYCSJfa convert rfc822-to-8bit (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 19 Mar 2008 09:35:30 +0000
Received: from dealogic.nl (a62-251-87-113.adsl.xs4all.nl [62.251.87.113])
	by smtp-vbr6.xs4all.nl (8.13.8/8.13.8) with ESMTP id m2J9Yvnh072533
	for <linux-mips@linux-mips.org>; Wed, 19 Mar 2008 10:35:29 +0100 (CET)
	(envelope-from ncoesel@DEALogic.nl)
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Subject: RE: Serial console on Au1100 
Content-Transfer-Encoding: 8BIT
X-MimeOLE: Produced By Microsoft Exchange V6.5
Date:	Wed, 19 Mar 2008 10:34:40 +0100
Message-ID: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF86E@dealogicserver.DEALogic.nl>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Serial console on Au1100 
thread-index: AciJFwlBP+AX6P9zTxeBRyzJE78jKAAgAbig
From:	"Nico Coesel" <ncoesel@DEALogic.nl>
To:	<linux-mips@linux-mips.org>
X-Virus-Scanned: by XS4ALL Virus Scanner
Return-Path: <ncoesel@DEALogic.nl>
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: 18440
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: ncoesel@DEALogic.nl
Precedence: bulk
X-list: linux-mips

Sergei,
I'm using kernel 2.6.24 now (before I used 2.6.21-rc4). I do see the
console messages on the framebuffer device.

Kernel options:
console=ttyS0 root=/dev/mtdblock0 rootfstype=jffs2 rw
video=au1100fb:panel:KERN_AU1100 tsdev.xres=320 tsdev.yres=234
console=tty0

If I omit console=tty0, then there is no output on the framebuffer
device or the serial port. I also tried setting the I/O address and so
on, but no luck.

Nico Coesel
 

> -----Oorspronkelijk bericht-----
> Van: Sergei Shtylyov [mailto:sshtylyov@ru.mvista.com] 
> Verzonden: dinsdag 18 maart 2008 17:44
> Aan: Nico Coesel
> CC: linux-mips@linux-mips.org
> Onderwerp: Serial console on Au1100 
> 
> Hello.
> 
> Nico Coesel wrote:
> 
> > Hello all,
> > I didn't follow the entire discussion, but I might have similar 
> > problems on the AU1100 SoC. The AU1100 also has 16550 style serial 
> > ports. The serial console doesn't work even though I specify 
> > console=/dev/ttyS0 on the kernel command line. Once a getty is 
> > started, the serial port is active and working fine.
> 
>     This is not at all related to the discussed issue, so 
> I've changed the subject. The console works like charm 
> (seemingly for everybody, which kernel version are you using?
> 
> > Nico
> 
> WBR, Sergei
> 

From mano@roarinelk.homelinux.net Wed Mar 19 10:52:18 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 19 Mar 2008 10:52:21 +0000 (GMT)
Received: from fnoeppeil48.netpark.at ([217.175.205.176]:21985 "EHLO
	roarinelk.homelinux.net") by ftp.linux-mips.org with ESMTP
	id S20022352AbYCSKwS (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 19 Mar 2008 10:52:18 +0000
Received: (qmail 29940 invoked by uid 1000); 19 Mar 2008 11:52:17 +0100
Date:	Wed, 19 Mar 2008 11:52:17 +0100
From:	Manuel Lauss <mano@roarinelk.homelinux.net>
To:	Nico Coesel <ncoesel@DEALogic.nl>
Cc:	linux-mips@linux-mips.org
Subject: Re: Serial console on Au1100
Message-ID: <20080319105217.GA28497@roarinelk.homelinux.net>
References: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF86E@dealogicserver.DEALogic.nl>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF86E@dealogicserver.DEALogic.nl>
User-Agent: Mutt/1.5.16 (2007-06-09)
Return-Path: <mano@roarinelk.homelinux.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: 18441
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: mano@roarinelk.homelinux.net
Precedence: bulk
X-list: linux-mips

On Wed, Mar 19, 2008 at 10:34:40AM +0100, Nico Coesel wrote:
> Sergei,
> I'm using kernel 2.6.24 now (before I used 2.6.21-rc4). I do see the
> console messages on the framebuffer device.
> 
> Kernel options:
> console=ttyS0 root=/dev/mtdblock0 rootfstype=jffs2 rw

try adding a baudrate to the commandline, like so:
 console=ttyS0,115200

-- 
 Manuel Lauss

From macro@linux-mips.org Wed Mar 19 11:12:29 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 19 Mar 2008 11:12:32 +0000 (GMT)
Received: from cerber.ds.pg.gda.pl ([153.19.208.18]:22999 "EHLO
	cerber.ds.pg.gda.pl") by ftp.linux-mips.org with ESMTP
	id S20022388AbYCSLM2 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 19 Mar 2008 11:12:28 +0000
Received: from localhost (unknown [127.0.0.17])
	by cerber.ds.pg.gda.pl (Postfix) with ESMTP id 0071F40075;
	Wed, 19 Mar 2008 12:12:29 +0100 (CET)
X-Virus-Scanned: amavisd-new at cerber.ds.pg.gda.pl
Received: from cerber.ds.pg.gda.pl ([153.19.208.18])
	by localhost (cerber.ds.pg.gda.pl [153.19.208.18]) (amavisd-new, port 10024)
	with ESMTP id x9u4abw7sIFN; Wed, 19 Mar 2008 12:12:23 +0100 (CET)
Received: from piorun.ds.pg.gda.pl (piorun.ds.pg.gda.pl [153.19.208.8])
	by cerber.ds.pg.gda.pl (Postfix) with ESMTP id 9EBD140072;
	Wed, 19 Mar 2008 12:12:23 +0100 (CET)
Received: by piorun.ds.pg.gda.pl (Postfix, from userid 2160)
	id 9119216405; Wed, 19 Mar 2008 12:12:23 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
	by piorun.ds.pg.gda.pl (Postfix) with ESMTP id 8D9D816404;
	Wed, 19 Mar 2008 11:12:23 +0000 (GMT)
Date:	Wed, 19 Mar 2008 11:12:23 +0000 (GMT)
From:	"Maciej W. Rozycki" <macro@linux-mips.org>
X-X-Sender: macro@piorun
To:	Ralf Baechle <ralf@linux-mips.org>
cc:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	linux-mips@linux-mips.org
Subject: Re: [PATCH] BCM1480: Init pci controller io_map_base
In-Reply-To: <20080310162825.GE31420@linux-mips.org>
Message-ID: <alpine.SOC.1.00.0803191111570.17546@piorun>
References: <20080308185155.BA791E31BE@solo.franken.de> <20080310162825.GE31420@linux-mips.org>
User-Agent: Alpine 1.00 (SOC 882 2007-12-20)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
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: 18442
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, 10 Mar 2008, Ralf Baechle wrote:

> Thanks, applied.  But this patch only solves the problem for the BCM1480's
> native PCI bus.  Support for PCI behind HT still needs to be fixed and I'm
> not quite sure where the ports of such devices and busses are getting
> mapped to.

 Hmm, A_BCM1480_PHYS_HT_IO_MATCH_BYTES?

  Maciej

From tsbogend@alpha.franken.de Wed Mar 19 12:20:51 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 19 Mar 2008 12:20:58 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:39871 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S20022558AbYCSMUv (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 19 Mar 2008 12:20:51 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JbxHm-0008Ju-00; Wed, 19 Mar 2008 13:20:50 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id 65662C28E1; Wed, 19 Mar 2008 13:20:42 +0100 (CET)
Date:	Wed, 19 Mar 2008 13:20:42 +0100
To:	"Maciej W. Rozycki" <macro@linux-mips.org>
Cc:	Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
Subject: Re: [PATCH] BCM1480: Init pci controller io_map_base
Message-ID: <20080319122042.GA6194@alpha.franken.de>
References: <20080308185155.BA791E31BE@solo.franken.de> <20080310162825.GE31420@linux-mips.org> <alpine.SOC.1.00.0803191111570.17546@piorun>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <alpine.SOC.1.00.0803191111570.17546@piorun>
User-Agent: Mutt/1.5.13 (2006-08-11)
From:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Return-Path: <tsbogend@alpha.franken.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: 18443
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips

On Wed, Mar 19, 2008 at 11:12:23AM +0000, Maciej W. Rozycki wrote:
> On Mon, 10 Mar 2008, Ralf Baechle wrote:
> 
> > Thanks, applied.  But this patch only solves the problem for the BCM1480's
> > native PCI bus.  Support for PCI behind HT still needs to be fixed and I'm
> > not quite sure where the ports of such devices and busses are getting
> > mapped to.
> 
>  Hmm, A_BCM1480_PHYS_HT_IO_MATCH_BYTES?

we could switch to IO_MATCH_BITS, but then we need to disable software
swapping and use address mangling. I personaly prefer to do swapping
in software.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

From sshtylyov@ru.mvista.com Thu Mar 20 17:58:16 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 20 Mar 2008 17:58:19 +0000 (GMT)
Received: from rtsoft3.corbina.net ([85.21.88.6]:41653 "EHLO
	buildserver.ru.mvista.com") by ftp.linux-mips.org with ESMTP
	id S28575438AbYCTR6Q (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 20 Mar 2008 17:58:16 +0000
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id 6CC408816; Thu, 20 Mar 2008 22:58:33 +0400 (SAMT)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	ralf@linux-mips.org
Subject: [PATCH] Make KGDB compile on UP
Date:	Thu, 20 Mar 2008 20:59:34 +0300
User-Agent: KMail/1.5
Cc:	linux-mips@linux-mips.org
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200803202059.37857.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@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: 18444
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips

Building UP kernel with KGDB enabled produces the following errors and warning
(fatal due to -Werror in arch/mips/kernel/Makefile):

In file included from arch/mips/kernel/gdb-stub.c:142:
include/asm/smp.h:25:1: "raw_smp_processor_id" redefined
In file included from include/linux/sched.h:69,
                 from arch/mips/kernel/gdb-stub.c:126:
include/linux/smp.h:88:1: this is the location of the previous definition
In file included from arch/mips/kernel/gdb-stub.c:142:
include/asm/smp.h:62: error: redefinition of 'smp_send_reschedule'
include/linux/smp.h:102: error: previous definition of 'smp_send_reschedule' was here
include/asm/smp.h: In function `smp_send_reschedule':
include/asm/smp.h:65: error: dereferencing pointer to incomplete type
arch/mips/kernel/gdb-stub.c: At top level:
arch/mips/kernel/gdb-stub.c:660: warning: 'kgdb_wait' defined but not used

Fix the errors by not directly including <asm/smp.h> (which is already included
by <linux/smp.h>) and the warning by enclosing kgdb_wait() in #ifdef CONFIG_SMP.

---
This should be applied to 2.6.23+ stable branches since -Werror was introduced
in 2.6.23-rc2; the errors only started occuring after 2.6.24...

 arch/mips/kernel/gdb-stub.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6/arch/mips/kernel/gdb-stub.c
===================================================================
--- linux-2.6.orig/arch/mips/kernel/gdb-stub.c
+++ linux-2.6/arch/mips/kernel/gdb-stub.c
@@ -139,7 +139,6 @@
 #include <asm/system.h>
 #include <asm/gdb-stub.h>
 #include <asm/inst.h>
-#include <asm/smp.h>
 
 /*
  * external low-level support routines
@@ -656,6 +655,7 @@ void set_async_breakpoint(unsigned long 
 	*epc = (unsigned long)async_breakpoint;
 }
 
+#ifdef CONFIG_SMP
 static void kgdb_wait(void *arg)
 {
 	unsigned flags;
@@ -668,6 +668,7 @@ static void kgdb_wait(void *arg)
 
 	local_irq_restore(flags);
 }
+#endif
 
 /*
  * GDB stub needs to call kgdb_wait on all processor with interrupts


From beistin@gmail.com Thu Mar 20 19:57:47 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 20 Mar 2008 19:57:50 +0000 (GMT)
Received: from hs-out-0708.google.com ([64.233.178.248]:24876 "EHLO
	hs-out-0708.google.com") by ftp.linux-mips.org with ESMTP
	id S28575344AbYCTT5r (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 20 Mar 2008 19:57:47 +0000
Received: by hs-out-0708.google.com with SMTP id x43so1044653hsb.0
        for <linux-mips@linux-mips.org>; Thu, 20 Mar 2008 12:57:35 -0700 (PDT)
DKIM-Signature:	v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=beta;
        h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type;
        bh=2zlo7VDJuQSuZAJKItAB20nMq9mh7RyRyGhHQROQzFI=;
        b=cKPFvDFRqXNlq5pZbZAZIbwxMOmMK/Ph+M0+UhktJReYfXF9q3MHc6zuNJ/Js2l4F4oopbC6hnCLh2tEofyjZSE/B5exaRY0nDdbP/Sc4QxdOgwI+OYWcdxvybmdgNi4DIAqvdfQIvqHeAA9QMXAp14fKOijrFDKEOAUOBFW3Pk=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=beta;
        h=message-id:date:from:to:subject:mime-version:content-type;
        b=Ha83ltRSaah9VQuasm8kMtijvJYTWbhVTEHhEQwFc3EtHuBDt3AwmUahaxq7IiXF49PokBDCqvII2QODAirLCRxUW2isvsU+FPEtiiBoZaB/9k/jL/eo5NaRfQDUAVKD/Am7yct2mseKs57Wb8kc98Q4XoIYgVYIdWq0WAGFG3s=
Received: by 10.100.14.2 with SMTP id 2mr6575889ann.16.1206043055196;
        Thu, 20 Mar 2008 12:57:35 -0700 (PDT)
Received: by 10.100.198.15 with HTTP; Thu, 20 Mar 2008 12:57:34 -0700 (PDT)
Message-ID: <1feaefbd0803201257s88d88b8qcfae52bceeb43a54@mail.gmail.com>
Date:	Thu, 20 Mar 2008 20:57:34 +0100
From:	"Benoit Istin" <beistin@gmail.com>
To:	linux-mips@linux-mips.org
Subject: [Patch] cpmac ethernet fix for linux 2.6.24.2
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2026_1938395.1206043055068"
Return-Path: <beistin@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: 18446
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: beistin@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 4196
Lines: 73

------=_Part_2026_1938395.1206043055068
Content-Type: multipart/alternative; 
	boundary="----=_Part_2027_24085917.1206043055069"

------=_Part_2027_24085917.1206043055069
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,

I tried a recent snapshot of openWrt project and it happened that the
ethernet card was not initialised on my DSL624T (AR7 based modem/router).

According to what I could find in the news, there is a conflict during
registration of the driver, so I tried to fix it.
And here it comes the patch that allowed me to have my cpmac eth0 up and
running.
As I am not an experiment kernel hacker, this may be not the good way to do
it, but a least, it look more like what  other drivers do :)

Could someone apply this patch to the kernel tree?
Best regards
B.I.

------=_Part_2027_24085917.1206043055069
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,<br><br>I tried a recent snapshot of openWrt project and it happened that the ethernet card was not initialised on my DSL624T (AR7 based modem/router).<br><br>According to what I could find in the news, there is a conflict during registration of the driver, so I tried to fix it.<br>
And here it comes the patch that allowed me to have my cpmac eth0 up and running.<br>As I am not an experiment kernel hacker, this may be not the good way to do it, but a least, it look more like what&nbsp; other drivers do :)<br>
<br>Could someone apply this patch to the kernel tree?<br>Best regards<br>B.I.<br><br>

------=_Part_2027_24085917.1206043055069--

------=_Part_2026_1938395.1206043055068
Content-Type: text/x-patch; name=cpmac_eth_fix.patch
Content-Transfer-Encoding: base64
X-Attachment-Id: f_fe1qm121
Content-Disposition: attachment; filename=cpmac_eth_fix.patch

ZGlmZiAtcHJ1TiBsaW51eC0yLjYuMjQuMi5vbGQvZHJpdmVycy9uZXQvY3BtYWMuYyBsaW51eC0y
LjYuMjQuMi9kcml2ZXJzL25ldC9jcG1hYy5jCi0tLSBsaW51eC0yLjYuMjQuMi5vbGQvZHJpdmVy
cy9uZXQvY3BtYWMuYwkyMDA4LTAzLTIwIDIwOjMzOjAxLjAwMDAwMDAwMCArMDEwMAorKysgbGlu
dXgtMi42LjI0LjIvZHJpdmVycy9uZXQvY3BtYWMuYwkyMDA4LTAzLTIwIDIwOjQ3OjMxLjAwMDAw
MDAwMCArMDEwMApAQCAtMTExMiw3ICsxMTEyLDggQEAgc3RhdGljIGludCBleHRlcm5hbF9zd2l0
Y2g7CiAKIHN0YXRpYyBpbnQgX19kZXZpbml0IGNwbWFjX3Byb2JlKHN0cnVjdCBwbGF0Zm9ybV9k
ZXZpY2UgKnBkZXYpCiB7Ci0JaW50IHJjLCBwaHlfaWQsIGk7CisJaW50IHJjLCBpOworCWludCBw
aHlfaWQ7CiAJaW50IG1kaW9fYnVzX2lkID0gY3BtYWNfbWlpLmlkOwogCXN0cnVjdCByZXNvdXJj
ZSAqbWVtOwogCXN0cnVjdCBjcG1hY19wcml2ICpwcml2OwpAQCAtMTEzMiw3ICsxMTMzLDcgQEAg
c3RhdGljIGludCBfX2RldmluaXQgY3BtYWNfcHJvYmUoc3RydWN0IAogCiAJaWYgKHBoeV9pZCA9
PSBQSFlfTUFYX0FERFIpIHsKIAkJaWYgKGV4dGVybmFsX3N3aXRjaCB8fCBkdW1iX3N3aXRjaCkg
ewotCQkJbWRpb19idXNfaWQgPSAwOyAvKiBmaXhlZCBwaHlzIGJ1cyAqLworCQkJbWRpb19idXNf
aWQgPSAwOyAKIAkJCXBoeV9pZCA9IHBkZXYtPmlkOwogCQl9IGVsc2UgewogCQkJZGV2X2Vycigm
cGRldi0+ZGV2LCAibm8gUEhZIHByZXNlbnRcbiIpOwpAQCAtMTE3OCw5ICsxMTc5LDcgQEAgc3Rh
dGljIGludCBfX2RldmluaXQgY3BtYWNfcHJvYmUoc3RydWN0IAogCXByaXYtPm1zZ19lbmFibGUg
PSBuZXRpZl9tc2dfaW5pdChkZWJ1Z19sZXZlbCwgMHhmZik7CiAJbWVtY3B5KGRldi0+ZGV2X2Fk
ZHIsIHBkYXRhLT5kZXZfYWRkciwgc2l6ZW9mKGRldi0+ZGV2X2FkZHIpKTsKIAotCXNucHJpbnRm
KHByaXYtPnBoeV9uYW1lLCBCVVNfSURfU0laRSwgUEhZX0lEX0ZNVCwgbWRpb19idXNfaWQsIHBo
eV9pZCk7Ci0KLQlwcml2LT5waHkgPSBwaHlfY29ubmVjdChkZXYsIHByaXYtPnBoeV9uYW1lLCAm
Y3BtYWNfYWRqdXN0X2xpbmssIDAsCisJcHJpdi0+cGh5ID0gcGh5X2Nvbm5lY3QoZGV2LCBjcG1h
Y19taWkucGh5X21hcFtwaHlfaWRdLT5kZXYuYnVzX2lkLCAmY3BtYWNfYWRqdXN0X2xpbmssIDAs
CiAJCQkJUEhZX0lOVEVSRkFDRV9NT0RFX01JSSk7CiAJaWYgKElTX0VSUihwcml2LT5waHkpKSB7
CiAJCWlmIChuZXRpZl9tc2dfZHJ2KHByaXYpKQpAQCAtMTIyMiwxMyArMTIyMSwxMyBAQCBzdGF0
aWMgc3RydWN0IHBsYXRmb3JtX2RyaXZlciBjcG1hY19kcml2CiAJLnJlbW92ZSA9IF9fZGV2ZXhp
dF9wKGNwbWFjX3JlbW92ZSksCiB9OwogCi1pbnQgX19kZXZpbml0IGNwbWFjX2luaXQodm9pZCkK
K2ludCBfX2RldmluaXQgY3BtYWNfaW5pdChzdHJ1Y3QgcGxhdGZvcm1fZGV2aWNlICpwbGRldiwg
bG9uZyBsb25nIGJhc2UpCiB7CiAJdTMyIG1hc2s7CiAJaW50IGksIHJlczsKIAorCWNwbWFjX21p
aS5pZD1wbGRldi0+aWQ7CiAJY3BtYWNfbWlpLnByaXYgPSBpb3JlbWFwKEFSN19SRUdTX01ESU8s
IDI1Nik7Ci0KIAlpZiAoIWNwbWFjX21paS5wcml2KSB7CiAJCXByaW50ayhLRVJOX0VSUiAiQ2Fu
J3QgaW9yZW1hcCBtZGlvIHJlZ2lzdGVyc1xuIik7CiAJCXJldHVybiAtRU5YSU87Cg==
------=_Part_2026_1938395.1206043055068--

From sshtylyov@ru.mvista.com Thu Mar 20 20:46:42 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 20 Mar 2008 20:46:44 +0000 (GMT)
Received: from h155.mvista.com ([63.81.120.155]:44777 "EHLO imap.sh.mvista.com")
	by ftp.linux-mips.org with ESMTP id S28575553AbYCTUqm (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 20 Mar 2008 20:46:42 +0000
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id D6A303ECA; Thu, 20 Mar 2008 13:46:38 -0700 (PDT)
Message-ID: <47E2CD81.3050107@ru.mvista.com>
Date:	Thu, 20 Mar 2008 23:48:01 +0300
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
X-Accept-Language: ru, en-us, en-gb
MIME-Version: 1.0
To:	ralf@linux-mips.org
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] Make KGDB compile on UP
References: <200803202059.37857.sshtylyov@ru.mvista.com>
In-Reply-To: <200803202059.37857.sshtylyov@ru.mvista.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@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: 18447
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1187
Lines: 26

Hi, I wrote:

> Building UP kernel with KGDB enabled produces the following errors and warning
> (fatal due to -Werror in arch/mips/kernel/Makefile):
> 
> In file included from arch/mips/kernel/gdb-stub.c:142:
> include/asm/smp.h:25:1: "raw_smp_processor_id" redefined
> In file included from include/linux/sched.h:69,
>                  from arch/mips/kernel/gdb-stub.c:126:
> include/linux/smp.h:88:1: this is the location of the previous definition
> In file included from arch/mips/kernel/gdb-stub.c:142:
> include/asm/smp.h:62: error: redefinition of 'smp_send_reschedule'
> include/linux/smp.h:102: error: previous definition of 'smp_send_reschedule' was here
> include/asm/smp.h: In function `smp_send_reschedule':
> include/asm/smp.h:65: error: dereferencing pointer to incomplete type
> arch/mips/kernel/gdb-stub.c: At top level:
> arch/mips/kernel/gdb-stub.c:660: warning: 'kgdb_wait' defined but not used
> 
> Fix the errors by not directly including <asm/smp.h> (which is already included
> by <linux/smp.h>) and the warning by enclosing kgdb_wait() in #ifdef CONFIG_SMP.

    As usual, forgot to stamp:

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

WBR, Sergei

From tsbogend@alpha.franken.de Fri Mar 21 01:55:45 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Mar 2008 01:55:48 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:23257 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28576465AbYCUBzp (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 21 Mar 2008 01:55:45 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JcWTu-0007B3-00; Fri, 21 Mar 2008 02:55:42 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id 9074FFA04B; Fri, 21 Mar 2008 02:55:40 +0100 (CET)
Date:	Fri, 21 Mar 2008 02:55:40 +0100
To:	Matteo Croce <technoboy85@gmail.com>
Cc:	linux-mips@linux-mips.org, Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH][MIPS][5/6]: AR7: serial hack
Message-ID: <20080321015540.GA30988@alpha.franken.de>
References: <200803120221.25044.technoboy85@gmail.com> <200803141646.09645.technoboy85@gmail.com> <20080315104009.GA6533@alpha.franken.de> <200803161645.06364.technoboy85@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200803161645.06364.technoboy85@gmail.com>
User-Agent: Mutt/1.5.13 (2006-08-11)
From:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Return-Path: <tsbogend@alpha.franken.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: 18448
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips
Content-Length: 3729
Lines: 99

On Sun, Mar 16, 2008 at 04:45:06PM +0100, Matteo Croce wrote:
> Tried I get teh usual broken serial output:
> 
> IP6 oover IPv4 tuneliing driver
> NET: eggistered protooll family 17
> VFS: Monteed root (squahfss filesystem)reaadonly.

Linux version 2.6.25-rc6-00000-g151de9e-dirty (tsbogend@solo.franken.de)
(gcc version 3.3.3 (Debian 20040320)) #29 Fri Mar 21 02:40:21 CET 2008
console [early0] enabled
CPU revision is: 00018448 (MIPS 4KEc)
TI AR7 (Unknown), ID: 0x5700, Revision: 0x00
Determined physical RAM map:
 memory: 02000000 @ 14000000 (usable)
Zone PFN ranges:
  Normal      81920 ->    90112
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0:    81920 ->    90112
Built 1 zonelists in Zone order, mobility grouping on.  Total pages:
8128
Kernel command line: console=ttyS0,115200
Primary instruction cache 16kB, VIPT, 4-way, linesize 16 bytes.
Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 16 bytes
Synthesized clear page handler (26 instructions).
Synthesized copy page handler (46 instructions).
PID hash table entries: 128 (order: 7, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 29700k/32768k available (2075k kernel code, 3068k reserved, 466k
data, 136k init, 0k highmem)
Mount-cache hash table entries: 512
net_namespace: 152 bytes
NET: Registered protocol family 16
SCSI subsystem initialized
NET: Registered protocol family 2
Time: MIPS clocksource has been installed.
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing
disabled
serial8250: ttyS0 at MMIO 0x8610e03 (irq = 15) is a 16550A
console handover: boot [early0] -> real [ttyS0]
serial8250: ttyS1 at MMIO 0x8610f03 (irq = 16) is a 16550A
loop: module loaded
Fixed MDIO Bus: probed
ar7_wdt: failed to unlock WDT disable reg
ar7_wdt: failed to unlock WDT prescale reg
ar7_wdt: failed to unlock WDT change reg
ar7_wdt: timer margin 59 seconds (prescale 65535, change 57180, freq
62500000)
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
List of all partitions:
No filesystem could mount root, tried:
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(2,0)
Rebooting in 3 seconds..

I don't see any problems with using PORT_16550A. What I'm still
wondering how your kernel could work at all, since there is a
missing case for setting up the TLB refill handler. Something like
the patch below.

And most of the AR7 device driver code will not work for big endian. 
The log above is from a big endian AR7 system, where I needed
to disable CPMAC to get it booting that far.

Thomas.


diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 3a93d4c..382738c 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -307,6 +307,7 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
 	case CPU_R12000:
 	case CPU_R14000:
 	case CPU_4KC:
+	case CPU_4KEC:
 	case CPU_SB1:
 	case CPU_SB1A:
 	case CPU_4KSC:


-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

From post@pfrst.de Fri Mar 21 15:11:58 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Mar 2008 15:12:00 +0000 (GMT)
Received: from mail1.pearl-online.net ([62.159.194.147]:40550 "EHLO
	mail1.pearl-online.net") by ftp.linux-mips.org with ESMTP
	id S28577181AbYCUPL6 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 21 Mar 2008 15:11:58 +0000
Received: from SNaIlmail.Peter (85.233.32.210.static.cablesurf.de [85.233.32.210])
	by mail1.pearl-online.net (Postfix) with ESMTP id 5E53FCAF8;
	Fri, 21 Mar 2008 16:11:41 +0100 (CET)
Received: from Indigo2.Peter (Indigo2.Peter [192.168.1.28])
	by SNaIlmail.Peter (8.12.6/8.12.6/Sendmail/Linux 2.0.32) with ESMTP id m2KIbLfM000974;
	Thu, 20 Mar 2008 19:37:22 +0100
Received: from Indigo2.Peter (localhost [127.0.0.1])
	by Indigo2.Peter (8.12.6/8.12.6/Sendmail/Linux 2.6.24-ip28) with ESMTP id m2LF3HE3000201;
	Fri, 21 Mar 2008 16:03:17 +0100
Received: from localhost (pf@localhost)
	by Indigo2.Peter (8.12.6/8.12.6/Submit) with ESMTP id m2LF3GoO000198;
	Fri, 21 Mar 2008 16:03:17 +0100
X-Authentication-Warning: Indigo2.Peter: pf owned process doing -bs
Date:	Fri, 21 Mar 2008 16:03:16 +0100 (CET)
From:	peter fuerst <post@pfrst.de>
X-X-Sender: pf@Indigo2.Peter
Reply-To: post@pfrst.de
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] IP28: fix MC GIOPAR setting
Message-ID: <Pine.LNX.4.58.0803211535570.423@Indigo2.Peter>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Return-Path: <post@pfrst.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: 18449
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: post@pfrst.de
Precedence: bulk
X-list: linux-mips
Content-Length: 691
Lines: 21



We must not omit the MASTERGFX setting, unless we want Impact DMA to hang ;-)


Signed-off-by: peter fuerst <post@pfrst.de>


--- a/arch/mips/sgi-ip22/ip22-mc.c	Tue Jan 29 10:14:58 2008
+++ b/arch/mips/sgi-ip22/ip22-mc.c	Fri Mar 21 13:59:42 2008
@@ -180,7 +180,9 @@
 	/* First the basic invariants across all GIO64 implementations. */
 	tmp = SGIMC_GIOPAR_HPC64;	/* All 1st HPC's interface at 64bits */
 	tmp |= SGIMC_GIOPAR_ONEBUS;	/* Only one physical GIO bus exists */
-
+#ifdef CONFIG_SGI_IP28
+	tmp |= SGIMC_GIOPAR_MASTERGFX;	/* GFX can act as a bus master */
+#endif
 	if (ip22_is_fullhouse()) {
 		/* Fullhouse specific settings. */
 		if (SGIOC_SYSID_BOARDREV(sgioc->sysid) < 2) {

From sshtylyov@ru.mvista.com Fri Mar 21 15:20:11 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Mar 2008 15:20:13 +0000 (GMT)
Received: from h155.mvista.com ([63.81.120.155]:55564 "EHLO imap.sh.mvista.com")
	by ftp.linux-mips.org with ESMTP id S28577222AbYCUPUL (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 21 Mar 2008 15:20:11 +0000
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id 00CD43ECB; Fri, 21 Mar 2008 08:20:08 -0700 (PDT)
Message-ID: <47E3D27B.5010908@ru.mvista.com>
Date:	Fri, 21 Mar 2008 18:21:31 +0300
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
X-Accept-Language: ru, en-us, en-gb
MIME-Version: 1.0
To:	Nico Coesel <ncoesel@DEALogic.nl>
Cc:	linux-mips@linux-mips.org
Subject: Re: Serial console on Au1100
References: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF86E@dealogicserver.DEALogic.nl>
In-Reply-To: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF86E@dealogicserver.DEALogic.nl>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@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: 18450
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 620
Lines: 24

Hello.

Nico Coesel wrote:

> Sergei,
> I'm using kernel 2.6.24 now (before I used 2.6.21-rc4). I do see the
> console messages on the framebuffer device.

> Kernel options:
> console=ttyS0 root=/dev/mtdblock0 rootfstype=jffs2 rw
> video=au1100fb:panel:KERN_AU1100 tsdev.xres=320 tsdev.yres=234
> console=tty0

> If I omit console=tty0, then there is no output on the framebuffer

    You're specifying console twice, but without a baud rate. Also, do you 
have  CONFIG_SERIAL_8250_CONSOLE enabled?

> device or the serial port. I also tried setting the I/O address and so
> on, but no luck.

> Nico Coesel

WBR, Sergei

From lstefani@yahoo.com Fri Mar 21 16:01:14 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Mar 2008 16:01:16 +0000 (GMT)
Received: from web38810.mail.mud.yahoo.com ([209.191.125.101]:52654 "HELO
	web38810.mail.mud.yahoo.com") by ftp.linux-mips.org with SMTP
	id S28577473AbYCUQBO (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 21 Mar 2008 16:01:14 +0000
Received: (qmail 92359 invoked by uid 60001); 21 Mar 2008 16:00:52 -0000
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
  s=s1024; d=yahoo.com;
  h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID;
  b=ry3zeCwfTyvu1WL+CLM07sOhFdfQrvcR6SF34NSP27XCHaiDYSKANCd+V9HALSZLT/HOmD6v3VRh3hRb55luSvPbkQTVu6shEaJQPKNPdZNvEr636/DQ+rujXh+5pfzC2r3QyW0RoN4e8KYjJxuRHONt/wPlFmgW/tuPMZhqcTM=;
X-YMail-OSG: 45DGeD8VM1lA_zSuzCBvUHobPt.7j6n9Wz6VZbSFZyGggDvggU7.3ODfVc4Sk.bKqvV1.eLjj8TgZve4iF55vpSD6xTBZVkVTstfzc9c2wiONQPn5Z2CtINeR69Vzw--
Received: from [68.236.82.170] by web38810.mail.mud.yahoo.com via HTTP; Fri, 21 Mar 2008 09:00:52 PDT
Date:	Fri, 21 Mar 2008 09:00:52 -0700 (PDT)
From:	Larry Stefani <lstefani@yahoo.com>
Subject: Extraneous line in interrupt.h in 2.6.16.60 kernel?
To:	linux-mips@linux-mips.org
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Message-ID: <582735.81620.qm@web38810.mail.mud.yahoo.com>
Return-Path: <lstefani@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: 18451
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: lstefani@yahoo.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1187
Lines: 45

Hi,

Back in 2.6.16.29, there were a lot changes made to
support MT_SMTC.  Among them were changes to the
include/asm-mips/interrupt.h:

__asm__ (
  " .macro  local_irq_enable        \n"
  " .set  push            \n"
  " .set  reorder           \n"
  " .set  noat            \n"
#ifdef CONFIG_CPU_MIPSR2
  " .set  mips32r2          \n"
#ifdef CONFIG_MIPS_MT_SMTC
  "mfc0 $1, $2, 1 # SMTC - clear TCStatus.IXMT    \n"
  "ori  $1, 0x400           \n"
  "xori $1, 0x400           \n"
  "mtc0 $1, $2, 1           \n"
#else
  " .set  mips32r2          \n"
  " ei              \n"
  " .set  mips0           \n"
#endif
#else
  " mfc0  $1,$12            \n"
  " ori $1,0x1f           \n"
  " xori  $1,0x1e           \n"
  " mtc0  $1,$12            \n"
#endif
  " irq_enable_hazard         \n"
  " .set  pop           \n"
  " .endm");


Am I missing something, or is the second ".set 
mips32r2  \n" (line 51) redundant?

Thanks,
Larry Stefani
lstefani@yahoo.com


      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

From memorylost@tin.it Fri Mar 21 16:22:46 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Mar 2008 16:22:48 +0000 (GMT)
Received: from [85.37.17.112] ([85.37.17.112]:45835 "EHLO smtp-out112.alice.it")
	by ftp.linux-mips.org with ESMTP id S28577343AbYCUQWq (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 21 Mar 2008 16:22:46 +0000
Received: from FBCMMO01.fbc.local ([192.168.68.195]) by smtp-out112.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Fri, 21 Mar 2008 17:22:31 +0100
Received: from FBCMCL01B06.fbc.local ([192.168.69.87]) by FBCMMO01.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Fri, 21 Mar 2008 17:22:30 +0100
Received: from [192.168.1.200] ([82.48.161.252]) by FBCMCL01B06.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Fri, 21 Mar 2008 17:22:29 +0100
Message-ID: <47E3E0C2.9070404@tin.it>
Date:	Fri, 21 Mar 2008 17:22:26 +0100
From:	LD <memorylost@tin.it>
User-Agent: Thunderbird 2.0.0.6 (X11/20071022)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: AU1100 2.4.21-pre4 flash disks problems
X-Enigmail-Version: 0.95.6
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 21 Mar 2008 16:22:30.0105 (UTC) FILETIME=[C282EC90:01C88B6F]
Return-Path: <memorylost@tin.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: 18452
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: memorylost@tin.it
Precedence: bulk
X-list: linux-mips
Content-Length: 1688
Lines: 49

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

Hi all,
I am working on an AU1100 system, using a 2.4.21-pre4 kernel. Filesystem
is jffs2, uclibc libraries.

I have a couple of problems with USB flash disk handling:

1) it seems that my system does not "see" disks larger than 512 MB. 1GB
disks or more cannot be mounted. This is becoming a problem because
512MB disks are going out of the market.

2) Given two flash disks of different sizes (for example: one 128 MB,
one 512 MB), if I mount/umount one of them -> I cannot then mount the
other and vice versa.
Example:

- - mount the 128 MB one, then umount. Try to mount the 512MB ->fail.
- - reset the device
- - mount the 512MB device, ok. Umount. Try to mount the 128MB -> fail.

Disks are vfat formatted ; did not try with other filesystem types.

Tried to use a 2.6.x kernel and no problem ; I am planning to switch all
to 2.6.x kernel, but in this moment for me is better (if possible)
fixing this problem, because I have a number of applications and drivers
running on 2.4.21 and the switching to 2.6.x means revising and
re-testing a lot of things.

Back to 2.4.21...
If I try to dmesg I see a "Partition check:" message missing when I put
in the second disk ; I am investigating on this (maybe some piece of
software is called checking for partitions on the first disk but is not
called again when I change disk type).

Any suggestions are welcome,

best regards

Lucio Dona'
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH4+DCvxHCsvXy9okRApudAJwON54jwrtPtgKd2zImEjmYbPbpRwCgsnWr
4nWlOjZbQtNDzqFUcfRRltI=
=vh3N
-----END PGP SIGNATURE-----

From memorylost@tin.it Fri Mar 21 16:35:38 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Mar 2008 16:35:40 +0000 (GMT)
Received: from smtp-out25.alice.it ([85.33.2.25]:40968 "EHLO
	smtp-out25.alice.it") by ftp.linux-mips.org with ESMTP
	id S28577355AbYCUQfi (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 21 Mar 2008 16:35:38 +0000
Received: from FBCMMO01.fbc.local ([192.168.68.195]) by smtp-out25.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Fri, 21 Mar 2008 17:34:30 +0100
Received: from FBCMCL01B05.fbc.local ([192.168.69.86]) by FBCMMO01.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Fri, 21 Mar 2008 17:34:30 +0100
Received: from [192.168.1.200] ([82.48.161.252]) by FBCMCL01B05.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Fri, 21 Mar 2008 17:34:30 +0100
Message-ID: <47E3E393.2080909@tin.it>
Date:	Fri, 21 Mar 2008 17:34:27 +0100
From:	LD <memorylost@tin.it>
User-Agent: Thunderbird 2.0.0.6 (X11/20071022)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: [Fwd: AU1100 2.4.21-pre4 flash disks problems]
X-Enigmail-Version: 0.95.6
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 21 Mar 2008 16:34:30.0645 (UTC) FILETIME=[6FFC9A50:01C88B71]
Return-Path: <memorylost@tin.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: 18453
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: memorylost@tin.it
Precedence: bulk
X-list: linux-mips
Content-Length: 787
Lines: 26

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

- ------------------------------
|Back to 2.4.21...
|If I try to dmesg I see a "Partition check:" message missing when I put
|in the second disk ; I am investigating on this (maybe some piece of
|software is called checking for partitions on the first disk but is not
|called again when I change disk type).
- ------------------------------

Just checked - only the printk is executed once, in fs/partitions/check.c.

Probably false road, continuing investigations.

Regards

Lucio Dona'
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH4+OTvxHCsvXy9okRAnJkAJ9f4S81P9RBw0TSuIs5C7Y0ElRCPgCeKv03
12gKL8W1uBfIW9Uwp25TM1s=
=At5R
-----END PGP SIGNATURE-----

From markus.gothe@27m.se Fri Mar 21 19:50:40 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Mar 2008 19:50:43 +0000 (GMT)
Received: from mail.lysator.liu.se ([130.236.254.3]:18327 "EHLO
	mail.lysator.liu.se") by ftp.linux-mips.org with ESMTP
	id S28578165AbYCUTuk (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 21 Mar 2008 19:50:40 +0000
Received: from localhost (localhost.localdomain [127.0.0.1])
	by mail.lysator.liu.se (Postfix) with ESMTP id DC7AC200A21D;
	Fri, 21 Mar 2008 20:50:38 +0100 (CET)
Received: from mail.lysator.liu.se ([127.0.0.1])
	by localhost (lenin.lysator.liu.se [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id 14608-01-8; Fri, 21 Mar 2008 20:50:38 +0100 (CET)
Received: from joyce.lan (cust.fiber-lan.vnet.lk.85.194.49.173.stunet.se [85.194.49.173])
	(using TLSv1 with cipher AES128-SHA (128/128 bits))
	(No client certificate requested)
	by mail.lysator.liu.se (Postfix) with ESMTP id 10E04200A1F0;
	Fri, 21 Mar 2008 20:50:38 +0100 (CET)
Cc:	linux-mips@linux-mips.org
Message-Id: <583248BA-1B57-4B3D-94E7-75F32ED951A1@27m.se>
From:	Markus Gothe <markus.gothe@27m.se>
To:	LD <memorylost@tin.it>
In-Reply-To: <47E3E0C2.9070404@tin.it>
Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-9-188564734"
Mime-Version: 1.0 (Apple Message framework v919.2)
Subject: Re: AU1100 2.4.21-pre4 flash disks problems
Date:	Fri, 21 Mar 2008 20:50:31 +0100
References: <47E3E0C2.9070404@tin.it>
X-Pgp-Agent: GPGMail d51 (Leopard)
Content-Transfer-Encoding: 7bit
X-Mailer: Apple Mail (2.919.2)
X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at lysator.liu.se
Return-Path: <markus.gothe@27m.se>
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: 18454
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: markus.gothe@27m.se
Precedence: bulk
X-list: linux-mips
Content-Length: 8360
Lines: 196

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--Apple-Mail-9-188564734
Content-Type: multipart/alternative; boundary=Apple-Mail-8-188564683


--Apple-Mail-8-188564683
Content-Type: text/plain;
	charset=ISO-8859-1;
	format=flowed;
	delsp=yes
Content-Transfer-Encoding: quoted-printable

Have you tried with 2.4.21 (not pre4), if not start there then try =20
2.4.22 and see if it works. The USB-layer in 2.4 around that time =20
being was pretty immature IIRC.

//Markus

On 21 Mar 2008, at 17:22, LD wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi all,
> I am working on an AU1100 system, using a 2.4.21-pre4 kernel. =20
> Filesystem
> is jffs2, uclibc libraries.
>
> I have a couple of problems with USB flash disk handling:
>
> 1) it seems that my system does not "see" disks larger than 512 MB. =20=

> 1GB
> disks or more cannot be mounted. This is becoming a problem because
> 512MB disks are going out of the market.
>
> 2) Given two flash disks of different sizes (for example: one 128 MB,
> one 512 MB), if I mount/umount one of them -> I cannot then mount the
> other and vice versa.
> Example:
>
> - - mount the 128 MB one, then umount. Try to mount the 512MB ->fail.
> - - reset the device
> - - mount the 512MB device, ok. Umount. Try to mount the 128MB -> =20
> fail.
>
> Disks are vfat formatted ; did not try with other filesystem types.
>
> Tried to use a 2.6.x kernel and no problem ; I am planning to switch =20=

> all
> to 2.6.x kernel, but in this moment for me is better (if possible)
> fixing this problem, because I have a number of applications and =20
> drivers
> running on 2.4.21 and the switching to 2.6.x means revising and
> re-testing a lot of things.
>
> Back to 2.4.21...
> If I try to dmesg I see a "Partition check:" message missing when I =20=

> put
> in the second disk ; I am investigating on this (maybe some piece of
> software is called checking for partitions on the first disk but is =20=

> not
> called again when I change disk type).
>
> Any suggestions are welcome,
>
> best regards
>
> Lucio Dona'
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFH4+DCvxHCsvXy9okRApudAJwON54jwrtPtgKd2zImEjmYbPbpRwCgsnWr
> 4nWlOjZbQtNDzqFUcfRRltI=3D
> =3Dvh3N
> -----END PGP SIGNATURE-----
>

_______________________________________

Mr Markus Gothe
Software Engineer

Phone: +46 (0)13 21 81 20 (ext. 1046)
Fax: +46 (0)13 21 21 15
Mobile: +46 (0)70 348 44 35
Diskettgatan 11, SE-583 35 Link=F6ping, Sweden
www.27m.com




--Apple-Mail-8-188564683
Content-Type: text/html;
	charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<html><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; ">Have you tried with 2.4.21 (not =
pre4), if not start there then try 2.4.22 and see if it works. The =
USB-layer in 2.4 around that time being was pretty immature =
IIRC.<div><br></div><div>//Markus</div><div><br><div><html>On 21 Mar =
2008, at 17:22, LD wrote:</html><br =
class=3D"Apple-interchange-newline"><blockquote type=3D"cite">-----BEGIN =
PGP SIGNED MESSAGE-----<br>Hash: SHA1<br><br>Hi all,<br>I am working on =
an AU1100 system, using a 2.4.21-pre4 kernel. Filesystem<br>is jffs2, =
uclibc libraries.<br><br>I have a couple of problems with USB flash disk =
handling:<br><br>1) it seems that my system does not "see" disks larger =
than 512 MB. 1GB<br>disks or more cannot be mounted. This is becoming a =
problem because<br>512MB disks are going out of the market.<br><br>2) =
Given two flash disks of different sizes (for example: one 128 =
MB,<br>one 512 MB), if I mount/umount one of them -> I cannot then mount =
the<br>other and vice versa.<br>Example:<br><br>- - mount the 128 MB =
one, then umount. Try to mount the 512MB ->fail.<br>- - reset the =
device<br>- - mount the 512MB device, ok. Umount. Try to mount the 128MB =
-> fail.<br><br>Disks are vfat formatted ; did not try with other =
filesystem types.<br><br>Tried to use a 2.6.x kernel and no problem ; I =
am planning to switch all<br>to 2.6.x kernel, but in this moment for me =
is better (if possible)<br>fixing this problem, because I have a number =
of applications and drivers<br>running on 2.4.21 and the switching to =
2.6.x means revising and<br>re-testing a lot of things.<br><br>Back to =
2.4.21...<br>If I try to dmesg I see a "Partition check:" message =
missing when I put<br>in the second disk ; I am investigating on this =
(maybe some piece of<br>software is called checking for partitions on =
the first disk but is not<br>called again when I change disk =
type).<br><br>Any suggestions are welcome,<br><br>best =
regards<br><br>Lucio Dona'<br>-----BEGIN PGP SIGNATURE-----<br>Version: =
GnuPG v1.4.6 (GNU/Linux)<br>Comment: Using GnuPG with Mozilla - <a =
href=3D"http://enigmail.mozdev.org">http://enigmail.mozdev.org</a><br><br>=
iD8DBQFH4+DCvxHCsvXy9okRApudAJwON54jwrtPtgKd2zImEjmYbPbpRwCgsnWr<br>4nWlOj=
ZbQtNDzqFUcfRRltI=3D<br>=3Dvh3N<br>-----END PGP =
SIGNATURE-----<br><br></blockquote></div><br><div =
apple-content-edited=3D"true"> <span class=3D"Apple-style-span" =
style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; =
white-space: normal; widows: 2; word-spacing: 0px; =
-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: =
0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0; "><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; "><span class=3D"Apple-style-span" =
style=3D"border-collapse: separate; -webkit-border-horizontal-spacing: =
0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant: normal; font-weight: normal; letter-spacing: normal; =
line-height: normal; -webkit-text-decorations-in-effect: none; =
text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; =
orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div =
style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; "><div style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; =
">_______________________________________</div><div style=3D"margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; =
min-height: 14px; "><br></div><div style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Mr Markus =
Gothe</div><div style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; ">Software Engineer</div><div =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; min-height: 14px; "><br></div><div style=3D"margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Phone: =
+46 (0)13 21 81 20 (ext. 1046)</div><div style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Fax: +46 =
(0)13 21 21 15</div><div style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; ">Mobile: +46 (0)70 348 44 =
35</div><div style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: =
0px; margin-left: 0px; ">Diskettgatan 11, SE-583 35 Link=F6ping, =
Sweden</div><div style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; "><a =
href=3D"http://www.27m.com">www.27m.com</a></div></div><br =
class=3D"Apple-interchange-newline"></span></div></span><br =
class=3D"Apple-interchange-newline"> </div><br></div></body></html>=

--Apple-Mail-8-188564683--

--Apple-Mail-9-188564734
content-type: application/pgp-signature; x-mac-type=70674453;
	name=PGP.sig
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkfkEYcACgkQ6I0XmJx2NrxMfQCfT125zBUDBBYUeoF1MI1ezjN1
9FkAn1JMsVQi1za9JbNf1RIOBAmf9iJp
=HeFH
-----END PGP SIGNATURE-----

--Apple-Mail-9-188564734--

From tsbogend@alpha.franken.de Fri Mar 21 19:54:37 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Mar 2008 19:54:39 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:48025 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28578219AbYCUTyh (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 21 Mar 2008 19:54:37 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JcnK0-0006Xg-00; Fri, 21 Mar 2008 20:54:36 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id 2A884C2DED; Fri, 21 Mar 2008 20:47:37 +0100 (CET)
Date:	Fri, 21 Mar 2008 20:47:37 +0100
To:	peter fuerst <post@pfrst.de>
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] IP28: fix MC GIOPAR setting
Message-ID: <20080321194737.GA8398@alpha.franken.de>
References: <Pine.LNX.4.58.0803211535570.423@Indigo2.Peter>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <Pine.LNX.4.58.0803211535570.423@Indigo2.Peter>
User-Agent: Mutt/1.5.13 (2006-08-11)
From:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Return-Path: <tsbogend@alpha.franken.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: 18455
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips
Content-Length: 357
Lines: 10

On Fri, Mar 21, 2008 at 04:03:16PM +0100, peter fuerst wrote:
> We must not omit the MASTERGFX setting, unless we want Impact DMA to hang ;-)

is there a reason to restrict this to IP28 only ?

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

From macro@linux-mips.org Fri Mar 21 21:14:47 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Mar 2008 21:14:50 +0000 (GMT)
Received: from cerber.ds.pg.gda.pl ([153.19.208.18]:53416 "EHLO
	cerber.ds.pg.gda.pl") by ftp.linux-mips.org with ESMTP
	id S28578649AbYCUVOr (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 21 Mar 2008 21:14:47 +0000
Received: from localhost (unknown [127.0.0.17])
	by cerber.ds.pg.gda.pl (Postfix) with ESMTP id 2445F40075;
	Fri, 21 Mar 2008 22:14:49 +0100 (CET)
X-Virus-Scanned: amavisd-new at cerber.ds.pg.gda.pl
Received: from cerber.ds.pg.gda.pl ([153.19.208.18])
	by localhost (cerber.ds.pg.gda.pl [153.19.208.18]) (amavisd-new, port 10024)
	with ESMTP id Te7BMsomXMld; Fri, 21 Mar 2008 22:14:43 +0100 (CET)
Received: from piorun.ds.pg.gda.pl (piorun.ds.pg.gda.pl [153.19.208.8])
	by cerber.ds.pg.gda.pl (Postfix) with ESMTP id 32E4B40165;
	Fri, 21 Mar 2008 22:14:43 +0100 (CET)
Received: by piorun.ds.pg.gda.pl (Postfix, from userid 2160)
	id D21BB177CF; Fri, 21 Mar 2008 22:14:42 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
	by piorun.ds.pg.gda.pl (Postfix) with ESMTP id CDC85177CE;
	Fri, 21 Mar 2008 21:14:42 +0000 (GMT)
Date:	Fri, 21 Mar 2008 21:14:42 +0000 (GMT)
From:	"Maciej W. Rozycki" <macro@linux-mips.org>
X-X-Sender: macro@piorun
To:	Larry Stefani <lstefani@yahoo.com>
cc:	linux-mips@linux-mips.org
Subject: Re: Extraneous line in interrupt.h in 2.6.16.60 kernel?
In-Reply-To: <582735.81620.qm@web38810.mail.mud.yahoo.com>
Message-ID: <alpine.SOC.1.00.0803212103040.3991@piorun>
References: <582735.81620.qm@web38810.mail.mud.yahoo.com>
User-Agent: Alpine 1.00 (SOC 882 2007-12-20)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
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: 18456
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: 254
Lines: 9

Hi Larry,

> Am I missing something, or is the second ".set 
> mips32r2  \n" (line 51) redundant?

 You are not missing anything, but it is harmless and the piece of code is 
gone in the current version.  Welcome to the world of MIPS, BTW. :-)

  Maciej

From post@pfrst.de Fri Mar 21 21:16:40 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Mar 2008 21:16:42 +0000 (GMT)
Received: from mail1.pearl-online.net ([62.159.194.147]:52498 "EHLO
	mail1.pearl-online.net") by ftp.linux-mips.org with ESMTP
	id S28578682AbYCUVQk (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 21 Mar 2008 21:16:40 +0000
Received: from SNaIlmail.Peter (85.233.32.210.static.cablesurf.de [85.233.32.210])
	by mail1.pearl-online.net (Postfix) with ESMTP id D408EC0D9;
	Fri, 21 Mar 2008 22:16:34 +0100 (CET)
Received: from Indigo2.Peter (Indigo2.Peter [192.168.1.28])
	by SNaIlmail.Peter (8.12.6/8.12.6/Sendmail/Linux 2.0.32) with ESMTP id m2L0gGfM001336;
	Fri, 21 Mar 2008 01:42:16 +0100
Received: from Indigo2.Peter (localhost [127.0.0.1])
	by Indigo2.Peter (8.12.6/8.12.6/Sendmail/Linux 2.6.14-rc2-ip28) with ESMTP id m2LL7cFS000532;
	Fri, 21 Mar 2008 22:07:38 +0100
Received: from localhost (pf@localhost)
	by Indigo2.Peter (8.12.6/8.12.6/Submit) with ESMTP id m2LL7cQb000529;
	Fri, 21 Mar 2008 22:07:38 +0100
X-Authentication-Warning: Indigo2.Peter: pf owned process doing -bs
Date:	Fri, 21 Mar 2008 22:07:38 +0100 (CET)
From:	peter fuerst <post@pfrst.de>
X-X-Sender: pf@Indigo2.Peter
Reply-To: post@pfrst.de
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] IP28: fix MC GIOPAR setting
In-Reply-To: <20080321194737.GA8398@alpha.franken.de>
Message-ID: <Pine.LNX.4.58.0803212125050.523@Indigo2.Peter>
References: <Pine.LNX.4.58.0803211535570.423@Indigo2.Peter>
 <20080321194737.GA8398@alpha.franken.de>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Return-Path: <post@pfrst.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: 18457
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: post@pfrst.de
Precedence: bulk
X-list: linux-mips
Content-Length: 931
Lines: 28



On Fri, 21 Mar 2008, Thomas Bogendoerfer wrote:

> Date: Fri, 21 Mar 2008 20:47:37 +0100
> From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> To: peter fuerst <post@pfrst.de>
> Cc: linux-mips@linux-mips.org, ralf@linux-mips.org
> Subject: Re: [PATCH] IP28: fix MC GIOPAR setting
>
> On Fri, Mar 21, 2008 at 04:03:16PM +0100, peter fuerst wrote:
> > We must not omit the MASTERGFX setting, unless we want Impact DMA to hang ;-)
>
> is there a reason to restrict this to IP28 only ?

Would indeed be most surprising, if this isn't appropriate for any Indigo2-
Impact, but don't know for sure.  And can't check, whether it at least doesn't
hurt Non-Impact Indigo2.  Of course, being able to avoid '#ifdef' at all would
be the prettiest alternative.

>
> Thomas.
>
> --
> Crap can work. Given enough thrust pigs will fly, but it's not necessary a
> good idea.                                                [ RFC1925, 2.3 ]
>
>

From tsbogend@alpha.franken.de Fri Mar 21 21:27:00 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Mar 2008 21:27:02 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:23964 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28578399AbYCUV1A (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 21 Mar 2008 21:27:00 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JcolP-0000Ni-00; Fri, 21 Mar 2008 22:26:59 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id 6F769C2DF8; Fri, 21 Mar 2008 22:25:43 +0100 (CET)
From:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To:	linux-scsi@vger.kernel.org, linux-mips@linux-mips.org
cc:	ralf@linux-mips.org, James.Bottomley@HansenPartnership.com
Subject: [PATCH] WD33C93: let platform stub override no_sync/fast/dma_mode
Message-Id: <20080321212543.6F769C2DF8@solo.franken.de>
Date:	Fri, 21 Mar 2008 22:25:43 +0100 (CET)
Return-Path: <tsbogend@alpha.franken.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: 18458
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips
Content-Length: 4363
Lines: 108

SGI machines with WD33C93 allow usage of burst mode DMA, which increases
performance noticable. To make this selectable by the sgiwd93 stub,
setting the values for no_sync, fast and dma_mode has been moved to the
individual platform stubs.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---

Please apply for 2.6.26

 drivers/scsi/a2091.c   |    3 +++
 drivers/scsi/a3000.c   |    3 +++
 drivers/scsi/gvp11.c   |    3 +++
 drivers/scsi/mvme147.c |    3 +++
 drivers/scsi/sgiwd93.c |    7 ++++---
 drivers/scsi/wd33c93.c |    3 ---
 6 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/a2091.c b/drivers/scsi/a2091.c
index 5ac3a3e..1d1bb25 100644
--- a/drivers/scsi/a2091.c
+++ b/drivers/scsi/a2091.c
@@ -179,6 +179,9 @@ int __init a2091_detect(struct scsi_host_template *tpnt)
 	DMA(instance)->DAWR = DAWR_A2091;
 	regs.SASR = &(DMA(instance)->SASR);
 	regs.SCMD = &(DMA(instance)->SCMD);
+	HDATA(a3000_host)->no_sync = 0xff;
+	HDATA(a3000_host)->fast = 0;
+	HDATA(a3000_host)->dma_mode = CTRL_DMA;
 	wd33c93_init(instance, regs, dma_setup, dma_stop, WD33C93_FS_8_10);
 	request_irq(IRQ_AMIGA_PORTS, a2091_intr, IRQF_SHARED, "A2091 SCSI",
 		    instance);
diff --git a/drivers/scsi/a3000.c b/drivers/scsi/a3000.c
index 3aeec96..8b449d8 100644
--- a/drivers/scsi/a3000.c
+++ b/drivers/scsi/a3000.c
@@ -178,6 +178,9 @@ int __init a3000_detect(struct scsi_host_template *tpnt)
     DMA(a3000_host)->DAWR = DAWR_A3000;
     regs.SASR = &(DMA(a3000_host)->SASR);
     regs.SCMD = &(DMA(a3000_host)->SCMD);
+    HDATA(a3000_host)->no_sync = 0xff;
+    HDATA(a3000_host)->fast = 0;
+    HDATA(a3000_host)->dma_mode = CTRL_DMA;
     wd33c93_init(a3000_host, regs, dma_setup, dma_stop, WD33C93_FS_12_15);
     if (request_irq(IRQ_AMIGA_PORTS, a3000_intr, IRQF_SHARED, "A3000 SCSI",
 		    a3000_intr))
diff --git a/drivers/scsi/gvp11.c b/drivers/scsi/gvp11.c
index 91f8522..e75a7ba 100644
--- a/drivers/scsi/gvp11.c
+++ b/drivers/scsi/gvp11.c
@@ -322,6 +322,9 @@ int __init gvp11_detect(struct scsi_host_template *tpnt)
 	 */
 	regs.SASR = &(DMA(instance)->SASR);
 	regs.SCMD = &(DMA(instance)->SCMD);
+	HDATA(a3000_host)->no_sync = 0xff;
+	HDATA(a3000_host)->fast = 0;
+	HDATA(a3000_host)->dma_mode = CTRL_DMA;
 	wd33c93_init(instance, regs, dma_setup, dma_stop,
 		     (epc & GVP_SCSICLKMASK) ? WD33C93_FS_8_10
 					     : WD33C93_FS_12_15);
diff --git a/drivers/scsi/mvme147.c b/drivers/scsi/mvme147.c
index be41aad..6a8cf17 100644
--- a/drivers/scsi/mvme147.c
+++ b/drivers/scsi/mvme147.c
@@ -82,6 +82,9 @@ int mvme147_detect(struct scsi_host_template *tpnt)
     mvme147_host->irq = MVME147_IRQ_SCSI_PORT;
     regs.SASR = (volatile unsigned char *)0xfffe4000;
     regs.SCMD = (volatile unsigned char *)0xfffe4001;
+    HDATA(a3000_host)->no_sync = 0xff;
+    HDATA(a3000_host)->fast = 0;
+    HDATA(a3000_host)->dma_mode = CTRL_DMA;
     wd33c93_init(mvme147_host, regs, dma_setup, dma_stop, WD33C93_FS_8_10);
 
     if (request_irq(MVME147_IRQ_SCSI_PORT, mvme147_intr, 0, "MVME147 SCSI PORT", mvme147_intr))
diff --git a/drivers/scsi/sgiwd93.c b/drivers/scsi/sgiwd93.c
index 26cfc56..03e3596 100644
--- a/drivers/scsi/sgiwd93.c
+++ b/drivers/scsi/sgiwd93.c
@@ -263,10 +263,11 @@ static int __init sgiwd93_probe(struct platform_device *pdev)
 	regs.SASR = wdregs + 3;
 	regs.SCMD = wdregs + 7;
 
-	wd33c93_init(host, regs, dma_setup, dma_stop, WD33C93_FS_MHZ(20));
+	hdata->wh.no_sync = 0;
+	hdata->wh.fast = 1;
+	hdata->wh.dma_mode = CTRL_BURST;
 
-	if (hdata->wh.no_sync == 0xff)
-		hdata->wh.no_sync = 0;
+	wd33c93_init(host, regs, dma_setup, dma_stop, WD33C93_FS_MHZ(20));
 
 	err = request_irq(irq, sgiwd93_intr, 0, "SGI WD93", host);
 	if (err) {
diff --git a/drivers/scsi/wd33c93.c b/drivers/scsi/wd33c93.c
index f286c37..5fda881 100644
--- a/drivers/scsi/wd33c93.c
+++ b/drivers/scsi/wd33c93.c
@@ -1973,10 +1973,7 @@ wd33c93_init(struct Scsi_Host *instance, const wd33c93_regs regs,
 	hostdata->incoming_ptr = 0;
 	hostdata->outgoing_len = 0;
 	hostdata->default_sx_per = DEFAULT_SX_PER;
-	hostdata->no_sync = 0xff;	/* sync defaults to off */
 	hostdata->no_dma = 0;	/* default is DMA enabled */
-	hostdata->fast = 0;	/* default is Fast SCSI transfers disabled */
-	hostdata->dma_mode = CTRL_DMA;	/* default is Single Byte DMA */
 
 #ifdef PROC_INTERFACE
 	hostdata->proc = PR_VERSION | PR_INFO | PR_STATISTICS |

From tsbogend@alpha.franken.de Fri Mar 21 21:32:58 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Mar 2008 21:33:04 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:37020 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28578710AbYCUVc5 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 21 Mar 2008 21:32:57 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JcorB-0000XQ-00; Fri, 21 Mar 2008 22:32:57 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id 5DB06C2DF9; Fri, 21 Mar 2008 22:32:33 +0100 (CET)
Date:	Fri, 21 Mar 2008 22:32:33 +0100
To:	peter fuerst <post@pfrst.de>
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] IP28: fix MC GIOPAR setting
Message-ID: <20080321213233.GA10546@alpha.franken.de>
References: <Pine.LNX.4.58.0803211535570.423@Indigo2.Peter> <20080321194737.GA8398@alpha.franken.de> <Pine.LNX.4.58.0803212125050.523@Indigo2.Peter>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <Pine.LNX.4.58.0803212125050.523@Indigo2.Peter>
User-Agent: Mutt/1.5.13 (2006-08-11)
From:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Return-Path: <tsbogend@alpha.franken.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: 18459
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips
Content-Length: 763
Lines: 17

On Fri, Mar 21, 2008 at 10:07:38PM +0100, peter fuerst wrote:
> > is there a reason to restrict this to IP28 only ?
> 
> Would indeed be most surprising, if this isn't appropriate for any Indigo2-
> Impact, but don't know for sure.  And can't check, whether it at least doesn't
> hurt Non-Impact Indigo2.  Of course, being able to avoid '#ifdef' at all would
> be the prettiest alternative.

I'll check my IP22 machines, if they are ok with that change. Another
solution could be to have gio_set_master() similair to pci_set_master().
That way we only enable master, if it is requested by a driver.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

From ralf@linux-mips.org Fri Mar 21 22:12:40 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Mar 2008 22:12:42 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:49372 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28578766AbYCUWMk (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 21 Mar 2008 22:12:40 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2LMCbOE005201;
	Fri, 21 Mar 2008 22:12:37 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2LMCUCD005200;
	Fri, 21 Mar 2008 22:12:30 GMT
Date:	Fri, 21 Mar 2008 22:12:30 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc:	linux-scsi@vger.kernel.org, linux-mips@linux-mips.org,
	James.Bottomley@HansenPartnership.com
Subject: Re: [PATCH] WD33C93: let platform stub override
	no_sync/fast/dma_mode
Message-ID: <20080321221230.GA5097@linux-mips.org>
References: <20080321212543.6F769C2DF8@solo.franken.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080321212543.6F769C2DF8@solo.franken.de>
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18460
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: 560
Lines: 15

On Fri, Mar 21, 2008 at 10:25:43PM +0100, Thomas Bogendoerfer wrote:

> SGI machines with WD33C93 allow usage of burst mode DMA, which increases
> performance noticable. To make this selectable by the sgiwd93 stub,
> setting the values for no_sync, fast and dma_mode has been moved to the
> individual platform stubs.
> 
> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

Acked-by: Ralf Baechle <ralf@linux-mips.org>

This is one of the things on my list of things to be fixed for IP22 for
even longer than I can recall.  Thanks Thomas!

  Ralf

From post@pfrst.de Fri Mar 21 22:29:29 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Mar 2008 22:29:32 +0000 (GMT)
Received: from mail1.pearl-online.net ([62.159.194.147]:2583 "EHLO
	mail1.pearl-online.net") by ftp.linux-mips.org with ESMTP
	id S28578789AbYCUW33 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 21 Mar 2008 22:29:29 +0000
Received: from SNaIlmail.Peter (85.233.32.210.static.cablesurf.de [85.233.32.210])
	by mail1.pearl-online.net (Postfix) with ESMTP id 08669C9E7;
	Fri, 21 Mar 2008 23:29:23 +0100 (CET)
Received: from Indigo2.Peter (Indigo2.Peter [192.168.1.28])
	by SNaIlmail.Peter (8.12.6/8.12.6/Sendmail/Linux 2.0.32) with ESMTP id m2L1t5fM001434;
	Fri, 21 Mar 2008 02:55:05 +0100
Received: from Indigo2.Peter (localhost [127.0.0.1])
	by Indigo2.Peter (8.12.6/8.12.6/Sendmail/Linux 2.6.14-rc2-ip28) with ESMTP id m2LMK8FS000573;
	Fri, 21 Mar 2008 23:20:08 +0100
Received: from localhost (pf@localhost)
	by Indigo2.Peter (8.12.6/8.12.6/Submit) with ESMTP id m2LMK8Qg000570;
	Fri, 21 Mar 2008 23:20:08 +0100
X-Authentication-Warning: Indigo2.Peter: pf owned process doing -bs
Date:	Fri, 21 Mar 2008 23:20:07 +0100 (CET)
From:	peter fuerst <post@pfrst.de>
X-X-Sender: pf@Indigo2.Peter
Reply-To: post@pfrst.de
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc:	linux-scsi@vger.kernel.org, linux-mips@linux-mips.org,
	ralf@linux-mips.org, James.Bottomley@HansenPartnership.com
Subject: Re: [PATCH] WD33C93: let platform stub override no_sync/fast/dma_mode
In-Reply-To: <20080321212543.6F769C2DF8@solo.franken.de>
Message-ID: <Pine.LNX.4.58.0803212302190.564@Indigo2.Peter>
References: <20080321212543.6F769C2DF8@solo.franken.de>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Return-Path: <post@pfrst.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: 18461
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: post@pfrst.de
Precedence: bulk
X-list: linux-mips
Content-Length: 3070
Lines: 84



Hi Thomas,

the code-sequence

	wd33c93_init(...
	if (hdata->wh.no_sync == 0xff)
		hdata->wh.no_sync = 0;

was put/kept there intentionally - in this very order - to enable
"nosync" from the command-line!

	Date: Mon, 12 Feb 2007 15:27:17 +0100 (CET)
	From: peter fuerst <post@pfrst.de>
	To: James.Bottomley@HansenPartnership.com, linux-scsi@vger.kernel.org
	Cc: Ralf Baechle <ralf@linux-mips.org>, Kumba <kumba@gentoo.org>,
	     Thiemo Seufer <ths@networkno.de>, Tim Yamin <plasmaroo@gentoo.org>
	Subject: [PATCH][SCSI] sgiwd93.c: interfacing to wd33c93

	1) sgiwd93 used to switch off asynchronous mode on the wd33c93, discarding
	   any "nosync"-requests from the commandline.
	   But we need to allow "nosync"-requests for selected devices, for example
	   the Pioneer DVD305S.
	   (For the curious: this device accepts the SDTR from wd33c93 and success-
	   fully sends inquiry data in sync mode, but after the data phase in the
	   inquiry command does an unexpected disconnect, seemingly sending no
	   "status" or "command complete". Forcing async transfers makes it work
	   together flawlessly with the wd33c93. Of course, preferable would be, to
	   implement wd33c93's "resume command" stuff, but that probably will not
	   come soon.)
	2) ...
	...

	========================================================================
	--- dc7bdc97927ea1c519f0d8bd3133739600c841d4/drivers/scsi/sgiwd93.c	Sat Oct  7 00:00:00 2006
	+++ new/drivers/scsi/sgiwd93.c	Sun Feb 11 22:10:06 2007
	@@ -250,3 +250,3 @@

	-	hdata->wh.no_sync = 0;
	+	if (0xff == hdata->wh.no_sync) hdata->wh.no_sync = 0;

	========================================================================
	...

On Fri, 21 Mar 2008, Thomas Bogendoerfer wrote:

> Date: Fri, 21 Mar 2008 22:25:43 +0100 (CET)
> From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> To: linux-scsi@vger.kernel.org, linux-mips@linux-mips.org
> Cc: ralf@linux-mips.org, James.Bottomley@HansenPartnership.com
> Subject: [PATCH] WD33C93: let platform stub override no_sync/fast/dma_mode
>
> SGI machines with WD33C93 allow usage of burst mode DMA, which increases
> performance noticable. To make this selectable by the sgiwd93 stub,
> setting the values for no_sync, fast and dma_mode has been moved to the
> individual platform stubs.
>
> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> ---
>
> Please apply for 2.6.26
>
> ...
> diff --git a/drivers/scsi/sgiwd93.c b/drivers/scsi/sgiwd93.c
> index 26cfc56..03e3596 100644
> --- a/drivers/scsi/sgiwd93.c
> +++ b/drivers/scsi/sgiwd93.c
> @@ -263,10 +263,11 @@ static int __init sgiwd93_probe(struct platform_device *pdev)
>  	regs.SASR = wdregs + 3;
>  	regs.SCMD = wdregs + 7;
>
> -	wd33c93_init(host, regs, dma_setup, dma_stop, WD33C93_FS_MHZ(20));
> +	hdata->wh.no_sync = 0;
> +	hdata->wh.fast = 1;
> +	hdata->wh.dma_mode = CTRL_BURST;
>
> -	if (hdata->wh.no_sync == 0xff)
> -		hdata->wh.no_sync = 0;
> +	wd33c93_init(host, regs, dma_setup, dma_stop, WD33C93_FS_MHZ(20));
>
>  	err = request_irq(irq, sgiwd93_intr, 0, "SGI WD93", host);
>  	if (err) {
> ...

From post@pfrst.de Fri Mar 21 22:38:21 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Mar 2008 22:38:23 +0000 (GMT)
Received: from mail1.pearl-online.net ([62.159.194.147]:38935 "EHLO
	mail1.pearl-online.net") by ftp.linux-mips.org with ESMTP
	id S28578787AbYCUWiV (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 21 Mar 2008 22:38:21 +0000
Received: from SNaIlmail.Peter (85.233.32.210.static.cablesurf.de [85.233.32.210])
	by mail1.pearl-online.net (Postfix) with ESMTP id 34794CCE5;
	Fri, 21 Mar 2008 23:38:16 +0100 (CET)
Received: from Indigo2.Peter (Indigo2.Peter [192.168.1.28])
	by SNaIlmail.Peter (8.12.6/8.12.6/Sendmail/Linux 2.0.32) with ESMTP id m2L23vfM001487;
	Fri, 21 Mar 2008 03:03:57 +0100
Received: from Indigo2.Peter (localhost [127.0.0.1])
	by Indigo2.Peter (8.12.6/8.12.6/Sendmail/Linux 2.6.14-rc2-ip28) with ESMTP id m2LMSxFS000587;
	Fri, 21 Mar 2008 23:28:59 +0100
Received: from localhost (pf@localhost)
	by Indigo2.Peter (8.12.6/8.12.6/Submit) with ESMTP id m2LMSxRu000584;
	Fri, 21 Mar 2008 23:28:59 +0100
X-Authentication-Warning: Indigo2.Peter: pf owned process doing -bs
Date:	Fri, 21 Mar 2008 23:28:59 +0100 (CET)
From:	peter fuerst <post@pfrst.de>
X-X-Sender: pf@Indigo2.Peter
Reply-To: post@pfrst.de
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc:	linux-scsi@vger.kernel.org, linux-mips@linux-mips.org,
	ralf@linux-mips.org, James.Bottomley@HansenPartnership.com
Subject: Re: [PATCH] WD33C93: let platform stub override no_sync/fast/dma_mode
In-Reply-To: <Pine.LNX.4.58.0803212302190.564@Indigo2.Peter>
Message-ID: <Pine.LNX.4.58.0803212327070.580@Indigo2.Peter>
References: <20080321212543.6F769C2DF8@solo.franken.de>
 <Pine.LNX.4.58.0803212302190.564@Indigo2.Peter>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Return-Path: <post@pfrst.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: 18462
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: post@pfrst.de
Precedence: bulk
X-list: linux-mips
Content-Length: 527
Lines: 25



Oops, forget it, i just missed the change in wd33c93.c, sorry.


kind regrads

peter


On Fri, 21 Mar 2008, peter fuerst wrote:

> Date: Fri, 21 Mar 2008 23:20:07 +0100 (CET)
> From: peter fuerst <post@pfrst.de>
> To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: linux-scsi@vger.kernel.org, linux-mips@linux-mips.org,
>      ralf@linux-mips.org, James.Bottomley@HansenPartnership.com
> Subject: Re: [PATCH] WD33C93: let platform stub override
>     no_sync/fast/dma_mode
>
>
> Hi Thomas,
>
> the code-sequence
> ...

From tsbogend@alpha.franken.de Fri Mar 21 23:00:22 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Mar 2008 23:00:25 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:29599 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28578739AbYCUXAW (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 21 Mar 2008 23:00:22 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JcqDl-0002Zi-00; Sat, 22 Mar 2008 00:00:21 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id 173F1C2DFC; Sat, 22 Mar 2008 00:00:10 +0100 (CET)
Date:	Sat, 22 Mar 2008 00:00:10 +0100
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	Giuseppe Sacco <giuseppe@eppesuigoccas.homedns.org>,
	linux-mips@linux-mips.org
Subject: Re: Compiler error? [was: Re: new kernel oops in recent kernels]
Message-ID: <20080321230010.GA31135@alpha.franken.de>
References: <1205664563.3050.4.camel@localhost> <1205699257.4159.14.camel@casa> <20080316233619.GA29511@alpha.franken.de> <1205741142.3515.2.camel@localhost> <20080317141828.GA25798@linux-mips.org> <20080317143215.GA11497@alpha.franken.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080317143215.GA11497@alpha.franken.de>
User-Agent: Mutt/1.5.13 (2006-08-11)
From:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Return-Path: <tsbogend@alpha.franken.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: 18463
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips
Content-Length: 17109
Lines: 648

On Mon, Mar 17, 2008 at 03:32:15PM +0100, Thomas Bogendoerfer wrote:
> On Mon, Mar 17, 2008 at 02:18:28PM +0000, Ralf Baechle wrote:
> > On Mon, Mar 17, 2008 at 09:05:42AM +0100, Giuseppe Sacco wrote:
> > 
> > > The patch you proposed, that use a larger buffer, does not seems to
> > > trigger the bug.
> > 
> > It may help but doesn't have a chance to be accepted upstream.  So
> > this is no more than an useful litmus test.
> 
> sure, that's why I called it a hack. It was just to make sure, that I'm
> on the right track.

below is a patch, which replaces all buffers on the stack, which are
passed to the scsi layer with kmalloced ones.

Giuseppe, could you please check if this fixes your problem, and
doesn't cause new regressions ? 

Thomas.


diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 12f5bae..fd45563 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -482,27 +482,37 @@ int cdrom_get_media_event(struct cdrom_device_info *cdi,
 			  struct media_event_desc *med)
 {
 	struct packet_command cgc;
-	unsigned char buffer[8];
-	struct event_header *eh = (struct event_header *) buffer;
+	unsigned char *buffer;
+	struct event_header *eh;
+	int ret = 1;
+
+	buffer = kmalloc(8, GFP_KERNEL);
+	if (!buffer)
+		return -ENOMEM;
 
-	init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ);
+	eh = (struct event_header *)buffer;
+
+	init_cdrom_command(&cgc, buffer, 8, CGC_DATA_READ);
 	cgc.cmd[0] = GPCMD_GET_EVENT_STATUS_NOTIFICATION;
 	cgc.cmd[1] = 1;		/* IMMED */
 	cgc.cmd[4] = 1 << 4;	/* media event */
-	cgc.cmd[8] = sizeof(buffer);
+	cgc.cmd[8] = 8;
 	cgc.quiet = 1;
 
 	if (cdi->ops->generic_packet(cdi, &cgc))
-		return 1;
+		goto err;
 
 	if (be16_to_cpu(eh->data_len) < sizeof(*med))
-		return 1;
+		goto err;
 
 	if (eh->nea || eh->notification_class != 0x4)
-		return 1;
+		goto err;
 
-	memcpy(med, &buffer[sizeof(*eh)], sizeof(*med));
-	return 0;
+	memcpy(med, buffer + sizeof(*eh), sizeof(*med));
+	ret = 0;
+err:
+	kfree(buffer);
+	return ret;
 }
 
 /*
@@ -512,68 +522,82 @@ int cdrom_get_media_event(struct cdrom_device_info *cdi,
 static int cdrom_mrw_probe_pc(struct cdrom_device_info *cdi)
 {
 	struct packet_command cgc;
-	char buffer[16];
+	char *buffer;
+	int ret = 1;
+
+	buffer = kmalloc(16, GFP_KERNEL);
+	if (!buffer)
+		return -ENOMEM;
 
-	init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ);
+	init_cdrom_command(&cgc, buffer, 16, CGC_DATA_READ);
 
 	cgc.timeout = HZ;
 	cgc.quiet = 1;
 
 	if (!cdrom_mode_sense(cdi, &cgc, MRW_MODE_PC, 0)) {
 		cdi->mrw_mode_page = MRW_MODE_PC;
-		return 0;
+		ret = 0;
 	} else if (!cdrom_mode_sense(cdi, &cgc, MRW_MODE_PC_PRE1, 0)) {
 		cdi->mrw_mode_page = MRW_MODE_PC_PRE1;
-		return 0;
+		ret = 0;
 	}
-
-	return 1;
+	kfree(buffer);
+	return ret;
 }
 
 static int cdrom_is_mrw(struct cdrom_device_info *cdi, int *write)
 {
 	struct packet_command cgc;
 	struct mrw_feature_desc *mfd;
-	unsigned char buffer[16];
+	unsigned char *buffer;
 	int ret;
 
 	*write = 0;
+	buffer = kmalloc(16, GFP_KERNEL);
+	if (!buffer)
+		return -ENOMEM;
 
-	init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ);
+	init_cdrom_command(&cgc, buffer, 16, CGC_DATA_READ);
 
 	cgc.cmd[0] = GPCMD_GET_CONFIGURATION;
 	cgc.cmd[3] = CDF_MRW;
-	cgc.cmd[8] = sizeof(buffer);
+	cgc.cmd[8] = 16;
 	cgc.quiet = 1;
 
 	if ((ret = cdi->ops->generic_packet(cdi, &cgc)))
-		return ret;
+		goto err;
 
 	mfd = (struct mrw_feature_desc *)&buffer[sizeof(struct feature_header)];
-	if (be16_to_cpu(mfd->feature_code) != CDF_MRW)
-		return 1;
+	if (be16_to_cpu(mfd->feature_code) != CDF_MRW) {
+		ret = 1;
+		goto err;
+	}
 	*write = mfd->write;
 
 	if ((ret = cdrom_mrw_probe_pc(cdi))) {
 		*write = 0;
-		return ret;
 	}
-
-	return 0;
+err:
+	kfree(buffer);
+	return ret;
 }
 
 static int cdrom_mrw_bgformat(struct cdrom_device_info *cdi, int cont)
 {
 	struct packet_command cgc;
-	unsigned char buffer[12];
+	unsigned char *buffer;
 	int ret;
 
 	printk(KERN_INFO "cdrom: %sstarting format\n", cont ? "Re" : "");
 
+	buffer = kmalloc(12, GFP_KERNEL);
+	if (!buffer)
+		return -ENOMEM;
+
 	/*
 	 * FmtData bit set (bit 4), format type is 1
 	 */
-	init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_WRITE);
+	init_cdrom_command(&cgc, buffer, 12, CGC_DATA_WRITE);
 	cgc.cmd[0] = GPCMD_FORMAT_UNIT;
 	cgc.cmd[1] = (1 << 4) | 1;
 
@@ -600,6 +624,7 @@ static int cdrom_mrw_bgformat(struct cdrom_device_info *cdi, int cont)
 	if (ret)
 		printk(KERN_INFO "cdrom: bgformat failed\n");
 
+	kfree(buffer);
 	return ret;
 }
 
@@ -659,16 +684,17 @@ static int cdrom_mrw_set_lba_space(struct cdrom_device_info *cdi, int space)
 {
 	struct packet_command cgc;
 	struct mode_page_header *mph;
-	char buffer[16];
+	char *buffer;
 	int ret, offset, size;
 
-	init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ);
+	buffer = kmalloc(16, GFP_KERNEL);
+	if (!buffer)
+		return -ENOMEM;
 
-	cgc.buffer = buffer;
-	cgc.buflen = sizeof(buffer);
+	init_cdrom_command(&cgc, buffer, 16, CGC_DATA_READ);
 
 	if ((ret = cdrom_mode_sense(cdi, &cgc, cdi->mrw_mode_page, 0)))
-		return ret;
+		goto err;
 
 	mph = (struct mode_page_header *) buffer;
 	offset = be16_to_cpu(mph->desc_length);
@@ -678,55 +704,70 @@ static int cdrom_mrw_set_lba_space(struct cdrom_device_info *cdi, int space)
 	cgc.buflen = size;
 
 	if ((ret = cdrom_mode_select(cdi, &cgc)))
-		return ret;
+		goto err;
 
 	printk(KERN_INFO "cdrom: %s: mrw address space %s selected\n", cdi->name, mrw_address_space[space]);
-	return 0;
+	ret = 0;
+err:
+	kfree(buffer);
+	return ret;
 }
 
 static int cdrom_get_random_writable(struct cdrom_device_info *cdi,
 			      struct rwrt_feature_desc *rfd)
 {
 	struct packet_command cgc;
-	char buffer[24];
+	char *buffer;
 	int ret;
 
-	init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ);
+	buffer = kmalloc(24, GFP_KERNEL);
+	if (!buffer)
+		return -ENOMEM;
+
+	init_cdrom_command(&cgc, buffer, 24, CGC_DATA_READ);
 
 	cgc.cmd[0] = GPCMD_GET_CONFIGURATION;	/* often 0x46 */
 	cgc.cmd[3] = CDF_RWRT;			/* often 0x0020 */
-	cgc.cmd[8] = sizeof(buffer);		/* often 0x18 */
+	cgc.cmd[8] = 24;		        /* often 0x18 */
 	cgc.quiet = 1;
 
 	if ((ret = cdi->ops->generic_packet(cdi, &cgc)))
-		return ret;
+		goto err;
 
 	memcpy(rfd, &buffer[sizeof(struct feature_header)], sizeof (*rfd));
-	return 0;
+	ret = 0;
+err:
+	kfree(buffer);
+	return ret;
 }
 
 static int cdrom_has_defect_mgt(struct cdrom_device_info *cdi)
 {
 	struct packet_command cgc;
-	char buffer[16];
+	char *buffer;
 	__be16 *feature_code;
 	int ret;
 
-	init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ);
+	buffer = kmalloc(16, GFP_KERNEL);
+	if (!buffer)
+		return -ENOMEM;
+
+	init_cdrom_command(&cgc, buffer, 16, CGC_DATA_READ);
 
 	cgc.cmd[0] = GPCMD_GET_CONFIGURATION;
 	cgc.cmd[3] = CDF_HWDM;
-	cgc.cmd[8] = sizeof(buffer);
+	cgc.cmd[8] = 16;
 	cgc.quiet = 1;
 
 	if ((ret = cdi->ops->generic_packet(cdi, &cgc)))
-		return ret;
+		goto err;
 
 	feature_code = (__be16 *) &buffer[sizeof(struct feature_header)];
 	if (be16_to_cpu(*feature_code) == CDF_HWDM)
-		return 0;
-
-	return 1;
+		ret = 0;
+err:
+	kfree(buffer);
+	return ret;
 }
 
 
@@ -817,10 +858,14 @@ static int cdrom_mrw_open_write(struct cdrom_device_info *cdi)
 static int mo_open_write(struct cdrom_device_info *cdi)
 {
 	struct packet_command cgc;
-	char buffer[255];
+	char *buffer;
 	int ret;
 
-	init_cdrom_command(&cgc, &buffer, 4, CGC_DATA_READ);
+	buffer = kmalloc(255, GFP_KERNEL);
+	if (!buffer)
+		return -ENOMEM;
+
+	init_cdrom_command(&cgc, buffer, 4, CGC_DATA_READ);
 	cgc.quiet = 1;
 
 	/*
@@ -837,10 +882,15 @@ static int mo_open_write(struct cdrom_device_info *cdi)
 	}
 
 	/* drive gave us no info, let the user go ahead */
-	if (ret)
-		return 0;
+	if (ret) {
+		ret = 0;
+		goto err;
+	}
 
-	return buffer[3] & 0x80;
+	ret = buffer[3] & 0x80;
+err:
+	kfree(buffer);
+	return ret;
 }
 
 static int cdrom_ram_open_write(struct cdrom_device_info *cdi)
@@ -863,15 +913,19 @@ static int cdrom_ram_open_write(struct cdrom_device_info *cdi)
 static void cdrom_mmc3_profile(struct cdrom_device_info *cdi)
 {
 	struct packet_command cgc;
-	char buffer[32];
+	char *buffer;
 	int ret, mmc3_profile;
 
-	init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ);
+	buffer = kmalloc(32, GFP_KERNEL);
+	if (!buffer)
+		return;
+
+	init_cdrom_command(&cgc, buffer, 32, CGC_DATA_READ);
 
 	cgc.cmd[0] = GPCMD_GET_CONFIGURATION;
 	cgc.cmd[1] = 0;
 	cgc.cmd[2] = cgc.cmd[3] = 0;		/* Starting Feature Number */
-	cgc.cmd[8] = sizeof(buffer);		/* Allocation Length */
+	cgc.cmd[8] = 32;		        /* Allocation Length */
 	cgc.quiet = 1;
 
 	if ((ret = cdi->ops->generic_packet(cdi, &cgc)))
@@ -880,6 +934,7 @@ static void cdrom_mmc3_profile(struct cdrom_device_info *cdi)
 		mmc3_profile = (buffer[6] << 8) | buffer[7];
 
 	cdi->mmc3_profile = mmc3_profile;
+	kfree(buffer);
 }
 
 static int cdrom_is_dvd_rw(struct cdrom_device_info *cdi)
@@ -1594,12 +1649,15 @@ static void setup_send_key(struct packet_command *cgc, unsigned agid, unsigned t
 static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai)
 {
 	int ret;
-	u_char buf[20];
+	u_char *buf;
 	struct packet_command cgc;
 	struct cdrom_device_ops *cdo = cdi->ops;
-	rpc_state_t rpc_state;
+	rpc_state_t *rpc_state;
+
+	buf = kzalloc(20, GFP_KERNEL);
+	if (!buf)
+		return -ENOMEM;
 
-	memset(buf, 0, sizeof(buf));
 	init_cdrom_command(&cgc, buf, 0, CGC_DATA_READ);
 
 	switch (ai->type) {
@@ -1610,7 +1668,7 @@ static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai)
 		setup_report_key(&cgc, ai->lsa.agid, 0);
 
 		if ((ret = cdo->generic_packet(cdi, &cgc)))
-			return ret;
+			goto err;
 
 		ai->lsa.agid = buf[7] >> 6;
 		/* Returning data, let host change state */
@@ -1621,7 +1679,7 @@ static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai)
 		setup_report_key(&cgc, ai->lsk.agid, 2);
 
 		if ((ret = cdo->generic_packet(cdi, &cgc)))
-			return ret;
+			goto err;
 
 		copy_key(ai->lsk.key, &buf[4]);
 		/* Returning data, let host change state */
@@ -1632,7 +1690,7 @@ static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai)
 		setup_report_key(&cgc, ai->lsc.agid, 1);
 
 		if ((ret = cdo->generic_packet(cdi, &cgc)))
-			return ret;
+			goto err;
 
 		copy_chal(ai->lsc.chal, &buf[4]);
 		/* Returning data, let host change state */
@@ -1649,7 +1707,7 @@ static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai)
 		cgc.cmd[2] = ai->lstk.lba >> 24;
 
 		if ((ret = cdo->generic_packet(cdi, &cgc)))
-			return ret;
+			goto err;
 
 		ai->lstk.cpm = (buf[4] >> 7) & 1;
 		ai->lstk.cp_sec = (buf[4] >> 6) & 1;
@@ -1663,7 +1721,7 @@ static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai)
 		setup_report_key(&cgc, ai->lsasf.agid, 5);
 		
 		if ((ret = cdo->generic_packet(cdi, &cgc)))
-			return ret;
+			goto err;
 
 		ai->lsasf.asf = buf[7] & 1;
 		break;
@@ -1676,7 +1734,7 @@ static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai)
 		copy_chal(&buf[4], ai->hsc.chal);
 
 		if ((ret = cdo->generic_packet(cdi, &cgc)))
-			return ret;
+			goto err;
 
 		ai->type = DVD_LU_SEND_KEY1;
 		break;
@@ -1689,7 +1747,7 @@ static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai)
 
 		if ((ret = cdo->generic_packet(cdi, &cgc))) {
 			ai->type = DVD_AUTH_FAILURE;
-			return ret;
+			goto err;
 		}
 		ai->type = DVD_AUTH_ESTABLISHED;
 		break;
@@ -1700,24 +1758,23 @@ static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai)
 		cdinfo(CD_DVD, "entering DVD_INVALIDATE_AGID\n"); 
 		setup_report_key(&cgc, ai->lsa.agid, 0x3f);
 		if ((ret = cdo->generic_packet(cdi, &cgc)))
-			return ret;
+			goto err;
 		break;
 
 	/* Get region settings */
 	case DVD_LU_SEND_RPC_STATE:
 		cdinfo(CD_DVD, "entering DVD_LU_SEND_RPC_STATE\n");
 		setup_report_key(&cgc, 0, 8);
-		memset(&rpc_state, 0, sizeof(rpc_state_t));
-		cgc.buffer = (char *) &rpc_state;
 
 		if ((ret = cdo->generic_packet(cdi, &cgc)))
-			return ret;
+			goto err;
 
-		ai->lrpcs.type = rpc_state.type_code;
-		ai->lrpcs.vra = rpc_state.vra;
-		ai->lrpcs.ucca = rpc_state.ucca;
-		ai->lrpcs.region_mask = rpc_state.region_mask;
-		ai->lrpcs.rpc_scheme = rpc_state.rpc_scheme;
+		rpc_state = (rpc_state_t *)buf;
+		ai->lrpcs.type = rpc_state->type_code;
+		ai->lrpcs.vra = rpc_state->vra;
+		ai->lrpcs.ucca = rpc_state->ucca;
+		ai->lrpcs.region_mask = rpc_state->region_mask;
+		ai->lrpcs.rpc_scheme = rpc_state->rpc_scheme;
 		break;
 
 	/* Set region settings */
@@ -1728,20 +1785,23 @@ static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai)
 		buf[4] = ai->hrpcs.pdrc;
 
 		if ((ret = cdo->generic_packet(cdi, &cgc)))
-			return ret;
+			goto err;
 		break;
 
 	default:
 		cdinfo(CD_WARNING, "Invalid DVD key ioctl (%d)\n", ai->type);
-		return -ENOTTY;
+		ret = -ENOTTY;
+		goto err;
 	}
-
-	return 0;
+	ret = 0;
+err:
+	kfree(buf);
+	return ret;
 }
 
 static int dvd_read_physical(struct cdrom_device_info *cdi, dvd_struct *s)
 {
-	unsigned char buf[21], *base;
+	unsigned char *buf, *base;
 	struct dvd_layer *layer;
 	struct packet_command cgc;
 	struct cdrom_device_ops *cdo = cdi->ops;
@@ -1750,7 +1810,11 @@ static int dvd_read_physical(struct cdrom_device_info *cdi, dvd_struct *s)
 	if (layer_num >= DVD_LAYERS)
 		return -EINVAL;
 
-	init_cdrom_command(&cgc, buf, sizeof(buf), CGC_DATA_READ);
+	buf = kmalloc(21, GFP_KERNEL);
+	if (!buf)
+		return -ENOMEM;
+
+	init_cdrom_command(&cgc, buf, 21, CGC_DATA_READ);
 	cgc.cmd[0] = GPCMD_READ_DVD_STRUCTURE;
 	cgc.cmd[6] = layer_num;
 	cgc.cmd[7] = s->type;
@@ -1762,7 +1826,7 @@ static int dvd_read_physical(struct cdrom_device_info *cdi, dvd_struct *s)
 	cgc.quiet = 1;
 
 	if ((ret = cdo->generic_packet(cdi, &cgc)))
-		return ret;
+		goto err;
 
 	base = &buf[4];
 	layer = &s->physical.layer[layer_num];
@@ -1786,17 +1850,24 @@ static int dvd_read_physical(struct cdrom_device_info *cdi, dvd_struct *s)
 	layer->end_sector_l0 = base[13] << 16 | base[14] << 8 | base[15];
 	layer->bca = base[16] >> 7;
 
-	return 0;
+	ret = 0;
+err:
+	kfree(buf);
+	return ret;
 }
 
 static int dvd_read_copyright(struct cdrom_device_info *cdi, dvd_struct *s)
 {
 	int ret;
-	u_char buf[8];
+	u_char *buf;
 	struct packet_command cgc;
 	struct cdrom_device_ops *cdo = cdi->ops;
 
-	init_cdrom_command(&cgc, buf, sizeof(buf), CGC_DATA_READ);
+	buf = kmalloc(8, GFP_KERNEL);
+	if (!buf)
+		return -ENOMEM;
+
+	init_cdrom_command(&cgc, buf, 8, CGC_DATA_READ);
 	cgc.cmd[0] = GPCMD_READ_DVD_STRUCTURE;
 	cgc.cmd[6] = s->copyright.layer_num;
 	cgc.cmd[7] = s->type;
@@ -1804,12 +1875,15 @@ static int dvd_read_copyright(struct cdrom_device_info *cdi, dvd_struct *s)
 	cgc.cmd[9] = cgc.buflen & 0xff;
 
 	if ((ret = cdo->generic_packet(cdi, &cgc)))
-		return ret;
+		goto err;
 
 	s->copyright.cpst = buf[4];
 	s->copyright.rmi = buf[5];
 
-	return 0;
+	ret = 0;
+err:
+	kfree(buf);
+	return ret;
 }
 
 static int dvd_read_disckey(struct cdrom_device_info *cdi, dvd_struct *s)
@@ -1841,26 +1915,33 @@ static int dvd_read_disckey(struct cdrom_device_info *cdi, dvd_struct *s)
 static int dvd_read_bca(struct cdrom_device_info *cdi, dvd_struct *s)
 {
 	int ret;
-	u_char buf[4 + 188];
+	u_char *buf;
 	struct packet_command cgc;
 	struct cdrom_device_ops *cdo = cdi->ops;
 
-	init_cdrom_command(&cgc, buf, sizeof(buf), CGC_DATA_READ);
+	buf = kmalloc(4 + 188, GFP_KERNEL);
+	if (!buf)
+		return -ENOMEM;
+
+	init_cdrom_command(&cgc, buf, 4 + 188, CGC_DATA_READ);
 	cgc.cmd[0] = GPCMD_READ_DVD_STRUCTURE;
 	cgc.cmd[7] = s->type;
 	cgc.cmd[9] = cgc.buflen & 0xff;
 
 	if ((ret = cdo->generic_packet(cdi, &cgc)))
-		return ret;
+		goto err;
 
 	s->bca.len = buf[0] << 8 | buf[1];
 	if (s->bca.len < 12 || s->bca.len > 188) {
 		cdinfo(CD_WARNING, "Received invalid BCA length (%d)\n", s->bca.len);
-		return -EIO;
+		ret = -EIO;
+		goto err;
 	}
 	memcpy(s->bca.value, &buf[4], s->bca.len);
-
-	return 0;
+	ret = 0;
+err:
+	kfree(buf);
+	return ret;
 }
 
 static int dvd_read_manufact(struct cdrom_device_info *cdi, dvd_struct *s)
@@ -1960,9 +2041,13 @@ static int cdrom_read_subchannel(struct cdrom_device_info *cdi,
 {
 	struct cdrom_device_ops *cdo = cdi->ops;
 	struct packet_command cgc;
-	char buffer[32];
+	char *buffer;
 	int ret;
 
+	buffer = kmalloc(32, GFP_KERNEL);
+	if (!buffer)
+		return -ENOMEM;
+
 	init_cdrom_command(&cgc, buffer, 16, CGC_DATA_READ);
 	cgc.cmd[0] = GPCMD_READ_SUBCHANNEL;
 	cgc.cmd[1] = 2;     /* MSF addressing */
@@ -1971,7 +2056,7 @@ static int cdrom_read_subchannel(struct cdrom_device_info *cdi,
 	cgc.cmd[8] = 16;
 
 	if ((ret = cdo->generic_packet(cdi, &cgc)))
-		return ret;
+		goto err;
 
 	subchnl->cdsc_audiostatus = cgc.buffer[1];
 	subchnl->cdsc_format = CDROM_MSF;
@@ -1986,7 +2071,10 @@ static int cdrom_read_subchannel(struct cdrom_device_info *cdi,
 	subchnl->cdsc_absaddr.msf.second = cgc.buffer[10];
 	subchnl->cdsc_absaddr.msf.frame = cgc.buffer[11];
 
-	return 0;
+	ret = 0;
+err:
+	kfree(buffer);
+	return ret;
 }
 
 /*

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

From tsbogend@alpha.franken.de Fri Mar 21 23:04:52 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Mar 2008 23:04:54 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:37791 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S28578781AbYCUXEw (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 21 Mar 2008 23:04:52 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JcqI7-0002en-00; Sat, 22 Mar 2008 00:04:51 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id 64B93C2DFD; Sat, 22 Mar 2008 00:04:24 +0100 (CET)
Date:	Sat, 22 Mar 2008 00:04:24 +0100
To:	peter fuerst <post@pfrst.de>
Cc:	linux-scsi@vger.kernel.org, linux-mips@linux-mips.org,
	ralf@linux-mips.org, James.Bottomley@HansenPartnership.com
Subject: Re: [PATCH] WD33C93: let platform stub override no_sync/fast/dma_mode
Message-ID: <20080321230424.GA31455@alpha.franken.de>
References: <20080321212543.6F769C2DF8@solo.franken.de> <Pine.LNX.4.58.0803212302190.564@Indigo2.Peter>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <Pine.LNX.4.58.0803212302190.564@Indigo2.Peter>
User-Agent: Mutt/1.5.13 (2006-08-11)
From:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Return-Path: <tsbogend@alpha.franken.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: 18464
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips
Content-Length: 758
Lines: 22

On Fri, Mar 21, 2008 at 11:20:07PM +0100, peter fuerst wrote:
> 
> the code-sequence
> 
> 	wd33c93_init(...
> 	if (hdata->wh.no_sync == 0xff)
> 		hdata->wh.no_sync = 0;
> 
> was put/kept there intentionally - in this very order - to enable
> "nosync" from the command-line!

this hack is IMHO no longer needed. If the user wants to override no_sync
via kernel command line, it works as before. If the user doesn't no_sync
will be 0 (now set in sgiwd93.c before calling wd33c93_init()) and the
driver will try to do sync transfers for all devices. It works like before.
Or did I miss something ?

Thomas

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

From post@pfrst.de Fri Mar 21 23:54:46 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Mar 2008 23:54:48 +0000 (GMT)
Received: from mail1.pearl-online.net ([62.159.194.147]:18715 "EHLO
	mail1.pearl-online.net") by ftp.linux-mips.org with ESMTP
	id S28578898AbYCUXyq (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 21 Mar 2008 23:54:46 +0000
Received: from SNaIlmail.Peter (85.233.32.210.static.cablesurf.de [85.233.32.210])
	by mail1.pearl-online.net (Postfix) with ESMTP id 29058CA17;
	Sat, 22 Mar 2008 00:54:41 +0100 (CET)
Received: from Indigo2.Peter (Indigo2.Peter [192.168.1.28])
	by SNaIlmail.Peter (8.12.6/8.12.6/Sendmail/Linux 2.0.32) with ESMTP id m2L3KMfM001807;
	Fri, 21 Mar 2008 04:20:22 +0100
Received: from Indigo2.Peter (localhost [127.0.0.1])
	by Indigo2.Peter (8.12.6/8.12.6/Sendmail/Linux 2.6.14-rc2-ip28) with ESMTP id m2LNj3FS000629;
	Sat, 22 Mar 2008 00:45:03 +0100
Received: from localhost (pf@localhost)
	by Indigo2.Peter (8.12.6/8.12.6/Submit) with ESMTP id m2LNj3rB000626;
	Sat, 22 Mar 2008 00:45:03 +0100
X-Authentication-Warning: Indigo2.Peter: pf owned process doing -bs
Date:	Sat, 22 Mar 2008 00:45:03 +0100 (CET)
From:	peter fuerst <post@pfrst.de>
X-X-Sender: pf@Indigo2.Peter
Reply-To: post@pfrst.de
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc:	linux-scsi@vger.kernel.org, linux-mips@linux-mips.org,
	ralf@linux-mips.org, James.Bottomley@HansenPartnership.com
Subject: Re: [PATCH] WD33C93: let platform stub override no_sync/fast/dma_mode
In-Reply-To: <20080321230424.GA31455@alpha.franken.de>
Message-ID: <Pine.LNX.4.58.0803220038510.622@Indigo2.Peter>
References: <20080321212543.6F769C2DF8@solo.franken.de>
 <Pine.LNX.4.58.0803212302190.564@Indigo2.Peter> <20080321230424.GA31455@alpha.franken.de>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Return-Path: <post@pfrst.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: 18465
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: post@pfrst.de
Precedence: bulk
X-list: linux-mips
Content-Length: 1097
Lines: 34



On Sat, 22 Mar 2008, Thomas Bogendoerfer wrote:

> Date: Sat, 22 Mar 2008 00:04:24 +0100
> From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> To: peter fuerst <post@pfrst.de>
> Cc: linux-scsi@vger.kernel.org, linux-mips@linux-mips.org,
>      ralf@linux-mips.org, James.Bottomley@HansenPartnership.com
> Subject: Re: [PATCH] WD33C93: let platform stub override
>     no_sync/fast/dma_mode
>
> On Fri, Mar 21, 2008 at 11:20:07PM +0100, peter fuerst wrote:
> > ...
>
> this hack is IMHO no longer needed. If the user wants to override no_sync
> via kernel command line, it works as before. If the user doesn't no_sync
> will be 0 (now set in sgiwd93.c before calling wd33c93_init()) and the
> driver will try to do sync transfers for all devices. It works like before.

It works cleaner than before :-)

> Or did I miss something ?

No. As already said, just forget it, i missed to look at the whole patch in time.

>
> Thomas
>
> --
> Crap can work. Given enough thrust pigs will fly, but it's not necessary a
> good idea.                                                [ RFC1925, 2.3 ]
>
>

From sshtylyov@ru.mvista.com Sat Mar 22 19:09:28 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 22 Mar 2008 19:09:30 +0000 (GMT)
Received: from h155.mvista.com ([63.81.120.155]:32043 "EHLO imap.sh.mvista.com")
	by ftp.linux-mips.org with ESMTP id S28581274AbYCVTJ2 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sat, 22 Mar 2008 19:09:28 +0000
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id 5E1AD3ECA; Sat, 22 Mar 2008 12:09:24 -0700 (PDT)
Message-ID: <47E559B6.9010001@ru.mvista.com>
Date:	Sat, 22 Mar 2008 22:10:46 +0300
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
X-Accept-Language: ru, en-us, en-gb
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: Where's C0 count/.compare IRQ is unmasked??
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@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: 18466
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 590
Lines: 12

Hello.

    I'm dazed and confused -- please forget my ignorance but I fail to see 
where the count/compare interrupt is enabled by the most platforms but Alchemy 
(which does it in arch_init_irq() -- which is causing me trouble). I'd 
expected this to happev in cevr-r4k.c but no, it doesn't (unlike cevt-sb1250.c 
for example). I'd expected this to happen in the platform code but most 
platforms disable (or ignore) this IRQ in arch_init_irq() and ignore it in 
plat_time_init() (probably correctly)? Could anyone shed some light on this? 
Where is a proper place to do it?

WBR, Sergei

From giuseppe@eppesuigoccas.homedns.org Sat Mar 22 23:40:17 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 22 Mar 2008 23:40:19 +0000 (GMT)
Received: from host194-211-dynamic.20-79-r.retail.telecomitalia.it ([79.20.211.194]:28651
	"EHLO eppesuigoccas.homedns.org") by ftp.linux-mips.org with ESMTP
	id S28642771AbYCVXkR (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 22 Mar 2008 23:40:17 +0000
Received: from casa ([192.168.2.34])
	by eppesuigoccas.homedns.org with esmtpsa (TLS-1.0:RSA_ARCFOUR_MD5:16)
	(Exim 4.63)
	(envelope-from <giuseppe@eppesuigoccas.homedns.org>)
	id 1JdDJn-0001YG-6X
	for linux-mips@linux-mips.org; Sun, 23 Mar 2008 00:40:09 +0100
Subject: Re: Compiler error? [was: Re: new kernel oops in recent kernels]
From:	Giuseppe Sacco <giuseppe@eppesuigoccas.homedns.org>
To:	linux-mips@linux-mips.org
In-Reply-To: <20080321230010.GA31135@alpha.franken.de>
References: <1205664563.3050.4.camel@localhost>
	 <1205699257.4159.14.camel@casa> <20080316233619.GA29511@alpha.franken.de>
	 <1205741142.3515.2.camel@localhost> <20080317141828.GA25798@linux-mips.org>
	 <20080317143215.GA11497@alpha.franken.de>
	 <20080321230010.GA31135@alpha.franken.de>
Content-Type: text/plain
Date:	Sun, 23 Mar 2008 00:39:58 +0100
Message-Id: <1206229198.4075.12.camel@casa>
Mime-Version: 1.0
X-Mailer: Evolution 2.6.3 
Content-Transfer-Encoding: 7bit
Return-Path: <giuseppe@eppesuigoccas.homedns.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: 18467
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: giuseppe@eppesuigoccas.homedns.org
Precedence: bulk
X-list: linux-mips
Content-Length: 532
Lines: 18

Hi Thomas,

Il giorno sab, 22/03/2008 alle 00.00 +0100, Thomas Bogendoerfer ha
scritto:
[...]
> below is a patch, which replaces all buffers on the stack, which are
> passed to the scsi layer with kmalloced ones.
> 
> Giuseppe, could you please check if this fixes your problem, and
> doesn't cause new regressions ? 

I rebuilt a kernel (pulling latest code from git) with your patch. Now I
do not get anymore the Oops at boot time, moreover I may mount a CDROM
and copying data from that CDROM to local SCSI disk.

Bye,
Giuseppe


From tsbogend@alpha.franken.de Sun Mar 23 11:16:25 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 23 Mar 2008 11:16:28 +0000 (GMT)
Received: from elvis.franken.de ([193.175.24.41]:27588 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S20024773AbYCWLQZ (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sun, 23 Mar 2008 11:16:25 +0000
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JdOBc-0004SP-01; Sun, 23 Mar 2008 12:16:24 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id CBF39C2DFF; Sun, 23 Mar 2008 12:16:10 +0100 (CET)
Date:	Sun, 23 Mar 2008 12:16:10 +0100
To:	Giuseppe Sacco <giuseppe@eppesuigoccas.homedns.org>
Cc:	linux-mips@linux-mips.org
Subject: Re: Compiler error? [was: Re: new kernel oops in recent kernels]
Message-ID: <20080323111610.GA8660@alpha.franken.de>
References: <1205664563.3050.4.camel@localhost> <1205699257.4159.14.camel@casa> <20080316233619.GA29511@alpha.franken.de> <1205741142.3515.2.camel@localhost> <20080317141828.GA25798@linux-mips.org> <20080317143215.GA11497@alpha.franken.de> <20080321230010.GA31135@alpha.franken.de> <1206229198.4075.12.camel@casa>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1206229198.4075.12.camel@casa>
User-Agent: Mutt/1.5.13 (2006-08-11)
From:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Return-Path: <tsbogend@alpha.franken.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: 18468
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips
Content-Length: 612
Lines: 15

On Sun, Mar 23, 2008 at 12:39:58AM +0100, Giuseppe Sacco wrote:
> > Giuseppe, could you please check if this fixes your problem, and
> > doesn't cause new regressions ? 
> 
> I rebuilt a kernel (pulling latest code from git) with your patch. Now I
> do not get anymore the Oops at boot time, moreover I may mount a CDROM
> and copying data from that CDROM to local SCSI disk.

great, thank you for testing. I'll submit the patch to the maintainer.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

From mrre@gimme-th.at Sun Mar 23 19:56:03 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 23 Mar 2008 19:56:05 +0000 (GMT)
Received: from mordac.selfhost.de ([82.98.82.6]:33940 "EHLO mordac.selfhost.de")
	by ftp.linux-mips.org with ESMTP id S20026640AbYCWT4D (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sun, 23 Mar 2008 19:56:03 +0000
Received: (qmail 32550 invoked from network); 23 Mar 2008 19:55:53 -0000
Received: from unknown (HELO belisama.gimme-th.at) (postmaster@gimme-th.at@84.146.149.186)
  by mailout.selfhost.de with SMTP; 23 Mar 2008 19:55:53 -0000
Received: by belisama.gimme-th.at (Postfix, from userid 5001)
	id 4AF4B4B991; Sun, 23 Mar 2008 20:52:10 +0100 (CET)
Received: from hey-dude.gimme-th.at (localhost [127.0.0.1])
	by belisama.gimme-th.at (Postfix) with ESMTP id BE5264B987
	for <linux-mips@linux-mips.org>; Sun, 23 Mar 2008 20:52:05 +0100 (CET)
Received: from 84.146.149.186
        (SquirrelMail authenticated user mrre@gimme-th.at)
        by hey-dude.gimme-th.at with HTTP;
        Sun, 23 Mar 2008 20:52:05 +0100 (CET)
Message-ID: <61692.84.146.149.186.1206301925.squirrel@hey-dude.gimme-th.at>
Date:	Sun, 23 Mar 2008 20:52:05 +0100 (CET)
Subject: Problem with compiling kernel on Octance R10K
From:	mrre@gimme-th.at
To:	linux-mips@linux-mips.org
User-Agent: SquirrelMail/1.4.12
MIME-Version: 1.0
Content-Type: text/plain;charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Priority: 3 (Normal)
Importance: Normal
Return-Path: <mrre@gimme-th.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: 18469
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: mrre@gimme-th.at
Precedence: bulk
X-list: linux-mips
Content-Length: 2783
Lines: 61

Hi,

I am not quite sure, whether I am at the right point to put this question.
But, maybe someone can help me

I recently aquired a SGI Octane with R10k-processor. I tried to install
gentoo on it, as described here:
http://www.gentoo.org/doc/en/handbook/handbook-mips.xml

I was using this gentoo-kernel: linux-2.6.22.6-20070902.ip30

It ended up with this failure-message:

  UPD     include/linux/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1
arch/mips/sgi-ip30/built-in.o: In function `mask_and_ack_heart_irq':
ip30-irq.c:(.text+0x57c): undefined reference to `ip30_irq_bridge'
ip30-irq.c:(.text+0x580): undefined reference to `ip30_irq_bridge'
ip30-irq.c:(.text+0x584): undefined reference to `ip30_irq_bridge'
ip30-irq.c:(.text+0x588): undefined reference to `ip30_irq_bridge'
arch/mips/sgi-ip30/built-in.o: In function `startup_heart_irq':
ip30-irq.c:(.text+0x760): undefined reference to `ip30_irq_bridge'
arch/mips/sgi-ip30/built-in.o:ip30-irq.c:(.text+0x764): more undefined
references to `ip30_irq_bridge' follow
arch/mips/sgi-ip30/built-in.o: In function `startup_heart_irq':
ip30-irq.c:(.text+0x794): undefined reference to `ip30_irq_in_bridge'
ip30-irq.c:(.text+0x798): undefined reference to `ip30_irq_in_bridge'
ip30-irq.c:(.text+0x79c): undefined reference to `ip30_irq_in_bridge'
ip30-irq.c:(.text+0x7a0): undefined reference to `ip30_irq_in_bridge'
arch/mips/sgi-ip30/built-in.o: In function `shutdown_heart_irq':
ip30-irq.c:(.text+0x910): undefined reference to `ip30_irq_in_bridge'
arch/mips/sgi-ip30/built-in.o:ip30-irq.c:(.text+0x914): more undefined
references to `ip30_irq_in_bridge' follow
arch/mips/sgi-ip30/built-in.o: In function `shutdown_heart_irq':
ip30-irq.c:(.text+0x938): undefined reference to `ip30_irq_bridge'
ip30-irq.c:(.text+0x93c): undefined reference to `ip30_irq_bridge'
ip30-irq.c:(.text+0x940): undefined reference to `ip30_irq_bridge'
ip30-irq.c:(.text+0x944): undefined reference to `ip30_irq_bridge'
arch/mips/sgi-ip30/built-in.o: In function `ip30_xtalk_setup':
: undefined reference to `bridge_probe'
arch/mips/sgi-ip30/built-in.o: In function `ip30_xtalk_setup':
: relocation truncated to fit: R_MIPS_26 against `bridge_probe'
arch/mips/mm/built-in.o: In function `free_initmem':
: undefined reference to `prom_free_prom_memory'
arch/mips/mm/built-in.o: In function `free_initmem':
: relocation truncated to fit: R_MIPS_26 against `prom_free_prom_memory'
arch/mips/arc/lib.a(init.o): In function `prom_init':
init.c:(.init.text+0x130): undefined reference to `prom_meminit'
init.c:(.init.text+0x130): relocation truncated to fit: R_MIPS_26 against
`prom_meminit'
make: *** [.tmp_vmlinux1] Error 1

Does anybody know, what I might do, to correct this problem?

Thank you in advance,

Markus



From zzh.hust@gmail.com Mon Mar 24 03:31:42 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 24 Mar 2008 03:31:44 +0000 (GMT)
Received: from py-out-1112.google.com ([64.233.166.182]:43728 "EHLO
	py-out-1112.google.com") by ftp.linux-mips.org with ESMTP
	id S28644041AbYCXDbm (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 24 Mar 2008 03:31:42 +0000
Received: by py-out-1112.google.com with SMTP id d32so3064482pye.22
        for <linux-mips@linux-mips.org>; Sun, 23 Mar 2008 20:31:41 -0700 (PDT)
DKIM-Signature:	v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=beta;
        h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type;
        bh=PEX87JKfVOQTTly2Sh/18FJgeFaN6KEHMPYpIeTyVzA=;
        b=TnwMhtujcXn2vSa8knQVqC1fFH7GpuhNw4GSaJ4tPr78Gs6OPzOt+7WNCqFHuNqeFokentS7NB6ZAlKwlmUiIiv9xl6JEMqPCuzpcD5FrldhsjRIbrpYUXgILQln5eGbKwreIoCYL5zTrGXi0cPVsENdOD2Kf/hsHty+bQDgBsM=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=beta;
        h=message-id:date:from:to:subject:mime-version:content-type;
        b=cR1BZNPFts/a3VOM3h32dgyR3uv8DpyntQoBPsfTeuizeI1tpK+l5AKPoyeLzYaD1eXa08MSYo57bOrL8FXYjJEyjdnOQNgseYFbQAfpIfS911WCunCEvZft/CjDYwN4y+0dQg5JYN5VfP2ulXRsmT22H+A+O+qXd792BfBQWrc=
Received: by 10.35.102.1 with SMTP id e1mr7485236pym.61.1206329501161;
        Sun, 23 Mar 2008 20:31:41 -0700 (PDT)
Received: by 10.35.16.3 with HTTP; Sun, 23 Mar 2008 20:31:41 -0700 (PDT)
Message-ID: <50c9a2250803232031o5033ce15o5ab843a9181e4e12@mail.gmail.com>
Date:	Mon, 24 Mar 2008 11:31:41 +0800
From:	zhuzhenhua <zzh.hust@gmail.com>
To:	linux-mips <linux-mips@linux-mips.org>
Subject: is uClibc-nptl stable for MIPS now?
MIME-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_4695_32279597.1206329501152"
Return-Path: <zzh.hust@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: 18470
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: zzh.hust@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1452
Lines: 46

------=_Part_4695_32279597.1206329501152
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

hello,all
         recently, i want to switch my toolchain from glibc to uClibc,. and
with buildroot, i succeed in toolchain with pthread_old.
         i try to build a uClibc-nptl toolchain, but failed( i have used the
gcc-4.2.1 and binutils-2.17 version). i wonder whether there
         is a stable version for uClibc-nptl on MIPS.   if someone get it
work, please give some info about the version.
         thanks for any hints.


Best Regards



zzh

------=_Part_4695_32279597.1206329501152
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

hello,all<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; recently, i want to
switch my toolchain from glibc to uClibc,. and with buildroot, i
succeed in toolchain with pthread_old. <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i try to build a
uClibc-nptl toolchain, but failed( i have used the gcc-4.2.1 and
binutils-2.17 version). i wonder whether there<br>
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; is a stable version for uClibc-nptl
on MIPS.&nbsp;&nbsp; if someone get it work, please give some info
about the version.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; thanks for any hints.<br>
<br>
<br>
Best Regards<br>
<br>
<br>
<br>
zzh<br>

------=_Part_4695_32279597.1206329501152--

From ddaney@avtrex.com Mon Mar 24 05:40:35 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 24 Mar 2008 05:40:38 +0000 (GMT)
Received: from smtp1.dnsmadeeasy.com ([205.234.170.144]:25488 "EHLO
	smtp1.dnsmadeeasy.com") by ftp.linux-mips.org with ESMTP
	id S20022130AbYCXFkf (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 24 Mar 2008 05:40:35 +0000
Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id 62511315D4B
	for <linux-mips@linux-mips.org>; Mon, 24 Mar 2008 05:40:26 +0000 (UTC)
X-Authenticated-Name: js.dnsmadeeasy
X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com
Received: from avtrex.com (unknown [67.116.42.147])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP
	for <linux-mips@linux-mips.org>; Mon, 24 Mar 2008 05:40:26 +0000 (UTC)
Received: from jennifer.localdomain ([192.168.7.225]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Sun, 23 Mar 2008 22:40:23 -0700
Message-ID: <47E73EC5.1080507@avtrex.com>
Date:	Sun, 23 Mar 2008 22:40:21 -0700
From:	David Daney <ddaney@avtrex.com>
User-Agent: Thunderbird 2.0.0.12 (X11/20080226)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: SGI Indy looking for a home...
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 24 Mar 2008 05:40:23.0475 (UTC) FILETIME=[8E16F830:01C88D71]
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: 18471
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: 3559
Lines: 103

I have an SGI Indy located in San Jose, CA that is looking for a home.  
Gratis to anyone that will take it away and make good use of it.

This bad boy has a whopping 256MB RAM (The maximum for an Indy I think), 
and a 1GB + 2GB disks.  It also sports an adapter so that you can attach 
a standard VGA monitor (must have sync on green, Samgung flat panels 
seem to work, but not my Cornerstone CRT).  Hook up standard PS-2 mouse 
and keyboard (not included), and you are ready to go with this fine 
MIPS64 system.

Currently it is running Debian, I am not sure the exact clock speed 
(probably 150MHz) as I don't have a monitor attached to view hwinv.  But 
here is the info I have handy:

daney@indy:~$ cat /proc/cpuinfo
system type             : SGI Indy
processor               : 0
cpu model               : R4400SC V5.0  FPU V0.0
BogoMIPS                : 74.49
wait instruction        : no
microsecond timers      : yes
tlb_entries             : 48
extra interrupt vector  : no
hardware watchpoint     : yes
ASEs implemented        :
VCED exceptions         : 476805
VCEI exceptions         : 4876

daney@indy:~$ dmesg
Linux version 2.6.18-4-r4k-ip22 (Debian 2.6.18.dfsg.1-12etch2) 
(dannf@debian.org) (gcc version 4.1.2 20061115 (prerelease) (Debian 
4.1.1-21)) #1 Tue May 8 03:48:00 UTC 2007
ARCH: SGI-IP22
PROMLIB: ARC firmware Version 1 Revision 10
CPU revision is: 00000450
FPU revision is: 00000500
MC: SGI memory controller Revision 3
MC: Probing memory configuration:
 bank0: 128M @ 08000000
 bank1: 128M @ 10000000
Determined physical RAM map:
 memory: 0000000010000000 @ 0000000008000000 (usable)

.
.
.
Calibrating system timer... 300000 [150.0000 MHz CPU]
Using 75.000 MHz high precision timer.
NG1: Revision 6, 24 bitplanes, REX3 revision B, VC2 revision A, xmap9 
revision A, cmap revision C, bt445 revision D
NG1: Screensize 1024x768
Console: colour SGI Newport 128x48
.
.
.
eth0: SGI Seeq8003 08:00:69:07:94:d1
wd33c93-0: chip=WD33c93B/13 no_sync=0xff no_dma=0 debug_flags=0x00
           setup_args=,,,,,,,,,
           Version 1.26 - 22/Feb/2003, Compiled May  8 2007 at 03:26:34
scsi0 : SGI WD93
 sending SDTR 0103013f0csync_xfer=2c<5>  Vendor: SGI       Model: 
SEAGATE ST31230N  Rev: 0272
  Type:   Direct-Access                      ANSI SCSI revision: 02
 sending SDTR 0103013f0csync_xfer=2c<5>  Vendor: SGI       Model: 
SEAGATE ST32430N  Rev: 0272
  Type:   Direct-Access                      ANSI SCSI revision: 02
SCSI device sda: 2070235 512-byte hdwr sectors (1060 MB)
sda: Write Protect is off
sda: Mode Sense: 87 00 10 08
SCSI device sda: drive cache: write through w/ FUA
SCSI device sda: 2070235 512-byte hdwr sectors (1060 MB)
sda: Write Protect is off
sda: Mode Sense: 87 00 10 08
SCSI device sda: drive cache: write through w/ FUA
 sda: sda1 sda2 sda9 sda11
sd 0:0:1:0: Attached scsi disk sda
SCSI device sdb: 4197405 512-byte hdwr sectors (2149 MB)
sdb: Write Protect is off
sdb: Mode Sense: 87 00 10 08
SCSI device sdb: drive cache: write through w/ FUA
SCSI device sdb: 4197405 512-byte hdwr sectors (2149 MB)
sdb: Write Protect is off
sdb: Mode Sense: 87 00 10 08
SCSI device sdb: drive cache: write through w/ FUA
 sdb: sdb1 sdb2 sdb9 sdb11
sd 0:0:2:0: Attached scsi disk sdb


daney@indy:~$ cat /proc/partitions
major minor  #blocks  name

   8     0    1035117 sda
   8     1     851136 sda1
   8     2     130944 sda2
   8     9      52173 sda9
   8    11    1034253 sda11
   8    16    2098702 sdb
   8    17    1966167 sdb1
   8    18     130625 sdb2
   8    25       1567 sdb9
   8    27    2098360 sdb11



From ralf@linux-mips.org Mon Mar 24 07:58:23 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 24 Mar 2008 07:58:25 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:62151 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S20022535AbYCXH6X (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 24 Mar 2008 07:58:23 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2O7wMnN001731;
	Mon, 24 Mar 2008 07:58:22 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2O7wMa5001730;
	Mon, 24 Mar 2008 07:58:22 GMT
Date:	Mon, 24 Mar 2008 07:58:22 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	linux-mips@linux-mips.org
Cc:	linux-kernel@vger.kernel.org
Subject: [ADMIN] Linux-mips.org moving to new site
Message-ID: <20080324075822.GB11880@linux-mips.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18472
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: 840
Lines: 16

On Tuesday, 25th March the linux-mips.org server machine will be moved from
it's current location just outside of Cambridge, England (old) to a new site
in Lisboa, Portugal.  This is expected to result in a downtime of up to a
week.  During this time I will try to maintain services at some reduced
level - and very much reduced bandwidth.

Git users are reminded that an uptodate copy of the Linux/MIPS git
repository is available on kernel.org which also has several thousand times
more bandwidth available.  The repository URLs are:

  gitweb: http://git.kernel.org/?p=linux/kernel/git/ralf/linux.git;a=summary
  git:    git://git.kernel.org/pub/scm/linux/kernel/git/ralf/linux.git
          http://www.kernel.org/pub/scm/linux/kernel/git/ralf/linux.git
          rsync://rsync.kernel.org/pub/scm/linux/kernel/git/ralf/linux.git

  Ralf

From lstefani@yahoo.com Mon Mar 24 14:00:39 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 24 Mar 2008 14:00:41 +0000 (GMT)
Received: from web38802.mail.mud.yahoo.com ([209.191.125.93]:17010 "HELO
	web38802.mail.mud.yahoo.com") by ftp.linux-mips.org with SMTP
	id S20027156AbYCXOAj (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 24 Mar 2008 14:00:39 +0000
Received: (qmail 82702 invoked by uid 60001); 24 Mar 2008 14:00:16 -0000
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
  s=s1024; d=yahoo.com;
  h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID;
  b=Et/Zpi+bUeZaxs8HG/OOzgkv+DrVVDWhb7pJL2X0Rcum4XOw4wQ3axG6/KwrXUixGKdJb2TaL2bNfoSSRtK1FKpsDBCmCWc3phlAC6L3amIQd4YQTt2jH0S/8KuplJ+6cUmWUL3G14SOaVL2v/8VOw0zEi8C5AYqmX1ewJ/f5/Y=;
X-YMail-OSG: V_Z0prMVM1l1d8NSGbuwhuBXKoIj61lrMeC0WGlodmqgzK2BOwcUwKhAC4_o.Lg6pIk_zSBcPtP20HWlnqrHxltU7UCQ6vbY3lrjH7ZHlbfJCCIKQEM-
Received: from [68.236.82.170] by web38802.mail.mud.yahoo.com via HTTP; Mon, 24 Mar 2008 07:00:15 PDT
Date:	Mon, 24 Mar 2008 07:00:15 -0700 (PDT)
From:	Larry Stefani <lstefani@yahoo.com>
Subject: SB1250 locking up in init on current 2.6.16 kernel
To:	linux-mips@linux-mips.org
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Message-ID: <15031.81072.qm@web38802.mail.mud.yahoo.com>
Return-Path: <lstefani@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: 18473
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: lstefani@yahoo.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1107
Lines: 38

Hi,

I've been trying to upgrade from 2.6.16.18 to
2.6.16.60, but am seeing a hard lockup right before
"INIT: version 2.78 booting" on my SB1250-based board.

I found a related discussion on the Debian mailing
list:

http://groups.google.com/group/linux.debian.bugs.dist/browse_thread/thread/b7159ee25106c7f9

However, after applying Thiemo's patch to mark pages
tainted by PIO IDE as dirty, the lockup still occurs.

I narrowed the file changes to

     arch/mips/mm/c-sb1.c
     arch/mips/mm/cache.c
     arch/mips/mm/init.c
     include/asm-mips/cache-flush.h
     include/asm-mips/page.h

between 2.6.16.27 and 2.6.16.29.  There was no
2.6.16.28 tarball posted on linux-mips.org, so I
basically brought .27 to .29 until I found the
offending files.

Is anyone running a 2.6.16 kernel (after 2.6.16.27) on
a SB1250-based board?

Thanks,
Larry Stefani
lstefani@yahoo.com


      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

From sshtylyov@ru.mvista.com Mon Mar 24 14:22:18 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 24 Mar 2008 14:22:20 +0000 (GMT)
Received: from rtsoft3.corbina.net ([85.21.88.6]:64739 "EHLO
	buildserver.ru.mvista.com") by ftp.linux-mips.org with ESMTP
	id S20027184AbYCXOWS (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 24 Mar 2008 14:22:18 +0000
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id 796728814; Mon, 24 Mar 2008 19:22:35 +0400 (SAMT)
Message-ID: <47E7B970.30105@ru.mvista.com>
Date:	Mon, 24 Mar 2008 17:23:44 +0300
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
X-Accept-Language: ru, en-us, en-gb
MIME-Version: 1.0
To:	Nico Coesel <ncoesel@DEALogic.nl>
Cc:	linux-mips@linux-mips.org
Subject: Re: FW: Alchemy power managment code.
References: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF804@dealogicserver.DEALogic.nl>
In-Reply-To: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF804@dealogicserver.DEALogic.nl>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@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: 18474
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 759
Lines: 19

Hello.

Nico Coesel wrote:

> Ralf,
> Funny you ask because I tried this yesterday on a AU1100 system with the
> 2.6.24 kernel (from kernel.org). I'm afraid I must say the kernel
> crashes when I enable power management. The reason I want to use power
> management is because I need to send the CPU to sleep when the system
> shuts down. I hacked power.c and reset.c a bit so au_sleep() is called
> when the system is shut down. Perhaps someone can confirm the
> powermanagement can be made to work with some fixes (it didn't work with
> 2.6.21-rc4 either).

    The TOY cpunter 0 clockevent driver is also need to be written for the 
recent kernel as CP0 timer stops ticking after wait insn is executed -- see 
arch/mips/au1000/common/time.c...

WBR, Sergei

From sshtylyov@ru.mvista.com Mon Mar 24 14:30:13 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 24 Mar 2008 14:30:15 +0000 (GMT)
Received: from rtsoft3.corbina.net ([85.21.88.6]:4068 "EHLO
	buildserver.ru.mvista.com") by ftp.linux-mips.org with ESMTP
	id S20027526AbYCXOaN (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 24 Mar 2008 14:30:13 +0000
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id BDD2F8814; Mon, 24 Mar 2008 19:30:30 +0400 (SAMT)
Message-ID: <47E7BB4B.3080507@ru.mvista.com>
Date:	Mon, 24 Mar 2008 17:31:39 +0300
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
X-Accept-Language: ru, en-us, en-gb
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Cc:	Nico Coesel <ncoesel@DEALogic.nl>
Subject: Re: FW: Alchemy power managment code.
References: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF804@dealogicserver.DEALogic.nl> <47E7B970.30105@ru.mvista.com>
In-Reply-To: <47E7B970.30105@ru.mvista.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@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: 18475
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 428
Lines: 11

I just wrote:

  >    The TOY cpunter 0 clockevent driver is also need to be written for
> the recent kernel as CP0 timer stops ticking after wait insn is executed 
> -- see arch/mips/au1000/common/time.c...

    And here's found another possible issue with Alchemy PM -- the CP0 counter 
counts at unpredictable frequency in idle state (after executing "wait"), so 
the MIPS clocksource will probably be unstable?

WBR, Sergei

From sshtylyov@ru.mvista.com Mon Mar 24 17:58:02 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 24 Mar 2008 17:58:04 +0000 (GMT)
Received: from rtsoft3.corbina.net ([85.21.88.6]:9190 "EHLO
	buildserver.ru.mvista.com") by ftp.linux-mips.org with ESMTP
	id S28581922AbYCXR6C (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 24 Mar 2008 17:58:02 +0000
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id 42E628810; Mon, 24 Mar 2008 22:58:19 +0400 (SAMT)
Message-ID: <47E7EBFF.6020406@ru.mvista.com>
Date:	Mon, 24 Mar 2008 20:59:27 +0300
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
X-Accept-Language: ru, en-us, en-gb
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: Re: Where's C0 count/.compare IRQ is unmasked??
References: <47E559B6.9010001@ru.mvista.com>
In-Reply-To: <47E559B6.9010001@ru.mvista.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@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: 18476
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 421
Lines: 12

Hi, I wrote:

>    I'm dazed and confused -- please forget my ignorance but I fail to 
> see where the count/compare interrupt is enabled by the most platforms 
> but Alchemy (which does it in arch_init_irq() -- which is causing me 
> trouble). I'd expected this to happev in cevr-r4k.c but no, it doesn't 
> (unlike cevt-sb1250.c for example).

    In fact, it does, via setup_irq(), so ignorant I am. :-[

WBR, Sergei


From ralf@linux-mips.org Mon Mar 24 19:55:55 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 24 Mar 2008 19:55:57 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:42640 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28582640AbYCXTzz (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 24 Mar 2008 19:55:55 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2OJtsll015618;
	Mon, 24 Mar 2008 19:55:54 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2OJtrCs015616;
	Mon, 24 Mar 2008 19:55:53 GMT
Date:	Mon, 24 Mar 2008 19:55:53 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	linux-mips@linux-mips.org
Cc:	linux-kernel@vger.kernel.org
Subject: Re: [ADMIN] Linux-mips.org moving to new site
Message-ID: <20080324195553.GA15294@linux-mips.org>
References: <20080324075822.GB11880@linux-mips.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080324075822.GB11880@linux-mips.org>
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18477
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: 1108
Lines: 22

On Mon, Mar 24, 2008 at 07:58:22AM +0000, Ralf Baechle wrote:

> On Tuesday, 25th March the linux-mips.org server machine will be moved from
> it's current location just outside of Cambridge, England (old) to a new site
> in Lisboa, Portugal.  This is expected to result in a downtime of up to a
> week.  During this time I will try to maintain services at some reduced
> level - and very much reduced bandwidth.
> 
> Git users are reminded that an uptodate copy of the Linux/MIPS git
> repository is available on kernel.org which also has several thousand times
> more bandwidth available.  The repository URLs are:
> 
>   gitweb: http://git.kernel.org/?p=linux/kernel/git/ralf/linux.git;a=summary
>   git:    git://git.kernel.org/pub/scm/linux/kernel/git/ralf/linux.git
>           http://www.kernel.org/pub/scm/linux/kernel/git/ralf/linux.git
>           rsync://rsync.kernel.org/pub/scm/linux/kernel/git/ralf/linux.git

So now that the third person has already asked - no I'm not planning to move
to Portugal even though my still-employer is going to close his UK office
by the end of the month.

  Ralf

From sshtylyov@ru.mvista.com Mon Mar 24 20:14:25 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 24 Mar 2008 20:14:27 +0000 (GMT)
Received: from rtsoft3.corbina.net ([85.21.88.6]:36839 "EHLO
	buildserver.ru.mvista.com") by ftp.linux-mips.org with ESMTP
	id S28582890AbYCXUOZ (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 24 Mar 2008 20:14:25 +0000
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id 347188810; Tue, 25 Mar 2008 01:14:42 +0400 (SAMT)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	ralf@linux-mips.org
Subject: [PATCH] Alchemy: don't unmask timer IRQ early
Date:	Mon, 24 Mar 2008 23:15:50 +0300
User-Agent: KMail/1.5
Cc:	linux-mips@linux-mips.org
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200803242315.50423.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@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: 18478
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 3586
Lines: 103

Defer the unmasking of the count/compare interrupt (IRQ5) till the clockevent
driver initialization:

- only enable the cascaded IRQs 0 thru 4 in arch_init_irq(); kill the ALLINTS
  macro -- this change is blessed by AMD as I saw it in their own patch; :-)

- do not force IRQ5 enabled in plat_time_init() if PM is enabled and there's
  no 32 KHz crystal.

Update the copyrights (taking into account my prior changes), also removing
Pete Popov's old email...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

---
The current code only caused me issues with interrupts prematurely enabled,
so the patch may be considered a cleanup...

 arch/mips/au1000/common/irq.c         |    7 +++----
 arch/mips/au1000/common/time.c        |    8 ++------
 include/asm-mips/mach-au1x00/au1000.h |   12 ++----------
 3 files changed, 7 insertions(+), 20 deletions(-)

Index: linux-2.6/arch/mips/au1000/common/irq.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/irq.c
+++ linux-2.6/arch/mips/au1000/common/irq.c
@@ -1,7 +1,6 @@
 /*
- * Copyright 2001 MontaVista Software Inc.
- * Author: MontaVista Software, Inc.
- *		ppopov@mvista.com or source@mvista.com
+ * Copyright 2001, 2007-2008 MontaVista Software Inc.
+ * Author: MontaVista Software, Inc. <source@mvista.com>
  *
  * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org)
  *
@@ -591,7 +590,7 @@ void __init arch_init_irq(void)
 		imp++;
 	}
 
-	set_c0_status(ALLINTS);
+	set_c0_status(IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4);
 
 	/* Board specific IRQ initialization.
 	*/
Index: linux-2.6/arch/mips/au1000/common/time.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/time.c
+++ linux-2.6/arch/mips/au1000/common/time.c
@@ -1,6 +1,6 @@
 /*
  *
- * Copyright (C) 2001 MontaVista Software, ppopov@mvista.com
+ * Copyright (C) 2001, 2006, 2008 MontaVista Software, <source@mvista.com>
  * Copied and modified Carsten Langgaard's time.c
  *
  * Carsten Langgaard, carstenl@mips.com
@@ -261,12 +261,8 @@ void __init plat_time_init(void)
 	 * Check to ensure we really have a 32KHz oscillator before
 	 * we do this.
 	 */
-	if (no_au1xxx_32khz) {
+	if (no_au1xxx_32khz)
 		printk("WARNING: no 32KHz clock found.\n");
-
-		/* Ensure we get CPO_COUNTER interrupts.  */
-		set_c0_status(IE_IRQ5);
-	}
 	else {
 		while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C0S);
 		au_writel(0, SYS_TOYWRITE);
Index: linux-2.6/include/asm-mips/mach-au1x00/au1000.h
===================================================================
--- linux-2.6.orig/include/asm-mips/mach-au1x00/au1000.h
+++ linux-2.6/include/asm-mips/mach-au1x00/au1000.h
@@ -3,9 +3,8 @@
  * BRIEF MODULE DESCRIPTION
  *	Include file for Alchemy Semiconductor's Au1k CPU.
  *
- * Copyright 2000,2001 MontaVista Software Inc.
- * Author: MontaVista Software, Inc.
- *         	ppopov@mvista.com or source@mvista.com
+ * Copyright 2000-2001, 2006-2008 MontaVista Software Inc.
+ * Author: MontaVista Software, Inc. <source@mvista.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
@@ -117,13 +116,6 @@ extern struct au1xxx_irqmap au1xxx_irq_m
 
 #endif /* !defined (_LANGUAGE_ASSEMBLY) */
 
-#ifdef CONFIG_PM
-/* no CP0 timer irq */
-#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4)
-#else
-#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
-#endif
-
 /*
  * SDRAM Register Offsets
  */


From ralf@linux-mips.org Mon Mar 24 20:33:14 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 24 Mar 2008 20:33:16 +0000 (GMT)
Received: from localhost.localdomain ([127.0.0.1]:34747 "EHLO
	dl5rb.ham-radio-op.net") by ftp.linux-mips.org with ESMTP
	id S28582943AbYCXUdM (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 24 Mar 2008 20:33:12 +0000
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2OKXBYp016310;
	Mon, 24 Mar 2008 20:33:11 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2OKXBHo016308;
	Mon, 24 Mar 2008 20:33:11 GMT
Date:	Mon, 24 Mar 2008 20:33:11 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Larry Stefani <lstefani@yahoo.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: SB1250 locking up in init on current 2.6.16 kernel
Message-ID: <20080324203311.GB15294@linux-mips.org>
References: <15031.81072.qm@web38802.mail.mud.yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <15031.81072.qm@web38802.mail.mud.yahoo.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
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: 18479
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: 1357
Lines: 42

On Mon, Mar 24, 2008 at 07:00:15AM -0700, Larry Stefani wrote:

> I've been trying to upgrade from 2.6.16.18 to
> 2.6.16.60, but am seeing a hard lockup right before
> "INIT: version 2.78 booting" on my SB1250-based board.
> 
> I found a related discussion on the Debian mailing
> list:
> 
> http://groups.google.com/group/linux.debian.bugs.dist/browse_thread/thread/b7159ee25106c7f9
> 
> However, after applying Thiemo's patch to mark pages
> tainted by PIO IDE as dirty, the lockup still occurs.

It's a bug which should be fixed but nevertheless I can highly recommend
something like a SiliconImage SATA controller - the onboard PIO PATA
controller is so slow.

> I narrowed the file changes to
> 
>      arch/mips/mm/c-sb1.c
>      arch/mips/mm/cache.c
>      arch/mips/mm/init.c
>      include/asm-mips/cache-flush.h
>      include/asm-mips/page.h
> 
> between 2.6.16.27 and 2.6.16.29.  There was no
> 2.6.16.28 tarball posted on linux-mips.org, so I
> basically brought .27 to .29 until I found the
> offending files.

I've pushed the tag again so now there is a tarball.

If you need to track something like this you're probably best with
git bisect which should bring you right to the offending commit.

> Is anyone running a 2.6.16 kernel (after 2.6.16.27) on
> a SB1250-based board?

Later kernels do run on bcm1480 which is close enough.

  Ralf

From ralf@linux-mips.org Wed Mar 26 16:22:36 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Mar 2008 16:22:38 +0100 (CET)
Received: from oss.sgi.com ([192.48.170.157]:32678 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S1101694AbYCZOTF (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Mar 2008 15:19:05 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m2QEIOj2019652
	for <linux-mips@linux-mips.org>; Wed, 26 Mar 2008 07:18:25 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2QEIr0q004282
	for <linux-mips@linux-mips.org>; Wed, 26 Mar 2008 14:18:53 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2QEIrpK004281
	for linux-mips@linux-mips.org; Wed, 26 Mar 2008 14:18:53 GMT
Resent-From: ralf@linux-mips.org
Resent-Date: Wed, 26 Mar 2008 14:18:53 +0000
Resent-Message-ID: <20080326141853.GA4017@linux-mips.org>
Resent-To: linux-mips@linux-mips.org
Received: from oss.sgi.com ([192.48.170.157]:12504 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S1101006AbYCZMOS (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Mar 2008 13:14:18 +0100
Received: from p549F5321.dip.t-dialin.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m2QBVUpo016060
	for <linux-mips@linux-mips.org>; Wed, 26 Mar 2008 05:13:40 -0700
Received: from oss.sgi.com ([192.48.170.157]:50569 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S1101652AbYCYSwe (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 25 Mar 2008 19:52:34 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m2PIorOO014952
	for <linux-mips@linux-mips.org>; Tue, 25 Mar 2008 11:50:55 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2PIpOIY023108;
	Tue, 25 Mar 2008 18:51:26 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2PIpMu1023107;
	Tue, 25 Mar 2008 18:51:22 GMT
Date:	Tue, 25 Mar 2008 18:51:22 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] Alchemy: don't unmask timer IRQ early
Message-ID: <20080325185122.GA23095@linux-mips.org>
References: <200803242315.50423.sshtylyov@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200803242315.50423.sshtylyov@ru.mvista.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
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: 18491
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: 584
Lines: 17

On Mon, Mar 24, 2008 at 11:15:50PM +0300, Sergei Shtylyov wrote:

> Defer the unmasking of the count/compare interrupt (IRQ5) till the clockevent
> driver initialization:
> 
> - only enable the cascaded IRQs 0 thru 4 in arch_init_irq(); kill the ALLINTS
>   macro -- this change is blessed by AMD as I saw it in their own patch; :-)
> 
> - do not force IRQ5 enabled in plat_time_init() if PM is enabled and there's
>   no 32 KHz crystal.
> 
> Update the copyrights (taking into account my prior changes), also removing
> Pete Popov's old email...

Queued for 2.6.26.  Thanks,

  Ralf

From root@linux-mips.net Wed Mar 26 16:55:23 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Mar 2008 16:55:26 +0100 (CET)
Received: (root@lappi.linux-mips.net) by lappi.linux-mips.net
	id S1101541AbYCZMju (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 26 Mar 2008 13:39:50 +0100
Resent-From: root@lappi.linux-mips.net
Resent-Date: Wed, 26 Mar 2008 13:39:49 +0100
Resent-Message-ID: <20080326123949.GB2581@lappi.linux-mips.net>
Resent-To: linux-mips@linux-mips.org
Received: from oss.sgi.com ([192.48.170.157]:2776 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S1101183AbYCZMOO (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Mar 2008 13:14:14 +0100
Received: from p549F5321.dip.t-dialin.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m2QBVUpk016060
	for <linux-mips@linux-mips.org>; Wed, 26 Mar 2008 05:13:33 -0700
Received: from relay01.mx.bawue.net ([193.7.176.67]:6878 "EHLO
	relay01.mx.bawue.net") by lappi.linux-mips.net with ESMTP
	id S1101594AbYCYRNC (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 25 Mar 2008 18:13:02 +0100
Received: from lagash (intrt.mips-uk.com [194.74.144.130])
	(using TLSv1 with cipher AES256-SHA (256/256 bits))
	(No client certificate requested)
	by relay01.mx.bawue.net (Postfix) with ESMTP id A926448917;
	Tue, 25 Mar 2008 18:12:30 +0100 (CET)
Received: from ths by lagash with local (Exim 4.69)
	(envelope-from <ths@networkno.de>)
	id 1JeChJ-0005yJ-1f; Tue, 25 Mar 2008 17:12:29 +0000
Date:	Tue, 25 Mar 2008 17:12:29 +0000
From:	Thiemo Seufer <ths@networkno.de>
To:	Larry Stefani <lstefani@yahoo.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: SB1250 locking up in init on current 2.6.16 kernel
Message-ID: <20080325171228.GD15685@networkno.de>
References: <15031.81072.qm@web38802.mail.mud.yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <15031.81072.qm@web38802.mail.mud.yahoo.com>
User-Agent: Mutt/1.5.17+20080114 (2008-01-14)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <root@linux-mips.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: 18527
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: root@lappi.linux-mips.net
Precedence: bulk
X-list: linux-mips
Content-Length: 961
Lines: 32

Larry Stefani wrote:
> Hi,
> 
> I've been trying to upgrade from 2.6.16.18 to
> 2.6.16.60, but am seeing a hard lockup right before
> "INIT: version 2.78 booting" on my SB1250-based board.
> 
> I found a related discussion on the Debian mailing
> list:
> 
> http://groups.google.com/group/linux.debian.bugs.dist/browse_thread/thread/b7159ee25106c7f9
> 
> However, after applying Thiemo's patch to mark pages
> tainted by PIO IDE as dirty, the lockup still occurs.
> 
> I narrowed the file changes to
> 
>      arch/mips/mm/c-sb1.c
>      arch/mips/mm/cache.c
>      arch/mips/mm/init.c
>      include/asm-mips/cache-flush.h
>      include/asm-mips/page.h
> 
> between 2.6.16.27 and 2.6.16.29.  There was no
> 2.6.16.28 tarball posted on linux-mips.org, so I
> basically brought .27 to .29 until I found the
> offending files.

Please learn about git bisect (git-bisect start; git-bisect good;
git-bisect bad) and use it to isolate the offending commit.


Thiemo
From root@linux-mips.net Wed Mar 26 17:09:36 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Mar 2008 17:09:39 +0100 (CET)
Received: (root@lappi.linux-mips.net) by lappi.linux-mips.net
	id S1100670AbYCZMiY (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 26 Mar 2008 13:38:24 +0100
Resent-From: root@lappi.linux-mips.net
Resent-Date: Wed, 26 Mar 2008 13:38:23 +0100
Resent-Message-ID: <20080326123823.GA2581@lappi.linux-mips.net>
Resent-To: linux-mips@linux-mips.org
Received: from oss.sgi.com ([192.48.170.157]:64171 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S1096320AbYCZLhr (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Mar 2008 12:37:47 +0100
Received: from p549F5321.dip.t-dialin.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m2QBVUZi016060
	for <linux-mips@linux-mips.org>; Wed, 26 Mar 2008 04:37:07 -0700
Received: from web38815.mail.mud.yahoo.com ([209.191.125.106]:52659 "HELO
	web38815.mail.mud.yahoo.com") by lappi.linux-mips.net with SMTP
	id S1101128AbYCYNFi (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 25 Mar 2008 14:05:38 +0100
Received: (qmail 44851 invoked by uid 60001); 25 Mar 2008 13:05:35 -0000
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
  s=s1024; d=yahoo.com;
  h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID;
  b=xCBNhWpKinYwWrVvE1Uft9KGjTtZxt3g4fLPn/rjRmDA6K+sN1agoijgRQYs+RIgIIhruDSUXidESuHIwJJ8q05/w71YSGb0eQBTMPTuA0gXFkoooie/8tjkvSWhoLRoN5h3DU151KFKXteS111lV/m/mKh9Gz3fOpXMhQFNPIQ=;
X-YMail-OSG: n7Waq3QVM1l.9KDtAO5iZnkVuqvXgNAognoUnsO_4moP6ISOuUdkSnqDuQ3FVPWwTqPhmQrTxytPdaJySzD.AJtfVyUvj5fRjj_mMOBdPFB.ETj0Xmw-
Received: from [68.236.82.170] by web38815.mail.mud.yahoo.com via HTTP; Tue, 25 Mar 2008 06:05:35 PDT
Date:	Tue, 25 Mar 2008 06:05:35 -0700 (PDT)
From:	Larry Stefani <lstefani@yahoo.com>
Subject: Re: SB1250 locking up in init on current 2.6.16 kernel
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org
In-Reply-To: <20080324203311.GB15294@linux-mips.org>
MIME-Version: 1.0
Content-Type:	text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7BIT
Message-ID: <64859.43533.qm@web38815.mail.mud.yahoo.com>
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <root@linux-mips.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: 18546
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: root@lappi.linux-mips.net
Precedence: bulk
X-list: linux-mips
Content-Length: 2270
Lines: 70

Hello Ralf,

Thank you very much for the quick response.  I know
you must be terribly busy with the server move, so I
won't take up too much more of your time.

I did find an old (possibly related) discussion you
were involved in:

http://www.linux-mips.org/archives/linux-mips/2006-09/msg00194.html

I can't tell from the thread whether it was a problem
seen on 2.6.16.29, but that might have been tip at the
time.

> It's a bug which should be fixed but nevertheless I
> can highly recommend
> something like a SiliconImage SATA controller - the
> onboard PIO PATA
> controller is so slow.

I understand, but changing that is not an option for
me today.

> I've pushed the tag again so now there is a tarball.

Thanks.  I thought something was terribly wrong with
.28 for it to be skipped.  

> If you need to track something like this you're
> probably best with
> git bisect which should bring you right to the
> offending commit.

I probably should have used that approach instead of
diffing .27 and .29 and narrowing the file list by
hand.  As it was, there were changes to non-MIPS
platforms and devices I'm not using so those were easy
to apply to .27.  Also, there were many file changes
for MT SMP support, and *most* (but not all) of those
changes were wrapped with conditional compiles, so
those were also easy to apply.  I knew once I got to
these five files I was in some interesting code that
could point to the problems I'm seeing.

> Later kernels do run on bcm1480 which is close
> enough.

By "later kernels", do you mean 2.6.16.60 or different
kernel branches?

Perhaps, but I'm seeing identical failures in .29 and
.60, although that could be misleading.  I do see
significant SMP-related changes in c-sb1.c between .29
and .60, and I am running in SMP.  I wish there was an
easy way to know whether it's in the same code.

Anyway, in the interest of time I may revert to .27
which appears to work.  I don't need any of the MT SMP
related changes that followed, and perhaps I can live
without the enhancements between .27 and .60 for now.

Thanks,
Larry Stefani
lstefani@yahoo.com



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs
From rkota@broadcom.com Wed Mar 26 17:28:37 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Mar 2008 17:28:44 +0100 (CET)
Received: from oss.sgi.com ([192.48.170.157]:54696 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S1100635AbYCZNEj (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Mar 2008 14:04:39 +0100
Received: from p549F5321.dip.t-dialin.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m2QBVULO016060
	for <linux-mips@linux-mips.org>; Wed, 26 Mar 2008 06:03:58 -0700
Received: from mms2.broadcom.com ([216.31.210.18]:18962 "EHLO
	mms2.broadcom.com") by lappi.linux-mips.net with ESMTP
	id S1102827AbYCZFV0 convert rfc822-to-8bit (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Mar 2008 06:21:26 +0100
Received: from [10.10.64.154] by mms2.broadcom.com with ESMTP (Broadcom
 SMTP Relay (Email Firewall v6.3.2)); Tue, 25 Mar 2008 22:20:45 -0700
X-Server-Uuid: D3C04415-6FA8-4F2C-93C1-920E106A2031
Received: by mail-irva-10.broadcom.com (Postfix, from userid 47) id
 B72B12B1; Tue, 25 Mar 2008 22:20:45 -0700 (PDT)
Received: from mail-irva-8.broadcom.com (mail-irva-8 [10.10.64.221]) by
 mail-irva-10.broadcom.com (Postfix) with ESMTP id A39182B0 for
 <linux-mips@linux-mips.org>; Tue, 25 Mar 2008 22:20:45 -0700 (PDT)
Received: from mail-sj1-12.sj.broadcom.com (mail-sj1-12.sj.broadcom.com
 [10.16.128.215]) by mail-irva-8.broadcom.com (MOS 3.7.5a-GA) with ESMTP
 id GRH15356; Tue, 25 Mar 2008 22:20:44 -0700 (PDT)
Received: from NT-SJCA-0752.brcm.ad.broadcom.com (nt-sjca-0752
 [10.16.192.222]) by mail-sj1-12.sj.broadcom.com (Postfix) with ESMTP id
 CFACF20501 for <linux-mips@linux-mips.org>; Tue, 25 Mar 2008 22:20:44
 -0700 (PDT)
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Subject: MTD Partitions Permissions at Run Time.
Date:	Tue, 25 Mar 2008 22:20:43 -0700
Message-ID: <E06E3B7BBC07864CADE892DAF1EB0FBD0641257D@NT-SJCA-0752.brcm.ad.broadcom.com>
In-Reply-To: <47E7EBFF.6020406@ru.mvista.com>
Thread-Topic: MTD Partitions Permissions at Run Time.
Thread-Index: AciN2LlE4bF7ypqjS4Cg9fHtifqyCABJ9L3g
References: <47E559B6.9010001@ru.mvista.com>
 <47E7EBFF.6020406@ru.mvista.com>
From:	"Ramgopal Kota" <rkota@broadcom.com>
To:	linux-mips@linux-mips.org
X-WSS-ID: 6BF702A741K18759677-01-01
Content-Type: text/plain;
 charset=us-ascii
Content-Transfer-Encoding: 8BIT
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <rkota@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: 18567
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: rkota@broadcom.com
Precedence: bulk
X-list: linux-mips
Content-Length: 602
Lines: 18

Hi ,

Ours is a embedded product with pre-defined flash partitions say "Boot"
, "Kernel" , "Rootfs" & "ProductData".
The kernel which is in the box (linux 2.6.14)has Boot partition as "RO"
(Read Only). We have a requirement in the field that the boot code
should be upgraded also.
Is there any possibility of changing the partition permissions at
run-time? If so how ? 
Our solution was to create a Kernel image Boot as RW, upgrade the kernel
& reboot. Later change the Boot code.

But we are seeing if we can avoid such situation by remounting the MTD
partition with a RW permission.

Ramgopal Kota



From ralf@linux-mips.org Wed Mar 26 18:29:24 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Mar 2008 18:29:27 +0100 (CET)
Received: from oss.sgi.com ([192.48.170.157]:26063 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S1099597AbYCZOqy (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Mar 2008 15:46:54 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m2QEkF2i025629
	for <linux-mips@linux-mips.org>; Wed, 26 Mar 2008 07:46:15 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2QEkofU004562
	for <linux-mips@linux-mips.org>; Wed, 26 Mar 2008 14:46:50 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2QEkocR004561
	for linux-mips@linux-mips.org; Wed, 26 Mar 2008 14:46:50 GMT
Date:	Wed, 26 Mar 2008 14:46:50 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	linux-mips@linux-mips.org
Subject: [ADMIN] linux-mips list on air again.
Message-ID: <20080326144650.GA4488@linux-mips.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
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: 18628
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: 120
Lines: 4

Well, limping badly but hopefully enough to keep things going until the
reall server is setup at it's new home.

  Ralf

From ths@networkno.de Wed Mar 26 18:56:49 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Mar 2008 18:56:57 +0100 (CET)
Received: from oss.sgi.com ([192.48.170.157]:31376 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S1102444AbYCZP0K (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Mar 2008 16:26:10 +0100
Received: from p549F5321.dip.t-dialin.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m2QBVUTG016060
	for <linux-mips@linux-mips.org>; Wed, 26 Mar 2008 06:18:55 -0700
Received: from relay01.mx.bawue.net ([193.7.176.67]:45013 "EHLO
	relay01.mx.bawue.net") by lappi.linux-mips.net with ESMTP
	id S1101373AbYCYPhv (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 25 Mar 2008 16:37:51 +0100
Received: from lagash (intrt.mips-uk.com [194.74.144.130])
	(using TLSv1 with cipher AES256-SHA (256/256 bits))
	(No client certificate requested)
	by relay01.mx.bawue.net (Postfix) with ESMTP id 025F548917;
	Tue, 25 Mar 2008 16:37:49 +0100 (CET)
Received: from ths by lagash with local (Exim 4.69)
	(envelope-from <ths@networkno.de>)
	id 1JeBDf-0007Jj-GW; Tue, 25 Mar 2008 15:37:47 +0000
Date:	Tue, 25 Mar 2008 15:37:47 +0000
From:	Thiemo Seufer <ths@networkno.de>
To:	Larry Stefani <lstefani@yahoo.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: SB1250 locking up in init on current 2.6.16 kernel
Message-ID: <20080325153747.GB15685@networkno.de>
References: <15031.81072.qm@web38802.mail.mud.yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <15031.81072.qm@web38802.mail.mud.yahoo.com>
User-Agent: Mutt/1.5.17+20080114 (2008-01-14)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
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: 18642
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: 962
Lines: 33

Larry Stefani wrote:
> Hi,
> 
> I've been trying to upgrade from 2.6.16.18 to
> 2.6.16.60, but am seeing a hard lockup right before
> "INIT: version 2.78 booting" on my SB1250-based board.
> 
> I found a related discussion on the Debian mailing
> list:
> 
> http://groups.google.com/group/linux.debian.bugs.dist/browse_thread/thread/b7159ee25106c7f9
> 
> However, after applying Thiemo's patch to mark pages
> tainted by PIO IDE as dirty, the lockup still occurs.
> 
> I narrowed the file changes to
> 
>      arch/mips/mm/c-sb1.c
>      arch/mips/mm/cache.c
>      arch/mips/mm/init.c
>      include/asm-mips/cache-flush.h
>      include/asm-mips/page.h
> 
> between 2.6.16.27 and 2.6.16.29.  There was no
> 2.6.16.28 tarball posted on linux-mips.org, so I
> basically brought .27 to .29 until I found the
> offending files.

Please learn about git bisect (git-bisect start; git-bisect good;
git-bisect bad) and use it to isolate the offending commit.


Thiemo

From tsbogend@alpha.franken.de Wed Mar 26 19:13:53 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Mar 2008 19:14:08 +0100 (CET)
Received: from elvis.franken.de ([193.175.24.41]:34193 "EHLO elvis.franken.de")
	by lappi.linux-mips.net with ESMTP id S1102780AbYCZPq1 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Mar 2008 16:46:27 +0100
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JeXmD-0000Fz-00; Wed, 26 Mar 2008 16:42:57 +0100
Received: by solo.franken.de (Postfix, from userid 1000)
	id D6760C2B7D; Wed, 26 Mar 2008 16:42:54 +0100 (CET)
From:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: [PATCH] Add missing 4KEC TLB refill handler
To:	linux-mips@linux-mips.org
cc:	ralf@linux-mips.org
Message-Id: <20080326154254.D6760C2B7D@solo.franken.de>
Date:	Wed, 26 Mar 2008 16:42:54 +0100 (CET)
Return-Path: <tsbogend@alpha.franken.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: 18650
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: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips
Content-Length: 593
Lines: 21

Early 4KEc were MIPS32r1 and therefore need some love to get a TLB 
refill handler.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---

 arch/mips/mm/tlbex.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 3a93d4c..382738c 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -307,6 +307,7 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
 	case CPU_R12000:
 	case CPU_R14000:
 	case CPU_4KC:
+	case CPU_4KEC:
 	case CPU_SB1:
 	case CPU_SB1A:
 	case CPU_4KSC:

From sshtylyov@ru.mvista.com Wed Mar 26 19:19:42 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Mar 2008 19:19:53 +0100 (CET)
Received: from h155.mvista.com ([63.81.120.155]:33265 "EHLO imap.sh.mvista.com")
	by lappi.linux-mips.net with ESMTP id S1102900AbYCZQbC (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Mar 2008 17:31:02 +0100
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id D278F3EC9; Wed, 26 Mar 2008 09:30:29 -0700 (PDT)
Message-ID: <47EA7A7B.8020602@ru.mvista.com>
Date:	Wed, 26 Mar 2008 19:31:55 +0300
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
X-Accept-Language: ru, en-us, en-gb
MIME-Version: 1.0
To:	Nico Coesel <ncoesel@DEALogic.nl>
Cc:	linux-mips@linux-mips.org
Subject: Re: FW: Alchemy power managment code.
References: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF804@dealogicserver.DEALogic.nl>
In-Reply-To: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF804@dealogicserver.DEALogic.nl>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@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: 18653
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 847
Lines: 23

Hello all.

Nico Coesel wrote:

> Ralf,
> Funny you ask because I tried this yesterday on a AU1100 system with the
> 2.6.24 kernel (from kernel.org). I'm afraid I must say the kernel
> crashes when I enable power management. The reason I want to use power
> management is because I need to send the CPU to sleep when the system
> shuts down. I hacked power.c and reset.c a bit so au_sleep() is called
> when the system is shut down. Perhaps someone can confirm the
> powermanagement can be made to work with some fixes (it didn't work with
> 2.6.21-rc4 either).

    BTW, for anybody interested in Alchemy PM code, here's the interesting
link: [ftp|http]://ftp.enneenne.com/pub/misc/au1100-patches/linux/.
    It contains  a lot of unmerged PM patches by Rodolfo Giometti (and not
only that) from around 2.6.17 time.

> Nico Coesel 

WBR, Sergei


From sshtylyov@ru.mvista.com Wed Mar 26 21:26:11 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Mar 2008 21:26:15 +0100 (CET)
Received: from rtsoft3.corbina.net ([85.21.88.6]:14601 "EHLO
	buildserver.ru.mvista.com") by lappi.linux-mips.net with ESMTP
	id S1102145AbYCZU0L (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 26 Mar 2008 21:26:11 +0100
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id 3D8658817; Thu, 27 Mar 2008 01:25:59 +0400 (SAMT)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	ralf@linux-mips.org
Subject: [PATCH] Alchemy: work around clock misdetection on eraly Au1000
Date:	Wed, 26 Mar 2008 23:27:03 +0300
User-Agent: KMail/1.5
Cc:	linux-mips@linux-mips.org
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200803262327.03262.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@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: 18657
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 6355
Lines: 159

Work around the CPU clock miscalculation on Au1000DA/HA/HB due the sys_cpupll
register being write-only, i.e. actually do what the comment before cal_r4off()
function advertised for years but code failed at.  This is achieved by simply
giving user a chance to define the clock explicitly in the board config. via
CONFIG_SOC_AU1X00_FREQUENCY option, defaulting to 396 MHz if the option is not
given...

The patch is based on the AMD's own unpublished patch, the issue seems to be an
undocumented errata (or feature :-)...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

---
That's what comes of a dozen line change when you do it properly. ;-)

 arch/mips/au1000/common/cputable.c    |   36 +++++++++++++++++-----------------
 arch/mips/au1000/common/setup.c       |   18 +++++++++++------
 arch/mips/au1000/common/time.c        |   24 +++++++++++++---------
 include/asm-mips/mach-au1x00/au1000.h |    1 
 4 files changed, 45 insertions(+), 34 deletions(-)

Index: linux-2.6/arch/mips/au1000/common/cputable.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/cputable.c
+++ linux-2.6/arch/mips/au1000/common/cputable.c
@@ -22,24 +22,24 @@ struct cpu_spec* cur_cpu_spec[NR_CPUS];
 /* With some thought, we can probably use the mask to reduce the
  * size of the table.
  */
-struct cpu_spec	cpu_specs[] = {
-    { 0xffffffff, 0x00030100, "Au1000 DA", 1, 0 },
-    { 0xffffffff, 0x00030201, "Au1000 HA", 1, 0 },
-    { 0xffffffff, 0x00030202, "Au1000 HB", 1, 0 },
-    { 0xffffffff, 0x00030203, "Au1000 HC", 1, 1 },
-    { 0xffffffff, 0x00030204, "Au1000 HD", 1, 1 },
-    { 0xffffffff, 0x01030200, "Au1500 AB", 1, 1 },
-    { 0xffffffff, 0x01030201, "Au1500 AC", 0, 1 },
-    { 0xffffffff, 0x01030202, "Au1500 AD", 0, 1 },
-    { 0xffffffff, 0x02030200, "Au1100 AB", 1, 1 },
-    { 0xffffffff, 0x02030201, "Au1100 BA", 1, 1 },
-    { 0xffffffff, 0x02030202, "Au1100 BC", 1, 1 },
-    { 0xffffffff, 0x02030203, "Au1100 BD", 0, 1 },
-    { 0xffffffff, 0x02030204, "Au1100 BE", 0, 1 },
-    { 0xffffffff, 0x03030200, "Au1550 AA", 0, 1 },
-    { 0xffffffff, 0x04030200, "Au1200 AB", 0, 0 },
-    { 0xffffffff, 0x04030201, "Au1200 AC", 1, 0 },
-    { 0x00000000, 0x00000000, "Unknown Au1xxx", 1, 0 },
+struct cpu_spec cpu_specs[] = {
+	{ 0xffffffff, 0x00030100, "Au1000 DA", 1, 0, 1 },
+	{ 0xffffffff, 0x00030201, "Au1000 HA", 1, 0, 1 },
+	{ 0xffffffff, 0x00030202, "Au1000 HB", 1, 0, 1 },
+	{ 0xffffffff, 0x00030203, "Au1000 HC", 1, 1, 0 },
+	{ 0xffffffff, 0x00030204, "Au1000 HD", 1, 1, 0 },
+	{ 0xffffffff, 0x01030200, "Au1500 AB", 1, 1, 0 },
+	{ 0xffffffff, 0x01030201, "Au1500 AC", 0, 1, 0 },
+	{ 0xffffffff, 0x01030202, "Au1500 AD", 0, 1, 0 },
+	{ 0xffffffff, 0x02030200, "Au1100 AB", 1, 1, 0 },
+	{ 0xffffffff, 0x02030201, "Au1100 BA", 1, 1, 0 },
+	{ 0xffffffff, 0x02030202, "Au1100 BC", 1, 1, 0 },
+	{ 0xffffffff, 0x02030203, "Au1100 BD", 0, 1, 0 },
+	{ 0xffffffff, 0x02030204, "Au1100 BE", 0, 1, 0 },
+	{ 0xffffffff, 0x03030200, "Au1550 AA", 0, 1, 0 },
+	{ 0xffffffff, 0x04030200, "Au1200 AB", 0, 0, 0 },
+	{ 0xffffffff, 0x04030201, "Au1200 AC", 1, 0, 0 },
+	{ 0x00000000, 0x00000000, "Unknown Au1xxx", 1, 0, 0 }
 };
 
 void
Index: linux-2.6/arch/mips/au1000/common/setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/setup.c
+++ linux-2.6/arch/mips/au1000/common/setup.c
@@ -1,7 +1,6 @@
 /*
- * Copyright 2000 MontaVista Software Inc.
- * Author: MontaVista Software, Inc.
- *         	ppopov@mvista.com or source@mvista.com
+ * Copyright (C) 2000, 2007-2008 MontaVista Software Inc.
+ * Author: MontaVista Software, Inc. <source@mvista.com>
  *
  * Updates to 2.6, Pete Popov, Embedded Alley Solutions, Inc.
  *
@@ -57,7 +56,7 @@ void __init plat_mem_setup(void)
 {
 	struct	cpu_spec *sp;
 	char *argptr;
-	unsigned long prid, cpupll, bclk = 1;
+	unsigned long prid, cpufreq, bclk = 1;
 
 	set_cpuspec();
 	sp = cur_cpu_spec[0];
@@ -65,8 +64,15 @@ void __init plat_mem_setup(void)
 	board_setup();  /* board specific setup */
 
 	prid = read_c0_prid();
-	cpupll = (au_readl(0xB1900060) & 0x3F) * 12;
-	printk("(PRId %08lx) @ %ldMHZ\n", prid, cpupll);
+	if (cur_cpu_spec[0]->cpu_pll_wo)
+#ifdef CONFIG_SOC_AU1X00_FREQUENCY
+		cpufreq = CONFIG_SOC_AU1X00_FREQUENCY / 1000000;
+#else
+		cpufreq = 396;
+#endif
+	else
+		cpufreq = (au_readl(SYS_CPUPLL) & 0x3F) * 12;
+	printk(KERN_INFO "(PRID %08lx) @ %ld MHz\n", prid, cpufreq);
 
 	bclk = sp->cpu_bclk;
 	if (bclk)
Index: linux-2.6/arch/mips/au1000/common/time.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/time.c
+++ linux-2.6/arch/mips/au1000/common/time.c
@@ -209,18 +209,22 @@ unsigned long cal_r4koff(void)
 		while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S);
 		au_writel(0, SYS_TOYWRITE);
 		while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S);
+	} else
+		no_au1xxx_32khz = 1;
 
-		cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) *
-			AU1000_SRC_CLK;
-	}
-	else {
-		/* The 32KHz oscillator isn't running, so assume there
-		 * isn't one and grab the processor speed from the PLL.
-		 * NOTE: some old silicon doesn't allow reading the PLL.
-		 */
+	/*
+	 * On early Au1000, sys_cpupll was write-only. Since these
+	 * silicon versions of Au1000 are not sold by AMD, we don't bend
+	 * over backwards trying to determine the frequency.
+	 */
+	if (cur_cpu_spec[0]->cpu_pll_wo)
+#ifdef CONFIG_SOC_AU1X00_FREQUENCY
+		cpu_speed = CONFIG_SOC_AU1X00_FREQUENCY;
+#else
+		cpu_speed = 396000000;
+#endif
+	else
 		cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) * AU1000_SRC_CLK;
-		no_au1xxx_32khz = 1;
-	}
 	mips_hpt_frequency = cpu_speed;
 	// Equation: Baudrate = CPU / (SD * 2 * CLKDIV * 16)
 	set_au1x00_uart_baud_base(cpu_speed / (2 * ((int)(au_readl(SYS_POWERCTRL)&0x03) + 2) * 16));
Index: linux-2.6/include/asm-mips/mach-au1x00/au1000.h
===================================================================
--- linux-2.6.orig/include/asm-mips/mach-au1x00/au1000.h
+++ linux-2.6/include/asm-mips/mach-au1x00/au1000.h
@@ -1778,6 +1778,7 @@ struct cpu_spec {
 	char		*cpu_name;
 	unsigned char	cpu_od;		/* Set Config[OD] */
 	unsigned char	cpu_bclk;	/* Enable BCLK switching */
+	unsigned char	cpu_pll_wo;	/* sys_cpupll reg. write-only */
 };
 
 extern struct cpu_spec		cpu_specs[];


From lstefani@yahoo.com Wed Mar 26 21:53:51 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Mar 2008 21:53:59 +0100 (CET)
Received: from web38810.mail.mud.yahoo.com ([209.191.125.101]:882 "HELO
	web38810.mail.mud.yahoo.com") by lappi.linux-mips.net with SMTP
	id S1102490AbYCZUxv (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 26 Mar 2008 21:53:51 +0100
Received: (qmail 30632 invoked by uid 60001); 26 Mar 2008 20:52:43 -0000
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
  s=s1024; d=yahoo.com;
  h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID;
  b=SIy4aSxtdi6BpAQIL0pAu6d3GtMukhoOeZ7ZKI5TSdhwnP2KcWKnjc39hwY1l7YVZgTnwwU0dIAltnZhu6HEdijflA7A02Y328WXSjHNTbypYUGEdZ0OjInFtwDHnd9ZcCUYL3Lv20efyIT53JULZthC/4C0O/7gR1btQkQhPkk=;
X-YMail-OSG: MndwsfYVM1kps35.Fk2AfEasnYAwkn0B9imQNf7cCLgFVKzh3riOPjDvKVBMOvG_x4eYTClpI33DNImliiiM6EcKbqANyEipIvNbHFJ4JZAnOehnt44-
Received: from [68.236.82.170] by web38810.mail.mud.yahoo.com via HTTP; Wed, 26 Mar 2008 13:52:42 PDT
Date:	Wed, 26 Mar 2008 13:52:42 -0700 (PDT)
From:	Larry Stefani <lstefani@yahoo.com>
Subject: Re: SB1250 locking up in init on current 2.6.16 kernel
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org, anemo@mba.ocn.ne.jp, ths@networkno.de,
	flo@rfc822.org
In-Reply-To: <20080324203311.GB15294@linux-mips.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Message-ID: <926775.30590.qm@web38810.mail.mud.yahoo.com>
Return-Path: <lstefani@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: 18658
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: lstefani@yahoo.com
Precedence: bulk
X-list: linux-mips
Content-Length: 4860
Lines: 157

Hi Ralf,

I used git bisect and narrowed the lockup to the
"[MIPS] Retire flush_icache_page from mm use." patch
(see git results below).  This is consistent with my
earlier testing and what Thiemo reported March 3 on
the linux.debian.kernel list.  I tried his patch (mark
pages tainted by PIO IDE as dirty) on 2.6.16.60, but
it didn't prevent the lockup.

Regards,
Larry Stefani
lstefani@yahoo.com

======================================================
/testkernels/linux> git bisect bad
Bisecting: 0 revisions left to test after this
[3a57f2ad7436d27dfa90717921b921fc3a168504] [MIPS]
Retire flush_icache_page from mm use.
/testkernels/linux> git bisect bad
3a57f2ad7436d27dfa90717921b921fc3a168504 is first bad
commit
commit 3a57f2ad7436d27dfa90717921b921fc3a168504
Author: Ralf Baechle <ralf@linux-mips.org>
Date:   Sat Aug 12 16:40:08 2006 +0100

    [MIPS] Retire flush_icache_page from mm use.

    On the 34K the redundant cache operations were
causing excessive stalls
    resulting in realtime code running on the second
VPE missing its deadline.
    For all other platforms this patch is just a
significant performance
    improvment as illustrated by below benchmark
numbers.

    Processor, Processes - times in microseconds -
smaller is better
   
------------------------------------------------------------------------------
    Host                 OS  Mhz null null      open
slct sig  sig  fork exec sh
                                 call  I/O stat clos
TCP  inst hndl proc proc proc
    --------- ------------- ---- ---- ---- ---- ----
---- ---- ---- ---- ---- ----
    25Kf      2.6.18-rc4     533 0.49 1.16 7.57 33.4
30.5 1.34 12.4 5497 17.K 54.K
    25Kf      2.6.18-rc4-p   533 0.49 1.16 6.68 23.0
30.7 1.36 8.55 5030 16.K 48.K
    4Kc       2.6.18-rc4      80 4.21 15.0 131. 289.
261. 16.5 258. 18.K 70.K 227K
    4Kc       2.6.18-rc4-p    80 4.34 13.1 128. 285.
262. 18.2 258. 12.K 52.K 176K
    34Kc      2.6.18-rc4      40 5.01 14.0 61.6 90.0
477. 17.9 94.7 29.K 108K 342K
    34Kc      2.6.18-rc4-p    40 4.98 13.9 61.2 89.7
475. 17.6 93.7 8758 44.K 158K
    BCM1480   2.6.18-rc4     700 0.28 0.60 3.68 5.92
16.0 0.78 5.08 931. 3163 15.K
    BCM1480   2.6.18-rc4-p   700 0.28 0.61 3.65 5.85
16.0 0.79 5.20 395. 1464 8385
    TX49-16K  2.6.18-rc3     197 0.73 2.41 19.0 37.8
82.9 2.94 17.5 4438 14.K 56.K
    TX49-16K  2.6.18-rc3-p   197 0.73 2.40 19.9 36.3
82.9 2.94 23.4 2577 9103 38.K
    TX49-32K  2.6.18-rc3     396 0.36 1.19 6.80 11.8
41.0 1.46 8.17 2738 8465 32.K
    TX49-32K  2.6.18-rc3-p   396 0.36 1.19 6.82 10.2
41.0 1.46 8.18 1330 4638 18.K

    Original patch by me with enhancements by Atsushi
Nemoto.

    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
    Signed-off-by: Atsushi Nemoto
<anemo@mba.ocn.ne.jp>
    (cherry picked from
4bbd62a93a1ab4b7d8a5b402b0c78ac265b35661 commit)

:040000 040000
6b4aeaca51e1f8974394f5c85c36cfcbf40984c9
2af41ed07f6c83962f9a4871812adb6f7c0dbee7 M      arch
:040000 040000
c2fb4be66f03aed2a1746d30f0e17922086eefdd
ab8cb20f7da9b97e72742946adfb5ab927dc777a M     
include
=====================================================



--- Ralf Baechle <ralf@linux-mips.org> wrote:

> On Mon, Mar 24, 2008 at 07:00:15AM -0700, Larry
> Stefani wrote:
> 
> > I've been trying to upgrade from 2.6.16.18 to
> > 2.6.16.60, but am seeing a hard lockup right
> before
> > "INIT: version 2.78 booting" on my SB1250-based
> board.
> > 
> > I found a related discussion on the Debian mailing
> > list:
> > 
> >
>
http://groups.google.com/group/linux.debian.bugs.dist/browse_thread/thread/b7159ee25106c7f9
> > 
> > However, after applying Thiemo's patch to mark
> pages
> > tainted by PIO IDE as dirty, the lockup still
> occurs.
> 
> It's a bug which should be fixed but nevertheless I
> can highly recommend
> something like a SiliconImage SATA controller - the
> onboard PIO PATA
> controller is so slow.
> 
> > I narrowed the file changes to
> > 
> >      arch/mips/mm/c-sb1.c
> >      arch/mips/mm/cache.c
> >      arch/mips/mm/init.c
> >      include/asm-mips/cache-flush.h
> >      include/asm-mips/page.h
> > 
> > between 2.6.16.27 and 2.6.16.29.  There was no
> > 2.6.16.28 tarball posted on linux-mips.org, so I
> > basically brought .27 to .29 until I found the
> > offending files.
> 
> I've pushed the tag again so now there is a tarball.
> 
> If you need to track something like this you're
> probably best with
> git bisect which should bring you right to the
> offending commit.
> 
> > Is anyone running a 2.6.16 kernel (after
> 2.6.16.27) on
> > a SB1250-based board?
> 
> Later kernels do run on bcm1480 which is close
> enough.
> 
>   Ralf
> 




      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

From michael@cubic.org Wed Mar 26 21:56:25 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Mar 2008 21:56:29 +0100 (CET)
Received: from roasted.cubic.org ([193.108.181.130]:3041 "EHLO
	roasted.cubic.org") by lappi.linux-mips.net with ESMTP
	id S1102490AbYCZU4Z (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 26 Mar 2008 21:56:25 +0100
Received: from localhost ([127.0.0.1] helo=mail.cubic.org)
	by roasted.cubic.org with esmtp (Exim 3.36 #1)
	id 1JeccW-0007Pd-00
	for linux-mips@linux-mips.org; Wed, 26 Mar 2008 21:53:16 +0100
Received: from 85.177.213.130
        (SquirrelMail authenticated user michael)
        by mail.cubic.org with HTTP;
        Wed, 26 Mar 2008 21:53:16 +0100 (CET)
Message-ID: <48312.85.177.213.130.1206564796.squirrel@mail.cubic.org>
Date:	Wed, 26 Mar 2008 21:53:16 +0100 (CET)
Subject: Re: MTD Partitions Permissions at Run Time.
From:	michael@cubic.org
To:	linux-mips@linux-mips.org
User-Agent: SquirrelMail/1.4.8
MIME-Version: 1.0
Content-Type: text/plain;charset=iso-8859-15
Content-Transfer-Encoding: 8bit
X-Priority: 3 (Normal)
Importance: Normal
Return-Path: <michael@cubic.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: 18659
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: michael@cubic.org
Precedence: bulk
X-list: linux-mips
Content-Length: 1301
Lines: 30

Hi.

> Ours is a embedded product with pre-defined flash partitions say "Boot"
> , "Kernel" , "Rootfs" & "ProductData".
> The kernel which is in the box (linux 2.6.14)has Boot partition as "RO"
> (Read Only). We have a requirement in the field that the boot code
> should be upgraded also.
> Is there any possibility of changing the partition permissions at
> run-time? If so how ?
> Our solution was to create a Kernel image Boot as RW, upgrade the kernel
> & reboot. Later change the Boot code.

It is. For the MeshCube, for each mtd partition we have added a proc entry
called /proc/sys/mtd/<mtdnum>/rw, with a value of 0 meanung read only and a
value of 1 meaning read-write. We used it to be able to disable the write
protection of the bootloader partition before an update of the bootloader.

I have attached the patch as an indication, of how it could be done. This patch
will not work with a 2.6 kernel anymore. It has been for the 2.4.27 kernel, that
has been used for the MeshCube.

It must be adopted to the 2.6 kernel and the /proc/sys stuff could be done in a
better way than we did it using the sysctl support.
You may take a look at some drivers like drivers/parport/procfs.c how it is done
for the parallel port.
The function register_sysctl_table is the key to it.

Regards,
Michael


From esiotrot@gmail.com Thu Mar 27 11:31:36 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Mar 2008 11:31:47 +0100 (CET)
Received: from el-out-1112.google.com ([209.85.162.180]:60954 "EHLO
	el-out-1112.google.com") by lappi.linux-mips.net with ESMTP
	id S263459AbYC0Kbg (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 27 Mar 2008 11:31:36 +0100
Received: by el-out-1112.google.com with SMTP id z25so2318160ele.15
        for <linux-mips@linux-mips.org>; Thu, 27 Mar 2008 03:30:59 -0700 (PDT)
DKIM-Signature:	v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=beta;
        h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references;
        bh=TMbCzJIpX/UprdvRjiQ6+2IRdObVqb25W0AiXbHQzzU=;
        b=A5Ml2pY7Dnvp4sWCS+OAnFcVG5/uiXhjAa5nD296D2G9pEyulHx9MGypqnE8X7ScsDhGn+6ad2gsJGIQK/QrYq8LLWkdtuoZ+SVlf5VaLAnBi7jLzViZ8Oy8Z4lhQRU0IUiYI4Mgbye9UHIr+7JHpH5V5kdPLuXeEpWX4bhJLcI=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=beta;
        h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references;
        b=Byi3zasHC5QqjKJjMXuZEamenM8JPOzdh33FVTBxbS8n/vLoKKELjDGZoLoiNb3i4gOT7ueRgDCbD/b6lCO+l6tsu5cP+NQ4XaN2o2Fz594dC+cfEMEvGUliUZbuRod8H+77pAPGT2bwUe/vWXSM8DMhQgklUhgZOQBAPnloUPg=
Received: by 10.150.145.20 with SMTP id s20mr701970ybd.5.1206613859638;
        Thu, 27 Mar 2008 03:30:59 -0700 (PDT)
Received: by 10.150.138.4 with HTTP; Thu, 27 Mar 2008 03:30:59 -0700 (PDT)
Message-ID: <5a8aa6680803270330o1606b7e7u7d89c653828e61bd@mail.gmail.com>
Date:	Thu, 27 Mar 2008 12:30:59 +0200
From:	"Michael Wood" <esiotrot@gmail.com>
To:	"Ramgopal Kota" <rkota@broadcom.com>
Subject: Re: MTD Partitions Permissions at Run Time.
Cc:	linux-mips@linux-mips.org
In-Reply-To: <E06E3B7BBC07864CADE892DAF1EB0FBD0641257D@NT-SJCA-0752.brcm.ad.broadcom.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <47E559B6.9010001@ru.mvista.com> <47E7EBFF.6020406@ru.mvista.com>
	 <E06E3B7BBC07864CADE892DAF1EB0FBD0641257D@NT-SJCA-0752.brcm.ad.broadcom.com>
Return-Path: <esiotrot@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: 18666
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: esiotrot@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 536
Lines: 15

On Wed, Mar 26, 2008 at 7:20 AM, Ramgopal Kota <rkota@broadcom.com> wrote:
> Hi ,
>
>  Ours is a embedded product with pre-defined flash partitions say "Boot"
>  , "Kernel" , "Rootfs" & "ProductData".
>  The kernel which is in the box (linux 2.6.14)has Boot partition as "RO"
>  (Read Only). We have a requirement in the field that the boot code
>  should be upgraded also.
>  Is there any possibility of changing the partition permissions at
>  run-time? If so how ?

Does "mtd unlock" not work?

-- 
Michael Wood <esiotrot@gmail.com>

From ralf@linux-mips.org Thu Mar 27 12:11:25 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Mar 2008 12:11:29 +0100 (CET)
Received: from oss.sgi.com ([192.48.170.157]:57817 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S263499AbYC0LLZ (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 27 Mar 2008 12:11:25 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m2RB9kQb016279
	for <linux-mips@linux-mips.org>; Thu, 27 Mar 2008 04:09:47 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2RBAKKo017329;
	Thu, 27 Mar 2008 11:10:20 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2RBAJs7017328;
	Thu, 27 Mar 2008 11:10:19 GMT
Date:	Thu, 27 Mar 2008 11:10:19 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] Add missing 4KEC TLB refill handler
Message-ID: <20080327111019.GA16498@linux-mips.org>
References: <20080326154254.D6760C2B7D@solo.franken.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080326154254.D6760C2B7D@solo.franken.de>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
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: 18667
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: 188
Lines: 8

On Wed, Mar 26, 2008 at 04:42:54PM +0100, Thomas Bogendoerfer wrote:

> Early 4KEc were MIPS32r1 and therefore need some love to get a TLB 
> refill handler.

Good catch.  Thanks!

  Ralf

From sshtylyov@ru.mvista.com Thu Mar 27 14:08:39 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Mar 2008 14:08:42 +0100 (CET)
Received: from rtsoft3.corbina.net ([85.21.88.6]:26887 "EHLO
	buildserver.ru.mvista.com") by lappi.linux-mips.net with ESMTP
	id S523983AbYC0NIi (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 27 Mar 2008 14:08:38 +0100
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id 5FB788810; Thu, 27 Mar 2008 18:08:27 +0400 (SAMT)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	ralf@linux-mips.org
Subject: [PATCH] Alchemy: work around clock misdetection on early Au1000 (take 2)
Date:	Thu, 27 Mar 2008 16:09:31 +0300
User-Agent: KMail/1.5
Cc:	linux-mips@linux-mips.org
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <200803271609.31772.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@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: 18669
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 6325
Lines: 156

Work around the CPU clock miscalculation on Au1000DA/HA/HB due the sys_cpupll
register being write-only, i.e. actually do what the comment before cal_r4off()
function advertised for years but the code failed at.  This is achieved by just
giving user a chance to define the clock explicitly  in the board config. via
CONFIG_SOC_AU1000_FREQUENCY option, defaulting to 396 MHz if the option is not
given...

The patch is based on the AMD's big unpublished patch, the issue seems to be an
undocumented errata (or feature :-)...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

---
That's what happens to a dozen line (and incorrect) change when you do it
properly. ;-)

This should theoretically apply to all stable branches, but as AMD claimed that
the guilty chips were not sold, it's up to the maintainer.

In this revision I decided to revert to CONFIG_SOC_AU1000_FREQUENCY option name
and defer the copyright update till the big cleanup patch that's coming...

 arch/mips/au1000/common/cputable.c    |   36 +++++++++++++++++-----------------
 arch/mips/au1000/common/setup.c       |   13 +++++++++---
 arch/mips/au1000/common/time.c        |   24 +++++++++++++---------
 include/asm-mips/mach-au1x00/au1000.h |    1 
 4 files changed, 43 insertions(+), 31 deletions(-)

Index: linux-2.6/arch/mips/au1000/common/cputable.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/cputable.c
+++ linux-2.6/arch/mips/au1000/common/cputable.c
@@ -22,24 +22,24 @@ struct cpu_spec* cur_cpu_spec[NR_CPUS];
 /* With some thought, we can probably use the mask to reduce the
  * size of the table.
  */
-struct cpu_spec	cpu_specs[] = {
-    { 0xffffffff, 0x00030100, "Au1000 DA", 1, 0 },
-    { 0xffffffff, 0x00030201, "Au1000 HA", 1, 0 },
-    { 0xffffffff, 0x00030202, "Au1000 HB", 1, 0 },
-    { 0xffffffff, 0x00030203, "Au1000 HC", 1, 1 },
-    { 0xffffffff, 0x00030204, "Au1000 HD", 1, 1 },
-    { 0xffffffff, 0x01030200, "Au1500 AB", 1, 1 },
-    { 0xffffffff, 0x01030201, "Au1500 AC", 0, 1 },
-    { 0xffffffff, 0x01030202, "Au1500 AD", 0, 1 },
-    { 0xffffffff, 0x02030200, "Au1100 AB", 1, 1 },
-    { 0xffffffff, 0x02030201, "Au1100 BA", 1, 1 },
-    { 0xffffffff, 0x02030202, "Au1100 BC", 1, 1 },
-    { 0xffffffff, 0x02030203, "Au1100 BD", 0, 1 },
-    { 0xffffffff, 0x02030204, "Au1100 BE", 0, 1 },
-    { 0xffffffff, 0x03030200, "Au1550 AA", 0, 1 },
-    { 0xffffffff, 0x04030200, "Au1200 AB", 0, 0 },
-    { 0xffffffff, 0x04030201, "Au1200 AC", 1, 0 },
-    { 0x00000000, 0x00000000, "Unknown Au1xxx", 1, 0 },
+struct cpu_spec cpu_specs[] = {
+	{ 0xffffffff, 0x00030100, "Au1000 DA", 1, 0, 1 },
+	{ 0xffffffff, 0x00030201, "Au1000 HA", 1, 0, 1 },
+	{ 0xffffffff, 0x00030202, "Au1000 HB", 1, 0, 1 },
+	{ 0xffffffff, 0x00030203, "Au1000 HC", 1, 1, 0 },
+	{ 0xffffffff, 0x00030204, "Au1000 HD", 1, 1, 0 },
+	{ 0xffffffff, 0x01030200, "Au1500 AB", 1, 1, 0 },
+	{ 0xffffffff, 0x01030201, "Au1500 AC", 0, 1, 0 },
+	{ 0xffffffff, 0x01030202, "Au1500 AD", 0, 1, 0 },
+	{ 0xffffffff, 0x02030200, "Au1100 AB", 1, 1, 0 },
+	{ 0xffffffff, 0x02030201, "Au1100 BA", 1, 1, 0 },
+	{ 0xffffffff, 0x02030202, "Au1100 BC", 1, 1, 0 },
+	{ 0xffffffff, 0x02030203, "Au1100 BD", 0, 1, 0 },
+	{ 0xffffffff, 0x02030204, "Au1100 BE", 0, 1, 0 },
+	{ 0xffffffff, 0x03030200, "Au1550 AA", 0, 1, 0 },
+	{ 0xffffffff, 0x04030200, "Au1200 AB", 0, 0, 0 },
+	{ 0xffffffff, 0x04030201, "Au1200 AC", 1, 0, 0 },
+	{ 0x00000000, 0x00000000, "Unknown Au1xxx", 1, 0, 0 }
 };
 
 void
Index: linux-2.6/arch/mips/au1000/common/setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/setup.c
+++ linux-2.6/arch/mips/au1000/common/setup.c
@@ -57,7 +57,7 @@ void __init plat_mem_setup(void)
 {
 	struct	cpu_spec *sp;
 	char *argptr;
-	unsigned long prid, cpupll, bclk = 1;
+	unsigned long prid, cpufreq, bclk = 1;
 
 	set_cpuspec();
 	sp = cur_cpu_spec[0];
@@ -65,8 +65,15 @@ void __init plat_mem_setup(void)
 	board_setup();  /* board specific setup */
 
 	prid = read_c0_prid();
-	cpupll = (au_readl(0xB1900060) & 0x3F) * 12;
-	printk("(PRId %08lx) @ %ldMHZ\n", prid, cpupll);
+	if (cur_cpu_spec[0]->cpu_pll_wo)
+#ifdef CONFIG_SOC_AU1000_FREQUENCY
+		cpufreq = CONFIG_SOC_AU1000_FREQUENCY / 1000000;
+#else
+		cpufreq = 396;
+#endif
+	else
+		cpufreq = (au_readl(SYS_CPUPLL) & 0x3F) * 12;
+	printk(KERN_INFO "(PRID %08lx) @ %ld MHz\n", prid, cpufreq);
 
 	bclk = sp->cpu_bclk;
 	if (bclk)
Index: linux-2.6/arch/mips/au1000/common/time.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/time.c
+++ linux-2.6/arch/mips/au1000/common/time.c
@@ -209,18 +209,22 @@ unsigned long cal_r4koff(void)
 		while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S);
 		au_writel(0, SYS_TOYWRITE);
 		while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S);
+	} else
+		no_au1xxx_32khz = 1;
 
-		cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) *
-			AU1000_SRC_CLK;
-	}
-	else {
-		/* The 32KHz oscillator isn't running, so assume there
-		 * isn't one and grab the processor speed from the PLL.
-		 * NOTE: some old silicon doesn't allow reading the PLL.
-		 */
+	/*
+	 * On early Au1000, sys_cpupll was write-only. Since these
+	 * silicon versions of Au1000 are not sold by AMD, we don't bend
+	 * over backwards trying to determine the frequency.
+	 */
+	if (cur_cpu_spec[0]->cpu_pll_wo)
+#ifdef CONFIG_SOC_AU1000_FREQUENCY
+		cpu_speed = CONFIG_SOC_AU1000_FREQUENCY;
+#else
+		cpu_speed = 396000000;
+#endif
+	else
 		cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) * AU1000_SRC_CLK;
-		no_au1xxx_32khz = 1;
-	}
 	mips_hpt_frequency = cpu_speed;
 	// Equation: Baudrate = CPU / (SD * 2 * CLKDIV * 16)
 	set_au1x00_uart_baud_base(cpu_speed / (2 * ((int)(au_readl(SYS_POWERCTRL)&0x03) + 2) * 16));
Index: linux-2.6/include/asm-mips/mach-au1x00/au1000.h
===================================================================
--- linux-2.6.orig/include/asm-mips/mach-au1x00/au1000.h
+++ linux-2.6/include/asm-mips/mach-au1x00/au1000.h
@@ -1778,6 +1778,7 @@ struct cpu_spec {
 	char		*cpu_name;
 	unsigned char	cpu_od;		/* Set Config[OD] */
 	unsigned char	cpu_bclk;	/* Enable BCLK switching */
+	unsigned char	cpu_pll_wo;	/* sys_cpupll reg. write-only */
 };
 
 extern struct cpu_spec		cpu_specs[];


From sshtylyov@ru.mvista.com Thu Mar 27 14:16:18 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Mar 2008 14:16:21 +0100 (CET)
Received: from h155.mvista.com ([63.81.120.155]:47150 "EHLO imap.sh.mvista.com")
	by lappi.linux-mips.net with ESMTP id S523995AbYC0NQR (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 27 Mar 2008 14:16:17 +0100
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id 6B61B3EC9; Thu, 27 Mar 2008 06:15:44 -0700 (PDT)
Message-ID: <47EB9E55.4040800@ru.mvista.com>
Date:	Thu, 27 Mar 2008 16:17:09 +0300
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
X-Accept-Language: ru, en-us, en-gb
MIME-Version: 1.0
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	ralf@linux-mips.org, linux-mips@linux-mips.org
Subject: Re: [PATCH] Alchemy: work around clock misdetection on early Au1000
 (take 2)
References: <200803271609.31772.sshtylyov@ru.mvista.com>
In-Reply-To: <200803271609.31772.sshtylyov@ru.mvista.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@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: 18670
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 847
Lines: 28

I just wrote:

> Index: linux-2.6/arch/mips/au1000/common/setup.c
> ===================================================================
> --- linux-2.6.orig/arch/mips/au1000/common/setup.c
> +++ linux-2.6/arch/mips/au1000/common/setup.c
> @@ -57,7 +57,7 @@ void __init plat_mem_setup(void)
>  {
>  	struct	cpu_spec *sp;
>  	char *argptr;
> -	unsigned long prid, cpupll, bclk = 1;
> +	unsigned long prid, cpufreq, bclk = 1;
>  
>  	set_cpuspec();
>  	sp = cur_cpu_spec[0];
> @@ -65,8 +65,15 @@ void __init plat_mem_setup(void)
>  	board_setup();  /* board specific setup */
>  
>  	prid = read_c0_prid();
> -	cpupll = (au_readl(0xB1900060) & 0x3F) * 12;
> -	printk("(PRId %08lx) @ %ldMHZ\n", prid, cpupll);
> +	if (cur_cpu_spec[0]->cpu_pll_wo)

    Oops! Ralf, could you change 'cur_cpu_spec[0]' to just 'sp' here before 
committing?

WBR, Sergei


From ralf@linux-mips.org Thu Mar 27 14:34:41 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Mar 2008 14:34:45 +0100 (CET)
Received: from oss.sgi.com ([192.48.170.157]:38335 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S524408AbYC0Nel (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 27 Mar 2008 14:34:41 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m2RDY1S9001874
	for <linux-mips@linux-mips.org>; Thu, 27 Mar 2008 06:34:02 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2RDYYVI019481;
	Thu, 27 Mar 2008 13:34:35 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2RDYX1S019480;
	Thu, 27 Mar 2008 13:34:33 GMT
Date:	Thu, 27 Mar 2008 13:34:33 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] Alchemy: work around clock misdetection on early
	Au1000 (take 2)
Message-ID: <20080327133433.GA19381@linux-mips.org>
References: <200803271609.31772.sshtylyov@ru.mvista.com> <47EB9E55.4040800@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <47EB9E55.4040800@ru.mvista.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
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: 18671
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: 173
Lines: 8

On Thu, Mar 27, 2008 at 04:17:09PM +0300, Sergei Shtylyov wrote:

>    Oops! Ralf, could you change 'cur_cpu_spec[0]' to just 'sp' here before 
> committing?

wilco

  Ralf

From ralf@linux-mips.org Thu Mar 27 14:41:07 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Mar 2008 14:41:13 +0100 (CET)
Received: from oss.sgi.com ([192.48.170.157]:45770 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S524408AbYC0NlH (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 27 Mar 2008 14:41:07 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m2RDbLtj002431
	for <linux-mips@linux-mips.org>; Thu, 27 Mar 2008 06:40:27 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2RDbu0Z019605;
	Thu, 27 Mar 2008 13:37:56 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2RDbsTA019604;
	Thu, 27 Mar 2008 13:37:54 GMT
Date:	Thu, 27 Mar 2008 13:37:54 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] Alchemy: work around clock misdetection on early
	Au1000 (take 2)
Message-ID: <20080327133754.GB19381@linux-mips.org>
References: <200803271609.31772.sshtylyov@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200803271609.31772.sshtylyov@ru.mvista.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
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: 18672
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: 634
Lines: 15

On Thu, Mar 27, 2008 at 04:09:31PM +0300, Sergei Shtylyov wrote:

> Work around the CPU clock miscalculation on Au1000DA/HA/HB due the sys_cpupll
> register being write-only, i.e. actually do what the comment before cal_r4off()
> function advertised for years but the code failed at.  This is achieved by just
> giving user a chance to define the clock explicitly  in the board config. via
> CONFIG_SOC_AU1000_FREQUENCY option, defaulting to 396 MHz if the option is not
> given...
> 
> The patch is based on the AMD's big unpublished patch, the issue seems to be an
> undocumented errata (or feature :-)...

Applied, thanks,

  Ralf

From ncoesel@DEALogic.nl Thu Mar 27 14:47:28 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Mar 2008 14:47:33 +0100 (CET)
Received: from smtp-vbr8.xs4all.nl ([194.109.24.28]:19725 "EHLO
	smtp-vbr8.xs4all.nl") by lappi.linux-mips.net with ESMTP
	id S524439AbYC0Nr2 convert rfc822-to-8bit (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 27 Mar 2008 14:47:28 +0100
Received: from dealogic.nl (a62-251-87-113.adsl.xs4all.nl [62.251.87.113])
	by smtp-vbr8.xs4all.nl (8.13.8/8.13.8) with ESMTP id m2RDkoJA040254;
	Thu, 27 Mar 2008 14:46:56 +0100 (CET)
	(envelope-from ncoesel@DEALogic.nl)
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 8BIT
Subject: RE: FW: Alchemy power managment code.
Date:	Thu, 27 Mar 2008 14:46:50 +0100
Message-ID: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF985@dealogicserver.DEALogic.nl>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: FW: Alchemy power managment code.
thread-index: AciPXrXQBHchMZF3Qt6bxoUnhX8xXwAsebgQ
From:	"Nico Coesel" <ncoesel@DEALogic.nl>
To:	"Sergei Shtylyov" <sshtylyov@ru.mvista.com>
Cc:	<linux-mips@linux-mips.org>
X-Virus-Scanned: by XS4ALL Virus Scanner
Return-Path: <ncoesel@DEALogic.nl>
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: 18673
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: ncoesel@DEALogic.nl
Precedence: bulk
X-list: linux-mips
Content-Length: 1282
Lines: 39

> -----Oorspronkelijk bericht-----
> Van: Sergei Shtylyov [mailto:sshtylyov@ru.mvista.com] 
> Verzonden: woensdag 26 maart 2008 17:32
> Aan: Nico Coesel
> CC: linux-mips@linux-mips.org
> Onderwerp: Re: FW: Alchemy power managment code.
> 
> Hello all.
> 
> Nico Coesel wrote:
> 
> > Ralf,
> > Funny you ask because I tried this yesterday on a AU1100 
> system with 
> > the
> > 2.6.24 kernel (from kernel.org). I'm afraid I must say the kernel 
> > crashes when I enable power management. The reason I want 
> to use power 
> > management is because I need to send the CPU to sleep when 
> the system 
> > shuts down. I hacked power.c and reset.c a bit so 
> au_sleep() is called 
> > when the system is shut down. Perhaps someone can confirm the 
> > powermanagement can be made to work with some fixes (it didn't work 
> > with
> > 2.6.21-rc4 either).
> 
>     BTW, for anybody interested in Alchemy PM code, here's 
> the interesting
> link: [ftp|http]://ftp.enneenne.com/pub/misc/au1100-patches/linux/.
>     It contains  a lot of unmerged PM patches by Rodolfo 
> Giometti (and not only that) from around 2.6.17 time.
> 

Sergei,
Is there a reason why these patches didn't make it into the official
kernel? IIRC Rodolfo has been quite active on this mailing list.

Nico Coesel

From sshtylyov@ru.mvista.com Thu Mar 27 17:40:36 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Mar 2008 17:40:40 +0100 (CET)
Received: from h155.mvista.com ([63.81.120.155]:58424 "EHLO imap.sh.mvista.com")
	by lappi.linux-mips.net with ESMTP id S525251AbYC0Qkf (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 27 Mar 2008 17:40:35 +0100
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id 67BB93EC9; Thu, 27 Mar 2008 09:40:03 -0700 (PDT)
Message-ID: <47EBCE38.5070503@ru.mvista.com>
Date:	Thu, 27 Mar 2008 19:41:28 +0300
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
X-Accept-Language: ru, en-us, en-gb
MIME-Version: 1.0
To:	Nico Coesel <ncoesel@DEALogic.nl>
Cc:	linux-mips@linux-mips.org
Subject: Re: FW: Alchemy power managment code.
References: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF985@dealogicserver.DEALogic.nl>
In-Reply-To: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF985@dealogicserver.DEALogic.nl>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@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: 18674
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 740
Lines: 20

Nico Coesel wrote:

>>    BTW, for anybody interested in Alchemy PM code, here's 
>>the interesting
>>link: [ftp|http]://ftp.enneenne.com/pub/misc/au1100-patches/linux/.
>>    It contains  a lot of unmerged PM patches by Rodolfo 
>>Giometti (and not only that) from around 2.6.17 time.

> Sergei,
> Is there a reason why these patches didn't make it into the official
> kernel? IIRC Rodolfo has been quite active on this mailing list.

    Keywords are "on this mailing list" -- most of his patches were for other 
mailing lists (e.g. he did much to support PM in the peripheral drivers but 
never pushed that stuff to the respective maintainers AFAIK). He just wasn't 
consistent about the upstream submission.

> Nico Coesel

WBR, Sergei

From sshtylyov@ru.mvista.com Thu Mar 27 20:05:09 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Mar 2008 20:05:15 +0100 (CET)
Received: from rtsoft3.corbina.net ([85.21.88.6]:38922 "EHLO
	buildserver.ru.mvista.com") by lappi.linux-mips.net with ESMTP
	id S526844AbYC0TFJ (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 27 Mar 2008 20:05:09 +0100
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id 1A2E78810; Fri, 28 Mar 2008 00:04:54 +0400 (SAMT)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	ralf@linux-mips.org
Subject: [PATCH] Alchemy: kill useless time variables
Date:	Thu, 27 Mar 2008 22:05:57 +0300
User-Agent: KMail/1.5
Cc:	linux-mips@linux-mips.org
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200803272205.57531.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@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: 18678
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 3280
Lines: 91

Since the commit 91a2fcc88634663e9e13dcdfad0e4a860e64aeee ([MIPS] Consolidate
all variants of MIPS cp0 timer interrupt handlers) removed the Alchemy specific
timer handler, 'r4k_offset' and 'r4k_cur' variables became practically useless,
so get rid of them at last, renaming cal_r4off() function into calc_clock() and
making it return CPU frequency. Also, make 'no_au1xxx_32khz' variable static...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

 arch/mips/au1000/common/dbg_io.c |    4 ++--
 arch/mips/au1000/common/time.c   |   19 ++++---------------
 2 files changed, 6 insertions(+), 17 deletions(-)

Index: linux-2.6/arch/mips/au1000/common/dbg_io.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/dbg_io.c
+++ linux-2.6/arch/mips/au1000/common/dbg_io.c
@@ -56,7 +56,7 @@ typedef         unsigned int  uint32;
 #define UART16550_WRITE(y, z) (au_writel(z&0xff, DEBUG_BASE + y))
 
 extern unsigned long get_au1x00_uart_baud_base(void);
-extern unsigned long cal_r4koff(void);
+extern unsigned long calc_clock(void);
 
 void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
 {
@@ -64,7 +64,7 @@ void debugInit(uint32 baud, uint8 data, 
 	if (UART16550_READ(UART_MOD_CNTRL) != 0x3) {
 		UART16550_WRITE(UART_MOD_CNTRL, 3);
 	}
-	cal_r4koff();
+	calc_clock();
 
 	/* disable interrupts */
 	UART16550_WRITE(UART_IER, 0);
Index: linux-2.6/arch/mips/au1000/common/time.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/time.c
+++ linux-2.6/arch/mips/au1000/common/time.c
@@ -48,9 +48,7 @@
 #include <linux/mc146818rtc.h>
 #include <linux/timex.h>
 
-static unsigned long r4k_offset; /* Amount to increment compare reg each time */
-static unsigned long r4k_cur;    /* What counter should be at next timer irq */
-int	no_au1xxx_32khz;
+static int no_au1xxx_32khz;
 extern int allow_au1k_wait; /* default off for CP0 Counter */
 
 #ifdef CONFIG_PM
@@ -184,7 +182,7 @@ wakeup_counter0_set(int ticks)
  * "wait" is enabled, and we need to detect if the 32KHz isn't present
  * but requested......got it? :-)		-- Dan
  */
-unsigned long cal_r4koff(void)
+unsigned long calc_clock(void)
 {
 	unsigned long cpu_speed;
 	unsigned long flags;
@@ -229,19 +227,13 @@ unsigned long cal_r4koff(void)
 	// Equation: Baudrate = CPU / (SD * 2 * CLKDIV * 16)
 	set_au1x00_uart_baud_base(cpu_speed / (2 * ((int)(au_readl(SYS_POWERCTRL)&0x03) + 2) * 16));
 	spin_unlock_irqrestore(&time_lock, flags);
-	return (cpu_speed / HZ);
+	return cpu_speed;
 }
 
 void __init plat_time_init(void)
 {
-	unsigned int est_freq;
+	unsigned int est_freq = calc_clock();
 
-	printk("calculating r4koff... ");
-	r4k_offset = cal_r4koff();
-	printk("%08lx(%d)\n", r4k_offset, (int) r4k_offset);
-
-	//est_freq = 2*r4k_offset*HZ;
-	est_freq = r4k_offset*HZ;
 	est_freq += 5000;    /* round */
 	est_freq -= est_freq%10000;
 	printk("CPU frequency %d.%02d MHz\n", est_freq/1000000,
@@ -249,9 +241,6 @@ void __init plat_time_init(void)
  	set_au1x00_speed(est_freq);
  	set_au1x00_lcd_clock(); // program the LCD clock
 
-	r4k_cur = (read_c0_count() + r4k_offset);
-	write_c0_compare(r4k_cur);
-
 #ifdef CONFIG_PM
 	/*
 	 * setup counter 0, since it keeps ticking after a


From technoboy85@gmail.com Thu Mar 27 22:14:45 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Mar 2008 22:14:49 +0100 (CET)
Received: from smtp-out26.alice.it ([85.33.2.26]:61196 "EHLO
	smtp-out26.alice.it") by lappi.linux-mips.net with ESMTP
	id S527089AbYC0VOp (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 27 Mar 2008 22:14:45 +0100
Received: from FBCMMO02.fbc.local ([192.168.68.196]) by smtp-out26.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 27 Mar 2008 22:14:22 +0100
Received: from FBCMCL01B06.fbc.local ([192.168.69.87]) by FBCMMO02.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 27 Mar 2008 22:14:22 +0100
Received: from raver.openwrt ([79.19.115.152]) by FBCMCL01B06.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 27 Mar 2008 22:14:21 +0100
From:	Matteo Croce <technoboy85@gmail.com>
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: Re: [PATCH][MIPS][5/6]: AR7: serial hack
Date:	Thu, 27 Mar 2008 22:14:21 +0100
User-Agent: KMail/1.9.9
Cc:	linux-mips@linux-mips.org, Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
References: <200803120221.25044.technoboy85@gmail.com> <200803161645.06364.technoboy85@gmail.com> <20080321015540.GA30988@alpha.franken.de>
In-Reply-To: <20080321015540.GA30988@alpha.franken.de>
X-Face:	0AUq?,0sKh2O65+R5#[nTCS'~}"m)9|g3Tsi=g7A9q69S+=M!BY)=?utf-8?q?Zdmwo2u!i=5CUylx=26=27D+=0A=09=5B7u=26z1=27s=7E=5B=3F+=24=27w?=
 =?utf-8?q?O6+?="'WWcr5Jy,]}8namg8NP:9<E,o^21xGB~/HRhB(u^@
 =?utf-8?q?ZB=2EXLP0swe=0A=09r9M=7EL?=<b1=^'4cv*_N1tNJ$`9Ot*KL/;8oXFdrT@r|-Ki2wCQI"R(X(
 =?utf-8?q?73r=3A=3BmnNPoA2a=5D=7EZ=0A=092n2sUh?=,B|bt;ys*hv.QR>a]{m
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200803272214.21456.technoboy85@gmail.com>
X-OriginalArrivalTime: 27 Mar 2008 21:14:21.0484 (UTC) FILETIME=[8695CEC0:01C8904F]
Return-Path: <technoboy85@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: 18681
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: technoboy85@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 4377
Lines: 121

Il Friday 21 March 2008 02:55:40 Thomas Bogendoerfer ha scritto:
> On Sun, Mar 16, 2008 at 04:45:06PM +0100, Matteo Croce wrote:
> > Tried I get teh usual broken serial output:
> > 
> > IP6 oover IPv4 tuneliing driver
> > NET: eggistered protooll family 17
> > VFS: Monteed root (squahfss filesystem)reaadonly.
> 
> Linux version 2.6.25-rc6-00000-g151de9e-dirty (tsbogend@solo.franken.de)
> (gcc version 3.3.3 (Debian 20040320)) #29 Fri Mar 21 02:40:21 CET 2008
> console [early0] enabled
> CPU revision is: 00018448 (MIPS 4KEc)
> TI AR7 (Unknown), ID: 0x5700, Revision: 0x00
> Determined physical RAM map:
>  memory: 02000000 @ 14000000 (usable)
> Zone PFN ranges:
>   Normal      81920 ->    90112
> Movable zone start PFN for each node
> early_node_map[1] active PFN ranges
>     0:    81920 ->    90112
> Built 1 zonelists in Zone order, mobility grouping on.  Total pages:
> 8128
> Kernel command line: console=ttyS0,115200
> Primary instruction cache 16kB, VIPT, 4-way, linesize 16 bytes.
> Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 16 bytes
> Synthesized clear page handler (26 instructions).
> Synthesized copy page handler (46 instructions).
> PID hash table entries: 128 (order: 7, 512 bytes)
> Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
> Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
> Memory: 29700k/32768k available (2075k kernel code, 3068k reserved, 466k
> data, 136k init, 0k highmem)
> Mount-cache hash table entries: 512
> net_namespace: 152 bytes
> NET: Registered protocol family 16
> SCSI subsystem initialized
> NET: Registered protocol family 2
> Time: MIPS clocksource has been installed.
> IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
> TCP established hash table entries: 1024 (order: 1, 8192 bytes)
> TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
> TCP: Hash tables configured (established 1024 bind 1024)
> TCP reno registered
> io scheduler noop registered
> io scheduler anticipatory registered (default)
> io scheduler deadline registered
> Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing
> disabled
> serial8250: ttyS0 at MMIO 0x8610e03 (irq = 15) is a 16550A
> console handover: boot [early0] -> real [ttyS0]
> serial8250: ttyS1 at MMIO 0x8610f03 (irq = 16) is a 16550A
> loop: module loaded
> Fixed MDIO Bus: probed
> ar7_wdt: failed to unlock WDT disable reg
> ar7_wdt: failed to unlock WDT prescale reg
> ar7_wdt: failed to unlock WDT change reg
> ar7_wdt: timer margin 59 seconds (prescale 65535, change 57180, freq
> 62500000)
> TCP cubic registered
> NET: Registered protocol family 1
> NET: Registered protocol family 17
> RPC: Registered udp transport module.
> RPC: Registered tcp transport module.
> Root-NFS: No NFS server available, giving up.
> VFS: Unable to mount root fs via NFS, trying floppy.
> List of all partitions:
> No filesystem could mount root, tried:
> Kernel panic - not syncing: VFS: Unable to mount root fs on
> unknown-block(2,0)
> Rebooting in 3 seconds..
> 
> I don't see any problems with using PORT_16550A. What I'm still
> wondering how your kernel could work at all, since there is a
> missing case for setting up the TLB refill handler. Something like
> the patch below.
> 
> And most of the AR7 device driver code will not work for big endian. 
> The log above is from a big endian AR7 system, where I needed
> to disable CPMAC to get it booting that far.
> 
> Thomas.
> 
> 
> diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
> index 3a93d4c..382738c 100644
> --- a/arch/mips/mm/tlbex.c
> +++ b/arch/mips/mm/tlbex.c
> @@ -307,6 +307,7 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
>  	case CPU_R12000:
>  	case CPU_R14000:
>  	case CPU_4KC:
> +	case CPU_4KEC:
>  	case CPU_SB1:
>  	case CPU_SB1A:
>  	case CPU_4KSC:
> 
> 

Actually we use this for 2.6.24:

Index: linux-2.6.24/arch/mips/mm/tlbex.c
===================================================================
--- linux-2.6.24/arch/mips/mm/tlbex.c	2007-10-10 04:31:38.000000000 +0800
+++ linux-2.6.24/arch/mips/mm/tlbex.c	2007-10-10 13:52:34.000000000 +0800
@@ -902,7 +902,6 @@
 	case CPU_R10000:
 	case CPU_R12000:
 	case CPU_R14000:
-	case CPU_4KC:
 	case CPU_SB1:
 	case CPU_SB1A:
 	case CPU_4KSC:
@@ -933,6 +932,7 @@
 		tlbw(p);
 		break;
 
+	case CPU_4KC:
 	case CPU_4KEC:
 	case CPU_24K:
 	case CPU_34K:


From technoboy85@gmail.com Thu Mar 27 22:17:49 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Mar 2008 22:17:57 +0100 (CET)
Received: from smtp-OUT05A.alice.it ([85.33.3.5]:31243 "EHLO
	smtp-OUT05A.alice.it") by lappi.linux-mips.net with ESMTP
	id S1103459AbYC0VRt (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 27 Mar 2008 22:17:49 +0100
Received: from FBCMMO01.fbc.local ([192.168.68.195]) by smtp-OUT05A.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 27 Mar 2008 22:17:25 +0100
Received: from FBCMCL01B08.fbc.local ([192.168.171.46]) by FBCMMO01.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 27 Mar 2008 22:17:17 +0100
Received: from raver.openwrt ([79.19.115.152]) by FBCMCL01B08.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 27 Mar 2008 22:16:53 +0100
From:	Matteo Croce <technoboy85@gmail.com>
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: Re: [PATCH][MIPS][5/6]: AR7: serial hack
Date:	Thu, 27 Mar 2008 22:17:16 +0100
User-Agent: KMail/1.9.9
Cc:	linux-mips@linux-mips.org, Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Nicolas Thill <nico@openwrt.org>, linux-serial@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
References: <200803120221.25044.technoboy85@gmail.com> <200803161645.06364.technoboy85@gmail.com> <20080321015540.GA30988@alpha.franken.de>
In-Reply-To: <20080321015540.GA30988@alpha.franken.de>
X-Face:	0AUq?,0sKh2O65+R5#[nTCS'~}"m)9|g3Tsi=g7A9q69S+=M!BY)=?utf-8?q?Zdmwo2u!i=5CUylx=26=27D+=0A=09=5B7u=26z1=27s=7E=5B=3F+=24=27w?=
 =?utf-8?q?O6+?="'WWcr5Jy,]}8namg8NP:9<E,o^21xGB~/HRhB(u^@
 =?utf-8?q?ZB=2EXLP0swe=0A=09r9M=7EL?=<b1=^'4cv*_N1tNJ$`9Ot*KL/;8oXFdrT@r|-Ki2wCQI"R(X(
 =?utf-8?q?73r=3A=3BmnNPoA2a=5D=7EZ=0A=092n2sUh?=,B|bt;ys*hv.QR>a]{m
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200803272217.16589.technoboy85@gmail.com>
X-OriginalArrivalTime: 27 Mar 2008 21:16:53.0703 (UTC) FILETIME=[E1509570:01C8904F]
Return-Path: <technoboy85@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: 18682
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: technoboy85@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 4377
Lines: 121

Il Friday 21 March 2008 02:55:40 Thomas Bogendoerfer ha scritto:
> On Sun, Mar 16, 2008 at 04:45:06PM +0100, Matteo Croce wrote:
> > Tried I get teh usual broken serial output:
> > 
> > IP6 oover IPv4 tuneliing driver
> > NET: eggistered protooll family 17
> > VFS: Monteed root (squahfss filesystem)reaadonly.
> 
> Linux version 2.6.25-rc6-00000-g151de9e-dirty (tsbogend@solo.franken.de)
> (gcc version 3.3.3 (Debian 20040320)) #29 Fri Mar 21 02:40:21 CET 2008
> console [early0] enabled
> CPU revision is: 00018448 (MIPS 4KEc)
> TI AR7 (Unknown), ID: 0x5700, Revision: 0x00
> Determined physical RAM map:
>  memory: 02000000 @ 14000000 (usable)
> Zone PFN ranges:
>   Normal      81920 ->    90112
> Movable zone start PFN for each node
> early_node_map[1] active PFN ranges
>     0:    81920 ->    90112
> Built 1 zonelists in Zone order, mobility grouping on.  Total pages:
> 8128
> Kernel command line: console=ttyS0,115200
> Primary instruction cache 16kB, VIPT, 4-way, linesize 16 bytes.
> Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 16 bytes
> Synthesized clear page handler (26 instructions).
> Synthesized copy page handler (46 instructions).
> PID hash table entries: 128 (order: 7, 512 bytes)
> Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
> Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
> Memory: 29700k/32768k available (2075k kernel code, 3068k reserved, 466k
> data, 136k init, 0k highmem)
> Mount-cache hash table entries: 512
> net_namespace: 152 bytes
> NET: Registered protocol family 16
> SCSI subsystem initialized
> NET: Registered protocol family 2
> Time: MIPS clocksource has been installed.
> IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
> TCP established hash table entries: 1024 (order: 1, 8192 bytes)
> TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
> TCP: Hash tables configured (established 1024 bind 1024)
> TCP reno registered
> io scheduler noop registered
> io scheduler anticipatory registered (default)
> io scheduler deadline registered
> Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing
> disabled
> serial8250: ttyS0 at MMIO 0x8610e03 (irq = 15) is a 16550A
> console handover: boot [early0] -> real [ttyS0]
> serial8250: ttyS1 at MMIO 0x8610f03 (irq = 16) is a 16550A
> loop: module loaded
> Fixed MDIO Bus: probed
> ar7_wdt: failed to unlock WDT disable reg
> ar7_wdt: failed to unlock WDT prescale reg
> ar7_wdt: failed to unlock WDT change reg
> ar7_wdt: timer margin 59 seconds (prescale 65535, change 57180, freq
> 62500000)
> TCP cubic registered
> NET: Registered protocol family 1
> NET: Registered protocol family 17
> RPC: Registered udp transport module.
> RPC: Registered tcp transport module.
> Root-NFS: No NFS server available, giving up.
> VFS: Unable to mount root fs via NFS, trying floppy.
> List of all partitions:
> No filesystem could mount root, tried:
> Kernel panic - not syncing: VFS: Unable to mount root fs on
> unknown-block(2,0)
> Rebooting in 3 seconds..
> 
> I don't see any problems with using PORT_16550A. What I'm still
> wondering how your kernel could work at all, since there is a
> missing case for setting up the TLB refill handler. Something like
> the patch below.
> 
> And most of the AR7 device driver code will not work for big endian. 
> The log above is from a big endian AR7 system, where I needed
> to disable CPMAC to get it booting that far.
> 
> Thomas.
> 
> 
> diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
> index 3a93d4c..382738c 100644
> --- a/arch/mips/mm/tlbex.c
> +++ b/arch/mips/mm/tlbex.c
> @@ -307,6 +307,7 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
>  	case CPU_R12000:
>  	case CPU_R14000:
>  	case CPU_4KC:
> +	case CPU_4KEC:
>  	case CPU_SB1:
>  	case CPU_SB1A:
>  	case CPU_4KSC:
> 
> 

Actually we use this for 2.6.24:

Index: linux-2.6.24/arch/mips/mm/tlbex.c
===================================================================
--- linux-2.6.24/arch/mips/mm/tlbex.c	2007-10-10 04:31:38.000000000 +0800
+++ linux-2.6.24/arch/mips/mm/tlbex.c	2007-10-10 13:52:34.000000000 +0800
@@ -902,7 +902,6 @@
 	case CPU_R10000:
 	case CPU_R12000:
 	case CPU_R14000:
-	case CPU_4KC:
 	case CPU_SB1:
 	case CPU_SB1A:
 	case CPU_4KSC:
@@ -933,6 +932,7 @@
 		tlbw(p);
 		break;
 
+	case CPU_4KC:
 	case CPU_4KEC:
 	case CPU_24K:
 	case CPU_34K:


From ralf@linux-mips.org Fri Mar 28 00:09:07 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Mar 2008 00:09:11 +0100 (CET)
Received: from oss.sgi.com ([192.48.170.157]:23748 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S527417AbYC0XJH (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 28 Mar 2008 00:09:07 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m2RN8Rws025558
	for <linux-mips@linux-mips.org>; Thu, 27 Mar 2008 16:08:27 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2RMXsdM027305;
	Thu, 27 Mar 2008 22:33:54 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2RMXsWV027304;
	Thu, 27 Mar 2008 22:33:54 GMT
Date:	Thu, 27 Mar 2008 22:33:54 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Nico Coesel <ncoesel@DEALogic.nl>
Cc:	Sergei Shtylyov <sshtylyov@ru.mvista.com>,
	linux-mips@linux-mips.org
Subject: Re: FW: Alchemy power managment code.
Message-ID: <20080327223354.GC26997@linux-mips.org>
References: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF985@dealogicserver.DEALogic.nl>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF985@dealogicserver.DEALogic.nl>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
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: 18683
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: 542
Lines: 16

On Thu, Mar 27, 2008 at 02:46:50PM +0100, Nico Coesel wrote:

> >     BTW, for anybody interested in Alchemy PM code, here's 
> > the interesting
> > link: [ftp|http]://ftp.enneenne.com/pub/misc/au1100-patches/linux/.
> >     It contains  a lot of unmerged PM patches by Rodolfo 
> > Giometti (and not only that) from around 2.6.17 time.
> > 
> 
> Sergei,
> Is there a reason why these patches didn't make it into the official
> kernel? IIRC Rodolfo has been quite active on this mailing list.

At times it simply takes nagging me :)

  Ralf

From ralf@linux-mips.org Fri Mar 28 00:09:46 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Mar 2008 00:09:50 +0100 (CET)
Received: from oss.sgi.com ([192.48.170.157]:25284 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S527418AbYC0XJL (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 28 Mar 2008 00:09:11 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m2RN8VvV025570
	for <linux-mips@linux-mips.org>; Thu, 27 Mar 2008 16:08:32 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2RMVaxD027286;
	Thu, 27 Mar 2008 22:31:36 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2RMVZZn027285;
	Thu, 27 Mar 2008 22:31:35 GMT
Date:	Thu, 27 Mar 2008 22:31:35 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	linux-mips@linux-mips.org, Nico Coesel <ncoesel@DEALogic.nl>
Subject: Re: FW: Alchemy power managment code.
Message-ID: <20080327223134.GA26997@linux-mips.org>
References: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF804@dealogicserver.DEALogic.nl> <47E7B970.30105@ru.mvista.com> <47E7BB4B.3080507@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <47E7BB4B.3080507@ru.mvista.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
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: 18684
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: 639
Lines: 15

On Mon, Mar 24, 2008 at 05:31:39PM +0300, Sergei Shtylyov wrote:

>  >    The TOY cpunter 0 clockevent driver is also need to be written for
>> the recent kernel as CP0 timer stops ticking after wait insn is executed 
>> -- see arch/mips/au1000/common/time.c...
>
>    And here's found another possible issue with Alchemy PM -- the CP0 
> counter counts at unpredictable frequency in idle state (after executing 
> "wait"), so the MIPS clocksource will probably be unstable?

Correct - and cevt-r4k won't be usable either.  I guess that means you
leave the user the choice between either these two or using wait.  Not
nice but ...

  Ralf

From ralf@linux-mips.org Fri Mar 28 00:10:34 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Mar 2008 00:10:41 +0100 (CET)
Received: from oss.sgi.com ([192.48.170.157]:27332 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S527422AbYC0XJQ (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 28 Mar 2008 00:09:16 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m2RN8aGD025582
	for <linux-mips@linux-mips.org>; Thu, 27 Mar 2008 16:08:37 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2RMWlBQ027298;
	Thu, 27 Mar 2008 22:32:47 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2RMWlaE027297;
	Thu, 27 Mar 2008 22:32:47 GMT
Date:	Thu, 27 Mar 2008 22:32:47 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	Nico Coesel <ncoesel@DEALogic.nl>, linux-mips@linux-mips.org
Subject: Re: FW: Alchemy power managment code.
Message-ID: <20080327223247.GB26997@linux-mips.org>
References: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF804@dealogicserver.DEALogic.nl> <47EA7A7B.8020602@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <47EA7A7B.8020602@ru.mvista.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
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: 18685
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: 966
Lines: 20

On Wed, Mar 26, 2008 at 07:31:55PM +0300, Sergei Shtylyov wrote:

>> Funny you ask because I tried this yesterday on a AU1100 system with the
>> 2.6.24 kernel (from kernel.org). I'm afraid I must say the kernel
>> crashes when I enable power management. The reason I want to use power
>> management is because I need to send the CPU to sleep when the system
>> shuts down. I hacked power.c and reset.c a bit so au_sleep() is called
>> when the system is shut down. Perhaps someone can confirm the
>> powermanagement can be made to work with some fixes (it didn't work with
>> 2.6.21-rc4 either).
>
>    BTW, for anybody interested in Alchemy PM code, here's the interesting
> link: [ftp|http]://ftp.enneenne.com/pub/misc/au1100-patches/linux/.
>    It contains  a lot of unmerged PM patches by Rodolfo Giometti (and not
> only that) from around 2.6.17 time.

Anybody interested in reviewing these patches and polishing them to be
applied to a recent kernel?

  Ralf

From ncoesel@DEALogic.nl Fri Mar 28 09:22:02 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Mar 2008 09:22:07 +0100 (CET)
Received: from smtp-vbr17.xs4all.nl ([194.109.24.37]:6152 "EHLO
	smtp-vbr17.xs4all.nl") by lappi.linux-mips.net with ESMTP
	id S528153AbYC1IWC convert rfc822-to-8bit (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 28 Mar 2008 09:22:02 +0100
Received: from dealogic.nl (a62-251-87-113.adsl.xs4all.nl [62.251.87.113])
	by smtp-vbr17.xs4all.nl (8.13.8/8.13.8) with ESMTP id m2S8LLDJ003013;
	Fri, 28 Mar 2008 09:21:26 +0100 (CET)
	(envelope-from ncoesel@DEALogic.nl)
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 8BIT
Subject: RE: FW: Alchemy power managment code.
Date:	Fri, 28 Mar 2008 09:21:22 +0100
Message-ID: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF98E@dealogicserver.DEALogic.nl>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: FW: Alchemy power managment code.
thread-index: AciQX5Nu6p3BCSPRTze+CZNOwIqc7AATAj0w
From:	"Nico Coesel" <ncoesel@DEALogic.nl>
To:	"Ralf Baechle" <ralf@linux-mips.org>,
	"Sergei Shtylyov" <sshtylyov@ru.mvista.com>
Cc:	<linux-mips@linux-mips.org>
X-Virus-Scanned: by XS4ALL Virus Scanner
Return-Path: <ncoesel@DEALogic.nl>
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: 18686
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: ncoesel@DEALogic.nl
Precedence: bulk
X-list: linux-mips
Content-Length: 1871
Lines: 50


> -----Oorspronkelijk bericht-----
> Van: Ralf Baechle [mailto:ralf@linux-mips.org] 
> Verzonden: donderdag 27 maart 2008 23:33
> Aan: Sergei Shtylyov
> CC: Nico Coesel; linux-mips@linux-mips.org
> Onderwerp: Re: FW: Alchemy power managment code.
> 
> On Wed, Mar 26, 2008 at 07:31:55PM +0300, Sergei Shtylyov wrote:
> 
> >> Funny you ask because I tried this yesterday on a AU1100 
> system with 
> >> the
> >> 2.6.24 kernel (from kernel.org). I'm afraid I must say the kernel 
> >> crashes when I enable power management. The reason I want to use 
> >> power management is because I need to send the CPU to 
> sleep when the 
> >> system shuts down. I hacked power.c and reset.c a bit so 
> au_sleep() 
> >> is called when the system is shut down. Perhaps someone 
> can confirm 
> >> the powermanagement can be made to work with some fixes (it didn't 
> >> work with
> >> 2.6.21-rc4 either).
> >
> >    BTW, for anybody interested in Alchemy PM code, here's the 
> > interesting
> > link: [ftp|http]://ftp.enneenne.com/pub/misc/au1100-patches/linux/.
> >    It contains  a lot of unmerged PM patches by Rodolfo 
> Giometti (and 
> > not only that) from around 2.6.17 time.
> 
> Anybody interested in reviewing these patches and polishing 
> them to be applied to a recent kernel?
> 
>   Ralf

I guess I will have to, but it will probably be somewhere near the end
of April. Also, I'm leaning towards only fixing the TOY timer during
sleep so the clock keeps running. IMHO this should be standard behaviour
which does not depend on power management.

Are diffs against 2.6.24 any good to you guys? The timer stuff Sergei
seems to be working on right now also sounds interesting. Perhaps I'll
patch my kernel with the timer patches from Sergei and apply (some of)
Rodolfo's patches afterwards. I assume there will be quite some overlap
in these patches.

Nico Coesel
 

From ralf@linux-mips.org Fri Mar 28 12:12:02 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Mar 2008 12:12:07 +0100 (CET)
Received: from oss.sgi.com ([192.48.170.157]:48282 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S528435AbYC1LMC (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 28 Mar 2008 12:12:02 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m2SBAJgc022054
	for <linux-mips@linux-mips.org>; Fri, 28 Mar 2008 04:10:20 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2SBAsrr006067;
	Fri, 28 Mar 2008 11:10:54 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2SBAqce006066;
	Fri, 28 Mar 2008 11:10:52 GMT
Date:	Fri, 28 Mar 2008 11:10:52 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] Alchemy: kill useless time variables
Message-ID: <20080328111052.GA5684@linux-mips.org>
References: <200803272205.57531.sshtylyov@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200803272205.57531.sshtylyov@ru.mvista.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
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: 18688
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: 510
Lines: 11

On Thu, Mar 27, 2008 at 10:05:57PM +0300, Sergei Shtylyov wrote:

> Since the commit 91a2fcc88634663e9e13dcdfad0e4a860e64aeee ([MIPS] Consolidate
> all variants of MIPS cp0 timer interrupt handlers) removed the Alchemy specific
> timer handler, 'r4k_offset' and 'r4k_cur' variables became practically useless,
> so get rid of them at last, renaming cal_r4off() function into calc_clock() and
> making it return CPU frequency. Also, make 'no_au1xxx_32khz' variable static...

Queued for2.6.26.  Thanks,

  Ralf

From sshtylyov@ru.mvista.com Fri Mar 28 12:35:18 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Mar 2008 12:35:25 +0100 (CET)
Received: from h155.mvista.com ([63.81.120.155]:1132 "EHLO imap.sh.mvista.com")
	by lappi.linux-mips.net with ESMTP id S528495AbYC1LfR (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 28 Mar 2008 12:35:17 +0100
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id 1E7FA3ECA; Fri, 28 Mar 2008 04:34:44 -0700 (PDT)
Message-ID: <47ECD828.8090600@ru.mvista.com>
Date:	Fri, 28 Mar 2008 14:36:08 +0300
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
X-Accept-Language: ru, en-us, en-gb
MIME-Version: 1.0
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org, Nico Coesel <ncoesel@DEALogic.nl>
Subject: Re: FW: Alchemy power managment code.
References: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF804@dealogicserver.DEALogic.nl> <47E7B970.30105@ru.mvista.com> <47E7BB4B.3080507@ru.mvista.com> <20080327223134.GA26997@linux-mips.org>
In-Reply-To: <20080327223134.GA26997@linux-mips.org>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@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: 18689
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 824
Lines: 24

Hello.

Ralf Baechle wrote:

>> >    The TOY cpunter 0 clockevent driver is also need to be written for

>>>the recent kernel as CP0 timer stops ticking after wait insn is executed 
>>>-- see arch/mips/au1000/common/time.c...

>>   And here's found another possible issue with Alchemy PM -- the CP0 
>>counter counts at unpredictable frequency in idle state (after executing 
>>"wait"), so the MIPS clocksource will probably be unstable?

> Correct - and cevt-r4k won't be usable either.  I guess that means you
> leave the user the choice between either these two or using wait.  Not
> nice but ...

    The Alchemy code doesn't even try to use CP0 counter when CONFIG_PM=y if 
you look into arch/mips/au1000/common/time.c... or at least it didn't before 
Atsushi removed do_fast_pm_gettimeoffset().

>   Ralf

WBR, Sergei

From sshtylyov@ru.mvista.com Fri Mar 28 12:39:06 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Mar 2008 12:39:11 +0100 (CET)
Received: from h155.mvista.com ([63.81.120.155]:14188 "EHLO imap.sh.mvista.com")
	by lappi.linux-mips.net with ESMTP id S528498AbYC1LjG (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 28 Mar 2008 12:39:06 +0100
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id 113EE3EC9; Fri, 28 Mar 2008 04:38:34 -0700 (PDT)
Message-ID: <47ECD90E.2020903@ru.mvista.com>
Date:	Fri, 28 Mar 2008 14:39:58 +0300
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
X-Accept-Language: ru, en-us, en-gb
MIME-Version: 1.0
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	Nico Coesel <ncoesel@DEALogic.nl>, linux-mips@linux-mips.org
Subject: Re: FW: Alchemy power managment code.
References: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF804@dealogicserver.DEALogic.nl> <47EA7A7B.8020602@ru.mvista.com> <20080327223247.GB26997@linux-mips.org>
In-Reply-To: <20080327223247.GB26997@linux-mips.org>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@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: 18690
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1059
Lines: 25

Ralf Baechle wrote:

>>>Funny you ask because I tried this yesterday on a AU1100 system with the
>>>2.6.24 kernel (from kernel.org). I'm afraid I must say the kernel
>>>crashes when I enable power management. The reason I want to use power
>>>management is because I need to send the CPU to sleep when the system
>>>shuts down. I hacked power.c and reset.c a bit so au_sleep() is called
>>>when the system is shut down. Perhaps someone can confirm the
>>>powermanagement can be made to work with some fixes (it didn't work with
>>>2.6.21-rc4 either).

>>   BTW, for anybody interested in Alchemy PM code, here's the interesting
>>link: [ftp|http]://ftp.enneenne.com/pub/misc/au1100-patches/linux/.
>>   It contains  a lot of unmerged PM patches by Rodolfo Giometti (and not
>>only that) from around 2.6.17 time.

> Anybody interested in reviewing these patches and polishing them to be
> applied to a recent kernel?

    I am, at least to some extent. But I'm not sure I'll have enough time from 
now on. Should have started earlier...

>   Ralf

WBR, Sergei

From ralf@linux-mips.org Fri Mar 28 14:32:52 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Mar 2008 14:32:58 +0100 (CET)
Received: from oss.sgi.com ([192.48.170.157]:4796 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S528708AbYC1Ncw (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 28 Mar 2008 14:32:52 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m2SDWCHJ007905
	for <linux-mips@linux-mips.org>; Fri, 28 Mar 2008 06:32:13 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2SDWjkO007437;
	Fri, 28 Mar 2008 13:32:45 GMT
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2SDWhfS007436;
	Fri, 28 Mar 2008 13:32:43 GMT
Date:	Fri, 28 Mar 2008 13:32:43 +0000
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	linux-mips@linux-mips.org, Nico Coesel <ncoesel@DEALogic.nl>
Subject: Re: FW: Alchemy power managment code.
Message-ID: <20080328133243.GA7429@linux-mips.org>
References: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF804@dealogicserver.DEALogic.nl> <47E7B970.30105@ru.mvista.com> <47E7BB4B.3080507@ru.mvista.com> <20080327223134.GA26997@linux-mips.org> <47ECD828.8090600@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <47ECD828.8090600@ru.mvista.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
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: 18692
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: 398
Lines: 10

On Fri, Mar 28, 2008 at 02:36:08PM +0300, Sergei Shtylyov wrote:

>    The Alchemy code doesn't even try to use CP0 counter when CONFIG_PM=y if 
> you look into arch/mips/au1000/common/time.c... or at least it didn't 
> before Atsushi removed do_fast_pm_gettimeoffset().

That decission is now done by the generic time.c based only on the
availability of a counter and the mfc0 $count bug.

  Ralf

From ths@networkno.de Fri Mar 28 14:43:49 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Mar 2008 14:43:53 +0100 (CET)
Received: from relay01.mx.bawue.net ([193.7.176.67]:15835 "EHLO
	relay01.mx.bawue.net") by lappi.linux-mips.net with ESMTP
	id S528721AbYC1Nnt (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 28 Mar 2008 14:43:49 +0100
Received: from lagash (intrt.mips-uk.com [194.74.144.130])
	(using TLSv1 with cipher AES256-SHA (256/256 bits))
	(No client certificate requested)
	by relay01.mx.bawue.net (Postfix) with ESMTP id 4119548918;
	Fri, 28 Mar 2008 14:43:18 +0100 (CET)
Received: from ths by lagash with local (Exim 4.69)
	(envelope-from <ths@networkno.de>)
	id 1JfErV-000643-D9; Fri, 28 Mar 2008 13:43:17 +0000
Date:	Fri, 28 Mar 2008 13:43:17 +0000
From:	Thiemo Seufer <ths@networkno.de>
To:	Larry Stefani <lstefani@yahoo.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: SB1250 locking up in init on current 2.6.16 kernel
Message-ID: <20080328134317.GA21099@networkno.de>
References: <20080324203311.GB15294@linux-mips.org> <926775.30590.qm@web38810.mail.mud.yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <926775.30590.qm@web38810.mail.mud.yahoo.com>
User-Agent: Mutt/1.5.17+20080114 (2008-01-14)
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: 18693
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: 618
Lines: 18

Larry Stefani wrote:
> Hi Ralf,
> 
> I used git bisect and narrowed the lockup to the
> "[MIPS] Retire flush_icache_page from mm use." patch
> (see git results below).  This is consistent with my
> earlier testing and what Thiemo reported March 3 on
> the linux.debian.kernel list.  I tried his patch (mark
> pages tainted by PIO IDE as dirty) on 2.6.16.60, but
> it didn't prevent the lockup.

ISTR I got 2.6.16.60 to work by always enabling the cache flush in
ide.h (it is currently only run to clean out aliases). Keep in mind
that this is a crude workaround on top of other cache code hacks for
the SB-1.


Thiemo

From anemo@mba.ocn.ne.jp Fri Mar 28 15:26:06 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Mar 2008 15:26:14 +0100 (CET)
Received: from mba.ocn.ne.jp ([122.1.235.107]:21996 "EHLO smtp.mba.ocn.ne.jp")
	by lappi.linux-mips.net with ESMTP id S528733AbYC1O0G (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 28 Mar 2008 15:26:06 +0100
Received: from localhost (p8031-ipad209funabasi.chiba.ocn.ne.jp [58.88.119.31])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id A8DBEA9A2; Fri, 28 Mar 2008 23:24:44 +0900 (JST)
Date:	Fri, 28 Mar 2008 23:25:27 +0900 (JST)
Message-Id: <20080328.232527.72707102.anemo@mba.ocn.ne.jp>
To:	sshtylyov@ru.mvista.com
Cc:	ralf@linux-mips.org, linux-mips@linux-mips.org, ncoesel@DEALogic.nl
Subject: Re: Alchemy power managment code.
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <47ECD828.8090600@ru.mvista.com>
References: <47E7BB4B.3080507@ru.mvista.com>
	<20080327223134.GA26997@linux-mips.org>
	<47ECD828.8090600@ru.mvista.com>
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 5.2 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: 18694
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: 1120
Lines: 37

On Fri, 28 Mar 2008 14:36:08 +0300, Sergei Shtylyov <sshtylyov@ru.mvista.com> wrote:
> > Correct - and cevt-r4k won't be usable either.  I guess that means you
> > leave the user the choice between either these two or using wait.  Not
> > nice but ...
> 
>     The Alchemy code doesn't even try to use CP0 counter when CONFIG_PM=y if 
> you look into arch/mips/au1000/common/time.c... or at least it didn't before 
> Atsushi removed do_fast_pm_gettimeoffset().

Oh, yes. At that time I tried to implement clocksource drivers for
non-standard timers, but it seems I had missied Alchemy PM=y case.

The driver would be something like this?  Completely untested ;-)

static cycle_t au1000_hpt_read(void)
{
	return au_readl(SYS_TOYREAD);
}

struct clocksource au1000_clocksource = {
	.name	= "au1000-counter",
	.rating	= 200,
	.read	= au1000_hpt_read,
	.mask	= CLOCKSOURCE_MASK(32),
	.flags	= CLOCK_SOURCE_IS_CONTINUOUS,
};

void __init au1000_clocksource_init(unsinged long cpu_speed)
{
	struct clocksource *cs = &au1000_clocksource;

	clocksource_set_clock(cs, cpu_speed);
	clocksource_register(cs);
}

---
Atsushi Nemoto

From sshtylyov@ru.mvista.com Fri Mar 28 16:13:46 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Mar 2008 16:13:52 +0100 (CET)
Received: from h155.mvista.com ([63.81.120.155]:8567 "EHLO imap.sh.mvista.com")
	by lappi.linux-mips.net with ESMTP id S528798AbYC1PNq (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 28 Mar 2008 16:13:46 +0100
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id 4F0203ECB; Fri, 28 Mar 2008 08:13:12 -0700 (PDT)
Message-ID: <47ED0B5C.9060003@ru.mvista.com>
Date:	Fri, 28 Mar 2008 18:14:36 +0300
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
X-Accept-Language: ru, en-us, en-gb
MIME-Version: 1.0
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	ralf@linux-mips.org, linux-mips@linux-mips.org, ncoesel@DEALogic.nl
Subject: Re: Alchemy power managment code.
References: <47E7BB4B.3080507@ru.mvista.com>	<20080327223134.GA26997@linux-mips.org>	<47ECD828.8090600@ru.mvista.com> <20080328.232527.72707102.anemo@mba.ocn.ne.jp>
In-Reply-To: <20080328.232527.72707102.anemo@mba.ocn.ne.jp>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@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: 18695
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1250
Lines: 46

Hello.

Atsushi Nemoto wrote:

>>>Correct - and cevt-r4k won't be usable either.  I guess that means you
>>>leave the user the choice between either these two or using wait.  Not
>>>nice but ...

>>    The Alchemy code doesn't even try to use CP0 counter when CONFIG_PM=y if 
>>you look into arch/mips/au1000/common/time.c... or at least it didn't before 
>>Atsushi removed do_fast_pm_gettimeoffset().

> Oh, yes. At that time I tried to implement clocksource drivers for
> non-standard timers, but it seems I had missied Alchemy PM=y case.

> The driver would be something like this?  Completely untested ;-)

> static cycle_t au1000_hpt_read(void)
> {
> 	return au_readl(SYS_TOYREAD);
> }

> struct clocksource au1000_clocksource = {
> 	.name	= "au1000-counter",
> 	.rating	= 200,

    Rating should be greater than that of CP0 counter...

> 	.read	= au1000_hpt_read,
> 	.mask	= CLOCKSOURCE_MASK(32),
> 	.flags	= CLOCK_SOURCE_IS_CONTINUOUS,
> };

> void __init au1000_clocksource_init(unsinged long cpu_speed)
> {
> 	struct clocksource *cs = &au1000_clocksource;
> 
> 	clocksource_set_clock(cs, cpu_speed);

    Not really, it's clocked by 32768 Hz input, so probably not very good as a 
clocksource.

> 	clocksource_register(cs);
> }

WBR, Sergei

From ncoesel@DEALogic.nl Fri Mar 28 17:04:40 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Mar 2008 17:04:46 +0100 (CET)
Received: from smtp-vbr5.xs4all.nl ([194.109.24.25]:16143 "EHLO
	smtp-vbr5.xs4all.nl") by lappi.linux-mips.net with ESMTP
	id S528876AbYC1QEj convert rfc822-to-8bit (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 28 Mar 2008 17:04:39 +0100
Received: from dealogic.nl (a62-251-87-113.adsl.xs4all.nl [62.251.87.113])
	by smtp-vbr5.xs4all.nl (8.13.8/8.13.8) with ESMTP id m2SG40he045506;
	Fri, 28 Mar 2008 17:04:05 +0100 (CET)
	(envelope-from ncoesel@DEALogic.nl)
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 8BIT
Subject: RE: Alchemy power managment code.
Date:	Fri, 28 Mar 2008 17:03:59 +0100
Message-ID: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF9A2@dealogicserver.DEALogic.nl>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Alchemy power managment code.
thread-index: AciQ5j564zLnauoESYeKcee2Jr0aAQAAFnjQ
From:	"Nico Coesel" <ncoesel@DEALogic.nl>
To:	"Sergei Shtylyov" <sshtylyov@ru.mvista.com>,
	"Atsushi Nemoto" <anemo@mba.ocn.ne.jp>
Cc:	<ralf@linux-mips.org>, <linux-mips@linux-mips.org>
X-Virus-Scanned: by XS4ALL Virus Scanner
Return-Path: <ncoesel@DEALogic.nl>
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: 18696
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: ncoesel@DEALogic.nl
Precedence: bulk
X-list: linux-mips
Content-Length: 1756
Lines: 55

> -----Oorspronkelijk bericht-----
> Van: Sergei Shtylyov [mailto:sshtylyov@ru.mvista.com] 
> Verzonden: vrijdag 28 maart 2008 16:15
> Aan: Atsushi Nemoto
> CC: ralf@linux-mips.org; linux-mips@linux-mips.org; Nico Coesel
> Onderwerp: Re: Alchemy power managment code.
> 
> Hello.
> 
> Atsushi Nemoto wrote:
> 
> >>>Correct - and cevt-r4k won't be usable either.  I guess that means 
> >>>you leave the user the choice between either these two or 
> using wait.  
> >>>Not nice but ...
> 
> >>    The Alchemy code doesn't even try to use CP0 counter when 
> >>CONFIG_PM=y if you look into 
> arch/mips/au1000/common/time.c... or at 
> >>least it didn't before Atsushi removed do_fast_pm_gettimeoffset().
> 
> > Oh, yes. At that time I tried to implement clocksource drivers for 
> > non-standard timers, but it seems I had missied Alchemy PM=y case.
> 
> > The driver would be something like this?  Completely untested ;-)
> 
> > static cycle_t au1000_hpt_read(void)
> > {
> > 	return au_readl(SYS_TOYREAD);
> > }
> 
> > struct clocksource au1000_clocksource = {
> > 	.name	= "au1000-counter",
> > 	.rating	= 200,
> 
>     Rating should be greater than that of CP0 counter...
> 
> > 	.read	= au1000_hpt_read,
> > 	.mask	= CLOCKSOURCE_MASK(32),
> > 	.flags	= CLOCK_SOURCE_IS_CONTINUOUS,
> > };
> 
> > void __init au1000_clocksource_init(unsinged long cpu_speed) {
> > 	struct clocksource *cs = &au1000_clocksource;
> > 
> > 	clocksource_set_clock(cs, cpu_speed);
> 
>     Not really, it's clocked by 32768 Hz input, so probably 
> not very good as a clocksource.

Why not? If a 32768Hz watch crystal is connected then you'll have a
stable clocksource. IIRC watch crystals are more precise than the
crystals used to generate the core frequency.
 
Nico Coesel

From sshtylyov@ru.mvista.com Fri Mar 28 17:12:19 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Mar 2008 17:12:25 +0100 (CET)
Received: from h155.mvista.com ([63.81.120.155]:26489 "EHLO imap.sh.mvista.com")
	by lappi.linux-mips.net with ESMTP id S528891AbYC1QMT (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 28 Mar 2008 17:12:19 +0100
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id D81153ECA; Fri, 28 Mar 2008 09:11:44 -0700 (PDT)
Message-ID: <47ED1915.6040506@ru.mvista.com>
Date:	Fri, 28 Mar 2008 19:13:09 +0300
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
X-Accept-Language: ru, en-us, en-gb
MIME-Version: 1.0
To:	Nico Coesel <ncoesel@DEALogic.nl>
Cc:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>, ralf@linux-mips.org,
	linux-mips@linux-mips.org
Subject: Re: Alchemy power managment code.
References: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF9A2@dealogicserver.DEALogic.nl>
In-Reply-To: <19CA9E279FDA5246B7D7A1C91A4AF7F40EF9A2@dealogicserver.DEALogic.nl>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@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: 18697
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: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1594
Lines: 53

Nico Coesel wrote:

>>>>>Correct - and cevt-r4k won't be usable either.  I guess that means 
>>>>>you leave the user the choice between either these two or using wait.  

>>>>>Not nice but ...

>>>>   The Alchemy code doesn't even try to use CP0 counter when 
>>>>CONFIG_PM=y if you look into 

>>arch/mips/au1000/common/time.c... or at 

>>>>least it didn't before Atsushi removed do_fast_pm_gettimeoffset().

>>>Oh, yes. At that time I tried to implement clocksource drivers for 
>>>non-standard timers, but it seems I had missied Alchemy PM=y case.

>>>The driver would be something like this?  Completely untested ;-)

>>>static cycle_t au1000_hpt_read(void)
>>>{
>>>	return au_readl(SYS_TOYREAD);
>>>}

>>>struct clocksource au1000_clocksource = {
>>>	.name	= "au1000-counter",
>>>	.rating	= 200,

>>    Rating should be greater than that of CP0 counter...

>>>	.read	= au1000_hpt_read,
>>>	.mask	= CLOCKSOURCE_MASK(32),
>>>	.flags	= CLOCK_SOURCE_IS_CONTINUOUS,
>>>};

>>>void __init au1000_clocksource_init(unsinged long cpu_speed) {
>>>	struct clocksource *cs = &au1000_clocksource;
>>>
>>>	clocksource_set_clock(cs, cpu_speed);

>>    Not really, it's clocked by 32768 Hz input, so probably 
>>not very good as a clocksource.

> Why not? If a 32768Hz watch crystal is connected then you'll have a
> stable clocksource. IIRC watch crystals are more precise than the
> crystals used to generate the core frequency.

    32 KHz is too low a frequency. The same goes about using TOY as a 
clockevent -- HRT boasts microsecond resoultion which TOY can't provide.

> Nico Coesel

WBR, Sergei

From lstefani@yahoo.com Fri Mar 28 17:39:17 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Mar 2008 17:39:21 +0100 (CET)
Received: from web38813.mail.mud.yahoo.com ([209.191.125.104]:28782 "HELO
	web38813.mail.mud.yahoo.com") by lappi.linux-mips.net with SMTP
	id S528921AbYC1QjR (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 28 Mar 2008 17:39:17 +0100
Received: (qmail 71770 invoked by uid 60001); 28 Mar 2008 16:38:12 -0000
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
  s=s1024; d=yahoo.com;
  h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID;
  b=Fmv1M4lH6f87HeG+Na6+WyCIKzNkWqBYwmXAvY7VJM9ZlEBda57wFaHIKFDEiBcKObkvGoKoxsIMMHoMoKeaZqswoEoEqdIGJfef8cigj8l724hJ6BAONvUT0GNTbX1vjfLIMyhInxE4r3Is2IX2Ekb2dLEOILVrCDJd0oD8Bac=;
X-YMail-OSG: 9H.BJv4VM1lFrrM7I7gYqqm_1eu1EURTDzRmGZZF
Received: from [68.236.82.170] by web38813.mail.mud.yahoo.com via HTTP; Fri, 28 Mar 2008 09:38:11 PDT
Date:	Fri, 28 Mar 2008 09:38:11 -0700 (PDT)
From:	Larry Stefani <lstefani@yahoo.com>
Subject: Re: SB1250 locking up in init on current 2.6.16 kernel
To:	Thiemo Seufer <ths@networkno.de>
Cc:	linux-mips@linux-mips.org
In-Reply-To: <20080328134317.GA21099@networkno.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Message-ID: <54971.71316.qm@web38813.mail.mud.yahoo.com>
Return-Path: <lstefani@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: 18698
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: lstefani@yahoo.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1541
Lines: 60

Hi Thiemo,

I applied your patch (from
http://www.linux-mips.org/archives/linux-mips/2008-03/msg00001.html)
on 2.6.16.60, and also patched arch/mips/mm/c-sb1.c to
remove:

          local_flush_data_cache_page = (void *)
sb1_nop;

in order to compile after your changes to cache.c and
cacheflush.h.  However, this did not work on my board,
and I experienced the same lockup as before.

>>Keep in mind that this is a crude workaround on top
of other cache code hacks for the SB-1.

What other "cache code hacks for SB-1"?  Are there
additional changes required to 2.6.16.60 to make SB1
work properly?  Did you post those hacks somewhere?

Thanks,
Larry


--- Thiemo Seufer <ths@networkno.de> wrote:

> Larry Stefani wrote:
> > Hi Ralf,
> > 
> > I used git bisect and narrowed the lockup to the
> > "[MIPS] Retire flush_icache_page from mm use."
> patch
> > (see git results below).  This is consistent with
> my
> > earlier testing and what Thiemo reported March 3
> on
> > the linux.debian.kernel list.  I tried his patch
> (mark
> > pages tainted by PIO IDE as dirty) on 2.6.16.60,
> but
> > it didn't prevent the lockup.
> 
> ISTR I got 2.6.16.60 to work by always enabling the
> cache flush in
> ide.h (it is currently only run to clean out
> aliases). Keep in mind
> that this is a crude workaround on top of other
> cache code hacks for
> the SB-1.
> 
> 
> Thiemo
> 



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

From ths@networkno.de Fri Mar 28 18:12:18 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Mar 2008 18:12:22 +0100 (CET)
Received: from relay01.mx.bawue.net ([193.7.176.67]:13993 "EHLO
	relay01.mx.bawue.net") by lappi.linux-mips.net with ESMTP
	id S528957AbYC1RMS (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 28 Mar 2008 18:12:18 +0100
Received: from lagash (intrt.mips-uk.com [194.74.144.130])
	(using TLSv1 with cipher AES256-SHA (256/256 bits))
	(No client certificate requested)
	by relay01.mx.bawue.net (Postfix) with ESMTP id 33E7E48916;
	Fri, 28 Mar 2008 18:11:47 +0100 (CET)
Received: from ths by lagash with local (Exim 4.69)
	(envelope-from <ths@networkno.de>)
	id 1JfI7G-0004uD-8Y; Fri, 28 Mar 2008 17:11:46 +0000
Date:	Fri, 28 Mar 2008 17:11:46 +0000
From:	Thiemo Seufer <ths@networkno.de>
To:	Larry Stefani <lstefani@yahoo.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: SB1250 locking up in init on current 2.6.16 kernel
Message-ID: <20080328171146.GA23320@networkno.de>
References: <20080328134317.GA21099@networkno.de> <54971.71316.qm@web38813.mail.mud.yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <54971.71316.qm@web38813.mail.mud.yahoo.com>
User-Agent: Mutt/1.5.17+20080114 (2008-01-14)
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: 18699
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: 1058
Lines: 35

Larry Stefani wrote:
> Hi Thiemo,
> 
> I applied your patch (from
> http://www.linux-mips.org/archives/linux-mips/2008-03/msg00001.html)
> on 2.6.16.60, and also patched arch/mips/mm/c-sb1.c to
> remove:
> 
>           local_flush_data_cache_page = (void *)
> sb1_nop;
> 
> in order to compile after your changes to cache.c and
> cacheflush.h.  However, this did not work on my board,
> and I experienced the same lockup as before.

Stick with the original 2.6.16.60 code but try to remove the

   if (cpu_has_dc_aliases) {

conditional in ide.h _without_ using my patch. This is what made
it boot for me.

> >>Keep in mind that this is a crude workaround on top
> of other cache code hacks for the SB-1.
> 
> What other "cache code hacks for SB-1"?  Are there
> additional changes required to 2.6.16.60 to make SB1
> work properly?  Did you post those hacks somewhere?

No, what I meant to say is that the old sb-1 cache code isn't quite
the most trustibe code, it had some holes which were papered over
by doing more cache flushes than necessary.


Thiemo

From flo@rfc822.org Sat Mar 29 10:59:45 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 29 Mar 2008 10:59:50 +0100 (CET)
Received: from hydra.gt.owl.de ([195.71.99.218]:38336 "EHLO hydra.gt.owl.de")
	by lappi.linux-mips.net with ESMTP id S529923AbYC2J7p (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sat, 29 Mar 2008 10:59:45 +0100
Received: by hydra.gt.owl.de (Postfix, from userid 1000)
	id B812C32EC6; Sat, 29 Mar 2008 10:59:14 +0100 (CET)
Date:	Sat, 29 Mar 2008 10:59:14 +0100
From:	Florian Lohoff <flo@rfc822.org>
To:	Matteo Croce <technoboy85@gmail.com>
Cc:	linux-mips@linux-mips.org, Eugene Konev <ejka@imfi.kspu.ru>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH][MIPS][3/6]: AR7: VLYNQ bus
Message-ID: <20080329095914.GA18263@paradigm.rfc822.org>
References: <200803120221.25044.technoboy85@gmail.com> <200803120226.42795.technoboy85@gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="qDbXVdCdHGoSgWSk"
Content-Disposition: inline
In-Reply-To: <200803120226.42795.technoboy85@gmail.com>
Organization: rfc822 - pure communication
X-SpiderMe: mh-200803291051@listme.rfc822.org
User-Agent: Mutt/1.5.13 (2006-08-11)
Return-Path: <flo@rfc822.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: 18702
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: flo@rfc822.org
Precedence: bulk
X-list: linux-mips
Content-Length: 2151
Lines: 66


--qDbXVdCdHGoSgWSk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable


Hi Matteo,

On Wed, Mar 12, 2008 at 02:26:42AM +0100, Matteo Croce wrote:
> +	switch (dev->divisor) {
> +	case vlynq_div_auto:
> +		/* Only try locally supplied clock, others cause problems */

i have a platform (AR7VWi - Leonardo Board) which has an external
supplied clock from an ACX111 so the div_auto autoprobing will not work.

I put the vlynq_div_external code in front of this which should
simply listen on the vlynq if there is a clock and use it. This solved
one of the issues for me. Can you elaborate on the above comment where
caused problems? I have seen multiple implementations of this, all of
them did autoprobing first by listening on the remote clock first.

> +		vlynq_reg_write(dev->remote->control, 0);
> +		for (i =3D vlynq_ldiv2; i <=3D vlynq_ldiv8; i++) {
> +			vlynq_reg_write(dev->local->control,
> +					VLYNQ_CTRL_CLOCK_INT |
> +					VLYNQ_CTRL_CLOCK_DIV(i - vlynq_ldiv1));
> +			if (vlynq_linked(dev)) {
> +				printk(KERN_DEBUG
> +				       "%s: using local clock divisor %d\n",
> +				       dev->dev.bus_id, i - vlynq_ldiv1 + 1);
> +				dev->divisor =3D i;
> +				return 0;
> +			}
> +		}

What i found in the TI code is that FIRST the local->control needs to
get set before issueing a remote access so shouldnd the=20

	vlynq_reg_write(dev->remote ... )

move behind the dev->local ? I mean the logic is to set a local clock
divisor - try to access something on the remote end and see if the link
got up ?!?

Flo
--=20
Florian Lohoff                  flo@rfc822.org             +49-171-2280134
	Those who would give up a little freedom to get a little=20
          security shall soon have neither - Benjamin Franklin

--qDbXVdCdHGoSgWSk
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFH7hLyUaz2rXW+gJcRAvm3AKCkLYLyJHPf+Z6xQ6VQYPMt20QNxQCdHEsZ
70YFvI1TMCRmgJORfmW9zuo=
=spvi
-----END PGP SIGNATURE-----

--qDbXVdCdHGoSgWSk--

From flo@rfc822.org Sat Mar 29 11:34:58 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 29 Mar 2008 11:35:03 +0100 (CET)
Received: from hydra.gt.owl.de ([195.71.99.218]:27619 "EHLO hydra.gt.owl.de")
	by lappi.linux-mips.net with ESMTP id S529939AbYC2Ke6 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sat, 29 Mar 2008 11:34:58 +0100
Received: by hydra.gt.owl.de (Postfix, from userid 1000)
	id 3925A32ED3; Sat, 29 Mar 2008 11:34:27 +0100 (CET)
Date:	Sat, 29 Mar 2008 11:34:27 +0100
From:	Florian Lohoff <flo@rfc822.org>
To:	Matteo Croce <technoboy85@gmail.com>
Cc:	linux-mips@linux-mips.org, Florian Fainelli <florian@openwrt.org>,
	Felix Fietkau <nbd@openwrt.org>,
	Eugene Konev <ejka@imfi.kspu.ru>,
	Nicolas Thill <nico@openwrt.org>, ralf@linux-mips.org
Subject: Re: [PATCH][MIPS][1/6]: AR7: core
Message-ID: <20080329103427.GA19501@paradigm.rfc822.org>
References: <200803120221.25044.technoboy85@gmail.com> <200803121906.25546.technoboy85@gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="NzB8fVQJ5HfG6fxh"
Content-Disposition: inline
In-Reply-To: <200803121906.25546.technoboy85@gmail.com>
Organization: rfc822 - pure communication
X-SpiderMe: mh-200803291103@listme.rfc822.org
User-Agent: Mutt/1.5.13 (2006-08-11)
Return-Path: <flo@rfc822.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: 18703
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: flo@rfc822.org
Precedence: bulk
X-list: linux-mips
Content-Length: 2755
Lines: 96


--NzB8fVQJ5HfG6fxh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi,

On Wed, Mar 12, 2008 at 07:06:25PM +0100, Matteo Croce wrote:
>=20
> Sorry but the linux-mips mailing list can't accept this patch for unknown=
 reasons.
> I'll send a gz file, that will work

i have a plattform AR7VWi which has a High Active reset for the
vlynq_low so the code is not sufficient to get the ACX up and running

+static struct plat_vlynq_data vlynq_low_data =3D {
+       .ops.on =3D vlynq_on,
+       .ops.off =3D vlynq_off,
+       .reset_bit =3D 20,
+       .gpio_bit =3D 18,
+};
+
+static struct plat_vlynq_data vlynq_high_data =3D {
+       .ops.on =3D vlynq_on,
+       .ops.off =3D vlynq_off,
+       .reset_bit =3D 16,
+       .gpio_bit =3D 19,
+};

The gpio_bit's are okay but they are high active so the generic code:

+static int vlynq_on(struct vlynq_device *dev)
+{
+       int result;
+       struct plat_vlynq_data *pdata =3D dev->dev.platform_data;
+
+       if ((result =3D gpio_request(pdata->gpio_bit, "vlynq")))
+               goto out;
+
+       ar7_device_reset(pdata->reset_bit);
+
+       if ((result =3D ar7_gpio_disable(pdata->gpio_bit)))
+               goto out_enabled;
+
+       if ((result =3D ar7_gpio_enable(pdata->gpio_bit)))
+               goto out_enabled;
+
+       if ((result =3D gpio_direction_output(pdata->gpio_bit, 0)))
+               goto out_gpio_enabled;
+
+       mdelay(50);
+
+       gpio_set_value(pdata->gpio_bit, 1);

Is not enough here - gpios might be reverse polarity ... The right thing
to actually reset a device would need a toggle not a static state.

+       mdelay(50);
+
+       return 0;


+static void vlynq_off(struct vlynq_device *dev)
+{
+       struct plat_vlynq_data *pdata =3D dev->dev.platform_data;
+       ar7_gpio_disable(pdata->gpio_bit);
+       gpio_free(pdata->gpio_bit);
+       ar7_device_disable(pdata->reset_bit);
+}

gpio_disable to gpio_bit will put the gpio to tristate or special function
which will lead to unpredicted results. So gpio_set_value would be needed
and then the same as for vlynq_on applies concerning the reverse polarity.

Flo
--=20
Florian Lohoff                  flo@rfc822.org             +49-171-2280134
	Those who would give up a little freedom to get a little=20
          security shall soon have neither - Benjamin Franklin

--NzB8fVQJ5HfG6fxh
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFH7hszUaz2rXW+gJcRAgFiAKCHUgxHWb+gKMtdoFVFPkWeO5XGVACgtSqI
XEmQ8hLk+gbC4nAJ63HnEP8=
=qLLm
-----END PGP SIGNATURE-----

--NzB8fVQJ5HfG6fxh--

From bunk@kernel.org Mon Mar 31 00:42:14 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 31 Mar 2008 00:42:22 +0200 (CEST)
Received: from [213.243.153.39] ([213.243.153.39]:11471 "EHLO smtp5.pp.htv.fi")
	by lappi.linux-mips.net with ESMTP id S531865AbYC3WmO (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 31 Mar 2008 00:42:14 +0200
Received: from cs181133002.pp.htv.fi (cs181133002.pp.htv.fi [82.181.133.2])
	by smtp5.pp.htv.fi (Postfix) with ESMTP id C6D775BC044;
	Mon, 31 Mar 2008 01:40:36 +0300 (EEST)
Date:	Mon, 31 Mar 2008 01:40:25 +0300
From:	Adrian Bunk <bunk@kernel.org>
To:	ralf@linux-mips.org
Cc:	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: [2.6 patch] mips: remove MIPS_XXS1500
Message-ID: <20080330224025.GF28445@cs181133002.pp.htv.fi>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
User-Agent: Mutt/1.5.17+20080114 (2008-01-14)
Return-Path: <bunk@kernel.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: 18710
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@kernel.org
Precedence: bulk
X-list: linux-mips
Content-Length: 16916
Lines: 548

MIPS_XXS1500 has several compile problems like e.g. the
#include <asm/keyboard.h> in arch/mips/au1000/xxs1500/board_setup.c 
having been broken by the removal of this header back in February 2004.

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---

 arch/mips/Makefile                     |    6 
 arch/mips/au1000/Kconfig               |    6 
 arch/mips/au1000/xxs1500/Makefile      |    9 -
 arch/mips/au1000/xxs1500/board_setup.c |   90 -----------
 arch/mips/au1000/xxs1500/init.c        |   63 --------
 arch/mips/au1000/xxs1500/irqmap.c      |   66 --------
 drivers/pcmcia/Makefile                |    1 
 drivers/pcmcia/au1000_generic.c        |    4 
 drivers/pcmcia/au1000_xxs1500.c        |  191 -------------------------
 9 files changed, 436 deletions(-)

42b527239af5ad2acfc98fba35699f241dac796e diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 72097da..88e4cd6 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -270,12 +270,6 @@ libs-$(CONFIG_MIPS_MTX1)	+= arch/mips/au1000/mtx-1/
 load-$(CONFIG_MIPS_MTX1)	+= 0xffffffff80100000
 
 #
-# MyCable eval board
-#
-libs-$(CONFIG_MIPS_XXS1500)	+= arch/mips/au1000/xxs1500/
-load-$(CONFIG_MIPS_XXS1500)	+= 0xffffffff80100000
-
-#
 # Cobalt Server
 #
 core-$(CONFIG_MIPS_COBALT)	+= arch/mips/cobalt/
diff --git a/arch/mips/au1000/Kconfig b/arch/mips/au1000/Kconfig
index 1fe97cc..61b3122 100644
--- a/arch/mips/au1000/Kconfig
+++ b/arch/mips/au1000/Kconfig
@@ -97,12 +97,6 @@ config MIPS_PB1550
 	select MIPS_DISABLE_OBSOLETE_IDE
 	select SYS_SUPPORTS_LITTLE_ENDIAN
 
-config MIPS_XXS1500
-	bool "MyCable XXS1500 board"
-	select DMA_NONCOHERENT
-	select SOC_AU1500
-	select SYS_SUPPORTS_LITTLE_ENDIAN
-
 endchoice
 
 config SOC_AU1000
diff --git a/arch/mips/au1000/xxs1500/Makefile b/arch/mips/au1000/xxs1500/Makefile
deleted file mode 100644
index 44d7f70..0000000
--- a/arch/mips/au1000/xxs1500/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-#  Copyright 2003 MontaVista Software Inc.
-#  Author: MontaVista Software, Inc.
-#     	ppopov@mvista.com or source@mvista.com
-#
-# Makefile for MyCable XXS1500 board.
-#
-
-lib-y := init.o board_setup.o irqmap.o
diff --git a/arch/mips/au1000/xxs1500/board_setup.c b/arch/mips/au1000/xxs1500/board_setup.c
deleted file mode 100644
index a9237f4..0000000
--- a/arch/mips/au1000/xxs1500/board_setup.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 2000-2003 MontaVista Software Inc.
- * Author: MontaVista Software, Inc.
- *         	ppopov@mvista.com or source@mvista.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.
- *
- *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
- *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
- *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  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.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
-#include <linux/delay.h>
-
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/keyboard.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
-#include <asm/au1000.h>
-
-void board_reset(void)
-{
-	/* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
-	au_writel(0x00000000, 0xAE00001C);
-}
-
-void __init board_setup(void)
-{
-	u32 pin_func;
-
-	// set multiple use pins (UART3/GPIO) to UART (it's used as UART too)
-	pin_func = au_readl(SYS_PINFUNC) & (u32)(~SYS_PF_UR3);
-	pin_func |= SYS_PF_UR3;
-	au_writel(pin_func, SYS_PINFUNC);
-
-	// enable UART
-	au_writel(0x01, UART3_ADDR+UART_MOD_CNTRL); // clock enable (CE)
-	mdelay(10);
-	au_writel(0x03, UART3_ADDR+UART_MOD_CNTRL); // CE and "enable"
-	mdelay(10);
-
-	// enable DTR = USB power up
-	au_writel(0x01, UART3_ADDR+UART_MCR); //? UART_MCR_DTR is 0x01???
-
-#ifdef CONFIG_PCMCIA_XXS1500
-	/* setup pcmcia signals */
-	au_writel(0, SYS_PININPUTEN);
-
-	/* gpio 0, 1, and 4 are inputs */
-	au_writel(1 | (1<<1) | (1<<4), SYS_TRIOUTCLR);
-
-	/* enable GPIO2 if not already enabled */
-	au_writel(1, GPIO2_ENABLE);
-	/* gpio2 208/9/10/11 are inputs */
-	au_writel((1<<8) | (1<<9) | (1<<10) | (1<<11), GPIO2_DIR);
-
-	/* turn off power */
-	au_writel((au_readl(GPIO2_PINSTATE) & ~(1<<14))|(1<<30), GPIO2_OUTPUT);
-#endif
-
-
-#ifdef CONFIG_PCI
-#if defined(__MIPSEB__)
-	au_writel(0xf | (2<<6) | (1<<4), Au1500_PCI_CFG);
-#else
-	au_writel(0xf, Au1500_PCI_CFG);
-#endif
-#endif
-}
diff --git a/arch/mips/au1000/xxs1500/init.c b/arch/mips/au1000/xxs1500/init.c
deleted file mode 100644
index 7e6878c..0000000
--- a/arch/mips/au1000/xxs1500/init.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * BRIEF MODULE DESCRIPTION
- *	XXS1500 board setup
- *
- * Copyright 2003 MontaVista Software Inc.
- * Author: MontaVista Software, Inc.
- *         	ppopov@mvista.com or source@mvista.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.
- *
- *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
- *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
- *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  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.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
-#include <linux/kernel.h>
-
-#include <asm/addrspace.h>
-#include <asm/bootinfo.h>
-
-#include <prom.h>
-
-const char *get_system_type(void)
-{
-	return "XXS1500";
-}
-
-void __init prom_init(void)
-{
-	unsigned char *memsize_str;
-	unsigned long memsize;
-
-	prom_argc = fw_arg0;
-	prom_argv = (char **) fw_arg1;
-	prom_envp = (char **) fw_arg2;
-
-	prom_init_cmdline();
-
-	memsize_str = prom_getenv("memsize");
-	if (!memsize_str)
-		memsize = 0x04000000;
-	else
-		memsize = simple_strtol(memsize_str, NULL, 0);
-	add_memory_region(0, memsize, BOOT_MEM_RAM);
-}
diff --git a/arch/mips/au1000/xxs1500/irqmap.c b/arch/mips/au1000/xxs1500/irqmap.c
deleted file mode 100644
index 3893492..0000000
--- a/arch/mips/au1000/xxs1500/irqmap.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * BRIEF MODULE DESCRIPTION
- *	Au1xxx irq map table
- *
- * Copyright 2003 Embedded Edge, LLC
- *		dan@embeddededge.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.
- *
- *  THIS  SOFTWARE  IS PROVIDED	  ``AS	IS'' AND   ANY	EXPRESS OR IMPLIED
- *  WARRANTIES,	  INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- *  NO	EVENT  SHALL   THE AUTHOR  BE	 LIABLE FOR ANY	  DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED	  TO, PROCUREMENT OF  SUBSTITUTE GOODS	OR SERVICES; LOSS OF
- *  USE, DATA,	OR PROFITS; OR	BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- *  ANY THEORY OF LIABILITY, WHETHER IN	 CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  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.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include <linux/errno.h>
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/kernel_stat.h>
-#include <linux/module.h>
-#include <linux/signal.h>
-#include <linux/sched.h>
-#include <linux/types.h>
-#include <linux/interrupt.h>
-#include <linux/ioport.h>
-#include <linux/timex.h>
-#include <linux/slab.h>
-#include <linux/random.h>
-#include <linux/delay.h>
-#include <linux/bitops.h>
-
-#include <asm/bootinfo.h>
-#include <asm/io.h>
-#include <asm/mipsregs.h>
-#include <asm/system.h>
-#include <asm/au1000.h>
-
-struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
-	{ AU1500_GPIO_204, INTC_INT_HIGH_LEVEL, 0},
-	{ AU1500_GPIO_201, INTC_INT_LOW_LEVEL, 0 },
-	{ AU1500_GPIO_202, INTC_INT_LOW_LEVEL, 0 },
-	{ AU1500_GPIO_203, INTC_INT_LOW_LEVEL, 0 },
-	{ AU1500_GPIO_205, INTC_INT_LOW_LEVEL, 0 },
-	{ AU1500_GPIO_207, INTC_INT_LOW_LEVEL, 0 },
-
-	{ AU1000_GPIO_0, INTC_INT_LOW_LEVEL, 0 },
-	{ AU1000_GPIO_1, INTC_INT_LOW_LEVEL, 0 },
-	{ AU1000_GPIO_2, INTC_INT_LOW_LEVEL, 0 },
-	{ AU1000_GPIO_3, INTC_INT_LOW_LEVEL, 0 },
-	{ AU1000_GPIO_4, INTC_INT_LOW_LEVEL, 0 }, /* CF interrupt */
-	{ AU1000_GPIO_5, INTC_INT_LOW_LEVEL, 0 },
-};
-
-int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map);
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
index 6f6478b..e7623e0 100644
--- a/drivers/pcmcia/Makefile
+++ b/drivers/pcmcia/Makefile
@@ -52,7 +52,6 @@ au1x00_ss-$(CONFIG_MIPS_DB1100)			+= au1000_db1x00.o
 au1x00_ss-$(CONFIG_MIPS_DB1200)			+= au1000_db1x00.o
 au1x00_ss-$(CONFIG_MIPS_DB1500)			+= au1000_db1x00.o
 au1x00_ss-$(CONFIG_MIPS_DB1550)			+= au1000_db1x00.o
-au1x00_ss-$(CONFIG_MIPS_XXS1500)		+= au1000_xxs1500.o
 
 sa1111_cs-y					+= sa1111_generic.o
 sa1111_cs-$(CONFIG_ASSABET_NEPONSET)		+= sa1100_neponset.o
diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c
index b693367..398e3f2 100644
--- a/drivers/pcmcia/au1000_generic.c
+++ b/drivers/pcmcia/au1000_generic.c
@@ -407,7 +407,6 @@ int au1x00_pcmcia_socket_probe(struct device *dev, struct pcmcia_low_level *ops,
 			skt->phys_attr = AU1X_SOCK0_PSEUDO_PHYS_ATTR;
 			skt->phys_mem = AU1X_SOCK0_PSEUDO_PHYS_MEM;
 		}
-#ifndef CONFIG_MIPS_XXS1500
 		else  {
 			skt->virt_io = (void *)
 				(ioremap((phys_t)AU1X_SOCK1_IO, 0x1000) -
@@ -415,7 +414,6 @@ int au1x00_pcmcia_socket_probe(struct device *dev, struct pcmcia_low_level *ops,
 			skt->phys_attr = AU1X_SOCK1_PSEUDO_PHYS_ATTR;
 			skt->phys_mem = AU1X_SOCK1_PSEUDO_PHYS_MEM;
 		}
-#endif
 		pcmcia_base_vaddrs[i] = (u32 *)skt->virt_io;
 		ret = ops->hw_init(skt);
 
@@ -453,12 +451,10 @@ out_err:
 			iounmap(skt->virt_io + (u32)mips_io_port_base);
 			skt->virt_io = NULL;
 		}
-#ifndef CONFIG_MIPS_XXS1500
 		else {
 			iounmap(skt->virt_io + (u32)mips_io_port_base);
 			skt->virt_io = NULL;
 		}
-#endif
 		ops->hw_shutdown(skt);
 
 	}
diff --git a/drivers/pcmcia/au1000_xxs1500.c b/drivers/pcmcia/au1000_xxs1500.c
deleted file mode 100644
index ce9d5c4..0000000
--- a/drivers/pcmcia/au1000_xxs1500.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- *
- * MyCable board specific pcmcia routines.
- *
- * Copyright 2003 MontaVista Software Inc.
- * Author: Pete Popov, MontaVista Software, Inc.
- *         	ppopov@mvista.com or source@mvista.com
- *
- * ########################################################################
- *
- *  This program is free software; you can distribute it and/or modify it
- *  under the terms of the GNU General Public License (Version 2) as
- *  published by the Free Software Foundation.
- *
- *  This program is distributed in the hope 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/module.h>
-#include <linux/init.h>
-#include <linux/delay.h>
-#include <linux/ioport.h>
-#include <linux/kernel.h>
-#include <linux/tqueue.h>
-#include <linux/timer.h>
-#include <linux/mm.h>
-#include <linux/proc_fs.h>
-#include <linux/types.h>
-
-#include <pcmcia/cs_types.h>
-#include <pcmcia/cs.h>
-#include <pcmcia/ss.h>
-#include <pcmcia/bulkmem.h>
-#include <pcmcia/cistpl.h>
-#include <pcmcia/bus_ops.h>
-#include "cs_internal.h"
-
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/system.h>
-
-#include <asm/au1000.h>
-#include <asm/au1000_pcmcia.h>
-
-#define PCMCIA_MAX_SOCK		0
-#define PCMCIA_NUM_SOCKS	(PCMCIA_MAX_SOCK + 1)
-#define PCMCIA_IRQ		AU1000_GPIO_4
-
-#if 0
-#define DEBUG(x,args...)	printk(__FUNCTION__ ": " x,##args)
-#else
-#define DEBUG(x,args...)
-#endif
-
-static int xxs1500_pcmcia_init(struct pcmcia_init *init)
-{
-	return PCMCIA_NUM_SOCKS;
-}
-
-static int xxs1500_pcmcia_shutdown(void)
-{
-	/* turn off power */
-	au_writel(au_readl(GPIO2_PINSTATE) | (1<<14)|(1<<30),
-			GPIO2_OUTPUT);
-	au_sync_delay(100);
-
-	/* assert reset */
-	au_writel(au_readl(GPIO2_PINSTATE) | (1<<4)|(1<<20),
-			GPIO2_OUTPUT);
-	au_sync_delay(100);
-	return 0;
-}
-
-
-static int
-xxs1500_pcmcia_socket_state(unsigned sock, struct pcmcia_state *state)
-{
-	u32 inserted; u32 vs;
-	unsigned long gpio, gpio2;
-
-	if(sock > PCMCIA_MAX_SOCK) return -1;
-
-	gpio = au_readl(SYS_PINSTATERD);
-	gpio2 = au_readl(GPIO2_PINSTATE);
-
-	vs = gpio2 & ((1<<8) | (1<<9));
-	inserted = (!(gpio & 0x1) && !(gpio & 0x2));
-
-	state->ready = 0;
-	state->vs_Xv = 0;
-	state->vs_3v = 0;
-	state->detect = 0;
-
-	if (inserted) {
-		switch (vs) {
-			case 0:
-			case 1:
-			case 2:
-				state->vs_3v=1;
-				break;
-			case 3: /* 5V */
-			default:
-				/* return without setting 'detect' */
-				printk(KERN_ERR "au1x00_cs: unsupported VS\n",
-						vs);
-				return;
-		}
-		state->detect = 1;
-	}
-
-	if (state->detect) {
-		state->ready = 1;
-	}
-
-	state->bvd1= gpio2 & (1<<10);
-	state->bvd2 = gpio2 & (1<<11);
-	state->wrprot=0;
-	return 1;
-}
-
-
-static int xxs1500_pcmcia_get_irq_info(struct pcmcia_irq_info *info)
-{
-
-	if(info->sock > PCMCIA_MAX_SOCK) return -1;
-	info->irq = PCMCIA_IRQ;
-	return 0;
-}
-
-
-static int
-xxs1500_pcmcia_configure_socket(const struct pcmcia_configure *configure)
-{
-
-	if(configure->sock > PCMCIA_MAX_SOCK) return -1;
-
-	DEBUG("Vcc %dV Vpp %dV, reset %d\n",
-			configure->vcc, configure->vpp, configure->reset);
-
-	switch(configure->vcc){
-		case 33: /* Vcc 3.3V */
-			/* turn on power */
-			DEBUG("turn on power\n");
-			au_writel((au_readl(GPIO2_PINSTATE) & ~(1<<14))|(1<<30),
-					GPIO2_OUTPUT);
-			au_sync_delay(100);
-			break;
-		case 50: /* Vcc 5V */
-		default: /* what's this ? */
-			printk(KERN_ERR "au1x00_cs: unsupported VCC\n");
-		case 0:  /* Vcc 0 */
-			/* turn off power */
-			au_sync_delay(100);
-			au_writel(au_readl(GPIO2_PINSTATE) | (1<<14)|(1<<30),
-					GPIO2_OUTPUT);
-			break;
-	}
-
-	if (!configure->reset) {
-		DEBUG("deassert reset\n");
-		au_writel((au_readl(GPIO2_PINSTATE) & ~(1<<4))|(1<<20),
-				GPIO2_OUTPUT);
-		au_sync_delay(100);
-		au_writel((au_readl(GPIO2_PINSTATE) & ~(1<<5))|(1<<21),
-				GPIO2_OUTPUT);
-	}
-	else {
-		DEBUG("assert reset\n");
-		au_writel(au_readl(GPIO2_PINSTATE) | (1<<4)|(1<<20),
-				GPIO2_OUTPUT);
-	}
-	au_sync_delay(100);
-	return 0;
-}
-
-struct pcmcia_low_level xxs1500_pcmcia_ops = {
-	xxs1500_pcmcia_init,
-	xxs1500_pcmcia_shutdown,
-	xxs1500_pcmcia_socket_state,
-	xxs1500_pcmcia_get_irq_info,
-	xxs1500_pcmcia_configure_socket
-};


From lstefani@yahoo.com Mon Mar 31 04:03:29 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 31 Mar 2008 04:03:33 +0200 (CEST)
Received: from web38804.mail.mud.yahoo.com ([209.191.125.95]:42597 "HELO
	web38804.mail.mud.yahoo.com") by lappi.linux-mips.net with SMTP
	id S531983AbYCaCD3 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 31 Mar 2008 04:03:29 +0200
Received: (qmail 48216 invoked by uid 60001); 31 Mar 2008 02:02:12 -0000
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
  s=s1024; d=yahoo.com;
  h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID;
  b=bjjBYVO6w2d0i0B0D+PtzjTMzSx0bvRtKoQ7GP6RCGPmOksiopnC61ov+e9Adt5Z/xjY2Ycx6daTLKAG3IsIY3/j66oh7lMrh6VJejTJvbfK6cHLibS18wjNmuyepLC50PJ1N67EmSF+oX0Z6bAUC/Mg9nPE1JTdC1qC5ayg0yA=;
X-YMail-OSG: JArq3YwVM1l4iP64LHT.HfXo0BGUUC_Z9yr4gC5GA6vkM3r4lZga_85Gkjz1vDoDizRPhpelQWJIeDfIuU7IRFPBnGHZEbPULULv3e2BZEJKCBU-
Received: from [24.34.110.3] by web38804.mail.mud.yahoo.com via HTTP; Sun, 30 Mar 2008 19:02:12 PDT
Date:	Sun, 30 Mar 2008 19:02:12 -0700 (PDT)
From:	Larry Stefani <lstefani@yahoo.com>
Subject: Re: SB1250 locking up in init on current 2.6.16 kernel
To:	Thiemo Seufer <ths@networkno.de>
Cc:	linux-mips@linux-mips.org
In-Reply-To: <20080328171146.GA23320@networkno.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Message-ID: <117918.44850.qm@web38804.mail.mud.yahoo.com>
Return-Path: <lstefani@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: 18711
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: lstefani@yahoo.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1686
Lines: 71

Hi Thiemo,

I went back to 2.6.16.60, reverted your patch changes,
then removed the

  if (cpu_has_dc_aliases) {

conditional expression in three places in
include/asm-mips/mach-generic/ide.h.

Unfortunately, I get the same lockup as before.

- Larry

--- Thiemo Seufer <ths@networkno.de> wrote:

> Larry Stefani wrote:
> > Hi Thiemo,
> > 
> > I applied your patch (from
> >
>
http://www.linux-mips.org/archives/linux-mips/2008-03/msg00001.html)
> > on 2.6.16.60, and also patched
> arch/mips/mm/c-sb1.c to
> > remove:
> > 
> >           local_flush_data_cache_page = (void *)
> > sb1_nop;
> > 
> > in order to compile after your changes to cache.c
> and
> > cacheflush.h.  However, this did not work on my
> board,
> > and I experienced the same lockup as before.
> 
> Stick with the original 2.6.16.60 code but try to
> remove the
> 
>    if (cpu_has_dc_aliases) {
> 
> conditional in ide.h _without_ using my patch. This
> is what made
> it boot for me.
> 
> > >>Keep in mind that this is a crude workaround on
> top
> > of other cache code hacks for the SB-1.
> > 
> > What other "cache code hacks for SB-1"?  Are there
> > additional changes required to 2.6.16.60 to make
> SB1
> > work properly?  Did you post those hacks
> somewhere?
> 
> No, what I meant to say is that the old sb-1 cache
> code isn't quite
> the most trustibe code, it had some holes which were
> papered over
> by doing more cache flushes than necessary.
> 
> 
> Thiemo
> 




      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

