From: Graeme Russ <graeme.russ@gmail.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-ide@vger.kernel.org
Subject: Re: Using PATA Platform Driver to access Memory Mapped CF Card
Date: Sun, 02 May 2010 21:57:11 +1000 [thread overview]
Message-ID: <4BDD6897.7000002@gmail.com> (raw)
In-Reply-To: <20100501113346.29225519@lxorguk.ukuu.org.uk>
Alan Cox wrote:
> On Sat, 01 May 2010 17:13:47 +1000
> Graeme Russ <graeme.russ@gmail.com> wrote:
>
>> Hello,
>>
>> I have a CF slot mapped to a GP bus on a board I'm porting linux to. It is
>> wired in 8-bit Memory Mode only with only A0 - A3 mapped from the address
>> bus (starting at 0x20000000). I know the arrangement works as this board is
>> successfully accessing CF cards using existing proprietary firmware.
>
> Our ATA/IDE driver stack only supports 16/32bit accesses for data. You
> can override the data_xfer methods in a driver to do 8bit transfers. That
> may be one problem you are seeing I guess.
>
Bingo! Thanks - I simply hacked:
ioread16_rep(data_addr, buf, words);
to:
ioread8_rep(data_addr, buf, buflen);
(and similarly for the writes) in ata_sff_data_xfer() and it all "just
works (tm)":
[ 2.106837] ata1.00: CFA: SanDisk SDCFH-1024, HDX 4.04, max PIO4
[ 2.109659] ata1.00: 2001888 sectors, multi 0: LBA
[ 2.111034] ata1.00: configured for PIO
[ 2.114811] ata1.00: configured for PIO
[ 2.116445] ata1: EH complete
[ 2.130852] scsi 0:0:0:0: Direct-Access ATA SanDisk SDCFH-10
HDX PQ: 0 ANSI: 5
[ 2.150821] sd 0:0:0:0: [sda] 2001888 512-byte logical blocks: (1.02
GB/977 MiB)
[ 2.158847] sd 0:0:0:0: [sda] Write Protect is off
[ 2.161977] sd 0:0:0:0: [sda] Write cache: disabled, read cache:
enabled, doesn't support DPO or FUA
[ 2.177842] sda: sda1
[ 2.205838] sd 0:0:0:0: [sda] Attached SCSI removable disk
Now to do things right - I've traced everything back into
pata_platform_port_ops (.sff_data_xfer = ata_sff_data_xfer_noirq). So I
will need to create custom data_xfer_noirq and data_xfer functions for the
8-bit transfers. Is there an elegant way to override pata_platform's use of
ata_sff_data_xfer_noirq or will I need to also write a new version of
pata_platform as well?
Thanks
Graeme
next prev parent reply other threads:[~2010-05-02 11:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4BDAE529.20903@gmail.com>
[not found] ` <201005010524.40949.marek.vasut@gmail.com>
2010-05-01 7:13 ` Using PATA Platform Driver to access Memory Mapped CF Card Graeme Russ
2010-05-01 10:33 ` Alan Cox
2010-05-02 11:57 ` Graeme Russ [this message]
2010-05-02 12:29 ` Alan Cox
2010-05-03 1:39 ` Graeme Russ
2010-05-03 10:57 ` Alan Cox
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=4BDD6897.7000002@gmail.com \
--to=graeme.russ@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--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).