qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [4640] Enable SD card on creation.
@ 2008-06-02  0:55 Andrzej Zaborowski
  2008-06-02 13:19 ` Paul Brook
  0 siblings, 1 reply; 3+ messages in thread
From: Andrzej Zaborowski @ 2008-06-02  0:55 UTC (permalink / raw)
  To: qemu-devel

Revision: 4640
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4640
Author:   balrog
Date:     2008-06-02 00:55:08 +0000 (Mon, 02 Jun 2008)

Log Message:
-----------
Enable SD card on creation.

Modified Paths:
--------------
    trunk/hw/sd.c

Modified: trunk/hw/sd.c
===================================================================
--- trunk/hw/sd.c	2008-06-02 00:39:30 UTC (rev 4639)
+++ trunk/hw/sd.c	2008-06-02 00:55:08 UTC (rev 4640)
@@ -421,6 +421,7 @@
     sd = (SDState *) qemu_mallocz(sizeof(SDState));
     sd->buf = qemu_memalign(512, 512);
     sd->spi = is_spi;
+    sd->enable = 1;
     sd_reset(sd, bs);
     bdrv_set_change_cb(sd->bdrv, sd_cardchange, sd);
     return sd;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [4640] Enable SD card on creation.
  2008-06-02  0:55 [Qemu-devel] [4640] Enable SD card on creation Andrzej Zaborowski
@ 2008-06-02 13:19 ` Paul Brook
  2008-06-02 13:43   ` andrzej zaborowski
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Brook @ 2008-06-02 13:19 UTC (permalink / raw)
  To: qemu-devel

On Monday 02 June 2008, Andrzej Zaborowski wrote:
> Revision: 4640
>           http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4640
> Author:   balrog
> Date:     2008-06-02 00:55:08 +0000 (Mon, 02 Jun 2008)
>
> Log Message:
> -----------
> Enable SD card on creation.
> 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.  
The whole point of chip selects is to allow multiple devices on the same bus. 
See stellaris_ssi_bus for an example of a bus multiplexer with chip selects.

Paul

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [4640] Enable SD card on creation.
  2008-06-02 13:19 ` Paul Brook
@ 2008-06-02 13:43   ` andrzej zaborowski
  0 siblings, 0 replies; 3+ messages in thread
From: andrzej zaborowski @ 2008-06-02 13:43 UTC (permalink / raw)
  To: Paul Brook; +Cc: qemu-devel

On 02/06/2008, Paul Brook <paul@codesourcery.com> 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-06-02 13:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-02  0:55 [Qemu-devel] [4640] Enable SD card on creation Andrzej Zaborowski
2008-06-02 13:19 ` Paul Brook
2008-06-02 13:43   ` andrzej zaborowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).