linux-mips-fnet
[Top] [All Lists]

Re: M700-10/3c503.c

To: linux-mips@fnet.fr
Subject: Re: M700-10/3c503.c
From: Systemkennung Linux <linux@mailhost.uni-koblenz.de>
Date: Mon, 25 Mar 1996 01:30:15 +0100 (MET)
In-reply-to: <199603241142.MAA26359@pallas.spacetec.no> from "Tor Arntsen" at Mar 24, 96 12:42:07 pm
Hi,

> >Is maybe the 'readb' too PC/x86 oriented?
> 
> Never mind, I guess it's not really the 'readb', it's the address, as
> the shared memory support is non-existing I believe..
> The 3c503.c code tries to detect the shared memory before it touches the
> ports, as a way to avoid "unnecessary" port probing.  Failing that, it
> continues with port probing the way ne.c does it.  
> I've jumpered the board to PIO and #if 0'ed the shared memory detection code,
> and then it finds it just fine.
> 
> I've still not got it to actually *work*, but I keep trying..

Try the diff appended below; the code is untested as I don't have a shared
memory card at hand.

   Ralf

--- /home/ralf/release/v1.3/linux-1.3.62/include/asm-mips/io.h  Wed Jan 10 
02:48:55 1996
+++ include/asm-mips/io.h       Sun Mar 24 23:45:49 1996
@@ -68,27 +68,33 @@
 #define bus_to_virt phys_to_virt
 
 /*
+ * isa_slot_offset is the address where E(ISA) busaddress 0 is is mapped
+ * for the processor.
+ */
+extern unsigned long isa_slot_offset;
+
+/*
  * readX/writeX() are used to access memory mapped devices. On some
  * architectures the memory mapped IO stuff needs to be accessed
  * differently. On the x86 architecture, we just read/write the
  * memory location directly.
  */
-#define readb(addr) (*(volatile unsigned char *) (addr))
-#define readw(addr) (*(volatile unsigned short *) (addr))
-#define readl(addr) (*(volatile unsigned int *) (addr))
+#define readb(addr) (*(volatile unsigned char *) ((isa_slot_offset + (unsigned 
long)addr))
+#define readw(addr) (*(volatile unsigned short *) ((isa_slot_offset + 
(unsigned long)addr))
+#define readl(addr) (*(volatile unsigned int *) ((isa_slot_offset + (unsigned 
long)addr))
 
-#define writeb(b,addr) ((*(volatile unsigned char *) (addr)) = (b))
-#define writew(b,addr) ((*(volatile unsigned short *) (addr)) = (b))
-#define writel(b,addr) ((*(volatile unsigned int *) (addr)) = (b))
+#define writeb(b,addr) ((*(volatile unsigned char *) ((isa_slot_offset + 
(unsigned long)addr)) = (b))
+#define writew(b,addr) ((*(volatile unsigned short *) ((isa_slot_offset + 
(unsigned long)addr)) = (b))
+#define writel(b,addr) ((*(volatile unsigned int *) ((isa_slot_offset + 
(unsigned long)addr)) = (b))
 
-#define memset_io(a,b,c)       memset((void *)(a),(b),(c))
-#define memcpy_fromio(a,b,c)   memcpy((a),(void *)(b),(c))
-#define memcpy_toio(a,b,c)     memcpy((void *)(a),(b),(c))
+#define memset_io(a,b,c)       memset((void *)(isa_slot_offset + (unsigned 
long)a),(b),(c))
+#define memcpy_fromio(a,b,c)   memcpy((a),(void *)(isa_slot_offset + (unsigned 
long)b),(c))
+#define memcpy_toio(a,b,c)     memcpy((void *)(isa_slot_offset + (unsigned 
long)a),(b),(c))
 
 /*
  * Again, MIPS does not require mem IO specific function.
+ * (Not shure about this one ...)
  */
-
 #define eth_io_copy_and_sum(a,b,c,d)   eth_copy_and_sum((a),(void 
*)(b),(c),(d))
 
 /*
--- /home/ralf/release/v1.3/linux-1.3.62/arch/mips/kernel/setup.c       Sun Feb 
11 05:05:29 1996
+++ arch/mips/kernel/setup.c    Sun Mar 24 23:50:15 1996
@@ -22,6 +22,7 @@
 
 #include <asm/asm.h>
 #include <asm/bootinfo.h>
+#include <asm/io.h>
 #include <asm/vector.h>
 #include <asm/segment.h>
 #include <asm/stackframe.h>
@@ -375,27 +376,32 @@
 #ifdef CONFIG_ACER_PICA_61
        case MACH_ACER_PICA_61:
                feature = &acer_pica_61_feature;
+               isa_slot_offset = 0xe3000000;
                break;
 #endif
 #ifdef CONFIG_DECSTATION
        case MACH_DECSTATION:
                feature = &decstation_feature;
+               /* No need to set isa_slot_offset */
                break;
 #endif
 #ifdef CONFIG_DESKSTATION_RPC44
        case MACH_DESKSTATION_RPC44:
                mips_memory_upper = KSEG0 + (32 << 20); /* xxx fixme imp */
                feature = &deskstation_rpc44_feature;
+               isa_slot_offset = 0xa0000000;
                break;
 #endif
 #ifdef CONFIG_DESKSTATION_TYNE
        case MACH_DESKSTATION_TYNE:
                feature = &deskstation_tyne_feature;
+               isa_slot_offset = 0xa0000000;
                break;
 #endif
 #ifdef CONFIG_MIPS_MAGNUM_4000
        case MACH_MIPS_MAGNUM_4000:
                feature = &mips_magnum_4000_feature;
+               isa_slot_offset = 0xe3000000;
                break;
 #endif
        default:

<Prev in Thread] Current Thread [Next in Thread>