linux-mips
[Top] [All Lists]

Re: [PATCH 1/2] ide: Add tx4939ide driver (v2)

To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Subject: Re: [PATCH 1/2] ide: Add tx4939ide driver (v2)
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Date: Wed, 24 Sep 2008 22:26:32 +0400
Cc: bzolnier@gmail.com, linux-mips@linux-mips.org, linux-ide@vger.kernel.org, ralf@linux-mips.org
In-reply-to: <48DA2543.4050304@ru.mvista.com>
Organization: MontaVista Software Inc.
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20080918.001342.52129176.anemo@mba.ocn.ne.jp> <48D57245.8060606@ru.mvista.com> <20080922.013256.128618380.anemo@mba.ocn.ne.jp> <48DA2543.4050304@ru.mvista.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
Hello, I  wrote:

+static void tx4939ide_tf_load(ide_drive_t *drive, ide_task_t *task)
+{
+    mm_tf_load(drive, task);
+    if (task->tf_flags & IDE_TFLAG_OUT_DEVICE) {
+        ide_hwif_t *hwif = drive->hwif;
+        void __iomem *base = TX4939IDE_BASE(hwif);
+        /* Fix ATA100 CORE System Control Register */
+        tx4939ide_writew(tx4939ide_readw(base, TX4939IDE_Sys_Ctl) &
+                 0x07f0,
+                 base, TX4939IDE_Sys_Ctl);

Why? Doesn't page 17-4 of the datasheet say that these bits get auto-cleared ona write to the device/head register? Or is this to address <CAUSION> on page 17-9?

Yes, that "CAUSION".  I will put it in the comment.

  Frankly speaking, I couldn't make out much of tht passage:

<CAUSION>
The write to the register by the Device/Head register may cause an unexpected function by write wrong data to the register. So please rewrite to the System Control register after write to the Device/Head
register to secure write to System Control register in ATA100 Core.

I thought that this was related to loading the correct transfer mode for the selected drive. But if it's not only that, it would be quite pointless to also implement selectproc() method if you have to hook the tf_load() method... Frankly speaking, I don't understand why they didn't implement 2 timing registers like on TC86C001 while still implementing 2 transfer counter registers...

MBR, Sergei

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