[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH v5 22/31] sdhci: add the generic Arasan SDHCI 8.9a PHY
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-arm] [PATCH v5 22/31] sdhci: add the generic Arasan SDHCI 8.9a PHY |
Date: |
Mon, 8 Jan 2018 12:42:54 -0300 |
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/sd/arasan_sdhci.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/hw/sd/arasan_sdhci.c b/hw/sd/arasan_sdhci.c
index c6d96b2583..11160baa22 100644
--- a/hw/sd/arasan_sdhci.c
+++ b/hw/sd/arasan_sdhci.c
@@ -49,6 +49,42 @@ static void arasan4_9a_sdhci_realize(DeviceState *dev, Error
**errp)
}
}
+/* Compatible with:
+ * - SD Host Controller Specification Version 3.00
+ * - SDIO Specification Version 3.0
+ * - eMMC Specification Version 4.51
+ *
+ * Host clock rate variable between 0 and 208 MHz
+ * Transfers the data in SDR104, SDR50, DDR50 modes
+ * (SDR104 mode: up to 832Mbits/s using 4 parallel data lines)
+ * Transfers the data in 1 bit and 4 bit SD modes
+ * UHS speed modes, 1.8V
+ * voltage switch, tuning commands
+ */
+static void arasan8_9a_sdhci_realize(DeviceState *dev, Error **errp)
+{
+ SDHCICommonClass *cc = SYSBUS_SDHCI_COMMON_GET_CLASS(dev);
+ Object *obj = OBJECT(dev);
+ Error *local_err = NULL;
+
+ object_property_set_uint(obj, 3, "sd-spec-version", &local_err);
+ object_property_set_bool(obj, true, "suspend", &local_err);
+ object_property_set_bool(obj, true, "1v8", &local_err);
+ object_property_set_bool(obj, true, "64bit", &local_err);
+ object_property_set_uint(obj, 0b111, "bus-speed", &local_err);
+ object_property_set_uint(obj, 0b111, "driver-strength", &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return;
+ }
+
+ cc->parent_realize(dev, &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return;
+ }
+}
+
static void arasan4_9a_sdhci_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -58,15 +94,31 @@ static void arasan4_9a_sdhci_class_init(ObjectClass *klass,
void *data)
dc->realize = arasan4_9a_sdhci_realize;
}
+static void arasan8_9a_sdhci_class_init(ObjectClass *klass, void *data)
+{
+ DeviceClass *dc = DEVICE_CLASS(klass);
+ SDHCICommonClass *cc = SYSBUS_SDHCI_COMMON_CLASS(klass);
+
+ cc->parent_realize = dc->realize;
+ dc->realize = arasan8_9a_sdhci_realize;
+}
+
static const TypeInfo arasan4_9a_sdhci_info = {
.name = "arasan,sdhci-4.9a",
.parent = TYPE_SYSBUS_SDHCI,
.class_init = arasan4_9a_sdhci_class_init,
};
+static const TypeInfo arasan8_9a_sdhci_info = {
+ .name = "arasan,sdhci-8.9a",
+ .parent = TYPE_SYSBUS_SDHCI,
+ .class_init = arasan8_9a_sdhci_class_init,
+};
+
static void arasan_sdhci_register_types(void)
{
type_register_static(&arasan4_9a_sdhci_info);
+ type_register_static(&arasan8_9a_sdhci_info);
}
type_init(arasan_sdhci_register_types)
--
2.15.1
- [Qemu-arm] [PATCH v5 13/31] hw/arm/xilinx_zynq: use the "arasan, sdhci-4.9a" device, (continued)
- [Qemu-arm] [PATCH v5 13/31] hw/arm/xilinx_zynq: use the "arasan, sdhci-4.9a" device, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 14/31] sdhci: add qtest to check the SD Spec version, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 15/31] sdhci: check Spec v2 capabilities qtest, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 16/31] sdhci: add v3 capabilities, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 17/31] sdhci: rename the hostctl1 register, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 18/31] sdhci: add the Broadcom BCM2835 SDHCI controller, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 19/31] hw/arm/bcm2835_peripherals: use the "brcm, bcm2835-sdhci" device, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 20/31] sdhci: add the Freescale controller for i.MX, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 21/31] hw/arm/fsl-imx6: use the "fsl, imx6q-usdhc" controller, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 22/31] sdhci: add the generic Arasan SDHCI 8.9a PHY,
Philippe Mathieu-Daudé <=
- [Qemu-arm] [PATCH v5 23/31] hw/arm/xilinx_zynqmp: use the "arasan, sdhci-8.9a" device, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 24/31] sdhci: let the SYSBUS_SDHCI type be abstract, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 25/31] sdhci: check Spec v3 capabilities qtest, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 26/31] sdhci: remove the deprecated 'capareg' property, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 27/31] sdhci: add check_capab_readonly() qtest, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 28/31] sdhci: add a check_capab_baseclock() qtest, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 29/31] sdhci: add a check_capab_sdma() qtest, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 30/31] sdhci: add a check_capab_v3() qtest, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 31/31] sdhci: add Spec v4.2 register definitions, Philippe Mathieu-Daudé, 2018/01/08