Skip to contentSkip to conversation

misc: qcom-geni: add DM_FLAG_PRE_RELOC to geni-se-qup driver

PATCH In review Gurumoorthy Santhakumar 3 participants 4 messages May 24 – Jun 3

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 misc: qcom-geni: add DM_FLAG_PRE_RELOC to geni-se-qup driver

The GENI SE QUP wrapper driver (geni-se-qup) needs to be bound during pre-relocation to allow its child devices (such as the debug UART) to be discovered and probed before relocation.

Without DM_FLAG_PRE_RELOC, the qupv3 device is skipped during the pre-relocation DM scan, which prevents early serial devices from being bound. This causes serial_find_console_or_panic() to fail with "No serial driver found" during serial_init().

Add DM_FLAG_PRE_RELOC to the geni_se_qup driver so that the GENI SE QUP wrapper and its children are bound during pre-relocation, enabling the serial console to be initialized correctly.

---
 drivers/misc/qcom_geni.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/qcom_geni.c +1 -1
index a62ae6a2478..cbad7bd3bd2 100644
@@ -576,5 +576,5 @@ U_BOOT_DRIVER(geni_se_qup) = {
 	.of_match = geni_ids,
 	.of_to_plat = geni_se_of_to_plat,
 	.plat_auto = sizeof(struct geni_se_plat),
-	.flags = DM_FLAG_DEFAULT_PD_CTRL_OFF,
+	.flags = DM_FLAG_PRE_RELOC | DM_FLAG_DEFAULT_PD_CTRL_OFF,
 };
Signature · 1 line
2.34.1
#1 lore raw

Hi Gurumoorthy,

Quoted 31 lines · Gurumoorthy Santhakumar

The GENI SE QUP wrapper driver (geni-se-qup) needs to be bound during pre-relocation to allow its child devices (such as the debug UART) to be discovered and probed before relocation.

Without DM_FLAG_PRE_RELOC, the qupv3 device is skipped during the pre-relocation DM scan, which prevents early serial devices from being bound. This causes serial_find_console_or_panic() to fail with "No serial driver found" during serial_init().

Add DM_FLAG_PRE_RELOC to the geni_se_qup driver so that the GENI SE QUP wrapper and its children are bound during pre-relocation, enabling the serial console to be initialized correctly.

---
 drivers/misc/qcom_geni.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/qcom_geni.c +1 -2
index a62ae6a2478..cbad7bd3bd2 100644
@@ -576,5 +576,5 @@ U_BOOT_DRIVER(geni_se_qup) = {
        .of_match = geni_ids,
        .of_to_plat = geni_se_of_to_plat,
        .plat_auto = sizeof(struct geni_se_plat),
-       .flags = DM_FLAG_DEFAULT_PD_CTRL_OFF,
+       .flags = DM_FLAG_PRE_RELOC | DM_FLAG_DEFAULT_PD_CTRL_OFF,
 };
--
Quoted 2 lines

2.34.1

Should this use a bootph tag?

Regards,
Simon

#2 lore raw
In reply to Gurumoorthy Santhakumar
Quoted 4 lines · Gurumoorthy Santhakumar

The GENI SE QUP wrapper driver (geni-se-qup) needs to be bound during pre-relocation to allow its child devices (such as the debug UART) to be discovered and probed before relocation.

Quoted 8 lines

Without DM_FLAG_PRE_RELOC, the qupv3 device is skipped during the pre-relocation DM scan, which prevents early serial devices from being bound. This causes serial_find_console_or_panic() to fail with "No serial driver found" during serial_init().

Add DM_FLAG_PRE_RELOC to the geni_se_qup driver so that the GENI SE QUP wrapper and its children are bound during pre-relocation, enabling the serial console to be initialized correctly.

This is a non-issue if you correctly set /chosen/stdout-path in your DTB. I'd rather minimise the devices we probe pre-reloc and skip this whole dance which we will do once we get
https://lore.kernel.org/u-boot/[email protected]/

Kind regards,

Quoted 17 lines
---
 drivers/misc/qcom_geni.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/qcom_geni.c +1 -1
index a62ae6a2478..cbad7bd3bd2 100644
@@ -576,5 +576,5 @@ U_BOOT_DRIVER(geni_se_qup) = {
 	.of_match = geni_ids,
 	.of_to_plat = geni_se_of_to_plat,
 	.plat_auto = sizeof(struct geni_se_plat),
-	.flags = DM_FLAG_DEFAULT_PD_CTRL_OFF,
+	.flags = DM_FLAG_PRE_RELOC | DM_FLAG_DEFAULT_PD_CTRL_OFF,
 };
Signature · 1 line
// Casey (she/her)
#3 lore raw

Hi Casey,
Thanks  for the feedback, please find my reply below,

Quoted 11 lines · Casey Connolly
Quoted 9 lines · Gurumoorthy Santhakumar

The GENI SE QUP wrapper driver (geni-se-qup) needs to be bound during pre-relocation to allow its child devices (such as the debug UART) to be discovered and probed before relocation.

Without DM_FLAG_PRE_RELOC, the qupv3 device is skipped during the pre-relocation DM scan, which prevents early serial devices from being bound. This causes serial_find_console_or_panic() to fail with "No serial driver found" during serial_init().

Quoted 7 lines
Quoted 3 lines

Add DM_FLAG_PRE_RELOC to the geni_se_qup driver so that the GENI SE QUP wrapper and its children are bound during pre-relocation, enabling the serial console to be initialized correctly.

This is a non-issue if you correctly set /chosen/stdout-path in your DTB. I'd rather minimise the devices we probe pre-reloc and skip this whole dance which we will do once we get
https://lore.kernel.org/u-boot/[email protected]/

I've addressed in v2 patch

Quoted 19 lines

Kind regards,

Quoted 16 lines
---
  drivers/misc/qcom_geni.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/qcom_geni.c +1 -1
index a62ae6a2478..cbad7bd3bd2 100644
@@ -576,5 +576,5 @@ U_BOOT_DRIVER(geni_se_qup) = {
  	.of_match = geni_ids,
  	.of_to_plat = geni_se_of_to_plat,
  	.plat_auto = sizeof(struct geni_se_plat),
-	.flags = DM_FLAG_DEFAULT_PD_CTRL_OFF,
+	.flags = DM_FLAG_PRE_RELOC | DM_FLAG_DEFAULT_PD_CTRL_OFF,
  };