Patchwork [v1,2/2] xilinx_zynq: added sdhci controller

login
register
mail settings
Submitter Peter A. G. Crosthwaite
Date April 2, 2012, 6:24 a.m.
Message ID <148d2dd338c23c16203ad6b4e41c0c7ad339845c.1333347300.git.peter.crosthwaite@petalogix.com>
Download mbox | patch
Permalink /patch/150077/
State New
Headers show

Comments

Peter A. G. Crosthwaite - April 2, 2012, 6:24 a.m.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
---
 hw/xilinx_zynq.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/xilinx_zynq.c b/hw/xilinx_zynq.c
index 31d9e81..e92ebe0 100644
--- a/hw/xilinx_zynq.c
+++ b/hw/xilinx_zynq.c
@@ -161,6 +161,18 @@  static void zynq_init(ram_addr_t ram_size, const char *boot_device,
     sysbus_create_varargs("cadence_ttc", 0xF8002000,
             pic[69-IRQ_OFFSET], pic[70-IRQ_OFFSET], pic[71-IRQ_OFFSET], NULL);
 
+    dev = qdev_create(NULL, "sysbus_sdhci");
+    dinfo = drive_get(IF_SD, 0, 0);
+    if (dinfo) {
+        if (qdev_prop_set_drive(dev, "block", dinfo ? dinfo->bdrv : NULL)) {
+            fprintf(stderr, "ZYNQ: ERROR: bad sd data file specified\n");
+        }
+    }
+    qdev_init_nofail(dev);
+    busdev = sysbus_from_qdev(dev);
+    sysbus_mmio_map(busdev, 0, 0xE0100000);
+    sysbus_connect_irq(busdev, 0, pic[56-IRQ_OFFSET]);
+
     for (n = 0; n < nb_nics; n++) {
         nd = &nd_table[n];
         if (n == 0) {
@@ -190,7 +202,6 @@  static QEMUMachine zynq_machine = {
     .init = zynq_init,
     .use_scsi = 1,
     .max_cpus = 2,
-    .no_sdcard = 1
 };
 
 static void zynq_machine_init(void)