[PATCH v2 4/7] qfw: Add flag to allow probing before relocation

Alper Nebi Yasak alpernebiyasak at gmail.com
Tue Aug 22 14:10:22 CEST 2023


QEMU firmware config drivers need to be probed to bind the ramfb device.
The ramfb driver needs to be bound before relocation to properly reserve
video memory for it, otherwise it cannot be probed after relocation. Add
the flag to probe QEMU firmware config drivers before relocation so that
ramfb can work as an initial vidconsole.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak at gmail.com>
---
Alternatively, I guess I could default VIDEO_PCI_DEFAULT_FB_SIZE to a
higher size with "if VIDEO_RAMFB". But it exists because "PCI drivers
cannot be bound before relocation unless they are mentioned in the
devicetree" and qfw is in the QEMU-generated devicetree unlike those, so
I assumed this would be the preferred way.

Changes in v2:
- Add patch "qfw: Add flag to allow probing before relocation"

 drivers/misc/qfw.c         | 1 +
 drivers/misc/qfw_mmio.c    | 1 +
 drivers/misc/qfw_pio.c     | 1 +
 drivers/misc/qfw_sandbox.c | 1 +
 4 files changed, 4 insertions(+)

diff --git a/drivers/misc/qfw.c b/drivers/misc/qfw.c
index 4e4260982cce..265f45290011 100644
--- a/drivers/misc/qfw.c
+++ b/drivers/misc/qfw.c
@@ -414,6 +414,7 @@ UCLASS_DRIVER(qfw) = {
 	.name		= "qfw",
 	.post_bind	= qfw_post_bind,
 	.per_device_auto	= sizeof(struct qfw_dev),
+	.flags = DM_FLAG_PRE_RELOC,
 };
 
 struct bootdev_ops qfw_bootdev_ops = {
diff --git a/drivers/misc/qfw_mmio.c b/drivers/misc/qfw_mmio.c
index f397384054a6..a5274982711c 100644
--- a/drivers/misc/qfw_mmio.c
+++ b/drivers/misc/qfw_mmio.c
@@ -116,4 +116,5 @@ U_BOOT_DRIVER(qfw_mmio) = {
 	.of_to_plat	= qfw_mmio_of_to_plat,
 	.probe	= qfw_mmio_probe,
 	.ops	= &qfw_mmio_ops,
+	.flags = DM_FLAG_PRE_RELOC,
 };
diff --git a/drivers/misc/qfw_pio.c b/drivers/misc/qfw_pio.c
index e2f628d33830..dae809bd3fea 100644
--- a/drivers/misc/qfw_pio.c
+++ b/drivers/misc/qfw_pio.c
@@ -66,4 +66,5 @@ U_BOOT_DRIVER(qfw_pio) = {
 	.id	= UCLASS_QFW,
 	.probe	= qfw_pio_probe,
 	.ops	= &qfw_pio_ops,
+	.flags = DM_FLAG_PRE_RELOC,
 };
diff --git a/drivers/misc/qfw_sandbox.c b/drivers/misc/qfw_sandbox.c
index 1002df75339e..0bd36acd1a09 100644
--- a/drivers/misc/qfw_sandbox.c
+++ b/drivers/misc/qfw_sandbox.c
@@ -120,6 +120,7 @@ U_BOOT_DRIVER(qfw_sandbox) = {
 	.plat_auto	= sizeof(struct qfw_sandbox_plat),
 	.probe	= qfw_sandbox_probe,
 	.ops	= &qfw_sandbox_ops,
+	.flags = DM_FLAG_PRE_RELOC,
 };
 
 U_BOOT_DRVINFO(qfw_sandbox) = {
-- 
2.40.1



More information about the U-Boot mailing list