From lhrkernelcoder@gmail.com Sat Jul  1 07:32:27 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 01 Jul 2006 07:32:35 +0100 (BST)
Received: from ug-out-1314.google.com ([66.249.92.170]:59498 "EHLO
	ug-out-1314.google.com") by ftp.linux-mips.org with ESMTP
	id S8126580AbWGAGc1 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 1 Jul 2006 07:32:27 +0100
Received: by ug-out-1314.google.com with SMTP id u2so987074uge
        for <linux-mips@linux-mips.org>; Fri, 30 Jun 2006 23:32:26 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition;
        b=rERT6prcNcvq/PrKyEp27HNoqLP1OxqQ7EDVggeyYTgciQM+bBDEVhycbAMbhwX+fVlmbbmGuQZuUKixzPPv+jgnGrxWafd3hdFAeSiIiAToPWRLtFVSeulYz/WBc9LFE8yh46HkPKMQc4b/OoYhasK5pWw7cKgjawGBTdVAmsk=
Received: by 10.78.179.12 with SMTP id b12mr299388huf;
        Fri, 30 Jun 2006 23:32:26 -0700 (PDT)
Received: by 10.78.83.7 with HTTP; Fri, 30 Jun 2006 23:32:26 -0700 (PDT)
Message-ID: <f69849430606302332g227bbb51n5aec43d08f2886eb@mail.gmail.com>
Date:	Sat, 1 Jul 2006 11:32:26 +0500
From:	"kernel coder" <lhrkernelcoder@gmail.com>
To:	gcc@gcc.gnu.org, gcc-help@gcc.gnu.org, linux-mips@linux-mips.org
Subject: explaination of some gcc functions
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Return-Path: <lhrkernelcoder@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: 11894
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: lhrkernelcoder@gmail.com
Precedence: bulk
X-list: linux-mips

hi,
     I'm trying to understand the backend code of gcc for MIPS
architecture.I'm having some trouble while understanding following
functions.

1:  push_topmost_sequence();
2: emit_insn_after(seq,get_insns());
3: pop_topmost_sequence();
4: emit_insn_before

Would you please explain what's the role of each function.

From trix@specifix.com Sat Jul  1 13:55:56 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 01 Jul 2006 13:56:05 +0100 (BST)
Received: from w099.z064220152.sjc-ca.dsl.cnc.net ([64.220.152.99]:17539 "EHLO
	duck.specifix.com") by ftp.linux-mips.org with ESMTP
	id S3686984AbWGAMz4 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 1 Jul 2006 13:55:56 +0100
Received: from localhost.localdomain (duck.corp.specifix.com [192.168.1.1])
	by duck.specifix.com (Postfix) with ESMTP
	id 41892FC69; Sat,  1 Jul 2006 05:55:35 -0700 (PDT)
Date:	Sat, 01 Jul 2006 08:27:52 -0500
To:	"Francois Romieu" <romieu@fr.zoreil.com>
Subject: Re: PATCH SB1250 NAPI support
Cc:	tbm@cyrius.com, jgarzik@pobox.com, netdev@vger.kernel.org,
	linux-mips@linux-mips.org, mark.e.mason@broadcom.com
References: <20060524125512.GO12089@deprecation.cyrius.com> <op.s93yprpethfl8t@localhost.localdomain> <20060525133505.GH8746@deprecation.cyrius.com> <op.tamrhvwlthfl8t@localhost.localdomain> <20060629200107.GA8122@electric-eye.fr.zoreil.com>
From:	"Tom Rix" <trix@specifix.com>
Organization: specifix
Content-Type: multipart/mixed; boundary=----------ggVnrypSDYHvVVQ57UgIBu
MIME-Version: 1.0
Message-ID: <op.tb0icqqcthfl8t@localhost.localdomain>
In-Reply-To: <20060629200107.GA8122@electric-eye.fr.zoreil.com>
User-Agent: Opera M2/8.51 (Linux, build 1462)
Return-Path: <trix@specifix.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: 11895
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: trix@specifix.com
Precedence: bulk
X-list: linux-mips

------------ggVnrypSDYHvVVQ57UgIBu
Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8
Content-Transfer-Encoding: 8bit

Here is a revised patch that does the interupt masking earlier.  Since  
resetting the mask is done now in 3 places, I created a macro to handle  
it.  This patch has been tested on the linux-mips kernel from 6/29/06 on a  
sb1250.
Tom

On Thu, 29 Jun 2006 15:01:07 -0500, Francois Romieu <romieu@fr.zoreil.com>  
wrote:

> Tom Rix <trix@specifix.com> :
> [...]
> diff -rup a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c
> --- a/drivers/net/sb1250-mac.c	2006-03-09 04:25:41.000000000 -0600
> +++ b/drivers/net/sb1250-mac.c	2006-03-09 05:30:52.000000000 -0600
> [...]
> @@ -2079,13 +2095,31 @@ static irqreturn_t sbmac_intr(int irq,vo
>  		 * Transmits on channel 0
>  		 */
> +#if defined(CONFIG_SBMAC_NAPI)
>  		if (isr & (M_MAC_INT_CHANNEL << S_MAC_TX_CH0)) {
> -			sbdma_tx_process(sc,&(sc->sbm_txdma));
> +			sbdma_tx_process(sc,&(sc->sbm_txdma), 0);
>  		}
> 		/*
>  		 * Receives on channel 0
>  		 */
> +		if (isr & (M_MAC_INT_CHANNEL << S_MAC_RX_CH0)) {
> +			if (netif_rx_schedule_prep(dev))
> +			{
>
> An irq could appear here. I am skeptical that it is safe to write
> the irq mask register so late.
>
> One should probably consider a break in the enclosing "for" loop too.
>
>
> +				__raw_writeq(0, sc->sbm_imr);
> +				__netif_rx_schedule(dev);
> +			}
> +			else
> +			{
>
> } else {, please.
>



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
------------ggVnrypSDYHvVVQ57UgIBu
Content-Disposition: attachment; filename=mips-sb1250-mac-NAPI-5.patch
Content-Type: application/octet-stream; name=mips-sb1250-mac-NAPI-5.patch
Content-Transfer-Encoding: Base64

LS0tIGEvZHJpdmVycy9uZXQvS2NvbmZpZwkyMDA2LTA3LTAxIDA2OjI5OjExLjAw
MDAwMDAwMCAtMDUwMAorKysgYi9kcml2ZXJzL25ldC9LY29uZmlnCTIwMDYtMDct
MDEgMDY6Mjg6NTguMDAwMDAwMDAwIC0wNTAwCkBAIC0yMDEzLDEwICsyMDEzLDYg
QEAgY29uZmlnIFI4MTY5X05BUEkKIAogCSAgSWYgaW4gZG91YnQsIHNheSBOLgog
Ci1jb25maWcgTkVUX1NCMTI1MF9NQUMKLQl0cmlzdGF0ZSAiU0IxMjUwIEV0aGVy
bmV0IHN1cHBvcnQiCi0JZGVwZW5kcyBvbiBTSUJZVEVfU0IxeHh4X1NPQwotCiBj
b25maWcgUjgxNjlfVkxBTgogCWJvb2wgIlZMQU4gc3VwcG9ydCIKIAlkZXBlbmRz
IG9uIFI4MTY5ICYmIFZMQU5fODAyMVEKQEAgLTIwMjYsNiArMjAyMiwyNyBAQCBj
b25maWcgUjgxNjlfVkxBTgogCSAgCiAJICBJZiBpbiBkb3VidCwgc2F5IFkuCiAK
K2NvbmZpZyBORVRfU0IxMjUwX01BQworCXRyaXN0YXRlICJTQjEyNTAgRXRoZXJu
ZXQgc3VwcG9ydCIKKwlkZXBlbmRzIG9uIFNJQllURV9TQjF4eHhfU09DCisKK2Nv
bmZpZyBTQk1BQ19OQVBJCisJYm9vbCAiVXNlIFJ4IFBvbGxpbmcgKE5BUEkpIChF
WFBFUklNRU5UQUwpIgorCWRlcGVuZHMgb24gTkVUX1NCMTI1MF9NQUMgJiYgRVhQ
RVJJTUVOVEFMCisJaGVscAorCSAgTkFQSSBpcyBhIG5ldyBkcml2ZXIgQVBJIGRl
c2lnbmVkIHRvIHJlZHV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ZWQoU0JNQUNfRVRIMl9I
V0FERFIpIHx8IGRlZmluZWQoU0JNQUNfRVRIM19IV0FERFIpCiBzdGF0aWMgdm9p
ZAo=

------------ggVnrypSDYHvVVQ57UgIBu--


From redhatter@gentoo.org Sat Jul  1 14:45:48 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 01 Jul 2006 14:45:58 +0100 (BST)
Received: from 202-47-55-78.adsl.gil.com.au ([202.47.55.78]:38569 "EHLO
	longlandclan.hopto.org") by ftp.linux-mips.org with ESMTP
	id S8133402AbWGANps (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 1 Jul 2006 14:45:48 +0100
Received: (qmail 28996 invoked from network); 1 Jul 2006 23:45:38 +1000
Received: from unknown (HELO ?10.0.0.251?) (10.0.0.251)
  by 192.168.5.1 with SMTP; 1 Jul 2006 23:45:38 +1000
Message-ID: <44A67C84.5050702@gentoo.org>
Date:	Sat, 01 Jul 2006 23:45:40 +1000
From:	Stuart Longland <redhatter@gentoo.org>
Organization: Gentoo Foundation
User-Agent: Thunderbird 1.5.0.4 (X11/20060623)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: The puzzle that is IP32 audio
X-Enigmail-Version: 0.94.0.0
OpenPGP: id=63264AB9;
	url=http://dev.gentoo.org/~redhatter/gpgkey.asc
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="------------enigF6C534AD88672EA71FEAE45A"
Return-Path: <redhatter@gentoo.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11896
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: redhatter@gentoo.org
Precedence: bulk
X-list: linux-mips

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

Hi All...

	I've just been tinkering with my O2's audio... and whilst looking
around at OpenBSD... it seems I might have some pieces to the puzzle
which may explain the rather poor audio quality one gets under Linux.

	The sound board is based around an Analogue Devices AD1843 codec
(datasheet here[1]), which is a 16-bit device.  The interesting note,
was in the OpenBSD source code for their mavb[2] driver... The mabv.c
file[3] contains this comment:

> /*
>  * For some reason SGI has decided to standardize their sound hardware
>  * interfaces on 24-bit PCM even though the AD1843 codec used in the
>  * Moosehead A/V Board only supports 16-bit and 8-bit formats.
>  * Therefore we must convert everything to 24-bit samples only to have
>  * the MACE hardware convert them back into 16-bit samples again.  To
>  * complicate matters further, the 24-bit samples are embedded 32-bit
>  * integers.  The 8-bit and 16-bit samples are first converted into
>  * 24-bit samples by padding them to the right with zeroes.  Then they
>  * are sign-extended into 32-bit integers.  This conversion is
>  * conveniently done through the software encoding layer of the high
>  * level audio driver by using the functions below.  Conversion of
>  * mu-law and A-law formats is done by the hardware.
>  */

	I'm wondering... I don't see any logic that does this in the ALSA
code... Could this be the reason we get such craptastic audio from this
device?

	I'll have a tinker, and see if I can use my limited coding skills to
fix up the current IP32 driver to the point the sound at least works...
without sounding terrible. :-)

Regards,
--=20
Stuart Longland (aka Redhatter)              .'''.
Gentoo Linux/MIPS Cobalt and Docs Developer  '.'` :
=2E . . . . . . . . . . . . . . . . . . . . .   .'.'
http://dev.gentoo.org/~redhatter             :.'

International Asperger's Year (1906 ~ 2006)
http://dev.gentoo.org/~redhatter/iay

Footnotes:
1. http://www.analog.com/UploadedFiles/Data_Sheets/314303384ad1843.pdf
2. http://www.openbsd.org/cgi-bin/man.cgi?query=3Dmavb&sektion=3D4&arch=3D=
sgi
3.
http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/arch/sgi/dev/mav=
b.c?rev=3D1.6&content-type=3Dtext/plain


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2-ecc0.1.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEpnyIuarJ1mMmSrkRAuycAJ4vHvrYBPHcPS9f3MRjmsfBrJsU4QCgi07C
EDyQ6YMEHKL4vi2Gp+7SRR0=
=OH1R
-----END PGP SIGNATURE-----

--------------enigF6C534AD88672EA71FEAE45A--

From yoichi_yuasa@tripeaks.co.jp Sun Jul  2 15:13:42 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 02 Jul 2006 15:13:52 +0100 (BST)
Received: from mo32.po.2iij.net ([210.128.50.17]:55598 "EHLO mo32.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133544AbWGBONm (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sun, 2 Jul 2006 15:13:42 +0100
Received: by mo.po.2iij.net (mo32) id k62EDcng085474; Sun, 2 Jul 2006 23:13:38 +0900 (JST)
Received: from localhost.localdomain (225.29.30.125.dy.iij4u.or.jp [125.30.29.225])
	by mbox.po.2iij.net (mbox31) id k62EDZfu061870
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Sun, 2 Jul 2006 23:13:35 +0900 (JST)
Date:	Sun, 2 Jul 2006 23:13:34 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org
Subject: [PATCH] vr41xx: removed unused definitions for NEC CMBVR4133
Message-Id: <20060702231334.082d5374.yoichi_yuasa@tripeaks.co.jp>
Organization: TriPeaks Corporation
X-Mailer: Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <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: 11897
X-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,

This patch has removed unused definitions for NEC CMBVR4133.
Please apply.

Yoichi

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

diff -pruN -X mips/Documentation/dontdiff mips-orig/include/asm-mips/vr41xx/cmbvr4133.h mips/include/asm-mips/vr41xx/cmbvr4133.h
--- mips-orig/include/asm-mips/vr41xx/cmbvr4133.h	2006-07-01 23:41:40.393059500 +0900
+++ mips/include/asm-mips/vr41xx/cmbvr4133.h	2006-07-01 23:45:11.882276750 +0900
@@ -55,7 +55,4 @@
 #define IDE_SECONDARY_IRQ		I8259_IRQ(15)
 #define I8259_IRQ_LAST			IDE_SECONDARY_IRQ
 
-#define RTC_PORT(x)	(0xaf000100 + (x))
-#define RTC_IO_EXTENT	0x140
-
 #endif /* __NEC_CMBVR4133_H */

From yoichi_yuasa@tripeaks.co.jp Sun Jul  2 15:17:37 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 02 Jul 2006 15:17:53 +0100 (BST)
Received: from mo31.po.2iij.net ([210.128.50.54]:24624 "EHLO mo31.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133546AbWGBORh (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sun, 2 Jul 2006 15:17:37 +0100
Received: by mo.po.2iij.net (mo31) id k62EHYPL097629; Sun, 2 Jul 2006 23:17:34 +0900 (JST)
Received: from localhost.localdomain (225.29.30.125.dy.iij4u.or.jp [125.30.29.225])
	by mbox.po.2iij.net (mbox31) id k62EHSj4062791
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Sun, 2 Jul 2006 23:17:29 +0900 (JST)
Date:	Sun, 2 Jul 2006 23:17:27 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips <linux-mips@linux-mips.org>
Subject: [PATCH] au1000: removed unused codes about au1000
Message-Id: <20060702231727.6e5e6f51.yoichi_yuasa@tripeaks.co.jp>
Organization: TriPeaks Corporation
X-Mailer: Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <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: 11898
X-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,

This patch has removed unused codes about au1000.
Please apply.

Yoichi

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

diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/au1000/csb250/Makefile mips/arch/mips/au1000/csb250/Makefile
--- mips-orig/arch/mips/au1000/csb250/Makefile	2006-06-28 13:34:58.611275750 +0900
+++ mips/arch/mips/au1000/csb250/Makefile	1970-01-01 09:00:00.000000000 +0900
@@ -1,8 +0,0 @@
-#
-#  Copyright 2002 Cogent Computer Systems
-#     	dan@embeddededge.com
-#
-# Makefile for the Cogent CSB250 Au1500 board.  Copied from Pb1500.
-#
-
-obj-y := init.o board_setup.o irqmap.o
diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/au1000/csb250/board_setup.c mips/arch/mips/au1000/csb250/board_setup.c
--- mips-orig/arch/mips/au1000/csb250/board_setup.c	2006-06-28 13:34:58.611275750 +0900
+++ mips/arch/mips/au1000/csb250/board_setup.c	1970-01-01 09:00:00.000000000 +0900
@@ -1,239 +0,0 @@
-/*
- *
- * BRIEF MODULE DESCRIPTION
- *	Cogent CSB250 board setup.
- *
- * Copyright 2002 Cogent Computer Systems, Inc.
- *	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/config.h>
-#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/keyboard.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
-#include <asm/au1000.h>
-#include <asm/csb250.h>
-
-extern int (*board_pci_idsel)(unsigned int devsel, int assert);
-int	csb250_pci_idsel(unsigned int devsel, int assert);
-
-void __init board_setup(void)
-{
-	u32 pin_func, pin_val;
-	u32 sys_freqctrl, sys_clksrc;
-
-
-	// set AUX clock to 12MHz * 8 = 96 MHz
-	au_writel(8, SYS_AUXPLL);
-	au_writel(0, SYS_PINSTATERD);
-	udelay(100);
-
-#if defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE)
-
-	/* GPIO201 is input for PCMCIA card detect */
-	/* GPIO203 is input for PCMCIA interrupt request */
-	au_writel(au_readl(GPIO2_DIR) & (u32)(~((1<<1)|(1<<3))), GPIO2_DIR);
-
-	/* zero and disable FREQ2 */
-	sys_freqctrl = au_readl(SYS_FREQCTRL0);
-	sys_freqctrl &= ~0xFFF00000;
-	au_writel(sys_freqctrl, SYS_FREQCTRL0);
-
-	/* zero and disable USBH/USBD clocks */
-	sys_clksrc = au_readl(SYS_CLKSRC);
-	sys_clksrc &= ~0x00007FE0;
-	au_writel(sys_clksrc, SYS_CLKSRC);
-
-	sys_freqctrl = au_readl(SYS_FREQCTRL0);
-	sys_freqctrl &= ~0xFFF00000;
-
-	sys_clksrc = au_readl(SYS_CLKSRC);
-	sys_clksrc &= ~0x00007FE0;
-
-	// FREQ2 = aux/2 = 48 MHz
-	sys_freqctrl |= ((0<<22) | (1<<21) | (1<<20));
-	au_writel(sys_freqctrl, SYS_FREQCTRL0);
-
-	/*
-	 * Route 48MHz FREQ2 into USB Host and/or Device
-	 */
-#ifdef CONFIG_USB_OHCI
-	sys_clksrc |= ((4<<12) | (0<<11) | (0<<10));
-#endif
-#ifdef CONFIG_AU1X00_USB_DEVICE
-	sys_clksrc |= ((4<<7) | (0<<6) | (0<<5));
-#endif
-	au_writel(sys_clksrc, SYS_CLKSRC);
-
-
-	pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8000);
-#ifndef CONFIG_AU1X00_USB_DEVICE
-	// 2nd USB port is USB host
-	pin_func |= 0x8000;
-#endif
-	au_writel(pin_func, SYS_PINFUNC);
-#endif // defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE)
-
-	/* Configure GPIO2....it's used by PCI among other things.
-	*/
-
-	/* Make everything but GP200 (PCI RST) an input until we get
-	 * the pins set correctly.
-	 */
-	au_writel(0x00000001, GPIO2_DIR);
-
-	/* Set the pins used for output.
-	 * A zero bit will leave PCI reset, LEDs off, power up USB,
-	 * IDSEL disabled.
-	 */
-	pin_val = ((3 << 30) | (7 << 19) | (1 << 17) | (1 << 16));
-	au_writel(pin_val, GPIO2_OUTPUT);
-
-	/* Set the output direction.
-	*/
-	pin_val = ((3 << 14) | (7 << 3) | (1 << 1) | (1 << 0));
-	au_writel(pin_val, GPIO2_DIR);
-
-#ifdef CONFIG_PCI
-	/* Use FREQ1 for the PCI output clock.  We use the
-	 * CPU clock of 384 MHz divided by 12 to get 32 MHz PCI.
-	 * If Michael changes the CPU speed, we need to adjust
-	 * that here as well :-).
-	 */
-
-	/* zero and disable FREQ1
-	*/
-	sys_freqctrl = au_readl(SYS_FREQCTRL0);
-	sys_freqctrl &= ~0x000ffc00;
-	au_writel(sys_freqctrl, SYS_FREQCTRL0);
-
-	/* zero and disable PCI clock
-	*/
-	sys_clksrc = au_readl(SYS_CLKSRC);
-	sys_clksrc &= ~0x000f8000;
-	au_writel(sys_clksrc, SYS_CLKSRC);
-
-	/* Get current values (which really should match above).
-	*/
-	sys_freqctrl = au_readl(SYS_FREQCTRL0);
-	sys_freqctrl &= ~0x000ffc00;
-
-	sys_clksrc = au_readl(SYS_CLKSRC);
-	sys_clksrc &= ~0x000f8000;
-
-	/* FREQ1 = cpu/12 = 32 MHz
-	*/
-	sys_freqctrl |= ((5<<12) | (1<<11) | (0<<10));
-	au_writel(sys_freqctrl, SYS_FREQCTRL0);
-
-	/* Just connect the clock without further dividing.
-	*/
-	sys_clksrc |= ((3<<17) | (0<<16) | (0<<15));
-	au_writel(sys_clksrc, SYS_CLKSRC);
-
-	udelay(1);
-
-	/* Now that clocks should be running, take PCI out of reset.
-	*/
-	pin_val = au_readl(GPIO2_OUTPUT);
-	pin_val |= ((1 << 16) | 1);
-	au_writel(pin_val, GPIO2_OUTPUT);
-
-	// Setup PCI bus controller
-	au_writel(0, Au1500_PCI_CMEM);
-	au_writel(0x00003fff, Au1500_CFG_BASE);
-
-	/* We run big endian without any of the software byte swapping,
-	 * so configure the PCI bridge to help us out.
-	 */
-	au_writel(0xf | (2<<6) | (1<<5) | (1<<4), Au1500_PCI_CFG);
-
-	au_writel(0xf0000000, Au1500_PCI_MWMASK_DEV);
-	au_writel(0, Au1500_PCI_MWBASE_REV_CCL);
-	au_writel(0x02a00356, Au1500_PCI_STATCMD);
-	au_writel(0x00003c04, Au1500_PCI_HDRTYPE);
-	au_writel(0x00000008, Au1500_PCI_MBAR);
-	au_sync();
-
-	board_pci_idsel = csb250_pci_idsel;
-#endif
-
-	/* Enable sys bus clock divider when IDLE state or no bus activity. */
-	au_writel(au_readl(SYS_POWERCTRL) | (0x3 << 5), SYS_POWERCTRL);
-
-#ifdef CONFIG_RTC
-	// Enable the RTC if not already enabled
-	if (!(au_readl(0xac000028) & 0x20)) {
-		printk("enabling clock ...\n");
-		au_writel((au_readl(0xac000028) | 0x20), 0xac000028);
-	}
-	// Put the clock in BCD mode
-	if (readl(0xac00002C) & 0x4) { /* reg B */
-		au_writel(au_readl(0xac00002c) & ~0x4, 0xac00002c);
-		au_sync();
-	}
-#endif
-}
-
-/* The IDSEL is selected in the GPIO2 register.  We will make device
- * 12 appear in slot 0 and device 13 appear in slot 1.
- */
-int
-csb250_pci_idsel(unsigned int devsel, int assert)
-{
-	int		retval;
-	unsigned int	gpio2_pins;
-
-	retval = 1;
-
-	/* First, disable both selects, then assert the one requested.
-	*/
-	au_writel(0xc000c000, GPIO2_OUTPUT);
-	au_sync();
-
-	if (assert) {
-		if (devsel == 12)
-			gpio2_pins = 0x40000000;
-		else if (devsel == 13)
-			gpio2_pins = 0x80000000;
-		else {
-			gpio2_pins = 0xc000c000;
-			retval = 0;
-		}
-		au_writel(gpio2_pins, GPIO2_OUTPUT);
-	}
-	au_sync();
-
-	return retval;
-}
diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/au1000/csb250/init.c mips/arch/mips/au1000/csb250/init.c
--- mips-orig/arch/mips/au1000/csb250/init.c	2006-06-28 13:34:58.611275750 +0900
+++ mips/arch/mips/au1000/csb250/init.c	1970-01-01 09:00:00.000000000 +0900
@@ -1,94 +0,0 @@
-/*
- *
- * BRIEF MODULE DESCRIPTION
- *	Cogent CSB250 board setup
- *
- * Copyright 2002 Cogent Computer Systems, Inc.
- * 	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/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);
-
-/* When we get initrd working someday.........
-*/
-int	my_initrd_start, my_initrd_size;
-
-/* Start arguments and environment.
-*/
-static char	*csb_env[2];
-static char	*csb_arg[4];
-static char	*arg1 = "console=ttyS3,38400";
-static char	*arg2 = "root=/dev/nfs rw ip=any";
-static char	*env1 = "ethaddr=00:30:23:50:00:00";
-
-const char *get_system_type(void)
-{
-	return "Cogent CSB250";
-}
-
-int __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
-{
-	unsigned char *memsize_str;
-	unsigned long memsize;
-
-	/* We use a0 and a1 to pass initrd start and size.
-	*/
-	if (((uint) argc > 0) && ((uint)argv > 0)) {
-		my_initrd_start = (uint)argc;
-		my_initrd_size = (uint)argv;
-	}
-
-	/* First argv is ignored.
-	*/
-	prom_argc = 3;
-	prom_argv = csb_arg;
-	prom_envp = csb_env;
-	csb_arg[1] = arg1;
-	csb_arg[2] = arg2;
-	csb_env[0] = env1;
-
-	mips_machgroup = MACH_GROUP_ALCHEMY;
-	mips_machtype = MACH_CSB250;
-
-	prom_init_cmdline();
-	memsize_str = prom_getenv("memsize");
-	if (!memsize_str) {
-		memsize = 0x02000000;
-	} else {
-		memsize = simple_strtol(memsize_str, NULL, 0);
-	}
-	add_memory_region(0, memsize, BOOT_MEM_RAM);
-	return 0;
-}
diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/au1000/csb250/irqmap.c mips/arch/mips/au1000/csb250/irqmap.c
--- mips-orig/arch/mips/au1000/csb250/irqmap.c	2006-06-28 13:34:58.611275750 +0900
+++ mips/arch/mips/au1000/csb250/irqmap.c	1970-01-01 09:00:00.000000000 +0900
@@ -1,60 +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>
-
-au1xxx_irq_map_t __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 },
-};
-
-int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map);
diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/au1000/hydrogen3/Makefile mips/arch/mips/au1000/hydrogen3/Makefile
--- mips-orig/arch/mips/au1000/hydrogen3/Makefile	2006-06-28 13:34:58.611275750 +0900
+++ mips/arch/mips/au1000/hydrogen3/Makefile	1970-01-01 09:00:00.000000000 +0900
@@ -1,9 +0,0 @@
-#
-#  Copyright 2000 MontaVista Software Inc.
-#  Author: MontaVista Software, Inc.
-#     	ppopov@mvista.com or source@mvista.com
-#
-# Makefile for the Alchemy Semiconductor PB1000 board.
-#
-
-obj-y := init.o board_setup.o irqmap.o
diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/au1000/hydrogen3/board_setup.c mips/arch/mips/au1000/hydrogen3/board_setup.c
--- mips-orig/arch/mips/au1000/hydrogen3/board_setup.c	2006-06-28 13:34:58.611275750 +0900
+++ mips/arch/mips/au1000/hydrogen3/board_setup.c	1970-01-01 09:00:00.000000000 +0900
@@ -1,70 +0,0 @@
-/*
- *
- * BRIEF MODULE DESCRIPTION
- *	Alchemy Db1x00 board setup.
- *
- * Copyright 2000 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/config.h>
-#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/keyboard.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
-#include <asm/au1000.h>
-
-void board_reset (void)
-{
-}
-
-void __init board_setup(void)
-{
-	u32 pin_func;
-
-#ifdef CONFIG_AU1X00_USB_DEVICE
-	// 2nd USB port is USB device
-	pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8000);
-	au_writel(pin_func, SYS_PINFUNC);
-#endif
-
-#if defined(CONFIG_IRDA) && (defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1100))
-	/* set IRFIRSEL instead of GPIO15 */
-	pin_func = au_readl(SYS_PINFUNC) | (u32)((1<<8));
-	au_writel(pin_func, SYS_PINFUNC);
-	au_sync();
-#endif
-
-    printk("AMD Alchemy Hydrogen3 Board\n");
-}
diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/au1000/hydrogen3/init.c mips/arch/mips/au1000/hydrogen3/init.c
--- mips-orig/arch/mips/au1000/hydrogen3/init.c	2006-06-28 13:34:58.611275750 +0900
+++ mips/arch/mips/au1000/hydrogen3/init.c	1970-01-01 09:00:00.000000000 +0900
@@ -1,76 +0,0 @@
-/*
- *
- * BRIEF MODULE DESCRIPTION
- *	PB1000 board setup
- *
- * Copyright 2001 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 <asm/addrspace.h>
-#include <asm/bootinfo.h>
-#include <linux/config.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)
-{
-#ifdef CONFIG_MIPS_BOSPORUS
-	return "Alchemy Bosporus Gateway Reference";
-#else
-	return "Alchemy Db1x00";
-#endif
-}
-
-int __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
-{
-	unsigned char *memsize_str;
-	unsigned long memsize;
-
-	prom_argc = argc;
-	prom_argv = argv;
-	prom_envp = envp;
-
-	mips_machgroup = MACH_GROUP_ALCHEMY;
-	mips_machtype = MACH_DB1000;	/* set the platform # */
-	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);
-	return 0;
-}
diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/au1000/hydrogen3/irqmap.c mips/arch/mips/au1000/hydrogen3/irqmap.c
--- mips-orig/arch/mips/au1000/hydrogen3/irqmap.c	2006-06-28 13:34:58.611275750 +0900
+++ mips/arch/mips/au1000/hydrogen3/irqmap.c	1970-01-01 09:00:00.000000000 +0900
@@ -1,56 +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>
-
-au1xxx_irq_map_t __initdata au1xxx_irq_map[] = {
-
-	/* { AU1500_GPIO_205, INTC_INT_LOW_LEVEL, 0 }, */
-	{ AU1000_GPIO_21, INTC_INT_LOW_LEVEL, 0 },
-};
-
-int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map);

From anemo@mba.ocn.ne.jp Sun Jul  2 16:08:41 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 02 Jul 2006 16:08:50 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:14836 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133546AbWGBPIl (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sun, 2 Jul 2006 16:08:41 +0100
Received: from localhost (p6162-ipad210funabasi.chiba.ocn.ne.jp [58.88.125.162])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 439C2B49A; Mon,  3 Jul 2006 00:08:35 +0900 (JST)
Date:	Mon, 03 Jul 2006 00:09:47 +0900 (JST)
Message-Id: <20060703.000947.74752434.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] make SPARSEMEM selectable on QEMU
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
X-Fingerprint: 6ACA 1623 39BD 9A94 9B1A  B746 CA77 FE94 2874 D52F
X-Pgp-Public-Key: http://wwwkeys.pgp.net/pks/lookup?op=get&search=0x2874D52F
X-Mailer: Mew version 3.3 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11899
X-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

This might be helpfull to debug sparsemem on mips.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 58e68ce..f151a7e 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -554,6 +554,7 @@ config QEMU
 	select SYS_HAS_CPU_MIPS32_R1
 	select SYS_SUPPORTS_32BIT_KERNEL
 	select SYS_SUPPORTS_BIG_ENDIAN
+	select ARCH_SPARSEMEM_ENABLE
 	help
 	  Qemu is a software emulator which among other architectures also
 	  can simulate a MIPS32 4Kc system.  This patch adds support for the
@@ -1687,6 +1688,9 @@ config ARCH_DISCONTIGMEM_ENABLE
 	  or have huge holes in the physical address space for other reasons.
 	  See <file:Documentation/vm/numa> for more.
 
+config ARCH_SPARSEMEM_ENABLE
+	bool
+
 config NUMA
 	bool "NUMA Support"
 	depends on SYS_SUPPORTS_NUMA

From sshtylyov@ru.mvista.com Sun Jul  2 20:23:56 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 02 Jul 2006 20:24:11 +0100 (BST)
Received: from h155.mvista.com ([63.81.120.155]:33948 "EHLO imap.sh.mvista.com")
	by ftp.linux-mips.org with ESMTP id S8133577AbWGBTXz (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sun, 2 Jul 2006 20:23:55 +0100
Received: from [192.168.1.248] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id 253B33EC9; Sun,  2 Jul 2006 12:23:29 -0700 (PDT)
Message-ID: <44A81CEF.3010907@ru.mvista.com>
Date:	Sun, 02 Jul 2006 23:22:23 +0400
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:	Rodolfo Giometti <giometti@linux.it>
Cc:	linux-mips@linux-mips.org
Subject: Re: au1000_lowlevel_probe on au1000_eth.c
References: <20060626221441.GA10595@enneenne.com> <20060627155914.GD10595@enneenne.com> <44A3EBD7.8090408@ru.mvista.com> <20060629151130.GM7471@enneenne.com>
In-Reply-To: <20060629151130.GM7471@enneenne.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: 11900
X-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.

Rodolfo Giometti wrote:

>>   Hrm, wouldn't it be better to put this stuff into a separate function 
>>   then?

> Maybe, but I considered that these stuff are dignificative only during
> boot time so I decided to do not consider them during wake up. Is that
> wrong?

    No. And exactly because of this, the __init time stuff should better be 
separated (if possible)...

> Ciao,

> Rodolfo


From domen.puncer@ultra.si Mon Jul  3 07:17:17 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 03 Jul 2006 07:17:27 +0100 (BST)
Received: from deliver-2.mx.triera.net ([213.161.0.32]:14749 "EHLO
	deliver-2.mx.triera.net") by ftp.linux-mips.org with ESMTP
	id S8133446AbWGCGRR (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 3 Jul 2006 07:17:17 +0100
Received: from localhost (in-1.mx.triera.net [213.161.0.25])
	by deliver-2.mx.triera.net (Postfix) with ESMTP id 63C9F1B5;
	Mon,  3 Jul 2006 08:17:07 +0200 (CEST)
Received: from smtp.triera.net (smtp.triera.net [213.161.0.30])
	by in-1.mx.triera.net (Postfix) with SMTP id 014141BC081;
	Mon,  3 Jul 2006 08:17:07 +0200 (CEST)
Received: from localhost (unknown [213.161.20.162])
	by smtp.triera.net (Postfix) with ESMTP id 0E3031A18AB;
	Mon,  3 Jul 2006 08:17:07 +0200 (CEST)
Date:	Mon, 3 Jul 2006 08:17:09 +0200
From:	Domen Puncer <domen.puncer@ultra.si>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org
Subject: [patch] au1xxx: support YAMON and U-Boot
Message-ID: <20060703061709.GL31105@domen.ultra.si>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.11+cvs20060126
X-Virus-Scanned: Triera AV Service
Return-Path: <domen.puncer@ultra.si>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11901
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: domen.puncer@ultra.si
Precedence: bulk
X-list: linux-mips

After (too) many emails with Sergei Shtylyov, we came up with this
patch to support YAMON and U-Boot style environments.


Signed-off-by: Domen Puncer <domen.puncer@ultra.si>

Index: linux-mailed/arch/mips/au1000/common/prom.c
===================================================================
--- linux-mailed.orig/arch/mips/au1000/common/prom.c
+++ linux-mailed/arch/mips/au1000/common/prom.c
@@ -1,7 +1,7 @@
 /*
  *
  * BRIEF MODULE DESCRIPTION
- *    PROM library initialisation code, assuming YAMON is the boot loader.
+ *    PROM library initialisation code, supports YAMON and U-Boot.
  *
  * Copyright 2000, 2001, 2006 MontaVista Software Inc.
  * Author: MontaVista Software, Inc.
@@ -46,12 +46,6 @@
 extern int prom_argc;
 extern char **prom_argv, **prom_envp;
 
-typedef struct
-{
-	char *name;
-	char *val;
-} t_env_var;
-
 
 char * prom_getcmdline(void)
 {
@@ -84,13 +78,21 @@ char *prom_getenv(char *envname)
 {
 	/*
 	 * Return a pointer to the given environment variable.
+	 * YAMON uses "name", "value" pairs, while U-Boot uses "name=value".
 	 */
 
-	t_env_var *env = (t_env_var *)prom_envp;
-
-	while (env->name) {
-		if (strcmp(envname, env->name) == 0)
-			return env->val;
+	char **env = prom_envp;
+	int i = strlen(envname);
+	int yamon = (*env && strchr(*env, '=') == NULL);
+
+	while (*env) {
+		if (yamon) {
+			if (strcmp(envname, *env++) == 0)
+				return *env;
+		} else {
+			if (strncmp(envname, *env, i) == 0 && (*env)[i] == '=')
+				return *env + i + 1;
+		}
 		env++;
 	}
 	return NULL;

From ths@networkno.de Mon Jul  3 13:30:15 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 03 Jul 2006 13:30:25 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:49795 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8133621AbWGCMaP (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 3 Jul 2006 13:30:15 +0100
Received: from lagash (mipsfw.mips-uk.com [194.74.144.146])
	(using TLSv1 with cipher DES-CBC3-SHA (168/168 bits))
	(No client certificate requested)
	by bender.bawue.de (Postfix) with ESMTP
	id A8C1F46220; Mon,  3 Jul 2006 14:30:10 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1FxNYv-00035Y-Nb; Mon, 03 Jul 2006 13:30:01 +0100
Date:	Mon, 3 Jul 2006 13:30:01 +0100
To:	ralf@linux-mips.org
Cc:	linux-mips@linux-mips.org
Subject: [PATCH] Save 2k text size in cpu-probe
Message-ID: <20060703123001.GA6625@networkno.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.11+cvs20060403
From:	Thiemo Seufer <ths@networkno.de>
Return-Path: <ths@networkno.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11902
X-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

The appended patch drops the inline for decode_configs, this saves about
2k of text size. It also uses MIPS_CONF_AR instead of magic constants.


Thiemo


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

--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -467,7 +467,7 @@ static inline unsigned int decode_config
 	isa = (config0 & MIPS_CONF_AT) >> 13;
 	switch (isa) {
 	case 0:
-		switch ((config0 >> 10) & 7) {
+		switch ((config0 & MIPS_CONF_AR) >> 10) {
 		case 0:
 			c->isa_level = MIPS_CPU_ISA_M32R1;
 			break;
@@ -479,7 +479,7 @@ static inline unsigned int decode_config
 		}
 		break;
 	case 2:
-		switch ((config0 >> 10) & 7) {
+		switch ((config0 & MIPS_CONF_AR) >> 10) {
 		case 0:
 			c->isa_level = MIPS_CPU_ISA_M64R1;
 			break;
@@ -556,7 +556,7 @@ static inline unsigned int decode_config
 	return config3 & MIPS_CONF_M;
 }
 
-static inline void decode_configs(struct cpuinfo_mips *c)
+__init static void decode_configs(struct cpuinfo_mips *c)
 {
 	/* MIPS32 or MIPS64 compliant CPU.  */
 	c->options = MIPS_CPU_4KEX | MIPS_CPU_4K_CACHE | MIPS_CPU_COUNTER |

From yoichi_yuasa@tripeaks.co.jp Tue Jul  4 14:16:37 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 04 Jul 2006 14:16:48 +0100 (BST)
Received: from mo31.po.2iij.net ([210.128.50.54]:3080 "EHLO mo31.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133491AbWGDNQh (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 4 Jul 2006 14:16:37 +0100
Received: by mo.po.2iij.net (mo31) id k64DGWYa027537; Tue, 4 Jul 2006 22:16:33 +0900 (JST)
Received: from localhost.localdomain (225.29.30.125.dy.iij4u.or.jp [125.30.29.225])
	by mbox.po.2iij.net (mbox31) id k64DGTr4012212
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Tue, 4 Jul 2006 22:16:30 +0900 (JST)
Date:	Tue, 4 Jul 2006 22:16:28 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips <linux-mips@linux-mips.org>
Subject: [PATCH] fixed build error about mips-mt.c
Message-Id: <20060704221628.4b878943.yoichi_yuasa@tripeaks.co.jp>
Organization: TriPeaks Corporation
X-Mailer: Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <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: 11903
X-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,

This patch has fixed a build error about mips-mt.c .

Yoichi

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


diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/kernel/mips-mt.c mips/arch/mips/kernel/mips-mt.c
--- mips-orig/arch/mips/kernel/mips-mt.c	2006-07-04 11:54:18.241298000 +0900
+++ mips/arch/mips/kernel/mips-mt.c	2006-07-04 11:28:57.834278500 +0900
@@ -7,6 +7,7 @@
 #include <linux/sched.h>
 #include <linux/cpumask.h>
 #include <linux/interrupt.h>
+#include <linux/security.h>
 
 #include <asm/cpu.h>
 #include <asm/processor.h>

From yoichi_yuasa@tripeaks.co.jp Tue Jul  4 14:59:48 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 04 Jul 2006 14:59:57 +0100 (BST)
Received: from mo30.po.2iij.net ([210.128.50.53]:55330 "EHLO mo30.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133491AbWGDN7s (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 4 Jul 2006 14:59:48 +0100
Received: by mo.po.2iij.net (mo30) id k64DxjHw073687; Tue, 4 Jul 2006 22:59:46 +0900 (JST)
Received: from localhost.localdomain (225.29.30.125.dy.iij4u.or.jp [125.30.29.225])
	by mbox.po.2iij.net (mbox32) id k64DxgZH070618
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Tue, 4 Jul 2006 22:59:43 +0900 (JST)
Date:	Tue, 4 Jul 2006 22:59:41 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips <linux-mips@linux-mips.org>
Subject: [PATCH] vr41xx: added CONF_BP for VR41xx
Message-Id: <20060704225941.14db0533.yoichi_yuasa@tripeaks.co.jp>
Organization: TriPeaks Corporation
X-Mailer: Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <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: 11904
X-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,

This patch has added CONF_BP for VR41xx.

Yoichi

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

diff -pruN -X mips/Documentation/dontdiff mips-orig/include/asm-mips/mipsregs.h mips/include/asm-mips/mipsregs.h
--- mips-orig/include/asm-mips/mipsregs.h	2006-07-03 00:51:00.895809500 +0900
+++ mips/include/asm-mips/mipsregs.h	2006-07-03 00:50:23.001441250 +0900
@@ -470,6 +470,7 @@
 
 /* Bits specific to the VR41xx.  */
 #define VR41_CONF_CS		(_ULCAST_(1) << 12)
+#define VR41_CONF_BP		(_ULCAST_(1) << 16)
 #define VR41_CONF_M16		(_ULCAST_(1) << 20)
 #define VR41_CONF_AD		(_ULCAST_(1) << 23)
 

From yoichi_yuasa@tripeaks.co.jp Tue Jul  4 15:04:40 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 04 Jul 2006 15:04:48 +0100 (BST)
Received: from mo30.po.2iij.net ([210.128.50.53]:8460 "EHLO mo30.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133491AbWGDOEk (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 4 Jul 2006 15:04:40 +0100
Received: by mo.po.2iij.net (mo30) id k64E4chY074389; Tue, 4 Jul 2006 23:04:38 +0900 (JST)
Received: from localhost.localdomain (225.29.30.125.dy.iij4u.or.jp [125.30.29.225])
	by mbox.po.2iij.net (mbox32) id k64E4WdD072675
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Tue, 4 Jul 2006 23:04:32 +0900 (JST)
Date:	Tue, 4 Jul 2006 23:04:31 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips <linux-mips@linux-mips.org>
Subject: [PATCH] vr41xx: VR41_CONF_BP is necessary only for processor ID
 0xc80
Message-Id: <20060704230431.74fbe12b.yoichi_yuasa@tripeaks.co.jp>
Organization: TriPeaks Corporation
X-Mailer: Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <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: 11905
X-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,

VR41_CONF_BP is necessary only for processor ID 0xc80. 
Please apply.

Yoichi

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

diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/mm/c-r4k.c mips/arch/mips/mm/c-r4k.c
--- mips-orig/arch/mips/mm/c-r4k.c	2006-07-04 11:54:18.405308250 +0900
+++ mips/arch/mips/mm/c-r4k.c	2006-07-04 22:45:11.862517750 +0900
@@ -848,7 +848,9 @@ static void __init probe_pcache(void)
 		if (c->processor_id == 0x0c80U || c->processor_id == 0x0c81U ||
 		    c->processor_id == 0x0c82U) {
 			config &= ~0x00000030U;
-			config |= 0x00410000U;
+			config |= 0x00400000U;
+			if (c->processor_id == 0x0c80U)
+				config |= VR41_CONF_BP;
 			write_c0_config(config);
 		}
 		icache_size = 1 << (10 + ((config & CONF_IC) >> 9));

From anemo@mba.ocn.ne.jp Tue Jul  4 17:21:37 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 04 Jul 2006 17:21:46 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:39417 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S3466304AbWGDQVh (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 4 Jul 2006 17:21:37 +0100
Received: from localhost (p3208-ipad34funabasi.chiba.ocn.ne.jp [124.85.60.208])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 8EF30B45E; Wed,  5 Jul 2006 01:21:30 +0900 (JST)
Date:	Wed, 05 Jul 2006 01:22:44 +0900 (JST)
Message-Id: <20060705.012244.96686002.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] sparsemem fix
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
X-Fingerprint: 6ACA 1623 39BD 9A94 9B1A  B746 CA77 FE94 2874 D52F
X-Pgp-Public-Key: http://wwwkeys.pgp.net/pks/lookup?op=get&search=0x2874D52F
X-Mailer: Mew version 3.3 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11906
X-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

1. MIPS should select SPARSEMEM_STATIC since allocating bootmem in
   memory_present() will corrupt bootmap area.
2. pfn_valid() for SPARSEMEM is defined in linux/mmzone.h

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index f151a7e..879a19c 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1690,6 +1690,7 @@ config ARCH_DISCONTIGMEM_ENABLE
 
 config ARCH_SPARSEMEM_ENABLE
 	bool
+	select SPARSEMEM_STATIC
 
 config NUMA
 	bool "NUMA Support"
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index 6b97744..6ed1151 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -138,16 +138,14 @@ #define __va(x)			((void *)((unsigned lo
 
 #define pfn_to_kaddr(pfn)	__va((pfn) << PAGE_SHIFT)
 
-#ifndef CONFIG_SPARSEMEM
-#ifndef CONFIG_NEED_MULTIPLE_NODES
-#define pfn_valid(pfn)		((pfn) < max_mapnr)
-#endif
-#endif
-
 #ifdef CONFIG_FLATMEM
 
 #define pfn_valid(pfn)		((pfn) < max_mapnr)
 
+#elif defined(CONFIG_SPARSEMEM)
+
+/* pfn_valid is defined in linux/mmzone.h */
+
 #elif defined(CONFIG_NEED_MULTIPLE_NODES)
 
 #define pfn_valid(pfn)							\
@@ -159,8 +157,6 @@ ({									\
 	            : 0);						\
 })
 
-#else
-#error Provide a definition of pfn_valid
 #endif
 
 #define virt_to_page(kaddr)	pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)

From Kenneth.Reese@caviumnetworks.com Tue Jul  4 18:03:44 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 04 Jul 2006 18:03:59 +0100 (BST)
Received: from smtp2.caviumnetworks.com ([209.113.159.134]:22584 "EHLO
	smtp2.caviumnetworks.com") by ftp.linux-mips.org with ESMTP
	id S8133770AbWGDRDo (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 4 Jul 2006 18:03:44 +0100
Received: from exch4.caveonetworks.com (Not Verified[192.168.16.23]) by smtp2.caviumnetworks.com with NetIQ MailMarshal (v6,0,3,8)
	id <B44aa9f730000>; Tue, 04 Jul 2006 13:03:47 -0400
Received: from [192.168.111.13] ([71.202.53.57]) by exch4.caveonetworks.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.1830);
	 Tue, 4 Jul 2006 10:03:36 -0700
Message-ID: <44AA9F67.3090309@caviumnetworks.com>
Date:	Tue, 04 Jul 2006 10:03:35 -0700
From:	Chad Reese <kreese@caviumnetworks.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060620 Debian/1.7.13-0.2
X-Accept-Language: en
MIME-Version: 1.0
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
CC:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] sparsemem fix
References: <20060705.012244.96686002.anemo@mba.ocn.ne.jp>
In-Reply-To: <20060705.012244.96686002.anemo@mba.ocn.ne.jp>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 04 Jul 2006 17:03:37.0133 (UTC) FILETIME=[CA6205D0:01C69F8B]
Return-Path: <Kenneth.Reese@caviumnetworks.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: 11907
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: kreese@caviumnetworks.com
Precedence: bulk
X-list: linux-mips

I believe Ralf committed a cleaned up version of the patch I created 
5/23/2006. It called memory_present() after the first bootmap memory was 
created. I've been using this and dynamic sparsemem on Mips64 for a 
while now.

Hope this helps,

Chad

Atsushi Nemoto wrote:

>1. MIPS should select SPARSEMEM_STATIC since allocating bootmem in
>   memory_present() will corrupt bootmap area.
>2. pfn_valid() for SPARSEMEM is defined in linux/mmzone.h
>
>Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
>
>diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
>index f151a7e..879a19c 100644
>--- a/arch/mips/Kconfig
>+++ b/arch/mips/Kconfig
>@@ -1690,6 +1690,7 @@ config ARCH_DISCONTIGMEM_ENABLE
> 
> config ARCH_SPARSEMEM_ENABLE
> 	bool
>+	select SPARSEMEM_STATIC
> 
> config NUMA
> 	bool "NUMA Support"
>diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
>index 6b97744..6ed1151 100644
>--- a/include/asm-mips/page.h
>+++ b/include/asm-mips/page.h
>@@ -138,16 +138,14 @@ #define __va(x)			((void *)((unsigned lo
> 
> #define pfn_to_kaddr(pfn)	__va((pfn) << PAGE_SHIFT)
> 
>-#ifndef CONFIG_SPARSEMEM
>-#ifndef CONFIG_NEED_MULTIPLE_NODES
>-#define pfn_valid(pfn)		((pfn) < max_mapnr)
>-#endif
>-#endif
>-
> #ifdef CONFIG_FLATMEM
> 
> #define pfn_valid(pfn)		((pfn) < max_mapnr)
> 
>+#elif defined(CONFIG_SPARSEMEM)
>+
>+/* pfn_valid is defined in linux/mmzone.h */
>+
> #elif defined(CONFIG_NEED_MULTIPLE_NODES)
> 
> #define pfn_valid(pfn)							\
>@@ -159,8 +157,6 @@ ({									\
> 	            : 0);						\
> })
> 
>-#else
>-#error Provide a definition of pfn_valid
> #endif
> 
> #define virt_to_page(kaddr)	pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
>
>  
>


From anemo@mba.ocn.ne.jp Wed Jul  5 02:30:22 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 05 Jul 2006 02:30:31 +0100 (BST)
Received: from topsns2.toshiba-tops.co.jp ([202.230.225.126]:29333 "EHLO
	topsns2.toshiba-tops.co.jp") by ftp.linux-mips.org with ESMTP
	id S3686520AbWGEBaW (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 5 Jul 2006 02:30:22 +0100
Received: from topsms.toshiba-tops.co.jp by topsns2.toshiba-tops.co.jp
          via smtpd (for ftp.linux-mips.org [194.74.144.162]) with ESMTP; Wed, 5 Jul 2006 10:30:21 +0900
Received: from topsms.toshiba-tops.co.jp (localhost.localdomain [127.0.0.1])
	by localhost.toshiba-tops.co.jp (Postfix) with ESMTP id A9673203FB;
	Wed,  5 Jul 2006 10:30:14 +0900 (JST)
Received: from srd2sd.toshiba-tops.co.jp (srd2sd.toshiba-tops.co.jp [172.17.28.2])
	by topsms.toshiba-tops.co.jp (Postfix) with ESMTP id 9C68220310;
	Wed,  5 Jul 2006 10:30:14 +0900 (JST)
Received: from localhost (fragile [172.17.28.65])
	by srd2sd.toshiba-tops.co.jp (8.12.10/8.12.10) with ESMTP id k651UDW0094787;
	Wed, 5 Jul 2006 10:30:14 +0900 (JST)
	(envelope-from anemo@mba.ocn.ne.jp)
Date:	Wed, 05 Jul 2006 10:30:13 +0900 (JST)
Message-Id: <20060705.103013.41196866.nemoto@toshiba-tops.co.jp>
To:	kreese@caviumnetworks.com
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] sparsemem fix
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <44AA9F67.3090309@caviumnetworks.com>
References: <20060705.012244.96686002.anemo@mba.ocn.ne.jp>
	<44AA9F67.3090309@caviumnetworks.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 3.3 on Emacs 21.3 / 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: 11908
X-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

On Tue, 04 Jul 2006 10:03:35 -0700, Chad Reese <kreese@caviumnetworks.com> wrote:
> I believe Ralf committed a cleaned up version of the patch I created 
> 5/23/2006. It called memory_present() after the first bootmap memory was 
> created. I've been using this and dynamic sparsemem on Mips64 for a 
> while now.

It is not enough.  If you want to use SPARSEMEM_EXTREME, do not call
memory_present() _before_ reserve_bootmem().

For SPARSEMEM_EXTREME, memory_present() try to allocate bootmem, but
first area of bootmem must be reserved for bootmap before any
allocation.

The alloc_bootmem_node try to allocate upper (>16MB) page first, then
try lower page.  So if the first memory area was smaller then 16MB
SPARSEMEM_EXTREME would not work.

Also, SPARSEMEM_STATIC will be a bit faster then SPARSEMEM_EXTREME.
The mm/Kconfig warns about mem_section[] size, but static
mem_section[] size is just 1KB for MIPS.  No problem.  :-)

---
Atsushi Nemoto

From olivier.charra@pacemicro.com Wed Jul  5 09:25:39 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 05 Jul 2006 09:25:48 +0100 (BST)
Received: from smtp-out3.pace.co.uk ([213.244.3.219]:34978 "EHLO
	smtp-out3.pace.co.uk") by ftp.linux-mips.org with ESMTP
	id S8126624AbWGEIZj (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 5 Jul 2006 09:25:39 +0100
Received: from meylan-exch.meylan.pace.co.uk (meylan-exch.meylan.pace.co.uk [136.170.216.4])
	by smtp-out3.pace.co.uk (Postfix) with ESMTP id C21131BD65
	for <linux-mips@linux-mips.org>; Wed,  5 Jul 2006 10:25:38 +0200 (CEST)
Received: by meylan-exch.meylan.pace.co.uk with Internet Mail Service (5.5.2653.19)
	id <HDP4JK99>; Wed, 5 Jul 2006 10:28:17 +0200
Message-ID: <4BE62CC10497D511B6CF0002A5873E9702C8A9FC@meylan-exch.meylan.pace.co.uk>
From:	Olivier CHARRA <olivier.charra@pacemicro.com>
To:	"'linux-mips@linux-mips.org'" <linux-mips@linux-mips.org>
Subject: Hardware watchpoint support
Date:	Wed, 5 Jul 2006 10:28:14 +0200 
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
	charset="iso-8859-1"
Return-Path: <olivier.charra@pacemicro.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: 11909
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: olivier.charra@pacemicro.com
Precedence: bulk
X-list: linux-mips


Hi all,

I would like to use hardware watchpoint on one of our mips 5Kc platform.

Before trying to implement it myself from scratch, I would like to know if
there was any open-source attempt from which I can start to work.

I quickly looked at the mailing list archives and it seems that some of you
were trying to do the same thing some week ago.

Thanks all,

Olivier Charra.



From vagabon.xyz@gmail.com Wed Jul  5 09:30:44 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 05 Jul 2006 09:30:57 +0100 (BST)
Received: from ug-out-1314.google.com ([66.249.92.173]:54767 "EHLO
	ug-out-1314.google.com") by ftp.linux-mips.org with ESMTP
	id S8133374AbWGEIao (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 5 Jul 2006 09:30:44 +0100
Received: by ug-out-1314.google.com with SMTP id u2so2078044uge
        for <linux-mips@linux-mips.org>; Wed, 05 Jul 2006 01:30:43 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:reply-to:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:from;
        b=lUwJRy4pwVDF/ZfwbLc/rRsccudIePGwy9q7xIJQat+LUxNIDOQRLPrTWY0gUnIJpBI2UC/YFLpAzTjj6+gypIf/wxJvNe3H+hludbjEaNW5FZVZM4nLd4fbQw37kWR7noYA59TbNvPIFw+2aqZcpvHQPjw3KQVlAv8g8BuYSRw=
Received: by 10.78.165.16 with SMTP id n16mr1882713hue;
        Wed, 05 Jul 2006 01:30:42 -0700 (PDT)
Received: from ?192.168.0.24? ( [194.3.162.233])
        by mx.gmail.com with ESMTP id 4sm1955406hud.2006.07.05.01.30.41;
        Wed, 05 Jul 2006 01:30:42 -0700 (PDT)
Message-ID: <44AB79D0.90002@innova-card.com>
Date:	Wed, 05 Jul 2006 10:35:28 +0200
Reply-To: Franck <vagabon.xyz@gmail.com>
User-Agent: Thunderbird 1.5.0.2 (X11/20060501)
MIME-Version: 1.0
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
CC:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] sparsemem fix
References: <20060705.012244.96686002.anemo@mba.ocn.ne.jp>
In-Reply-To: <20060705.012244.96686002.anemo@mba.ocn.ne.jp>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From:	Franck Bui-Huu <vagabon.xyz@gmail.com>
Return-Path: <vagabon.xyz@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: 11910
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: vagabon.xyz@gmail.com
Precedence: bulk
X-list: linux-mips

Atsushi Nemoto wrote:
> 1. MIPS should select SPARSEMEM_STATIC since allocating bootmem in
>    memory_present() will corrupt bootmap area.
> 2. pfn_valid() for SPARSEMEM is defined in linux/mmzone.h
> 
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
> 
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index f151a7e..879a19c 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -1690,6 +1690,7 @@ config ARCH_DISCONTIGMEM_ENABLE
>  
>  config ARCH_SPARSEMEM_ENABLE
>  	bool
> +	select SPARSEMEM_STATIC
>  
>  config NUMA
>  	bool "NUMA Support"
> diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
> index 6b97744..6ed1151 100644
> --- a/include/asm-mips/page.h
> +++ b/include/asm-mips/page.h
> @@ -138,16 +138,14 @@ #define __va(x)			((void *)((unsigned lo
>  
>  #define pfn_to_kaddr(pfn)	__va((pfn) << PAGE_SHIFT)
>  
> -#ifndef CONFIG_SPARSEMEM
> -#ifndef CONFIG_NEED_MULTIPLE_NODES
> -#define pfn_valid(pfn)		((pfn) < max_mapnr)
> -#endif
> -#endif
> -
>  #ifdef CONFIG_FLATMEM
>  
>  #define pfn_valid(pfn)		((pfn) < max_mapnr)
>  

In flatmem case, I would define pfn_valid like:

#define pfn_valid(pfn)          ((pfn) >= ARCH_PFN_OFFSET && (pfn) < max_mapnr)

> +#elif defined(CONFIG_SPARSEMEM)
> +
> +/* pfn_valid is defined in linux/mmzone.h */
> +
>  #elif defined(CONFIG_NEED_MULTIPLE_NODES)

why not using:

#elif defined(CONFIG_DISCONTIGMEM) || defined(CONFIG_NUMA)

hence, we would have all memory model cases.

For now it seems to be implemented only in sgi-ip27 machine. Maybe we should
make things clear by adding:

#ifdef CONFIG_SGI_IP27
#define pfn_valid	[...]
#else
#error discontigmem model is only supported by sgi-ip27 platforms.
#error Please try to implement a generic solution if you plan to
#error use this memory model. Good luck ;)
#endif /* CONFIG_SGI_IP27 */

>  
>  #define pfn_valid(pfn)							\
> @@ -159,8 +157,6 @@ ({									\
>  	            : 0);						\
>  })
>  
> -#else
> -#error Provide a definition of pfn_valid
>  #endif

maybe this would be better too ?

#else

#error Unknow memory model, provide a definition of pfn_valid

#endif

>  
>  #define virt_to_page(kaddr)	pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
> 
> 


From anemo@mba.ocn.ne.jp Wed Jul  5 11:21:02 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 05 Jul 2006 11:21:11 +0100 (BST)
Received: from topsns2.toshiba-tops.co.jp ([202.230.225.126]:14303 "EHLO
	topsns2.toshiba-tops.co.jp") by ftp.linux-mips.org with ESMTP
	id S8133407AbWGEKVC (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 5 Jul 2006 11:21:02 +0100
Received: from topsms.toshiba-tops.co.jp by topsns2.toshiba-tops.co.jp
          via smtpd (for ftp.linux-mips.org [194.74.144.162]) with ESMTP; Wed, 5 Jul 2006 19:20:59 +0900
Received: from topsms.toshiba-tops.co.jp (localhost.localdomain [127.0.0.1])
	by localhost.toshiba-tops.co.jp (Postfix) with ESMTP id ACCDA20453;
	Wed,  5 Jul 2006 19:20:55 +0900 (JST)
Received: from srd2sd.toshiba-tops.co.jp (srd2sd.toshiba-tops.co.jp [172.17.28.2])
	by topsms.toshiba-tops.co.jp (Postfix) with ESMTP id 85C562030D;
	Wed,  5 Jul 2006 19:20:55 +0900 (JST)
Received: from localhost (fragile [172.17.28.65])
	by srd2sd.toshiba-tops.co.jp (8.12.10/8.12.10) with ESMTP id k65AKsW0096669;
	Wed, 5 Jul 2006 19:20:55 +0900 (JST)
	(envelope-from anemo@mba.ocn.ne.jp)
Date:	Wed, 05 Jul 2006 19:20:54 +0900 (JST)
Message-Id: <20060705.192054.128618288.nemoto@toshiba-tops.co.jp>
To:	vagabon.xyz@gmail.com
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] sparsemem fix
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <44AB79D0.90002@innova-card.com>
References: <20060705.012244.96686002.anemo@mba.ocn.ne.jp>
	<44AB79D0.90002@innova-card.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 3.3 on Emacs 21.3 / 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: 11911
X-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

On Wed, 05 Jul 2006 10:35:28 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
> >  #elif defined(CONFIG_NEED_MULTIPLE_NODES)
> 
> why not using:
> 
> #elif defined(CONFIG_DISCONTIGMEM) || defined(CONFIG_NUMA)
> 
> hence, we would have all memory model cases.

While NEED_MULTIPLE_NODES is defined if DISCONTIGMEM || NUMA, it seems
no difference.

> For now it seems to be implemented only in sgi-ip27 machine. Maybe we should
> make things clear by adding:
> 
> #ifdef CONFIG_SGI_IP27
> #define pfn_valid	[...]
> #else
> #error discontigmem model is only supported by sgi-ip27 platforms.
> #error Please try to implement a generic solution if you plan to
> #error use this memory model. Good luck ;)
> #endif /* CONFIG_SGI_IP27 */

Though the pfn_valid() is only used by ip27 for now, I suppose it
could be used other NUMA systems (not sure).

---
Atsushi Nemoto

From vagabon.xyz@gmail.com Wed Jul  5 11:46:54 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 05 Jul 2006 11:47:06 +0100 (BST)
Received: from ug-out-1314.google.com ([66.249.92.169]:28477 "EHLO
	ug-out-1314.google.com") by ftp.linux-mips.org with ESMTP
	id S8133420AbWGEKqy (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 5 Jul 2006 11:46:54 +0100
Received: by ug-out-1314.google.com with SMTP id u2so2130466uge
        for <linux-mips@linux-mips.org>; Wed, 05 Jul 2006 03:46:48 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:reply-to:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:from;
        b=pAsQO6hMToatk4RsuTtY79w9YGYOJ1KFuZbr7YGIecGE1zn4GanhM9hSg3wxuz7xiqEZ9d8hiJnYN1aGD9S3ILFYCdH4bpjeMbkIa+nzFodaQ2dpVayO9OXYaBKU2BVsiXWGiO4E2QBfSVJr3Agnb4Qr8plrQw+t1l8vtlHz4y8=
Received: by 10.78.166.7 with SMTP id o7mr1965413hue;
        Wed, 05 Jul 2006 03:46:48 -0700 (PDT)
Received: from ?192.168.0.24? ( [194.3.162.233])
        by mx.gmail.com with ESMTP id 28sm1992590hua.2006.07.05.03.46.44;
        Wed, 05 Jul 2006 03:46:48 -0700 (PDT)
Message-ID: <44AB99AD.8000403@innova-card.com>
Date:	Wed, 05 Jul 2006 12:51:25 +0200
Reply-To: Franck <vagabon.xyz@gmail.com>
User-Agent: Thunderbird 1.5.0.2 (X11/20060501)
MIME-Version: 1.0
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
CC:	vagabon.xyz@gmail.com, linux-mips@linux-mips.org,
	ralf@linux-mips.org
Subject: Re: [PATCH] sparsemem fix
References: <20060705.012244.96686002.anemo@mba.ocn.ne.jp>	<44AB79D0.90002@innova-card.com> <20060705.192054.128618288.nemoto@toshiba-tops.co.jp>
In-Reply-To: <20060705.192054.128618288.nemoto@toshiba-tops.co.jp>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
From:	Franck Bui-Huu <vagabon.xyz@gmail.com>
Return-Path: <vagabon.xyz@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: 11912
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: vagabon.xyz@gmail.com
Precedence: bulk
X-list: linux-mips

Atsushi Nemoto wrote:
> On Wed, 05 Jul 2006 10:35:28 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
>>>  #elif defined(CONFIG_NEED_MULTIPLE_NODES)
>> why not using:
>>
>> #elif defined(CONFIG_DISCONTIGMEM) || defined(CONFIG_NUMA)
>>
>> hence, we would have all memory model cases.
> 
> While NEED_MULTIPLE_NODES is defined if DISCONTIGMEM || NUMA, it seems
> no difference.
> 

well, in the previous case the reader sees a case for _all_ memory models.
In your case the reader needs to know that NEED_MULTIPLE_NODES is defined
as (DISCONTIGMEM || NUMA).

>> For now it seems to be implemented only in sgi-ip27 machine. Maybe we should
>> make things clear by adding:
>>
>> #ifdef CONFIG_SGI_IP27
>> #define pfn_valid	[...]
>> #else
>> #error discontigmem model is only supported by sgi-ip27 platforms.
>> #error Please try to implement a generic solution if you plan to
>> #error use this memory model. Good luck ;)
>> #endif /* CONFIG_SGI_IP27 */
> 
> Though the pfn_valid() is only used by ip27 for now, I suppose it
> could be used other NUMA systems (not sure).
> 

no the code related to NUMA is embedded in ip27 directory. So if
someone has another NUMA system, she should (a) copy all the stuff
in its platform directory or (b) make a generic solution maybe based
on ip27 one for all others NUMA platforms.  But in the second case,
the NUMA implementation is going to be modified heavily (a guess)
and probably same for pfn_valid definition.

The previous change makes things clear: for now, you can't use
pfn_valid when NUMA or DISCONTIGMEM configs without some reworks.


		Franck


From anemo@mba.ocn.ne.jp Wed Jul  5 14:12:45 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 05 Jul 2006 14:12:57 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:5876 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S3466314AbWGENMp (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 5 Jul 2006 14:12:45 +0100
Received: from localhost (p8107-ipad212funabasi.chiba.ocn.ne.jp [58.91.172.107])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 976DCB7B5; Wed,  5 Jul 2006 22:12:39 +0900 (JST)
Date:	Wed, 05 Jul 2006 22:13:54 +0900 (JST)
Message-Id: <20060705.221354.74751389.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] do not count pages in holes with sparsemem
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
X-Fingerprint: 6ACA 1623 39BD 9A94 9B1A  B746 CA77 FE94 2874 D52F
X-Pgp-Public-Key: http://wwwkeys.pgp.net/pks/lookup?op=get&search=0x2874D52F
X-Mailer: Mew version 3.3 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11913
X-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

With SPARSEMEM, the single node can contains some holes so there might
be many invalid pages.  For example, with two 256M memory and one 256M
hole, some variables (num_physpage, totalpages, nr_kernel_pages,
nr_all_pages, etc.) will indicate that there are 768MB on this system.
This is not desired because, for example, alloc_large_system_hash()
allocates too many entries.

Use free_area_init_node() with counted zholes_size[] instead of
free_area_init().

For num_physpages, use number of ram pages instead of max_low_pfn.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 802bdd3..d41dee5 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -139,10 +139,36 @@ #endif /* CONFIG_HIGHMEM */
 #ifndef CONFIG_NEED_MULTIPLE_NODES
 extern void pagetable_init(void);
 
+static int __init page_is_ram(unsigned long pagenr)
+{
+	int i;
+
+	for (i = 0; i < boot_mem_map.nr_map; i++) {
+		unsigned long addr, end;
+
+		if (boot_mem_map.map[i].type != BOOT_MEM_RAM)
+			/* not usable memory */
+			continue;
+
+		addr = PFN_UP(boot_mem_map.map[i].addr);
+		end = PFN_DOWN(boot_mem_map.map[i].addr +
+			       boot_mem_map.map[i].size);
+
+		if (pagenr >= addr && pagenr < end)
+			return 1;
+	}
+
+	return 0;
+}
+
 void __init paging_init(void)
 {
-	unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};
+	unsigned long zones_size[] = { [0 ... MAX_NR_ZONES - 1] = 0 };
 	unsigned long max_dma, high, low;
+#ifdef CONFIG_SPARSEMEM
+	unsigned long zholes_size[] = { [0 ... MAX_NR_ZONES - 1] = 0 };
+	unsigned long i, j, pfn;
+#endif
 
 	pagetable_init();
 
@@ -174,29 +200,17 @@ #ifdef CONFIG_HIGHMEM
 		zones_size[ZONE_HIGHMEM] = high - low;
 #endif
 
+#ifdef CONFIG_SPARSEMEM
+	pfn = 0;
+	for (i = 0; i < MAX_NR_ZONES; i++)
+		for (j = 0; j < zones_size[i]; j++, pfn++)
+			if (!page_is_ram(pfn))
+				zholes_size[i]++;
+	free_area_init_node(0, NODE_DATA(0), zones_size,
+			    __pa(PAGE_OFFSET), zholes_size);
+#else
 	free_area_init(zones_size);
-}
-
-static inline int page_is_ram(unsigned long pagenr)
-{
-	int i;
-
-	for (i = 0; i < boot_mem_map.nr_map; i++) {
-		unsigned long addr, end;
-
-		if (boot_mem_map.map[i].type != BOOT_MEM_RAM)
-			/* not usable memory */
-			continue;
-
-		addr = PFN_UP(boot_mem_map.map[i].addr);
-		end = PFN_DOWN(boot_mem_map.map[i].addr +
-			       boot_mem_map.map[i].size);
-
-		if (pagenr >= addr && pagenr < end)
-			return 1;
-	}
-
-	return 0;
+#endif
 }
 
 static struct kcore_list kcore_mem, kcore_vmalloc;
@@ -213,9 +227,9 @@ #ifdef CONFIG_HIGHMEM
 #ifdef CONFIG_DISCONTIGMEM
 #error "CONFIG_HIGHMEM and CONFIG_DISCONTIGMEM dont work together yet"
 #endif
-	max_mapnr = num_physpages = highend_pfn;
+	max_mapnr = highend_pfn;
 #else
-	max_mapnr = num_physpages = max_low_pfn;
+	max_mapnr = max_low_pfn;
 #endif
 	high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT);
 
@@ -229,6 +243,7 @@ #endif
 			if (PageReserved(pfn_to_page(tmp)))
 				reservedpages++;
 		}
+	num_physpages = ram;
 
 #ifdef CONFIG_HIGHMEM
 	for (tmp = highstart_pfn; tmp < highend_pfn; tmp++) {
@@ -247,6 +262,7 @@ #endif
 		totalhigh_pages++;
 	}
 	totalram_pages += totalhigh_pages;
+	num_physpages += totalhigh_pages;
 #endif
 
 	codesize =  (unsigned long) &_etext - (unsigned long) &_text;

From ths@networkno.de Wed Jul  5 14:26:50 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 05 Jul 2006 14:26:59 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:16861 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8133380AbWGEN0u (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 5 Jul 2006 14:26:50 +0100
Received: from lagash (mipsfw.mips-uk.com [194.74.144.146])
	(using TLSv1 with cipher DES-CBC3-SHA (168/168 bits))
	(No client certificate requested)
	by bender.bawue.de (Postfix) with ESMTP
	id CB4504413B; Wed,  5 Jul 2006 15:26:49 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1Fy7Oo-0008Fe-Fu; Wed, 05 Jul 2006 14:26:38 +0100
Date:	Wed, 5 Jul 2006 14:26:38 +0100
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] Improve interrupt latency again for sb1250/bcm1480
Message-ID: <20060705132638.GC29112@networkno.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.11+cvs20060403
From:	Thiemo Seufer <ths@networkno.de>
Return-Path: <ths@networkno.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11914
X-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

Hello All,

this patch restores the behaviour of the old (assembly-written)
interrupt handler, the handler is left as soon as a single interrupt
cause is handled.


Thiemo


diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c
index 0eb0b10..ed325f0 100644
--- a/arch/mips/sibyte/bcm1480/irq.c
+++ b/arch/mips/sibyte/bcm1480/irq.c
@@ -502,22 +502,23 @@ #endif
 #ifdef CONFIG_SIBYTE_BCM1480_PROF
 	if (pending & CAUSEF_IP7)	/* Cpu performance counter interrupt */
 		sbprof_cpu_intr(exception_epc(regs));
+	else
 #endif
 
 	if (pending & CAUSEF_IP4)
 		bcm1480_timer_interrupt(regs);
 
 #ifdef CONFIG_SMP
-	if (pending & CAUSEF_IP3)
+	else if (pending & CAUSEF_IP3)
 		bcm1480_mailbox_interrupt(regs);
 #endif
 
 #ifdef CONFIG_KGDB
-	if (pending & CAUSEF_IP6)
+	else if (pending & CAUSEF_IP6)
 		bcm1480_kgdb_interrupt(regs);		/* KGDB (uart 1) */
 #endif
 
-	if (pending & CAUSEF_IP2) {
+	else if (pending & CAUSEF_IP2) {
 		unsigned long long mask_h, mask_l;
 		unsigned long base;
 
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c
index 8d49cb5..1de71ad 100644
--- a/arch/mips/sibyte/sb1250/irq.c
+++ b/arch/mips/sibyte/sb1250/irq.c
@@ -460,25 +460,25 @@ #endif
 	pending = read_c0_cause();
 
 #ifdef CONFIG_SIBYTE_SB1250_PROF
-	if (pending & CAUSEF_IP7) { /* Cpu performance counter interrupt */
+	if (pending & CAUSEF_IP7) /* Cpu performance counter interrupt */
 		sbprof_cpu_intr(exception_epc(regs));
-	}
+	else
 #endif
 
 	if (pending & CAUSEF_IP4)
 		sb1250_timer_interrupt(regs);
 
 #ifdef CONFIG_SMP
-	if (pending & CAUSEF_IP3)
+	else if (pending & CAUSEF_IP3)
 		sb1250_mailbox_interrupt(regs);
 #endif
 
 #ifdef CONFIG_KGDB
-	if (pending & CAUSEF_IP6)			/* KGDB (uart 1) */
+	else if (pending & CAUSEF_IP6)			/* KGDB (uart 1) */
 		sb1250_kgdb_interrupt(regs);
 #endif
 
-	if (pending & CAUSEF_IP2) {
+	else if (pending & CAUSEF_IP2) {
 		unsigned long long mask;
 
 		/*

From ths@networkno.de Wed Jul  5 14:33:07 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 05 Jul 2006 14:33:16 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:3806 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8133380AbWGENdH (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 5 Jul 2006 14:33:07 +0100
Received: from lagash (mipsfw.mips-uk.com [194.74.144.146])
	(using TLSv1 with cipher DES-CBC3-SHA (168/168 bits))
	(No client certificate requested)
	by bender.bawue.de (Postfix) with ESMTP
	id 1B17A44672; Wed,  5 Jul 2006 15:33:02 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1Fy7Up-0008Gu-Na; Wed, 05 Jul 2006 14:32:51 +0100
Date:	Wed, 5 Jul 2006 14:32:51 +0100
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] Fix fatal typo for bcm1480
Message-ID: <20060705133251.GD29112@networkno.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.11+cvs20060403
From:	Thiemo Seufer <ths@networkno.de>
Return-Path: <ths@networkno.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11915
X-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

Hello All,

this fixes a fatal typo which crept in the rewritten interrupt handler.


Thiemo


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


--- a/arch/mips/sibyte/bcm1480/irq.c
+++ b/arch/mips/sibyte/bcm1480/irq.c
@@ -533,7 +533,7 @@ #endif
 		mask_l = __raw_readq(
 			IOADDR(base + R_BCM1480_IMR_INTERRUPT_STATUS_BASE_L));
 
-		if (!mask_h) {
+		if (mask_h) {
 			if (mask_h ^ 1)
 				do_IRQ(63 - dclz(mask_h), regs);
 			else

From ths@networkno.de Wed Jul  5 14:34:19 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 05 Jul 2006 14:34:30 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:9950 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8133380AbWGENeT (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 5 Jul 2006 14:34:19 +0100
Received: from lagash (mipsfw.mips-uk.com [194.74.144.146])
	(using TLSv1 with cipher DES-CBC3-SHA (168/168 bits))
	(No client certificate requested)
	by bender.bawue.de (Postfix) with ESMTP
	id 3E6234455E; Wed,  5 Jul 2006 15:34:18 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1Fy7W3-0008Hb-Qo; Wed, 05 Jul 2006 14:34:07 +0100
Date:	Wed, 5 Jul 2006 14:34:07 +0100
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] Fix build failure in sb1250_duart.c
Message-ID: <20060705133407.GE29112@networkno.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.11+cvs20060403
From:	Thiemo Seufer <ths@networkno.de>
Return-Path: <ths@networkno.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11916
X-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

Hello All,

this fixes a build failure caused by the devfs removal.


Thiemo


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


--- a/drivers/char/sb1250_duart.c
+++ b/drivers/char/sb1250_duart.c
@@ -763,7 +763,6 @@ static int __init sb1250_duart_init(void
 
 	sb1250_duart_driver->owner = THIS_MODULE;
 	sb1250_duart_driver->name = "duart";
-	sb1250_duart_driver->devfs_name = "duart/";
 	sb1250_duart_driver->major = TTY_MAJOR;
 	sb1250_duart_driver->minor_start = SB1250_DUART_MINOR_BASE;
 	sb1250_duart_driver->type            = TTY_DRIVER_TYPE_SERIAL;

From vagabon.xyz@gmail.com Wed Jul  5 14:54:15 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 05 Jul 2006 14:54:25 +0100 (BST)
Received: from ug-out-1314.google.com ([66.249.92.173]:30699 "EHLO
	ug-out-1314.google.com") by ftp.linux-mips.org with ESMTP
	id S8133454AbWGENyP (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 5 Jul 2006 14:54:15 +0100
Received: by ug-out-1314.google.com with SMTP id u2so2203928uge
        for <linux-mips@linux-mips.org>; Wed, 05 Jul 2006 06:54:15 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:reply-to:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:from;
        b=ujjyJfL9zq1ltiAzXmAnRRQ4b7F9tDmyHyJ5QFSN5z3t0+7iMx6620Qnaa0SOiFJU9+Z3cYSmLReI4RqDLqkXDwzM3eMgnDtq40tOqjpn1FCuVNb/0a0ulyCkpzELByng+E8r5yLDIo2KEgxFmiMshVC8RpAiE7pVUlYBk4EsqQ=
Received: by 10.78.167.12 with SMTP id p12mr3513568hue;
        Wed, 05 Jul 2006 06:54:14 -0700 (PDT)
Received: from ?192.168.0.24? ( [194.3.162.233])
        by mx.gmail.com with ESMTP id 33sm2343758hue.2006.07.05.06.54.11;
        Wed, 05 Jul 2006 06:54:14 -0700 (PDT)
Message-ID: <44ABC59C.6070607@innova-card.com>
Date:	Wed, 05 Jul 2006 15:58:52 +0200
Reply-To: Franck <vagabon.xyz@gmail.com>
User-Agent: Thunderbird 1.5.0.2 (X11/20060501)
MIME-Version: 1.0
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
CC:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] do not count pages in holes with sparsemem
References: <20060705.221354.74751389.anemo@mba.ocn.ne.jp>
In-Reply-To: <20060705.221354.74751389.anemo@mba.ocn.ne.jp>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From:	Franck Bui-Huu <vagabon.xyz@gmail.com>
Return-Path: <vagabon.xyz@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: 11917
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: vagabon.xyz@gmail.com
Precedence: bulk
X-list: linux-mips

Atsushi Nemoto wrote:
> With SPARSEMEM, the single node can contains some holes so there might
> be many invalid pages.  For example, with two 256M memory and one 256M

Does SPARSEMEM is the only memory model where we can have memory holes ?

> hole, some variables (num_physpage, totalpages, nr_kernel_pages,
> nr_all_pages, etc.) will indicate that there are 768MB on this system.
> This is not desired because, for example, alloc_large_system_hash()
> allocates too many entries.
> 
> Use free_area_init_node() with counted zholes_size[] instead of
> free_area_init().
> 
> For num_physpages, use number of ram pages instead of max_low_pfn.
> 
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
> 
> diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
> index 802bdd3..d41dee5 100644
> --- a/arch/mips/mm/init.c
> +++ b/arch/mips/mm/init.c

[snip]

>  
> @@ -174,29 +200,17 @@ #ifdef CONFIG_HIGHMEM
>  		zones_size[ZONE_HIGHMEM] = high - low;
>  #endif
>  
> +#ifdef CONFIG_SPARSEMEM
> +	pfn = 0;
> +	for (i = 0; i < MAX_NR_ZONES; i++)
> +		for (j = 0; j < zones_size[i]; j++, pfn++)
> +			if (!page_is_ram(pfn))
> +				zholes_size[i]++;
> +	free_area_init_node(0, NODE_DATA(0), zones_size,
> +			    __pa(PAGE_OFFSET), zholes_size);


Does this code really need the ifdef CONFIG_SPARSEMEM ? Can't we make
it generic instead. Only zholes_size[] initialisation really depends
on the memory model. Of course FLATMEM will let zholes_size as is...

If I remember correctly free_area_init_node() takes a pfn number as
fourth parameter: __pa(PAGE_OFFSET) results in a physical address...

BTW why using __pa(OFFSET) ? isn't it going to yield always into 0 ?
At least on MIPS, it's defined as

#define __pa(x)	((unsigned long) (x) - PAGE_OFFSET)

why not using ARCH_PFN_OFFSET instead ?

thanks

		Franck


From anemo@mba.ocn.ne.jp Wed Jul  5 15:16:31 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 05 Jul 2006 15:16:40 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:27336 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133536AbWGEOQb (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 5 Jul 2006 15:16:31 +0100
Received: from localhost (p8107-ipad212funabasi.chiba.ocn.ne.jp [58.91.172.107])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id AA691B7B6; Wed,  5 Jul 2006 23:16:22 +0900 (JST)
Date:	Wed, 05 Jul 2006 23:17:37 +0900 (JST)
Message-Id: <20060705.231737.59032119.anemo@mba.ocn.ne.jp>
To:	vagabon.xyz@gmail.com
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] do not count pages in holes with sparsemem
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <44ABC59C.6070607@innova-card.com>
References: <20060705.221354.74751389.anemo@mba.ocn.ne.jp>
	<44ABC59C.6070607@innova-card.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 3.3 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11918
X-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

On Wed, 05 Jul 2006 15:58:52 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
> Does SPARSEMEM is the only memory model where we can have memory holes ?
...
> Does this code really need the ifdef CONFIG_SPARSEMEM ? Can't we make
> it generic instead. Only zholes_size[] initialisation really depends
> on the memory model. Of course FLATMEM will let zholes_size as is...
 
Indeed.  Others can have holes, but might be a bit ineffective.

> If I remember correctly free_area_init_node() takes a pfn number as
> fourth parameter: __pa(PAGE_OFFSET) results in a physical address...

You are right.

> BTW why using __pa(OFFSET) ? isn't it going to yield always into 0 ?
> At least on MIPS, it's defined as
> 
> #define __pa(x)	((unsigned long) (x) - PAGE_OFFSET)
> 
> why not using ARCH_PFN_OFFSET instead ?

Indeed.  I copied the code from free_area_init().  I think 0 is enough
for MIPS.  Patch revised.  Thank you for comments.


With some memory model other than FLATMEM, the single node can
contains some holes so there might be many invalid pages.  For
example, with two 256M memory and one 256M hole, some variables
(num_physpage, totalpages, nr_kernel_pages, nr_all_pages, etc.) will
indicate that there are 768MB on this system.  This is not desired
because, for example, alloc_large_system_hash() allocates too many
entries.

Use free_area_init_node() with counted zholes_size[] instead of
free_area_init().

For num_physpages, use number of ram pages instead of max_low_pfn.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 802bdd3..6c68b2a 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -139,10 +139,36 @@ #endif /* CONFIG_HIGHMEM */
 #ifndef CONFIG_NEED_MULTIPLE_NODES
 extern void pagetable_init(void);
 
+static int __init page_is_ram(unsigned long pagenr)
+{
+	int i;
+
+	for (i = 0; i < boot_mem_map.nr_map; i++) {
+		unsigned long addr, end;
+
+		if (boot_mem_map.map[i].type != BOOT_MEM_RAM)
+			/* not usable memory */
+			continue;
+
+		addr = PFN_UP(boot_mem_map.map[i].addr);
+		end = PFN_DOWN(boot_mem_map.map[i].addr +
+			       boot_mem_map.map[i].size);
+
+		if (pagenr >= addr && pagenr < end)
+			return 1;
+	}
+
+	return 0;
+}
+
 void __init paging_init(void)
 {
-	unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};
+	unsigned long zones_size[] = { [0 ... MAX_NR_ZONES - 1] = 0 };
 	unsigned long max_dma, high, low;
+	unsigned long zholes_size[] = { [0 ... MAX_NR_ZONES - 1] = 0 };
+#ifndef CONFIG_FLATMEM
+	unsigned long i, j, pfn;
+#endif
 
 	pagetable_init();
 
@@ -174,29 +200,14 @@ #ifdef CONFIG_HIGHMEM
 		zones_size[ZONE_HIGHMEM] = high - low;
 #endif
 
-	free_area_init(zones_size);
-}
-
-static inline int page_is_ram(unsigned long pagenr)
-{
-	int i;
-
-	for (i = 0; i < boot_mem_map.nr_map; i++) {
-		unsigned long addr, end;
-
-		if (boot_mem_map.map[i].type != BOOT_MEM_RAM)
-			/* not usable memory */
-			continue;
-
-		addr = PFN_UP(boot_mem_map.map[i].addr);
-		end = PFN_DOWN(boot_mem_map.map[i].addr +
-			       boot_mem_map.map[i].size);
-
-		if (pagenr >= addr && pagenr < end)
-			return 1;
-	}
-
-	return 0;
+#ifndef CONFIG_FLATMEM
+	pfn = 0;
+	for (i = 0; i < MAX_NR_ZONES; i++)
+		for (j = 0; j < zones_size[i]; j++, pfn++)
+			if (!page_is_ram(pfn))
+				zholes_size[i]++;
+#endif
+	free_area_init_node(0, NODE_DATA(0), zones_size, 0, zholes_size);
 }
 
 static struct kcore_list kcore_mem, kcore_vmalloc;
@@ -213,9 +224,9 @@ #ifdef CONFIG_HIGHMEM
 #ifdef CONFIG_DISCONTIGMEM
 #error "CONFIG_HIGHMEM and CONFIG_DISCONTIGMEM dont work together yet"
 #endif
-	max_mapnr = num_physpages = highend_pfn;
+	max_mapnr = highend_pfn;
 #else
-	max_mapnr = num_physpages = max_low_pfn;
+	max_mapnr = max_low_pfn;
 #endif
 	high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT);
 
@@ -229,6 +240,7 @@ #endif
 			if (PageReserved(pfn_to_page(tmp)))
 				reservedpages++;
 		}
+	num_physpages = ram;
 
 #ifdef CONFIG_HIGHMEM
 	for (tmp = highstart_pfn; tmp < highend_pfn; tmp++) {
@@ -247,6 +259,7 @@ #endif
 		totalhigh_pages++;
 	}
 	totalram_pages += totalhigh_pages;
+	num_physpages += totalhigh_pages;
 #endif
 
 	codesize =  (unsigned long) &_etext - (unsigned long) &_text;

From ths@networkno.de Wed Jul  5 18:43:44 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 05 Jul 2006 18:43:55 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:48546 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8133778AbWGERno (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 5 Jul 2006 18:43:44 +0100
Received: from lagash (mipsfw.mips-uk.com [194.74.144.146])
	(using TLSv1 with cipher DES-CBC3-SHA (168/168 bits))
	(No client certificate requested)
	by bender.bawue.de (Postfix) with ESMTP
	id 45C88443C9; Wed,  5 Jul 2006 19:43:41 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1FyBPN-0005Ar-7O; Wed, 05 Jul 2006 18:43:29 +0100
Date:	Wed, 5 Jul 2006 18:43:29 +0100
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] Search+replace gone wrong...
Message-ID: <20060705174329.GA15138@networkno.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.11+cvs20060403
From:	Thiemo Seufer <ths@networkno.de>
Return-Path: <ths@networkno.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11919
X-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

Hello All,

some random hit by search+replace, it seems.


Thiemo


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


diff --git a/arch/mips/sgi-ip32/ip32-irq.c b/arch/mips/sgi-ip32/ip32-irq.c
index ac658c4..c64a820 100644
--- a/arch/mips/sgi-ip32/ip32-irq.c
+++ b/arch/mips/sgi-ip32/ip32-irq.c
@@ -316,9 +316,9 @@ #define MACEISA_MISC_INT	(MACEISA_RTC_IN
 				 MACEISA_KEYB_POLL_INT |	\
 				 MACEISA_MOUSE_INT |		\
 				 MACEISA_MOUSE_POLL_INT |	\
-				 MACEIIRQF_TIMER0_INT |		\
-				 MACEIIRQF_TIMER1_INT |		\
-				 MACEIIRQF_TIMER2_INT)
+				 MACEISA_TIMER0_INT |		\
+				 MACEISA_TIMER1_INT |		\
+				 MACEISA_TIMER2_INT)
 #define MACEISA_SUPERIO_INT	(MACEISA_PARALLEL_INT |		\
 				 MACEISA_PAR_CTXA_INT |		\
 				 MACEISA_PAR_CTXB_INT |		\
@@ -349,7 +349,7 @@ static void enable_maceisa_irq (unsigned
 	case MACEISA_AUDIO_SW_IRQ ... MACEISA_AUDIO3_MERR_IRQ:
 		crime_int = MACE_AUDIO_INT;
 		break;
-	case MACEISA_RTC_IRQ ... MACEIIRQF_TIMER2_IRQ:
+	case MACEISA_RTC_IRQ ... MACEISA_TIMER2_IRQ:
 		crime_int = MACE_MISC_INT;
 		break;
 	case MACEISA_PARALLEL_IRQ ... MACEISA_SERIAL2_RDMAOR_IRQ:

From vagabon.xyz@gmail.com Thu Jul  6 14:07:24 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Jul 2006 14:07:34 +0100 (BST)
Received: from nf-out-0910.google.com ([64.233.182.184]:32010 "EHLO
	nf-out-0910.google.com") by ftp.linux-mips.org with ESMTP
	id S3466326AbWGFNHY (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 6 Jul 2006 14:07:24 +0100
Received: by nf-out-0910.google.com with SMTP id a27so79996nfc
        for <linux-mips@linux-mips.org>; Thu, 06 Jul 2006 06:07:24 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:reply-to:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:from;
        b=CLDP9vO0jhrpmySENUWO5UK5vUuT/MlvQRje0LeI5IgzYGvK5Qeiv8KuLyFhgfNe1S6CKYM95N/YqTeop2ww5V+Wr4+XKdjwDUJ+UcsN86SBtHAtYHaSPehBFr4Ng1C0EFYq4aRtuDWGkFaiyb7V2lkZlWSKyBRM8U2gAxTRz5c=
Received: by 10.48.80.3 with SMTP id d3mr449227nfb;
        Thu, 06 Jul 2006 06:07:23 -0700 (PDT)
Received: from ?192.168.0.24? ( [194.3.162.233])
        by mx.gmail.com with ESMTP id l22sm6713706nfc.2006.07.06.06.07.22;
        Thu, 06 Jul 2006 06:07:23 -0700 (PDT)
Message-ID: <44AD0C2B.7060204@innova-card.com>
Date:	Thu, 06 Jul 2006 15:12:11 +0200
Reply-To: Franck <vagabon.xyz@gmail.com>
User-Agent: Thunderbird 1.5.0.2 (X11/20060501)
MIME-Version: 1.0
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
CC:	vagabon.xyz@gmail.com, linux-mips@linux-mips.org,
	ralf@linux-mips.org
Subject: Re: [PATCH] do not count pages in holes with sparsemem
References: <20060705.221354.74751389.anemo@mba.ocn.ne.jp>	<44ABC59C.6070607@innova-card.com> <20060705.231737.59032119.anemo@mba.ocn.ne.jp>
In-Reply-To: <20060705.231737.59032119.anemo@mba.ocn.ne.jp>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From:	Franck Bui-Huu <vagabon.xyz@gmail.com>
Return-Path: <vagabon.xyz@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: 11920
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: vagabon.xyz@gmail.com
Precedence: bulk
X-list: linux-mips

Atsushi Nemoto wrote:
> On Wed, 05 Jul 2006 15:58:52 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
>> BTW why using __pa(OFFSET) ? isn't it going to yield always into 0 ?
>> At least on MIPS, it's defined as
>>
>> #define __pa(x)	((unsigned long) (x) - PAGE_OFFSET)
>>
>> why not using ARCH_PFN_OFFSET instead ?
> 
> Indeed.  I copied the code from free_area_init().  I think 0 is enough
> for MIPS.  Patch revised.  Thank you for comments.
> 
> 

Ok thinking more about it, some platforms may have physical memory
that doesn't start at 0. MIPS doesn't support such platform though it
should be fairly easy. In that case __pa should be defined as:

	#define __pa(x)	((unsigned long) (x) - PAGE_OFFSET + PFN_PHYS(ARCH_PFN_OFFSET))

and use in your patch:

	free_area_init_node(0, NODE_DATA(0), zones_size, ARCH_PFN_OFFSET, zholes_size);

So I would recommend to use ARCH_PFN_OFFSET.

		Franck

From anemo@mba.ocn.ne.jp Thu Jul  6 15:35:25 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Jul 2006 15:35:36 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:59886 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S3466333AbWGFOfZ (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 6 Jul 2006 15:35:25 +0100
Received: from localhost (p4085-ipad209funabasi.chiba.ocn.ne.jp [58.88.115.85])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 211ABB6DB; Thu,  6 Jul 2006 23:35:19 +0900 (JST)
Date:	Thu, 06 Jul 2006 23:36:34 +0900 (JST)
Message-Id: <20060706.233634.59465089.anemo@mba.ocn.ne.jp>
To:	vagabon.xyz@gmail.com
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] do not count pages in holes with sparsemem
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <44AD0C2B.7060204@innova-card.com>
References: <44ABC59C.6070607@innova-card.com>
	<20060705.231737.59032119.anemo@mba.ocn.ne.jp>
	<44AD0C2B.7060204@innova-card.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 3.3 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11921
X-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

On Thu, 06 Jul 2006 15:12:11 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
> Ok thinking more about it, some platforms may have physical memory
> that doesn't start at 0. MIPS doesn't support such platform though it
> should be fairly easy. In that case __pa should be defined as:
> 
> 	#define __pa(x)	((unsigned long) (x) - PAGE_OFFSET + PFN_PHYS(ARCH_PFN_OFFSET))
> 
> and use in your patch:
> 
> 	free_area_init_node(0, NODE_DATA(0), zones_size, ARCH_PFN_OFFSET, zholes_size);
> 
> So I would recommend to use ARCH_PFN_OFFSET.

Well, currently ARCH_PFN_OFFSET is defined in
asm-generic/memory_model.h only for FLATMEM case.  I think other
memory models do not need it because it is just a case that a first
hole begins at pfn 0.

---
Atsushi Nemoto

From vagabon.xyz@gmail.com Thu Jul  6 15:54:14 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Jul 2006 15:54:24 +0100 (BST)
Received: from nf-out-0910.google.com ([64.233.182.187]:3492 "EHLO
	nf-out-0910.google.com") by ftp.linux-mips.org with ESMTP
	id S3466417AbWGFOyO (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 6 Jul 2006 15:54:14 +0100
Received: by nf-out-0910.google.com with SMTP id x30so154687nfb
        for <linux-mips@linux-mips.org>; Thu, 06 Jul 2006 07:54:14 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:reply-to:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:from;
        b=ayGo4llO081s8g9x84xS8lYYFx0M9A0eVHn32F30/5Gu0Drj5OBGyTIUg89cz4ylTuXNCBekcgrvUBBvzrnRhedy/LErROrR6o5oHUr6PmT9aNGZ70B3V1U2w4MxHl6WLiiYm03meduRol/ILvT0dteTYGPORXY/mX4OTeM+KqE=
Received: by 10.48.231.6 with SMTP id d6mr523703nfh;
        Thu, 06 Jul 2006 07:54:14 -0700 (PDT)
Received: from ?192.168.0.24? ( [194.3.162.233])
        by mx.gmail.com with ESMTP id r33sm8288584nfc.2006.07.06.07.54.13;
        Thu, 06 Jul 2006 07:54:13 -0700 (PDT)
Message-ID: <44AD2537.1030509@innova-card.com>
Date:	Thu, 06 Jul 2006 16:59:03 +0200
Reply-To: Franck <vagabon.xyz@gmail.com>
User-Agent: Thunderbird 1.5.0.2 (X11/20060501)
MIME-Version: 1.0
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
CC:	vagabon.xyz@gmail.com, linux-mips@linux-mips.org,
	ralf@linux-mips.org
Subject: Re: [PATCH] do not count pages in holes with sparsemem
References: <44ABC59C.6070607@innova-card.com>	<20060705.231737.59032119.anemo@mba.ocn.ne.jp>	<44AD0C2B.7060204@innova-card.com> <20060706.233634.59465089.anemo@mba.ocn.ne.jp>
In-Reply-To: <20060706.233634.59465089.anemo@mba.ocn.ne.jp>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
From:	Franck Bui-Huu <vagabon.xyz@gmail.com>
Return-Path: <vagabon.xyz@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: 11922
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: vagabon.xyz@gmail.com
Precedence: bulk
X-list: linux-mips

Atsushi Nemoto wrote:
> On Thu, 06 Jul 2006 15:12:11 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
>> Ok thinking more about it, some platforms may have physical memory
>> that doesn't start at 0. MIPS doesn't support such platform though it
>> should be fairly easy. In that case __pa should be defined as:
>>
>> 	#define __pa(x)	((unsigned long) (x) - PAGE_OFFSET + PFN_PHYS(ARCH_PFN_OFFSET))
>>
>> and use in your patch:
>>
>> 	free_area_init_node(0, NODE_DATA(0), zones_size, ARCH_PFN_OFFSET, zholes_size);
>>
>> So I would recommend to use ARCH_PFN_OFFSET.
> 
> Well, currently ARCH_PFN_OFFSET is defined in
> asm-generic/memory_model.h only for FLATMEM case.  I think other
> memory models do not need it because it is just a case that a first
> hole begins at pfn 0.
> 

That's true, I thought it was defined whatever the mem models...

what about this, on top of your patch ?

-- >8 --

diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index c6e684d..eb1b3fc 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -166,8 +166,8 @@ void __init paging_init(void)
 {
 	unsigned long zones_size[] = { [0 ... MAX_NR_ZONES - 1] = 0 };
 	unsigned long max_dma, high, low;
-	unsigned long zholes_size[] = { [0 ... MAX_NR_ZONES - 1] = 0 };
 #ifndef CONFIG_FLATMEM
+	unsigned long zholes_size[] = { [0 ... MAX_NR_ZONES - 1] = 0 };
 	unsigned long i, j, pfn;
 #endif
 
@@ -207,8 +207,10 @@ #ifndef CONFIG_FLATMEM
 		for (j = 0; j < zones_size[i]; j++, pfn++)
 			if (!page_is_ram(pfn))
 				zholes_size[i]++;
-#endif
 	free_area_init_node(0, NODE_DATA(0), zones_size, 0, zholes_size);
+#else
+	free_area_init_node(0, NODE_DATA(0), zones_size, ARCH_PFN_OFFSET, NULL);
+#endif
 }
 
 static struct kcore_list kcore_mem, kcore_vmalloc;

From vagabon.xyz@gmail.com Thu Jul  6 16:05:36 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Jul 2006 16:05:46 +0100 (BST)
Received: from ug-out-1314.google.com ([66.249.92.174]:29019 "EHLO
	ug-out-1314.google.com") by ftp.linux-mips.org with ESMTP
	id S3466417AbWGFPFg (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 6 Jul 2006 16:05:36 +0100
Received: by ug-out-1314.google.com with SMTP id k3so2155542ugf
        for <linux-mips@linux-mips.org>; Thu, 06 Jul 2006 08:05:36 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references;
        b=KjATFb+4IkDMblfk2E/xlQIIqIgnf54EL6Ocx+D2nK83XiI05qIyf/Bm0AVvvQYTaxo0nbznSYKgqtKSCXh/WNOzr9QHaY/6jklk4LTbM26Vkt1glLOtWrkdOOzYJI20Dzk8e/MODsXuOKiwKCVYQ1WUtoDNFHJFy+L0XNN7A0Q=
Received: by 10.67.100.17 with SMTP id c17mr825964ugm;
        Thu, 06 Jul 2006 08:05:35 -0700 (PDT)
Received: by 10.67.100.10 with HTTP; Thu, 6 Jul 2006 08:05:35 -0700 (PDT)
Message-ID: <cda58cb80607060805yc656114p53516b904188c20f@mail.gmail.com>
Date:	Thu, 6 Jul 2006 17:05:35 +0200
From:	"Franck Bui-Huu" <vagabon.xyz@gmail.com>
To:	"Atsushi Nemoto" <anemo@mba.ocn.ne.jp>
Subject: Re: [PATCH] do not count pages in holes with sparsemem
Cc:	vagabon.xyz@gmail.com, linux-mips@linux-mips.org,
	ralf@linux-mips.org
In-Reply-To: <44AD2537.1030509@innova-card.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <44ABC59C.6070607@innova-card.com>
	 <20060705.231737.59032119.anemo@mba.ocn.ne.jp>
	 <44AD0C2B.7060204@innova-card.com>
	 <20060706.233634.59465089.anemo@mba.ocn.ne.jp>
	 <44AD2537.1030509@innova-card.com>
Return-Path: <vagabon.xyz@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: 11923
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: vagabon.xyz@gmail.com
Precedence: bulk
X-list: linux-mips

2006/7/6, Franck Bui-Huu <vagabon.xyz@gmail.com>:
> @@ -207,8 +207,10 @@ #ifndef CONFIG_FLATMEM
>                 for (j = 0; j < zones_size[i]; j++, pfn++)
>                         if (!page_is_ram(pfn))
>                                 zholes_size[i]++;
> -#endif
>         free_area_init_node(0, NODE_DATA(0), zones_size, 0, zholes_size);
> +#else
> +       free_area_init_node(0, NODE_DATA(0), zones_size, ARCH_PFN_OFFSET, NULL);

which is equivalent to:

       free_area_init(zones_size);

-- 
               Franck

From anemo@mba.ocn.ne.jp Thu Jul  6 16:24:56 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Jul 2006 16:25:11 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:42480 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S3466417AbWGFPY4 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 6 Jul 2006 16:24:56 +0100
Received: from localhost (p4085-ipad209funabasi.chiba.ocn.ne.jp [58.88.115.85])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 2B3FDAE85; Fri,  7 Jul 2006 00:24:52 +0900 (JST)
Date:	Fri, 07 Jul 2006 00:26:02 +0900 (JST)
Message-Id: <20060707.002602.75184460.anemo@mba.ocn.ne.jp>
To:	vagabon.xyz@gmail.com
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] do not count pages in holes with sparsemem
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <cda58cb80607060805yc656114p53516b904188c20f@mail.gmail.com>
References: <20060706.233634.59465089.anemo@mba.ocn.ne.jp>
	<44AD2537.1030509@innova-card.com>
	<cda58cb80607060805yc656114p53516b904188c20f@mail.gmail.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 3.3 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11924
X-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

On Thu, 6 Jul 2006 17:05:35 +0200, "Franck Bui-Huu" <vagabon.xyz@gmail.com> wrote:
> >         free_area_init_node(0, NODE_DATA(0), zones_size, 0, zholes_size);
> > +#else
> > +       free_area_init_node(0, NODE_DATA(0), zones_size, ARCH_PFN_OFFSET, NULL);
> 
> which is equivalent to:
> 
>        free_area_init(zones_size);

Sure.  Then this can be a final proposal?


With some memory model other than FLATMEM, the single node can
contains some holes so there might be many invalid pages.  For
example, with two 256M memory and one 256M hole, some variables
(num_physpage, totalpages, nr_kernel_pages, nr_all_pages, etc.) will
indicate that there are 768MB on this system.  This is not desired
because, f