All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yoshinori Sato <ysato@users.sourceforge.jp>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linux-ide@vger.kernel.org
Subject: Re: H8/300 target support patch
Date: Tue, 17 Feb 2004 20:33:41 +0900	[thread overview]
Message-ID: <m2lln2ndnu.wl%ysato@users.sourceforge.jp> (raw)
In-Reply-To: <1076969377.1053.62.camel@gaston>

At Tue, 17 Feb 2004 09:09:38 +1100,
Benjamin Herrenschmidt wrote:
> 
> 
> > > 
> > > 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>

  reply	other threads:[~2004-02-17 11:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-15  6:05 H8/300 target support patch Yoshinori Sato
2004-02-15 14:40 ` Bartlomiej Zolnierkiewicz
2004-02-16 16:09   ` Yoshinori Sato
2004-02-16 16:40     ` Bartlomiej Zolnierkiewicz
2004-02-16 22:07       ` Benjamin Herrenschmidt
2004-02-16 22:09     ` Benjamin Herrenschmidt
2004-02-17 11:33       ` Yoshinori Sato [this message]
2004-02-17 12:55         ` Benjamin Herrenschmidt
2004-02-19 16:12           ` Yoshinori Sato
2004-02-19 16:34             ` Bartlomiej Zolnierkiewicz
2004-02-20 12:28               ` Yoshinori Sato
2004-02-20 15:25                 ` Bartlomiej Zolnierkiewicz
2004-02-20 17:58                   ` Yoshinori Sato
2004-02-20 18:42                     ` Bartlomiej Zolnierkiewicz
2004-02-22 16:30                       ` Yoshinori Sato
2004-02-22 17:08                         ` Bartlomiej Zolnierkiewicz
2004-02-22 17:28                           ` Bartlomiej Zolnierkiewicz
2004-02-26 16:46                             ` Yoshinori Sato
2004-02-26 19:26                               ` Bartlomiej Zolnierkiewicz
2004-02-28 17:02                                 ` Yoshinori Sato
2004-02-28 17:55                                   ` Bartlomiej Zolnierkiewicz

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=m2lln2ndnu.wl%ysato@users.sourceforge.jp \
    --to=ysato@users.sourceforge.jp \
    --cc=benh@kernel.crashing.org \
    --cc=linux-ide@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.