+/* DMA transfer control data between UCLASS_QFW and QEMU. */
+struct qfw_dma {
+ __be32 control;
+ __be32 length;
+ __be64 address;
+};
+
+/* uclass per-device configuration information */
+struct qfw_dev {
+ struct udevice *dev; /* Transport device */
+ bool dma_present; /* DMA interface usable? */
+ struct list_head fw_list; /* Cached firmware file list */
+};
+
+/* Ops used internally between UCLASS_QFW and its driver implementations. */
+struct dm_qfw_ops {
+ /**
+ * read_entry_io() - Read a firmware config entry using the regular
+ * IO interface for the platform (either PIO or MMIO)
+ *
+ * Supply %FW_CFG_INVALID as the entry to continue a previous read. In
+ * this case, no selector will be issued before reading.
+ *
+ * @dev: Device to use
+ * @entry: Firmware config entry number (e.g. %FW_CFG_SIGNATURE)
+ * @size: Number of bytes to read
+ * @address: Target location for read
+ */
+ void (*read_entry_io)(struct udevice *dev, u16 entry, u32 size,
+ void *address);
+
+ /**
+ * read_entry_dma() - Read a firmware config entry using the DMA
+ * interface
+ *
+ * Supply FW_CFG_INVALID as the entry to continue a previous read. In
+ * this case, no selector will be issued before reading.
+ *
+ * This method assumes DMA availability has already been confirmed.
+ *
+ * @dev: Device to use
+ * @dma: DMA transfer control struct
+ */
+ void (*read_entry_dma)(struct udevice *dev, struct qfw_dma *dma);
+};
+
+#define dm_qfw_get_ops(dev) \
+ ((struct dm_qfw_ops *)(dev)->driver->ops)
+
+/**
+ * qfw_register() - Called by a qfw driver after successful probe.
+ * @dev: Device registering itself with the uclass.
+ *
+ * Used internally by driver implementations on successful probe.
+ *
+ * Return: 0 on success, negative otherwise.
+ */
+int qfw_register(struct udevice *dev);
+
+struct udevice;
+
+/**
+ * qfw_get_dev() - Get QEMU firmware config device.
+ * @devp: Pointer to be filled with address of the qfw device.
+ *
+ * Gets the active QEMU firmware config device, for use with qfw_read_entry()
+ * and others.
+ *
+ * Return: 0 on success, -ENODEV if the device is not available.
+ */
+int qfw_get_dev(struct udevice **devp);
+