fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / arm / mach-footbridge / netwinder-hw.c
index c81775b..a1f381c 100644 (file)
@@ -5,16 +5,21 @@
  *
  * Copyright (C) 1998, 1999 Russell King, Phil Blundell
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 
+#include <asm/hardware/dec21285.h>
 #include <asm/io.h>
 #include <asm/leds.h>
 #include <asm/mach-types.h>
+#include <asm/setup.h>
+
+#include <asm/mach/arch.h>
+
+#include "common.h"
 
 #define IRDA_IO_BASE           0x180
 #define GP1_IO_BASE            0x338
@@ -52,7 +57,7 @@ static inline void wb977_ww(int reg, int val)
        outb(reg, 0x370);
        outb(val >> 8, 0x371);
        outb(reg + 1, 0x370);
-       outb(val, 0x371);
+       outb(val & 255, 0x371);
 }
 
 #define wb977_device_select(dev)       wb977_wb(0x07, dev)
@@ -62,7 +67,7 @@ static inline void wb977_ww(int reg, int val)
 /*
  * This is a lock for accessing ports GP1_IO_BASE and GP2_IO_BASE
  */
-spinlock_t gpio_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(gpio_lock);
 
 static unsigned int current_gpio_op;
 static unsigned int current_gpio_io;
@@ -482,7 +487,7 @@ static inline void rwa010_waveartist_init(int base, int irq, int dma)
        WRITE_RWA(7, 0);
 
        dprintk("WaveArtist base: ");
-       WRITE_RWA(0x61, base);
+       WRITE_RWA(0x61, base & 255);
        i = inb(0x203);
 
        WRITE_RWA(0x60, base >> 8);
@@ -504,7 +509,7 @@ static inline void rwa010_soundblaster_init(int sb_base, int al_base, int irq, i
        WRITE_RWA(7, 1);
 
        dprintk("SoundBlaster base: ");
-       WRITE_RWA(0x61, sb_base);
+       WRITE_RWA(0x61, sb_base & 255);
        i = inb(0x203);
 
        WRITE_RWA(0x60, sb_base >> 8);
@@ -519,7 +524,7 @@ static inline void rwa010_soundblaster_init(int sb_base, int al_base, int irq, i
        dprintk("%d (%d)\n", inb(0x203), dma);
 
        dprintk("AdLib base: ");
-       WRITE_RWA(0x63, al_base);
+       WRITE_RWA(0x63, al_base & 255);
        i = inb(0x203);
 
        WRITE_RWA(0x62, al_base >> 8);
@@ -595,6 +600,7 @@ EXPORT_SYMBOL(gpio_lock);
 EXPORT_SYMBOL(gpio_modify_op);
 EXPORT_SYMBOL(gpio_modify_io);
 EXPORT_SYMBOL(cpld_modify);
+EXPORT_SYMBOL(gpio_read);
 
 /*
  * Initialise any other hardware after we've got the PCI bus
@@ -618,3 +624,39 @@ static int __init nw_hw_init(void)
 }
 
 __initcall(nw_hw_init);
+
+/*
+ * Older NeTTroms either do not provide a parameters
+ * page, or they don't supply correct information in
+ * the parameter page.
+ */
+static void __init
+fixup_netwinder(struct machine_desc *desc, struct tag *tags,
+               char **cmdline, struct meminfo *mi)
+{
+#ifdef CONFIG_ISAPNP
+       extern int isapnp_disable;
+
+       /*
+        * We must not use the kernels ISAPnP code
+        * on the NetWinder - it will reset the settings
+        * for the WaveArtist chip and render it inoperable.
+        */
+       isapnp_disable = 1;
+#endif
+}
+
+MACHINE_START(NETWINDER, "Rebel-NetWinder")
+       /* Maintainer: Russell King/Rebel.com */
+       .phys_io        = DC21285_ARMCSR_BASE,
+       .io_pg_offst    = ((0xfe000000) >> 18) & 0xfffc,
+       .boot_params    = 0x00000100,
+       .video_start    = 0x000a0000,
+       .video_end      = 0x000bffff,
+       .reserve_lp0    = 1,
+       .reserve_lp2    = 1,
+       .fixup          = fixup_netwinder,
+       .map_io         = footbridge_map_io,
+       .init_irq       = footbridge_init_irq,
+       .timer          = &isa_timer,
+MACHINE_END