From 1b85dd241dbd6197552458fcaf2cdfe8581f242c Mon Sep 17 00:00:00 2001 From: William Norman Date: Thu, 2 Jul 2026 07:38:04 +0000 Subject: [PATCH] drivers: usb: dwc3: Extend core mapping to LLUCTL The DWC_usb31 LLUCTL register is accessed when the core forces Gen1 speed for maximum-speed = "super-speed". Map the core register window far enough to cover LLUCTL while still clamping to the parent resource end. Signed-off-by: William Norman --- drivers/usb/dwc3/core.c | 3 ++- drivers/usb/dwc3/core.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 1afcd98f49d4d..aa6a878dc6657 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1999,7 +1999,8 @@ int dwc3_probe(struct dwc3 *dwc, */ dwc_res = *res; dwc_res.start += DWC3_GLOBALS_REGS_START; - dwc_res.end = res->start + DWC3_OTG_REGS_END; + dwc_res.end = min_t(resource_size_t, res->end, + res->start + DWC3_LLUCTL_REGS_END); if (dev->of_node) { struct device_node *parent = of_get_parent(dev->of_node); diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 6b6cb9a969ad5..cda9d911b9570 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -83,6 +83,8 @@ #define DWC3_DEVICE_REGS_END 0xcbff #define DWC3_OTG_REGS_START 0xcc00 #define DWC3_OTG_REGS_END 0xccff +/* DWC_usb31 LLUCTL sits past the OTG register block. */ +#define DWC3_LLUCTL_REGS_END 0xda00 #define DWC3_RTK_RTD_GLOBALS_REGS_START 0x8100