From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4vxf-0006H5-4w for qemu-devel@nongnu.org; Fri, 04 Dec 2015 14:24:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4vxb-0007kV-A6 for qemu-devel@nongnu.org; Fri, 04 Dec 2015 14:24:07 -0500 Received: from mail-qk0-x22e.google.com ([2607:f8b0:400d:c09::22e]:35951) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4vxb-0007kC-5f for qemu-devel@nongnu.org; Fri, 04 Dec 2015 14:24:03 -0500 Received: by qkda6 with SMTP id a6so48025774qkd.3 for ; Fri, 04 Dec 2015 11:24:02 -0800 (PST) Date: Fri, 4 Dec 2015 14:24:01 -0500 From: Kevin O'Connor Message-ID: <20151204192400.GD28805@morn.lan> References: <1439302524-19142-1-git-send-email-peter.maydell@linaro.org> <1439302524-19142-2-git-send-email-peter.maydell@linaro.org> <87bnde2nf2.fsf@blackfin.pond.sub.org> <8737yq181q.fsf@blackfin.pond.sub.org> <8737vizn4c.fsf@blackfin.pond.sub.org> <5661C289.9000506@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH 1/3] hw/sd/pxa2xx_mmci: convert to SysBusDevice object List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: Peter Maydell , Patch Tracking , QEMU Developers , Markus Armbruster , Stefan Hajnoczi , Paolo Bonzini On Fri, Dec 04, 2015 at 10:50:21AM -0800, Peter Crosthwaite wrote: > > FWIW, I don't think the SD card will be qdevified because it doesn't > > need a bus. It's similar indeed to SerialState, which was supposed to > > be the poster child of QOM embedding and never got QOMified. > > SD is a bus in its own right and should be busified and QOMified IMO. > SDHCI can talk to non-sd cards (SDIO). There is also a range of > incompatible cards that you can talk to - MMC/eMMC/SD(H|S|X)C. I think > anything that couples the controller to an SD card is a bug, the card > and device should be arranged as separate devices. > > > A host controller controls exactly one SD card, the SSI bridge is also > > for exactly one SD card, etc. > > I think you can RYO chip selects with a GPIO and control multiple SD > cards with one SDHCI. In practice, the SDHCI controllers are one-to-one with cards. This is codified in the sdhci spec as it has a "card present" bit and "port location" information that is per controller. I suppose in theory, one could put an SDHCI contoller into SPI compatibility mode and "hot wire" it into a bus, but qemu doesn't support that anyway, and it is a lot of complexity for something that is not done in practice. -Kevin