[PATCH] MIPS: Fix forgotten preempt_enable() when CPU has inclusive pcaches

2013-10-02 Thread Yoichi Yuasa

[1.904000] BUG: scheduling while atomic: swapper/1/0x0002
[1.908000] Modules linked in:
[1.916000] CPU: 0 PID: 1 Comm: swapper Not tainted 
3.12.0-rc2-lemote-los.git-5318619-dirty #1
[1.92] Stack : 31aac000 810d 0052 
802730a4
   0001 810cdf90 810d
  8068b968 806f5537 810cdf90 98009f0782e8
  0001 8072 806b 98009f078000
  98009f29 805f312c 98009f05b5d8 80233518
  98009f05b5e8 80274b7c 98009f078000 8068b968
     
   98009f05b520  805f2f6c
   8070 8070 806fc758
  8070 8020be98 806fceb0 805f2f6c
  ...
[2.028000] Call Trace:
[2.032000] [] show_stack+0x80/0x98
[2.036000] [] __schedule_bug+0x44/0x6c
[2.04] [] __schedule+0x518/0x5b0
[2.044000] [] schedule_timeout+0x128/0x1f0
[2.048000] [] msleep+0x3c/0x60
[2.052000] [] do_probe+0x238/0x3a8
[2.056000] [] ide_probe_port+0x340/0x7e8
[2.06] [] ide_host_register+0x2d0/0x7a8
[2.064000] [] ide_pci_init_two+0x4e4/0x790
[2.068000] [] amd74xx_probe+0x148/0x2c8
[2.072000] [] pci_device_probe+0xc4/0x130
[2.076000] [] driver_probe_device+0x98/0x270
[2.08] [] __driver_attach+0xe0/0xe8
[2.084000] [] bus_for_each_dev+0x78/0xe0
[2.088000] [] bus_add_driver+0x230/0x310
[2.092000] [] driver_register+0x84/0x158
[2.096000] [] do_one_initcall+0x104/0x160

Reported-by: Aaro Koskinen 
Tested-by: Aaro Koskinen 
Signed-off-by: Yoichi Yuasa 
---
 arch/mips/mm/c-r4k.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 627883b..bc6f96f 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -609,6 +609,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, 
unsigned long size)
r4k_blast_scache();
else
blast_scache_range(addr, addr + size);
+   preempt_enable();
__sync();
return;
}
@@ -650,6 +651,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned 
long size)
 */
blast_inv_scache_range(addr, addr + size);
}
+   preempt_enable();
__sync();
return;
}
-- 
1.7.9.5

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


[PATCH] MIPS: Fix forgotten preempt_enable() when CPU has inclusive pcaches

2013-10-02 Thread Yoichi Yuasa

[1.904000] BUG: scheduling while atomic: swapper/1/0x0002
[1.908000] Modules linked in:
[1.916000] CPU: 0 PID: 1 Comm: swapper Not tainted 
3.12.0-rc2-lemote-los.git-5318619-dirty #1
[1.92] Stack : 31aac000 810d 0052 
802730a4
   0001 810cdf90 810d
  8068b968 806f5537 810cdf90 98009f0782e8
  0001 8072 806b 98009f078000
  98009f29 805f312c 98009f05b5d8 80233518
  98009f05b5e8 80274b7c 98009f078000 8068b968
     
   98009f05b520  805f2f6c
   8070 8070 806fc758
  8070 8020be98 806fceb0 805f2f6c
  ...
[2.028000] Call Trace:
[2.032000] [8020be98] show_stack+0x80/0x98
[2.036000] [805f2f6c] __schedule_bug+0x44/0x6c
[2.04] [805fac58] __schedule+0x518/0x5b0
[2.044000] [805f8a58] schedule_timeout+0x128/0x1f0
[2.048000] [80240314] msleep+0x3c/0x60
[2.052000] [80495400] do_probe+0x238/0x3a8
[2.056000] [804958b0] ide_probe_port+0x340/0x7e8
[2.06] [80496028] ide_host_register+0x2d0/0x7a8
[2.064000] [8049c65c] ide_pci_init_two+0x4e4/0x790
[2.068000] [8049f9b8] amd74xx_probe+0x148/0x2c8
[2.072000] [803f571c] pci_device_probe+0xc4/0x130
[2.076000] [80478f60] driver_probe_device+0x98/0x270
[2.08] [80479298] __driver_attach+0xe0/0xe8
[2.084000] [80476ab0] bus_for_each_dev+0x78/0xe0
[2.088000] [80478468] bus_add_driver+0x230/0x310
[2.092000] [80479b44] driver_register+0x84/0x158
[2.096000] [80200504] do_one_initcall+0x104/0x160

Reported-by: Aaro Koskinen aaro.koski...@iki.fi
Tested-by: Aaro Koskinen aaro.koski...@iki.fi
Signed-off-by: Yoichi Yuasa yu...@linux-mips.org
---
 arch/mips/mm/c-r4k.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 627883b..bc6f96f 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -609,6 +609,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, 
unsigned long size)
r4k_blast_scache();
else
blast_scache_range(addr, addr + size);
+   preempt_enable();
__sync();
return;
}
@@ -650,6 +651,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned 
long size)
 */
blast_inv_scache_range(addr, addr + size);
}
+   preempt_enable();
__sync();
return;
}
-- 
1.7.9.5

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


Re: Linux 3.12-rc2 - MIPS regression

2013-10-01 Thread Yoichi Yuasa
Hi,

On Sat, 28 Sep 2013 02:10:12 +0300
Aaro Koskinen  wrote:

> Hi,
> 
> 3.12-rc2 breaks the boot (BUG: scheduling while atomic, see logs below)
> on Lemote Mini-PC (MIPS). According to git bisect, this is caused by:
> 
> ff522058bd717506b2fa066fa564657f2b86477e is the first bad commit
> commit ff522058bd717506b2fa066fa564657f2b86477e
> Author: Ralf Baechle 
> Date:   Tue Sep 17 12:44:31 2013 +0200
> 
> MIPS: Fix accessing to per-cpu data when flushing the cache
> 
> Reverting the commit from v3.12-rc2 makes the board boot fine.

Please try this patch on top of rc2.

MIPS: Fix forgotten preempt_enable() when CPU has inclusive pcaches

Signed-off-by: Yoichi Yuasa 

diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 627883b..2492e60 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -609,6 +609,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, 
unsigned long size)
r4k_blast_scache();
else
blast_scache_range(addr, addr + size);
+   preempt_enable();
__sync();
return;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux 3.12-rc2 - MIPS regression

2013-10-01 Thread Yoichi Yuasa
Hi,

On Sat, 28 Sep 2013 02:10:12 +0300
Aaro Koskinen aaro.koski...@iki.fi wrote:

 Hi,
 
 3.12-rc2 breaks the boot (BUG: scheduling while atomic, see logs below)
 on Lemote Mini-PC (MIPS). According to git bisect, this is caused by:
 
 ff522058bd717506b2fa066fa564657f2b86477e is the first bad commit
 commit ff522058bd717506b2fa066fa564657f2b86477e
 Author: Ralf Baechle r...@linux-mips.org
 Date:   Tue Sep 17 12:44:31 2013 +0200
 
 MIPS: Fix accessing to per-cpu data when flushing the cache
 
 Reverting the commit from v3.12-rc2 makes the board boot fine.

Please try this patch on top of rc2.

MIPS: Fix forgotten preempt_enable() when CPU has inclusive pcaches

Signed-off-by: Yoichi Yuasa yu...@linux-mips.org

diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 627883b..2492e60 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -609,6 +609,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, 
unsigned long size)
r4k_blast_scache();
else
blast_scache_range(addr, addr + size);
+   preempt_enable();
__sync();
return;
}
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: cobalt_btns.c <-> struct platform_device compile error

2008-02-17 Thread Yoichi Yuasa
Hi,

I already sent a patch to Dmitry.

Yoichi

On Sun, 17 Feb 2008 22:09:35 +0200
Adrian Bunk <[EMAIL PROTECTED]> wrote:

> Commit b037b08e59633d939d79f1df9c43c6625f8db904 broke the compilation of 
> cobalt_btns.c:
> 
> <--  snip  -->
> 
> ...
>   CC  drivers/input/misc/cobalt_btns.o
> ...
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/input/misc/cobalt_btns.c: 
> In function 'cobalt_buttons_probe':
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/input/misc/cobalt_btns.c:101:
>  error: 'struct platform_device' has no member named 'keymap'
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/input/misc/cobalt_btns.c:102:
>  error: 'struct platform_device' has no member named 'keymap'
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/input/misc/cobalt_btns.c:102:
>  error: 'struct platform_device' has no member named 'keymap'
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/input/misc/cobalt_btns.c:102:
>  error: 'struct platform_device' has no member named 'keymap'
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/input/misc/cobalt_btns.c:102:
>  error: 'struct platform_device' has no member named 'keymap'
> ...
> make[4]: *** [drivers/input/misc/cobalt_btns.o] Error 1
> 
> <--  snip  -->
> 
> cu
> Adrian
> 
> -- 
> 
>"Is there not promise of rain?" Ling Tan asked suddenly out
> of the darkness. There had been need of rain for many days.
>"Only a promise," Lao Er said.
>Pearl S. Buck - Dragon Seed
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: cobalt_btns.c - struct platform_device compile error

2008-02-17 Thread Yoichi Yuasa
Hi,

I already sent a patch to Dmitry.

Yoichi

On Sun, 17 Feb 2008 22:09:35 +0200
Adrian Bunk [EMAIL PROTECTED] wrote:

 Commit b037b08e59633d939d79f1df9c43c6625f8db904 broke the compilation of 
 cobalt_btns.c:
 
 --  snip  --
 
 ...
   CC  drivers/input/misc/cobalt_btns.o
 ...
 /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/input/misc/cobalt_btns.c: 
 In function 'cobalt_buttons_probe':
 /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/input/misc/cobalt_btns.c:101:
  error: 'struct platform_device' has no member named 'keymap'
 /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/input/misc/cobalt_btns.c:102:
  error: 'struct platform_device' has no member named 'keymap'
 /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/input/misc/cobalt_btns.c:102:
  error: 'struct platform_device' has no member named 'keymap'
 /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/input/misc/cobalt_btns.c:102:
  error: 'struct platform_device' has no member named 'keymap'
 /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/input/misc/cobalt_btns.c:102:
  error: 'struct platform_device' has no member named 'keymap'
 ...
 make[4]: *** [drivers/input/misc/cobalt_btns.o] Error 1
 
 --  snip  --
 
 cu
 Adrian
 
 -- 
 
Is there not promise of rain? Ling Tan asked suddenly out
 of the darkness. There had been need of rain for many days.
Only a promise, Lao Er said.
Pearl S. Buck - Dragon Seed
 
 
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Please revert: PCI: fix IDE legacy mode resources

2007-12-05 Thread Yoichi Yuasa
On Thu, 06 Dec 2007 16:04:07 +1100
Benjamin Herrenschmidt <[EMAIL PROTECTED]> wrote:

> 
> On Thu, 2007-12-06 at 13:34 +0900, Yoichi Yuasa wrote:
> > > I don't understand how his fix can work on MIPS nor why the previous
> > > code didn't, but I don't know how MIPS does its remapping tricks,
> > > however it will definitely -not- work on powerpc (and will break a
> > > couple of machines out there).
> > 
> > MIPS pcibios_fixup_bus() converts RAW BAR values(including offset) to
> > resource values. How does it fix up on powerpc?
> 
> Same thing. We expect resources to contain raw values before .

Same.

> What I don't understand is thus why you are calling resource_to_bus on 0x1f0
> which is -not- a resource value, but is already a BAR value...

0x1f0 is resource value on MIPS Cobalt.
All RAW BAR values contain the offset(0x1000) on it.

Do the BAR values on your target contain the offset?

Yoichi



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


Re: Please revert: PCI: fix IDE legacy mode resources

2007-12-05 Thread Yoichi Yuasa
On Thu, 06 Dec 2007 11:10:18 +1100
Benjamin Herrenschmidt <[EMAIL PROTECTED]> wrote:

> The commit below that was merged in october looks bogus to me.
> 
> At this stage in the PCI probe, the pci_dev->resource's contain RAW bar
> values, that is bus values..
> 
> A PCI legacy IDE controller that hard decodes 0x1f0 etc...  does such as
> bus values as well. That is, the resources should contain 0x1f0...0x1f7
> etc... -not- some kind of transformed values, because that's exactly
> what a BAR would contain if it had been read from the device by
> pci_read_bases() and we haven't performed any fixup yet.
> 
> If the platform offsets resources, like powerpc does, it should do so
> later on in a fixup pass (on ppc, we use either a header quirk or
> fixup_bus depending on the phase of the moon) and that should work
> fine. 
> 
> I don't understand how his fix can work on MIPS nor why the previous
> code didn't, but I don't know how MIPS does its remapping tricks,
> however it will definitely -not- work on powerpc (and will break a
> couple of machines out there).

MIPS pcibios_fixup_bus() converts RAW BAR values(including offset) to resource 
values.
How does it fix up on powerpc?

Yoichi 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Please revert: PCI: fix IDE legacy mode resources

2007-12-05 Thread Yoichi Yuasa
On Thu, 06 Dec 2007 11:10:18 +1100
Benjamin Herrenschmidt [EMAIL PROTECTED] wrote:

 The commit below that was merged in october looks bogus to me.
 
 At this stage in the PCI probe, the pci_dev-resource's contain RAW bar
 values, that is bus values..
 
 A PCI legacy IDE controller that hard decodes 0x1f0 etc...  does such as
 bus values as well. That is, the resources should contain 0x1f0...0x1f7
 etc... -not- some kind of transformed values, because that's exactly
 what a BAR would contain if it had been read from the device by
 pci_read_bases() and we haven't performed any fixup yet.
 
 If the platform offsets resources, like powerpc does, it should do so
 later on in a fixup pass (on ppc, we use either a header quirk or
 fixup_bus depending on the phase of the moon) and that should work
 fine. 
 
 I don't understand how his fix can work on MIPS nor why the previous
 code didn't, but I don't know how MIPS does its remapping tricks,
 however it will definitely -not- work on powerpc (and will break a
 couple of machines out there).

MIPS pcibios_fixup_bus() converts RAW BAR values(including offset) to resource 
values.
How does it fix up on powerpc?

Yoichi 
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Please revert: PCI: fix IDE legacy mode resources

2007-12-05 Thread Yoichi Yuasa
On Thu, 06 Dec 2007 16:04:07 +1100
Benjamin Herrenschmidt [EMAIL PROTECTED] wrote:

 
 On Thu, 2007-12-06 at 13:34 +0900, Yoichi Yuasa wrote:
   I don't understand how his fix can work on MIPS nor why the previous
   code didn't, but I don't know how MIPS does its remapping tricks,
   however it will definitely -not- work on powerpc (and will break a
   couple of machines out there).
  
  MIPS pcibios_fixup_bus() converts RAW BAR values(including offset) to
  resource values. How does it fix up on powerpc?
 
 Same thing. We expect resources to contain raw values before .

Same.

 What I don't understand is thus why you are calling resource_to_bus on 0x1f0
 which is -not- a resource value, but is already a BAR value...

0x1f0 is resource value on MIPS Cobalt.
All RAW BAR values contain the offset(0x1000) on it.

Do the BAR values on your target contain the offset?

Yoichi



--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH][2/3] led: add Cobalt Raq series LEDs support

2007-09-13 Thread Yoichi Yuasa
Add Cobalt Raq series LEDs support.

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/Kconfig 
mips/drivers/leds/Kconfig
--- mips-orig/drivers/leds/Kconfig  2007-09-14 13:05:27.969928000 +0900
+++ mips/drivers/leds/Kconfig   2007-09-14 13:05:39.450645500 +0900
@@ -93,6 +93,13 @@ config LEDS_COBALT_QUBE
help
  This option enables support for the front LED on Cobalt Qube series
 
+config LEDS_COBALT_RAQ
+   bool "LED Support for the Cobalt Raq series"
+   depends on LEDS_CLASS && MIPS_COBALT
+   select LEDS_TRIGGERS
+   help
+ This option enables support for the Cobalt Raq series LEDs.
+
 config LEDS_GPIO
tristate "LED Support for GPIO connected LEDs"
depends on LEDS_CLASS && GENERIC_GPIO
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/Makefile 
mips/drivers/leds/Makefile
--- mips-orig/drivers/leds/Makefile 2007-09-14 13:05:27.981928750 +0900
+++ mips/drivers/leds/Makefile  2007-09-14 13:05:39.450645500 +0900
@@ -16,6 +16,7 @@ obj-$(CONFIG_LEDS_NET48XX)+= leds-net4
 obj-$(CONFIG_LEDS_WRAP)+= leds-wrap.o
 obj-$(CONFIG_LEDS_H1940)   += leds-h1940.o
 obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-cobalt-qube.o
+obj-$(CONFIG_LEDS_COBALT_RAQ)  += leds-cobalt-raq.o
 obj-$(CONFIG_LEDS_GPIO)+= leds-gpio.o
 
 # LED Triggers
diff -pruN -X mips/Documentation/dontdiff 
mips-orig/drivers/leds/leds-cobalt-raq.c mips/drivers/leds/leds-cobalt-raq.c
--- mips-orig/drivers/leds/leds-cobalt-raq.c1970-01-01 09:00:00.0 
+0900
+++ mips/drivers/leds/leds-cobalt-raq.c 2007-09-14 13:06:03.900173500 +0900
@@ -0,0 +1,135 @@
+/*
+ *  LEDs driver for the Cobalt Raq series.
+ *
+ *  Copyright (C) 2007  Yoichi Yuasa <[EMAIL PROTECTED]>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#define LED_WEB0x04
+#define LED_POWER_OFF  0x08
+
+static void __iomem *led_port;
+static u8 led_value;
+static DEFINE_SPINLOCK(led_value_lock);
+
+static void raq_web_led_set(struct led_classdev *led_cdev,
+enum led_brightness brightness)
+{
+   spin_lock_irq(_value_lock);
+
+   if (brightness)
+   led_value |= LED_WEB;
+   else
+   led_value &= ~LED_WEB;
+   writeb(led_value, led_port);
+
+   spin_unlock_irq(_value_lock);
+}
+
+static struct led_classdev raq_web_led = {
+   .name   = "raq-web",
+   .brightness_set = raq_web_led_set,
+};
+
+static void raq_power_off_led_set(struct led_classdev *led_cdev,
+  enum led_brightness brightness)
+{
+   spin_lock_irq(_value_lock);
+
+   if (brightness)
+   led_value |= LED_POWER_OFF;
+   else
+   led_value &= ~LED_POWER_OFF;
+   writeb(led_value, led_port);
+
+   spin_unlock_irq(_value_lock);
+}
+
+static struct led_classdev raq_power_off_led = {
+   .name   = "raq-power-off",
+   .brightness_set = raq_power_off_led_set,
+   .default_trigger= "power-off",
+};
+
+static int __devinit cobalt_raq_led_probe(struct platform_device *pdev)
+{
+   struct resource *res;
+   int retval;
+
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   if (!res)
+   return -EBUSY;
+
+   led_port = ioremap(res->start, res->end - res->start + 1);
+   if (!led_port)
+   return -ENOMEM;
+
+   retval = led_classdev_register(>dev, _power_off_led);
+   if (retval)
+   goto err_iounmap;
+
+   retval = led_classdev_register(>dev, _web_led);
+   if (retval)
+   goto err_unregister;
+
+   return 0;
+
+err_unregister:
+   led_classdev_unregister(_power_off_led);
+
+err_iounmap:
+   iounmap(led_port);
+   led_port = NULL;
+
+   return retval;
+}
+
+static int __devexit cobalt_raq_led_remove(struct platform_device *pdev)
+{
+   led_classdev_unregister(_power_off_led);
+   led_classdev_unregister(_w

[PATCH][3/3] led: update Cobalt Qube series front LED support

2007-09-13 Thread Yoichi Yuasa
Update Cobalt Qube series front LED support.

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -pruN -X mips/Documentation/dontdiff 
mips-orig/drivers/leds/leds-cobalt-qube.c mips/drivers/leds/leds-cobalt-qube.c
--- mips-orig/drivers/leds/leds-cobalt-qube.c   2007-09-14 11:16:22.397075500 
+0900
+++ mips/drivers/leds/leds-cobalt-qube.c2007-09-14 11:38:52.797470250 
+0900
@@ -3,40 +3,100 @@
  *
  * Control the Cobalt Qube series front LED
  */
-
+#include 
+#include 
+#include 
 #include 
+#include 
 #include 
-#include 
-#include 
-#include 
-#include 
 
-static void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness 
brightness)
+#include 
+
+#define LED_FRONT_LEFT 0x01
+#define LED_FRONT_RIGHT0x02
+
+static void __iomem *led_port;
+static u8 led_value;
+
+static void qube_front_led_set(struct led_classdev *led_cdev,
+   enum led_brightness brightness)
 {
if (brightness)
-   COBALT_LED_PORT = COBALT_LED_BAR_LEFT | COBALT_LED_BAR_RIGHT;
+   led_value = LED_FRONT_LEFT | LED_FRONT_RIGHT;
else
-   COBALT_LED_PORT = 0;
+   led_value = ~(LED_FRONT_LEFT | LED_FRONT_RIGHT);
+   writeb(led_value, led_port);
+}
+
+static struct led_classdev qube_front_led = {
+   .name   = "qube-front",
+   .brightness = LED_FULL,
+   .brightness_set = qube_front_led_set,
+   .default_trigger= "ide-disk",
+};
+
+static int __devinit cobalt_qube_led_probe(struct platform_device *pdev)
+{
+   struct resource *res;
+   int retval;
+
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   if (!res)
+   return -EBUSY;
+
+   led_port = ioremap(res->start, res->end - res->start + 1);
+   if (!led_port)
+   return -ENOMEM;
+
+   led_value = LED_FRONT_LEFT | LED_FRONT_RIGHT;
+   writeb(led_value, led_port);
+
+   retval = led_classdev_register(>dev, _front_led);
+   if (retval)
+   goto err_iounmap;
+
+   return 0;
+
+err_iounmap:
+   iounmap(led_port);
+   led_port = NULL;
+
+   return retval;
+}
+
+static int __devexit cobalt_qube_led_remove(struct platform_device *pdev)
+{
+   led_classdev_unregister(_front_led);
+
+   if (led_port) {
+   iounmap(led_port);
+   led_port = NULL;
+   }
+
+   return 0;
 }
 
-static struct led_classdev cobalt_led = {
-   .name = "cobalt-front-led",
-   .brightness_set = cobalt_led_set,
-   .default_trigger = "ide-disk",
+static struct platform_driver cobalt_qube_led_driver = {
+   .probe  = cobalt_qube_led_probe,
+   .remove = __devexit_p(cobalt_qube_led_remove),
+   .driver = {
+   .name   = "Cobalt Qube LEDs",
+   .owner  = THIS_MODULE,
+   },
 };
 
-static int __init cobalt_led_init(void)
+static int __init cobalt_qube_led_init(void)
 {
-   return led_classdev_register(NULL, _led);
+   return platform_driver_register(_qube_led_driver);
 }
 
-static void __exit cobalt_led_exit(void)
+static void __exit cobalt_qube_led_exit(void)
 {
-   led_classdev_unregister(_led);
+   platform_driver_unregister(_qube_led_driver);
 }
 
-module_init(cobalt_led_init);
-module_exit(cobalt_led_exit);
+module_init(cobalt_qube_led_init);
+module_exit(cobalt_qube_led_exit);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Front LED support for Cobalt Qube series");
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH][1/3] led: fix machines supported by leds-cobalt

2007-09-13 Thread Yoichi Yuasa
The leds-cobalt driver only supports the Coable Qube series
(not included in Cobalt Raq series).
This patch has fixed Kconfig and renamed the driver.

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/Kconfig 
mips/drivers/leds/Kconfig
--- mips-orig/drivers/leds/Kconfig  2007-09-14 12:11:41.222575000 +0900
+++ mips/drivers/leds/Kconfig   2007-09-14 12:12:06.820174750 +0900
@@ -87,11 +87,11 @@ config LEDS_H1940
help
  This option enables support for the LEDs on the h1940.
 
-config LEDS_COBALT
-   tristate "LED Support for Cobalt Server front LED"
+config LEDS_COBALT_QUBE
+   tristate "LED Support for the Cobalt Qube series front LED"
depends on LEDS_CLASS && MIPS_COBALT
help
- This option enables support for the front LED on Cobalt Server
+ This option enables support for the front LED on Cobalt Qube series
 
 config LEDS_GPIO
tristate "LED Support for GPIO connected LEDs"
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/Makefile 
mips/drivers/leds/Makefile
--- mips-orig/drivers/leds/Makefile 2007-09-14 12:11:41.234575750 +0900
+++ mips/drivers/leds/Makefile  2007-09-14 12:11:23.217449750 +0900
@@ -15,7 +15,7 @@ obj-$(CONFIG_LEDS_AMS_DELTA)  += leds-am
 obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o
 obj-$(CONFIG_LEDS_WRAP)+= leds-wrap.o
 obj-$(CONFIG_LEDS_H1940)   += leds-h1940.o
-obj-$(CONFIG_LEDS_COBALT)  += leds-cobalt.o
+obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-cobalt-qube.o
 obj-$(CONFIG_LEDS_GPIO)+= leds-gpio.o
 
 # LED Triggers
diff -pruN -X mips/Documentation/dontdiff 
mips-orig/drivers/leds/leds-cobalt-qube.c mips/drivers/leds/leds-cobalt-qube.c
--- mips-orig/drivers/leds/leds-cobalt-qube.c   1970-01-01 09:00:00.0 
+0900
+++ mips/drivers/leds/leds-cobalt-qube.c2007-09-14 12:11:23.217449750 
+0900
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2006 - Florian Fainelli <[EMAIL PROTECTED]>
+ *
+ * Control the Cobalt Qube series front LED
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness 
brightness)
+{
+   if (brightness)
+   COBALT_LED_PORT = COBALT_LED_BAR_LEFT | COBALT_LED_BAR_RIGHT;
+   else
+   COBALT_LED_PORT = 0;
+}
+
+static struct led_classdev cobalt_led = {
+   .name = "cobalt-front-led",
+   .brightness_set = cobalt_led_set,
+   .default_trigger = "ide-disk",
+};
+
+static int __init cobalt_led_init(void)
+{
+   return led_classdev_register(NULL, _led);
+}
+
+static void __exit cobalt_led_exit(void)
+{
+   led_classdev_unregister(_led);
+}
+
+module_init(cobalt_led_init);
+module_exit(cobalt_led_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Front LED support for Cobalt Qube series");
+MODULE_AUTHOR("Florian Fainelli <[EMAIL PROTECTED]>");
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/leds-cobalt.c 
mips/drivers/leds/leds-cobalt.c
--- mips-orig/drivers/leds/leds-cobalt.c2007-09-14 12:11:41.258577250 
+0900
+++ mips/drivers/leds/leds-cobalt.c 1970-01-01 09:00:00.0 +0900
@@ -1,43 +0,0 @@
-/*
- * Copyright 2006 - Florian Fainelli <[EMAIL PROTECTED]>
- *
- * Control the Cobalt Qube/RaQ front LED
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-static void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness 
brightness)
-{
-   if (brightness)
-   COBALT_LED_PORT = COBALT_LED_BAR_LEFT | COBALT_LED_BAR_RIGHT;
-   else
-   COBALT_LED_PORT = 0;
-}
-
-static struct led_classdev cobalt_led = {
-   .name = "cobalt-front-led",
-   .brightness_set = cobalt_led_set,
-   .default_trigger = "ide-disk",
-};
-
-static int __init cobalt_led_init(void)
-{
-   return led_classdev_register(NULL, _led);
-}
-
-static void __exit cobalt_led_exit(void)
-{
-   led_classdev_unregister(_led);
-}
-
-module_init(cobalt_led_init);
-module_exit(cobalt_led_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("Front LED support for Cobalt Server");
-MODULE_AUTHOR("Florian Fainelli <[EMAIL PROTECTED]>");
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH][1/2] led: add Cobalt Raq LEDs support

2007-09-13 Thread Yoichi Yuasa
On Thu, 13 Sep 2007 22:32:12 +0100
Richard Purdie <[EMAIL PROTECTED]> wrote:

> On Thu, 2007-09-13 at 23:54 +0900, Yoichi Yuasa wrote:
> > Add Cobalt Raq LEDs support.
> > 
> > Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>
> 
> Not the clearest patch I've ever seen or the most helpful patch
> description. The rename could probably be split from the additional new
> driver at least...

OK, I'll split it.

> > diff -pruN -X mips/Documentation/dontdiff 
> > mips-orig/drivers/leds/leds-cobalt-raq.c mips/drivers/leds/leds-cobalt-raq.c
> > --- mips-orig/drivers/leds/leds-cobalt-raq.c1970-01-01 
> > 09:00:00.0 +0900
> > +++ mips/drivers/leds/leds-cobalt-raq.c 2007-09-12 12:04:34.021000750 
> > +0900
> [...]
> > +static void raq_web_led_set(struct led_classdev *led_cdev,
> > +enum led_brightness brightness)
> > +{
> > +   spin_lock_irq(_led_lock);
> > +
> > +   if (brightness)
> > +   led_value |= LED_WEB;
> > +   else
> > +   led_value &= ~LED_WEB;
> > +   writeb(led_value, led_port);
> > +
> > +   spin_unlock_irq(_led_lock);
> > +}
> 
> The _irq spinlock variants are not safe there or in the other brightness
> set function...
> 
> +static struct led_classdev raq_web_led = {
> > +   .name   = "raq-web-led",
> > +   .brightness_set = raq_web_led_set,
> > +};
> > +
> [...]
> > +static struct led_classdev raq_power_off_led = {
> > +   .name   = "raq-power-off-led",
> > +   .brightness_set = raq_power_off_led_set,
> > +   .default_trigger= "power-off",
> > +};
> 
> Do these really need "led" in the name?
> 
> What does a power-off trigger do with an LED out of interest?

It lights when the Cobalt Raq is possible to turn off power. 

> 
> > +static int __devexit cobalt_raq_led_remove(struct platform_device *pdev)
> > +{
> > +   if (led_port) {
> > +   iounmap(led_port);
> > +   led_port = NULL;
> > +   }
> > +
> > +   led_classdev_unregister(_power_off_led);
> > +   led_classdev_unregister(_web_led);
> > +
> > +   return 0;
> > +}
> 
> You want to unregister, then iounmap...
> 
> > +static int __init cobalt_raq_led_init(void)
> > +{
> > +   return platform_driver_register(_raq_led_driver);
> > +}
> > +
> > +module_init(cobalt_raq_led_init);
> 
> No module_exit in one driver for any particular reason?

This driver cares power-off LED.
Therefore, this driver is not tristate.

> Some of these comments also apply to you second patch. All minor tweaks
> really though :).

Thank you for your comments.

Yoichi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH][2/2] led: update Cobalt Qube LED support

2007-09-13 Thread Yoichi Yuasa
Update Cobalt Qube front LED support.

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -pruN -X mips/Documentation/dontdiff 
mips-orig/drivers/leds/leds-cobalt-qube.c mips/drivers/leds/leds-cobalt-qube.c
--- mips-orig/drivers/leds/leds-cobalt-qube.c   2007-08-24 19:35:51.689587500 
+0900
+++ mips/drivers/leds/leds-cobalt-qube.c2007-08-24 19:57:45.391688750 
+0900
@@ -1,43 +1,103 @@
 /*
  * Copyright 2006 - Florian Fainelli <[EMAIL PROTECTED]>
  *
- * Control the Cobalt Qube/RaQ front LED
+ * Control the Cobalt Qube/Qube2 front LED
  */
-
+#include 
+#include 
+#include 
 #include 
+#include 
 #include 
-#include 
-#include 
-#include 
-#include 
 
-static void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness 
brightness)
+#include 
+
+#define LED_BAR_LEFT   0x01
+#define LED_BAR_RIGHT  0x02
+
+static void __iomem *led_port;
+static u8 led_value;
+
+static void qube_bar_led_set(struct led_classdev *led_cdev,
+ enum led_brightness brightness)
 {
if (brightness)
-   COBALT_LED_PORT = COBALT_LED_BAR_LEFT | COBALT_LED_BAR_RIGHT;
+   led_value = LED_BAR_LEFT | LED_BAR_RIGHT;
else
-   COBALT_LED_PORT = 0;
+   led_value = ~(LED_BAR_LEFT | LED_BAR_RIGHT);
+   writeb(led_value, led_port);
+}
+
+static struct led_classdev qube_bar_led = {
+   .name   = "qube-bar-led",
+   .brightness = LED_FULL,
+   .brightness_set = qube_bar_led_set,
+   .default_trigger= "ide-disk",
+};
+
+static int __devinit cobalt_qube_led_probe(struct platform_device *pdev)
+{
+   struct resource *res;
+   int retval;
+
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   if (!res)
+   return -EBUSY;
+
+   led_port = ioremap(res->start, res->end - res->start + 1);
+   if (!led_port)
+   return -ENOMEM;
+
+   led_value = LED_BAR_LEFT | LED_BAR_RIGHT;
+   writeb(led_value, led_port);
+
+   retval = led_classdev_register(>dev, _bar_led);
+   if (retval)
+   goto err_iounmap;
+
+   return 0;
+
+err_iounmap:
+   iounmap(led_port);
+   led_port = NULL;
+
+   return retval;
+}
+
+static int __devexit cobalt_qube_led_remove(struct platform_device *pdev)
+{
+   if (led_port) {
+   iounmap(led_port);
+   led_port = NULL;
+   }
+
+   led_classdev_unregister(_bar_led);
+
+   return 0;
 }
 
-static struct led_classdev cobalt_led = {
-   .name = "cobalt-front-led",
-   .brightness_set = cobalt_led_set,
-   .default_trigger = "ide-disk",
+static struct platform_driver cobalt_qube_led_driver = {
+   .probe  = cobalt_qube_led_probe,
+   .remove = __devexit_p(cobalt_qube_led_remove),
+   .driver = {
+   .name   = "Cobalt Qube LEDs",
+   .owner  = THIS_MODULE,
+   },
 };
 
-static int __init cobalt_led_init(void)
+static int __init cobalt_qube_led_init(void)
 {
-   return led_classdev_register(NULL, _led);
+   return platform_driver_register(_qube_led_driver);
 }
 
-static void __exit cobalt_led_exit(void)
+static void __exit cobalt_qube_led_exit(void)
 {
-   led_classdev_unregister(_led);
+   platform_driver_unregister(_qube_led_driver);
 }
 
-module_init(cobalt_led_init);
-module_exit(cobalt_led_exit);
+module_init(cobalt_qube_led_init);
+module_exit(cobalt_qube_led_exit);
 
 MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("Front LED support for Cobalt Server");
+MODULE_DESCRIPTION("Front LED support for Cobalt Qube");
 MODULE_AUTHOR("Florian Fainelli <[EMAIL PROTECTED]>");
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH][1/2] led: add Cobalt Raq LEDs support

2007-09-13 Thread Yoichi Yuasa
Add Cobalt Raq LEDs support.

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/Kconfig 
mips/drivers/leds/Kconfig
--- mips-orig/drivers/leds/Kconfig  2007-09-12 12:01:58.027251750 +0900
+++ mips/drivers/leds/Kconfig   2007-09-12 12:04:34.021000750 +0900
@@ -87,11 +87,18 @@ config LEDS_H1940
help
  This option enables support for the LEDs on the h1940.
 
-config LEDS_COBALT
-   tristate "LED Support for Cobalt Server front LED"
+config LEDS_COBALT_QUBE
+   tristate "LED Support for Cobalt Qube front LED"
depends on LEDS_CLASS && MIPS_COBALT
help
- This option enables support for the front LED on Cobalt Server
+ This option enables support for the front LEDs on Cobalt Qube/Qube2.
+
+config LEDS_COBALT_RAQ
+   bool "LED Support for Cobalt Raq series"
+   depends on LEDS_CLASS && MIPS_COBALT
+   select LEDS_TRIGGERS
+   help
+ This option enables support for LEDs on the Cobalt Raq series.
 
 config LEDS_GPIO
tristate "LED Support for GPIO connected LEDs"
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/Makefile 
mips/drivers/leds/Makefile
--- mips-orig/drivers/leds/Makefile 2007-09-12 12:01:58.035252250 +0900
+++ mips/drivers/leds/Makefile  2007-09-12 12:04:34.021000750 +0900
@@ -15,7 +15,8 @@ obj-$(CONFIG_LEDS_AMS_DELTA)  += leds-am
 obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o
 obj-$(CONFIG_LEDS_WRAP)+= leds-wrap.o
 obj-$(CONFIG_LEDS_H1940)   += leds-h1940.o
-obj-$(CONFIG_LEDS_COBALT)  += leds-cobalt.o
+obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-cobalt-qube.o
+obj-$(CONFIG_LEDS_COBALT_RAQ)  += leds-cobalt-raq.o
 obj-$(CONFIG_LEDS_GPIO)+= leds-gpio.o
 
 # LED Triggers
diff -pruN -X mips/Documentation/dontdiff 
mips-orig/drivers/leds/leds-cobalt-qube.c mips/drivers/leds/leds-cobalt-qube.c
--- mips-orig/drivers/leds/leds-cobalt-qube.c   1970-01-01 09:00:00.0 
+0900
+++ mips/drivers/leds/leds-cobalt-qube.c2007-09-12 13:29:20.088085000 
+0900
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2006 - Florian Fainelli <[EMAIL PROTECTED]>
+ *
+ * Control the Cobalt Qube/RaQ front LED
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness 
brightness)
+{
+   if (brightness)
+   COBALT_LED_PORT = COBALT_LED_BAR_LEFT | COBALT_LED_BAR_RIGHT;
+   else
+   COBALT_LED_PORT = 0;
+}
+
+static struct led_classdev cobalt_led = {
+   .name = "cobalt-front-led",
+   .brightness_set = cobalt_led_set,
+   .default_trigger = "ide-disk",
+};
+
+static int __init cobalt_led_init(void)
+{
+   return led_classdev_register(NULL, _led);
+}
+
+static void __exit cobalt_led_exit(void)
+{
+   led_classdev_unregister(_led);
+}
+
+module_init(cobalt_led_init);
+module_exit(cobalt_led_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Front LED support for Cobalt Server");
+MODULE_AUTHOR("Florian Fainelli <[EMAIL PROTECTED]>");
diff -pruN -X mips/Documentation/dontdiff 
mips-orig/drivers/leds/leds-cobalt-raq.c mips/drivers/leds/leds-cobalt-raq.c
--- mips-orig/drivers/leds/leds-cobalt-raq.c1970-01-01 09:00:00.0 
+0900
+++ mips/drivers/leds/leds-cobalt-raq.c 2007-09-12 12:04:34.021000750 +0900
@@ -0,0 +1,135 @@
+/*
+ *  Cobalt Raq/Raq2 LED driver.
+ *
+ *  Copyright (C) 2007  Yoichi Yuasa <[EMAIL PROTECTED]>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#define LED_WEB0x04
+#define LED_POWER_OFF  0x08
+
+static void __iomem *led_port;
+static u8 led_value;
+DEFINE_SPINLOCK(raq_led_lock);
+
+static void raq_web_led_set(struct led_classdev *led_cdev,
+enum led_brightness brightness)
+{
+   spin_lock_irq(_led_lock);
+
+   if (brightness)
+   led_value |= LED_WEB;
+   else
+   led_value &= ~LED_WEB;
+   writeb(led_value, le

[PATCH][2/2] led: update Cobalt Qube LED support

2007-09-13 Thread Yoichi Yuasa
Update Cobalt Qube front LED support.

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -pruN -X mips/Documentation/dontdiff 
mips-orig/drivers/leds/leds-cobalt-qube.c mips/drivers/leds/leds-cobalt-qube.c
--- mips-orig/drivers/leds/leds-cobalt-qube.c   2007-08-24 19:35:51.689587500 
+0900
+++ mips/drivers/leds/leds-cobalt-qube.c2007-08-24 19:57:45.391688750 
+0900
@@ -1,43 +1,103 @@
 /*
  * Copyright 2006 - Florian Fainelli [EMAIL PROTECTED]
  *
- * Control the Cobalt Qube/RaQ front LED
+ * Control the Cobalt Qube/Qube2 front LED
  */
-
+#include linux/init.h
+#include linux/ioport.h
+#include linux/leds.h
 #include linux/module.h
+#include linux/platform_device.h
 #include linux/types.h
-#include linux/kernel.h
-#include linux/device.h
-#include linux/leds.h
-#include asm/mach-cobalt/cobalt.h
 
-static void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness 
brightness)
+#include asm/io.h
+
+#define LED_BAR_LEFT   0x01
+#define LED_BAR_RIGHT  0x02
+
+static void __iomem *led_port;
+static u8 led_value;
+
+static void qube_bar_led_set(struct led_classdev *led_cdev,
+ enum led_brightness brightness)
 {
if (brightness)
-   COBALT_LED_PORT = COBALT_LED_BAR_LEFT | COBALT_LED_BAR_RIGHT;
+   led_value = LED_BAR_LEFT | LED_BAR_RIGHT;
else
-   COBALT_LED_PORT = 0;
+   led_value = ~(LED_BAR_LEFT | LED_BAR_RIGHT);
+   writeb(led_value, led_port);
+}
+
+static struct led_classdev qube_bar_led = {
+   .name   = qube-bar-led,
+   .brightness = LED_FULL,
+   .brightness_set = qube_bar_led_set,
+   .default_trigger= ide-disk,
+};
+
+static int __devinit cobalt_qube_led_probe(struct platform_device *pdev)
+{
+   struct resource *res;
+   int retval;
+
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   if (!res)
+   return -EBUSY;
+
+   led_port = ioremap(res-start, res-end - res-start + 1);
+   if (!led_port)
+   return -ENOMEM;
+
+   led_value = LED_BAR_LEFT | LED_BAR_RIGHT;
+   writeb(led_value, led_port);
+
+   retval = led_classdev_register(pdev-dev, qube_bar_led);
+   if (retval)
+   goto err_iounmap;
+
+   return 0;
+
+err_iounmap:
+   iounmap(led_port);
+   led_port = NULL;
+
+   return retval;
+}
+
+static int __devexit cobalt_qube_led_remove(struct platform_device *pdev)
+{
+   if (led_port) {
+   iounmap(led_port);
+   led_port = NULL;
+   }
+
+   led_classdev_unregister(qube_bar_led);
+
+   return 0;
 }
 
-static struct led_classdev cobalt_led = {
-   .name = cobalt-front-led,
-   .brightness_set = cobalt_led_set,
-   .default_trigger = ide-disk,
+static struct platform_driver cobalt_qube_led_driver = {
+   .probe  = cobalt_qube_led_probe,
+   .remove = __devexit_p(cobalt_qube_led_remove),
+   .driver = {
+   .name   = Cobalt Qube LEDs,
+   .owner  = THIS_MODULE,
+   },
 };
 
-static int __init cobalt_led_init(void)
+static int __init cobalt_qube_led_init(void)
 {
-   return led_classdev_register(NULL, cobalt_led);
+   return platform_driver_register(cobalt_qube_led_driver);
 }
 
-static void __exit cobalt_led_exit(void)
+static void __exit cobalt_qube_led_exit(void)
 {
-   led_classdev_unregister(cobalt_led);
+   platform_driver_unregister(cobalt_qube_led_driver);
 }
 
-module_init(cobalt_led_init);
-module_exit(cobalt_led_exit);
+module_init(cobalt_qube_led_init);
+module_exit(cobalt_qube_led_exit);
 
 MODULE_LICENSE(GPL);
-MODULE_DESCRIPTION(Front LED support for Cobalt Server);
+MODULE_DESCRIPTION(Front LED support for Cobalt Qube);
 MODULE_AUTHOR(Florian Fainelli [EMAIL PROTECTED]);
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH][1/2] led: add Cobalt Raq LEDs support

2007-09-13 Thread Yoichi Yuasa
Add Cobalt Raq LEDs support.

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/Kconfig 
mips/drivers/leds/Kconfig
--- mips-orig/drivers/leds/Kconfig  2007-09-12 12:01:58.027251750 +0900
+++ mips/drivers/leds/Kconfig   2007-09-12 12:04:34.021000750 +0900
@@ -87,11 +87,18 @@ config LEDS_H1940
help
  This option enables support for the LEDs on the h1940.
 
-config LEDS_COBALT
-   tristate LED Support for Cobalt Server front LED
+config LEDS_COBALT_QUBE
+   tristate LED Support for Cobalt Qube front LED
depends on LEDS_CLASS  MIPS_COBALT
help
- This option enables support for the front LED on Cobalt Server
+ This option enables support for the front LEDs on Cobalt Qube/Qube2.
+
+config LEDS_COBALT_RAQ
+   bool LED Support for Cobalt Raq series
+   depends on LEDS_CLASS  MIPS_COBALT
+   select LEDS_TRIGGERS
+   help
+ This option enables support for LEDs on the Cobalt Raq series.
 
 config LEDS_GPIO
tristate LED Support for GPIO connected LEDs
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/Makefile 
mips/drivers/leds/Makefile
--- mips-orig/drivers/leds/Makefile 2007-09-12 12:01:58.035252250 +0900
+++ mips/drivers/leds/Makefile  2007-09-12 12:04:34.021000750 +0900
@@ -15,7 +15,8 @@ obj-$(CONFIG_LEDS_AMS_DELTA)  += leds-am
 obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o
 obj-$(CONFIG_LEDS_WRAP)+= leds-wrap.o
 obj-$(CONFIG_LEDS_H1940)   += leds-h1940.o
-obj-$(CONFIG_LEDS_COBALT)  += leds-cobalt.o
+obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-cobalt-qube.o
+obj-$(CONFIG_LEDS_COBALT_RAQ)  += leds-cobalt-raq.o
 obj-$(CONFIG_LEDS_GPIO)+= leds-gpio.o
 
 # LED Triggers
diff -pruN -X mips/Documentation/dontdiff 
mips-orig/drivers/leds/leds-cobalt-qube.c mips/drivers/leds/leds-cobalt-qube.c
--- mips-orig/drivers/leds/leds-cobalt-qube.c   1970-01-01 09:00:00.0 
+0900
+++ mips/drivers/leds/leds-cobalt-qube.c2007-09-12 13:29:20.088085000 
+0900
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2006 - Florian Fainelli [EMAIL PROTECTED]
+ *
+ * Control the Cobalt Qube/RaQ front LED
+ */
+
+#include linux/module.h
+#include linux/types.h
+#include linux/kernel.h
+#include linux/device.h
+#include linux/leds.h
+#include asm/mach-cobalt/cobalt.h
+
+static void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness 
brightness)
+{
+   if (brightness)
+   COBALT_LED_PORT = COBALT_LED_BAR_LEFT | COBALT_LED_BAR_RIGHT;
+   else
+   COBALT_LED_PORT = 0;
+}
+
+static struct led_classdev cobalt_led = {
+   .name = cobalt-front-led,
+   .brightness_set = cobalt_led_set,
+   .default_trigger = ide-disk,
+};
+
+static int __init cobalt_led_init(void)
+{
+   return led_classdev_register(NULL, cobalt_led);
+}
+
+static void __exit cobalt_led_exit(void)
+{
+   led_classdev_unregister(cobalt_led);
+}
+
+module_init(cobalt_led_init);
+module_exit(cobalt_led_exit);
+
+MODULE_LICENSE(GPL);
+MODULE_DESCRIPTION(Front LED support for Cobalt Server);
+MODULE_AUTHOR(Florian Fainelli [EMAIL PROTECTED]);
diff -pruN -X mips/Documentation/dontdiff 
mips-orig/drivers/leds/leds-cobalt-raq.c mips/drivers/leds/leds-cobalt-raq.c
--- mips-orig/drivers/leds/leds-cobalt-raq.c1970-01-01 09:00:00.0 
+0900
+++ mips/drivers/leds/leds-cobalt-raq.c 2007-09-12 12:04:34.021000750 +0900
@@ -0,0 +1,135 @@
+/*
+ *  Cobalt Raq/Raq2 LED driver.
+ *
+ *  Copyright (C) 2007  Yoichi Yuasa [EMAIL PROTECTED]
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+ */
+#include linux/init.h
+#include linux/ioport.h
+#include linux/leds.h
+#include linux/platform_device.h
+#include linux/spinlock.h
+#include linux/types.h
+
+#include asm/io.h
+
+#define LED_WEB0x04
+#define LED_POWER_OFF  0x08
+
+static void __iomem *led_port;
+static u8 led_value;
+DEFINE_SPINLOCK(raq_led_lock);
+
+static void raq_web_led_set(struct led_classdev *led_cdev,
+enum led_brightness brightness)
+{
+   spin_lock_irq(raq_led_lock);
+
+   if (brightness)
+   led_value |= LED_WEB;
+   else
+   led_value

Re: [PATCH][1/2] led: add Cobalt Raq LEDs support

2007-09-13 Thread Yoichi Yuasa
On Thu, 13 Sep 2007 22:32:12 +0100
Richard Purdie [EMAIL PROTECTED] wrote:

 On Thu, 2007-09-13 at 23:54 +0900, Yoichi Yuasa wrote:
  Add Cobalt Raq LEDs support.
  
  Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]
 
 Not the clearest patch I've ever seen or the most helpful patch
 description. The rename could probably be split from the additional new
 driver at least...

OK, I'll split it.

  diff -pruN -X mips/Documentation/dontdiff 
  mips-orig/drivers/leds/leds-cobalt-raq.c mips/drivers/leds/leds-cobalt-raq.c
  --- mips-orig/drivers/leds/leds-cobalt-raq.c1970-01-01 
  09:00:00.0 +0900
  +++ mips/drivers/leds/leds-cobalt-raq.c 2007-09-12 12:04:34.021000750 
  +0900
 [...]
  +static void raq_web_led_set(struct led_classdev *led_cdev,
  +enum led_brightness brightness)
  +{
  +   spin_lock_irq(raq_led_lock);
  +
  +   if (brightness)
  +   led_value |= LED_WEB;
  +   else
  +   led_value = ~LED_WEB;
  +   writeb(led_value, led_port);
  +
  +   spin_unlock_irq(raq_led_lock);
  +}
 
 The _irq spinlock variants are not safe there or in the other brightness
 set function...
 
 +static struct led_classdev raq_web_led = {
  +   .name   = raq-web-led,
  +   .brightness_set = raq_web_led_set,
  +};
  +
 [...]
  +static struct led_classdev raq_power_off_led = {
  +   .name   = raq-power-off-led,
  +   .brightness_set = raq_power_off_led_set,
  +   .default_trigger= power-off,
  +};
 
 Do these really need led in the name?
 
 What does a power-off trigger do with an LED out of interest?

It lights when the Cobalt Raq is possible to turn off power. 

 
  +static int __devexit cobalt_raq_led_remove(struct platform_device *pdev)
  +{
  +   if (led_port) {
  +   iounmap(led_port);
  +   led_port = NULL;
  +   }
  +
  +   led_classdev_unregister(raq_power_off_led);
  +   led_classdev_unregister(raq_web_led);
  +
  +   return 0;
  +}
 
 You want to unregister, then iounmap...
 
  +static int __init cobalt_raq_led_init(void)
  +{
  +   return platform_driver_register(cobalt_raq_led_driver);
  +}
  +
  +module_init(cobalt_raq_led_init);
 
 No module_exit in one driver for any particular reason?

This driver cares power-off LED.
Therefore, this driver is not tristate.

 Some of these comments also apply to you second patch. All minor tweaks
 really though :).

Thank you for your comments.

Yoichi
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH][2/3] led: add Cobalt Raq series LEDs support

2007-09-13 Thread Yoichi Yuasa
Add Cobalt Raq series LEDs support.

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/Kconfig 
mips/drivers/leds/Kconfig
--- mips-orig/drivers/leds/Kconfig  2007-09-14 13:05:27.969928000 +0900
+++ mips/drivers/leds/Kconfig   2007-09-14 13:05:39.450645500 +0900
@@ -93,6 +93,13 @@ config LEDS_COBALT_QUBE
help
  This option enables support for the front LED on Cobalt Qube series
 
+config LEDS_COBALT_RAQ
+   bool LED Support for the Cobalt Raq series
+   depends on LEDS_CLASS  MIPS_COBALT
+   select LEDS_TRIGGERS
+   help
+ This option enables support for the Cobalt Raq series LEDs.
+
 config LEDS_GPIO
tristate LED Support for GPIO connected LEDs
depends on LEDS_CLASS  GENERIC_GPIO
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/Makefile 
mips/drivers/leds/Makefile
--- mips-orig/drivers/leds/Makefile 2007-09-14 13:05:27.981928750 +0900
+++ mips/drivers/leds/Makefile  2007-09-14 13:05:39.450645500 +0900
@@ -16,6 +16,7 @@ obj-$(CONFIG_LEDS_NET48XX)+= leds-net4
 obj-$(CONFIG_LEDS_WRAP)+= leds-wrap.o
 obj-$(CONFIG_LEDS_H1940)   += leds-h1940.o
 obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-cobalt-qube.o
+obj-$(CONFIG_LEDS_COBALT_RAQ)  += leds-cobalt-raq.o
 obj-$(CONFIG_LEDS_GPIO)+= leds-gpio.o
 
 # LED Triggers
diff -pruN -X mips/Documentation/dontdiff 
mips-orig/drivers/leds/leds-cobalt-raq.c mips/drivers/leds/leds-cobalt-raq.c
--- mips-orig/drivers/leds/leds-cobalt-raq.c1970-01-01 09:00:00.0 
+0900
+++ mips/drivers/leds/leds-cobalt-raq.c 2007-09-14 13:06:03.900173500 +0900
@@ -0,0 +1,135 @@
+/*
+ *  LEDs driver for the Cobalt Raq series.
+ *
+ *  Copyright (C) 2007  Yoichi Yuasa [EMAIL PROTECTED]
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+ */
+#include linux/init.h
+#include linux/ioport.h
+#include linux/leds.h
+#include linux/platform_device.h
+#include linux/spinlock.h
+#include linux/types.h
+
+#include asm/io.h
+
+#define LED_WEB0x04
+#define LED_POWER_OFF  0x08
+
+static void __iomem *led_port;
+static u8 led_value;
+static DEFINE_SPINLOCK(led_value_lock);
+
+static void raq_web_led_set(struct led_classdev *led_cdev,
+enum led_brightness brightness)
+{
+   spin_lock_irq(led_value_lock);
+
+   if (brightness)
+   led_value |= LED_WEB;
+   else
+   led_value = ~LED_WEB;
+   writeb(led_value, led_port);
+
+   spin_unlock_irq(led_value_lock);
+}
+
+static struct led_classdev raq_web_led = {
+   .name   = raq-web,
+   .brightness_set = raq_web_led_set,
+};
+
+static void raq_power_off_led_set(struct led_classdev *led_cdev,
+  enum led_brightness brightness)
+{
+   spin_lock_irq(led_value_lock);
+
+   if (brightness)
+   led_value |= LED_POWER_OFF;
+   else
+   led_value = ~LED_POWER_OFF;
+   writeb(led_value, led_port);
+
+   spin_unlock_irq(led_value_lock);
+}
+
+static struct led_classdev raq_power_off_led = {
+   .name   = raq-power-off,
+   .brightness_set = raq_power_off_led_set,
+   .default_trigger= power-off,
+};
+
+static int __devinit cobalt_raq_led_probe(struct platform_device *pdev)
+{
+   struct resource *res;
+   int retval;
+
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   if (!res)
+   return -EBUSY;
+
+   led_port = ioremap(res-start, res-end - res-start + 1);
+   if (!led_port)
+   return -ENOMEM;
+
+   retval = led_classdev_register(pdev-dev, raq_power_off_led);
+   if (retval)
+   goto err_iounmap;
+
+   retval = led_classdev_register(pdev-dev, raq_web_led);
+   if (retval)
+   goto err_unregister;
+
+   return 0;
+
+err_unregister:
+   led_classdev_unregister(raq_power_off_led);
+
+err_iounmap:
+   iounmap(led_port);
+   led_port = NULL;
+
+   return retval;
+}
+
+static int __devexit cobalt_raq_led_remove(struct platform_device *pdev)
+{
+   led_classdev_unregister(raq_power_off_led);
+   led_classdev_unregister

[PATCH][3/3] led: update Cobalt Qube series front LED support

2007-09-13 Thread Yoichi Yuasa
Update Cobalt Qube series front LED support.

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -pruN -X mips/Documentation/dontdiff 
mips-orig/drivers/leds/leds-cobalt-qube.c mips/drivers/leds/leds-cobalt-qube.c
--- mips-orig/drivers/leds/leds-cobalt-qube.c   2007-09-14 11:16:22.397075500 
+0900
+++ mips/drivers/leds/leds-cobalt-qube.c2007-09-14 11:38:52.797470250 
+0900
@@ -3,40 +3,100 @@
  *
  * Control the Cobalt Qube series front LED
  */
-
+#include linux/init.h
+#include linux/ioport.h
+#include linux/leds.h
 #include linux/module.h
+#include linux/platform_device.h
 #include linux/types.h
-#include linux/kernel.h
-#include linux/device.h
-#include linux/leds.h
-#include asm/mach-cobalt/cobalt.h
 
-static void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness 
brightness)
+#include asm/io.h
+
+#define LED_FRONT_LEFT 0x01
+#define LED_FRONT_RIGHT0x02
+
+static void __iomem *led_port;
+static u8 led_value;
+
+static void qube_front_led_set(struct led_classdev *led_cdev,
+   enum led_brightness brightness)
 {
if (brightness)
-   COBALT_LED_PORT = COBALT_LED_BAR_LEFT | COBALT_LED_BAR_RIGHT;
+   led_value = LED_FRONT_LEFT | LED_FRONT_RIGHT;
else
-   COBALT_LED_PORT = 0;
+   led_value = ~(LED_FRONT_LEFT | LED_FRONT_RIGHT);
+   writeb(led_value, led_port);
+}
+
+static struct led_classdev qube_front_led = {
+   .name   = qube-front,
+   .brightness = LED_FULL,
+   .brightness_set = qube_front_led_set,
+   .default_trigger= ide-disk,
+};
+
+static int __devinit cobalt_qube_led_probe(struct platform_device *pdev)
+{
+   struct resource *res;
+   int retval;
+
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   if (!res)
+   return -EBUSY;
+
+   led_port = ioremap(res-start, res-end - res-start + 1);
+   if (!led_port)
+   return -ENOMEM;
+
+   led_value = LED_FRONT_LEFT | LED_FRONT_RIGHT;
+   writeb(led_value, led_port);
+
+   retval = led_classdev_register(pdev-dev, qube_front_led);
+   if (retval)
+   goto err_iounmap;
+
+   return 0;
+
+err_iounmap:
+   iounmap(led_port);
+   led_port = NULL;
+
+   return retval;
+}
+
+static int __devexit cobalt_qube_led_remove(struct platform_device *pdev)
+{
+   led_classdev_unregister(qube_front_led);
+
+   if (led_port) {
+   iounmap(led_port);
+   led_port = NULL;
+   }
+
+   return 0;
 }
 
-static struct led_classdev cobalt_led = {
-   .name = cobalt-front-led,
-   .brightness_set = cobalt_led_set,
-   .default_trigger = ide-disk,
+static struct platform_driver cobalt_qube_led_driver = {
+   .probe  = cobalt_qube_led_probe,
+   .remove = __devexit_p(cobalt_qube_led_remove),
+   .driver = {
+   .name   = Cobalt Qube LEDs,
+   .owner  = THIS_MODULE,
+   },
 };
 
-static int __init cobalt_led_init(void)
+static int __init cobalt_qube_led_init(void)
 {
-   return led_classdev_register(NULL, cobalt_led);
+   return platform_driver_register(cobalt_qube_led_driver);
 }
 
-static void __exit cobalt_led_exit(void)
+static void __exit cobalt_qube_led_exit(void)
 {
-   led_classdev_unregister(cobalt_led);
+   platform_driver_unregister(cobalt_qube_led_driver);
 }
 
-module_init(cobalt_led_init);
-module_exit(cobalt_led_exit);
+module_init(cobalt_qube_led_init);
+module_exit(cobalt_qube_led_exit);
 
 MODULE_LICENSE(GPL);
 MODULE_DESCRIPTION(Front LED support for Cobalt Qube series);
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH][1/3] led: fix machines supported by leds-cobalt

2007-09-13 Thread Yoichi Yuasa
The leds-cobalt driver only supports the Coable Qube series
(not included in Cobalt Raq series).
This patch has fixed Kconfig and renamed the driver.

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/Kconfig 
mips/drivers/leds/Kconfig
--- mips-orig/drivers/leds/Kconfig  2007-09-14 12:11:41.222575000 +0900
+++ mips/drivers/leds/Kconfig   2007-09-14 12:12:06.820174750 +0900
@@ -87,11 +87,11 @@ config LEDS_H1940
help
  This option enables support for the LEDs on the h1940.
 
-config LEDS_COBALT
-   tristate LED Support for Cobalt Server front LED
+config LEDS_COBALT_QUBE
+   tristate LED Support for the Cobalt Qube series front LED
depends on LEDS_CLASS  MIPS_COBALT
help
- This option enables support for the front LED on Cobalt Server
+ This option enables support for the front LED on Cobalt Qube series
 
 config LEDS_GPIO
tristate LED Support for GPIO connected LEDs
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/Makefile 
mips/drivers/leds/Makefile
--- mips-orig/drivers/leds/Makefile 2007-09-14 12:11:41.234575750 +0900
+++ mips/drivers/leds/Makefile  2007-09-14 12:11:23.217449750 +0900
@@ -15,7 +15,7 @@ obj-$(CONFIG_LEDS_AMS_DELTA)  += leds-am
 obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o
 obj-$(CONFIG_LEDS_WRAP)+= leds-wrap.o
 obj-$(CONFIG_LEDS_H1940)   += leds-h1940.o
-obj-$(CONFIG_LEDS_COBALT)  += leds-cobalt.o
+obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-cobalt-qube.o
 obj-$(CONFIG_LEDS_GPIO)+= leds-gpio.o
 
 # LED Triggers
diff -pruN -X mips/Documentation/dontdiff 
mips-orig/drivers/leds/leds-cobalt-qube.c mips/drivers/leds/leds-cobalt-qube.c
--- mips-orig/drivers/leds/leds-cobalt-qube.c   1970-01-01 09:00:00.0 
+0900
+++ mips/drivers/leds/leds-cobalt-qube.c2007-09-14 12:11:23.217449750 
+0900
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2006 - Florian Fainelli [EMAIL PROTECTED]
+ *
+ * Control the Cobalt Qube series front LED
+ */
+
+#include linux/module.h
+#include linux/types.h
+#include linux/kernel.h
+#include linux/device.h
+#include linux/leds.h
+#include asm/mach-cobalt/cobalt.h
+
+static void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness 
brightness)
+{
+   if (brightness)
+   COBALT_LED_PORT = COBALT_LED_BAR_LEFT | COBALT_LED_BAR_RIGHT;
+   else
+   COBALT_LED_PORT = 0;
+}
+
+static struct led_classdev cobalt_led = {
+   .name = cobalt-front-led,
+   .brightness_set = cobalt_led_set,
+   .default_trigger = ide-disk,
+};
+
+static int __init cobalt_led_init(void)
+{
+   return led_classdev_register(NULL, cobalt_led);
+}
+
+static void __exit cobalt_led_exit(void)
+{
+   led_classdev_unregister(cobalt_led);
+}
+
+module_init(cobalt_led_init);
+module_exit(cobalt_led_exit);
+
+MODULE_LICENSE(GPL);
+MODULE_DESCRIPTION(Front LED support for Cobalt Qube series);
+MODULE_AUTHOR(Florian Fainelli [EMAIL PROTECTED]);
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/leds/leds-cobalt.c 
mips/drivers/leds/leds-cobalt.c
--- mips-orig/drivers/leds/leds-cobalt.c2007-09-14 12:11:41.258577250 
+0900
+++ mips/drivers/leds/leds-cobalt.c 1970-01-01 09:00:00.0 +0900
@@ -1,43 +0,0 @@
-/*
- * Copyright 2006 - Florian Fainelli [EMAIL PROTECTED]
- *
- * Control the Cobalt Qube/RaQ front LED
- */
-
-#include linux/module.h
-#include linux/types.h
-#include linux/kernel.h
-#include linux/device.h
-#include linux/leds.h
-#include asm/mach-cobalt/cobalt.h
-
-static void cobalt_led_set(struct led_classdev *led_cdev, enum led_brightness 
brightness)
-{
-   if (brightness)
-   COBALT_LED_PORT = COBALT_LED_BAR_LEFT | COBALT_LED_BAR_RIGHT;
-   else
-   COBALT_LED_PORT = 0;
-}
-
-static struct led_classdev cobalt_led = {
-   .name = cobalt-front-led,
-   .brightness_set = cobalt_led_set,
-   .default_trigger = ide-disk,
-};
-
-static int __init cobalt_led_init(void)
-{
-   return led_classdev_register(NULL, cobalt_led);
-}
-
-static void __exit cobalt_led_exit(void)
-{
-   led_classdev_unregister(cobalt_led);
-}
-
-module_init(cobalt_led_init);
-module_exit(cobalt_led_exit);
-
-MODULE_LICENSE(GPL);
-MODULE_DESCRIPTION(Front LED support for Cobalt Server);
-MODULE_AUTHOR(Florian Fainelli [EMAIL PROTECTED]);
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] leds: add #include to include/linux/leds.h for rwlock_t

2007-09-11 Thread Yoichi Yuasa
On Mon, 10 Sep 2007 22:04:23 -0700
Andrew Morton <[EMAIL PROTECTED]> wrote:

> On Tue, 4 Sep 2007 16:23:45 +0900 Yoichi Yuasa <[EMAIL PROTECTED]> wrote:
> 
> > 
> > This patch has added #include  to 
> > include/linux/leds.h for rwlock_t.
> > 
> > Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>
> > 
> > diff -pruN -X generic/Documentation/dontdiff 
> > generic-orig/include/linux/leds.h generic/include/linux/leds.h
> > --- generic-orig/include/linux/leds.h   2007-09-04 14:59:51.334686250 
> > +0900
> > +++ generic/include/linux/leds.h2007-09-04 14:56:10.676896000 +0900
> > @@ -13,6 +13,7 @@
> >  #define __LINUX_LEDS_H_INCLUDED
> >  
> >  #include 
> > +#include 
> >  
> >  struct device;
> >  /*
> 
> I think spinlock_types.h is more an internal implementation detail, and
> that leds.h should be including plain old .  Does that
> change also fix whatever build error you were seeing?

Yes it does.

Yoichi

---

This patch has added #include  to include/linux/leds.h for 
rwlock_t.

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -pruN -X generic/Documentation/dontdiff generic-orig/include/linux/leds.h 
generic/include/linux/leds.h
--- generic-orig/include/linux/leds.h   2007-09-11 15:32:22.723667750 +0900
+++ generic/include/linux/leds.h2007-09-11 15:28:20.696542000 +0900
@@ -13,6 +13,7 @@
 #define __LINUX_LEDS_H_INCLUDED
 
 #include 
+#include 
 
 struct device;
 /*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] leds: add #include linux/spinlock_types.h to include/linux/leds.h for rwlock_t

2007-09-11 Thread Yoichi Yuasa
On Mon, 10 Sep 2007 22:04:23 -0700
Andrew Morton [EMAIL PROTECTED] wrote:

 On Tue, 4 Sep 2007 16:23:45 +0900 Yoichi Yuasa [EMAIL PROTECTED] wrote:
 
  
  This patch has added #include linux/spinlock_types.h to 
  include/linux/leds.h for rwlock_t.
  
  Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]
  
  diff -pruN -X generic/Documentation/dontdiff 
  generic-orig/include/linux/leds.h generic/include/linux/leds.h
  --- generic-orig/include/linux/leds.h   2007-09-04 14:59:51.334686250 
  +0900
  +++ generic/include/linux/leds.h2007-09-04 14:56:10.676896000 +0900
  @@ -13,6 +13,7 @@
   #define __LINUX_LEDS_H_INCLUDED
   
   #include linux/list.h
  +#include linux/spinlock_types.h
   
   struct device;
   /*
 
 I think spinlock_types.h is more an internal implementation detail, and
 that leds.h should be including plain old linux/spinlock.h.  Does that
 change also fix whatever build error you were seeing?

Yes it does.

Yoichi

---

This patch has added #include linux/spinlock.h to include/linux/leds.h for 
rwlock_t.

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -pruN -X generic/Documentation/dontdiff generic-orig/include/linux/leds.h 
generic/include/linux/leds.h
--- generic-orig/include/linux/leds.h   2007-09-11 15:32:22.723667750 +0900
+++ generic/include/linux/leds.h2007-09-11 15:28:20.696542000 +0900
@@ -13,6 +13,7 @@
 #define __LINUX_LEDS_H_INCLUDED
 
 #include linux/list.h
+#include linux/spinlock.h
 
 struct device;
 /*
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] leds: add #include to include/linux/leds.h for rwlock_t

2007-09-04 Thread Yoichi Yuasa

This patch has added #include  to include/linux/leds.h 
for rwlock_t.

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -pruN -X generic/Documentation/dontdiff generic-orig/include/linux/leds.h 
generic/include/linux/leds.h
--- generic-orig/include/linux/leds.h   2007-09-04 14:59:51.334686250 +0900
+++ generic/include/linux/leds.h2007-09-04 14:56:10.676896000 +0900
@@ -13,6 +13,7 @@
 #define __LINUX_LEDS_H_INCLUDED
 
 #include 
+#include 
 
 struct device;
 /*

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


[PATCH] leds: add #include linux/spinlock_types.h to include/linux/leds.h for rwlock_t

2007-09-04 Thread Yoichi Yuasa

This patch has added #include linux/spinlock_types.h to include/linux/leds.h 
for rwlock_t.

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -pruN -X generic/Documentation/dontdiff generic-orig/include/linux/leds.h 
generic/include/linux/leds.h
--- generic-orig/include/linux/leds.h   2007-09-04 14:59:51.334686250 +0900
+++ generic/include/linux/leds.h2007-09-04 14:56:10.676896000 +0900
@@ -13,6 +13,7 @@
 #define __LINUX_LEDS_H_INCLUDED
 
 #include linux/list.h
+#include linux/spinlock_types.h
 
 struct device;
 /*

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH][resend] fix IDE legacy mode resources

2007-08-23 Thread Yoichi Yuasa
Hi,

I got the following error on MIPS Cobalt.

PCI: Unable to reserve I/O region #1:[EMAIL PROTECTED] for device :00:09.1
pata_via :00:09.1: failed to request/iomap BARs for port 0 (errno=-16)
PCI: Unable to reserve I/O region #3:[EMAIL PROTECTED] for device :00:09.1
pata_via :00:09.1: failed to request/iomap BARs for port 1 (errno=-16)
pata_via :00:09.1: no available native port

The legacy mode IDE resources set the following order. 

pci_setup_device()
Legacy mode ATA controllers have fixed addresses.
IDE resources: 0x1F0-0x1F7, 0x3F6, 0x170-0x177, 0x376
|
V
pcibios_fixup_bus()
MIPS Cobalt PCI bus regions have the -0x1000 offset from PCI resources.
pcibios_fixup_bus() fix PCI bus regions.
0x1F0 - 0x1000 = 0xF1F0
|
V
ata_pci_init_one()
PCI: Unable to reserve I/O region #1:[EMAIL PROTECTED] for device 
:00:09.1

In some architectures, PCI bus regions have the offset from PCI resources.
For this reason, pci_setup_device() should set PCI bus regions to 
dev->resource[]. 

Yoichi

---

Fix legacy mode IDE resources 

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -pruN -X generic/Documentation/dontdiff generic-orig/drivers/pci/probe.c 
generic/drivers/pci/probe.c
--- generic-orig/drivers/pci/probe.c2007-07-26 17:07:44.151670750 +0900
+++ generic/drivers/pci/probe.c 2007-07-26 17:25:42.227046250 +0900
@@ -744,22 +744,40 @@ static int pci_setup_device(struct pci_d
 */
if (class == PCI_CLASS_STORAGE_IDE) {
u8 progif;
+   struct pci_bus_region region;
+   struct resource resource;
pci_read_config_byte(dev, PCI_CLASS_PROG, );
if ((progif & 1) == 0) {
-   dev->resource[0].start = 0x1F0;
-   dev->resource[0].end = 0x1F7;
-   dev->resource[0].flags = LEGACY_IO_RESOURCE;
-   dev->resource[1].start = 0x3F6;
-   dev->resource[1].end = 0x3F6;
-   dev->resource[1].flags = LEGACY_IO_RESOURCE;
+   resource.start = 0x1F0;
+   resource.end = 0x1F7;
+   resource.flags = LEGACY_IO_RESOURCE;
+   pcibios_resource_to_bus(dev, , 
);
+   dev->resource[0].start = region.start;
+   dev->resource[0].end = region.end;
+   dev->resource[0].flags = resource.flags;
+   resource.start = 0x3F6;
+   resource.end = 0x3F6;
+   resource.flags = LEGACY_IO_RESOURCE;
+   pcibios_resource_to_bus(dev, , 
);
+   dev->resource[1].start = region.start;
+   dev->resource[1].end = region.end;
+   dev->resource[1].flags = resource.flags;
}
if ((progif & 4) == 0) {
-   dev->resource[2].start = 0x170;
-   dev->resource[2].end = 0x177;
-   dev->resource[2].flags = LEGACY_IO_RESOURCE;
-   dev->resource[3].start = 0x376;
-   dev->resource[3].end = 0x376;
-   dev->resource[3].flags = LEGACY_IO_RESOURCE;
+   resource.start = 0x170;
+   resource.end = 0x177;
+   resource.flags = LEGACY_IO_RESOURCE;
+   pcibios_resource_to_bus(dev, , 
);
+   dev->resource[2].start = region.start;
+   dev->resource[2].end = region.end;
+   dev->resource[2].flags = resource.flags;
+   resource.start = 0x376;
+   resource.end = 0x376;
+   resource.flags = LEGACY_IO_RESOURCE;
+   pcibios_resource_to_bus(dev, , 
);
+   dev->resource[3].start = region.start;
+   dev->resource[3].end = region.end;
+   dev->resource[3].flags = resource.flags;
}
}
break;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH][resend] fix IDE legacy mode resources

2007-08-23 Thread Yoichi Yuasa
Hi,

I got the following error on MIPS Cobalt.

PCI: Unable to reserve I/O region #1:[EMAIL PROTECTED] for device :00:09.1
pata_via :00:09.1: failed to request/iomap BARs for port 0 (errno=-16)
PCI: Unable to reserve I/O region #3:[EMAIL PROTECTED] for device :00:09.1
pata_via :00:09.1: failed to request/iomap BARs for port 1 (errno=-16)
pata_via :00:09.1: no available native port

The legacy mode IDE resources set the following order. 

pci_setup_device()
Legacy mode ATA controllers have fixed addresses.
IDE resources: 0x1F0-0x1F7, 0x3F6, 0x170-0x177, 0x376
|
V
pcibios_fixup_bus()
MIPS Cobalt PCI bus regions have the -0x1000 offset from PCI resources.
pcibios_fixup_bus() fix PCI bus regions.
0x1F0 - 0x1000 = 0xF1F0
|
V
ata_pci_init_one()
PCI: Unable to reserve I/O region #1:[EMAIL PROTECTED] for device 
:00:09.1

In some architectures, PCI bus regions have the offset from PCI resources.
For this reason, pci_setup_device() should set PCI bus regions to 
dev-resource[]. 

Yoichi

---

Fix legacy mode IDE resources 

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -pruN -X generic/Documentation/dontdiff generic-orig/drivers/pci/probe.c 
generic/drivers/pci/probe.c
--- generic-orig/drivers/pci/probe.c2007-07-26 17:07:44.151670750 +0900
+++ generic/drivers/pci/probe.c 2007-07-26 17:25:42.227046250 +0900
@@ -744,22 +744,40 @@ static int pci_setup_device(struct pci_d
 */
if (class == PCI_CLASS_STORAGE_IDE) {
u8 progif;
+   struct pci_bus_region region;
+   struct resource resource;
pci_read_config_byte(dev, PCI_CLASS_PROG, progif);
if ((progif  1) == 0) {
-   dev-resource[0].start = 0x1F0;
-   dev-resource[0].end = 0x1F7;
-   dev-resource[0].flags = LEGACY_IO_RESOURCE;
-   dev-resource[1].start = 0x3F6;
-   dev-resource[1].end = 0x3F6;
-   dev-resource[1].flags = LEGACY_IO_RESOURCE;
+   resource.start = 0x1F0;
+   resource.end = 0x1F7;
+   resource.flags = LEGACY_IO_RESOURCE;
+   pcibios_resource_to_bus(dev, region, 
resource);
+   dev-resource[0].start = region.start;
+   dev-resource[0].end = region.end;
+   dev-resource[0].flags = resource.flags;
+   resource.start = 0x3F6;
+   resource.end = 0x3F6;
+   resource.flags = LEGACY_IO_RESOURCE;
+   pcibios_resource_to_bus(dev, region, 
resource);
+   dev-resource[1].start = region.start;
+   dev-resource[1].end = region.end;
+   dev-resource[1].flags = resource.flags;
}
if ((progif  4) == 0) {
-   dev-resource[2].start = 0x170;
-   dev-resource[2].end = 0x177;
-   dev-resource[2].flags = LEGACY_IO_RESOURCE;
-   dev-resource[3].start = 0x376;
-   dev-resource[3].end = 0x376;
-   dev-resource[3].flags = LEGACY_IO_RESOURCE;
+   resource.start = 0x170;
+   resource.end = 0x177;
+   resource.flags = LEGACY_IO_RESOURCE;
+   pcibios_resource_to_bus(dev, region, 
resource);
+   dev-resource[2].start = region.start;
+   dev-resource[2].end = region.end;
+   dev-resource[2].flags = resource.flags;
+   resource.start = 0x376;
+   resource.end = 0x376;
+   resource.flags = LEGACY_IO_RESOURCE;
+   pcibios_resource_to_bus(dev, region, 
resource);
+   dev-resource[3].start = region.start;
+   dev-resource[3].end = region.end;
+   dev-resource[3].flags = resource.flags;
}
}
break;
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] fix IDE legacy mode resource

2007-08-06 Thread Yoichi Yuasa
Hello Jeff,

Do you have any comments?

On Sun, 29 Jul 2007 17:15:44 +0900
Yoichi Yuasa <[EMAIL PROTECTED]> wrote:

> On Sat, 28 Jul 2007 14:13:06 -0400
> Jeff Garzik <[EMAIL PROTECTED]> wrote:
> 
> > Yoichi Yuasa wrote:
> > > Hi,
> > > 
> > > I got the following error on MIPS Cobalt.
> > > MIPS Cobalt has the 0x1000 offset between resource and bus region. 
> > > 
> > > PCI: Unable to reserve I/O region #1:[EMAIL PROTECTED] for device 
> > > :00:09.1
> > > pata_via :00:09.1: failed to request/iomap BARs for port 0 (errno=-16)
> > > PCI: Unable to reserve I/O region #3:[EMAIL PROTECTED] for device 
> > > :00:09.1
> > > pata_via :00:09.1: failed to request/iomap BARs for port 1 (errno=-16)
> > > pata_via 0000:00:09.1: no available native port
> > > 
> > > At this point, these resources should be the bus regions.
> > > 
> > > Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>
> > 
> > I'm not sure I understand what's going on here... could you or someone 
> > provide additional explanation as to why this is a fix?
> 
> The legacy mode IDE resources set the following order. 
> 
> pci_setup_device()
> Legacy mode ATA controllers have fixed addresses.
> IDE resources: 0x1F0-0x1F7, 0x3F6, 0x170-0x177, 0x376
> |
> V
> pcibios_fixup_bus()
> MIPS Cobalt PCI bus have the -0x1000 offset from PCI resources.
> pcibios_fixup_bus() fix PCI bus regions.
> 0x1F0 - 0x1000 = 0xF1F0
> |
> V
> ata_pci_init_one()
> PCI: Unable to reserve I/O region #1:[EMAIL PROTECTED] for device 
> :00:09.1
> 
> In some architectures, PCI bus have the offset from PCI resource.
> They are adjusted by pcibios_fixup_bus().
> 
> For this reason, pci_setup_device() should set PCI bus regions. 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] fix IDE legacy mode resource

2007-08-06 Thread Yoichi Yuasa
Hello Jeff,

Do you have any comments?

On Sun, 29 Jul 2007 17:15:44 +0900
Yoichi Yuasa [EMAIL PROTECTED] wrote:

 On Sat, 28 Jul 2007 14:13:06 -0400
 Jeff Garzik [EMAIL PROTECTED] wrote:
 
  Yoichi Yuasa wrote:
   Hi,
   
   I got the following error on MIPS Cobalt.
   MIPS Cobalt has the 0x1000 offset between resource and bus region. 
   
   PCI: Unable to reserve I/O region #1:[EMAIL PROTECTED] for device 
   :00:09.1
   pata_via :00:09.1: failed to request/iomap BARs for port 0 (errno=-16)
   PCI: Unable to reserve I/O region #3:[EMAIL PROTECTED] for device 
   :00:09.1
   pata_via :00:09.1: failed to request/iomap BARs for port 1 (errno=-16)
   pata_via :00:09.1: no available native port
   
   At this point, these resources should be the bus regions.
   
   Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]
  
  I'm not sure I understand what's going on here... could you or someone 
  provide additional explanation as to why this is a fix?
 
 The legacy mode IDE resources set the following order. 
 
 pci_setup_device()
 Legacy mode ATA controllers have fixed addresses.
 IDE resources: 0x1F0-0x1F7, 0x3F6, 0x170-0x177, 0x376
 |
 V
 pcibios_fixup_bus()
 MIPS Cobalt PCI bus have the -0x1000 offset from PCI resources.
 pcibios_fixup_bus() fix PCI bus regions.
 0x1F0 - 0x1000 = 0xF1F0
 |
 V
 ata_pci_init_one()
 PCI: Unable to reserve I/O region #1:[EMAIL PROTECTED] for device 
 :00:09.1
 
 In some architectures, PCI bus have the offset from PCI resource.
 They are adjusted by pcibios_fixup_bus().
 
 For this reason, pci_setup_device() should set PCI bus regions. 
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] fix IDE legacy mode resource

2007-07-29 Thread Yoichi Yuasa
On Sat, 28 Jul 2007 14:13:06 -0400
Jeff Garzik <[EMAIL PROTECTED]> wrote:

> Yoichi Yuasa wrote:
> > Hi,
> > 
> > I got the following error on MIPS Cobalt.
> > MIPS Cobalt has the 0x1000 offset between resource and bus region. 
> > 
> > PCI: Unable to reserve I/O region #1:[EMAIL PROTECTED] for device 
> > :00:09.1
> > pata_via :00:09.1: failed to request/iomap BARs for port 0 (errno=-16)
> > PCI: Unable to reserve I/O region #3:[EMAIL PROTECTED] for device 
> > :00:09.1
> > pata_via :00:09.1: failed to request/iomap BARs for port 1 (errno=-16)
> > pata_via :00:09.1: no available native port
> > 
> > At this point, these resources should be the bus regions.
> > 
> > Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>
> 
> I'm not sure I understand what's going on here... could you or someone 
> provide additional explanation as to why this is a fix?

The legacy mode IDE resources set the following order. 

pci_setup_device()
Legacy mode ATA controllers have fixed addresses.
IDE resources: 0x1F0-0x1F7, 0x3F6, 0x170-0x177, 0x376
|
V
pcibios_fixup_bus()
MIPS Cobalt PCI bus have the -0x1000 offset from PCI resources.
pcibios_fixup_bus() fix PCI bus regions.
0x1F0 - 0x1000 = 0xF1F0
|
V
ata_pci_init_one()
PCI: Unable to reserve I/O region #1:[EMAIL PROTECTED] for device 
:00:09.1

In some architectures, PCI bus have the offset from PCI resource.
They are adjusted by pcibios_fixup_bus().

For this reason, pci_setup_device() should set PCI bus regions. 

Yoichi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] fix IDE legacy mode resource

2007-07-29 Thread Yoichi Yuasa
On Sat, 28 Jul 2007 14:13:06 -0400
Jeff Garzik [EMAIL PROTECTED] wrote:

 Yoichi Yuasa wrote:
  Hi,
  
  I got the following error on MIPS Cobalt.
  MIPS Cobalt has the 0x1000 offset between resource and bus region. 
  
  PCI: Unable to reserve I/O region #1:[EMAIL PROTECTED] for device 
  :00:09.1
  pata_via :00:09.1: failed to request/iomap BARs for port 0 (errno=-16)
  PCI: Unable to reserve I/O region #3:[EMAIL PROTECTED] for device 
  :00:09.1
  pata_via :00:09.1: failed to request/iomap BARs for port 1 (errno=-16)
  pata_via :00:09.1: no available native port
  
  At this point, these resources should be the bus regions.
  
  Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]
 
 I'm not sure I understand what's going on here... could you or someone 
 provide additional explanation as to why this is a fix?

The legacy mode IDE resources set the following order. 

pci_setup_device()
Legacy mode ATA controllers have fixed addresses.
IDE resources: 0x1F0-0x1F7, 0x3F6, 0x170-0x177, 0x376
|
V
pcibios_fixup_bus()
MIPS Cobalt PCI bus have the -0x1000 offset from PCI resources.
pcibios_fixup_bus() fix PCI bus regions.
0x1F0 - 0x1000 = 0xF1F0
|
V
ata_pci_init_one()
PCI: Unable to reserve I/O region #1:[EMAIL PROTECTED] for device 
:00:09.1

In some architectures, PCI bus have the offset from PCI resource.
They are adjusted by pcibios_fixup_bus().

For this reason, pci_setup_device() should set PCI bus regions. 

Yoichi
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] fix IDE legacy mode resource

2007-07-28 Thread Yoichi Yuasa
Hi,

I got the following error on MIPS Cobalt.
MIPS Cobalt has the 0x1000 offset between resource and bus region. 

PCI: Unable to reserve I/O region #1:[EMAIL PROTECTED] for device :00:09.1
pata_via :00:09.1: failed to request/iomap BARs for port 0 (errno=-16)
PCI: Unable to reserve I/O region #3:[EMAIL PROTECTED] for device :00:09.1
pata_via :00:09.1: failed to request/iomap BARs for port 1 (errno=-16)
pata_via :00:09.1: no available native port

At this point, these resources should be the bus regions.

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -pruN -X generic/Documentation/dontdiff generic-orig/drivers/pci/probe.c 
generic/drivers/pci/probe.c
--- generic-orig/drivers/pci/probe.c2007-07-26 17:07:44.151670750 +0900
+++ generic/drivers/pci/probe.c 2007-07-26 17:25:42.227046250 +0900
@@ -744,22 +744,40 @@ static int pci_setup_device(struct pci_d
 */
if (class == PCI_CLASS_STORAGE_IDE) {
u8 progif;
+   struct pci_bus_region region;
+   struct resource resource;
pci_read_config_byte(dev, PCI_CLASS_PROG, );
if ((progif & 1) == 0) {
-   dev->resource[0].start = 0x1F0;
-   dev->resource[0].end = 0x1F7;
-   dev->resource[0].flags = LEGACY_IO_RESOURCE;
-   dev->resource[1].start = 0x3F6;
-   dev->resource[1].end = 0x3F6;
-   dev->resource[1].flags = LEGACY_IO_RESOURCE;
+   resource.start = 0x1F0;
+   resource.end = 0x1F7;
+   resource.flags = LEGACY_IO_RESOURCE;
+   pcibios_resource_to_bus(dev, , 
);
+   dev->resource[0].start = region.start;
+   dev->resource[0].end = region.end;
+   dev->resource[0].flags = resource.flags;
+   resource.start = 0x3F6;
+   resource.end = 0x3F6;
+   resource.flags = LEGACY_IO_RESOURCE;
+   pcibios_resource_to_bus(dev, , 
);
+   dev->resource[1].start = region.start;
+   dev->resource[1].end = region.end;
+   dev->resource[1].flags = resource.flags;
}
if ((progif & 4) == 0) {
-   dev->resource[2].start = 0x170;
-   dev->resource[2].end = 0x177;
-   dev->resource[2].flags = LEGACY_IO_RESOURCE;
-   dev->resource[3].start = 0x376;
-   dev->resource[3].end = 0x376;
-   dev->resource[3].flags = LEGACY_IO_RESOURCE;
+   resource.start = 0x170;
+   resource.end = 0x177;
+   resource.flags = LEGACY_IO_RESOURCE;
+   pcibios_resource_to_bus(dev, , 
);
+   dev->resource[2].start = region.start;
+   dev->resource[2].end = region.end;
+   dev->resource[2].flags = resource.flags;
+   resource.start = 0x376;
+   resource.end = 0x376;
+   resource.flags = LEGACY_IO_RESOURCE;
+   pcibios_resource_to_bus(dev, , 
);
+   dev->resource[3].start = region.start;
+   dev->resource[3].end = region.end;
+   dev->resource[3].flags = resource.flags;
}
}
break;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] fix IDE legacy mode resource

2007-07-28 Thread Yoichi Yuasa
Hi,

I got the following error on MIPS Cobalt.
MIPS Cobalt has the 0x1000 offset between resource and bus region. 

PCI: Unable to reserve I/O region #1:[EMAIL PROTECTED] for device :00:09.1
pata_via :00:09.1: failed to request/iomap BARs for port 0 (errno=-16)
PCI: Unable to reserve I/O region #3:[EMAIL PROTECTED] for device :00:09.1
pata_via :00:09.1: failed to request/iomap BARs for port 1 (errno=-16)
pata_via :00:09.1: no available native port

At this point, these resources should be the bus regions.

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -pruN -X generic/Documentation/dontdiff generic-orig/drivers/pci/probe.c 
generic/drivers/pci/probe.c
--- generic-orig/drivers/pci/probe.c2007-07-26 17:07:44.151670750 +0900
+++ generic/drivers/pci/probe.c 2007-07-26 17:25:42.227046250 +0900
@@ -744,22 +744,40 @@ static int pci_setup_device(struct pci_d
 */
if (class == PCI_CLASS_STORAGE_IDE) {
u8 progif;
+   struct pci_bus_region region;
+   struct resource resource;
pci_read_config_byte(dev, PCI_CLASS_PROG, progif);
if ((progif  1) == 0) {
-   dev-resource[0].start = 0x1F0;
-   dev-resource[0].end = 0x1F7;
-   dev-resource[0].flags = LEGACY_IO_RESOURCE;
-   dev-resource[1].start = 0x3F6;
-   dev-resource[1].end = 0x3F6;
-   dev-resource[1].flags = LEGACY_IO_RESOURCE;
+   resource.start = 0x1F0;
+   resource.end = 0x1F7;
+   resource.flags = LEGACY_IO_RESOURCE;
+   pcibios_resource_to_bus(dev, region, 
resource);
+   dev-resource[0].start = region.start;
+   dev-resource[0].end = region.end;
+   dev-resource[0].flags = resource.flags;
+   resource.start = 0x3F6;
+   resource.end = 0x3F6;
+   resource.flags = LEGACY_IO_RESOURCE;
+   pcibios_resource_to_bus(dev, region, 
resource);
+   dev-resource[1].start = region.start;
+   dev-resource[1].end = region.end;
+   dev-resource[1].flags = resource.flags;
}
if ((progif  4) == 0) {
-   dev-resource[2].start = 0x170;
-   dev-resource[2].end = 0x177;
-   dev-resource[2].flags = LEGACY_IO_RESOURCE;
-   dev-resource[3].start = 0x376;
-   dev-resource[3].end = 0x376;
-   dev-resource[3].flags = LEGACY_IO_RESOURCE;
+   resource.start = 0x170;
+   resource.end = 0x177;
+   resource.flags = LEGACY_IO_RESOURCE;
+   pcibios_resource_to_bus(dev, region, 
resource);
+   dev-resource[2].start = region.start;
+   dev-resource[2].end = region.end;
+   dev-resource[2].flags = resource.flags;
+   resource.start = 0x376;
+   resource.end = 0x376;
+   resource.flags = LEGACY_IO_RESOURCE;
+   pcibios_resource_to_bus(dev, region, 
resource);
+   dev-resource[3].start = region.start;
+   dev-resource[3].end = region.end;
+   dev-resource[3].flags = resource.flags;
}
}
break;
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: rtc_cmos: error after first write to wakealarm

2007-06-15 Thread Yoichi Yuasa
On Fri, 15 Jun 2007 08:33:08 +0200
Tino Keitel <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I have the following strange behaviour with rtc_cmos:
> 
> $ echo 1181934240 > /sys/class/rtc/rtc0/wakealarm
> bash: echo: write error: Device or resource busy
> $ rmmod rtc_cmos
> $ modprobe rtc_cmos
> $ echo 1181934240 > /sys/class/rtc/rtc0/wakealarm
> $ echo 1181934240 > /sys/class/rtc/rtc0/wakealarm
> bash: echo: write error: Device or resource busy
> $

If the alarm has already been enabled, you cannot set the next alarm. 
You should disable first.

Yoichi

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


Re: rtc_cmos: error after first write to wakealarm

2007-06-15 Thread Yoichi Yuasa
On Fri, 15 Jun 2007 08:33:08 +0200
Tino Keitel [EMAIL PROTECTED] wrote:

 Hi,
 
 I have the following strange behaviour with rtc_cmos:
 
 $ echo 1181934240  /sys/class/rtc/rtc0/wakealarm
 bash: echo: write error: Device or resource busy
 $ rmmod rtc_cmos
 $ modprobe rtc_cmos
 $ echo 1181934240  /sys/class/rtc/rtc0/wakealarm
 $ echo 1181934240  /sys/class/rtc/rtc0/wakealarm
 bash: echo: write error: Device or resource busy
 $

If the alarm has already been enabled, you cannot set the next alarm. 
You should disable first.

Yoichi

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] rename TANBAC TB0219 config

2007-04-25 Thread Yoichi Yuasa
Hi

This patch has renamed config of TANBAC TB0219 GPIO support.
It changed to an appropriate name. 

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -pruN -X generic/Documentation/dontdiff generic-orig/drivers/char/Kconfig 
generic/drivers/char/Kconfig
--- generic-orig/drivers/char/Kconfig   2007-04-26 13:45:27.225157000 +0900
+++ generic/drivers/char/Kconfig2007-04-26 13:58:56.663743750 +0900
@@ -905,8 +905,8 @@ config SONYPI
  To compile this driver as a module, choose M here: the
  module will be called sonypi.
 
-config TANBAC_TB0219
-   tristate "TANBAC TB0219 base board support"
+config GPIO_TB0219
+   tristate "TANBAC TB0219 GPIO support"
depends on TANBAC_TB022X
select GPIO_VR41XX
 
diff -pruN -X generic/Documentation/dontdiff generic-orig/drivers/char/Makefile 
generic/drivers/char/Makefile
--- generic-orig/drivers/char/Makefile  2007-04-26 13:45:27.345164500 +0900
+++ generic/drivers/char/Makefile   2007-04-26 13:43:30.361853500 +0900
@@ -91,7 +91,7 @@ obj-$(CONFIG_PC8736x_GPIO)+= pc8736x_gp
 obj-$(CONFIG_NSC_GPIO) += nsc_gpio.o
 obj-$(CONFIG_CS5535_GPIO)  += cs5535_gpio.o
 obj-$(CONFIG_GPIO_VR41XX)  += vr41xx_giu.o
-obj-$(CONFIG_TANBAC_TB0219)+= tb0219.o
+obj-$(CONFIG_GPIO_TB0219)  += tb0219.o
 obj-$(CONFIG_TELCLOCK) += tlclk.o
 
 obj-$(CONFIG_WATCHDOG) += watchdog/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] rename TANBAC TB0219 config

2007-04-25 Thread Yoichi Yuasa
Hi

This patch has renamed config of TANBAC TB0219 GPIO support.
It changed to an appropriate name. 

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -pruN -X generic/Documentation/dontdiff generic-orig/drivers/char/Kconfig 
generic/drivers/char/Kconfig
--- generic-orig/drivers/char/Kconfig   2007-04-26 13:45:27.225157000 +0900
+++ generic/drivers/char/Kconfig2007-04-26 13:58:56.663743750 +0900
@@ -905,8 +905,8 @@ config SONYPI
  To compile this driver as a module, choose M here: the
  module will be called sonypi.
 
-config TANBAC_TB0219
-   tristate TANBAC TB0219 base board support
+config GPIO_TB0219
+   tristate TANBAC TB0219 GPIO support
depends on TANBAC_TB022X
select GPIO_VR41XX
 
diff -pruN -X generic/Documentation/dontdiff generic-orig/drivers/char/Makefile 
generic/drivers/char/Makefile
--- generic-orig/drivers/char/Makefile  2007-04-26 13:45:27.345164500 +0900
+++ generic/drivers/char/Makefile   2007-04-26 13:43:30.361853500 +0900
@@ -91,7 +91,7 @@ obj-$(CONFIG_PC8736x_GPIO)+= pc8736x_gp
 obj-$(CONFIG_NSC_GPIO) += nsc_gpio.o
 obj-$(CONFIG_CS5535_GPIO)  += cs5535_gpio.o
 obj-$(CONFIG_GPIO_VR41XX)  += vr41xx_giu.o
-obj-$(CONFIG_TANBAC_TB0219)+= tb0219.o
+obj-$(CONFIG_GPIO_TB0219)  += tb0219.o
 obj-$(CONFIG_TELCLOCK) += tlclk.o
 
 obj-$(CONFIG_WATCHDOG) += watchdog/
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Add Cobalt button interface driver support

2007-04-05 Thread Yoichi Yuasa
Hi Dmitry,

On Wed, 4 Apr 2007 00:01:41 -0400
Dmitry Torokhov <[EMAIL PROTECTED]> wrote:

> Hi Yoichi,
> 
> Could you please try the patch below? It moves platform device creation
> code into cobalt arch code to belletr follow driver model.

It works fine.

Acked-by: Yoichi Yuasa <[EMAIL PROTECTED]>

Yoichi

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


Re: [PATCH] Add Cobalt button interface driver support

2007-04-05 Thread Yoichi Yuasa
Hi Dmitry,

On Wed, 4 Apr 2007 00:01:41 -0400
Dmitry Torokhov [EMAIL PROTECTED] wrote:

 Hi Yoichi,
 
 Could you please try the patch below? It moves platform device creation
 code into cobalt arch code to belletr follow driver model.

It works fine.

Acked-by: Yoichi Yuasa [EMAIL PROTECTED]

Yoichi

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Fixed build error on zs serial driver

2007-04-04 Thread Yoichi Yuasa
Hi,

This patch has fixed build error on zs serial driver.

drivers/tc/zs.c:73:24: error: asm/dec/tc.h: No such file or directory
make[2]: *** [drivers/tc/zs.o] Error 1

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/tc/zs.c 
mips/drivers/tc/zs.c
--- mips-orig/drivers/tc/zs.c   2007-04-04 15:01:22.952507000 +0900
+++ mips/drivers/tc/zs.c2007-04-04 15:15:37.861935500 +0900
@@ -70,7 +70,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #ifdef CONFIG_KGDB
 #include 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Fixed build error on zs serial driver

2007-04-04 Thread Yoichi Yuasa
Hi,

This patch has fixed build error on zs serial driver.

drivers/tc/zs.c:73:24: error: asm/dec/tc.h: No such file or directory
make[2]: *** [drivers/tc/zs.o] Error 1

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/tc/zs.c 
mips/drivers/tc/zs.c
--- mips-orig/drivers/tc/zs.c   2007-04-04 15:01:22.952507000 +0900
+++ mips/drivers/tc/zs.c2007-04-04 15:15:37.861935500 +0900
@@ -70,7 +70,6 @@
 #include asm/dec/machtype.h
 #include asm/dec/serial.h
 #include asm/dec/system.h
-#include asm/dec/tc.h
 
 #ifdef CONFIG_KGDB
 #include asm/kgdb.h
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] fix memory leak dma_declare_coherent_memory()

2007-02-23 Thread Yoichi Yuasa
Hi,

This patch has fixed memory leak in dma_declare_coherent_memory().
When it goes to free1_out, dev->dma_mem has not been freed.

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -pruN -X generic/Documentation/dontdiff 
generic-orig/arch/cris/arch-v32/drivers/pci/dma.c 
generic/arch/cris/arch-v32/drivers/pci/dma.c
--- generic-orig/arch/cris/arch-v32/drivers/pci/dma.c   2007-02-23 
19:06:28.355418750 +0900
+++ generic/arch/cris/arch-v32/drivers/pci/dma.c2007-02-23 
19:08:43.311853000 +0900
@@ -111,7 +111,7 @@ int dma_declare_coherent_memory(struct d
return DMA_MEMORY_IO;
 
  free1_out:
-   kfree(dev->dma_mem->bitmap);
+   kfree(dev->dma_mem);
  out:
return 0;
 }
diff -pruN -X generic/Documentation/dontdiff 
generic-orig/arch/i386/kernel/pci-dma.c generic/arch/i386/kernel/pci-dma.c
--- generic-orig/arch/i386/kernel/pci-dma.c 2007-02-23 19:06:30.183533000 
+0900
+++ generic/arch/i386/kernel/pci-dma.c  2007-02-23 19:07:28.475176000 +0900
@@ -110,7 +110,7 @@ int dma_declare_coherent_memory(struct d
return DMA_MEMORY_IO;
 
  free1_out:
-   kfree(dev->dma_mem->bitmap);
+   kfree(dev->dma_mem);
  out:
if (mem_base)
iounmap(mem_base);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] fix memory leak dma_declare_coherent_memory()

2007-02-23 Thread Yoichi Yuasa
Hi,

This patch has fixed memory leak in dma_declare_coherent_memory().
When it goes to free1_out, dev-dma_mem has not been freed.

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -pruN -X generic/Documentation/dontdiff 
generic-orig/arch/cris/arch-v32/drivers/pci/dma.c 
generic/arch/cris/arch-v32/drivers/pci/dma.c
--- generic-orig/arch/cris/arch-v32/drivers/pci/dma.c   2007-02-23 
19:06:28.355418750 +0900
+++ generic/arch/cris/arch-v32/drivers/pci/dma.c2007-02-23 
19:08:43.311853000 +0900
@@ -111,7 +111,7 @@ int dma_declare_coherent_memory(struct d
return DMA_MEMORY_IO;
 
  free1_out:
-   kfree(dev-dma_mem-bitmap);
+   kfree(dev-dma_mem);
  out:
return 0;
 }
diff -pruN -X generic/Documentation/dontdiff 
generic-orig/arch/i386/kernel/pci-dma.c generic/arch/i386/kernel/pci-dma.c
--- generic-orig/arch/i386/kernel/pci-dma.c 2007-02-23 19:06:30.183533000 
+0900
+++ generic/arch/i386/kernel/pci-dma.c  2007-02-23 19:07:28.475176000 +0900
@@ -110,7 +110,7 @@ int dma_declare_coherent_memory(struct d
return DMA_MEMORY_IO;
 
  free1_out:
-   kfree(dev-dma_mem-bitmap);
+   kfree(dev-dma_mem);
  out:
if (mem_base)
iounmap(mem_base);
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Add Cobalt button interface driver support

2007-02-16 Thread Yoichi Yuasa
On Fri, 16 Feb 2007 10:15:11 -0500
"Dmitry Torokhov" <[EMAIL PROTECTED]> wrote:

> On 2/16/07, Yoichi Yuasa <[EMAIL PROTECTED]> wrote:
> > +
> > +static int cobalt_buttons_open(struct inode *inode, struct file *file)
> > +{
> > +   buttons_timer.expires = jiffies + 
> > msecs_to_jiffies(BUTTONS_POLL_INTERVAL);
> > +   add_timer(_timer);
> > +
> > +   return nonseekable_open(inode, file);
> > +
> > +}
> 
> Hi,
> 
> I am sorry, I was not clear enough - when I was talking about adding
> cobalt_buttons_open/close I was not asking you to add a misc device to
> the driver. I was talking about setting up open() and close() methods
> in input_dev structure. These methods are called by input core when
> first (or last) user opens or closes one of input interfaces, such as
> /dev/input/eventX, /dev/input/jsX, etc and so it is naturally to
> start/stop polling device from these functions.
> 
> Does this make sense?

make sense.
updated my patch.

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -pruN -X cobalt-buttons/Documentation/dontdiff 
cobalt-buttons-orig/drivers/input/misc/Kconfig 
cobalt-buttons/drivers/input/misc/Kconfig
--- cobalt-buttons-orig/drivers/input/misc/Kconfig  2007-02-14 
15:35:30.566862000 +0900
+++ cobalt-buttons/drivers/input/misc/Kconfig   2007-02-15 17:20:28.721985250 
+0900
@@ -89,4 +89,10 @@ config HP_SDC_RTC
  Say Y here if you want to support the built-in real time clock
  of the HP SDC controller.
 
+config INPUT_COBALT_BTNS
+   tristate "Cobalt button interface"   
+   depends on MIPS_COBALT
+   help
+ Say Y here if you want to support MIPS Cobalt button interface.
+
 endif
diff -pruN -X cobalt-buttons/Documentation/dontdiff 
cobalt-buttons-orig/drivers/input/misc/Makefile 
cobalt-buttons/drivers/input/misc/Makefile
--- cobalt-buttons-orig/drivers/input/misc/Makefile 2007-02-14 
15:35:30.566862000 +0900
+++ cobalt-buttons/drivers/input/misc/Makefile  2007-02-15 11:55:30.856042500 
+0900
@@ -12,3 +12,4 @@ obj-$(CONFIG_INPUT_WISTRON_BTNS)  += wist
 obj-$(CONFIG_INPUT_ATLAS_BTNS) += atlas_btns.o
 obj-$(CONFIG_HP_SDC_RTC)   += hp_sdc_rtc.o
 obj-$(CONFIG_INPUT_IXP4XX_BEEPER)  += ixp4xx-beeper.o
+obj-$(CONFIG_INPUT_COBALT_BTNS)+= cobalt_btns.o
diff -pruN -X cobalt-buttons/Documentation/dontdiff 
cobalt-buttons-orig/drivers/input/misc/cobalt_btns.c 
cobalt-buttons/drivers/input/misc/cobalt_btns.c
--- cobalt-buttons-orig/drivers/input/misc/cobalt_btns.c1970-01-01 
09:00:00.0 +0900
+++ cobalt-buttons/drivers/input/misc/cobalt_btns.c 2007-02-17 
01:14:33.079876500 +0900
@@ -0,0 +1,211 @@
+/*
+ *  Cobalt button interface driver.
+ *
+ *  Copyright (C) 2007  Yoichi Yuasa <[EMAIL PROTECTED]>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define BUTTONS_POLL_INTERVAL  30  /* msec */
+#define BUTTONS_COUNT_THRESHOLD3
+#define BUTTONS_STATUS_MASK0xfe00
+
+struct buttons_dev {
+   struct input_dev *input;
+   void __iomem *reg;
+};
+
+struct buttons_map {
+   uint32_tmask;
+   int keycode;
+   int count;
+};
+
+static struct buttons_map buttons_map[] = {
+   { 0x0200, KEY_RESTART, },
+   { 0x0400, KEY_LEFT, },
+   { 0x0800, KEY_UP, },
+   { 0x1000, KEY_DOWN, },
+   { 0x2000, KEY_RIGHT, },
+   { 0x4000, KEY_ENTER, },
+   { 0x8000, KEY_SELECT, },
+};
+
+static struct resource cobalt_buttons_resource __initdata = {
+   .start  = 0x1d00,
+   .end= 0x1d03,
+   .flags  = IORESOURCE_MEM,
+};
+
+static struct platform_device *cobalt_buttons_device;
+
+static struct timer_list buttons_timer;
+
+static void handle_buttons(unsigned long data)
+{
+   struct buttons_map *button = buttons_map;
+   struct buttons_dev *bdev;
+   uint32_t status;
+   int i;
+
+   bdev = (struct buttons_dev *)data;
+   status = readl(bdev->reg);
+   status = ~status & BUTTONS_STATUS_MASK;
+
+   for (i

Re: [PATCH] Add Cobalt button interface driver support

2007-02-16 Thread Yoichi Yuasa
Hi,

Thank you for your comments.

On Thu, 15 Feb 2007 23:09:43 -0500
Dmitry Torokhov <[EMAIL PROTECTED]> wrote:

> On Thursday 15 February 2007 22:36, Yoichi Yuasa wrote:
> > Hi,
> > 
> > This patch adds support for the back panel buttons on Cobalt server.
> > It's tested on the Cobalt Qube2.
> > 
> 
> Hi,
> 
> Thank you for your patch. Couple of comments:
> 
> > +
> > +   button++;
> > +   }
> > +
> > +   mod_timer(_timer, jiffies + HZ / BUTTONS_POLL_FREQUENCY);
> 
> May I suggest using msecs_to_jiffies() to avoid direct computations on HZ?

OK, I updated it.

> > +
> > +   bdev->input = input;
> > +   bdev->reg = ioremap(res->start, res->end - res->start + 1);
> > +   dev_set_drvdata(>dev, bdev);
> > +
> > +   setup_timer(_timer, handle_buttons, (unsigned long)bdev);
> > +   mod_timer(_timer, jiffies + HZ / BUTTONS_POLL_FREQUENCY);
> 
> Please implement cobalt_buttons_open() and cobalt_buttons_close() methods
> and start/stop timer from there - there is no point in polling hardware
> if noone is listening to the events.

I updated it too.

> > +static int __devexit cobalt_buttons_remove(struct platform_device *pdev)
> > +{
> > +   struct device *dev = >dev;
> > +   struct buttons_dev *bdev = dev_get_drvdata(dev);
> > +
> > +   del_timer(_timer);
> 
> del_timer_sync? Is there any possibility it may run SMP?

Cobalt server doesn't support SMP. but there is no problem.
I updated it.

> > +static void __exit cobalt_buttons_exit(void)
> > +{
> > +   platform_driver_unregister(_buttons_driver);
> 
> You are not allowed to unregister statically allocated devices -
> if there are references left and your module goes away then
> these references become invalid and kernel goes boom.
> 
> Please convert to platform_device_alloc/platform_device_add.

I updated it.

> Is there a point of moving platform device creation code into
> platform-specific code? Is there a possibility of this driver
> being used elsewhere?

No it isn't. 

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/input/misc/Kconfig 
mips/drivers/input/misc/Kconfig
--- mips-orig/drivers/input/misc/Kconfig2007-02-14 15:35:30.566862000 
+0900
+++ mips/drivers/input/misc/Kconfig 2007-02-15 17:20:28.721985250 +0900
@@ -89,4 +89,10 @@ config HP_SDC_RTC
  Say Y here if you want to support the built-in real time clock
  of the HP SDC controller.
 
+config INPUT_COBALT_BTNS
+   tristate "Cobalt button interface"   
+   depends on MIPS_COBALT
+   help
+ Say Y here if you want to support MIPS Cobalt button interface.
+
 endif
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/input/misc/Makefile 
mips/drivers/input/misc/Makefile
--- mips-orig/drivers/input/misc/Makefile   2007-02-14 15:35:30.566862000 
+0900
+++ mips/drivers/input/misc/Makefile2007-02-15 11:55:30.856042500 +0900
@@ -12,3 +12,4 @@ obj-$(CONFIG_INPUT_WISTRON_BTNS)  += wist
 obj-$(CONFIG_INPUT_ATLAS_BTNS) += atlas_btns.o
 obj-$(CONFIG_HP_SDC_RTC)   += hp_sdc_rtc.o
 obj-$(CONFIG_INPUT_IXP4XX_BEEPER)  += ixp4xx-beeper.o
+obj-$(CONFIG_INPUT_COBALT_BTNS)+= cobalt_btns.o
diff -pruN -X mips/Documentation/dontdiff 
mips-orig/drivers/input/misc/cobalt_btns.c mips/drivers/input/misc/cobalt_btns.c
--- mips-orig/drivers/input/misc/cobalt_btns.c  1970-01-01 09:00:00.0 
+0900
+++ mips/drivers/input/misc/cobalt_btns.c   2007-02-16 16:09:48.857365000 
+0900
@@ -0,0 +1,233 @@
+/*
+ *  Cobalt button interface driver.
+ *
+ *  Copyright (C) 2007  Yoichi Yuasa <[EMAIL PROTECTED]>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#define BUTTONS_POLL_INTERVAL  30  /* msec */
+#define BUTTONS_COUNT_THRESHOLD3
+#define BUTTONS_STATUS_MASK0xfe00
+
+struct buttons_dev {
+   struct input_dev *input;
+   void __iomem *reg;

Re: [PATCH] Add Cobalt button interface driver support

2007-02-16 Thread Yoichi Yuasa
Hi,

Thank you for your comments.

On Thu, 15 Feb 2007 23:09:43 -0500
Dmitry Torokhov [EMAIL PROTECTED] wrote:

 On Thursday 15 February 2007 22:36, Yoichi Yuasa wrote:
  Hi,
  
  This patch adds support for the back panel buttons on Cobalt server.
  It's tested on the Cobalt Qube2.
  
 
 Hi,
 
 Thank you for your patch. Couple of comments:
 
  +
  +   button++;
  +   }
  +
  +   mod_timer(buttons_timer, jiffies + HZ / BUTTONS_POLL_FREQUENCY);
 
 May I suggest using msecs_to_jiffies() to avoid direct computations on HZ?

OK, I updated it.

  +
  +   bdev-input = input;
  +   bdev-reg = ioremap(res-start, res-end - res-start + 1);
  +   dev_set_drvdata(pdev-dev, bdev);
  +
  +   setup_timer(buttons_timer, handle_buttons, (unsigned long)bdev);
  +   mod_timer(buttons_timer, jiffies + HZ / BUTTONS_POLL_FREQUENCY);
 
 Please implement cobalt_buttons_open() and cobalt_buttons_close() methods
 and start/stop timer from there - there is no point in polling hardware
 if noone is listening to the events.

I updated it too.

  +static int __devexit cobalt_buttons_remove(struct platform_device *pdev)
  +{
  +   struct device *dev = pdev-dev;
  +   struct buttons_dev *bdev = dev_get_drvdata(dev);
  +
  +   del_timer(buttons_timer);
 
 del_timer_sync? Is there any possibility it may run SMP?

Cobalt server doesn't support SMP. but there is no problem.
I updated it.

  +static void __exit cobalt_buttons_exit(void)
  +{
  +   platform_driver_unregister(cobalt_buttons_driver);
 
 You are not allowed to unregister statically allocated devices -
 if there are references left and your module goes away then
 these references become invalid and kernel goes boom.
 
 Please convert to platform_device_alloc/platform_device_add.

I updated it.

 Is there a point of moving platform device creation code into
 platform-specific code? Is there a possibility of this driver
 being used elsewhere?

No it isn't. 

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/input/misc/Kconfig 
mips/drivers/input/misc/Kconfig
--- mips-orig/drivers/input/misc/Kconfig2007-02-14 15:35:30.566862000 
+0900
+++ mips/drivers/input/misc/Kconfig 2007-02-15 17:20:28.721985250 +0900
@@ -89,4 +89,10 @@ config HP_SDC_RTC
  Say Y here if you want to support the built-in real time clock
  of the HP SDC controller.
 
+config INPUT_COBALT_BTNS
+   tristate Cobalt button interface   
+   depends on MIPS_COBALT
+   help
+ Say Y here if you want to support MIPS Cobalt button interface.
+
 endif
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/input/misc/Makefile 
mips/drivers/input/misc/Makefile
--- mips-orig/drivers/input/misc/Makefile   2007-02-14 15:35:30.566862000 
+0900
+++ mips/drivers/input/misc/Makefile2007-02-15 11:55:30.856042500 +0900
@@ -12,3 +12,4 @@ obj-$(CONFIG_INPUT_WISTRON_BTNS)  += wist
 obj-$(CONFIG_INPUT_ATLAS_BTNS) += atlas_btns.o
 obj-$(CONFIG_HP_SDC_RTC)   += hp_sdc_rtc.o
 obj-$(CONFIG_INPUT_IXP4XX_BEEPER)  += ixp4xx-beeper.o
+obj-$(CONFIG_INPUT_COBALT_BTNS)+= cobalt_btns.o
diff -pruN -X mips/Documentation/dontdiff 
mips-orig/drivers/input/misc/cobalt_btns.c mips/drivers/input/misc/cobalt_btns.c
--- mips-orig/drivers/input/misc/cobalt_btns.c  1970-01-01 09:00:00.0 
+0900
+++ mips/drivers/input/misc/cobalt_btns.c   2007-02-16 16:09:48.857365000 
+0900
@@ -0,0 +1,233 @@
+/*
+ *  Cobalt button interface driver.
+ *
+ *  Copyright (C) 2007  Yoichi Yuasa [EMAIL PROTECTED]
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+ */
+#include linux/init.h
+#include linux/input.h
+#include linux/ioport.h
+#include linux/miscdevice.h
+#include linux/module.h
+#include linux/platform_device.h
+#include linux/jiffies.h
+#include linux/timer.h
+
+#include asm/param.h
+
+#define BUTTONS_POLL_INTERVAL  30  /* msec */
+#define BUTTONS_COUNT_THRESHOLD3
+#define BUTTONS_STATUS_MASK0xfe00
+
+struct buttons_dev {
+   struct input_dev *input;
+   void __iomem *reg;
+};
+
+struct buttons_map {
+   uint32_tmask;
+   int keycode;
+   int count;
+};
+
+static struct buttons_map buttons_map[] = {
+   { 0x0200

Re: [PATCH] Add Cobalt button interface driver support

2007-02-16 Thread Yoichi Yuasa
On Fri, 16 Feb 2007 10:15:11 -0500
Dmitry Torokhov [EMAIL PROTECTED] wrote:

 On 2/16/07, Yoichi Yuasa [EMAIL PROTECTED] wrote:
  +
  +static int cobalt_buttons_open(struct inode *inode, struct file *file)
  +{
  +   buttons_timer.expires = jiffies + 
  msecs_to_jiffies(BUTTONS_POLL_INTERVAL);
  +   add_timer(buttons_timer);
  +
  +   return nonseekable_open(inode, file);
  +
  +}
 
 Hi,
 
 I am sorry, I was not clear enough - when I was talking about adding
 cobalt_buttons_open/close I was not asking you to add a misc device to
 the driver. I was talking about setting up open() and close() methods
 in input_dev structure. These methods are called by input core when
 first (or last) user opens or closes one of input interfaces, such as
 /dev/input/eventX, /dev/input/jsX, etc and so it is naturally to
 start/stop polling device from these functions.
 
 Does this make sense?

make sense.
updated my patch.

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -pruN -X cobalt-buttons/Documentation/dontdiff 
cobalt-buttons-orig/drivers/input/misc/Kconfig 
cobalt-buttons/drivers/input/misc/Kconfig
--- cobalt-buttons-orig/drivers/input/misc/Kconfig  2007-02-14 
15:35:30.566862000 +0900
+++ cobalt-buttons/drivers/input/misc/Kconfig   2007-02-15 17:20:28.721985250 
+0900
@@ -89,4 +89,10 @@ config HP_SDC_RTC
  Say Y here if you want to support the built-in real time clock
  of the HP SDC controller.
 
+config INPUT_COBALT_BTNS
+   tristate Cobalt button interface   
+   depends on MIPS_COBALT
+   help
+ Say Y here if you want to support MIPS Cobalt button interface.
+
 endif
diff -pruN -X cobalt-buttons/Documentation/dontdiff 
cobalt-buttons-orig/drivers/input/misc/Makefile 
cobalt-buttons/drivers/input/misc/Makefile
--- cobalt-buttons-orig/drivers/input/misc/Makefile 2007-02-14 
15:35:30.566862000 +0900
+++ cobalt-buttons/drivers/input/misc/Makefile  2007-02-15 11:55:30.856042500 
+0900
@@ -12,3 +12,4 @@ obj-$(CONFIG_INPUT_WISTRON_BTNS)  += wist
 obj-$(CONFIG_INPUT_ATLAS_BTNS) += atlas_btns.o
 obj-$(CONFIG_HP_SDC_RTC)   += hp_sdc_rtc.o
 obj-$(CONFIG_INPUT_IXP4XX_BEEPER)  += ixp4xx-beeper.o
+obj-$(CONFIG_INPUT_COBALT_BTNS)+= cobalt_btns.o
diff -pruN -X cobalt-buttons/Documentation/dontdiff 
cobalt-buttons-orig/drivers/input/misc/cobalt_btns.c 
cobalt-buttons/drivers/input/misc/cobalt_btns.c
--- cobalt-buttons-orig/drivers/input/misc/cobalt_btns.c1970-01-01 
09:00:00.0 +0900
+++ cobalt-buttons/drivers/input/misc/cobalt_btns.c 2007-02-17 
01:14:33.079876500 +0900
@@ -0,0 +1,211 @@
+/*
+ *  Cobalt button interface driver.
+ *
+ *  Copyright (C) 2007  Yoichi Yuasa [EMAIL PROTECTED]
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+ */
+#include linux/init.h
+#include linux/input.h
+#include linux/ioport.h
+#include linux/module.h
+#include linux/platform_device.h
+#include linux/jiffies.h
+#include linux/timer.h
+
+#define BUTTONS_POLL_INTERVAL  30  /* msec */
+#define BUTTONS_COUNT_THRESHOLD3
+#define BUTTONS_STATUS_MASK0xfe00
+
+struct buttons_dev {
+   struct input_dev *input;
+   void __iomem *reg;
+};
+
+struct buttons_map {
+   uint32_tmask;
+   int keycode;
+   int count;
+};
+
+static struct buttons_map buttons_map[] = {
+   { 0x0200, KEY_RESTART, },
+   { 0x0400, KEY_LEFT, },
+   { 0x0800, KEY_UP, },
+   { 0x1000, KEY_DOWN, },
+   { 0x2000, KEY_RIGHT, },
+   { 0x4000, KEY_ENTER, },
+   { 0x8000, KEY_SELECT, },
+};
+
+static struct resource cobalt_buttons_resource __initdata = {
+   .start  = 0x1d00,
+   .end= 0x1d03,
+   .flags  = IORESOURCE_MEM,
+};
+
+static struct platform_device *cobalt_buttons_device;
+
+static struct timer_list buttons_timer;
+
+static void handle_buttons(unsigned long data)
+{
+   struct buttons_map *button = buttons_map;
+   struct buttons_dev *bdev;
+   uint32_t status;
+   int i;
+
+   bdev = (struct buttons_dev *)data;
+   status = readl(bdev-reg);
+   status = ~status  BUTTONS_STATUS_MASK;
+
+   for (i = 0; i  ARRAY_SIZE(buttons_map); i++) {
+   if (status  button-mask

[PATCH] Add Cobalt button interface driver support

2007-02-15 Thread Yoichi Yuasa
Hi,

This patch adds support for the back panel buttons on Cobalt server.
It's tested on the Cobalt Qube2.

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/input/misc/Kconfig 
mips/drivers/input/misc/Kconfig
--- mips-orig/drivers/input/misc/Kconfig2007-02-14 15:35:30.566862000 
+0900
+++ mips/drivers/input/misc/Kconfig 2007-02-15 17:20:28.721985250 +0900
@@ -89,4 +89,10 @@ config HP_SDC_RTC
  Say Y here if you want to support the built-in real time clock
  of the HP SDC controller.
 
+config INPUT_COBALT_BTNS
+   tristate "Cobalt button interface"   
+   depends on MIPS_COBALT
+   help
+ Say Y here if you want to support MIPS Cobalt button interface.
+
 endif
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/input/misc/Makefile 
mips/drivers/input/misc/Makefile
--- mips-orig/drivers/input/misc/Makefile   2007-02-14 15:35:30.566862000 
+0900
+++ mips/drivers/input/misc/Makefile2007-02-15 11:55:30.856042500 +0900
@@ -12,3 +12,4 @@ obj-$(CONFIG_INPUT_WISTRON_BTNS)  += wist
 obj-$(CONFIG_INPUT_ATLAS_BTNS) += atlas_btns.o
 obj-$(CONFIG_HP_SDC_RTC)   += hp_sdc_rtc.o
 obj-$(CONFIG_INPUT_IXP4XX_BEEPER)  += ixp4xx-beeper.o
+obj-$(CONFIG_INPUT_COBALT_BTNS)+= cobalt_btns.o
diff -pruN -X mips/Documentation/dontdiff 
mips-orig/drivers/input/misc/cobalt_btns.c mips/drivers/input/misc/cobalt_btns.c
--- mips-orig/drivers/input/misc/cobalt_btns.c  1970-01-01 09:00:00.0 
+0900
+++ mips/drivers/input/misc/cobalt_btns.c   2007-02-15 17:17:31.550912750 
+0900
@@ -0,0 +1,199 @@
+/*
+ *  Cobalt button interface driver.
+ *
+ *  Copyright (C) 2007  Yoichi Yuasa <[EMAIL PROTECTED]>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#define BUTTONS_POLL_FREQUENCY 30
+#define BUTTONS_COUNT_THRESHOLD3
+#define BUTTONS_STATUS_MASK0xfe00
+
+struct buttons_dev {
+   struct input_dev *input;
+   void __iomem *reg;
+};
+
+struct buttons_map {
+   uint32_tmask;
+   int keycode;
+   int count;
+};
+
+static struct buttons_map buttons_map[] = {
+   { 0x0200, KEY_RESTART, },
+   { 0x0400, KEY_LEFT, },
+   { 0x0800, KEY_UP, },
+   { 0x1000, KEY_DOWN, },
+   { 0x2000, KEY_RIGHT, },
+   { 0x4000, KEY_ENTER, },
+   { 0x8000, KEY_SELECT, },
+};
+
+static struct resource cobalt_buttons_resource = {
+   .start  = 0x1d00,
+   .end= 0x1d03,
+   .flags  = IORESOURCE_MEM,
+};
+
+static struct platform_device cobalt_buttons_device = {
+   .name   = "Cobalt buttons",
+   .num_resources  = 1,
+   .resource   = _buttons_resource,
+};
+
+static struct timer_list buttons_timer;
+
+static void handle_buttons(unsigned long data)
+{
+   struct buttons_map *button = buttons_map;
+   struct buttons_dev *bdev;
+   uint32_t status;
+   int i;
+
+   bdev = (struct buttons_dev *)data;
+   status = readl(bdev->reg);
+   status = ~status & BUTTONS_STATUS_MASK;
+
+   for (i = 0; i < ARRAY_SIZE(buttons_map); i++) {
+   if (status & button->mask) {
+   button->count++;
+   } else {
+   if (button->count >= BUTTONS_COUNT_THRESHOLD) {
+   input_report_key(bdev->input, button->keycode, 
0);
+   input_sync(bdev->input);
+   }
+   button->count = 0;
+   }
+
+   if (button->count == BUTTONS_COUNT_THRESHOLD) {
+   input_report_key(bdev->input, button->keycode, 1);
+   input_sync(bdev->input);
+   }
+
+   button++;
+   }
+
+   mod_timer(_timer, jiffies + HZ / BUTTONS_POLL_FREQUENCY);
+}
+
+static int __init cobalt_buttons_probe(struct platform_device *pdev)
+{
+   struct buttons_dev *bdev;
+   struct input_dev *input;
+   struct resource *res;
+   

[PATCH] Add Cobalt button interface driver support

2007-02-15 Thread Yoichi Yuasa
Hi,

This patch adds support for the back panel buttons on Cobalt server.
It's tested on the Cobalt Qube2.

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/input/misc/Kconfig 
mips/drivers/input/misc/Kconfig
--- mips-orig/drivers/input/misc/Kconfig2007-02-14 15:35:30.566862000 
+0900
+++ mips/drivers/input/misc/Kconfig 2007-02-15 17:20:28.721985250 +0900
@@ -89,4 +89,10 @@ config HP_SDC_RTC
  Say Y here if you want to support the built-in real time clock
  of the HP SDC controller.
 
+config INPUT_COBALT_BTNS
+   tristate Cobalt button interface   
+   depends on MIPS_COBALT
+   help
+ Say Y here if you want to support MIPS Cobalt button interface.
+
 endif
diff -pruN -X mips/Documentation/dontdiff mips-orig/drivers/input/misc/Makefile 
mips/drivers/input/misc/Makefile
--- mips-orig/drivers/input/misc/Makefile   2007-02-14 15:35:30.566862000 
+0900
+++ mips/drivers/input/misc/Makefile2007-02-15 11:55:30.856042500 +0900
@@ -12,3 +12,4 @@ obj-$(CONFIG_INPUT_WISTRON_BTNS)  += wist
 obj-$(CONFIG_INPUT_ATLAS_BTNS) += atlas_btns.o
 obj-$(CONFIG_HP_SDC_RTC)   += hp_sdc_rtc.o
 obj-$(CONFIG_INPUT_IXP4XX_BEEPER)  += ixp4xx-beeper.o
+obj-$(CONFIG_INPUT_COBALT_BTNS)+= cobalt_btns.o
diff -pruN -X mips/Documentation/dontdiff 
mips-orig/drivers/input/misc/cobalt_btns.c mips/drivers/input/misc/cobalt_btns.c
--- mips-orig/drivers/input/misc/cobalt_btns.c  1970-01-01 09:00:00.0 
+0900
+++ mips/drivers/input/misc/cobalt_btns.c   2007-02-15 17:17:31.550912750 
+0900
@@ -0,0 +1,199 @@
+/*
+ *  Cobalt button interface driver.
+ *
+ *  Copyright (C) 2007  Yoichi Yuasa [EMAIL PROTECTED]
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+ */
+#include linux/init.h
+#include linux/input.h
+#include linux/ioport.h
+#include linux/module.h
+#include linux/platform_device.h
+#include linux/jiffies.h
+#include linux/timer.h
+
+#include asm/param.h
+
+#define BUTTONS_POLL_FREQUENCY 30
+#define BUTTONS_COUNT_THRESHOLD3
+#define BUTTONS_STATUS_MASK0xfe00
+
+struct buttons_dev {
+   struct input_dev *input;
+   void __iomem *reg;
+};
+
+struct buttons_map {
+   uint32_tmask;
+   int keycode;
+   int count;
+};
+
+static struct buttons_map buttons_map[] = {
+   { 0x0200, KEY_RESTART, },
+   { 0x0400, KEY_LEFT, },
+   { 0x0800, KEY_UP, },
+   { 0x1000, KEY_DOWN, },
+   { 0x2000, KEY_RIGHT, },
+   { 0x4000, KEY_ENTER, },
+   { 0x8000, KEY_SELECT, },
+};
+
+static struct resource cobalt_buttons_resource = {
+   .start  = 0x1d00,
+   .end= 0x1d03,
+   .flags  = IORESOURCE_MEM,
+};
+
+static struct platform_device cobalt_buttons_device = {
+   .name   = Cobalt buttons,
+   .num_resources  = 1,
+   .resource   = cobalt_buttons_resource,
+};
+
+static struct timer_list buttons_timer;
+
+static void handle_buttons(unsigned long data)
+{
+   struct buttons_map *button = buttons_map;
+   struct buttons_dev *bdev;
+   uint32_t status;
+   int i;
+
+   bdev = (struct buttons_dev *)data;
+   status = readl(bdev-reg);
+   status = ~status  BUTTONS_STATUS_MASK;
+
+   for (i = 0; i  ARRAY_SIZE(buttons_map); i++) {
+   if (status  button-mask) {
+   button-count++;
+   } else {
+   if (button-count = BUTTONS_COUNT_THRESHOLD) {
+   input_report_key(bdev-input, button-keycode, 
0);
+   input_sync(bdev-input);
+   }
+   button-count = 0;
+   }
+
+   if (button-count == BUTTONS_COUNT_THRESHOLD) {
+   input_report_key(bdev-input, button-keycode, 1);
+   input_sync(bdev-input);
+   }
+
+   button++;
+   }
+
+   mod_timer(buttons_timer, jiffies + HZ / BUTTONS_POLL_FREQUENCY);
+}
+
+static int __init cobalt_buttons_probe(struct platform_device *pdev)
+{
+   struct buttons_dev *bdev;
+   struct input_dev *input;
+   struct resource *res

[PATCH] mmc: fix au1xmmc build error

2006-12-03 Thread Yoichi Yuasa
Hi,

This patch has fixed the following build error abou au1xmmc.

drivers/mmc/au1xmmc.c: In function `au1xmmc_poll_event':
drivers/mmc/au1xmmc.c:835: warning: unused variable `status'
drivers/mmc/au1xmmc.c: At top level:
drivers/mmc/au1xmmc.c:878: error: parse error before "const"
drivers/mmc/au1xmmc.c: In function `au1xmmc_probe':
drivers/mmc/au1xmmc.c:909: error: `au1xmmc_ops' undeclared (first use in this 
function)
drivers/mmc/au1xmmc.c:909: error: (Each undeclared identifier is reported only 
once
drivers/mmc/au1xmmc.c:909: error: for each function it appears in.)
drivers/mmc/au1xmmc.c: At top level:
drivers/mmc/au1xmmc.c:659: warning: 'au1xmmc_request' defined but not used
drivers/mmc/au1xmmc.c:719: warning: 'au1xmmc_set_ios' defined but not used
make[2]: *** [drivers/mmc/au1xmmc.o] Error 1
make[1]: *** [drivers/mmc] Error 2
make: *** [drivers] Error 2

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -pruN -X linux-2.6.19-rc6-mm2/Documentation/dontdiff 
linux-2.6.19-rc6-mm2-orig/drivers/mmc/au1xmmc.c 
linux-2.6.19-rc6-mm2/drivers/mmc/au1xmmc.c
--- linux-2.6.19-rc6-mm2-orig/drivers/mmc/au1xmmc.c 2006-11-29 
10:11:46.026275500 +0900
+++ linux-2.6.19-rc6-mm2/drivers/mmc/au1xmmc.c  2006-11-29 13:46:27.293077250 
+0900
@@ -875,7 +875,7 @@ static void au1xmmc_init_dma(struct au1x
host->rx_chan = rxchan;
 }
 
-struct const mmc_host_ops au1xmmc_ops = {
+static const struct mmc_host_ops au1xmmc_ops = {
.request= au1xmmc_request,
.set_ios= au1xmmc_set_ios,
 };
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mmc: fix au1xmmc build error

2006-12-03 Thread Yoichi Yuasa
Hi,

This patch has fixed the following build error abou au1xmmc.

drivers/mmc/au1xmmc.c: In function `au1xmmc_poll_event':
drivers/mmc/au1xmmc.c:835: warning: unused variable `status'
drivers/mmc/au1xmmc.c: At top level:
drivers/mmc/au1xmmc.c:878: error: parse error before const
drivers/mmc/au1xmmc.c: In function `au1xmmc_probe':
drivers/mmc/au1xmmc.c:909: error: `au1xmmc_ops' undeclared (first use in this 
function)
drivers/mmc/au1xmmc.c:909: error: (Each undeclared identifier is reported only 
once
drivers/mmc/au1xmmc.c:909: error: for each function it appears in.)
drivers/mmc/au1xmmc.c: At top level:
drivers/mmc/au1xmmc.c:659: warning: 'au1xmmc_request' defined but not used
drivers/mmc/au1xmmc.c:719: warning: 'au1xmmc_set_ios' defined but not used
make[2]: *** [drivers/mmc/au1xmmc.o] Error 1
make[1]: *** [drivers/mmc] Error 2
make: *** [drivers] Error 2

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -pruN -X linux-2.6.19-rc6-mm2/Documentation/dontdiff 
linux-2.6.19-rc6-mm2-orig/drivers/mmc/au1xmmc.c 
linux-2.6.19-rc6-mm2/drivers/mmc/au1xmmc.c
--- linux-2.6.19-rc6-mm2-orig/drivers/mmc/au1xmmc.c 2006-11-29 
10:11:46.026275500 +0900
+++ linux-2.6.19-rc6-mm2/drivers/mmc/au1xmmc.c  2006-11-29 13:46:27.293077250 
+0900
@@ -875,7 +875,7 @@ static void au1xmmc_init_dma(struct au1x
host-rx_chan = rxchan;
 }
 
-struct const mmc_host_ops au1xmmc_ops = {
+static const struct mmc_host_ops au1xmmc_ops = {
.request= au1xmmc_request,
.set_ios= au1xmmc_set_ios,
 };
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mips: add TANBAC TB0287 support

2005-09-07 Thread Yoichi Yuasa
Hi

This patch has added TANBAC TB0287 support.
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff mm1-orig/arch/mips/Kconfig mm1/arch/mips/Kconfig
--- mm1-orig/arch/mips/Kconfig  2005-09-01 21:58:37.0 +0900
+++ mm1/arch/mips/Kconfig   2005-09-01 22:57:38.0 +0900
@@ -149,6 +149,13 @@
  The TANBAC Mbase(TB0226) is a MIPS-based platform manufactured by 
TANBAC.
  Please refer to <http://www.tanbac.co.jp/> about Mbase.
 
+config TANBAC_TB0287
+   bool "Support for TANBAC Mini-ITX DIMM base(TB0287)"
+   depends on TANBAC_TB022X
+   help
+ The TANBAC Mini-ITX DIMM base(TB0287) is a MIPS-based platform 
manufactured by TANBAC.
+ Please refer to <http://www.tanbac.co.jp/> about Mini-ITX DIMM base.
+
 config VICTOR_MPC30X
bool "Support for Victor MP-C303/304"
depends on MACH_VR41XX
diff -urN -X dontdiff mm1-orig/arch/mips/configs/tb0287_defconfig 
mm1/arch/mips/configs/tb0287_defconfig
--- mm1-orig/arch/mips/configs/tb0287_defconfig 1970-01-01 09:00:00.0 
+0900
+++ mm1/arch/mips/configs/tb0287_defconfig  2005-09-01 22:58:47.0 
+0900
@@ -0,0 +1,1041 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.13-mm1
+# Thu Sep  1 22:58:34 2005
+#
+CONFIG_MIPS=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+# CONFIG_HOTPLUG is not set
+CONFIG_KOBJECT_UEVENT=y
+# CONFIG_IKCONFIG is not set
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_EMBEDDED=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SHMEM=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_KMOD=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
+
+#
+# Kernel type
+#
+CONFIG_32BIT=y
+# CONFIG_64BIT is not set
+
+#
+# Machine selection
+#
+# CONFIG_MACH_JAZZ is not set
+CONFIG_MACH_VR41XX=y
+# CONFIG_NEC_CMBVR4133 is not set
+# CONFIG_CASIO_E55 is not set
+# CONFIG_IBM_WORKPAD is not set
+CONFIG_TANBAC_TB022X=y
+# CONFIG_TANBAC_TB0226 is not set
+CONFIG_TANBAC_TB0287=y
+# CONFIG_VICTOR_MPC30X is not set
+# CONFIG_ZAO_CAPCELLA is not set
+CONFIG_PCI_VR41XX=y
+# CONFIG_VRC4173 is not set
+# CONFIG_TOSHIBA_JMR3927 is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_MACH_DECSTATION is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_LASAT is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_MIPS_SEAD is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_MOMENCO_OCELOT_G is not set
+# CONFIG_MOMENCO_OCELOT_C is not set
+# CONFIG_MOMENCO_OCELOT_3 is not set
+# CONFIG_MOMENCO_JAGUAR_ATX is not set
+# CONFIG_PMC_YOSEMITE is not set
+# CONFIG_DDB5074 is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_QEMU is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP32 is not set
+# CONFIG_SOC_AU1X00 is not set
+# CONFIG_SIBYTE_SB1xxx_SOC is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_TOSHIBA_RBTX4927 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_HAVE_DEC_LOCK=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_IRQ_CPU=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+
+#
+# CPU selection
+#
+# CONFIG_CPU_MIPS32 is not set
+# CONFIG_CPU_MIPS64 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+CONFIG_CPU_VR41XX=y
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R1 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+# CONFIG_CPU_SB1 is not set
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+# CONFIG_CPU_ADVANCED is not set
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_ARCH_FLATMEM_ENABL

[PATCH] mips: add TANBAC TB0287 support

2005-09-07 Thread Yoichi Yuasa
Hi

This patch has added TANBAC TB0287 support.
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff mm1-orig/arch/mips/Kconfig mm1/arch/mips/Kconfig
--- mm1-orig/arch/mips/Kconfig  2005-09-01 21:58:37.0 +0900
+++ mm1/arch/mips/Kconfig   2005-09-01 22:57:38.0 +0900
@@ -149,6 +149,13 @@
  The TANBAC Mbase(TB0226) is a MIPS-based platform manufactured by 
TANBAC.
  Please refer to http://www.tanbac.co.jp/ about Mbase.
 
+config TANBAC_TB0287
+   bool Support for TANBAC Mini-ITX DIMM base(TB0287)
+   depends on TANBAC_TB022X
+   help
+ The TANBAC Mini-ITX DIMM base(TB0287) is a MIPS-based platform 
manufactured by TANBAC.
+ Please refer to http://www.tanbac.co.jp/ about Mini-ITX DIMM base.
+
 config VICTOR_MPC30X
bool Support for Victor MP-C303/304
depends on MACH_VR41XX
diff -urN -X dontdiff mm1-orig/arch/mips/configs/tb0287_defconfig 
mm1/arch/mips/configs/tb0287_defconfig
--- mm1-orig/arch/mips/configs/tb0287_defconfig 1970-01-01 09:00:00.0 
+0900
+++ mm1/arch/mips/configs/tb0287_defconfig  2005-09-01 22:58:47.0 
+0900
@@ -0,0 +1,1041 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.13-mm1
+# Thu Sep  1 22:58:34 2005
+#
+CONFIG_MIPS=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+# CONFIG_HOTPLUG is not set
+CONFIG_KOBJECT_UEVENT=y
+# CONFIG_IKCONFIG is not set
+CONFIG_INITRAMFS_SOURCE=
+CONFIG_EMBEDDED=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SHMEM=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_KMOD=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
+
+#
+# Kernel type
+#
+CONFIG_32BIT=y
+# CONFIG_64BIT is not set
+
+#
+# Machine selection
+#
+# CONFIG_MACH_JAZZ is not set
+CONFIG_MACH_VR41XX=y
+# CONFIG_NEC_CMBVR4133 is not set
+# CONFIG_CASIO_E55 is not set
+# CONFIG_IBM_WORKPAD is not set
+CONFIG_TANBAC_TB022X=y
+# CONFIG_TANBAC_TB0226 is not set
+CONFIG_TANBAC_TB0287=y
+# CONFIG_VICTOR_MPC30X is not set
+# CONFIG_ZAO_CAPCELLA is not set
+CONFIG_PCI_VR41XX=y
+# CONFIG_VRC4173 is not set
+# CONFIG_TOSHIBA_JMR3927 is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_MACH_DECSTATION is not set
+# CONFIG_MIPS_EV64120 is not set
+# CONFIG_MIPS_EV96100 is not set
+# CONFIG_MIPS_IVR is not set
+# CONFIG_LASAT is not set
+# CONFIG_MIPS_ITE8172 is not set
+# CONFIG_MIPS_ATLAS is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_MIPS_SEAD is not set
+# CONFIG_MOMENCO_OCELOT is not set
+# CONFIG_MOMENCO_OCELOT_G is not set
+# CONFIG_MOMENCO_OCELOT_C is not set
+# CONFIG_MOMENCO_OCELOT_3 is not set
+# CONFIG_MOMENCO_JAGUAR_ATX is not set
+# CONFIG_PMC_YOSEMITE is not set
+# CONFIG_DDB5074 is not set
+# CONFIG_DDB5476 is not set
+# CONFIG_DDB5477 is not set
+# CONFIG_QEMU is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP32 is not set
+# CONFIG_SOC_AU1X00 is not set
+# CONFIG_SIBYTE_SB1xxx_SOC is not set
+# CONFIG_SNI_RM200_PCI is not set
+# CONFIG_TOSHIBA_RBTX4927 is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_HAVE_DEC_LOCK=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_IRQ_CPU=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+
+#
+# CPU selection
+#
+# CONFIG_CPU_MIPS32 is not set
+# CONFIG_CPU_MIPS64 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+CONFIG_CPU_VR41XX=y
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R1 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+# CONFIG_CPU_SB1 is not set
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+# CONFIG_CPU_ADVANCED is not set
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL

[PATCH] mips: remove the unused variable about futex

2005-09-02 Thread Yoichi Yuasa
Hi,

This patch has removed the unused variable about futex.
Please apply.

Yoichi

  CC  kernel/futex.o
In file included from kernel/futex.c:43:
include/asm/futex.h: In function `futex_atomic_op_inuser':
include/asm/futex.h:17: warning: unused variable `tem'


Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff mm1-orig/include/asm-mips/futex.h 
mm1/include/asm-mips/futex.h
--- mm1-orig/include/asm-mips/futex.h   2005-09-01 21:58:47.0 +0900
+++ mm1/include/asm-mips/futex.h2005-09-02 23:04:03.0 +0900
@@ -14,7 +14,7 @@
int cmp = (encoded_op >> 24) & 15;
int oparg = (encoded_op << 8) >> 20;
int cmparg = (encoded_op << 20) >> 20;
-   int oldval = 0, ret, tem;
+   int oldval = 0, ret;
if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
oparg = 1 << oparg;
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mips: remove the unused variable about futex

2005-09-02 Thread Yoichi Yuasa
Hi,

This patch has removed the unused variable about futex.
Please apply.

Yoichi

  CC  kernel/futex.o
In file included from kernel/futex.c:43:
include/asm/futex.h: In function `futex_atomic_op_inuser':
include/asm/futex.h:17: warning: unused variable `tem'


Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff mm1-orig/include/asm-mips/futex.h 
mm1/include/asm-mips/futex.h
--- mm1-orig/include/asm-mips/futex.h   2005-09-01 21:58:47.0 +0900
+++ mm1/include/asm-mips/futex.h2005-09-02 23:04:03.0 +0900
@@ -14,7 +14,7 @@
int cmp = (encoded_op  24)  15;
int oparg = (encoded_op  8)  20;
int cmparg = (encoded_op  20)  20;
-   int oldval = 0, ret, tem;
+   int oldval = 0, ret;
if (encoded_op  (FUTEX_OP_OPARG_SHIFT  28))
oparg = 1  oparg;
 
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mips: remove typedef from struct flock

2005-09-01 Thread Yoichi Yuasa
Hi,

This patch has fixed the following warning about MIPS.
Please apply.

Yoichi

  CC  arch/mips/kernel/offset.s
In file included from include/linux/fcntl.h:4,
 from include/linux/fs.h:689,
 from include/linux/mm.h:15,
 from arch/mips/kernel/offset.c:15:
include/asm/fcntl.h:53: warning: useless keyword or type name in empty 
declaration

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff mm1-orig/include/asm-mips/fcntl.h 
mm1/include/asm-mips/fcntl.h
--- mm1-orig/include/asm-mips/fcntl.h   2005-09-01 21:58:47.0 +0900
+++ mm1/include/asm-mips/fcntl.h2005-09-01 23:38:18.0 +0900
@@ -42,7 +42,7 @@
 
 #ifndef __mips64
 
-typedef struct flock {
+struct flock {
short   l_type;
short   l_whence;
__kernel_off_t l_start;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mips: remove typedef from struct flock

2005-09-01 Thread Yoichi Yuasa
Hi,

This patch has fixed the following warning about MIPS.
Please apply.

Yoichi

  CC  arch/mips/kernel/offset.s
In file included from include/linux/fcntl.h:4,
 from include/linux/fs.h:689,
 from include/linux/mm.h:15,
 from arch/mips/kernel/offset.c:15:
include/asm/fcntl.h:53: warning: useless keyword or type name in empty 
declaration

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff mm1-orig/include/asm-mips/fcntl.h 
mm1/include/asm-mips/fcntl.h
--- mm1-orig/include/asm-mips/fcntl.h   2005-09-01 21:58:47.0 +0900
+++ mm1/include/asm-mips/fcntl.h2005-09-01 23:38:18.0 +0900
@@ -42,7 +42,7 @@
 
 #ifndef __mips64
 
-typedef struct flock {
+struct flock {
short   l_type;
short   l_whence;
__kernel_off_t l_start;
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mips: remove timex.h for vr41xx

2005-08-30 Thread Yoichi Yuasa
Hi,

vr41xx doesn't need mach-vr41xx/timex.h.
This patch has removed mach-vr41xx/timex.h.

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff rc6-mm2-orig/include/asm-mips/mach-vr41xx/timex.h 
rc6-mm2/include/asm-mips/mach-vr41xx/timex.h
--- rc6-mm2-orig/include/asm-mips/mach-vr41xx/timex.h   2005-08-08 
03:18:56.0 +0900
+++ rc6-mm2/include/asm-mips/mach-vr41xx/timex.h1970-01-01 
09:00:00.0 +0900
@@ -1,18 +0,0 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2003 by Ralf Baechle
- */
-/*
- * Changes:
- *  Yoichi Yuasa <[EMAIL PROTECTED]>
- *  - CLOCK_TICK_RATE is changed into 32768 from 6144000.
- */
-#ifndef __ASM_MACH_VR41XX_TIMEX_H
-#define __ASM_MACH_VR41XX_TIMEX_H
-
-#define CLOCK_TICK_RATE32768
-
-#endif /* __ASM_MACH_VR41XX_TIMEX_H */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mips: remove timex.h for vr41xx

2005-08-30 Thread Yoichi Yuasa
Hi,

vr41xx doesn't need mach-vr41xx/timex.h.
This patch has removed mach-vr41xx/timex.h.

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff rc6-mm2-orig/include/asm-mips/mach-vr41xx/timex.h 
rc6-mm2/include/asm-mips/mach-vr41xx/timex.h
--- rc6-mm2-orig/include/asm-mips/mach-vr41xx/timex.h   2005-08-08 
03:18:56.0 +0900
+++ rc6-mm2/include/asm-mips/mach-vr41xx/timex.h1970-01-01 
09:00:00.0 +0900
@@ -1,18 +0,0 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file COPYING in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2003 by Ralf Baechle
- */
-/*
- * Changes:
- *  Yoichi Yuasa [EMAIL PROTECTED]
- *  - CLOCK_TICK_RATE is changed into 32768 from 6144000.
- */
-#ifndef __ASM_MACH_VR41XX_TIMEX_H
-#define __ASM_MACH_VR41XX_TIMEX_H
-
-#define CLOCK_TICK_RATE32768
-
-#endif /* __ASM_MACH_VR41XX_TIMEX_H */
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mips: fix build warnings

2005-08-24 Thread Yoichi Yuasa
Hi,

This patch has fixed the following warnings.

arch/mips/kernel/genex.S:250:5: warning: "CONFIG_64BIT" is not defined
arch/mips/math-emu/cp1emu.c:1128:5: warning: "__mips64" is not defined
arch/mips/math-emu/cp1emu.c:1206:5: warning: "__mips64" is not defined
arch/mips/math-emu/cp1emu.c:1270:5: warning: "__mips64" is not defined
arch/mips/math-emu/cp1emu.c:323:5: warning: "__mips64" is not defined
arch/mips/math-emu/cp1emu.c:808:5: warning: "__mips64" is not defined
arch/mips/math-emu/cp1emu.c:953:5: warning: "__mips64" is not defined
arch/mips/mm/tlbex.c:519:5: warning: "CONFIG_64BIT" is not defined
include/asm/reg.h:73:5: warning: "CONFIG_64BIT" is not defined

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff mm2-orig/arch/mips/kernel/genex.S 
mm2/arch/mips/kernel/genex.S
--- mm2-orig/arch/mips/kernel/genex.S   2005-08-24 23:04:03.0 +0900
+++ mm2/arch/mips/kernel/genex.S2005-08-24 22:31:00.0 +0900
@@ -244,10 +244,10 @@
   start with an n and gas will believe \n is ok ...  */
.macro  __BUILD_verbose nexception
LONG_L  a1, PT_EPC(sp)
-#if CONFIG_32BIT
+#ifdef CONFIG_32BIT
PRINT("Got \nexception at %08lx\012")
 #endif
-#if CONFIG_64BIT
+#ifdef CONFIG_64BIT
PRINT("Got \nexception at %016lx\012")
 #endif
.endm
diff -urN -X dontdiff mm2-orig/arch/mips/math-emu/cp1emu.c 
mm2/arch/mips/math-emu/cp1emu.c
--- mm2-orig/arch/mips/math-emu/cp1emu.c2005-08-08 03:18:56.0 
+0900
+++ mm2/arch/mips/math-emu/cp1emu.c 2005-08-24 22:50:55.0 +0900
@@ -320,7 +320,7 @@
case cop1_op:
switch (MIPSInst_RS(ir)) {
 
-#if __mips64 && !defined(SINGLE_ONLY_FPU)
+#if defined(__mips64) && !defined(SINGLE_ONLY_FPU)
case dmfc_op:
/* copregister fs -> gpr[rt] */
if (MIPSInst_RT(ir) != 0) {
@@ -805,7 +805,7 @@
ieee754dp d;
ieee754sp s;
int w;
-#if __mips64
+#ifdef __mips64
s64 l;
 #endif
} rv;   /* resulting value */
@@ -950,7 +950,7 @@
}
 #endif /* __mips >= 2 */
 
-#if __mips64 && !defined(SINGLE_ONLY_FPU)
+#if defined(__mips64) && !defined(SINGLE_ONLY_FPU)
case fcvtl_op:{
ieee754sp fs;
 
@@ -1125,7 +1125,7 @@
}
 #endif
 
-#if __mips64 && !defined(SINGLE_ONLY_FPU)
+#if defined(__mips64) && !defined(SINGLE_ONLY_FPU)
case fcvtl_op:{
ieee754dp fs;
 
@@ -1203,7 +1203,7 @@
break;
}
 
-#if __mips64 && !defined(SINGLE_ONLY_FPU)
+#if defined(__mips64) && !defined(SINGLE_ONLY_FPU)
case l_fmt:{
switch (MIPSInst_FUNC(ir)) {
case fcvts_op:
@@ -1267,7 +1267,7 @@
case w_fmt:
SITOREG(rv.w, MIPSInst_FD(ir));
break;
-#if __mips64 && !defined(SINGLE_ONLY_FPU)
+#if defined(__mips64) && !defined(SINGLE_ONLY_FPU)
case l_fmt:
DITOREG(rv.l, MIPSInst_FD(ir));
break;
diff -urN -X dontdiff mm2-orig/arch/mips/mm/tlbex.c mm2/arch/mips/mm/tlbex.c
--- mm2-orig/arch/mips/mm/tlbex.c   2005-08-24 23:04:03.0 +0900
+++ mm2/arch/mips/mm/tlbex.c2005-08-24 22:32:48.0 +0900
@@ -516,7 +516,7 @@
 
 static __init void i_LA_mostly(u32 **buf, unsigned int rs, long addr)
 {
-#if CONFIG_64BIT
+#ifdef CONFIG_64BIT
if (!in_compat_space_p(addr)) {
i_lui(buf, rs, rel_highest(addr));
if (rel_higher(addr))
diff -urN -X dontdiff mm2-orig/include/asm-mips/reg.h mm2/include/asm-mips/reg.h
--- mm2-orig/include/asm-mips/reg.h 2005-08-24 23:04:07.0 +0900
+++ mm2/include/asm-mips/reg.h  2005-08-24 22:30:38.0 +0900
@@ -70,7 +70,7 @@
 
 #endif
 
-#if CONFIG_64BIT
+#ifdef CONFIG_64BIT
 
 #define EF_R0   0
 #define EF_R1   1


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


[PATCH] mips: fix build warnings

2005-08-24 Thread Yoichi Yuasa
Hi,

This patch has fixed the following warnings.

arch/mips/kernel/genex.S:250:5: warning: CONFIG_64BIT is not defined
arch/mips/math-emu/cp1emu.c:1128:5: warning: __mips64 is not defined
arch/mips/math-emu/cp1emu.c:1206:5: warning: __mips64 is not defined
arch/mips/math-emu/cp1emu.c:1270:5: warning: __mips64 is not defined
arch/mips/math-emu/cp1emu.c:323:5: warning: __mips64 is not defined
arch/mips/math-emu/cp1emu.c:808:5: warning: __mips64 is not defined
arch/mips/math-emu/cp1emu.c:953:5: warning: __mips64 is not defined
arch/mips/mm/tlbex.c:519:5: warning: CONFIG_64BIT is not defined
include/asm/reg.h:73:5: warning: CONFIG_64BIT is not defined

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff mm2-orig/arch/mips/kernel/genex.S 
mm2/arch/mips/kernel/genex.S
--- mm2-orig/arch/mips/kernel/genex.S   2005-08-24 23:04:03.0 +0900
+++ mm2/arch/mips/kernel/genex.S2005-08-24 22:31:00.0 +0900
@@ -244,10 +244,10 @@
   start with an n and gas will believe \n is ok ...  */
.macro  __BUILD_verbose nexception
LONG_L  a1, PT_EPC(sp)
-#if CONFIG_32BIT
+#ifdef CONFIG_32BIT
PRINT(Got \nexception at %08lx\012)
 #endif
-#if CONFIG_64BIT
+#ifdef CONFIG_64BIT
PRINT(Got \nexception at %016lx\012)
 #endif
.endm
diff -urN -X dontdiff mm2-orig/arch/mips/math-emu/cp1emu.c 
mm2/arch/mips/math-emu/cp1emu.c
--- mm2-orig/arch/mips/math-emu/cp1emu.c2005-08-08 03:18:56.0 
+0900
+++ mm2/arch/mips/math-emu/cp1emu.c 2005-08-24 22:50:55.0 +0900
@@ -320,7 +320,7 @@
case cop1_op:
switch (MIPSInst_RS(ir)) {
 
-#if __mips64  !defined(SINGLE_ONLY_FPU)
+#if defined(__mips64)  !defined(SINGLE_ONLY_FPU)
case dmfc_op:
/* copregister fs - gpr[rt] */
if (MIPSInst_RT(ir) != 0) {
@@ -805,7 +805,7 @@
ieee754dp d;
ieee754sp s;
int w;
-#if __mips64
+#ifdef __mips64
s64 l;
 #endif
} rv;   /* resulting value */
@@ -950,7 +950,7 @@
}
 #endif /* __mips = 2 */
 
-#if __mips64  !defined(SINGLE_ONLY_FPU)
+#if defined(__mips64)  !defined(SINGLE_ONLY_FPU)
case fcvtl_op:{
ieee754sp fs;
 
@@ -1125,7 +1125,7 @@
}
 #endif
 
-#if __mips64  !defined(SINGLE_ONLY_FPU)
+#if defined(__mips64)  !defined(SINGLE_ONLY_FPU)
case fcvtl_op:{
ieee754dp fs;
 
@@ -1203,7 +1203,7 @@
break;
}
 
-#if __mips64  !defined(SINGLE_ONLY_FPU)
+#if defined(__mips64)  !defined(SINGLE_ONLY_FPU)
case l_fmt:{
switch (MIPSInst_FUNC(ir)) {
case fcvts_op:
@@ -1267,7 +1267,7 @@
case w_fmt:
SITOREG(rv.w, MIPSInst_FD(ir));
break;
-#if __mips64  !defined(SINGLE_ONLY_FPU)
+#if defined(__mips64)  !defined(SINGLE_ONLY_FPU)
case l_fmt:
DITOREG(rv.l, MIPSInst_FD(ir));
break;
diff -urN -X dontdiff mm2-orig/arch/mips/mm/tlbex.c mm2/arch/mips/mm/tlbex.c
--- mm2-orig/arch/mips/mm/tlbex.c   2005-08-24 23:04:03.0 +0900
+++ mm2/arch/mips/mm/tlbex.c2005-08-24 22:32:48.0 +0900
@@ -516,7 +516,7 @@
 
 static __init void i_LA_mostly(u32 **buf, unsigned int rs, long addr)
 {
-#if CONFIG_64BIT
+#ifdef CONFIG_64BIT
if (!in_compat_space_p(addr)) {
i_lui(buf, rs, rel_highest(addr));
if (rel_higher(addr))
diff -urN -X dontdiff mm2-orig/include/asm-mips/reg.h mm2/include/asm-mips/reg.h
--- mm2-orig/include/asm-mips/reg.h 2005-08-24 23:04:07.0 +0900
+++ mm2/include/asm-mips/reg.h  2005-08-24 22:30:38.0 +0900
@@ -70,7 +70,7 @@
 
 #endif
 
-#if CONFIG_64BIT
+#ifdef CONFIG_64BIT
 
 #define EF_R0   0
 #define EF_R1   1


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mips: add pcibios_bus_to_resource

2005-08-21 Thread Yoichi Yuasa
Hi,

This patch has added pcibios_bus_to_resource to MIPS.
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff mm1-orig/arch/mips/pci/pci.c mm1/arch/mips/pci/pci.c
--- mm1-orig/arch/mips/pci/pci.c2005-08-21 01:35:21.0 +0900
+++ mm1/arch/mips/pci/pci.c 2005-08-21 01:38:06.0 +0900
@@ -292,8 +292,25 @@
region->end = res->end - offset;
 }
 
+void __devinit
+pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
+   struct pci_bus_region *region)
+{
+   struct pci_controller *hose = (struct pci_controller *)dev->sysdata;
+   unsigned long offset = 0;
+
+   if (res->flags & IORESOURCE_IO)
+   offset = hose->io_offset;
+   else if (res->flags & IORESOURCE_MEM)
+   offset = hose->mem_offset;
+
+   res->start = region->start + offset;
+   res->end = region->end + offset;
+}
+
 #ifdef CONFIG_HOTPLUG
 EXPORT_SYMBOL(pcibios_resource_to_bus);
+EXPORT_SYMBOL(pcibios_bus_to_resource);
 EXPORT_SYMBOL(PCIBIOS_MIN_IO);
 EXPORT_SYMBOL(PCIBIOS_MIN_MEM);
 #endif
diff -urN -X dontdiff mm1-orig/include/asm-mips/pci.h mm1/include/asm-mips/pci.h
--- mm1-orig/include/asm-mips/pci.h 2005-08-21 01:38:19.0 +0900
+++ mm1/include/asm-mips/pci.h  2005-08-21 01:41:01.0 +0900
@@ -142,6 +142,8 @@
 
 extern void pcibios_resource_to_bus(struct pci_dev *dev,
struct pci_bus_region *region, struct resource *res);
+extern void pcibios_bus_to_resource(struct pci_dev *dev,
+   struct resource *res, struct pci_bus_region *region);
 
 #ifdef CONFIG_PCI_DOMAINS
 


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


[PATCH] mips: add pcibios_bus_to_resource

2005-08-21 Thread Yoichi Yuasa
Hi,

This patch has added pcibios_bus_to_resource to MIPS.
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff mm1-orig/arch/mips/pci/pci.c mm1/arch/mips/pci/pci.c
--- mm1-orig/arch/mips/pci/pci.c2005-08-21 01:35:21.0 +0900
+++ mm1/arch/mips/pci/pci.c 2005-08-21 01:38:06.0 +0900
@@ -292,8 +292,25 @@
region-end = res-end - offset;
 }
 
+void __devinit
+pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
+   struct pci_bus_region *region)
+{
+   struct pci_controller *hose = (struct pci_controller *)dev-sysdata;
+   unsigned long offset = 0;
+
+   if (res-flags  IORESOURCE_IO)
+   offset = hose-io_offset;
+   else if (res-flags  IORESOURCE_MEM)
+   offset = hose-mem_offset;
+
+   res-start = region-start + offset;
+   res-end = region-end + offset;
+}
+
 #ifdef CONFIG_HOTPLUG
 EXPORT_SYMBOL(pcibios_resource_to_bus);
+EXPORT_SYMBOL(pcibios_bus_to_resource);
 EXPORT_SYMBOL(PCIBIOS_MIN_IO);
 EXPORT_SYMBOL(PCIBIOS_MIN_MEM);
 #endif
diff -urN -X dontdiff mm1-orig/include/asm-mips/pci.h mm1/include/asm-mips/pci.h
--- mm1-orig/include/asm-mips/pci.h 2005-08-21 01:38:19.0 +0900
+++ mm1/include/asm-mips/pci.h  2005-08-21 01:41:01.0 +0900
@@ -142,6 +142,8 @@
 
 extern void pcibios_resource_to_bus(struct pci_dev *dev,
struct pci_bus_region *region, struct resource *res);
+extern void pcibios_bus_to_resource(struct pci_dev *dev,
+   struct resource *res, struct pci_bus_region *region);
 
 #ifdef CONFIG_PCI_DOMAINS
 


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] fix warning of TANBAC_TB0219 in drivers/char/Kconfig

2005-08-19 Thread Yoichi Yuasa
On Fri, 19 Aug 2005 20:03:26 +0200
Jesper Juhl <[EMAIL PROTECTED]> wrote:

> On 8/19/05, Andrew Morton <[EMAIL PROTECTED]> wrote:
> > 
> > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.13-rc6/2.6.13-rc6-mm1/
> > 
> 
> menuconfig complains a little :
> 
> $ make menuconfig
> scripts/kconfig/mconf arch/i386/Kconfig
> drivers/char/Kconfig:847:warning: 'select' used by config symbol
> 'TANBAC_TB0219' refer to undefined symbol 'PCI_VR41XX'
> 
> otherwise things seem to be ok here.
> 

Here is a patch for this warning fix.

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff rc6-mm1-orig/arch/mips/Kconfig rc6-mm1/arch/mips/Kconfig
--- rc6-mm1-orig/arch/mips/Kconfig  2005-08-20 08:32:28.0 +0900
+++ rc6-mm1/arch/mips/Kconfig   2005-08-20 08:41:42.0 +0900
@@ -91,8 +91,6 @@
select DMA_NONCOHERENT
select IRQ_CPU
select HW_HAS_PCI
-   select PCI
-   select PCI_VR41XX
 
 config ROCKHOPPER
bool "Support for Rockhopper baseboard"
@@ -133,8 +131,6 @@
 config TANBAC_TB0226
bool "Support for TANBAC Mbase(TB0226)"
depends on TANBAC_TB022X
-   select PCI
-   select PCI_VR41XX
select GPIO_VR41XX
help
  The TANBAC Mbase(TB0226) is a MIPS-based platform manufactured by 
TANBAC.
@@ -147,8 +143,6 @@
select DMA_NONCOHERENT
select IRQ_CPU
select HW_HAS_PCI
-   select PCI
-   select PCI_VR41XX
 
 config ZAO_CAPCELLA
bool "Support for ZAO Networks Capcella"
@@ -157,12 +151,12 @@
select DMA_NONCOHERENT
select IRQ_CPU
select HW_HAS_PCI
-   select PCI
-   select PCI_VR41XX
 
 config PCI_VR41XX
bool "Add PCI control unit support of NEC VR4100 series"
-   depends on MACH_VR41XX && PCI
+   depends on MACH_VR41XX && HW_HAS_PCI
+   default y
+   select PCI
 
 config VRC4173
tristate "Add NEC VRC4173 companion chip support"
diff -urN -X dontdiff rc6-mm1-orig/drivers/char/Kconfig 
rc6-mm1/drivers/char/Kconfig
--- rc6-mm1-orig/drivers/char/Kconfig   2005-08-20 08:32:35.0 +0900
+++ rc6-mm1/drivers/char/Kconfig2005-08-20 09:41:43.0 +0900
@@ -843,8 +843,6 @@
 config TANBAC_TB0219
tristate "TANBAC TB0219 base board support"
depends TANBAC_TB022X
-   select PCI
-   select PCI_VR41XX
 
 menu "Ftape, the floppy tape device driver"
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mips: add pcibios_select_root

2005-08-19 Thread Yoichi Yuasa
Hi,

This patch has added pcibios_select_root to MIPS.
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff mm1-orig/include/asm-mips/pci.h mm1/include/asm-mips/pci.h
--- mm1-orig/include/asm-mips/pci.h 2005-08-20 00:04:18.0 +0900
+++ mm1/include/asm-mips/pci.h  2005-08-19 23:53:04.0 +0900
@@ -167,4 +167,17 @@
 /* Do platform specific device initialization at pci_enable_device() time */
 extern int pcibios_plat_dev_init(struct pci_dev *dev);
 
+static inline struct resource *
+pcibios_select_root(struct pci_dev *pdev, struct resource *res)
+{
+   struct resource *root = NULL;
+
+   if (res->flags & IORESOURCE_IO)
+   root = _resource;
+   if (res->flags & IORESOURCE_MEM)
+   root = _resource;
+
+   return root;
+}
+
 #endif /* _ASM_PCI_H */


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


[PATCH] mips: add pcibios_select_root

2005-08-19 Thread Yoichi Yuasa
Hi,

This patch has added pcibios_select_root to MIPS.
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff mm1-orig/include/asm-mips/pci.h mm1/include/asm-mips/pci.h
--- mm1-orig/include/asm-mips/pci.h 2005-08-20 00:04:18.0 +0900
+++ mm1/include/asm-mips/pci.h  2005-08-19 23:53:04.0 +0900
@@ -167,4 +167,17 @@
 /* Do platform specific device initialization at pci_enable_device() time */
 extern int pcibios_plat_dev_init(struct pci_dev *dev);
 
+static inline struct resource *
+pcibios_select_root(struct pci_dev *pdev, struct resource *res)
+{
+   struct resource *root = NULL;
+
+   if (res-flags  IORESOURCE_IO)
+   root = ioport_resource;
+   if (res-flags  IORESOURCE_MEM)
+   root = iomem_resource;
+
+   return root;
+}
+
 #endif /* _ASM_PCI_H */


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] fix warning of TANBAC_TB0219 in drivers/char/Kconfig

2005-08-19 Thread Yoichi Yuasa
On Fri, 19 Aug 2005 20:03:26 +0200
Jesper Juhl [EMAIL PROTECTED] wrote:

 On 8/19/05, Andrew Morton [EMAIL PROTECTED] wrote:
  
  ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.13-rc6/2.6.13-rc6-mm1/
  
 
 menuconfig complains a little :
 
 $ make menuconfig
 scripts/kconfig/mconf arch/i386/Kconfig
 drivers/char/Kconfig:847:warning: 'select' used by config symbol
 'TANBAC_TB0219' refer to undefined symbol 'PCI_VR41XX'
 
 otherwise things seem to be ok here.
 

Here is a patch for this warning fix.

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff rc6-mm1-orig/arch/mips/Kconfig rc6-mm1/arch/mips/Kconfig
--- rc6-mm1-orig/arch/mips/Kconfig  2005-08-20 08:32:28.0 +0900
+++ rc6-mm1/arch/mips/Kconfig   2005-08-20 08:41:42.0 +0900
@@ -91,8 +91,6 @@
select DMA_NONCOHERENT
select IRQ_CPU
select HW_HAS_PCI
-   select PCI
-   select PCI_VR41XX
 
 config ROCKHOPPER
bool Support for Rockhopper baseboard
@@ -133,8 +131,6 @@
 config TANBAC_TB0226
bool Support for TANBAC Mbase(TB0226)
depends on TANBAC_TB022X
-   select PCI
-   select PCI_VR41XX
select GPIO_VR41XX
help
  The TANBAC Mbase(TB0226) is a MIPS-based platform manufactured by 
TANBAC.
@@ -147,8 +143,6 @@
select DMA_NONCOHERENT
select IRQ_CPU
select HW_HAS_PCI
-   select PCI
-   select PCI_VR41XX
 
 config ZAO_CAPCELLA
bool Support for ZAO Networks Capcella
@@ -157,12 +151,12 @@
select DMA_NONCOHERENT
select IRQ_CPU
select HW_HAS_PCI
-   select PCI
-   select PCI_VR41XX
 
 config PCI_VR41XX
bool Add PCI control unit support of NEC VR4100 series
-   depends on MACH_VR41XX  PCI
+   depends on MACH_VR41XX  HW_HAS_PCI
+   default y
+   select PCI
 
 config VRC4173
tristate Add NEC VRC4173 companion chip support
diff -urN -X dontdiff rc6-mm1-orig/drivers/char/Kconfig 
rc6-mm1/drivers/char/Kconfig
--- rc6-mm1-orig/drivers/char/Kconfig   2005-08-20 08:32:35.0 +0900
+++ rc6-mm1/drivers/char/Kconfig2005-08-20 09:41:43.0 +0900
@@ -843,8 +843,6 @@
 config TANBAC_TB0219
tristate TANBAC TB0219 base board support
depends TANBAC_TB022X
-   select PCI
-   select PCI_VR41XX
 
 menu Ftape, the floppy tape device driver
 
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH][4/4] mips: changed from VR41xx to VR4100 series in Kconfig

2005-08-11 Thread Yoichi Yuasa
Hi,

This patch has changed from VR41XX to VR4100 series in arch/mips/Kconfig.
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff mm1-orig/arch/mips/Kconfig mm1/arch/mips/Kconfig
--- mm1-orig/arch/mips/Kconfig  2005-08-11 23:47:04.0 +0900
+++ mm1/arch/mips/Kconfig   2005-08-11 23:46:44.0 +0900
@@ -71,7 +71,7 @@
  <http://www.linux-mips.org/>.
 
 config MACH_VR41XX
-   bool "Support for NEC VR41XX-based machines"
+   bool "Support for NEC VR4100 series based machines"
 
 config NEC_CMBVR4133
bool "Support for NEC CMB-VR4133"
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH][2/4] mips: add default select configs for vr41xx

2005-08-11 Thread Yoichi Yuasa
Hi,

This patch has added default select configs for vr41xx.
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff mm1-orig/arch/mips/Kconfig mm1/arch/mips/Kconfig
--- mm1-orig/arch/mips/Kconfig  2005-08-11 23:21:13.0 +0900
+++ mm1/arch/mips/Kconfig   2005-08-11 23:27:17.0 +0900
@@ -80,6 +80,7 @@
select DMA_NONCOHERENT
select IRQ_CPU
select HW_HAS_PCI
+   select PCI
select PCI_VR41XX
 
 config ROCKHOPPER
@@ -91,6 +92,7 @@
 config CASIO_E55
bool "Support for CASIO CASSIOPEIA E-10/15/55/65"
depends on MACH_VR41XX
+   select CPU_LITTLE_ENDIAN
select DMA_NONCOHERENT
select IRQ_CPU
select ISA
@@ -98,6 +100,7 @@
 config IBM_WORKPAD
bool "Support for IBM WorkPad z50"
depends on MACH_VR41XX
+   select CPU_LITTLE_ENDIAN
select DMA_NONCOHERENT
select IRQ_CPU
select ISA
@@ -128,17 +131,23 @@
 
 config VICTOR_MPC30X
bool "Support for Victor MP-C303/304"
+   depends on MACH_VR41XX
+   select CPU_LITTLE_ENDIAN
select DMA_NONCOHERENT
-   select HW_HAS_PCI
select IRQ_CPU
-   depends on MACH_VR41XX
+   select HW_HAS_PCI
+   select PCI
+   select PCI_VR41XX
 
 config ZAO_CAPCELLA
bool "Support for ZAO Networks Capcella"
depends on MACH_VR41XX
+   select CPU_LITTLE_ENDIAN
select DMA_NONCOHERENT
-   select HW_HAS_PCI
select IRQ_CPU
+   select HW_HAS_PCI
+   select PCI
+   select PCI_VR41XX
 
 config PCI_VR41XX
bool "Add PCI control unit support of NEC VR4100 series"

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


[PATCH][1/4] mips: add TANBAC VR4131 multichip module

2005-08-11 Thread Yoichi Yuasa
Hi,

This patch has added TANBAC VR4131 multichip module in arch/mips/Kconfig
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff mm1-orig/arch/mips/Kconfig mm1/arch/mips/Kconfig
--- mm1-orig/arch/mips/Kconfig  2005-08-02 13:45:48.0 +0900
+++ mm1/arch/mips/Kconfig   2005-08-12 00:06:39.0 +0900
@@ -102,25 +102,29 @@
select IRQ_CPU
select ISA
 
-config TANBAC_TB0226
-   bool "Support for TANBAC TB0226 (Mbase)"
+config TANBAC_TB022X
+   bool "Support for TANBAC VR4131 multichip module and TANBAC VR4131DIMM"
depends on MACH_VR41XX
+   select CPU_LITTLE_ENDIAN
select DMA_NONCOHERENT
-   select HW_HAS_PCI
select IRQ_CPU
+   select HW_HAS_PCI
help
- The TANBAC TB0226 (Mbase) is a MIPS-based platform manufactured by 
TANBAC.
- Please refer to <http://www.tanbac.co.jp/> about Mbase.
+ The TANBAC VR4131 multichip module(TB0225) and
+ the TANBAC VR4131DIMM(TB0229) are MIPS-based platforms
+ manufactured by TANBAC.
+ Please refer to <http://www.tanbac.co.jp/>
+ about VR4131 multichip module and VR4131DIMM.
 
-config TANBAC_TB0229
-   bool "Support for TANBAC TB0229 (VR4131DIMM)"
-   depends on MACH_VR41XX
-   select DMA_NONCOHERENT
-   select HW_HAS_PCI
-   select IRQ_CPU
+config TANBAC_TB0226
+   bool "Support for TANBAC Mbase(TB0226)"
+   depends on TANBAC_TB022X
+   select PCI
+   select PCI_VR41XX
+   select GPIO_VR41XX
help
- The TANBAC TB0229 (VR4131DIMM) is a MIPS-based platform manufactured 
by TANBAC.
- Please refer to <http://www.tanbac.co.jp/> about VR4131DIMM.
+ The TANBAC Mbase(TB0226) is a MIPS-based platform manufactured by 
TANBAC.
+ Please refer to <http://www.tanbac.co.jp/> about Mbase.
 
 config VICTOR_MPC30X
bool "Support for Victor MP-C303/304"
diff -urN -X dontdiff mm1-orig/arch/mips/Makefile mm1/arch/mips/Makefile
--- mm1-orig/arch/mips/Makefile 2005-08-12 00:00:57.0 +0900
+++ mm1/arch/mips/Makefile  2005-08-12 00:06:39.0 +0900
@@ -510,14 +510,9 @@
 load-$(CONFIG_CASIO_E55)   += 0x80004000
 
 #
-# TANBAC TB0226 Mbase (VR4131)
+# TANBAC VR4131 multichip module(TB0225) and TANBAC VR4131DIMM(TB0229) (VR4131)
 #
-load-$(CONFIG_TANBAC_TB0226)   += 0x8000
-
-#
-# TANBAC TB0229 VR4131DIMM (VR4131)
-#
-load-$(CONFIG_TANBAC_TB0229)   += 0x8000
+load-$(CONFIG_TANBAC_TB022X)   += 0x8000
 
 #
 # SGI IP22 (Indy/Indigo2)
diff -urN -X dontdiff mm1-orig/drivers/char/Kconfig mm1/drivers/char/Kconfig
--- mm1-orig/drivers/char/Kconfig   2005-08-12 00:00:58.0 +0900
+++ mm1/drivers/char/Kconfig2005-08-12 00:07:21.0 +0900
@@ -842,8 +842,9 @@
 
 config TANBAC_TB0219
tristate "TANBAC TB0219 base board support"
-   depends TANBAC_TB0229
-
+   depends TANBAC_TB022X
+   select PCI
+   select PCI_VR41XX
 
 menu "Ftape, the floppy tape device driver"
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH][3/4] mips: remove vrc4171 config

2005-08-11 Thread Yoichi Yuasa
Hi,

This patch has removed obsolete VRC4171 config.
Please apply.

Yoichi

diff -urN -X dontdiff mm1-orig/arch/mips/Kconfig mm1/arch/mips/Kconfig
--- mm1-orig/arch/mips/Kconfig  2005-08-11 23:39:49.0 +0900
+++ mm1/arch/mips/Kconfig   2005-08-11 23:40:22.0 +0900
@@ -153,12 +153,6 @@
bool "Add PCI control unit support of NEC VR4100 series"
depends on MACH_VR41XX && PCI
 
-config VRC4171
-   tristate "Add NEC VRC4171 companion chip support"
-   depends on MACH_VR41XX && ISA
-   ---help---
- The NEC VRC4171/4171A is a companion chip for NEC VR4111/VR4121.
-
 config VRC4173
tristate "Add NEC VRC4173 companion chip support"
depends on MACH_VR41XX && PCI_VR41XX
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH][3/4] mips: remove vrc4171 config

2005-08-11 Thread Yoichi Yuasa
Hi,

This patch has removed obsolete VRC4171 config.
Please apply.

Yoichi

diff -urN -X dontdiff mm1-orig/arch/mips/Kconfig mm1/arch/mips/Kconfig
--- mm1-orig/arch/mips/Kconfig  2005-08-11 23:39:49.0 +0900
+++ mm1/arch/mips/Kconfig   2005-08-11 23:40:22.0 +0900
@@ -153,12 +153,6 @@
bool Add PCI control unit support of NEC VR4100 series
depends on MACH_VR41XX  PCI
 
-config VRC4171
-   tristate Add NEC VRC4171 companion chip support
-   depends on MACH_VR41XX  ISA
-   ---help---
- The NEC VRC4171/4171A is a companion chip for NEC VR4111/VR4121.
-
 config VRC4173
tristate Add NEC VRC4173 companion chip support
depends on MACH_VR41XX  PCI_VR41XX
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH][1/4] mips: add TANBAC VR4131 multichip module

2005-08-11 Thread Yoichi Yuasa
Hi,

This patch has added TANBAC VR4131 multichip module in arch/mips/Kconfig
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff mm1-orig/arch/mips/Kconfig mm1/arch/mips/Kconfig
--- mm1-orig/arch/mips/Kconfig  2005-08-02 13:45:48.0 +0900
+++ mm1/arch/mips/Kconfig   2005-08-12 00:06:39.0 +0900
@@ -102,25 +102,29 @@
select IRQ_CPU
select ISA
 
-config TANBAC_TB0226
-   bool Support for TANBAC TB0226 (Mbase)
+config TANBAC_TB022X
+   bool Support for TANBAC VR4131 multichip module and TANBAC VR4131DIMM
depends on MACH_VR41XX
+   select CPU_LITTLE_ENDIAN
select DMA_NONCOHERENT
-   select HW_HAS_PCI
select IRQ_CPU
+   select HW_HAS_PCI
help
- The TANBAC TB0226 (Mbase) is a MIPS-based platform manufactured by 
TANBAC.
- Please refer to http://www.tanbac.co.jp/ about Mbase.
+ The TANBAC VR4131 multichip module(TB0225) and
+ the TANBAC VR4131DIMM(TB0229) are MIPS-based platforms
+ manufactured by TANBAC.
+ Please refer to http://www.tanbac.co.jp/
+ about VR4131 multichip module and VR4131DIMM.
 
-config TANBAC_TB0229
-   bool Support for TANBAC TB0229 (VR4131DIMM)
-   depends on MACH_VR41XX
-   select DMA_NONCOHERENT
-   select HW_HAS_PCI
-   select IRQ_CPU
+config TANBAC_TB0226
+   bool Support for TANBAC Mbase(TB0226)
+   depends on TANBAC_TB022X
+   select PCI
+   select PCI_VR41XX
+   select GPIO_VR41XX
help
- The TANBAC TB0229 (VR4131DIMM) is a MIPS-based platform manufactured 
by TANBAC.
- Please refer to http://www.tanbac.co.jp/ about VR4131DIMM.
+ The TANBAC Mbase(TB0226) is a MIPS-based platform manufactured by 
TANBAC.
+ Please refer to http://www.tanbac.co.jp/ about Mbase.
 
 config VICTOR_MPC30X
bool Support for Victor MP-C303/304
diff -urN -X dontdiff mm1-orig/arch/mips/Makefile mm1/arch/mips/Makefile
--- mm1-orig/arch/mips/Makefile 2005-08-12 00:00:57.0 +0900
+++ mm1/arch/mips/Makefile  2005-08-12 00:06:39.0 +0900
@@ -510,14 +510,9 @@
 load-$(CONFIG_CASIO_E55)   += 0x80004000
 
 #
-# TANBAC TB0226 Mbase (VR4131)
+# TANBAC VR4131 multichip module(TB0225) and TANBAC VR4131DIMM(TB0229) (VR4131)
 #
-load-$(CONFIG_TANBAC_TB0226)   += 0x8000
-
-#
-# TANBAC TB0229 VR4131DIMM (VR4131)
-#
-load-$(CONFIG_TANBAC_TB0229)   += 0x8000
+load-$(CONFIG_TANBAC_TB022X)   += 0x8000
 
 #
 # SGI IP22 (Indy/Indigo2)
diff -urN -X dontdiff mm1-orig/drivers/char/Kconfig mm1/drivers/char/Kconfig
--- mm1-orig/drivers/char/Kconfig   2005-08-12 00:00:58.0 +0900
+++ mm1/drivers/char/Kconfig2005-08-12 00:07:21.0 +0900
@@ -842,8 +842,9 @@
 
 config TANBAC_TB0219
tristate TANBAC TB0219 base board support
-   depends TANBAC_TB0229
-
+   depends TANBAC_TB022X
+   select PCI
+   select PCI_VR41XX
 
 menu Ftape, the floppy tape device driver
 
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH][2/4] mips: add default select configs for vr41xx

2005-08-11 Thread Yoichi Yuasa
Hi,

This patch has added default select configs for vr41xx.
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff mm1-orig/arch/mips/Kconfig mm1/arch/mips/Kconfig
--- mm1-orig/arch/mips/Kconfig  2005-08-11 23:21:13.0 +0900
+++ mm1/arch/mips/Kconfig   2005-08-11 23:27:17.0 +0900
@@ -80,6 +80,7 @@
select DMA_NONCOHERENT
select IRQ_CPU
select HW_HAS_PCI
+   select PCI
select PCI_VR41XX
 
 config ROCKHOPPER
@@ -91,6 +92,7 @@
 config CASIO_E55
bool Support for CASIO CASSIOPEIA E-10/15/55/65
depends on MACH_VR41XX
+   select CPU_LITTLE_ENDIAN
select DMA_NONCOHERENT
select IRQ_CPU
select ISA
@@ -98,6 +100,7 @@
 config IBM_WORKPAD
bool Support for IBM WorkPad z50
depends on MACH_VR41XX
+   select CPU_LITTLE_ENDIAN
select DMA_NONCOHERENT
select IRQ_CPU
select ISA
@@ -128,17 +131,23 @@
 
 config VICTOR_MPC30X
bool Support for Victor MP-C303/304
+   depends on MACH_VR41XX
+   select CPU_LITTLE_ENDIAN
select DMA_NONCOHERENT
-   select HW_HAS_PCI
select IRQ_CPU
-   depends on MACH_VR41XX
+   select HW_HAS_PCI
+   select PCI
+   select PCI_VR41XX
 
 config ZAO_CAPCELLA
bool Support for ZAO Networks Capcella
depends on MACH_VR41XX
+   select CPU_LITTLE_ENDIAN
select DMA_NONCOHERENT
-   select HW_HAS_PCI
select IRQ_CPU
+   select HW_HAS_PCI
+   select PCI
+   select PCI_VR41XX
 
 config PCI_VR41XX
bool Add PCI control unit support of NEC VR4100 series

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH][4/4] mips: changed from VR41xx to VR4100 series in Kconfig

2005-08-11 Thread Yoichi Yuasa
Hi,

This patch has changed from VR41XX to VR4100 series in arch/mips/Kconfig.
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff mm1-orig/arch/mips/Kconfig mm1/arch/mips/Kconfig
--- mm1-orig/arch/mips/Kconfig  2005-08-11 23:47:04.0 +0900
+++ mm1/arch/mips/Kconfig   2005-08-11 23:46:44.0 +0900
@@ -71,7 +71,7 @@
  http://www.linux-mips.org/.
 
 config MACH_VR41XX
-   bool Support for NEC VR41XX-based machines
+   bool Support for NEC VR4100 series based machines
 
 config NEC_CMBVR4133
bool Support for NEC CMB-VR4133
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mips: moreover remove vr4181

2005-08-07 Thread Yoichi Yuasa
Hi,

We also need this patch for removing mips vr4181.
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff mm1-orig/arch/mips/Makefile mm1/arch/mips/Makefile
--- mm1-orig/arch/mips/Makefile 2005-08-07 22:15:17.0 +0900
+++ mm1/arch/mips/Makefile  2005-08-07 22:08:19.0 +0900
@@ -469,13 +469,6 @@
 load-$(CONFIG_LASAT)   += 0x8000
 
 #
-# NEC Osprey (vr4181) board
-#
-core-$(CONFIG_NEC_OSPREY)  += arch/mips/vr4181/common/ \
-  arch/mips/vr4181/osprey/
-load-$(CONFIG_NEC_OSPREY)  += 0x80002000
-
-#
 # Common VR41xx
 #
 core-$(CONFIG_MACH_VR41XX) += arch/mips/vr41xx/common/


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


[PATCH] mips: moreover remove vr4181

2005-08-07 Thread Yoichi Yuasa
Hi,

We also need this patch for removing mips vr4181.
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff mm1-orig/arch/mips/Makefile mm1/arch/mips/Makefile
--- mm1-orig/arch/mips/Makefile 2005-08-07 22:15:17.0 +0900
+++ mm1/arch/mips/Makefile  2005-08-07 22:08:19.0 +0900
@@ -469,13 +469,6 @@
 load-$(CONFIG_LASAT)   += 0x8000
 
 #
-# NEC Osprey (vr4181) board
-#
-core-$(CONFIG_NEC_OSPREY)  += arch/mips/vr4181/common/ \
-  arch/mips/vr4181/osprey/
-load-$(CONFIG_NEC_OSPREY)  += 0x80002000
-
-#
 # Common VR41xx
 #
 core-$(CONFIG_MACH_VR41XX) += arch/mips/vr41xx/common/


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mips: update IRQ handling for vr41xx

2005-08-01 Thread Yoichi Yuasa
Hi,

This patch has updated IRQ handling for vr41xx.
o added common IRQ dispatch
o changed IRQ number in int-handler.S
o added resource management to icu.c

This patch already has been applied to mips tree.
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff 
linux-2.6.13-rc4-git2-orig/arch/mips/vr41xx/common/Makefile 
linux-2.6.13-rc4-git2/arch/mips/vr41xx/common/Makefile
--- linux-2.6.13-rc4-git2-orig/arch/mips/vr41xx/common/Makefile 2005-07-29 
07:44:44.0 +0900
+++ linux-2.6.13-rc4-git2/arch/mips/vr41xx/common/Makefile  2005-07-31 
01:20:03.0 +0900
@@ -2,7 +2,7 @@
 # Makefile for common code of the NEC VR4100 series.
 #
 
-obj-y  += bcu.o cmu.o icu.o init.o int-handler.o pmu.o
+obj-y  += bcu.o cmu.o icu.o init.o int-handler.o irq.o 
pmu.o
 obj-$(CONFIG_VRC4173)  += vrc4173.o
 
 EXTRA_AFLAGS := $(CFLAGS)
diff -urN -X dontdiff linux-2.6.13-rc4-git2-orig/arch/mips/vr41xx/common/icu.c 
linux-2.6.13-rc4-git2/arch/mips/vr41xx/common/icu.c
--- linux-2.6.13-rc4-git2-orig/arch/mips/vr41xx/common/icu.c2005-07-29 
07:44:44.0 +0900
+++ linux-2.6.13-rc4-git2/arch/mips/vr41xx/common/icu.c 2005-07-31 
01:20:03.0 +0900
@@ -3,8 +3,7 @@
  *
  *  Copyright (C) 2001-2002  MontaVista Software Inc.
  *Author: Yoichi Yuasa <[EMAIL PROTECTED] or [EMAIL PROTECTED]>
- *  Copyright (C) 2003-2004  Yoichi Yuasa <[EMAIL PROTECTED]>
- *  Copyright (C) 2005 Ralf Baechle ([EMAIL PROTECTED])
+ *  Copyright (C) 2003-2005  Yoichi Yuasa <[EMAIL PROTECTED]>
  *
  *  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
@@ -31,7 +30,7 @@
  */
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -39,34 +38,24 @@
 
 #include 
 #include 
-#include 
-#include 
 #include 
 
-extern asmlinkage void vr41xx_handle_interrupt(void);
-
-extern void init_vr41xx_giuint_irq(void);
-extern void giuint_irq_dispatch(struct pt_regs *regs);
-
-static uint32_t icu1_base;
-static uint32_t icu2_base;
-
-static struct irqaction icu_cascade = {
-   .handler= no_action,
-   .mask   = CPU_MASK_NONE,
-   .name   = "cascade",
-};
+static void __iomem *icu1_base;
+static void __iomem *icu2_base;
 
 static unsigned char sysint1_assign[16] = {
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
 static unsigned char sysint2_assign[16] = {
-   2, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+   2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
 
-#define SYSINT1REG_TYPE1   KSEG1ADDR(0x0b80)
-#define SYSINT2REG_TYPE1   KSEG1ADDR(0x0b000200)
+#define ICU1_TYPE1_BASE0x0b80UL
+#define ICU2_TYPE1_BASE0x0b000200UL
 
-#define SYSINT1REG_TYPE2   KSEG1ADDR(0x0f80)
-#define SYSINT2REG_TYPE2   KSEG1ADDR(0x0fa0)
+#define ICU1_TYPE2_BASE0x0f80UL
+#define ICU2_TYPE2_BASE0x0fa0UL
+
+#define ICU1_SIZE  0x20
+#define ICU2_SIZE  0x1c
 
 #define SYSINT1REG 0x00
 #define PIUINTREG  0x02
@@ -106,61 +95,61 @@
 #define SYSINT1_IRQ_TO_PIN(x)  ((x) - SYSINT1_IRQ_BASE)/* Pin 0-15 */
 #define SYSINT2_IRQ_TO_PIN(x)  ((x) - SYSINT2_IRQ_BASE)/* Pin 0-15 */
 
-#define read_icu1(offset)  readw(icu1_base + (offset))
-#define write_icu1(val, offset)writew((val), icu1_base + (offset))
+#define INT_TO_IRQ(x)  ((x) + 2)   /* Int0-4 -> IRQ2-6 */
+
+#define icu1_read(offset)  readw(icu1_base + (offset))
+#define icu1_write(offset, value)  writew((value), icu1_base + (offset))
 
-#define read_icu2(offset)  readw(icu2_base + (offset))
-#define write_icu2(val, offset)writew((val), icu2_base + (offset))
+#define icu2_read(offset)  readw(icu2_base + (offset))
+#define icu2_write(offset, value)  writew((value), icu2_base + (offset))
 
 #define INTASSIGN_MAX  4
 #define INTASSIGN_MASK 0x0007
 
-static inline uint16_t set_icu1(uint8_t offset, uint16_t set)
+static inline uint16_t icu1_set(uint8_t offset, uint16_t set)
 {
-   uint16_t res;
+   uint16_t data;
 
-   res = read_icu1(offset);
-   res |= set;
-   write_icu1(res, offset);
+   data = icu1_read(offset);
+   data |= set;
+   icu1_write(offset, data);
 
-   return res;
+   return data;
 }
 
-static inline uint16_t clear_icu1(uint8_t offset, uint16_t clear)
+static inline uint16_t icu1_clear(uint8_t offset, uint16_t clear)
 {
-   uint16_t res;
+   uint16_t data;
 
-   res = read_icu1(offset);
-   res &= ~clear;
-   write_icu1(res, offset);
+   data = icu1_read(offset);
+   data &= ~clear;
+   icu1_write(offset, data);
 
-   return res;
+   return data;
 }
 
-static inline uint16_t set_icu2(uint8_t offset, uint16_t set)
+static inline uint16_t icu2_set(uint8_t 

[PATCH] mips: change system type name in proc for vr41xx

2005-08-01 Thread Yoichi Yuasa
Hi,

This patch has changed system type name in proc for vr41xx.
This patch already has been applied to mips tree.
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff git2-orig/arch/mips/Makefile git2/arch/mips/Makefile
--- git2-orig/arch/mips/Makefile2005-07-29 07:44:44.0 +0900
+++ git2/arch/mips/Makefile 2005-07-30 23:06:55.0 +0900
@@ -490,13 +490,11 @@
 #
 # ZAO Networks Capcella (VR4131)
 #
-core-$(CONFIG_ZAO_CAPCELLA)+= arch/mips/vr41xx/zao-capcella/
 load-$(CONFIG_ZAO_CAPCELLA)+= 0x8000
 
 #
 # Victor MP-C303/304 (VR4122)
 #
-core-$(CONFIG_VICTOR_MPC30X)   += arch/mips/vr41xx/victor-mpc30x/
 load-$(CONFIG_VICTOR_MPC30X)   += 0x80001000
 
 #
@@ -514,13 +512,11 @@
 #
 # TANBAC TB0226 Mbase (VR4131)
 #
-core-$(CONFIG_TANBAC_TB0226)   += arch/mips/vr41xx/tanbac-tb0226/
 load-$(CONFIG_TANBAC_TB0226)   += 0x8000
 
 #
 # TANBAC TB0229 VR4131DIMM (VR4131)
 #
-core-$(CONFIG_TANBAC_TB0229)   += arch/mips/vr41xx/tanbac-tb0229/
 load-$(CONFIG_TANBAC_TB0229)   += 0x8000
 
 #
diff -urN -X dontdiff git2-orig/arch/mips/vr41xx/casio-e55/setup.c 
git2/arch/mips/vr41xx/casio-e55/setup.c
--- git2-orig/arch/mips/vr41xx/casio-e55/setup.c2005-07-29 
07:44:44.0 +0900
+++ git2/arch/mips/vr41xx/casio-e55/setup.c 2005-07-30 23:06:55.0 
+0900
@@ -23,11 +23,6 @@
 #include 
 #include 
 
-const char *get_system_type(void)
-{
-   return "CASIO CASSIOPEIA E-11/15/55/65";
-}
-
 static int __init casio_e55_setup(void)
 {
set_io_port_base(IO_PORT_BASE);
diff -urN -X dontdiff git2-orig/arch/mips/vr41xx/common/Makefile 
git2/arch/mips/vr41xx/common/Makefile
--- git2-orig/arch/mips/vr41xx/common/Makefile  2005-07-30 23:27:44.0 
+0900
+++ git2/arch/mips/vr41xx/common/Makefile   2005-07-30 23:06:55.0 
+0900
@@ -2,7 +2,7 @@
 # Makefile for common code of the NEC VR4100 series.
 #
 
-obj-y  += bcu.o cmu.o icu.o init.o int-handler.o irq.o 
pmu.o
+obj-y  += bcu.o cmu.o icu.o init.o int-handler.o irq.o 
pmu.o type.o
 obj-$(CONFIG_VRC4173)  += vrc4173.o
 
 EXTRA_AFLAGS := $(CFLAGS)
diff -urN -X dontdiff git2-orig/arch/mips/vr41xx/common/type.c 
git2/arch/mips/vr41xx/common/type.c
--- git2-orig/arch/mips/vr41xx/common/type.c1970-01-01 09:00:00.0 
+0900
+++ git2/arch/mips/vr41xx/common/type.c 2005-07-30 23:06:55.0 +0900
@@ -0,0 +1,24 @@
+/*
+ *  type.c, System type for NEC VR4100 series.
+ *
+ *  Copyright (C) 2005  Yoichi Yuasa <[EMAIL PROTECTED]>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+const char *get_system_type(void)
+{
+   return "NEC VR4100 series";
+}
diff -urN -X dontdiff git2-orig/arch/mips/vr41xx/ibm-workpad/setup.c 
git2/arch/mips/vr41xx/ibm-workpad/setup.c
--- git2-orig/arch/mips/vr41xx/ibm-workpad/setup.c  2005-07-29 
07:44:44.0 +0900
+++ git2/arch/mips/vr41xx/ibm-workpad/setup.c   2005-07-30 23:06:55.0 
+0900
@@ -23,11 +23,6 @@
 #include 
 #include 
 
-const char *get_system_type(void)
-{
-   return "IBM WorkPad z50";
-}
-
 static int __init ibm_workpad_setup(void)
 {
set_io_port_base(IO_PORT_BASE);
diff -urN -X dontdiff git2-orig/arch/mips/vr41xx/nec-cmbvr4133/init.c 
git2/arch/mips/vr41xx/nec-cmbvr4133/init.c
--- git2-orig/arch/mips/vr41xx/nec-cmbvr4133/init.c 2005-07-29 
07:44:44.0 +0900
+++ git2/arch/mips/vr41xx/nec-cmbvr4133/init.c  2005-07-30 23:06:55.0 
+0900
@@ -16,11 +16,6 @@
  * Manish Lachwani ([EMAIL PROTECTED])
  */
 #include 
-#include 
-#include 
-#include 
-
-#include 
 
 #ifdef CONFIG_ROCKHOPPER
 #include 
@@ -28,14 +23,7 @@
 
 #define PCICONFDREG0xaf000c14
 #define PCICONFAREG0xaf000c18
-#endif
-
-const char *get_system_type(void)
-{
-   return "NEC CMB-VR4133";
-}
 
-#ifdef CONFIG_ROCKHOPPER
 void disable_pcnet(void)
 {
u32 data;
diff -urN -X dontdiff git2-orig/arch/mips/vr41xx/tanbac-tb0226/Makefile 
git2/arch/mips/vr41xx/tanbac-tb0226/Makefile
--- git2-orig/arch/mips/vr41xx/tanbac-tb0226/Makefile   2005-07-29 
07:44:44.0 +0900
+++ git2/arch/mips/vr41xx/tanbac-tb0226/Makefile1970-01-01 
09:00:00.0 +0900
@@ -1,5 +

[PATCH] mips: remove obsolete GIU function call for vr41xx

2005-08-01 Thread Yoichi Yuasa
Hi,

This patch has removed obsolete GIU function call for vr41xx.
This patch already has been applied to mips tree.
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff rc4-orig/arch/mips/pci/fixup-tb0219.c 
rc4/arch/mips/pci/fixup-tb0219.c
--- rc4-orig/arch/mips/pci/fixup-tb0219.c   2005-07-29 07:44:44.0 
+0900
+++ rc4/arch/mips/pci/fixup-tb0219.c2005-07-30 01:23:53.0 +0900
@@ -29,27 +29,12 @@
 
switch (slot) {
case 12:
-   vr41xx_set_irq_trigger(TB0219_PCI_SLOT1_PIN,
-  TRIGGER_LEVEL,
-  SIGNAL_THROUGH);
-   vr41xx_set_irq_level(TB0219_PCI_SLOT1_PIN,
-LEVEL_LOW);
irq = TB0219_PCI_SLOT1_IRQ;
break;
case 13:
-   vr41xx_set_irq_trigger(TB0219_PCI_SLOT2_PIN,
-  TRIGGER_LEVEL,
-  SIGNAL_THROUGH);
-   vr41xx_set_irq_level(TB0219_PCI_SLOT2_PIN,
-LEVEL_LOW);
irq = TB0219_PCI_SLOT2_IRQ;
break;
case 14:
-   vr41xx_set_irq_trigger(TB0219_PCI_SLOT3_PIN,
-  TRIGGER_LEVEL,
-  SIGNAL_THROUGH);
-   vr41xx_set_irq_level(TB0219_PCI_SLOT3_PIN,
-LEVEL_LOW);
irq = TB0219_PCI_SLOT3_IRQ;
break;
default:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mips: remove obsolete GIU function call for vr41xx

2005-08-01 Thread Yoichi Yuasa
Hi,

This patch has removed obsolete GIU function call for vr41xx.
This patch already has been applied to mips tree.
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff rc4-orig/arch/mips/pci/fixup-tb0219.c 
rc4/arch/mips/pci/fixup-tb0219.c
--- rc4-orig/arch/mips/pci/fixup-tb0219.c   2005-07-29 07:44:44.0 
+0900
+++ rc4/arch/mips/pci/fixup-tb0219.c2005-07-30 01:23:53.0 +0900
@@ -29,27 +29,12 @@
 
switch (slot) {
case 12:
-   vr41xx_set_irq_trigger(TB0219_PCI_SLOT1_PIN,
-  TRIGGER_LEVEL,
-  SIGNAL_THROUGH);
-   vr41xx_set_irq_level(TB0219_PCI_SLOT1_PIN,
-LEVEL_LOW);
irq = TB0219_PCI_SLOT1_IRQ;
break;
case 13:
-   vr41xx_set_irq_trigger(TB0219_PCI_SLOT2_PIN,
-  TRIGGER_LEVEL,
-  SIGNAL_THROUGH);
-   vr41xx_set_irq_level(TB0219_PCI_SLOT2_PIN,
-LEVEL_LOW);
irq = TB0219_PCI_SLOT2_IRQ;
break;
case 14:
-   vr41xx_set_irq_trigger(TB0219_PCI_SLOT3_PIN,
-  TRIGGER_LEVEL,
-  SIGNAL_THROUGH);
-   vr41xx_set_irq_level(TB0219_PCI_SLOT3_PIN,
-LEVEL_LOW);
irq = TB0219_PCI_SLOT3_IRQ;
break;
default:
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mips: change system type name in proc for vr41xx

2005-08-01 Thread Yoichi Yuasa
Hi,

This patch has changed system type name in proc for vr41xx.
This patch already has been applied to mips tree.
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff git2-orig/arch/mips/Makefile git2/arch/mips/Makefile
--- git2-orig/arch/mips/Makefile2005-07-29 07:44:44.0 +0900
+++ git2/arch/mips/Makefile 2005-07-30 23:06:55.0 +0900
@@ -490,13 +490,11 @@
 #
 # ZAO Networks Capcella (VR4131)
 #
-core-$(CONFIG_ZAO_CAPCELLA)+= arch/mips/vr41xx/zao-capcella/
 load-$(CONFIG_ZAO_CAPCELLA)+= 0x8000
 
 #
 # Victor MP-C303/304 (VR4122)
 #
-core-$(CONFIG_VICTOR_MPC30X)   += arch/mips/vr41xx/victor-mpc30x/
 load-$(CONFIG_VICTOR_MPC30X)   += 0x80001000
 
 #
@@ -514,13 +512,11 @@
 #
 # TANBAC TB0226 Mbase (VR4131)
 #
-core-$(CONFIG_TANBAC_TB0226)   += arch/mips/vr41xx/tanbac-tb0226/
 load-$(CONFIG_TANBAC_TB0226)   += 0x8000
 
 #
 # TANBAC TB0229 VR4131DIMM (VR4131)
 #
-core-$(CONFIG_TANBAC_TB0229)   += arch/mips/vr41xx/tanbac-tb0229/
 load-$(CONFIG_TANBAC_TB0229)   += 0x8000
 
 #
diff -urN -X dontdiff git2-orig/arch/mips/vr41xx/casio-e55/setup.c 
git2/arch/mips/vr41xx/casio-e55/setup.c
--- git2-orig/arch/mips/vr41xx/casio-e55/setup.c2005-07-29 
07:44:44.0 +0900
+++ git2/arch/mips/vr41xx/casio-e55/setup.c 2005-07-30 23:06:55.0 
+0900
@@ -23,11 +23,6 @@
 #include asm/io.h
 #include asm/vr41xx/e55.h
 
-const char *get_system_type(void)
-{
-   return CASIO CASSIOPEIA E-11/15/55/65;
-}
-
 static int __init casio_e55_setup(void)
 {
set_io_port_base(IO_PORT_BASE);
diff -urN -X dontdiff git2-orig/arch/mips/vr41xx/common/Makefile 
git2/arch/mips/vr41xx/common/Makefile
--- git2-orig/arch/mips/vr41xx/common/Makefile  2005-07-30 23:27:44.0 
+0900
+++ git2/arch/mips/vr41xx/common/Makefile   2005-07-30 23:06:55.0 
+0900
@@ -2,7 +2,7 @@
 # Makefile for common code of the NEC VR4100 series.
 #
 
-obj-y  += bcu.o cmu.o icu.o init.o int-handler.o irq.o 
pmu.o
+obj-y  += bcu.o cmu.o icu.o init.o int-handler.o irq.o 
pmu.o type.o
 obj-$(CONFIG_VRC4173)  += vrc4173.o
 
 EXTRA_AFLAGS := $(CFLAGS)
diff -urN -X dontdiff git2-orig/arch/mips/vr41xx/common/type.c 
git2/arch/mips/vr41xx/common/type.c
--- git2-orig/arch/mips/vr41xx/common/type.c1970-01-01 09:00:00.0 
+0900
+++ git2/arch/mips/vr41xx/common/type.c 2005-07-30 23:06:55.0 +0900
@@ -0,0 +1,24 @@
+/*
+ *  type.c, System type for NEC VR4100 series.
+ *
+ *  Copyright (C) 2005  Yoichi Yuasa [EMAIL PROTECTED]
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+const char *get_system_type(void)
+{
+   return NEC VR4100 series;
+}
diff -urN -X dontdiff git2-orig/arch/mips/vr41xx/ibm-workpad/setup.c 
git2/arch/mips/vr41xx/ibm-workpad/setup.c
--- git2-orig/arch/mips/vr41xx/ibm-workpad/setup.c  2005-07-29 
07:44:44.0 +0900
+++ git2/arch/mips/vr41xx/ibm-workpad/setup.c   2005-07-30 23:06:55.0 
+0900
@@ -23,11 +23,6 @@
 #include asm/io.h
 #include asm/vr41xx/workpad.h
 
-const char *get_system_type(void)
-{
-   return IBM WorkPad z50;
-}
-
 static int __init ibm_workpad_setup(void)
 {
set_io_port_base(IO_PORT_BASE);
diff -urN -X dontdiff git2-orig/arch/mips/vr41xx/nec-cmbvr4133/init.c 
git2/arch/mips/vr41xx/nec-cmbvr4133/init.c
--- git2-orig/arch/mips/vr41xx/nec-cmbvr4133/init.c 2005-07-29 
07:44:44.0 +0900
+++ git2/arch/mips/vr41xx/nec-cmbvr4133/init.c  2005-07-30 23:06:55.0 
+0900
@@ -16,11 +16,6 @@
  * Manish Lachwani ([EMAIL PROTECTED])
  */
 #include linux/config.h
-#include linux/init.h
-#include linux/kernel.h
-#include linux/string.h
-
-#include asm/bootinfo.h
 
 #ifdef CONFIG_ROCKHOPPER
 #include asm/io.h
@@ -28,14 +23,7 @@
 
 #define PCICONFDREG0xaf000c14
 #define PCICONFAREG0xaf000c18
-#endif
-
-const char *get_system_type(void)
-{
-   return NEC CMB-VR4133;
-}
 
-#ifdef CONFIG_ROCKHOPPER
 void disable_pcnet(void)
 {
u32 data;
diff -urN -X dontdiff git2-orig/arch/mips/vr41xx/tanbac-tb0226/Makefile 
git2/arch/mips/vr41xx/tanbac-tb0226/Makefile
--- git2-orig/arch/mips/vr41xx/tanbac-tb0226/Makefile   2005-07-29 
07:44:44.0 +0900
+++ git2/arch/mips/vr41xx/tanbac-tb0226

[PATCH] mips: update IRQ handling for vr41xx

2005-08-01 Thread Yoichi Yuasa
Hi,

This patch has updated IRQ handling for vr41xx.
o added common IRQ dispatch
o changed IRQ number in int-handler.S
o added resource management to icu.c

This patch already has been applied to mips tree.
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff 
linux-2.6.13-rc4-git2-orig/arch/mips/vr41xx/common/Makefile 
linux-2.6.13-rc4-git2/arch/mips/vr41xx/common/Makefile
--- linux-2.6.13-rc4-git2-orig/arch/mips/vr41xx/common/Makefile 2005-07-29 
07:44:44.0 +0900
+++ linux-2.6.13-rc4-git2/arch/mips/vr41xx/common/Makefile  2005-07-31 
01:20:03.0 +0900
@@ -2,7 +2,7 @@
 # Makefile for common code of the NEC VR4100 series.
 #
 
-obj-y  += bcu.o cmu.o icu.o init.o int-handler.o pmu.o
+obj-y  += bcu.o cmu.o icu.o init.o int-handler.o irq.o 
pmu.o
 obj-$(CONFIG_VRC4173)  += vrc4173.o
 
 EXTRA_AFLAGS := $(CFLAGS)
diff -urN -X dontdiff linux-2.6.13-rc4-git2-orig/arch/mips/vr41xx/common/icu.c 
linux-2.6.13-rc4-git2/arch/mips/vr41xx/common/icu.c
--- linux-2.6.13-rc4-git2-orig/arch/mips/vr41xx/common/icu.c2005-07-29 
07:44:44.0 +0900
+++ linux-2.6.13-rc4-git2/arch/mips/vr41xx/common/icu.c 2005-07-31 
01:20:03.0 +0900
@@ -3,8 +3,7 @@
  *
  *  Copyright (C) 2001-2002  MontaVista Software Inc.
  *Author: Yoichi Yuasa [EMAIL PROTECTED] or [EMAIL PROTECTED]
- *  Copyright (C) 2003-2004  Yoichi Yuasa [EMAIL PROTECTED]
- *  Copyright (C) 2005 Ralf Baechle ([EMAIL PROTECTED])
+ *  Copyright (C) 2003-2005  Yoichi Yuasa [EMAIL PROTECTED]
  *
  *  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
@@ -31,7 +30,7 @@
  */
 #include linux/errno.h
 #include linux/init.h
-#include linux/interrupt.h
+#include linux/ioport.h
 #include linux/irq.h
 #include linux/module.h
 #include linux/smp.h
@@ -39,34 +38,24 @@
 
 #include asm/cpu.h
 #include asm/io.h
-#include asm/irq.h
-#include asm/irq_cpu.h
 #include asm/vr41xx/vr41xx.h
 
-extern asmlinkage void vr41xx_handle_interrupt(void);
-
-extern void init_vr41xx_giuint_irq(void);
-extern void giuint_irq_dispatch(struct pt_regs *regs);
-
-static uint32_t icu1_base;
-static uint32_t icu2_base;
-
-static struct irqaction icu_cascade = {
-   .handler= no_action,
-   .mask   = CPU_MASK_NONE,
-   .name   = cascade,
-};
+static void __iomem *icu1_base;
+static void __iomem *icu2_base;
 
 static unsigned char sysint1_assign[16] = {
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
 static unsigned char sysint2_assign[16] = {
-   2, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+   2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
 
-#define SYSINT1REG_TYPE1   KSEG1ADDR(0x0b80)
-#define SYSINT2REG_TYPE1   KSEG1ADDR(0x0b000200)
+#define ICU1_TYPE1_BASE0x0b80UL
+#define ICU2_TYPE1_BASE0x0b000200UL
 
-#define SYSINT1REG_TYPE2   KSEG1ADDR(0x0f80)
-#define SYSINT2REG_TYPE2   KSEG1ADDR(0x0fa0)
+#define ICU1_TYPE2_BASE0x0f80UL
+#define ICU2_TYPE2_BASE0x0fa0UL
+
+#define ICU1_SIZE  0x20
+#define ICU2_SIZE  0x1c
 
 #define SYSINT1REG 0x00
 #define PIUINTREG  0x02
@@ -106,61 +95,61 @@
 #define SYSINT1_IRQ_TO_PIN(x)  ((x) - SYSINT1_IRQ_BASE)/* Pin 0-15 */
 #define SYSINT2_IRQ_TO_PIN(x)  ((x) - SYSINT2_IRQ_BASE)/* Pin 0-15 */
 
-#define read_icu1(offset)  readw(icu1_base + (offset))
-#define write_icu1(val, offset)writew((val), icu1_base + (offset))
+#define INT_TO_IRQ(x)  ((x) + 2)   /* Int0-4 - IRQ2-6 */
+
+#define icu1_read(offset)  readw(icu1_base + (offset))
+#define icu1_write(offset, value)  writew((value), icu1_base + (offset))
 
-#define read_icu2(offset)  readw(icu2_base + (offset))
-#define write_icu2(val, offset)writew((val), icu2_base + (offset))
+#define icu2_read(offset)  readw(icu2_base + (offset))
+#define icu2_write(offset, value)  writew((value), icu2_base + (offset))
 
 #define INTASSIGN_MAX  4
 #define INTASSIGN_MASK 0x0007
 
-static inline uint16_t set_icu1(uint8_t offset, uint16_t set)
+static inline uint16_t icu1_set(uint8_t offset, uint16_t set)
 {
-   uint16_t res;
+   uint16_t data;
 
-   res = read_icu1(offset);
-   res |= set;
-   write_icu1(res, offset);
+   data = icu1_read(offset);
+   data |= set;
+   icu1_write(offset, data);
 
-   return res;
+   return data;
 }
 
-static inline uint16_t clear_icu1(uint8_t offset, uint16_t clear)
+static inline uint16_t icu1_clear(uint8_t offset, uint16_t clear)
 {
-   uint16_t res;
+   uint16_t data;
 
-   res = read_icu1(offset);
-   res = ~clear;
-   write_icu1(res, offset);
+   data = icu1_read(offset);
+   data = ~clear;
+   icu1_write(offset, data);
 
-   return res;
+   return data;
 }
 
-static inline

[PATCH] mips: remove obsolete GIU driver for vr41xx

2005-07-17 Thread Yoichi Yuasa
Hi,

This patch has removed obsolete GIU driver for vr41xx.
This patch already has been applied to mips tree.

Yoichi

-- 
Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff mm1-orig/arch/mips/vr41xx/common/Makefile 
mm1/arch/mips/vr41xx/common/Makefile
--- mm1-orig/arch/mips/vr41xx/common/Makefile   2005-07-13 13:46:46.0 
+0900
+++ mm1/arch/mips/vr41xx/common/Makefile2005-07-16 23:23:48.0 
+0900
@@ -2,7 +2,7 @@
 # Makefile for common code of the NEC VR4100 series.
 #
 
-obj-y  += bcu.o cmu.o giu.o icu.o init.o int-handler.o 
pmu.o
+obj-y  += bcu.o cmu.o icu.o init.o int-handler.o pmu.o
 obj-$(CONFIG_VRC4173)  += vrc4173.o
 
 EXTRA_AFLAGS := $(CFLAGS)
diff -urN -X dontdiff mm1-orig/arch/mips/vr41xx/common/giu.c 
mm1/arch/mips/vr41xx/common/giu.c
--- mm1-orig/arch/mips/vr41xx/common/giu.c  2005-07-13 13:46:46.0 
+0900
+++ mm1/arch/mips/vr41xx/common/giu.c   1970-01-01 09:00:00.0 +0900
@@ -1,455 +0,0 @@
-/*
- *  giu.c, General-purpose I/O Unit Interrupt routines for NEC VR4100 series.
- *
- *  Copyright (C) 2002 MontaVista Software Inc.
- *Author: Yoichi Yuasa <[EMAIL PROTECTED] or [EMAIL PROTECTED]>
- *  Copyright (C) 2003-2004  Yoichi Yuasa <[EMAIL PROTECTED]>
- *  Copyright (C) 2005 Ralf Baechle ([EMAIL PROTECTED])
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-/*
- * Changes:
- *  MontaVista Software Inc. <[EMAIL PROTECTED]> or <[EMAIL PROTECTED]>
- *  - New creation, NEC VR4111, VR4121, VR4122 and VR4131 are supported.
- *
- *  Yoichi Yuasa <[EMAIL PROTECTED]>
- *  - Added support for NEC VR4133.
- *  - Removed board_irq_init.
- */
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-
-#define GIUIOSELL_TYPE1KSEG1ADDR(0x0b000100)
-#define GIUIOSELL_TYPE2KSEG1ADDR(0x0f000140)
-
-#define GIUIOSELL  0x00
-#define GIUIOSELH  0x02
-#define GIUINTSTATL0x08
-#define GIUINTSTATH0x0a
-#define GIUINTENL  0x0c
-#define GIUINTENH  0x0e
-#define GIUINTTYPL 0x10
-#define GIUINTTYPH 0x12
-#define GIUINTALSELL   0x14
-#define GIUINTALSELH   0x16
-#define GIUINTHTSELL   0x18
-#define GIUINTHTSELH   0x1a
-#define GIUFEDGEINHL   0x20
-#define GIUFEDGEINHH   0x22
-#define GIUREDGEINHL   0x24
-#define GIUREDGEINHH   0x26
-
-static uint32_t giu_base;
-
-static struct irqaction giu_cascade = {
-   .handler= no_action,
-   .mask   = CPU_MASK_NONE,
-   .name   = "cascade",
-};
-
-#define read_giuint(offset)readw(giu_base + (offset))
-#define write_giuint(val, offset)  writew((val), giu_base + (offset))
-
-#define GIUINT_HIGH_OFFSET 16
-
-static inline uint16_t set_giuint(uint8_t offset, uint16_t set)
-{
-   uint16_t res;
-
-   res = read_giuint(offset);
-   res |= set;
-   write_giuint(res, offset);
-
-   return res;
-}
-
-static inline uint16_t clear_giuint(uint8_t offset, uint16_t clear)
-{
-   uint16_t res;
-
-   res = read_giuint(offset);
-   res &= ~clear;
-   write_giuint(res, offset);
-
-   return res;
-}
-
-static unsigned int startup_giuint_low_irq(unsigned int irq)
-{
-   unsigned int pin;
-
-   pin = GIU_IRQ_TO_PIN(irq);
-   write_giuint((uint16_t)1 << pin, GIUINTSTATL);
-   set_giuint(GIUINTENL, (uint16_t)1 << pin);
-
-   return 0;
-}
-
-static void shutdown_giuint_low_irq(unsigned int irq)
-{
-   clear_giuint(GIUINTENL, (uint16_t)1 << GIU_IRQ_TO_PIN(irq));
-}
-
-static void enable_giuint_low_irq(unsigned int irq)
-{
-   set_giuint(GIUINTENL, (uint16_t)1 << GIU_IRQ_TO_PIN(irq));
-}
-
-#define disable_giuint_low_irq shutdown_giuint_low_irq
-
-static void ack_giuint_low_irq(unsigned int irq)
-{
-   unsigned int pin;
-
-   pin = GIU_IRQ_TO_PIN(irq);
-   clear_giuint(GIUINTENL, (uint16_t)1 << pin);
-   write_giuint((uint16_t)1 << pin, GIUINTSTATL);
-}
-
-static void end_giuint_low_irq(unsigned int irq)
-{
-   if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
-   set_giuint(GIUINTENL, (uint16_t)1 << GIU_IRQ_TO_PIN(irq));
-}
-
-static struct

[PATCH] mips: remove obsolete GIU driver for vr41xx

2005-07-17 Thread Yoichi Yuasa
Hi,

This patch has removed obsolete GIU driver for vr41xx.
This patch already has been applied to mips tree.

Yoichi

-- 
Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff mm1-orig/arch/mips/vr41xx/common/Makefile 
mm1/arch/mips/vr41xx/common/Makefile
--- mm1-orig/arch/mips/vr41xx/common/Makefile   2005-07-13 13:46:46.0 
+0900
+++ mm1/arch/mips/vr41xx/common/Makefile2005-07-16 23:23:48.0 
+0900
@@ -2,7 +2,7 @@
 # Makefile for common code of the NEC VR4100 series.
 #
 
-obj-y  += bcu.o cmu.o giu.o icu.o init.o int-handler.o 
pmu.o
+obj-y  += bcu.o cmu.o icu.o init.o int-handler.o pmu.o
 obj-$(CONFIG_VRC4173)  += vrc4173.o
 
 EXTRA_AFLAGS := $(CFLAGS)
diff -urN -X dontdiff mm1-orig/arch/mips/vr41xx/common/giu.c 
mm1/arch/mips/vr41xx/common/giu.c
--- mm1-orig/arch/mips/vr41xx/common/giu.c  2005-07-13 13:46:46.0 
+0900
+++ mm1/arch/mips/vr41xx/common/giu.c   1970-01-01 09:00:00.0 +0900
@@ -1,455 +0,0 @@
-/*
- *  giu.c, General-purpose I/O Unit Interrupt routines for NEC VR4100 series.
- *
- *  Copyright (C) 2002 MontaVista Software Inc.
- *Author: Yoichi Yuasa [EMAIL PROTECTED] or [EMAIL PROTECTED]
- *  Copyright (C) 2003-2004  Yoichi Yuasa [EMAIL PROTECTED]
- *  Copyright (C) 2005 Ralf Baechle ([EMAIL PROTECTED])
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-/*
- * Changes:
- *  MontaVista Software Inc. [EMAIL PROTECTED] or [EMAIL PROTECTED]
- *  - New creation, NEC VR4111, VR4121, VR4122 and VR4131 are supported.
- *
- *  Yoichi Yuasa [EMAIL PROTECTED]
- *  - Added support for NEC VR4133.
- *  - Removed board_irq_init.
- */
-#include linux/errno.h
-#include linux/init.h
-#include linux/irq.h
-#include linux/kernel.h
-#include linux/module.h
-#include linux/smp.h
-#include linux/types.h
-
-#include asm/cpu.h
-#include asm/io.h
-#include asm/vr41xx/vr41xx.h
-
-#define GIUIOSELL_TYPE1KSEG1ADDR(0x0b000100)
-#define GIUIOSELL_TYPE2KSEG1ADDR(0x0f000140)
-
-#define GIUIOSELL  0x00
-#define GIUIOSELH  0x02
-#define GIUINTSTATL0x08
-#define GIUINTSTATH0x0a
-#define GIUINTENL  0x0c
-#define GIUINTENH  0x0e
-#define GIUINTTYPL 0x10
-#define GIUINTTYPH 0x12
-#define GIUINTALSELL   0x14
-#define GIUINTALSELH   0x16
-#define GIUINTHTSELL   0x18
-#define GIUINTHTSELH   0x1a
-#define GIUFEDGEINHL   0x20
-#define GIUFEDGEINHH   0x22
-#define GIUREDGEINHL   0x24
-#define GIUREDGEINHH   0x26
-
-static uint32_t giu_base;
-
-static struct irqaction giu_cascade = {
-   .handler= no_action,
-   .mask   = CPU_MASK_NONE,
-   .name   = cascade,
-};
-
-#define read_giuint(offset)readw(giu_base + (offset))
-#define write_giuint(val, offset)  writew((val), giu_base + (offset))
-
-#define GIUINT_HIGH_OFFSET 16
-
-static inline uint16_t set_giuint(uint8_t offset, uint16_t set)
-{
-   uint16_t res;
-
-   res = read_giuint(offset);
-   res |= set;
-   write_giuint(res, offset);
-
-   return res;
-}
-
-static inline uint16_t clear_giuint(uint8_t offset, uint16_t clear)
-{
-   uint16_t res;
-
-   res = read_giuint(offset);
-   res = ~clear;
-   write_giuint(res, offset);
-
-   return res;
-}
-
-static unsigned int startup_giuint_low_irq(unsigned int irq)
-{
-   unsigned int pin;
-
-   pin = GIU_IRQ_TO_PIN(irq);
-   write_giuint((uint16_t)1  pin, GIUINTSTATL);
-   set_giuint(GIUINTENL, (uint16_t)1  pin);
-
-   return 0;
-}
-
-static void shutdown_giuint_low_irq(unsigned int irq)
-{
-   clear_giuint(GIUINTENL, (uint16_t)1  GIU_IRQ_TO_PIN(irq));
-}
-
-static void enable_giuint_low_irq(unsigned int irq)
-{
-   set_giuint(GIUINTENL, (uint16_t)1  GIU_IRQ_TO_PIN(irq));
-}
-
-#define disable_giuint_low_irq shutdown_giuint_low_irq
-
-static void ack_giuint_low_irq(unsigned int irq)
-{
-   unsigned int pin;
-
-   pin = GIU_IRQ_TO_PIN(irq);
-   clear_giuint(GIUINTENL, (uint16_t)1  pin);
-   write_giuint((uint16_t)1  pin, GIUINTSTATL);
-}
-
-static void end_giuint_low_irq(unsigned int irq)
-{
-   if (!(irq_desc[irq].status  (IRQ_DISABLED | IRQ_INPROGRESS)))
-   set_giuint(GIUINTENL, (uint16_t)1  GIU_IRQ_TO_PIN(irq));
-}
-
-static struct

Re: 2.6.13-rc3-mm1

2005-07-15 Thread Yoichi Yuasa
Hi,

On Fri, 15 Jul 2005 16:23:49 -0700
Andrew Morton <[EMAIL PROTECTED]> wrote:

> Yoichi Yuasa <[EMAIL PROTECTED]> wrote:
> >
> > Hi Andrew
> > 
> > I got the following error.
> > 
> > make ARCH=mips oldconfig
> > scripts/kconfig/conf -o arch/mips/Kconfig
> > drivers/video/Kconfig:7:warning: type of 'FB' redefined from 'boolean' to 
> > 'tristate'
> > 
> > file drivers/char/speakup/Kconfig already scanned?
> > make[1]: *** [oldconfig] Error 1
> > make: *** [oldconfig] Error 2
> > 
> 
> Well arch/mips/Kconfig is defining CONFIG_FB as bool and
> drivers/video/Kconfig was changed a while ago to define it as tristate.  I
> assume this failure also happens in linus's current tree.  
> 
> It seems odd that mips is privately duplicating the generic code's
> definition.  Maybe that needs to be taken out of there.

Yes, It can be removed.

> I'll cc the fbdev guys - could someone please come up with fix?  It's a
> showstopper for the MIPS architecture.

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff mm1-orig/arch/mips/Kconfig mm1/arch/mips/Kconfig
--- mm1-orig/arch/mips/Kconfig  2005-07-15 21:44:53.0 +0900
+++ mm1/arch/mips/Kconfig   2005-07-16 10:01:29.0 +0900
@@ -1090,41 +1090,6 @@
depends on MACH_JAZZ || SNI_RM200_PCI || SGI_IP22 || SGI_IP32
default y
 
-config FB
-   bool
-   depends on MIPS_MAGNUM_4000 || OLIVETTI_M700
-   default y
-   ---help---
- The frame buffer device provides an abstraction for the graphics
- hardware. It represents the frame buffer of some video hardware and
- allows application software to access the graphics hardware through
- a well-defined interface, so the software doesn't need to know
- anything about the low-level (hardware register) stuff.
-
- Frame buffer devices work identically across the different
- architectures supported by Linux and make the implementation of
- application programs easier and more portable; at this point, an X
- server exists which uses the frame buffer device exclusively.
- On several non-X86 architectures, the frame buffer device is the
- only way to use the graphics hardware.
-
- The device is accessed through special device nodes, usually located
- in the /dev directory, i.e. /dev/fb*.
-
- You need an utility program called fbset to make full use of frame
- buffer devices. Please read 
- and the Framebuffer-HOWTO at <http://www.tldp.org/docs.html#howto>
- for more information.
-
- Say Y here and to the driver for your graphics board below if you
- are compiling a kernel for a non-x86 architecture.
-
- If you are compiling for the x86 architecture, you can say Y if you
- want to play with it, but it is not essential. Please note that
- running graphical applications that directly touch the hardware
- (e.g. an accelerated X server) and that are not frame buffer
- device-aware may cause unexpected results. If unsure, say N.
-
 config HAVE_STD_PC_SERIAL_PORT
bool
 
diff -urN -X dontdiff mm1-orig/drivers/video/Kconfig mm1/drivers/video/Kconfig
--- mm1-orig/drivers/video/Kconfig  2005-07-13 13:46:46.0 +0900
+++ mm1/drivers/video/Kconfig   2005-07-16 09:56:59.0 +0900
@@ -1399,8 +1399,8 @@
  Say Y here to enable kernel support for the on-board framebuffer.
 
 config FB_G364
-   bool
-   depends on MIPS_MAGNUM_4000 || OLIVETTI_M700
+   bool "G364 frame buffer support"
+   depends on (FB = y) && (MIPS_MAGNUM_4000 || OLIVETTI_M700)
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.13-rc3-mm1

2005-07-15 Thread Yoichi Yuasa
Hi again,

On Sat, 16 Jul 2005 07:52:42 +0900
Yoichi Yuasa <[EMAIL PROTECTED]> wrote:

> Hi Andrew
> 
> I got the following error.
> 
> make ARCH=mips oldconfig
> scripts/kconfig/conf -o arch/mips/Kconfig
> drivers/video/Kconfig:7:warning: type of 'FB' redefined from 'boolean' to 
> 'tristate'
> 
> file drivers/char/speakup/Kconfig already scanned?
> make[1]: *** [oldconfig] Error 1
> make: *** [oldconfig] Error 2
> 
> 
> gregkh-driver-speakup-core.patch
> 
>  arch/arm/Kconfig |1
>  arch/mips/Kconfig|2
>  arch/sparc64/Kconfig |2
> 
> It is not necessary to change these three files. 
> Please remove these changes.

Sorry, I mistook.
It is not necessary to change for mips.
Please remove mips Kconfig change.

Yoichi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.13-rc3-mm1

2005-07-15 Thread Yoichi Yuasa
Hi Andrew

I got the following error.

make ARCH=mips oldconfig
scripts/kconfig/conf -o arch/mips/Kconfig
drivers/video/Kconfig:7:warning: type of 'FB' redefined from 'boolean' to 
'tristate'

file drivers/char/speakup/Kconfig already scanned?
make[1]: *** [oldconfig] Error 1
make: *** [oldconfig] Error 2


gregkh-driver-speakup-core.patch

 arch/arm/Kconfig |1
 arch/mips/Kconfig|2
 arch/sparc64/Kconfig |2

It is not necessary to change these three files. 
Please remove these changes.

Yoichi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.13-rc3-mm1

2005-07-15 Thread Yoichi Yuasa
Hi Andrew

I got the following error.

make ARCH=mips oldconfig
scripts/kconfig/conf -o arch/mips/Kconfig
drivers/video/Kconfig:7:warning: type of 'FB' redefined from 'boolean' to 
'tristate'

file drivers/char/speakup/Kconfig already scanned?
make[1]: *** [oldconfig] Error 1
make: *** [oldconfig] Error 2


gregkh-driver-speakup-core.patch

 arch/arm/Kconfig |1
 arch/mips/Kconfig|2
 arch/sparc64/Kconfig |2

It is not necessary to change these three files. 
Please remove these changes.

Yoichi
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.13-rc3-mm1

2005-07-15 Thread Yoichi Yuasa
Hi again,

On Sat, 16 Jul 2005 07:52:42 +0900
Yoichi Yuasa [EMAIL PROTECTED] wrote:

 Hi Andrew
 
 I got the following error.
 
 make ARCH=mips oldconfig
 scripts/kconfig/conf -o arch/mips/Kconfig
 drivers/video/Kconfig:7:warning: type of 'FB' redefined from 'boolean' to 
 'tristate'
 
 file drivers/char/speakup/Kconfig already scanned?
 make[1]: *** [oldconfig] Error 1
 make: *** [oldconfig] Error 2
 
 
 gregkh-driver-speakup-core.patch
 
  arch/arm/Kconfig |1
  arch/mips/Kconfig|2
  arch/sparc64/Kconfig |2
 
 It is not necessary to change these three files. 
 Please remove these changes.

Sorry, I mistook.
It is not necessary to change for mips.
Please remove mips Kconfig change.

Yoichi
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.13-rc3-mm1

2005-07-15 Thread Yoichi Yuasa
Hi,

On Fri, 15 Jul 2005 16:23:49 -0700
Andrew Morton [EMAIL PROTECTED] wrote:

 Yoichi Yuasa [EMAIL PROTECTED] wrote:
 
  Hi Andrew
  
  I got the following error.
  
  make ARCH=mips oldconfig
  scripts/kconfig/conf -o arch/mips/Kconfig
  drivers/video/Kconfig:7:warning: type of 'FB' redefined from 'boolean' to 
  'tristate'
  
  file drivers/char/speakup/Kconfig already scanned?
  make[1]: *** [oldconfig] Error 1
  make: *** [oldconfig] Error 2
  
 
 Well arch/mips/Kconfig is defining CONFIG_FB as bool and
 drivers/video/Kconfig was changed a while ago to define it as tristate.  I
 assume this failure also happens in linus's current tree.  
 
 It seems odd that mips is privately duplicating the generic code's
 definition.  Maybe that needs to be taken out of there.

Yes, It can be removed.

 I'll cc the fbdev guys - could someone please come up with fix?  It's a
 showstopper for the MIPS architecture.

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff mm1-orig/arch/mips/Kconfig mm1/arch/mips/Kconfig
--- mm1-orig/arch/mips/Kconfig  2005-07-15 21:44:53.0 +0900
+++ mm1/arch/mips/Kconfig   2005-07-16 10:01:29.0 +0900
@@ -1090,41 +1090,6 @@
depends on MACH_JAZZ || SNI_RM200_PCI || SGI_IP22 || SGI_IP32
default y
 
-config FB
-   bool
-   depends on MIPS_MAGNUM_4000 || OLIVETTI_M700
-   default y
-   ---help---
- The frame buffer device provides an abstraction for the graphics
- hardware. It represents the frame buffer of some video hardware and
- allows application software to access the graphics hardware through
- a well-defined interface, so the software doesn't need to know
- anything about the low-level (hardware register) stuff.
-
- Frame buffer devices work identically across the different
- architectures supported by Linux and make the implementation of
- application programs easier and more portable; at this point, an X
- server exists which uses the frame buffer device exclusively.
- On several non-X86 architectures, the frame buffer device is the
- only way to use the graphics hardware.
-
- The device is accessed through special device nodes, usually located
- in the /dev directory, i.e. /dev/fb*.
-
- You need an utility program called fbset to make full use of frame
- buffer devices. Please read file:Documentation/fb/framebuffer.txt
- and the Framebuffer-HOWTO at http://www.tldp.org/docs.html#howto
- for more information.
-
- Say Y here and to the driver for your graphics board below if you
- are compiling a kernel for a non-x86 architecture.
-
- If you are compiling for the x86 architecture, you can say Y if you
- want to play with it, but it is not essential. Please note that
- running graphical applications that directly touch the hardware
- (e.g. an accelerated X server) and that are not frame buffer
- device-aware may cause unexpected results. If unsure, say N.
-
 config HAVE_STD_PC_SERIAL_PORT
bool
 
diff -urN -X dontdiff mm1-orig/drivers/video/Kconfig mm1/drivers/video/Kconfig
--- mm1-orig/drivers/video/Kconfig  2005-07-13 13:46:46.0 +0900
+++ mm1/drivers/video/Kconfig   2005-07-16 09:56:59.0 +0900
@@ -1399,8 +1399,8 @@
  Say Y here to enable kernel support for the on-board framebuffer.
 
 config FB_G364
-   bool
-   depends on MIPS_MAGNUM_4000 || OLIVETTI_M700
+   bool G364 frame buffer support
+   depends on (FB = y)  (MIPS_MAGNUM_4000 || OLIVETTI_M700)
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2.6.13-rc2-mm1] add PCI IRQ initialization to TB0219

2005-07-09 Thread Yoichi Yuasa
Hi,

This patch had added PCI IRQ initialization to TB0219 driver.
Please apply.

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff mm1-orig/drivers/char/tb0219.c mm1/drivers/char/tb0219.c
--- mm1-orig/drivers/char/tb0219.c  2005-07-06 12:46:33.0 +0900
+++ mm1/drivers/char/tb0219.c   2005-07-09 17:26:34.395047032 +0900
@@ -24,6 +24,8 @@
 
 #include 
 #include 
+#include 
+#include 
 
 MODULE_AUTHOR("Yoichi Yuasa <[EMAIL PROTECTED]>");
 MODULE_DESCRIPTION("TANBAC TB0219 base board driver");
@@ -266,6 +268,21 @@
tb0219_write(TB0219_RESET, 0);
 }
 
+static void tb0219_pci_irq_init(void)
+{
+   /* PCI Slot 1 */
+   vr41xx_set_irq_trigger(TB0219_PCI_SLOT1_PIN, IRQ_TRIGGER_LEVEL, 
IRQ_SIGNAL_THROUGH);
+   vr41xx_set_irq_level(TB0219_PCI_SLOT1_PIN, IRQ_LEVEL_LOW);
+
+   /* PCI Slot 2 */
+   vr41xx_set_irq_trigger(TB0219_PCI_SLOT2_PIN, IRQ_TRIGGER_LEVEL, 
IRQ_SIGNAL_THROUGH);
+   vr41xx_set_irq_level(TB0219_PCI_SLOT2_PIN, IRQ_LEVEL_LOW);
+
+   /* PCI Slot 3 */
+   vr41xx_set_irq_trigger(TB0219_PCI_SLOT3_PIN, IRQ_TRIGGER_LEVEL, 
IRQ_SIGNAL_THROUGH);
+   vr41xx_set_irq_level(TB0219_PCI_SLOT3_PIN, IRQ_LEVEL_LOW);
+}
+
 static int tb0219_probe(struct device *dev)
 {
int retval;
@@ -292,6 +309,8 @@
old_machine_restart = _machine_restart;
_machine_restart = tb0219_restart;
 
+   tb0219_pci_irq_init();
+
if (major == 0) {
major = retval;
printk(KERN_INFO "TB0219: major number %d\n", major);

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


[PATCH 2.6.13-rc2-mm1] add PCI IRQ initialization to TB0219

2005-07-09 Thread Yoichi Yuasa
Hi,

This patch had added PCI IRQ initialization to TB0219 driver.
Please apply.

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff mm1-orig/drivers/char/tb0219.c mm1/drivers/char/tb0219.c
--- mm1-orig/drivers/char/tb0219.c  2005-07-06 12:46:33.0 +0900
+++ mm1/drivers/char/tb0219.c   2005-07-09 17:26:34.395047032 +0900
@@ -24,6 +24,8 @@
 
 #include asm/io.h
 #include asm/reboot.h
+#include asm/vr41xx/giu.h
+#include asm/vr41xx/tb0219.h
 
 MODULE_AUTHOR(Yoichi Yuasa [EMAIL PROTECTED]);
 MODULE_DESCRIPTION(TANBAC TB0219 base board driver);
@@ -266,6 +268,21 @@
tb0219_write(TB0219_RESET, 0);
 }
 
+static void tb0219_pci_irq_init(void)
+{
+   /* PCI Slot 1 */
+   vr41xx_set_irq_trigger(TB0219_PCI_SLOT1_PIN, IRQ_TRIGGER_LEVEL, 
IRQ_SIGNAL_THROUGH);
+   vr41xx_set_irq_level(TB0219_PCI_SLOT1_PIN, IRQ_LEVEL_LOW);
+
+   /* PCI Slot 2 */
+   vr41xx_set_irq_trigger(TB0219_PCI_SLOT2_PIN, IRQ_TRIGGER_LEVEL, 
IRQ_SIGNAL_THROUGH);
+   vr41xx_set_irq_level(TB0219_PCI_SLOT2_PIN, IRQ_LEVEL_LOW);
+
+   /* PCI Slot 3 */
+   vr41xx_set_irq_trigger(TB0219_PCI_SLOT3_PIN, IRQ_TRIGGER_LEVEL, 
IRQ_SIGNAL_THROUGH);
+   vr41xx_set_irq_level(TB0219_PCI_SLOT3_PIN, IRQ_LEVEL_LOW);
+}
+
 static int tb0219_probe(struct device *dev)
 {
int retval;
@@ -292,6 +309,8 @@
old_machine_restart = _machine_restart;
_machine_restart = tb0219_restart;
 
+   tb0219_pci_irq_init();
+
if (major == 0) {
major = retval;
printk(KERN_INFO TB0219: major number %d\n, major);

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.12-rc2-mm3] serial: update NEC VR4100 series serial support

2005-04-13 Thread Yoichi Yuasa
On Wed, 13 Apr 2005 16:02:48 +0100
Russell King <[EMAIL PROTECTED]> wrote:

> On Wed, Apr 13, 2005 at 11:18:27PM +0900, Yoichi Yuasa wrote:
> >  static struct uart_ops early_uart_ops = {
> > -   .set_termios= early_set_termios,
> > +   .set_termios= siu_set_termios,
> >  };
> 
> In this case, you don't need the early_uart_ops here - the standard
> ones will do just as well.  (.set_termios is the only method which
> the console init code will use.)

First, I tested the standerd ops. kernel was crashed.
Now, I'm using early_uart_ops.

I'll test again with standerd ops.

Thanks,

Yoichi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2.6.12-rc2-mm3] serial: update NEC VR4100 series serial support

2005-04-13 Thread Yoichi Yuasa
I had fixed Russell's comment.

On Wed, 30 Mar 2005 10:23:08 +0100
Russell King <[EMAIL PROTECTED]> wrote:

> On Mon, Mar 07, 2005 at 09:20:22PM -0800, [EMAIL PROTECTED] wrote:
> > +static inline const char *siu_type_name(struct uart_port *port)
> > +{
> > +   switch (port->type) {
> > +   case PORT_VR41XX_SIU:
> > +   return "SIU";
> > +   case PORT_VR41XX_DSIU:
> > +   return "DSIU";
> > +   }
> > +
> > +   return "unknown";
> 
> You can return NULL here.

Changed.

> > +static irqreturn_t siu_interrupt(int irq, void *dev_id, struct pt_regs 
> > *regs)
> > +{
> > +   struct uart_port *port;
> > +   uint8_t iir, lsr;
> > +
> > +   if (dev_id == NULL)
> > +   return IRQ_NONE;
> 
> This driver always registers interrupts with a dev_id.  Therefore, this can
> never be NULL.

Removed.

> 
> > +static void siu_shutdown(struct uart_port *port)
> > +{
> > +   unsigned long flags;
> > +   uint8_t lcr;
> > +
> > +   if (port->membase == NULL)
> > +   return;
> 
> How can this happen?  We always shut down a port before we change the
> address.  Maybe this check should be in siu_startup instead?

This check moved to siu_startup.

> > +#ifdef CONFIG_SERIAL_VR41XX_CONSOLE
> > +
> > +static void early_set_termios(struct uart_port *port, struct termios *new,
> > +  struct termios *old)
> > +{



> > +}
> > +
> > +static struct uart_ops early_uart_ops = {
> > +   .set_termios= early_set_termios,
> > +};
> 
> Eww.  Is there a reason why your standard termios setting function can't
> be used?

Now using my standerd termios. It changed.

> > +static int siu_probe(struct device *dev)
> > +{
> > +   struct uart_port *port;
> > +   int num, i, retval;
> > +
> > +   num = siu_init_ports();
> > +   if (num <= 0)
> > +   return -ENODEV;
> > +
> > +   siu_uart_driver.nr = num;
> > +   retval = uart_register_driver(_uart_driver);
> > +   if (retval)
> > +   return retval;
> > +
> > +   for (i = 0; i < num; i++) {
> > +   port = _uart_ports[i];
> > +   port->ops = _uart_ops;
> > +   port->dev = dev;
> > +
> > +   retval = uart_add_one_port(_uart_driver, port);
> > +   if (retval)
> > +   break;
> > +   }
> 
> If port 1 fails to be registered...
> 
> > +
> > +   if (i == 0 && retval < 0) {
> > +   uart_unregister_driver(_uart_driver);
> > +   return retval;
> > +   }
> > +
> > +   return 0;
> > +}
> > +
> > +static int siu_remove(struct device *dev)
> > +{
> > +   struct uart_port *port;
> > +   int i;
> > +
> > +   for (i = 0; i < siu_uart_driver.nr; i++) {
> > +   port = _uart_ports[i];
> > +   if (port->dev == dev) {
> 
> ... we try to unregister it here, because port->dev was initialised.
> Maybe you want to NULL out port->dev in the above function when that
> happens?

Fixed.

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff rc1-mm3-orig/drivers/serial/vr41xx_siu.c 
rc1-mm3/drivers/serial/vr41xx_siu.c
--- rc1-mm3-orig/drivers/serial/vr41xx_siu.cMon Mar 28 21:08:04 2005
+++ rc1-mm3/drivers/serial/vr41xx_siu.c Thu Mar 31 12:47:54 2005
@@ -234,7 +234,7 @@
return "DSIU";
}
 
-   return "unknown";
+   return NULL;
 }
 
 static unsigned int siu_tx_empty(struct uart_port *port)
@@ -484,9 +484,6 @@
struct uart_port *port;
uint8_t iir, lsr;
 
-   if (dev_id == NULL)
-   return IRQ_NONE;
-
port = (struct uart_port *)dev_id;
 
iir = siu_read(port, UART_IIR);
@@ -509,6 +506,9 @@
 {
int retval;
 
+   if (port->membase == NULL)
+   return -ENODEV;
+
siu_clear_fifo(port);
 
(void)siu_read(port, UART_LSR);
@@ -547,9 +547,6 @@
unsigned long flags;
uint8_t lcr;
 
-   if (port->membase == NULL)
-   return;
-
siu_write(port, UART_IER, 0);
 
spin_lock_irqsave(>lock, flags);
@@ -804,51 +801,8 @@
 
 #ifdef CONFIG_SERIAL_VR41XX_CONSOLE
 
-static void early_set_termios(struct uart_port *port, struct termios *new,
-  struct termios *old)
-{
-   tcflag_t c_cflag;
-   uint8_t lcr;
-   unsigned int baud, quot;
-
-   c_cflag = new->c_cflag;
-   switch (c_cflag & CSIZE) {
-   case CS5:
-   lcr = UART_LCR_WLEN5;

[PATCH 2.6.12-rc2-mm3] serial: update NEC VR4100 series serial support

2005-04-13 Thread Yoichi Yuasa
I had fixed Russell's comment.

On Wed, 30 Mar 2005 10:23:08 +0100
Russell King [EMAIL PROTECTED] wrote:

 On Mon, Mar 07, 2005 at 09:20:22PM -0800, [EMAIL PROTECTED] wrote:
  +static inline const char *siu_type_name(struct uart_port *port)
  +{
  +   switch (port-type) {
  +   case PORT_VR41XX_SIU:
  +   return SIU;
  +   case PORT_VR41XX_DSIU:
  +   return DSIU;
  +   }
  +
  +   return unknown;
 
 You can return NULL here.

Changed.

  +static irqreturn_t siu_interrupt(int irq, void *dev_id, struct pt_regs 
  *regs)
  +{
  +   struct uart_port *port;
  +   uint8_t iir, lsr;
  +
  +   if (dev_id == NULL)
  +   return IRQ_NONE;
 
 This driver always registers interrupts with a dev_id.  Therefore, this can
 never be NULL.

Removed.

 
  +static void siu_shutdown(struct uart_port *port)
  +{
  +   unsigned long flags;
  +   uint8_t lcr;
  +
  +   if (port-membase == NULL)
  +   return;
 
 How can this happen?  We always shut down a port before we change the
 address.  Maybe this check should be in siu_startup instead?

This check moved to siu_startup.

  +#ifdef CONFIG_SERIAL_VR41XX_CONSOLE
  +
  +static void early_set_termios(struct uart_port *port, struct termios *new,
  +  struct termios *old)
  +{

snip

  +}
  +
  +static struct uart_ops early_uart_ops = {
  +   .set_termios= early_set_termios,
  +};
 
 Eww.  Is there a reason why your standard termios setting function can't
 be used?

Now using my standerd termios. It changed.

  +static int siu_probe(struct device *dev)
  +{
  +   struct uart_port *port;
  +   int num, i, retval;
  +
  +   num = siu_init_ports();
  +   if (num = 0)
  +   return -ENODEV;
  +
  +   siu_uart_driver.nr = num;
  +   retval = uart_register_driver(siu_uart_driver);
  +   if (retval)
  +   return retval;
  +
  +   for (i = 0; i  num; i++) {
  +   port = siu_uart_ports[i];
  +   port-ops = siu_uart_ops;
  +   port-dev = dev;
  +
  +   retval = uart_add_one_port(siu_uart_driver, port);
  +   if (retval)
  +   break;
  +   }
 
 If port 1 fails to be registered...
 
  +
  +   if (i == 0  retval  0) {
  +   uart_unregister_driver(siu_uart_driver);
  +   return retval;
  +   }
  +
  +   return 0;
  +}
  +
  +static int siu_remove(struct device *dev)
  +{
  +   struct uart_port *port;
  +   int i;
  +
  +   for (i = 0; i  siu_uart_driver.nr; i++) {
  +   port = siu_uart_ports[i];
  +   if (port-dev == dev) {
 
 ... we try to unregister it here, because port-dev was initialised.
 Maybe you want to NULL out port-dev in the above function when that
 happens?

Fixed.

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff rc1-mm3-orig/drivers/serial/vr41xx_siu.c 
rc1-mm3/drivers/serial/vr41xx_siu.c
--- rc1-mm3-orig/drivers/serial/vr41xx_siu.cMon Mar 28 21:08:04 2005
+++ rc1-mm3/drivers/serial/vr41xx_siu.c Thu Mar 31 12:47:54 2005
@@ -234,7 +234,7 @@
return DSIU;
}
 
-   return unknown;
+   return NULL;
 }
 
 static unsigned int siu_tx_empty(struct uart_port *port)
@@ -484,9 +484,6 @@
struct uart_port *port;
uint8_t iir, lsr;
 
-   if (dev_id == NULL)
-   return IRQ_NONE;
-
port = (struct uart_port *)dev_id;
 
iir = siu_read(port, UART_IIR);
@@ -509,6 +506,9 @@
 {
int retval;
 
+   if (port-membase == NULL)
+   return -ENODEV;
+
siu_clear_fifo(port);
 
(void)siu_read(port, UART_LSR);
@@ -547,9 +547,6 @@
unsigned long flags;
uint8_t lcr;
 
-   if (port-membase == NULL)
-   return;
-
siu_write(port, UART_IER, 0);
 
spin_lock_irqsave(port-lock, flags);
@@ -804,51 +801,8 @@
 
 #ifdef CONFIG_SERIAL_VR41XX_CONSOLE
 
-static void early_set_termios(struct uart_port *port, struct termios *new,
-  struct termios *old)
-{
-   tcflag_t c_cflag;
-   uint8_t lcr;
-   unsigned int baud, quot;
-
-   c_cflag = new-c_cflag;
-   switch (c_cflag  CSIZE) {
-   case CS5:
-   lcr = UART_LCR_WLEN5;
-   break;
-   case CS6:
-   lcr = UART_LCR_WLEN6;
-   break;
-   case CS7:
-   lcr = UART_LCR_WLEN7;
-   break;
-   default:
-   lcr = UART_LCR_WLEN8;
-   break;
-   }
-
-   if (c_cflag  CSTOPB)
-   lcr |= UART_LCR_STOP;
-   if (c_cflag  PARENB)
-   lcr |= UART_LCR_PARITY;
-   if ((c_cflag  PARODD) != PARODD)
-   lcr |= UART_LCR_EPAR;
-   if (c_cflag  CMSPAR)
-   lcr |= UART_LCR_SPAR;
-
-   baud = uart_get_baud_rate(port, new, old, 0, port-uartclk/16);
-   quot = uart_get_divisor(port, baud);
-
-   siu_write(port, UART_LCR, lcr | UART_LCR_DLAB);
-
-   siu_write(port, UART_DLL, (uint8_t)quot);
-   siu_write(port

Re: [PATCH 2.6.12-rc2-mm3] serial: update NEC VR4100 series serial support

2005-04-13 Thread Yoichi Yuasa
On Wed, 13 Apr 2005 16:02:48 +0100
Russell King [EMAIL PROTECTED] wrote:

 On Wed, Apr 13, 2005 at 11:18:27PM +0900, Yoichi Yuasa wrote:
   static struct uart_ops early_uart_ops = {
  -   .set_termios= early_set_termios,
  +   .set_termios= siu_set_termios,
   };
 
 In this case, you don't need the early_uart_ops here - the standard
 ones will do just as well.  (.set_termios is the only method which
 the console init code will use.)

First, I tested the standerd ops. kernel was crashed.
Now, I'm using early_uart_ops.

I'll test again with standerd ops.

Thanks,

Yoichi
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2.6.12-rc2-mm1] mips: remove #include two times

2005-04-06 Thread Yoichi Yuasa
This patch removes #include .
Because it includes two times.

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff rc2-mm1-orig/arch/mips/kernel/ptrace.c 
rc2-mm1/arch/mips/kernel/ptrace.c
--- rc2-mm1-orig/arch/mips/kernel/ptrace.c  Tue Apr  5 23:19:16 2005
+++ rc2-mm1/arch/mips/kernel/ptrace.c   Tue Apr  5 23:27:50 2005
@@ -26,7 +26,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 


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


[PATCH 2.6.12-rc2-mm1] mips: remove #include linux/audit.h two times

2005-04-06 Thread Yoichi Yuasa
This patch removes #include linux/audit.h.
Because it includes two times.

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff rc2-mm1-orig/arch/mips/kernel/ptrace.c 
rc2-mm1/arch/mips/kernel/ptrace.c
--- rc2-mm1-orig/arch/mips/kernel/ptrace.c  Tue Apr  5 23:19:16 2005
+++ rc2-mm1/arch/mips/kernel/ptrace.c   Tue Apr  5 23:27:50 2005
@@ -26,7 +26,6 @@
 #include linux/smp_lock.h
 #include linux/user.h
 #include linux/security.h
-#include linux/audit.h
 
 #include asm/cpu.h
 #include asm/fpu.h


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


  1   2   >