From dmitri.vorobiev@gmail.com Tue Apr  1 00:05:13 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 01 Apr 2008 00:05:20 +0200 (CEST)
Received: from [62.5.255.49] ([62.5.255.49]:56021 "EHLO smtp02.mtu.ru")
	by lappi.linux-mips.net with ESMTP id S1100115AbYCaWFN (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 1 Apr 2008 00:05:13 +0200
Received: from smtp02.mtu.ru (localhost [127.0.0.1])
	by smtp02.mtu.ru (Postfix) with ESMTP id 7EB1744759;
	Tue,  1 Apr 2008 02:03:45 +0400 (MSD)
Received: from localhost.localdomain (ppp85-140-79-111.pppoe.mtu-net.ru [85.140.79.111])
	by smtp02.mtu.ru (Postfix) with ESMTP id AC3E1445A7;
	Tue,  1 Apr 2008 02:03:22 +0400 (MSD)
From:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
To:	linux-mips@linux-mips.org, ralf@linux-mips.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/6] [MIPS] make mips_nmi_setup() static
Date:	Tue,  1 Apr 2008 02:03:20 +0400
Message-Id: <1207001005-2633-2-git-send-email-dmitri.vorobiev@gmail.com>
X-Mailer: git-send-email 1.5.3.6
In-Reply-To: <1207001005-2633-1-git-send-email-dmitri.vorobiev@gmail.com>
References: <1207001005-2633-1-git-send-email-dmitri.vorobiev@gmail.com>
X-DCC-STREAM-Metrics: smtp02.mtu.ru 10001; Body=0 Fuz1=0 Fuz2=0
Return-Path: <dmitri.vorobiev@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: 18721
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dmitri.vorobiev@gmail.com
Precedence: bulk
X-list: linux-mips

This change makes the needlessly global function mips_nmi_setup() static.

Successfully build-tested using default configs for Malta, Atlas
and SEAD boards.

Runtime test successfully performed by booting the Malta 4Kc board
up to the shell prompt.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
---
 arch/mips/mips-boards/generic/init.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/mips-boards/generic/init.c b/arch/mips/mips-boards/generic/init.c
index 1695dca..70dd9f4 100644
--- a/arch/mips/mips-boards/generic/init.c
+++ b/arch/mips/mips-boards/generic/init.c
@@ -226,7 +226,7 @@ void __init kgdb_config(void)
 }
 #endif
 
-void __init mips_nmi_setup(void)
+static void __init mips_nmi_setup(void)
 {
 	void *base;
 	extern char except_vec_nmi;
-- 
1.5.3


From dmitri.vorobiev@gmail.com Tue Apr  1 00:06:27 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 01 Apr 2008 00:06:37 +0200 (CEST)
Received: from smtp02.mtu.ru ([62.5.255.49]:57302 "EHLO smtp02.mtu.ru")
	by lappi.linux-mips.net with ESMTP id S1100126AbYCaWG0 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 1 Apr 2008 00:06:26 +0200
Received: from smtp02.mtu.ru (localhost [127.0.0.1])
	by smtp02.mtu.ru (Postfix) with ESMTP id 04FDE451D6;
	Tue,  1 Apr 2008 02:04:01 +0400 (MSD)
Received: from localhost.localdomain (ppp85-140-79-111.pppoe.mtu-net.ru [85.140.79.111])
	by smtp02.mtu.ru (Postfix) with ESMTP id 657294565A;
	Tue,  1 Apr 2008 02:03:27 +0400 (MSD)
From:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
To:	linux-mips@linux-mips.org, ralf@linux-mips.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/6] [MIPS] make mips_ejtag_setup() static
Date:	Tue,  1 Apr 2008 02:03:21 +0400
Message-Id: <1207001005-2633-3-git-send-email-dmitri.vorobiev@gmail.com>
X-Mailer: git-send-email 1.5.3.6
In-Reply-To: <1207001005-2633-1-git-send-email-dmitri.vorobiev@gmail.com>
References: <1207001005-2633-1-git-send-email-dmitri.vorobiev@gmail.com>
X-DCC-STREAM-Metrics: smtp02.mtu.ru 10001; Body=0 Fuz1=0 Fuz2=0
Return-Path: <dmitri.vorobiev@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: 18722
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dmitri.vorobiev@gmail.com
Precedence: bulk
X-list: linux-mips

This change makes the needlessly global function mips_ejtag_setup() static.

Successfully build-tested using default configs for Malta, Atlas
and SEAD boards.

Runtime test successfully performed by booting the Malta 4Kc board
up to the shell prompt.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
---
 arch/mips/mips-boards/generic/init.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/mips-boards/generic/init.c b/arch/mips/mips-boards/generic/init.c
index 70dd9f4..80e5504 100644
--- a/arch/mips/mips-boards/generic/init.c
+++ b/arch/mips/mips-boards/generic/init.c
@@ -238,7 +238,7 @@ static void __init mips_nmi_setup(void)
 	flush_icache_range((unsigned long)base, (unsigned long)base + 0x80);
 }
 
-void __init mips_ejtag_setup(void)
+static void __init mips_ejtag_setup(void)
 {
 	void *base;
 	extern char except_vec_ejtag_debug;
-- 
1.5.3


From dmitri.vorobiev@gmail.com Tue Apr  1 00:07:27 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 01 Apr 2008 00:07:37 +0200 (CEST)
Received: from smtp02.mtu.ru ([62.5.255.49]:10456 "EHLO smtp02.mtu.ru")
	by lappi.linux-mips.net with ESMTP id S1100128AbYCaWHG (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 1 Apr 2008 00:07:06 +0200
Received: from smtp02.mtu.ru (localhost [127.0.0.1])
	by smtp02.mtu.ru (Postfix) with ESMTP id A412E456AF;
	Tue,  1 Apr 2008 02:05:16 +0400 (MSD)
Received: from localhost.localdomain (ppp85-140-79-111.pppoe.mtu-net.ru [85.140.79.111])
	by smtp02.mtu.ru (Postfix) with ESMTP id 1CC7B4470B;
	Tue,  1 Apr 2008 02:03:41 +0400 (MSD)
From:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
To:	linux-mips@linux-mips.org, ralf@linux-mips.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 6/6] [MIPS] malta_int.c: make 4 variables static
Date:	Tue,  1 Apr 2008 02:03:25 +0400
Message-Id: <1207001005-2633-7-git-send-email-dmitri.vorobiev@gmail.com>
X-Mailer: git-send-email 1.5.3.6
In-Reply-To: <1207001005-2633-1-git-send-email-dmitri.vorobiev@gmail.com>
References: <1207001005-2633-1-git-send-email-dmitri.vorobiev@gmail.com>
X-DCC-STREAM-Metrics: smtp02.mtu.ru 10001; Body=0 Fuz1=0 Fuz2=0
Return-Path: <dmitri.vorobiev@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: 18723
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dmitri.vorobiev@gmail.com
Precedence: bulk
X-list: linux-mips

The following variables defined in arch/mips/mips-boards/malta/malta_int.c
can become static: msc_irqmap[], msc_nr_irqs, msc_eicirqmap[], and
msc_nr_eicirqs. This patch makes them static.

Successfully build-tested using default configs for Malta, Atlas
and SEAD boards.

Runtime test successfully performed by booting the Malta 4Kc board
up to the shell prompt.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
---
 arch/mips/mips-boards/malta/malta_int.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/mips/mips-boards/malta/malta_int.c b/arch/mips/mips-boards/malta/malta_int.c
index dbe60eb..b51a70b 100644
--- a/arch/mips/mips-boards/malta/malta_int.c
+++ b/arch/mips/mips-boards/malta/malta_int.c
@@ -273,13 +273,13 @@ static struct irqaction corehi_irqaction = {
 	.name = "CoreHi"
 };
 
-msc_irqmap_t __initdata msc_irqmap[] = {
+static msc_irqmap_t __initdata msc_irqmap[] = {
 	{MSC01C_INT_TMR,		MSC01_IRQ_EDGE, 0},
 	{MSC01C_INT_PCI,		MSC01_IRQ_LEVEL, 0},
 };
-int __initdata msc_nr_irqs = ARRAY_SIZE(msc_irqmap);
+static int __initdata msc_nr_irqs = ARRAY_SIZE(msc_irqmap);
 
-msc_irqmap_t __initdata msc_eicirqmap[] = {
+static msc_irqmap_t __initdata msc_eicirqmap[] = {
 	{MSC01E_INT_SW0,		MSC01_IRQ_LEVEL, 0},
 	{MSC01E_INT_SW1,		MSC01_IRQ_LEVEL, 0},
 	{MSC01E_INT_I8259A,		MSC01_IRQ_LEVEL, 0},
@@ -291,7 +291,7 @@ msc_irqmap_t __initdata msc_eicirqmap[] = {
 	{MSC01E_INT_PERFCTR,		MSC01_IRQ_LEVEL, 0},
 	{MSC01E_INT_CPUCTR,		MSC01_IRQ_LEVEL, 0}
 };
-int __initdata msc_nr_eicirqs = ARRAY_SIZE(msc_eicirqmap);
+static int __initdata msc_nr_eicirqs = ARRAY_SIZE(msc_eicirqmap);
 
 void __init arch_init_irq(void)
 {
-- 
1.5.3


From dmitri.vorobiev@gmail.com Tue Apr  1 00:08:38 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 01 Apr 2008 00:08:46 +0200 (CEST)
Received: from smtp02.mtu.ru ([62.5.255.49]:15832 "EHLO smtp02.mtu.ru")
	by lappi.linux-mips.net with ESMTP id S1100129AbYCaWHH (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 1 Apr 2008 00:07:07 +0200
Received: from smtp02.mtu.ru (localhost [127.0.0.1])
	by smtp02.mtu.ru (Postfix) with ESMTP id 6A49945350;
	Tue,  1 Apr 2008 02:05:25 +0400 (MSD)
Received: from localhost.localdomain (ppp85-140-79-111.pppoe.mtu-net.ru [85.140.79.111])
	by smtp02.mtu.ru (Postfix) with ESMTP id 5ECE6439E1;
	Tue,  1 Apr 2008 02:03:30 +0400 (MSD)
From:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
To:	linux-mips@linux-mips.org, ralf@linux-mips.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/6] [MIPS] make mdesc and prom_getmdesc() static
Date:	Tue,  1 Apr 2008 02:03:22 +0400
Message-Id: <1207001005-2633-4-git-send-email-dmitri.vorobiev@gmail.com>
X-Mailer: git-send-email 1.5.3.6
In-Reply-To: <1207001005-2633-1-git-send-email-dmitri.vorobiev@gmail.com>
References: <1207001005-2633-1-git-send-email-dmitri.vorobiev@gmail.com>
X-DCC-STREAM-Metrics: smtp02.mtu.ru 10001; Body=0 Fuz1=0 Fuz2=0
Return-Path: <dmitri.vorobiev@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: 18724
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dmitri.vorobiev@gmail.com
Precedence: bulk
X-list: linux-mips

Neither the mdesc[] array nor the prom_getmdesc() function need to
be global. This patch makes them static.

Successfully build-tested using default configs for Malta, Atlas
and SEAD boards.

Runtime test successfully performed by booting the Malta 4Kc board
up to the shell prompt.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
---
 arch/mips/mips-boards/generic/memory.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/mips-boards/generic/memory.c b/arch/mips/mips-boards/generic/memory.c
index dc272c1..5e443bb 100644
--- a/arch/mips/mips-boards/generic/memory.c
+++ b/arch/mips/mips-boards/generic/memory.c
@@ -37,7 +37,7 @@ enum yamon_memtypes {
 	yamon_prom,
 	yamon_free,
 };
-struct prom_pmemblock mdesc[PROM_MAX_PMEMBLOCKS];
+static struct prom_pmemblock mdesc[PROM_MAX_PMEMBLOCKS];
 
 #ifdef DEBUG
 static char *mtypes[3] = {
@@ -50,7 +50,7 @@ static char *mtypes[3] = {
 /* determined physical memory size, not overridden by command line args  */
 unsigned long physical_memsize = 0L;
 
-struct prom_pmemblock * __init prom_getmdesc(void)
+static struct prom_pmemblock * __init prom_getmdesc(void)
 {
 	char *memsize_str;
 	unsigned int memsize;
-- 
1.5.3


From dmitri.vorobiev@gmail.com Tue Apr  1 00:10:09 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 01 Apr 2008 00:10:17 +0200 (CEST)
Received: from smtp02.mtu.ru ([62.5.255.49]:33753 "EHLO smtp02.mtu.ru")
	by lappi.linux-mips.net with ESMTP id S1100135AbYCaWHr (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 1 Apr 2008 00:07:47 +0200
Received: from smtp02.mtu.ru (localhost [127.0.0.1])
	by smtp02.mtu.ru (Postfix) with ESMTP id 4CC3644161;
	Tue,  1 Apr 2008 02:04:40 +0400 (MSD)
Received: from localhost.localdomain (ppp85-140-79-111.pppoe.mtu-net.ru [85.140.79.111])
	by smtp02.mtu.ru (Postfix) with ESMTP id C1FE044654;
	Tue,  1 Apr 2008 02:03:33 +0400 (MSD)
From:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
To:	linux-mips@linux-mips.org, ralf@linux-mips.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 4/6] [MIPS] make plat_perf_setup() static
Date:	Tue,  1 Apr 2008 02:03:23 +0400
Message-Id: <1207001005-2633-5-git-send-email-dmitri.vorobiev@gmail.com>
X-Mailer: git-send-email 1.5.3.6
In-Reply-To: <1207001005-2633-1-git-send-email-dmitri.vorobiev@gmail.com>
References: <1207001005-2633-1-git-send-email-dmitri.vorobiev@gmail.com>
X-DCC-STREAM-Metrics: smtp02.mtu.ru 10001; Body=0 Fuz1=0 Fuz2=0
Return-Path: <dmitri.vorobiev@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: 18725
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dmitri.vorobiev@gmail.com
Precedence: bulk
X-list: linux-mips

There is no need for the plat_perf_setup() function to be global,
so make it static.

Successfully build-tested using default configs for Malta, Atlas
and SEAD boards.

Runtime test successfully performed by booting the Malta 4Kc board
up to the shell prompt.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
---
 arch/mips/mips-boards/generic/time.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/mips-boards/generic/time.c b/arch/mips/mips-boards/generic/time.c
index b50e0fc..a6eece7 100644
--- a/arch/mips/mips-boards/generic/time.c
+++ b/arch/mips/mips-boards/generic/time.c
@@ -127,7 +127,7 @@ unsigned long read_persistent_clock(void)
 	return mc146818_get_cmos_time();
 }
 
-void __init plat_perf_setup(void)
+static void __init plat_perf_setup(void)
 {
 	cp0_perfcount_irq = -1;
 
-- 
1.5.3


From dmitri.vorobiev@gmail.com Tue Apr  1 00:11:17 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 01 Apr 2008 00:11:30 +0200 (CEST)
Received: from smtp02.mtu.ru ([62.5.255.49]:23511 "EHLO smtp02.mtu.ru")
	by lappi.linux-mips.net with ESMTP id S1100127AbYCaWHu (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 1 Apr 2008 00:07:50 +0200
Received: from smtp02.mtu.ru (localhost [127.0.0.1])
	by smtp02.mtu.ru (Postfix) with ESMTP id B399543AA0;
	Tue,  1 Apr 2008 02:04:08 +0400 (MSD)
Received: from localhost.localdomain (ppp85-140-79-111.pppoe.mtu-net.ru [85.140.79.111])
	by smtp02.mtu.ru (Postfix) with ESMTP id 76B9D45A06;
	Tue,  1 Apr 2008 02:03:17 +0400 (MSD)
From:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
To:	linux-mips@linux-mips.org, ralf@linux-mips.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 0/6] [MIPS] make some functions and variables static
Date:	Tue,  1 Apr 2008 02:03:19 +0400
Message-Id: <1207001005-2633-1-git-send-email-dmitri.vorobiev@gmail.com>
X-Mailer: git-send-email 1.5.3.6
X-DCC-STREAM-Metrics: smtp02.mtu.ru 10001; Body=0 Fuz1=0 Fuz2=0
Return-Path: <dmitri.vorobiev@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: 18726
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dmitri.vorobiev@gmail.com
Precedence: bulk
X-list: linux-mips

Hi Ralf,

I noticed that a few functions and variables in the MIPS-specific
code can become static, and this series of patches cleans up the
kernel global name space a little bit.

Please consider.

Thanks,
Dmitri Vorobiev

From dmitri.vorobiev@gmail.com Tue Apr  1 00:12:18 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 01 Apr 2008 00:12:30 +0200 (CEST)
Received: from smtp02.mtu.ru ([62.5.255.49]:2522 "EHLO smtp02.mtu.ru")
	by lappi.linux-mips.net with ESMTP id S1100136AbYCaWId (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 1 Apr 2008 00:08:33 +0200
Received: from smtp02.mtu.ru (localhost [127.0.0.1])
	by smtp02.mtu.ru (Postfix) with ESMTP id 1086243437;
	Tue,  1 Apr 2008 02:05:55 +0400 (MSD)
Received: from localhost.localdomain (ppp85-140-79-111.pppoe.mtu-net.ru [85.140.79.111])
	by smtp02.mtu.ru (Postfix) with ESMTP id E094441C2E;
	Tue,  1 Apr 2008 02:03:37 +0400 (MSD)
From:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
To:	linux-mips@linux-mips.org, ralf@linux-mips.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 5/6] [MIPS] make standard_io_resources[] static
Date:	Tue,  1 Apr 2008 02:03:24 +0400
Message-Id: <1207001005-2633-6-git-send-email-dmitri.vorobiev@gmail.com>
X-Mailer: git-send-email 1.5.3.6
In-Reply-To: <1207001005-2633-1-git-send-email-dmitri.vorobiev@gmail.com>
References: <1207001005-2633-1-git-send-email-dmitri.vorobiev@gmail.com>
X-DCC-STREAM-Metrics: smtp02.mtu.ru 10001; Body=0 Fuz1=0 Fuz2=0
Return-Path: <dmitri.vorobiev@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: 18727
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dmitri.vorobiev@gmail.com
Precedence: bulk
X-list: linux-mips

The array standard_io_resources[] needs not to be exposed in the kernel
global namespace. This patch makes it static.

Successfully build-tested using default configs for Malta, Atlas
and SEAD boards.

Runtime test successfully performed by booting the Malta 4Kc board
up to the shell prompt.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
---
 arch/mips/mips-boards/malta/malta_setup.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/mips-boards/malta/malta_setup.c b/arch/mips/mips-boards/malta/malta_setup.c
index 2cd8f57..a06e4b5 100644
--- a/arch/mips/mips-boards/malta/malta_setup.c
+++ b/arch/mips/mips-boards/malta/malta_setup.c
@@ -1,7 +1,7 @@
 /*
  * Carsten Langgaard, carstenl@mips.com
  * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
- * Copyright (C) Dmitri Vorobiev
+ * Copyright (C) 2008 Dmitri Vorobiev
  *
  *  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
@@ -36,7 +36,7 @@
 #include <linux/console.h>
 #endif
 
-struct resource standard_io_resources[] = {
+static struct resource standard_io_resources[] = {
 	{
 		.name = "dma1",
 		.start = 0x00,
-- 
1.5.3


From ralf@linux-mips.org Tue Apr  1 00:42:49 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 01 Apr 2008 00:42:53 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:25737 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S1100373AbYCaWmt (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 1 Apr 2008 00:42:49 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m2VMf8db015954
	for <linux-mips@linux-mips.org>; Mon, 31 Mar 2008 15:41:09 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m2VMfhoB028487;
	Mon, 31 Mar 2008 23:41:43 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m2VMfhW2028486;
	Mon, 31 Mar 2008 23:41:43 +0100
Date:	Mon, 31 Mar 2008 23:41:43 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
Cc:	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/6] [MIPS] make some functions and variables static
Message-ID: <20080331224143.GA28473@linux-mips.org>
References: <1207001005-2633-1-git-send-email-dmitri.vorobiev@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1207001005-2633-1-git-send-email-dmitri.vorobiev@gmail.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18728
X-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, Apr 01, 2008 at 02:03:19AM +0400, Dmitri Vorobiev wrote:

> I noticed that a few functions and variables in the MIPS-specific
> code can become static, and this series of patches cleans up the
> kernel global name space a little bit.

I've queued the whole series for 2.6.26.

Thanks,

  Ralf

From kevink@mips.com Tue Apr  1 10:40:21 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 01 Apr 2008 10:40:29 +0200 (CEST)
Received: from mx.mips.com ([63.167.95.198]:58520 "EHLO dns0.mips.com")
	by lappi.linux-mips.net with ESMTP id S1101018AbYDAIkV (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 1 Apr 2008 10:40:21 +0200
Received: from mercury.mips.com (mercury [192.168.64.101])
	by dns0.mips.com (8.12.11/8.12.11) with ESMTP id m318VspA008956
	for <linux-mips@linux-mips.org>; Tue, 1 Apr 2008 00:31:55 -0800 (PST)
Received: from [127.0.0.1] (grendel [192.168.236.16])
	by mercury.mips.com (8.13.5/8.13.5) with ESMTP id m318WlCb002510
	for <linux-mips@linux-mips.org>; Tue, 1 Apr 2008 01:32:48 -0700 (PDT)
Message-ID: <47F1F349.7010503@mips.com>
Date:	Tue, 01 Apr 2008 10:33:13 +0200
From:	"Kevin D. Kissell" <kevink@mips.com>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: max_pfn: Uninitialized, or Deprecated?
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <kevink@mips.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18733
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: kevink@mips.com
Precedence: bulk
X-list: linux-mips
Content-Length: 733
Lines: 18

Once upon a time, the global max_pfn value was set up as part of
bootmem_init(), but this seems to have been dropped in favor of
establishing max_low_pfn, I suppose to be clear that it's the max
non-highmem PFN.  However, the global max_pfn gets used in
the MIPS APRP support code,  and also in places like
block/blk-settings.c.  Is the use of max_pfn supposed to be
deprecated, such that we consider blk-settings.c to be broken
and change arch/mips/kernel/vpe.c to use max_low_pfn, or
ought we assign  max_pfn = max_low_pfn in bootmem_init()?

I'm going to try the later for my own experimental purposes,
but won't propose a patch until I have a better understanding
of why things changed.

          Regards,

          Kevin K.
 

From dmitri.vorobiev@gmail.com Tue Apr  1 10:55:15 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 01 Apr 2008 10:55:20 +0200 (CEST)
Received: from fg-out-1718.google.com ([72.14.220.155]:33682 "EHLO
	fg-out-1718.google.com") by lappi.linux-mips.net with ESMTP
	id S1101071AbYDAIzP (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 1 Apr 2008 10:55:15 +0200
Received: by fg-out-1718.google.com with SMTP id d23so1697050fga.32
        for <linux-mips@linux-mips.org>; Tue, 01 Apr 2008 01:54:55 -0700 (PDT)
DKIM-Signature:	v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=beta;
        h=domainkey-signature:received:received:message-id:date:from:organization:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding;
        bh=/3SZO9gQbpC22nXXyoHj5CmlDcgOZsYarHs7NOyElKo=;
        b=s868a4oQRJv982BPuxsPAwaybsXeQ6EhsfzW/fV7PupxZ9xkh24jTgyee9Q97IBqAlp5xtobhrsUfSwBOYF1L7POb7uymB1SxuzGVHyKNWjO+m/SCkBQXoif4H/mDPYcK7WsZzBHBIeE0jir9UXpfiv0ramiELNhngTMIHEH9lA=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=beta;
        h=message-id:date:from:organization:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding;
        b=P4HIC5hzxlW28h02xOYD4+KsXEQUO+/knykhd+U6n5UcM1CTDOKt4I0e+jZrDKAhLnM/Z/Ke+n0z02RE3a1dDwDRiKew1TeG0l21foeEjdusH6BJvDagcDsglW5NB4RHF93MP1HHkKctBJD4/dRBHCEVdVsrS1KgXbs8KDWe25M=
Received: by 10.86.97.7 with SMTP id u7mr5223454fgb.54.1207040095561;
        Tue, 01 Apr 2008 01:54:55 -0700 (PDT)
Received: from ?192.168.1.3? ( [85.140.79.111])
        by mx.google.com with ESMTPS id e11sm6644026fga.5.2008.04.01.01.54.51
        (version=SSLv3 cipher=RC4-MD5);
        Tue, 01 Apr 2008 01:54:51 -0700 (PDT)
Message-ID: <47F1F859.6020305@gmail.com>
Date:	Tue, 01 Apr 2008 12:54:49 +0400
From:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
Organization: DmVo Home
User-Agent: Thunderbird 1.5.0.14pre (X11/20071022)
MIME-Version: 1.0
To:	Ralf Baechle <ralf@linux-mips.org>
CC:	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/6] [MIPS] make some functions and variables static
References: <1207001005-2633-1-git-send-email-dmitri.vorobiev@gmail.com> <20080331224143.GA28473@linux-mips.org>
In-Reply-To: <20080331224143.GA28473@linux-mips.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Return-Path: <dmitri.vorobiev@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: 18734
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dmitri.vorobiev@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 376
Lines: 19

Ralf Baechle Ð¿Ð¸ÑˆÐµÑ‚:
> On Tue, Apr 01, 2008 at 02:03:19AM +0400, Dmitri Vorobiev wrote:
> 
>> I noticed that a few functions and variables in the MIPS-specific
>> code can become static, and this series of patches cleans up the
>> kernel global name space a little bit.
> 
> I've queued the whole series for 2.6.26.

Thank you, Ralf.

Dmitri

> 
> Thanks,
> 
>   Ralf
> 


From florian.fainelli@telecomint.eu Tue Apr  1 15:49:35 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 01 Apr 2008 15:49:48 +0200 (CEST)
Received: from [157.159.40.25] ([157.159.40.25]:12692 "EHLO mx1.minet.net")
	by lappi.linux-mips.net with ESMTP id S1101510AbYDANtf (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 1 Apr 2008 15:49:35 +0200
Received: from localhost (spam.minet.net [192.168.1.97])
	by mx1.minet.net (Postfix) with ESMTP id 26B7260CFA;
	Tue,  1 Apr 2008 15:49:29 +0200 (CEST)
X-Virus-Scanned: by amavisd-new using ClamAV at minet.net
Received: from smtp.minet.net (imap.minet.net [192.168.1.27])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.minet.net (Postfix) with ESMTP id E758A60CFB;
	Tue,  1 Apr 2008 15:49:14 +0200 (CEST)
Received: from ibook (mla78-1-82-240-17-188.fbx.proxad.net [82.240.17.188])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: florian)
	by smtp.minet.net (Postfix) with ESMTP id 866C215B59;
	Tue,  1 Apr 2008 15:48:33 +0200 (CEST)
From:	Florian Fainelli <florian.fainelli@telecomint.eu>
Date:	Tue, 1 Apr 2008 15:53:25 +0200
Subject: [PATCH] Fix xss1500 compilation
MIME-Version: 1.0
X-UID:	946
X-Length: 1931
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org, Adrian Bunk <bunk@kernel.org>
Content-Disposition: inline
Message-Id: <200804011553.25850.florian.fainelli@telecomint.eu>
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Return-Path: <florian.fainelli@telecomint.eu>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18737
X-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@telecomint.eu
Precedence: bulk
X-list: linux-mips
Content-Length: 1104
Lines: 37

This patch fixes the compilation of the Au1000 XSS1500
board setup and irqmap code.

Signed-off-by: Florian Fainelli <florian.fainelli@telecomint.eu>
---
diff --git a/arch/mips/au1000/xxs1500/board_setup.c 
b/arch/mips/au1000/xxs1500/board_setup.c
index a9237f4..b2e413e 100644
--- a/arch/mips/au1000/xxs1500/board_setup.c
+++ b/arch/mips/au1000/xxs1500/board_setup.c
@@ -33,11 +33,10 @@
 #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/mach-au1x00/au1000.h>
 
 void board_reset(void)
 {
diff --git a/arch/mips/au1000/xxs1500/irqmap.c 
b/arch/mips/au1000/xxs1500/irqmap.c
index 3893492..a343da1 100644
--- a/arch/mips/au1000/xxs1500/irqmap.c
+++ b/arch/mips/au1000/xxs1500/irqmap.c
@@ -45,7 +45,7 @@
 #include <asm/io.h>
 #include <asm/mipsregs.h>
 #include <asm/system.h>
-#include <asm/au1000.h>
+#include <asm/mach-au1x00/au1000.h>
 
 struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
 	{ AU1500_GPIO_204, INTC_INT_HIGH_LEVEL, 0},

From florian.fainelli@telecomint.eu Tue Apr  1 15:50:22 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 01 Apr 2008 15:50:31 +0200 (CEST)
Received: from [157.159.10.71] ([157.159.10.71]:46010 "EHLO smtp4.int-evry.fr")
	by lappi.linux-mips.net with ESMTP id S1101581AbYDANto convert rfc822-to-8bit
	(ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 1 Apr 2008 15:49:44 +0200
Received: from smtp2.int-evry.fr (smtp2.int-evry.fr [157.159.10.45])
	by smtp4.int-evry.fr (Postfix) with ESMTP id 52348DB0015;
	Tue,  1 Apr 2008 15:48:30 +0200 (CEST)
Received: from smtp-ext.int-evry.fr (smtp-ext.int-evry.fr [157.159.11.17])
	by smtp2.int-evry.fr (Postfix) with ESMTP id 3C7513EDCA1;
	Tue,  1 Apr 2008 15:48:29 +0200 (CEST)
Received: from ibook (mla78-1-82-240-17-188.fbx.proxad.net [82.240.17.188])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp-ext.int-evry.fr (Postfix) with ESMTP id B8ADD9012C;
	Tue,  1 Apr 2008 15:48:28 +0200 (CEST)
From:	Florian Fainelli <florian.fainelli@telecomint.eu>
To:	Adrian Bunk <bunk@kernel.org>
Subject: Re: [2.6 patch] mips: remove MIPS_XXS1500
Date:	Tue, 1 Apr 2008 15:54:02 +0200
User-Agent: KMail/1.9.9
Cc:	ralf@linux-mips.org, linux-mips@linux-mips.org,
	linux-kernel@vger.kernel.org
References: <20080330224025.GF28445@cs181133002.pp.htv.fi>
In-Reply-To: <20080330224025.GF28445@cs181133002.pp.htv.fi>
MIME-Version: 1.0
Content-Disposition: inline
X-UID:	944
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 8BIT
Message-Id: <200804011554.03249.florian.fainelli@telecomint.eu>
X-int-MailScanner-Information: Please contact the ISP for more information
X-int-MailScanner: Found to be clean
X-int-MailScanner-SpamCheck: 
X-int-MailScanner-From:	florian.fainelli@telecomint.eu
Return-Path: <florian.fainelli@telecomint.eu>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18738
X-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@telecomint.eu
Precedence: bulk
X-list: linux-mips
Content-Length: 299
Lines: 8

Hi Adrian,

Le lundi 31 mars 2008, Adrian Bunk a Ã©critÂ :
> MIPS_XXS1500 has several compile problems like e.g. the
> #include <asm/keyboard.h> in arch/mips/au1000/xxs1500/board_setup.c
> having been broken by the removal of this header back in February 2004.

Nack, just emailed you with the fix.

From ralf@linux-mips.org Tue Apr  1 16:43:29 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 01 Apr 2008 16:43:35 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:20415 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S1101666AbYDAOn3 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 1 Apr 2008 16:43:29 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m31Eflj8024742
	for <linux-mips@linux-mips.org>; Tue, 1 Apr 2008 07:41:48 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m31EgLJk013831;
	Tue, 1 Apr 2008 15:42:21 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m31EgKJX013830;
	Tue, 1 Apr 2008 15:42:20 +0100
Date:	Tue, 1 Apr 2008 15:42:20 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Florian Fainelli <florian.fainelli@telecomint.eu>
Cc:	linux-mips@linux-mips.org, Adrian Bunk <bunk@kernel.org>
Subject: Re: [PATCH] Fix xss1500 compilation
Message-ID: <20080401144220.GC12879@linux-mips.org>
References: <200804011553.25850.florian.fainelli@telecomint.eu>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200804011553.25850.florian.fainelli@telecomint.eu>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18740
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 267
Lines: 9

On Tue, Apr 01, 2008 at 03:53:25PM +0200, Florian Fainelli wrote:

> This patch fixes the compilation of the Au1000 XSS1500
> board setup and irqmap code.

I'm okay with the patch this case raises the question how popular if at
all this platform still is ...

  Ralf

From ralf@linux-mips.org Tue Apr  1 17:38:04 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 01 Apr 2008 17:38:10 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:56787 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S1101763AbYDAPiE (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 1 Apr 2008 17:38:04 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m31FaLHB004792
	for <linux-mips@linux-mips.org>; Tue, 1 Apr 2008 08:36:22 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m31Fauwh015720;
	Tue, 1 Apr 2008 16:36:56 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m31FatgQ015719;
	Tue, 1 Apr 2008 16:36:55 +0100
Date:	Tue, 1 Apr 2008 16:36:55 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc:	peter fuerst <post@pfrst.de>, linux-mips@linux-mips.org
Subject: Re: [PATCH] IP28: fix MC GIOPAR setting
Message-ID: <20080401153655.GA15109@linux-mips.org>
References: <Pine.LNX.4.58.0803211535570.423@Indigo2.Peter> <20080321194737.GA8398@alpha.franken.de> <Pine.LNX.4.58.0803212125050.523@Indigo2.Peter> <20080321213233.GA10546@alpha.franken.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080321213233.GA10546@alpha.franken.de>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18742
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 692
Lines: 15

On Fri, Mar 21, 2008 at 10:32:33PM +0100, Thomas Bogendoerfer wrote:

> > Would indeed be most surprising, if this isn't appropriate for any Indigo2-
> > Impact, but don't know for sure.  And can't check, whether it at least doesn't
> > hurt Non-Impact Indigo2.  Of course, being able to avoid '#ifdef' at all would
> > be the prettiest alternative.
> 
> I'll check my IP22 machines, if they are ok with that change. Another
> solution could be to have gio_set_master() similair to pci_set_master().
> That way we only enable master, if it is requested by a driver.

That sounds like a clean solution.  Anyway where are we standing with this?
I assume it's release critical for IP28?

  Ralf

From bunk@kernel.org Tue Apr  1 17:55:42 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 01 Apr 2008 17:55:48 +0200 (CEST)
Received: from smtp4.pp.htv.fi ([213.243.153.38]:47307 "EHLO smtp4.pp.htv.fi")
	by lappi.linux-mips.net with ESMTP id S1101815AbYDAPzm (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 1 Apr 2008 17:55:42 +0200
Received: from cs181133002.pp.htv.fi (cs181133002.pp.htv.fi [82.181.133.2])
	by smtp4.pp.htv.fi (Postfix) with ESMTP id 2E0E65BC007;
	Tue,  1 Apr 2008 18:55:20 +0300 (EEST)
Date:	Tue, 1 Apr 2008 18:55:15 +0300
From:	Adrian Bunk <bunk@kernel.org>
To:	Florian Fainelli <florian.fainelli@telecomint.eu>
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] Fix xss1500 compilation
Message-ID: <20080401155515.GA32269@cs181133002.pp.htv.fi>
References: <200804011553.25850.florian.fainelli@telecomint.eu>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <200804011553.25850.florian.fainelli@telecomint.eu>
User-Agent: Mutt/1.5.17+20080114 (2008-01-14)
Return-Path: <bunk@kernel.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18743
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: bunk@kernel.org
Precedence: bulk
X-list: linux-mips
Content-Length: 1343
Lines: 39

On Tue, Apr 01, 2008 at 03:53:25PM +0200, Florian Fainelli wrote:
> This patch fixes the compilation of the Au1000 XSS1500
> board setup and irqmap code.
>...

Another compile error for this platform is:

<--  snip  -->

...
  CC [M]  drivers/pcmcia/au1000_xxs1500.o
/tmp/linux-2.6.25-rc7/drivers/pcmcia/au1000_xxs1500.c:33:26: error: linux/tqueue.h: No such file or directory
/tmp/linux-2.6.25-rc7/drivers/pcmcia/au1000_xxs1500.c:44:28: error: pcmcia/bus_ops.h: No such file or directory
/tmp/linux-2.6.25-rc7/drivers/pcmcia/au1000_xxs1500.c:51:24: error: asm/au1000.h: No such file or directory
/tmp/linux-2.6.25-rc7/drivers/pcmcia/au1000_xxs1500.c:52:31: error: asm/au1000_pcmcia.h: No such file or directory
...
make[3]: *** [drivers/pcmcia/au1000_xxs1500.o] Error 1

<--  snip  -->

include/linux/tqueue.h was removed on Sep 30, 2002 (sic) which was even 
before 2.6.0 .

Obviously no 2.6 kernel ever ran on these boards.

If you have such a board and want to run kernel 2.6 on it that's fine 
with me, but otherwise i don't see much point in keeping the support 
for this board.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


From markus.gothe@27m.se Tue Apr  1 18:50:57 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 01 Apr 2008 18:51:05 +0200 (CEST)
Received: from mail.lysator.liu.se ([130.236.254.3]:16606 "EHLO
	mail.lysator.liu.se") by lappi.linux-mips.net with ESMTP
	id S1102006AbYDAQur (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 1 Apr 2008 18:50:47 +0200
Received: from localhost (localhost.localdomain [127.0.0.1])
	by mail.lysator.liu.se (Postfix) with ESMTP id EF000200A233;
	Tue,  1 Apr 2008 18:50:05 +0200 (CEST)
Received: from mail.lysator.liu.se ([127.0.0.1])
	by localhost (lenin.lysator.liu.se [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id 06583-01-97; Tue, 1 Apr 2008 18:50:05 +0200 (CEST)
Received: from [192.168.27.166] (152-186-96-87.cust.blixtvik.se [87.96.186.152])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.lysator.liu.se (Postfix) with ESMTP id 67DC1200A231;
	Tue,  1 Apr 2008 18:50:05 +0200 (CEST)
Message-ID: <47F267BA.8050807@27m.se>
Date:	Tue, 01 Apr 2008 18:50:02 +0200
From:	Markus Gothe <markus.gothe@27m.se>
User-Agent: Thunderbird 2.0.0.12 (X11/20080227)
MIME-Version: 1.0
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	peter fuerst <post@pfrst.de>, linux-mips@linux-mips.org
Subject: Re: [PATCH] IP28: fix MC GIOPAR setting
References: <Pine.LNX.4.58.0803211535570.423@Indigo2.Peter> <20080321194737.GA8398@alpha.franken.de> <Pine.LNX.4.58.0803212125050.523@Indigo2.Peter> <20080321213233.GA10546@alpha.franken.de> <20080401153655.GA15109@linux-mips.org>
In-Reply-To: <20080401153655.GA15109@linux-mips.org>
X-Enigmail-Version: 0.95.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at lysator.liu.se
Return-Path: <markus.gothe@27m.se>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18746
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: markus.gothe@27m.se
Precedence: bulk
X-list: linux-mips
Content-Length: 1415
Lines: 50

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Thanks to O'Reilly in Germany, I've got an I^2, non-impact... I'll set
up an test enviroment for mips-linux there,
when I've got the time.

//Markus

Ralf Baechle wrote:
> On Fri, Mar 21, 2008 at 10:32:33PM +0100, Thomas Bogendoerfer
> wrote:
>
>>> Would indeed be most surprising, if this isn't appropriate for
>>> any Indigo2- Impact, but don't know for sure.  And can't check,
>>> whether it at least doesn't hurt Non-Impact Indigo2.  Of
>>> course, being able to avoid '#ifdef' at all would be the
>>> prettiest alternative.
>> I'll check my IP22 machines, if they are ok with that change.
>> Another solution could be to have gio_set_master() similair to
>> pci_set_master(). That way we only enable master, if it is
>> requested by a driver.
>
> That sounds like a clean solution.  Anyway where are we standing
> with this? I assume it's release critical for IP28?
>
> Ralf
>


- --
_______________________________________

Mr Markus Gothe
Software Engineer

Phone: +46 (0)13 21 81 20 (ext. 1046)
Fax: +46 (0)13 21 21 15
Mobile: +46 (0)70 348 44 35
Diskettgatan 11, SE-583 35 LinkÃ¶ping, Sweden
www.27m.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH8me16I0XmJx2NrwRCG5JAJ9vCHZhAVXD9GGwtVC8RBgaTun+rQCePUnE
uDmjdB3ii0qRasWST4pqaJc=
=LCvE
-----END PGP SIGNATURE-----


From sshtylyov@ru.mvista.com Tue Apr  1 19:13:18 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 01 Apr 2008 19:13:26 +0200 (CEST)
Received: from [63.81.120.155] ([63.81.120.155]:31811 "EHLO imap.sh.mvista.com")
	by lappi.linux-mips.net with ESMTP id S1102049AbYDARNS (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 1 Apr 2008 19:13:18 +0200
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id 309B13ECA; Tue,  1 Apr 2008 09:17:21 -0700 (PDT)
Message-ID: <47F25FE7.5000406@ru.mvista.com>
Date:	Tue, 01 Apr 2008 20:16:39 +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:	Adrian Bunk <bunk@kernel.org>
Cc:	Florian Fainelli <florian.fainelli@telecomint.eu>,
	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] Fix xss1500 compilation
References: <200804011553.25850.florian.fainelli@telecomint.eu> <20080401155515.GA32269@cs181133002.pp.htv.fi>
In-Reply-To: <20080401155515.GA32269@cs181133002.pp.htv.fi>
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: 18748
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1081
Lines: 30

Adrian Bunk wrote:

>>This patch fixes the compilation of the Au1000 XSS1500
>>board setup and irqmap code.
>>...

> Another compile error for this platform is:
> 
> <--  snip  -->

> ...
>   CC [M]  drivers/pcmcia/au1000_xxs1500.o
> /tmp/linux-2.6.25-rc7/drivers/pcmcia/au1000_xxs1500.c:33:26: error: linux/tqueue.h: No such file or directory
> /tmp/linux-2.6.25-rc7/drivers/pcmcia/au1000_xxs1500.c:44:28: error: pcmcia/bus_ops.h: No such file or directory
> /tmp/linux-2.6.25-rc7/drivers/pcmcia/au1000_xxs1500.c:51:24: error: asm/au1000.h: No such file or directory
> /tmp/linux-2.6.25-rc7/drivers/pcmcia/au1000_xxs1500.c:52:31: error: asm/au1000_pcmcia.h: No such file or directory
> ...
> make[3]: *** [drivers/pcmcia/au1000_xxs1500.o] Error 1

> <--  snip  -->

> include/linux/tqueue.h was removed on Sep 30, 2002 (sic) which was even 
> before 2.6.0 .

> Obviously no 2.6 kernel ever ran on these boards.

    Not true -- there have been 2.6 patches from MyCable, the board vendor.
According to them, the last version supported version (on request) was 2.6.22.

WBR, Sergei

From bunk@kernel.org Tue Apr  1 19:15:27 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 01 Apr 2008 19:15:36 +0200 (CEST)
Received: from smtp4.pp.htv.fi ([213.243.153.38]:24800 "EHLO smtp4.pp.htv.fi")
	by lappi.linux-mips.net with ESMTP id S1102060AbYDARP1 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 1 Apr 2008 19:15:27 +0200
Received: from cs181133002.pp.htv.fi (cs181133002.pp.htv.fi [82.181.133.2])
	by smtp4.pp.htv.fi (Postfix) with ESMTP id 4969C5BC08F;
	Tue,  1 Apr 2008 19:38:34 +0300 (EEST)
Date:	Tue, 1 Apr 2008 19:38:29 +0300
From:	Adrian Bunk <bunk@kernel.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	Florian Fainelli <florian.fainelli@telecomint.eu>,
	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] Fix xss1500 compilation
Message-ID: <20080401163829.GB32269@cs181133002.pp.htv.fi>
References: <200804011553.25850.florian.fainelli@telecomint.eu> <20080401155515.GA32269@cs181133002.pp.htv.fi> <47F25FE7.5000406@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <47F25FE7.5000406@ru.mvista.com>
User-Agent: Mutt/1.5.17+20080114 (2008-01-14)
Return-Path: <bunk@kernel.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18749
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: bunk@kernel.org
Precedence: bulk
X-list: linux-mips
Content-Length: 2110
Lines: 60

On Tue, Apr 01, 2008 at 08:16:39PM +0400, Sergei Shtylyov wrote:
> Adrian Bunk wrote:
>
>>> This patch fixes the compilation of the Au1000 XSS1500
>>> board setup and irqmap code.
>>> ...
>
>> Another compile error for this platform is:
>>
>> <--  snip  -->
>
>> ...
>>   CC [M]  drivers/pcmcia/au1000_xxs1500.o
>> /tmp/linux-2.6.25-rc7/drivers/pcmcia/au1000_xxs1500.c:33:26: error: linux/tqueue.h: No such file or directory
>> /tmp/linux-2.6.25-rc7/drivers/pcmcia/au1000_xxs1500.c:44:28: error: pcmcia/bus_ops.h: No such file or directory
>> /tmp/linux-2.6.25-rc7/drivers/pcmcia/au1000_xxs1500.c:51:24: error: asm/au1000.h: No such file or directory
>> /tmp/linux-2.6.25-rc7/drivers/pcmcia/au1000_xxs1500.c:52:31: error: asm/au1000_pcmcia.h: No such file or directory
>> ...
>> make[3]: *** [drivers/pcmcia/au1000_xxs1500.o] Error 1
>
>> <--  snip  -->
>
>> include/linux/tqueue.h was removed on Sep 30, 2002 (sic) which was even 
>> before 2.6.0 .
>
>> Obviously no 2.6 kernel ever ran on these boards.
>
>    Not true -- there have been 2.6 patches from MyCable, the board vendor.

When I talk about a "2.6 kernel" I'm talking about what is on
ftp.kernel.org, not what is hidden in some vendor patches.

> According to them, the last version supported version (on request) was 2.6.22.

Why is it not being submitted, and how much does it actually have in 
common with the code currently in the kernel?

After all, e.g. the pcmcia driver was added in 2003 with the
#include <linux/tqueue.h> and a "Copyright 2003 MontaVista Software Inc.".

And 2003 is one year *after* include/linux/tqueue.h was removed.

If MyCable submits their patches for 2.6.22 (adapted to 2.6.25 if 
required) that would be great.

But otherwise there's simply no point in trying to fix the compilation 
of this kernel 2.4 code that was dumped into kernel 2.6.

> WBR, Sergei

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


From dmitri.vorobiev@gmail.com Wed Apr  2 01:59:18 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Apr 2008 01:59:24 +0200 (CEST)
Received: from smtp03.mtu.ru ([62.5.255.50]:45818 "EHLO smtp03.mtu.ru")
	by lappi.linux-mips.net with ESMTP id S1103045AbYDAX7S (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 2 Apr 2008 01:59:18 +0200
Received: from smtp03.mtu.ru (localhost.mtu.ru [127.0.0.1])
	by smtp03.mtu.ru (Postfix) with ESMTP id CD3751870750;
	Wed,  2 Apr 2008 03:58:46 +0400 (MSD)
Received: from localhost.localdomain (ppp91-76-28-42.pppoe.mtu-net.ru [91.76.28.42])
	by smtp03.mtu.ru (Postfix) with ESMTP id B30B2187084B;
	Wed,  2 Apr 2008 03:58:38 +0400 (MSD)
From:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
To:	linux-mips@linux-mips.org, ralf@linux-mips.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 0/5] [MIPS] unexport a few symbols in MIPS-specific code
Date:	Wed,  2 Apr 2008 03:58:33 +0400
Message-Id: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com>
X-Mailer: git-send-email 1.5.3.6
X-DCC-STREAM-Metrics: smtp03.mtu.ru 10002; Body=0 Fuz1=0 Fuz2=0
Return-Path: <dmitri.vorobiev@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: 18754
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dmitri.vorobiev@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 655
Lines: 19

Hi Ralf,

A few exported symbols in MIPS-specific code can be unexported,
and this series of patches does so.

This series was tested using a custom config that was produced
by running `make allmodconfig', after which the CONFIG_VORTEX
option was manually turned off. The patches I am submitting do
not touch the code affected by this option, however. Setting
this options on leads to unbuildable kernel independently of
whether the patches are applied.

Additionally, the entire patchset was tested at runtime by
booting the Malta 4Kc board up to the shell prompt and
inserting the `oprofile.ko' kernel module. The tests were
successful.

Thanks,
Dmitri

From dmitri.vorobiev@gmail.com Wed Apr  2 01:59:59 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Apr 2008 02:00:06 +0200 (CEST)
Received: from smtp03.mtu.ru ([62.5.255.50]:46074 "EHLO smtp03.mtu.ru")
	by lappi.linux-mips.net with ESMTP id S1103046AbYDAX7S (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 2 Apr 2008 01:59:18 +0200
Received: from smtp03.mtu.ru (localhost.mtu.ru [127.0.0.1])
	by smtp03.mtu.ru (Postfix) with ESMTP id F21891870854;
	Wed,  2 Apr 2008 03:58:46 +0400 (MSD)
Received: from localhost.localdomain (ppp91-76-28-42.pppoe.mtu-net.ru [91.76.28.42])
	by smtp03.mtu.ru (Postfix) with ESMTP id D53751870752;
	Wed,  2 Apr 2008 03:58:46 +0400 (MSD)
From:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
To:	linux-mips@linux-mips.org, ralf@linux-mips.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/5] [MIPS] unexport copy_user_highpage()
Date:	Wed,  2 Apr 2008 03:58:34 +0400
Message-Id: <1207094318-21748-2-git-send-email-dmitri.vorobiev@gmail.com>
X-Mailer: git-send-email 1.5.3.6
In-Reply-To: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com>
References: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com>
X-DCC-STREAM-Metrics: smtp03.mtu.ru 10002; Body=0 Fuz1=0 Fuz2=0
Return-Path: <dmitri.vorobiev@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: 18755
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dmitri.vorobiev@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 745
Lines: 25

The copy_user_highpage() routine has no users outside of the
core kernel code, so exporting this symbol is pointless.
This patch removes EXPORT_SYMBOL(copy_user_highpage).

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
---
 arch/mips/mm/init.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index c7aed13..71e5962 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -229,8 +229,6 @@ void copy_user_highpage(struct page *to, struct page *from,
 	smp_wmb();
 }
 
-EXPORT_SYMBOL(copy_user_highpage);
-
 void copy_to_user_page(struct vm_area_struct *vma,
 	struct page *page, unsigned long vaddr, void *dst, const void *src,
 	unsigned long len)
-- 
1.5.3


From dmitri.vorobiev@gmail.com Wed Apr  2 02:01:04 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Apr 2008 02:01:13 +0200 (CEST)
Received: from smtp03.mtu.ru ([62.5.255.50]:46330 "EHLO smtp03.mtu.ru")
	by lappi.linux-mips.net with ESMTP id S1103054AbYDAX7T (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 2 Apr 2008 01:59:19 +0200
Received: from smtp03.mtu.ru (localhost.mtu.ru [127.0.0.1])
	by smtp03.mtu.ru (Postfix) with ESMTP id 2138B1870876;
	Wed,  2 Apr 2008 03:58:47 +0400 (MSD)
Received: from localhost.localdomain (ppp91-76-28-42.pppoe.mtu-net.ru [91.76.28.42])
	by smtp03.mtu.ru (Postfix) with ESMTP id 0601E1870868;
	Wed,  2 Apr 2008 03:58:47 +0400 (MSD)
From:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
To:	linux-mips@linux-mips.org, ralf@linux-mips.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/5] [MIPS] unexport copy_to_user_page()
Date:	Wed,  2 Apr 2008 03:58:35 +0400
Message-Id: <1207094318-21748-3-git-send-email-dmitri.vorobiev@gmail.com>
X-Mailer: git-send-email 1.5.3.6
In-Reply-To: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com>
References: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com>
X-DCC-STREAM-Metrics: smtp03.mtu.ru 10002; Body=0 Fuz1=0 Fuz2=0
Return-Path: <dmitri.vorobiev@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: 18756
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dmitri.vorobiev@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 772
Lines: 25

The copy_to_user_page() function is called only in the core kernel
code. Therefore, there is no need to export it. This patch removes
EXPORT_SYMBOL(copy_to_user_page).

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
---
 arch/mips/mm/init.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 71e5962..6b9d54b 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -247,8 +247,6 @@ void copy_to_user_page(struct vm_area_struct *vma,
 		flush_cache_page(vma, vaddr, page_to_pfn(page));
 }
 
-EXPORT_SYMBOL(copy_to_user_page);
-
 void copy_from_user_page(struct vm_area_struct *vma,
 	struct page *page, unsigned long vaddr, void *dst, const void *src,
 	unsigned long len)
-- 
1.5.3


From dmitri.vorobiev@gmail.com Wed Apr  2 02:02:03 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Apr 2008 02:02:11 +0200 (CEST)
Received: from smtp03.mtu.ru ([62.5.255.50]:48634 "EHLO smtp03.mtu.ru")
	by lappi.linux-mips.net with ESMTP id S1103055AbYDAX7T (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 2 Apr 2008 01:59:19 +0200
Received: from smtp03.mtu.ru (localhost.mtu.ru [127.0.0.1])
	by smtp03.mtu.ru (Postfix) with ESMTP id 6B21D18708A7;
	Wed,  2 Apr 2008 03:58:47 +0400 (MSD)
Received: from localhost.localdomain (ppp91-76-28-42.pppoe.mtu-net.ru [91.76.28.42])
	by smtp03.mtu.ru (Postfix) with ESMTP id 4E8531870894;
	Wed,  2 Apr 2008 03:58:47 +0400 (MSD)
From:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
To:	linux-mips@linux-mips.org, ralf@linux-mips.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 4/5] [MIPS] unexport rtc_mips_set_time()
Date:	Wed,  2 Apr 2008 03:58:37 +0400
Message-Id: <1207094318-21748-5-git-send-email-dmitri.vorobiev@gmail.com>
X-Mailer: git-send-email 1.5.3.6
In-Reply-To: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com>
References: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com>
X-DCC-STREAM-Metrics: smtp03.mtu.ru 10002; Body=0 Fuz1=0 Fuz2=0
Return-Path: <dmitri.vorobiev@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: 18757
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dmitri.vorobiev@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 657
Lines: 24

No users for the rtc_mips_set_time() routine exist outside of the
core kernel code. Therefore, EXPORT_SYMBOL(rtc_mips_set_time) is
useless, and this patch removes it.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
---
 arch/mips/kernel/time.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
index b45a709..d70ce5c 100644
--- a/arch/mips/kernel/time.c
+++ b/arch/mips/kernel/time.c
@@ -38,7 +38,6 @@ int __weak rtc_mips_set_time(unsigned long sec)
 {
 	return 0;
 }
-EXPORT_SYMBOL(rtc_mips_set_time);
 
 int __weak rtc_mips_set_mmss(unsigned long nowtime)
 {
-- 
1.5.3


From dmitri.vorobiev@gmail.com Wed Apr  2 02:02:56 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Apr 2008 02:03:04 +0200 (CEST)
Received: from smtp03.mtu.ru ([62.5.255.50]:48378 "EHLO smtp03.mtu.ru")
	by lappi.linux-mips.net with ESMTP id S1103053AbYDAX7T (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 2 Apr 2008 01:59:19 +0200
Received: from smtp03.mtu.ru (localhost.mtu.ru [127.0.0.1])
	by smtp03.mtu.ru (Postfix) with ESMTP id 463E31870882;
	Wed,  2 Apr 2008 03:58:47 +0400 (MSD)
Received: from localhost.localdomain (ppp91-76-28-42.pppoe.mtu-net.ru [91.76.28.42])
	by smtp03.mtu.ru (Postfix) with ESMTP id 2A72B1870878;
	Wed,  2 Apr 2008 03:58:47 +0400 (MSD)
From:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
To:	linux-mips@linux-mips.org, ralf@linux-mips.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/5] [MIPS] unexport copy_from_user_page()
Date:	Wed,  2 Apr 2008 03:58:36 +0400
Message-Id: <1207094318-21748-4-git-send-email-dmitri.vorobiev@gmail.com>
X-Mailer: git-send-email 1.5.3.6
In-Reply-To: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com>
References: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com>
X-DCC-STREAM-Metrics: smtp03.mtu.ru 10002; Body=0 Fuz1=0 Fuz2=0
Return-Path: <dmitri.vorobiev@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: 18758
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dmitri.vorobiev@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 657
Lines: 26

No users for the copy_from_user_page() routine exist outside of the
core kernel code. Therefore, EXPORT_SYMBOL(copy_from_user_page) is
useless, and this patch removes it.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
---
 arch/mips/mm/init.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 6b9d54b..ff61184 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -263,9 +263,6 @@ void copy_from_user_page(struct vm_area_struct *vma,
 	}
 }
 
-EXPORT_SYMBOL(copy_from_user_page);
-
-
 #ifdef CONFIG_HIGHMEM
 unsigned long highstart_pfn, highend_pfn;
 
-- 
1.5.3


From dmitri.vorobiev@gmail.com Wed Apr  2 02:04:00 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Apr 2008 02:04:08 +0200 (CEST)
Received: from smtp03.mtu.ru ([62.5.255.50]:25083 "EHLO smtp03.mtu.ru")
	by lappi.linux-mips.net with ESMTP id S1103057AbYDAX7t (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 2 Apr 2008 01:59:49 +0200
Received: from smtp03.mtu.ru (localhost.mtu.ru [127.0.0.1])
	by smtp03.mtu.ru (Postfix) with ESMTP id 9688218708B3;
	Wed,  2 Apr 2008 03:58:47 +0400 (MSD)
Received: from localhost.localdomain (ppp91-76-28-42.pppoe.mtu-net.ru [91.76.28.42])
	by smtp03.mtu.ru (Postfix) with ESMTP id 72F0718708AC;
	Wed,  2 Apr 2008 03:58:47 +0400 (MSD)
From:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
To:	linux-mips@linux-mips.org, ralf@linux-mips.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 5/5] [MIPS] unexport null_perf_irq() and make it static
Date:	Wed,  2 Apr 2008 03:58:38 +0400
Message-Id: <1207094318-21748-6-git-send-email-dmitri.vorobiev@gmail.com>
X-Mailer: git-send-email 1.5.3.6
In-Reply-To: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com>
References: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com>
X-DCC-STREAM-Metrics: smtp03.mtu.ru 10002; Body=0 Fuz1=0 Fuz2=0
Return-Path: <dmitri.vorobiev@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: 18759
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dmitri.vorobiev@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 2005
Lines: 74

This patch unexports the null_perf_irq() symbol, and simultaneously
makes this function static.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
---
 arch/mips/kernel/time.c              |    4 +---
 arch/mips/oprofile/op_impl.h         |    1 -
 arch/mips/oprofile/op_model_mipsxx.c |    5 ++++-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
index d70ce5c..1f467d5 100644
--- a/arch/mips/kernel/time.c
+++ b/arch/mips/kernel/time.c
@@ -49,13 +49,11 @@ int update_persistent_clock(struct timespec now)
 	return rtc_mips_set_mmss(now.tv_sec);
 }
 
-int null_perf_irq(void)
+static int null_perf_irq(void)
 {
 	return 0;
 }
 
-EXPORT_SYMBOL(null_perf_irq);
-
 int (*perf_irq)(void) = null_perf_irq;
 
 EXPORT_SYMBOL(perf_irq);
diff --git a/arch/mips/oprofile/op_impl.h b/arch/mips/oprofile/op_impl.h
index fa6b4aa..2bfc17c 100644
--- a/arch/mips/oprofile/op_impl.h
+++ b/arch/mips/oprofile/op_impl.h
@@ -10,7 +10,6 @@
 #ifndef OP_IMPL_H
 #define OP_IMPL_H 1
 
-extern int null_perf_irq(void);
 extern int (*perf_irq)(void);
 
 /* Per-counter configuration as set via oprofilefs.  */
diff --git a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c
index ccbea22..12e840f 100644
--- a/arch/mips/oprofile/op_model_mipsxx.c
+++ b/arch/mips/oprofile/op_model_mipsxx.c
@@ -31,6 +31,8 @@
 
 #define M_COUNTER_OVERFLOW		(1UL      << 31)
 
+int (*save_perf_irq)(void);
+
 #ifdef CONFIG_MIPS_MT_SMP
 #define WHAT		(M_TC_EN_VPE | M_PERFCTL_VPEID(smp_processor_id()))
 #define vpe_id()	smp_processor_id()
@@ -355,6 +357,7 @@ static int __init mipsxx_init(void)
 		return -ENODEV;
 	}
 
+	save_perf_irq = perf_irq;
 	perf_irq = mipsxx_perfcount_handler;
 
 	return 0;
@@ -367,7 +370,7 @@ static void mipsxx_exit(void)
 	counters = counters_per_cpu_to_total(counters);
 	reset_counters(counters);
 
-	perf_irq = null_perf_irq;
+	perf_irq = save_perf_irq;
 }
 
 struct op_mips_model op_model_mipsxx_ops = {
-- 
1.5.3


From geert@linux-m68k.org Wed Apr  2 09:17:07 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Apr 2008 09:17:13 +0200 (CEST)
Received: from edna.telenet-ops.be ([195.130.132.58]:60600 "EHLO
	edna.telenet-ops.be") by lappi.linux-mips.net with ESMTP
	id S1102566AbYDBHRG (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 2 Apr 2008 09:17:06 +0200
Received: from localhost (localhost.localdomain [127.0.0.1])
	by edna.telenet-ops.be (Postfix) with SMTP id 6AAFDE400A;
	Wed,  2 Apr 2008 09:16:55 +0200 (CEST)
Received: from anakin.of.borg (d54C15D55.access.telenet.be [84.193.93.85])
	by edna.telenet-ops.be (Postfix) with ESMTP id 3A2BDE405B;
	Wed,  2 Apr 2008 09:16:55 +0200 (CEST)
Received: from anakin.of.borg (localhost [127.0.0.1])
	by anakin.of.borg (8.14.2/8.14.2/Debian-3) with ESMTP id m327GsXj011687
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Wed, 2 Apr 2008 09:16:54 +0200
Received: from localhost (geert@localhost)
	by anakin.of.borg (8.14.2/8.14.2/Submit) with ESMTP id m327GrpJ011684;
	Wed, 2 Apr 2008 09:16:54 +0200
X-Authentication-Warning: anakin.of.borg: geert owned process doing -bs
Date:	Wed, 2 Apr 2008 09:16:52 +0200 (CEST)
From:	Geert Uytterhoeven <geert@linux-m68k.org>
To:	"Kevin D. Kissell" <kevink@mips.com>
cc:	Linux/MIPS Development <linux-mips@linux-mips.org>,
	Linux Kernel Development <linux-kernel@vger.kernel.org>,
	linux-arch@vger.kernel.org
Subject: Re: max_pfn: Uninitialized, or Deprecated?
In-Reply-To: <47F1F349.7010503@mips.com>
Message-ID: <Pine.LNX.4.64.0804020910290.14383@anakin>
References: <47F1F349.7010503@mips.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Return-Path: <geert@linux-m68k.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: 18762
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: geert@linux-m68k.org
Precedence: bulk
X-list: linux-mips
Content-Length: 1163
Lines: 27

On Tue, 1 Apr 2008, Kevin D. Kissell wrote:
> Once upon a time, the global max_pfn value was set up as part of
> bootmem_init(), but this seems to have been dropped in favor of
> establishing max_low_pfn, I suppose to be clear that it's the max
> non-highmem PFN.  However, the global max_pfn gets used in
> the MIPS APRP support code,  and also in places like
> block/blk-settings.c.  Is the use of max_pfn supposed to be
> deprecated, such that we consider blk-settings.c to be broken
> and change arch/mips/kernel/vpe.c to use max_low_pfn, or
> ought we assign  max_pfn = max_low_pfn in bootmem_init()?

I noticed this too when investigating why initrds no longer worked on
m68k (Fix in http://lkml.org/lkml/2007/12/23/36, still not in mainline).

Apparently a value of max_pfn = 0 is OK, as several architectures
(including MIPS and m68k) don't touch it?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

From kevink@mips.com Wed Apr  2 10:04:49 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Apr 2008 10:04:53 +0200 (CEST)
Received: from dns0.mips.com ([63.167.95.198]:40874 "EHLO dns0.mips.com")
	by lappi.linux-mips.net with ESMTP id S262190AbYDBIEt (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 2 Apr 2008 10:04:49 +0200
Received: from mercury.mips.com (mercury [192.168.64.101])
	by dns0.mips.com (8.12.11/8.12.11) with ESMTP id m327uClT013206;
	Tue, 1 Apr 2008 23:56:13 -0800 (PST)
Received: from [127.0.0.1] (grendel [192.168.236.16])
	by mercury.mips.com (8.13.5/8.13.5) with ESMTP id m327v4hu009559;
	Wed, 2 Apr 2008 00:57:05 -0700 (PDT)
Message-ID: <47F33C6B.9050704@mips.com>
Date:	Wed, 02 Apr 2008 09:57:31 +0200
From:	"Kevin D. Kissell" <kevink@mips.com>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
To:	Geert Uytterhoeven <geert@linux-m68k.org>
CC:	Linux/MIPS Development <linux-mips@linux-mips.org>,
	Linux Kernel Development <linux-kernel@vger.kernel.org>,
	linux-arch@vger.kernel.org
Subject: Re: max_pfn: Uninitialized, or Deprecated?
References: <47F1F349.7010503@mips.com> <Pine.LNX.4.64.0804020910290.14383@anakin>
In-Reply-To: <Pine.LNX.4.64.0804020910290.14383@anakin>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <kevink@mips.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18763
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: kevink@mips.com
Precedence: bulk
X-list: linux-mips
Content-Length: 2004
Lines: 48

The patch you point to will maybe solve some initrd problems,
but I think it's treating a symptom rather than the cause.  There
is other code, both generic and MIPS-specific (the APRP stuff),
that assumes that max_pfn is meaningful.  Either we have to hunt
down and kill those instances (not really hard, but requiring several
maintainers working in concert) or we see to it that MIPS provides
a usable value.  A value of 0 causes the system to treat the beginning
of kseg0 as "out of band" memory, which may work some of the time
for MIPSxxR2 processors, where the cacheable execption vector
base is set up to be beyond the kernel image, but for older processors
where the vectors are at the beginning of kseg0...

          Regards,

          Kevin K.

Geert Uytterhoeven wrote:
> On Tue, 1 Apr 2008, Kevin D. Kissell wrote:
>   
>> Once upon a time, the global max_pfn value was set up as part of
>> bootmem_init(), but this seems to have been dropped in favor of
>> establishing max_low_pfn, I suppose to be clear that it's the max
>> non-highmem PFN.  However, the global max_pfn gets used in
>> the MIPS APRP support code,  and also in places like
>> block/blk-settings.c.  Is the use of max_pfn supposed to be
>> deprecated, such that we consider blk-settings.c to be broken
>> and change arch/mips/kernel/vpe.c to use max_low_pfn, or
>> ought we assign  max_pfn = max_low_pfn in bootmem_init()?
>>     
>
> I noticed this too when investigating why initrds no longer worked on
> m68k (Fix in http://lkml.org/lkml/2007/12/23/36, still not in mainline).
>
> Apparently a value of max_pfn = 0 is OK, as several architectures
> (including MIPS and m68k) don't touch it?
>
> Gr{oetje,eeting}s,
>
> 						Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> 							    -- Linus Torvalds
>
>   

From florian.fainelli@telecomint.eu Wed Apr  2 12:16:42 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Apr 2008 12:16:46 +0200 (CEST)
Received: from mx1.minet.net ([157.159.40.25]:57556 "EHLO mx1.minet.net")
	by lappi.linux-mips.net with ESMTP id S524468AbYDBKQg (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 2 Apr 2008 12:16:36 +0200
Received: from localhost (spam.minet.net [192.168.1.97])
	by mx1.minet.net (Postfix) with ESMTP id F2D1E5CD71;
	Wed,  2 Apr 2008 12:17:06 +0200 (CEST)
X-Virus-Scanned: by amavisd-new using ClamAV at minet.net
Received: from smtp.minet.net (imap.minet.net [192.168.1.27])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.minet.net (Postfix) with ESMTP id D5A1D5CD70;
	Wed,  2 Apr 2008 12:16:57 +0200 (CEST)
Received: from ibook (mla78-1-82-240-17-188.fbx.proxad.net [82.240.17.188])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: florian)
	by smtp.minet.net (Postfix) with ESMTP id A77F814A7A;
	Wed,  2 Apr 2008 12:16:26 +0200 (CEST)
From:	Florian Fainelli <florian.fainelli@telecomint.eu>
Date:	Wed, 2 Apr 2008 12:21:18 +0200
Subject: [PATCH] Fix Alchemy xss1500 and pb1x00 PCMCIA drivers
MIME-Version: 1.0
X-UID:	949
X-Length: 15920
To:	linux-pcmcia@lists.infradead.org
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org,
	Adrian Bunk <bunk@kernel.org>
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804021221.19377.florian.fainelli@telecomint.eu>
Return-Path: <florian.fainelli@telecomint.eu>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18766
X-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@telecomint.eu
Precedence: bulk
X-list: linux-mips
Content-Length: 14506
Lines: 554

This patch fixes compilation of the Alchemy XSS1500
and PB1x00 PCMCIA drivers. Clean up code while we are
at it.

Signed-off-by: Florian Fainelli <florian.fainelli@telecomint.eu>
---
diff --git a/drivers/pcmcia/au1000_pb1x00.c b/drivers/pcmcia/au1000_pb1x00.c
index 86c0808..9bc9739 100644
--- a/drivers/pcmcia/au1000_pb1x00.c
+++ b/drivers/pcmcia/au1000_pb1x00.c
@@ -22,48 +22,41 @@
  *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  */
 #include <linux/module.h>
-#include <linux/init.h>
-#include <linux/delay.h>
-#include <linux/ioport.h>
 #include <linux/kernel.h>
-#include <linux/tqueue.h>
-#include <linux/timer.h>
-#include <linux/mm.h>
-#include <linux/proc_fs.h>
-#include <linux/types.h>
-
-#include <pcmcia/cs_types.h>
-#include <pcmcia/cs.h>
-#include <pcmcia/ss.h>
-#include <pcmcia/bulkmem.h>
-#include <pcmcia/cistpl.h>
-#include <pcmcia/bus_ops.h>
-#include "cs_internal.h"
-
-#include <asm/io.h>
+#include <linux/errno.h>
+#include <linux/interrupt.h>
+#include <linux/device.h>
+#include <linux/init.h>
+
 #include <asm/irq.h>
-#include <asm/system.h>
+#include <asm/signal.h>
+#include <asm/mach-au1x00/au1000.h>
 
-#include <asm/au1000.h>
-#include <asm/au1000_pcmcia.h>
-
-#define debug(fmt, arg...) do { } while (0)
+#include "au1000_generic.h"
 
 #ifdef CONFIG_MIPS_PB1000
-#include <asm/pb1000.h>
+#include <asm/mach-pb1x00/pb1000.h>
 #define PCMCIA_IRQ AU1000_GPIO_15
 #elif defined (CONFIG_MIPS_PB1500)
-#include <asm/pb1500.h>
+#include <asm/mach-pb1x00/pb1500.h>
 #define PCMCIA_IRQ AU1500_GPIO_203
 #elif defined (CONFIG_MIPS_PB1100)
-#include <asm/pb1100.h>
+#include <asm/mach-pb1x00/pb1100.h>
 #define PCMCIA_IRQ AU1000_GPIO_11
 #endif
 
-static int pb1x00_pcmcia_init(struct pcmcia_init *init)
+#define debug(fmt, arg...) do { } while (0)
+
+struct au1000_pcmcia_socket au1000_pcmcia_socket[PCMCIA_NUM_SOCKS];
+extern int au1x00_pcmcia_socket_probe(struct device *, struct pcmcia_low_level *, int, int);
+
+static int pb1x00_pcmcia_init(struct au1000_pcmcia_socket *skt)
 {
-#ifdef CONFIG_MIPS_PB1000
 	u16 pcr;
+
+        skt->irq = PCMCIA_IRQ;
+
+#ifdef CONFIG_MIPS_PB1000
 	pcr = PCR_SLOT_0_RST | PCR_SLOT_1_RST;
 
 	au_writel(0x8000, PB1000_MDR); /* clear pcmcia interrupt */
@@ -79,17 +72,16 @@ static int pb1x00_pcmcia_init(struct pcmcia_init *init)
 	return PCMCIA_NUM_SOCKS;
 
 #else /* fixme -- take care of the Pb1500 at some point */
-
-	u16 pcr;
 	pcr = au_readw(PCMCIA_BOARD_REG) & ~0xf; /* turn off power */
 	pcr &= ~(PC_DEASSERT_RST | PC_DRV_EN);
 	au_writew(pcr, PCMCIA_BOARD_REG);
 	au_sync_delay(500);
+	
 	return PCMCIA_NUM_SOCKS;
 #endif
 }
 
-static int pb1x00_pcmcia_shutdown(void)
+static int pb1x00_pcmcia_shutdown(struct au1000_pcmcia_socket *skt)
 {
 #ifdef CONFIG_MIPS_PB1000
 	u16 pcr;
@@ -109,11 +101,12 @@ static int pb1x00_pcmcia_shutdown(void)
 #endif
 }
 
-static int 
-pb1x00_pcmcia_socket_state(unsigned sock, struct pcmcia_state *state)
+static int pb1x00_pcmcia_socket_state(struct au1000_pcmcia_socket *skt, struct pcmcia_state *state)
 {
 	u32 inserted0, inserted1;
 	u16 vs0, vs1;
+	
+	vs1 = 0;
 
 #ifdef CONFIG_MIPS_PB1000
 	vs0 = vs1 = (u16)au_readl(PB1000_ACR1);
@@ -136,7 +129,7 @@ pb1x00_pcmcia_socket_state(unsigned sock, struct pcmcia_state *state)
 	state->vs_3v = 0;
 	state->detect = 0;
 
-	if (sock == 0) {
+	if (skt->nr == 0) {
 		if (inserted0) {
 			switch (vs0) {
 				case 0:
@@ -179,37 +172,23 @@ pb1x00_pcmcia_socket_state(unsigned sock, struct pcmcia_state *state)
 
 	state->bvd1=1;
 	state->bvd2=1;
-	state->wrprot=0; 
-	return 1;
-}
-
-
-static int pb1x00_pcmcia_get_irq_info(struct pcmcia_irq_info *info)
-{
-
-	if(info->sock > PCMCIA_MAX_SOCK) return -1;
+	state->wrprot=0;
 
-	/*
-	 * Even in the case of the Pb1000, both sockets are connected
-	 * to the same irq line.
-	 */
-	info->irq = PCMCIA_IRQ;
-
-	return 0;
+	return 1;
 }
 
 
-static int 
-pb1x00_pcmcia_configure_socket(const struct pcmcia_configure *configure)
+static int pb1x00_pcmcia_configure_socket(struct au1000_pcmcia_socket *skt, struct socket_state_t *state)
 {
 	u16 pcr;
 
-	if(configure->sock > PCMCIA_MAX_SOCK) return -1;
+	if (skt->nr > PCMCIA_MAX_SOCK)
+		return -1;
 
 #ifdef CONFIG_MIPS_PB1000
 	pcr = au_readl(PB1000_PCR);
 
-	if (configure->sock == 0) {
+	if (skt->nr == 0) {
 		pcr &= ~(PCR_SLOT_0_VCC0 | PCR_SLOT_0_VCC1 | 
 				PCR_SLOT_0_VPP0 | PCR_SLOT_0_VPP1);
 	}
@@ -220,107 +199,107 @@ pb1x00_pcmcia_configure_socket(const struct pcmcia_configure *configure)
 
 	pcr &= ~PCR_SLOT_0_RST;
 	debug("Vcc %dV Vpp %dV, pcr %x\n", 
-			configure->vcc, configure->vpp, pcr);
-	switch(configure->vcc){
+			state->Vcc, state->Vpp, pcr);
+	switch(state->Vcc){
 		case 0:  /* Vcc 0 */
-			switch(configure->vpp) {
+			switch(state->Vpp) {
 				case 0:
 					pcr |= SET_VCC_VPP(VCC_HIZ,VPP_GND,
-							configure->sock);
+							skt->nr);
 					break;
 				case 12:
 					pcr |= SET_VCC_VPP(VCC_HIZ,VPP_12V,
-							configure->sock);
+							skt->nr);
 					break;
 				case 50:
 					pcr |= SET_VCC_VPP(VCC_HIZ,VPP_5V,
-							configure->sock);
+							skt->nr);
 					break;
 				case 33:
 					pcr |= SET_VCC_VPP(VCC_HIZ,VPP_3V,
-							configure->sock);
+							skt->nr);
 					break;
 				default:
 					pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ,
-							configure->sock);
+							skt->nr);
 					printk("%s: bad Vcc/Vpp (%d:%d)\n", 
 							__FUNCTION__, 
-							configure->vcc, 
-							configure->vpp);
+							state->Vcc, 
+							state->Vpp);
 					break;
 			}
 			break;
 		case 50: /* Vcc 5V */
-			switch(configure->vpp) {
+			switch(state->Vpp) {
 				case 0:
 					pcr |= SET_VCC_VPP(VCC_5V,VPP_GND,
-							configure->sock);
+							stk->nr);
 					break;
 				case 50:
 					pcr |= SET_VCC_VPP(VCC_5V,VPP_5V,
-							configure->sock);
+							skt->nr);
 					break;
 				case 12:
 					pcr |= SET_VCC_VPP(VCC_5V,VPP_12V,
-							configure->sock);
+							skt->nr);
 					break;
 				case 33:
 					pcr |= SET_VCC_VPP(VCC_5V,VPP_3V,
-							configure->sock);
+							skt->nr);
 					break;
 				default:
 					pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ,
-							configure->sock);
+							skt->nr);
 					printk("%s: bad Vcc/Vpp (%d:%d)\n", 
 							__FUNCTION__, 
-							configure->vcc, 
-							configure->vpp);
+							state->Vcc, 
+							state->Vpp);
 					break;
 			}
 			break;
 		case 33: /* Vcc 3.3V */
-			switch(configure->vpp) {
+			switch(state->Vpp) {
 				case 0:
 					pcr |= SET_VCC_VPP(VCC_3V,VPP_GND,
-							configure->sock);
+							skt->nr);
 					break;
 				case 50:
 					pcr |= SET_VCC_VPP(VCC_3V,VPP_5V,
-							configure->sock);
+							skt->nr);
 					break;
 				case 12:
 					pcr |= SET_VCC_VPP(VCC_3V,VPP_12V,
-							configure->sock);
+							skt->nr);
 					break;
 				case 33:
 					pcr |= SET_VCC_VPP(VCC_3V,VPP_3V,
-							configure->sock);
+							skt->nr);
 					break;
 				default:
 					pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ,
-							configure->sock);
+							skt->nr);
 					printk("%s: bad Vcc/Vpp (%d:%d)\n", 
 							__FUNCTION__, 
-							configure->vcc, 
-							configure->vpp);
+							state->Vcc, 
+							state->Vpp);
 					break;
 			}
 			break;
 		default: /* what's this ? */
-			pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ,configure->sock);
+			pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ,skt->nr);
 			printk(KERN_ERR "%s: bad Vcc %d\n", 
-					__FUNCTION__, configure->vcc);
+					__FUNCTION__, state->Vcc);
 			break;
 	}
 
-	if (configure->sock == 0) {
+	if (skt->nr == 0) {
 	pcr &= ~(PCR_SLOT_0_RST);
-		if (configure->reset)
-		pcr |= PCR_SLOT_0_RST;
+		if (state->flags & SS_REET)
+			pcr |= PCR_SLOT_0_RST;
 	}
 	else {
 		pcr &= ~(PCR_SLOT_1_RST);
-		if (configure->reset)
+		if (state->flags & SS_RESET)
 			pcr |= PCR_SLOT_1_RST;
 	}
 	au_writel(pcr, PB1000_PCR);
@@ -331,15 +310,15 @@ pb1x00_pcmcia_configure_socket(const struct pcmcia_configure *configure)
 	pcr = au_readw(PCMCIA_BOARD_REG) & ~0xf;
 
 	debug("Vcc %dV Vpp %dV, pcr %x, reset %d\n", 
-			configure->vcc, configure->vpp, pcr, configure->reset);
+			state->Vcc, state->Vpp, pcr, state->flags & SS_RESET);
 
 
-	switch(configure->vcc){
+	switch(state->Vcc){
 		case 0:  /* Vcc 0 */
 			pcr |= SET_VCC_VPP(0,0);
 			break;
 		case 50: /* Vcc 5V */
-			switch(configure->vpp) {
+			switch(state->Vpp) {
 				case 0:
 					pcr |= SET_VCC_VPP(2,0);
 					break;
@@ -354,13 +333,13 @@ pb1x00_pcmcia_configure_socket(const struct pcmcia_configure *configure)
 					pcr |= SET_VCC_VPP(0,0);
 					printk("%s: bad Vcc/Vpp (%d:%d)\n", 
 							__FUNCTION__, 
-							configure->vcc, 
-							configure->vpp);
+							state->Vcc, 
+							state->Vpp);
 					break;
 			}
 			break;
 		case 33: /* Vcc 3.3V */
-			switch(configure->vpp) {
+			switch(state->Vpp) {
 				case 0:
 					pcr |= SET_VCC_VPP(1,0);
 					break;
@@ -375,22 +354,22 @@ pb1x00_pcmcia_configure_socket(const struct pcmcia_configure *configure)
 					pcr |= SET_VCC_VPP(0,0);
 					printk("%s: bad Vcc/Vpp (%d:%d)\n", 
 							__FUNCTION__, 
-							configure->vcc, 
-							configure->vpp);
+							state->Vcc, 
+							state->Vpp);
 					break;
 			}
 			break;
 		default: /* what's this ? */
 			pcr |= SET_VCC_VPP(0,0);
 			printk(KERN_ERR "%s: bad Vcc %d\n", 
-					__FUNCTION__, configure->vcc);
+					__FUNCTION__, state->Vcc);
 			break;
 	}
 
 	au_writew(pcr, PCMCIA_BOARD_REG);
 	au_sync_delay(300);
 
-	if (!configure->reset) {
+	if (!(state->flags & SS_RESET)) {
 		pcr |= PC_DRV_EN;
 		au_writew(pcr, PCMCIA_BOARD_REG);
 		au_sync_delay(100);
@@ -408,10 +387,16 @@ pb1x00_pcmcia_configure_socket(const struct pcmcia_configure *configure)
 }
 
 
-struct pcmcia_low_level pb1x00_pcmcia_ops = { 
-	pb1x00_pcmcia_init,
-	pb1x00_pcmcia_shutdown,
-	pb1x00_pcmcia_socket_state,
-	pb1x00_pcmcia_get_irq_info,
-	pb1x00_pcmcia_configure_socket
+static struct pcmcia_low_level pb1x00_pcmcia_ops = {
+	.owner			= THIS_MODULE,
+	
+	.hw_init		= pb1x00_pcmcia_init,
+	.hw_shutdown		= pb1x00_pcmcia_shutdown,
+	.socket_state		= pb1x00_pcmcia_socket_state,
+	.configure_socket 	= pb1x00_pcmcia_configure_socket
 };
+
+int au1x_board_init(struct device *dev)
+{
+        return au1x00_pcmcia_socket_probe(dev, &pb1x00_pcmcia_ops, 0, PCMCIA_MAX_SOCK);
+}
diff --git a/drivers/pcmcia/au1000_xxs1500.c b/drivers/pcmcia/au1000_xxs1500.c
index ce9d5c4..1ca0e3b 100644
--- a/drivers/pcmcia/au1000_xxs1500.c
+++ b/drivers/pcmcia/au1000_xxs1500.c
@@ -26,47 +26,37 @@
  *
  */
 #include <linux/module.h>
-#include <linux/init.h>
-#include <linux/delay.h>
-#include <linux/ioport.h>
 #include <linux/kernel.h>
-#include <linux/tqueue.h>
-#include <linux/timer.h>
-#include <linux/mm.h>
-#include <linux/proc_fs.h>
-#include <linux/types.h>
-
-#include <pcmcia/cs_types.h>
-#include <pcmcia/cs.h>
-#include <pcmcia/ss.h>
-#include <pcmcia/bulkmem.h>
-#include <pcmcia/cistpl.h>
-#include <pcmcia/bus_ops.h>
-#include "cs_internal.h"
-
-#include <asm/io.h>
+#include <linux/errno.h>
+#include <linux/interrupt.h>
+#include <linux/device.h>
+#include <linux/init.h>
+
 #include <asm/irq.h>
-#include <asm/system.h>
+#include <asm/signal.h>
+#include <asm/mach-au1x00/au1000.h>
 
-#include <asm/au1000.h>
-#include <asm/au1000_pcmcia.h>
+#include "au1000_generic.h"
 
 #define PCMCIA_MAX_SOCK		0
 #define PCMCIA_NUM_SOCKS	(PCMCIA_MAX_SOCK + 1)
-#define PCMCIA_IRQ		AU1000_GPIO_4
 
-#if 0
-#define DEBUG(x,args...)	printk(__FUNCTION__ ": " x,##args)
-#else
 #define DEBUG(x,args...)
-#endif
 
-static int xxs1500_pcmcia_init(struct pcmcia_init *init)
+struct au1000_pcmcia_socket au1000_pcmcia_socket[PCMCIA_NUM_SOCKS];
+extern int au1x00_pcmcia_socket_probe(struct device *, struct pcmcia_low_level *, int, int);
+
+static int xxs1500_pcmcia_init(struct au1000_pcmcia_socket *skt)
 {
+	if (skt->nr > PCMCIA_MAX_SOCK)
+		return -1;
+
+	skt->irq = AU1000_GPIO_4;
+
 	return PCMCIA_NUM_SOCKS;
 }
 
-static int xxs1500_pcmcia_shutdown(void)
+static int xxs1500_pcmcia_shutdown(struct au1000_pcmcia_socket *skt)
 {
 	/* turn off power */
 	au_writel(au_readl(GPIO2_PINSTATE) | (1<<14)|(1<<30),
@@ -82,12 +72,13 @@ static int xxs1500_pcmcia_shutdown(void)
 
 
 static int
-xxs1500_pcmcia_socket_state(unsigned sock, struct pcmcia_state *state)
+xxs1500_pcmcia_socket_state(struct au1000_pcmcia_socket *skt, struct pcmcia_state *state)
 {
 	u32 inserted; u32 vs;
 	unsigned long gpio, gpio2;
 
-	if(sock > PCMCIA_MAX_SOCK) return -1;
+	if(skt->nr > PCMCIA_MAX_SOCK)
+		return -1;
 
 	gpio = au_readl(SYS_PINSTATERD);
 	gpio2 = au_readl(GPIO2_PINSTATE);
@@ -110,9 +101,9 @@ xxs1500_pcmcia_socket_state(unsigned sock, struct pcmcia_state *state)
 			case 3: /* 5V */
 			default:
 				/* return without setting 'detect' */
-				printk(KERN_ERR "au1x00_cs: unsupported VS\n",
+				printk(KERN_ERR "au1x00_cs: unsupported VS 0x%08x\n",
 						vs);
-				return;
+				return -1;
 		}
 		state->detect = 1;
 	}
@@ -128,25 +119,16 @@ xxs1500_pcmcia_socket_state(unsigned sock, struct pcmcia_state *state)
 }
 
 
-static int xxs1500_pcmcia_get_irq_info(struct pcmcia_irq_info *info)
-{
-
-	if(info->sock > PCMCIA_MAX_SOCK) return -1;
-	info->irq = PCMCIA_IRQ;
-	return 0;
-}
-
-
 static int
-xxs1500_pcmcia_configure_socket(const struct pcmcia_configure *configure)
+xxs1500_pcmcia_configure_socket(struct au1000_pcmcia_socket *skt, struct socket_state_t *state)
 {
-
-	if(configure->sock > PCMCIA_MAX_SOCK) return -1;
+	if(skt->nr > PCMCIA_MAX_SOCK)
+		return -1;
 
 	DEBUG("Vcc %dV Vpp %dV, reset %d\n",
-			configure->vcc, configure->vpp, configure->reset);
+			state->Vcc, state->vpp, state->flags & SS_RESET);
 
-	switch(configure->vcc){
+	switch(state->Vcc){
 		case 33: /* Vcc 3.3V */
 			/* turn on power */
 			DEBUG("turn on power\n");
@@ -165,7 +147,7 @@ xxs1500_pcmcia_configure_socket(const struct pcmcia_configure *configure)
 			break;
 	}
 
-	if (!configure->reset) {
+	if (!(state->flags & SS_RESET)) {
 		DEBUG("deassert reset\n");
 		au_writel((au_readl(GPIO2_PINSTATE) & ~(1<<4))|(1<<20),
 				GPIO2_OUTPUT);
@@ -183,9 +165,16 @@ xxs1500_pcmcia_configure_socket(const struct pcmcia_configure *configure)
 }
 
 struct pcmcia_low_level xxs1500_pcmcia_ops = {
-	xxs1500_pcmcia_init,
-	xxs1500_pcmcia_shutdown,
-	xxs1500_pcmcia_socket_state,
-	xxs1500_pcmcia_get_irq_info,
-	xxs1500_pcmcia_configure_socket
+	.owner 			= THIS_MODULE,
+
+	.hw_init 		= xxs1500_pcmcia_init,
+	.hw_shutdown		= xxs1500_pcmcia_shutdown,
+
+	.socket_state		= xxs1500_pcmcia_socket_state,
+	.configure_socket 	= xxs1500_pcmcia_configure_socket
 };
+
+int au1x_board_init(struct device *dev)
+{
+	return au1x00_pcmcia_socket_probe(dev, &xxs1500_pcmcia_ops, 0, PCMCIA_MAX_SOCK);
+}

From anemo@mba.ocn.ne.jp Wed Apr  2 14:38:53 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Apr 2008 14:38:56 +0200 (CEST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:41196 "EHLO smtp.mba.ocn.ne.jp")
	by lappi.linux-mips.net with ESMTP id S525078AbYDBMiw (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 2 Apr 2008 14:38:52 +0200
Received: from localhost (p8208-ipad209funabasi.chiba.ocn.ne.jp [58.88.119.208])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 5E7419FD3; Wed,  2 Apr 2008 21:37:31 +0900 (JST)
Date:	Wed, 02 Apr 2008 21:38:17 +0900 (JST)
Message-Id: <20080402.213817.74752727.anemo@mba.ocn.ne.jp>
To:	dmitri.vorobiev@gmail.com
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/5] [MIPS] unexport null_perf_irq() and make it static
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <1207094318-21748-6-git-send-email-dmitri.vorobiev@gmail.com>
References: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com>
	<1207094318-21748-6-git-send-email-dmitri.vorobiev@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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18768
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 365
Lines: 13

On Wed,  2 Apr 2008 03:58:38 +0400, Dmitri Vorobiev <dmitri.vorobiev@gmail.com> wrote:
> --- a/arch/mips/oprofile/op_model_mipsxx.c
> +++ b/arch/mips/oprofile/op_model_mipsxx.c
> @@ -31,6 +31,8 @@
>  
>  #define M_COUNTER_OVERFLOW		(1UL      << 31)
>  
> +int (*save_perf_irq)(void);

This should be another target of "make it static" patch :-)

---
Atsushi Nemoto

From dmitri.vorobiev@gmail.com Wed Apr  2 14:46:11 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Apr 2008 14:46:18 +0200 (CEST)
Received: from fk-out-0910.google.com ([209.85.128.185]:10878 "EHLO
	fk-out-0910.google.com") by lappi.linux-mips.net with ESMTP
	id S525111AbYDBMqJ (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 2 Apr 2008 14:46:09 +0200
Received: by fk-out-0910.google.com with SMTP id f40so7147275fka.0
        for <linux-mips@linux-mips.org>; Wed, 02 Apr 2008 05:45:46 -0700 (PDT)
DKIM-Signature:	v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=beta;
        h=domainkey-signature:received:received:message-id:date:from:organization:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding;
        bh=vE8PlF/QgpsKhdQ3nQGmQHoGnLSxOlr5STkGRUz8CN8=;
        b=MEZ2vy6R/Pm6cz+qqs+QTLxSU2GdpkZqsPVNzAHWRAsaUwXPZ+WCHFRRoOYrQO8Jfhlf6edyE7tMHkVbu3ql0xSR5zNFfDsrylEQnXwFfbNiHVqme03TKABauIbstGYGpZxBJmokD1USNyytxsht8JVGl3uQ9tWkTXcUcphoSTU=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=beta;
        h=message-id:date:from:organization:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding;
        b=Y3MLfMZKqsjeRrDRpnzFHGHfPxvjDhg6x+aFJYiAR3ZnM+VxFgFq05XEWE4kjVYTtXz/j2+p+qbr6F1lnkTpPYdm9Qha+eo1ttlSPftkZb7bog+jaPDdwUV7pk48AHLER1kmTQdH5BPugIIoIPwJNG+h6ojUGUQcOKH+/HKH8V4=
Received: by 10.82.121.15 with SMTP id t15mr23655567buc.8.1207140346512;
        Wed, 02 Apr 2008 05:45:46 -0700 (PDT)
Received: from ?192.168.1.3? ( [91.76.28.42])
        by mx.google.com with ESMTPS id u14sm2117561gvf.1.2008.04.02.05.45.44
        (version=SSLv3 cipher=RC4-MD5);
        Wed, 02 Apr 2008 05:45:45 -0700 (PDT)
Message-ID: <47F37FF6.50206@gmail.com>
Date:	Wed, 02 Apr 2008 16:45:42 +0400
From:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
Organization: DmVo Home
User-Agent: Thunderbird 1.5.0.14pre (X11/20071022)
MIME-Version: 1.0
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
CC:	linux-mips@linux-mips.org, ralf@linux-mips.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/5] [MIPS] unexport null_perf_irq() and make it static
References: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com>	<1207094318-21748-6-git-send-email-dmitri.vorobiev@gmail.com> <20080402.213817.74752727.anemo@mba.ocn.ne.jp>
In-Reply-To: <20080402.213817.74752727.anemo@mba.ocn.ne.jp>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Return-Path: <dmitri.vorobiev@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: 18769
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dmitri.vorobiev@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 709
Lines: 24

Atsushi Nemoto Ð¿Ð¸ÑˆÐµÑ‚:
> On Wed,  2 Apr 2008 03:58:38 +0400, Dmitri Vorobiev <dmitri.vorobiev@gmail.com> wrote:
>> --- a/arch/mips/oprofile/op_model_mipsxx.c
>> +++ b/arch/mips/oprofile/op_model_mipsxx.c
>> @@ -31,6 +31,8 @@
>>  
>>  #define M_COUNTER_OVERFLOW		(1UL      << 31)
>>  
>> +int (*save_perf_irq)(void);
> 
> This should be another target of "make it static" patch :-)

Indeed. Thank you for noticing that.

> 
> ---
> Atsushi Nemoto
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


From technoboy85@gmail.com Wed Apr  2 14:57:12 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Apr 2008 14:57:18 +0200 (CEST)
Received: from smtp-out26.alice.it ([85.33.2.26]:61965 "EHLO
	smtp-out26.alice.it") by lappi.linux-mips.net with ESMTP
	id S525081AbYDBM5M (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 2 Apr 2008 14:57:12 +0200
Received: from FBCMMO02.fbc.local ([192.168.68.196]) by smtp-out26.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 2 Apr 2008 14:56:46 +0200
Received: from FBCMCL01B01.fbc.local ([192.168.69.82]) by FBCMMO02.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 2 Apr 2008 14:56:45 +0200
Received: from [192.168.1.3] ([87.7.112.40]) by FBCMCL01B01.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 2 Apr 2008 14:56:44 +0200
From:	Matteo Croce <technoboy85@gmail.com>
To:	Florian Lohoff <flo@rfc822.org>
Subject: Re: [PATCH][MIPS][3/6]: AR7: VLYNQ bus
Date:	Wed, 2 Apr 2008 14:56:44 +0200
User-Agent: KMail/1.9.9
Cc:	linux-mips@linux-mips.org, Eugene Konev <ejka@imfi.kspu.ru>,
	Andrew Morton <akpm@linux-foundation.org>
References: <200803120221.25044.technoboy85@gmail.com> <200803120226.42795.technoboy85@gmail.com> <20080329095914.GA18263@paradigm.rfc822.org>
In-Reply-To: <20080329095914.GA18263@paradigm.rfc822.org>
X-Face:	0AUq?,0sKh2O65+R5#[nTCS'~}"m)9|g3Tsi=g7A9q69S+=M!BY)=?utf-8?q?Zdmwo2u!i=5CUylx=26=27D+=0A=09=5B7u=26z1=27s=7E=5B=3F+=24=27w?=
 =?utf-8?q?O6+?="'WWcr5Jy,]}8namg8NP:9<E,o^21xGB~/HRhB(u^@
 =?utf-8?q?ZB=2EXLP0swe=0A=09r9M=7EL?=<b1=^'4cv*_N1tNJ$`9Ot*KL/;8oXFdrT@r|-Ki2wCQI"R(X(
 =?utf-8?q?73r=3A=3BmnNPoA2a=5D=7EZ=0A=092n2sUh?=,B|bt;ys*hv.QR>a]{m
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804021456.44472.technoboy85@gmail.com>
X-OriginalArrivalTime: 02 Apr 2008 12:56:44.0934 (UTC) FILETIME=[012C5260:01C894C1]
Return-Path: <technoboy85@gmail.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18770
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: technoboy85@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 25064
Lines: 943

Il Saturday 29 March 2008 10:59:14 Florian Lohoff ha scritto:
> 
> Hi Matteo,
> 
> On Wed, Mar 12, 2008 at 02:26:42AM +0100, Matteo Croce wrote:
> > +	switch (dev->divisor) {
> > +	case vlynq_div_auto:
> > +		/* Only try locally supplied clock, others cause problems */
> 
> i have a platform (AR7VWi - Leonardo Board) which has an external
> supplied clock from an ACX111 so the div_auto autoprobing will not work.
> 
> I put the vlynq_div_external code in front of this which should
> simply listen on the vlynq if there is a clock and use it. This solved
> one of the issues for me. Can you elaborate on the above comment where
> caused problems? I have seen multiple implementations of this, all of
> them did autoprobing first by listening on the remote clock first.
> 
> > +		vlynq_reg_write(dev->remote->control, 0);
> > +		for (i = vlynq_ldiv2; i <= vlynq_ldiv8; i++) {
> > +			vlynq_reg_write(dev->local->control,
> > +					VLYNQ_CTRL_CLOCK_INT |
> > +					VLYNQ_CTRL_CLOCK_DIV(i - vlynq_ldiv1));
> > +			if (vlynq_linked(dev)) {
> > +				printk(KERN_DEBUG
> > +				       "%s: using local clock divisor %d\n",
> > +				       dev->dev.bus_id, i - vlynq_ldiv1 + 1);
> > +				dev->divisor = i;
> > +				return 0;
> > +			}
> > +		}
> 

Il Saturday 29 March 2008 10:59:14 hai scritto:
> 
> Hi Matteo,
> 
> On Wed, Mar 12, 2008 at 02:26:42AM +0100, Matteo Croce wrote:
> > +	switch (dev->divisor) {
> > +	case vlynq_div_auto:
> > +		/* Only try locally supplied clock, others cause problems */
> 
> i have a platform (AR7VWi - Leonardo Board) which has an external
> supplied clock from an ACX111 so the div_auto autoprobing will not work.
> 
> I put the vlynq_div_external code in front of this which should
> simply listen on the vlynq if there is a clock and use it. This solved
> one of the issues for me. Can you elaborate on the above comment where
> caused problems? I have seen multiple implementations of this, all of
> them did autoprobing first by listening on the remote clock first.
> 
> > +		vlynq_reg_write(dev->remote->control, 0);
> > +		for (i = vlynq_ldiv2; i <= vlynq_ldiv8; i++) {
> > +			vlynq_reg_write(dev->local->control,
> > +					VLYNQ_CTRL_CLOCK_INT |
> > +					VLYNQ_CTRL_CLOCK_DIV(i - vlynq_ldiv1));
> > +			if (vlynq_linked(dev)) {
> > +				printk(KERN_DEBUG
> > +				       "%s: using local clock divisor %d\n",
> > +				       dev->dev.bus_id, i - vlynq_ldiv1 + 1);
> > +				dev->divisor = i;
> > +				return 0;
> > +			}
> > +		}

Works fine for my AR7 which has an interlan clock.

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

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


From technoboy85@gmail.com Wed Apr  2 15:57:41 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Apr 2008 15:57:47 +0200 (CEST)
Received: from smtp-out113.alice.it ([85.37.17.113]:24591 "EHLO
	smtp-out113.alice.it") by lappi.linux-mips.net with ESMTP
	id S525206AbYDBN5k (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 2 Apr 2008 15:57:40 +0200
Received: from FBCMMO02.fbc.local ([192.168.68.196]) by smtp-out113.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 2 Apr 2008 15:57:17 +0200
Received: from FBCMCL01B02.fbc.local ([192.168.69.83]) by FBCMMO02.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 2 Apr 2008 15:57:17 +0200
Received: from [192.168.1.3] ([87.7.112.40]) by FBCMCL01B02.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 2 Apr 2008 15:57:14 +0200
From:	Matteo Croce <technoboy85@gmail.com>
To:	Florian Lohoff <flo@rfc822.org>
Subject: Re: [PATCH][MIPS][3/6]: AR7: VLYNQ bus
Date:	Wed, 2 Apr 2008 15:57:08 +0200
User-Agent: KMail/1.9.9
Cc:	linux-mips@linux-mips.org, Eugene Konev <ejka@imfi.kspu.ru>,
	Andrew Morton <akpm@linux-foundation.org>
References: <200803120221.25044.technoboy85@gmail.com> <200803120226.42795.technoboy85@gmail.com> <20080329095914.GA18263@paradigm.rfc822.org>
In-Reply-To: <20080329095914.GA18263@paradigm.rfc822.org>
X-Face:	0AUq?,0sKh2O65+R5#[nTCS'~}"m)9|g3Tsi=g7A9q69S+=M!BY)=?utf-8?q?Zdmwo2u!i=5CUylx=26=27D+=0A=09=5B7u=26z1=27s=7E=5B=3F+=24=27w?=
 =?utf-8?q?O6+?="'WWcr5Jy,]}8namg8NP:9<E,o^21xGB~/HRhB(u^@
 =?utf-8?q?ZB=2EXLP0swe=0A=09r9M=7EL?=<b1=^'4cv*_N1tNJ$`9Ot*KL/;8oXFdrT@r|-Ki2wCQI"R(X(
 =?utf-8?q?73r=3A=3BmnNPoA2a=5D=7EZ=0A=092n2sUh?=,B|bt;ys*hv.QR>a]{m
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804021557.08605.technoboy85@gmail.com>
X-OriginalArrivalTime: 02 Apr 2008 13:57:17.0162 (UTC) FILETIME=[762654A0:01C894C9]
Return-Path: <technoboy85@gmail.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18772
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: technoboy85@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 521
Lines: 15

Il Saturday 29 March 2008 10:59:14 Florian Lohoff ha scritto:
> What i found in the TI code is that FIRST the local->control needs to
> get set before issueing a remote access so shouldnd the 
> 
> 	vlynq_reg_write(dev->remote ... )
> 
> move behind the dev->local ? I mean the logic is to set a local clock
> divisor - try to access something on the remote end and see if the link
> got up ?!?
> 
> Flo


dunno about the order, maybe "vlynq_reg_write(dev->remote->control, 0);"
and other NULL writes works as a reset...

From technoboy85@gmail.com Wed Apr  2 16:59:07 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Apr 2008 16:59:15 +0200 (CEST)
Received: from smtp-out26.alice.it ([85.33.2.26]:33292 "EHLO
	smtp-out26.alice.it") by lappi.linux-mips.net with ESMTP
	id S525282AbYDBO7H (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 2 Apr 2008 16:59:07 +0200
Received: from FBCMMO01.fbc.local ([192.168.68.195]) by smtp-out26.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 2 Apr 2008 16:58:44 +0200
Received: from FBCMCL01B06.fbc.local ([192.168.69.87]) by FBCMMO01.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 2 Apr 2008 16:58:44 +0200
Received: from [192.168.1.3] ([87.7.112.40]) by FBCMCL01B06.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Wed, 2 Apr 2008 16:58:42 +0200
From:	Matteo Croce <technoboy85@gmail.com>
To:	Florian Lohoff <flo@rfc822.org>
Subject: Re: [PATCH][MIPS][3/6]: AR7: VLYNQ bus
Date:	Wed, 2 Apr 2008 16:58:41 +0200
User-Agent: KMail/1.9.9
Cc:	linux-mips@linux-mips.org, Eugene Konev <ejka@openwrt.org>,
	Andrew Morton <akpm@linux-foundation.org>
References: <200803120221.25044.technoboy85@gmail.com> <200803120226.42795.technoboy85@gmail.com> <20080329095914.GA18263@paradigm.rfc822.org>
In-Reply-To: <20080329095914.GA18263@paradigm.rfc822.org>
X-Face:	0AUq?,0sKh2O65+R5#[nTCS'~}"m)9|g3Tsi=g7A9q69S+=M!BY)=?utf-8?q?Zdmwo2u!i=5CUylx=26=27D+=0A=09=5B7u=26z1=27s=7E=5B=3F+=24=27w?=
 =?utf-8?q?O6+?="'WWcr5Jy,]}8namg8NP:9<E,o^21xGB~/HRhB(u^@
 =?utf-8?q?ZB=2EXLP0swe=0A=09r9M=7EL?=<b1=^'4cv*_N1tNJ$`9Ot*KL/;8oXFdrT@r|-Ki2wCQI"R(X(
 =?utf-8?q?73r=3A=3BmnNPoA2a=5D=7EZ=0A=092n2sUh?=,B|bt;ys*hv.QR>a]{m
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804021658.41676.technoboy85@gmail.com>
X-OriginalArrivalTime: 02 Apr 2008 14:58:43.0049 (UTC) FILETIME=[0B1C0D90:01C894D2]
Return-Path: <technoboy85@gmail.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18773
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: technoboy85@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 24219
Lines: 922

Il Saturday 29 March 2008 10:59:14 Florian Lohoff ha scritto:
> 
> Hi Matteo,
> 
> On Wed, Mar 12, 2008 at 02:26:42AM +0100, Matteo Croce wrote:
> > +	switch (dev->divisor) {
> > +	case vlynq_div_auto:
> > +		/* Only try locally supplied clock, others cause problems */
> 
> i have a platform (AR7VWi - Leonardo Board) which has an external
> supplied clock from an ACX111 so the div_auto autoprobing will not work.
> 
> I put the vlynq_div_external code in front of this which should
> simply listen on the vlynq if there is a clock and use it. This solved
> one of the issues for me. Can you elaborate on the above comment where
> caused problems? I have seen multiple implementations of this, all of
> them did autoprobing first by listening on the remote clock first.
> 
> > +		vlynq_reg_write(dev->remote->control, 0);
> > +		for (i = vlynq_ldiv2; i <= vlynq_ldiv8; i++) {
> > +			vlynq_reg_write(dev->local->control,
> > +					VLYNQ_CTRL_CLOCK_INT |
> > +					VLYNQ_CTRL_CLOCK_DIV(i - vlynq_ldiv1));
> > +			if (vlynq_linked(dev)) {
> > +				printk(KERN_DEBUG
> > +				       "%s: using local clock divisor %d\n",
> > +				       dev->dev.bus_id, i - vlynq_ldiv1 + 1);
> > +				dev->divisor = i;
> > +				return 0;
> > +			}
> > +		}
> 
> What i found in the TI code is that FIRST the local->control needs to
> get set before issueing a remote access so shouldnd the 
> 
> 	vlynq_reg_write(dev->remote ... )
> 
> move behind the dev->local ? I mean the logic is to set a local clock
> divisor - try to access something on the remote end and see if the link
> got up ?!?
> 
> Flo

You were right, here is the fixed vlynq driver:

Signed-off-by: Matteo Croce <technoboy85@gmail.com>
Signed-off-by: Eugene Konev <ejka@openwrt.org>

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


From dmitri.vorobiev@gmail.com Wed Apr  2 17:51:37 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Apr 2008 17:51:44 +0200 (CEST)
Received: from smtp03.mtu.ru ([62.5.255.50]:4291 "EHLO smtp03.mtu.ru")
	by lappi.linux-mips.net with ESMTP id S525390AbYDBPvh (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 2 Apr 2008 17:51:37 +0200
Received: from smtp03.mtu.ru (localhost.mtu.ru [127.0.0.1])
	by smtp03.mtu.ru (Postfix) with ESMTP id 74A76187078E;
	Wed,  2 Apr 2008 19:51:06 +0400 (MSD)
Received: from localhost.localdomain (ppp91-76-28-42.pppoe.mtu-net.ru [91.76.28.42])
	by smtp03.mtu.ru (Postfix) with ESMTP id 59765187077A;
	Wed,  2 Apr 2008 19:51:06 +0400 (MSD)
From:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
To:	linux-mips@linux-mips.org, ralf@linux-mips.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 6/5] [MIPS] op_model_mipsxx.c: make the save_perf_irq variable static
Date:	Wed,  2 Apr 2008 19:51:05 +0400
Message-Id: <1207151465-29257-1-git-send-email-dmitri.vorobiev@gmail.com>
X-Mailer: git-send-email 1.5.3.6
In-Reply-To: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com>
References: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com>
X-DCC-STREAM-Metrics: smtp03.mtu.ru 10001; Body=0 Fuz1=0 Fuz2=0
Return-Path: <dmitri.vorobiev@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: 18774
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dmitri.vorobiev@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 873
Lines: 33

The function pointer save_perf_irq introduced by the previous
patch in this series can become static.

Thanks for Atsushi Nemoto for pointing out the possibility.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
---
Hi Ralf,

If you find that the series is worth it, please pick up this
patch too. Thank you.

Dmitri

 arch/mips/oprofile/op_model_mipsxx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c
index 12e840f..0a11727 100644
--- a/arch/mips/oprofile/op_model_mipsxx.c
+++ b/arch/mips/oprofile/op_model_mipsxx.c
@@ -31,7 +31,7 @@
 
 #define M_COUNTER_OVERFLOW		(1UL      << 31)
 
-int (*save_perf_irq)(void);
+static int (*save_perf_irq)(void);
 
 #ifdef CONFIG_MIPS_MT_SMP
 #define WHAT		(M_TC_EN_VPE | M_PERFCTL_VPEID(smp_processor_id()))
-- 
1.5.3


From flo@rfc822.org Wed Apr  2 20:32:03 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Apr 2008 20:32:11 +0200 (CEST)
Received: from hydra.gt.owl.de ([195.71.99.218]:11463 "EHLO hydra.gt.owl.de")
	by lappi.linux-mips.net with ESMTP id S1102616AbYDBScD (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 2 Apr 2008 20:32:03 +0200
Received: by hydra.gt.owl.de (Postfix, from userid 1000)
	id 2BC3832CEB; Wed,  2 Apr 2008 20:31:14 +0200 (CEST)
Date:	Wed, 2 Apr 2008 20:31:14 +0200
From:	Florian Lohoff <flo@rfc822.org>
To:	Matteo Croce <technoboy85@gmail.com>
Cc:	linux-mips@linux-mips.org, Eugene Konev <ejka@imfi.kspu.ru>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH][MIPS][3/6]: AR7: VLYNQ bus
Message-ID: <20080402183114.GA371@paradigm.rfc822.org>
References: <200803120221.25044.technoboy85@gmail.com> <200803120226.42795.technoboy85@gmail.com> <20080329095914.GA18263@paradigm.rfc822.org> <200804021456.44472.technoboy85@gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="ZGiS0Q5IWpPtfppv"
Content-Disposition: inline
In-Reply-To: <200804021456.44472.technoboy85@gmail.com>
Organization: rfc822 - pure communication
X-SpiderMe: mh-200804022026@listme.rfc822.org
User-Agent: Mutt/1.5.13 (2006-08-11)
Return-Path: <flo@rfc822.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18776
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: flo@rfc822.org
Precedence: bulk
X-list: linux-mips
Content-Length: 2117
Lines: 60


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

On Wed, Apr 02, 2008 at 02:56:44PM +0200, Matteo Croce wrote:
>=20
> Works fine for my AR7 which has an interlan clock.
>=20

Its doesnt for me with an external clock - thats what i mean - Auto
probing should first try to listen for an external clock before letting
clocks run against each other. This is the hunk of a patch on top of
yours ...

@@ -371,12 +371,20 @@ static int __vlynq_enable_device(struct=20
=20
        switch (dev->divisor) {
        case vlynq_div_auto:
-               /* Only try locally supplied clock, others cause problems */
+      =20
+               vlynq_reg_write(dev->local->control, 0);
                vlynq_reg_write(dev->remote->control, 0);
+               if (vlynq_linked(dev)) {
+                       printk(KERN_DEBUG "%s: using external clock\n",
+                              dev->dev.bus_id);
+                       return 0;
+               }
+
                for (i =3D vlynq_ldiv2; i <=3D vlynq_ldiv8; i++) {
                        vlynq_reg_write(dev->local->control,
                                        VLYNQ_CTRL_CLOCK_INT |
                                        VLYNQ_CTRL_CLOCK_DIV(i - vlynq_ldiv=
1));
+                       vlynq_reg_write(dev->remote->control, 0);
                        if (vlynq_linked(dev)) {
                                printk(KERN_DEBUG
                                       "%s: using local clock divisor %d\n",

Flo
--=20
Florian Lohoff                  flo@rfc822.org             +49-171-2280134
	Those who would give up a little freedom to get a little=20
          security shall soon have neither - Benjamin Franklin

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

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

iD8DBQFH89DyUaz2rXW+gJcRAmkrAKCHy18gvEz0YZyWRsIKSaapLwPACgCgln1W
ASQxBkyXowNvoXqegMq9VxQ=
=qKwm
-----END PGP SIGNATURE-----

--ZGiS0Q5IWpPtfppv--

From jfraser@broadcom.com Wed Apr  2 21:16:06 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Apr 2008 21:16:12 +0200 (CEST)
Received: from mms1.broadcom.com ([216.31.210.17]:55817 "EHLO
	mms1.broadcom.com") by lappi.linux-mips.net with ESMTP
	id S1102629AbYDBTQG (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 2 Apr 2008 21:16:06 +0200
Received: from [10.11.16.99] by mms1.broadcom.com with ESMTP (Broadcom
 SMTP Relay (Email Firewall v6.3.2)); Wed, 02 Apr 2008 12:14:43 -0700
X-Server-Uuid: 02CED230-5797-4B57-9875-D5D2FEE4708A
Received: by mail-irva-10.broadcom.com (Postfix, from userid 47) id
 8AAA32B1; Wed, 2 Apr 2008 12:14:43 -0700 (PDT)
Received: from mail-irva-8.broadcom.com (mail-irva-8 [10.11.18.52]) by
 mail-irva-10.broadcom.com (Postfix) with ESMTP id 760C02B0; Wed, 2 Apr
 2008 12:14:43 -0700 (PDT)
Received: from mail-irva-12.broadcom.com (mail-irva-12.broadcom.com
 [10.11.16.101]) by mail-irva-8.broadcom.com (MOS 3.7.5a-GA) with ESMTP
 id GSL01811; Wed, 2 Apr 2008 12:14:43 -0700 (PDT)
Received: from [10.28.6.13] (lab-mhtb-013.ne.broadcom.com [10.28.6.13])
 by mail-irva-12.broadcom.com (Postfix) with ESMTP id 2930369CA4; Wed, 2
 Apr 2008 12:14:42 -0700 (PDT)
Subject: Re: [PATCH 2.6.24][MIPS]Work in progress: fix HIGHMEM-enabled
 dcache flushing on 32-bit processor
From:	"Jon Fraser" <jfraser@broadcom.com>
Reply-to: jfraser@broadcom.com
To:	"David VomLehn" <dvomlehn@cisco.com>
cc:	linux-mips@linux-mips.org
In-Reply-To: <47D89211.1020504@cisco.com>
References: <47D89211.1020504@cisco.com>
Organization: Broadcom
Date:	Wed, 02 Apr 2008 15:14:41 -0400
Message-ID: <1207163681.32277.132.camel@chaos.ne.broadcom.com>
MIME-Version: 1.0
X-Mailer: Evolution 2.12.3 (2.12.3-3.fc8)
X-WSS-ID: 6BED04A94RG115300-01-01
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Return-Path: <jfraser@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: 18777
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: jfraser@broadcom.com
Precedence: bulk
X-list: linux-mips
Content-Length: 6571
Lines: 216

Did this fix your NFS problem?

I'm working on discontiguous memory platforms as well.

Jon Fraser
Broadcom
Andover, Mass.



On Wed, 2008-03-12 at 19:31 -0700, David VomLehn wrote:
> This patch is a work in progress, per Ralf's suggestion from last week. It is 
> intended to fix dcache flushing issues when using HIGHMEM support. We get much 
> better results with this patch applied, but I would not characterize our 2.6.24 
> port as stable, yet, so there may be other HIGHMEM-related issues.
> 
> Any comments welcome. Thanks!
> 
> David VomLehn
> 
> diff -urN a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
> --- a/arch/mips/mm/cache.c	2008-01-24 14:58:37.000000000 -0800
> +++ b/arch/mips/mm/cache.c	2008-03-12 19:11:39.000000000 -0700
> @@ -19,6 +19,7 @@
>   #include <asm/processor.h>
>   #include <asm/cpu.h>
>   #include <asm/cpu-features.h>
> +#include <asm/highmem.h>
> 
>   /* Cache operations. */
>   void (*flush_cache_all)(void);
> @@ -70,10 +71,28 @@
>   void __flush_dcache_page(struct page *page)
>   {
>   	struct address_space *mapping = page_mapping(page);
> -	unsigned long addr;
> +	void	* addr;
> 
> +#ifndef CONFIG_HIGHMEM
>   	if (PageHighMem(page))
>   		return;
> +#endif
> +
> +	/* If there is a temporary kernel mapping, i.e. if kmap_atomic was
> +	 * used to map a page, we only need to flush the page. We can skip
> +	 * the other work here because it won't be used in any other way. */
> +	if (PageHighMem(page)) {
> +		addr = kmap_atomic_to_vaddr(page);
> +		if (addr != NULL) {
> +			flush_data_cache_page((unsigned long) addr);
> +			return;
> +		}
> +	}
> +
> +	/* If page_mapping returned a non-NULL value, then the page is not
> +	 * in the swap cache and it isn't anonymously mapped. If it's not
> +	 * already mapped into user space, we can just set the dirty bit to
> +	 * get the cache flushed later, if needed */
>   	if (mapping && !mapping_mapped(mapping)) {
>   		SetPageDcacheDirty(page);
>   		return;
> @@ -84,8 +103,10 @@
>   	 * case is for exec env/arg pages and those are %99 certainly going to
>   	 * get faulted into the tlb (and thus flushed) anyways.
>   	 */
> -	addr = (unsigned long) page_address(page);
> -	flush_data_cache_page(addr);
> +	addr = page_address(page);
> +	/* If the page is not mapped for kernel access, don't flush it */
> +	if (addr != NULL)
> +		flush_data_cache_page((unsigned long) addr);
>   }
> 
>   EXPORT_SYMBOL(__flush_dcache_page);
> diff -urN a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c
> --- a/arch/mips/mm/highmem.c	2008-01-24 14:58:37.000000000 -0800
> +++ b/arch/mips/mm/highmem.c	2008-03-12 18:58:10.000000000 -0700
> @@ -25,6 +25,25 @@
>   }
> 
>   /*
> + * Describes one page->virtual association in kmap_atomic
> + */
> +struct kmap_atomic_map {
> +	struct list_head list;
> +	struct page *page;
> +};
> +
> +/*
> + * Array of linked lists of the mappings currently in use. The array is
> + * indexed by the CPU number, so we don't have to worry about synchronizing
> + * between the CPUs. We can add maps in interrupt handlers, however, so
> + * we will need to block interrupts when manipulating the linked list.
> + */
> +static struct kmap_atomic_map_list {
> +	struct list_head lh;
> +	struct kmap_atomic_map map_pool[KM_TYPE_NR];
> +} ____cacheline_aligned_in_smp map_list[NR_CPUS];
> +
> +/*
>    * kmap_atomic/kunmap_atomic is significantly faster than kmap/kunmap because
>    * no global lock is needed and because the kmap code must perform a global TLB
>    * invalidation when the kmap pool wraps.
> @@ -37,6 +56,7 @@
>   {
>   	enum fixed_addresses idx;
>   	unsigned long vaddr;
> +	unsigned long flags;
> 
>   	/* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */
>   	pagefault_disable();
> @@ -52,11 +72,18 @@
>   	set_pte(kmap_pte-idx, mk_pte(page, kmap_prot));
>   	local_flush_tlb_one((unsigned long)vaddr);
> 
> +	local_irq_save(flags);
> +	map_list[smp_processor_id()].map_pool[type].page = page;
> +	list_add(&(map_list[smp_processor_id()].map_pool[type]).list, 
> &map_list[smp_processor_id()].lh);
> +	local_irq_restore(flags);
> +
>   	return (void*) vaddr;
>   }
> 
>   void __kunmap_atomic(void *kvaddr, enum km_type type)
>   {
> +	unsigned long flags;
> +
>   #ifdef CONFIG_DEBUG_HIGHMEM
>   	unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
>   	enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();
> @@ -75,8 +102,14 @@
>   	 */
>   	pte_clear(&init_mm, vaddr, kmap_pte-idx);
>   	local_flush_tlb_one(vaddr);
> +
> +	map_list[smp_processor_id()].map_pool[type].page = NULL;
>   #endif
> 
> +	local_irq_save(flags);
> +	list_del(&(map_list[smp_processor_id()].map_pool[type]).list);
> +	local_irq_restore(flags);
> +
>   	pagefault_enable();
>   }
> 
> @@ -112,6 +145,40 @@
>   	return pte_page(*pte);
>   }
> 
> +void *kmap_atomic_to_vaddr(struct page *page)
> +{
> +	unsigned long flags;
> +	struct kmap_atomic_map *map;
> +	unsigned long vaddr = 0;
> +
> +	local_irq_save(flags);
> +	list_for_each_entry(map, &map_list[smp_processor_id()].lh, list) {
> +		if (map->page == page) {
> +			vaddr = __fix_to_virt(FIX_KMAP_BEGIN +
> +				(map - map_list[smp_processor_id()].map_pool));
> +			break;
> +		}
> +	}
> +	local_irq_restore(flags);
> +
> +	return (void *)vaddr;		
> +}
> +
> +void __init kmap_atomic_init(void)
> +{
> +	int i, j;
> +
> +	for (i = 0; i < NR_CPUS; i++) {
> +		INIT_LIST_HEAD(&map_list[i].lh);
> +#ifdef CONFIG_DEBUG_HIGHMEM
> +		for (j = 0; j < KM_TYPE_NR; j++) {
> +			INIT_LIST_HEAD(&(map_list[i].map_pool[j]).list);
> +			map_list[i].map_pool[j].page = NULL;
> +		}
> +#endif
> +	}
> +}
> +
>   EXPORT_SYMBOL(__kmap);
>   EXPORT_SYMBOL(__kunmap);
>   EXPORT_SYMBOL(__kmap_atomic);
> diff -urN a/arch/mips/mm/init.c b/arch/mips/mm/init.c
> --- a/arch/mips/mm/init.c	2008-01-24 14:58:37.000000000 -0800
> +++ b/arch/mips/mm/init.c	2008-03-12 19:12:51.000000000 -0700
> @@ -354,6 +354,7 @@
> 
>   #ifdef CONFIG_HIGHMEM
>   	kmap_init();
> +	kmap_atomic_init();
>   #endif
>   	kmap_coherent_init();
> 
> diff -urN a/include/asm-mips/highmem.h b/include/asm-mips/highmem.h
> --- a/include/asm-mips/highmem.h	2008-01-24 14:58:37.000000000 -0800
> +++ b/include/asm-mips/highmem.h	2008-03-12 18:57:22.000000000 -0700
> @@ -55,6 +55,9 @@
>   extern void *kmap_atomic_pfn(unsigned long pfn, enum km_type type);
>   extern struct page *__kmap_atomic_to_page(void *ptr);
> 
> +extern void *kmap_atomic_to_vaddr(struct page *page);
> +extern void kmap_atomic_init(void);
> +
>   #define kmap			__kmap
>   #define kunmap			__kunmap
>   #define kmap_atomic		__kmap_atomic
> 
> 
> 



From sshtylyov@ru.mvista.com Wed Apr  2 21:34:16 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Apr 2008 21:34:24 +0200 (CEST)
Received: from rtsoft3.corbina.net ([85.21.88.6]:23647 "EHLO
	buildserver.ru.mvista.com") by lappi.linux-mips.net with ESMTP
	id S525878AbYDBTeQ (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 2 Apr 2008 21:34:16 +0200
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id 78B3C8810; Thu,  3 Apr 2008 01:33:11 +0500 (SAMST)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	ralf@linux-mips.org
Subject: [PATCH] Alchemy: kill useless #include's and extern's
Date:	Wed, 2 Apr 2008 23:32:08 +0400
User-Agent: KMail/1.5
Cc:	linux-mips@linux-mips.org
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804022332.08317.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18778
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 30545
Lines: 978

Go thru the Alchemy code and hunt down every unneeded #include and extern
(some of which refer to already long dead functions).

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

---
Compile tested on all supported Alchemy platforms...

 arch/mips/au1000/common/cputable.c     |    5 +----
 arch/mips/au1000/common/dbdma.c        |    6 ------
 arch/mips/au1000/common/dbg_io.c       |    1 -
 arch/mips/au1000/common/dma.c          |    5 +----
 arch/mips/au1000/common/gpio.c         |    5 -----
 arch/mips/au1000/common/irq.c          |    1 -
 arch/mips/au1000/common/pci.c          |    2 +-
 arch/mips/au1000/common/platform.c     |    4 +---
 arch/mips/au1000/common/power.c        |    9 +--------
 arch/mips/au1000/common/prom.c         |    2 +-
 arch/mips/au1000/common/puts.c         |    1 -
 arch/mips/au1000/common/reset.c        |    8 +-------
 arch/mips/au1000/common/setup.c        |   11 +----------
 arch/mips/au1000/common/sleeper.S      |    2 +-
 arch/mips/au1000/common/time.c         |    8 --------
 arch/mips/au1000/db1x00/board_setup.c  |   15 ++-------------
 arch/mips/au1000/db1x00/init.c         |    5 -----
 arch/mips/au1000/db1x00/irqmap.c       |   21 ++-------------------
 arch/mips/au1000/mtx-1/board_setup.c   |   14 ++------------
 arch/mips/au1000/mtx-1/init.c          |    6 +-----
 arch/mips/au1000/mtx-1/irqmap.c        |   19 +------------------
 arch/mips/au1000/pb1000/board_setup.c  |   11 +----------
 arch/mips/au1000/pb1000/init.c         |    6 +-----
 arch/mips/au1000/pb1000/irqmap.c       |   18 +-----------------
 arch/mips/au1000/pb1100/board_setup.c  |   11 +----------
 arch/mips/au1000/pb1100/init.c         |    6 +-----
 arch/mips/au1000/pb1100/irqmap.c       |   19 +------------------
 arch/mips/au1000/pb1200/board_setup.c  |   17 +----------------
 arch/mips/au1000/pb1200/init.c         |    6 +-----
 arch/mips/au1000/pb1200/irqmap.c       |   20 ++------------------
 arch/mips/au1000/pb1500/board_setup.c  |   11 +----------
 arch/mips/au1000/pb1500/init.c         |    6 +-----
 arch/mips/au1000/pb1500/irqmap.c       |   19 +------------------
 arch/mips/au1000/pb1550/board_setup.c  |   15 ++-------------
 arch/mips/au1000/pb1550/init.c         |    6 +-----
 arch/mips/au1000/pb1550/irqmap.c       |   19 +------------------
 arch/mips/au1000/xxs1500/board_setup.c |   11 +----------
 arch/mips/au1000/xxs1500/init.c        |    6 +-----
 arch/mips/au1000/xxs1500/irqmap.c      |   19 +------------------
 arch/mips/pci/fixup-au1000.c           |    5 +----
 40 files changed, 38 insertions(+), 343 deletions(-)

Index: linux-2.6/arch/mips/au1000/common/cputable.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/cputable.c
+++ linux-2.6/arch/mips/au1000/common/cputable.c
@@ -11,10 +11,7 @@
  *  as published by the Free Software Foundation; either version
  *  2 of the License, or (at your option) any later version.
  */
-#include <linux/string.h>
-#include <linux/sched.h>
-#include <linux/threads.h>
-#include <linux/init.h>
+
 #include <asm/mach-au1x00/au1000.h>
 
 struct cpu_spec* cur_cpu_spec[NR_CPUS];
Index: linux-2.6/arch/mips/au1000/common/dbdma.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/dbdma.c
+++ linux-2.6/arch/mips/au1000/common/dbdma.c
@@ -31,18 +31,12 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
-#include <linux/string.h>
-#include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-au1x00/au1xxx_dbdma.h>
-#include <asm/system.h>
-
 
 #if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
 
Index: linux-2.6/arch/mips/au1000/common/dbg_io.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/dbg_io.c
+++ linux-2.6/arch/mips/au1000/common/dbg_io.c
@@ -1,5 +1,4 @@
 
-#include <asm/io.h>
 #include <asm/mach-au1x00/au1000.h>
 
 #ifdef CONFIG_KGDB
Index: linux-2.6/arch/mips/au1000/common/dma.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/dma.c
+++ linux-2.6/arch/mips/au1000/common/dma.c
@@ -33,12 +33,9 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
-#include <linux/sched.h>
 #include <linux/spinlock.h>
-#include <linux/string.h>
-#include <linux/delay.h>
 #include <linux/interrupt.h>
-#include <asm/system.h>
+
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-au1x00/au1000_dma.h>
 
Index: linux-2.6/arch/mips/au1000/common/gpio.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/gpio.c
+++ linux-2.6/arch/mips/au1000/common/gpio.c
@@ -27,13 +27,8 @@
  * 	others have a second one : GPIO2
  */
 
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/types.h>
 #include <linux/module.h>
 
-#include <asm/addrspace.h>
-
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/gpio.h>
 
Index: linux-2.6/arch/mips/au1000/common/irq.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/irq.c
+++ linux-2.6/arch/mips/au1000/common/irq.c
@@ -26,7 +26,6 @@
  */
 #include <linux/bitops.h>
 #include <linux/init.h>
-#include <linux/io.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 
Index: linux-2.6/arch/mips/au1000/common/pci.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/pci.c
+++ linux-2.6/arch/mips/au1000/common/pci.c
@@ -30,7 +30,7 @@
  *  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/pci.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
Index: linux-2.6/arch/mips/au1000/common/platform.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/platform.c
+++ linux-2.6/arch/mips/au1000/common/platform.c
@@ -7,11 +7,9 @@
  * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
-#include <linux/device.h>
+
 #include <linux/platform_device.h>
-#include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/resource.h>
 
 #include <asm/mach-au1x00/au1xxx.h>
 
Index: linux-2.6/arch/mips/au1000/common/power.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/power.c
+++ linux-2.6/arch/mips/au1000/common/power.c
@@ -29,17 +29,14 @@
  *  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/pm.h>
 #include <linux/pm_legacy.h>
-#include <linux/slab.h>
 #include <linux/sysctl.h>
 #include <linux/jiffies.h>
 
-#include <asm/string.h>
 #include <asm/uaccess.h>
-#include <asm/io.h>
-#include <asm/system.h>
 #include <asm/cacheflush.h>
 #include <asm/mach-au1x00/au1000.h>
 
@@ -54,10 +51,6 @@
 
 static void au1000_calibrate_delay(void);
 
-extern void set_au1x00_speed(unsigned int new_freq);
-extern unsigned int get_au1x00_speed(void);
-extern unsigned long get_au1x00_uart_baud_base(void);
-extern void set_au1x00_uart_baud_base(unsigned long new_baud_base);
 extern unsigned long save_local_and_disable(int controller);
 extern void restore_local_and_enable(int controller, unsigned long mask);
 extern void local_enable_irq(unsigned int irq_nr);
Index: linux-2.6/arch/mips/au1000/common/prom.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/prom.c
+++ linux-2.6/arch/mips/au1000/common/prom.c
@@ -33,8 +33,8 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/module.h>
-#include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/string.h>
 
Index: linux-2.6/arch/mips/au1000/common/puts.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/puts.c
+++ linux-2.6/arch/mips/au1000/common/puts.c
@@ -28,7 +28,6 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/types.h>
 #include <asm/mach-au1x00/au1000.h>
 
 #define SERIAL_BASE   UART_BASE
Index: linux-2.6/arch/mips/au1000/common/reset.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/reset.c
+++ linux-2.6/arch/mips/au1000/common/reset.c
@@ -27,13 +27,7 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/sched.h>
-#include <linux/mm.h>
-#include <asm/io.h>
-#include <asm/pgtable.h>
-#include <asm/processor.h>
-#include <asm/reboot.h>
-#include <asm/system.h>
+
 #include <asm/mach-au1x00/au1000.h>
 
 extern int au_sleep(void);
Index: linux-2.6/arch/mips/au1000/common/setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/setup.c
+++ linux-2.6/arch/mips/au1000/common/setup.c
@@ -25,21 +25,14 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
 #include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/delay.h>
-#include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/pm.h>
 
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
 #include <asm/mipsregs.h>
 #include <asm/reboot.h>
-#include <asm/pgtable.h>
 #include <asm/time.h>
 
 #include <au1000.h>
@@ -49,8 +42,6 @@ extern void __init board_setup(void);
 extern void au1000_restart(char *);
 extern void au1000_halt(void);
 extern void au1000_power_off(void);
-extern void au1x_time_init(void);
-extern void au1x_timer_setup(struct irqaction *irq);
 extern void set_cpuspec(void);
 
 void __init plat_mem_setup(void)
Index: linux-2.6/arch/mips/au1000/common/sleeper.S
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/sleeper.S
+++ linux-2.6/arch/mips/au1000/common/sleeper.S
@@ -9,9 +9,9 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
  */
+
 #include <asm/asm.h>
 #include <asm/mipsregs.h>
-#include <asm/addrspace.h>
 #include <asm/regdef.h>
 #include <asm/stackframe.h>
 
Index: linux-2.6/arch/mips/au1000/common/time.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/time.c
+++ linux-2.6/arch/mips/au1000/common/time.c
@@ -34,20 +34,12 @@
 
 #include <linux/types.h>
 #include <linux/init.h>
-#include <linux/kernel_stat.h>
-#include <linux/sched.h>
 #include <linux/spinlock.h>
-#include <linux/hardirq.h>
 
-#include <asm/compiler.h>
 #include <asm/mipsregs.h>
 #include <asm/time.h>
-#include <asm/div64.h>
 #include <asm/mach-au1x00/au1000.h>
 
-#include <linux/mc146818rtc.h>
-#include <linux/timex.h>
-
 static int no_au1xxx_32khz;
 extern int allow_au1k_wait; /* default off for CP0 Counter */
 
Index: linux-2.6/arch/mips/au1000/db1x00/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/db1x00/board_setup.c
+++ linux-2.6/arch/mips/au1000/db1x00/board_setup.c
@@ -27,20 +27,9 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
-#include <linux/mc146818rtc.h>
-#include <linux/delay.h>
-
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
+
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-db1x00/db1x00.h>
 
Index: linux-2.6/arch/mips/au1000/db1x00/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/db1x00/init.c
+++ linux-2.6/arch/mips/au1000/db1x00/init.c
@@ -28,13 +28,8 @@
  */
 
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/db1x00/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/db1x00/irqmap.c
+++ linux-2.6/arch/mips/au1000/db1x00/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 #ifdef CONFIG_MIPS_DB1500
Index: linux-2.6/arch/mips/au1000/mtx-1/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/mtx-1/board_setup.c
+++ linux-2.6/arch/mips/au1000/mtx-1/board_setup.c
@@ -28,19 +28,9 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
-#include <linux/delay.h>
-
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
+
 #include <asm/mach-au1x00/au1000.h>
 
 extern int (*board_pci_idsel)(unsigned int devsel, int assert);
Index: linux-2.6/arch/mips/au1000/mtx-1/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/mtx-1/init.c
+++ linux-2.6/arch/mips/au1000/mtx-1/init.c
@@ -28,14 +28,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/string.h>
+
 #include <linux/kernel.h>
-#include <linux/sched.h>
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/bootmem.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/mtx-1/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/mtx-1/irqmap.c
+++ linux-2.6/arch/mips/au1000/mtx-1/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 char irq_tab_alchemy[][5] __initdata = {
Index: linux-2.6/arch/mips/au1000/pb1000/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1000/board_setup.c
+++ linux-2.6/arch/mips/au1000/pb1000/board_setup.c
@@ -23,19 +23,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
 #include <linux/delay.h>
 
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-pb1x00/pb1000.h>
 
Index: linux-2.6/arch/mips/au1000/pb1000/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1000/init.c
+++ linux-2.6/arch/mips/au1000/pb1000/init.c
@@ -26,14 +26,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/pb1000/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1000/irqmap.c
+++ linux-2.6/arch/mips/au1000/pb1000/irqmap.c
@@ -25,26 +25,10 @@
  *  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/mach-au1x00/au1000.h>
 
 struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
Index: linux-2.6/arch/mips/au1000/pb1100/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1100/board_setup.c
+++ linux-2.6/arch/mips/au1000/pb1100/board_setup.c
@@ -23,19 +23,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
 #include <linux/delay.h>
 
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-pb1x00/pb1100.h>
 
Index: linux-2.6/arch/mips/au1000/pb1100/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1100/init.c
+++ linux-2.6/arch/mips/au1000/pb1100/init.c
@@ -27,14 +27,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/pb1100/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1100/irqmap.c
+++ linux-2.6/arch/mips/au1000/pb1100/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
Index: linux-2.6/arch/mips/au1000/pb1200/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1200/board_setup.c
+++ linux-2.6/arch/mips/au1000/pb1200/board_setup.c
@@ -23,24 +23,9 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
 #include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
-#include <linux/mc146818rtc.h>
-#include <linux/delay.h>
-
-#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
-#include <linux/ide.h>
-#endif
-
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
 
 #include <au1000.h>
 #include <au1xxx_dbdma.h>
Index: linux-2.6/arch/mips/au1000/pb1200/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1200/init.c
+++ linux-2.6/arch/mips/au1000/pb1200/init.c
@@ -27,14 +27,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/pb1200/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1200/irqmap.c
+++ linux-2.6/arch/mips/au1000/pb1200/irqmap.c
@@ -22,26 +22,10 @@
  *  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/mach-au1x00/au1000.h>
 
 #ifdef CONFIG_MIPS_PB1200
Index: linux-2.6/arch/mips/au1000/pb1500/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1500/board_setup.c
+++ linux-2.6/arch/mips/au1000/pb1500/board_setup.c
@@ -23,19 +23,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
 #include <linux/delay.h>
 
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-pb1x00/pb1500.h>
 
Index: linux-2.6/arch/mips/au1000/pb1500/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1500/init.c
+++ linux-2.6/arch/mips/au1000/pb1500/init.c
@@ -27,14 +27,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/pb1500/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1500/irqmap.c
+++ linux-2.6/arch/mips/au1000/pb1500/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 char irq_tab_alchemy[][5] __initdata = {
Index: linux-2.6/arch/mips/au1000/pb1550/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1550/board_setup.c
+++ linux-2.6/arch/mips/au1000/pb1550/board_setup.c
@@ -27,20 +27,9 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
-#include <linux/mc146818rtc.h>
-#include <linux/delay.h>
-
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
+
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-pb1x00/pb1550.h>
 
Index: linux-2.6/arch/mips/au1000/pb1550/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1550/init.c
+++ linux-2.6/arch/mips/au1000/pb1550/init.c
@@ -27,14 +27,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/pb1550/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1550/irqmap.c
+++ linux-2.6/arch/mips/au1000/pb1550/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 char irq_tab_alchemy[][5] __initdata = {
Index: linux-2.6/arch/mips/au1000/xxs1500/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/xxs1500/board_setup.c
+++ linux-2.6/arch/mips/au1000/xxs1500/board_setup.c
@@ -23,19 +23,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
 #include <linux/delay.h>
 
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
 #include <asm/mach-au1x00/au1000.h>
 
 void board_reset(void)
Index: linux-2.6/arch/mips/au1000/xxs1500/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/xxs1500/init.c
+++ linux-2.6/arch/mips/au1000/xxs1500/init.c
@@ -26,14 +26,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/xxs1500/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/xxs1500/irqmap.c
+++ linux-2.6/arch/mips/au1000/xxs1500/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
Index: linux-2.6/arch/mips/pci/fixup-au1000.c
===================================================================
--- linux-2.6.orig/arch/mips/pci/fixup-au1000.c
+++ linux-2.6/arch/mips/pci/fixup-au1000.c
@@ -26,13 +26,10 @@
  *  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/pci.h>
-#include <linux/kernel.h>
 #include <linux/init.h>
 
-#include <asm/mach-au1x00/au1000.h>
-
 extern char irq_tab_alchemy[][5];
 
 int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)


From sshtylyov@ru.mvista.com Wed Apr  2 21:55:04 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Apr 2008 21:55:14 +0200 (CEST)
Received: from rtsoft3.corbina.net ([85.21.88.6]:34655 "EHLO
	buildserver.ru.mvista.com") by lappi.linux-mips.net with ESMTP
	id S525911AbYDBTzE (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 2 Apr 2008 21:55:04 +0200
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id 071798810; Thu,  3 Apr 2008 01:54:22 +0500 (SAMST)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	ralf@linux-mips.org
Subject: [PATCH] PbAu1200: fix header breakage
Date:	Wed, 2 Apr 2008 23:53:19 +0400
User-Agent: KMail/1.5
Cc:	linux-mips@linux-mips.org
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804022353.19379.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18780
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 706
Lines: 22

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

---
Looks like nobody ever cared since the code was merged -- there's no defconfig.

 include/asm-mips/mach-pb1x00/pb1200.h |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/include/asm-mips/mach-pb1x00/pb1200.h
===================================================================
--- linux-2.6.orig/include/asm-mips/mach-pb1x00/pb1200.h
+++ linux-2.6/include/asm-mips/mach-pb1x00/pb1200.h
@@ -245,7 +245,7 @@ enum external_pb1200_ints {
 	PB1200_SD1_INSERT_INT,
 	PB1200_SD1_EJECT_INT,
 
-	PB1200_INT_END			(PB1200_INT_BEGIN + 15)
+	PB1200_INT_END		= PB1200_INT_BEGIN + 15
 };
 
 /* For drivers/pcmcia/au1000_db1x00.c */


From dvomlehn@cisco.com Wed Apr  2 23:58:01 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 02 Apr 2008 23:58:06 +0200 (CEST)
Received: from sj-iport-1.cisco.com ([171.71.176.70]:28993 "EHLO
	sj-iport-1.cisco.com") by lappi.linux-mips.net with ESMTP
	id S525971AbYDBV6B (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 2 Apr 2008 23:58:01 +0200
Received: from sj-dkim-1.cisco.com ([171.71.179.21])
  by sj-iport-1.cisco.com with ESMTP; 02 Apr 2008 14:56:58 -0700
Received: from sj-core-1.cisco.com (sj-core-1.cisco.com [171.71.177.237])
	by sj-dkim-1.cisco.com (8.12.11/8.12.11) with ESMTP id m32Luwg2013460;
	Wed, 2 Apr 2008 14:56:58 -0700
Received: from cliff.cisco.com (cliff.cisco.com [171.69.11.141])
	by sj-core-1.cisco.com (8.13.8/8.13.8) with ESMTP id m32LuwTf020080;
	Wed, 2 Apr 2008 21:56:58 GMT
Received: from [127.0.0.1] ([64.100.150.211]) by cliff.cisco.com (8.6.12/8.6.5) with ESMTP id VAA16875; Wed, 2 Apr 2008 21:56:52 GMT
Message-ID: <47F4011F.9020604@cisco.com>
Date:	Wed, 02 Apr 2008 14:56:47 -0700
From:	David VomLehn <dvomlehn@cisco.com>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
To:	"Jon Fraser [jfraser"@broadcom.com], linux-mips@linux-mips.org
Illegal-Object:	Syntax error in To: address found on lappi.linux-mips.net:
	To:	"Jon Fraser [jfraser"@broadcom.com]
							  ^-missing end of address
Subject: Re: [PATCH 2.6.24][MIPS]Work in progress: fix HIGHMEM-enabled dcache
 flushing on 32-bit processor
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
DKIM-Signature:	v=1; a=rsa-sha256; q=dns/txt; l=1118; t=1207173418; x=1208037418;
	c=relaxed/simple; s=sjdkim1004;
	h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version;
	d=cisco.com; i=dvomlehn@cisco.com;
	z=From:=20David=20VomLehn=20<dvomlehn@cisco.com>
	|Subject:=20Re=3A=20[PATCH=202.6.24][MIPS]Work=20in=20progr
	ess=3A=20fix=20HIGHMEM-enabled=20dcache=0A=20flushing=20on=2
	032-bit=20processor
	|Sender:=20;
	bh=uOYvlErAfqKD8lrMpRH3pKnur3snz1z8iQ1zzvUcals=;
	b=LY4psVsAnXhwZ5irV2eOvLCprFnXsorilOAPUJqng7iRlw8wZkyqGzNdC2
	EClFNI7A/vLQk111JTCcU9cBEjllmQa8mmYZiu4HEct1bdzU35/4YmS19YnO
	6cZ5+43yqZaB6iCAZbwD2XTEwHKEHqWcPP7q3FX9zhsH46KktHxhw=;
Authentication-Results:	sj-dkim-1; header.From=dvomlehn@cisco.com; dkim=pass (
	sig from cisco.com/sjdkim1004 verified; ); 
Return-Path: <dvomlehn@cisco.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18782
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dvomlehn@cisco.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1096
Lines: 24

> Did this fix your NFS problem?
> 
> I'm working on discontiguous memory platforms as well.
> 
> Jon Fraser
> 
> On Wed, 2008-03-12 at 19:31 -0700, David VomLehn wrote:
>> This patch is a work in progress, per Ralf's suggestion from last 
>> week. It is intended to fix dcache flushing issues when using HIGHMEM 
>> support. We get much better results with this patch applied, but I 
>> would not characterize our 2.6.24 port as stable, yet, so there may be other HIGHMEM-related issues.

Yes, we are able to boot using NFS with this patch. There are some other minor 
changes that appear necessary for correct cache flushing but which don't seem to 
be causing any actual issues. (Cache stuff just works that way--you don't know 
you've got a problem until you get into some obscure corner case). I'll post 
these as soon as I can get to it.

I can't say whether these are all the changes required for high memory support, 
but we sure get a lot farther when we use them...
-- 
David VomLehn, dvomlehn@cisco.com
The opinions expressed herein are likely mine, but might not be my employer's...


From technoboy85@gmail.com Thu Apr  3 02:19:30 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 03 Apr 2008 02:19:36 +0200 (CEST)
Received: from smtp-out112.alice.it ([85.37.17.112]:8966 "EHLO
	smtp-out112.alice.it") by lappi.linux-mips.net with ESMTP
	id S526274AbYDCAT3 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 3 Apr 2008 02:19:29 +0200
Received: from FBCMMO01.fbc.local ([192.168.68.195]) by smtp-out112.alice.it with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 3 Apr 2008 02:19:05 +0200
Received: from FBCMCL01B02.fbc.local ([192.168.69.83]) by FBCMMO01.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 3 Apr 2008 02:19:04 +0200
Received: from [192.168.1.3] ([87.7.112.40]) by FBCMCL01B02.fbc.local with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 3 Apr 2008 02:19:04 +0200
From:	Matteo Croce <technoboy85@gmail.com>
To:	Florian Lohoff <flo@rfc822.org>
Subject: Re: [PATCH][MIPS][3/6]: AR7: VLYNQ bus
Date:	Thu, 3 Apr 2008 02:19:03 +0200
User-Agent: KMail/1.9.9
Cc:	linux-mips@linux-mips.org, Eugene Konev <ejka@imfi.kspu.ru>,
	Andrew Morton <akpm@linux-foundation.org>
References: <200803120221.25044.technoboy85@gmail.com> <200804021456.44472.technoboy85@gmail.com> <20080402183114.GA371@paradigm.rfc822.org>
In-Reply-To: <20080402183114.GA371@paradigm.rfc822.org>
X-Face:	0AUq?,0sKh2O65+R5#[nTCS'~}"m)9|g3Tsi=g7A9q69S+=M!BY)=?utf-8?q?Zdmwo2u!i=5CUylx=26=27D+=0A=09=5B7u=26z1=27s=7E=5B=3F+=24=27w?=
 =?utf-8?q?O6+?="'WWcr5Jy,]}8namg8NP:9<E,o^21xGB~/HRhB(u^@
 =?utf-8?q?ZB=2EXLP0swe=0A=09r9M=7EL?=<b1=^'4cv*_N1tNJ$`9Ot*KL/;8oXFdrT@r|-Ki2wCQI"R(X(
 =?utf-8?q?73r=3A=3BmnNPoA2a=5D=7EZ=0A=092n2sUh?=,B|bt;ys*hv.QR>a]{m
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804030219.03335.technoboy85@gmail.com>
X-OriginalArrivalTime: 03 Apr 2008 00:19:04.0633 (UTC) FILETIME=[5322A290:01C89520]
Return-Path: <technoboy85@gmail.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18783
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: technoboy85@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1570
Lines: 37

Il Wednesday 02 April 2008 20:31:14 Florian Lohoff ha scritto:
> On Wed, Apr 02, 2008 at 02:56:44PM +0200, Matteo Croce wrote:
> > 
> > Works fine for my AR7 which has an interlan clock.
> > 
> 
> Its doesnt for me with an external clock - thats what i mean - Auto
> probing should first try to listen for an external clock before letting
> clocks run against each other. This is the hunk of a patch on top of
> yours ...
> 
> @@ -371,12 +371,20 @@ static int __vlynq_enable_device(struct 
>  
>         switch (dev->divisor) {
>         case vlynq_div_auto:
> -               /* Only try locally supplied clock, others cause problems */
> +       
> +               vlynq_reg_write(dev->local->control, 0);
>                 vlynq_reg_write(dev->remote->control, 0);
> +               if (vlynq_linked(dev)) {
> +                       printk(KERN_DEBUG "%s: using external clock\n",
> +                              dev->dev.bus_id);
> +                       return 0;
> +               }
> +
>                 for (i = vlynq_ldiv2; i <= vlynq_ldiv8; i++) {
>                         vlynq_reg_write(dev->local->control,
>                                         VLYNQ_CTRL_CLOCK_INT |
>                                         VLYNQ_CTRL_CLOCK_DIV(i - vlynq_ldiv1));
> +                       vlynq_reg_write(dev->remote->control, 0);
>                         if (vlynq_linked(dev)) {
>                                 printk(KERN_DEBUG
>                                        "%s: using local clock divisor %d\n",
> 
> Flo

isn't this what I do in my last patch?

From sshtylyov@ru.mvista.com Thu Apr  3 18:57:02 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 03 Apr 2008 18:57:16 +0200 (CEST)
Received: from h155.mvista.com ([63.81.120.155]:64450 "EHLO imap.sh.mvista.com")
	by lappi.linux-mips.net with ESMTP id S533777AbYDCPqq (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 3 Apr 2008 17:46:46 +0200
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id 0FE1B3EC9; Thu,  3 Apr 2008 08:46:13 -0700 (PDT)
Message-ID: <47F4FB9A.6070005@ru.mvista.com>
Date:	Thu, 03 Apr 2008 19:45:30 +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:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	ralf@linux-mips.org, linux-mips@linux-mips.org
Subject: Re: [PATCH] PbAu1200: fix header breakage
References: <200804022353.19379.sshtylyov@ru.mvista.com>
In-Reply-To: <200804022353.19379.sshtylyov@ru.mvista.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18784
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 299
Lines: 9

Hello, I wrote:

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

    Er, the boards are called Pb1x00, not PbAu1x00, so Ralf please change the 
summary before comitting (if you feel inclined :-).
    (Luckily, DBAu1200 uses its own header, so it wasn't hurt by this error.)

WBR, Sergei

From sshtylyov@ru.mvista.com Thu Apr  3 19:08:39 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 03 Apr 2008 19:08:47 +0200 (CEST)
Received: from h155.mvista.com ([63.81.120.155]:6077 "EHLO imap.sh.mvista.com")
	by lappi.linux-mips.net with ESMTP id S532902AbYDCMlE (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 3 Apr 2008 14:41:04 +0200
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id 91F913EC9; Thu,  3 Apr 2008 05:40:16 -0700 (PDT)
Message-ID: <47F4D006.4090200@ru.mvista.com>
Date:	Thu, 03 Apr 2008 16:39:34 +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:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	ralf@linux-mips.org, linux-mips@linux-mips.org
Subject: Re: [PATCH] PbAu1200: fix header breakage
References: <200804022353.19379.sshtylyov@ru.mvista.com>
In-Reply-To: <200804022353.19379.sshtylyov@ru.mvista.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18787
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 381
Lines: 12

Hello, I wrote:

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

> ---
> Looks like nobody ever cared since the code was merged -- there's no defconfig.

    Er, no... the breakage has been introduced by the commit 
95c4eb3ef4484ca85da5c98780d358cffd546b90 ([MIPS] Alchemy: Renumber interrupts 
so irq_cpu can work.), so thanks go to its hasty author. ;-)

WBR, Sergei

From ralf@linux-mips.org Thu Apr  3 19:10:15 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 03 Apr 2008 19:10:25 +0200 (CEST)
Received: from [192.48.170.157] ([192.48.170.157]:49876 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S1101209AbYDCRBW (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 3 Apr 2008 19:01:22 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m33GwvZ6018930
	for <linux-mips@linux-mips.org>; Thu, 3 Apr 2008 09:59:01 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m33CpOAj026139;
	Thu, 3 Apr 2008 13:51:24 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m33CpOEt026138;
	Thu, 3 Apr 2008 13:51:24 +0100
Date:	Thu, 3 Apr 2008 13:51:24 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] Alchemy: kill useless #include's and extern's
Message-ID: <20080403125124.GB20775@linux-mips.org>
References: <200804022332.08317.sshtylyov@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200804022332.08317.sshtylyov@ru.mvista.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18788
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 296
Lines: 10

On Wed, Apr 02, 2008 at 11:32:08PM +0400, Sergei Shtylyov wrote:

> Go thru the Alchemy code and hunt down every unneeded #include and extern
> (some of which refer to already long dead functions).
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

Thanks, queued for 2.6.26.

  Ralf

From ralf@linux-mips.org Thu Apr  3 19:12:20 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 03 Apr 2008 19:12:33 +0200 (CEST)
Received: from [192.48.170.157] ([192.48.170.157]:48340 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S1101210AbYDCRBW (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 3 Apr 2008 19:01:22 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m33GwvZ4018930
	for <linux-mips@linux-mips.org>; Thu, 3 Apr 2008 09:58:58 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m33CVjkt021120;
	Thu, 3 Apr 2008 13:31:45 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m33CVX7o021116;
	Thu, 3 Apr 2008 13:31:33 +0100
Date:	Thu, 3 Apr 2008 13:31:33 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] PbAu1200: fix header breakage
Message-ID: <20080403123130.GA20775@linux-mips.org>
References: <200804022353.19379.sshtylyov@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200804022353.19379.sshtylyov@ru.mvista.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18789
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 240
Lines: 10

On Wed, Apr 02, 2008 at 11:53:19PM +0400, Sergei Shtylyov wrote:

> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
> 
> ---
> Looks like nobody ever cared since the code was merged -- there's no defconfig.

Applied, sigh.

  Ralf

From flo@rfc822.org Thu Apr  3 19:35:41 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 03 Apr 2008 19:35:51 +0200 (CEST)
Received: from hydra.gt.owl.de ([195.71.99.218]:14058 "EHLO hydra.gt.owl.de")
	by lappi.linux-mips.net with ESMTP id S526924AbYDCGJA (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 3 Apr 2008 08:09:00 +0200
Received: by hydra.gt.owl.de (Postfix, from userid 1000)
	id E6F2232D00; Thu,  3 Apr 2008 08:08:20 +0200 (CEST)
Date:	Thu, 3 Apr 2008 08:08:20 +0200
From:	Florian Lohoff <flo@rfc822.org>
To:	Matteo Croce <technoboy85@gmail.com>
Cc:	linux-mips@linux-mips.org, Eugene Konev <ejka@imfi.kspu.ru>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH][MIPS][3/6]: AR7: VLYNQ bus
Message-ID: <20080403060820.GD26540@paradigm.rfc822.org>
References: <200803120221.25044.technoboy85@gmail.com> <200804021456.44472.technoboy85@gmail.com> <20080402183114.GA371@paradigm.rfc822.org> <200804030219.03335.technoboy85@gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="GyRA7555PLgSTuth"
Content-Disposition: inline
In-Reply-To: <200804030219.03335.technoboy85@gmail.com>
Organization: rfc822 - pure communication
X-SpiderMe: mh-200804030734@listme.rfc822.org
User-Agent: Mutt/1.5.13 (2006-08-11)
Return-Path: <flo@rfc822.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18792
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: flo@rfc822.org
Precedence: bulk
X-list: linux-mips
Content-Length: 2115
Lines: 60


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

On Thu, Apr 03, 2008 at 02:19:03AM +0200, Matteo Croce wrote:
> > @@ -371,12 +371,20 @@ static int __vlynq_enable_device(struct=20
> > =20
> >         switch (dev->divisor) {
> >         case vlynq_div_auto:
> > -               /* Only try locally supplied clock, others cause proble=
ms */
> > +      =20
> > +               vlynq_reg_write(dev->local->control, 0);
> >                 vlynq_reg_write(dev->remote->control, 0);
> > +               if (vlynq_linked(dev)) {
> > +                       printk(KERN_DEBUG "%s: using external clock\n",
> > +                              dev->dev.bus_id);
> > +                       return 0;
> > +               }
> > +
> >                 for (i =3D vlynq_ldiv2; i <=3D vlynq_ldiv8; i++) {
> >                         vlynq_reg_write(dev->local->control,
> >                                         VLYNQ_CTRL_CLOCK_INT |
> >                                         VLYNQ_CTRL_CLOCK_DIV(i - vlynq_=
ldiv1));
> > +                       vlynq_reg_write(dev->remote->control, 0);
> >                         if (vlynq_linked(dev)) {
> >                                 printk(KERN_DEBUG
> >                                        "%s: using local clock divisor %=
d\n",
> >=20
> > Flo
>=20
> isn't this what I do in my last patch?

I was shoveling through my inbox top down and the first mail was the
original patch i was referring to - sorry for the noise...

Flo
--=20
Florian Lohoff                  flo@rfc822.org             +49-171-2280134
	Those who would give up a little freedom to get a little=20
          security shall soon have neither - Benjamin Franklin

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

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

iD8DBQFH9HRUUaz2rXW+gJcRAlIjAJ0VUZEpLquWzU9/b/rvmsQQiruIVgCcDVYZ
fSBJi7+9L5iIIaF+LsEIm0M=
=zGjZ
-----END PGP SIGNATURE-----

--GyRA7555PLgSTuth--

From ralf@linux-mips.org Thu Apr  3 19:43:37 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 03 Apr 2008 19:43:47 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:43244 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S526437AbYDCRnb (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 3 Apr 2008 19:43:31 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m33HfgEG031833
	for <linux-mips@linux-mips.org>; Thu, 3 Apr 2008 10:41:46 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m33HgKrD031393;
	Thu, 3 Apr 2008 18:42:20 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m33HgK4E031392;
	Thu, 3 Apr 2008 18:42:20 +0100
Date:	Thu, 3 Apr 2008 18:42:20 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] PbAu1200: fix header breakage
Message-ID: <20080403174220.GA31379@linux-mips.org>
References: <200804022353.19379.sshtylyov@ru.mvista.com> <47F4D006.4090200@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <47F4D006.4090200@ru.mvista.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18793
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 629
Lines: 16

On Thu, Apr 03, 2008 at 04:39:34PM +0400, Sergei Shtylyov wrote:

>> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
>
>> ---
>> Looks like nobody ever cared since the code was merged -- there's no defconfig.
>
>    Er, no... the breakage has been introduced by the commit 
> 95c4eb3ef4484ca85da5c98780d358cffd546b90 ([MIPS] Alchemy: Renumber 
> interrupts so irq_cpu can work.), so thanks go to its hasty author. ;-)

Peple throw all sorts of MIPS kit at me but no big iron that could be
used for regular test builds.  So that sort of mistakes which to a degree
is unavoidable oftens stays hidden for too long.

  Ralf

From sshtylyov@ru.mvista.com Thu Apr  3 22:04:31 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 03 Apr 2008 22:04:43 +0200 (CEST)
Received: from rtsoft3.corbina.net ([85.21.88.6]:28268 "EHLO
	buildserver.ru.mvista.com") by lappi.linux-mips.net with ESMTP
	id S526618AbYDCUE2 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 3 Apr 2008 22:04:28 +0200
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id 368C38816; Fri,  4 Apr 2008 02:03:56 +0500 (SAMST)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	ralf@linux-mips.org
Subject: [PATCH] Alchemy: move UART platform code to its proper place
Date:	Fri, 4 Apr 2008 00:02:53 +0400
User-Agent: KMail/1.5
Cc:	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804040002.53757.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18794
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 7828
Lines: 248

Move the code registering the Alchemy UART platform devices from drivers/serial/
to its proper place, into the Alchemy platform code.  Fix the related Kconfig
entry, while at it...

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

---
Ralf, could you take this patch thru your queue -- it ahould apply atop of my
former #include /extern cleanup?

I don't know how the platform code ended up accepted into the serial drivers in
the first place -- it's high time to amend this.

 drivers/serial/8250_au1x00.c       |  100 -------------------------------------
 arch/mips/au1000/common/platform.c |   55 ++++++++++++++++++++
 drivers/serial/Kconfig             |    8 +-
 drivers/serial/Makefile            |    1 
 4 files changed, 59 insertions(+), 105 deletions(-)

Index: linux-2.6/arch/mips/au1000/common/platform.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/platform.c
+++ linux-2.6/arch/mips/au1000/common/platform.c
@@ -3,16 +3,63 @@
  *
  * Copyright 2004, Matt Porter <mporter@kernel.crashing.org>
  *
+ * (C) Copyright Embedded Alley Solutions, Inc 2005
+ * Author: Pantelis Antoniou <pantelis@embeddedalley.com>
+ *
  * This file is licensed under the terms of the GNU General Public
  * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
 
 #include <linux/platform_device.h>
+#include <linux/serial_8250.h>
 #include <linux/init.h>
 
 #include <asm/mach-au1x00/au1xxx.h>
 
+#define PORT(_base, _irq)				\
+	{						\
+		.iobase		= _base,		\
+		.membase	= (void __iomem *)_base,\
+		.mapbase	= CPHYSADDR(_base),	\
+		.irq		= _irq,			\
+		.regshift	= 2,			\
+		.iotype		= UPIO_AU,		\
+		.flags		= UPF_SKIP_TEST 	\
+	}
+
+static struct plat_serial8250_port au1x00_uart_data[] = {
+#if defined(CONFIG_SOC_AU1000)
+	PORT(UART0_ADDR, AU1000_UART0_INT),
+	PORT(UART1_ADDR, AU1000_UART1_INT),
+	PORT(UART2_ADDR, AU1000_UART2_INT),
+	PORT(UART3_ADDR, AU1000_UART3_INT),
+#elif defined(CONFIG_SOC_AU1500)
+	PORT(UART0_ADDR, AU1500_UART0_INT),
+	PORT(UART3_ADDR, AU1500_UART3_INT),
+#elif defined(CONFIG_SOC_AU1100)
+	PORT(UART0_ADDR, AU1100_UART0_INT),
+	PORT(UART1_ADDR, AU1100_UART1_INT),
+	PORT(UART3_ADDR, AU1100_UART3_INT),
+#elif defined(CONFIG_SOC_AU1550)
+	PORT(UART0_ADDR, AU1550_UART0_INT),
+	PORT(UART1_ADDR, AU1550_UART1_INT),
+	PORT(UART3_ADDR, AU1550_UART3_INT),
+#elif defined(CONFIG_SOC_AU1200)
+	PORT(UART0_ADDR, AU1200_UART0_INT),
+	PORT(UART1_ADDR, AU1200_UART1_INT),
+#endif
+	{ },
+};
+
+static struct platform_device au1xx0_uart_device = {
+	.name			= "serial8250",
+	.id			= PLAT8250_DEV_AU1X00,
+	.dev			= {
+		.platform_data	= au1x00_uart_data,
+	},
+};
+
 /* OHCI (USB full speed host controller) */
 static struct resource au1xxx_usb_ohci_resources[] = {
 	[0] = {
@@ -287,6 +334,7 @@ static struct platform_device pbdb_smbus
 #endif
 
 static struct platform_device *au1xxx_platform_devices[] __initdata = {
+	&au1xx0_uart_device,
 	&au1xxx_usb_ohci_device,
 	&au1x00_pcmcia_device,
 #ifdef CONFIG_FB_AU1100
@@ -310,6 +358,13 @@ static struct platform_device *au1xxx_pl
 
 int __init au1xxx_platform_init(void)
 {
+	unsigned int uartclk = get_au1x00_uart_baud_base() * 16;
+	int i;
+
+	/* Fill up uartclk. */
+	for (i = 0; au1x00_uart_data[i].flags ; i++)
+		au1x00_uart_data[i].uartclk = uartclk;
+
 	return platform_add_devices(au1xxx_platform_devices, ARRAY_SIZE(au1xxx_platform_devices));
 }
 
Index: linux-2.6/drivers/serial/8250_au1x00.c
===================================================================
--- linux-2.6.orig/drivers/serial/8250_au1x00.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Serial Device Initialisation for Au1x00
- *
- * (C) Copyright Embedded Alley Solutions, Inc 2005
- * Author: Pantelis Antoniou <pantelis@embeddedalley.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#include <linux/errno.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/ioport.h>
-#include <linux/module.h>
-#include <linux/serial_core.h>
-#include <linux/signal.h>
-#include <linux/slab.h>
-#include <linux/types.h>
-
-#include <linux/serial_8250.h>
-
-#include <asm/mach-au1x00/au1000.h>
-
-#include "8250.h"
-
-#define PORT(_base, _irq)				\
-	{						\
-		.iobase		= _base,		\
-		.membase	= (void __iomem *)_base,\
-		.mapbase	= CPHYSADDR(_base),	\
-		.irq		= _irq,			\
-		.uartclk	= 0,	/* filled */	\
-		.regshift	= 2,			\
-		.iotype		= UPIO_AU,		\
-		.flags		= UPF_SKIP_TEST 	\
-	}
-
-static struct plat_serial8250_port au1x00_data[] = {
-#if defined(CONFIG_SOC_AU1000)
-	PORT(UART0_ADDR, AU1000_UART0_INT),
-	PORT(UART1_ADDR, AU1000_UART1_INT),
-	PORT(UART2_ADDR, AU1000_UART2_INT),
-	PORT(UART3_ADDR, AU1000_UART3_INT),
-#elif defined(CONFIG_SOC_AU1500)
-	PORT(UART0_ADDR, AU1500_UART0_INT),
-	PORT(UART3_ADDR, AU1500_UART3_INT),
-#elif defined(CONFIG_SOC_AU1100)
-	PORT(UART0_ADDR, AU1100_UART0_INT),
-	PORT(UART1_ADDR, AU1100_UART1_INT),
-	/* The internal UART2 does not exist on the AU1100 processor. */
-	PORT(UART3_ADDR, AU1100_UART3_INT),
-#elif defined(CONFIG_SOC_AU1550)
-	PORT(UART0_ADDR, AU1550_UART0_INT),
-	PORT(UART1_ADDR, AU1550_UART1_INT),
-	PORT(UART3_ADDR, AU1550_UART3_INT),
-#elif defined(CONFIG_SOC_AU1200)
-	PORT(UART0_ADDR, AU1200_UART0_INT),
-	PORT(UART1_ADDR, AU1200_UART1_INT),
-#endif
-	{ },
-};
-
-static struct platform_device au1x00_device = {
-	.name			= "serial8250",
-	.id			= PLAT8250_DEV_AU1X00,
-	.dev			= {
-		.platform_data	= au1x00_data,
-	},
-};
-
-static int __init au1x00_init(void)
-{
-	int i;
-	unsigned int uartclk;
-
-	/* get uart clock */
-	uartclk = get_au1x00_uart_baud_base() * 16;
-
-	/* fill up uartclk */
-	for (i = 0; au1x00_data[i].flags ; i++)
-		au1x00_data[i].uartclk = uartclk;
-
-	return platform_device_register(&au1x00_device);
-}
-
-/* XXX: Yes, I know this doesn't yet work. */
-static void __exit au1x00_exit(void)
-{
-	platform_device_unregister(&au1x00_device);
-}
-
-module_init(au1x00_init);
-module_exit(au1x00_exit);
-
-MODULE_AUTHOR("Pantelis Antoniou <pantelis@embeddedalley.com>");
-MODULE_DESCRIPTION("8250 serial probe module for Au1x000 cards");
-MODULE_LICENSE("GPL");
Index: linux-2.6/drivers/serial/Kconfig
===================================================================
--- linux-2.6.orig/drivers/serial/Kconfig
+++ linux-2.6/drivers/serial/Kconfig
@@ -262,12 +262,12 @@ config SERIAL_8250_ACORN
 	  cards.  If unsure, say N.
 
 config SERIAL_8250_AU1X00
-	bool "AU1X00 serial port support"
+	bool "Au1x00 serial port support"
 	depends on SERIAL_8250 != n && SOC_AU1X00
 	help
-	  If you have an Au1x00 board and want to use the serial port, say Y
-	  to this option.  The driver can handle 1 or 2 serial ports.
-	  If unsure, say N.
+	  If you have an Au1x00 SOC based board and want to use the serial port,
+	  say Y to this option. The driver can handle up to 4 serial ports,
+	  depending on the SOC. If unsure, say N.
 
 config SERIAL_8250_RM9K
 	bool "Support for MIPS RM9xxx integrated serial port"
Index: linux-2.6/drivers/serial/Makefile
===================================================================
--- linux-2.6.orig/drivers/serial/Makefile
+++ linux-2.6/drivers/serial/Makefile
@@ -20,7 +20,6 @@ obj-$(CONFIG_SERIAL_8250_BOCA) += 8250_b
 obj-$(CONFIG_SERIAL_8250_EXAR_ST16C554) += 8250_exar_st16c554.o
 obj-$(CONFIG_SERIAL_8250_HUB6) += 8250_hub6.o
 obj-$(CONFIG_SERIAL_8250_MCA) += 8250_mca.o
-obj-$(CONFIG_SERIAL_8250_AU1X00) += 8250_au1x00.o
 obj-$(CONFIG_SERIAL_AMBA_PL010) += amba-pl010.o
 obj-$(CONFIG_SERIAL_AMBA_PL011) += amba-pl011.o
 obj-$(CONFIG_SERIAL_CLPS711X) += clps711x.o


From ralf@linux-mips.org Thu Apr  3 23:46:07 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 03 Apr 2008 23:46:29 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:22188 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S526997AbYDCVoz (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 3 Apr 2008 23:44:55 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m33Lh98E019631
	for <linux-mips@linux-mips.org>; Thu, 3 Apr 2008 14:43:14 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m33LhHQo002124;
	Thu, 3 Apr 2008 22:43:17 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m33LhGDS002123;
	Thu, 3 Apr 2008 22:43:16 +0100
Date:	Thu, 3 Apr 2008 22:43:16 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] PbAu1200: fix header breakage
Message-ID: <20080403214316.GC721@linux-mips.org>
References: <200804022353.19379.sshtylyov@ru.mvista.com> <47F4FB9A.6070005@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <47F4FB9A.6070005@ru.mvista.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18797
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 451
Lines: 12

On Thu, Apr 03, 2008 at 07:45:30PM +0400, Sergei Shtylyov wrote:

>> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
>
>    Er, the boards are called Pb1x00, not PbAu1x00, so Ralf please change 
> the summary before comitting (if you feel inclined :-).
>    (Luckily, DBAu1200 uses its own header, so it wasn't hurt by this error.)

Sorry, I already had committed the patch.  I'll fix it up in what I'm
going to send to Linus though.

  Ralf

From ralf@linux-mips.org Fri Apr  4 08:30:36 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 04 Apr 2008 08:30:40 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:26555 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S524998AbYDDGag (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 4 Apr 2008 08:30:36 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m346Sq4t031801
	for <linux-mips@linux-mips.org>; Thu, 3 Apr 2008 23:28:53 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m346TSJA013671;
	Fri, 4 Apr 2008 07:29:28 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m346TPZx013670;
	Fri, 4 Apr 2008 07:29:25 +0100
Date:	Fri, 4 Apr 2008 07:29:25 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Andrew Morton <akpm@linux-foundation.org>
Cc:	Sergei Shtylyov <sshtylyov@ru.mvista.com>,
	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Alchemy: move UART platform code to its proper place
Message-ID: <20080404062924.GA12086@linux-mips.org>
References: <200804040002.53757.sshtylyov@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200804040002.53757.sshtylyov@ru.mvista.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18802
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 8436
Lines: 253

On Fri, Apr 04, 2008 at 12:02:53AM +0400, Sergei Shtylyov wrote:

> Move the code registering the Alchemy UART platform devices from drivers/serial/
> to its proper place, into the Alchemy platform code.  Fix the related Kconfig
> entry, while at it...
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
> 
> ---
> Ralf, could you take this patch thru your queue -- it ahould apply atop of my
> former #include /extern cleanup?
> 
> I don't know how the platform code ended up accepted into the serial drivers in
> the first place -- it's high time to amend this.

Andrew, I'd like to queue this patch, ok?

  Ralf

>  drivers/serial/8250_au1x00.c       |  100 -------------------------------------
>  arch/mips/au1000/common/platform.c |   55 ++++++++++++++++++++
>  drivers/serial/Kconfig             |    8 +-
>  drivers/serial/Makefile            |    1 
>  4 files changed, 59 insertions(+), 105 deletions(-)
> 
> Index: linux-2.6/arch/mips/au1000/common/platform.c
> ===================================================================
> --- linux-2.6.orig/arch/mips/au1000/common/platform.c
> +++ linux-2.6/arch/mips/au1000/common/platform.c
> @@ -3,16 +3,63 @@
>   *
>   * Copyright 2004, Matt Porter <mporter@kernel.crashing.org>
>   *
> + * (C) Copyright Embedded Alley Solutions, Inc 2005
> + * Author: Pantelis Antoniou <pantelis@embeddedalley.com>
> + *
>   * This file is licensed under the terms of the GNU General Public
>   * License version 2.  This program is licensed "as is" without any
>   * warranty of any kind, whether express or implied.
>   */
>  
>  #include <linux/platform_device.h>
> +#include <linux/serial_8250.h>
>  #include <linux/init.h>
>  
>  #include <asm/mach-au1x00/au1xxx.h>
>  
> +#define PORT(_base, _irq)				\
> +	{						\
> +		.iobase		= _base,		\
> +		.membase	= (void __iomem *)_base,\
> +		.mapbase	= CPHYSADDR(_base),	\
> +		.irq		= _irq,			\
> +		.regshift	= 2,			\
> +		.iotype		= UPIO_AU,		\
> +		.flags		= UPF_SKIP_TEST 	\
> +	}
> +
> +static struct plat_serial8250_port au1x00_uart_data[] = {
> +#if defined(CONFIG_SOC_AU1000)
> +	PORT(UART0_ADDR, AU1000_UART0_INT),
> +	PORT(UART1_ADDR, AU1000_UART1_INT),
> +	PORT(UART2_ADDR, AU1000_UART2_INT),
> +	PORT(UART3_ADDR, AU1000_UART3_INT),
> +#elif defined(CONFIG_SOC_AU1500)
> +	PORT(UART0_ADDR, AU1500_UART0_INT),
> +	PORT(UART3_ADDR, AU1500_UART3_INT),
> +#elif defined(CONFIG_SOC_AU1100)
> +	PORT(UART0_ADDR, AU1100_UART0_INT),
> +	PORT(UART1_ADDR, AU1100_UART1_INT),
> +	PORT(UART3_ADDR, AU1100_UART3_INT),
> +#elif defined(CONFIG_SOC_AU1550)
> +	PORT(UART0_ADDR, AU1550_UART0_INT),
> +	PORT(UART1_ADDR, AU1550_UART1_INT),
> +	PORT(UART3_ADDR, AU1550_UART3_INT),
> +#elif defined(CONFIG_SOC_AU1200)
> +	PORT(UART0_ADDR, AU1200_UART0_INT),
> +	PORT(UART1_ADDR, AU1200_UART1_INT),
> +#endif
> +	{ },
> +};
> +
> +static struct platform_device au1xx0_uart_device = {
> +	.name			= "serial8250",
> +	.id			= PLAT8250_DEV_AU1X00,
> +	.dev			= {
> +		.platform_data	= au1x00_uart_data,
> +	},
> +};
> +
>  /* OHCI (USB full speed host controller) */
>  static struct resource au1xxx_usb_ohci_resources[] = {
>  	[0] = {
> @@ -287,6 +334,7 @@ static struct platform_device pbdb_smbus
>  #endif
>  
>  static struct platform_device *au1xxx_platform_devices[] __initdata = {
> +	&au1xx0_uart_device,
>  	&au1xxx_usb_ohci_device,
>  	&au1x00_pcmcia_device,
>  #ifdef CONFIG_FB_AU1100
> @@ -310,6 +358,13 @@ static struct platform_device *au1xxx_pl
>  
>  int __init au1xxx_platform_init(void)
>  {
> +	unsigned int uartclk = get_au1x00_uart_baud_base() * 16;
> +	int i;
> +
> +	/* Fill up uartclk. */
> +	for (i = 0; au1x00_uart_data[i].flags ; i++)
> +		au1x00_uart_data[i].uartclk = uartclk;
> +
>  	return platform_add_devices(au1xxx_platform_devices, ARRAY_SIZE(au1xxx_platform_devices));
>  }
>  
> Index: linux-2.6/drivers/serial/8250_au1x00.c
> ===================================================================
> --- linux-2.6.orig/drivers/serial/8250_au1x00.c
> +++ /dev/null
> @@ -1,100 +0,0 @@
> -/*
> - * Serial Device Initialisation for Au1x00
> - *
> - * (C) Copyright Embedded Alley Solutions, Inc 2005
> - * Author: Pantelis Antoniou <pantelis@embeddedalley.com>
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License as published by
> - * the Free Software Foundation; either version 2 of the License, or
> - * (at your option) any later version.
> - */
> -
> -#include <linux/errno.h>
> -#include <linux/init.h>
> -#include <linux/interrupt.h>
> -#include <linux/ioport.h>
> -#include <linux/module.h>
> -#include <linux/serial_core.h>
> -#include <linux/signal.h>
> -#include <linux/slab.h>
> -#include <linux/types.h>
> -
> -#include <linux/serial_8250.h>
> -
> -#include <asm/mach-au1x00/au1000.h>
> -
> -#include "8250.h"
> -
> -#define PORT(_base, _irq)				\
> -	{						\
> -		.iobase		= _base,		\
> -		.membase	= (void __iomem *)_base,\
> -		.mapbase	= CPHYSADDR(_base),	\
> -		.irq		= _irq,			\
> -		.uartclk	= 0,	/* filled */	\
> -		.regshift	= 2,			\
> -		.iotype		= UPIO_AU,		\
> -		.flags		= UPF_SKIP_TEST 	\
> -	}
> -
> -static struct plat_serial8250_port au1x00_data[] = {
> -#if defined(CONFIG_SOC_AU1000)
> -	PORT(UART0_ADDR, AU1000_UART0_INT),
> -	PORT(UART1_ADDR, AU1000_UART1_INT),
> -	PORT(UART2_ADDR, AU1000_UART2_INT),
> -	PORT(UART3_ADDR, AU1000_UART3_INT),
> -#elif defined(CONFIG_SOC_AU1500)
> -	PORT(UART0_ADDR, AU1500_UART0_INT),
> -	PORT(UART3_ADDR, AU1500_UART3_INT),
> -#elif defined(CONFIG_SOC_AU1100)
> -	PORT(UART0_ADDR, AU1100_UART0_INT),
> -	PORT(UART1_ADDR, AU1100_UART1_INT),
> -	/* The internal UART2 does not exist on the AU1100 processor. */
> -	PORT(UART3_ADDR, AU1100_UART3_INT),
> -#elif defined(CONFIG_SOC_AU1550)
> -	PORT(UART0_ADDR, AU1550_UART0_INT),
> -	PORT(UART1_ADDR, AU1550_UART1_INT),
> -	PORT(UART3_ADDR, AU1550_UART3_INT),
> -#elif defined(CONFIG_SOC_AU1200)
> -	PORT(UART0_ADDR, AU1200_UART0_INT),
> -	PORT(UART1_ADDR, AU1200_UART1_INT),
> -#endif
> -	{ },
> -};
> -
> -static struct platform_device au1x00_device = {
> -	.name			= "serial8250",
> -	.id			= PLAT8250_DEV_AU1X00,
> -	.dev			= {
> -		.platform_data	= au1x00_data,
> -	},
> -};
> -
> -static int __init au1x00_init(void)
> -{
> -	int i;
> -	unsigned int uartclk;
> -
> -	/* get uart clock */
> -	uartclk = get_au1x00_uart_baud_base() * 16;
> -
> -	/* fill up uartclk */
> -	for (i = 0; au1x00_data[i].flags ; i++)
> -		au1x00_data[i].uartclk = uartclk;
> -
> -	return platform_device_register(&au1x00_device);
> -}
> -
> -/* XXX: Yes, I know this doesn't yet work. */
> -static void __exit au1x00_exit(void)
> -{
> -	platform_device_unregister(&au1x00_device);
> -}
> -
> -module_init(au1x00_init);
> -module_exit(au1x00_exit);
> -
> -MODULE_AUTHOR("Pantelis Antoniou <pantelis@embeddedalley.com>");
> -MODULE_DESCRIPTION("8250 serial probe module for Au1x000 cards");
> -MODULE_LICENSE("GPL");
> Index: linux-2.6/drivers/serial/Kconfig
> ===================================================================
> --- linux-2.6.orig/drivers/serial/Kconfig
> +++ linux-2.6/drivers/serial/Kconfig
> @@ -262,12 +262,12 @@ config SERIAL_8250_ACORN
>  	  cards.  If unsure, say N.
>  
>  config SERIAL_8250_AU1X00
> -	bool "AU1X00 serial port support"
> +	bool "Au1x00 serial port support"
>  	depends on SERIAL_8250 != n && SOC_AU1X00
>  	help
> -	  If you have an Au1x00 board and want to use the serial port, say Y
> -	  to this option.  The driver can handle 1 or 2 serial ports.
> -	  If unsure, say N.
> +	  If you have an Au1x00 SOC based board and want to use the serial port,
> +	  say Y to this option. The driver can handle up to 4 serial ports,
> +	  depending on the SOC. If unsure, say N.
>  
>  config SERIAL_8250_RM9K
>  	bool "Support for MIPS RM9xxx integrated serial port"
> Index: linux-2.6/drivers/serial/Makefile
> ===================================================================
> --- linux-2.6.orig/drivers/serial/Makefile
> +++ linux-2.6/drivers/serial/Makefile
> @@ -20,7 +20,6 @@ obj-$(CONFIG_SERIAL_8250_BOCA) += 8250_b
>  obj-$(CONFIG_SERIAL_8250_EXAR_ST16C554) += 8250_exar_st16c554.o
>  obj-$(CONFIG_SERIAL_8250_HUB6) += 8250_hub6.o
>  obj-$(CONFIG_SERIAL_8250_MCA) += 8250_mca.o
> -obj-$(CONFIG_SERIAL_8250_AU1X00) += 8250_au1x00.o
>  obj-$(CONFIG_SERIAL_AMBA_PL010) += amba-pl010.o
>  obj-$(CONFIG_SERIAL_AMBA_PL011) += amba-pl011.o
>  obj-$(CONFIG_SERIAL_CLPS711X) += clps711x.o

From akpm@linux-foundation.org Fri Apr  4 08:41:36 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 04 Apr 2008 08:41:41 +0200 (CEST)
Received: from smtp1.linux-foundation.org ([140.211.169.13]:36517 "EHLO
	smtp1.linux-foundation.org") by lappi.linux-mips.net with ESMTP
	id S525092AbYDDGlg (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 4 Apr 2008 08:41:36 +0200
Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55])
	by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id m346euVd013763
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 3 Apr 2008 23:40:57 -0700
Received: from y.localdomain (localhost [127.0.0.1])
	by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with SMTP id m346Yejc009935;
	Thu, 3 Apr 2008 23:34:40 -0700
Date:	Thu, 3 Apr 2008 23:34:40 -0700
From:	Andrew Morton <akpm@linux-foundation.org>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	Sergei Shtylyov <sshtylyov@ru.mvista.com>,
	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Alchemy: move UART platform code to its proper place
Message-Id: <20080403233440.9b920466.akpm@linux-foundation.org>
In-Reply-To: <20080404062924.GA12086@linux-mips.org>
References: <200804040002.53757.sshtylyov@ru.mvista.com>
	<20080404062924.GA12086@linux-mips.org>
X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.5; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-MIMEDefang-Filter: lf$Revision: 1.188 $
X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13
Return-Path: <akpm@linux-foundation.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18803
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: akpm@linux-foundation.org
Precedence: bulk
X-list: linux-mips
Content-Length: 735
Lines: 20

On Fri, 4 Apr 2008 07:29:25 +0100 Ralf Baechle <ralf@linux-mips.org> wrote:

> On Fri, Apr 04, 2008 at 12:02:53AM +0400, Sergei Shtylyov wrote:
> 
> > Move the code registering the Alchemy UART platform devices from drivers/serial/
> > to its proper place, into the Alchemy platform code.  Fix the related Kconfig
> > entry, while at it...
> > 
> > Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
> > 
> > ---
> > Ralf, could you take this patch thru your queue -- it ahould apply atop of my
> > former #include /extern cleanup?
> > 
> > I don't know how the platform code ended up accepted into the serial drivers in
> > the first place -- it's high time to amend this.
> 
> Andrew, I'd like to queue this patch, ok?

Sure..

From ncoesel@DEALogic.nl Fri Apr  4 09:11:52 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 04 Apr 2008 09:11:57 +0200 (CEST)
Received: from smtp-vbr12.xs4all.nl ([194.109.24.32]:7944 "EHLO
	smtp-vbr12.xs4all.nl") by lappi.linux-mips.net with ESMTP
	id S525882AbYDDHLw convert rfc822-to-8bit (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 4 Apr 2008 09:11:52 +0200
Received: from dealogic.nl (a62-251-87-113.adsl.xs4all.nl [62.251.87.113])
	by smtp-vbr12.xs4all.nl (8.13.8/8.13.8) with ESMTP id m347B4IE009580
	for <linux-mips@linux-mips.org>; Fri, 4 Apr 2008 09:11:21 +0200 (CEST)
	(envelope-from ncoesel@DEALogic.nl)
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 8BIT
Subject: RE: [PATCH] Fix xss1500 compilation
Date:	Fri, 4 Apr 2008 09:06:29 +0200
Message-ID: <19CA9E279FDA5246B7D7A1C91A4AF7F40EFAA3@dealogicserver.DEALogic.nl>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [PATCH] Fix xss1500 compilation
thread-index: AciVwPeSIL8Q3NchQmO23q+AJU8R/QAYAQEA
From:	"Nico Coesel" <ncoesel@DEALogic.nl>
To:	<linux-mips@linux-mips.org>
X-Virus-Scanned: by XS4ALL Virus Scanner
Return-Path: <ncoesel@DEALogic.nl>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18804
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ncoesel@DEALogic.nl
Precedence: bulk
X-list: linux-mips
Content-Length: 2007
Lines: 59

I just looked at some other AU1x00 PCMCIA drivers. My guess is that if
someone wants to use PCMCIA on the XXS1500 board it is pretty simple to
create a new driver based on the pb1x00 or db1x00 board drivers
-assuming these work and compile well-.

Nico Coesel

> -----Oorspronkelijk bericht-----
> Van: linux-mips-bounce@linux-mips.org 
> [mailto:linux-mips-bounce@linux-mips.org] Namens Adrian Bunk
> Verzonden: dinsdag 1 april 2008 17:55
> Aan: Florian Fainelli
> CC: linux-mips@linux-mips.org; ralf@linux-mips.org
> Onderwerp: Re: [PATCH] Fix xss1500 compilation
> 
> On Tue, Apr 01, 2008 at 03:53:25PM +0200, Florian Fainelli wrote:
> > This patch fixes the compilation of the Au1000 XSS1500  board setup 
> >and irqmap code.
> >...
> 
> Another compile error for this platform is:
> 
> <--  snip  -->
> 
> ...
>   CC [M]  drivers/pcmcia/au1000_xxs1500.o
> /tmp/linux-2.6.25-rc7/drivers/pcmcia/au1000_xxs1500.c:33:26: 
> error: linux/tqueue.h: No such file or directory
> /tmp/linux-2.6.25-rc7/drivers/pcmcia/au1000_xxs1500.c:44:28: 
> error: pcmcia/bus_ops.h: No such file or directory
> /tmp/linux-2.6.25-rc7/drivers/pcmcia/au1000_xxs1500.c:51:24: 
> error: asm/au1000.h: No such file or directory
> /tmp/linux-2.6.25-rc7/drivers/pcmcia/au1000_xxs1500.c:52:31: 
> error: asm/au1000_pcmcia.h: No such file or directory ...
> make[3]: *** [drivers/pcmcia/au1000_xxs1500.o] Error 1
> 
> <--  snip  -->
> 
> include/linux/tqueue.h was removed on Sep 30, 2002 (sic) 
> which was even before 2.6.0 .
> 
> Obviously no 2.6 kernel ever ran on these boards.
> 
> If you have such a board and want to run kernel 2.6 on it 
> that's fine with me, but otherwise i don't see much point in 
> keeping the support for this board.
> 
> cu
> Adrian
> 
> -- 
> 
>        "Is there not promise of rain?" Ling Tan asked suddenly out
>         of the darkness. There had been need of rain for many days.
>        "Only a promise," Lao Er said.
>                                        Pearl S. Buck - Dragon Seed
> 
> 
> 

From ralf@linux-mips.org Fri Apr  4 09:20:57 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 04 Apr 2008 09:21:01 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:27345 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S525982AbYDDHU5 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 4 Apr 2008 09:20:57 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m347JFoH015131
	for <linux-mips@linux-mips.org>; Fri, 4 Apr 2008 00:19:15 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m347JoUB023915;
	Fri, 4 Apr 2008 08:19:50 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m347Jocm023914;
	Fri, 4 Apr 2008 08:19:50 +0100
Date:	Fri, 4 Apr 2008 08:19:50 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
Cc:	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/5] [MIPS] unexport copy_user_highpage()
Message-ID: <20080404071950.GB12086@linux-mips.org>
References: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com> <1207094318-21748-2-git-send-email-dmitri.vorobiev@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1207094318-21748-2-git-send-email-dmitri.vorobiev@gmail.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18805
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 345
Lines: 11

On Wed, Apr 02, 2008 at 03:58:34AM +0400, Dmitri Vorobiev wrote:

> The copy_user_highpage() routine has no users outside of the
> core kernel code, so exporting this symbol is pointless.
> This patch removes EXPORT_SYMBOL(copy_user_highpage).
> 
> Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>

Queued for 2.6.26.  Thanks,

  Ralf

From ralf@linux-mips.org Fri Apr  4 09:21:32 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 04 Apr 2008 09:21:36 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:28625 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S526199AbYDDHVI (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 4 Apr 2008 09:21:08 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m347JQ6T015175
	for <linux-mips@linux-mips.org>; Fri, 4 Apr 2008 00:19:27 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m347K1f7023921;
	Fri, 4 Apr 2008 08:20:01 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m347K1un023920;
	Fri, 4 Apr 2008 08:20:01 +0100
Date:	Fri, 4 Apr 2008 08:20:01 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
Cc:	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/5] [MIPS] unexport copy_to_user_page()
Message-ID: <20080404072001.GC12086@linux-mips.org>
References: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com> <1207094318-21748-3-git-send-email-dmitri.vorobiev@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1207094318-21748-3-git-send-email-dmitri.vorobiev@gmail.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18806
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 341
Lines: 11

On Wed, Apr 02, 2008 at 03:58:35AM +0400, Dmitri Vorobiev wrote:

> The copy_to_user_page() function is called only in the core kernel
> code. Therefore, there is no need to export it. This patch removes
> EXPORT_SYMBOL(copy_to_user_page).
> 
> Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>

Queued for 2.6.26.  Thanks,

  Ralf

From ralf@linux-mips.org Fri Apr  4 09:22:23 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 04 Apr 2008 09:22:30 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:30161 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S526214AbYDDHVS (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 4 Apr 2008 09:21:18 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m347JbsN015248
	for <linux-mips@linux-mips.org>; Fri, 4 Apr 2008 00:19:38 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m347KBwD023937;
	Fri, 4 Apr 2008 08:20:11 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m347KB9d023936;
	Fri, 4 Apr 2008 08:20:11 +0100
Date:	Fri, 4 Apr 2008 08:20:11 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
Cc:	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] [MIPS] unexport copy_from_user_page()
Message-ID: <20080404072011.GD12086@linux-mips.org>
References: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com> <1207094318-21748-4-git-send-email-dmitri.vorobiev@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1207094318-21748-4-git-send-email-dmitri.vorobiev@gmail.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18807
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 344
Lines: 11

On Wed, Apr 02, 2008 at 03:58:36AM +0400, Dmitri Vorobiev wrote:

> No users for the copy_from_user_page() routine exist outside of the
> core kernel code. Therefore, EXPORT_SYMBOL(copy_from_user_page) is
> useless, and this patch removes it.
> 
> Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>

Queued for 2.6.26.  Thanks,

  Ralf

From ralf@linux-mips.org Fri Apr  4 09:23:24 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 04 Apr 2008 09:23:32 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:30417 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S526225AbYDDHVZ (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 4 Apr 2008 09:21:25 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m347Jidp015281
	for <linux-mips@linux-mips.org>; Fri, 4 Apr 2008 00:19:45 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m347KK8n023950;
	Fri, 4 Apr 2008 08:20:20 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m347KKsr023949;
	Fri, 4 Apr 2008 08:20:20 +0100
Date:	Fri, 4 Apr 2008 08:20:20 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
Cc:	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] [MIPS] unexport rtc_mips_set_time()
Message-ID: <20080404072020.GE12086@linux-mips.org>
References: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com> <1207094318-21748-5-git-send-email-dmitri.vorobiev@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1207094318-21748-5-git-send-email-dmitri.vorobiev@gmail.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18808
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 340
Lines: 11

On Wed, Apr 02, 2008 at 03:58:37AM +0400, Dmitri Vorobiev wrote:

> No users for the rtc_mips_set_time() routine exist outside of the
> core kernel code. Therefore, EXPORT_SYMBOL(rtc_mips_set_time) is
> useless, and this patch removes it.
> 
> Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>

Queued for 2.6.26.  Thanks,

  Ralf

From ralf@linux-mips.org Fri Apr  4 09:24:30 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 04 Apr 2008 09:24:36 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:37841 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S526236AbYDDHWA (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 4 Apr 2008 09:22:00 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m347KF6f015363
	for <linux-mips@linux-mips.org>; Fri, 4 Apr 2008 00:20:16 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m347KmvY023956;
	Fri, 4 Apr 2008 08:20:48 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m347Km4c023955;
	Fri, 4 Apr 2008 08:20:48 +0100
Date:	Fri, 4 Apr 2008 08:20:48 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
Cc:	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/5] [MIPS] unexport null_perf_irq() and make it static
Message-ID: <20080404072048.GF12086@linux-mips.org>
References: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com> <1207094318-21748-6-git-send-email-dmitri.vorobiev@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1207094318-21748-6-git-send-email-dmitri.vorobiev@gmail.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18809
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 298
Lines: 10

On Wed, Apr 02, 2008 at 03:58:38AM +0400, Dmitri Vorobiev wrote:

> This patch unexports the null_perf_irq() symbol, and simultaneously
> makes this function static.
> 
> Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>

Queued for 2.6.26 with your static fix folded in.  Thanks,

  Ralf

From sshtylyov@ru.mvista.com Fri Apr  4 15:23:10 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 04 Apr 2008 15:23:20 +0200 (CEST)
Received: from h155.mvista.com ([63.81.120.155]:41462 "EHLO imap.sh.mvista.com")
	by lappi.linux-mips.net with ESMTP id S527924AbYDDNXK (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 4 Apr 2008 15:23:10 +0200
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id 0B54A3EC9; Fri,  4 Apr 2008 06:22:25 -0700 (PDT)
Message-ID: <47F62B66.6040908@ru.mvista.com>
Date:	Fri, 04 Apr 2008 17:21:42 +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 Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] PbAu1200: fix header breakage
References: <200804022353.19379.sshtylyov@ru.mvista.com> <47F4FB9A.6070005@ru.mvista.com> <20080403214316.GC721@linux-mips.org>
In-Reply-To: <20080403214316.GC721@linux-mips.org>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18813
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 538
Lines: 17

Ralf Baechle wrote:

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

>>   Er, the boards are called Pb1x00, not PbAu1x00, so Ralf please change 
>>the summary before comitting (if you feel inclined :-).
>>   (Luckily, DBAu1200 uses its own header, so it wasn't hurt by this error.)

> Sorry, I already had committed the patch.  I'll fix it up in what I'm
> going to send to Linus though.

    Er, thanks. May I also ask you to pickup the "Make KGDB compile on UP" 
patch which I psted 2 weeks ago? :-)

>   Ralf

WBR, Sergei

From sshtylyov@ru.mvista.com Fri Apr  4 15:35:01 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 04 Apr 2008 15:35:09 +0200 (CEST)
Received: from rtsoft3.corbina.net ([85.21.88.6]:28788 "EHLO
	buildserver.ru.mvista.com") by lappi.linux-mips.net with ESMTP
	id S527951AbYDDNfA (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 4 Apr 2008 15:35:00 +0200
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id 0B6228810; Fri,  4 Apr 2008 19:34:48 +0500 (SAMST)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	ralf@linux-mips.org
Subject: [PATCH] Alchemy: move UART platform code to its proper place (take 2)
Date:	Fri, 4 Apr 2008 17:33:45 +0400
User-Agent: KMail/1.5
Cc:	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <200804041733.45170.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18814
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 7968
Lines: 251

Move the code registering the Alchemy UART platform devices from drivers/serial
to its proper place, into the Alchemy platform code.  Fix the related Kconfig
entry, while at it...

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

---
Note that we don't register UART platform devices if CONFIG_SERIAL_8250_AU1X00
is defined (the same way that the old code behaved) since if the 8250.c driver
is built without this option, it won't be able to correctly access the Alchemy
UART registers.

Ralf, please update the patch in your queue...

 drivers/serial/8250_au1x00.c       |  100 -------------------------------------
 arch/mips/au1000/common/platform.c |   57 +++++++++++++++++++++
 drivers/serial/Kconfig             |    8 +-
 drivers/serial/Makefile            |    1 
 4 files changed, 61 insertions(+), 105 deletions(-)

Index: linux-2.6/arch/mips/au1000/common/platform.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/platform.c
+++ linux-2.6/arch/mips/au1000/common/platform.c
@@ -3,16 +3,65 @@
  *
  * Copyright 2004, Matt Porter <mporter@kernel.crashing.org>
  *
+ * (C) Copyright Embedded Alley Solutions, Inc 2005
+ * Author: Pantelis Antoniou <pantelis@embeddedalley.com>
+ *
  * This file is licensed under the terms of the GNU General Public
  * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
 
 #include <linux/platform_device.h>
+#include <linux/serial_8250.h>
 #include <linux/init.h>
 
 #include <asm/mach-au1x00/au1xxx.h>
 
+#define PORT(_base, _irq)				\
+	{						\
+		.iobase		= _base,		\
+		.membase	= (void __iomem *)_base,\
+		.mapbase	= CPHYSADDR(_base),	\
+		.irq		= _irq,			\
+		.regshift	= 2,			\
+		.iotype		= UPIO_AU,		\
+		.flags		= UPF_SKIP_TEST 	\
+	}
+
+static struct plat_serial8250_port au1x00_uart_data[] = {
+#if defined(CONFIG_SERIAL_8250_AU1X00)
+#if defined(CONFIG_SOC_AU1000)
+	PORT(UART0_ADDR, AU1000_UART0_INT),
+	PORT(UART1_ADDR, AU1000_UART1_INT),
+	PORT(UART2_ADDR, AU1000_UART2_INT),
+	PORT(UART3_ADDR, AU1000_UART3_INT),
+#elif defined(CONFIG_SOC_AU1500)
+	PORT(UART0_ADDR, AU1500_UART0_INT),
+	PORT(UART3_ADDR, AU1500_UART3_INT),
+#elif defined(CONFIG_SOC_AU1100)
+	PORT(UART0_ADDR, AU1100_UART0_INT),
+	PORT(UART1_ADDR, AU1100_UART1_INT),
+	PORT(UART3_ADDR, AU1100_UART3_INT),
+#elif defined(CONFIG_SOC_AU1550)
+	PORT(UART0_ADDR, AU1550_UART0_INT),
+	PORT(UART1_ADDR, AU1550_UART1_INT),
+	PORT(UART3_ADDR, AU1550_UART3_INT),
+#elif defined(CONFIG_SOC_AU1200)
+	PORT(UART0_ADDR, AU1200_UART0_INT),
+	PORT(UART1_ADDR, AU1200_UART1_INT),
+#endif
+#endif	/* CONFIG_SERIAL_8250_AU1X00 */
+	{ },
+};
+
+static struct platform_device au1xx0_uart_device = {
+	.name			= "serial8250",
+	.id			= PLAT8250_DEV_AU1X00,
+	.dev			= {
+		.platform_data	= au1x00_uart_data,
+	},
+};
+
 /* OHCI (USB full speed host controller) */
 static struct resource au1xxx_usb_ohci_resources[] = {
 	[0] = {
@@ -287,6 +336,7 @@ static struct platform_device pbdb_smbus
 #endif
 
 static struct platform_device *au1xxx_platform_devices[] __initdata = {
+	&au1xx0_uart_device,
 	&au1xxx_usb_ohci_device,
 	&au1x00_pcmcia_device,
 #ifdef CONFIG_FB_AU1100
@@ -310,6 +360,13 @@ static struct platform_device *au1xxx_pl
 
 int __init au1xxx_platform_init(void)
 {
+	unsigned int uartclk = get_au1x00_uart_baud_base() * 16;
+	int i;
+
+	/* Fill up uartclk. */
+	for (i = 0; au1x00_uart_data[i].flags ; i++)
+		au1x00_uart_data[i].uartclk = uartclk;
+
 	return platform_add_devices(au1xxx_platform_devices, ARRAY_SIZE(au1xxx_platform_devices));
 }
 
Index: linux-2.6/drivers/serial/8250_au1x00.c
===================================================================
--- linux-2.6.orig/drivers/serial/8250_au1x00.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Serial Device Initialisation for Au1x00
- *
- * (C) Copyright Embedded Alley Solutions, Inc 2005
- * Author: Pantelis Antoniou <pantelis@embeddedalley.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#include <linux/errno.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/ioport.h>
-#include <linux/module.h>
-#include <linux/serial_core.h>
-#include <linux/signal.h>
-#include <linux/slab.h>
-#include <linux/types.h>
-
-#include <linux/serial_8250.h>
-
-#include <asm/mach-au1x00/au1000.h>
-
-#include "8250.h"
-
-#define PORT(_base, _irq)				\
-	{						\
-		.iobase		= _base,		\
-		.membase	= (void __iomem *)_base,\
-		.mapbase	= CPHYSADDR(_base),	\
-		.irq		= _irq,			\
-		.uartclk	= 0,	/* filled */	\
-		.regshift	= 2,			\
-		.iotype		= UPIO_AU,		\
-		.flags		= UPF_SKIP_TEST 	\
-	}
-
-static struct plat_serial8250_port au1x00_data[] = {
-#if defined(CONFIG_SOC_AU1000)
-	PORT(UART0_ADDR, AU1000_UART0_INT),
-	PORT(UART1_ADDR, AU1000_UART1_INT),
-	PORT(UART2_ADDR, AU1000_UART2_INT),
-	PORT(UART3_ADDR, AU1000_UART3_INT),
-#elif defined(CONFIG_SOC_AU1500)
-	PORT(UART0_ADDR, AU1500_UART0_INT),
-	PORT(UART3_ADDR, AU1500_UART3_INT),
-#elif defined(CONFIG_SOC_AU1100)
-	PORT(UART0_ADDR, AU1100_UART0_INT),
-	PORT(UART1_ADDR, AU1100_UART1_INT),
-	/* The internal UART2 does not exist on the AU1100 processor. */
-	PORT(UART3_ADDR, AU1100_UART3_INT),
-#elif defined(CONFIG_SOC_AU1550)
-	PORT(UART0_ADDR, AU1550_UART0_INT),
-	PORT(UART1_ADDR, AU1550_UART1_INT),
-	PORT(UART3_ADDR, AU1550_UART3_INT),
-#elif defined(CONFIG_SOC_AU1200)
-	PORT(UART0_ADDR, AU1200_UART0_INT),
-	PORT(UART1_ADDR, AU1200_UART1_INT),
-#endif
-	{ },
-};
-
-static struct platform_device au1x00_device = {
-	.name			= "serial8250",
-	.id			= PLAT8250_DEV_AU1X00,
-	.dev			= {
-		.platform_data	= au1x00_data,
-	},
-};
-
-static int __init au1x00_init(void)
-{
-	int i;
-	unsigned int uartclk;
-
-	/* get uart clock */
-	uartclk = get_au1x00_uart_baud_base() * 16;
-
-	/* fill up uartclk */
-	for (i = 0; au1x00_data[i].flags ; i++)
-		au1x00_data[i].uartclk = uartclk;
-
-	return platform_device_register(&au1x00_device);
-}
-
-/* XXX: Yes, I know this doesn't yet work. */
-static void __exit au1x00_exit(void)
-{
-	platform_device_unregister(&au1x00_device);
-}
-
-module_init(au1x00_init);
-module_exit(au1x00_exit);
-
-MODULE_AUTHOR("Pantelis Antoniou <pantelis@embeddedalley.com>");
-MODULE_DESCRIPTION("8250 serial probe module for Au1x000 cards");
-MODULE_LICENSE("GPL");
Index: linux-2.6/drivers/serial/Kconfig
===================================================================
--- linux-2.6.orig/drivers/serial/Kconfig
+++ linux-2.6/drivers/serial/Kconfig
@@ -262,12 +262,12 @@ config SERIAL_8250_ACORN
 	  cards.  If unsure, say N.
 
 config SERIAL_8250_AU1X00
-	bool "AU1X00 serial port support"
+	bool "Au1x00 serial port support"
 	depends on SERIAL_8250 != n && SOC_AU1X00
 	help
-	  If you have an Au1x00 board and want to use the serial port, say Y
-	  to this option.  The driver can handle 1 or 2 serial ports.
-	  If unsure, say N.
+	  If you have an Au1x00 SOC based board and want to use the serial port,
+	  say Y to this option. The driver can handle up to 4 serial ports,
+	  depending on the SOC. If unsure, say N.
 
 config SERIAL_8250_RM9K
 	bool "Support for MIPS RM9xxx integrated serial port"
Index: linux-2.6/drivers/serial/Makefile
===================================================================
--- linux-2.6.orig/drivers/serial/Makefile
+++ linux-2.6/drivers/serial/Makefile
@@ -20,7 +20,6 @@ obj-$(CONFIG_SERIAL_8250_BOCA) += 8250_b
 obj-$(CONFIG_SERIAL_8250_EXAR_ST16C554) += 8250_exar_st16c554.o
 obj-$(CONFIG_SERIAL_8250_HUB6) += 8250_hub6.o
 obj-$(CONFIG_SERIAL_8250_MCA) += 8250_mca.o
-obj-$(CONFIG_SERIAL_8250_AU1X00) += 8250_au1x00.o
 obj-$(CONFIG_SERIAL_AMBA_PL010) += amba-pl010.o
 obj-$(CONFIG_SERIAL_AMBA_PL011) += amba-pl011.o
 obj-$(CONFIG_SERIAL_CLPS711X) += clps711x.o


From anemo@mba.ocn.ne.jp Fri Apr  4 17:55:59 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 04 Apr 2008 17:56:03 +0200 (CEST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:16607 "EHLO smtp.mba.ocn.ne.jp")
	by lappi.linux-mips.net with ESMTP id S529355AbYDDPz6 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 4 Apr 2008 17:55:58 +0200
Received: from localhost (p2014-ipad306funabasi.chiba.ocn.ne.jp [123.217.172.14])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id E4291AB76; Sat,  5 Apr 2008 00:54:36 +0900 (JST)
Date:	Sat, 05 Apr 2008 00:55:24 +0900 (JST)
Message-Id: <20080405.005524.108306693.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH 1/4] make fallback gpio.h gpiolib-friendly
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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18815
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 1060
Lines: 30

If gpiolib was selected, asm-generic/gpio.h provides some prototypes
for gpio API and implementation helpers.  With this patch, platform
code can implement its GPIO API using gpiolib without custom gpio.h
file.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
diff --git a/include/asm-mips/mach-generic/gpio.h b/include/asm-mips/mach-generic/gpio.h
index 6eaf5ef..e6b376b 100644
--- a/include/asm-mips/mach-generic/gpio.h
+++ b/include/asm-mips/mach-generic/gpio.h
@@ -1,12 +1,18 @@
 #ifndef __ASM_MACH_GENERIC_GPIO_H
 #define __ASM_MACH_GENERIC_GPIO_H
 
+#ifdef CONFIG_HAVE_GPIO_LIB
+#define gpio_get_value	__gpio_get_value
+#define gpio_set_value	__gpio_set_value
+#define gpio_cansleep	__gpio_cansleep
+#else
 int gpio_request(unsigned gpio, const char *label);
 void gpio_free(unsigned gpio);
 int gpio_direction_input(unsigned gpio);
 int gpio_direction_output(unsigned gpio, int value);
 int gpio_get_value(unsigned gpio);
 void gpio_set_value(unsigned gpio, int value);
+#endif
 int gpio_to_irq(unsigned gpio);
 int irq_to_gpio(unsigned irq);
 

From anemo@mba.ocn.ne.jp Fri Apr  4 17:56:35 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 04 Apr 2008 17:56:39 +0200 (CEST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:20963 "EHLO smtp.mba.ocn.ne.jp")
	by lappi.linux-mips.net with ESMTP id S529372AbYDDP4O (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 4 Apr 2008 17:56:14 +0200
Received: from localhost (p2014-ipad306funabasi.chiba.ocn.ne.jp [123.217.172.14])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 86063AA8C; Sat,  5 Apr 2008 00:54:53 +0900 (JST)
Date:	Sat, 05 Apr 2008 00:55:41 +0900 (JST)
Message-Id: <20080405.005541.92586328.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH 2/4] generic txx9 gpio support
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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18816
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 4346
Lines: 167

This is a board-independent TXx9 gpio API implementation using gpiolib.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
 arch/mips/Kconfig            |    5 ++
 arch/mips/kernel/Makefile    |    2 +
 arch/mips/kernel/gpio_txx9.c |   87 ++++++++++++++++++++++++++++++++++++++++++
 include/asm-mips/txx9pio.h   |   29 ++++++++++++++
 4 files changed, 123 insertions(+), 0 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 8724ed3..d06e204 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -788,6 +788,11 @@ config CSRC_R4K
 config CSRC_SB1250
 	bool
 
+config GPIO_TXX9
+	select GENERIC_GPIO
+	select HAVE_GPIO_LIB
+	bool
+
 config CFE
 	bool
 
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index 9e78e1a..1eaf012 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -77,6 +77,8 @@ obj-$(CONFIG_64BIT)		+= cpu-bugs64.o
 
 obj-$(CONFIG_I8253)		+= i8253.o
 
+obj-$(CONFIG_GPIO_TXX9)		+= gpio_txx9.o
+
 obj-$(CONFIG_KEXEC)		+= machine_kexec.o relocate_kernel.o
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
diff --git a/arch/mips/kernel/gpio_txx9.c b/arch/mips/kernel/gpio_txx9.c
new file mode 100644
index 0000000..b1436a8
--- /dev/null
+++ b/arch/mips/kernel/gpio_txx9.c
@@ -0,0 +1,87 @@
+/*
+ * A gpio chip driver for TXx9 SoCs
+ *
+ * Copyright (C) 2008 Atsushi Nemoto <anemo@mba.ocn.ne.jp>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/spinlock.h>
+#include <linux/gpio.h>
+#include <linux/errno.h>
+#include <linux/io.h>
+#include <asm/txx9pio.h>
+
+static DEFINE_SPINLOCK(txx9_gpio_lock);
+
+static struct txx9_pio_reg __iomem *txx9_pioptr;
+
+static int txx9_gpio_get(struct gpio_chip *chip, unsigned int offset)
+{
+	return __raw_readl(&txx9_pioptr->din) & (1 << offset);
+}
+
+static void txx9_gpio_set_raw(unsigned int offset, int value)
+{
+	u32 val;
+	val = __raw_readl(&txx9_pioptr->dout);
+	if (value)
+		val |= 1 << offset;
+	else
+		val &= ~(1 << offset);
+	__raw_writel(val, &txx9_pioptr->dout);
+}
+
+static void txx9_gpio_set(struct gpio_chip *chip, unsigned int offset,
+			  int value)
+{
+	unsigned long flags;
+	spin_lock_irqsave(&txx9_gpio_lock, flags);
+	txx9_gpio_set_raw(offset, value);
+	mmiowb();
+	spin_unlock_irqrestore(&txx9_gpio_lock, flags);
+}
+
+static int txx9_gpio_dir_in(struct gpio_chip *chip, unsigned int offset)
+{
+	spin_lock_irq(&txx9_gpio_lock);
+	__raw_writel(__raw_readl(&txx9_pioptr->dir) & ~(1 << offset),
+		     &txx9_pioptr->dir);
+	mmiowb();
+	spin_unlock_irq(&txx9_gpio_lock);
+	return 0;
+}
+
+static int txx9_gpio_dir_out(struct gpio_chip *chip, unsigned int offset,
+			     int value)
+{
+	spin_lock_irq(&txx9_gpio_lock);
+	txx9_gpio_set_raw(offset, value);
+	__raw_writel(__raw_readl(&txx9_pioptr->dir) | (1 << offset),
+		     &txx9_pioptr->dir);
+	mmiowb();
+	spin_unlock_irq(&txx9_gpio_lock);
+	return 0;
+}
+
+static struct gpio_chip txx9_gpio_chip = {
+	.get = txx9_gpio_get,
+	.set = txx9_gpio_set,
+	.direction_input = txx9_gpio_dir_in,
+	.direction_output = txx9_gpio_dir_out,
+	.label = "TXx9",
+};
+
+int __init txx9_gpio_init(unsigned long baseaddr,
+			  unsigned int base, unsigned int num)
+{
+	txx9_pioptr = ioremap(baseaddr, sizeof(struct txx9_pio_reg));
+	if (!txx9_pioptr)
+		return -ENODEV;
+	txx9_gpio_chip.base = base;
+	txx9_gpio_chip.ngpio = num;
+	return gpiochip_add(&txx9_gpio_chip);
+}
diff --git a/include/asm-mips/txx9pio.h b/include/asm-mips/txx9pio.h
new file mode 100644
index 0000000..3d6fa9f
--- /dev/null
+++ b/include/asm-mips/txx9pio.h
@@ -0,0 +1,29 @@
+/*
+ * include/asm-mips/txx9pio.h
+ * TX39/TX49 PIO controller definitions.
+ *
+ * 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.
+ */
+#ifndef __ASM_TXX9PIO_H
+#define __ASM_TXX9PIO_H
+
+#include <linux/types.h>
+
+struct txx9_pio_reg {
+	__u32 dout;
+	__u32 din;
+	__u32 dir;
+	__u32 od;
+	__u32 flag[2];
+	__u32 pol;
+	__u32 intc;
+	__u32 maskcpu;
+	__u32 maskext;
+};
+
+int txx9_gpio_init(unsigned long baseaddr,
+		   unsigned int base, unsigned int num);
+
+#endif /* __ASM_TXX9PIO_H */

From anemo@mba.ocn.ne.jp Fri Apr  4 17:57:20 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 04 Apr 2008 17:57:27 +0200 (CEST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:32489 "EHLO smtp.mba.ocn.ne.jp")
	by lappi.linux-mips.net with ESMTP id S529355AbYDDP4l (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 4 Apr 2008 17:56:41 +0200
Received: from localhost (p2014-ipad306funabasi.chiba.ocn.ne.jp [123.217.172.14])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id A43D3AB7C; Sat,  5 Apr 2008 00:55:21 +0900 (JST)
Date:	Sat, 05 Apr 2008 00:56:09 +0900 (JST)
Message-Id: <20080405.005609.104641118.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH 3/4] rbhma4500: use generic txx9 gpio
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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18817
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 7134
Lines: 254

Use generic txx9 gpio (and gpiolib) for RBHMA4500 board.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
 arch/mips/Kconfig                         |    2 +-
 arch/mips/tx4938/toshiba_rbtx4938/setup.c |  133 ++++++++++-------------------
 include/asm-mips/tx4938/tx4938.h          |   14 +---
 3 files changed, 46 insertions(+), 103 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index d06e204..340a31d 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -653,7 +653,7 @@ config TOSHIBA_RBTX4938
 	select SYS_SUPPORTS_BIG_ENDIAN
 	select SYS_SUPPORTS_KGDB
 	select GENERIC_HARDIRQS_NO__DO_IRQ
-	select GENERIC_GPIO
+	select GPIO_TXX9
 	help
 	  This Toshiba board is based on the TX4938 processor. Say Y here to
 	  support this machine type
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/setup.c b/arch/mips/tx4938/toshiba_rbtx4938/setup.c
index 61249f0..b38ea5a 100644
--- a/arch/mips/tx4938/toshiba_rbtx4938/setup.c
+++ b/arch/mips/tx4938/toshiba_rbtx4938/setup.c
@@ -21,6 +21,7 @@
 #include <linux/pm.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
+#include <linux/gpio.h>
 
 #include <asm/wbflush.h>
 #include <asm/reboot.h>
@@ -34,7 +35,7 @@
 #endif
 #include <linux/spi/spi.h>
 #include <asm/tx4938/spi.h>
-#include <asm/gpio.h>
+#include <asm/txx9pio.h>
 
 extern char * __init prom_getcmdline(void);
 static inline void tx4938_report_pcic_status1(struct tx4938_pcic_reg *pcicptr);
@@ -615,9 +616,6 @@ static void __init rbtx4938_spi_setup(void)
 {
 	/* set SPI_SEL */
 	tx4938_ccfgptr->pcfg |= TX4938_PCFG_SPI_SEL;
-	/* chip selects for SPI devices */
-	tx4938_pioptr->dout |= (1 << SEEPROM1_CS);
-	tx4938_pioptr->dir |= (1 << SEEPROM1_CS);
 }
 
 static struct resource rbtx4938_fpga_resource;
@@ -780,8 +778,8 @@ void __init tx4938_board_setup(void)
 	TX4938_WR64(0xff1fb950, TX4938_DMA_MCR_MSTEN);
 
 	/* PIO */
-	tx4938_pioptr->maskcpu = 0;
-	tx4938_pioptr->maskext = 0;
+	__raw_writel(0, &tx4938_pioptr->maskcpu);
+	__raw_writel(0, &tx4938_pioptr->maskext);
 
 	/* TX4938 internal registers */
 	if (request_resource(&iomem_resource, &tx4938_reg_resource))
@@ -984,106 +982,48 @@ device_initcall(rbtx4938_ne_init);
 
 /* GPIO support */
 
+int gpio_to_irq(unsigned gpio)
+{
+	return -EINVAL;
+}
+
+int irq_to_gpio(unsigned irq)
+{
+	return -EINVAL;
+}
+
 static DEFINE_SPINLOCK(rbtx4938_spi_gpio_lock);
 
-static void rbtx4938_spi_gpio_set(unsigned gpio, int value)
+static void rbtx4938_spi_gpio_set(struct gpio_chip *chip, unsigned int offset,
+				  int value)
 {
 	u8 val;
 	unsigned long flags;
-	gpio -= 16;
 	spin_lock_irqsave(&rbtx4938_spi_gpio_lock, flags);
 	val = *rbtx4938_spics_ptr;
 	if (value)
-		val |= 1 << gpio;
+		val |= 1 << offset;
 	else
-		val &= ~(1 << gpio);
+		val &= ~(1 << offset);
 	*rbtx4938_spics_ptr = val;
 	mmiowb();
 	spin_unlock_irqrestore(&rbtx4938_spi_gpio_lock, flags);
 }
 
-static int rbtx4938_spi_gpio_dir_out(unsigned gpio, int value)
+static int rbtx4938_spi_gpio_dir_out(struct gpio_chip *chip,
+				     unsigned int offset, int value)
 {
-	rbtx4938_spi_gpio_set(gpio, value);
+	rbtx4938_spi_gpio_set(chip, offset, value);
 	return 0;
 }
 
-static DEFINE_SPINLOCK(tx4938_gpio_lock);
-
-static int tx4938_gpio_get(unsigned gpio)
-{
-	return tx4938_pioptr->din & (1 << gpio);
-}
-
-static void tx4938_gpio_set_raw(unsigned gpio, int value)
-{
-	u32 val;
-	val = tx4938_pioptr->dout;
-	if (value)
-		val |= 1 << gpio;
-	else
-		val &= ~(1 << gpio);
-	tx4938_pioptr->dout = val;
-}
-
-static void tx4938_gpio_set(unsigned gpio, int value)
-{
-	unsigned long flags;
-	spin_lock_irqsave(&tx4938_gpio_lock, flags);
-	tx4938_gpio_set_raw(gpio, value);
-	mmiowb();
-	spin_unlock_irqrestore(&tx4938_gpio_lock, flags);
-}
-
-static int tx4938_gpio_dir_in(unsigned gpio)
-{
-	spin_lock_irq(&tx4938_gpio_lock);
-	tx4938_pioptr->dir &= ~(1 << gpio);
-	mmiowb();
-	spin_unlock_irq(&tx4938_gpio_lock);
-	return 0;
-}
-
-static int tx4938_gpio_dir_out(unsigned int gpio, int value)
-{
-	spin_lock_irq(&tx4938_gpio_lock);
-	tx4938_gpio_set_raw(gpio, value);
-	tx4938_pioptr->dir |= 1 << gpio;
-	mmiowb();
-	spin_unlock_irq(&tx4938_gpio_lock);
-	return 0;
-}
-
-int gpio_direction_input(unsigned gpio)
-{
-	if (gpio < 16)
-		return tx4938_gpio_dir_in(gpio);
-	return -EINVAL;
-}
-
-int gpio_direction_output(unsigned gpio, int value)
-{
-	if (gpio < 16)
-		return tx4938_gpio_dir_out(gpio, value);
-	if (gpio < 16 + 3)
-		return rbtx4938_spi_gpio_dir_out(gpio, value);
-	return -EINVAL;
-}
-
-int gpio_get_value(unsigned gpio)
-{
-	if (gpio < 16)
-		return tx4938_gpio_get(gpio);
-	return 0;
-}
-
-void gpio_set_value(unsigned gpio, int value)
-{
-	if (gpio < 16)
-		tx4938_gpio_set(gpio, value);
-	else
-		rbtx4938_spi_gpio_set(gpio, value);
-}
+static struct gpio_chip rbtx4938_spi_gpio_chip = {
+	.set = rbtx4938_spi_gpio_set,
+	.direction_output = rbtx4938_spi_gpio_dir_out,
+	.label = "RBTX4938-SPICS",
+	.base = 16,
+	.ngpio = 3,
+};
 
 /* SPI support */
 
@@ -1118,10 +1058,25 @@ static int __init rbtx4938_spi_init(void)
 	spi_eeprom_register(SEEPROM1_CS);
 	spi_eeprom_register(16 + SEEPROM2_CS);
 	spi_eeprom_register(16 + SEEPROM3_CS);
+	gpio_request(16 + SRTC_CS, "rtc-rs5c348");
+	gpio_direction_output(16 + SRTC_CS, 0);
+	gpio_request(SEEPROM1_CS, "seeprom1");
+	gpio_direction_output(SEEPROM1_CS, 1);
+	gpio_request(16 + SEEPROM2_CS, "seeprom2");
+	gpio_direction_output(16 + SEEPROM2_CS, 1);
+	gpio_request(16 + SEEPROM3_CS, "seeprom3");
+	gpio_direction_output(16 + SEEPROM3_CS, 1);
 	txx9_spi_init(TX4938_SPI_REG & 0xfffffffffULL, RBTX4938_IRQ_IRC_SPI);
 	return 0;
 }
-arch_initcall(rbtx4938_spi_init);
+
+static int __init rbtx4938_arch_init(void)
+{
+	txx9_gpio_init(TX4938_PIO_REG & 0xfffffffffULL, 0, 16);
+	gpiochip_add(&rbtx4938_spi_gpio_chip);
+	return rbtx4938_spi_init();
+}
+arch_initcall(rbtx4938_arch_init);
 
 /* Watchdog support */
 
diff --git a/include/asm-mips/tx4938/tx4938.h b/include/asm-mips/tx4938/tx4938.h
index f7c448b..a05f031 100644
--- a/include/asm-mips/tx4938/tx4938.h
+++ b/include/asm-mips/tx4938/tx4938.h
@@ -261,18 +261,6 @@ struct tx4938_sio_reg {
 	volatile unsigned long rfifo;
 };
 
-struct tx4938_pio_reg {
-	volatile unsigned long dout;
-	volatile unsigned long din;
-	volatile unsigned long dir;
-	volatile unsigned long od;
-	volatile unsigned long flag[2];
-	volatile unsigned long pol;
-	volatile unsigned long intc;
-	volatile unsigned long maskcpu;
-	volatile unsigned long maskext;
-};
-
 struct tx4938_ndfmc_reg {
 	endian_def_l2(unused0, dtr);
 	endian_def_l2(unused1, mcr);
@@ -642,7 +630,7 @@ struct tx4938_ccfg_reg {
 #define tx4938_pcic1ptr		((struct tx4938_pcic_reg *)TX4938_PCIC1_REG)
 #define tx4938_ccfgptr		((struct tx4938_ccfg_reg *)TX4938_CCFG_REG)
 #define tx4938_sioptr(ch)	((struct tx4938_sio_reg *)TX4938_SIO_REG(ch))
-#define tx4938_pioptr		((struct tx4938_pio_reg *)TX4938_PIO_REG)
+#define tx4938_pioptr		((struct txx9_pio_reg __iomem *)TX4938_PIO_REG)
 #define tx4938_aclcptr		((struct tx4938_aclc_reg *)TX4938_ACLC_REG)
 #define tx4938_spiptr		((struct tx4938_spi_reg *)TX4938_SPI_REG)
 #define tx4938_sramcptr		((struct tx4938_sramc_reg *)TX4938_SRAMC_REG)

From anemo@mba.ocn.ne.jp Fri Apr  4 17:58:15 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 04 Apr 2008 17:58:24 +0200 (CEST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:21229 "EHLO smtp.mba.ocn.ne.jp")
	by lappi.linux-mips.net with ESMTP id S529379AbYDDP5A (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 4 Apr 2008 17:57:00 +0200
Received: from localhost (p2014-ipad306funabasi.chiba.ocn.ne.jp [123.217.172.14])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id EDBF3AB9E; Sat,  5 Apr 2008 00:55:39 +0900 (JST)
Date:	Sat, 05 Apr 2008 00:56:27 +0900 (JST)
Message-Id: <20080405.005627.30186902.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH 4/4] jmr3927: use generic txx9 gpio
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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18818
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 3785
Lines: 107

Use generic txx9 gpio (and gpiolib) for JMR3927 board.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
 arch/mips/Kconfig                   |    1 +
 arch/mips/jmr3927/rbhma3100/setup.c |   11 ++++++++---
 include/asm-mips/jmr3927/jmr3927.h  |    4 ++--
 include/asm-mips/jmr3927/tx3927.h   |    2 +-
 include/asm-mips/jmr3927/txx927.h   |   12 ------------
 5 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 340a31d..25df3fc 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -612,6 +612,7 @@ config TOSHIBA_JMR3927
 	select SYS_SUPPORTS_LITTLE_ENDIAN
 	select SYS_SUPPORTS_BIG_ENDIAN
 	select GENERIC_HARDIRQS_NO__DO_IRQ
+	select GPIO_TXX9
 
 config TOSHIBA_RBTX4927
 	bool "Toshiba RBTX49[23]7 board"
diff --git a/arch/mips/jmr3927/rbhma3100/setup.c b/arch/mips/jmr3927/rbhma3100/setup.c
index c886d80..f39c444 100644
--- a/arch/mips/jmr3927/rbhma3100/setup.c
+++ b/arch/mips/jmr3927/rbhma3100/setup.c
@@ -36,11 +36,13 @@
 #include <linux/pm.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
+#include <linux/gpio.h>
 #ifdef CONFIG_SERIAL_TXX9
 #include <linux/serial_core.h>
 #endif
 
 #include <asm/txx9tmr.h>
+#include <asm/txx9pio.h>
 #include <asm/reboot.h>
 #include <asm/jmr3927/jmr3927.h>
 #include <asm/mipsregs.h>
@@ -340,9 +342,12 @@ static void __init tx3927_setup(void)
 
 	/* PIO */
 	/* PIO[15:12] connected to LEDs */
-	tx3927_pioptr->dir = 0x0000f000;
-	tx3927_pioptr->maskcpu = 0;
-	tx3927_pioptr->maskext = 0;
+	__raw_writel(0x0000f000, &tx3927_pioptr->dir);
+	__raw_writel(0, &tx3927_pioptr->maskcpu);
+	__raw_writel(0, &tx3927_pioptr->maskext);
+	txx9_gpio_init(TX3927_PIO_REG, 0, 16);
+	gpio_request(11, "dipsw1");
+	gpio_request(10, "dipsw2");
 	{
 		unsigned int conf;
 
diff --git a/include/asm-mips/jmr3927/jmr3927.h b/include/asm-mips/jmr3927/jmr3927.h
index 81602c8..a162268 100644
--- a/include/asm-mips/jmr3927/jmr3927.h
+++ b/include/asm-mips/jmr3927/jmr3927.h
@@ -99,8 +99,8 @@
 #define jmr3927_led_and_set(n/*0-16*/)	jmr3927_ioc_reg_out((~(n)) & jmr3927_ioc_reg_in(JMR3927_IOC_LED_ADDR), JMR3927_IOC_LED_ADDR)
 
 /* DIPSW4 macro */
-#define jmr3927_dipsw1()	((tx3927_pioptr->din & (1 << 11)) == 0)
-#define jmr3927_dipsw2()	((tx3927_pioptr->din & (1 << 10)) == 0)
+#define jmr3927_dipsw1()	(gpio_get_value(11) == 0)
+#define jmr3927_dipsw2()	(gpio_get_value(10) == 0)
 #define jmr3927_dipsw3()	((jmr3927_ioc_reg_in(JMR3927_IOC_DIPSW_ADDR) & 2) == 0)
 #define jmr3927_dipsw4()	((jmr3927_ioc_reg_in(JMR3927_IOC_DIPSW_ADDR) & 1) == 0)
 
diff --git a/include/asm-mips/jmr3927/tx3927.h b/include/asm-mips/jmr3927/tx3927.h
index 338f998..fb58033 100644
--- a/include/asm-mips/jmr3927/tx3927.h
+++ b/include/asm-mips/jmr3927/tx3927.h
@@ -314,6 +314,6 @@ struct tx3927_ccfg_reg {
 #define tx3927_ccfgptr		((struct tx3927_ccfg_reg *)TX3927_CCFG_REG)
 #define tx3927_tmrptr(ch)	((struct txx927_tmr_reg *)TX3927_TMR_REG(ch))
 #define tx3927_sioptr(ch)	((struct txx927_sio_reg *)TX3927_SIO_REG(ch))
-#define tx3927_pioptr		((struct txx927_pio_reg *)TX3927_PIO_REG)
+#define tx3927_pioptr		((struct txx9_pio_reg __iomem *)TX3927_PIO_REG)
 
 #endif /* __ASM_TX3927_H */
diff --git a/include/asm-mips/jmr3927/txx927.h b/include/asm-mips/jmr3927/txx927.h
index 0474fe8..25dcf2f 100644
--- a/include/asm-mips/jmr3927/txx927.h
+++ b/include/asm-mips/jmr3927/txx927.h
@@ -22,18 +22,6 @@ struct txx927_sio_reg {
 	volatile unsigned long rfifo;
 };
 
-struct txx927_pio_reg {
-	volatile unsigned long dout;
-	volatile unsigned long din;
-	volatile unsigned long dir;
-	volatile unsigned long od;
-	volatile unsigned long flag[2];
-	volatile unsigned long pol;
-	volatile unsigned long intc;
-	volatile unsigned long maskcpu;
-	volatile unsigned long maskext;
-};
-
 /*
  * SIO
  */

From ralf@linux-mips.org Fri Apr  4 19:45:00 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 04 Apr 2008 19:45:05 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:43138 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S529633AbYDDRpA (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 4 Apr 2008 19:45:00 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m34HiJ7b015863
	for <linux-mips@linux-mips.org>; Fri, 4 Apr 2008 10:44:20 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m34HiuWJ004793;
	Fri, 4 Apr 2008 18:44:56 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m34HisAF004792;
	Fri, 4 Apr 2008 18:44:54 +0100
Date:	Fri, 4 Apr 2008 18:44:54 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH 1/4] make fallback gpio.h gpiolib-friendly
Message-ID: <20080404174454.GA3546@linux-mips.org>
References: <20080405.005524.108306693.anemo@mba.ocn.ne.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080405.005524.108306693.anemo@mba.ocn.ne.jp>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18821
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 377
Lines: 12

On Sat, Apr 05, 2008 at 12:55:24AM +0900, Atsushi Nemoto wrote:

> If gpiolib was selected, asm-generic/gpio.h provides some prototypes
> for gpio API and implementation helpers.  With this patch, platform
> code can implement its GPIO API using gpiolib without custom gpio.h
> file.
> 
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

Thanks, queued for 2.6.26,

  Ralf

From ralf@linux-mips.org Fri Apr  4 19:45:29 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 04 Apr 2008 19:45:33 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:50818 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S529636AbYDDRpU (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 4 Apr 2008 19:45:20 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m34HidEV015907
	for <linux-mips@linux-mips.org>; Fri, 4 Apr 2008 10:44:40 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m34HjHsx004817;
	Fri, 4 Apr 2008 18:45:17 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m34HjHFw004816;
	Fri, 4 Apr 2008 18:45:17 +0100
Date:	Fri, 4 Apr 2008 18:45:17 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH 3/4] rbhma4500: use generic txx9 gpio
Message-ID: <20080404174517.GC3546@linux-mips.org>
References: <20080405.005609.104641118.anemo@mba.ocn.ne.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080405.005609.104641118.anemo@mba.ocn.ne.jp>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18822
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 217
Lines: 9

On Sat, Apr 05, 2008 at 12:56:09AM +0900, Atsushi Nemoto wrote:

> Use generic txx9 gpio (and gpiolib) for RBHMA4500 board.
> 
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

Thanks, queued for 2.6.26,

  Ralf

From ralf@linux-mips.org Fri Apr  4 19:57:38 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 04 Apr 2008 19:57:44 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:22665 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S529659AbYDDR5i (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 4 Apr 2008 19:57:38 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m34HuuWw017615
	for <linux-mips@linux-mips.org>; Fri, 4 Apr 2008 10:56:57 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m34HjRJW004823;
	Fri, 4 Apr 2008 18:45:27 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m34HjRdR004822;
	Fri, 4 Apr 2008 18:45:27 +0100
Date:	Fri, 4 Apr 2008 18:45:27 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH 4/4] jmr3927: use generic txx9 gpio
Message-ID: <20080404174527.GD3546@linux-mips.org>
References: <20080405.005627.30186902.anemo@mba.ocn.ne.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080405.005627.30186902.anemo@mba.ocn.ne.jp>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18823
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 215
Lines: 9

On Sat, Apr 05, 2008 at 12:56:27AM +0900, Atsushi Nemoto wrote:

> Use generic txx9 gpio (and gpiolib) for JMR3927 board.
> 
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

Thanks, queued for 2.6.26,

  Ralf

From ralf@linux-mips.org Fri Apr  4 19:58:10 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 04 Apr 2008 19:58:15 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:23689 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S529660AbYDDR5j (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 4 Apr 2008 19:57:39 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m34HuuX0017615
	for <linux-mips@linux-mips.org>; Fri, 4 Apr 2008 10:56:59 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m34Hj7nj004811;
	Fri, 4 Apr 2008 18:45:07 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m34Hj7Yk004810;
	Fri, 4 Apr 2008 18:45:07 +0100
Date:	Fri, 4 Apr 2008 18:45:07 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH 2/4] generic txx9 gpio support
Message-ID: <20080404174507.GB3546@linux-mips.org>
References: <20080405.005541.92586328.anemo@mba.ocn.ne.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080405.005541.92586328.anemo@mba.ocn.ne.jp>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18824
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 232
Lines: 9

On Sat, Apr 05, 2008 at 12:55:41AM +0900, Atsushi Nemoto wrote:

> This is a board-independent TXx9 gpio API implementation using gpiolib.
> 
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

Thanks, queued for 2.6.26,

  Ralf

From ralf@linux-mips.org Fri Apr  4 21:35:57 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 04 Apr 2008 21:36:01 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:57509 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S1103085AbYDDTf5 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 4 Apr 2008 21:35:57 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m34JZFB4006337
	for <linux-mips@linux-mips.org>; Fri, 4 Apr 2008 12:35:15 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m34JZqLn008210;
	Fri, 4 Apr 2008 20:35:52 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m34JZpRK008208;
	Fri, 4 Apr 2008 20:35:51 +0100
Date:	Fri, 4 Apr 2008 20:35:51 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] Make KGDB compile on UP
Message-ID: <20080404193551.GA5959@linux-mips.org>
References: <200803202059.37857.sshtylyov@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200803202059.37857.sshtylyov@ru.mvista.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18826
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 1162
Lines: 24

On Thu, Mar 20, 2008 at 08:59:34PM +0300, Sergei Shtylyov wrote:

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

Applied, thanks.

  Ralf

From ralf@linux-mips.org Fri Apr  4 22:22:33 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 04 Apr 2008 22:22:37 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:59821 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S526214AbYDDUWd (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 4 Apr 2008 22:22:33 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m34KLqrN014239
	for <linux-mips@linux-mips.org>; Fri, 4 Apr 2008 13:21:52 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m34KMTLp013006;
	Fri, 4 Apr 2008 21:22:29 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m34KMSLv013005;
	Fri, 4 Apr 2008 21:22:28 +0100
Date:	Fri, 4 Apr 2008 21:22:28 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Alchemy: move UART platform code to its proper place
	(take 2)
Message-ID: <20080404202228.GB5959@linux-mips.org>
References: <200804041733.45170.sshtylyov@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200804041733.45170.sshtylyov@ru.mvista.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18827
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 345
Lines: 11

On Fri, Apr 04, 2008 at 05:33:45PM +0400, Sergei Shtylyov wrote:

> Move the code registering the Alchemy UART platform devices from drivers/serial
> to its proper place, into the Alchemy platform code.  Fix the related Kconfig
> entry, while at it...
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

2.6.26 queue updated,

  Ralf

From dmitri.vorobiev@gmail.com Sat Apr  5 03:31:00 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 05 Apr 2008 03:31:05 +0200 (CEST)
Received: from mu-out-0910.google.com ([209.85.134.186]:22434 "EHLO
	mu-out-0910.google.com") by lappi.linux-mips.net with ESMTP
	id S530157AbYDEBbA (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 5 Apr 2008 03:31:00 +0200
Received: by mu-out-0910.google.com with SMTP id w8so520264mue.1
        for <linux-mips@linux-mips.org>; Fri, 04 Apr 2008 18:30:37 -0700 (PDT)
DKIM-Signature:	v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:organization:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding;
        bh=mNT7ngrm7pW7uNfLdzVudrb2vv44lRkMTZmGI7fZG3c=;
        b=kDdBd3p3/tar/cAgRZcx3+cvN887wS3ClcF5tLLZT6plbS46JNRRI/KZR5kjcbACJtMsj1tLhcr/2yfJginVx87x9JzJUxuO8O+clAHgBHbFHAHu+TlCD4+jIgK0zksp5DGmdgOPrAHAhjc5J9GyNT7tvaeH4lOiRVzKRVo8WsQ=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:organization:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding;
        b=dVtnn6SNOcpXF7kZw6/FZDmECjSdW/It9fZZS2HG+muIpzpqNSljbRBFKhtKKN+lvkEN6FpBiToPQY/PPdwir4jnWqhyYhiiot7tX8nV2y3N2tQmvpaAVVnx7aHsFkkXIHl5C8cmpkeROG91MoAbEKMl1zMj4T8xS85kz+1zIJM=
Received: by 10.78.145.16 with SMTP id s16mr5959660hud.23.1207359037827;
        Fri, 04 Apr 2008 18:30:37 -0700 (PDT)
Received: from ?92.36.11.113? ( [92.36.11.113])
        by mx.google.com with ESMTPS id d25sm9022690nfh.33.2008.04.04.18.30.23
        (version=SSLv3 cipher=RC4-MD5);
        Fri, 04 Apr 2008 18:30:36 -0700 (PDT)
Message-ID: <47F6D611.5080402@gmail.com>
Date:	Sat, 05 Apr 2008 05:29:53 +0400
From:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
Organization: DmVo Home
User-Agent: Thunderbird 1.5.0.14ubu (X11/20080306)
MIME-Version: 1.0
To:	Ralf Baechle <ralf@linux-mips.org>
CC:	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/5] [MIPS] unexport null_perf_irq() and make it static
References: <1207094318-21748-1-git-send-email-dmitri.vorobiev@gmail.com> <1207094318-21748-6-git-send-email-dmitri.vorobiev@gmail.com> <20080404072048.GF12086@linux-mips.org>
In-Reply-To: <20080404072048.GF12086@linux-mips.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Return-Path: <dmitri.vorobiev@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: 18828
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dmitri.vorobiev@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 388
Lines: 19

Ralf Baechle Ð¿Ð¸ÑˆÐµÑ‚:
> On Wed, Apr 02, 2008 at 03:58:38AM +0400, Dmitri Vorobiev wrote:
> 
>> This patch unexports the null_perf_irq() symbol, and simultaneously
>> makes this function static.
>>
>> Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
> 
> Queued for 2.6.26 with your static fix folded in.  Thanks,

Thanks for picking the patches up.

Dmitri

> 
>   Ralf
> 



From sshtylyov@ru.mvista.com Sat Apr  5 20:17:36 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 05 Apr 2008 20:17:41 +0200 (CEST)
Received: from rtsoft3.corbina.net ([85.21.88.6]:36483 "EHLO
	buildserver.ru.mvista.com") by lappi.linux-mips.net with ESMTP
	id S533091AbYDESRg (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 5 Apr 2008 20:17:36 +0200
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id DA0538810; Sun,  6 Apr 2008 00:17:24 +0500 (SAMST)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	linux-mips@linux-mips.org, i2c@lm-sensors.org
Subject: [PATCH] Alchemy: SMBus resource fix
Date:	Sat, 5 Apr 2008 22:16:21 +0400
User-Agent: KMail/1.5
Cc:	ralf@linux-mips.org
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-Id: <200804052216.21699.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18832
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1697
Lines: 45

The Alchemy platform code registers the SMBus device using the virtual address
of its registers instead of the physical one -- fix this, taking into account
that actually the whole megabyte is decoded by any of the programmable serial
controllers (one of which is SMBus), and that all the Alchemy peripherals are
directly mappable into KSEG1 kernel space and therefore ioremap() call would
just boil down to CKSEG1ADDR() invocation.

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

---
I'm not sure thru which tree this should go -- probably thru Linux/MIPS one...

 arch/mips/au1000/common/platform.c |    4 ++--
 drivers/i2c/busses/i2c-au1550.c    |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Index: linux-2.6/arch/mips/au1000/common/platform.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/platform.c
+++ linux-2.6/arch/mips/au1000/common/platform.c
@@ -274,8 +274,8 @@ static struct platform_device smc91x_dev
 #ifdef SMBUS_PSC_BASE
 static struct resource pbdb_smbus_resources[] = {
 	{
-		.start	= SMBUS_PSC_BASE,
-		.end	= SMBUS_PSC_BASE + 0x24 - 1,
+		.start	= CPHYSADDR(SMBUS_PSC_BASE),
+		.end	= CPHYSADDR(SMBUS_PSC_BASE + 0xfffff),
 		.flags	= IORESOURCE_MEM,
 	},
 };
Index: linux-2.6/drivers/i2c/busses/i2c-au1550.c
===================================================================
--- linux-2.6.orig/drivers/i2c/busses/i2c-au1550.c
+++ linux-2.6/drivers/i2c/busses/i2c-au1550.c
@@ -335,7 +335,7 @@ i2c_au1550_probe(struct platform_device 
 		goto out_mem;
 	}
 
-	priv->psc_base = r->start;
+	priv->psc_base = CKSEG1ADDR(r->start);
 	priv->xfer_timeout = 200;
 	priv->ack_timeout = 200;
 


From sshtylyov@ru.mvista.com Sat Apr  5 21:00:44 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 05 Apr 2008 21:00:49 +0200 (CEST)
Received: from rtsoft3.corbina.net ([85.21.88.6]:65411 "EHLO
	buildserver.ru.mvista.com") by lappi.linux-mips.net with ESMTP
	id S533222AbYDETAo (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 5 Apr 2008 21:00:44 +0200
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id A73DA8810; Sun,  6 Apr 2008 01:00:33 +0500 (SAMST)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	ralf@linux-mips.org
Subject: [PATCH] Pb1000: bury the remnants of the PCI code
Date:	Sat, 5 Apr 2008 22:59:29 +0400
User-Agent: KMail/1.5
Cc:	linux-mips@linux-mips.org
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804052259.29959.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18833
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 3295
Lines: 106

PCI support for the Pb1000 board was ectomized by Pete Popov four years ago.
Unfortunately,  the header file  wasn't cleansed, so the remnants still get
in the way of the kernel build (due to macro redefinitions).

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

---
See the commit 709c5032ee77a340e56441f922d76f0b9bd28ed0 in the Linux/MIPS tree
for the original Pete's patch

 include/asm-mips/mach-pb1x00/pb1000.h |   83 ----------------------------------
 1 files changed, 83 deletions(-)

Index: linux-2.6/include/asm-mips/mach-pb1x00/pb1000.h
===================================================================
--- linux-2.6.orig/include/asm-mips/mach-pb1x00/pb1000.h
+++ linux-2.6/include/asm-mips/mach-pb1x00/pb1000.h
@@ -86,87 +86,4 @@
 /* VPP/VCC */
 #define SET_VCC_VPP(VCC, VPP, SLOT)\
 	((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8))
-
-
-/* PCI PB1000 specific defines */
-/* The reason these defines are here instead of au1000.h is because
- * the Au1000 does not have a PCI bus controller so the PCI implementation
- * on the some of the older Pb1000 boards was very board specific.
- */
-#define PCI_CONFIG_BASE   0xBA020000 /* the only external slot */
-
-#define SDRAM_DEVID       0xBA010000
-#define SDRAM_CMD         0xBA010004
-#define SDRAM_CLASS       0xBA010008
-#define SDRAM_MISC        0xBA01000C
-#define SDRAM_MBAR        0xBA010010
-
-#define PCI_IO_DATA_PORT  0xBA800000
-
-#define PCI_IO_ADDR       0xBE00001C
-#define PCI_INT_ACK       0xBBC00000
-#define PCI_IO_READ       0xBBC00020
-#define PCI_IO_WRITE      0xBBC00030
-
-#define PCI_BRIDGE_CONFIG 0xBE000018
-
-#define PCI_IO_START      0x10000000
-#define PCI_IO_END        0x1000ffff
-#define PCI_MEM_START     0x18000000
-#define PCI_MEM_END       0x18ffffff
-
-#define PCI_FIRST_DEVFN   0
-#define PCI_LAST_DEVFN    1
-
-static inline u8 au_pci_io_readb(u32 addr)
-{
-	writel(addr, PCI_IO_ADDR);
-	writel((readl(PCI_BRIDGE_CONFIG) & 0xffffcfff) | (1<<12), PCI_BRIDGE_CONFIG);
-	return (readl(PCI_IO_DATA_PORT) & 0xff);
-}
-
-static inline u16 au_pci_io_readw(u32 addr)
-{
-	writel(addr, PCI_IO_ADDR);
-	writel((readl(PCI_BRIDGE_CONFIG) & 0xffffcfff) | (1<<13), PCI_BRIDGE_CONFIG);
-	return (readl(PCI_IO_DATA_PORT) & 0xffff);
-}
-
-static inline u32 au_pci_io_readl(u32 addr)
-{
-	writel(addr, PCI_IO_ADDR);
-	writel((readl(PCI_BRIDGE_CONFIG) & 0xffffcfff), PCI_BRIDGE_CONFIG);
-	return readl(PCI_IO_DATA_PORT);
-}
-
-static inline void au_pci_io_writeb(u8 val, u32 addr)
-{
-	writel(addr, PCI_IO_ADDR);
-	writel((readl(PCI_BRIDGE_CONFIG) & 0xffffcfff) | (1<<12), PCI_BRIDGE_CONFIG);
-	writel(val, PCI_IO_DATA_PORT);
-}
-
-static inline void au_pci_io_writew(u16 val, u32 addr)
-{
-	writel(addr, PCI_IO_ADDR);
-	writel((readl(PCI_BRIDGE_CONFIG) & 0xffffcfff) | (1<<13), PCI_BRIDGE_CONFIG);
-	writel(val, PCI_IO_DATA_PORT);
-}
-
-static inline void au_pci_io_writel(u32 val, u32 addr)
-{
-	writel(addr, PCI_IO_ADDR);
-	writel(readl(PCI_BRIDGE_CONFIG) & 0xffffcfff, PCI_BRIDGE_CONFIG);
-	writel(val, PCI_IO_DATA_PORT);
-}
-
-static inline void set_sdram_extbyte(void)
-{
-	writel(readl(PCI_BRIDGE_CONFIG) & 0xffffff00, PCI_BRIDGE_CONFIG);
-}
-
-static inline void set_slot_extbyte(void)
-{
-	writel((readl(PCI_BRIDGE_CONFIG) & 0xffffbf00) | 0x18, PCI_BRIDGE_CONFIG);
-}
 #endif /* __ASM_PB1000_H */


From ralf@linux-mips.org Tue Apr  8 13:16:28 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 08 Apr 2008 13:16:34 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:50915 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S536794AbYDHLQ2 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 8 Apr 2008 13:16:28 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m38BEV5n005731
	for <linux-mips@linux-mips.org>; Tue, 8 Apr 2008 04:14:32 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m38B5mEE000459;
	Tue, 8 Apr 2008 12:05:48 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m38B5lMG000458;
	Tue, 8 Apr 2008 12:05:47 +0100
Date:	Tue, 8 Apr 2008 12:05:47 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	linux-mips@linux-mips.org, i2c@lm-sensors.org
Subject: Re: [PATCH] Alchemy: SMBus resource fix
Message-ID: <20080408110547.GA424@linux-mips.org>
References: <200804052216.21699.sshtylyov@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200804052216.21699.sshtylyov@ru.mvista.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18854
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 708
Lines: 17

On Sat, Apr 05, 2008 at 10:16:21PM +0400, Sergei Shtylyov wrote:

> The Alchemy platform code registers the SMBus device using the virtual address
> of its registers instead of the physical one -- fix this, taking into account
> that actually the whole megabyte is decoded by any of the programmable serial
> controllers (one of which is SMBus), and that all the Alchemy peripherals are
> directly mappable into KSEG1 kernel space and therefore ioremap() call would
> just boil down to CKSEG1ADDR() invocation.
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
> 
> ---
> I'm not sure thru which tree this should go -- probably thru Linux/MIPS one...

Looks ok, so I'll send it to Linus.

  Ralf

From ralf@linux-mips.org Tue Apr  8 14:16:36 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 08 Apr 2008 14:16:42 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:57323 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S536848AbYDHMQg (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 8 Apr 2008 14:16:36 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m38CEUhD018704
	for <linux-mips@linux-mips.org>; Tue, 8 Apr 2008 05:14:31 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m38BJdAn016880;
	Tue, 8 Apr 2008 12:19:39 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m38BJd3m016879;
	Tue, 8 Apr 2008 12:19:39 +0100
Date:	Tue, 8 Apr 2008 12:19:39 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] Pb1000: bury the remnants of the PCI code
Message-ID: <20080408111939.GA15630@linux-mips.org>
References: <200804052259.29959.sshtylyov@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200804052259.29959.sshtylyov@ru.mvista.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18855
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 374
Lines: 11

On Sat, Apr 05, 2008 at 10:59:29PM +0400, Sergei Shtylyov wrote:

> PCI support for the Pb1000 board was ectomized by Pete Popov four years ago.
> Unfortunately,  the header file  wasn't cleansed, so the remnants still get
> in the way of the kernel build (due to macro redefinitions).
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

Thanks, applied.

  Ralf

From tsbogend@alpha.franken.de Tue Apr  8 23:47:10 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 08 Apr 2008 23:47:14 +0200 (CEST)
Received: from elvis.franken.de ([193.175.24.41]:31147 "EHLO elvis.franken.de")
	by lappi.linux-mips.net with ESMTP id S537508AbYDHVrK (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 8 Apr 2008 23:47:10 +0200
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JjLbj-0000LK-01; Tue, 08 Apr 2008 23:43:59 +0200
Received: by solo.franken.de (Postfix, from userid 1000)
	id 17E39C2C04; Tue,  8 Apr 2008 23:43:57 +0200 (CEST)
From:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: [PATCH] IP27: Fix clockevent setup
To:	linux-mips@linux-mips.org
cc:	ralf@linux-mips.org
Message-Id: <20080408214357.17E39C2C04@solo.franken.de>
Date:	Tue,  8 Apr 2008 23:43:57 +0200 (CEST)
Return-Path: <tsbogend@alpha.franken.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18862
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips
Content-Length: 3181
Lines: 101

Fix breakage introduced by converting hub_rt to clockevent.

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

 arch/mips/sgi-ip27/ip27-smp.c   |    5 ++++-
 arch/mips/sgi-ip27/ip27-timer.c |   27 +++++++++++++--------------
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/arch/mips/sgi-ip27/ip27-smp.c b/arch/mips/sgi-ip27/ip27-smp.c
index f15fc93..ba5cdeb 100644
--- a/arch/mips/sgi-ip27/ip27-smp.c
+++ b/arch/mips/sgi-ip27/ip27-smp.c
@@ -176,11 +176,14 @@ static void ip27_send_ipi_mask(cpumask_t mask, unsigned int action)
 static void __cpuinit ip27_init_secondary(void)
 {
 	per_cpu_init();
-	local_irq_enable();
 }
 
 static void __cpuinit ip27_smp_finish(void)
 {
+	extern void hub_rt_clock_event_init(void);
+
+	hub_rt_clock_event_init();
+	local_irq_enable();
 }
 
 static void __init ip27_cpus_done(void)
diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c
index 25d3baf..ffde7e1 100644
--- a/arch/mips/sgi-ip27/ip27-timer.c
+++ b/arch/mips/sgi-ip27/ip27-timer.c
@@ -160,10 +160,13 @@ static void rt_set_mode(enum clock_event_mode mode,
 
 unsigned int rt_timer_irq;
 
+static DEFINE_PER_CPU(struct clock_event_device, hub_rt_clockevent);
+static DEFINE_PER_CPU(char [11], hub_rt_name);
+
 static irqreturn_t hub_rt_counter_handler(int irq, void *dev_id)
 {
-	struct clock_event_device *cd = dev_id;
 	unsigned int cpu = smp_processor_id();
+	struct clock_event_device *cd = &per_cpu(hub_rt_clockevent, cpu);
 	int slice = cputoslice(cpu);
 
 	/*
@@ -192,10 +195,7 @@ struct irqaction hub_rt_irqaction = {
 #define NSEC_PER_CYCLE		800
 #define CYCLES_PER_SEC		(NSEC_PER_SEC / NSEC_PER_CYCLE)
 
-static DEFINE_PER_CPU(struct clock_event_device, hub_rt_clockevent);
-static DEFINE_PER_CPU(char [11], hub_rt_name);
-
-static void __cpuinit hub_rt_clock_event_init(void)
+void __cpuinit hub_rt_clock_event_init(void)
 {
 	unsigned int cpu = smp_processor_id();
 	struct clock_event_device *cd = &per_cpu(hub_rt_clockevent, cpu);
@@ -203,17 +203,16 @@ static void __cpuinit hub_rt_clock_event_init(void)
 	int irq = rt_timer_irq;
 
 	sprintf(name, "hub-rt %d", cpu);
-	cd->name		= "HUB-RT",
-	cd->features		= CLOCK_EVT_FEAT_ONESHOT,
+	cd->name		= name;
+	cd->features		= CLOCK_EVT_FEAT_ONESHOT;
 	clockevent_set_clock(cd, CYCLES_PER_SEC);
 	cd->max_delta_ns        = clockevent_delta2ns(0xfffffffffffff, cd);
 	cd->min_delta_ns        = clockevent_delta2ns(0x300, cd);
-	cd->rating		= 200,
-	cd->irq			= irq,
-	cd->cpumask		= cpumask_of_cpu(cpu),
-	cd->rating		= 300,
-	cd->set_next_event	= rt_next_event,
-	cd->set_mode		= rt_set_mode,
+	cd->rating		= 200;
+	cd->irq			= irq;
+	cd->cpumask		= cpumask_of_cpu(cpu);
+	cd->set_next_event	= rt_next_event;
+	cd->set_mode		= rt_set_mode;
 	clockevents_register_device(cd);
 }
 
@@ -261,6 +260,7 @@ void __init plat_time_init(void)
 {
 	hub_rt_clocksource_init();
 	hub_rt_clock_event_global_init();
+	hub_rt_clock_event_init();
 }
 
 void __cpuinit cpu_time_init(void)
@@ -281,7 +281,6 @@ void __cpuinit cpu_time_init(void)
 
 	printk("CPU %d clock is %dMHz.\n", smp_processor_id(), cpu->cpu_speed);
 
-	hub_rt_clock_event_init();
 	set_c0_status(SRB_TIMOCLK);
 }
 

From tsbogend@alpha.franken.de Tue Apr  8 23:47:37 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 08 Apr 2008 23:47:42 +0200 (CEST)
Received: from elvis.franken.de ([193.175.24.41]:31403 "EHLO elvis.franken.de")
	by lappi.linux-mips.net with ESMTP id S537510AbYDHVrK (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 8 Apr 2008 23:47:10 +0200
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JjLbj-0000LK-00; Tue, 08 Apr 2008 23:43:59 +0200
Received: by solo.franken.de (Postfix, from userid 1000)
	id ECFF7C2C03; Tue,  8 Apr 2008 23:43:46 +0200 (CEST)
From:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: [PATCH] IP27: Fix bootmem memory setup
To:	linux-mips@linux-mips.org
cc:	ralf@linux-mips.org
Message-Id: <20080408214346.ECFF7C2C03@solo.franken.de>
Date:	Tue,  8 Apr 2008 23:43:46 +0200 (CEST)
Return-Path: <tsbogend@alpha.franken.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18863
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips
Content-Length: 6518
Lines: 220

Changes in the generic bootmem code broke memory setup for IP27. This
patch fixes this by replacing lots of special IP27 code with generic
bootmon code. This has been tested only on a single node.

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

 arch/mips/sgi-ip27/ip27-memory.c |  119 +++++++------------------------------
 1 files changed, 23 insertions(+), 96 deletions(-)

diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c
index bf438d0..aedbc28 100644
--- a/arch/mips/sgi-ip27/ip27-memory.c
+++ b/arch/mips/sgi-ip27/ip27-memory.c
@@ -33,10 +33,6 @@
 #define SLOT_PFNSHIFT           (SLOT_SHIFT - PAGE_SHIFT)
 #define PFN_NASIDSHFT           (NASID_SHFT - PAGE_SHIFT)
 
-#define SLOT_IGNORED		0xffff
-
-static short __initdata slot_lastfilled_cache[MAX_COMPACT_NODES];
-static unsigned short __initdata slot_psize_cache[MAX_COMPACT_NODES][MAX_MEM_SLOTS];
 static struct bootmem_data __initdata plat_node_bdata[MAX_COMPACT_NODES];
 
 struct node_data *__node_data[MAX_COMPACT_NODES];
@@ -267,51 +263,6 @@ static pfn_t __init slot_getbasepfn(cnodeid_t cnode, int slot)
 	return ((pfn_t)nasid << PFN_NASIDSHFT) | (slot << SLOT_PFNSHIFT);
 }
 
-/*
- * Return the number of pages of memory provided by the given slot
- * on the specified node.
- */
-static pfn_t __init slot_getsize(cnodeid_t node, int slot)
-{
-	return (pfn_t) slot_psize_cache[node][slot];
-}
-
-/*
- * Return highest slot filled
- */
-static int __init node_getlastslot(cnodeid_t node)
-{
-	return (int) slot_lastfilled_cache[node];
-}
-
-/*
- * Return the pfn of the last free page of memory on a node.
- */
-static pfn_t __init node_getmaxclick(cnodeid_t node)
-{
-	pfn_t	slot_psize;
-	int	slot;
-
-	/*
-	 * Start at the top slot. When we find a slot with memory in it,
-	 * that's the winner.
-	 */
-	for (slot = (MAX_MEM_SLOTS - 1); slot >= 0; slot--) {
-		if ((slot_psize = slot_getsize(node, slot))) {
-			if (slot_psize == SLOT_IGNORED)
-				continue;
-			/* Return the basepfn + the slot size, minus 1. */
-			return slot_getbasepfn(node, slot) + slot_psize - 1;
-		}
-	}
-
-	/*
-	 * If there's no memory on the node, return 0. This is likely
-	 * to cause problems.
-	 */
-	return 0;
-}
-
 static pfn_t __init slot_psize_compute(cnodeid_t node, int slot)
 {
 	nasid_t nasid;
@@ -404,13 +355,13 @@ static void __init mlreset(void)
 static void __init szmem(void)
 {
 	pfn_t slot_psize, slot0sz = 0, nodebytes;	/* Hack to detect problem configs */
-	int slot, ignore;
+	int slot;
 	cnodeid_t node;
 
 	num_physpages = 0;
 
 	for_each_online_node(node) {
-		ignore = nodebytes = 0;
+		nodebytes = 0;
 		for (slot = 0; slot < MAX_MEM_SLOTS; slot++) {
 			slot_psize = slot_psize_compute(node, slot);
 			if (slot == 0)
@@ -420,21 +371,20 @@ static void __init szmem(void)
 			 * kernel text.
 			 */
 			nodebytes += (1LL << SLOT_SHIFT);
+			
+			if (!slot_psize)
+				continue;
+			
 			if ((nodebytes >> PAGE_SHIFT) * (sizeof(struct page)) >
-						(slot0sz << PAGE_SHIFT))
-				ignore = 1;
-			if (ignore && slot_psize) {
+						(slot0sz << PAGE_SHIFT)) {
 				printk("Ignoring slot %d onwards on node %d\n",
 								slot, node);
-				slot_psize_cache[node][slot] = SLOT_IGNORED;
 				slot = MAX_MEM_SLOTS;
 				continue;
 			}
 			num_physpages += slot_psize;
-			slot_psize_cache[node][slot] =
-					(unsigned short) slot_psize;
-			if (slot_psize)
-				slot_lastfilled_cache[node] = slot;
+			add_active_range(node, slot_getbasepfn(node, slot),
+					 slot_getbasepfn(node, slot) + slot_psize);
 		}
 	}
 }
@@ -442,18 +392,20 @@ static void __init szmem(void)
 static void __init node_mem_init(cnodeid_t node)
 {
 	pfn_t slot_firstpfn = slot_getbasepfn(node, 0);
-	pfn_t slot_lastpfn = slot_firstpfn + slot_getsize(node, 0);
 	pfn_t slot_freepfn = node_getfirstfree(node);
-	struct pglist_data *pd;
 	unsigned long bootmap_size;
+	pfn_t start_pfn, end_pfn;
+	
+	get_pfn_range_for_nid(node, &start_pfn, &end_pfn);
 
 	/*
 	 * Allocate the node data structures on the node first.
 	 */
 	__node_data[node] = __va(slot_freepfn << PAGE_SHIFT);
 
-	pd = NODE_DATA(node);
-	pd->bdata = &plat_node_bdata[node];
+	NODE_DATA(node)->bdata = &plat_node_bdata[node];
+	NODE_DATA(node)->node_start_pfn = start_pfn;
+	NODE_DATA(node)->node_spanned_pages = end_pfn - start_pfn;
 
 	cpus_clear(hub_data(node)->h_cpus);
 
@@ -461,12 +413,12 @@ static void __init node_mem_init(cnodeid_t node)
 			       sizeof(struct hub_data));
 
   	bootmap_size = init_bootmem_node(NODE_DATA(node), slot_freepfn,
-					slot_firstpfn, slot_lastpfn);
-	free_bootmem_node(NODE_DATA(node), slot_firstpfn << PAGE_SHIFT,
-			(slot_lastpfn - slot_firstpfn) << PAGE_SHIFT);
+					start_pfn, end_pfn);
+	free_bootmem_with_active_regions(node, end_pfn);
 	reserve_bootmem_node(NODE_DATA(node), slot_firstpfn << PAGE_SHIFT,
 		((slot_freepfn - slot_firstpfn) << PAGE_SHIFT) + bootmap_size,
 		BOOTMEM_DEFAULT);
+	sparse_memory_present_with_active_regions(node);
 }
 
 /*
@@ -515,16 +467,15 @@ void __init paging_init(void)
 	pagetable_init();
 
 	for_each_online_node(node) {
-		pfn_t start_pfn = slot_getbasepfn(node, 0);
-		pfn_t end_pfn = node_getmaxclick(node) + 1;
-
-		zones_size[ZONE_NORMAL] = end_pfn - start_pfn;
-		free_area_init_node(node, NODE_DATA(node),
-				zones_size, start_pfn, NULL);
+		pfn_t start_pfn, end_pfn;
+		
+		get_pfn_range_for_nid(node, &start_pfn, &end_pfn);
 
 		if (end_pfn > max_low_pfn)
 			max_low_pfn = end_pfn;
 	}
+	zones_size[ZONE_NORMAL] = max_low_pfn;
+	free_area_init_nodes(zones_size);
 }
 
 void __init mem_init(void)
@@ -535,34 +486,10 @@ void __init mem_init(void)
 	high_memory = (void *) __va(num_physpages << PAGE_SHIFT);
 
 	for_each_online_node(node) {
-		unsigned slot, numslots;
-		struct page *end, *p;
-
 		/*
 		 * This will free up the bootmem, ie, slot 0 memory.
 		 */
 		totalram_pages += free_all_bootmem_node(NODE_DATA(node));
-
-		/*
-		 * We need to manually do the other slots.
-		 */
-		numslots = node_getlastslot(node);
-		for (slot = 1; slot <= numslots; slot++) {
-			p = nid_page_nr(node, slot_getbasepfn(node, slot) -
-					      slot_getbasepfn(node, 0));
-
-			/*
-			 * Free valid memory in current slot.
-			 */
-			for (end = p + slot_getsize(node, slot); p < end; p++) {
-				/* if (!page_is_ram(pgnr)) continue; */
-				/* commented out until page_is_ram works */
-				ClearPageReserved(p);
-				init_page_count(p);
-				__free_page(p);
-				totalram_pages++;
-			}
-		}
 	}
 
 	totalram_pages -= setup_zero_pages();	/* This comes from node 0 */

From ralf@linux-mips.org Wed Apr  9 16:48:29 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 09 Apr 2008 16:48:33 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:3517 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S538533AbYDIOs3 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 9 Apr 2008 16:48:29 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m39ElkIE028224
	for <linux-mips@linux-mips.org>; Wed, 9 Apr 2008 07:47:47 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m39EmNUK003628;
	Wed, 9 Apr 2008 15:48:23 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m39EmNZ8003627;
	Wed, 9 Apr 2008 15:48:23 +0100
Date:	Wed, 9 Apr 2008 15:48:23 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] IP27: Fix bootmem memory setup
Message-ID: <20080409144823.GA3607@linux-mips.org>
References: <20080408214346.ECFF7C2C03@solo.franken.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080408214346.ECFF7C2C03@solo.franken.de>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18872
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 341
Lines: 9

On Tue, Apr 08, 2008 at 11:43:46PM +0200, Thomas Bogendoerfer wrote:

> Changes in the generic bootmem code broke memory setup for IP27. This
> patch fixes this by replacing lots of special IP27 code with generic
> bootmon code. This has been tested only on a single node.

I have a dual-node for testing, will give it a spin later.

  Ralf

From anemo@mba.ocn.ne.jp Thu Apr 10 17:24:27 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 10 Apr 2008 17:24:33 +0200 (CEST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:38346 "EHLO smtp.mba.ocn.ne.jp")
	by lappi.linux-mips.net with ESMTP id S1784247AbYDJPY0 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 10 Apr 2008 17:24:26 +0200
Received: from localhost (p5205-ipad206funabasi.chiba.ocn.ne.jp [222.145.79.205])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id D4CB27BE8; Fri, 11 Apr 2008 00:23:03 +0900 (JST)
Date:	Fri, 11 Apr 2008 00:23:55 +0900 (JST)
Message-Id: <20080411.002355.08076156.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	Jeff Garzik <jeff@garzik.org>, netdev@vger.kernel.org
Subject: [PATCH 0/6] tc35815: driver update
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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18884
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 406
Lines: 13

This patchset is for tc35815 driver update, including many cleanups
and conversion to phylib.

* Statistics cleanup
* Use print_mac() helper
* Use netdev_priv()
* Use managed pci iomap helper
* Use generic PHY layer
* Whitespace cleanup

 drivers/net/Kconfig   |    2 +-
 drivers/net/tc35815.c | 1674 +++++++++++++++++--------------------------------
 2 files changed, 589 insertions(+), 1087 deletions(-)

From anemo@mba.ocn.ne.jp Thu Apr 10 17:24:57 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 10 Apr 2008 17:25:03 +0200 (CEST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:52174 "EHLO smtp.mba.ocn.ne.jp")
	by lappi.linux-mips.net with ESMTP id S1784249AbYDJPYk (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 10 Apr 2008 17:24:40 +0200
Received: from localhost (p5205-ipad206funabasi.chiba.ocn.ne.jp [222.145.79.205])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id D43ADB4B4; Fri, 11 Apr 2008 00:23:20 +0900 (JST)
Date:	Fri, 11 Apr 2008 00:24:12 +0900 (JST)
Message-Id: <20080411.002412.03977557.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	Jeff Garzik <jeff@garzik.org>, netdev@vger.kernel.org
Subject: [PATCH 1/6] tc35815: Statistics cleanup
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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18885
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 5881
Lines: 189

Use struct net_device_stats embedded in struct net_device.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
 drivers/net/tc35815.c |   61 +++++++++++++++++++++++++------------------------
 1 files changed, 31 insertions(+), 30 deletions(-)

diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
index 370d329..f0e9566 100644
--- a/drivers/net/tc35815.c
+++ b/drivers/net/tc35815.c
@@ -418,7 +418,6 @@ struct tc35815_local {
 	struct napi_struct napi;
 
 	/* statistics */
-	struct net_device_stats stats;
 	struct {
 		int max_tx_qlen;
 		int tx_ints;
@@ -1192,7 +1191,7 @@ static void tc35815_tx_timeout(struct net_device *dev)
 	tc35815_restart(dev);
 	spin_unlock_irq(&lp->lock);
 
-	lp->stats.tx_errors++;
+	dev->stats.tx_errors++;
 
 	/* If we have space available to accept new transmit
 	 * requests, wake up the queueing layer.  This would
@@ -1392,7 +1391,7 @@ static int tc35815_do_interrupt(struct net_device *dev, u32 status)
 		printk(KERN_WARNING
 		       "%s: Free Descriptor Area Exhausted (%#x).\n",
 		       dev->name, status);
-		lp->stats.rx_dropped++;
+		dev->stats.rx_dropped++;
 		ret = 0;
 	}
 	if (status & Int_IntBLEx) {
@@ -1401,14 +1400,14 @@ static int tc35815_do_interrupt(struct net_device *dev, u32 status)
 		printk(KERN_WARNING
 		       "%s: Buffer List Exhausted (%#x).\n",
 		       dev->name, status);
-		lp->stats.rx_dropped++;
+		dev->stats.rx_dropped++;
 		ret = 0;
 	}
 	if (status & Int_IntExBD) {
 		printk(KERN_WARNING
 		       "%s: Excessive Buffer Descriptiors (%#x).\n",
 		       dev->name, status);
-		lp->stats.rx_length_errors++;
+		dev->stats.rx_length_errors++;
 		ret = 0;
 	}
 
@@ -1532,7 +1531,7 @@ tc35815_rx(struct net_device *dev)
 			if (skb == NULL) {
 				printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n",
 				       dev->name);
-				lp->stats.rx_dropped++;
+				dev->stats.rx_dropped++;
 				break;
 			}
 			skb_reserve(skb, 2);   /* 16 bit alignment */
@@ -1602,10 +1601,10 @@ tc35815_rx(struct net_device *dev)
 			netif_rx(skb);
 #endif
 			dev->last_rx = jiffies;
-			lp->stats.rx_packets++;
-			lp->stats.rx_bytes += pkt_len;
+			dev->stats.rx_packets++;
+			dev->stats.rx_bytes += pkt_len;
 		} else {
-			lp->stats.rx_errors++;
+			dev->stats.rx_errors++;
 			printk(KERN_DEBUG "%s: Rx error (status %x)\n",
 			       dev->name, status & Rx_Stat_Mask);
 			/* WORKAROUND: LongErr and CRCErr means Overflow. */
@@ -1613,10 +1612,14 @@ tc35815_rx(struct net_device *dev)
 				status &= ~(Rx_LongErr|Rx_CRCErr);
 				status |= Rx_Over;
 			}
-			if (status & Rx_LongErr) lp->stats.rx_length_errors++;
-			if (status & Rx_Over) lp->stats.rx_fifo_errors++;
-			if (status & Rx_CRCErr) lp->stats.rx_crc_errors++;
-			if (status & Rx_Align) lp->stats.rx_frame_errors++;
+			if (status & Rx_LongErr)
+				dev->stats.rx_length_errors++;
+			if (status & Rx_Over)
+				dev->stats.rx_fifo_errors++;
+			if (status & Rx_CRCErr)
+				dev->stats.rx_crc_errors++;
+			if (status & Rx_Align)
+				dev->stats.rx_frame_errors++;
 		}
 
 		if (bd_count > 0) {
@@ -1777,9 +1780,9 @@ tc35815_check_tx_stat(struct net_device *dev, int status)
 
 	/* count collisions */
 	if (status & Tx_ExColl)
-		lp->stats.collisions += 16;
+		dev->stats.collisions += 16;
 	if (status & Tx_TxColl_MASK)
-		lp->stats.collisions += status & Tx_TxColl_MASK;
+		dev->stats.collisions += status & Tx_TxColl_MASK;
 
 #ifndef NO_CHECK_CARRIER
 	/* TX4939 does not have NCarr */
@@ -1795,17 +1798,17 @@ tc35815_check_tx_stat(struct net_device *dev, int status)
 
 	if (!(status & TX_STA_ERR)) {
 		/* no error. */
-		lp->stats.tx_packets++;
+		dev->stats.tx_packets++;
 		return;
 	}
 
-	lp->stats.tx_errors++;
+	dev->stats.tx_errors++;
 	if (status & Tx_ExColl) {
-		lp->stats.tx_aborted_errors++;
+		dev->stats.tx_aborted_errors++;
 		msg = "Excessive Collision.";
 	}
 	if (status & Tx_Under) {
-		lp->stats.tx_fifo_errors++;
+		dev->stats.tx_fifo_errors++;
 		msg = "Tx FIFO Underrun.";
 		if (lp->lstats.tx_underrun < TX_THRESHOLD_KEEP_LIMIT) {
 			lp->lstats.tx_underrun++;
@@ -1818,25 +1821,25 @@ tc35815_check_tx_stat(struct net_device *dev, int status)
 		}
 	}
 	if (status & Tx_Defer) {
-		lp->stats.tx_fifo_errors++;
+		dev->stats.tx_fifo_errors++;
 		msg = "Excessive Deferral.";
 	}
 #ifndef NO_CHECK_CARRIER
 	if (status & Tx_NCarr) {
-		lp->stats.tx_carrier_errors++;
+		dev->stats.tx_carrier_errors++;
 		msg = "Lost Carrier Sense.";
 	}
 #endif
 	if (status & Tx_LateColl) {
-		lp->stats.tx_aborted_errors++;
+		dev->stats.tx_aborted_errors++;
 		msg = "Late Collision.";
 	}
 	if (status & Tx_TxPar) {
-		lp->stats.tx_fifo_errors++;
+		dev->stats.tx_fifo_errors++;
 		msg = "Transmit Parity Error.";
 	}
 	if (status & Tx_SQErr) {
-		lp->stats.tx_heartbeat_errors++;
+		dev->stats.tx_heartbeat_errors++;
 		msg = "Signal Quality Error.";
 	}
 	if (msg && netif_msg_tx_err(lp))
@@ -1878,7 +1881,7 @@ tc35815_txdone(struct net_device *dev)
 		BUG_ON(lp->tx_skbs[lp->tfd_end].skb != skb);
 #endif
 		if (skb) {
-			lp->stats.tx_bytes += skb->len;
+			dev->stats.tx_bytes += skb->len;
 			pci_unmap_single(lp->pci_dev, lp->tx_skbs[lp->tfd_end].skb_dma, skb->len, PCI_DMA_TODEVICE);
 			lp->tx_skbs[lp->tfd_end].skb = NULL;
 			lp->tx_skbs[lp->tfd_end].skb_dma = 0;
@@ -1972,15 +1975,13 @@ tc35815_close(struct net_device *dev)
  */
 static struct net_device_stats *tc35815_get_stats(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
 	struct tc35815_regs __iomem *tr =
 		(struct tc35815_regs __iomem *)dev->base_addr;
-	if (netif_running(dev)) {
+	if (netif_running(dev))
 		/* Update the statistics from the device registers. */
-		lp->stats.rx_missed_errors = tc_readl(&tr->Miss_Cnt);
-	}
+		dev->stats.rx_missed_errors = tc_readl(&tr->Miss_Cnt);
 
-	return &lp->stats;
+	return &dev->stats;
 }
 
 static void tc35815_set_cam_entry(struct net_device *dev, int index, unsigned char *addr)

From anemo@mba.ocn.ne.jp Thu Apr 10 17:25:43 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 10 Apr 2008 17:25:53 +0200 (CEST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:62929 "EHLO smtp.mba.ocn.ne.jp")
	by lappi.linux-mips.net with ESMTP id S1784250AbYDJPYw (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 10 Apr 2008 17:24:52 +0200
Received: from localhost (p5205-ipad206funabasi.chiba.ocn.ne.jp [222.145.79.205])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id A4CADB4A5; Fri, 11 Apr 2008 00:23:32 +0900 (JST)
Date:	Fri, 11 Apr 2008 00:24:24 +0900 (JST)
Message-Id: <20080411.002424.130850795.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	Jeff Garzik <jeff@garzik.org>, netdev@vger.kernel.org
Subject: [PATCH 2/6] tc35815: Use print_mac() helper
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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18886
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 2541
Lines: 82

Use print_mac() and DECLARE_MAC_BUF().

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
 drivers/net/tc35815.c |   36 ++++++++++++++----------------------
 1 files changed, 14 insertions(+), 22 deletions(-)

diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
index f0e9566..1f623e5 100644
--- a/drivers/net/tc35815.c
+++ b/drivers/net/tc35815.c
@@ -664,6 +664,7 @@ static int __devinit tc35815_init_one (struct pci_dev *pdev,
 	struct tc35815_local *lp;
 	int rc;
 	unsigned long mmio_start, mmio_end, mmio_flags, mmio_len;
+	DECLARE_MAC_BUF(mac);
 
 	static int printed_version;
 	if (!printed_version++) {
@@ -770,15 +771,11 @@ static int __devinit tc35815_init_one (struct pci_dev *pdev,
 		goto err_out_unmap;
 
 	memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
-	printk(KERN_INFO "%s: %s at 0x%lx, "
-		"%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, "
-		"IRQ %d\n",
+	printk(KERN_INFO "%s: %s at 0x%lx, %s, IRQ %d\n",
 		dev->name,
 		board_info[ent->driver_data].name,
 		dev->base_addr,
-		dev->dev_addr[0], dev->dev_addr[1],
-		dev->dev_addr[2], dev->dev_addr[3],
-		dev->dev_addr[4], dev->dev_addr[5],
+		print_mac(mac, dev->dev_addr),
 		dev->irq);
 
 	setup_timer(&lp->timer, tc35815_timer, (unsigned long) dev);
@@ -1127,17 +1124,14 @@ panic_queues(struct net_device *dev)
 }
 #endif
 
-static void print_eth(char *add)
+static void print_eth(const u8 *add)
 {
-	int i;
+	DECLARE_MAC_BUF(mac);
 
-	printk("print_eth(%p)\n", add);
-	for (i = 0; i < 6; i++)
-		printk(" %2.2X", (unsigned char) add[i + 6]);
-	printk(" =>");
-	for (i = 0; i < 6; i++)
-		printk(" %2.2X", (unsigned char) add[i]);
-	printk(" : %2.2X%2.2X\n", (unsigned char) add[12], (unsigned char) add[13]);
+	printk(KERN_DEBUG "print_eth(%p)\n", add);
+	printk(KERN_DEBUG " %s =>", print_mac(mac, add + 6));
+	printk(KERN_CONT " %s : %02x%02x\n",
+		print_mac(mac, add), add[12], add[13]);
 }
 
 static int tc35815_tx_full(struct net_device *dev)
@@ -1992,15 +1986,13 @@ static void tc35815_set_cam_entry(struct net_device *dev, int index, unsigned ch
 	int cam_index = index * 6;
 	u32 cam_data;
 	u32 saved_addr;
+	DECLARE_MAC_BUF(mac);
+
 	saved_addr = tc_readl(&tr->CAM_Adr);
 
-	if (netif_msg_hw(lp)) {
-		int i;
-		printk(KERN_DEBUG "%s: CAM %d:", dev->name, index);
-		for (i = 0; i < 6; i++)
-			printk(" %02x", addr[i]);
-		printk("\n");
-	}
+	if (netif_msg_hw(lp))
+		printk(KERN_DEBUG "%s: CAM %d: %s\n",
+			dev->name, index, print_mac(mac, addr));
 	if (index & 1) {
 		/* read modify write */
 		tc_writel(cam_index - 2, &tr->CAM_Adr);

From anemo@mba.ocn.ne.jp Thu Apr 10 17:26:36 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 10 Apr 2008 17:26:45 +0200 (CEST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:43476 "EHLO smtp.mba.ocn.ne.jp")
	by lappi.linux-mips.net with ESMTP id S1784247AbYDJPZE (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 10 Apr 2008 17:25:04 +0200
Received: from localhost (p5205-ipad206funabasi.chiba.ocn.ne.jp [222.145.79.205])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id E906BB582; Fri, 11 Apr 2008 00:23:44 +0900 (JST)
Date:	Fri, 11 Apr 2008 00:24:36 +0900 (JST)
Message-Id: <20080411.002436.122621005.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	Jeff Garzik <jeff@garzik.org>, netdev@vger.kernel.org
Subject: [PATCH 3/6] tc35815: Use netdev_priv()
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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18887
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 12189
Lines: 356

Use netdev_priv() instead of dev->priv.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
 drivers/net/tc35815.c |   78 ++++++++++++++++++++++++------------------------
 1 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
index 1f623e5..5f4a14f 100644
--- a/drivers/net/tc35815.c
+++ b/drivers/net/tc35815.c
@@ -616,7 +616,7 @@ static int __devinit tc35815_mac_match(struct device *dev, void *data)
 
 static int __devinit tc35815_read_plat_dev_addr(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	struct device *pd = bus_find_device(&platform_bus_type, NULL,
 					    lp->pci_dev, tc35815_mac_match);
 	if (pd) {
@@ -686,7 +686,7 @@ static int __devinit tc35815_init_one (struct pci_dev *pdev,
 		return -ENOMEM;
 	}
 	SET_NETDEV_DEV(dev, &pdev->dev);
-	lp = dev->priv;
+	lp = netdev_priv(dev);
 	lp->dev = dev;
 
 	/* enable device (incl. PCI PM wakeup), and bus-mastering */
@@ -823,7 +823,7 @@ static void __devexit tc35815_remove_one (struct pci_dev *pdev)
 static int
 tc35815_init_queues(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	int i;
 	unsigned long fd_addr;
 
@@ -960,7 +960,7 @@ tc35815_init_queues(struct net_device *dev)
 static void
 tc35815_clear_queues(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	int i;
 
 	for (i = 0; i < TX_FD_NUM; i++) {
@@ -991,7 +991,7 @@ tc35815_clear_queues(struct net_device *dev)
 static void
 tc35815_free_queues(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	int i;
 
 	if (lp->tfd_base) {
@@ -1105,7 +1105,7 @@ dump_frfd(struct FrFD *fd)
 static void
 panic_queues(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	int i;
 
 	printk("TxFD base %p, start %u, end %u\n",
@@ -1136,13 +1136,13 @@ static void print_eth(const u8 *add)
 
 static int tc35815_tx_full(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	return ((lp->tfd_start + 1) % TX_FD_NUM == lp->tfd_end);
 }
 
 static void tc35815_restart(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	int pid = lp->phy_addr;
 	int do_phy_reset = 1;
 	del_timer(&lp->timer);		/* Kill if running	*/
@@ -1173,7 +1173,7 @@ static void tc35815_restart(struct net_device *dev)
 
 static void tc35815_tx_timeout(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	struct tc35815_regs __iomem *tr =
 		(struct tc35815_regs __iomem *)dev->base_addr;
 
@@ -1212,7 +1212,7 @@ static void tc35815_tx_timeout(struct net_device *dev)
 static int
 tc35815_open(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 
 	/*
 	 * This is used if the interrupt line can turned off (shared).
@@ -1254,7 +1254,7 @@ tc35815_open(struct net_device *dev)
  */
 static int tc35815_send_packet(struct sk_buff *skb, struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	struct TxFD *txfd;
 	unsigned long flags;
 
@@ -1368,7 +1368,7 @@ static int tc35815_do_interrupt(struct net_device *dev, u32 status, int limit)
 static int tc35815_do_interrupt(struct net_device *dev, u32 status)
 #endif
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	struct tc35815_regs __iomem *tr =
 		(struct tc35815_regs __iomem *)dev->base_addr;
 	int ret = -1;
@@ -1485,7 +1485,7 @@ static void
 tc35815_rx(struct net_device *dev)
 #endif
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	unsigned int fdctl;
 	int i;
 	int buf_free_count = 0;
@@ -1769,7 +1769,7 @@ static int tc35815_poll(struct napi_struct *napi, int budget)
 static void
 tc35815_check_tx_stat(struct net_device *dev, int status)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	const char *msg = NULL;
 
 	/* count collisions */
@@ -1846,7 +1846,7 @@ tc35815_check_tx_stat(struct net_device *dev, int status)
 static void
 tc35815_txdone(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	struct TxFD *txfd;
 	unsigned int fdctl;
 
@@ -1944,7 +1944,7 @@ tc35815_txdone(struct net_device *dev)
 static int
 tc35815_close(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 
 	netif_stop_queue(dev);
 #ifdef TC35815_NAPI
@@ -1980,7 +1980,7 @@ static struct net_device_stats *tc35815_get_stats(struct net_device *dev)
 
 static void tc35815_set_cam_entry(struct net_device *dev, int index, unsigned char *addr)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	struct tc35815_regs __iomem *tr =
 		(struct tc35815_regs __iomem *)dev->base_addr;
 	int cam_index = index * 6;
@@ -2037,7 +2037,7 @@ tc35815_set_multicast_list(struct net_device *dev)
 #ifdef WORKAROUND_100HALF_PROMISC
 		/* With some (all?) 100MHalf HUB, controller will hang
 		 * if we enabled promiscuous mode before linkup... */
-		struct tc35815_local *lp = dev->priv;
+		struct tc35815_local *lp = netdev_priv(dev);
 		int pid = lp->phy_addr;
 		if (!(tc_mdio_read(dev, pid, MII_BMSR) & BMSR_LSTATUS))
 			return;
@@ -2077,7 +2077,7 @@ tc35815_set_multicast_list(struct net_device *dev)
 
 static void tc35815_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	strcpy(info->driver, MODNAME);
 	strcpy(info->version, DRV_VERSION);
 	strcpy(info->bus_info, pci_name(lp->pci_dev));
@@ -2085,7 +2085,7 @@ static void tc35815_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *
 
 static int tc35815_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	spin_lock_irq(&lp->lock);
 	mii_ethtool_gset(&lp->mii, cmd);
 	spin_unlock_irq(&lp->lock);
@@ -2094,7 +2094,7 @@ static int tc35815_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 
 static int tc35815_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	int rc;
 #if 1	/* use our negotiation method... */
 	/* Verify the settings we care about. */
@@ -2124,7 +2124,7 @@ static int tc35815_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 
 static int tc35815_nway_reset(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	int rc;
 	spin_lock_irq(&lp->lock);
 	rc = mii_nway_restart(&lp->mii);
@@ -2134,7 +2134,7 @@ static int tc35815_nway_reset(struct net_device *dev)
 
 static u32 tc35815_get_link(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	int rc;
 	spin_lock_irq(&lp->lock);
 	rc = mii_link_ok(&lp->mii);
@@ -2144,19 +2144,19 @@ static u32 tc35815_get_link(struct net_device *dev)
 
 static u32 tc35815_get_msglevel(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	return lp->msg_enable;
 }
 
 static void tc35815_set_msglevel(struct net_device *dev, u32 datum)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	lp->msg_enable = datum;
 }
 
 static int tc35815_get_sset_count(struct net_device *dev, int sset)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 
 	switch (sset) {
 	case ETH_SS_STATS:
@@ -2168,7 +2168,7 @@ static int tc35815_get_sset_count(struct net_device *dev, int sset)
 
 static void tc35815_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *stats, u64 *data)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	data[0] = lp->lstats.max_tx_qlen;
 	data[1] = lp->lstats.tx_ints;
 	data[2] = lp->lstats.rx_ints;
@@ -2204,7 +2204,7 @@ static const struct ethtool_ops tc35815_ethtool_ops = {
 
 static int tc35815_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	int rc;
 
 	if (!netif_running(dev))
@@ -2276,7 +2276,7 @@ static void tc_mdio_write(struct net_device *dev, int phy_id, int location,
 
 static int tc35815_try_next_permutation(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	int pid = lp->phy_addr;
 	unsigned short bmcr;
 
@@ -2305,7 +2305,7 @@ static int tc35815_try_next_permutation(struct net_device *dev)
 static void
 tc35815_display_link_mode(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	int pid = lp->phy_addr;
 	unsigned short lpa, bmcr;
 	char *speed = "", *duplex = "";
@@ -2331,7 +2331,7 @@ tc35815_display_link_mode(struct net_device *dev)
 
 static void tc35815_display_forced_link_mode(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	int pid = lp->phy_addr;
 	unsigned short bmcr;
 	char *speed = "", *duplex = "";
@@ -2353,7 +2353,7 @@ static void tc35815_display_forced_link_mode(struct net_device *dev)
 
 static void tc35815_set_link_modes(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	struct tc35815_regs __iomem *tr =
 		(struct tc35815_regs __iomem *)dev->base_addr;
 	int pid = lp->phy_addr;
@@ -2420,7 +2420,7 @@ static void tc35815_set_link_modes(struct net_device *dev)
 static void tc35815_timer(unsigned long data)
 {
 	struct net_device *dev = (struct net_device *)data;
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	int pid = lp->phy_addr;
 	unsigned short bmsr, bmcr, lpa;
 	int restart_timer = 0;
@@ -2628,7 +2628,7 @@ out:
 static void tc35815_start_auto_negotiation(struct net_device *dev,
 					   struct ethtool_cmd *ep)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	int pid = lp->phy_addr;
 	unsigned short bmsr, bmcr, advertize;
 	int timeout;
@@ -2752,7 +2752,7 @@ force_link:
 
 static void tc35815_find_phy(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	int pid = lp->phy_addr;
 	unsigned short id0;
 
@@ -2781,7 +2781,7 @@ static void tc35815_find_phy(struct net_device *dev)
 
 static void tc35815_phy_chip_init(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	int pid = lp->phy_addr;
 	unsigned short bmcr;
 	struct ethtool_cmd ecmd, *ep;
@@ -2855,7 +2855,7 @@ static void tc35815_chip_reset(struct net_device *dev)
 
 static void tc35815_chip_init(struct net_device *dev)
 {
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	struct tc35815_regs __iomem *tr =
 		(struct tc35815_regs __iomem *)dev->base_addr;
 	unsigned long txctl = TX_CTL_CMD;
@@ -2917,7 +2917,7 @@ static void tc35815_chip_init(struct net_device *dev)
 static int tc35815_suspend(struct pci_dev *pdev, pm_message_t state)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	unsigned long flags;
 
 	pci_save_state(pdev);
@@ -2935,7 +2935,7 @@ static int tc35815_suspend(struct pci_dev *pdev, pm_message_t state)
 static int tc35815_resume(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
-	struct tc35815_local *lp = dev->priv;
+	struct tc35815_local *lp = netdev_priv(dev);
 	unsigned long flags;
 
 	pci_restore_state(pdev);

From anemo@mba.ocn.ne.jp Thu Apr 10 17:27:17 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 10 Apr 2008 17:27:27 +0200 (CEST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:3543 "EHLO smtp.mba.ocn.ne.jp")
	by lappi.linux-mips.net with ESMTP id S1784252AbYDJPZN (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 10 Apr 2008 17:25:13 +0200
Received: from localhost (p5205-ipad206funabasi.chiba.ocn.ne.jp [222.145.79.205])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 19D5EB48D; Fri, 11 Apr 2008 00:23:54 +0900 (JST)
Date:	Fri, 11 Apr 2008 00:24:45 +0900 (JST)
Message-Id: <20080411.002445.122254468.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	Jeff Garzik <jeff@garzik.org>, netdev@vger.kernel.org
Subject: [PATCH 4/6] tc35815: Use managed pci iomap helper
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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18888
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 4778
Lines: 187

Use managed pci functions and kill unnecessary volatiles.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
 drivers/net/tc35815.c |  121 +++++++++++++++---------------------------------
 1 files changed, 38 insertions(+), 83 deletions(-)

diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
index 5f4a14f..60eff78 100644
--- a/drivers/net/tc35815.c
+++ b/drivers/net/tc35815.c
@@ -94,37 +94,37 @@ static struct tc35815_options {
  * Registers
  */
 struct tc35815_regs {
-	volatile __u32 DMA_Ctl;		/* 0x00 */
-	volatile __u32 TxFrmPtr;
-	volatile __u32 TxThrsh;
-	volatile __u32 TxPollCtr;
-	volatile __u32 BLFrmPtr;
-	volatile __u32 RxFragSize;
-	volatile __u32 Int_En;
-	volatile __u32 FDA_Bas;
-	volatile __u32 FDA_Lim;		/* 0x20 */
-	volatile __u32 Int_Src;
-	volatile __u32 unused0[2];
-	volatile __u32 PauseCnt;
-	volatile __u32 RemPauCnt;
-	volatile __u32 TxCtlFrmStat;
-	volatile __u32 unused1;
-	volatile __u32 MAC_Ctl;		/* 0x40 */
-	volatile __u32 CAM_Ctl;
-	volatile __u32 Tx_Ctl;
-	volatile __u32 Tx_Stat;
-	volatile __u32 Rx_Ctl;
-	volatile __u32 Rx_Stat;
-	volatile __u32 MD_Data;
-	volatile __u32 MD_CA;
-	volatile __u32 CAM_Adr;		/* 0x60 */
-	volatile __u32 CAM_Data;
-	volatile __u32 CAM_Ena;
-	volatile __u32 PROM_Ctl;
-	volatile __u32 PROM_Data;
-	volatile __u32 Algn_Cnt;
-	volatile __u32 CRC_Cnt;
-	volatile __u32 Miss_Cnt;
+	__u32 DMA_Ctl;		/* 0x00 */
+	__u32 TxFrmPtr;
+	__u32 TxThrsh;
+	__u32 TxPollCtr;
+	__u32 BLFrmPtr;
+	__u32 RxFragSize;
+	__u32 Int_En;
+	__u32 FDA_Bas;
+	__u32 FDA_Lim;		/* 0x20 */
+	__u32 Int_Src;
+	__u32 unused0[2];
+	__u32 PauseCnt;
+	__u32 RemPauCnt;
+	__u32 TxCtlFrmStat;
+	__u32 unused1;
+	__u32 MAC_Ctl;		/* 0x40 */
+	__u32 CAM_Ctl;
+	__u32 Tx_Ctl;
+	__u32 Tx_Stat;
+	__u32 Rx_Ctl;
+	__u32 Rx_Stat;
+	__u32 MD_Data;
+	__u32 MD_CA;
+	__u32 CAM_Adr;		/* 0x60 */
+	__u32 CAM_Data;
+	__u32 CAM_Ena;
+	__u32 PROM_Ctl;
+	__u32 PROM_Data;
+	__u32 Algn_Cnt;
+	__u32 CRC_Cnt;
+	__u32 Miss_Cnt;
 };
 
 /*
@@ -396,8 +396,8 @@ struct FrFD {
 };
 
 
-#define tc_readl(addr)	readl(addr)
-#define tc_writel(d, addr)	writel(d, addr)
+#define tc_readl(addr)	ioread32(addr)
+#define tc_writel(d, addr)	iowrite32(d, addr)
 
 #define TC35815_TX_TIMEOUT  msecs_to_jiffies(400)
 
@@ -663,7 +663,6 @@ static int __devinit tc35815_init_one (struct pci_dev *pdev,
 	struct net_device *dev;
 	struct tc35815_local *lp;
 	int rc;
-	unsigned long mmio_start, mmio_end, mmio_flags, mmio_len;
 	DECLARE_MAC_BUF(mac);
 
 	static int printed_version;
@@ -690,45 +689,14 @@ static int __devinit tc35815_init_one (struct pci_dev *pdev,
 	lp->dev = dev;
 
 	/* enable device (incl. PCI PM wakeup), and bus-mastering */
-	rc = pci_enable_device (pdev);
+	rc = pcim_enable_device(pdev);
 	if (rc)
 		goto err_out;
-
-	mmio_start = pci_resource_start (pdev, 1);
-	mmio_end = pci_resource_end (pdev, 1);
-	mmio_flags = pci_resource_flags (pdev, 1);
-	mmio_len = pci_resource_len (pdev, 1);
-
-	/* set this immediately, we need to know before
-	 * we talk to the chip directly */
-
-	/* make sure PCI base addr 1 is MMIO */
-	if (!(mmio_flags & IORESOURCE_MEM)) {
-		dev_err(&pdev->dev, "region #1 not an MMIO resource, aborting\n");
-		rc = -ENODEV;
-		goto err_out;
-	}
-
-	/* check for weird/broken PCI region reporting */
-	if ((mmio_len < sizeof(struct tc35815_regs))) {
-		dev_err(&pdev->dev, "Invalid PCI region size(s), aborting\n");
-		rc = -ENODEV;
-		goto err_out;
-	}
-
-	rc = pci_request_regions (pdev, MODNAME);
+	rc = pcim_iomap_regions(pdev, 1 << 1, MODNAME);
 	if (rc)
 		goto err_out;
-
-	pci_set_master (pdev);
-
-	/* ioremap MMIO region */
-	ioaddr = ioremap (mmio_start, mmio_len);
-	if (ioaddr == NULL) {
-		dev_err(&pdev->dev, "cannot remap MMIO, aborting\n");
-		rc = -EIO;
-		goto err_out_free_res;
-	}
+	pci_set_master(pdev);
+	ioaddr = pcim_iomap_table(pdev)[1];
 
 	/* Initialize the device structure. */
 	dev->open = tc35815_open;
@@ -768,7 +736,7 @@ static int __devinit tc35815_init_one (struct pci_dev *pdev,
 
 	rc = register_netdev (dev);
 	if (rc)
-		goto err_out_unmap;
+		goto err_out;
 
 	memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
 	printk(KERN_INFO "%s: %s at 0x%lx, %s, IRQ %d\n",
@@ -791,10 +759,6 @@ static int __devinit tc35815_init_one (struct pci_dev *pdev,
 
 	return 0;
 
-err_out_unmap:
-	iounmap(ioaddr);
-err_out_free_res:
-	pci_release_regions (pdev);
 err_out:
 	free_netdev (dev);
 	return rc;
@@ -804,17 +768,8 @@ err_out:
 static void __devexit tc35815_remove_one (struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata (pdev);
-	unsigned long mmio_addr;
-
-	mmio_addr = dev->base_addr;
 
 	unregister_netdev (dev);
-
-	if (mmio_addr) {
-		iounmap ((void __iomem *)mmio_addr);
-		pci_release_regions (pdev);
-	}
-
 	free_netdev (dev);
 
 	pci_set_drvdata (pdev, NULL);

From anemo@mba.ocn.ne.jp Thu Apr 10 17:27:58 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 10 Apr 2008 17:28:08 +0200 (CEST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:24801 "EHLO smtp.mba.ocn.ne.jp")
	by lappi.linux-mips.net with ESMTP id S1784254AbYDJP0R (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 10 Apr 2008 17:26:17 +0200
Received: from localhost (p5205-ipad206funabasi.chiba.ocn.ne.jp [222.145.79.205])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id A6CD1B555; Fri, 11 Apr 2008 00:24:31 +0900 (JST)
Date:	Fri, 11 Apr 2008 00:25:23 +0900 (JST)
Message-Id: <20080411.002523.18305938.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	Jeff Garzik <jeff@garzik.org>, netdev@vger.kernel.org
Subject: [PATCH 5/6] tc35815: Use generic PHY layer
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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18889
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 38357
Lines: 1293

Convert the tc35815 driver to use the generic PHY layer in
drivers/net/phy.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
 drivers/net/Kconfig   |    2 +-
 drivers/net/tc35815.c | 1028 ++++++++++++++-----------------------------------
 2 files changed, 291 insertions(+), 739 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 757ba15..c1f2fd5 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1431,7 +1431,7 @@ config CS89x0
 config TC35815
 	tristate "TOSHIBA TC35815 Ethernet support"
 	depends on NET_PCI && PCI && MIPS
-	select MII
+	select PHYLIB
 
 config EEPRO100
 	tristate "EtherExpressPro/100 support (eepro100, original Becker driver)"
diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
index 60eff78..de8b18e 100644
--- a/drivers/net/tc35815.c
+++ b/drivers/net/tc35815.c
@@ -23,9 +23,9 @@
  */
 
 #ifdef TC35815_NAPI
-#define DRV_VERSION	"1.36-NAPI"
+#define DRV_VERSION	"1.37-NAPI"
 #else
-#define DRV_VERSION	"1.36"
+#define DRV_VERSION	"1.37"
 #endif
 static const char *version = "tc35815.c:v" DRV_VERSION "\n";
 #define MODNAME			"tc35815"
@@ -47,8 +47,8 @@ static const char *version = "tc35815.c:v" DRV_VERSION "\n";
 #include <linux/skbuff.h>
 #include <linux/delay.h>
 #include <linux/pci.h>
-#include <linux/mii.h>
-#include <linux/ethtool.h>
+#include <linux/phy.h>
+#include <linux/workqueue.h>
 #include <linux/platform_device.h>
 #include <asm/io.h>
 #include <asm/byteorder.h>
@@ -87,7 +87,6 @@ MODULE_DEVICE_TABLE (pci, tc35815_pci_tbl);
 static struct tc35815_options {
 	int speed;
 	int duplex;
-	int doforce;
 } options;
 
 /*
@@ -401,15 +400,6 @@ struct FrFD {
 
 #define TC35815_TX_TIMEOUT  msecs_to_jiffies(400)
 
-/* Timer state engine. */
-enum tc35815_timer_state {
-	arbwait  = 0,	/* Waiting for auto negotiation to complete.          */
-	lupwait  = 1,	/* Auto-neg complete, awaiting link-up status.        */
-	ltrywait = 2,	/* Forcing try of all modes, from fastest to slowest. */
-	asleep   = 3,	/* Time inactive.                                     */
-	lcheck   = 4,	/* Check link status.                                 */
-};
-
 /* Information that need to be kept for each board. */
 struct tc35815_local {
 	struct pci_dev *pci_dev;
@@ -432,12 +422,12 @@ struct tc35815_local {
 	 */
 	spinlock_t lock;
 
-	int phy_addr;
-	int fullduplex;
-	unsigned short saved_lpa;
-	struct timer_list timer;
-	enum tc35815_timer_state timer_state; /* State of auto-neg timer. */
-	unsigned int timer_ticks;	/* Number of clicks at each state  */
+	struct mii_bus mii_bus;
+	struct phy_device *phy_dev;
+	int duplex;
+	int speed;
+	int link;
+	struct work_struct restart_work;
 
 	/*
 	 * Transmitting: Batch Mode.
@@ -475,8 +465,6 @@ struct tc35815_local {
 		dma_addr_t skb_dma;
 	} tx_skbs[TX_FD_NUM], rx_skbs[RX_BUF_NUM];
 #endif
-	struct mii_if_info mii;
-	unsigned short mii_id[2];
 	u32 msg_enable;
 	board_t boardtype;
 };
@@ -586,19 +574,218 @@ static const struct ethtool_ops tc35815_ethtool_ops;
 /* Example routines you must write ;->. */
 static void 	tc35815_chip_reset(struct net_device *dev);
 static void 	tc35815_chip_init(struct net_device *dev);
-static void	tc35815_find_phy(struct net_device *dev);
-static void 	tc35815_phy_chip_init(struct net_device *dev);
 
 #ifdef DEBUG
 static void	panic_queues(struct net_device *dev);
 #endif
 
-static void tc35815_timer(unsigned long data);
-static void tc35815_start_auto_negotiation(struct net_device *dev,
-					   struct ethtool_cmd *ep);
-static int tc_mdio_read(struct net_device *dev, int phy_id, int location);
-static void tc_mdio_write(struct net_device *dev, int phy_id, int location,
-			  int val);
+static void tc35815_restart_work(struct work_struct *work);
+
+static int tc_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
+{
+	struct net_device *dev = bus->priv;
+	struct tc35815_regs __iomem *tr =
+		(struct tc35815_regs __iomem *)dev->base_addr;
+	unsigned long timeout = jiffies + 10;
+
+	tc_writel(MD_CA_Busy | (mii_id << 5) | (regnum & 0x1f), &tr->MD_CA);
+	while (tc_readl(&tr->MD_CA) & MD_CA_Busy) {
+		if (time_after(jiffies, timeout))
+			return -EIO;
+		cpu_relax();
+	}
+	return tc_readl(&tr->MD_Data) & 0xffff;
+}
+
+static int tc_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 val)
+{
+	struct net_device *dev = bus->priv;
+	struct tc35815_regs __iomem *tr =
+		(struct tc35815_regs __iomem *)dev->base_addr;
+	unsigned long timeout = jiffies + 10;
+
+	tc_writel(val, &tr->MD_Data);
+	tc_writel(MD_CA_Busy | MD_CA_Wr | (mii_id << 5) | (regnum & 0x1f),
+		  &tr->MD_CA);
+	while (tc_readl(&tr->MD_CA) & MD_CA_Busy) {
+		if (time_after(jiffies, timeout))
+			return -EIO;
+		cpu_relax();
+	}
+	return 0;
+}
+
+static void tc_handle_link_change(struct net_device *dev)
+{
+	struct tc35815_local *lp = netdev_priv(dev);
+	struct phy_device *phydev = lp->phy_dev;
+	unsigned long flags;
+	int status_change = 0;
+
+	spin_lock_irqsave(&lp->lock, flags);
+	if (phydev->link &&
+	    (lp->speed != phydev->speed || lp->duplex != phydev->duplex)) {
+		struct tc35815_regs __iomem *tr =
+			(struct tc35815_regs __iomem *)dev->base_addr;
+		u32 reg;
+
+		reg = tc_readl(&tr->MAC_Ctl);
+		reg |= MAC_HaltReq;
+		tc_writel(reg, &tr->MAC_Ctl);
+		if (phydev->duplex == DUPLEX_FULL)
+			reg |= MAC_FullDup;
+		else
+			reg &= ~MAC_FullDup;
+		tc_writel(reg, &tr->MAC_Ctl);
+		reg &= ~MAC_HaltReq;
+		tc_writel(reg, &tr->MAC_Ctl);
+
+		/*
+		 * TX4939 PCFG.SPEEDn bit will be changed on
+		 * NETDEV_CHANGE event.
+		 */
+
+#if !defined(NO_CHECK_CARRIER) && defined(WORKAROUND_LOSTCAR)
+		/*
+		 * WORKAROUND: enable LostCrS only if half duplex
+		 * operation.
+		 * (TX4939 does not have EnLCarr)
+		 */
+		if (phydev->duplex == DUPLEX_HALF &&
+		    lp->boardtype != TC35815_TX4939)
+			tc_writel(tc_readl(&tr->Tx_Ctl) | Tx_EnLCarr,
+				  &tr->Tx_Ctl);
+#endif
+
+		lp->speed = phydev->speed;
+		lp->duplex = phydev->duplex;
+		status_change = 1;
+	}
+
+	if (phydev->link != lp->link) {
+		if (phydev->link) {
+#ifdef WORKAROUND_100HALF_PROMISC
+			/* delayed promiscuous enabling */
+			if (dev->flags & IFF_PROMISC)
+				tc35815_set_multicast_list(dev);
+#endif
+			netif_schedule(dev);
+		} else {
+			lp->speed = 0;
+			lp->duplex = -1;
+		}
+		lp->link = phydev->link;
+
+		status_change = 1;
+	}
+	spin_unlock_irqrestore(&lp->lock, flags);
+
+	if (status_change && netif_msg_link(lp)) {
+		phy_print_status(phydev);
+#ifdef DEBUG
+		printk(KERN_DEBUG
+		       "%s: MII BMCR %04x BMSR %04x LPA %04x\n",
+		       dev->name,
+		       phy_read(phydev, MII_BMCR),
+		       phy_read(phydev, MII_BMSR),
+		       phy_read(phydev, MII_LPA));
+#endif
+	}
+}
+
+static int tc_mii_probe(struct net_device *dev)
+{
+	struct tc35815_local *lp = netdev_priv(dev);
+	struct phy_device *phydev = NULL;
+	int phy_addr;
+
+	/* find the first phy */
+	for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++) {
+		if (lp->mii_bus.phy_map[phy_addr]) {
+			phydev = lp->mii_bus.phy_map[phy_addr];
+			break;
+		}
+	}
+
+	if (!phydev) {
+		printk(KERN_ERR "%s: no PHY found\n", dev->name);
+		return -ENODEV;
+	}
+
+	/* attach the mac to the phy */
+	phydev = phy_connect(dev, phydev->dev.bus_id,
+			     &tc_handle_link_change, 0,
+			     lp->boardtype == TC35815_TX4939 ?
+			     PHY_INTERFACE_MODE_RMII : PHY_INTERFACE_MODE_MII);
+	if (IS_ERR(phydev)) {
+		printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name);
+		return PTR_ERR(phydev);
+	}
+	printk(KERN_INFO "%s: attached PHY driver [%s] "
+		"(mii_bus:phy_addr=%s, id=%x)\n",
+		dev->name, phydev->drv->name, phydev->dev.bus_id,
+		phydev->phy_id);
+
+	/* mask with MAC supported features */
+	phydev->supported &= PHY_BASIC_FEATURES;
+	if (options.speed == 10)
+		phydev->supported &=
+			~(SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full);
+	else if (options.speed == 100)
+		phydev->supported &=
+			~(SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full);
+	if (options.duplex == 1)
+		phydev->supported &=
+			~(SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Full);
+	else if (options.duplex == 2)
+		phydev->supported &=
+			~(SUPPORTED_10baseT_Half | SUPPORTED_100baseT_Half);
+	phydev->advertising = phydev->supported;
+
+	lp->link = 0;
+	lp->speed = 0;
+	lp->duplex = -1;
+	lp->phy_dev = phydev;
+
+	return 0;
+}
+
+static int tc_mii_init(struct net_device *dev)
+{
+	struct tc35815_local *lp = netdev_priv(dev);
+	int err;
+	int i;
+
+	lp->mii_bus.name = "tc35815_mii_bus",
+	lp->mii_bus.read = tc_mdio_read,
+	lp->mii_bus.write = tc_mdio_write,
+	lp->mii_bus.id = lp->pci_dev->devfn,
+	lp->mii_bus.priv = dev,
+	lp->mii_bus.dev = &lp->pci_dev->dev;
+	lp->mii_bus.irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
+	if (!lp->mii_bus.irq) {
+		err = -ENOMEM;
+		goto err_out;
+	}
+
+	for (i = 0; i < PHY_MAX_ADDR; i++)
+		lp->mii_bus.irq[i] = PHY_POLL;
+
+	err = mdiobus_register(&lp->mii_bus);
+	if (err)
+		goto err_out_free_mdio_irq;
+	err = tc_mii_probe(dev);
+	if (err)
+		goto err_out_unregister_bus;
+	return 0;
+
+err_out_unregister_bus:
+	mdiobus_unregister(&lp->mii_bus);
+err_out_free_mdio_irq:
+	kfree(lp->mii_bus.irq);
+err_out:
+	return err;
+}
 
 #ifdef CONFIG_CPU_TX49XX
 /*
@@ -669,8 +856,8 @@ static int __devinit tc35815_init_one (struct pci_dev *pdev,
 	if (!printed_version++) {
 		printk(version);
 		dev_printk(KERN_DEBUG, &pdev->dev,
-			   "speed:%d duplex:%d doforce:%d\n",
-			   options.speed, options.duplex, options.doforce);
+			   "speed:%d duplex:%d\n",
+			   options.speed, options.duplex);
 	}
 
 	if (!pdev->irq) {
@@ -718,6 +905,7 @@ static int __devinit tc35815_init_one (struct pci_dev *pdev,
 	dev->irq = pdev->irq;
 	dev->base_addr = (unsigned long) ioaddr;
 
+	INIT_WORK(&lp->restart_work, tc35815_restart_work);
 	spin_lock_init(&lp->lock);
 	lp->pci_dev = pdev;
 	lp->boardtype = ent->driver_data;
@@ -746,19 +934,14 @@ static int __devinit tc35815_init_one (struct pci_dev *pdev,
 		print_mac(mac, dev->dev_addr),
 		dev->irq);
 
-	setup_timer(&lp->timer, tc35815_timer, (unsigned long) dev);
-	lp->mii.dev = dev;
-	lp->mii.mdio_read = tc_mdio_read;
-	lp->mii.mdio_write = tc_mdio_write;
-	lp->mii.phy_id_mask = 0x1f;
-	lp->mii.reg_num_mask = 0x1f;
-	tc35815_find_phy(dev);
-	lp->mii.phy_id = lp->phy_addr;
-	lp->mii.full_duplex = 0;
-	lp->mii.force_media = 0;
+	rc = tc_mii_init(dev);
+	if (rc)
+		goto err_out_unregister;
 
 	return 0;
 
+err_out_unregister:
+	unregister_netdev(dev);
 err_out:
 	free_netdev (dev);
 	return rc;
@@ -768,7 +951,11 @@ err_out:
 static void __devexit tc35815_remove_one (struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata (pdev);
+	struct tc35815_local *lp = netdev_priv(dev);
 
+	phy_disconnect(lp->phy_dev);
+	mdiobus_unregister(&lp->mii_bus);
+	kfree(lp->mii_bus.irq);
 	unregister_netdev (dev);
 	free_netdev (dev);
 
@@ -1098,20 +1285,15 @@ static int tc35815_tx_full(struct net_device *dev)
 static void tc35815_restart(struct net_device *dev)
 {
 	struct tc35815_local *lp = netdev_priv(dev);
-	int pid = lp->phy_addr;
-	int do_phy_reset = 1;
-	del_timer(&lp->timer);		/* Kill if running	*/
 
-	if (lp->mii_id[0] == 0x0016 && (lp->mii_id[1] & 0xfc00) == 0xf800) {
+	if (lp->phy_dev && (lp->phy_dev->phy_id & 0xfffffc00) != 0x0016f800) {
 		/* Resetting PHY cause problem on some chip... (SEEQ 80221) */
-		do_phy_reset = 0;
-	}
-	if (do_phy_reset) {
 		int timeout;
-		tc_mdio_write(dev, pid, MII_BMCR, BMCR_RESET);
+
+		phy_write(lp->phy_dev, MII_BMCR, BMCR_RESET);
 		timeout = 100;
 		while (--timeout) {
-			if (!(tc_mdio_read(dev, pid, MII_BMCR) & BMCR_RESET))
+			if (!(phy_read(lp->phy_dev, MII_BMCR) & BMCR_RESET))
 				break;
 			udelay(1);
 		}
@@ -1119,41 +1301,49 @@ static void tc35815_restart(struct net_device *dev)
 			printk(KERN_ERR "%s: BMCR reset failed.\n", dev->name);
 	}
 
+	spin_lock_irq(&lp->lock);
 	tc35815_chip_reset(dev);
 	tc35815_clear_queues(dev);
 	tc35815_chip_init(dev);
 	/* Reconfigure CAM again since tc35815_chip_init() initialize it. */
 	tc35815_set_multicast_list(dev);
+	spin_unlock_irq(&lp->lock);
+
+	netif_wake_queue(dev);
 }
 
-static void tc35815_tx_timeout(struct net_device *dev)
+static void tc35815_restart_work(struct work_struct *work)
+{
+	struct tc35815_local *lp =
+		container_of(work, struct tc35815_local, restart_work);
+	struct net_device *dev = lp->dev;
+
+	tc35815_restart(dev);
+}
+
+static void tc35815_schedule_restart(struct net_device *dev)
 {
 	struct tc35815_local *lp = netdev_priv(dev);
 	struct tc35815_regs __iomem *tr =
 		(struct tc35815_regs __iomem *)dev->base_addr;
 
+	/* disable interrupts */
+	tc_writel(0, &tr->Int_En);
+	tc_writel(tc_readl(&tr->DMA_Ctl) | DMA_IntMask, &tr->DMA_Ctl);
+	schedule_work(&lp->restart_work);
+}
+
+static void tc35815_tx_timeout(struct net_device *dev)
+{
+	struct tc35815_regs __iomem *tr =
+		(struct tc35815_regs __iomem *)dev->base_addr;
+
 	printk(KERN_WARNING "%s: transmit timed out, status %#x\n",
 	       dev->name, tc_readl(&tr->Tx_Stat));
 
 	/* Try to restart the adaptor. */
-	spin_lock_irq(&lp->lock);
-	tc35815_restart(dev);
-	spin_unlock_irq(&lp->lock);
-
+	tc35815_schedule_restart(dev);
 	dev->stats.tx_errors++;
-
-	/* If we have space available to accept new transmit
-	 * requests, wake up the queueing layer.  This would
-	 * be the case if the chipset_init() call above just
-	 * flushes out the tx queue and empties it.
-	 *
-	 * If instead, the tx queue is retained then the
-	 * netif_wake_queue() call should be placed in the
-	 * TX completion interrupt handler of the driver instead
-	 * of here.
-	 */
-	if (!tc35815_tx_full(dev))
-		netif_wake_queue(dev);
 }
 
 /*
@@ -1177,7 +1367,6 @@ tc35815_open(struct net_device *dev)
 		return -EAGAIN;
 	}
 
-	del_timer(&lp->timer);		/* Kill if running	*/
 	tc35815_chip_reset(dev);
 
 	if (tc35815_init_queues(dev) != 0) {
@@ -1194,6 +1383,9 @@ tc35815_open(struct net_device *dev)
 	tc35815_chip_init(dev);
 	spin_unlock_irq(&lp->lock);
 
+	/* schedule a link state check */
+	phy_start(lp->phy_dev);
+
 	/* We are now ready to accept transmit requeusts from
 	 * the queueing layer of the networking.
 	 */
@@ -1314,7 +1506,7 @@ static void tc35815_fatal_error_interrupt(struct net_device *dev, u32 status)
 		panic("%s: Too many fatal errors.", dev->name);
 	printk(KERN_WARNING "%s: Resetting ...\n", dev->name);
 	/* Try to restart the adaptor. */
-	tc35815_restart(dev);
+	tc35815_schedule_restart(dev);
 }
 
 #ifdef TC35815_NAPI
@@ -1739,8 +1931,9 @@ tc35815_check_tx_stat(struct net_device *dev, int status)
 		status &= ~Tx_NCarr;
 #ifdef WORKAROUND_LOSTCAR
 	/* WORKAROUND: ignore LostCrS in full duplex operation */
-	if ((lp->timer_state != asleep && lp->timer_state != lcheck)
-	    || lp->fullduplex)
+	if (!(lp->phy_dev->state == PHY_RUNNING ||
+	      lp->phy_dev->state == PHY_CHANGELINK) ||
+	    lp->duplex == DUPLEX_FULL)
 		status &= ~Tx_NCarr;
 #endif
 #endif
@@ -1905,10 +2098,11 @@ tc35815_close(struct net_device *dev)
 #ifdef TC35815_NAPI
 	napi_disable(&lp->napi);
 #endif
+	if (lp->phy_dev)
+		phy_stop(lp->phy_dev);
+	cancel_work_sync(&lp->restart_work);
 
 	/* Flush the Tx and disable Rx here. */
-
-	del_timer(&lp->timer);		/* Kill if running	*/
 	tc35815_chip_reset(dev);
 	free_irq(dev->irq, dev);
 
@@ -1993,8 +2187,8 @@ tc35815_set_multicast_list(struct net_device *dev)
 		/* With some (all?) 100MHalf HUB, controller will hang
 		 * if we enabled promiscuous mode before linkup... */
 		struct tc35815_local *lp = netdev_priv(dev);
-		int pid = lp->phy_addr;
-		if (!(tc_mdio_read(dev, pid, MII_BMSR) & BMSR_LSTATUS))
+
+		if (!lp->link)
 			return;
 #endif
 		/* Enable promiscuous mode */
@@ -2041,60 +2235,19 @@ static void tc35815_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *
 static int tc35815_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 {
 	struct tc35815_local *lp = netdev_priv(dev);
-	spin_lock_irq(&lp->lock);
-	mii_ethtool_gset(&lp->mii, cmd);
-	spin_unlock_irq(&lp->lock);
-	return 0;
-}
-
-static int tc35815_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
-{
-	struct tc35815_local *lp = netdev_priv(dev);
-	int rc;
-#if 1	/* use our negotiation method... */
-	/* Verify the settings we care about. */
-	if (cmd->autoneg != AUTONEG_ENABLE &&
-	    cmd->autoneg != AUTONEG_DISABLE)
-		return -EINVAL;
-	if (cmd->autoneg == AUTONEG_DISABLE &&
-	    ((cmd->speed != SPEED_100 &&
-	      cmd->speed != SPEED_10) ||
-	     (cmd->duplex != DUPLEX_HALF &&
-	      cmd->duplex != DUPLEX_FULL)))
-		return -EINVAL;
 
-	/* Ok, do it to it. */
-	spin_lock_irq(&lp->lock);
-	del_timer(&lp->timer);
-	tc35815_start_auto_negotiation(dev, cmd);
-	spin_unlock_irq(&lp->lock);
-	rc = 0;
-#else
-	spin_lock_irq(&lp->lock);
-	rc = mii_ethtool_sset(&lp->mii, cmd);
-	spin_unlock_irq(&lp->lock);
-#endif
-	return rc;
+	if (!lp->phy_dev)
+		return -ENODEV;
+	return phy_ethtool_gset(lp->phy_dev, cmd);
 }
 
-static int tc35815_nway_reset(struct net_device *dev)
+static int tc35815_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 {
 	struct tc35815_local *lp = netdev_priv(dev);
-	int rc;
-	spin_lock_irq(&lp->lock);
-	rc = mii_nway_restart(&lp->mii);
-	spin_unlock_irq(&lp->lock);
-	return rc;
-}
 
-static u32 tc35815_get_link(struct net_device *dev)
-{
-	struct tc35815_local *lp = netdev_priv(dev);
-	int rc;
-	spin_lock_irq(&lp->lock);
-	rc = mii_link_ok(&lp->mii);
-	spin_unlock_irq(&lp->lock);
-	return rc;
+	if (!lp->phy_dev)
+		return -ENODEV;
+	return phy_ethtool_sset(lp->phy_dev, cmd);
 }
 
 static u32 tc35815_get_msglevel(struct net_device *dev)
@@ -2148,8 +2301,7 @@ static const struct ethtool_ops tc35815_ethtool_ops = {
 	.get_drvinfo		= tc35815_get_drvinfo,
 	.get_settings		= tc35815_get_settings,
 	.set_settings		= tc35815_set_settings,
-	.nway_reset		= tc35815_nway_reset,
-	.get_link		= tc35815_get_link,
+	.get_link		= ethtool_op_get_link,
 	.get_msglevel		= tc35815_get_msglevel,
 	.set_msglevel		= tc35815_set_msglevel,
 	.get_strings		= tc35815_get_strings,
@@ -2160,610 +2312,12 @@ static const struct ethtool_ops tc35815_ethtool_ops = {
 static int tc35815_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct tc35815_local *lp = netdev_priv(dev);
-	int rc;
 
 	if (!netif_running(dev))
 		return -EINVAL;
-
-	spin_lock_irq(&lp->lock);
-	rc = generic_mii_ioctl(&lp->mii, if_mii(rq), cmd, NULL);
-	spin_unlock_irq(&lp->lock);
-
-	return rc;
-}
-
-static int tc_mdio_read(struct net_device *dev, int phy_id, int location)
-{
-	struct tc35815_regs __iomem *tr =
-		(struct tc35815_regs __iomem *)dev->base_addr;
-	u32 data;
-	tc_writel(MD_CA_Busy | (phy_id << 5) | location, &tr->MD_CA);
-	while (tc_readl(&tr->MD_CA) & MD_CA_Busy)
-		;
-	data = tc_readl(&tr->MD_Data);
-	return data & 0xffff;
-}
-
-static void tc_mdio_write(struct net_device *dev, int phy_id, int location,
-			  int val)
-{
-	struct tc35815_regs __iomem *tr =
-		(struct tc35815_regs __iomem *)dev->base_addr;
-	tc_writel(val, &tr->MD_Data);
-	tc_writel(MD_CA_Busy | MD_CA_Wr | (phy_id << 5) | location, &tr->MD_CA);
-	while (tc_readl(&tr->MD_CA) & MD_CA_Busy)
-		;
-}
-
-/* Auto negotiation.  The scheme is very simple.  We have a timer routine
- * that keeps watching the auto negotiation process as it progresses.
- * The DP83840 is first told to start doing it's thing, we set up the time
- * and place the timer state machine in it's initial state.
- *
- * Here the timer peeks at the DP83840 status registers at each click to see
- * if the auto negotiation has completed, we assume here that the DP83840 PHY
- * will time out at some point and just tell us what (didn't) happen.  For
- * complete coverage we only allow so many of the ticks at this level to run,
- * when this has expired we print a warning message and try another strategy.
- * This "other" strategy is to force the interface into various speed/duplex
- * configurations and we stop when we see a link-up condition before the
- * maximum number of "peek" ticks have occurred.
- *
- * Once a valid link status has been detected we configure the BigMAC and
- * the rest of the Happy Meal to speak the most efficient protocol we could
- * get a clean link for.  The priority for link configurations, highest first
- * is:
- *                 100 Base-T Full Duplex
- *                 100 Base-T Half Duplex
- *                 10 Base-T Full Duplex
- *                 10 Base-T Half Duplex
- *
- * We start a new timer now, after a successful auto negotiation status has
- * been detected.  This timer just waits for the link-up bit to get set in
- * the BMCR of the DP83840.  When this occurs we print a kernel log message
- * describing the link type in use and the fact that it is up.
- *
- * If a fatal error of some sort is signalled and detected in the interrupt
- * service routine, and the chip is reset, or the link is ifconfig'd down
- * and then back up, this entire process repeats itself all over again.
- */
-/* Note: Above comments are come from sunhme driver. */
-
-static int tc35815_try_next_permutation(struct net_device *dev)
-{
-	struct tc35815_local *lp = netdev_priv(dev);
-	int pid = lp->phy_addr;
-	unsigned short bmcr;
-
-	bmcr = tc_mdio_read(dev, pid, MII_BMCR);
-
-	/* Downgrade from full to half duplex.  Only possible via ethtool.  */
-	if (bmcr & BMCR_FULLDPLX) {
-		bmcr &= ~BMCR_FULLDPLX;
-		printk(KERN_DEBUG "%s: try next permutation (BMCR %x)\n", dev->name, bmcr);
-		tc_mdio_write(dev, pid, MII_BMCR, bmcr);
-		return 0;
-	}
-
-	/* Downgrade from 100 to 10. */
-	if (bmcr & BMCR_SPEED100) {
-		bmcr &= ~BMCR_SPEED100;
-		printk(KERN_DEBUG "%s: try next permutation (BMCR %x)\n", dev->name, bmcr);
-		tc_mdio_write(dev, pid, MII_BMCR, bmcr);
-		return 0;
-	}
-
-	/* We've tried everything. */
-	return -1;
-}
-
-static void
-tc35815_display_link_mode(struct net_device *dev)
-{
-	struct tc35815_local *lp = netdev_priv(dev);
-	int pid = lp->phy_addr;
-	unsigned short lpa, bmcr;
-	char *speed = "", *duplex = "";
-
-	lpa = tc_mdio_read(dev, pid, MII_LPA);
-	bmcr = tc_mdio_read(dev, pid, MII_BMCR);
-	if (options.speed ? (bmcr & BMCR_SPEED100) : (lpa & (LPA_100HALF | LPA_100FULL)))
-		speed = "100Mb/s";
-	else
-		speed = "10Mb/s";
-	if (options.duplex ? (bmcr & BMCR_FULLDPLX) : (lpa & (LPA_100FULL | LPA_10FULL)))
-		duplex = "Full Duplex";
-	else
-		duplex = "Half Duplex";
-
-	if (netif_msg_link(lp))
-		printk(KERN_INFO "%s: Link is up at %s, %s.\n",
-		       dev->name, speed, duplex);
-	printk(KERN_DEBUG "%s: MII BMCR %04x BMSR %04x LPA %04x\n",
-	       dev->name,
-	       bmcr, tc_mdio_read(dev, pid, MII_BMSR), lpa);
-}
-
-static void tc35815_display_forced_link_mode(struct net_device *dev)
-{
-	struct tc35815_local *lp = netdev_priv(dev);
-	int pid = lp->phy_addr;
-	unsigned short bmcr;
-	char *speed = "", *duplex = "";
-
-	bmcr = tc_mdio_read(dev, pid, MII_BMCR);
-	if (bmcr & BMCR_SPEED100)
-		speed = "100Mb/s";
-	else
-		speed = "10Mb/s";
-	if (bmcr & BMCR_FULLDPLX)
-		duplex = "Full Duplex.\n";
-	else
-		duplex = "Half Duplex.\n";
-
-	if (netif_msg_link(lp))
-		printk(KERN_INFO "%s: Link has been forced up at %s, %s",
-		       dev->name, speed, duplex);
-}
-
-static void tc35815_set_link_modes(struct net_device *dev)
-{
-	struct tc35815_local *lp = netdev_priv(dev);
-	struct tc35815_regs __iomem *tr =
-		(struct tc35815_regs __iomem *)dev->base_addr;
-	int pid = lp->phy_addr;
-	unsigned short bmcr, lpa;
-	int speed;
-
-	if (lp->timer_state == arbwait) {
-		lpa = tc_mdio_read(dev, pid, MII_LPA);
-		bmcr = tc_mdio_read(dev, pid, MII_BMCR);
-		printk(KERN_DEBUG "%s: MII BMCR %04x BMSR %04x LPA %04x\n",
-		       dev->name,
-		       bmcr, tc_mdio_read(dev, pid, MII_BMSR), lpa);
-		if (!(lpa & (LPA_10HALF | LPA_10FULL |
-			     LPA_100HALF | LPA_100FULL))) {
-			/* fall back to 10HALF */
-			printk(KERN_INFO "%s: bad ability %04x - falling back to 10HD.\n",
-			       dev->name, lpa);
-			lpa = LPA_10HALF;
-		}
-		if (options.duplex ? (bmcr & BMCR_FULLDPLX) : (lpa & (LPA_100FULL | LPA_10FULL)))
-			lp->fullduplex = 1;
-		else
-			lp->fullduplex = 0;
-		if (options.speed ? (bmcr & BMCR_SPEED100) : (lpa & (LPA_100HALF | LPA_100FULL)))
-			speed = 100;
-		else
-			speed = 10;
-	} else {
-		/* Forcing a link mode. */
-		bmcr = tc_mdio_read(dev, pid, MII_BMCR);
-		if (bmcr & BMCR_FULLDPLX)
-			lp->fullduplex = 1;
-		else
-			lp->fullduplex = 0;
-		if (bmcr & BMCR_SPEED100)
-			speed = 100;
-		else
-			speed = 10;
-	}
-
-	tc_writel(tc_readl(&tr->MAC_Ctl) | MAC_HaltReq, &tr->MAC_Ctl);
-	if (lp->fullduplex) {
-		tc_writel(tc_readl(&tr->MAC_Ctl) | MAC_FullDup, &tr->MAC_Ctl);
-	} else {
-		tc_writel(tc_readl(&tr->MAC_Ctl) & ~MAC_FullDup, &tr->MAC_Ctl);
-	}
-	tc_writel(tc_readl(&tr->MAC_Ctl) & ~MAC_HaltReq, &tr->MAC_Ctl);
-
-	/* TX4939 PCFG.SPEEDn bit will be changed on NETDEV_CHANGE event. */
-
-#ifndef NO_CHECK_CARRIER
-	/* TX4939 does not have EnLCarr */
-	if (lp->boardtype != TC35815_TX4939) {
-#ifdef WORKAROUND_LOSTCAR
-		/* WORKAROUND: enable LostCrS only if half duplex operation */
-		if (!lp->fullduplex && lp->boardtype != TC35815_TX4939)
-			tc_writel(tc_readl(&tr->Tx_Ctl) | Tx_EnLCarr, &tr->Tx_Ctl);
-#endif
-	}
-#endif
-	lp->mii.full_duplex = lp->fullduplex;
-}
-
-static void tc35815_timer(unsigned long data)
-{
-	struct net_device *dev = (struct net_device *)data;
-	struct tc35815_local *lp = netdev_priv(dev);
-	int pid = lp->phy_addr;
-	unsigned short bmsr, bmcr, lpa;
-	int restart_timer = 0;
-
-	spin_lock_irq(&lp->lock);
-
-	lp->timer_ticks++;
-	switch (lp->timer_state) {
-	case arbwait:
-		/*
-		 * Only allow for 5 ticks, thats 10 seconds and much too
-		 * long to wait for arbitration to complete.
-		 */
-		/* TC35815 need more times... */
-		if (lp->timer_ticks >= 10) {
-			/* Enter force mode. */
-			if (!options.doforce) {
-				printk(KERN_NOTICE "%s: Auto-Negotiation unsuccessful,"
-				       " cable probblem?\n", dev->name);
-				/* Try to restart the adaptor. */
-				tc35815_restart(dev);
-				goto out;
-			}
-			printk(KERN_NOTICE "%s: Auto-Negotiation unsuccessful,"
-			       " trying force link mode\n", dev->name);
-			printk(KERN_DEBUG "%s: BMCR %x BMSR %x\n", dev->name,
-			       tc_mdio_read(dev, pid, MII_BMCR),
-			       tc_mdio_read(dev, pid, MII_BMSR));
-			bmcr = BMCR_SPEED100;
-			tc_mdio_write(dev, pid, MII_BMCR, bmcr);
-
-			/*
-			 * OK, seems we need do disable the transceiver
-			 * for the first tick to make sure we get an
-			 * accurate link state at the second tick.
-			 */
-
-			lp->timer_state = ltrywait;
-			lp->timer_ticks = 0;
-			restart_timer = 1;
-		} else {
-			/* Anything interesting happen? */
-			bmsr = tc_mdio_read(dev, pid, MII_BMSR);
-			if (bmsr & BMSR_ANEGCOMPLETE) {
-				/* Just what we've been waiting for... */
-				tc35815_set_link_modes(dev);
-
-				/*
-				 * Success, at least so far, advance our state
-				 * engine.
-				 */
-				lp->timer_state = lupwait;
-				restart_timer = 1;
-			} else {
-				restart_timer = 1;
-			}
-		}
-		break;
-
-	case lupwait:
-		/*
-		 * Auto negotiation was successful and we are awaiting a
-		 * link up status.  I have decided to let this timer run
-		 * forever until some sort of error is signalled, reporting
-		 * a message to the user at 10 second intervals.
-		 */
-		bmsr = tc_mdio_read(dev, pid, MII_BMSR);
-		if (bmsr & BMSR_LSTATUS) {
-			/*
-			 * Wheee, it's up, display the link mode in use and put
-			 * the timer to sleep.
-			 */
-			tc35815_display_link_mode(dev);
-			netif_carrier_on(dev);
-#ifdef WORKAROUND_100HALF_PROMISC
-			/* delayed promiscuous enabling */
-			if (dev->flags & IFF_PROMISC)
-				tc35815_set_multicast_list(dev);
-#endif
-#if 1
-			lp->saved_lpa = tc_mdio_read(dev, pid, MII_LPA);
-			lp->timer_state = lcheck;
-			restart_timer = 1;
-#else
-			lp->timer_state = asleep;
-			restart_timer = 0;
-#endif
-		} else {
-			if (lp->timer_ticks >= 10) {
-				printk(KERN_NOTICE "%s: Auto negotiation successful, link still "
-				       "not completely up.\n", dev->name);
-				lp->timer_ticks = 0;
-				restart_timer = 1;
-			} else {
-				restart_timer = 1;
-			}
-		}
-		break;
-
-	case ltrywait:
-		/*
-		 * Making the timeout here too long can make it take
-		 * annoyingly long to attempt all of the link mode
-		 * permutations, but then again this is essentially
-		 * error recovery code for the most part.
-		 */
-		bmsr = tc_mdio_read(dev, pid, MII_BMSR);
-		bmcr = tc_mdio_read(dev, pid, MII_BMCR);
-		if (lp->timer_ticks == 1) {
-			/*
-			 * Re-enable transceiver, we'll re-enable the
-			 * transceiver next tick, then check link state
-			 * on the following tick.
-			 */
-			restart_timer = 1;
-			break;
-		}
-		if (lp->timer_ticks == 2) {
-			restart_timer = 1;
-			break;
-		}
-		if (bmsr & BMSR_LSTATUS) {
-			/* Force mode selection success. */
-			tc35815_display_forced_link_mode(dev);
-			netif_carrier_on(dev);
-			tc35815_set_link_modes(dev);
-#ifdef WORKAROUND_100HALF_PROMISC
-			/* delayed promiscuous enabling */
-			if (dev->flags & IFF_PROMISC)
-				tc35815_set_multicast_list(dev);
-#endif
-#if 1
-			lp->saved_lpa = tc_mdio_read(dev, pid, MII_LPA);
-			lp->timer_state = lcheck;
-			restart_timer = 1;
-#else
-			lp->timer_state = asleep;
-			restart_timer = 0;
-#endif
-		} else {
-			if (lp->timer_ticks >= 4) { /* 6 seconds or so... */
-				int ret;
-
-				ret = tc35815_try_next_permutation(dev);
-				if (ret == -1) {
-					/*
-					 * Aieee, tried them all, reset the
-					 * chip and try all over again.
-					 */
-					printk(KERN_NOTICE "%s: Link down, "
-					       "cable problem?\n",
-					       dev->name);
-
-					/* Try to restart the adaptor. */
-					tc35815_restart(dev);
-					goto out;
-				}
-				lp->timer_ticks = 0;
-				restart_timer = 1;
-			} else {
-				restart_timer = 1;
-			}
-		}
-		break;
-
-	case lcheck:
-		bmcr = tc_mdio_read(dev, pid, MII_BMCR);
-		lpa = tc_mdio_read(dev, pid, MII_LPA);
-		if (bmcr & (BMCR_PDOWN | BMCR_ISOLATE | BMCR_RESET)) {
-			printk(KERN_ERR "%s: PHY down? (BMCR %x)\n", dev->name,
-			       bmcr);
-		} else if ((lp->saved_lpa ^ lpa) &
-			   (LPA_100FULL|LPA_100HALF|LPA_10FULL|LPA_10HALF)) {
-			printk(KERN_NOTICE "%s: link status changed"
-			       " (BMCR %x LPA %x->%x)\n", dev->name,
-			       bmcr, lp->saved_lpa, lpa);
-		} else {
-			/* go on */
-			restart_timer = 1;
-			break;
-		}
-		/* Try to restart the adaptor. */
-		tc35815_restart(dev);
-		goto out;
-
-	case asleep:
-	default:
-		/* Can't happens.... */
-		printk(KERN_ERR "%s: Aieee, link timer is asleep but we got "
-		       "one anyways!\n", dev->name);
-		restart_timer = 0;
-		lp->timer_ticks = 0;
-		lp->timer_state = asleep; /* foo on you */
-		break;
-	}
-
-	if (restart_timer) {
-		lp->timer.expires = jiffies + msecs_to_jiffies(1200);
-		add_timer(&lp->timer);
-	}
-out:
-	spin_unlock_irq(&lp->lock);
-}
-
-static void tc35815_start_auto_negotiation(struct net_device *dev,
-					   struct ethtool_cmd *ep)
-{
-	struct tc35815_local *lp = netdev_priv(dev);
-	int pid = lp->phy_addr;
-	unsigned short bmsr, bmcr, advertize;
-	int timeout;
-
-	netif_carrier_off(dev);
-	bmsr = tc_mdio_read(dev, pid, MII_BMSR);
-	bmcr = tc_mdio_read(dev, pid, MII_BMCR);
-	advertize = tc_mdio_read(dev, pid, MII_ADVERTISE);
-
-	if (ep == NULL || ep->autoneg == AUTONEG_ENABLE) {
-		if (options.speed || options.duplex) {
-			/* Advertise only specified configuration. */
-			advertize &= ~(ADVERTISE_10HALF |
-				       ADVERTISE_10FULL |
-				       ADVERTISE_100HALF |
-				       ADVERTISE_100FULL);
-			if (options.speed != 10) {
-				if (options.duplex != 1)
-					advertize |= ADVERTISE_100FULL;
-				if (options.duplex != 2)
-					advertize |= ADVERTISE_100HALF;
-			}
-			if (options.speed != 100) {
-				if (options.duplex != 1)
-					advertize |= ADVERTISE_10FULL;
-				if (options.duplex != 2)
-					advertize |= ADVERTISE_10HALF;
-			}
-			if (options.speed == 100)
-				bmcr |= BMCR_SPEED100;
-			else if (options.speed == 10)
-				bmcr &= ~BMCR_SPEED100;
-			if (options.duplex == 2)
-				bmcr |= BMCR_FULLDPLX;
-			else if (options.duplex == 1)
-				bmcr &= ~BMCR_FULLDPLX;
-		} else {
-			/* Advertise everything we can support. */
-			if (bmsr & BMSR_10HALF)
-				advertize |= ADVERTISE_10HALF;
-			else
-				advertize &= ~ADVERTISE_10HALF;
-			if (bmsr & BMSR_10FULL)
-				advertize |= ADVERTISE_10FULL;
-			else
-				advertize &= ~ADVERTISE_10FULL;
-			if (bmsr & BMSR_100HALF)
-				advertize |= ADVERTISE_100HALF;
-			else
-				advertize &= ~ADVERTISE_100HALF;
-			if (bmsr & BMSR_100FULL)
-				advertize |= ADVERTISE_100FULL;
-			else
-				advertize &= ~ADVERTISE_100FULL;
-		}
-
-		tc_mdio_write(dev, pid, MII_ADVERTISE, advertize);
-
-		/* Enable Auto-Negotiation, this is usually on already... */
-		bmcr |= BMCR_ANENABLE;
-		tc_mdio_write(dev, pid, MII_BMCR, bmcr);
-
-		/* Restart it to make sure it is going. */
-		bmcr |= BMCR_ANRESTART;
-		tc_mdio_write(dev, pid, MII_BMCR, bmcr);
-		printk(KERN_DEBUG "%s: ADVERTISE %x BMCR %x\n", dev->name, advertize, bmcr);
-
-		/* BMCR_ANRESTART self clears when the process has begun. */
-		timeout = 64;  /* More than enough. */
-		while (--timeout) {
-			bmcr = tc_mdio_read(dev, pid, MII_BMCR);
-			if (!(bmcr & BMCR_ANRESTART))
-				break; /* got it. */
-			udelay(10);
-		}
-		if (!timeout) {
-			printk(KERN_ERR "%s: TC35815 would not start auto "
-			       "negotiation BMCR=0x%04x\n",
-			       dev->name, bmcr);
-			printk(KERN_NOTICE "%s: Performing force link "
-			       "detection.\n", dev->name);
-			goto force_link;
-		} else {
-			printk(KERN_DEBUG "%s: auto negotiation started.\n", dev->name);
-			lp->timer_state = arbwait;
-		}
-	} else {
-force_link:
-		/* Force the link up, trying first a particular mode.
-		 * Either we are here at the request of ethtool or
-		 * because the Happy Meal would not start to autoneg.
-		 */
-
-		/* Disable auto-negotiation in BMCR, enable the duplex and
-		 * speed setting, init the timer state machine, and fire it off.
-		 */
-		if (ep == NULL || ep->autoneg == AUTONEG_ENABLE) {
-			bmcr = BMCR_SPEED100;
-		} else {
-			if (ep->speed == SPEED_100)
-				bmcr = BMCR_SPEED100;
-			else
-				bmcr = 0;
-			if (ep->duplex == DUPLEX_FULL)
-				bmcr |= BMCR_FULLDPLX;
-		}
-		tc_mdio_write(dev, pid, MII_BMCR, bmcr);
-
-		/* OK, seems we need do disable the transceiver for the first
-		 * tick to make sure we get an accurate link state at the
-		 * second tick.
-		 */
-		lp->timer_state = ltrywait;
-	}
-
-	del_timer(&lp->timer);
-	lp->timer_ticks = 0;
-	lp->timer.expires = jiffies + msecs_to_jiffies(1200);
-	add_timer(&lp->timer);
-}
-
-static void tc35815_find_phy(struct net_device *dev)
-{
-	struct tc35815_local *lp = netdev_priv(dev);
-	int pid = lp->phy_addr;
-	unsigned short id0;
-
-	/* find MII phy */
-	for (pid = 31; pid >= 0; pid--) {
-		id0 = tc_mdio_read(dev, pid, MII_BMSR);
-		if (id0 != 0xffff && id0 != 0x0000 &&
-		    (id0 & BMSR_RESV) != (0xffff & BMSR_RESV) /* paranoia? */
-			) {
-			lp->phy_addr = pid;
-			break;
-		}
-	}
-	if (pid < 0) {
-		printk(KERN_ERR "%s: No MII Phy found.\n",
-		       dev->name);
-		lp->phy_addr = pid = 0;
-	}
-
-	lp->mii_id[0] = tc_mdio_read(dev, pid, MII_PHYSID1);
-	lp->mii_id[1] = tc_mdio_read(dev, pid, MII_PHYSID2);
-	if (netif_msg_hw(lp))
-		printk(KERN_INFO "%s: PHY(%02x) ID %04x %04x\n", dev->name,
-		       pid, lp->mii_id[0], lp->mii_id[1]);
-}
-
-static void tc35815_phy_chip_init(struct net_device *dev)
-{
-	struct tc35815_local *lp = netdev_priv(dev);
-	int pid = lp->phy_addr;
-	unsigned short bmcr;
-	struct ethtool_cmd ecmd, *ep;
-
-	/* dis-isolate if needed. */
-	bmcr = tc_mdio_read(dev, pid, MII_BMCR);
-	if (bmcr & BMCR_ISOLATE) {
-		int count = 32;
-		printk(KERN_DEBUG "%s: unisolating...", dev->name);
-		tc_mdio_write(dev, pid, MII_BMCR, bmcr & ~BMCR_ISOLATE);
-		while (--count) {
-			if (!(tc_mdio_read(dev, pid, MII_BMCR) & BMCR_ISOLATE))
-				break;
-			udelay(20);
-		}
-		printk(" %s.\n", count ? "done" : "failed");
-	}
-
-	if (options.speed && options.duplex) {
-		ecmd.autoneg = AUTONEG_DISABLE;
-		ecmd.speed = options.speed == 10 ? SPEED_10 : SPEED_100;
-		ecmd.duplex = options.duplex == 1 ? DUPLEX_HALF : DUPLEX_FULL;
-		ep = &ecmd;
-	} else {
-		ep = NULL;
-	}
-	tc35815_start_auto_negotiation(dev, ep);
+	if (!lp->phy_dev)
+		return -ENODEV;
+	return phy_mii_ioctl(lp->phy_dev, if_mii(rq), cmd);
 }
 
 static void tc35815_chip_reset(struct net_device *dev)
@@ -2815,8 +2369,6 @@ static void tc35815_chip_init(struct net_device *dev)
 		(struct tc35815_regs __iomem *)dev->base_addr;
 	unsigned long txctl = TX_CTL_CMD;
 
-	tc35815_phy_chip_init(dev);
-
 	/* load station address to CAM */
 	tc35815_set_cam_entry(dev, CAM_ENTRY_SOURCE, dev->dev_addr);
 
@@ -2857,8 +2409,10 @@ static void tc35815_chip_init(struct net_device *dev)
 		txctl &= ~Tx_EnLCarr;
 #ifdef WORKAROUND_LOSTCAR
 	/* WORKAROUND: ignore LostCrS in full duplex operation */
-	if ((lp->timer_state != asleep && lp->timer_state != lcheck) ||
-	    lp->fullduplex)
+	if (!lp->phy_dev ||
+	    !(lp->phy_dev->state == PHY_RUNNING ||
+	      lp->phy_dev->state == PHY_CHANGELINK) ||
+	    lp->duplex == DUPLEX_FULL)
 		txctl &= ~Tx_EnLCarr;
 #endif
 #endif /* !NO_CHECK_CARRIER */
@@ -2879,8 +2433,9 @@ static int tc35815_suspend(struct pci_dev *pdev, pm_message_t state)
 	if (!netif_running(dev))
 		return 0;
 	netif_device_detach(dev);
+	if (lp->phy_dev)
+		phy_stop(lp->phy_dev);
 	spin_lock_irqsave(&lp->lock, flags);
-	del_timer(&lp->timer);		/* Kill if running	*/
 	tc35815_chip_reset(dev);
 	spin_unlock_irqrestore(&lp->lock, flags);
 	pci_set_power_state(pdev, PCI_D3hot);
@@ -2891,15 +2446,14 @@ static int tc35815_resume(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct tc35815_local *lp = netdev_priv(dev);
-	unsigned long flags;
 
 	pci_restore_state(pdev);
 	if (!netif_running(dev))
 		return 0;
 	pci_set_power_state(pdev, PCI_D0);
-	spin_lock_irqsave(&lp->lock, flags);
 	tc35815_restart(dev);
-	spin_unlock_irqrestore(&lp->lock, flags);
+	if (lp->phy_dev)
+		phy_start(lp->phy_dev);
 	netif_device_attach(dev);
 	return 0;
 }
@@ -2920,8 +2474,6 @@ module_param_named(speed, options.speed, int, 0);
 MODULE_PARM_DESC(speed, "0:auto, 10:10Mbps, 100:100Mbps");
 module_param_named(duplex, options.duplex, int, 0);
 MODULE_PARM_DESC(duplex, "0:auto, 1:half, 2:full");
-module_param_named(doforce, options.doforce, int, 0);
-MODULE_PARM_DESC(doforce, "try force link mode if auto-negotiation failed");
 
 static int __init tc35815_init_module(void)
 {

From anemo@mba.ocn.ne.jp Thu Apr 10 17:28:37 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 10 Apr 2008 17:28:47 +0200 (CEST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:41955 "EHLO smtp.mba.ocn.ne.jp")
	by lappi.linux-mips.net with ESMTP id S1784255AbYDJP0V (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 10 Apr 2008 17:26:21 +0200
Received: from localhost (p5205-ipad206funabasi.chiba.ocn.ne.jp [222.145.79.205])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id D496BB538; Fri, 11 Apr 2008 00:24:39 +0900 (JST)
Date:	Fri, 11 Apr 2008 00:25:31 +0900 (JST)
Message-Id: <20080411.002531.72708711.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	Jeff Garzik <jeff@garzik.org>, netdev@vger.kernel.org
Subject: [PATCH 6/6] tc35815: Whitespace cleanup
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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18890
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 32329
Lines: 621

Cosmetic TAB/whitespace cleanups and some style cleanups.  No
functional changes.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
 drivers/net/tc35815.c |  372 +++++++++++++++++++++++++------------------------
 1 files changed, 187 insertions(+), 185 deletions(-)

diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
index de8b18e..090f46e 100644
--- a/drivers/net/tc35815.c
+++ b/drivers/net/tc35815.c
@@ -81,7 +81,7 @@ static const struct pci_device_id tc35815_pci_tbl[] = {
 	{PCI_DEVICE(PCI_VENDOR_ID_TOSHIBA_2, PCI_DEVICE_ID_TOSHIBA_TC35815_TX4939), .driver_data = TC35815_TX4939 },
 	{0,}
 };
-MODULE_DEVICE_TABLE (pci, tc35815_pci_tbl);
+MODULE_DEVICE_TABLE(pci, tc35815_pci_tbl);
 
 /* see MODULE_PARM_DESC */
 static struct tc35815_options {
@@ -130,159 +130,159 @@ struct tc35815_regs {
  * Bit assignments
  */
 /* DMA_Ctl bit asign ------------------------------------------------------- */
-#define DMA_RxAlign            0x00c00000 /* 1:Reception Alignment           */
-#define DMA_RxAlign_1          0x00400000
-#define DMA_RxAlign_2          0x00800000
-#define DMA_RxAlign_3          0x00c00000
-#define DMA_M66EnStat          0x00080000 /* 1:66MHz Enable State            */
-#define DMA_IntMask            0x00040000 /* 1:Interupt mask                 */
-#define DMA_SWIntReq           0x00020000 /* 1:Software Interrupt request    */
-#define DMA_TxWakeUp           0x00010000 /* 1:Transmit Wake Up              */
-#define DMA_RxBigE             0x00008000 /* 1:Receive Big Endian            */
-#define DMA_TxBigE             0x00004000 /* 1:Transmit Big Endian           */
-#define DMA_TestMode           0x00002000 /* 1:Test Mode                     */
-#define DMA_PowrMgmnt          0x00001000 /* 1:Power Management              */
-#define DMA_DmBurst_Mask       0x000001fc /* DMA Burst size                  */
+#define DMA_RxAlign	       0x00c00000 /* 1:Reception Alignment	     */
+#define DMA_RxAlign_1	       0x00400000
+#define DMA_RxAlign_2	       0x00800000
+#define DMA_RxAlign_3	       0x00c00000
+#define DMA_M66EnStat	       0x00080000 /* 1:66MHz Enable State	     */
+#define DMA_IntMask	       0x00040000 /* 1:Interupt mask		     */
+#define DMA_SWIntReq	       0x00020000 /* 1:Software Interrupt request    */
+#define DMA_TxWakeUp	       0x00010000 /* 1:Transmit Wake Up		     */
+#define DMA_RxBigE	       0x00008000 /* 1:Receive Big Endian	     */
+#define DMA_TxBigE	       0x00004000 /* 1:Transmit Big Endian	     */
+#define DMA_TestMode	       0x00002000 /* 1:Test Mode		     */
+#define DMA_PowrMgmnt	       0x00001000 /* 1:Power Management		     */
+#define DMA_DmBurst_Mask       0x000001fc /* DMA Burst size		     */
 
 /* RxFragSize bit asign ---------------------------------------------------- */
-#define RxFrag_EnPack          0x00008000 /* 1:Enable Packing                */
-#define RxFrag_MinFragMask     0x00000ffc /* Minimum Fragment                */
+#define RxFrag_EnPack	       0x00008000 /* 1:Enable Packing		     */
+#define RxFrag_MinFragMask     0x00000ffc /* Minimum Fragment		     */
 
 /* MAC_Ctl bit asign ------------------------------------------------------- */
-#define MAC_Link10             0x00008000 /* 1:Link Status 10Mbits           */
-#define MAC_EnMissRoll         0x00002000 /* 1:Enable Missed Roll            */
-#define MAC_MissRoll           0x00000400 /* 1:Missed Roll                   */
-#define MAC_Loop10             0x00000080 /* 1:Loop 10 Mbps                  */
-#define MAC_Conn_Auto          0x00000000 /*00:Connection mode (Automatic)   */
-#define MAC_Conn_10M           0x00000020 /*01:                (10Mbps endec)*/
-#define MAC_Conn_Mll           0x00000040 /*10:                (Mll clock)   */
-#define MAC_MacLoop            0x00000010 /* 1:MAC Loopback                  */
-#define MAC_FullDup            0x00000008 /* 1:Full Duplex 0:Half Duplex     */
-#define MAC_Reset              0x00000004 /* 1:Software Reset                */
-#define MAC_HaltImm            0x00000002 /* 1:Halt Immediate                */
-#define MAC_HaltReq            0x00000001 /* 1:Halt request                  */
+#define MAC_Link10	       0x00008000 /* 1:Link Status 10Mbits	     */
+#define MAC_EnMissRoll	       0x00002000 /* 1:Enable Missed Roll	     */
+#define MAC_MissRoll	       0x00000400 /* 1:Missed Roll		     */
+#define MAC_Loop10	       0x00000080 /* 1:Loop 10 Mbps		     */
+#define MAC_Conn_Auto	       0x00000000 /*00:Connection mode (Automatic)   */
+#define MAC_Conn_10M	       0x00000020 /*01:		       (10Mbps endec)*/
+#define MAC_Conn_Mll	       0x00000040 /*10:		       (Mll clock)   */
+#define MAC_MacLoop	       0x00000010 /* 1:MAC Loopback		     */
+#define MAC_FullDup	       0x00000008 /* 1:Full Duplex 0:Half Duplex     */
+#define MAC_Reset	       0x00000004 /* 1:Software Reset		     */
+#define MAC_HaltImm	       0x00000002 /* 1:Halt Immediate		     */
+#define MAC_HaltReq	       0x00000001 /* 1:Halt request		     */
 
 /* PROM_Ctl bit asign ------------------------------------------------------ */
-#define PROM_Busy              0x00008000 /* 1:Busy (Start Operation)        */
-#define PROM_Read              0x00004000 /*10:Read operation                */
-#define PROM_Write             0x00002000 /*01:Write operation               */
-#define PROM_Erase             0x00006000 /*11:Erase operation               */
-                                          /*00:Enable or Disable Writting,   */
-                                          /*      as specified in PROM_Addr. */
-#define PROM_Addr_Ena          0x00000030 /*11xxxx:PROM Write enable         */
-                                          /*00xxxx:           disable        */
+#define PROM_Busy	       0x00008000 /* 1:Busy (Start Operation)	     */
+#define PROM_Read	       0x00004000 /*10:Read operation		     */
+#define PROM_Write	       0x00002000 /*01:Write operation		     */
+#define PROM_Erase	       0x00006000 /*11:Erase operation		     */
+					  /*00:Enable or Disable Writting,   */
+					  /*	  as specified in PROM_Addr. */
+#define PROM_Addr_Ena	       0x00000030 /*11xxxx:PROM Write enable	     */
+					  /*00xxxx:	      disable	     */
 
 /* CAM_Ctl bit asign ------------------------------------------------------- */
-#define CAM_CompEn             0x00000010 /* 1:CAM Compare Enable            */
-#define CAM_NegCAM             0x00000008 /* 1:Reject packets CAM recognizes,*/
-                                          /*                    accept other */
-#define CAM_BroadAcc           0x00000004 /* 1:Broadcast assept              */
-#define CAM_GroupAcc           0x00000002 /* 1:Multicast assept              */
-#define CAM_StationAcc         0x00000001 /* 1:unicast accept                */
+#define CAM_CompEn	       0x00000010 /* 1:CAM Compare Enable	     */
+#define CAM_NegCAM	       0x00000008 /* 1:Reject packets CAM recognizes,*/
+					  /*			accept other */
+#define CAM_BroadAcc	       0x00000004 /* 1:Broadcast assept		     */
+#define CAM_GroupAcc	       0x00000002 /* 1:Multicast assept		     */
+#define CAM_StationAcc	       0x00000001 /* 1:unicast accept		     */
 
 /* CAM_Ena bit asign ------------------------------------------------------- */
-#define CAM_ENTRY_MAX                  21   /* CAM Data entry max count      */
+#define CAM_ENTRY_MAX		       21   /* CAM Data entry max count	     */
 #define CAM_Ena_Mask ((1<<CAM_ENTRY_MAX)-1) /* CAM Enable bits (Max 21bits)  */
-#define CAM_Ena_Bit(index)         (1<<(index))
+#define CAM_Ena_Bit(index)	(1 << (index))
 #define CAM_ENTRY_DESTINATION	0
 #define CAM_ENTRY_SOURCE	1
 #define CAM_ENTRY_MACCTL	20
 
 /* Tx_Ctl bit asign -------------------------------------------------------- */
-#define Tx_En                  0x00000001 /* 1:Transmit enable               */
-#define Tx_TxHalt              0x00000002 /* 1:Transmit Halt Request         */
-#define Tx_NoPad               0x00000004 /* 1:Suppress Padding              */
-#define Tx_NoCRC               0x00000008 /* 1:Suppress Padding              */
-#define Tx_FBack               0x00000010 /* 1:Fast Back-off                 */
-#define Tx_EnUnder             0x00000100 /* 1:Enable Underrun               */
-#define Tx_EnExDefer           0x00000200 /* 1:Enable Excessive Deferral     */
-#define Tx_EnLCarr             0x00000400 /* 1:Enable Lost Carrier           */
-#define Tx_EnExColl            0x00000800 /* 1:Enable Excessive Collision    */
-#define Tx_EnLateColl          0x00001000 /* 1:Enable Late Collision         */
-#define Tx_EnTxPar             0x00002000 /* 1:Enable Transmit Parity        */
-#define Tx_EnComp              0x00004000 /* 1:Enable Completion             */
+#define Tx_En		       0x00000001 /* 1:Transmit enable		     */
+#define Tx_TxHalt	       0x00000002 /* 1:Transmit Halt Request	     */
+#define Tx_NoPad	       0x00000004 /* 1:Suppress Padding		     */
+#define Tx_NoCRC	       0x00000008 /* 1:Suppress Padding		     */
+#define Tx_FBack	       0x00000010 /* 1:Fast Back-off		     */
+#define Tx_EnUnder	       0x00000100 /* 1:Enable Underrun		     */
+#define Tx_EnExDefer	       0x00000200 /* 1:Enable Excessive Deferral     */
+#define Tx_EnLCarr	       0x00000400 /* 1:Enable Lost Carrier	     */
+#define Tx_EnExColl	       0x00000800 /* 1:Enable Excessive Collision    */
+#define Tx_EnLateColl	       0x00001000 /* 1:Enable Late Collision	     */
+#define Tx_EnTxPar	       0x00002000 /* 1:Enable Transmit Parity	     */
+#define Tx_EnComp	       0x00004000 /* 1:Enable Completion	     */
 
 /* Tx_Stat bit asign ------------------------------------------------------- */
-#define Tx_TxColl_MASK         0x0000000F /* Tx Collision Count              */
-#define Tx_ExColl              0x00000010 /* Excessive Collision             */
-#define Tx_TXDefer             0x00000020 /* Transmit Defered                */
-#define Tx_Paused              0x00000040 /* Transmit Paused                 */
-#define Tx_IntTx               0x00000080 /* Interrupt on Tx                 */
-#define Tx_Under               0x00000100 /* Underrun                        */
-#define Tx_Defer               0x00000200 /* Deferral                        */
-#define Tx_NCarr               0x00000400 /* No Carrier                      */
-#define Tx_10Stat              0x00000800 /* 10Mbps Status                   */
-#define Tx_LateColl            0x00001000 /* Late Collision                  */
-#define Tx_TxPar               0x00002000 /* Tx Parity Error                 */
-#define Tx_Comp                0x00004000 /* Completion                      */
-#define Tx_Halted              0x00008000 /* Tx Halted                       */
-#define Tx_SQErr               0x00010000 /* Signal Quality Error(SQE)       */
+#define Tx_TxColl_MASK	       0x0000000F /* Tx Collision Count		     */
+#define Tx_ExColl	       0x00000010 /* Excessive Collision	     */
+#define Tx_TXDefer	       0x00000020 /* Transmit Defered		     */
+#define Tx_Paused	       0x00000040 /* Transmit Paused		     */
+#define Tx_IntTx	       0x00000080 /* Interrupt on Tx		     */
+#define Tx_Under	       0x00000100 /* Underrun			     */
+#define Tx_Defer	       0x00000200 /* Deferral			     */
+#define Tx_NCarr	       0x00000400 /* No Carrier			     */
+#define Tx_10Stat	       0x00000800 /* 10Mbps Status		     */
+#define Tx_LateColl	       0x00001000 /* Late Collision		     */
+#define Tx_TxPar	       0x00002000 /* Tx Parity Error		     */
+#define Tx_Comp		       0x00004000 /* Completion			     */
+#define Tx_Halted	       0x00008000 /* Tx Halted			     */
+#define Tx_SQErr	       0x00010000 /* Signal Quality Error(SQE)	     */
 
 /* Rx_Ctl bit asign -------------------------------------------------------- */
-#define Rx_EnGood              0x00004000 /* 1:Enable Good                   */
-#define Rx_EnRxPar             0x00002000 /* 1:Enable Receive Parity         */
-#define Rx_EnLongErr           0x00000800 /* 1:Enable Long Error             */
-#define Rx_EnOver              0x00000400 /* 1:Enable OverFlow               */
-#define Rx_EnCRCErr            0x00000200 /* 1:Enable CRC Error              */
-#define Rx_EnAlign             0x00000100 /* 1:Enable Alignment              */
-#define Rx_IgnoreCRC           0x00000040 /* 1:Ignore CRC Value              */
-#define Rx_StripCRC            0x00000010 /* 1:Strip CRC Value               */
-#define Rx_ShortEn             0x00000008 /* 1:Short Enable                  */
-#define Rx_LongEn              0x00000004 /* 1:Long Enable                   */
-#define Rx_RxHalt              0x00000002 /* 1:Receive Halt Request          */
-#define Rx_RxEn                0x00000001 /* 1:Receive Intrrupt Enable       */
+#define Rx_EnGood	       0x00004000 /* 1:Enable Good		     */
+#define Rx_EnRxPar	       0x00002000 /* 1:Enable Receive Parity	     */
+#define Rx_EnLongErr	       0x00000800 /* 1:Enable Long Error	     */
+#define Rx_EnOver	       0x00000400 /* 1:Enable OverFlow		     */
+#define Rx_EnCRCErr	       0x00000200 /* 1:Enable CRC Error		     */
+#define Rx_EnAlign	       0x00000100 /* 1:Enable Alignment		     */
+#define Rx_IgnoreCRC	       0x00000040 /* 1:Ignore CRC Value		     */
+#define Rx_StripCRC	       0x00000010 /* 1:Strip CRC Value		     */
+#define Rx_ShortEn	       0x00000008 /* 1:Short Enable		     */
+#define Rx_LongEn	       0x00000004 /* 1:Long Enable		     */
+#define Rx_RxHalt	       0x00000002 /* 1:Receive Halt Request	     */
+#define Rx_RxEn		       0x00000001 /* 1:Receive Intrrupt Enable	     */
 
 /* Rx_Stat bit asign ------------------------------------------------------- */
-#define Rx_Halted              0x00008000 /* Rx Halted                       */
-#define Rx_Good                0x00004000 /* Rx Good                         */
-#define Rx_RxPar               0x00002000 /* Rx Parity Error                 */
-                            /* 0x00001000    not use                         */
-#define Rx_LongErr             0x00000800 /* Rx Long Error                   */
-#define Rx_Over                0x00000400 /* Rx Overflow                     */
-#define Rx_CRCErr              0x00000200 /* Rx CRC Error                    */
-#define Rx_Align               0x00000100 /* Rx Alignment Error              */
-#define Rx_10Stat              0x00000080 /* Rx 10Mbps Status                */
-#define Rx_IntRx               0x00000040 /* Rx Interrupt                    */
-#define Rx_CtlRecd             0x00000020 /* Rx Control Receive              */
-
-#define Rx_Stat_Mask           0x0000EFC0 /* Rx All Status Mask              */
+#define Rx_Halted	       0x00008000 /* Rx Halted			     */
+#define Rx_Good		       0x00004000 /* Rx Good			     */
+#define Rx_RxPar	       0x00002000 /* Rx Parity Error		     */
+			    /* 0x00001000    not use			     */
+#define Rx_LongErr	       0x00000800 /* Rx Long Error		     */
+#define Rx_Over		       0x00000400 /* Rx Overflow		     */
+#define Rx_CRCErr	       0x00000200 /* Rx CRC Error		     */
+#define Rx_Align	       0x00000100 /* Rx Alignment Error		     */
+#define Rx_10Stat	       0x00000080 /* Rx 10Mbps Status		     */
+#define Rx_IntRx	       0x00000040 /* Rx Interrupt		     */
+#define Rx_CtlRecd	       0x00000020 /* Rx Control Receive		     */
+
+#define Rx_Stat_Mask	       0x0000EFC0 /* Rx All Status Mask		     */
 
 /* Int_En bit asign -------------------------------------------------------- */
-#define Int_NRAbtEn            0x00000800 /* 1:Non-recoverable Abort Enable  */
-#define Int_TxCtlCmpEn         0x00000400 /* 1:Transmit Control Complete Enable */
-#define Int_DmParErrEn         0x00000200 /* 1:DMA Parity Error Enable       */
-#define Int_DParDEn            0x00000100 /* 1:Data Parity Error Enable      */
-#define Int_EarNotEn           0x00000080 /* 1:Early Notify Enable           */
-#define Int_DParErrEn          0x00000040 /* 1:Detected Parity Error Enable  */
-#define Int_SSysErrEn          0x00000020 /* 1:Signalled System Error Enable */
-#define Int_RMasAbtEn          0x00000010 /* 1:Received Master Abort Enable  */
-#define Int_RTargAbtEn         0x00000008 /* 1:Received Target Abort Enable  */
-#define Int_STargAbtEn         0x00000004 /* 1:Signalled Target Abort Enable */
-#define Int_BLExEn             0x00000002 /* 1:Buffer List Exhausted Enable  */
-#define Int_FDAExEn            0x00000001 /* 1:Free Descriptor Area          */
-                                          /*               Exhausted Enable  */
+#define Int_NRAbtEn	       0x00000800 /* 1:Non-recoverable Abort Enable  */
+#define Int_TxCtlCmpEn	       0x00000400 /* 1:Transmit Ctl Complete Enable  */
+#define Int_DmParErrEn	       0x00000200 /* 1:DMA Parity Error Enable	     */
+#define Int_DParDEn	       0x00000100 /* 1:Data Parity Error Enable	     */
+#define Int_EarNotEn	       0x00000080 /* 1:Early Notify Enable	     */
+#define Int_DParErrEn	       0x00000040 /* 1:Detected Parity Error Enable  */
+#define Int_SSysErrEn	       0x00000020 /* 1:Signalled System Error Enable */
+#define Int_RMasAbtEn	       0x00000010 /* 1:Received Master Abort Enable  */
+#define Int_RTargAbtEn	       0x00000008 /* 1:Received Target Abort Enable  */
+#define Int_STargAbtEn	       0x00000004 /* 1:Signalled Target Abort Enable */
+#define Int_BLExEn	       0x00000002 /* 1:Buffer List Exhausted Enable  */
+#define Int_FDAExEn	       0x00000001 /* 1:Free Descriptor Area	     */
+					  /*		   Exhausted Enable  */
 
 /* Int_Src bit asign ------------------------------------------------------- */
-#define Int_NRabt              0x00004000 /* 1:Non Recoverable error         */
-#define Int_DmParErrStat       0x00002000 /* 1:DMA Parity Error & Clear      */
-#define Int_BLEx               0x00001000 /* 1:Buffer List Empty & Clear     */
-#define Int_FDAEx              0x00000800 /* 1:FDA Empty & Clear             */
-#define Int_IntNRAbt           0x00000400 /* 1:Non Recoverable Abort         */
-#define	Int_IntCmp             0x00000200 /* 1:MAC control packet complete   */
-#define Int_IntExBD            0x00000100 /* 1:Interrupt Extra BD & Clear    */
-#define Int_DmParErr           0x00000080 /* 1:DMA Parity Error & Clear      */
-#define Int_IntEarNot          0x00000040 /* 1:Receive Data write & Clear    */
-#define Int_SWInt              0x00000020 /* 1:Software request & Clear      */
-#define Int_IntBLEx            0x00000010 /* 1:Buffer List Empty & Clear     */
-#define Int_IntFDAEx           0x00000008 /* 1:FDA Empty & Clear             */
-#define Int_IntPCI             0x00000004 /* 1:PCI controller & Clear        */
-#define Int_IntMacRx           0x00000002 /* 1:Rx controller & Clear         */
-#define Int_IntMacTx           0x00000001 /* 1:Tx controller & Clear         */
+#define Int_NRabt	       0x00004000 /* 1:Non Recoverable error	     */
+#define Int_DmParErrStat       0x00002000 /* 1:DMA Parity Error & Clear	     */
+#define Int_BLEx	       0x00001000 /* 1:Buffer List Empty & Clear     */
+#define Int_FDAEx	       0x00000800 /* 1:FDA Empty & Clear	     */
+#define Int_IntNRAbt	       0x00000400 /* 1:Non Recoverable Abort	     */
+#define Int_IntCmp	       0x00000200 /* 1:MAC control packet complete   */
+#define Int_IntExBD	       0x00000100 /* 1:Interrupt Extra BD & Clear    */
+#define Int_DmParErr	       0x00000080 /* 1:DMA Parity Error & Clear	     */
+#define Int_IntEarNot	       0x00000040 /* 1:Receive Data write & Clear    */
+#define Int_SWInt	       0x00000020 /* 1:Software request & Clear	     */
+#define Int_IntBLEx	       0x00000010 /* 1:Buffer List Empty & Clear     */
+#define Int_IntFDAEx	       0x00000008 /* 1:FDA Empty & Clear	     */
+#define Int_IntPCI	       0x00000004 /* 1:PCI controller & Clear	     */
+#define Int_IntMacRx	       0x00000002 /* 1:Rx controller & Clear	     */
+#define Int_IntMacTx	       0x00000001 /* 1:Tx controller & Clear	     */
 
 /* MD_CA bit asign --------------------------------------------------------- */
-#define MD_CA_PreSup           0x00001000 /* 1:Preamble Supress              */
-#define MD_CA_Busy             0x00000800 /* 1:Busy (Start Operation)        */
-#define MD_CA_Wr               0x00000400 /* 1:Write 0:Read                  */
+#define MD_CA_PreSup	       0x00001000 /* 1:Preamble Supress		     */
+#define MD_CA_Busy	       0x00000800 /* 1:Busy (Start Operation)	     */
+#define MD_CA_Wr	       0x00000400 /* 1:Write 0:Read		     */
 
 
 /*
@@ -306,24 +306,24 @@ struct BDesc {
 #define FD_ALIGN	16
 
 /* Frame Descripter bit asign ---------------------------------------------- */
-#define FD_FDLength_MASK       0x0000FFFF /* Length MASK                     */
-#define FD_BDCnt_MASK          0x001F0000 /* BD count MASK in FD             */
-#define FD_FrmOpt_MASK         0x7C000000 /* Frame option MASK               */
+#define FD_FDLength_MASK       0x0000FFFF /* Length MASK		     */
+#define FD_BDCnt_MASK	       0x001F0000 /* BD count MASK in FD	     */
+#define FD_FrmOpt_MASK	       0x7C000000 /* Frame option MASK		     */
 #define FD_FrmOpt_BigEndian    0x40000000 /* Tx/Rx */
-#define FD_FrmOpt_IntTx        0x20000000 /* Tx only */
-#define FD_FrmOpt_NoCRC        0x10000000 /* Tx only */
+#define FD_FrmOpt_IntTx	       0x20000000 /* Tx only */
+#define FD_FrmOpt_NoCRC	       0x10000000 /* Tx only */
 #define FD_FrmOpt_NoPadding    0x08000000 /* Tx only */
 #define FD_FrmOpt_Packing      0x04000000 /* Rx only */
-#define FD_CownsFD             0x80000000 /* FD Controller owner bit         */
-#define FD_Next_EOL            0x00000001 /* FD EOL indicator                */
-#define FD_BDCnt_SHIFT         16
+#define FD_CownsFD	       0x80000000 /* FD Controller owner bit	     */
+#define FD_Next_EOL	       0x00000001 /* FD EOL indicator		     */
+#define FD_BDCnt_SHIFT	       16
 
 /* Buffer Descripter bit asign --------------------------------------------- */
-#define BD_BuffLength_MASK     0x0000FFFF /* Recieve Data Size               */
-#define BD_RxBDID_MASK         0x00FF0000 /* BD ID Number MASK               */
-#define BD_RxBDSeqN_MASK       0x7F000000 /* Rx BD Sequence Number           */
-#define BD_CownsBD             0x80000000 /* BD Controller owner bit         */
-#define BD_RxBDID_SHIFT        16
+#define BD_BuffLength_MASK     0x0000FFFF /* Recieve Data Size		     */
+#define BD_RxBDID_MASK	       0x00FF0000 /* BD ID Number MASK		     */
+#define BD_RxBDSeqN_MASK       0x7F000000 /* Rx BD Sequence Number	     */
+#define BD_CownsBD	       0x80000000 /* BD Controller owner bit	     */
+#define BD_RxBDID_SHIFT	       16
 #define BD_RxBDSeqN_SHIFT      24
 
 
@@ -352,8 +352,10 @@ struct BDesc {
 /* Tuning parameters */
 #define DMA_BURST_SIZE	32
 #define TX_THRESHOLD	1024
-#define TX_THRESHOLD_MAX 1536       /* used threshold with packet max byte for low pci transfer ability.*/
-#define TX_THRESHOLD_KEEP_LIMIT 10  /* setting threshold max value when overrun error occured this count. */
+/* used threshold with packet max byte for low pci transfer ability.*/
+#define TX_THRESHOLD_MAX 1536
+/* setting threshold max value when overrun error occured this count. */
+#define TX_THRESHOLD_KEEP_LIMIT 10
 
 /* 16 + RX_BUF_NUM * 8 + RX_FD_NUM * 16 + TX_FD_NUM * 32 <= PAGE_SIZE*FD_PAGE_NUM */
 #ifdef TC35815_USE_PACKEDBUFFER
@@ -412,7 +414,7 @@ struct tc35815_local {
 		int max_tx_qlen;
 		int tx_ints;
 		int rx_ints;
-	        int tx_underrun;
+		int tx_underrun;
 	} lstats;
 
 	/* Tx control lock.  This protects the transmit buffer ring
@@ -441,7 +443,7 @@ struct tc35815_local {
 	 *	RX_BUF_NUM BD in Free Buffer FD.
 	 *	One Free Buffer BD has ETH_FRAME_LEN data buffer.
 	 */
-	void * fd_buf;	/* for TxFD, RxFD, FrFD */
+	void *fd_buf;	/* for TxFD, RxFD, FrFD */
 	dma_addr_t fd_buf_dma;
 	struct TxFD *tfd_base;
 	unsigned int tfd_start;
@@ -452,7 +454,7 @@ struct tc35815_local {
 	struct FrFD *fbl_ptr;
 #ifdef TC35815_USE_PACKEDBUFFER
 	unsigned char fbl_curid;
-	void * data_buf[RX_BUF_NUM];		/* packing */
+	void *data_buf[RX_BUF_NUM];		/* packing */
 	dma_addr_t data_buf_dma[RX_BUF_NUM];
 	struct {
 		struct sk_buff *skb;
@@ -493,13 +495,14 @@ static inline void *rxbuf_bus_to_virt(struct tc35815_local *lp, dma_addr_t bus)
 }
 
 #define TC35815_DMA_SYNC_ONDEMAND
-static void* alloc_rxbuf_page(struct pci_dev *hwdev, dma_addr_t *dma_handle)
+static void *alloc_rxbuf_page(struct pci_dev *hwdev, dma_addr_t *dma_handle)
 {
 #ifdef TC35815_DMA_SYNC_ONDEMAND
 	void *buf;
 	/* pci_map + pci_dma_sync will be more effective than
 	 * pci_alloc_consistent on some archs. */
-	if ((buf = (void *)__get_free_page(GFP_ATOMIC)) == NULL)
+	buf = (void *)__get_free_page(GFP_ATOMIC);
+	if (!buf)
 		return NULL;
 	*dma_handle = pci_map_single(hwdev, buf, PAGE_SIZE,
 				     PCI_DMA_FROMDEVICE);
@@ -564,7 +567,7 @@ static void	tc35815_txdone(struct net_device *dev);
 static int	tc35815_close(struct net_device *dev);
 static struct	net_device_stats *tc35815_get_stats(struct net_device *dev);
 static void	tc35815_set_multicast_list(struct net_device *dev);
-static void     tc35815_tx_timeout(struct net_device *dev);
+static void	tc35815_tx_timeout(struct net_device *dev);
 static int	tc35815_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 #ifdef CONFIG_NET_POLL_CONTROLLER
 static void	tc35815_poll_controller(struct net_device *dev);
@@ -572,8 +575,8 @@ static void	tc35815_poll_controller(struct net_device *dev);
 static const struct ethtool_ops tc35815_ethtool_ops;
 
 /* Example routines you must write ;->. */
-static void 	tc35815_chip_reset(struct net_device *dev);
-static void 	tc35815_chip_init(struct net_device *dev);
+static void	tc35815_chip_reset(struct net_device *dev);
+static void	tc35815_chip_init(struct net_device *dev);
 
 #ifdef DEBUG
 static void	panic_queues(struct net_device *dev);
@@ -821,7 +824,7 @@ static int __devinit tc35815_read_plat_dev_addr(struct net_device *dev)
 }
 #endif
 
-static int __devinit tc35815_init_dev_addr (struct net_device *dev)
+static int __devinit tc35815_init_dev_addr(struct net_device *dev)
 {
 	struct tc35815_regs __iomem *tr =
 		(struct tc35815_regs __iomem *)dev->base_addr;
@@ -843,8 +846,8 @@ static int __devinit tc35815_init_dev_addr (struct net_device *dev)
 	return 0;
 }
 
-static int __devinit tc35815_init_one (struct pci_dev *pdev,
-				       const struct pci_device_id *ent)
+static int __devinit tc35815_init_one(struct pci_dev *pdev,
+				      const struct pci_device_id *ent)
 {
 	void __iomem *ioaddr = NULL;
 	struct net_device *dev;
@@ -866,7 +869,7 @@ static int __devinit tc35815_init_one (struct pci_dev *pdev,
 	}
 
 	/* dev zeroed in alloc_etherdev */
-	dev = alloc_etherdev (sizeof (*lp));
+	dev = alloc_etherdev(sizeof(*lp));
 	if (dev == NULL) {
 		dev_err(&pdev->dev, "unable to alloc new ethernet\n");
 		return -ENOMEM;
@@ -903,7 +906,7 @@ static int __devinit tc35815_init_one (struct pci_dev *pdev,
 #endif
 
 	dev->irq = pdev->irq;
-	dev->base_addr = (unsigned long) ioaddr;
+	dev->base_addr = (unsigned long)ioaddr;
 
 	INIT_WORK(&lp->restart_work, tc35815_restart_work);
 	spin_lock_init(&lp->lock);
@@ -922,7 +925,7 @@ static int __devinit tc35815_init_one (struct pci_dev *pdev,
 		random_ether_addr(dev->dev_addr);
 	}
 
-	rc = register_netdev (dev);
+	rc = register_netdev(dev);
 	if (rc)
 		goto err_out;
 
@@ -943,23 +946,22 @@ static int __devinit tc35815_init_one (struct pci_dev *pdev,
 err_out_unregister:
 	unregister_netdev(dev);
 err_out:
-	free_netdev (dev);
+	free_netdev(dev);
 	return rc;
 }
 
 
-static void __devexit tc35815_remove_one (struct pci_dev *pdev)
+static void __devexit tc35815_remove_one(struct pci_dev *pdev)
 {
-	struct net_device *dev = pci_get_drvdata (pdev);
+	struct net_device *dev = pci_get_drvdata(pdev);
 	struct tc35815_local *lp = netdev_priv(dev);
 
 	phy_disconnect(lp->phy_dev);
 	mdiobus_unregister(&lp->mii_bus);
 	kfree(lp->mii_bus.irq);
-	unregister_netdev (dev);
-	free_netdev (dev);
-
-	pci_set_drvdata (pdev, NULL);
+	unregister_netdev(dev);
+	free_netdev(dev);
+	pci_set_drvdata(pdev, NULL);
 }
 
 static int
@@ -976,11 +978,17 @@ tc35815_init_queues(struct net_device *dev)
 		       sizeof(struct TxFD) * TX_FD_NUM >
 		       PAGE_SIZE * FD_PAGE_NUM);
 
-		if ((lp->fd_buf = pci_alloc_consistent(lp->pci_dev, PAGE_SIZE * FD_PAGE_NUM, &lp->fd_buf_dma)) == 0)
+		lp->fd_buf = pci_alloc_consistent(lp->pci_dev,
+						  PAGE_SIZE * FD_PAGE_NUM,
+						  &lp->fd_buf_dma);
+		if (!lp->fd_buf)
 			return -ENOMEM;
 		for (i = 0; i < RX_BUF_NUM; i++) {
 #ifdef TC35815_USE_PACKEDBUFFER
-			if ((lp->data_buf[i] = alloc_rxbuf_page(lp->pci_dev, &lp->data_buf_dma[i])) == NULL) {
+			lp->data_buf[i] =
+				alloc_rxbuf_page(lp->pci_dev,
+						 &lp->data_buf_dma[i]);
+			if (!lp->data_buf[i]) {
 				while (--i >= 0) {
 					free_rxbuf_page(lp->pci_dev,
 							lp->data_buf[i],
@@ -1023,18 +1031,17 @@ tc35815_init_queues(struct net_device *dev)
 #endif
 		printk("\n");
 	} else {
-		for (i = 0; i < FD_PAGE_NUM; i++) {
-			clear_page((void *)((unsigned long)lp->fd_buf + i * PAGE_SIZE));
-		}
+		for (i = 0; i < FD_PAGE_NUM; i++)
+			clear_page((void *)((unsigned long)lp->fd_buf +
+					    i * PAGE_SIZE));
 	}
 	fd_addr = (unsigned long)lp->fd_buf;
 
 	/* Free Descriptors (for Receive) */
 	lp->rfd_base = (struct RxFD *)fd_addr;
 	fd_addr += sizeof(struct RxFD) * RX_FD_NUM;
-	for (i = 0; i < RX_FD_NUM; i++) {
+	for (i = 0; i < RX_FD_NUM; i++)
 		lp->rfd_base[i].fd.FDCtl = cpu_to_le32(FD_CownsFD);
-	}
 	lp->rfd_cur = lp->rfd_base;
 	lp->rfd_limit = (struct RxFD *)fd_addr - (RX_FD_RESERVE + 1);
 
@@ -1214,7 +1221,7 @@ dump_rxfd(struct RxFD *fd)
 	       le32_to_cpu(fd->fd.FDStat),
 	       le32_to_cpu(fd->fd.FDCtl));
 	if (le32_to_cpu(fd->fd.FDCtl) & FD_CownsFD)
-	    return 0;
+		return 0;
 	printk("BD: ");
 	for (i = 0; i < bd_count; i++)
 		printk(" %08x %08x",
@@ -1363,9 +1370,9 @@ tc35815_open(struct net_device *dev)
 	 * This is used if the interrupt line can turned off (shared).
 	 * See 3c503.c for an example of selecting the IRQ at config-time.
 	 */
-	if (request_irq(dev->irq, &tc35815_interrupt, IRQF_SHARED, dev->name, dev)) {
+	if (request_irq(dev->irq, &tc35815_interrupt, IRQF_SHARED,
+			dev->name, dev))
 		return -EAGAIN;
-	}
 
 	tc35815_chip_reset(dev);
 
@@ -2049,7 +2056,7 @@ tc35815_txdone(struct net_device *dev)
 				struct tc35815_regs __iomem *tr =
 					(struct tc35815_regs __iomem *)dev->base_addr;
 				int head = (lp->tfd_start + TX_FD_NUM - 1) % TX_FD_NUM;
-				struct TxFD* txhead = &lp->tfd_base[head];
+				struct TxFD *txhead = &lp->tfd_base[head];
 				int qlen = (lp->tfd_start + TX_FD_NUM
 					    - lp->tfd_end) % TX_FD_NUM;
 
@@ -2084,7 +2091,7 @@ tc35815_txdone(struct net_device *dev)
 	 * condition, and space has now been made available,
 	 * wake up the queue.
 	 */
-	if (netif_queue_stopped(dev) && ! tc35815_tx_full(dev))
+	if (netif_queue_stopped(dev) && !tc35815_tx_full(dev))
 		netif_wake_queue(dev);
 }
 
@@ -2181,8 +2188,7 @@ tc35815_set_multicast_list(struct net_device *dev)
 	struct tc35815_regs __iomem *tr =
 		(struct tc35815_regs __iomem *)dev->base_addr;
 
-	if (dev->flags&IFF_PROMISC)
-	{
+	if (dev->flags & IFF_PROMISC) {
 #ifdef WORKAROUND_100HALF_PROMISC
 		/* With some (all?) 100MHalf HUB, controller will hang
 		 * if we enabled promiscuous mode before linkup... */
@@ -2193,16 +2199,13 @@ tc35815_set_multicast_list(struct net_device *dev)
 #endif
 		/* Enable promiscuous mode */
 		tc_writel(CAM_CompEn | CAM_BroadAcc | CAM_GroupAcc | CAM_StationAcc, &tr->CAM_Ctl);
-	}
-	else if((dev->flags&IFF_ALLMULTI) || dev->mc_count > CAM_ENTRY_MAX - 3)
-	{
+	} else if ((dev->flags & IFF_ALLMULTI) ||
+		  dev->mc_count > CAM_ENTRY_MAX - 3) {
 		/* CAM 0, 1, 20 are reserved. */
 		/* Disable promiscuous mode, use normal mode. */
 		tc_writel(CAM_CompEn | CAM_BroadAcc | CAM_GroupAcc, &tr->CAM_Ctl);
-	}
-	else if(dev->mc_count)
-	{
-		struct dev_mc_list* cur_addr = dev->mc_list;
+	} else if (dev->mc_count) {
+		struct dev_mc_list *cur_addr = dev->mc_list;
 		int i;
 		int ena_bits = CAM_Ena_Bit(CAM_ENTRY_SOURCE);
 
@@ -2217,8 +2220,7 @@ tc35815_set_multicast_list(struct net_device *dev)
 		}
 		tc_writel(ena_bits, &tr->CAM_Ena);
 		tc_writel(CAM_CompEn | CAM_BroadAcc, &tr->CAM_Ctl);
-	}
-	else {
+	} else {
 		tc_writel(CAM_Ena_Bit(CAM_ENTRY_SOURCE), &tr->CAM_Ena);
 		tc_writel(CAM_CompEn | CAM_BroadAcc, &tr->CAM_Ctl);
 	}

From afleming@freescale.com Thu Apr 10 22:06:15 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 10 Apr 2008 22:06:19 +0200 (CEST)
Received: from az33egw02.freescale.net ([192.88.158.103]:62346 "EHLO
	az33egw02.freescale.net") by lappi.linux-mips.net with ESMTP
	id S1784766AbYDJUGP (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Thu, 10 Apr 2008 22:06:15 +0200
Received: from az33smr01.freescale.net (az33smr01.freescale.net [10.64.34.199])
	by az33egw02.freescale.net (8.12.11/az33egw02) with ESMTP id m3AJwWSh027503;
	Thu, 10 Apr 2008 12:58:33 -0700 (MST)
Received: from SaintGeorge.am.freescale.net (SaintGeorge.am.freescale.net [10.82.16.122])
	by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id m3AJwViI027438;
	Thu, 10 Apr 2008 14:58:31 -0500 (CDT)
Cc:	linux-mips@linux-mips.org, Jeff Garzik <jeff@garzik.org>,
	netdev@vger.kernel.org
Message-Id: <4CD8B148-87DF-42C6-8A04-A6501109C1F2@freescale.com>
From:	Andy Fleming <afleming@freescale.com>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <20080411.002523.18305938.anemo@mba.ocn.ne.jp>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Apple Message framework v919.2)
Subject: Re: [PATCH 5/6] tc35815: Use generic PHY layer
Date:	Thu, 10 Apr 2008 14:58:28 -0500
References: <20080411.002523.18305938.anemo@mba.ocn.ne.jp>
X-Mailer: Apple Mail (2.919.2)
Return-Path: <afleming@freescale.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18891
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: afleming@freescale.com
Precedence: bulk
X-list: linux-mips
Content-Length: 5002
Lines: 174


On Apr 10, 2008, at 10:25, Atsushi Nemoto wrote:

> Convert the tc35815 driver to use the generic PHY layer in
> drivers/net/phy.
>
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>


Excellent, just a few quick (and hopefully easy to resolve) comments:

> drivers/net/Kconfig   |    2 +-
> drivers/net/tc35815.c | 1028 +++++++++++++ 
> +-----------------------------------
> 2 files changed, 291 insertions(+), 739 deletions(-)
>


That's the sort of code shrinkage I like to see.  :)


> +static int tc_mii_probe(struct net_device *dev)
> +{
> +	struct tc35815_local *lp = netdev_priv(dev);
> +	struct phy_device *phydev = NULL;
> +	int phy_addr;
> +
> +	/* find the first phy */
> +	for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++) {
> +		if (lp->mii_bus.phy_map[phy_addr]) {
> +			phydev = lp->mii_bus.phy_map[phy_addr];
> +			break;
> +		}
> +	}


I'm always amazed that this works.  I have a board that has 4 PHYs for  
two different ethernet controllers, and they are laid out thus:

1: UCC2
2: eTSEC1
3: eTSEC2
7: UCC1

This isn't really a criticism, since this controller may very well  
guarantee there's only one PHY on the bus, or that you only care about  
the first one.  I'm just putting that out there to feel out how people  
solve


>
> +
> +	if (!phydev) {
> +		printk(KERN_ERR "%s: no PHY found\n", dev->name);
> +		return -ENODEV;
> +	}
> +
> +	/* attach the mac to the phy */
> +	phydev = phy_connect(dev, phydev->dev.bus_id,
> +			     &tc_handle_link_change, 0,
> +			     lp->boardtype == TC35815_TX4939 ?
> +			     PHY_INTERFACE_MODE_RMII : PHY_INTERFACE_MODE_MII);


Generally, it's preferred for boards to pass in the interface to the  
driver, rather than have the ethernet driver have an awareness of what  
boards it runs on.  I'm not familiar with this hardware, but it makes  
porting to new boards much easier.


>
> +	if (IS_ERR(phydev)) {
> +		printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name);
> +		return PTR_ERR(phydev);
> +	}
> +	printk(KERN_INFO "%s: attached PHY driver [%s] "
> +		"(mii_bus:phy_addr=%s, id=%x)\n",
> +		dev->name, phydev->drv->name, phydev->dev.bus_id,
> +		phydev->phy_id);
> +
> +	/* mask with MAC supported features */
> +	phydev->supported &= PHY_BASIC_FEATURES;
> +	if (options.speed == 10)
> +		phydev->supported &=
> +			~(SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full);
> +	else if (options.speed == 100)
> +		phydev->supported &=
> +			~(SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full);
> +	if (options.duplex == 1)
> +		phydev->supported &=
> +			~(SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Full);
> +	else if (options.duplex == 2)
> +		phydev->supported &=
> +			~(SUPPORTED_10baseT_Half | SUPPORTED_100baseT_Half);


Your controller only supports one speed or the other?  This is also a  
little confusing to read.  It might be clearer if you build up a  
bitmask of the supported options, and then mask phydev->supported.   
That's just personal preference, though.

>
>
> +static int tc_mii_init(struct net_device *dev)
> +{
> +	struct tc35815_local *lp = netdev_priv(dev);
> +	int err;
> +	int i;
> +
> +	lp->mii_bus.name = "tc35815_mii_bus",
> +	lp->mii_bus.read = tc_mdio_read,
> +	lp->mii_bus.write = tc_mdio_write,
> +	lp->mii_bus.id = lp->pci_dev->devfn,


I just submitted a patch to change mii_bus.id to a char [].  It's an  
easy fix:

snprintf(lp->mii_bus.id, PHY_BUS_ID_SIZE, "%x", lp->pci_dev->devfn);

Or you can come up with a string on your own.  I haven't looked  
carefully to make sure you aren't using the number in some way.

>
>
> static void tc35815_restart(struct net_device *dev)
> {
> 	struct tc35815_local *lp = netdev_priv(dev);
> -	int pid = lp->phy_addr;
> -	int do_phy_reset = 1;
> -	del_timer(&lp->timer);		/* Kill if running	*/
>
> -	if (lp->mii_id[0] == 0x0016 && (lp->mii_id[1] & 0xfc00) == 0xf800) {
> +	if (lp->phy_dev && (lp->phy_dev->phy_id & 0xfffffc00) !=  
> 0x0016f800) {
> 		/* Resetting PHY cause problem on some chip... (SEEQ 80221) */
> -		do_phy_reset = 0;
> -	}
> -	if (do_phy_reset) {
> 		int timeout;
> -		tc_mdio_write(dev, pid, MII_BMCR, BMCR_RESET);
> +
> +		phy_write(lp->phy_dev, MII_BMCR, BMCR_RESET);
> 		timeout = 100;
> 		while (--timeout) {
> -			if (!(tc_mdio_read(dev, pid, MII_BMCR) & BMCR_RESET))
> +			if (!(phy_read(lp->phy_dev, MII_BMCR) & BMCR_RESET))
> 				break;
> 			udelay(1);
> 		}


Hm.  We should probably come up with a way to handle this inside the  
PHY driver, since the goal of the PHY Lib is to avoid having to know  
what type of PHY you are connected to.


>
>
> #ifdef WORKAROUND_LOSTCAR
> 	/* WORKAROUND: ignore LostCrS in full duplex operation */
> -	if ((lp->timer_state != asleep && lp->timer_state != lcheck)
> -	    || lp->fullduplex)
> +	if (!(lp->phy_dev->state == PHY_RUNNING ||
> +	      lp->phy_dev->state == PHY_CHANGELINK) ||
> +	    lp->duplex == DUPLEX_FULL)
> 		status &= ~Tx_NCarr;


Are you sure those states are right?  I'm just asking because it seems  
like an odd use of the phydev state.




From rpoornar@hotmail.com Fri Apr 11 16:26:08 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 11 Apr 2008 16:26:15 +0200 (CEST)
Received: from bay0-omc3-s17.bay0.hotmail.com ([65.54.246.217]:12250 "EHLO
	bay0-omc3-s17.bay0.hotmail.com") by lappi.linux-mips.net with ESMTP
	id S1786583AbYDKO0I convert rfc822-to-8bit (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 11 Apr 2008 16:26:08 +0200
Received: from BAY141-W48 ([65.55.152.83]) by bay0-omc3-s17.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959);
	 Fri, 11 Apr 2008 07:25:43 -0700
Message-ID: <BAY141-W485F2B6BCF95F92004A64DC2EF0@phx.gbl>
X-Originating-IP: [61.95.197.134]
From:	POORNIMA R <rpoornar@hotmail.com>
To:	<linux-mips@linux-mips.org>
CC:	<ralf@linux-mips.org>
Subject: [MIPS]hrt implementation on MIPS
Date:	Fri, 11 Apr 2008 14:25:43 +0000
Importance: Normal
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8BIT
MIME-Version: 1.0
X-OriginalArrivalTime: 11 Apr 2008 14:25:43.0655 (UTC) FILETIME=[ED043F70:01C89BDF]
Return-Path: <rpoornar@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: 18896
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: rpoornar@hotmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 554
Lines: 12



Hi,

I am a newbie to MIPS architecture. I am working on MIPS architecture and my kernel version is vanilla linux-2.6.18.
I  wanted to know whether High resolution timer implemented is done for MIPS?
If it is implemented is it implemented as a part of existing timer sub-system or as a seperate sub-system?
and how do I check HRT imlemenation?

Poornima
_________________________________________________________________
Technology : Catch up on updates on the latest Gadgets, Reviews, Gaming and Tips to use technology etc.
http://computing.in.msn.com/
From rpoornar@hotmail.com Fri Apr 11 16:26:39 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 11 Apr 2008 16:26:46 +0200 (CEST)
Received: from bay0-omc3-s22.bay0.hotmail.com ([65.54.246.222]:47333 "EHLO
	bay0-omc3-s22.bay0.hotmail.com") by lappi.linux-mips.net with ESMTP
	id S1786584AbYDKO0I convert rfc822-to-8bit (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 11 Apr 2008 16:26:08 +0200
Received: from BAY141-W20 ([65.55.152.55]) by bay0-omc3-s22.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959);
	 Fri, 11 Apr 2008 07:25:43 -0700
Message-ID: <BAY141-W20230983BB721CEFFD0670C2EF0@phx.gbl>
X-Originating-IP: [61.95.197.134]
From:	POORNIMA R <rpoornar@hotmail.com>
To:	<linux-mips@linux-mips.org>
CC:	<ralf@linux-mips.org>
Subject: [MIPS]hrt implementation on MIPS
Date:	Fri, 11 Apr 2008 14:25:43 +0000
Importance: Normal
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8BIT
MIME-Version: 1.0
X-OriginalArrivalTime: 11 Apr 2008 14:25:43.0636 (UTC) FILETIME=[ED015940:01C89BDF]
Return-Path: <rpoornar@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: 18897
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: rpoornar@hotmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 554
Lines: 12



Hi,

I am a newbie to MIPS architecture. I am working on MIPS architecture and my kernel version is vanilla linux-2.6.18.
I  wanted to know whether High resolution timer implemented is done for MIPS?
If it is implemented is it implemented as a part of existing timer sub-system or as a seperate sub-system?
and how do I check HRT imlemenation?

Poornima
_________________________________________________________________
Technology : Catch up on updates on the latest Gadgets, Reviews, Gaming and Tips to use technology etc.
http://computing.in.msn.com/
From rpoornar@hotmail.com Fri Apr 11 16:33:31 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 11 Apr 2008 16:33:36 +0200 (CEST)
Received: from bay0-omc3-s9.bay0.hotmail.com ([65.54.246.209]:32896 "EHLO
	bay0-omc3-s9.bay0.hotmail.com") by lappi.linux-mips.net with ESMTP
	id S1786590AbYDKOdb convert rfc822-to-8bit (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 11 Apr 2008 16:33:31 +0200
Received: from BAY141-W52 ([65.55.152.87]) by bay0-omc3-s9.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959);
	 Fri, 11 Apr 2008 07:33:08 -0700
Message-ID: <BAY141-W5221CFA922CACCA7ECC366C2EF0@phx.gbl>
X-Originating-IP: [61.95.197.134]
From:	POORNIMA R <rpoornar@hotmail.com>
To:	<ralf@linux-mips.org>
CC:	<linux-mips@linux-mips.org>
Subject: [MIPS]hrt implementation for mips
Date:	Fri, 11 Apr 2008 14:33:08 +0000
Importance: Normal
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8BIT
MIME-Version: 1.0
X-OriginalArrivalTime: 11 Apr 2008 14:33:08.0314 (UTC) FILETIME=[F60DD3A0:01C89BE0]
Return-Path: <rpoornar@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: 18898
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: rpoornar@hotmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 557
Lines: 12



Hi,
 
I am a newbie to MIPS architecture. I am working on MIPS architecture and my kernel version is vanilla linux-2.6.18.
I  wanted to know whether High resolution timer implementation is done for MIPS?
If it is implemented, is it implemented as a part of existing timer sub-system or as a seperate sub-system?
and how do I check HRT implementation?
 
Poornima
_________________________________________________________________
Video: Get a glimpse of the latest in Cricket, Bollywood, News and Fashion. Only on MSN videos.
http://video.msn.com/?mkt=en-in
From rpoornar@hotmail.com Fri Apr 11 16:34:07 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 11 Apr 2008 16:34:14 +0200 (CEST)
Received: from bay0-omc3-s23.bay0.hotmail.com ([65.54.246.223]:27248 "EHLO
	bay0-omc3-s23.bay0.hotmail.com") by lappi.linux-mips.net with ESMTP
	id S1786591AbYDKOdb convert rfc822-to-8bit (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 11 Apr 2008 16:33:31 +0200
Received: from BAY141-W54 ([65.55.152.89]) by bay0-omc3-s23.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959);
	 Fri, 11 Apr 2008 07:33:07 -0700
Message-ID: <BAY141-W540D8674F884B2B1C129ECC2EF0@phx.gbl>
X-Originating-IP: [61.95.197.134]
From:	POORNIMA R <rpoornar@hotmail.com>
To:	<ralf@linux-mips.org>
CC:	<linux-mips@linux-mips.org>
Subject: [MIPS]hrt implementation for mips
Date:	Fri, 11 Apr 2008 14:33:07 +0000
Importance: Normal
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8BIT
MIME-Version: 1.0
X-OriginalArrivalTime: 11 Apr 2008 14:33:08.0031 (UTC) FILETIME=[F5E2A4F0:01C89BE0]
Return-Path: <rpoornar@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: 18899
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: rpoornar@hotmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 557
Lines: 12



Hi,
 
I am a newbie to MIPS architecture. I am working on MIPS architecture and my kernel version is vanilla linux-2.6.18.
I  wanted to know whether High resolution timer implementation is done for MIPS?
If it is implemented, is it implemented as a part of existing timer sub-system or as a seperate sub-system?
and how do I check HRT implementation?
 
Poornima
_________________________________________________________________
Video: Get a glimpse of the latest in Cricket, Bollywood, News and Fashion. Only on MSN videos.
http://video.msn.com/?mkt=en-in
From ralf@linux-mips.org Fri Apr 11 16:49:37 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 11 Apr 2008 16:49:41 +0200 (CEST)
Received: from oss.sgi.com ([192.48.170.157]:28547 "EHLO oss.sgi.com")
	by lappi.linux-mips.net with ESMTP id S1786620AbYDKOth (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 11 Apr 2008 16:49:37 +0200
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3BEmrOj007011
	for <linux-mips@linux-mips.org>; Fri, 11 Apr 2008 07:48:54 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m3BEnWuk012239
	for <linux-mips@linux-mips.org>; Fri, 11 Apr 2008 15:49:32 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m3BEnPaI012238
	for linux-mips@linux-mips.org; Fri, 11 Apr 2008 15:49:25 +0100
Date:	Fri, 11 Apr 2008 15:49:25 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	linux-mips@linux-mips.org
Subject: [MIPS] More server moving ...
Message-ID: <20080411144925.GA12209@linux-mips.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18900
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 209
Lines: 5

The linux-mips.org server machine has just been installed in Portugal.
So I'm now going to shut down the temporary services and migrate
services to the real machines.  Thanks for everybody's patience!

  Ralf

From jeff@garzik.org Sun Apr 13 19:40:43 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 13 Apr 2008 19:40:45 +0100 (BST)
Received: from p549F61CF.dip.t-dialin.net ([84.159.97.207]:51393 "EHLO
	p549F61CF.dip.t-dialin.net") by ftp.linux-mips.org with ESMTP
	id S20021353AbYDMSkn (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 13 Apr 2008 19:40:43 +0100
Received: from srv5.dvmed.net ([207.36.208.214]:48553 "EHLO mail.dvmed.net")
	by lappi.linux-mips.net with ESMTP id S1788220AbYDLJAz (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sat, 12 Apr 2008 11:00:55 +0200
Received: from cpe-069-134-071-233.nc.res.rr.com ([69.134.71.233] helo=core.yyz.us)
	by mail.dvmed.net with esmtpsa (Exim 4.68 #1 (Red Hat Linux))
	id 1JkbbO-0004BS-Ab; Sat, 12 Apr 2008 09:00:50 +0000
Message-ID: <48007A41.2000803@garzik.org>
Date:	Sat, 12 Apr 2008 05:00:49 -0400
From:	Jeff Garzik <jeff@garzik.org>
User-Agent: Thunderbird 2.0.0.12 (X11/20080226)
MIME-Version: 1.0
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
CC:	linux-mips@linux-mips.org, netdev@vger.kernel.org
Subject: Re: [PATCH 1/6] tc35815: Statistics cleanup
References: <20080411.002412.03977557.anemo@mba.ocn.ne.jp>
In-Reply-To: <20080411.002412.03977557.anemo@mba.ocn.ne.jp>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <jeff@garzik.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18902
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: jeff@garzik.org
Precedence: bulk
X-list: linux-mips
Content-Length: 297
Lines: 11

Atsushi Nemoto wrote:
> Use struct net_device_stats embedded in struct net_device.
> 
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
> ---
>  drivers/net/tc35815.c |   61 +++++++++++++++++++++++++------------------------
>  1 files changed, 31 insertions(+), 30 deletions(-)

applied 1-6



From anemo@mba.ocn.ne.jp Sun Apr 13 20:07:12 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 13 Apr 2008 20:07:15 +0100 (BST)
Received: from p549F61CF.dip.t-dialin.net ([84.159.97.207]:51393 "EHLO
	p549F61CF.dip.t-dialin.net") by ftp.linux-mips.org with ESMTP
	id S20022105AbYDMTHM (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 13 Apr 2008 20:07:12 +0100
Received: from mba.ocn.ne.jp ([122.1.235.107]:51175 "EHLO smtp.mba.ocn.ne.jp")
	by lappi.linux-mips.net with ESMTP id S1786736AbYDKPrO (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 11 Apr 2008 17:47:14 +0200
Received: from localhost (p4083-ipad203funabasi.chiba.ocn.ne.jp [222.146.83.83])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 6C6B6B24B; Sat, 12 Apr 2008 00:46:54 +0900 (JST)
Date:	Sat, 12 Apr 2008 00:47:46 +0900 (JST)
Message-Id: <20080412.004746.51861397.anemo@mba.ocn.ne.jp>
To:	afleming@freescale.com
Cc:	linux-mips@linux-mips.org, jeff@garzik.org, netdev@vger.kernel.org
Subject: Re: [PATCH 5/6] tc35815: Use generic PHY layer
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <20080412.004058.88699680.anemo@mba.ocn.ne.jp>
References: <20080411.002523.18305938.anemo@mba.ocn.ne.jp>
	<4CD8B148-87DF-42C6-8A04-A6501109C1F2@freescale.com>
	<20080412.004058.88699680.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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18903
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 40490
Lines: 1356

Convert the tc35815 driver to use the generic PHY layer in
drivers/net/phy.  Also rename 'boardtype' to 'chiptype' which hould be
more appropriate.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
Updated considering comments from Andy Fleming.
Other patches in the patchset are not affected.

 drivers/net/Kconfig   |    2 +-
 drivers/net/tc35815.c | 1052 ++++++++++++++-----------------------------------
 2 files changed, 302 insertions(+), 752 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 757ba15..c1f2fd5 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1431,7 +1431,7 @@ config CS89x0
 config TC35815
 	tristate "TOSHIBA TC35815 Ethernet support"
 	depends on NET_PCI && PCI && MIPS
-	select MII
+	select PHYLIB
 
 config EEPRO100
 	tristate "EtherExpressPro/100 support (eepro100, original Becker driver)"
diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
index 60eff78..59f783e 100644
--- a/drivers/net/tc35815.c
+++ b/drivers/net/tc35815.c
@@ -23,9 +23,9 @@
  */
 
 #ifdef TC35815_NAPI
-#define DRV_VERSION	"1.36-NAPI"
+#define DRV_VERSION	"1.37-NAPI"
 #else
-#define DRV_VERSION	"1.36"
+#define DRV_VERSION	"1.37"
 #endif
 static const char *version = "tc35815.c:v" DRV_VERSION "\n";
 #define MODNAME			"tc35815"
@@ -47,8 +47,8 @@ static const char *version = "tc35815.c:v" DRV_VERSION "\n";
 #include <linux/skbuff.h>
 #include <linux/delay.h>
 #include <linux/pci.h>
-#include <linux/mii.h>
-#include <linux/ethtool.h>
+#include <linux/phy.h>
+#include <linux/workqueue.h>
 #include <linux/platform_device.h>
 #include <asm/io.h>
 #include <asm/byteorder.h>
@@ -60,16 +60,16 @@ static const char *version = "tc35815.c:v" DRV_VERSION "\n";
 #define WORKAROUND_100HALF_PROMISC
 /* #define TC35815_USE_PACKEDBUFFER */
 
-typedef enum {
+enum tc35815_chiptype {
 	TC35815CF = 0,
 	TC35815_NWU,
 	TC35815_TX4939,
-} board_t;
+};
 
-/* indexed by board_t, above */
+/* indexed by tc35815_chiptype, above */
 static const struct {
 	const char *name;
-} board_info[] __devinitdata = {
+} chip_info[] __devinitdata = {
 	{ "TOSHIBA TC35815CF 10/100BaseTX" },
 	{ "TOSHIBA TC35815 with Wake on LAN" },
 	{ "TOSHIBA TC35815/TX4939" },
@@ -87,7 +87,6 @@ MODULE_DEVICE_TABLE (pci, tc35815_pci_tbl);
 static struct tc35815_options {
 	int speed;
 	int duplex;
-	int doforce;
 } options;
 
 /*
@@ -348,7 +347,7 @@ struct BDesc {
 	Int_STargAbtEn | \
 	Int_BLExEn  | Int_FDAExEn) /* maybe 0xb7f*/
 #define DMA_CTL_CMD	DMA_BURST_SIZE
-#define HAVE_DMA_RXALIGN(lp)	likely((lp)->boardtype != TC35815CF)
+#define HAVE_DMA_RXALIGN(lp)	likely((lp)->chiptype != TC35815CF)
 
 /* Tuning parameters */
 #define DMA_BURST_SIZE	32
@@ -401,16 +400,7 @@ struct FrFD {
 
 #define TC35815_TX_TIMEOUT  msecs_to_jiffies(400)
 
-/* Timer state engine. */
-enum tc35815_timer_state {
-	arbwait  = 0,	/* Waiting for auto negotiation to complete.          */
-	lupwait  = 1,	/* Auto-neg complete, awaiting link-up status.        */
-	ltrywait = 2,	/* Forcing try of all modes, from fastest to slowest. */
-	asleep   = 3,	/* Time inactive.                                     */
-	lcheck   = 4,	/* Check link status.                                 */
-};
-
-/* Information that need to be kept for each board. */
+/* Information that need to be kept for each controller. */
 struct tc35815_local {
 	struct pci_dev *pci_dev;
 
@@ -432,12 +422,12 @@ struct tc35815_local {
 	 */
 	spinlock_t lock;
 
-	int phy_addr;
-	int fullduplex;
-	unsigned short saved_lpa;
-	struct timer_list timer;
-	enum tc35815_timer_state timer_state; /* State of auto-neg timer. */
-	unsigned int timer_ticks;	/* Number of clicks at each state  */
+	struct mii_bus mii_bus;
+	struct phy_device *phy_dev;
+	int duplex;
+	int speed;
+	int link;
+	struct work_struct restart_work;
 
 	/*
 	 * Transmitting: Batch Mode.
@@ -475,10 +465,8 @@ struct tc35815_local {
 		dma_addr_t skb_dma;
 	} tx_skbs[TX_FD_NUM], rx_skbs[RX_BUF_NUM];
 #endif
-	struct mii_if_info mii;
-	unsigned short mii_id[2];
 	u32 msg_enable;
-	board_t boardtype;
+	enum tc35815_chiptype chiptype;
 };
 
 static inline dma_addr_t fd_virt_to_bus(struct tc35815_local *lp, void *virt)
@@ -586,19 +574,222 @@ static const struct ethtool_ops tc35815_ethtool_ops;
 /* Example routines you must write ;->. */
 static void 	tc35815_chip_reset(struct net_device *dev);
 static void 	tc35815_chip_init(struct net_device *dev);
-static void	tc35815_find_phy(struct net_device *dev);
-static void 	tc35815_phy_chip_init(struct net_device *dev);
 
 #ifdef DEBUG
 static void	panic_queues(struct net_device *dev);
 #endif
 
-static void tc35815_timer(unsigned long data);
-static void tc35815_start_auto_negotiation(struct net_device *dev,
-					   struct ethtool_cmd *ep);
-static int tc_mdio_read(struct net_device *dev, int phy_id, int location);
-static void tc_mdio_write(struct net_device *dev, int phy_id, int location,
-			  int val);
+static void tc35815_restart_work(struct work_struct *work);
+
+static int tc_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
+{
+	struct net_device *dev = bus->priv;
+	struct tc35815_regs __iomem *tr =
+		(struct tc35815_regs __iomem *)dev->base_addr;
+	unsigned long timeout = jiffies + 10;
+
+	tc_writel(MD_CA_Busy | (mii_id << 5) | (regnum & 0x1f), &tr->MD_CA);
+	while (tc_readl(&tr->MD_CA) & MD_CA_Busy) {
+		if (time_after(jiffies, timeout))
+			return -EIO;
+		cpu_relax();
+	}
+	return tc_readl(&tr->MD_Data) & 0xffff;
+}
+
+static int tc_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 val)
+{
+	struct net_device *dev = bus->priv;
+	struct tc35815_regs __iomem *tr =
+		(struct tc35815_regs __iomem *)dev->base_addr;
+	unsigned long timeout = jiffies + 10;
+
+	tc_writel(val, &tr->MD_Data);
+	tc_writel(MD_CA_Busy | MD_CA_Wr | (mii_id << 5) | (regnum & 0x1f),
+		  &tr->MD_CA);
+	while (tc_readl(&tr->MD_CA) & MD_CA_Busy) {
+		if (time_after(jiffies, timeout))
+			return -EIO;
+		cpu_relax();
+	}
+	return 0;
+}
+
+static void tc_handle_link_change(struct net_device *dev)
+{
+	struct tc35815_local *lp = netdev_priv(dev);
+	struct phy_device *phydev = lp->phy_dev;
+	unsigned long flags;
+	int status_change = 0;
+
+	spin_lock_irqsave(&lp->lock, flags);
+	if (phydev->link &&
+	    (lp->speed != phydev->speed || lp->duplex != phydev->duplex)) {
+		struct tc35815_regs __iomem *tr =
+			(struct tc35815_regs __iomem *)dev->base_addr;
+		u32 reg;
+
+		reg = tc_readl(&tr->MAC_Ctl);
+		reg |= MAC_HaltReq;
+		tc_writel(reg, &tr->MAC_Ctl);
+		if (phydev->duplex == DUPLEX_FULL)
+			reg |= MAC_FullDup;
+		else
+			reg &= ~MAC_FullDup;
+		tc_writel(reg, &tr->MAC_Ctl);
+		reg &= ~MAC_HaltReq;
+		tc_writel(reg, &tr->MAC_Ctl);
+
+		/*
+		 * TX4939 PCFG.SPEEDn bit will be changed on
+		 * NETDEV_CHANGE event.
+		 */
+
+#if !defined(NO_CHECK_CARRIER) && defined(WORKAROUND_LOSTCAR)
+		/*
+		 * WORKAROUND: enable LostCrS only if half duplex
+		 * operation.
+		 * (TX4939 does not have EnLCarr)
+		 */
+		if (phydev->duplex == DUPLEX_HALF &&
+		    lp->chiptype != TC35815_TX4939)
+			tc_writel(tc_readl(&tr->Tx_Ctl) | Tx_EnLCarr,
+				  &tr->Tx_Ctl);
+#endif
+
+		lp->speed = phydev->speed;
+		lp->duplex = phydev->duplex;
+		status_change = 1;
+	}
+
+	if (phydev->link != lp->link) {
+		if (phydev->link) {
+#ifdef WORKAROUND_100HALF_PROMISC
+			/* delayed promiscuous enabling */
+			if (dev->flags & IFF_PROMISC)
+				tc35815_set_multicast_list(dev);
+#endif
+			netif_schedule(dev);
+		} else {
+			lp->speed = 0;
+			lp->duplex = -1;
+		}
+		lp->link = phydev->link;
+
+		status_change = 1;
+	}
+	spin_unlock_irqrestore(&lp->lock, flags);
+
+	if (status_change && netif_msg_link(lp)) {
+		phy_print_status(phydev);
+#ifdef DEBUG
+		printk(KERN_DEBUG
+		       "%s: MII BMCR %04x BMSR %04x LPA %04x\n",
+		       dev->name,
+		       phy_read(phydev, MII_BMCR),
+		       phy_read(phydev, MII_BMSR),
+		       phy_read(phydev, MII_LPA));
+#endif
+	}
+}
+
+static int tc_mii_probe(struct net_device *dev)
+{
+	struct tc35815_local *lp = netdev_priv(dev);
+	struct phy_device *phydev = NULL;
+	int phy_addr;
+	u32 dropmask;
+
+	/* find the first phy */
+	for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++) {
+		if (lp->mii_bus.phy_map[phy_addr]) {
+			if (phydev) {
+				printk(KERN_ERR "%s: multiple PHYs found\n",
+				       dev->name);
+				return -EINVAL;
+			}
+			phydev = lp->mii_bus.phy_map[phy_addr];
+			break;
+		}
+	}
+
+	if (!phydev) {
+		printk(KERN_ERR "%s: no PHY found\n", dev->name);
+		return -ENODEV;
+	}
+
+	/* attach the mac to the phy */
+	phydev = phy_connect(dev, phydev->dev.bus_id,
+			     &tc_handle_link_change, 0,
+			     lp->chiptype == TC35815_TX4939 ?
+			     PHY_INTERFACE_MODE_RMII : PHY_INTERFACE_MODE_MII);
+	if (IS_ERR(phydev)) {
+		printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name);
+		return PTR_ERR(phydev);
+	}
+	printk(KERN_INFO "%s: attached PHY driver [%s] "
+		"(mii_bus:phy_addr=%s, id=%x)\n",
+		dev->name, phydev->drv->name, phydev->dev.bus_id,
+		phydev->phy_id);
+
+	/* mask with MAC supported features */
+	phydev->supported &= PHY_BASIC_FEATURES;
+	dropmask = 0;
+	if (options.speed == 10)
+		dropmask |= SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full;
+	else if (options.speed == 100)
+		dropmask |= SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full;
+	if (options.duplex == 1)
+		dropmask |= SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Full;
+	else if (options.duplex == 2)
+		dropmask |= SUPPORTED_10baseT_Half | SUPPORTED_100baseT_Half;
+	phydev->supported &= ~dropmask;
+	phydev->advertising = phydev->supported;
+
+	lp->link = 0;
+	lp->speed = 0;
+	lp->duplex = -1;
+	lp->phy_dev = phydev;
+
+	return 0;
+}
+
+static int tc_mii_init(struct net_device *dev)
+{
+	struct tc35815_local *lp = netdev_priv(dev);
+	int err;
+	int i;
+
+	lp->mii_bus.name = "tc35815_mii_bus";
+	lp->mii_bus.read = tc_mdio_read;
+	lp->mii_bus.write = tc_mdio_write;
+	lp->mii_bus.id = (lp->pci_dev->bus->number << 8) | lp->pci_dev->devfn;
+	lp->mii_bus.priv = dev;
+	lp->mii_bus.dev = &lp->pci_dev->dev;
+	lp->mii_bus.irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
+	if (!lp->mii_bus.irq) {
+		err = -ENOMEM;
+		goto err_out;
+	}
+
+	for (i = 0; i < PHY_MAX_ADDR; i++)
+		lp->mii_bus.irq[i] = PHY_POLL;
+
+	err = mdiobus_register(&lp->mii_bus);
+	if (err)
+		goto err_out_free_mdio_irq;
+	err = tc_mii_probe(dev);
+	if (err)
+		goto err_out_unregister_bus;
+	return 0;
+
+err_out_unregister_bus:
+	mdiobus_unregister(&lp->mii_bus);
+err_out_free_mdio_irq:
+	kfree(lp->mii_bus.irq);
+err_out:
+	return err;
+}
 
 #ifdef CONFIG_CPU_TX49XX
 /*
@@ -669,8 +860,8 @@ static int __devinit tc35815_init_one (struct pci_dev *pdev,
 	if (!printed_version++) {
 		printk(version);
 		dev_printk(KERN_DEBUG, &pdev->dev,
-			   "speed:%d duplex:%d doforce:%d\n",
-			   options.speed, options.duplex, options.doforce);
+			   "speed:%d duplex:%d\n",
+			   options.speed, options.duplex);
 	}
 
 	if (!pdev->irq) {
@@ -718,9 +909,10 @@ static int __devinit tc35815_init_one (struct pci_dev *pdev,
 	dev->irq = pdev->irq;
 	dev->base_addr = (unsigned long) ioaddr;
 
+	INIT_WORK(&lp->restart_work, tc35815_restart_work);
 	spin_lock_init(&lp->lock);
 	lp->pci_dev = pdev;
-	lp->boardtype = ent->driver_data;
+	lp->chiptype = ent->driver_data;
 
 	lp->msg_enable = NETIF_MSG_TX_ERR | NETIF_MSG_HW | NETIF_MSG_DRV | NETIF_MSG_LINK;
 	pci_set_drvdata(pdev, dev);
@@ -741,24 +933,19 @@ static int __devinit tc35815_init_one (struct pci_dev *pdev,
 	memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
 	printk(KERN_INFO "%s: %s at 0x%lx, %s, IRQ %d\n",
 		dev->name,
-		board_info[ent->driver_data].name,
+		chip_info[ent->driver_data].name,
 		dev->base_addr,
 		print_mac(mac, dev->dev_addr),
 		dev->irq);
 
-	setup_timer(&lp->timer, tc35815_timer, (unsigned long) dev);
-	lp->mii.dev = dev;
-	lp->mii.mdio_read = tc_mdio_read;
-	lp->mii.mdio_write = tc_mdio_write;
-	lp->mii.phy_id_mask = 0x1f;
-	lp->mii.reg_num_mask = 0x1f;
-	tc35815_find_phy(dev);
-	lp->mii.phy_id = lp->phy_addr;
-	lp->mii.full_duplex = 0;
-	lp->mii.force_media = 0;
+	rc = tc_mii_init(dev);
+	if (rc)
+		goto err_out_unregister;
 
 	return 0;
 
+err_out_unregister:
+	unregister_netdev(dev);
 err_out:
 	free_netdev (dev);
 	return rc;
@@ -768,7 +955,11 @@ err_out:
 static void __devexit tc35815_remove_one (struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata (pdev);
+	struct tc35815_local *lp = netdev_priv(dev);
 
+	phy_disconnect(lp->phy_dev);
+	mdiobus_unregister(&lp->mii_bus);
+	kfree(lp->mii_bus.irq);
 	unregister_netdev (dev);
 	free_netdev (dev);
 
@@ -1098,20 +1289,14 @@ static int tc35815_tx_full(struct net_device *dev)
 static void tc35815_restart(struct net_device *dev)
 {
 	struct tc35815_local *lp = netdev_priv(dev);
-	int pid = lp->phy_addr;
-	int do_phy_reset = 1;
-	del_timer(&lp->timer);		/* Kill if running	*/
 
-	if (lp->mii_id[0] == 0x0016 && (lp->mii_id[1] & 0xfc00) == 0xf800) {
-		/* Resetting PHY cause problem on some chip... (SEEQ 80221) */
-		do_phy_reset = 0;
-	}
-	if (do_phy_reset) {
+	if (lp->phy_dev) {
 		int timeout;
-		tc_mdio_write(dev, pid, MII_BMCR, BMCR_RESET);
+
+		phy_write(lp->phy_dev, MII_BMCR, BMCR_RESET);
 		timeout = 100;
 		while (--timeout) {
-			if (!(tc_mdio_read(dev, pid, MII_BMCR) & BMCR_RESET))
+			if (!(phy_read(lp->phy_dev, MII_BMCR) & BMCR_RESET))
 				break;
 			udelay(1);
 		}
@@ -1119,45 +1304,53 @@ static void tc35815_restart(struct net_device *dev)
 			printk(KERN_ERR "%s: BMCR reset failed.\n", dev->name);
 	}
 
+	spin_lock_irq(&lp->lock);
 	tc35815_chip_reset(dev);
 	tc35815_clear_queues(dev);
 	tc35815_chip_init(dev);
 	/* Reconfigure CAM again since tc35815_chip_init() initialize it. */
 	tc35815_set_multicast_list(dev);
+	spin_unlock_irq(&lp->lock);
+
+	netif_wake_queue(dev);
 }
 
-static void tc35815_tx_timeout(struct net_device *dev)
+static void tc35815_restart_work(struct work_struct *work)
+{
+	struct tc35815_local *lp =
+		container_of(work, struct tc35815_local, restart_work);
+	struct net_device *dev = lp->dev;
+
+	tc35815_restart(dev);
+}
+
+static void tc35815_schedule_restart(struct net_device *dev)
 {
 	struct tc35815_local *lp = netdev_priv(dev);
 	struct tc35815_regs __iomem *tr =
 		(struct tc35815_regs __iomem *)dev->base_addr;
 
+	/* disable interrupts */
+	tc_writel(0, &tr->Int_En);
+	tc_writel(tc_readl(&tr->DMA_Ctl) | DMA_IntMask, &tr->DMA_Ctl);
+	schedule_work(&lp->restart_work);
+}
+
+static void tc35815_tx_timeout(struct net_device *dev)
+{
+	struct tc35815_regs __iomem *tr =
+		(struct tc35815_regs __iomem *)dev->base_addr;
+
 	printk(KERN_WARNING "%s: transmit timed out, status %#x\n",
 	       dev->name, tc_readl(&tr->Tx_Stat));
 
 	/* Try to restart the adaptor. */
-	spin_lock_irq(&lp->lock);
-	tc35815_restart(dev);
-	spin_unlock_irq(&lp->lock);
-
+	tc35815_schedule_restart(dev);
 	dev->stats.tx_errors++;
-
-	/* If we have space available to accept new transmit
-	 * requests, wake up the queueing layer.  This would
-	 * be the case if the chipset_init() call above just
-	 * flushes out the tx queue and empties it.
-	 *
-	 * If instead, the tx queue is retained then the
-	 * netif_wake_queue() call should be placed in the
-	 * TX completion interrupt handler of the driver instead
-	 * of here.
-	 */
-	if (!tc35815_tx_full(dev))
-		netif_wake_queue(dev);
 }
 
 /*
- * Open/initialize the board. This is called (in the current kernel)
+ * Open/initialize the controller. This is called (in the current kernel)
  * sometime after booting when the 'ifconfig' program is run.
  *
  * This routine should set everything up anew at each open, even
@@ -1177,7 +1370,6 @@ tc35815_open(struct net_device *dev)
 		return -EAGAIN;
 	}
 
-	del_timer(&lp->timer);		/* Kill if running	*/
 	tc35815_chip_reset(dev);
 
 	if (tc35815_init_queues(dev) != 0) {
@@ -1194,6 +1386,9 @@ tc35815_open(struct net_device *dev)
 	tc35815_chip_init(dev);
 	spin_unlock_irq(&lp->lock);
 
+	/* schedule a link state check */
+	phy_start(lp->phy_dev);
+
 	/* We are now ready to accept transmit requeusts from
 	 * the queueing layer of the networking.
 	 */
@@ -1314,7 +1509,7 @@ static void tc35815_fatal_error_interrupt(struct net_device *dev, u32 status)
 		panic("%s: Too many fatal errors.", dev->name);
 	printk(KERN_WARNING "%s: Resetting ...\n", dev->name);
 	/* Try to restart the adaptor. */
-	tc35815_restart(dev);
+	tc35815_schedule_restart(dev);
 }
 
 #ifdef TC35815_NAPI
@@ -1735,12 +1930,11 @@ tc35815_check_tx_stat(struct net_device *dev, int status)
 
 #ifndef NO_CHECK_CARRIER
 	/* TX4939 does not have NCarr */
-	if (lp->boardtype == TC35815_TX4939)
+	if (lp->chiptype == TC35815_TX4939)
 		status &= ~Tx_NCarr;
 #ifdef WORKAROUND_LOSTCAR
 	/* WORKAROUND: ignore LostCrS in full duplex operation */
-	if ((lp->timer_state != asleep && lp->timer_state != lcheck)
-	    || lp->fullduplex)
+	if (!lp->link || lp->duplex == DUPLEX_FULL)
 		status &= ~Tx_NCarr;
 #endif
 #endif
@@ -1905,10 +2099,11 @@ tc35815_close(struct net_device *dev)
 #ifdef TC35815_NAPI
 	napi_disable(&lp->napi);
 #endif
+	if (lp->phy_dev)
+		phy_stop(lp->phy_dev);
+	cancel_work_sync(&lp->restart_work);
 
 	/* Flush the Tx and disable Rx here. */
-
-	del_timer(&lp->timer);		/* Kill if running	*/
 	tc35815_chip_reset(dev);
 	free_irq(dev->irq, dev);
 
@@ -1993,8 +2188,8 @@ tc35815_set_multicast_list(struct net_device *dev)
 		/* With some (all?) 100MHalf HUB, controller will hang
 		 * if we enabled promiscuous mode before linkup... */
 		struct tc35815_local *lp = netdev_priv(dev);
-		int pid = lp->phy_addr;
-		if (!(tc_mdio_read(dev, pid, MII_BMSR) & BMSR_LSTATUS))
+
+		if (!lp->link)
 			return;
 #endif
 		/* Enable promiscuous mode */
@@ -2041,60 +2236,19 @@ static void tc35815_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *
 static int tc35815_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 {
 	struct tc35815_local *lp = netdev_priv(dev);
-	spin_lock_irq(&lp->lock);
-	mii_ethtool_gset(&lp->mii, cmd);
-	spin_unlock_irq(&lp->lock);
-	return 0;
-}
-
-static int tc35815_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
-{
-	struct tc35815_local *lp = netdev_priv(dev);
-	int rc;
-#if 1	/* use our negotiation method... */
-	/* Verify the settings we care about. */
-	if (cmd->autoneg != AUTONEG_ENABLE &&
-	    cmd->autoneg != AUTONEG_DISABLE)
-		return -EINVAL;
-	if (cmd->autoneg == AUTONEG_DISABLE &&
-	    ((cmd->speed != SPEED_100 &&
-	      cmd->speed != SPEED_10) ||
-	     (cmd->duplex != DUPLEX_HALF &&
-	      cmd->duplex != DUPLEX_FULL)))
-		return -EINVAL;
 
-	/* Ok, do it to it. */
-	spin_lock_irq(&lp->lock);
-	del_timer(&lp->timer);
-	tc35815_start_auto_negotiation(dev, cmd);
-	spin_unlock_irq(&lp->lock);
-	rc = 0;
-#else
-	spin_lock_irq(&lp->lock);
-	rc = mii_ethtool_sset(&lp->mii, cmd);
-	spin_unlock_irq(&lp->lock);
-#endif
-	return rc;
+	if (!lp->phy_dev)
+		return -ENODEV;
+	return phy_ethtool_gset(lp->phy_dev, cmd);
 }
 
-static int tc35815_nway_reset(struct net_device *dev)
+static int tc35815_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 {
 	struct tc35815_local *lp = netdev_priv(dev);
-	int rc;
-	spin_lock_irq(&lp->lock);
-	rc = mii_nway_restart(&lp->mii);
-	spin_unlock_irq(&lp->lock);
-	return rc;
-}
 
-static u32 tc35815_get_link(struct net_device *dev)
-{
-	struct tc35815_local *lp = netdev_priv(dev);
-	int rc;
-	spin_lock_irq(&lp->lock);
-	rc = mii_link_ok(&lp->mii);
-	spin_unlock_irq(&lp->lock);
-	return rc;
+	if (!lp->phy_dev)
+		return -ENODEV;
+	return phy_ethtool_sset(lp->phy_dev, cmd);
 }
 
 static u32 tc35815_get_msglevel(struct net_device *dev)
@@ -2148,8 +2302,7 @@ static const struct ethtool_ops tc35815_ethtool_ops = {
 	.get_drvinfo		= tc35815_get_drvinfo,
 	.get_settings		= tc35815_get_settings,
 	.set_settings		= tc35815_set_settings,
-	.nway_reset		= tc35815_nway_reset,
-	.get_link		= tc35815_get_link,
+	.get_link		= ethtool_op_get_link,
 	.get_msglevel		= tc35815_get_msglevel,
 	.set_msglevel		= tc35815_set_msglevel,
 	.get_strings		= tc35815_get_strings,
@@ -2160,610 +2313,12 @@ static const struct ethtool_ops tc35815_ethtool_ops = {
 static int tc35815_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct tc35815_local *lp = netdev_priv(dev);
-	int rc;
 
 	if (!netif_running(dev))
 		return -EINVAL;
-
-	spin_lock_irq(&lp->lock);
-	rc = generic_mii_ioctl(&lp->mii, if_mii(rq), cmd, NULL);
-	spin_unlock_irq(&lp->lock);
-
-	return rc;
-}
-
-static int tc_mdio_read(struct net_device *dev, int phy_id, int location)
-{
-	struct tc35815_regs __iomem *tr =
-		(struct tc35815_regs __iomem *)dev->base_addr;
-	u32 data;
-	tc_writel(MD_CA_Busy | (phy_id << 5) | location, &tr->MD_CA);
-	while (tc_readl(&tr->MD_CA) & MD_CA_Busy)
-		;
-	data = tc_readl(&tr->MD_Data);
-	return data & 0xffff;
-}
-
-static void tc_mdio_write(struct net_device *dev, int phy_id, int location,
-			  int val)
-{
-	struct tc35815_regs __iomem *tr =
-		(struct tc35815_regs __iomem *)dev->base_addr;
-	tc_writel(val, &tr->MD_Data);
-	tc_writel(MD_CA_Busy | MD_CA_Wr | (phy_id << 5) | location, &tr->MD_CA);
-	while (tc_readl(&tr->MD_CA) & MD_CA_Busy)
-		;
-}
-
-/* Auto negotiation.  The scheme is very simple.  We have a timer routine
- * that keeps watching the auto negotiation process as it progresses.
- * The DP83840 is first told to start doing it's thing, we set up the time
- * and place the timer state machine in it's initial state.
- *
- * Here the timer peeks at the DP83840 status registers at each click to see
- * if the auto negotiation has completed, we assume here that the DP83840 PHY
- * will time out at some point and just tell us what (didn't) happen.  For
- * complete coverage we only allow so many of the ticks at this level to run,
- * when this has expired we print a warning message and try another strategy.
- * This "other" strategy is to force the interface into various speed/duplex
- * configurations and we stop when we see a link-up condition before the
- * maximum number of "peek" ticks have occurred.
- *
- * Once a valid link status has been detected we configure the BigMAC and
- * the rest of the Happy Meal to speak the most efficient protocol we could
- * get a clean link for.  The priority for link configurations, highest first
- * is:
- *                 100 Base-T Full Duplex
- *                 100 Base-T Half Duplex
- *                 10 Base-T Full Duplex
- *                 10 Base-T Half Duplex
- *
- * We start a new timer now, after a successful auto negotiation status has
- * been detected.  This timer just waits for the link-up bit to get set in
- * the BMCR of the DP83840.  When this occurs we print a kernel log message
- * describing the link type in use and the fact that it is up.
- *
- * If a fatal error of some sort is signalled and detected in the interrupt
- * service routine, and the chip is reset, or the link is ifconfig'd down
- * and then back up, this entire process repeats itself all over again.
- */
-/* Note: Above comments are come from sunhme driver. */
-
-static int tc35815_try_next_permutation(struct net_device *dev)
-{
-	struct tc35815_local *lp = netdev_priv(dev);
-	int pid = lp->phy_addr;
-	unsigned short bmcr;
-
-	bmcr = tc_mdio_read(dev, pid, MII_BMCR);
-
-	/* Downgrade from full to half duplex.  Only possible via ethtool.  */
-	if (bmcr & BMCR_FULLDPLX) {
-		bmcr &= ~BMCR_FULLDPLX;
-		printk(KERN_DEBUG "%s: try next permutation (BMCR %x)\n", dev->name, bmcr);
-		tc_mdio_write(dev, pid, MII_BMCR, bmcr);
-		return 0;
-	}
-
-	/* Downgrade from 100 to 10. */
-	if (bmcr & BMCR_SPEED100) {
-		bmcr &= ~BMCR_SPEED100;
-		printk(KERN_DEBUG "%s: try next permutation (BMCR %x)\n", dev->name, bmcr);
-		tc_mdio_write(dev, pid, MII_BMCR, bmcr);
-		return 0;
-	}
-
-	/* We've tried everything. */
-	return -1;
-}
-
-static void
-tc35815_display_link_mode(struct net_device *dev)
-{
-	struct tc35815_local *lp = netdev_priv(dev);
-	int pid = lp->phy_addr;
-	unsigned short lpa, bmcr;
-	char *speed = "", *duplex = "";
-
-	lpa = tc_mdio_read(dev, pid, MII_LPA);
-	bmcr = tc_mdio_read(dev, pid, MII_BMCR);
-	if (options.speed ? (bmcr & BMCR_SPEED100) : (lpa & (LPA_100HALF | LPA_100FULL)))
-		speed = "100Mb/s";
-	else
-		speed = "10Mb/s";
-	if (options.duplex ? (bmcr & BMCR_FULLDPLX) : (lpa & (LPA_100FULL | LPA_10FULL)))
-		duplex = "Full Duplex";
-	else
-		duplex = "Half Duplex";
-
-	if (netif_msg_link(lp))
-		printk(KERN_INFO "%s: Link is up at %s, %s.\n",
-		       dev->name, speed, duplex);
-	printk(KERN_DEBUG "%s: MII BMCR %04x BMSR %04x LPA %04x\n",
-	       dev->name,
-	       bmcr, tc_mdio_read(dev, pid, MII_BMSR), lpa);
-}
-
-static void tc35815_display_forced_link_mode(struct net_device *dev)
-{
-	struct tc35815_local *lp = netdev_priv(dev);
-	int pid = lp->phy_addr;
-	unsigned short bmcr;
-	char *speed = "", *duplex = "";
-
-	bmcr = tc_mdio_read(dev, pid, MII_BMCR);
-	if (bmcr & BMCR_SPEED100)
-		speed = "100Mb/s";
-	else
-		speed = "10Mb/s";
-	if (bmcr & BMCR_FULLDPLX)
-		duplex = "Full Duplex.\n";
-	else
-		duplex = "Half Duplex.\n";
-
-	if (netif_msg_link(lp))
-		printk(KERN_INFO "%s: Link has been forced up at %s, %s",
-		       dev->name, speed, duplex);
-}
-
-static void tc35815_set_link_modes(struct net_device *dev)
-{
-	struct tc35815_local *lp = netdev_priv(dev);
-	struct tc35815_regs __iomem *tr =
-		(struct tc35815_regs __iomem *)dev->base_addr;
-	int pid = lp->phy_addr;
-	unsigned short bmcr, lpa;
-	int speed;
-
-	if (lp->timer_state == arbwait) {
-		lpa = tc_mdio_read(dev, pid, MII_LPA);
-		bmcr = tc_mdio_read(dev, pid, MII_BMCR);
-		printk(KERN_DEBUG "%s: MII BMCR %04x BMSR %04x LPA %04x\n",
-		       dev->name,
-		       bmcr, tc_mdio_read(dev, pid, MII_BMSR), lpa);
-		if (!(lpa & (LPA_10HALF | LPA_10FULL |
-			     LPA_100HALF | LPA_100FULL))) {
-			/* fall back to 10HALF */
-			printk(KERN_INFO "%s: bad ability %04x - falling back to 10HD.\n",
-			       dev->name, lpa);
-			lpa = LPA_10HALF;
-		}
-		if (options.duplex ? (bmcr & BMCR_FULLDPLX) : (lpa & (LPA_100FULL | LPA_10FULL)))
-			lp->fullduplex = 1;
-		else
-			lp->fullduplex = 0;
-		if (options.speed ? (bmcr & BMCR_SPEED100) : (lpa & (LPA_100HALF | LPA_100FULL)))
-			speed = 100;
-		else
-			speed = 10;
-	} else {
-		/* Forcing a link mode. */
-		bmcr = tc_mdio_read(dev, pid, MII_BMCR);
-		if (bmcr & BMCR_FULLDPLX)
-			lp->fullduplex = 1;
-		else
-			lp->fullduplex = 0;
-		if (bmcr & BMCR_SPEED100)
-			speed = 100;
-		else
-			speed = 10;
-	}
-
-	tc_writel(tc_readl(&tr->MAC_Ctl) | MAC_HaltReq, &tr->MAC_Ctl);
-	if (lp->fullduplex) {
-		tc_writel(tc_readl(&tr->MAC_Ctl) | MAC_FullDup, &tr->MAC_Ctl);
-	} else {
-		tc_writel(tc_readl(&tr->MAC_Ctl) & ~MAC_FullDup, &tr->MAC_Ctl);
-	}
-	tc_writel(tc_readl(&tr->MAC_Ctl) & ~MAC_HaltReq, &tr->MAC_Ctl);
-
-	/* TX4939 PCFG.SPEEDn bit will be changed on NETDEV_CHANGE event. */
-
-#ifndef NO_CHECK_CARRIER
-	/* TX4939 does not have EnLCarr */
-	if (lp->boardtype != TC35815_TX4939) {
-#ifdef WORKAROUND_LOSTCAR
-		/* WORKAROUND: enable LostCrS only if half duplex operation */
-		if (!lp->fullduplex && lp->boardtype != TC35815_TX4939)
-			tc_writel(tc_readl(&tr->Tx_Ctl) | Tx_EnLCarr, &tr->Tx_Ctl);
-#endif
-	}
-#endif
-	lp->mii.full_duplex = lp->fullduplex;
-}
-
-static void tc35815_timer(unsigned long data)
-{
-	struct net_device *dev = (struct net_device *)data;
-	struct tc35815_local *lp = netdev_priv(dev);
-	int pid = lp->phy_addr;
-	unsigned short bmsr, bmcr, lpa;
-	int restart_timer = 0;
-
-	spin_lock_irq(&lp->lock);
-
-	lp->timer_ticks++;
-	switch (lp->timer_state) {
-	case arbwait:
-		/*
-		 * Only allow for 5 ticks, thats 10 seconds and much too
-		 * long to wait for arbitration to complete.
-		 */
-		/* TC35815 need more times... */
-		if (lp->timer_ticks >= 10) {
-			/* Enter force mode. */
-			if (!options.doforce) {
-				printk(KERN_NOTICE "%s: Auto-Negotiation unsuccessful,"
-				       " cable probblem?\n", dev->name);
-				/* Try to restart the adaptor. */
-				tc35815_restart(dev);
-				goto out;
-			}
-			printk(KERN_NOTICE "%s: Auto-Negotiation unsuccessful,"
-			       " trying force link mode\n", dev->name);
-			printk(KERN_DEBUG "%s: BMCR %x BMSR %x\n", dev->name,
-			       tc_mdio_read(dev, pid, MII_BMCR),
-			       tc_mdio_read(dev, pid, MII_BMSR));
-			bmcr = BMCR_SPEED100;
-			tc_mdio_write(dev, pid, MII_BMCR, bmcr);
-
-			/*
-			 * OK, seems we need do disable the transceiver
-			 * for the first tick to make sure we get an
-			 * accurate link state at the second tick.
-			 */
-
-			lp->timer_state = ltrywait;
-			lp->timer_ticks = 0;
-			restart_timer = 1;
-		} else {
-			/* Anything interesting happen? */
-			bmsr = tc_mdio_read(dev, pid, MII_BMSR);
-			if (bmsr & BMSR_ANEGCOMPLETE) {
-				/* Just what we've been waiting for... */
-				tc35815_set_link_modes(dev);
-
-				/*
-				 * Success, at least so far, advance our state
-				 * engine.
-				 */
-				lp->timer_state = lupwait;
-				restart_timer = 1;
-			} else {
-				restart_timer = 1;
-			}
-		}
-		break;
-
-	case lupwait:
-		/*
-		 * Auto negotiation was successful and we are awaiting a
-		 * link up status.  I have decided to let this timer run
-		 * forever until some sort of error is signalled, reporting
-		 * a message to the user at 10 second intervals.
-		 */
-		bmsr = tc_mdio_read(dev, pid, MII_BMSR);
-		if (bmsr & BMSR_LSTATUS) {
-			/*
-			 * Wheee, it's up, display the link mode in use and put
-			 * the timer to sleep.
-			 */
-			tc35815_display_link_mode(dev);
-			netif_carrier_on(dev);
-#ifdef WORKAROUND_100HALF_PROMISC
-			/* delayed promiscuous enabling */
-			if (dev->flags & IFF_PROMISC)
-				tc35815_set_multicast_list(dev);
-#endif
-#if 1
-			lp->saved_lpa = tc_mdio_read(dev, pid, MII_LPA);
-			lp->timer_state = lcheck;
-			restart_timer = 1;
-#else
-			lp->timer_state = asleep;
-			restart_timer = 0;
-#endif
-		} else {
-			if (lp->timer_ticks >= 10) {
-				printk(KERN_NOTICE "%s: Auto negotiation successful, link still "
-				       "not completely up.\n", dev->name);
-				lp->timer_ticks = 0;
-				restart_timer = 1;
-			} else {
-				restart_timer = 1;
-			}
-		}
-		break;
-
-	case ltrywait:
-		/*
-		 * Making the timeout here too long can make it take
-		 * annoyingly long to attempt all of the link mode
-		 * permutations, but then again this is essentially
-		 * error recovery code for the most part.
-		 */
-		bmsr = tc_mdio_read(dev, pid, MII_BMSR);
-		bmcr = tc_mdio_read(dev, pid, MII_BMCR);
-		if (lp->timer_ticks == 1) {
-			/*
-			 * Re-enable transceiver, we'll re-enable the
-			 * transceiver next tick, then check link state
-			 * on the following tick.
-			 */
-			restart_timer = 1;
-			break;
-		}
-		if (lp->timer_ticks == 2) {
-			restart_timer = 1;
-			break;
-		}
-		if (bmsr & BMSR_LSTATUS) {
-			/* Force mode selection success. */
-			tc35815_display_forced_link_mode(dev);
-			netif_carrier_on(dev);
-			tc35815_set_link_modes(dev);
-#ifdef WORKAROUND_100HALF_PROMISC
-			/* delayed promiscuous enabling */
-			if (dev->flags & IFF_PROMISC)
-				tc35815_set_multicast_list(dev);
-#endif
-#if 1
-			lp->saved_lpa = tc_mdio_read(dev, pid, MII_LPA);
-			lp->timer_state = lcheck;
-			restart_timer = 1;
-#else
-			lp->timer_state = asleep;
-			restart_timer = 0;
-#endif
-		} else {
-			if (lp->timer_ticks >= 4) { /* 6 seconds or so... */
-				int ret;
-
-				ret = tc35815_try_next_permutation(dev);
-				if (ret == -1) {
-					/*
-					 * Aieee, tried them all, reset the
-					 * chip and try all over again.
-					 */
-					printk(KERN_NOTICE "%s: Link down, "
-					       "cable problem?\n",
-					       dev->name);
-
-					/* Try to restart the adaptor. */
-					tc35815_restart(dev);
-					goto out;
-				}
-				lp->timer_ticks = 0;
-				restart_timer = 1;
-			} else {
-				restart_timer = 1;
-			}
-		}
-		break;
-
-	case lcheck:
-		bmcr = tc_mdio_read(dev, pid, MII_BMCR);
-		lpa = tc_mdio_read(dev, pid, MII_LPA);
-		if (bmcr & (BMCR_PDOWN | BMCR_ISOLATE | BMCR_RESET)) {
-			printk(KERN_ERR "%s: PHY down? (BMCR %x)\n", dev->name,
-			       bmcr);
-		} else if ((lp->saved_lpa ^ lpa) &
-			   (LPA_100FULL|LPA_100HALF|LPA_10FULL|LPA_10HALF)) {
-			printk(KERN_NOTICE "%s: link status changed"
-			       " (BMCR %x LPA %x->%x)\n", dev->name,
-			       bmcr, lp->saved_lpa, lpa);
-		} else {
-			/* go on */
-			restart_timer = 1;
-			break;
-		}
-		/* Try to restart the adaptor. */
-		tc35815_restart(dev);
-		goto out;
-
-	case asleep:
-	default:
-		/* Can't happens.... */
-		printk(KERN_ERR "%s: Aieee, link timer is asleep but we got "
-		       "one anyways!\n", dev->name);
-		restart_timer = 0;
-		lp->timer_ticks = 0;
-		lp->timer_state = asleep; /* foo on you */
-		break;
-	}
-
-	if (restart_timer) {
-		lp->timer.expires = jiffies + msecs_to_jiffies(1200);
-		add_timer(&lp->timer);
-	}
-out:
-	spin_unlock_irq(&lp->lock);
-}
-
-static void tc35815_start_auto_negotiation(struct net_device *dev,
-					   struct ethtool_cmd *ep)
-{
-	struct tc35815_local *lp = netdev_priv(dev);
-	int pid = lp->phy_addr;
-	unsigned short bmsr, bmcr, advertize;
-	int timeout;
-
-	netif_carrier_off(dev);
-	bmsr = tc_mdio_read(dev, pid, MII_BMSR);
-	bmcr = tc_mdio_read(dev, pid, MII_BMCR);
-	advertize = tc_mdio_read(dev, pid, MII_ADVERTISE);
-
-	if (ep == NULL || ep->autoneg == AUTONEG_ENABLE) {
-		if (options.speed || options.duplex) {
-			/* Advertise only specified configuration. */
-			advertize &= ~(ADVERTISE_10HALF |
-				       ADVERTISE_10FULL |
-				       ADVERTISE_100HALF |
-				       ADVERTISE_100FULL);
-			if (options.speed != 10) {
-				if (options.duplex != 1)
-					advertize |= ADVERTISE_100FULL;
-				if (options.duplex != 2)
-					advertize |= ADVERTISE_100HALF;
-			}
-			if (options.speed != 100) {
-				if (options.duplex != 1)
-					advertize |= ADVERTISE_10FULL;
-				if (options.duplex != 2)
-					advertize |= ADVERTISE_10HALF;
-			}
-			if (options.speed == 100)
-				bmcr |= BMCR_SPEED100;
-			else if (options.speed == 10)
-				bmcr &= ~BMCR_SPEED100;
-			if (options.duplex == 2)
-				bmcr |= BMCR_FULLDPLX;
-			else if (options.duplex == 1)
-				bmcr &= ~BMCR_FULLDPLX;
-		} else {
-			/* Advertise everything we can support. */
-			if (bmsr & BMSR_10HALF)
-				advertize |= ADVERTISE_10HALF;
-			else
-				advertize &= ~ADVERTISE_10HALF;
-			if (bmsr & BMSR_10FULL)
-				advertize |= ADVERTISE_10FULL;
-			else
-				advertize &= ~ADVERTISE_10FULL;
-			if (bmsr & BMSR_100HALF)
-				advertize |= ADVERTISE_100HALF;
-			else
-				advertize &= ~ADVERTISE_100HALF;
-			if (bmsr & BMSR_100FULL)
-				advertize |= ADVERTISE_100FULL;
-			else
-				advertize &= ~ADVERTISE_100FULL;
-		}
-
-		tc_mdio_write(dev, pid, MII_ADVERTISE, advertize);
-
-		/* Enable Auto-Negotiation, this is usually on already... */
-		bmcr |= BMCR_ANENABLE;
-		tc_mdio_write(dev, pid, MII_BMCR, bmcr);
-
-		/* Restart it to make sure it is going. */
-		bmcr |= BMCR_ANRESTART;
-		tc_mdio_write(dev, pid, MII_BMCR, bmcr);
-		printk(KERN_DEBUG "%s: ADVERTISE %x BMCR %x\n", dev->name, advertize, bmcr);
-
-		/* BMCR_ANRESTART self clears when the process has begun. */
-		timeout = 64;  /* More than enough. */
-		while (--timeout) {
-			bmcr = tc_mdio_read(dev, pid, MII_BMCR);
-			if (!(bmcr & BMCR_ANRESTART))
-				break; /* got it. */
-			udelay(10);
-		}
-		if (!timeout) {
-			printk(KERN_ERR "%s: TC35815 would not start auto "
-			       "negotiation BMCR=0x%04x\n",
-			       dev->name, bmcr);
-			printk(KERN_NOTICE "%s: Performing force link "
-			       "detection.\n", dev->name);
-			goto force_link;
-		} else {
-			printk(KERN_DEBUG "%s: auto negotiation started.\n", dev->name);
-			lp->timer_state = arbwait;
-		}
-	} else {
-force_link:
-		/* Force the link up, trying first a particular mode.
-		 * Either we are here at the request of ethtool or
-		 * because the Happy Meal would not start to autoneg.
-		 */
-
-		/* Disable auto-negotiation in BMCR, enable the duplex and
-		 * speed setting, init the timer state machine, and fire it off.
-		 */
-		if (ep == NULL || ep->autoneg == AUTONEG_ENABLE) {
-			bmcr = BMCR_SPEED100;
-		} else {
-			if (ep->speed == SPEED_100)
-				bmcr = BMCR_SPEED100;
-			else
-				bmcr = 0;
-			if (ep->duplex == DUPLEX_FULL)
-				bmcr |= BMCR_FULLDPLX;
-		}
-		tc_mdio_write(dev, pid, MII_BMCR, bmcr);
-
-		/* OK, seems we need do disable the transceiver for the first
-		 * tick to make sure we get an accurate link state at the
-		 * second tick.
-		 */
-		lp->timer_state = ltrywait;
-	}
-
-	del_timer(&lp->timer);
-	lp->timer_ticks = 0;
-	lp->timer.expires = jiffies + msecs_to_jiffies(1200);
-	add_timer(&lp->timer);
-}
-
-static void tc35815_find_phy(struct net_device *dev)
-{
-	struct tc35815_local *lp = netdev_priv(dev);
-	int pid = lp->phy_addr;
-	unsigned short id0;
-
-	/* find MII phy */
-	for (pid = 31; pid >= 0; pid--) {
-		id0 = tc_mdio_read(dev, pid, MII_BMSR);
-		if (id0 != 0xffff && id0 != 0x0000 &&
-		    (id0 & BMSR_RESV) != (0xffff & BMSR_RESV) /* paranoia? */
-			) {
-			lp->phy_addr = pid;
-			break;
-		}
-	}
-	if (pid < 0) {
-		printk(KERN_ERR "%s: No MII Phy found.\n",
-		       dev->name);
-		lp->phy_addr = pid = 0;
-	}
-
-	lp->mii_id[0] = tc_mdio_read(dev, pid, MII_PHYSID1);
-	lp->mii_id[1] = tc_mdio_read(dev, pid, MII_PHYSID2);
-	if (netif_msg_hw(lp))
-		printk(KERN_INFO "%s: PHY(%02x) ID %04x %04x\n", dev->name,
-		       pid, lp->mii_id[0], lp->mii_id[1]);
-}
-
-static void tc35815_phy_chip_init(struct net_device *dev)
-{
-	struct tc35815_local *lp = netdev_priv(dev);
-	int pid = lp->phy_addr;
-	unsigned short bmcr;
-	struct ethtool_cmd ecmd, *ep;
-
-	/* dis-isolate if needed. */
-	bmcr = tc_mdio_read(dev, pid, MII_BMCR);
-	if (bmcr & BMCR_ISOLATE) {
-		int count = 32;
-		printk(KERN_DEBUG "%s: unisolating...", dev->name);
-		tc_mdio_write(dev, pid, MII_BMCR, bmcr & ~BMCR_ISOLATE);
-		while (--count) {
-			if (!(tc_mdio_read(dev, pid, MII_BMCR) & BMCR_ISOLATE))
-				break;
-			udelay(20);
-		}
-		printk(" %s.\n", count ? "done" : "failed");
-	}
-
-	if (options.speed && options.duplex) {
-		ecmd.autoneg = AUTONEG_DISABLE;
-		ecmd.speed = options.speed == 10 ? SPEED_10 : SPEED_100;
-		ecmd.duplex = options.duplex == 1 ? DUPLEX_HALF : DUPLEX_FULL;
-		ep = &ecmd;
-	} else {
-		ep = NULL;
-	}
-	tc35815_start_auto_negotiation(dev, ep);
+	if (!lp->phy_dev)
+		return -ENODEV;
+	return phy_mii_ioctl(lp->phy_dev, if_mii(rq), cmd);
 }
 
 static void tc35815_chip_reset(struct net_device *dev)
@@ -2815,8 +2370,6 @@ static void tc35815_chip_init(struct net_device *dev)
 		(struct tc35815_regs __iomem *)dev->base_addr;
 	unsigned long txctl = TX_CTL_CMD;
 
-	tc35815_phy_chip_init(dev);
-
 	/* load station address to CAM */
 	tc35815_set_cam_entry(dev, CAM_ENTRY_SOURCE, dev->dev_addr);
 
@@ -2853,12 +2406,11 @@ static void tc35815_chip_init(struct net_device *dev)
 	/* start MAC transmitter */
 #ifndef NO_CHECK_CARRIER
 	/* TX4939 does not have EnLCarr */
-	if (lp->boardtype == TC35815_TX4939)
+	if (lp->chiptype == TC35815_TX4939)
 		txctl &= ~Tx_EnLCarr;
 #ifdef WORKAROUND_LOSTCAR
 	/* WORKAROUND: ignore LostCrS in full duplex operation */
-	if ((lp->timer_state != asleep && lp->timer_state != lcheck) ||
-	    lp->fullduplex)
+	if (!lp->phy_dev || !lp->link || lp->duplex == DUPLEX_FULL)
 		txctl &= ~Tx_EnLCarr;
 #endif
 #endif /* !NO_CHECK_CARRIER */
@@ -2879,8 +2431,9 @@ static int tc35815_suspend(struct pci_dev *pdev, pm_message_t state)
 	if (!netif_running(dev))
 		return 0;
 	netif_device_detach(dev);
+	if (lp->phy_dev)
+		phy_stop(lp->phy_dev);
 	spin_lock_irqsave(&lp->lock, flags);
-	del_timer(&lp->timer);		/* Kill if running	*/
 	tc35815_chip_reset(dev);
 	spin_unlock_irqrestore(&lp->lock, flags);
 	pci_set_power_state(pdev, PCI_D3hot);
@@ -2891,15 +2444,14 @@ static int tc35815_resume(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct tc35815_local *lp = netdev_priv(dev);
-	unsigned long flags;
 
 	pci_restore_state(pdev);
 	if (!netif_running(dev))
 		return 0;
 	pci_set_power_state(pdev, PCI_D0);
-	spin_lock_irqsave(&lp->lock, flags);
 	tc35815_restart(dev);
-	spin_unlock_irqrestore(&lp->lock, flags);
+	if (lp->phy_dev)
+		phy_start(lp->phy_dev);
 	netif_device_attach(dev);
 	return 0;
 }
@@ -2920,8 +2472,6 @@ module_param_named(speed, options.speed, int, 0);
 MODULE_PARM_DESC(speed, "0:auto, 10:10Mbps, 100:100Mbps");
 module_param_named(duplex, options.duplex, int, 0);
 MODULE_PARM_DESC(duplex, "0:auto, 1:half, 2:full");
-module_param_named(doforce, options.doforce, int, 0);
-MODULE_PARM_DESC(doforce, "try force link mode if auto-negotiation failed");
 
 static int __init tc35815_init_module(void)
 {

From sshtylyov@ru.mvista.com Sun Apr 13 21:00:59 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 13 Apr 2008 21:01:02 +0100 (BST)
Received: from p549F61CF.dip.t-dialin.net ([84.159.97.207]:51393 "EHLO
	p549F61CF.dip.t-dialin.net") by ftp.linux-mips.org with ESMTP
	id S20021373AbYDMUA7 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 13 Apr 2008 21:00:59 +0100
Received: from rtsoft3.corbina.net ([85.21.88.6]:16155 "EHLO
	buildserver.ru.mvista.com") by lappi.linux-mips.net with ESMTP
	id S1786810AbYDKQzb (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 11 Apr 2008 18:55:31 +0200
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id E9EA68810; Fri, 11 Apr 2008 21:55:25 +0500 (SAMST)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	ralf@linux-mips.org
Subject: [PATCH] Alchemy: kill useless #include's and extern'sv (take 2)
Date:	Fri, 11 Apr 2008 20:54:43 +0400
User-Agent: KMail/1.5
Cc:	linux-mips@linux-mips.org
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <200804112054.44078.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18904
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 31023
Lines: 992

Go thru the Alchemy code and hunt down every unneeded #include and extern
(some of which refer to already long dead functions).

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

---
Last time I overlooked arch/mips/au1000/mtx-1/platform.c, so please update the
queued patch...

 arch/mips/au1000/common/cputable.c     |    5 +----
 arch/mips/au1000/common/dbdma.c        |    6 ------
 arch/mips/au1000/common/dbg_io.c       |    1 -
 arch/mips/au1000/common/dma.c          |    5 +----
 arch/mips/au1000/common/gpio.c         |    5 -----
 arch/mips/au1000/common/irq.c          |    1 -
 arch/mips/au1000/common/pci.c          |    2 +-
 arch/mips/au1000/common/platform.c     |    4 +---
 arch/mips/au1000/common/power.c        |    9 +--------
 arch/mips/au1000/common/prom.c         |    2 +-
 arch/mips/au1000/common/puts.c         |    1 -
 arch/mips/au1000/common/reset.c        |    8 +-------
 arch/mips/au1000/common/setup.c        |   11 +----------
 arch/mips/au1000/common/sleeper.S      |    2 +-
 arch/mips/au1000/common/time.c         |    8 --------
 arch/mips/au1000/db1x00/board_setup.c  |   15 ++-------------
 arch/mips/au1000/db1x00/init.c         |    5 -----
 arch/mips/au1000/db1x00/irqmap.c       |   21 ++-------------------
 arch/mips/au1000/mtx-1/board_setup.c   |   14 ++------------
 arch/mips/au1000/mtx-1/init.c          |    6 +-----
 arch/mips/au1000/mtx-1/irqmap.c        |   19 +------------------
 arch/mips/au1000/mtx-1/platform.c      |    1 -
 arch/mips/au1000/pb1000/board_setup.c  |   11 +----------
 arch/mips/au1000/pb1000/init.c         |    6 +-----
 arch/mips/au1000/pb1000/irqmap.c       |   18 +-----------------
 arch/mips/au1000/pb1100/board_setup.c  |   11 +----------
 arch/mips/au1000/pb1100/init.c         |    6 +-----
 arch/mips/au1000/pb1100/irqmap.c       |   19 +------------------
 arch/mips/au1000/pb1200/board_setup.c  |   17 +----------------
 arch/mips/au1000/pb1200/init.c         |    6 +-----
 arch/mips/au1000/pb1200/irqmap.c       |   20 ++------------------
 arch/mips/au1000/pb1500/board_setup.c  |   11 +----------
 arch/mips/au1000/pb1500/init.c         |    6 +-----
 arch/mips/au1000/pb1500/irqmap.c       |   19 +------------------
 arch/mips/au1000/pb1550/board_setup.c  |   15 ++-------------
 arch/mips/au1000/pb1550/init.c         |    6 +-----
 arch/mips/au1000/pb1550/irqmap.c       |   19 +------------------
 arch/mips/au1000/xxs1500/board_setup.c |   11 +----------
 arch/mips/au1000/xxs1500/init.c        |    6 +-----
 arch/mips/au1000/xxs1500/irqmap.c      |   19 +------------------
 arch/mips/pci/fixup-au1000.c           |    5 +----
 41 files changed, 38 insertions(+), 344 deletions(-)

Index: linux-2.6/arch/mips/au1000/common/cputable.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/cputable.c
+++ linux-2.6/arch/mips/au1000/common/cputable.c
@@ -11,10 +11,7 @@
  *  as published by the Free Software Foundation; either version
  *  2 of the License, or (at your option) any later version.
  */
-#include <linux/string.h>
-#include <linux/sched.h>
-#include <linux/threads.h>
-#include <linux/init.h>
+
 #include <asm/mach-au1x00/au1000.h>
 
 struct cpu_spec* cur_cpu_spec[NR_CPUS];
Index: linux-2.6/arch/mips/au1000/common/dbdma.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/dbdma.c
+++ linux-2.6/arch/mips/au1000/common/dbdma.c
@@ -31,18 +31,12 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
-#include <linux/string.h>
-#include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-au1x00/au1xxx_dbdma.h>
-#include <asm/system.h>
-
 
 #if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
 
Index: linux-2.6/arch/mips/au1000/common/dbg_io.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/dbg_io.c
+++ linux-2.6/arch/mips/au1000/common/dbg_io.c
@@ -1,5 +1,4 @@
 
-#include <asm/io.h>
 #include <asm/mach-au1x00/au1000.h>
 
 #ifdef CONFIG_KGDB
Index: linux-2.6/arch/mips/au1000/common/dma.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/dma.c
+++ linux-2.6/arch/mips/au1000/common/dma.c
@@ -33,12 +33,9 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
-#include <linux/sched.h>
 #include <linux/spinlock.h>
-#include <linux/string.h>
-#include <linux/delay.h>
 #include <linux/interrupt.h>
-#include <asm/system.h>
+
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-au1x00/au1000_dma.h>
 
Index: linux-2.6/arch/mips/au1000/common/gpio.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/gpio.c
+++ linux-2.6/arch/mips/au1000/common/gpio.c
@@ -27,13 +27,8 @@
  * 	others have a second one : GPIO2
  */
 
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/types.h>
 #include <linux/module.h>
 
-#include <asm/addrspace.h>
-
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/gpio.h>
 
Index: linux-2.6/arch/mips/au1000/common/irq.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/irq.c
+++ linux-2.6/arch/mips/au1000/common/irq.c
@@ -26,7 +26,6 @@
  */
 #include <linux/bitops.h>
 #include <linux/init.h>
-#include <linux/io.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 
Index: linux-2.6/arch/mips/au1000/common/pci.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/pci.c
+++ linux-2.6/arch/mips/au1000/common/pci.c
@@ -30,7 +30,7 @@
  *  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/pci.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
Index: linux-2.6/arch/mips/au1000/common/platform.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/platform.c
+++ linux-2.6/arch/mips/au1000/common/platform.c
@@ -7,11 +7,9 @@
  * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
-#include <linux/device.h>
+
 #include <linux/platform_device.h>
-#include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/resource.h>
 
 #include <asm/mach-au1x00/au1xxx.h>
 
Index: linux-2.6/arch/mips/au1000/common/power.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/power.c
+++ linux-2.6/arch/mips/au1000/common/power.c
@@ -29,17 +29,14 @@
  *  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/pm.h>
 #include <linux/pm_legacy.h>
-#include <linux/slab.h>
 #include <linux/sysctl.h>
 #include <linux/jiffies.h>
 
-#include <asm/string.h>
 #include <asm/uaccess.h>
-#include <asm/io.h>
-#include <asm/system.h>
 #include <asm/cacheflush.h>
 #include <asm/mach-au1x00/au1000.h>
 
@@ -54,10 +51,6 @@
 
 static void au1000_calibrate_delay(void);
 
-extern void set_au1x00_speed(unsigned int new_freq);
-extern unsigned int get_au1x00_speed(void);
-extern unsigned long get_au1x00_uart_baud_base(void);
-extern void set_au1x00_uart_baud_base(unsigned long new_baud_base);
 extern unsigned long save_local_and_disable(int controller);
 extern void restore_local_and_enable(int controller, unsigned long mask);
 extern void local_enable_irq(unsigned int irq_nr);
Index: linux-2.6/arch/mips/au1000/common/prom.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/prom.c
+++ linux-2.6/arch/mips/au1000/common/prom.c
@@ -33,8 +33,8 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/module.h>
-#include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/string.h>
 
Index: linux-2.6/arch/mips/au1000/common/puts.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/puts.c
+++ linux-2.6/arch/mips/au1000/common/puts.c
@@ -28,7 +28,6 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/types.h>
 #include <asm/mach-au1x00/au1000.h>
 
 #define SERIAL_BASE   UART_BASE
Index: linux-2.6/arch/mips/au1000/common/reset.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/reset.c
+++ linux-2.6/arch/mips/au1000/common/reset.c
@@ -27,13 +27,7 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/sched.h>
-#include <linux/mm.h>
-#include <asm/io.h>
-#include <asm/pgtable.h>
-#include <asm/processor.h>
-#include <asm/reboot.h>
-#include <asm/system.h>
+
 #include <asm/mach-au1x00/au1000.h>
 
 extern int au_sleep(void);
Index: linux-2.6/arch/mips/au1000/common/setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/setup.c
+++ linux-2.6/arch/mips/au1000/common/setup.c
@@ -25,21 +25,14 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
 #include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/delay.h>
-#include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/pm.h>
 
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
 #include <asm/mipsregs.h>
 #include <asm/reboot.h>
-#include <asm/pgtable.h>
 #include <asm/time.h>
 
 #include <au1000.h>
@@ -49,8 +42,6 @@ extern void __init board_setup(void);
 extern void au1000_restart(char *);
 extern void au1000_halt(void);
 extern void au1000_power_off(void);
-extern void au1x_time_init(void);
-extern void au1x_timer_setup(struct irqaction *irq);
 extern void set_cpuspec(void);
 
 void __init plat_mem_setup(void)
Index: linux-2.6/arch/mips/au1000/common/sleeper.S
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/sleeper.S
+++ linux-2.6/arch/mips/au1000/common/sleeper.S
@@ -9,9 +9,9 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
  */
+
 #include <asm/asm.h>
 #include <asm/mipsregs.h>
-#include <asm/addrspace.h>
 #include <asm/regdef.h>
 #include <asm/stackframe.h>
 
Index: linux-2.6/arch/mips/au1000/common/time.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/time.c
+++ linux-2.6/arch/mips/au1000/common/time.c
@@ -34,20 +34,12 @@
 
 #include <linux/types.h>
 #include <linux/init.h>
-#include <linux/kernel_stat.h>
-#include <linux/sched.h>
 #include <linux/spinlock.h>
-#include <linux/hardirq.h>
 
-#include <asm/compiler.h>
 #include <asm/mipsregs.h>
 #include <asm/time.h>
-#include <asm/div64.h>
 #include <asm/mach-au1x00/au1000.h>
 
-#include <linux/mc146818rtc.h>
-#include <linux/timex.h>
-
 static int no_au1xxx_32khz;
 extern int allow_au1k_wait; /* default off for CP0 Counter */
 
Index: linux-2.6/arch/mips/au1000/db1x00/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/db1x00/board_setup.c
+++ linux-2.6/arch/mips/au1000/db1x00/board_setup.c
@@ -27,20 +27,9 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
-#include <linux/mc146818rtc.h>
-#include <linux/delay.h>
-
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
+
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-db1x00/db1x00.h>
 
Index: linux-2.6/arch/mips/au1000/db1x00/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/db1x00/init.c
+++ linux-2.6/arch/mips/au1000/db1x00/init.c
@@ -28,13 +28,8 @@
  */
 
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/db1x00/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/db1x00/irqmap.c
+++ linux-2.6/arch/mips/au1000/db1x00/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 #ifdef CONFIG_MIPS_DB1500
Index: linux-2.6/arch/mips/au1000/mtx-1/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/mtx-1/board_setup.c
+++ linux-2.6/arch/mips/au1000/mtx-1/board_setup.c
@@ -28,19 +28,9 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
-#include <linux/delay.h>
-
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
+
 #include <asm/mach-au1x00/au1000.h>
 
 extern int (*board_pci_idsel)(unsigned int devsel, int assert);
Index: linux-2.6/arch/mips/au1000/mtx-1/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/mtx-1/init.c
+++ linux-2.6/arch/mips/au1000/mtx-1/init.c
@@ -28,14 +28,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/string.h>
+
 #include <linux/kernel.h>
-#include <linux/sched.h>
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/bootmem.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/mtx-1/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/mtx-1/irqmap.c
+++ linux-2.6/arch/mips/au1000/mtx-1/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 char irq_tab_alchemy[][5] __initdata = {
Index: linux-2.6/arch/mips/au1000/pb1000/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1000/board_setup.c
+++ linux-2.6/arch/mips/au1000/pb1000/board_setup.c
@@ -23,19 +23,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
 #include <linux/delay.h>
 
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-pb1x00/pb1000.h>
 
Index: linux-2.6/arch/mips/au1000/pb1000/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1000/init.c
+++ linux-2.6/arch/mips/au1000/pb1000/init.c
@@ -26,14 +26,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/pb1000/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1000/irqmap.c
+++ linux-2.6/arch/mips/au1000/pb1000/irqmap.c
@@ -25,26 +25,10 @@
  *  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/mach-au1x00/au1000.h>
 
 struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
Index: linux-2.6/arch/mips/au1000/pb1100/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1100/board_setup.c
+++ linux-2.6/arch/mips/au1000/pb1100/board_setup.c
@@ -23,19 +23,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
 #include <linux/delay.h>
 
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-pb1x00/pb1100.h>
 
Index: linux-2.6/arch/mips/au1000/pb1100/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1100/init.c
+++ linux-2.6/arch/mips/au1000/pb1100/init.c
@@ -27,14 +27,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/pb1100/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1100/irqmap.c
+++ linux-2.6/arch/mips/au1000/pb1100/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
Index: linux-2.6/arch/mips/au1000/pb1200/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1200/board_setup.c
+++ linux-2.6/arch/mips/au1000/pb1200/board_setup.c
@@ -23,24 +23,9 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
 #include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
-#include <linux/mc146818rtc.h>
-#include <linux/delay.h>
-
-#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
-#include <linux/ide.h>
-#endif
-
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
 
 #include <au1000.h>
 #include <au1xxx_dbdma.h>
Index: linux-2.6/arch/mips/au1000/pb1200/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1200/init.c
+++ linux-2.6/arch/mips/au1000/pb1200/init.c
@@ -27,14 +27,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/pb1200/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1200/irqmap.c
+++ linux-2.6/arch/mips/au1000/pb1200/irqmap.c
@@ -22,26 +22,10 @@
  *  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/mach-au1x00/au1000.h>
 
 #ifdef CONFIG_MIPS_PB1200
Index: linux-2.6/arch/mips/au1000/pb1500/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1500/board_setup.c
+++ linux-2.6/arch/mips/au1000/pb1500/board_setup.c
@@ -23,19 +23,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
 #include <linux/delay.h>
 
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-pb1x00/pb1500.h>
 
Index: linux-2.6/arch/mips/au1000/pb1500/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1500/init.c
+++ linux-2.6/arch/mips/au1000/pb1500/init.c
@@ -27,14 +27,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/pb1500/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1500/irqmap.c
+++ linux-2.6/arch/mips/au1000/pb1500/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 char irq_tab_alchemy[][5] __initdata = {
Index: linux-2.6/arch/mips/au1000/pb1550/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1550/board_setup.c
+++ linux-2.6/arch/mips/au1000/pb1550/board_setup.c
@@ -27,20 +27,9 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
-#include <linux/mc146818rtc.h>
-#include <linux/delay.h>
-
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
+
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-pb1x00/pb1550.h>
 
Index: linux-2.6/arch/mips/au1000/pb1550/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1550/init.c
+++ linux-2.6/arch/mips/au1000/pb1550/init.c
@@ -27,14 +27,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/pb1550/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1550/irqmap.c
+++ linux-2.6/arch/mips/au1000/pb1550/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 char irq_tab_alchemy[][5] __initdata = {
Index: linux-2.6/arch/mips/au1000/xxs1500/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/xxs1500/board_setup.c
+++ linux-2.6/arch/mips/au1000/xxs1500/board_setup.c
@@ -23,19 +23,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
 #include <linux/delay.h>
 
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
 #include <asm/mach-au1x00/au1000.h>
 
 void board_reset(void)
Index: linux-2.6/arch/mips/au1000/xxs1500/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/xxs1500/init.c
+++ linux-2.6/arch/mips/au1000/xxs1500/init.c
@@ -26,14 +26,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/xxs1500/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/xxs1500/irqmap.c
+++ linux-2.6/arch/mips/au1000/xxs1500/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
Index: linux-2.6/arch/mips/pci/fixup-au1000.c
===================================================================
--- linux-2.6.orig/arch/mips/pci/fixup-au1000.c
+++ linux-2.6/arch/mips/pci/fixup-au1000.c
@@ -26,13 +26,10 @@
  *  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/pci.h>
-#include <linux/kernel.h>
 #include <linux/init.h>
 
-#include <asm/mach-au1x00/au1000.h>
-
 extern char irq_tab_alchemy[][5];
 
 int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
Index: linux-2.6/arch/mips/au1000/mtx-1/platform.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/mtx-1/platform.c
+++ linux-2.6/arch/mips/au1000/mtx-1/platform.c
@@ -19,7 +19,6 @@
  */
 
 #include <linux/init.h>
-#include <linux/types.h>
 #include <linux/platform_device.h>
 #include <linux/leds.h>
 #include <linux/gpio_keys.h>


From anemo@mba.ocn.ne.jp Sun Apr 13 22:04:06 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 13 Apr 2008 22:04:14 +0100 (BST)
Received: from p549F61CF.dip.t-dialin.net ([84.159.97.207]:51393 "EHLO
	p549F61CF.dip.t-dialin.net") by ftp.linux-mips.org with ESMTP
	id S20022667AbYDMVEG (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 13 Apr 2008 22:04:06 +0100
Received: from mba.ocn.ne.jp ([122.1.235.107]:30916 "EHLO smtp.mba.ocn.ne.jp")
	by lappi.linux-mips.net with ESMTP id S1786717AbYDKPkX (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 11 Apr 2008 17:40:23 +0200
Received: from localhost (p4083-ipad203funabasi.chiba.ocn.ne.jp [222.146.83.83])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 1C55E9DC7; Sat, 12 Apr 2008 00:40:06 +0900 (JST)
Date:	Sat, 12 Apr 2008 00:40:58 +0900 (JST)
Message-Id: <20080412.004058.88699680.anemo@mba.ocn.ne.jp>
To:	afleming@freescale.com
Cc:	linux-mips@linux-mips.org, jeff@garzik.org, netdev@vger.kernel.org
Subject: Re: [PATCH 5/6] tc35815: Use generic PHY layer
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <4CD8B148-87DF-42C6-8A04-A6501109C1F2@freescale.com>
References: <20080411.002523.18305938.anemo@mba.ocn.ne.jp>
	<4CD8B148-87DF-42C6-8A04-A6501109C1F2@freescale.com>
X-Fingerprint: 6ACA 1623 39BD 9A94 9B1A  B746 CA77 FE94 2874 D52F
X-Pgp-Public-Key: http://wwwkeys.pgp.net/pks/lookup?op=get&search=0x2874D52F
X-Mailer: Mew version 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18905
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 4931
Lines: 131

On Thu, 10 Apr 2008 14:58:28 -0500, Andy Fleming <afleming@freescale.com> wrote:
> Excellent, just a few quick (and hopefully easy to resolve) comments:

Thank you for review.

> > +	/* find the first phy */
> > +	for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++) {
> > +		if (lp->mii_bus.phy_map[phy_addr]) {
> > +			phydev = lp->mii_bus.phy_map[phy_addr];
> > +			break;
> > +		}
> > +	}
> 
> I'm always amazed that this works.  I have a board that has 4 PHYs for  
> two different ethernet controllers, and they are laid out thus:
> 
> 1: UCC2
> 2: eTSEC1
> 3: eTSEC2
> 7: UCC1
> 
> This isn't really a criticism, since this controller may very well  
> guarantee there's only one PHY on the bus, or that you only care about  
> the first one.  I'm just putting that out there to feel out how people  
> solve

Though I had never seen multple PHYs connected to this controller, it
might be better to check it instead of silently ignoreing others.
I'll add explicitly check.

> > +	/* attach the mac to the phy */
> > +	phydev = phy_connect(dev, phydev->dev.bus_id,
> > +			     &tc_handle_link_change, 0,
> > +			     lp->boardtype == TC35815_TX4939 ?
> > +			     PHY_INTERFACE_MODE_RMII : PHY_INTERFACE_MODE_MII);
> 
> Generally, it's preferred for boards to pass in the interface to the  
> driver, rather than have the ethernet driver have an awareness of what  
> boards it runs on.  I'm not familiar with this hardware, but it makes  
> porting to new boards much easier.

Well, the 'boardtype' variable was wrongly named.  It is actually
'chiptype'.  The board designeer cannot select MII/RMII.  So I'll
change the name of the variable.

> > +	/* mask with MAC supported features */
> > +	phydev->supported &= PHY_BASIC_FEATURES;
> > +	if (options.speed == 10)
> > +		phydev->supported &=
> > +			~(SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full);
> > +	else if (options.speed == 100)
> > +		phydev->supported &=
> > +			~(SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full);
> > +	if (options.duplex == 1)
> > +		phydev->supported &=
> > +			~(SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Full);
> > +	else if (options.duplex == 2)
> > +		phydev->supported &=
> > +			~(SUPPORTED_10baseT_Half | SUPPORTED_100baseT_Half);
> 
> Your controller only supports one speed or the other?  This is also a  
> little confusing to read.  It might be clearer if you build up a  
> bitmask of the supported options, and then mask phydev->supported.   
> That's just personal preference, though.

The purpose of original code is force speed/duplex setting by module
options, if specified.  Usually both 10/100 and half/full are
supported.  I'll try to make the code more readable.

> > +	lp->mii_bus.name = "tc35815_mii_bus",
> > +	lp->mii_bus.read = tc_mdio_read,
> > +	lp->mii_bus.write = tc_mdio_write,
> > +	lp->mii_bus.id = lp->pci_dev->devfn,
> 
> I just submitted a patch to change mii_bus.id to a char [].  It's an  
> easy fix:
> 
> snprintf(lp->mii_bus.id, PHY_BUS_ID_SIZE, "%x", lp->pci_dev->devfn);
> 
> Or you can come up with a string on your own.  I haven't looked  
> carefully to make sure you aren't using the number in some way.

OK, if your patch was merged to mainline or upstream tree, I'll adjust
for it.  And I noticed pci_dev->devfn seems not enough for mii_bus.id,
while we can have multiple PCI busses.  I'll use both pci_dev->bus->id
and pci_dev->devfn.

> > -	if (lp->mii_id[0] == 0x0016 && (lp->mii_id[1] & 0xfc00) == 0xf800) {
> > +	if (lp->phy_dev && (lp->phy_dev->phy_id & 0xfffffc00) !=  
> > 0x0016f800) {
> > 		/* Resetting PHY cause problem on some chip... (SEEQ 80221) */
> > -		do_phy_reset = 0;
> > -	}
> > -	if (do_phy_reset) {
> > 		int timeout;
> > -		tc_mdio_write(dev, pid, MII_BMCR, BMCR_RESET);
> > +
> > +		phy_write(lp->phy_dev, MII_BMCR, BMCR_RESET);
> > 		timeout = 100;
> > 		while (--timeout) {
> > -			if (!(tc_mdio_read(dev, pid, MII_BMCR) & BMCR_RESET))
> > +			if (!(phy_read(lp->phy_dev, MII_BMCR) & BMCR_RESET))
> > 				break;
> > 			udelay(1);
> > 		}
> 
> Hm.  We should probably come up with a way to handle this inside the  
> PHY driver, since the goal of the PHY Lib is to avoid having to know  
> what type of PHY you are connected to.

Agreed.  Actually, this hack for SEEQ PHY seems not needed.  I tried
today and works fine without this hack.  I'll remove it.

> > #ifdef WORKAROUND_LOSTCAR
> > 	/* WORKAROUND: ignore LostCrS in full duplex operation */
> > -	if ((lp->timer_state != asleep && lp->timer_state != lcheck)
> > -	    || lp->fullduplex)
> > +	if (!(lp->phy_dev->state == PHY_RUNNING ||
> > +	      lp->phy_dev->state == PHY_CHANGELINK) ||
> > +	    lp->duplex == DUPLEX_FULL)
> > 		status &= ~Tx_NCarr;
> 
> Are you sure those states are right?  I'm just asking because it seems  
> like an odd use of the phydev state.

Well, I think again. Just checking lp->link would be enough.  Thanks.

I will send an updated patch soon.

---
Atsushi Nemoto

From anemo@mba.ocn.ne.jp Mon Apr 14 01:50:32 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 14 Apr 2008 01:50:35 +0100 (BST)
Received: from p549F7144.dip.t-dialin.net ([84.159.113.68]:39589 "EHLO
	p549F7144.dip.t-dialin.net") by ftp.linux-mips.org with ESMTP
	id S20023344AbYDNAuc (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 14 Apr 2008 01:50:32 +0100
Received: from mba.ocn.ne.jp ([122.1.235.107]:960 "EHLO smtp.mba.ocn.ne.jp")
	by lappi.linux-mips.net with ESMTP id S1788957AbYDLPK7 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sat, 12 Apr 2008 17:10:59 +0200
Received: from localhost (p4038-ipad205funabasi.chiba.ocn.ne.jp [222.146.99.38])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 0A2DBAB59; Sun, 13 Apr 2008 00:10:54 +0900 (JST)
Date:	Sun, 13 Apr 2008 00:11:46 +0900 (JST)
Message-Id: <20080413.001146.25909265.anemo@mba.ocn.ne.jp>
To:	jeff@garzik.org, Andy Fleming <afleming@freescale.com>
Cc:	linux-mips@linux-mips.org, netdev@vger.kernel.org
Subject: Re: [PATCH 1/6] tc35815: Statistics cleanup
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <48007A41.2000803@garzik.org>
References: <20080411.002412.03977557.anemo@mba.ocn.ne.jp>
	<48007A41.2000803@garzik.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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18906
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 1113
Lines: 30

On Sat, 12 Apr 2008 05:00:49 -0400, Jeff Garzik <jeff@garzik.org> wrote:
> applied 1-6

Thanks.

Could you apply this too, or hopufully fold into Andy Fleming's "phy:
Change mii_bus id field to a string" patch (commit c69fedae) ?

------------------------------------------------------
Subject: [PATCH] tc35815: build fix

Fix build failure caused by Andy Fleming's "phy: Change mii_bus id
field to a string" patch.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
index 744f11f..10e4e85 100644
--- a/drivers/net/tc35815.c
+++ b/drivers/net/tc35815.c
@@ -766,7 +766,8 @@ static int tc_mii_init(struct net_device *dev)
 	lp->mii_bus.name = "tc35815_mii_bus";
 	lp->mii_bus.read = tc_mdio_read;
 	lp->mii_bus.write = tc_mdio_write;
-	lp->mii_bus.id = (lp->pci_dev->bus->number << 8) | lp->pci_dev->devfn;
+	snprintf(lp->mii_bus.id, MII_BUS_ID_SIZE, "%x",
+		 (lp->pci_dev->bus->number << 8) | lp->pci_dev->devfn);
 	lp->mii_bus.priv = dev;
 	lp->mii_bus.dev = &lp->pci_dev->dev;
 	lp->mii_bus.irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);

From umeshyv@gmail.com Mon Apr 14 06:49:18 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 14 Apr 2008 06:49:20 +0100 (BST)
Received: from wf-out-1314.google.com ([209.85.200.175]:28637 "EHLO
	wf-out-1314.google.com") by ftp.linux-mips.org with ESMTP
	id S20022654AbYDNFtS (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 14 Apr 2008 06:49:18 +0100
Received: by wf-out-1314.google.com with SMTP id 23so1940531wfg.21
        for <linux-mips@linux-mips.org>; Sun, 13 Apr 2008 22:49:15 -0700 (PDT)
DKIM-Signature:	v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type;
        bh=KbLVxW0NSqTpGlRXl3eNqHZnM+4dKhBcFB81/UGtOSU=;
        b=PUqITdF7uCQY8o61ViAKHT8nUq1azuS5TjOySI0e9zDA9F7boqpzeSAOQF4J1vF79CEC7+Cfzk1UKGaZXCJaO1v7ocPGzge9V7h9vaZO7CSggcVRGUjBaYGDdxHKGjA0xySfVcwsdyG4sqJHvS0UvE0YHUPeMQZILIFo6OVIFLk=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:to:subject:mime-version:content-type;
        b=hi/RDJIIPeg9tTvvvBJKZgVEiBstNy1kZHD037pNAgrI6UzldXzI5ixJK8PbIhQw9UzDWJTkVIvGjcx0h40XFVatz4br2m3zBPcjVPwgOfJUH9vUNVJ41yK2prCsKF1XmtKodfk1K9VQR2nerbwY6pnxY40L1qInOk99GPtibhU=
Received: by 10.142.180.17 with SMTP id c17mr1684151wff.83.1208152155765;
        Sun, 13 Apr 2008 22:49:15 -0700 (PDT)
Received: by 10.143.122.4 with HTTP; Sun, 13 Apr 2008 22:49:15 -0700 (PDT)
Message-ID: <b5c34db00804132249v6b2f904gef0a52fca81c7ed9@mail.gmail.com>
Date:	Mon, 14 Apr 2008 11:19:15 +0530
From:	umeshyv <umeshyv@gmail.com>
To:	linux-mips@linux-mips.org
Subject: co processor in mips regarded
MIME-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_10688_32623342.1208152155770"
Return-Path: <umeshyv@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: 18907
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: umeshyv@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 847
Lines: 22

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

Hi to all,
How can I read / write to co processor registers in au1200 processor and i
need to do some small modules in  it for my basic understanding could anyone
help me how to carry on in linux.waiting for valuable responses

Regards
Umesh

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

Hi to all,<br>How can I read / write to co processor registers in au1200 processor and i need to do some small modules in&nbsp; it for my basic understanding could anyone help me how to carry on in linux.waiting for valuable responses<br>
<br>Regards<br>Umesh<br>

------=_Part_10688_32623342.1208152155770--

From anemo@mba.ocn.ne.jp Mon Apr 14 09:56:46 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 14 Apr 2008 09:56:48 +0100 (BST)
Received: from topsns2.toshiba-tops.co.jp ([202.230.225.126]:7244 "EHLO
	topsns2.toshiba-tops.co.jp") by ftp.linux-mips.org with ESMTP
	id S20022890AbYDNI4q (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 14 Apr 2008 09:56:46 +0100
Received: from topsms.toshiba-tops.co.jp by topsns2.toshiba-tops.co.jp
          via smtpd (for [213.58.128.207] [213.58.128.207]) with ESMTP; Mon, 14 Apr 2008 17:56:43 +0900
Received: from topsms.toshiba-tops.co.jp (localhost.localdomain [127.0.0.1])
	by localhost.toshiba-tops.co.jp (Postfix) with ESMTP id 5583247294;
	Mon, 14 Apr 2008 17:56:34 +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 41F3E4728D;
	Mon, 14 Apr 2008 17:56:34 +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 m3E8uWAF052958;
	Mon, 14 Apr 2008 17:56:33 +0900 (JST)
	(envelope-from anemo@mba.ocn.ne.jp)
Date:	Mon, 14 Apr 2008 17:56:32 +0900 (JST)
Message-Id: <20080414.175632.128440098.nemoto@toshiba-tops.co.jp>
To:	ths@networkno.de
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] Reimplement clear_page/copy_page
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <20080218193249.GD4747@networkno.de>
References: <20080218193249.GD4747@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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18908
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 1728
Lines: 46

On Mon, 18 Feb 2008 19:32:49 +0000, Thiemo Seufer <ths@networkno.de> wrote:
> Fold the SB-1 specific implementation of clear_page/copy_page in the
> generic version, and rewrite that one in tlbex style. The immediate
> benefits:
>   - It converts the compile-time workaround for SB-1 pass 1 prefetches
>     to a more efficient run-time check.
>   - It allows adjustment of loop unfolling, which helps to reduce the
>     number of redundant cdex cache ops.
>   - It fixes some esoteric cornercases (the cache line length calculations
>     can go wrong, and support for 64k pages without prefetch instructions
>     will overflow the addiu immediate).
>   - Somewhat better guesses of "good" prefetch values.
> 
> 
> Signed-off-by: Thiemo Seufer <ths@networkno.de>

With this patch, on platforms do not have prefetch instruction, a
first instruction of clear_page and copy_page would be something like:

	ori a2, a0, PAGE_SIZE

Of course this does not work for odd pages.  Please fold this fix into
your patch.

diff --git a/arch/mips/mm/page.c b/arch/mips/mm/page.c
index e763101..d827d61 100644
--- a/arch/mips/mm/page.c
+++ b/arch/mips/mm/page.c
@@ -302,7 +302,7 @@ void __cpuinit build_clear_page(void)
 	BUG_ON(PAGE_SIZE < pref_bias_clear_store);
 
 	off = PAGE_SIZE - pref_bias_clear_store;
-	if (off > 0xffff)
+	if (off > 0xffff || !pref_bias_clear_store)
 		pg_addiu(&buf, A2, A0, off);
 	else
 		uasm_i_ori(&buf, A2, A0, off);
@@ -446,7 +446,7 @@ void __cpuinit build_copy_page(void)
 	BUG_ON(pref_bias_copy_store > pref_bias_copy_load);
 
 	off = PAGE_SIZE - pref_bias_copy_load;
-	if (off > 0xffff)
+	if (off > 0xffff || !pref_bias_copy_load)
 		pg_addiu(&buf, A2, A0, off);
 	else
 		uasm_i_ori(&buf, A2, A0, off);

From anemo@mba.ocn.ne.jp Mon Apr 14 13:48:20 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 14 Apr 2008 13:48:23 +0100 (BST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:39667 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S20023615AbYDNMsU (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 14 Apr 2008 13:48:20 +0100
Received: from localhost (p6040-ipad303funabasi.chiba.ocn.ne.jp [123.217.152.40])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id F0E59AA61; Mon, 14 Apr 2008 21:48:12 +0900 (JST)
Date:	Mon, 14 Apr 2008 21:49:07 +0900 (JST)
Message-Id: <20080414.214907.07642439.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] rbtx4938: misc cleanups
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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18909
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 16111
Lines: 492

* Do not use non-standard I/O accessors, such as reg_rd08, etc.
* Kill unnecessary wbflush()
* Kill tx4938_mips.h
* Kill unnecessary includes

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
Patch against linux-queue tree.

 arch/mips/tx4938/common/dbgio.c           |    4 +-
 arch/mips/tx4938/common/prom.c            |   11 +----
 arch/mips/tx4938/toshiba_rbtx4938/irq.c   |   46 ++++----------------
 arch/mips/tx4938/toshiba_rbtx4938/setup.c |   66 +++++++++++++----------------
 include/asm-mips/tx4938/rbtx4938.h        |   58 +++++++++----------------
 include/asm-mips/tx4938/tx4938.h          |   24 ----------
 include/asm-mips/tx4938/tx4938_mips.h     |   54 -----------------------
 7 files changed, 63 insertions(+), 200 deletions(-)

diff --git a/arch/mips/tx4938/common/dbgio.c b/arch/mips/tx4938/common/dbgio.c
index bea59ff..33b9c67 100644
--- a/arch/mips/tx4938/common/dbgio.c
+++ b/arch/mips/tx4938/common/dbgio.c
@@ -31,9 +31,7 @@
  * Support for TX4938 in 2.6 - Hiroshi DOYU <Hiroshi_DOYU@montavista.co.jp>
  */
 
-#include <asm/mipsregs.h>
-#include <asm/system.h>
-#include <asm/tx4938/tx4938_mips.h>
+#include <linux/types>
 
 extern u8 txx9_sio_kdbg_rd(void);
 extern int txx9_sio_kdbg_wr( u8 ch );
diff --git a/arch/mips/tx4938/common/prom.c b/arch/mips/tx4938/common/prom.c
index 3189a65..20baeae 100644
--- a/arch/mips/tx4938/common/prom.c
+++ b/arch/mips/tx4938/common/prom.c
@@ -13,13 +13,8 @@
  */
 
 #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 <asm/tx4938/tx4938.h>
+#include <linux/types.h>
+#include <linux/io.h>
 
 static unsigned int __init
 tx4938_process_sdccr(u64 * addr)
@@ -35,7 +30,7 @@ tx4938_process_sdccr(u64 * addr)
 	unsigned int bc = 4;
 	unsigned int msize = 0;
 
-	val = (*((vu64 *) (addr)));
+	val = ____raw_readq((void __iomem *)addr);
 
 	/* MVMCP -- need #defs for these bits masks */
 	sdccr_ce = ((val & (1 << 10)) >> 10);
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/irq.c b/arch/mips/tx4938/toshiba_rbtx4938/irq.c
index f001850..4d6a8dc 100644
--- a/arch/mips/tx4938/toshiba_rbtx4938/irq.c
+++ b/arch/mips/tx4938/toshiba_rbtx4938/irq.c
@@ -67,24 +67,7 @@ IRQ  Device
 63 RBTX4938-IOC/07 SWINT
 */
 #include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/mm.h>
-#include <linux/swap.h>
-#include <linux/ioport.h>
-#include <linux/sched.h>
 #include <linux/interrupt.h>
-#include <linux/pci.h>
-#include <linux/timex.h>
-#include <asm/bootinfo.h>
-#include <asm/page.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/processor.h>
-#include <asm/reboot.h>
-#include <asm/time.h>
-#include <asm/wbflush.h>
-#include <linux/bootmem.h>
 #include <asm/tx4938/rbtx4938.h>
 
 static void toshiba_rbtx4938_irq_ioc_enable(unsigned int irq);
@@ -99,21 +82,16 @@ static struct irq_chip toshiba_rbtx4938_irq_ioc_type = {
 	.unmask = toshiba_rbtx4938_irq_ioc_enable,
 };
 
-#define TOSHIBA_RBTX4938_IOC_INTR_ENAB 0xb7f02000
-#define TOSHIBA_RBTX4938_IOC_INTR_STAT 0xb7f0200a
-
 int
 toshiba_rbtx4938_irq_nested(int sw_irq)
 {
 	u8 level3;
 
-	level3 = reg_rd08(TOSHIBA_RBTX4938_IOC_INTR_STAT) & 0xff;
-	if (level3) {
+	level3 = readb(rbtx4938_imstat_addr);
+	if (level3)
 		/* must use fls so onboard ATA has priority */
 		sw_irq = TOSHIBA_RBTX4938_IRQ_IOC_BEG + fls(level3) - 1;
-	}
 
-	wbflush();
 	return sw_irq;
 }
 
@@ -144,25 +122,23 @@ toshiba_rbtx4938_irq_ioc_init(void)
 static void
 toshiba_rbtx4938_irq_ioc_enable(unsigned int irq)
 {
-	volatile unsigned char v;
+	unsigned char v;
 
-	v = TX4938_RD08(TOSHIBA_RBTX4938_IOC_INTR_ENAB);
+	v = readb(rbtx4938_imask_addr);
 	v |= (1 << (irq - TOSHIBA_RBTX4938_IRQ_IOC_BEG));
-	TX4938_WR08(TOSHIBA_RBTX4938_IOC_INTR_ENAB, v);
+	writeb(v, rbtx4938_imask_addr);
 	mmiowb();
-	TX4938_RD08(TOSHIBA_RBTX4938_IOC_INTR_ENAB);
 }
 
 static void
 toshiba_rbtx4938_irq_ioc_disable(unsigned int irq)
 {
-	volatile unsigned char v;
+	unsigned char v;
 
-	v = TX4938_RD08(TOSHIBA_RBTX4938_IOC_INTR_ENAB);
+	v = readb(rbtx4938_imask_addr);
 	v &= ~(1 << (irq - TOSHIBA_RBTX4938_IRQ_IOC_BEG));
-	TX4938_WR08(TOSHIBA_RBTX4938_IOC_INTR_ENAB, v);
+	writeb(v, rbtx4938_imask_addr);
 	mmiowb();
-	TX4938_RD08(TOSHIBA_RBTX4938_IOC_INTR_ENAB);
 }
 
 void __init arch_init_irq(void)
@@ -174,14 +150,12 @@ void __init arch_init_irq(void)
 	/* all IRC interrupt mode are Low Active. */
 
 	/* mask all IOC interrupts */
-	*rbtx4938_imask_ptr = 0;
+	writeb(0, rbtx4938_imask_addr);
 
 	/* clear SoftInt interrupts */
-	*rbtx4938_softint_ptr = 0;
+	writeb(0, rbtx4938_softint_addr);
 	tx4938_irq_init();
 	toshiba_rbtx4938_irq_ioc_init();
 	/* Onboard 10M Ether: High Active */
 	set_irq_type(RBTX4938_IRQ_ETHER, IRQF_TRIGGER_HIGH);
-
-	wbflush();
 }
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/setup.c b/arch/mips/tx4938/toshiba_rbtx4938/setup.c
index b38ea5a..2fbf7d4 100644
--- a/arch/mips/tx4938/toshiba_rbtx4938/setup.c
+++ b/arch/mips/tx4938/toshiba_rbtx4938/setup.c
@@ -23,7 +23,6 @@
 #include <linux/clk.h>
 #include <linux/gpio.h>
 
-#include <asm/wbflush.h>
 #include <asm/reboot.h>
 #include <asm/time.h>
 #include <asm/txx9tmr.h>
@@ -91,12 +90,11 @@ void rbtx4938_machine_restart(char *command)
 	local_irq_disable();
 
 	printk("Rebooting...");
-	*rbtx4938_softresetlock_ptr = 1;
-	*rbtx4938_sfvol_ptr = 1;
-	*rbtx4938_softreset_ptr = 1;
-	wbflush();
-
-	while(1);
+	writeb(1, rbtx4938_softresetlock_addr);
+	writeb(1, rbtx4938_sfvol_addr);
+	writeb(1, rbtx4938_softreset_addr);
+	while(1)
+		;
 }
 
 void __init
@@ -488,7 +486,7 @@ static int __init tx4938_pcibios_init(void)
 	}
 
 	/* Reset PCI Bus */
-	*rbtx4938_pcireset_ptr = 0;
+	writeb(0, rbtx4938_pcireset_addr);
 	/* Reset PCIC */
 	tx4938_ccfgptr->clkctr |= TX4938_CLKCTR_PCIRST;
 	if (txboard_pci66_mode > 0)
@@ -496,8 +494,8 @@ static int __init tx4938_pcibios_init(void)
 	mdelay(10);
 	/* clear PCIC reset */
 	tx4938_ccfgptr->clkctr &= ~TX4938_CLKCTR_PCIRST;
-	*rbtx4938_pcireset_ptr = 1;
-	wbflush();
+	writeb(1, rbtx4938_pcireset_addr);
+	mmiowb();
 	tx4938_report_pcic_status1(tx4938_pcicptr);
 
 	tx4938_report_pciclk();
@@ -505,15 +503,15 @@ static int __init tx4938_pcibios_init(void)
 	if (txboard_pci66_mode == 0 &&
 	    txboard_pci66_check(&tx4938_pci_controller[0], 0, 0)) {
 		/* Reset PCI Bus */
-		*rbtx4938_pcireset_ptr = 0;
+		writeb(0, rbtx4938_pcireset_addr);
 		/* Reset PCIC */
 		tx4938_ccfgptr->clkctr |= TX4938_CLKCTR_PCIRST;
 		tx4938_pciclk66_setup();
 		mdelay(10);
 		/* clear PCIC reset */
 		tx4938_ccfgptr->clkctr &= ~TX4938_CLKCTR_PCIRST;
-		*rbtx4938_pcireset_ptr = 1;
-		wbflush();
+		writeb(1, rbtx4938_pcireset_addr);
+		mmiowb();
 		/* Reinitialize PCIC */
 		tx4938_report_pciclk();
 		tx4938_pcic_setup(tx4938_pcicptr, &tx4938_pci_controller[0], io_base[0], extarb);
@@ -774,8 +772,9 @@ void __init tx4938_board_setup(void)
 		txx9_tmr_init(TX4938_TMR_REG(i) & 0xfffffffffULL);
 
 	/* enable DMA */
-	TX4938_WR64(0xff1fb150, TX4938_DMA_MCR_MSTEN);
-	TX4938_WR64(0xff1fb950, TX4938_DMA_MCR_MSTEN);
+	for (i = 0; i < 2; i++)
+		____raw_writeq(TX4938_DMA_MCR_MSTEN,
+			       (void __iomem *)(TX4938_DMA_REG(i) + 0x50));
 
 	/* PIO */
 	__raw_writel(0, &tx4938_pioptr->maskcpu);
@@ -861,10 +860,6 @@ void __init plat_mem_setup(void)
 	if (txx9_master_clock == 0)
 		txx9_master_clock = 25000000; /* 25MHz */
 	tx4938_board_setup();
-	/* setup serial stuff */
-	TX4938_WR(0xff1ff314, 0x00000000);	/* h/w flow control off */
-	TX4938_WR(0xff1ff414, 0x00000000);	/* h/w flow control off */
-
 #ifndef CONFIG_PCI
 	set_io_port_base(RBTX4938_ETHER_BASE);
 #endif
@@ -930,16 +925,16 @@ void __init plat_mem_setup(void)
 	pcfg = tx4938_ccfgptr->pcfg;	/* updated */
 	/* fixup piosel */
 	if ((pcfg & (TX4938_PCFG_ATA_SEL | TX4938_PCFG_NDF_SEL)) ==
-	    TX4938_PCFG_ATA_SEL) {
-		*rbtx4938_piosel_ptr = (*rbtx4938_piosel_ptr & 0x03) | 0x04;
-	}
+	    TX4938_PCFG_ATA_SEL)
+		writeb((readb(rbtx4938_piosel_addr) & 0x03) | 0x04,
+		       rbtx4938_piosel_addr);
 	else if ((pcfg & (TX4938_PCFG_ATA_SEL | TX4938_PCFG_NDF_SEL)) ==
-	    TX4938_PCFG_NDF_SEL) {
-		*rbtx4938_piosel_ptr = (*rbtx4938_piosel_ptr & 0x03) | 0x08;
-	}
-	else {
-		*rbtx4938_piosel_ptr &= ~(0x08 | 0x04);
-	}
+		 TX4938_PCFG_NDF_SEL)
+		writeb((readb(rbtx4938_piosel_addr) & 0x03) | 0x08,
+		       rbtx4938_piosel_addr);
+	else
+		writeb(readb(rbtx4938_piosel_addr) & ~(0x08 | 0x04),
+		       rbtx4938_piosel_addr);
 
 	rbtx4938_fpga_resource.name = "FPGA Registers";
 	rbtx4938_fpga_resource.start = CPHYSADDR(RBTX4938_FPGA_REG_ADDR);
@@ -948,17 +943,14 @@ void __init plat_mem_setup(void)
 	if (request_resource(&iomem_resource, &rbtx4938_fpga_resource))
 		printk("request resource for fpga failed\n");
 
-	/* disable all OnBoard I/O interrupts */
-	*rbtx4938_imask_ptr = 0;
-
 	_machine_restart = rbtx4938_machine_restart;
 	_machine_halt = rbtx4938_machine_halt;
 	pm_power_off = rbtx4938_machine_power_off;
 
-	*rbtx4938_led_ptr = 0xff;
-	printk("RBTX4938 --- FPGA(Rev %02x)", *rbtx4938_fpga_rev_ptr);
-	printk(" DIPSW:%02x,%02x\n",
-	       *rbtx4938_dipsw_ptr, *rbtx4938_bdipsw_ptr);
+	writeb(0xff, rbtx4938_led_addr);
+	printk(KERN_INFO "RBTX4938 --- FPGA(Rev %02x) DIPSW:%02x,%02x\n",
+	       readb(rbtx4938_fpga_rev_addr),
+	       readb(rbtx4938_dipsw_addr), readb(rbtx4938_bdipsw_addr));
 }
 
 static int __init rbtx4938_ne_init(void)
@@ -1000,12 +992,12 @@ static void rbtx4938_spi_gpio_set(struct gpio_chip *chip, unsigned int offset,
 	u8 val;
 	unsigned long flags;
 	spin_lock_irqsave(&rbtx4938_spi_gpio_lock, flags);
-	val = *rbtx4938_spics_ptr;
+	val = readb(rbtx4938_spics_addr);
 	if (value)
 		val |= 1 << offset;
 	else
 		val &= ~(1 << offset);
-	*rbtx4938_spics_ptr = val;
+	writeb(val, rbtx4938_spics_addr);
 	mmiowb();
 	spin_unlock_irqrestore(&rbtx4938_spi_gpio_lock, flags);
 }
diff --git a/include/asm-mips/tx4938/rbtx4938.h b/include/asm-mips/tx4938/rbtx4938.h
index b180488..dfed7be 100644
--- a/include/asm-mips/tx4938/rbtx4938.h
+++ b/include/asm-mips/tx4938/rbtx4938.h
@@ -67,44 +67,26 @@
 #define RBTX4938_INTF_MODEM	(1 << RBTX4938_INTB_MODEM)
 #define RBTX4938_INTF_SWINT	(1 << RBTX4938_INTB_SWINT)
 
-#define rbtx4938_fpga_rev_ptr	\
-	((volatile unsigned char *)RBTX4938_FPGA_REV_ADDR)
-#define rbtx4938_led_ptr	\
-	((volatile unsigned char *)RBTX4938_LED_ADDR)
-#define rbtx4938_dipsw_ptr	\
-	((volatile unsigned char *)RBTX4938_DIPSW_ADDR)
-#define rbtx4938_bdipsw_ptr	\
-	((volatile unsigned char *)RBTX4938_BDIPSW_ADDR)
-#define rbtx4938_imask_ptr	\
-	((volatile unsigned char *)RBTX4938_IMASK_ADDR)
-#define rbtx4938_imask2_ptr	\
-	((volatile unsigned char *)RBTX4938_IMASK2_ADDR)
-#define rbtx4938_intpol_ptr	\
-	((volatile unsigned char *)RBTX4938_INTPOL_ADDR)
-#define rbtx4938_istat_ptr	\
-	((volatile unsigned char *)RBTX4938_ISTAT_ADDR)
-#define rbtx4938_istat2_ptr	\
-	((volatile unsigned char *)RBTX4938_ISTAT2_ADDR)
-#define rbtx4938_imstat_ptr	\
-	((volatile unsigned char *)RBTX4938_IMSTAT_ADDR)
-#define rbtx4938_imstat2_ptr	\
-	((volatile unsigned char *)RBTX4938_IMSTAT2_ADDR)
-#define rbtx4938_softint_ptr	\
-	((volatile unsigned char *)RBTX4938_SOFTINT_ADDR)
-#define rbtx4938_piosel_ptr	\
-	((volatile unsigned char *)RBTX4938_PIOSEL_ADDR)
-#define rbtx4938_spics_ptr	\
-	((volatile unsigned char *)RBTX4938_SPICS_ADDR)
-#define rbtx4938_sfpwr_ptr	\
-	((volatile unsigned char *)RBTX4938_SFPWR_ADDR)
-#define rbtx4938_sfvol_ptr	\
-	((volatile unsigned char *)RBTX4938_SFVOL_ADDR)
-#define rbtx4938_softreset_ptr	\
-	((volatile unsigned char *)RBTX4938_SOFTRESET_ADDR)
-#define rbtx4938_softresetlock_ptr	\
-	((volatile unsigned char *)RBTX4938_SOFTRESETLOCK_ADDR)
-#define rbtx4938_pcireset_ptr	\
-	((volatile unsigned char *)RBTX4938_PCIRESET_ADDR)
+#define rbtx4938_fpga_rev_addr	((__u8 __iomem *)RBTX4938_FPGA_REV_ADDR)
+#define rbtx4938_led_addr	((__u8 __iomem *)RBTX4938_LED_ADDR)
+#define rbtx4938_dipsw_addr	((__u8 __iomem *)RBTX4938_DIPSW_ADDR)
+#define rbtx4938_bdipsw_addr	((__u8 __iomem *)RBTX4938_BDIPSW_ADDR)
+#define rbtx4938_imask_addr	((__u8 __iomem *)RBTX4938_IMASK_ADDR)
+#define rbtx4938_imask2_addr	((__u8 __iomem *)RBTX4938_IMASK2_ADDR)
+#define rbtx4938_intpol_addr	((__u8 __iomem *)RBTX4938_INTPOL_ADDR)
+#define rbtx4938_istat_addr	((__u8 __iomem *)RBTX4938_ISTAT_ADDR)
+#define rbtx4938_istat2_addr	((__u8 __iomem *)RBTX4938_ISTAT2_ADDR)
+#define rbtx4938_imstat_addr	((__u8 __iomem *)RBTX4938_IMSTAT_ADDR)
+#define rbtx4938_imstat2_addr	((__u8 __iomem *)RBTX4938_IMSTAT2_ADDR)
+#define rbtx4938_softint_addr	((__u8 __iomem *)RBTX4938_SOFTINT_ADDR)
+#define rbtx4938_piosel_addr	((__u8 __iomem *)RBTX4938_PIOSEL_ADDR)
+#define rbtx4938_spics_addr	((__u8 __iomem *)RBTX4938_SPICS_ADDR)
+#define rbtx4938_sfpwr_addr	((__u8 __iomem *)RBTX4938_SFPWR_ADDR)
+#define rbtx4938_sfvol_addr	((__u8 __iomem *)RBTX4938_SFVOL_ADDR)
+#define rbtx4938_softreset_addr	((__u8 __iomem *)RBTX4938_SOFTRESET_ADDR)
+#define rbtx4938_softresetlock_addr	\
+				((__u8 __iomem *)RBTX4938_SOFTRESETLOCK_ADDR)
+#define rbtx4938_pcireset_addr	((__u8 __iomem *)RBTX4938_PCIRESET_ADDR)
 
 /*
  * IRQ mappings
diff --git a/include/asm-mips/tx4938/tx4938.h b/include/asm-mips/tx4938/tx4938.h
index a05f031..e8807f5 100644
--- a/include/asm-mips/tx4938/tx4938.h
+++ b/include/asm-mips/tx4938/tx4938.h
@@ -13,8 +13,6 @@
 #ifndef __ASM_TX_BOARDS_TX4938_H
 #define __ASM_TX_BOARDS_TX4938_H
 
-#include <asm/tx4938/tx4938_mips.h>
-
 #define tx4938_read_nfmc(addr) (*(volatile unsigned int *)(addr))
 #define tx4938_write_nfmc(b, addr) (*(volatile unsigned int *)(addr)) = (b)
 
@@ -54,28 +52,6 @@
 #define TX4938_ACLC_REG		(TX4938_REG_BASE + 0xf700)
 #define TX4938_SPI_REG		(TX4938_REG_BASE + 0xf800)
 
-#ifndef _LANGUAGE_ASSEMBLY
-#include <asm/byteorder.h>
-
-#define TX4938_MKA(x) ((u32)( ((u32)(TX4938_REG_BASE)) | ((u32)(x)) ))
-
-#define TX4938_RD08( reg      )   (*(vu08*)(reg))
-#define TX4938_WR08( reg, val )  ((*(vu08*)(reg))=(val))
-
-#define TX4938_RD16( reg      )   (*(vu16*)(reg))
-#define TX4938_WR16( reg, val )  ((*(vu16*)(reg))=(val))
-
-#define TX4938_RD32( reg      )   (*(vu32*)(reg))
-#define TX4938_WR32( reg, val )  ((*(vu32*)(reg))=(val))
-
-#define TX4938_RD64( reg      )   (*(vu64*)(reg))
-#define TX4938_WR64( reg, val )  ((*(vu64*)(reg))=(val))
-
-#define TX4938_RD( reg      ) TX4938_RD32( reg )
-#define TX4938_WR( reg, val ) TX4938_WR32( reg, val )
-
-#endif /* !__ASSEMBLY__ */
-
 #ifdef __ASSEMBLY__
 #define _CONST64(c)	c
 #else
diff --git a/include/asm-mips/tx4938/tx4938_mips.h b/include/asm-mips/tx4938/tx4938_mips.h
deleted file mode 100644
index f346ff5..0000000
--- a/include/asm-mips/tx4938/tx4938_mips.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * linux/include/asm-mips/tx4938/tx4938_mips.h
- * Generic bitmask definitions
- *
- * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
- * terms of the GNU General Public License version 2. This program is
- * licensed "as is" without any warranty of any kind, whether express
- * or implied.
- *
- * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
- */
-
-#ifndef TX4938_TX4938_MIPS_H
-#define TX4938_TX4938_MIPS_H
-#ifndef __ASSEMBLY__
-
-#define reg_rd08(r)    ((u8 )(*((vu8 *)(r))))
-#define reg_rd16(r)    ((u16)(*((vu16*)(r))))
-#define reg_rd32(r)    ((u32)(*((vu32*)(r))))
-#define reg_rd64(r)    ((u64)(*((vu64*)(r))))
-
-#define reg_wr08(r, v)  ((*((vu8 *)(r)))=((u8 )(v)))
-#define reg_wr16(r, v)  ((*((vu16*)(r)))=((u16)(v)))
-#define reg_wr32(r, v)  ((*((vu32*)(r)))=((u32)(v)))
-#define reg_wr64(r, v)  ((*((vu64*)(r)))=((u64)(v)))
-
-typedef volatile __signed char vs8;
-typedef volatile unsigned char vu8;
-
-typedef volatile __signed short vs16;
-typedef volatile unsigned short vu16;
-
-typedef volatile __signed int vs32;
-typedef volatile unsigned int vu32;
-
-typedef s8 s08;
-typedef vs8 vs08;
-
-typedef u8 u08;
-typedef vu8 vu08;
-
-#if (_MIPS_SZLONG == 64)
-
-typedef volatile __signed__ long vs64;
-typedef volatile unsigned long vu64;
-
-#else
-
-typedef volatile __signed__ long long vs64;
-typedef volatile unsigned long long vu64;
-
-#endif
-#endif
-#endif



From anemo@mba.ocn.ne.jp Mon Apr 14 13:52:02 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 14 Apr 2008 13:52:04 +0100 (BST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:54726 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S20023615AbYDNMwC (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 14 Apr 2008 13:52:02 +0100
Received: from localhost (p6040-ipad303funabasi.chiba.ocn.ne.jp [123.217.152.40])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 7D1C9AD83; Mon, 14 Apr 2008 21:51:57 +0900 (JST)
Date:	Mon, 14 Apr 2008 21:52:51 +0900 (JST)
Message-Id: <20080414.215251.25478108.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] Fix some section mismatches
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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18910
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 2922
Lines: 99

Also make coherentio static.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
Patch against linux-queue tree.

 arch/mips/kernel/spram.c |   14 +++++++-------
 arch/mips/mm/c-r4k.c     |    4 ++--
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/mips/kernel/spram.c b/arch/mips/kernel/spram.c
index 31bb952..6ddb507 100644
--- a/arch/mips/kernel/spram.c
+++ b/arch/mips/kernel/spram.c
@@ -39,7 +39,7 @@
 /*
  * Different semantics to the set_c0_* function built by __BUILD_SET_C0
  */
-static __init unsigned int bis_c0_errctl(unsigned int set)
+static __cpuinit unsigned int bis_c0_errctl(unsigned int set)
 {
 	unsigned int res;
 	res = read_c0_errctl();
@@ -47,7 +47,7 @@ static __init unsigned int bis_c0_errctl(unsigned int set)
 	return res;
 }
 
-static __init void ispram_store_tag(unsigned int offset, unsigned int data)
+static __cpuinit void ispram_store_tag(unsigned int offset, unsigned int data)
 {
 	unsigned int errctl;
 
@@ -66,7 +66,7 @@ static __init void ispram_store_tag(unsigned int offset, unsigned int data)
 }
 
 
-static __init unsigned int ispram_load_tag(unsigned int offset)
+static __cpuinit unsigned int ispram_load_tag(unsigned int offset)
 {
 	unsigned int data;
 	unsigned int errctl;
@@ -84,7 +84,7 @@ static __init unsigned int ispram_load_tag(unsigned int offset)
 	return data;
 }
 
-static __init void dspram_store_tag(unsigned int offset, unsigned int data)
+static __cpuinit void dspram_store_tag(unsigned int offset, unsigned int data)
 {
 	unsigned int errctl;
 
@@ -100,7 +100,7 @@ static __init void dspram_store_tag(unsigned int offset, unsigned int data)
 }
 
 
-static __init unsigned int dspram_load_tag(unsigned int offset)
+static __cpuinit unsigned int dspram_load_tag(unsigned int offset)
 {
 	unsigned int data;
 	unsigned int errctl;
@@ -117,7 +117,7 @@ static __init unsigned int dspram_load_tag(unsigned int offset)
 	return data;
 }
 
-static __init void probe_spram(char *type,
+static __cpuinit void probe_spram(char *type,
 	    unsigned int base,
 	    unsigned int (*read)(unsigned int),
 	    void (*write)(unsigned int, unsigned int))
@@ -199,7 +199,7 @@ static __init void probe_spram(char *type,
 	}
 }
 
-__init void spram_config(void)
+__cpuinit void spram_config(void)
 {
 	struct cpuinfo_mips *c = &current_cpu_data;
 	unsigned int config0;
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 92b549e..82bdc66 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -1226,7 +1226,7 @@ void au1x00_fixup_config_od(void)
 	}
 }
 
-static int __initdata cca = -1;
+static int __cpuinitdata cca = -1;
 unsigned long _page_cachable_default;
 EXPORT_SYMBOL_GPL(_page_cachable_default);
 
@@ -1296,7 +1296,7 @@ static void __cpuinit coherency_setup(void)
 
 #if defined(CONFIG_DMA_NONCOHERENT)
 
-int __initdata coherentio;
+static int __cpuinitdata coherentio;
 
 static int __init setcoherentio(char *str)
 {

From ralf@linux-mips.org Mon Apr 14 13:58:01 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 14 Apr 2008 13:58:09 +0100 (BST)
Received: from oss.sgi.com ([192.48.170.157]:12692 "EHLO oss.sgi.com")
	by ftp.linux-mips.org with ESMTP id S20023657AbYDNM6B (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 14 Apr 2008 13:58:01 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3ECvGj0017985
	for <linux-mips@linux-mips.org>; Mon, 14 Apr 2008 05:57:17 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m3ECvu1F010388;
	Mon, 14 Apr 2008 13:57:56 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m3ECvt1v010387;
	Mon, 14 Apr 2008 13:57:55 +0100
Date:	Mon, 14 Apr 2008 13:57:55 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] rbtx4938: misc cleanups
Message-ID: <20080414125755.GA6361@linux-mips.org>
References: <20080414.214907.07642439.anemo@mba.ocn.ne.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080414.214907.07642439.anemo@mba.ocn.ne.jp>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18911
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 308
Lines: 12

On Mon, Apr 14, 2008 at 09:49:07PM +0900, Atsushi Nemoto wrote:

> * Do not use non-standard I/O accessors, such as reg_rd08, etc.
> * Kill unnecessary wbflush()
> * Kill tx4938_mips.h
> * Kill unnecessary includes
> 
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

Thanks, queued for 2.6.26,

  Ralf

From ralf@linux-mips.org Mon Apr 14 14:10:26 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 14 Apr 2008 14:10:28 +0100 (BST)
Received: from oss.sgi.com ([192.48.170.157]:50594 "EHLO oss.sgi.com")
	by ftp.linux-mips.org with ESMTP id S28573704AbYDNNK0 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 14 Apr 2008 14:10:26 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3ED9cX3019298
	for <linux-mips@linux-mips.org>; Mon, 14 Apr 2008 06:09:39 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m3EDAIrZ012406;
	Mon, 14 Apr 2008 14:10:18 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m3EDAIsZ012405;
	Mon, 14 Apr 2008 14:10:18 +0100
Date:	Mon, 14 Apr 2008 14:10:18 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] Fix some section mismatches
Message-ID: <20080414131018.GB6361@linux-mips.org>
References: <20080414.215251.25478108.anemo@mba.ocn.ne.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080414.215251.25478108.anemo@mba.ocn.ne.jp>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18912
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 246
Lines: 10

On Mon, Apr 14, 2008 at 09:52:51PM +0900, Atsushi Nemoto wrote:

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

Thanks; I folded your fixes into the other queue patches which introduced
the bugs.

  Ralf

From ralf@linux-mips.org Mon Apr 14 14:13:37 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 14 Apr 2008 14:13:40 +0100 (BST)
Received: from oss.sgi.com ([192.48.170.157]:40614 "EHLO oss.sgi.com")
	by ftp.linux-mips.org with ESMTP id S20022552AbYDNNNh (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 14 Apr 2008 14:13:37 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3EDCsB8019651
	for <linux-mips@linux-mips.org>; Mon, 14 Apr 2008 06:12:54 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m3EDDYr7013201;
	Mon, 14 Apr 2008 14:13:34 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m3EDDXVh013200;
	Mon, 14 Apr 2008 14:13:33 +0100
Date:	Mon, 14 Apr 2008 14:13:33 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	ths@networkno.de, linux-mips@linux-mips.org
Subject: Re: [PATCH] Reimplement clear_page/copy_page
Message-ID: <20080414131333.GC6361@linux-mips.org>
References: <20080218193249.GD4747@networkno.de> <20080414.175632.128440098.nemoto@toshiba-tops.co.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080414.175632.128440098.nemoto@toshiba-tops.co.jp>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18913
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 372
Lines: 13

On Mon, Apr 14, 2008 at 05:56:32PM +0900, Atsushi Nemoto wrote:

> With this patch, on platforms do not have prefetch instruction, a
> first instruction of clear_page and copy_page would be something like:
> 
> 	ori a2, a0, PAGE_SIZE
> 
> Of course this does not work for odd pages.  Please fold this fix into
> your patch.

Folded into the 2.6.26 queue.  Thanks,

  Ralf

From sshtylyov@ru.mvista.com Mon Apr 14 14:28:08 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 14 Apr 2008 14:28:10 +0100 (BST)
Received: from rtsoft3.corbina.net ([85.21.88.6]:55090 "EHLO
	buildserver.ru.mvista.com") by ftp.linux-mips.org with ESMTP
	id S28573721AbYDNN2I (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 14 Apr 2008 14:28:08 +0100
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id DCDDA8810; Mon, 14 Apr 2008 18:28:06 +0500 (SAMST)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	linux-pcmcia@lists.infradead.org
Subject: [PATCH] Alchemy: fix PCMCIA warnings
Date:	Mon, 14 Apr 2008 17:27:30 +0400
User-Agent: KMail/1.5
Cc:	linux-mips@linux-mips.org
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804141727.30170.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18914
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 2834
Lines: 63

Fix the following warnings:

drivers/pcmcia/au1000_generic.c: In function `au1x00_pcmcia_socket_probe':
drivers/pcmcia/au1000_generic.c:405: warning: integer constant is too large for
"long" type
drivers/pcmcia/au1000_generic.c:413: warning: integer constant is too large for
"long" type

by properly postfixing the socket constants. While at it, fix the lines over 80
characters long in the vicinity...

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

 drivers/pcmcia/au1000_generic.h |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)

Index: linux-2.6/drivers/pcmcia/au1000_generic.h
===================================================================
--- linux-2.6.orig/drivers/pcmcia/au1000_generic.h
+++ linux-2.6/drivers/pcmcia/au1000_generic.h
@@ -34,9 +34,9 @@
 #define AU1000_PCMCIA_IO_SPEED       (255)
 #define AU1000_PCMCIA_MEM_SPEED      (300)
 
-#define AU1X_SOCK0_IO        0xF00000000
-#define AU1X_SOCK0_PHYS_ATTR 0xF40000000
-#define AU1X_SOCK0_PHYS_MEM  0xF80000000
+#define AU1X_SOCK0_IO        0xF00000000ULL
+#define AU1X_SOCK0_PHYS_ATTR 0xF40000000ULL
+#define AU1X_SOCK0_PHYS_MEM  0xF80000000ULL
 /* pseudo 32 bit phys addresses, which get fixed up to the
  * real 36 bit address in fixup_bigphys_addr() */
 #define AU1X_SOCK0_PSEUDO_PHYS_ATTR 0xF4000000
@@ -45,16 +45,20 @@
 /* pcmcia socket 1 needs external glue logic so the memory map
  * differs from board to board.
  */
-#if defined(CONFIG_MIPS_PB1000) || defined(CONFIG_MIPS_PB1100) || defined(CONFIG_MIPS_PB1500) || defined(CONFIG_MIPS_PB1550) || defined(CONFIG_MIPS_PB1200)
-#define AU1X_SOCK1_IO        0xF08000000
-#define AU1X_SOCK1_PHYS_ATTR 0xF48000000
-#define AU1X_SOCK1_PHYS_MEM  0xF88000000
+#if defined(CONFIG_MIPS_PB1000) || defined(CONFIG_MIPS_PB1100) || \
+    defined(CONFIG_MIPS_PB1500) || defined(CONFIG_MIPS_PB1550) || \
+    defined(CONFIG_MIPS_PB1200)
+#define AU1X_SOCK1_IO        0xF08000000ULL
+#define AU1X_SOCK1_PHYS_ATTR 0xF48000000ULL
+#define AU1X_SOCK1_PHYS_MEM  0xF88000000ULL
 #define AU1X_SOCK1_PSEUDO_PHYS_ATTR 0xF4800000
 #define AU1X_SOCK1_PSEUDO_PHYS_MEM  0xF8800000
-#elif defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100) || defined(CONFIG_MIPS_DB1500) || defined(CONFIG_MIPS_DB1550) || defined(CONFIG_MIPS_DB1200)
-#define AU1X_SOCK1_IO        0xF04000000
-#define AU1X_SOCK1_PHYS_ATTR 0xF44000000
-#define AU1X_SOCK1_PHYS_MEM  0xF84000000
+#elif defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100) || \
+      defined(CONFIG_MIPS_DB1500) || defined(CONFIG_MIPS_DB1550) || \
+      defined(CONFIG_MIPS_DB1200)
+#define AU1X_SOCK1_IO        0xF04000000ULL
+#define AU1X_SOCK1_PHYS_ATTR 0xF44000000ULL
+#define AU1X_SOCK1_PHYS_MEM  0xF84000000ULL
 #define AU1X_SOCK1_PSEUDO_PHYS_ATTR 0xF4400000
 #define AU1X_SOCK1_PSEUDO_PHYS_MEM  0xF8400000
 #endif


From anemo@mba.ocn.ne.jp Mon Apr 14 14:47:11 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 14 Apr 2008 14:47:13 +0100 (BST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:53989 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S20023777AbYDNNrL (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 14 Apr 2008 14:47:11 +0100
Received: from localhost (p6040-ipad303funabasi.chiba.ocn.ne.jp [123.217.152.40])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 1F399AA6A; Mon, 14 Apr 2008 22:47:05 +0900 (JST)
Date:	Mon, 14 Apr 2008 22:47:59 +0900 (JST)
Message-Id: <20080414.224759.130241483.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] Do not build spram.o unconditionally
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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18915
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 1519
Lines: 45

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
Patch against linux-queue tree.

 arch/mips/kernel/Makefile    |    3 ++-
 arch/mips/kernel/cpu-probe.c |    4 ++++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index 80c5aba..27dbbaa 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -7,7 +7,7 @@ extra-y		:= head.o init_task.o vmlinux.lds
 obj-y		+= cpu-probe.o branch.o entry.o genex.o irq.o process.o \
 		   ptrace.o reset.o semaphore.o setup.o signal.o syscall.o \
 		   time.o topology.o traps.o unaligned.o \
-		   spram.o irq-gic.o
+		   irq-gic.o
 
 obj-$(CONFIG_CEVT_BCM1480)	+= cevt-bcm1480.o
 obj-$(CONFIG_CEVT_R4K)		+= cevt-r4k.o
@@ -53,6 +53,7 @@ obj-$(CONFIG_MIPS_MT_FPAFF)	+= mips-mt-fpaff.o
 obj-$(CONFIG_MIPS_MT_SMTC)	+= smtc.o smtc-asm.o smtc-proc.o
 obj-$(CONFIG_MIPS_MT_SMP)	+= smp-mt.o
 obj-$(CONFIG_MIPS_CMP)		+= smp-cmp.o
+obj-$(CONFIG_CPU_MIPSR2)	+= spram.o
 
 obj-$(CONFIG_MIPS_APSP_KSPD)	+= kspd.o
 obj-$(CONFIG_MIPS_VPE_LOADER)	+= vpe.o
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index dd26322..335a6ae 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -676,7 +676,11 @@ static void __cpuinit decode_configs(struct cpuinfo_mips *c)
 		return;
 }
 
+#ifdef CONFIG_CPU_MIPSR2
 extern void spram_config(void);
+#else
+static inline void spram_config(void) {}
+#endif
 
 static inline void cpu_probe_mips(struct cpuinfo_mips *c)
 {

From ralf@linux-mips.org Mon Apr 14 14:57:35 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 14 Apr 2008 14:57:38 +0100 (BST)
Received: from oss.sgi.com ([192.48.170.157]:39897 "EHLO oss.sgi.com")
	by ftp.linux-mips.org with ESMTP id S28573732AbYDNN5f (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 14 Apr 2008 14:57:35 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3EDulXl023817
	for <linux-mips@linux-mips.org>; Mon, 14 Apr 2008 06:56:48 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m3EDvRGi024383;
	Mon, 14 Apr 2008 14:57:27 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m3EDvQqU024382;
	Mon, 14 Apr 2008 14:57:26 +0100
Date:	Mon, 14 Apr 2008 14:57:26 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] Alchemy: kill useless #include's and extern'sv (take 2)
Message-ID: <20080414135726.GA16005@linux-mips.org>
References: <200804112054.44078.sshtylyov@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200804112054.44078.sshtylyov@ru.mvista.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18916
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 394
Lines: 14

On Fri, Apr 11, 2008 at 08:54:43PM +0400, Sergei Shtylyov wrote:

> Go thru the Alchemy code and hunt down every unneeded #include and extern
> (some of which refer to already long dead functions).
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
> 
> ---
> Last time I overlooked arch/mips/au1000/mtx-1/platform.c, so please update the
> queued patch...

Thanks, updated.

  Ralf

From ralf@linux-mips.org Mon Apr 14 15:44:43 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 14 Apr 2008 15:44:45 +0100 (BST)
Received: from oss.sgi.com ([192.48.170.157]:14755 "EHLO oss.sgi.com")
	by ftp.linux-mips.org with ESMTP id S20023875AbYDNOon (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 14 Apr 2008 15:44:43 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3EEhwRd028646
	for <linux-mips@linux-mips.org>; Mon, 14 Apr 2008 07:43:59 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m3EEicn1031660;
	Mon, 14 Apr 2008 15:44:38 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m3EEic1l031659;
	Mon, 14 Apr 2008 15:44:38 +0100
Date:	Mon, 14 Apr 2008 15:44:38 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] Do not build spram.o unconditionally
Message-ID: <20080414144438.GA29804@linux-mips.org>
References: <20080414.224759.130241483.anemo@mba.ocn.ne.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080414.224759.130241483.anemo@mba.ocn.ne.jp>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18917
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 424
Lines: 13

On Mon, Apr 14, 2008 at 10:47:59PM +0900, Atsushi Nemoto wrote:

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

Also folded into the SPRAM patch.  But since not every R2 core has SPRAM
this should probably be done using a new CONFIG_ symbol.  And the
CONFIG_CPU_* were always meant for optimization not feature selection.
So I guess a little more polishing is still needed.  But it's getting
there.

Thanks!

  Ralf

From sshtylyov@ru.mvista.com Mon Apr 14 18:08:12 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 14 Apr 2008 18:08:14 +0100 (BST)
Received: from rtsoft3.corbina.net ([85.21.88.6]:45107 "EHLO
	buildserver.ru.mvista.com") by ftp.linux-mips.org with ESMTP
	id S20022494AbYDNRIM (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 14 Apr 2008 18:08:12 +0100
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id 461298810; Mon, 14 Apr 2008 22:08:08 +0500 (SAMST)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	linux-mips@linux-mips.org, linux-ide@vger.kernel.org
Subject: [PATCH] Pb1200/DBAu1200: IDE resource size off by one
Date:	Mon, 14 Apr 2008 21:07:30 +0400
User-Agent: KMail/1.5
Cc:	ralf@linux-mips.org, bzolnier@gmail.com
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804142107.30799.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18918
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 2023
Lines: 56

The IDE platform device on Pb1200/DBAu1200 boards claims one byte too many for
its memory resource -- fix the platform code and the IDE driver in accordance.

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

---
I'm not sure thru which tree this should go -- probably thru Linux/MIPS one...

 arch/mips/au1000/common/platform.c |    2 +-
 drivers/ide/mips/au1xxx-ide.c      |    7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

Index: linux-2.6/arch/mips/au1000/common/platform.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/platform.c
+++ linux-2.6/arch/mips/au1000/common/platform.c
@@ -189,7 +189,7 @@ static struct resource au1200_lcd_resour
 static struct resource au1200_ide0_resources[] = {
 	[0] = {
 		.start		= AU1XXX_ATA_PHYS_ADDR,
-		.end 		= AU1XXX_ATA_PHYS_ADDR + AU1XXX_ATA_PHYS_LEN,
+		.end 		= AU1XXX_ATA_PHYS_ADDR + AU1XXX_ATA_PHYS_LEN - 1,
 		.flags		= IORESOURCE_MEM,
 	},
 	[1] = {
Index: linux-2.6/drivers/ide/mips/au1xxx-ide.c
===================================================================
--- linux-2.6.orig/drivers/ide/mips/au1xxx-ide.c
+++ linux-2.6/drivers/ide/mips/au1xxx-ide.c
@@ -591,13 +591,14 @@ static int au_ide_probe(struct device *d
 		goto out;
 	}
 
-	if (!request_mem_region (res->start, res->end-res->start, pdev->name)) {
+	if (!request_mem_region(res->start, res->end - res->start + 1,
+				pdev->name)) {
 		pr_debug("%s: request_mem_region failed\n", DRV_NAME);
 		ret =  -EBUSY;
 		goto out;
 	}
 
-	ahwif->regbase = (u32)ioremap(res->start, res->end-res->start);
+	ahwif->regbase = (u32)ioremap(res->start, res->end - res->start + 1);
 	if (ahwif->regbase == 0) {
 		ret = -ENOMEM;
 		goto out;
@@ -682,7 +683,7 @@ static int au_ide_remove(struct device *
 	iounmap((void *)ahwif->regbase);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	release_mem_region(res->start, res->end - res->start);
+	release_mem_region(res->start, res->end - res->start + 1);
 
 	return 0;
 }


From sshtylyov@ru.mvista.com Mon Apr 14 19:29:31 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 14 Apr 2008 19:29:33 +0100 (BST)
Received: from rtsoft3.corbina.net ([85.21.88.6]:7732 "EHLO
	buildserver.ru.mvista.com") by ftp.linux-mips.org with ESMTP
	id S20024197AbYDNS3b (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 14 Apr 2008 19:29:31 +0100
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id 0FF788810; Mon, 14 Apr 2008 23:29:29 +0500 (SAMST)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	linux-mips@linux-mips.org, linux-ide@vger.kernel.org
Subject: [PATCH] Au1200: kill IDE driver function prototypes
Date:	Mon, 14 Apr 2008 22:28:51 +0400
User-Agent: KMail/1.5
Cc:	ralf@linux-mips.org, bzolnier@gmail.com
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804142228.51987.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18919
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 2871
Lines: 66

Fix these warnings emitted when compiling drivers/ide/mips/au1xxx-ide.c:

include/asm/mach-au1x00/au1xxx_ide.h:137: warning: 'auide_tune_drive' declared 
`static' but never defined
include/asm/mach-au1x00/au1xxx_ide.h:138: warning: 'auide_tune_chipset' declared
 `static' but never defined

by wiping out the whole "function prototyping" section from the header file
<asm-mips/mach-au1x00/au1xxx_ide.h> as it mostly declared functions that are
already dead in the IDE driver; move the only useful prototype into the driver.

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

---
I'm not sure thru which tree this should go -- probably thru Linux/MIPS one...

Bart, au1xxx-ide-fix-mwdma-support.patch will probably need to be updated to
remove that added prototype since it won't be needed anymore...

 drivers/ide/mips/au1xxx-ide.c             |    2 ++
 include/asm-mips/mach-au1x00/au1xxx_ide.h |   18 ------------------
 2 files changed, 2 insertions(+), 18 deletions(-)

Index: linux-2.6/drivers/ide/mips/au1xxx-ide.c
===================================================================
--- linux-2.6.orig/drivers/ide/mips/au1xxx-ide.c
+++ linux-2.6/drivers/ide/mips/au1xxx-ide.c
@@ -56,6 +56,8 @@
 static _auide_hwif auide_hwif;
 static int dbdma_init_done;
 
+static int auide_ddma_init(_auide_hwif *auide);
+
 #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA)
 
 void auide_insw(unsigned long port, void *addr, u32 count)
Index: linux-2.6/include/asm-mips/mach-au1x00/au1xxx_ide.h
===================================================================
--- linux-2.6.orig/include/asm-mips/mach-au1x00/au1xxx_ide.h
+++ linux-2.6/include/asm-mips/mach-au1x00/au1xxx_ide.h
@@ -122,24 +122,6 @@ static const struct drive_list_entry dma
 };
 #endif
 
-/* function prototyping */
-u8 auide_inb(unsigned long port);
-u16 auide_inw(unsigned long port);
-u32 auide_inl(unsigned long port);
-void auide_insw(unsigned long port, void *addr, u32 count);
-void auide_insl(unsigned long port, void *addr, u32 count);
-void auide_outb(u8 addr, unsigned long port);
-void auide_outbsync(ide_drive_t *drive, u8 addr, unsigned long port);
-void auide_outw(u16 addr, unsigned long port);
-void auide_outl(u32 addr, unsigned long port);
-void auide_outsw(unsigned long port, void *addr, u32 count);
-void auide_outsl(unsigned long port, void *addr, u32 count);
-static void auide_tune_drive(ide_drive_t *drive, byte pio);
-static int auide_tune_chipset(ide_drive_t *drive, u8 speed);
-static int auide_ddma_init( _auide_hwif *auide );
-static void auide_setup_ports(hw_regs_t *hw, _auide_hwif *ahwif);
-int __init auide_probe(void);
-
 /*******************************************************************************
 * PIO Mode timing calculation :                                                *
 *                                                                              *


From sshtylyov@ru.mvista.com Mon Apr 14 20:03:42 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 14 Apr 2008 20:03:44 +0100 (BST)
Received: from rtsoft3.corbina.net ([85.21.88.6]:20020 "EHLO
	buildserver.ru.mvista.com") by ftp.linux-mips.org with ESMTP
	id S28573807AbYDNTDm (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 14 Apr 2008 20:03:42 +0100
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id 51E0D8810; Tue, 15 Apr 2008 00:03:41 +0500 (SAMST)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	bzolnier@gmail.com
Subject: [PATCH] Au1200: IDE driver build fix
Date:	Mon, 14 Apr 2008 23:03:04 +0400
User-Agent: KMail/1.5
Cc:	linux-ide@vger.kernel.org, linux-mips@linux-mips.org
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804142303.04661.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18920
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1362
Lines: 44

The driver fails to compile with CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA enabled:

drivers/ide/mips/au1xxx-ide.c: In function `auide_build_dmatable':
drivers/ide/mips/au1xxx-ide.c:256: error: implicit declaration of function
`sg_virt'
drivers/ide/mips/au1xxx-ide.c:275: error: implicit declaration of function
`sg_next'
drivers/ide/mips/au1xxx-ide.c:275: warning: assignment makes pointer from
integer without a cast

Fix this by including <linux/scatterlist.h>. While at it, remove the #include's
without which the driver happily builds.

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

 drivers/ide/mips/au1xxx-ide.c |    9 +--------
 1 files changed, 1 insertion(+), 8 deletions(-)

Index: linux-2.6/drivers/ide/mips/au1xxx-ide.c
===================================================================
--- linux-2.6.orig/drivers/ide/mips/au1xxx-ide.c
+++ linux-2.6/drivers/ide/mips/au1xxx-ide.c
@@ -32,19 +32,12 @@
 #include <linux/kernel.h>
 #include <linux/delay.h>
 #include <linux/platform_device.h>
-
 #include <linux/init.h>
 #include <linux/ide.h>
-#include <linux/sysdev.h>
-
-#include <linux/dma-mapping.h>
+#include <linux/scatterlist.h>
 
-#include "ide-timing.h"
-
-#include <asm/io.h>
 #include <asm/mach-au1x00/au1xxx.h>
 #include <asm/mach-au1x00/au1xxx_dbdma.h>
-
 #include <asm/mach-au1x00/au1xxx_ide.h>
 
 #define DRV_NAME	"au1200-ide"


From anemo@mba.ocn.ne.jp Tue Apr 15 01:51:41 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 15 Apr 2008 01:51:43 +0100 (BST)
Received: from topsns2.toshiba-tops.co.jp ([202.230.225.126]:35639 "EHLO
	topsns2.toshiba-tops.co.jp") by ftp.linux-mips.org with ESMTP
	id S28574198AbYDOAvl (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 15 Apr 2008 01:51:41 +0100
Received: from topsms.toshiba-tops.co.jp by topsns2.toshiba-tops.co.jp
          via smtpd (for [213.58.128.207] [213.58.128.207]) with ESMTP; Tue, 15 Apr 2008 09:51:39 +0900
Received: from topsms.toshiba-tops.co.jp (localhost.localdomain [127.0.0.1])
	by localhost.toshiba-tops.co.jp (Postfix) with ESMTP id 814C04741E;
	Tue, 15 Apr 2008 09:51:35 +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 6DB264741B;
	Tue, 15 Apr 2008 09:51:35 +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 m3F0pYAF056726;
	Tue, 15 Apr 2008 09:51:35 +0900 (JST)
	(envelope-from anemo@mba.ocn.ne.jp)
Date:	Tue, 15 Apr 2008 09:51:34 +0900 (JST)
Message-Id: <20080415.095134.03976245.nemoto@toshiba-tops.co.jp>
To:	ralf@linux-mips.org
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] Do not build spram.o unconditionally
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <20080414144438.GA29804@linux-mips.org>
References: <20080414.224759.130241483.anemo@mba.ocn.ne.jp>
	<20080414144438.GA29804@linux-mips.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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18921
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 455
Lines: 11

On Mon, 14 Apr 2008 15:44:38 +0100, Ralf Baechle <ralf@linux-mips.org> wrote:
> Also folded into the SPRAM patch.  But since not every R2 core has SPRAM
> this should probably be done using a new CONFIG_ symbol.  And the
> CONFIG_CPU_* were always meant for optimization not feature selection.
> So I guess a little more polishing is still needed.  But it's getting
> there.

Thanks, and please do not forget fix cpu-probe.c part too.

---
Atsushi Nemoto

From sshtylyov@ru.mvista.com Tue Apr 15 13:57:37 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 15 Apr 2008 13:57:39 +0100 (BST)
Received: from h155.mvista.com ([63.81.120.155]:30250 "EHLO imap.sh.mvista.com")
	by ftp.linux-mips.org with ESMTP id S28574444AbYDOM5h (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 15 Apr 2008 13:57:37 +0100
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id 09BCC3EC9; Tue, 15 Apr 2008 05:57:33 -0700 (PDT)
Message-ID: <4804A617.5010703@ru.mvista.com>
Date:	Tue, 15 Apr 2008 16:56:55 +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, bzolnier@gmail.com
Cc:	linux-mips@linux-mips.org, linux-ide@vger.kernel.org
Subject: Re: [PATCH] Pb1200/DBAu1200: IDE resource size off by one
References: <200804142107.30799.sshtylyov@ru.mvista.com>
In-Reply-To: <200804142107.30799.sshtylyov@ru.mvista.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18923
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 336
Lines: 9

Hello, I wrote:

> The IDE platform device on Pb1200/DBAu1200 boards claims one byte too many for
> its memory resource -- fix the platform code and the IDE driver in accordance.

    Don't apply this patch yet. It turned out that the resource size is 
actually twice wrong -- 257 ISO 512. I'll send an updated patch soon.

WBR, Sergei

From sshtylyov@ru.mvista.com Tue Apr 15 17:45:13 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 15 Apr 2008 17:45:16 +0100 (BST)
Received: from rtsoft3.corbina.net ([85.21.88.6]:18438 "EHLO
	buildserver.ru.mvista.com") by ftp.linux-mips.org with ESMTP
	id S28574922AbYDOQpN (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 15 Apr 2008 17:45:13 +0100
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id 6F1BC8814; Tue, 15 Apr 2008 21:45:11 +0500 (SAMST)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	linux-mips@linux-mips.org, linux-ide@vger.kernel.org
Subject: [PATCH] Pb1200/DBAu1200: fix bad IDE resource size
Date:	Tue, 15 Apr 2008 20:44:32 +0400
User-Agent: KMail/1.5
Cc:	ralf@linux-mips.org, bzolnier@gmail.com
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <200804152044.32912.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18924
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 3654
Lines: 91

The header files for the Pb1200/DBAu1200 boards have wrong definition for the
IDE interface's  decoded range length -- it should be 512 bytes according to
what the IDE driver does.  In addition, the IDE platform device claims 1 byte
too many for its memory resource -- fix the platform code and the IDE driver
in accordance.

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

---
I'm not sure thru which tree this should go -- probably thru Linux/MIPS one...

 arch/mips/au1000/common/platform.c    |    2 +-
 drivers/ide/mips/au1xxx-ide.c         |    7 ++++---
 include/asm-mips/mach-db1x00/db1200.h |    4 ++--
 include/asm-mips/mach-pb1x00/pb1200.h |    4 ++--
 4 files changed, 9 insertions(+), 8 deletions(-)

Index: linux-2.6/arch/mips/au1000/common/platform.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/platform.c
+++ linux-2.6/arch/mips/au1000/common/platform.c
@@ -189,7 +189,7 @@ static struct resource au1200_lcd_resour
 static struct resource au1200_ide0_resources[] = {
 	[0] = {
 		.start		= AU1XXX_ATA_PHYS_ADDR,
-		.end 		= AU1XXX_ATA_PHYS_ADDR + AU1XXX_ATA_PHYS_LEN,
+		.end 		= AU1XXX_ATA_PHYS_ADDR + AU1XXX_ATA_PHYS_LEN - 1,
 		.flags		= IORESOURCE_MEM,
 	},
 	[1] = {
Index: linux-2.6/drivers/ide/mips/au1xxx-ide.c
===================================================================
--- linux-2.6.orig/drivers/ide/mips/au1xxx-ide.c
+++ linux-2.6/drivers/ide/mips/au1xxx-ide.c
@@ -591,13 +591,14 @@ static int au_ide_probe(struct device *d
 		goto out;
 	}
 
-	if (!request_mem_region (res->start, res->end-res->start, pdev->name)) {
+	if (!request_mem_region(res->start, res->end - res->start + 1,
+				pdev->name)) {
 		pr_debug("%s: request_mem_region failed\n", DRV_NAME);
 		ret =  -EBUSY;
 		goto out;
 	}
 
-	ahwif->regbase = (u32)ioremap(res->start, res->end-res->start);
+	ahwif->regbase = (u32)ioremap(res->start, res->end - res->start + 1);
 	if (ahwif->regbase == 0) {
 		ret = -ENOMEM;
 		goto out;
@@ -682,7 +683,7 @@ static int au_ide_remove(struct device *
 	iounmap((void *)ahwif->regbase);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	release_mem_region(res->start, res->end - res->start);
+	release_mem_region(res->start, res->end - res->start + 1);
 
 	return 0;
 }
Index: linux-2.6/include/asm-mips/mach-db1x00/db1200.h
===================================================================
--- linux-2.6.orig/include/asm-mips/mach-db1x00/db1200.h
+++ linux-2.6/include/asm-mips/mach-db1x00/db1200.h
@@ -173,8 +173,8 @@ static BCSR * const bcsr = (BCSR *)BCSR_
 #define AU1XXX_SMC91111_IRQ			DB1200_ETH_INT
 
 #define AU1XXX_ATA_PHYS_ADDR		(0x18800000)
-#define AU1XXX_ATA_PHYS_LEN			(0x100)
-#define AU1XXX_ATA_REG_OFFSET	(5)
+#define AU1XXX_ATA_REG_OFFSET		(5)
+#define AU1XXX_ATA_PHYS_LEN		(16 << AU1XXX_ATA_REG_OFFSET)
 #define AU1XXX_ATA_INT			DB1200_IDE_INT
 #define AU1XXX_ATA_DDMA_REQ		DSCR_CMD0_DMA_REQ1;
 #define AU1XXX_ATA_RQSIZE		128
Index: linux-2.6/include/asm-mips/mach-pb1x00/pb1200.h
===================================================================
--- linux-2.6.orig/include/asm-mips/mach-pb1x00/pb1200.h
+++ linux-2.6/include/asm-mips/mach-pb1x00/pb1200.h
@@ -186,8 +186,8 @@ static BCSR * const bcsr = (BCSR *)BCSR_
 #define AU1XXX_SMC91111_IRQ			PB1200_ETH_INT
 
 #define AU1XXX_ATA_PHYS_ADDR		(0x0C800000)
-#define AU1XXX_ATA_PHYS_LEN			(0x100)
-#define AU1XXX_ATA_REG_OFFSET	(5)
+#define AU1XXX_ATA_REG_OFFSET		(5)
+#define AU1XXX_ATA_PHYS_LEN		(16 << AU1XXX_ATA_REG_OFFSET)
 #define AU1XXX_ATA_INT			PB1200_IDE_INT
 #define AU1XXX_ATA_DDMA_REQ		DSCR_CMD0_DMA_REQ1;
 #define AU1XXX_ATA_RQSIZE		128


From anemo@mba.ocn.ne.jp Tue Apr 15 17:59:59 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 15 Apr 2008 18:00:03 +0100 (BST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:48354 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S28574755AbYDOQ77 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 15 Apr 2008 17:59:59 +0100
Received: from localhost (p1004-ipad205funabasi.chiba.ocn.ne.jp [222.146.96.4])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 59AB9AF04; Wed, 16 Apr 2008 01:59:50 +0900 (JST)
Date:	Wed, 16 Apr 2008 02:00:45 +0900 (JST)
Message-Id: <20080416.020045.75183728.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] rbtx4927: misc cleanups
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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18925
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 49400
Lines: 1473

* Merge tx4927_pci.h into tx4927.h
* Kill (broken) external PCI clock frequency reporting
* Kill unnecessary wbflush()
* Kill unnecessary includes
* Kill debug garbages

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
Patch against linux-queue tree.

 arch/mips/pci/fixup-rbtx4927.c                     |    1 -
 arch/mips/pci/ops-tx4927.c                         |    5 +-
 arch/mips/tx4927/common/tx4927_dbgio.c             |    5 +-
 arch/mips/tx4927/common/tx4927_prom.c              |    8 +-
 .../tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c |  234 +--------------
 .../toshiba_rbtx4927/toshiba_rbtx4927_prom.c       |    7 +-
 .../toshiba_rbtx4927/toshiba_rbtx4927_setup.c      |  322 +-------------------
 include/asm-mips/tx4927/toshiba_rbtx4927.h         |    4 -
 include/asm-mips/tx4927/tx4927.h                   |  240 ++++++++++++++-
 include/asm-mips/tx4927/tx4927_pci.h               |  268 ----------------
 10 files changed, 266 insertions(+), 828 deletions(-)

diff --git a/arch/mips/pci/fixup-rbtx4927.c b/arch/mips/pci/fixup-rbtx4927.c
index 7450c33..2d234ca 100644
--- a/arch/mips/pci/fixup-rbtx4927.c
+++ b/arch/mips/pci/fixup-rbtx4927.c
@@ -38,7 +38,6 @@
 #include <linux/init.h>
 
 #include <asm/tx4927/tx4927.h>
-#include <asm/tx4927/tx4927_pci.h>
 
 #undef  DEBUG
 #ifdef  DEBUG
diff --git a/arch/mips/pci/ops-tx4927.c b/arch/mips/pci/ops-tx4927.c
index 150419c..1bbafeb 100644
--- a/arch/mips/pci/ops-tx4927.c
+++ b/arch/mips/pci/ops-tx4927.c
@@ -40,10 +40,7 @@
 #include <linux/pci.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
-
-#include <asm/addrspace.h>
-#include <asm/byteorder.h>
-#include <asm/tx4927/tx4927_pci.h>
+#include <asm/tx4927/tx4927.h>
 
 /* initialize in setup */
 struct resource pci_io_resource = {
diff --git a/arch/mips/tx4927/common/tx4927_dbgio.c b/arch/mips/tx4927/common/tx4927_dbgio.c
index d8423e0..ea1ff23 100644
--- a/arch/mips/tx4927/common/tx4927_dbgio.c
+++ b/arch/mips/tx4927/common/tx4927_dbgio.c
@@ -28,9 +28,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-
-#include <asm/mipsregs.h>
-#include <asm/system.h>
+#include <linux/types.h>
 
 u8 getDebugChar(void)
 {
@@ -38,7 +36,6 @@ u8 getDebugChar(void)
 	return (txx9_sio_kdbg_rd());
 }
 
-
 int putDebugChar(u8 byte)
 {
 	extern int txx9_sio_kdbg_wr( u8 ch );
diff --git a/arch/mips/tx4927/common/tx4927_prom.c b/arch/mips/tx4927/common/tx4927_prom.c
index 6eed53d..cc2aa9d 100644
--- a/arch/mips/tx4927/common/tx4927_prom.c
+++ b/arch/mips/tx4927/common/tx4927_prom.c
@@ -30,12 +30,8 @@
  */
 
 #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/types.h>
+#include <linux/io.h>
 #include <asm/tx4927/tx4927.h>
 
 static unsigned int __init tx4927_process_sdccr(unsigned long addr)
diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
index 6d31f2a..c18901a 100644
--- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
+++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
@@ -28,8 +28,6 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-
-
 /*
 IRQ  Device
 00   RBTX4927-ISA/00
@@ -112,76 +110,14 @@ JP7 is not bus master -- do NOT use -- only 4 pci bus master's allowed -- SouthB
 */
 
 #include <linux/init.h>
-#include <linux/kernel.h>
 #include <linux/types.h>
-#include <linux/mm.h>
-#include <linux/swap.h>
-#include <linux/ioport.h>
-#include <linux/sched.h>
 #include <linux/interrupt.h>
-#include <linux/pci.h>
-#include <linux/timex.h>
-#include <asm/bootinfo.h>
-#include <asm/page.h>
 #include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/pci.h>
-#include <asm/processor.h>
-#include <asm/reboot.h>
-#include <asm/time.h>
-#include <asm/wbflush.h>
-#include <linux/bootmem.h>
-#include <linux/blkdev.h>
 #ifdef CONFIG_TOSHIBA_FPCIB0
 #include <asm/i8259.h>
-#include <asm/tx4927/smsc_fdc37m81x.h>
 #endif
 #include <asm/tx4927/toshiba_rbtx4927.h>
 
-
-#undef TOSHIBA_RBTX4927_IRQ_DEBUG
-
-#ifdef TOSHIBA_RBTX4927_IRQ_DEBUG
-#define TOSHIBA_RBTX4927_IRQ_NONE        0x00000000
-
-#define TOSHIBA_RBTX4927_IRQ_INFO          ( 1 <<  0 )
-#define TOSHIBA_RBTX4927_IRQ_WARN          ( 1 <<  1 )
-#define TOSHIBA_RBTX4927_IRQ_EROR          ( 1 <<  2 )
-
-#define TOSHIBA_RBTX4927_IRQ_IOC_INIT      ( 1 << 10 )
-#define TOSHIBA_RBTX4927_IRQ_IOC_ENABLE    ( 1 << 13 )
-#define TOSHIBA_RBTX4927_IRQ_IOC_DISABLE   ( 1 << 14 )
-
-#define TOSHIBA_RBTX4927_SETUP_ALL         0xffffffff
-#endif
-
-
-#ifdef TOSHIBA_RBTX4927_IRQ_DEBUG
-static const u32 toshiba_rbtx4927_irq_debug_flag =
-    (TOSHIBA_RBTX4927_IRQ_NONE | TOSHIBA_RBTX4927_IRQ_INFO |
-     TOSHIBA_RBTX4927_IRQ_WARN | TOSHIBA_RBTX4927_IRQ_EROR
-//                                                 | TOSHIBA_RBTX4927_IRQ_IOC_INIT
-//                                                 | TOSHIBA_RBTX4927_IRQ_IOC_ENABLE
-//                                                 | TOSHIBA_RBTX4927_IRQ_IOC_DISABLE
-    );
-#endif
-
-
-#ifdef TOSHIBA_RBTX4927_IRQ_DEBUG
-#define TOSHIBA_RBTX4927_IRQ_DPRINTK(flag,str...) \
-        if ( (toshiba_rbtx4927_irq_debug_flag) & (flag) ) \
-        { \
-           char tmp[100]; \
-           sprintf( tmp, str ); \
-           printk( "%s(%s:%u)::%s", __func__, __FILE__, __LINE__, tmp ); \
-        }
-#else
-#define TOSHIBA_RBTX4927_IRQ_DPRINTK(flag, str...)
-#endif
-
-
-
-
 #define TOSHIBA_RBTX4927_IRQ_IOC_RAW_BEG   0
 #define TOSHIBA_RBTX4927_IRQ_IOC_RAW_END   7
 
@@ -207,39 +143,22 @@ static struct irq_chip toshiba_rbtx4927_irq_ioc_type = {
 #define TOSHIBA_RBTX4927_IOC_INTR_ENAB (void __iomem *)0xbc002000UL
 #define TOSHIBA_RBTX4927_IOC_INTR_STAT (void __iomem *)0xbc002006UL
 
-
-u32 bit2num(u32 num)
-{
-	u32 i;
-
-	for (i = 0; i < (sizeof(num) * 8); i++) {
-		if (num & (1 << i)) {
-			return (i);
-		}
-	}
-	return (0);
-}
-
 int toshiba_rbtx4927_irq_nested(int sw_irq)
 {
-	u32 level3;
+	u8 level3;
 
 	level3 = readb(TOSHIBA_RBTX4927_IOC_INTR_STAT) & 0x1f;
 	if (level3) {
-		sw_irq = TOSHIBA_RBTX4927_IRQ_IOC_BEG + bit2num(level3);
-		if (sw_irq != TOSHIBA_RBTX4927_IRQ_NEST_ISA_ON_IOC) {
-			goto RETURN;
-		}
-	}
+		sw_irq = TOSHIBA_RBTX4927_IRQ_IOC_BEG + fls(level3) - 1;
 #ifdef CONFIG_TOSHIBA_FPCIB0
-	if (tx4927_using_backplane) {
-		int irq = i8259_irq();
-		if (irq >= 0)
-			sw_irq = irq;
-	}
+		if (sw_irq == TOSHIBA_RBTX4927_IRQ_NEST_ISA_ON_IOC &&
+		    tx4927_using_backplane) {
+			int irq = i8259_irq();
+			if (irq >= 0)
+				sw_irq = irq;
+		}
 #endif
-
-      RETURN:
+	}
 	return (sw_irq);
 }
 
@@ -250,21 +169,10 @@ static struct irqaction toshiba_rbtx4927_irq_ioc_action = {
 	.name		= TOSHIBA_RBTX4927_IOC_NAME
 };
 
-
-/**********************************************************************************/
-/* Functions for ioc                                                              */
-/**********************************************************************************/
-
-
 static void __init toshiba_rbtx4927_irq_ioc_init(void)
 {
 	int i;
 
-	TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_IOC_INIT,
-				     "beg=%d end=%d\n",
-				     TOSHIBA_RBTX4927_IRQ_IOC_BEG,
-				     TOSHIBA_RBTX4927_IRQ_IOC_END);
-
 	for (i = TOSHIBA_RBTX4927_IRQ_IOC_BEG;
 	     i <= TOSHIBA_RBTX4927_IRQ_IOC_END; i++)
 		set_irq_chip_and_handler(i, &toshiba_rbtx4927_irq_ioc_type,
@@ -276,37 +184,16 @@ static void __init toshiba_rbtx4927_irq_ioc_init(void)
 
 static void toshiba_rbtx4927_irq_ioc_enable(unsigned int irq)
 {
-	volatile unsigned char v;
-
-	TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_IOC_ENABLE,
-				     "irq=%d\n", irq);
-
-	if (irq < TOSHIBA_RBTX4927_IRQ_IOC_BEG
-	    || irq > TOSHIBA_RBTX4927_IRQ_IOC_END) {
-		TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_EROR,
-					     "bad irq=%d\n", irq);
-		panic("\n");
-	}
+	unsigned char v;
 
 	v = readb(TOSHIBA_RBTX4927_IOC_INTR_ENAB);
 	v |= (1 << (irq - TOSHIBA_RBTX4927_IRQ_IOC_BEG));
 	writeb(v, TOSHIBA_RBTX4927_IOC_INTR_ENAB);
 }
 
-
 static void toshiba_rbtx4927_irq_ioc_disable(unsigned int irq)
 {
-	volatile unsigned char v;
-
-	TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_IOC_DISABLE,
-				     "irq=%d\n", irq);
-
-	if (irq < TOSHIBA_RBTX4927_IRQ_IOC_BEG
-	    || irq > TOSHIBA_RBTX4927_IRQ_IOC_END) {
-		TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_EROR,
-					     "bad irq=%d\n", irq);
-		panic("\n");
-	}
+	unsigned char v;
 
 	v = readb(TOSHIBA_RBTX4927_IOC_INTR_ENAB);
 	v &= ~(1 << (irq - TOSHIBA_RBTX4927_IRQ_IOC_BEG));
@@ -314,7 +201,6 @@ static void toshiba_rbtx4927_irq_ioc_disable(unsigned int irq)
 	mmiowb();
 }
 
-
 void __init arch_init_irq(void)
 {
 	extern void tx4927_irq_init(void);
@@ -327,102 +213,4 @@ void __init arch_init_irq(void)
 #endif
 	/* Onboard 10M Ether: High Active */
 	set_irq_type(RBTX4927_RTL_8019_IRQ, IRQF_TRIGGER_HIGH);
-
-	wbflush();
-}
-
-void toshiba_rbtx4927_irq_dump(char *key)
-{
-#ifdef TOSHIBA_RBTX4927_IRQ_DEBUG
-	{
-		u32 i, j = 0;
-		for (i = 0; i < NR_IRQS; i++) {
-			if (strcmp(irq_desc[i].chip->name, "none")
-			    == 0)
-				continue;
-
-			if ((i >= 1)
-			    && (irq_desc[i - 1].chip->name ==
-				irq_desc[i].chip->name)) {
-				j++;
-			} else {
-				j = 0;
-			}
-			TOSHIBA_RBTX4927_IRQ_DPRINTK
-			    (TOSHIBA_RBTX4927_IRQ_INFO,
-			     "%s irq=0x%02x/%3d s=0x%08x h=0x%08x a=0x%08x ah=0x%08x d=%1d n=%s/%02d\n",
-			     key, i, i, irq_desc[i].status,
-			     (u32) irq_desc[i].chip,
-			     (u32) irq_desc[i].action,
-			     (u32) (irq_desc[i].action ? irq_desc[i].
-				    action->handler : 0),
-			     irq_desc[i].depth,
-			     irq_desc[i].chip->name, j);
-		}
-	}
-#endif
-}
-
-void toshiba_rbtx4927_irq_dump_pics(char *s)
-{
-	u32 level0_m;
-	u32 level0_s;
-	u32 level1_m;
-	u32 level1_s;
-	u32 level2;
-	u32 level2_p;
-	u32 level2_s;
-	u32 level3_m;
-	u32 level3_s;
-	u32 level4_m;
-	u32 level4_s;
-	u32 level5_m;
-	u32 level5_s;
-
-	if (s == NULL)
-		s = "null";
-
-	level0_m = (read_c0_status() & 0x0000ff00) >> 8;
-	level0_s = (read_c0_cause() & 0x0000ff00) >> 8;
-
-	level1_m = level0_m;
-	level1_s = level0_s & 0x87;
-
-	level2 = __raw_readl((void __iomem *)0xff1ff6a0UL);
-	level2_p = (((level2 & 0x10000)) ? 0 : 1);
-	level2_s = (((level2 & 0x1f) == 0x1f) ? 0 : (level2 & 0x1f));
-
-	level3_m = readb(TOSHIBA_RBTX4927_IOC_INTR_ENAB) & 0x1f;
-	level3_s = readb(TOSHIBA_RBTX4927_IOC_INTR_STAT) & 0x1f;
-
-	level4_m = inb(0x21);
-	outb(0x0A, 0x20);
-	level4_s = inb(0x20);
-
-	level5_m = inb(0xa1);
-	outb(0x0A, 0xa0);
-	level5_s = inb(0xa0);
-
-	TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_INFO,
-				     "dump_raw_pic() ");
-	TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_INFO,
-				     "cp0:m=0x%02x/s=0x%02x ", level0_m,
-				     level0_s);
-	TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_INFO,
-				     "cp0:m=0x%02x/s=0x%02x ", level1_m,
-				     level1_s);
-	TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_INFO,
-				     "pic:e=0x%02x/s=0x%02x ", level2_p,
-				     level2_s);
-	TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_INFO,
-				     "ioc:m=0x%02x/s=0x%02x ", level3_m,
-				     level3_s);
-	TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_INFO,
-				     "sbm:m=0x%02x/s=0x%02x ", level4_m,
-				     level4_s);
-	TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_INFO,
-				     "sbs:m=0x%02x/s=0x%02x ", level5_m,
-				     level5_s);
-	TOSHIBA_RBTX4927_IRQ_DPRINTK(TOSHIBA_RBTX4927_IRQ_INFO, "[%s]\n",
-				     s);
 }
diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_prom.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_prom.c
index f3f8685..fdbad4b 100644
--- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_prom.c
+++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_prom.c
@@ -30,13 +30,10 @@
  *  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 <linux/string.h>
 #include <asm/bootinfo.h>
 #include <asm/cpu.h>
+#include <asm/mipsregs.h>
 #include <asm/tx4927/tx4927.h>
 
 void __init prom_init_cmdline(void)
diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
index 2203c77..185f303 100644
--- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
+++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
@@ -62,43 +62,10 @@
 #include <asm/tx4927/smsc_fdc37m81x.h>
 #endif
 #include <asm/tx4927/toshiba_rbtx4927.h>
-#ifdef CONFIG_PCI
-#include <asm/tx4927/tx4927_pci.h>
-#endif
 #ifdef CONFIG_SERIAL_TXX9
 #include <linux/serial_core.h>
 #endif
 
-#undef TOSHIBA_RBTX4927_SETUP_DEBUG
-
-#ifdef TOSHIBA_RBTX4927_SETUP_DEBUG
-#define TOSHIBA_RBTX4927_SETUP_SETUP       ( 1 <<  4 )
-#define TOSHIBA_RBTX4927_SETUP_PCIBIOS     ( 1 <<  7 )
-#define TOSHIBA_RBTX4927_SETUP_PCI1        ( 1 <<  8 )
-#define TOSHIBA_RBTX4927_SETUP_PCI2        ( 1 <<  9 )
-
-#define TOSHIBA_RBTX4927_SETUP_ALL         0xffffffff
-#endif
-
-#ifdef TOSHIBA_RBTX4927_SETUP_DEBUG
-static const u32 toshiba_rbtx4927_setup_debug_flag =
-    (TOSHIBA_RBTX4927_SETUP_SETUP |
-     | TOSHIBA_RBTX4927_SETUP_PCIBIOS | TOSHIBA_RBTX4927_SETUP_PCI1 |
-     TOSHIBA_RBTX4927_SETUP_PCI2);
-#endif
-
-#ifdef TOSHIBA_RBTX4927_SETUP_DEBUG
-#define TOSHIBA_RBTX4927_SETUP_DPRINTK(flag,str...) \
-        if ( (toshiba_rbtx4927_setup_debug_flag) & (flag) ) \
-        { \
-           char tmp[100]; \
-           sprintf( tmp, str ); \
-           printk( "%s(%s:%u)::%s", __func__, __FILE__, __LINE__, tmp ); \
-        }
-#else
-#define TOSHIBA_RBTX4927_SETUP_DPRINTK(flag, str...)
-#endif
-
 /* These functions are used for rebooting or halting the machine*/
 extern void toshiba_rbtx4927_restart(char *command);
 extern void toshiba_rbtx4927_halt(void);
@@ -124,7 +91,6 @@ unsigned long mips_memory_upper;
 static int tx4927_ccfg_toeon = 1;
 static int tx4927_pcic_trdyto = 0;	/* default: disabled */
 unsigned long tx4927_ce_base[8];
-void tx4927_reset_pci_pcic(void);
 int tx4927_pci66 = 0;		/* 0:auto */
 #endif
 
@@ -172,9 +138,6 @@ static int __init tx4927_pcibios_init(void)
 	int busno = 0; /* One bus on the Toshiba */
 	struct pci_controller *hose = &tx4927_controller;
 
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-				       "-\n");
-
 	for (pci_devfn = devfn_start; pci_devfn < devfn_stop; pci_devfn++) {
 		early_read_config_dword(hose, busno, busno, pci_devfn,
 					PCI_VENDOR_ID, &id);
@@ -187,13 +150,6 @@ static int __init tx4927_pcibios_init(void)
 			u8 v08_64;
 			u32 v32_b0;
 			u8 v08_e1;
-#ifdef TOSHIBA_RBTX4927_SETUP_DEBUG
-			char *s = " sb/isa --";
-#endif
-
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_PCIBIOS, ":%s beg\n",
-			     s);
 
 			early_read_config_byte(hose, busno, busno,
 					       pci_devfn, 0x64, &v08_64);
@@ -202,16 +158,6 @@ static int __init tx4927_pcibios_init(void)
 			early_read_config_byte(hose, busno, busno,
 					       pci_devfn, 0xe1, &v08_e1);
 
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-			     ":%s beg 0x64 = 0x%02x\n", s, v08_64);
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-			     ":%s beg 0xb0 = 0x%02x\n", s, v32_b0);
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-			     ":%s beg 0xe1 = 0x%02x\n", s, v08_e1);
-
 			/* serial irq control */
 			v08_64 = 0xd0;
 
@@ -222,50 +168,12 @@ static int __init tx4927_pcibios_init(void)
 			v08_e1 &= 0xf0;
 			v08_e1 |= 0x0d;
 
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-			     ":%s mid 0x64 = 0x%02x\n", s, v08_64);
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-			     ":%s mid 0xb0 = 0x%02x\n", s, v32_b0);
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-			     ":%s mid 0xe1 = 0x%02x\n", s, v08_e1);
-
 			early_write_config_byte(hose, busno, busno,
 						pci_devfn, 0x64, v08_64);
 			early_write_config_dword(hose, busno, busno,
 						 pci_devfn, 0xb0, v32_b0);
 			early_write_config_byte(hose, busno, busno,
 						pci_devfn, 0xe1, v08_e1);
-
-#ifdef TOSHIBA_RBTX4927_SETUP_DEBUG
-			{
-				early_read_config_byte(hose, busno, busno,
-						       pci_devfn, 0x64,
-						       &v08_64);
-				early_read_config_dword(hose, busno, busno,
-							pci_devfn, 0xb0,
-							&v32_b0);
-				early_read_config_byte(hose, busno, busno,
-						       pci_devfn, 0xe1,
-						       &v08_e1);
-
-				TOSHIBA_RBTX4927_SETUP_DPRINTK
-				    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-				     ":%s end 0x64 = 0x%02x\n", s, v08_64);
-				TOSHIBA_RBTX4927_SETUP_DPRINTK
-				    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-				     ":%s end 0xb0 = 0x%02x\n", s, v32_b0);
-				TOSHIBA_RBTX4927_SETUP_DPRINTK
-				    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-				     ":%s end 0xe1 = 0x%02x\n", s, v08_e1);
-			}
-#endif
-
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_PCIBIOS, ":%s end\n",
-			     s);
 		}
 
 		if (id == 0x91301055) {
@@ -274,13 +182,6 @@ static int __init tx4927_pcibios_init(void)
 			u8 v08_41;
 			u8 v08_43;
 			u8 v08_5c;
-#ifdef TOSHIBA_RBTX4927_SETUP_DEBUG
-			char *s = " sb/ide --";
-#endif
-
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_PCIBIOS, ":%s beg\n",
-			     s);
 
 			early_read_config_byte(hose, busno, busno,
 					       pci_devfn, 0x04, &v08_04);
@@ -293,22 +194,6 @@ static int __init tx4927_pcibios_init(void)
 			early_read_config_byte(hose, busno, busno,
 					       pci_devfn, 0x5c, &v08_5c);
 
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-			     ":%s beg 0x04 = 0x%02x\n", s, v08_04);
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-			     ":%s beg 0x09 = 0x%02x\n", s, v08_09);
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-			     ":%s beg 0x41 = 0x%02x\n", s, v08_41);
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-			     ":%s beg 0x43 = 0x%02x\n", s, v08_43);
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-			     ":%s beg 0x5c = 0x%02x\n", s, v08_5c);
-
 			/* enable ide master/io */
 			v08_04 |= (PCI_COMMAND_MASTER | PCI_COMMAND_IO);
 
@@ -332,22 +217,6 @@ static int __init tx4927_pcibios_init(void)
 			 */
 			v08_5c |= 0x01;
 
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-			     ":%s mid 0x04 = 0x%02x\n", s, v08_04);
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-			     ":%s mid 0x09 = 0x%02x\n", s, v08_09);
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-			     ":%s mid 0x41 = 0x%02x\n", s, v08_41);
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-			     ":%s mid 0x43 = 0x%02x\n", s, v08_43);
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-			     ":%s mid 0x5c = 0x%02x\n", s, v08_5c);
-
 			early_write_config_byte(hose, busno, busno,
 						pci_devfn, 0x5c, v08_5c);
 			early_write_config_byte(hose, busno, busno,
@@ -358,54 +227,11 @@ static int __init tx4927_pcibios_init(void)
 						pci_devfn, 0x41, v08_41);
 			early_write_config_byte(hose, busno, busno,
 						pci_devfn, 0x43, v08_43);
-
-#ifdef TOSHIBA_RBTX4927_SETUP_DEBUG
-			{
-				early_read_config_byte(hose, busno, busno,
-						       pci_devfn, 0x04,
-						       &v08_04);
-				early_read_config_byte(hose, busno, busno,
-						       pci_devfn, 0x09,
-						       &v08_09);
-				early_read_config_byte(hose, busno, busno,
-						       pci_devfn, 0x41,
-						       &v08_41);
-				early_read_config_byte(hose, busno, busno,
-						       pci_devfn, 0x43,
-						       &v08_43);
-				early_read_config_byte(hose, busno, busno,
-						       pci_devfn, 0x5c,
-						       &v08_5c);
-
-				TOSHIBA_RBTX4927_SETUP_DPRINTK
-				    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-				     ":%s end 0x04 = 0x%02x\n", s, v08_04);
-				TOSHIBA_RBTX4927_SETUP_DPRINTK
-				    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-				     ":%s end 0x09 = 0x%02x\n", s, v08_09);
-				TOSHIBA_RBTX4927_SETUP_DPRINTK
-				    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-				     ":%s end 0x41 = 0x%02x\n", s, v08_41);
-				TOSHIBA_RBTX4927_SETUP_DPRINTK
-				    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-				     ":%s end 0x43 = 0x%02x\n", s, v08_43);
-				TOSHIBA_RBTX4927_SETUP_DPRINTK
-				    (TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-				     ":%s end 0x5c = 0x%02x\n", s, v08_5c);
-			}
-#endif
-
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_PCIBIOS, ":%s end\n",
-			     s);
 		}
 
 	}
 
 	register_pci_controller(&tx4927_controller);
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCIBIOS,
-				       "+\n");
-
 	return 0;
 }
 
@@ -419,45 +245,13 @@ void __init tx4927_pci_setup(void)
 	static int called = 0;
 	extern unsigned int tx4927_get_mem_size(void);
 
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2, "-\n");
-
 	mips_memory_upper = tx4927_get_mem_size() << 20;
 	mips_memory_upper += KSEG0;
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
-				       "0x%08lx=mips_memory_upper\n",
-				       mips_memory_upper);
 	mips_pci_io_base = TX4927_PCIIO;
 	mips_pci_io_size = TX4927_PCIIO_SIZE;
 	mips_pci_mem_base = TX4927_PCIMEM;
 	mips_pci_mem_size = TX4927_PCIMEM_SIZE;
 
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
-				       "0x%08lx=mips_pci_io_base\n",
-				       mips_pci_io_base);
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
-				       "0x%08lx=mips_pci_io_size\n",
-				       mips_pci_io_size);
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
-				       "0x%08lx=mips_pci_mem_base\n",
-				       mips_pci_mem_base);
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
-				       "0x%08lx=mips_pci_mem_size\n",
-				       mips_pci_mem_size);
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
-				       "0x%08lx=pci_io_resource.start\n",
-				       pci_io_resource.start);
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
-				       "0x%08lx=pci_io_resource.end\n",
-				       pci_io_resource.end);
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
-				       "0x%08lx=pci_mem_resource.start\n",
-				       pci_mem_resource.start);
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
-				       "0x%08lx=pci_mem_resource.end\n",
-				       pci_mem_resource.end);
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
-				       "0x%08lx=mips_io_port_base",
-				       mips_io_port_base);
 	if (!called) {
 		printk
 		    ("%s PCIC -- DID:%04x VID:%04x RID:%02x Arbiter:%s\n",
@@ -521,29 +315,10 @@ void __init tx4927_pci_setup(void)
 			}
 
 		printk("Internal(%dMHz)", pciclk / 1000000);
-	} else {
-		int pciclk = 0;
-		int pciclk_setting = *tx4927_pci_clk_ptr;
-		switch (pciclk_setting & TX4927_PCI_CLK_MASK) {
-		case TX4927_PCI_CLK_33:
-			pciclk = 33333333;
-			break;
-		case TX4927_PCI_CLK_25:
-			pciclk = 25000000;
-			break;
-		case TX4927_PCI_CLK_66:
-			pciclk = 66666666;
-			break;
-		case TX4927_PCI_CLK_50:
-			pciclk = 50000000;
-			break;
-		}
-		printk("External(%dMHz)", pciclk / 1000000);
-	}
+	} else
+		printk("External");
 	printk("\n");
 
-
-
 	/* GB->PCI mappings */
 	tx4927_pcicptr->g2piomask = (mips_pci_io_size - 1) >> 4;
 	tx4927_pcicptr->g2piogbase = mips_pci_io_base |
@@ -644,12 +419,7 @@ void __init tx4927_pci_setup(void)
 	tx4927_pcicptr->pcistatus = PCI_COMMAND_MASTER |
 	    PCI_COMMAND_MEMORY |
 	    PCI_COMMAND_PARITY | PCI_COMMAND_SERR;
-
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2,
-				       ":pci setup complete:\n");
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI2, "+\n");
 }
-
 #endif /* CONFIG_PCI */
 
 static void __noreturn wait_forever(void)
@@ -679,7 +449,6 @@ void toshiba_rbtx4927_restart(char *command)
 	/* no return */
 }
 
-
 void toshiba_rbtx4927_halt(void)
 {
 	printk(KERN_NOTICE "System Halted\n");
@@ -702,33 +471,19 @@ void __init plat_mem_setup(void)
 
 	printk("CPU is %s\n", toshiba_name);
 
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
-				       "-\n");
-
 	/* f/w leaves this on at startup */
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
-				       ":Clearing STO_ERL.\n");
 	clear_c0_status(ST0_ERL);
 
 	/* enable caches -- HCP5 does this, pmon does not */
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
-				       ":Enabling TX49_CONF_IC,TX49_CONF_DC.\n");
 	cp0_config = read_c0_config();
 	cp0_config = cp0_config & ~(TX49_CONF_IC | TX49_CONF_DC);
 	write_c0_config(cp0_config);
 
 	set_io_port_base(KSEG1 + TBTX4927_ISA_IO_OFFSET);
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
-				       ":mips_io_port_base=0x%08lx\n",
-				       mips_io_port_base);
 
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
-				       ":Resource\n");
 	ioport_resource.end = 0xffffffff;
 	iomem_resource.end = 0xffffffff;
 
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
-				       ":ResetRoutines\n");
 	_machine_restart = toshiba_rbtx4927_restart;
 	_machine_halt = toshiba_rbtx4927_halt;
 	pm_power_off = toshiba_rbtx4927_power_off;
@@ -761,23 +516,6 @@ void __init plat_mem_setup(void)
 	   * CPU 333MHz: PCI 66MHz : PCIDIVMODE: 101 (1/5)
 	   *
 	 */
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI1,
-				       "ccfg is %lx, PCIDIVMODE is %x\n",
-				       (unsigned long) tx4927_ccfgptr->ccfg,
-				       (unsigned long) tx4927_ccfgptr->ccfg &
-				       (mips_machtype == MACH_TOSHIBA_RBTX4937 ?
-					TX4937_CCFG_PCIDIVMODE_MASK :
-					TX4927_CCFG_PCIDIVMODE_MASK));
-
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_PCI1,
-				       "PCI66 mode is %lx, PCI mode is %lx, pci arb is %lx\n",
-				       (unsigned long) tx4927_ccfgptr->
-				       ccfg & TX4927_CCFG_PCI66,
-				       (unsigned long) tx4927_ccfgptr->
-				       ccfg & TX4927_CCFG_PCIMIDE,
-				       (unsigned long) tx4927_ccfgptr->
-				       ccfg & TX4927_CCFG_PCIXARB);
-
 	if (mips_machtype == MACH_TOSHIBA_RBTX4937)
 		switch ((unsigned long)tx4927_ccfgptr->
 			ccfg & TX4937_CCFG_PCIDIVMODE_MASK) {
@@ -818,49 +556,18 @@ void __init plat_mem_setup(void)
 
 	/* this is on ISA bus behind PCI bus, so need PCI up first */
 #ifdef CONFIG_TOSHIBA_FPCIB0
-	{
-		if (tx4927_using_backplane) {
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_SETUP,
-			     ":fpcibo=yes\n");
-
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_SETUP,
-			     ":smsc_fdc37m81x_init()\n");
-			smsc_fdc37m81x_init(0x3f0);
-
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_SETUP,
-			     ":smsc_fdc37m81x_config_beg()\n");
-			smsc_fdc37m81x_config_beg();
-
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_SETUP,
-			     ":smsc_fdc37m81x_config_set(KBD)\n");
-			smsc_fdc37m81x_config_set(SMSC_FDC37M81X_DNUM,
-						  SMSC_FDC37M81X_KBD);
-			smsc_fdc37m81x_config_set(SMSC_FDC37M81X_INT, 1);
-			smsc_fdc37m81x_config_set(SMSC_FDC37M81X_INT2, 12);
-			smsc_fdc37m81x_config_set(SMSC_FDC37M81X_ACTIVE,
-						  1);
-
-			smsc_fdc37m81x_config_end();
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_SETUP,
-			     ":smsc_fdc37m81x_config_end()\n");
-		} else {
-			TOSHIBA_RBTX4927_SETUP_DPRINTK
-			    (TOSHIBA_RBTX4927_SETUP_SETUP,
-			     ":fpcibo=not_found\n");
-		}
-	}
-#else
-	{
-		TOSHIBA_RBTX4927_SETUP_DPRINTK
-		    (TOSHIBA_RBTX4927_SETUP_SETUP, ":fpcibo=no\n");
+	if (tx4927_using_backplane) {
+		smsc_fdc37m81x_init(0x3f0);
+		smsc_fdc37m81x_config_beg();
+		smsc_fdc37m81x_config_set(SMSC_FDC37M81X_DNUM,
+					  SMSC_FDC37M81X_KBD);
+		smsc_fdc37m81x_config_set(SMSC_FDC37M81X_INT, 1);
+		smsc_fdc37m81x_config_set(SMSC_FDC37M81X_INT2, 12);
+		smsc_fdc37m81x_config_set(SMSC_FDC37M81X_ACTIVE,
+					  1);
+		smsc_fdc37m81x_config_end();
 	}
 #endif
-
 #endif /* CONFIG_PCI */
 
 #ifdef CONFIG_SERIAL_TXX9
@@ -894,17 +601,12 @@ void __init plat_mem_setup(void)
         }
 #endif
 
-
 #ifdef CONFIG_IP_PNP
         argptr = prom_getcmdline();
         if (strstr(argptr, "ip=") == NULL) {
                 strcat(argptr, " ip=any");
         }
 #endif
-
-
-	TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
-			       "+\n");
 }
 
 void __init plat_time_init(void)
diff --git a/include/asm-mips/tx4927/toshiba_rbtx4927.h b/include/asm-mips/tx4927/toshiba_rbtx4927.h
index b188a65..d6b32ac 100644
--- a/include/asm-mips/tx4927/toshiba_rbtx4927.h
+++ b/include/asm-mips/tx4927/toshiba_rbtx4927.h
@@ -28,9 +28,6 @@
 #define __ASM_TX4927_TOSHIBA_RBTX4927_H
 
 #include <asm/tx4927/tx4927.h>
-#ifdef CONFIG_PCI
-#include <asm/tx4927/tx4927_pci.h>
-#endif
 
 #ifdef CONFIG_PCI
 #define TBTX4927_ISA_IO_OFFSET TX4927_PCIIO
@@ -44,7 +41,6 @@
 #define RBTX4927_SW_RESET_ENABLE     (void __iomem *)0xbc00f002UL
 #define RBTX4927_SW_RESET_ENABLE_SET            0x01
 
-
 #define RBTX4927_RTL_8019_BASE (0x1c020280-TBTX4927_ISA_IO_OFFSET)
 #define RBTX4927_RTL_8019_IRQ  (TX4927_IRQ_PIC_BEG + 5)
 
diff --git a/include/asm-mips/tx4927/tx4927.h b/include/asm-mips/tx4927/tx4927.h
index 193e80a..1d4816f 100644
--- a/include/asm-mips/tx4927/tx4927.h
+++ b/include/asm-mips/tx4927/tx4927.h
@@ -36,11 +36,245 @@
 #define TX4927_IRQ_PIC_END  (TXX9_IRQ_BASE + TXx9_MAX_IR - 1)
 
 
-#define TX4927_IRQ_USER0            (TX4927_IRQ_CP0_BEG+0)
-#define TX4927_IRQ_USER1            (TX4927_IRQ_CP0_BEG+1)
+#define TX4927_IRQ_USER0	    (TX4927_IRQ_CP0_BEG+0)
+#define TX4927_IRQ_USER1	    (TX4927_IRQ_CP0_BEG+1)
 #define TX4927_IRQ_NEST_PIC_ON_CP0  (TX4927_IRQ_CP0_BEG+2)
-#define TX4927_IRQ_CPU_TIMER        (TX4927_IRQ_CP0_BEG+7)
+#define TX4927_IRQ_CPU_TIMER	    (TX4927_IRQ_CP0_BEG+7)
 
 #define TX4927_IRQ_NEST_EXT_ON_PIC  (TX4927_IRQ_PIC_BEG+3)
 
+#define TX4927_CCFG_TOE 0x00004000
+#define TX4927_CCFG_WR	0x00008000
+#define TX4927_CCFG_TINTDIS	0x01000000
+
+#define TX4927_PCIMEM	   0x08000000
+#define TX4927_PCIMEM_SIZE 0x08000000
+#define TX4927_PCIIO	   0x16000000
+#define TX4927_PCIIO_SIZE  0x01000000
+
+#define TX4927_SDRAMC_REG	0xff1f8000
+#define TX4927_EBUSC_REG	0xff1f9000
+#define TX4927_PCIC_REG		0xff1fd000
+#define TX4927_CCFG_REG		0xff1fe000
+#define TX4927_IRC_REG		0xff1ff600
+#define TX4927_NR_TMR	3
+#define TX4927_TMR_REG(ch)	(0xff1ff000 + (ch) * 0x100)
+
+/* bits for ISTAT3/IMASK3/IMSTAT3 */
+#define TX4927_INT3B_PCID	0
+#define TX4927_INT3B_PCIC	1
+#define TX4927_INT3B_PCIB	2
+#define TX4927_INT3B_PCIA	3
+#define TX4927_INT3F_PCID	(1 << TX4927_INT3B_PCID)
+#define TX4927_INT3F_PCIC	(1 << TX4927_INT3B_PCIC)
+#define TX4927_INT3F_PCIB	(1 << TX4927_INT3B_PCIB)
+#define TX4927_INT3F_PCIA	(1 << TX4927_INT3B_PCIA)
+
+#define TX4927_NR_IRQ_LOCAL	TX4927_IRQ_PIC_BEG
+#define TX4927_NR_IRQ_IRC	32	/* On-Chip IRC */
+
+#define TX4927_IR_PCIC		16
+#define TX4927_IR_PCIERR	22
+#define TX4927_IR_PCIPMA	23
+#define TX4927_IRQ_IRC_PCIC	(TX4927_NR_IRQ_LOCAL + TX4927_IR_PCIC)
+#define TX4927_IRQ_IRC_PCIERR	(TX4927_NR_IRQ_LOCAL + TX4927_IR_PCIERR)
+#define TX4927_IRQ_IOC1		(TX4927_NR_IRQ_LOCAL + TX4927_NR_IRQ_IRC)
+#define TX4927_IRQ_IOC_PCID	(TX4927_IRQ_IOC1 + TX4927_INT3B_PCID)
+#define TX4927_IRQ_IOC_PCIC	(TX4927_IRQ_IOC1 + TX4927_INT3B_PCIC)
+#define TX4927_IRQ_IOC_PCIB	(TX4927_IRQ_IOC1 + TX4927_INT3B_PCIB)
+#define TX4927_IRQ_IOC_PCIA	(TX4927_IRQ_IOC1 + TX4927_INT3B_PCIA)
+
+#ifdef _LANGUAGE_ASSEMBLY
+#define _CONST64(c)	c
+#else
+#define _CONST64(c)	c##ull
+
+#include <asm/byteorder.h>
+
+struct tx4927_sdramc_reg {
+	volatile unsigned long long cr[4];
+	volatile unsigned long long unused0[4];
+	volatile unsigned long long tr;
+	volatile unsigned long long unused1[2];
+	volatile unsigned long long cmd;
+};
+
+struct tx4927_ebusc_reg {
+	volatile unsigned long long cr[8];
+};
+
+struct tx4927_ccfg_reg {
+	volatile unsigned long long ccfg;
+	volatile unsigned long long crir;
+	volatile unsigned long long pcfg;
+	volatile unsigned long long tear;
+	volatile unsigned long long clkctr;
+	volatile unsigned long long unused0;
+	volatile unsigned long long garbc;
+	volatile unsigned long long unused1;
+	volatile unsigned long long unused2;
+	volatile unsigned long long ramp;
+};
+
+struct tx4927_pcic_reg {
+	volatile unsigned long pciid;
+	volatile unsigned long pcistatus;
+	volatile unsigned long pciccrev;
+	volatile unsigned long pcicfg1;
+	volatile unsigned long p2gm0plbase;		/* +10 */
+	volatile unsigned long p2gm0pubase;
+	volatile unsigned long p2gm1plbase;
+	volatile unsigned long p2gm1pubase;
+	volatile unsigned long p2gm2pbase;		/* +20 */
+	volatile unsigned long p2giopbase;
+	volatile unsigned long unused0;
+	volatile unsigned long pcisid;
+	volatile unsigned long unused1;		/* +30 */
+	volatile unsigned long pcicapptr;
+	volatile unsigned long unused2;
+	volatile unsigned long pcicfg2;
+	volatile unsigned long g2ptocnt;		/* +40 */
+	volatile unsigned long unused3[15];
+	volatile unsigned long g2pstatus;		/* +80 */
+	volatile unsigned long g2pmask;
+	volatile unsigned long pcisstatus;
+	volatile unsigned long pcimask;
+	volatile unsigned long p2gcfg;		/* +90 */
+	volatile unsigned long p2gstatus;
+	volatile unsigned long p2gmask;
+	volatile unsigned long p2gccmd;
+	volatile unsigned long unused4[24];		/* +a0 */
+	volatile unsigned long pbareqport;		/* +100 */
+	volatile unsigned long pbacfg;
+	volatile unsigned long pbastatus;
+	volatile unsigned long pbamask;
+	volatile unsigned long pbabm;		/* +110 */
+	volatile unsigned long pbacreq;
+	volatile unsigned long pbacgnt;
+	volatile unsigned long pbacstate;
+	volatile unsigned long long g2pmgbase[3];		/* +120 */
+	volatile unsigned long long g2piogbase;
+	volatile unsigned long g2pmmask[3];		/* +140 */
+	volatile unsigned long g2piomask;
+	volatile unsigned long long g2pmpbase[3];		/* +150 */
+	volatile unsigned long long g2piopbase;
+	volatile unsigned long pciccfg;		/* +170 */
+	volatile unsigned long pcicstatus;
+	volatile unsigned long pcicmask;
+	volatile unsigned long unused5;
+	volatile unsigned long long p2gmgbase[3];		/* +180 */
+	volatile unsigned long long p2giogbase;
+	volatile unsigned long g2pcfgadrs;		/* +1a0 */
+	volatile unsigned long g2pcfgdata;
+	volatile unsigned long unused6[8];
+	volatile unsigned long g2pintack;
+	volatile unsigned long g2pspc;
+	volatile unsigned long unused7[12];		/* +1d0 */
+	volatile unsigned long long pdmca;		/* +200 */
+	volatile unsigned long long pdmga;
+	volatile unsigned long long pdmpa;
+	volatile unsigned long long pdmcut;
+	volatile unsigned long long pdmcnt;		/* +220 */
+	volatile unsigned long long pdmsts;
+	volatile unsigned long long unused8[2];
+	volatile unsigned long long pdmdb[4];		/* +240 */
+	volatile unsigned long long pdmtdh;		/* +260 */
+	volatile unsigned long long pdmdms;
+};
+
+#endif /* _LANGUAGE_ASSEMBLY */
+
+/*
+ * PCIC
+ */
+
+/* bits for G2PSTATUS/G2PMASK */
+#define TX4927_PCIC_G2PSTATUS_ALL	0x00000003
+#define TX4927_PCIC_G2PSTATUS_TTOE	0x00000002
+#define TX4927_PCIC_G2PSTATUS_RTOE	0x00000001
+
+/* bits for PCIMASK (see also PCI_STATUS_XXX in linux/pci.h */
+#define TX4927_PCIC_PCISTATUS_ALL	0x0000f900
+
+/* bits for PBACFG */
+#define TX4927_PCIC_PBACFG_RPBA 0x00000004
+#define TX4927_PCIC_PBACFG_PBAEN	0x00000002
+#define TX4927_PCIC_PBACFG_BMCEN	0x00000001
+
+/* bits for G2PMnGBASE */
+#define TX4927_PCIC_G2PMnGBASE_BSDIS	_CONST64(0x0000002000000000)
+#define TX4927_PCIC_G2PMnGBASE_ECHG	_CONST64(0x0000001000000000)
+
+/* bits for G2PIOGBASE */
+#define TX4927_PCIC_G2PIOGBASE_BSDIS	_CONST64(0x0000002000000000)
+#define TX4927_PCIC_G2PIOGBASE_ECHG	_CONST64(0x0000001000000000)
+
+/* bits for PCICSTATUS/PCICMASK */
+#define TX4927_PCIC_PCICSTATUS_ALL	0x000007dc
+
+/* bits for PCICCFG */
+#define TX4927_PCIC_PCICCFG_LBWC_MASK	0x0fff0000
+#define TX4927_PCIC_PCICCFG_HRST	0x00000800
+#define TX4927_PCIC_PCICCFG_SRST	0x00000400
+#define TX4927_PCIC_PCICCFG_IRBER	0x00000200
+#define TX4927_PCIC_PCICCFG_IMSE0	0x00000100
+#define TX4927_PCIC_PCICCFG_IMSE1	0x00000080
+#define TX4927_PCIC_PCICCFG_IMSE2	0x00000040
+#define TX4927_PCIC_PCICCFG_IISE	0x00000020
+#define TX4927_PCIC_PCICCFG_ATR 0x00000010
+#define TX4927_PCIC_PCICCFG_ICAE	0x00000008
+
+/* bits for P2GMnGBASE */
+#define TX4927_PCIC_P2GMnGBASE_TMEMEN	_CONST64(0x0000004000000000)
+#define TX4927_PCIC_P2GMnGBASE_TBSDIS	_CONST64(0x0000002000000000)
+#define TX4927_PCIC_P2GMnGBASE_TECHG	_CONST64(0x0000001000000000)
+
+/* bits for P2GIOGBASE */
+#define TX4927_PCIC_P2GIOGBASE_TIOEN	_CONST64(0x0000004000000000)
+#define TX4927_PCIC_P2GIOGBASE_TBSDIS	_CONST64(0x0000002000000000)
+#define TX4927_PCIC_P2GIOGBASE_TECHG	_CONST64(0x0000001000000000)
+
+#define TX4927_PCIC_IDSEL_AD_TO_SLOT(ad)	((ad) - 11)
+#define TX4927_PCIC_MAX_DEVNU	TX4927_PCIC_IDSEL_AD_TO_SLOT(32)
+
+/*
+ * CCFG
+ */
+/* CCFG : Chip Configuration */
+#define TX4927_CCFG_PCI66	0x00800000
+#define TX4927_CCFG_PCIMIDE	0x00400000
+#define TX4927_CCFG_PCIXARB	0x00002000
+#define TX4927_CCFG_PCIDIVMODE_MASK	0x00001800
+#define TX4927_CCFG_PCIDIVMODE_2_5	0x00000000
+#define TX4927_CCFG_PCIDIVMODE_3	0x00000800
+#define TX4927_CCFG_PCIDIVMODE_5	0x00001000
+#define TX4927_CCFG_PCIDIVMODE_6	0x00001800
+
+#define TX4937_CCFG_PCIDIVMODE_MASK	0x00001c00
+#define TX4937_CCFG_PCIDIVMODE_8	0x00000000
+#define TX4937_CCFG_PCIDIVMODE_4	0x00000400
+#define TX4937_CCFG_PCIDIVMODE_9	0x00000800
+#define TX4937_CCFG_PCIDIVMODE_4_5	0x00000c00
+#define TX4937_CCFG_PCIDIVMODE_10	0x00001000
+#define TX4937_CCFG_PCIDIVMODE_5	0x00001400
+#define TX4937_CCFG_PCIDIVMODE_11	0x00001800
+#define TX4937_CCFG_PCIDIVMODE_5_5	0x00001c00
+
+/* PCFG : Pin Configuration */
+#define TX4927_PCFG_PCICLKEN_ALL	0x003f0000
+#define TX4927_PCFG_PCICLKEN(ch)	(0x00010000<<(ch))
+
+/* CLKCTR : Clock Control */
+#define TX4927_CLKCTR_PCICKD	0x00400000
+#define TX4927_CLKCTR_PCIRST	0x00000040
+
+#ifndef _LANGUAGE_ASSEMBLY
+
+#define tx4927_sdramcptr	((struct tx4927_sdramc_reg *)TX4927_SDRAMC_REG)
+#define tx4927_pcicptr		((struct tx4927_pcic_reg *)TX4927_PCIC_REG)
+#define tx4927_ccfgptr		((struct tx4927_ccfg_reg *)TX4927_CCFG_REG)
+#define tx4927_ebuscptr		((struct tx4927_ebusc_reg *)TX4927_EBUSC_REG)
+
+#endif /* _LANGUAGE_ASSEMBLY */
+
 #endif /* __ASM_TX4927_TX4927_H */
diff --git a/include/asm-mips/tx4927/tx4927_pci.h b/include/asm-mips/tx4927/tx4927_pci.h
deleted file mode 100644
index 0be77df..0000000
--- a/include/asm-mips/tx4927/tx4927_pci.h
+++ /dev/null
@@ -1,268 +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) 2000-2001 Toshiba Corporation
- */
-#ifndef __ASM_TX4927_TX4927_PCI_H
-#define __ASM_TX4927_TX4927_PCI_H
-
-#define TX4927_CCFG_TOE 0x00004000
-#define TX4927_CCFG_WR	0x00008000
-#define TX4927_CCFG_TINTDIS	0x01000000
-
-#define TX4927_PCIMEM      0x08000000
-#define TX4927_PCIMEM_SIZE 0x08000000
-#define TX4927_PCIIO       0x16000000
-#define TX4927_PCIIO_SIZE  0x01000000
-
-#define TX4927_SDRAMC_REG       0xff1f8000
-#define TX4927_EBUSC_REG        0xff1f9000
-#define TX4927_PCIC_REG         0xff1fd000
-#define TX4927_CCFG_REG         0xff1fe000
-#define TX4927_IRC_REG          0xff1ff600
-#define TX4927_NR_TMR	3
-#define TX4927_TMR_REG(ch)	(0xff1ff000 + (ch) * 0x100)
-#define TX4927_CE3      0x17f00000      /* 1M */
-#define TX4927_PCIRESET_ADDR    0xbc00f006
-#define TX4927_PCI_CLK_ADDR     (KSEG1 + TX4927_CE3 + 0x00040020)
-
-#define TX4927_IMSTAT_ADDR(n)   (KSEG1 + TX4927_CE3 + 0x0004001a + (n))
-#define tx4927_imstat_ptr(n)    \
-        ((volatile unsigned char *)TX4927_IMSTAT_ADDR(n))
-
-/* bits for ISTAT3/IMASK3/IMSTAT3 */
-#define TX4927_INT3B_PCID       0
-#define TX4927_INT3B_PCIC       1
-#define TX4927_INT3B_PCIB       2
-#define TX4927_INT3B_PCIA       3
-#define TX4927_INT3F_PCID       (1 << TX4927_INT3B_PCID)
-#define TX4927_INT3F_PCIC       (1 << TX4927_INT3B_PCIC)
-#define TX4927_INT3F_PCIB       (1 << TX4927_INT3B_PCIB)
-#define TX4927_INT3F_PCIA       (1 << TX4927_INT3B_PCIA)
-
-/* bits for PCI_CLK (S6) */
-#define TX4927_PCI_CLK_HOST     0x80
-#define TX4927_PCI_CLK_MASK     (0x0f << 3)
-#define TX4927_PCI_CLK_33       (0x01 << 3)
-#define TX4927_PCI_CLK_25       (0x04 << 3)
-#define TX4927_PCI_CLK_66       (0x09 << 3)
-#define TX4927_PCI_CLK_50       (0x0c << 3)
-#define TX4927_PCI_CLK_ACK      0x04
-#define TX4927_PCI_CLK_ACE      0x02
-#define TX4927_PCI_CLK_ENDIAN   0x01
-#define TX4927_NR_IRQ_LOCAL     TX4927_IRQ_PIC_BEG
-#define TX4927_NR_IRQ_IRC       32      /* On-Chip IRC */
-
-#define TX4927_IR_PCIC  	16
-#define TX4927_IR_PCIERR        22
-#define TX4927_IR_PCIPMA        23
-#define TX4927_IRQ_IRC_PCIC     (TX4927_NR_IRQ_LOCAL + TX4927_IR_PCIC)
-#define TX4927_IRQ_IRC_PCIERR   (TX4927_NR_IRQ_LOCAL + TX4927_IR_PCIERR)
-#define TX4927_IRQ_IOC1         (TX4927_NR_IRQ_LOCAL + TX4927_NR_IRQ_IRC)
-#define TX4927_IRQ_IOC_PCID     (TX4927_IRQ_IOC1 + TX4927_INT3B_PCID)
-#define TX4927_IRQ_IOC_PCIC     (TX4927_IRQ_IOC1 + TX4927_INT3B_PCIC)
-#define TX4927_IRQ_IOC_PCIB     (TX4927_IRQ_IOC1 + TX4927_INT3B_PCIB)
-#define TX4927_IRQ_IOC_PCIA     (TX4927_IRQ_IOC1 + TX4927_INT3B_PCIA)
-
-#ifdef _LANGUAGE_ASSEMBLY
-#define _CONST64(c)     c
-#else
-#define _CONST64(c)     c##ull
-
-#include <asm/byteorder.h>
-
-#define tx4927_pcireset_ptr     \
-        ((volatile unsigned char *)TX4927_PCIRESET_ADDR)
-#define tx4927_pci_clk_ptr      \
-        ((volatile unsigned char *)TX4927_PCI_CLK_ADDR)
-
-struct tx4927_sdramc_reg {
-        volatile unsigned long long cr[4];
-        volatile unsigned long long unused0[4];
-        volatile unsigned long long tr;
-        volatile unsigned long long unused1[2];
-        volatile unsigned long long cmd;
-};
-
-struct tx4927_ebusc_reg {
-        volatile unsigned long long cr[8];
-};
-
-struct tx4927_ccfg_reg {
-        volatile unsigned long long ccfg;
-        volatile unsigned long long crir;
-        volatile unsigned long long pcfg;
-        volatile unsigned long long tear;
-        volatile unsigned long long clkctr;
-        volatile unsigned long long unused0;
-        volatile unsigned long long garbc;
-        volatile unsigned long long unused1;
-        volatile unsigned long long unused2;
-        volatile unsigned long long ramp;
-};
-
-struct tx4927_pcic_reg {
-        volatile unsigned long pciid;
-        volatile unsigned long pcistatus;
-        volatile unsigned long pciccrev;
-        volatile unsigned long pcicfg1;
-        volatile unsigned long p2gm0plbase;             /* +10 */
-        volatile unsigned long p2gm0pubase;
-        volatile unsigned long p2gm1plbase;
-        volatile unsigned long p2gm1pubase;
-        volatile unsigned long p2gm2pbase;              /* +20 */
-        volatile unsigned long p2giopbase;
-        volatile unsigned long unused0;
-        volatile unsigned long pcisid;
-        volatile unsigned long unused1;         /* +30 */
-        volatile unsigned long pcicapptr;
-        volatile unsigned long unused2;
-        volatile unsigned long pcicfg2;
-        volatile unsigned long g2ptocnt;                /* +40 */
-        volatile unsigned long unused3[15];
-        volatile unsigned long g2pstatus;               /* +80 */
-        volatile unsigned long g2pmask;
-        volatile unsigned long pcisstatus;
-        volatile unsigned long pcimask;
-        volatile unsigned long p2gcfg;          /* +90 */
-        volatile unsigned long p2gstatus;
-        volatile unsigned long p2gmask;
-        volatile unsigned long p2gccmd;
-        volatile unsigned long unused4[24];             /* +a0 */
-        volatile unsigned long pbareqport;              /* +100 */
-        volatile unsigned long pbacfg;
-        volatile unsigned long pbastatus;
-        volatile unsigned long pbamask;
-        volatile unsigned long pbabm;           /* +110 */
-        volatile unsigned long pbacreq;
-        volatile unsigned long pbacgnt;
-        volatile unsigned long pbacstate;
-        volatile unsigned long long g2pmgbase[3];               /* +120 */
-        volatile unsigned long long g2piogbase;
-        volatile unsigned long g2pmmask[3];             /* +140 */
-        volatile unsigned long g2piomask;
-        volatile unsigned long long g2pmpbase[3];               /* +150 */
-        volatile unsigned long long g2piopbase;
-        volatile unsigned long pciccfg;         /* +170 */
-        volatile unsigned long pcicstatus;
-        volatile unsigned long pcicmask;
-        volatile unsigned long unused5;
-        volatile unsigned long long p2gmgbase[3];               /* +180 */
-        volatile unsigned long long p2giogbase;
-        volatile unsigned long g2pcfgadrs;              /* +1a0 */
-        volatile unsigned long g2pcfgdata;
-        volatile unsigned long unused6[8];
-        volatile unsigned long g2pintack;
-        volatile unsigned long g2pspc;
-        volatile unsigned long unused7[12];             /* +1d0 */
-        volatile unsigned long long pdmca;              /* +200 */
-        volatile unsigned long long pdmga;
-        volatile unsigned long long pdmpa;
-        volatile unsigned long long pdmcut;
-        volatile unsigned long long pdmcnt;             /* +220 */
-        volatile unsigned long long pdmsts;
-        volatile unsigned long long unused8[2];
-        volatile unsigned long long pdmdb[4];           /* +240 */
-        volatile unsigned long long pdmtdh;             /* +260 */
-        volatile unsigned long long pdmdms;
-};
-
-#endif /* _LANGUAGE_ASSEMBLY */
-
-/*
- * PCIC
- */
-
-/* bits for G2PSTATUS/G2PMASK */
-#define TX4927_PCIC_G2PSTATUS_ALL       0x00000003
-#define TX4927_PCIC_G2PSTATUS_TTOE      0x00000002
-#define TX4927_PCIC_G2PSTATUS_RTOE      0x00000001
-
-/* bits for PCIMASK (see also PCI_STATUS_XXX in linux/pci.h */
-#define TX4927_PCIC_PCISTATUS_ALL       0x0000f900
-
-/* bits for PBACFG */
-#define TX4927_PCIC_PBACFG_RPBA 0x00000004
-#define TX4927_PCIC_PBACFG_PBAEN        0x00000002
-#define TX4927_PCIC_PBACFG_BMCEN        0x00000001
-
-/* bits for G2PMnGBASE */
-#define TX4927_PCIC_G2PMnGBASE_BSDIS    _CONST64(0x0000002000000000)
-#define TX4927_PCIC_G2PMnGBASE_ECHG     _CONST64(0x0000001000000000)
-
-/* bits for G2PIOGBASE */
-#define TX4927_PCIC_G2PIOGBASE_BSDIS    _CONST64(0x0000002000000000)
-#define TX4927_PCIC_G2PIOGBASE_ECHG     _CONST64(0x0000001000000000)
-
-/* bits for PCICSTATUS/PCICMASK */
-#define TX4927_PCIC_PCICSTATUS_ALL      0x000007dc
-
-/* bits for PCICCFG */
-#define TX4927_PCIC_PCICCFG_LBWC_MASK   0x0fff0000
-#define TX4927_PCIC_PCICCFG_HRST        0x00000800
-#define TX4927_PCIC_PCICCFG_SRST        0x00000400
-#define TX4927_PCIC_PCICCFG_IRBER       0x00000200
-#define TX4927_PCIC_PCICCFG_IMSE0       0x00000100
-#define TX4927_PCIC_PCICCFG_IMSE1       0x00000080
-#define TX4927_PCIC_PCICCFG_IMSE2       0x00000040
-#define TX4927_PCIC_PCICCFG_IISE        0x00000020
-#define TX4927_PCIC_PCICCFG_ATR 0x00000010
-#define TX4927_PCIC_PCICCFG_ICAE        0x00000008
-
-/* bits for P2GMnGBASE */
-#define TX4927_PCIC_P2GMnGBASE_TMEMEN   _CONST64(0x0000004000000000)
-#define TX4927_PCIC_P2GMnGBASE_TBSDIS   _CONST64(0x0000002000000000)
-#define TX4927_PCIC_P2GMnGBASE_TECHG    _CONST64(0x0000001000000000)
-
-/* bits for P2GIOGBASE */
-#define TX4927_PCIC_P2GIOGBASE_TIOEN    _CONST64(0x0000004000000000)
-#define TX4927_PCIC_P2GIOGBASE_TBSDIS   _CONST64(0x0000002000000000)
-#define TX4927_PCIC_P2GIOGBASE_TECHG    _CONST64(0x0000001000000000)
-
-#define TX4927_PCIC_IDSEL_AD_TO_SLOT(ad)        ((ad) - 11)
-#define TX4927_PCIC_MAX_DEVNU   TX4927_PCIC_IDSEL_AD_TO_SLOT(32)
-
-/*
- * CCFG
- */
-/* CCFG : Chip Configuration */
-#define TX4927_CCFG_PCI66       0x00800000
-#define TX4927_CCFG_PCIMIDE     0x00400000
-#define TX4927_CCFG_PCIXARB     0x00002000
-#define TX4927_CCFG_PCIDIVMODE_MASK     0x00001800
-#define TX4927_CCFG_PCIDIVMODE_2_5      0x00000000
-#define TX4927_CCFG_PCIDIVMODE_3        0x00000800
-#define TX4927_CCFG_PCIDIVMODE_5        0x00001000
-#define TX4927_CCFG_PCIDIVMODE_6        0x00001800
-
-#define TX4937_CCFG_PCIDIVMODE_MASK	0x00001c00
-#define TX4937_CCFG_PCIDIVMODE_8	0x00000000
-#define TX4937_CCFG_PCIDIVMODE_4	0x00000400
-#define TX4937_CCFG_PCIDIVMODE_9 	0x00000800
-#define TX4937_CCFG_PCIDIVMODE_4_5	0x00000c00
-#define TX4937_CCFG_PCIDIVMODE_10	0x00001000
-#define TX4937_CCFG_PCIDIVMODE_5	0x00001400
-#define TX4937_CCFG_PCIDIVMODE_11	0x00001800
-#define TX4937_CCFG_PCIDIVMODE_5_5	0x00001c00
-
-/* PCFG : Pin Configuration */
-#define TX4927_PCFG_PCICLKEN_ALL        0x003f0000
-#define TX4927_PCFG_PCICLKEN(ch)        (0x00010000<<(ch))
-
-/* CLKCTR : Clock Control */
-#define TX4927_CLKCTR_PCICKD    0x00400000
-#define TX4927_CLKCTR_PCIRST    0x00000040
-
-
-#ifndef _LANGUAGE_ASSEMBLY
-
-#define tx4927_sdramcptr        ((struct tx4927_sdramc_reg *)TX4927_SDRAMC_REG)
-#define tx4927_pcicptr          ((struct tx4927_pcic_reg *)TX4927_PCIC_REG)
-#define tx4927_ccfgptr          ((struct tx4927_ccfg_reg *)TX4927_CCFG_REG)
-#define tx4927_ebuscptr         ((struct tx4927_ebusc_reg *)TX4927_EBUSC_REG)
-
-#endif /* _LANGUAGE_ASSEMBLY */
-
-#endif /* __ASM_TX4927_TX4927_PCI_H */



From sshtylyov@ru.mvista.com Tue Apr 15 19:21:25 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 15 Apr 2008 19:21:27 +0100 (BST)
Received: from rtsoft3.corbina.net ([85.21.88.6]:48390 "EHLO
	buildserver.ru.mvista.com") by ftp.linux-mips.org with ESMTP
	id S28575130AbYDOSVZ (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 15 Apr 2008 19:21:25 +0100
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id 48F578810; Tue, 15 Apr 2008 23:21:24 +0500 (SAMST)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	ralf@linux-mips.org
Subject: [PATCH 1/2] DBAu1200: fix bad SMC 91C111 resource size
Date:	Tue, 15 Apr 2008 22:20:45 +0400
User-Agent: KMail/1.5
Cc:	linux-mips@linux-mips.org
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804152220.45725.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18926
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 854
Lines: 25

The on-board SMC 91C111 chip only decodes 16 bytes of memory (obviously, it can
not decode a whole megabyte starting from address 0x19000300).

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

---
Looking into drivers/net/smc91x.h cleared the things up...

 arch/mips/au1000/common/platform.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/arch/mips/au1000/common/platform.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/platform.c
+++ linux-2.6/arch/mips/au1000/common/platform.c
@@ -251,7 +251,7 @@ static struct resource smc91x_resources[
 	[0] = {
 		.name	= "smc91x-regs",
 		.start	= AU1XXX_SMC91111_PHYS_ADDR,
-		.end	= AU1XXX_SMC91111_PHYS_ADDR + 0xfffff,
+		.end	= AU1XXX_SMC91111_PHYS_ADDR + 0xf,
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {


From sshtylyov@ru.mvista.com Tue Apr 15 19:26:57 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 15 Apr 2008 19:26:59 +0100 (BST)
Received: from rtsoft3.corbina.net ([85.21.88.6]:50438 "EHLO
	buildserver.ru.mvista.com") by ftp.linux-mips.org with ESMTP
	id S28575188AbYDOS05 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 15 Apr 2008 19:26:57 +0100
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id D58108810; Tue, 15 Apr 2008 23:26:55 +0500 (SAMST)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	ralf@linux-mips.org
Subject: [PATCH 2/2] Pb1200: do register SMC 91C111
Date:	Tue, 15 Apr 2008 22:26:18 +0400
User-Agent: KMail/1.5
Cc:	linux-mips@linux-mips.org
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804152226.18762.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18927
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1506
Lines: 46

Pb1200 does have SMC 91C111 Ethernet chip on board but the platform code did
not register it, so one couldn't mount NFS...

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

---
This is definitely a bad place for the board #ifdef's, so I'm going to submit
a patch moving IDE and 91C111 registration into arch/mips/au1000/pb1200/...

 arch/mips/au1000/common/platform.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

Index: linux-2.6/arch/mips/au1000/common/platform.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/platform.c
+++ linux-2.6/arch/mips/au1000/common/platform.c
@@ -245,8 +245,7 @@ static struct platform_device au1x00_pcm
 	.id 		= 0,
 };
 
-#ifdef CONFIG_MIPS_DB1200
-
+#if defined(CONFIG_MIPS_DB1200) || defined(CONFIG_MIPS_PB1200)
 static struct resource smc91x_resources[] = {
 	[0] = {
 		.name	= "smc91x-regs",
@@ -267,8 +266,7 @@ static struct platform_device smc91x_dev
 	.num_resources	= ARRAY_SIZE(smc91x_resources),
 	.resource	= smc91x_resources,
 };
-
-#endif
+#endif /* defined(CONFIG_MIPS_DB1200) || defined(CONFIG_MIPS_PB1200) */
 
 /* All Alchemy demoboards with I2C have this #define in their headers */
 #ifdef SMBUS_PSC_BASE
@@ -302,7 +300,7 @@ static struct platform_device *au1xxx_pl
 	&au1200_ide0_device,
 	&au1xxx_mmc_device,
 #endif
-#ifdef CONFIG_MIPS_DB1200
+#if defined(CONFIG_MIPS_DB1200) || defined(CONFIG_MIPS_PB1200)
 	&smc91x_device,
 #endif
 #ifdef SMBUS_PSC_BASE


From bzolnier@gmail.com Tue Apr 15 22:19:57 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 15 Apr 2008 22:19:59 +0100 (BST)
Received: from fk-out-0910.google.com ([209.85.128.190]:13796 "EHLO
	fk-out-0910.google.com") by ftp.linux-mips.org with ESMTP
	id S20026534AbYDOVT5 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 15 Apr 2008 22:19:57 +0100
Received: by fk-out-0910.google.com with SMTP id f40so4215339fka.0
        for <linux-mips@linux-mips.org>; Tue, 15 Apr 2008 14:19:56 -0700 (PDT)
DKIM-Signature:	v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:from:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-disposition:message-id:content-type:content-transfer-encoding;
        bh=baOtjHGeW11SJ1cEGq6bP/dSCU8Afhqi/omkh/Noy3Q=;
        b=B3wYvDgGoahgpTs/yGQAwzLrBRVLu54fTGviARvA/PhyRSkBeTHBxdx/EzIViS/KgLnBYFzcw6mXMuJo9htL8HB54NgLt7BWf8hzBGERnGkcDOvIiiq7FR43cD/i4tGmv+WcM0q8G+aegiWdLeDt8VJyMPvk6qig/hhd5t/H7eQ=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=from:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-disposition:message-id:content-type:content-transfer-encoding;
        b=SEVyqf7TcHLEkt9oHt/v+JgFASaw5oQ8QXdfJoP4s6BAfGsfYjEm+BTfNE3a9cxveJ0LCsrcAhEMPcGDn2Hn+Tnf96J48o0BfwQNJCKQKKs/Mf8HHndyEylncSx5qatd+KIsVDCUTvkh5ZYPUcjpfsj01Gxam4cwtsHN9aFnjI0=
Received: by 10.82.151.14 with SMTP id y14mr5550251bud.62.1208294395444;
        Tue, 15 Apr 2008 14:19:55 -0700 (PDT)
Received: from ?192.168.123.7? ( [81.18.197.216])
        by mx.google.com with ESMTPS id s10sm11503456mue.15.2008.04.15.14.19.53
        (version=TLSv1/SSLv3 cipher=OTHER);
        Tue, 15 Apr 2008 14:19:54 -0700 (PDT)
From:	Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Subject: Re: [PATCH] Pb1200/DBAu1200: fix bad IDE resource size
Date:	Tue, 15 Apr 2008 23:09:11 +0200
User-Agent: KMail/1.9.9
Cc:	linux-mips@linux-mips.org, linux-ide@vger.kernel.org,
	ralf@linux-mips.org
References: <200804152044.32912.sshtylyov@ru.mvista.com>
In-Reply-To: <200804152044.32912.sshtylyov@ru.mvista.com>
MIME-Version: 1.0
Content-Disposition: inline
Message-Id: <200804152309.11471.bzolnier@gmail.com>
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Return-Path: <bzolnier@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: 18928
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: bzolnier@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 924
Lines: 20

On Tuesday 15 April 2008, Sergei Shtylyov wrote:
> The header files for the Pb1200/DBAu1200 boards have wrong definition for the
> IDE interface's  decoded range length -- it should be 512 bytes according to
> what the IDE driver does.  In addition, the IDE platform device claims 1 byte
> too many for its memory resource -- fix the platform code and the IDE driver
> in accordance.
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
> 
> ---
> I'm not sure thru which tree this should go -- probably thru Linux/MIPS one...

Well, since I've been already merging the other au1xxx-ide patches
to IDE tree I've also applied this one while at it...

>  arch/mips/au1000/common/platform.c    |    2 +-
>  drivers/ide/mips/au1xxx-ide.c         |    7 ++++---
>  include/asm-mips/mach-db1x00/db1200.h |    4 ++--
>  include/asm-mips/mach-pb1x00/pb1200.h |    4 ++--
>  4 files changed, 9 insertions(+), 8 deletions(-)

From bzolnier@gmail.com Tue Apr 15 22:20:13 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 15 Apr 2008 22:20:15 +0100 (BST)
Received: from fg-out-1718.google.com ([72.14.220.158]:13950 "EHLO
	fg-out-1718.google.com") by ftp.linux-mips.org with ESMTP
	id S20026544AbYDOVT6 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 15 Apr 2008 22:19:58 +0100
Received: by fg-out-1718.google.com with SMTP id d23so2714757fga.32
        for <linux-mips@linux-mips.org>; Tue, 15 Apr 2008 14:19:53 -0700 (PDT)
DKIM-Signature:	v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:from:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id;
        bh=L8BW2XOggRiNzdKnAOii+dVtlR/IcizVGaoe/gkgte0=;
        b=qOej/3/c6bvwppNDe2AN/AsCbUCrqMIAu+DnHUXYCRQTCZ07OCWQzC8SWFgr5kDONj2d1bEORlZp7OFRik0LhkeBYfNL/E9oat/0W5cBMGS+vqIPKF4/OxaNwQDSheFn+zzQc4qS4UkzbhpCs85w1KpJ9msCRNBl8S/JpFtaA+M=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=from:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id;
        b=BddKWju2d6Tmt7+kiDdsWPwBuSEJWfCh1ZVkaP8fi2Ia91ZAzLiFoJogBanZIbH9pwMRLvi0fLzPijfC5CwtvkBxqNRGzqtronxOfdZa9KoFKNFHRLvx6EJABc7LNtkD+3GZ44I6Bohpd9fJB5zajLiX3KvymxdqgMWFqo4BlMc=
Received: by 10.86.30.9 with SMTP id d9mr16853571fgd.77.1208294393734;
        Tue, 15 Apr 2008 14:19:53 -0700 (PDT)
Received: from ?192.168.123.7? ( [81.18.197.216])
        by mx.google.com with ESMTPS id s10sm11503456mue.15.2008.04.15.14.19.52
        (version=TLSv1/SSLv3 cipher=OTHER);
        Tue, 15 Apr 2008 14:19:53 -0700 (PDT)
From:	Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Subject: Re: [PATCH] Au1200: IDE driver build fix
Date:	Tue, 15 Apr 2008 22:55:15 +0200
User-Agent: KMail/1.9.9
Cc:	linux-ide@vger.kernel.org, linux-mips@linux-mips.org
References: <200804142303.04661.sshtylyov@ru.mvista.com>
In-Reply-To: <200804142303.04661.sshtylyov@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804152255.15926.bzolnier@gmail.com>
Return-Path: <bzolnier@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: 18929
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: bzolnier@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 680
Lines: 17

On Monday 14 April 2008, Sergei Shtylyov wrote:
> The driver fails to compile with CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA enabled:
> 
> drivers/ide/mips/au1xxx-ide.c: In function `auide_build_dmatable':
> drivers/ide/mips/au1xxx-ide.c:256: error: implicit declaration of function
> `sg_virt'
> drivers/ide/mips/au1xxx-ide.c:275: error: implicit declaration of function
> `sg_next'
> drivers/ide/mips/au1xxx-ide.c:275: warning: assignment makes pointer from
> integer without a cast
> 
> Fix this by including <linux/scatterlist.h>. While at it, remove the #include's
> without which the driver happily builds.
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

applied

From bzolnier@gmail.com Tue Apr 15 22:20:29 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 15 Apr 2008 22:20:32 +0100 (BST)
Received: from fg-out-1718.google.com ([72.14.220.156]:55674 "EHLO
	fg-out-1718.google.com") by ftp.linux-mips.org with ESMTP
	id S20026543AbYDOVT6 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 15 Apr 2008 22:19:58 +0100
Received: by fg-out-1718.google.com with SMTP id d23so2714702fga.32
        for <linux-mips@linux-mips.org>; Tue, 15 Apr 2008 14:19:52 -0700 (PDT)
DKIM-Signature:	v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:from:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id;
        bh=zw6dj2TmuXUgilX8wxf0WBCVWhoVaTax2a68QOmrr0Y=;
        b=Mxhk9xFsPFB0LLDs2seXfxaM964CIJoC3hkS11o4fynL9xVnnVE2SRuPIsOiswBo61zVwLw0YJu6PaAYmLv9gCTT9fbwLxzTINqZwwkWMMTQVoL710+4jYSl6mEc2zU23rrLS2mPBKedIYMAyF+1c7wFjJPsvgZxAdk6mCDzvpM=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=from:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id;
        b=YajF0rRctlsUgONlIwxyakwJWHOwcUkfz5y+QmHIzRqC3UxQPNYPtSx4Yh6YiDl8kyckbB3hpOmyYpFL7JNHxtOK6Y3G8aZgZNqU5GK/C0VX5NhB6pdOH0dg41QUNcoCvrtTBK2t4F/OY0ABweoooKyFNnjNr++Pt5mYCxx+Edc=
Received: by 10.86.94.11 with SMTP id r11mr6147638fgb.1.1208294392689;
        Tue, 15 Apr 2008 14:19:52 -0700 (PDT)
Received: from ?192.168.123.7? ( [81.18.197.216])
        by mx.google.com with ESMTPS id s10sm11503456mue.15.2008.04.15.14.19.48
        (version=TLSv1/SSLv3 cipher=OTHER);
        Tue, 15 Apr 2008 14:19:48 -0700 (PDT)
From:	Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Subject: Re: [PATCH] Au1200: kill IDE driver function prototypes
Date:	Tue, 15 Apr 2008 22:54:34 +0200
User-Agent: KMail/1.9.9
Cc:	linux-mips@linux-mips.org, linux-ide@vger.kernel.org,
	ralf@linux-mips.org
References: <200804142228.51987.sshtylyov@ru.mvista.com>
In-Reply-To: <200804142228.51987.sshtylyov@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804152254.34197.bzolnier@gmail.com>
Return-Path: <bzolnier@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: 18930
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: bzolnier@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1227
Lines: 28

On Monday 14 April 2008, Sergei Shtylyov wrote:
> Fix these warnings emitted when compiling drivers/ide/mips/au1xxx-ide.c:
> 
> include/asm/mach-au1x00/au1xxx_ide.h:137: warning: 'auide_tune_drive' declared 
> `static' but never defined
> include/asm/mach-au1x00/au1xxx_ide.h:138: warning: 'auide_tune_chipset' declared
>  `static' but never defined
> 
> by wiping out the whole "function prototyping" section from the header file
> <asm-mips/mach-au1x00/au1xxx_ide.h> as it mostly declared functions that are
> already dead in the IDE driver; move the only useful prototype into the driver.
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

applied

> ---
> I'm not sure thru which tree this should go -- probably thru Linux/MIPS one...
> 
> Bart, au1xxx-ide-fix-mwdma-support.patch will probably need to be updated to
> remove that added prototype since it won't be needed anymore...

I would prefer to merge this patch thru IDE tree because of the above and
the fact that it only touches "IDE" files - I hope Ralf is fine with it.

>  drivers/ide/mips/au1xxx-ide.c             |    2 ++
>  include/asm-mips/mach-au1x00/au1xxx_ide.h |   18 ------------------
>  2 files changed, 2 insertions(+), 18 deletions(-)

From 12o3l@tiscali.nl Wed Apr 16 02:39:27 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 16 Apr 2008 02:39:29 +0100 (BST)
Received: from smtp-out1.tiscali.nl ([195.241.79.176]:32466 "EHLO
	smtp-out1.tiscali.nl") by ftp.linux-mips.org with ESMTP
	id S20022489AbYDPBj1 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 16 Apr 2008 02:39:27 +0100
Received: from [82.171.187.43] (helo=[192.168.1.2])
	by smtp-out1.tiscali.nl with esmtp (Tiscali http://www.tiscali.nl)
	id 1JlwcQ-0007lQ-1K; Wed, 16 Apr 2008 03:39:26 +0200
Message-ID: <480558CA.7090800@tiscali.nl>
Date:	Wed, 16 Apr 2008 03:39:22 +0200
From:	Roel Kluin <12o3l@tiscali.nl>
User-Agent: Thunderbird 2.0.0.9 (X11/20071031)
MIME-Version: 1.0
To:	ralf@linux-mips.org
CC:	linux-mips@linux-mips.org, lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/6] MIPS: irixelf: fix test unsigned var < 0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Return-Path: <12o3l@tiscali.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: 18931
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: 12o3l@tiscali.nl
Precedence: bulk
X-list: linux-mips
Content-Length: 712
Lines: 26

v is unsigned, cast to signed to evaluate the do_brk() return value,
    
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c
index 290d8e3..fad2a2a 100644
--- a/arch/mips/kernel/irixelf.c
+++ b/arch/mips/kernel/irixelf.c
@@ -583,15 +583,15 @@ static void irix_map_prda_page(void)
 	unsigned long v;
 	struct prda *pp;
 
 	down_write(&current->mm->mmap_sem);
 	v =  do_brk(PRDA_ADDRESS, PAGE_SIZE);
 	up_write(&current->mm->mmap_sem);
 
-	if (v < 0)
+	if ((long) v < 0)
 		return;
 
 	pp = (struct prda *) v;
 	pp->prda_sys.t_pid  = task_pid_vnr(current);
 	pp->prda_sys.t_prid = read_c0_prid();
 	pp->prda_sys.t_rpid = task_pid_vnr(current);
 


From 12o3l@tiscali.nl Wed Apr 16 02:43:58 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 16 Apr 2008 02:44:01 +0100 (BST)
Received: from smtp-out2.tiscali.nl ([195.241.79.177]:58834 "EHLO
	smtp-out2.tiscali.nl") by ftp.linux-mips.org with ESMTP
	id S20027056AbYDPBn6 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 16 Apr 2008 02:43:58 +0100
Received: from [82.171.187.43] (helo=[192.168.1.2])
	by smtp-out2.tiscali.nl with esmtp (Tiscali http://www.tiscali.nl)
	id 1Jlwgo-0001bX-8j; Wed, 16 Apr 2008 03:43:58 +0200
Message-ID: <480559DC.2060807@tiscali.nl>
Date:	Wed, 16 Apr 2008 03:43:56 +0200
From:	Roel Kluin <12o3l@tiscali.nl>
User-Agent: Thunderbird 2.0.0.9 (X11/20071031)
MIME-Version: 1.0
To:	ralf@linux-mips.org
CC:	linux-mips@linux-mips.org, lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/6] MIPS: ip27-timer: fix unsigned irq < 0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Return-Path: <12o3l@tiscali.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: 18932
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: 12o3l@tiscali.nl
Precedence: bulk
X-list: linux-mips
Content-Length: 796
Lines: 29

irq is unsigned, cast to signed to evaluate the allocate_irqno() return value,
    
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---   
diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c
index 25d3baf..3c08afd 100644
--- a/arch/mips/sgi-ip27/ip27-timer.c
+++ b/arch/mips/sgi-ip27/ip27-timer.c
@@ -222,19 +222,19 @@ static void __init hub_rt_clock_event_global_init(void)
 	unsigned int irq;
 
 	do {
 		smp_wmb();
 		irq = rt_timer_irq;
 		if (irq)
 			break;
 
 		irq = allocate_irqno();
-		if (irq < 0)
+		if ((int) irq < 0)
 			panic("Allocation of irq number for timer failed");
 	} while (xchg(&rt_timer_irq, irq));
 
 	set_irq_chip_and_handler(irq, &rt_irq_type, handle_percpu_irq);
 	setup_irq(irq, &hub_rt_irqaction);
 }
 
 static cycle_t hub_rt_read(void)
 {

From tsbogend@alpha.franken.de Wed Apr 16 10:16:06 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 16 Apr 2008 10:16:09 +0100 (BST)
Received: from elvis.franken.de ([193.175.24.41]:46296 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S20026422AbYDPJQG (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 16 Apr 2008 10:16:06 +0100
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1Jm3kJ-0002nj-00; Wed, 16 Apr 2008 11:16:03 +0200
Received: by solo.franken.de (Postfix, from userid 1000)
	id EED88C3E3D; Wed, 16 Apr 2008 11:15:54 +0200 (CEST)
Date:	Wed, 16 Apr 2008 11:15:54 +0200
To:	Roel Kluin <12o3l@tiscali.nl>
Cc:	ralf@linux-mips.org, linux-mips@linux-mips.org,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/6] MIPS: ip27-timer: fix unsigned irq < 0
Message-ID: <20080416091554.GA6026@alpha.franken.de>
References: <480559DC.2060807@tiscali.nl>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <480559DC.2060807@tiscali.nl>
User-Agent: Mutt/1.5.13 (2006-08-11)
From:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Return-Path: <tsbogend@alpha.franken.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18933
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips
Content-Length: 874
Lines: 29

On Wed, Apr 16, 2008 at 03:43:56AM +0200, Roel Kluin wrote:
> irq is unsigned, cast to signed to evaluate the allocate_irqno() return value,
>     
> Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
> ---   
> diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c
> index 25d3baf..3c08afd 100644
> --- a/arch/mips/sgi-ip27/ip27-timer.c
> +++ b/arch/mips/sgi-ip27/ip27-timer.c
> @@ -222,19 +222,19 @@ static void __init hub_rt_clock_event_global_init(void)
>  	unsigned int irq;
>  
>  	do {
>  		smp_wmb();
>  		irq = rt_timer_irq;
>  		if (irq)
>  			break;
>  
>  		irq = allocate_irqno();
> -		if (irq < 0)
> +		if ((int) irq < 0)

Why don't you just make irq and rt_timer_irq an int ?

Thomas.

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

From kevink@mips.com Wed Apr 16 14:32:38 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 16 Apr 2008 14:32:41 +0100 (BST)
Received: from mx.mips.com ([63.167.95.198]:31702 "EHLO dns0.mips.com")
	by ftp.linux-mips.org with ESMTP id S20023684AbYDPNci (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 16 Apr 2008 14:32:38 +0100
Received: from mercury.mips.com (mercury [192.168.64.101])
	by dns0.mips.com (8.12.11/8.12.11) with ESMTP id m3GDVW0V029103
	for <linux-mips@linux-mips.org>; Wed, 16 Apr 2008 06:31:32 -0700 (PDT)
Received: from [192.168.236.12] (cthulhu [192.168.236.12])
	by mercury.mips.com (8.13.5/8.13.5) with ESMTP id m3GDWMOB009908
	for <linux-mips@linux-mips.org>; Wed, 16 Apr 2008 06:32:28 -0700 (PDT)
Message-ID: <4805FFE6.5080903@mips.com>
Date:	Wed, 16 Apr 2008 15:32:22 +0200
From:	"Kevin D. Kissell" <kevink@mips.com>
User-Agent: Thunderbird 2.0.0.12 (X11/20080226)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: Patches for 34K APRP
Content-Type: multipart/mixed;
 boundary="------------030103020306010003010808"
Return-Path: <kevink@mips.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18934
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: kevink@mips.com
Precedence: bulk
X-list: linux-mips
Content-Length: 988
Lines: 28

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

APRP operation of the 34K has been multiply broken
in 2.6.24.4.  The following patch set gets things
working seemingly reliably. The first two were previously
submitted to Ralf as essential to get RP programs to launch
safely. The larger third patch is new, and gets the Linux
I/O  services for the RP working again, and fixes formatting
in a few places.

Note that SMTC has scheduling problems in 2.6.24,
so testing under SMTC has been limited to boots with
only one TC acting as a Linux CPU.

	Regards,

	Kevin K.

--------------030103020306010003010808
Content-Type: text/x-patch;
 name="0001-Fixes-necessary-for-non-SMP-kernels-and-non-relocata.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename*0="0001-Fixes-necessary-for-non-SMP-kernels-and-non-relocata.pa";
 filename*1="tch"

From d164aa1b9dba720ee08a6a773e1a81b62aea7d10 Mon Sep 17 00:00:00 2001
From: Kevin D. Kissell <kevink@mips.com>
Date: Thu, 10 Apr 2008 02:07:38 +0200
Subject: [PATCH] Fixes necessary for non-SMP kernels and non-relocatable binaries
Content-Length: 1777
Lines: 59


Signed-off-by: Kevin D. Kissell <kevink@mips.com>
---
 arch/mips/kernel/vpe.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index 95446fa..4515f1e 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -782,10 +782,15 @@ static int vpe_run(struct vpe * v)
 	/* take system out of configuration state */
 	clear_c0_mvpcontrol(MVPCONTROL_VPC);
 
+	/* 
+ 	 * SMTC/SMVP kernels manage VPE enable independently,
+ 	 * but uniprocessor kernels need to turn it on, even
+ 	 * if that wasn't the pre-dvpe() state.
+ 	 */
 #ifdef CONFIG_SMP
-	evpe(EVPE_ENABLE);
-#else
 	evpe(vpeflags);
+#else
+	evpe(EVPE_ENABLE);
 #endif
 	emt(dmt_flag);
 	local_irq_restore(flags);
@@ -948,12 +953,13 @@ static int vpe_elfload(struct vpe * v)
 		struct elf_phdr *phdr = (struct elf_phdr *) ((char *)hdr + hdr->e_phoff);
 
 		for (i = 0; i < hdr->e_phnum; i++) {
-			if (phdr->p_type != PT_LOAD)
-				continue;
-
-			memcpy((void *)phdr->p_paddr, (char *)hdr + phdr->p_offset, phdr->p_filesz);
-			memset((void *)phdr->p_paddr + phdr->p_filesz, 0, phdr->p_memsz - phdr->p_filesz);
-			phdr++;
+		    if (phdr->p_type == PT_LOAD) {
+			memcpy((void *)phdr->p_paddr, 
+				(char *)hdr + phdr->p_offset, phdr->p_filesz);
+			memset((void *)phdr->p_paddr + phdr->p_filesz, 
+				0, phdr->p_memsz - phdr->p_filesz);
+		    }
+		    phdr++;
 		}
 
 		for (i = 0; i < hdr->e_shnum; i++) {
-- 
1.5.3.3


--------------030103020306010003010808
Content-Type: text/x-patch;
 name="0002-Propagate-max_low_pfn-as-max_pfn-for-compatibility-w.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename*0="0002-Propagate-max_low_pfn-as-max_pfn-for-compatibility-w.pa";
 filename*1="tch"

From 3fb8ed1c2eab46d17ec090f1d9e3a1a54ada4e6a Mon Sep 17 00:00:00 2001
From: Kevin D. Kissell <kevink@mips.com>
Date: Thu, 10 Apr 2008 02:45:26 +0200
Subject: [PATCH] Propagate max_low_pfn as max_pfn for compatibility with legacy driver and aprp code.
Content-Length: 880
Lines: 32


Signed-off-by: Kevin D. Kissell <kevink@mips.com>
---
 arch/mips/kernel/setup.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index f8a535a..a6a0d62 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -336,6 +336,10 @@ static void __init bootmem_init(void)
 #endif
 		max_low_pfn = PFN_DOWN(HIGHMEM_START);
 	}
+	/*
+	 * Propagate final value of max_low_pfn to max_pfn
+	 */
+	max_pfn = max_low_pfn;
 
 	/*
 	 * Initialize the boot-time allocator with low memory only.
-- 
1.5.3.3


--------------030103020306010003010808
Content-Type: text/x-patch;
 name="0003-Functional-Fixes-and-a-little-reformatting-of-APRP-S.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename*0="0003-Functional-Fixes-and-a-little-reformatting-of-APRP-S.pa";
 filename*1="tch"

From a523893f2d44fc47231abc698fd908666b7de570 Mon Sep 17 00:00:00 2001
From: Kevin D. Kissell <kevink@mips.com>
Date: Wed, 16 Apr 2008 11:56:31 +0200
Subject: [PATCH] Functional Fixes and a little reformatting of APRP Support for MIPS MT
Content-Length: 7141
Lines: 244


Signed-off-by: Kevin D. Kissell <kevink@mips.com>
---
 arch/mips/kernel/Makefile |    2 +-
 arch/mips/kernel/kspd.c   |    5 ++-
 arch/mips/kernel/rtlx.c   |  101 +++++++++++++++++++++++++++------------------
 include/asm-mips/rtlx.h   |    4 +-
 4 files changed, 68 insertions(+), 44 deletions(-)

diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index ffa0836..0ce7bca 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -51,9 +51,9 @@ obj-$(CONFIG_MIPS_MT_FPAFF)	+= mips-mt-fpaff.o
 obj-$(CONFIG_MIPS_MT_SMTC)	+= smtc.o smtc-asm.o smtc-proc.o
 obj-$(CONFIG_MIPS_MT_SMP)	+= smp-mt.o
 
-obj-$(CONFIG_MIPS_APSP_KSPD)	+= kspd.o
 obj-$(CONFIG_MIPS_VPE_LOADER)	+= vpe.o
 obj-$(CONFIG_MIPS_VPE_APSP_API)	+= rtlx.o
+obj-$(CONFIG_MIPS_APSP_KSPD)	+= kspd.o
 
 obj-$(CONFIG_I8259)		+= i8259.o
 obj-$(CONFIG_IRQ_CPU)		+= irq_cpu.o
diff --git a/arch/mips/kernel/kspd.c b/arch/mips/kernel/kspd.c
index d2c2e00..5e86c3a 100644
--- a/arch/mips/kernel/kspd.c
+++ b/arch/mips/kernel/kspd.c
@@ -257,7 +257,7 @@ void sp_work_handle_request(void)
 
 		vcwd = vpe_getcwd(tclimit);
 
- 		/* change to the cwd of the process that loaded the SP program */
+ 		/* change to cwd of the process that loaded the SP program */
 		old_fs = get_fs();
 		set_fs(KERNEL_DS);
 		sys_chdir(vcwd);
@@ -323,6 +323,9 @@ static void sp_cleanup(void)
 			set >>= 1;
 		}
 	}
+
+	/* Put daemon cwd back to root to avoid umount problems */
+	sys_chdir("/");
 }
 
 static int channel_open = 0;
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c
index 1ba00c1..c0bb347 100644
--- a/arch/mips/kernel/rtlx.c
+++ b/arch/mips/kernel/rtlx.c
@@ -73,6 +73,15 @@ static void rtlx_dispatch(void)
 static irqreturn_t rtlx_interrupt(int irq, void *dev_id)
 {
 	int i;
+	unsigned int flags, vpeflags;
+
+	/* Ought not to be strictly necessary for SMTC builds */
+	local_irq_save(flags);
+	vpeflags = dvpe();
+	set_c0_status(0x100 << MIPS_CPU_RTLX_IRQ);
+	irq_enable_hazard();
+	evpe(vpeflags);
+	local_irq_restore(flags);
 
 	for (i = 0; i < RTLX_CHANNELS; i++) {
 			wake_up(&channel_wqs[i].lx_queue);
@@ -109,7 +118,8 @@ static void __used dump_rtlx(void)
 static int rtlx_init(struct rtlx_info *rtlxi)
 {
 	if (rtlxi->id != RTLX_ID) {
-		printk(KERN_ERR "no valid RTLX id at 0x%p 0x%lx\n", rtlxi, rtlxi->id);
+		printk(KERN_ERR "no valid RTLX id at 0x%p 0x%lx\n", 
+			rtlxi, rtlxi->id);
 		return -ENOEXEC;
 	}
 
@@ -163,51 +173,51 @@ int rtlx_open(int index, int can_sleep)
 
 	if (rtlx == NULL) {
 		if( (p = vpe_get_shared(tclimit)) == NULL) {
-			if (can_sleep) {
-				__wait_event_interruptible(channel_wqs[index].lx_queue,
-				                           (p = vpe_get_shared(tclimit)),
-				                           ret);
-				if (ret)
-					goto out_fail;
-			} else {
-				printk(KERN_DEBUG "No SP program loaded, and device "
-					"opened with O_NONBLOCK\n");
-				ret = -ENOSYS;
+		    if (can_sleep) {
+			__wait_event_interruptible(channel_wqs[index].lx_queue,
+				(p = vpe_get_shared(tclimit)), ret);
+			if (ret)
 				goto out_fail;
-			}
+		    } else {
+			printk(KERN_DEBUG "No SP program loaded, and device "
+					"opened with O_NONBLOCK\n");
+			ret = -ENOSYS;
+			goto out_fail;
+		    }
 		}
 
 		smp_rmb();
 		if (*p == NULL) {
-			if (can_sleep) {
-				DEFINE_WAIT(wait);
-
-				for (;;) {
-					prepare_to_wait(&channel_wqs[index].lx_queue, &wait, TASK_INTERRUPTIBLE);
-					smp_rmb();
-					if (*p != NULL)
-						break;
-					if (!signal_pending(current)) {
-						schedule();
-						continue;
-					}
-					ret = -ERESTARTSYS;
-					goto out_fail;
+		    if (can_sleep) {
+			DEFINE_WAIT(wait);
+
+			for (;;) {
+				prepare_to_wait(&channel_wqs[index].lx_queue, 
+						&wait, TASK_INTERRUPTIBLE);
+				smp_rmb();
+				if (*p != NULL)
+					break;
+				if (!signal_pending(current)) {
+					schedule();
+					continue;
 				}
-				finish_wait(&channel_wqs[index].lx_queue, &wait);
-			} else {
-				printk(" *vpe_get_shared is NULL. "
-				       "Has an SP program been loaded?\n");
-				ret = -ENOSYS;
+				ret = -ERESTARTSYS;
 				goto out_fail;
 			}
+			finish_wait(&channel_wqs[index].lx_queue, &wait);
+		    } else {
+			printk(" *vpe_get_shared is NULL. "
+			       "Has an SP program been loaded?\n");
+				ret = -ENOSYS;
+				goto out_fail;
+		    }
 		}
 
 		if ((unsigned int)*p < KSEG0) {
-			printk(KERN_WARNING "vpe_get_shared returned an invalid pointer "
-			       "maybe an error code %d\n", (int)*p);
-			ret = -ENOSYS;
-			goto out_fail;
+		    printk(KERN_WARNING "vpe_get_shared returned an invalid "
+			"pointer maybe an error code %d\n", (int)*p);
+		    ret = -ENOSYS;
+		    goto out_fail;
 		}
 
 		if ((ret = rtlx_init(*p)) < 0)
@@ -233,6 +243,10 @@ out_ret:
 
 int rtlx_release(int index)
 {
+ 	if (rtlx == NULL) {
+		printk("rtlx_release() with null rtlx\n");
+ 		return 0;
+	}
 	rtlx->channel[index].lx_state = RTLX_STATE_UNUSED;
 	return 0;
 }
@@ -252,8 +266,8 @@ unsigned int rtlx_read_poll(int index, int can_sleep)
 			int ret = 0;
 
 			__wait_event_interruptible(channel_wqs[index].lx_queue,
-			                           chan->lx_read != chan->lx_write || sp_stopping,
-			                           ret);
+				(chan->lx_read != chan->lx_write) 
+				|| sp_stopping, ret);
 			if (ret)
 				return ret;
 
@@ -283,7 +297,9 @@ static inline int write_spacefree(int read, int write, int size)
 unsigned int rtlx_write_poll(int index)
 {
 	struct rtlx_channel *chan = &rtlx->channel[index];
-	return write_spacefree(chan->rt_read, chan->rt_write, chan->buffer_size);
+
+	return write_spacefree(chan->rt_read, chan->rt_write, 
+				chan->buffer_size);
 }
 
 ssize_t rtlx_read(int index, void __user *buff, size_t count)
@@ -345,8 +361,8 @@ ssize_t rtlx_write(int index, const void __user *buffer, size_t count)
 	rt_read = rt->rt_read;
 
 	/* total number of bytes to copy */
-	count = min(count,
-		    (size_t)write_spacefree(rt_read, rt->rt_write, rt->buffer_size));
+	count = min(count, (size_t)write_spacefree(rt_read, rt->rt_write, 
+							rt->buffer_size));
 
 	/* first bit from write pointer to the end of the buffer, or count */
 	fl = min(count, (size_t) rt->buffer_size - rt->rt_write);
@@ -515,6 +531,11 @@ static int __init rtlx_module_init(void)
 
 	if (cpu_has_vint)
 		set_vi_handler(MIPS_CPU_RTLX_IRQ, rtlx_dispatch);
+	else {
+		printk("APRP RTLX init on non-vectored-interrupt processor\n");
+		err = -ENODEV;
+		goto out_chrdev;
+	}
 
 	rtlx_irq.dev_id = rtlx;
 	setup_irq(rtlx_irq_num, &rtlx_irq);
diff --git a/include/asm-mips/rtlx.h b/include/asm-mips/rtlx.h
index 65778c8..20b6660 100644
--- a/include/asm-mips/rtlx.h
+++ b/include/asm-mips/rtlx.h
@@ -29,13 +29,13 @@ extern unsigned int rtlx_read_poll(int index, int can_sleep);
 extern unsigned int rtlx_write_poll(int index);
 
 enum rtlx_state {
-	RTLX_STATE_UNUSED,
+	RTLX_STATE_UNUSED = 0,
 	RTLX_STATE_INITIALISED,
 	RTLX_STATE_REMOTE_READY,
 	RTLX_STATE_OPENED
 };
 
-#define RTLX_BUFFER_SIZE 1024
+#define RTLX_BUFFER_SIZE 2048
 
 /* each channel supports read and write.
    linux (vpe0) reads lx_buffer  and writes rt_buffer
-- 
1.5.3.3


--------------030103020306010003010808--

From kevink@mips.com Wed Apr 16 14:42:57 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 16 Apr 2008 14:43:00 +0100 (BST)
Received: from dns0.mips.com ([63.167.95.198]:40662 "EHLO dns0.mips.com")
	by ftp.linux-mips.org with ESMTP id S20023719AbYDPNm5 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 16 Apr 2008 14:42:57 +0100
Received: from mercury.mips.com (mercury [192.168.64.101])
	by dns0.mips.com (8.12.11/8.12.11) with ESMTP id m3GDfraa029120
	for <linux-mips@linux-mips.org>; Wed, 16 Apr 2008 06:41:53 -0700 (PDT)
Received: from [192.168.236.12] (cthulhu [192.168.236.12])
	by mercury.mips.com (8.13.5/8.13.5) with ESMTP id m3GDgmtj010150
	for <linux-mips@linux-mips.org>; Wed, 16 Apr 2008 06:42:49 -0700 (PDT)
Message-ID: <48060258.8050904@mips.com>
Date:	Wed, 16 Apr 2008 15:42:48 +0200
From:	"Kevin D. Kissell" <kevink@mips.com>
User-Agent: Thunderbird 2.0.0.12 (X11/20080226)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: Re: Patches for 34K APRP
References: <4805FFE6.5080903@mips.com>
In-Reply-To: <4805FFE6.5080903@mips.com>
Content-Type: multipart/mixed;
 boundary="------------090906030603000704070808"
Return-Path: <kevink@mips.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18935
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: kevink@mips.com
Precedence: bulk
X-list: linux-mips
Content-Length: 6357
Lines: 110

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

Sigh.  Some mailers (including Thunderbird for Windows)
seem to be unable to handle the attachment of the patch
files by Thunderbird.  So I attach them as a .tgz, which
even Outlook should be able to deal with correctly.

	Regards,

	Kevin K.

Kevin D. Kissell wrote:
> APRP operation of the 34K has been multiply broken
> in 2.6.24.4.  The following patch set gets things
> working seemingly reliably. The first two were previously
> submitted to Ralf as essential to get RP programs to launch
> safely. The larger third patch is new, and gets the Linux
> I/O  services for the RP working again, and fixes formatting
> in a few places.
> 
> Note that SMTC has scheduling problems in 2.6.24,
> so testing under SMTC has been limited to boots with
> only one TC acting as a Linux CPU.
> 
>     Regards,
> 
>     Kevin K.


--------------090906030603000704070808
Content-Type: application/x-compressed-tar;
 name="aprprollup_160408.tgz"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="aprprollup_160408.tgz"

H4sIAE8BBkgAA+0aaXfbxtFfyV8xUdqUFAgK4AFS8tEoFhXzWaJYUU565eEtgYWECgRgHDrc
+L93ZnfBm5LluG5fHvdJBLA7OzvXzswOYBiGqR/7dzzVQ+7wNGXJve5FiR5GoT46HerXPAl5
kOosdEVfwoPIYRmrxyxzrp59SjOwWa0WXlvNltURz0bbkFfDaDas5jPTREKaltlpWM+MRtPE
YTA+CftvbHmasQTg2TW/8cPrzXCuH38Ncr52O06iCbim1WLMHO+7Y9ZpGJwbXWaxTqfJTdY1
x1aDcdZxTQNOoxBGPAazA4ZxIP6ggYorE5oDeEsyhKM6vPXTlAcBvJBS/X7ix2ndiSavykcs
4wdwcZXXAPEdxgnN74LRODA6B80uaAY+l0f5+F/cyQ7gH8PDi9dvfgFhoTC1UEALBWWhoCwU
0EJh3kLHAYexH7LE52m5XB75lyF39cjz9PH9J9Gq63oZWOJc7VHfnlxn7ybmdQd+BYBGA7SF
pqtWBhM8P0CKnSsWXnIXmW2BH6Y8yfwoTCtatQZdcHnA5bNeLZdd3/NA1y/9DNjehlXHGwbK
fujyO9hvt1qWx+r1VttseyZHEdPGI0Y24iwj3Zvxfv896J1uo4a60sS1DdiFWybzHWQoAwSz
kzyspFmSO+IRduGmWobS3i5k7JpDep9mfAJRnkHkgROFnn+ZJ4wYF4hwwh6COwFnie0Y9uQm
RqAsiYLK6U/D12eDi/OzExvvqs/LUNYIb1mDEi4zOr14vTdCoKkJTFjILjn8NOwBD4UBkGBi
jj9hFtzX1MQx0pKHfpxEZE9oSsX8kHMXsgiyPAkBFRGFNeA3PFTzfA+yK5bBLUvDP2V4zyFO
uO4i15WqZKYuQZGjb33P5R4gA8f9H2001LJe4gTZQ/Ls3uDwh5MesqR/iwtzFIAYw38vYJcp
DmhyQFs3Cb5FlnyPZk2yijvJbJpFAyWy/cD2k/d2wtMsSnilQEi63G91ayaa7X67WTOba3TJ
Ay+ImLtGnyXVhRB2fOUmsCt+X0JlZaAKlQpaPt3Rswb4q7/iOIq7T6gR0dEWrvg433gOPryY
wYT5BHs0rQr/RpGVSij1SixGYzu7R4K+eQnDC/vk7PCoKgBKZC9+mHOUpuiY8IkT31cqN5Hv
Ig3F5Ji5blKDRdKKQaQs5Vlt+iz27wdSkESIg+sRzuGQc2pgzNDQzA+gr0dLnZqGqi6V0J3A
CqMvZ4yiLLRHORMgpSfypz2dP7nOp3CpOPtY3BQco/4/PmgG6aIZ6FA26+16s94sl//XIfN3
1TD/aujDJIrZJXovfcLu7CC6tWMv1FkqHumWEkIMiZjy+WM/8LN7/fbL5X+Y61nL+V/Lam3z
v6/RRP7X9MZd7ppOg7Nxy3LNDneMfcMz3X3eZCZrt5jLWtxi/9X8r9U+aFib8r+phcKchQJL
QVmoSAgXLBRu/ewKAn7JnHtwE/+GJyJDZHESI6SLkfrL5YToPPNYZYXQElnhmhxwJQU0npQC
FousSdbUkEoDvS5rN9uYBmISb7hW45E0sJi8IREshil9aDatGuqILqi9WfYg4oZt+yFSPo6i
DOOBeBABpTqXrpTm1YfR7XhgH539PKi86f/45rR3ao8uDs8vRB7zUaR6+IP5x0z7HubzAdyw
IOeUTc5jw7RNGYOYtIe/hXG8nAeU6QeiFildH6n0WeB/4CKdI+L1zJ9wYIE4RaBZSUOKbgG5
ivDsEYXBff33EpLo/K0f56FDVsgCVQqgwz7TcRtlAcfzFG6uCcswxbrEraIfDs+H+uiL+X/T
arQby/4fo9LW/3+NJvw/azea3f2m13BbLc9pdRpNk40da7/ruftG17Ksccfl7c6XO///LI7E
1sz/m+ZB2zpomhvP/1MLVaUA4cpBWijMWyi5BbJQGOVxHCWZiAyn/eEITi++oMc/xaMtuXfp
8vFEtQ7oOo1ddNgggdoYF9ZBJVlwV0CZhrlUU1hbYJi1MsYUJ8hdvsfSiS7QCnxXxaotQVpr
ORZZ3eVg1Go9KRpNBbAmZBRjRTzymNFtWvW64fDO2GGPxKPp7A0BaTpOEalt1vZBE7/4GI3/
pf+hoo7cpHT79MI+Hh4eH1dLGkYBxKJPMt2LmefVo/J6eCorCPB0kjn1SFwwGZ4Ut1Q2eGDy
UM2NcSUCK+urgIfD0dB+OxoeCVhhJmsR0qGfjn+9cwFINZmNcALn4bAvIIUNRGXtU5deQtrv
Ntr71RJB+HS7smr//C/26+E7BZK8t504R6CHTUZthzUqlSPKXNwGJqKGUa+3eddymo+Zi5q7
wVjUKJlKo92pdUCTF+wQSUsa27dRcm3jvnADbif8fc7Tad5CGcuNc+uCkL19yTN8qGRO4E/8
TBQydITY21X7SpSOMIugGZGn6kOixiTrRlRZoQIT9o+GNHSZsIlIVZaxPBkDIogC1/ZSJBXJ
xJuKSKNKqXx42zsf9E7so5HqvU9t58r1kwqxp4pDzUZTZHd42V9O7lBOVKEL87iQTUnghlev
XoJZHOgpa5MlumGegcswYQoFL2PmXBNfCeZXdGUCaT6J8jAjNsYBn6QyaZuRtrO3Q9SKQsFc
mYqkhKq1o5iHom7wiNkp/7rGOOSIMjtzzAzDMet1xxiPm63OI2an5m4wOzUqyqdCqPi7UDsV
/BOU7fqpSKUKuRacJu8TTnVIO5NwyDpPkjzOKiQEHK5JJLsuv7HFzH+jAsQY1V3yMBWhTohM
lABrUFQXnxdaOssvrzIIpU7GHNdOfCcL7pcq7eQRYZz7gat0NCsypuxmVmHUSsUKqBdZFaVO
MkHHsImxPK0YdyhYePFCBGVyIvb5xclfyaMIYEIqa7e4Jz+wxJU4VqqjDxQ6adsul5XEGq/f
HA5wF4ymdSUy4lsMJzaa9XeFXd2+T//h/1JHkaMvyLnaHKaxT97DNLu17urJJ09R0m4+iW3S
1bIqw6kK8UikqqWqw4tgl279Qn8eVMSz/goRf/NSEt4/UsXQOEFk12I3273zc9gJIzoNISjB
AV7RSRh3f4zpJ7j7Z7hTEyv56kJYZVnuczCJut8adChGaaug9wZnvb/2XssTHEjJWc1aG9Ma
syOu2DUVCG1hac60BWtye7PQTgPOY+l/C4FQMXTw7uREqc33KlCJZ37ZTq9Ywme+uToPX1SR
Z6hVZ8m2b5mf2VTjz2Y7zEfrqyyYA5E3M4manAyb24OkPT4dpalKxJJ/fJRPpcsId2qUo09n
fiBBPgK9KCg4mtfrUe+Hdz/CziCaDxYyhNREBo2uw3c47CjkO6QPNGRx4j2zB2eDH07OXr9F
3RfUICXIGGl59LfRQuF6QbbabxCtrGE/KD8lH21ePLBJOtMadCEm7bOlpD0uJW2tkJYJm5bF
Z3XwlHzHZKyiNrG1G3+aDR/1jvuDnv3zYf+iQiKvFq9BpBN8/nwKiWzzGGVpZ5FQzpLPW9IE
fEcwNbg4HL21+4ML9BLvhhd99dpK4JsjWnYour9RdKve0jjh7Hoe5hsKTui+6dUcHtoqTp4k
aCfVGaml1Lnibh7wGfL59zzi+aO6FgI/74n6kZD62u3ykL2uEaMmBuakqD1diMpoSg8JU1uS
pbZOlNq8JKcQDwlSW5GjtiRGmJOih9Epvfpku6g+4Hx2YHdx74KfCi7qhatRfm7nDaOj/PzG
G3PM6uTu+/ODjme92te5ASjcwGfw+IDzeJBL7YlMapuYfNxzkBlU5tO9KprNC3g76v1oFPtp
3t/9fHg+6A/Q4y1RL0M43iCtfihzgTgSnluprWBowu4xWUQw9Omi7u5y+KMrUoSKXF+pbYkh
fSM/n0ufFPROQeYnEaaWXB/KVk1nXspyziyXQ3xVFLVRlQfMpkj1G62mqo4THpxyQBimOU/C
8RyV8lnaIzI/bX2mM0vUdhYmV2X0CfMgEFiVEc0SMYM4IiuhUf2VsvU5O5efXqj8EvfPRc9+
N3g36h0R0zMkaGny7NzAtFdrWJbMfhdOF4oy5tpxFAQP5XPktGiCEKOhPgT4TUnYA0kUzdVf
KdLIj047bhMfef/1VzrV4tEhjtFzPopulnOIN+wPoa4qr7+0gkIBK2mLEjdenqucudFtilrF
fmfhKO6HgR9yIVaxkI1HR4d7CZfmRNTUZqPyNvU/cFxnVWMSw6LK1Clk/oyiVAC7dINq+26d
RdHeVlwsEyZFk2S2pG76qEiUz+Pc83hiC1pl3P08bFLu63CqMgI92XMmO2+ts7NcArs0uwYK
3KE6hdzkzVabdkLTMtU5cB6joGIeJYbaNFtFzJNl1LRRpTWRf5lyWLyswvN5xgLc75Mx4og8
GN9nPBWVoii+p0O5XhKY6F2XH1bEvTBpcRqRa1WXhTkVo1pRCZGe5oUnzH4V+1PRFplQaQ1+
xaXnJyiusZ+BR+8l5D4tnLsqrmGiU5TGClEKV0/kiUKYF6wnc5kv0BcIVOf8ttkmJ95umjXT
XPpASr3hFKqeRJRULbzlVKdVJ87tK5baN75UrKh/3PiqxJhUVuoetcVCkKx3TNONwv+Llxry
bB6KT9PEx4433KHah6tP/SZMP2ubZhY4oELdUe8n0TMNc85VgscbFSxUuKCiSl1WlVS0I6cl
3gPTUKWAsdEca9If0GN1qRC36cXEeNOIKsRZ7U6n63Tr9YYxtizLWCzEbZorC3GbRoVP3adP
3jR5wQ5+hxILPy+UoUA2Tl/rV4WJcxSYhJHRl3KzlfhLJ+CVTgqXNVTC3EB/0L/oH570xZSF
kfPe6Zm4HB79bWnobNgb9I7QGYra9bcu9yieCIAf3h0f987tUf/vPZR4o1XWNg43jFaX+MEd
y5lzVVRkIZWv3FIRiMTRWciiXiYnhJErvwOq4WFWSgApoCDkfoQZME7OVO/v5R37/3MTn/k+
4V3+57RHvv/CfLn1zDQ6nU6jbTU77WeGaXY62+//v0rbfnW+/ep8+9X59qvz7Vfnq1+d/699
87Zt27Zt27Zt27Zt27Zt27Zt27Zt27Zt27Zt27Zt27Zt27Zt2+e0/wCbU6K7AFAAAA==
--------------090906030603000704070808--

From 12o3l@tiscali.nl Wed Apr 16 16:10:05 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 16 Apr 2008 16:10:10 +0100 (BST)
Received: from smtp-out2.tiscali.nl ([195.241.79.177]:38018 "EHLO
	smtp-out2.tiscali.nl") by ftp.linux-mips.org with ESMTP
	id S20029160AbYDPPKF (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 16 Apr 2008 16:10:05 +0100
Received: from [82.171.187.43] (helo=[192.168.1.2])
	by smtp-out2.tiscali.nl with esmtp (Tiscali http://www.tiscali.nl)
	id 1Jm9Gp-0004Ui-Gj; Wed, 16 Apr 2008 17:09:59 +0200
Message-ID: <480616C6.3080203@tiscali.nl>
Date:	Wed, 16 Apr 2008 17:09:58 +0200
From:	Roel Kluin <12o3l@tiscali.nl>
User-Agent: Thunderbird 2.0.0.9 (X11/20071031)
MIME-Version: 1.0
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
CC:	ralf@linux-mips.org, linux-mips@linux-mips.org,
	lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/6 v2] MIPS: ip27-timer: unsigned irq to evaluate allocate_irqno()
References: <480559DC.2060807@tiscali.nl> <20080416091554.GA6026@alpha.franken.de>
In-Reply-To: <20080416091554.GA6026@alpha.franken.de>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Return-Path: <12o3l@tiscali.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: 18936
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: 12o3l@tiscali.nl
Precedence: bulk
X-list: linux-mips
Content-Length: 1087
Lines: 38

Thomas Bogendoerfer wrote:
> On Wed, Apr 16, 2008 at 03:43:56AM +0200, Roel Kluin wrote:
>> irq is unsigned, cast to signed to evaluate the allocate_irqno() return value,
 
>> +		if ((int) irq < 0)
> 
> Why don't you just make irq and rt_timer_irq an int ?

Ok, thanks, It should be right, but I cannot test this (no hardware).
---
when allocate_irqno() returns a negative error value, but is stored in an
unsigned variable 'irq', the test '(irq < 0)' won't work.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c
index 25d3baf..9cebc9e 100644
--- a/arch/mips/sgi-ip27/ip27-timer.c
+++ b/arch/mips/sgi-ip27/ip27-timer.c
@@ -158,7 +158,7 @@ static void rt_set_mode(enum clock_event_mode mode,
 	}
 }
 
-unsigned int rt_timer_irq;
+int rt_timer_irq;
 
 static irqreturn_t hub_rt_counter_handler(int irq, void *dev_id)
 {
@@ -219,7 +219,7 @@ static void __cpuinit hub_rt_clock_event_init(void)
 
 static void __init hub_rt_clock_event_global_init(void)
 {
-	unsigned int irq;
+	int irq;
 
 	do {
 		smp_wmb();


From sshtylyov@ru.mvista.com Wed Apr 16 18:16:40 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 16 Apr 2008 18:16:43 +0100 (BST)
Received: from rtsoft3.corbina.net ([85.21.88.6]:46351 "EHLO
	buildserver.ru.mvista.com") by ftp.linux-mips.org with ESMTP
	id S20029654AbYDPRQk (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 16 Apr 2008 18:16:40 +0100
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id 367198815; Wed, 16 Apr 2008 22:16:37 +0500 (SAMST)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	ralf@linux-mips.org
Subject: [PATCH] Alchemy: kill useless #include's, #define's and extern's (take 3)
Date:	Wed, 16 Apr 2008 21:15:59 +0400
User-Agent: KMail/1.5
Cc:	linux-mips@linux-mips.org
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <200804162115.59620.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18937
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 31358
Lines: 1006

Go thru the Alchemy code and hunt down every unneeded #include, #define, and
extern (some of which refer to already long dead functions).

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

---
Killed #include <au1xxx_dbdma.h> and couple #define's in
arch/mips/au1000/pb1200/board_setup.c...

Please update the queued patch, hopefully the last time. :-)

 arch/mips/au1000/common/cputable.c     |    5 +----
 arch/mips/au1000/common/dbdma.c        |    6 ------
 arch/mips/au1000/common/dbg_io.c       |    1 -
 arch/mips/au1000/common/dma.c          |    5 +----
 arch/mips/au1000/common/gpio.c         |    5 -----
 arch/mips/au1000/common/irq.c          |    1 -
 arch/mips/au1000/common/pci.c          |    2 +-
 arch/mips/au1000/common/platform.c     |    4 +---
 arch/mips/au1000/common/power.c        |    9 +--------
 arch/mips/au1000/common/prom.c         |    2 +-
 arch/mips/au1000/common/puts.c         |    1 -
 arch/mips/au1000/common/reset.c        |    8 +-------
 arch/mips/au1000/common/setup.c        |   11 +----------
 arch/mips/au1000/common/sleeper.S      |    2 +-
 arch/mips/au1000/common/time.c         |    8 --------
 arch/mips/au1000/db1x00/board_setup.c  |   15 ++-------------
 arch/mips/au1000/db1x00/init.c         |    5 -----
 arch/mips/au1000/db1x00/irqmap.c       |   21 ++-------------------
 arch/mips/au1000/mtx-1/board_setup.c   |   14 ++------------
 arch/mips/au1000/mtx-1/init.c          |    6 +-----
 arch/mips/au1000/mtx-1/irqmap.c        |   19 +------------------
 arch/mips/au1000/mtx-1/platform.c      |    1 -
 arch/mips/au1000/pb1000/board_setup.c  |   11 +----------
 arch/mips/au1000/pb1000/init.c         |    6 +-----
 arch/mips/au1000/pb1000/irqmap.c       |   18 +-----------------
 arch/mips/au1000/pb1100/board_setup.c  |   11 +----------
 arch/mips/au1000/pb1100/init.c         |    6 +-----
 arch/mips/au1000/pb1100/irqmap.c       |   19 +------------------
 arch/mips/au1000/pb1200/board_setup.c  |   20 +-------------------
 arch/mips/au1000/pb1200/init.c         |    6 +-----
 arch/mips/au1000/pb1200/irqmap.c       |   20 ++------------------
 arch/mips/au1000/pb1500/board_setup.c  |   11 +----------
 arch/mips/au1000/pb1500/init.c         |    6 +-----
 arch/mips/au1000/pb1500/irqmap.c       |   19 +------------------
 arch/mips/au1000/pb1550/board_setup.c  |   15 ++-------------
 arch/mips/au1000/pb1550/init.c         |    6 +-----
 arch/mips/au1000/pb1550/irqmap.c       |   19 +------------------
 arch/mips/au1000/xxs1500/board_setup.c |   11 +----------
 arch/mips/au1000/xxs1500/init.c        |    6 +-----
 arch/mips/au1000/xxs1500/irqmap.c      |   19 +------------------
 arch/mips/pci/fixup-au1000.c           |    5 +----
 41 files changed, 38 insertions(+), 347 deletions(-)

Index: linux-2.6/arch/mips/au1000/common/cputable.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/cputable.c
+++ linux-2.6/arch/mips/au1000/common/cputable.c
@@ -11,10 +11,7 @@
  *  as published by the Free Software Foundation; either version
  *  2 of the License, or (at your option) any later version.
  */
-#include <linux/string.h>
-#include <linux/sched.h>
-#include <linux/threads.h>
-#include <linux/init.h>
+
 #include <asm/mach-au1x00/au1000.h>
 
 struct cpu_spec* cur_cpu_spec[NR_CPUS];
Index: linux-2.6/arch/mips/au1000/common/dbdma.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/dbdma.c
+++ linux-2.6/arch/mips/au1000/common/dbdma.c
@@ -31,18 +31,12 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
-#include <linux/string.h>
-#include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-au1x00/au1xxx_dbdma.h>
-#include <asm/system.h>
-
 
 #if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
 
Index: linux-2.6/arch/mips/au1000/common/dbg_io.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/dbg_io.c
+++ linux-2.6/arch/mips/au1000/common/dbg_io.c
@@ -1,5 +1,4 @@
 
-#include <asm/io.h>
 #include <asm/mach-au1x00/au1000.h>
 
 #ifdef CONFIG_KGDB
Index: linux-2.6/arch/mips/au1000/common/dma.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/dma.c
+++ linux-2.6/arch/mips/au1000/common/dma.c
@@ -33,12 +33,9 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
-#include <linux/sched.h>
 #include <linux/spinlock.h>
-#include <linux/string.h>
-#include <linux/delay.h>
 #include <linux/interrupt.h>
-#include <asm/system.h>
+
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-au1x00/au1000_dma.h>
 
Index: linux-2.6/arch/mips/au1000/common/gpio.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/gpio.c
+++ linux-2.6/arch/mips/au1000/common/gpio.c
@@ -27,13 +27,8 @@
  * 	others have a second one : GPIO2
  */
 
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/types.h>
 #include <linux/module.h>
 
-#include <asm/addrspace.h>
-
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/gpio.h>
 
Index: linux-2.6/arch/mips/au1000/common/irq.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/irq.c
+++ linux-2.6/arch/mips/au1000/common/irq.c
@@ -26,7 +26,6 @@
  */
 #include <linux/bitops.h>
 #include <linux/init.h>
-#include <linux/io.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 
Index: linux-2.6/arch/mips/au1000/common/pci.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/pci.c
+++ linux-2.6/arch/mips/au1000/common/pci.c
@@ -30,7 +30,7 @@
  *  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/pci.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
Index: linux-2.6/arch/mips/au1000/common/platform.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/platform.c
+++ linux-2.6/arch/mips/au1000/common/platform.c
@@ -7,11 +7,9 @@
  * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
-#include <linux/device.h>
+
 #include <linux/platform_device.h>
-#include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/resource.h>
 
 #include <asm/mach-au1x00/au1xxx.h>
 
Index: linux-2.6/arch/mips/au1000/common/power.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/power.c
+++ linux-2.6/arch/mips/au1000/common/power.c
@@ -29,17 +29,14 @@
  *  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/pm.h>
 #include <linux/pm_legacy.h>
-#include <linux/slab.h>
 #include <linux/sysctl.h>
 #include <linux/jiffies.h>
 
-#include <asm/string.h>
 #include <asm/uaccess.h>
-#include <asm/io.h>
-#include <asm/system.h>
 #include <asm/cacheflush.h>
 #include <asm/mach-au1x00/au1000.h>
 
@@ -54,10 +51,6 @@
 
 static void au1000_calibrate_delay(void);
 
-extern void set_au1x00_speed(unsigned int new_freq);
-extern unsigned int get_au1x00_speed(void);
-extern unsigned long get_au1x00_uart_baud_base(void);
-extern void set_au1x00_uart_baud_base(unsigned long new_baud_base);
 extern unsigned long save_local_and_disable(int controller);
 extern void restore_local_and_enable(int controller, unsigned long mask);
 extern void local_enable_irq(unsigned int irq_nr);
Index: linux-2.6/arch/mips/au1000/common/prom.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/prom.c
+++ linux-2.6/arch/mips/au1000/common/prom.c
@@ -33,8 +33,8 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/module.h>
-#include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/string.h>
 
Index: linux-2.6/arch/mips/au1000/common/puts.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/puts.c
+++ linux-2.6/arch/mips/au1000/common/puts.c
@@ -28,7 +28,6 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/types.h>
 #include <asm/mach-au1x00/au1000.h>
 
 #define SERIAL_BASE   UART_BASE
Index: linux-2.6/arch/mips/au1000/common/reset.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/reset.c
+++ linux-2.6/arch/mips/au1000/common/reset.c
@@ -27,13 +27,7 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/sched.h>
-#include <linux/mm.h>
-#include <asm/io.h>
-#include <asm/pgtable.h>
-#include <asm/processor.h>
-#include <asm/reboot.h>
-#include <asm/system.h>
+
 #include <asm/mach-au1x00/au1000.h>
 
 extern int au_sleep(void);
Index: linux-2.6/arch/mips/au1000/common/setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/setup.c
+++ linux-2.6/arch/mips/au1000/common/setup.c
@@ -25,21 +25,14 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
 #include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/delay.h>
-#include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/pm.h>
 
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
 #include <asm/mipsregs.h>
 #include <asm/reboot.h>
-#include <asm/pgtable.h>
 #include <asm/time.h>
 
 #include <au1000.h>
@@ -49,8 +42,6 @@ extern void __init board_setup(void);
 extern void au1000_restart(char *);
 extern void au1000_halt(void);
 extern void au1000_power_off(void);
-extern void au1x_time_init(void);
-extern void au1x_timer_setup(struct irqaction *irq);
 extern void set_cpuspec(void);
 
 void __init plat_mem_setup(void)
Index: linux-2.6/arch/mips/au1000/common/sleeper.S
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/sleeper.S
+++ linux-2.6/arch/mips/au1000/common/sleeper.S
@@ -9,9 +9,9 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
  */
+
 #include <asm/asm.h>
 #include <asm/mipsregs.h>
-#include <asm/addrspace.h>
 #include <asm/regdef.h>
 #include <asm/stackframe.h>
 
Index: linux-2.6/arch/mips/au1000/common/time.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/time.c
+++ linux-2.6/arch/mips/au1000/common/time.c
@@ -34,20 +34,12 @@
 
 #include <linux/types.h>
 #include <linux/init.h>
-#include <linux/kernel_stat.h>
-#include <linux/sched.h>
 #include <linux/spinlock.h>
-#include <linux/hardirq.h>
 
-#include <asm/compiler.h>
 #include <asm/mipsregs.h>
 #include <asm/time.h>
-#include <asm/div64.h>
 #include <asm/mach-au1x00/au1000.h>
 
-#include <linux/mc146818rtc.h>
-#include <linux/timex.h>
-
 static int no_au1xxx_32khz;
 extern int allow_au1k_wait; /* default off for CP0 Counter */
 
Index: linux-2.6/arch/mips/au1000/db1x00/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/db1x00/board_setup.c
+++ linux-2.6/arch/mips/au1000/db1x00/board_setup.c
@@ -27,20 +27,9 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
-#include <linux/mc146818rtc.h>
-#include <linux/delay.h>
-
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
+
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-db1x00/db1x00.h>
 
Index: linux-2.6/arch/mips/au1000/db1x00/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/db1x00/init.c
+++ linux-2.6/arch/mips/au1000/db1x00/init.c
@@ -28,13 +28,8 @@
  */
 
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/db1x00/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/db1x00/irqmap.c
+++ linux-2.6/arch/mips/au1000/db1x00/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 #ifdef CONFIG_MIPS_DB1500
Index: linux-2.6/arch/mips/au1000/mtx-1/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/mtx-1/board_setup.c
+++ linux-2.6/arch/mips/au1000/mtx-1/board_setup.c
@@ -28,19 +28,9 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
-#include <linux/delay.h>
-
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
+
 #include <asm/mach-au1x00/au1000.h>
 
 extern int (*board_pci_idsel)(unsigned int devsel, int assert);
Index: linux-2.6/arch/mips/au1000/mtx-1/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/mtx-1/init.c
+++ linux-2.6/arch/mips/au1000/mtx-1/init.c
@@ -28,14 +28,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/string.h>
+
 #include <linux/kernel.h>
-#include <linux/sched.h>
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/bootmem.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/mtx-1/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/mtx-1/irqmap.c
+++ linux-2.6/arch/mips/au1000/mtx-1/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 char irq_tab_alchemy[][5] __initdata = {
Index: linux-2.6/arch/mips/au1000/mtx-1/platform.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/mtx-1/platform.c
+++ linux-2.6/arch/mips/au1000/mtx-1/platform.c
@@ -19,7 +19,6 @@
  */
 
 #include <linux/init.h>
-#include <linux/types.h>
 #include <linux/platform_device.h>
 #include <linux/leds.h>
 #include <linux/gpio_keys.h>
Index: linux-2.6/arch/mips/au1000/pb1000/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1000/board_setup.c
+++ linux-2.6/arch/mips/au1000/pb1000/board_setup.c
@@ -23,19 +23,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
 #include <linux/delay.h>
 
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-pb1x00/pb1000.h>
 
Index: linux-2.6/arch/mips/au1000/pb1000/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1000/init.c
+++ linux-2.6/arch/mips/au1000/pb1000/init.c
@@ -26,14 +26,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/pb1000/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1000/irqmap.c
+++ linux-2.6/arch/mips/au1000/pb1000/irqmap.c
@@ -25,26 +25,10 @@
  *  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/mach-au1x00/au1000.h>
 
 struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
Index: linux-2.6/arch/mips/au1000/pb1100/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1100/board_setup.c
+++ linux-2.6/arch/mips/au1000/pb1100/board_setup.c
@@ -23,19 +23,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
 #include <linux/delay.h>
 
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-pb1x00/pb1100.h>
 
Index: linux-2.6/arch/mips/au1000/pb1100/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1100/init.c
+++ linux-2.6/arch/mips/au1000/pb1100/init.c
@@ -27,14 +27,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/pb1100/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1100/irqmap.c
+++ linux-2.6/arch/mips/au1000/pb1100/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
Index: linux-2.6/arch/mips/au1000/pb1200/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1200/board_setup.c
+++ linux-2.6/arch/mips/au1000/pb1200/board_setup.c
@@ -23,27 +23,11 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
 #include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
-#include <linux/mc146818rtc.h>
-#include <linux/delay.h>
-
-#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
-#include <linux/ide.h>
-#endif
-
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
 
 #include <au1000.h>
-#include <au1xxx_dbdma.h>
 #include <prom.h>
 
 #ifdef CONFIG_MIPS_PB1200
@@ -52,8 +36,6 @@
 
 #ifdef CONFIG_MIPS_DB1200
 #include <asm/mach-db1x00/db1200.h>
-#define PB1200_ETH_INT DB1200_ETH_INT
-#define PB1200_IDE_INT DB1200_IDE_INT
 #endif
 
 extern void _board_init_irq(void);
Index: linux-2.6/arch/mips/au1000/pb1200/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1200/init.c
+++ linux-2.6/arch/mips/au1000/pb1200/init.c
@@ -27,14 +27,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/pb1200/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1200/irqmap.c
+++ linux-2.6/arch/mips/au1000/pb1200/irqmap.c
@@ -22,26 +22,10 @@
  *  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/mach-au1x00/au1000.h>
 
 #ifdef CONFIG_MIPS_PB1200
Index: linux-2.6/arch/mips/au1000/pb1500/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1500/board_setup.c
+++ linux-2.6/arch/mips/au1000/pb1500/board_setup.c
@@ -23,19 +23,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
 #include <linux/delay.h>
 
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-pb1x00/pb1500.h>
 
Index: linux-2.6/arch/mips/au1000/pb1500/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1500/init.c
+++ linux-2.6/arch/mips/au1000/pb1500/init.c
@@ -27,14 +27,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/pb1500/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1500/irqmap.c
+++ linux-2.6/arch/mips/au1000/pb1500/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 char irq_tab_alchemy[][5] __initdata = {
Index: linux-2.6/arch/mips/au1000/pb1550/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1550/board_setup.c
+++ linux-2.6/arch/mips/au1000/pb1550/board_setup.c
@@ -27,20 +27,9 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
-#include <linux/mc146818rtc.h>
-#include <linux/delay.h>
-
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
+
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-pb1x00/pb1550.h>
 
Index: linux-2.6/arch/mips/au1000/pb1550/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1550/init.c
+++ linux-2.6/arch/mips/au1000/pb1550/init.c
@@ -27,14 +27,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/pb1550/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1550/irqmap.c
+++ linux-2.6/arch/mips/au1000/pb1550/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 char irq_tab_alchemy[][5] __initdata = {
Index: linux-2.6/arch/mips/au1000/xxs1500/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/xxs1500/board_setup.c
+++ linux-2.6/arch/mips/au1000/xxs1500/board_setup.c
@@ -23,19 +23,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
 #include <linux/delay.h>
 
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
 #include <asm/mach-au1x00/au1000.h>
 
 void board_reset(void)
Index: linux-2.6/arch/mips/au1000/xxs1500/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/xxs1500/init.c
+++ linux-2.6/arch/mips/au1000/xxs1500/init.c
@@ -26,14 +26,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/xxs1500/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/xxs1500/irqmap.c
+++ linux-2.6/arch/mips/au1000/xxs1500/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
Index: linux-2.6/arch/mips/pci/fixup-au1000.c
===================================================================
--- linux-2.6.orig/arch/mips/pci/fixup-au1000.c
+++ linux-2.6/arch/mips/pci/fixup-au1000.c
@@ -26,13 +26,10 @@
  *  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/pci.h>
-#include <linux/kernel.h>
 #include <linux/init.h>
 
-#include <asm/mach-au1x00/au1000.h>
-
 extern char irq_tab_alchemy[][5];
 
 int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)


From ralf@linux-mips.org Wed Apr 16 18:27:46 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 16 Apr 2008 18:27:48 +0100 (BST)
Received: from oss.sgi.com ([192.48.170.157]:21129 "EHLO oss.sgi.com")
	by ftp.linux-mips.org with ESMTP id S20029584AbYDPR1q (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 16 Apr 2008 18:27:46 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3GHQw4I008668
	for <linux-mips@linux-mips.org>; Wed, 16 Apr 2008 10:26:59 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m3GHRdmI006378;
	Wed, 16 Apr 2008 18:27:39 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m3GHRcnw006377;
	Wed, 16 Apr 2008 18:27:38 +0100
Date:	Wed, 16 Apr 2008 18:27:37 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] Alchemy: kill useless #include's, #define's and
	extern's (take 3)
Message-ID: <20080416172737.GA32263@linux-mips.org>
References: <200804162115.59620.sshtylyov@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200804162115.59620.sshtylyov@ru.mvista.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18938
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 462
Lines: 16

On Wed, Apr 16, 2008 at 09:15:59PM +0400, Sergei Shtylyov wrote:

> Go thru the Alchemy code and hunt down every unneeded #include, #define, and
> extern (some of which refer to already long dead functions).
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
> 
> ---
> Killed #include <au1xxx_dbdma.h> and couple #define's in
> arch/mips/au1000/pb1200/board_setup.c...
> 
> Please update the queued patch, hopefully the last time. :-)

Done,

  Ralf

From ralf@linux-mips.org Wed Apr 16 19:01:05 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 16 Apr 2008 19:01:07 +0100 (BST)
Received: from oss.sgi.com ([192.48.170.157]:59017 "EHLO oss.sgi.com")
	by ftp.linux-mips.org with ESMTP id S20029399AbYDPSBF (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 16 Apr 2008 19:01:05 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3GI0J5i010956
	for <linux-mips@linux-mips.org>; Wed, 16 Apr 2008 11:00:19 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m3GI0xv6007079;
	Wed, 16 Apr 2008 19:00:59 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m3GI0xa0007078;
	Wed, 16 Apr 2008 19:00:59 +0100
Date:	Wed, 16 Apr 2008 19:00:59 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Roel Kluin <12o3l@tiscali.nl>
Cc:	linux-mips@linux-mips.org, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/6] MIPS: irixelf: fix test unsigned var < 0
Message-ID: <20080416180059.GC32263@linux-mips.org>
References: <480558CA.7090800@tiscali.nl>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <480558CA.7090800@tiscali.nl>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18939
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 380
Lines: 12

On Wed, Apr 16, 2008 at 03:39:22AM +0200, Roel Kluin wrote:

> v is unsigned, cast to signed to evaluate the do_brk() return value,

do_brk() is expected to return its first argument as the result in case
of success.  An error also wasn't getting propagated so some further
fixes were needed for irix_map_prda_page and its caller.  So I'll apply
a different fix.

Thanks!

  Ralf

From sshtylyov@ru.mvista.com Wed Apr 16 19:54:55 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 16 Apr 2008 19:54:58 +0100 (BST)
Received: from h155.mvista.com ([63.81.120.155]:28040 "EHLO imap.sh.mvista.com")
	by ftp.linux-mips.org with ESMTP id S20029896AbYDPSyz (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 16 Apr 2008 19:54:55 +0100
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id 77FCD3EC9; Wed, 16 Apr 2008 11:54:48 -0700 (PDT)
Message-ID: <48064B52.4050804@ru.mvista.com>
Date:	Wed, 16 Apr 2008 22:54:10 +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 Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] Alchemy: kill useless #include's, #define's and	extern's
 (take 3)
References: <200804162115.59620.sshtylyov@ru.mvista.com> <20080416172737.GA32263@linux-mips.org>
In-Reply-To: <20080416172737.GA32263@linux-mips.org>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18940
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 525
Lines: 21

Ralf Baechle wrote:

>>Go thru the Alchemy code and hunt down every unneeded #include, #define, and
>>extern (some of which refer to already long dead functions).

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

>>---
>>Killed #include <au1xxx_dbdma.h> and couple #define's in
>>arch/mips/au1000/pb1200/board_setup.c...

>>Please update the queued patch, hopefully the last time. :-)

> Done,

    Thanks. But actually, summary and description also did change -- but not 
in the queue. :-)

>   Ralf

WBR, Sergei

From marcin.slusarz@gmail.com Wed Apr 16 20:40:20 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 16 Apr 2008 20:40:22 +0100 (BST)
Received: from nf-out-0910.google.com ([64.233.182.191]:41900 "EHLO
	nf-out-0910.google.com") by ftp.linux-mips.org with ESMTP
	id S20030142AbYDPTkU (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 16 Apr 2008 20:40:20 +0100
Received: by nf-out-0910.google.com with SMTP id b11so758404nfh.14
        for <linux-mips@linux-mips.org>; Wed, 16 Apr 2008 12:40:13 -0700 (PDT)
DKIM-Signature:	v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:date:from:to:cc:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent;
        bh=LeU4640JuXOAT3alpUq4Dlf3VUA2GyhCHU9wHSqaM2g=;
        b=KnPUDvoxbuP6LdL1l7S3xI2lmAaPzXCIfaqjFMmsP5Kza9IXjbTmgS85JF64tC3BhsNz3gZDqekD9qB3IIE3R1oWTtmoUppfzamz9hTZvQCNrX6cSVGdMD9feor6se/WPdPFMi32d9QLiJf2plgTKf6f63SsSRY3m43Hgn+rdzA=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=date:from:to:cc:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent;
        b=WLp8gMTRHhY2RUld/XToVJfOZt84n7OFrWfp85w4iTSrM2T4hZEFt6hjg0KTMK9z7gxrHj3Xf58VqYsPoJUZDabuUg8gq25kcJggayby7ZT341cKk/CDt3UH6D0GzB3rhFSHPSMDp9fTgVqD99Y8OiCz9D8tnkVUfmltjGLB5gk=
Received: by 10.78.100.2 with SMTP id x2mr709796hub.52.1208374813223;
        Wed, 16 Apr 2008 12:40:13 -0700 (PDT)
Received: from @ ( [91.94.225.201])
        by mx.google.com with ESMTPS id d25sm14166788nfh.33.2008.04.16.12.40.03
        (version=TLSv1/SSLv3 cipher=OTHER);
        Wed, 16 Apr 2008 12:40:12 -0700 (PDT)
Date:	Wed, 16 Apr 2008 21:39:44 +0200
From:	Marcin Slusarz <marcin.slusarz@gmail.com>
To:	Roel Kluin <12o3l@tiscali.nl>
Cc:	ralf@linux-mips.org, linux-mips@linux-mips.org,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/6] MIPS: irixelf: fix test unsigned var < 0
Message-ID: <20080416193941.GB6264@joi>
References: <480558CA.7090800@tiscali.nl>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <480558CA.7090800@tiscali.nl>
User-Agent: Mutt/1.5.16 (2007-06-09)
Return-Path: <marcin.slusarz@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: 18941
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: marcin.slusarz@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1150
Lines: 34

On Wed, Apr 16, 2008 at 03:39:22AM +0200, Roel Kluin wrote:
> v is unsigned, cast to signed to evaluate the do_brk() return value,
>     
> Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
> ---
> diff --git a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c
> index 290d8e3..fad2a2a 100644
> --- a/arch/mips/kernel/irixelf.c
> +++ b/arch/mips/kernel/irixelf.c
> @@ -583,15 +583,15 @@ static void irix_map_prda_page(void)
>  	unsigned long v;
>  	struct prda *pp;
>  
>  	down_write(&current->mm->mmap_sem);
>  	v =  do_brk(PRDA_ADDRESS, PAGE_SIZE);
>  	up_write(&current->mm->mmap_sem);
>  
> -	if (v < 0)
> +	if ((long) v < 0)
maybe cast it earlier (to struct prda *) and check error with IS_ERR?

>  		return;
>  
>  	pp = (struct prda *) v;
>  	pp->prda_sys.t_pid  = task_pid_vnr(current);
>  	pp->prda_sys.t_prid = read_c0_prid();
>  	pp->prda_sys.t_rpid = task_pid_vnr(current);
>  
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

From tux-master@web.de Wed Apr 16 21:12:52 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 16 Apr 2008 21:12:54 +0100 (BST)
Received: from fmmailgate03.web.de ([217.72.192.234]:63617 "EHLO
	fmmailgate03.web.de") by ftp.linux-mips.org with ESMTP
	id S20030350AbYDPUMw (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 16 Apr 2008 21:12:52 +0100
Received: from smtp05.web.de (fmsmtp05.dlan.cinetic.de [172.20.4.166])
	by fmmailgate03.web.de (Postfix) with ESMTP id 6AABDD74FFD0;
	Wed, 16 Apr 2008 22:12:43 +0200 (CEST)
Received: from [77.178.173.29] (helo=merkur.sol.de)
	by smtp05.web.de with asmtp (TLSv1:AES256-SHA:256)
	(WEB.DE 4.109 #226)
	id 1JmDzn-0007wa-00; Wed, 16 Apr 2008 22:12:43 +0200
Received: from jens by merkur.sol.de with local (Exim 4.63)
	(envelope-from <tux-master@web.de>)
	id 1JmDsd-0005dw-4n; Wed, 16 Apr 2008 22:05:19 +0200
Date:	Wed, 16 Apr 2008 22:05:19 +0200
From:	Jens Seidel <jensseidel@users.sf.net>
To:	linux-mips@linux-mips.org,
	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Subject: Re: [PATCH] Alchemy: kill useless #include's, #define's and extern's (take 3)
Message-ID: <20080416200517.GA21402@merkur.sol.de>
References: <200804162115.59620.sshtylyov@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200804162115.59620.sshtylyov@ru.mvista.com>
User-Agent: Mutt/1.5.13 (2006-08-11)
X-Sender: tux-master@web.de
X-Provags-ID: V01U2FsdGVkX1/99qTNxT3eGWA3/Cp5LnB7txU2eRKN0jGLU/lt
	w6cONwVsMu5T8sf1UtodlIOHhmQTcxE3qXrEMLo8dgnVhlsRNj
	zHXdTcK3A=
Return-Path: <tux-master@web.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: 18942
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: jensseidel@users.sf.net
Precedence: bulk
X-list: linux-mips
Content-Length: 400
Lines: 12

Hi Sergei,

On Wed, Apr 16, 2008 at 09:15:59PM +0400, Sergei Shtylyov wrote:
> Go thru the Alchemy code and hunt down every unneeded #include, #define, and
> extern (some of which refer to already long dead functions).

that's an impressive patch! Did you created it manually or do you have a
script which does the checks for you?

I have a program which would probably profit from it as well.

Jens

From tsbogend@alpha.franken.de Wed Apr 16 23:28:11 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 16 Apr 2008 23:28:15 +0100 (BST)
Received: from elvis.franken.de ([193.175.24.41]:35718 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S20030847AbYDPW2L (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 16 Apr 2008 23:28:11 +0100
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JmG6o-00084V-00; Thu, 17 Apr 2008 00:28:06 +0200
Received: by solo.franken.de (Postfix, from userid 1000)
	id 13667C3E3F; Thu, 17 Apr 2008 00:27:56 +0200 (CEST)
Date:	Thu, 17 Apr 2008 00:27:56 +0200
To:	Roel Kluin <12o3l@tiscali.nl>
Cc:	ralf@linux-mips.org, linux-mips@linux-mips.org,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/6 v2] MIPS: ip27-timer: unsigned irq to evaluate allocate_irqno()
Message-ID: <20080416222755.GA18832@alpha.franken.de>
References: <480559DC.2060807@tiscali.nl> <20080416091554.GA6026@alpha.franken.de> <480616C6.3080203@tiscali.nl>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <480616C6.3080203@tiscali.nl>
User-Agent: Mutt/1.5.13 (2006-08-11)
From:	tsbogend@alpha.franken.de (Thomas Bogendoerfer)
Return-Path: <tsbogend@alpha.franken.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18943
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips
Content-Length: 663
Lines: 20

On Wed, Apr 16, 2008 at 05:09:58PM +0200, Roel Kluin wrote:
> Thomas Bogendoerfer wrote:
> > On Wed, Apr 16, 2008 at 03:43:56AM +0200, Roel Kluin wrote:
> >> irq is unsigned, cast to signed to evaluate the allocate_irqno() return value,
>  
> >> +		if ((int) irq < 0)
> > 
> > Why don't you just make irq and rt_timer_irq an int ?
> 
> Ok, thanks, It should be right, but I cannot test this (no hardware).

I've tested it on real hardware.

Acked-By: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

Thomas.

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

From jeff@garzik.org Thu Apr 17 01:54:19 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 17 Apr 2008 01:54:22 +0100 (BST)
Received: from srv5.dvmed.net ([207.36.208.214]:21684 "EHLO mail.dvmed.net")
	by ftp.linux-mips.org with ESMTP id S20030720AbYDQAyT (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 17 Apr 2008 01:54:19 +0100
Received: from cpe-069-134-071-233.nc.res.rr.com ([69.134.71.233] helo=core.yyz.us)
	by mail.dvmed.net with esmtpsa (Exim 4.68 #1 (Red Hat Linux))
	id 1JmIOB-00083H-SZ; Thu, 17 Apr 2008 00:54:12 +0000
Message-ID: <48069FB3.1070404@garzik.org>
Date:	Wed, 16 Apr 2008 20:54:11 -0400
From:	Jeff Garzik <jeff@garzik.org>
User-Agent: Thunderbird 2.0.0.12 (X11/20080226)
MIME-Version: 1.0
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
CC:	Andy Fleming <afleming@freescale.com>, linux-mips@linux-mips.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH 1/6] tc35815: Statistics cleanup
References: <20080411.002412.03977557.anemo@mba.ocn.ne.jp>	<48007A41.2000803@garzik.org> <20080413.001146.25909265.anemo@mba.ocn.ne.jp>
In-Reply-To: <20080413.001146.25909265.anemo@mba.ocn.ne.jp>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <jeff@garzik.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18944
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: jeff@garzik.org
Precedence: bulk
X-list: linux-mips
Content-Length: 1205
Lines: 35

Atsushi Nemoto wrote:
> On Sat, 12 Apr 2008 05:00:49 -0400, Jeff Garzik <jeff@garzik.org> wrote:
>> applied 1-6
> 
> Thanks.
> 
> Could you apply this too, or hopufully fold into Andy Fleming's "phy:
> Change mii_bus id field to a string" patch (commit c69fedae) ?
> 
> ------------------------------------------------------
> Subject: [PATCH] tc35815: build fix
> 
> Fix build failure caused by Andy Fleming's "phy: Change mii_bus id
> field to a string" patch.
> 
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
> ---
> diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
> index 744f11f..10e4e85 100644
> --- a/drivers/net/tc35815.c
> +++ b/drivers/net/tc35815.c
> @@ -766,7 +766,8 @@ static int tc_mii_init(struct net_device *dev)
>  	lp->mii_bus.name = "tc35815_mii_bus";
>  	lp->mii_bus.read = tc_mdio_read;
>  	lp->mii_bus.write = tc_mdio_write;
> -	lp->mii_bus.id = (lp->pci_dev->bus->number << 8) | lp->pci_dev->devfn;
> +	snprintf(lp->mii_bus.id, MII_BUS_ID_SIZE, "%x",
> +		 (lp->pci_dev->bus->number << 8) | lp->pci_dev->devfn);
>  	lp->mii_bus.priv = dev;
>  	lp->mii_bus.dev = &lp->pci_dev->dev;
>  	lp->mii_bus.irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);

applied



From ralf@linux-mips.org Thu Apr 17 10:51:44 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 17 Apr 2008 10:51:46 +0100 (BST)
Received: from oss.sgi.com ([192.48.170.157]:64171 "EHLO oss.sgi.com")
	by ftp.linux-mips.org with ESMTP id S28576551AbYDQJvo (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 17 Apr 2008 10:51:44 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3H9ovKb009148
	for <linux-mips@linux-mips.org>; Thu, 17 Apr 2008 02:50:57 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m3H9pbKP026509;
	Thu, 17 Apr 2008 10:51:37 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m3H9palM026508;
	Thu, 17 Apr 2008 10:51:36 +0100
Date:	Thu, 17 Apr 2008 10:51:36 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] Alchemy: kill useless #include's, #define's and
	extern's (take 3)
Message-ID: <20080417095136.GA26409@linux-mips.org>
References: <200804162115.59620.sshtylyov@ru.mvista.com> <20080416172737.GA32263@linux-mips.org> <48064B52.4050804@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <48064B52.4050804@ru.mvista.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18945
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 259
Lines: 12

On Wed, Apr 16, 2008 at 10:54:10PM +0400, Sergei Shtylyov wrote:

>>> Please update the queued patch, hopefully the last time. :-)
>
>> Done,
>
>    Thanks. But actually, summary and description also did change -- but not 
> in the queue. :-)

Fixed.

  Ralf

From ralf@linux-mips.org Thu Apr 17 12:00:10 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 17 Apr 2008 12:00:13 +0100 (BST)
Received: from oss.sgi.com ([192.48.170.157]:54444 "EHLO oss.sgi.com")
	by ftp.linux-mips.org with ESMTP id S28576665AbYDQLAK (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 17 Apr 2008 12:00:10 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3HAxJhW013035
	for <linux-mips@linux-mips.org>; Thu, 17 Apr 2008 03:59:20 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m3HAxsMK028752;
	Thu, 17 Apr 2008 11:59:55 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m3HAxr4m028739;
	Thu, 17 Apr 2008 11:59:53 +0100
Date:	Thu, 17 Apr 2008 11:59:52 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc:	Roel Kluin <12o3l@tiscali.nl>, linux-mips@linux-mips.org,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/6 v2] MIPS: ip27-timer: unsigned irq to evaluate
	allocate_irqno()
Message-ID: <20080417105930.GA28713@linux-mips.org>
References: <480559DC.2060807@tiscali.nl> <20080416091554.GA6026@alpha.franken.de> <480616C6.3080203@tiscali.nl> <20080416222755.GA18832@alpha.franken.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080416222755.GA18832@alpha.franken.de>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18946
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 623
Lines: 20

On Thu, Apr 17, 2008 at 12:27:56AM +0200, Thomas Bogendoerfer wrote:

> On Wed, Apr 16, 2008 at 05:09:58PM +0200, Roel Kluin wrote:
> > Thomas Bogendoerfer wrote:
> > > On Wed, Apr 16, 2008 at 03:43:56AM +0200, Roel Kluin wrote:
> > >> irq is unsigned, cast to signed to evaluate the allocate_irqno() return value,
> >  
> > >> +		if ((int) irq < 0)
> > > 
> > > Why don't you just make irq and rt_timer_irq an int ?
> > 
> > Ok, thanks, It should be right, but I cannot test this (no hardware).
> 
> I've tested it on real hardware.
> 
> Acked-By: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

Thanks, applied.

  Ralf

From sshtylyov@ru.mvista.com Thu Apr 17 12:34:42 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 17 Apr 2008 12:34:44 +0100 (BST)
Received: from h155.mvista.com ([63.81.120.155]:56501 "EHLO imap.sh.mvista.com")
	by ftp.linux-mips.org with ESMTP id S28576737AbYDQLem (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 17 Apr 2008 12:34:42 +0100
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id 3DE843EC9; Thu, 17 Apr 2008 04:34:38 -0700 (PDT)
Message-ID: <480735A8.8010900@ru.mvista.com>
Date:	Thu, 17 Apr 2008 15:34:00 +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:	Jens Seidel <jensseidel@users.sf.net>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] Alchemy: kill useless #include's, #define's and extern's
 (take 3)
References: <200804162115.59620.sshtylyov@ru.mvista.com> <20080416200517.GA21402@merkur.sol.de>
In-Reply-To: <20080416200517.GA21402@merkur.sol.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: 18947
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 315
Lines: 11

Jens Seidel wrote:

>>Go thru the Alchemy code and hunt down every unneeded #include, #define, and
>>extern (some of which refer to already long dead functions).

> that's an impressive patch! Did you created it manually or do you have a
> script which does the checks for you?

    All hand work. :-)

WBR, Sergei

From ralf@linux-mips.org Thu Apr 17 13:10:11 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 17 Apr 2008 13:10:14 +0100 (BST)
Received: from oss.sgi.com ([192.48.170.157]:25262 "EHLO oss.sgi.com")
	by ftp.linux-mips.org with ESMTP id S28576837AbYDQMKL (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 17 Apr 2008 13:10:11 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3HC9LLU022210
	for <linux-mips@linux-mips.org>; Thu, 17 Apr 2008 05:09:24 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m3HCA2Vl031265;
	Thu, 17 Apr 2008 13:10:02 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m3HCA1kX031258;
	Thu, 17 Apr 2008 13:10:01 +0100
Date:	Thu, 17 Apr 2008 13:10:01 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	"Kevin D. Kissell" <kevink@mips.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: Patches for 34K APRP
Message-ID: <20080417121001.GA30873@linux-mips.org>
References: <4805FFE6.5080903@mips.com> <48060258.8050904@mips.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <48060258.8050904@mips.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18948
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 1165
Lines: 26

On Wed, Apr 16, 2008 at 03:42:48PM +0200, Kevin D. Kissell wrote:

> Sigh.  Some mailers (including Thunderbird for Windows)
> seem to be unable to handle the attachment of the patch
> files by Thunderbird.  So I attach them as a .tgz, which
> even Outlook should be able to deal with correctly.

With the kernel maintainers head hidden for a moment - the attachments
certainly were ok, I was able to feed them to patch and had no problems
applying them.

With the kernel maintainers hat firmly back on the head:

 o git will use the Subject: line followed by the body followed by the
   attachment's leading comment as the commit message for the patch.
   Anything after a "---" tearoff line such a signature will be dropped.
   For the submitter that means to ensure only things that are meant to
   go into the log should be before the tearoff line.
 o As the result of this method git will only be able to handle a single
   patch per email.  But that's not a problem anyway.  Patches are meant
   to be easily discussable by email and that's best done with a single
   patch per mail.

I'm going to send comments on the actual patch by separate email.

  Ralf

From ralf@linux-mips.org Thu Apr 17 13:30:02 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 17 Apr 2008 13:30:05 +0100 (BST)
Received: from oss.sgi.com ([192.48.170.157]:37038 "EHLO oss.sgi.com")
	by ftp.linux-mips.org with ESMTP id S20025662AbYDQMaC (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 17 Apr 2008 13:30:02 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3HCTI1t023347
	for <linux-mips@linux-mips.org>; Thu, 17 Apr 2008 05:29:18 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m3HCTxSc031855;
	Thu, 17 Apr 2008 13:29:59 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m3HCTwg4031853;
	Thu, 17 Apr 2008 13:29:58 +0100
Date:	Thu, 17 Apr 2008 13:29:58 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	"Kevin D. Kissell" <kevink@mips.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: Patches for 34K APRP
Message-ID: <20080417122958.GA31790@linux-mips.org>
References: <4805FFE6.5080903@mips.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4805FFE6.5080903@mips.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18949
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 1592
Lines: 41

On Wed, Apr 16, 2008 at 03:32:22PM +0200, Kevin D. Kissell wrote:

> >From d164aa1b9dba720ee08a6a773e1a81b62aea7d10 Mon Sep 17 00:00:00 2001
> From: Kevin D. Kissell <kevink@mips.com>
> Date: Thu, 10 Apr 2008 02:07:38 +0200
> Subject: [PATCH] Fixes necessary for non-SMP kernels and non-relocatable binaries

>  		struct elf_phdr *phdr = (struct elf_phdr *) ((char *)hdr + hdr->e_phoff);
>  
>  		for (i = 0; i < hdr->e_phnum; i++) {
> -			if (phdr->p_type != PT_LOAD)
> -				continue;
> -
> -			memcpy((void *)phdr->p_paddr, (char *)hdr + phdr->p_offset, phdr->p_filesz);
> -			memset((void *)phdr->p_paddr + phdr->p_filesz, 0, phdr->p_memsz - phdr->p_filesz);
> -			phdr++;
> +		    if (phdr->p_type == PT_LOAD) {
> +			memcpy((void *)phdr->p_paddr, 
> +				(char *)hdr + phdr->p_offset, phdr->p_filesz);
> +			memset((void *)phdr->p_paddr + phdr->p_filesz, 
> +				0, phdr->p_memsz - phdr->p_filesz);
> +		    }

Patch applied with some reformatting to stick to the one tab per nesting
level rule.  Also git was bitching a little about whitespace:

.dotest/patch:13:       /* 
Space in indent is followed by a tab.
.dotest/patch:14:        * SMTC/SMVP kernels manage VPE enable independently,
Space in indent is followed by a tab.
.dotest/patch:15:        * but uniprocessor kernels need to turn it on, even
Space in indent is followed by a tab.
.dotest/patch:16:        * if that wasn't the pre-dvpe() state.
Space in indent is followed by a tab.
.dotest/patch:17:        */
warning: squelched 2 whitespace errors
warning: 7 lines applied after fixing whitespace errors.

Thanks,

  Ralf

From ralf@linux-mips.org Thu Apr 17 13:43:24 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 17 Apr 2008 13:43:26 +0100 (BST)
Received: from oss.sgi.com ([192.48.170.157]:47022 "EHLO oss.sgi.com")
	by ftp.linux-mips.org with ESMTP id S28574015AbYDQMnY (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 17 Apr 2008 13:43:24 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3HCgcgj024156
	for <linux-mips@linux-mips.org>; Thu, 17 Apr 2008 05:42:39 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m3HChJ5F032172;
	Thu, 17 Apr 2008 13:43:19 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m3HChJDg032171;
	Thu, 17 Apr 2008 13:43:19 +0100
Date:	Thu, 17 Apr 2008 13:43:19 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	"Kevin D. Kissell" <kevink@mips.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: Patches for 34K APRP
Message-ID: <20080417124319.GA31453@linux-mips.org>
References: <4805FFE6.5080903@mips.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4805FFE6.5080903@mips.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18950
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 783
Lines: 25

On Wed, Apr 16, 2008 at 03:32:22PM +0200, Kevin D. Kissell wrote:

>  arch/mips/kernel/setup.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
> index f8a535a..a6a0d62 100644
> --- a/arch/mips/kernel/setup.c
> +++ b/arch/mips/kernel/setup.c
> @@ -336,6 +336,10 @@ static void __init bootmem_init(void)
>  #endif
>  		max_low_pfn = PFN_DOWN(HIGHMEM_START);
>  	}
> +	/*
> +	 * Propagate final value of max_low_pfn to max_pfn
> +	 */
> +	max_pfn = max_low_pfn;

That will be incorrect for systems with highmem.  So I think the right
fix is to replace all references to max_pfn in vpe.c with max_low_pfn.

It still won't play nicely with esotheric configurations such as
discontig memory ...

  Ralf

From ralf@linux-mips.org Thu Apr 17 14:26:22 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 17 Apr 2008 14:26:24 +0100 (BST)
Received: from oss.sgi.com ([192.48.170.157]:49327 "EHLO oss.sgi.com")
	by ftp.linux-mips.org with ESMTP id S20022591AbYDQN0W (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 17 Apr 2008 14:26:22 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3HDPTvd026671
	for <linux-mips@linux-mips.org>; Thu, 17 Apr 2008 06:25:32 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m3HDQAML000599;
	Thu, 17 Apr 2008 14:26:10 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m3HDQASU000598;
	Thu, 17 Apr 2008 14:26:10 +0100
Date:	Thu, 17 Apr 2008 14:26:10 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	"Kevin D. Kissell" <kevink@mips.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: Patches for 34K APRP
Message-ID: <20080417132610.GB31453@linux-mips.org>
References: <4805FFE6.5080903@mips.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4805FFE6.5080903@mips.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18951
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 7046
Lines: 246

On Wed, Apr 16, 2008 at 03:32:22PM +0200, Kevin D. Kissell wrote:

> --- a/arch/mips/kernel/kspd.c
> +++ b/arch/mips/kernel/kspd.c
> @@ -257,7 +257,7 @@ void sp_work_handle_request(void)
>  
>  		vcwd = vpe_getcwd(tclimit);
>  
> - 		/* change to the cwd of the process that loaded the SP program */
> + 		/* change to cwd of the process that loaded the SP program */
>  		old_fs = get_fs();
>  		set_fs(KERNEL_DS);
>  		sys_chdir(vcwd);
> @@ -323,6 +323,9 @@ static void sp_cleanup(void)
>  			set >>= 1;
>  		}
>  	}
> +
> +	/* Put daemon cwd back to root to avoid umount problems */
> +	sys_chdir("/");

Still not kosher; there might be multiple roots on a system ...

>  }
>  
>  static int channel_open = 0;
> diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c
> index 1ba00c1..c0bb347 100644
> --- a/arch/mips/kernel/rtlx.c
> +++ b/arch/mips/kernel/rtlx.c
> @@ -73,6 +73,15 @@ static void rtlx_dispatch(void)
>  static irqreturn_t rtlx_interrupt(int irq, void *dev_id)
>  {
>  	int i;
> +	unsigned int flags, vpeflags;
> +
> +	/* Ought not to be strictly necessary for SMTC builds */
> +	local_irq_save(flags);
> +	vpeflags = dvpe();
> +	set_c0_status(0x100 << MIPS_CPU_RTLX_IRQ);
> +	irq_enable_hazard();
> +	evpe(vpeflags);
> +	local_irq_restore(flags);
>  
>  	for (i = 0; i < RTLX_CHANNELS; i++) {
>  			wake_up(&channel_wqs[i].lx_queue);
> @@ -109,7 +118,8 @@ static void __used dump_rtlx(void)
>  static int rtlx_init(struct rtlx_info *rtlxi)
>  {
>  	if (rtlxi->id != RTLX_ID) {
> -		printk(KERN_ERR "no valid RTLX id at 0x%p 0x%lx\n", rtlxi, rtlxi->id);
> +		printk(KERN_ERR "no valid RTLX id at 0x%p 0x%lx\n", 
> +			rtlxi, rtlxi->id);
>  		return -ENOEXEC;
>  	}
>  
> @@ -163,51 +173,51 @@ int rtlx_open(int index, int can_sleep)
>  
>  	if (rtlx == NULL) {
>  		if( (p = vpe_get_shared(tclimit)) == NULL) {
> -			if (can_sleep) {
> -				__wait_event_interruptible(channel_wqs[index].lx_queue,
> -				                           (p = vpe_get_shared(tclimit)),
> -				                           ret);
> -				if (ret)
> -					goto out_fail;
> -			} else {
> -				printk(KERN_DEBUG "No SP program loaded, and device "
> -					"opened with O_NONBLOCK\n");
> -				ret = -ENOSYS;
> +		    if (can_sleep) {
> +			__wait_event_interruptible(channel_wqs[index].lx_queue,
> +				(p = vpe_get_shared(tclimit)), ret);
> +			if (ret)
>  				goto out_fail;
> -			}
> +		    } else {
> +			printk(KERN_DEBUG "No SP program loaded, and device "
> +					"opened with O_NONBLOCK\n");
> +			ret = -ENOSYS;
> +			goto out_fail;
> +		    }
>  		}
>  
>  		smp_rmb();
>  		if (*p == NULL) {
> -			if (can_sleep) {
> -				DEFINE_WAIT(wait);
> -
> -				for (;;) {
> -					prepare_to_wait(&channel_wqs[index].lx_queue, &wait, TASK_INTERRUPTIBLE);
> -					smp_rmb();
> -					if (*p != NULL)
> -						break;
> -					if (!signal_pending(current)) {
> -						schedule();
> -						continue;
> -					}
> -					ret = -ERESTARTSYS;
> -					goto out_fail;
> +		    if (can_sleep) {
> +			DEFINE_WAIT(wait);
> +
> +			for (;;) {
> +				prepare_to_wait(&channel_wqs[index].lx_queue, 
> +						&wait, TASK_INTERRUPTIBLE);
> +				smp_rmb();
> +				if (*p != NULL)
> +					break;
> +				if (!signal_pending(current)) {
> +					schedule();
> +					continue;
>  				}
> -				finish_wait(&channel_wqs[index].lx_queue, &wait);
> -			} else {
> -				printk(" *vpe_get_shared is NULL. "
> -				       "Has an SP program been loaded?\n");
> -				ret = -ENOSYS;
> +				ret = -ERESTARTSYS;
>  				goto out_fail;
>  			}
> +			finish_wait(&channel_wqs[index].lx_queue, &wait);
> +		    } else {
> +			printk(" *vpe_get_shared is NULL. "
> +			       "Has an SP program been loaded?\n");
> +				ret = -ENOSYS;
> +				goto out_fail;
> +		    }
>  		}
>  
>  		if ((unsigned int)*p < KSEG0) {
> -			printk(KERN_WARNING "vpe_get_shared returned an invalid pointer "
> -			       "maybe an error code %d\n", (int)*p);
> -			ret = -ENOSYS;
> -			goto out_fail;
> +		    printk(KERN_WARNING "vpe_get_shared returned an invalid "
> +			"pointer maybe an error code %d\n", (int)*p);
> +		    ret = -ENOSYS;
> +		    goto out_fail;

Indention one tab per nested block.

>  		}
>  
>  		if ((ret = rtlx_init(*p)) < 0)
> @@ -233,6 +243,10 @@ out_ret:
>  
>  int rtlx_release(int index)
>  {
> + 	if (rtlx == NULL) {
> +		printk("rtlx_release() with null rtlx\n");

Missing KERN_ facility level.  I turned this printk into a pr_err().

> + 		return 0;
> +	}
>  	rtlx->channel[index].lx_state = RTLX_STATE_UNUSED;
>  	return 0;
>  }
> @@ -252,8 +266,8 @@ unsigned int rtlx_read_poll(int index, int can_sleep)
>  			int ret = 0;
>  
>  			__wait_event_interruptible(channel_wqs[index].lx_queue,
> -			                           chan->lx_read != chan->lx_write || sp_stopping,
> -			                           ret);
> +				(chan->lx_read != chan->lx_write) 
> +				|| sp_stopping, ret);

Linux conding style:

	if (expr1 ||
	    expr2)

GNU coding style:

	if (expr1
	    || expr2)

Gno GNUs ;-)

>  			if (ret)
>  				return ret;
>  
> @@ -283,7 +297,9 @@ static inline int write_spacefree(int read, int write, int size)
>  unsigned int rtlx_write_poll(int index)
>  {
>  	struct rtlx_channel *chan = &rtlx->channel[index];
> -	return write_spacefree(chan->rt_read, chan->rt_write, chan->buffer_size);
> +
> +	return write_spacefree(chan->rt_read, chan->rt_write, 
> +				chan->buffer_size);
>  }
>  
>  ssize_t rtlx_read(int index, void __user *buff, size_t count)
> @@ -345,8 +361,8 @@ ssize_t rtlx_write(int index, const void __user *buffer, size_t count)
>  	rt_read = rt->rt_read;
>  
>  	/* total number of bytes to copy */
> -	count = min(count,
> -		    (size_t)write_spacefree(rt_read, rt->rt_write, rt->buffer_size));
> +	count = min(count, (size_t)write_spacefree(rt_read, rt->rt_write, 
> +							rt->buffer_size));
>  
>  	/* first bit from write pointer to the end of the buffer, or count */
>  	fl = min(count, (size_t) rt->buffer_size - rt->rt_write);
> @@ -515,6 +531,11 @@ static int __init rtlx_module_init(void)
>  
>  	if (cpu_has_vint)
>  		set_vi_handler(MIPS_CPU_RTLX_IRQ, rtlx_dispatch);
> +	else {
> +		printk("APRP RTLX init on non-vectored-interrupt processor\n");

Missing KERN_ facility level.  I turned this printk into a pr_err().

> +		err = -ENODEV;
> +		goto out_chrdev;
> +	}
>  
>  	rtlx_irq.dev_id = rtlx;
>  	setup_irq(rtlx_irq_num, &rtlx_irq);
> diff --git a/include/asm-mips/rtlx.h b/include/asm-mips/rtlx.h
> index 65778c8..20b6660 100644
> --- a/include/asm-mips/rtlx.h
> +++ b/include/asm-mips/rtlx.h
> @@ -29,13 +29,13 @@ extern unsigned int rtlx_read_poll(int index, int can_sleep);
>  extern unsigned int rtlx_write_poll(int index);
>  
>  enum rtlx_state {
> -	RTLX_STATE_UNUSED,
> +	RTLX_STATE_UNUSED = 0,
>  	RTLX_STATE_INITIALISED,
>  	RTLX_STATE_REMOTE_READY,
>  	RTLX_STATE_OPENED
>  };
>  
> -#define RTLX_BUFFER_SIZE 1024
> +#define RTLX_BUFFER_SIZE 2048
>  
>  /* each channel supports read and write.
>     linux (vpe0) reads lx_buffer  and writes rt_buffer

Applie with a few fixes but not the chdir issue.

Thanks,

  Ralf

From kevink@mips.com Thu Apr 17 14:37:24 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 17 Apr 2008 14:37:27 +0100 (BST)
Received: from dns0.mips.com ([63.167.95.198]:17907 "EHLO dns0.mips.com")
	by ftp.linux-mips.org with ESMTP id S20021417AbYDQNhY (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 17 Apr 2008 14:37:24 +0100
Received: from mercury.mips.com (mercury [192.168.64.101])
	by dns0.mips.com (8.12.11/8.12.11) with ESMTP id m3HDaIFm003633;
	Thu, 17 Apr 2008 06:36:18 -0700 (PDT)
Received: from [127.0.0.1] (grendel [192.168.236.16])
	by mercury.mips.com (8.13.5/8.13.5) with ESMTP id m3HDbES0017774;
	Thu, 17 Apr 2008 06:37:15 -0700 (PDT)
Message-ID: <480752B8.9040601@mips.com>
Date:	Thu, 17 Apr 2008 15:38:00 +0200
From:	"Kevin D. Kissell" <kevink@mips.com>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
To:	Ralf Baechle <ralf@linux-mips.org>
CC:	linux-mips@linux-mips.org
Subject: Re: Patches for 34K APRP
References: <4805FFE6.5080903@mips.com> <20080417124319.GA31453@linux-mips.org>
In-Reply-To: <20080417124319.GA31453@linux-mips.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <kevink@mips.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18952
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: kevink@mips.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1359
Lines: 36

Ralf Baechle wrote:
> On Wed, Apr 16, 2008 at 03:32:22PM +0200, Kevin D. Kissell wrote:
>
>   
>>  arch/mips/kernel/setup.c |    4 ++++
>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
>> index f8a535a..a6a0d62 100644
>> --- a/arch/mips/kernel/setup.c
>> +++ b/arch/mips/kernel/setup.c
>> @@ -336,6 +336,10 @@ static void __init bootmem_init(void)
>>  #endif
>>  		max_low_pfn = PFN_DOWN(HIGHMEM_START);
>>  	}
>> +	/*
>> +	 * Propagate final value of max_low_pfn to max_pfn
>> +	 */
>> +	max_pfn = max_low_pfn;
>>     
>
> That will be incorrect for systems with highmem.  So I think the right
> fix is to replace all references to max_pfn in vpe.c with max_low_pfn.
>   
Which will still be incorrect for systems with highmem, right?  The reason
I propose fixing max_pfn instead of just hacking vpe.c is that, as per my
email of a couple of weeks ago, there are other, architecture independent,
bits of code in the 2.6.24 kernel where max_pfn is assumed to be sane,
and the value of zero may result in otherwise inexplicable Bad Things
happening.  So even if you want to change vpe.c to use max_low_pfn
instead of max_pfn, I believe that we really want that patch to setup.c
until such time as we've verified that the kernel is max_pfn-free.

          Regards,

          Kevin K.

From kevink@mips.com Thu Apr 17 14:42:26 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 17 Apr 2008 14:42:28 +0100 (BST)
Received: from mx.mips.com ([63.167.95.198]:24819 "EHLO dns0.mips.com")
	by ftp.linux-mips.org with ESMTP id S20021935AbYDQNm0 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 17 Apr 2008 14:42:26 +0100
Received: from mercury.mips.com (mercury [192.168.64.101])
	by dns0.mips.com (8.12.11/8.12.11) with ESMTP id m3HDfLSo003649;
	Thu, 17 Apr 2008 06:41:21 -0700 (PDT)
Received: from [127.0.0.1] (grendel [192.168.236.16])
	by mercury.mips.com (8.13.5/8.13.5) with ESMTP id m3HDgHQD017894;
	Thu, 17 Apr 2008 06:42:17 -0700 (PDT)
Message-ID: <480753E6.3030402@mips.com>
Date:	Thu, 17 Apr 2008 15:43:02 +0200
From:	"Kevin D. Kissell" <kevink@mips.com>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
To:	Ralf Baechle <ralf@linux-mips.org>
CC:	linux-mips@linux-mips.org
Subject: Re: Patches for 34K APRP
References: <4805FFE6.5080903@mips.com> <20080417132610.GB31453@linux-mips.org>
In-Reply-To: <20080417132610.GB31453@linux-mips.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <kevink@mips.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18953
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: kevink@mips.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1145
Lines: 38

Ralf Baechle wrote:
> On Wed, Apr 16, 2008 at 03:32:22PM +0200, Kevin D. Kissell wrote:
>
>   
>> --- a/arch/mips/kernel/kspd.c
>> +++ b/arch/mips/kernel/kspd.c
>> @@ -257,7 +257,7 @@ void sp_work_handle_request(void)
>>  
>>  		vcwd = vpe_getcwd(tclimit);
>>  
>> - 		/* change to the cwd of the process that loaded the SP program */
>> + 		/* change to cwd of the process that loaded the SP program */
>>  		old_fs = get_fs();
>>  		set_fs(KERNEL_DS);
>>  		sys_chdir(vcwd);
>> @@ -323,6 +323,9 @@ static void sp_cleanup(void)
>>  			set >>= 1;
>>  		}
>>  	}
>> +
>> +	/* Put daemon cwd back to root to avoid umount problems */
>> +	sys_chdir("/");
>>     
>
> Still not kosher; there might be multiple roots on a system ...
>   
What do you suggest, then?  Leaving things as they are makes it impossible
to do a clean shutdown of an APRP system if the kspd was last used to 
support
an RP binary that was read from a mounted file system.  I respectfully 
submit
that it's at least an order of magnitude more likely that a mounted file 
system
will have been used than a chrooted, mounted file system.

          Regards,

          Kevin K.

From tsbogend@alpha.franken.de Thu Apr 17 21:07:45 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 17 Apr 2008 21:07:47 +0100 (BST)
Received: from elvis.franken.de ([193.175.24.41]:32472 "EHLO elvis.franken.de")
	by ftp.linux-mips.org with ESMTP id S20023833AbYDQUHp (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 17 Apr 2008 21:07:45 +0100
Received: from uucp (helo=solo.franken.de)
	by elvis.franken.de with local-bsmtp (Exim 3.36 #1)
	id 1JmaOW-0007xM-00; Thu, 17 Apr 2008 22:07:44 +0200
Received: by solo.franken.de (Postfix, from userid 1000)
	id 9914FC2BFD; Thu, 17 Apr 2008 22:07:42 +0200 (CEST)
From:	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: [PATCH] IP27: misc fixes
To:	linux-mips@linux-mips.org
cc:	ralf@linux-mips.org
Message-Id: <20080417200742.9914FC2BFD@solo.franken.de>
Date:	Thu, 17 Apr 2008 22:07:42 +0200 (CEST)
Return-Path: <tsbogend@alpha.franken.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18954
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: tsbogend@alpha.franken.de
Precedence: bulk
X-list: linux-mips
Content-Length: 3733
Lines: 126

- fix PCI interrupt assignment by emulating ioc3 interrupt pin register
- use pci_probe_only mode
- select correct page size in bridge
- remove no longer needed ioc3_sio_init() code

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

 arch/mips/pci/ops-bridge.c     |   20 ++++++++++++++++++--
 arch/mips/pci/pci-ip27.c       |   10 ++++++++++
 arch/mips/sgi-ip27/ip27-init.c |   22 ----------------------
 3 files changed, 28 insertions(+), 24 deletions(-)

diff --git a/arch/mips/pci/ops-bridge.c b/arch/mips/pci/ops-bridge.c
index 1fa0992..b46b3e2 100644
--- a/arch/mips/pci/ops-bridge.c
+++ b/arch/mips/pci/ops-bridge.c
@@ -14,6 +14,22 @@
 #include <asm/sn/sn0/hub.h>
 
 /*
+ * Most of the IOC3 PCI config register aren't present
+ * we emulate what is needed for a normal PCI enumeration
+ */
+static u32 emulate_ioc3_cfg(int where, int size)
+{
+	if (size == 1 && where == 0x3d)
+		return 0x01;
+	else if (size == 2 && where == 0x3c)
+		return 0x0100;
+	else if (size == 4 && where == 0x3c)
+		return 0x00000100;
+
+	return 0;
+}
+
+/*
  * The Bridge ASIC supports both type 0 and type 1 access.  Type 1 is
  * not really documented, so right now I can't write code which uses it.
  * Therefore we use type 0 accesses for now even though they won't work
@@ -64,7 +80,7 @@ oh_my_gawd:
 	 * generic PCI code a chance to look at the wrong register.
 	 */
 	if ((where >= 0x14 && where < 0x40) || (where >= 0x48)) {
-		*value = 0;
+		*value = emulate_ioc3_cfg(where, size);
 		return PCIBIOS_SUCCESSFUL;
 	}
 
@@ -127,7 +143,7 @@ oh_my_gawd:
 	 * generic PCI code a chance to look at the wrong register.
 	 */
 	if ((where >= 0x14 && where < 0x40) || (where >= 0x48)) {
-		*value = 0;
+		*value = emulate_ioc3_cfg(where, size);
 		return PCIBIOS_SUCCESSFUL;
 	}
 
diff --git a/arch/mips/pci/pci-ip27.c b/arch/mips/pci/pci-ip27.c
index bb64828..b8a28b5 100644
--- a/arch/mips/pci/pci-ip27.c
+++ b/arch/mips/pci/pci-ip27.c
@@ -47,6 +47,9 @@ int __cpuinit bridge_probe(nasid_t nasid, int widget_id, int masterwid)
 	static int num_bridges = 0;
 	bridge_t *bridge;
 	int slot;
+	extern int pci_probe_only;
+
+	pci_probe_only = 1;
 
 	printk("a bridge\n");
 
@@ -100,6 +103,13 @@ int __cpuinit bridge_probe(nasid_t nasid, int widget_id, int masterwid)
 	 */
 	bridge->b_wid_control |= BRIDGE_CTRL_IO_SWAP |
 	                         BRIDGE_CTRL_MEM_SWAP;
+#ifdef CONFIG_PAGE_SIZE_4KB
+	bridge->b_wid_control &= ~BRIDGE_CTRL_PAGE_SIZE;
+#elif defined(CONFIG_PAGE_SIZE_16KB)
+	bridge->b_wid_control |= BRIDGE_CTRL_PAGE_SIZE;
+#else
+#error Fixme for page size other than 4kB and 16kB
+#endif
 
 	/*
 	 * Hmm...  IRIX sets additional bits in the address which
diff --git a/arch/mips/sgi-ip27/ip27-init.c b/arch/mips/sgi-ip27/ip27-init.c
index 7093e7c..4a500e8 100644
--- a/arch/mips/sgi-ip27/ip27-init.c
+++ b/arch/mips/sgi-ip27/ip27-init.c
@@ -161,27 +161,6 @@ cnodeid_t get_compact_nodeid(void)
 	return NASID_TO_COMPACT_NODEID(get_nasid());
 }
 
-/* Extracted from the IOC3 meta driver.  FIXME.  */
-static inline void ioc3_sio_init(void)
-{
-	struct ioc3 *ioc3;
-	nasid_t nid;
-	long loops;
-
-	nid = get_nasid();
-	ioc3 = (struct ioc3 *) KL_CONFIG_CH_CONS_INFO(nid)->memory_base;
-
-	ioc3->sscr_a = 0;			/* PIO mode for uarta.  */
-	ioc3->sscr_b = 0;			/* PIO mode for uartb.  */
-	ioc3->sio_iec = ~0;
-	ioc3->sio_ies = (SIO_IR_SA_INT | SIO_IR_SB_INT);
-
-	loops=1000000; while(loops--);
-	ioc3->sregs.uarta.iu_fcr = 0;
-	ioc3->sregs.uartb.iu_fcr = 0;
-	loops=1000000; while(loops--);
-}
-
 static inline void ioc3_eth_init(void)
 {
 	struct ioc3 *ioc3;
@@ -234,7 +213,6 @@ void __init plat_mem_setup(void)
 		panic("Kernel compiled for N mode.");
 #endif
 
-	ioc3_sio_init();
 	ioc3_eth_init();
 	per_cpu_init();
 

From ralf@linux-mips.org Fri Apr 18 10:53:01 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 18 Apr 2008 10:53:03 +0100 (BST)
Received: from oss.sgi.com ([192.48.170.157]:13782 "EHLO oss.sgi.com")
	by ftp.linux-mips.org with ESMTP id S20022225AbYDRJxB (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 18 Apr 2008 10:53:01 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3I9qBFk019835
	for <linux-mips@linux-mips.org>; Fri, 18 Apr 2008 02:52:14 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m3I9qqjU023558;
	Fri, 18 Apr 2008 10:52:52 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m3I9qqm0023557;
	Fri, 18 Apr 2008 10:52:52 +0100
Date:	Fri, 18 Apr 2008 10:52:52 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	"Kevin D. Kissell" <kevink@mips.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: Patches for 34K APRP
Message-ID: <20080418095252.GA23316@linux-mips.org>
References: <4805FFE6.5080903@mips.com> <20080417124319.GA31453@linux-mips.org> <480752B8.9040601@mips.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <480752B8.9040601@mips.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18955
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 1046
Lines: 20

On Thu, Apr 17, 2008 at 03:38:00PM +0200, Kevin D. Kissell wrote:

>> That will be incorrect for systems with highmem.  So I think the right
>> fix is to replace all references to max_pfn in vpe.c with max_low_pfn.
>>   
> Which will still be incorrect for systems with highmem, right?  The reason
> I propose fixing max_pfn instead of just hacking vpe.c is that, as per my
> email of a couple of weeks ago, there are other, architecture independent,
> bits of code in the 2.6.24 kernel where max_pfn is assumed to be sane,
> and the value of zero may result in otherwise inexplicable Bad Things
> happening.  So even if you want to change vpe.c to use max_low_pfn
> instead of max_pfn, I believe that we really want that patch to setup.c
> until such time as we've verified that the kernel is max_pfn-free.

Hmm..  yes.  But your 0002-Propagate-max_low_pfn-as-max_pfn-fo patch
uses max_low_pfn after it has already been cut down to exclude highmem.
Moving the assignment a few lines up just before the if statement should
fix the issue.

  Ralf

From anemo@mba.ocn.ne.jp Fri Apr 18 15:53:08 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 18 Apr 2008 15:53:11 +0100 (BST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:54222 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S20027180AbYDROxI (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 18 Apr 2008 15:53:08 +0100
Received: from localhost (p1047-ipad304funabasi.chiba.ocn.ne.jp [123.217.155.47])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id AD4CCB208; Fri, 18 Apr 2008 23:53:00 +0900 (JST)
Date:	Fri, 18 Apr 2008 23:53:57 +0900 (JST)
Message-Id: <20080418.235357.25909447.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] Make pcibios_plat_dev_init weak
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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18956
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 14163
Lines: 438

Most platforms do not need special pcibios_plat_dev_init.  Make it
weak function and kill all empty instances.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
 arch/mips/pci/fixup-atlas.c    |    6 ------
 arch/mips/pci/fixup-au1000.c   |    6 ------
 arch/mips/pci/fixup-capcella.c |    6 ------
 arch/mips/pci/fixup-cobalt.c   |    6 ------
 arch/mips/pci/fixup-emma2rh.c  |    6 ------
 arch/mips/pci/fixup-excite.c   |    6 ------
 arch/mips/pci/fixup-ip32.c     |    6 ------
 arch/mips/pci/fixup-jmr3927.c  |    6 ------
 arch/mips/pci/fixup-lm2e.c     |    6 ------
 arch/mips/pci/fixup-malta.c    |    6 ------
 arch/mips/pci/fixup-mpc30x.c   |    6 ------
 arch/mips/pci/fixup-pmcmsp.c   |   21 ---------------------
 arch/mips/pci/fixup-pnx8550.c  |    6 ------
 arch/mips/pci/fixup-rbtx4927.c |    6 ------
 arch/mips/pci/fixup-sni.c      |    6 ------
 arch/mips/pci/fixup-tb0219.c   |    6 ------
 arch/mips/pci/fixup-tb0226.c   |    6 ------
 arch/mips/pci/fixup-tb0287.c   |    6 ------
 arch/mips/pci/fixup-tx4938.c   |    9 ---------
 arch/mips/pci/fixup-wrppmc.c   |    6 ------
 arch/mips/pci/fixup-yosemite.c |    6 ------
 arch/mips/pci/pci-bcm1480.c    |    6 ------
 arch/mips/pci/pci-ip27.c       |    6 ------
 arch/mips/pci/pci-lasat.c      |    6 ------
 arch/mips/pci/pci-sb1250.c     |    6 ------
 arch/mips/pci/pci.c            |    5 +++++
 26 files changed, 5 insertions(+), 168 deletions(-)

diff --git a/arch/mips/pci/fixup-atlas.c b/arch/mips/pci/fixup-atlas.c
index 506e883..d41c8c6 100644
--- a/arch/mips/pci/fixup-atlas.c
+++ b/arch/mips/pci/fixup-atlas.c
@@ -63,12 +63,6 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 	return irq_tab[slot][pin];
 }
 
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
-
 #ifdef CONFIG_KGDB
 /*
  * The PCI scan may have moved the saa9730 I/O address, so reread
diff --git a/arch/mips/pci/fixup-au1000.c b/arch/mips/pci/fixup-au1000.c
index 00c36c9..ad59195 100644
--- a/arch/mips/pci/fixup-au1000.c
+++ b/arch/mips/pci/fixup-au1000.c
@@ -36,9 +36,3 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 	return irq_tab_alchemy[slot][pin];
 }
-
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
diff --git a/arch/mips/pci/fixup-capcella.c b/arch/mips/pci/fixup-capcella.c
index 1416bca..834be10 100644
--- a/arch/mips/pci/fixup-capcella.c
+++ b/arch/mips/pci/fixup-capcella.c
@@ -42,9 +42,3 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 	return irq_tab_capcella[slot][pin];
 }
-
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
diff --git a/arch/mips/pci/fixup-cobalt.c b/arch/mips/pci/fixup-cobalt.c
index 9553b14..eff9041 100644
--- a/arch/mips/pci/fixup-cobalt.c
+++ b/arch/mips/pci/fixup-cobalt.c
@@ -185,9 +185,3 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 
 	return irq_tab_cobalt[slot];
 }
-
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
diff --git a/arch/mips/pci/fixup-emma2rh.c b/arch/mips/pci/fixup-emma2rh.c
index a270589..cc26790 100644
--- a/arch/mips/pci/fixup-emma2rh.c
+++ b/arch/mips/pci/fixup-emma2rh.c
@@ -93,9 +93,3 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 	return irq_map[slot][pin];
 }
-
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
diff --git a/arch/mips/pci/fixup-excite.c b/arch/mips/pci/fixup-excite.c
index cd64d9f..106649d 100644
--- a/arch/mips/pci/fixup-excite.c
+++ b/arch/mips/pci/fixup-excite.c
@@ -28,9 +28,3 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 
 	return USB_IRQ;		/* USB controller is the only PCI device */
 }
-
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
diff --git a/arch/mips/pci/fixup-ip32.c b/arch/mips/pci/fixup-ip32.c
index 190fffd..97e3a04 100644
--- a/arch/mips/pci/fixup-ip32.c
+++ b/arch/mips/pci/fixup-ip32.c
@@ -43,9 +43,3 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 	return irq_tab_mace[slot][pin];
 }
-
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
diff --git a/arch/mips/pci/fixup-jmr3927.c b/arch/mips/pci/fixup-jmr3927.c
index e974394..a46196a 100644
--- a/arch/mips/pci/fixup-jmr3927.c
+++ b/arch/mips/pci/fixup-jmr3927.c
@@ -84,9 +84,3 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 		irq = JMR3927_IRQ_ETHER0;
 	return irq;
 }
-
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
diff --git a/arch/mips/pci/fixup-lm2e.c b/arch/mips/pci/fixup-lm2e.c
index e18ae4f..791cb8f 100644
--- a/arch/mips/pci/fixup-lm2e.c
+++ b/arch/mips/pci/fixup-lm2e.c
@@ -59,12 +59,6 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 
 }
 
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
-
 static void __init loongson2e_nec_fixup(struct pci_dev *pdev)
 {
 	unsigned int val;
diff --git a/arch/mips/pci/fixup-malta.c b/arch/mips/pci/fixup-malta.c
index 0f48498..c3b2ba0 100644
--- a/arch/mips/pci/fixup-malta.c
+++ b/arch/mips/pci/fixup-malta.c
@@ -43,12 +43,6 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 	return pci_irq[virq];
 }
 
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
-
 static void __init malta_piix_func0_fixup(struct pci_dev *pdev)
 {
 	unsigned char reg_val;
diff --git a/arch/mips/pci/fixup-mpc30x.c b/arch/mips/pci/fixup-mpc30x.c
index 5911596..092cc75 100644
--- a/arch/mips/pci/fixup-mpc30x.c
+++ b/arch/mips/pci/fixup-mpc30x.c
@@ -41,9 +41,3 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 
 	return irq_tab_mpc30x[slot];
 }
-
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
diff --git a/arch/mips/pci/fixup-pmcmsp.c b/arch/mips/pci/fixup-pmcmsp.c
index 65735b1..087bf06 100644
--- a/arch/mips/pci/fixup-pmcmsp.c
+++ b/arch/mips/pci/fixup-pmcmsp.c
@@ -164,27 +164,6 @@ static char irq_tab[][5] __initdata = {
 
 /*****************************************************************************
  *
- *  FUNCTION: pcibios_plat_dev_init
- *  _________________________________________________________________________
- *
- *  DESCRIPTION: Perform platform specific device initialization at
- *               pci_enable_device() time.
- *               None are needed for the MSP7120 PCI Controller.
- *
- *  INPUTS:      dev     - structure describing the PCI device
- *
- *  OUTPUTS:     none
- *
- *  RETURNS:     PCIBIOS_SUCCESSFUL
- *
- ****************************************************************************/
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return PCIBIOS_SUCCESSFUL;
-}
-
-/*****************************************************************************
- *
  *  FUNCTION: pcibios_map_irq
  *  _________________________________________________________________________
  *
diff --git a/arch/mips/pci/fixup-pnx8550.c b/arch/mips/pci/fixup-pnx8550.c
index 96857ac..1ef895a 100644
--- a/arch/mips/pci/fixup-pnx8550.c
+++ b/arch/mips/pci/fixup-pnx8550.c
@@ -49,9 +49,3 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 	return pnx8550_irq_tab[slot][pin];
 }
-
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
diff --git a/arch/mips/pci/fixup-rbtx4927.c b/arch/mips/pci/fixup-rbtx4927.c
index 7450c33..6c7c02a 100644
--- a/arch/mips/pci/fixup-rbtx4927.c
+++ b/arch/mips/pci/fixup-rbtx4927.c
@@ -132,9 +132,3 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 
 	return irq;
 }
-
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
diff --git a/arch/mips/pci/fixup-sni.c b/arch/mips/pci/fixup-sni.c
index 5c8a79b..bf6718c 100644
--- a/arch/mips/pci/fixup-sni.c
+++ b/arch/mips/pci/fixup-sni.c
@@ -162,9 +162,3 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 
 	return 0;
 }
-
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
diff --git a/arch/mips/pci/fixup-tb0219.c b/arch/mips/pci/fixup-tb0219.c
index ed87733..d525c53 100644
--- a/arch/mips/pci/fixup-tb0219.c
+++ b/arch/mips/pci/fixup-tb0219.c
@@ -43,9 +43,3 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 
 	return irq;
 }
-
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
diff --git a/arch/mips/pci/fixup-tb0226.c b/arch/mips/pci/fixup-tb0226.c
index e3eedf4..7e5e922 100644
--- a/arch/mips/pci/fixup-tb0226.c
+++ b/arch/mips/pci/fixup-tb0226.c
@@ -78,9 +78,3 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 
 	return irq;
 }
-
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
diff --git a/arch/mips/pci/fixup-tb0287.c b/arch/mips/pci/fixup-tb0287.c
index 267ab3d..fd0f628 100644
--- a/arch/mips/pci/fixup-tb0287.c
+++ b/arch/mips/pci/fixup-tb0287.c
@@ -57,9 +57,3 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 
 	return irq;
 }
-
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
diff --git a/arch/mips/pci/fixup-tx4938.c b/arch/mips/pci/fixup-tx4938.c
index f2ba06e..6d33d06 100644
--- a/arch/mips/pci/fixup-tx4938.c
+++ b/arch/mips/pci/fixup-tx4938.c
@@ -81,12 +81,3 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 
 	return irq;
 }
-
-/*
- * Do platform specific device initialization at pci_enable_device() time
- */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
-
diff --git a/arch/mips/pci/fixup-wrppmc.c b/arch/mips/pci/fixup-wrppmc.c
index 3d27754..f50b078 100644
--- a/arch/mips/pci/fixup-wrppmc.c
+++ b/arch/mips/pci/fixup-wrppmc.c
@@ -29,9 +29,3 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 	return pci_irq_tab[slot][pin];
 }
-
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
diff --git a/arch/mips/pci/fixup-yosemite.c b/arch/mips/pci/fixup-yosemite.c
index fdafb13..0a75d30 100644
--- a/arch/mips/pci/fixup-yosemite.c
+++ b/arch/mips/pci/fixup-yosemite.c
@@ -33,9 +33,3 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 
 	return 3;			/* Everything goes to one irq bit */
 }
-
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
diff --git a/arch/mips/pci/pci-bcm1480.c b/arch/mips/pci/pci-bcm1480.c
index 87e2c8f..c2a15a1 100644
--- a/arch/mips/pci/pci-bcm1480.c
+++ b/arch/mips/pci/pci-bcm1480.c
@@ -82,12 +82,6 @@ int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 	return K_BCM1480_INT_PCI_INTA - 1 + pin;
 }
 
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
-
 /*
  * Some checks before doing config cycles:
  * In PCI Device Mode, hide everything on bus 0 except the LDT host
diff --git a/arch/mips/pci/pci-ip27.c b/arch/mips/pci/pci-ip27.c
index bb64828..1bc0854 100644
--- a/arch/mips/pci/pci-ip27.c
+++ b/arch/mips/pci/pci-ip27.c
@@ -152,12 +152,6 @@ int __devinit pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 	return irq;
 }
 
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
-
 /*
  * Device might live on a subordinate PCI bus.  XXX Walk up the chain of buses
  * to find the slot number in sense of the bridge device register.
diff --git a/arch/mips/pci/pci-lasat.c b/arch/mips/pci/pci-lasat.c
index e70ae32..fce5e52 100644
--- a/arch/mips/pci/pci-lasat.c
+++ b/arch/mips/pci/pci-lasat.c
@@ -86,9 +86,3 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 
 	return -1;
 }
-
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
diff --git a/arch/mips/pci/pci-sb1250.c b/arch/mips/pci/pci-sb1250.c
index 42e4d2c..67a623b 100644
--- a/arch/mips/pci/pci-sb1250.c
+++ b/arch/mips/pci/pci-sb1250.c
@@ -89,12 +89,6 @@ int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 	return dev->irq;
 }
 
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	return 0;
-}
-
 /*
  * Some checks before doing config cycles:
  * In PCI Device Mode, hide everything on bus 0 except the LDT host
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index 358ad62..0bd93fb 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -227,6 +227,11 @@ unsigned int pcibios_assign_all_busses(void)
 	return (pci_probe & PCI_ASSIGN_ALL_BUSSES) ? 1 : 0;
 }
 
+int __weak pcibios_plat_dev_init(struct pci_dev *dev)
+{
+	return 0;
+}
+
 int pcibios_enable_device(struct pci_dev *dev, int mask)
 {
 	int err;

From anemo@mba.ocn.ne.jp Fri Apr 18 16:33:43 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 18 Apr 2008 16:33:46 +0100 (BST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:39925 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S20029157AbYDRPdn (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 18 Apr 2008 16:33:43 +0100
Received: from localhost (p1047-ipad304funabasi.chiba.ocn.ne.jp [123.217.155.47])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 9164AB209; Sat, 19 Apr 2008 00:33:38 +0900 (JST)
Date:	Sat, 19 Apr 2008 00:34:35 +0900 (JST)
Message-Id: <20080419.003435.26096353.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] Remove never used pci_probe variable
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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18957
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 927
Lines: 35

Nobody overwrite pci_probe.  Remove it.  Also make
pcibios_assign_all_busses weak so that platform code can overwrite it.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
 arch/mips/pci/pci.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index 0bd93fb..7533e3f 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -21,10 +21,6 @@
  */
 int pci_probe_only;
 
-#define PCI_ASSIGN_ALL_BUSSES	1
-
-unsigned int pci_probe = PCI_ASSIGN_ALL_BUSSES;
-
 /*
  * The PCI controller list.
  */
@@ -222,9 +218,9 @@ void pcibios_set_master(struct pci_dev *dev)
 	pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat);
 }
 
-unsigned int pcibios_assign_all_busses(void)
+unsigned int __weak pcibios_assign_all_busses(void)
 {
-	return (pci_probe & PCI_ASSIGN_ALL_BUSSES) ? 1 : 0;
+	return 1;
 }
 
 int __weak pcibios_plat_dev_init(struct pci_dev *dev)

From anemo@mba.ocn.ne.jp Fri Apr 18 16:36:40 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 18 Apr 2008 16:36:42 +0100 (BST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:52197 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S20029196AbYDRPgk (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 18 Apr 2008 16:36:40 +0100
Received: from localhost (p1047-ipad304funabasi.chiba.ocn.ne.jp [123.217.155.47])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 4423FB25A; Sat, 19 Apr 2008 00:36:36 +0900 (JST)
Date:	Sat, 19 Apr 2008 00:37:33 +0900 (JST)
Message-Id: <20080419.003733.48796522.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] Make pcibios_setup weak
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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18958
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 525
Lines: 20

Make pcibios_setup weak so that platform code can overwrite it.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
 arch/mips/pci/pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index 7533e3f..0987144 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -330,7 +330,7 @@ EXPORT_SYMBOL(PCIBIOS_MIN_IO);
 EXPORT_SYMBOL(PCIBIOS_MIN_MEM);
 #endif
 
-char *pcibios_setup(char *str)
+char *__weak pcibios_setup(char *str)
 {
 	return str;
 }

From anemo@mba.ocn.ne.jp Fri Apr 18 16:52:57 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 18 Apr 2008 16:53:00 +0100 (BST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:36335 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S28573768AbYDRPw5 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Fri, 18 Apr 2008 16:52:57 +0100
Received: from localhost (p1047-ipad304funabasi.chiba.ocn.ne.jp [123.217.155.47])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id A162EB175; Sat, 19 Apr 2008 00:52:49 +0900 (JST)
Date:	Sat, 19 Apr 2008 00:53:46 +0900 (JST)
Message-Id: <20080419.005346.85684007.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] Declare some pci variables in header file
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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18959
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 1956
Lines: 62

Declare pci_probe_only, etc. in asm-mips/pci.h file.  This will fix
some sparse warnings.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
 arch/mips/pci/fixup-vr4133.c |    1 -
 arch/mips/pci/pci-bcm1480.c  |    1 -
 arch/mips/pci/pci-sb1250.c   |    1 -
 include/asm-mips/pci.h       |    6 ++++++
 4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/mips/pci/fixup-vr4133.c b/arch/mips/pci/fixup-vr4133.c
index de5e5f6..34e651b 100644
--- a/arch/mips/pci/fixup-vr4133.c
+++ b/arch/mips/pci/fixup-vr4133.c
@@ -171,7 +171,6 @@ void i8259_init(void)
 
 int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
-	extern int pci_probe_only;
 	pci_probe_only = 1;
 
 #ifdef CONFIG_ROCKHOPPER
diff --git a/arch/mips/pci/pci-bcm1480.c b/arch/mips/pci/pci-bcm1480.c
index c2a15a1..61b88f9 100644
--- a/arch/mips/pci/pci-bcm1480.c
+++ b/arch/mips/pci/pci-bcm1480.c
@@ -196,7 +196,6 @@ static int __init bcm1480_pcibios_init(void)
 {
 	uint32_t cmdreg;
 	uint64_t reg;
-	extern int pci_probe_only;
 
 	/* CFE will assign PCI resources */
 	pci_probe_only = 1;
diff --git a/arch/mips/pci/pci-sb1250.c b/arch/mips/pci/pci-sb1250.c
index 67a623b..53ee8eb 100644
--- a/arch/mips/pci/pci-sb1250.c
+++ b/arch/mips/pci/pci-sb1250.c
@@ -203,7 +203,6 @@ static int __init sb1250_pcibios_init(void)
 {
 	uint32_t cmdreg;
 	uint64_t reg;
-	extern int pci_probe_only;
 
 	/* CFE will assign PCI resources */
 	pci_probe_only = 1;
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h
index 301ff2f..49a461f 100644
--- a/include/asm-mips/pci.h
+++ b/include/asm-mips/pci.h
@@ -172,4 +172,10 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
 	return channel ? 15 : 14;
 }
 
+extern struct pci_controller *hose_head;
+extern struct pci_controller **hose_tail;
+extern struct pci_controller *pci_isa_hose;
+extern int pci_probe_only;
+extern unsigned int pcibios_max_latency;
+
 #endif /* _ASM_PCI_H */

From jfraser@broadcom.com Fri Apr 18 19:01:41 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 18 Apr 2008 19:01:43 +0100 (BST)
Received: from mms2.broadcom.com ([216.31.210.18]:65038 "EHLO
	mms2.broadcom.com") by ftp.linux-mips.org with ESMTP
	id S28573866AbYDRSBl (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Fri, 18 Apr 2008 19:01:41 +0100
Received: from [10.11.16.99] by mms2.broadcom.com with ESMTP (Broadcom
 SMTP Relay (Email Firewall v6.3.2)); Fri, 18 Apr 2008 11:01:19 -0700
X-Server-Uuid: D3C04415-6FA8-4F2C-93C1-920E106A2031
Received: by mail-irva-10.broadcom.com (Postfix, from userid 47) id
 BEA3F2B5; Fri, 18 Apr 2008 11:01:19 -0700 (PDT)
Received: from mail-irva-8.broadcom.com (mail-irva-8 [10.11.18.52]) by
 mail-irva-10.broadcom.com (Postfix) with ESMTP id A9D5A2B3 for
 <linux-mips@linux-mips.org>; Fri, 18 Apr 2008 11:01:19 -0700 (PDT)
Received: from mail-irva-13.broadcom.com (mail-irva-13.broadcom.com
 [10.11.16.103]) by mail-irva-8.broadcom.com (MOS 3.7.5a-GA) with ESMTP
 id GUF24191; Fri, 18 Apr 2008 11:00:57 -0700 (PDT)
Received: from [10.28.6.13] (lab-mhtb-013.ne.broadcom.com [10.28.6.13])
 by mail-irva-13.broadcom.com (Postfix) with ESMTP id 2702974D19; Fri,
 18 Apr 2008 11:00:51 -0700 (PDT)
Subject: Re: [PATCH 2.6.24][MIPS]Work in progress: fix HIGHMEM-enabled
 dcache flushing on 32-bit processor
From:	"Jon Fraser" <jfraser@broadcom.com>
Reply-to: jfraser@broadcom.com
To:	linux-mips@linux-mips.org
In-Reply-To: <47D89211.1020504@cisco.com>
References: <47D89211.1020504@cisco.com>
Organization: Broadcom
Date:	Fri, 18 Apr 2008 14:00:50 -0400
Message-ID: <1208541650.9942.203.camel@chaos.ne.broadcom.com>
MIME-Version: 1.0
X-Mailer: Evolution 2.12.3 (2.12.3-3.fc8)
X-WSS-ID: 64163E654YC25959650-01-01
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Return-Path: <jfraser@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: 18960
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: jfraser@broadcom.com
Precedence: bulk
X-list: linux-mips
Content-Length: 8852
Lines: 294

Dave,

  You might want to try out this patch to arch/mips/mm/dma-default.c.
The code for dma_map_sg will fail for the HIGHMEM case since there's no
permanent mapping for the pages.

     I don't know if the address range checks are valid for your platform.
r4k_dma_cache_wback_inv can't handle bad addresses on our platform. 

     Once we made this fix, we could do IO to HIGHMEM and some crashes which
appeared to be memory corruption went away.

Jon
______________________________
--- linux-2.6.24-virgin/arch/mips/mm/dma-default.c	2008-01-25
06:23:51.000000000 -0500
+++ stblinux-2.6.24/arch/mips/mm/dma-default.c	2008-04-18
10:49:43.000000000 -0400
@@ -132,6 +132,9 @@
 static inline void __dma_sync(unsigned long addr, size_t size,
 	enum dma_data_direction direction)
 {
+
+	BUG_ON(addr < KSEG0);
+
 	switch (direction) {
 	case DMA_TO_DEVICE:
 		dma_cache_wback(addr, size);
@@ -185,11 +188,13 @@
 	for (i = 0; i < nents; i++, sg++) {
 		unsigned long addr;
 
+	        BUG_ON(!sg_page(sg));
+
 		addr = (unsigned long) sg_virt(sg);
-		if (!plat_device_is_coherent(dev) && addr)
+		if (!plat_device_is_coherent(dev) && (addr >= KSEG0))
 			__dma_sync(addr, sg->length, direction);
-		sg->dma_address = plat_map_dma_mem(dev,
-				                   (void *)addr, sg->length);
+
+		sg->dma_address = sg_phys(sg);
 	}
 
 	return nents;
@@ -206,6 +211,7 @@
 		unsigned long addr;
 
 		addr = (unsigned long) page_address(page) + offset;
+		if (addr >= KSEG0)
 		dma_cache_wback_inv(addr, size);
 	}
 
@@ -221,8 +227,11 @@
 
 	if (!plat_device_is_coherent(dev) && direction != DMA_TO_DEVICE) {
 		unsigned long addr;
+		unsigned int offset;
 
-		addr = plat_dma_addr_to_phys(dma_address);
+		offset = dma_address & ~PAGE_MASK;
+		addr = (unsigned long)page_address(pfn_to_page(dma_address >>
PAGE_SHIFT)) + offset;
+		if (addr >= KSEG0)
 		dma_cache_wback_inv(addr, size);
 	}
 
@@ -243,7 +252,7 @@
 		if (!plat_device_is_coherent(dev) &&
 		    direction != DMA_TO_DEVICE) {
 			addr = (unsigned long) sg_virt(sg);
-			if (addr)
+			if (addr >= KSEG0)
 				__dma_sync(addr, sg->length, direction);
 		}
 		plat_unmap_dma_mem(sg->dma_address);
@@ -381,6 +390,7 @@
 	       enum dma_data_direction direction)
 {
 	BUG_ON(direction == DMA_NONE);
+	BUG_ON(vaddr < (void *)KSEG0);
 
 	if (!plat_device_is_coherent(dev))
 		dma_cache_wback_inv((unsigned long)vaddr, size);


_______________________________

On Wed, 2008-03-12 at 19:31 -0700, David VomLehn wrote:
> This patch is a work in progress, per Ralf's suggestion from last week. It is 
> intended to fix dcache flushing issues when using HIGHMEM support. We get much 
> better results with this patch applied, but I would not characterize our 2.6.24 
> port as stable, yet, so there may be other HIGHMEM-related issues.
> 
> Any comments welcome. Thanks!
> 
> David VomLehn
> 
> diff -urN a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
> --- a/arch/mips/mm/cache.c	2008-01-24 14:58:37.000000000 -0800
> +++ b/arch/mips/mm/cache.c	2008-03-12 19:11:39.000000000 -0700
> @@ -19,6 +19,7 @@
>   #include <asm/processor.h>
>   #include <asm/cpu.h>
>   #include <asm/cpu-features.h>
> +#include <asm/highmem.h>
> 
>   /* Cache operations. */
>   void (*flush_cache_all)(void);
> @@ -70,10 +71,28 @@
>   void __flush_dcache_page(struct page *page)
>   {
>   	struct address_space *mapping = page_mapping(page);
> -	unsigned long addr;
> +	void	* addr;
> 
> +#ifndef CONFIG_HIGHMEM
>   	if (PageHighMem(page))
>   		return;
> +#endif
> +
> +	/* If there is a temporary kernel mapping, i.e. if kmap_atomic was
> +	 * used to map a page, we only need to flush the page. We can skip
> +	 * the other work here because it won't be used in any other way. */
> +	if (PageHighMem(page)) {
> +		addr = kmap_atomic_to_vaddr(page);
> +		if (addr != NULL) {
> +			flush_data_cache_page((unsigned long) addr);
> +			return;
> +		}
> +	}
> +
> +	/* If page_mapping returned a non-NULL value, then the page is not
> +	 * in the swap cache and it isn't anonymously mapped. If it's not
> +	 * already mapped into user space, we can just set the dirty bit to
> +	 * get the cache flushed later, if needed */
>   	if (mapping && !mapping_mapped(mapping)) {
>   		SetPageDcacheDirty(page);
>   		return;
> @@ -84,8 +103,10 @@
>   	 * case is for exec env/arg pages and those are %99 certainly going to
>   	 * get faulted into the tlb (and thus flushed) anyways.
>   	 */
> -	addr = (unsigned long) page_address(page);
> -	flush_data_cache_page(addr);
> +	addr = page_address(page);
> +	/* If the page is not mapped for kernel access, don't flush it */
> +	if (addr != NULL)
> +		flush_data_cache_page((unsigned long) addr);
>   }
> 
>   EXPORT_SYMBOL(__flush_dcache_page);
> diff -urN a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c
> --- a/arch/mips/mm/highmem.c	2008-01-24 14:58:37.000000000 -0800
> +++ b/arch/mips/mm/highmem.c	2008-03-12 18:58:10.000000000 -0700
> @@ -25,6 +25,25 @@
>   }
> 
>   /*
> + * Describes one page->virtual association in kmap_atomic
> + */
> +struct kmap_atomic_map {
> +	struct list_head list;
> +	struct page *page;
> +};
> +
> +/*
> + * Array of linked lists of the mappings currently in use. The array is
> + * indexed by the CPU number, so we don't have to worry about synchronizing
> + * between the CPUs. We can add maps in interrupt handlers, however, so
> + * we will need to block interrupts when manipulating the linked list.
> + */
> +static struct kmap_atomic_map_list {
> +	struct list_head lh;
> +	struct kmap_atomic_map map_pool[KM_TYPE_NR];
> +} ____cacheline_aligned_in_smp map_list[NR_CPUS];
> +
> +/*
>    * kmap_atomic/kunmap_atomic is significantly faster than kmap/kunmap because
>    * no global lock is needed and because the kmap code must perform a global TLB
>    * invalidation when the kmap pool wraps.
> @@ -37,6 +56,7 @@
>   {
>   	enum fixed_addresses idx;
>   	unsigned long vaddr;
> +	unsigned long flags;
> 
>   	/* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */
>   	pagefault_disable();
> @@ -52,11 +72,18 @@
>   	set_pte(kmap_pte-idx, mk_pte(page, kmap_prot));
>   	local_flush_tlb_one((unsigned long)vaddr);
> 
> +	local_irq_save(flags);
> +	map_list[smp_processor_id()].map_pool[type].page = page;
> +	list_add(&(map_list[smp_processor_id()].map_pool[type]).list, 
> &map_list[smp_processor_id()].lh);
> +	local_irq_restore(flags);
> +
>   	return (void*) vaddr;
>   }
> 
>   void __kunmap_atomic(void *kvaddr, enum km_type type)
>   {
> +	unsigned long flags;
> +
>   #ifdef CONFIG_DEBUG_HIGHMEM
>   	unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
>   	enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();
> @@ -75,8 +102,14 @@
>   	 */
>   	pte_clear(&init_mm, vaddr, kmap_pte-idx);
>   	local_flush_tlb_one(vaddr);
> +
> +	map_list[smp_processor_id()].map_pool[type].page = NULL;
>   #endif
> 
> +	local_irq_save(flags);
> +	list_del(&(map_list[smp_processor_id()].map_pool[type]).list);
> +	local_irq_restore(flags);
> +
>   	pagefault_enable();
>   }
> 
> @@ -112,6 +145,40 @@
>   	return pte_page(*pte);
>   }
> 
> +void *kmap_atomic_to_vaddr(struct page *page)
> +{
> +	unsigned long flags;
> +	struct kmap_atomic_map *map;
> +	unsigned long vaddr = 0;
> +
> +	local_irq_save(flags);
> +	list_for_each_entry(map, &map_list[smp_processor_id()].lh, list) {
> +		if (map->page == page) {
> +			vaddr = __fix_to_virt(FIX_KMAP_BEGIN +
> +				(map - map_list[smp_processor_id()].map_pool));
> +			break;
> +		}
> +	}
> +	local_irq_restore(flags);
> +
> +	return (void *)vaddr;		
> +}
> +
> +void __init kmap_atomic_init(void)
> +{
> +	int i, j;
> +
> +	for (i = 0; i < NR_CPUS; i++) {
> +		INIT_LIST_HEAD(&map_list[i].lh);
> +#ifdef CONFIG_DEBUG_HIGHMEM
> +		for (j = 0; j < KM_TYPE_NR; j++) {
> +			INIT_LIST_HEAD(&(map_list[i].map_pool[j]).list);
> +			map_list[i].map_pool[j].page = NULL;
> +		}
> +#endif
> +	}
> +}
> +
>   EXPORT_SYMBOL(__kmap);
>   EXPORT_SYMBOL(__kunmap);
>   EXPORT_SYMBOL(__kmap_atomic);
> diff -urN a/arch/mips/mm/init.c b/arch/mips/mm/init.c
> --- a/arch/mips/mm/init.c	2008-01-24 14:58:37.000000000 -0800
> +++ b/arch/mips/mm/init.c	2008-03-12 19:12:51.000000000 -0700
> @@ -354,6 +354,7 @@
> 
>   #ifdef CONFIG_HIGHMEM
>   	kmap_init();
> +	kmap_atomic_init();
>   #endif
>   	kmap_coherent_init();
> 
> diff -urN a/include/asm-mips/highmem.h b/include/asm-mips/highmem.h
> --- a/include/asm-mips/highmem.h	2008-01-24 14:58:37.000000000 -0800
> +++ b/include/asm-mips/highmem.h	2008-03-12 18:57:22.000000000 -0700
> @@ -55,6 +55,9 @@
>   extern void *kmap_atomic_pfn(unsigned long pfn, enum km_type type);
>   extern struct page *__kmap_atomic_to_page(void *ptr);
> 
> +extern void *kmap_atomic_to_vaddr(struct page *page);
> +extern void kmap_atomic_init(void);
> +
>   #define kmap			__kmap
>   #define kunmap			__kunmap
>   #define kmap_atomic		__kmap_atomic
> 
> 
> 



From ilpo.jarvinen@helsinki.fi Sat Apr 19 21:18:11 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 19 Apr 2008 21:18:14 +0100 (BST)
Received: from courier.cs.helsinki.fi ([128.214.9.1]:28358 "EHLO
	mail.cs.helsinki.fi") by ftp.linux-mips.org with ESMTP
	id S28574748AbYDSUSL (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 19 Apr 2008 21:18:11 +0100
Received: from wrl-59.cs.helsinki.fi (wrl-59.cs.helsinki.fi [128.214.166.179])
  (AUTH: PLAIN cs-relay, TLS: TLSv1/SSLv3,256bits,AES256-SHA)
  by mail.cs.helsinki.fi with esmtp; Sat, 19 Apr 2008 23:17:31 +0300
  id 0006812C.480A535B.00006A9F
Received: by wrl-59.cs.helsinki.fi (Postfix, from userid 50795)
	id 80CBFA0092; Sat, 19 Apr 2008 23:16:36 +0300 (EEST)
Received: from localhost (localhost [127.0.0.1])
	by wrl-59.cs.helsinki.fi (Postfix) with ESMTP id 6F5B5A006C;
	Sat, 19 Apr 2008 23:16:36 +0300 (EEST)
Date:	Sat, 19 Apr 2008 23:16:36 +0300 (EEST)
From:	"=?ISO-8859-1?Q?Ilpo_J=E4rvinen?=" <ilpo.jarvinen@helsinki.fi>
X-X-Sender: ijjarvin@wrl-59.cs.helsinki.fi
To:	ralf@linux-mips.org
cc:	linux-mips@linux-mips.org
Subject: [PATCH] [MIPS] Fix order of BRK_BUG in case
Message-ID: <Pine.LNX.4.64.0804192310460.20623@wrl-59.cs.helsinki.fi>
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="-696208474-35109629-1208636196=:20623"
Return-Path: <ilpo.jarvinen@helsinki.fi>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18961
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ilpo.jarvinen@helsinki.fi
Precedence: bulk
X-list: linux-mips
Content-Length: 1227
Lines: 41

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

---696208474-35109629-1208636196=:20623
Content-Type: TEXT/PLAIN; charset=ISO-8859-1
Content-Transfer-Encoding: 8BIT


BRK bug is defined as 512, which is smaller than 1 << 10
resulting in left shifting bcode by 10 earlier. Without
this the code block can't ever be reached.

Problem was added in commit 63dc68a8cf ([MIPS] Use conditional
traps for BUG_ON on MIPS II and better).

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---

I'm by no means familiar with MIPS but this seems
an appropriate fix.

 arch/mips/kernel/traps.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 984c0d0..4dfcd61 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -694,7 +694,7 @@ asmlinkage void do_bp(struct pt_regs *regs)
 		info.si_addr = (void __user *) regs->cp0_epc;
 		force_sig_info(SIGFPE, &info, current);
 		break;
-	case BRK_BUG:
+	case BRK_BUG << 10:
 		die("Kernel bug detected", regs);
 		break;
 	default:
-- 
1.5.4.4

---696208474-35109629-1208636196=:20623--

From ddaney@avtrex.com Sat Apr 19 23:23:53 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 19 Apr 2008 23:23:55 +0100 (BST)
Received: from smtp1.dnsmadeeasy.com ([205.234.170.144]:50103 "EHLO
	smtp1.dnsmadeeasy.com") by ftp.linux-mips.org with ESMTP
	id S28575417AbYDSWXx (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sat, 19 Apr 2008 23:23:53 +0100
Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id E612B3187F4
	for <linux-mips@linux-mips.org>; Sat, 19 Apr 2008 22:24:37 +0000 (UTC)
X-Authenticated-Name: js.dnsmadeeasy
X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com
Received: from avtrex.com (unknown [67.116.42.147])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP
	for <linux-mips@linux-mips.org>; Sat, 19 Apr 2008 22:24:37 +0000 (UTC)
Received: from [192.168.7.226] ([192.168.7.226]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Sat, 19 Apr 2008 15:23:38 -0700
Message-ID: <480A70EA.50804@avtrex.com>
Date:	Sat, 19 Apr 2008 15:23:38 -0700
From:	David Daney <ddaney@avtrex.com>
User-Agent: Thunderbird 1.5.0.12 (X11/20071019)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Subject: Building current kernel for Qemu
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 19 Apr 2008 22:23:38.0967 (UTC) FILETIME=[04239E70:01C8A26C]
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: 18962
X-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: 491
Lines: 14

I would like to build a current kernel for mipsel on qemu.  However it
seems that the qemu target was recently removed.

I tried building a plain malta kernel vmlinux, but there is no output on
the console when trying to boot it.  The Debian 2.6.18 qemu kernel seems
to work well though.

Do you have to do anything special to the kernel to run on qemu?

How does one go about building a kernel for qemu from current kernel
sources?

Thanks in advance for any insight into this,
David Daney

From ths@networkno.de Sun Apr 20 00:08:46 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 20 Apr 2008 00:08:48 +0100 (BST)
Received: from relay01.mx.bawue.net ([193.7.176.67]:29655 "EHLO
	relay01.mx.bawue.net") by ftp.linux-mips.org with ESMTP
	id S28575656AbYDSXIq (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 20 Apr 2008 00:08:46 +0100
Received: from lagash (88-106-226-17.dynamic.dsl.as9105.com [88.106.226.17])
	(using TLSv1 with cipher AES256-SHA (256/256 bits))
	(No client certificate requested)
	by relay01.mx.bawue.net (Postfix) with ESMTP id 334CB48917;
	Sun, 20 Apr 2008 01:08:45 +0200 (CEST)
Received: from ths by lagash with local (Exim 4.69)
	(envelope-from <ths@networkno.de>)
	id 1JnMAm-0008UI-Kk; Sun, 20 Apr 2008 00:08:44 +0100
Date:	Sun, 20 Apr 2008 00:08:44 +0100
From:	Thiemo Seufer <ths@networkno.de>
To:	David Daney <ddaney@avtrex.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: Building current kernel for Qemu
Message-ID: <20080419230844.GA31431@networkno.de>
References: <480A70EA.50804@avtrex.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <480A70EA.50804@avtrex.com>
User-Agent: Mutt/1.5.17+20080114 (2008-01-14)
Return-Path: <ths@networkno.de>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18963
X-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: 979
Lines: 28

David Daney wrote:
> I would like to build a current kernel for mipsel on qemu.  However it
> seems that the qemu target was recently removed.
> 
> I tried building a plain malta kernel vmlinux, but there is no output on
> the console when trying to boot it.  The Debian 2.6.18 qemu kernel seems
> to work well though.
> 
> Do you have to do anything special to the kernel to run on qemu?

Nothing special is needed for the kernel. You need to start with
e.g. "qemu-system-mipsel -M malta" to select Qemu's malta machine
emulation.

> How does one go about building a kernel for qemu from current kernel
> sources?

The special qemu kernel is now deprecated, as the malta kernel is a
full replacement which corresponds better to real existing hardware.

This is btw. also true for Qemu itself, the mips_r4k machine is still
there because
 a) uBoot supports it as the only mips Qemu target
 b) Some out-of-tree machine definitions use it as a baseline
    configuration.


Thiemo

From ddaney@avtrex.com Sun Apr 20 00:16:23 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 20 Apr 2008 00:16:25 +0100 (BST)
Received: from smtp1.dnsmadeeasy.com ([205.234.170.144]:58580 "EHLO
	smtp1.dnsmadeeasy.com") by ftp.linux-mips.org with ESMTP
	id S28575716AbYDSXQX (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 20 Apr 2008 00:16:23 +0100
Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id 538AD3188A8;
	Sat, 19 Apr 2008 23:17:10 +0000 (UTC)
X-Authenticated-Name: js.dnsmadeeasy
X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com
Received: from avtrex.com (unknown [67.116.42.147])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP;
	Sat, 19 Apr 2008 23:17:10 +0000 (UTC)
Received: from [192.168.7.221] ([192.168.7.221]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Sat, 19 Apr 2008 16:16:11 -0700
Message-ID: <480A7D3A.2040004@avtrex.com>
Date:	Sat, 19 Apr 2008 16:16:10 -0700
From:	David Daney <ddaney@avtrex.com>
User-Agent: Thunderbird 1.5.0.12 (X11/20071019)
MIME-Version: 1.0
To:	Thiemo Seufer <ths@networkno.de>
Cc:	linux-mips@linux-mips.org
Subject: Re: Building current kernel for Qemu
References: <480A70EA.50804@avtrex.com> <20080419230844.GA31431@networkno.de>
In-Reply-To: <20080419230844.GA31431@networkno.de>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 19 Apr 2008 23:16:11.0219 (UTC) FILETIME=[5B071A30:01C8A273]
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: 18964
X-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: 696
Lines: 21

Thiemo Seufer wrote:
> David Daney wrote:
>   
>> I would like to build a current kernel for mipsel on qemu.  However it
>> seems that the qemu target was recently removed.
>>
>> I tried building a plain malta kernel vmlinux, but there is no output on
>> the console when trying to boot it.  The Debian 2.6.18 qemu kernel seems
>> to work well though.
>>
>> Do you have to do anything special to the kernel to run on qemu?
>>     
>
> Nothing special is needed for the kernel. You need to start with
> e.g. "qemu-system-mipsel -M malta" to select Qemu's malta machine
> emulation.
>   
Thanks Thiemo,  the '-M malta' is all I was missing.  I am now running
with the current git tip.

David Daney

From bunk@kernel.org Sun Apr 20 11:04:10 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 20 Apr 2008 11:04:13 +0100 (BST)
Received: from smtp5.pp.htv.fi ([213.243.153.39]:27347 "EHLO smtp5.pp.htv.fi")
	by ftp.linux-mips.org with ESMTP id S20034109AbYDTKEK (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sun, 20 Apr 2008 11:04:10 +0100
Received: from cs181133002.pp.htv.fi (cs181133002.pp.htv.fi [82.181.133.2])
	by smtp5.pp.htv.fi (Postfix) with ESMTP id 8E2705BC043;
	Sun, 20 Apr 2008 13:04:09 +0300 (EEST)
Date:	Sun, 20 Apr 2008 13:03:47 +0300
From:	Adrian Bunk <bunk@kernel.org>
To:	Michael Buesch <mb@bu3sch.de>,
	"John W. Linville" <linville@tuxdriver.com>,
	Aurelien Jarno <aurelien@aurel32.net>,
	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: mips BCM47XX compile error
Message-ID: <20080420100347.GH1595@cs181133002.pp.htv.fi>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
User-Agent: Mutt/1.5.17+20080114 (2008-01-14)
Return-Path: <bunk@kernel.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18965
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: bunk@kernel.org
Precedence: bulk
X-list: linux-mips
Content-Length: 958
Lines: 29

Commit aab547ce0d1493d400b6468c521a0137cd8c1edf
(ssb: Add Gigabit Ethernet driver) causes the following
build error with bcm47xx_defconfig:

<--  snip  -->

...
  LD      .tmp_vmlinux1
arch/mips/pci/built-in.o: In function `pcibios_enable_device':
(.text+0x1f8): undefined reference to `pcibios_plat_dev_init'
arch/mips/pci/built-in.o: In function `pcibios_enable_device':
(.text+0x1f8): relocation truncated to fit: R_MIPS_26 against `pcibios_plat_dev_init'
arch/mips/pci/built-in.o: In function `pcibios_init':
pci.c:(.init.text+0x14c): undefined reference to `pcibios_map_irq'
pci.c:(.init.text+0x158): undefined reference to `pcibios_map_irq'
make[1]: *** [.tmp_vmlinux1] Error 1

<--  snip  -->

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


From mb@bu3sch.de Sun Apr 20 11:15:26 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 20 Apr 2008 11:15:28 +0100 (BST)
Received: from vs166246.vserver.de ([62.75.166.246]:2951 "EHLO
	vs166246.vserver.de") by ftp.linux-mips.org with ESMTP
	id S20034163AbYDTKP0 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 20 Apr 2008 11:15:26 +0100
Received: from t5d89.t.pppool.de ([89.55.93.137] helo=powermac.local)
	by vs166246.vserver.de with esmtpa (Exim 4.63)
	(envelope-from <mb@bu3sch.de>)
	id 1JnWZg-0004mO-2F; Sun, 20 Apr 2008 10:15:08 +0000
From:	Michael Buesch <mb@bu3sch.de>
To:	Adrian Bunk <bunk@kernel.org>
Subject: Re: mips BCM47XX compile error
Date:	Sun, 20 Apr 2008 12:14:46 +0200
User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405)
Cc:	"John W. Linville" <linville@tuxdriver.com>,
	Aurelien Jarno <aurelien@aurel32.net>,
	Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org,
	linux-kernel@vger.kernel.org
References: <20080420100347.GH1595@cs181133002.pp.htv.fi>
In-Reply-To: <20080420100347.GH1595@cs181133002.pp.htv.fi>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804201214.46936.mb@bu3sch.de>
Return-Path: <mb@bu3sch.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: 18966
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: mb@bu3sch.de
Precedence: bulk
X-list: linux-mips
Content-Length: 982
Lines: 24

On Sunday 20 April 2008 12:03:47 Adrian Bunk wrote:
> Commit aab547ce0d1493d400b6468c521a0137cd8c1edf
> (ssb: Add Gigabit Ethernet driver) causes the following
> build error with bcm47xx_defconfig:
> 
> <--  snip  -->
> 
> ...
>   LD      .tmp_vmlinux1
> arch/mips/pci/built-in.o: In function `pcibios_enable_device':
> (.text+0x1f8): undefined reference to `pcibios_plat_dev_init'
> arch/mips/pci/built-in.o: In function `pcibios_enable_device':
> (.text+0x1f8): relocation truncated to fit: R_MIPS_26 against `pcibios_plat_dev_init'
> arch/mips/pci/built-in.o: In function `pcibios_init':
> pci.c:(.init.text+0x14c): undefined reference to `pcibios_map_irq'
> pci.c:(.init.text+0x158): undefined reference to `pcibios_map_irq'
> make[1]: *** [.tmp_vmlinux1] Error 1

Some parts of the new 47xx arch code are not ported, yet.
Somebody should port all the new code from openwrt SVN over to mainline.
I don't really have time for that, at the moment, though.

-- 
Greetings Michael.

From ralf@linux-mips.org Sun Apr 20 12:24:28 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 20 Apr 2008 12:24:31 +0100 (BST)
Received: from oss.sgi.com ([192.48.170.157]:485 "EHLO oss.sgi.com")
	by ftp.linux-mips.org with ESMTP id S20033966AbYDTLY2 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sun, 20 Apr 2008 12:24:28 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3KBNh8s019340
	for <linux-mips@linux-mips.org>; Sun, 20 Apr 2008 04:23:43 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m3KBOInW021118;
	Sun, 20 Apr 2008 12:24:18 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m3KBOHWI021117;
	Sun, 20 Apr 2008 12:24:17 +0100
Date:	Sun, 20 Apr 2008 12:24:17 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Ilpo =?iso-8859-1?Q?J=E4rvinen?= <ilpo.jarvinen@helsinki.fi>
Cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] [MIPS] Fix order of BRK_BUG in case
Message-ID: <20080420112417.GA21078@linux-mips.org>
References: <Pine.LNX.4.64.0804192310460.20623@wrl-59.cs.helsinki.fi>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <Pine.LNX.4.64.0804192310460.20623@wrl-59.cs.helsinki.fi>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18967
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 623
Lines: 19

On Sat, Apr 19, 2008 at 11:16:36PM +0300, Ilpo Järvinen wrote:

> diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
> index 984c0d0..4dfcd61 100644
> --- a/arch/mips/kernel/traps.c
> +++ b/arch/mips/kernel/traps.c
> @@ -694,7 +694,7 @@ asmlinkage void do_bp(struct pt_regs *regs)
>  		info.si_addr = (void __user *) regs->cp0_epc;
>  		force_sig_info(SIGFPE, &info, current);
>  		break;
> -	case BRK_BUG:
> +	case BRK_BUG << 10:
>  		die("Kernel bug detected", regs);
                ^^^

Now what will be happening if with your patch applied a "break BRK_BUG"
instruction is executed in userspace?

  Ralf

From ilpo.jarvinen@helsinki.fi Sun Apr 20 19:38:30 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 20 Apr 2008 19:38:32 +0100 (BST)
Received: from courier.cs.helsinki.fi ([128.214.9.1]:12437 "EHLO
	mail.cs.helsinki.fi") by ftp.linux-mips.org with ESMTP
	id S20035928AbYDTSia (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 20 Apr 2008 19:38:30 +0100
Received: from wrl-59.cs.helsinki.fi (wrl-59.cs.helsinki.fi [128.214.166.179])
  (AUTH: PLAIN cs-relay, TLS: TLSv1/SSLv3,256bits,AES256-SHA)
  by mail.cs.helsinki.fi with esmtp; Sun, 20 Apr 2008 21:38:28 +0300
  id 00068138.480B8DA4.00005025
Received: by wrl-59.cs.helsinki.fi (Postfix, from userid 50795)
	id 89DC1A0092; Sun, 20 Apr 2008 21:38:28 +0300 (EEST)
Received: from localhost (localhost [127.0.0.1])
	by wrl-59.cs.helsinki.fi (Postfix) with ESMTP id 786C1A006C;
	Sun, 20 Apr 2008 21:38:28 +0300 (EEST)
Date:	Sun, 20 Apr 2008 21:38:28 +0300 (EEST)
From:	"=?ISO-8859-1?Q?Ilpo_J=E4rvinen?=" <ilpo.jarvinen@helsinki.fi>
X-X-Sender: ijjarvin@wrl-59.cs.helsinki.fi
To:	Ralf Baechle <ralf@linux-mips.org>
cc:	linux-mips@linux-mips.org
Subject: Re: [PATCH] [MIPS] Fix order of BRK_BUG in case
In-Reply-To: <20080420112417.GA21078@linux-mips.org>
Message-ID: <Pine.LNX.4.64.0804202132010.4083@wrl-59.cs.helsinki.fi>
References: <Pine.LNX.4.64.0804192310460.20623@wrl-59.cs.helsinki.fi>
 <20080420112417.GA21078@linux-mips.org>
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="-696208474-2054475427-1208716708=:4083"
Return-Path: <ilpo.jarvinen@helsinki.fi>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18968
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ilpo.jarvinen@helsinki.fi
Precedence: bulk
X-list: linux-mips
Content-Length: 1444
Lines: 37

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

---696208474-2054475427-1208716708=:4083
Content-Type: TEXT/PLAIN; charset=iso-8859-1
Content-Transfer-Encoding: 8BIT

On Sun, 20 Apr 2008, Ralf Baechle wrote:

> On Sat, Apr 19, 2008 at 11:16:36PM +0300, Ilpo Järvinen wrote:
> 
> > diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
> > index 984c0d0..4dfcd61 100644
> > --- a/arch/mips/kernel/traps.c
> > +++ b/arch/mips/kernel/traps.c
> > @@ -694,7 +694,7 @@ asmlinkage void do_bp(struct pt_regs *regs)
> >  		info.si_addr = (void __user *) regs->cp0_epc;
> >  		force_sig_info(SIGFPE, &info, current);
> >  		break;
> > -	case BRK_BUG:
> > +	case BRK_BUG << 10:
> >  		die("Kernel bug detected", regs);
>                 ^^^
> 
> Now what will be happening if with your patch applied a "break BRK_BUG"
> instruction is executed in userspace?

I suppose you know better, I can only guess :-). Like I said, I have no 
idea about mips code, maybe one would want die_if_kernel() kernel 
instead...? My main point was that the conversion made by commit 63dc68a8 
here seems questionable (resulted in dead code and would that not have 
been dead code the question you asked would apply to that code fragment), 
what is the right thing to do, you sure know better than I do :-).

-- 
 i.
---696208474-2054475427-1208716708=:4083--

From aurelien@aurel32.net Sun Apr 20 23:30:29 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 20 Apr 2008 23:30:31 +0100 (BST)
Received: from hall2.aurel32.net ([91.121.138.14]:5517 "EHLO hall2.aurel32.net")
	by ftp.linux-mips.org with ESMTP id S20036868AbYDTWa3 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Sun, 20 Apr 2008 23:30:29 +0100
Received: from aurel32 by hall2.aurel32.net with local (Exim 4.63)
	(envelope-from <aurelien@aurel32.net>)
	id 1Jni3I-0002Xh-1c; Mon, 21 Apr 2008 00:30:28 +0200
Date:	Mon, 21 Apr 2008 00:30:28 +0200
From:	Aurelien Jarno <aurelien@aurel32.net>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org
Subject: [PATCH 0/4] MIPS BCM47xx patches (resend)
Message-ID: <20080420223028.GA9282@hall2.aurel32.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: inline
X-Mailer: Mutt 1.5.13 (2006-08-11)
User-Agent: Mutt/1.5.13 (2006-08-11)
Return-Path: <aurelien@aurel32.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: 18969
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: aurelien@aurel32.net
Precedence: bulk
X-list: linux-mips
Content-Length: 535
Lines: 12

The following 4 patches have been sent 2 months ago, but they haven't
been been merged yet and I haven't received any comment. I am resending 
them again, in the hope to see them merged for 2.6.26.

The first patch is really important to make PCI working again on this
platform (broken since 2.6.24).

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

From aurelien@aurel32.net Sun Apr 20 23:31:16 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 20 Apr 2008 23:31:18 +0100 (BST)
Received: from hall2.aurel32.net ([91.121.138.14]:10893 "EHLO
	hall2.aurel32.net") by ftp.linux-mips.org with ESMTP
	id S20036869AbYDTWbQ (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 20 Apr 2008 23:31:16 +0100
Received: from aurel32 by hall2.aurel32.net with local (Exim 4.63)
	(envelope-from <aurelien@aurel32.net>)
	id 1Jni43-0002YD-QL; Mon, 21 Apr 2008 00:31:15 +0200
Date:	Mon, 21 Apr 2008 00:31:15 +0200
From:	Aurelien Jarno <aurelien@aurel32.net>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org
Subject: [PATCH 1/4] Scan PCI busses when they are registered
Message-ID: <20080420223115.GA9783@hall2.aurel32.net>
References: <20080420223028.GA9282@hall2.aurel32.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: inline
In-Reply-To: <20080420223028.GA9282@hall2.aurel32.net>
X-Mailer: Mutt 1.5.13 (2006-08-11)
User-Agent: Mutt/1.5.13 (2006-08-11)
Return-Path: <aurelien@aurel32.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: 18970
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: aurelien@aurel32.net
Precedence: bulk
X-list: linux-mips
Content-Length: 3806
Lines: 138

The patch below changes register_pci_controller() such that controllers
being added after pcibios_init() has run are be scanned immediately.

This is needed for example by the BCM47xx PCI controller, which is
located on the SSB bus, which is now initialized after the PCI
subsystem.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 arch/mips/pci/pci.c |   80 +++++++++++++++++++++++++++++++++-----------------
 1 files changed, 53 insertions(+), 27 deletions(-)

diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index 358ad62..d0d811d 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -35,6 +35,8 @@ struct pci_controller *pci_isa_hose;
 unsigned long PCIBIOS_MIN_IO	= 0x0000;
 unsigned long PCIBIOS_MIN_MEM	= 0;
 
+static int pci_initialized;
+
 /*
  * We need to avoid collisions with `mirrored' VGA ports
  * and other strange ISA hardware, so we always want the
@@ -75,6 +77,42 @@ pcibios_align_resource(void *data, struct resource *res,
 	res->start = start;
 }
 
+static void __devinit pcibios_scanbus(struct pci_controller *hose)
+{
+	static int next_busno;
+	static int need_domain_info;
+	struct pci_bus *bus;
+
+	if (!hose->iommu)
+		PCI_DMA_BUS_IS_PHYS = 1;
+
+	if (hose->get_busno && pci_probe_only)
+		next_busno = (*hose->get_busno)();
+
+	bus = pci_scan_bus(next_busno, hose->pci_ops, hose);
+	hose->bus = bus;
+
+	need_domain_info = need_domain_info || hose->index;
+	hose->need_domain_info = need_domain_info;
+	if (bus) {
+		next_busno = bus->subordinate + 1;
+		/* Don't allow 8-bit bus number overflow inside the hose -
+		   reserve some space for bridges. */
+		if (next_busno > 224) {
+			next_busno = 0;
+			need_domain_info = 1;
+		}
+
+		if (!pci_probe_only) {
+			pci_bus_size_bridges(bus);
+			pci_bus_assign_resources(bus);
+			pci_enable_bridges(bus);
+		}
+	}
+}
+
+static DEFINE_MUTEX(pci_scan_mutex);
+
 void __devinit register_pci_controller(struct pci_controller *hose)
 {
 	if (request_resource(&iomem_resource, hose->mem_resource) < 0)
@@ -94,6 +132,17 @@ void __devinit register_pci_controller(struct pci_controller *hose)
 		printk(KERN_WARNING
 		       "registering PCI controller with io_map_base unset\n");
 	}
+
+	/*
+	 * Scan the bus if it is register after the PCI subsystem
+	 * initialization.
+	 */
+	if (pci_initialized) {
+		mutex_lock(&pci_scan_mutex);
+		pcibios_scanbus(hose);
+		mutex_unlock(&pci_scan_mutex);
+	}
+
 	return;
 
 out:
@@ -126,38 +175,15 @@ static u8 __init common_swizzle(struct pci_dev *dev, u8 *pinp)
 static int __init pcibios_init(void)
 {
 	struct pci_controller *hose;
-	struct pci_bus *bus;
-	int next_busno;
-	int need_domain_info = 0;
 
 	/* Scan all of the recorded PCI controllers.  */
-	for (next_busno = 0, hose = hose_head; hose; hose = hose->next) {
-
-		if (!hose->iommu)
-			PCI_DMA_BUS_IS_PHYS = 1;
-
-		if (hose->get_busno && pci_probe_only)
-			next_busno = (*hose->get_busno)();
-
-		bus = pci_scan_bus(next_busno, hose->pci_ops, hose);
-		hose->bus = bus;
-		need_domain_info = need_domain_info || hose->index;
-		hose->need_domain_info = need_domain_info;
-		if (bus) {
-			next_busno = bus->subordinate + 1;
-			/* Don't allow 8-bit bus number overflow inside the hose -
-			   reserve some space for bridges. */
-			if (next_busno > 224) {
-				next_busno = 0;
-				need_domain_info = 1;
-			}
-		}
-	}
+	for (hose = hose_head; hose; hose = hose->next)
+		pcibios_scanbus(hose);
 
-	if (!pci_probe_only)
-		pci_assign_unassigned_resources();
 	pci_fixup_irqs(common_swizzle, pcibios_map_irq);
 
+	pci_initialized = 1;
+
 	return 0;
 }
 
-- 
1.5.5


-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

From aurelien@aurel32.net Sun Apr 20 23:32:00 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 20 Apr 2008 23:32:02 +0100 (BST)
Received: from hall2.aurel32.net ([91.121.138.14]:16014 "EHLO
	hall2.aurel32.net") by ftp.linux-mips.org with ESMTP
	id S20036874AbYDTWcA (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 20 Apr 2008 23:32:00 +0100
Received: from aurel32 by hall2.aurel32.net with local (Exim 4.63)
	(envelope-from <aurelien@aurel32.net>)
	id 1Jni4l-0002Yh-QW; Mon, 21 Apr 2008 00:31:59 +0200
Date:	Mon, 21 Apr 2008 00:31:59 +0200
From:	Aurelien Jarno <aurelien@aurel32.net>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org
Subject: [PATCH 2/4] WGT634U: Add machine detection message
Message-ID: <20080420223159.GB9783@hall2.aurel32.net>
References: <20080420223028.GA9282@hall2.aurel32.net> <20080420223115.GA9783@hall2.aurel32.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: inline
In-Reply-To: <20080420223115.GA9783@hall2.aurel32.net>
X-Mailer: Mutt 1.5.13 (2006-08-11)
User-Agent: Mutt/1.5.13 (2006-08-11)
Return-Path: <aurelien@aurel32.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: 18971
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: aurelien@aurel32.net
Precedence: bulk
X-list: linux-mips
Content-Length: 1057
Lines: 30

This adds a printk message when a WGT634U machine is detected.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 arch/mips/bcm47xx/wgt634u.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/mips/bcm47xx/wgt634u.c b/arch/mips/bcm47xx/wgt634u.c
index d1d90c9..f9e309a 100644
--- a/arch/mips/bcm47xx/wgt634u.c
+++ b/arch/mips/bcm47xx/wgt634u.c
@@ -112,6 +112,9 @@ static int __init wgt634u_init(void)
 	    ((et0mac[1] == 0x09 && et0mac[2] == 0x5b) ||
 	     (et0mac[1] == 0x0f && et0mac[2] == 0xb5))) {
 		struct ssb_mipscore *mcore = &ssb_bcm47xx.mipscore;
+
+		printk(KERN_INFO "WGT634U machine detected.\n");
+
 		wgt634u_flash_data.width = mcore->flash_buswidth;
 		wgt634u_flash_resource.start = mcore->flash_window;
 		wgt634u_flash_resource.end = mcore->flash_window
-- 
1.5.5


-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

From aurelien@aurel32.net Sun Apr 20 23:33:08 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 20 Apr 2008 23:33:11 +0100 (BST)
Received: from hall2.aurel32.net ([91.121.138.14]:39630 "EHLO
	hall2.aurel32.net") by ftp.linux-mips.org with ESMTP
	id S20036872AbYDTWdI (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 20 Apr 2008 23:33:08 +0100
Received: from aurel32 by hall2.aurel32.net with local (Exim 4.63)
	(envelope-from <aurelien@aurel32.net>)
	id 1Jni5s-0002aG-6e; Mon, 21 Apr 2008 00:33:08 +0200
Date:	Mon, 21 Apr 2008 00:33:08 +0200
From:	Aurelien Jarno <aurelien@aurel32.net>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org
Subject: [PATCH 3/4] BCM47xx: Use the new SSB GPIO API
Message-ID: <20080420223308.GC9783@hall2.aurel32.net>
References: <20080420223028.GA9282@hall2.aurel32.net> <20080420223115.GA9783@hall2.aurel32.net> <20080420223159.GB9783@hall2.aurel32.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: inline
In-Reply-To: <20080420223159.GB9783@hall2.aurel32.net>
X-Mailer: Mutt 1.5.13 (2006-08-11)
User-Agent: Mutt/1.5.13 (2006-08-11)
Return-Path: <aurelien@aurel32.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: 18972
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: aurelien@aurel32.net
Precedence: bulk
X-list: linux-mips
Content-Length: 7373
Lines: 238

This patch simplifies the BCM47xx GPIO code by using the new SSB GPIO
API, which does a lot things that were implemented directly in the
BCM47xx code.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 arch/mips/Kconfig                    |    1 +
 arch/mips/bcm47xx/gpio.c             |   81 ++++++++++++---------------------
 arch/mips/bcm47xx/setup.c            |    5 +-
 include/asm-mips/mach-bcm47xx/gpio.h |   41 ++++++++---------
 4 files changed, 54 insertions(+), 74 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 8724ed3..e65c4de 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -52,6 +52,7 @@ config BCM47XX
 	select SSB
 	select SSB_DRIVER_MIPS
 	select SSB_DRIVER_EXTIF
+	select SSB_EMBEDDED
 	select SSB_PCICORE_HOSTMODE if PCI
 	select GENERIC_GPIO
 	select SYS_HAS_EARLY_PRINTK
diff --git a/arch/mips/bcm47xx/gpio.c b/arch/mips/bcm47xx/gpio.c
index f5a53ac..218713d 100644
--- a/arch/mips/bcm47xx/gpio.c
+++ b/arch/mips/bcm47xx/gpio.c
@@ -12,68 +12,47 @@
 #include <asm/mach-bcm47xx/bcm47xx.h>
 #include <asm/mach-bcm47xx/gpio.h>
 
-int bcm47xx_gpio_to_irq(unsigned gpio)
+static DECLARE_BITMAP(gpio_in_use, BCM47XX_CHIPCO_GPIO_LINES);
+
+int gpio_request(unsigned gpio, const char *tag)
 {
-	if (ssb_bcm47xx.chipco.dev)
-		return ssb_mips_irq(ssb_bcm47xx.chipco.dev) + 2;
-	else if (ssb_bcm47xx.extif.dev)
-		return ssb_mips_irq(ssb_bcm47xx.extif.dev) + 2;
-	else
+	if (ssb_chipco_available(&ssb_bcm47xx.chipco) &&
+	    gpio >= BCM47XX_CHIPCO_GPIO_LINES)
 		return -EINVAL;
-}
-EXPORT_SYMBOL_GPL(bcm47xx_gpio_to_irq);
 
-int bcm47xx_gpio_get_value(unsigned gpio)
-{
-	if (ssb_bcm47xx.chipco.dev)
-		return ssb_chipco_gpio_in(&ssb_bcm47xx.chipco, 1 << gpio);
-	else if (ssb_bcm47xx.extif.dev)
-		return ssb_extif_gpio_in(&ssb_bcm47xx.extif, 1 << gpio);
-	else
-		return 0;
-}
-EXPORT_SYMBOL_GPL(bcm47xx_gpio_get_value);
+	if (ssb_extif_available(&ssb_bcm47xx.extif) &&
+	    gpio >= BCM47XX_EXTIF_GPIO_LINES)
+		return -EINVAL;
 
-void bcm47xx_gpio_set_value(unsigned gpio, int value)
-{
-	if (ssb_bcm47xx.chipco.dev)
-		ssb_chipco_gpio_out(&ssb_bcm47xx.chipco,
-				    1 << gpio,
-				    value ? 1 << gpio : 0);
-	else if (ssb_bcm47xx.extif.dev)
-		ssb_extif_gpio_out(&ssb_bcm47xx.extif,
-				   1 << gpio,
-				   value ? 1 << gpio : 0);
-}
-EXPORT_SYMBOL_GPL(bcm47xx_gpio_set_value);
+	if (test_and_set_bit(gpio, gpio_in_use))
+		return -EBUSY;
 
-int bcm47xx_gpio_direction_input(unsigned gpio)
-{
-	if (ssb_bcm47xx.chipco.dev && (gpio < BCM47XX_CHIPCO_GPIO_LINES))
-		ssb_chipco_gpio_outen(&ssb_bcm47xx.chipco,
-				      1 << gpio, 0);
-	else if (ssb_bcm47xx.extif.dev && (gpio < BCM47XX_EXTIF_GPIO_LINES))
-		ssb_extif_gpio_outen(&ssb_bcm47xx.extif,
-				     1 << gpio, 0);
-	else
-		return -EINVAL;
 	return 0;
 }
-EXPORT_SYMBOL_GPL(bcm47xx_gpio_direction_input);
+EXPORT_SYMBOL(gpio_request);
 
-int bcm47xx_gpio_direction_output(unsigned gpio, int value)
+void gpio_free(unsigned gpio)
 {
-	bcm47xx_gpio_set_value(gpio, value);
+	if (ssb_chipco_available(&ssb_bcm47xx.chipco) &&
+	    gpio >= BCM47XX_CHIPCO_GPIO_LINES)
+		return;
+
+	if (ssb_extif_available(&ssb_bcm47xx.extif) &&
+	    gpio >= BCM47XX_EXTIF_GPIO_LINES)
+		return;
+
+	clear_bit(gpio, gpio_in_use);
+}
+EXPORT_SYMBOL(gpio_free);
 
-	if (ssb_bcm47xx.chipco.dev && (gpio < BCM47XX_CHIPCO_GPIO_LINES))
-		ssb_chipco_gpio_outen(&ssb_bcm47xx.chipco,
-				      1 << gpio, 1 << gpio);
-	else if (ssb_bcm47xx.extif.dev && (gpio < BCM47XX_EXTIF_GPIO_LINES))
-		ssb_extif_gpio_outen(&ssb_bcm47xx.extif,
-				     1 << gpio, 1 << gpio);
+int gpio_to_irq(unsigned gpio)
+{
+	if (ssb_chipco_available(&ssb_bcm47xx.chipco))
+		return ssb_mips_irq(ssb_bcm47xx.chipco.dev) + 2;
+	else if (ssb_extif_available(&ssb_bcm47xx.extif))
+		return ssb_mips_irq(ssb_bcm47xx.extif.dev) + 2;
 	else
 		return -EINVAL;
-	return 0;
 }
-EXPORT_SYMBOL_GPL(bcm47xx_gpio_direction_output);
+EXPORT_SYMBOL_GPL(gpio_to_irq);
 
diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
index 8d36f18..2f580fa 100644
--- a/arch/mips/bcm47xx/setup.c
+++ b/arch/mips/bcm47xx/setup.c
@@ -27,6 +27,7 @@
 
 #include <linux/types.h>
 #include <linux/ssb/ssb.h>
+#include <linux/ssb/ssb_embedded.h>
 #include <asm/bootinfo.h>
 #include <asm/reboot.h>
 #include <asm/time.h>
@@ -41,7 +42,7 @@ static void bcm47xx_machine_restart(char *command)
 	printk(KERN_ALERT "Please stand by while rebooting the system...\n");
 	local_irq_disable();
 	/* Set the watchdog timer to reset immediately */
-	ssb_chipco_watchdog_timer_set(&ssb_bcm47xx.chipco, 1);
+	ssb_watchdog_timer_set(&ssb_bcm47xx, 1);
 	while (1)
 		cpu_relax();
 }
@@ -50,7 +51,7 @@ static void bcm47xx_machine_halt(void)
 {
 	/* Disable interrupts and watchdog and spin forever */
 	local_irq_disable();
-	ssb_chipco_watchdog_timer_set(&ssb_bcm47xx.chipco, 0);
+	ssb_watchdog_timer_set(&ssb_bcm47xx, 0);
 	while (1)
 		cpu_relax();
 }
diff --git a/include/asm-mips/mach-bcm47xx/gpio.h b/include/asm-mips/mach-bcm47xx/gpio.h
index cfc8f4d..9b5218b 100644
--- a/include/asm-mips/mach-bcm47xx/gpio.h
+++ b/include/asm-mips/mach-bcm47xx/gpio.h
@@ -9,47 +9,46 @@
 #ifndef __BCM47XX_GPIO_H
 #define __BCM47XX_GPIO_H
 
+#include <linux/ssb/ssb_embedded.h>
+#include <asm/mach-bcm47xx/bcm47xx.h>
+
 #define BCM47XX_EXTIF_GPIO_LINES	5
 #define BCM47XX_CHIPCO_GPIO_LINES	16
 
-extern int bcm47xx_gpio_to_irq(unsigned gpio);
-extern int bcm47xx_gpio_get_value(unsigned gpio);
-extern void bcm47xx_gpio_set_value(unsigned gpio, int value);
-extern int bcm47xx_gpio_direction_input(unsigned gpio);
-extern int bcm47xx_gpio_direction_output(unsigned gpio, int value);
-
-static inline int gpio_request(unsigned gpio, const char *label)
-{
-       return 0;
-}
+int gpio_request(unsigned gpio, const char *label);
+void gpio_free(unsigned gpio);
+int gpio_to_irq(unsigned gpio);
 
-static inline void gpio_free(unsigned gpio)
+static inline int gpio_get_value(unsigned gpio)
 {
+	return ssb_gpio_in(&ssb_bcm47xx, 1 << gpio);
 }
 
-static inline int gpio_to_irq(unsigned gpio)
+static inline void gpio_set_value(unsigned gpio, int value)
 {
-	return bcm47xx_gpio_to_irq(gpio);
+	ssb_gpio_out(&ssb_bcm47xx, 1 << gpio, value ? 1 << gpio : 0);
 }
 
-static inline int gpio_get_value(unsigned gpio)
+static inline int gpio_direction_input(unsigned gpio)
 {
-	return bcm47xx_gpio_get_value(gpio);
+	return ssb_gpio_outen(&ssb_bcm47xx, 1 << gpio, 0);
 }
 
-static inline void gpio_set_value(unsigned gpio, int value)
+static inline int gpio_direction_output(unsigned gpio, int value)
 {
-	bcm47xx_gpio_set_value(gpio, value);
+	return ssb_gpio_outen(&ssb_bcm47xx, 1 << gpio, 1);
 }
 
-static inline int gpio_direction_input(unsigned gpio)
+static int gpio_intmask(unsigned gpio, int value)
 {
-	return bcm47xx_gpio_direction_input(gpio);
+	return ssb_gpio_intmask(&ssb_bcm47xx, 1 << gpio,
+				value ? 1 << gpio : 0);
 }
 
-static inline int gpio_direction_output(unsigned gpio, int value)
+static int gpio_polarity(unsigned gpio, int value)
 {
-	return bcm47xx_gpio_direction_output(gpio, value);
+	return ssb_gpio_polarity(&ssb_bcm47xx, 1 << gpio,
+				 value ? 1 << gpio : 0);
 }
 
 
-- 
1.5.5


-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

From aurelien@aurel32.net Sun Apr 20 23:33:42 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 20 Apr 2008 23:33:44 +0100 (BST)
Received: from hall2.aurel32.net ([91.121.138.14]:42958 "EHLO
	hall2.aurel32.net") by ftp.linux-mips.org with ESMTP
	id S20036890AbYDTWdm (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 20 Apr 2008 23:33:42 +0100
Received: from aurel32 by hall2.aurel32.net with local (Exim 4.63)
	(envelope-from <aurelien@aurel32.net>)
	id 1Jni6Q-0002ar-33; Mon, 21 Apr 2008 00:33:42 +0200
Date:	Mon, 21 Apr 2008 00:33:42 +0200
From:	Aurelien Jarno <aurelien@aurel32.net>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	linux-mips@linux-mips.org
Subject: [PATCH 4/4] Add WGT634U reset button support
Message-ID: <20080420223342.GD9783@hall2.aurel32.net>
References: <20080420223028.GA9282@hall2.aurel32.net> <20080420223115.GA9783@hall2.aurel32.net> <20080420223159.GB9783@hall2.aurel32.net> <20080420223308.GC9783@hall2.aurel32.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: inline
In-Reply-To: <20080420223308.GC9783@hall2.aurel32.net>
X-Mailer: Mutt 1.5.13 (2006-08-11)
User-Agent: Mutt/1.5.13 (2006-08-11)
Return-Path: <aurelien@aurel32.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: 18973
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: aurelien@aurel32.net
Precedence: bulk
X-list: linux-mips
Content-Length: 2389
Lines: 79

This patch adds support for the reset button of WGT634U machine, using
GPIO interrupts. Based on a patch from Michel Lespinasse.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 arch/mips/bcm47xx/wgt634u.c |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/arch/mips/bcm47xx/wgt634u.c b/arch/mips/bcm47xx/wgt634u.c
index f9e309a..db1a72f 100644
--- a/arch/mips/bcm47xx/wgt634u.c
+++ b/arch/mips/bcm47xx/wgt634u.c
@@ -11,6 +11,9 @@
 #include <linux/leds.h>
 #include <linux/mtd/physmap.h>
 #include <linux/ssb/ssb.h>
+#include <linux/interrupt.h>
+#include <linux/reboot.h>
+#include <asm/gpio.h>
 #include <asm/mach-bcm47xx/bcm47xx.h>
 
 /* GPIO definitions for the WGT634U */
@@ -99,6 +102,30 @@ static struct platform_device *wgt634u_devices[] __initdata = {
 	&wgt634u_gpio_leds,
 };
 
+static irqreturn_t gpio_interrupt(int irq, void *ignored)
+{
+	int state;
+
+	/* Interrupts are shared, check if the current one is
+	   a GPIO interrupt. */
+	if (!ssb_chipco_irq_status(&ssb_bcm47xx.chipco,
+				   SSB_CHIPCO_IRQ_GPIO))
+		return IRQ_NONE;
+
+	state = gpio_get_value(WGT634U_GPIO_RESET);
+
+	/* Interrupt are level triggered, revert the interrupt polarity
+	   to clear the interrupt. */
+	gpio_polarity(WGT634U_GPIO_RESET, state);
+
+	if (!state) {
+		printk(KERN_INFO "Reset button pressed");
+		ctrl_alt_del();
+	}
+
+	return IRQ_HANDLED;
+}
+
 static int __init wgt634u_init(void)
 {
 	/* There is no easy way to detect that we are running on a WGT634U
@@ -115,6 +142,16 @@ static int __init wgt634u_init(void)
 
 		printk(KERN_INFO "WGT634U machine detected.\n");
 
+		if (!request_irq(gpio_to_irq(WGT634U_GPIO_RESET),
+				 gpio_interrupt, IRQF_SHARED,
+				 "WGT634U GPIO", &ssb_bcm47xx.chipco)) {
+			gpio_direction_input(WGT634U_GPIO_RESET);
+			gpio_intmask(WGT634U_GPIO_RESET, 1);
+			ssb_chipco_irq_mask(&ssb_bcm47xx.chipco,
+					    SSB_CHIPCO_IRQ_GPIO,
+					    SSB_CHIPCO_IRQ_GPIO);
+		}
+
 		wgt634u_flash_data.width = mcore->flash_buswidth;
 		wgt634u_flash_resource.start = mcore->flash_window;
 		wgt634u_flash_resource.end = mcore->flash_window
-- 
1.5.5


-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

From aurelien@aurel32.net Sun Apr 20 23:49:54 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 20 Apr 2008 23:49:56 +0100 (BST)
Received: from hall2.aurel32.net ([91.121.138.14]:44930 "EHLO
	hall2.aurel32.net") by ftp.linux-mips.org with ESMTP
	id S20037073AbYDTWty (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Sun, 20 Apr 2008 23:49:54 +0100
Received: from volta.aurel32.net ([2002:52e8:2fb:1:21e:8cff:feb0:693b])
	by hall2.aurel32.net with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.63)
	(envelope-from <aurelien@aurel32.net>)
	id 1JniLv-000317-0o; Mon, 21 Apr 2008 00:49:43 +0200
Received: from aurel32 by volta.aurel32.net with local (Exim 4.69)
	(envelope-from <aurelien@aurel32.net>)
	id 1JniLu-0005TC-Jf; Mon, 21 Apr 2008 00:49:42 +0200
Date:	Mon, 21 Apr 2008 00:49:42 +0200
From:	Aurelien Jarno <aurelien@aurel32.net>
To:	Michael Buesch <mb@bu3sch.de>
Cc:	Adrian Bunk <bunk@kernel.org>,
	"John W. Linville" <linville@tuxdriver.com>,
	Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org,
	linux-kernel@vger.kernel.org
Subject: Re: mips BCM47XX compile error
Message-ID: <20080420224942.GA21009@volta.aurel32.net>
Mail-Followup-To: Aurelien Jarno <aurelien@aurel32.net>,
	Michael Buesch <mb@bu3sch.de>, Adrian Bunk <bunk@kernel.org>,
	"John W. Linville" <linville@tuxdriver.com>,
	Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org,
	linux-kernel@vger.kernel.org
References: <20080420100347.GH1595@cs181133002.pp.htv.fi> <200804201214.46936.mb@bu3sch.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <200804201214.46936.mb@bu3sch.de>
User-Agent: Mozilla-Thunderbird 2.0.0.12 (X11/20080405)
Return-Path: <aurelien@aurel32.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: 18974
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: aurelien@aurel32.net
Precedence: bulk
X-list: linux-mips
Content-Length: 1450
Lines: 35

Michael Buesch a écrit :
> On Sunday 20 April 2008 12:03:47 Adrian Bunk wrote:
>> Commit aab547ce0d1493d400b6468c521a0137cd8c1edf
>> (ssb: Add Gigabit Ethernet driver) causes the following
>> build error with bcm47xx_defconfig:
>>
>> <--  snip  -->
>>
>> ...
>>   LD      .tmp_vmlinux1
>> arch/mips/pci/built-in.o: In function `pcibios_enable_device':
>> (.text+0x1f8): undefined reference to `pcibios_plat_dev_init'
>> arch/mips/pci/built-in.o: In function `pcibios_enable_device':
>> (.text+0x1f8): relocation truncated to fit: R_MIPS_26 against `pcibios_plat_dev_init'
>> arch/mips/pci/built-in.o: In function `pcibios_init':
>> pci.c:(.init.text+0x14c): undefined reference to `pcibios_map_irq'
>> pci.c:(.init.text+0x158): undefined reference to `pcibios_map_irq'
>> make[1]: *** [.tmp_vmlinux1] Error 1
> 
> Some parts of the new 47xx arch code are not ported, yet.

It would have been nice at least to warn before breaking a platform.

> Somebody should port all the new code from openwrt SVN over to mainline.
> I don't really have time for that, at the moment, though.

I gave a quick look at openwrt SVN, and only find 2.6.23 patches. I
can't find a possible fix among them. Do you have a better pointer?

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net


From anemo@mba.ocn.ne.jp Mon Apr 21 02:07:38 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 21 Apr 2008 02:07:40 +0100 (BST)
Received: from topsns2.toshiba-tops.co.jp ([202.230.225.126]:63603 "EHLO
	topsns2.toshiba-tops.co.jp") by ftp.linux-mips.org with ESMTP
	id S20041957AbYDUBHi (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 21 Apr 2008 02:07:38 +0100
Received: from topsms.toshiba-tops.co.jp by topsns2.toshiba-tops.co.jp
          via smtpd (for [213.58.128.207] [213.58.128.207]) with ESMTP; Mon, 21 Apr 2008 10:07:36 +0900
Received: from localhost (localhost.localdomain [127.0.0.1])
	by localhost.toshiba-tops.co.jp (Postfix) with SMTP id 0CFC54742A;
	Mon, 21 Apr 2008 10:07:28 +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 2A26D47421;
	Mon, 21 Apr 2008 10:07: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 m3L17LAF091093;
	Mon, 21 Apr 2008 10:07:22 +0900 (JST)
	(envelope-from anemo@mba.ocn.ne.jp)
Date:	Mon, 21 Apr 2008 10:07:21 +0900 (JST)
Message-Id: <20080421.100721.07644724.nemoto@toshiba-tops.co.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: Re: [MIPS] Fix handling of trap and breakpoint instructions
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <S20041689AbYDUAiN/20080421003813Z+6727@ftp.linux-mips.org>
References: <S20041689AbYDUAiN/20080421003813Z+6727@ftp.linux-mips.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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18975
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 299
Lines: 12

> Author: Ralf Baechle <ralf@linux-mips.org> Sun Apr 20 16:28:54 2008 +0100
> Commit: 5881bb0de64887a60f7f49922cf73a3b4d40fc01
> Gitweb: http://www.linux-mips.org/g/linux/5881bb0d
> Branch: master

You must drop left shift of this line too.

		if (bcode == (BRK_DIVZERO << 10))

---
Atsushi Nemoto


From aurelien@aurel32.net Mon Apr 21 08:29:03 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 21 Apr 2008 08:29:05 +0100 (BST)
Received: from hall2.aurel32.net ([91.121.138.14]:22490 "EHLO
	hall2.aurel32.net") by ftp.linux-mips.org with ESMTP
	id S20037618AbYDUH3D (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 21 Apr 2008 08:29:03 +0100
Received: from aurel32 by hall2.aurel32.net with local (Exim 4.63)
	(envelope-from <aurelien@aurel32.net>)
	id 1JnqSJ-0000tR-BN; Mon, 21 Apr 2008 09:28:51 +0200
Date:	Mon, 21 Apr 2008 09:28:51 +0200
From:	Aurelien Jarno <aurelien@aurel32.net>
To:	Michael Buesch <mb@bu3sch.de>, Adrian Bunk <bunk@kernel.org>,
	"John W. Linville" <linville@tuxdriver.com>,
	Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org,
	linux-kernel@vger.kernel.org
Subject: Re: mips BCM47XX compile error
Message-ID: <20080421072851.GA3381@hall2.aurel32.net>
Mail-Followup-To: Aurelien Jarno <aurelien@aurel32.net>,
	Michael Buesch <mb@bu3sch.de>, Adrian Bunk <bunk@kernel.org>,
	"John W. Linville" <linville@tuxdriver.com>,
	Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org,
	linux-kernel@vger.kernel.org
References: <20080420100347.GH1595@cs181133002.pp.htv.fi> <200804201214.46936.mb@bu3sch.de> <20080420224942.GA21009@volta.aurel32.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20080420224942.GA21009@volta.aurel32.net>
X-Mailer: Mutt 1.5.13 (2006-08-11)
User-Agent: Mutt/1.5.13 (2006-08-11)
Return-Path: <aurelien@aurel32.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: 18976
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: aurelien@aurel32.net
Precedence: bulk
X-list: linux-mips
Content-Length: 1691
Lines: 41

On Mon, Apr 21, 2008 at 12:49:42AM +0200, Aurelien Jarno wrote:
> Michael Buesch a écrit :
> > On Sunday 20 April 2008 12:03:47 Adrian Bunk wrote:
> >> Commit aab547ce0d1493d400b6468c521a0137cd8c1edf
> >> (ssb: Add Gigabit Ethernet driver) causes the following
> >> build error with bcm47xx_defconfig:
> >>
> >> <--  snip  -->
> >>
> >> ...
> >>   LD      .tmp_vmlinux1
> >> arch/mips/pci/built-in.o: In function `pcibios_enable_device':
> >> (.text+0x1f8): undefined reference to `pcibios_plat_dev_init'
> >> arch/mips/pci/built-in.o: In function `pcibios_enable_device':
> >> (.text+0x1f8): relocation truncated to fit: R_MIPS_26 against `pcibios_plat_dev_init'
> >> arch/mips/pci/built-in.o: In function `pcibios_init':
> >> pci.c:(.init.text+0x14c): undefined reference to `pcibios_map_irq'
> >> pci.c:(.init.text+0x158): undefined reference to `pcibios_map_irq'
> >> make[1]: *** [.tmp_vmlinux1] Error 1
> > 
> > Some parts of the new 47xx arch code are not ported, yet.
> 
> It would have been nice at least to warn before breaking a platform.
> 
> > Somebody should port all the new code from openwrt SVN over to mainline.
> > I don't really have time for that, at the moment, though.
> 
> I gave a quick look at openwrt SVN, and only find 2.6.23 patches. I
> can't find a possible fix among them. Do you have a better pointer?
> 

I have finally found it, the code was not in a form of a patch, but in
form of a C code file.

I am working on a fix.

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

From aurelien@aurel32.net Mon Apr 21 08:54:34 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 21 Apr 2008 08:54:36 +0100 (BST)
Received: from hall2.aurel32.net ([91.121.138.14]:9173 "EHLO hall2.aurel32.net")
	by ftp.linux-mips.org with ESMTP id S20037494AbYDUHye (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 21 Apr 2008 08:54:34 +0100
Received: from aurel32 by hall2.aurel32.net with local (Exim 4.63)
	(envelope-from <aurelien@aurel32.net>)
	id 1JnqrB-0001bf-7q; Mon, 21 Apr 2008 09:54:33 +0200
Date:	Mon, 21 Apr 2008 09:54:33 +0200
From:	Aurelien Jarno <aurelien@aurel32.net>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	Michael Buesch <mb@bu3sch.de>, linux-mips@linux-mips.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] BCM47xx: Add platform specific PCI code
Message-ID: <20080421075433.GA3966@hall2.aurel32.net>
Mail-Followup-To: Aurelien Jarno <aurelien@aurel32.net>,
	Ralf Baechle <ralf@linux-mips.org>, Michael Buesch <mb@bu3sch.de>,
	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: inline
X-Mailer: Mutt 1.5.13 (2006-08-11)
User-Agent: Mutt/1.5.13 (2006-08-11)
Return-Path: <aurelien@aurel32.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: 18977
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: aurelien@aurel32.net
Precedence: bulk
X-list: linux-mips
Content-Length: 3384
Lines: 96

This patch, ported from OpenWRT SVN, defines pcibios_map_irq() and
pcibios_plat_dev_init() for the BCM47xx platform.

It fixes the regression introduced by commit
aab547ce0d1493d400b6468c521a0137cd8c1edf.
---
 arch/mips/pci/Makefile      |    1 +
 arch/mips/pci/pci-bcm47xx.c |   58 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+), 0 deletions(-)
 create mode 100644 arch/mips/pci/pci-bcm47xx.c

diff --git a/arch/mips/pci/Makefile b/arch/mips/pci/Makefile
index ed0c076..64ba3fa 100644
--- a/arch/mips/pci/Makefile
+++ b/arch/mips/pci/Makefile
@@ -15,6 +15,7 @@ obj-$(CONFIG_MIPS_TX3927)	+= ops-tx3927.o
 obj-$(CONFIG_PCI_VR41XX)	+= ops-vr41xx.o pci-vr41xx.o
 obj-$(CONFIG_NEC_CMBVR4133)	+= fixup-vr4133.o
 obj-$(CONFIG_MARKEINS)		+= ops-emma2rh.o pci-emma2rh.o fixup-emma2rh.o
+obj-$(CONFIG_BCM47XX)		+= pci-bcm47xx.o
 
 #
 # These are still pretty much in the old state, watch, go blind.
diff --git a/arch/mips/pci/pci-bcm47xx.c b/arch/mips/pci/pci-bcm47xx.c
new file mode 100644
index 0000000..64ccb4f
--- /dev/null
+++ b/arch/mips/pci/pci-bcm47xx.c
@@ -0,0 +1,58 @@
+/*
+ *  Copyright (C) 2008 Michael Buesch <mb@bu3sch.de>
+ *  Copyright (C) 2008 Aurelien Jarno <aurelien@aurel32.net>
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ *  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/pci.h>
+#include <linux/ssb/ssb.h>
+
+int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
+{
+	int res;
+
+	res = ssb_pcibios_map_irq(dev, slot, pin);
+	if (res < 0) {
+		printk(KERN_ALERT "PCI: Failed to map IRQ of device %s\n",
+		       dev->dev.bus_id);
+		return 0;
+	}
+	/* IRQ-0 and IRQ-1 are software interrupts. */
+	WARN_ON((res == 0) || (res == 1));
+
+	return res;
+}
+
+int pcibios_plat_dev_init(struct pci_dev *dev)
+{
+	int err;
+
+	err = ssb_pcibios_plat_dev_init(dev);
+	if (err) {
+		printk(KERN_ALERT "PCI: Failed to init device %s\n",
+		       pci_name(dev));
+	}
+
+	return err;
+}
+
-- 
1.5.5


-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

From bunk@kernel.org Mon Apr 21 09:52:07 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 21 Apr 2008 09:52:09 +0100 (BST)
Received: from smtp6.pp.htv.fi ([213.243.153.40]:4001 "EHLO smtp6.pp.htv.fi")
	by ftp.linux-mips.org with ESMTP id S20038289AbYDUIwH (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 21 Apr 2008 09:52:07 +0100
Received: from cs181133002.pp.htv.fi (cs181133002.pp.htv.fi [82.181.133.2])
	by smtp6.pp.htv.fi (Postfix) with ESMTP id B53BF5BC03C;
	Mon, 21 Apr 2008 11:52:04 +0300 (EEST)
Date:	Mon, 21 Apr 2008 11:51:37 +0300
From:	Adrian Bunk <bunk@kernel.org>
To:	ralf@linux-mips.org
Cc:	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: [2.6 patch] mips: unexport __kmap_atomic_to_page
Message-ID: <20080421085137.GF26897@cs181133002.pp.htv.fi>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
User-Agent: Mutt/1.5.17+20080114 (2008-01-14)
Return-Path: <bunk@kernel.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18978
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: bunk@kernel.org
Precedence: bulk
X-list: linux-mips
Content-Length: 484
Lines: 14

This patch removes the no longer used export of __kmap_atomic_to_page.

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---
4d052a402ef108fb899e725d3492b605b8921d15 diff --git a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c
index 10dd2af..8f2cd8e 100644
--- a/arch/mips/mm/highmem.c
+++ b/arch/mips/mm/highmem.c
@@ -116,4 +116,3 @@ EXPORT_SYMBOL(__kmap);
 EXPORT_SYMBOL(__kunmap);
 EXPORT_SYMBOL(__kmap_atomic);
 EXPORT_SYMBOL(__kunmap_atomic);
-EXPORT_SYMBOL(__kmap_atomic_to_page);

From ralf@linux-mips.org Mon Apr 21 10:30:23 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 21 Apr 2008 10:30:25 +0100 (BST)
Received: from oss.sgi.com ([192.48.170.157]:49389 "EHLO oss.sgi.com")
	by ftp.linux-mips.org with ESMTP id S20022898AbYDUJaX (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 21 Apr 2008 10:30:23 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3L9TZsJ031213
	for <linux-mips@linux-mips.org>; Mon, 21 Apr 2008 02:29:35 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m3L9UGC0017252;
	Mon, 21 Apr 2008 10:30:16 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m3L9UFVC017243;
	Mon, 21 Apr 2008 10:30:15 +0100
Date:	Mon, 21 Apr 2008 10:30:15 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	linux-mips@linux-mips.org
Subject: Re: [MIPS] Fix handling of trap and breakpoint instructions
Message-ID: <20080421093015.GA26982@linux-mips.org>
References: <S20041689AbYDUAiN/20080421003813Z+6727@ftp.linux-mips.org> <20080421.100721.07644724.nemoto@toshiba-tops.co.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20080421.100721.07644724.nemoto@toshiba-tops.co.jp>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18979
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 420
Lines: 14

On Mon, Apr 21, 2008 at 10:07:21AM +0900, Atsushi Nemoto wrote:

> > Author: Ralf Baechle <ralf@linux-mips.org> Sun Apr 20 16:28:54 2008 +0100
> > Commit: 5881bb0de64887a60f7f49922cf73a3b4d40fc01
> > Gitweb: http://www.linux-mips.org/g/linux/5881bb0d
> > Branch: master
> 
> You must drop left shift of this line too.
> 
> 		if (bcode == (BRK_DIVZERO << 10))

Sigh, damn code duplication.  Will fix and cleanup.

  Ralf

From mb@bu3sch.de Mon Apr 21 14:49:21 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 21 Apr 2008 14:49:23 +0100 (BST)
Received: from vs166246.vserver.de ([62.75.166.246]:32171 "EHLO
	vs166246.vserver.de") by ftp.linux-mips.org with ESMTP
	id S20028882AbYDUNtV convert rfc822-to-8bit (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 21 Apr 2008 14:49:21 +0100
Received: from t4f38.t.pppool.de ([89.55.79.56] helo=powermac.local)
	by vs166246.vserver.de with esmtpa (Exim 4.63)
	(envelope-from <mb@bu3sch.de>)
	id 1JnwO7-0002Y5-3H; Mon, 21 Apr 2008 13:48:55 +0000
From:	Michael Buesch <mb@bu3sch.de>
To:	Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: mips BCM47XX compile error
Date:	Mon, 21 Apr 2008 15:48:33 +0200
User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405)
Cc:	Adrian Bunk <bunk@kernel.org>,
	"John W. Linville" <linville@tuxdriver.com>,
	Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org,
	linux-kernel@vger.kernel.org
References: <20080420100347.GH1595@cs181133002.pp.htv.fi> <200804201214.46936.mb@bu3sch.de> <20080420224942.GA21009@volta.aurel32.net>
In-Reply-To: <20080420224942.GA21009@volta.aurel32.net>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-15"
Content-Transfer-Encoding: 8BIT
Content-Disposition: inline
Message-Id: <200804211548.33769.mb@bu3sch.de>
Return-Path: <mb@bu3sch.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: 18980
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: mb@bu3sch.de
Precedence: bulk
X-list: linux-mips
Content-Length: 1476
Lines: 36

On Monday 21 April 2008 00:49:42 Aurelien Jarno wrote:
> Michael Buesch a écrit :
> > On Sunday 20 April 2008 12:03:47 Adrian Bunk wrote:
> >> Commit aab547ce0d1493d400b6468c521a0137cd8c1edf
> >> (ssb: Add Gigabit Ethernet driver) causes the following
> >> build error with bcm47xx_defconfig:
> >>
> >> <--  snip  -->
> >>
> >> ...
> >>   LD      .tmp_vmlinux1
> >> arch/mips/pci/built-in.o: In function `pcibios_enable_device':
> >> (.text+0x1f8): undefined reference to `pcibios_plat_dev_init'
> >> arch/mips/pci/built-in.o: In function `pcibios_enable_device':
> >> (.text+0x1f8): relocation truncated to fit: R_MIPS_26 against `pcibios_plat_dev_init'
> >> arch/mips/pci/built-in.o: In function `pcibios_init':
> >> pci.c:(.init.text+0x14c): undefined reference to `pcibios_map_irq'
> >> pci.c:(.init.text+0x158): undefined reference to `pcibios_map_irq'
> >> make[1]: *** [.tmp_vmlinux1] Error 1
> > 
> > Some parts of the new 47xx arch code are not ported, yet.
> 
> It would have been nice at least to warn before breaking a platform.

You know, I intentionally did this, because I'm evil...

> > Somebody should port all the new code from openwrt SVN over to mainline.
> > I don't really have time for that, at the moment, though.
> 
> I gave a quick look at openwrt SVN, and only find 2.6.23 patches. I
> can't find a possible fix among them. Do you have a better pointer?

It's fixed in the plain files that are copied to the build directory.

-- 
Greetings Michael.

From mb@bu3sch.de Mon Apr 21 14:53:15 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 21 Apr 2008 14:53:17 +0100 (BST)
Received: from vs166246.vserver.de ([62.75.166.246]:28591 "EHLO
	vs166246.vserver.de") by ftp.linux-mips.org with ESMTP
	id S20039615AbYDUNxP (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 21 Apr 2008 14:53:15 +0100
Received: from t4f38.t.pppool.de ([89.55.79.56] helo=powermac.local)
	by vs166246.vserver.de with esmtpa (Exim 4.63)
	(envelope-from <mb@bu3sch.de>)
	id 1JnwSE-0004ct-Pw; Mon, 21 Apr 2008 13:53:11 +0000
From:	Michael Buesch <mb@bu3sch.de>
To:	Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [PATCH] BCM47xx: Add platform specific PCI code
Date:	Mon, 21 Apr 2008 15:52:49 +0200
User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405)
Cc:	Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org,
	linux-kernel@vger.kernel.org
References: <20080421075433.GA3966@hall2.aurel32.net>
In-Reply-To: <20080421075433.GA3966@hall2.aurel32.net>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804211552.49884.mb@bu3sch.de>
Return-Path: <mb@bu3sch.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: 18981
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: mb@bu3sch.de
Precedence: bulk
X-list: linux-mips
Content-Length: 3457
Lines: 100

On Monday 21 April 2008 09:54:33 Aurelien Jarno wrote:
> This patch, ported from OpenWRT SVN, defines pcibios_map_irq() and
> pcibios_plat_dev_init() for the BCM47xx platform.


Reviewed-by: Michael Buesch <mb@bu3sch.de>

> It fixes the regression introduced by commit
> aab547ce0d1493d400b6468c521a0137cd8c1edf.
> ---
>  arch/mips/pci/Makefile      |    1 +
>  arch/mips/pci/pci-bcm47xx.c |   58 +++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 59 insertions(+), 0 deletions(-)
>  create mode 100644 arch/mips/pci/pci-bcm47xx.c
> 
> diff --git a/arch/mips/pci/Makefile b/arch/mips/pci/Makefile
> index ed0c076..64ba3fa 100644
> --- a/arch/mips/pci/Makefile
> +++ b/arch/mips/pci/Makefile
> @@ -15,6 +15,7 @@ obj-$(CONFIG_MIPS_TX3927)	+= ops-tx3927.o
>  obj-$(CONFIG_PCI_VR41XX)	+= ops-vr41xx.o pci-vr41xx.o
>  obj-$(CONFIG_NEC_CMBVR4133)	+= fixup-vr4133.o
>  obj-$(CONFIG_MARKEINS)		+= ops-emma2rh.o pci-emma2rh.o fixup-emma2rh.o
> +obj-$(CONFIG_BCM47XX)		+= pci-bcm47xx.o
>  
>  #
>  # These are still pretty much in the old state, watch, go blind.
> diff --git a/arch/mips/pci/pci-bcm47xx.c b/arch/mips/pci/pci-bcm47xx.c
> new file mode 100644
> index 0000000..64ccb4f
> --- /dev/null
> +++ b/arch/mips/pci/pci-bcm47xx.c
> @@ -0,0 +1,58 @@
> +/*
> + *  Copyright (C) 2008 Michael Buesch <mb@bu3sch.de>
> + *  Copyright (C) 2008 Aurelien Jarno <aurelien@aurel32.net>
> + *
> + *  This program is free software; you can redistribute  it and/or modify it
> + *  under  the terms of  the GNU General  Public License as published by the
> + *  Free Software Foundation;  either version 2 of the  License, or (at your
> + *  option) any later version.
> + *
> + *  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/pci.h>
> +#include <linux/ssb/ssb.h>
> +
> +int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
> +{
> +	int res;
> +
> +	res = ssb_pcibios_map_irq(dev, slot, pin);
> +	if (res < 0) {
> +		printk(KERN_ALERT "PCI: Failed to map IRQ of device %s\n",
> +		       dev->dev.bus_id);
> +		return 0;
> +	}
> +	/* IRQ-0 and IRQ-1 are software interrupts. */
> +	WARN_ON((res == 0) || (res == 1));
> +
> +	return res;
> +}
> +
> +int pcibios_plat_dev_init(struct pci_dev *dev)
> +{
> +	int err;
> +
> +	err = ssb_pcibios_plat_dev_init(dev);
> +	if (err) {
> +		printk(KERN_ALERT "PCI: Failed to init device %s\n",
> +		       pci_name(dev));
> +	}
> +
> +	return err;
> +}
> +
> -- 
> 1.5.5
> 
> 



-- 
Greetings Michael.

From ddaney@avtrex.com Mon Apr 21 16:48:06 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 21 Apr 2008 16:48:08 +0100 (BST)
Received: from smtp1.dnsmadeeasy.com ([205.234.170.144]:56209 "EHLO
	smtp1.dnsmadeeasy.com") by ftp.linux-mips.org with ESMTP
	id S20040458AbYDUPsG (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Mon, 21 Apr 2008 16:48:06 +0100
Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id C3CF4318AFC;
	Mon, 21 Apr 2008 15:49:26 +0000 (UTC)
X-Authenticated-Name: js.dnsmadeeasy
X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com
Received: from avtrex.com (unknown [67.116.42.147])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP;
	Mon, 21 Apr 2008 15:49:26 +0000 (UTC)
Received: from dl2.hq2.avtrex.com ([192.168.7.26]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Mon, 21 Apr 2008 08:47:52 -0700
Message-ID: <480CB728.7060402@avtrex.com>
Date:	Mon, 21 Apr 2008 08:47:52 -0700
From:	David Daney <ddaney@avtrex.com>
User-Agent: Thunderbird 2.0.0.12 (X11/20080226)
MIME-Version: 1.0
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [MIPS] Fix handling of trap and breakpoint instructions
References: <S20041689AbYDUAiN/20080421003813Z+6727@ftp.linux-mips.org> <20080421.100721.07644724.nemoto@toshiba-tops.co.jp>
In-Reply-To: <20080421.100721.07644724.nemoto@toshiba-tops.co.jp>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 21 Apr 2008 15:47:52.0947 (UTC) FILETIME=[0F3C0430:01C8A3C7]
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: 18982
X-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: 801
Lines: 22

Atsushi Nemoto wrote:
>> Author: Ralf Baechle <ralf@linux-mips.org> Sun Apr 20 16:28:54 2008 +0100
>> Commit: 5881bb0de64887a60f7f49922cf73a3b4d40fc01
>> Gitweb: http://www.linux-mips.org/g/linux/5881bb0d
>> Branch: master
> 
> You must drop left shift of this line too.
> 
> 		if (bcode == (BRK_DIVZERO << 10))
> 

Note that there has been some confusion about break codes in gas over 
the years.  Ancient versions (I am not sure which) generated different 
break codes than recent versions.

Before changing it make sure that you don't break existing user space code.

One problem (fixed around 2.4.25 or so) was the integer division by zero 
in user space would result in SIGTRAP instead of SIGFPE.   If you change 
the break code handling you should verify that you don't break this.

David Daney

From ralf@linux-mips.org Mon Apr 21 17:12:52 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 21 Apr 2008 17:12:54 +0100 (BST)
Received: from oss.sgi.com ([192.48.170.157]:58804 "EHLO oss.sgi.com")
	by ftp.linux-mips.org with ESMTP id S20040672AbYDUQMv (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 21 Apr 2008 17:12:51 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3LGBrp8001253
	for <linux-mips@linux-mips.org>; Mon, 21 Apr 2008 09:12:00 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m3LGCNMr004515;
	Mon, 21 Apr 2008 17:12:23 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m3LGCLag004501;
	Mon, 21 Apr 2008 17:12:21 +0100
Date:	Mon, 21 Apr 2008 17:12:21 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	David Daney <ddaney@avtrex.com>
Cc:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>, linux-mips@linux-mips.org
Subject: Re: [MIPS] Fix handling of trap and breakpoint instructions
Message-ID: <20080421161221.GA21641@linux-mips.org>
References: <S20041689AbYDUAiN/20080421003813Z+6727@ftp.linux-mips.org> <20080421.100721.07644724.nemoto@toshiba-tops.co.jp> <480CB728.7060402@avtrex.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <480CB728.7060402@avtrex.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18983
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 702
Lines: 16

On Mon, Apr 21, 2008 at 08:47:52AM -0700, David Daney wrote:

> Note that there has been some confusion about break codes in gas over the 
> years.  Ancient versions (I am not sure which) generated different break 
> codes than recent versions.
>
> Before changing it make sure that you don't break existing user space code.
>
> One problem (fixed around 2.4.25 or so) was the integer division by zero in 
> user space would result in SIGTRAP instead of SIGFPE.   If you change the 
> break code handling you should verify that you don't break this.

Not quite correct.  Very old and recent binutils are bug compatible.  It's
middle age gcc which unfortunately fixed the bug creating a bug ;-)

  Ralf

From sshtylyov@ru.mvista.com Mon Apr 21 17:16:48 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 21 Apr 2008 17:16:51 +0100 (BST)
Received: from h155.mvista.com ([63.81.120.155]:20004 "EHLO imap.sh.mvista.com")
	by ftp.linux-mips.org with ESMTP id S20040685AbYDUQQs (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Mon, 21 Apr 2008 17:16:48 +0100
Received: from [192.168.1.234] (unknown [10.150.0.9])
	by imap.sh.mvista.com (Postfix) with ESMTP
	id AA7773EC9; Mon, 21 Apr 2008 09:16:43 -0700 (PDT)
Message-ID: <480CBDC8.9090500@ru.mvista.com>
Date:	Mon, 21 Apr 2008 20:16:08 +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:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	ralf@linux-mips.org, linux-mips@linux-mips.org
Subject: Re: [PATCH 2/2] Pb1200: do register SMC 91C111
References: <200804152226.18762.sshtylyov@ru.mvista.com>
In-Reply-To: <200804152226.18762.sshtylyov@ru.mvista.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18984
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 608
Lines: 16

Hello, I wrote:

> Pb1200 does have SMC 91C111 Ethernet chip on board but the platform code did
> not register it, so one couldn't mount NFS...

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

> ---
> This is definitely a bad place for the board #ifdef's, so I'm going to submit
> a patch moving IDE and 91C111 registration into arch/mips/au1000/pb1200/...

    Err, Ralf, since these 2 patches haven't got merged and haven't got into 
2.6.25 anyway, maybe it makes sense to ignore them, so that I do these change 
along with moving the code into arch/mips/au1000/pb1200/platform.c?

WBR, Sergei

From ddaney@avtrex.com Tue Apr 22 00:21:03 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 22 Apr 2008 00:21:06 +0100 (BST)
Received: from smtp1.dnsmadeeasy.com ([205.234.170.144]:5603 "EHLO
	smtp1.dnsmadeeasy.com") by ftp.linux-mips.org with ESMTP
	id S20042941AbYDUXVD (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 22 Apr 2008 00:21:03 +0100
Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id 93131318CA0;
	Mon, 21 Apr 2008 23:22:30 +0000 (UTC)
X-Authenticated-Name: js.dnsmadeeasy
X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com
Received: from avtrex.com (unknown [67.116.42.147])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP;
	Mon, 21 Apr 2008 23:22:30 +0000 (UTC)
Received: from [192.168.7.54] ([192.168.7.54]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Mon, 21 Apr 2008 16:20:50 -0700
Message-ID: <480D2151.2020701@avtrex.com>
Date:	Mon, 21 Apr 2008 16:20:49 -0700
From:	David Daney <ddaney@avtrex.com>
User-Agent: Thunderbird 1.5.0.12 (X11/20071019)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Cc:	linux-kernel@vger.kernel.org
Subject: [Patch 0/6] MIPS Hardware watchpoint support for gdb.
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 21 Apr 2008 23:20:50.0131 (UTC) FILETIME=[56193230:01C8A406]
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: 18985
X-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: 839
Lines: 23

This series of patches adds hardware watch register support for MIPS to
the kernel.  This is kind of a chicken-and-egg type of problem as you
need gdb support to test it, but you cannot test gdb until the kernel
support is present.  These kernel patches are preliminary and
undoubtedly will need some tweaking.

If you want to test this out, you will need to build a suitable gdb
using the patch here:

http://sourceware.org/ml/gdb-patches/2008-04/msg00439.html

The patches are against current linux-mips.org (commit
096bc9f852d4e782b318218d82181f4b09bac63f)

My main test platform only runs 2.6.15, so I could not fully test them
in the current kernel.  I did test under Qemu, but since it lacks full
watch register support in mips, I could not verify that it really works
there.

Well without further ado, here they come.

David Daney


From ddaney@avtrex.com Tue Apr 22 01:01:19 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 22 Apr 2008 01:01:22 +0100 (BST)
Received: from smtp1.dnsmadeeasy.com ([205.234.170.144]:51383 "EHLO
	smtp1.dnsmadeeasy.com") by ftp.linux-mips.org with ESMTP
	id S20043516AbYDVABT (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 22 Apr 2008 01:01:19 +0100
Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id 4277A318E74;
	Tue, 22 Apr 2008 00:02:46 +0000 (UTC)
X-Authenticated-Name: js.dnsmadeeasy
X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com
Received: from avtrex.com (unknown [67.116.42.147])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP;
	Tue, 22 Apr 2008 00:02:46 +0000 (UTC)
Received: from dl2.hq2.avtrex.com ([192.168.7.26]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Mon, 21 Apr 2008 17:01:04 -0700
Message-ID: <480D2ABF.5000005@avtrex.com>
Date:	Mon, 21 Apr 2008 17:01:03 -0700
From:	David Daney <ddaney@avtrex.com>
User-Agent: Thunderbird 2.0.0.12 (X11/20080226)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Cc:	linux-kernel@vger.kernel.org
Subject: [Patch 1/6] Add HARDWARE_WATCHPOINTS configure option.
References: <480D2151.2020701@avtrex.com>
In-Reply-To: <480D2151.2020701@avtrex.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 22 Apr 2008 00:01:04.0870 (UTC) FILETIME=[F5652060:01C8A40B]
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: 18986
X-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: 810
Lines: 29

This first patch just adds the HARDWARE_WATCHPOINTS option to the
'Kernel type' menu.  If N, the watch register support is disabled.

Signed-off-by: David Daney <ddaney@avtrex.com>
---
 arch/mips/Kconfig |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 8724ed3..98f46f6 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1622,6 +1622,13 @@ config CPU_HAS_SMARTMIPS
 	  you don't know you probably don't have SmartMIPS and should say N
 	  here.
 
+config HARDWARE_WATCHPOINTS
+	bool "Debugger support for hardware watchpoints"
+	depends on (CPU_MIPS32 || CPU_MIPS64)
+	help
+	  Saying yes here allows you to utilize the hardware watchpoint
+	  registers.  Most people should say Y here.
+
 config CPU_HAS_WB
 	bool
 
-- 
1.5.5


From ddaney@avtrex.com Tue Apr 22 01:11:03 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 22 Apr 2008 01:11:06 +0100 (BST)
Received: from smtp1.dnsmadeeasy.com ([205.234.170.144]:24519 "EHLO
	smtp1.dnsmadeeasy.com") by ftp.linux-mips.org with ESMTP
	id S20043626AbYDVALD (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 22 Apr 2008 01:11:03 +0100
Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id 9F468318DAE;
	Tue, 22 Apr 2008 00:12:32 +0000 (UTC)
X-Authenticated-Name: js.dnsmadeeasy
X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com
Received: from avtrex.com (unknown [67.116.42.147])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP;
	Tue, 22 Apr 2008 00:12:32 +0000 (UTC)
Received: from dl2.hq2.avtrex.com ([192.168.7.26]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Mon, 21 Apr 2008 17:10:51 -0700
Message-ID: <480D2D0A.2030705@avtrex.com>
Date:	Mon, 21 Apr 2008 17:10:50 -0700
From:	David Daney <ddaney@avtrex.com>
User-Agent: Thunderbird 2.0.0.12 (X11/20080226)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Cc:	linux-kernel@vger.kernel.org
Subject: [Patch 2/6] Add HARDWARE_WATCHPOINTS definitions and support code.
References: <480D2151.2020701@avtrex.com>
In-Reply-To: <480D2151.2020701@avtrex.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 22 Apr 2008 00:10:51.0663 (UTC) FILETIME=[5326A1F0:01C8A40D]
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: 18987
X-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: 9462
Lines: 341

This patch adds arch/mips/kernel/watch.c which contains support code for
manipulating the watch registers.  It also adds the needed fields to the
thread_struct and thread_info.  The cpu_info structure is augmented to 
contain the characteristics of the watch registers.


Signed-off-by: David Daney <ddaney@avtrex.com>
---
 arch/mips/kernel/Makefile      |    1 +
 arch/mips/kernel/watch.c       |  177 ++++++++++++++++++++++++++++++++++++++++
 include/asm-mips/cpu-info.h    |    5 +
 include/asm-mips/processor.h   |   29 +++++++
 include/asm-mips/thread_info.h |    2 +
 include/asm-mips/watch.h       |   29 +++++++
 6 files changed, 243 insertions(+), 0 deletions(-)
 create mode 100644 arch/mips/kernel/watch.c
 create mode 100644 include/asm-mips/watch.h

diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index 938be3a..5b1e017 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -72,6 +72,7 @@ obj-$(CONFIG_MIPS32_O32)	+= binfmt_elfo32.o scall64-o32.o
 
 obj-$(CONFIG_KGDB)		+= gdb-low.o gdb-stub.o
 obj-$(CONFIG_PROC_FS)		+= proc.o
+obj-$(CONFIG_HARDWARE_WATCHPOINTS) += watch.o
 
 obj-$(CONFIG_64BIT)		+= cpu-bugs64.o
 
diff --git a/arch/mips/kernel/watch.c b/arch/mips/kernel/watch.c
new file mode 100644
index 0000000..6217682
--- /dev/null
+++ b/arch/mips/kernel/watch.c
@@ -0,0 +1,177 @@
+/*
+ * 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) 2008 David Daney
+ */
+
+#include <linux/sched.h>
+
+#include <asm/watch.h>
+
+void mips_install_watch_registers()
+{
+	struct mips32_watch_reg_state *watches = &current->thread.watch.mips32;
+	switch (current_cpu_data.watch_reg_count) {
+	default:
+		BUG();
+	case 8:
+		write_c0_watchlo7(watches->watchlo[7]);
+		/* Write 1 to the I, R, and W bits to clear them. */
+		write_c0_watchhi7(watches->watchhi[7] | 7);
+	case 7:
+		write_c0_watchlo6(watches->watchlo[6]);
+		write_c0_watchhi6(watches->watchhi[6] | 7);
+	case 6:
+		write_c0_watchlo5(watches->watchlo[5]);
+		write_c0_watchhi5(watches->watchhi[5] | 7);
+	case 5:
+		write_c0_watchlo4(watches->watchlo[4]);
+		write_c0_watchhi4(watches->watchhi[4] | 7);
+	case 4:
+		write_c0_watchlo3(watches->watchlo[3]);
+		write_c0_watchhi3(watches->watchhi[3] | 7);
+	case 3:
+		write_c0_watchlo2(watches->watchlo[2]);
+		write_c0_watchhi2(watches->watchhi[2] | 7);
+	case 2:
+		write_c0_watchlo1(watches->watchlo[1]);
+		write_c0_watchhi1(watches->watchhi[1] | 7);
+	case 1:
+		write_c0_watchlo0(watches->watchlo[0]);
+		write_c0_watchhi0(watches->watchhi[0] | 7);
+	}
+}
+
+/*
+ * Read back the watchhi registers so the user space debugger has
+ * access to the I, R, and W bits.
+ */
+void mips_read_watch_registers()
+{
+	struct mips32_watch_reg_state *watches = &current->thread.watch.mips32;
+	switch (current_cpu_data.watch_reg_count) {
+	default:
+		BUG();
+	case 8:
+		watches->watchhi[7] = read_c0_watchhi7();
+	case 7:
+		watches->watchhi[6] = read_c0_watchhi6();
+	case 6:
+		watches->watchhi[5] = read_c0_watchhi5();
+	case 5:
+		watches->watchhi[4] = read_c0_watchhi4();
+	case 4:
+		watches->watchhi[3] = read_c0_watchhi3();
+	case 3:
+		watches->watchhi[2] = read_c0_watchhi2();
+	case 2:
+		watches->watchhi[1] = read_c0_watchhi1();
+	case 1:
+		watches->watchhi[0] = read_c0_watchhi0();
+	}
+}
+
+void mips_clear_watch_registers()
+{
+	switch (current_cpu_data.watch_reg_count) {
+	default:
+		BUG();
+	case 8:
+		write_c0_watchlo7(0);
+	case 7:
+		write_c0_watchlo6(0);
+	case 6:
+		write_c0_watchlo5(0);
+	case 5:
+		write_c0_watchlo4(0);
+	case 4:
+		write_c0_watchlo3(0);
+	case 3:
+		write_c0_watchlo2(0);
+	case 2:
+		write_c0_watchlo1(0);
+	case 1:
+		write_c0_watchlo0(0);
+	}
+}
+
+__init void mips_probe_watch_registers(struct cpuinfo_mips *c)
+{
+	unsigned int t;
+
+	if ((c->options & MIPS_CPU_WATCH) == 0)
+		return;
+	/*
+	 * Check which of the I,R and W bits are supported, then
+	 * disable the register.
+	 */
+	write_c0_watchlo0(7);
+	t = read_c0_watchlo0();
+	write_c0_watchlo0(0);
+	c->watch_reg_irw = t & 7;
+
+	t = read_c0_watchhi0();
+	write_c0_watchhi0(t | 0xff8);
+	t = read_c0_watchhi0();
+	c->watch_reg_count = 1;
+	c->watch_reg_mask = t & 0xff8;
+	if ((t & 0x80000000) == 0)
+		return;
+
+	t = read_c0_watchhi1();
+	write_c0_watchhi1(t | 0xff8);
+	t = read_c0_watchhi1();
+	c->watch_reg_count = 2;
+	/* Calculate the smallest common mask.  */
+	c->watch_reg_mask &= t;
+	if ((t & 0x80000000) == 0)
+		return;
+
+	t = read_c0_watchhi2();
+	write_c0_watchhi2(t | 0xff8);
+	t = read_c0_watchhi2();
+	c->watch_reg_count = 3;
+	c->watch_reg_mask &= t;
+	if ((t & 0x80000000) == 0)
+		return;
+
+	t = read_c0_watchhi3();
+	write_c0_watchhi3(t | 0xff8);
+	t = read_c0_watchhi3();
+	c->watch_reg_count = 4;
+	c->watch_reg_mask &= t;
+	if ((t & 0x80000000) == 0)
+		return;
+
+	t = read_c0_watchhi4();
+	write_c0_watchhi4(t | 0xff8);
+	t = read_c0_watchhi4();
+	c->watch_reg_count = 5;
+	c->watch_reg_mask &= t;
+	if ((t & 0x80000000) == 0)
+		return;
+
+	t = read_c0_watchhi5();
+	write_c0_watchhi5(t | 0xff8);
+	t = read_c0_watchhi5();
+	c->watch_reg_count = 6;
+	c->watch_reg_mask &= t;
+	if ((t & 0x80000000) == 0)
+		return;
+
+	t = read_c0_watchhi6();
+	write_c0_watchhi6(t | 0xff8);
+	t = read_c0_watchhi6();
+	c->watch_reg_count = 7;
+	c->watch_reg_mask &= t;
+	if ((t & 0x80000000) == 0)
+		return;
+
+	t = read_c0_watchhi7();
+	write_c0_watchhi7(t | 0xff8);
+	t = read_c0_watchhi7();
+	c->watch_reg_count = 8;
+	c->watch_reg_mask &= t;
+}
diff --git a/include/asm-mips/cpu-info.h b/include/asm-mips/cpu-info.h
index 0c5a358..7d3a093 100644
--- a/include/asm-mips/cpu-info.h
+++ b/include/asm-mips/cpu-info.h
@@ -49,6 +49,11 @@ struct cpuinfo_mips {
 	unsigned int		fpu_id;
 	unsigned int		cputype;
 	int			isa_level;
+#if defined(CONFIG_HARDWARE_WATCHPOINTS)
+	unsigned int		watch_reg_count;
+	unsigned int		watch_reg_mask;
+	unsigned int		watch_reg_irw;
+#endif
 	int			tlbsize;
 	struct cache_desc	icache;	/* Primary I-cache */
 	struct cache_desc	dcache;	/* Primary D or combined I/D cache */
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h
index 58cbac5..423e04d 100644
--- a/include/asm-mips/processor.h
+++ b/include/asm-mips/processor.h
@@ -105,6 +105,26 @@ struct mips_dsp_state {
 	{0,} \
 }
 
+#ifdef CONFIG_HARDWARE_WATCHPOINTS
+
+#define NUM_WATCH_REGS 8
+
+struct mips32_watch_reg_state {
+	__u32 watchlo[NUM_WATCH_REGS];
+	__u32 watchhi[NUM_WATCH_REGS];
+};
+
+union mips_watch_reg_state {
+	struct mips32_watch_reg_state mips32;
+};
+
+#define INIT_WATCH .watch = {{{0,},},}
+
+#define OPTIONAL_INIT_WATCH INIT_WATCH,
+#else
+#define OPTIONAL_INIT_WATCH
+#endif
+
 typedef struct {
 	unsigned long seg;
 } mm_segment_t;
@@ -137,6 +157,11 @@ struct thread_struct {
 	/* Saved state of the DSP ASE, if available. */
 	struct mips_dsp_state dsp;
 
+#ifdef CONFIG_HARDWARE_WATCHPOINTS
+	/* Saved watch register state, if available. */
+	union mips_watch_reg_state watch;
+#endif
+
 	/* Other stuff associated with the thread. */
 	unsigned long cp0_badvaddr;	/* Last user fault */
 	unsigned long cp0_baduaddr;	/* Last kernel fault accessing USEG */
@@ -193,6 +218,10 @@ struct thread_struct {
 		.dspcontrol	= 0,				\
 	},							\
 	/*							\
+	 * saved watch register stuff				\
+	 */							\
+	OPTIONAL_INIT_WATCH					\
+	/*							\
 	 * Other stuff associated with the process		\
 	 */							\
 	.cp0_badvaddr		= 0,				\
diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h
index b2772df..e31de4b 100644
--- a/include/asm-mips/thread_info.h
+++ b/include/asm-mips/thread_info.h
@@ -122,6 +122,7 @@ register struct thread_info *__current_thread_info __asm__("$28");
 #define TIF_32BIT_REGS		22	/* also implies 16/32 fprs */
 #define TIF_32BIT_ADDR		23	/* 32-bit address space (o32/n32) */
 #define TIF_FPUBOUND		24	/* thread bound to FPU-full CPU set */
+#define TIF_LOAD_WATCH		25	/* If set, load watch registers */
 #define TIF_SYSCALL_TRACE	31	/* syscall trace active */
 
 #define _TIF_SYSCALL_TRACE	(1<<TIF_SYSCALL_TRACE)
@@ -138,6 +139,7 @@ register struct thread_info *__current_thread_info __asm__("$28");
 #define _TIF_32BIT_REGS		(1<<TIF_32BIT_REGS)
 #define _TIF_32BIT_ADDR		(1<<TIF_32BIT_ADDR)
 #define _TIF_FPUBOUND		(1<<TIF_FPUBOUND)
+#define _TIF_LOAD_WATCH		(1<<TIF_LOAD_WATCH)
 
 /* work to do on interrupt/exception return */
 #define _TIF_WORK_MASK		(0x0000ffef & ~_TIF_SECCOMP)
diff --git a/include/asm-mips/watch.h b/include/asm-mips/watch.h
new file mode 100644
index 0000000..72607be
--- /dev/null
+++ b/include/asm-mips/watch.h
@@ -0,0 +1,29 @@
+/*
+ * 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) 2008 David Daney
+ */
+#ifndef _ASM_WATCH_H
+#define _ASM_WATCH_H
+
+#include <asm/mipsregs.h>
+
+#ifdef CONFIG_HARDWARE_WATCHPOINTS
+void mips_install_watch_registers(void);
+void mips_read_watch_registers(void);
+void mips_clear_watch_registers(void);
+void mips_probe_watch_registers(struct cpuinfo_mips *c);
+
+#define __restore_watch() do {						\
+	if (unlikely(current_thread_info()->flags & _TIF_LOAD_WATCH)) {	\
+		mips_install_watch_registers();				\
+	}								\
+} while (0)
+
+#else
+#define __restore_watch() do {} while (0)
+#endif
+
+#endif /* _ASM_WATCH_H */
-- 
1.5.5


From ddaney@avtrex.com Tue Apr 22 01:15:48 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 22 Apr 2008 01:15:50 +0100 (BST)
Received: from smtp1.dnsmadeeasy.com ([205.234.170.144]:46030 "EHLO
	smtp1.dnsmadeeasy.com") by ftp.linux-mips.org with ESMTP
	id S20042904AbYDVAPs (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 22 Apr 2008 01:15:48 +0100
Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id 4EBAD318EAB;
	Tue, 22 Apr 2008 00:17:17 +0000 (UTC)
X-Authenticated-Name: js.dnsmadeeasy
X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com
Received: from avtrex.com (unknown [67.116.42.147])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP;
	Tue, 22 Apr 2008 00:17:17 +0000 (UTC)
Received: from dl2.hq2.avtrex.com ([192.168.7.26]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Mon, 21 Apr 2008 17:15:36 -0700
Message-ID: <480D2E27.1000309@avtrex.com>
Date:	Mon, 21 Apr 2008 17:15:35 -0700
From:	David Daney <ddaney@avtrex.com>
User-Agent: Thunderbird 2.0.0.12 (X11/20080226)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Cc:	linux-kernel@vger.kernel.org
Subject: [Patch 3/6] Probe watch registers and report configuration.
References: <480D2151.2020701@avtrex.com>
In-Reply-To: <480D2151.2020701@avtrex.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 22 Apr 2008 00:15:36.0192 (UTC) FILETIME=[FCBE5000:01C8A40D]
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: 18988
X-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: 1862
Lines: 51

This portion of the patch add probing for the watch registers.  The probing
code is in watch.c, here we add a call to that code.

Also /proc/cpu info is modified to print out the watch register information.

Signed-off-by: David Daney <ddaney@avtrex.com>
---
 arch/mips/kernel/cpu-probe.c |    3 +++
 arch/mips/kernel/proc.c      |   10 ++++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 89c3304..c3308d3 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -678,6 +678,9 @@ static void __cpuinit decode_configs(struct cpuinfo_mips *c)
 static inline void cpu_probe_mips(struct cpuinfo_mips *c)
 {
 	decode_configs(c);
+#if defined(CONFIG_HARDWARE_WATCHPOINTS)
+	mips_probe_watch_registers(c);
+#endif
 	switch (c->processor_id & 0xff00) {
 	case PRID_IMP_4KC:
 		c->cputype = CPU_4KC;
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c
index 36f0653..e2f716c 100644
--- a/arch/mips/kernel/proc.c
+++ b/arch/mips/kernel/proc.c
@@ -50,8 +50,18 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 	seq_printf(m, "tlb_entries\t\t: %d\n", cpu_data[n].tlbsize);
 	seq_printf(m, "extra interrupt vector\t: %s\n",
 	              cpu_has_divec ? "yes" : "no");
+#ifdef CONFIG_HARDWARE_WATCHPOINTS
+	seq_printf(m, "hardware watchpoint\t: %s",
+		   cpu_has_watch ? "yes" : "no\n");
+	if (cpu_has_watch)
+		seq_printf(m, ", count: %d, address mask: 0x%04x, irw mask 0x%02x\n",
+			   cpu_data[n].watch_reg_count,
+			   cpu_data[n].watch_reg_mask,
+			   cpu_data[n].watch_reg_irw);
+#else
 	seq_printf(m, "hardware watchpoint\t: %s\n",
 	              cpu_has_watch ? "yes" : "no");
+#endif
 	seq_printf(m, "ASEs implemented\t:%s%s%s%s%s%s\n",
 		      cpu_has_mips16 ? " mips16" : "",
 		      cpu_has_mdmx ? " mdmx" : "",
-- 
1.5.5


From ddaney@avtrex.com Tue Apr 22 01:21:58 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 22 Apr 2008 01:22:01 +0100 (BST)
Received: from smtp1.dnsmadeeasy.com ([205.234.170.144]:41690 "EHLO
	smtp1.dnsmadeeasy.com") by ftp.linux-mips.org with ESMTP
	id S20043663AbYDVAV6 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 22 Apr 2008 01:21:58 +0100
Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id DEC34318A9B;
	Tue, 22 Apr 2008 00:23:32 +0000 (UTC)
X-Authenticated-Name: js.dnsmadeeasy
X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com
Received: from avtrex.com (unknown [67.116.42.147])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP;
	Tue, 22 Apr 2008 00:23:32 +0000 (UTC)
Received: from dl2.hq2.avtrex.com ([192.168.7.26]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Mon, 21 Apr 2008 17:21:51 -0700
Message-ID: <480D2F9E.4060408@avtrex.com>
Date:	Mon, 21 Apr 2008 17:21:50 -0700
From:	David Daney <ddaney@avtrex.com>
User-Agent: Thunderbird 2.0.0.12 (X11/20080226)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Cc:	linux-kernel@vger.kernel.org
Subject: [Patch 4/6] Watch trap handling for HARDWARE_WATCHPOINTS.
References: <480D2151.2020701@avtrex.com>
In-Reply-To: <480D2151.2020701@avtrex.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 22 Apr 2008 00:21:51.0846 (UTC) FILETIME=[DCA69060:01C8A40E]
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: 18989
X-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: 2257
Lines: 65

In this portion of the patch we hook up the watch trap handler.  When the
trap occurs, we copy the register contents into the thread_struct and 
send SIGTRAP.  If the current thread was not expecting the trap, the
watch register values must have been left over from a different context and
we just clear the registers and return.

Also I turn off the message the prints on each trap, as these traps are now
expected.

Signed-off-by: David Daney <ddaney@avtrex.com>
---
 arch/mips/kernel/genex.S |    4 ++++
 arch/mips/kernel/traps.c |   13 +++++++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index c6ada98..15a9bde 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -416,7 +416,11 @@ NESTED(nmi_handler, PT_SIZE, sp)
 	BUILD_HANDLER tr tr sti silent			/* #13 */
 	BUILD_HANDLER fpe fpe fpe silent		/* #15 */
 	BUILD_HANDLER mdmx mdmx sti silent		/* #22 */
+#ifdef 	CONFIG_HARDWARE_WATCHPOINTS
+	BUILD_HANDLER watch watch sti silent		/* #23 */
+#else
 	BUILD_HANDLER watch watch sti verbose		/* #23 */
+#endif
 	BUILD_HANDLER mcheck mcheck cli verbose		/* #24 */
 	BUILD_HANDLER mt mt sti silent			/* #25 */
 	BUILD_HANDLER dsp dsp sti silent		/* #26 */
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 984c0d0..6a5f3f0 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -887,6 +887,18 @@ asmlinkage void do_mdmx(struct pt_regs *regs)
 
 asmlinkage void do_watch(struct pt_regs *regs)
 {
+#ifdef CONFIG_HARDWARE_WATCHPOINTS
+	/*
+	 * If the current thread has the watch registers loaded, save
+	 * their values and send SIGTRAP.  Otherwise another thread
+	 * left the registers set, clear them and continue.
+	 */
+	if (test_tsk_thread_flag(current, TIF_LOAD_WATCH)) {
+		mips_read_watch_registers();
+		force_sig(SIGTRAP, current);
+	} else
+		mips_clear_watch_registers();
+#else
 	if (board_watchpoint_handler) {
 		(*board_watchpoint_handler)(regs);
 		return;
@@ -899,6 +911,7 @@ asmlinkage void do_watch(struct pt_regs *regs)
 	dump_tlb_all();
 	show_regs(regs);
 	panic("Caught WATCH exception - probably caused by stack overflow.");
+#endif
 }
 
 asmlinkage void do_mcheck(struct pt_regs *regs)
-- 
1.5.5


From ddaney@avtrex.com Tue Apr 22 01:33:15 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 22 Apr 2008 01:33:17 +0100 (BST)
Received: from smtp1.dnsmadeeasy.com ([205.234.170.144]:5357 "EHLO
	smtp1.dnsmadeeasy.com") by ftp.linux-mips.org with ESMTP
	id S20043690AbYDVAdP (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 22 Apr 2008 01:33:15 +0100
Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id 142E7318F62;
	Tue, 22 Apr 2008 00:34:49 +0000 (UTC)
X-Authenticated-Name: js.dnsmadeeasy
X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com
Received: from avtrex.com (unknown [67.116.42.147])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP;
	Tue, 22 Apr 2008 00:34:48 +0000 (UTC)
Received: from dl2.hq2.avtrex.com ([192.168.7.26]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Mon, 21 Apr 2008 17:33:05 -0700
Message-ID: <480D3240.5050106@avtrex.com>
Date:	Mon, 21 Apr 2008 17:33:04 -0700
From:	David Daney <ddaney@avtrex.com>
User-Agent: Thunderbird 2.0.0.12 (X11/20080226)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Cc:	linux-kernel@vger.kernel.org
Subject: [Patch 5/6] Scheduler support for HARDWARE_WATCHPOINTS.
References: <480D2151.2020701@avtrex.com>
In-Reply-To: <480D2151.2020701@avtrex.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 22 Apr 2008 00:33:05.0654 (UTC) FILETIME=[6E458160:01C8A410]
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: 18990
X-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: 1029
Lines: 35

This is the meat of the patch.  Here we install the watch register values when we
schedule a new thread.

The implemtation of __restore_watch() is in asm/watch.h.  In the case where there
are no watch registers to install (the normal case) the overhead is 5 machine
instructions with gcc-3.4.3.

Signed-off-by: David Daney <ddaney@avtrex.com>
---
 include/asm-mips/system.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index a944eda..cd30f83 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -20,6 +20,7 @@
 #include <asm/cmpxchg.h>
 #include <asm/cpu-features.h>
 #include <asm/dsp.h>
+#include <asm/watch.h>
 #include <asm/war.h>
 
 
@@ -76,6 +77,7 @@ do {									\
 		__restore_dsp(current);					\
 	if (cpu_has_userlocal)						\
 		write_c0_userlocal(current_thread_info()->tp_value);	\
+	__restore_watch();						\
 } while (0)
 
 static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
-- 
1.5.5


From ddaney@avtrex.com Tue Apr 22 01:40:21 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 22 Apr 2008 01:40:24 +0100 (BST)
Received: from smtp1.dnsmadeeasy.com ([205.234.170.144]:6536 "EHLO
	smtp1.dnsmadeeasy.com") by ftp.linux-mips.org with ESMTP
	id S20043709AbYDVAkV (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 22 Apr 2008 01:40:21 +0100
Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id BC9B9318C66;
	Tue, 22 Apr 2008 00:41:54 +0000 (UTC)
X-Authenticated-Name: js.dnsmadeeasy
X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com
Received: from avtrex.com (unknown [67.116.42.147])
	by smtp1.dnsmadeeasy.com (Postfix) with ESMTP;
	Tue, 22 Apr 2008 00:41:54 +0000 (UTC)
Received: from dl2.hq2.avtrex.com ([192.168.7.26]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Mon, 21 Apr 2008 17:40:12 -0700
Message-ID: <480D33EB.30808@avtrex.com>
Date:	Mon, 21 Apr 2008 17:40:11 -0700
From:	David Daney <ddaney@avtrex.com>
User-Agent: Thunderbird 2.0.0.12 (X11/20080226)
MIME-Version: 1.0
To:	linux-mips@linux-mips.org
Cc:	linux-kernel@vger.kernel.org
Subject: [Patch 6/6] Ptrace support for HARDWARE_WATCHPOINTS.
References: <480D2151.2020701@avtrex.com>
In-Reply-To: <480D2151.2020701@avtrex.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 22 Apr 2008 00:40:12.0792 (UTC) FILETIME=[6CDD9780:01C8A411]
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: 18991
X-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: 4495
Lines: 160

This is the final part of the patch.  Here we add ptrace support so that
gdb can read and set the watch register values.

We add two new ptrace requests PTRACE_GET_WATCH_REGS, and
PTRACE_SET_WATCH_REGS to access the watch registers.  Since MIPS has more
than one format for watch registers, the data structure is a union, the
first structure member is an enum that tells us which layout is in use.
For this first cut at the patch, I only support mips32 style registers.

Signed-off-by: David Daney <ddaney@avtrex.com>
---
 arch/mips/kernel/ptrace.c |   81 +++++++++++++++++++++++++++++++++++++++++++++
 include/asm-mips/ptrace.h |   23 +++++++++++++
 2 files changed, 104 insertions(+), 0 deletions(-)

diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
index 35234b9..d6dece8 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
@@ -46,7 +46,12 @@
  */
 void ptrace_disable(struct task_struct *child)
 {
+#ifdef CONFIG_HARDWARE_WATCHPOINTS
+	/* Don't load the watchpoint registers for the ex-child. */
+	clear_tsk_thread_flag(child, TIF_LOAD_WATCH);
+#else
 	/* Nothing to do.. */
+#endif
 }
 
 /*
@@ -167,6 +172,72 @@ int ptrace_setfpregs(struct task_struct *child, __u32 __user *data)
 	return 0;
 }
 
+#ifdef CONFIG_HARDWARE_WATCHPOINTS
+int ptrace_get_watch_regs(struct task_struct *child,
+			  struct pt_watch_regs __user *addr)
+{
+	int i;
+
+	if (!cpu_has_watch)
+		return -EIO;
+	if (!access_ok(VERIFY_WRITE, addr, sizeof(struct pt_watch_regs)))
+		return -EIO;
+
+	__put_user (pt_watch_style_mips32, &addr->style);
+	__put_user (current_cpu_data.watch_reg_count, &addr->mips32.num_valid);
+	__put_user (current_cpu_data.watch_reg_mask, &addr->mips32.reg_mask);
+	__put_user (current_cpu_data.watch_reg_irw, &addr->mips32.irw_mask);
+	for (i = 0; i < current_cpu_data.watch_reg_count; i++) {
+		__put_user (child->thread.watch.mips32.watchlo[i],
+			    &addr->mips32.watchlo[i]);
+		__put_user (child->thread.watch.mips32.watchhi[i] & 0xfff,
+			    &addr->mips32.watchhi[i]);
+	}
+
+	return 0;
+}
+
+int ptrace_set_watch_regs(struct task_struct *child,
+			  struct pt_watch_regs __user *addr)
+{
+	int i;
+	int watch_active = 0;
+	unsigned long lt[NUM_WATCH_REGS];
+	unsigned int ht[NUM_WATCH_REGS];
+
+	if (!cpu_has_watch)
+		return -EIO;
+	if (!access_ok(VERIFY_READ, addr, sizeof(struct pt_watch_regs)))
+		return -EIO;
+	/* Check the values. */
+	for (i = 0; i < NUM_WATCH_REGS; i++) {
+		__get_user(lt[i], &addr->mips32.watchlo[i]);
+		if (lt[i] & __UA_LIMIT)
+			return -EINVAL;
+
+		__get_user(ht[i], &addr->mips32.watchhi[i]);
+		if (ht[i] & ~0xff8)
+			return -EINVAL;
+	}
+	/* Install them. */
+	for (i = 0; i < NUM_WATCH_REGS; i++) {
+		if (lt[i] & 7)
+			watch_active = 1;
+		child->thread.watch.mips32.watchlo[i] = lt[i];
+		/* Set the G bit. */
+		child->thread.watch.mips32.watchhi[i] = ht[i] | 0x40000000;
+	}
+
+	if (watch_active)
+		set_tsk_thread_flag(child, TIF_LOAD_WATCH);
+	else
+		clear_tsk_thread_flag(child, TIF_LOAD_WATCH);
+
+	return 0;
+}
+
+#endif
+
 long arch_ptrace(struct task_struct *child, long request, long addr, long data)
 {
 	int ret;
@@ -439,7 +510,17 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
 		ret = put_user(task_thread_info(child)->tp_value,
 				(unsigned long __user *) data);
 		break;
+#ifdef CONFIG_HARDWARE_WATCHPOINTS
+	case PTRACE_GET_WATCH_REGS:
+		ret = ptrace_get_watch_regs(child,
+					(struct pt_watch_regs __user *) addr);
+		break;
 
+	case PTRACE_SET_WATCH_REGS:
+		ret = ptrace_set_watch_regs(child,
+					(struct pt_watch_regs __user *) addr);
+		break;
+#endif
 	default:
 		ret = ptrace_request(child, request, addr, data);
 		break;
diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h
index 786f7e3..8fb1bcc 100644
--- a/include/asm-mips/ptrace.h
+++ b/include/asm-mips/ptrace.h
@@ -71,6 +71,29 @@ struct pt_regs {
 #define PTRACE_POKEDATA_3264	0xc3
 #define PTRACE_GET_THREAD_AREA_3264	0xc4
 
+/* Read and write watchpoint registers.  */
+enum pt_watch_style {
+	pt_watch_style_mips32,
+	pt_watch_style_mips64
+};
+struct mips32_watch_regs {
+	unsigned int num_valid;
+	unsigned int reg_mask;
+	unsigned int irw_mask;
+	unsigned long watchlo[8];
+	unsigned int watchhi[8];
+};
+
+struct pt_watch_regs {
+	enum pt_watch_style style;
+	union {
+		struct mips32_watch_regs mips32;
+	};
+};
+
+#define PTRACE_GET_WATCH_REGS	0xd0
+#define PTRACE_SET_WATCH_REGS	0xd1
+
 #ifdef __KERNEL__
 
 #include <linux/linkage.h>
-- 
1.5.5


From anemo@mba.ocn.ne.jp Tue Apr 22 15:58:41 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 22 Apr 2008 15:58:43 +0100 (BST)
Received: from mba.ocn.ne.jp ([122.1.235.107]:9209 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S28578514AbYDVO6l (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 22 Apr 2008 15:58:41 +0100
Received: from localhost (p7186-ipad207funabasi.chiba.ocn.ne.jp [222.145.89.186])
	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP
	id 78A1AC1DA; Tue, 22 Apr 2008 23:58:30 +0900 (JST)
Date:	Tue, 22 Apr 2008 23:59:30 +0900 (JST)
Message-Id: <20080422.235930.75184305.anemo@mba.ocn.ne.jp>
To:	linux-mips@linux-mips.org
Cc:	ralf@linux-mips.org
Subject: [PATCH] rbtx4938: minor cleanup
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 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18992
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 1003
Lines: 29

* Do not initialize res->parent for platform device.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
Patch against linux-queue tree.

 arch/mips/tx4938/toshiba_rbtx4938/setup.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/mips/tx4938/toshiba_rbtx4938/setup.c b/arch/mips/tx4938/toshiba_rbtx4938/setup.c
index 2fbf7d4..3a3659e 100644
--- a/arch/mips/tx4938/toshiba_rbtx4938/setup.c
+++ b/arch/mips/tx4938/toshiba_rbtx4938/setup.c
@@ -1026,7 +1026,6 @@ static void __init txx9_spi_init(unsigned long base, int irq)
 			.start	= base,
 			.end	= base + 0x20 - 1,
 			.flags	= IORESOURCE_MEM,
-			.parent	= &tx4938_reg_resource,
 		}, {
 			.start	= irq,
 			.flags	= IORESOURCE_IRQ,
@@ -1078,7 +1077,6 @@ static int __init txx9_wdt_init(unsigned long base)
 		.start	= base,
 		.end	= base + 0x100 - 1,
 		.flags	= IORESOURCE_MEM,
-		.parent	= &tx4938_reg_resource,
 	};
 	struct platform_device *dev =
 		platform_device_register_simple("txx9wdt", -1, &res, 1);

From drow@false.org Tue Apr 22 17:23:49 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 22 Apr 2008 17:23:51 +0100 (BST)
Received: from NaN.false.org ([208.75.86.248]:42962 "EHLO nan.false.org")
	by ftp.linux-mips.org with ESMTP id S28578959AbYDVQXt (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 22 Apr 2008 17:23:49 +0100
Received: from nan.false.org (localhost [127.0.0.1])
	by nan.false.org (Postfix) with ESMTP id 744D4983DB;
	Tue, 22 Apr 2008 16:23:44 +0000 (GMT)
Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55])
	by nan.false.org (Postfix) with ESMTP id 39E9398060;
	Tue, 22 Apr 2008 16:23:44 +0000 (GMT)
Received: from drow by caradoc.them.org with local (Exim 4.69)
	(envelope-from <drow@caradoc.them.org>)
	id 1JoLHT-00040t-EI; Tue, 22 Apr 2008 12:23:43 -0400
Date:	Tue, 22 Apr 2008 12:23:43 -0400
From:	Daniel Jacobowitz <dan@debian.org>
To:	David Daney <ddaney@avtrex.com>
Cc:	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [Patch 6/6] Ptrace support for HARDWARE_WATCHPOINTS.
Message-ID: <20080422162343.GA14790@caradoc.them.org>
Mail-Followup-To: David Daney <ddaney@avtrex.com>,
	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
References: <480D2151.2020701@avtrex.com> <480D33EB.30808@avtrex.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <480D33EB.30808@avtrex.com>
User-Agent: Mutt/1.5.17 (2007-12-11)
Return-Path: <drow@false.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18993
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dan@debian.org
Precedence: bulk
X-list: linux-mips
Content-Length: 439
Lines: 16

On Mon, Apr 21, 2008 at 05:40:11PM -0700, David Daney wrote:
> +struct mips32_watch_regs {
> +	unsigned int num_valid;
> +	unsigned int reg_mask;
> +	unsigned int irw_mask;
> +	unsigned long watchlo[8];
> +	unsigned int watchhi[8];
> +};

Please do not use long in new ptrace interfaces.  Use either
uint32_t or uint64_t as appropriate so that it doesn't depend
on how the kernel or debugger was built.

-- 
Daniel Jacobowitz
CodeSourcery

From macro@linux-mips.org Tue Apr 22 19:27:41 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 22 Apr 2008 19:27:44 +0100 (BST)
Received: from kirk.serum.com.pl ([213.77.9.205]:33779 "EHLO serum.com.pl")
	by ftp.linux-mips.org with ESMTP id S28579898AbYDVS1l (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 22 Apr 2008 19:27:41 +0100
Received: from serum.com.pl (IDENT:macro@localhost [127.0.0.1])
	by serum.com.pl (8.12.11/8.12.11) with ESMTP id m3MIRBQk026383;
	Tue, 22 Apr 2008 20:27:11 +0200
Received: from localhost (macro@localhost)
	by serum.com.pl (8.12.11/8.12.11/Submit) with ESMTP id m3MIQs2K026379;
	Tue, 22 Apr 2008 19:27:03 +0100
Date:	Tue, 22 Apr 2008 19:26:54 +0100 (BST)
From:	"Maciej W. Rozycki" <macro@linux-mips.org>
To:	Daniel Jacobowitz <dan@debian.org>
cc:	David Daney <ddaney@avtrex.com>, linux-mips@linux-mips.org,
	linux-kernel@vger.kernel.org
Subject: Re: [Patch 6/6] Ptrace support for HARDWARE_WATCHPOINTS.
In-Reply-To: <20080422162343.GA14790@caradoc.them.org>
Message-ID: <Pine.LNX.4.55.0804221923010.23679@cliff.in.clinika.pl>
References: <480D2151.2020701@avtrex.com> <480D33EB.30808@avtrex.com>
 <20080422162343.GA14790@caradoc.them.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Return-Path: <macro@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18994
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: macro@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 650
Lines: 20

On Tue, 22 Apr 2008, Daniel Jacobowitz wrote:

> On Mon, Apr 21, 2008 at 05:40:11PM -0700, David Daney wrote:
> > +struct mips32_watch_regs {
> > +	unsigned int num_valid;
> > +	unsigned int reg_mask;
> > +	unsigned int irw_mask;
> > +	unsigned long watchlo[8];
> > +	unsigned int watchhi[8];
> > +};
> 
> Please do not use long in new ptrace interfaces.  Use either
> uint32_t or uint64_t as appropriate so that it doesn't depend
> on how the kernel or debugger was built.

 A minor nit from my side too -- since it is a new API it may be wise to
move wider structure members to the beginning not to waste gaps in memory
due to alignment.

  Maciej

From sshtylyov@ru.mvista.com Tue Apr 22 20:29:35 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 22 Apr 2008 20:29:37 +0100 (BST)
Received: from rtsoft3.corbina.net ([85.21.88.6]:63574 "EHLO
	buildserver.ru.mvista.com") by ftp.linux-mips.org with ESMTP
	id S20045096AbYDVT3e (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 22 Apr 2008 20:29:34 +0100
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id 8E9088815; Wed, 23 Apr 2008 00:29:32 +0500 (SAMST)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	ralf@linux-mips.org
Subject: Alchemy: kill unused PCI_IRQ_TABLE_LOOKUP macro
Date:	Tue, 22 Apr 2008 23:28:57 +0400
User-Agent: KMail/1.5
Cc:	linux-mips@linux-mips.org
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804222328.57098.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18995
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1181
Lines: 32

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

---
 include/asm-mips/mach-au1x00/au1000.h |   14 --------------
 1 files changed, 14 deletions(-)

Index: linux-2.6/include/asm-mips/mach-au1x00/au1000.h
===================================================================
--- linux-2.6.orig/include/asm-mips/mach-au1x00/au1000.h
+++ linux-2.6/include/asm-mips/mach-au1x00/au1000.h
@@ -1685,20 +1685,6 @@ enum soc_au1200_ints {
 #define IOMEM_RESOURCE_START  0x10000000
 #define IOMEM_RESOURCE_END    0xffffffff
 
-  /*
-   * Borrowed from the PPC arch:
-   * The following macro is used to lookup irqs in a standard table
-   * format for those PPC systems that do not already have PCI
-   * interrupts properly routed.
-   */
-  /* FIXME - double check this from asm-ppc/pci-bridge.h */
-#define PCI_IRQ_TABLE_LOOKUP                            \
-  ({ long _ctl_ = -1;                                 \
-      if (idsel >= min_idsel && idsel <= max_idsel && pin <= irqs_per_slot)    \
-	       _ctl_ = pci_irq_table[idsel - min_idsel][pin-1];               \
-		      _ctl_; })
-
-
 #else /* Au1000 and Au1100 and Au1200 */
 
 /* don't allow any legacy ports probing */


From rzo2b7m1uh@gmail.com Tue Apr 22 22:56:59 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 22 Apr 2008 22:57:01 +0100 (BST)
Received: from po-out-1718.google.com ([72.14.252.159]:31252 "EHLO
	po-out-1718.google.com") by ftp.linux-mips.org with ESMTP
	id S28580657AbYDVV47 (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Tue, 22 Apr 2008 22:56:59 +0100
Received: by po-out-1718.google.com with SMTP id y22so3738755pof.4
        for <linux-mips@linux-mips.org>; Tue, 22 Apr 2008 14:56:55 -0700 (PDT)
DKIM-Signature:	v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition;
        bh=Mst0dGHjSFY2OAmV5Ct1HhKRXNi1QdYKlvNOpgEK1tM=;
        b=UYjGGPS7OY1JqeZVoUVVwqcymoJkfVGepGZvOLtB58xM8dZXwTYUN1AXnFVrGy10u5fn0ODfDMVIWu3Qx7LdMhy6/G5ELzq8BIz6oFyeEO8uuSW58kEA9cQDx670GN58F9hSTTRiN/jr4Bd7QH84EjHjK17ABKejQbk5NFe0rzs=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition;
        b=Rigwrm8aW6EzVp1ROYJl4/4hkm4rokY3LLqAEdusdH9hzdLjfWtiFLAzOTp9YGQxZlx91NttyXzlIKVczUsIiE+PcG2vdt1Tk3m4dhETQiqiQgoLTXxMiRzMexBwKgi1Vxn6N0VfPrXVoaIEOirKyYGb6I1xUlZaBlFV6BteVqc=
Received: by 10.141.71.8 with SMTP id y8mr105037rvk.63.1208901414678;
        Tue, 22 Apr 2008 14:56:54 -0700 (PDT)
Received: by 10.140.158.7 with HTTP; Tue, 22 Apr 2008 14:56:52 -0700 (PDT)
Message-ID: <5a802f680804221456g107d2044ve0f0e4ee1499875b@mail.gmail.com>
Date:	Wed, 23 Apr 2008 05:56:52 +0800
From:	"=?BIG5?B?qkyqbLTy?=" <rzo2b7m1uh@gmail.com>
To:	twesamedm1@gmail.com
Subject: =?BIG5?B?MjAwOC80LzIzIC0gNTo1Ng==?= =?BIG5?B?OjQxIKRz4L6s7KfeuvSttrNdrXAgzNOpR6HP?=
MIME-Version: 1.0
Content-Type: text/plain; charset=BIG5
Content-Transfer-Encoding: base64
Content-Disposition: inline
Return-Path: <rzo2b7m1uh@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: 18996
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: rzo2b7m1uh@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 531
Lines: 7

MjAwOC00LTIzICAtICA1OjU2Cgqkc+C+rOyn3rr0rbazXa1wCgqn2q3MqrqpdqauoUeryKThqrqo
Q6O4pfOkcKjGsaGhQbOjrE+kc+C+qrqkaqjGsaEKCqfarcyye6ZiscClWKX4t36nzrZIuvSvuKVd
p3SrZaV4uvSttqz8pHUrq+GleLresnq1e6ahCgqtra7Jra22cbFNrte7+aV1rW4kMjQsOTAwICAo
pmKwZaO4pn4xMDBNQqSjra2sebZxuvSvuKrFtqEpCgqn2q3MsLWquqSjpXWsT7r0r7ihQabTrE+x
eqX4t36quqRKpGYKCqO4rdOmbqq6pfi3frr0r7i46q7Gp1muyafzt3OqurN0q9esT6vcrautbqq6
Cgql+Ld+ou2kxrCqq3696LnOtqShQaW0s3mxeqq6uvS49Kr5rbEKCr/vvtykc+C+pqi0TrF6qrq5
2rdRCgrFd6rvqNO5cayiuN+2wLFNrfuhRzA5ODAxMTk4MTIKCjVZMFZGNGc2bWlXNwo=

From ralf@linux-mips.org Wed Apr 23 00:14:07 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 23 Apr 2008 00:14:09 +0100 (BST)
Received: from oss.sgi.com ([192.48.170.157]:41103 "EHLO oss.sgi.com")
	by ftp.linux-mips.org with ESMTP id S28581317AbYDVXOH (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 23 Apr 2008 00:14:07 +0100
Received: from dl5rb.ham-radio-op.net (localhost [127.0.0.1])
	by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m3MNDID4022227
	for <linux-mips@linux-mips.org>; Tue, 22 Apr 2008 16:13:19 -0700
Received: from denk.linux-mips.net (denk.linux-mips.net [127.0.0.1])
	by dl5rb.ham-radio-op.net (8.14.1/8.13.8) with ESMTP id m3MNE0lO031358;
	Wed, 23 Apr 2008 00:14:00 +0100
Received: (from ralf@localhost)
	by denk.linux-mips.net (8.14.1/8.14.1/Submit) id m3MNDxGL031351;
	Wed, 23 Apr 2008 00:13:59 +0100
Date:	Wed, 23 Apr 2008 00:13:59 +0100
From:	Ralf Baechle <ralf@linux-mips.org>
To:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc:	linux-mips@linux-mips.org
Subject: Re: Alchemy: kill unused PCI_IRQ_TABLE_LOOKUP macro
Message-ID: <20080422231359.GC27728@linux-mips.org>
References: <200804222328.57098.sshtylyov@ru.mvista.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200804222328.57098.sshtylyov@ru.mvista.com>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com
X-Virus-Status:	Clean
Return-Path: <ralf@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18997
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ralf@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 151
Lines: 7

On Tue, Apr 22, 2008 at 11:28:57PM +0400, Sergei Shtylyov wrote:

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

Thanks, applied.

  Ralf

From yoichi_yuasa@tripeaks.co.jp Wed Apr 23 00:53:15 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 23 Apr 2008 00:53:17 +0100 (BST)
Received: from mo31.po.2iij.net ([210.128.50.54]:35605 "EHLO mo31.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S28581543AbYDVXxP (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 23 Apr 2008 00:53:15 +0100
Received: by mo.po.2iij.net (mo31) id m3MNrA9G081994; Wed, 23 Apr 2008 08:53:10 +0900 (JST)
Received: from rally.tripeaks.co.jp (65.126.232.202.bf.2iij.net [202.232.126.65])
	by mbox.po.2iij.net (po-mbox304) id m3MNr76b023230
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Wed, 23 Apr 2008 08:53:08 +0900
Date:	Wed, 23 Apr 2008 08:51:40 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	yoichi_yuasa@tripeaks.co.jp, linux-mips <linux-mips@linux-mips.org>
Subject: [PATCH 1/2] [MIPS] add DECstation I/O ASIC clocksource
Message-Id: <20080423085140.a693b2e5.yoichi_yuasa@tripeaks.co.jp>
Organization: TriPeaks Corporation
X-Mailer: Sylpheed version 2.3.0beta5 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yoichi_yuasa@tripeaks.co.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18998
X-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: 4188
Lines: 107

add DECstation I/O ASIC clocksource

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

diff -pruN -X /home/yuasa/Memo/dontdiff mips-queue-orig/arch/mips/Kconfig mips-queue/arch/mips/Kconfig
--- mips-queue-orig/arch/mips/Kconfig	2008-04-22 23:13:37.099040014 +0900
+++ mips-queue/arch/mips/Kconfig	2008-04-22 23:13:21.770166469 +0900
@@ -82,6 +82,7 @@ config MACH_DECSTATION
 	bool "DECstations"
 	select BOOT_ELF32
 	select CEVT_R4K
+	select CSRC_IOASIC
 	select CSRC_R4K
 	select CPU_DADDI_WORKAROUNDS if 64BIT
 	select CPU_R4000_WORKAROUNDS if 64BIT
@@ -783,6 +784,9 @@ config CEVT_TXX9
 config CSRC_BCM1480
 	bool
 
+config CSRC_IOASIC
+	bool
+
 config CSRC_R4K
 	bool
 
diff -pruN -X /home/yuasa/Memo/dontdiff mips-queue-orig/arch/mips/dec/time.c mips-queue/arch/mips/dec/time.c
--- mips-queue-orig/arch/mips/dec/time.c	2008-04-22 23:13:37.231047535 +0900
+++ mips-queue/arch/mips/dec/time.c	2008-04-22 23:13:21.770166469 +0900
@@ -165,7 +165,7 @@ void __init plat_time_init(void)
 
 	if (!cpu_has_counter && IOASIC)
 		/* For pre-R4k systems we use the I/O ASIC's counter.  */
-		clocksource_mips.read = dec_ioasic_hpt_read;
+		dec_ioasic_clocksource_init();
 
 	/* Set up the rate of periodic DS1287 interrupts.  */
 	CMOS_WRITE(RTC_REF_CLCK_32KHZ | (16 - __ffs(HZ)), RTC_REG_A);
diff -pruN -X /home/yuasa/Memo/dontdiff mips-queue-orig/arch/mips/kernel/Makefile mips-queue/arch/mips/kernel/Makefile
--- mips-queue-orig/arch/mips/kernel/Makefile	2008-04-22 23:13:37.239047990 +0900
+++ mips-queue/arch/mips/kernel/Makefile	2008-04-22 23:13:21.774166698 +0900
@@ -14,6 +14,7 @@ obj-$(CONFIG_CEVT_GT641XX)	+= cevt-gt641
 obj-$(CONFIG_CEVT_SB1250)	+= cevt-sb1250.o
 obj-$(CONFIG_CEVT_TXX9)		+= cevt-txx9.o
 obj-$(CONFIG_CSRC_BCM1480)	+= csrc-bcm1480.o
+obj-$(CONFIG_CSRC_IOASIC)	+= csrc-ioasic.o
 obj-$(CONFIG_CSRC_R4K)		+= csrc-r4k.o
 obj-$(CONFIG_CSRC_SB1250)	+= csrc-sb1250.o
 obj-$(CONFIG_SYNC_R4K)		+= sync-r4k.o
diff -pruN -X /home/yuasa/Memo/dontdiff mips-queue-orig/arch/mips/kernel/csrc-ioasic.c mips-queue/arch/mips/kernel/csrc-ioasic.c
--- mips-queue-orig/arch/mips/kernel/csrc-ioasic.c	1970-01-01 09:00:00.000000000 +0900
+++ mips-queue/arch/mips/kernel/csrc-ioasic.c	2008-04-22 23:13:21.774166698 +0900
@@ -0,0 +1,45 @@
+/*
+ *  DEC I/O ASIC's counter clocksource
+ *
+ *  Copyright (C) 2008  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#include <linux/clocksource.h>
+#include <linux/init.h>
+
+#include <asm/time.h>
+#include <asm/dec/ioasic.h>
+#include <asm/dec/ioasic_addrs.h>
+
+static cycle_t dec_ioasic_hpt_read(void)
+{
+	return ioasic_read(IO_REG_FCTR);
+}
+
+static struct clocksource clocksource_dec = {
+	.name		= "dec-ioasic",
+	.read		= dec_ioasic_hpt_read,
+	.mask		= CLOCKSOURCE_MASK(32),
+	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
+};
+
+void __init dec_ioasic_clocksource_init(void)
+{
+	clocksource_dec.rating = 200;
+	clocksource_set_clock(&clocksource_dec, 25000000);
+
+	clocksource_register(&clocksource_dec);
+}
diff -pruN -X /home/yuasa/Memo/dontdiff mips-queue-orig/include/asm-mips/dec/ioasic.h mips-queue/include/asm-mips/dec/ioasic.h
--- mips-queue-orig/include/asm-mips/dec/ioasic.h	2008-04-22 23:13:58.672269400 +0900
+++ mips-queue/include/asm-mips/dec/ioasic.h	2008-04-22 23:13:21.774166698 +0900
@@ -33,4 +33,6 @@ static inline u32 ioasic_read(unsigned i
 
 extern void init_ioasic_irqs(int base);
 
+extern void dec_ioasic_clocksource_init(void);
+
 #endif /* __ASM_DEC_IOASIC_H */

From yoichi_yuasa@tripeaks.co.jp Wed Apr 23 00:53:33 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 23 Apr 2008 00:53:35 +0100 (BST)
Received: from mo30.po.2iij.NET ([210.128.50.53]:11540 "EHLO mo30.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S28581544AbYDVXxQ (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 23 Apr 2008 00:53:16 +0100
Received: by mo.po.2iij.net (mo30) id m3MNrC2j032759; Wed, 23 Apr 2008 08:53:12 +0900 (JST)
Received: from rally.tripeaks.co.jp (65.126.232.202.bf.2iij.net [202.232.126.65])
	by mbox.po.2iij.net (po-mbox303) id m3MNr8m4025538
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Wed, 23 Apr 2008 08:53:08 +0900
Message-Id: <200804222353.m3MNr8m4025538@po-mbox303.hop.2iij.net>
Date:	Wed, 23 Apr 2008 08:52:45 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Ralf Baechle <ralf@linux-mips.org>
Cc:	yoichi_yuasa@tripeaks.co.jp, linux-mips <linux-mips@linux-mips.org>
Subject: [PATCH 2/2] [MIPS] add DECstation DS1287 clockevent
In-Reply-To: <20080423085140.a693b2e5.yoichi_yuasa@tripeaks.co.jp>
References: <20080423085140.a693b2e5.yoichi_yuasa@tripeaks.co.jp>
Organization: TriPeaks Corporation
X-Mailer: Sylpheed version 2.3.0beta5 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yoichi_yuasa@tripeaks.co.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 18999
X-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: 8602
Lines: 305

add DECstation DS1287 clockevent

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

diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/Kconfig linux/arch/mips/Kconfig
--- linux-orig/arch/mips/Kconfig	2008-04-22 19:01:43.957134178 +0900
+++ linux/arch/mips/Kconfig	2008-04-22 18:03:05.427649422 +0900
@@ -81,6 +81,7 @@ config MIPS_COBALT
 config MACH_DECSTATION
 	bool "DECstations"
 	select BOOT_ELF32
+	select CEVT_DS1287
 	select CEVT_R4K
 	select CSRC_IOASIC
 	select CSRC_R4K
@@ -769,6 +770,9 @@ config BOOT_RAW
 config CEVT_BCM1480
 	bool
 
+config CEVT_DS1287
+	bool
+
 config CEVT_GT641XX
 	bool
 
diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/dec/time.c linux/arch/mips/dec/time.c
--- linux-orig/arch/mips/dec/time.c	2008-04-22 19:01:43.957134178 +0900
+++ linux/arch/mips/dec/time.c	2008-04-22 18:03:05.427649422 +0900
@@ -9,30 +9,16 @@
  *
  */
 #include <linux/bcd.h>
-#include <linux/errno.h>
 #include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/kernel.h>
 #include <linux/mc146818rtc.h>
-#include <linux/mm.h>
-#include <linux/module.h>
 #include <linux/param.h>
-#include <linux/sched.h>
-#include <linux/string.h>
-#include <linux/time.h>
-#include <linux/types.h>
-
-#include <asm/bootinfo.h>
-#include <asm/cpu.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/sections.h>
+
+#include <asm/cpu-features.h>
 #include <asm/time.h>
 
+#include <asm/dec/ds1287.h>
 #include <asm/dec/interrupts.h>
 #include <asm/dec/ioasic.h>
-#include <asm/dec/ioasic_addrs.h>
 #include <asm/dec/machtype.h>
 
 unsigned long read_persistent_clock(void)
@@ -139,42 +125,32 @@ int rtc_mips_set_mmss(unsigned long nowt
 	return retval;
 }
 
-static int dec_timer_state(void)
+void __init plat_time_init(void)
 {
-	return (CMOS_READ(RTC_REG_C) & RTC_PF) != 0;
-}
+	u32 start, end;
+	int i = HZ / 10;
 
-static void dec_timer_ack(void)
-{
-	CMOS_READ(RTC_REG_C);			/* Ack the RTC interrupt.  */
-}
+	/* Set up the rate of periodic DS1287 interrupts. */
+	ds1287_set_base_clock(HZ);
 
-static cycle_t dec_ioasic_hpt_read(void)
-{
-	/*
-	 * The free-running counter is 32-bit which is good for about
-	 * 2 minutes, 50 seconds at possible count rates of up to 25MHz.
-	 */
-	return ioasic_read(IO_REG_FCTR);
-}
+	if (cpu_has_counter) {
+		while (!ds1287_timer_state())
+			;
 
+		start = read_c0_count();
 
-void __init plat_time_init(void)
-{
-	mips_timer_ack = dec_timer_ack;
+		while (i--)
+			while (!ds1287_timer_state())
+				;
+
+		end = read_c0_count();
 
-	if (!cpu_has_counter && IOASIC)
+		mips_hpt_frequency = (end - start) * 10;
+		printk(KERN_INFO "MIPS counter frequency %dHz\n",
+			mips_hpt_frequency);
+	} else if (IOASIC)
 		/* For pre-R4k systems we use the I/O ASIC's counter.  */
 		dec_ioasic_clocksource_init();
 
-	/* Set up the rate of periodic DS1287 interrupts.  */
-	CMOS_WRITE(RTC_REF_CLCK_32KHZ | (16 - __ffs(HZ)), RTC_REG_A);
-}
-
-void __init plat_timer_setup(struct irqaction *irq)
-{
-	setup_irq(dec_interrupt[DEC_IRQ_RTC], irq);
-
-	/* Enable periodic DS1287 interrupts.  */
-	CMOS_WRITE(CMOS_READ(RTC_REG_B) | RTC_PIE, RTC_REG_B);
+	ds1287_clockevent_init(dec_interrupt[DEC_IRQ_RTC]);
 }
diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/kernel/Makefile linux/arch/mips/kernel/Makefile
--- linux-orig/arch/mips/kernel/Makefile	2008-04-22 19:01:43.957134178 +0900
+++ linux/arch/mips/kernel/Makefile	2008-04-22 18:03:05.427649422 +0900
@@ -9,8 +9,9 @@ obj-y		+= cpu-probe.o branch.o entry.o g
 		   time.o topology.o traps.o unaligned.o
 
 obj-$(CONFIG_CEVT_BCM1480)	+= cevt-bcm1480.o
-obj-$(CONFIG_CEVT_R4K)		+= cevt-r4k.o
+obj-$(CONFIG_CEVT_DS1287)	+= cevt-ds1287.o
 obj-$(CONFIG_CEVT_GT641XX)	+= cevt-gt641xx.o
+obj-$(CONFIG_CEVT_R4K)		+= cevt-r4k.o
 obj-$(CONFIG_CEVT_SB1250)	+= cevt-sb1250.o
 obj-$(CONFIG_CEVT_TXX9)		+= cevt-txx9.o
 obj-$(CONFIG_CSRC_BCM1480)	+= csrc-bcm1480.o
diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/kernel/cevt-ds1287.c linux/arch/mips/kernel/cevt-ds1287.c
--- linux-orig/arch/mips/kernel/cevt-ds1287.c	1970-01-01 09:00:00.000000000 +0900
+++ linux/arch/mips/kernel/cevt-ds1287.c	2008-04-22 18:03:05.455637018 +0900
@@ -0,0 +1,132 @@
+/*
+ *  DS1287 clockevent driver
+ *
+ *  Copyright (C) 2008  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#include <linux/clockchips.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/mc146818rtc.h>
+
+#include <asm/time.h>
+
+#include <irq.h>
+
+int ds1287_timer_state(void)
+{
+	return (CMOS_READ(RTC_REG_C) & RTC_PF) != 0;
+}
+
+int ds1287_set_base_clock(unsigned int hz)
+{
+	u8 rate;
+
+	switch (hz) {
+	case 128:
+		rate = 0x9;
+		break;
+	case 256:
+		rate = 0x8;
+		break;
+	case 1024:
+		rate = 0x6;
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	CMOS_WRITE(RTC_REF_CLCK_32KHZ | rate, RTC_REG_A);
+
+	return 0;
+}
+
+static int ds1287_set_next_event(unsigned long delta,
+				 struct clock_event_device *evt)
+{
+	return -EINVAL;
+}
+
+static void ds1287_set_mode(enum clock_event_mode mode,
+			    struct clock_event_device *evt)
+{
+	unsigned long flags;
+	u8 val;
+
+	spin_lock_irqsave(&rtc_lock, flags);
+
+	val = CMOS_READ(RTC_REG_B);
+
+	switch (mode) {
+	case CLOCK_EVT_MODE_PERIODIC:
+		val |= RTC_PIE;
+		break;
+	default:
+		val &= ~RTC_PIE;
+		break;
+	}
+
+	CMOS_WRITE(val, RTC_REG_B);
+
+	spin_unlock_irqrestore(&rtc_lock, flags);
+}
+
+static void ds1287_event_handler(struct clock_event_device *dev)
+{
+}
+
+static struct clock_event_device ds1287_clockevent = {
+	.name		= "ds1287",
+	.features	= CLOCK_EVT_FEAT_PERIODIC,
+	.cpumask	= CPU_MASK_CPU0,
+	.set_next_event	= ds1287_set_next_event,
+	.set_mode	= ds1287_set_mode,
+	.event_handler	= ds1287_event_handler,
+};
+
+static irqreturn_t ds1287_interrupt(int irq, void *dev_id)
+{
+	struct clock_event_device *cd = &ds1287_clockevent;
+
+	/* Ack the RTC interrupt. */
+	CMOS_READ(RTC_REG_C);
+
+	cd->event_handler(cd);
+
+	return IRQ_HANDLED;
+}
+
+static struct irqaction ds1287_irqaction = {
+	.handler	= ds1287_interrupt,
+	.flags		= IRQF_DISABLED | IRQF_PERCPU,
+	.name		= "ds1287",
+};
+
+int __init ds1287_clockevent_init(int irq)
+{
+	struct clock_event_device *cd;
+
+	cd = &ds1287_clockevent;
+	cd->rating = 100;
+	cd->irq = irq;
+	clockevent_set_clock(cd, 32768);
+	cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd);
+	cd->min_delta_ns = clockevent_delta2ns(0x300, cd);
+
+	clockevents_register_device(&ds1287_clockevent);
+
+	return setup_irq(irq, &ds1287_irqaction);
+}
diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/include/asm-mips/dec/ds1287.h linux/include/asm-mips/dec/ds1287.h
--- linux-orig/include/asm-mips/dec/ds1287.h	1970-01-01 09:00:00.000000000 +0900
+++ linux/include/asm-mips/dec/ds1287.h	2008-04-22 18:03:05.455637018 +0900
@@ -0,0 +1,27 @@
+/*
+ *  DS1287 timer functions.
+ *
+ *  Copyright (C) 2008  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#ifndef __ASM_DEC_DS1287_H
+#define __ASM_DEC_DS1287_H
+
+extern int ds1287_timer_state(void);
+extern void ds1287_set_base_clock(unsigned int clock);
+extern int ds1287_clockevent_init(int irq);
+
+#endif

From macro@linux-mips.org Wed Apr 23 01:46:27 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 23 Apr 2008 01:46:30 +0100 (BST)
Received: from kirk.serum.com.pl ([213.77.9.205]:31728 "EHLO serum.com.pl")
	by ftp.linux-mips.org with ESMTP id S28581767AbYDWAq1 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 23 Apr 2008 01:46:27 +0100
Received: from serum.com.pl (IDENT:macro@localhost [127.0.0.1])
	by serum.com.pl (8.12.11/8.12.11) with ESMTP id m3N0kRcS028261;
	Wed, 23 Apr 2008 02:46:27 +0200
Received: from localhost (macro@localhost)
	by serum.com.pl (8.12.11/8.12.11/Submit) with ESMTP id m3N0kH7I028255;
	Wed, 23 Apr 2008 01:46:26 +0100
Date:	Wed, 23 Apr 2008 01:46:16 +0100 (BST)
From:	"Maciej W. Rozycki" <macro@linux-mips.org>
To:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
cc:	Ralf Baechle <ralf@linux-mips.org>,
	linux-mips <linux-mips@linux-mips.org>
Subject: Re: [PATCH 1/2] [MIPS] add DECstation I/O ASIC clocksource
In-Reply-To: <20080423085140.a693b2e5.yoichi_yuasa@tripeaks.co.jp>
Message-ID: <Pine.LNX.4.55.0804230135190.23679@cliff.in.clinika.pl>
References: <20080423085140.a693b2e5.yoichi_yuasa@tripeaks.co.jp>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Return-Path: <macro@linux-mips.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 19000
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: macro@linux-mips.org
Precedence: bulk
X-list: linux-mips
Content-Length: 791
Lines: 23

On Wed, 23 Apr 2008, Yoichi Yuasa wrote:

> add DECstation I/O ASIC clocksource

 Thanks, I will have a look into it; reasonably soon I hope -- I'm
updating my tree right now.  I am quite surprised you care about this 
platform too.

> +void __init dec_ioasic_clocksource_init(void)
> +{
> +	clocksource_dec.rating = 200;
> +	clocksource_set_clock(&clocksource_dec, 25000000);
> +
> +	clocksource_register(&clocksource_dec);
> +}

 This is not true for all systems -- the clock rate is based on the
TURBOchannel clock and it varies across systems.  And some have no counter
in the I/O ASIC at all (it has been added in a later revision of the 
chip), which the old code handled albeit not in the prettiest way (by 
chance actually, as originally I did know of the older revision).

  Maciej

From yoichi_yuasa@tripeaks.co.jp Wed Apr 23 02:46:08 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 23 Apr 2008 02:46:11 +0100 (BST)
Received: from mo32.po.2iij.NET ([210.128.50.17]:15109 "EHLO mo32.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S28581982AbYDWBqI (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 23 Apr 2008 02:46:08 +0100
Received: by mo.po.2iij.net (mo32) id m3N1k41f071052; Wed, 23 Apr 2008 10:46:04 +0900 (JST)
Received: from rally.tripeaks.co.jp (65.126.232.202.bf.2iij.net [202.232.126.65])
	by mbox.po.2iij.net (po-mbox300) id m3N1k3Bw015816
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Wed, 23 Apr 2008 10:46:03 +0900
Message-Id: <200804230146.m3N1k3Bw015816@po-mbox300.hop.2iij.net>
Date:	Wed, 23 Apr 2008 10:46:03 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	"Maciej W. Rozycki" <macro@linux-mips.org>
Cc:	yoichi_yuasa@tripeaks.co.jp, Ralf Baechle <ralf@linux-mips.org>,
	linux-mips <linux-mips@linux-mips.org>
Subject: Re: [PATCH 1/2] [MIPS] add DECstation I/O ASIC clocksource
In-Reply-To: <Pine.LNX.4.55.0804230135190.23679@cliff.in.clinika.pl>
References: <20080423085140.a693b2e5.yoichi_yuasa@tripeaks.co.jp>
	<Pine.LNX.4.55.0804230135190.23679@cliff.in.clinika.pl>
Organization: TriPeaks Corporation
X-Mailer: Sylpheed version 2.3.0beta5 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yoichi_yuasa@tripeaks.co.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 19001
X-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: 1062
Lines: 33

Hi Maciej,

On Wed, 23 Apr 2008 01:46:16 +0100 (BST)
"Maciej W. Rozycki" <macro@linux-mips.org> wrote:

> On Wed, 23 Apr 2008, Yoichi Yuasa wrote:
> 
> > add DECstation I/O ASIC clocksource
> 
>  Thanks, I will have a look into it; reasonably soon I hope -- I'm
> updating my tree right now.  I am quite surprised you care about this 
> platform too.

I'm interested in the little endian systems ;)
 
> > +void __init dec_ioasic_clocksource_init(void)
> > +{
> > +	clocksource_dec.rating = 200;
> > +	clocksource_set_clock(&clocksource_dec, 25000000);
> > +
> > +	clocksource_register(&clocksource_dec);
> > +}
> 
>  This is not true for all systems -- the clock rate is based on the
> TURBOchannel clock and it varies across systems.  And some have no counter
> in the I/O ASIC at all (it has been added in a later revision of the 
> chip), which the old code handled albeit not in the prettiest way (by 
> chance actually, as originally I did know of the older revision).

Hmm, we should measure the clock rate.
OK, I'll update dec-ioasic clocksource.

Yoichi

From anemo@mba.ocn.ne.jp Wed Apr 23 03:55:35 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 23 Apr 2008 03:55:38 +0100 (BST)
Received: from topsns2.toshiba-tops.co.jp ([202.230.225.126]:2783 "EHLO
	topsns2.toshiba-tops.co.jp") by ftp.linux-mips.org with ESMTP
	id S28582162AbYDWCzd (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 23 Apr 2008 03:55:33 +0100
Received: from topsms.toshiba-tops.co.jp by topsns2.toshiba-tops.co.jp
          via smtpd (for [213.58.128.207] [213.58.128.207]) with ESMTP; Wed, 23 Apr 2008 11:55:31 +0900
Received: from topsms.toshiba-tops.co.jp (localhost.localdomain [127.0.0.1])
	by localhost.toshiba-tops.co.jp (Postfix) with ESMTP id 0A7BB478FF;
	Wed, 23 Apr 2008 11:55:29 +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 EB0CB478F5;
	Wed, 23 Apr 2008 11:55:28 +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 m3N2tSAF006761;
	Wed, 23 Apr 2008 11:55:28 +0900 (JST)
	(envelope-from anemo@mba.ocn.ne.jp)
Date:	Wed, 23 Apr 2008 11:55:28 +0900 (JST)
Message-Id: <20080423.115528.59033169.nemoto@toshiba-tops.co.jp>
To:	yoichi_yuasa@tripeaks.co.jp
Cc:	ralf@linux-mips.org, linux-mips@linux-mips.org
Subject: Re: [PATCH 2/2] [MIPS] add DECstation DS1287 clockevent
From:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
In-Reply-To: <200804222353.m3MNr8m4025538@po-mbox303.hop.2iij.net>
References: <20080423085140.a693b2e5.yoichi_yuasa@tripeaks.co.jp>
	<200804222353.m3MNr8m4025538@po-mbox303.hop.2iij.net>
X-Fingerprint: 6ACA 1623 39BD 9A94 9B1A  B746 CA77 FE94 2874 D52F
X-Pgp-Public-Key: http://wwwkeys.pgp.net/pks/lookup?op=get&search=0x2874D52F
X-Mailer: Mew version 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <anemo@mba.ocn.ne.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 19002
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: anemo@mba.ocn.ne.jp
Precedence: bulk
X-list: linux-mips
Content-Length: 1700
Lines: 46

On Wed, 23 Apr 2008 08:52:45 +0900, Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> wrote:
> add DECstation DS1287 clockevent
> 
> Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
...
> --- linux-orig/arch/mips/kernel/Makefile	2008-04-22 19:01:43.957134178 +0900
> +++ linux/arch/mips/kernel/Makefile	2008-04-22 18:03:05.427649422 +0900
> @@ -9,8 +9,9 @@ obj-y		+= cpu-probe.o branch.o entry.o g
>  		   time.o topology.o traps.o unaligned.o
>  
>  obj-$(CONFIG_CEVT_BCM1480)	+= cevt-bcm1480.o
> -obj-$(CONFIG_CEVT_R4K)		+= cevt-r4k.o
> +obj-$(CONFIG_CEVT_DS1287)	+= cevt-ds1287.o
>  obj-$(CONFIG_CEVT_GT641XX)	+= cevt-gt641xx.o
> +obj-$(CONFIG_CEVT_R4K)		+= cevt-r4k.o
>  obj-$(CONFIG_CEVT_SB1250)	+= cevt-sb1250.o
>  obj-$(CONFIG_CEVT_TXX9)		+= cevt-txx9.o
>  obj-$(CONFIG_CSRC_BCM1480)	+= csrc-bcm1480.o

Why CONFIG_CEVT_R4K line was moved?  The order is important?

> --- linux-orig/arch/mips/kernel/cevt-ds1287.c	1970-01-01 09:00:00.000000000 +0900
> +++ linux/arch/mips/kernel/cevt-ds1287.c	2008-04-22 18:03:05.455637018 +0900
...
> +static void ds1287_set_mode(enum clock_event_mode mode,
> +			    struct clock_event_device *evt)
> +{
> +	unsigned long flags;
> +	u8 val;
> +
> +	spin_lock_irqsave(&rtc_lock, flags);

You do not have to use irqsave here, while set_mode is always called
with interrupts disabled.  And for rtc_lock ... I don't know if this
code could be used on SMP :-)

> --- linux-orig/include/asm-mips/dec/ds1287.h	1970-01-01 09:00:00.000000000 +0900
> +++ linux/include/asm-mips/dec/ds1287.h	2008-04-22 18:03:05.455637018 +0900
> @@ -0,0 +1,27 @@
...

I suppose CEVT_DS1287 is not DEC specific one.  If so,
include/asm-mips/ would be better place.

---
Atsushi Nemoto

From yoichi_yuasa@tripeaks.co.jp Wed Apr 23 05:07:40 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 23 Apr 2008 05:07:43 +0100 (BST)
Received: from mo32.po.2iij.NET ([210.128.50.17]:11287 "EHLO mo32.po.2iij.net")
	by ftp.linux-mips.org with ESMTP id S20023463AbYDWEHk (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 23 Apr 2008 05:07:40 +0100
Received: by mo.po.2iij.net (mo32) id m3N47bhV015503; Wed, 23 Apr 2008 13:07:37 +0900 (JST)
Received: from rally.tripeaks.co.jp (65.126.232.202.bf.2iij.net [202.232.126.65])
	by mbox.po.2iij.net (po-mbox304) id m3N47ZvT009775
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Wed, 23 Apr 2008 13:07:36 +0900
Message-Id: <200804230407.m3N47ZvT009775@po-mbox304.hop.2iij.net>
Date:	Wed, 23 Apr 2008 13:07:37 +0900
From:	Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc:	yoichi_yuasa@tripeaks.co.jp, ralf@linux-mips.org,
	linux-mips@linux-mips.org
Subject: Re: [PATCH 2/2] [MIPS] add DECstation DS1287 clockevent
In-Reply-To: <20080423.115528.59033169.nemoto@toshiba-tops.co.jp>
References: <20080423085140.a693b2e5.yoichi_yuasa@tripeaks.co.jp>
	<200804222353.m3MNr8m4025538@po-mbox303.hop.2iij.net>
	<20080423.115528.59033169.nemoto@toshiba-tops.co.jp>
Organization: TriPeaks Corporation
X-Mailer: Sylpheed version 2.3.0beta5 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Return-Path: <yoichi_yuasa@tripeaks.co.jp>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 19003
X-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: 1953
Lines: 57

Hi,

On Wed, 23 Apr 2008 11:55:28 +0900 (JST)
Atsushi Nemoto <anemo@mba.ocn.ne.jp> wrote:

> On Wed, 23 Apr 2008 08:52:45 +0900, Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> wrote:
> > add DECstation DS1287 clockevent
> > 
> > Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
> ...
> > --- linux-orig/arch/mips/kernel/Makefile	2008-04-22 19:01:43.957134178 +0900
> > +++ linux/arch/mips/kernel/Makefile	2008-04-22 18:03:05.427649422 +0900
> > @@ -9,8 +9,9 @@ obj-y		+= cpu-probe.o branch.o entry.o g
> >  		   time.o topology.o traps.o unaligned.o
> >  
> >  obj-$(CONFIG_CEVT_BCM1480)	+= cevt-bcm1480.o
> > -obj-$(CONFIG_CEVT_R4K)		+= cevt-r4k.o
> > +obj-$(CONFIG_CEVT_DS1287)	+= cevt-ds1287.o
> >  obj-$(CONFIG_CEVT_GT641XX)	+= cevt-gt641xx.o
> > +obj-$(CONFIG_CEVT_R4K)		+= cevt-r4k.o
> >  obj-$(CONFIG_CEVT_SB1250)	+= cevt-sb1250.o
> >  obj-$(CONFIG_CEVT_TXX9)		+= cevt-txx9.o
> >  obj-$(CONFIG_CSRC_BCM1480)	+= csrc-bcm1480.o
> 
> Why CONFIG_CEVT_R4K line was moved?  The order is important?

Just sorted.
It's not important.

> 
> > --- linux-orig/arch/mips/kernel/cevt-ds1287.c	1970-01-01 09:00:00.000000000 +0900
> > +++ linux/arch/mips/kernel/cevt-ds1287.c	2008-04-22 18:03:05.455637018 +0900
> ...
> > +static void ds1287_set_mode(enum clock_event_mode mode,
> > +			    struct clock_event_device *evt)
> > +{
> > +	unsigned long flags;
> > +	u8 val;
> > +
> > +	spin_lock_irqsave(&rtc_lock, flags);
> 
> You do not have to use irqsave here, while set_mode is always called
> with interrupts disabled.  And for rtc_lock ... I don't know if this
> code could be used on SMP :-)
> 
> > --- linux-orig/include/asm-mips/dec/ds1287.h	1970-01-01 09:00:00.000000000 +0900
> > +++ linux/include/asm-mips/dec/ds1287.h	2008-04-22 18:03:05.455637018 +0900
> > @@ -0,0 +1,27 @@
> ...
> 
> I suppose CEVT_DS1287 is not DEC specific one.  If so,
> include/asm-mips/ would be better place.

Thank you for your comment.
I'll update this patch.

Yoichi

From bunk@kernel.org Wed Apr 23 16:56:40 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 23 Apr 2008 16:56:42 +0100 (BST)
Received: from smtp4.pp.htv.fi ([213.243.153.38]:62370 "EHLO smtp4.pp.htv.fi")
	by ftp.linux-mips.org with ESMTP id S28584095AbYDWP4k (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 23 Apr 2008 16:56:40 +0100
Received: from cs181133002.pp.htv.fi (cs181133002.pp.htv.fi [82.181.133.2])
	by smtp4.pp.htv.fi (Postfix) with ESMTP id 2EA065BC004;
	Wed, 23 Apr 2008 18:56:39 +0300 (EEST)
Date:	Wed, 23 Apr 2008 18:55:59 +0300
From:	Adrian Bunk <bunk@kernel.org>
To:	ralf@linux-mips.org
Cc:	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: [2.6 patch] asm-mips/mach-ip27/topology.h must #include
	<asm-generic/topology.h>
Message-ID: <20080423155559.GR28933@cs181133002.pp.htv.fi>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
User-Agent: Mutt/1.5.17+20080114 (2008-01-14)
Return-Path: <bunk@kernel.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 19004
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: bunk@kernel.org
Precedence: bulk
X-list: linux-mips
Content-Length: 1892
Lines: 36

This patch fixes the following compile error:

<--  snip  -->

...
  CC      kernel/sched.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/kernel/sched.c: In function 'find_next_best_node':
/home/bunk/linux/kernel-2.6/git/linux-2.6/kernel/sched.c:7015: error: implicit declaration of function 'node_to_cpumask_ptr'
/home/bunk/linux/kernel-2.6/git/linux-2.6/kernel/sched.c:7015: error: '__tmp__' undeclared (first use in this function)
/home/bunk/linux/kernel-2.6/git/linux-2.6/kernel/sched.c:7015: error: (Each undeclared identifier is reported only once
/home/bunk/linux/kernel-2.6/git/linux-2.6/kernel/sched.c:7015: error: for each function it appears in.)
/home/bunk/linux/kernel-2.6/git/linux-2.6/kernel/sched.c: In function 'sched_domain_node_span':
/home/bunk/linux/kernel-2.6/git/linux-2.6/kernel/sched.c:7047: error: 'nodemask' undeclared (first use in this function)
/home/bunk/linux/kernel-2.6/git/linux-2.6/kernel/sched.c:7048: warning: ISO C90 forbids mixed declarations and code
/home/bunk/linux/kernel-2.6/git/linux-2.6/kernel/sched.c:7059: error: implicit declaration of function 'node_to_cpumask_ptr_next'
/home/bunk/linux/kernel-2.6/git/linux-2.6/kernel/sched.c: In function '__build_sched_domains':
/home/bunk/linux/kernel-2.6/git/linux-2.6/kernel/sched.c:7605: error: 'pnodemask' undeclared (first use in this function)
make[2]: *** [kernel/sched.o] Error 1

<--  snip  -->

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---
95146e0f305fd55f05b24d26dd671b5b0a1f657c diff --git a/include/asm-mips/mach-ip27/topology.h b/include/asm-mips/mach-ip27/topology.h
index 372291f..7785bec 100644
--- a/include/asm-mips/mach-ip27/topology.h
+++ b/include/asm-mips/mach-ip27/topology.h
@@ -54,4 +54,6 @@ extern unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES];
 	.nr_balance_failed	= 0,			\
 }
 
+#include <asm-generic/topology.h>
+
 #endif /* _ASM_MACH_TOPOLOGY_H */


From bunk@kernel.org Wed Apr 23 17:06:47 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 23 Apr 2008 17:06:49 +0100 (BST)
Received: from smtp5.pp.htv.fi ([213.243.153.39]:41449 "EHLO smtp5.pp.htv.fi")
	by ftp.linux-mips.org with ESMTP id S28584158AbYDWQGr (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Wed, 23 Apr 2008 17:06:47 +0100
Received: from cs181133002.pp.htv.fi (cs181133002.pp.htv.fi [82.181.133.2])
	by smtp5.pp.htv.fi (Postfix) with ESMTP id DA5F05BC016;
	Wed, 23 Apr 2008 19:06:46 +0300 (EEST)
Date:	Wed, 23 Apr 2008 19:06:07 +0300
From:	Adrian Bunk <bunk@kernel.org>
To:	Roland McGrath <roland@redhat.com>, ralf@linux-mips.org
Cc:	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: mips ptrace compat build error
Message-ID: <20080423160607.GS28933@cs181133002.pp.htv.fi>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
User-Agent: Mutt/1.5.17+20080114 (2008-01-14)
Return-Path: <bunk@kernel.org>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 19005
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: bunk@kernel.org
Precedence: bulk
X-list: linux-mips
Content-Length: 724
Lines: 26

Commit e16b27816462de700f9508d86954410c41105dc2
(ptrace: compat_ptrace_request siginfo) causes
the following build error with CONFIG_COMPAT=y
on mips:

<--  snip   -->

...
  LD      .tmp_vmlinux1
kernel/built-in.o: In function `$L181':
ptrace.c:(.text+0x1d380): undefined reference to `copy_siginfo_from_user32'
ptrace.c:(.text+0x1d380): relocation truncated to fit: R_MIPS_26 against `copy_siginfo_from_user32'
make[1]: *** [.tmp_vmlinux1] Error 1

<--  snip  -->

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


From sshtylyov@ru.mvista.com Wed Apr 23 19:44:37 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 23 Apr 2008 19:44:40 +0100 (BST)
Received: from rtsoft3.corbina.net ([85.21.88.6]:61026 "EHLO
	buildserver.ru.mvista.com") by ftp.linux-mips.org with ESMTP
	id S28585414AbYDWSoc (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 23 Apr 2008 19:44:32 +0100
Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9])
	by buildserver.ru.mvista.com (Postfix) with ESMTP
	id 5046E8815; Wed, 23 Apr 2008 23:44:31 +0500 (SAMST)
From:	Sergei Shtylyov <sshtylyov@ru.mvista.com>
Organization: MontaVista Software Inc.
To:	ralf@linux-mips.org
Subject: [PATCH] Alchemy: kill useless #include's, #define's and extern's (take 4)
Date:	Wed, 23 Apr 2008 22:43:55 +0400
User-Agent: KMail/1.5
Cc:	linux-mips@linux-mips.org
MIME-Version: 1.0
Content-Disposition: inline
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <200804232243.55944.sshtylyov@ru.mvista.com>
Return-Path: <sshtylyov@ru.mvista.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 19006
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: sshtylyov@ru.mvista.com
Precedence: bulk
X-list: linux-mips
Content-Length: 31699
Lines: 1013

Go thru the Alchemy code and hunt down every unneeded #include, #define, and
extern (some of which refer to already long dead functions).

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

---
Killed an overlooked 'extern' in arch/mips/au1000/common/dbg_io.c...

Please update the queued patch again, probably indeed for the last time. :-)

 arch/mips/au1000/common/cputable.c     |    5 +----
 arch/mips/au1000/common/dbdma.c        |    6 ------
 arch/mips/au1000/common/dbg_io.c       |    2 --
 arch/mips/au1000/common/dma.c          |    5 +----
 arch/mips/au1000/common/gpio.c         |    5 -----
 arch/mips/au1000/common/irq.c          |    1 -
 arch/mips/au1000/common/pci.c          |    2 +-
 arch/mips/au1000/common/platform.c     |    4 +---
 arch/mips/au1000/common/power.c        |    9 +--------
 arch/mips/au1000/common/prom.c         |    2 +-
 arch/mips/au1000/common/puts.c         |    1 -
 arch/mips/au1000/common/reset.c        |    8 +-------
 arch/mips/au1000/common/setup.c        |   11 +----------
 arch/mips/au1000/common/sleeper.S      |    2 +-
 arch/mips/au1000/common/time.c         |    8 --------
 arch/mips/au1000/db1x00/board_setup.c  |   15 ++-------------
 arch/mips/au1000/db1x00/init.c         |    5 -----
 arch/mips/au1000/db1x00/irqmap.c       |   21 ++-------------------
 arch/mips/au1000/mtx-1/board_setup.c   |   14 ++------------
 arch/mips/au1000/mtx-1/init.c          |    6 +-----
 arch/mips/au1000/mtx-1/irqmap.c        |   19 +------------------
 arch/mips/au1000/mtx-1/platform.c      |    1 -
 arch/mips/au1000/pb1000/board_setup.c  |   11 +----------
 arch/mips/au1000/pb1000/init.c         |    6 +-----
 arch/mips/au1000/pb1000/irqmap.c       |   18 +-----------------
 arch/mips/au1000/pb1100/board_setup.c  |   11 +----------
 arch/mips/au1000/pb1100/init.c         |    6 +-----
 arch/mips/au1000/pb1100/irqmap.c       |   19 +------------------
 arch/mips/au1000/pb1200/board_setup.c  |   20 +-------------------
 arch/mips/au1000/pb1200/init.c         |    6 +-----
 arch/mips/au1000/pb1200/irqmap.c       |   20 ++------------------
 arch/mips/au1000/pb1500/board_setup.c  |   11 +----------
 arch/mips/au1000/pb1500/init.c         |    6 +-----
 arch/mips/au1000/pb1500/irqmap.c       |   19 +------------------
 arch/mips/au1000/pb1550/board_setup.c  |   15 ++-------------
 arch/mips/au1000/pb1550/init.c         |    6 +-----
 arch/mips/au1000/pb1550/irqmap.c       |   19 +------------------
 arch/mips/au1000/xxs1500/board_setup.c |   11 +----------
 arch/mips/au1000/xxs1500/init.c        |    6 +-----
 arch/mips/au1000/xxs1500/irqmap.c      |   19 +------------------
 arch/mips/pci/fixup-au1000.c           |    5 +----
 41 files changed, 38 insertions(+), 348 deletions(-)

Index: linux-2.6/arch/mips/au1000/common/cputable.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/cputable.c
+++ linux-2.6/arch/mips/au1000/common/cputable.c
@@ -11,10 +11,7 @@
  *  as published by the Free Software Foundation; either version
  *  2 of the License, or (at your option) any later version.
  */
-#include <linux/string.h>
-#include <linux/sched.h>
-#include <linux/threads.h>
-#include <linux/init.h>
+
 #include <asm/mach-au1x00/au1000.h>
 
 struct cpu_spec* cur_cpu_spec[NR_CPUS];
Index: linux-2.6/arch/mips/au1000/common/dbdma.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/dbdma.c
+++ linux-2.6/arch/mips/au1000/common/dbdma.c
@@ -31,18 +31,12 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
-#include <linux/string.h>
-#include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-au1x00/au1xxx_dbdma.h>
-#include <asm/system.h>
-
 
 #if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
 
Index: linux-2.6/arch/mips/au1000/common/dbg_io.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/dbg_io.c
+++ linux-2.6/arch/mips/au1000/common/dbg_io.c
@@ -1,5 +1,4 @@
 
-#include <asm/io.h>
 #include <asm/mach-au1x00/au1000.h>
 
 #ifdef CONFIG_KGDB
@@ -55,7 +54,6 @@ typedef         unsigned int  uint32;
 #define UART16550_READ(y)    (au_readl(DEBUG_BASE + y) & 0xff)
 #define UART16550_WRITE(y, z) (au_writel(z&0xff, DEBUG_BASE + y))
 
-extern unsigned long get_au1x00_uart_baud_base(void);
 extern unsigned long calc_clock(void);
 
 void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
Index: linux-2.6/arch/mips/au1000/common/dma.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/dma.c
+++ linux-2.6/arch/mips/au1000/common/dma.c
@@ -33,12 +33,9 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
-#include <linux/sched.h>
 #include <linux/spinlock.h>
-#include <linux/string.h>
-#include <linux/delay.h>
 #include <linux/interrupt.h>
-#include <asm/system.h>
+
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-au1x00/au1000_dma.h>
 
Index: linux-2.6/arch/mips/au1000/common/gpio.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/gpio.c
+++ linux-2.6/arch/mips/au1000/common/gpio.c
@@ -27,13 +27,8 @@
  * 	others have a second one : GPIO2
  */
 
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/types.h>
 #include <linux/module.h>
 
-#include <asm/addrspace.h>
-
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/gpio.h>
 
Index: linux-2.6/arch/mips/au1000/common/irq.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/irq.c
+++ linux-2.6/arch/mips/au1000/common/irq.c
@@ -26,7 +26,6 @@
  */
 #include <linux/bitops.h>
 #include <linux/init.h>
-#include <linux/io.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 
Index: linux-2.6/arch/mips/au1000/common/pci.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/pci.c
+++ linux-2.6/arch/mips/au1000/common/pci.c
@@ -30,7 +30,7 @@
  *  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/pci.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
Index: linux-2.6/arch/mips/au1000/common/platform.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/platform.c
+++ linux-2.6/arch/mips/au1000/common/platform.c
@@ -7,11 +7,9 @@
  * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
-#include <linux/device.h>
+
 #include <linux/platform_device.h>
-#include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/resource.h>
 
 #include <asm/mach-au1x00/au1xxx.h>
 
Index: linux-2.6/arch/mips/au1000/common/power.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/power.c
+++ linux-2.6/arch/mips/au1000/common/power.c
@@ -29,17 +29,14 @@
  *  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/pm.h>
 #include <linux/pm_legacy.h>
-#include <linux/slab.h>
 #include <linux/sysctl.h>
 #include <linux/jiffies.h>
 
-#include <asm/string.h>
 #include <asm/uaccess.h>
-#include <asm/io.h>
-#include <asm/system.h>
 #include <asm/cacheflush.h>
 #include <asm/mach-au1x00/au1000.h>
 
@@ -54,10 +51,6 @@
 
 static void au1000_calibrate_delay(void);
 
-extern void set_au1x00_speed(unsigned int new_freq);
-extern unsigned int get_au1x00_speed(void);
-extern unsigned long get_au1x00_uart_baud_base(void);
-extern void set_au1x00_uart_baud_base(unsigned long new_baud_base);
 extern unsigned long save_local_and_disable(int controller);
 extern void restore_local_and_enable(int controller, unsigned long mask);
 extern void local_enable_irq(unsigned int irq_nr);
Index: linux-2.6/arch/mips/au1000/common/prom.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/prom.c
+++ linux-2.6/arch/mips/au1000/common/prom.c
@@ -33,8 +33,8 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/module.h>
-#include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/string.h>
 
Index: linux-2.6/arch/mips/au1000/common/puts.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/puts.c
+++ linux-2.6/arch/mips/au1000/common/puts.c
@@ -28,7 +28,6 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/types.h>
 #include <asm/mach-au1x00/au1000.h>
 
 #define SERIAL_BASE   UART_BASE
Index: linux-2.6/arch/mips/au1000/common/reset.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/reset.c
+++ linux-2.6/arch/mips/au1000/common/reset.c
@@ -27,13 +27,7 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/sched.h>
-#include <linux/mm.h>
-#include <asm/io.h>
-#include <asm/pgtable.h>
-#include <asm/processor.h>
-#include <asm/reboot.h>
-#include <asm/system.h>
+
 #include <asm/mach-au1x00/au1000.h>
 
 extern int au_sleep(void);
Index: linux-2.6/arch/mips/au1000/common/setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/setup.c
+++ linux-2.6/arch/mips/au1000/common/setup.c
@@ -25,21 +25,14 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
 #include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/delay.h>
-#include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/pm.h>
 
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
 #include <asm/mipsregs.h>
 #include <asm/reboot.h>
-#include <asm/pgtable.h>
 #include <asm/time.h>
 
 #include <au1000.h>
@@ -49,8 +42,6 @@ extern void __init board_setup(void);
 extern void au1000_restart(char *);
 extern void au1000_halt(void);
 extern void au1000_power_off(void);
-extern void au1x_time_init(void);
-extern void au1x_timer_setup(struct irqaction *irq);
 extern void set_cpuspec(void);
 
 void __init plat_mem_setup(void)
Index: linux-2.6/arch/mips/au1000/common/sleeper.S
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/sleeper.S
+++ linux-2.6/arch/mips/au1000/common/sleeper.S
@@ -9,9 +9,9 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
  */
+
 #include <asm/asm.h>
 #include <asm/mipsregs.h>
-#include <asm/addrspace.h>
 #include <asm/regdef.h>
 #include <asm/stackframe.h>
 
Index: linux-2.6/arch/mips/au1000/common/time.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/time.c
+++ linux-2.6/arch/mips/au1000/common/time.c
@@ -34,20 +34,12 @@
 
 #include <linux/types.h>
 #include <linux/init.h>
-#include <linux/kernel_stat.h>
-#include <linux/sched.h>
 #include <linux/spinlock.h>
-#include <linux/hardirq.h>
 
-#include <asm/compiler.h>
 #include <asm/mipsregs.h>
 #include <asm/time.h>
-#include <asm/div64.h>
 #include <asm/mach-au1x00/au1000.h>
 
-#include <linux/mc146818rtc.h>
-#include <linux/timex.h>
-
 static int no_au1xxx_32khz;
 extern int allow_au1k_wait; /* default off for CP0 Counter */
 
Index: linux-2.6/arch/mips/au1000/db1x00/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/db1x00/board_setup.c
+++ linux-2.6/arch/mips/au1000/db1x00/board_setup.c
@@ -27,20 +27,9 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
-#include <linux/mc146818rtc.h>
-#include <linux/delay.h>
-
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
+
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-db1x00/db1x00.h>
 
Index: linux-2.6/arch/mips/au1000/db1x00/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/db1x00/init.c
+++ linux-2.6/arch/mips/au1000/db1x00/init.c
@@ -28,13 +28,8 @@
  */
 
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/db1x00/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/db1x00/irqmap.c
+++ linux-2.6/arch/mips/au1000/db1x00/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 #ifdef CONFIG_MIPS_DB1500
Index: linux-2.6/arch/mips/au1000/mtx-1/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/mtx-1/board_setup.c
+++ linux-2.6/arch/mips/au1000/mtx-1/board_setup.c
@@ -28,19 +28,9 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
-#include <linux/delay.h>
-
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
+
 #include <asm/mach-au1x00/au1000.h>
 
 extern int (*board_pci_idsel)(unsigned int devsel, int assert);
Index: linux-2.6/arch/mips/au1000/mtx-1/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/mtx-1/init.c
+++ linux-2.6/arch/mips/au1000/mtx-1/init.c
@@ -28,14 +28,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/string.h>
+
 #include <linux/kernel.h>
-#include <linux/sched.h>
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/bootmem.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/mtx-1/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/mtx-1/irqmap.c
+++ linux-2.6/arch/mips/au1000/mtx-1/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 char irq_tab_alchemy[][5] __initdata = {
Index: linux-2.6/arch/mips/au1000/mtx-1/platform.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/mtx-1/platform.c
+++ linux-2.6/arch/mips/au1000/mtx-1/platform.c
@@ -19,7 +19,6 @@
  */
 
 #include <linux/init.h>
-#include <linux/types.h>
 #include <linux/platform_device.h>
 #include <linux/leds.h>
 #include <linux/gpio_keys.h>
Index: linux-2.6/arch/mips/au1000/pb1000/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1000/board_setup.c
+++ linux-2.6/arch/mips/au1000/pb1000/board_setup.c
@@ -23,19 +23,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
 #include <linux/delay.h>
 
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-pb1x00/pb1000.h>
 
Index: linux-2.6/arch/mips/au1000/pb1000/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1000/init.c
+++ linux-2.6/arch/mips/au1000/pb1000/init.c
@@ -26,14 +26,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/pb1000/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1000/irqmap.c
+++ linux-2.6/arch/mips/au1000/pb1000/irqmap.c
@@ -25,26 +25,10 @@
  *  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/mach-au1x00/au1000.h>
 
 struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
Index: linux-2.6/arch/mips/au1000/pb1100/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1100/board_setup.c
+++ linux-2.6/arch/mips/au1000/pb1100/board_setup.c
@@ -23,19 +23,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
 #include <linux/delay.h>
 
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-pb1x00/pb1100.h>
 
Index: linux-2.6/arch/mips/au1000/pb1100/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1100/init.c
+++ linux-2.6/arch/mips/au1000/pb1100/init.c
@@ -27,14 +27,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/pb1100/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1100/irqmap.c
+++ linux-2.6/arch/mips/au1000/pb1100/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
Index: linux-2.6/arch/mips/au1000/pb1200/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1200/board_setup.c
+++ linux-2.6/arch/mips/au1000/pb1200/board_setup.c
@@ -23,27 +23,11 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
 #include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
-#include <linux/mc146818rtc.h>
-#include <linux/delay.h>
-
-#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
-#include <linux/ide.h>
-#endif
-
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
 
 #include <au1000.h>
-#include <au1xxx_dbdma.h>
 #include <prom.h>
 
 #ifdef CONFIG_MIPS_PB1200
@@ -52,8 +36,6 @@
 
 #ifdef CONFIG_MIPS_DB1200
 #include <asm/mach-db1x00/db1200.h>
-#define PB1200_ETH_INT DB1200_ETH_INT
-#define PB1200_IDE_INT DB1200_IDE_INT
 #endif
 
 extern void _board_init_irq(void);
Index: linux-2.6/arch/mips/au1000/pb1200/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1200/init.c
+++ linux-2.6/arch/mips/au1000/pb1200/init.c
@@ -27,14 +27,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/pb1200/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1200/irqmap.c
+++ linux-2.6/arch/mips/au1000/pb1200/irqmap.c
@@ -22,26 +22,10 @@
  *  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/mach-au1x00/au1000.h>
 
 #ifdef CONFIG_MIPS_PB1200
Index: linux-2.6/arch/mips/au1000/pb1500/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1500/board_setup.c
+++ linux-2.6/arch/mips/au1000/pb1500/board_setup.c
@@ -23,19 +23,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
 #include <linux/delay.h>
 
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-pb1x00/pb1500.h>
 
Index: linux-2.6/arch/mips/au1000/pb1500/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1500/init.c
+++ linux-2.6/arch/mips/au1000/pb1500/init.c
@@ -27,14 +27,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/pb1500/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1500/irqmap.c
+++ linux-2.6/arch/mips/au1000/pb1500/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 char irq_tab_alchemy[][5] __initdata = {
Index: linux-2.6/arch/mips/au1000/pb1550/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1550/board_setup.c
+++ linux-2.6/arch/mips/au1000/pb1550/board_setup.c
@@ -27,20 +27,9 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
-#include <linux/mc146818rtc.h>
-#include <linux/delay.h>
-
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
+
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-pb1x00/pb1550.h>
 
Index: linux-2.6/arch/mips/au1000/pb1550/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1550/init.c
+++ linux-2.6/arch/mips/au1000/pb1550/init.c
@@ -27,14 +27,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/pb1550/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/pb1550/irqmap.c
+++ linux-2.6/arch/mips/au1000/pb1550/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 char irq_tab_alchemy[][5] __initdata = {
Index: linux-2.6/arch/mips/au1000/xxs1500/board_setup.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/xxs1500/board_setup.c
+++ linux-2.6/arch/mips/au1000/xxs1500/board_setup.c
@@ -23,19 +23,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/console.h>
 #include <linux/delay.h>
 
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/mipsregs.h>
-#include <asm/reboot.h>
-#include <asm/pgtable.h>
 #include <asm/mach-au1x00/au1000.h>
 
 void board_reset(void)
Index: linux-2.6/arch/mips/au1000/xxs1500/init.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/xxs1500/init.c
+++ linux-2.6/arch/mips/au1000/xxs1500/init.c
@@ -26,14 +26,10 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
+
 #include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/bootmem.h>
-#include <linux/string.h>
 #include <linux/kernel.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 #include <prom.h>
Index: linux-2.6/arch/mips/au1000/xxs1500/irqmap.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/xxs1500/irqmap.c
+++ linux-2.6/arch/mips/au1000/xxs1500/irqmap.c
@@ -25,26 +25,9 @@
  *  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/mach-au1x00/au1000.h>
 
 struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
Index: linux-2.6/arch/mips/pci/fixup-au1000.c
===================================================================
--- linux-2.6.orig/arch/mips/pci/fixup-au1000.c
+++ linux-2.6/arch/mips/pci/fixup-au1000.c
@@ -26,13 +26,10 @@
  *  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/pci.h>
-#include <linux/kernel.h>
 #include <linux/init.h>
 
-#include <asm/mach-au1x00/au1000.h>
-
 extern char irq_tab_alchemy[][5];
 
 int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)


From dmitri.vorobiev@gmail.com Wed Apr 23 19:45:03 2008
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 23 Apr 2008 19:45:06 +0100 (BST)
Received: from fg-out-1718.google.com ([72.14.220.158]:2585 "EHLO
	fg-out-1718.google.com") by ftp.linux-mips.org with ESMTP
	id S28585429AbYDWSpD (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 23 Apr 2008 19:45:03 +0100
Received: by fg-out-1718.google.com with SMTP id d23so10036568fga.32
        for <linux-mips@linux-mips.org>; Wed, 23 Apr 2008 11:45:00 -0700 (PDT)
DKIM-Signature:	v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:organization:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding;
        bh=Pvzy8l5pav9yxoSjGNNtexejPzk2r/qxbVVKWCz62uw=;
        b=V1r2pRVzAvzmTeQAfMASRSOvmcpb5ioUgdqTdfcTiBZaiyWT3R7Z9Zse28N9Ry8f5xSO5d4fkZFxL59jw9dMN8ZY0AutNlYO++NH8BP6aV3VjFP1TdNV5s1a86RoZWN9H5myQIuk/Sv3BE1T+w4CR4MXNFZ6KfY6tJ0aiOGS2Kw=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:organization:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding;
        b=mt18noNfN/q701Su/2HT2u9VvY2onadi1dyZ2aitjLJIDMWNCmGIu8V9oxodfZp8dXv3to5FvCSgh+VQs8MElXtUmcDvDzN28WFfmLtBEMwiNSYSKjApDNTSdeGrm49FwTEoAUl3VSKPMs7FgwO/UC5GEX4qS08Vfosd/f6tJ/c=
Received: by 10.86.31.18 with SMTP id e18mr3773355fge.38.1208976300312;
        Wed, 23 Apr 2008 11:45:00 -0700 (PDT)
Received: from ?192.168.1.3? ( [85.140.76.196])
        by mx.google.com with ESMTPS id l12sm433032fgb.8.2008.04.23.11.44.57
        (version=SSLv3 cipher=RC4-MD5);
        Wed, 23 Apr 2008 11:44:58 -0700 (PDT)
Message-ID: <480F83A6.50308@gmail.com>
Date:	Wed, 23 Apr 2008 22:44:54 +0400
From:	Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
Organization: DmVo Home
User-Agent: Thunderbird 1.5.0.14ubu (X11/20080306)
MIME-Version: 1.0
To:	Atsushi Nemoto <anemo@mba.ocn.ne.jp>
CC:	yoichi_yuasa@tripeaks.co.jp, ralf@linux-mips.org,
	linux-mips@linux-mips.org
Subject: Re: [PATCH 2/2] [MIPS] add DECstation DS1287 clockevent
References: <20080423085140.a693b2e5.yoichi_yuasa@tripeaks.co.jp>	<200804222353.m3MNr8m4025538@po-mbox303.hop.2iij.net> <20080423.115528.59033169.nemoto@toshiba-tops.co.jp>
In-Reply-To: <20080423.115528.59033169.nemoto@toshiba-tops.co.jp>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Return-Path: <dmitri.vorobiev@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: 19007
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: dmitri.vorobiev@gmail.com
Precedence: bulk
X-list: linux-mips
Content-Length: 1670
Lines: 43

Atsushi Nemoto Ð¿Ð¸ÑˆÐµÑ‚:
> On Wed, 23 Apr 2008 08:52:45 +0900, Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> wrote:
>> add DECstation DS1287 clockevent
>>
>> Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
> ...
>> --- linux-orig/arch/mips/kernel/Makefile	2008-04-22 19:01:43.957134178 +0900
>> +++ linux/arch/mips/kernel/Makefile	2008-04-22 18:03:05.427649422 +0900
>> @@ -9,8 +9,9 @@ obj-y		+= cpu-probe.o branch.o entry.o g
>>  		   time.o topology.o traps.o unaligned.o
>>  
>>  obj-$(CONFIG_CEVT_BCM1480)	+= cevt-bcm1480.o
>> -obj-$(CONFIG_CEVT_R4K)		+= cevt-r4k.o
>> +obj-$(CONFIG_CEVT_DS1287)	+= cevt-ds1287.o
>>  obj-$(CONFIG_CEVT_GT641XX)	+= cevt-gt641xx.o
>> +obj-$(CONFIG_CEVT_R4K)		+= cevt-r4k.o
>>  obj-$(CONFIG_CEVT_SB1250)	+= cevt-sb1250.o
>>  obj-$(CONFIG_CEVT_TXX9)		+= cevt-txx9.o
>>  ob