qemu: android: Add support for multiple SD cards
Add commandline support for an additional SD card, and plumb support to
the MMC emulation layer. This patch also reworks the way the hw emulation
layer registers devices. Previously, the mmc virtual hardware was only
created if the sdcard image existed. Now, two virtual MMC controllers are
*always* created as on real hardware. When a request is made to one
of our controllers which has no image file bound to it, a new interrupt
status indicating a command timeout is sent to the guest driver, as
is standard with MMC controllers. This patch also sets the stage for
supporting hot-add / hot-remove.
Signed-off-by: San Mehat <san@google.com>
qemu: android: Integrate card detect into the virtual mmc hardware and
wire it up to the STATE_CHANGE irq status
Signed-off-by: San Mehat <san@google.com>
fixups from review - mmc now works with legacy
drivers
Signed-off-by: San Mehat <san@google.com>
diff --git a/android/help.c b/android/help.c
index a142f9d..cbca332 100644
--- a/android/help.c
+++ b/android/help.c
@@ -120,8 +120,8 @@
" You can use the -sysdir, -system, -kernel, -ramdisk, -datadir, -data options\n"
" to specify different search directories or specific image files. You can\n"
- " also use the -cache and -sdcard options to indicate specific cache partition\n"
- " and SD Card image files.\n\n"
+ " also use the -cache, -sdcard, and -sdcard2 options to indicate specific \n"
+ " cache partition and SD Card image files.\n\n"
" For more details, see the corresponding -help-<option> section.\n\n"
@@ -166,6 +166,7 @@
" system-qemu.img an *optional* persistent system image\n"
" cache.img an *optional* cache partition image\n"
" sdcard.img an *optional* SD Card partition image\n\n"
+ " sdcard2.img an *optional* second SD Card partition image\n\n"
" If you use a virtual device, its content directory should store\n"
" all writable images, and read-only ones will be found from the\n"
@@ -181,7 +182,7 @@
" can still run the emulator by explicitely providing the paths to\n"
" *all* required disk images through a combination of the following\n"
" options: -sysdir, -datadir, -kernel, -ramdisk, -system, -data, -cache\n"
- " and -sdcard\n\n"
+ " -sdcard, and -sdcard2\n\n"
" The actual logic being that the emulator should be able to find all\n"
" images from the options you give it.\n\n"
@@ -621,6 +622,21 @@
}
static void
+help_sdcard2(stralloc_t* out)
+{
+ PRINTF(
+ " use '-sdcard2 <file>' to specify a second SD Card image file that will be attached\n"
+ " to the emulator. By default, the 'sdcard.img' file is searched in the data\n"
+ " directory.\n\n"
+
+ " if the file does not exist, the emulator will still start, but without a\n"
+ " second SD Card attached.\n\n"
+
+ " see '-help-disk-images' for more information about disk image files\n\n"
+ );
+}
+
+static void
help_skindir(stralloc_t* out)
{
PRINTF(