> From: Peter Maydell [mailto:peter.mayd...@linaro.org]
> Sent: Wednesday, 9 December 2015 13:01
> On 9 December 2015 at 18:54, Peter Crosthwaite
> <crosthwaitepe...@gmail.com> wrote:
> > On Wed, Dec 9, 2015 at 10:17 AM, Andrew Baumann
> > <andrew.baum...@microsoft.com> wrote:
> >>> From: Peter Crosthwaite [mailto:crosthwaitepe...@gmail.com]
> >>> Is that more likely to be an IP connectivity problem (wierd input to
> >>> the card-detect pin in the SoC)?
> >>
> >> That might be it, but in any case I still need to model it somehow.
> >>
> >
> > Ideally, this would be managed on the board level but it is kinda hard
> > the way to code is organised. Currently SDHCI is managing the SD card
> > instantiation due to a lack of QOMification. So for the moment, this
> > would be valid as a boolean property which disables the card detect
> > logic completely. If we get the SD QOMification though, the power,
> > card detect and sd interface proper can then be more finely managed on
> > the board level for all these varying connectivity configurations.
> 
> Card detect you should be able to handle on the board level without
> waiting for QOMification -- it's just modelled as a QEMU irq line
> (the vexpress board connects it up to a random register, or you could
> not connect it to anything, etc).

Forgive me if I'm slow, but I don’t see how that could work for sdhci.

Vexpress uses pl181, which has GPIO _outputs_ for card inserted etc. sdhci 
multiplexes the card inserted interrupt (which originates in sd.c) along with 
other SD events like command completion into a single interrupt line.

If there was a way to interpose on the irq between sd and sdhci, I think I 
could do what I want, but right now they are allocated and wired up in sdhci's 
init routine.

Andrew

Reply via email to