public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: Kernel configurations for R2D PLUS with Compact Flush support
Date: Sun, 21 Sep 2008 21:18:00 +0000	[thread overview]
Message-ID: <20080921211759.GA10271@linux-sh.org> (raw)
In-Reply-To: <48D60BEA.2040806@juno.dti.ne.jp>

On Sun, Sep 21, 2008 at 10:24:21PM +0900, Shin-ichiro KAWASAKI wrote:
> Thanks for your quick answers!
> I've started to investigate pata_platform.c and libata-sff.c.
> It will takes some time for me to understand them.
> 
> >Note that you can optionally just hand in 0 for the IRQ in order to
> >disable IRQ mode and simply default to polling (which the following patch
> >does).
> 
> Do you mean that polling by kernel will let us skip the implementation of
> IRQ part of the CF support?  It sounds good to make progress step by step.
> 
Correct. On R2D boards the CF IRQ is routed through an FPGA, where some
earlier versions of the board have buggy FPGA logic, and we just don't
bother hooking up the IRQ at all. pata_platform takes an optional
IORESOURCE_IRQ, so if one is not provided, polling is used instead.

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h«ac3f784f11cf8ccca0fc37ae4f5ff04cc245c4

Given that, the easiest solution is probably for the qemu defconfig to
set V1 of the board to automatically enable the polling logic, then
switch that back to enabling R2D+ support at a later point when the
system emulator handles the IRQ correctly.

> >>Any help or comments will be welcome.  Thanks.
> >>
> >I had the same idea on the flight back from kernel summit :-)
> >
> >So, how about something like this for a start?
> 
> Good!  It will be the first part of the patches for CF support.
> 
> >+
> >+    isa_ide_init(ide_iobase[0], ide_iobase[1], 0, hd[0], NULL);
> >+
> 
> This part seems to cause a segmentation fault, perhaps you know.
> I guess that the reason is that isa_ide_init() handles the iobase
> as I/O port number, not a memory mapped I/O address.
> 
Indeed. It was intended more as a proof of concept than anything else.
MMIO is certainly the way it wants to go.

> hw/ide.c:pmac_init_ide() handles the memory mapped I/O.
> So, instead of invoking isa_ide_init(), following (dirty) lines
> will work to avoid the fault.
> 
> {
>    int ide_memory = pmac_ide_init(&hd[0], 0 /* no irq */);
>    cpu_register_physical_memory(ide_iobase[0], 0x1000, ide_memory);
> }
> 
That looks like a better approach, yes. It's probably worth generalizing
the pmac_ide code so it's something more like mmio_ide, as it's fairly
generic. One of the things to watch out for is the I/O port shifting (see
ioport_shift in the pata_platform info).

      parent reply	other threads:[~2008-09-21 21:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-21  8:55 Kernel configurations for R2D PLUS with Compact Flush support Shin-ichiro KAWASAKI
2008-09-21 10:01 ` Paul Mundt
2008-09-21 13:24 ` Shin-ichiro KAWASAKI
2008-09-21 21:18 ` Paul Mundt [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=20080921211759.GA10271@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=linux-sh@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