Thread (21 messages) 21 messages, 3 authors, 2004-02-28

Re: H8/300 target support patch

From: Yoshinori Sato <ysato@users.sourceforge.jp>
Date: 2004-02-17 11:33:45

At Tue, 17 Feb 2004 09:09:38 +1100,
Benjamin Herrenschmidt wrote:
quoted
quoted
why you don't use outsw() and insw() from include/asm-h8300/io.h?
Because bus turns over, insw/outsw is not usable.
Please explain.

Your IDE bus is flipped backward ? The next one who do that should
lose all rights to do any kind of HW design... Or is it a big endian
platform ? In this case, use normal flipping inw/outw for IOs and
non-flipping for stream IOs (insw/outsw)
This architecture is big endian.
Your functions are "streaming" versions, they should be called
with the proper name "insw/outsw". Calling the streaming versions
from the IO ones is wrong.
It was my misunderstanding that did not use asm/io.h.
It is the patch which it corrected to use it.
h8300/h8_ide_iops.h becomes needless.

diff -u ide-probe.c.orig ide-probe.c
--- ide-probe.c.orig	2004-02-17 19:46:33.000000000 +0900
+++ ide-probe.c	2004-02-17 19:51:30.000000000 +0900
@@ -983,6 +983,7 @@
 	unsigned int index;
 	ide_hwgroup_t *hwgroup;
 	ide_hwif_t *match = NULL;
+	int ide_regs_gap;
 
 	BUG_ON(in_interrupt());
 	BUG_ON(irqs_disabled());	
@@ -1101,19 +1102,17 @@
 		spin_unlock_irq(&ide_lock);
 	}
 
-#if !defined(__mc68000__) && !defined(CONFIG_APUS) && !defined(__sparc__) && \
-    !defined(__H8300H__) && !defined(__H8300S__)
+	ide_regs_gap = hwif->io_ports[IDE_ERROR_OFFSET] - hwif->io_ports[IDE_DATA_OFFSET];
+#if !defined(__mc68000__) && !defined(CONFIG_APUS) && !defined(__sparc__)
 	printk("%s at 0x%03lx-0x%03lx,0x%03lx on irq %d", hwif->name,
 		hwif->io_ports[IDE_DATA_OFFSET],
-		hwif->io_ports[IDE_DATA_OFFSET]+7,
+		hwif->io_ports[IDE_DATA_OFFSET] + ide_regs_gap * 8 - 1,
 		hwif->io_ports[IDE_CONTROL_OFFSET], hwif->irq);
 #elif defined(__sparc__)
 	printk("%s at 0x%03lx-0x%03lx,0x%03lx on irq %s", hwif->name,
 		hwif->io_ports[IDE_DATA_OFFSET],
 		hwif->io_ports[IDE_DATA_OFFSET]+7,
 		hwif->io_ports[IDE_CONTROL_OFFSET], __irq_itoa(hwif->irq));
-#elif defined(__H8300H__) || defined(__H8300S__)
-	h8300_ide_print_resource(hwif->name,&(hwif->hw));
 #else
 	printk("%s at 0x%08lx on irq %d", hwif->name,
 		hwif->io_ports[IDE_DATA_OFFSET], hwif->irq);
diff -u h8300/aki3068_ide.c.orig h8300/aki3068_ide.c
--- aki3068_ide.c.orig	2004-02-16 22:48:00.000000000 +0900
+++ aki3068_ide.c	2004-02-17 20:09:11.000000000 +0900
@@ -24,8 +24,6 @@
 #include <asm/irq.h>
 #include <asm/regs306x.h>
 
-#include "h8_ide_iops.h"
-
 /* IDE I/F configuration */
 #define IDE_BASE CONFIG_H8300_IDE_BASE
 #define IDE_CTRL CONFIG_H8300_IDE_ALT
@@ -40,7 +38,7 @@
 #define IDE_SELECT	0x0C
 #define IDE_STATUS	0x0E
 
-static void h8300_ide_ports(hw_regs_t *hw, unsigned long ioaddr)
+static void __init h8300_ide_ports(hw_regs_t *hw, unsigned long ioaddr)
 {
 	hw->io_ports[IDE_DATA_OFFSET]	 = ioaddr + IDE_DATA;
 	hw->io_ports[IDE_ERROR_OFFSET]	 = ioaddr + IDE_ERROR;
@@ -68,14 +66,5 @@
 	hw.irq = IDE_IRQ;
 
 	if (ide_register_hw(&hw, &hwif) != -1)
-		h8300_hwif_iops(hwif);
-}
-
-void __init h8300_ide_print_resource(char *name, hw_regs_t *hw)
-{
-	printk("%s at 0x%08x-0x%08x,0x%08x on irq %d", name,
-		(unsigned int)hw->io_ports[IDE_DATA_OFFSET],
-		(unsigned int)hw->io_ports[IDE_DATA_OFFSET]+15,
-		(unsigned int)hw->io_ports[IDE_CONTROL_OFFSET],
-		hw->irq);
+		default_hwif_iops(hwif);
 }
diff -u h8300/h8max_ide.c.orig h8300/h8max_ide.c
--- h8max_ide.c.orig	2004-02-17 19:45:46.000000000 +0900
+++ h8max_ide.c	2004-02-17 19:50:32.000000000 +0900
@@ -23,8 +23,6 @@
 #include <linux/init.h>
 #include <asm/irq.h>
 
-#include "h8_ide_iops.h"
-
 /* IDE I/F configuration */
 #define IDE_BASE 0x200000
 #define IDE_CTRL 0x60000c
@@ -39,7 +37,7 @@
 #define IDE_SELECT	0x0C
 #define IDE_STATUS	0x0E
 
-static void h8300_ide_ports(hw_regs_t *hw, unsigned long ioaddr)
+static void __init h8300_ide_ports(hw_regs_t *hw, unsigned long ioaddr)
 {
 	hw->io_ports[IDE_DATA_OFFSET]	 = ioaddr + IDE_DATA;
 	hw->io_ports[IDE_ERROR_OFFSET]	 = ioaddr + IDE_ERROR;
@@ -63,14 +61,5 @@
 	hw.irq = IDE_IRQ;
 
 	if (ide_register_hw(&hw, &hwif) != -1)
-		h8300_hwif_iops(hwif);
-}
-
-void __init h8300_ide_print_resource(char *name, hw_regs_t *hw)
-{
-	printk("%s at 0x%08x-0x%08x,0x%08x on irq %d", name,
-		(unsigned int)hw->io_ports[IDE_DATA_OFFSET],
-		(unsigned int)hw->io_ports[IDE_DATA_OFFSET]+15,
-		(unsigned int)hw->io_ports[IDE_CONTROL_OFFSET],
-		hw->irq);
+		default_hwif_iops(hwif);
 }
-- 
Yoshinori Sato
<ysato@users.sourceforge.jp>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help