public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.10-rc2-mm3] mips: fixed memory mapped I/O of IDE on MIPS
@ 2004-11-24  1:18 Yoichi Yuasa
  2004-11-24 17:51 ` Ralf Baechle
  0 siblings, 1 reply; 3+ messages in thread
From: Yoichi Yuasa @ 2004-11-24  1:18 UTC (permalink / raw)
  To: Andrew Morton; +Cc: yuasa, linux-kernel, Ralf Baechle

This patch fixes memory mapped I/O of IDE on MIPS.

The MMIO of IDE on MIPS, the read*()/write*() are correct methods for it.
 
Signed-off-by: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>

diff -urN -X dontdiff a-orig/include/asm-mips/ide.h a/include/asm-mips/ide.h
--- a-orig/include/asm-mips/ide.h	Mon Oct 11 11:58:23 2004
+++ a/include/asm-mips/ide.h	Thu Oct 14 12:19:27 2004
@@ -14,11 +14,7 @@
 #ifdef __KERNEL__
 
 #include <ide.h>
-
-#define __ide_mm_insw   ide_insw
-#define __ide_mm_insl   ide_insl
-#define __ide_mm_outsw  ide_outsw
-#define __ide_mm_outsl  ide_outsl
+#include <asm-generic/ide_iops.h>
 
 #endif /* __KERNEL__ */
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2.6.10-rc2-mm3] mips: fixed memory mapped I/O of IDE on MIPS
  2004-11-24  1:18 [PATCH 2.6.10-rc2-mm3] mips: fixed memory mapped I/O of IDE on MIPS Yoichi Yuasa
@ 2004-11-24 17:51 ` Ralf Baechle
  2004-11-25 15:17   ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Ralf Baechle @ 2004-11-24 17:51 UTC (permalink / raw)
  To: Yoichi Yuasa; +Cc: Andrew Morton, linux-kernel, linux-mips

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=unknown-8bit, Size: 4129 bytes --]

On Wed, Nov 24, 2004 at 10:18:09AM +0900, Yoichi Yuasa wrote:

> This patch fixes memory mapped I/O of IDE on MIPS.
> 
> The MMIO of IDE on MIPS, the read*()/write*() are correct methods for it.
>  
> Signed-off-by: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
> 
> diff -urN -X dontdiff a-orig/include/asm-mips/ide.h a/include/asm-mips/ide.h
> --- a-orig/include/asm-mips/ide.h	Mon Oct 11 11:58:23 2004
> +++ a/include/asm-mips/ide.h	Thu Oct 14 12:19:27 2004
> @@ -14,11 +14,7 @@
>  #ifdef __KERNEL__
>  
>  #include <ide.h>
> -
> -#define __ide_mm_insw   ide_insw
> -#define __ide_mm_insl   ide_insl
> -#define __ide_mm_outsw  ide_outsw
> -#define __ide_mm_outsl  ide_outsl
> +#include <asm-generic/ide_iops.h>

I wish things were that easy.  About once a week I'm mailed a patch to
"fix¨ MIPS IDE.  Fix for a particular platform breaking all others. Just
to maximize the fun factor on MIPS we have good old IDE attached via
MMIO, I/O ports (which on MIPS of course is just MMIO in disguise),
with the same and with different byte switching requirements that for
any devices in the system.  And then of course also completly crazy stuff.
Technically a bloody mess - and the software support no better.

End of rant.

Checkout rev. 1.11 of include/asm-mips/ide.h in CVS to see some of the
uglyness that was needed to get IDE to sort of work in the past.  Don't
look to close or your stomach will oops ;-)

I'm going to put the below patch into CVS; it will allow individual
platforms to override things will all the mad stuff they deem necessary.

  Ralf

Index: include/asm-mips/ide.h
===================================================================
RCS file: /home/cvs/linux/include/asm-mips/ide.h,v
retrieving revision 1.24
diff -u -r1.24 ide.h
--- include/asm-mips/ide.h	18 Nov 2003 01:17:47 -0000	1.24
+++ include/asm-mips/ide.h	24 Nov 2004 17:49:00 -0000
@@ -4,22 +4,10 @@
  * for more details.
  *
  * This file contains the MIPS architecture specific IDE code.
- *
- * Copyright (C) 1994-1996  Linus Torvalds & authors
  */
-
 #ifndef __ASM_IDE_H
 #define __ASM_IDE_H
 
-#ifdef __KERNEL__
-
 #include <ide.h>
 
-#define __ide_mm_insw   ide_insw
-#define __ide_mm_insl   ide_insl
-#define __ide_mm_outsw  ide_outsw
-#define __ide_mm_outsl  ide_outsl
-
-#endif /* __KERNEL__ */
-
 #endif /* __ASM_IDE_H */
Index: include/asm-mips/mach-generic/ide.h
===================================================================
RCS file: /home/cvs/linux/include/asm-mips/mach-generic/ide.h,v
retrieving revision 1.4
diff -u -r1.4 ide.h
--- include/asm-mips/mach-generic/ide.h	9 Jun 2004 14:12:13 -0000	1.4
+++ include/asm-mips/mach-generic/ide.h	24 Nov 2004 17:49:00 -0000
@@ -3,13 +3,18 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * IDE routines for typical pc-like legacy IDE configurations.
+ * Copyright (C) 1994-1996  Linus Torvalds & authors
  *
- * Copyright (C) 1998, 1999, 2001, 2003 by Ralf Baechle
+ * Copied from i386; many of the especially older MIPS or ISA-based platforms
+ * are basically identical.  Using this file probably implies i8259 PIC
+ * support in a system but the very least interrupt numbers 0 - 15 need to
+ * be put aside for legacy devices.
  */
 #ifndef __ASM_MACH_GENERIC_IDE_H
 #define __ASM_MACH_GENERIC_IDE_H
 
+#ifdef __KERNEL__
+
 #include <linux/config.h>
 
 #ifndef MAX_HWIFS
@@ -22,7 +27,7 @@
 
 #define IDE_ARCH_OBSOLETE_DEFAULTS
 
-static inline int ide_default_irq(unsigned long base)
+static __inline__ int ide_default_irq(unsigned long base)
 {
 	switch (base) {
 		case 0x1f0: return 14;
@@ -36,11 +41,11 @@
 	}
 }
 
-static inline unsigned long ide_default_io_base(int index)
+static __inline__ unsigned long ide_default_io_base(int index)
 {
 	switch (index) {
-		case 0: return 0x1f0;
-		case 1: return 0x170;
+		case 0:	return 0x1f0;
+		case 1:	return 0x170;
 		case 2: return 0x1e8;
 		case 3: return 0x168;
 		case 4: return 0x1e0;
@@ -59,4 +64,8 @@
 #define ide_init_default_irq(base)	ide_default_irq(base)
 #endif
 
+#include <asm-generic/ide_iops.h>
+
+#endif /* __KERNEL__ */
+
 #endif /* __ASM_MACH_GENERIC_IDE_H */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2.6.10-rc2-mm3] mips: fixed memory mapped I/O of IDE on MIPS
  2004-11-24 17:51 ` Ralf Baechle
@ 2004-11-25 15:17   ` Alan Cox
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Cox @ 2004-11-25 15:17 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: Yoichi Yuasa, Andrew Morton, Linux Kernel Mailing List,
	linux-mips

You also need to implement the OUTBNOSYNC operator correctly if you are
using mmio and your bridge does PCI posting. Without that you'll get the
odd problem if the IDE IRQ line is shared.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-11-27  3:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-24  1:18 [PATCH 2.6.10-rc2-mm3] mips: fixed memory mapped I/O of IDE on MIPS Yoichi Yuasa
2004-11-24 17:51 ` Ralf Baechle
2004-11-25 15:17   ` Alan Cox

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