From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K3AKN-00078o-Mv for qemu-devel@nongnu.org; Mon, 02 Jun 2008 09:43:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K3AKM-00078Q-JL for qemu-devel@nongnu.org; Mon, 02 Jun 2008 09:43:59 -0400 Received: from [199.232.76.173] (port=53930 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K3AKM-00078N-Bt for qemu-devel@nongnu.org; Mon, 02 Jun 2008 09:43:58 -0400 Received: from ug-out-1314.google.com ([66.249.92.172]:56969) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K3AKM-0001TH-5z for qemu-devel@nongnu.org; Mon, 02 Jun 2008 09:43:58 -0400 Received: by ug-out-1314.google.com with SMTP id j40so258303ugd.4 for ; Mon, 02 Jun 2008 06:43:57 -0700 (PDT) Message-ID: Date: Mon, 2 Jun 2008 15:43:56 +0200 From: "andrzej zaborowski" Subject: Re: [Qemu-devel] [4640] Enable SD card on creation. In-Reply-To: <200806021419.08543.paul@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200806021419.08543.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: qemu-devel@nongnu.org On 02/06/2008, Paul Brook wrote: > > void sd_enable(SDState *sd, int enable) > > This shouldn't exist to start with. It should be using a qemu_irq, like the > other GPIO pins do, and probably wants to be implemented outside sd.c anyway. Yes, that shouldn't be in sd.c. We should be able to create a number of SD cards and "insert" and "eject" them from the slots using monitor commands or a chipselect pin driven by guest. I partially did this in svn.openmoko.org qemu where we have SDIO cards using the same slots as SD. The root misconception is of whether BlockDriverState represents the drive or the media. In the cd-rom implementation the whole state machine is in the drive and the media is just a piece of plastic. In MMC/SD the removable card has the entire state machine in it and using bdrv_is_inserted() makes no sense anymore. -- Please do not print this email unless absolutely necessary. Spread environmental awareness.