linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Andrei Martynov <andrei.martynov@web.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>, linux-ide@vger.kernel.org
Subject: Re: porting IDE patches to PATA driver
Date: Mon, 29 Jun 2009 00:33:06 +0400	[thread overview]
Message-ID: <4A47D382.2080308@ru.mvista.com> (raw)
In-Reply-To: <20090626172143.3fe6a59c@lxorguk.ukuu.org.uk>

Hello.

Alan Cox wrote:

>> controller switches to a specific DVD-LOADER mode as soon as kernel
>> sends any command to the slave device, so they had to patch sources
>> and add a strange looking command
>>
>> OUT_BYTE((head|drive->select.all) & ~(1<<4), IDE_SELECT_REG);
>>
>> everywhere the slave device is accessed to cheat the controller and
>> let it believe it talks to the master. Slave device remains active
>> because it was already selected but the controller assumes we are
>> talking to the master and does not switch to DVD-LOADER mode.
>>     
>
> That can be done in a libata driver by providing your own exec_command
> functions but again could wait. Try something like
>
> static void my_sff_exec_command(struct ata_port *ap, const struct
> 	ata_taskfile *tf)
> {
> 	iowrite8(tf->command, ap->ioaddr.command_addr);
> 	if (tf->flags & ATA_TFLAG_DEVICE)
> 		iowrite8(tf->device & ~ATA_DEV1, ap->ioaddr.device_addr);
>   

  Note that this possibly violates ATA specs that forbid writing to any 
register with BSY set -- which might well be after wroiting a command, 
despite 400 ns couldn't have passed yet. IOW, I don't advice such 
trickery -- your write may well  be ignored.

> 	ata_sff_pause(ap);
> }

MBR, Sergei



  reply	other threads:[~2009-06-28 20:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-25  8:09 porting IDE patches to PATA driver Andrei Martynov
2009-06-25  8:23 ` Alan Cox
2009-06-25  8:38   ` Re[2]: " Andrei Martynov
2009-06-25  9:05     ` Alan Cox
2009-06-25 10:30       ` Re[2]: " Andrei Martynov
2009-06-25 11:29         ` Alan Cox
2009-06-26 13:24           ` Re[2]: " Andrei Martynov
2009-06-26 13:46             ` Alan Cox
2009-06-26 14:40               ` Re[2]: " Andrei Martynov
2009-06-26 16:21                 ` Alan Cox
2009-06-28 20:33                   ` Sergei Shtylyov [this message]
2009-06-29 12:31                     ` Alan Cox
2009-06-29 12:01                   ` Re[2]: " Andrei Martynov
2009-06-29 14:53                     ` Alan Cox
2009-07-03  9:50                       ` Re[2]: " Andrei Martynov
2009-07-04  1:17                         ` Robert Hancock

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=4A47D382.2080308@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=andrei.martynov@web.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).