]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
usb: musb-new: Relative ctrl_mod address parsing
authorMarkus Schneider-Pargmann (TI.com) <msp@baylibre.com>
Mon, 9 Feb 2026 09:24:37 +0000 (10:24 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 6 Mar 2026 14:15:43 +0000 (08:15 -0600)
For the upstream DT the ctrl_mod node is using a relative register
address which is not translated by the current code.

Make address parsing understand relative addresses.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp@baylibre.com>
Reviewed-by: Marek Vasut <marek.vasut@mailbox.org>
drivers/usb/musb-new/ti-musb.c

index bcd31adba522fc55190fc43fd2dbd2dec93a2731..75dc2dc18748e33785c7312a24145544b659579d 100644 (file)
@@ -83,17 +83,17 @@ static int ti_musb_of_to_plat(struct udevice *dev)
        struct ti_musb_plat *plat = dev_get_plat(dev);
        const void *fdt = gd->fdt_blob;
        int node = dev_of_offset(dev);
-       int phys;
-       int ctrl_mod;
+       ofnode phys_node;
+       ofnode ctrl_mod_node;
        int usb_index;
        int ret;
        struct musb_hdrc_config *musb_config;
 
        plat->base = devfdt_get_addr_index_ptr(dev, 1);
 
-       phys = fdtdec_lookup_phandle(fdt, node, "phys");
-       ctrl_mod = fdtdec_lookup_phandle(fdt, phys, "ti,ctrl_mod");
-       plat->ctrl_mod_base = (void *)fdtdec_get_addr(fdt, ctrl_mod, "reg");
+       phys_node = ofnode_get_by_phandle(dev_read_u32_default(dev, "phys", 0));
+       ctrl_mod_node = ofnode_get_by_phandle(ofnode_read_u32_default(phys_node, "ti,ctrl_mod", 0));
+       plat->ctrl_mod_base = (void *)ofnode_get_addr(ctrl_mod_node);
        usb_index = ti_musb_get_usb_index(node);
        switch (usb_index) {
        case 1: