On 2015-02-03 19:03, Peter Maydell wrote: > On 30 January 2015 at 20:19, Jan Kiszka wrote: >> This allows to use MMC emulation with the Integrator/CP model. Well, >> mostly. There seems to be timing issues with Linux so that the card is >> not always detected (but most of the time). >> >> Note that the read-only pin is intentionally left unconnected because >> the PIC model could deliver it incorrectly as interrupt to the guest >> while the spec says that this pin is just for status reading. > > I'm not sure what you mean here. The WPROT signal isn't wired > up to the SIC at all as far as I can see -- it's just a read-only > bit in the CP_INTREG register in what we model as "icp_control". > > Your patch doesn't seem to do anything with the icp_control at all, > which doesn't look right, because the docs say that to clear the > 'card insert' interrupt reported by the SIC you need to write > to the CP_INTREG register. > > The gpio out line from the PL181 is just a status line (high when > a card is present, low if not); there needs to be a latch somewhere > in here that gets reset by the CP_INTREG write, the PL181 line > isn't just wired directly to the SIC. Indeed, read this too quickly. Let's see if modeling this more correctly will also improve the detection reliability. Jan