public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Paul Mundt <lethal@linux-sh.org>
Cc: Matthias Fuchs <matthias.fuchs@esd-electronics.com>,
	linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
	Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH] Generic platform device IDE driver
Date: Fri, 13 Oct 2006 08:46:49 -0400	[thread overview]
Message-ID: <452F8AB9.20100@pobox.com> (raw)
In-Reply-To: <20061013122824.GA26705@linux-sh.org>

Paul Mundt wrote:
> On Fri, Oct 13, 2006 at 08:52:19AM +0100, Russell King wrote:
>> On Thu, Oct 12, 2006 at 03:13:48PM +0900, Paul Mundt wrote:
>>> Yes, that's one thing I was thinking of as well.. Here's a patch that
>>> makes an attempt at that, can you give it a try and see if it works for
>>> you? This applies on top of the earlier patch. None of the ARM, SH, or
>>> H8300 cases need to do the remapping at least.
>> It's likely that ARM will switch over to using the MMIO resources if
>> this patch makes it in.  There's certain ARM platforms which would
>> benefit from this change (since inb() and friends are more complex
>> than they necessarily need to be.)
>>
>> However, one issue needs to be solved before we could do that - how do
>> we handle the case where the IDE registers are on a 4 byte spacing
>> interval instead of the usual 1 byte?
>>
> We could solve this in the driver, but it sounds like this is something
> that libata should have some visibility of directly.
> 
>> I notice that this driver is calling ata_std_ports() which handles
>> the standard setup.  Maybe that needs to become a little more inteligent?
>>
> If we go this route, I suppose the easiest option will be simply to have
> a private structure with a few function pointers for these sorts of
> things, or we can simply have an element for the spacing interval if you
> don't forsee needing to change the ioaddrs in any fashion beyond the
> register spacing.. Which approach would you be more comfortable with?
> Are there any other items that you're concerned with in the current
> driver?


Here's the decision matrix for libata:  Will the hardware use the 
standard taskfile push/pull functions like ata_tf_load(), ata_tf_read(), 
ata_exec_command(), etc.?  If yes, simply replace ata_std_ports() call 
with a call to your own function, written similarly to 
pdc_ata_setup_port() in sata_promise.c.

If the hardware requires non-standard I/O accessors, or the register 
sizes themselves changed, then you must implement your own taskfile I/O 
functions, similar to k2_sata_tf_load(), k2_sata_tf_read(), and 
k2_bmdma_setup_mmio() in sata_svw.c.  For this case, data in struct 
ata_ioports is largely up to you to manage, or ignore.

If there are special command setup or teardown operations, there are 
other standard hooks to override as well.

	Jeff



      reply	other threads:[~2006-10-13 12:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-04  7:45 [PATCH] Generic platform device IDE driver Paul Mundt
2006-10-04 11:30 ` girish
2006-10-04 20:02   ` Paul Mundt
2006-10-04 12:25     ` girish
2006-10-04 11:41 ` Alan Cox
2006-10-04 20:05   ` Paul Mundt
2006-10-04 14:38     ` Alan Cox
2006-10-05  9:16       ` Paul Mundt
     [not found]         ` <200610111450.41909.matthias.fuchs@esd-electronics.com>
2006-10-12  6:13           ` Paul Mundt
2006-10-13  7:52             ` Russell King
2006-10-13 12:28               ` Paul Mundt
2006-10-13 12:46                 ` Jeff Garzik [this message]

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=452F8AB9.20100@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=lethal@linux-sh.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthias.fuchs@esd-electronics.com \
    /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