[PATCH 2/5] board: ten64: add fdt fixup to hide usb hub topology

Peng Fan peng.fan at oss.nxp.com
Mon Apr 20 14:43:12 CEST 2026


Hi Mathew,

On Thu, Apr 09, 2026 at 10:06:32AM +1000, Mathew McBride wrote:
>The USB Hub (microchip,usb5744) can enter a dis-/reconnect loop
>if a driver tries to re-initialise the hub over I2C.
>
>On the Ten64 board, this process only needs to be run once
>per system reset cycle, which is carried out by U-Boot.
>
>As there are distributions shipping with the affected
>driver by default, the best solution is to remove
>the USB hub toplogy information from the FDT passed
>to the operating system, so the OS won't attempt
>to re-initialise the USB hub under any circumstance.
>
>Signed-off-by: Mathew McBride <matt at traverse.com.au>
>---
> board/traverse/ten64/ten64.c | 49 ++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 49 insertions(+)
>
>diff --git a/board/traverse/ten64/ten64.c b/board/traverse/ten64/ten64.c
>index d41bd2e9dee..69632fdc31e 100644
>--- a/board/traverse/ten64/ten64.c
>+++ b/board/traverse/ten64/ten64.c
>@@ -186,6 +186,50 @@ void fdt_fixup_board_enet(void *fdt)
> 		fdt_status_fail(fdt, offset);
> }
> 
>+/* The onboard USB hub driver (microchip,usb5744)
>+ * can cause a disconnect-reconnect loop if the operating system
>+ * attempts to re-initalise the hub after U-Boot has already done it.
>+ * (This process only needs to be done once per system RESET cycle)
>+ *
>+ * To avoid this condition, make the hub topology invisible
>+ * to the operating system.
>+ * It is also required to remove the hub on boards
>+ * without it (RevD).
>+ */
>+int fdt_fixup_usb_hub(void *fdt)
>+{
>+	int usb1_hub2744_offset, usb1_hub5744_offset;
>+	int i2c_usb5744_offset;
>+	int err;
>+
>+	usb1_hub2744_offset = fdt_path_offset(fdt, "/soc/usb at 3110000/hub at 1");
>+
>+	if (usb1_hub2744_offset < 0)
>+		return usb1_hub2744_offset;
>+
>+	err = fdt_del_node(fdt, usb1_hub2744_offset);
>+	if (err)
>+		return err;
>+
>+	usb1_hub5744_offset = fdt_path_offset(fdt, "/soc/usb at 3110000/hub at 2");
>+	if (usb1_hub5744_offset < 0)
>+		return usb1_hub5744_offset;
>+
>+	err = fdt_del_node(fdt, usb1_hub5744_offset);
>+	if (err)
>+		return err;
>+
>+	i2c_usb5744_offset = fdt_path_offset(fdt, "/soc/i2c at 2000000/usb-hub at 2d");
>+	if (i2c_usb5744_offset < 0)
>+		return i2c_usb5744_offset;
>+
>+	err = fdt_setprop_string(fdt, i2c_usb5744_offset, "status", "disabled");
>+	if (err)
>+		return err;
>+
>+	return 0;
>+}
>+
> /* Called after SoC board_late_init in fsl-layerscape/soc.c */
> int fsl_board_late_init(void)
> {
>@@ -208,6 +252,7 @@ int ft_board_setup(void *blob, struct bd_info *bd)
> 	u64 mc_memory_base = 0;
> 	u64 mc_memory_size = 0;
> 	u16 total_memory_banks;
>+	int err;
> 
> 	debug("%s blob=0x%p\n", __func__, blob);
> 
>@@ -251,6 +296,10 @@ int ft_board_setup(void *blob, struct bd_info *bd)
> 
> 	fdt_fixup_icid(blob);
> 
>+	err = fdt_fixup_usb_hub(blob);
>+	if (err)
>+		printf("%s: error %d fixing up usb-hub fdt\n", __func__, err);

You will not able to know which function returns error inside fdt_fixup_usb_hub,
with just a simple printf here.

Regards,
Peng

>+
> 	return 0;
> }
> 
>
>-- 
>2.52.0
>
>


More information about the U-Boot mailing list