linux-mips
[Top] [All Lists]

Re: [PATCH] ide: Add tx4938ide driver (v2)

To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Subject: Re: [PATCH] ide: Add tx4938ide driver (v2)
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Date: Sun, 08 Feb 2009 14:44:58 +0300
Cc: linux-mips@linux-mips.org, linux-ide@vger.kernel.org, Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>, ralf@linux-mips.org
In-reply-to: <20081023.012013.52129771.anemo@mba.ocn.ne.jp>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20081023.012013.52129771.anemo@mba.ocn.ne.jp>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)
Hello.

Atsushi Nemoto wrote:

This is the driver for the Toshiba TX4938 SoC EBUS controller ATA mode.
It has custom set_pio_mode and some hacks for big endian.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
[...]
+static void tx4938ide_input_data_swap(ide_drive_t *drive, struct request *rq,
+                               void *buf, unsigned int len)
+{
+       unsigned long port = drive->hwif->io_ports.data_addr;
+       unsigned short *ptr = buf;
+       unsigned int count = (len + 1) / 2;
+
+       while (count--)
+               *ptr++ = cpu_to_le16(__raw_readw((void __iomem *)port));
+       __ide_flush_dcache_range((unsigned long)buf, count * 2);
+}
+
+static void tx4938ide_output_data_swap(ide_drive_t *drive, struct request *rq,
+                               void *buf, unsigned int len)
+{
+       unsigned long port = drive->hwif->io_ports.data_addr;
+       unsigned short *ptr = buf;
+       unsigned int count = (len + 1) / 2;
+
+       while (count--) {
+               __raw_writew(le16_to_cpu(*ptr), (void __iomem *)port);
+               ptr++;
+       }
+       __ide_flush_dcache_range((unsigned long)buf, count * 2);
+}

Atsushi, does TX49 really suffer from the issue that these flushes are trying to address?

MBR, Sergei



<Prev in Thread] Current Thread [Next in Thread>