[PATCH v5 1/2] usb: musb-new: Relative ctrl_mod address parsing
Marek Vasut
marek.vasut at mailbox.org
Sun Feb 1 19:18:04 CET 2026
On 1/30/26 5:28 PM, Markus Schneider-Pargmann (TI.com) wrote:
> 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 at kernel.org>
> Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp at baylibre.com>
> ---
> drivers/usb/musb-new/ti-musb.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/usb/musb-new/ti-musb.c b/drivers/usb/musb-new/ti-musb.c
> index bcd31adba522fc55190fc43fd2dbd2dec93a2731..75dc2dc18748e33785c7312a24145544b659579d 100644
> --- a/drivers/usb/musb-new/ti-musb.c
> +++ b/drivers/usb/musb-new/ti-musb.c
> @@ -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);
Is the cast to void * necessary , and if yes, can it be removed ?
More information about the U-Boot
mailing list