From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yoshinori Sato Subject: Re: H8/300 target support patch Date: Tue, 17 Feb 2004 20:33:41 +0900 Sender: linux-ide-owner@vger.kernel.org Message-ID: References: <200402151540.56377.bzolnier@elka.pw.edu.pl> <1076969377.1053.62.camel@gaston> Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from p062096.ppp.asahi-net.or.jp ([221.113.62.96]:35058 "EHLO mitou.ysato.dip.jp") by vger.kernel.org with ESMTP id S265652AbUBQLdp (ORCPT ); Tue, 17 Feb 2004 06:33:45 -0500 In-Reply-To: <1076969377.1053.62.camel@gaston> List-Id: linux-ide@vger.kernel.org To: Benjamin Herrenschmidt Cc: linux-ide@vger.kernel.org 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 #include -#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 #include -#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