summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2020-05-18 22:27:57 -0700
committerYe Li <ye.li@nxp.com>2020-05-19 07:23:39 -0700
commitb270afa39e1e97e54f58addfa9f1e322aff73d6d (patch)
tree066b3c93fd008d27cea602dc4a13980713b851c4
parentb1d08b73756f5090aa33edda98edd239cfca3f4e (diff)
MLK-24062-4 usb: ehci-mx6: Improve the bind function
To avoid calling devfdt_get_addr_index in bind, which introduces much overhead, checks the req_seq and only call the devfdt_get_addr_index when the req_seq (usb alias) is not set in DTS Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
-rw-r--r--drivers/usb/host/ehci-mx6.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index 2df634f2ff1..035e0b6715e 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -365,13 +365,16 @@ static int ehci_usb_bind(struct udevice *dev)
* the driver is fully converted to DT probing.
*/
u32 controller_spacing;
- if (IS_ENABLED(CONFIG_MX6))
- controller_spacing = 0x200;
- else
- controller_spacing = 0x10000;
- fdt_addr_t addr = devfdt_get_addr_index(dev, 0);
- dev->req_seq = (addr - USB_BASE_ADDR) / controller_spacing;
+ if (dev->req_seq == -1) {
+ if (IS_ENABLED(CONFIG_MX6))
+ controller_spacing = 0x200;
+ else
+ controller_spacing = 0x10000;
+ fdt_addr_t addr = devfdt_get_addr_index(dev, 0);
+
+ dev->req_seq = (addr - USB_BASE_ADDR) / controller_spacing;
+ }
return 0;
}