• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision1665ba42ee962c08db06e7737e5f24a39669124a (tree)
Time2018-01-06 09:17:52
AuthorPhilippe Mathieu-Daudé <f4bug@amsa...>
CommiterPhilippe Mathieu-Daudé

Log Message

sdhci: backport for the zynqmp

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Change Summary

Incremental Difference

--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -1481,7 +1481,6 @@ static void sdhci_sysbus_class_init(ObjectClass *klass, void *data)
14811481 }
14821482
14831483 static const TypeInfo sdhci_sysbus_info = {
1484- .abstract = true,
14851484 .name = TYPE_SYSBUS_SDHCI,
14861485 .parent = TYPE_SYS_BUS_DEVICE,
14871486 .instance_size = sizeof(SDHCIState),
--- a/hw/sd/zynqmp-sdhci.c
+++ b/hw/sd/zynqmp-sdhci.c
@@ -81,13 +81,9 @@ static void zynqmp_sdhci_slottype_handler(void *opaque, int n, int level)
8181
8282 static void zynqmp_sdhci_reset(DeviceState *dev)
8383 {
84- ZynqMPSDHCIState *s = ZYNQMP_SDHCI(dev);
85- SDHCIState *ss = SYSBUS_SDHCI(dev);
8684 DeviceClass *dc_parent = DEVICE_CLASS(ZYNQMP_SDHCI_PARENT_CLASS);
8785
8886 dc_parent->reset(dev);
89-
90- sd_set_cb(s->card, ss->ro_cb, ss->eject_cb);
9187 }
9288
9389 static void zynqmp_sdhci_realize(DeviceState *dev, Error **errp)
@@ -109,8 +105,24 @@ static void zynqmp_sdhci_realize(DeviceState *dev, Error **errp)
109105 index_offset++;
110106 }
111107
112- qdev_prop_set_uint32(dev, "capareg",
113- (uint32_t) SDHC_CAPAB_REG_DEFAULT | (1 << 28));
108+ /* Compatible with:
109+ * - SD Host Controller Specification Version 3.00
110+ * - SDIO Specification Version 3.0
111+ * - eMMC Specification Version 4.51
112+ *
113+ * Host clock rate variable between 0 and 208 MHz
114+ * Transfers the data in SDR104, SDR50, DDR50 modes
115+ * (SDR104 mode: up to 832Mbits/s using 4 parallel data lines)
116+ * Transfers the data in 1 bit and 4 bit SD modes
117+ * UHS speed modes, 1.8V
118+ * voltage switch, tuning commands
119+ */
120+ qdev_prop_set_uint8(dev, "sd-spec-version", 3);
121+ qdev_prop_set_bit(dev, "suspend", true);
122+ qdev_prop_set_bit(dev, "1v8", true);
123+ qdev_prop_set_bit(dev, "64bit", true);
124+ qdev_prop_set_uint8(dev, "bus-speed", 0b111);
125+ qdev_prop_set_uint8(dev, "driver-strength", 0b111);
114126 carddev_sd = qdev_create(qdev_get_child_bus(DEVICE(dev), "sd-bus"),
115127 TYPE_SD_CARD);
116128 object_property_set_bool(OBJECT(carddev_sd), false, "spi", &error_fatal);