@@ -41,3 +41,5 @@ virtio-gpu-3d.o-cflags := $(VIRGL_CFLAGS)
virtio-gpu-3d.o-libs += $(VIRGL_LIBS)
obj-$(CONFIG_DPCD) += dpcd.o
obj-$(CONFIG_XLNX_ZYNQMP) += xlnx_dp.o
+
+obj-$(CONFIG_IMX) += imx_lcdif.o
new file mode 100644
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2017, Impinj, Inc.
+ *
+ * i.MX LCD block emulation code
+ *
+ * Author: Andrey Smirnov <andrew.smirnov@gmail.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include "hw/display/imx_lcdif.h"
+#include "qemu/log.h"
+
+static uint64_t imx_lcdif_read(void *opaque, hwaddr offset,
+ unsigned size)
+{
+ return 0;
+}
+
+static void imx_lcdif_write(void *opaque, hwaddr offset,
+ uint64_t value, unsigned size)
+{
+}
+
+static const struct MemoryRegionOps imx_lcdif_ops = {
+ .read = imx_lcdif_read,
+ .write = imx_lcdif_write,
+ .endianness = DEVICE_NATIVE_ENDIAN,
+ .impl = {
+ .min_access_size = 4,
+ .max_access_size = 4,
+ .unaligned = false,
+ },
+};
+
+static void imx_lcdif_init(Object *obj)
+{
+ SysBusDevice *sd = SYS_BUS_DEVICE(obj);
+ IMXLCDState *s = IMX_LCDIF(obj);
+
+ memory_region_init_io(&s->iomem,
+ obj,
+ &imx_lcdif_ops,
+ s,
+ TYPE_IMX_LCDIF ".iomem",
+ 0x10000);
+ sysbus_init_mmio(sd, &s->iomem);
+}
+
+static void imx_lcdif_class_init(ObjectClass *klass, void *data)
+{
+ DeviceClass *dc = DEVICE_CLASS(klass);
+
+ dc->desc = "i.MX LCD Controller";
+}
+
+static const TypeInfo imx_lcdif_info = {
+ .name = TYPE_IMX_LCDIF,
+ .parent = TYPE_SYS_BUS_DEVICE,
+ .instance_size = sizeof(IMXLCDState),
+ .instance_init = imx_lcdif_init,
+ .class_init = imx_lcdif_class_init,
+};
+
+static void imx_lcdif_register_type(void)
+{
+ type_register_static(&imx_lcdif_info);
+}
+type_init(imx_lcdif_register_type)
new file mode 100644
@@ -0,0 +1,16 @@
+#ifndef IMX_LCDIF_H
+#define IMX_LCDIF_H
+
+#include "hw/sysbus.h"
+
+typedef struct IMXLCDState {
+ /*< private >*/
+ SysBusDevice parent_obj;
+
+ MemoryRegion iomem;
+} IMXLCDState;
+
+#define TYPE_IMX_LCDIF "imx:lcdif"
+#define IMX_LCDIF(obj) OBJECT_CHECK(IMXLCDState, (obj), TYPE_IMX_LCDIF)
+
+#endif /* IMX_LCDIF_H */
Add basic i.MX LCD block emulation code needed to boot Linux guest. Cc: Peter Maydell <peter.maydell@linaro.org> Cc: Jason Wang <jasowang@redhat.com> Cc: Philippe Mathieu-Daudé <f4bug@amsat.org> Cc: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Cc: yurovsky@gmail.com Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> --- hw/display/Makefile.objs | 2 ++ hw/display/imx_lcdif.c | 71 ++++++++++++++++++++++++++++++++++++++++++ include/hw/display/imx_lcdif.h | 16 ++++++++++ 3 files changed, 89 insertions(+) create mode 100644 hw/display/imx_lcdif.c create mode 100644 include/hw/display/imx_lcdif.h