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
c2lnbmVkIHRvIHJlZHVjZSBDUFUgYW5kIGludGVycnVwdCBsb2FkCisJICB3aGVu
IHRoZSBkcml2ZXIgaXMgcmVjZWl2aW5nIGxvdHMgb2YgcGFja2V0cyBmcm9tIHRo
ZSBjYXJkLiBJdCBpcworCSAgc3RpbGwgc29tZXdoYXQgZXhwZXJpbWVudGFsIGFu
ZCB0aHVzIG5vdCB5ZXQgZW5hYmxlZCBieSBkZWZhdWx0LgorCisJICBJZiB5b3Vy
IGVzdGltYXRlZCBSeCBsb2FkIGlzIDEwa3BwcyBvciBtb3JlLCBvciBpZiB0aGUg
Y2FyZCB3aWxsIGJlCisJICBkZXBsb3llZCBvbiBwb3RlbnRpYWxseSB1bmZyaWVu
ZGx5IG5ldHdvcmtzIChlLmcuIGluIGEgZmlyZXdhbGwpLAorCSAgdGhlbiBzYXkg
WSBoZXJlLgorCisJICBTZWUgPGZpbGU6RG9jdW1lbnRhdGlvbi9uZXR3b3JraW5n
L05BUElfSE9XVE8udHh0PiBmb3IgbW9yZQorCSAgaW5mb3JtYXRpb24uCisKKwkg
IElmIGluIGRvdWJ0LCBzYXkgeS4KKwogY29uZmlnIFNJUzE5MAogCXRyaXN0YXRl
ICJTaVMxOTAvU2lTMTkxIGdpZ2FiaXQgZXRoZXJuZXQgc3VwcG9ydCIKIAlkZXBl
bmRzIG9uIFBDSQotLS0gYS9kcml2ZXJzL25ldC9zYjEyNTAtbWFjLmMJMjAwNi0w
Ny0wMSAwNjoyOToyNy4wMDAwMDAwMDAgLTA1MDAKKysrIGIvZHJpdmVycy9uZXQv
c2IxMjUwLW1hYy5jCTIwMDYtMDctMDEgMDY6Mjk6MTguMDAwMDAwMDAwIC0wNTAw
CkBAIC0xNjQsNiArMTY0LDI1IEBAIHR5cGVkZWYgZW51bSB7IHNibWFjX3N0YXRl
X3VuaW5pdCwgc2JtYWMKICNkZWZpbmUgRU5FVF9QQUNLRVRfU0laRQkxNTE4CiAv
KiNkZWZpbmUgRU5FVF9QQUNLRVRfU0laRQk5MjE2ICovCiAKKworI2lmZGVmIENP
TkZJR19TQk1BQ19DT0FMRVNDRQorLyoKKyAqIEFjY2VwdCBhbnkgVFggaW50ZXJy
dXB0IGFuZCBFT1AgY291bnQvdGltZXIgUlggaW50ZXJydXB0cyBvbiBjaCAwCisg
Ki8KKyNkZWZpbmUgU0VUX0lOVFJfTUFTSyhTKSBcCitfX3Jhd193cml0ZXEoKChN
X01BQ19JTlRfRU9QX0NPVU5UIHwgTV9NQUNfSU5UX0VPUF9USU1FUikgPDwgU19N
QUNfVFhfQ0gwKSB8IFwKKwkgICAgICgoTV9NQUNfSU5UX0VPUF9DT1VOVCB8IE1f
TUFDX0lOVF9FT1BfVElNRVIpIDw8IFNfTUFDX1JYX0NIMCksIFwKKwkgICAgIChT
KS0+c2JtX2ltcik7CisjZWxzZQorLyoKKyAqIEFjY2VwdCBhbnkga2luZCBvZiBp
bnRlcnJ1cHQgb24gVFggYW5kIFJYIERNQSBjaGFubmVsIDAKKyAqLworI2RlZmlu
ZSBTRVRfSU5UUl9NQVNLKFMpIFwKK19fcmF3X3dyaXRlcSgoTV9NQUNfSU5UX0NI
QU5ORUwgPDwgU19NQUNfVFhfQ0gwKSB8IFwKKyAgICAgICAgICAgICAoTV9NQUNf
SU5UX0NIQU5ORUwgPDwgU19NQUNfUlhfQ0gwKSwgKFMpLT5zYm1faW1yKTsKKyNl
bmRpZgorCisKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKiAgRE1BIERlc2Ny
aXB0b3Igc3RydWN0dXJlCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCkBAIC0y
MDUsNiArMjI0LDcgQEAgdHlwZWRlZiBzdHJ1Y3Qgc2JtYWNkbWFfcyB7CiAJICog
VGhpcyBzdHVmZiBpcyBmb3IgbWFpbnRlbmFuY2Ugb2YgdGhlIHJpbmcKIAkgKi8K
IAorCXNiZG1hZHNjcl90ICAgICAqc2JkbWFfZHNjcnRhYmxlX3VuYWxpZ25lZDsg
CiAJc2JkbWFkc2NyX3QgICAgICpzYmRtYV9kc2NydGFibGU7CS8qIGJhc2Ugb2Yg
ZGVzY3JpcHRvciB0YWJsZSAqLwogCXNiZG1hZHNjcl90ICAgICAqc2JkbWFfZHNj
cnRhYmxlX2VuZDsgLyogZW5kIG9mIGRlc2NyaXB0b3IgdGFibGUgKi8KIApAQCAt
Mjg3LDggKzMwNyw4IEBAIHN0YXRpYyBpbnQgc2JkbWFfYWRkX3JjdmJ1ZmZlcihz
Ym1hY2RtYV8KIHN0YXRpYyBpbnQgc2JkbWFfYWRkX3R4YnVmZmVyKHNibWFjZG1h
X3QgKmQsc3RydWN0IHNrX2J1ZmYgKm0pOwogc3RhdGljIHZvaWQgc2JkbWFfZW1w
dHlyaW5nKHNibWFjZG1hX3QgKmQpOwogc3RhdGljIHZvaWQgc2JkbWFfZmlsbHJp
bmcoc2JtYWNkbWFfdCAqZCk7Ci1zdGF0aWMgdm9pZCBzYmRtYV9yeF9wcm9jZXNz
KHN0cnVjdCBzYm1hY19zb2Z0YyAqc2Msc2JtYWNkbWFfdCAqZCk7Ci1zdGF0aWMg
dm9pZCBzYmRtYV90eF9wcm9jZXNzKHN0cnVjdCBzYm1hY19zb2Z0YyAqc2Msc2Jt
YWNkbWFfdCAqZCk7CitzdGF0aWMgaW50IHNiZG1hX3J4X3Byb2Nlc3Moc3RydWN0
IHNibWFjX3NvZnRjICpzYyxzYm1hY2RtYV90ICpkLCBpbnQgcG9sbCk7CitzdGF0
aWMgdm9pZCBzYmRtYV90eF9wcm9jZXNzKHN0cnVjdCBzYm1hY19zb2Z0YyAqc2Ms
c2JtYWNkbWFfdCAqZCwgaW50IHBvbGwpOwogc3RhdGljIGludCBzYm1hY19pbml0
Y3R4KHN0cnVjdCBzYm1hY19zb2Z0YyAqcyk7CiBzdGF0aWMgdm9pZCBzYm1hY19j
aGFubmVsX3N0YXJ0KHN0cnVjdCBzYm1hY19zb2Z0YyAqcyk7CiBzdGF0aWMgdm9p
ZCBzYm1hY19jaGFubmVsX3N0b3Aoc3RydWN0IHNibWFjX3NvZnRjICpzKTsKQEAg
LTMwOSw2ICszMjksMTAgQEAgc3RhdGljIHN0cnVjdCBuZXRfZGV2aWNlX3N0YXRz
ICpzYm1hY19nZQogc3RhdGljIHZvaWQgc2JtYWNfc2V0X3J4X21vZGUoc3RydWN0
IG5ldF9kZXZpY2UgKmRldik7CiBzdGF0aWMgaW50IHNibWFjX21paV9pb2N0bChz
dHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBzdHJ1Y3QgaWZyZXEgKnJxLCBpbnQgY21k
KTsKIHN0YXRpYyBpbnQgc2JtYWNfY2xvc2Uoc3RydWN0IG5ldF9kZXZpY2UgKmRl
dik7CisjaWYgZGVmaW5lZCAoQ09ORklHX1NCTUFDX05BUEkpCitzdGF0aWMgaW50
IHNibWFjX3BvbGwoc3RydWN0IG5ldF9kZXZpY2UgKnBvbGxfZGV2LCBpbnQgKmJ1
ZGdldCk7CisjZW5kaWYKKwogc3RhdGljIGludCBzYm1hY19taWlfcG9sbChzdHJ1
Y3Qgc2JtYWNfc29mdGMgKnMsaW50IG5vaXN5KTsKIHN0YXRpYyBpbnQgc2JtYWNf
bWlpX3Byb2JlKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpOwogCkBAIC03MzYsNyAr
NzYwLDcgQEAgc3RhdGljIHZvaWQgc2JkbWFfaW5pdGN0eChzYm1hY2RtYV90ICpk
LAogCiAJZC0+c2JkbWFfbWF4ZGVzY3IgPSBtYXhkZXNjcjsKIAotCWQtPnNiZG1h
X2RzY3J0YWJsZSA9IChzYmRtYWRzY3JfdCAqKQorCWQtPnNiZG1hX2RzY3J0YWJs
ZV91bmFsaWduZWQgPSBkLT5zYmRtYV9kc2NydGFibGUgPSAoc2JkbWFkc2NyX3Qg
KikKIAkJa21hbGxvYygoZC0+c2JkbWFfbWF4ZGVzY3IrMSkqc2l6ZW9mKHNiZG1h
ZHNjcl90KSwgR0ZQX0tFUk5FTCk7CiAKIAkvKgpAQCAtNzc4LDcgKzgwMiw2IEBA
IHN0YXRpYyB2b2lkIHNiZG1hX2luaXRjdHgoc2JtYWNkbWFfdCAqZCwKIAkJZC0+
c2JkbWFfaW50X3RpbWVvdXQgPSAwOwogCX0KICNlbmRpZgotCiB9CiAKIC8qKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqCkBAIC0xMTQ2LDEzICsxMTY5LDE0IEBAIHN0YXRp
YyB2b2lkIHNiZG1hX2ZpbGxyaW5nKHNibWFjZG1hX3QgKmQKICAqICAJICAgbm90
aGluZwogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwogCi1zdGF0aWMgdm9pZCBz
YmRtYV9yeF9wcm9jZXNzKHN0cnVjdCBzYm1hY19zb2Z0YyAqc2Msc2JtYWNkbWFf
dCAqZCkKK3N0YXRpYyBpbnQgc2JkbWFfcnhfcHJvY2VzcyhzdHJ1Y3Qgc2JtYWNf
c29mdGMgKnNjLHNibWFjZG1hX3QgKmQsIGludCBwb2xsKQogewogCWludCBjdXJp
ZHg7CiAJaW50IGh3aWR4OwogCXNiZG1hZHNjcl90ICpkc2M7CiAJc3RydWN0IHNr
X2J1ZmYgKnNiOwogCWludCBsZW47CisJaW50IHdvcmtfZG9uZSA9IDA7CiAKIAlm
b3IgKDs7KSB7CiAJCS8qCkBAIC0xMjMwLDggKzEyNTQsMTUgQEAgc3RhdGljIHZv
aWQgc2JkbWFfcnhfcHJvY2VzcyhzdHJ1Y3Qgc2JtYQogCQkJCQkJc2ItPmlwX3N1
bW1lZCA9IENIRUNLU1VNX05PTkU7CiAJCQkJCX0KIAkJCQl9Ci0KKwkJCQkKKyNp
ZiBkZWZpbmVkKENPTkZJR19TQk1BQ19OQVBJKQorCQkJCWlmICgwID09IHBvbGwp
CisJCQkJCW5ldGlmX3J4KHNiKTsKKwkJCQllbHNlCisJCQkJCW5ldGlmX3JlY2Vp
dmVfc2tiKHNiKTsKKyNlbHNlCiAJCQkJbmV0aWZfcngoc2IpOworI2VuZGlmCQkJ
CQogCQkJfQogCQl9IGVsc2UgewogCQkJLyoKQEAgLTEyNDgsOCArMTI3OSw5IEBA
IHN0YXRpYyB2b2lkIHNiZG1hX3J4X3Byb2Nlc3Moc3RydWN0IHNibWEKIAkJICov
CiAKIAkJZC0+c2JkbWFfcmVtcHRyID0gU0JETUFfTkVYVEJVRihkLHNiZG1hX3Jl
bXB0cik7Ci0KKwkJd29ya19kb25lKys7CiAJfQorCXJldHVybiB3b3JrX2RvbmU7
CiB9CiAKIApAQCAtMTI3MSwxNSArMTMwMywyMiBAQCBzdGF0aWMgdm9pZCBzYmRt
YV9yeF9wcm9jZXNzKHN0cnVjdCBzYm1hCiAgKiAgCSAgIG5vdGhpbmcKICAqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKiogKi8KIAotc3RhdGljIHZvaWQgc2JkbWFfdHhfcHJv
Y2VzcyhzdHJ1Y3Qgc2JtYWNfc29mdGMgKnNjLHNibWFjZG1hX3QgKmQpCitzdGF0
aWMgdm9pZCBzYmRtYV90eF9wcm9jZXNzKHN0cnVjdCBzYm1hY19zb2Z0YyAqc2Ms
c2JtYWNkbWFfdCAqZCwgaW50IHBvbGwpCiB7CiAJaW50IGN1cmlkeDsKIAlpbnQg
aHdpZHg7CiAJc2JkbWFkc2NyX3QgKmRzYzsKIAlzdHJ1Y3Qgc2tfYnVmZiAqc2I7
CiAJdW5zaWduZWQgbG9uZyBmbGFnczsKKwlpbnQgcGFja2V0c19oYW5kbGVkID0g
MDsKIAogCXNwaW5fbG9ja19pcnFzYXZlKCYoc2MtPnNibV9sb2NrKSwgZmxhZ3Mp
OworCQorCWlmIChkLT5zYmRtYV9yZW1wdHIgPT0gZC0+c2JkbWFfYWRkcHRyKQor
CQlnb3RvIGVuZF91bmxvY2s7CisKKwlod2lkeCA9IChpbnQpICgoKF9fcmF3X3Jl
YWRxKGQtPnNiZG1hX2N1cmRzY3IpICYgTV9ETUFfQ1VSRFNDUl9BRERSKSAtCisJ
CQlkLT5zYmRtYV9kc2NydGFibGVfcGh5cykgLyBzaXplb2Yoc2JkbWFkc2NyX3Qp
KTsKIAogCWZvciAoOzspIHsKIAkJLyoKQEAgLTEyOTQsMTUgKzEzMzMsMTIgQEAg
c3RhdGljIHZvaWQgc2JkbWFfdHhfcHJvY2VzcyhzdHJ1Y3Qgc2JtYQogCQkgKi8K
IAogCQljdXJpZHggPSBkLT5zYmRtYV9yZW1wdHIgLSBkLT5zYmRtYV9kc2NydGFi
bGU7Ci0JCWh3aWR4ID0gKGludCkgKCgoX19yYXdfcmVhZHEoZC0+c2JkbWFfY3Vy
ZHNjcikgJiBNX0RNQV9DVVJEU0NSX0FERFIpIC0KLQkJCQlkLT5zYmRtYV9kc2Ny
dGFibGVfcGh5cykgLyBzaXplb2Yoc2JkbWFkc2NyX3QpKTsKIAogCQkvKgogCQkg
KiBJZiB0aGV5J3JlIHRoZSBzYW1lLCB0aGF0IG1lYW5zIHdlJ3ZlIHByb2Nlc3Nl
ZCBhbGwKIAkJICogb2YgdGhlIGRlc2NyaXB0b3JzIHVwIHRvIChidXQgbm90IGlu
Y2x1ZGluZykgdGhlIG9uZSB0aGF0CiAJCSAqIHRoZSBoYXJkd2FyZSBpcyB3b3Jr
aW5nIG9uIHJpZ2h0IG5vdy4KIAkJICovCi0KIAkJaWYgKGN1cmlkeCA9PSBod2lk
eCkKIAkJCWJyZWFrOwogCkBAIC0xMzMzLDYgKzEzNjksNyBAQCBzdGF0aWMgdm9p
ZCBzYmRtYV90eF9wcm9jZXNzKHN0cnVjdCBzYm1hCiAKIAkJZC0+c2JkbWFfcmVt
cHRyID0gU0JETUFfTkVYVEJVRihkLHNiZG1hX3JlbXB0cik7CiAKKwkJcGFja2V0
c19oYW5kbGVkKys7CiAJfQogCiAJLyoKQEAgLTEzNDAsMTUgKzEzNzcsMTUgQEAg
c3RhdGljIHZvaWQgc2JkbWFfdHhfcHJvY2VzcyhzdHJ1Y3Qgc2JtYQogCSAqIE90
aGVyIGRyaXZlcnMgc2VlbSB0byBkbyB0aGlzIHdoZW4gd2UgcmVhY2ggYSBsb3cK
IAkgKiB3YXRlcm1hcmsgb24gdGhlIHRyYW5zbWl0IHF1ZXVlLgogCSAqLworCQor
CWlmIChwYWNrZXRzX2hhbmRsZWQpCisJCW5ldGlmX3dha2VfcXVldWUoZC0+c2Jk
bWFfZXRoLT5zYm1fZGV2KTsKIAotCW5ldGlmX3dha2VfcXVldWUoZC0+c2JkbWFf
ZXRoLT5zYm1fZGV2KTsKLQorIGVuZF91bmxvY2s6CiAJc3Bpbl91bmxvY2tfaXJx
cmVzdG9yZSgmKHNjLT5zYm1fbG9jayksIGZsYWdzKTsKIAogfQogCi0KLQogLyoq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioKICAqICBTQk1BQ19JTklUQ1RYKHMpCiAgKgpA
QCAtMTM5Miw3ICsxNDI5LDYgQEAgc3RhdGljIGludCBzYm1hY19pbml0Y3R4KHN0
cnVjdCBzYm1hY19zbwogCSAqIEluaXRpYWxpemUgdGhlIERNQSBjaGFubmVscy4g
IFJpZ2h0IG5vdywgb25seSBvbmUgcGVyIE1BQyBpcyB1c2VkCiAJICogTm90ZTog
T25seSBkbyB0aGlzIF9vbmNlXywgYXMgaXQgYWxsb2NhdGVzIG1lbW9yeSBmcm9t
IHRoZSBrZXJuZWwhCiAJICovCi0KIAlzYmRtYV9pbml0Y3R4KCYocy0+c2JtX3R4
ZG1hKSxzLDAsRE1BX1RYLFNCTUFDX01BWF9UWERFU0NSKTsKIAlzYmRtYV9pbml0
Y3R4KCYocy0+c2JtX3J4ZG1hKSxzLDAsRE1BX1JYLFNCTUFDX01BWF9SWERFU0NS
KTsKIApAQCAtMTQxNiw5ICsxNDUyLDkgQEAgc3RhdGljIGludCBzYm1hY19pbml0
Y3R4KHN0cnVjdCBzYm1hY19zbwogCiBzdGF0aWMgdm9pZCBzYmRtYV91bmluaXRj
dHgoc3RydWN0IHNibWFjZG1hX3MgKmQpCiB7Ci0JaWYgKGQtPnNiZG1hX2RzY3J0
YWJsZSkgewotCQlrZnJlZShkLT5zYmRtYV9kc2NydGFibGUpOwotCQlkLT5zYmRt
YV9kc2NydGFibGUgPSBOVUxMOworCWlmIChkLT5zYmRtYV9kc2NydGFibGVfdW5h
bGlnbmVkKSB7CisJCWtmcmVlKGQtPnNiZG1hX2RzY3J0YWJsZV91bmFsaWduZWQp
OworCQlkLT5zYmRtYV9kc2NydGFibGVfdW5hbGlnbmVkID0gZC0+c2JkbWFfZHNj
cnRhYmxlID0gTlVMTDsKIAl9CiAKIAlpZiAoZC0+c2JkbWFfY3R4dGFibGUpIHsK
QEAgLTE2MDUsMjkgKzE2NDEsMTYgQEAgc3RhdGljIHZvaWQgc2JtYWNfY2hhbm5l
bF9zdGFydChzdHJ1Y3QgcwogCiAjaWYgZGVmaW5lZChDT05GSUdfU0lCWVRFX0JD
TTF4NTUpIHx8IGRlZmluZWQoQ09ORklHX1NJQllURV9CQ00xeDgwKQogCV9fcmF3
X3dyaXRlcShNX01BQ19SWERNQV9FTjAgfAotCQkgICAgICAgTV9NQUNfVFhETUFf
RU4wLCBzLT5zYm1fbWFjZW5hYmxlKTsKKwkJICAgICBNX01BQ19UWERNQV9FTjAs
IHMtPnNibV9tYWNlbmFibGUpOwogI2VsaWYgZGVmaW5lZChDT05GSUdfU0lCWVRF
X1NCMTI1MCkgfHwgZGVmaW5lZChDT05GSUdfU0lCWVRFX0JDTTExMlgpCiAJX19y
YXdfd3JpdGVxKE1fTUFDX1JYRE1BX0VOMCB8Ci0JCSAgICAgICBNX01BQ19UWERN
QV9FTjAgfAotCQkgICAgICAgTV9NQUNfUlhfRU5BQkxFIHwKLQkJICAgICAgIE1f
TUFDX1RYX0VOQUJMRSwgcy0+c2JtX21hY2VuYWJsZSk7CisJCSAgICAgTV9NQUNf
VFhETUFfRU4wIHwKKwkJICAgICBNX01BQ19SWF9FTkFCTEUgfAorCQkgICAgIE1f
TUFDX1RYX0VOQUJMRSwgcy0+c2JtX21hY2VuYWJsZSk7CiAjZWxzZQogI2Vycm9y
IGludmFsaWQgU2lCeXRlIE1BQyBjb25maWd1YXRpb24KICNlbmRpZgotCi0jaWZk
ZWYgQ09ORklHX1NCTUFDX0NPQUxFU0NFCi0JLyoKLQkgKiBBY2NlcHQgYW55IFRY
IGludGVycnVwdCBhbmQgRU9QIGNvdW50L3RpbWVyIFJYIGludGVycnVwdHMgb24g
Y2ggMAotCSAqLwotCV9fcmF3X3dyaXRlcSgoKE1fTUFDX0lOVF9FT1BfQ09VTlQg
fCBNX01BQ19JTlRfRU9QX1RJTUVSKSA8PCBTX01BQ19UWF9DSDApIHwKLQkJICAg
ICAgICgoTV9NQUNfSU5UX0VPUF9DT1VOVCB8IE1fTUFDX0lOVF9FT1BfVElNRVIp
IDw8IFNfTUFDX1JYX0NIMCksIHMtPnNibV9pbXIpOwotI2Vsc2UKLQkvKgotCSAq
IEFjY2VwdCBhbnkga2luZCBvZiBpbnRlcnJ1cHQgb24gVFggYW5kIFJYIERNQSBj
aGFubmVsIDAKLQkgKi8KLQlfX3Jhd193cml0ZXEoKE1fTUFDX0lOVF9DSEFOTkVM
IDw8IFNfTUFDX1RYX0NIMCkgfAotCQkgICAgICAgKE1fTUFDX0lOVF9DSEFOTkVM
IDw8IFNfTUFDX1JYX0NIMCksIHMtPnNibV9pbXIpOwotI2VuZGlmCisJU0VUX0lO
VFJfTUFTSyhzKTsKIAogCS8qCiAJICogRW5hYmxlIHJlY2VpdmluZyB1bmljYXN0
cyBhbmQgYnJvYWRjYXN0cwpAQCAtMjA2Myw3ICsyMDg2LDYgQEAgc3RhdGljIGly
cXJldHVybl90IHNibWFjX2ludHIoaW50IGlycSx2bwogCQkgKiBSZWFkIHRoZSBJ
U1IgKHRoaXMgY2xlYXJzIHRoZSBiaXRzIGluIHRoZSByZWFsCiAJCSAqIHJlZ2lz
dGVyLCBleGNlcHQgZm9yIGNvdW50ZXIgYWRkcikKIAkJICovCi0KIAkJaXNyID0g
X19yYXdfcmVhZHEoc2MtPnNibV9pc3IpICYgfk1fTUFDX0NPVU5URVJfQUREUjsK
IAogCQlpZiAoaXNyID09IDApCkBAIC0yMDc1LDEzICsyMDk3LDMzIEBAIHN0YXRp
YyBpcnFyZXR1cm5fdCBzYm1hY19pbnRyKGludCBpcnEsdm8KIAkJICogVHJhbnNt
aXRzIG9uIGNoYW5uZWwgMAogCQkgKi8KIAorI2lmIGRlZmluZWQoQ09ORklHX1NC
TUFDX05BUEkpCisJCWlmIChpc3IgJiAoTV9NQUNfSU5UX0NIQU5ORUwgPDwgU19N
QUNfUlhfQ0gwKSkgeworCQkJX19yYXdfd3JpdGVxKDAsIHNjLT5zYm1faW1yKTsK
KwkJfQorCiAJCWlmIChpc3IgJiAoTV9NQUNfSU5UX0NIQU5ORUwgPDwgU19NQUNf
VFhfQ0gwKSkgewotCQkJc2JkbWFfdHhfcHJvY2VzcyhzYywmKHNjLT5zYm1fdHhk
bWEpKTsKKwkJCXNiZG1hX3R4X3Byb2Nlc3Moc2MsJihzYy0+c2JtX3R4ZG1hKSwg
MCk7CiAJCX0KIAogCQkvKgogCQkgKiBSZWNlaXZlcyBvbiBjaGFubmVsIDAKIAkJ
ICovCisJCWlmIChpc3IgJiAoTV9NQUNfSU5UX0NIQU5ORUwgPDwgU19NQUNfUlhf
Q0gwKSkgeworCQkJaWYgKG5ldGlmX3J4X3NjaGVkdWxlX3ByZXAoZGV2KSkKKwkJ
CXsKKwkJCQlfX25ldGlmX3J4X3NjaGVkdWxlKGRldik7CisJCQl9IGVsc2Ugewor
CQkJCVNFVF9JTlRSX01BU0soc2MpOworCQkJCXNiZG1hX3J4X3Byb2Nlc3Moc2Ms
JihzYy0+c2JtX3J4ZG1hKSwgMCk7CisJCQl9CisJCX0KKyNlbHNlCisJCS8qIE5v
biBOQVBJICovCisKKwkJaWYgKGlzciAmIChNX01BQ19JTlRfQ0hBTk5FTCA8PCBT
X01BQ19UWF9DSDApKSB7CisJCQlzYmRtYV90eF9wcm9jZXNzKHNjLCYoc2MtPnNi
bV90eGRtYSksIDApOworCQl9CiAKIAkJLyoKIAkJICogSXQncyBpbXBvcnRhbnQg
dG8gdGVzdCBhbGwgdGhlIGJpdHMgKG9yIGF0IGxlYXN0IHRoZQpAQCAtMjEwMSw4
ICsyMTQzLDkgQEAgc3RhdGljIGlycXJldHVybl90IHNibWFjX2ludHIoaW50IGly
cSx2bwogCiAKIAkJaWYgKGlzciAmIChNX01BQ19JTlRfQ0hBTk5FTCA8PCBTX01B
Q19SWF9DSDApKSB7Ci0JCQlzYmRtYV9yeF9wcm9jZXNzKHNjLCYoc2MtPnNibV9y
eGRtYSkpOworCQkJc2JkbWFfcnhfcHJvY2VzcyhzYywmKHNjLT5zYm1fcnhkbWEp
LCAwKTsKIAkJfQorI2VuZGlmCiAJfQogCXJldHVybiBJUlFfUkVUVkFMKGhhbmRs
ZWQpOwogfQpAQCAtMjQwMSw3ICsyNDQ0LDEwIEBAIHN0YXRpYyBpbnQgc2JtYWNf
aW5pdChzdHJ1Y3QgbmV0X2RldmljZSAKIAlkZXYtPmRvX2lvY3RsICAgICAgICAg
ICA9IHNibWFjX21paV9pb2N0bDsKIAlkZXYtPnR4X3RpbWVvdXQgICAgICAgICA9
IHNibWFjX3R4X3RpbWVvdXQ7CiAJZGV2LT53YXRjaGRvZ190aW1lbyAgICAgPSBU
WF9USU1FT1VUOwotCisjaWYgZGVmaW5lZChDT05GSUdfU0JNQUNfTkFQSSkKKwlk
ZXYtPnBvbGwgICAgICAgICAgICAgICA9IHNibWFjX3BvbGw7CisJZGV2LT53ZWln
aHQgICAgICAgICAgICAgPSAxNjsKKyNlbmRpZgogCWRldi0+Y2hhbmdlX210dSAg
ICAgICAgID0gc2IxMjUwX2NoYW5nZV9tdHU7CiAKIAkvKiBUaGlzIGlzIG5lZWRl
ZCBmb3IgUEFTUzIgZm9yIFJ4IEgvVyBjaGVja3N1bSBmZWF0dXJlICovCkBAIC0y
ODA5LDcgKzI4NTUsMjkgQEAgc3RhdGljIGludCBzYm1hY19jbG9zZShzdHJ1Y3Qg
bmV0X2RldmljZQogCXJldHVybiAwOwogfQogCisjaWYgZGVmaW5lZChDT05GSUdf
U0JNQUNfTkFQSSkKK3N0YXRpYyBpbnQgc2JtYWNfcG9sbChzdHJ1Y3QgbmV0X2Rl
dmljZSAqZGV2LCBpbnQgKmJ1ZGdldCkKK3sKKwlpbnQgd29ya190b19kbzsKKwlp
bnQgd29ya19kb25lOworCXN0cnVjdCBzYm1hY19zb2Z0YyAqc2MgPSBuZXRkZXZf
cHJpdihkZXYpOworCisJd29ya190b19kbyA9IG1pbigqYnVkZ2V0LCBkZXYtPnF1
b3RhKTsKKwl3b3JrX2RvbmUgPSBzYmRtYV9yeF9wcm9jZXNzKHNjLCYoc2MtPnNi
bV9yeGRtYSksIDEpOwogCisJc2JkbWFfdHhfcHJvY2VzcyhzYywmKHNjLT5zYm1f
dHhkbWEpLCAxKTsKKworCSpidWRnZXQgLT0gd29ya19kb25lOworCWRldi0+cXVv
dGEgLT0gd29ya19kb25lOworCisJaWYgKHdvcmtfZG9uZSA8IHdvcmtfdG9fZG8p
IHsKKwkJbmV0aWZfcnhfY29tcGxldGUoZGV2KTsKKwkJU0VUX0lOVFJfTUFTSyhz
Yyk7CisJfQorCisJcmV0dXJuICh3b3JrX2RvbmUgPj0gd29ya190b19kbyk7Cit9
CisjZW5kaWYKIAogI2lmIGRlZmluZWQoU0JNQUNfRVRIMF9IV0FERFIpIHx8IGRl
ZmluZWQoU0JNQUNfRVRIMV9IV0FERFIpIHx8IGRlZmluZWQoU0JNQUNfRVRIMl9I
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, 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..c52497b 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;
+#ifndef CONFIG_FLATMEM
+	unsigned long zholes_size[] = { [0 ... MAX_NR_ZONES - 1] = 0 };
+	unsigned long i, j, pfn;
+#endif
 
 	pagetable_init();
 
@@ -174,29 +200,16 @@ #ifdef CONFIG_HIGHMEM
 		zones_size[ZONE_HIGHMEM] = high - low;
 #endif
 
+#ifdef CONFIG_FLATMEM
 	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;
+#else
+	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, 0, zholes_size);
+#endif
 }
 
 static struct kcore_list kcore_mem, kcore_vmalloc;
@@ -213,9 +226,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 +242,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 +261,7 @@ #endif
 		totalhigh_pages++;
 	}
 	totalram_pages += totalhigh_pages;
+	num_physpages += totalhigh_pages;
 #endif
 
 	codesize =  (unsigned long) &_etext - (unsigned long) &_text;

From ralf@linux-mips.org Thu Jul  6 18:33:03 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Jul 2006 18:33:11 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:53180 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S3489795AbWGFRdD (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 6 Jul 2006 18:33:03 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.6/8.13.4) with ESMTP id k66HWrex005057;
	Thu, 6 Jul 2006 18:32:53 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.6/8.13.6/Submit) id k66HWaHi005056;
	Thu, 6 Jul 2006 18:32:36 +0100
Date:	Thu, 6 Jul 2006 18:32:36 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	vagabon.xyz@gmail.com, linux-mips@linux-mips.org
Subject: Re: [PATCH] sparsemem fix
Message-ID: <20060706173235.GA4739@linux-mips.org>
References: <20060705.012244.96686002.anemo@mba.ocn.ne.jp> <44AB79D0.90002@innova-card.com> <20060705.192054.128618288.nemoto@toshiba-tops.co.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060705.192054.128618288.nemoto@toshiba-tops.co.jp>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11925
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Wed, Jul 05, 2006 at 07:20:54PM +0900, Atsushi Nemoto wrote:

> > 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

The fact that the code is only used on IP27 doesn't mean it is IP27-specific.

> > #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).

Yes, and there will be one or two more NUMA systems.

  Ralf

From ralf@linux-mips.org Thu Jul  6 18:37:30 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Jul 2006 18:37:38 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:41900 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S3489809AbWGFRh3 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 6 Jul 2006 18:37:29 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.6/8.13.4) with ESMTP id k66HbTBE005088;
	Thu, 6 Jul 2006 18:37:29 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.6/8.13.6/Submit) id k66HbTZh005087;
	Thu, 6 Jul 2006 18:37:29 +0100
Date:	Thu, 6 Jul 2006 18:37:29 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Franck Bui-Huu <vagabon.xyz@gmail.com>
Cc:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>, linux-mips@linux-mips.org
Subject: Re: [PATCH] sparsemem fix
Message-ID: <20060706173729.GB4739@linux-mips.org>
References: <20060705.012244.96686002.anemo@mba.ocn.ne.jp> <44AB79D0.90002@innova-card.com> <20060705.192054.128618288.nemoto@toshiba-tops.co.jp> <44AB99AD.8000403@innova-card.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <44AB99AD.8000403@innova-card.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11926
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Wed, Jul 05, 2006 at 12:51:25PM +0200, Franck Bui-Huu wrote:

> 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.

Most of the related IP27 code bits are for initialization.

  Ralf

From sshtylyov@ru.mvista.com Thu Jul  6 22:26:43 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Jul 2006 22:26:52 +0100 (BST)
Received: from h155.mvista.com ([63.81.120.155]:52713 "EHLO imap.sh.mvista.com")
	by ftp.linux-mips.org with ESMTP id S3489828AbWGFV0n (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 6 Jul 2006 22:26:43 +0100
Received: from [192.168.1.248] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id 604B63EC9; Thu,  6 Jul 2006 14:26:21 -0700 (PDT)
Message-ID: <44AD7FBA.8000203@ru.mvista.com>
Date:	Fri, 07 Jul 2006 01:25:14 +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:	ralf@linux-mips.org, Linux-MIPS <linux-mips@linux-mips.org>
Cc:	a.voropay@equant.ru
Subject: [PATCH] Fix process crash in 2.4 on attempt to use FPU on MIPS32
Content-Type: multipart/mixed;
 boundary="------------080003060807040507050809"
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: 11927
X-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

This is a multi-part message in MIME format.
--------------080003060807040507050809
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

If there's built-in FPU in a MIPS32 CPU the first time the process tries
to use it, the kernel should crash with "reserved instruction" -- CPU will try
to execute 'dmtc1' which is a MIPS64 only insn. _init_fpu() was apprently 
blindly copied form arch/mips64/... :-)

Since this occured with GXemul recently resending this 1.5 year old patch.

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



--------------080003060807040507050809
Content-Type: text/plain;
 name="MIPS32-FPU-init-2.4.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="MIPS32-FPU-init-2.4.patch"

diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
index 1999483..30b67c8 100644
--- a/arch/mips/kernel/r4k_switch.S
+++ b/arch/mips/kernel/r4k_switch.S
@@ -134,7 +134,6 @@ LEAF(_restore_fp)
 #define FPU_DEFAULT  0x00000000
 
 LEAF(_init_fpu)
-	.set	mips3
 	mfc0	t0, CP0_STATUS
 	li	t1, ST0_CU1
 	or	t0, t1
@@ -146,24 +145,40 @@ LEAF(_init_fpu)
 
 	li	t0, -1
 
-	dmtc1	t0, $f0
-	dmtc1	t0, $f2
-	dmtc1	t0, $f4
-	dmtc1	t0, $f6
-	dmtc1	t0, $f8
-	dmtc1	t0, $f10
-	dmtc1	t0, $f12
-	dmtc1	t0, $f14
-	dmtc1	t0, $f16
-	dmtc1	t0, $f18
-	dmtc1	t0, $f20
-	dmtc1	t0, $f22
-	dmtc1	t0, $f24
-	dmtc1	t0, $f26
-	dmtc1	t0, $f28
+	mtc1	t0, $f0
+	mtc1	t0, $f1
+	mtc1	t0, $f2
+	mtc1	t0, $f3
+	mtc1	t0, $f4
+	mtc1	t0, $f5
+	mtc1	t0, $f6
+	mtc1	t0, $f7
+	mtc1	t0, $f8
+	mtc1	t0, $f9
+	mtc1	t0, $f10
+	mtc1	t0, $f11
+	mtc1	t0, $f12
+	mtc1	t0, $f13
+	mtc1	t0, $f14
+	mtc1	t0, $f15
+	mtc1	t0, $f16
+	mtc1	t0, $f17
+	mtc1	t0, $f18
+	mtc1	t0, $f19
+	mtc1	t0, $f20
+	mtc1	t0, $f21
+	mtc1	t0, $f22
+	mtc1	t0, $f23
+	mtc1	t0, $f24
+	mtc1	t0, $f25
+	mtc1	t0, $f26
+	mtc1	t0, $f27
+	mtc1	t0, $f28
+	mtc1	t0, $f29
+	mtc1	t0, $f30
 	.set	noreorder
 	jr	ra
-	 dmtc1	t0, $f30
 	.set	reorder
+	 mtc1	t0, $f31
 	END(_init_fpu)
 



--------------080003060807040507050809--

From ralf@linux-mips.org Thu Jul  6 23:57:26 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 06 Jul 2006 23:57:36 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:61893 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S3489839AbWGFW50 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 6 Jul 2006 23:57:26 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.6/8.13.4) with ESMTP id k66MvMSx018434;
	Thu, 6 Jul 2006 23:57:22 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.6/8.13.6/Submit) id k66MvIG9018433;
	Thu, 6 Jul 2006 23:57:18 +0100
Date:	Thu, 6 Jul 2006 23:57:18 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	Linux-MIPS <linux-mips@linux-mips.org>, a.voropay@equant.ru
Subject: Re: [PATCH] Fix process crash in 2.4 on attempt to use FPU on MIPS32
Message-ID: <20060706225718.GA18284@linux-mips.org>
References: <44AD7FBA.8000203@ru.mvista.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <44AD7FBA.8000203@ru.mvista.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11928
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Fri, Jul 07, 2006 at 01:25:14AM +0400, Sergei Shtylyov wrote:

> If there's built-in FPU in a MIPS32 CPU the first time the process tries
> to use it, the kernel should crash with "reserved instruction" -- CPU will 
> try
> to execute 'dmtc1' which is a MIPS64 only insn. _init_fpu() was apprently 
> blindly copied form arch/mips64/... :-)
> 
> Since this occured with GXemul recently resending this 1.5 year old patch.

I didn't like the patch back then because it drops the optimizations
for 64-bit processors.  So I just took the 2.6 variant of the code and
bolted it into 2.4.

  Ralf

From zzh.hust@gmail.com Fri Jul  7 06:12:24 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 07 Jul 2006 06:12:33 +0100 (BST)
Received: from ug-out-1314.google.com ([66.249.92.173]:34154 "EHLO
	ug-out-1314.google.com") by ftp.linux-mips.org with ESMTP
	id S8127208AbWGGFMY (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 7 Jul 2006 06:12:24 +0100
Received: by ug-out-1314.google.com with SMTP id k3so2416516ugf
        for <linux-mips@linux-mips.org>; Thu, 06 Jul 2006 22:12:23 -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=B9CkXO+oIzVK5npAJRsm8Ofz46Rh1YLOuGPHOixYobLSAnkQtSP/BI6JbplMEhpTvhJuzgluo/k6E3dZGvPArEXCBJ1A8CtO8wkdTWoCJfOVAb13IYimQY82T2MQfbyxo8rtrTM78Bba9wBbgEm9zlz5DBzQ39Um36x9yE8I5vQ=
Received: by 10.67.29.12 with SMTP id g12mr1549838ugj;
        Thu, 06 Jul 2006 22:12:23 -0700 (PDT)
Received: by 10.66.242.15 with HTTP; Thu, 6 Jul 2006 22:12:23 -0700 (PDT)
Message-ID: <50c9a2250607062212w70de956ax7aefd4f131ae9396@mail.gmail.com>
Date:	Fri, 7 Jul 2006 13:12:23 +0800
From:	zhuzhenhua <zzh.hust@gmail.com>
To:	linux-mips <linux-mips@linux-mips.org>
Subject: "Error -3 while decompressing!" while use cramfs as rootfs
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Return-Path: <zzh.hust@gmail.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11929
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: zzh.hust@gmail.com
Precedence: bulk
X-list: linux-mips

i have write a rootfs.cramfs to mtdblock2, and if i use nfsroot, and
can mount /dev/mtdblock2 correctly.but if i use /dev/mtdblock2 as
rootfs with bootargs
"root/dev/mtdblock2 rootfstype=cramfs"
the kernel output next messages
....
VFS: Mounted root (cramfs filesystem) readonly.
Freeing unused kernel memory: 144k freed
Error -3 while decompressing!
805bf6a8(-2046512)->81218000(4096)
Error -3 while decompressing!
803cc4fc(26)->8121e000(4096)
Error -3 while decompressing!
803cc516(26)->8121f000(4096)
Error -3 while decompressing!
803cc530(26)->803a0000(4096)
....

my kernel version is 2.6.14, flash is SST39VF3201, nor flash, 4M Byte

does anyone have idea about this situation?

thanks for any hints

Best Regards

zhuzhenhua

From anemo@mba.ocn.ne.jp Fri Jul  7 06:26:50 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 07 Jul 2006 06:26:59 +0100 (BST)
Received: from topsns2.toshiba-tops.co.jp ([202.230.225.126]:53713 "EHLO
	topsns2.toshiba-tops.co.jp") by ftp.linux-mips.org with ESMTP
	id S3466138AbWGGF0u (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 7 Jul 2006 06:26:50 +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; Fri, 7 Jul 2006 14:26:48 +0900
Received: from topsms.toshiba-tops.co.jp (localhost.localdomain [127.0.0.1])
	by localhost.toshiba-tops.co.jp (Postfix) with ESMTP id B40A9202F9;
	Fri,  7 Jul 2006 14:26:42 +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 A01A41F5D9;
	Fri,  7 Jul 2006 14:26:42 +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 k675QfW0005409;
	Fri, 7 Jul 2006 14:26:41 +0900 (JST)
	(envelope-from anemo@mba.ocn.ne.jp)
Date:	Fri, 07 Jul 2006 14:26:41 +0900 (JST)
Message-Id: <20060707.142641.122254596.nemoto@toshiba-tops.co.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org, ths@networkno.de
Subject: [PATCH] fix rdhwr_op definition
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.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: 11930
X-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

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

diff --git a/include/asm-mips/inst.h b/include/asm-mips/inst.h
index 1ed8d0f..6489f00 100644
--- a/include/asm-mips/inst.h
+++ b/include/asm-mips/inst.h
@@ -74,7 +74,7 @@ enum spec3_op {
 	ins_op, dinsm_op, dinsu_op, dins_op,
 	bshfl_op = 0x20,
 	dbshfl_op = 0x24,
-	rdhwr_op = 0x3f
+	rdhwr_op = 0x3b
 };
 
 /*

From ths@networkno.de Fri Jul  7 08:43:11 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 07 Jul 2006 08:43:21 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:59371 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8133361AbWGGHnL (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 7 Jul 2006 08:43:11 +0100
Received: from lagash (88-106-172-167.dynamic.dsl.as9105.com [88.106.172.167])
	(using TLSv1 with cipher DES-CBC3-SHA (168/168 bits))
	(No client certificate requested)
	by bender.bawue.de (Postfix) with ESMTP
	id D73A44542A; Fri,  7 Jul 2006 09:43:10 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1Fyk6Y-00045e-Jx; Fri, 07 Jul 2006 07:46:22 +0100
Date:	Fri, 7 Jul 2006 07:46:22 +0100
From:	Thiemo Seufer <ths@networkno.de>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] fix rdhwr_op definition
Message-ID: <20060707064622.GB4274@networkno.de>
References: <20060707.142641.122254596.nemoto@toshiba-tops.co.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060707.142641.122254596.nemoto@toshiba-tops.co.jp>
User-Agent: Mutt/1.5.11+cvs20060403
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: 11931
X-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

Atsushi Nemoto wrote:
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
>
> diff --git a/include/asm-mips/inst.h b/include/asm-mips/inst.h
> index 1ed8d0f..6489f00 100644
> --- a/include/asm-mips/inst.h
> +++ b/include/asm-mips/inst.h
> @@ -74,7 +74,7 @@ enum spec3_op {
>  	ins_op, dinsm_op, dinsu_op, dins_op,
>  	bshfl_op = 0x20,
>  	dbshfl_op = 0x24,
> -	rdhwr_op = 0x3f
> +	rdhwr_op = 0x3b

Correct, thanks for catching this.


Thiemo

From ths@networkno.de Fri Jul  7 10:38:55 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 07 Jul 2006 10:39:04 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:12699 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8133435AbWGGJiz (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 7 Jul 2006 10:38:55 +0100
Received: from lagash (88-106-172-167.dynamic.dsl.as9105.com [88.106.172.167])
	(using TLSv1 with cipher DES-CBC3-SHA (168/168 bits))
	(No client certificate requested)
	by bender.bawue.de (Postfix) with ESMTP
	id BDC2845769; Fri,  7 Jul 2006 11:38:54 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1FymnU-0005CR-0x; Fri, 07 Jul 2006 10:38:52 +0100
Date:	Fri, 7 Jul 2006 10:38:51 +0100
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] Fix build failure in op_model_mipsxx.c
Message-ID: <20060707093851.GC4274@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: 11932
X-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 warning which gets handled as -Werror.


Thiemo


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


diff --git a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c
index a09c5f9..a175d67 100644
--- a/arch/mips/oprofile/op_model_mipsxx.c
+++ b/arch/mips/oprofile/op_model_mipsxx.c
@@ -49,6 +49,7 @@ static inline unsigned int r_c0_ ## r ##
 	default:							\
 		BUG();							\
 	}								\
+	return 0;							\
 }									\
 									\
 static inline void w_c0_ ## r ## n(unsigned int value)			\
@@ -65,6 +66,7 @@ static inline void w_c0_ ## r ## n(unsig
 	default:							\
 		BUG();							\
 	}								\
+	return;								\
 }									\
 
 __define_perf_accessors(perfcntr, 0, 2)

From anemo@mba.ocn.ne.jp Fri Jul  7 15:59:23 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 07 Jul 2006 15:59:33 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:50892 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133487AbWGGO7X (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 7 Jul 2006 15:59:23 +0100
Received: from localhost (p1163-ipad206funabasi.chiba.ocn.ne.jp [222.146.104.163])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 6E794951A; Fri,  7 Jul 2006 23:59:16 +0900 (JST)
Date:	Sat, 08 Jul 2006 00:00:32 +0900 (JST)
Message-Id: <20060708.000032.88471510.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] fast path for rdhwr emulation for TLS
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: 11933
X-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

Adding special short path for emulationg RDHWR which is used to
support TLS.

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

diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index b563811..545bcb1 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -357,7 +357,7 @@ #endif
 	BUILD_HANDLER ibe be cli silent			/* #6  */
 	BUILD_HANDLER dbe be cli silent			/* #7  */
 	BUILD_HANDLER bp bp sti silent			/* #9  */
-	BUILD_HANDLER ri ri sti silent			/* #10 */
+	BUILD_HANDLER ri_slow ri sti silent		/* #10 */
 	BUILD_HANDLER cpu cpu sti silent		/* #11 */
 	BUILD_HANDLER ov ov sti silent			/* #12 */
 	BUILD_HANDLER tr tr sti silent			/* #13 */
@@ -369,6 +369,39 @@ #endif
 	BUILD_HANDLER dsp dsp sti silent		/* #26 */
 	BUILD_HANDLER reserved reserved sti verbose	/* others */
 
+	.align	5
+	LEAF(handle_ri)
+	.set	push
+	.set	noat
+	mfc0	k0, CP0_CAUSE
+	MFC0	k1, CP0_EPC
+	bltz	k0, handle_ri_slow	/* if delay slot */
+	lw	k0, (k1)
+	li	k1, 0x7c03e83b	/* rdhwr v1,$29 */
+	bne	k0, k1, handle_ri_slow	/* if not ours */
+	get_saved_sp	/* k1 := current_thread_info */
+	MFC0	k0, CP0_EPC
+	LONG_ADDIU	k0, 4
+	.set	noreorder
+#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
+	ori	k1, _THREAD_MASK
+	xori	k1, _THREAD_MASK
+	LONG_L	v1, TI_TP_VALUE(k1)
+	jr	k0
+	 rfe
+#else
+	/* I hope three instructions between MTC0 and ERET are enough... */
+	MTC0	k0, CP0_EPC
+	ori	k1, _THREAD_MASK
+	xori	k1, _THREAD_MASK
+	LONG_L	v1, TI_TP_VALUE(k1)
+	.set	mips3
+	eret
+	.set	mips0
+#endif
+	.set	pop
+	END(handle_ri)
+
 #ifdef CONFIG_64BIT
 /* A temporary overflow handler used by check_daddi(). */
 

From macro@linux-mips.org Fri Jul  7 16:22:49 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 07 Jul 2006 16:22:58 +0100 (BST)
Received: from pollux.ds.pg.gda.pl ([153.19.208.7]:40714 "EHLO
	pollux.ds.pg.gda.pl") by ftp.linux-mips.org with ESMTP
	id S8133492AbWGGPWt (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 7 Jul 2006 16:22:49 +0100
Received: from localhost (localhost [127.0.0.1])
	by pollux.ds.pg.gda.pl (Postfix) with ESMTP id 80FC6F65E4;
	Fri,  7 Jul 2006 17:22:42 +0200 (CEST)
Received: from pollux.ds.pg.gda.pl ([127.0.0.1])
 by localhost (pollux.ds.pg.gda.pl [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 10458-06; Fri,  7 Jul 2006 17:22:42 +0200 (CEST)
Received: from piorun.ds.pg.gda.pl (piorun.ds.pg.gda.pl [153.19.208.8])
	by pollux.ds.pg.gda.pl (Postfix) with ESMTP id 25BDCF65D9;
	Fri,  7 Jul 2006 17:22:42 +0200 (CEST)
Received: from blysk.ds.pg.gda.pl (macro@blysk.ds.pg.gda.pl [153.19.208.6])
	by piorun.ds.pg.gda.pl (8.13.7/8.13.1) with ESMTP id k67FMp59004760;
	Fri, 7 Jul 2006 17:22:51 +0200
Date:	Fri, 7 Jul 2006 16:22:46 +0100 (BST)
From:	"Maciej W. Rozycki" <macro@linux-mips.org>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] fast path for rdhwr emulation for TLS
In-Reply-To: <20060708.000032.88471510.anemo@mba.ocn.ne.jp>
Message-ID: <Pine.LNX.4.64N.0607071607520.25285@blysk.ds.pg.gda.pl>
References: <20060708.000032.88471510.anemo@mba.ocn.ne.jp>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Virus-Scanned: ClamAV 0.88.2/1588/Fri Jul  7 15:54:23 2006 on piorun.ds.pg.gda.pl
X-Virus-Status:	Clean
X-Virus-Scanned: by amavisd-new at pollux.ds.pg.gda.pl
Return-Path: <macro@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11934
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: macro@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Sat, 8 Jul 2006, Atsushi Nemoto wrote:

> Adding special short path for emulationg RDHWR which is used to
> support TLS.

 You need to take care of VIVT I-caches.

> @@ -369,6 +369,39 @@ #endif
>  	BUILD_HANDLER dsp dsp sti silent		/* #26 */
>  	BUILD_HANDLER reserved reserved sti verbose	/* others */
>  
> +	.align	5
> +	LEAF(handle_ri)
> +	.set	push
> +	.set	noat
> +	mfc0	k0, CP0_CAUSE
> +	MFC0	k1, CP0_EPC
> +	bltz	k0, handle_ri_slow	/* if delay slot */
> +	lw	k0, (k1)

 For a VIVT I-cache this can result in a TLB exception.  TLB handlers are 
not currently prepared for being called at the exception level.

 Also I am fairly sure gas won't fill the branch delay slot above -- a 
trivial rearrangement of code would save a cycle here (and this is a fast 
path, so we do not want wasting time).

> +	li	k1, 0x7c03e83b	/* rdhwr v1,$29 */
> +	bne	k0, k1, handle_ri_slow	/* if not ours */
> +	get_saved_sp	/* k1 := current_thread_info */
> +	MFC0	k0, CP0_EPC
> +	LONG_ADDIU	k0, 4

 I suggest moving MFC0 ahead of get_saved_sp to avoid a stall.  I would 
fit in the branch delay slot nicely.

  Maciej

From yoichi_yuasa@tripeaks.co.jp Fri Jul  7 16:42:09 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 07 Jul 2006 16:42:18 +0100 (BST)
Received: from mo30.po.2iij.net ([210.128.50.53]:29764 "EHLO mo30.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133495AbWGGPmJ (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 7 Jul 2006 16:42:09 +0100
Received: by mo.po.2iij.net (mo30) id k67Fg64p018143; Sat, 8 Jul 2006 00:42:06 +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 k67Fg234030353
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Sat, 8 Jul 2006 00:42:03 +0900 (JST)
Date:	Sat, 8 Jul 2006 00:42:01 +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 1/2] vr41xx: changed the workaround to recommended method
Message-Id: <20060708004201.3a677b9c.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: 11935
X-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 changed the workaround to recommended method.
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-06 17:54:34.149940250 +0900
+++ mips/arch/mips/mm/c-r4k.c	2006-07-06 18:00:15.249128000 +0900
@@ -867,12 +867,13 @@ static void __init probe_pcache(void)
 		/* Workaround for cache instruction bug of VR4131 */
 		if (c->processor_id == 0x0c80U || c->processor_id == 0x0c81U ||
 		    c->processor_id == 0x0c82U) {
-			config &= ~0x00000030U;
 			config |= 0x00400000U;
 			if (c->processor_id == 0x0c80U)
 				config |= VR41_CONF_BP;
 			write_c0_config(config);
-		}
+		} else
+			c->options |= MIPS_CPU_CACHE_CDEX_P;
+
 		icache_size = 1 << (10 + ((config & CONF_IC) >> 9));
 		c->icache.linesz = 16 << ((config & CONF_IB) >> 5);
 		c->icache.ways = 2;
@@ -882,8 +883,6 @@ static void __init probe_pcache(void)
 		c->dcache.linesz = 16 << ((config & CONF_DB) >> 4);
 		c->dcache.ways = 2;
 		c->dcache.waybit = __ffs(dcache_size/2);
-
-		c->options |= MIPS_CPU_CACHE_CDEX_P;
 		break;
 
 	case CPU_VR41XX:

From yoichi_yuasa@tripeaks.co.jp Fri Jul  7 16:42:47 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 07 Jul 2006 16:43:01 +0100 (BST)
Received: from mo31.po.2iij.net ([210.128.50.54]:33869 "EHLO mo31.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133502AbWGGPmV (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 7 Jul 2006 16:42:21 +0100
Received: by mo.po.2iij.net (mo31) id k67FgIp1083828; Sat, 8 Jul 2006 00:42:18 +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 k67FgD5t030391
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Sat, 8 Jul 2006 00:42:14 +0900 (JST)
Date:	Sat, 8 Jul 2006 00:42:12 +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 2/2] vr41xx: define P4K bit for VR41xx
Message-Id: <20060708004212.52cbf512.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: 11936
X-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 defined P4K bit for VR41xx.
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-06 18:03:06.162320750 +0900
+++ mips/arch/mips/mm/c-r4k.c	2006-07-06 18:03:13.127272250 +0900
@@ -862,7 +862,7 @@ static void __init probe_pcache(void)
 		break;
 
 	case CPU_VR4133:
-		write_c0_config(config & ~CONF_EB);
+		write_c0_config(config & ~VR41_CONF_P4K);
 	case CPU_VR4131:
 		/* Workaround for cache instruction bug of VR4131 */
 		if (c->processor_id == 0x0c80U || c->processor_id == 0x0c81U ||
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-06 17:49:45.931927750 +0900
+++ mips/include/asm-mips/mipsregs.h	2006-07-06 18:09:30.443242500 +0900
@@ -470,6 +470,7 @@
 
 /* Bits specific to the VR41xx.  */
 #define VR41_CONF_CS		(_ULCAST_(1) << 12)
+#define VR41_CONF_P4K		(_ULCAST_(1) << 13)
 #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 Fri Jul  7 16:51:20 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 07 Jul 2006 16:51:29 +0100 (BST)
Received: from mo32.po.2iij.net ([210.128.50.17]:56842 "EHLO mo32.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133498AbWGGPvU (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 7 Jul 2006 16:51:20 +0100
Received: by mo.po.2iij.net (mo32) id k67FpHfY065727; Sat, 8 Jul 2006 00:51:17 +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 k67FpCrB032453
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Sat, 8 Jul 2006 00:51:13 +0900 (JST)
Date:	Sat, 8 Jul 2006 00:51:11 +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] removed vmlinux.rm200
Message-Id: <20060708005111.12a066a4.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: 11937
X-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 vmlinux.rm200 from Makefile.
We can use vmlinux.ecoff instead.

Yoichi

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

diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/Makefile mips/arch/mips/Makefile
--- mips-orig/arch/mips/Makefile	2006-07-07 12:28:54.055411000 +0900
+++ mips/arch/mips/Makefile	2006-07-07 16:08:50.208627750 +0900
@@ -712,16 +712,14 @@ endif
 vmlinux.bin: $(vmlinux-32)
 	+@$(call makeboot,$@)
 
-vmlinux.ecoff vmlinux.rm200: $(vmlinux-32)
+vmlinux.ecoff: $(vmlinux-32)
 	+@$(call makeboot,$@)
 
 vmlinux.srec: $(vmlinux-32)
 	+@$(call makeboot,$@)
 
 CLEAN_FILES += vmlinux.ecoff \
-	       vmlinux.srec \
-	       vmlinux.rm200.tmp \
-	       vmlinux.rm200
+	       vmlinux.srec
 
 archclean:
 	@$(MAKE) $(clean)=arch/mips/boot

From anemo@mba.ocn.ne.jp Fri Jul  7 17:11:33 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 07 Jul 2006 17:11:43 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:65221 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133498AbWGGQLd (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 7 Jul 2006 17:11:33 +0100
Received: from localhost (p1163-ipad206funabasi.chiba.ocn.ne.jp [222.146.104.163])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 040B4A14F; Sat,  8 Jul 2006 01:11:29 +0900 (JST)
Date:	Sat, 08 Jul 2006 01:12:45 +0900 (JST)
Message-Id: <20060708.011245.82794581.anemo@mba.ocn.ne.jp>
To:	macro@linux-mips.org
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] fast path for rdhwr emulation for TLS
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <Pine.LNX.4.64N.0607071607520.25285@blysk.ds.pg.gda.pl>
References: <20060708.000032.88471510.anemo@mba.ocn.ne.jp>
	<Pine.LNX.4.64N.0607071607520.25285@blysk.ds.pg.gda.pl>
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: 11938
X-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 Fri, 7 Jul 2006 16:22:46 +0100 (BST), "Maciej W. Rozycki" <macro@linux-mips.org> wrote:
> > +	.align	5
> > +	LEAF(handle_ri)
> > +	.set	push
> > +	.set	noat
> > +	mfc0	k0, CP0_CAUSE
> > +	MFC0	k1, CP0_EPC
> > +	bltz	k0, handle_ri_slow	/* if delay slot */
> > +	lw	k0, (k1)
> 
>  For a VIVT I-cache this can result in a TLB exception.  TLB handlers are 
> not currently prepared for being called at the exception level.

Thanks, now I understand the problem.  Are there any good solutions?
Only I can think now is using handle_ri_slow for such CPUs.

>  Also I am fairly sure gas won't fill the branch delay slot above -- a 
> trivial rearrangement of code would save a cycle here (and this is a fast 
> path, so we do not want wasting time).

Well, here is a code compiled by binutils 2.17.  This version of gas
can put MFC0 on the delay slot.  But it might be better to use
noreorder by myself.

80012a80 <handle_ri>:
80012a80:	401a6800 	mfc0	k0,c0_cause
80012a84:	0740fd2e 	bltz	k0,80011f40 <handle_ri_slow>
80012a88:	401b7000 	mfc0	k1,c0_epc
80012a8c:	8f7a0000 	lw	k0,0(k1)
80012a90:	3c1b7c03 	lui	k1,0x7c03
80012a94:	377be83b 	ori	k1,k1,0xe83b
80012a98:	175bfd29 	bne	k0,k1,80011f40 <handle_ri_slow>
80012a9c:	00000000 	nop
80012aa0:	3c1b801b 	lui	k1,0x801b
80012aa4:	8f7b4008 	lw	k1,16392(k1)
80012aa8:	401a7000 	mfc0	k0,c0_epc
80012aac:	275a0004 	addiu	k0,k0,4
80012ab0:	409a7000 	mtc0	k0,c0_epc
80012ab4:	377b1fff 	ori	k1,k1,0x1fff
80012ab8:	3b7b1fff 	xori	k1,k1,0x1fff
80012abc:	8f63000c 	lw	v1,12(k1)
80012ac0:	42000018 	eret

> > +	li	k1, 0x7c03e83b	/* rdhwr v1,$29 */
> > +	bne	k0, k1, handle_ri_slow	/* if not ours */
> > +	get_saved_sp	/* k1 := current_thread_info */
> > +	MFC0	k0, CP0_EPC
> > +	LONG_ADDIU	k0, 4
> 
>  I suggest moving MFC0 ahead of get_saved_sp to avoid a stall.  I would 
> fit in the branch delay slot nicely.

The MFC0 can not be moved.  SMP version of get_saved_sp uses k0 and
k1.  But of course I can use #ifdef CONFIG_SMP, but these assumption
makes the code a bit fragile.  Another performance vs. maintainance
cost issue...

---
Atsushi Nemoto

From anemo@mba.ocn.ne.jp Fri Jul  7 17:42:27 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 07 Jul 2006 17:42:36 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:43463 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133512AbWGGQm1 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 7 Jul 2006 17:42:27 +0100
Received: from localhost (p1163-ipad206funabasi.chiba.ocn.ne.jp [222.146.104.163])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 25B2D8CFE; Sat,  8 Jul 2006 01:42:23 +0900 (JST)
Date:	Sat, 08 Jul 2006 01:43:39 +0900 (JST)
Message-Id: <20060708.014339.89274844.anemo@mba.ocn.ne.jp>
To:	macro@linux-mips.org
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] fast path for rdhwr emulation for TLS
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <20060708.011245.82794581.anemo@mba.ocn.ne.jp>
References: <20060708.000032.88471510.anemo@mba.ocn.ne.jp>
	<Pine.LNX.4.64N.0607071607520.25285@blysk.ds.pg.gda.pl>
	<20060708.011245.82794581.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: 11939
X-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 Sat, 08 Jul 2006 01:12:45 +0900 (JST), Atsushi Nemoto <anemo@mba.ocn.ne.jp> wrote:
> >  For a VIVT I-cache this can result in a TLB exception.  TLB handlers are 
> > not currently prepared for being called at the exception level.
> 
> Thanks, now I understand the problem.  Are there any good solutions?
> Only I can think now is using handle_ri_slow for such CPUs.

Can we use Index_Load_Data_I to load the instruction code from icache?
Just an idea...

---
Atsushi Nemoto

From macro@linux-mips.org Fri Jul  7 17:58:45 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 07 Jul 2006 17:58:55 +0100 (BST)
Received: from pollux.ds.pg.gda.pl ([153.19.208.7]:11013 "EHLO
	pollux.ds.pg.gda.pl") by ftp.linux-mips.org with ESMTP
	id S8133510AbWGGQ6p (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 7 Jul 2006 17:58:45 +0100
Received: from localhost (localhost [127.0.0.1])
	by pollux.ds.pg.gda.pl (Postfix) with ESMTP id C912CF5CF3;
	Fri,  7 Jul 2006 18:58:39 +0200 (CEST)
Received: from pollux.ds.pg.gda.pl ([127.0.0.1])
 by localhost (pollux.ds.pg.gda.pl [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 03788-09; Fri,  7 Jul 2006 18:58:39 +0200 (CEST)
Received: from piorun.ds.pg.gda.pl (piorun.ds.pg.gda.pl [153.19.208.8])
	by pollux.ds.pg.gda.pl (Postfix) with ESMTP id 6BF26F5CE8;
	Fri,  7 Jul 2006 18:58:39 +0200 (CEST)
Received: from blysk.ds.pg.gda.pl (macro@blysk.ds.pg.gda.pl [153.19.208.6])
	by piorun.ds.pg.gda.pl (8.13.7/8.13.1) with ESMTP id k67GwouK018230;
	Fri, 7 Jul 2006 18:58:50 +0200
Date:	Fri, 7 Jul 2006 17:58:44 +0100 (BST)
From:	"Maciej W. Rozycki" <macro@linux-mips.org>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] fast path for rdhwr emulation for TLS
In-Reply-To: <20060708.011245.82794581.anemo@mba.ocn.ne.jp>
Message-ID: <Pine.LNX.4.64N.0607071715360.25285@blysk.ds.pg.gda.pl>
References: <20060708.000032.88471510.anemo@mba.ocn.ne.jp>
 <Pine.LNX.4.64N.0607071607520.25285@blysk.ds.pg.gda.pl>
 <20060708.011245.82794581.anemo@mba.ocn.ne.jp>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Virus-Scanned: ClamAV 0.88.2/1588/Fri Jul  7 15:54:23 2006 on piorun.ds.pg.gda.pl
X-Virus-Status:	Clean
X-Virus-Scanned: by amavisd-new at pollux.ds.pg.gda.pl
Return-Path: <macro@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11940
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: macro@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Sat, 8 Jul 2006, Atsushi Nemoto wrote:

> >  For a VIVT I-cache this can result in a TLB exception.  TLB handlers are 
> > not currently prepared for being called at the exception level.
> 
> Thanks, now I understand the problem.  Are there any good solutions?
> Only I can think now is using handle_ri_slow for such CPUs.

 I have implemented an appropriate update to the TLB handlers (or actually 
it's enough to care for this case for the TLBL exception), but it predates 
the current synthesized ones.  There is a small impact resulting from 
this change and the synthesized handlers have the advantage of making it 
only necessary for these chips that do need such handling.

 There are two possible ways of handling TLB exceptions from the exception 
level, both requiring checking cp0.index.p (which we do not do at the 
moment under the assumption a TLB refill exception has already been taken 
and handled) and if a failure is indicated either:

1. jumping to the TLB refill handler,

or:

2. executing "tlbwr" rather than "tlbwi".

Both are good, but I have not benchmarked them -- note that a failure is 
expected to be an extremely rare event, so it's the performance for the 
probe success that matters.

> >  Also I am fairly sure gas won't fill the branch delay slot above -- a 
> > trivial rearrangement of code would save a cycle here (and this is a fast 
> > path, so we do not want wasting time).
> 
> Well, here is a code compiled by binutils 2.17.  This version of gas
> can put MFC0 on the delay slot.  But it might be better to use
> noreorder by myself.
> 
> 80012a80 <handle_ri>:
> 80012a80:	401a6800 	mfc0	k0,c0_cause
> 80012a84:	0740fd2e 	bltz	k0,80011f40 <handle_ri_slow>
> 80012a88:	401b7000 	mfc0	k1,c0_epc
> 80012a8c:	8f7a0000 	lw	k0,0(k1)

 Still bad -- you have a stall on $k1 here.  And on $k0 two instructions 
earlier.

> 80012a90:	3c1b7c03 	lui	k1,0x7c03
> 80012a94:	377be83b 	ori	k1,k1,0xe83b
> 80012a98:	175bfd29 	bne	k0,k1,80011f40 <handle_ri_slow>
> 80012a9c:	00000000 	nop

 And this "nop" is a waste of time.

> 80012aa0:	3c1b801b 	lui	k1,0x801b
> 80012aa4:	8f7b4008 	lw	k1,16392(k1)
> 80012aa8:	401a7000 	mfc0	k0,c0_epc
> 80012aac:	275a0004 	addiu	k0,k0,4
> 80012ab0:	409a7000 	mtc0	k0,c0_epc
> 80012ab4:	377b1fff 	ori	k1,k1,0x1fff
> 80012ab8:	3b7b1fff 	xori	k1,k1,0x1fff
> 80012abc:	8f63000c 	lw	v1,12(k1)
> 80012ac0:	42000018 	eret

 I'd restructure the code more or less like this, taking care for (almost) 
all stalls resulting from interlocks on coprocessor moves and memory loads 
and likewise avoiding the need for "nop" fillers there for MIPS I 
processors:

	.set	push
	.set	noat
	.set	noreorder
	mfc0	k0, CP0_CAUSE
	MFC0	k1, CP0_EPC
	bltz	k0, handle_ri_slow	/* if delay slot */
	 lui	k0, 0x7c03
	lw	k1, (k1)
	ori	k0, 0xe83b		/* k0 := rdhwr v1,$29 */
	bne	k0, k1, handle_ri_slow	/* if not ours */
	 get_saved_sp			/* k1 := current_thread_info */
	MFC0	k0, CP0_EPC
#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
	ori	k1, _THREAD_MASK
	xori	k1, _THREAD_MASK
	LONG_L	v1, TI_FLAGS(k1)
	PTR_ADDIU k0, 4
	jr	k0
	 rfe
#else
	PTR_ADDIU k0, 4			/* stall on $k0 */
	MTC0	k0, CP0_EPC
	ori	k1, _THREAD_MASK
	xori	k1, _THREAD_MASK
	LONG_L	v1, TI_FLAGS(k1)
	eret
#endif
	.set	pop

I hope I got this right. ;-)

  Maciej

From macro@linux-mips.org Fri Jul  7 18:04:09 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 07 Jul 2006 18:04:19 +0100 (BST)
Received: from pollux.ds.pg.gda.pl ([153.19.208.7]:2565 "EHLO
	pollux.ds.pg.gda.pl") by ftp.linux-mips.org with ESMTP
	id S8133521AbWGGREJ (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 7 Jul 2006 18:04:09 +0100
Received: from localhost (localhost [127.0.0.1])
	by pollux.ds.pg.gda.pl (Postfix) with ESMTP id 4F723F6181;
	Fri,  7 Jul 2006 19:04:03 +0200 (CEST)
Received: from pollux.ds.pg.gda.pl ([127.0.0.1])
 by localhost (pollux.ds.pg.gda.pl [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 30145-05; Fri,  7 Jul 2006 19:04:03 +0200 (CEST)
Received: from piorun.ds.pg.gda.pl (piorun.ds.pg.gda.pl [153.19.208.8])
	by pollux.ds.pg.gda.pl (Postfix) with ESMTP id E8A58F59C3;
	Fri,  7 Jul 2006 19:04:02 +0200 (CEST)
Received: from blysk.ds.pg.gda.pl (macro@blysk.ds.pg.gda.pl [153.19.208.6])
	by piorun.ds.pg.gda.pl (8.13.7/8.13.1) with ESMTP id k67H4DkP018919;
	Fri, 7 Jul 2006 19:04:13 +0200
Date:	Fri, 7 Jul 2006 18:04:08 +0100 (BST)
From:	"Maciej W. Rozycki" <macro@linux-mips.org>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] fast path for rdhwr emulation for TLS
In-Reply-To: <20060708.014339.89274844.anemo@mba.ocn.ne.jp>
Message-ID: <Pine.LNX.4.64N.0607071759140.25285@blysk.ds.pg.gda.pl>
References: <20060708.000032.88471510.anemo@mba.ocn.ne.jp>
 <Pine.LNX.4.64N.0607071607520.25285@blysk.ds.pg.gda.pl>
 <20060708.011245.82794581.anemo@mba.ocn.ne.jp> <20060708.014339.89274844.anemo@mba.ocn.ne.jp>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Virus-Scanned: ClamAV 0.88.2/1588/Fri Jul  7 15:54:23 2006 on piorun.ds.pg.gda.pl
X-Virus-Status:	Clean
X-Virus-Scanned: by amavisd-new at pollux.ds.pg.gda.pl
Return-Path: <macro@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11941
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: macro@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Sat, 8 Jul 2006, Atsushi Nemoto wrote:

> Can we use Index_Load_Data_I to load the instruction code from icache?

 No need to go through such a hassle when we have a proper architectural 
way of handling it.  Remember MIPS TLB-based MMUs (the two variations I 
know well, anyway) were designed to support a paged kernel.

  Maciej

From ralf@linux-mips.org Fri Jul  7 19:58:50 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 07 Jul 2006 19:58:59 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:60076 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S3466458AbWGGS6u (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 7 Jul 2006 19:58:50 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.6/8.13.4) with ESMTP id k67IMjek028773;
	Fri, 7 Jul 2006 19:22:45 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.6/8.13.6/Submit) id k67IMiQe028772;
	Fri, 7 Jul 2006 19:22:44 +0100
Date:	Fri, 7 Jul 2006 19:22:44 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	macro@linux-mips.org, linux-mips@linux-mips.org
Subject: Re: [PATCH] fast path for rdhwr emulation for TLS
Message-ID: <20060707182244.GA28118@linux-mips.org>
References: <20060708.000032.88471510.anemo@mba.ocn.ne.jp> <Pine.LNX.4.64N.0607071607520.25285@blysk.ds.pg.gda.pl> <20060708.011245.82794581.anemo@mba.ocn.ne.jp> <20060708.014339.89274844.anemo@mba.ocn.ne.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060708.014339.89274844.anemo@mba.ocn.ne.jp>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11942
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Sat, Jul 08, 2006 at 01:43:39AM +0900, Atsushi Nemoto wrote:

> > >  For a VIVT I-cache this can result in a TLB exception.  TLB handlers are 
> > > not currently prepared for being called at the exception level.
> > 
> > Thanks, now I understand the problem.  Are there any good solutions?
> > Only I can think now is using handle_ri_slow for such CPUs.
> 
> Can we use Index_Load_Data_I to load the instruction code from icache?
> Just an idea...

In addition to what Maciej said - the format of instructions in the I-cache
is not necessarily the same as in memory.  Many processor store pre-decoded
instructions in the I-cache.

  Ralf

From vagabon.xyz@gmail.com Sat Jul  8 15:39:46 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 08 Jul 2006 15:39:56 +0100 (BST)
Received: from ug-out-1314.google.com ([66.249.92.172]:47353 "EHLO
	ug-out-1314.google.com") by ftp.linux-mips.org with ESMTP
	id S8133530AbWGHOjp (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 8 Jul 2006 15:39:45 +0100
Received: by ug-out-1314.google.com with SMTP id k3so2904329ugf
        for <linux-mips@linux-mips.org>; Sat, 08 Jul 2006 07:39:45 -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=loFzxgB9Tc14mskH5WnUvVq7D7YQH+670us6Ggw9Iz/tIb4itS9i+kPTx8sOaHa+SU8pzfow5ctB8NKxAPFKj0kAZjRASuC3Q5ItWyIIsngLKYLoetBDPIQ2+AoUDuOwW9X6NqrY1ZgoIdvhAcjdG25/2LZEJnXFF3Pwb0BRFLY=
Received: by 10.66.219.11 with SMTP id r11mr3096539ugg;
        Sat, 08 Jul 2006 07:39:44 -0700 (PDT)
Received: by 10.67.100.10 with HTTP; Sat, 8 Jul 2006 07:39:44 -0700 (PDT)
Message-ID: <cda58cb80607080739i772d439dqc4e06a8b275e03ee@mail.gmail.com>
Date:	Sat, 8 Jul 2006 16:39:44 +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:	linux-mips@linux-mips.org, ralf@linux-mips.org
In-Reply-To: <20060707.002602.75184460.anemo@mba.ocn.ne.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <20060706.233634.59465089.anemo@mba.ocn.ne.jp>
	 <44AD2537.1030509@innova-card.com>
	 <cda58cb80607060805yc656114p53516b904188c20f@mail.gmail.com>
	 <20060707.002602.75184460.anemo@mba.ocn.ne.jp>
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: 11943
X-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, Atsushi Nemoto <anemo@mba.ocn.ne.jp>:
> 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?
>

Sorry for the late answer.

Did you check that show_mem() still works ? I'm not sure about that point.

Thanks
-- 
               Franck

From vagabon.xyz@gmail.com Sat Jul  8 15:47:39 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 08 Jul 2006 15:47:49 +0100 (BST)
Received: from ug-out-1314.google.com ([66.249.92.173]:45071 "EHLO
	ug-out-1314.google.com") by ftp.linux-mips.org with ESMTP
	id S8133530AbWGHOrj (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 8 Jul 2006 15:47:39 +0100
Received: by ug-out-1314.google.com with SMTP id k3so2905928ugf
        for <linux-mips@linux-mips.org>; Sat, 08 Jul 2006 07:47:39 -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=gLqG7ppaQwyRZS1DHuyjaSSktwrHFOus3yEhxoROAX+H0/w/IyXLmtq6610GrMtC87uRUuV9VpabfqMycTW8bRnX8wAWkLk8o5O85syJf59r7odzWz1ZDJ1FlQtNcBs8popxQAyxyJTa2m+yQrl37SDeB5KmABbLHuZi167ZHDs=
Received: by 10.67.29.12 with SMTP id g12mr3098367ugj;
        Sat, 08 Jul 2006 07:47:39 -0700 (PDT)
Received: by 10.67.100.10 with HTTP; Sat, 8 Jul 2006 07:47:39 -0700 (PDT)
Message-ID: <cda58cb80607080747g66ac4357ya1f2cef89b4d868@mail.gmail.com>
Date:	Sat, 8 Jul 2006 16:47:39 +0200
From:	"Franck Bui-Huu" <vagabon.xyz@gmail.com>
To:	"Ralf Baechle" <ralf@linux-mips.org>
Subject: Re: [PATCH] sparsemem fix
Cc:	"Atsushi Nemoto" <anemo@mba.ocn.ne.jp>, linux-mips@linux-mips.org
In-Reply-To: <20060706173235.GA4739@linux-mips.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <20060705.012244.96686002.anemo@mba.ocn.ne.jp>
	 <44AB79D0.90002@innova-card.com>
	 <20060705.192054.128618288.nemoto@toshiba-tops.co.jp>
	 <20060706173235.GA4739@linux-mips.org>
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: 11944
X-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, Ralf Baechle <ralf@linux-mips.org>:
> On Wed, Jul 05, 2006 at 07:20:54PM +0900, Atsushi Nemoto wrote:
>
> > > 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
>
> The fact that the code is only used on IP27 doesn't mean it is IP27-specific.
>

but the code seems to be in arch/mips/sgi-ip27, no ?

BTW, Ralf, are there any needs for MIPS to support platforms whose
memory start is not 0 ? I have made a patch for that, and wondering if
it's worth to post it on the list...

-- 
               Franck

From anemo@mba.ocn.ne.jp Sat Jul  8 17:02:04 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 08 Jul 2006 17:02:13 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:11731 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133540AbWGHQCE (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sat, 8 Jul 2006 17:02:04 +0100
Received: from localhost (p5177-ipad202funabasi.chiba.ocn.ne.jp [222.146.76.177])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 3425CB258; Sun,  9 Jul 2006 01:01:59 +0900 (JST)
Date:	Sun, 09 Jul 2006 01:03:16 +0900 (JST)
Message-Id: <20060709.010316.126574153.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: <cda58cb80607080739i772d439dqc4e06a8b275e03ee@mail.gmail.com>
References: <cda58cb80607060805yc656114p53516b904188c20f@mail.gmail.com>
	<20060707.002602.75184460.anemo@mba.ocn.ne.jp>
	<cda58cb80607080739i772d439dqc4e06a8b275e03ee@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: 11945
X-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 Sat, 8 Jul 2006 16:39:44 +0200, "Franck Bui-Huu" <vagabon.xyz@gmail.com> wrote:
> Did you check that show_mem() still works ? I'm not sure about that point.

It should work, but this patch would make the output a bit better.

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

diff --git a/arch/mips/mm/pgtable.c b/arch/mips/mm/pgtable.c
index 792c6eb..c93aa6c 100644
--- a/arch/mips/mm/pgtable.c
+++ b/arch/mips/mm/pgtable.c
@@ -15,6 +15,8 @@ #ifndef CONFIG_NEED_MULTIPLE_NODES  /* X
 	printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
 	pfn = max_mapnr;
 	while (pfn-- > 0) {
+		if (!pfn_valid(pfn))
+			continue;
 		page = pfn_to_page(pfn);
 		total++;
 		if (PageHighMem(page))

From anemo@mba.ocn.ne.jp Sat Jul  8 17:11:46 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 08 Jul 2006 17:11:56 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:49871 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133540AbWGHQLq (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sat, 8 Jul 2006 17:11:46 +0100
Received: from localhost (p5177-ipad202funabasi.chiba.ocn.ne.jp [222.146.76.177])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 783C09B55; Sun,  9 Jul 2006 01:11:42 +0900 (JST)
Date:	Sun, 09 Jul 2006 01:12:59 +0900 (JST)
Message-Id: <20060709.011259.92587435.anemo@mba.ocn.ne.jp>
To:	macro@linux-mips.org
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] fast path for rdhwr emulation for TLS
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <Pine.LNX.4.64N.0607071715360.25285@blysk.ds.pg.gda.pl>
References: <Pine.LNX.4.64N.0607071607520.25285@blysk.ds.pg.gda.pl>
	<20060708.011245.82794581.anemo@mba.ocn.ne.jp>
	<Pine.LNX.4.64N.0607071715360.25285@blysk.ds.pg.gda.pl>
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: 11946
X-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 Fri, 7 Jul 2006 17:58:44 +0100 (BST), "Maciej W. Rozycki" <macro@linux-mips.org> wrote:
> > Thanks, now I understand the problem.  Are there any good solutions?
> > Only I can think now is using handle_ri_slow for such CPUs.
> 
>  I have implemented an appropriate update to the TLB handlers (or actually 
> it's enough to care for this case for the TLBL exception), but it predates 
> the current synthesized ones.  There is a small impact resulting from 
> this change and the synthesized handlers have the advantage of making it 
> only necessary for these chips that do need such handling.

Do you still have the code?  Could you post it for reference?

>  I'd restructure the code more or less like this, taking care for (almost) 
> all stalls resulting from interlocks on coprocessor moves and memory loads 
> and likewise avoiding the need for "nop" fillers there for MIPS I 
> processors:

Thanks.  I'll look it deeply.

> 	bne	k0, k1, handle_ri_slow	/* if not ours */
> 	 get_saved_sp			/* k1 := current_thread_info */

Unfortunately, get_saved_sp is not a single instruction...

---
Atsushi Nemoto

From vagabon.xyz@gmail.com Sat Jul  8 17:15:53 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 08 Jul 2006 17:16:05 +0100 (BST)
Received: from ug-out-1314.google.com ([66.249.92.170]:25482 "EHLO
	ug-out-1314.google.com") by ftp.linux-mips.org with ESMTP
	id S8133553AbWGHQPx (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 8 Jul 2006 17:15:53 +0100
Received: by ug-out-1314.google.com with SMTP id k3so2926443ugf
        for <linux-mips@linux-mips.org>; Sat, 08 Jul 2006 09:15:52 -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=ATGvwD8yCwQCsxfJhUohckISBKuYuD+QkLZCGBDuduxphHE5FkQIkLiR2vlAerPSFeuGKGIe16cZfkwYR62U7iprL4c9lFoScfGY4jwHs3H1nZsuMBV6f2Ezoq/q4HgbE7NijUjfwsy26WDTB20GaZxhr5ivaSArb8M98mnlGag=
Received: by 10.66.243.2 with SMTP id q2mr3168053ugh;
        Sat, 08 Jul 2006 09:15:52 -0700 (PDT)
Received: by 10.67.100.10 with HTTP; Sat, 8 Jul 2006 09:15:52 -0700 (PDT)
Message-ID: <cda58cb80607080915h59f2fcc0yff605fb4afdf1b8b@mail.gmail.com>
Date:	Sat, 8 Jul 2006 18:15:52 +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:	linux-mips@linux-mips.org, ralf@linux-mips.org
In-Reply-To: <20060709.010316.126574153.anemo@mba.ocn.ne.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <cda58cb80607060805yc656114p53516b904188c20f@mail.gmail.com>
	 <20060707.002602.75184460.anemo@mba.ocn.ne.jp>
	 <cda58cb80607080739i772d439dqc4e06a8b275e03ee@mail.gmail.com>
	 <20060709.010316.126574153.anemo@mba.ocn.ne.jp>
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: 11947
X-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/8, Atsushi Nemoto <anemo@mba.ocn.ne.jp>:
> On Sat, 8 Jul 2006 16:39:44 +0200, "Franck Bui-Huu" <vagabon.xyz@gmail.com> wrote:
> > Did you check that show_mem() still works ? I'm not sure about that point.
>
> It should work, but this patch would make the output a bit better.
>

well I would say without this patch it should break.

'pfn' takes values between 0 and max_mapnr. This range includes memory
holes, doens't it ? In that case what does
pfn_to_page(pfn_inside_a_hole) ?

-- 
               Franck

From daniel@caiaq.de Sat Jul  8 18:35:23 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 08 Jul 2006 18:35:33 +0100 (BST)
Received: from buzzloop.caiaq.de ([212.112.241.133]:46600 "EHLO
	buzzloop.caiaq.de") by ftp.linux-mips.org with ESMTP
	id S8133557AbWGHRfX (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 8 Jul 2006 18:35:23 +0100
Received: from localhost (localhost [127.0.0.1])
	by buzzloop.caiaq.de (Postfix) with ESMTP id 5EE067F4028
	for <linux-mips@linux-mips.org>; Sat,  8 Jul 2006 19:35:17 +0200 (CEST)
Received: from buzzloop.caiaq.de ([127.0.0.1])
	by localhost (buzzloop [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 09040-07 for <linux-mips@linux-mips.org>;
	Sat, 8 Jul 2006 19:35:17 +0200 (CEST)
Received: from [192.168.4.4] (port-212-202-198-187.dynamic.qsc.de [212.202.198.187])
	(using TLSv1 with cipher RC4-SHA (128/128 bits))
	(No client certificate requested)
	by buzzloop.caiaq.de (Postfix) with ESMTP id F2C587F4024
	for <linux-mips@linux-mips.org>; Sat,  8 Jul 2006 19:35:16 +0200 (CEST)
Mime-Version: 1.0 (Apple Message framework v752.2)
Content-Transfer-Encoding: 7bit
Message-Id: <B4CE0C51-47B5-4F72-8008-08549262B4F0@caiaq.de>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
To:	linux-mips@linux-mips.org
From:	Daniel Mack <daniel@caiaq.de>
Subject: [PATCH] remove double entry of FB_AU1200 in drivers/video/Kconfig
Date:	Sat, 8 Jul 2006 19:35:12 +0200
X-Mailer: Apple Mail (2.752.2)
Return-Path: <daniel@caiaq.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: 11948
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: daniel@caiaq.de
Precedence: bulk
X-list: linux-mips

Signed-off-by: Daniel Mack <daniel@caiaq.de>


diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 335d37a..a810581 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -1353,17 +1353,6 @@ config FB_AU1200
           various panels and CRTs by passing in kernel cmd line option
           au1200fb:panel=<name>.
-config FB_AU1200
-       bool "Au1200 LCD Driver"
-       depends on FB && MIPS && SOC_AU1200
-       select FB_CFB_FILLRECT
-       select FB_CFB_COPYAREA
-       select FB_CFB_IMAGEBLIT
-       help
-         This is the framebuffer driver for the AMD Au1200 SOC.  It  
can drive
-         various panels and CRTs by passing in kernel cmd line option
-         au1200fb:panel=<name>.
-
source "drivers/video/geode/Kconfig"
config FB_FFB


From jblache@debian.org Sat Jul  8 23:02:11 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 08 Jul 2006 23:02:19 +0100 (BST)
Received: from frigate.technologeek.org ([62.4.21.148]:14041 "EHLO
	frigate.technologeek.org") by ftp.linux-mips.org with ESMTP
	id S8133575AbWGHWCK (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 8 Jul 2006 23:02:10 +0100
Received: by frigate.technologeek.org (Postfix, from userid 1000)
	id 5B874147834A; Sun,  9 Jul 2006 00:02:12 +0200 (CEST)
From:	Julien BLACHE <jblache@debian.org>
To:	debian-mips@lists.debian.org
Cc:	linux-mips@linux-mips.org
Subject: IP22 RTC bug on 64bit 2.6 kernels ?
Date:	Sun, 09 Jul 2006 00:02:12 +0200
Message-ID: <87fyhbhi1n.fsf@frigate.technologeek.org>
User-Agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.19 (linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Return-Path: <jblache@debian.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: 11949
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: jblache@debian.org
Precedence: bulk
X-list: linux-mips

Hi,

For some time now, my IP22 was booting in a "back to the future" mode,
somewhere between 1983 and 1987 (usually, 1985). Interestingly enough,
only the year comes out wrong, everything else is perfectly OK.

This is not the RTC chip at fault, as everything else stored in the
NVRAM is OK too. I was prepared to order a new RTC chip, until...

Until I remembered that it all started with the new 64bit 2.6 kernels
built by Martin Michlmayr in Debian. Indeed, rebooting into a 32bit
2.4.27 the problem goes away.

Using the 2.6 kernel (2.6.17), hwclock -w/hwclock -r will not give the
same year twice in a row, which is quite fun and unexpected. I
couldn't find a logic of some kind in the values read from the RTC;
the year went as far as 1972 and as close as 2007 :)

So, it looks like there is a bug in this area with (at least) 64bit
2.6 kernels. Is there any known bug ? Anything I can do to help track
the problem down ?

Thanks,

JB.

-- 
 Julien BLACHE - Debian & GNU/Linux Developer - <jblache@debian.org> 
 
 Public key available on <http://www.jblache.org> - KeyID: F5D6 5169 
 GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169 

From jblache@debian.org Sat Jul  8 23:21:22 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 08 Jul 2006 23:21:36 +0100 (BST)
Received: from frigate.technologeek.org ([62.4.21.148]:35306 "EHLO
	frigate.technologeek.org") by ftp.linux-mips.org with ESMTP
	id S8133575AbWGHWVW (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 8 Jul 2006 23:21:22 +0100
Received: by frigate.technologeek.org (Postfix, from userid 1000)
	id 506A2147834A; Sun,  9 Jul 2006 00:21:24 +0200 (CEST)
From:	Julien BLACHE <jblache@debian.org>
To:	debian-mips@lists.debian.org
Cc:	linux-mips@linux-mips.org
Subject: Re: IP22 RTC bug on 64bit 2.6 kernels ?
References: <87fyhbhi1n.fsf@frigate.technologeek.org>
Date:	Sun, 09 Jul 2006 00:21:24 +0200
In-Reply-To: <87fyhbhi1n.fsf@frigate.technologeek.org> (Julien BLACHE's
	message of "Sun, 09 Jul 2006 00:02:12 +0200")
Message-ID: <87ac7jhh5n.fsf@frigate.technologeek.org>
User-Agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.19 (linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Return-Path: <jblache@debian.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: 11950
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: jblache@debian.org
Precedence: bulk
X-list: linux-mips

--=-=-=

Julien BLACHE <jblache@debian.org> wrote:

Hi,

> So, it looks like there is a bug in this area with (at least) 64bit
> 2.6 kernels. Is there any known bug ? Anything I can do to help track
> the problem down ?

Ok, it's brown paper bag time for someone :-)


This patch fixes a typo in arch/mips/sgi-ip22/ip22-time.c, leading to
the incorrect year being set into the RTC chip.

Signed-off-by: Julien BLACHE <jb@jblache.org>


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=ip22-rtc-year-typo-fix.patch
Content-Description: Typo fix in arch/mips/sgi-ip22/ip22-time.c

--- arch/mips/sgi-ip22/ip22-time.c.orig	2006-07-08 22:17:02.000000000 +0000
+++ arch/mips/sgi-ip22/ip22-time.c	2006-07-08 22:17:29.000000000 +0000
@@ -76,7 +76,7 @@
 	save_control = hpc3c0->rtcregs[RTC_CMD] & 0xff;
 	hpc3c0->rtcregs[RTC_CMD] = save_control | RTC_TE;
 
-	hpc3c0->rtcregs[RTC_YEAR] = BIN2BCD(tm.tm_sec);
+	hpc3c0->rtcregs[RTC_YEAR] = BIN2BCD(tm.tm_year);
 	hpc3c0->rtcregs[RTC_MONTH] = BIN2BCD(tm.tm_mon);
 	hpc3c0->rtcregs[RTC_DATE] = BIN2BCD(tm.tm_mday);
 	hpc3c0->rtcregs[RTC_HOURS] = BIN2BCD(tm.tm_hour);

--=-=-=



Thanks,

JB.

-- 
 Julien BLACHE - Debian & GNU/Linux Developer - <jblache@debian.org> 
 
 Public key available on <http://www.jblache.org> - KeyID: F5D6 5169 
 GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169 

--=-=-=--

From ths@networkno.de Sun Jul  9 01:22:31 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 09 Jul 2006 01:22:43 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:17900 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8133619AbWGIAWa (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sun, 9 Jul 2006 01:22:30 +0100
Received: from lagash (88-106-172-167.dynamic.dsl.as9105.com [88.106.172.167])
	(using TLSv1 with cipher DES-CBC3-SHA (168/168 bits))
	(No client certificate requested)
	by bender.bawue.de (Postfix) with ESMTP
	id 1794D45C95; Sun,  9 Jul 2006 02:22:29 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1FzN40-0004NZ-F8; Sun, 09 Jul 2006 01:22:20 +0100
Date:	Sun, 9 Jul 2006 01:22:20 +0100
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] Print out TLB handler assembly
Message-ID: <20060709002220.GB4375@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: 11951
X-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 changes tlbex to print out the (.word) assembler code of
the synthesized handlers.


Thiemo


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


diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index e1a8139..709280e 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -5,7 +5,7 @@
  *
  * Synthesize TLB refill handlers at runtime.
  *
- * Copyright (C) 2004,2005 by Thiemo Seufer
+ * Copyright (C) 2004,2005,2006 by Thiemo Seufer
  * Copyright (C) 2005  Maciej W. Rozycki
  * Copyright (C) 2006  Ralf Baechle (ralf@linux-mips.org)
  *
@@ -35,8 +35,6 @@ #include <asm/elf.h>
 #include <asm/smp.h>
 #include <asm/war.h>
 
-/* #define DEBUG_TLB */
-
 static __init int __attribute__((unused)) r45k_bvahwbug(void)
 {
 	/* XXX: We should probe for the presence of this bug, but we don't. */
@@ -728,6 +726,7 @@ static void __init build_r3000_tlb_refil
 {
 	long pgdc = (long)pgd_current;
 	u32 *p;
+	int i;
 
 	memset(tlb_handler, 0, sizeof(tlb_handler));
 	p = tlb_handler;
@@ -753,16 +752,15 @@ static void __init build_r3000_tlb_refil
 	if (p > tlb_handler + 32)
 		panic("TLB refill handler space exceeded");
 
-	printk("Synthesized TLB refill handler (%u instructions).\n",
+	printk(KERN_INFO
+	       "Synthesized TLB refill handler (%u instructions).\n",
 	       (unsigned int)(p - tlb_handler));
-#ifdef DEBUG_TLB
-	{
-		int i;
 
-		for (i = 0; i < (p - tlb_handler); i++)
-			printk("%08x\n", tlb_handler[i]);
-	}
-#endif
+	printk(KERN_DEBUG "\t.set push\n");
+	printk(KERN_DEBUG "\t.set noreorder\n");
+	for (i = 0; i < (p - tlb_handler); i++)
+		printk(KERN_DEBUG "\t.word 0x%08x\n", tlb_handler[i]);
+	printk(KERN_DEBUG "\t.set pop\n");
 
 	memcpy((void *)ebase, tlb_handler, 0x80);
 }
@@ -1175,6 +1173,7 @@ static void __init build_r4000_tlb_refil
 	struct reloc *r = relocs;
 	u32 *f;
 	unsigned int final_len;
+	int i;
 
 	memset(tlb_handler, 0, sizeof(tlb_handler));
 	memset(labels, 0, sizeof(labels));
@@ -1272,24 +1271,22 @@ #else /* CONFIG_64BIT */
 #endif /* CONFIG_64BIT */
 
 	resolve_relocs(relocs, labels);
-	printk("Synthesized TLB refill handler (%u instructions).\n",
+	printk(KERN_INFO
+	       "Synthesized TLB refill handler (%u instructions).\n",
 	       final_len);
 
-#ifdef DEBUG_TLB
-	{
-		int i;
-
-		f = final_handler;
+	f = final_handler;
 #ifdef CONFIG_64BIT
-		if (final_len > 32)
-			final_len = 64;
-		else
-			f = final_handler + 32;
+	if (final_len > 32)
+		final_len = 64;
+	else
+		f = final_handler + 32;
 #endif /* CONFIG_64BIT */
-		for (i = 0; i < final_len; i++)
-			printk("%08x\n", f[i]);
-	}
-#endif
+	printk(KERN_DEBUG "\t.set push\n");
+	printk(KERN_DEBUG "\t.set noreorder\n");
+	for (i = 0; i < final_len; i++)
+		printk(KERN_DEBUG "\t.word 0x%08x\n", f[i]);
+	printk(KERN_DEBUG "\t.set pop\n");
 
 	memcpy((void *)ebase, final_handler, 0x100);
 }
@@ -1522,6 +1519,7 @@ static void __init build_r3000_tlb_load_
 	u32 *p = handle_tlbl;
 	struct label *l = labels;
 	struct reloc *r = relocs;
+	int i;
 
 	memset(handle_tlbl, 0, sizeof(handle_tlbl));
 	memset(labels, 0, sizeof(labels));
@@ -1541,17 +1539,15 @@ static void __init build_r3000_tlb_load_
 		panic("TLB load handler fastpath space exceeded");
 
 	resolve_relocs(relocs, labels);
-	printk("Synthesized TLB load handler fastpath (%u instructions).\n",
+	printk(KERN_INFO
+	       "Synthesized TLB load handler fastpath (%u instructions).\n",
 	       (unsigned int)(p - handle_tlbl));
 
-#ifdef DEBUG_TLB
-	{
-		int i;
-
-		for (i = 0; i < (p - handle_tlbl); i++)
-			printk("%08x\n", handle_tlbl[i]);
-	}
-#endif
+	printk(KERN_DEBUG "\t.set push\n");
+	printk(KERN_DEBUG "\t.set noreorder\n");
+	for (i = 0; i < (p - handle_tlbl); i++)
+		printk(KERN_DEBUG "\t.word 0x%08x\n", handle_tlbl[i]);
+	printk(KERN_DEBUG "\t.set pop\n");
 }
 
 static void __init build_r3000_tlb_store_handler(void)
@@ -1559,6 +1555,7 @@ static void __init build_r3000_tlb_store
 	u32 *p = handle_tlbs;
 	struct label *l = labels;
 	struct reloc *r = relocs;
+	int i;
 
 	memset(handle_tlbs, 0, sizeof(handle_tlbs));
 	memset(labels, 0, sizeof(labels));
@@ -1578,17 +1575,15 @@ static void __init build_r3000_tlb_store
 		panic("TLB store handler fastpath space exceeded");
 
 	resolve_relocs(relocs, labels);
-	printk("Synthesized TLB store handler fastpath (%u instructions).\n",
+	printk(KERN_INFO
+	       "Synthesized TLB store handler fastpath (%u instructions).\n",
 	       (unsigned int)(p - handle_tlbs));
 
-#ifdef DEBUG_TLB
-	{
-		int i;
-
-		for (i = 0; i < (p - handle_tlbs); i++)
-			printk("%08x\n", handle_tlbs[i]);
-	}
-#endif
+	printk(KERN_DEBUG "\t.set push\n");
+	printk(KERN_DEBUG "\t.set noreorder\n");
+	for (i = 0; i < (p - handle_tlbs); i++)
+		printk(KERN_DEBUG "\t.word 0x%08x\n", handle_tlbs[i]);
+	printk(KERN_DEBUG "\t.set pop\n");
 }
 
 static void __init build_r3000_tlb_modify_handler(void)
@@ -1596,6 +1591,7 @@ static void __init build_r3000_tlb_modif
 	u32 *p = handle_tlbm;
 	struct label *l = labels;
 	struct reloc *r = relocs;
+	int i;
 
 	memset(handle_tlbm, 0, sizeof(handle_tlbm));
 	memset(labels, 0, sizeof(labels));
@@ -1615,17 +1611,15 @@ static void __init build_r3000_tlb_modif
 		panic("TLB modify handler fastpath space exceeded");
 
 	resolve_relocs(relocs, labels);
-	printk("Synthesized TLB modify handler fastpath (%u instructions).\n",
+	printk(KERN_INFO
+	       "Synthesized TLB modify handler fastpath (%u instructions).\n",
 	       (unsigned int)(p - handle_tlbm));
 
-#ifdef DEBUG_TLB
-	{
-		int i;
-
-		for (i = 0; i < (p - handle_tlbm); i++)
-			printk("%08x\n", handle_tlbm[i]);
-	}
-#endif
+	printk(KERN_DEBUG "\t.set push\n");
+	printk(KERN_DEBUG "\t.set noreorder\n");
+	for (i = 0; i < (p - handle_tlbm); i++)
+		printk(KERN_DEBUG "\t.word 0x%08x\n", handle_tlbm[i]);
+	printk(KERN_DEBUG "\t.set pop\n");
 }
 
 /*
@@ -1677,6 +1671,7 @@ static void __init build_r4000_tlb_load_
 	u32 *p = handle_tlbl;
 	struct label *l = labels;
 	struct reloc *r = relocs;
+	int i;
 
 	memset(handle_tlbl, 0, sizeof(handle_tlbl));
 	memset(labels, 0, sizeof(labels));
@@ -1704,17 +1699,15 @@ static void __init build_r4000_tlb_load_
 		panic("TLB load handler fastpath space exceeded");
 
 	resolve_relocs(relocs, labels);
-	printk("Synthesized TLB load handler fastpath (%u instructions).\n",
+	printk(KERN_INFO
+	       "Synthesized TLB load handler fastpath (%u instructions).\n",
 	       (unsigned int)(p - handle_tlbl));
 
-#ifdef DEBUG_TLB
-	{
-		int i;
-
-		for (i = 0; i < (p - handle_tlbl); i++)
-			printk("%08x\n", handle_tlbl[i]);
-	}
-#endif
+	printk(KERN_DEBUG "\t.set push\n");
+	printk(KERN_DEBUG "\t.set noreorder\n");
+	for (i = 0; i < (p - handle_tlbl); i++)
+		printk(KERN_DEBUG "\t.word 0x%08x\n", handle_tlbl[i]);
+	printk(KERN_DEBUG "\t.set pop\n");
 }
 
 static void __init build_r4000_tlb_store_handler(void)
@@ -1722,6 +1715,7 @@ static void __init build_r4000_tlb_store
 	u32 *p = handle_tlbs;
 	struct label *l = labels;
 	struct reloc *r = relocs;
+	int i;
 
 	memset(handle_tlbs, 0, sizeof(handle_tlbs));
 	memset(labels, 0, sizeof(labels));
@@ -1740,17 +1734,15 @@ static void __init build_r4000_tlb_store
 		panic("TLB store handler fastpath space exceeded");
 
 	resolve_relocs(relocs, labels);
-	printk("Synthesized TLB store handler fastpath (%u instructions).\n",
+	printk(KERN_INFO
+	       "Synthesized TLB store handler fastpath (%u instructions).\n",
 	       (unsigned int)(p - handle_tlbs));
 
-#ifdef DEBUG_TLB
-	{
-		int i;
-
-		for (i = 0; i < (p - handle_tlbs); i++)
-			printk("%08x\n", handle_tlbs[i]);
-	}
-#endif
+	printk(KERN_DEBUG "\t.set push\n");
+	printk(KERN_DEBUG "\t.set noreorder\n");
+	for (i = 0; i < (p - handle_tlbs); i++)
+		printk(KERN_DEBUG "\t.word 0x%08x\n", handle_tlbs[i]);
+	printk(KERN_DEBUG "\t.set pop\n");
 }
 
 static void __init build_r4000_tlb_modify_handler(void)
@@ -1758,6 +1750,7 @@ static void __init build_r4000_tlb_modif
 	u32 *p = handle_tlbm;
 	struct label *l = labels;
 	struct reloc *r = relocs;
+	int i;
 
 	memset(handle_tlbm, 0, sizeof(handle_tlbm));
 	memset(labels, 0, sizeof(labels));
@@ -1777,17 +1770,15 @@ static void __init build_r4000_tlb_modif
 		panic("TLB modify handler fastpath space exceeded");
 
 	resolve_relocs(relocs, labels);
-	printk("Synthesized TLB modify handler fastpath (%u instructions).\n",
+	printk(KERN_INFO
+	       "Synthesized TLB modify handler fastpath (%u instructions).\n",
 	       (unsigned int)(p - handle_tlbm));
 
-#ifdef DEBUG_TLB
-	{
-		int i;
-
-		for (i = 0; i < (p - handle_tlbm); i++)
-			printk("%08x\n", handle_tlbm[i]);
-	}
-#endif
+	printk(KERN_DEBUG "\t.set push\n");
+	printk(KERN_DEBUG "\t.set noreorder\n");
+	for (i = 0; i < (p - handle_tlbm); i++)
+		printk(KERN_DEBUG "\t.word 0x%08x\n", handle_tlbm[i]);
+	printk(KERN_DEBUG "\t.set pop\n");
 }
 
 void __init build_tlb_refill_handler(void)

From ths@networkno.de Sun Jul  9 01:47:16 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 09 Jul 2006 01:47:27 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:58500 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8133624AbWGIArQ (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sun, 9 Jul 2006 01:47:16 +0100
Received: from lagash (88-106-172-167.dynamic.dsl.as9105.com [88.106.172.167])
	(using TLSv1 with cipher DES-CBC3-SHA (168/168 bits))
	(No client certificate requested)
	by bender.bawue.de (Postfix) with ESMTP
	id 4C3D145CCF; Sun,  9 Jul 2006 02:47:15 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1FzNRy-0004QV-6d; Sun, 09 Jul 2006 01:47:06 +0100
Date:	Sun, 9 Jul 2006 01:47:06 +0100
From:	Thiemo Seufer <ths@networkno.de>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: Re: [PATCH] Print out TLB handler assembly
Message-ID: <20060709004706.GC4375@networkno.de>
References: <20060709002220.GB4375@networkno.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060709002220.GB4375@networkno.de>
User-Agent: Mutt/1.5.11+cvs20060403
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: 11952
X-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

Thiemo Seufer wrote:
> Hello All,
> 
> this changes tlbex to print out the (.word) assembler code of
> the synthesized handlers.

Small update, using pr_debug and pr_info.


Thiemo


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


diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index e1a8139..375e099 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -5,7 +5,7 @@
  *
  * Synthesize TLB refill handlers at runtime.
  *
- * Copyright (C) 2004,2005 by Thiemo Seufer
+ * Copyright (C) 2004,2005,2006 by Thiemo Seufer
  * Copyright (C) 2005  Maciej W. Rozycki
  * Copyright (C) 2006  Ralf Baechle (ralf@linux-mips.org)
  *
@@ -35,8 +35,6 @@ #include <asm/elf.h>
 #include <asm/smp.h>
 #include <asm/war.h>
 
-/* #define DEBUG_TLB */
-
 static __init int __attribute__((unused)) r45k_bvahwbug(void)
 {
 	/* XXX: We should probe for the presence of this bug, but we don't. */
@@ -728,6 +726,7 @@ static void __init build_r3000_tlb_refil
 {
 	long pgdc = (long)pgd_current;
 	u32 *p;
+	int i;
 
 	memset(tlb_handler, 0, sizeof(tlb_handler));
 	p = tlb_handler;
@@ -753,16 +752,14 @@ static void __init build_r3000_tlb_refil
 	if (p > tlb_handler + 32)
 		panic("TLB refill handler space exceeded");
 
-	printk("Synthesized TLB refill handler (%u instructions).\n",
-	       (unsigned int)(p - tlb_handler));
-#ifdef DEBUG_TLB
-	{
-		int i;
+	pr_info("Synthesized TLB refill handler (%u instructions).\n",
+		(unsigned int)(p - tlb_handler));
 
-		for (i = 0; i < (p - tlb_handler); i++)
-			printk("%08x\n", tlb_handler[i]);
-	}
-#endif
+	pr_debug("\t.set push\n");
+	pr_debug("\t.set noreorder\n");
+	for (i = 0; i < (p - tlb_handler); i++)
+		pr_debug("\t.word 0x%08x\n", tlb_handler[i]);
+	pr_debug("\t.set pop\n");
 
 	memcpy((void *)ebase, tlb_handler, 0x80);
 }
@@ -1175,6 +1172,7 @@ static void __init build_r4000_tlb_refil
 	struct reloc *r = relocs;
 	u32 *f;
 	unsigned int final_len;
+	int i;
 
 	memset(tlb_handler, 0, sizeof(tlb_handler));
 	memset(labels, 0, sizeof(labels));
@@ -1272,24 +1270,21 @@ #else /* CONFIG_64BIT */
 #endif /* CONFIG_64BIT */
 
 	resolve_relocs(relocs, labels);
-	printk("Synthesized TLB refill handler (%u instructions).\n",
-	       final_len);
-
-#ifdef DEBUG_TLB
-	{
-		int i;
+	pr_info("Synthesized TLB refill handler (%u instructions).\n",
+		final_len);
 
-		f = final_handler;
+	f = final_handler;
 #ifdef CONFIG_64BIT
-		if (final_len > 32)
-			final_len = 64;
-		else
-			f = final_handler + 32;
+	if (final_len > 32)
+		final_len = 64;
+	else
+		f = final_handler + 32;
 #endif /* CONFIG_64BIT */
-		for (i = 0; i < final_len; i++)
-			printk("%08x\n", f[i]);
-	}
-#endif
+	pr_debug("\t.set push\n");
+	pr_debug("\t.set noreorder\n");
+	for (i = 0; i < final_len; i++)
+		pr_debug("\t.word 0x%08x\n", f[i]);
+	pr_debug("\t.set pop\n");
 
 	memcpy((void *)ebase, final_handler, 0x100);
 }
@@ -1522,6 +1517,7 @@ static void __init build_r3000_tlb_load_
 	u32 *p = handle_tlbl;
 	struct label *l = labels;
 	struct reloc *r = relocs;
+	int i;
 
 	memset(handle_tlbl, 0, sizeof(handle_tlbl));
 	memset(labels, 0, sizeof(labels));
@@ -1541,17 +1537,14 @@ static void __init build_r3000_tlb_load_
 		panic("TLB load handler fastpath space exceeded");
 
 	resolve_relocs(relocs, labels);
-	printk("Synthesized TLB load handler fastpath (%u instructions).\n",
-	       (unsigned int)(p - handle_tlbl));
-
-#ifdef DEBUG_TLB
-	{
-		int i;
+	pr_info("Synthesized TLB load handler fastpath (%u instructions).\n",
+		(unsigned int)(p - handle_tlbl));
 
-		for (i = 0; i < (p - handle_tlbl); i++)
-			printk("%08x\n", handle_tlbl[i]);
-	}
-#endif
+	pr_debug("\t.set push\n");
+	pr_debug("\t.set noreorder\n");
+	for (i = 0; i < (p - handle_tlbl); i++)
+		pr_debug("\t.word 0x%08x\n", handle_tlbl[i]);
+	pr_debug("\t.set pop\n");
 }
 
 static void __init build_r3000_tlb_store_handler(void)
@@ -1559,6 +1552,7 @@ static void __init build_r3000_tlb_store
 	u32 *p = handle_tlbs;
 	struct label *l = labels;
 	struct reloc *r = relocs;
+	int i;
 
 	memset(handle_tlbs, 0, sizeof(handle_tlbs));
 	memset(labels, 0, sizeof(labels));
@@ -1578,17 +1572,14 @@ static void __init build_r3000_tlb_store
 		panic("TLB store handler fastpath space exceeded");
 
 	resolve_relocs(relocs, labels);
-	printk("Synthesized TLB store handler fastpath (%u instructions).\n",
-	       (unsigned int)(p - handle_tlbs));
+	pr_info("Synthesized TLB store handler fastpath (%u instructions).\n",
+		(unsigned int)(p - handle_tlbs));
 
-#ifdef DEBUG_TLB
-	{
-		int i;
-
-		for (i = 0; i < (p - handle_tlbs); i++)
-			printk("%08x\n", handle_tlbs[i]);
-	}
-#endif
+	pr_debug("\t.set push\n");
+	pr_debug("\t.set noreorder\n");
+	for (i = 0; i < (p - handle_tlbs); i++)
+		pr_debug("\t.word 0x%08x\n", handle_tlbs[i]);
+	pr_debug("\t.set pop\n");
 }
 
 static void __init build_r3000_tlb_modify_handler(void)
@@ -1596,6 +1587,7 @@ static void __init build_r3000_tlb_modif
 	u32 *p = handle_tlbm;
 	struct label *l = labels;
 	struct reloc *r = relocs;
+	int i;
 
 	memset(handle_tlbm, 0, sizeof(handle_tlbm));
 	memset(labels, 0, sizeof(labels));
@@ -1615,17 +1607,14 @@ static void __init build_r3000_tlb_modif
 		panic("TLB modify handler fastpath space exceeded");
 
 	resolve_relocs(relocs, labels);
-	printk("Synthesized TLB modify handler fastpath (%u instructions).\n",
-	       (unsigned int)(p - handle_tlbm));
+	pr_info("Synthesized TLB modify handler fastpath (%u instructions).\n",
+		(unsigned int)(p - handle_tlbm));
 
-#ifdef DEBUG_TLB
-	{
-		int i;
-
-		for (i = 0; i < (p - handle_tlbm); i++)
-			printk("%08x\n", handle_tlbm[i]);
-	}
-#endif
+	pr_debug("\t.set push\n");
+	pr_debug("\t.set noreorder\n");
+	for (i = 0; i < (p - handle_tlbm); i++)
+		pr_debug("\t.word 0x%08x\n", handle_tlbm[i]);
+	pr_debug("\t.set pop\n");
 }
 
 /*
@@ -1677,6 +1666,7 @@ static void __init build_r4000_tlb_load_
 	u32 *p = handle_tlbl;
 	struct label *l = labels;
 	struct reloc *r = relocs;
+	int i;
 
 	memset(handle_tlbl, 0, sizeof(handle_tlbl));
 	memset(labels, 0, sizeof(labels));
@@ -1704,17 +1694,14 @@ static void __init build_r4000_tlb_load_
 		panic("TLB load handler fastpath space exceeded");
 
 	resolve_relocs(relocs, labels);
-	printk("Synthesized TLB load handler fastpath (%u instructions).\n",
-	       (unsigned int)(p - handle_tlbl));
-
-#ifdef DEBUG_TLB
-	{
-		int i;
+	pr_info("Synthesized TLB load handler fastpath (%u instructions).\n",
+		(unsigned int)(p - handle_tlbl));
 
-		for (i = 0; i < (p - handle_tlbl); i++)
-			printk("%08x\n", handle_tlbl[i]);
-	}
-#endif
+	pr_debug("\t.set push\n");
+	pr_debug("\t.set noreorder\n");
+	for (i = 0; i < (p - handle_tlbl); i++)
+		pr_debug("\t.word 0x%08x\n", handle_tlbl[i]);
+	pr_debug("\t.set pop\n");
 }
 
 static void __init build_r4000_tlb_store_handler(void)
@@ -1722,6 +1709,7 @@ static void __init build_r4000_tlb_store
 	u32 *p = handle_tlbs;
 	struct label *l = labels;
 	struct reloc *r = relocs;
+	int i;
 
 	memset(handle_tlbs, 0, sizeof(handle_tlbs));
 	memset(labels, 0, sizeof(labels));
@@ -1740,17 +1728,14 @@ static void __init build_r4000_tlb_store
 		panic("TLB store handler fastpath space exceeded");
 
 	resolve_relocs(relocs, labels);
-	printk("Synthesized TLB store handler fastpath (%u instructions).\n",
-	       (unsigned int)(p - handle_tlbs));
-
-#ifdef DEBUG_TLB
-	{
-		int i;
+	pr_info("Synthesized TLB store handler fastpath (%u instructions).\n",
+		(unsigned int)(p - handle_tlbs));
 
-		for (i = 0; i < (p - handle_tlbs); i++)
-			printk("%08x\n", handle_tlbs[i]);
-	}
-#endif
+	pr_debug("\t.set push\n");
+	pr_debug("\t.set noreorder\n");
+	for (i = 0; i < (p - handle_tlbs); i++)
+		pr_debug("\t.word 0x%08x\n", handle_tlbs[i]);
+	pr_debug("\t.set pop\n");
 }
 
 static void __init build_r4000_tlb_modify_handler(void)
@@ -1758,6 +1743,7 @@ static void __init build_r4000_tlb_modif
 	u32 *p = handle_tlbm;
 	struct label *l = labels;
 	struct reloc *r = relocs;
+	int i;
 
 	memset(handle_tlbm, 0, sizeof(handle_tlbm));
 	memset(labels, 0, sizeof(labels));
@@ -1777,17 +1763,14 @@ static void __init build_r4000_tlb_modif
 		panic("TLB modify handler fastpath space exceeded");
 
 	resolve_relocs(relocs, labels);
-	printk("Synthesized TLB modify handler fastpath (%u instructions).\n",
-	       (unsigned int)(p - handle_tlbm));
-
-#ifdef DEBUG_TLB
-	{
-		int i;
-
-		for (i = 0; i < (p - handle_tlbm); i++)
-			printk("%08x\n", handle_tlbm[i]);
-	}
-#endif
+	pr_info("Synthesized TLB modify handler fastpath (%u instructions).\n",
+		(unsigned int)(p - handle_tlbm));
+
+	pr_debug("\t.set push\n");
+	pr_debug("\t.set noreorder\n");
+	for (i = 0; i < (p - handle_tlbm); i++)
+		pr_debug("\t.word 0x%08x\n", handle_tlbm[i]);
+	pr_debug("\t.set pop\n");
 }
 
 void __init build_tlb_refill_handler(void)

From anemo@mba.ocn.ne.jp Sun Jul  9 13:55:38 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 09 Jul 2006 13:55:47 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:6386 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133790AbWGIMzi (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sun, 9 Jul 2006 13:55:38 +0100
Received: from localhost (p7197-ipad202funabasi.chiba.ocn.ne.jp [222.146.78.197])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 905E7A741; Sun,  9 Jul 2006 21:55:33 +0900 (JST)
Date:	Sun, 09 Jul 2006 21:56:51 +0900 (JST)
Message-Id: <20060709.215651.126573568.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: <cda58cb80607080915h59f2fcc0yff605fb4afdf1b8b@mail.gmail.com>
References: <cda58cb80607080739i772d439dqc4e06a8b275e03ee@mail.gmail.com>
	<20060709.010316.126574153.anemo@mba.ocn.ne.jp>
	<cda58cb80607080915h59f2fcc0yff605fb4afdf1b8b@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: 11953
X-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 Sat, 8 Jul 2006 18:15:52 +0200, "Franck Bui-Huu" <vagabon.xyz@gmail.com> wrote:
> well I would say without this patch it should break.
> 
> 'pfn' takes values between 0 and max_mapnr. This range includes memory
> holes, doens't it ? In that case what does
> pfn_to_page(pfn_inside_a_hole) ?

Oh, you are right.  The show_mem() must be fixed indeed.

---
Atsushi Nemoto

From jblache@debian.org Sun Jul  9 14:51:25 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 09 Jul 2006 14:51:35 +0100 (BST)
Received: from frigate.technologeek.org ([62.4.21.148]:15500 "EHLO
	frigate.technologeek.org") by ftp.linux-mips.org with ESMTP
	id S8133513AbWGINvZ (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 9 Jul 2006 14:51:25 +0100
Received: by frigate.technologeek.org (Postfix, from userid 1000)
	id ECF271465D70; Sun,  9 Jul 2006 15:51:26 +0200 (CEST)
From:	Julien BLACHE <jblache@debian.org>
To:	linux-mips@linux-mips.org
Cc:	debian-mips@lists.debian.org
Subject: [PATCH] IP22: fix serial console hangs
Date:	Sun, 09 Jul 2006 15:51:26 +0200
Message-ID: <87irm6naxt.fsf@frigate.technologeek.org>
User-Agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.19 (linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Return-Path: <jblache@debian.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: 11954
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: jblache@debian.org
Precedence: bulk
X-list: linux-mips

--=-=-=

Hi,

The patch below fixes serial console hangs as seen on IP22
machines. Typically, while booting, the machine hangs for ~1 minute
displaying "INIT: ", then the same thing happens again when init
enters in the designated runlevel and finally the getty process on
ttyS0 hangs indefinitely (though strace'ing it helps).

strace (-e raw=ioctl, otherwise the ioctl() translation is utterly
bogus) reveals that getty hangs on ioctl() 0x540f which happens to be
TCSETSW (I saw it hang on another console ioctl() but couldn't
reproduce that one).

A diff between ip22zilog and sunzilog revealed the following
differences:
 1. the channel A flag being set on up.port.flags instead of up.flags
 2. the channel A flag being set on what is marked as being channel B
 3. sunzilog has a call to uart_update_timeout(port, termios->c_cflag, baud);
    at the end of sunzilog_set_termios(), which ip22zilog lacks (on
    purpose ?)

The patch below addresses point 1 and fixes the serial console hangs
just fine. However point 2 should be investigated by someone familiar
with the IP22 Zilog; it's probably OK as is but even if it is, a
comment in ip22zilog.c is badly needed.

Point 3 is left as an exercise for whoever feels like digging into
ip22zilog :)

These are the main obvious differences between ip22zilog and
sunzilog. Newer versions of sunzilog (Linus's git tree as of today)
are more close to ip22zilog as the sbus_{write,read}b have been
changed into simple {write,read}b, which shrinks the diff by a fair
amount. Resyncing both drivers should be doable in a few hours time
now for someone familiar with the IP22 Zilog hardware.


Additional point: the IP22 thinks it's using the console on the
framebuffer when booting, when it's really using the serial console
(console=ttyS passed at boot, console=d, consoleOut=serial(0))


Please apply, along with the RTC typo fix from yesterday.

Thanks,

JB.

---
IP22: fix serial console hang due to a typo in ip22zilog.c

Signed-off-by: Julien BLACHE <jb@jblache.org>


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=ip22zilog-channel-A-flag.patch
Content-Description: fix serial console hangs on IP22

--- source-mips-none/drivers/serial/ip22zilog.c	2006-06-18 03:49:35.000000000 +0200
+++ source/drivers/serial/ip22zilog.c	2006-07-09 14:25:11.847260358 +0200
@@ -1145,9 +1145,8 @@
 		up[(chip * 2) + 1].port.fifosize = 1;
 		up[(chip * 2) + 1].port.ops = &ip22zilog_pops;
 		up[(chip * 2) + 1].port.type = PORT_IP22ZILOG;
-		up[(chip * 2) + 1].port.flags |= IP22ZILOG_FLAG_IS_CHANNEL_A;
 		up[(chip * 2) + 1].port.line = (chip * 2) + 1;
-		up[(chip * 2) + 1].flags = 0;
+		up[(chip * 2) + 1].flags |= IP22ZILOG_FLAG_IS_CHANNEL_A;
 	}
 }
 

--=-=-=



-- 
 Julien BLACHE <jblache@debian.org>  |  Debian, because code matters more 
 Debian & GNU/Linux Developer        |       <http://www.debian.org>
 Public key available on <http://www.jblache.org> - KeyID: F5D6 5169 
 GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169 

--=-=-=--

From kumba@gentoo.org Sun Jul  9 18:39:12 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 09 Jul 2006 18:39:22 +0100 (BST)
Received: from p549F5FD7.dip.t-dialin.net ([84.159.95.215]:9675 "EHLO
	p549F5FD7.dip.t-dialin.net") by ftp.linux-mips.org with ESMTP
	id S8133858AbWGIRjL (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 9 Jul 2006 18:39:11 +0100
Received: from rwcrmhc11.comcast.net ([216.148.227.151]:62143 "EHLO
	rwcrmhc11.comcast.net") by lappi.linux-mips.net with ESMTP
	id S1097688AbWGIRjN (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 9 Jul 2006 19:39:13 +0200
Received: from [127.0.0.1] (unknown[69.140.185.142])
          by comcast.net (rwcrmhc11) with ESMTP
          id <20060709173824m1100i3fnse>; Sun, 9 Jul 2006 17:38:25 +0000
Message-ID: <44B13F02.5020002@gentoo.org>
Date:	Sun, 09 Jul 2006 13:38:10 -0400
From:	Kumba <kumba@gentoo.org>
User-Agent: Thunderbird 1.5.0.4 (Windows/20060516)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
CC:	Julien BLACHE <jblache@debian.org>
Subject: Re: [PATCH] IP22: fix serial console hangs
References: <87irm6naxt.fsf@frigate.technologeek.org>
In-Reply-To: <87irm6naxt.fsf@frigate.technologeek.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <kumba@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: 11955
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: kumba@gentoo.org
Precedence: bulk
X-list: linux-mips

Julien BLACHE wrote:
> Hi,
> 
> The patch below fixes serial console hangs as seen on IP22
> machines. Typically, while booting, the machine hangs for ~1 minute
> displaying "INIT: ", then the same thing happens again when init
> enters in the designated runlevel and finally the getty process on
> ttyS0 hangs indefinitely (though strace'ing it helps).
> 

Out of curiosity, don't suppose you've seen the oops on IP22 that can sometimes 
be triggered by closing the serial client on another box?  Haven't investigated 
it too much, but I've seen the odd case on Indy and IP28 (which also uses the 
zilog driver) where shutting down my serial client or sometimes rebooting the 
system running the client oopses the driver.  I suspect some rogue data gets 
passed that zilog doesn't know how to handle properly.


--Kumba

-- 
Gentoo/MIPS Team Lead
Gentoo Foundation Board of Trustees

"Such is oft the course of deeds that move the wheels of the world: small hands 
do them because they must, while the eyes of the great are elsewhere."  --Elrond

From tbm@cyrius.com Sun Jul  9 18:58:47 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 09 Jul 2006 18:58:58 +0100 (BST)
Received: from sorrow.cyrius.com ([65.19.161.204]:37905 "EHLO
	sorrow.cyrius.com") by ftp.linux-mips.org with ESMTP
	id S8133862AbWGIR6r (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 9 Jul 2006 18:58:47 +0100
Received: by sorrow.cyrius.com (Postfix, from userid 10)
	id E347664D55; Sun,  9 Jul 2006 17:58:39 +0000 (UTC)
Received: by deprecation.cyrius.com (Postfix, from userid 1000)
	id 5A30666E52; Sun,  9 Jul 2006 19:58:41 +0200 (CEST)
Date:	Sun, 9 Jul 2006 19:58:41 +0200
From:	Martin Michlmayr <tbm@cyrius.com>
To:	Julien BLACHE <jblache@debian.org>
Cc:	linux-mips@linux-mips.org, debian-mips@lists.debian.org
Subject: Re: [PATCH] IP22: fix serial console hangs
Message-ID: <20060709175841.GB24958@deprecation.cyrius.com>
References: <87irm6naxt.fsf@frigate.technologeek.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <87irm6naxt.fsf@frigate.technologeek.org>
User-Agent: Mutt/1.5.11+cvs20060403
Return-Path: <tbm@cyrius.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11956
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: tbm@cyrius.com
Precedence: bulk
X-list: linux-mips

* Julien BLACHE <jblache@debian.org> [2006-07-09 15:51]:
> The patch below fixes serial console hangs as seen on IP22
> machines. Typically, while booting, the machine hangs for ~1 minute

Thanks for tracking this down.  You've to send the patch to
rmk+serial@arm.linux.org.uk and linux-serial@vger.kernel.org
though.
-- 
Martin Michlmayr
http://www.cyrius.com/

From jblache@debian.org Sun Jul  9 19:37:20 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 09 Jul 2006 19:37:29 +0100 (BST)
Received: from frigate.technologeek.org ([62.4.21.148]:18633 "EHLO
	frigate.technologeek.org") by ftp.linux-mips.org with ESMTP
	id S8133348AbWGIShU (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 9 Jul 2006 19:37:20 +0100
Received: by frigate.technologeek.org (Postfix, from userid 1000)
	id 8F7461465D70; Sun,  9 Jul 2006 20:37:22 +0200 (CEST)
From:	Julien BLACHE <jblache@debian.org>
To:	Kumba <kumba@gentoo.org>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] IP22: fix serial console hangs
References: <87irm6naxt.fsf@frigate.technologeek.org>
	<44B13F02.5020002@gentoo.org>
Date:	Sun, 09 Jul 2006 20:37:21 +0200
In-Reply-To: <44B13F02.5020002@gentoo.org> (kumba@gentoo.org's message of
	"Sun, 09 Jul 2006 13:38:10 -0400")
Message-ID: <877j2mmxpa.fsf@frigate.technologeek.org>
User-Agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.19 (linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Return-Path: <jblache@debian.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: 11957
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: jblache@debian.org
Precedence: bulk
X-list: linux-mips

Kumba <kumba@gentoo.org> wrote:

Hi,

> Out of curiosity, don't suppose you've seen the oops on IP22 that can
> sometimes be triggered by closing the serial client on another box?

Haven't seen this one, no. I'm using a hardware console on the serial
line most of the time (though I still haven't found the proper
configuration and it's hardly usable for anything advanced making use
of terminal features).

> Haven't investigated it too much, but I've seen the odd case on Indy
> and IP28 (which also uses the zilog driver) where shutting down my
> serial client or sometimes rebooting the system running the client
> oopses the driver.  I suspect some rogue data gets passed that zilog
> doesn't know how to handle properly.

It looks a bit like the serial driver crash on reboot which Martin
Michlmayr fixed a couple of months back by backporting fixes from the
sunzilog driver. But I think this one made its way into the kernel, so
it must be something else.

JB.

-- 
 Julien BLACHE <jblache@debian.org>  |  Debian, because code matters more 
 Debian & GNU/Linux Developer        |       <http://www.debian.org>
 Public key available on <http://www.jblache.org> - KeyID: F5D6 5169 
 GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169 

From jblache@debian.org Sun Jul  9 19:40:41 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 09 Jul 2006 19:40:50 +0100 (BST)
Received: from frigate.technologeek.org ([62.4.21.148]:19913 "EHLO
	frigate.technologeek.org") by ftp.linux-mips.org with ESMTP
	id S8133350AbWGISkl (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 9 Jul 2006 19:40:41 +0100
Received: by frigate.technologeek.org (Postfix, from userid 1000)
	id 1D5DA1465D70; Sun,  9 Jul 2006 20:40:44 +0200 (CEST)
From:	Julien BLACHE <jblache@debian.org>
To:	linux-mips@linux-mips.org
Cc:	debian-mips@lists.debian.org
Subject: Re: [PATCH] IP22: fix serial console hangs
References: <87irm6naxt.fsf@frigate.technologeek.org>
	<20060709175841.GB24958@deprecation.cyrius.com>
Date:	Sun, 09 Jul 2006 20:40:44 +0200
In-Reply-To: <20060709175841.GB24958@deprecation.cyrius.com> (Martin
	Michlmayr's message of "Sun, 9 Jul 2006 19:58:41 +0200")
Message-ID: <87y7v2liz7.fsf@frigate.technologeek.org>
User-Agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.19 (linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Return-Path: <jblache@debian.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: 11958
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: jblache@debian.org
Precedence: bulk
X-list: linux-mips

Martin Michlmayr <tbm@cyrius.com> wrote:

> * Julien BLACHE <jblache@debian.org> [2006-07-09 15:51]:
>> The patch below fixes serial console hangs as seen on IP22
>> machines. Typically, while booting, the machine hangs for ~1 minute
>
> Thanks for tracking this down.  You've to send the patch to
> rmk+serial@arm.linux.org.uk and linux-serial@vger.kernel.org
> though.

Done.

JB.

-- 
 Julien BLACHE <jblache@debian.org>  |  Debian, because code matters more 
 Debian & GNU/Linux Developer        |       <http://www.debian.org>
 Public key available on <http://www.jblache.org> - KeyID: F5D6 5169 
 GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169 

From ralf@linux-mips.org Sun Jul  9 23:46:52 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 09 Jul 2006 23:47:00 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:26319 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S8133495AbWGIWqw (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sun, 9 Jul 2006 23:46:52 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.6/8.13.4) with ESMTP id k69MkvgW020630;
	Sun, 9 Jul 2006 23:46:57 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.6/8.13.6/Submit) id k69MksxT020625;
	Sun, 9 Jul 2006 23:46:54 +0100
Date:	Sun, 9 Jul 2006 23:46:53 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Franck Bui-Huu <vagabon.xyz@gmail.com>
Cc:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>, linux-mips@linux-mips.org
Subject: Re: [PATCH] sparsemem fix
Message-ID: <20060709224653.GA20598@linux-mips.org>
References: <20060705.012244.96686002.anemo@mba.ocn.ne.jp> <44AB79D0.90002@innova-card.com> <20060705.192054.128618288.nemoto@toshiba-tops.co.jp> <20060706173235.GA4739@linux-mips.org> <cda58cb80607080747g66ac4357ya1f2cef89b4d868@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <cda58cb80607080747g66ac4357ya1f2cef89b4d868@mail.gmail.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11959
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Sat, Jul 08, 2006 at 04:47:39PM +0200, Franck Bui-Huu wrote:

> but the code seems to be in arch/mips/sgi-ip27, no ?
> 
> BTW, Ralf, are there any needs for MIPS to support platforms whose
> memory start is not 0 ? I have made a patch for that, and wondering if
> it's worth to post it on the list...

Yes, while it's relativly rare such platforms do exist and they currently
pay the price of wasting some memory for the allocation of unused entries
in mem_map[].

  Ralf

From vagabon.xyz@gmail.com Mon Jul 10 08:47:10 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 10 Jul 2006 08:47:22 +0100 (BST)
Received: from nf-out-0910.google.com ([64.233.182.184]:46428 "EHLO
	nf-out-0910.google.com") by ftp.linux-mips.org with ESMTP
	id S8133398AbWGJHrK (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 10 Jul 2006 08:47:10 +0100
Received: by nf-out-0910.google.com with SMTP id x4so605431nfb
        for <linux-mips@linux-mips.org>; Mon, 10 Jul 2006 00:47:09 -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=aaahY14kVIG/EC77uQ/Zv8QC8kqZK+t5CtaPi+nPtgrFg1c9TR0jpN8ldY+190P8wggtATymo+H9GksY7Y3RrdXsAf7zBmgfsAVP6GWSZ1koKrNQ6z3KMZq9aTtPn0rI7lG/uWOVvzF89MXqq3pJf/Aijk9rjUOLsdePGufKYRs=
Received: by 10.48.1.4 with SMTP id 4mr3500015nfa;
        Mon, 10 Jul 2006 00:47:08 -0700 (PDT)
Received: from ?192.168.0.24? ( [194.3.162.233])
        by mx.gmail.com with ESMTP id x27sm3397448nfb.2006.07.10.00.47.07;
        Mon, 10 Jul 2006 00:47:08 -0700 (PDT)
Message-ID: <44B20723.3070409@innova-card.com>
Date:	Mon, 10 Jul 2006 09:52:03 +0200
Reply-To: Franck <vagabon.xyz@gmail.com>
User-Agent: Thunderbird 1.5.0.2 (X11/20060501)
MIME-Version: 1.0
To:	Ralf Baechle <ralf@linux-mips.org>
CC:	Franck Bui-Huu <vagabon.xyz@gmail.com>,
	Atsushi Nemoto <anemo@mba.ocn.ne.jp>, linux-mips@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> <20060706173235.GA4739@linux-mips.org> <cda58cb80607080747g66ac4357ya1f2cef89b4d868@mail.gmail.com> <20060709224653.GA20598@linux-mips.org>
In-Reply-To: <20060709224653.GA20598@linux-mips.org>
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: 11960
X-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

Ralf Baechle wrote:
> On Sat, Jul 08, 2006 at 04:47:39PM +0200, Franck Bui-Huu wrote:
> 
>> but the code seems to be in arch/mips/sgi-ip27, no ?
>>
>> BTW, Ralf, are there any needs for MIPS to support platforms whose
>> memory start is not 0 ? I have made a patch for that, and wondering if
>> it's worth to post it on the list...
> 
> Yes, while it's relativly rare such platforms do exist and they currently
> pay the price of wasting some memory for the allocation of unused entries
> in mem_map[].
> 

Ok I'll send that this week. I remember to have to replace CPHYSADDR()
macro with __pa() in boot init code still I don't if it's correct.

Can you tell me why we can't always use __pa() ?

Thanks

		Franck

From tglx@linutronix.de Mon Jul 10 10:53:15 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 10 Jul 2006 10:53:24 +0100 (BST)
Received: from www.osadl.org ([213.239.205.134]:54979 "EHLO mail.tglx.de")
	by ftp.linux-mips.org with ESMTP id S8133425AbWGJJxP (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 10 Jul 2006 10:53:15 +0100
Received: from localhost (debian [213.239.205.147])
	by mail.tglx.de (Postfix) with ESMTP id D320465C003;
	Mon, 10 Jul 2006 11:53:13 +0200 (CEST)
Subject: Re: [PATCH] PNX8550 NAND flash driver
From:	Thomas Gleixner <tglx@linutronix.de>
To:	"Vladimir A. Barinov" <vbarinov@ru.mvista.com>
Cc:	Todd Poynor <tpoynor@mvista.com>, linux-mtd@lists.infradead.org,
	linux-mips@linux-mips.org
In-Reply-To: <43F1D439.60205@ru.mvista.com>
References: <43A2F819.1040106@ru.mvista.com> <43C69EC2.2070601@mvista.com>
	 <43F1D439.60205@ru.mvista.com>
Content-Type: text/plain
Organization: linutronix
Date:	Mon, 10 Jul 2006 11:53:16 +0200
Message-Id: <1152525196.30929.11.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 2.6.1 
Content-Transfer-Encoding: 7bit
Return-Path: <tglx@linutronix.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: 11961
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: tglx@linutronix.de
Precedence: bulk
X-list: linux-mips

On Tue, 2006-02-14 at 15:59 +0300, Vladimir A. Barinov wrote:
> >> +    }
> >> +
> >> +    if (((bytes & 3) || (bytes < 16)) || ((u32) to & 3) || ((u32) 
> >> from & 3)) {
> >> +        if (((bytes & 1) == 0) &&
> >> +            (((u32) to & 1) == 0) && (((u32) from & 1) == 0)) {
> >> +            int words = bytes / 2;
> >> +
> >> +            local_irq_disable();
> >> +            for (i = 0; i < words; i++) {
> >> +                to16[i] = from16[i];
> >> +            }
> >> +            local_irq_enable();
> >
> >
> > Really necessary to disable all irqs around this transfer?  How long 
> > can interrupts be off during that time?
> 
> That is needed since the NAND device is binded to the external XIO bus 
> that could be used by another devices.

Err, you have to protect the whole access sequence then. What protects
the chip against access between the command write and data read ?

If this really is a bus conflict problem, then you need some more
protection than this.

Can you please describe in detail why you think this is necessary. 

	tglx





From vagabon.xyz@gmail.com Mon Jul 10 12:34:07 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 10 Jul 2006 12:34:17 +0100 (BST)
Received: from ug-out-1314.google.com ([66.249.92.171]:47543 "EHLO
	ug-out-1314.google.com") by ftp.linux-mips.org with ESMTP
	id S8133442AbWGJLeH (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 10 Jul 2006 12:34:07 +0100
Received: by ug-out-1314.google.com with SMTP id k3so3370314ugf
        for <linux-mips@linux-mips.org>; Mon, 10 Jul 2006 04:34:06 -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=FT+YLWVgz7JWnmJZO7gSkMPQLi8ZZ9lRyKrTDc0BxFa99fb8lqAHQ32hox0clYAcN/Bj7H1hUiC/2ourau3PnPeFvFnnISsS9dqZj+oXeMgPWce28sNeGownSonPErD7i2KFR/ixhxNaMnHY5v/f3hQ2InSNfK8aR2WSUqrvj2I=
Received: by 10.67.26.7 with SMTP id d7mr4937629ugj;
        Mon, 10 Jul 2006 04:34:06 -0700 (PDT)
Received: by 10.67.100.10 with HTTP; Mon, 10 Jul 2006 04:34:06 -0700 (PDT)
Message-ID: <cda58cb80607100434h13831eb7rc6eda13a0d9e373f@mail.gmail.com>
Date:	Mon, 10 Jul 2006 13:34:06 +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:	linux-mips@linux-mips.org, ralf@linux-mips.org
In-Reply-To: <20060707.002602.75184460.anemo@mba.ocn.ne.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <20060706.233634.59465089.anemo@mba.ocn.ne.jp>
	 <44AD2537.1030509@innova-card.com>
	 <cda58cb80607060805yc656114p53516b904188c20f@mail.gmail.com>
	 <20060707.002602.75184460.anemo@mba.ocn.ne.jp>
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: 11962
X-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, Atsushi Nemoto <anemo@mba.ocn.ne.jp>:
>
> Sure.  Then this can be a final proposal?
>

could you put the diffstat next time ?

>
> 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..c52497b 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;
> +#ifndef CONFIG_FLATMEM
> +       unsigned long zholes_size[] = { [0 ... MAX_NR_ZONES - 1] = 0 };
> +       unsigned long i, j, pfn;
> +#endif
>
>         pagetable_init();
>
> @@ -174,29 +200,16 @@ #ifdef CONFIG_HIGHMEM
>                 zones_size[ZONE_HIGHMEM] = high - low;
>  #endif
>
> +#ifdef CONFIG_FLATMEM
>         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;
> +#else
> +       pfn = 0;
> +       for (i = 0; i < MAX_NR_ZONES; i++)
> +               for (j = 0; j < zones_size[i]; j++, pfn++)
> +                       if (!page_is_ram(pfn))

can we use pfn_valid() instead of page_is_ram() ? bootmem_init() and
sparse_init() have already been called so pfn_valid() should be safe
here....

> +                               zholes_size[i]++;
> +       free_area_init_node(0, NODE_DATA(0), zones_size, 0, zholes_size);
> +#endif
>  }
>
>  static struct kcore_list kcore_mem, kcore_vmalloc;
> @@ -213,9 +226,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;

this is not always true, specially if FLATMEM set and your physical mem
do not start at 0.

>  #endif
>         high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT);
>
> @@ -229,6 +242,7 @@ #endif

in this loop can we use pfn_valid() instead of page_is_ram() ? Therefore
we could get rid of the latter macro ?

>                         if (PageReserved(pfn_to_page(tmp)))
>                                 reservedpages++;
>                 }
> +       num_physpages = ram;
>
>  #ifdef CONFIG_HIGHMEM
>         for (tmp = highstart_pfn; tmp < highend_pfn; tmp++) {
> @@ -247,6 +261,7 @@ #endif
>                 totalhigh_pages++;
>         }
>         totalram_pages += totalhigh_pages;
> +       num_physpages += totalhigh_pages;
>  #endif
>
>         codesize =  (unsigned long) &_etext - (unsigned long) &_text;
>

-- 
               Franck

From anemo@mba.ocn.ne.jp Mon Jul 10 15:33:41 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 10 Jul 2006 15:33:50 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:48872 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133454AbWGJOdl (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 10 Jul 2006 15:33:41 +0100
Received: from localhost (p8142-ipad212funabasi.chiba.ocn.ne.jp [58.91.172.142])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 6B9F1A8B5; Mon, 10 Jul 2006 23:33:36 +0900 (JST)
Date:	Mon, 10 Jul 2006 23:34:54 +0900 (JST)
Message-Id: <20060710.233454.39153668.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: <cda58cb80607100434h13831eb7rc6eda13a0d9e373f@mail.gmail.com>
References: <cda58cb80607060805yc656114p53516b904188c20f@mail.gmail.com>
	<20060707.002602.75184460.anemo@mba.ocn.ne.jp>
	<cda58cb80607100434h13831eb7rc6eda13a0d9e373f@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: 11963
X-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 Mon, 10 Jul 2006 13:34:06 +0200, "Franck Bui-Huu" <vagabon.xyz@gmail.com> wrote:
> could you put the diffstat next time ?

Sure.  I'll do it.

> can we use pfn_valid() instead of page_is_ram() ? bootmem_init() and
> sparse_init() have already been called so pfn_valid() should be safe
> here....

We can, but we can get more precise value using page_is_ram().  The
pfn_valid() returns true for _all_ pages on present section, and
currently the section size is 256MB.

> > -       max_mapnr = num_physpages = highend_pfn;
> > +       max_mapnr = highend_pfn;
> >  #else
> > -       max_mapnr = num_physpages = max_low_pfn;
> > +       max_mapnr = max_low_pfn;
> 
> this is not always true, specially if FLATMEM set and your physical mem
> do not start at 0.

Yes, and I think you are preparing a patch for these systems ;-)

---
Atsushi Nemoto

From anemo@mba.ocn.ne.jp Mon Jul 10 15:38:57 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 10 Jul 2006 15:39:09 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:34514 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133864AbWGJOi5 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 10 Jul 2006 15:38:57 +0100
Received: from localhost (p8142-ipad212funabasi.chiba.ocn.ne.jp [58.91.172.142])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 19722B49A; Mon, 10 Jul 2006 23:38:52 +0900 (JST)
Date:	Mon, 10 Jul 2006 23:40:10 +0900 (JST)
Message-Id: <20060710.234010.07457279.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org, macro@linux-mips.org
Subject: Re: [PATCH] fast path for rdhwr emulation for TLS
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <20060709.011259.92587435.anemo@mba.ocn.ne.jp>
References: <20060708.011245.82794581.anemo@mba.ocn.ne.jp>
	<Pine.LNX.4.64N.0607071715360.25285@blysk.ds.pg.gda.pl>
	<20060709.011259.92587435.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: 11964
X-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

Take 2.  Comments (especially from pipeline wizards) are welcome.

Add special short path for emulationg RDHWR which is used to support
TLS.  The handle_tlbl synthesizer takes a care for
cpu_has_vtag_icache.

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

diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index 37fda3d..dfceea9 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -375,6 +375,43 @@ #endif
 	BUILD_HANDLER dsp dsp sti silent		/* #26 */
 	BUILD_HANDLER reserved reserved sti verbose	/* others */
 
+	.align	5
+	LEAF(handle_ri_rdhwr)
+	.set	push
+	.set	noat
+	.set	noreorder
+	/* 0x7c03e83b: rdhwr v1,$29 */
+	MFC0	k1, CP0_EPC
+	lui	k0, 0x7c03
+	lw	k1, (k1)
+	ori	k0, 0xe83b
+	.set	reorder
+	bne	k0, k1, handle_ri	/* if not ours */
+	/* The insn is rdhwr.  No need to check CAUSE.BD here. */
+	get_saved_sp	/* k1 := current_thread_info */
+	.set	noreorder
+	MFC0	k0, CP0_EPC
+#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
+	ori	k1, _THREAD_MASK
+	xori	k1, _THREAD_MASK
+	LONG_L	v1, TI_TP_VALUE(k1)
+	LONG_ADDIU	k0, 4
+	jr	k0
+	 rfe
+#else
+	LONG_ADDIU	k0, 4		/* stall on $k0 */
+	MTC0	k0, CP0_EPC
+	/* I hope three instructions between MTC0 and ERET are enough... */
+	ori	k1, _THREAD_MASK
+	xori	k1, _THREAD_MASK
+	LONG_L	v1, TI_TP_VALUE(k1)
+	.set	mips3
+	eret
+	.set	mips0
+#endif
+	.set	pop
+	END(handle_ri_rdhwr)
+
 #ifdef CONFIG_64BIT
 /* A temporary overflow handler used by check_daddi(). */
 
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 954a198..46eba9f 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -52,6 +52,7 @@ extern asmlinkage void handle_dbe(void);
 extern asmlinkage void handle_sys(void);
 extern asmlinkage void handle_bp(void);
 extern asmlinkage void handle_ri(void);
+extern asmlinkage void handle_ri_rdhwr(void);
 extern asmlinkage void handle_cpu(void);
 extern asmlinkage void handle_ov(void);
 extern asmlinkage void handle_tr(void);
@@ -1381,6 +1382,15 @@ #endif
 	memcpy((void *)(uncached_ebase + offset), addr, size);
 }
 
+int __initdata rdhwr_noopt;
+static int __init set_rdhwr_noopt(char *str)
+{
+	rdhwr_noopt = 1;
+	return 1;
+}
+
+__setup("rdhwr_noopt", set_rdhwr_noopt);
+
 void __init trap_init(void)
 {
 	extern char except_vec3_generic, except_vec3_r4000;
@@ -1460,7 +1470,7 @@ void __init trap_init(void)
 
 	set_except_vector(8, handle_sys);
 	set_except_vector(9, handle_bp);
-	set_except_vector(10, handle_ri);
+	set_except_vector(10, rdhwr_noopt ? handle_ri : handle_ri_rdhwr);
 	set_except_vector(11, handle_cpu);
 	set_except_vector(12, handle_ov);
 	set_except_vector(13, handle_tr);
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 375e099..3f53fa7 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -817,9 +817,10 @@ static __init void __attribute__((unused
  * Write random or indexed TLB entry, and care about the hazards from
  * the preceeding mtc0 and for the following eret.
  */
-enum tlb_write_entry { tlb_random, tlb_indexed };
+enum tlb_write_entry { tlb_random, tlb_indexed, tlb_arbitrary };
 
-static __init void build_tlb_write_entry(u32 **p, struct label **l,
+static __init void build_tlb_write_entry(u32 **p, unsigned int tmp,
+					 struct label **l,
 					 struct reloc **r,
 					 enum tlb_write_entry wmode)
 {
@@ -828,6 +829,11 @@ static __init void build_tlb_write_entry
 	switch (wmode) {
 	case tlb_random: tlbw = i_tlbwr; break;
 	case tlb_indexed: tlbw = i_tlbwi; break;
+	case tlb_arbitrary:
+		/* tmp contains CP0_INDEX.  see build_update_entries(). */
+		/* if tmp <= 0, use tlbwr instead of tlbwi */
+		tlbw = i_tlbwr;
+		break;
 	}
 
 	switch (current_cpu_data.cputype) {
@@ -841,6 +847,10 @@ static __init void build_tlb_write_entry
 		 * This branch uses up a mtc0 hazard nop slot and saves
 		 * two nops after the tlbw instruction.
 		 */
+		if (wmode == tlb_arbitrary) {
+			il_bgezl(p, r, tmp, label_tlbw_hazard);
+			i_tlbwi(p);
+		}
 		il_bgezl(p, r, 0, label_tlbw_hazard);
 		tlbw(p);
 		l_tlbw_hazard(l, *p);
@@ -851,8 +861,13 @@ static __init void build_tlb_write_entry
 	case CPU_R4700:
 	case CPU_R5000:
 	case CPU_R5000A:
-		i_nop(p);
+		if (wmode == tlb_arbitrary) {
+			il_bgezl(p, r, tmp, label_tlbw_hazard);
+			i_tlbwi(p);
+		} else
+			i_nop(p);
 		tlbw(p);
+		l_tlbw_hazard(l, *p);
 		i_nop(p);
 		break;
 
@@ -865,8 +880,13 @@ static __init void build_tlb_write_entry
 	case CPU_AU1550:
 	case CPU_AU1200:
 	case CPU_PR4450:
-		i_nop(p);
+		if (wmode == tlb_arbitrary) {
+			il_bgezl(p, r, tmp, label_tlbw_hazard);
+			i_tlbwi(p);
+		} else
+			i_nop(p);
 		tlbw(p);
+		l_tlbw_hazard(l, *p);
 		break;
 
 	case CPU_R10000:
@@ -878,15 +898,24 @@ static __init void build_tlb_write_entry
 	case CPU_4KSC:
 	case CPU_20KC:
 	case CPU_25KF:
+		if (wmode == tlb_arbitrary) {
+			il_bgezl(p, r, tmp, label_tlbw_hazard);
+			i_tlbwi(p);
+		}
 		tlbw(p);
+		l_tlbw_hazard(l, *p);
 		break;
 
 	case CPU_NEVADA:
-		i_nop(p); /* QED specifies 2 nops hazard */
 		/*
 		 * This branch uses up a mtc0 hazard nop slot and saves
 		 * a nop after the tlbw instruction.
 		 */
+		if (wmode == tlb_arbitrary) {
+			il_bgezl(p, r, tmp, label_tlbw_hazard);
+			i_tlbwi(p);
+		} else
+			i_nop(p); /* QED specifies 2 nops hazard */
 		il_bgezl(p, r, 0, label_tlbw_hazard);
 		tlbw(p);
 		l_tlbw_hazard(l, *p);
@@ -896,8 +925,13 @@ static __init void build_tlb_write_entry
 		i_nop(p);
 		i_nop(p);
 		i_nop(p);
-		i_nop(p);
+		if (wmode == tlb_arbitrary) {
+			il_bgezl(p, r, tmp, label_tlbw_hazard);
+			i_tlbwi(p);
+		} else
+			i_nop(p);
 		tlbw(p);
+		l_tlbw_hazard(l, *p);
 		break;
 
 	case CPU_4KEC:
@@ -905,7 +939,12 @@ static __init void build_tlb_write_entry
 	case CPU_34K:
 	case CPU_74K:
 		i_ehb(p);
+		if (wmode == tlb_arbitrary) {
+			il_bgezl(p, r, tmp, label_tlbw_hazard);
+			i_tlbwi(p);
+		}
 		tlbw(p);
+		l_tlbw_hazard(l, *p);
 		break;
 
 	case CPU_RM9000:
@@ -918,8 +957,13 @@ static __init void build_tlb_write_entry
 		i_ssnop(p);
 		i_ssnop(p);
 		i_ssnop(p);
-		i_ssnop(p);
+		if (wmode == tlb_arbitrary) {
+			il_bgezl(p, r, tmp, label_tlbw_hazard);
+			i_tlbwi(p);
+		} else
+			i_ssnop(p);
 		tlbw(p);
+		l_tlbw_hazard(l, *p);
 		i_ssnop(p);
 		i_ssnop(p);
 		i_ssnop(p);
@@ -932,8 +976,13 @@ static __init void build_tlb_write_entry
 	case CPU_VR4181:
 	case CPU_VR4181A:
 		i_nop(p);
-		i_nop(p);
+		if (wmode == tlb_arbitrary) {
+			il_bgezl(p, r, tmp, label_tlbw_hazard);
+			i_tlbwi(p);
+		} else
+			i_nop(p);
 		tlbw(p);
+		l_tlbw_hazard(l, *p);
 		i_nop(p);
 		i_nop(p);
 		break;
@@ -942,8 +991,13 @@ static __init void build_tlb_write_entry
 	case CPU_VR4133:
 	case CPU_R5432:
 		i_nop(p);
-		i_nop(p);
+		if (wmode == tlb_arbitrary) {
+			il_bgezl(p, r, tmp, label_tlbw_hazard);
+			i_tlbwi(p);
+		} else
+			i_nop(p);
 		tlbw(p);
+		l_tlbw_hazard(l, *p);
 		break;
 
 	default:
@@ -1123,7 +1177,7 @@ static __init void build_get_ptep(u32 **
 }
 
 static __init void build_update_entries(u32 **p, unsigned int tmp,
-					unsigned int ptep)
+					unsigned int ptep, int loadindex)
 {
 	/*
 	 * 64bit address support (36bit on a 32bit CPU) in a 32bit
@@ -1136,6 +1190,8 @@ #ifdef CONFIG_64BIT_PHYS_ADDR
 		i_dsrl(p, tmp, tmp, 6); /* convert to entrylo0 */
 		i_mtc0(p, tmp, C0_ENTRYLO0); /* load it */
 		i_dsrl(p, ptep, ptep, 6); /* convert to entrylo1 */
+		if (loadindex)
+			i_mfc0(p, tmp, C0_INDEX); /* used by tlb_arbitrary */
 		i_mtc0(p, ptep, C0_ENTRYLO1); /* load it */
 	} else {
 		int pte_off_even = sizeof(pte_t) / 2;
@@ -1145,6 +1201,8 @@ #ifdef CONFIG_64BIT_PHYS_ADDR
 		i_lw(p, tmp, pte_off_even, ptep); /* get even pte */
 		i_mtc0(p, tmp, C0_ENTRYLO0); /* load it */
 		i_lw(p, ptep, pte_off_odd, ptep); /* get odd pte */
+		if (loadindex)
+			i_mfc0(p, tmp, C0_INDEX); /* used by tlb_arbitrary */
 		i_mtc0(p, ptep, C0_ENTRYLO1); /* load it */
 	}
 #else
@@ -1157,8 +1215,8 @@ #else
 		i_mtc0(p, 0, C0_ENTRYLO0);
 	i_mtc0(p, tmp, C0_ENTRYLO0); /* load it */
 	i_SRL(p, ptep, ptep, 6); /* convert to entrylo1 */
-	if (r45k_bvahwbug())
-		i_mfc0(p, tmp, C0_INDEX);
+	if (r45k_bvahwbug() || loadindex)
+		i_mfc0(p, tmp, C0_INDEX); /* used by tlb_arbitrary */
 	if (r4k_250MHZhwbug())
 		i_mtc0(p, 0, C0_ENTRYLO1);
 	i_mtc0(p, ptep, C0_ENTRYLO1); /* load it */
@@ -1198,8 +1256,8 @@ #else
 #endif
 
 	build_get_ptep(&p, K0, K1);
-	build_update_entries(&p, K0, K1);
-	build_tlb_write_entry(&p, &l, &r, tlb_random);
+	build_update_entries(&p, K0, K1, 0);
+	build_tlb_write_entry(&p, K0, &l, &r, tlb_random);
 	l_leave(&l, p);
 	i_eret(&p); /* return from trap */
 
@@ -1647,12 +1705,13 @@ # endif
 static void __init
 build_r4000_tlbchange_handler_tail(u32 **p, struct label **l,
 				   struct reloc **r, unsigned int tmp,
-				   unsigned int ptr)
+				   unsigned int ptr,
+				   enum tlb_write_entry wmode)
 {
 	i_ori(p, ptr, ptr, sizeof(pte_t));
 	i_xori(p, ptr, ptr, sizeof(pte_t));
-	build_update_entries(p, tmp, ptr);
-	build_tlb_write_entry(p, l, r, tlb_indexed);
+	build_update_entries(p, tmp, ptr, wmode == tlb_arbitrary);
+	build_tlb_write_entry(p, tmp, l, r, wmode);
 	l_leave(l, *p);
 	i_eret(p); /* return from trap */
 
@@ -1667,6 +1726,9 @@ static void __init build_r4000_tlb_load_
 	struct label *l = labels;
 	struct reloc *r = relocs;
 	int i;
+ 	extern int rdhwr_noopt;
+ 	enum tlb_write_entry wmode = (!rdhwr_noopt && cpu_has_vtag_icache) ?
+		tlb_arbitrary : tlb_indexed;
 
 	memset(handle_tlbl, 0, sizeof(handle_tlbl));
 	memset(labels, 0, sizeof(labels));
@@ -1684,7 +1746,7 @@ static void __init build_r4000_tlb_load_
 	build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1);
 	build_pte_present(&p, &l, &r, K0, K1, label_nopage_tlbl);
 	build_make_valid(&p, &r, K0, K1);
-	build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1);
+	build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1, wmode);
 
 	l_nopage_tlbl(&l, p);
 	i_j(&p, (unsigned long)tlb_do_page_fault_0 & 0x0fffffff);
@@ -1718,7 +1780,7 @@ static void __init build_r4000_tlb_store
 	build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1);
 	build_pte_writable(&p, &l, &r, K0, K1, label_nopage_tlbs);
 	build_make_write(&p, &r, K0, K1);
-	build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1);
+	build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1, tlb_indexed);
 
 	l_nopage_tlbs(&l, p);
 	i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff);
@@ -1753,7 +1815,7 @@ static void __init build_r4000_tlb_modif
 	build_pte_modifiable(&p, &l, &r, K0, K1, label_nopage_tlbm);
 	/* Present and writable bits set, set accessed and dirty bits. */
 	build_make_write(&p, &r, K0, K1);
-	build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1);
+	build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1, tlb_indexed);
 
 	l_nopage_tlbm(&l, p);
 	i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff);

From anemo@mba.ocn.ne.jp Mon Jul 10 15:54:39 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 10 Jul 2006 15:54:50 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:43714 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133454AbWGJOyj (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 10 Jul 2006 15:54:39 +0100
Received: from localhost (p8142-ipad212funabasi.chiba.ocn.ne.jp [58.91.172.142])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 45664A725; Mon, 10 Jul 2006 23:54:35 +0900 (JST)
Date:	Mon, 10 Jul 2006 23:55:53 +0900 (JST)
Message-Id: <20060710.235553.48797818.anemo@mba.ocn.ne.jp>
To:	macro@linux-mips.org
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] fast path for rdhwr emulation for TLS
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <Pine.LNX.4.64N.0607071715360.25285@blysk.ds.pg.gda.pl>
References: <Pine.LNX.4.64N.0607071607520.25285@blysk.ds.pg.gda.pl>
	<20060708.011245.82794581.anemo@mba.ocn.ne.jp>
	<Pine.LNX.4.64N.0607071715360.25285@blysk.ds.pg.gda.pl>
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: 11965
X-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 Fri, 7 Jul 2006 17:58:44 +0100 (BST), "Maciej W. Rozycki" <macro@linux-mips.org> wrote:
> 	mfc0	k0, CP0_CAUSE
> 	MFC0	k1, CP0_EPC
> 	bltz	k0, handle_ri_slow	/* if delay slot */
> 	 lui	k0, 0x7c03

I noticed that checking for CP0_CAUSE.BD is unneeded, since we are
checking the instruction code anyway and "rdhwr" does not have a delay
slot.  I removed the checking on the "take 2" patch I just sent.

---
Atsushi Nemoto

From craigslist@willmert.com Mon Jul 10 18:45:54 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 10 Jul 2006 18:46:03 +0100 (BST)
Received: from imf22aec.mail.bellsouth.net ([205.152.59.70]:12494 "EHLO
	imf22aec.mail.bellsouth.net") by ftp.linux-mips.org with ESMTP
	id S8133875AbWGJRpy (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 10 Jul 2006 18:45:54 +0100
Received: from ibm67aec.bellsouth.net ([74.236.202.48])
          by imf22aec.mail.bellsouth.net with ESMTP
          id <20060710174548.SFPI13979.imf22aec.mail.bellsouth.net@ibm67aec.bellsouth.net>
          for <linux-mips@linux-mips.org>; Mon, 10 Jul 2006 13:45:48 -0400
Received: from [192.168.1.96] (really [74.236.202.48])
          by ibm67aec.bellsouth.net with ESMTP
          id <20060710174548.RVBY16552.ibm67aec.bellsouth.net@[192.168.1.96]>
          for <linux-mips@linux-mips.org>; Mon, 10 Jul 2006 13:45:48 -0400
Mime-Version: 1.0 (Apple Message framework v750)
Content-Transfer-Encoding: 7bit
Message-Id: <4E35E8AD-C3ED-47AE-A738-97B7F08D946C@willmert.com>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
To:	linux-mips@linux-mips.org
From:	craigslist <craigslist@willmert.com>
Subject: PCMCIA Help - AU1000 Alchemy Dev Board
Date:	Mon, 10 Jul 2006 13:45:24 -0400
X-Mailer: Apple Mail (2.750)
Return-Path: <craigslist@willmert.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: 11966
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: craigslist@willmert.com
Precedence: bulk
X-list: linux-mips

Hi all,

I'm working on a project with linux 2.6.10 on the AMD au1000 alchemy  
board. I'm attempting to get the pcmcia socket working with a  
wireless network card using the madwifi drivers. I have the 2.6.10  
kernel built for the au1000 dev board and the filesystem, etc.  
However, I'm having difficulties getting the PCMCIA socket to work  
correctly.

At this point, i'm just working with the au1x00_ss module trying to  
get it to recognize a card insert into socket 0 of the au1000 dev  
board. Through debugging, I've noticed that the board_status register  
at 0XAE000004, bit 4, is not changing whether a card is inserted or  
not. It's my understanding that the first step to getting this  
working is detecting the presence of a card, however, I am apparently  
missing some detail as that register value never changes.

Does anyone have experience with this? Has anyone gotten the pcmcia  
sockets working on the au1000 in 2.6?

Any suggestions would be greatly appreciated.


Thanks

Stefan Willmert

From manoje@broadcom.com Tue Jul 11 00:00:35 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 11 Jul 2006 00:00:45 +0100 (BST)
Received: from mms3.broadcom.com ([216.31.210.19]:51470 "EHLO
	MMS3.broadcom.com") by ftp.linux-mips.org with ESMTP
	id S8133816AbWGJXAf (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 11 Jul 2006 00:00:35 +0100
Received: from 10.10.64.154 by MMS3.broadcom.com with ESMTP (Broadcom
 SMTP Relay (Email Firewall v6.2.0)); Mon, 10 Jul 2006 16:00:16 -0700
X-Server-Uuid: B238DE4C-2139-4D32-96A8-DD564EF2313E
Received: by mail-irva-10.broadcom.com (Postfix, from userid 47) id
 9224D2B0; Mon, 10 Jul 2006 16:00:16 -0700 (PDT)
Received: from mail-irva-8.broadcom.com (mail-irva-8 [10.10.64.221]) by
 mail-irva-10.broadcom.com (Postfix) with ESMTP id 6DA1B2AF; Mon, 10 Jul
 2006 16:00:16 -0700 (PDT)
Received: from mail-sj1-12.sj.broadcom.com (mail-sj1-12.sj.broadcom.com
 [10.16.128.215]) by mail-irva-8.broadcom.com (MOS 3.7.5a-GA) with ESMTP
 id DYL90946; Mon, 10 Jul 2006 16:00:15 -0700 (PDT)
Received: from NT-SJCA-0751.brcm.ad.broadcom.com (nt-sjca-0751
 [10.16.192.221]) by mail-sj1-12.sj.broadcom.com (Postfix) with ESMTP id
 6B95420502; Mon, 10 Jul 2006 16:00:15 -0700 (PDT)
Received: from NT-SJCA-0752.brcm.ad.broadcom.com ([10.16.192.222]) by
 NT-SJCA-0751.brcm.ad.broadcom.com with Microsoft
 SMTPSVC(6.0.3790.1830); Mon, 10 Jul 2006 16:00:15 -0700
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Subject: [PATCH] update sb1250-swarm-defconfig
Date:	Mon, 10 Jul 2006 16:00:12 -0700
Message-ID: <710F16C36810444CA2F5821E5EAB7F230675D0@NT-SJCA-0752.brcm.ad.broadcom.com>
Thread-Topic: [PATCH] update sb1250-swarm-defconfig
Thread-Index: AcakdJmLnbao0lI4QU641ETr8/MmgQ==
From:	"Manoj Ekbote" <manoje@broadcom.com>
To:	linux-mips@linux-mips.org
cc:	ralf@linux-mips.org
X-OriginalArrivalTime: 10 Jul 2006 23:00:15.0346 (UTC)
 FILETIME=[9B30B520:01C6A474]
X-TMWD-Spam-Summary: SEV=1.1; DFV=A2006071013; IFV=2.0.6,4.0-7;
 RPD=4.00.0004;
 RPDID=303030312E30413039303230362E34344232443942452E303032442D412D;
 ENG=IBF; TS=20060710230018; CAT=NONE; CON=NONE;
X-MMS-Spam-Filter-ID: A2006071013_4.00.0004_2.0.6,4.0-7
X-WSS-ID: 68AC038A1OO4149131-01-01
Content-Type: multipart/alternative;
 boundary="----_=_NextPart_001_01C6A474.9B081E80"
Return-Path: <manoje@broadcom.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11967
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: manoje@broadcom.com
Precedence: bulk
X-list: linux-mips

This is a multi-part message in MIME format.

------_=_NextPart_001_01C6A474.9B081E80
Content-Type: text/plain;
 charset=us-ascii
Content-Transfer-Encoding: quoted-printable

Hi,

 This patch updates sb1250-swarm-defconfig file to default to Sibyte Bn
silicon as the PASS_1 processors are very old.

=20
--- a/arch/mips/configs/sb1250-swarm_defconfig=20
+++ b/arch/mips/configs/sb1250-swarm_defconfig=20
@@ -66,9 +66,9 @@
 # CONFIG_TOSHIBA_RBTX4938 is not set
 CONFIG_SIBYTE_SB1250=3Dy
 CONFIG_SIBYTE_SB1xxx_SOC=3Dy
-CONFIG_CPU_SB1_PASS_1=3Dy
+# CONFIG_CPU_SB1_PASS_1 is not set
 # CONFIG_CPU_SB1_PASS_2_1250 is not set
-# CONFIG_CPU_SB1_PASS_2_2 is not set
+CONFIG_CPU_SB1_PASS_2_2=3Dy
 # CONFIG_CPU_SB1_PASS_4 is not set
 # CONFIG_CPU_SB1_PASS_2_112x is not set
 # CONFIG_CPU_SB1_PASS_3 is not set
=20
=20
-manoj
=20

------_=_NextPart_001_01C6A474.9B081E80
Content-Type: text/html;
 charset=us-ascii
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2900.2873" name=3DGENERATOR></HEAD>
<BODY>
<DIV align=3Dleft><FONT face=3DArial size=3D2>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi,<?xml:namespace prefix =
=3D o ns =3D=20
"urn:schemas-microsoft-com:office:office" =
/><o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><o:p>&nbsp;</o:p></SPAN></FONT><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">This&nbsp;<SPAN=20
class=3D095542718-10072006>patch&nbsp;u</SPAN>pdate<SPAN=20
class=3D095542718-10072006>s</SPAN> sb1250-swarm-defconfig&nbsp;<SPAN=20
class=3D095542718-10072006>file </SPAN>to default to&nbsp;<SPAN=20
class=3D095542718-10072006>Sibyte </SPAN>Bn silicon<SPAN =
class=3D095542718-10072006>=20
as the PASS_1 processors are very old.</SPAN></SPAN></P></FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT face=3D"Arial Unicode MS" size=3D2>---=20
a/arch/mips/configs/sb1250-swarm_defconfig&nbsp;<BR>+++=20
b/arch/mips/configs/sb1250-swarm_defconfig&nbsp;</FONT></DIV><FONT=20
face=3D"Arial Unicode MS"></FONT><FONT face=3D"Arial Unicode MS">
<DIV align=3Dleft><FONT size=3D2>@@ -66,9 +66,9 @@<BR>&nbsp;#=20
CONFIG_TOSHIBA_RBTX4938 is not=20
set<BR>&nbsp;CONFIG_SIBYTE_SB1250=3Dy<BR>&nbsp;CONFIG_SIBYTE_SB1xxx_SOC=3D=
y<BR>-CONFIG_CPU_SB1_PASS_1=3Dy<BR>+#=20
CONFIG_CPU_SB1_PASS_1 is not set<BR>&nbsp;# CONFIG_CPU_SB1_PASS_2_1250 =
is not=20
set<BR>-# CONFIG_CPU_SB1_PASS_2_2 is not=20
set<BR>+CONFIG_CPU_SB1_PASS_2_2=3Dy<BR>&nbsp;# CONFIG_CPU_SB1_PASS_4 is =
not=20
set<BR>&nbsp;# CONFIG_CPU_SB1_PASS_2_112x is not set<BR>&nbsp;#=20
CONFIG_CPU_SB1_PASS_3 is not set</FONT></DIV>
<DIV align=3Dleft><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV align=3Dleft></FONT><FONT face=3DArial size=3D2>-m<SPAN=20
class=3D496534422-10072006>a</SPAN>noj</FONT></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------_=_NextPart_001_01C6A474.9B081E80--


From mrv@corecom.co.kr Tue Jul 11 02:22:10 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 11 Jul 2006 02:22:18 +0100 (BST)
Received: from [220.76.242.187] ([220.76.242.187]:16269 "EHLO
	localhost.localdomain") by ftp.linux-mips.org with ESMTP
	id S8133892AbWGKBWK (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 11 Jul 2006 02:22:10 +0100
Received: from mrv ([192.168.11.157])
	by localhost.localdomain (8.12.8/8.12.8) with SMTP id k6B1NhiU020256
	for <linux-mips@linux-mips.org>; Tue, 11 Jul 2006 10:23:46 +0900
Message-ID: <000901c6a488$6f7e1800$9d0ba8c0@mrv>
From:	"Roman Mashak" <mrv@corecom.co.kr>
To:	<linux-mips@linux-mips.org>
Subject: SHT_REL bad size
Date:	Tue, 11 Jul 2006 10:22:11 +0900
MIME-Version: 1.0
Content-Type: text/plain;
	format=flowed;
	charset="windows-1251";
	reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
FL-Build: Fidolook 2002 (SL) 6.0.2800.86 - 14/6/2003 22:16:25
Return-Path: <mrv@corecom.co.kr>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11968
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: mrv@corecom.co.kr
Precedence: bulk
X-list: linux-mips

Hello,

I'm trying to compile application for MIPS 4km (designed by "Cavium"). Here 
is the command line:

Compiling main.cpp
mips-g++ -c -Wall -D_GNU_SOURCE -mips32 -mtune=4kc  main.cpp -o main.o
Compiling cmd.cpp
mips-g++ -c -Wall -D_GNU_SOURCE -mips32 -mtune=4kc  cmdProc.cpp -o cmdProc.o
Linking binkd
mips-g++ main.o cmd.o ../lnkep.c ../lib/libapi.a  -o binkd

Compilation is fine, but on target I ran into error launching the program:

#./binkd
SHT_REL bad size=0
./binkd cannot execute

Seems like the problem with linker?

Appreciate any hints, thank you.

With best regards, Roman Mashak.  E-mail: mrv@corecom.co.kr 



From drow@nevyn.them.org Tue Jul 11 03:53:45 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 11 Jul 2006 03:53:54 +0100 (BST)
Received: from nevyn.them.org ([66.93.172.17]:50092 "EHLO nevyn.them.org")
	by ftp.linux-mips.org with ESMTP id S8133905AbWGKCxp (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 11 Jul 2006 03:53:45 +0100
Received: from drow by nevyn.them.org with local (Exim 4.54)
	id 1G08Na-0001nx-Hr; Mon, 10 Jul 2006 22:53:42 -0400
Date:	Mon, 10 Jul 2006 22:53:42 -0400
From:	Daniel Jacobowitz <dan@debian.org>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	macro@linux-mips.org, linux-mips@linux-mips.org,
	ralf@linux-mips.org
Subject: Re: [PATCH] fast path for rdhwr emulation for TLS
Message-ID: <20060711025342.GA6898@nevyn.them.org>
References: <Pine.LNX.4.64N.0607071607520.25285@blysk.ds.pg.gda.pl> <20060708.011245.82794581.anemo@mba.ocn.ne.jp> <Pine.LNX.4.64N.0607071715360.25285@blysk.ds.pg.gda.pl> <20060710.235553.48797818.anemo@mba.ocn.ne.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060710.235553.48797818.anemo@mba.ocn.ne.jp>
User-Agent: Mutt/1.5.11+cvs20060403
Return-Path: <drow@nevyn.them.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11969
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dan@debian.org
Precedence: bulk
X-list: linux-mips

On Mon, Jul 10, 2006 at 11:55:53PM +0900, Atsushi Nemoto wrote:
> On Fri, 7 Jul 2006 17:58:44 +0100 (BST), "Maciej W. Rozycki" <macro@linux-mips.org> wrote:
> > 	mfc0	k0, CP0_CAUSE
> > 	MFC0	k1, CP0_EPC
> > 	bltz	k0, handle_ri_slow	/* if delay slot */
> > 	 lui	k0, 0x7c03
> 
> I noticed that checking for CP0_CAUSE.BD is unneeded, since we are
> checking the instruction code anyway and "rdhwr" does not have a delay
> slot.  I removed the checking on the "take 2" patch I just sent.

Isn't BD "this instruction is in a delay slot", not "this instruction
has a delay slot"?  It affects where we go when we return.

BTW, if the fast emulation can't handle rdhwr in a delay slot, please
report a bug on GCC asking it not to put rdhwr in delay slots by
default.  It's probably worthwhile.

-- 
Daniel Jacobowitz
CodeSourcery

From anemo@mba.ocn.ne.jp Tue Jul 11 04:20:28 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 11 Jul 2006 04:20:37 +0100 (BST)
Received: from topsns2.toshiba-tops.co.jp ([202.230.225.126]:28841 "EHLO
	topsns2.toshiba-tops.co.jp") by ftp.linux-mips.org with ESMTP
	id S8126484AbWGKDU2 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 11 Jul 2006 04:20:28 +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; Tue, 11 Jul 2006 12:20:25 +0900
Received: from topsms.toshiba-tops.co.jp (localhost.localdomain [127.0.0.1])
	by localhost.toshiba-tops.co.jp (Postfix) with ESMTP id 608FC203F1;
	Tue, 11 Jul 2006 12:20:15 +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 53E7D203E9;
	Tue, 11 Jul 2006 12:20:15 +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 k6B3KEW0022064;
	Tue, 11 Jul 2006 12:20:14 +0900 (JST)
	(envelope-from anemo@mba.ocn.ne.jp)
Date:	Tue, 11 Jul 2006 12:20:14 +0900 (JST)
Message-Id: <20060711.122014.52129937.nemoto@toshiba-tops.co.jp>
To:	dan@debian.org
Cc:	macro@linux-mips.org, linux-mips@linux-mips.org,
	ralf@linux-mips.org
Subject: Re: [PATCH] fast path for rdhwr emulation for TLS
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <20060711025342.GA6898@nevyn.them.org>
References: <Pine.LNX.4.64N.0607071715360.25285@blysk.ds.pg.gda.pl>
	<20060710.235553.48797818.anemo@mba.ocn.ne.jp>
	<20060711025342.GA6898@nevyn.them.org>
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: 11970
X-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 Mon, 10 Jul 2006 22:53:42 -0400, Daniel Jacobowitz <dan@debian.org> wrote:
> > I noticed that checking for CP0_CAUSE.BD is unneeded, since we are
> > checking the instruction code anyway and "rdhwr" does not have a delay
> > slot.  I removed the checking on the "take 2" patch I just sent.
> 
> Isn't BD "this instruction is in a delay slot", not "this instruction
> has a delay slot"?  It affects where we go when we return.
 
Well, the BD means "the exception occurred on a delay slot of this
(which EPC points) instruction".  If rdhwr was in a delay slot, EPC
points the preceding jump/branch instruction.  This fast path is
reading a instruction at the EPC (regardless BD), so it must not be
"rdhwr" and fall back to slow path.

> BTW, if the fast emulation can't handle rdhwr in a delay slot, please
> report a bug on GCC asking it not to put rdhwr in delay slots by
> default.  It's probably worthwhile.

If rdhwr was on a delay slot, the slow emulation will be more slower.
So I think rdhwr should not be put on delay slot anyway regardless
fast emulation.

I asked on GCC bugzilla a few days ago but can not got feedback yet.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28126

---
Atsushi Nemoto

From Eckhardt@satorlaser.com Tue Jul 11 09:14:29 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 11 Jul 2006 09:14:39 +0100 (BST)
Received: from mail.domino-uk.com ([193.131.116.193]:35847 "EHLO
	vMimePS1.domino-printing.com") by ftp.linux-mips.org with ESMTP
	id S8133396AbWGKIO3 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 11 Jul 2006 09:14:29 +0100
Received: from emea-exchange3.emea.dps.local (EMEA-EXCHANGE3) by 
    vMimePS1.domino-printing.com (Clearswift SMTPRS 5.2.3) with ESMTP id 
    <T79690e3921c18374c12698@vMimePS1.domino-printing.com> for 
    <linux-mips@linux-mips.org>; Tue, 11 Jul 2006 08:13:02 +0100
Received: from tuxator2.emea.dps.local ([192.168.55.75]) by 
    emea-exchange3.emea.dps.local with Microsoft SMTPSVC(6.0.3790.1830); 
    Tue, 11 Jul 2006 10:14:22 +0200
From:	Ulrich Eckhardt <eckhardt@satorlaser.com>
Organization: Sator Laser GmbH
To:	linux-mips@linux-mips.org
Subject: Re: PCMCIA Help - AU1000 Alchemy Dev Board
Date:	Tue, 11 Jul 2006 10:14:21 +0200
User-Agent: KMail/1.9.1
References: <4E35E8AD-C3ED-47AE-A738-97B7F08D946C@willmert.com>
In-Reply-To: <4E35E8AD-C3ED-47AE-A738-97B7F08D946C@willmert.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200607111014.21617.eckhardt@satorlaser.com>
X-OriginalArrivalTime: 11 Jul 2006 08:14:22.0163 (UTC) 
    FILETIME=[03D66230:01C6A4C2]
Return-Path: <Eckhardt@satorlaser.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: 11971
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: eckhardt@satorlaser.com
Precedence: bulk
X-list: linux-mips

On Monday 10 July 2006 19:45, craigslist wrote:
> I'm working on a project with linux 2.6.10 on the AMD au1000 alchemy
> board. 

I think there are two boards, called Db1000 and Pb1000. It is the processor 
that is called Au1000. You first need to make sure which one you have.

> I'm attempting to get the pcmcia socket working with a 
> wireless network card using the madwifi drivers. I have the 2.6.10
> kernel built for the au1000 dev board and the filesystem, etc.
> However, I'm having difficulties getting the PCMCIA socket to work
> correctly.
>
> At this point, i'm just working with the au1x00_ss module trying to
> get it to recognize a card insert into socket 0 of the au1000 dev
> board. Through debugging, I've noticed that the board_status register
> at 0XAE000004, bit 4, is not changing whether a card is inserted or
> not. It's my understanding that the first step to getting this
> working is detecting the presence of a card, however, I am apparently
> missing some detail as that register value never changes.
>
> Does anyone have experience with this? Has anyone gotten the pcmcia
> sockets working on the au1000 in 2.6?

I haven't worked with the Au1000 but the Au1100 on a custom board, and from 
there I have the following steps in mind:

1. The system-busses are used for multiple purposes, so the first thing to do 
is to configure the right bus for PCMCIA access (processor-specific).
2. You need to switch on power to the PCMCIA slot. There is no standard way to 
do that, as it depends on the board. On my board I had to read the layout to 
find the transistors used to switch the voltage, it was via some GPIO pins. 
These then also have to be properly configured (use a voltmeter to check 
power is present). Also mind that these are sometimes low-active or inverted 
along the lines - this caused confusion for me quite some times.
You should then also be able to detect that the card is present and such 
things. I don't remember, but I think some of those did not go through GPIO 
so these should have fixed connections valid for all boards.
3. You need to map the PCMCIA memory ranges into virtual memory. This is again 
only processor-specific, see the documentation.

Note that only the processor-specific part should be done by the au1x00_ss 
driver, though I wouldn't be surprised to find some board-specific parts 
there, too. It's not always easy to cleanly separate things.

Good luck!

Uli


****************************************************
Visit our website at <http://www.domino-printing.com/>
****************************************************
This Email and any files transmitted with it are intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any reading, redistribution, disclosure or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.  If you are not the intended recipient please contact the sender immediately and delete the material from your computer.

E-mail may be susceptible to data corruption, interception, viruses and unauthorised amendment and Domino UK Limited does not accept liability for any such corruption, interception, viruses or amendment or their consequences.
****************************************************


From vagabon.xyz@gmail.com Tue Jul 11 09:28:37 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 11 Jul 2006 09:28:48 +0100 (BST)
Received: from nf-out-0910.google.com ([64.233.182.187]:18631 "EHLO
	nf-out-0910.google.com") by ftp.linux-mips.org with ESMTP
	id S8133396AbWGKI2h (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 11 Jul 2006 09:28:37 +0100
Received: by nf-out-0910.google.com with SMTP id k27so141131nfc
        for <linux-mips@linux-mips.org>; Tue, 11 Jul 2006 01:28:35 -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=oWante4wEqW7XS6sFVOCCWpcwEDO6peQLed5/y20uk9+qZ2u9KEvSQgZlU7IrX2KNez10uwmE2+fSpWff4DTb+eoBotyDmAowAQuXNC0jOk5ixAL64gH+VgF/a+cM7N7yIdKnO6PjHyUBX2dCh1FjG84Vrzo0G2N4SIKDP26kc0=
Received: by 10.48.1.4 with SMTP id 4mr280349nfa;
        Tue, 11 Jul 2006 01:28:34 -0700 (PDT)
Received: from ?192.168.0.24? ( [194.3.162.233])
        by mx.gmail.com with ESMTP id k24sm13420090nfc.2006.07.11.01.28.33;
        Tue, 11 Jul 2006 01:28:34 -0700 (PDT)
Message-ID: <44B3625B.7000700@innova-card.com>
Date:	Tue, 11 Jul 2006 10:33:31 +0200
Reply-To: Franck <vagabon.xyz@gmail.com>
User-Agent: Thunderbird 1.5.0.4 (X11/20060614)
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: <cda58cb80607060805yc656114p53516b904188c20f@mail.gmail.com>	<20060707.002602.75184460.anemo@mba.ocn.ne.jp>	<cda58cb80607100434h13831eb7rc6eda13a0d9e373f@mail.gmail.com> <20060710.233454.39153668.anemo@mba.ocn.ne.jp>
In-Reply-To: <20060710.233454.39153668.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: 11972
X-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 Mon, 10 Jul 2006 13:34:06 +0200, "Franck Bui-Huu" <vagabon.xyz@gmail.com> wrote:
> 
>> can we use pfn_valid() instead of page_is_ram() ? bootmem_init() and
>> sparse_init() have already been called so pfn_valid() should be safe
>> here....
> 
> We can, but we can get more precise value using page_is_ram().  The
> pfn_valid() returns true for _all_ pages on present section, and
> currently the section size is 256MB.

so your total pages of RAM in show_mem() is incorrect...

               if (!pfn_valid(pfn))
                        continue;
                page = pfn_to_page(pfn);
                total++;


I don't know SPARSEMEM a lot but is it allowed to have holes inside
a section ? Shouldn't we tune the section size to avoid holes inside
section ?

> 
>>> -       max_mapnr = num_physpages = highend_pfn;
>>> +       max_mapnr = highend_pfn;
>>>  #else
>>> -       max_mapnr = num_physpages = max_low_pfn;
>>> +       max_mapnr = max_low_pfn;
>> this is not always true, specially if FLATMEM set and your physical mem
>> do not start at 0.
> 
> Yes, and I think you are preparing a patch for these systems ;-)
> 

good point :)

		Franck

From anemo@mba.ocn.ne.jp Tue Jul 11 14:23:44 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 11 Jul 2006 14:23:53 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:49101 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S3558331AbWGKNXo (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 11 Jul 2006 14:23:44 +0100
Received: from localhost (p6234-ipad28funabasi.chiba.ocn.ne.jp [220.107.205.234])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 0AF9AAF65; Tue, 11 Jul 2006 22:23:39 +0900 (JST)
Date:	Tue, 11 Jul 2006 22:24:58 +0900 (JST)
Message-Id: <20060711.222458.74752678.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: <44B3625B.7000700@innova-card.com>
References: <cda58cb80607100434h13831eb7rc6eda13a0d9e373f@mail.gmail.com>
	<20060710.233454.39153668.anemo@mba.ocn.ne.jp>
	<44B3625B.7000700@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: 11973
X-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, 11 Jul 2006 10:33:31 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
> > We can, but we can get more precise value using page_is_ram().  The
> > pfn_valid() returns true for _all_ pages on present section, and
> > currently the section size is 256MB.
> 
> so your total pages of RAM in show_mem() is incorrect...
> 
>                if (!pfn_valid(pfn))
>                         continue;
>                 page = pfn_to_page(pfn);
>                 total++;
> 
> 
> I don't know SPARSEMEM a lot but is it allowed to have holes inside
> a section ? Shouldn't we tune the section size to avoid holes inside
> section ?

If holes exist in a section, show_mem() will count these pages as
"reserved".  You can count real pages by "total - reserved".

Talking about nr_kernel_pages (calculated by zones_size[] and
zones_holes[]) and num_physpages, these values are used to determine
sizes of some kernel data structures, it would be better to set more
precise value for them.

While large holes in a section wastes some memory, make the section
size customizable might be a good idea.  Anyone?  ;-)

---
Atsushi Nemoto

From giometti@enneenne.com Wed Jul 12 13:34:14 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 12 Jul 2006 13:34:23 +0100 (BST)
Received: from 81-174-11-161.f5.ngi.it ([81.174.11.161]:28899 "EHLO
	gundam.enneenne.com") by ftp.linux-mips.org with ESMTP
	id S3561325AbWGLMeO (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 12 Jul 2006 13:34:14 +0100
Received: from giometti by gundam.enneenne.com with local (Exim 3.36 #1 (Debian))
	id 1G0Xxf-0004di-00; Wed, 12 Jul 2006 08:12:39 +0200
Date:	Wed, 12 Jul 2006 08:12:39 +0200
From:	Rodolfo Giometti <giometti@linux.it>
To:	linux-mips@linux-mips.org
Cc:	linux-fbdev-devel@lists.sourceforge.net
Subject: [PATCH] au1100fb.c info->var.rotate fix
Message-ID: <20060712061239.GF5994@gundam.enneenne.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="KJY2Ze80yH5MUxol"
Content-Disposition: inline
Organization: GNU/Linux Device Drivers, Embedded Systems and Courses
X-PGP-Key: gpg --keyserver keyserver.linux.it --recv-keys D25A5633
User-Agent: Mutt/1.5.5.1+cvs20040105i
Return-Path: <giometti@enneenne.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: 11974
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: giometti@linux.it
Precedence: bulk
X-list: linux-mips


--KJY2Ze80yH5MUxol
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello,

here a little patch to fix "info->var.rotate" data settings.

This info should be deduced directly from "fbdev->panel->control_base"
defined into au1100fb.h.

Ciao,

Rodolfo


Signed-off-by: Rodolfo Giometti <giometti@linux.it>

-- 

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

--KJY2Ze80yH5MUxol
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-au1100fb-rotate

diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c
index f492fe8..dc5a673 100644
--- a/drivers/video/au1100fb.c
+++ b/drivers/video/au1100fb.c
@@ -177,10 +177,11 @@ int au1100fb_setmode(struct au1100fb_dev
 	}
 
 	info->screen_size = info->fix.line_length * info->var.yres_virtual;
+	info->var.rotate = ((fbdev->panel->control_base&LCD_CONTROL_SM_MASK) \
+				>> LCD_CONTROL_SM_BIT) * 90;
 
 	/* Determine BPP mode and format */
-	fbdev->regs->lcd_control = fbdev->panel->control_base |
-			    ((info->var.rotate/90) << LCD_CONTROL_SM_BIT);
+	fbdev->regs->lcd_control = fbdev->panel->control_base;
 
 	fbdev->regs->lcd_intenable = 0;
 	fbdev->regs->lcd_intstatus = 0;

--KJY2Ze80yH5MUxol--

From giometti@enneenne.com Wed Jul 12 14:10:18 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 12 Jul 2006 14:10:28 +0100 (BST)
Received: from 81-174-11-161.f5.ngi.it ([81.174.11.161]:56209 "EHLO
	gundam.enneenne.com") by ftp.linux-mips.org with ESMTP
	id S3561327AbWGLNKS (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 12 Jul 2006 14:10:18 +0100
Received: from giometti by gundam.enneenne.com with local (Exim 3.36 #1 (Debian))
	id 1G0YTH-0005gZ-00; Wed, 12 Jul 2006 08:45:19 +0200
Date:	Wed, 12 Jul 2006 08:45:19 +0200
From:	Rodolfo Giometti <giometti@linux.it>
To:	linux-mips@linux-mips.org
Cc:	linux-fbdev-devel@lists.sourceforge.net
Subject: [PATCH] au1100fb.c cursor enable/disable
Message-ID: <20060712064519.GA17240@gundam.enneenne.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="FL5UXtIhxfXey3p5"
Content-Disposition: inline
Organization: GNU/Linux Device Drivers, Embedded Systems and Courses
X-PGP-Key: gpg --keyserver keyserver.linux.it --recv-keys D25A5633
User-Agent: Mutt/1.5.5.1+cvs20040105i
Return-Path: <giometti@enneenne.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: 11975
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: giometti@linux.it
Precedence: bulk
X-list: linux-mips


--FL5UXtIhxfXey3p5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello,

here a patch to add cursor enable/disable, very useful if you wish a
full screen boot logo.

Cursor can be disabled from kernel command line:

   video=au1100fb:nocursor,panel:Toppoly_TD035STED4

or from sysfs interface:

   echo 1 > /sys/module/au1100fb/parameters/nocursor

The patch also fixes up some wrong indentation issues.

Ciao,

Rodolfo


Signed-off-by: Rodolfo Giometti <giometti@linux.it>

-- 

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

--FL5UXtIhxfXey3p5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-au1100fb-nocursor

diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c
index e0b71fe..1b9ad17 100644
--- a/drivers/video/au1100fb.c
+++ b/drivers/video/au1100fb.c
@@ -8,6 +8,7 @@
  *  	<c.pellegrin@exadron.com>
  *
  * PM support added by Rodolfo Giometti <giometti@linux.it>
+ * Cursor enable/disable by Rodolfo Giometti <giometti@linux.it>
  *
  * Copyright 2002 MontaVista Software
  * Author: MontaVista Software, Inc.
@@ -114,6 +115,10 @@ static struct fb_var_screeninfo au1100fb
 
 static struct au1100fb_drv_info drv_info;
 
+static int nocursor = 0;
+module_param(nocursor, int, 0644);
+MODULE_PARM_DESC(nocursor, "cursor enable/disable");
+
 int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi);
 
 /*
@@ -440,6 +445,17 @@ int au1100fb_fb_mmap(struct fb_info *fbi
 	return 0;
 }
 
+/* fb_cursor
+ * Used to disable cursor drawing...
+ */
+int au1100fb_fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
+{
+	if (nocursor)
+		return 0;
+	else
+		return -EINVAL;	/* just to force soft_cursor() call */
+}
+
 static struct fb_ops au1100fb_ops =
 {
 	.owner			= THIS_MODULE,
@@ -451,6 +467,7 @@ static struct fb_ops au1100fb_ops =
 	.fb_imageblit		= cfb_imageblit,
 	.fb_rotate		= au1100fb_fb_rotate,
 	.fb_mmap		= au1100fb_fb_mmap,
+	.fb_cursor		= au1100fb_fb_cursor,
 };
 
 
@@ -705,7 +722,7 @@ int au1100fb_setup(char *options)
 	if (options) {
 		while ((this_opt = strsep(&options,",")) != NULL) {
 			/* Panel option */
-		if (!strncmp(this_opt, "panel:", 6)) {
+			if (!strncmp(this_opt, "panel:", 6)) {
 				int i;
 				this_opt += 6;
 				for (i = 0; i < num_panels; i++) {
@@ -713,13 +730,18 @@ int au1100fb_setup(char *options)
 					      	     known_lcd_panels[i].name,
 							strlen(this_opt))) {
 						panel_idx = i;
-					break;
+						break;
+					}
 				}
-			}
 				if (i >= num_panels) {
  					print_warn("Panel %s not supported!", this_opt);
 				}
 			}
+			if (!strncmp(this_opt, "nocursor", 8)) {
+				this_opt += 8;
+				nocursor = 1;
+				print_info("Cursor disabled");
+			}
 			/* Mode option (only option that start with digit) */
 			else if (isdigit(this_opt[0])) {
 				mode = kmalloc(strlen(this_opt) + 1, GFP_KERNEL);
@@ -728,7 +750,7 @@ int au1100fb_setup(char *options)
 			/* Unsupported option */
 			else {
 				print_warn("Unsupported option \"%s\"", this_opt);
-		}
+			}
 		}
 	}
 

--FL5UXtIhxfXey3p5--

From giometti@enneenne.com Wed Jul 12 14:28:33 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 12 Jul 2006 14:28:42 +0100 (BST)
Received: from 81-174-11-161.f5.ngi.it ([81.174.11.161]:45535 "EHLO
	gundam.enneenne.com") by ftp.linux-mips.org with ESMTP
	id S3561335AbWGLN2d (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 12 Jul 2006 14:28:33 +0100
Received: from giometti by gundam.enneenne.com with local (Exim 3.36 #1 (Debian))
	id 1G0Yjl-000690-00; Wed, 12 Jul 2006 09:02:21 +0200
Date:	Wed, 12 Jul 2006 09:02:21 +0200
From:	Rodolfo Giometti <giometti@linux.it>
To:	linux-mips@linux-mips.org
Cc:	linux-fbdev-devel@lists.sourceforge.net
Subject: [PATCH] au1100fb.c startup sequence
Message-ID: <20060712070221.GI5994@gundam.enneenne.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="WHz+neNWvhIGAO8A"
Content-Disposition: inline
Organization: GNU/Linux Device Drivers, Embedded Systems and Courses
X-PGP-Key: gpg --keyserver keyserver.linux.it --recv-keys D25A5633
User-Agent: Mutt/1.5.5.1+cvs20040105i
Return-Path: <giometti@enneenne.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: 11976
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: giometti@linux.it
Precedence: bulk
X-list: linux-mips


--WHz+neNWvhIGAO8A
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello,

here a patch to fix up the start up sequence.

This new sequence allow you to correctly enable the LCD controller
even if the bootloader has already did it.

The patch also fixes up a wrong indentation issue.

Ciao,

Rodolfo


Signed-off-by: Rodolfo Giometti <giometti@linux.it>

-- 

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

--WHz+neNWvhIGAO8A
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-au1100fb-startup-fix

diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c
index 1b9ad17..f9fcc65 100644
--- a/drivers/video/au1100fb.c
+++ b/drivers/video/au1100fb.c
@@ -167,7 +167,7 @@ int au1100fb_setmode(struct au1100fb_dev
 
 			info->fix.visual = FB_VISUAL_TRUECOLOR;
 			info->fix.line_length = info->var.xres_virtual << 1; /* depth=16 */
-	}
+		}
 	} else {
 		/* mono */
 		info->fix.visual = FB_VISUAL_MONO10;
@@ -180,16 +180,11 @@ int au1100fb_setmode(struct au1100fb_dev
 
 	/* Determine BPP mode and format */
 	fbdev->regs->lcd_control = fbdev->panel->control_base;
-
-	fbdev->regs->lcd_intenable = 0;
-	fbdev->regs->lcd_intstatus = 0;
-
 	fbdev->regs->lcd_horztiming = fbdev->panel->horztiming;
-
 	fbdev->regs->lcd_verttiming = fbdev->panel->verttiming;
-
 	fbdev->regs->lcd_clkcontrol = fbdev->panel->clkcontrol_base;
-
+	fbdev->regs->lcd_intenable = 0;
+	fbdev->regs->lcd_intstatus = 0;
 	fbdev->regs->lcd_dmaaddr0 = LCD_DMA_SA_N(fbdev->fb_phys);
 
 	if (panel_is_dual(fbdev->panel)) {
@@ -217,7 +212,8 @@ int au1100fb_setmode(struct au1100fb_dev
 	fbdev->regs->lcd_pwmhi = 0;
 
 	/* Resume controller */
-	au1100fb_fb_blank(VESA_NO_BLANKING, &fbdev->info);
+	mdelay(10);
+	au1100fb_fb_blank(VESA_NO_BLANKING, info);
 
 	return 0;
 }

--WHz+neNWvhIGAO8A--

From david.goodenough@btconnect.com Wed Jul 12 17:37:26 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 12 Jul 2006 17:37:35 +0100 (BST)
Received: from s2.ukfsn.org ([217.158.120.143]:34265 "EHLO mail.ukfsn.org")
	by ftp.linux-mips.org with ESMTP id S3561366AbWGLQh0 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 12 Jul 2006 17:37:26 +0100
Received: from [10.0.1.63] (84-45-236-142.no-dns-yet.enta.net [84.45.236.142])
	by mail.ukfsn.org (Postfix) with ESMTP id C963CE6DC9
	for <linux-mips@linux-mips.org>; Wed, 12 Jul 2006 17:34:46 +0100 (BST)
From:	David Goodenough <david.goodenough@btconnect.com>
To:	linux-mips@linux-mips.org
Subject: RouterBoard 532 NAND support
Date:	Wed, 12 Jul 2006 17:37:18 +0100
User-Agent: KMail/1.9.1
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200607121737.18866.david.goodenough@btconnect.com>
Return-Path: <david.goodenough@btconnect.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: 11977
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: david.goodenough@btconnect.com
Precedence: bulk
X-list: linux-mips

Does anyone have a patch for 2.6.17 to add NAND support for a Routerboard
532?  I have the bits that add Yaffs, and I have some code that was a patch
to 2.6.17-rc5 but I can not get it to work on 2.6.17 (it compiles but it 
seems to be looking in the wrong place for the NAND as it gets back 0xff
as the manufacturer and device id file in drivers/mtd/nand/nand_base.c in
the routine nand_scan.  

Any help gratefully received

David

From yoichi_yuasa@tripeaks.co.jp Thu Jul 13 09:33:09 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Jul 2006 09:33:21 +0100 (BST)
Received: from mo31.po.2iij.net ([210.128.50.54]:22582 "EHLO mo31.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133565AbWGMIdJ (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Jul 2006 09:33:09 +0100
Received: by mo.po.2iij.net (mo31) id k6D8X4GO077110; Thu, 13 Jul 2006 17:33:04 +0900 (JST)
Received: from localhost.localdomain (65.126.232.202.bf.2iij.net [202.232.126.65])
	by mbox.po.2iij.net (mbox32) id k6D8X3Ag039372
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Thu, 13 Jul 2006 17:33:04 +0900 (JST)
Date:	Thu, 13 Jul 2006 17:33:03 +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: moved the IRQ numbers to asm-mips/vr41xx/irq.h
Message-Id: <20060713173303.23f34127.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: 11978
X-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 moved the IRQ numbers to asm-mips/vr41xx/irq.h
Please apply.

Yoichi

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

diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/pci/fixup-mpc30x.c mips/arch/mips/pci/fixup-mpc30x.c
--- mips-orig/arch/mips/pci/fixup-mpc30x.c	2006-07-12 12:13:07.238092750 +0900
+++ mips/arch/mips/pci/fixup-mpc30x.c	2006-07-12 13:12:01.510971000 +0900
@@ -21,7 +21,6 @@
 #include <linux/pci.h>
 
 #include <asm/vr41xx/mpc30x.h>
-#include <asm/vr41xx/vrc4173.h>
 
 static const int internal_func_irqs[] __initdata = {
 	VRC4173_CASCADE_IRQ,
diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/vr41xx/common/icu.c mips/arch/mips/vr41xx/common/icu.c
--- mips-orig/arch/mips/vr41xx/common/icu.c	2006-07-12 12:13:07.318097750 +0900
+++ mips/arch/mips/vr41xx/common/icu.c	2006-07-12 13:00:49.252957500 +0900
@@ -38,6 +38,7 @@
 
 #include <asm/cpu.h>
 #include <asm/io.h>
+#include <asm/vr41xx/irq.h>
 #include <asm/vr41xx/vr41xx.h>
 
 static void __iomem *icu1_base;
diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/vr41xx/common/init.c mips/arch/mips/vr41xx/common/init.c
--- mips-orig/arch/mips/vr41xx/common/init.c	2006-07-12 12:13:07.318097750 +0900
+++ mips/arch/mips/vr41xx/common/init.c	2006-07-12 13:01:04.617917750 +0900
@@ -24,6 +24,7 @@
 
 #include <asm/bootinfo.h>
 #include <asm/time.h>
+#include <asm/vr41xx/irq.h>
 #include <asm/vr41xx/vr41xx.h>
 
 #define IO_MEM_RESOURCE_START	0UL
diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/vr41xx/common/irq.c mips/arch/mips/vr41xx/common/irq.c
--- mips-orig/arch/mips/vr41xx/common/irq.c	2006-07-12 12:13:07.318097750 +0900
+++ mips/arch/mips/vr41xx/common/irq.c	2006-07-12 13:01:44.724424250 +0900
@@ -22,7 +22,7 @@
 
 #include <asm/irq_cpu.h>
 #include <asm/system.h>
-#include <asm/vr41xx/vr41xx.h>
+#include <asm/vr41xx/irq.h>
 
 typedef struct irq_cascade {
 	int (*get_irq)(unsigned int, struct pt_regs *);
diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/vr41xx/common/vrc4173.c mips/arch/mips/vr41xx/common/vrc4173.c
--- mips-orig/arch/mips/vr41xx/common/vrc4173.c	2006-07-12 12:13:07.318097750 +0900
+++ mips/arch/mips/vr41xx/common/vrc4173.c	2006-07-12 13:17:44.408400750 +0900
@@ -28,6 +28,7 @@
 #include <linux/spinlock.h>
 #include <linux/types.h>
 
+#include <asm/vr41xx/irq.h>
 #include <asm/vr41xx/vr41xx.h>
 #include <asm/vr41xx/vrc4173.h>
 
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/char/vr41xx_giu.c mips/drivers/char/vr41xx_giu.c
--- mips-orig/drivers/char/vr41xx_giu.c	2006-07-12 12:13:08.998202750 +0900
+++ mips/drivers/char/vr41xx_giu.c	2006-07-12 13:04:59.980627000 +0900
@@ -33,6 +33,7 @@
 #include <asm/cpu.h>
 #include <asm/io.h>
 #include <asm/vr41xx/giu.h>
+#include <asm/vr41xx/irq.h>
 #include <asm/vr41xx/vr41xx.h>
 
 MODULE_AUTHOR("Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>");
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/rtc/rtc-vr41xx.c mips/drivers/rtc/rtc-vr41xx.c
--- mips-orig/drivers/rtc/rtc-vr41xx.c	2006-07-12 12:13:10.158275250 +0900
+++ mips/drivers/rtc/rtc-vr41xx.c	2006-07-12 13:05:30.870557500 +0900
@@ -30,7 +30,7 @@
 #include <asm/div64.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
-#include <asm/vr41xx/vr41xx.h>
+#include <asm/vr41xx/irq.h>
 
 MODULE_AUTHOR("Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>");
 MODULE_DESCRIPTION("NEC VR4100 series RTC driver");
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/serial/vr41xx_siu.c mips/drivers/serial/vr41xx_siu.c
--- mips-orig/drivers/serial/vr41xx_siu.c	2006-07-12 12:13:10.534298750 +0900
+++ mips/drivers/serial/vr41xx_siu.c	2006-07-12 13:07:48.327148000 +0900
@@ -38,6 +38,7 @@
 #include <linux/tty_flip.h>
 
 #include <asm/io.h>
+#include <asm/vr41xx/irq.h>
 #include <asm/vr41xx/siu.h>
 #include <asm/vr41xx/vr41xx.h>
 
diff -pruN -X mips/Documentation/dontdiff mips-orig/include/asm-mips/vr41xx/capcella.h mips/include/asm-mips/vr41xx/capcella.h
--- mips-orig/include/asm-mips/vr41xx/capcella.h	2006-07-12 12:13:12.654431250 +0900
+++ mips/include/asm-mips/vr41xx/capcella.h	2006-07-12 13:02:54.692797000 +0900
@@ -20,7 +20,7 @@
 #ifndef __ZAO_CAPCELLA_H
 #define __ZAO_CAPCELLA_H
 
-#include <asm/vr41xx/vr41xx.h>
+#include <asm/vr41xx/irq.h>
 
 /*
  * General-Purpose I/O Pin Number
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-12 12:13:12.654431250 +0900
+++ mips/include/asm-mips/vr41xx/cmbvr4133.h	2006-07-12 13:10:11.764112250 +0900
@@ -15,8 +15,7 @@
 #ifndef __NEC_CMBVR4133_H
 #define __NEC_CMBVR4133_H
 
-#include <asm/addrspace.h>
-#include <asm/vr41xx/vr41xx.h>
+#include <asm/vr41xx/irq.h>
 
 /*
  * General-Purpose I/O Pin Number
diff -pruN -X mips/Documentation/dontdiff mips-orig/include/asm-mips/vr41xx/irq.h mips/include/asm-mips/vr41xx/irq.h
--- mips-orig/include/asm-mips/vr41xx/irq.h	1970-01-01 09:00:00.000000000 +0900
+++ mips/include/asm-mips/vr41xx/irq.h	2006-07-12 13:22:25.161946750 +0900
@@ -0,0 +1,101 @@
+/*
+ * include/asm-mips/vr41xx/irq.h
+ *
+ * Interrupt numbers for NEC VR4100 series.
+ *
+ * Copyright (C) 1999 Michael Klar
+ * Copyright (C) 2001, 2002 Paul Mundt
+ * Copyright (C) 2002 MontaVista Software, Inc.
+ * Copyright (C) 2002 TimeSys Corp.
+ * Copyright (C) 2003-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+#ifndef __NEC_VR41XX_IRQ_H
+#define __NEC_VR41XX_IRQ_H
+
+/*
+ * CPU core Interrupt Numbers
+ */
+#define MIPS_CPU_IRQ_BASE	0
+#define MIPS_CPU_IRQ(x)		(MIPS_CPU_IRQ_BASE + (x))
+#define MIPS_SOFTINT0_IRQ	MIPS_CPU_IRQ(0)
+#define MIPS_SOFTINT1_IRQ	MIPS_CPU_IRQ(1)
+#define INT0_IRQ		MIPS_CPU_IRQ(2)
+#define INT1_IRQ		MIPS_CPU_IRQ(3)
+#define INT2_IRQ		MIPS_CPU_IRQ(4)
+#define INT3_IRQ		MIPS_CPU_IRQ(5)
+#define INT4_IRQ		MIPS_CPU_IRQ(6)
+#define TIMER_IRQ		MIPS_CPU_IRQ(7)
+
+/*
+ * SYINT1 Interrupt Numbers
+ */
+#define SYSINT1_IRQ_BASE	8
+#define SYSINT1_IRQ(x)		(SYSINT1_IRQ_BASE + (x))
+#define BATTRY_IRQ		SYSINT1_IRQ(0)
+#define POWER_IRQ		SYSINT1_IRQ(1)
+#define RTCLONG1_IRQ		SYSINT1_IRQ(2)
+#define ELAPSEDTIME_IRQ		SYSINT1_IRQ(3)
+/* RFU */
+#define PIU_IRQ			SYSINT1_IRQ(5)
+#define AIU_IRQ			SYSINT1_IRQ(6)
+#define KIU_IRQ			SYSINT1_IRQ(7)
+#define GIUINT_IRQ		SYSINT1_IRQ(8)
+#define SIU_IRQ			SYSINT1_IRQ(9)
+#define BUSERR_IRQ		SYSINT1_IRQ(10)
+#define SOFTINT_IRQ		SYSINT1_IRQ(11)
+#define CLKRUN_IRQ		SYSINT1_IRQ(12)
+#define DOZEPIU_IRQ		SYSINT1_IRQ(13)
+#define SYSINT1_IRQ_LAST	DOZEPIU_IRQ
+
+/*
+ * SYSINT2 Interrupt Numbers
+ */
+#define SYSINT2_IRQ_BASE	24
+#define SYSINT2_IRQ(x)		(SYSINT2_IRQ_BASE + (x))
+#define RTCLONG2_IRQ		SYSINT2_IRQ(0)
+#define LED_IRQ			SYSINT2_IRQ(1)
+#define HSP_IRQ			SYSINT2_IRQ(2)
+#define TCLOCK_IRQ		SYSINT2_IRQ(3)
+#define FIR_IRQ			SYSINT2_IRQ(4)
+#define CEU_IRQ			SYSINT2_IRQ(4)	/* same number as FIR_IRQ */
+#define DSIU_IRQ		SYSINT2_IRQ(5)
+#define PCI_IRQ			SYSINT2_IRQ(6)
+#define SCU_IRQ			SYSINT2_IRQ(7)
+#define CSI_IRQ			SYSINT2_IRQ(8)
+#define BCU_IRQ			SYSINT2_IRQ(9)
+#define ETHERNET_IRQ		SYSINT2_IRQ(10)
+#define SYSINT2_IRQ_LAST	ETHERNET_IRQ
+
+/*
+ * GIU Interrupt Numbers
+ */
+#define GIU_IRQ_BASE		40
+#define GIU_IRQ(x)		(GIU_IRQ_BASE + (x))	/* IRQ 40-71 */
+#define GIU_IRQ_LAST		GIU_IRQ(31)
+
+/*
+ * VRC4173 Interrupt Numbers
+ */
+#define VRC4173_IRQ_BASE	72
+#define VRC4173_IRQ(x)		(VRC4173_IRQ_BASE + (x))
+#define VRC4173_USB_IRQ		VRC4173_IRQ(0)
+#define VRC4173_PCMCIA2_IRQ	VRC4173_IRQ(1)
+#define VRC4173_PCMCIA1_IRQ	VRC4173_IRQ(2)
+#define VRC4173_PS2CH2_IRQ	VRC4173_IRQ(3)
+#define VRC4173_PS2CH1_IRQ	VRC4173_IRQ(4)
+#define VRC4173_PIU_IRQ		VRC4173_IRQ(5)
+#define VRC4173_AIU_IRQ		VRC4173_IRQ(6)
+#define VRC4173_KIU_IRQ		VRC4173_IRQ(7)
+#define VRC4173_GIU_IRQ		VRC4173_IRQ(8)
+#define VRC4173_AC97_IRQ	VRC4173_IRQ(9)
+#define VRC4173_AC97INT1_IRQ	VRC4173_IRQ(10)
+/* RFU */
+#define VRC4173_DOZEPIU_IRQ	VRC4173_IRQ(13)
+#define VRC4173_IRQ_LAST	VRC4173_DOZEPIU_IRQ
+
+#endif /* __NEC_VR41XX_IRQ_H */
diff -pruN -X mips/Documentation/dontdiff mips-orig/include/asm-mips/vr41xx/mpc30x.h mips/include/asm-mips/vr41xx/mpc30x.h
--- mips-orig/include/asm-mips/vr41xx/mpc30x.h	2006-07-12 12:13:12.654431250 +0900
+++ mips/include/asm-mips/vr41xx/mpc30x.h	2006-07-12 13:10:46.838304250 +0900
@@ -20,7 +20,7 @@
 #ifndef __VICTOR_MPC30X_H
 #define __VICTOR_MPC30X_H
 
-#include <asm/vr41xx/vr41xx.h>
+#include <asm/vr41xx/irq.h>
 
 /*
  * General-Purpose I/O Pin Number
diff -pruN -X mips/Documentation/dontdiff mips-orig/include/asm-mips/vr41xx/tb0219.h mips/include/asm-mips/vr41xx/tb0219.h
--- mips-orig/include/asm-mips/vr41xx/tb0219.h	2006-07-12 12:13:12.654431250 +0900
+++ mips/include/asm-mips/vr41xx/tb0219.h	2006-07-12 13:10:58.647042250 +0900
@@ -23,7 +23,7 @@
 #ifndef __TANBAC_TB0219_H
 #define __TANBAC_TB0219_H
 
-#include <asm/vr41xx/vr41xx.h>
+#include <asm/vr41xx/irq.h>
 
 /*
  * General-Purpose I/O Pin Number
diff -pruN -X mips/Documentation/dontdiff mips-orig/include/asm-mips/vr41xx/tb0226.h mips/include/asm-mips/vr41xx/tb0226.h
--- mips-orig/include/asm-mips/vr41xx/tb0226.h	2006-07-12 12:13:12.654431250 +0900
+++ mips/include/asm-mips/vr41xx/tb0226.h	2006-07-12 13:11:11.571850000 +0900
@@ -20,7 +20,7 @@
 #ifndef __TANBAC_TB0226_H
 #define __TANBAC_TB0226_H
 
-#include <asm/vr41xx/vr41xx.h>
+#include <asm/vr41xx/irq.h>
 
 /*
  * General-Purpose I/O Pin Number
diff -pruN -X mips/Documentation/dontdiff mips-orig/include/asm-mips/vr41xx/tb0287.h mips/include/asm-mips/vr41xx/tb0287.h
--- mips-orig/include/asm-mips/vr41xx/tb0287.h	2006-07-12 12:13:12.654431250 +0900
+++ mips/include/asm-mips/vr41xx/tb0287.h	2006-07-12 13:11:25.972750000 +0900
@@ -22,7 +22,7 @@
 #ifndef __TANBAC_TB0287_H
 #define __TANBAC_TB0287_H
 
-#include <asm/vr41xx/vr41xx.h>
+#include <asm/vr41xx/irq.h>
 
 /*
  * General-Purpose I/O Pin Number
diff -pruN -X mips/Documentation/dontdiff mips-orig/include/asm-mips/vr41xx/vr41xx.h mips/include/asm-mips/vr41xx/vr41xx.h
--- mips-orig/include/asm-mips/vr41xx/vr41xx.h	2006-07-12 12:13:12.654431250 +0900
+++ mips/include/asm-mips/vr41xx/vr41xx.h	2006-07-12 12:56:30.872809750 +0900
@@ -74,59 +74,6 @@ extern void vr41xx_mask_clock(vr41xx_clo
 /*
  * Interrupt Control Unit
  */
-/* CPU core Interrupt Numbers */
-#define MIPS_CPU_IRQ_BASE	0
-#define MIPS_CPU_IRQ(x)		(MIPS_CPU_IRQ_BASE + (x))
-#define MIPS_SOFTINT0_IRQ	MIPS_CPU_IRQ(0)
-#define MIPS_SOFTINT1_IRQ	MIPS_CPU_IRQ(1)
-#define INT0_IRQ		MIPS_CPU_IRQ(2)
-#define INT1_IRQ		MIPS_CPU_IRQ(3)
-#define INT2_IRQ		MIPS_CPU_IRQ(4)
-#define INT3_IRQ		MIPS_CPU_IRQ(5)
-#define INT4_IRQ		MIPS_CPU_IRQ(6)
-#define TIMER_IRQ		MIPS_CPU_IRQ(7)
-
-/* SYINT1 Interrupt Numbers */
-#define SYSINT1_IRQ_BASE	8
-#define SYSINT1_IRQ(x)		(SYSINT1_IRQ_BASE + (x))
-#define BATTRY_IRQ		SYSINT1_IRQ(0)
-#define POWER_IRQ		SYSINT1_IRQ(1)
-#define RTCLONG1_IRQ		SYSINT1_IRQ(2)
-#define ELAPSEDTIME_IRQ		SYSINT1_IRQ(3)
-/* RFU */
-#define PIU_IRQ			SYSINT1_IRQ(5)
-#define AIU_IRQ			SYSINT1_IRQ(6)
-#define KIU_IRQ			SYSINT1_IRQ(7)
-#define GIUINT_IRQ		SYSINT1_IRQ(8)
-#define SIU_IRQ			SYSINT1_IRQ(9)
-#define BUSERR_IRQ		SYSINT1_IRQ(10)
-#define SOFTINT_IRQ		SYSINT1_IRQ(11)
-#define CLKRUN_IRQ		SYSINT1_IRQ(12)
-#define DOZEPIU_IRQ		SYSINT1_IRQ(13)
-#define SYSINT1_IRQ_LAST	DOZEPIU_IRQ
-
-/* SYSINT2 Interrupt Numbers */
-#define SYSINT2_IRQ_BASE	24
-#define SYSINT2_IRQ(x)		(SYSINT2_IRQ_BASE + (x))
-#define RTCLONG2_IRQ		SYSINT2_IRQ(0)
-#define LED_IRQ			SYSINT2_IRQ(1)
-#define HSP_IRQ			SYSINT2_IRQ(2)
-#define TCLOCK_IRQ		SYSINT2_IRQ(3)
-#define FIR_IRQ			SYSINT2_IRQ(4)
-#define CEU_IRQ			SYSINT2_IRQ(4)	/* same number as FIR_IRQ */
-#define DSIU_IRQ		SYSINT2_IRQ(5)
-#define PCI_IRQ			SYSINT2_IRQ(6)
-#define SCU_IRQ			SYSINT2_IRQ(7)
-#define CSI_IRQ			SYSINT2_IRQ(8)
-#define BCU_IRQ			SYSINT2_IRQ(9)
-#define ETHERNET_IRQ		SYSINT2_IRQ(10)
-#define SYSINT2_IRQ_LAST	ETHERNET_IRQ
-
-/* GIU Interrupt Numbers */
-#define GIU_IRQ_BASE		40
-#define GIU_IRQ(x)		(GIU_IRQ_BASE + (x))	/* IRQ 40-71 */
-#define GIU_IRQ_LAST		GIU_IRQ(31)
-
 extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign);
 extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int, struct pt_regs *));
 
diff -pruN -X mips/Documentation/dontdiff mips-orig/include/asm-mips/vr41xx/vrc4173.h mips/include/asm-mips/vr41xx/vrc4173.h
--- mips-orig/include/asm-mips/vr41xx/vrc4173.h	2006-07-12 12:13:12.654431250 +0900
+++ mips/include/asm-mips/vr41xx/vrc4173.h	2006-07-12 12:56:09.215456250 +0900
@@ -27,26 +27,6 @@
 #include <asm/io.h>
 
 /*
- * Interrupt Number
- */
-#define VRC4173_IRQ_BASE	72
-#define VRC4173_IRQ(x)		(VRC4173_IRQ_BASE + (x))
-#define VRC4173_USB_IRQ		VRC4173_IRQ(0)
-#define VRC4173_PCMCIA2_IRQ	VRC4173_IRQ(1)
-#define VRC4173_PCMCIA1_IRQ	VRC4173_IRQ(2)
-#define VRC4173_PS2CH2_IRQ	VRC4173_IRQ(3)
-#define VRC4173_PS2CH1_IRQ	VRC4173_IRQ(4)
-#define VRC4173_PIU_IRQ		VRC4173_IRQ(5)
-#define VRC4173_AIU_IRQ		VRC4173_IRQ(6)
-#define VRC4173_KIU_IRQ		VRC4173_IRQ(7)
-#define VRC4173_GIU_IRQ		VRC4173_IRQ(8)
-#define VRC4173_AC97_IRQ	VRC4173_IRQ(9)
-#define VRC4173_AC97INT1_IRQ	VRC4173_IRQ(10)
-/* RFU */
-#define VRC4173_DOZEPIU_IRQ	VRC4173_IRQ(13)
-#define VRC4173_IRQ_LAST	VRC4173_DOZEPIU_IRQ
-
-/*
  * PCI I/O accesses
  */
 #ifdef CONFIG_VRC4173

From yoichi_yuasa@tripeaks.co.jp Thu Jul 13 09:33:50 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Jul 2006 09:34:21 +0100 (BST)
Received: from mo32.po.2iij.net ([210.128.50.17]:38406 "EHLO mo32.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133563AbWGMIdU (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Jul 2006 09:33:20 +0100
Received: by mo.po.2iij.net (mo32) id k6D8XHlC049262; Thu, 13 Jul 2006 17:33:17 +0900 (JST)
Received: from localhost.localdomain (65.126.232.202.bf.2iij.net [202.232.126.65])
	by mbox.po.2iij.net (mbox31) id k6D8XFh3006980
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Thu, 13 Jul 2006 17:33:15 +0900 (JST)
Date:	Thu, 13 Jul 2006 17:33:14 +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: removed old v2.4 VRC4173 driver
Message-Id: <20060713173314.05685c76.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: 11979
X-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 the old v2.4 VRC4173 driver.
Please apply.

Yoichi

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

diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/vr41xx/Kconfig mips/arch/mips/vr41xx/Kconfig
--- mips-orig/arch/mips/vr41xx/Kconfig	2006-07-12 12:13:07.314097500 +0900
+++ mips/arch/mips/vr41xx/Kconfig	2006-07-12 13:52:20.030119000 +0900
@@ -86,9 +86,3 @@ config PCI_VR41XX
 	depends on MACH_VR41XX && HW_HAS_PCI
 	default y
 	select PCI
-
-config VRC4173
-	tristate "Add NEC VRC4173 companion chip support"
-	depends on MACH_VR41XX && PCI_VR41XX
-	help
-	  The NEC VRC4173 is a companion chip for NEC VR4122/VR4131.
diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/vr41xx/common/Makefile mips/arch/mips/vr41xx/common/Makefile
--- mips-orig/arch/mips/vr41xx/common/Makefile	2006-07-12 12:13:07.314097500 +0900
+++ mips/arch/mips/vr41xx/common/Makefile	2006-07-12 13:52:52.340138250 +0900
@@ -2,7 +2,6 @@
 # Makefile for common code of the NEC VR4100 series.
 #
 
-obj-y				+= bcu.o cmu.o icu.o init.o irq.o pmu.o type.o
-obj-$(CONFIG_VRC4173)		+= vrc4173.o
+obj-y	+= bcu.o cmu.o icu.o init.o irq.o pmu.o type.o
 
 EXTRA_AFLAGS := $(CFLAGS)
diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/vr41xx/common/vrc4173.c mips/arch/mips/vr41xx/common/vrc4173.c
--- mips-orig/arch/mips/vr41xx/common/vrc4173.c	2006-07-12 13:51:13.817981000 +0900
+++ mips/arch/mips/vr41xx/common/vrc4173.c	1970-01-01 09:00:00.000000000 +0900
@@ -1,582 +0,0 @@
-/*
- *  vrc4173.c, NEC VRC4173 base driver for NEC VR4122/VR4131.
- *
- *  Copyright (C) 2001-2003  MontaVista Software Inc.
- *    Author: Yoichi Yuasa <yyuasa@mvista.com, or source@mvista.com>
- *  Copyright (C) 2004  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
- *  Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/pci.h>
-#include <linux/spinlock.h>
-#include <linux/types.h>
-
-#include <asm/vr41xx/irq.h>
-#include <asm/vr41xx/vr41xx.h>
-#include <asm/vr41xx/vrc4173.h>
-
-MODULE_DESCRIPTION("NEC VRC4173 base driver for NEC VR4122/4131");
-MODULE_AUTHOR("Yoichi Yuasa <yyuasa@mvista.com>");
-MODULE_LICENSE("GPL");
-
-#define VRC4173_CMUCLKMSK	0x040
- #define MSKPIU			0x0001
- #define MSKKIU			0x0002
- #define MSKAIU			0x0004
- #define MSKPS2CH1		0x0008
- #define MSKPS2CH2		0x0010
- #define MSKUSB			0x0020
- #define MSKCARD1		0x0040
- #define MSKCARD2		0x0080
- #define MSKAC97		0x0100
- #define MSK48MUSB		0x0400
- #define MSK48MPIN		0x0800
- #define MSK48MOSC		0x1000
-#define VRC4173_CMUSRST		0x042
- #define USBRST			0x0001
- #define CARD1RST		0x0002
- #define CARD2RST		0x0004
- #define AC97RST		0x0008
-
-#define VRC4173_SYSINT1REG	0x060
-#define VRC4173_MSYSINT1REG	0x06c
-#define VRC4173_MPIUINTREG	0x06e
-#define VRC4173_MAIUINTREG	0x070
-#define VRC4173_MKIUINTREG	0x072
-
-#define VRC4173_SELECTREG	0x09e
- #define SEL3			0x0008
- #define SEL2			0x0004
- #define SEL1			0x0002
- #define SEL0			0x0001
-
-static struct pci_device_id vrc4173_id_table[] __devinitdata = {
-	{	.vendor		= PCI_VENDOR_ID_NEC,
-		.device		= PCI_DEVICE_ID_NEC_VRC4173,
-		.subvendor	= PCI_ANY_ID,
-		.subdevice	= PCI_ANY_ID,			},
-	{	.vendor		= 0,				},
-};
-
-unsigned long vrc4173_io_offset = 0;
-
-EXPORT_SYMBOL(vrc4173_io_offset);
-
-static int vrc4173_initialized;
-static uint16_t vrc4173_cmuclkmsk;
-static uint16_t vrc4173_selectreg;
-static DEFINE_SPINLOCK(vrc4173_cmu_lock);
-static DEFINE_SPINLOCK(vrc4173_giu_lock);
-
-static inline void set_cmusrst(uint16_t val)
-{
-	uint16_t cmusrst;
-
-	cmusrst = vrc4173_inw(VRC4173_CMUSRST);
-	cmusrst |= val;
-	vrc4173_outw(cmusrst, VRC4173_CMUSRST);
-}
-
-static inline void clear_cmusrst(uint16_t val)
-{
-	uint16_t cmusrst;
-
-	cmusrst = vrc4173_inw(VRC4173_CMUSRST);
-	cmusrst &= ~val;
-	vrc4173_outw(cmusrst, VRC4173_CMUSRST);
-}
-
-void vrc4173_supply_clock(vrc4173_clock_t clock)
-{
-	if (vrc4173_initialized) {
-		spin_lock_irq(&vrc4173_cmu_lock);
-
-		switch (clock) {
-		case VRC4173_PIU_CLOCK:
-			vrc4173_cmuclkmsk |= MSKPIU;
-			break;
-		case VRC4173_KIU_CLOCK:
-			vrc4173_cmuclkmsk |= MSKKIU;
-			break;
-		case VRC4173_AIU_CLOCK:
-			vrc4173_cmuclkmsk |= MSKAIU;
-			break;
-		case VRC4173_PS2_CH1_CLOCK:
-			vrc4173_cmuclkmsk |= MSKPS2CH1;
-			break;
-		case VRC4173_PS2_CH2_CLOCK:
-			vrc4173_cmuclkmsk |= MSKPS2CH2;
-			break;
-		case VRC4173_USBU_PCI_CLOCK:
-			set_cmusrst(USBRST);
-			vrc4173_cmuclkmsk |= MSKUSB;
-			break;
-		case VRC4173_CARDU1_PCI_CLOCK:
-			set_cmusrst(CARD1RST);
-			vrc4173_cmuclkmsk |= MSKCARD1;
-			break;
-		case VRC4173_CARDU2_PCI_CLOCK:
-			set_cmusrst(CARD2RST);
-			vrc4173_cmuclkmsk |= MSKCARD2;
-			break;
-		case VRC4173_AC97U_PCI_CLOCK:
-			set_cmusrst(AC97RST);
-			vrc4173_cmuclkmsk |= MSKAC97;
-			break;
-		case VRC4173_USBU_48MHz_CLOCK:
-			set_cmusrst(USBRST);
-			vrc4173_cmuclkmsk |= MSK48MUSB;
-			break;
-		case VRC4173_EXT_48MHz_CLOCK:
-			if (vrc4173_cmuclkmsk & MSK48MOSC)
-				vrc4173_cmuclkmsk |= MSK48MPIN;
-			else
-				printk(KERN_WARNING
-				       "vrc4173_supply_clock: "
-				       "Please supply VRC4173_48MHz_CLOCK first "
-				       "rather than VRC4173_EXT_48MHz_CLOCK.\n");
-			break;
-		case VRC4173_48MHz_CLOCK:
-			vrc4173_cmuclkmsk |= MSK48MOSC;
-			break;
-		default:
-			printk(KERN_WARNING
-			       "vrc4173_supply_clock: Invalid CLOCK value %u\n", clock);
-			break;
-		}
-
-		vrc4173_outw(vrc4173_cmuclkmsk, VRC4173_CMUCLKMSK);
-
-		switch (clock) {
-		case VRC4173_USBU_PCI_CLOCK:
-		case VRC4173_USBU_48MHz_CLOCK:
-			clear_cmusrst(USBRST);
-			break;
-		case VRC4173_CARDU1_PCI_CLOCK:
-			clear_cmusrst(CARD1RST);
-			break;
-		case VRC4173_CARDU2_PCI_CLOCK:
-			clear_cmusrst(CARD2RST);
-			break;
-		case VRC4173_AC97U_PCI_CLOCK:
-			clear_cmusrst(AC97RST);
-			break;
-		default:
-			break;
-		}
-
-		spin_unlock_irq(&vrc4173_cmu_lock);
-	}
-}
-
-EXPORT_SYMBOL(vrc4173_supply_clock);
-
-void vrc4173_mask_clock(vrc4173_clock_t clock)
-{
-	if (vrc4173_initialized) {
-		spin_lock_irq(&vrc4173_cmu_lock);
-
-		switch (clock) {
-		case VRC4173_PIU_CLOCK:
-			vrc4173_cmuclkmsk &= ~MSKPIU;
-			break;
-		case VRC4173_KIU_CLOCK:
-			vrc4173_cmuclkmsk &= ~MSKKIU;
-			break;
-		case VRC4173_AIU_CLOCK:
-			vrc4173_cmuclkmsk &= ~MSKAIU;
-			break;
-		case VRC4173_PS2_CH1_CLOCK:
-			vrc4173_cmuclkmsk &= ~MSKPS2CH1;
-			break;
-		case VRC4173_PS2_CH2_CLOCK:
-			vrc4173_cmuclkmsk &= ~MSKPS2CH2;
-			break;
-		case VRC4173_USBU_PCI_CLOCK:
-			set_cmusrst(USBRST);
-			vrc4173_cmuclkmsk &= ~MSKUSB;
-			break;
-		case VRC4173_CARDU1_PCI_CLOCK:
-			set_cmusrst(CARD1RST);
-			vrc4173_cmuclkmsk &= ~MSKCARD1;
-			break;
-		case VRC4173_CARDU2_PCI_CLOCK:
-			set_cmusrst(CARD2RST);
-			vrc4173_cmuclkmsk &= ~MSKCARD2;
-			break;
-		case VRC4173_AC97U_PCI_CLOCK:
-			set_cmusrst(AC97RST);
-			vrc4173_cmuclkmsk &= ~MSKAC97;
-			break;
-		case VRC4173_USBU_48MHz_CLOCK:
-			set_cmusrst(USBRST);
-			vrc4173_cmuclkmsk &= ~MSK48MUSB;
-			break;
-		case VRC4173_EXT_48MHz_CLOCK:
-			vrc4173_cmuclkmsk &= ~MSK48MPIN;
-			break;
-		case VRC4173_48MHz_CLOCK:
-			vrc4173_cmuclkmsk &= ~MSK48MOSC;
-			break;
-		default:
-			printk(KERN_WARNING "vrc4173_mask_clock: Invalid CLOCK value %u\n", clock);
-			break;
-		}
-
-		vrc4173_outw(vrc4173_cmuclkmsk, VRC4173_CMUCLKMSK);
-
-		switch (clock) {
-		case VRC4173_USBU_PCI_CLOCK:
-		case VRC4173_USBU_48MHz_CLOCK:
-			clear_cmusrst(USBRST);
-			break;
-		case VRC4173_CARDU1_PCI_CLOCK:
-			clear_cmusrst(CARD1RST);
-			break;
-		case VRC4173_CARDU2_PCI_CLOCK:
-			clear_cmusrst(CARD2RST);
-			break;
-		case VRC4173_AC97U_PCI_CLOCK:
-			clear_cmusrst(AC97RST);
-			break;
-		default:
-			break;
-		}
-
-		spin_unlock_irq(&vrc4173_cmu_lock);
-	}
-}
-
-EXPORT_SYMBOL(vrc4173_mask_clock);
-
-static inline void vrc4173_cmu_init(void)
-{
-	vrc4173_cmuclkmsk = vrc4173_inw(VRC4173_CMUCLKMSK);
-
-	spin_lock_init(&vrc4173_cmu_lock);
-}
-
-void vrc4173_select_function(vrc4173_function_t function)
-{
-	if (vrc4173_initialized) {
-		spin_lock_irq(&vrc4173_giu_lock);
-
-		switch(function) {
-		case PS2_CHANNEL1:
-			vrc4173_selectreg |= SEL2;
-			break;
-		case PS2_CHANNEL2:
-			vrc4173_selectreg |= SEL1;
-			break;
-		case TOUCHPANEL:
-			vrc4173_selectreg &= SEL2 | SEL1 | SEL0;
-			break;
-		case KEYBOARD_8SCANLINES:
-			vrc4173_selectreg &= SEL3 | SEL2 | SEL1;
-			break;
-		case KEYBOARD_10SCANLINES:
-			vrc4173_selectreg &= SEL3 | SEL2;
-			break;
-		case KEYBOARD_12SCANLINES:
-			vrc4173_selectreg &= SEL3;
-			break;
-		case GPIO_0_15PINS:
-			vrc4173_selectreg |= SEL0;
-			break;
-		case GPIO_16_20PINS:
-			vrc4173_selectreg |= SEL3;
-			break;
-		}
-
-		vrc4173_outw(vrc4173_selectreg, VRC4173_SELECTREG);
-
-		spin_unlock_irq(&vrc4173_giu_lock);
-	}
-}
-
-EXPORT_SYMBOL(vrc4173_select_function);
-
-static inline void vrc4173_giu_init(void)
-{
-	vrc4173_selectreg = vrc4173_inw(VRC4173_SELECTREG);
-
-	spin_lock_init(&vrc4173_giu_lock);
-}
-
-void vrc4173_enable_piuint(uint16_t mask)
-{
-	struct irq_desc *desc = irq_desc + VRC4173_PIU_IRQ;
-	unsigned long flags;
-	uint16_t val;
-
-	spin_lock_irqsave(&desc->lock, flags);
-	val = vrc4173_inw(VRC4173_MPIUINTREG);
-	val |= mask;
-	vrc4173_outw(val, VRC4173_MPIUINTREG);
-	spin_unlock_irqrestore(&desc->lock, flags);
-}
-
-EXPORT_SYMBOL(vrc4173_enable_piuint);
-
-void vrc4173_disable_piuint(uint16_t mask)
-{
-	struct irq_desc *desc = irq_desc + VRC4173_PIU_IRQ;
-	unsigned long flags;
-	uint16_t val;
-
-	spin_lock_irqsave(&desc->lock, flags);
-	val = vrc4173_inw(VRC4173_MPIUINTREG);
-	val &= ~mask;
-	vrc4173_outw(val, VRC4173_MPIUINTREG);
-	spin_unlock_irqrestore(&desc->lock, flags);
-}
-
-EXPORT_SYMBOL(vrc4173_disable_piuint);
-
-void vrc4173_enable_aiuint(uint16_t mask)
-{
-	struct irq_desc *desc = irq_desc + VRC4173_AIU_IRQ;
-	unsigned long flags;
-	uint16_t val;
-
-	spin_lock_irqsave(&desc->lock, flags);
-	val = vrc4173_inw(VRC4173_MAIUINTREG);
-	val |= mask;
-	vrc4173_outw(val, VRC4173_MAIUINTREG);
-	spin_unlock_irqrestore(&desc->lock, flags);
-}
-
-EXPORT_SYMBOL(vrc4173_enable_aiuint);
-
-void vrc4173_disable_aiuint(uint16_t mask)
-{
-	struct irq_desc *desc = irq_desc + VRC4173_AIU_IRQ;
-	unsigned long flags;
-	uint16_t val;
-
-	spin_lock_irqsave(&desc->lock, flags);
-	val = vrc4173_inw(VRC4173_MAIUINTREG);
-	val &= ~mask;
-	vrc4173_outw(val, VRC4173_MAIUINTREG);
-	spin_unlock_irqrestore(&desc->lock, flags);
-}
-
-EXPORT_SYMBOL(vrc4173_disable_aiuint);
-
-void vrc4173_enable_kiuint(uint16_t mask)
-{
-	struct irq_desc *desc = irq_desc + VRC4173_KIU_IRQ;
-	unsigned long flags;
-	uint16_t val;
-
-	spin_lock_irqsave(&desc->lock, flags);
-	val = vrc4173_inw(VRC4173_MKIUINTREG);
-	val |= mask;
-	vrc4173_outw(val, VRC4173_MKIUINTREG);
-	spin_unlock_irqrestore(&desc->lock, flags);
-}
-
-EXPORT_SYMBOL(vrc4173_enable_kiuint);
-
-void vrc4173_disable_kiuint(uint16_t mask)
-{
-	struct irq_desc *desc = irq_desc + VRC4173_KIU_IRQ;
-	unsigned long flags;
-	uint16_t val;
-
-	spin_lock_irqsave(&desc->lock, flags);
-	val = vrc4173_inw(VRC4173_MKIUINTREG);
-	val &= ~mask;
-	vrc4173_outw(val, VRC4173_MKIUINTREG);
-	spin_unlock_irqrestore(&desc->lock, flags);
-}
-
-EXPORT_SYMBOL(vrc4173_disable_kiuint);
-
-static void enable_vrc4173_irq(unsigned int irq)
-{
-	uint16_t val;
-
-	val = vrc4173_inw(VRC4173_MSYSINT1REG);
-	val |= (uint16_t)1 << (irq - VRC4173_IRQ_BASE);
-	vrc4173_outw(val, VRC4173_MSYSINT1REG);
-}
-
-static void disable_vrc4173_irq(unsigned int irq)
-{
-	uint16_t val;
-
-	val = vrc4173_inw(VRC4173_MSYSINT1REG);
-	val &= ~((uint16_t)1 << (irq - VRC4173_IRQ_BASE));
-	vrc4173_outw(val, VRC4173_MSYSINT1REG);
-}
-
-static unsigned int startup_vrc4173_irq(unsigned int irq)
-{
-	enable_vrc4173_irq(irq);
-	return 0; /* never anything pending */
-}
-
-#define shutdown_vrc4173_irq	disable_vrc4173_irq
-#define ack_vrc4173_irq		disable_vrc4173_irq
-
-static void end_vrc4173_irq(unsigned int irq)
-{
-	if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
-		enable_vrc4173_irq(irq);
-}
-
-static struct irq_chip vrc4173_irq_type = {
-	.typename	= "VRC4173",
-	.startup	= startup_vrc4173_irq,
-	.shutdown	= shutdown_vrc4173_irq,
-	.enable		= enable_vrc4173_irq,
-	.disable	= disable_vrc4173_irq,
-	.ack		= ack_vrc4173_irq,
-	.end		= end_vrc4173_irq,
-};
-
-static int vrc4173_get_irq_number(int irq)
-{
-	uint16_t status, mask;
-	int i;
-
-        status = vrc4173_inw(VRC4173_SYSINT1REG);
-        mask = vrc4173_inw(VRC4173_MSYSINT1REG);
-
-	status &= mask;
-	if (status) {
-		for (i = 0; i < 16; i++)
-			if (status & (0x0001 << i))
-				return VRC4173_IRQ(i);
-	}
-
-	return -EINVAL;
-}
-
-static inline int vrc4173_icu_init(int cascade_irq)
-{
-	int i;
-
-	if (cascade_irq < GIU_IRQ(0) || cascade_irq > GIU_IRQ(15))
-		return -EINVAL;
-
-	vrc4173_outw(0, VRC4173_MSYSINT1REG);
-
-	vr41xx_set_irq_trigger(GIU_IRQ_TO_PIN(cascade_irq), TRIGGER_LEVEL, SIGNAL_THROUGH);
-	vr41xx_set_irq_level(GIU_IRQ_TO_PIN(cascade_irq), LEVEL_LOW);
-
-	for (i = VRC4173_IRQ_BASE; i <= VRC4173_IRQ_LAST; i++)
-                irq_desc[i].chip = &vrc4173_irq_type;
-
-	return 0;
-}
-
-static int __devinit vrc4173_probe(struct pci_dev *dev,
-                                   const struct pci_device_id *id)
-{
-	unsigned long start, flags;
-	int err;
-
-	err = pci_enable_device(dev);
-	if (err < 0) {
-		printk(KERN_ERR "vrc4173: Failed to enable PCI device, aborting\n");
-		return err;
-	}
-
-	pci_set_master(dev);
-
-	start = pci_resource_start(dev, 0);
-	if (start == 0) {
-		printk(KERN_ERR "vrc4173:No such PCI I/O resource, aborting\n");
-		return -ENXIO;
-	}
-
-	flags = pci_resource_flags(dev, 0);
-	if ((flags & IORESOURCE_IO) == 0) {
-		printk(KERN_ERR "vrc4173: No such PCI I/O resource, aborting\n");
-		return -ENXIO;
-	}
-
-	err = pci_request_regions(dev, "NEC VRC4173");
-	if (err < 0) {
-		printk(KERN_ERR "vrc4173: PCI resources are busy, aborting\n");
-		return err;
-	}
-
-	set_vrc4173_io_offset(start);
-
-	vrc4173_cmu_init();
-	vrc4173_giu_init();
-
-	err = vrc4173_icu_init(dev->irq);
-	if (err < 0) {
-		printk(KERN_ERR "vrc4173: Invalid IRQ %d, aborting\n", dev->irq);
-		return err;
-	}
-
-	err = vr41xx_cascade_irq(dev->irq, vrc4173_get_irq_number);
-	if (err < 0) {
-		printk(KERN_ERR "vrc4173: IRQ resource %d is busy, aborting\n", dev->irq);
-		return err;
-	}
-
-	printk(KERN_INFO
-	       "NEC VRC4173 at 0x%#08lx, IRQ is cascaded to %d\n", start, dev->irq);
-
-	return 0;
-}
-
-static void vrc4173_remove(struct pci_dev *dev)
-{
-	free_irq(dev->irq, NULL);
-
-	pci_release_regions(dev);
-}
-
-static struct pci_driver vrc4173_driver = {
-	.name		= "NEC VRC4173",
-	.probe		= vrc4173_probe,
-	.remove		= vrc4173_remove,
-	.id_table	= vrc4173_id_table,
-};
-
-static int __devinit vrc4173_init(void)
-{
-	int err;
-
-	err = pci_register_driver(&vrc4173_driver);
-	if (err < 0)
-		return err;
-
-	vrc4173_initialized = 1;
-
-	return 0;
-}
-
-static void __devexit vrc4173_exit(void)
-{
-	vrc4173_initialized = 0;
-
-	pci_unregister_driver(&vrc4173_driver);
-}
-
-module_init(vrc4173_init);
-module_exit(vrc4173_exit);
diff -pruN -X mips/Documentation/dontdiff mips-orig/include/asm-mips/vr41xx/vrc4173.h mips/include/asm-mips/vr41xx/vrc4173.h
--- mips-orig/include/asm-mips/vr41xx/vrc4173.h	2006-07-12 13:51:13.825981500 +0900
+++ mips/include/asm-mips/vr41xx/vrc4173.h	1970-01-01 09:00:00.000000000 +0900
@@ -1,201 +0,0 @@
-/*
- *  vrc4173.h, Include file for NEC VRC4173.
- *
- *  Copyright (C) 2000  Michael R. McDonald
- *  Copyright (C) 2001-2003 Montavista Software Inc.
- *    Author: Yoichi Yuasa <yyuasa@mvista.com, or source@mvista.com>
- *  Copyright (C) 2004  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
- *  Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __NEC_VRC4173_H
-#define __NEC_VRC4173_H
-
-#include <asm/io.h>
-
-/*
- * PCI I/O accesses
- */
-#ifdef CONFIG_VRC4173
-
-extern unsigned long vrc4173_io_offset;
-
-#define set_vrc4173_io_offset(offset)	do { vrc4173_io_offset = (offset); } while (0)
-
-#define vrc4173_outb(val,port)		outb((val), vrc4173_io_offset+(port))
-#define vrc4173_outw(val,port)		outw((val), vrc4173_io_offset+(port))
-#define vrc4173_outl(val,port)		outl((val), vrc4173_io_offset+(port))
-#define vrc4173_outb_p(val,port)	outb_p((val), vrc4173_io_offset+(port))
-#define vrc4173_outw_p(val,port)	outw_p((val), vrc4173_io_offset+(port))
-#define vrc4173_outl_p(val,port)	outl_p((val), vrc4173_io_offset+(port))
-
-#define vrc4173_inb(port)		inb(vrc4173_io_offset+(port))
-#define vrc4173_inw(port)		inw(vrc4173_io_offset+(port))
-#define vrc4173_inl(port)		inl(vrc4173_io_offset+(port))
-#define vrc4173_inb_p(port)		inb_p(vrc4173_io_offset+(port))
-#define vrc4173_inw_p(port)		inw_p(vrc4173_io_offset+(port))
-#define vrc4173_inl_p(port)		inl_p(vrc4173_io_offset+(port))
-
-#define vrc4173_outsb(port,addr,count)	outsb(vrc4173_io_offset+(port),(addr),(count))
-#define vrc4173_outsw(port,addr,count)	outsw(vrc4173_io_offset+(port),(addr),(count))
-#define vrc4173_outsl(port,addr,count)	outsl(vrc4173_io_offset+(port),(addr),(count))
-
-#define vrc4173_insb(port,addr,count)	insb(vrc4173_io_offset+(port),(addr),(count))
-#define vrc4173_insw(port,addr,count)	insw(vrc4173_io_offset+(port),(addr),(count))
-#define vrc4173_insl(port,addr,count)	insl(vrc4173_io_offset+(port),(addr),(count))
-
-#else
-
-#define set_vrc4173_io_offset(offset)	do {} while (0)
-
-#define vrc4173_outb(val,port)		do {} while (0)
-#define vrc4173_outw(val,port)		do {} while (0)
-#define vrc4173_outl(val,port)		do {} while (0)
-#define vrc4173_outb_p(val,port)	do {} while (0)
-#define vrc4173_outw_p(val,port)	do {} while (0)
-#define vrc4173_outl_p(val,port)	do {} while (0)
-
-#define vrc4173_inb(port)		0
-#define vrc4173_inw(port)		0
-#define vrc4173_inl(port)		0
-#define vrc4173_inb_p(port)		0
-#define vrc4173_inw_p(port)		0
-#define vrc4173_inl_p(port)		0
-
-#define vrc4173_outsb(port,addr,count)	do {} while (0)
-#define vrc4173_outsw(port,addr,count)	do {} while (0)
-#define vrc4173_outsl(port,addr,count)	do {} while (0)
-
-#define vrc4173_insb(port,addr,count)	do {} while (0)
-#define vrc4173_insw(port,addr,count)	do {} while (0)
-#define vrc4173_insl(port,addr,count)	do {} while (0)
-
-#endif
-
-/*
- * Clock Mask Unit
- */
-typedef enum vrc4173_clock {
-	VRC4173_PIU_CLOCK,
-	VRC4173_KIU_CLOCK,
-	VRC4173_AIU_CLOCK,
-	VRC4173_PS2_CH1_CLOCK,
-	VRC4173_PS2_CH2_CLOCK,
-	VRC4173_USBU_PCI_CLOCK,
-	VRC4173_CARDU1_PCI_CLOCK,
-	VRC4173_CARDU2_PCI_CLOCK,
-	VRC4173_AC97U_PCI_CLOCK,
-	VRC4173_USBU_48MHz_CLOCK,
-	VRC4173_EXT_48MHz_CLOCK,
-	VRC4173_48MHz_CLOCK,
-} vrc4173_clock_t;
-
-#ifdef CONFIG_VRC4173
-
-extern void vrc4173_supply_clock(vrc4173_clock_t clock);
-extern void vrc4173_mask_clock(vrc4173_clock_t clock);
-
-#else
-
-static inline void vrc4173_supply_clock(vrc4173_clock_t clock) {}
-static inline void vrc4173_mask_clock(vrc4173_clock_t clock) {}
-
-#endif
-
-/*
- * Interupt Control Unit
- */
-
-#define VRC4173_PIUINT_COMMAND		0x0040
-#define VRC4173_PIUINT_DATA		0x0020
-#define VRC4173_PIUINT_PAGE1		0x0010
-#define VRC4173_PIUINT_PAGE0		0x0008
-#define VRC4173_PIUINT_DATALOST		0x0004
-#define VRC4173_PIUINT_STATUSCHANGE	0x0001
-
-#ifdef CONFIG_VRC4173
-
-extern void vrc4173_enable_piuint(uint16_t mask);
-extern void vrc4173_disable_piuint(uint16_t mask);
-
-#else
-
-static inline void vrc4173_enable_piuint(uint16_t mask) {}
-static inline void vrc4173_disable_piuint(uint16_t mask) {}
-
-#endif
-
-#define VRC4173_AIUINT_INPUT_DMAEND	0x0800
-#define VRC4173_AIUINT_INPUT_DMAHALT	0x0400
-#define VRC4173_AIUINT_INPUT_DATALOST	0x0200
-#define VRC4173_AIUINT_INPUT_DATA	0x0100
-#define VRC4173_AIUINT_OUTPUT_DMAEND	0x0008
-#define VRC4173_AIUINT_OUTPUT_DMAHALT	0x0004
-#define VRC4173_AIUINT_OUTPUT_NODATA	0x0002
-
-#ifdef CONFIG_VRC4173
-
-extern void vrc4173_enable_aiuint(uint16_t mask);
-extern void vrc4173_disable_aiuint(uint16_t mask);
-
-#else
-
-static inline void vrc4173_enable_aiuint(uint16_t mask) {}
-static inline void vrc4173_disable_aiuint(uint16_t mask) {}
-
-#endif
-
-#define VRC4173_KIUINT_DATALOST		0x0004
-#define VRC4173_KIUINT_DATAREADY	0x0002
-#define VRC4173_KIUINT_SCAN		0x0001
-
-#ifdef CONFIG_VRC4173
-
-extern void vrc4173_enable_kiuint(uint16_t mask);
-extern void vrc4173_disable_kiuint(uint16_t mask);
-
-#else
-
-static inline void vrc4173_enable_kiuint(uint16_t mask) {}
-static inline void vrc4173_disable_kiuint(uint16_t mask) {}
-
-#endif
-
-/*
- * General-Purpose I/O Unit
- */
-typedef enum vrc4173_function {
-	PS2_CHANNEL1,
-	PS2_CHANNEL2,
-	TOUCHPANEL,
-	KEYBOARD_8SCANLINES,
-	KEYBOARD_10SCANLINES,
-	KEYBOARD_12SCANLINES,
-	GPIO_0_15PINS,
-	GPIO_16_20PINS,
-} vrc4173_function_t;
-
-#ifdef CONFIG_VRC4173
-
-extern void vrc4173_select_function(vrc4173_function_t function);
-
-#else
-
-static inline void vrc4173_select_function(vrc4173_function_t function) {}
-
-#endif
-
-#endif /* __NEC_VRC4173_H */

From yoichi_yuasa@tripeaks.co.jp Thu Jul 13 09:34:50 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Jul 2006 09:35:05 +0100 (BST)
Received: from mo30.po.2iij.net ([210.128.50.53]:22596 "EHLO mo30.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133571AbWGMId2 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Jul 2006 09:33:28 +0100
Received: by mo.po.2iij.net (mo30) id k6D8XQSc013158; Thu, 13 Jul 2006 17:33:26 +0900 (JST)
Received: from localhost.localdomain (65.126.232.202.bf.2iij.net [202.232.126.65])
	by mbox.po.2iij.net (mbox30) id k6D8XOTQ055077
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Thu, 13 Jul 2006 17:33:24 +0900 (JST)
Date:	Thu, 13 Jul 2006 17:33:24 +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: updated e55 setup function
Message-Id: <20060713173324.5499df36.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: 11980
X-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 updated the CASIO E55 setup function.
Please apply.

Yoichi

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

diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/vr41xx/casio-e55/setup.c mips/arch/mips/vr41xx/casio-e55/setup.c
--- mips-orig/arch/mips/vr41xx/casio-e55/setup.c	2006-07-12 12:13:07.314097500 +0900
+++ mips/arch/mips/vr41xx/casio-e55/setup.c	2006-07-12 15:31:40.894635500 +0900
@@ -1,7 +1,7 @@
 /*
  *  setup.c, Setup for the CASIO CASSIOPEIA E-11/15/55/65.
  *
- *  Copyright (C) 2002-2005  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+ *  Copyright (C) 2002-2006  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -21,13 +21,18 @@
 #include <linux/ioport.h>
 
 #include <asm/io.h>
-#include <asm/vr41xx/e55.h>
+
+#define E55_ISA_IO_BASE		0x1400c000
+#define E55_ISA_IO_SIZE		0x03ff4000
+#define E55_ISA_IO_START	0
+#define E55_ISA_IO_END		(E55_ISA_IO_SIZE - 1)
+#define E55_IO_PORT_BASE	KSEG1ADDR(E55_ISA_IO_BASE)
 
 static int __init casio_e55_setup(void)
 {
-	set_io_port_base(IO_PORT_BASE);
-	ioport_resource.start = IO_PORT_RESOURCE_START;
-	ioport_resource.end = IO_PORT_RESOURCE_END;
+	set_io_port_base(E55_IO_PORT_BASE);
+	ioport_resource.start = E55_ISA_IO_START;
+	ioport_resource.end = E55_ISA_IO_END;
 
 	return 0;
 }
diff -pruN -X mips/Documentation/dontdiff mips-orig/include/asm-mips/vr41xx/e55.h mips/include/asm-mips/vr41xx/e55.h
--- mips-orig/include/asm-mips/vr41xx/e55.h	2006-07-12 12:13:12.654431250 +0900
+++ mips/include/asm-mips/vr41xx/e55.h	1970-01-01 09:00:00.000000000 +0900
@@ -1,43 +0,0 @@
-/*
- *  e55.h, Include file for CASIO CASSIOPEIA E-10/15/55/65.
- *
- *  Copyright (C) 2002-2004  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __CASIO_E55_H
-#define __CASIO_E55_H
-
-#include <asm/addrspace.h>
-#include <asm/vr41xx/vr41xx.h>
-
-/*
- * Board specific address mapping
- */
-#define VR41XX_ISA_MEM_BASE		0x10000000
-#define VR41XX_ISA_MEM_SIZE		0x04000000
-
-/* VR41XX_ISA_IO_BASE includes offset from real base. */
-#define VR41XX_ISA_IO_BASE		0x1400c000
-#define VR41XX_ISA_IO_SIZE		0x03ff4000
-
-#define ISA_BUS_IO_BASE			0
-#define ISA_BUS_IO_SIZE			VR41XX_ISA_IO_SIZE
-
-#define IO_PORT_BASE			KSEG1ADDR(VR41XX_ISA_IO_BASE)
-#define IO_PORT_RESOURCE_START		ISA_BUS_IO_BASE
-#define IO_PORT_RESOURCE_END		(ISA_BUS_IO_BASE + ISA_BUS_IO_SIZE - 1)
-
-#endif /* __CASIO_E55_H */

From yoichi_yuasa@tripeaks.co.jp Thu Jul 13 09:35:38 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Jul 2006 09:35:58 +0100 (BST)
Received: from mo31.po.2iij.net ([210.128.50.54]:18955 "EHLO mo31.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133572AbWGMIdh (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Jul 2006 09:33:37 +0100
Received: by mo.po.2iij.net (mo31) id k6D8XZT4077358; Thu, 13 Jul 2006 17:33:35 +0900 (JST)
Received: from localhost.localdomain (65.126.232.202.bf.2iij.net [202.232.126.65])
	by mbox.po.2iij.net (mbox33) id k6D8XX3l062971
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Thu, 13 Jul 2006 17:33:33 +0900 (JST)
Date:	Thu, 13 Jul 2006 17:33:33 +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: updated workpad setup function
Message-Id: <20060713173333.2eddfd7d.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: 11981
X-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 updated the IBM WorkPad setup function.
Please apply.

Yoichi

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

diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/vr41xx/ibm-workpad/setup.c mips/arch/mips/vr41xx/ibm-workpad/setup.c
--- mips-orig/arch/mips/vr41xx/ibm-workpad/setup.c	2006-07-12 12:13:07.318097750 +0900
+++ mips/arch/mips/vr41xx/ibm-workpad/setup.c	2006-07-12 15:40:51.761062500 +0900
@@ -1,7 +1,7 @@
 /*
  *  setup.c, Setup for the IBM WorkPad z50.
  *
- *  Copyright (C) 2002-2005  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+ *  Copyright (C) 2002-2006  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -21,13 +21,18 @@
 #include <linux/ioport.h>
 
 #include <asm/io.h>
-#include <asm/vr41xx/workpad.h>
+
+#define WORKPAD_ISA_IO_BASE	0x15000000
+#define WORKPAD_ISA_IO_SIZE	0x03000000
+#define WORKPAD_ISA_IO_START	0
+#define WORKPAD_ISA_IO_END	(WORKPAD_ISA_IO_SIZE - 1)
+#define WORKPAD_IO_PORT_BASE	KSEG1ADDR(WORKPAD_ISA_IO_BASE)
 
 static int __init ibm_workpad_setup(void)
 {
-	set_io_port_base(IO_PORT_BASE);
-	ioport_resource.start = IO_PORT_RESOURCE_START;
-	ioport_resource.end = IO_PORT_RESOURCE_END;
+	set_io_port_base(WORKPAD_IO_PORT_BASE);
+	ioport_resource.start = WORKPAD_ISA_IO_START;
+	ioport_resource.end = WORKPAD_ISA_IO_END;
 
 	return 0;
 }
diff -pruN -X mips/Documentation/dontdiff mips-orig/include/asm-mips/vr41xx/workpad.h mips/include/asm-mips/vr41xx/workpad.h
--- mips-orig/include/asm-mips/vr41xx/workpad.h	2006-07-12 12:13:12.654431250 +0900
+++ mips/include/asm-mips/vr41xx/workpad.h	1970-01-01 09:00:00.000000000 +0900
@@ -1,43 +0,0 @@
-/*
- *  workpad.h, Include file for IBM WorkPad z50.
- *
- *  Copyright (C) 2002-2004  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __IBM_WORKPAD_H
-#define __IBM_WORKPAD_H
-
-#include <asm/addrspace.h>
-#include <asm/vr41xx/vr41xx.h>
-
-/*
- * Board specific address mapping
- */
-#define VR41XX_ISA_MEM_BASE		0x10000000
-#define VR41XX_ISA_MEM_SIZE		0x04000000
-
-/* VR41XX_ISA_IO_BASE includes offset from real base. */
-#define VR41XX_ISA_IO_BASE		0x15000000
-#define VR41XX_ISA_IO_SIZE		0x03000000
-
-#define ISA_BUS_IO_BASE			0
-#define ISA_BUS_IO_SIZE			VR41XX_ISA_IO_SIZE
-
-#define IO_PORT_BASE			KSEG1ADDR(VR41XX_ISA_IO_BASE)
-#define IO_PORT_RESOURCE_START		ISA_BUS_IO_BASE
-#define IO_PORT_RESOURCE_END		(ISA_BUS_IO_BASE + ISA_BUS_IO_SIZE - 1)
-
-#endif /* __IBM_WORKPAD_H */


From yoichi_yuasa@tripeaks.co.jp Thu Jul 13 09:36:27 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Jul 2006 09:36:44 +0100 (BST)
Received: from mo32.po.2iij.net ([210.128.50.17]:58437 "EHLO mo32.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133565AbWGMIeB (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Jul 2006 09:34:01 +0100
Received: by mo.po.2iij.net (mo32) id k6D8XvPU049591; Thu, 13 Jul 2006 17:33:57 +0900 (JST)
Received: from localhost.localdomain (65.126.232.202.bf.2iij.net [202.232.126.65])
	by mbox.po.2iij.net (mbox31) id k6D8Xuu0008549
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Thu, 13 Jul 2006 17:33:57 +0900 (JST)
Date:	Thu, 13 Jul 2006 17:33:56 +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 #indef __KERNEL__/#endif to vr41xx header
 files
Message-Id: <20060713173356.72ab52f1.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: 11982
X-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 #ifdef __KERNEL__/#endif to vr41xx header files.
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/giu.h mips/include/asm-mips/vr41xx/giu.h
--- mips-orig/include/asm-mips/vr41xx/giu.h	2006-07-12 12:13:12.654431250 +0900
+++ mips/include/asm-mips/vr41xx/giu.h	2006-07-12 15:59:14.834000250 +0900
@@ -20,6 +20,8 @@
 #ifndef __NEC_VR41XX_GIU_H
 #define __NEC_VR41XX_GIU_H
 
+#ifdef __KERNEL__
+
 typedef enum {
 	IRQ_TRIGGER_LEVEL,
 	IRQ_TRIGGER_EDGE,
@@ -66,4 +68,6 @@ typedef enum {
 
 extern int vr41xx_gpio_pullupdown(unsigned int pin, gpio_pull_t pull);
 
+#endif /* __KERNEL__ */
+
 #endif /* __NEC_VR41XX_GIU_H */
diff -pruN -X mips/Documentation/dontdiff mips-orig/include/asm-mips/vr41xx/pci.h mips/include/asm-mips/vr41xx/pci.h
--- mips-orig/include/asm-mips/vr41xx/pci.h	2006-07-12 12:13:12.654431250 +0900
+++ mips/include/asm-mips/vr41xx/pci.h	2006-07-12 15:59:14.834000250 +0900
@@ -20,6 +20,8 @@
 #ifndef __NEC_VR41XX_PCI_H
 #define __NEC_VR41XX_PCI_H
 
+#ifdef __KERNEL__
+
 #define PCI_MASTER_ADDRESS_MASK	0x7fffffffU
 
 struct pci_master_address_conversion {
@@ -87,4 +89,6 @@ struct pci_controller_unit_setup {
 
 extern void vr41xx_pciu_setup(struct pci_controller_unit_setup *setup);
 
+#endif /* __KERNEL__ */
+
 #endif /* __NEC_VR41XX_PCI_H */
diff -pruN -X mips/Documentation/dontdiff mips-orig/include/asm-mips/vr41xx/siu.h mips/include/asm-mips/vr41xx/siu.h
--- mips-orig/include/asm-mips/vr41xx/siu.h	2006-07-12 12:13:12.654431250 +0900
+++ mips/include/asm-mips/vr41xx/siu.h	2006-07-12 15:59:14.838000500 +0900
@@ -20,6 +20,8 @@
 #ifndef __NEC_VR41XX_SIU_H
 #define __NEC_VR41XX_SIU_H
 
+#ifdef __KERNEL__
+
 typedef enum {
 	SIU_INTERFACE_RS232C,
 	SIU_INTERFACE_IRDA,
@@ -47,4 +49,6 @@ typedef enum {
 
 extern void vr41xx_select_irda_module(irda_module_t module, irda_speed_t speed);
 
+#endif /* __KERNEL__ */
+
 #endif /* __NEC_VR41XX_SIU_H */
diff -pruN -X mips/Documentation/dontdiff mips-orig/include/asm-mips/vr41xx/vr41xx.h mips/include/asm-mips/vr41xx/vr41xx.h
--- mips-orig/include/asm-mips/vr41xx/vr41xx.h	2006-07-12 13:51:13.821981250 +0900
+++ mips/include/asm-mips/vr41xx/vr41xx.h	2006-07-12 15:59:14.838000500 +0900
@@ -42,6 +42,8 @@
 /* VR4133 0x00000c84- */
 #define PRID_VR4133		0x00000c84
 
+#ifdef __KERNEL__
+
 /*
  * Bus Control Uint
  */
@@ -143,4 +145,6 @@ extern void vr41xx_disable_csiint(uint16
 extern void vr41xx_enable_bcuint(void);
 extern void vr41xx_disable_bcuint(void);
 
+#endif /* __KERNEL__ */
+
 #endif /* __NEC_VR41XX_H */

From yoichi_yuasa@tripeaks.co.jp Thu Jul 13 09:37:15 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Jul 2006 09:37:30 +0100 (BST)
Received: from mo30.po.2iij.net ([210.128.50.53]:40986 "EHLO mo30.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133577AbWGMIeW (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Jul 2006 09:34:22 +0100
Received: by mo.po.2iij.net (mo30) id k6D8YHMq013604; Thu, 13 Jul 2006 17:34:17 +0900 (JST)
Received: from localhost.localdomain (65.126.232.202.bf.2iij.net [202.232.126.65])
	by mbox.po.2iij.net (mbox30) id k6D8YDIT057026
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Thu, 13 Jul 2006 17:34:13 +0900 (JST)
Date:	Thu, 13 Jul 2006 17:34:13 +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  screen_info build error about Qemu
Message-Id: <20060713173413.1e26694d.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: 11983
X-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 screen_info build error about Qemu.
Please apply.

Yoichi

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

diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/qemu/q-vga.c mips/arch/mips/qemu/q-vga.c
--- mips-orig/arch/mips/qemu/q-vga.c	2006-07-11 23:20:17.050899000 +0900
+++ mips/arch/mips/qemu/q-vga.c	2006-07-12 07:10:50.285183000 +0900
@@ -8,6 +8,7 @@
  * This will eventually go into the qemu firmware.
  */
 #include <linux/init.h>
+#include <linux/screen_info.h>
 #include <linux/tty.h>
 #include <asm/io.h>
 #include <video/vga.h>

From ralf@linux-mips.org Thu Jul 13 12:42:47 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Jul 2006 12:42:56 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:13534 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S8133649AbWGMLmr (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Jul 2006 12:42:47 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.6/8.13.4) with ESMTP id k6DBgmSO020964;
	Thu, 13 Jul 2006 12:42:48 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.6/8.13.6/Submit) id k6DBglV4020963;
	Thu, 13 Jul 2006 12:42:47 +0100
Date:	Thu, 13 Jul 2006 12:42:47 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Cc:	linux-mips <linux-mips@linux-mips.org>
Subject: Re: [PATCH] vr41xx: moved the IRQ numbers to asm-mips/vr41xx/irq.h
Message-ID: <20060713114246.GA20957@linux-mips.org>
References: <20060713173303.23f34127.yoichi_yuasa@tripeaks.co.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060713173303.23f34127.yoichi_yuasa@tripeaks.co.jp>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11984
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Thu, Jul 13, 2006 at 05:33:03PM +0900, Yoichi Yuasa wrote:

> This patch has moved the IRQ numbers to asm-mips/vr41xx/irq.h

Applied,

  Ralf

From ralf@linux-mips.org Thu Jul 13 12:43:23 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Jul 2006 12:43:37 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:16862 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S8133655AbWGMLnB (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Jul 2006 12:43:01 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.6/8.13.4) with ESMTP id k6DBh31i020990;
	Thu, 13 Jul 2006 12:43:03 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.6/8.13.6/Submit) id k6DBh3L5020989;
	Thu, 13 Jul 2006 12:43:03 +0100
Date:	Thu, 13 Jul 2006 12:43:03 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Cc:	linux-mips <linux-mips@linux-mips.org>
Subject: Re: [PATCH] vr41xx: removed old v2.4 VRC4173 driver
Message-ID: <20060713114303.GB20957@linux-mips.org>
References: <20060713173314.05685c76.yoichi_yuasa@tripeaks.co.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060713173314.05685c76.yoichi_yuasa@tripeaks.co.jp>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11985
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Thu, Jul 13, 2006 at 05:33:14PM +0900, Yoichi Yuasa wrote:

> This patch has removed the old v2.4 VRC4173 driver.

Applied,

  Ralf

From ralf@linux-mips.org Thu Jul 13 12:44:09 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Jul 2006 12:44:28 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:18398 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S8133642AbWGMLnP (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Jul 2006 12:43:15 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.6/8.13.4) with ESMTP id k6DBhHLo020996;
	Thu, 13 Jul 2006 12:43:17 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.6/8.13.6/Submit) id k6DBhH8A020995;
	Thu, 13 Jul 2006 12:43:17 +0100
Date:	Thu, 13 Jul 2006 12:43:17 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Cc:	linux-mips <linux-mips@linux-mips.org>
Subject: Re: [PATCH] vr41xx: updated e55 setup function
Message-ID: <20060713114317.GC20957@linux-mips.org>
References: <20060713173324.5499df36.yoichi_yuasa@tripeaks.co.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060713173324.5499df36.yoichi_yuasa@tripeaks.co.jp>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11986
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Thu, Jul 13, 2006 at 05:33:24PM +0900, Yoichi Yuasa wrote:

> This patch has updated the CASIO E55 setup function.

Applied,

  Ralf

From ralf@linux-mips.org Thu Jul 13 12:44:59 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Jul 2006 12:45:18 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:45790 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S8133649AbWGMLnb (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Jul 2006 12:43:31 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.6/8.13.4) with ESMTP id k6DBhW5M021028;
	Thu, 13 Jul 2006 12:43:32 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.6/8.13.6/Submit) id k6DBhWr6021027;
	Thu, 13 Jul 2006 12:43:32 +0100
Date:	Thu, 13 Jul 2006 12:43:32 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Cc:	linux-mips <linux-mips@linux-mips.org>
Subject: Re: [PATCH] vr41xx: updated workpad setup function
Message-ID: <20060713114332.GD20957@linux-mips.org>
References: <20060713173333.2eddfd7d.yoichi_yuasa@tripeaks.co.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060713173333.2eddfd7d.yoichi_yuasa@tripeaks.co.jp>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11987
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Thu, Jul 13, 2006 at 05:33:33PM +0900, Yoichi Yuasa wrote:

> This patch has updated the IBM WorkPad setup function.

Applied,

  Ralf

From ralf@linux-mips.org Thu Jul 13 12:45:48 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Jul 2006 12:46:07 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:19903 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S8133683AbWGMLnq (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Jul 2006 12:43:46 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.6/8.13.4) with ESMTP id k6DBhl75021034;
	Thu, 13 Jul 2006 12:43:47 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.6/8.13.6/Submit) id k6DBhlcA021033;
	Thu, 13 Jul 2006 12:43:47 +0100
Date:	Thu, 13 Jul 2006 12:43:47 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Cc:	linux-mips <linux-mips@linux-mips.org>
Subject: Re: [PATCH] fixed  screen_info build error about Qemu
Message-ID: <20060713114347.GE20957@linux-mips.org>
References: <20060713173413.1e26694d.yoichi_yuasa@tripeaks.co.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060713173413.1e26694d.yoichi_yuasa@tripeaks.co.jp>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11988
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Thu, Jul 13, 2006 at 05:34:13PM +0900, Yoichi Yuasa wrote:

> This patch has fixed screen_info build error about Qemu.

Applied,

  Ralf

From anemo@mba.ocn.ne.jp Thu Jul 13 15:00:38 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Jul 2006 15:00:47 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:6852 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133523AbWGMOAi (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Jul 2006 15:00:38 +0100
Received: from localhost (p7138-ipad202funabasi.chiba.ocn.ne.jp [222.146.78.138])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 6D140A9CD; Thu, 13 Jul 2006 23:00:30 +0900 (JST)
Date:	Thu, 13 Jul 2006 23:01:50 +0900 (JST)
Message-Id: <20060713.230150.07642847.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org, vagabon.xyz@gmail.com
Subject: [PATCH] sparsemem: fix crash in show_mem
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: 11989
X-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

Resend with proper subject. (old subject was "do not count pages in
holes with sparsemem"


With sparsemem, pfn should be checked by pfn_valid() before pfn_to_page().

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

diff --git a/arch/mips/mm/pgtable.c b/arch/mips/mm/pgtable.c
index 792c6eb..c93aa6c 100644
--- a/arch/mips/mm/pgtable.c
+++ b/arch/mips/mm/pgtable.c
@@ -15,6 +15,8 @@ #ifndef CONFIG_NEED_MULTIPLE_NODES  /* X
 	printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
 	pfn = max_mapnr;
 	while (pfn-- > 0) {
+		if (!pfn_valid(pfn))
+			continue;
 		page = pfn_to_page(pfn);
 		total++;
 		if (PageHighMem(page))


From ralf@linux-mips.org Thu Jul 13 15:15:16 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Jul 2006 15:15:24 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:1191 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S8133523AbWGMOPP (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Jul 2006 15:15:15 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.6/8.13.4) with ESMTP id k6DEFHWF026818;
	Thu, 13 Jul 2006 15:15:17 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.6/8.13.6/Submit) id k6DEFGIa026817;
	Thu, 13 Jul 2006 15:15:16 +0100
Date:	Thu, 13 Jul 2006 15:15:16 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Cc:	linux-mips <linux-mips@linux-mips.org>
Subject: Re: [PATCH] vr41xx: added #indef __KERNEL__/#endif to vr41xx header files
Message-ID: <20060713141516.GB24611@linux-mips.org>
References: <20060713173356.72ab52f1.yoichi_yuasa@tripeaks.co.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060713173356.72ab52f1.yoichi_yuasa@tripeaks.co.jp>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11990
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Thu, Jul 13, 2006 at 05:33:56PM +0900, Yoichi Yuasa wrote:

> This patch has added #ifdef __KERNEL__/#endif to vr41xx header files.

None of the include/asm-mips/vr41xx/ files touched by this patch is
listed in include/asm-mips/Kbuild for installation so I don't see why
protecting with #indef __KERNEL__ would make sense?

  Ralf

From ralf@linux-mips.org Thu Jul 13 15:21:45 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Jul 2006 15:21:54 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:11904 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S8133656AbWGMOVp (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Jul 2006 15:21:45 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.6/8.13.4) with ESMTP id k6DELk3m026963;
	Thu, 13 Jul 2006 15:21:46 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.6/8.13.6/Submit) id k6DELk6N026962;
	Thu, 13 Jul 2006 15:21:46 +0100
Date:	Thu, 13 Jul 2006 15:21:46 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Daniel Mack <daniel@caiaq.de>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] remove double entry of FB_AU1200 in drivers/video/Kconfig
Message-ID: <20060713142146.GC24611@linux-mips.org>
References: <B4CE0C51-47B5-4F72-8008-08549262B4F0@caiaq.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <B4CE0C51-47B5-4F72-8008-08549262B4F0@caiaq.de>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11991
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Sat, Jul 08, 2006 at 07:35:12PM +0200, Daniel Mack wrote:

I've sent an identical patch to Antonino, still waiting for him to apply
it.

  Ralf

From dusko.dobranic@micronasnit.com Thu Jul 13 15:49:28 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Jul 2006 15:49:37 +0100 (BST)
Received: from krt.tmd.ns.ac.yu ([147.91.177.65]:25322 "EHLO krt.neobee.net")
	by ftp.linux-mips.org with ESMTP id S8133643AbWGMOt2 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Jul 2006 15:49:28 +0100
Received: from localhost (localhost [127.0.0.1])
	by krt.neobee.net (8.12.7/8.12.7/SuSE Linux 0.6) with ESMTP id k6DGEntk018858
	for <linux-mips@linux-mips.org>; Thu, 13 Jul 2006 18:14:49 +0200
Received: from krt.neobee.net ([127.0.0.1])
 by localhost (krt.neobee.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP
 id 18071-08 for <linux-mips@linux-mips.org>;
 Thu, 13 Jul 2006 18:14:49 +0200 (CEST)
Received: from [192.168.0.91] ([192.168.0.91])
	by krt.neobee.net (8.12.7/8.12.7/SuSE Linux 0.6) with ESMTP id k6DGEiMQ018847
	for <linux-mips@linux-mips.org>; Thu, 13 Jul 2006 18:14:44 +0200
Message-ID: <44B65D71.7080905@micronasnit.com>
Date:	Thu, 13 Jul 2006 16:49:21 +0200
From:	Dusko Dobranic <dusko.dobranic@micronasnit.com>
User-Agent: Thunderbird 1.5.0.4 (X11/20060516)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: Suspend to RAM
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: by amavisd-new at krt.neobee.net
Return-Path: <dusko.dobranic@micronasnit.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: 11992
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dusko.dobranic@micronasnit.com
Precedence: bulk
X-list: linux-mips

Hi all,

Does anyone has successfully implemented Suspend to RAM feature on MIPS32R2?
How can I restart kernel after putting system to sleep?

Thanks

From giometti@enneenne.com Thu Jul 13 17:44:34 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Jul 2006 17:44:43 +0100 (BST)
Received: from 81-174-11-161.f5.ngi.it ([81.174.11.161]:18595 "EHLO
	gundam.enneenne.com") by ftp.linux-mips.org with ESMTP
	id S8133723AbWGMQoe (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 13 Jul 2006 17:44:34 +0100
Received: from giometti by gundam.enneenne.com with local (Exim 3.36 #1 (Debian))
	id 1G146a-00020q-00
	for <linux-mips@linux-mips.org>; Thu, 13 Jul 2006 18:32:00 +0200
Date:	Thu, 13 Jul 2006 18:32:00 +0200
From:	Rodolfo Giometti <giometti@linux.it>
To:	linux-mips@linux-mips.org
Subject: Problems after merge to 2.6.18-rc1
Message-ID: <20060713163200.GA7186@gundam.enneenne.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Organization: GNU/Linux Device Drivers, Embedded Systems and Courses
X-PGP-Key: gpg --keyserver keyserver.linux.it --recv-keys D25A5633
User-Agent: Mutt/1.5.5.1+cvs20040105i
Return-Path: <giometti@enneenne.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: 11993
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: giometti@linux.it
Precedence: bulk
X-list: linux-mips

Hello,

I just finished a (big) merge with linux-mips 2.6.18-rc1 and
my tree and at boot I get:

   Linux version 2.6.18-rc1-g2636fd13-dirty (giometti@gundam) (gcc version 3.4.3) #165 Thu Jul 13 18:13:26 CEST 2006
   CPU revision is: 02030204
   Board WWPC1000 version 1.0
   WWPC-setup: uC=off 
   (PRId 02030204) @ 396MHZ
   BCLK switching enabled!
   Determined physical RAM map:
    memory: 04000000 @ 00000000 (usable)
   Early serial console at AU 0x11100000 (options '115200')
   Determined physical RAM map:
    memory: 04000000 @ 00000000 (usable)
   Built 1 zonelists.  Total pages: 16384
   Kernel command line: wwpc=uc-off console=uart,au,0x11100000,115200 root=/dev/nfs rw nfsroot=192.168.32.254:/homemipsel/distro/debian ip=192.168.32.24:192.168.32.254::255.255.255.0:000:eth0:off
   Primary instruction cache 16kB, physically tagged, 4-way, linesize 32 bytes.
   Primary data cache 16kB, 4-way, linesize 32 bytes.
   Synthesized TLB refill handler (17 instructions).
   Synthesized TLB load handler fastpath (34 instructions).
   Synthesized TLB store handler fastpath (34 instructions).
   Synthesized TLB modify handler fastpath (33 instructions).
   PID hash table entries: 1024 (order: 10, 4096 bytes)
   calculating r4koff... 00182b80(1584000)
   CPU frequency 396.00 MHz
   Console: colour dummy device 80x25
   Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
   Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
   Bad page state in process 'swapper'
   page:810092a0 flags:0x00000000 mapping:00000000 mapcount:1 count:0
   Trying to fix it up, but a reboot is needed
   Backtrace:
   Call Trace:
    [<8015d91c>] bad_page+0x6c/0xac
    [<8015e4c0>] free_hot_cold_page+0x190/0x1ec
    [<8046099c>] free_all_bootmem_core+0x1ec/0x228
    [<80457110>] mem_init+0x4c/0x218
    [<80462a50>] inode_init_early+0x68/0xbc
    [<804657d8>] console_init+0x48/0x68
    [<80450824>] start_kernel+0x208/0x400
    [<8045081c>] start_kernel+0x200/0x400
    [<80450134>] unknown_bootoption+0x0/0x310

   Bad page state in process 'swapper'
   page:810092c0 flags:0x00000000 mapping:00000000 mapcount:1 count:0
   Trying to fix it up, but a reboot is needed
   ...

Suggestions? :)

Thanks,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

From daniel@caiaq.de Thu Jul 13 20:48:48 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Jul 2006 20:49:06 +0100 (BST)
Received: from p549F7879.dip.t-dialin.net ([84.159.120.121]:21455 "EHLO
	p549F7879.dip.t-dialin.net") by ftp.linux-mips.org with ESMTP
	id S8133433AbWGMTsb (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 13 Jul 2006 20:48:31 +0100
Received: from buzzloop.caiaq.de ([212.112.241.133]:59664 "EHLO
	buzzloop.caiaq.de") by lappi.linux-mips.net with ESMTP
	id S1099483AbWGMTUA (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 13 Jul 2006 21:20:00 +0200
Received: from localhost (localhost [127.0.0.1])
	by buzzloop.caiaq.de (Postfix) with ESMTP id A1F5B7F4028;
	Thu, 13 Jul 2006 21:19:22 +0200 (CEST)
Received: from buzzloop.caiaq.de ([127.0.0.1])
	by localhost (buzzloop [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 25499-08; Thu, 13 Jul 2006 21:19:22 +0200 (CEST)
Received: from [192.168.1.140] (port-83-236-238-37.static.qsc.de [83.236.238.37])
	(using TLSv1 with cipher RC4-SHA (128/128 bits))
	(No client certificate requested)
	by buzzloop.caiaq.de (Postfix) with ESMTP id 2F0827F4022;
	Thu, 13 Jul 2006 21:19:22 +0200 (CEST)
In-Reply-To: <20060713163200.GA7186@gundam.enneenne.com>
References: <20060713163200.GA7186@gundam.enneenne.com>
Mime-Version: 1.0 (Apple Message framework v752.2)
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed
Message-Id: <7B459115-48AE-4E49-877E-4DFFF46BD207@caiaq.de>
Cc:	linux-mips@linux-mips.org
Content-Transfer-Encoding: 7bit
X-Mailer: Apple Mail (2.752.2)
From:	Daniel Mack <daniel@caiaq.de>
Subject: Re: Problems after merge to 2.6.18-rc1
Date:	Thu, 13 Jul 2006 21:19:15 +0200
To:	Rodolfo Giometti <giometti@linux.it>
Return-Path: <daniel@caiaq.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: 11994
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: daniel@caiaq.de
Precedence: bulk
X-list: linux-mips

Hi,

On Jul 13, 2006, at 6:32 PM, Rodolfo Giometti wrote:

>    Call Trace:
>     [<8015d91c>] bad_page+0x6c/0xac
>     [<8015e4c0>] free_hot_cold_page+0x190/0x1ec
>     [<8046099c>] free_all_bootmem_core+0x1ec/0x228
>     [<80457110>] mem_init+0x4c/0x218
>     [<80462a50>] inode_init_early+0x68/0xbc
>     [<804657d8>] console_init+0x48/0x68
>     [<80450824>] start_kernel+0x208/0x400
>     [<8045081c>] start_kernel+0x200/0x400
>     [<80450134>] unknown_bootoption+0x0/0x310

Well, what might 'unknown_bootoption' be trying to tell you?
What boot options did you set?

Daniel




From ashlesha@kenati.com Thu Jul 13 23:54:31 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 13 Jul 2006 23:54:49 +0100 (BST)
Received: from [69.90.147.196] ([69.90.147.196]:4287 "EHLO mail.kenati.com")
	by ftp.linux-mips.org with ESMTP id S8133593AbWGMWyb (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 13 Jul 2006 23:54:31 +0100
Received: from [192.168.1.105] (adsl-71-130-109-177.dsl.snfc21.pacbell.net [71.130.109.177])
	by mail.kenati.com (Postfix) with ESMTP id 842F8E404D
	for <linux-mips@linux-mips.org>; Thu, 13 Jul 2006 16:07:47 -0700 (PDT)
Subject: BSP: for an AU1500 board.
From:	Ashlesha Shintre <ashlesha@kenati.com>
Reply-To: ashlesha@kenati.com
To:	linux-mips@linux-mips.org
Content-Type: text/plain
Date:	Thu, 13 Jul 2006 15:59:07 -0700
Message-Id: <1152831547.7681.14.camel@sandbar.kenati.com>
Mime-Version: 1.0
X-Mailer: Evolution 2.4.2.1 
Content-Transfer-Encoding: 7bit
Return-Path: <ashlesha@kenati.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: 11995
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ashlesha@kenati.com
Precedence: bulk
X-list: linux-mips

Hi,

I m working with an AU-1500 MIPS processor on the EncoreM3 board and my
task is to write board support packages for the same.  I am very much a
newbie to linux and embedded systems.

I m not entirely sure of the sequence in which i should start doing
things, but here is a rough roadmap: 

1) To create a config file appropriate to the board using menuconfig
2) Map the VIA southbridge
3) Adding IRQ Mappings
4) Integration and Debugging

First I decided to 'do' the configuration file, but I still havent got a
birdseye picture of how I should proceed.  Any pointers?

Also, when does the config file come into play during the bootup
process, and where will I find the addresses of different devices say on
the PCI bus (memory adds) that will need to be mapped at boottime?

Thanks,
Ashlesha.



From yoichi_yuasa@tripeaks.co.jp Fri Jul 14 01:43:09 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 14 Jul 2006 01:43:17 +0100 (BST)
Received: from mo31.po.2iij.net ([210.128.50.54]:2616 "EHLO mo31.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133737AbWGNAnJ (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 14 Jul 2006 01:43:09 +0100
Received: by mo.po.2iij.net (mo31) id k6E0h5r3064489; Fri, 14 Jul 2006 09:43:05 +0900 (JST)
Received: from localhost.localdomain (65.126.232.202.bf.2iij.net [202.232.126.65])
	by mbox.po.2iij.net (mbox30) id k6E0h3ID011958
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Fri, 14 Jul 2006 09:43:03 +0900 (JST)
Date:	Fri, 14 Jul 2006 09:43:03 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	yoichi_yuasa@tripeaks.co.jp, linux-mips@linux-mips.org
Subject: Re: [PATCH] vr41xx: added #indef __KERNEL__/#endif to vr41xx header
 files
Message-Id: <20060714094303.3b9cfab8.yoichi_yuasa@tripeaks.co.jp>
In-Reply-To: <20060713141516.GB24611@linux-mips.org>
References: <20060713173356.72ab52f1.yoichi_yuasa@tripeaks.co.jp>
	<20060713141516.GB24611@linux-mips.org>
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: 11996
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: yoichi_yuasa@tripeaks.co.jp
Precedence: bulk
X-list: linux-mips

Hi,

On Thu, 13 Jul 2006 15:15:16 +0100
Ralf Baechle <ralf@linux-mips.org> wrote:

> On Thu, Jul 13, 2006 at 05:33:56PM +0900, Yoichi Yuasa wrote:
> 
> > This patch has added #ifdef __KERNEL__/#endif to vr41xx header files.
> 
> None of the include/asm-mips/vr41xx/ files touched by this patch is
> listed in include/asm-mips/Kbuild for installation so I don't see why
> protecting with #indef __KERNEL__ would make sense?

I see how it is.
Thanks for your comment.

Yoichi

From anemo@mba.ocn.ne.jp Fri Jul 14 02:35:32 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 14 Jul 2006 02:35:40 +0100 (BST)
Received: from topsns2.toshiba-tops.co.jp ([202.230.225.126]:40884 "EHLO
	topsns2.toshiba-tops.co.jp") by ftp.linux-mips.org with ESMTP
	id S8133760AbWGNBfc (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 14 Jul 2006 02:35:32 +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; Fri, 14 Jul 2006 10:35:28 +0900
Received: from topsms.toshiba-tops.co.jp (localhost.localdomain [127.0.0.1])
	by localhost.toshiba-tops.co.jp (Postfix) with ESMTP id CEA3C20301;
	Fri, 14 Jul 2006 10:35:22 +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 C26851FF81;
	Fri, 14 Jul 2006 10:35:22 +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 k6E1ZLW0035361;
	Fri, 14 Jul 2006 10:35:22 +0900 (JST)
	(envelope-from anemo@mba.ocn.ne.jp)
Date:	Fri, 14 Jul 2006 10:35:21 +0900 (JST)
Message-Id: <20060714.103521.25910483.nemoto@toshiba-tops.co.jp>
To:	giometti@linux.it
Cc:	linux-mips@linux-mips.org
Subject: Re: Problems after merge to 2.6.18-rc1
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <20060713163200.GA7186@gundam.enneenne.com>
References: <20060713163200.GA7186@gundam.enneenne.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: 11997
X-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, 13 Jul 2006 18:32:00 +0200, Rodolfo Giometti <giometti@linux.it> wrote:
> I just finished a (big) merge with linux-mips 2.6.18-rc1 and
> my tree and at boot I get:
> 
>    Linux version 2.6.18-rc1-g2636fd13-dirty (giometti@gundam) (gcc version 3.4.3) #165 Thu Jul 13 18:13:26 CEST 2006
>    CPU revision is: 02030204
>    Board WWPC1000 version 1.0
>    WWPC-setup: uC=off 
>    (PRId 02030204) @ 396MHZ
>    BCLK switching enabled!
>    Determined physical RAM map:
>     memory: 04000000 @ 00000000 (usable)
>    Early serial console at AU 0x11100000 (options '115200')
>    Determined physical RAM map:
>     memory: 04000000 @ 00000000 (usable)
>    Built 1 zonelists.  Total pages: 16384

Two "Determined physycal RAM map:" line here.  If both were printed in
parse_cmdline_early() (i.e. parse_cmdline_early was called twice),
something is seriously broken.

---
Atsushi Nemoto

From ppopov@embeddedalley.com Fri Jul 14 07:03:31 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 14 Jul 2006 07:03:42 +0100 (BST)
Received: from smtp106.biz.mail.mud.yahoo.com ([68.142.200.254]:61788 "HELO
	smtp106.biz.mail.mud.yahoo.com") by ftp.linux-mips.org with SMTP
	id S8133497AbWGNGDb (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 14 Jul 2006 07:03:31 +0100
Received: (qmail 28648 invoked from network); 14 Jul 2006 06:03:25 -0000
Received: from unknown (HELO ?192.168.15.100?) (ppopov@embeddedalley.com@63.194.214.47 with plain)
  by smtp106.biz.mail.mud.yahoo.com with SMTP; 14 Jul 2006 06:03:24 -0000
Subject: Re: BSP: for an AU1500 board.
From:	Pete Popov <ppopov@embeddedalley.com>
Reply-To: ppopov@embeddedalley.com
To:	ashlesha@kenati.com
Cc:	linux-mips@linux-mips.org
In-Reply-To: <1152831547.7681.14.camel@sandbar.kenati.com>
References: <1152831547.7681.14.camel@sandbar.kenati.com>
Content-Type: text/plain
Organization: Embedded Alley Solutions, Inc
Date:	Thu, 13 Jul 2006 23:03:16 -0700
Message-Id: <1152856996.18840.106.camel@localhost.localdomain>
Mime-Version: 1.0
X-Mailer: Evolution 2.4.1 
Content-Transfer-Encoding: 7bit
Return-Path: <ppopov@embeddedalley.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 11998
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ppopov@embeddedalley.com
Precedence: bulk
X-list: linux-mips

On Thu, 2006-07-13 at 15:59 -0700, Ashlesha Shintre wrote:
> Hi,
> 
> I m working with an AU-1500 MIPS processor on the EncoreM3 board and my
> task is to write board support packages for the same.  I am very much a
> newbie to linux and embedded systems.
> 
> I m not entirely sure of the sequence in which i should start doing
> things, but here is a rough roadmap: 
> 
> 1) To create a config file appropriate to the board using menuconfig
> 2) Map the VIA southbridge
> 3) Adding IRQ Mappings
> 4) Integration and Debugging
> 
> First I decided to 'do' the configuration file, but I still havent got a
> birdseye picture of how I should proceed.  Any pointers?

You said newbie to Linux _and_ embedded systems. I'm not sure a new BSP
is the place to start. If you have access to a well supported embedded
board, start with that by rebuilding the kernel, booting it, and getting
familiar with making kernel changes.

Pete

> Also, when does the config file come into play during the bootup
> process, and where will I find the addresses of different devices say on
> the PCI bus (memory adds) that will need to be mapped at boottime?
> 
> Thanks,
> Ashlesha.
> 
> 
> 


From yoichi_yuasa@tripeaks.co.jp Fri Jul 14 08:29:39 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 14 Jul 2006 08:29:49 +0100 (BST)
Received: from mo31.po.2iij.net ([210.128.50.54]:6436 "EHLO mo31.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133365AbWGNH3j (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 14 Jul 2006 08:29:39 +0100
Received: by mo.po.2iij.net (mo31) id k6E7Ta9Z056434; Fri, 14 Jul 2006 16:29:36 +0900 (JST)
Received: from localhost.localdomain (65.126.232.202.bf.2iij.net [202.232.126.65])
	by mbox.po.2iij.net (mbox32) id k6E7TZNs064507
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Fri, 14 Jul 2006 16:29:35 +0900 (JST)
Date:	Fri, 14 Jul 2006 16:29:35 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	linux-usb-devel <linux-usb-devel@lists.sourceforge.net>
Cc:	linux-mips <linux-mips@linux-mips.org>
Subject: [PATCH] USB: removed a unbalanced #endif from ohci-au1xxx.c
Message-Id: <20060714162935.70502a98.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: 11999
X-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,

This patch has removed a unbalanced #endif from ohci-au1xxx.c .

Error message was:
In file included from drivers/usb/host/ohci-hcd.c:909:
drivers/usb/host/ohci-au1xxx.c:113:2: #endif without #if

Yoichi

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

diff -pruN -X 2.6.18-rc1/Documentation/dontdiff 2.6.18-rc1-orig/drivers/usb/host/ohci-au1xxx.c 2.6.18-rc1/drivers/usb/host/ohci-au1xxx.c
--- 2.6.18-rc1-orig/drivers/usb/host/ohci-au1xxx.c	2006-07-14 11:17:34.443211500 +0900
+++ 2.6.18-rc1/drivers/usb/host/ohci-au1xxx.c	2006-07-14 10:33:47.945949750 +0900
@@ -110,7 +110,6 @@ static void au1xxx_start_ohc(struct plat
 
 	printk(KERN_DEBUG __FILE__
 	": Clock to USB host has been enabled \n");
-#endif
 }
 
 static void au1xxx_stop_ohc(struct platform_device *dev)

From matej.kupljen@ultra.si Fri Jul 14 08:31:56 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 14 Jul 2006 08:32:04 +0100 (BST)
Received: from deliver-2.mx.triera.net ([213.161.0.32]:42908 "EHLO
	deliver-2.mx.triera.net") by ftp.linux-mips.org with ESMTP
	id S8133365AbWGNHby (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 14 Jul 2006 08:31:54 +0100
Received: from localhost (in-2.mx.triera.net [213.161.0.26])
	by deliver-2.mx.triera.net (Postfix) with ESMTP id D8AA2DB;
	Fri, 14 Jul 2006 09:31:44 +0200 (CEST)
Received: from smtp.triera.net (smtp.triera.net [213.161.0.30])
	by in-2.mx.triera.net (Postfix) with SMTP id AD2A51BC087;
	Fri, 14 Jul 2006 09:31:46 +0200 (CEST)
Received: from [192.168.80.1] (cmb58-52.dial-up.arnes.si [153.5.49.52])
	by smtp.triera.net (Postfix) with ESMTP id 50C081A18A5;
	Fri, 14 Jul 2006 09:31:46 +0200 (CEST)
Subject: Re: Suspend to RAM
From:	Matej Kupljen <matej.kupljen@ultra.si>
To:	Dusko Dobranic <dusko.dobranic@micronasnit.com>
Cc:	linux-mips@linux-mips.org
In-Reply-To: <44B65D71.7080905@micronasnit.com>
References: <44B65D71.7080905@micronasnit.com>
Content-Type: text/plain
Organization: Ultra d.o.o.
Date:	Fri, 14 Jul 2006 09:31:47 +0200
Message-Id: <1152862307.5876.6.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 2.6.1 
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: Triera AV Service
Return-Path: <matej.kupljen@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: 12000
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: matej.kupljen@ultra.si
Precedence: bulk
X-list: linux-mips

Hi

> Does anyone has successfully implemented Suspend to RAM feature on MIPS32R2?

We did that on the DB1200 board.

> How can I restart kernel after putting system to sleep?

Your bootloader should support this. U-Boot does, at least
for the Alchemy CPU. 
Look for the mails from the Rodolfo Giometti. He posted
patches to this mailing list and to the U-Boot mailing list
to support resume for the au1x00 CPU.

BR,
Matej


From domen.puncer@ultra.si Fri Jul 14 09:45:40 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 14 Jul 2006 09:45:51 +0100 (BST)
Received: from deliver-2.mx.triera.net ([213.161.0.32]:18086 "EHLO
	deliver-2.mx.triera.net") by ftp.linux-mips.org with ESMTP
	id S8133365AbWGNIpk (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 14 Jul 2006 09:45:40 +0100
Received: from localhost (in-1.mx.triera.net [213.161.0.25])
	by deliver-2.mx.triera.net (Postfix) with ESMTP id 35D51163;
	Fri, 14 Jul 2006 10:45:30 +0200 (CEST)
Received: from smtp.triera.net (smtp.triera.net [213.161.0.30])
	by in-1.mx.triera.net (Postfix) with SMTP id AF2BA1BC08E;
	Fri, 14 Jul 2006 10:45:31 +0200 (CEST)
Received: from localhost (unknown [213.161.20.162])
	by smtp.triera.net (Postfix) with ESMTP id D96C21A18C0;
	Fri, 14 Jul 2006 10:45:30 +0200 (CEST)
Date:	Fri, 14 Jul 2006 10:45:33 +0200
From:	Domen Puncer <domen.puncer@ultra.si>
To:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Cc:	linux-usb-devel <linux-usb-devel@lists.sourceforge.net>,
	linux-mips <linux-mips@linux-mips.org>,
	Daniel Mack <daniel@caiaq.de>
Subject: Re: [PATCH] USB: removed a unbalanced #endif from ohci-au1xxx.c
Message-ID: <20060714084533.GP31105@domen.ultra.si>
References: <20060714162935.70502a98.yoichi_yuasa@tripeaks.co.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060714162935.70502a98.yoichi_yuasa@tripeaks.co.jp>
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: 12001
X-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

On 14/07/06 16:29 +0900, Yoichi Yuasa wrote:
> Hi,
> 
> This patch has removed a unbalanced #endif from ohci-au1xxx.c .
> 
> Error message was:
> In file included from drivers/usb/host/ohci-hcd.c:909:
> drivers/usb/host/ohci-au1xxx.c:113:2: #endif without #if
> 
> Yoichi
> 
> Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
> 
> diff -pruN -X 2.6.18-rc1/Documentation/dontdiff 2.6.18-rc1-orig/drivers/usb/host/ohci-au1xxx.c 2.6.18-rc1/drivers/usb/host/ohci-au1xxx.c
> --- 2.6.18-rc1-orig/drivers/usb/host/ohci-au1xxx.c	2006-07-14 11:17:34.443211500 +0900
> +++ 2.6.18-rc1/drivers/usb/host/ohci-au1xxx.c	2006-07-14 10:33:47.945949750 +0900
> @@ -110,7 +110,6 @@ static void au1xxx_start_ohc(struct plat
>  
>  	printk(KERN_DEBUG __FILE__
>  	": Clock to USB host has been enabled \n");
> -#endif
>  }
>  
>  static void au1xxx_stop_ohc(struct platform_device *dev)

Looks right to me.

It looks like something went wrong with this patch
http://www.linux-mips.org/git?p=linux.git;a=commitdiff;h=d14feb5ee4a46218f92b21ed52338b64130a151b

Looks like ehci-au1xxx.c might also be affected.
Daniel?


	Domen

From giometti@enneenne.com Fri Jul 14 10:33:46 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 14 Jul 2006 10:33:56 +0100 (BST)
Received: from 81-174-11-161.f5.ngi.it ([81.174.11.161]:64917 "EHLO
	gundam.enneenne.com") by ftp.linux-mips.org with ESMTP
	id S8133769AbWGNJdq (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 14 Jul 2006 10:33:46 +0100
Received: from giometti by gundam.enneenne.com with local (Exim 3.36 #1 (Debian))
	id 1G1IVV-0002We-00; Fri, 14 Jul 2006 09:54:41 +0200
Date:	Fri, 14 Jul 2006 09:54:41 +0200
From:	Rodolfo Giometti <giometti@linux.it>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	linux-mips@linux-mips.org
Subject: Re: Problems after merge to 2.6.18-rc1
Message-ID: <20060714075441.GE7186@gundam.enneenne.com>
References: <20060713163200.GA7186@gundam.enneenne.com> <20060714.103521.25910483.nemoto@toshiba-tops.co.jp>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="at6+YcpfzWZg/htY"
Content-Disposition: inline
In-Reply-To: <20060714.103521.25910483.nemoto@toshiba-tops.co.jp>
Organization: GNU/Linux Device Drivers, Embedded Systems and Courses
X-PGP-Key: gpg --keyserver keyserver.linux.it --recv-keys D25A5633
User-Agent: Mutt/1.5.5.1+cvs20040105i
Return-Path: <giometti@enneenne.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: 12002
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: giometti@linux.it
Precedence: bulk
X-list: linux-mips


--at6+YcpfzWZg/htY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Jul 14, 2006 at 10:35:21AM +0900, Atsushi Nemoto wrote:
>=20
> Two "Determined physycal RAM map:" line here.  If both were printed in
> parse_cmdline_early() (i.e. parse_cmdline_early was called twice),
> something is seriously broken.

Yes, you was right. I fixed it! :)

However now I have another (strange) problem.

Attached you can find my patch to add power managament to the new
version of file "drivers/net/au1000_eth.c" that implements the
PHY-layer support.

Please, note the hack after the function mii_probe() called by
au1000_lowlevel_probe().

Kernel messages during suspend are:

   hostname:~# apm --suspend
   Stopping tasks: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D|
   au1xxx_pm_prepare: state =3D 3
    usbdev1.1_ep81: PM: suspend 0->2, parent 1-0:1.0 already 1
   warning! Serial console ttyS0 is not disabled in debug kernel mode
   au1xxx_pm_enter: state =3D 3
   au_sleep: reason -3 force 0 wakeup 100 ticks 3000
   au_sleep: Zzz...
   au_sleep: Yep!
   kobject_add failed for 0:1f with -EEXIST, don't try to register things w=
ith the same name in the same directory.
   Call Trace:
    [<80252ca8>] kobject_add+0x17c/0x1e0
    [<80252b98>] kobject_add+0x6c/0x1e0
    [<80292008>] device_add+0xc0/0x464
    [<80291ff4>] device_add+0xac/0x464
    [<802a2e64>] mdiobus_register+0x134/0x198
    [<802a3ac0>] au1000_lowlevel_probe+0x104/0x4b4
    [<802a58a4>] au1000_drv_resume+0x3c/0xc8
    [<80138978>] process_timeout+0x0/0x8
    [<80298610>] platform_resume+0x34/0x40
    [<8029bf7c>] resume_device+0x19c/0x200
    [<802528e4>] kobject_get+0x20/0x34
    [<8029391c>] __sysdev_resume+0xf0/0xf8
    [<80291da4>] get_device+0x20/0x34
    [<8029c1c4>] dpm_resume+0x1e4/0x3c0
    [<8029c3fc>] device_resume+0x5c/0x174
    [<80153848>] enter_state+0x290/0x314
    [<80153840>] enter_state+0x288/0x314
    [<8010e824>] apm_suspend+0x1c/0xa0
    [<80219750>] nfs_getattr+0x88/0xf8
    [<80219708>] nfs_getattr+0x40/0xf8
    [<8010eca8>] apm_ioctl+0x198/0x22c
    [<80110e84>] do_page_fault+0x364/0x3d0
    [<80110c24>] do_page_fault+0x104/0x3d0
    [<801a0d24>] do_ioctl+0x54/0x90
    [<801a0f6c>] vfs_ioctl+0x20c/0x394
    [<801b7950>] sync_inodes+0x20/0x54
    [<801a1144>] sys_ioctl+0x50/0x9c
    [<8010f66c>] stack_done+0x20/0x40
    [<8010f66c>] stack_done+0x20/0x40

   phy 31 failed to register
   au1000_eth_mii: probed
   eth0: 0:1f already attached
   eth0: Could not attach to PHY
   usb usb1: root hub lost power or was reset
   Restarting tasks... done
   au1xxx_pm_finish: state =3D 3
   hostname:~#

The first strange thing is that this time the kernel messages stop
after "au1xxx_pm_prepare: state =3D 3" and not after "au_sleep: Zzz..."
as before the merge! Maybe something as changed in serial console
magement?

The second strange thing is that _only_ calling the mii_probe()
the resume works correctly, otherwise the CPU loops forever
calling the au1000_lowlevel_probe() without showing the printk()
messages through the serial console. =3D:-o

Suggestions?

Ciao,

Rodolfo

--=20

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

--at6+YcpfzWZg/htY
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFEt03BQaTCYNJaVjMRAv0vAJ9Sc54wxXRcxL1ySlM1JcxMqpAatQCfU3ss
dTUEhUVllcl2cHUi/QVa04w=
=/HXw
-----END PGP SIGNATURE-----

--at6+YcpfzWZg/htY--

From giometti@enneenne.com Fri Jul 14 12:03:14 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 14 Jul 2006 12:03:22 +0100 (BST)
Received: from 81-174-11-161.f5.ngi.it ([81.174.11.161]:41877 "EHLO
	gundam.enneenne.com") by ftp.linux-mips.org with ESMTP
	id S8133763AbWGNLDO (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 14 Jul 2006 12:03:14 +0100
Received: from giometti by gundam.enneenne.com with local (Exim 3.36 #1 (Debian))
	id 1G1Jpi-00051Q-00; Fri, 14 Jul 2006 11:19:38 +0200
Date:	Fri, 14 Jul 2006 11:19:38 +0200
From:	Rodolfo Giometti <giometti@linux.it>
To:	Matej Kupljen <matej.kupljen@ultra.si>
Cc:	linux-mips@linux-mips.org
Subject: Re: Suspend to RAM
Message-ID: <20060714091937.GI7186@gundam.enneenne.com>
References: <44B65D71.7080905@micronasnit.com> <1152862307.5876.6.camel@localhost>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="PW0Eas8rCkcu1VkF"
Content-Disposition: inline
In-Reply-To: <1152862307.5876.6.camel@localhost>
Organization: GNU/Linux Device Drivers, Embedded Systems and Courses
X-PGP-Key: gpg --keyserver keyserver.linux.it --recv-keys D25A5633
User-Agent: Mutt/1.5.5.1+cvs20040105i
Return-Path: <giometti@enneenne.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: 12003
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: giometti@linux.it
Precedence: bulk
X-list: linux-mips


--PW0Eas8rCkcu1VkF
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Jul 14, 2006 at 09:31:47AM +0200, Matej Kupljen wrote:
>
> Look for the mails from the Rodolfo Giometti. He posted
> patches to this mailing list and to the U-Boot mailing list
> to support resume for the au1x00 CPU.

Look here:

   http://ftp.enneenne.com/pub/misc/au1100-patches/

however keep in mind that some patches are now obsolete...

Ciao,

Rodolfo

--=20

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

--PW0Eas8rCkcu1VkF
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD4DBQFEt2GpQaTCYNJaVjMRArDiAJdveFN0voFAD6hspof1aGH9ozKxAKC8jQ+k
/0EwVOfM7u29UqzGMaTYCg==
=6ZnB
-----END PGP SIGNATURE-----

--PW0Eas8rCkcu1VkF--

From giometti@enneenne.com Fri Jul 14 13:33:36 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 14 Jul 2006 13:33:47 +0100 (BST)
Received: from 81-174-11-161.f5.ngi.it ([81.174.11.161]:24037 "EHLO
	gundam.enneenne.com") by ftp.linux-mips.org with ESMTP
	id S3466309AbWGNMdg (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 14 Jul 2006 13:33:36 +0100
Received: from giometti by gundam.enneenne.com with local (Exim 3.36 #1 (Debian))
	id 1G1LE8-0007gL-00
	for <linux-mips@linux-mips.org>; Fri, 14 Jul 2006 12:48:56 +0200
Date:	Fri, 14 Jul 2006 12:48:56 +0200
From:	Rodolfo Giometti <giometti@linux.it>
To:	linux-mips@linux-mips.org
Subject: Re: Problems after merge to 2.6.18-rc1
Message-ID: <20060714104856.GJ7186@gundam.enneenne.com>
References: <20060713163200.GA7186@gundam.enneenne.com> <20060714.103521.25910483.nemoto@toshiba-tops.co.jp> <20060714075441.GE7186@gundam.enneenne.com>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="UlxN1C6awaFNesUv"
Content-Disposition: inline
In-Reply-To: <20060714075441.GE7186@gundam.enneenne.com>
Organization: GNU/Linux Device Drivers, Embedded Systems and Courses
X-PGP-Key: gpg --keyserver keyserver.linux.it --recv-keys D25A5633
User-Agent: Mutt/1.5.5.1+cvs20040105i
Return-Path: <giometti@enneenne.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: 12004
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: giometti@linux.it
Precedence: bulk
X-list: linux-mips


--UlxN1C6awaFNesUv
Content-Type: multipart/mixed; boundary="ZOudaV4lSIjFTlHv"
Content-Disposition: inline


--ZOudaV4lSIjFTlHv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Jul 14, 2006 at 09:54:41AM +0200, Rodolfo Giometti wrote:
>=20
> Attached you can find my patch to add power managament to the new

Sorry... :)

Ciao,

Rodolfo

--=20

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

--ZOudaV4lSIjFTlHv
Content-Type: text/x-csrc; charset=us-ascii
Content-Disposition: attachment; filename="patch-au1000_eth.c"
Content-Transfer-Encoding: quoted-printable

diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 55f6e3f..ff536c4 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -11,6 +11,8 @@
  * ioctls (SIOCGMIIPHY)
  * Copyright 2006 Herbert Valerio Riedel <hvr@gnu.org>
  *  converted to use linux-2.6.x's PHY framework
+ * Copyright 2006 Rodolfo Giometti <giometti@linux.it>
+ *  power management, driver registration and module support.
  *
  * Author: MontaVista Software, Inc.
  *         	ppopov@mvista.com or source@mvista.com
@@ -61,6 +63,7 @@ #include <asm/irq.h>
 #include <asm/io.h>
 #include <asm/processor.h>
=20
+#include <linux/platform_device.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/cpu.h>
 #include "au1000_eth.h"
@@ -83,7 +86,8 @@ MODULE_LICENSE("GPL");
 // prototypes
 static void hard_stop(struct net_device *);
 static void enable_rx_tx(struct net_device *dev);
-static struct net_device * au1000_probe(int port_num);
+static int au1000_lowlevel_probe(struct net_device *ndev, void *ioaddr, vo=
id *macen_addr, int port_num, int skip_prom);
+static void au1000_lowlevel_remove(struct net_device *ndev);
 static int au1000_init(struct net_device *);
 static int au1000_open(struct net_device *);
 static int au1000_close(struct net_device *);
@@ -520,59 +524,6 @@ setup_hw_rings(struct au1000_private *au
 	}
 }
=20
-static struct {
-	u32 base_addr;
-	u32 macen_addr;
-	int irq;
-	struct net_device *dev;
-} iflist[2] =3D {
-#ifdef CONFIG_SOC_AU1000
-	{AU1000_ETH0_BASE, AU1000_MAC0_ENABLE, AU1000_MAC0_DMA_INT},
-	{AU1000_ETH1_BASE, AU1000_MAC1_ENABLE, AU1000_MAC1_DMA_INT}
-#endif
-#ifdef CONFIG_SOC_AU1100
-	{AU1100_ETH0_BASE, AU1100_MAC0_ENABLE, AU1100_MAC0_DMA_INT}
-#endif
-#ifdef CONFIG_SOC_AU1500
-	{AU1500_ETH0_BASE, AU1500_MAC0_ENABLE, AU1500_MAC0_DMA_INT},
-	{AU1500_ETH1_BASE, AU1500_MAC1_ENABLE, AU1500_MAC1_DMA_INT}
-#endif
-#ifdef CONFIG_SOC_AU1550
-	{AU1550_ETH0_BASE, AU1550_MAC0_ENABLE, AU1550_MAC0_DMA_INT},
-	{AU1550_ETH1_BASE, AU1550_MAC1_ENABLE, AU1550_MAC1_DMA_INT}
-#endif
-};
-
-static int num_ifs;
-
-/*
- * Setup the base address and interupt of the Au1xxx ethernet macs
- * based on cpu type and whether the interface is enabled in sys_pinfunc
- * register. The last interface is enabled if SYS_PF_NI2 (bit 4) is 0.
- */
-static int __init au1000_init_module(void)
-{
-	int ni =3D (int)((au_readl(SYS_PINFUNC) & (u32)(SYS_PF_NI2)) >> 4);
-	struct net_device *dev;
-	int i, found_one =3D 0;
-
-	num_ifs =3D NUM_ETH_INTERFACES - ni;
-
-	for(i =3D 0; i < num_ifs; i++) {
-		dev =3D au1000_probe(i);
-		iflist[i].dev =3D dev;
-		if (dev)
-			found_one++;
-	}
-	if (!found_one)
-		return -ENODEV;
-	return 0;
-}
-
-/*
- * ethtool operations
- */
-
 static int au1000_get_settings(struct net_device *dev, struct ethtool_cmd =
*cmd)
 {
 	struct au1000_private *aup =3D (struct au1000_private *)dev->priv;
@@ -615,48 +566,14 @@ static struct ethtool_ops au1000_ethtool
 	.get_link =3D ethtool_op_get_link,
 };
=20
-static struct net_device * au1000_probe(int port_num)
+static int=20
+au1000_lowlevel_probe(struct net_device *ndev, void *ioaddr, void *macen_a=
ddr, int port_num, int skip_prom)
 {
-	static unsigned version_printed =3D 0;
-	struct au1000_private *aup =3D NULL;
-	struct net_device *dev =3D NULL;
+	struct au1000_private *aup =3D ndev->priv;
 	db_dest_t *pDB, *pDBfree;
 	char *pmac, *argptr;
 	char ethaddr[6];
-	int irq, i, err;
-	u32 base, macen;
-
-	if (port_num >=3D NUM_ETH_INTERFACES)
- 		return NULL;
-
-	base  =3D CPHYSADDR(iflist[port_num].base_addr );
-	macen =3D CPHYSADDR(iflist[port_num].macen_addr);
-	irq =3D iflist[port_num].irq;
-
-	if (!request_mem_region( base, MAC_IOSIZE, "Au1x00 ENET") ||
-	    !request_mem_region(macen, 4, "Au1x00 ENET"))
-		return NULL;
-
-	if (version_printed++ =3D=3D 0)
-		printk("%s version %s %s\n", DRV_NAME, DRV_VERSION, DRV_AUTHOR);
-
-	dev =3D alloc_etherdev(sizeof(struct au1000_private));
-	if (!dev) {
-		printk(KERN_ERR "%s: alloc_etherdev failed\n", DRV_NAME);
-		return NULL;
-	}
-
-	if ((err =3D register_netdev(dev)) !=3D 0) {
-		printk(KERN_ERR "%s: Cannot register net device, error %d\n",
-				DRV_NAME, err);
-		free_netdev(dev);
-		return NULL;
-	}
-
-	printk("%s: Au1xx0 Ethernet found at 0x%x, irq %d\n",
-		dev->name, base, irq);
-
-	aup =3D dev->priv;
+	int i, ret;
=20
 	/* Allocate the data buffers */
 	/* Snooping works fine with eth on all au1xxx */
@@ -664,53 +581,62 @@ static struct net_device * au1000_probe(
 						(NUM_TX_BUFFS + NUM_RX_BUFFS),
 						&aup->dma_addr,	0);
 	if (!aup->vaddr) {
-		free_netdev(dev);
-		release_mem_region( base, MAC_IOSIZE);
-		release_mem_region(macen, 4);
-		return NULL;
+		printk(KERN_ERR "%s: cannot dma_alloc_noncoherent\n",
+		       ndev->name);
+		ret =3D -ENOMEM;
+		goto out;
 	}
=20
 	/* aup->mac is the base address of the MAC's registers */
-	aup->mac =3D (volatile mac_reg_t *)iflist[port_num].base_addr;
-
+	aup->mac =3D (volatile mac_reg_t *)((unsigned long)ioaddr);
 	/* Setup some variables for quick register address access */
-	aup->enable =3D (volatile u32 *)iflist[port_num].macen_addr;
-	aup->mac_id =3D port_num;
-	au_macs[port_num] =3D aup;
-
-	if (port_num =3D=3D 0) {
-		/* Check the environment variables first */
-		if (get_ethernet_addr(ethaddr) =3D=3D 0)
-			memcpy(au1000_mac_addr, ethaddr, sizeof(au1000_mac_addr));
-		else {
-			/* Check command line */
-			argptr =3D prom_getcmdline();
-			if ((pmac =3D strstr(argptr, "ethaddr=3D")) =3D=3D NULL)
-				printk(KERN_INFO "%s: No MAC address found\n",
-						 dev->name);
-				/* Use the hard coded MAC addresses */
-			else {
-				str2eaddr(ethaddr, pmac + strlen("ethaddr=3D"));
-				memcpy(au1000_mac_addr, ethaddr,=20
-				       sizeof(au1000_mac_addr));
+	if (port_num =3D=3D 0)
+	{
+		if (!skip_prom) {
+			/* check env variables first */
+			if (!get_ethernet_addr(ethaddr)) {=20
+				memcpy(au1000_mac_addr, ethaddr, sizeof(au1000_mac_addr));
+			} else {
+				/* Check command line */
+				argptr =3D prom_getcmdline();
+				if ((pmac =3D strstr(argptr, "ethaddr=3D")) =3D=3D NULL) {
+					printk(KERN_INFO "%s: No mac address found\n",=20
+							ndev->name);
+					/* use the hard coded mac addresses */
+				} else {
+					str2eaddr(ethaddr, pmac + strlen("ethaddr=3D"));
+					memcpy(au1000_mac_addr, ethaddr,=20
+							sizeof(au1000_mac_addr));
+				}
 			}
 		}
=20
+		aup->enable =3D (volatile u32 *) ((unsigned long) macen_addr);
+		memcpy(ndev->dev_addr, au1000_mac_addr, sizeof(au1000_mac_addr));
 		setup_hw_rings(aup, MAC0_RX_DMA_ADDR, MAC0_TX_DMA_ADDR);
-	} else if (port_num =3D=3D 1)
-		setup_hw_rings(aup, MAC1_RX_DMA_ADDR, MAC1_TX_DMA_ADDR);
+		aup->mac_id =3D 0;
+		au_macs[0] =3D aup;
+	}
+		else
+	if (port_num =3D=3D 1)
+	{
+		aup->enable =3D (volatile u32 *) ((unsigned long) macen_addr);
+		memcpy(ndev->dev_addr, au1000_mac_addr, sizeof(au1000_mac_addr));
+		ndev->dev_addr[5] +=3D 0x01;
=20
-	/*
-	 * Assign to the Ethernet ports two consecutive MAC addresses
-	 * to match those that are printed on their stickers
-	 */
-	memcpy(dev->dev_addr, au1000_mac_addr, sizeof(au1000_mac_addr));
-	dev->dev_addr[5] +=3D port_num;
+		setup_hw_rings(aup, MAC1_RX_DMA_ADDR, MAC1_TX_DMA_ADDR);
+		aup->mac_id =3D 1;
+		au_macs[1] =3D aup;
+	}
+	else
+	{
+		printk(KERN_ERR "%s: bad ioaddr\n", ndev->name);
+	}
=20
 	*aup->enable =3D 0;
 	aup->mac_enabled =3D 0;
=20
-	aup->mii_bus.priv =3D dev;
+	aup->mii_bus.priv =3D ndev;
 	aup->mii_bus.read =3D mdiobus_read;
 	aup->mii_bus.write =3D mdiobus_write;
 	aup->mii_bus.reset =3D mdiobus_reset;
@@ -733,8 +659,18 @@ # endif
 #endif
 	mdiobus_register(&aup->mii_bus);
=20
-	if (mii_probe(dev) !=3D 0) {
-		goto err_out;
+	if (mii_probe(ndev) !=3D 0) {
+		/* Hack, hack, hack!
+		 * This is needed during resume... you'll get a "Call Trace"
+		 * error message, but at least the wake up works...
+		 * Feel free to post a patch. :)
+		 *
+		 * Rodolfo Giometti
+		 * */
+		if (!skip_prom) {
+			ret =3D -EBUSY;
+			goto err_out;
+		}
 	}
=20
 	pDBfree =3D NULL;
@@ -752,6 +688,7 @@ #endif
 	for (i =3D 0; i < NUM_RX_DMA; i++) {
 		pDB =3D GetFreeDB(aup);
 		if (!pDB) {
+			ret =3D -ENOMEM;
 			goto err_out;
 		}
 		aup->rx_dma_ring[i]->buff_stat =3D (unsigned)pDB->dma_addr;
@@ -760,6 +697,7 @@ #endif
 	for (i =3D 0; i < NUM_TX_DMA; i++) {
 		pDB =3D GetFreeDB(aup);
 		if (!pDB) {
+			ret =3D -ENOMEM;
 			goto err_out;
 		}
 		aup->tx_dma_ring[i]->buff_stat =3D (unsigned)pDB->dma_addr;
@@ -767,31 +705,23 @@ #endif
 		aup->tx_db_inuse[i] =3D pDB;
 	}
=20
-	spin_lock_init(&aup->lock);
-	dev->base_addr =3D base;
-	dev->irq =3D irq;
-	dev->open =3D au1000_open;
-	dev->hard_start_xmit =3D au1000_tx;
-	dev->stop =3D au1000_close;
-	dev->get_stats =3D au1000_get_stats;
-	dev->set_multicast_list =3D &set_rx_mode;
-	dev->do_ioctl =3D &au1000_ioctl;
-	SET_ETHTOOL_OPS(dev, &au1000_ethtool_ops);
-	dev->tx_timeout =3D au1000_tx_timeout;
-	dev->watchdog_timeo =3D ETH_TX_TIMEOUT;
+	return 0;
=20
-	/*=20
-	 * The boot code uses the ethernet controller, so reset it to start=20
-	 * fresh.  au1000_init() expects that the device is in reset state.
-	 */
-	reset_mac(dev);
+err_out :
+	au1000_lowlevel_remove(ndev);
+out :
+	return ret;
+}
=20
-	return dev;
+static void
+au1000_lowlevel_remove(struct net_device *ndev)
+{
+	struct au1000_private *aup =3D ndev->priv;
+	int i;
=20
-err_out:
 	/* here we should have a valid dev plus aup-> register addresses
 	 * so we can reset the mac properly.*/
-	reset_mac(dev);
+	reset_mac(ndev);
=20
 	for (i =3D 0; i < NUM_RX_DMA; i++) {
 		if (aup->rx_db_inuse[i])
@@ -801,13 +731,10 @@ err_out:
 		if (aup->tx_db_inuse[i])
 			ReleaseDB(aup, aup->tx_db_inuse[i]);
 	}
-	dma_free_noncoherent(NULL, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS),
-			     (void *)aup->vaddr, aup->dma_addr);
-	unregister_netdev(dev);
-	free_netdev(dev);
-	release_mem_region( base, MAC_IOSIZE);
-	release_mem_region(macen, 4);
-	return NULL;
+	dma_free_noncoherent(NULL,
+			MAX_BUF_SIZE * (NUM_TX_BUFFS+NUM_RX_BUFFS),
+			(void *)aup->vaddr,
+			aup->dma_addr);
 }
=20
 /*=20
@@ -1009,38 +936,15 @@ static int au1000_close(struct net_devic
 	return 0;
 }
=20
-static void __exit au1000_cleanup_module(void)
-{
-	int i, j;
-	struct net_device *dev;
-	struct au1000_private *aup;
-
-	for (i =3D 0; i < num_ifs; i++) {
-		dev =3D iflist[i].dev;
-		if (dev) {
-			aup =3D (struct au1000_private *) dev->priv;
-			unregister_netdev(dev);
-			for (j =3D 0; j < NUM_RX_DMA; j++)
-				if (aup->rx_db_inuse[j])
-					ReleaseDB(aup, aup->rx_db_inuse[j]);
-			for (j =3D 0; j < NUM_TX_DMA; j++)
-				if (aup->tx_db_inuse[j])
-					ReleaseDB(aup, aup->tx_db_inuse[j]);
- 			dma_free_noncoherent(NULL, MAX_BUF_SIZE *
- 					     (NUM_TX_BUFFS + NUM_RX_BUFFS),
- 					     (void *)aup->vaddr, aup->dma_addr);
- 			release_mem_region(dev->base_addr, MAC_IOSIZE);
- 			release_mem_region(CPHYSADDR(iflist[i].macen_addr), 4);
-			free_netdev(dev);
-		}
-	}
-}
-
-static void update_tx_stats(struct net_device *dev, u32 status)
+static inline void
+update_tx_stats(struct net_device *dev, u32 status, u32 pkt_len)
 {
 	struct au1000_private *aup =3D (struct au1000_private *) dev->priv;
 	struct net_device_stats *ps =3D &aup->stats;
=20
+	ps->tx_packets++;
+	ps->tx_bytes +=3D pkt_len;
+
 	if (status & TX_FRAME_ABORTED) {
 		if (!aup->phy_dev || (DUPLEX_FULL =3D=3D aup->phy_dev->duplex)) {
 			if (status & (TX_JAB_TIMEOUT | TX_UNDERRUN)) {
@@ -1073,7 +977,7 @@ static void au1000_tx_ack(struct net_dev
 	ptxd =3D aup->tx_dma_ring[aup->tx_tail];
=20
 	while (ptxd->buff_stat & TX_T_DONE) {
-		update_tx_stats(dev, ptxd->status);
+		update_tx_stats(dev, ptxd->status, ptxd->len & 0x3ff);
 		ptxd->buff_stat &=3D ~TX_T_DONE;
 		ptxd->len =3D 0;
 		au_sync();
@@ -1095,7 +999,6 @@ static void au1000_tx_ack(struct net_dev
 static int au1000_tx(struct sk_buff *skb, struct net_device *dev)
 {
 	struct au1000_private *aup =3D (struct au1000_private *) dev->priv;
-	struct net_device_stats *ps =3D &aup->stats;
 	volatile tx_dma_t *ptxd;
 	u32 buff_stat;
 	db_dest_t *pDB;
@@ -1115,7 +1018,7 @@ static int au1000_tx(struct sk_buff *skb
 		return 1;
 	}
 	else if (buff_stat & TX_T_DONE) {
-		update_tx_stats(dev, ptxd->status);
+		update_tx_stats(dev, ptxd->status, ptxd->len & 0x3ff);
 		ptxd->len =3D 0;
 	}
=20
@@ -1135,9 +1038,6 @@ static int au1000_tx(struct sk_buff *skb
 	else
 		ptxd->len =3D skb->len;
=20
-	ps->tx_packets++;
-	ps->tx_bytes +=3D ptxd->len;
-
 	ptxd->buff_stat =3D pDB->dma_addr | TX_DMA_ENABLE;
 	au_sync();
 	dev_kfree_skb(skb);
@@ -1340,5 +1240,211 @@ static struct net_device_stats *au1000_g
 	return 0;
 }
=20
-module_init(au1000_init_module);
-module_exit(au1000_cleanup_module);
+/*
+ * Setup the base address and interupt of the Au1xxx ethernet macs
+ * based on cpu type and whether the interface is enabled in sys_pinfunc
+ * register. The last interface is enabled if SYS_PF_NI2 (bit 4) is 0.
+ */
+static int au1000_drv_probe(struct device *dev)
+{
+	struct platform_device *pdev =3D to_platform_device(dev);
+	struct net_device *ndev;
+	struct au1000_private *aup;
+	struct resource *res;
+	static unsigned version_printed =3D 0;
+	u32 base_addr_phys;
+	void *base_addr, *macen_addr;
+	int irq, ret;
+
+	/* Get the resource info */
+	res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "eth-base");
+	if (!res) {
+		ret =3D -ENODEV;
+		goto out;
+	}
+	base_addr_phys =3D res->start;
+	base_addr =3D ioremap(res->start, res->end - res->start);
+	if (!base_addr) {
+		printk (KERN_ERR "%s: unable to remap address %lx\n",
+		        DRV_NAME, (long unsigned int) res->start); =20
+		ret =3D -EINVAL;
+		goto out;
+	}
+	res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "eth-mac");
+	if (!res) {
+		ret =3D -ENODEV;
+		goto out_release_io;
+	}
+	macen_addr =3D ioremap(res->start, res->end - res->start);
+	if (!macen_addr) {
+		printk (KERN_ERR "%s: unable to remap address %lx\n",
+		        DRV_NAME, (long unsigned int) res->start); =20
+		ret =3D -ENOMEM;
+		goto out_release_io;
+	}
+	res =3D platform_get_resource_byname(pdev, IORESOURCE_IRQ, "eth-irq");
+	if (!res) {
+		ret =3D -ENODEV;
+		goto out_release_iomac;
+	}
+	irq =3D res->start;
+
+	if (version_printed++ =3D=3D 0)=20
+		printk("%s version %s %s\n", DRV_NAME, DRV_VERSION, DRV_AUTHOR);
+
+	ndev =3D alloc_etherdev(sizeof(struct au1000_private));
+	if (!ndev) {
+		printk (KERN_ERR "%s: alloc etherdev failed\n", DRV_NAME); =20
+		ret =3D -ENOMEM;
+		goto out_release_iomac;
+	}
+	SET_MODULE_OWNER(ndev);
+	SET_NETDEV_DEV(ndev, dev);
+
+	/* Force the device name to a know state... */
+	sprintf(ndev->name, "au1xxx_eth(%d)", pdev->id);
+	ret =3D au1000_lowlevel_probe(ndev, base_addr, macen_addr, pdev->id, 0);
+	if (ret < 0) {
+		printk (KERN_ERR "%s: low level probe failed\n", DRV_NAME); =20
+		goto out_free_netdev;
+	}
+	/* ...and then came back to a more standard name. */
+	strcpy(ndev->name, "eth%d");
+
+	aup =3D ndev->priv;
+
+	spin_lock_init(&aup->lock);
+	ndev->base_addr =3D base_addr_phys;
+	ndev->irq =3D irq;
+	ndev->open =3D au1000_open;
+	ndev->hard_start_xmit =3D au1000_tx;
+	ndev->stop =3D au1000_close;
+	ndev->get_stats =3D au1000_get_stats;
+	ndev->set_multicast_list =3D &set_rx_mode;
+	ndev->do_ioctl =3D &au1000_ioctl;
+	SET_ETHTOOL_OPS(ndev, &au1000_ethtool_ops);
+	ndev->tx_timeout =3D au1000_tx_timeout;
+	ndev->watchdog_timeo =3D ETH_TX_TIMEOUT;
+
+	/*=20
+	 * The boot code uses the ethernet controller, so reset it to start=20
+	 * fresh.  au1000_init() expects that the device is in reset state.
+	 */
+	reset_mac(ndev);
+
+	ret =3D register_netdev(ndev);
+	if (ret) {
+		printk(KERN_ERR "%s: cannot register net device err %d\n",
+		       DRV_NAME, ret);
+		goto out_lowlevel_remove;
+	}
+
+	printk("%s: Au1x Ethernet found at 0x%x, irq %d\n",=20
+			ndev->name, base_addr_phys, irq);
+
+	dev_set_drvdata(dev, ndev);
+
+	return 0;
+
+out_lowlevel_remove :
+	au1000_lowlevel_remove(ndev);
+out_free_netdev :
+	free_netdev(ndev);
+out_release_iomac :
+	iounmap(macen_addr);
+out_release_io :
+	iounmap(base_addr);
+out :
+	printk("%s: not found (%d).\n", DRV_NAME, ret);
+
+	return ret;
+}
+
+static int au1000_drv_remove(struct device *dev)
+{
+	struct net_device *ndev =3D dev_get_drvdata(dev);
+
+	dev_set_drvdata(dev, NULL);
+
+	unregister_netdev(ndev);
+	au1000_lowlevel_remove(ndev);
+	free_netdev(ndev);
+
+	return 0;
+}
+
+#ifdef CONFIG_PM
+static int au1000_drv_suspend(struct device *dev, pm_message_t state)
+{
+	struct net_device *ndev =3D dev_get_drvdata(dev);
+	struct au1000_private *aup;
+	struct phy_device *phydev;
+
+	if (!ndev)
+		return 0;
+
+	aup =3D (struct au1000_private *) ndev->priv;
+	phydev =3D aup->phy_dev;
+
+	if (netif_running(ndev))
+		netif_device_detach(ndev);
+
+	au1000_lowlevel_remove(ndev);
+
+	return 0;
+}
+
+static int au1000_drv_resume(struct device *dev)
+{
+	struct net_device *ndev =3D dev_get_drvdata(dev);
+	struct au1000_private *aup;
+	struct phy_device *phydev;
+	int ret;
+
+	if (!ndev)
+		return 0;
+
+	aup =3D (struct au1000_private *) ndev->priv;
+	phydev =3D aup->phy_dev;
+
+	ret =3D au1000_lowlevel_probe(ndev, (void *) aup->mac, (void *) aup->enab=
le, aup->mac_id, ~0);
+	if (ret < 0) {
+		printk (KERN_ERR "%s: low level probe failed\n", DRV_NAME); =20
+		return ret;
+	}
+
+	/* au1000_init() expects that the device is in reset state.
+	 */
+	reset_mac(ndev); /* au1000_init() expects the device in reset */
+	au1000_init(ndev);
+
+	if (netif_running(ndev))
+		netif_device_attach(ndev);
+
+	return 0;
+}
+#endif
+
+static struct device_driver au1000_driver =3D {
+	.name		=3D DRV_NAME,
+	.bus		=3D &platform_bus_type,
+	.probe          =3D au1000_drv_probe,
+	.remove         =3D au1000_drv_remove,
+#ifdef CONFIG_PM
+	.suspend        =3D au1000_drv_suspend,
+	.resume         =3D au1000_drv_resume,
+#endif
+};
+
+static int __init au1000_eth_init(void)
+{
+	return driver_register(&au1000_driver);
+}
+
+static void __exit au1000_eth_cleanup(void)
+{
+	driver_unregister(&au1000_driver);
+}
+
+module_init(au1000_eth_init);
+module_exit(au1000_eth_cleanup);

--ZOudaV4lSIjFTlHv--

--UlxN1C6awaFNesUv
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFEt3aYQaTCYNJaVjMRAs5vAJwJbRBber2dpll2Z1nmpeCrwl52IgCfb56f
ajekKdTFqnZTPBduWshjTRc=
=n6U3
-----END PGP SIGNATURE-----

--UlxN1C6awaFNesUv--

From daniel@caiaq.de Fri Jul 14 15:46:45 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 14 Jul 2006 15:46:54 +0100 (BST)
Received: from buzzloop.caiaq.de ([212.112.241.133]:21511 "EHLO
	buzzloop.caiaq.de") by ftp.linux-mips.org with ESMTP
	id S8133431AbWGNOqp (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 14 Jul 2006 15:46:45 +0100
Received: from localhost (localhost [127.0.0.1])
	by buzzloop.caiaq.de (Postfix) with ESMTP id A2C2A7F4028
	for <linux-mips@linux-mips.org>; Fri, 14 Jul 2006 16:46:40 +0200 (CEST)
Received: from buzzloop.caiaq.de ([127.0.0.1])
	by localhost (buzzloop [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 10801-03 for <linux-mips@linux-mips.org>;
	Fri, 14 Jul 2006 16:46:40 +0200 (CEST)
Received: from [192.168.1.100] (port-83-236-238-37.static.qsc.de [83.236.238.37])
	(using TLSv1 with cipher RC4-SHA (128/128 bits))
	(No client certificate requested)
	by buzzloop.caiaq.de (Postfix) with ESMTP id 31B1D7F4024
	for <linux-mips@linux-mips.org>; Fri, 14 Jul 2006 16:46:40 +0200 (CEST)
Mime-Version: 1.0 (Apple Message framework v752.2)
Content-Transfer-Encoding: 7bit
Message-Id: <8DE93A09-CFEB-47A1-A535-F02B7F32ADB6@caiaq.de>
Content-Type: text/plain; charset=US-ASCII; format=flowed
To:	linux-mips@linux-mips.org
From:	Daniel Mack <daniel@caiaq.de>
Subject: [PATCH] fix irq_chip struct for Pb1200/Db1200 platform
Date:	Fri, 14 Jul 2006 16:46:33 +0200
X-Mailer: Apple Mail (2.752.2)
Return-Path: <daniel@caiaq.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: 12005
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: daniel@caiaq.de
Precedence: bulk
X-list: linux-mips

Hi,

the following patch makes external interrupt sources work again
on AMD's Au1200 development boards. The unnamed initialization
of 'external_irq_type' lead to a defective function mapping.

Daniel


--- a/arch/mips/au1000/pb1200/irqmap.c
+++ b/arch/mips/au1000/pb1200/irqmap.c
@@ -151,18 +151,17 @@ static void pb1200_end_irq(unsigned int
static struct irq_chip external_irq_type =
{
#ifdef CONFIG_MIPS_PB1200
-       "Pb1200 Ext",
+       .name = "Pb1200 Ext",
#endif
#ifdef CONFIG_MIPS_DB1200
-       "Db1200 Ext",
+       .name = "Db1200 Ext",
#endif
-       pb1200_startup_irq,
-       pb1200_shutdown_irq,
-       pb1200_enable_irq,
-       pb1200_disable_irq,
-       pb1200_mask_and_ack_irq,
-       pb1200_end_irq,
-       NULL
+       .startup  = pb1200_startup_irq,
+       .shutdown = pb1200_shutdown_irq,
+       .enable   = pb1200_enable_irq,
+       .disable  = pb1200_disable_irq,
+       .mask_ack = pb1200_mask_and_ack_irq,
+       .end      = pb1200_end_irq
};
void _board_init_irq(void)




From daniel@caiaq.de Fri Jul 14 15:53:19 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 14 Jul 2006 15:53:28 +0100 (BST)
Received: from buzzloop.caiaq.de ([212.112.241.133]:3085 "EHLO
	buzzloop.caiaq.de") by ftp.linux-mips.org with ESMTP
	id S8133431AbWGNOxT (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 14 Jul 2006 15:53:19 +0100
Received: from localhost (localhost [127.0.0.1])
	by buzzloop.caiaq.de (Postfix) with ESMTP id 6DB9A7F4028
	for <linux-mips@linux-mips.org>; Fri, 14 Jul 2006 16:53:15 +0200 (CEST)
Received: from buzzloop.caiaq.de ([127.0.0.1])
	by localhost (buzzloop [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 10818-04 for <linux-mips@linux-mips.org>;
	Fri, 14 Jul 2006 16:53:15 +0200 (CEST)
Received: from [192.168.1.100] (port-83-236-238-37.static.qsc.de [83.236.238.37])
	(using TLSv1 with cipher RC4-SHA (128/128 bits))
	(No client certificate requested)
	by buzzloop.caiaq.de (Postfix) with ESMTP id 1DC9E7F4024
	for <linux-mips@linux-mips.org>; Fri, 14 Jul 2006 16:53:15 +0200 (CEST)
Mime-Version: 1.0 (Apple Message framework v752.2)
Content-Transfer-Encoding: 7bit
Message-Id: <2F5D781B-2119-4942-82C1-70B5037F5622@caiaq.de>
Content-Type: text/plain; charset=US-ASCII; format=flowed
To:	linux-mips@linux-mips.org
From:	Daniel Mack <daniel@caiaq.de>
Subject: [PATCH] fix irq_chip struct for Pb1200/Db1200 platform
Date:	Fri, 14 Jul 2006 16:53:11 +0200
X-Mailer: Apple Mail (2.752.2)
Return-Path: <daniel@caiaq.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: 12006
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: daniel@caiaq.de
Precedence: bulk
X-list: linux-mips

Hi,

the following patch makes external interrupt sources work again
on AMD's Au1200 development boards. The unnamed initialization
of 'external_irq_type' lead to a defective function mapping.

I resent it because of the missing Signed-off-by: line, sorry.

Daniel


Signed-off-by: Daniel Mack <daniel@caiaq.de>

--- a/arch/mips/au1000/pb1200/irqmap.c
+++ b/arch/mips/au1000/pb1200/irqmap.c
@@ -151,18 +151,17 @@ static void pb1200_end_irq(unsigned int
static struct irq_chip external_irq_type =
{
#ifdef CONFIG_MIPS_PB1200
-       "Pb1200 Ext",
+       .name = "Pb1200 Ext",
#endif
#ifdef CONFIG_MIPS_DB1200
-       "Db1200 Ext",
+       .name = "Db1200 Ext",
#endif
-       pb1200_startup_irq,
-       pb1200_shutdown_irq,
-       pb1200_enable_irq,
-       pb1200_disable_irq,
-       pb1200_mask_and_ack_irq,
-       pb1200_end_irq,
-       NULL
+       .startup  = pb1200_startup_irq,
+       .shutdown = pb1200_shutdown_irq,
+       .enable   = pb1200_enable_irq,
+       .disable  = pb1200_disable_irq,
+       .mask_ack = pb1200_mask_and_ack_irq,
+       .end      = pb1200_end_irq
};
void _board_init_irq(void)




From ralf@linux-mips.org Fri Jul 14 17:11:28 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 14 Jul 2006 17:11:36 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:16568 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S8133536AbWGNQL1 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 14 Jul 2006 17:11:27 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.6/8.13.4) with ESMTP id k6EGBS1N012564;
	Fri, 14 Jul 2006 17:11:28 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.6/8.13.6/Submit) id k6EGBS4B012563;
	Fri, 14 Jul 2006 17:11:28 +0100
Date:	Fri, 14 Jul 2006 17:11:28 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Daniel Mack <daniel@caiaq.de>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] fix irq_chip struct for Pb1200/Db1200 platform
Message-ID: <20060714161128.GB15427@linux-mips.org>
References: <2F5D781B-2119-4942-82C1-70B5037F5622@caiaq.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <2F5D781B-2119-4942-82C1-70B5037F5622@caiaq.de>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12007
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Fri, Jul 14, 2006 at 04:53:11PM +0200, Daniel Mack wrote:

> the following patch makes external interrupt sources work again
> on AMD's Au1200 development boards. The unnamed initialization
> of 'external_irq_type' lead to a defective function mapping.
> 
> I resent it because of the missing Signed-off-by: line, sorry.

Good - but this patch is still corrupted so doesn't apply, can you
resend with a non-broken mailer?

  Ralf

From Geoffrey.Levand@am.sony.com Fri Jul 14 20:52:34 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 14 Jul 2006 20:52:46 +0100 (BST)
Received: from outbound-kan.frontbridge.com ([63.161.60.23]:62127 "EHLO
	outbound1-kan-R.bigfish.com") by ftp.linux-mips.org with ESMTP
	id S8133768AbWGNTwe (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 14 Jul 2006 20:52:34 +0100
Received: from outbound1-kan.bigfish.com (localhost.localdomain [127.0.0.1])
	by outbound1-kan-R.bigfish.com (Postfix) with ESMTP id 75BD08057CE;
	Fri, 14 Jul 2006 19:52:27 +0000 (UTC)
Received: from mail55-kan-R.bigfish.com (unknown [172.18.7.1])
	by outbound1-kan.bigfish.com (Postfix) with ESMTP id 6E864804B9F;
	Fri, 14 Jul 2006 19:52:27 +0000 (UTC)
Received: from mail55-kan.bigfish.com (localhost.localdomain [127.0.0.1])
	by mail55-kan-R.bigfish.com (Postfix) with ESMTP id 640EC25E40F;
	Fri, 14 Jul 2006 19:52:27 +0000 (UTC)
X-BigFish: V
Received: by mail55-kan (MessageSwitch) id 1152906747361017_5997; Fri, 14 Jul 2006 19:52:27 +0000 (UCT)
Received: from mail8.fw-bc.sony.com (mail8.fw-bc.sony.com [160.33.98.75])
	(using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits))
	(No client certificate requested)
	by mail55-kan.bigfish.com (Postfix) with ESMTP id 42A3625E0F2;
	Fri, 14 Jul 2006 19:52:27 +0000 (UTC)
Received: from mail1.sgo.in.sel.sony.com (mail1.sgo.in.sel.sony.com [43.130.1.111])
	by mail8.fw-bc.sony.com (8.12.11/8.12.11) with ESMTP id k6EJqQu7014258;
	Fri, 14 Jul 2006 19:52:26 GMT
Received: from USSDIXIM01.am.sony.com (ussdixim01.am.sony.com [43.130.140.33])
	by mail1.sgo.in.sel.sony.com (8.12.11/8.12.11) with ESMTP id k6EJqPTQ021046;
	Fri, 14 Jul 2006 19:52:25 GMT
Received: from ussdixms03.am.sony.com ([43.130.140.23]) by USSDIXIM01.am.sony.com with Microsoft SMTPSVC(5.0.2195.6713);
	 Fri, 14 Jul 2006 12:52:25 -0700
Received: from [192.168.1.10] ([43.134.85.105]) by ussdixms03.am.sony.com with Microsoft SMTPSVC(5.0.2195.6713);
	 Fri, 14 Jul 2006 12:52:19 -0700
Message-ID: <44B7F5F3.9090104@am.sony.com>
Date:	Fri, 14 Jul 2006 12:52:19 -0700
From:	Geoff Levand <geoffrey.levand@am.sony.com>
User-Agent: Mozilla Thunderbird 1.0.8-1.1.fc4 (X11/20060501)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	ralf@linux-mips.org
CC:	linux-mips@linux-mips.org
Subject: [PATCH 1/2] mips: fix arch help
X-Enigmail-Version: 0.93.0.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 14 Jul 2006 19:52:19.0581 (UTC) FILETIME=[03F682D0:01C6A77F]
Return-Path: <Geoffrey.Levand@am.sony.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: 12008
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: geoffrey.levand@am.sony.com
Precedence: bulk
X-list: linux-mips

Fixes the arch specific help for mips.  This moves the help
def's to arch/mips/Makefile, where they will be found by
'make help'.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>

--

Fixes this warning:

Architecture specific targets (mips):
  No architecture specific help defined for mips


Index: 2.6.16/arch/mips/Makefile
===================================================================
--- 2.6.16.orig/arch/mips/Makefile	2006-07-14 11:30:10.000000000 -0700
+++ 2.6.16/arch/mips/Makefile	2006-07-14 11:37:33.000000000 -0700
@@ -845,6 +845,11 @@
 	       vmlinux.rm200.tmp \
 	       vmlinux.rm200

+define archhelp
+	@echo '* vmlinux.ecoff            - ECOFF boot image'
+	@echo '* vmlinux.srec             - SREC boot image'
+endef
+
 archclean:
 	@$(MAKE) $(clean)=arch/mips/boot
 	@$(MAKE) $(clean)=arch/mips/lasat
Index: 2.6.16/arch/mips/boot/Makefile
===================================================================
--- 2.6.16.orig/arch/mips/boot/Makefile	2006-07-14 11:30:10.000000000 -0700
+++ 2.6.16/arch/mips/boot/Makefile	2006-07-14 11:37:33.000000000 -0700
@@ -42,10 +42,6 @@
 $(obj)/addinitrd: $(obj)/addinitrd.c
 	$(HOSTCC) -o $@ $^

-archhelp:
-	@echo	'* vmlinux.ecoff	- ECOFF boot image'
-	@echo	'* vmlinux.srec		- SREC boot image'
-
 clean-files += addinitrd \
 	       elf2ecoff \
 	       vmlinux.bin \



From Geoffrey.Levand@am.sony.com Fri Jul 14 20:53:13 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 14 Jul 2006 20:53:39 +0100 (BST)
Received: from outbound-kan.frontbridge.com ([63.161.60.23]:2768 "EHLO
	outbound2-kan-R.bigfish.com") by ftp.linux-mips.org with ESMTP
	id S8133776AbWGNTwe (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 14 Jul 2006 20:52:34 +0100
Received: from outbound2-kan.bigfish.com (localhost.localdomain [127.0.0.1])
	by outbound2-kan-R.bigfish.com (Postfix) with ESMTP id 9FF4D7AF850;
	Fri, 14 Jul 2006 19:52:27 +0000 (UTC)
Received: from mail56-kan-R.bigfish.com (unknown [172.18.7.1])
	by outbound2-kan.bigfish.com (Postfix) with ESMTP id 973367AF83B;
	Fri, 14 Jul 2006 19:52:27 +0000 (UTC)
Received: from mail56-kan.bigfish.com (localhost.localdomain [127.0.0.1])
	by mail56-kan-R.bigfish.com (Postfix) with ESMTP id 8C71D1A1C59;
	Fri, 14 Jul 2006 19:52:27 +0000 (UTC)
X-BigFish: V
Received: by mail56-kan (MessageSwitch) id 1152906747534868_15490; Fri, 14 Jul 2006 19:52:27 +0000 (UCT)
Received: from mail8.fw-bc.sony.com (mail8.fw-bc.sony.com [160.33.98.75])
	(using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits))
	(No client certificate requested)
	by mail56-kan.bigfish.com (Postfix) with ESMTP id 6D5271A1A29;
	Fri, 14 Jul 2006 19:52:27 +0000 (UTC)
Received: from mail1.sgo.in.sel.sony.com (mail1.sgo.in.sel.sony.com [43.130.1.111])
	by mail8.fw-bc.sony.com (8.12.11/8.12.11) with ESMTP id k6EJqQek014259;
	Fri, 14 Jul 2006 19:52:26 GMT
Received: from USSDIXIM01.am.sony.com (ussdixim01.am.sony.com [43.130.140.33])
	by mail1.sgo.in.sel.sony.com (8.12.11/8.12.11) with ESMTP id k6EJqQCj021049;
	Fri, 14 Jul 2006 19:52:26 GMT
Received: from ussdixms03.am.sony.com ([43.130.140.23]) by USSDIXIM01.am.sony.com with Microsoft SMTPSVC(5.0.2195.6713);
	 Fri, 14 Jul 2006 12:52:25 -0700
Received: from [192.168.1.10] ([43.134.85.105]) by ussdixms03.am.sony.com with Microsoft SMTPSVC(5.0.2195.6713);
	 Fri, 14 Jul 2006 12:52:24 -0700
Message-ID: <44B7F5F8.4050703@am.sony.com>
Date:	Fri, 14 Jul 2006 12:52:24 -0700
From:	Geoff Levand <geoffrey.levand@am.sony.com>
User-Agent: Mozilla Thunderbird 1.0.8-1.1.fc4 (X11/20060501)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	ralf@linux-mips.org
CC:	linux-mips@linux-mips.org
Subject: [PATCH 2/2] mips: add new target vmlinux.strip
X-Enigmail-Version: 0.93.0.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 14 Jul 2006 19:52:24.0253 (UTC) FILETIME=[06BF66D0:01C6A77F]
Return-Path: <Geoffrey.Levand@am.sony.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: 12009
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: geoffrey.levand@am.sony.com
Precedence: bulk
X-list: linux-mips

Adds a new make target 'vmlinux.strip', a stripped elf boot
image.  This target reduces image load time with bootloaders
that load elf images.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>


Index: 2.6.16/arch/mips/Makefile
===================================================================
--- 2.6.16.orig/arch/mips/Makefile	2006-07-14 11:37:33.000000000 -0700
+++ 2.6.16/arch/mips/Makefile	2006-07-14 11:39:25.000000000 -0700
@@ -834,6 +834,9 @@
 vmlinux.bin: $(vmlinux-32)
 	+@$(call makeboot,$@)

+vmlinux.strip: $(vmlinux-32)
+	+@$(call makeboot,$@)
+
 vmlinux.ecoff vmlinux.rm200: $(vmlinux-32)
 	+@$(call makeboot,$@)

@@ -846,6 +849,7 @@
 	       vmlinux.rm200

 define archhelp
+	@echo '* vmlinux.strip            - stripped elf boot image'
 	@echo '* vmlinux.ecoff            - ECOFF boot image'
 	@echo '* vmlinux.srec             - SREC boot image'
 endef
Index: 2.6.16/arch/mips/boot/Makefile
===================================================================
--- 2.6.16.orig/arch/mips/boot/Makefile	2006-07-14 11:37:33.000000000 -0700
+++ 2.6.16/arch/mips/boot/Makefile	2006-07-14 11:37:55.000000000 -0700
@@ -23,6 +23,9 @@
 drop-sections	= .reginfo .mdebug .comment .note .pdr .options .MIPS.options
 strip-flags	= $(addprefix --remove-section=,$(drop-sections))

+quiet_cmd_stripvm = STRIP   $@
+      cmd_stripvm = $(STRIP) -s -R .comment $< -o $@
+
 VMLINUX = vmlinux

 all: vmlinux.ecoff vmlinux.srec addinitrd
@@ -36,6 +39,9 @@
 vmlinux.bin: $(VMLINUX)
 	$(OBJCOPY) -O binary $(strip-flags) $(VMLINUX) $(obj)/vmlinux.bin

+vmlinux.strip: $(VMLINUX)
+	$(call if_changed,stripvm)
+
 vmlinux.srec: $(VMLINUX)
 	$(OBJCOPY) -S -O srec $(strip-flags) $(VMLINUX) $(obj)/vmlinux.srec




From daniel@yoobay.net Sat Jul 15 01:57:50 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 15 Jul 2006 01:58:00 +0100 (BST)
Received: from buzzloop.caiaq.de ([212.112.241.133]:27143 "EHLO
	buzzloop.caiaq.de") by ftp.linux-mips.org with ESMTP
	id S8133422AbWGOA5u (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 15 Jul 2006 01:57:50 +0100
Received: from localhost (localhost [127.0.0.1])
	by buzzloop.caiaq.de (Postfix) with ESMTP id 11DF47F4028;
	Sat, 15 Jul 2006 02:57:48 +0200 (CEST)
Received: from buzzloop.caiaq.de ([127.0.0.1])
	by localhost (buzzloop [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 19862-06; Sat, 15 Jul 2006 02:57:47 +0200 (CEST)
Received: by buzzloop.caiaq.de (Postfix, from userid 1000)
	id BE49D7F4024; Sat, 15 Jul 2006 02:57:47 +0200 (CEST)
Date:	Sat, 15 Jul 2006 02:57:47 +0200
From:	Daniel Mack <daniel@yoobay.net>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] fix irq_chip struct for Pb1200/Db1200 platform
Message-ID: <20060715005747.GA21358@ipxXXXXX>
References: <2F5D781B-2119-4942-82C1-70B5037F5622@caiaq.de> <20060714161128.GB15427@linux-mips.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060714161128.GB15427@linux-mips.org>
User-Agent: Mutt/1.5.11
Return-Path: <daniel@yoobay.net>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12010
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: daniel@yoobay.net
Precedence: bulk
X-list: linux-mips

On Fri, Jul 14, 2006 at 05:11:28PM +0100, Ralf Baechle wrote:
> > the following patch makes external interrupt sources work again
> > on AMD's Au1200 development boards. The unnamed initialization
> > of 'external_irq_type' lead to a defective function mapping.
> > 
> > I resent it because of the missing Signed-off-by: line, sorry.
> 
> Good - but this patch is still corrupted so doesn't apply, can you
> resend with a non-broken mailer?

It hasn't been line-wrapped or corrupted by my mailer, as one can
see in the mailing list's web archive. 
Anyway, I put it online as a plain text file so anybody should be
able to use it properly:

	http://caiaq.org/linux-mips/patches/irq_chip_pb1200.patch

Daniel


From daniel@caiaq.de Sat Jul 15 02:19:51 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 15 Jul 2006 02:20:00 +0100 (BST)
Received: from buzzloop.caiaq.de ([212.112.241.133]:19218 "EHLO
	buzzloop.caiaq.de") by ftp.linux-mips.org with ESMTP
	id S8133407AbWGOBTv (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 15 Jul 2006 02:19:51 +0100
Received: from localhost (localhost [127.0.0.1])
	by buzzloop.caiaq.de (Postfix) with ESMTP id 7A56F7F4028;
	Sat, 15 Jul 2006 03:19:49 +0200 (CEST)
Received: from buzzloop.caiaq.de ([127.0.0.1])
	by localhost (buzzloop [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 19862-07; Sat, 15 Jul 2006 03:19:49 +0200 (CEST)
Received: by buzzloop.caiaq.de (Postfix, from userid 1000)
	id 26BA87F4024; Sat, 15 Jul 2006 03:19:49 +0200 (CEST)
Date:	Sat, 15 Jul 2006 03:19:49 +0200
From:	Daniel Mack <daniel@caiaq.de>
To:	Domen Puncer <domen.puncer@ultra.si>
Cc:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>,
	linux-usb-devel <linux-usb-devel@lists.sourceforge.net>,
	linux-mips <linux-mips@linux-mips.org>
Subject: Re: [PATCH] USB: removed a unbalanced #endif from ohci-au1xxx.c
Message-ID: <20060715011949.GA21737@ipxXXXXX>
References: <20060714162935.70502a98.yoichi_yuasa@tripeaks.co.jp> <20060714084533.GP31105@domen.ultra.si>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060714084533.GP31105@domen.ultra.si>
User-Agent: Mutt/1.5.11
Return-Path: <daniel@caiaq.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: 12011
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: daniel@caiaq.de
Precedence: bulk
X-list: linux-mips

On Fri, Jul 14, 2006 at 10:45:33AM +0200, Domen Puncer wrote:
> > Error message was:
> > In file included from drivers/usb/host/ohci-hcd.c:909:
> > drivers/usb/host/ohci-au1xxx.c:113:2: #endif without #if
> > 
> > Yoichi
> > 
> > Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
> > 
> > diff -pruN -X 2.6.18-rc1/Documentation/dontdiff 2.6.18-rc1-orig/drivers/usb/host/ohci-au1xxx.c 2.6.18-rc1/drivers/usb/host/ohci-au1xxx.c
> > --- 2.6.18-rc1-orig/drivers/usb/host/ohci-au1xxx.c	2006-07-14 11:17:34.443211500 +0900
> > +++ 2.6.18-rc1/drivers/usb/host/ohci-au1xxx.c	2006-07-14 10:33:47.945949750 +0900
> > @@ -110,7 +110,6 @@ static void au1xxx_start_ohc(struct plat
> >  
> >  	printk(KERN_DEBUG __FILE__
> >  	": Clock to USB host has been enabled \n");
> > -#endif
> >  }
> >  
> >  static void au1xxx_stop_ohc(struct platform_device *dev)

Yes, you're right.

> It looks like something went wrong with this patch
> http://www.linux-mips.org/git?p=linux.git;a=commitdiff;h=d14feb5ee4a46218f92b21ed52338b64130a151b
> 
> Looks like ehci-au1xxx.c might also be affected.

No, ehci-au1xxx.c looks ok to me, at least I was able to compile a
freshly updated git tree with only the above patch applied. Are there
any contrary reports?

Greets,
Daniel

From ralf@linux-mips.org Sat Jul 15 05:39:52 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 15 Jul 2006 05:40:03 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:34441 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S8133376AbWGOEjw (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sat, 15 Jul 2006 05:39:52 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.6/8.13.4) with ESMTP id k6F4dibs003927;
	Sat, 15 Jul 2006 05:39:44 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.6/8.13.6/Submit) id k6F4dfCt003926;
	Sat, 15 Jul 2006 05:39:41 +0100
Date:	Sat, 15 Jul 2006 05:39:41 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Daniel Mack <daniel@yoobay.net>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] fix irq_chip struct for Pb1200/Db1200 platform
Message-ID: <20060715043941.GA3587@linux-mips.org>
References: <2F5D781B-2119-4942-82C1-70B5037F5622@caiaq.de> <20060714161128.GB15427@linux-mips.org> <20060715005747.GA21358@ipxXXXXX>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060715005747.GA21358@ipxXXXXX>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12012
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Sat, Jul 15, 2006 at 02:57:47AM +0200, Daniel Mack wrote:
> Date:	Sat, 15 Jul 2006 02:57:47 +0200
> From:	Daniel Mack <daniel@yoobay.net>
> To:	Ralf Baechle <ralf@linux-mips.org>
> Cc:	linux-mips@linux-mips.org
> Subject: Re: [PATCH] fix irq_chip struct for Pb1200/Db1200 platform
> Content-Type: text/plain; charset=us-ascii
> 
> On Fri, Jul 14, 2006 at 05:11:28PM +0100, Ralf Baechle wrote:
> > > the following patch makes external interrupt sources work again
> > > on AMD's Au1200 development boards. The unnamed initialization
> > > of 'external_irq_type' lead to a defective function mapping.
> > > 
> > > I resent it because of the missing Signed-off-by: line, sorry.
> > 
> > Good - but this patch is still corrupted so doesn't apply, can you
> > resend with a non-broken mailer?
> 
> It hasn't been line-wrapped or corrupted by my mailer, as one can
> see in the mailing list's web archive. 

Same corrupt stuff:

$ wget http://caiaq.org/linux-mips/patches/irq_chip_pb1200.patch
--05:36:02--  http://caiaq.org/linux-mips/patches/irq_chip_pb1200.patch
           => `irq_chip_pb1200.patch'
Resolving caiaq.org... 212.112.241.133
Connecting to caiaq.org|212.112.241.133|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1,057 (1.0K) [text/plain]

100%[====================================>] 1,057         --.--K/s

05:36:02 (77.54 MB/s) - `irq_chip_pb1200.patch' saved [1057/1057]

$ patch -p1 < irq_chip_pb1200.patch
patching file arch/mips/au1000/pb1200/irqmap.c
patch: **** malformed patch at line 15: static struct irq_chip external_irq_type =

$

  Ralf

From daniel@caiaq.de Sat Jul 15 10:16:20 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 15 Jul 2006 10:16:29 +0100 (BST)
Received: from buzzloop.caiaq.de ([212.112.241.133]:51977 "EHLO
	buzzloop.caiaq.de") by ftp.linux-mips.org with ESMTP
	id S8127229AbWGOJQU (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 15 Jul 2006 10:16:20 +0100
Received: from localhost (localhost [127.0.0.1])
	by buzzloop.caiaq.de (Postfix) with ESMTP id 309867F4028;
	Sat, 15 Jul 2006 11:16:15 +0200 (CEST)
Received: from buzzloop.caiaq.de ([127.0.0.1])
	by localhost (buzzloop [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 23703-09; Sat, 15 Jul 2006 11:16:15 +0200 (CEST)
Received: by buzzloop.caiaq.de (Postfix, from userid 1000)
	id D0ED57F4022; Sat, 15 Jul 2006 11:16:14 +0200 (CEST)
Date:	Sat, 15 Jul 2006 11:16:14 +0200
From:	Daniel Mack <daniel@caiaq.de>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] fix irq_chip struct for Pb1200/Db1200 platform
Message-ID: <20060715091614.GB21737@ipxXXXXX>
References: <2F5D781B-2119-4942-82C1-70B5037F5622@caiaq.de> <20060714161128.GB15427@linux-mips.org> <20060715005747.GA21358@ipxXXXXX> <20060715043941.GA3587@linux-mips.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060715043941.GA3587@linux-mips.org>
User-Agent: Mutt/1.5.11
Return-Path: <daniel@caiaq.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: 12013
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: daniel@caiaq.de
Precedence: bulk
X-list: linux-mips

On Sat, Jul 15, 2006 at 05:39:41AM +0100, Ralf Baechle wrote:
> Same corrupt stuff:
> 
> $ wget http://caiaq.org/linux-mips/patches/irq_chip_pb1200.patch
> --05:36:02--  http://caiaq.org/linux-mips/patches/irq_chip_pb1200.patch

Argh, now I see what went wrong - sorry for the hazzle. Please 
try again, same link, slightly different content...

Daniel

From adaplas@gmail.com Sat Jul 15 14:07:39 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 15 Jul 2006 14:07:48 +0100 (BST)
Received: from py-out-1112.google.com ([64.233.166.182]:57052 "EHLO
	py-out-1112.google.com") by ftp.linux-mips.org with ESMTP
	id S8133509AbWGONHj (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 15 Jul 2006 14:07:39 +0100
Received: by py-out-1112.google.com with SMTP id m51so940109pye
        for <linux-mips@linux-mips.org>; Sat, 15 Jul 2006 06:07:37 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding;
        b=bepYrY1NoYFxXi9CIN8gB0XMfGpxooDCjWgqoHvhamM1/bVSGQphLLyj35HrngqF3Q9KValMLlxy+LEGlOXez7pc0i6d3rBL6iwtBm5H4ZQsJWxbTT4QBPpznpxVJ6NO7pqfDPuAyNwVuYiPG6HQlM362KIIk+nvMU5k9LnFi0Q=
Received: by 10.35.19.6 with SMTP id w6mr922440pyi;
        Sat, 15 Jul 2006 06:07:37 -0700 (PDT)
Received: from ?192.168.232.98? ( [203.84.188.10])
        by mx.gmail.com with ESMTP id m68sm251473pye.2006.07.15.06.07.35;
        Sat, 15 Jul 2006 06:07:37 -0700 (PDT)
Message-ID: <44B8E88C.7050804@gmail.com>
Date:	Sat, 15 Jul 2006 21:07:24 +0800
From:	"Antonino A. Daplas" <adaplas@gmail.com>
User-Agent: Thunderbird 1.5.0.4 (X11/20060516)
MIME-Version: 1.0
To:	linux-fbdev-devel@lists.sourceforge.net
CC:	linux-mips@linux-mips.org, Rodolfo Giometti <giometti@linux.it>
Subject: Re: [Linux-fbdev-devel] [PATCH] au1100fb.c cursor enable/disable
References: <20060712064519.GA17240@gundam.enneenne.com>
In-Reply-To: <20060712064519.GA17240@gundam.enneenne.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Return-Path: <adaplas@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: 12014
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: adaplas@gmail.com
Precedence: bulk
X-list: linux-mips

Rodolfo Giometti wrote:
> Hello,
> 
> here a patch to add cursor enable/disable, very useful if you wish a
> full screen boot logo.
> 
> Cursor can be disabled from kernel command line:
> 
>    video=au1100fb:nocursor,panel:Toppoly_TD035STED4
> 
> or from sysfs interface:
> 
>    echo 1 > /sys/module/au1100fb/parameters/nocursor
> 
> The patch also fixes up some wrong indentation issues.

I'm getting rejects with this patch and with the startup patch.
I'm manually fixing it but please check if its okay.

Tony
 

From hjl@lucon.org Sat Jul 15 23:19:15 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 15 Jul 2006 23:19:27 +0100 (BST)
Received: from smtp106.sbc.mail.mud.yahoo.com ([68.142.198.205]:22954 "HELO
	smtp106.sbc.mail.mud.yahoo.com") by ftp.linux-mips.org with SMTP
	id S3949226AbWGOWTP (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 15 Jul 2006 23:19:15 +0100
Received: (qmail 56480 invoked from network); 15 Jul 2006 22:19:08 -0000
Received: from unknown (HELO lucon.org) (hjjean@sbcglobal.net@71.146.109.150 with login)
  by smtp106.sbc.mail.mud.yahoo.com with SMTP; 15 Jul 2006 22:19:07 -0000
Received: by lucon.org (Postfix, from userid 1000)
	id 38F3664374; Sat, 15 Jul 2006 15:19:06 -0700 (PDT)
Date:	Sat, 15 Jul 2006 15:19:05 -0700
From:	"H. J. Lu" <hjl@lucon.org>
To:	linux-gcc@vger.kernel.org, gcc@gcc.gnu.org,
	GNU C Library <libc-alpha@sources.redhat.com>,
	Mat Hostetter <mat@lcs.mit.edu>, Warner Losh <imp@village.org>,
	linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>,
	Linas Vepstas <linas@linas.org>
Subject: The Linux binutils 2.17.50.0.3 is released
Message-ID: <20060715221905.GA10293@lucon.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.4.2.1i
Return-Path: <hjl@lucon.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12015
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: hjl@lucon.org
Precedence: bulk
X-list: linux-mips


This is the beta release of binutils 2.17.50.0.3 for Linux, which is
based on binutils 2006 0715 in CVS on sources.redhat.com plus various
changes. It is purely for Linux.

The new x86_64 assembler no longer accepts

	monitor %eax,%ecx,%edx

You should use

	monitor %rax,%ecx,%edx

or
	monitor

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

The new i386/x86_64 assemblers no longer accept instructions for moving
between a segment register and a 32bit memory location, i.e.,

	movl (%eax),%ds
	movl %ds,(%eax)

To generate instructions for moving between a segment register and a
16bit memory location without the 16bit operand size prefix, 0x66,

	mov (%eax),%ds
	mov %ds,(%eax)

should be used. It will work with both new and old assemblers. The
assembler starting from 2.16.90.0.1 will also support

	movw (%eax),%ds
	movw %ds,(%eax)

without the 0x66 prefix. Patches for 2.4 and 2.6 Linux kernels are
available at

http://www.kernel.org/pub/linux/devel/binutils/linux-2.4-seg-4.patch
http://www.kernel.org/pub/linux/devel/binutils/linux-2.6-seg-5.patch

The ia64 assembler is now defaulted to tune for Itanium 2 processors.
To build a kernel for Itanium 1 processors, you will need to add

ifeq ($(CONFIG_ITANIUM),y)
	CFLAGS += -Wa,-mtune=itanium1
	AFLAGS += -Wa,-mtune=itanium1
endif

to arch/ia64/Makefile in your kernel source tree.

Please report any bugs related to binutils 2.17.50.0.3 to hjl@lucon.org

and

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

If you don't use

# rpmbuild -ta binutils-xx.xx.xx.xx.xx.tar.bz2

to compile the Linux binutils, please read patches/README in source
tree to apply Linux patches if there are any.

Changes from binutils 2.17.50.0.2:

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

Changes from binutils 2.17.50.0.1:

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

Changes from binutils 2.16.91.0.7:

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

Changes from binutils 2.16.91.0.6:

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

Changes from binutils 2.16.91.0.5:

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

Changes from binutils 2.16.91.0.4:

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

Changes from binutils 2.16.91.0.3:

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

Changes from binutils 2.16.91.0.2:

1. Update from binutils 2005 0821.
2. Support x86-64 medium model.
3. Fix "objdump -S --adjust-vma=xxx" (PR 1179).
4. Reduce R_IA64_NONE relocations from R_IA64_LDXMOV relaxation.
5. Fix x86 linker regression for dosemu.
6. Add "readelf -t/--section-details" to display section details.
7. Fix "as -al=file" regression (PR 1118).

Changes from binutils 2.16.91.0.1:

1. Update from binutils 2005 0720.
2. Add Intel VMX support.
3. Add AMD SVME support.
4. Add x86-64 new relocations for medium model.
5. Fix a PIE regression (PR 975).
6. Fix an x86_64 signed 32bit displacement regression.
7. Fix PPC PLT (PR 1004). 
8. Improve empty section removal.

Changes from binutils 2.16.90.0.3:

1. Update from binutils 2005 0622.
2. Fix a linker versioning bug exposed by gcc 4 (PR 1022/1023/1025).
3. Optimize ia64 br->brl relaxation (PR 834).
4. Improve linker empty section removal.
5. Fix DWARF 2 line number reporting (PR 990).
6. Fix DWARF 2 line number reporting regression on assembly file (PR
1000).

Changes from binutils 2.16.90.0.2:

1. Update from binutils 2005 0510.
2. Update ia64 assembler to support comdat group section generated by
gcc 4 (PR 940).
3. Fix a linker crash on bad input (PR 939).
4. Fix a sh64 assembler regression (PR 936).
5. Support linker script on executable (PR 882).
6. Fix the linker -pie regression (PR 878).
7. Fix an x86_64 disassembler bug (PR 843).
8. Fix a PPC linker regression.
9. Misc speed up.

Changes from binutils 2.16.90.0.1:

1. Update from binutils 2005 0429.
2. Fix an ELF linker regression (PR 815).
3. Fix an empty section removal related bug.
4. Fix an ia64 linker regression (PR 855).
5. Don't allow local symbol to be equated common/undefined symbols (PR
857).
6. Fix the ia64 linker to handle local dynamic symbol error reporting.
7. Make non-debugging reference to discarded section an error (PR 858).
8. Support Sparc/TLS.
9. Support rpm build with newer rpm.
10. Fix an alpha linker regression.
11. Fix the non-gcc build regression.

Changes from binutils 2.15.94.0.2.2:

1. Update from binutils 2005 0408.
2. The i386/x86_64 assemblers no longer accept instructions for moving
between a segment register and a 32bit memory location.
3. The x86_64 assembler now allows movq between a segment register and
a 64bit general purpose register.
4. 20x Speed up linker for input files with >64K sections.
5. Properly report ia64 linker relaxation failures.
6. Support tuning ia64 assembler for Itanium 2 processors.
7. Linker will remove empty unused output sections.
8. Add -N to readelf to display full section names.
9. Fix the ia64 linker to support linkonce text sections without unwind
sections.
10. More unwind directive checkings in the ia64 assembler.
11. Speed up linker with wildcard handling.
12. Fix readelf to properly dump .debug_ranges and .debug_loc sections.

Changes from binutils 2.15.94.0.2:

1. Fix greater than 64K section support in linker.
2. Properly handle i386 and x86_64 protected symbols in linker.
3. Fix readelf for LEB128 on 64bit hosts.
4. Speed up readelf for section group process.
5. Include ia64 texinfo pages.
6. Change ia64 assembler to check hint.b for Montecito.
7. Improve relaxation failure report in ia64 linker.
8. Fix ia64 linker to allow relax backward branch in the same section.

Changes from binutils 2.15.94.0.1:

1. Update from binutils 2004 1220.
2. Fix strip for TLS symbol references.

Changes from binutils 2.15.92.0.2:

1. Update from binutils 2004 1121.
2. Put ia64 .ctors/.dtors sections next to small data section for
Intel ia64 compiler.
3. Fix -Bdynamic/-Bstatic handling for linker script.
4. Provide more information on relocation overflow.
5. Add --sort-section to linker.
6. Support icc 8.1 unwind info in readelf.
7. Fix the infinite loop bug on bad input in the ia64 assembler.
8. Fix ia64 SECREL relocation in linker.
9. Fix a section group memory leak in readelf.

Changes from binutils 2.15.91.0.2:

1. Update from binutils 2004 0927.
2. Work around a section header bug in Intel ia64 compiler.
3. Fix an unwind directive bug in the ia64 assembler.
4. Fix various PPC bugs.
5. Update ARM support.
6. Fix an x86-64 linker warning while building Linux kernel.

Changes from binutils 2.15.91.0.1:

1. Update from binutils 2004 0727.
2. Fix the x86_64 linker to prevent non-PIC code in shared library.
3. Fix the ia64 linker to warn the relotable files which can't be
relaxed.
4. Fix the comdat group support. Allow mix single-member comdat group
with linkonce section.
5. Added --add-needed/--no-add-needed options to linker.
6. Fix the SHF_LINK_ORDER support.
7. Fix the ia64 assembler for multiple sections with the same name and
SHT_IA_64_UNWIND sections.
8. Fix the ia64 assembler for merge section and relaxation.

Changes from binutils 2.15.90.0.3:

1. Update from binutils 2004 0527.
2. Fix -x auto option in the ia64 assembler.
3. Add the AR check in the ia64 assembler.
4. Fix the section group support.
5. Add a new -z relro linker option.
6. Fix an exception section placement bug in linker.
7. Add .serialize.data and .serialize.instruction to the ia64
assembler.

Changes from binutils 2.15.90.0.2:

1. Update from binutils 2004 0415.
2. Fix the linker for weak undefined symbol handling.
3. Fix the ELF/Sparc and ELF/Sparc64 linker for statically linking PIC
code.

Changes from binutils 2.15.90.0.1.1:

1. Update from binutils 2004 0412.
2. Add --as-needed/--no-as-needed to linker.
3. Fix -z defs in linker.
4. Always reserve the memory for ia64 dynamic linker.
5. Fix a race condition in ia64 lazy binding.

Changes from binutils 2.15.90.0.1:

1. Fixed an ia64 assembler bug.
2. Install the assembler man page.

Changes from binutils 2.14.90.0.8:

1. Update from binutils 2004 0303.
2. Fixed linker for undefined symbols with non-default visibility.
3. Sped up linker weakdef symbol handling.
4. Fixed mixing ELF32 and ELF64 object files in archive.
5. Added ia64 linker brl optimization.
6. Fixed ia64 linker to disallow invalid dynamic relocations.
7. Fixed DT_TEXTREL handling in ia64 linker.
8. Fixed alignment handling in ia64 assembler.
9. Improved ia64 assembler unwind table handling. 

Changes from binutils 2.14.90.0.7:

1. Update from binutils 2004 0114.
2. Fixed an ia64 assembler unwind table bug. 
3. Better handle IPF linker relaxation overflow.
4. Fixed misc PPC bugs.

Changes from binutils 2.14.90.0.6:

1. Update from binutils 2003 1029.
2. Allow type changes for undefined symbols.
3. Fix EH frame optimization.
4. Fix the check for undefined versioned symbol with wildcard.
5. Support generating code for Itanium.
6. Detect and warn bad symbol index.
7. Update IPF assemebler DV check.

Changes from binutils 2.14.90.0.5:

1. Update from binutils 2003 0820.
2. No longer use section names for ELF section types nor flags.
3. Fix some ELF/IA64 linker bugs.
4. Fix some ELF/ppc bugs.
5. Add archive support to readelf.

Changes from binutils 2.14.90.0.4.1:

1. Update from binutils 2003 0722.
2. Fix an ELF/mips linker bug.
3. Fix an ELF/hpppa linker bug.
4. Fix an ELF/ia64 assembler bug.
5. Fix a linkonce support with C++ debug.
6. A new working C++ demangler.
7. Various alpha, mips, ia64, ... bug fixes.
8. Support for the current gcc and glibc.

Changes from binutils 2.14.90.0.4:
 
1. Fix an ia64 assembler hint@pause bug.
2. Support Intel Prescott New Instructions.

Changes from binutils 2.14.90.0.3:

1. Work around the brain dead libtool.

Changes from binutils 2.14.90.0.2:

1. Update from binutils 2003 0523.
2. Fix 2 ELF visibility bugs.
3. Fix ELF/ppc linker bugs.

Changes from binutils 2.14.90.0.1:

1. Update from binutils 2003 0515.
2. Fix various ELF visibility bugs.
3. Fix some ia64 linker bugs.
4. Add more IAS compatibilities to ia64 assembler.

Changes from binutils 2.13.90.0.20:

1. Update from binutils 2003 0505.
2. Fix various ELF visibility bugs.
3. Fix some ia64 linker bugs.
4. Fix some ia64 assembler bugs.
5. Add some IAS compatibilities to ia64 assembler.
6. Fix ELF common symbol alignment.
7. Fix ELF weak symbol handling.

Changes from binutils 2.13.90.0.18:

1. Update from binutils 2003 0319.
2. Fix an ia64 linker brl relaxation bug.
3. Fix some ELF/ppc linker bugs.

Changes from binutils 2.13.90.0.16:

1. Update from binutils 2003 0121.
2. Fix an ia64 gas bug.
3. Fix some TLS bugs.
4. Fix some ELF/ppc bugs.
5. Fix an ELF/m68k bug.

2. Include /usr/bin/c++filt.
Changes from binutils 2.13.90.0.14:

1. Update from binutils 2002 1126.
2. Include /usr/bin/c++filt.
3. Fix "ld -r" with execption handling.

Changes from binutils 2.13.90.0.10:

1. Update from binutils 2002 1114.
2. Fix ELF/alpha bugs.
3. Fix an ELF/i386 assembler bug.

Changes from binutils 2.13.90.0.4:

1. Update from binutils 2002 1010.
2. More ELF/PPC linker bug fixes.
3. Fix an ELF/alpha linker bug.
4. Fix an ELF/sparc linker bug to support Solaris.
5. More TLS updates.

Changes from binutils 2.13.90.0.3:

1. Update from binutils 2002 0814.
2. Fix symbol versioning bugs for gcc 3.2.
3. Fix mips gas.

Changes from binutils 2.13.90.0.2:

1. Update from binutils 2002 0809.
2. Fix a mips gas compatibility bug.
3. Fix an x86 TLS bfd bug.
4. Fix an x86 PIC gas bug.
5. Improve symbol versioning support.

The file list:

1. binutils-2.17.50.0.3.tar.bz2. Source code.
2. binutils-2.17.50.0.2-2.17.50.0.3.diff.bz2. Patch against the
   previous beta source code.
3. binutils-2.17.50.0.3-1.i386.rpm. IA-32 binary RPM for RedHat EL 4.
4. binutils-2.17.50.0.3-1.ia64.rpm. IA-64 binary RPM for RedHat EL 4.
5. binutils-2.17.50.0.3-1.x86_64.rpm. X64_64 binary RPM for RedHat
   EL 4.

There is no separate source rpm. You can do

# rpmbuild -ta binutils-2.17.50.0.3.tar.bz2

to create both binary and source rpms.

The primary sites for the beta Linux binutils are:

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

Thanks.


H.J. Lu
hjl@lucon.org
07/15/2006

From yoichi_yuasa@tripeaks.co.jp Sun Jul 16 23:14:33 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 16 Jul 2006 23:14:51 +0100 (BST)
Received: from p549F6FFC.dip.t-dialin.net ([84.159.111.252]:55019 "EHLO
	p549F6FFC.dip.t-dialin.net") by ftp.linux-mips.org with ESMTP
	id S8133792AbWGPWNi (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 16 Jul 2006 23:13:38 +0100
Received: from mo31.po.2iij.net ([210.128.50.54]:40259 "EHLO mo31.po.2iij.net")
	by lappi.linux-mips.net with ESMTP id S1099323AbWGPOkW (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sun, 16 Jul 2006 16:40:22 +0200
Received: by mo.po.2iij.net (mo31) id k6GEe9hq017148; Sun, 16 Jul 2006 23:40:09 +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 k6GEe1dl069793
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Sun, 16 Jul 2006 23:40:03 +0900 (JST)
Date:	Sun, 16 Jul 2006 23:40:00 +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] removed an undefined config symbol
Message-Id: <20060716234000.6fb28c7e.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: 12016
X-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 an undefined config symbol in arch/mips/Kconfig.

Yoichi

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

diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/Kconfig mips/arch/mips/Kconfig
--- mips-orig/arch/mips/Kconfig	2006-07-16 23:19:10.231100750 +0900
+++ mips/arch/mips/Kconfig	2006-07-16 23:22:32.331731250 +0900
@@ -126,7 +126,6 @@ config BASLER_EXCITE
 	select IRQ_CPU
 	select IRQ_CPU_RM7K
 	select IRQ_CPU_RM9K
-	select SERIAL_RM9000
 	select SYS_HAS_CPU_RM9000
 	select SYS_SUPPORTS_32BIT_KERNEL
 	select SYS_SUPPORTS_64BIT_KERNEL

From david.goodenough@linkchoose.co.uk Mon Jul 17 12:16:58 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 17 Jul 2006 12:17:07 +0100 (BST)
Received: from ip-217-204-115-127.easynet.co.uk ([217.204.115.127]:31498 "EHLO
	apollo.linkchoose.co.uk") by ftp.linux-mips.org with ESMTP
	id S8133531AbWGQLQ6 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 17 Jul 2006 12:16:58 +0100
Received: from [10.98.1.127] (helo=galaxy.dga.co.uk)
	by apollo.linkchoose.co.uk with esmtp (Exim 4.60)
	(envelope-from <david.goodenough@linkchoose.co.uk>)
	id 1G2R9T-0004QE-9o
	for linux-mips@linux-mips.org; Mon, 17 Jul 2006 12:20:39 +0100
Received: from [10.0.1.63]
	by galaxy.dga.co.uk with esmtp (Exim 4.62)
	(envelope-from <david.goodenough@linkchoose.co.uk>)
	id 1G2R5q-0004dH-4T
	for linux-mips@linux-mips.org; Mon, 17 Jul 2006 12:16:54 +0100
From:	David Goodenough <david.goodenough@linkchoose.co.uk>
To:	linux-mips@linux-mips.org
Subject: Looking for help with an IDT RC32434 processor and Chip Select lines
Date:	Mon, 17 Jul 2006 12:16:53 +0100
User-Agent: KMail/1.9.1
Organization: Linkchoose Ltd
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200607171216.54317.david.goodenough@linkchoose.co.uk>
Return-Path: <david.goodenough@linkchoose.co.uk>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12017
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: david.goodenough@linkchoose.co.uk
Precedence: bulk
X-list: linux-mips

I am new to the MIPS world in general and the IDT chips in particular and
I wonder if someone who is familiar with them might be able to spare a few
minutes to help with understanding how this is supposed to work.

I have a board (a RouterBoard 532) which has one of these chips at its
heart and also has a Hynix 64Mb NAND flash chip on it.  I have a patch
which patches things all over the place which adds support for the chip
to a 2.6.17-rc5 kernel, but I want to separate out just the support for
the NAND chip as a patch on its own.  This patch successfully detects
the NAND chip when I load it onto the board. 

When I take just the mods to the drivers/mtd/nand code and add them to
2.6.17 it is as though the NAND chip is never being selected, the manufacturer
and device id for the NAND chip come back as 0xff where with the rc5 patch
they come back as the correct values 0xad and 0x76 respectively.

Having read the IDT documentation I think that all this is controlled by
the Device Control Registers.  The driver seems to expect that the chips is
accessed through DEV2, and in both cases when I boot the system up the values
in these registers are identical, and according to the IDT docs should cause
the chip select line to be raised.  

I can not find anything else that controls the chip select lines, and I do 
not have any hardware monitoring available to me (no oscilloscopes etc) to 
try to see what is happening at the hardware level.

So my first question is whether my assumption that I only have to bother
myself with the DEV2 register is right, or is there another set of switches
that control the chip select lines?

Thanks in advance

David

From hemanth.venkatesh@wipro.com Tue Jul 18 06:24:54 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Jul 2006 06:25:03 +0100 (BST)
Received: from wip-ec-wd.wipro.com ([203.91.193.32]:63211 "EHLO
	wip-ec-wd.wipro.com") by ftp.linux-mips.org with ESMTP
	id S8126482AbWGRFYy (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 18 Jul 2006 06:24:54 +0100
Received: from wip-ec-wd.wipro.com (localhost.wipro.com [127.0.0.1])
	by localhost (Postfix) with ESMTP id 86737205ED
	for <linux-mips@linux-mips.org>; Tue, 18 Jul 2006 10:51:52 +0530 (IST)
Received: from blr-ec-bh02.wipro.com (blr-ec-bh02.wipro.com [10.201.50.92])
	by wip-ec-wd.wipro.com (Postfix) with ESMTP id 56286205EC
	for <linux-mips@linux-mips.org>; Tue, 18 Jul 2006 10:51:51 +0530 (IST)
Received: from blr-m2-msg.wipro.com ([10.116.50.99]) by blr-ec-bh02.wipro.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Tue, 18 Jul 2006 10:54:42 +0530
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C6AA29.6F544430"
Subject: RE: Mounting rootfs from Alchemy Flash fails
Date:	Tue, 18 Jul 2006 10:47:16 +0530
Message-ID: <2156B1E923F1A147AABDF4D9FDEAB4CB09D11E@blr-m2-msg.wipro.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Mounting rootfs from Alchemy Flash fails
Thread-Index: AcaprqiZwSqm6qT8QY2NecCyN8MlvgAeXs+QAAAbMpA=
From:	<hemanth.venkatesh@wipro.com>
To:	<linux-mips@linux-mips.org>
X-OriginalArrivalTime: 18 Jul 2006 05:24:42.0129 (UTC) FILETIME=[78F4B810:01C6AA2A]
Return-Path: <hemanth.venkatesh@wipro.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: 12018
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: hemanth.venkatesh@wipro.com
Precedence: bulk
X-list: linux-mips

This is a multi-part message in MIME format.

------_=_NextPart_001_01C6AA29.6F544430
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi All,

=20

   We are trying to boot Linux MIPS 2.6.14 kernel on an AU1100 based
board, mounting  root file system from Flash (S29GLxxxN MirrorBitTM
Family, AMD Spansion) fails.  We have updated Alchamy-flash.c  to
specify  flash size 32 MB and physical address as 0X1E000000.  We found
that probe function is failing and vendor command set is not found, log
attached below. Any inputs for resolving the problem are appreciated.

=20

=20

Kernel command line arguments:   root=3D/dev/mtdblock0,

=20

SUI Flash: probing 32-bit flash bus

SUI Flash: Found 2 x16 devices at 0x0 in 32-bit bank

 Amd/Fujitsu Extended Query Table at 0x0040

SUI Flash: CFI does not contain boot bank location. Assuming top.

number of CFI chips: 1

Sum of regions (0) !=3D total size of set of interleaved chips (2000000)

gen_probe: No supported Vendor Command Set found

=20

=20

Thanks in advance

Hemanth

=20


------_=_NextPart_001_01C6AA29.6F544430
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

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

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal;
	font-family:Arial;
	color:windowtext;}
span.EmailStyle18
	{mso-style-type:personal;
	font-family:Arial;
	color:navy;}
span.EmailStyle19
	{mso-style-type:personal-reply;
	font-family:Arial;
	color:navy;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Hi All,<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp; We are trying to boot Linux MIPS 2.6.14 =
kernel
on an AU1100 based board, mounting &nbsp;root file system from Flash =
(S29GLxxxN
MirrorBitTM Family, AMD Spansion) fails.&nbsp; We have updated =
Alchamy-flash.c
&nbsp;to specify &nbsp;flash size 32 MB and physical address as =
0X1E000000.
&nbsp;We found that probe function is failing and vendor command set is =
not
found, log attached below. Any inputs for resolving the problem are
appreciated.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Kernel command line arguments:&nbsp;&nbsp;
root=3D/dev/mtdblock0,<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>SUI Flash: probing 32-bit flash =
bus<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>SUI Flash: Found 2 x16 devices at 0x0 in 32-bit =
bank<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>&nbsp;Amd/Fujitsu Extended Query Table at =
0x0040<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>SUI Flash: CFI does not contain boot bank location. =
Assuming
top.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>number of CFI chips: 1<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Sum of regions (0) !=3D total size of set of =
interleaved chips
(2000000)<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>gen_probe: No supported Vendor Command Set =
found<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Thanks in advance<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Hemanth<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>

------_=_NextPart_001_01C6AA29.6F544430--

From demon19840308@hotmail.com Tue Jul 18 08:12:38 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Jul 2006 08:12:48 +0100 (BST)
Received: from bay0-omc1-s3.bay0.hotmail.com ([65.54.246.75]:14502 "EHLO
	bay0-omc1-s3.bay0.hotmail.com") by ftp.linux-mips.org with ESMTP
	id S8133349AbWGRHMi (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 18 Jul 2006 08:12:38 +0100
Received: from hotmail.com ([207.46.10.235]) by bay0-omc1-s3.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Tue, 18 Jul 2006 00:12:30 -0700
Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;
	 Tue, 18 Jul 2006 00:12:30 -0700
Message-ID: <BAY122-F271C1ACCD1969B2F38611AAD630@phx.gbl>
Received: from 207.46.10.254 by by122fd.bay122.hotmail.msn.com with HTTP;
	Tue, 18 Jul 2006 07:12:29 GMT
X-Originating-IP: [211.144.27.155]
X-Originating-Email: [demon19840308@hotmail.com]
X-Sender: demon19840308@hotmail.com
From:	"qi tao" <demon19840308@hotmail.com>
To:	linux-mips@linux-mips.org
Subject: cross compiling gcc for mips
Date:	Tue, 18 Jul 2006 15:12:29 +0800
Mime-Version: 1.0
Content-Type: text/plain; charset=gb2312; format=flowed
X-OriginalArrivalTime: 18 Jul 2006 07:12:30.0453 (UTC) FILETIME=[8860A250:01C6AA39]
Return-Path: <demon19840308@hotmail.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12019
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: demon19840308@hotmail.com
Precedence: bulk
X-list: linux-mips

hello:
I am building a toolchain for mips platform. I am using

binutils-2.17
gcc-4.1.1
glibc-2.4
linux-2.6.17.4
linux-headers-2.6.17.4

First I built binutils and now I was setting up the bootstrap compiler.
However when I do "make all-gcc" I get the following errors:
  

  -c ../../gcc-4.1.1/gcc/crtstuff.c -DCRT_BEGIN \
  -o crtbegin.o
In file included from ../../gcc-4.1.1/gcc/crtstuff.c:68:
.../../gcc-4.1.1/gcc/tsystem.h:90:19: error: stdio.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
.../../gcc-4.1.1/gcc/tsystem.h:93:23: error: sys/types.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
.../../gcc-4.1.1/gcc/tsystem.h:96:19: error: errno.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
.../../gcc-4.1.1/gcc/tsystem.h:103:20: error: string.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
.../../gcc-4.1.1/gcc/tsystem.h:104:20: error: stdlib.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
.../../gcc-4.1.1/gcc/tsystem.h:105:20: error: unistd.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
In file included from 
/opt/cross_src4.1.1/gcc-build/./gcc/include/syslimits.h:7,
                 from 
/opt/cross_src4.1.1/gcc-build/./gcc/include/limits.h:11,
                 from ../../gcc-4.1.1/gcc/tsystem.h:108,
                 from ../../gcc-4.1.1/gcc/crtstuff.c:68:
/opt/cross_src4.1.1/gcc-build/./gcc/include/limits.h:122:61: error: 
limits.h: Ã» ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
In file included from ../../gcc-4.1.1/gcc/crtstuff.c:68:
.../../gcc-4.1.1/gcc/tsystem.h:111:18: error: time.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
make[1]: *** [crtbegin.o] ´íÎó 1
make[1]: Leaving directory `/opt/cross_src4.1.1/gcc-build/gcc'
make: *** [all-gcc] ´íÎó 2
 
what should i do??  thanks for your help ! thank you

_________________________________________________________________
ÏíÓÃÊÀ½çÉÏ×î´óµÄµç×ÓÓÊ¼þÏµÍ³¡ª MSN Hotmail¡£  http://www.hotmail.com  


From freddy@dusktilldawn.nl Tue Jul 18 08:18:28 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Jul 2006 08:18:38 +0100 (BST)
Received: from tool.snarl.nl ([213.84.251.124]:23267 "EHLO tool.snarl.nl")
	by ftp.linux-mips.org with ESMTP id S8133349AbWGRHS2 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 18 Jul 2006 08:18:28 +0100
Received: from localhost (tool.local.snarl.nl [127.0.0.1])
	by tool.snarl.nl (Postfix) with ESMTP id CA92A5DFB3;
	Tue, 18 Jul 2006 09:18:19 +0200 (CEST)
Received: from tool.snarl.nl ([127.0.0.1])
	by localhost (tool.local.snarl.nl [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id YtxDHEdGdTmV; Tue, 18 Jul 2006 09:18:19 +0200 (CEST)
Received: by tool.snarl.nl (Postfix, from userid 1000)
	id 6FEAA5DF86; Tue, 18 Jul 2006 09:18:19 +0200 (CEST)
Date:	Tue, 18 Jul 2006 09:18:19 +0200
From:	Freddy Spierenburg <freddy@dusktilldawn.nl>
To:	hemanth.venkatesh@wipro.com
Cc:	linux-mips@linux-mips.org
Subject: Re: Mounting rootfs from Alchemy Flash fails
Message-ID: <20060718071819.GW5162@dusktilldawn.nl>
References: <2156B1E923F1A147AABDF4D9FDEAB4CB09D11E@blr-m2-msg.wipro.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="nqu5fpgjE+BQlEdo"
Content-Disposition: inline
In-Reply-To: <2156B1E923F1A147AABDF4D9FDEAB4CB09D11E@blr-m2-msg.wipro.com>
X-User-Agent-Feature: All mail clients suck. This one just sucks less.
X-GPG-Key: http://snarl.nl/~freddy/keys/freddyPublicKey.gpg
User-Agent: Mutt/1.5.11+cvs20060403
Return-Path: <freddy@dusktilldawn.nl>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12020
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: freddy@dusktilldawn.nl
Precedence: bulk
X-list: linux-mips


--nqu5fpgjE+BQlEdo
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi Hemanth,

On Tue, Jul 18, 2006 at 10:47:16AM +0530, hemanth.venkatesh@wipro.com wrote:
> We have updated Alchamy-flash.c  to specify  flash size 32 MB
> and physical address as 0X1E000000.

Isn't 32MB the default in 2.6.14 for the DB1100 board? If I
memorized it correctly you don't have to update anything. It
should work out of the box, since the DB1100 comes standard with
32MB flash.


> We found that probe function is failing and vendor command set
> is not found, log attached below. Any inputs for resolving the
> problem are appreciated.

Have you checked dip-switch S5? Both switches should be on (white
switches both near the 1 and 2 instead of the text cts-2)


--=20
$ cat ~/.signature
Freddy Spierenburg <freddy@dusktilldawn.nl>  http://freddy.snarl.nl/
GnuPG: 0x7941D1E1=3DC948 5851 26D2 FA5C 39F1  E588 6F17 FD5D 7941 D1E1
$ # Please read http://www.ietf.org/rfc/rfc2015.txt before complain!

--nqu5fpgjE+BQlEdo
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEvIs7bxf9XXlB0eERAgB/AJ9Td9xi+HL1d4Go2clI2sifDc7Q2gCgzbrd
Nt1A4YtljqEX1nDMqBjGZGE=
=MHsw
-----END PGP SIGNATURE-----

--nqu5fpgjE+BQlEdo--

From hemanth.venkatesh@wipro.com Tue Jul 18 09:46:38 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Jul 2006 09:46:47 +0100 (BST)
Received: from wip-ec-wd.wipro.com ([203.91.193.32]:13971 "EHLO
	wip-ec-wd.wipro.com") by ftp.linux-mips.org with ESMTP
	id S8127232AbWGRIqi convert rfc822-to-8bit (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 18 Jul 2006 09:46:38 +0100
Received: from wip-ec-wd.wipro.com (localhost.wipro.com [127.0.0.1])
	by localhost (Postfix) with ESMTP id 4960D205E6
	for <linux-mips@linux-mips.org>; Tue, 18 Jul 2006 14:13:39 +0530 (IST)
Received: from blr-ec-bh01.wipro.com (blr-ec-bh01.wipro.com [10.201.50.91])
	by wip-ec-wd.wipro.com (Postfix) with ESMTP id 35AF2205D9
	for <linux-mips@linux-mips.org>; Tue, 18 Jul 2006 14:13:39 +0530 (IST)
Received: from blr-m2-msg.wipro.com ([10.116.50.99]) by blr-ec-bh01.wipro.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Tue, 18 Jul 2006 14:16:30 +0530
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 8BIT
Subject: RE: Mounting rootfs from Alchemy Flash fails
Date:	Tue, 18 Jul 2006 14:16:23 +0530
Message-ID: <2156B1E923F1A147AABDF4D9FDEAB4CB09D16B@blr-m2-msg.wipro.com>
In-Reply-To: <20060718071819.GW5162@dusktilldawn.nl>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Mounting rootfs from Alchemy Flash fails
Thread-Index: AcaqOmjJXaqvsu/lQnWwaA5KoDrEbwACjM5A
From:	<hemanth.venkatesh@wipro.com>
To:	<freddy@dusktilldawn.nl>
Cc:	<linux-mips@linux-mips.org>
X-OriginalArrivalTime: 18 Jul 2006 08:46:30.0474 (UTC) FILETIME=[AA178AA0:01C6AA46]
Return-Path: <hemanth.venkatesh@wipro.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: 12021
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: hemanth.venkatesh@wipro.com
Precedence: bulk
X-list: linux-mips

Freddy, thanks for your reply. We are not using DB1100 board, but a
custom board which has AU1100 core. We have added the partition info
into alchemy-flash.c but the probe is not going through. It doesnot seem
to have the dip switches you mentioned, and we are able to boot from
flash with a 2.4 kernel. Its only 2.6.14 that is giving problems.

Thanks
Hemanth

-----Original Message-----
From: Freddy Spierenburg [mailto:freddy@dusktilldawn.nl] 
Sent: Tuesday, July 18, 2006 12:48 PM
To: Hemanth V (WT01 - Embedded Systems)
Cc: linux-mips@linux-mips.org
Subject: Re: Mounting rootfs from Alchemy Flash fails

Hi Hemanth,

On Tue, Jul 18, 2006 at 10:47:16AM +0530, hemanth.venkatesh@wipro.com
wrote:
> We have updated Alchamy-flash.c  to specify  flash size 32 MB
> and physical address as 0X1E000000.

Isn't 32MB the default in 2.6.14 for the DB1100 board? If I
memorized it correctly you don't have to update anything. It
should work out of the box, since the DB1100 comes standard with
32MB flash.


> We found that probe function is failing and vendor command set
> is not found, log attached below. Any inputs for resolving the
> problem are appreciated.

Have you checked dip-switch S5? Both switches should be on (white
switches both near the 1 and 2 instead of the text cts-2)


-- 
$ cat ~/.signature
Freddy Spierenburg <freddy@dusktilldawn.nl>  http://freddy.snarl.nl/
GnuPG: 0x7941D1E1=C948 5851 26D2 FA5C 39F1  E588 6F17 FD5D 7941 D1E1
$ # Please read http://www.ietf.org/rfc/rfc2015.txt before complain!

From macro@linux-mips.org Tue Jul 18 11:53:15 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Jul 2006 11:53:24 +0100 (BST)
Received: from pollux.ds.pg.gda.pl ([153.19.208.7]:21516 "EHLO
	pollux.ds.pg.gda.pl") by ftp.linux-mips.org with ESMTP
	id S8133413AbWGRKxP (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 18 Jul 2006 11:53:15 +0100
Received: from localhost (localhost [127.0.0.1])
	by pollux.ds.pg.gda.pl (Postfix) with ESMTP id 25B66F6652;
	Tue, 18 Jul 2006 12:53:11 +0200 (CEST)
Received: from pollux.ds.pg.gda.pl ([127.0.0.1])
 by localhost (pollux.ds.pg.gda.pl [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 26005-10; Tue, 18 Jul 2006 12:53:10 +0200 (CEST)
Received: from piorun.ds.pg.gda.pl (piorun.ds.pg.gda.pl [153.19.208.8])
	by pollux.ds.pg.gda.pl (Postfix) with ESMTP id CBB5BF5A19;
	Tue, 18 Jul 2006 12:53:10 +0200 (CEST)
Received: from blysk.ds.pg.gda.pl (macro@blysk.ds.pg.gda.pl [153.19.208.6])
	by piorun.ds.pg.gda.pl (8.13.7/8.13.1) with ESMTP id k6IArGoP013958;
	Tue, 18 Jul 2006 12:53:16 +0200
Date:	Tue, 18 Jul 2006 11:53:13 +0100 (BST)
From:	"Maciej W. Rozycki" <macro@linux-mips.org>
To:	qi tao <demon19840308@hotmail.com>
cc:	linux-mips@linux-mips.org
Subject: Re: cross compiling gcc for mips
In-Reply-To: <BAY122-F271C1ACCD1969B2F38611AAD630@phx.gbl>
Message-ID: <Pine.LNX.4.64N.0607181150160.31692@blysk.ds.pg.gda.pl>
References: <BAY122-F271C1ACCD1969B2F38611AAD630@phx.gbl>
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="328795856-18111934-1153219993=:31692"
X-Virus-Scanned: ClamAV 0.88.3/1600/Sat Jul 15 17:03:46 2006 on piorun.ds.pg.gda.pl
X-Virus-Status:	Clean
X-Virus-Scanned: by amavisd-new at pollux.ds.pg.gda.pl
Return-Path: <macro@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12022
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: macro@linux-mips.org
Precedence: bulk
X-list: linux-mips

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--328795856-18111934-1153219993=:31692
Content-Type: TEXT/PLAIN; charset=gb2312
Content-Transfer-Encoding: 8BIT

On Tue, 18 Jul 2006, qi tao wrote:

> However when I do "make all-gcc" I get the following errors:
>  
> 
>  -c ../../gcc-4.1.1/gcc/crtstuff.c -DCRT_BEGIN \
>  -o crtbegin.o
> In file included from ../../gcc-4.1.1/gcc/crtstuff.c:68:
> .../../gcc-4.1.1/gcc/tsystem.h:90:19: error: stdio.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
> .../../gcc-4.1.1/gcc/tsystem.h:93:23: error: sys/types.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
> .../../gcc-4.1.1/gcc/tsystem.h:96:19: error: errno.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
> .../../gcc-4.1.1/gcc/tsystem.h:103:20: error: string.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
> .../../gcc-4.1.1/gcc/tsystem.h:104:20: error: stdlib.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
> .../../gcc-4.1.1/gcc/tsystem.h:105:20: error: unistd.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
> In file included from
> /opt/cross_src4.1.1/gcc-build/./gcc/include/syslimits.h:7,
>                 from /opt/cross_src4.1.1/gcc-build/./gcc/include/limits.h:11,
>                 from ../../gcc-4.1.1/gcc/tsystem.h:108,
>                 from ../../gcc-4.1.1/gcc/crtstuff.c:68:
> /opt/cross_src4.1.1/gcc-build/./gcc/include/limits.h:122:61: error: limits.h:
> Ã» ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
> In file included from ../../gcc-4.1.1/gcc/crtstuff.c:68:
> .../../gcc-4.1.1/gcc/tsystem.h:111:18: error: time.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
> make[1]: *** [crtbegin.o] ´íÎó 1
> make[1]: Leaving directory `/opt/cross_src4.1.1/gcc-build/gcc'
> make: *** [all-gcc] ´íÎó 2
> 
> what should i do??  thanks for your help ! thank you

 It would raise the probability of someone being able to provide you some 
help if you set your locale to English before reporting error messages.

  Maciej
--328795856-18111934-1153219993=:31692--

From fxzhang@ict.ac.cn Tue Jul 18 13:48:52 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Jul 2006 13:49:01 +0100 (BST)
Received: from webmail.ict.ac.cn ([159.226.39.7]:2784 "EHLO ict.ac.cn")
	by ftp.linux-mips.org with ESMTP id S3949191AbWGRMsw (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 18 Jul 2006 13:48:52 +0100
Received: (qmail 13881 invoked by uid 507); 18 Jul 2006 21:28:55 +0800
Received: from unknown (HELO ?192.168.2.202?) (fxzhang@222.92.8.142)
  by ict.ac.cn with SMTP; 18 Jul 2006 21:28:55 +0800
Message-ID: <44BCD870.8090206@ict.ac.cn>
Date:	Tue, 18 Jul 2006 20:47:44 +0800
From:	Fuxin Zhang <fxzhang@ict.ac.cn>
User-Agent: Thunderbird 1.5.0.4 (Windows/20060516)
MIME-Version: 1.0
To:	"Maciej W. Rozycki" <macro@linux-mips.org>
CC:	qi tao <demon19840308@hotmail.com>, linux-mips@linux-mips.org
Subject: Re: cross compiling gcc for mips
References: <BAY122-F271C1ACCD1969B2F38611AAD630@phx.gbl> <Pine.LNX.4.64N.0607181150160.31692@blysk.ds.pg.gda.pl>
In-Reply-To: <Pine.LNX.4.64N.0607181150160.31692@blysk.ds.pg.gda.pl>
X-Enigmail-Version: 0.93.0.0
Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: 8bit
Return-Path: <fxzhang@ict.ac.cn>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12023
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: fxzhang@ict.ac.cn
Precedence: bulk
X-list: linux-mips

They are "No such file or directory" :)

Maciej W. Rozycki Ð´µÀ:
> On Tue, 18 Jul 2006, qi tao wrote:
> 
>> However when I do "make all-gcc" I get the following errors:
>>  
>>
>>  -c ../../gcc-4.1.1/gcc/crtstuff.c -DCRT_BEGIN \
>>  -o crtbegin.o
>> In file included from ../../gcc-4.1.1/gcc/crtstuff.c:68:
>> .../../gcc-4.1.1/gcc/tsystem.h:90:19: error: stdio.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
>> .../../gcc-4.1.1/gcc/tsystem.h:93:23: error: sys/types.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
>> .../../gcc-4.1.1/gcc/tsystem.h:96:19: error: errno.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
>> .../../gcc-4.1.1/gcc/tsystem.h:103:20: error: string.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
>> .../../gcc-4.1.1/gcc/tsystem.h:104:20: error: stdlib.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
>> .../../gcc-4.1.1/gcc/tsystem.h:105:20: error: unistd.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
>> In file included from
>> /opt/cross_src4.1.1/gcc-build/./gcc/include/syslimits.h:7,
>>                 from /opt/cross_src4.1.1/gcc-build/./gcc/include/limits.h:11,
>>                 from ../../gcc-4.1.1/gcc/tsystem.h:108,
>>                 from ../../gcc-4.1.1/gcc/crtstuff.c:68:
>> /opt/cross_src4.1.1/gcc-build/./gcc/include/limits.h:122:61: error: limits.h:
>> Ã» ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
>> In file included from ../../gcc-4.1.1/gcc/crtstuff.c:68:
>> .../../gcc-4.1.1/gcc/tsystem.h:111:18: error: time.h: Ã»ÓÐÄÇ¸öÎÄ¼þ»òÄ¿Â¼
>> make[1]: *** [crtbegin.o] ´íÎó 1 ==> error 1
>> make[1]: Leaving directory `/opt/cross_src4.1.1/gcc-build/gcc'
>> make: *** [all-gcc] ´íÎó 2  ==> error 2
>>
>> what should i do??  thanks for your help ! thank you
> 
>  It would raise the probability of someone being able to provide you some 
> help if you set your locale to English before reporting error messages.
> 
>   Maciej

From giometti@enneenne.com Tue Jul 18 18:46:45 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Jul 2006 18:46:55 +0100 (BST)
Received: from 81-174-11-161.f5.ngi.it ([81.174.11.161]:45719 "EHLO
	mail.enneenne.com") by ftp.linux-mips.org with ESMTP
	id S8133511AbWGRRqp (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 18 Jul 2006 18:46:45 +0100
Received: from zaigor.enneenne.com ([192.168.32.1])
	by mail.enneenne.com with esmtp (Exim 4.50)
	id 1G2sft-0008Lr-2H
	for linux-mips@linux-mips.org; Tue, 18 Jul 2006 18:43:57 +0200
Received: from giometti by zaigor.enneenne.com with local (Exim 4.60)
	(envelope-from <giometti@enneenne.com>)
	id 1G2teZ-0006cb-Tq
	for linux-mips@linux-mips.org; Tue, 18 Jul 2006 19:46:39 +0200
Date:	Tue, 18 Jul 2006 19:46:39 +0200
From:	Rodolfo Giometti <giometti@linux.it>
To:	linux-mips@linux-mips.org
Message-ID: <20060718174639.GB6887@enneenne.com>
References: <20060713163200.GA7186@gundam.enneenne.com> <20060714.103521.25910483.nemoto@toshiba-tops.co.jp> <20060714075441.GE7186@gundam.enneenne.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="qlTNgmc+xy1dBmNv"
Content-Disposition: inline
In-Reply-To: <20060714075441.GE7186@gundam.enneenne.com>
Organization: GNU/Linux Device Drivers, Embedded Systems and Courses
X-PGP-Key: gpg --keyserver keyserver.linux.it --recv-keys D25A5633
User-Agent: Mutt/1.5.11+cvs20060403
X-SA-Exim-Connect-IP: 192.168.32.1
X-SA-Exim-Mail-From: giometti@enneenne.com
Subject: Re: Problems after merge to 2.6.18-rc1
X-SA-Exim-Version: 4.2 (built Thu, 03 Mar 2005 10:44:12 +0100)
X-SA-Exim-Scanned: Yes (on mail.enneenne.com)
Return-Path: <giometti@enneenne.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: 12024
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: giometti@linux.it
Precedence: bulk
X-list: linux-mips


--qlTNgmc+xy1dBmNv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Jul 14, 2006 at 09:54:41AM +0200, Rodolfo Giometti wrote:
>=20
> The first strange thing is that this time the kernel messages stop
> after "au1xxx_pm_prepare: state =3D 3" and not after "au_sleep: Zzz..."
> as before the merge! Maybe something as changed in serial console
> magement?

Yes, something as changed... here the patch to remove the problem.

   diff --git a/kernel/power/main.c b/kernel/power/main.c
   index 6d295c7..10bf859 100644
   --- a/kernel/power/main.c
   +++ b/kernel/power/main.c
   @@ -86,7 +86,9 @@ static int suspend_prepare(suspend_state
    			goto Thaw;
    	}
   =20
   +#ifndef CONFIG_DEBUG_KERNEL
    	suspend_console();
   +#endif
    	if ((error =3D device_suspend(PMSG_SUSPEND))) {
    		printk(KERN_ERR "Some devices failed to suspend\n");
    		goto Finish;

I'd like also sending this patch to the Linux main tree, where should
I send it? I found nothing useful in MAINTAINERS file... :-o

Ciao,

Rodolfo

--=20

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

--qlTNgmc+xy1dBmNv
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFEvR5/QaTCYNJaVjMRArfQAJ9mgkuN6FILxTuig9Nz4Tvt0vt3AgCfcDii
igOzwcHEos+f/q0FynVDLss=
=vcL4
-----END PGP SIGNATURE-----

--qlTNgmc+xy1dBmNv--

From ralf@linux-mips.org Tue Jul 18 20:36:45 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 18 Jul 2006 20:36:54 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:38819 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S8133522AbWGRTgp (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 18 Jul 2006 20:36:45 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.6/8.13.4) with ESMTP id k6IJaljR016972;
	Tue, 18 Jul 2006 15:36:47 -0400
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.6/8.13.6/Submit) id k6IJakwV016971;
	Tue, 18 Jul 2006 15:36:46 -0400
Date:	Tue, 18 Jul 2006 15:36:46 -0400
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Rodolfo Giometti <giometti@linux.it>
Cc:	linux-mips@linux-mips.org
Subject: Re: Problems after merge to 2.6.18-rc1
Message-ID: <20060718193646.GB16822@linux-mips.org>
References: <20060713163200.GA7186@gundam.enneenne.com> <20060714.103521.25910483.nemoto@toshiba-tops.co.jp> <20060714075441.GE7186@gundam.enneenne.com> <20060718174639.GB6887@enneenne.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060718174639.GB6887@enneenne.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12025
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Tue, Jul 18, 2006 at 07:46:39PM +0200, Rodolfo Giometti wrote:

> > The first strange thing is that this time the kernel messages stop
> > after "au1xxx_pm_prepare: state = 3" and not after "au_sleep: Zzz..."
> > as before the merge! Maybe something as changed in serial console
> > magement?
> 
> Yes, something as changed... here the patch to remove the problem.
> 
>    diff --git a/kernel/power/main.c b/kernel/power/main.c
>    index 6d295c7..10bf859 100644
>    --- a/kernel/power/main.c
>    +++ b/kernel/power/main.c
>    @@ -86,7 +86,9 @@ static int suspend_prepare(suspend_state
>     			goto Thaw;
>     	}
>     
>    +#ifndef CONFIG_DEBUG_KERNEL
>     	suspend_console();
>    +#endif
>     	if ((error = device_suspend(PMSG_SUSPEND))) {
>     		printk(KERN_ERR "Some devices failed to suspend\n");
>     		goto Finish;
> 
> I'd like also sending this patch to the Linux main tree, where should
> I send it? I found nothing useful in MAINTAINERS file... :-o

You missed the last entry in MAINTAINERS ;-)  Send such stuff to
linux-kernel@vger.kernel.org.

  Ralf

From giometti@enneenne.com Wed Jul 19 09:30:11 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 19 Jul 2006 09:30:24 +0100 (BST)
Received: from 81-174-11-161.f5.ngi.it ([81.174.11.161]:12445 "EHLO
	mail.enneenne.com") by ftp.linux-mips.org with ESMTP
	id S8133408AbWGSIaL (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 19 Jul 2006 09:30:11 +0100
Received: from zaigor.enneenne.com ([192.168.32.1])
	by mail.enneenne.com with esmtp (Exim 4.50)
	id 1G36SN-0004IL-2q; Wed, 19 Jul 2006 09:26:56 +0200
Received: from giometti by zaigor.enneenne.com with local (Exim 4.60)
	(envelope-from <giometti@enneenne.com>)
	id 1G37R6-00005j-OK; Wed, 19 Jul 2006 10:29:40 +0200
Date:	Wed, 19 Jul 2006 10:29:40 +0200
From:	Rodolfo Giometti <giometti@linux.it>
To:	linux-mips@linux-mips.org
Cc:	netdev@vger.kernel.org
Message-ID: <20060719082940.GC6887@enneenne.com>
References: <20060713163200.GA7186@gundam.enneenne.com> <20060714.103521.25910483.nemoto@toshiba-tops.co.jp> <20060714075441.GE7186@gundam.enneenne.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="BI5RvnYi6R4T2M87"
Content-Disposition: inline
In-Reply-To: <20060714075441.GE7186@gundam.enneenne.com>
Organization: GNU/Linux Device Drivers, Embedded Systems and Courses
X-PGP-Key: gpg --keyserver keyserver.linux.it --recv-keys D25A5633
User-Agent: Mutt/1.5.11+cvs20060403
X-SA-Exim-Connect-IP: 192.168.32.1
X-SA-Exim-Mail-From: giometti@enneenne.com
Subject: [PATCH] au1000_eth.c power management and driver registration support
X-SA-Exim-Version: 4.2 (built Thu, 03 Mar 2005 10:44:12 +0100)
X-SA-Exim-Scanned: Yes (on mail.enneenne.com)
Return-Path: <giometti@enneenne.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: 12026
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: giometti@linux.it
Precedence: bulk
X-list: linux-mips


--BI5RvnYi6R4T2M87
Content-Type: multipart/mixed; boundary="Clx92ZfkiYIKRjnr"
Content-Disposition: inline


--Clx92ZfkiYIKRjnr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello,

Attached you can find my patch to add power managament and driver
registration to the new version of file "drivers/net/au1000_eth.c"
that implements the PHY-layer support.

Ciao,

Rodolfo Giometti

Signed-off-by: Rodolfo Giometti <giometti@linux.it

--=20

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

--Clx92ZfkiYIKRjnr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-au1000_eth-pm-and-registration
Content-Transfer-Encoding: quoted-printable

diff --git a/arch/mips/au1000/common/au1xxx_irqmap.c b/arch/mips/au1000/com=
mon/au1xxx_irqmap.c
index 7acfe9b..d94bde1 100644
--- a/arch/mips/au1000/common/au1xxx_irqmap.c
+++ b/arch/mips/au1000/common/au1xxx_irqmap.c
@@ -117,7 +117,7 @@ #elif defined(CONFIG_SOC_AU1500)
 	{ AU1000_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 },
 	{ AU1000_USB_HOST_INT, INTC_INT_LOW_LEVEL, 0 },
 	{ AU1000_ACSYNC_INT, INTC_INT_RISE_EDGE, 0 },
-	{ AU1500_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0},
+	{ AU1000_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0},
 	{ AU1500_MAC1_DMA_INT, INTC_INT_HIGH_LEVEL, 0},
 	{ AU1000_AC97C_INT, INTC_INT_RISE_EDGE, 0 },
=20
@@ -151,7 +151,7 @@ #elif defined(CONFIG_SOC_AU1100)
 	{ AU1000_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 },
 	{ AU1000_USB_HOST_INT, INTC_INT_LOW_LEVEL, 0 },
 	{ AU1000_ACSYNC_INT, INTC_INT_RISE_EDGE, 0 },
-	{ AU1100_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0},
+	{ AU1000_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0},
 	/*{ AU1000_GPIO215_208_INT, INTC_INT_HIGH_LEVEL, 0},*/
 	{ AU1100_LCD_INT, INTC_INT_HIGH_LEVEL, 0},
 	{ AU1000_AC97C_INT, INTC_INT_RISE_EDGE, 0 },
diff --git a/arch/mips/au1000/common/platform.c b/arch/mips/au1000/common/p=
latform.c
index 8fd203d..ec81d4b 100644
--- a/arch/mips/au1000/common/platform.c
+++ b/arch/mips/au1000/common/platform.c
@@ -15,6 +15,78 @@ #include <linux/resource.h>
=20
 #include <asm/mach-au1x00/au1xxx.h>
=20
+#if defined(CONFIG_MIPS_AU1X00_ENET) || defined(CONFIG_MIPS_AU1X00_ENET_MO=
DULE)
+/* Ethernet controllers */
+static struct resource au1xxx_eth0_resources[] =3D {
+	[0] =3D {
+		.name	=3D "eth-base",
+		.start	=3D ETH0_BASE,
+		.end	=3D ETH0_BASE + MAC_IOSIZE - 1,
+		.flags	=3D IORESOURCE_MEM,
+	},
+	[1] =3D {
+		.name	=3D "eth-mac",
+		.start	=3D MAC0_ENABLE,
+		.end	=3D MAC0_ENABLE + 4 - 1,
+		.flags	=3D IORESOURCE_MEM,
+	},
+	[2] =3D {
+		.name	=3D "eth-irq",
+#if defined(CONFIG_SOC_AU1550)
+		.start	=3D AU1550_MAC0_DMA_INT,
+		.end	=3D AU1550_MAC0_DMA_INT,
+#else
+		.start	=3D AU1000_MAC0_DMA_INT,
+		.end	=3D AU1000_MAC0_DMA_INT,
+#endif
+		.flags	=3D IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device au1xxx_eth0_device =3D {
+	.name		=3D "au1000_eth",
+ 	.id		=3D 0,
+	.num_resources	=3D ARRAY_SIZE(au1xxx_eth0_resources),
+	.resource	=3D au1xxx_eth0_resources,
+};
+
+#if defined(CONFIG_SOC_AU1000) || \
+    defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)
+static struct resource au1xxx_eth1_resources[] =3D {
+	[0] =3D {
+		.name	=3D "eth-base",
+		.start	=3D ETH1_BASE,
+		.end	=3D ETH1_BASE + MAC_IOSIZE - 1,
+		.flags	=3D IORESOURCE_MEM,
+	},
+	[1] =3D {
+		.name	=3D "eth-mac",
+		.start	=3D MAC1_ENABLE,
+		.end	=3D MAC1_ENABLE + 4 - 1,
+		.flags	=3D IORESOURCE_MEM,
+	},
+	[2] =3D {
+		.name	=3D "eth-irq",
+#if defined(CONFIG_SOC_AU1550)
+		.start	=3D AU1550_MAC1_DMA_INT,
+		.end	=3D AU1550_MAC1_DMA_INT,
+#else
+		.start	=3D AU1000_MAC1_DMA_INT,
+		.end	=3D AU1000_MAC1_DMA_INT,
+#endif
+		.flags	=3D IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device au1xxx_eth1_device =3D {
+	.name		=3D "au1000_eth",
+ 	.id		=3D 1,
+	.num_resources	=3D ARRAY_SIZE(au1xxx_eth1_resources),
+	.resource	=3D au1xxx_eth1_resources,
+};
+#endif
+#endif
+
 /* OHCI (USB full speed host controller) */
 static struct resource au1xxx_usb_ohci_resources[] =3D {
 	[0] =3D {
@@ -270,7 +367,14 @@ static struct platform_device smc91x_dev
=20
 #endif
=20
 static struct platform_device *au1xxx_platform_devices[] __initdata =3D {
+#if defined(CONFIG_MIPS_AU1X00_ENET) || defined(CONFIG_MIPS_AU1X00_ENET_MO=
DULE)
+	&au1xxx_eth0_device,
+#if defined(CONFIG_SOC_AU1000) || \
+    defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)
+	&au1xxx_eth1_device,
+#endif
+#endif
 	&au1xxx_usb_ohci_device,
 	&au1x00_pcmcia_device,
 #ifdef CONFIG_FB_AU1100
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 27d465f..47c624b 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -453,13 +453,13 @@ config MIPS_GT96100ETH
 	  Say Y here to support the Ethernet subsystem on your GT96100 card.
=20
 config MIPS_AU1X00_ENET
-	bool "MIPS AU1000 Ethernet support"
+	tristate "MIPS AU1000 Ethernet support"
 	depends on NET_ETHERNET && SOC_AU1X00
 	select PHYLIB
 	select CRC32
 	help
 	  If you have an Alchemy Semi AU1X00 based system
-	  say Y.  Otherwise, say N.
+	  say Y or M.  Otherwise, say N.
=20
 config SGI_IOC3_ETH
 	bool "SGI IOC3 Ethernet"
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 55f6e3f..004452f 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -11,6 +11,8 @@
  * ioctls (SIOCGMIIPHY)
  * Copyright 2006 Herbert Valerio Riedel <hvr@gnu.org>
  *  converted to use linux-2.6.x's PHY framework
+ * Copyright 2006 Rodolfo Giometti <giometti@linux.it>
+ *  power management, driver registration and module support.
  *
  * Author: MontaVista Software, Inc.
  *         	ppopov@mvista.com or source@mvista.com
@@ -61,6 +63,7 @@ #include <asm/irq.h>
 #include <asm/io.h>
 #include <asm/processor.h>
=20
+#include <linux/platform_device.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/cpu.h>
 #include "au1000_eth.h"
@@ -83,7 +86,8 @@ MODULE_LICENSE("GPL");
 // prototypes
 static void hard_stop(struct net_device *);
 static void enable_rx_tx(struct net_device *dev);
-static struct net_device * au1000_probe(int port_num);
+static int au1000_lowlevel_probe(struct net_device *ndev, void *ioaddr, vo=
id *macen_addr, int port_num, int skip_prom);
+static void au1000_lowlevel_remove(struct net_device *ndev);
 static int au1000_init(struct net_device *);
 static int au1000_open(struct net_device *);
 static int au1000_close(struct net_device *);
@@ -520,59 +524,6 @@ setup_hw_rings(struct au1000_private *au
 	}
 }
=20
-static struct {
-	u32 base_addr;
-	u32 macen_addr;
-	int irq;
-	struct net_device *dev;
-} iflist[2] =3D {
-#ifdef CONFIG_SOC_AU1000
-	{AU1000_ETH0_BASE, AU1000_MAC0_ENABLE, AU1000_MAC0_DMA_INT},
-	{AU1000_ETH1_BASE, AU1000_MAC1_ENABLE, AU1000_MAC1_DMA_INT}
-#endif
-#ifdef CONFIG_SOC_AU1100
-	{AU1100_ETH0_BASE, AU1100_MAC0_ENABLE, AU1100_MAC0_DMA_INT}
-#endif
-#ifdef CONFIG_SOC_AU1500
-	{AU1500_ETH0_BASE, AU1500_MAC0_ENABLE, AU1500_MAC0_DMA_INT},
-	{AU1500_ETH1_BASE, AU1500_MAC1_ENABLE, AU1500_MAC1_DMA_INT}
-#endif
-#ifdef CONFIG_SOC_AU1550
-	{AU1550_ETH0_BASE, AU1550_MAC0_ENABLE, AU1550_MAC0_DMA_INT},
-	{AU1550_ETH1_BASE, AU1550_MAC1_ENABLE, AU1550_MAC1_DMA_INT}
-#endif
-};
-
-static int num_ifs;
-
-/*
- * Setup the base address and interupt of the Au1xxx ethernet macs
- * based on cpu type and whether the interface is enabled in sys_pinfunc
- * register. The last interface is enabled if SYS_PF_NI2 (bit 4) is 0.
- */
-static int __init au1000_init_module(void)
-{
-	int ni =3D (int)((au_readl(SYS_PINFUNC) & (u32)(SYS_PF_NI2)) >> 4);
-	struct net_device *dev;
-	int i, found_one =3D 0;
-
-	num_ifs =3D NUM_ETH_INTERFACES - ni;
-
-	for(i =3D 0; i < num_ifs; i++) {
-		dev =3D au1000_probe(i);
-		iflist[i].dev =3D dev;
-		if (dev)
-			found_one++;
-	}
-	if (!found_one)
-		return -ENODEV;
-	return 0;
-}
-
-/*
- * ethtool operations
- */
-
 static int au1000_get_settings(struct net_device *dev, struct ethtool_cmd =
*cmd)
 {
 	struct au1000_private *aup =3D (struct au1000_private *)dev->priv;
@@ -615,48 +566,14 @@ static struct ethtool_ops au1000_ethtool
 	.get_link =3D ethtool_op_get_link,
 };
=20
-static struct net_device * au1000_probe(int port_num)
+static int=20
+au1000_lowlevel_probe(struct net_device *ndev, void *ioaddr, void *macen_a=
ddr, int port_num, int skip_prom)
 {
-	static unsigned version_printed =3D 0;
-	struct au1000_private *aup =3D NULL;
-	struct net_device *dev =3D NULL;
+	struct au1000_private *aup =3D ndev->priv;
 	db_dest_t *pDB, *pDBfree;
 	char *pmac, *argptr;
 	char ethaddr[6];
-	int irq, i, err;
-	u32 base, macen;
-
-	if (port_num >=3D NUM_ETH_INTERFACES)
- 		return NULL;
-
-	base  =3D CPHYSADDR(iflist[port_num].base_addr );
-	macen =3D CPHYSADDR(iflist[port_num].macen_addr);
-	irq =3D iflist[port_num].irq;
-
-	if (!request_mem_region( base, MAC_IOSIZE, "Au1x00 ENET") ||
-	    !request_mem_region(macen, 4, "Au1x00 ENET"))
-		return NULL;
-
-	if (version_printed++ =3D=3D 0)
-		printk("%s version %s %s\n", DRV_NAME, DRV_VERSION, DRV_AUTHOR);
-
-	dev =3D alloc_etherdev(sizeof(struct au1000_private));
-	if (!dev) {
-		printk(KERN_ERR "%s: alloc_etherdev failed\n", DRV_NAME);
-		return NULL;
-	}
-
-	if ((err =3D register_netdev(dev)) !=3D 0) {
-		printk(KERN_ERR "%s: Cannot register net device, error %d\n",
-				DRV_NAME, err);
-		free_netdev(dev);
-		return NULL;
-	}
-
-	printk("%s: Au1xx0 Ethernet found at 0x%x, irq %d\n",
-		dev->name, base, irq);
-
-	aup =3D dev->priv;
+	int i, ret;
=20
 	/* Allocate the data buffers */
 	/* Snooping works fine with eth on all au1xxx */
@@ -664,79 +581,61 @@ static struct net_device * au1000_probe(
 						(NUM_TX_BUFFS + NUM_RX_BUFFS),
 						&aup->dma_addr,	0);
 	if (!aup->vaddr) {
-		free_netdev(dev);
-		release_mem_region( base, MAC_IOSIZE);
-		release_mem_region(macen, 4);
-		return NULL;
+		printk(KERN_ERR "%s: cannot dma_alloc_noncoherent\n",
+		       ndev->name);
+		ret =3D -ENOMEM;
+		goto out;
 	}
=20
 	/* aup->mac is the base address of the MAC's registers */
-	aup->mac =3D (volatile mac_reg_t *)iflist[port_num].base_addr;
-
+	aup->mac =3D (volatile mac_reg_t *)((unsigned long)ioaddr);
 	/* Setup some variables for quick register address access */
-	aup->enable =3D (volatile u32 *)iflist[port_num].macen_addr;
-	aup->mac_id =3D port_num;
-	au_macs[port_num] =3D aup;
-
-	if (port_num =3D=3D 0) {
-		/* Check the environment variables first */
-		if (get_ethernet_addr(ethaddr) =3D=3D 0)
-			memcpy(au1000_mac_addr, ethaddr, sizeof(au1000_mac_addr));
-		else {
-			/* Check command line */
-			argptr =3D prom_getcmdline();
-			if ((pmac =3D strstr(argptr, "ethaddr=3D")) =3D=3D NULL)
-				printk(KERN_INFO "%s: No MAC address found\n",
-						 dev->name);
-				/* Use the hard coded MAC addresses */
-			else {
-				str2eaddr(ethaddr, pmac + strlen("ethaddr=3D"));
-				memcpy(au1000_mac_addr, ethaddr,=20
-				       sizeof(au1000_mac_addr));
+	if (port_num =3D=3D 0)
+	{
+		if (!skip_prom) {
+			/* check env variables first */
+			if (!get_ethernet_addr(ethaddr)) {=20
+				memcpy(au1000_mac_addr, ethaddr, sizeof(au1000_mac_addr));
+			} else {
+				/* Check command line */
+				argptr =3D prom_getcmdline();
+				if ((pmac =3D strstr(argptr, "ethaddr=3D")) =3D=3D NULL) {
+					printk(KERN_INFO "%s: No mac address found\n",=20
+							ndev->name);
+					/* use the hard coded mac addresses */
+				} else {
+					str2eaddr(ethaddr, pmac + strlen("ethaddr=3D"));
+					memcpy(au1000_mac_addr, ethaddr,=20
+							sizeof(au1000_mac_addr));
+				}
 			}
 		}
=20
+		aup->enable =3D (volatile u32 *) ((unsigned long) macen_addr);
+		memcpy(ndev->dev_addr, au1000_mac_addr, sizeof(au1000_mac_addr));
 		setup_hw_rings(aup, MAC0_RX_DMA_ADDR, MAC0_TX_DMA_ADDR);
-	} else if (port_num =3D=3D 1)
-		setup_hw_rings(aup, MAC1_RX_DMA_ADDR, MAC1_TX_DMA_ADDR);
+		aup->mac_id =3D 0;
+		au_macs[0] =3D aup;
+	}
+		else
+	if (port_num =3D=3D 1)
+	{
+		aup->enable =3D (volatile u32 *) ((unsigned long) macen_addr);
+		memcpy(ndev->dev_addr, au1000_mac_addr, sizeof(au1000_mac_addr));
+		ndev->dev_addr[5] +=3D 0x01;
=20
-	/*
-	 * Assign to the Ethernet ports two consecutive MAC addresses
-	 * to match those that are printed on their stickers
-	 */
-	memcpy(dev->dev_addr, au1000_mac_addr, sizeof(au1000_mac_addr));
-	dev->dev_addr[5] +=3D port_num;
+		setup_hw_rings(aup, MAC1_RX_DMA_ADDR, MAC1_TX_DMA_ADDR);
+		aup->mac_id =3D 1;
+		au_macs[1] =3D aup;
+	}
+	else
+	{
+		printk(KERN_ERR "%s: bad ioaddr\n", ndev->name);
+	}
=20
 	*aup->enable =3D 0;
 	aup->mac_enabled =3D 0;
=20
-	aup->mii_bus.priv =3D dev;
-	aup->mii_bus.read =3D mdiobus_read;
-	aup->mii_bus.write =3D mdiobus_write;
-	aup->mii_bus.reset =3D mdiobus_reset;
-	aup->mii_bus.name =3D "au1000_eth_mii";
-	aup->mii_bus.id =3D aup->mac_id;
-	aup->mii_bus.irq =3D kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
-	for(i =3D 0; i < PHY_MAX_ADDR; ++i)
-		aup->mii_bus.irq[i] =3D PHY_POLL;
-
-	/* if known, set corresponding PHY IRQs */
-#if defined(AU1XXX_PHY_STATIC_CONFIG)
-# if defined(AU1XXX_PHY0_IRQ)
-	if (AU1XXX_PHY0_BUSID =3D=3D aup->mii_bus.id)
-		aup->mii_bus.irq[AU1XXX_PHY0_ADDR] =3D AU1XXX_PHY0_IRQ;
-# endif
-# if defined(AU1XXX_PHY1_IRQ)
-	if (AU1XXX_PHY1_BUSID =3D=3D aup->mii_bus.id)
-		aup->mii_bus.irq[AU1XXX_PHY1_ADDR] =3D AU1XXX_PHY1_IRQ;
-# endif
-#endif
-	mdiobus_register(&aup->mii_bus);
-
-	if (mii_probe(dev) !=3D 0) {
-		goto err_out;
-	}
-
 	pDBfree =3D NULL;
 	/* setup the data buffer descriptors and attach a buffer to each one */
 	pDB =3D aup->db;
@@ -752,6 +651,7 @@ #endif
 	for (i =3D 0; i < NUM_RX_DMA; i++) {
 		pDB =3D GetFreeDB(aup);
 		if (!pDB) {
+			ret =3D -ENOMEM;
 			goto err_out;
 		}
 		aup->rx_dma_ring[i]->buff_stat =3D (unsigned)pDB->dma_addr;
@@ -760,6 +660,7 @@ #endif
 	for (i =3D 0; i < NUM_TX_DMA; i++) {
 		pDB =3D GetFreeDB(aup);
 		if (!pDB) {
+			ret =3D -ENOMEM;
 			goto err_out;
 		}
 		aup->tx_dma_ring[i]->buff_stat =3D (unsigned)pDB->dma_addr;
@@ -767,31 +668,23 @@ #endif
 		aup->tx_db_inuse[i] =3D pDB;
 	}
=20
-	spin_lock_init(&aup->lock);
-	dev->base_addr =3D base;
-	dev->irq =3D irq;
-	dev->open =3D au1000_open;
-	dev->hard_start_xmit =3D au1000_tx;
-	dev->stop =3D au1000_close;
-	dev->get_stats =3D au1000_get_stats;
-	dev->set_multicast_list =3D &set_rx_mode;
-	dev->do_ioctl =3D &au1000_ioctl;
-	SET_ETHTOOL_OPS(dev, &au1000_ethtool_ops);
-	dev->tx_timeout =3D au1000_tx_timeout;
-	dev->watchdog_timeo =3D ETH_TX_TIMEOUT;
+	return 0;
=20
-	/*=20
-	 * The boot code uses the ethernet controller, so reset it to start=20
-	 * fresh.  au1000_init() expects that the device is in reset state.
-	 */
-	reset_mac(dev);
+err_out :
+	au1000_lowlevel_remove(ndev);
+out :
+	return ret;
+}
=20
-	return dev;
+static void
+au1000_lowlevel_remove(struct net_device *ndev)
+{
+	struct au1000_private *aup =3D ndev->priv;
+	int i;
=20
-err_out:
 	/* here we should have a valid dev plus aup-> register addresses
 	 * so we can reset the mac properly.*/
-	reset_mac(dev);
+	reset_mac(ndev);
=20
 	for (i =3D 0; i < NUM_RX_DMA; i++) {
 		if (aup->rx_db_inuse[i])
@@ -801,13 +694,10 @@ err_out:
 		if (aup->tx_db_inuse[i])
 			ReleaseDB(aup, aup->tx_db_inuse[i]);
 	}
-	dma_free_noncoherent(NULL, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS),
-			     (void *)aup->vaddr, aup->dma_addr);
-	unregister_netdev(dev);
-	free_netdev(dev);
-	release_mem_region( base, MAC_IOSIZE);
-	release_mem_region(macen, 4);
-	return NULL;
+	dma_free_noncoherent(NULL,
+			MAX_BUF_SIZE * (NUM_TX_BUFFS+NUM_RX_BUFFS),
+			(void *)aup->vaddr,
+			aup->dma_addr);
 }
=20
 /*=20
@@ -1009,38 +899,15 @@ static int au1000_close(struct net_devic
 	return 0;
 }
=20
-static void __exit au1000_cleanup_module(void)
-{
-	int i, j;
-	struct net_device *dev;
-	struct au1000_private *aup;
-
-	for (i =3D 0; i < num_ifs; i++) {
-		dev =3D iflist[i].dev;
-		if (dev) {
-			aup =3D (struct au1000_private *) dev->priv;
-			unregister_netdev(dev);
-			for (j =3D 0; j < NUM_RX_DMA; j++)
-				if (aup->rx_db_inuse[j])
-					ReleaseDB(aup, aup->rx_db_inuse[j]);
-			for (j =3D 0; j < NUM_TX_DMA; j++)
-				if (aup->tx_db_inuse[j])
-					ReleaseDB(aup, aup->tx_db_inuse[j]);
- 			dma_free_noncoherent(NULL, MAX_BUF_SIZE *
- 					     (NUM_TX_BUFFS + NUM_RX_BUFFS),
- 					     (void *)aup->vaddr, aup->dma_addr);
- 			release_mem_region(dev->base_addr, MAC_IOSIZE);
- 			release_mem_region(CPHYSADDR(iflist[i].macen_addr), 4);
-			free_netdev(dev);
-		}
-	}
-}
-
-static void update_tx_stats(struct net_device *dev, u32 status)
+static inline void
+update_tx_stats(struct net_device *dev, u32 status, u32 pkt_len)
 {
 	struct au1000_private *aup =3D (struct au1000_private *) dev->priv;
 	struct net_device_stats *ps =3D &aup->stats;
=20
+	ps->tx_packets++;
+	ps->tx_bytes +=3D pkt_len;
+
 	if (status & TX_FRAME_ABORTED) {
 		if (!aup->phy_dev || (DUPLEX_FULL =3D=3D aup->phy_dev->duplex)) {
 			if (status & (TX_JAB_TIMEOUT | TX_UNDERRUN)) {
@@ -1073,7 +940,7 @@ static void au1000_tx_ack(struct net_dev
 	ptxd =3D aup->tx_dma_ring[aup->tx_tail];
=20
 	while (ptxd->buff_stat & TX_T_DONE) {
-		update_tx_stats(dev, ptxd->status);
+		update_tx_stats(dev, ptxd->status, ptxd->len & 0x3ff);
 		ptxd->buff_stat &=3D ~TX_T_DONE;
 		ptxd->len =3D 0;
 		au_sync();
@@ -1095,7 +962,6 @@ static void au1000_tx_ack(struct net_dev
 static int au1000_tx(struct sk_buff *skb, struct net_device *dev)
 {
 	struct au1000_private *aup =3D (struct au1000_private *) dev->priv;
-	struct net_device_stats *ps =3D &aup->stats;
 	volatile tx_dma_t *ptxd;
 	u32 buff_stat;
 	db_dest_t *pDB;
@@ -1115,7 +981,7 @@ static int au1000_tx(struct sk_buff *skb
 		return 1;
 	}
 	else if (buff_stat & TX_T_DONE) {
-		update_tx_stats(dev, ptxd->status);
+		update_tx_stats(dev, ptxd->status, ptxd->len & 0x3ff);
 		ptxd->len =3D 0;
 	}
=20
@@ -1135,9 +1001,6 @@ static int au1000_tx(struct sk_buff *skb
 	else
 		ptxd->len =3D skb->len;
=20
-	ps->tx_packets++;
-	ps->tx_bytes +=3D ptxd->len;
-
 	ptxd->buff_stat =3D pDB->dma_addr | TX_DMA_ENABLE;
 	au_sync();
 	dev_kfree_skb(skb);
@@ -1340,5 +1203,251 @@ static struct net_device_stats *au1000_g
 	return 0;
 }
=20
-module_init(au1000_init_module);
-module_exit(au1000_cleanup_module);
+/*
+ * Setup the base address and interupt of the Au1xxx ethernet macs
+ * based on cpu type and whether the interface is enabled in sys_pinfunc
+ * register. The last interface is enabled if SYS_PF_NI2 (bit 4) is 0.
+ */
+static int au1000_drv_probe(struct device *dev)
+{
+	struct platform_device *pdev =3D to_platform_device(dev);
+	struct net_device *ndev;
+	struct au1000_private *aup;
+	struct resource *res;
+	static unsigned version_printed =3D 0;
+	u32 base_addr_phys;
+	void *base_addr, *macen_addr;
+	int i, irq, ret;
+
+	if (pdev->id =3D=3D 1 && (au_readl(SYS_PINFUNC) & SYS_PF_NI2) !=3D 0)
+		return -ENODEV;
+
+	/* Get the resource info */
+	res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "eth-base");
+	if (!res) {
+		ret =3D -ENODEV;
+		goto out;
+	}
+	base_addr_phys =3D res->start;
+	base_addr =3D ioremap(res->start, res->end - res->start);
+	if (!base_addr) {
+		printk (KERN_ERR "%s: unable to remap address %lx\n",
+		        DRV_NAME, (long unsigned int) res->start); =20
+		ret =3D -EINVAL;
+		goto out;
+	}
+	res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "eth-mac");
+	if (!res) {
+		ret =3D -ENODEV;
+		goto out_release_io;
+	}
+	macen_addr =3D ioremap(res->start, res->end - res->start);
+	if (!macen_addr) {
+		printk (KERN_ERR "%s: unable to remap address %lx\n",
+		        DRV_NAME, (long unsigned int) res->start); =20
+		ret =3D -ENOMEM;
+		goto out_release_io;
+	}
+	res =3D platform_get_resource_byname(pdev, IORESOURCE_IRQ, "eth-irq");
+	if (!res) {
+		ret =3D -ENODEV;
+		goto out_release_iomac;
+	}
+	irq =3D res->start;
+
+	if (version_printed++ =3D=3D 0)=20
+		printk("%s version %s %s\n", DRV_NAME, DRV_VERSION, DRV_AUTHOR);
+
+	ndev =3D alloc_etherdev(sizeof(struct au1000_private));
+	if (!ndev) {
+		printk (KERN_ERR "%s: alloc etherdev failed\n", DRV_NAME); =20
+		ret =3D -ENOMEM;
+		goto out_release_iomac;
+	}
+	SET_MODULE_OWNER(ndev);
+	SET_NETDEV_DEV(ndev, dev);
+
+	/* Force the device name to a know state... */
+	sprintf(ndev->name, "au1xxx_eth(%d)", pdev->id);
+	ret =3D au1000_lowlevel_probe(ndev, base_addr, macen_addr, pdev->id, 0);
+	if (ret < 0) {
+		printk (KERN_ERR "%s: low level probe failed\n", DRV_NAME); =20
+		goto out_free_netdev;
+	}
+
+	aup =3D ndev->priv;
+
+	/* Register the MII bus */
+	aup->mii_bus.priv =3D ndev;
+	aup->mii_bus.read =3D mdiobus_read;
+	aup->mii_bus.write =3D mdiobus_write;
+	aup->mii_bus.reset =3D mdiobus_reset;
+	aup->mii_bus.name =3D "au1000_eth_mii";
+	aup->mii_bus.id =3D aup->mac_id;
+	aup->mii_bus.irq =3D kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
+	for(i =3D 0; i < PHY_MAX_ADDR; ++i)
+		aup->mii_bus.irq[i] =3D PHY_POLL;
+
+	/* if known, set corresponding PHY IRQs */
+#if defined(AU1XXX_PHY_STATIC_CONFIG)
+# if defined(AU1XXX_PHY0_IRQ)
+	if (AU1XXX_PHY0_BUSID =3D=3D aup->mii_bus.id)
+		aup->mii_bus.irq[AU1XXX_PHY0_ADDR] =3D AU1XXX_PHY0_IRQ;
+# endif
+# if defined(AU1XXX_PHY1_IRQ)
+	if (AU1XXX_PHY1_BUSID =3D=3D aup->mii_bus.id)
+		aup->mii_bus.irq[AU1XXX_PHY1_ADDR] =3D AU1XXX_PHY1_IRQ;
+# endif
+#endif
+	mdiobus_register(&aup->mii_bus);
+
+	if (mii_probe(ndev) !=3D 0) {
+		ret =3D -EBUSY;
+		goto out_lowlevel_remove;
+	}
+
+	/* Came back to a more standard name before registering the
+	 * net device... */
+	strcpy(ndev->name, "eth%d");
+
+	/* Setup base info */
+	spin_lock_init(&aup->lock);
+	ndev->base_addr =3D base_addr_phys;
+	ndev->irq =3D irq;
+	ndev->open =3D au1000_open;
+	ndev->hard_start_xmit =3D au1000_tx;
+	ndev->stop =3D au1000_close;
+	ndev->get_stats =3D au1000_get_stats;
+	ndev->set_multicast_list =3D &set_rx_mode;
+	ndev->do_ioctl =3D &au1000_ioctl;
+	SET_ETHTOOL_OPS(ndev, &au1000_ethtool_ops);
+	ndev->tx_timeout =3D au1000_tx_timeout;
+	ndev->watchdog_timeo =3D ETH_TX_TIMEOUT;
+
+	/*=20
+	 * The boot code uses the ethernet controller, so reset it to start=20
+	 * fresh.  au1000_init() expects that the device is in reset state.
+	 */
+	reset_mac(ndev);
+
+	ret =3D register_netdev(ndev);
+	if (ret) {
+		printk(KERN_ERR "%s: cannot register net device err %d\n",
+		       DRV_NAME, ret);
+		goto out_mdiobus_unregister;
+	}
+
+	printk("%s: Au1x Ethernet found at 0x%x, irq %d\n",=20
+			ndev->name, base_addr_phys, irq);
+
+	dev_set_drvdata(dev, ndev);
+
+	return 0;
+
+out_mdiobus_unregister :
+	mdiobus_unregister(&aup->mii_bus);
+out_lowlevel_remove :
+	au1000_lowlevel_remove(ndev);
+out_free_netdev :
+	free_netdev(ndev);
+out_release_iomac :
+	iounmap(macen_addr);
+out_release_io :
+	iounmap(base_addr);
+out :
+	printk("%s: not found (%d).\n", DRV_NAME, ret);
+
+	return ret;
+}
+
+static int au1000_drv_remove(struct device *dev)
+{
+	struct net_device *ndev =3D dev_get_drvdata(dev);
+	struct au1000_private *aup =3D (struct au1000_private *) ndev->priv;
+
+	dev_set_drvdata(dev, NULL);
+
+	unregister_netdev(ndev);
+	mdiobus_unregister(&aup->mii_bus);
+	au1000_lowlevel_remove(ndev);
+	free_netdev(ndev);
+
+	return 0;
+}
+
+#ifdef CONFIG_PM
+static int au1000_drv_suspend(struct device *dev, pm_message_t state)
+{
+	struct net_device *ndev =3D dev_get_drvdata(dev);
+	struct au1000_private *aup;
+	struct phy_device *phydev;
+
+	if (!ndev)
+		return 0;
+
+	aup =3D (struct au1000_private *) ndev->priv;
+	phydev =3D aup->phy_dev;
+
+	if (netif_running(ndev))
+		netif_device_detach(ndev);
+
+	au1000_lowlevel_remove(ndev);
+
+	return 0;
+}
+
+static int au1000_drv_resume(struct device *dev)
+{
+	struct net_device *ndev =3D dev_get_drvdata(dev);
+	struct au1000_private *aup;
+	struct phy_device *phydev;
+	int ret;
+
+	if (!ndev)
+		return 0;
+
+	aup =3D (struct au1000_private *) ndev->priv;
+	phydev =3D aup->phy_dev;
+
+	ret =3D au1000_lowlevel_probe(ndev, (void *) aup->mac, (void *) aup->enab=
le, aup->mac_id, ~0);
+	if (ret < 0) {
+		printk (KERN_ERR "%s: low level probe failed\n", DRV_NAME); =20
+		return ret;
+	}
+
+	/* au1000_init() expects that the device is in reset state.
+	 */
+	aup->mii_bus.reset(&aup->mii_bus);
+	reset_mac(ndev);
+	au1000_init(ndev);
+
+	if (netif_running(ndev))
+		netif_device_attach(ndev);
+
+	return 0;
+}
+#endif
+
+static struct device_driver au1000_driver =3D {
+	.name		=3D DRV_NAME,
+	.bus		=3D &platform_bus_type,
+	.probe          =3D au1000_drv_probe,
+	.remove         =3D au1000_drv_remove,
+#ifdef CONFIG_PM
+	.suspend        =3D au1000_drv_suspend,
+	.resume         =3D au1000_drv_resume,
+#endif
+};
+
+static int __init au1000_eth_init(void)
+{
+	return driver_register(&au1000_driver);
+}
+
+static void __exit au1000_eth_cleanup(void)
+{
+	driver_unregister(&au1000_driver);
+}
+
+module_init(au1000_eth_init);
+module_exit(au1000_eth_cleanup);
diff --git a/drivers/net/au1000_eth.h b/drivers/net/au1000_eth.h
index 41c2f84..056ecdc 100644
--- a/drivers/net/au1000_eth.h
+++ b/drivers/net/au1000_eth.h
@@ -27,7 +27,6 @@
  */
=20
=20
-#define MAC_IOSIZE 0x10000
 #define NUM_RX_DMA 4       /* Au1x00 has 4 rx hardware descriptors */
 #define NUM_TX_DMA 4       /* Au1x00 has 4 tx hardware descriptors */
=20
diff --git a/include/asm-mips/mach-au1x00/au1000.h b/include/asm-mips/mach-=
au1x00/au1000.h
index 582acd8..5d58ce6 100644
--- a/include/asm-mips/mach-au1x00/au1000.h
+++ b/include/asm-mips/mach-au1x00/au1000.h
@@ -605,11 +605,11 @@ #define UART3_ADDR                0xB140
 #define USB_OHCI_BASE             0x10100000 // phys addr for ioremap
 #define USB_HOST_CONFIG           0xB017fffc
=20
-#define AU1000_ETH0_BASE      0xB0500000
-#define AU1000_ETH1_BASE      0xB0510000
-#define AU1000_MAC0_ENABLE       0xB0520000
-#define AU1000_MAC1_ENABLE       0xB0520004
-#define NUM_ETH_INTERFACES 2
+#define ETH0_BASE                 0x10500000
+#define ETH1_BASE                 0x10510000
+#define MAC0_ENABLE               0x10520000
+#define MAC1_ENABLE               0x10520004
+#define NUM_ETH_INTERFACES        2
 #endif /* CONFIG_SOC_AU1000 */
=20
 /* Au1500 */
@@ -634,8 +634,8 @@ #define AU1000_USB_DEV_REQ_INT    24
 #define AU1000_USB_DEV_SUS_INT    25
 #define AU1000_USB_HOST_INT       26
 #define AU1000_ACSYNC_INT         27
-#define AU1500_MAC0_DMA_INT       28
-#define AU1500_MAC1_DMA_INT       29
+#define AU1000_MAC0_DMA_INT       28
+#define AU1000_MAC1_DMA_INT       29
 #define AU1000_AC97C_INT          31
 #define AU1000_GPIO_0             32
 #define AU1000_GPIO_1             33
@@ -682,11 +682,11 @@ #define UART3_ADDR                0xB140
 #define USB_OHCI_BASE             0x10100000 // phys addr for ioremap
 #define USB_HOST_CONFIG           0xB017fffc
=20
-#define AU1500_ETH0_BASE	  0xB1500000
-#define AU1500_ETH1_BASE	  0xB1510000
-#define AU1500_MAC0_ENABLE       0xB1520000
-#define AU1500_MAC1_ENABLE       0xB1520004
-#define NUM_ETH_INTERFACES 2
+#define ETH0_BASE	          0x11500000
+#define ETH1_BASE	          0x11510000
+#define MAC0_ENABLE               0x11520000
+#define MAC1_ENABLE               0x11520004
+#define NUM_ETH_INTERFACES        2
 #endif /* CONFIG_SOC_AU1500 */
=20
 /* Au1100 */
@@ -712,7 +712,7 @@ #define AU1000_USB_DEV_REQ_INT    24
 #define AU1000_USB_DEV_SUS_INT    25
 #define AU1000_USB_HOST_INT       26
 #define AU1000_ACSYNC_INT         27
-#define AU1100_MAC0_DMA_INT       28
+#define AU1000_MAC0_DMA_INT       28
 #define	AU1100_GPIO_208_215	29
 #define	AU1100_LCD_INT            30
 #define AU1000_AC97C_INT          31
@@ -756,9 +756,9 @@ #define UART3_ADDR                0xB140
 #define USB_OHCI_BASE             0x10100000 // phys addr for ioremap
 #define USB_HOST_CONFIG           0xB017fffc
=20
-#define AU1100_ETH0_BASE	  0xB0500000
-#define AU1100_MAC0_ENABLE       0xB0520000
-#define NUM_ETH_INTERFACES 1
+#define ETH0_BASE	          0x10500000
+#define MAC0_ENABLE               0x10520000
+#define NUM_ETH_INTERFACES        1
 #endif /* CONFIG_SOC_AU1100 */
=20
 #ifdef CONFIG_SOC_AU1550
@@ -791,8 +791,8 @@ #define AU1550_USB_HOST_INT       26
 #define AU1000_USB_DEV_REQ_INT    AU1550_USB_DEV_REQ_INT
 #define AU1000_USB_DEV_SUS_INT    AU1550_USB_DEV_SUS_INT
 #define AU1000_USB_HOST_INT       AU1550_USB_HOST_INT
-#define AU1550_MAC0_DMA_INT       27
-#define AU1550_MAC1_DMA_INT       28
+#define AU1000_MAC0_DMA_INT       27
+#define AU1000_MAC1_DMA_INT       28
 #define AU1000_GPIO_0             32
 #define AU1000_GPIO_1             33
 #define AU1000_GPIO_2             34
@@ -840,11 +840,11 @@ #define USB_OHCI_BASE             0x1402
 #define USB_OHCI_LEN              0x00060000
 #define USB_HOST_CONFIG           0xB4027ffc
=20
-#define AU1550_ETH0_BASE      0xB0500000
-#define AU1550_ETH1_BASE      0xB0510000
-#define AU1550_MAC0_ENABLE       0xB0520000
-#define AU1550_MAC1_ENABLE       0xB0520004
-#define NUM_ETH_INTERFACES 2
+#define ETH0_BASE                 0x10500000
+#define ETH1_BASE                 0x10510000
+#define MAC0_ENABLE               0x10520000
+#define MAC1_ENABLE               0x10520004
+#define NUM_ETH_INTERFACES        2
 #endif /* CONFIG_SOC_AU1550 */
=20
 #ifdef CONFIG_SOC_AU1200
@@ -1069,6 +1069,7 @@ #define USBD_ENABLE               0xB020
 #endif /* !CONFIG_SOC_AU1200 */
=20
 /* Ethernet Controllers  */
+#define MAC_IOSIZE                      0x10000
=20
 /* 4 byte offsets from AU1000_ETH_BASE */
 #define MAC_CONTROL                     0x0

--Clx92ZfkiYIKRjnr--

--BI5RvnYi6R4T2M87
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFEve10QaTCYNJaVjMRAlLBAJ4neCWWLsTpZWC3+GjBaAFCw8PzMwCfVRJt
9Bzh6yRSkLGmkwfswhetgTg=
=OKxn
-----END PGP SIGNATURE-----

--BI5RvnYi6R4T2M87--

From giometti@enneenne.com Wed Jul 19 10:16:00 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 19 Jul 2006 10:16:08 +0100 (BST)
Received: from 81-174-11-161.f5.ngi.it ([81.174.11.161]:41885 "EHLO
	mail.enneenne.com") by ftp.linux-mips.org with ESMTP
	id S8133416AbWGSJQA (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 19 Jul 2006 10:16:00 +0100
Received: from zaigor.enneenne.com ([192.168.32.1])
	by mail.enneenne.com with esmtp (Exim 4.50)
	id 1G37BC-0004cF-8E; Wed, 19 Jul 2006 10:13:14 +0200
Received: from giometti by zaigor.enneenne.com with local (Exim 4.60)
	(envelope-from <giometti@enneenne.com>)
	id 1G389w-0000Ip-1X; Wed, 19 Jul 2006 11:16:00 +0200
Date:	Wed, 19 Jul 2006 11:16:00 +0200
From:	Rodolfo Giometti <giometti@linux.it>
To:	linux-kernel@vger.kernel.org
Cc:	linux-mips@linux-mips.org
Message-ID: <20060719091559.GD25330@enneenne.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="OaZoDhBhXzo6bW1J"
Content-Disposition: inline
Organization: GNU/Linux Device Drivers, Embedded Systems and Courses
X-PGP-Key: gpg --keyserver keyserver.linux.it --recv-keys D25A5633
User-Agent: Mutt/1.5.11+cvs20060403
X-SA-Exim-Connect-IP: 192.168.32.1
X-SA-Exim-Mail-From: giometti@enneenne.com
Subject: [PATCH] no console disabling during suspend stage
X-SA-Exim-Version: 4.2 (built Thu, 03 Mar 2005 10:44:12 +0100)
X-SA-Exim-Scanned: Yes (on mail.enneenne.com)
Return-Path: <giometti@enneenne.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: 12027
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: giometti@linux.it
Precedence: bulk
X-list: linux-mips


--OaZoDhBhXzo6bW1J
Content-Type: multipart/mixed; boundary="uXxzq0nDebZQVNAZ"
Content-Disposition: inline


--uXxzq0nDebZQVNAZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello,

here a little patch to avoid disabling console during suspend stage
while we are debugging kernel.

Ciao,

Rodolfo

Signed-off-by: Rodolfo Giometti <giometti@linux.it>

--=20

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

--uXxzq0nDebZQVNAZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-no-console-disabling-on-kernel-debugging
Content-Transfer-Encoding: quoted-printable

--- kernel/power/main.c	2006-07-19 10:54:11.000000000 +0200
+++ kernel/power/main.c.new	2006-07-18 19:38:41.000000000 +0200
@@ -86,7 +86,9 @@
 			goto Thaw;
 	}
=20
+#ifndef CONFIG_DEBUG_KERNEL
 	suspend_console();
+#endif
 	if ((error =3D device_suspend(PMSG_SUSPEND))) {
 		printk(KERN_ERR "Some devices failed to suspend\n");
 		goto Finish;

--uXxzq0nDebZQVNAZ--

--OaZoDhBhXzo6bW1J
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFEvfhPQaTCYNJaVjMRArQ/AJ9kH8tD9+4Ns9dePH7itlofL9XqvACgk+ur
ne26TtLGRWhHpAkSQBOmV64=
=Wnji
-----END PGP SIGNATURE-----

--OaZoDhBhXzo6bW1J--

From hemanth.venkatesh@wipro.com Wed Jul 19 15:13:12 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 19 Jul 2006 15:13:21 +0100 (BST)
Received: from wip-ec-wd.wipro.com ([203.91.193.32]:65209 "EHLO
	wip-ec-wd.wipro.com") by ftp.linux-mips.org with ESMTP
	id S8133477AbWGSONM (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 19 Jul 2006 15:13:12 +0100
Received: from wip-ec-wd.wipro.com (localhost.wipro.com [127.0.0.1])
	by localhost (Postfix) with ESMTP id 3D57220654
	for <linux-mips@linux-mips.org>; Wed, 19 Jul 2006 19:40:10 +0530 (IST)
Received: from blr-ec-bh02.wipro.com (blr-ec-bh02.wipro.com [10.201.50.92])
	by wip-ec-wd.wipro.com (Postfix) with ESMTP id 2901020626
	for <linux-mips@linux-mips.org>; Wed, 19 Jul 2006 19:40:10 +0530 (IST)
Received: from blr-m2-msg.wipro.com ([10.116.50.99]) by blr-ec-bh02.wipro.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 19 Jul 2006 19:43:03 +0530
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C6AB3D.728FBB18"
Subject: CRAMFS  Ramdisk image as Rootfs
Date:	Wed, 19 Jul 2006 19:43:03 +0530
Message-ID: <2156B1E923F1A147AABDF4D9FDEAB4CB09D2DE@blr-m2-msg.wipro.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: CRAMFS  Ramdisk image as Rootfs
Thread-Index: AcarPJ0J09gYqrEETqyoWap0XUe/Hg==
From:	<hemanth.venkatesh@wipro.com>
To:	<linux-mips@linux-mips.org>
X-OriginalArrivalTime: 19 Jul 2006 14:13:03.0280 (UTC) FILETIME=[72BA3B00:01C6AB3D]
Return-Path: <hemanth.venkatesh@wipro.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: 12028
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: hemanth.venkatesh@wipro.com
Precedence: bulk
X-list: linux-mips

This is a multi-part message in MIME format.

------_=_NextPart_001_01C6AB3D.728FBB18
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi All,

=20

I was trying to mount cramfs image as Ramdisk rootfs for 2.6.14 kernel.
Even though the kernel seems to detect the cramfs image, it is not able
to mount it as rootfs. It throws the error "cramfs: bad root offset
4864" The target is little endian, and  RHEL host on which the image was
built is also little endian.=20

=20

The other images like EXT2 for ramdisk don't seem to get detected at
all, and just throws error "VFS: Unable to mount root fs on
unknown-block(1,0)".  Anyone faced similar issue before or knows what
could be causing the problem.

=20

go r root=3D/dev/ram rd_start=3D0x85000000 rd_size=3D5009408 =
rootfstype=3Dcramfs

=20

Initializing IPsec netlink socket

NET: Registered protocol family 1

NET: Registered protocol family 17

md: Autodetecting RAID arrays.

md: autorun ...

md: ... autorun DONE.

WIPRO path_lookup retval 0

WIPRO security_sb_mount  retval 0

WIPRO do_new_mount retval 0

WIPRO do_mount retval 0

RAMDISK: cramfs filesystem found at block 0

RAMDISK: Loading 4892KiB [1 disk] into ram disk... done.

cramfs: bad root offset 4864

=20

Thanks

Hemanth


------_=_NextPart_001_01C6AB3D.728FBB18
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

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

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
 name=3D"PlaceName"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
 name=3D"PlaceType"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
 name=3D"place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Hi All,<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I was trying to <st1:place w:st=3D"on"><st1:PlaceType =
w:st=3D"on">mount</st1:PlaceType>
 <st1:PlaceName w:st=3D"on">cramfs</st1:PlaceName></st1:place> image as =
Ramdisk
rootfs for 2.6.14 kernel. Even though the kernel seems to detect the =
cramfs
image, it is not able to mount it as rootfs. It throws the error =
&#8220;cramfs:
bad root offset 4864&#8221; The target is little endian, and &nbsp;RHEL =
host on
which the image was built is also little endian. =
<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>The other images like EXT2 for ramdisk don&#8217;t =
seem to
get detected at all, and just throws error &#8220;VFS: Unable to mount =
root fs
on unknown-block(1,0)&#8221;.&nbsp; Anyone faced similar issue before or =
knows
what could be causing the problem.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>go r root=3D/dev/ram rd_start=3D0x85000000 =
rd_size=3D5009408
rootfstype=3Dcramfs<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Initializing IPsec netlink =
socket<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>NET: Registered protocol family =
1<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>NET: Registered protocol family =
17<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>md: Autodetecting RAID =
arrays.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>md: autorun ...<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>md: ... autorun DONE.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>WIPRO path_lookup retval =
0<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>WIPRO security_sb_mount&nbsp; retval =
0<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>WIPRO do_new_mount retval =
0<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>WIPRO do_mount retval 0<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>RAMDISK: cramfs filesystem found at block =
0<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>RAMDISK: Loading 4892KiB [1 disk] into ram disk... =
done.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>cramfs: bad root offset =
4864<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Thanks<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Hemanth<o:p></o:p></span></font></p>

</div>

</body>

</html>

------_=_NextPart_001_01C6AB3D.728FBB18--

From ths@networkno.de Wed Jul 19 15:35:51 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 19 Jul 2006 15:35:59 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:25749 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8133425AbWGSOfv (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 19 Jul 2006 15:35:51 +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 465D945D53; Wed, 19 Jul 2006 16:35:50 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1G3D8f-0007tA-6z; Wed, 19 Jul 2006 15:35:01 +0100
Date:	Wed, 19 Jul 2006 15:35:01 +0100
To:	hemanth.venkatesh@wipro.com
Cc:	linux-mips@linux-mips.org
Subject: Re: CRAMFS  Ramdisk image as Rootfs
Message-ID: <20060719143500.GI4613@networkno.de>
References: <2156B1E923F1A147AABDF4D9FDEAB4CB09D2DE@blr-m2-msg.wipro.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <2156B1E923F1A147AABDF4D9FDEAB4CB09D2DE@blr-m2-msg.wipro.com>
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: 12029
X-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

hemanth.venkatesh@wipro.com wrote:
> Hi All,
> 
>  
> 
> I was trying to mount cramfs image as Ramdisk rootfs for 2.6.14 kernel.
> Even though the kernel seems to detect the cramfs image, it is not able
> to mount it as rootfs. It throws the error "cramfs: bad root offset
> 4864" The target is little endian, and  RHEL host on which the image was
> built is also little endian. 

Sounds like the fs image is somewhat broken. Is the cramfs loop-mountable
on RHEL without showing the error message?


Thiemo

From hemanth.venkatesh@wipro.com Wed Jul 19 15:39:37 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 19 Jul 2006 15:39:46 +0100 (BST)
Received: from wip-ec-wd.wipro.com ([203.91.193.32]:55739 "EHLO
	wip-ec-wd.wipro.com") by ftp.linux-mips.org with ESMTP
	id S8133425AbWGSOjh convert rfc822-to-8bit (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 19 Jul 2006 15:39:37 +0100
Received: from wip-ec-wd.wipro.com (localhost.wipro.com [127.0.0.1])
	by localhost (Postfix) with ESMTP id 80DA92063D
	for <linux-mips@linux-mips.org>; Wed, 19 Jul 2006 20:06:37 +0530 (IST)
Received: from blr-ec-bh02.wipro.com (blr-ec-bh02.wipro.com [10.201.50.92])
	by wip-ec-wd.wipro.com (Postfix) with ESMTP id 6B57A2061B
	for <linux-mips@linux-mips.org>; Wed, 19 Jul 2006 20:06:37 +0530 (IST)
Received: from blr-m2-msg.wipro.com ([10.116.50.99]) by blr-ec-bh02.wipro.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 19 Jul 2006 20:09:30 +0530
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 8BIT
Subject: RE: CRAMFS  Ramdisk image as Rootfs
Date:	Wed, 19 Jul 2006 20:09:30 +0530
Message-ID: <2156B1E923F1A147AABDF4D9FDEAB4CB09D2E6@blr-m2-msg.wipro.com>
In-Reply-To: <20060719143500.GI4613@networkno.de>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: CRAMFS  Ramdisk image as Rootfs
Thread-Index: AcarQLDHY0SZHVbVRUWxtoAC8ake1gAAL2Eg
From:	<hemanth.venkatesh@wipro.com>
To:	<ths@networkno.de>
Cc:	<linux-mips@linux-mips.org>
X-OriginalArrivalTime: 19 Jul 2006 14:39:30.0568 (UTC) FILETIME=[24D32880:01C6AB41]
Return-Path: <hemanth.venkatesh@wipro.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: 12030
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: hemanth.venkatesh@wipro.com
Precedence: bulk
X-list: linux-mips

Yes, I am able to mount the image on an RHEL host using the loopback
device.

Hemanth

-----Original Message-----
From: Thiemo Seufer [mailto:ths@networkno.de] 
Sent: Wednesday, July 19, 2006 8:05 PM
To: Hemanth V (WT01 - Embedded Systems)
Cc: linux-mips@linux-mips.org
Subject: Re: CRAMFS Ramdisk image as Rootfs

hemanth.venkatesh@wipro.com wrote:
> Hi All,
> 
>  
> 
> I was trying to mount cramfs image as Ramdisk rootfs for 2.6.14
kernel.
> Even though the kernel seems to detect the cramfs image, it is not
able
> to mount it as rootfs. It throws the error "cramfs: bad root offset
> 4864" The target is little endian, and  RHEL host on which the image
was
> built is also little endian. 

Sounds like the fs image is somewhat broken. Is the cramfs
loop-mountable
on RHEL without showing the error message?


Thiemo

From freddy@dusktilldawn.nl Wed Jul 19 16:58:17 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 19 Jul 2006 16:58:33 +0100 (BST)
Received: from tool.snarl.nl ([213.84.251.124]:51175 "EHLO tool.snarl.nl")
	by ftp.linux-mips.org with ESMTP id S8133431AbWGSP6R (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 19 Jul 2006 16:58:17 +0100
Received: from localhost (tool.local.snarl.nl [127.0.0.1])
	by tool.snarl.nl (Postfix) with ESMTP id 055B85DFB3
	for <linux-mips@linux-mips.org>; Wed, 19 Jul 2006 17:58:05 +0200 (CEST)
Received: from tool.snarl.nl ([127.0.0.1])
	by localhost (tool.local.snarl.nl [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id SO030LJDf7zR for <linux-mips@linux-mips.org>;
	Wed, 19 Jul 2006 17:58:04 +0200 (CEST)
Received: by tool.snarl.nl (Postfix, from userid 1000)
	id 845E35DF86; Wed, 19 Jul 2006 17:58:04 +0200 (CEST)
Date:	Wed, 19 Jul 2006 17:58:04 +0200
From:	Freddy Spierenburg <freddy@dusktilldawn.nl>
To:	linux-mips@linux-mips.org
Subject: pseudo 32 bit physical addresses and the real 36 bit world
Message-ID: <20060719155804.GB5162@dusktilldawn.nl>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="k/A+UfywgnnvevLW"
Content-Disposition: inline
X-User-Agent-Feature: All mail clients suck. This one just sucks less.
X-GPG-Key: http://snarl.nl/~freddy/keys/freddyPublicKey.gpg
User-Agent: Mutt/1.5.11+cvs20060403
Return-Path: <freddy@dusktilldawn.nl>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12031
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: freddy@dusktilldawn.nl
Precedence: bulk
X-list: linux-mips


--k/A+UfywgnnvevLW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi,

The AU1100 processor uses internally a 36-bit address bus. The
kernel (32 bits) is only able to work with 32-bit addresses.
Well, there must exist some sort of scheme for the kernel to work
with these 36-bit addresses, but I don't quiet get it yet. Is
anybody willing to give me some insight?

I'm looking at the pcmcia implementation at this moment and I
don't get it. If I look at drivers/pcmcia/au1000_generic.h I see
AU1X_SOCK0_IO defines as 0xF00000000 (note the 36 bit length).
This one is used in drivers/pcmcia/au1000_generic.c
au1x00_pcmcia_socket_probe() where it get cast to phys_t. phys_t
is a typedef from include/asm-mips/types.h as an unsigned long.
Of course the compiler warns us during compilation of
drivers/pcmcia/au1000_generic.c:

drivers/pcmcia/au1000_generic.c:403: warning: integer constant is too large=
 for "long" type
drivers/pcmcia/au1000_generic.c:406: warning: integer constant is too large=
 for "long" type
drivers/pcmcia/au1000_generic.c:414: warning: integer constant is too large=
 for "long" type

And this is where I'm sort of lost. How can this scheme work? I
must be missing something, but I don't understand it. I expect
=66rom reading the au1100 databook and 'See MIPS Run (chapter 6)
that the TLB is involved, but I'm not yet able to link it
altogether.

I also expect more is happening with the
AU1X_SOCK0_PSEUDO_PHYS_ATTR and AU1X_SOCK0_PSEUDO_PHYS_MEM, but
not that I can find any clue how this appears to work.

To end this email into a happy end I shall also explain what I
really want to do. We've built our own computer using the AU1100
processor. We've connected two SC16C652 dual UART's, one to RCS2
and one to RCS3. Now I want to map those UARTS at AE000000 and
AE040000. I've configured the mem_stcfg[23], mem_sttime[23] and
mem_staddr[23] registers in yamon:

  #define MEM_STCFG[23]   0x00000001
  #define MEM_STTIME[23]  0x03FFC7C7
  #define MEM_STADDR2     0x1AE03FFF
  #define MEM_STADDR3     0x1AE07FFF

But after that I'm sort of lost in the dark. What should I do
inside the kernel so that when I refer to AE000000 in my driver
the processor triggers chip select 2 (RCS2)?

Any hints would be appreciated.


--=20
$ cat ~/.signature
Freddy Spierenburg <freddy@dusktilldawn.nl>  http://freddy.snarl.nl/
GnuPG: 0x7941D1E1=3DC948 5851 26D2 FA5C 39F1  E588 6F17 FD5D 7941 D1E1
$ # Please read http://www.ietf.org/rfc/rfc2015.txt before complain!

--k/A+UfywgnnvevLW
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEvlaMbxf9XXlB0eERAgXLAJ9OyZ4SVt1jV08HHTqd75oIv+5pqwCgki1J
MgCSjlp348P9892I5u8Mkk4=
=gLxw
-----END PGP SIGNATURE-----

--k/A+UfywgnnvevLW--

From dan@embeddedalley.com Wed Jul 19 17:21:55 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 19 Jul 2006 17:22:04 +0100 (BST)
Received: from smtp106.biz.mail.re2.yahoo.com ([206.190.52.175]:13758 "HELO
	smtp106.biz.mail.re2.yahoo.com") by ftp.linux-mips.org with SMTP
	id S8133715AbWGSQVz (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 19 Jul 2006 17:21:55 +0100
Received: (qmail 66070 invoked from network); 19 Jul 2006 16:21:49 -0000
Received: from unknown (HELO ?172.16.1.43?) (dan@embeddedalley.com@12.6.244.2 with plain)
  by smtp106.biz.mail.re2.yahoo.com with SMTP; 19 Jul 2006 16:21:48 -0000
In-Reply-To: <20060719155804.GB5162@dusktilldawn.nl>
References: <20060719155804.GB5162@dusktilldawn.nl>
Mime-Version: 1.0 (Apple Message framework v752.2)
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
Message-Id: <C4E21CBB-A5C6-49F5-A585-0910DD069544@embeddedalley.com>
Cc:	linux-mips@linux-mips.org
Content-Transfer-Encoding: 7bit
From:	Dan Malek <dan@embeddedalley.com>
Subject: Re: pseudo 32 bit physical addresses and the real 36 bit world
Date:	Wed, 19 Jul 2006 12:22:10 -0400
To:	Freddy Spierenburg <freddy@dusktilldawn.nl>
X-Mailer: Apple Mail (2.752.2)
Return-Path: <dan@embeddedalley.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12032
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dan@embeddedalley.com
Precedence: bulk
X-list: linux-mips


On Jul 19, 2006, at 11:58 AM, Freddy Spierenburg wrote:

> The AU1100 processor uses internally a 36-bit address bus. The
> kernel (32 bits) is only able to work with 32-bit addresses.
> Well, there must exist some sort of scheme for the kernel to work
> with these 36-bit addresses, but I don't quiet get it yet. Is
> anybody willing to give me some insight?

On the Alchemy processors, only some peripherals exist
above the 32-bit boundary.  We use a 64-bit version of
ioremap() to access this space.

> Of course the compiler warns us during compilation of
> drivers/pcmcia/au1000_generic.c:
>
> drivers/pcmcia/au1000_generic.c:403: warning: integer constant is  
> too large for "long" type

It looks like your configuration file is not enabling the
64-bit IO option.

> ....  I expect
> from reading the au1100 databook and 'See MIPS Run (chapter 6)
> that the TLB is involved, but I'm not yet able to link it
> altogether.

This has already been done for you :-)  There is nothing
for you to invent.  You didn't mention which version of
the kernel you are using, but the default configuration
files for boards with Alchemy processors should have
all of this properly configured.

Thanks.

	-- Dan


From ppopov@embeddedalley.com Wed Jul 19 17:59:09 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 19 Jul 2006 17:59:19 +0100 (BST)
Received: from smtp101.biz.mail.mud.yahoo.com ([68.142.200.236]:22353 "HELO
	smtp101.biz.mail.mud.yahoo.com") by ftp.linux-mips.org with SMTP
	id S8133477AbWGSQ7J (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 19 Jul 2006 17:59:09 +0100
Received: (qmail 92580 invoked from network); 19 Jul 2006 16:59:02 -0000
Received: from unknown (HELO ?192.168.15.100?) (ppopov@embeddedalley.com@63.194.214.47 with plain)
  by smtp101.biz.mail.mud.yahoo.com with SMTP; 19 Jul 2006 16:59:01 -0000
Subject: Re: pseudo 32 bit physical addresses and the real 36 bit world
From:	Pete Popov <ppopov@embeddedalley.com>
Reply-To: ppopov@embeddedalley.com
To:	Freddy Spierenburg <freddy@dusktilldawn.nl>
Cc:	linux-mips@linux-mips.org
In-Reply-To: <20060719155804.GB5162@dusktilldawn.nl>
References: <20060719155804.GB5162@dusktilldawn.nl>
Content-Type: text/plain
Organization: Embedded Alley Solutions, Inc
Date:	Wed, 19 Jul 2006 09:58:49 -0700
Message-Id: <1153328330.15277.29.camel@localhost.localdomain>
Mime-Version: 1.0
X-Mailer: Evolution 2.4.1 
Content-Transfer-Encoding: 7bit
Return-Path: <ppopov@embeddedalley.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12033
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ppopov@embeddedalley.com
Precedence: bulk
X-list: linux-mips

On Wed, 2006-07-19 at 17:58 +0200, Freddy Spierenburg wrote:
> Hi,
> 
> The AU1100 processor uses internally a 36-bit address bus. The
> kernel (32 bits) is only able to work with 32-bit addresses.
> Well, there must exist some sort of scheme for the kernel to work
> with these 36-bit addresses, but I don't quiet get it yet. Is
> anybody willing to give me some insight?
> 
> I'm looking at the pcmcia implementation at this moment and I
> don't get it. If I look at drivers/pcmcia/au1000_generic.h I see
> AU1X_SOCK0_IO defines as 0xF00000000 (note the 36 bit length).
> This one is used in drivers/pcmcia/au1000_generic.c
> au1x00_pcmcia_socket_probe() where it get cast to phys_t. phys_t
> is a typedef from include/asm-mips/types.h as an unsigned long.
> Of course the compiler warns us during compilation of
> drivers/pcmcia/au1000_generic.c:
> 
> drivers/pcmcia/au1000_generic.c:403: warning: integer constant is too large for "long" type
> drivers/pcmcia/au1000_generic.c:406: warning: integer constant is too large for "long" type
> drivers/pcmcia/au1000_generic.c:414: warning: integer constant is too large for "long" type
> 
> And this is where I'm sort of lost. How can this scheme work? 

PCMCIA is one of the peripherals on the Au1x processors that is accessed
on a 36bit physical address. The actual phys address is 36 bit, however,
the generic Linux pcmcia layer doesn't support 36 bit phys addresses. In
order to avoid having to modify that common code, the Au1x 36 bit
support uses, in this case, 32 bit pseudo phys address. If you take a
look at ioremap(), you'll see a call to a fixup function. This function
detects the pseudo phys address and returns the real 36 bit phys address
that then gets ioremapped.

> I
> must be missing something, but I don't understand it. I expect
> from reading the au1100 databook and 'See MIPS Run (chapter 6)
> that the TLB is involved, but I'm not yet able to link it
> altogether.
> 
> I also expect more is happening with the
> AU1X_SOCK0_PSEUDO_PHYS_ATTR and AU1X_SOCK0_PSEUDO_PHYS_MEM, but
> not that I can find any clue how this appears to work.
> 
> To end this email into a happy end I shall also explain what I
> really want to do. We've built our own computer using the AU1100
> processor. We've connected two SC16C652 dual UART's, one to RCS2
> and one to RCS3. Now I want to map those UARTS at AE000000 and
> AE040000. I've configured the mem_stcfg[23], mem_sttime[23] and
> mem_staddr[23] registers in yamon:
> 
>   #define MEM_STCFG[23]   0x00000001
>   #define MEM_STTIME[23]  0x03FFC7C7
>   #define MEM_STADDR2     0x1AE03FFF
>   #define MEM_STADDR3     0x1AE07FFF
> 
> But after that I'm sort of lost in the dark. What should I do
> inside the kernel so that when I refer to AE000000 in my driver
> the processor triggers chip select 2 (RCS2)?

Assuming you've setup mem_xxxx correctly, and AE000000 does not overlap
with some other phys address already used, then you should be ioremap
that address and use it directly.

Pete


From giometti@enneenne.com Wed Jul 19 19:02:20 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 19 Jul 2006 19:02:31 +0100 (BST)
Received: from 81-174-11-161.f5.ngi.it ([81.174.11.161]:21410 "EHLO
	mail.enneenne.com") by ftp.linux-mips.org with ESMTP
	id S3561480AbWGSSCU (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 19 Jul 2006 19:02:20 +0100
Received: from zaigor.enneenne.com ([192.168.32.1])
	by mail.enneenne.com with esmtp (Exim 4.50)
	id 1G3FOH-0006qK-Cb; Wed, 19 Jul 2006 18:59:18 +0200
Received: from giometti by zaigor.enneenne.com with local (Exim 4.60)
	(envelope-from <giometti@enneenne.com>)
	id 1G3GN2-00028n-T4; Wed, 19 Jul 2006 20:02:04 +0200
Date:	Wed, 19 Jul 2006 20:02:04 +0200
From:	Rodolfo Giometti <giometti@linux.it>
To:	i2c@lm-sensors.org
Cc:	linux-mips@linux-mips.org
Message-ID: <20060719180204.GK25330@enneenne.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="DN8g+DOX2TxGxleI"
Content-Disposition: inline
Organization: GNU/Linux Device Drivers, Embedded Systems and Courses
X-PGP-Key: gpg --keyserver keyserver.linux.it --recv-keys D25A5633
User-Agent: Mutt/1.5.11+cvs20060403
X-SA-Exim-Connect-IP: 192.168.32.1
X-SA-Exim-Mail-From: giometti@enneenne.com
Subject: [PATCH] AU1100 I2C support
X-SA-Exim-Version: 4.2 (built Thu, 03 Mar 2005 10:44:12 +0100)
X-SA-Exim-Scanned: Yes (on mail.enneenne.com)
Return-Path: <giometti@enneenne.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: 12034
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: giometti@linux.it
Precedence: bulk
X-list: linux-mips


--DN8g+DOX2TxGxleI
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello,

here a patch to add I2C support to AU1100 processors by using two
GPIOs.

Ciao,

Rodolfo

Signed-off-by: Rodolfo Giometti <giometti@linux.it>

--=20

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

--DN8g+DOX2TxGxleI
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-i2c-gpio-support
Content-Transfer-Encoding: quoted-printable

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 884320e..222c7fc 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -419,6 +419,18 @@ config SCx200_ACB
 	  This support is also available as a module.  If so, the module=20
 	  will be called scx200_acb.
=20
+config AU1100_I2C
+	tristate "Au1100 I2C using GPIO pins"
+	depends on SOC_AU1100
+	select I2C_ALGOBIT
+	help
+	  Enable the use of two GPIO pins of a Au1100 processor as an I2C bus.
+
+	  If you don't know what to do here, say N.
+
+	  This support is also available as a module.  If so, the module=20
+	  will be called i2c-au1100.
+
 config I2C_SIS5595
 	tristate "SiS 5595"
 	depends on I2C && PCI
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
index ac56df5..adb7576 100644
--- a/drivers/i2c/busses/Makefile
+++ b/drivers/i2c/busses/Makefile
@@ -43,6 +43,7 @@ obj-$(CONFIG_I2C_VIAPRO)	+=3D i2c-viapro.o
 obj-$(CONFIG_I2C_VOODOO3)	+=3D i2c-voodoo3.o
 obj-$(CONFIG_SCx200_ACB)	+=3D scx200_acb.o
 obj-$(CONFIG_SCx200_I2C)	+=3D scx200_i2c.o
+obj-$(CONFIG_AU1100_I2C)	+=3D i2c-au1100.o
=20
 ifeq ($(CONFIG_I2C_DEBUG_BUS),y)
 EXTRA_CFLAGS +=3D -DDEBUG
diff --git a/drivers/i2c/busses/i2c-au1100.c b/drivers/i2c/busses/i2c-au110=
0.c
new file mode 100644
index 0000000..e010cf8
--- /dev/null
+++ b/drivers/i2c/busses/i2c-au1100.c
@@ -0,0 +1,139 @@
+/*=20
+   i2c-au1100.c - I2C support for Au1100
+
+   Copyright (c) 2006 Rodolfo Giometti <giometti@linux.it>
+   Copyright (c) 2006 Eurotech S.p.A. <info@eurotech.it>
+
+   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.
+  =20
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+  =20
+   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.		    =20
+*/
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/i2c.h>
+#include <linux/i2c-algo-bit.h>
+#include <asm/io.h>
+
+#include <asm/mach-au1x00/au1000.h>
+
+#define NAME "au1100_i2c"
+
+#if 0
+	/* put here the per-board settings */
+#else
+/* The default GPIOs */
+static int scl =3D 31;
+static int sda =3D 30;
+#endif
+
+module_param(scl, int, 0);
+MODULE_PARM_DESC(scl, "GPIO line for SCL");
+module_param(sda, int, 0);
+MODULE_PARM_DESC(sda, "GPIO line for SDA");
+
+/* --- Local functions ---------------------------------------------------=
-- */
+
+static inline void au1100_gpio_set(int gpio, int state)
+{
+	if (state)
+		au_writel(1<<gpio, SYS_OUTPUTSET);
+	else
+		au_writel(1<<gpio, SYS_OUTPUTCLR);
+	au_sync();
+}
+
+static inline int au1100_gpio_get(int gpio)
+{
+	au_writel(1<<gpio, SYS_PININPUTEN);
+	udelay(100);
+	return au_readl(SYS_PINSTATERD)&(1<<gpio) ? 1 : 0;
+}
+
+/* --- I2C operations ----------------------------------------------------=
-- */
+
+static void au1100_i2c_setscl(void *data, int state)
+{
+	au1100_gpio_set(scl, state);
+}
+
+static void au1100_i2c_setsda(void *data, int state)
+{
+	au1100_gpio_set(sda, state);
+}=20
+
+static int au1100_i2c_getscl(void *data)
+{
+	return au1100_gpio_get(scl);
+}
+
+static int au1100_i2c_getsda(void *data)
+{
+	return au1100_gpio_get(sda);
+}
+
+static struct i2c_algo_bit_data au1100_i2c_data =3D {
+	NULL,
+	au1100_i2c_setsda,
+	au1100_i2c_setscl,
+	au1100_i2c_getsda,
+	au1100_i2c_getscl,
+	10, 10, 100,		/* waits, timeout */
+};
+
+static struct i2c_adapter au1100_i2c_ops =3D {
+	.owner		=3D THIS_MODULE,
+	.algo_data	=3D &au1100_i2c_data,
+	.name		=3D "Au1100 I2C",
+};
+
+/* --- Module stuff ------------------------------------------------------=
-- */
+
+static int au1100_i2c_init(void)
+{
+	pr_debug(NAME ": SCL=3DGPIO%02u, SDA=3DGPIO%02u\n", scl, sda);
+
+	if (scl < 0 || sda < 0 || scl > 31 || sda > 31 || scl =3D=3D sda) {
+		printk(KERN_ERR NAME ": invalid \"scl\" and \"sda\" values\n");
+		return -EINVAL;
+	}
+
+	/* Configure GPIOs as outputs */
+	au1100_gpio_set(scl, 1);
+	au1100_gpio_set(sda, 1);
+
+	if (i2c_bit_add_bus(&au1100_i2c_ops) < 0) {
+		printk(KERN_ERR NAME ": adapter \"%s\" registration failed\n",=20
+		       au1100_i2c_ops.name);
+		return -ENODEV;
+	}
+
+	pr_info(NAME ": Au1100 I2C Driver enabled\n");
+=09
+	return 0;
+}
+
+static void au1100_i2c_cleanup(void)
+{
+	i2c_bit_del_bus(&au1100_i2c_ops);
+}
+
+module_init(au1100_i2c_init);
+module_exit(au1100_i2c_cleanup);
+
+MODULE_AUTHOR("Rodolfo Giometti <giometti@linux.it>");
+MODULE_DESCRIPTION("Au1100 I2C Driver");
+MODULE_LICENSE("GPL");

--DN8g+DOX2TxGxleI--

From wilson@specifix.com Wed Jul 19 19:35:30 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 19 Jul 2006 19:35:39 +0100 (BST)
Received: from w099.z064220152.sjc-ca.dsl.cnc.net ([64.220.152.99]:4249 "EHLO
	duck.specifix.com") by ftp.linux-mips.org with ESMTP
	id S3949399AbWGSSfa (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 19 Jul 2006 19:35:30 +0100
Received: from [127.0.0.1] (duck.corp.specifix.com [192.168.1.1])
	by duck.specifix.com (Postfix) with ESMTP
	id 8C1D1FC70; Wed, 19 Jul 2006 11:35:03 -0700 (PDT)
Subject: Re: cross compiling gcc for mips
From:	James E Wilson <wilson@specifix.com>
To:	qi tao <demon19840308@hotmail.com>
Cc:	linux-mips@linux-mips.org
In-Reply-To: <BAY122-F271C1ACCD1969B2F38611AAD630@phx.gbl>
References: <BAY122-F271C1ACCD1969B2F38611AAD630@phx.gbl>
Content-Type: text/plain; charset=UTF-8
Message-Id: <1153334103.18674.18.camel@aretha.corp.specifix.com>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.4.6 
Date:	Wed, 19 Jul 2006 11:35:03 -0700
Content-Transfer-Encoding: 8bit
Return-Path: <wilson@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: 12035
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: wilson@specifix.com
Precedence: bulk
X-list: linux-mips

On Tue, 2006-07-18 at 00:12, qi tao wrote:
> First I built binutils and now I was setting up the bootstrap compiler.
> In file included from ../../gcc-4.1.1/gcc/crtstuff.c:68:
> .../../gcc-4.1.1/gcc/tsystem.h:90:19: error: stdio.h: æ²¡æœ‰é‚£ä¸ªæ–‡ä»¶æˆ–ç›®å½•

You can't build the gcc libraries unless you have a C library first. 
And, of course, you can't build a C library unless you have a compiler
first.  This circular dependency makes bootstrapping a bit tricky.  

The basic process here is that you have to do a glibc make
install-headers first which gives you C library headers, and then a
partial gcc build minus the libraries, then a full glibc build, then a
full gcc build.

This is simpler is you just follow instructions written up by someone
else who already knows how to do it.  The one I recommend is the
crosstool scrips written by Dan Kegel.  There is a pointer to them on
the linux-mips.org wiki.
    http://www.linux-mips.org/wiki/Toolchains
    http://kegel.com/crosstool/
-- 
Jim Wilson, GNU Tools Support, http://www.specifix.com


From ashlesha@kenati.com Thu Jul 20 02:28:21 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 20 Jul 2006 02:28:32 +0100 (BST)
Received: from [69.90.147.196] ([69.90.147.196]:37311 "EHLO mail.kenati.com")
	by ftp.linux-mips.org with ESMTP id S8133420AbWGTB2V (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 20 Jul 2006 02:28:21 +0100
Received: from [192.168.1.105] (adsl-71-130-109-177.dsl.snfc21.pacbell.net [71.130.109.177])
	by mail.kenati.com (Postfix) with ESMTP id A92C8E404D;
	Wed, 19 Jul 2006 18:42:19 -0700 (PDT)
Subject: Re: Overview-writing BSP
From:	Ashlesha Shintre <ashlesha@kenati.com>
Reply-To: ashlesha@kenati.com
To:	Mayuresh Chitale <mchitale@gmail.com>, ppopov@embeddedalley.com
Cc:	linux-mips@linux-mips.org
In-Reply-To: <d096a3ee0607132241m3ede0834tf6096d7489933e61@mail.gmail.com>
References: <1152829827.7681.6.camel@sandbar.kenati.com>
	 <d096a3ee0607132241m3ede0834tf6096d7489933e61@mail.gmail.com>
Content-Type: text/plain
Date:	Wed, 19 Jul 2006 18:32:51 -0700
Message-Id: <1153359171.1947.7.camel@sandbar.kenati.com>
Mime-Version: 1.0
X-Mailer: Evolution 2.4.2.1 
Content-Transfer-Encoding: 7bit
Return-Path: <ashlesha@kenati.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: 12036
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ashlesha@kenati.com
Precedence: bulk
X-list: linux-mips

Hi,

Thanks for your reply.  I ve got a DB1500 board which is supported, so
right now I m trying to build the kernel for the same.  However, my next
task is to map the VIA southbridge and I m not very sure of what this
means exactly.  

I do not have the datasheet for the Southbridge.  Please point me in a
direction where I can start.  Should I be looking for hardware addresses
in the datasheet or for the type of interrupts generated by different
hardware??

Thanks and Regards,
Ashlesha.


On Fri, 2006-07-14 at 11:11 +0530, Mayuresh Chitale wrote:
> Hi,
> 
> Please see inline.
> 
> Thanks,
> Mayuresh.
> 
> On 7/14/06, Ashlesha Shintre <ashlesha@kenati.com> wrote:
> > Hi,
> >
> > I m working with an AU-1500 MIPS processor on the EncoreM3 board and my
> > task is to write board support packages for the same.  I am very much a
> > newbie to linux and embedded systems.
> >
> You may look at these links :
> 
> http://www.linux-mips.org/wiki/Porting
> http://linux.junsun.net/porting-howto/
> 
> 
> > I m not entirely sure of the sequence in which i should start doing
> > things, but here is a rough roadmap:
> >
> > 1) To create a config file appropriate to the board using menuconfig
> > 2) Map the VIA southbridge
> > 3) Adding IRQ Mappings
> > 4) Integration and Debugging
> >
> > First I decided to 'do' the configuration file, but I still havent got a
> > birdseye picture of how I should proceed.  Any pointers?
> Look at how its implemented for existing boards.
> >
> > Also, when does the config file come into play during the bootup
> Its not for runtime. Its needed only while building the kernel. Let me
> put it this way. Its a nicer way of configuring the kernel. You could
> change only the make files and be able to build. But menuconfig adds
> lot of flexibility and ease of use.
> 
> 
> > process, and where will I find the addresses of different devices say on
> > the PCI bus (memory adds) that will need to be mapped at boottime?
> Refer to the links mentioned above.
> >
> > Thanks,
> > Ashlesha.
> >
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-mips" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >


From Eckhardt@satorlaser.com Thu Jul 20 07:58:59 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 20 Jul 2006 07:59:11 +0100 (BST)
Received: from mail.domino-uk.com ([193.131.116.193]:5138 "EHLO
	vMimePS1.domino-printing.com") by ftp.linux-mips.org with ESMTP
	id S8133392AbWGTG67 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 20 Jul 2006 07:58:59 +0100
Received: from emea-exchange3.emea.dps.local (EMEA-EXCHANGE3) by 
    vMimePS1.domino-printing.com (Clearswift SMTPRS 5.2.3) with ESMTP id 
    <T79975ba7b4c18374c1128@vMimePS1.domino-printing.com> for 
    <linux-mips@linux-mips.org>; Thu, 20 Jul 2006 08:00:09 +0100
Received: from tuxator2.emea.dps.local ([192.168.55.75]) by 
    emea-exchange3.emea.dps.local with Microsoft SMTPSVC(6.0.3790.1830); 
    Thu, 20 Jul 2006 08:58:53 +0200
From:	Ulrich Eckhardt <eckhardt@satorlaser.com>
Organization: Sator Laser GmbH
To:	linux-mips@linux-mips.org
Subject: Re: pseudo 32 bit physical addresses and the real 36 bit world
Date:	Thu, 20 Jul 2006 08:58:52 +0200
User-Agent: KMail/1.9.1
References: <20060719155804.GB5162@dusktilldawn.nl>
In-Reply-To: <20060719155804.GB5162@dusktilldawn.nl>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200607200858.52837.eckhardt@satorlaser.com>
X-OriginalArrivalTime: 20 Jul 2006 06:58:53.0354 (UTC) 
    FILETIME=[F62CB8A0:01C6ABC9]
Return-Path: <Eckhardt@satorlaser.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: 12037
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: eckhardt@satorlaser.com
Precedence: bulk
X-list: linux-mips

On Wednesday 19 July 2006 17:58, Freddy Spierenburg wrote:
> The AU1100 processor uses internally a 36-bit address bus. The
> kernel (32 bits) is only able to work with 32-bit addresses.
> Well, there must exist some sort of scheme for the kernel to work
> with these 36-bit addresses, but I don't quiet get it yet. Is
> anybody willing to give me some insight?
[...]
> I expect
> from reading the au1100 databook and 'See MIPS Run (chapter 6)
> that the TLB is involved, but I'm not yet able to link it
> altogether.

As others already said, the TLB is involved. However, there are two modes in 
which you can compile the kernel, with 32 and 64 bit physical addresses. For 
the 32 bit case (which is a bit hackish) its "physical addresses" are not 
always what the real physical addresses are for the Alchemy CPU, there is a 
functions called fixup or so that converts some parts of this range when 
creating real physical addresses for the TLB.

> I'm looking at the pcmcia implementation at this moment and I
> don't get it. If I look at drivers/pcmcia/au1000_generic.h I see
> AU1X_SOCK0_IO defines as 0xF00000000 (note the 36 bit length).
> This one is used in drivers/pcmcia/au1000_generic.c
> au1x00_pcmcia_socket_probe() where it get cast to phys_t. phys_t
> is a typedef from include/asm-mips/types.h as an unsigned long.
> Of course the compiler warns us during compilation of
> drivers/pcmcia/au1000_generic.c:
>
> drivers/pcmcia/au1000_generic.c:403: warning: integer constant is too large
> for "long" type drivers/pcmcia/au1000_generic.c:406: warning: integer
> constant is too large for "long" type drivers/pcmcia/au1000_generic.c:414:
> warning: integer constant is too large for "long" type

This is possibly an error. I know there are some cases where this causes  
runtime errors when you don't have 64 bit physical addresses, but I thought 
the configuration ("make config" & Co) had been fixed to not allow this case. 
I had also proposed to add a preprocessor check that generates an error but 
that was refused, I hope this is not the case where it would have fired here.

Turn on 64 bit physical addresses when in doubt.

> I also expect more is happening with the
> AU1X_SOCK0_PSEUDO_PHYS_ATTR and AU1X_SOCK0_PSEUDO_PHYS_MEM, but
> not that I can find any clue how this appears to work.
>
> To end this email into a happy end I shall also explain what I
> really want to do. We've built our own computer using the AU1100
> processor. We've connected two SC16C652 dual UART's, one to RCS2
> and one to RCS3. Now I want to map those UARTS at AE000000 and
> AE040000. I've configured the mem_stcfg[23], mem_sttime[23] and
> mem_staddr[23] registers in yamon:
>
>   #define MEM_STCFG[23]   0x00000001
>   #define MEM_STTIME[23]  0x03FFC7C7
>   #define MEM_STADDR2     0x1AE03FFF
>   #define MEM_STADDR3     0x1AE07FFF
>
> But after that I'm sort of lost in the dark. What should I do
> inside the kernel so that when I refer to AE000000 in my driver
> the processor triggers chip select 2 (RCS2)?

I didn't check above values, but inside the kernel you simply need to 
ioremap() or ioremap_nocache() the range you want to access, specified by the 
physical address of the device (this address is probably not AE000000!).

ioremap() gives you a pointer to a virtual address (32 bit, regardless of 
physical address size) which you can use to access the UARTs. Note that this 
doesn't map to the addresses AE000000 and AE040000 but selects a virtual 
address itself, but you shouldn't depend on that. If you do, you will need to 
take different measures.

Uli

****************************************************
Visit our website at <http://www.domino-printing.com/>
****************************************************
This Email and any files transmitted with it are intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any reading, redistribution, disclosure or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.  If you are not the intended recipient please contact the sender immediately and delete the material from your computer.

E-mail may be susceptible to data corruption, interception, viruses and unauthorised amendment and Domino UK Limited does not accept liability for any such corruption, interception, viruses or amendment or their consequences.
****************************************************


From giometti@enneenne.com Thu Jul 20 08:33:53 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 20 Jul 2006 08:34:07 +0100 (BST)
Received: from 81-174-11-161.f5.ngi.it ([81.174.11.161]:60326 "EHLO
	mail.enneenne.com") by ftp.linux-mips.org with ESMTP
	id S8133415AbWGTHdx (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 20 Jul 2006 08:33:53 +0100
Received: from zaigor.enneenne.com ([192.168.32.1])
	by mail.enneenne.com with esmtp (Exim 4.50)
	id 1G3S3g-0002q6-9K; Thu, 20 Jul 2006 08:30:54 +0200
Received: from giometti by zaigor.enneenne.com with local (Exim 4.60)
	(envelope-from <giometti@enneenne.com>)
	id 1G3T2U-0002LY-4y; Thu, 20 Jul 2006 09:33:42 +0200
Date:	Thu, 20 Jul 2006 09:33:42 +0200
From:	Rodolfo Giometti <giometti@linux.it>
To:	linux-laptop@vger.kernel.org, sfr@canb.auug.org.au
Cc:	linux-mips@linux-mips.org
Message-ID: <20060720073342.GL25330@enneenne.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="qYrsQHciA3Wqs7Iv"
Content-Disposition: inline
Organization: GNU/Linux Device Drivers, Embedded Systems and Courses
X-PGP-Key: gpg --keyserver keyserver.linux.it --recv-keys D25A5633
User-Agent: Mutt/1.5.11+cvs20060403
X-SA-Exim-Connect-IP: 192.168.32.1
X-SA-Exim-Mail-From: giometti@enneenne.com
Subject: [PATCH] APM emulation reunion
X-SA-Exim-Version: 4.2 (built Thu, 03 Mar 2005 10:44:12 +0100)
X-SA-Exim-Scanned: Yes (on mail.enneenne.com)
Return-Path: <giometti@enneenne.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: 12038
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: giometti@linux.it
Precedence: bulk
X-list: linux-mips


--qYrsQHciA3Wqs7Iv
Content-Type: multipart/mixed; boundary="S66JdqtemGhvbcZP"
Content-Disposition: inline


--S66JdqtemGhvbcZP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello,

here a patch to unify the APM enulation supports for ARM and MIPS.

I put APM emulation code into a dedicated directory so it can be used
to put there the APM-emu per board specific code. For instance on my
system I added the following lines to the "Kconfig" file:

   config CONFIG_WWPC1000_APM_EMU
          tristate "APM support for WWPC1000"
          depends APM_EMU
          default y

The kernel configuration file is now unique and not duplicated
anymore.

Also I modified the configuration define "CONFIG_APM" to
"CONFIG_APM_EMU" in order to avoid conflicts with real APM
support. Doing like this these boards' configuration files should be
updated:

   arch/arm/configs/bast_defconfig:CONFIG_APM=3Dy
   arch/arm/configs/collie_defconfig:CONFIG_APM=3Dy
   arch/arm/configs/corgi_defconfig:CONFIG_APM=3Dy
   arch/arm/configs/ixp4xx_defconfig:CONFIG_APM=3Dy
   arch/arm/configs/neponset_defconfig:CONFIG_APM=3Dy
   arch/arm/configs/s3c2410_defconfig:CONFIG_APM=3Dy
   arch/arm/configs/simpad_defconfig:CONFIG_APM=3Dy
   arch/arm/configs/spitz_defconfig:CONFIG_APM=3Dy
   arch/arm/configs/trizeps4_defconfig:CONFIG_APM=3Dy

Ciao,

Rodolfo

Signed-off-by: Rodolfo Giometti <giometti@linux.it>

--=20

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

--S66JdqtemGhvbcZP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-apm-emu-reunion
Content-Transfer-Encoding: quoted-printable

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index f81a623..d039838 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -797,32 +797,7 @@ menu "Power management options"
=20
 source "kernel/power/Kconfig"
=20
-config APM
-	tristate "Advanced Power Management Emulation"
-	---help---
-	  APM is a BIOS specification for saving power using several different
-	  techniques. This is mostly useful for battery powered laptops with
-	  APM compliant BIOSes. If you say Y here, the system time will be
-	  reset after a RESUME operation, the /proc/apm device will provide
-	  battery status information, and user-space programs will receive
-	  notification of APM "events" (e.g. battery status change).
-
-	  In order to use APM, you will need supporting software. For location
-	  and more information, read <file:Documentation/pm.txt> and the
-	  Battery Powered Linux mini-HOWTO, available from
-	  <http://www.tldp.org/docs.html#howto>.
-
-	  This driver does not spin down disk drives (see the hdparm(8)
-	  manpage ("man 8 hdparm") for that), and it doesn't turn off
-	  VESA-compliant "green" monitors.
-
-	  Generally, if you don't have a battery in your machine, there isn't
-	  much point in using this driver and you should say N. If you get
-	  random kernel OOPSes or reboots that don't seem to be related to
-	  anything, try disabling/enabling this option (or disabling/enabling
-	  APM in your BIOS).
-
-endmenu
+source "drivers/apm-emu/Kconfig"
=20
 source "net/Kconfig"
=20
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index f0c0cdb..fe7d480 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -10,7 +10,6 @@ obj-y		:=3D compat.o entry-armv.o entry-co
 		   process.o ptrace.o semaphore.o setup.o signal.o sys_arm.o \
 		   time.o traps.o
=20
-obj-$(CONFIG_APM)		+=3D apm.o
 obj-$(CONFIG_ISA_DMA_API)	+=3D dma.o
 obj-$(CONFIG_ARCH_ACORN)	+=3D ecard.o=20
 obj-$(CONFIG_FOOTBRIDGE)	+=3D isa.o
diff --git a/arch/arm/kernel/apm.c b/arch/arm/kernel/apm.c
deleted file mode 100644
index 33c5568..0000000
--- a/arch/arm/kernel/apm.c
+++ /dev/null
@@ -1,604 +0,0 @@
-/*
- * bios-less APM driver for ARM Linux=20
- *  Jamey Hicks <jamey@crl.dec.com>
- *  adapted from the APM BIOS driver for Linux by Stephen Rothwell (sfr@li=
nuxcare.com)
- *
- * APM 1.2 Reference:
- *   Intel Corporation, Microsoft Corporation. Advanced Power Management
- *   (APM) BIOS Interface Specification, Revision 1.2, February 1996.
- *
- * [This document is available from Microsoft at:
- *    http://www.microsoft.com/hwdev/busbios/amp_12.htm]
- */
-#include <linux/module.h>
-#include <linux/poll.h>
-#include <linux/timer.h>
-#include <linux/slab.h>
-#include <linux/proc_fs.h>
-#include <linux/miscdevice.h>
-#include <linux/apm_bios.h>
-#include <linux/capability.h>
-#include <linux/sched.h>
-#include <linux/pm.h>
-#include <linux/device.h>
-#include <linux/kernel.h>
-#include <linux/list.h>
-#include <linux/init.h>
-#include <linux/completion.h>
-
-#include <asm/apm.h> /* apm_power_info */
-#include <asm/system.h>
-
-/*
- * The apm_bios device is one of the misc char devices.
- * This is its minor number.
- */
-#define APM_MINOR_DEV	134
-
-/*
- * See Documentation/Config.help for the configuration options.
- *
- * Various options can be changed at boot time as follows:
- * (We allow underscores for compatibility with the modules code)
- *	apm=3Don/off			enable/disable APM
- */
-
-/*
- * Maximum number of events stored
- */
-#define APM_MAX_EVENTS		16
-
-struct apm_queue {
-	unsigned int		event_head;
-	unsigned int		event_tail;
-	apm_event_t		events[APM_MAX_EVENTS];
-};
-
-/*
- * The per-file APM data
- */
-struct apm_user {
-	struct list_head	list;
-
-	unsigned int		suser: 1;
-	unsigned int		writer: 1;
-	unsigned int		reader: 1;
-
-	int			suspend_result;
-	unsigned int		suspend_state;
-#define SUSPEND_NONE	0		/* no suspend pending */
-#define SUSPEND_PENDING	1		/* suspend pending read */
-#define SUSPEND_READ	2		/* suspend read, pending ack */
-#define SUSPEND_ACKED	3		/* suspend acked */
-#define SUSPEND_DONE	4		/* suspend completed */
-
-	struct apm_queue	queue;
-};
-
-/*
- * Local variables
- */
-static int suspends_pending;
-static int apm_disabled;
-static int arm_apm_active;
-
-static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue);
-static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue);
-
-/*
- * This is a list of everyone who has opened /dev/apm_bios
- */
-static DECLARE_RWSEM(user_list_lock);
-static LIST_HEAD(apm_user_list);
-
-/*
- * kapmd info.  kapmd provides us a process context to handle
- * "APM" events within - specifically necessary if we're going
- * to be suspending the system.
- */
-static DECLARE_WAIT_QUEUE_HEAD(kapmd_wait);
-static DECLARE_COMPLETION(kapmd_exit);
-static DEFINE_SPINLOCK(kapmd_queue_lock);
-static struct apm_queue kapmd_queue;
-
-
-static const char driver_version[] =3D "1.13";	/* no spaces */
-
-
-
-/*
- * Compatibility cruft until the IPAQ people move over to the new
- * interface.
- */
-static void __apm_get_power_status(struct apm_power_info *info)
-{
-}
-
-/*
- * This allows machines to provide their own "apm get power status" functi=
on.
- */
-void (*apm_get_power_status)(struct apm_power_info *) =3D __apm_get_power_=
status;
-EXPORT_SYMBOL(apm_get_power_status);
-
-
-/*
- * APM event queue management.
- */
-static inline int queue_empty(struct apm_queue *q)
-{
-	return q->event_head =3D=3D q->event_tail;
-}
-
-static inline apm_event_t queue_get_event(struct apm_queue *q)
-{
-	q->event_tail =3D (q->event_tail + 1) % APM_MAX_EVENTS;
-	return q->events[q->event_tail];
-}
-
-static void queue_add_event(struct apm_queue *q, apm_event_t event)
-{
-	q->event_head =3D (q->event_head + 1) % APM_MAX_EVENTS;
-	if (q->event_head =3D=3D q->event_tail) {
-		static int notified;
-
-		if (notified++ =3D=3D 0)
-		    printk(KERN_ERR "apm: an event queue overflowed\n");
-		q->event_tail =3D (q->event_tail + 1) % APM_MAX_EVENTS;
-	}
-	q->events[q->event_head] =3D event;
-}
-
-static void queue_event_one_user(struct apm_user *as, apm_event_t event)
-{
-	if (as->suser && as->writer) {
-		switch (event) {
-		case APM_SYS_SUSPEND:
-		case APM_USER_SUSPEND:
-			/*
-			 * If this user already has a suspend pending,
-			 * don't queue another one.
-			 */
-			if (as->suspend_state !=3D SUSPEND_NONE)
-				return;
-
-			as->suspend_state =3D SUSPEND_PENDING;
-			suspends_pending++;
-			break;
-		}
-	}
-	queue_add_event(&as->queue, event);
-}
-
-static void queue_event(apm_event_t event, struct apm_user *sender)
-{
-	struct apm_user *as;
-
-	down_read(&user_list_lock);
-	list_for_each_entry(as, &apm_user_list, list) {
-		if (as !=3D sender && as->reader)
-			queue_event_one_user(as, event);
-	}
-	up_read(&user_list_lock);
-	wake_up_interruptible(&apm_waitqueue);
-}
-
-static void apm_suspend(void)
-{
-	struct apm_user *as;
-	int err =3D pm_suspend(PM_SUSPEND_MEM);
-
-	/*
-	 * Anyone on the APM queues will think we're still suspended.
-	 * Send a message so everyone knows we're now awake again.
-	 */
-	queue_event(APM_NORMAL_RESUME, NULL);
-
-	/*
-	 * Finally, wake up anyone who is sleeping on the suspend.
-	 */
-	down_read(&user_list_lock);
-	list_for_each_entry(as, &apm_user_list, list) {
-		as->suspend_result =3D err;
-		as->suspend_state =3D SUSPEND_DONE;
-	}
-	up_read(&user_list_lock);
-
-	wake_up(&apm_suspend_waitqueue);
-}
-
-static ssize_t apm_read(struct file *fp, char __user *buf, size_t count, l=
off_t *ppos)
-{
-	struct apm_user *as =3D fp->private_data;
-	apm_event_t event;
-	int i =3D count, ret =3D 0;
-
-	if (count < sizeof(apm_event_t))
-		return -EINVAL;
-
-	if (queue_empty(&as->queue) && fp->f_flags & O_NONBLOCK)
-		return -EAGAIN;
-
-	wait_event_interruptible(apm_waitqueue, !queue_empty(&as->queue));
-
-	while ((i >=3D sizeof(event)) && !queue_empty(&as->queue)) {
-		event =3D queue_get_event(&as->queue);
-
-		ret =3D -EFAULT;
-		if (copy_to_user(buf, &event, sizeof(event)))
-			break;
-
-		if (event =3D=3D APM_SYS_SUSPEND || event =3D=3D APM_USER_SUSPEND)
-			as->suspend_state =3D SUSPEND_READ;
-
-		buf +=3D sizeof(event);
-		i -=3D sizeof(event);
-	}
-
-	if (i < count)
-		ret =3D count - i;
-
-	return ret;
-}
-
-static unsigned int apm_poll(struct file *fp, poll_table * wait)
-{
-	struct apm_user *as =3D fp->private_data;
-
-	poll_wait(fp, &apm_waitqueue, wait);
-	return queue_empty(&as->queue) ? 0 : POLLIN | POLLRDNORM;
-}
-
-/*
- * apm_ioctl - handle APM ioctl
- *
- * APM_IOC_SUSPEND
- *   This IOCTL is overloaded, and performs two functions.  It is used to:
- *     - initiate a suspend
- *     - acknowledge a suspend read from /dev/apm_bios.
- *   Only when everyone who has opened /dev/apm_bios with write permission
- *   has acknowledge does the actual suspend happen.
- */
-static int
-apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg)
-{
-	struct apm_user *as =3D filp->private_data;
-	unsigned long flags;
-	int err =3D -EINVAL;
-
-	if (!as->suser || !as->writer)
-		return -EPERM;
-
-	switch (cmd) {
-	case APM_IOC_SUSPEND:
-		as->suspend_result =3D -EINTR;
-
-		if (as->suspend_state =3D=3D SUSPEND_READ) {
-			/*
-			 * If we read a suspend command from /dev/apm_bios,
-			 * then the corresponding APM_IOC_SUSPEND ioctl is
-			 * interpreted as an acknowledge.
-			 */
-			as->suspend_state =3D SUSPEND_ACKED;
-			suspends_pending--;
-		} else {
-			/*
-			 * Otherwise it is a request to suspend the system.
-			 * Queue an event for all readers, and expect an
-			 * acknowledge from all writers who haven't already
-			 * acknowledged.
-			 */
-			queue_event(APM_USER_SUSPEND, as);
-		}
-
-		/*
-		 * If there are no further acknowledges required, suspend
-		 * the system.
-		 */
-		if (suspends_pending =3D=3D 0)
-			apm_suspend();
-
-		/*
-		 * Wait for the suspend/resume to complete.  If there are
-		 * pending acknowledges, we wait here for them.
-		 *
-		 * Note that we need to ensure that the PM subsystem does
-		 * not kick us out of the wait when it suspends the threads.
-		 */
-		flags =3D current->flags;
-		current->flags |=3D PF_NOFREEZE;
-
-		/*
-		 * Note: do not allow a thread which is acking the suspend
-		 * to escape until the resume is complete.
-		 */
-		if (as->suspend_state =3D=3D SUSPEND_ACKED)
-			wait_event(apm_suspend_waitqueue,
-					 as->suspend_state =3D=3D SUSPEND_DONE);
-		else
-			wait_event_interruptible(apm_suspend_waitqueue,
-					 as->suspend_state =3D=3D SUSPEND_DONE);
-
-		current->flags =3D flags;
-		err =3D as->suspend_result;
-		as->suspend_state =3D SUSPEND_NONE;
-		break;
-	}
-
-	return err;
-}
-
-static int apm_release(struct inode * inode, struct file * filp)
-{
-	struct apm_user *as =3D filp->private_data;
-	filp->private_data =3D NULL;
-
-	down_write(&user_list_lock);
-	list_del(&as->list);
-	up_write(&user_list_lock);
-
-	/*
-	 * We are now unhooked from the chain.  As far as new
-	 * events are concerned, we no longer exist.  However, we
-	 * need to balance suspends_pending, which means the
-	 * possibility of sleeping.
-	 */
-	if (as->suspend_state !=3D SUSPEND_NONE) {
-		suspends_pending -=3D 1;
-		if (suspends_pending =3D=3D 0)
-			apm_suspend();
-	}
-
-	kfree(as);
-	return 0;
-}
-
-static int apm_open(struct inode * inode, struct file * filp)
-{
-	struct apm_user *as;
-
-	as =3D (struct apm_user *)kzalloc(sizeof(*as), GFP_KERNEL);
-	if (as) {
-		/*
-		 * XXX - this is a tiny bit broken, when we consider BSD
-		 * process accounting. If the device is opened by root, we
-		 * instantly flag that we used superuser privs. Who knows,
-		 * we might close the device immediately without doing a
-		 * privileged operation -- cevans
-		 */
-		as->suser =3D capable(CAP_SYS_ADMIN);
-		as->writer =3D (filp->f_mode & FMODE_WRITE) =3D=3D FMODE_WRITE;
-		as->reader =3D (filp->f_mode & FMODE_READ) =3D=3D FMODE_READ;
-
-		down_write(&user_list_lock);
-		list_add(&as->list, &apm_user_list);
-		up_write(&user_list_lock);
-
-		filp->private_data =3D as;
-	}
-
-	return as ? 0 : -ENOMEM;
-}
-
-static struct file_operations apm_bios_fops =3D {
-	.owner		=3D THIS_MODULE,
-	.read		=3D apm_read,
-	.poll		=3D apm_poll,
-	.ioctl		=3D apm_ioctl,
-	.open		=3D apm_open,
-	.release	=3D apm_release,
-};
-
-static struct miscdevice apm_device =3D {
-	.minor		=3D APM_MINOR_DEV,
-	.name		=3D "apm_bios",
-	.fops		=3D &apm_bios_fops
-};
-
-
-#ifdef CONFIG_PROC_FS
-/*
- * Arguments, with symbols from linux/apm_bios.h.
- *
- *   0) Linux driver version (this will change if format changes)
- *   1) APM BIOS Version.  Usually 1.0, 1.1 or 1.2.
- *   2) APM flags from APM Installation Check (0x00):
- *	bit 0: APM_16_BIT_SUPPORT
- *	bit 1: APM_32_BIT_SUPPORT
- *	bit 2: APM_IDLE_SLOWS_CLOCK
- *	bit 3: APM_BIOS_DISABLED
- *	bit 4: APM_BIOS_DISENGAGED
- *   3) AC line status
- *	0x00: Off-line
- *	0x01: On-line
- *	0x02: On backup power (BIOS >=3D 1.1 only)
- *	0xff: Unknown
- *   4) Battery status
- *	0x00: High
- *	0x01: Low
- *	0x02: Critical
- *	0x03: Charging
- *	0x04: Selected battery not present (BIOS >=3D 1.2 only)
- *	0xff: Unknown
- *   5) Battery flag
- *	bit 0: High
- *	bit 1: Low
- *	bit 2: Critical
- *	bit 3: Charging
- *	bit 7: No system battery
- *	0xff: Unknown
- *   6) Remaining battery life (percentage of charge):
- *	0-100: valid
- *	-1: Unknown
- *   7) Remaining battery life (time units):
- *	Number of remaining minutes or seconds
- *	-1: Unknown
- *   8) min =3D minutes; sec =3D seconds
- */
-static int apm_get_info(char *buf, char **start, off_t fpos, int length)
-{
-	struct apm_power_info info;
-	char *units;
-	int ret;
-
-	info.ac_line_status =3D 0xff;
-	info.battery_status =3D 0xff;
-	info.battery_flag   =3D 0xff;
-	info.battery_life   =3D -1;
-	info.time	    =3D -1;
-	info.units	    =3D -1;
-
-	if (apm_get_power_status)
-		apm_get_power_status(&info);
-
-	switch (info.units) {
-	default:	units =3D "?";	break;
-	case 0: 	units =3D "min";	break;
-	case 1: 	units =3D "sec";	break;
-	}
-
-	ret =3D sprintf(buf, "%s 1.2 0x%02x 0x%02x 0x%02x 0x%02x %d%% %d %s\n",
-		     driver_version, APM_32_BIT_SUPPORT,
-		     info.ac_line_status, info.battery_status,
-		     info.battery_flag, info.battery_life,
-		     info.time, units);
-
- 	return ret;
-}
-#endif
-
-static int kapmd(void *arg)
-{
-	daemonize("kapmd");
-	current->flags |=3D PF_NOFREEZE;
-
-	do {
-		apm_event_t event;
-
-		wait_event_interruptible(kapmd_wait,
-				!queue_empty(&kapmd_queue) || !arm_apm_active);
-
-		if (!arm_apm_active)
-			break;
-
-		spin_lock_irq(&kapmd_queue_lock);
-		event =3D 0;
-		if (!queue_empty(&kapmd_queue))
-			event =3D queue_get_event(&kapmd_queue);
-		spin_unlock_irq(&kapmd_queue_lock);
-
-		switch (event) {
-		case 0:
-			break;
-
-		case APM_LOW_BATTERY:
-		case APM_POWER_STATUS_CHANGE:
-			queue_event(event, NULL);
-			break;
-
-		case APM_USER_SUSPEND:
-		case APM_SYS_SUSPEND:
-			queue_event(event, NULL);
-			if (suspends_pending =3D=3D 0)
-				apm_suspend();
-			break;
-
-		case APM_CRITICAL_SUSPEND:
-			apm_suspend();
-			break;
-		}
-	} while (1);
-
-	complete_and_exit(&kapmd_exit, 0);
-}
-
-static int __init apm_init(void)
-{
-	int ret;
-
-	if (apm_disabled) {
-		printk(KERN_NOTICE "apm: disabled on user request.\n");
-		return -ENODEV;
-	}
-
-	arm_apm_active =3D 1;
-
-	ret =3D kernel_thread(kapmd, NULL, CLONE_KERNEL);
-	if (ret < 0) {
-		arm_apm_active =3D 0;
-		return ret;
-	}
-
-#ifdef CONFIG_PROC_FS
-	create_proc_info_entry("apm", 0, NULL, apm_get_info);
-#endif
-
-	ret =3D misc_register(&apm_device);
-	if (ret !=3D 0) {
-		remove_proc_entry("apm", NULL);
-
-		arm_apm_active =3D 0;
-		wake_up(&kapmd_wait);
-		wait_for_completion(&kapmd_exit);
-	}
-
-	return ret;
-}
-
-static void __exit apm_exit(void)
-{
-	misc_deregister(&apm_device);
-	remove_proc_entry("apm", NULL);
-
-	arm_apm_active =3D 0;
-	wake_up(&kapmd_wait);
-	wait_for_completion(&kapmd_exit);
-}
-
-module_init(apm_init);
-module_exit(apm_exit);
-
-MODULE_AUTHOR("Stephen Rothwell");
-MODULE_DESCRIPTION("Advanced Power Management");
-MODULE_LICENSE("GPL");
-
-#ifndef MODULE
-static int __init apm_setup(char *str)
-{
-	while ((str !=3D NULL) && (*str !=3D '\0')) {
-		if (strncmp(str, "off", 3) =3D=3D 0)
-			apm_disabled =3D 1;
-		if (strncmp(str, "on", 2) =3D=3D 0)
-			apm_disabled =3D 0;
-		str =3D strchr(str, ',');
-		if (str !=3D NULL)
-			str +=3D strspn(str, ", \t");
-	}
-	return 1;
-}
-
-__setup("apm=3D", apm_setup);
-#endif
-
-/**
- * apm_queue_event - queue an APM event for kapmd
- * @event: APM event
- *
- * Queue an APM event for kapmd to process and ultimately take the
- * appropriate action.  Only a subset of events are handled:
- *   %APM_LOW_BATTERY
- *   %APM_POWER_STATUS_CHANGE
- *   %APM_USER_SUSPEND
- *   %APM_SYS_SUSPEND
- *   %APM_CRITICAL_SUSPEND
- */
-void apm_queue_event(apm_event_t event)
-{
-	unsigned long flags;
-
-	spin_lock_irqsave(&kapmd_queue_lock, flags);
-	queue_add_event(&kapmd_queue, event);
-	spin_unlock_irqrestore(&kapmd_queue_lock, flags);
-
-	wake_up_interruptible(&kapmd_wait);
-}
-EXPORT_SYMBOL(apm_queue_event);
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 309757a..ccdee59 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -2018,35 +2018,15 @@ config SECCOMP
=20
 	  If unsure, say Y. Only embedded should say N here.
=20
-config PM
-	bool "Power Management support (EXPERIMENTAL)"
-	depends on EXPERIMENTAL && SOC_AU1X00
-
-config APM
-        tristate "Advanced Power Management Emulation"
-	depends on PM
-        ---help---
-	  APM is a BIOS specification for saving power using several different
-	  techniques. This is mostly useful for battery powered systems with
-	  APM compliant BIOSes. If you say Y here, the system time will be
-	  reset after a RESUME operation, the /proc/apm device will provide
-	  battery status information, and user-space programs will receive
-	  notification of APM "events" (e.g. battery status change).
-
-	  In order to use APM, you will need supporting software. For location
-	  and more information, read <file:Documentation/pm.txt> and the
-	  Battery Powered Linux mini-HOWTO, available from
-	  <http://www.tldp.org/docs.html#howto>.
-
-	  This driver does not spin down disk drives (see the hdparm(8)
-	  manpage ("man 8 hdparm") for that), and it doesn't turn off
-	  VESA-compliant "green" monitors.
-
-	  Generally, if you don't have a battery in your machine, there isn't
-	  much point in using this driver and you should say N. If you get
-	  random kernel OOPSes or reboots that don't seem to be related to
-	  anything, try disabling/enabling this option (or disabling/enabling
-	  APM in your BIOS).
+endmenu
+
+menu "Power management options"
+
+if SOC_AU1X00
+source "kernel/power/Kconfig"
+endif
+
+source "drivers/apm-emu/Kconfig"
=20
 endmenu
=20
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index 881c467..34e8a25 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -13,8 +13,6 @@ binfmt_irix-objs	:=3D irixelf.o irixinv.o=20
=20
 obj-$(CONFIG_MODULES)		+=3D mips_ksyms.o module.o
=20
-obj-$(CONFIG_APM)		+=3D apm.o
-
 obj-$(CONFIG_CPU_R3000)		+=3D r2300_fpu.o r2300_switch.o
 obj-$(CONFIG_CPU_TX39XX)	+=3D r2300_fpu.o r2300_switch.o
 obj-$(CONFIG_CPU_TX49XX)	+=3D r4k_fpu.o r4k_switch.o
diff --git a/drivers/Makefile b/drivers/Makefile
index fc2d744..c3c2abd 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -10,6 +10,7 @@ obj-$(CONFIG_PARISC)		+=3D parisc/
 obj-$(CONFIG_RAPIDIO)		+=3D rapidio/
 obj-y				+=3D video/
 obj-$(CONFIG_ACPI)		+=3D acpi/
+obj-$(CONFIG_APM_EMU)		+=3D apm-emu/
 # PnP must come after ACPI since it will eventually need to check if acpi
 # was used and do nothing if so
 obj-$(CONFIG_PNP)		+=3D pnp/
diff --git a/drivers/apm-emu/Kconfig b/drivers/apm-emu/Kconfig
new file mode 100644
index 0000000..a37f1cc
--- /dev/null
+++ b/drivers/apm-emu/Kconfig
@@ -0,0 +1,25 @@
+#
+# APM Emulator Configuration
+#
+
+config APM_EMU
+        tristate "Advanced Power Management (APM) Emulation"
+        ---help---
+	  APM is a BIOS specification for saving power using several different
+	  techniques. This is mostly useful for battery powered systems with
+	  APM compliant BIOSes. If you say Y here, the system time will be
+	  reset after a RESUME operation, the /proc/apm device will provide
+	  battery status information, and user-space programs will receive
+	  notification of APM "events" (e.g. battery status change).
+
+	  In order to use APM, you will need supporting software. For location
+	  and more information, read <file:Documentation/pm.txt> and the
+	  Battery Powered Linux mini-HOWTO, available from
+	  <http://www.tldp.org/docs.html#howto>.
+
+	  Please, note that this driver is just an emulation of BIOS APM, so
+	  you have to add specific support for your board in order to make
+	  it work.
+
+	  Generally, if you don't have a battery in your machine, there isn't
+	  much point in using this driver and you should say N.
diff --git a/drivers/apm-emu/Makefile b/drivers/apm-emu/Makefile
new file mode 100644
index 0000000..751ce37
--- /dev/null
+++ b/drivers/apm-emu/Makefile
@@ -0,0 +1,5 @@
+#
+# Makefile for the Linux APM Emulator
+#
+
+obj-$(CONFIG_APM_EMU)               +=3D apm-emu.o
diff --git a/arch/mips/kernel/apm.c b/drivers/apm-emu/apm-emu.c
similarity index 90%
rename from arch/mips/kernel/apm.c
rename to drivers/apm-emu/apm-emu.c
index 528e731..e96dccf 100644
--- a/arch/mips/kernel/apm.c
+++ b/drivers/apm-emu/apm-emu.c
@@ -1,15 +1,39 @@
 /*
- * bios-less APM driver for MIPS Linux
- *  Jamey Hicks <jamey@crl.dec.com>
- *  adapted from the APM BIOS driver for Linux by Stephen Rothwell (sfr@li=
nuxcare.com)
+ * Generic bios-less APM driver for Linux
  *
- * APM 1.2 Reference:
- *   Intel Corporation, Microsoft Corporation. Advanced Power Management
- *   (APM) BIOS Interface Specification, Revision 1.2, February 1996.
+ * Derived from "arch/arm/kernel/apm.c" and generalized by
+ *  Rodolfo Giometti <giometti@linux.it>
  *
- * [This document is available from Microsoft at:
- *    http://www.microsoft.com/hwdev/busbios/amp_12.htm]
+ * Copyright 2006 Rodolfo Giometti <giometti@linux.it>
+ *
+ * Original copyright message:
+ *
+ *   bios-less APM driver for ARM Linux
+ *    Jamey Hicks <jamey@crl.dec.com>
+ *    adapted from the APM BIOS driver for Linux by
+ *    Stephen Rothwell (sfr@linuxcare.com)
+ *
+ *   APM 1.2 Reference:
+ *     Intel Corporation, Microsoft Corporation. Advanced Power Management
+ *     (APM) BIOS Interface Specification, Revision 1.2, February 1996.
+ *
+ *   [This document is available from Microsoft at:
+ *      http://www.microsoft.com/hwdev/busbios/amp_12.htm]
+ *
+ * This program is free software; you can distribute it and/or modify it
+ * under the terms of the GNU General Public License (Version 2) as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  */
+
 #include <linux/module.h>
 #include <linux/poll.h>
 #include <linux/timer.h>
@@ -80,7 +104,7 @@ #define SUSPEND_DONE	4		/* suspend compl
  */
 static int suspends_pending;
 static int apm_disabled;
-static int mips_apm_active;
+static int apm_emu_active;
=20
 static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue);
 static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue);
@@ -475,9 +499,9 @@ static int kapmd(void *arg)
 		apm_event_t event;
=20
 		wait_event_interruptible(kapmd_wait,
-				!queue_empty(&kapmd_queue) || !mips_apm_active);
+				!queue_empty(&kapmd_queue) || !apm_emu_active);
=20
-		if (!mips_apm_active)
+		if (!apm_emu_active)
 			break;
=20
 		spin_lock_irq(&kapmd_queue_lock);
@@ -520,11 +544,11 @@ static int __init apm_init(void)
 		return -ENODEV;
 	}
=20
-	mips_apm_active =3D 1;
+	apm_emu_active =3D 1;
=20
 	ret =3D kernel_thread(kapmd, NULL, CLONE_KERNEL);
 	if (ret < 0) {
-		mips_apm_active =3D 0;
+		apm_emu_active =3D 0;
 		return ret;
 	}
=20
@@ -536,7 +560,7 @@ #endif
 	if (ret !=3D 0) {
 		remove_proc_entry("apm", NULL);
=20
-		mips_apm_active =3D 0;
+		apm_emu_active =3D 0;
 		wake_up(&kapmd_wait);
 		wait_for_completion(&kapmd_exit);
 	}
@@ -549,7 +573,7 @@ static void __exit apm_exit(void)
 	misc_deregister(&apm_device);
 	remove_proc_entry("apm", NULL);
=20
-	mips_apm_active =3D 0;
+	apm_emu_active =3D 0;
 	wake_up(&kapmd_wait);
 	wait_for_completion(&kapmd_exit);
 }

--S66JdqtemGhvbcZP--

--qYrsQHciA3Wqs7Iv
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFEvzHWQaTCYNJaVjMRAi4tAKDcu4N15Oa7/p4F9OPIzfJWMHkk2QCguC1y
6T2Whm0RcdhIka7j+RWw6Yk=
=zOX5
-----END PGP SIGNATURE-----

--qYrsQHciA3Wqs7Iv--

From gary.smith@3phoenix.com Thu Jul 20 15:30:36 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 20 Jul 2006 15:30:47 +0100 (BST)
Received: from lvs00-fl-n02.ftl.affinity.com ([216.219.253.98]:16306 "EHLO
	lvs00-fl-n02.ftl.affinity.com") by ftp.linux-mips.org with ESMTP
	id S8133847AbWGTOag (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 20 Jul 2006 15:30:36 +0100
Received: from [24.106.202.234] ([24.106.202.234]:13062 "EHLO 3PiGAS")
	by ams002.ftl.affinity.com with ESMTP id S362485AbWGTOaa (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 20 Jul 2006 10:30:30 -0400
From:	"Gary Smith" <gary.smith@3phoenix.com>
To:	<linux-mips@linux-mips.org>
Subject: IDE on Swarm
Date:	Thu, 20 Jul 2006 10:30:28 -0400
Organization: 3 Phoenix, Inc.
Message-ID: <000601c6ac09$0c262f30$6dacaac0@3PiGAS>
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_0007_01C6ABE7.85148F30"
X-Mailer: Microsoft Office Outlook 11
Thread-Index: AcasCQvZcIj85GkSRXKQ3ZPigI/XLA==
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
Return-Path: <gary.smith@3phoenix.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12039
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: gary.smith@3phoenix.com
Precedence: bulk
X-list: linux-mips

This is a multi-part message in MIME format.

------=_NextPart_000_0007_01C6ABE7.85148F30
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit

Hello All,

 

I'd like to ask a question regarding a post I noticed on a message board.
The post I read is as follows.

 

http://mail.bitmover.com/pipermail/sibyte-users/2004-November/000029.html

 

I am using a BCM91250A evaluation board with a compactflash device connected
to the onboard IDE controller.  When booting with a Linux 2.4.20 kernel, the
IDE interface is recognized and the compactflash device is hda.  When
booting with a Linux 2.6.16.25 kernel, the IDE interface is recognized, but
no device information is echoed to the console.  I've included output below.
The message post above mentions that there were problems with the IDE driver
in Linux 2.6 during the late 2004 time-frame.  I'd like to inquire about the
current availability of the IDE driver in the kernel.

 

 

Linux 2.4.20 Output:

 

Uniform Multi-Platform E-IDE driver Revision: 6.31

ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx

SiByte onboard IDE configured as device 0

hda: SanDisk SDCFB-1024, ATA DISK drive

ide0 at 0xffffffffb00b3e01-0xffffffffb00b3e08,0xffffffffb00b7ec1 on irq 36

hda: 2001888 sectors (1025 MB) w/1KiB Cache, CHS=1986/16/63

Partition check:

 /dev/ide/host0/bus0/target0/lun0: p1

 

 

 

Linux 2.6.16.25 Output:

 

Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2

ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx

ide-floppy driver 0.99.newide

SWARM IDE driver

ide-swarm: IDE interface at GenBus slot 4

NET: Registered protocol family 2

 

 

Thank you for your time.

 

Gary

--

Gary A. Smith, ABD PhD
Systems Engineer, 3Phoenix, Inc.


------=_NextPart_000_0007_01C6ABE7.85148F30
Content-Type: text/html;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

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

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
 name=3D"City"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
 name=3D"place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier New";color:black'>Hello =
All,<o:p></o:p></span></font></p>

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

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier =
New";color:black'>I&#8217;d like
to ask a question regarding a post I noticed on a message board.&nbsp; =
The post
I read is as follows.<o:p></o:p></span></font></p>

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

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier =
New";color:black'>http://mail.bitmover.com/pipermail/sibyte-users/2004-No=
vember/000029.html<o:p></o:p></span></font></p>

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

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier New";color:black'>I am =
using a
BCM91250A evaluation board with a compactflash device connected to the =
onboard
IDE controller.&nbsp; When booting with a Linux 2.4.20 kernel, the IDE
interface is recognized and the compactflash device is hda.&nbsp; When =
booting
with a Linux 2.6.16.25 kernel, the IDE interface is recognized, but no =
device
information is echoed to the console.&nbsp; I&#8217;ve included output
below.&nbsp; The message post above mentions that there were problems =
with the
IDE driver in Linux 2.6 during the late 2004 time-frame.&nbsp; I&#8217;d =
like
to inquire about the current availability of the IDE driver in the =
kernel.<o:p></o:p></span></font></p>

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

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

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier New";color:black'>Linux =
2.4.20
Output:<o:p></o:p></span></font></p>

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

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier New";color:black'>Uniform
Multi-Platform E-IDE driver Revision: 6.31<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier New";color:black'>ide: =
Assuming
50MHz system bus speed for PIO modes; override with =
idebus=3Dxx<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier New";color:black'>SiByte =
onboard
IDE configured as device 0<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier New";color:black'>hda: =
SanDisk
SDCFB-1024, ATA DISK drive<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier New";color:black'>ide0 at =
0xffffffffb00b3e01-0xffffffffb00b3e08,0xffffffffb00b7ec1
on irq 36<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier New";color:black'>hda: =
2001888
sectors (1025 MB) w/1KiB Cache, =
CHS=3D1986/16/63<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier =
New";color:black'>Partition check:<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier =
New";color:black'>&nbsp;/dev/ide/host0/bus0/target0/lun0:
p1<o:p></o:p></span></font></p>

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

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

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

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier New";color:black'>Linux =
2.6.16.25
Output:<o:p></o:p></span></font></p>

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

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier New";color:black'>Uniform =
Multi-Platform
E-IDE driver Revision: 7.00alpha2<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier New";color:black'>ide: =
Assuming
50MHz system bus speed for PIO modes; override with =
idebus=3Dxx<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier =
New";color:black'>ide-floppy
driver 0.99.newide<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier New";color:black'>SWARM =
IDE driver<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier =
New";color:black'>ide-swarm: IDE
interface at GenBus slot 4<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier New";color:black'>NET: =
Registered
protocol family 2<o:p></o:p></span></font></p>

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

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

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Courier =
New"><span
style=3D'font-size:12.0pt;font-family:"Courier New";color:black'>Thank =
you for
your time.<o:p></o:p></span></font></p>

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

<p class=3DMsoNormal><st1:place w:st=3D"on"><st1:City w:st=3D"on"><font =
size=3D3
  color=3Dblack face=3D"Courier New"><span =
style=3D'font-size:12.0pt;font-family:
  "Courier =
New";color:black'>Gary</span></font></st1:City></st1:place><font
color=3Dblack face=3D"Courier New"><span style=3D'font-family:"Courier =
New";
color:black'><o:p></o:p></span></font></p>

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

<p class=3DMsoNormal><font size=3D3 face=3D"Courier New"><span =
style=3D'font-size:12.0pt;
font-family:"Courier New"'>Gary A. Smith, ABD PhD<br>
Systems Engineer, 3Phoenix, Inc.</span></font><o:p></o:p></p>

</div>

</body>

</html>

------=_NextPart_000_0007_01C6ABE7.85148F30--


From ths@networkno.de Thu Jul 20 16:32:55 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 20 Jul 2006 16:33:08 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:57511 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8133847AbWGTPcz (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 20 Jul 2006 16:32:55 +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 3071C4654D; Thu, 20 Jul 2006 17:32:54 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1G3aVU-00005g-8g; Thu, 20 Jul 2006 16:32:08 +0100
Date:	Thu, 20 Jul 2006 16:32:08 +0100
To:	Gary Smith <gary.smith@3phoenix.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: IDE on Swarm
Message-ID: <20060720153208.GC4350@networkno.de>
References: <000601c6ac09$0c262f30$6dacaac0@3PiGAS>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <000601c6ac09$0c262f30$6dacaac0@3PiGAS>
User-Agent: Mutt/1.5.12-2006-07-14
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: 12040
X-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

Gary Smith wrote:
[snip]
> I am using a BCM91250A evaluation board with a compactflash device connected
> to the onboard IDE controller.  When booting with a Linux 2.4.20 kernel, the
> IDE interface is recognized and the compactflash device is hda.  When
> booting with a Linux 2.6.16.25 kernel, the IDE interface is recognized, but
> no device information is echoed to the console.  I've included output below.
> The message post above mentions that there were problems with the IDE driver
> in Linux 2.6 during the late 2004 time-frame.  I'd like to inquire about the
> current availability of the IDE driver in the kernel.

The SWARM onboard IDE works for me with the appended patch. (Originally from
Peter Horton <pdh@colonel-panic.org>.)


Thiemo

--- a/drivers/ide/mips/swarm.c
+++ b/drivers/ide/mips/swarm.c
@@ -127,6 +127,7 @@ static int __devinit swarm_ide_probe(str
 	memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports));
 	hwif->irq = hwif->hw.irq;
 
+	probe_hwif_init(hwif);
 	dev_set_drvdata(dev, hwif);
 
 	return 0;

From tbm@cyrius.com Thu Jul 20 16:36:34 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 20 Jul 2006 16:36:43 +0100 (BST)
Received: from sorrow.cyrius.com ([65.19.161.204]:35854 "EHLO
	sorrow.cyrius.com") by ftp.linux-mips.org with ESMTP
	id S8133505AbWGTPge (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 20 Jul 2006 16:36:34 +0100
Received: by sorrow.cyrius.com (Postfix, from userid 10)
	id 5775D64D54; Thu, 20 Jul 2006 15:36:27 +0000 (UTC)
Received: by deprecation.cyrius.com (Postfix, from userid 1000)
	id 9CC9366ED2; Thu, 20 Jul 2006 17:36:29 +0200 (CEST)
Date:	Thu, 20 Jul 2006 17:36:29 +0200
From:	Martin Michlmayr <tbm@cyrius.com>
To:	Thiemo Seufer <ths@networkno.de>
Cc:	Gary Smith <gary.smith@3phoenix.com>, linux-mips@linux-mips.org
Subject: Re: IDE on Swarm
Message-ID: <20060720153629.GH26731@deprecation.cyrius.com>
References: <000601c6ac09$0c262f30$6dacaac0@3PiGAS> <20060720153208.GC4350@networkno.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060720153208.GC4350@networkno.de>
User-Agent: Mutt/1.5.11+cvs20060403
Return-Path: <tbm@cyrius.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12041
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: tbm@cyrius.com
Precedence: bulk
X-list: linux-mips

* Thiemo Seufer <ths@networkno.de> [2006-07-20 16:32]:
> > in Linux 2.6 during the late 2004 time-frame.  I'd like to inquire about the
> > current availability of the IDE driver in the kernel.
> The SWARM onboard IDE works for me with the appended patch. (Originally from
> Peter Horton <pdh@colonel-panic.org>.)

I think the problem is that PCMCIA support was never ported to 2.6.
Peter 'p2' De Schrijver wanted to work on this but I've no idea what
the progress is.
-- 
Martin Michlmayr
http://www.cyrius.com/

From sshtylyov@ru.mvista.com Thu Jul 20 16:55:10 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 20 Jul 2006 16:55:19 +0100 (BST)
Received: from h155.mvista.com ([63.81.120.155]:27383 "EHLO imap.sh.mvista.com")
	by ftp.linux-mips.org with ESMTP id S8133505AbWGTPzK (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 20 Jul 2006 16:55:10 +0100
Received: from [192.168.1.248] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id 79DE23EBE; Thu, 20 Jul 2006 08:54:47 -0700 (PDT)
Message-ID: <44BFA700.7040202@ru.mvista.com>
Date:	Thu, 20 Jul 2006 19:53:36 +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:	Thiemo Seufer <ths@networkno.de>
Cc:	Gary Smith <gary.smith@3phoenix.com>, linux-mips@linux-mips.org
Subject: Re: IDE on Swarm
References: <000601c6ac09$0c262f30$6dacaac0@3PiGAS> <20060720153208.GC4350@networkno.de>
In-Reply-To: <20060720153208.GC4350@networkno.de>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12042
X-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.

Thiemo Seufer wrote:

> The SWARM onboard IDE works for me with the appended patch. (Originally from
> Peter Horton <pdh@colonel-panic.org>.)

> Thiemo
> 
> --- a/drivers/ide/mips/swarm.c
> +++ b/drivers/ide/mips/swarm.c
> @@ -127,6 +127,7 @@ static int __devinit swarm_ide_probe(str
>  	memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports));
>  	hwif->irq = hwif->hw.irq;
>  
> +	probe_hwif_init(hwif);
>  	dev_set_drvdata(dev, hwif);
>  
>  	return 0;

    Has it been submitted anywhere?

WBR, Sergei

From ths@networkno.de Thu Jul 20 16:56:01 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 20 Jul 2006 16:56:11 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:3762 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8133505AbWGTP4B (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 20 Jul 2006 16:56:01 +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 696DB4652A; Thu, 20 Jul 2006 17:56:00 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1G3arq-0000Rh-H2; Thu, 20 Jul 2006 16:55:14 +0100
Date:	Thu, 20 Jul 2006 16:55:14 +0100
From:	Thiemo Seufer <ths@networkno.de>
To:	Martin Michlmayr <tbm@cyrius.com>
Cc:	Gary Smith <gary.smith@3phoenix.com>, linux-mips@linux-mips.org
Subject: Re: IDE on Swarm
Message-ID: <20060720155514.GD4350@networkno.de>
References: <000601c6ac09$0c262f30$6dacaac0@3PiGAS> <20060720153208.GC4350@networkno.de> <20060720153629.GH26731@deprecation.cyrius.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060720153629.GH26731@deprecation.cyrius.com>
User-Agent: Mutt/1.5.12-2006-07-14
Return-Path: <ths@networkno.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12043
X-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

Martin Michlmayr wrote:
> * Thiemo Seufer <ths@networkno.de> [2006-07-20 16:32]:
> > > in Linux 2.6 during the late 2004 time-frame.  I'd like to inquire about the
> > > current availability of the IDE driver in the kernel.
> > The SWARM onboard IDE works for me with the appended patch. (Originally from
> > Peter Horton <pdh@colonel-panic.org>.)
> 
> I think the problem is that PCMCIA support was never ported to 2.6.
> Peter 'p2' De Schrijver wanted to work on this but I've no idea what
> the progress is.

AFAIU Gary used a Compact Flash connected to the onboard IDE, not a
CF -> PCMCIA Adapter.


Thiemo

From hemanth.venkatesh@wipro.com Thu Jul 20 17:02:38 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 20 Jul 2006 17:02:47 +0100 (BST)
Received: from wip-ec-wd.wipro.com ([203.91.193.32]:3017 "EHLO
	wip-ec-wd.wipro.com") by ftp.linux-mips.org with ESMTP
	id S8133863AbWGTQCi (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 20 Jul 2006 17:02:38 +0100
Received: from wip-ec-wd.wipro.com (localhost.wipro.com [127.0.0.1])
	by localhost (Postfix) with ESMTP id 5FF4520611
	for <linux-mips@linux-mips.org>; Thu, 20 Jul 2006 21:29:33 +0530 (IST)
Received: from blr-ec-bh02.wipro.com (blr-ec-bh02.wipro.com [10.201.50.92])
	by wip-ec-wd.wipro.com (Postfix) with ESMTP id 45B38205F9
	for <linux-mips@linux-mips.org>; Thu, 20 Jul 2006 21:29:33 +0530 (IST)
Received: from blr-m2-msg.wipro.com ([10.116.50.99]) by blr-ec-bh02.wipro.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 20 Jul 2006 21:32:28 +0530
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C6AC15.E5D92044"
Subject: Bit operations work differently on MIPS and IA32
Date:	Thu, 20 Jul 2006 21:32:27 +0530
Message-ID: <2156B1E923F1A147AABDF4D9FDEAB4CB09D3D8@blr-m2-msg.wipro.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Bit operations work differently on MIPS and IA32
Thread-Index: AcasFQ/xrmCPYNwVQ4+tr2B2UuBJFg==
From:	<hemanth.venkatesh@wipro.com>
To:	<linux-mips@linux-mips.org>
X-OriginalArrivalTime: 20 Jul 2006 16:02:28.0051 (UTC) FILETIME=[E60C8A30:01C6AC15]
Return-Path: <hemanth.venkatesh@wipro.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: 12044
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: hemanth.venkatesh@wipro.com
Precedence: bulk
X-list: linux-mips

This is a multi-part message in MIME format.

------_=_NextPart_001_01C6AC15.E5D92044
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi All,

=20

I ran the below program on an IA32 and AU1100 machine, both being little
endian machines and got different results. Does anyone know what could
be the cause of this behaviour. This problem is blocking us from booting
the cramfs rootfs.

=20

#include <stdio.h>

typedef unsigned int u32;

main()

{

struct tmp{

u32 namelen:6,offset:26;

}tmp1;

=20

(*(int *)(&tmp1))=3D0x4c0;

=20

printf("%d %d\n",tmp1.namelen,tmp1.offset);

=20

}

=20

Results on IA32 : 0 19

=20

Results on AU1100 (MIPS):  0 1216

=20

Thanks

hemanth


------_=_NextPart_001_01C6AC15.E5D92044
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

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

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Hi All,<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I ran the below program on an IA32 and AU1100 =
machine, both
being little endian machines and got different results. Does anyone know =
what
could be the cause of this behaviour. This problem is blocking us from =
booting
the cramfs rootfs.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>#include &lt;stdio.h&gt;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>typedef unsigned int =
u32;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>main()<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>{<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>struct tmp{<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>u32 namelen:6,offset:26;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>}tmp1;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>(*(int =
*)(&amp;tmp1))=3D0x4c0;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>printf(&quot;%d =
%d\n&quot;,tmp1.namelen,tmp1.offset);<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:11.0pt;
font-family:Arial'>}<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:11.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:11.0pt;
font-family:Arial'>Results on IA32 : 0 19<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:11.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:11.0pt;
font-family:Arial'>Results on AU1100 (MIPS):&nbsp; 0 =
1216<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:11.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:11.0pt;
font-family:Arial'>Thanks<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:11.0pt;
font-family:Arial'>hemanth<o:p></o:p></span></font></p>

</div>

</body>

</html>

------_=_NextPart_001_01C6AC15.E5D92044--

From ths@networkno.de Thu Jul 20 17:19:26 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 20 Jul 2006 17:19:36 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:31929 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8133505AbWGTQT0 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 20 Jul 2006 17:19:26 +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 492A046A3A; Thu, 20 Jul 2006 18:19:26 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1G3bEW-00010n-07; Thu, 20 Jul 2006 17:18:40 +0100
Date:	Thu, 20 Jul 2006 17:18:39 +0100
To:	hemanth.venkatesh@wipro.com
Cc:	linux-mips@linux-mips.org
Subject: Re: Bit operations work differently on MIPS and IA32
Message-ID: <20060720161839.GE4350@networkno.de>
References: <2156B1E923F1A147AABDF4D9FDEAB4CB09D3D8@blr-m2-msg.wipro.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <2156B1E923F1A147AABDF4D9FDEAB4CB09D3D8@blr-m2-msg.wipro.com>
User-Agent: Mutt/1.5.12-2006-07-14
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: 12045
X-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

hemanth.venkatesh@wipro.com wrote:
> Hi All,
> 
>  
> 
> I ran the below program on an IA32 and AU1100 machine, both being little
> endian machines and got different results. Does anyone know what could
> be the cause of this behaviour. This problem is blocking us from booting
> the cramfs rootfs.
> 
>  
> 
> #include <stdio.h>
> 
> typedef unsigned int u32;
> 
> main()
> 
> {
> 
> struct tmp{
> 
> u32 namelen:6,offset:26;
> 
> }tmp1;
> 
> (*(int *)(&tmp1))=0x4c0;

This makes non-portable assumptions about the bitfield layout. The
results are platform-dependent (or rather ABI-dependent). Portable
code needs to avoid acessing bitfields via typecasts.


Thiemo

From mbizon@freebox.fr Thu Jul 20 17:52:08 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 20 Jul 2006 17:52:16 +0100 (BST)
Received: from sakura.staff.proxad.net ([213.228.1.107]:51646 "EHLO
	sakura.staff.proxad.net") by ftp.linux-mips.org with ESMTP
	id S8133859AbWGTQwI (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 20 Jul 2006 17:52:08 +0100
Received: from max by sakura.staff.proxad.net with local (Exim 3.36 #1 (Debian))
	id 1G3bko-00024v-00
	for <linux-mips@linux-mips.org>; Thu, 20 Jul 2006 18:52:02 +0200
Subject: [PATCH] Honour "panic_on_oops" sysctl on mips arch
From:	Maxime Bizon <mbizon@freebox.fr>
Reply-To: mbizon@freebox.fr
To:	linux-mips@linux-mips.org
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Date:	Thu, 20 Jul 2006 18:52:02 +0200
Message-Id: <1153414322.20352.268.camel@sakura.staff.proxad.net>
Mime-Version: 1.0
X-Mailer: Evolution 2.6.1 
Return-Path: <mbizon@freebox.fr>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12046
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: mbizon@freebox.fr
Precedence: bulk
X-list: linux-mips


Hello all,

The panic_on_oops sysctl has no effect on mips, the following patch
fixes it.


Signed-off-by: Maxime Bizon <mbizon@freebox.fr>

--- linux-2.6.17.6/arch/mips/kernel/traps.c.orig	2006-07-20 18:42:37.000000000 +0200
+++ linux-2.6.17.6/arch/mips/kernel/traps.c	2006-07-20 18:42:56.000000000 +0200
@@ -21,6 +21,7 @@
 #include <linux/spinlock.h>
 #include <linux/kallsyms.h>
 #include <linux/bootmem.h>
+#include <linux/interrupt.h>
 
 #include <asm/bootinfo.h>
 #include <asm/branch.h>
@@ -293,6 +294,16 @@
 	printk("%s[#%d]:\n", str, ++die_counter);
 	show_registers(regs);
 	spin_unlock_irq(&die_lock);
+
+	if (in_interrupt())
+		panic("Fatal exception in interrupt");
+
+	if (panic_on_oops) {
+		printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
+		ssleep(5);
+		panic("Fatal exception");
+	}
+
 	do_exit(SIGSEGV);
 }
 


Regards,

-- 
Maxime

From imipak@yahoo.com Thu Jul 20 18:45:28 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 20 Jul 2006 18:45:40 +0100 (BST)
Received: from web31514.mail.mud.yahoo.com ([68.142.198.143]:31599 "HELO
	web31514.mail.mud.yahoo.com") by ftp.linux-mips.org with SMTP
	id S8133869AbWGTRp2 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 20 Jul 2006 18:45:28 +0100
Received: (qmail 67215 invoked by uid 60001); 20 Jul 2006 17:45:22 -0000
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
  s=s1024; d=yahoo.com;
  h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding;
  b=rKnZDtcKRkiZP9xebeUku0WbwXV0KLxnmfmiXggqxJSbpFDX4A7+vZsXIoz4W7z58/e/ghD9J0Uoid05tALE32sUDJqLnapmv+lH1b9H7WouCZArFvN7rWoMX9Nx+O0SJu4bgaPU9QP4C11HP+mLH7TfQPK2D6h/JNLo0BME2W0=  ;
Message-ID: <20060720174522.67213.qmail@web31514.mail.mud.yahoo.com>
Received: from [209.102.119.100] by web31514.mail.mud.yahoo.com via HTTP; Thu, 20 Jul 2006 10:45:22 PDT
Date:	Thu, 20 Jul 2006 10:45:22 -0700 (PDT)
From:	Jonathan Day <imipak@yahoo.com>
Subject: Re: Bit operations work differently on MIPS and IA32
To:	hemanth.venkatesh@wipro.com, linux-mips@linux-mips.org
In-Reply-To: <2156B1E923F1A147AABDF4D9FDEAB4CB09D3D8@blr-m2-msg.wipro.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Return-Path: <imipak@yahoo.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12047
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: imipak@yahoo.com
Precedence: bulk
X-list: linux-mips

Hi,

Well, looking at it, the word is aligned in exactly
the same way but the bitfields are applied in the
opposite direction. (In the ix32 example, the 6 bits
are counting from the low end of the word, but on the
MIPS are counting from the high end.)

The first question one must ask is whether you are
using the same toolchain for both and what compiler
directives you are giving in each case. (If you are
using GCC on the MIPS, it would also be good to know
what sort of code it was compiled to generate by
default. If you ask GCC for the version information,
it'll give the compiler flags used.)

Even with this information, as another poster noted,
bitfield operations are not guaranteed to be portable.
The best I, or anyone else, can do is see if there's
anything obviously inconsistant in the compiler flags.

If you absolutely need to use the bitfields you've
listed, you CAN do a workaround. Either you can use a
#ifdef to determine the order the bitfields are listed
in the union, OR you can take 6 bits off each end and
recombine the end you want to keep with the offset.

(Optimizing the code could break either of these
methods, as there is no guarantee where the optimizer
will decide to place the fields. That would presumably
be system-dependent, as different bytes may be easier
to access on different architectures, so would be
subject to different optimizations.)

--- hemanth.venkatesh@wipro.com wrote:

> Hi All,
> 
>  
> 
> I ran the below program on an IA32 and AU1100
> machine, both being little
> endian machines and got different results. Does
> anyone know what could
> be the cause of this behaviour. This problem is
> blocking us from booting
> the cramfs rootfs.
> 
>  
> 
> #include <stdio.h>
> 
> typedef unsigned int u32;
> 
> main()
> 
> {
> 
> struct tmp{
> 
> u32 namelen:6,offset:26;
> 
> }tmp1;
> 
>  
> 
> (*(int *)(&tmp1))=0x4c0;
> 
>  
> 
> printf("%d %d\n",tmp1.namelen,tmp1.offset);
> 
>  
> 
> }
> 
>  
> 
> Results on IA32 : 0 19
> 
>  
> 
> Results on AU1100 (MIPS):  0 1216
> 
>  
> 
> Thanks
> 
> hemanth
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

From ralf@linux-mips.org Thu Jul 20 21:26:38 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 20 Jul 2006 21:26:46 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:64161 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S8133853AbWGTU0i (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 20 Jul 2006 21:26:38 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.7/8.13.4) with ESMTP id k6KJIcrD022469;
	Thu, 20 Jul 2006 15:21:18 -0400
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.7/8.13.7/Submit) id k6KJIaiR022468;
	Thu, 20 Jul 2006 15:18:36 -0400
Date:	Thu, 20 Jul 2006 15:18:36 -0400
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Maxime Bizon <mbizon@freebox.fr>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] Honour "panic_on_oops" sysctl on mips arch
Message-ID: <20060720191836.GA22361@linux-mips.org>
References: <1153414322.20352.268.camel@sakura.staff.proxad.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1153414322.20352.268.camel@sakura.staff.proxad.net>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12048
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Thu, Jul 20, 2006 at 06:52:02PM +0200, Maxime Bizon wrote:

> The panic_on_oops sysctl has no effect on mips, the following patch
> fixes it.

Applied. thanks,

  Ralf

From hemanth.venkatesh@wipro.com Fri Jul 21 07:51:55 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Jul 2006 07:52:04 +0100 (BST)
Received: from wip-ec-wd.wipro.com ([203.91.193.32]:5001 "EHLO
	wip-ec-wd.wipro.com") by ftp.linux-mips.org with ESMTP
	id S8133479AbWGUGvz convert rfc822-to-8bit (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 21 Jul 2006 07:51:55 +0100
Received: from wip-ec-wd.wipro.com (localhost.wipro.com [127.0.0.1])
	by localhost (Postfix) with ESMTP id AFFB52062A
	for <linux-mips@linux-mips.org>; Fri, 21 Jul 2006 12:18:50 +0530 (IST)
Received: from blr-ec-bh02.wipro.com (blr-ec-bh02.wipro.com [10.201.50.92])
	by wip-ec-wd.wipro.com (Postfix) with ESMTP id 9AD102061C
	for <linux-mips@linux-mips.org>; Fri, 21 Jul 2006 12:18:50 +0530 (IST)
Received: from blr-m2-msg.wipro.com ([10.116.50.99]) by blr-ec-bh02.wipro.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Fri, 21 Jul 2006 12:21:46 +0530
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 8BIT
Subject: RE: Bit operations work differently on MIPS and IA32
Date:	Fri, 21 Jul 2006 12:21:45 +0530
Message-ID: <2156B1E923F1A147AABDF4D9FDEAB4CB09D442@blr-m2-msg.wipro.com>
In-Reply-To: <20060720174522.67213.qmail@web31514.mail.mud.yahoo.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Bit operations work differently on MIPS and IA32
Thread-Index: AcasJFVDEyeancCHSNS+3F9wS4UZvwAajYsg
From:	<hemanth.venkatesh@wipro.com>
To:	<imipak@yahoo.com>
Cc:	<linux-mips@linux-mips.org>
X-OriginalArrivalTime: 21 Jul 2006 06:51:46.0195 (UTC) FILETIME=[21FB2E30:01C6AC92]
Return-Path: <hemanth.venkatesh@wipro.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: 12049
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: hemanth.venkatesh@wipro.com
Precedence: bulk
X-list: linux-mips

Hi,

It was indeed compiler options, but not sure exactly which one.
Previously we were using WR GNU compiler  mips-wrs-linux-gnu-gcc, and
when we replaced it with mips-wrs-linux-gnu-mips32_el-gpp-gcc bit
operations are working perfectly. The system has been booted from a
cramfs RAMDISK image.

Thanks for your help
Hemanth

-----Original Message-----
From: Jonathan Day [mailto:imipak@yahoo.com] 
Sent: Thursday, July 20, 2006 11:15 PM
To: Hemanth V (WT01 - Embedded Systems); linux-mips@linux-mips.org
Subject: Re: Bit operations work differently on MIPS and IA32

Hi,

Well, looking at it, the word is aligned in exactly
the same way but the bitfields are applied in the
opposite direction. (In the ix32 example, the 6 bits
are counting from the low end of the word, but on the
MIPS are counting from the high end.)

The first question one must ask is whether you are
using the same toolchain for both and what compiler
directives you are giving in each case. (If you are
using GCC on the MIPS, it would also be good to know
what sort of code it was compiled to generate by
default. If you ask GCC for the version information,
it'll give the compiler flags used.)

Even with this information, as another poster noted,
bitfield operations are not guaranteed to be portable.
The best I, or anyone else, can do is see if there's
anything obviously inconsistant in the compiler flags.

If you absolutely need to use the bitfields you've
listed, you CAN do a workaround. Either you can use a
#ifdef to determine the order the bitfields are listed
in the union, OR you can take 6 bits off each end and
recombine the end you want to keep with the offset.

(Optimizing the code could break either of these
methods, as there is no guarantee where the optimizer
will decide to place the fields. That would presumably
be system-dependent, as different bytes may be easier
to access on different architectures, so would be
subject to different optimizations.)

--- hemanth.venkatesh@wipro.com wrote:

> Hi All,
> 
>  
> 
> I ran the below program on an IA32 and AU1100
> machine, both being little
> endian machines and got different results. Does
> anyone know what could
> be the cause of this behaviour. This problem is
> blocking us from booting
> the cramfs rootfs.
> 
>  
> 
> #include <stdio.h>
> 
> typedef unsigned int u32;
> 
> main()
> 
> {
> 
> struct tmp{
> 
> u32 namelen:6,offset:26;
> 
> }tmp1;
> 
>  
> 
> (*(int *)(&tmp1))=0x4c0;
> 
>  
> 
> printf("%d %d\n",tmp1.namelen,tmp1.offset);
> 
>  
> 
> }
> 
>  
> 
> Results on IA32 : 0 19
> 
>  
> 
> Results on AU1100 (MIPS):  0 1216
> 
>  
> 
> Thanks
> 
> hemanth
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

From pulsar@kpsws.com Fri Jul 21 10:31:40 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Jul 2006 10:31:48 +0100 (BST)
Received: from ingenieursbureauknipscheer.nl ([213.189.19.79]:42493 "EHLO
	mail.kpsws.com") by ftp.linux-mips.org with ESMTP id S8133539AbWGUJbk
	(ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 21 Jul 2006 10:31:40 +0100
Received: (qmail 99299 invoked by uid 89); 21 Jul 2006 09:28:08 -0000
Received: from unknown (HELO mail.kpsws.com) (127.0.0.1)
  by 127.0.0.1 with SMTP; 21 Jul 2006 09:28:08 -0000
Received: from 194.171.252.100
        (SquirrelMail authenticated user pulsar@kpsws.com)
        by mail.kpsws.com with HTTP;
        Fri, 21 Jul 2006 09:28:08 -0000 (UTC)
Message-ID: <15360.194.171.252.100.1153474088.squirrel@mail.kpsws.com>
In-Reply-To: <20060720191836.GA22361@linux-mips.org>
References: <1153414322.20352.268.camel@sakura.staff.proxad.net>
    <20060720191836.GA22361@linux-mips.org>
Date:	Fri, 21 Jul 2006 09:28:08 -0000 (UTC)
Subject: reserved pages and zero pages question
From:	pulsar@kpsws.com
To:	linux-mips@linux-mips.org
User-Agent: SquirrelMail/1.4.6
MIME-Version: 1.0
Content-Type: text/plain;charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Priority: 3 (Normal)
Importance: Normal
Return-Path: <pulsar@kpsws.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: 12050
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: pulsar@kpsws.com
Precedence: bulk
X-list: linux-mips

Hi,

In my kernel startup I see the memory usage printed as:

Memory: 125312k/131072k available (1977k kernel code, 5648k reserved, 287k
data, 1664k init, 0k highmem)

I wonder where the reserved pages are used for and how we can minimize it
for small memory systems.

In my search I see that in arcm/mips/mm/init.c there are zero-pages
allocated and put to reserved.

Where are the zero pages used for and can we do without ?

thanks in advance,

Niels Sterrenburg


From ths@networkno.de Fri Jul 21 12:15:34 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Jul 2006 12:15:43 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:35542 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8133492AbWGULPe (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 21 Jul 2006 12:15:34 +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 A0C1E46034; Fri, 21 Jul 2006 13:15:33 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1G3sEi-0003Lb-E9; Fri, 21 Jul 2006 11:28:00 +0100
Date:	Fri, 21 Jul 2006 11:28:00 +0100
To:	pulsar@kpsws.com
Cc:	linux-mips@linux-mips.org
Subject: Re: reserved pages and zero pages question
Message-ID: <20060721102800.GA4456@networkno.de>
References: <1153414322.20352.268.camel@sakura.staff.proxad.net> <20060720191836.GA22361@linux-mips.org> <15360.194.171.252.100.1153474088.squirrel@mail.kpsws.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <15360.194.171.252.100.1153474088.squirrel@mail.kpsws.com>
User-Agent: Mutt/1.5.12-2006-07-14
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: 12051
X-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

pulsar@kpsws.com wrote:
> Hi,
> 
> In my kernel startup I see the memory usage printed as:
> 
> Memory: 125312k/131072k available (1977k kernel code, 5648k reserved, 287k
> data, 1664k init, 0k highmem)
> 
> I wonder where the reserved pages are used for and how we can minimize it
> for small memory systems.

Most of that is the ramdisk you included. :-)  It normally given back
once the ramdisk is decompressed.

> In my search I see that in arcm/mips/mm/init.c there are zero-pages
> allocated and put to reserved.
> 
> Where are the zero pages used for and can we do without ?

They provide a clean zeroed page which gets mapped read-only (probably
for copy-on-write). You can't do without.


Thiemo

From akpm@osdl.org Fri Jul 21 14:05:46 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 21 Jul 2006 14:05:55 +0100 (BST)
Received: from smtp.osdl.org ([65.172.181.4]:15330 "EHLO smtp.osdl.org")
	by ftp.linux-mips.org with ESMTP id S8133889AbWGUNFq (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 21 Jul 2006 14:05:46 +0100
Received: from shell0.pdx.osdl.net (fw.osdl.org [65.172.181.6])
	by smtp.osdl.org (8.12.8/8.12.8) with ESMTP id k6LD5anW032361
	(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO);
	Fri, 21 Jul 2006 06:05:37 -0700
Received: from sony (shell0.pdx.osdl.net [10.9.0.31])
	by shell0.pdx.osdl.net (8.13.1/8.11.6) with SMTP id k6LD5aKB000454;
	Fri, 21 Jul 2006 06:05:36 -0700
Date:	Fri, 21 Jul 2006 06:05:13 -0700
From:	Andrew Morton <akpm@osdl.org>
To:	Rodolfo Giometti <giometti@linux.it>
Cc:	linux-kernel@vger.kernel.org, linux-mips@linux-mips.org
Subject: Re: [PATCH] no console disabling during suspend stage
Message-Id: <20060721060513.fd78b793.akpm@osdl.org>
In-Reply-To: <20060719091559.GD25330@enneenne.com>
References: <20060719091559.GD25330@enneenne.com>
X-Mailer: Sylpheed version 2.2.4 (GTK+ 2.8.19; i686-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-MIMEDefang-Filter: osdl$Revision: 1.141 $
X-Scanned-By: MIMEDefang 2.36
Return-Path: <akpm@osdl.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: 12052
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: akpm@osdl.org
Precedence: bulk
X-list: linux-mips

On Wed, 19 Jul 2006 11:16:00 +0200
Rodolfo Giometti <giometti@linux.it> wrote:

> here a little patch to avoid disabling console during suspend stage
> while we are debugging kernel.
> 
> ...
>
> --- kernel/power/main.c	2006-07-19 10:54:11.000000000 +0200
> +++ kernel/power/main.c.new	2006-07-18 19:38:41.000000000 +0200
> @@ -86,7 +86,9 @@
>  			goto Thaw;
>  	}
>  
> +#ifndef CONFIG_DEBUG_KERNEL
>  	suspend_console();
> +#endif

CONFIG_DEBUG_KERNEL is not really the appropriate thing to use here - it's
more a user-interface/Kconfig level thing.

Can you please describe the problems which suspend_console() are causing?

Some runtime knob might be more appropriate.  Perhaps /sys/power/debug?

If the suspend_console() call is to be disabled then you'll want to disable
the matching resume_console() call too.

printk.c needs sem2mutex conversion.

The console_suspended/secondary_console_sem handling is racy.  Bad Linus. 
But as we're running on a single CPU and all other tasks are frozen it
doesn't matter.

From daniel@yoobay.net Sat Jul 22 10:13:48 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 22 Jul 2006 10:13:57 +0100 (BST)
Received: from buzzloop.caiaq.de ([212.112.241.133]:48395 "EHLO
	buzzloop.caiaq.de") by ftp.linux-mips.org with ESMTP
	id S8133437AbWGVJNs (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 22 Jul 2006 10:13:48 +0100
Received: from localhost (localhost [127.0.0.1])
	by buzzloop.caiaq.de (Postfix) with ESMTP id BC9E37F4028;
	Sat, 22 Jul 2006 11:13:42 +0200 (CEST)
Received: from buzzloop.caiaq.de ([127.0.0.1])
	by localhost (buzzloop [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 17390-03; Sat, 22 Jul 2006 11:13:42 +0200 (CEST)
Received: by buzzloop.caiaq.de (Postfix, from userid 1000)
	id 655AD7F4024; Sat, 22 Jul 2006 11:13:42 +0200 (CEST)
Date:	Sat, 22 Jul 2006 11:13:42 +0200
From:	Daniel Mack <daniel@yoobay.net>
To:	Rodolfo Giometti <giometti@linux.it>
Cc:	i2c@lm-sensors.org, linux-mips@linux-mips.org
Subject: Re: [PATCH] AU1100 I2C support
Message-ID: <20060722091342.GA22158@ipxXXXXX>
References: <20060719180204.GK25330@enneenne.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060719180204.GK25330@enneenne.com>
User-Agent: Mutt/1.5.11
Return-Path: <daniel@yoobay.net>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12053
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: daniel@yoobay.net
Precedence: bulk
X-list: linux-mips

Hi,

On Wed, Jul 19, 2006 at 08:02:04PM +0200, Rodolfo Giometti wrote:
> here a patch to add I2C support to AU1100 processors by using two
> GPIOs.

Is there any reason why it is limited to this very processor and
should not work with all au1xxx types?

Daniel

From giometti@enneenne.com Sat Jul 22 13:37:31 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 22 Jul 2006 13:37:40 +0100 (BST)
Received: from 81-174-11-161.f5.ngi.it ([81.174.11.161]:53168 "EHLO
	gundam.enneenne.com") by ftp.linux-mips.org with ESMTP
	id S8133526AbWGVMhb (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 22 Jul 2006 13:37:31 +0100
Received: from giometti by gundam.enneenne.com with local (Exim 3.36 #1 (Debian))
	id 1G4Gex-0001KG-00; Sat, 22 Jul 2006 14:32:43 +0200
Date:	Sat, 22 Jul 2006 14:32:43 +0200
From:	Rodolfo Giometti <giometti@linux.it>
To:	Daniel Mack <daniel@yoobay.net>
Cc:	i2c@lm-sensors.org, linux-mips@linux-mips.org
Subject: Re: [PATCH] AU1100 I2C support
Message-ID: <20060722123243.GA4543@gundam.enneenne.com>
References: <20060719180204.GK25330@enneenne.com> <20060722091342.GA22158@ipxXXXXX>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="2fHTh5uZTiUOsy+g"
Content-Disposition: inline
In-Reply-To: <20060722091342.GA22158@ipxXXXXX>
Organization: GNU/Linux Device Drivers, Embedded Systems and Courses
X-PGP-Key: gpg --keyserver keyserver.linux.it --recv-keys D25A5633
User-Agent: Mutt/1.5.5.1+cvs20040105i
Return-Path: <giometti@enneenne.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: 12054
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: giometti@linux.it
Precedence: bulk
X-list: linux-mips


--2fHTh5uZTiUOsy+g
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Jul 22, 2006 at 11:13:42AM +0200, Daniel Mack wrote:
>=20
> Is there any reason why it is limited to this very processor and
> should not work with all au1xxx types?

To be honest I don't know exacly... I don't know so well other
processors in this family. However I think at least au1000 and au1200
should be compatible.

Ciao,

Rodolfo

--=20

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

--2fHTh5uZTiUOsy+g
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFEwhrrQaTCYNJaVjMRAruZAJ4p9PLCoUBCEmIT9SU6ya84xJho+ACgolBA
HhQKmiw1Rz9YlRPkx/G7EoM=
=pAEW
-----END PGP SIGNATURE-----

--2fHTh5uZTiUOsy+g--

From daniel@caiaq.de Mon Jul 24 11:30:52 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 24 Jul 2006 11:31:01 +0100 (BST)
Received: from buzzloop.caiaq.de ([212.112.241.133]:15884 "EHLO
	buzzloop.caiaq.de") by ftp.linux-mips.org with ESMTP
	id S8133454AbWGXKaw (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 24 Jul 2006 11:30:52 +0100
Received: from localhost (localhost [127.0.0.1])
	by buzzloop.caiaq.de (Postfix) with ESMTP id 16D327F4028;
	Mon, 24 Jul 2006 12:30:44 +0200 (CEST)
Received: from buzzloop.caiaq.de ([127.0.0.1])
	by localhost (buzzloop [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 32146-07; Mon, 24 Jul 2006 12:30:43 +0200 (CEST)
Received: from [192.168.1.140] (port-83-236-238-37.static.qsc.de [83.236.238.37])
	(using TLSv1 with cipher RC4-SHA (128/128 bits))
	(No client certificate requested)
	by buzzloop.caiaq.de (Postfix) with ESMTP id 8694B7F4024;
	Mon, 24 Jul 2006 12:30:43 +0200 (CEST)
In-Reply-To: <20060722123243.GA4543@gundam.enneenne.com>
References: <20060719180204.GK25330@enneenne.com> <20060722091342.GA22158@ipxXXXXX> <20060722123243.GA4543@gundam.enneenne.com>
Mime-Version: 1.0 (Apple Message framework v752.2)
X-Gpgmail-State: !signed
Content-Type: text/plain; charset=US-ASCII; format=flowed
Message-Id: <133FC0BA-B375-46D4-916E-773996425F57@caiaq.de>
Cc:	i2c@lm-sensors.org, linux-mips@linux-mips.org
Content-Transfer-Encoding: 7bit
From:	Daniel Mack <daniel@caiaq.de>
Subject: Re: [PATCH] AU1100 I2C support
Date:	Mon, 24 Jul 2006 12:30:42 +0200
To:	Rodolfo Giometti <giometti@linux.it>
X-Mailer: Apple Mail (2.752.2)
Return-Path: <daniel@caiaq.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: 12055
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: daniel@caiaq.de
Precedence: bulk
X-list: linux-mips


On Jul 22, 2006, at 2:32 PM, Rodolfo Giometti wrote:

> On Sat, Jul 22, 2006 at 11:13:42AM +0200, Daniel Mack wrote:
>>
>> Is there any reason why it is limited to this very processor and
>> should not work with all au1xxx types?
>
> To be honest I don't know exacly... I don't know so well other
> processors in this family. However I think at least au1000 and au1200
> should be compatible.

I think so, too. Since you only call the generic au_* functions for
the GPIO access, all members of this processor family should be
supported. I propose to change the patch accordingly.

Daniel


From giometti@enneenne.com Mon Jul 24 11:34:59 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 24 Jul 2006 11:35:08 +0100 (BST)
Received: from 81-174-11-161.f5.ngi.it ([81.174.11.161]:43984 "EHLO
	mail.enneenne.com") by ftp.linux-mips.org with ESMTP
	id S8133803AbWGXKe7 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 24 Jul 2006 11:34:59 +0100
Received: from zaigor.enneenne.com ([192.168.32.1])
	by mail.enneenne.com with esmtp (Exim 4.50)
	id 1G4wn3-0003N7-4a; Mon, 24 Jul 2006 11:31:53 +0200
Received: from giometti by zaigor.enneenne.com with local (Exim 4.60)
	(envelope-from <giometti@enneenne.com>)
	id 1G4xmA-0006EZ-8c; Mon, 24 Jul 2006 12:35:02 +0200
Date:	Mon, 24 Jul 2006 12:35:02 +0200
From:	Rodolfo Giometti <giometti@linux.it>
To:	Daniel Mack <daniel@caiaq.de>
Cc:	i2c@lm-sensors.org, linux-mips@linux-mips.org
Message-ID: <20060724103502.GZ9129@enneenne.com>
References: <20060719180204.GK25330@enneenne.com> <20060722091342.GA22158@ipxXXXXX> <20060722123243.GA4543@gundam.enneenne.com> <133FC0BA-B375-46D4-916E-773996425F57@caiaq.de>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="OJWLbGElk4npXSe3"
Content-Disposition: inline
In-Reply-To: <133FC0BA-B375-46D4-916E-773996425F57@caiaq.de>
Organization: GNU/Linux Device Drivers, Embedded Systems and Courses
X-PGP-Key: gpg --keyserver keyserver.linux.it --recv-keys D25A5633
User-Agent: Mutt/1.5.11+cvs20060403
X-SA-Exim-Connect-IP: 192.168.32.1
X-SA-Exim-Mail-From: giometti@enneenne.com
Subject: Re: [PATCH] AU1100 I2C support
X-SA-Exim-Version: 4.2 (built Thu, 03 Mar 2005 10:44:12 +0100)
X-SA-Exim-Scanned: Yes (on mail.enneenne.com)
Return-Path: <giometti@enneenne.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: 12056
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: giometti@linux.it
Precedence: bulk
X-list: linux-mips


--OJWLbGElk4npXSe3
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Jul 24, 2006 at 12:30:42PM +0200, Daniel Mack wrote:
>=20
> I think so, too. Since you only call the generic au_* functions for
> the GPIO access, all members of this processor family should be
> supported. I propose to change the patch accordingly.

Do you think I should change strings (functions' name, etc.) from
"au1100" to "au1xxx"?

If so, do you prefere a new patch or I can just send you a
patch-to-the-patch? :D

Ciao,

Rodolfo

--=20

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

--OJWLbGElk4npXSe3
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFExKJWQaTCYNJaVjMRAqEaAJ92M+eR794+xnPw8b0ua+sEzJpPsQCcCtpC
MsZylU0C7cuLPoYjF9hlXE8=
=RjD2
-----END PGP SIGNATURE-----

--OJWLbGElk4npXSe3--

From sshtylyov@ru.mvista.com Mon Jul 24 14:33:09 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 24 Jul 2006 14:35:06 +0100 (BST)
Received: from h155.mvista.com ([63.81.120.155]:11586 "EHLO imap.sh.mvista.com")
	by ftp.linux-mips.org with ESMTP id S8133932AbWGXNdJ (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 24 Jul 2006 14:33:09 +0100
Received: from [192.168.1.248] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id 1D3FA3ECD; Mon, 24 Jul 2006 06:32:44 -0700 (PDT)
Message-ID: <44C4CBB4.3030501@ru.mvista.com>
Date:	Mon, 24 Jul 2006 17:31:32 +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:	Daniel Mack <daniel@caiaq.de>
Cc:	giometti@linux.it, i2c@lm-sensors.org, linux-mips@linux-mips.org
Subject: Re: [PATCH] AU1100 I2C support
References: <20060719180204.GK25330@enneenne.com> <20060722091342.GA22158@ipxXXXXX> <20060722123243.GA4543@gundam.enneenne.com> <133FC0BA-B375-46D4-916E-773996425F57@caiaq.de>
In-Reply-To: <133FC0BA-B375-46D4-916E-773996425F57@caiaq.de>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12057
X-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.

Daniel Mack wrote:

>> On Sat, Jul 22, 2006 at 11:13:42AM +0200, Daniel Mack wrote:

>>> Is there any reason why it is limited to this very processor and
>>> should not work with all au1xxx types?

>> To be honest I don't know exacly... I don't know so well other
>> processors in this family. However I think at least au1000 and au1200
>> should be compatible.

> I think so, too. Since you only call the generic au_* functions for
> the GPIO access, all members of this processor family should be
> supported. I propose to change the patch accordingly.

    Actually, Au1550/1200 have dedicated SMBus contoller and an existing I2C 
driver for it, so there''s probably no need for another bit-banging driver for 
them.

> Daniel

WBR, Sergei

From hemanth.venkatesh@wipro.com Mon Jul 24 15:54:25 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 24 Jul 2006 15:54:34 +0100 (BST)
Received: from wip-ec-wd.wipro.com ([203.91.193.32]:25315 "EHLO
	wip-ec-wd.wipro.com") by ftp.linux-mips.org with ESMTP
	id S8133935AbWGXOyZ (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 24 Jul 2006 15:54:25 +0100
Received: from wip-ec-wd.wipro.com (localhost.wipro.com [127.0.0.1])
	by localhost (Postfix) with ESMTP id 5F751206C9
	for <linux-mips@linux-mips.org>; Mon, 24 Jul 2006 20:21:13 +0530 (IST)
Received: from blr-ec-bh02.wipro.com (blr-ec-bh02.wipro.com [10.201.50.92])
	by wip-ec-wd.wipro.com (Postfix) with ESMTP id 4759220650
	for <linux-mips@linux-mips.org>; Mon, 24 Jul 2006 20:21:13 +0530 (IST)
Received: from blr-m2-msg.wipro.com ([10.116.50.99]) by blr-ec-bh02.wipro.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Mon, 24 Jul 2006 20:24:13 +0530
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C6AF31.072375BC"
Subject: Multiple page size support for AU1xxx
Date:	Mon, 24 Jul 2006 20:24:13 +0530
Message-ID: <2156B1E923F1A147AABDF4D9FDEAB4CB09D650@blr-m2-msg.wipro.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Multiple page size support for AU1xxx
Thread-Index: AcavMDAwyRtxpL6mT2OQFFiCV25fYQ==
From:	<hemanth.venkatesh@wipro.com>
To:	<linux-mips@linux-mips.org>
X-OriginalArrivalTime: 24 Jul 2006 14:54:13.0642 (UTC) FILETIME=[073E4EA0:01C6AF31]
Return-Path: <hemanth.venkatesh@wipro.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: 12058
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: hemanth.venkatesh@wipro.com
Precedence: bulk
X-list: linux-mips

This is a multi-part message in MIME format.

------_=_NextPart_001_01C6AF31.072375BC
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Has anyone been able to configure and boot kernel with page sizes other
that 4kb i.e. 16KB and 64KB on any AU1xxx based boards.

=20

Thanks

Hemanth


------_=_NextPart_001_01C6AF31.072375BC
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

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

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Has anyone been able to configure and boot kernel =
with page
sizes other that 4kb i.e. 16KB and 64KB on any AU1xxx based =
boards.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Thanks<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Hemanth<o:p></o:p></span></font></p>

</div>

</body>

</html>

------_=_NextPart_001_01C6AF31.072375BC--

From wyb@topsec.com.cn Tue Jul 25 03:52:52 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 25 Jul 2006 03:53:01 +0100 (BST)
Received: from [202.99.27.194] ([202.99.27.194]:1752 "EHLO mail1.topsec.com.cn")
	by ftp.linux-mips.org with ESMTP id S8133966AbWGYCww (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 25 Jul 2006 03:52:52 +0100
Received: from codingman ([192.168.83.211])
	by mail1.topsec.com.cn (MOS 3.7.3a-GA)
	with ESMTP id ASF59444 (AUTH wyb);
	Tue, 25 Jul 2006 10:42:53 +0800 (CST)
Message-ID: <004001c6af95$14585900$0100000a@codingman>
From:	<wyb@topsec.com.cn>
To:	<macro@linux-mips.org>, <ralf@linux-mips.org>,
	<sskowron@ET.PUT.Poznan.PL>, <rsandifo@redhat.com>
Cc:	<linux-mips@linux-mips.org>
Subject: unmatched R_MIPS_HI16/LO16 on gcc 3.4.3
Date:	Tue, 25 Jul 2006 10:49:56 +0800
MIME-Version: 1.0
Content-Type: text/plain;
	charset="Windows-1252"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1807
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807
X-Junkmail-Whitelist: YES (by domain whitelist at mail1.topsec.com.cn)
Return-Path: <wyb@topsec.com.cn>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12059
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: wyb@topsec.com.cn
Precedence: bulk
X-list: linux-mips

Sorry for disturbing you.

I met similar problem as Stanislaw Skowronek, but for gcc 3.4.3. I created a
kernel module, when insmod, kernel reported "dangerous relocation". I traced
the bug, found unmatched R_MIPS_HI16/LO16 in module's elf file, and kernel
refused to relocate:
...
00015a5c  00039a05 R_MIPS_HI16       0000000c   tos_net_debug
00015a68  00000204 R_MIPS_26         00000000   .text
00015a64  00046005 R_MIPS_HI16       0006b598   arp_proxy_list
00015a6c  00046006 R_MIPS_LO16       0006b598   arp_proxy_list
...

My problem arised when expression on tos_net_debug could be optimized out,
it seemed like gcc optimized out the LO16, but left HI16.

The original discussion on similar problem is at
http://www.linux-mips.org/archives/linux-mips/2005-05/msg00097.html

thanks very much



From ralf@denk.linux-mips.net.redhat.com Tue Jul 25 04:44:42 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 25 Jul 2006 04:44:51 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:49575 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S8126515AbWGYDom (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 25 Jul 2006 04:44:42 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.7/8.13.4) with ESMTP id k6P3iRi4026104;
	Mon, 24 Jul 2006 23:44:28 -0400
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.7/8.13.7/Submit) id k6P3iOhg026103;
	Mon, 24 Jul 2006 23:44:24 -0400
Date:	Mon, 24 Jul 2006 23:44:24 -0400
From:	Ralf Baechle <ralf@linux-mips.org>
To:	wyb@topsec.com.cn
Cc:	macro@linux-mips.org, sskowron@ET.PUT.Poznan.PL.redhat.com,
	rsandifo@redhat.com, linux-mips@linux-mips.org
Subject: Re: unmatched R_MIPS_HI16/LO16 on gcc 3.4.3
Message-ID: <20060725034424.GB22138@linux-mips.org>
References: <004001c6af95$14585900$0100000a@codingman>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <004001c6af95$14585900$0100000a@codingman>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@denk.linux-mips.net.redhat.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: 12060
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Tue, Jul 25, 2006 at 10:49:56AM +0800, wyb@topsec.com.cn wrote:

> I met similar problem as Stanislaw Skowronek, but for gcc 3.4.3. I created a
> kernel module, when insmod, kernel reported "dangerous relocation". I traced
> the bug, found unmatched R_MIPS_HI16/LO16 in module's elf file, and kernel
> refused to relocate:
> ...
> 00015a5c  00039a05 R_MIPS_HI16       0000000c   tos_net_debug
> 00015a68  00000204 R_MIPS_26         00000000   .text
> 00015a64  00046005 R_MIPS_HI16       0006b598   arp_proxy_list
> 00015a6c  00046006 R_MIPS_LO16       0006b598   arp_proxy_list
> ...
> 
> My problem arised when expression on tos_net_debug could be optimized out,
> it seemed like gcc optimized out the LO16, but left HI16.
> 
> The original discussion on similar problem is at
> http://www.linux-mips.org/archives/linux-mips/2005-05/msg00097.html

Do you have a testcase, a kernel .config file to trigger this?

  Ralf

From ralf@denk.linux-mips.net.redhat.com Tue Jul 25 04:45:59 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 25 Jul 2006 04:46:08 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:58577 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S8126515AbWGYDp7 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 25 Jul 2006 04:45:59 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.7/8.13.4) with ESMTP id k6P3kJq9026153;
	Mon, 24 Jul 2006 23:46:20 -0400
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.7/8.13.7/Submit) id k6P3kJRt026152;
	Mon, 24 Jul 2006 23:46:19 -0400
Date:	Mon, 24 Jul 2006 23:46:19 -0400
From:	Ralf Baechle <ralf@linux-mips.org>
To:	hemanth.venkatesh@wipro.com.redhat.com
Cc:	linux-mips@linux-mips.org
Subject: Re: Multiple page size support for AU1xxx
Message-ID: <20060725034619.GA22617@linux-mips.org>
References: <2156B1E923F1A147AABDF4D9FDEAB4CB09D650@blr-m2-msg.wipro.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <2156B1E923F1A147AABDF4D9FDEAB4CB09D650@blr-m2-msg.wipro.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@denk.linux-mips.net.redhat.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: 12061
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Mon, Jul 24, 2006 at 08:24:13PM +0530, hemanth.venkatesh@wipro.com wrote:

> Has anyone been able to configure and boot kernel with page sizes other
> that 4kb i.e. 16KB and 64KB on any AU1xxx based boards.

Currently only 16kB works and only for 64-bit kernels.  I'm planning to
fix that rsn.

64K pagesize is extremly large for embedded systems of the size of the
typical Alchemy system due to the memory overhead.

  Ralf

From hemanth.venkatesh@wipro.com Tue Jul 25 11:06:53 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 25 Jul 2006 11:07:03 +0100 (BST)
Received: from wip-ec-wd.wipro.com ([203.91.193.32]:33995 "EHLO
	wip-ec-wd.wipro.com") by ftp.linux-mips.org with ESMTP
	id S8133435AbWGYKGx convert rfc822-to-8bit (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 25 Jul 2006 11:06:53 +0100
Received: from wip-ec-wd.wipro.com (localhost.wipro.com [127.0.0.1])
	by localhost (Postfix) with ESMTP id 98357205EF;
	Tue, 25 Jul 2006 15:33:44 +0530 (IST)
Received: from blr-ec-bh02.wipro.com (blr-ec-bh02.wipro.com [10.201.50.92])
	by wip-ec-wd.wipro.com (Postfix) with ESMTP id 6E1EE205E2;
	Tue, 25 Jul 2006 15:33:44 +0530 (IST)
Received: from blr-m2-msg.wipro.com ([10.116.50.99]) by blr-ec-bh02.wipro.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Tue, 25 Jul 2006 15:36:45 +0530
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 8BIT
Subject: RE: Multiple page size support for AU1xxx
Date:	Tue, 25 Jul 2006 15:36:33 +0530
Message-ID: <2156B1E923F1A147AABDF4D9FDEAB4CB09D6F3@blr-m2-msg.wipro.com>
In-Reply-To: <20060725034619.GA22617@linux-mips.org>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Multiple page size support for AU1xxx
Thread-Index: AcavnPb35TBFRvN5QpSkFe2jX1iUNwAMnsUQ
From:	<hemanth.venkatesh@wipro.com>
To:	<ralf@linux-mips.org>
Cc:	<linux-mips@linux-mips.org>
X-OriginalArrivalTime: 25 Jul 2006 10:06:45.0930 (UTC) FILETIME=[093810A0:01C6AFD2]
Return-Path: <hemanth.venkatesh@wipro.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: 12062
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: hemanth.venkatesh@wipro.com
Precedence: bulk
X-list: linux-mips

Hi Ralf,

>>Currently only 16kB works and only for 64-bit kernels.  I'm planning
to
>> fix that rsn.

Thanks for the info, did u mean 16KB would be supported for 32 bit
kernel also. I also saw code changes in arch/mips/mm/tlb-r8k.c only, is
there a plan to port it to r4k TLB also.


Help on 2.6.14 and 2.6.17 kernels provide the below info. Does it mean
some changes are required at user level also.

config PAGE_SIZE_16KB
        help
          Note that you will need a suitable Linux distribution to
support 
          this.
          There are also issues with compatibility of user applications

Thanks
Hemanth

  

From ths@networkno.de Tue Jul 25 12:09:04 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 25 Jul 2006 12:09:13 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:25995 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8133455AbWGYLJE (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 25 Jul 2006 12:09:04 +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 58EEF441A8; Tue, 25 Jul 2006 13:09:03 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1G5Km4-0003a5-TU; Tue, 25 Jul 2006 12:08:28 +0100
Date:	Tue, 25 Jul 2006 12:08:28 +0100
To:	hemanth.venkatesh@wipro.com
Cc:	ralf@linux-mips.org, linux-mips@linux-mips.org
Subject: Re: Multiple page size support for AU1xxx
Message-ID: <20060725110828.GD8401@networkno.de>
References: <20060725034619.GA22617@linux-mips.org> <2156B1E923F1A147AABDF4D9FDEAB4CB09D6F3@blr-m2-msg.wipro.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <2156B1E923F1A147AABDF4D9FDEAB4CB09D6F3@blr-m2-msg.wipro.com>
User-Agent: Mutt/1.5.12-2006-07-14
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: 12063
X-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

hemanth.venkatesh@wipro.com wrote:
> Hi Ralf,
> 
> >>Currently only 16kB works and only for 64-bit kernels.  I'm planning
> to
> >> fix that rsn.
> 
> Thanks for the info, did u mean 16KB would be supported for 32 bit
> kernel also. I also saw code changes in arch/mips/mm/tlb-r8k.c only, is
> there a plan to port it to r4k TLB also.
> 
> 
> Help on 2.6.14 and 2.6.17 kernels provide the below info. Does it mean
> some changes are required at user level also.

Old binutils (2.14 and earlier) didn't put enough alignment between code
and data section, it this case a re-link with a newer linker is needed.

Some userland applications hardcode a specific pagesize, typically 4kB,
instead of querying sysconf(_SC_PAGESIZE). Those applications will need
fixing.


Thiemo

From yoichi_yuasa@tripeaks.co.jp Tue Jul 25 15:26:57 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 25 Jul 2006 15:27:06 +0100 (BST)
Received: from mo32.po.2iij.net ([210.128.50.17]:25375 "EHLO mo32.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133797AbWGYO05 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 25 Jul 2006 15:26:57 +0100
Received: by mo.po.2iij.net (mo32) id k6PEQr8L072953; Tue, 25 Jul 2006 23:26:53 +0900 (JST)
Received: from localhost.localdomain (203.25.30.125.dy.iij4u.or.jp [125.30.25.203])
	by mbox.po.2iij.net (mbox32) id k6PEQplD057538
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Tue, 25 Jul 2006 23:26:52 +0900 (JST)
Date:	Tue, 25 Jul 2006 23:24:47 +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] update e55 defconfig
Message-Id: <20060725232447.3e2404b6.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: 12065
X-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 updated e55 defconfig.
Please apply.

Yoichi

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

diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/configs/e55_defconfig mips/arch/mips/configs/e55_defconfig
--- mips-orig/arch/mips/configs/e55_defconfig	2006-07-25 22:52:01.575229250 +0900
+++ mips/arch/mips/configs/e55_defconfig	2006-07-25 23:15:32.663416750 +0900
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18-rc1
-# Thu Jul  6 10:04:02 2006
+# Linux kernel version: 2.6.18-rc2
+# Tue Jul 25 23:15:03 2006
 #
 CONFIG_MIPS=y
 
@@ -227,7 +227,6 @@ CONFIG_MMU=y
 #
 # PCCARD (PCMCIA/CardBus) support
 #
-# CONFIG_PCCARD is not set
 
 #
 # PCI Hotplug Support
@@ -254,7 +253,6 @@ CONFIG_TRAD_SIGNALS=y
 #
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
-# CONFIG_FW_LOADER is not set
 # CONFIG_SYS_HYPERVISOR is not set
 
 #
@@ -284,6 +282,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_BLK_DEV_RAM=m
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 # CONFIG_BLK_DEV_INITRD is not set
 # CONFIG_CDROM_PKTCDVD is not set
 
@@ -643,6 +642,7 @@ CONFIG_MSDOS_PARTITION=y
 #
 # Kernel hacking
 #
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_UNUSED_SYMBOLS is not set
@@ -650,7 +650,7 @@ CONFIG_MSDOS_PARTITION=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_DEBUG_FS is not set
 CONFIG_CROSSCOMPILE=y
-CONFIG_CMDLINE="console=ttyVR0,19200 mem=8M"
+CONFIG_CMDLINE="console=ttyVR0,19200 ide0=0x1f0,0x3f6,40 mem=8M"
 
 #
 # Security options

From yoichi_yuasa@tripeaks.co.jp Tue Jul 25 15:27:34 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 25 Jul 2006 15:27:56 +0100 (BST)
Received: from mo30.po.2iij.net ([210.128.50.53]:57420 "EHLO mo30.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133810AbWGYO06 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 25 Jul 2006 15:26:58 +0100
Received: by mo.po.2iij.net (mo30) id k6PEQuao047018; Tue, 25 Jul 2006 23:26:56 +0900 (JST)
Received: from localhost.localdomain (203.25.30.125.dy.iij4u.or.jp [125.30.25.203])
	by mbox.po.2iij.net (mbox32) id k6PEQspX057558
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Tue, 25 Jul 2006 23:26:55 +0900 (JST)
Date:	Tue, 25 Jul 2006 23:26:09 +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] update mpc30x defconfig
Message-Id: <20060725232609.2021c28f.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: 12066
X-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 updated mpc30x defconfig.
Please apply.

Yoichi

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

diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/configs/mpc30x_defconfig mips/arch/mips/configs/mpc30x_defconfig
--- mips-orig/arch/mips/configs/mpc30x_defconfig	2006-07-25 22:52:01.579229500 +0900
+++ mips/arch/mips/configs/mpc30x_defconfig	2006-07-25 23:17:09.261453750 +0900
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18-rc1
-# Thu Jul  6 10:04:15 2006
+# Linux kernel version: 2.6.18-rc2
+# Tue Jul 25 23:16:46 2006
 #
 CONFIG_MIPS=y
 
@@ -71,7 +71,6 @@ CONFIG_MACH_VR41XX=y
 CONFIG_VICTOR_MPC30X=y
 # CONFIG_ZAO_CAPCELLA is not set
 CONFIG_PCI_VR41XX=y
-CONFIG_VRC4173=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
@@ -168,6 +167,7 @@ CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
@@ -841,7 +841,7 @@ CONFIG_USB_PEGASUS=m
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
 # CONFIG_USB_LED is not set
-# CONFIG_USB_CY7C63 is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
 # CONFIG_USB_PHIDGETKIT is not set
 # CONFIG_USB_PHIDGETSERVO is not set
@@ -982,7 +982,6 @@ CONFIG_SUNRPC=y
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
-# CONFIG_CIFS_DEBUG2 is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
@@ -1007,6 +1006,7 @@ CONFIG_MSDOS_PARTITION=y
 #
 # Kernel hacking
 #
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_UNUSED_SYMBOLS is not set
@@ -1014,7 +1014,7 @@ CONFIG_MSDOS_PARTITION=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_DEBUG_FS is not set
 CONFIG_CROSSCOMPILE=y
-CONFIG_CMDLINE="mem=32M console=ttyVR0,19200"
+CONFIG_CMDLINE="mem=32M console=ttyVR0,19200 ide0=0x170,0x376,73"
 
 #
 # Security options

From yoichi_yuasa@tripeaks.co.jp Tue Jul 25 15:28:25 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 25 Jul 2006 15:28:46 +0100 (BST)
Received: from mo30.po.2iij.net ([210.128.50.53]:36933 "EHLO mo30.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133933AbWGYO07 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 25 Jul 2006 15:26:59 +0100
Received: by mo.po.2iij.net (mo30) id k6PEQvWV047028; Tue, 25 Jul 2006 23:26:57 +0900 (JST)
Received: from localhost.localdomain (203.25.30.125.dy.iij4u.or.jp [125.30.25.203])
	by mbox.po.2iij.net (mbox32) id k6PEQr8R057544
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Tue, 25 Jul 2006 23:26:53 +0900 (JST)
Date:	Tue, 25 Jul 2006 23:24:54 +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] update workpad defconfig
Message-Id: <20060725232454.70d5f078.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: 12067
X-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 updated workpad defconfig.
Please apply.

Yoichi

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

diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/configs/workpad_defconfig mips/arch/mips/configs/workpad_defconfig
--- mips-orig/arch/mips/configs/workpad_defconfig	2006-07-25 22:52:01.587230000 +0900
+++ mips/arch/mips/configs/workpad_defconfig	2006-07-25 23:13:22.855304250 +0900
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18-rc1
-# Thu Jul  6 10:04:21 2006
+# Linux kernel version: 2.6.18-rc2
+# Tue Jul 25 23:13:04 2006
 #
 CONFIG_MIPS=y
 
@@ -166,6 +166,7 @@ CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
@@ -379,6 +380,7 @@ CONFIG_CONNECTOR=m
 CONFIG_BLK_DEV_RAM=m
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 # CONFIG_BLK_DEV_INITRD is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
@@ -855,7 +857,6 @@ CONFIG_SUNRPC=y
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
-# CONFIG_CIFS_DEBUG2 is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
@@ -880,6 +881,7 @@ CONFIG_MSDOS_PARTITION=y
 #
 # Kernel hacking
 #
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_UNUSED_SYMBOLS is not set
@@ -887,7 +889,7 @@ CONFIG_MSDOS_PARTITION=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_DEBUG_FS is not set
 CONFIG_CROSSCOMPILE=y
-CONFIG_CMDLINE="console=ttyVR0,19200 mem=16M"
+CONFIG_CMDLINE="console=ttyVR0,19200 ide0=0x170,0x376,49 mem=16M"
 
 #
 # Security options

From anemo@mba.ocn.ne.jp Tue Jul 25 15:50:14 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 25 Jul 2006 15:50:28 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:34800 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133455AbWGYOuO (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 25 Jul 2006 15:50:14 +0100
Received: from localhost (p6003-ipad211funabasi.chiba.ocn.ne.jp [58.91.162.3])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 05359881E; Tue, 25 Jul 2006 23:50:07 +0900 (JST)
Date:	Tue, 25 Jul 2006 23:51:36 +0900 (JST)
Message-Id: <20060725.235136.92587083.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] rearrange show_stack, show_trace 
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: 12068
X-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

Print call-trace in show_stack() (as like as other archs).
Also make show_trace() static and simplify its argument list.

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

diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 368fdb7..c6f7046 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -79,6 +79,25 @@ void (*board_bind_eic_interrupt)(int irq
  */
 #define MODULE_RANGE (8*1024*1024)
 
+static void show_trace(unsigned long *stack)
+{
+	const int field = 2 * sizeof(unsigned long);
+	unsigned long addr;
+
+	printk("Call Trace:");
+#ifdef CONFIG_KALLSYMS
+	printk("\n");
+#endif
+	while (!kstack_end(stack)) {
+		addr = *stack++;
+		if (__kernel_text_address(addr)) {
+			printk(" [<%0*lx>] ", field, addr);
+			print_symbol("%s\n", addr);
+		}
+	}
+	printk("\n");
+}
+
 /*
  * This routine abuses get_user()/put_user() to reference pointers
  * with at least a bit of error checking ...
@@ -88,6 +107,7 @@ void show_stack(struct task_struct *task
 	const int field = 2 * sizeof(unsigned long);
 	long stackdata;
 	int i;
+	unsigned long *stack;
 
 	if (!sp) {
 		if (task && task != current)
@@ -95,6 +115,7 @@ void show_stack(struct task_struct *task
 		else
 			sp = (unsigned long *) &sp;
 	}
+	stack = sp;
 
 	printk("Stack :");
 	i = 0;
@@ -115,32 +136,7 @@ void show_stack(struct task_struct *task
 		i++;
 	}
 	printk("\n");
-}
-
-void show_trace(struct task_struct *task, unsigned long *stack)
-{
-	const int field = 2 * sizeof(unsigned long);
-	unsigned long addr;
-
-	if (!stack) {
-		if (task && task != current)
-			stack = (unsigned long *) task->thread.reg29;
-		else
-			stack = (unsigned long *) &stack;
-	}
-
-	printk("Call Trace:");
-#ifdef CONFIG_KALLSYMS
-	printk("\n");
-#endif
-	while (!kstack_end(stack)) {
-		addr = *stack++;
-		if (__kernel_text_address(addr)) {
-			printk(" [<%0*lx>] ", field, addr);
-			print_symbol("%s\n", addr);
-		}
-	}
-	printk("\n");
+	show_trace(stack);
 }
 
 /*
@@ -150,7 +146,7 @@ void dump_stack(void)
 {
 	unsigned long stack;
 
-	show_trace(current, &stack);
+	show_trace(&stack);
 }
 
 EXPORT_SYMBOL(dump_stack);
@@ -270,7 +266,6 @@ void show_registers(struct pt_regs *regs
 	printk("Process %s (pid: %d, threadinfo=%p, task=%p)\n",
 	        current->comm, current->pid, current_thread_info(), current);
 	show_stack(current, (long *) regs->regs[29]);
-	show_trace(current, (long *) regs->regs[29]);
 	show_code((unsigned int *) regs->cp0_epc);
 	printk("\n");
 }

From jurgen.parmentier@telenet.be Tue Jul 25 19:34:42 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 25 Jul 2006 19:34:53 +0100 (BST)
Received: from asia.telenet-ops.be ([195.130.137.74]:28848 "EHLO
	asia.telenet-ops.be") by ftp.linux-mips.org with ESMTP
	id S8133966AbWGYSem (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 25 Jul 2006 19:34:42 +0100
Received: from localhost (localhost.localdomain [127.0.0.1])
	by asia.telenet-ops.be (Postfix) with SMTP id A44B8D418D;
	Tue, 25 Jul 2006 20:34:36 +0200 (CEST)
Received: from [192.168.1.4] (d54C48E70.access.telenet.be [84.196.142.112])
	by asia.telenet-ops.be (Postfix) with ESMTP id 20CAED4184;
	Tue, 25 Jul 2006 20:34:35 +0200 (CEST)
Message-ID: <44C66437.9030402@telenet.be>
Date:	Tue, 25 Jul 2006 20:34:31 +0200
From:	Jurgen <jurgen.parmentier@telenet.be>
User-Agent: Thunderbird 1.5.0.4 (X11/20060615)
MIME-Version: 1.0
To:	Thomas Gleixner <tglx@linutronix.de>
Cc:	"Vladimir A. Barinov" <vbarinov@ru.mvista.com>,
	Todd Poynor <tpoynor@mvista.com>,
	linux-mtd@lists.infradead.org, linux-mips@linux-mips.org
Subject: Re: [PATCH] PNX8550 NAND flash driver
References: <43A2F819.1040106@ru.mvista.com> <43C69EC2.2070601@mvista.com>	 <43F1D439.60205@ru.mvista.com> <1152525196.30929.11.camel@localhost>
In-Reply-To: <1152525196.30929.11.camel@localhost>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <jurgen.parmentier@telenet.be>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12069
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: jurgen.parmentier@telenet.be
Precedence: bulk
X-list: linux-mips

Thomas Gleixner schreef:
> On Tue, 2006-02-14 at 15:59 +0300, Vladimir A. Barinov wrote:
>   
>>>> +    }
>>>> +
>>>> +    if (((bytes & 3) || (bytes < 16)) || ((u32) to & 3) || ((u32) 
>>>> from & 3)) {
>>>> +        if (((bytes & 1) == 0) &&
>>>> +            (((u32) to & 1) == 0) && (((u32) from & 1) == 0)) {
>>>> +            int words = bytes / 2;
>>>> +
>>>> +            local_irq_disable();
>>>> +            for (i = 0; i < words; i++) {
>>>> +                to16[i] = from16[i];
>>>> +            }
>>>> +            local_irq_enable();
>>>>         
>>> Really necessary to disable all irqs around this transfer?  How long 
>>> can interrupts be off during that time?
>>>       
>> That is needed since the NAND device is binded to the external XIO bus 
>> that could be used by another devices.
>>     
>
> Err, you have to protect the whole access sequence then. What protects
> the chip against access between the command write and data read ?
>
> If this really is a bus conflict problem, then you need some more
> protection than this.
>
> Can you please describe in detail why you think this is necessary. 
>
> 	tglx
>
>
>
>
>
>
>
>   
Root cause of the problem lies within the early implementation of the 
low-level NAND commands. There was a severe risk that the PCI accesses 
were stalled because of a Read Status command for the NAND Flash. This 
Read Status was launched immediately after program/erase command. The 
hardware itself will wait for the Ready/Busy to be high and only then 
launch the Read Status command. This behavior caused timeout on the 
internal bus because PCI was unable to use the pins during this wait.

If this problem was coinciding with an ISR that tried to perform a PCI 
status register, then this PCI access could possibly timeout (because 
the PCI pins were already claimed for the XIO access that is depending 
on the RBY signal).

Since the problem only showed during the PCI device ISR, the 
quick'n'dirty hack was to disable interrupts during XIO accesses.

A better fix that should be available somewhere, is to improve the 
low-level NAND driver that will first check the status of the Ready/Busy 
line and only THEN launch the Read NAND Status command...

Jurgen

From ashlesha@kenati.com Wed Jul 26 01:09:37 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Jul 2006 01:09:50 +0100 (BST)
Received: from [69.90.147.196] ([69.90.147.196]:42678 "EHLO mail.kenati.com")
	by ftp.linux-mips.org with ESMTP id S8133989AbWGZAJh (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Jul 2006 01:09:37 +0100
Received: from [192.168.1.105] (adsl-71-130-109-177.dsl.snfc21.pacbell.net [71.130.109.177])
	by mail.kenati.com (Postfix) with ESMTP id AD114E4052
	for <linux-mips@linux-mips.org>; Tue, 25 Jul 2006 17:24:11 -0700 (PDT)
Subject: YAMON: go
From:	Ashlesha Shintre <ashlesha@kenati.com>
Reply-To: ashlesha@kenati.com
To:	linux-mips@linux-mips.org
Content-Type: text/plain
Date:	Tue, 25 Jul 2006 17:14:22 -0700
Message-Id: <1153872862.6478.7.camel@sandbar.kenati.com>
Mime-Version: 1.0
X-Mailer: Evolution 2.4.2.1 
Content-Transfer-Encoding: 7bit
Return-Path: <ashlesha@kenati.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: 12070
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ashlesha@kenati.com
Precedence: bulk
X-list: linux-mips

Hi,

I compiled an 2.6 kernel for the db1500 board and used the load command
in YAMON to write the srec image to the RAM using tftp.  Now I want to
start the kernel and so I issued the go command.  It gives me the
following error:

* Exception (user) : Reserved instruction *

CAUSE    = 0x00808028  STATUS   = 0x00000002
EPC      = 0x80404004  ERROREPC = 0x00000000
BADVADDR = 0x00000000

Also another query is this: How does one know whether the load command
has written to the RAM or the Flash?  The help load says that this
depends on the address.  However, upon issuing the load command without
any options, YAMON outputs the following as the location of the load:

Start = 0x80404000, range = (0x80100000,0x80423084), format = SREC

Thanks & Regards,

Ashlesha Shintre.
Intern
Kenati Technologies
800W California Ave.
Sunnyvale, CA


From ppopov@embeddedalley.com Wed Jul 26 01:20:34 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Jul 2006 01:20:47 +0100 (BST)
Received: from smtp107.biz.mail.mud.yahoo.com ([68.142.200.255]:38768 "HELO
	smtp107.biz.mail.mud.yahoo.com") by ftp.linux-mips.org with SMTP
	id S8133987AbWGZAUe (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 26 Jul 2006 01:20:34 +0100
Received: (qmail 13761 invoked from network); 26 Jul 2006 00:20:23 -0000
Received: from unknown (HELO ?192.168.1.107?) (ppopov@embeddedalley.com@71.128.175.242 with plain)
  by smtp107.biz.mail.mud.yahoo.com with SMTP; 26 Jul 2006 00:20:22 -0000
Subject: Re: YAMON: go
From:	Pete Popov <ppopov@embeddedalley.com>
Reply-To: ppopov@embeddedalley.com
To:	ashlesha@kenati.com
Cc:	linux-mips@linux-mips.org
In-Reply-To: <1153872862.6478.7.camel@sandbar.kenati.com>
References: <1153872862.6478.7.camel@sandbar.kenati.com>
Content-Type: text/plain
Organization: Embedded Alley Solutions, Inc
Date:	Tue, 25 Jul 2006 17:20:06 -0700
Message-Id: <1153873206.1824.59.camel@localhost.localdomain>
Mime-Version: 1.0
X-Mailer: Evolution 2.4.1 
Content-Transfer-Encoding: 7bit
Return-Path: <ppopov@embeddedalley.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12071
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ppopov@embeddedalley.com
Precedence: bulk
X-list: linux-mips

On Tue, 2006-07-25 at 17:14 -0700, Ashlesha Shintre wrote:
> Hi,
> 
> I compiled an 2.6 kernel for the db1500 board and used the load command
> in YAMON to write the srec image to the RAM using tftp.  Now I want to
> start the kernel and so I issued the go command.  It gives me the
> following error:
> 
> * Exception (user) : Reserved instruction *
> 
> CAUSE    = 0x00808028  STATUS   = 0x00000002
> EPC      = 0x80404004  ERROREPC = 0x00000000
> BADVADDR = 0x00000000

> Also another query is this: How does one know whether the load command
> has written to the RAM or the Flash?  The help load says that this
> depends on the address.  However, upon issuing the load command without
> any options, YAMON outputs the following as the location of the load:
> 
> Start = 0x80404000, range = (0x80100000,0x80423084), format = SREC

... which is a ram address.  SRECs have the load address embedded in
them and the kernel is linked to run from ram.

Are you sure the jumpers on the board are setup to match the kernel
endianness you have compiled? Looks like your kernel crashed pretty
quickly.

Pete


From craigslist@willmert.com Wed Jul 26 01:22:23 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Jul 2006 01:22:38 +0100 (BST)
Received: from imf19aec.mail.bellsouth.net ([205.152.59.67]:59205 "EHLO
	imf19aec.mail.bellsouth.net") by ftp.linux-mips.org with ESMTP
	id S8133994AbWGZAWC (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 26 Jul 2006 01:22:02 +0100
Received: from ibm60aec.bellsouth.net ([74.236.202.48])
          by imf19aec.mail.bellsouth.net with ESMTP
          id <20060726002120.BIUM21715.imf19aec.mail.bellsouth.net@ibm60aec.bellsouth.net>
          for <linux-mips@linux-mips.org>; Tue, 25 Jul 2006 20:21:20 -0400
Received: from [192.168.1.96] (really [74.236.202.48])
          by ibm60aec.bellsouth.net with ESMTP
          id <20060726002120.EOCM16573.ibm60aec.bellsouth.net@[192.168.1.96]>
          for <linux-mips@linux-mips.org>; Tue, 25 Jul 2006 20:21:20 -0400
Mime-Version: 1.0 (Apple Message framework v752.2)
In-Reply-To: <1153872862.6478.7.camel@sandbar.kenati.com>
References: <1153872862.6478.7.camel@sandbar.kenati.com>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
Message-Id: <68A51BFC-20AC-4D7A-9B07-CC40EC49C22A@willmert.com>
Content-Transfer-Encoding: 7bit
From:	craigslist <craigslist@willmert.com>
Subject: Re: YAMON: go
Date:	Tue, 25 Jul 2006 20:21:13 -0400
To:	linux-mips@linux-mips.org
X-Mailer: Apple Mail (2.752.2)
Return-Path: <craigslist@willmert.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: 12072
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: craigslist@willmert.com
Precedence: bulk
X-list: linux-mips


On Jul 25, 2006, at 8:14 PM, Ashlesha Shintre wrote:

> Hi,
>
> I compiled an 2.6 kernel for the db1500 board and used the load  
> command
> in YAMON to write the srec image to the RAM using tftp.  Now I want to
> start the kernel and so I issued the go command.  It gives me the
> following error:
>
> * Exception (user) : Reserved instruction *
>
> CAUSE    = 0x00808028  STATUS   = 0x00000002
> EPC      = 0x80404004  ERROREPC = 0x00000000
> BADVADDR = 0x00000000

I think the command should be
	go .

the period tells it to use the start address from the last "load"  
command.

>
> Also another query is this: How does one know whether the load command
> has written to the RAM or the Flash?

The address the srec file is loaded to is dependent upon the address  
used when building the srec file. I believe it defaults to ram  
memory. I use the --adjust-vma option with objcopy to adjust the  
address to a flash memory location. Yamon will put that in flash if  
the address parameter is correct.

> The help load says that this
> depends on the address.  However, upon issuing the load command  
> without
> any options, YAMON outputs the following as the location of the load:
>
> Start = 0x80404000, range = (0x80100000,0x80423084), format = SREC
>
> Thanks & Regards,
>
> Ashlesha Shintre.
> Intern
> Kenati Technologies
> 800W California Ave.
> Sunnyvale, CA
>
>


From Kenneth.Reese@caviumnetworks.com Wed Jul 26 01:32:50 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Jul 2006 01:33:01 +0100 (BST)
Received: from smtp2.caviumnetworks.com ([209.113.159.134]:33048 "EHLO
	smtp2.caviumnetworks.com") by ftp.linux-mips.org with ESMTP
	id S8134012AbWGZAcu (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 26 Jul 2006 01:32:50 +0100
Received: from exch4.caveonetworks.com (Not Verified[192.168.16.23]) by smtp2.caviumnetworks.com with NetIQ MailMarshal (v6,0,3,8)
	id <B44c6b8230000>; Tue, 25 Jul 2006 20:32:35 -0400
Received: from [192.168.16.29] ([64.169.86.201]) by exch4.caveonetworks.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.1830);
	 Tue, 25 Jul 2006 17:32:43 -0700
Message-ID: <44C6B829.8050508@caviumnetworks.com>
Date:	Tue, 25 Jul 2006 17:32:41 -0700
From:	Chad Reese <creese@caviumnetworks.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.8) Gecko/20060629 Debian/1.7.8-1sarge7.1
X-Accept-Language: en
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: 64bit kernel/N32 userspace - shmctl corrupts userspace memory
Content-Type: multipart/mixed;
 boundary="------------020004060209090703030702"
X-OriginalArrivalTime: 26 Jul 2006 00:32:43.0171 (UTC) FILETIME=[0225DF30:01C6B04B]
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: 12073
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: creese@caviumnetworks.com
Precedence: bulk
X-list: linux-mips

This is a multi-part message in MIME format.
--------------020004060209090703030702
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

If you're running a 64bit kernel with N32 userspace, shmctl will corrupt
memory in userspace. When copy_shmid_to_user() is called, it copies the
entire kernel shmid_ds into userspace. For a 64bit kernel, this is 88
bytes. In N32 userspace it is 76 bytes.

My hack to get around the problem is attached, but I expect someone here
will be able to come up with a better fix. shmid_ds contains a lot of
members that are marked unused. Are these really useless?

Chad


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

Index: linux/ipc/shm.c
===================================================================
RCS file: /repository/octsw/linux/kernel_2.6/linux/ipc/shm.c,v
retrieving revision 1.1.1.6
retrieving revision 1.2
diff -u -r1.1.1.6 -r1.2
--- linux/ipc/shm.c	7 Jun 2006 19:19:51 -0000	1.1.1.6
+++ linux/ipc/shm.c	22 Jul 2006 02:26:11 -0000	1.2
@@ -321,7 +321,11 @@
 		out.shm_lpid	= in->shm_lpid;
 		out.shm_nattch	= in->shm_nattch;
 
-		return copy_to_user(buf, &out, sizeof(out));
+		/* Use offsetof() instead of sizeof() since N32 userspace has a 
+		    different size including the unused fields. This just copies 
+		    what is used. The old method would corrupt data after the 
+		    structure */
+		return copy_to_user(buf, &out, offsetof(struct shmid_ds, shm_unused2));
 	    }
 	default:
 		return -EINVAL;

--------------020004060209090703030702--

From ralf@denk.linux-mips.net.redhat.com Wed Jul 26 03:05:35 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Jul 2006 03:05:51 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:62852 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S8133936AbWGZCFf (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Jul 2006 03:05:35 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.7/8.13.4) with ESMTP id k6Q24WKj025868;
	Tue, 25 Jul 2006 22:04:32 -0400
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.7/8.13.7/Submit) id k6Q24Rb8025867;
	Tue, 25 Jul 2006 22:04:27 -0400
Date:	Tue, 25 Jul 2006 22:04:27 -0400
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Chad Reese <creese@caviumnetworks.com.redhat.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: 64bit kernel/N32 userspace - shmctl corrupts userspace memory
Message-ID: <20060726020427.GA21024@linux-mips.org>
References: <44C6B829.8050508@caviumnetworks.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <44C6B829.8050508@caviumnetworks.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@denk.linux-mips.net.redhat.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: 12074
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Tue, Jul 25, 2006 at 05:32:41PM -0700, Chad Reese wrote:

> If you're running a 64bit kernel with N32 userspace, shmctl will corrupt
> memory in userspace. When copy_shmid_to_user() is called, it copies the
> entire kernel shmid_ds into userspace. For a 64bit kernel, this is 88
> bytes. In N32 userspace it is 76 bytes.
> 
> My hack to get around the problem is attached, but I expect someone here
> will be able to come up with a better fix. shmid_ds contains a lot of
> members that are marked unused. Are these really useless?

Can you try below patch?

  Ralf

diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index 98abbc5..605d393 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -150,7 +150,7 @@ EXPORT(sysn32_call_table)
 	PTR	sys_madvise
 	PTR	sys_shmget
 	PTR	sys32_shmat
-	PTR	sys_shmctl			/* 6030 */
+	PTR	compat_sys_shmctl		/* 6030 */
 	PTR	sys_dup
 	PTR	sys_dup2
 	PTR	sys_pause

From ralf@denk.linux-mips.net.redhat.com Wed Jul 26 03:07:29 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Jul 2006 03:07:38 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:57321 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S8133856AbWGZCH3 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Jul 2006 03:07:29 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.7/8.13.4) with ESMTP id k6Q27KHV025914;
	Tue, 25 Jul 2006 22:07:20 -0400
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.7/8.13.7/Submit) id k6Q27KDc025913;
	Tue, 25 Jul 2006 22:07:20 -0400
Date:	Tue, 25 Jul 2006 22:07:20 -0400
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Chad Reese <creese@caviumnetworks.com.redhat.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: 64bit kernel/N32 userspace - shmctl corrupts userspace memory
Message-ID: <20060726020720.GB21024@linux-mips.org>
References: <44C6B829.8050508@caviumnetworks.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <44C6B829.8050508@caviumnetworks.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@denk.linux-mips.net.redhat.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: 12075
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Tue, Jul 25, 2006 at 05:32:41PM -0700, Chad Reese wrote:

> If you're running a 64bit kernel with N32 userspace, shmctl will corrupt
> memory in userspace. When copy_shmid_to_user() is called, it copies the
> entire kernel shmid_ds into userspace. For a 64bit kernel, this is 88
> bytes. In N32 userspace it is 76 bytes.
> 
> My hack to get around the problem is attached, but I expect someone here
> will be able to come up with a better fix. shmid_ds contains a lot of
> members that are marked unused. Are these really useless?

They need to be there for compatibility with older revisions of the
structure - we can increase the size of the structure but not decrease.

Talking about compatibility, you change breaks N64 compatibility ...

  Ralf

From Kenneth.Reese@caviumnetworks.com Wed Jul 26 03:30:53 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Jul 2006 03:31:03 +0100 (BST)
Received: from smtp2.caviumnetworks.com ([209.113.159.134]:49947 "EHLO
	smtp2.caviumnetworks.com") by ftp.linux-mips.org with ESMTP
	id S8133936AbWGZCax (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 26 Jul 2006 03:30:53 +0100
Received: from exch4.caveonetworks.com (Not Verified[192.168.16.23]) by smtp2.caviumnetworks.com with NetIQ MailMarshal (v6,0,3,8)
	id <B44c6d3ce0000>; Tue, 25 Jul 2006 22:30:38 -0400
Received: from [192.168.16.29] ([64.169.86.201]) by exch4.caveonetworks.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.1830);
	 Tue, 25 Jul 2006 19:30:46 -0700
Message-ID: <44C6D3D5.9080409@caviumnetworks.com>
Date:	Tue, 25 Jul 2006 19:30:45 -0700
From:	Chad Reese <creese@caviumnetworks.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.8) Gecko/20060629 Debian/1.7.8-1sarge7.1
X-Accept-Language: en
MIME-Version: 1.0
To:	Ralf Baechle <ralf@linux-mips.org>
CC:	linux-mips@linux-mips.org
Subject: Re: 64bit kernel/N32 userspace - shmctl corrupts userspace memory
References: <44C6B829.8050508@caviumnetworks.com> <20060726020427.GA21024@linux-mips.org>
In-Reply-To: <20060726020427.GA21024@linux-mips.org>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 26 Jul 2006 02:30:46.0189 (UTC) FILETIME=[7FF4A5D0:01C6B05B]
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: 12076
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: creese@caviumnetworks.com
Precedence: bulk
X-list: linux-mips

compat.c is only included if CONFIG_SYSVIPC_COMPAT is defined. This
isn't anywhere in 2.6.16.26. Is this what you're refering to?

Chad

Ralf Baechle wrote:
> On Tue, Jul 25, 2006 at 05:32:41PM -0700, Chad Reese wrote:
> 
> 
>>If you're running a 64bit kernel with N32 userspace, shmctl will corrupt
>>memory in userspace. When copy_shmid_to_user() is called, it copies the
>>entire kernel shmid_ds into userspace. For a 64bit kernel, this is 88
>>bytes. In N32 userspace it is 76 bytes.
>>
>>My hack to get around the problem is attached, but I expect someone here
>>will be able to come up with a better fix. shmid_ds contains a lot of
>>members that are marked unused. Are these really useless?
> 
> 
> Can you try below patch?
> 
>   Ralf
> 
> diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
> index 98abbc5..605d393 100644
> --- a/arch/mips/kernel/scall64-n32.S
> +++ b/arch/mips/kernel/scall64-n32.S
> @@ -150,7 +150,7 @@ EXPORT(sysn32_call_table)
>  	PTR	sys_madvise
>  	PTR	sys_shmget
>  	PTR	sys32_shmat
> -	PTR	sys_shmctl			/* 6030 */
> +	PTR	compat_sys_shmctl		/* 6030 */
>  	PTR	sys_dup
>  	PTR	sys_dup2
>  	PTR	sys_pause
> 

-- 

Chad Reese <kreese@caviumnetworks.com>
Cavium Networks
Phone: 650 - 623 - 7038
Cell: 321 - 438 - 7753


From anemo@mba.ocn.ne.jp Wed Jul 26 04:13:11 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Jul 2006 04:13:21 +0100 (BST)
Received: from topsns2.toshiba-tops.co.jp ([202.230.225.126]:14442 "EHLO
	topsns2.toshiba-tops.co.jp") by ftp.linux-mips.org with ESMTP
	id S8126537AbWGZDNL (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 26 Jul 2006 04:13:11 +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, 26 Jul 2006 12:13:09 +0900
Received: from topsms.toshiba-tops.co.jp (localhost.localdomain [127.0.0.1])
	by localhost.toshiba-tops.co.jp (Postfix) with ESMTP id E38FF20454;
	Wed, 26 Jul 2006 12:13:02 +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 D8B2D202E8;
	Wed, 26 Jul 2006 12:13:02 +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 k6Q3D2W0087701;
	Wed, 26 Jul 2006 12:13:02 +0900 (JST)
	(envelope-from anemo@mba.ocn.ne.jp)
Date:	Wed, 26 Jul 2006 12:13:02 +0900 (JST)
Message-Id: <20060726.121302.75185183.nemoto@toshiba-tops.co.jp>
To:	creese@caviumnetworks.com
Cc:	ralf@linux-mips.org, linux-mips@linux-mips.org
Subject: Re: 64bit kernel/N32 userspace - shmctl corrupts userspace memory
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <44C6D3D5.9080409@caviumnetworks.com>
References: <44C6B829.8050508@caviumnetworks.com>
	<20060726020427.GA21024@linux-mips.org>
	<44C6D3D5.9080409@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: 12077
X-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, 25 Jul 2006 19:30:45 -0700, Chad Reese <creese@caviumnetworks.com> wrote:
> compat.c is only included if CONFIG_SYSVIPC_COMPAT is defined. This
> isn't anywhere in 2.6.16.26. Is this what you're refering to?

You can add this to arch/mips/Kconfig:

config SYSVIPC_COMPAT
	bool
	depends on COMPAT && SYSVIPC
	default y

BTW, it seems many SYSVIPC functions in arch/mips/kernel/linux32.c can
be replaced by this common code.

---
Atsushi Nemoto

From tglx@linutronix.de Wed Jul 26 07:58:46 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Jul 2006 07:59:04 +0100 (BST)
Received: from www.osadl.org ([213.239.205.134]:38376 "EHLO mail.tglx.de")
	by ftp.linux-mips.org with ESMTP id S8133516AbWGZG6p (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Jul 2006 07:58:45 +0100
Received: from hermes.tec.linutronix.de (unknown [192.168.0.1])
	by mail.tglx.de (Postfix) with ESMTP id 8BA9665C003;
	Wed, 26 Jul 2006 08:58:44 +0200 (CEST)
Received: from tglx.tec.linutronix.de (tglx.tec.linutronix.de [192.168.0.68])
	by hermes.tec.linutronix.de (Postfix) with ESMTP id EDA9668034;
	Wed, 26 Jul 2006 08:58:42 +0200 (CEST)
Subject: Re: [PATCH] PNX8550 NAND flash driver
From:	Thomas Gleixner <tglx@linutronix.de>
Reply-To: tglx@linutronix.de
To:	Jurgen <jurgen.parmentier@telenet.be>
Cc:	linux-mtd@lists.infradead.org,
	"Vladimir A. Barinov" <vbarinov@ru.mvista.com>,
	Todd Poynor <tpoynor@mvista.com>, linux-mips@linux-mips.org
In-Reply-To: <44C66437.9030402@telenet.be>
References: <43A2F819.1040106@ru.mvista.com> <43C69EC2.2070601@mvista.com>
	 <43F1D439.60205@ru.mvista.com> <1152525196.30929.11.camel@localhost>
	 <44C66437.9030402@telenet.be>
Content-Type: text/plain
Date:	Wed, 26 Jul 2006 09:02:53 +0200
Message-Id: <1153897373.26845.77.camel@localhost.localdomain>
Mime-Version: 1.0
X-Mailer: Evolution 2.6.1 
Content-Transfer-Encoding: 7bit
Return-Path: <tglx@linutronix.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: 12078
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: tglx@linutronix.de
Precedence: bulk
X-list: linux-mips

On Tue, 2006-07-25 at 20:34 +0200, Jurgen wrote:
> Root cause of the problem lies within the early implementation of the 
> low-level NAND commands. There was a severe risk that the PCI accesses 
> were stalled because of a Read Status command for the NAND Flash. This 
> Read Status was launched immediately after program/erase command. The 
> hardware itself will wait for the Ready/Busy to be high and only then 
> launch the Read Status command. This behavior caused timeout on the 
> internal bus because PCI was unable to use the pins during this wait.

The hardware design is broken. Status Read can be requested while R/B is
low. See NAND datasheets.

> If this problem was coinciding with an ISR that tried to perform a PCI 
> status register, then this PCI access could possibly timeout (because 
> the PCI pins were already claimed for the XIO access that is depending 
> on the RBY signal).
> 
> Since the problem only showed during the PCI device ISR, the 
> quick'n'dirty hack was to disable interrupts during XIO accesses.
> 
> A better fix that should be available somewhere, is to improve the 
> low-level NAND driver that will first check the status of the Ready/Busy 
> line and only THEN launch the Read NAND Status command...

Thats not an improvement. Thats a hack for your broken hardware. You'd
burden the R/B check on every sane hardware out there.

You can add the R/B check to the chip->cmd_ctrl() function of your board
driver.

	tglx



From florian.fainelli@int-evry.fr Wed Jul 26 09:38:05 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Jul 2006 09:38:16 +0100 (BST)
Received: from smtp2.int-evry.fr ([157.159.10.45]:8623 "EHLO smtp2.int-evry.fr")
	by ftp.linux-mips.org with ESMTP id S8133529AbWGZIiF (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Jul 2006 09:38:05 +0100
Received: from connect.int-evry.fr (connect.int-evry.fr [157.159.10.48])
	by smtp2.int-evry.fr (Postfix) with ESMTP id C84282FE6D
	for <linux-mips@linux-mips.org>; Wed, 26 Jul 2006 10:37:56 +0200 (CEST)
From:	Florian FAINELLI <florian.fainelli@int-evry.fr>
To:	linux-mips@linux-mips.org
Subject: YAMON and decompression from flash
Date:	Wed, 26 Jul 2006 10:37:53 +0200
User-Agent: KMail/1.9.1
MIME-Version: 1.0
Content-Type: multipart/signed;
  boundary="nextPart1797976.nX7Jklc9tA";
  protocol="application/pgp-signature";
  micalg=pgp-sha1
Content-Transfer-Encoding: 7bit
Message-Id: <200607261037.55996.florian.fainelli@int-evry.fr>
X-INT-MailScanner-Information: Please contact the ISP for more information
X-INT-MailScanner: Found to be clean
X-INT-MailScanner-MCPCheck: 
X-INT-MailScanner-SpamCheck: 
X-MailScanner-From: florian.fainelli@int-evry.fr
Return-Path: <florian.fainelli@int-evry.fr>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12079
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: florian.fainelli@int-evry.fr
Precedence: bulk
X-list: linux-mips

--nextPart1797976.nX7Jklc9tA
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi all,

I want to use the generic LZMA decompressor we use in OpenWrt with an MTX-1=
=20
board. Currently, decompressing from RAM works fine. My problems are coming=
=20
from decompression from flash.

Basically, I used the same parameters for flash decompression as for RAM=20
decompression (kernel entry point, ram start address, ram size), except tha=
t=20
I ran an "--adjust-vma" with the same parameters as the zlib decompressor h=
as=20
in the Makefile (patch can be found here :=20
https://dev.openwrt.org/browser/branches/buildroot-ng/openwrt/target/linux/=
au1000-2.6/patches/003-zImage.patch).

I think I am missing some ideas/concepts, and don't know why it works for=20
zlib, and not for lzma (apart from the fact that the two decompressor may n=
ot=20
work the same way).

Thank you very much in advance for any suggestion. If it is relevant I will=
=20
post the exception handling YAMON generates while decompressing from flash.
=2D--
Cordialement, Florian Fainelli
=2D--------------------------------------------
5, rue Charles Fourier
Chambre 1511
91011 Evry
http://www.alphacore.net
(+33) 01 60 76 64 86
(+33) 06 09 02 64 95
=2D--------------------------------------------
Association MiNET
http://www.minet.net
=2D--------------------------------------------
Institut National des T=E9l=E9communications
http://www.int-evry.fr/telecomint
=2D--------------------------------------------

--nextPart1797976.nX7Jklc9tA
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQBExynjQ/Yr6D8A81kRAtJ9AJ9IZCAwh2nd30iRtfnzVj22umdYYwCfYDRz
VS/zSdRFuLMnKB8TTdHiPMc=
=8+4n
-----END PGP SIGNATURE-----

--nextPart1797976.nX7Jklc9tA--

From anemo@mba.ocn.ne.jp Wed Jul 26 15:21:07 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Jul 2006 15:21:17 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:20684 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133648AbWGZOVH (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Jul 2006 15:21:07 +0100
Received: from localhost (p2027-ipad203funabasi.chiba.ocn.ne.jp [222.146.81.27])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 61EF7A2F0; Wed, 26 Jul 2006 23:21:01 +0900 (JST)
Date:	Wed, 26 Jul 2006 23:22:31 +0900 (JST)
Message-Id: <20060726.232231.59465336.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] dump_stack() based on prologue code analysis
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: 12080
X-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

Instead of dump all possible address in the stack, unwind the stack
frame based on prologue code analysis, as like as get_chan() does.
While the code analysis might fail for some reason, there is a new
kernel option "raw_show_trace" to disable this feature.

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

diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 7ab67f7..8f1a5fe 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -281,7 +281,7 @@ static struct mips_frame_info {
 } *schedule_frame, mfinfo[64];
 static int mfinfo_num;
 
-static int __init get_frame_info(struct mips_frame_info *info)
+static int get_frame_info(struct mips_frame_info *info)
 {
 	int i;
 	void *func = info->func;
@@ -329,12 +329,6 @@ #endif
 				ip->i_format.simmediate / sizeof(long);
 		}
 	}
-	if (info->pc_offset == -1 || info->frame_size == 0) {
-		if (func == schedule)
-			printk("Can't analyze prologue code at %p\n", func);
-		info->pc_offset = -1;
-		info->frame_size = 0;
-	}
 
 	return 0;
 }
@@ -367,8 +361,17 @@ #else
 	mfinfo[0].func = schedule;
 	schedule_frame = &mfinfo[0];
 #endif
-	for (i = 0; i < ARRAY_SIZE(mfinfo) && mfinfo[i].func; i++)
-		get_frame_info(&mfinfo[i]);
+	for (i = 0; i < ARRAY_SIZE(mfinfo) && mfinfo[i].func; i++) {
+		struct mips_frame_info *info = &mfinfo[i];
+		get_frame_info(info);
+		if (info->pc_offset < 0 || info->frame_size == 0) {
+			if (info->func == schedule)
+				printk("Can't analyze prologue code at %p\n",
+				       info->func);
+			info->pc_offset = -1;
+			info->frame_size = 0;
+		}
+	}
 
 	mfinfo_num = i;
 	return 0;
@@ -437,3 +440,41 @@ #endif
 	return pc;
 }
 
+#ifdef CONFIG_KALLSYMS
+/* used by show_frametrace() */
+unsigned long unwind_stack(struct task_struct *task,
+			   unsigned long **sp, unsigned long pc)
+{
+	unsigned long stack_page;
+	struct mips_frame_info info;
+	char *modname;
+	char namebuf[KSYM_NAME_LEN + 1];
+	unsigned long size, ofs;
+
+	stack_page = (unsigned long)task_stack_page(task);
+	if (!stack_page)
+		return 0;
+
+	if (!kallsyms_lookup(pc, &size, &ofs, &modname, namebuf))
+		return 0;
+	if (ofs == 0)
+		return 0;
+
+	info.func = (void *)(pc - ofs);
+	info.func_size = ofs;	/* analyze from start to ofs */
+	get_frame_info(&info);
+	if (info.pc_offset < 0 || !info.frame_size) {
+		/* leaf? */
+		*sp += info.frame_size / sizeof(long);
+		return 0;
+	}
+	if ((unsigned long)*sp < stack_page ||
+	    (unsigned long)*sp + info.frame_size / sizeof(long) >
+	    stack_page + THREAD_SIZE - 32)
+		return 0;
+
+	pc = (*sp)[info.pc_offset];
+	*sp += info.frame_size / sizeof(long);
+	return pc;
+}
+#endif
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index c6f7046..bf36fcc 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -98,24 +98,53 @@ #endif
 	printk("\n");
 }
 
+#ifdef CONFIG_KALLSYMS
+static int raw_show_trace;
+static int __init set_raw_show_trace(char *str)
+{
+	raw_show_trace = 1;
+	return 1;
+}
+__setup("raw_show_trace", set_raw_show_trace);
+
+extern unsigned long unwind_stack(struct task_struct *task,
+				  unsigned long **sp, unsigned long pc);
+static void show_frametrace(struct task_struct *task, struct pt_regs *regs)
+{
+	const int field = 2 * sizeof(unsigned long);
+	unsigned long *stack = (long *)regs->regs[29];
+	unsigned long pc = regs->cp0_epc;
+	int top = 1;
+
+	if (raw_show_trace || !__kernel_text_address(pc)) {
+		show_trace(stack);
+		return;
+	}
+	printk("Call Trace:\n");
+	while (__kernel_text_address(pc)) {
+		printk(" [<%0*lx>] ", field, pc);
+		print_symbol("%s\n", pc);
+		pc = unwind_stack(task, &stack, pc);
+		if (top && pc == 0)
+			pc = regs->regs[31];	/* leaf? */
+		top = 0;
+	}
+	printk("\n");
+}
+#else
+#define show_frametrace(task, r) show_trace((long *)(r)->regs[29]);
+#endif
+
 /*
  * This routine abuses get_user()/put_user() to reference pointers
  * with at least a bit of error checking ...
  */
-void show_stack(struct task_struct *task, unsigned long *sp)
+static void show_stacktrace(struct task_struct *task, struct pt_regs *regs)
 {
 	const int field = 2 * sizeof(unsigned long);
 	long stackdata;
 	int i;
-	unsigned long *stack;
-
-	if (!sp) {
-		if (task && task != current)
-			sp = (unsigned long *) task->thread.reg29;
-		else
-			sp = (unsigned long *) &sp;
-	}
-	stack = sp;
+	unsigned long *sp = (unsigned long *)regs->regs[29];
 
 	printk("Stack :");
 	i = 0;
@@ -136,7 +165,44 @@ void show_stack(struct task_struct *task
 		i++;
 	}
 	printk("\n");
-	show_trace(stack);
+	show_frametrace(task, regs);
+}
+
+static noinline void dump_stack_top(struct pt_regs *regs)
+{
+	__asm__ __volatile__(
+		"1: la $2, 1b\n\t"
+#ifdef CONFIG_64BIT
+		"sd $2, %0\n\t"
+		"sd $29, %1\n\t"
+		"sd $31, %2\n\t"
+#else
+		"sw $2, %0\n\t"
+		"sw $29, %1\n\t"
+		"sw $31, %2\n\t"
+#endif
+		: "=m" (regs->cp0_epc),
+		"=m" (regs->regs[29]), "=m" (regs->regs[31])
+		: : "memory");
+}
+
+void show_stack(struct task_struct *task, unsigned long *sp)
+{
+	struct pt_regs regs;
+	if (sp) {
+		regs.regs[29] = (unsigned long)sp;
+		regs.regs[31] = 0;
+		regs.cp0_epc = 0;
+	} else {
+		if (task && task != current) {
+			regs.regs[29] = task->thread.reg29;
+			regs.regs[31] = 0;
+			regs.cp0_epc = task->thread.reg31;
+		} else {
+			dump_stack_top(&regs);
+		}
+	}
+	show_stacktrace(task, &regs);
 }
 
 /*
@@ -146,6 +212,14 @@ void dump_stack(void)
 {
 	unsigned long stack;
 
+#ifdef CONFIG_KALLSYMS
+	if (!raw_show_trace) {
+		struct pt_regs regs;
+		dump_stack_top(&regs);
+		show_frametrace(current, &regs);
+		return;
+	}
+#endif
 	show_trace(&stack);
 }
 
@@ -265,7 +339,7 @@ void show_registers(struct pt_regs *regs
 	print_modules();
 	printk("Process %s (pid: %d, threadinfo=%p, task=%p)\n",
 	        current->comm, current->pid, current_thread_info(), current);
-	show_stack(current, (long *) regs->regs[29]);
+	show_stacktrace(current, regs);
 	show_code((unsigned int *) regs->cp0_epc);
 	printk("\n");
 }

From vagabon.xyz@gmail.com Wed Jul 26 15:34:56 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Jul 2006 15:35:07 +0100 (BST)
Received: from wr-out-0506.google.com ([64.233.184.236]:30985 "EHLO
	wr-out-0506.google.com") by ftp.linux-mips.org with ESMTP
	id S8133827AbWGZOe4 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 26 Jul 2006 15:34:56 +0100
Received: by wr-out-0506.google.com with SMTP id 57so1210441wri
        for <linux-mips@linux-mips.org>; Wed, 26 Jul 2006 07:34:52 -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=hWi7aFC9MYxORGScfzIM8uh5NzBQ2mYilZ9WABbhQoz26R1Yyw1y/xlRDD5STlKHBS26aeUY89v7zPrzU6oPZAblGtSZCx6nhuiqsGJCBfZWJ63gewtAPGF9N1GhXyC5T8tmPxiaAFz+v2qMny8sChwX/85crqJUyW5fYOct4Ak=
Received: by 10.54.105.15 with SMTP id d15mr6646545wrc;
        Wed, 26 Jul 2006 07:34:52 -0700 (PDT)
Received: from ?192.168.0.24? ( [194.3.162.233])
        by mx.gmail.com with ESMTP id 29sm3839960wrl.2006.07.26.07.34.50;
        Wed, 26 Jul 2006 07:34:52 -0700 (PDT)
Message-ID: <44C77D49.90205@innova-card.com>
Date:	Wed, 26 Jul 2006 16:33:45 +0200
Reply-To: Franck <vagabon.xyz@gmail.com>
User-Agent: Thunderbird 1.5.0.4 (X11/20060614)
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: <cda58cb80607100434h13831eb7rc6eda13a0d9e373f@mail.gmail.com>	<20060710.233454.39153668.anemo@mba.ocn.ne.jp>	<44B3625B.7000700@innova-card.com> <20060711.222458.74752678.anemo@mba.ocn.ne.jp>
In-Reply-To: <20060711.222458.74752678.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: 12081
X-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

Hi Atsushi,

Sorry for the delay...

Atsushi Nemoto wrote:
> On Tue, 11 Jul 2006 10:33:31 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
>>> We can, but we can get more precise value using page_is_ram().  The
>>> pfn_valid() returns true for _all_ pages on present section, and
>>> currently the section size is 256MB.
>> so your total pages of RAM in show_mem() is incorrect...
>>
>>                if (!pfn_valid(pfn))
>>                         continue;
>>                 page = pfn_to_page(pfn);
>>                 total++;
>>
>>
>> I don't know SPARSEMEM a lot but is it allowed to have holes inside
>> a section ? Shouldn't we tune the section size to avoid holes inside
>> section ?
> 
> If holes exist in a section, show_mem() will count these pages as
> "reserved".  You can count real pages by "total - reserved".
> 

I don't think that's correct to mark them as "reserved". Basicaly
"reserved" means that it belongs to the kernel (code or data), these
holes are not and we will end up to have wrong value as you pointed
out.

Having quick look at sparsemem code, I don't think that it expects
to have holes inside a section, do it ? If so you probably have to
fix up your section size...

> Talking about nr_kernel_pages (calculated by zones_size[] and
> zones_holes[]) and num_physpages, these values are used to determine
> sizes of some kernel data structures, it would be better to set more
> precise value for them.
> 
> While large holes in a section wastes some memory, make the section
> size customizable might be a good idea.  Anyone?  ;-)
> 

hey, you are working in this area, aren't you ? ;)

		Franck

From yoichi_yuasa@tripeaks.co.jp Wed Jul 26 15:38:25 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Jul 2006 15:38:37 +0100 (BST)
Received: from mo32.po.2iij.net ([210.128.50.17]:57348 "EHLO mo32.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133835AbWGZOiZ (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Jul 2006 15:38:25 +0100
Received: by mo.po.2iij.net (mo32) id k6QEcNxX080597; Wed, 26 Jul 2006 23:38:23 +0900 (JST)
Received: from localhost.localdomain (203.25.30.125.dy.iij4u.or.jp [125.30.25.203])
	by mbox.po.2iij.net (mbox30) id k6QEcHT2089713
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Wed, 26 Jul 2006 23:38:18 +0900 (JST)
Date:	Wed, 26 Jul 2006 23:31:02 +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] removed unused arc/console.c
Message-Id: <20060726233102.2ae5ba17.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: 12082
X-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 arc/console.c .
This file is not used now.

Yoichi

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

diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/arc/console.c mips/arch/mips/arc/console.c
--- mips-orig/arch/mips/arc/console.c	2006-07-26 10:34:31.756177500 +0900
+++ mips/arch/mips/arc/console.c	1970-01-01 09:00:00.000000000 +0900
@@ -1,63 +0,0 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 1996 David S. Miller (dm@sgi.com)
- * Compability with board caches, Ulf Carlsson
- */
-#include <linux/kernel.h>
-#include <asm/sgialib.h>
-#include <asm/bcache.h>
-
-/*
- * IP22 boardcache is not compatible with board caches.  Thus we disable it
- * during romvec action.  Since r4xx0.c is always compiled and linked with your
- * kernel, this shouldn't cause any harm regardless what MIPS processor you
- * have.
- *
- * The ARC write and read functions seem to interfere with the serial lines
- * in some way. You should be careful with them.
- */
-
-void prom_putchar(char c)
-{
-	ULONG cnt;
-	CHAR it = c;
-
-	bc_disable();
-	ArcWrite(1, &it, 1, &cnt);
-	bc_enable();
-}
-
-char prom_getchar(void)
-{
-	ULONG cnt;
-	CHAR c;
-
-	bc_disable();
-	ArcRead(0, &c, 1, &cnt);
-	bc_enable();
-
-	return c;
-}
-
-void prom_printf(char *fmt, ...)
-{
-	va_list args;
-	char ppbuf[1024];
-	char *bptr;
-
-	va_start(args, fmt);
-	vsprintf(ppbuf, fmt, args);
-
-	bptr = ppbuf;
-
-	while (*bptr != 0) {
-		if (*bptr == '\n')
-			prom_putchar('\r');
-
-		prom_putchar(*bptr++);
-	}
-	va_end(args);
-}

From yoichi_yuasa@tripeaks.co.jp Wed Jul 26 15:39:12 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Jul 2006 15:39:38 +0100 (BST)
Received: from mo32.po.2iij.net ([210.128.50.17]:21533 "EHLO mo32.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133827AbWGZOiZ (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Jul 2006 15:38:25 +0100
Received: by mo.po.2iij.net (mo32) id k6QEcN8F080598; Wed, 26 Jul 2006 23:38:23 +0900 (JST)
Received: from localhost.localdomain (203.25.30.125.dy.iij4u.or.jp [125.30.25.203])
	by mbox.po.2iij.net (mbox30) id k6QEcKsJ089723
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Wed, 26 Jul 2006 23:38:20 +0900 (JST)
Date:	Wed, 26 Jul 2006 23:35:53 +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] removed unused excite_flashtest.c
Message-Id: <20060726233553.57b4c96f.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: 12083
X-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 excite_flashtest.c .
This file is not used now.

Yoichi

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

diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/basler/excite/excite_flashtest.c mips/arch/mips/basler/excite/excite_flashtest.c
--- mips-orig/arch/mips/basler/excite/excite_flashtest.c	2006-07-26 10:34:31.772178500 +0900
+++ mips/arch/mips/basler/excite/excite_flashtest.c	1970-01-01 09:00:00.000000000 +0900
@@ -1,294 +0,0 @@
-/*
-*  Copyright (C) 2005 by Basler Vision Technologies AG
-*  Author: Thies Moeller <thies.moeller@baslerweb.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 program is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  You should have received a copy of the GNU General Public License
-*  along with this program; if not, write to the Free Software
-*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/ioport.h>
-#include <linux/device.h>
-#include <linux/delay.h>
-#include <linux/err.h>
-#include <linux/kernel.h>
-
-#include <excite.h>
-
-#include <asm/io.h>
-
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/nand.h>
-#include <linux/mtd/nand_ecc.h>
-#include <linux/mtd/partitions.h>
-#include <asm/rm9k-ocd.h> // for ocd_write
-#include <linux/workqueue.h> // for queue
-
-#include "excite_nandflash.h"
-#include "nandflash.h"
-
-#define PFX "excite flashtest: "
-typedef void __iomem *io_reg_t;
-
-#define io_readb(__a__)		__raw_readb((__a__))
-#define io_writeb(__v__, __a__)	__raw_writeb((__v__), (__a__))
-
-
-
-static inline const struct resource *excite_nandflash_get_resource(
-	struct platform_device *d, unsigned long flags, const char *basename)
-{
-	const char fmt[] = "%s_%u";
-	char buf[80];
-
-	if (unlikely(snprintf(buf, sizeof buf, fmt, basename, d->id) >= sizeof buf))
-		return NULL;
-
-	return platform_get_resource_byname(d, flags, buf);
-}
-
-static inline io_reg_t
-excite_nandflash_map_regs(struct platform_device *d, const char *basename)
-{
-	void *result = NULL;
-	const struct resource *const r =
-	    excite_nandflash_get_resource(d, IORESOURCE_MEM, basename);
-	if (r)
-	   result = ioremap_nocache(r->start, r->end + 1 - r->start);
-	return result;
-}
-
-/* controller and mtd information */
-
-struct excite_nandflash_drvdata {
-	struct mtd_info board_mtd;
-	struct nand_chip board_chip;
-	io_reg_t regs;
-};
-
-
-/* command and control functions */
-static void excite_nandflash_hwcontrol(struct mtd_info *mtd, int cmd)
-{
-	struct nand_chip *this = mtd->priv;
-	io_reg_t regs = container_of(mtd,struct excite_nandflash_drvdata,board_mtd)->regs;
-
-	switch (cmd) {
-	/* Select the command latch */
-	case NAND_CTL_SETCLE: this->IO_ADDR_W = regs + EXCITE_NANDFLASH_CMD;
-		break;
-	/* Deselect the command latch */
-	case NAND_CTL_CLRCLE: this->IO_ADDR_W = regs + EXCITE_NANDFLASH_DATA;
-		break;
-	/* Select the address latch */
-	case NAND_CTL_SETALE: this->IO_ADDR_W = regs + EXCITE_NANDFLASH_ADDR;
-		break;
-	/* Deselect the address latch */
-	case NAND_CTL_CLRALE: this->IO_ADDR_W = regs  + EXCITE_NANDFLASH_DATA;
-		break;
-	/* Select the chip  -- not used */
-	case NAND_CTL_SETNCE:
-		break;
-	/* Deselect the chip -- not used */
-	case NAND_CTL_CLRNCE:
-		break;
-	}
-
-	this->IO_ADDR_R = this->IO_ADDR_W;
-}
-
-/* excite_nandflash_devready()
- *
- * returns 0 if the nand is busy, 1 if it is ready
- */
-static int excite_nandflash_devready(struct mtd_info *mtd)
-{
-	struct excite_nandflash_drvdata *drvdata =
-	    container_of(mtd, struct excite_nandflash_drvdata, board_mtd);
-
-	return io_readb(drvdata->regs + EXCITE_NANDFLASH_STATUS);
-}
-
-/* device management functions */
-
-/* excite_nandflash_remove
- *
- * called by device layer to remove the driver
- * the binding to the mtd and all allocated
- * resources are released
- */
-static int excite_nandflash_remove(struct device *dev)
-{
-	struct excite_nandflash_drvdata *this = dev_get_drvdata(dev);
-
-	pr_info(PFX "remove");
-
-	dev_set_drvdata(dev, NULL);
-
-	if (this == NULL) {
-		pr_debug(PFX "call remove without private data!!");
-		return 0;
-	}
-
-
-	/* free the common resources */
-	if (this->regs != NULL) {
-		iounmap(this->regs);
-		this->regs = NULL;
-	}
-
-	kfree(this);
-
-	return 0;
-}
-
-static int elapsed;
-
-void my_workqueue_handler(void *arg)
-{
-	elapsed = 1;
-}
-
-DECLARE_WORK(sigElapsed, my_workqueue_handler, 0);
-
-
-/* excite_nandflash_probe
- *
- * called by device layer when it finds a device matching
- * one our driver can handled. This code checks to see if
- * it can allocate all necessary resources then calls the
- * nand layer to look for devices
-*/
-static int excite_nandflash_probe(struct device *dev)
-{
-	struct platform_device *pdev = to_platform_device(dev);
-
-	struct excite_nandflash_drvdata *drvdata;	    /* private driver data     */
-	struct nand_chip              *board_chip;  /* private flash chip data */
-	struct mtd_info               *board_mtd;   /* mtd info for this board */
-
-	int err      = 0;
-	int count    = 0;
-	struct timeval tv,endtv;
-	unsigned int dt;
-
-	pr_info(PFX "probe dev: (%p)\n", dev);
-
-	pr_info(PFX "adjust LB timing\n");
-	ocd_writel(0x00000330, LDP2);
-
-	drvdata = kmalloc(sizeof(*drvdata), GFP_KERNEL);
-	if (unlikely(!drvdata)) {
-		printk(KERN_ERR PFX "no memory for drvdata\n");
-		err = -ENOMEM;
-		goto mem_error;
-	}
-
-	/* Initialize structures */
-	memset(drvdata, 0, sizeof(*drvdata));
-
-	/* bind private data into driver */
-	dev_set_drvdata(dev, drvdata);
-
-	/* allocate and map the resource */
-	drvdata->regs =
-	    excite_nandflash_map_regs(pdev, EXCITE_NANDFLASH_RESOURCE_REGS);
-
-	if (unlikely(!drvdata->regs)) {
-		printk(KERN_ERR PFX "cannot reserve register region\n");
-		err = -ENXIO;
-		goto io_error;
-	}
-
-	/* initialise our chip */
-	board_chip = &drvdata->board_chip;
-
-	board_chip->IO_ADDR_R = drvdata->regs + EXCITE_NANDFLASH_DATA;
-	board_chip->IO_ADDR_W = drvdata->regs + EXCITE_NANDFLASH_DATA;
-
-	board_chip->hwcontrol = excite_nandflash_hwcontrol;
-	board_chip->dev_ready = excite_nandflash_devready;
-
-	board_chip->chip_delay = 25;
-	#if 0
-	/* TODO: speedup the initial scan */
-	board_chip->options = NAND_USE_FLASH_BBT;
-	#endif
-	board_chip->eccmode = NAND_ECC_SOFT;
-
-	/* link chip to mtd */
-	board_mtd = &drvdata->board_mtd;
-	board_mtd->priv = board_chip;
-
-
-	pr_info(PFX "FlashTest\n");
-	elapsed = 0;
-/*	schedule_delayed_work(&sigElapsed, 1*HZ);
-	while (!elapsed) {
-		io_readb(drvdata->regs + EXCITE_NANDFLASH_STATUS);
-		count++;
-	}
-	pr_info(PFX "reads in 1 sec --> %d\n",count);
-*/
-	do_gettimeofday(&tv);
-	for (count = 0 ; count < 1000000; count ++) {
-		io_readb(drvdata->regs + EXCITE_NANDFLASH_STATUS);
-	}
-	do_gettimeofday(&endtv);
-	dt = (endtv.tv_sec - tv.tv_sec) * 1000000 + endtv.tv_usec  - tv.tv_usec;
-	pr_info(PFX "%8d us timeval\n",dt);
-	pr_info(PFX "EndFlashTest\n");
-
-/*      return with error to unload everything
-*/
-io_error:
-	iounmap(drvdata->regs);
-
-mem_error:
-	kfree(drvdata);
-
-	if (err == 0)
-		err = -EINVAL;
-	return err;
-}
-
-static struct device_driver excite_nandflash_driver = {
-	.name = "excite_nand",
-	.bus = &platform_bus_type,
-	.probe = excite_nandflash_probe,
-	.remove = excite_nandflash_remove,
-};
-
-static int __init excite_nandflash_init(void)
-{
-	pr_info(PFX "register Driver (Rev: $Revision:$)\n");
-	return driver_register(&excite_nandflash_driver);
-}
-
-static void __exit excite_nandflash_exit(void)
-{
-	driver_unregister(&excite_nandflash_driver);
-	pr_info(PFX "Driver unregistered");
-}
-
-module_init(excite_nandflash_init);
-module_exit(excite_nandflash_exit);
-
-MODULE_AUTHOR("Thies Moeller <thies.moeller@baslerweb.com>");
-MODULE_DESCRIPTION("Basler eXcite NAND-Flash driver");
-MODULE_LICENSE("GPL");

From yoichi_yuasa@tripeaks.co.jp Wed Jul 26 15:40:14 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Jul 2006 15:40:40 +0100 (BST)
Received: from mo31.po.2iij.net ([210.128.50.54]:61472 "EHLO mo31.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133832AbWGZOiZ (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Jul 2006 15:38:25 +0100
Received: by mo.po.2iij.net (mo31) id k6QEcMwM016987; Wed, 26 Jul 2006 23:38:22 +0900 (JST)
Received: from localhost.localdomain (203.25.30.125.dy.iij4u.or.jp [125.30.25.203])
	by mbox.po.2iij.net (mbox30) id k6QEcJ4G089718
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Wed, 26 Jul 2006 23:38:19 +0900 (JST)
Date:	Wed, 26 Jul 2006 23:34:19 +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] removed unused mirage_ts.c
Message-Id: <20060726233419.2f24df15.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: 12084
X-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 mirage_ts.c .
CONFIG_WM97XX_COMODULE doesn't exist.

Yoichi

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

No config WM97XX_COMODULE

diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/au1000/db1x00/Makefile mips/arch/mips/au1000/db1x00/Makefile
--- mips-orig/arch/mips/au1000/db1x00/Makefile	2006-07-26 10:34:31.764178000 +0900
+++ mips/arch/mips/au1000/db1x00/Makefile	2006-07-26 15:22:58.350116250 +0900
@@ -6,4 +6,3 @@
 # Makefile for the Alchemy Semiconductor Db1x00 board.
 
 lib-y := init.o board_setup.o irqmap.o
-obj-$(CONFIG_WM97XX_COMODULE) += mirage_ts.o
diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/au1000/db1x00/mirage_ts.c mips/arch/mips/au1000/db1x00/mirage_ts.c
--- mips-orig/arch/mips/au1000/db1x00/mirage_ts.c	2006-07-26 10:34:31.764178000 +0900
+++ mips/arch/mips/au1000/db1x00/mirage_ts.c	1970-01-01 09:00:00.000000000 +0900
@@ -1,260 +0,0 @@
-/*
- * linux/arch/mips/au1000/db1x00/mirage_ts.c
- *
- * BRIEF MODULE DESCRIPTION
- *	Glue between Mirage board-specific touchscreen pieces
- *	and generic Wolfson Codec touchscreen support.
- *
- *	Based on pb1100_ts.c used in Hydrogen II.
- *
- * Copyright (c) 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/types.h>
-#include <linux/module.h>
-#include <linux/sched.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/fs.h>
-#include <linux/poll.h>
-#include <linux/proc_fs.h>
-#include <linux/smp.h>
-#include <linux/smp_lock.h>
-#include <linux/wait.h>
-
-#include <asm/segment.h>
-#include <asm/irq.h>
-#include <asm/uaccess.h>
-#include <asm/delay.h>
-#include <asm/au1000.h>
-
-/*
- *  Imported interface to Wolfson Codec driver.
- */
-extern void *wm97xx_ts_get_handle(int which);
-extern int wm97xx_ts_ready(void* ts_handle);
-extern void wm97xx_ts_set_cal(void* ts_handle, int xscale, int xtrans, int yscale, int ytrans);
-extern u16 wm97xx_ts_get_ac97(void* ts_handle, u8 reg);
-extern void wm97xx_ts_set_ac97(void* ts_handle, u8 reg, u16 val);
-extern int wm97xx_ts_read_data(void* ts_handle, long* x, long* y, long* pressure);
-extern void wm97xx_ts_send_data(void* ts_handle, long x, long y, long z);
-
-int wm97xx_comodule_present = 1;
-
-
-#define TS_NAME "mirage_ts"
-
-#define err(format, arg...) printk(KERN_ERR TS_NAME ": " format "\n" , ## arg)
-#define info(format, arg...) printk(KERN_INFO TS_NAME ": " format "\n" , ## arg)
-#define warn(format, arg...) printk(KERN_WARNING TS_NAME ": " format "\n" , ## arg)
-#define DPRINTK(format, arg...) printk("%s: " format "\n", __FUNCTION__ , ## arg)
-
-
-#define PEN_DOWN_IRQ	AU1000_GPIO_7
-
-static struct task_struct *ts_task = 0;
-static DECLARE_COMPLETION(ts_complete);
-static DECLARE_WAIT_QUEUE_HEAD(pendown_wait);
-
-#ifdef CONFIG_WM97XX_FIVEWIRETS
-static int release_pressure = 1;
-#else
-static int release_pressure = 50;
-#endif
-
-typedef struct {
-   long x;
-   long y;
-} DOWN_EVENT;
-
-#define SAMPLE_RATE	50	/* samples per second */
-#define PEN_DEBOUNCE	5	/* samples for settling - fn of SAMPLE_RATE */
-#define PEN_UP_TIMEOUT	10	/* in seconds */
-#define PEN_UP_SETTLE	5	/* samples per second */
-
-static struct {
-	int xscale;
-	int xtrans;
-	int yscale;
-	int ytrans;
-} mirage_ts_cal =
-{
-#if 0
-	.xscale   = 84,
-	.xtrans = -157,
-	.yscale   = 66,
-	.ytrans = -150,
-#else
-	.xscale   = 84,
-	.xtrans = -150,
-	.yscale   = 66,
-	.ytrans = -146,
-#endif
-};
-
-
-static void pendown_irq(int irqnr, void *devid, struct pt_regs *regs)
-{
-//DPRINTK("got one 0x%x", au_readl(SYS_PINSTATERD));
-	wake_up(&pendown_wait);
-}
-
-static int ts_thread(void *id)
-{
-	static int pen_was_down = 0;
-	static DOWN_EVENT pen_xy;
-	long x, y, z;
-	void *ts;	/* handle */
-	struct task_struct *tsk = current;
-	int timeout = HZ / SAMPLE_RATE;
-
-	ts_task = tsk;
-
-	daemonize();
-	tsk->tty = NULL;
-	tsk->policy = SCHED_FIFO;
-	tsk->rt_priority = 1;
-	strcpy(tsk->comm, "touchscreen");
-
-	/* only want to receive SIGKILL */
-	spin_lock_irq(&tsk->sigmask_lock);
-	siginitsetinv(&tsk->blocked, sigmask(SIGKILL));
-	recalc_sigpending(tsk);
-	spin_unlock_irq(&tsk->sigmask_lock);
-
-	/* get handle for codec */
-	ts = wm97xx_ts_get_handle(0);
-
-	/* proceed only after everybody is ready */
-	wait_event_timeout(pendown_wait, wm97xx_ts_ready(ts), HZ/4);
-
-	/* board-specific calibration */
-	wm97xx_ts_set_cal(ts,
-			mirage_ts_cal.xscale,
-			mirage_ts_cal.xtrans,
-			mirage_ts_cal.yscale,
-			mirage_ts_cal.ytrans);
-
-	/* route Wolfson pendown interrupts to our GPIO */
-	au_sync();
-	wm97xx_ts_set_ac97(ts, 0x4c, wm97xx_ts_get_ac97(ts, 0x4c) & ~0x0008);
-	au_sync();
-	wm97xx_ts_set_ac97(ts, 0x56, wm97xx_ts_get_ac97(ts, 0x56) & ~0x0008);
-	au_sync();
-	wm97xx_ts_set_ac97(ts, 0x52, wm97xx_ts_get_ac97(ts, 0x52) | 0x2008);
-	au_sync();
-
-	for (;;) {
-		interruptible_sleep_on_timeout(&pendown_wait, timeout);
-		disable_irq(PEN_DOWN_IRQ);
-		if (signal_pending(tsk)) {
-			break;
-		}
-
-		/* read codec */
-		if (!wm97xx_ts_read_data(ts, &x, &y, &z))
-			z = 0;	/* treat no-data and pen-up the same */
-
-		if (signal_pending(tsk)) {
-			break;
-		}
-
-		if (z >= release_pressure) {
-			y = ~y;	/* top to bottom */
-			if (pen_was_down > 1 /*&& pen_was_down < PEN_DEBOUNCE*/) {//THXXX
-				/* bounce ? */
-				x = pen_xy.x;
-				y = pen_xy.y;
-				--pen_was_down;
-			} else if (pen_was_down <= 1) {
-				pen_xy.x = x;
-				pen_xy.y = y;
-				if (pen_was_down)
-					wm97xx_ts_send_data(ts, x, y, z);
-				pen_was_down = PEN_DEBOUNCE;
-			}
-			//wm97xx_ts_send_data(ts, x, y, z);
-			timeout = HZ / SAMPLE_RATE;
-		} else {
-			if (pen_was_down) {
-				if (--pen_was_down)
-					z = release_pressure;
-				else //THXXX
-				wm97xx_ts_send_data(ts, pen_xy.x, pen_xy.y, z);
-			}
-			/* The pendown signal takes some time to settle after
-			 * reading the pen pressure so wait a little
-			 * before enabling the pen.
-			 */
-			if (! pen_was_down) {
-//				interruptible_sleep_on_timeout(&pendown_wait, HZ / PEN_UP_SETTLE);
-				timeout = HZ * PEN_UP_TIMEOUT;
-			}
-		}
-		enable_irq(PEN_DOWN_IRQ);
-	}
-	enable_irq(PEN_DOWN_IRQ);
-	ts_task = NULL;
-	complete(&ts_complete);
-	return 0;
-}
-
-static int __init ts_mirage_init(void)
-{
-	int ret;
-
-	/* pen down signal is connected to GPIO 7 */
-
-	ret = request_irq(PEN_DOWN_IRQ, pendown_irq, 0, "ts-pendown", NULL);
-	if (ret) {
-		err("unable to get pendown irq%d: [%d]", PEN_DOWN_IRQ, ret);
-		return ret;
-	}
-
-	lock_kernel();
-	ret = kernel_thread(ts_thread, NULL, CLONE_FS | CLONE_FILES);
-	if (ret < 0) {
-		unlock_kernel();
-		return ret;
-	}
-	unlock_kernel();
-
-	info("Mirage touchscreen IRQ initialized.");
-
-	return 0;
-}
-
-static void __exit ts_mirage_exit(void)
-{
-	if (ts_task) {
-		send_sig(SIGKILL, ts_task, 1);
-		wait_for_completion(&ts_complete);
-	}
-
-	free_irq(PEN_DOWN_IRQ, NULL);
-}
-
-module_init(ts_mirage_init);
-module_exit(ts_mirage_exit);
-

From yoichi_yuasa@tripeaks.co.jp Wed Jul 26 15:41:15 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Jul 2006 15:41:44 +0100 (BST)
Received: from mo32.po.2iij.net ([210.128.50.17]:14143 "EHLO mo32.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8133828AbWGZOiZ (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Jul 2006 15:38:25 +0100
Received: by mo.po.2iij.net (mo32) id k6QEcNxZ080597; Wed, 26 Jul 2006 23:38:23 +0900 (JST)
Received: from localhost.localdomain (203.25.30.125.dy.iij4u.or.jp [125.30.25.203])
	by mbox.po.2iij.net (mbox30) id k6QEcLNn089729
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Wed, 26 Jul 2006 23:38:22 +0900 (JST)
Date:	Wed, 26 Jul 2006 23:37:44 +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] removed unused sibyte/swarm/time.c
Message-Id: <20060726233744.6262ce07.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: 12085
X-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 sibyte/swarm/time.c .
This file is not used now.

Yoichi

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

diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/sibyte/swarm/time.c mips/arch/mips/sibyte/swarm/time.c
--- mips-orig/arch/mips/sibyte/swarm/time.c	2006-07-26 10:34:31.964190500 +0900
+++ mips/arch/mips/sibyte/swarm/time.c	1970-01-01 09:00:00.000000000 +0900
@@ -1,244 +0,0 @@
-/*
- * Copyright (C) 2000, 2001 Broadcom Corporation
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-/*
- * Time routines for the swarm board.  We pass all the hard stuff
- * through to the sb1250 handling code.  Only thing we really keep
- * track of here is what time of day we think it is.  And we don't
- * really even do a good job of that...
- */
-
-
-#include <linux/bcd.h>
-#include <linux/init.h>
-#include <linux/time.h>
-#include <linux/sched.h>
-#include <linux/spinlock.h>
-#include <asm/system.h>
-#include <asm/addrspace.h>
-#include <asm/io.h>
-
-#include <asm/sibyte/sb1250.h>
-#include <asm/sibyte/sb1250_regs.h>
-#include <asm/sibyte/sb1250_smbus.h>
-
-static unsigned long long sec_bias = 0;
-static unsigned int usec_bias = 0;
-
-/* Xicor 1241 definitions */
-
-/*
- * Register bits
- */
-
-#define X1241REG_SR_BAT	0x80		/* currently on battery power */
-#define X1241REG_SR_RWEL 0x04		/* r/w latch is enabled, can write RTC */
-#define X1241REG_SR_WEL 0x02		/* r/w latch is unlocked, can enable r/w now */
-#define X1241REG_SR_RTCF 0x01		/* clock failed */
-#define X1241REG_BL_BP2 0x80		/* block protect 2 */
-#define X1241REG_BL_BP1 0x40		/* block protect 1 */
-#define X1241REG_BL_BP0 0x20		/* block protect 0 */
-#define X1241REG_BL_WD1	0x10
-#define X1241REG_BL_WD0	0x08
-#define X1241REG_HR_MIL 0x80		/* military time format */
-
-/*
- * Register numbers
- */
-
-#define X1241REG_BL	0x10		/* block protect bits */
-#define X1241REG_INT	0x11		/*  */
-#define X1241REG_SC	0x30		/* Seconds */
-#define X1241REG_MN	0x31		/* Minutes */
-#define X1241REG_HR	0x32		/* Hours */
-#define X1241REG_DT	0x33		/* Day of month */
-#define X1241REG_MO	0x34		/* Month */
-#define X1241REG_YR	0x35		/* Year */
-#define X1241REG_DW	0x36		/* Day of Week */
-#define X1241REG_Y2K	0x37		/* Year 2K */
-#define X1241REG_SR	0x3F		/* Status register */
-
-#define X1241_CCR_ADDRESS	0x6F
-
-#define SMB_CSR(reg) (IOADDR(A_SMB_REGISTER(1, reg)))
-
-static int xicor_read(uint8_t addr)
-{
-        while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
-                ;
-
-	__raw_writeq((addr >> 8) & 0x7, SMB_CSR(R_SMB_CMD));
-	__raw_writeq(addr & 0xff, SMB_CSR(R_SMB_DATA));
-	__raw_writeq(V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR2BYTE,
-		     SMB_CSR(R_SMB_START));
-
-        while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
-                ;
-
-	__raw_writeq(V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_RD1BYTE,
-		     SMB_CSR(R_SMB_START));
-
-        while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
-                ;
-
-        if (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) {
-                /* Clear error bit by writing a 1 */
-                __raw_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS));
-                return -1;
-        }
-
-	return (__raw_readq(SMB_CSR(R_SMB_DATA)) & 0xff);
-}
-
-static int xicor_write(uint8_t addr, int b)
-{
-        while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
-                ;
-
-	__raw_writeq(addr, SMB_CSR(R_SMB_CMD));
-	__raw_writeq((addr & 0xff) | ((b & 0xff) << 8), SMB_CSR(R_SMB_DATA));
-	__raw_writeq(V_SMB_ADDR(X1241_CCR_ADDRESS) | V_SMB_TT_WR3BYTE,
-		     SMB_CSR(R_SMB_START));
-
-        while (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
-                ;
-
-        if (__raw_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_ERROR) {
-                /* Clear error bit by writing a 1 */
-                __raw_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS));
-                return -1;
-        } else {
-		return 0;
-	}
-}
-
-/*
- * In order to set the CMOS clock precisely, set_rtc_mmss has to be
- * called 500 ms after the second nowtime has started, because when
- * nowtime is written into the registers of the CMOS clock, it will
- * jump to the next second precisely 500 ms later. Check the Motorola
- * MC146818A or Dallas DS12887 data sheet for details.
- *
- * BUG: This routine does not handle hour overflow properly; it just
- *      sets the minutes. Usually you'll only notice that after reboot!
- */
-int set_rtc_mmss(unsigned long nowtime)
-{
-	int retval = 0;
-	int real_seconds, real_minutes, cmos_minutes;
-
-	cmos_minutes = xicor_read(X1241REG_MN);
-	cmos_minutes = BCD2BIN(cmos_minutes);
-
-	/*
-	 * since we're only adjusting minutes and seconds,
-	 * don't interfere with hour overflow. This avoids
-	 * messing with unknown time zones but requires your
-	 * RTC not to be off by more than 15 minutes
-	 */
-	real_seconds = nowtime % 60;
-	real_minutes = nowtime / 60;
-	if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
-		real_minutes += 30;		/* correct for half hour time zone */
-	real_minutes %= 60;
-
-	/* unlock writes to the CCR */
-	xicor_write(X1241REG_SR, X1241REG_SR_WEL);
-	xicor_write(X1241REG_SR, X1241REG_SR_WEL | X1241REG_SR_RWEL);
-
-	if (abs(real_minutes - cmos_minutes) < 30) {
-		real_seconds = BIN2BCD(real_seconds);
-		real_minutes = BIN2BCD(real_minutes);
-		xicor_write(X1241REG_SC, real_seconds);
-		xicor_write(X1241REG_MN, real_minutes);
-	} else {
-		printk(KERN_WARNING
-		       "set_rtc_mmss: can't update from %d to %d\n",
-		       cmos_minutes, real_minutes);
-		retval = -1;
-	}
-
-	xicor_write(X1241REG_SR, 0);
-
-	printk("set_rtc_mmss: %02d:%02d\n", real_minutes, real_seconds);
-
-	return retval;
-}
-
-static unsigned long __init get_swarm_time(void)
-{
-	unsigned int year, mon, day, hour, min, sec, y2k;
-
-	sec = xicor_read(X1241REG_SC);
-	min = xicor_read(X1241REG_MN);
-	hour = xicor_read(X1241REG_HR);
-
-	if (hour & X1241REG_HR_MIL) {
-		hour &= 0x3f;
-	} else {
-		if (hour & 0x20)
-			hour = (hour & 0xf) + 0x12;
-	}
-
-	sec = BCD2BIN(sec);
-	min = BCD2BIN(min);
-	hour = BCD2BIN(hour);
-
-	day = xicor_read(X1241REG_DT);
-	mon = xicor_read(X1241REG_MO);
-	year = xicor_read(X1241REG_YR);
-	y2k = xicor_read(X1241REG_Y2K);
-
-	day = BCD2BIN(day);
-	mon = BCD2BIN(mon);
-	year = BCD2BIN(year);
-	y2k = BCD2BIN(y2k);
-
-	year += (y2k * 100);
-
-	return mktime(year, mon, day, hour, min, sec);
-}
-
-/*
- *  Bring up the timer at 100 Hz.
- */
-void __init swarm_time_init(void)
-{
-	unsigned int flags;
-	int status;
-
-	/* Set up the scd general purpose timer 0 to cpu 0 */
-	sb1250_time_init();
-
-	/* Establish communication with the Xicor 1241 RTC */
-	/* XXXKW how do I share the SMBus with the I2C subsystem? */
-
-	__raw_writeq(K_SMB_FREQ_400KHZ, SMB_CSR(R_SMB_FREQ));
-	__raw_writeq(0, SMB_CSR(R_SMB_CONTROL));
-
-	if ((status = xicor_read(X1241REG_SR_RTCF)) < 0) {
-		printk("x1241: couldn't detect on SWARM SMBus 1\n");
-	} else {
-		if (status & X1241REG_SR_RTCF)
-			printk("x1241: battery failed -- time is probably wrong\n");
-		write_seqlock_irqsave(&xtime_lock, flags);
-		xtime.tv_sec = get_swarm_time();
-		xtime.tv_nsec = 0;
-		write_sequnlock_irqrestore(&xtime_lock, flags);
-	}
-}

From anemo@mba.ocn.ne.jp Wed Jul 26 16:20:29 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Jul 2006 16:20:39 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:59389 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133806AbWGZPU3 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Jul 2006 16:20:29 +0100
Received: from localhost (p2027-ipad203funabasi.chiba.ocn.ne.jp [222.146.81.27])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 303D485B1; Thu, 27 Jul 2006 00:20:24 +0900 (JST)
Date:	Thu, 27 Jul 2006 00:21:53 +0900 (JST)
Message-Id: <20060727.002153.41632148.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: <44C77D49.90205@innova-card.com>
References: <44B3625B.7000700@innova-card.com>
	<20060711.222458.74752678.anemo@mba.ocn.ne.jp>
	<44C77D49.90205@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: 12086
X-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, 26 Jul 2006 16:33:45 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
> I don't think that's correct to mark them as "reserved". Basicaly
> "reserved" means that it belongs to the kernel (code or data), these
> holes are not and we will end up to have wrong value as you pointed
> out.
> 
> Having quick look at sparsemem code, I don't think that it expects
> to have holes inside a section, do it ? If so you probably have to
> fix up your section size...

Yes, for such small holes, sparsemem and flatmem is same.  We can use
smaller section size to save more memory, but I suppose it will be a
bit slower.

> > Talking about nr_kernel_pages (calculated by zones_size[] and
> > zones_holes[]) and num_physpages, these values are used to determine
> > sizes of some kernel data structures, it would be better to set more
> > precise value for them.
> > 
> > While large holes in a section wastes some memory, make the section
> > size customizable might be a good idea.  Anyone?  ;-)
> > 
> 
> hey, you are working in this area, aren't you ? ;)

Well, not actively now since I'm comfort with 256MB section size :-)

---
Atsushi Nemoto

From ashlesha@kenati.com Wed Jul 26 22:45:20 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 26 Jul 2006 22:45:29 +0100 (BST)
Received: from [69.90.147.196] ([69.90.147.196]:35228 "EHLO mail.kenati.com")
	by ftp.linux-mips.org with ESMTP id S8133901AbWGZVpU (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 26 Jul 2006 22:45:20 +0100
Received: from [192.168.1.115] (adsl-71-130-109-177.dsl.snfc21.pacbell.net [71.130.109.177])
	by mail.kenati.com (Postfix) with ESMTP id C40D9E4051
	for <linux-mips@linux-mips.org>; Wed, 26 Jul 2006 15:00:04 -0700 (PDT)
Subject: Boot args on YAMON and Console init on the Encore M3.
From:	Ashlesha Shintre <ashlesha@kenati.com>
Reply-To: ashlesha@kenati.com
To:	linux-mips@linux-mips.org
Content-Type: text/plain
Date:	Wed, 26 Jul 2006 14:50:17 -0700
Message-Id: <1153950618.6491.26.camel@sandbar.kenati.com>
Mime-Version: 1.0
X-Mailer: Evolution 2.4.2.1 
Content-Transfer-Encoding: 7bit
Return-Path: <ashlesha@kenati.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: 12087
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ashlesha@kenati.com
Precedence: bulk
X-list: linux-mips

Background Info: working on porting linux kernel 2.6 to the DB1500 and
Encore M3 board both of which are run on the AU1500 processor.

Hi,

Thanks Pete for your inputs.  I changed the DB1500 board setting so that
it is now Big Endian.

Now when I load the image and issue the 'go' command in YAMON, I dont
see anything happen.  I cant stop the process by a control C.  Where is
the logbuf located where all the commands are dumped?

I m also pasting here the output of the setenv command which shows me
the environment variables and what they are set to.  What are the
bootargs meant to be set to?

MAC         (R/W)  0
bootargs0   (USER) ip=xxx.xxx.x.150::::db1500:eth0:off
bootargs1   (USER) nfsroot=xxx.xxx.x.15:/usr/local/targets/mips-target
bootargs2   (USER) root=ff noinitrd video=atyfb:1024x768-8@70
bootfile    (R/W)  vmlinux.srec
bootprot    (R/W)  tftp
bootserport (R/W)  tty0
bootserver  (R/W)  xxx.xxx.x.8
ethaddr     (R/W)  xx.xx.xx.xx.xx.xx
gateway     (R/W)  xxx.xxx.xx.1
ipaddr      (R/W)  xxx.xxx.x.146
memsize     (RO)   0x04000000
modetty0    (RO)   115200,n,8,1,none
modetty1    (RO)   115200,n,8,1,none
prompt      (R/W)  YAMON
start       (R/W)  load; go
subnetmask  (R/W)  255.255.255.0

I have another query about a different board - the Alchemy Encore M3
which has the same processor, AU1500, as the DB1500 above.

The ENM3 has a VIA Southbridge on the PCI bus.  The serial port on the
Southbridge is connected to the board.  Now I want to 'see' what is
happening during the boot process, thus, want to see messages being
output, through the serial port.  A UART driver is thus no good.

It has been suggested that I write a TLB entry during the initial
booting process (eg. when the memory is mapped, timer interrupt is set
up etc.) to route all the printk outputs to the serial port (which will
be 'hardcoded').  However, I am really not sure how to do this!  I m
confused about this:
- if this entry is written, what should point to the address in
question? 
- should it just be one address or a chunk of addresses so that longer
messages maybe printed?  If this question doesnt make sense, then I
think I m unclear on the actual process of what actually happens when
the kernel comes into the picture.  Are there any links that will help
clarify the matter? I have already looked at 
http://www.linux-mips.org/wiki/Porting  and
http://linux.junsun.net/porting-howto/

I am reading the following books:

1) Understanding the Linux Kernel - for 2.4 kernel
2) Linux Device Drivers: again for the 2.4 kernel
3) Linux Kernel Development (kernel 2.6)

Please shed some light on this cus I think I m just trying to make
guesses in the dark!

I really appreciate all the help I have gotten so far and thanks in
advance for your replies.

Regards,
Ashlesha.


From daniel@caiaq.de Thu Jul 27 03:32:10 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Jul 2006 03:32:21 +0100 (BST)
Received: from buzzloop.caiaq.de ([212.112.241.133]:13062 "EHLO
	buzzloop.caiaq.de") by ftp.linux-mips.org with ESMTP
	id S8134001AbWG0CcH (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 27 Jul 2006 03:32:07 +0100
Received: from localhost (localhost [127.0.0.1])
	by buzzloop.caiaq.de (Postfix) with ESMTP id 8545B7F4028;
	Thu, 27 Jul 2006 04:32:05 +0200 (CEST)
Received: from buzzloop.caiaq.de ([127.0.0.1])
	by localhost (buzzloop [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 26478-05; Thu, 27 Jul 2006 04:32:05 +0200 (CEST)
Received: by buzzloop.caiaq.de (Postfix, from userid 1000)
	id 48C9B7F4024; Thu, 27 Jul 2006 04:32:05 +0200 (CEST)
Date:	Thu, 27 Jul 2006 04:32:05 +0200
From:	Daniel Mack <daniel@caiaq.de>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] fix irq_chip struct for Pb1200/Db1200 platform
Message-ID: <20060727023204.GA28793@ipxXXXXX>
References: <2F5D781B-2119-4942-82C1-70B5037F5622@caiaq.de> <20060714161128.GB15427@linux-mips.org> <20060715005747.GA21358@ipxXXXXX> <20060715043941.GA3587@linux-mips.org> <20060715091614.GB21737@ipxXXXXX>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060715091614.GB21737@ipxXXXXX>
User-Agent: Mutt/1.5.11
Return-Path: <daniel@caiaq.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: 12088
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: daniel@caiaq.de
Precedence: bulk
X-list: linux-mips

On Sat, Jul 15, 2006 at 11:16:14AM +0200, Daniel Mack wrote:
> http://caiaq.org/linux-mips/patches/irq_chip_pb1200.patch

What about this one? Did it apply now?

Daniel


From vagabon.xyz@gmail.com Thu Jul 27 10:01:32 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Jul 2006 10:01:42 +0100 (BST)
Received: from nf-out-0910.google.com ([64.233.182.189]:10412 "EHLO
	nf-out-0910.google.com") by ftp.linux-mips.org with ESMTP
	id S8133372AbWG0JB3 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 27 Jul 2006 10:01:29 +0100
Received: by nf-out-0910.google.com with SMTP id q29so92478nfc
        for <linux-mips@linux-mips.org>; Thu, 27 Jul 2006 02:01:27 -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=KXdXECXv/BUDirNB6IH8QkJ6p6acXvGrgRKoZksJOM4ekOJkJtPtIRh7SGxn3KZ9VGLsMkuxaCuK21c4c8WjFn8xiXCV60d0QlFdo3zaQQh1YfafMiPQLyuDbsYdTLUjmrrT3J54RoLbJC/EKezzQ/vOPiXaG2HmmD138aI9GXE=
Received: by 10.48.240.10 with SMTP id n10mr1546511nfh;
        Thu, 27 Jul 2006 02:01:27 -0700 (PDT)
Received: from ?192.168.0.24? ( [194.3.162.233])
        by mx.gmail.com with ESMTP id p43sm448014nfa.2006.07.27.02.01.26;
        Thu, 27 Jul 2006 02:01:27 -0700 (PDT)
Message-ID: <44C880A9.1070402@innova-card.com>
Date:	Thu, 27 Jul 2006 11:00:25 +0200
Reply-To: Franck <vagabon.xyz@gmail.com>
User-Agent: Thunderbird 1.5.0.4 (X11/20060614)
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: <44B3625B.7000700@innova-card.com>	<20060711.222458.74752678.anemo@mba.ocn.ne.jp>	<44C77D49.90205@innova-card.com> <20060727.002153.41632148.anemo@mba.ocn.ne.jp>
In-Reply-To: <20060727.002153.41632148.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: 12089
X-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, 26 Jul 2006 16:33:45 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
>> I don't think that's correct to mark them as "reserved". Basicaly
>> "reserved" means that it belongs to the kernel (code or data), these
>> holes are not and we will end up to have wrong value as you pointed
>> out.
>>
>> Having quick look at sparsemem code, I don't think that it expects
>> to have holes inside a section, do it ? If so you probably have to
>> fix up your section size...
> 
> Yes, for such small holes, sparsemem and flatmem is same.  We can use
> smaller section size to save more memory, but I suppose it will be a
> bit slower.
> 

I'm suprised that sparsemem code doens't check for holes inside
sections. I would feel really more confortable to use sparsemem if a
check like the following patch exists. We could safely use pfn_valid()
in _any_ cases and if holes exist inside sections then the user have
to fix up its section sizes.

what do you think ?

		Franck

-- >8 --

diff --git a/mm/sparse.c b/mm/sparse.c
index 86c52ab..4c29a13 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -119,6 +119,13 @@ void memory_present(int nid, unsigned lo
 {
 	unsigned long pfn;
 
+	if (start & (PAGES_PER_SECTION-1) || end & (PAGES_PER_SECTION-1)) {
+		printk(KERN_ERR "SPARSEMEM: memory area (%lx-%lx) creates a "
+		       "hole inside a section, fix your SECTION_SIZE_BITS "
+		       "value...\n", start, end);
+		BUG();
+	}
+	
 	start &= PAGE_SECTION_MASK;
 	for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) {
 		unsigned long section = pfn_to_section_nr(pfn);


From treestem@gmail.com Thu Jul 27 12:35:28 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Jul 2006 12:35:36 +0100 (BST)
Received: from ug-out-1314.google.com ([66.249.92.175]:18181 "EHLO
	ug-out-1314.google.com") by ftp.linux-mips.org with ESMTP
	id S8133452AbWG0Lf2 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 27 Jul 2006 12:35:28 +0100
Received: by ug-out-1314.google.com with SMTP id y2so184664uge
        for <linux-mips@linux-mips.org>; Thu, 27 Jul 2006 04:35:27 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references;
        b=Aimc+1ifDFmRNrFxSvIhUQYw7eytev1iiDqHDxxvXQJ6Rf8l7GXSTCKc0wpiQqNQ2g4IdRSQuDwevx7TFic36Pc5IQTD+X8bDkS9YBPZ4n0ro81Fn94j9aRJ4wyIA/e2Jw+pH7IZsDOhRsRRBP6Wz6GUzHamWgjfBOmcUHgKNNk=
Received: by 10.66.220.17 with SMTP id s17mr7074813ugg;
        Thu, 27 Jul 2006 04:35:26 -0700 (PDT)
Received: by 10.67.23.12 with HTTP; Thu, 27 Jul 2006 04:35:26 -0700 (PDT)
Message-ID: <218a54980607270435y778c4b79w5b9bb0fb0a435aa@mail.gmail.com>
Date:	Thu, 27 Jul 2006 07:35:26 -0400
From:	"Peter Watkins" <treestem@gmail.com>
To:	linux-mips@linux-mips.org
Subject: [PATCH] For N32 rt_sigqueueinfo uses O32 padding, not N64.
In-Reply-To: <218a54980607261642i55966303r791f29791bab5588@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_20871_31264724.1154000126872"
References: <218a54980607261642i55966303r791f29791bab5588@mail.gmail.com>
Return-Path: <treestem@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: 12090
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: treestem@gmail.com
Precedence: bulk
X-list: linux-mips

------=_Part_20871_31264724.1154000126872
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

 For N32 rt_sigqueueinfo uses O32 padding, not N64.

------=_Part_20871_31264724.1154000126872
Content-Type: application/octet-stream; name=patch-scall64
Content-Transfer-Encoding: base64
X-Attachment-Id: f_eq4cc60u
Content-Disposition: attachment; filename="patch-scall64"

RGF0ZTogV2VkLCAyNiBKdWwgMjAwNiAxOToyNjoxMiAtMDQwMApTdWJqZWN0OiBGb3IgTjMyIHJ0
X3NpZ3F1ZXVlaW5mbyB1c2VzIE8zMiBwYWRkaW5nLCBub3QgTjY0LgotLS0KIGFyY2gvbWlwcy9r
ZXJuZWwvc2NhbGw2NC1uMzIuUyB8ICAgIDIgKy0KIDEgZmlsZXMgY2hhbmdlZCwgMSBpbnNlcnRp
b25zKCspLCAxIGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2FyY2gvbWlwcy9rZXJuZWwvc2Nh
bGw2NC1uMzIuUyBiL2FyY2gvbWlwcy9rZXJuZWwvc2NhbGw2NC1uMzIuUwppbmRleCA5OGFiYmM1
Li41NDliNGJjIDEwMDY0NAotLS0gYS9hcmNoL21pcHMva2VybmVsL3NjYWxsNjQtbjMyLlMKKysr
IGIvYXJjaC9taXBzL2tlcm5lbC9zY2FsbDY0LW4zMi5TCkBAIC0yNDcsNyArMjQ3LDcgQEAgRVhQ
T1JUKHN5c24zMl9jYWxsX3RhYmxlKQogCVBUUglzeXNfY2Fwc2V0CiAJUFRSCXN5czMyX3J0X3Np
Z3BlbmRpbmcJCS8qIDYxMjUgKi8KIAlQVFIJY29tcGF0X3N5c19ydF9zaWd0aW1lZHdhaXQKLQlQ
VFIJc3lzX3J0X3NpZ3F1ZXVlaW5mbworCVBUUglzeXMzMl9ydF9zaWdxdWV1ZWluZm8KIAlQVFIJ
c3lzbjMyX3J0X3NpZ3N1c3BlbmQKIAlQVFIJc3lzMzJfc2lnYWx0c3RhY2sKIAlQVFIJY29tcGF0
X3N5c191dGltZQkJLyogNjEzMCAqLwotLSAKMS40LjEKCg==
------=_Part_20871_31264724.1154000126872--

From treestem@gmail.com Thu Jul 27 12:43:31 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Jul 2006 12:43:40 +0100 (BST)
Received: from ug-out-1314.google.com ([66.249.92.170]:50198 "EHLO
	ug-out-1314.google.com") by ftp.linux-mips.org with ESMTP
	id S8134006AbWG0Lnb (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 27 Jul 2006 12:43:31 +0100
Received: by ug-out-1314.google.com with SMTP id y2so187402uge
        for <linux-mips@linux-mips.org>; Thu, 27 Jul 2006 04:43:31 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references;
        b=CIre+qD1mvO0oduxFBqg3G/mb3L9f9+f3lyTspyuTxNK86CfjNla0UMHJ4fQ2ZXhDmralhlKbNG3vFEmK2u/80+hbIcRtgMj23dGxUavPVr/CJ2BS3R9h3/4J4U1GXODz62q9TCjVbywUOHsV3q/+H4J9rt1jNwky4G6h6Gd9PI=
Received: by 10.66.244.10 with SMTP id r10mr6975320ugh;
        Thu, 27 Jul 2006 04:43:31 -0700 (PDT)
Received: by 10.67.23.12 with HTTP; Thu, 27 Jul 2006 04:43:31 -0700 (PDT)
Message-ID: <218a54980607270443i7b896d68p2a048a6ba8b0f37e@mail.gmail.com>
Date:	Thu, 27 Jul 2006 07:43:31 -0400
From:	"Peter Watkins" <treestem@gmail.com>
To:	linux-mips@linux-mips.org
Subject: [PATCH] For N32 rt_sigqueueinfo uses O32 padding, not N64.
In-Reply-To: <218a54980607270435y778c4b79w5b9bb0fb0a435aa@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_21019_33340978.1154000611443"
References: <218a54980607261642i55966303r791f29791bab5588@mail.gmail.com>
	 <218a54980607270435y778c4b79w5b9bb0fb0a435aa@mail.gmail.com>
Return-Path: <treestem@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: 12091
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: treestem@gmail.com
Precedence: bulk
X-list: linux-mips

------=_Part_21019_33340978.1154000611443
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

 For N32 rt_sigqueueinfo uses O32 padding, not N64.

------=_Part_21019_33340978.1154000611443
Content-Type: application/octet-stream; name=patch-scall64
Content-Transfer-Encoding: base64
X-Attachment-Id: f_eq4cc60u
Content-Disposition: attachment; filename="patch-scall64"

RGF0ZTogV2VkLCAyNiBKdWwgMjAwNiAxOToyNjoxMiAtMDQwMApTdWJqZWN0OiBGb3IgTjMyIHJ0
X3NpZ3F1ZXVlaW5mbyB1c2VzIE8zMiBwYWRkaW5nLCBub3QgTjY0LgotLS0KIGFyY2gvbWlwcy9r
ZXJuZWwvc2NhbGw2NC1uMzIuUyB8ICAgIDIgKy0KIDEgZmlsZXMgY2hhbmdlZCwgMSBpbnNlcnRp
b25zKCspLCAxIGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2FyY2gvbWlwcy9rZXJuZWwvc2Nh
bGw2NC1uMzIuUyBiL2FyY2gvbWlwcy9rZXJuZWwvc2NhbGw2NC1uMzIuUwppbmRleCA5OGFiYmM1
Li41NDliNGJjIDEwMDY0NAotLS0gYS9hcmNoL21pcHMva2VybmVsL3NjYWxsNjQtbjMyLlMKKysr
IGIvYXJjaC9taXBzL2tlcm5lbC9zY2FsbDY0LW4zMi5TCkBAIC0yNDcsNyArMjQ3LDcgQEAgRVhQ
T1JUKHN5c24zMl9jYWxsX3RhYmxlKQogCVBUUglzeXNfY2Fwc2V0CiAJUFRSCXN5czMyX3J0X3Np
Z3BlbmRpbmcJCS8qIDYxMjUgKi8KIAlQVFIJY29tcGF0X3N5c19ydF9zaWd0aW1lZHdhaXQKLQlQ
VFIJc3lzX3J0X3NpZ3F1ZXVlaW5mbworCVBUUglzeXMzMl9ydF9zaWdxdWV1ZWluZm8KIAlQVFIJ
c3lzbjMyX3J0X3NpZ3N1c3BlbmQKIAlQVFIJc3lzMzJfc2lnYWx0c3RhY2sKIAlQVFIJY29tcGF0
X3N5c191dGltZQkJLyogNjEzMCAqLwotLSAKMS40LjEKCg==
------=_Part_21019_33340978.1154000611443--

From vagabon.xyz@gmail.com Thu Jul 27 15:34:22 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Jul 2006 15:34:34 +0100 (BST)
Received: from nf-out-0910.google.com ([64.233.182.184]:30412 "EHLO
	nf-out-0910.google.com") by ftp.linux-mips.org with ESMTP
	id S8134016AbWG0OeW (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 27 Jul 2006 15:34:22 +0100
Received: by nf-out-0910.google.com with SMTP id q29so188316nfc
        for <linux-mips@linux-mips.org>; Thu, 27 Jul 2006 07:34:11 -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=ULbKCUXxxgj9z8m2p1yvkYXBU8eycm6j0S3p6LwPqon4DyJ6qEymIj2aN8XPw5as88fCCfHQC4KyYWiOJG6K+Klf8oRUoWYiXUL9VfPy/BaNO+fLF0ns9zxtglj4j5Tl5bgRybpqTMCKs2jUiI6vLWXzt7m+TlN+tg64U49TEt4=
Received: by 10.48.240.10 with SMTP id n10mr78861nfh;
        Thu, 27 Jul 2006 07:34:11 -0700 (PDT)
Received: from ?192.168.0.24? ( [194.3.162.233])
        by mx.gmail.com with ESMTP id p43sm814927nfa.2006.07.27.07.34.10;
        Thu, 27 Jul 2006 07:34:11 -0700 (PDT)
Message-ID: <44C8CEA4.20000@innova-card.com>
Date:	Thu, 27 Jul 2006 16:33:08 +0200
Reply-To: Franck <vagabon.xyz@gmail.com>
User-Agent: Thunderbird 1.5.0.4 (X11/20060614)
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] dump_stack() based on prologue code analysis
References: <20060726.232231.59465336.anemo@mba.ocn.ne.jp>
In-Reply-To: <20060726.232231.59465336.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: 12092
X-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

Hi Atsushi ;)

Atsushi Nemoto wrote:
> Instead of dump all possible address in the stack, unwind the stack
> frame based on prologue code analysis, as like as get_chan() does.
> While the code analysis might fail for some reason, there is a new
> kernel option "raw_show_trace" to disable this feature.
> 
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
> 
> diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
> index 7ab67f7..8f1a5fe 100644
> --- a/arch/mips/kernel/process.c
> +++ b/arch/mips/kernel/process.c
> @@ -281,7 +281,7 @@ static struct mips_frame_info {
>  } *schedule_frame, mfinfo[64];
>  static int mfinfo_num;
>  
> -static int __init get_frame_info(struct mips_frame_info *info)
> +static int get_frame_info(struct mips_frame_info *info)
>  {
>  	int i;
>  	void *func = info->func;
> @@ -329,12 +329,6 @@ #endif
>  				ip->i_format.simmediate / sizeof(long);
>  		}
>  	}
> -	if (info->pc_offset == -1 || info->frame_size == 0) {
> -		if (func == schedule)
> -			printk("Can't analyze prologue code at %p\n", func);
> -		info->pc_offset = -1;
> -		info->frame_size = 0;
> -	}
>  
>  	return 0;
>  }
> @@ -367,8 +361,17 @@ #else
>  	mfinfo[0].func = schedule;
>  	schedule_frame = &mfinfo[0];
>  #endif
> -	for (i = 0; i < ARRAY_SIZE(mfinfo) && mfinfo[i].func; i++)
> -		get_frame_info(&mfinfo[i]);
> +	for (i = 0; i < ARRAY_SIZE(mfinfo) && mfinfo[i].func; i++) {
> +		struct mips_frame_info *info = &mfinfo[i];
> +		get_frame_info(info);
> +		if (info->pc_offset < 0 || info->frame_size == 0) {
> +			if (info->func == schedule)

This can't happen since "schedule" is not a leaf function. Something I'm
missing here but I would have said:

			if (func != schedule)

instead, no ?

> +				printk("Can't analyze prologue code at %p\n",
> +				       info->func);
> +			info->pc_offset = -1;
> +			info->frame_size = 0;
> +		}
> +	}
>  
>  	mfinfo_num = i;
>  	return 0;
> @@ -437,3 +440,41 @@ #endif
>  	return pc;
>  }
>  
> +#ifdef CONFIG_KALLSYMS
> +/* used by show_frametrace() */
> +unsigned long unwind_stack(struct task_struct *task,
> +			   unsigned long **sp, unsigned long pc)
> +{
> +	unsigned long stack_page;
> +	struct mips_frame_info info;
> +	char *modname;
> +	char namebuf[KSYM_NAME_LEN + 1];
> +	unsigned long size, ofs;
> +
> +	stack_page = (unsigned long)task_stack_page(task);
> +	if (!stack_page)
> +		return 0;
> +
> +	if (!kallsyms_lookup(pc, &size, &ofs, &modname, namebuf))
> +		return 0;
> +	if (ofs == 0)
> +		return 0;
> +
> +	info.func = (void *)(pc - ofs);
> +	info.func_size = ofs;	/* analyze from start to ofs */
> +	get_frame_info(&info);
> +	if (info.pc_offset < 0 || !info.frame_size) {
> +		/* leaf? */

for leaf case, can't we simply do this test:

	if (info.pc_offset < 0) {

IOW, can a leaf function move sp ? I would say yes...

BTW why not let this logic inside get_frame_info() ? Hence this function
could return:

	if (info.frame_size && info.pc_offset > 0) /* nested */
		return 0;
	if (info.pc_offset < 0) /* leaf */
		return 1;
	/* prologue seems boggus... */
	printk("Can't analyze prologue code at %p\n", info->func);
	return -1;

> +		*sp += info.frame_size / sizeof(long);
> +		return 0;

why not returning:
		return regs->regs[31];

and removes the leaf detection logic in show_frametrace() ?

> +	}
> +	if ((unsigned long)*sp < stack_page ||
> +	    (unsigned long)*sp + info.frame_size / sizeof(long) >
> +	    stack_page + THREAD_SIZE - 32)
> +		return 0;
> +
> +	pc = (*sp)[info.pc_offset];
> +	*sp += info.frame_size / sizeof(long);
> +	return pc;

why not directly doing:

	return (*sp)[info.pc_offset];

and remove:

	pc = (*sp)[info.pc_offset];

> +}
> +#endif
> diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
> index c6f7046..bf36fcc 100644
> --- a/arch/mips/kernel/traps.c
> +++ b/arch/mips/kernel/traps.c
> @@ -98,24 +98,53 @@ #endif
>  	printk("\n");
>  }
>  
> +#ifdef CONFIG_KALLSYMS
> +static int raw_show_trace;
> +static int __init set_raw_show_trace(char *str)
> +{
> +	raw_show_trace = 1;
> +	return 1;
> +}
> +__setup("raw_show_trace", set_raw_show_trace);
> +
> +extern unsigned long unwind_stack(struct task_struct *task,
> +				  unsigned long **sp, unsigned long pc);
> +static void show_frametrace(struct task_struct *task, struct pt_regs *regs)
> +{
> +	const int field = 2 * sizeof(unsigned long);
> +	unsigned long *stack = (long *)regs->regs[29];

why not calling that "sp" ?

> +	unsigned long pc = regs->cp0_epc;
> +	int top = 1;
> +
> +	if (raw_show_trace || !__kernel_text_address(pc)) {
> +		show_trace(stack);
> +		return;
> +	}
> +	printk("Call Trace:\n");
> +	while (__kernel_text_address(pc)) {
> +		printk(" [<%0*lx>] ", field, pc);
> +		print_symbol("%s\n", pc);
> +		pc = unwind_stack(task, &stack, pc);
> +		if (top && pc == 0)
> +			pc = regs->regs[31];	/* leaf? */
> +		top = 0;
> +	}
> +	printk("\n");
> +}
> +#else
> +#define show_frametrace(task, r) show_trace((long *)(r)->regs[29]);
> +#endif
> +
>  /*
>   * This routine abuses get_user()/put_user() to reference pointers
>   * with at least a bit of error checking ...
>   */
> -void show_stack(struct task_struct *task, unsigned long *sp)
> +static void show_stacktrace(struct task_struct *task, struct pt_regs *regs)
>  {
>  	const int field = 2 * sizeof(unsigned long);
>  	long stackdata;
>  	int i;
> -	unsigned long *stack;
> -
> -	if (!sp) {
> -		if (task && task != current)
> -			sp = (unsigned long *) task->thread.reg29;
> -		else
> -			sp = (unsigned long *) &sp;
> -	}
> -	stack = sp;
> +	unsigned long *sp = (unsigned long *)regs->regs[29];
>  
>  	printk("Stack :");
>  	i = 0;
> @@ -136,7 +165,44 @@ void show_stack(struct task_struct *task
>  		i++;
>  	}
>  	printk("\n");
> -	show_trace(stack);
> +	show_frametrace(task, regs);
> +}
> +
> +static noinline void dump_stack_top(struct pt_regs *regs)

This sounds weird, you're actually dumping v0, ra, and sp, no ?
If so "dump_stack_top" seems not be appropriate, does it ?

> +{
> +	__asm__ __volatile__(
> +		"1: la $2, 1b\n\t"
> +#ifdef CONFIG_64BIT
> +		"sd $2, %0\n\t"
> +		"sd $29, %1\n\t"
> +		"sd $31, %2\n\t"
> +#else
> +		"sw $2, %0\n\t"
> +		"sw $29, %1\n\t"
> +		"sw $31, %2\n\t"
> +#endif
> +		: "=m" (regs->cp0_epc),
> +		"=m" (regs->regs[29]), "=m" (regs->regs[31])
> +		: : "memory");
> +}
> +
> +void show_stack(struct task_struct *task, unsigned long *sp)
> +{
> +	struct pt_regs regs;
> +	if (sp) {
> +		regs.regs[29] = (unsigned long)sp;
> +		regs.regs[31] = 0;
> +		regs.cp0_epc = 0;
> +	} else {
> +		if (task && task != current) {
> +			regs.regs[29] = task->thread.reg29;
> +			regs.regs[31] = 0;
> +			regs.cp0_epc = task->thread.reg31;
> +		} else {
> +			dump_stack_top(&regs);
> +		}
> +	}
> +	show_stacktrace(task, &regs);
>  }
>  
>  /*
> @@ -146,6 +212,14 @@ void dump_stack(void)
>  {
>  	unsigned long stack;
>  
> +#ifdef CONFIG_KALLSYMS
> +	if (!raw_show_trace) {
> +		struct pt_regs regs;
> +		dump_stack_top(&regs);
> +		show_frametrace(current, &regs);
> +		return;
> +	}
> +#endif
>  	show_trace(&stack);
>  }
>  
> @@ -265,7 +339,7 @@ void show_registers(struct pt_regs *regs
>  	print_modules();
>  	printk("Process %s (pid: %d, threadinfo=%p, task=%p)\n",
>  	        current->comm, current->pid, current_thread_info(), current);
> -	show_stack(current, (long *) regs->regs[29]);
> +	show_stacktrace(current, regs);
>  	show_code((unsigned int *) regs->cp0_epc);
>  	printk("\n");
>  }
> 
> 


From swang@eventmine.com Thu Jul 27 16:53:54 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Jul 2006 16:54:04 +0100 (BST)
Received: from cluster-a.mailcontroller.altohiway.com ([213.83.66.193]:26603
	"EHLO cluster-a.mailcontroller.altohiway.com") by ftp.linux-mips.org
	with ESMTP id S8134022AbWG0Pxy (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 27 Jul 2006 16:53:54 +0100
Received: from efs01.eventmine.local (host-212-158-201-87.bulldogdsl.com [212.158.201.87])
	by rlya6a.mailcontroller.altohiway.com (MailControl) with SMTP id k6RFrlTr009217
	for <linux-mips@linux-mips.org>; Thu, 27 Jul 2006 16:53:47 +0100
Content-class: urn:content-classes:message
Subject: is sde lite a complete toolchain?
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C6B194.D8D498EE"
Date:	Thu, 27 Jul 2006 16:53:47 +0100
X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
Message-ID: <583C102FDFBE2E4FB8ADF0D680B0798C0B53CB@efs01.eventmine.local>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: is sde lite a complete toolchain?
Thread-Index: AcaxlNiWg1ugYcxmR2GbTjm4BJ3SKg==
From:	"Shan Wang" <swang@eventmine.com>
To:	<linux-mips@linux-mips.org>
X-Scanned-By: MailControl A-06-00-05 (www.mailcontrol.com) on 10.60.0.116
Return-Path: <swang@eventmine.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: 12093
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: swang@eventmine.com
Precedence: bulk
X-list: linux-mips

This is a multi-part message in MIME format.

------_=_NextPart_001_01C6B194.D8D498EE
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi all,

=20

I downloaded the SDE lite toolchain from MIPS Technologies. I can use
the makefiles to build all the examples come with the package and test
them with the simulator. But when I tried to use sde-gcc to cross
compile the hello world example directly:

=20

sde-gcc -Wall -mips32 -mtune=3D4kc -EL hello.c -o hello

=20

I got errors like the following:

/home/linuxdev/packages/sde-lite-linux/bin/../lib/gcc/sde/3.4.4/../../..
/../sde/bin/ld: warning: cannot find entry symbol __start;

 defaulting to 0000000080020000

/tmp/ccEaLxlW.o: In function `main':

hello.c:(.text+0x20): undefined reference to `printf'

hello.c:(.text+0x20): relocation truncated to fit: R_MIPS_26 against
`printf'

collect2: ld returned 1 exit status

=20

=20

Does that mean the SDE lite package is not a complete cross toolchain,
can I use it to compile my own application?=20

=20

Any help will be appropriated, thanks very much.

=20

=20

Best Regards,

=20

Shan



This message has been scanned by MailController - www.MailController.altohi=
way.com

------_=_NextPart_001_01C6B194.D8D498EE
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

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

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
@page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>Hi all,<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>I downloaded the SDE lite toolchain from MIPS
Technologies. I can use the makefiles to build all the examples come with t=
he
package and test them with the simulator. But when I tried to use sde-gcc to
cross compile the hello world example directly:<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>sde-gcc -Wall -mips32 -mtune=3D4kc -EL hello.c -o=
 hello<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>I got errors like the following:<o:p></o:p></span=
></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>/home/linuxdev/packages/sde-lite-linux/bin/../lib=
/gcc/sde/3.4.4/../../../../sde/bin/ld:
warning: cannot find entry symbol __start;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>&nbsp;defaulting to 0000000080020000<o:p></o:p></=
span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>/tmp/ccEaLxlW.o: In function `main':<o:p></o:p></=
span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>hello.c:(.text+0x20): undefined reference to `pri=
ntf'<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>hello.c:(.text+0x20): relocation truncated to fit:
R_MIPS_26 against `printf'<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>collect2: ld returned 1 exit status<o:p></o:p></s=
pan></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>Does that mean the SDE lite package is not a comp=
lete
cross toolchain, can I use it to compile my own application? <o:p></o:p></s=
pan></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>Any help will be appropriated, thanks very much.<=
o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>Best Regards,<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB style=
=3D'font-size:
10.0pt;font-family:Arial'>Shan<o:p></o:p></span></font></p>

</div>

<br><br>
<P align=3Dcenter>This message has been scanned by <A href=3D"http://www.ma=
ilcontroller.altohiway.com/">MailController</A>.</P>
</body>

</html>

------_=_NextPart_001_01C6B194.D8D498EE--

From ddaney@avtrex.com Thu Jul 27 17:55:07 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Jul 2006 17:55:16 +0100 (BST)
Received: from smtp1.dnsmadeeasy.com ([205.234.170.134]:45971 "EHLO
	smtp1.dnsmadeeasy.com") by ftp.linux-mips.org with ESMTP
	id S8133592AbWG0QzH (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 27 Jul 2006 17:55:07 +0100
Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id 44AA5B0B4C;
	Thu, 27 Jul 2006 13:07:48 -0400 (EDT)
X-Authenticated-Name: js.dnsmadeeasy
X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com
Received: from avtrex.com (unknown [67.116.42.147])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP;
	Thu, 27 Jul 2006 13:07:48 -0400 (EDT)
Received: from [192.168.7.26] ([192.168.7.26]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 27 Jul 2006 09:54:58 -0700
Message-ID: <44C8EFE2.4010102@avtrex.com>
Date:	Thu, 27 Jul 2006 09:54:58 -0700
From:	David Daney <ddaney@avtrex.com>
User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc3 (X11/20050929)
X-Accept-Language: en-us, 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] dump_stack() based on prologue code analysis
References: <20060726.232231.59465336.anemo@mba.ocn.ne.jp>
In-Reply-To: <20060726.232231.59465336.anemo@mba.ocn.ne.jp>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 27 Jul 2006 16:54:58.0471 (UTC) FILETIME=[64BCBB70:01C6B19D]
Return-Path: <ddaney@avtrex.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12095
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ddaney@avtrex.com
Precedence: bulk
X-list: linux-mips
Content-Length: 981
Lines: 24

Atsushi Nemoto wrote:
> Instead of dump all possible address in the stack, unwind the stack
> frame based on prologue code analysis, as like as get_chan() does.
> While the code analysis might fail for some reason, there is a new
> kernel option "raw_show_trace" to disable this feature.
> 
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

Let me start by saying I have not analyzed how all this code works, but 
I have done something similar in user space.

Since the kernel ABI does not use gp, many functions may not have a 
prolog (especially when compiled with newer versions of GCC).  In the 
user space case, most leaf functions have no prolog.  For the kernel I 
would imagine that many non-leaf functions (simple non-leaf functions 
that do only a tail call) would also not have a prolog.

I would be worried that many stack traces would become less useful.

If this were conditional on -fno-omit-frame-pointer, then I think it 
would be a good idea.

David Daney.


From ths@networkno.de Thu Jul 27 18:03:44 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Jul 2006 18:03:55 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:12928 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8133593AbWG0RDo (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 27 Jul 2006 18:03: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 CC936469AB; Thu, 27 Jul 2006 19:03:36 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1G69GL-00012R-Np; Thu, 27 Jul 2006 18:03:05 +0100
Date:	Thu, 27 Jul 2006 18:03:05 +0100
To:	David Daney <ddaney@avtrex.com>
Cc:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>, linux-mips@linux-mips.org,
	ralf@linux-mips.org
Subject: Re: [PATCH] dump_stack() based on prologue code analysis
Message-ID: <20060727170305.GB4505@networkno.de>
References: <20060726.232231.59465336.anemo@mba.ocn.ne.jp> <44C8EFE2.4010102@avtrex.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <44C8EFE2.4010102@avtrex.com>
User-Agent: Mutt/1.5.12-2006-07-14
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: 12096
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ths@networkno.de
Precedence: bulk
X-list: linux-mips
Content-Length: 937
Lines: 23

David Daney wrote:
> Atsushi Nemoto wrote:
> >Instead of dump all possible address in the stack, unwind the stack
> >frame based on prologue code analysis, as like as get_chan() does.
> >While the code analysis might fail for some reason, there is a new
> >kernel option "raw_show_trace" to disable this feature.
> >
> >Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
> 
> Let me start by saying I have not analyzed how all this code works, but 
> I have done something similar in user space.
> 
> Since the kernel ABI does not use gp, many functions may not have a 
> prolog (especially when compiled with newer versions of GCC).  In the 
> user space case, most leaf functions have no prolog.  For the kernel I 
> would imagine that many non-leaf functions (simple non-leaf functions 
> that do only a tail call) would also not have a prolog.

Non-leaves have to save/restore $31 somewhere, so there should be a
prologue.


Thiemo

From ths@networkno.de Thu Jul 27 18:10:13 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Jul 2006 18:10:23 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:36737 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8134062AbWG0RKN (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 27 Jul 2006 18:10:13 +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 7046D469C6; Thu, 27 Jul 2006 19:10:13 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1G68Xz-0000iX-E0; Thu, 27 Jul 2006 17:17:15 +0100
Date:	Thu, 27 Jul 2006 17:17:15 +0100
To:	Shan Wang <swang@eventmine.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: is sde lite a complete toolchain?
Message-ID: <20060727161715.GA4505@networkno.de>
References: <583C102FDFBE2E4FB8ADF0D680B0798C0B53CB@efs01.eventmine.local>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <583C102FDFBE2E4FB8ADF0D680B0798C0B53CB@efs01.eventmine.local>
User-Agent: Mutt/1.5.12-2006-07-14
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: 12097
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ths@networkno.de
Precedence: bulk
X-list: linux-mips
Content-Length: 1383
Lines: 45

Shan Wang wrote:
> Hi all,
> 
>  
> 
> I downloaded the SDE lite toolchain from MIPS Technologies. I can use
> the makefiles to build all the examples come with the package and test
> them with the simulator. But when I tried to use sde-gcc to cross
> compile the hello world example directly:

Note that those examples are for a bare-metal embedded system without OS,
they won't work on Linux/MIPS.

> sde-gcc -Wall -mips32 -mtune=4kc -EL hello.c -o hello

Also, sde-gcc is a compiler for embedded ELF targets, it won't produce
Linux binaries.

> I got errors like the following:
> 
> /home/linuxdev/packages/sde-lite-linux/bin/../lib/gcc/sde/3.4.4/../../..
> /../sde/bin/ld: warning: cannot find entry symbol __start;
> 
>  defaulting to 0000000080020000
> 
> /tmp/ccEaLxlW.o: In function `main':
> 
> hello.c:(.text+0x20): undefined reference to `printf'
> 
> hello.c:(.text+0x20): relocation truncated to fit: R_MIPS_26 against
> `printf'
> 
> collect2: ld returned 1 exit status

This is the expected result, since your command line misses to include
the necessary libraries and the board support package.

> Does that mean the SDE lite package is not a complete cross toolchain,
> can I use it to compile my own application? 

This depends on what your target platform is. If it is Linux/MIPS, you
may want to have a look at http://www.linux-mips.org/wiki/Toolchains.


Thiemo

From ddaney@avtrex.com Thu Jul 27 18:27:51 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Jul 2006 18:28:01 +0100 (BST)
Received: from smtp1.dnsmadeeasy.com ([205.234.170.134]:52404 "EHLO
	smtp1.dnsmadeeasy.com") by ftp.linux-mips.org with ESMTP
	id S8133593AbWG0R1v (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 27 Jul 2006 18:27:51 +0100
Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id 62313B0C00;
	Thu, 27 Jul 2006 13:40:33 -0400 (EDT)
X-Authenticated-Name: js.dnsmadeeasy
X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com
Received: from avtrex.com (unknown [67.116.42.147])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP;
	Thu, 27 Jul 2006 13:40:32 -0400 (EDT)
Received: from [192.168.7.26] ([192.168.7.26]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 27 Jul 2006 10:27:43 -0700
Message-ID: <44C8F78E.50406@avtrex.com>
Date:	Thu, 27 Jul 2006 10:27:42 -0700
From:	David Daney <ddaney@avtrex.com>
User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc3 (X11/20050929)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	Thiemo Seufer <ths@networkno.de>
Cc:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>, linux-mips@linux-mips.org,
	ralf@linux-mips.org
Subject: Re: [PATCH] dump_stack() based on prologue code analysis
References: <20060726.232231.59465336.anemo@mba.ocn.ne.jp> <44C8EFE2.4010102@avtrex.com> <20060727170305.GB4505@networkno.de>
In-Reply-To: <20060727170305.GB4505@networkno.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 27 Jul 2006 17:27:43.0071 (UTC) FILETIME=[F7BAE6F0:01C6B1A1]
Return-Path: <ddaney@avtrex.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12098
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ddaney@avtrex.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1044
Lines: 30

Thiemo Seufer wrote:
> David Daney wrote:
> 
>>Atsushi Nemoto wrote:
>>
>>>Instead of dump all possible address in the stack, unwind the stack
>>>frame based on prologue code analysis, as like as get_chan() does.
>>>While the code analysis might fail for some reason, there is a new
>>>kernel option "raw_show_trace" to disable this feature.
>>>
>>>Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
>>
>>Let me start by saying I have not analyzed how all this code works, but 
>>I have done something similar in user space.
>>
>>Since the kernel ABI does not use gp, many functions may not have a 
>>prolog (especially when compiled with newer versions of GCC).  In the 
>>user space case, most leaf functions have no prolog.  For the kernel I 
>>would imagine that many non-leaf functions (simple non-leaf functions 
>>that do only a tail call) would also not have a prolog.
> 
> 
> Non-leaves have to save/restore $31 somewhere, so there should be a
> prologue.

OK, good point.

But there is still the leaf function problem.

David Daney.

From vagabon.xyz@gmail.com Thu Jul 27 19:51:19 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Jul 2006 19:51:28 +0100 (BST)
Received: from ug-out-1314.google.com ([66.249.92.174]:48834 "EHLO
	ug-out-1314.google.com") by ftp.linux-mips.org with ESMTP
	id S8133577AbWG0SvT (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 27 Jul 2006 19:51:19 +0100
Received: by ug-out-1314.google.com with SMTP id y2so382720uge
        for <linux-mips@linux-mips.org>; Thu, 27 Jul 2006 11:51:18 -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=CIxcd9XT/SazVaR6EkmAbHR78T0PlIljlyg1dktNayWneg1eMOVOCClTbFWmy3i+svoyNm7cFbkvb49ETAXPupaPzid2ubJAk2MbrReqOYJIAspib7ppGIZPiQsvV8Qsw6+IloE3O+QhQTeuy6hTvmh+QsGxWx6hnfy+YQBw/Zs=
Received: by 10.67.29.12 with SMTP id g12mr7564180ugj;
        Thu, 27 Jul 2006 11:51:17 -0700 (PDT)
Received: by 10.67.87.8 with HTTP; Thu, 27 Jul 2006 11:51:17 -0700 (PDT)
Message-ID: <cda58cb80607271151n2dcfe64cn4cb1ecca3ece6b1e@mail.gmail.com>
Date:	Thu, 27 Jul 2006 20:51:17 +0200
From:	"Franck Bui-Huu" <vagabon.xyz@gmail.com>
To:	"Thiemo Seufer" <ths@networkno.de>
Subject: Re: [PATCH] dump_stack() based on prologue code analysis
Cc:	"David Daney" <ddaney@avtrex.com>,
	"Atsushi Nemoto" <anemo@mba.ocn.ne.jp>, linux-mips@linux-mips.org,
	ralf@linux-mips.org
In-Reply-To: <20060727170305.GB4505@networkno.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <20060726.232231.59465336.anemo@mba.ocn.ne.jp>
	 <44C8EFE2.4010102@avtrex.com> <20060727170305.GB4505@networkno.de>
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: 12099
X-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
Content-Length: 1856
Lines: 53

2006/7/27, Thiemo Seufer <ths@networkno.de>:
> David Daney wrote:
> > Atsushi Nemoto wrote:
> > >Instead of dump all possible address in the stack, unwind the stack
> > >frame based on prologue code analysis, as like as get_chan() does.
> > >While the code analysis might fail for some reason, there is a new
> > >kernel option "raw_show_trace" to disable this feature.
> > >
> > >Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
> >
> > Let me start by saying I have not analyzed how all this code works, but
> > I have done something similar in user space.
> >
> > Since the kernel ABI does not use gp, many functions may not have a
> > prolog (especially when compiled with newer versions of GCC).  In the
> > user space case, most leaf functions have no prolog.  For the kernel I
> > would imagine that many non-leaf functions (simple non-leaf functions
> > that do only a tail call) would also not have a prolog.
>
> Non-leaves have to save/restore $31 somewhere, so there should be a
> prologue.
>

That's no always true. Consider this simple example:

void foo_wrapper(int a, int b)
{
        /* doing some checkings */
        [...];
        foo(a,b);
}

void foo(int a, intb)
{
        [...];
}

In foo_wrapper(), gcc will generate a "j" instruction (well I guess)
because once foo() is called and is finished, there's no needs to
return back to foo_wrapper(). In that case, foo_wrapper() won't have a
prologue.

But is it really needed to show that foo_wrapper() has been called
before foo() ? The backtrace given by oops is for the first debug
intervention. They don't give a very accurate backtrace but it's
enough to understand what's going on in most cases.

BTW, the same exists with inlined functions. Gcc can inlined function
that are not been marked inlined and these functions won't appear in
any traces...

-- 
               Franck

From vagabon.xyz@gmail.com Thu Jul 27 20:03:08 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Jul 2006 20:03:17 +0100 (BST)
Received: from ug-out-1314.google.com ([66.249.92.170]:46816 "EHLO
	ug-out-1314.google.com") by ftp.linux-mips.org with ESMTP
	id S8133438AbWG0TDI (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 27 Jul 2006 20:03:08 +0100
Received: by ug-out-1314.google.com with SMTP id o2so394331uge
        for <linux-mips@linux-mips.org>; Thu, 27 Jul 2006 12:03:07 -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=X6rTPwARg2edGpAAhLeq+Y3TGqOHqbN6X+SpcHjF0aR6W1kwIRmKReOZMStZj/0lfufYHpULzcv/oAfK9twJYUHxLinc8VjGaDRq9Qw+pFEjenrFJ4TGHf7kXQlt3BKE5UHpwuh8jStsfmqaj29K/NCdvbPALRwDbj2f8PwbghA=
Received: by 10.67.93.7 with SMTP id v7mr7589291ugl;
        Thu, 27 Jul 2006 12:03:07 -0700 (PDT)
Received: by 10.67.87.8 with HTTP; Thu, 27 Jul 2006 12:03:07 -0700 (PDT)
Message-ID: <cda58cb80607271203u70b26e23o65b71d3d0c900f94@mail.gmail.com>
Date:	Thu, 27 Jul 2006 21:03:07 +0200
From:	"Franck Bui-Huu" <vagabon.xyz@gmail.com>
To:	"Atsushi Nemoto" <anemo@mba.ocn.ne.jp>
Subject: Re: [PATCH] dump_stack() based on prologue code analysis
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
In-Reply-To: <44C8CEA4.20000@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: <20060726.232231.59465336.anemo@mba.ocn.ne.jp>
	 <44C8CEA4.20000@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: 12100
X-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
Content-Length: 1387
Lines: 47

one more comment,

2006/7/27, Franck Bui-Huu <vagabon.xyz@gmail.com>:
> Hi Atsushi ;)
>
> Atsushi Nemoto wrote:
> > +unsigned long unwind_stack(struct task_struct *task,
> > +                        unsigned long **sp, unsigned long pc)
> > +{
> > +     unsigned long stack_page;
> > +     struct mips_frame_info info;
> > +     char *modname;
> > +     char namebuf[KSYM_NAME_LEN + 1];
> > +     unsigned long size, ofs;
> > +
> > +     stack_page = (unsigned long)task_stack_page(task);
> > +     if (!stack_page)
> > +             return 0;
> > +
> > +     if (!kallsyms_lookup(pc, &size, &ofs, &modname, namebuf))
> > +             return 0;
> > +     if (ofs == 0)
> > +             return 0;
> > +
> > +     info.func = (void *)(pc - ofs);
> > +     info.func_size = ofs;   /* analyze from start to ofs */

in get_frame_info(), there is the following condition to stop the
prologue analysis

		if (info->func_size && i >= info->func_size / 4)
			break;

Setting info.func_size = ofs may trigger this stop condition very
early, specially if "ofs" is small...I would simply remove this
condition since it's very empirical and IMHO not very usefull.

> > +     get_frame_info(&info);
> > +     if (info.pc_offset < 0 || !info.frame_size) {
> > +             /* leaf? */
>
> for leaf case, can't we simply do this test:
>
>         if (info.pc_offset < 0) {

-- 
               Franck

From ths@networkno.de Thu Jul 27 20:13:17 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Jul 2006 20:13:26 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:4803 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8134030AbWG0TNR (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 27 Jul 2006 20:13:17 +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 1E9B5444E0; Thu, 27 Jul 2006 21:13:17 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1G6BHp-0001kP-K8; Thu, 27 Jul 2006 20:12:45 +0100
Date:	Thu, 27 Jul 2006 20:12:45 +0100
From:	Thiemo Seufer <ths@networkno.de>
To:	Franck Bui-Huu <vagabon.xyz@gmail.com>
Cc:	David Daney <ddaney@avtrex.com>,
	Atsushi Nemoto <anemo@mba.ocn.ne.jp>,
	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] dump_stack() based on prologue code analysis
Message-ID: <20060727191245.GD4505@networkno.de>
References: <20060726.232231.59465336.anemo@mba.ocn.ne.jp> <44C8EFE2.4010102@avtrex.com> <20060727170305.GB4505@networkno.de> <cda58cb80607271151n2dcfe64cn4cb1ecca3ece6b1e@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <cda58cb80607271151n2dcfe64cn4cb1ecca3ece6b1e@mail.gmail.com>
User-Agent: Mutt/1.5.12-2006-07-14
Return-Path: <ths@networkno.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12101
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ths@networkno.de
Precedence: bulk
X-list: linux-mips
Content-Length: 1793
Lines: 52

Franck Bui-Huu wrote:
> 2006/7/27, Thiemo Seufer <ths@networkno.de>:
> >David Daney wrote:
> >> Atsushi Nemoto wrote:
> >> >Instead of dump all possible address in the stack, unwind the stack
> >> >frame based on prologue code analysis, as like as get_chan() does.
> >> >While the code analysis might fail for some reason, there is a new
> >> >kernel option "raw_show_trace" to disable this feature.
> >> >
> >> >Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
> >>
> >> Let me start by saying I have not analyzed how all this code works, but
> >> I have done something similar in user space.
> >>
> >> Since the kernel ABI does not use gp, many functions may not have a
> >> prolog (especially when compiled with newer versions of GCC).  In the
> >> user space case, most leaf functions have no prolog.  For the kernel I
> >> would imagine that many non-leaf functions (simple non-leaf functions
> >> that do only a tail call) would also not have a prolog.
> >
> >Non-leaves have to save/restore $31 somewhere, so there should be a
> >prologue.
> >
> 
> That's no always true. Consider this simple example:
> 
> void foo_wrapper(int a, int b)
> {
>        /* doing some checkings */
>        [...];
>        foo(a,b);
> }
> 
> void foo(int a, intb)
> {
>        [...];
> }
> 
> In foo_wrapper(), gcc will generate a "j" instruction (well I guess)
> because once foo() is called and is finished, there's no needs to
> return back to foo_wrapper(). In that case, foo_wrapper() won't have a
> prologue.

Well, with tail call optimisation it isn't a true nested function any
more, the compiler can even reorder and/or combine functions in more
creative ways.

IOW, binary analysis can't be expected to provide full accuracy, but
we can live with a reasonable approximation, I think.


Thiemo

From volker@thalreit.de Thu Jul 27 21:55:11 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Jul 2006 21:55:20 +0100 (BST)
Received: from moutng.kundenserver.de ([212.227.126.177]:29143 "EHLO
	moutng.kundenserver.de") by ftp.linux-mips.org with ESMTP
	id S8133438AbWG0UzL (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 27 Jul 2006 21:55:11 +0100
Received: from [89.48.106.171] (helo=thalreit.de)
	by mrelayeu.kundenserver.de (node=mrelayeu3) with ESMTP (Nemesis),
	id 0MKxQS-1G6Csv3TO8-0000d5; Thu, 27 Jul 2006 22:55:10 +0200
Received: from eos.thalreit ([10.87.15.10] ident=Debian-exim)
	by thalreit.de with esmtp (Exim 4.51 (FreeBSD))
	id 1G6Csu-000Afm-IE
	for linux-mips@linux-mips.org; Thu, 27 Jul 2006 22:55:08 +0200
Received: from volker by eos.thalreit with local (Exim 4.50)
	id 1G6Csu-0001Kp-8M
	for linux-mips@linux-mips.org; Thu, 27 Jul 2006 22:55:08 +0200
Date:	Thu, 27 Jul 2006 22:55:08 +0200
From:	Volker Jahns <volker@thalreit.de>
To:	linux-mips@linux-mips.org
Subject: Longshine LCS-8240 / Netronix NH-240
Message-ID: <20060727205508.GA5126@eos.thalreit>
Mail-Followup-To: linux-mips@linux-mips.org
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.9i
X-Provags-ID: kundenserver.de abuse@kundenserver.de login:5b79f71352ef1364d4beaa70fe75636d
Return-Path: <volker@thalreit.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: 12102
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: volker@thalreit.de
Precedence: bulk
X-list: linux-mips
Content-Length: 531
Lines: 12

I do have here an Longshine LCS-8240, which seems to be a repackaged Netronix NH-240 ( MSP2006, 4M Flash, 64MB SDRAM - what Netronix claims) and which I would like to activate with homegrown Linux Firmware.

Is there any information out there for similar devices on
- howto to hook up a serial line
- firmware building and uploading

I have asked Netronix and Longshine for the source code, with Netronix
redirecting me to Longshine and Longshine not answering. 

Any help is much appreciated.
-- 
Volker Jahns, volker@thalreit.de

From ashlesha@kenati.com Thu Jul 27 22:43:03 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 27 Jul 2006 22:43:11 +0100 (BST)
Received: from [69.90.147.196] ([69.90.147.196]:29352 "EHLO mail.kenati.com")
	by ftp.linux-mips.org with ESMTP id S8133592AbWG0VnD (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 27 Jul 2006 22:43:03 +0100
Received: from [192.168.1.169] (adsl-71-130-109-177.dsl.snfc21.pacbell.net [71.130.109.177])
	by mail.kenati.com (Postfix) with ESMTP id DEDB8E4051
	for <linux-mips@linux-mips.org>; Thu, 27 Jul 2006 14:57:56 -0700 (PDT)
Subject: 2.6 -initramfs -bootarg root=
From:	Ashlesha Shintre <ashlesha@kenati.com>
Reply-To: ashlesha@kenati.com
To:	linux-mips@linux-mips.org
Content-Type: text/plain
Date:	Thu, 27 Jul 2006 14:48:08 -0700
Message-Id: <1154036888.6804.8.camel@sandbar.kenati.com>
Mime-Version: 1.0
X-Mailer: Evolution 2.4.2.1 
Content-Transfer-Encoding: 7bit
Return-Path: <ashlesha@kenati.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: 12103
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ashlesha@kenati.com
Precedence: bulk
X-list: linux-mips
Content-Length: 804
Lines: 27

Hi,

I experimenting with different boot arguments to make the 2.6 kernel
boot on the DB1500 board (with the AU1500 MIPS processor).

Along with the image, the make also generated a /usr directory
containing the initramfs_data.cpio.gz and other files, namely:

CVS      Makefile    gen_init_cpio    initramfs_data.S
initramfs_data.cpio.gz  initramfs_list
Kconfig  built-in.o  gen_init_cpio.c  initramfs_data.cpio
initramfs_data.o

During the configuration, 'Create Root File System' was selected in the
xconfig menu.
Therefore, I think using NFS is appropriate.  In the boot args, I ve
written the following:

root=/dev/nfs  
nfsroot=192.168.1.8:/tftpboot/usr_as/initramfs_list 
console=tty0,115200,n,1,none
ip=xxx.xxx.x.146:xxx.xxx.x.8 (client: server)

Please help me out here--
Thank you..
Ashlesha.


From treestem@gmail.com Fri Jul 28 00:44:46 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Jul 2006 00:44:57 +0100 (BST)
Received: from wx-out-0102.google.com ([66.249.82.203]:45868 "EHLO
	wx-out-0102.google.com") by ftp.linux-mips.org with ESMTP
	id S8133593AbWG0Xop (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 28 Jul 2006 00:44:45 +0100
Received: by wx-out-0102.google.com with SMTP id i31so1434591wxd
        for <linux-mips@linux-mips.org>; Thu, 27 Jul 2006 16:44:45 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:content-type;
        b=jKxEM1mvRZvAxmKfnN5C3TfnGUATRG3NwuSyC/OUyFQJI1a0+JU9b4kAHUHSlChnqC+DqbQ8HBgKrWl5A5TSK5a/rn6vNUs2KDWLSSFWSs7AzyZkUs5UhcZSVvOt5YUwZNXHfW8ZyUrg5nhfeQzylEEjBr0AO/dnoyhEJZEOtV8=
Received: by 10.70.21.10 with SMTP id 10mr1247372wxu;
        Thu, 27 Jul 2006 16:44:45 -0700 (PDT)
Received: from ?10.0.1.104? ( [71.243.124.123])
        by mx.gmail.com with ESMTP id h16sm963784wxd.2006.07.27.16.44.43;
        Thu, 27 Jul 2006 16:44:44 -0700 (PDT)
Message-ID: <44C94FEA.1010607@gmail.com>
Date:	Thu, 27 Jul 2006 19:44:42 -0400
From:	Peter Watkins <treestem@gmail.com>
User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050831)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: [PATCH] Use compat code to translate siginfo_t for N32
Content-Type: multipart/mixed;
 boundary="------------030007040606060806020005"
Return-Path: <treestem@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: 12104
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: treestem@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 12563
Lines: 415

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


This patch fixes incorrect data returned from waitid() for mips64el N32. 
It uses compat code to translate siginfo_t for N32, and factors out 
common O32 and N32 compat code for siginfo_t, to compat32.c. Tested on 
glibc suite and LTP.






--------------030007040606060806020005
Content-Type: text/plain;
 name="patch-siginfo-2.6.18-rc1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="patch-siginfo-2.6.18-rc1"

From: Peter Watkins <treestem@gmail.com>
Date: Thu, 27 Jul 2006 19:13:09 -0400
Subject: Use compat code to translate siginfo_t for N32.
Use compat code to translate siginfo_t for N32.
Factor out common O32 and N32 compat code for siginfo_t, to compat32.c.
---
 arch/mips/kernel/Makefile     |    4 +-
 arch/mips/kernel/compat32.c   |   88 +++++++++++++++++++++++++++++++++++++++++
 arch/mips/kernel/compat32.h   |   76 +++++++++++++++++++++++++++++++++++
 arch/mips/kernel/linux32.c    |   28 -------------
 arch/mips/kernel/signal32.c   |   52 ------------------------
 arch/mips/kernel/signal_n32.c |   37 ++++++++++++++++-
 6 files changed, 200 insertions(+), 85 deletions(-)

diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index 881c467..108171a 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -56,8 +56,8 @@ obj-$(CONFIG_32BIT)		+= scall32-o32.o
 obj-$(CONFIG_64BIT)		+= scall64-64.o
 obj-$(CONFIG_BINFMT_IRIX)	+= binfmt_irix.o
 obj-$(CONFIG_MIPS32_COMPAT)	+= linux32.o signal32.o
-obj-$(CONFIG_MIPS32_N32)	+= binfmt_elfn32.o scall64-n32.o signal_n32.o
-obj-$(CONFIG_MIPS32_O32)	+= binfmt_elfo32.o scall64-o32.o ptrace32.o
+obj-$(CONFIG_MIPS32_N32)	+= binfmt_elfn32.o scall64-n32.o signal_n32.o compat32.o
+obj-$(CONFIG_MIPS32_O32)	+= binfmt_elfo32.o scall64-o32.o ptrace32.o compat32.o
 
 obj-$(CONFIG_KGDB)		+= gdb-low.o gdb-stub.o
 obj-$(CONFIG_PROC_FS)		+= proc.o
diff --git a/arch/mips/kernel/compat32.c b/arch/mips/kernel/compat32.c
new file mode 100644
index 0000000..858f7db
--- /dev/null
+++ b/arch/mips/kernel/compat32.c
@@ -0,0 +1,88 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1991, 1992  Linus Torvalds
+ * Copyright (C) 1994 - 2000  Ralf Baechle
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ */
+#include <linux/cache.h>
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/smp.h>
+#include <linux/smp_lock.h>
+#include <linux/kernel.h>
+#include <linux/signal.h>
+#include <linux/syscalls.h>
+#include <linux/errno.h>
+#include <linux/wait.h>
+#include <linux/ptrace.h>
+#include <linux/compat.h>
+#include <linux/suspend.h>
+#include <linux/compiler.h>
+
+#include <asm/abi.h>
+#include <asm/asm.h>
+#include <linux/bitops.h>
+#include <asm/sim.h>
+#include <asm/uaccess.h>
+#include <asm/ucontext.h>
+#include <asm/system.h>
+#include <asm/fpu.h>
+#include <asm/war.h>
+
+#include "compat32.h"
+
+
+int copy_siginfo_to_user32(compat_siginfo_t *to, siginfo_t *from)
+{
+	int err;
+
+	if (!access_ok (VERIFY_WRITE, to, sizeof(compat_siginfo_t)))
+		return -EFAULT;
+
+	/* If you change siginfo_t structure, please be sure
+	   this code is fixed accordingly.
+	   It should never copy any pad contained in the structure
+	   to avoid security leaks, but must copy the generic
+	   3 ints plus the relevant union member.
+	   This routine must convert siginfo from 64bit to 32bit as well
+	   at the same time.  */
+	err = __put_user(from->si_signo, &to->si_signo);
+	err |= __put_user(from->si_errno, &to->si_errno);
+	err |= __put_user((short)from->si_code, &to->si_code);
+	if (from->si_code < 0)
+		err |= __copy_to_user(&to->_sifields._pad, &from->_sifields._pad, SI_PAD_SIZE);
+	else {
+		switch (from->si_code >> 16) {
+		case __SI_TIMER >> 16:
+			err |= __put_user(from->si_tid, &to->si_tid);
+			err |= __put_user(from->si_overrun, &to->si_overrun);
+			err |= __put_user(from->si_int, &to->si_int);
+			break;
+		case __SI_CHLD >> 16:
+			err |= __put_user(from->si_utime, &to->si_utime);
+			err |= __put_user(from->si_stime, &to->si_stime);
+			err |= __put_user(from->si_status, &to->si_status);
+		default:
+			err |= __put_user(from->si_pid, &to->si_pid);
+			err |= __put_user(from->si_uid, &to->si_uid);
+			break;
+		case __SI_FAULT >> 16:
+			err |= __put_user((long)from->si_addr, &to->si_addr);
+			break;
+		case __SI_POLL >> 16:
+			err |= __put_user(from->si_band, &to->si_band);
+			err |= __put_user(from->si_fd, &to->si_fd);
+			break;
+		case __SI_RT >> 16: /* This is not generated by the kernel as of now.  */
+		case __SI_MESGQ >> 16:
+			err |= __put_user(from->si_pid, &to->si_pid);
+			err |= __put_user(from->si_uid, &to->si_uid);
+			err |= __put_user(from->si_int, &to->si_int);
+			break;
+		}
+	}
+	return err;
+}
diff --git a/arch/mips/kernel/compat32.h b/arch/mips/kernel/compat32.h
new file mode 100644
index 0000000..e2bb23b
--- /dev/null
+++ b/arch/mips/kernel/compat32.h
@@ -0,0 +1,76 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1991, 1992  Linus Torvalds
+ * Copyright (C) 1994 - 2000  Ralf Baechle
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ */
+
+#define SI_PAD_SIZE32   ((SI_MAX_SIZE/sizeof(int)) - 3)
+
+typedef struct compat_siginfo {
+	int si_signo;
+	int si_code;
+	int si_errno;
+
+	union {
+		int _pad[SI_PAD_SIZE32];
+
+		/* kill() */
+		struct {
+			compat_pid_t _pid;	/* sender's pid */
+			compat_uid_t _uid;	/* sender's uid */
+		} _kill;
+
+		/* SIGCHLD */
+		struct {
+			compat_pid_t _pid;	/* which child */
+			compat_uid_t _uid;	/* sender's uid */
+			int _status;		/* exit code */
+			compat_clock_t _utime;
+			compat_clock_t _stime;
+		} _sigchld;
+
+		/* IRIX SIGCHLD */
+		struct {
+			compat_pid_t _pid;	/* which child */
+			compat_clock_t _utime;
+			int _status;		/* exit code */
+			compat_clock_t _stime;
+		} _irix_sigchld;
+
+		/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+		struct {
+			s32 _addr; /* faulting insn/memory ref. */
+		} _sigfault;
+
+		/* SIGPOLL, SIGXFSZ (To do ...)  */
+		struct {
+			int _band;	/* POLL_IN, POLL_OUT, POLL_MSG */
+			int _fd;
+		} _sigpoll;
+
+		/* POSIX.1b timers */
+		struct {
+			timer_t _tid;		/* timer id */
+			int _overrun;		/* overrun count */
+			compat_sigval_t _sigval;/* same as below */
+			int _sys_private;       /* not to be passed to user */
+		} _timer;
+
+		/* POSIX.1b signals */
+		struct {
+			compat_pid_t _pid;	/* sender's pid */
+			compat_uid_t _uid;	/* sender's uid */
+			compat_sigval_t _sigval;
+		} _rt;
+
+	} _sifields;
+} compat_siginfo_t;
+
+
+
+int copy_siginfo_to_user32(compat_siginfo_t *to, siginfo_t *from);
+
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 450ac59..dd71096 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -163,34 +163,6 @@ out:
 	return error;
 }
 
-asmlinkage long
-sysn32_waitid(int which, compat_pid_t pid,
-	      siginfo_t __user *uinfo, int options,
-	      struct compat_rusage __user *uru)
-{
-	struct rusage ru;
-	long ret;
-	mm_segment_t old_fs = get_fs();
-	int si_signo;
-
-	if (!access_ok(VERIFY_WRITE, uinfo, sizeof(*uinfo)))
-		return -EFAULT;
-
-	set_fs (KERNEL_DS);
-	ret = sys_waitid(which, pid, uinfo, options,
-			 uru ? (struct rusage __user *) &ru : NULL);
-	set_fs (old_fs);
-
-	if (__get_user(si_signo, &uinfo->si_signo))
-		return -EFAULT;
-	if (ret < 0 || si_signo == 0)
-		return ret;
-
-	if (uru)
-		ret = put_compat_rusage(&ru, uru);
-	return ret;
-}
-
 struct sysinfo32 {
         s32 uptime;
         u32 loads[3];
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c
index f32a229..2ba8c53 100644
--- a/arch/mips/kernel/signal32.c
+++ b/arch/mips/kernel/signal32.c
@@ -411,58 +411,6 @@ #if ICACHE_REFILLS_WORKAROUND_WAR
 #endif
 };
 
-int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
-{
-	int err;
-
-	if (!access_ok (VERIFY_WRITE, to, sizeof(compat_siginfo_t)))
-		return -EFAULT;
-
-	/* If you change siginfo_t structure, please be sure
-	   this code is fixed accordingly.
-	   It should never copy any pad contained in the structure
-	   to avoid security leaks, but must copy the generic
-	   3 ints plus the relevant union member.
-	   This routine must convert siginfo from 64bit to 32bit as well
-	   at the same time.  */
-	err = __put_user(from->si_signo, &to->si_signo);
-	err |= __put_user(from->si_errno, &to->si_errno);
-	err |= __put_user((short)from->si_code, &to->si_code);
-	if (from->si_code < 0)
-		err |= __copy_to_user(&to->_sifields._pad, &from->_sifields._pad, SI_PAD_SIZE);
-	else {
-		switch (from->si_code >> 16) {
-		case __SI_TIMER >> 16:
-			err |= __put_user(from->si_tid, &to->si_tid);
-			err |= __put_user(from->si_overrun, &to->si_overrun);
-			err |= __put_user(from->si_int, &to->si_int);
-			break;
-		case __SI_CHLD >> 16:
-			err |= __put_user(from->si_utime, &to->si_utime);
-			err |= __put_user(from->si_stime, &to->si_stime);
-			err |= __put_user(from->si_status, &to->si_status);
-		default:
-			err |= __put_user(from->si_pid, &to->si_pid);
-			err |= __put_user(from->si_uid, &to->si_uid);
-			break;
-		case __SI_FAULT >> 16:
-			err |= __put_user((unsigned long)from->si_addr, &to->si_addr);
-			break;
-		case __SI_POLL >> 16:
-			err |= __put_user(from->si_band, &to->si_band);
-			err |= __put_user(from->si_fd, &to->si_fd);
-			break;
-		case __SI_RT >> 16: /* This is not generated by the kernel as of now.  */
-		case __SI_MESGQ >> 16:
-			err |= __put_user(from->si_pid, &to->si_pid);
-			err |= __put_user(from->si_uid, &to->si_uid);
-			err |= __put_user(from->si_int, &to->si_int);
-			break;
-		}
-	}
-	return err;
-}
-
 save_static_function(sys32_sigreturn);
 __attribute_used__ noinline static void
 _sys32_sigreturn(nabi_no_regargs struct pt_regs regs)
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c
index 477c533..f805bea 100644
--- a/arch/mips/kernel/signal_n32.c
+++ b/arch/mips/kernel/signal_n32.c
@@ -23,6 +23,7 @@ #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
+#include <linux/syscalls.h>
 #include <linux/errno.h>
 #include <linux/wait.h>
 #include <linux/ptrace.h>
@@ -41,6 +42,7 @@ #include <asm/cpu-features.h>
 #include <asm/war.h>
 
 #include "signal-common.h"
+#include "compat32.h"
 
 /*
  * Including <asm/unistd.h> would give use the 64-bit syscall numbers ...
@@ -74,7 +76,7 @@ #if ICACHE_REFILLS_WORKAROUND_WAR
 #else
 	u32 rs_code[2];			/* signal trampoline */
 #endif
-	struct siginfo rs_info;
+	compat_siginfo_t rs_info;
 	struct ucontextn32 rs_uc;
 #if ICACHE_REFILLS_WORKAROUND_WAR
 	u32 rs_code[8] ____cacheline_aligned;		/* signal trampoline */
@@ -180,7 +182,7 @@ int setup_rt_frame_n32(struct k_sigactio
 	install_sigtramp(frame->rs_code, __NR_N32_rt_sigreturn);
 
 	/* Create siginfo.  */
-	err |= copy_siginfo_to_user(&frame->rs_info, info);
+	err |= copy_siginfo_to_user32(&frame->rs_info, info);
 
 	/* Create the ucontext.  */
 	err |= __put_user(0, &frame->rs_uc.uc_flags);
@@ -215,7 +217,7 @@ int setup_rt_frame_n32(struct k_sigactio
 	regs->regs[31] = (unsigned long) frame->rs_code;
 	regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler;
 
-#if DEBUG_SIG
+#ifdef DEBUG_SIG
 	printk("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%p\n",
 	       current->comm, current->pid,
 	       frame, regs->cp0_epc, regs->regs[31]);
@@ -226,3 +228,32 @@ give_sigsegv:
 	force_sigsegv(signr, current);
 	return -EFAULT;
 }
+
+
+
+asmlinkage long
+sysn32_waitid(int which, compat_pid_t pid,
+	      compat_siginfo_t __user *uinfo, int options,
+	      struct compat_rusage __user *uru)
+{
+	siginfo_t info;
+	struct rusage ru;
+	long ret;
+	mm_segment_t old_fs = get_fs();
+
+	info.si_signo = 0;
+	set_fs (KERNEL_DS);
+	ret = sys_waitid(which, pid, (siginfo_t __user *) &info, options,
+			 uru ? (struct rusage __user *) &ru : NULL);
+	set_fs (old_fs);
+
+	if (ret < 0 || info.si_signo == 0)
+		return ret;
+
+	if (uru && (ret = put_compat_rusage(&ru, uru)))
+		return ret;
+
+	BUG_ON(info.si_code & __SI_MASK);
+	info.si_code |= __SI_CHLD;
+	return copy_siginfo_to_user32(uinfo, &info);
+}
-- 
1.4.1


--------------030007040606060806020005--

From yoichi_yuasa@tripeaks.co.jp Fri Jul 28 02:44:32 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Jul 2006 02:44:42 +0100 (BST)
Received: from mo31.po.2iij.net ([210.128.50.54]:40249 "EHLO mo31.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8134056AbWG1Boc (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 28 Jul 2006 02:44:32 +0100
Received: by mo.po.2iij.net (mo31) id k6S1iQx5027247; Fri, 28 Jul 2006 10:44:26 +0900 (JST)
Received: from localhost.localdomain (65.126.232.202.bf.2iij.net [202.232.126.65])
	by mbox.po.2iij.net (mbox32) id k6S1iOt1059064
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Fri, 28 Jul 2006 10:44:25 +0900 (JST)
Date:	Fri, 28 Jul 2006 10:44:24 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Peter Watkins <treestem@gmail.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] Use compat code to translate siginfo_t for N32
Message-Id: <20060728104424.19e1bfaa.yoichi_yuasa@tripeaks.co.jp>
In-Reply-To: <44C94FEA.1010607@gmail.com>
References: <44C94FEA.1010607@gmail.com>
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: 12105
X-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
Content-Length: 1867
Lines: 63

Hi,

> diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
> index 881c467..108171a 100644
> --- a/arch/mips/kernel/Makefile
> +++ b/arch/mips/kernel/Makefile
> @@ -56,8 +56,8 @@ obj-$(CONFIG_32BIT)           += scall32-o32.o
>  obj-$(CONFIG_64BIT)            += scall64-64.o
>  obj-$(CONFIG_BINFMT_IRIX)      += binfmt_irix.o
>  obj-$(CONFIG_MIPS32_COMPAT)    += linux32.o signal32.o
> -obj-$(CONFIG_MIPS32_N32)       += binfmt_elfn32.o scall64-n32.o signal_n32.o
> -obj-$(CONFIG_MIPS32_O32)       += binfmt_elfo32.o scall64-o32.o ptrace32.o
> +obj-$(CONFIG_MIPS32_N32)       += binfmt_elfn32.o scall64-n32.o signal_n32.o compat32.o
> +obj-$(CONFIG_MIPS32_O32)       += binfmt_elfo32.o scall64-o32.o ptrace32.o compat32.o

Why do you separate comapt32.o ?

> diff --git a/arch/mips/kernel/compat32.c b/arch/mips/kernel/compat32.c
> new file mode 100644
> index 0000000..858f7db
> --- /dev/null
> +++ b/arch/mips/kernel/compat32.c

<snip>

> +int copy_siginfo_to_user32(compat_siginfo_t *to, siginfo_t *from)

see include/linux/compat.h .

int copy_siginfo_to_user32(struct compat_siginfo __user *to, siginfo_t *from);


> diff --git a/arch/mips/kernel/compat32.h b/arch/mips/kernel/compat32.h
> new file mode 100644
> index 0000000..e2bb23b
> --- /dev/null
> +++ b/arch/mips/kernel/compat32.h
> @@ -0,0 +1,76 @@

<snip>

> +int copy_siginfo_to_user32(compat_siginfo_t *to, siginfo_t *from);

It's already defined in include/linux/compat.h .

> diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c
> index 477c533..f805bea 100644
> --- a/arch/mips/kernel/signal_n32.c
> +++ b/arch/mips/kernel/signal_n32.c

<snip>

> @@ -74,7 +76,7 @@ #if ICACHE_REFILLS_WORKAROUND_WAR
>  #else
>  	u32 rs_code[2];			/* signal trampoline */
>  #endif
> -	struct siginfo rs_info;
> +	compat_siginfo_t rs_info;

use struct compat_siginfo .

Yoichi


From vagabon.xyz@gmail.com Fri Jul 28 09:17:23 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Jul 2006 09:17:32 +0100 (BST)
Received: from nz-out-0102.google.com ([64.233.162.194]:6416 "EHLO
	nz-out-0102.google.com") by ftp.linux-mips.org with ESMTP
	id S8133420AbWG1IRX (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 28 Jul 2006 09:17:23 +0100
Received: by nz-out-0102.google.com with SMTP id q3so137946nzb
        for <linux-mips@linux-mips.org>; Fri, 28 Jul 2006 01:17:21 -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=gtOkU+uTCRT5nvgVDv8kr5wMPFek7C9JiGecIbDclojplooE55nIy3rPI+6yOdEj0VYWnyptN42qbsClKF5s1WBFOHYid1+Z/R67FD1sNVU0+dk6/Y2PlP279mdsmeSSyJE4iIxk9qLmCTz/acA/Wdm0Wb0rnHaLBqNTlR+7Vic=
Received: by 10.65.112.5 with SMTP id p5mr2151640qbm;
        Fri, 28 Jul 2006 01:17:21 -0700 (PDT)
Received: from ?192.168.0.24? ( [194.3.162.233])
        by mx.gmail.com with ESMTP id 22sm684724nzn.2006.07.28.01.17.19;
        Fri, 28 Jul 2006 01:17:21 -0700 (PDT)
Message-ID: <44C9C7D2.3000207@innova-card.com>
Date:	Fri, 28 Jul 2006 10:16:18 +0200
Reply-To: Franck <vagabon.xyz@gmail.com>
User-Agent: Thunderbird 1.5.0.4 (X11/20060614)
MIME-Version: 1.0
To:	Franck Bui-Huu <vagabon.xyz@gmail.com>
CC:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>, linux-mips@linux-mips.org,
	ralf@linux-mips.org
Subject: Re: [PATCH] dump_stack() based on prologue code analysis
References: <20060726.232231.59465336.anemo@mba.ocn.ne.jp>	 <44C8CEA4.20000@innova-card.com> <cda58cb80607271203u70b26e23o65b71d3d0c900f94@mail.gmail.com>
In-Reply-To: <cda58cb80607271203u70b26e23o65b71d3d0c900f94@mail.gmail.com>
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: 12106
X-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

Franck Bui-Huu wrote:
> one more comment,
> 

argh, your patch is already applied ! No room for comments
on MIPS...BTW, are these patches going to be included in
a 2.6.18-rcX release ?

Anyways, I'll send to you a patch on top of yours including
my changes if you agree with them.

Thanks
		Franck

From anemo@mba.ocn.ne.jp Fri Jul 28 13:47:03 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Jul 2006 13:47:12 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:12522 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133711AbWG1MrD (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 28 Jul 2006 13:47:03 +0100
Received: from localhost (p7008-ipad205funabasi.chiba.ocn.ne.jp [222.146.102.8])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 1B81BB455; Fri, 28 Jul 2006 21:46:59 +0900 (JST)
Date:	Fri, 28 Jul 2006 21:48:29 +0900 (JST)
Message-Id: <20060728.214829.07644540.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: <44C880A9.1070402@innova-card.com>
References: <44C77D49.90205@innova-card.com>
	<20060727.002153.41632148.anemo@mba.ocn.ne.jp>
	<44C880A9.1070402@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: 12107
X-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, 27 Jul 2006 11:00:25 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
> I'm suprised that sparsemem code doens't check for holes inside
> sections. I would feel really more confortable to use sparsemem if a
> check like the following patch exists. We could safely use pfn_valid()
> in _any_ cases and if holes exist inside sections then the user have
> to fix up its section sizes.
> 
> what do you think ?

I think holes inside a section is not illegal, just a bit ineffective.
So I feel your patch is too strict.

---
Atsushi Nemoto

From anemo@mba.ocn.ne.jp Fri Jul 28 15:37:20 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Jul 2006 15:37:30 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:51684 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133723AbWG1OhU (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 28 Jul 2006 15:37:20 +0100
Received: from localhost (p7008-ipad205funabasi.chiba.ocn.ne.jp [222.146.102.8])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 17DCFB56B; Fri, 28 Jul 2006 23:37:12 +0900 (JST)
Date:	Fri, 28 Jul 2006 23:38:42 +0900 (JST)
Message-Id: <20060728.233842.41629448.anemo@mba.ocn.ne.jp>
To:	ths@networkno.de
Cc:	vagabon.xyz@gmail.com, ddaney@avtrex.com,
	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] dump_stack() based on prologue code analysis
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <20060727191245.GD4505@networkno.de>
References: <20060727170305.GB4505@networkno.de>
	<cda58cb80607271151n2dcfe64cn4cb1ecca3ece6b1e@mail.gmail.com>
	<20060727191245.GD4505@networkno.de>
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: 12108
X-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, 27 Jul 2006 20:12:45 +0100, Thiemo Seufer <ths@networkno.de> wrote:
> IOW, binary analysis can't be expected to provide full accuracy, but
> we can live with a reasonable approximation, I think.

Yes, this is a starting point.

The patch (and current mips get_wchan() implementation) tries to do is
what I used to do to analyze stack dump by hand.

1. Determine PC and SP.
2. Disassemble a function containing the PC address.
3. If the function is leaf, make use RA for new PC.
4. Otherwise, obtain saved RA from stack and use it for new PC.
5. Calculate new SP by undoing "addiu sp,sp,-imm".
6. Back to (2).

While it is hard to make the get_frame_info() perfect, this approach
might fail sometimes.  But it can work well for most case, and if it
did well we can get very good stack trace than current one (which may
contain so many false entries).

If you wanted to know the difference, please try ALT-SYSRQ-T (or
BREAK-T for serial console) with and without this patch :-)

---
Atsushi Nemoto

From anemo@mba.ocn.ne.jp Fri Jul 28 16:43:17 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Jul 2006 16:43:28 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:34813 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133772AbWG1PnR (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 28 Jul 2006 16:43:17 +0100
Received: from localhost (p7008-ipad205funabasi.chiba.ocn.ne.jp [222.146.102.8])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 6935BB530; Sat, 29 Jul 2006 00:43:12 +0900 (JST)
Date:	Sat, 29 Jul 2006 00:44:42 +0900 (JST)
Message-Id: <20060729.004442.96686266.anemo@mba.ocn.ne.jp>
To:	vagabon.xyz@gmail.com
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] dump_stack() based on prologue code analysis
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <cda58cb80607271203u70b26e23o65b71d3d0c900f94@mail.gmail.com>
	<44C8CEA4.20000@innova-card.com>
References: <20060726.232231.59465336.anemo@mba.ocn.ne.jp>
	<44C8CEA4.20000@innova-card.com>
	<cda58cb80607271203u70b26e23o65b71d3d0c900f94@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: 12109
X-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

Hi, Franck.  Thank you for detailed review.

On Thu, 27 Jul 2006 16:33:08 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
> > +		if (info->pc_offset < 0 || info->frame_size == 0) {
> > +			if (info->func == schedule)
> 
> This can't happen since "schedule" is not a leaf function. Something I'm
> missing here but I would have said:
> 
> 			if (func != schedule)
> 
> instead, no ?

This "if (info->func == schedule)" condition is originally in current
get_frame_info().  And it was added to report "Can't analyze" message
only for schedule() function.  This is because we can get at least
somewhat worth results for thread_saved_pc() and get_wchan() if the
frame information for the schedule() could be analyzed.  The frame
information for other functions just make get_wchan()'s result better.

> > +	if (info.pc_offset < 0 || !info.frame_size) {
> > +		/* leaf? */
> 
> for leaf case, can't we simply do this test:
> 
> 	if (info.pc_offset < 0) {
> 
> IOW, can a leaf function move sp ? I would say yes...

Normally, we can omit "!info.frame_size".  But as I wrote in other
mail, I think it is hard to make perfect get_frame_info().  We should
handle any wired result from get_frame_info().

> BTW why not let this logic inside get_frame_info() ? Hence this function
> could return:
> 
> 	if (info.frame_size && info.pc_offset > 0) /* nested */
> 		return 0;
> 	if (info.pc_offset < 0) /* leaf */
> 		return 1;
> 	/* prologue seems boggus... */
> 	printk("Can't analyze prologue code at %p\n", info->func);
> 	return -1;

Indeed.  I'll make new patch.  But I think put printk() in
get_frame_info() not good because now I want to use it for
show_trace().  I don't want to see the "Can't analyze" message in oops
log.

> > +		*sp += info.frame_size / sizeof(long);
> > +		return 0;
> 
> why not returning:
> 		return regs->regs[31];
> 
> and removes the leaf detection logic in show_frametrace() ?

Because unwind_stack() does not have "regs" argument.  The RA
information is only needed for leaf (i.e. top on stack trace) and
unwind_stack() is used for any level of stack, so I think it is better
to handle the leaf case in show_frametrace().

> > +	pc = (*sp)[info.pc_offset];
> > +	*sp += info.frame_size / sizeof(long);
> > +	return pc;
> 
> why not directly doing:
> 
> 	return (*sp)[info.pc_offset];
> 
> and remove:
> 
> 	pc = (*sp)[info.pc_offset];

This is wrong.  The *sp must be modified before return.

> > +	unsigned long *stack = (long *)regs->regs[29];
> 
> why not calling that "sp" ?

Just because show_trace() named it "stack" :-)

---
Atsushi Nemoto

From anemo@mba.ocn.ne.jp Fri Jul 28 17:00:11 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Jul 2006 17:00:20 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:5103 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133717AbWG1QAL (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 28 Jul 2006 17:00:11 +0100
Received: from localhost (p7008-ipad205funabasi.chiba.ocn.ne.jp [222.146.102.8])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id A52D8B649; Sat, 29 Jul 2006 01:00:06 +0900 (JST)
Date:	Sat, 29 Jul 2006 01:01:37 +0900 (JST)
Message-Id: <20060729.010137.36922349.anemo@mba.ocn.ne.jp>
To:	vagabon.xyz@gmail.com
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] dump_stack() based on prologue code analysis
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <cda58cb80607271203u70b26e23o65b71d3d0c900f94@mail.gmail.com>
References: <20060726.232231.59465336.anemo@mba.ocn.ne.jp>
	<44C8CEA4.20000@innova-card.com>
	<cda58cb80607271203u70b26e23o65b71d3d0c900f94@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: 12110
X-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, 27 Jul 2006 21:03:07 +0200, "Franck Bui-Huu" <vagabon.xyz@gmail.com> wrote:
> > > +     info.func = (void *)(pc - ofs);
> > > +     info.func_size = ofs;   /* analyze from start to ofs */
> 
> in get_frame_info(), there is the following condition to stop the
> prologue analysis
> 
> 		if (info->func_size && i >= info->func_size / 4)
> 			break;
> 
> Setting info.func_size = ofs may trigger this stop condition very
> early, specially if "ofs" is small...I would simply remove this
> condition since it's very empirical and IMHO not very usefull.

Yes, that is what I wanted.  Imagine if a exception happened on first
place on non-leaf function.  In this case, we must assume the function
is leaf since RA is not saved to the stack.

---
Atsushi Nemoto

From anemo@mba.ocn.ne.jp Fri Jul 28 17:06:52 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Jul 2006 17:07:00 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:59341 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133717AbWG1QGw (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 28 Jul 2006 17:06:52 +0100
Received: from localhost (p7008-ipad205funabasi.chiba.ocn.ne.jp [222.146.102.8])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 794F4B3EC; Sat, 29 Jul 2006 01:06:48 +0900 (JST)
Date:	Sat, 29 Jul 2006 01:08:18 +0900 (JST)
Message-Id: <20060729.010818.55512402.anemo@mba.ocn.ne.jp>
To:	vagabon.xyz@gmail.com
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] dump_stack() based on prologue code analysis
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <44C9C7D2.3000207@innova-card.com>
References: <44C8CEA4.20000@innova-card.com>
	<cda58cb80607271203u70b26e23o65b71d3d0c900f94@mail.gmail.com>
	<44C9C7D2.3000207@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: 12111
X-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 Fri, 28 Jul 2006 10:16:18 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
> argh, your patch is already applied ! No room for comments
> on MIPS...BTW, are these patches going to be included in
> a 2.6.18-rcX release ?

Unfortunately, not applied yet.  Comments are welcome even if already
applied.  We can send a new patch anyway.  Nothing is too late :-)

---
Atsushi Nemoto

From treestem@gmail.com Fri Jul 28 18:00:02 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Jul 2006 18:00:12 +0100 (BST)
Received: from ug-out-1314.google.com ([66.249.92.169]:59115 "EHLO
	ug-out-1314.google.com") by ftp.linux-mips.org with ESMTP
	id S8133753AbWG1RAC (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 28 Jul 2006 18:00:02 +0100
Received: by ug-out-1314.google.com with SMTP id y2so773003uge
        for <linux-mips@linux-mips.org>; Fri, 28 Jul 2006 10:00:01 -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:references;
        b=rYkyB4uZVvtfifzsokuStGaDHHrVDxDRsM1qbVMsN2KEvWdm0b5IrB7RxQVWjkIdvD8dGBnV1pzxdCrDDtagcow9UwEKaMxVom0HZPVs/gzNUfKHFCLEHmth9S0uq4WImz6O1zNGGVqlFKrXDzsJtw5Axyz2Y3v/CxSjhyavc/c=
Received: by 10.66.244.10 with SMTP id r10mr8750250ugh;
        Fri, 28 Jul 2006 10:00:01 -0700 (PDT)
Received: by 10.67.23.12 with HTTP; Fri, 28 Jul 2006 10:00:01 -0700 (PDT)
Message-ID: <218a54980607281000hc62b038h31e74e96400db763@mail.gmail.com>
Date:	Fri, 28 Jul 2006 13:00:01 -0400
From:	"Peter Watkins" <treestem@gmail.com>
To:	"Yoichi Yuasa" <yoichi_yuasa@tripeaks.co.jp>
Subject: Re: [PATCH] Use compat code to translate siginfo_t for N32
Cc:	linux-mips@linux-mips.org
In-Reply-To: <20060728104424.19e1bfaa.yoichi_yuasa@tripeaks.co.jp>
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_12927_3587587.1154106001113"
References: <44C94FEA.1010607@gmail.com>
	 <20060728104424.19e1bfaa.yoichi_yuasa@tripeaks.co.jp>
Return-Path: <treestem@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: 12112
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: treestem@gmail.com
Precedence: bulk
X-list: linux-mips

------=_Part_12927_3587587.1154106001113
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hello Yoichi,

The attached patch addresses your points, and ends up cleaner and
simpler. Except:

> > diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c
> > index 477c533..f805bea 100644
> > --- a/arch/mips/kernel/signal_n32.c
> > +++ b/arch/mips/kernel/signal_n32.c
>
> <snip>
>
> > @@ -74,7 +76,7 @@ #if ICACHE_REFILLS_WORKAROUND_WAR
> >  #else
> >       u32 rs_code[2];                 /* signal trampoline */
> >  #endif
> > -     struct siginfo rs_info;
> > +     compat_siginfo_t rs_info;
>
> use struct compat_siginfo .
>

I did not change this as it's currently consistent with the form used
in signal32.c and signal_n32.c. If we want to change this, it seemed
preferable to have another patch for just that purpose.

- Peter

------=_Part_12927_3587587.1154106001113
Content-Type: text/plain; name=patch-siginfo-2.6.18-rc1.txt; 
	charset=ANSI_X3.4-1968
Content-Transfer-Encoding: base64
X-Attachment-Id: f_eq6sstla
Content-Disposition: attachment; filename="patch-siginfo-2.6.18-rc1.txt"

RnJvbSAyMTQwMDVhMzk1ZGQwOGEyMDlmMmVjMmQ5YzAzY2QwMDAzOGVjNzgzIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBQZXRlciBXYXRraW5zIDx0cmVlc3RlbUBnbWFpbC5jb20+CkRh
dGU6IEZyaSwgMjggSnVsIDIwMDYgMTI6MTU6NTIgLTA0MDAKU3ViamVjdDogW1BBVENIXSBGaXgg
aW5jb3JyZWN0IGRhdGEgcmV0dXJuZWQgZnJvbSB3YWl0aWQoKSBmb3IgbWlwczY0ZWwgTjMyLgpV
c2UgY29tcGF0IGNvZGUgdG8gdHJhbnNsYXRlIHNpZ2luZm9fdCBmb3IgTjMyLgotLS0KIGFyY2gv
bWlwcy9rZXJuZWwvbGludXgzMi5jICAgICAgIHwgICAyOCAtLS0tLS0tLS0tLS0tLS0tCiBhcmNo
L21pcHMva2VybmVsL3NpZ25hbC1jb21tb24uaCB8ICAgNjUgKysrKysrKysrKysrKysrKysrKysr
KysrKysrKysrKysrKysrKysKIGFyY2gvbWlwcy9rZXJuZWwvc2lnbmFsX24zMi5jICAgIHwgICAz
NiArKysrKysrKysrKysrKysrKysrLS0KIDMgZmlsZXMgY2hhbmdlZCwgOTggaW5zZXJ0aW9ucygr
KSwgMzEgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvYXJjaC9taXBzL2tlcm5lbC9saW51eDMy
LmMgYi9hcmNoL21pcHMva2VybmVsL2xpbnV4MzIuYwppbmRleCA0NTBhYzU5Li5kZDcxMDk2IDEw
MDY0NAotLS0gYS9hcmNoL21pcHMva2VybmVsL2xpbnV4MzIuYworKysgYi9hcmNoL21pcHMva2Vy
bmVsL2xpbnV4MzIuYwpAQCAtMTYzLDM0ICsxNjMsNiBAQCBvdXQ6CiAJcmV0dXJuIGVycm9yOwog
fQogCi1hc21saW5rYWdlIGxvbmcKLXN5c24zMl93YWl0aWQoaW50IHdoaWNoLCBjb21wYXRfcGlk
X3QgcGlkLAotCSAgICAgIHNpZ2luZm9fdCBfX3VzZXIgKnVpbmZvLCBpbnQgb3B0aW9ucywKLQkg
ICAgICBzdHJ1Y3QgY29tcGF0X3J1c2FnZSBfX3VzZXIgKnVydSkKLXsKLQlzdHJ1Y3QgcnVzYWdl
IHJ1OwotCWxvbmcgcmV0OwotCW1tX3NlZ21lbnRfdCBvbGRfZnMgPSBnZXRfZnMoKTsKLQlpbnQg
c2lfc2lnbm87Ci0KLQlpZiAoIWFjY2Vzc19vayhWRVJJRllfV1JJVEUsIHVpbmZvLCBzaXplb2Yo
KnVpbmZvKSkpCi0JCXJldHVybiAtRUZBVUxUOwotCi0Jc2V0X2ZzIChLRVJORUxfRFMpOwotCXJl
dCA9IHN5c193YWl0aWQod2hpY2gsIHBpZCwgdWluZm8sIG9wdGlvbnMsCi0JCQkgdXJ1ID8gKHN0
cnVjdCBydXNhZ2UgX191c2VyICopICZydSA6IE5VTEwpOwotCXNldF9mcyAob2xkX2ZzKTsKLQot
CWlmIChfX2dldF91c2VyKHNpX3NpZ25vLCAmdWluZm8tPnNpX3NpZ25vKSkKLQkJcmV0dXJuIC1F
RkFVTFQ7Ci0JaWYgKHJldCA8IDAgfHwgc2lfc2lnbm8gPT0gMCkKLQkJcmV0dXJuIHJldDsKLQot
CWlmICh1cnUpCi0JCXJldCA9IHB1dF9jb21wYXRfcnVzYWdlKCZydSwgdXJ1KTsKLQlyZXR1cm4g
cmV0OwotfQotCiBzdHJ1Y3Qgc3lzaW5mbzMyIHsKICAgICAgICAgczMyIHVwdGltZTsKICAgICAg
ICAgdTMyIGxvYWRzWzNdOwpkaWZmIC0tZ2l0IGEvYXJjaC9taXBzL2tlcm5lbC9zaWduYWwtY29t
bW9uLmggYi9hcmNoL21pcHMva2VybmVsL3NpZ25hbC1jb21tb24uaAppbmRleCBiMWYwOWQ1Li5k
NGE4MGU3IDEwMDY0NAotLS0gYS9hcmNoL21pcHMva2VybmVsL3NpZ25hbC1jb21tb24uaAorKysg
Yi9hcmNoL21pcHMva2VybmVsL3NpZ25hbC1jb21tb24uaApAQCAtOCw2ICs4LDcgQEAKICAqIENv
cHlyaWdodCAoQykgMTk5OSwgMjAwMCBTaWxpY29uIEdyYXBoaWNzLCBJbmMuCiAgKi8KIAorI2lu
Y2x1ZGUgPGxpbnV4L2NvbXBhdC5oPgogCiBzdGF0aWMgaW5saW5lIGludAogc2V0dXBfc2lnY29u
dGV4dChzdHJ1Y3QgcHRfcmVncyAqcmVncywgc3RydWN0IHNpZ2NvbnRleHQgX191c2VyICpzYykK
QEAgLTE3NCwzICsxNzUsNjcgQEAgc3RhdGljIGlubGluZSBpbnQgaW5zdGFsbF9zaWd0cmFtcCh1
bnNpZwogCiAJcmV0dXJuIGVycjsKIH0KKworCisjZGVmaW5lIFNJX1BBRF9TSVpFMzIgICAoKFNJ
X01BWF9TSVpFL3NpemVvZihpbnQpKSAtIDMpCisKK3R5cGVkZWYgc3RydWN0IGNvbXBhdF9zaWdp
bmZvIHsKKwlpbnQgc2lfc2lnbm87CisJaW50IHNpX2NvZGU7CisJaW50IHNpX2Vycm5vOworCisJ
dW5pb24geworCQlpbnQgX3BhZFtTSV9QQURfU0laRTMyXTsKKworCQkvKiBraWxsKCkgKi8KKwkJ
c3RydWN0IHsKKwkJCWNvbXBhdF9waWRfdCBfcGlkOwkvKiBzZW5kZXIncyBwaWQgKi8KKwkJCWNv
bXBhdF91aWRfdCBfdWlkOwkvKiBzZW5kZXIncyB1aWQgKi8KKwkJfSBfa2lsbDsKKworCQkvKiBT
SUdDSExEICovCisJCXN0cnVjdCB7CisJCQljb21wYXRfcGlkX3QgX3BpZDsJLyogd2hpY2ggY2hp
bGQgKi8KKwkJCWNvbXBhdF91aWRfdCBfdWlkOwkvKiBzZW5kZXIncyB1aWQgKi8KKwkJCWludCBf
c3RhdHVzOwkJLyogZXhpdCBjb2RlICovCisJCQljb21wYXRfY2xvY2tfdCBfdXRpbWU7CisJCQlj
b21wYXRfY2xvY2tfdCBfc3RpbWU7CisJCX0gX3NpZ2NobGQ7CisKKwkJLyogSVJJWCBTSUdDSExE
ICovCisJCXN0cnVjdCB7CisJCQljb21wYXRfcGlkX3QgX3BpZDsJLyogd2hpY2ggY2hpbGQgKi8K
KwkJCWNvbXBhdF9jbG9ja190IF91dGltZTsKKwkJCWludCBfc3RhdHVzOwkJLyogZXhpdCBjb2Rl
ICovCisJCQljb21wYXRfY2xvY2tfdCBfc3RpbWU7CisJCX0gX2lyaXhfc2lnY2hsZDsKKworCQkv
KiBTSUdJTEwsIFNJR0ZQRSwgU0lHU0VHViwgU0lHQlVTICovCisJCXN0cnVjdCB7CisJCQlzMzIg
X2FkZHI7IC8qIGZhdWx0aW5nIGluc24vbWVtb3J5IHJlZi4gKi8KKwkJfSBfc2lnZmF1bHQ7CisK
KwkJLyogU0lHUE9MTCwgU0lHWEZTWiAoVG8gZG8gLi4uKSAgKi8KKwkJc3RydWN0IHsKKwkJCWlu
dCBfYmFuZDsJLyogUE9MTF9JTiwgUE9MTF9PVVQsIFBPTExfTVNHICovCisJCQlpbnQgX2ZkOwor
CQl9IF9zaWdwb2xsOworCisJCS8qIFBPU0lYLjFiIHRpbWVycyAqLworCQlzdHJ1Y3QgeworCQkJ
dGltZXJfdCBfdGlkOwkJLyogdGltZXIgaWQgKi8KKwkJCWludCBfb3ZlcnJ1bjsJCS8qIG92ZXJy
dW4gY291bnQgKi8KKwkJCWNvbXBhdF9zaWd2YWxfdCBfc2lndmFsOy8qIHNhbWUgYXMgYmVsb3cg
Ki8KKwkJCWludCBfc3lzX3ByaXZhdGU7ICAgICAgIC8qIG5vdCB0byBiZSBwYXNzZWQgdG8gdXNl
ciAqLworCQl9IF90aW1lcjsKKworCQkvKiBQT1NJWC4xYiBzaWduYWxzICovCisJCXN0cnVjdCB7
CisJCQljb21wYXRfcGlkX3QgX3BpZDsJLyogc2VuZGVyJ3MgcGlkICovCisJCQljb21wYXRfdWlk
X3QgX3VpZDsJLyogc2VuZGVyJ3MgdWlkICovCisJCQljb21wYXRfc2lndmFsX3QgX3NpZ3ZhbDsK
KwkJfSBfcnQ7CisKKwl9IF9zaWZpZWxkczsKK30gY29tcGF0X3NpZ2luZm9fdDsKKwpkaWZmIC0t
Z2l0IGEvYXJjaC9taXBzL2tlcm5lbC9zaWduYWxfbjMyLmMgYi9hcmNoL21pcHMva2VybmVsL3Np
Z25hbF9uMzIuYwppbmRleCA0NzdjNTMzLi4zOTRkNGM2IDEwMDY0NAotLS0gYS9hcmNoL21pcHMv
a2VybmVsL3NpZ25hbF9uMzIuYworKysgYi9hcmNoL21pcHMva2VybmVsL3NpZ25hbF9uMzIuYwpA
QCAtMjMsNiArMjMsNyBAQCAjaW5jbHVkZSA8bGludXgvc21wLmg+CiAjaW5jbHVkZSA8bGludXgv
c21wX2xvY2suaD4KICNpbmNsdWRlIDxsaW51eC9rZXJuZWwuaD4KICNpbmNsdWRlIDxsaW51eC9z
aWduYWwuaD4KKyNpbmNsdWRlIDxsaW51eC9zeXNjYWxscy5oPgogI2luY2x1ZGUgPGxpbnV4L2Vy
cm5vLmg+CiAjaW5jbHVkZSA8bGludXgvd2FpdC5oPgogI2luY2x1ZGUgPGxpbnV4L3B0cmFjZS5o
PgpAQCAtNzQsNyArNzUsNyBAQCAjaWYgSUNBQ0hFX1JFRklMTFNfV09SS0FST1VORF9XQVIKICNl
bHNlCiAJdTMyIHJzX2NvZGVbMl07CQkJLyogc2lnbmFsIHRyYW1wb2xpbmUgKi8KICNlbmRpZgot
CXN0cnVjdCBzaWdpbmZvIHJzX2luZm87CisJY29tcGF0X3NpZ2luZm9fdCByc19pbmZvOwogCXN0
cnVjdCB1Y29udGV4dG4zMiByc191YzsKICNpZiBJQ0FDSEVfUkVGSUxMU19XT1JLQVJPVU5EX1dB
UgogCXUzMiByc19jb2RlWzhdIF9fX19jYWNoZWxpbmVfYWxpZ25lZDsJCS8qIHNpZ25hbCB0cmFt
cG9saW5lICovCkBAIC0xODAsNyArMTgxLDcgQEAgaW50IHNldHVwX3J0X2ZyYW1lX24zMihzdHJ1
Y3Qga19zaWdhY3RpbwogCWluc3RhbGxfc2lndHJhbXAoZnJhbWUtPnJzX2NvZGUsIF9fTlJfTjMy
X3J0X3NpZ3JldHVybik7CiAKIAkvKiBDcmVhdGUgc2lnaW5mby4gICovCi0JZXJyIHw9IGNvcHlf
c2lnaW5mb190b191c2VyKCZmcmFtZS0+cnNfaW5mbywgaW5mbyk7CisJZXJyIHw9IGNvcHlfc2ln
aW5mb190b191c2VyMzIoJmZyYW1lLT5yc19pbmZvLCBpbmZvKTsKIAogCS8qIENyZWF0ZSB0aGUg
dWNvbnRleHQuICAqLwogCWVyciB8PSBfX3B1dF91c2VyKDAsICZmcmFtZS0+cnNfdWMudWNfZmxh
Z3MpOwpAQCAtMjE1LDcgKzIxNiw3IEBAIGludCBzZXR1cF9ydF9mcmFtZV9uMzIoc3RydWN0IGtf
c2lnYWN0aW8KIAlyZWdzLT5yZWdzWzMxXSA9ICh1bnNpZ25lZCBsb25nKSBmcmFtZS0+cnNfY29k
ZTsKIAlyZWdzLT5jcDBfZXBjID0gcmVncy0+cmVnc1syNV0gPSAodW5zaWduZWQgbG9uZykga2Et
PnNhLnNhX2hhbmRsZXI7CiAKLSNpZiBERUJVR19TSUcKKyNpZmRlZiBERUJVR19TSUcKIAlwcmlu
dGsoIlNJRyBkZWxpdmVyICglczolZCk6IHNwPTB4JXAgcGM9MHglbHggcmE9MHglcFxuIiwKIAkg
ICAgICAgY3VycmVudC0+Y29tbSwgY3VycmVudC0+cGlkLAogCSAgICAgICBmcmFtZSwgcmVncy0+
Y3AwX2VwYywgcmVncy0+cmVnc1szMV0pOwpAQCAtMjI2LDMgKzIyNywzMiBAQCBnaXZlX3NpZ3Nl
Z3Y6CiAJZm9yY2Vfc2lnc2VndihzaWduciwgY3VycmVudCk7CiAJcmV0dXJuIC1FRkFVTFQ7CiB9
CisKKworCithc21saW5rYWdlIGxvbmcKK3N5c24zMl93YWl0aWQoaW50IHdoaWNoLCBjb21wYXRf
cGlkX3QgcGlkLAorCSAgICAgIGNvbXBhdF9zaWdpbmZvX3QgX191c2VyICp1aW5mbywgaW50IG9w
dGlvbnMsCisJICAgICAgc3RydWN0IGNvbXBhdF9ydXNhZ2UgX191c2VyICp1cnUpCit7CisJc2ln
aW5mb190IGluZm87CisJc3RydWN0IHJ1c2FnZSBydTsKKwlsb25nIHJldDsKKwltbV9zZWdtZW50
X3Qgb2xkX2ZzID0gZ2V0X2ZzKCk7CisKKwlpbmZvLnNpX3NpZ25vID0gMDsKKwlzZXRfZnMgKEtF
Uk5FTF9EUyk7CisJcmV0ID0gc3lzX3dhaXRpZCh3aGljaCwgcGlkLCAoc2lnaW5mb190IF9fdXNl
ciAqKSAmaW5mbywgb3B0aW9ucywKKwkJCSB1cnUgPyAoc3RydWN0IHJ1c2FnZSBfX3VzZXIgKikg
JnJ1IDogTlVMTCk7CisJc2V0X2ZzIChvbGRfZnMpOworCisJaWYgKHJldCA8IDAgfHwgaW5mby5z
aV9zaWdubyA9PSAwKQorCQlyZXR1cm4gcmV0OworCisJaWYgKHVydSAmJiAocmV0ID0gcHV0X2Nv
bXBhdF9ydXNhZ2UoJnJ1LCB1cnUpKSkKKwkJcmV0dXJuIHJldDsKKworCUJVR19PTihpbmZvLnNp
X2NvZGUgJiBfX1NJX01BU0spOworCWluZm8uc2lfY29kZSB8PSBfX1NJX0NITEQ7CisJcmV0dXJu
IGNvcHlfc2lnaW5mb190b191c2VyMzIodWluZm8sICZpbmZvKTsKK30KLS0gCjEuNC4xCgo=
------=_Part_12927_3587587.1154106001113--

From ddaney@avtrex.com Fri Jul 28 18:05:58 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Jul 2006 18:06:06 +0100 (BST)
Received: from smtp1.dnsmadeeasy.com ([205.234.170.134]:20883 "EHLO
	smtp1.dnsmadeeasy.com") by ftp.linux-mips.org with ESMTP
	id S8133936AbWG1RF5 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 28 Jul 2006 18:05:57 +0100
Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id D2529B0E86;
	Fri, 28 Jul 2006 13:18:58 -0400 (EDT)
X-Authenticated-Name: js.dnsmadeeasy
X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com
Received: from avtrex.com (unknown [67.116.42.147])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP;
	Fri, 28 Jul 2006 13:18:58 -0400 (EDT)
Received: from [192.168.7.26] ([192.168.7.26]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Fri, 28 Jul 2006 10:05:48 -0700
Message-ID: <44CA43EC.9010904@avtrex.com>
Date:	Fri, 28 Jul 2006 10:05:48 -0700
From:	David Daney <ddaney@avtrex.com>
User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc3 (X11/20050929)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	ths@networkno.de, vagabon.xyz@gmail.com, linux-mips@linux-mips.org,
	ralf@linux-mips.org
Subject: Re: [PATCH] dump_stack() based on prologue code analysis
References: <20060727170305.GB4505@networkno.de>	<cda58cb80607271151n2dcfe64cn4cb1ecca3ece6b1e@mail.gmail.com>	<20060727191245.GD4505@networkno.de> <20060728.233842.41629448.anemo@mba.ocn.ne.jp>
In-Reply-To: <20060728.233842.41629448.anemo@mba.ocn.ne.jp>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 28 Jul 2006 17:05:48.0503 (UTC) FILETIME=[12997E70:01C6B268]
Return-Path: <ddaney@avtrex.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12113
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ddaney@avtrex.com
Precedence: bulk
X-list: linux-mips

Atsushi Nemoto wrote:
> On Thu, 27 Jul 2006 20:12:45 +0100, Thiemo Seufer <ths@networkno.de> wrote:
> 
>>IOW, binary analysis can't be expected to provide full accuracy, but
>>we can live with a reasonable approximation, I think.
> 
> 
> Yes, this is a starting point.
> 
> The patch (and current mips get_wchan() implementation) tries to do is
> what I used to do to analyze stack dump by hand.
> 
> 1. Determine PC and SP.
> 2. Disassemble a function containing the PC address.
> 3. If the function is leaf, make use RA for new PC.

This was always the tricky part for me.  How do you know if the function 
is a leaf?

.
.
.
David Daney

From nigel@mips.com Fri Jul 28 18:34:47 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Jul 2006 18:34:57 +0100 (BST)
Received: from 209-232-97-206.ded.pacbell.net ([209.232.97.206]:38906 "EHLO
	dns0.mips.com") by ftp.linux-mips.org with ESMTP id S8133763AbWG1Rer
	(ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 28 Jul 2006 18:34:47 +0100
Received: from mercury.mips.com (sbcns-dmz [209.232.97.193])
	by dns0.mips.com (8.12.11/8.12.11) with ESMTP id k6SHYVVv000389;
	Fri, 28 Jul 2006 10:34:32 -0700 (PDT)
Received: from ukservices1.mips.com (ukservices1 [192.168.192.240])
	by mercury.mips.com (8.13.5/8.13.5) with ESMTP id k6SHYWfA024992;
	Fri, 28 Jul 2006 10:34:33 -0700 (PDT)
Received: from wapping.mips-uk.com ([172.20.192.98])
	by ukservices1.mips.com with esmtp (Exim 3.36 #1 (Debian))
	id 1G6WEF-00037m-00; Fri, 28 Jul 2006 18:34:27 +0100
Message-ID: <44CA4AA3.8080700@mips.com>
Date:	Fri, 28 Jul 2006 18:34:27 +0100
From:	Nigel Stephens <nigel@mips.com>
Organization: MIPS Technologies
User-Agent: Thunderbird 1.5.0.4 (X11/20060619)
MIME-Version: 1.0
To:	David Daney <ddaney@avtrex.com>
CC:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>, ths@networkno.de,
	vagabon.xyz@gmail.com, linux-mips@linux-mips.org,
	ralf@linux-mips.org
Subject: Re: [PATCH] dump_stack() based on prologue code analysis
References: <20060727170305.GB4505@networkno.de>	<cda58cb80607271151n2dcfe64cn4cb1ecca3ece6b1e@mail.gmail.com>	<20060727191245.GD4505@networkno.de> <20060728.233842.41629448.anemo@mba.ocn.ne.jp> <44CA43EC.9010904@avtrex.com>
In-Reply-To: <44CA43EC.9010904@avtrex.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-MIPS-Technologies-UK-MailScanner: Found to be clean
X-MIPS-Technologies-UK-MailScanner-From: nigel@mips.com
X-Scanned-By: MIMEDefang 2.39
Return-Path: <nigel@mips.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12114
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: nigel@mips.com
Precedence: bulk
X-list: linux-mips



David Daney wrote:
> Atsushi Nemoto wrote:
>> On Thu, 27 Jul 2006 20:12:45 +0100, Thiemo Seufer <ths@networkno.de> 
>> wrote:
>>
>>> IOW, binary analysis can't be expected to provide full accuracy, but
>>> we can live with a reasonable approximation, I think.
>>
>>
>> Yes, this is a starting point.
>>
>> The patch (and current mips get_wchan() implementation) tries to do is
>> what I used to do to analyze stack dump by hand.
>>
>> 1. Determine PC and SP.
>> 2. Disassemble a function containing the PC address.
>> 3. If the function is leaf, make use RA for new PC.
>
> This was always the tricky part for me.  How do you know if the 
> function is a leaf?
>

I think that if you cannot find a store instruction which saves RA to 
the stack -- either because it's a real leaf and there is no such store, 
or because the PC hasn't yet reached the store instruction -- then in 
both cases it can be treated as a leaf.

Nigel

From ddaney@avtrex.com Fri Jul 28 19:32:34 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Jul 2006 19:32:44 +0100 (BST)
Received: from smtp1.dnsmadeeasy.com ([205.234.170.134]:26604 "EHLO
	smtp1.dnsmadeeasy.com") by ftp.linux-mips.org with ESMTP
	id S8134058AbWG1Sce (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 28 Jul 2006 19:32:34 +0100
Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id BC4A8B0E4C;
	Fri, 28 Jul 2006 14:45:34 -0400 (EDT)
X-Authenticated-Name: js.dnsmadeeasy
X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com
Received: from avtrex.com (unknown [67.116.42.147])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP;
	Fri, 28 Jul 2006 14:45:34 -0400 (EDT)
Received: from [192.168.7.26] ([192.168.7.26]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Fri, 28 Jul 2006 11:32:24 -0700
Message-ID: <44CA5837.2060502@avtrex.com>
Date:	Fri, 28 Jul 2006 11:32:23 -0700
From:	David Daney <ddaney@avtrex.com>
User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc3 (X11/20050929)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To:	Nigel Stephens <nigel@mips.com>
Cc:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>, ths@networkno.de,
	vagabon.xyz@gmail.com, linux-mips@linux-mips.org,
	ralf@linux-mips.org
Subject: Re: [PATCH] dump_stack() based on prologue code analysis
References: <20060727170305.GB4505@networkno.de>	<cda58cb80607271151n2dcfe64cn4cb1ecca3ece6b1e@mail.gmail.com>	<20060727191245.GD4505@networkno.de> <20060728.233842.41629448.anemo@mba.ocn.ne.jp> <44CA43EC.9010904@avtrex.com> <44CA4AA3.8080700@mips.com>
In-Reply-To: <44CA4AA3.8080700@mips.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 28 Jul 2006 18:32:24.0006 (UTC) FILETIME=[2B5C5660:01C6B274]
Return-Path: <ddaney@avtrex.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12115
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ddaney@avtrex.com
Precedence: bulk
X-list: linux-mips

Nigel Stephens wrote:
> 
> 
> David Daney wrote:
> 
>> Atsushi Nemoto wrote:
>>
>>> On Thu, 27 Jul 2006 20:12:45 +0100, Thiemo Seufer <ths@networkno.de> 
>>> wrote:
>>>
>>>> IOW, binary analysis can't be expected to provide full accuracy, but
>>>> we can live with a reasonable approximation, I think.
>>>
>>>
>>>
>>> Yes, this is a starting point.
>>>
>>> The patch (and current mips get_wchan() implementation) tries to do is
>>> what I used to do to analyze stack dump by hand.
>>>
>>> 1. Determine PC and SP.
>>> 2. Disassemble a function containing the PC address.
>>> 3. If the function is leaf, make use RA for new PC.
>>
>>
>> This was always the tricky part for me.  How do you know if the 
>> function is a leaf?
>>
> 
> I think that if you cannot find a store instruction which saves RA to 
> the stack -- either because it's a real leaf and there is no such store, 
> or because the PC hasn't yet reached the store instruction -- then in 
> both cases it can be treated as a leaf.

Presumably you are walking the code back from the PC until you find the 
prolog.  How would you tell if you had gone past the beginning of a leaf 
function?  If you find a j $31 you might assume that it was the end of 
the previous function.

But that does not work if you are in a function that has multiple return 
points.  On encountering a j $31 you have no way of telling if you are 
in a leaf function or a non-leaf function with multiple return points.

I may be missing something here, if you know of a failure-proof manner 
to detect leaf functions I would appreciate hearing what it is.

Thanks,
David Daney.

From ths@networkno.de Fri Jul 28 20:32:04 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Jul 2006 20:32:27 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:42654 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8134060AbWG1Tb6 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 28 Jul 2006 20:31:58 +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 85EDC44841; Fri, 28 Jul 2006 21:31:57 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1G6Y3T-0007iN-F0; Fri, 28 Jul 2006 20:31:27 +0100
Date:	Fri, 28 Jul 2006 20:31:27 +0100
From:	Thiemo Seufer <ths@networkno.de>
To:	David Daney <ddaney@avtrex.com>
Cc:	Nigel Stephens <nigel@mips.com>,
	Atsushi Nemoto <anemo@mba.ocn.ne.jp>, vagabon.xyz@gmail.com,
	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] dump_stack() based on prologue code analysis
Message-ID: <20060728193127.GA25426@networkno.de>
References: <20060727170305.GB4505@networkno.de> <cda58cb80607271151n2dcfe64cn4cb1ecca3ece6b1e@mail.gmail.com> <20060727191245.GD4505@networkno.de> <20060728.233842.41629448.anemo@mba.ocn.ne.jp> <44CA43EC.9010904@avtrex.com> <44CA4AA3.8080700@mips.com> <44CA5837.2060502@avtrex.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <44CA5837.2060502@avtrex.com>
User-Agent: Mutt/1.5.12-2006-07-14
Return-Path: <ths@networkno.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12116
X-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

David Daney wrote:
> Nigel Stephens wrote:
> >
> >
> >David Daney wrote:
> >
> >>Atsushi Nemoto wrote:
> >>
> >>>On Thu, 27 Jul 2006 20:12:45 +0100, Thiemo Seufer <ths@networkno.de> 
> >>>wrote:
> >>>
> >>>>IOW, binary analysis can't be expected to provide full accuracy, but
> >>>>we can live with a reasonable approximation, I think.
> >>>
> >>>
> >>>
> >>>Yes, this is a starting point.
> >>>
> >>>The patch (and current mips get_wchan() implementation) tries to do is
> >>>what I used to do to analyze stack dump by hand.
> >>>
> >>>1. Determine PC and SP.
> >>>2. Disassemble a function containing the PC address.
> >>>3. If the function is leaf, make use RA for new PC.
> >>
> >>
> >>This was always the tricky part for me.  How do you know if the 
> >>function is a leaf?
> >>
> >
> >I think that if you cannot find a store instruction which saves RA to 
> >the stack -- either because it's a real leaf and there is no such store, 
> >or because the PC hasn't yet reached the store instruction -- then in 
> >both cases it can be treated as a leaf.
> 
> Presumably you are walking the code back from the PC until you find the 
> prolog.  How would you tell if you had gone past the beginning of a leaf 
> function?  If you find a j $31 you might assume that it was the end of 
> the previous function.
> 
> But that does not work if you are in a function that has multiple return 
> points.  On encountering a j $31 you have no way of telling if you are 
> in a leaf function or a non-leaf function with multiple return points.

... or in a fragment of a single return function which was moved out
of the hot path, after the return point.


Thiemo

From ralf@denk.linux-mips.net.redhat.com Fri Jul 28 20:41:41 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Jul 2006 20:41:50 +0100 (BST)
Received: from localhost.localdomain ([127.0.0.1]:62876 "EHLO bacchus.dhis.org")
	by ftp.linux-mips.org with ESMTP id S8134075AbWG1Tlk (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 28 Jul 2006 20:41:40 +0100
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by bacchus.dhis.org (8.13.7/8.13.4) with ESMTP id k6SJg6PQ003415;
	Fri, 28 Jul 2006 15:42:06 -0400
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.13.7/8.13.7/Submit) id k6SJg4c1003414;
	Fri, 28 Jul 2006 15:42:04 -0400
Date:	Fri, 28 Jul 2006 15:42:04 -0400
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Ricardo Nabinger Sanchez <rnsanchez@gmail.com>
Cc:	freebsd-mips@freebsd.org, linux-mips@linux-mips.org
Subject: Re: ld: cannot open crt1.o
Message-ID: <20060728194204.GA28080@linux-mips.org>
References: <20060728162202.4567446d.rnsanchez@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060728162202.4567446d.rnsanchez@gmail.com>
User-Agent: Mutt/1.4.2.1i
Return-Path: <ralf@denk.linux-mips.net.redhat.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: 12117
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips

On Fri, Jul 28, 2006 at 04:22:02PM -0300, Ricardo Nabinger Sanchez wrote:

> I'm trying to get my mipsel-linux environment to work, but no success:
>
> % mipsel-linux-gcc test.c
> /usr/local/lib/gcc-lib/mipsel-linux/2.97/../../../../mipsel-linux/bin/ld:
> cannot open crt1.o: No such file or directory
> collect2: ld returned 1 exit status
> Exit 1
> 
> % cat test.c 
> int main() {
>         return 0;
> }
> 
> % fgrep crt1.o -r /var/db/pkg/mipsel-linux-*
> Exit 1
> 
> Here there's only the crt1.o from the base gcc (not the MIPS one):
> % find /usr -type f -name crt1.o
> /usr/lib/crt1.o
> 
> 
> I feel like clearly missing something very basic here.  Aren't these ports
> enough?
> 
> 	devel/mipsel-linux-binutils
> 	devel/mipsel-linux-gcc
> 	devel/mipsel-linux-kernel-headers

crt1.o is part of glibc; you only seem to have installed cross versions of
binutils and gcc.

  Ralf

From rnsanchez@gmail.com Fri Jul 28 22:31:09 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 28 Jul 2006 22:31:18 +0100 (BST)
Received: from wr-out-0506.google.com ([64.233.184.232]:65477 "EHLO
	wr-out-0506.google.com") by ftp.linux-mips.org with ESMTP
	id S8133727AbWG1VbJ (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 28 Jul 2006 22:31:09 +0100
Received: by wr-out-0506.google.com with SMTP id i23so139122wra
        for <linux-mips@linux-mips.org>; Fri, 28 Jul 2006 14:31:07 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer:mime-version:content-type:content-transfer-encoding;
        b=PaY+tdALS5e/4yLJGGfj5lft3gpWbLqq88yIqivITmOFCVaaSNqi+0yIWUsLxnyCps6Ub8VhoeHcZwja59a64ITUsXXASmJ2p1o5R1h4vMkxIYXGBVOblxI1iu3TySpBgtQA0Zsbecq7eWNi6yA6X1/jg7TfKMuoqIoUVLrvwoU=
Received: by 10.54.66.1 with SMTP id o1mr10076117wra;
        Fri, 28 Jul 2006 14:31:06 -0700 (PDT)
Received: from sauron.lan.box ( [200.180.163.244])
        by mx.gmail.com with ESMTP id 14sm386709wrl.2006.07.28.14.31.04;
        Fri, 28 Jul 2006 14:31:06 -0700 (PDT)
Date:	Fri, 28 Jul 2006 18:31:02 -0300
From:	Ricardo Nabinger Sanchez <rnsanchez@gmail.com>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	freebsd-mips@freebsd.org, linux-mips@linux-mips.org
Subject: Re: ld: cannot open crt1.o
Message-Id: <20060728183102.1f08dcd4.rnsanchez@gmail.com>
In-Reply-To: <20060728194204.GA28080@linux-mips.org>
References: <20060728162202.4567446d.rnsanchez@gmail.com>
	<20060728194204.GA28080@linux-mips.org>
X-Mailer: Sylpheed version 2.2.6 (GTK+ 2.8.20; i386-portbld-freebsd6.1)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <rnsanchez@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: 12118
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: rnsanchez@gmail.com
Precedence: bulk
X-list: linux-mips

Quoting  Ralf Baechle <ralf@linux-mips.org>
Sent on  Fri, 28 Jul 2006 15:42:04 -0400

> crt1.o is part of glibc; you only seem to have installed cross versions of
> binutils and gcc.

Yes, I installed the mipsel-* packages from ports, on 6.1-STABLE.  Does
it have to be glibc or can it be uClibc?

Anyway, I'll check my possibilities.  In case of further problems, I bug
you guys again.

Thanks.

ps: please note that I'm on a FreeBSD box.

-- 
Ricardo Nabinger Sanchez     <rnsanchez@{gmail.com,wait4.org}>
Powered by FreeBSD

  "Left to themselves, things tend to go from bad to worse."

From anemo@mba.ocn.ne.jp Sat Jul 29 15:23:58 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 29 Jul 2006 15:24:08 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:24006 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133802AbWG2OX6 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sat, 29 Jul 2006 15:23:58 +0100
Received: from localhost (p6108-ipad213funabasi.chiba.ocn.ne.jp [124.85.71.108])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 9945CB032; Sat, 29 Jul 2006 23:23:52 +0900 (JST)
Date:	Sat, 29 Jul 2006 23:25:23 +0900 (JST)
Message-Id: <20060729.232523.74752889.anemo@mba.ocn.ne.jp>
To:	ddaney@avtrex.com
Cc:	nigel@mips.com, ths@networkno.de, vagabon.xyz@gmail.com,
	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] dump_stack() based on prologue code analysis
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <44CA5837.2060502@avtrex.com>
References: <44CA43EC.9010904@avtrex.com>
	<44CA4AA3.8080700@mips.com>
	<44CA5837.2060502@avtrex.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: 12119
X-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 Fri, 28 Jul 2006 11:32:23 -0700, David Daney <ddaney@avtrex.com> wrote:
> >> This was always the tricky part for me.  How do you know if the 
> >> function is a leaf?
> > 
> > I think that if you cannot find a store instruction which saves RA to 
> > the stack -- either because it's a real leaf and there is no such store, 
> > or because the PC hasn't yet reached the store instruction -- then in 
> > both cases it can be treated as a leaf.

Right.

> Presumably you are walking the code back from the PC until you find the 
> prolog.  How would you tell if you had gone past the beginning of a leaf 
> function?  If you find a j $31 you might assume that it was the end of 
> the previous function.

I think you are misunderstanding here.

What the get_frame_info() doing is just searching "sw $ra, ofs($sp)"
and "addiu sp,sp,-imm" instructions from beginning of the function.
We can obtain the start address and size of the function by
kallsyms_lookup().  This is why those stuff depend on CONFIG_KALLSYMS.

> I may be missing something here, if you know of a failure-proof manner 
> to detect leaf functions I would appreciate hearing what it is.

I have no good idea to do it without CONFIG_KALL_SYMS.
I suppose there is no silver bullet here...

---
Atsushi Nemoto

From anemo@mba.ocn.ne.jp Sat Jul 29 15:25:53 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 29 Jul 2006 15:26:04 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:28135 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8133802AbWG2OZx (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sat, 29 Jul 2006 15:25:53 +0100
Received: from localhost (p6108-ipad213funabasi.chiba.ocn.ne.jp [124.85.71.108])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id EC04CA743; Sat, 29 Jul 2006 23:25:48 +0900 (JST)
Date:	Sat, 29 Jul 2006 23:27:20 +0900 (JST)
Message-Id: <20060729.232720.108740310.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org, vagabon.xyz@gmail.com
Subject: [PATCH] dump_stack() based on prologue code analysis (take 2)
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: 12120
X-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

Take 2.  Reflecting some advices from Franck Bui-Huu.


Subject: [PATCH] dump_stack() based on prologue code analysis

Instead of dump all possible address in the stack, unwind the stack
frame based on prologue code analysis, as like as get_wchan() does.
While the code analysis might fail for some reason, there is a new
kernel option "raw_show_trace" to disable this feature.

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

diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 7ab67f7..8709a46 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -281,7 +281,7 @@ static struct mips_frame_info {
 } *schedule_frame, mfinfo[64];
 static int mfinfo_num;
 
-static int __init get_frame_info(struct mips_frame_info *info)
+static int get_frame_info(struct mips_frame_info *info)
 {
 	int i;
 	void *func = info->func;
@@ -329,14 +329,12 @@ #endif
 				ip->i_format.simmediate / sizeof(long);
 		}
 	}
-	if (info->pc_offset == -1 || info->frame_size == 0) {
-		if (func == schedule)
-			printk("Can't analyze prologue code at %p\n", func);
-		info->pc_offset = -1;
-		info->frame_size = 0;
-	}
-
-	return 0;
+	if (info->frame_size && info->pc_offset >= 0) /* nested */
+		return 0;
+	if (info->pc_offset < 0) /* leaf */
+		return 1;
+	/* prologue seems boggus... */
+	return -1;
 }
 
 static int __init frame_info_init(void)
@@ -367,8 +365,15 @@ #else
 	mfinfo[0].func = schedule;
 	schedule_frame = &mfinfo[0];
 #endif
-	for (i = 0; i < ARRAY_SIZE(mfinfo) && mfinfo[i].func; i++)
-		get_frame_info(&mfinfo[i]);
+	for (i = 0; i < ARRAY_SIZE(mfinfo) && mfinfo[i].func; i++) {
+		struct mips_frame_info *info = &mfinfo[i];
+		if (get_frame_info(info)) {
+			/* leaf or unknown */
+			if (info->func == schedule)
+				printk("Can't analyze prologue code at %p\n",
+				       info->func);
+		}
+	}
 
 	mfinfo_num = i;
 	return 0;
@@ -427,6 +432,8 @@ #ifdef CONFIG_KALLSYMS
 		if (i < 0)
 			break;
 
+		if (mfinfo[i].pc_offset < 0)
+			break;
 		pc = ((unsigned long *)frame)[mfinfo[i].pc_offset];
 		if (!mfinfo[i].frame_size)
 			break;
@@ -437,3 +444,40 @@ #endif
 	return pc;
 }
 
+#ifdef CONFIG_KALLSYMS
+/* used by show_frametrace() */
+unsigned long unwind_stack(struct task_struct *task,
+			   unsigned long **sp, unsigned long pc)
+{
+	unsigned long stack_page;
+	struct mips_frame_info info;
+	char *modname;
+	char namebuf[KSYM_NAME_LEN + 1];
+	unsigned long size, ofs;
+
+	stack_page = (unsigned long)task_stack_page(task);
+	if (!stack_page)
+		return 0;
+
+	if (!kallsyms_lookup(pc, &size, &ofs, &modname, namebuf))
+		return 0;
+	if (ofs == 0)
+		return 0;
+
+	info.func = (void *)(pc - ofs);
+	info.func_size = ofs;	/* analyze from start to ofs */
+	if (get_frame_info(&info)) {
+		/* leaf or unknown */
+		*sp += info.frame_size / sizeof(long);
+		return 0;
+	}
+	if ((unsigned long)*sp < stack_page ||
+	    (unsigned long)*sp + info.frame_size / sizeof(long) >
+	    stack_page + THREAD_SIZE - 32)
+		return 0;
+
+	pc = (*sp)[info.pc_offset];
+	*sp += info.frame_size / sizeof(long);
+	return pc;
+}
+#endif
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index c6f7046..7aa9dfc 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -98,24 +98,53 @@ #endif
 	printk("\n");
 }
 
+#ifdef CONFIG_KALLSYMS
+static int raw_show_trace;
+static int __init set_raw_show_trace(char *str)
+{
+	raw_show_trace = 1;
+	return 1;
+}
+__setup("raw_show_trace", set_raw_show_trace);
+
+extern unsigned long unwind_stack(struct task_struct *task,
+				  unsigned long **sp, unsigned long pc);
+static void show_frametrace(struct task_struct *task, struct pt_regs *regs)
+{
+	const int field = 2 * sizeof(unsigned long);
+	unsigned long *stack = (long *)regs->regs[29];
+	unsigned long pc = regs->cp0_epc;
+	int top = 1;
+
+	if (raw_show_trace || !__kernel_text_address(pc)) {
+		show_trace(stack);
+		return;
+	}
+	printk("Call Trace:\n");
+	while (__kernel_text_address(pc)) {
+		printk(" [<%0*lx>] ", field, pc);
+		print_symbol("%s\n", pc);
+		pc = unwind_stack(task, &stack, pc);
+		if (top && pc == 0)
+			pc = regs->regs[31];	/* leaf? */
+		top = 0;
+	}
+	printk("\n");
+}
+#else
+#define show_frametrace(task, r) show_trace((long *)(r)->regs[29]);
+#endif
+
 /*
  * This routine abuses get_user()/put_user() to reference pointers
  * with at least a bit of error checking ...
  */
-void show_stack(struct task_struct *task, unsigned long *sp)
+static void show_stacktrace(struct task_struct *task, struct pt_regs *regs)
 {
 	const int field = 2 * sizeof(unsigned long);
 	long stackdata;
 	int i;
-	unsigned long *stack;
-
-	if (!sp) {
-		if (task && task != current)
-			sp = (unsigned long *) task->thread.reg29;
-		else
-			sp = (unsigned long *) &sp;
-	}
-	stack = sp;
+	unsigned long *sp = (unsigned long *)regs->regs[29];
 
 	printk("Stack :");
 	i = 0;
@@ -136,7 +165,44 @@ void show_stack(struct task_struct *task
 		i++;
 	}
 	printk("\n");
-	show_trace(stack);
+	show_frametrace(task, regs);
+}
+
+static noinline void prepare_frametrace(struct pt_regs *regs)
+{
+	__asm__ __volatile__(
+		"1: la $2, 1b\n\t"
+#ifdef CONFIG_64BIT
+		"sd $2, %0\n\t"
+		"sd $29, %1\n\t"
+		"sd $31, %2\n\t"
+#else
+		"sw $2, %0\n\t"
+		"sw $29, %1\n\t"
+		"sw $31, %2\n\t"
+#endif
+		: "=m" (regs->cp0_epc),
+		"=m" (regs->regs[29]), "=m" (regs->regs[31])
+		: : "memory");
+}
+
+void show_stack(struct task_struct *task, unsigned long *sp)
+{
+	struct pt_regs regs;
+	if (sp) {
+		regs.regs[29] = (unsigned long)sp;
+		regs.regs[31] = 0;
+		regs.cp0_epc = 0;
+	} else {
+		if (task && task != current) {
+			regs.regs[29] = task->thread.reg29;
+			regs.regs[31] = 0;
+			regs.cp0_epc = task->thread.reg31;
+		} else {
+			prepare_frametrace(&regs);
+		}
+	}
+	show_stacktrace(task, &regs);
 }
 
 /*
@@ -146,6 +212,14 @@ void dump_stack(void)
 {
 	unsigned long stack;
 
+#ifdef CONFIG_KALLSYMS
+	if (!raw_show_trace) {
+		struct pt_regs regs;
+		prepare_frametrace(&regs);
+		show_frametrace(current, &regs);
+		return;
+	}
+#endif
 	show_trace(&stack);
 }
 
@@ -265,7 +339,7 @@ void show_registers(struct pt_regs *regs
 	print_modules();
 	printk("Process %s (pid: %d, threadinfo=%p, task=%p)\n",
 	        current->comm, current->pid, current_thread_info(), current);
-	show_stack(current, (long *) regs->regs[29]);
+	show_stacktrace(current, regs);
 	show_code((unsigned int *) regs->cp0_epc);
 	printk("\n");
 }

From tbm@cyrius.com Sun Jul 30 23:41:47 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 30 Jul 2006 23:41:57 +0100 (BST)
Received: from sorrow.cyrius.com ([65.19.161.204]:59410 "EHLO
	sorrow.cyrius.com") by ftp.linux-mips.org with ESMTP
	id S8133883AbWG3Wlr (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 30 Jul 2006 23:41:47 +0100
Received: by sorrow.cyrius.com (Postfix, from userid 10)
	id 00ED664D54; Sun, 30 Jul 2006 22:41:38 +0000 (UTC)
Received: by deprecation.cyrius.com (Postfix, from userid 1000)
	id 811BB66BCD; Mon, 31 Jul 2006 00:41:37 +0200 (CEST)
Date:	Mon, 31 Jul 2006 00:41:37 +0200
From:	Martin Michlmayr <tbm@cyrius.com>
To:	linux-mips@linux-mips.org
Cc:	Roger Leigh <rleigh@debian.org>, 380531-silent@bugs.debian.org
Subject: Re: Bug#380531: linux-2.6: mips and mipsel personality(2) support is broken
Message-ID: <20060730224137.GP17134@deprecation.cyrius.com>
References: <20060730183939.7119.48747.reportbug@hardknott.home.whinlatter.ukfsn.org>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="h31gzZEtNLTqOjlF"
Content-Disposition: inline
In-Reply-To: <20060730183939.7119.48747.reportbug@hardknott.home.whinlatter.ukfsn.org>
User-Agent: Mutt/1.5.11+cvs20060403
Return-Path: <tbm@cyrius.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12121
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: tbm@cyrius.com
Precedence: bulk
X-list: linux-mips


--h31gzZEtNLTqOjlF
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

FYI, but report tht "mips and mipsel personality(2) support is broken"

* Roger Leigh <rleigh@debian.org> [2006-07-30 19:39]:
> personality(2) only works the first time it is called [in the lifetime
> of a process/program].  All subsequent calls return EPERM, which is
> not a documented return value; I can see no mention of it in
> kernel/execdomain.c.  None of the other architectures I have tested
> (amd64, arm, i386, ia64, powerpc) behave this way: personality(2) is
> not a privileged call.
> 
> This happens no matter what the value of persona is, even if it is
> just 0xffffffff to query the current personality.
> 
> The attached testcase demonstrates the breakage.  On a working
> platform (powerpc), the output is like this:
> 
> ------------------------
> $ ./testpersona
> Getting personality
> Get returned '0'
> Setting personality '8'
> Set OK
> Getting personality
> Get returned '8'
> Setting personality '0'
> Set OK
> Getting personality
> Get returned '0'
> ------------------------
> 
> 0 == PER_LINUX
> 8 == PER_LINUX32
> 
> It successfully switched from PER_LINUX to PER_LINUX32 and back again,
> checking the personality before and after each change.
> 
> 
> Regards,
> Roger

-- 
Martin Michlmayr
http://www.cyrius.com/

--h31gzZEtNLTqOjlF
Content-Type: text/x-csrc; charset=us-ascii
Content-Disposition: attachment; filename="testpersona.c"

#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/personality.h>

int
set_persona (unsigned long p)
{
  fprintf (stderr, "Setting personality '%lu'\n", p);

  int status = personality(p);
  if (status == -1)
    fprintf(stderr, "Set failed: %s\n", strerror(errno));

  fprintf(stderr, "Set OK\n");

  return status;
}

int
get_persona (void)
{
  fprintf (stderr, "Getting personality\n");

  int status = personality(0xffffffff);
  if (status == -1)
    fprintf(stderr, "Get failed: %s\n", strerror(errno));

  fprintf(stderr, "Get returned '%d'\n", status);

  return status;
}

int
main (void)
{
  get_persona();
  set_persona(PER_LINUX32);
  get_persona();
  set_persona(PER_LINUX);
  get_persona();
  return 0;
}

--h31gzZEtNLTqOjlF--

From rleigh@whinlatter.ukfsn.org Mon Jul 31 00:20:16 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 31 Jul 2006 00:20:25 +0100 (BST)
Received: from s2.ukfsn.org ([217.158.120.143]:17546 "EHLO mail.ukfsn.org")
	by ftp.linux-mips.org with ESMTP id S8133889AbWG3XUQ (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 31 Jul 2006 00:20:16 +0100
Received: from hardknott.home.whinlatter.ukfsn.org (84-45-213-194.no-dns-yet.enta.net [84.45.213.194])
	by mail.ukfsn.org (Postfix) with ESMTP
	id 20519E714C; Mon, 31 Jul 2006 00:20:06 +0100 (BST)
Received: from rleigh by hardknott.home.whinlatter.ukfsn.org with local (Exim 4.62)
	(envelope-from <rleigh@whinlatter.ukfsn.org>)
	id 1G7KZr-0006Lt-QT; Mon, 31 Jul 2006 00:20:07 +0100
From:	Roger Leigh <rleigh@whinlatter.ukfsn.org>
To:	Martin Michlmayr <tbm@cyrius.com>
Cc:	linux-mips@linux-mips.org, 380531-silent@bugs.debian.org
Subject: Re: Bug#380531: linux-2.6: mips and mipsel personality(2) support is broken
References: <20060730183939.7119.48747.reportbug@hardknott.home.whinlatter.ukfsn.org>
	<20060730224137.GP17134@deprecation.cyrius.com>
Date:	Mon, 31 Jul 2006 00:20:05 +0100
In-Reply-To: <20060730224137.GP17134@deprecation.cyrius.com> (Martin
	Michlmayr's message of "Mon, 31 Jul 2006 00:41:37 +0200")
Message-ID: <87veper87u.fsf@hardknott.home.whinlatter.ukfsn.org>
User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
	micalg=pgp-sha1; protocol="application/pgp-signature"
Return-Path: <rleigh@whinlatter.ukfsn.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: 12122
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: rleigh@whinlatter.ukfsn.org
Precedence: bulk
X-list: linux-mips

--=-=-=
Content-Transfer-Encoding: quoted-printable

Martin Michlmayr <tbm@cyrius.com> writes:

> FYI, but report tht "mips and mipsel personality(2) support is broken"
>
> * Roger Leigh <rleigh@debian.org> [2006-07-30 19:39]:
>> personality(2) only works the first time it is called [in the lifetime
>> of a process/program].  All subsequent calls return EPERM, which is
>> not a documented return value; I can see no mention of it in
>> kernel/execdomain.c.  None of the other architectures I have tested
>> (amd64, arm, i386, ia64, powerpc) behave this way: personality(2) is
>> not a privileged call.
>>=20
>> This happens no matter what the value of persona is, even if it is
>> just 0xffffffff to query the current personality.

Just a follow up:

There is a twist to the behaviour:

If personality(2) is called with a personality other than 0xffffffff
(query), and it fails, a subsequent call (any persona value) will
succeed.

I can't see any reason for the behaviour looking at the
kernel/execdomain.c or arch/mips/kernel/linux32.c.  ths believes it's
due to a bug in the syscall interface:

<ths> I believe it is related to sign extension.
<ths> o32 queries with 0xffffffff, which is really 0xffffffffffffffff, then=
 the kernel compares against 0xffffffff.
<rleigh> I haven't heard of that.  Is it MIPS-specific, or a 64-bit-specifi=
c thing?
<ths> mips uses sign-extended registers for 32bit values.
<ths> There's no 64bit mode switch.
<ths> (The argument for the sys32_personality should be int, not long.)


=2D-=20
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please sign and encrypt your mail.

--=-=-=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEzT6nVcFcaSW/uEgRAhlYAKDwVC2cKrLiDTv6IM5vveapSt4sNACfWbGo
Ka4e+Tgtds2j1eUFIxjsfDc=
=yFZw
-----END PGP SIGNATURE-----
--=-=-=--

From ths@networkno.de Mon Jul 31 00:20:51 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 31 Jul 2006 00:21:07 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:10904 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8133893AbWG3XUs (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 31 Jul 2006 00:20:48 +0100
Received: from lagash (88-106-139-84.dynamic.dsl.as9105.com [88.106.139.84])
	(using TLSv1 with cipher DES-CBC3-SHA (168/168 bits))
	(No client certificate requested)
	by bender.bawue.de (Postfix) with ESMTP
	id 51B2C44124; Mon, 31 Jul 2006 01:19:50 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1G7KZ5-0005CB-LA; Mon, 31 Jul 2006 00:19:19 +0100
Date:	Mon, 31 Jul 2006 00:19:19 +0100
To:	Martin Michlmayr <tbm@cyrius.com>
Cc:	linux-mips@linux-mips.org, Roger Leigh <rleigh@debian.org>,
	380531-silent@bugs.debian.org
Subject: Re: Bug#380531: linux-2.6: mips and mipsel personality(2) support is broken
Message-ID: <20060730231919.GD15011@networkno.de>
References: <20060730183939.7119.48747.reportbug@hardknott.home.whinlatter.ukfsn.org> <20060730224137.GP17134@deprecation.cyrius.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20060730224137.GP17134@deprecation.cyrius.com>
User-Agent: Mutt/1.5.12-2006-07-14
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: 12123
X-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

Martin Michlmayr wrote:
> FYI, but report tht "mips and mipsel personality(2) support is broken"

This patch fixes sys_personality for the o32 emulation by
 a) killing the sign extension bits
 b) tighten the bitmask match for current->personality (like it is done
    for x86_64)


Thiemo


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


--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -1053,7 +1053,9 @@ asmlinkage long sys32_newuname(struct ne
 asmlinkage int sys32_personality(unsigned long personality)
 {
 	int ret;
-	if (current->personality == PER_LINUX32 && personality == PER_LINUX)
+	personality &= 0xffffffff;
+	if (personality(current->personality) == PER_LINUX32 &&
+	    personality == PER_LINUX)
 		personality = PER_LINUX32;
 	ret = sys_personality(personality);
 	if (ret == PER_LINUX32)

From wyb@topsec.com.cn Mon Jul 31 03:01:23 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 31 Jul 2006 03:01:33 +0100 (BST)
Received: from [202.99.27.194] ([202.99.27.194]:57063 "EHLO
	mail1.topsec.com.cn") by ftp.linux-mips.org with ESMTP
	id S8133918AbWGaCBX (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 31 Jul 2006 03:01:23 +0100
Received: from codingman ([192.168.83.211])
	by mail1.topsec.com.cn (MOS 3.7.3a-GA)
	with ESMTP id ASG16567 (AUTH wyb);
	Mon, 31 Jul 2006 09:51:12 +0800 (CST)
Message-ID: <000f01c6b444$e1e820e0$0100000a@codingman>
From:	<wyb@topsec.com.cn>
To:	"Ralf Baechle" <ralf@linux-mips.org>
Cc:	<macro@linux-mips.org>, <sskowron@ET.PUT.Poznan.PL>,
	<rsandifo@redhat.com>, <linux-mips@linux-mips.org>
References: <004001c6af95$14585900$0100000a@codingman> <20060725034424.GB22138@linux-mips.org>
Subject: Re: unmatched R_MIPS_HI16/LO16 on gcc 3.4.3
Date:	Mon, 31 Jul 2006 09:58:28 +0800
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="----=_NextPart_000_000C_01C6B487.DF72B8A0"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1807
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807
X-Junkmail-Whitelist: YES (by domain whitelist at mail1.topsec.com.cn)
Return-Path: <wyb@topsec.com.cn>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 12124
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: wyb@topsec.com.cn
Precedence: bulk
X-list: linux-mips

This is a multi-part message in MIME format.

------=_NextPart_000_000C_01C6B487.DF72B8A0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit


Attachment is a testsuit. It costed me a week to make this testsuit.

If I added -mno-explicit-relocs -mno-split-addresses to makefile, this bug
disappeared. Is there any performance difference with and without these
flags ?

Thanks!

----- Original Message ----- 
From: "Ralf Baechle" <ralf@linux-mips.org>
To: <wyb@topsec.com.cn>
Cc: <macro@linux-mips.org>; <sskowron@ET.PUT.Poznan.PL>;
<rsandifo@redhat.com>; <linux-mips@linux-mips.org>
Sent: Tuesday, July 25, 2006 11:44 AM
Subject: Re: unmatched R_MIPS_HI16/LO16 on gcc 3.4.3


> On Tue, Jul 25, 2006 at 10:49:56AM +0800, wyb@topsec.com.cn wrote:
>
> > I met similar problem as Stanislaw Skowronek, but for gcc 3.4.3. I
created a
> > kernel module, when insmod, kernel reported "dangerous relocation". I
traced
> > the bug, found unmatched R_MIPS_HI16/LO16 in module's elf file, and
kernel
> > refused to relocate:
> > ...
> > 00015a5c  00039a05 R_MIPS_HI16       0000000c   tos_net_debug
> > 00015a68  00000204 R_MIPS_26         00000000   .text
> > 00015a64  00046005 R_MIPS_HI16       0006b598   arp_proxy_list
> > 00015a6c  00046006 R_MIPS_LO16       0006b598   arp_proxy_list
> > ...
> >
> > My problem arised when expression on tos_net_debug could be optimized
out,
> > it seemed like gcc optimized out the LO16, but left HI16.
> >
> > The original discussion on similar problem is at
> > http://www.linux-mips.org/archives/linux-mips/2005-05/msg00097.html
>
> Do you have a testcase, a kernel .config file to trigger this?
>
>   Ralf
>

------=_NextPart_000_000C_01C6B487.DF72B8A0
Content-Type: application/octet-stream;
	name="bug.tgz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	filename="bug.tgz"

H4sIAC5jzUQAA+1Ye3PaRhD3v9Kn2DiJRyI8JBnjNK48Q2zsMLGB8GiTaTtXgQSoBonqkdpN/d27
exJCCOFMp3UybdmxD2lv73e7e3d7u7o2bqyxPbP2HpEUVVGOj6p7SkTZX+W4Wt1TlWrtUKup1eox
yqva4eEeKI+p1JJCPzA8gD3PdYOH5D7X/y8l8arZGrwHHSqh71V8b1SZ2U54G7UlrVwrq8cVUWy8
73fr7Oziqn7Zgxc6lL43ZjMotTUoTaDUfCZxGLliO6NZaFqc1W/3WLN1djU4b7DzZlfOZVYcK4Af
RYH6eo2M/DljbxvdVuOKMXy5bp8Prhr4cNZuXTQvWavRv2he9RtdZBFsZAlhjd25HZTGnjG3SgvX
dgLLg2fSWWcQYbY6rNl9x+qve2jUWZ+Dt84brweXMVK7xbQaPE1eetcdUXSHv5Tm8EqHYTgpuyK2
JWT5xCG34btadpePGkqI6KJXMHfNcGb5Yvz7ShSeSdf1tw0ZvtNVKJ3B0nfQG7xGs3v6z4vfzJ+T
ceJoZhkODvPmUBpDoXzjYoO95RH+umBg6+P/ApYipEIhVgX5ovjQ+pPQY+8xRani+T/aev7peXn+
1ZpC8eKwWtuDo8dWjOh/fv6TrTt6vDko/teqW+N/tXpUS9ZfoX2iqoc1dRf/vwQ9XUbsb6O4H4Wd
8vRUzPbcWJ5jzfJ6Rq4ztid5PRjcTeujPcoF9G+G4Xic12Mv8rgz2w/W+PsUiaf7omjdYoR3AAM9
GN6C+ZZjSvTiLooQOr49cSwTRlNc54LpB2xujDb4eA44X4Q0ZYRwp0yseDxj4aEGMcdeLBmEg2/r
MH7ghaMA0BsscgfqYX2U4SRRPZYgE9nUMkxux8Jzb+8Y8VAyZWOEg8YTwFMT8zfHAs5gE88IQjtw
Q58hgiCtRA9AuX2pyMmMH13bpKtMY7ZjB1L0TirheQjsEZ+I8T7gAtQvi59EYTVGxukFzwpChFNw
5L24HMzBGLNucTRqZyej79cWa+x6vxmeuZqUj7OdGRnEMsbwZY18Im1xKKm34ckCPZ4kHSvHWk7g
3UEBGQvsjpbPjh9fwhBX+Yef9E/K7XhchIfa++WQAg6BE0CnVAotNwBSmOYDewx8Sli47gxsHwLX
haE9KVSS5buuv2eX3Xp/0Oy3Bz1W73ZYp9t+/0E4UjUERAQJniz9JYvC0u+0BDStjhvgY+kUG2aY
pkds7gIcwixjNJXorQgH6/tKBvSYQB5AgKnhTzV65i7m3WgZn9oJ3OlMor7Sqb2gCTRMpWCTrcrw
AlQ4xWREELbZROoLGDQCPNYWacrnyNvAkX7CwsPdciPt98ihKwnuWzSQ/0YO3idxYf95WF7+6bp+
mnotkp/guf+js1/ksq1m592gfp6xogh5fE2OxnBXO5hdcgfd4z/+kSKSTY7Mc8sJbi34Nq9P430v
XpCthF4pUFswXXCWeyhjMnorPi+R0YhseBagRx1rFFhmmQNUqCXHRpONZ8YEdB16/Xq/ecYok4dK
4eCAG2QvmO2zBECaBq4zQ2Nk7i65UOFbLr1o3GQhiba4tu0O6zY6Vx+K/OgUgUdTGhS9piAz6LEP
7yk4LI8D4r3pnrNG/w2m94KaCZOpcz9z3cXQGN3QO8KF8/kdPfKQksgOPducYIwYeuylojHVPBEp
/GTiS2DPLY95oYNLqNLBiqNYThiSkoth5joTvCZC3zLT4ScTmVbhx3YSfvRI+59vHXzW6fgODd86
IcfwRo/2Gtof7w9aUYkzaUV9jOvNiws26Mi6rmQOViT8BHWxx2xkeJ6N9rk3NFrOFd2AbbVxIbaJ
0m46SPsf/viDq6wfJOuQHZueKLhbWPBEX1vrzdDw0DUQ7x7cN24YYIn0wIIq/HqKq7Do+qKGrrCY
R5eVRJcV8aJaE0vKs0ar15D2LztX+8j/2tnaP09Jvfr18n9Vw5w/qf+Ij/l/dff954vQfyL//3z2
vJ426zxdTWegccT/K/eLmJ9B0yXQbDX7GDt6ffamgSlENunCkDW35r6FYw7W8ZUi+PbvljuW0nyZ
5+WrMYkW6QGrkMulMdj9I+WQ8DfrIOGhAoh8tTWzpSVaPgsqN+lrH5b/IMXxvzx9xDk+F/+PjqPv
f/TxRzus8u//x0e7+P8lKL8q/iRmPl2sQitE5fSyPzrtEJc5W/jaSRYvHQl4rpsdSFkoHvmTpCJY
r06xMuQqcW0liUqJfEuKXE5OYNLlT5qUROL8Q6t+nSOiJhKten8TAElbq194PfRu0Oj1aXBGtFIg
EfCsX0MLL6gNSn0ZSJVW0SzboBazu02gPKhErcNNqO5DauVBxWpVt0Llq7UB1XSWar3chGo6D6iV
CxWp9c12qFy1NqBa9bdxl6psQEn1/rVMaCupNaj0p66pQRU21iKO7dB3u6997ne0ox3taEc72tGO
dvT/pD8Bm3blsAAoAAA=

------=_NextPart_000_000C_01C6B487.DF72B8A0
Content-Type: application/octet-stream;
	name=".config"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename=".config"

#=0A=
# Automatically generated make config: don't edit=0A=
# Linux kernel version: 2.6.16.17=0A=
# Mon Jul 31 09:50:46 2006=0A=
#=0A=
CONFIG_MIPS=3Dy=0A=
=0A=
#=0A=
# Machine selection=0A=
#=0A=
# CONFIG_MIPS_MTX1 is not set=0A=
# CONFIG_MIPS_BOSPORUS is not set=0A=
# CONFIG_MIPS_PB1000 is not set=0A=
# CONFIG_MIPS_PB1100 is not set=0A=
# CONFIG_MIPS_PB1500 is not set=0A=
# CONFIG_MIPS_PB1550 is not set=0A=
# CONFIG_MIPS_PB1200 is not set=0A=
# CONFIG_MIPS_DB1000 is not set=0A=
# CONFIG_MIPS_DB1100 is not set=0A=
# CONFIG_MIPS_DB1500 is not set=0A=
# CONFIG_MIPS_DB1550 is not set=0A=
# CONFIG_MIPS_DB1200 is not set=0A=
# CONFIG_MIPS_MIRAGE is not set=0A=
# CONFIG_MIPS_COBALT is not set=0A=
# CONFIG_MACH_DECSTATION is not set=0A=
# CONFIG_MIPS_EV64120 is not set=0A=
# CONFIG_MIPS_EV96100 is not set=0A=
# CONFIG_MIPS_IVR is not set=0A=
# CONFIG_MIPS_ITE8172 is not set=0A=
# CONFIG_MACH_JAZZ is not set=0A=
# CONFIG_LASAT is not set=0A=
# CONFIG_MIPS_ATLAS is not set=0A=
# CONFIG_MIPS_MALTA is not set=0A=
# CONFIG_MIPS_SEAD is not set=0A=
# CONFIG_MIPS_SIM is not set=0A=
# CONFIG_MOMENCO_JAGUAR_ATX is not set=0A=
# CONFIG_MOMENCO_OCELOT is not set=0A=
# CONFIG_MOMENCO_OCELOT_3 is not set=0A=
# CONFIG_MOMENCO_OCELOT_C is not set=0A=
# CONFIG_MOMENCO_OCELOT_G is not set=0A=
# CONFIG_MIPS_XXS1500 is not set=0A=
# CONFIG_PNX8550_V2PCI is not set=0A=
# CONFIG_PNX8550_JBS is not set=0A=
# CONFIG_DDB5074 is not set=0A=
# CONFIG_DDB5476 is not set=0A=
# CONFIG_DDB5477 is not set=0A=
# CONFIG_MACH_VR41XX is not set=0A=
# CONFIG_PMC_YOSEMITE is not set=0A=
# CONFIG_QEMU is not set=0A=
# CONFIG_SGI_IP22 is not set=0A=
# CONFIG_SGI_IP27 is not set=0A=
# CONFIG_SGI_IP32 is not set=0A=
CONFIG_SIBYTE_BIGSUR=3Dy=0A=
# CONFIG_SIBYTE_SWARM is not set=0A=
# CONFIG_SIBYTE_SENTOSA is not set=0A=
# CONFIG_SIBYTE_RHONE is not set=0A=
# CONFIG_SIBYTE_CARMEL is not set=0A=
# CONFIG_SIBYTE_PTSWARM is not set=0A=
# CONFIG_SIBYTE_LITTLESUR is not set=0A=
# CONFIG_SIBYTE_CRHINE is not set=0A=
# CONFIG_SIBYTE_CRHONE is not set=0A=
# CONFIG_SNI_RM200_PCI is not set=0A=
# CONFIG_TOSHIBA_JMR3927 is not set=0A=
# CONFIG_TOSHIBA_RBTX4927 is not set=0A=
# CONFIG_TOSHIBA_RBTX4938 is not set=0A=
# CONFIG_RMI_PTR is not set=0A=
CONFIG_SIBYTE_BCM1x80=3Dy=0A=
CONFIG_SIBYTE_SB1xxx_SOC=3Dy=0A=
# CONFIG_CPU_SB1_PASS_1 is not set=0A=
# CONFIG_CPU_SB1_PASS_2_1250 is not set=0A=
# CONFIG_CPU_SB1_PASS_2_2 is not set=0A=
# CONFIG_CPU_SB1_PASS_4 is not set=0A=
# CONFIG_CPU_SB1_PASS_2_112x is not set=0A=
# CONFIG_CPU_SB1_PASS_3 is not set=0A=
# CONFIG_SIMULATION is not set=0A=
# CONFIG_SB1_CEX_ALWAYS_FATAL is not set=0A=
# CONFIG_SB1_CERR_STALL is not set=0A=
CONFIG_SIBYTE_CFE=3Dy=0A=
# CONFIG_SIBYTE_CFE_CONSOLE is not set=0A=
# CONFIG_SIBYTE_BUS_WATCHER is not set=0A=
# CONFIG_SIBYTE_SB1250_PROF is not set=0A=
# CONFIG_SIBYTE_TBPROF is not set=0A=
CONFIG_RWSEM_GENERIC_SPINLOCK=3Dy=0A=
CONFIG_GENERIC_CALIBRATE_DELAY=3Dy=0A=
CONFIG_DMA_COHERENT=3Dy=0A=
CONFIG_CPU_BIG_ENDIAN=3Dy=0A=
# CONFIG_CPU_LITTLE_ENDIAN is not set=0A=
CONFIG_SYS_SUPPORTS_BIG_ENDIAN=3Dy=0A=
CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=3Dy=0A=
CONFIG_SWAP_IO_SPACE=3Dy=0A=
CONFIG_BOOT_ELF32=3Dy=0A=
CONFIG_MIPS_L1_CACHE_SHIFT=3D5=0A=
=0A=
#=0A=
# CPU selection=0A=
#=0A=
# CONFIG_CPU_MIPS32_R1 is not set=0A=
# CONFIG_CPU_MIPS32_R2 is not set=0A=
# CONFIG_CPU_MIPS64_R1 is not set=0A=
# CONFIG_CPU_MIPS64_R2 is not set=0A=
# CONFIG_CPU_R3000 is not set=0A=
# CONFIG_CPU_TX39XX is not set=0A=
# CONFIG_CPU_VR41XX is not set=0A=
# CONFIG_CPU_R4300 is not set=0A=
# CONFIG_CPU_R4X00 is not set=0A=
# CONFIG_CPU_TX49XX is not set=0A=
# CONFIG_CPU_R5000 is not set=0A=
# CONFIG_CPU_R5432 is not set=0A=
# CONFIG_CPU_R6000 is not set=0A=
# CONFIG_CPU_NEVADA is not set=0A=
# CONFIG_CPU_R8000 is not set=0A=
# CONFIG_CPU_R10000 is not set=0A=
# CONFIG_CPU_RM7000 is not set=0A=
# CONFIG_CPU_RM9000 is not set=0A=
CONFIG_CPU_SB1=3Dy=0A=
# CONFIG_CPU_PHOENIX is not set=0A=
CONFIG_SYS_HAS_CPU_SB1=3Dy=0A=
CONFIG_SYS_SUPPORTS_32BIT_KERNEL=3Dy=0A=
CONFIG_SYS_SUPPORTS_64BIT_KERNEL=3Dy=0A=
CONFIG_CPU_SUPPORTS_32BIT_KERNEL=3Dy=0A=
CONFIG_CPU_SUPPORTS_64BIT_KERNEL=3Dy=0A=
=0A=
#=0A=
# Kernel type=0A=
#=0A=
CONFIG_32BIT=3Dy=0A=
# CONFIG_64BIT is not set=0A=
CONFIG_PAGE_SIZE_4KB=3Dy=0A=
# CONFIG_PAGE_SIZE_8KB is not set=0A=
# CONFIG_PAGE_SIZE_16KB is not set=0A=
# CONFIG_PAGE_SIZE_64KB is not set=0A=
# CONFIG_SIBYTE_DMA_PAGEOPS is not set=0A=
# CONFIG_MIPS_MT is not set=0A=
CONFIG_64BIT_PHYS_ADDR=3Dy=0A=
# CONFIG_CPU_ADVANCED is not set=0A=
CONFIG_CPU_HAS_LLSC=3Dy=0A=
CONFIG_CPU_HAS_SYNC=3Dy=0A=
CONFIG_GENERIC_HARDIRQS=3Dy=0A=
CONFIG_GENERIC_IRQ_PROBE=3Dy=0A=
CONFIG_CPU_SUPPORTS_HIGHMEM=3Dy=0A=
CONFIG_ARCH_FLATMEM_ENABLE=3Dy=0A=
CONFIG_SELECT_MEMORY_MODEL=3Dy=0A=
CONFIG_FLATMEM_MANUAL=3Dy=0A=
# CONFIG_DISCONTIGMEM_MANUAL is not set=0A=
# CONFIG_SPARSEMEM_MANUAL is not set=0A=
CONFIG_FLATMEM=3Dy=0A=
CONFIG_FLAT_NODE_MEM_MAP=3Dy=0A=
# CONFIG_SPARSEMEM_STATIC is not set=0A=
CONFIG_SPLIT_PTLOCK_CPUS=3D4=0A=
CONFIG_SMP=3Dy=0A=
CONFIG_NR_CPUS=3D32=0A=
# CONFIG_PREEMPT_NONE is not set=0A=
# CONFIG_PREEMPT_VOLUNTARY is not set=0A=
CONFIG_PREEMPT=3Dy=0A=
# CONFIG_PREEMPT_BKL is not set=0A=
=0A=
#=0A=
# Code maturity level options=0A=
#=0A=
CONFIG_EXPERIMENTAL=3Dy=0A=
CONFIG_LOCK_KERNEL=3Dy=0A=
CONFIG_INIT_ENV_ARG_LIMIT=3D32=0A=
=0A=
#=0A=
# General setup=0A=
#=0A=
CONFIG_LOCALVERSION=3D""=0A=
CONFIG_LOCALVERSION_AUTO=3Dy=0A=
CONFIG_SWAP=3Dy=0A=
CONFIG_SYSVIPC=3Dy=0A=
# CONFIG_POSIX_MQUEUE is not set=0A=
# CONFIG_BSD_PROCESS_ACCT is not set=0A=
CONFIG_SYSCTL=3Dy=0A=
# CONFIG_AUDIT is not set=0A=
# CONFIG_IKCONFIG is not set=0A=
# CONFIG_CPUSETS is not set=0A=
# CONFIG_BTLB_LOADER is not set=0A=
CONFIG_INITRAMFS_SOURCE=3D"./arch/mips/rmi/phoenix/initramfs_data.cpio"=0A=
CONFIG_INITRAMFS_ROOT_UID=3D0=0A=
CONFIG_INITRAMFS_ROOT_GID=3D0=0A=
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set=0A=
CONFIG_EMBEDDED=3Dy=0A=
# CONFIG_KALLSYMS is not set=0A=
CONFIG_HOTPLUG=3Dy=0A=
CONFIG_PRINTK=3Dy=0A=
CONFIG_BUG=3Dy=0A=
CONFIG_ELF_CORE=3Dy=0A=
CONFIG_BASE_FULL=3Dy=0A=
CONFIG_FUTEX=3Dy=0A=
CONFIG_EPOLL=3Dy=0A=
CONFIG_SHMEM=3Dy=0A=
CONFIG_CC_ALIGN_FUNCTIONS=3D0=0A=
CONFIG_CC_ALIGN_LABELS=3D0=0A=
CONFIG_CC_ALIGN_LOOPS=3D0=0A=
CONFIG_CC_ALIGN_JUMPS=3D0=0A=
CONFIG_SLAB=3Dy=0A=
# CONFIG_TINY_SHMEM is not set=0A=
CONFIG_BASE_SMALL=3D0=0A=
# CONFIG_SLOB is not set=0A=
CONFIG_OBSOLETE_INTERMODULE=3Dy=0A=
=0A=
#=0A=
# Loadable module support=0A=
#=0A=
CONFIG_MODULES=3Dy=0A=
CONFIG_MODULE_UNLOAD=3Dy=0A=
CONFIG_MODULE_FORCE_UNLOAD=3Dy=0A=
CONFIG_OBSOLETE_MODPARM=3Dy=0A=
# CONFIG_MODVERSIONS is not set=0A=
# CONFIG_MODULE_SRCVERSION_ALL is not set=0A=
CONFIG_KMOD=3Dy=0A=
CONFIG_STOP_MACHINE=3Dy=0A=
=0A=
#=0A=
# Block layer=0A=
#=0A=
CONFIG_LBD=3Dy=0A=
=0A=
#=0A=
# IO Schedulers=0A=
#=0A=
CONFIG_IOSCHED_NOOP=3Dy=0A=
CONFIG_IOSCHED_AS=3Dy=0A=
CONFIG_IOSCHED_DEADLINE=3Dy=0A=
CONFIG_IOSCHED_CFQ=3Dy=0A=
CONFIG_DEFAULT_AS=3Dy=0A=
# CONFIG_DEFAULT_DEADLINE is not set=0A=
# CONFIG_DEFAULT_CFQ is not set=0A=
# CONFIG_DEFAULT_NOOP is not set=0A=
CONFIG_DEFAULT_IOSCHED=3D"anticipatory"=0A=
=0A=
#=0A=
# Bus options (PCI, PCMCIA, EISA, ISA, TC)=0A=
#=0A=
CONFIG_HW_HAS_PCI=3Dy=0A=
CONFIG_PCI=3Dy=0A=
CONFIG_PCI_DOMAINS=3Dy=0A=
CONFIG_PCI_LEGACY_PROC=3Dy=0A=
CONFIG_MMU=3Dy=0A=
=0A=
#=0A=
# PCCARD (PCMCIA/CardBus) support=0A=
#=0A=
# CONFIG_PCCARD is not set=0A=
=0A=
#=0A=
# PCI Hotplug Support=0A=
#=0A=
# CONFIG_HOTPLUG_PCI is not set=0A=
=0A=
#=0A=
# Executable file formats=0A=
#=0A=
CONFIG_BINFMT_ELF=3Dy=0A=
# CONFIG_BINFMT_MISC is not set=0A=
CONFIG_TRAD_SIGNALS=3Dy=0A=
=0A=
#=0A=
# Networking=0A=
#=0A=
CONFIG_NET=3Dy=0A=
=0A=
#=0A=
# Networking options=0A=
#=0A=
# CONFIG_NETDEBUG is not set=0A=
CONFIG_PACKET=3Dy=0A=
CONFIG_PACKET_MMAP=3Dy=0A=
CONFIG_UNIX=3Dy=0A=
CONFIG_XFRM=3Dy=0A=
CONFIG_XFRM_USER=3Dy=0A=
CONFIG_NET_KEY=3Dy=0A=
CONFIG_INET=3Dy=0A=
CONFIG_IP_MULTICAST=3Dy=0A=
CONFIG_IP_ADVANCED_ROUTER=3Dy=0A=
CONFIG_ASK_IP_FIB_HASH=3Dy=0A=
# CONFIG_IP_FIB_TRIE is not set=0A=
CONFIG_IP_FIB_HASH=3Dy=0A=
CONFIG_IP_MULTIPLE_TABLES=3Dy=0A=
CONFIG_IP_ROUTE_MULTIPATH=3Dy=0A=
# CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set=0A=
CONFIG_IP_ROUTE_VERBOSE=3Dy=0A=
CONFIG_IP_PNP=3Dy=0A=
CONFIG_IP_PNP_DHCP=3Dy=0A=
CONFIG_IP_PNP_BOOTP=3Dy=0A=
CONFIG_IP_PNP_RARP=3Dy=0A=
# CONFIG_NET_IPIP is not set=0A=
# CONFIG_NET_IPGRE is not set=0A=
# CONFIG_IP_MROUTE is not set=0A=
CONFIG_ARPD=3Dy=0A=
CONFIG_SYN_COOKIES=3Dy=0A=
CONFIG_INET_AH=3Dy=0A=
CONFIG_INET_ESP=3Dy=0A=
CONFIG_INET_IPCOMP=3Dy=0A=
CONFIG_INET_TUNNEL=3Dy=0A=
CONFIG_INET_DIAG=3Dy=0A=
CONFIG_INET_TCP_DIAG=3Dy=0A=
# CONFIG_TCP_CONG_ADVANCED is not set=0A=
CONFIG_TCP_CONG_BIC=3Dy=0A=
CONFIG_IPV6=3Dy=0A=
# CONFIG_IPV6_PRIVACY is not set=0A=
# CONFIG_INET6_AH is not set=0A=
CONFIG_INET6_ESP=3Dy=0A=
CONFIG_INET6_IPCOMP=3Dy=0A=
CONFIG_INET6_TUNNEL=3Dy=0A=
CONFIG_IPV6_TUNNEL=3Dy=0A=
# CONFIG_NETFILTER is not set=0A=
=0A=
#=0A=
# DCCP Configuration (EXPERIMENTAL)=0A=
#=0A=
# CONFIG_IP_DCCP is not set=0A=
=0A=
#=0A=
# SCTP Configuration (EXPERIMENTAL)=0A=
#=0A=
# CONFIG_IP_SCTP is not set=0A=
=0A=
#=0A=
# TIPC Configuration (EXPERIMENTAL)=0A=
#=0A=
# CONFIG_TIPC is not set=0A=
# CONFIG_ATM is not set=0A=
# CONFIG_BRIDGE is not set=0A=
# CONFIG_VLAN_8021Q is not set=0A=
# CONFIG_DECNET is not set=0A=
# CONFIG_LLC2 is not set=0A=
# CONFIG_IPX is not set=0A=
# CONFIG_ATALK is not set=0A=
# CONFIG_X25 is not set=0A=
# CONFIG_LAPB is not set=0A=
# CONFIG_NET_DIVERT is not set=0A=
# CONFIG_ECONET is not set=0A=
# CONFIG_WAN_ROUTER is not set=0A=
=0A=
#=0A=
# QoS and/or fair queueing=0A=
#=0A=
# CONFIG_NET_SCHED is not set=0A=
=0A=
#=0A=
# Network testing=0A=
#=0A=
# CONFIG_NET_PKTGEN is not set=0A=
# CONFIG_HAMRADIO is not set=0A=
# CONFIG_IRDA is not set=0A=
# CONFIG_BT is not set=0A=
# CONFIG_IEEE80211 is not set=0A=
=0A=
#=0A=
# Device Drivers=0A=
#=0A=
=0A=
#=0A=
# Generic Driver Options=0A=
#=0A=
CONFIG_STANDALONE=3Dy=0A=
CONFIG_PREVENT_FIRMWARE_BUILD=3Dy=0A=
# CONFIG_FW_LOADER is not set=0A=
=0A=
#=0A=
# Connector - unified userspace <-> kernelspace linker=0A=
#=0A=
# CONFIG_CONNECTOR is not set=0A=
=0A=
#=0A=
# Memory Technology Devices (MTD)=0A=
#=0A=
CONFIG_MTD=3Dy=0A=
# CONFIG_MTD_DEBUG is not set=0A=
# CONFIG_MTD_CONCAT is not set=0A=
# CONFIG_MTD_PARTITIONS is not set=0A=
=0A=
#=0A=
# User Modules And Translation Layers=0A=
#=0A=
CONFIG_MTD_CHAR=3Dy=0A=
CONFIG_MTD_BLOCK=3Dy=0A=
# CONFIG_FTL is not set=0A=
# CONFIG_NFTL is not set=0A=
# CONFIG_INFTL is not set=0A=
# CONFIG_RFD_FTL is not set=0A=
=0A=
#=0A=
# RAM/ROM/Flash chip drivers=0A=
#=0A=
CONFIG_MTD_CFI=3Dy=0A=
# CONFIG_MTD_JEDECPROBE is not set=0A=
CONFIG_MTD_GEN_PROBE=3Dy=0A=
CONFIG_MTD_CFI_ADV_OPTIONS=3Dy=0A=
# CONFIG_MTD_CFI_NOSWAP is not set=0A=
# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set=0A=
CONFIG_MTD_CFI_LE_BYTE_SWAP=3Dy=0A=
CONFIG_MTD_CFI_GEOMETRY=3Dy=0A=
# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set=0A=
CONFIG_MTD_MAP_BANK_WIDTH_2=3Dy=0A=
# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set=0A=
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set=0A=
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set=0A=
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set=0A=
CONFIG_MTD_CFI_I1=3Dy=0A=
# CONFIG_MTD_CFI_I2 is not set=0A=
# CONFIG_MTD_CFI_I4 is not set=0A=
# CONFIG_MTD_CFI_I8 is not set=0A=
# CONFIG_MTD_OTP is not set=0A=
CONFIG_MTD_CFI_INTELEXT=3Dy=0A=
# CONFIG_MTD_CFI_AMDSTD is not set=0A=
# CONFIG_MTD_CFI_STAA is not set=0A=
CONFIG_MTD_CFI_UTIL=3Dy=0A=
# CONFIG_MTD_RAM is not set=0A=
# CONFIG_MTD_ROM is not set=0A=
# CONFIG_MTD_ABSENT is not set=0A=
# CONFIG_MTD_OBSOLETE_CHIPS is not set=0A=
=0A=
#=0A=
# Mapping drivers for chip access=0A=
#=0A=
# CONFIG_MTD_COMPLEX_MAPPINGS is not set=0A=
CONFIG_MTD_PHYSMAP=3Dy=0A=
CONFIG_MTD_PHYSMAP_START=3D0x1c000000=0A=
CONFIG_MTD_PHYSMAP_LEN=3D0x1000000=0A=
CONFIG_MTD_PHYSMAP_BANKWIDTH=3D2=0A=
# CONFIG_MTD_PLATRAM is not set=0A=
=0A=
#=0A=
# Self-contained MTD device drivers=0A=
#=0A=
# CONFIG_MTD_PMC551 is not set=0A=
# CONFIG_MTD_SLRAM is not set=0A=
# CONFIG_MTD_PHRAM is not set=0A=
# CONFIG_MTD_MTDRAM is not set=0A=
# CONFIG_MTD_BLKMTD is not set=0A=
# CONFIG_MTD_BLOCK2MTD is not set=0A=
=0A=
#=0A=
# Disk-On-Chip Device Drivers=0A=
#=0A=
# CONFIG_MTD_DOC2000 is not set=0A=
# CONFIG_MTD_DOC2001 is not set=0A=
# CONFIG_MTD_DOC2001PLUS is not set=0A=
=0A=
#=0A=
# NAND Flash Device Drivers=0A=
#=0A=
# CONFIG_MTD_NAND is not set=0A=
=0A=
#=0A=
# OneNAND Flash Device Drivers=0A=
#=0A=
# CONFIG_MTD_ONENAND is not set=0A=
=0A=
#=0A=
# Parallel port support=0A=
#=0A=
# CONFIG_PARPORT is not set=0A=
=0A=
#=0A=
# Plug and Play support=0A=
#=0A=
=0A=
#=0A=
# Block devices=0A=
#=0A=
# CONFIG_BLK_CPQ_DA is not set=0A=
# CONFIG_BLK_CPQ_CISS_DA is not set=0A=
# CONFIG_BLK_DEV_DAC960 is not set=0A=
# CONFIG_BLK_DEV_UMEM is not set=0A=
# CONFIG_BLK_DEV_COW_COMMON is not set=0A=
# CONFIG_BLK_DEV_LOOP is not set=0A=
# CONFIG_BLK_DEV_NBD is not set=0A=
# CONFIG_BLK_DEV_SX8 is not set=0A=
CONFIG_BLK_DEV_RAM=3Dy=0A=
CONFIG_BLK_DEV_RAM_COUNT=3D16=0A=
CONFIG_BLK_DEV_RAM_SIZE=3D32768=0A=
CONFIG_BLK_DEV_INITRD=3Dy=0A=
# CONFIG_CDROM_PKTCDVD is not set=0A=
# CONFIG_ATA_OVER_ETH is not set=0A=
=0A=
#=0A=
# ATA/ATAPI/MFM/RLL support=0A=
#=0A=
CONFIG_IDE=3Dy=0A=
CONFIG_BLK_DEV_IDE=3Dy=0A=
=0A=
#=0A=
# Please see Documentation/ide.txt for help/info on IDE drives=0A=
#=0A=
CONFIG_BLK_DEV_IDE_SATA=3Dy=0A=
CONFIG_BLK_DEV_IDEDISK=3Dy=0A=
# CONFIG_IDEDISK_MULTI_MODE is not set=0A=
# CONFIG_BLK_DEV_IDECD is not set=0A=
# CONFIG_BLK_DEV_IDETAPE is not set=0A=
# CONFIG_BLK_DEV_IDEFLOPPY is not set=0A=
# CONFIG_IDE_TASK_IOCTL is not set=0A=
=0A=
#=0A=
# IDE chipset support/bugfixes=0A=
#=0A=
CONFIG_IDE_GENERIC=3Dy=0A=
CONFIG_BLK_DEV_IDEPCI=3Dy=0A=
CONFIG_IDEPCI_SHARE_IRQ=3Dy=0A=
# CONFIG_BLK_DEV_OFFBOARD is not set=0A=
CONFIG_BLK_DEV_GENERIC=3Dy=0A=
# CONFIG_BLK_DEV_OPTI621 is not set=0A=
CONFIG_BLK_DEV_IDEDMA_PCI=3Dy=0A=
# CONFIG_BLK_DEV_IDEDMA_FORCED is not set=0A=
CONFIG_IDEDMA_PCI_AUTO=3Dy=0A=
# CONFIG_IDEDMA_ONLYDISK is not set=0A=
# CONFIG_BLK_DEV_AEC62XX is not set=0A=
# CONFIG_BLK_DEV_ALI15X3 is not set=0A=
# CONFIG_BLK_DEV_AMD74XX is not set=0A=
# CONFIG_BLK_DEV_CMD64X is not set=0A=
# CONFIG_BLK_DEV_TRIFLEX is not set=0A=
# CONFIG_BLK_DEV_CY82C693 is not set=0A=
# CONFIG_BLK_DEV_CS5520 is not set=0A=
# CONFIG_BLK_DEV_CS5530 is not set=0A=
# CONFIG_BLK_DEV_HPT34X is not set=0A=
# CONFIG_BLK_DEV_HPT366 is not set=0A=
# CONFIG_BLK_DEV_SC1200 is not set=0A=
# CONFIG_BLK_DEV_PIIX is not set=0A=
# CONFIG_BLK_DEV_IT821X is not set=0A=
# CONFIG_BLK_DEV_NS87415 is not set=0A=
# CONFIG_BLK_DEV_PDC202XX_OLD is not set=0A=
CONFIG_BLK_DEV_PDC202XX_NEW=3Dy=0A=
# CONFIG_BLK_DEV_SVWKS is not set=0A=
CONFIG_BLK_DEV_SIIMAGE=3Dy=0A=
# CONFIG_BLK_DEV_SLC90E66 is not set=0A=
# CONFIG_BLK_DEV_TRM290 is not set=0A=
# CONFIG_BLK_DEV_VIA82CXXX is not set=0A=
# CONFIG_BLK_DEV_IDE_SWARM is not set=0A=
# CONFIG_IDE_ARM is not set=0A=
CONFIG_BLK_DEV_IDEDMA=3Dy=0A=
# CONFIG_IDEDMA_IVB is not set=0A=
CONFIG_IDEDMA_AUTO=3Dy=0A=
# CONFIG_BLK_DEV_HD is not set=0A=
=0A=
#=0A=
# SCSI device support=0A=
#=0A=
# CONFIG_RAID_ATTRS is not set=0A=
# CONFIG_SCSI is not set=0A=
=0A=
#=0A=
# Multi-device support (RAID and LVM)=0A=
#=0A=
# CONFIG_MD is not set=0A=
=0A=
#=0A=
# Fusion MPT device support=0A=
#=0A=
# CONFIG_FUSION is not set=0A=
=0A=
#=0A=
# IEEE 1394 (FireWire) support=0A=
#=0A=
# CONFIG_IEEE1394 is not set=0A=
=0A=
#=0A=
# I2O device support=0A=
#=0A=
# CONFIG_I2O is not set=0A=
=0A=
#=0A=
# Network device support=0A=
#=0A=
CONFIG_NETDEVICES=3Dy=0A=
CONFIG_DUMMY=3Dy=0A=
# CONFIG_BONDING is not set=0A=
# CONFIG_EQUALIZER is not set=0A=
# CONFIG_TUN is not set=0A=
=0A=
#=0A=
# ARCnet devices=0A=
#=0A=
# CONFIG_ARCNET is not set=0A=
=0A=
#=0A=
# PHY device support=0A=
#=0A=
# CONFIG_PHYLIB is not set=0A=
=0A=
#=0A=
# Ethernet (10 or 100Mbit)=0A=
#=0A=
CONFIG_NET_ETHERNET=3Dy=0A=
CONFIG_MII=3Dy=0A=
# CONFIG_HAPPYMEAL is not set=0A=
# CONFIG_SUNGEM is not set=0A=
# CONFIG_CASSINI is not set=0A=
# CONFIG_NET_VENDOR_3COM is not set=0A=
# CONFIG_DM9000 is not set=0A=
=0A=
#=0A=
# Tulip family network device support=0A=
#=0A=
# CONFIG_NET_TULIP is not set=0A=
# CONFIG_HP100 is not set=0A=
CONFIG_NET_PCI=3Dy=0A=
# CONFIG_PCNET32 is not set=0A=
# CONFIG_AMD8111_ETH is not set=0A=
# CONFIG_ADAPTEC_STARFIRE is not set=0A=
# CONFIG_B44 is not set=0A=
# CONFIG_FORCEDETH is not set=0A=
# CONFIG_DGRS is not set=0A=
# CONFIG_EEPRO100 is not set=0A=
# CONFIG_E100 is not set=0A=
# CONFIG_FEALNX is not set=0A=
CONFIG_NATSEMI=3Dy=0A=
# CONFIG_NE2K_PCI is not set=0A=
# CONFIG_8139CP is not set=0A=
CONFIG_8139TOO=3Dy=0A=
# CONFIG_8139TOO_PIO is not set=0A=
# CONFIG_8139TOO_TUNE_TWISTER is not set=0A=
# CONFIG_8139TOO_8129 is not set=0A=
# CONFIG_8139_OLD_RX_RESET is not set=0A=
# CONFIG_SIS900 is not set=0A=
# CONFIG_EPIC100 is not set=0A=
# CONFIG_SUNDANCE is not set=0A=
# CONFIG_TLAN is not set=0A=
# CONFIG_VIA_RHINE is not set=0A=
# CONFIG_LAN_SAA9730 is not set=0A=
=0A=
#=0A=
# Ethernet (1000 Mbit)=0A=
#=0A=
# CONFIG_ACENIC is not set=0A=
# CONFIG_DL2K is not set=0A=
# CONFIG_E1000 is not set=0A=
# CONFIG_NS83820 is not set=0A=
# CONFIG_HAMACHI is not set=0A=
# CONFIG_YELLOWFIN is not set=0A=
# CONFIG_R8169 is not set=0A=
# CONFIG_NET_SB1250_MAC is not set=0A=
# CONFIG_SIS190 is not set=0A=
# CONFIG_SKGE is not set=0A=
# CONFIG_SKY2 is not set=0A=
# CONFIG_SK98LIN is not set=0A=
# CONFIG_VIA_VELOCITY is not set=0A=
CONFIG_TIGON3=3Dy=0A=
# CONFIG_BNX2 is not set=0A=
=0A=
#=0A=
# Ethernet (10000 Mbit)=0A=
#=0A=
# CONFIG_CHELSIO_T1 is not set=0A=
# CONFIG_IXGB is not set=0A=
# CONFIG_S2IO is not set=0A=
=0A=
#=0A=
# Token Ring devices=0A=
#=0A=
# CONFIG_TR is not set=0A=
=0A=
#=0A=
# Wireless LAN (non-hamradio)=0A=
#=0A=
CONFIG_NET_RADIO=3Dy=0A=
=0A=
#=0A=
# Obsolete Wireless cards support (pre-802.11)=0A=
#=0A=
CONFIG_STRIP=3Dm=0A=
=0A=
#=0A=
# Wireless 802.11b ISA/PCI cards support=0A=
#=0A=
CONFIG_HERMES=3Dm=0A=
# CONFIG_PLX_HERMES is not set=0A=
# CONFIG_TMD_HERMES is not set=0A=
# CONFIG_NORTEL_HERMES is not set=0A=
# CONFIG_PCI_HERMES is not set=0A=
# CONFIG_ATMEL is not set=0A=
=0A=
#=0A=
# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support=0A=
#=0A=
# CONFIG_PRISM54 is not set=0A=
# CONFIG_HOSTAP is not set=0A=
CONFIG_NET_WIRELESS=3Dy=0A=
=0A=
#=0A=
# Wan interfaces=0A=
#=0A=
CONFIG_WAN=3Dy=0A=
# CONFIG_DSCC4 is not set=0A=
# CONFIG_LANMEDIA is not set=0A=
# CONFIG_SYNCLINK_SYNCPPP is not set=0A=
# CONFIG_HDLC is not set=0A=
CONFIG_DLCI=3Dm=0A=
CONFIG_DLCI_COUNT=3D24=0A=
CONFIG_DLCI_MAX=3D8=0A=
# CONFIG_FDDI is not set=0A=
# CONFIG_HIPPI is not set=0A=
# CONFIG_PPP is not set=0A=
# CONFIG_SLIP is not set=0A=
# CONFIG_SHAPER is not set=0A=
# CONFIG_NETCONSOLE is not set=0A=
# CONFIG_NETPOLL is not set=0A=
# CONFIG_NET_POLL_CONTROLLER is not set=0A=
=0A=
#=0A=
# ISDN subsystem=0A=
#=0A=
# CONFIG_ISDN is not set=0A=
=0A=
#=0A=
# Telephony Support=0A=
#=0A=
# CONFIG_PHONE is not set=0A=
=0A=
#=0A=
# Input device support=0A=
#=0A=
# CONFIG_INPUT is not set=0A=
=0A=
#=0A=
# Hardware I/O ports=0A=
#=0A=
# CONFIG_SERIO is not set=0A=
# CONFIG_GAMEPORT is not set=0A=
=0A=
#=0A=
# Character devices=0A=
#=0A=
# CONFIG_VT is not set=0A=
# CONFIG_SERIAL_NONSTANDARD is not set=0A=
# CONFIG_SIBYTE_SB1250_DUART is not set=0A=
=0A=
#=0A=
# Serial drivers=0A=
#=0A=
CONFIG_SERIAL_8250=3Dy=0A=
CONFIG_SERIAL_8250_CONSOLE=3Dy=0A=
CONFIG_SERIAL_8250_NR_UARTS=3D4=0A=
CONFIG_SERIAL_8250_RUNTIME_UARTS=3D4=0A=
CONFIG_SERIAL_8250_EXTENDED=3Dy=0A=
# CONFIG_SERIAL_8250_MANY_PORTS is not set=0A=
# CONFIG_SERIAL_8250_SHARE_IRQ is not set=0A=
# CONFIG_SERIAL_8250_DETECT_IRQ is not set=0A=
# CONFIG_SERIAL_8250_RSA is not set=0A=
=0A=
#=0A=
# Non-8250 serial port support=0A=
#=0A=
CONFIG_SERIAL_CORE=3Dy=0A=
CONFIG_SERIAL_CORE_CONSOLE=3Dy=0A=
# CONFIG_SERIAL_JSM is not set=0A=
CONFIG_UNIX98_PTYS=3Dy=0A=
CONFIG_LEGACY_PTYS=3Dy=0A=
CONFIG_LEGACY_PTY_COUNT=3D256=0A=
=0A=
#=0A=
# IPMI=0A=
#=0A=
# CONFIG_IPMI_HANDLER is not set=0A=
=0A=
#=0A=
# Watchdog Cards=0A=
#=0A=
# CONFIG_WATCHDOG is not set=0A=
# CONFIG_RTC is not set=0A=
# CONFIG_GEN_RTC is not set=0A=
# CONFIG_DTLK is not set=0A=
# CONFIG_R3964 is not set=0A=
# CONFIG_APPLICOM is not set=0A=
=0A=
#=0A=
# Ftape, the floppy tape device driver=0A=
#=0A=
# CONFIG_DRM is not set=0A=
# CONFIG_RAW_DRIVER is not set=0A=
=0A=
#=0A=
# TPM devices=0A=
#=0A=
# CONFIG_TCG_TPM is not set=0A=
# CONFIG_TELCLOCK is not set=0A=
=0A=
#=0A=
# I2C support=0A=
#=0A=
CONFIG_I2C=3Dy=0A=
# CONFIG_I2C_CHARDEV is not set=0A=
=0A=
#=0A=
# I2C Algorithms=0A=
#=0A=
# CONFIG_I2C_ALGOBIT is not set=0A=
# CONFIG_I2C_ALGOPCF is not set=0A=
CONFIG_I2C_ALGOPALM=3Dy=0A=
# CONFIG_I2C_ALGOPCA is not set=0A=
# CONFIG_I2C_ALGO_SIBYTE is not set=0A=
=0A=
#=0A=
# I2C Hardware Bus support=0A=
#=0A=
# CONFIG_I2C_ALI1535 is not set=0A=
# CONFIG_I2C_ALI1563 is not set=0A=
# CONFIG_I2C_ALI15X3 is not set=0A=
# CONFIG_I2C_AMD756 is not set=0A=
# CONFIG_I2C_AMD8111 is not set=0A=
CONFIG_I2C_BK3220=3Dy=0A=
# CONFIG_I2C_I801 is not set=0A=
# CONFIG_I2C_I810 is not set=0A=
# CONFIG_I2C_PIIX4 is not set=0A=
# CONFIG_I2C_NFORCE2 is not set=0A=
# CONFIG_I2C_PARPORT_LIGHT is not set=0A=
# CONFIG_I2C_PROSAVAGE is not set=0A=
# CONFIG_I2C_SAVAGE4 is not set=0A=
# CONFIG_I2C_SIBYTE is not set=0A=
# CONFIG_SCx200_ACB is not set=0A=
# CONFIG_I2C_SIS5595 is not set=0A=
# CONFIG_I2C_SIS630 is not set=0A=
# CONFIG_I2C_SIS96X is not set=0A=
# CONFIG_I2C_STUB is not set=0A=
# CONFIG_I2C_VIA is not set=0A=
# CONFIG_I2C_VIAPRO is not set=0A=
# CONFIG_I2C_VOODOO3 is not set=0A=
# CONFIG_I2C_PCA_ISA is not set=0A=
=0A=
#=0A=
# Miscellaneous I2C Chip support=0A=
#=0A=
# CONFIG_SENSORS_DS1337 is not set=0A=
# CONFIG_SENSORS_DS1374 is not set=0A=
# CONFIG_SENSORS_EEPROM is not set=0A=
# CONFIG_SENSORS_PCF8574 is not set=0A=
# CONFIG_SENSORS_PCA9539 is not set=0A=
# CONFIG_SENSORS_PCF8591 is not set=0A=
# CONFIG_SENSORS_RTC8564 is not set=0A=
# CONFIG_SENSORS_MAX6875 is not set=0A=
# CONFIG_RTC_X1205_I2C is not set=0A=
# CONFIG_I2C_DEBUG_CORE is not set=0A=
# CONFIG_I2C_DEBUG_ALGO is not set=0A=
# CONFIG_I2C_DEBUG_BUS is not set=0A=
# CONFIG_I2C_DEBUG_CHIP is not set=0A=
=0A=
#=0A=
# SPI support=0A=
#=0A=
# CONFIG_SPI is not set=0A=
# CONFIG_SPI_MASTER is not set=0A=
=0A=
#=0A=
# Dallas's 1-wire bus=0A=
#=0A=
# CONFIG_W1 is not set=0A=
=0A=
#=0A=
# Hardware Monitoring support=0A=
#=0A=
CONFIG_HWMON=3Dy=0A=
# CONFIG_HWMON_VID is not set=0A=
# CONFIG_SENSORS_ADM1021 is not set=0A=
# CONFIG_SENSORS_ADM1025 is not set=0A=
# CONFIG_SENSORS_ADM1026 is not set=0A=
# CONFIG_SENSORS_ADM1031 is not set=0A=
# CONFIG_SENSORS_ADM9240 is not set=0A=
# CONFIG_SENSORS_ASB100 is not set=0A=
# CONFIG_SENSORS_ATXP1 is not set=0A=
# CONFIG_SENSORS_DS1621 is not set=0A=
# CONFIG_SENSORS_F71805F is not set=0A=
# CONFIG_SENSORS_FSCHER is not set=0A=
# CONFIG_SENSORS_FSCPOS is not set=0A=
# CONFIG_SENSORS_GL518SM is not set=0A=
# CONFIG_SENSORS_GL520SM is not set=0A=
# CONFIG_SENSORS_IT87 is not set=0A=
# CONFIG_SENSORS_LM63 is not set=0A=
# CONFIG_SENSORS_LM75 is not set=0A=
# CONFIG_SENSORS_LM77 is not set=0A=
# CONFIG_SENSORS_LM78 is not set=0A=
# CONFIG_SENSORS_LM80 is not set=0A=
# CONFIG_SENSORS_LM83 is not set=0A=
# CONFIG_SENSORS_LM85 is not set=0A=
# CONFIG_SENSORS_LM87 is not set=0A=
# CONFIG_SENSORS_LM90 is not set=0A=
# CONFIG_SENSORS_LM92 is not set=0A=
# CONFIG_SENSORS_MAX1619 is not set=0A=
# CONFIG_SENSORS_PC87360 is not set=0A=
# CONFIG_SENSORS_SIS5595 is not set=0A=
# CONFIG_SENSORS_SMSC47M1 is not set=0A=
# CONFIG_SENSORS_SMSC47B397 is not set=0A=
# CONFIG_SENSORS_VIA686A is not set=0A=
# CONFIG_SENSORS_VT8231 is not set=0A=
# CONFIG_SENSORS_W83781D is not set=0A=
# CONFIG_SENSORS_W83792D is not set=0A=
# CONFIG_SENSORS_W83L785TS is not set=0A=
# CONFIG_SENSORS_W83627HF is not set=0A=
# CONFIG_SENSORS_W83627EHF is not set=0A=
# CONFIG_HWMON_DEBUG_CHIP is not set=0A=
=0A=
#=0A=
# Misc devices=0A=
#=0A=
=0A=
#=0A=
# Multimedia Capabilities Port drivers=0A=
#=0A=
=0A=
#=0A=
# Multimedia devices=0A=
#=0A=
# CONFIG_VIDEO_DEV is not set=0A=
=0A=
#=0A=
# Digital Video Broadcasting Devices=0A=
#=0A=
# CONFIG_DVB is not set=0A=
=0A=
#=0A=
# Graphics support=0A=
#=0A=
# CONFIG_FB is not set=0A=
=0A=
#=0A=
# Sound=0A=
#=0A=
# CONFIG_SOUND is not set=0A=
=0A=
#=0A=
# USB support=0A=
#=0A=
CONFIG_USB_ARCH_HAS_HCD=3Dy=0A=
CONFIG_USB_ARCH_HAS_OHCI=3Dy=0A=
# CONFIG_USB is not set=0A=
=0A=
#=0A=
# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'=0A=
#=0A=
=0A=
#=0A=
# USB Gadget Support=0A=
#=0A=
# CONFIG_USB_GADGET is not set=0A=
=0A=
#=0A=
# MMC/SD Card support=0A=
#=0A=
# CONFIG_MMC is not set=0A=
=0A=
#=0A=
# InfiniBand support=0A=
#=0A=
# CONFIG_INFINIBAND is not set=0A=
=0A=
#=0A=
# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)=0A=
#=0A=
=0A=
#=0A=
# File systems=0A=
#=0A=
CONFIG_EXT2_FS=3Dy=0A=
# CONFIG_EXT2_FS_XATTR is not set=0A=
# CONFIG_EXT2_FS_XIP is not set=0A=
CONFIG_EXT3_FS=3Dy=0A=
# CONFIG_EXT3_FS_XATTR is not set=0A=
CONFIG_JBD=3Dy=0A=
# CONFIG_JBD_DEBUG is not set=0A=
# CONFIG_REISERFS_FS is not set=0A=
# CONFIG_JFS_FS is not set=0A=
# CONFIG_FS_POSIX_ACL is not set=0A=
# CONFIG_XFS_FS is not set=0A=
# CONFIG_OCFS2_FS is not set=0A=
# CONFIG_MINIX_FS is not set=0A=
# CONFIG_ROMFS_FS is not set=0A=
CONFIG_INOTIFY=3Dy=0A=
# CONFIG_QUOTA is not set=0A=
CONFIG_DNOTIFY=3Dy=0A=
# CONFIG_AUTOFS_FS is not set=0A=
# CONFIG_AUTOFS4_FS is not set=0A=
# CONFIG_FUSE_FS is not set=0A=
=0A=
#=0A=
# CD-ROM/DVD Filesystems=0A=
#=0A=
# CONFIG_ISO9660_FS is not set=0A=
# CONFIG_UDF_FS is not set=0A=
=0A=
#=0A=
# DOS/FAT/NT Filesystems=0A=
#=0A=
CONFIG_FAT_FS=3Dy=0A=
CONFIG_MSDOS_FS=3Dy=0A=
CONFIG_VFAT_FS=3Dy=0A=
CONFIG_FAT_DEFAULT_CODEPAGE=3D437=0A=
CONFIG_FAT_DEFAULT_IOCHARSET=3D"iso8859-1"=0A=
# CONFIG_NTFS_FS is not set=0A=
=0A=
#=0A=
# Pseudo filesystems=0A=
#=0A=
CONFIG_PROC_FS=3Dy=0A=
CONFIG_PROC_KCORE=3Dy=0A=
CONFIG_SYSFS=3Dy=0A=
CONFIG_TMPFS=3Dy=0A=
# CONFIG_HUGETLB_PAGE is not set=0A=
CONFIG_RAMFS=3Dy=0A=
# CONFIG_RELAYFS_FS is not set=0A=
# CONFIG_CONFIGFS_FS is not set=0A=
=0A=
#=0A=
# Miscellaneous filesystems=0A=
#=0A=
# CONFIG_ADFS_FS is not set=0A=
# CONFIG_AFFS_FS is not set=0A=
# CONFIG_HFS_FS is not set=0A=
# CONFIG_HFSPLUS_FS is not set=0A=
# CONFIG_BEFS_FS is not set=0A=
# CONFIG_BFS_FS is not set=0A=
# CONFIG_EFS_FS is not set=0A=
# CONFIG_JFFS_FS is not set=0A=
# CONFIG_JFFS2_FS is not set=0A=
# CONFIG_CRAMFS is not set=0A=
# CONFIG_VXFS_FS is not set=0A=
# CONFIG_HPFS_FS is not set=0A=
# CONFIG_QNX4FS_FS is not set=0A=
# CONFIG_SYSV_FS is not set=0A=
# CONFIG_UFS_FS is not set=0A=
=0A=
#=0A=
# Network File Systems=0A=
#=0A=
CONFIG_NFS_FS=3Dy=0A=
CONFIG_NFS_V3=3Dy=0A=
# CONFIG_NFS_V3_ACL is not set=0A=
CONFIG_NFS_V4=3Dy=0A=
# CONFIG_NFS_DIRECTIO is not set=0A=
# CONFIG_NFSD is not set=0A=
# CONFIG_ROOT_NFS is not set=0A=
CONFIG_LOCKD=3Dy=0A=
CONFIG_LOCKD_V4=3Dy=0A=
CONFIG_NFS_COMMON=3Dy=0A=
CONFIG_SUNRPC=3Dy=0A=
CONFIG_SUNRPC_GSS=3Dy=0A=
CONFIG_RPCSEC_GSS_KRB5=3Dy=0A=
# CONFIG_RPCSEC_GSS_SPKM3 is not set=0A=
# CONFIG_SMB_FS is not set=0A=
# CONFIG_CIFS is not set=0A=
# CONFIG_NCP_FS is not set=0A=
# CONFIG_CODA_FS is not set=0A=
# CONFIG_AFS_FS is not set=0A=
# CONFIG_9P_FS is not set=0A=
=0A=
#=0A=
# Partition Types=0A=
#=0A=
CONFIG_PARTITION_ADVANCED=3Dy=0A=
# CONFIG_ACORN_PARTITION is not set=0A=
# CONFIG_OSF_PARTITION is not set=0A=
# CONFIG_AMIGA_PARTITION is not set=0A=
# CONFIG_ATARI_PARTITION is not set=0A=
# CONFIG_MAC_PARTITION is not set=0A=
CONFIG_MSDOS_PARTITION=3Dy=0A=
CONFIG_BSD_DISKLABEL=3Dy=0A=
# CONFIG_MINIX_SUBPARTITION is not set=0A=
# CONFIG_SOLARIS_X86_PARTITION is not set=0A=
# CONFIG_UNIXWARE_DISKLABEL is not set=0A=
# CONFIG_LDM_PARTITION is not set=0A=
# CONFIG_SGI_PARTITION is not set=0A=
# CONFIG_ULTRIX_PARTITION is not set=0A=
# CONFIG_SUN_PARTITION is not set=0A=
# CONFIG_KARMA_PARTITION is not set=0A=
# CONFIG_EFI_PARTITION is not set=0A=
=0A=
#=0A=
# Native Language Support=0A=
#=0A=
CONFIG_NLS=3Dy=0A=
CONFIG_NLS_DEFAULT=3D"iso8859-1"=0A=
# CONFIG_NLS_CODEPAGE_437 is not set=0A=
# CONFIG_NLS_CODEPAGE_737 is not set=0A=
# CONFIG_NLS_CODEPAGE_775 is not set=0A=
# CONFIG_NLS_CODEPAGE_850 is not set=0A=
# CONFIG_NLS_CODEPAGE_852 is not set=0A=
# CONFIG_NLS_CODEPAGE_855 is not set=0A=
# CONFIG_NLS_CODEPAGE_857 is not set=0A=
# CONFIG_NLS_CODEPAGE_860 is not set=0A=
# CONFIG_NLS_CODEPAGE_861 is not set=0A=
# CONFIG_NLS_CODEPAGE_862 is not set=0A=
# CONFIG_NLS_CODEPAGE_863 is not set=0A=
# CONFIG_NLS_CODEPAGE_864 is not set=0A=
# CONFIG_NLS_CODEPAGE_865 is not set=0A=
# CONFIG_NLS_CODEPAGE_866 is not set=0A=
# CONFIG_NLS_CODEPAGE_869 is not set=0A=
# CONFIG_NLS_CODEPAGE_936 is not set=0A=
# CONFIG_NLS_CODEPAGE_950 is not set=0A=
# CONFIG_NLS_CODEPAGE_932 is not set=0A=
# CONFIG_NLS_CODEPAGE_949 is not set=0A=
# CONFIG_NLS_CODEPAGE_874 is not set=0A=
# CONFIG_NLS_ISO8859_8 is not set=0A=
# CONFIG_NLS_CODEPAGE_1250 is not set=0A=
# CONFIG_NLS_CODEPAGE_1251 is not set=0A=
# CONFIG_NLS_ASCII is not set=0A=
# CONFIG_NLS_ISO8859_1 is not set=0A=
# CONFIG_NLS_ISO8859_2 is not set=0A=
# CONFIG_NLS_ISO8859_3 is not set=0A=
# CONFIG_NLS_ISO8859_4 is not set=0A=
# CONFIG_NLS_ISO8859_5 is not set=0A=
# CONFIG_NLS_ISO8859_6 is not set=0A=
# CONFIG_NLS_ISO8859_7 is not set=0A=
# CONFIG_NLS_ISO8859_9 is not set=0A=
# CONFIG_NLS_ISO8859_13 is not set=0A=
# CONFIG_NLS_ISO8859_14 is not set=0A=
# CONFIG_NLS_ISO8859_15 is not set=0A=
# CONFIG_NLS_KOI8_R is not set=0A=
# CONFIG_NLS_KOI8_U is not set=0A=
# CONFIG_NLS_UTF8 is not set=0A=
=0A=
#=0A=
# Profiling support=0A=
#=0A=
=0A=
#=0A=
# Performance-monitoring counters support=0A=
#=0A=
# CONFIG_PERFCTR is not set=0A=
# CONFIG_PROFILING is not set=0A=
=0A=
#=0A=
# Kernel hacking=0A=
#=0A=
# CONFIG_PRINTK_TIME is not set=0A=
# CONFIG_MAGIC_SYSRQ is not set=0A=
# CONFIG_DEBUG_KERNEL is not set=0A=
CONFIG_LOG_BUF_SHIFT=3D15=0A=
CONFIG_CROSSCOMPILE=3Dy=0A=
CONFIG_CMDLINE=3D""=0A=
# CONFIG_SB1XXX_CORELIS is not set=0A=
=0A=
#=0A=
# Security options=0A=
#=0A=
# CONFIG_KEYS is not set=0A=
CONFIG_SECURITY=3Dy=0A=
CONFIG_SECURITY_NETWORK=3Dy=0A=
# CONFIG_SECURITY_NETWORK_XFRM is not set=0A=
CONFIG_SECURITY_CAPABILITIES=3Dy=0A=
# CONFIG_SECURITY_SECLVL is not set=0A=
=0A=
#=0A=
# Cryptographic options=0A=
#=0A=
CONFIG_CRYPTO=3Dy=0A=
CONFIG_CRYPTO_HMAC=3Dy=0A=
CONFIG_CRYPTO_NULL=3Dy=0A=
CONFIG_CRYPTO_MD4=3Dy=0A=
CONFIG_CRYPTO_MD5=3Dy=0A=
CONFIG_CRYPTO_SHA1=3Dy=0A=
CONFIG_CRYPTO_SHA256=3Dy=0A=
CONFIG_CRYPTO_SHA512=3Dy=0A=
# CONFIG_CRYPTO_WP512 is not set=0A=
# CONFIG_CRYPTO_TGR192 is not set=0A=
CONFIG_CRYPTO_DES=3Dy=0A=
CONFIG_CRYPTO_BLOWFISH=3Dy=0A=
CONFIG_CRYPTO_TWOFISH=3Dy=0A=
CONFIG_CRYPTO_SERPENT=3Dy=0A=
CONFIG_CRYPTO_AES=3Dy=0A=
CONFIG_CRYPTO_CAST5=3Dy=0A=
CONFIG_CRYPTO_CAST6=3Dy=0A=
# CONFIG_CRYPTO_TEA is not set=0A=
CONFIG_CRYPTO_ARC4=3Dy=0A=
# CONFIG_CRYPTO_KHAZAD is not set=0A=
# CONFIG_CRYPTO_ANUBIS is not set=0A=
CONFIG_CRYPTO_DEFLATE=3Dy=0A=
CONFIG_CRYPTO_MICHAEL_MIC=3Dy=0A=
# CONFIG_CRYPTO_CRC32C is not set=0A=
# CONFIG_CRYPTO_TEST is not set=0A=
=0A=
#=0A=
# Hardware crypto devices=0A=
#=0A=
=0A=
#=0A=
# Library routines=0A=
#=0A=
# CONFIG_CRC_CCITT is not set=0A=
# CONFIG_CRC16 is not set=0A=
CONFIG_CRC32=3Dy=0A=
# CONFIG_LIBCRC32C is not set=0A=
CONFIG_ZLIB_INFLATE=3Dy=0A=
CONFIG_ZLIB_DEFLATE=3Dy=0A=

------=_NextPart_000_000C_01C6B487.DF72B8A0--


From ths@networkno.de Mon Jul 31 09:37:10 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 31 Jul 2006 09:37:20 +0100 (BST)
Received: from bender.bawue.de ([193.7.176.20]:41953 "EHLO bender.bawue.de")
	by ftp.linux-mips.org with ESMTP id S8133457AbWGaIhK (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 31 Jul 2006 09:37:10 +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 3DDA546693; Mon, 31 Jul 2006 10:35:08 +0200 (MEST)
Received: from ths by lagash with local (Exim 4.62)
	(envelope-from <ths@networkno.de>)
	id 1G7TEN-0000k6-MF; Mon, 31 Jul 2006 09:34:31 +0100
Date:	Mon, 31 Jul 2006 09:34:31 +0100
To:	wyb@topsec.com.cn
Cc:	Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
Subject: Re: unmatched R_MIPS_HI16/LO16 on gcc 3.4.3
Message-ID: <20060731083431.GG15011@networkno.de>
References: <004001c6af95$14585900$0100000a@codingman> <20060725034424.GB22138@linux-mips.org> <000f01c6b444$e1e820e0$0100000a@codingman>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <000f01c6b444$e1e820e0$0100000a@codingman>
User-Agent: Mutt/1.5.12-2006-07-14
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: 12125
X-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

wyb@topsec.com.cn wrote:
> 
> Attachment is a testsuit. It costed me a week to make this testsuit.

FWIW, I can't reproduce the failure with Debian's gcc 3.4.6.
ISTR this bug was fixed in later 3.4.x versions.

> If I added -mno-explicit-relocs -mno-split-addresses to makefile, this bug
> disappeared. Is there any performance difference with and without these
> flags ?

-mno-explicit-relocs will degrade the efficiency of the compiler's
instruction scheduling since some macro expansions are left to the
assembler in that case. It will likely affect both execution speed
and code size.


Thiemo

From vagabon.xyz@gmail.com Mon Jul 31 09:46:01 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 31 Jul 2006 09:46:11 +0100 (BST)
Received: from wr-out-0506.google.com ([64.233.184.236]:16487 "EHLO
	wr-out-0506.google.com") by ftp.linux-mips.org with ESMTP
	id S8133484AbWGaIqB (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 31 Jul 2006 09:46:01 +0100
Received: by wr-out-0506.google.com with SMTP id i31so348156wra
        for <linux-mips@linux-mips.org>; Mon, 31 Jul 2006 01:46:00 -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=daOpDG9BhJG0UqNg3r/CSCUkPWDCIAIbtCnRlcPsriqy2Pkh5KGQq1+/WuSOIEJ0B0GhFopWJqFlkMvwYeZQzSBqjt3DkOoDq8Eai16wyBvGjPQzbyA1ONRZ1YAEz/NHdsYJ94flH8pyuEk9Ho4ND0bNLEPXT7bKbcVg9zRdSdA=
Received: by 10.54.152.12 with SMTP id z12mr2183732wrd;
        Mon, 31 Jul 2006 01:46:00 -0700 (PDT)
Received: from ?192.168.0.24? ( [194.3.162.233])
        by mx.gmail.com with ESMTP id 38sm4616786wrl.2006.07.31.01.45.57;
        Mon, 31 Jul 2006 01:45:59 -0700 (PDT)
Message-ID: <44CDC30D.2070705@innova-card.com>
Date:	Mon, 31 Jul 2006 10:45:01 +0200
Reply-To: Franck <vagabon.xyz@gmail.com>
User-Agent: Thunderbird 1.5.0.4 (X11/20060614)
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] dump_stack() based on prologue code analysis
References: <20060726.232231.59465336.anemo@mba.ocn.ne.jp>	<44C8CEA4.20000@innova-card.com>	<cda58cb80607271203u70b26e23o65b71d3d0c900f94@mail.gmail.com> <20060729.004442.96686266.anemo@mba.ocn.ne.jp>
In-Reply-To: <20060729.004442.96686266.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: 12126
X-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:
> Hi, Franck.  Thank you for detailed review.
> 
> On Thu, 27 Jul 2006 16:33:08 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
>>> +	unsigned long *stack = (long *)regs->regs[29];
>> why not calling that "sp" ?
> 
> Just because show_trace() named it "stack" :-)
> 

nothing is too late ;)

		Franck

From vagabon.xyz@gmail.com Mon Jul 31 10:00:28 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 31 Jul 2006 10:00:39 +0100 (BST)
Received: from nz-out-0102.google.com ([64.233.162.203]:23799 "EHLO
	nz-out-0102.google.com") by ftp.linux-mips.org with ESMTP
	id S8133494AbWGaJA2 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 31 Jul 2006 10:00:28 +0100
Received: by nz-out-0102.google.com with SMTP id l1so152246nzf
        for <linux-mips@linux-mips.org>; Mon, 31 Jul 2006 02:00:25 -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=HMphpboCX87iwbGbyPvxOTmBW1JKe8c9Dxd0u7HzOYpiqU9XMKOz5B38hD/n2VmpG0znyqEEfOxUtERqevra1rXwSUBX9dSkTxvnrMSatFzb/lp7gSF3Q4LGREYEhMIQ/0+tb6oiUPcjKNKzpgnp7OuekTMej0e7t5US7rpy7+c=
Received: by 10.65.114.4 with SMTP id r4mr3114256qbm;
        Mon, 31 Jul 2006 02:00:16 -0700 (PDT)
Received: from ?192.168.0.24? ( [194.3.162.233])
        by mx.gmail.com with ESMTP id 36sm3714524nza.2006.07.31.02.00.08;
        Mon, 31 Jul 2006 02:00:16 -0700 (PDT)
Message-ID: <44CDC657.9090403@innova-card.com>
Date:	Mon, 31 Jul 2006 10:59:03 +0200
Reply-To: Franck <vagabon.xyz@gmail.com>
User-Agent: Thunderbird 1.5.0.4 (X11/20060614)
MIME-Version: 1.0
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
CC:	linux-mips@linux-mips.org, ralf@linux-mips.org,
	vagabon.xyz@gmail.com
Subject: Re: [PATCH] dump_stack() based on prologue code analysis (take 2)
References: <20060729.232720.108740310.anemo@mba.ocn.ne.jp>
In-Reply-To: <20060729.232720.108740310.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: 12127
X-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:
> 
> Subject: [PATCH] dump_stack() based on prologue code analysis
> 
> Instead of dump all possible address in the stack, unwind the stack
> frame based on prologue code analysis, as like as get_wchan() does.
> While the code analysis might fail for some reason, there is a new
> kernel option "raw_show_trace" to disable this feature.
> 

my comments included with this patch...(you can find the plain patch
at the end of this email)

diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 8709a46..3bb4d47 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -365,15 +365,15 @@ #else
 	mfinfo[0].func = schedule;
 	schedule_frame = &mfinfo[0];
 #endif
-	for (i = 0; i < ARRAY_SIZE(mfinfo) && mfinfo[i].func; i++) {
-		struct mips_frame_info *info = &mfinfo[i];
-		if (get_frame_info(info)) {
-			/* leaf or unknown */
-			if (info->func == schedule)
-				printk("Can't analyze prologue code at %p\n",
-				       info->func);
-		}
-	}
+	for (i = 0; i < ARRAY_SIZE(mfinfo) && mfinfo[i].func; i++)
+		get_frame_info(mfinfo + i);
+
+	/*
+	 * Without schedule() frame info, result given by
+	 * thread_saved_pc() and get_wchan() are not reliable.
+	 */
+	if (schedule_frame->pc_offset < 0)
+		printk("Can't analyze schedule() prologue at %p\n", schedule);

>>>>>>>>>>>>>
I just put the test out of the loop and add a comment.
<<<<<<<<<<<<<
 
 	mfinfo_num = i;
 	return 0;
@@ -446,14 +446,15 @@ #endif
 
 #ifdef CONFIG_KALLSYMS
 /* used by show_frametrace() */
-unsigned long unwind_stack(struct task_struct *task,
-			   unsigned long **sp, unsigned long pc)
+unsigned long unwind_stack(struct task_struct *task, unsigned long **sp,
+			   unsigned long pc, struct pt_regs *regs)
 {
 	unsigned long stack_page;
 	struct mips_frame_info info;
 	char *modname;
 	char namebuf[KSYM_NAME_LEN + 1];
 	unsigned long size, ofs;
+	int rv;
 
 	stack_page = (unsigned long)task_stack_page(task);
 	if (!stack_page)
@@ -466,18 +467,21 @@ unsigned long unwind_stack(struct task_s
 
 	info.func = (void *)(pc - ofs);
 	info.func_size = ofs;	/* analyze from start to ofs */
-	if (get_frame_info(&info)) {
-		/* leaf or unknown */
-		*sp += info.frame_size / sizeof(long);
+	rv = get_frame_info(&info);
+	if (rv < 0)
 		return 0;
-	}
+
 	if ((unsigned long)*sp < stack_page ||
 	    (unsigned long)*sp + info.frame_size / sizeof(long) >
 	    stack_page + THREAD_SIZE - 32)
 		return 0;
 
-	pc = (*sp)[info.pc_offset];
+	if (rv)		/* leaf */
+		pc = regs->regs[31];
+	else		/* nested */
+		pc = (*sp)[info.pc_offset];
+
 	*sp += info.frame_size / sizeof(long);
-	return pc;
+	return __kernel_text_address(pc) ? pc : 0;

>>>>>>>>>>>>>
I pass regs to unwind_stack(), that simplify the caller because
it needn't to deal with leaf or nested case. Simply test for pc
is 0.
<<<<<<<<<<<<<

 }
 #endif
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 7aa9dfc..bbd1cf9 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -73,13 +73,8 @@ void (*board_nmi_handler_setup)(void);
 void (*board_ejtag_handler_setup)(void);
 void (*board_bind_eic_interrupt)(int irq, int regset);
 
-/*
- * These constant is for searching for possible module text segments.
- * MODULE_RANGE is a guess of how much space is likely to be vmalloced.
- */
-#define MODULE_RANGE (8*1024*1024)

>>>>>>>>>>>>>
seems to be unused now...
<<<<<<<<<<<<<

-static void show_trace(unsigned long *stack)
+static void show_trace(unsigned long *sp)
 {
 	const int field = 2 * sizeof(unsigned long);
 	unsigned long addr;
@@ -88,8 +83,8 @@ static void show_trace(unsigned long *st
 #ifdef CONFIG_KALLSYMS
 	printk("\n");
 #endif
-	while (!kstack_end(stack)) {
-		addr = *stack++;
+	while (!kstack_end(sp)) {
+		addr = *sp++;

>>>>>>>>>>>>>
now show_trace calls sp sp. (nothing is too late)
<<<<<<<<<<<<<

 		if (__kernel_text_address(addr)) {
 			printk(" [<%0*lx>] ", field, addr);
 			print_symbol("%s\n", addr);
@@ -107,32 +102,27 @@ static int __init set_raw_show_trace(cha
 }
 __setup("raw_show_trace", set_raw_show_trace);
 
-extern unsigned long unwind_stack(struct task_struct *task,
-				  unsigned long **sp, unsigned long pc);
-static void show_frametrace(struct task_struct *task, struct pt_regs *regs)
+extern unsigned long unwind_stack(struct task_struct *task, unsigned long **sp,
+				  unsigned long pc, struct pt_regs *regs);
+
+static void show_backtrace(struct task_struct *task, struct pt_regs *regs)

>>>>>>>>>>>>>
Just renamed show_stacktrace() into show_backtrace(). I think we
usually use the latter no ?
<<<<<<<<<<<<<

 {
-	const int field = 2 * sizeof(unsigned long);
-	unsigned long *stack = (long *)regs->regs[29];
+	unsigned long *sp = (long *)regs->regs[29];
 	unsigned long pc = regs->cp0_epc;
-	int top = 1;
 
 	if (raw_show_trace || !__kernel_text_address(pc)) {
-		show_trace(stack);
+		show_trace(sp);
 		return;
 	}
 	printk("Call Trace:\n");
-	while (__kernel_text_address(pc)) {
-		printk(" [<%0*lx>] ", field, pc);
+	do {
+		printk(" [<%0*lx>] ", 2*sizeof(unsigned long), pc);
 		print_symbol("%s\n", pc);
-		pc = unwind_stack(task, &stack, pc);
-		if (top && pc == 0)
-			pc = regs->regs[31];	/* leaf? */
-		top = 0;
-	}
+	} while ((pc = unwind_stack(task, &sp, pc, regs)));

>>>>>>>>>>>>>
Now don't deal with leaf case since unwind_stack() does it for us.
<<<<<<<<<<<<<

 	printk("\n");
 }
 #else
-#define show_frametrace(task, r) show_trace((long *)(r)->regs[29]);
+#define show_backtrace(task, r) show_trace((long *)(r)->regs[29]);
 #endif
 
 /*
@@ -165,7 +155,7 @@ static void show_stacktrace(struct task_
 		i++;
 	}
 	printk("\n");
-	show_frametrace(task, regs);
+	show_backtrace(task, regs);
 }
 
 static noinline void prepare_frametrace(struct pt_regs *regs)
@@ -216,7 +206,7 @@ #ifdef CONFIG_KALLSYMS
 	if (!raw_show_trace) {
 		struct pt_regs regs;
 		prepare_frametrace(&regs);
-		show_frametrace(current, &regs);
+		show_backtrace(current, &regs);
 		return;
 	}
 #endif



Here is the plain patch.

-- >8 --

diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 8709a46..3bb4d47 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -365,15 +365,15 @@ #else
 	mfinfo[0].func = schedule;
 	schedule_frame = &mfinfo[0];
 #endif
-	for (i = 0; i < ARRAY_SIZE(mfinfo) && mfinfo[i].func; i++) {
-		struct mips_frame_info *info = &mfinfo[i];
-		if (get_frame_info(info)) {
-			/* leaf or unknown */
-			if (info->func == schedule)
-				printk("Can't analyze prologue code at %p\n",
-				       info->func);
-		}
-	}
+	for (i = 0; i < ARRAY_SIZE(mfinfo) && mfinfo[i].func; i++)
+		get_frame_info(mfinfo + i);
+
+	/*
+	 * Without schedule() frame info, result given by
+	 * thread_saved_pc() and get_wchan() are not reliable.
+	 */
+	if (schedule_frame->pc_offset < 0)
+		printk("Can't analyze schedule() prologue at %p\n", schedule);
 
 	mfinfo_num = i;
 	return 0;
@@ -446,14 +446,15 @@ #endif
 
 #ifdef CONFIG_KALLSYMS
 /* used by show_frametrace() */
-unsigned long unwind_stack(struct task_struct *task,
-			   unsigned long **sp, unsigned long pc)
+unsigned long unwind_stack(struct task_struct *task, unsigned long **sp,
+			   unsigned long pc, struct pt_regs *regs)
 {
 	unsigned long stack_page;
 	struct mips_frame_info info;
 	char *modname;
 	char namebuf[KSYM_NAME_LEN + 1];
 	unsigned long size, ofs;
+	int rv;
 
 	stack_page = (unsigned long)task_stack_page(task);
 	if (!stack_page)
@@ -466,18 +467,21 @@ unsigned long unwind_stack(struct task_s
 
 	info.func = (void *)(pc - ofs);
 	info.func_size = ofs;	/* analyze from start to ofs */
-	if (get_frame_info(&info)) {
-		/* leaf or unknown */
-		*sp += info.frame_size / sizeof(long);
+	rv = get_frame_info(&info);
+	if (rv < 0)
 		return 0;
-	}
+
 	if ((unsigned long)*sp < stack_page ||
 	    (unsigned long)*sp + info.frame_size / sizeof(long) >
 	    stack_page + THREAD_SIZE - 32)
 		return 0;
 
-	pc = (*sp)[info.pc_offset];
+	if (rv)		/* leaf */
+		pc = regs->regs[31];
+	else		/* nested */
+		pc = (*sp)[info.pc_offset];
+
 	*sp += info.frame_size / sizeof(long);
-	return pc;
+	return __kernel_text_address(pc) ? pc : 0;
 }
 #endif
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 7aa9dfc..bbd1cf9 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -73,13 +73,8 @@ void (*board_nmi_handler_setup)(void);
 void (*board_ejtag_handler_setup)(void);
 void (*board_bind_eic_interrupt)(int irq, int regset);
 
-/*
- * These constant is for searching for possible module text segments.
- * MODULE_RANGE is a guess of how much space is likely to be vmalloced.
- */
-#define MODULE_RANGE (8*1024*1024)
 
-static void show_trace(unsigned long *stack)
+static void show_trace(unsigned long *sp)
 {
 	const int field = 2 * sizeof(unsigned long);
 	unsigned long addr;
@@ -88,8 +83,8 @@ static void show_trace(unsigned long *st
 #ifdef CONFIG_KALLSYMS
 	printk("\n");
 #endif
-	while (!kstack_end(stack)) {
-		addr = *stack++;
+	while (!kstack_end(sp)) {
+		addr = *sp++;
 		if (__kernel_text_address(addr)) {
 			printk(" [<%0*lx>] ", field, addr);
 			print_symbol("%s\n", addr);
@@ -107,32 +102,27 @@ static int __init set_raw_show_trace(cha
 }
 __setup("raw_show_trace", set_raw_show_trace);
 
-extern unsigned long unwind_stack(struct task_struct *task,
-				  unsigned long **sp, unsigned long pc);
-static void show_frametrace(struct task_struct *task, struct pt_regs *regs)
+extern unsigned long unwind_stack(struct task_struct *task, unsigned long **sp,
+				  unsigned long pc, struct pt_regs *regs);
+
+static void show_backtrace(struct task_struct *task, struct pt_regs *regs)
 {
-	const int field = 2 * sizeof(unsigned long);
-	unsigned long *stack = (long *)regs->regs[29];
+	unsigned long *sp = (long *)regs->regs[29];
 	unsigned long pc = regs->cp0_epc;
-	int top = 1;
 
 	if (raw_show_trace || !__kernel_text_address(pc)) {
-		show_trace(stack);
+		show_trace(sp);
 		return;
 	}
 	printk("Call Trace:\n");
-	while (__kernel_text_address(pc)) {
-		printk(" [<%0*lx>] ", field, pc);
+	do {
+		printk(" [<%0*lx>] ", 2*sizeof(unsigned long), pc);
 		print_symbol("%s\n", pc);
-		pc = unwind_stack(task, &stack, pc);
-		if (top && pc == 0)
-			pc = regs->regs[31];	/* leaf? */
-		top = 0;
-	}
+	} while ((pc = unwind_stack(task, &sp, pc, regs)));
 	printk("\n");
 }
 #else
-#define show_frametrace(task, r) show_trace((long *)(r)->regs[29]);
+#define show_backtrace(task, r) show_trace((long *)(r)->regs[29]);
 #endif
 
 /*
@@ -165,7 +155,7 @@ static void show_stacktrace(struct task_
 		i++;
 	}
 	printk("\n");
-	show_frametrace(task, regs);
+	show_backtrace(task, regs);
 }
 
 static noinline void prepare_frametrace(struct pt_regs *regs)
@@ -216,7 +206,7 @@ #ifdef CONFIG_KALLSYMS
 	if (!raw_show_trace) {
 		struct pt_regs regs;
 		prepare_frametrace(&regs);
-		show_frametrace(current, &regs);
+		show_backtrace(current, &regs);
 		return;
 	}
 #endif


From vagabon.xyz@gmail.com Mon Jul 31 10:16:49 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 31 Jul 2006 10:16:58 +0100 (BST)
Received: from wr-out-0506.google.com ([64.233.184.235]:8064 "EHLO
	wr-out-0506.google.com") by ftp.linux-mips.org with ESMTP
	id S8133487AbWGaJQt (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 31 Jul 2006 10:16:49 +0100
Received: by wr-out-0506.google.com with SMTP id i31so359291wra
        for <linux-mips@linux-mips.org>; Mon, 31 Jul 2006 02:16:47 -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=W3VDaNnNEyqPGCUyYY3ku0ori+WV5QjZCd2mQgyYMa0alxnZ6JfXAKEN1UVB4FxmiMnRR+eznCZzyCVrjyttBMdgRzE1tkhvWvKk2QrkgK9d6bS1w/y0j4OC8aMzzoZ1DaG1FxWobXrFtsq7etZWbaXmD/OXUt1+rqwXAppHLyE=
Received: by 10.54.109.3 with SMTP id h3mr2210919wrc;
        Mon, 31 Jul 2006 02:16:47 -0700 (PDT)
Received: from ?192.168.0.24? ( [194.3.162.233])
        by mx.gmail.com with ESMTP id 8sm3209276wrl.2006.07.31.02.16.45;
        Mon, 31 Jul 2006 02:16:47 -0700 (PDT)
Message-ID: <44CDCA46.3030707@innova-card.com>
Date:	Mon, 31 Jul 2006 11:15:50 +0200
Reply-To: Franck <vagabon.xyz@gmail.com>
User-Agent: Thunderbird 1.5.0.4 (X11/20060614)
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] dump_stack() based on prologue code analysis
References: <20060726.232231.59465336.anemo@mba.ocn.ne.jp>	<44C8CEA4.20000@innova-card.com>	<cda58cb80607271203u70b26e23o65b71d3d0c900f94@mail.gmail.com> <20060729.010137.36922349.anemo@mba.ocn.ne.jp>
In-Reply-To: <20060729.010137.36922349.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: 12128
X-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, 27 Jul 2006 21:03:07 +0200, "Franck Bui-Huu" <vagabon.xyz@gmail.com> wrote:
>>>> +     info.func = (void *)(pc - ofs);
>>>> +     info.func_size = ofs;   /* analyze from start to ofs */
>> in get_frame_info(), there is the following condition to stop the
>> prologue analysis
>>
>> 		if (info->func_size && i >= info->func_size / 4)
>> 			break;
>>
>> Setting info.func_size = ofs may trigger this stop condition very
>> early, specially if "ofs" is small...I would simply remove this
>> condition since it's very empirical and IMHO not very usefull.
> 
> Yes, that is what I wanted.  Imagine if a exception happened on first
> place on non-leaf function.  In this case, we must assume the function
> is leaf since RA is not saved to the stack.
> 

The only case I can imagine is when sp is corrupted which is unlikely.
However an exception can occure just after a prologue of a nested
function which is more likely. In that case you will assume wrongly
that the function was a leaf one.

I don't think we gain more than we loose with this test. Maybe we can
just leave

 		if (i >= info->func_size)
 			break;

for safety purpose.

		Franck

From anemo@mba.ocn.ne.jp Mon Jul 31 14:38:05 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 31 Jul 2006 14:38:16 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:47331 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8126917AbWGaNiF (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 31 Jul 2006 14:38:05 +0100
Received: from localhost (p3075-ipad208funabasi.chiba.ocn.ne.jp [60.43.104.75])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id E77AD97CB; Mon, 31 Jul 2006 22:37:50 +0900 (JST)
Date:	Mon, 31 Jul 2006 22:39:23 +0900 (JST)
Message-Id: <20060731.223923.115609520.anemo@mba.ocn.ne.jp>
To:	vagabon.xyz@gmail.com
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] dump_stack() based on prologue code analysis
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <44CDCA46.3030707@innova-card.com>
References: <cda58cb80607271203u70b26e23o65b71d3d0c900f94@mail.gmail.com>
	<20060729.010137.36922349.anemo@mba.ocn.ne.jp>
	<44CDCA46.3030707@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: 12129
X-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 Mon, 31 Jul 2006 11:15:50 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
> > Yes, that is what I wanted.  Imagine if a exception happened on first
> > place on non-leaf function.  In this case, we must assume the function
> > is leaf since RA is not saved to the stack.
> 
> The only case I can imagine is when sp is corrupted which is unlikely.

Modern gcc somtimes do amazing optimization ;-)

> However an exception can occure just after a prologue of a nested
> function which is more likely. In that case you will assume wrongly
> that the function was a leaf one.

Why?  get_frame_info() should detect frame_size and pc_offset for that
case.

Is your objection against "info->func_size / 4" part?  the "4" comes
from size of a instruction.

Well, using "4" instead of "sizeof(union mips_instruction)" or
"sizeof(*ip)" was my old fault...

---
Atsushi Nemoto

From yoichi_yuasa@tripeaks.co.jp Mon Jul 31 15:05:38 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 31 Jul 2006 15:05:48 +0100 (BST)
Received: from mo31.po.2iij.net ([210.128.50.54]:20268 "EHLO mo31.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8126917AbWGaOFi (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 31 Jul 2006 15:05:38 +0100
Received: by mo.po.2iij.net (mo31) id k6VE5ZNm082481; Mon, 31 Jul 2006 23:05:35 +0900 (JST)
Received: from localhost.localdomain (8.26.30.125.dy.iij4u.or.jp [125.30.26.8])
	by mbox.po.2iij.net (mbox32) id k6VE5XbT094551
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Mon, 31 Jul 2006 23:05:33 +0900 (JST)
Date:	Mon, 31 Jul 2006 23:05:04 +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 Makefile about EV64120 PCI fixup
Message-Id: <20060731230504.5f470eb6.yoichi_yuasa@tripeaks.co.jp>
Organization: TriPeaks Corporation
X-Mailer: Sylpheed version 1.0.6 (GTK+ 1.2.10; i486-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <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: 12130
X-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 Makefile about EV64120 PCI fixup.
Please apply.

Yoichi

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

diff -pruN -X mips/Documentation/dontdiff mips-orig/arch/mips/pci/Makefile mips/arch/mips/pci/Makefile
--- mips-orig/arch/mips/pci/Makefile	2006-07-31 13:48:35.879388750 +0900
+++ mips/arch/mips/pci/Makefile	2006-07-31 13:49:44.115653250 +0900
@@ -28,7 +28,7 @@ obj-$(CONFIG_DDB5477)		+= fixup-ddb5477.
 obj-$(CONFIG_LASAT)		+= pci-lasat.o
 obj-$(CONFIG_MIPS_ATLAS)	+= fixup-atlas.o
 obj-$(CONFIG_MIPS_COBALT)	+= fixup-cobalt.o
-obj-$(CONFIG_MIPS_EV96100)	+= fixup-ev64120.o
+obj-$(CONFIG_MIPS_EV64120)	+= fixup-ev64120.o
 obj-$(CONFIG_MIPS_EV96100)	+= fixup-ev96100.o pci-ev96100.o
 obj-$(CONFIG_MIPS_ITE8172)	+= fixup-ite8172g.o
 obj-$(CONFIG_MIPS_IVR)		+= fixup-ivr.o

From yoichi_yuasa@tripeaks.co.jp Mon Jul 31 15:06:16 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 31 Jul 2006 15:06:38 +0100 (BST)
Received: from mo31.po.2iij.net ([210.128.50.54]:48967 "EHLO mo31.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S8126920AbWGaOFi (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 31 Jul 2006 15:05:38 +0100
Received: by mo.po.2iij.net (mo31) id k6VE5YwV082474; Mon, 31 Jul 2006 23:05:34 +0900 (JST)
Received: from localhost.localdomain (8.26.30.125.dy.iij4u.or.jp [125.30.26.8])
	by mbox.po.2iij.net (mbox32) id k6VE5Wlt094537
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Mon, 31 Jul 2006 23:05:32 +0900 (JST)
Date:	Mon, 31 Jul 2006 23:01:37 +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] changed common definitions to using asm-generic/signal.h
Message-Id: <20060731230137.494dfb3e.yoichi_yuasa@tripeaks.co.jp>
Organization: TriPeaks Corporation
X-Mailer: Sylpheed version 1.0.6 (GTK+ 1.2.10; i486-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <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: 12131
X-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 changed common definitions to using asm-generic/signal.h .
Please apply.

Yoichi

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

diff -pruN -X mips/Documentation/dontdiff mips-orig/include/asm-mips/signal.h mips/include/asm-mips/signal.h
--- mips-orig/include/asm-mips/signal.h	2006-07-25 14:34:52.507500500 +0900
+++ mips/include/asm-mips/signal.h	2006-07-25 14:49:34.814641250 +0900
@@ -111,14 +111,7 @@ typedef unsigned long old_sigset_t;		/* 
 #define SIG_SETMASK32	256	/* Goodie from SGI for BSD compatibility:
 				   set only the low 32 bit of the sigset.  */
 
-/* Type of a signal handler.  */
-typedef void __signalfn_t(int);
-typedef __signalfn_t __user *__sighandler_t;
-
-/* Fake signal functions */
-#define SIG_DFL	((__sighandler_t)0)	/* default signal handling */
-#define SIG_IGN	((__sighandler_t)1)	/* ignore signal */
-#define SIG_ERR	((__sighandler_t)-1)	/* error return from signal */
+#include <asm-generic/signal.h>
 
 struct sigaction {
 	unsigned int	sa_flags;

From vagabon.xyz@gmail.com Mon Jul 31 15:33:53 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 31 Jul 2006 15:34:03 +0100 (BST)
Received: from wr-out-0506.google.com ([64.233.184.239]:57782 "EHLO
	wr-out-0506.google.com") by ftp.linux-mips.org with ESMTP
	id S8126923AbWGaOdx (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 31 Jul 2006 15:33:53 +0100
Received: by wr-out-0506.google.com with SMTP id i31so505558wra
        for <linux-mips@linux-mips.org>; Mon, 31 Jul 2006 07:33:50 -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=pdV3PF9u7xgH8hajhChmgndSGjjU29y9Dg5f9gg7gAHOKcDekvwmDmFCs2KmVRVpohTP1gb39wEojRl+ffGZvMNNZsrS1u9xwy5KsHhljNev39zN6cbJWaBmS57cLhBo5HQw8RriVsum6GhCoDilza0B7E3xCE/ew4gD2EJZL3k=
Received: by 10.54.62.16 with SMTP id k16mr2515652wra;
        Mon, 31 Jul 2006 07:33:50 -0700 (PDT)
Received: from ?192.168.0.24? ( [194.3.162.233])
        by mx.gmail.com with ESMTP id 29sm147864wrl.2006.07.31.07.33.48;
        Mon, 31 Jul 2006 07:33:49 -0700 (PDT)
Message-ID: <44CE1494.4080801@innova-card.com>
Date:	Mon, 31 Jul 2006 16:32:52 +0200
Reply-To: Franck <vagabon.xyz@gmail.com>
User-Agent: Thunderbird 1.5.0.4 (X11/20060614)
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] dump_stack() based on prologue code analysis
References: <cda58cb80607271203u70b26e23o65b71d3d0c900f94@mail.gmail.com>	<20060729.010137.36922349.anemo@mba.ocn.ne.jp>	<44CDCA46.3030707@innova-card.com> <20060731.223923.115609520.anemo@mba.ocn.ne.jp>
In-Reply-To: <20060731.223923.115609520.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: 12132
X-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 Mon, 31 Jul 2006 11:15:50 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
>>> Yes, that is what I wanted.  Imagine if a exception happened on first
>>> place on non-leaf function.  In this case, we must assume the function
>>> is leaf since RA is not saved to the stack.
>> The only case I can imagine is when sp is corrupted which is unlikely.
> 
> Modern gcc somtimes do amazing optimization ;-)
> 
>> However an exception can occure just after a prologue of a nested
>> function which is more likely. In that case you will assume wrongly
>> that the function was a leaf one.
> 
> Why?  get_frame_info() should detect frame_size and pc_offset for that
> case.
> 
> Is your objection against "info->func_size / 4" part?  the "4" comes
> from size of a instruction.
>

OK. I missed that, sorry.

> Well, using "4" instead of "sizeof(union mips_instruction)" or
> "sizeof(*ip)" was my old fault...

Well could we use "sizeof(union mips_instruction)" so nobody won't
make the same mistake ?

 		if (i >= info->func_size / sizeof(union mips_instruction))
 			break;

BTW I omit the first condition "info->func_size != 0" because
normally a func has a no null size. If it has we should stop
right now.

We should also test this condition _before_ testing that "*ip" is
a jal instruction, shouldn't we ?

		Franck

From anemo@mba.ocn.ne.jp Mon Jul 31 15:55:01 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 31 Jul 2006 15:55:13 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:13771 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8126927AbWGaOzB (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 31 Jul 2006 15:55:01 +0100
Received: from localhost (p3075-ipad208funabasi.chiba.ocn.ne.jp [60.43.104.75])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id BC1C18626; Mon, 31 Jul 2006 23:54:53 +0900 (JST)
Date:	Mon, 31 Jul 2006 23:56:26 +0900 (JST)
Message-Id: <20060731.235626.86888625.anemo@mba.ocn.ne.jp>
To:	vagabon.xyz@gmail.com
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] dump_stack() based on prologue code analysis (take 2)
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <44CDC657.9090403@innova-card.com>
References: <20060729.232720.108740310.anemo@mba.ocn.ne.jp>
	<44CDC657.9090403@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: 12133
X-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 Mon, 31 Jul 2006 10:59:03 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
> my comments included with this patch...(you can find the plain patch
> at the end of this email)
> 
> diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
> index 8709a46..3bb4d47 100644
> --- a/arch/mips/kernel/process.c
> +++ b/arch/mips/kernel/process.c
> @@ -365,15 +365,15 @@ #else
>  	mfinfo[0].func = schedule;
>  	schedule_frame = &mfinfo[0];
>  #endif
> -	for (i = 0; i < ARRAY_SIZE(mfinfo) && mfinfo[i].func; i++) {
> -		struct mips_frame_info *info = &mfinfo[i];
> -		if (get_frame_info(info)) {
> -			/* leaf or unknown */
> -			if (info->func == schedule)
> -				printk("Can't analyze prologue code at %p\n",
> -				       info->func);
> -		}
> -	}
> +	for (i = 0; i < ARRAY_SIZE(mfinfo) && mfinfo[i].func; i++)
> +		get_frame_info(mfinfo + i);
> +
> +	/*
> +	 * Without schedule() frame info, result given by
> +	 * thread_saved_pc() and get_wchan() are not reliable.
> +	 */
> +	if (schedule_frame->pc_offset < 0)
> +		printk("Can't analyze schedule() prologue at %p\n", schedule);
> 
> >>>>>>>>>>>>>
> I just put the test out of the loop and add a comment.
> <<<<<<<<<<<<<

Looks good.

> @@ -466,18 +467,21 @@ unsigned long unwind_stack(struct task_s
>  
>  	info.func = (void *)(pc - ofs);
>  	info.func_size = ofs;	/* analyze from start to ofs */
> -	if (get_frame_info(&info)) {
> -		/* leaf or unknown */
> -		*sp += info.frame_size / sizeof(long);
> +	rv = get_frame_info(&info);
> +	if (rv < 0)
>  		return 0;
> -	}
> +
>  	if ((unsigned long)*sp < stack_page ||
>  	    (unsigned long)*sp + info.frame_size / sizeof(long) >
>  	    stack_page + THREAD_SIZE - 32)
>  		return 0;
>  
> -	pc = (*sp)[info.pc_offset];
> +	if (rv)		/* leaf */
> +		pc = regs->regs[31];
> +	else		/* nested */
> +		pc = (*sp)[info.pc_offset];
> +
>  	*sp += info.frame_size / sizeof(long);
> -	return pc;
> +	return __kernel_text_address(pc) ? pc : 0;
> 
> >>>>>>>>>>>>>
> I pass regs to unwind_stack(), that simplify the caller because
> it needn't to deal with leaf or nested case. Simply test for pc
> is 0.
> <<<<<<<<<<<<<

It seems a bit fragile.  The regs->regs[31] can be used for top of
stack, but we should consider that get_frame_info() might return wrong
result (again, get_frame_info() is not perfect).  If get_frame_info()
returned 0 on middle level of the stack, taking regs->regs[31] leads
wrong trace.  Maybe you can use NULL value as regs for non-toplevel.

> diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
> index 7aa9dfc..bbd1cf9 100644
> --- a/arch/mips/kernel/traps.c
> +++ b/arch/mips/kernel/traps.c
> @@ -73,13 +73,8 @@ void (*board_nmi_handler_setup)(void);
>  void (*board_ejtag_handler_setup)(void);
>  void (*board_bind_eic_interrupt)(int irq, int regset);
>  
> -/*
> - * These constant is for searching for possible module text segments.
> - * MODULE_RANGE is a guess of how much space is likely to be vmalloced.
> - */
> -#define MODULE_RANGE (8*1024*1024)
> 
> >>>>>>>>>>>>>
> seems to be unused now...
> <<<<<<<<<<<<<

This is irrelevant.  It would be better to make another patch.

> -static void show_trace(unsigned long *stack)
> +static void show_trace(unsigned long *sp)
>  {
>  	const int field = 2 * sizeof(unsigned long);
>  	unsigned long addr;
> @@ -88,8 +83,8 @@ static void show_trace(unsigned long *st
>  #ifdef CONFIG_KALLSYMS
>  	printk("\n");
>  #endif
> -	while (!kstack_end(stack)) {
> -		addr = *stack++;
> +	while (!kstack_end(sp)) {
> +		addr = *sp++;
> 
> >>>>>>>>>>>>>
> now show_trace calls sp sp. (nothing is too late)
> <<<<<<<<<<<<<

I feel "stack" is better than "sp" in this case, but do not object to
this change.

> @@ -107,32 +102,27 @@ static int __init set_raw_show_trace(cha
>  }
>  __setup("raw_show_trace", set_raw_show_trace);
>  
> -extern unsigned long unwind_stack(struct task_struct *task,
> -				  unsigned long **sp, unsigned long pc);
> -static void show_frametrace(struct task_struct *task, struct pt_regs *regs)
> +extern unsigned long unwind_stack(struct task_struct *task, unsigned long **sp,
> +				  unsigned long pc, struct pt_regs *regs);
> +
> +static void show_backtrace(struct task_struct *task, struct pt_regs *regs)
> 
> >>>>>>>>>>>>>
> Just renamed show_stacktrace() into show_backtrace(). I think we
> usually use the latter no ?
> <<<<<<<<<<<<<

No objection.

>  {
> -	const int field = 2 * sizeof(unsigned long);
> -	unsigned long *stack = (long *)regs->regs[29];
> +	unsigned long *sp = (long *)regs->regs[29];
>  	unsigned long pc = regs->cp0_epc;
> -	int top = 1;
>  
>  	if (raw_show_trace || !__kernel_text_address(pc)) {
> -		show_trace(stack);
> +		show_trace(sp);
>  		return;
>  	}
>  	printk("Call Trace:\n");
> -	while (__kernel_text_address(pc)) {
> -		printk(" [<%0*lx>] ", field, pc);
> +	do {
> +		printk(" [<%0*lx>] ", 2*sizeof(unsigned long), pc);
>  		print_symbol("%s\n", pc);
> -		pc = unwind_stack(task, &stack, pc);
> -		if (top && pc == 0)
> -			pc = regs->regs[31];	/* leaf? */
> -		top = 0;
> -	}
> +	} while ((pc = unwind_stack(task, &sp, pc, regs)));
> 
> >>>>>>>>>>>>>
> Now don't deal with leaf case since unwind_stack() does it for us.
> <<<<<<<<<<<<<

As I wrote above, passing "regs" for all level seems not appropriate.

---
Atsushi Nemoto

From anemo@mba.ocn.ne.jp Mon Jul 31 16:31:45 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 31 Jul 2006 16:31:56 +0100 (BST)
Received: from mba.ocn.ne.jp ([210.190.142.172]:57052 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S8126934AbWGaPbp (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 31 Jul 2006 16:31:45 +0100
Received: from localhost (p3075-ipad208funabasi.chiba.ocn.ne.jp [60.43.104.75])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 6947B943B; Tue,  1 Aug 2006 00:31:39 +0900 (JST)
Date:	Tue, 01 Aug 2006 00:33:11 +0900 (JST)
Message-Id: <20060801.003311.75758612.anemo@mba.ocn.ne.jp>
To:	vagabon.xyz@gmail.com
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] dump_stack() based on prologue code analysis
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <44CE1494.4080801@innova-card.com>
References: <44CDCA46.3030707@innova-card.com>
	<20060731.223923.115609520.anemo@mba.ocn.ne.jp>
	<44CE1494.4080801@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: 12134
X-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 Mon, 31 Jul 2006 16:32:52 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
> Well could we use "sizeof(union mips_instruction)" so nobody won't
> make the same mistake ?
> 
>  		if (i >= info->func_size / sizeof(union mips_instruction))
>  			break;

Indeed.

> BTW I omit the first condition "info->func_size != 0" because
> normally a func has a no null size. If it has we should stop
> right now.
 
Yes.  I can not remember why "info->func_size != 0" is there...

> We should also test this condition _before_ testing that "*ip" is
> a jal instruction, shouldn't we ?

Yes, and we can hold the condition indo the "for" statement.


Subject: [PATCH] make get_frame_info() more readable.

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

diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 8709a46..949efaf 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -286,18 +286,17 @@ static int get_frame_info(struct mips_fr
 	int i;
 	void *func = info->func;
 	union mips_instruction *ip = (union mips_instruction *)func;
+	int max_insns =
+		min(128UL, info->func_size / sizeof(union mips_instruction));
 	info->pc_offset = -1;
 	info->frame_size = 0;
-	for (i = 0; i < 128; i++, ip++) {
+	for (i = 0; i < max_insns; i++, ip++) {
 		/* if jal, jalr, jr, stop. */
 		if (ip->j_format.opcode == jal_op ||
 		    (ip->r_format.opcode == spec_op &&
 		     (ip->r_format.func == jalr_op ||
 		      ip->r_format.func == jr_op)))
 			break;
-
-		if (info->func_size && i >= info->func_size / 4)
-			break;
 		if (
 #ifdef CONFIG_32BIT
 		    ip->i_format.opcode == addiu_op &&

From vagabon.xyz@gmail.com Mon Jul 31 16:52:23 2006
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 31 Jul 2006 16:52:37 +0100 (BST)
Received: from wx-out-0102.google.com ([66.249.82.194]:31939 "EHLO
	wx-out-0102.google.com") by ftp.linux-mips.org with ESMTP
	id S8126937AbWGaPwX (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 31 Jul 2006 16:52:23 +0100
Received: by wx-out-0102.google.com with SMTP id h29so91434wxd
        for <linux-mips@linux-mips.org>; Mon, 31 Jul 2006 08:52:19 -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=DiCc0JkvJ5vXrD7Fc7Xz/WUzhz9kYtIM6wKtd/X6jy4kYHhc5BE2J8WVKIKHQ8gT7Hc/KMYsU1T8qjBibYuxU9krDT8blBEoTGXl7j+4cQ6ppc9hw6d6KXBzI17+hzyPV02mN+a3eSTij9PJOPn3b1NfgD4mYHcwZ9D6Jt0388I=
Received: by 10.70.32.18 with SMTP id f18mr2832055wxf;
        Mon, 31 Jul 2006 08:52:19 -0700 (PDT)
Received: from ?192.168.0.24? ( [194.3.162.233])
        by mx.gmail.com with ESMTP id h7sm5045880wxd.2006.07.31.08.52.17;
        Mon, 31 Jul 2006 08:52:19 -0700 (PDT)
Message-ID: <44CE26FA.8070909@innova-card.com>
Date:	Mon, 31 Jul 2006 17:51:22 +0200
Reply-To: Franck <vagabon.xyz@gmail.com>
User-Agent: Thunderbird 1.5.0.4 (X11/20060614)
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] dump_stack() based on prologue code analysis
References: <44CDCA46.3030707@innova-card.com>	<20060731.223923.115609520.anemo@mba.ocn.ne.jp>	<44CE1494.4080801@innova-car