summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2020-12-23 18:10:15 -0500
committerTom Rini <[email protected]>2020-12-23 18:10:15 -0500
commit958b9e2482538ebfeb2e1161257603d4dec498cb (patch)
tree6b9283b58c8684a239d25492c2e8a8b1319be8ca /drivers/usb
parent8351a29d2df18c92d8e365cfa848218c3859f3d2 (diff)
parentec1add1e51affd4aacc308dc37439ea13dc1b70e (diff)
Merge tag 'dm-next-23dec20' of git://git.denx.de/u-boot-dm into next
dm: New sequence number implementation SPI handling of bus with different-speed devices patman supression of sign-offs
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/max3420_udc.c2
-rw-r--r--drivers/usb/host/ehci-mx5.c2
-rw-r--r--drivers/usb/host/ehci-mx6.c14
-rw-r--r--drivers/usb/host/ehci-omap.c2
-rw-r--r--drivers/usb/host/ehci-vf.c8
-rw-r--r--drivers/usb/host/usb-sandbox.c2
-rw-r--r--drivers/usb/host/usb-uclass.c6
7 files changed, 20 insertions, 16 deletions
diff --git a/drivers/usb/gadget/max3420_udc.c b/drivers/usb/gadget/max3420_udc.c
index 53e74d4f61a..a16095f8927 100644
--- a/drivers/usb/gadget/max3420_udc.c
+++ b/drivers/usb/gadget/max3420_udc.c
@@ -821,7 +821,7 @@ static int max3420_udc_probe(struct udevice *dev)
struct max3420_udc *udc = dev_get_priv(dev);
struct dm_spi_slave_plat *slave_pdata;
struct udevice *bus = dev->parent;
- int busnum = bus->seq;
+ int busnum = dev_seq(bus);
unsigned int cs;
uint speed, mode;
struct udevice *spid;
diff --git a/drivers/usb/host/ehci-mx5.c b/drivers/usb/host/ehci-mx5.c
index 04862638efe..0af02ba2737 100644
--- a/drivers/usb/host/ehci-mx5.c
+++ b/drivers/usb/host/ehci-mx5.c
@@ -321,7 +321,7 @@ static int ehci_usb_probe(struct udevice *dev)
mdelay(1);
priv->ehci = ehci;
- priv->portnr = dev->seq;
+ priv->portnr = dev_seq(dev);
priv->init_type = type;
ret = device_get_supply_regulator(dev, "vbus-supply",
diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index 65ebd7c8091..d2f49cf4690 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -569,10 +569,16 @@ static int ehci_usb_bind(struct udevice *dev)
* With these changes in place, the ad-hoc indexing goes away and
* the driver is fully converted to DT probing.
*/
- u32 controller_spacing = is_mx7() ? 0x10000 : 0x200;
- fdt_addr_t addr = devfdt_get_addr_index(dev, 0);
- dev->req_seq = (addr - USB_BASE_ADDR) / controller_spacing;
+ /*
+ * FIXME: This cannot work with the new sequence numbers.
+ * Please complete the DM conversion.
+ *
+ * u32 controller_spacing = is_mx7() ? 0x10000 : 0x200;
+ * fdt_addr_t addr = devfdt_get_addr_index(dev, 0);
+ *
+ * dev->req_seq = (addr - USB_BASE_ADDR) / controller_spacing;
+ */
return 0;
}
@@ -596,7 +602,7 @@ static int ehci_usb_probe(struct udevice *dev)
}
priv->ehci = ehci;
- priv->portnr = dev->seq;
+ priv->portnr = dev_seq(dev);
priv->init_type = type;
#if CONFIG_IS_ENABLED(DM_REGULATOR)
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index cb50bf3c4f9..12c422d811d 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -383,7 +383,7 @@ static int omap_ehci_probe(struct udevice *dev)
struct ehci_hcor *hcor;
priv->ehci = dev_read_addr_ptr(dev);
- priv->portnr = dev->seq;
+ priv->portnr = dev_seq(dev);
priv->init_type = plat->init_type;
hccr = (struct ehci_hccr *)&priv->ehci->hccapbase;
diff --git a/drivers/usb/host/ehci-vf.c b/drivers/usb/host/ehci-vf.c
index e0e4f84a9e9..25f76c9fa91 100644
--- a/drivers/usb/host/ehci-vf.c
+++ b/drivers/usb/host/ehci-vf.c
@@ -222,7 +222,7 @@ static int vf_usb_of_to_plat(struct udevice *dev)
int node = dev_of_offset(dev);
const char *mode;
- priv->portnr = dev->seq;
+ priv->portnr = dev_seq(dev);
priv->ehci = dev_read_addr_ptr(dev);
mode = fdt_getprop(dt_blob, node, "dr_mode", NULL);
@@ -296,16 +296,14 @@ static const struct ehci_ops vf_ehci_ops = {
static int vf_usb_bind(struct udevice *dev)
{
- static int num_controllers;
-
/*
* Without this hack, if we return ENODEV for USB Controller 0, on
* probe for the next controller, USB Controller 1 will be given a
* sequence number of 0. This conflicts with our requirement of
* sequence numbers while initialising the peripherals.
+ *
+ * FIXME: Check that this still works OK with the new sequence numbers
*/
- dev->req_seq = num_controllers;
- num_controllers++;
return 0;
}
diff --git a/drivers/usb/host/usb-sandbox.c b/drivers/usb/host/usb-sandbox.c
index e5442e71ae9..d7cc92aa544 100644
--- a/drivers/usb/host/usb-sandbox.c
+++ b/drivers/usb/host/usb-sandbox.c
@@ -23,7 +23,7 @@ static void usbmon_trace(struct udevice *bus, ulong pipe,
type = (pipe & USB_PIPE_TYPE_MASK) >> USB_PIPE_TYPE_SHIFT;
debug("0 0 S %c%c:%d:%03ld:%ld", types[type],
pipe & USB_DIR_IN ? 'i' : 'o',
- bus->seq,
+ dev_seq(bus),
(pipe & USB_PIPE_DEV_MASK) >> USB_PIPE_DEV_SHIFT,
(pipe & USB_PIPE_EP_MASK) >> USB_PIPE_EP_SHIFT);
if (setup) {
diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c
index decee61d96b..a2bd7436f42 100644
--- a/drivers/usb/host/usb-uclass.c
+++ b/drivers/usb/host/usb-uclass.c
@@ -394,7 +394,7 @@ int usb_setup_ehci_gadget(struct ehci_ctrl **ctlrp)
int ret;
/* Find the old device and remove it */
- ret = uclass_find_device_by_seq(UCLASS_USB, 0, true, &dev);
+ ret = uclass_find_device_by_seq(UCLASS_USB, 0, &dev);
if (ret)
return ret;
ret = device_remove(dev, DM_REMOVE_NORMAL);
@@ -417,7 +417,7 @@ int usb_remove_ehci_gadget(struct ehci_ctrl **ctlrp)
int ret;
/* Find the old device and remove it */
- ret = uclass_find_device_by_seq(UCLASS_USB, 0, true, &dev);
+ ret = uclass_find_device_by_seq(UCLASS_USB, 0, &dev);
if (ret)
return ret;
ret = device_remove(dev, DM_REMOVE_NORMAL);
@@ -701,7 +701,7 @@ int usb_scan_device(struct udevice *parent, int port,
return ret;
ret = usb_find_and_bind_driver(parent, &udev->descriptor,
iface,
- udev->controller_dev->seq,
+ dev_seq(udev->controller_dev),
udev->devnum, port, &dev);
if (ret)
return ret;