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>
