lkml.org 
[lkml]   [2008]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 5/5] falconide/q40ide: add ->atapi_*put_bytes and ->ata_*put_data methods
	Hi Bart,

On Sun, 30 Mar 2008, Bartlomiej Zolnierkiewicz wrote:
> * Add ->atapi_{in,out}put_bytes and ->ata_{in,out}put_data methods to
> falconide and q40ide host drivers (->ata_* methods are implemented on
> top of ->atapi_* methods so they also do byte-swapping now).
>
> * Cleanup atapi_{in,out}put_bytes().

Thanks!

One remaining issue (for which the fix has never been submitted upstream so
far) with Atari and Q40 is that due to the byteswapped interface, the driveid
is also byteswapped, so it has to be unswapped again in ide_fix_driveid().

Here's a very old and unclean but working patch:

--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -284,6 +284,23 @@ void ide_fix_driveid (struct hd_driveid
int i;
u16 *stringcast;

+#ifdef __mc68000__
+ if (!MACH_IS_AMIGA && !MACH_IS_MAC && !MACH_IS_Q40 && !MACH_IS_ATARI)
+ return;
+
+#ifdef M68K_IDE_SWAPW
+ if (M68K_IDE_SWAPW) { /* fix bus byteorder first */
+ u_char *p = (u_char *)id;
+ u_char t;
+ for (i = 0; i < 512; i += 2) {
+ t = p[i];
+ p[i] = p[i+1];
+ p[i+1] = t;
+ }
+ }
+#endif
+#endif /* __mc68000__ */
+
id->config = __le16_to_cpu(id->config);
id->cyls = __le16_to_cpu(id->cyls);
id->reserved2 = __le16_to_cpu(id->reserved2);
Note that include/asm-m68k/ide.h has

#define M68K_IDE_SWAPW (MACH_IS_Q40 || MACH_IS_ATARI)
Gr{oetje,eeting}s,
Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


\
 
 \ /
  Last update: 2008-03-30 20:21    [W:0.061 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site