linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Linux Kernel Development <linux-kernel@vger.kernel.org>
Subject: [PATCH] 2.4 IDE core code for m68k
Date: Wed, 2 Apr 2003 12:15:19 +0200 (MEST)	[thread overview]
Message-ID: <Pine.GSO.4.21.0304021209320.7230-100000@vervain.sonytel.be> (raw)

	Hi Alan,

Here are the changes to the 2.4 IDE core code for m68k. The real m68k-specific
stuff (drivers and asm/ide.h) will follow later (probably next weekend). Most
of these are already in 2.5.x.

Changes:
  - Remove first parameter of ide_{get,release}_lock() so it can be handled by
    the Atari-specific code
  - outsl() returns void
  - Both Atari and Q40 have byteswapped IDE interfaces
  - Fix drive ID swapping (perhaps we want some arch-specific function call
    here?)
  - Print irq number in decimal
  - ide_ack_intr() is defined by arch-specific code if IDE_ARCH_ACK_INTR is set

--- linux-2.4.21-pre6/drivers/ide/ide-io.c	Thu Feb 27 10:15:44 2003
+++ linux-m68k-2.4.21-pre6/drivers/ide/ide-io.c	Sun Mar 30 22:22:40 2003
@@ -761,7 +761,7 @@
 	ide_startstop_t	startstop;
 
 	/* for atari only: POSSIBLY BROKEN HERE(?) */
-	ide_get_lock(&ide_intr_lock, ide_intr, hwgroup);
+	ide_get_lock(ide_intr, hwgroup);
 
 	/* necessary paranoia: ensure IRQs are masked on local CPU */
 	local_irq_disable();
@@ -801,7 +801,7 @@
 				 */
 
 				/* for atari only */
-				ide_release_lock(&ide_intr_lock);
+				ide_release_lock();
 				hwgroup->busy = 0;
 			}
 			/* no more work for this hwgroup (for now) */
--- linux-2.4.21-pre6/drivers/ide/ide-iops.c	Thu Feb 27 10:15:44 2003
+++ linux-m68k-2.4.21-pre6/drivers/ide/ide-iops.c	Sun Mar 30 22:22:40 2003
@@ -79,7 +79,7 @@
 
 static void ide_outsl (unsigned long port, void *addr, u32 count)
 {
-	return outsl(port, addr, count);
+	outsl(port, addr, count);
 }
 
 void default_hwif_iops (ide_hwif_t *hwif)
@@ -302,7 +302,7 @@
 		insw_swapw(IDE_DATA_REG, buffer, bytecount / 2);
 		return;
 	}
-#endif /* CONFIG_ATARI */
+#endif /* CONFIG_ATARI || CONFIG_Q40 */
 	hwif->ata_input_data(drive, buffer, bytecount / 4);
 	if ((bytecount & 0x03) >= 2)
 		hwif->INSW(IDE_DATA_REG, ((u8 *)buffer)+(bytecount & ~0x03), 1);
@@ -321,7 +321,7 @@
 		outsw_swapw(IDE_DATA_REG, buffer, bytecount / 2);
 		return;
 	}
-#endif /* CONFIG_ATARI */
+#endif /* CONFIG_ATARI || CONFIG_Q40 */
 	hwif->ata_output_data(drive, buffer, bytecount / 4);
 	if ((bytecount & 0x03) >= 2)
 		hwif->OUTSW(IDE_DATA_REG, ((u8*)buffer)+(bytecount & ~0x03), 1);
@@ -338,6 +338,23 @@
 # ifdef __BIG_ENDIAN
 	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);
--- linux-2.4.21-pre6/drivers/ide/ide-probe.c	Thu Feb 27 10:15:44 2003
+++ linux-m68k-2.4.21-pre6/drivers/ide/ide-probe.c	Sun Mar 30 22:22:40 2003
@@ -948,7 +948,7 @@
 		hwif->io_ports[IDE_DATA_OFFSET]+7,
 		hwif->io_ports[IDE_CONTROL_OFFSET], __irq_itoa(hwif->irq));
 #else
-	printk("%s at %x on irq 0x%08x", hwif->name,
+	printk("%s at 0x%08lx on irq %d", hwif->name,
 		hwif->io_ports[IDE_DATA_OFFSET], hwif->irq);
 #endif /* __mc68000__ && CONFIG_APUS */
 	if (match)
--- linux-2.4.21-pre6/drivers/ide/ide.c	Thu Feb 27 10:15:45 2003
+++ linux-m68k-2.4.21-pre6/drivers/ide/ide.c	Sun Mar 30 22:22:40 2003
@@ -174,14 +174,6 @@
 
 static int ide_scan_direction;	/* THIS was formerly 2.2.x pci=reverse */
 
-#if defined(__mc68000__) || defined(CONFIG_APUS)
-/*
- * ide_lock is used by the Atari code to obtain access to the IDE interrupt,
- * which is shared between several drivers.
- */
-static int ide_intr_lock;
-#endif /* __mc68000__ || CONFIG_APUS */
-
 #ifdef CONFIG_IDEDMA_AUTO
 int noautodma = 0;
 #else
@@ -2225,12 +2217,12 @@
 
 #ifdef CONFIG_BLK_DEV_IDE
 	if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
-		ide_get_lock(&ide_intr_lock, NULL, NULL); /* for atari only */
+		ide_get_lock(NULL, NULL); /* for atari only */
 
 	(void) ideprobe_init();
 
 	if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
-		ide_release_lock(&ide_intr_lock);	/* for atari only */
+		ide_release_lock();	/* for atari only */
 #endif /* CONFIG_BLK_DEV_IDE */
 
 #ifdef CONFIG_PROC_FS
--- linux-2.4.21-pre6/include/linux/ide.h	Thu Feb 27 10:17:26 2003
+++ linux-m68k-2.4.21-pre6/include/linux/ide.h	Sun Mar 30 22:22:41 2003
@@ -344,17 +344,14 @@
 #include <asm/ide.h>
 
 /* Currently only m68k, apus and m8xx need it */
-#ifdef IDE_ARCH_ACK_INTR
-extern int ide_irq_lock;
-# define ide_ack_intr(hwif) (hwif->hw.ack_intr ? hwif->hw.ack_intr(hwif) : 1)
-#else
+#ifndef IDE_ARCH_ACK_INTR
 # define ide_ack_intr(hwif) (1)
 #endif
 
 /* Currently only Atari needs it */
 #ifndef IDE_ARCH_LOCK
-# define ide_release_lock(lock)			do {} while (0)
-# define ide_get_lock(lock, hdlr, data)		do {} while (0)
+# define ide_release_lock()			do {} while (0)
+# define ide_get_lock(hdlr, data)		do {} while (0)
 #endif /* IDE_ARCH_LOCK */
 
 /*

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


             reply	other threads:[~2003-04-02 10:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-02 10:15 Geert Uytterhoeven [this message]
2003-04-13 13:05 Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.4.21.0304021209320.7230-100000@vervain.sonytel.be \
    --to=geert@linux-m68k.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH] 2.4 IDE core code for m68k' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox