patch-2.2.0-pre6 linux/include/asm-ppc/ide.h

Next file: linux/include/asm-ppc/pgtable.h
Previous file: linux/include/asm-ppc/dma.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.0-pre5/linux/include/asm-ppc/ide.h linux/include/asm-ppc/ide.h
@@ -80,8 +80,11 @@
 
 static __inline__ int ide_default_irq(ide_ioreg_t base)
 {
-	if ( (_machine == _MACH_Pmac) || (_machine == _MACH_mbx) )
+	if ( _machine == _MACH_Pmac )
 		return 0;
+	else if ( _machine == _MACH_mbx )
+		/* hardcode IRQ 14 on the MBX */
+		return 14+16;		     
         else if ( _machine == _MACH_chrp) {
                 if (chrp_ide_ports_known == 0) 
 			chrp_ide_probe();
@@ -142,7 +145,7 @@
 }
 
 /* Convert the shorts/longs in hd_driveid from little to big endian;
-   chars are endian independant, of course, but strings need to be flipped.
+   chars are endian independent, of course, but strings need to be flipped.
    (Despite what it says in drivers/block/ide.h, they come up as little endian...)
    Changes to linux/hdreg.h may require changes here. */
 static __inline__ void ide_fix_driveid (struct hd_driveid *id) {
@@ -252,14 +255,14 @@
 	}
 }
 
-
 #undef insw
 #define insw(port, buf, ns) 	do {			\
 	if ( _machine == _MACH_chrp)  {\
 		 ide_insw((port)+_IO_BASE, (buf), (ns));  \
 	}\
 	else if ( (_machine == _MACH_Pmac) || (_machine == _MACH_mbx) )			\
-		ide_insw((port), (buf), (ns));		\
+		ide_insw((port)+((_machine==_MACH_mbx)? 0x80000000: 0), \
+			 (buf), (ns));		\
 	else						\
 		/* this must be the same as insw in io.h!! */	\
 		_insw((unsigned short *)((port)+_IO_BASE), (buf), (ns)); \
@@ -270,8 +273,9 @@
 	if ( _machine == _MACH_chrp) {\
 		ide_outsw((port)+_IO_BASE, (buf), (ns)); \
 	}\
-	else if ( (_machine == _MACH_Pmac) || (_machine == _MACH_mbx) )			\
-		ide_outsw((port), (buf), (ns));		\
+	else if ( (_machine == _MACH_Pmac) || (_machine == _MACH_mbx) )	 \
+		ide_outsw((port)+((_machine==_MACH_mbx)? 0x80000000: 0), \
+			   (buf), (ns));		\
 	else						\
 		/* this must be the same as outsw in io.h!! */	\
 		_outsw((unsigned short *)((port)+_IO_BASE), (buf), (ns)); \
@@ -279,13 +283,17 @@
 
 #undef inb
 #define inb(port)	\
-	in_8((unsigned char *)((port) + ((_machine==_MACH_Pmac)? 0: _IO_BASE)))
+	in_8((unsigned char *)((port) + \
+			       ((_machine==_MACH_Pmac)? 0: _IO_BASE) + \
+			       ((_machine==_MACH_mbx)? 0x80000000: 0)) )
 #undef inb_p
 #define inb_p(port)	inb(port)
 
 #undef outb
 #define outb(val, port)	\
-	out_8((unsigned char *)((port) + ((_machine==_MACH_Pmac)? 0: _IO_BASE)), (val))
+	out_8((unsigned char *)((port) + \
+				((_machine==_MACH_Pmac)? 0: _IO_BASE) + \
+				((_machine==_MACH_mbx)? 0x80000000: 0)), (val) )
 #undef outb_p
 #define outb_p(val, port)	outb(val, port)
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov