dslinux/linux-2.6.x/drivers/ide/arm ide_arm.c

amadeus dslinux_amadeus at user.in-berlin.de
Thu Sep 7 21:26:16 CEST 2006


Update of /cvsroot/dslinux/dslinux/linux-2.6.x/drivers/ide/arm
In directory antilope:/tmp/cvs-serv3580/linux-2.6.x/drivers/ide/arm

Modified Files:
	ide_arm.c 
Log Message:
Fix compile error for supercard CF & !CONFIG_ROM_8BIT

Index: ide_arm.c
===================================================================
RCS file: /cvsroot/dslinux/dslinux/linux-2.6.x/drivers/ide/arm/ide_arm.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- ide_arm.c	3 Sep 2006 20:22:27 -0000	1.9
+++ ide_arm.c	7 Sep 2006 19:26:14 -0000	1.10
@@ -40,7 +40,7 @@
 #endif
 
 /*****************************************************************************/
-#ifdef CONFIG_IDE_NDS_SUPERCARD
+#if defined(CONFIG_IDE_NDS_SUPERCARD) && defined(CONFIG_NDS_ROM8BIT)
 /* externals from sccf_s.S */
 extern int sccf_detect_card(void);
 extern u8  sccf_ide_inb(unsigned long port);
@@ -56,6 +56,22 @@
 #endif
 
 /*****************************************************************************/
+#if defined(CONFIG_IDE_NDS_M3) && defined(CONFIG_NDS_ROM8BIT)
+/* externals from m3cf_s.S */
+extern int m3cf_detect_card(void);
+extern u8  m3cf_ide_inb(unsigned long port);
+extern u16 m3cf_ide_inw(unsigned long port);
+extern u32 m3cf_ide_inl(unsigned long port);
+
+extern void m3cf_ide_outb( u8 value, unsigned long port);
+extern void m3cf_ide_outw(u16 value, unsigned long port);
+extern void m3cf_ide_outl(u32 value, unsigned long port);
+
+extern void m3cf_ide_insw(unsigned long port, u16 *dest, u32 count);
+extern void m3cf_ide_outsw(unsigned long port, u16 *src, u32 count);
+#endif
+
+/*****************************************************************************/
 #ifdef CONFIG_NDS_ROM8BIT
 static void nds_ide_insw(unsigned long port, void *dest, u32 count)
 {
@@ -71,11 +87,6 @@
  	} while (count);
 }
 
-static void nds_ide_insl(unsigned long port, void *dest, u32 count)
-{
-	nds_ide_insw(port, dest, count *2);	
-}
-
 static void nds_ide_outsw(unsigned long port, void *source, u32 count)
 {
 	u16 *src = (u16*)source;
@@ -90,6 +101,11 @@
  	} while (count);
 }
 
+static void nds_ide_insl(unsigned long port, void *dest, u32 count)
+{
+	nds_ide_insw(port, dest, count *2);	
+}
+
 static void nds_ide_outsl(unsigned long port, void *source, u32 count)
 {
 	nds_ide_outsw(port, source, count *2);	
@@ -102,22 +118,6 @@
 #endif
 
 /*****************************************************************************/
-#ifdef CONFIG_IDE_NDS_M3
-static void M3_Unlock( void )
-{
-	volatile u16 tmp ;
-	tmp = *(volatile u16 *)0x08000000 ;
-	tmp = *(volatile u16 *)0x08E00002 ;
-	tmp = *(volatile u16 *)0x0800000E ;
-	tmp = *(volatile u16 *)0x08801FFC ;
-	tmp = *(volatile u16 *)0x0800104A ;
-	tmp = *(volatile u16 *)0x08800612 ;
-	tmp = *(volatile u16 *)0x08000000 ;
-	tmp = *(volatile u16 *)0x08801B66 ;
-	tmp = *(volatile u16 *)0x08800006 ;
-	tmp = *(volatile u16 *)0x08000000 ;
-}
-#endif
 
 void __init ide_arm_init(void)
 {
@@ -127,7 +127,7 @@
 
 		memset(&hw, 0, sizeof(hw));
 
-#ifdef CONFIG_IDE_NDS_SUPERCARD
+#if defined(CONFIG_IDE_NDS_SUPERCARD) && defined(CONFIG_NDS_ROM8BIT)
 		if (sccf_detect_card()) {
 			ide_hwif_t *hwif;
 
@@ -161,18 +161,53 @@
 		}
 #endif
 
+#if defined(CONFIG_IDE_NDS_M3) && defined(CONFIG_NDS_ROM8BIT)
+		if (m3cf_detect_card()) {
+			ide_hwif_t *hwif;
+
+			printk( KERN_INFO "M3 CF detected\n");
+
+			/* setup register addresses */
+			for (i=0; i<8; i++)
+				hw.io_ports[i] = 0x08800000 + 0x20000*i;
+			hw.io_ports[8] = 0x080C0000; // control
+			/* setup IRQ */
+			hw.irq = IRQ_CART;
+			/* register hardware addresses */
+			ide_register_hw(&hw, &hwif);
+			/* modify IO functions */
+			hw_ide_insw     = m3cf_ide_insw;
+			hw_ide_outsw    = m3cf_ide_outsw;
+			hw_ide_outb	= m3cf_ide_outb;
+			hwif->OUTB	= m3cf_ide_outb;
+			hwif->OUTBSYNC	= nds_ide_outbsync;
+			hwif->OUTW	= m3cf_ide_outw;
+			hwif->OUTL	= m3cf_ide_outl;
+			hwif->OUTSW	= nds_ide_outsw;
+			hwif->OUTSL	= nds_ide_outsl;
+			hwif->INB	= m3cf_ide_inb;
+			hwif->INW	= m3cf_ide_inw;
+			hwif->INL	= m3cf_ide_inl;
+			hwif->INSW	= nds_ide_insw;
+			hwif->INSL	= nds_ide_insl;
+			/* all OK */
+			return;
+		}
+#endif
+
 #ifndef CONFIG_NDS_ROM8BIT
 
 #ifdef CONFIG_IDE_NDS_M3
-		M3_Unlock();
 		for (i=0; i<8; i++)
-			hw.io_ports[i] = 0x08800000 + 0x20000*i;
-		hw.io_ports[8] = 0x080C0000; // control
-#elif defined(CONFIG_IDE_NDS_MAX_MEDIA_PLAYER)
+			hw.io_ports[i] = 0x09000000 + 0x20000*i;
+		hw.io_ports[8] = 0x098C0000; // control
+#endif
+#ifdef CONFIG_IDE_NDS_MAX_MEDIA_PLAYER
 		for (i=0; i<8; i++)
 			hw.io_ports[i] = 0x08000000 + 0x20000*i;
 		hw.io_ports[8] = 0x080E0000; // control
-#else
+#endif
+#ifdef CONFIG_IDE_NDS_SUPERCARD
 		for (i=0; i<8; i++)
 			hw.io_ports[i] = 0x09000000 + 0x20000*i;
 		hw.io_ports[8] = 0x098C0000; // control




More information about the dslinux-commit mailing list