On Sun, Aug 13, 2023 at 11:24:20PM +0100, William R Sowerbutts wrote:
I am going to look at the pata_legacy driver and see if it might be usable on the Q40 instead of pata_falcon. As a long term fix I think I need to read up on CONFIG_HAS_IOPORT_MAP to try and understand how I might enable this. I expect enabling it will have implications for all M68K machines, so maybe someone with more experience should be making that decision.
Enabling CONFIG_HAS_IOPORT_MAP for the Q40 turned out to be simple. Attached is the patch I am using -- it just sets NO_IOPORT_MAP=n when Q40 is enabled. Enabling CONFIG_HAS_IOPORT_MAP allows pata_legacy to work on the Q40 with no further changes! pata_legacy drives the IDE interface perfectly. The data is byte swapped, so I think pata_falcon still has a place for Q40 users who want to use legacy reverse-byte-order disks. I tested bulk transfer performance (exactly the same way as I tested pata_falcon with and without byte swapping); pata_legacy performs much the same as pata_falcon with byte swapping enabled (as one might expect). I suppose the next step is to build a kernel supporting both Q40 and perhaps Atari, then test this in ARAnyM. I'll try this out over the next few days. Thanks Will _________________________________________________________________________ William R Sowerbutts will@xxxxxxxxxxxxxx "Carpe post meridiem" http://sowerbutts.com main(){char*s=">#=0> ^#X@#@^7=",c=0,m;for(;c<15;c++)for (m=-1;m<7;putchar(m++/6&c%3/2?10:s[c]-31&1<<m?42:32));}
diff -urN linux-6.4.10.orig/arch/m68k/include/asm/kmap.h linux-6.4.10.q40/arch/m68k/include/asm/kmap.h --- linux-6.4.10.orig/arch/m68k/include/asm/kmap.h 2023-08-11 11:14:29.000000000 +0100 +++ linux-6.4.10.q40/arch/m68k/include/asm/kmap.h 2023-08-16 00:34:12.894812394 +0100 @@ -58,6 +58,7 @@ #endif /* CONFIG_MMU */ +#ifndef CONFIG_HAS_IOPORT_MAP #define ioport_map ioport_map static inline void __iomem *ioport_map(unsigned long port, unsigned int nr) { @@ -68,5 +69,6 @@ static inline void ioport_unmap(void __iomem *p) { } +#endif /* CONFIG_HAS_IOPORT_MAP */ #endif /* _KMAP_H */ diff -urN linux-6.4.10.orig/arch/m68k/Kconfig linux-6.4.10.q40/arch/m68k/Kconfig --- linux-6.4.10.orig/arch/m68k/Kconfig 2023-08-11 11:14:29.000000000 +0100 +++ linux-6.4.10.q40/arch/m68k/Kconfig 2023-08-16 00:27:50.044269922 +0100 @@ -61,7 +61,8 @@ default y config NO_IOPORT_MAP - def_bool y + bool + default !Q40 config HZ int