Date: Thu, 25 Sep 1997 20:54:05 +0200 (MET DST)
From: Wout Klaren <W.Klaren@inter.NL.net>
To: linux-m68k@phil.uni-sb.de
Subject: Re: L68K: More patches for the Hades
In-Reply-To: <9709250843.AA19172@faui21.informatik.uni-erlangen.de>
Sender: owner-linux-m68k@phil.uni-sb.de
Reply-To: Wout Klaren <W.Klaren@inter.NL.net>



On Thu, 25 Sep 1997, Roman Hodek wrote:

> Some comments to your patches: 
> 
> > +Hades support
> > +CONFIG_HADES
> > +  This option enables support for the Hades Atari clone. If you say
> > +  Y here, PCI bus support will be compiled in and the TT SCSI DMA
> > +  emulation option for SCSI will be enabled. Note that a kernel
> > +  without this option set (but with Atari support) will also work
> > +  on the Hades, but without PCI bus support and SCSI transfers will
> > +  be very slow. If you plan to use this kernel on a Hades, say Y
> > +  here; otherwise say N.
> > +
> 
> This is not really true... The CONFIG_PCI and CONFIG_TT_DMA_EMUL are
> extra config vars, that are only offered if CONFIG_HADES is selected,
> too.
>
> CONFIG_HADES also does a few other things: It takes care that the
> autolevel 2 interrupt isn't disabled, and the new virt_to_bus mapping.

Ok, I have updated the comment in the patches below.

> Do you need the VME mapping on a Hades? (AFAICR, it doesn't have a VME
> bus.) Then you could use the tt1 reg for your mapping instead of tt0
> and thus save one of the transp. translation register sets. Just put
> some "if (is_hades)" into the code where the VME mapping is set up and
> use a different tt value then.

The Hades has a VME bus, so tt1 is not free. The first versions of the
PCI driver did not use tt0, but used kernel_map to remap the PCI memory,
I/O and configuration areas. But it is easier to have the PCI bus at a
fixed address.

> To the PCI stuff: Do you know Torsten Lang? He has written some kind
> of Hades PCI BIOS for mw. Unfortunately he can't give away the source
> code (it's proprietary), but he surely can help you with PCI problems
> in all ways...

Yes, I know him. I have spoken with him about the PCI driver.

> I'm not sure about these... can't they be used also somewhere else
> where byteswapping wouldn't be good?

Because of the other reactions in this mailing list, I have deleted them.
When I added them I looked at the Linux/PPC port. In this port these
macro's swap the byteorder. The Linux/PPC port has also versions which
do not change the byteorder, but these macro's have other names.

> You should better also add a runtime test for Hades, otherwise kernels
> compiled with CONFIG_HADES don't run on other machines anymore... I.e.,
> 
> #define virt_to_bus(a) (virt_to_phys(a) + (is_hades ? 0x80000000 : 0))

You are right. I have fixed it in the pacthes below.


Wout Klaren



diff -ruN -x *.o -x *.a -x .*depend -x .config* -x .menuconfig* -x System.map -x .version -x autoconf.h -x compile.h -x vmlinux -x *_MODULES -x *.ver linux-2.1.55.orig/Documentation/Configure.help linux-2.1.55/Documentation/Configure.help
--- linux-2.1.55.orig/Documentation/Configure.help	Wed Sep 24 23:22:19 1997
+++ linux-2.1.55/Documentation/Configure.help	Thu Sep 25 19:51:45 1997
@@ -5602,13 +5602,8 @@
 
 Hades support
 CONFIG_HADES
-  This option enables support for the Hades Atari clone. If you say
-  Y here, PCI bus support will be compiled in and the TT SCSI DMA
-  emulation option for SCSI will be enabled. Note that a kernel
-  without this option set (but with Atari support) will also work
-  on the Hades, but without PCI bus support and SCSI transfers will
-  be very slow. If you plan to use this kernel on a Hades, say Y
-  here; otherwise say N.
+  This option enables support for the Hades Atari clone. If you plan to
+  use this kernel on a Hades, say Y here; otherwise say N.
 
 Macintosh support
 CONFIG_MAC
diff -ruN -x *.o -x *.a -x .*depend -x .config* -x .menuconfig* -x System.map -x .version -x autoconf.h -x compile.h -x vmlinux -x *_MODULES -x *.ver linux-2.1.55.orig/include/asm-m68k/io.h linux-2.1.55/include/asm-m68k/io.h
--- linux-2.1.55.orig/include/asm-m68k/io.h	Wed Sep 24 23:22:21 1997
+++ linux-2.1.55/include/asm-m68k/io.h	Thu Sep 25 19:39:57 1997
@@ -41,28 +41,6 @@
 #define outb(x,addr) ((void) writeb(x,addr))
 #define outb_p(x,addr) outb(x,addr)
 
-extern inline unsigned short inw(int port)
-{
-	return le16_to_cpu(readw(port));
-}
-
-extern inline unsigned long inl(int port)
-{
-	return le32_to_cpu(readl(port));
-}
-
-extern inline unsigned short outw(unsigned short val, int port)
-{
-	writew(cpu_to_le16(val), port);
-	return val;
-}
-
-extern inline unsigned long outl(unsigned long val, int port)
-{
-	writel(cpu_to_le32(val), port);
-	return val;
-}
-
 /*
  * Change virtual addresses to physical addresses and vv.
  */
@@ -84,8 +62,8 @@
  * except on the PCI bus of the Hades.
  */
 #ifdef CONFIG_HADES
-#define virt_to_bus(a) (virt_to_phys(a) + 0x80000000)
-#define bus_to_virt(a) (phys_to_virt((a) - 0x80000000))
+#define virt_to_bus(a) (virt_to_phys(a) + (is_hades ? 0x80000000 : 0))
+#define bus_to_virt(a) (phys_to_virt((a) - (is_hades ? 0x80000000 : 0)))
 #else
 #define virt_to_bus virt_to_phys
 #define bus_to_virt phys_to_virt





