Commit Graph

1514 Commits

Author SHA1 Message Date
Tom Rini
1d12a7c8cd Merge git://git.denx.de/u-boot-spi 2018-01-26 07:46:34 -05:00
Daniel Schwierzeck
6f7c92db4c usb: ehci: mxs: fix swapped argument in ehci_writel()
ehci_writel() swaps the arguments for address and value. One call
in ehci-mxs ignores that.

This fixes the warning:

drivers/usb/host/ehci-mxs.c: In function ?ehci_hcd_stop?:
drivers/usb/host/ehci-mxs.c:159:19: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
  ehci_writel(tmp, &hcor->or_usbcmd);
                   ^
arch/arm/include/asm/io.h:117:34: note: in definition of macro ?writel?
 #define writel(v,c) ({ u32 __v = v; __iowmb(); __arch_putl(__v,c); __v; })
                                  ^
drivers/usb/host/ehci-mxs.c:159:2: note: in expansion of macro ?ehci_writel?
  ^~~~~~~~~~~

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2018-01-25 20:59:20 +01:00
Gustavo A. R. Silva
eacccbda43 usb: xhci: Fix bool initialization in xhci_bulk_tx
Bool initializations should use true and false.

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Marek Vasut <marex@denx.de>
2018-01-25 20:59:16 +01:00
Álvaro Fernández Rojas
48263504c8 wait_bit: use wait_for_bit_le32 and remove wait_for_bit
wait_for_bit callers use the 32 bit LE version

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
2018-01-24 12:03:43 +05:30
Adam Ford
6574864df8 Convert CONFIG_ROCKCHIP_USB2_PHY to Kconfig
This converts the following to Kconfig:
   CONFIG_ROCKCHIP_USB2_PHY

Signed-off-by: Adam Ford <aford173@gmail.com>
2018-01-22 16:43:30 -05:00
Adam Ford
b9b500b0f9 Convert CONFIG_OMAP_USB_PHY to Kconfig
This converts the following to Kconfig:
   CONFIG_OMAP_USB_PHY

Signed-off-by: Adam Ford <aford173@gmail.com>
2018-01-22 16:43:30 -05:00
Adam Ford
3b9e2a2520 Convert CONFIG_TWL4030_USB to Kconfig
This converts the following to Kconfig:
   CONFIG_TWL4030_USB

Signed-off-by: Adam Ford <aford173@gmail.com>
2018-01-22 16:43:30 -05:00
Adam Ford
e13a9dc370 Convert CONFIG_USB_MUSB_HCD et al to Kconfig
This converts the following to Kconfig:
   CONFIG_USB_MUSB_HCD
   CONFIG_USB_MUSB_UDC
   CONFIG_USB_DAVINCI
   CONFIG_USB_OMAP3
   CONFIG_USB_DA8XX
   CONFIG_USB_AM35X

Signed-off-by: Adam Ford <aford173@gmail.com>
2018-01-22 16:43:29 -05:00
Adam Ford
86362221fc Convert CONFIG_USB_MUSB_OMAP2PLUS et al to Kconfig
This converts the following to Kconfig:
   CONFIG_USB_MUSB_OMAP2PLUS
   CONFIG_USB_MUSB_AM35X
   CONFIG_USB_MUSB_DSPS
   CONFIG_USB_MUSB_PIO_ONLY

Signed-off-by: Adam Ford <aford173@gmail.com>
2018-01-22 16:43:29 -05:00
Eddie Cai
bf2b72bef1 usb: rockchip: add the rockusb gadget
this patch implement rockusb protocol on the device side. this is based on
USB download gadget infrastructure. the rockusb function implements the rd,
wl, rid commands. it can work with rkdeveloptool

Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2018-01-10 11:11:05 +01:00
Chen-Yu Tsai
f4f9896ac3 musb: sunxi: Use base address from device tree
Now that the musb sunxi glue driver is completely device model / device
tree driven, we should use the base address from the device tree,
instead of hard-coding it in the source code.

Fixes: 3a61b080ac ("musb: sunxi: switch to the device model")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
2018-01-10 11:11:05 +01:00
Ran Wang
91f4fb9b89 arm64: layerscape: Move CONFIG_HAS_FSL_DR_USB to Kconfig
Rename to USB_EHCI_FSL, use Kconfig to select ehci accordingly.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
2018-01-09 12:37:15 +01:00
Ran Wang
be3872ea81 usb: ehci: fsl: Fix some compile warnings.
When enable CONFIG_HAS_FSL_DR_USB, we might encounter below compile
warning, apply this patch can fix it:

drivers/usb/host/ehci-fsl.c:109:4: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   ((u32)hccr + HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
    ^
drivers/usb/host/ehci-fsl.c:108:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  hcor = (struct ehci_hcor *)
         ^
drivers/usb/host/ehci-fsl.c:115:8: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
        (u32)hccr, (u32)hcor,
        ^
include/log.h:131:26: note: in definition of macro 'debug_cond'
    printf(pr_fmt(fmt), ##args); \
                          ^~~~
drivers/usb/host/ehci-fsl.c:114:2: note: in expansion of macro 'debug'
  debug("ehci-fsl: init hccr %x and hcor %x hc_length %d\n",
  ^~~~~
drivers/usb/host/ehci-fsl.c:115:19: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
        (u32)hccr, (u32)hcor,
                   ^
include/log.h:131:26: note: in definition of macro 'debug_cond'
    printf(pr_fmt(fmt), ##args); \
                          ^~~~
drivers/usb/host/ehci-fsl.c:114:2: note: in expansion of macro 'debug'
  debug("ehci-fsl: init hccr %x and hcor %x hc_length %d\n",
  ^~~~~

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
2018-01-09 12:37:15 +01:00
Tom Rini
1a3fc354b5 Merge git://git.denx.de/u-boot-fsl-qoriq 2017-12-18 18:39:00 -05:00
Wenbin song
a8f33034f2 armv8: ls1043a/ls2080a: check SoC by device ID
Check LS1043A/LS2080a by device ID without using personality ID to
determine revision number. This check applies to all various
personalities of the same SoC family.

Signed-off-by: Wenbin Song <wenbin.song@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
2017-12-13 13:40:29 -08:00
Chris Brandt
243fd6420d usb: r8a66597: convert wait loop to readw_poll_timeout
It is better to use an existing wait loop implementation.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
2017-12-09 13:39:27 +01:00
Chris Brandt
11f4678962 usb: r8a66597: Add support for RZ/A series
While the USB HW in the RZ/A is basically the same, there are some
differences from the original versions that were in the SH SoCs.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
2017-11-28 04:06:40 +01:00
Vincent Prince
8171dac00d Trigger watchdog before calling usb_gadget_handle_interrupts
This prevents board resets when calling sdp command on boards which have a watchdog.

Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Stefan Agner <stefan.agner@toradex.com>
2017-11-26 02:22:36 +01:00
Marek Vasut
a8c402f45c usb: gadget: storage: Increase FSG_BUFLEN
Increase the buffer length to be just above maximum permissible value
of 128 kiB . This increases the performance of the UMS and alike by a
factor of 2 - 2.5 as the buffers are less fragmented.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Lukasz Majewski <lukma@denx.de>
2017-11-26 02:22:36 +01:00
Dirk Behme
b3cbcd902d usb: ehci: do not invalidate a NULL buffer
Its a valid use case to call ehci_submit_async() with a NULL buffer
with length 0. E.g. from usb_set_configuration().

As invalidate_dcache_range() isn't able to judge if the address
NULL is valid or not (depending on the SoC hardware configuration it
might be valid) do the check in ehci_submit_async() as here we know
that we don't have to invalidate such a buffer.

Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
2017-11-26 02:22:36 +01:00
Heinrich Schuchardt
45157d2764 dm: usb: ehci: avoid possible NULL dereference
Currently we check in ehci_shutdown() if ctrl is NULL after
dereferencing it.

Before this we have already dereferenced ctrl, ctrl->hccr,
and ctrl->hcor in ehci_get_portsc_register(), ehci_submit_root(),
and hci_common_init().

A better approach is to already check ctrl, ctrl->hccr, and ctrl->hcor
during the initialization in ehci_register() and usb_lowlevel_init()
and signal an error here via the return code.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2017-11-26 02:22:36 +01:00
Marek Vasut
e1cc60c0d6 usb: xhci: Add Renesas R-Car xHCI driver
Add firmware V3, firmware loader and XHCI glue for the Renesas R-Car
Gen3 SoCs XHCI controller. Thus far only the R-Car Gen3 R8A7795 ES2.0+
and R8A7796 are supported.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
2017-11-26 02:22:36 +01:00
Alexey Brodkin
9829ce2ff2 usb: ehci: Fix accessors for big-endian platforms and descriptors
Commit 9000eddbae ("drivers/usb/ehci: Use platform-specific accessors")
broke USB 2.0 on big-endian platforms because for them writel/readl()
does automatic conversion of BE data to LE.

Proper implementation requires to use "raw" variant of these accessors
which read/write data without messing with endianess.

While at it replace cpu_to_be32() to be32_to_cpu() in readl() to
keep sane semantics.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Marek Vasut <marex@denx.de>
Reported-by: Vladimir Boroda <boroda@yahoo.com>
2017-11-26 02:22:36 +01:00
Jon Nettleton
d3d036af8c mvebu: usb: xhci: a38x support
This makes the initial changes need to support the
a38x series of SOCs.  It adds the device-tree identifier
as well as changing the board_support function to take
the IO address designated by device-tree.

Signed-off-by: Jon Nettleton <jon@solid-run.com>
[baruch: use fdt_addr_t; update 37xx and 8K implementations]
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Stefan Roese <sr@denx.de>
2017-11-16 11:45:20 +01:00
Patrice Chotard
fb48bc448c sti: fix STMicroelectronics copyright
Uniformize all STMicroelectronics copyrights headers for STi
related code.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2017-11-06 09:51:01 -05:00
Ran Wang
420b0eba3c usb: host: Move CONFIG_XHCI_FSL to Kconfig
use Kconfig to select xhci accordingly.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: York Sun <york.sun@nxp.com>
2017-10-27 08:44:06 -07:00
Masahiro Yamada
4bb3dac772 usb: dwc3-uniphier: replace <common.h> with <linux/bitops.h>
Including <common.h> pulls in a lot of bloat.  What this driver needs
is BIT(), so replace it with <linux/bitops.h>

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Marek Vasut <marex@denx.de>
2017-10-15 22:32:24 +09:00
Tom Rini
2ee87b0c1a Merge branch 'rmobile' of git://git.denx.de/u-boot-sh 2017-10-10 20:14:38 -04:00
Tom Rini
4f42a0d721 Merge git://git.denx.de/u-boot-sunxi 2017-10-05 08:26:36 -04:00
Masahiro Yamada
0a70fb4c1c bug.h: move runtime BUG/WARN macros into <linux/bug.h>
Collect runtime BUG/WARN into a self-contained header <linux/bug.h>
to make these macros easier to use.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-10-04 12:00:20 -04:00
Masahiro Yamada
9b643e312d treewide: replace with error() with pr_err()
U-Boot widely uses error() as a bit noisier variant of printf().

This macro causes name conflict with the following line in
include/linux/compiler-gcc.h:

  # define __compiletime_error(message) __attribute__((error(message)))

This prevents us from using __compiletime_error(), and makes it
difficult to fully sync BUILD_BUG macros with Linux.  (Notice
Linux's BUILD_BUG_ON_MSG is implemented by using compiletime_assert().)

Let's convert error() into now treewide-available pr_err().

Done with the help of Coccinelle, excluing tools/ directory.

The semantic patch I used is as follows:

// <smpl>
@@@@
-error
+pr_err
 (...)
// </smpl>

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Re-run Coccinelle]
Signed-off-by: Tom Rini <trini@konsulko.com>
2017-10-04 11:59:44 -04:00
Masahiro Yamada
b44b30260f printk: collect printk stuff into <linux/printk.h> with loglevel support
When we import code from Linux, with regular re-sync planned, we want
to use printk() and pr_*().  U-Boot does not support them in a clean
way.  So, people end up with local macros, or compat headers here and
there, then we occasionally see build errors of definition conflicts.

We have include/linux/compat.h, but putting all sorts of unrelated
things into a single header is just a temporal workaround.  Hence this
patch, to find the best home for all printk variants.  If you want to
use printk() and friends, please include <linux/printk.h>.  This header
is self-contained, and pulls in only a few headers.

When I was testing this clean-up, I noticed the image size exceeded
its platform limit on some boards.  This is because all pr_*() that
were previously defined as no-op in include/linux/mtd/mtd.h (unless
CONFIG_MTD_DEBUG is set), are now enabled.

To make such boards happy, this commit also implements CONFIG_LOGLEVEL.
The concept is similar to the kernel parameter "loglevel".  (Actually,
the Kconfig help message was taken from kernel-paremeter.txt of Linux)
Messages with a loglevel smaller than console loglevel will be printed.

The difference is the loglevel is build-time determined.  To save the
image size, lower priority pr_*() are compiled out.  I set the default
of CONFIG_LOGLEVEL to 6, i.e. pr_notice and higher priority messages
are compiled in.

I adjusted CONFIG_LOGLEVEL to avoid build error for some boards.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[trini: Add in SPL_LOGLEVEL that is the same as LOGLEVEL]
Signed-off-by: Tom Rini <trini@konsulko.com>
2017-10-04 10:31:17 -04:00
Marek Vasut
c322d4b72b usb: Drop the EHCI RCar Gen3
Since we use EHCI generic driver on RCar Gen3 , this driver is useless.
Remove it.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Acked-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2017-10-04 08:50:43 +09:00
Maxime Ripard
3c989f3a19 sunxi: Fix USB_GADGET implication
USB_GADGET will fail to compile if USB_MUSB_GADGET is not defined. Make
sure we have that condition right.

Fixes: e0ea88042d51 ("sunxi: Imply USB_ETHER")
Suggested-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2017-10-03 19:12:06 +02:00
Maxime Ripard
3a61b080ac musb: sunxi: switch to the device model
The device model was implemented so far using a hook that needed to be
called from the board support, without DT support and only for the host.

Switch to probing both in peripheral and host mode through the DT.

Reviewed-by: Łukasz Majewski <lukma@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2017-10-03 19:12:05 +02:00
Maxime Ripard
e02687bda9 sunxi: provide default USB gadget setup
All the Allwinner boards use the same manufacturer, VID and PID for the
gadgets. Make them the defaults to remove some boilerplate from our
defconfigs.

Reviewed-by: Łukasz Majewski <lukma@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2017-10-03 19:12:05 +02:00
Maxime Ripard
10ac57fda3 usb: gadget: usb_ether: Move settings to common
The usb_ether gadget duplicates the USB settings for the manufacturer,
product ID and vendor ID.

Make sure we use the common option so that we can expect a single VID/PID
couple for a single device.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2017-10-03 19:12:05 +02:00
Maxime Ripard
a95aee6af7 usb: gadget: Make g_dnl USB settings common
The g_dnl USB settings for the vendor ID, product ID and manufacturer are
actually common settings that can and should be shared by all the gadgets.

Make them common by renaming them, and convert all the users.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2017-10-03 19:12:05 +02:00
Maxime Ripard
d2f0f4af4b usb: gadget: usb_ether: Move the interfaces to Kconfig
We need to select an interface for the usb_ether gadget, and they haven't
been converted to Kconfig yet. Add a choice to make sure we have an option
selected, and convert all the users.

Reviewed-by: Łukasz Majewski <lukma@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2017-10-03 19:12:05 +02:00
Maxime Ripard
3f33d3c8f4 usb: gadget: Convert USB_ETHER to Kconfig
The USB Ethernet gadget option has not yet been moved to Kconfig, let's
deal with that.

Reviewed-by: Łukasz Majewski <lukma@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2017-10-03 19:12:05 +02:00
Maxime Ripard
c163668a4a usb: gadget: Move USBNET_HOST_ADDR to Kconfig
While the USB Ethernet device address is already defined in Kconfig, the
host address isn't. Convert it.

Reviewed-by: Łukasz Majewski <lukma@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2017-10-03 19:12:04 +02:00
Maxime Ripard
74e7997c70 usb: gadget: Document USBNET_DEVADDR
Add an help about the USBNET_DEVADDR Kconfig option to make it clearer what
it's about.

Acked-by: Łukasz Majewski <lukma@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2017-10-03 19:12:04 +02:00
Maxime Ripard
5506ff149d usb: gadget: Move USBNET_DEVADDR option out of g_dnl
The USBNET_DEVADDR has nothing to do with the USB download gadget, but
rather with the USB Ethernet gadget. Move it out of the if statement.

Acked-by: Łukasz Majewski <lukma@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2017-10-03 19:12:04 +02:00
Masahiro Yamada
dc04b35ef2 usb: dwc3: add UniPhier specific glue layer
Add UniPhier platform specific glue layer to support USB3 Host mode
on Synopsys DWC3 IP.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Marek Vasut <marex@denx.de>
2017-10-01 16:32:55 +02:00
Bin Meng
fae35857e1 usb: xhci: Set 'Average TRB Length' to 8 for control endpoints
Update the codes to conform with xHCI spec chapter 6.2.3.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01 16:32:55 +02:00
Bin Meng
ab2b727dc0 usb: xhci: Set 'Error Count' to 0 for isoch endpoints
Per xHCI spec, 'Error Count' should be set to 0 for isoch endpoints.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01 16:32:54 +02:00
Bin Meng
fa483b2c75 usb: xhci: Program max burst size for endpoint
The 'Max Burst Size' indicates to the xHC the maximum number of
consecutive USB transactions that should be executed per scheduling
opportunity. This is a “zero-based” value, where 0 to 15 represents
burst sizes of 1 to 16, but at present this is always set to zero.
Let's program the required value according to real needs.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01 16:32:54 +02:00
Bin Meng
f51966bf7a usb: xhci: Honor endpoint's interval
USB endpoint reports the period between consecutive requests to send
or receive data as bInverval in its endpoint descriptor. So far this
is ignored by xHCI driver and the 'Interval' field in xHC's endpoint
context is always programmed to zero which means 1ms for low speed
or full speed , or 125us for high speed or super speed. We should
honor the interval by getting it from endpoint descriptor.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01 16:32:54 +02:00
Bin Meng
b5aa857b95 usb: xhci: Fix max packet size for full speed device endpoint 0
In xhci_check_maxpacket(), the control endpoint 0 max packet size
is wrongly taken from the interface's endpoint descriptor. However
the default endpoint 0 does not come with an endpoint descriptor
hence is not included in the interface structure. Change to use
epmaxpacketin[0] instead.

The other bug in this routine is that when setting max packet size
to the xHC endpoint 0 context, it does not clear its previous value
at all before programming a new one.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01 16:32:54 +02:00
Bin Meng
1897d60130 usb: xhci: Add interrupt transfer support
xHCI uses normal TRBs for both bulk and interrupt. This adds the
missing interrupt transfer support to xHCI so that devices like
USB keyboard that uses interrupt transfer can work.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01 16:32:53 +02:00
Bin Meng
8a0e6d8307 usb: xhci: Don't assume LS/FS devices are always behind a HS hub
At present xHCI driver assumes LS/FS devices are attached directly
to a HS hub. If they are connected to a LS/FS hub, the driver will
fail to perform the USB enumeration process on such devices.

This is fixed by looking from the device itself all the way up to
the HS hub where the TT that serves the device is located.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01 16:32:52 +02:00
Bin Meng
ad56e4b684 dm: usb: emul: Drop usb_emul_reset()
With the root hub unbinding in usb_stop(), there is no need to do
a Sandbox-specific reset operation. usb_emul_reset() is no longer
used anywhere, drop it.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01 16:32:51 +02:00
Bin Meng
ad0a9378bf dm: usb: Remove no longer needed blk_unbind_all()
With the root hub unbinding in usb_stop(), there is no need to do
a blk uclass specific unbind operation.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01 16:32:51 +02:00
Bin Meng
d4efefe32e dm: usb: Fix broken usb_stop()
At present we only do device_remove() during usb stop. The DM API
device_remove() only marks the device state as inactivated, but
still keeps its USB topology (eg: parent, children, etc) in the DM
device structure. There is no issue if we only start USB subsystem
once and never stop it. But a big issue occurs when we do 'usb stop'
and 'usb start' multiple times.

Strange things may be observed with current implementation, like:
- the enumeration may report only 1 mass storage device is detected,
  but the total number of USB devices is correct.
- USB keyboard does not work anymore after a bunch of 'usb reset'
  even if 'usb tree' shows it is correctly identified.
- read/write flash drive via 'fatload usb' may complain "Bad device"

In fact, every time when USB host controller starts the enumeration
process, it takes random time for each USB port to show up online,
hence each USB device may appear in a different order from previous
enumeration, and gets assigned to a totally different USB address.
As a result, we end up using a stale USB topology in the DM device
structure which still reflects the previous enumeration result, and
it may create an exact same DM device name like generic_bus_0_dev_7
that is already in the DM device structure. And since the DM device
structure is there, there is no device_bind() call to bind driver to
the device during current enumeration process, eventually creating
an inconsistent software representation of the hardware topology, a
non-working USB subsystem.

The fix is to clear the unused USB topology in the usb_stop(), by
calling device_unbind() on each controller's root hub device, and
the unbinding will unbind all of its children automatically.

For Sandbox, we need scan the device tree each time when we start
the USB stack, in order to re-create the emulated USB devices and
bind drivers for them before we actually do the driver probe.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01 16:32:51 +02:00
Bin Meng
d7771f0c5c usb: emul: hub: Report the actual device speed of the emulation device
At present the usb hub emulator always reports its downstream port
speed as full speed. Actually it is high speed for sandbox-flash,
and low speed for sandbox-keyb. We can determine the device speed
by checking its device descriptor bcdUSB field, and do the proper
hub port status report based on that.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01 16:32:51 +02:00
Bin Meng
848436a48d usb: emul: Expose find_descriptor() as a public API
This can be useful outside of the sandbox usb emulation uclass
driver. Expose it as a public API with a proper prefix (usb_emul_).

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01 16:32:51 +02:00
Bin Meng
84aa8536f0 usb: sandbox: Fix emulator device select logic in usb_emul_find_devnum()
Current emulator select logic in usb_emul_find_devnum() is to test
the USB address. The USB address of the device being enumerated is
initialized to zero at the beginning of the enumeration process in
usb_setup_device(). At this point, the saved USB address in the
platform data has not been assigned to any valid USB address either.
This means: the logic will select an emulator device according to
its sequence of declaring order in the device tree. Take test.dts
for example, flash-stick@0 will be selected before flash-stick@1.
But unfortunately such logic is wrong.

In fact USB devices show up in a random order during the enumeration
which means usb_emul_find_devnum() may be called on port 3 for keyb@3
before on port 0 for flash-stick@0.

To fix this, we introduce a new emulator uclass specific platdata
to store the USB device's port number on its parent hub, and update
the logic to test the port number instead.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01 16:32:50 +02:00
Bin Meng
813f74ea47 usb: sandbox: Initialize root hub's device speed to high speed
At present 'usb tree' shows that the root hub on the Sandbox USB
controller is at full speed. But its device descriptor says it's
USB 2.0, so let's report it as a high speed device.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01 16:32:50 +02:00
Bin Meng
98b639fc50 usb: emul: Remove maxpacketsize in usb_emul_setup_device()
This parameter is never used.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01 16:32:50 +02:00
Seung-Woo Kim
a939af0c74 usb: dwc2: Align size of invalidating dcache before starting DMA
During using dwc2 usb gadget, if usb message size is too small,
following cache misaligned warning is shown:

   CACHE: Misaligned operation at range [bfdbcb00, bfdbcb04]

Align size of invalidating dcache before starting DMA to remove the
warning.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2017-09-27 12:12:23 +02:00
Bin Meng
2e5026a2f0 usb: kbd: Set a default polling mechanism for USB keyboard
The choice of "USB keyboard polling" cannot be optional as without
one mechanism being set, it just doesn't work. Set the default one
to CONFIG_SYS_USB_EVENT_POLL.

Fixes: ecad7051 ("configs: Migrate all of the existing USB symbols, except fastboot")
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-09-27 12:12:23 +02:00
Philipp Tomsich
6e652e3a7d usb: host: ehci-generic: convert to livetree
Update the generic EHCI driver to support a live tree.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-09-27 12:12:23 +02:00
Philipp Tomsich
a9d3037a8e usb: dwc2: convert to livetree
Update the DWC2 USB driver to support a live tree.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-09-27 12:12:22 +02:00
Philipp Tomsich
32c8eee37f rockchip: xhci: Convert to livetree
Update the Rockchip xhci wrapper driver to support a live device tree.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-09-27 12:12:22 +02:00
Bin Meng
a23aa66baa dm: usb: ehci: Implement get_max_xfer_size() operation
EHCD can handle any transfer length as long as there is enough free
heap space left, hence set the theoretical max number SIZE_MAX.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-09-27 12:12:22 +02:00
Bin Meng
022ceacaf8 dm: usb: xhci: Implement get_max_xfer_size() operation
xHCD allocates one segment which includes 64 TRBs for each endpoint
and the last TRB in this segment is configured as a link TRB to form
a TRB ring. Each TRB can transfer up to 64K bytes, however data
buffers referenced by transfer TRBs shall not span 64KB boundaries.
Hence the maximum number of TRBs we can use in one transfer is 62.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-09-27 12:12:22 +02:00
Bin Meng
3e59f59015 dm: usb: Add a new USB controller operation 'get_max_xfer_size'
The HCD may have limitation on the maximum bytes to be transferred
in a USB transfer. USB class driver needs to be aware of this.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-09-27 12:12:21 +02:00
Marek Vasut
7489d22a3c usb: xhci: Set number of event segments and entries to 1
The Linux kernel driver sets the number of event segments and entries
to 1 , while the initial import of the xhci code set that values to 3
for reasons unknown. While most controllers are fine with more event
segments with more entries, there are standard-conformant controllers
(ie. Renesas RCar xHCI) which only support 1 event segment.

Set the number of event segments and event entries back to 1 to allow
such controllers to work with U-Boot xHCI stack. Note that the Renesas
controller correctly indicates ERST Max = 1 in HCSPARAMS2[7:4] .

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
2017-09-27 12:12:21 +02:00
Patrice Chotard
40d1a31e63 usb: dwc3: Add dwc3 glue driver support for STi
This patch adds the ST glue logic to manage the DWC3 HC
on STiH407 SoC family. It configures the internal glue
logic and syscfg registers.

Part of this code been extracted from kernel.org driver
(drivers/usb/dwc3/dwc3-st.c)

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-09-22 07:39:59 -04:00
Chris Packham
f58ad98a62 usb: net: migrate USB Ethernet adapters to Kconfig
This migrates ASIX, ASIX88179, MCS7830, RTL8152 and SMSC95XX to Kconfig.
Update defconfigs.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-09-08 10:23:00 -04:00
Chris Packham
ae3584498b usb: net: migrate CONFIG_USB_HOST_ETHER to Kconfig
CONFIG_USB_HOST_ETHER is the framework that the drivers are dependent on
USB_HOST_ETHER. Use this as a menu and move the existing LAN75XX and
LAN78XX options under new menu. Finally update the defconfigs that need
CONFIG_USB_HOST_ETHER.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-09-08 10:21:46 -04:00
Sam Protsenko
de4e4edaff usb: gadget: g_dnl: Sync internal SN variable with env
Since commit 842778a091 ("usb: gadget: g_dnl: only set iSerialNumber
if we have a serial#") "fastboot devices" stopped to show correct device
serial number for TI boards, showing this line instead:

    ????????????	fastboot

This is because serial# env variable could be set after g_dnl gadget was
initialized (e.g. by using env_set() in the board file).

To fix this, let's update internal serial number variable (g_dnl_serial)
when "serial#" env var is changed.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
Tested-by: Heiko Schocher <hs@denx.de>
Acked-by: Łukasz Majewski <lukma@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
2017-09-05 20:17:08 -04:00
Tom Rini
6aee2ab68c Merge git://git.denx.de/u-boot-imx
Signed-off-by: Tom Rini <trini@konsulko.com>

Conflicts:
	configs/imx6qdl_icore_mmc_defconfig
	configs/imx6qdl_icore_rqs_defconfig
2017-09-01 10:40:59 -04:00
Masahiro Yamada
6ea247d137 usb: dwc3: fix Kconfig dependency to accept host driver in drivers/usb/dwc3
We see the choice of USB_DWC3_HOST / _GADGET in drivers/usb/dwc3/Kconfig,
but we can not choose USB_DWC3_HOST unless USB_GADGET is defined.
This is strange.

Loosen the "depends on" and also move "select USB_GADGET_DUALSPEED" to
the correct place.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-08-28 22:32:34 +02:00
Stefan Agner
a3774c1c3c spl: add serial download protocol (SDP) support
Add USB serial download protocol support to SPL. If the SoC started
in recovery mode the SPL will immediately switch to SDP and wait for
further downloads/commands from the host side.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
Reviewed-by: Łukasz Majewski <lukma@denx.de>
2017-08-23 10:41:58 +02:00
Stefan Agner
ccd7a4d2f4 usb: gadget: sdp: extend images compatible for jumps
Support U-Boot images in SPL so that u-boot.img files can be
directly downloaded and executed. Furthermore support U-Boot
scripts download and execution in full U-Boot so that custom
recovery actions can be downloaded from the host in a third
step.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Reviewed-by: Łukasz Majewski <lukma@denx.de>
Reviewed-by: Stefano Babic <sbabic@denx.de>
2017-08-23 10:41:58 +02:00
Stefan Agner
5661f08a71 usb: gadget: add SDP driver
Add SDP (Serial Downloader Protocol) implementation for U-Boot. The
protocol is used in NXP SoC's boot ROM and allows to download program
images. Beside that, it can also be used to read/write registers and
download complete Device Configuration Data (DCD) sets. This basic
implementation supports downloading images with the imx header format
reading and writing registers.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Reviewed-by: Łukasz Majewski <lukma@denx.de>
2017-08-23 10:41:58 +02:00
Tom Rini
90ae53ce1a fastboot: Ensure we treat CONFIG_FASTBOOT_BUF_ADDR as long
Otherwise:
drivers/usb/gadget/f_fastboot.c:564:32: warning: format "%lx" expects
argument of type "long unsigned int", but argument 3 has type "unsigned
int" [-Wformat=]

Signed-off-by: Tom Rini <trini@konsulko.com>
2017-08-22 08:20:02 -04:00
John Keeping
7715dea48b fastboot: avoid printing invalid data
There is no guarantee that commands are null-terminated in the USB
request buffer, so limit the length of data that is printed.

Signed-off-by: John Keeping <john@metanate.com>
Tested-by: Steve Rae <steve.rae@raedomain.com>
2017-08-21 11:31:10 +02:00
Peter Chubb
d331084298 Fix fastboot boot address
Fastboot loads an image at CONFIG_FASTBOOT_BUF_ADDR, but currently
tells do_bootm() to look for an image at $loadaddr.  This breaks if
CONFIG_FASTBOOT_BUF_ADDR is different from the current user-set
loadaddr.

Instead, tell do_bootm() to pick up the image where it was laoded.

Signed-off-by: Peter Chubb <peter.chubb@data61.csiro.au>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Steve Rae <steve.rae@raedomain.com>
2017-08-21 11:31:10 +02:00
Bin Meng
a11a5b8ad9 usb: ehci: Convert CONFIG_USB_EHCI_PCI to Kconfig
This converts CONFIG_USB_EHCI_PCI to a Kconfig option, and updates
all boards that use it.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-08-21 11:30:44 +02:00
Simon Glass
00caae6d47 env: Rename getenv/_f() to env_get()
We are now using an env_ prefix for environment functions. Rename these
two functions for consistency. Also add function comments in common.h.

Quite a few places use getenv() in a condition context, provoking a
warning from checkpatch. These are fixed up in this patch also.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16 08:30:24 -04:00
Simon Glass
fd1e959e91 env: Rename eth_setenv_enetaddr() to eth_env_set_enetaddr()
Rename this function for consistency with env_set().

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16 08:23:56 -04:00
Yuiko Oshino
d2c3197922 usb: net: Add support for Microchip LAN75xx and LAN78xx
Add support for Microchip LAN7500, LAN7800 and LAN7850,
USB to 10/100/1000 Ethernet Controllers.

Signed-off-by: Yuiko Oshino <yuiko.oshino@microchip.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2017-08-14 12:47:33 -05:00
Philipp Tomsich
734f9abd17 net: usb: r8152: fix "duplicate 'const' declaration specifier"
After upgrading to GCC 7.1, the duplicate const specifies in the
r8152 driver trigger the following build warnings with buildman
(observed on a 'buildman rockchip' test)::
  ../drivers/usb/eth/r8152.c:62:35: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
   static const struct r8152_version const r8152_versions[] = {
                                     ^~~~~

This commit fixes these by removing the duplicate 'const' specifier
from the declarations.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2017-08-07 15:18:29 -05:00
Tom Rini
ec7483e34e Merge git://git.denx.de/u-boot-fsl-qoriq
Signed-off-by: Tom Rini <trini@konsulko.com>

Conflicts:
	include/configs/ls1046aqds.h
	include/configs/ls1046ardb.h
2017-08-02 10:52:26 -04:00
Santan Kumar
e478307918 fsl/usb: enable errata-a010151 for ls2088a and ls2081a
Signed-off-by: Santan Kumar <santan.kumar@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
2017-08-01 08:28:56 -07:00
Tom Rini
211aaf309c Merge git://git.denx.de/u-boot-usb 2017-07-29 11:43:51 -04:00
Patrice Chotard
d38a8ea19c usb: host: xhci-dxc3: fix compilation warnings
Fix following warnings encountered with platforms
dra7xx_evm and dra7xx_hs_evm :

       arm:  +   dra7xx_evm
+  hccr = (struct xhci_hccr *)devfdt_get_addr(dev);
+         ^
+  hcor = (struct xhci_hcor *)((phys_addr_t)hccr +
+                              ^
w+drivers/usb/host/xhci-dwc3.c: In function 'xhci_dwc3_probe':
w+drivers/usb/host/xhci-dwc3.c:124:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
w+drivers/usb/host/xhci-dwc3.c:125:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
w+drivers/usb/host/xhci-dwc3.c:125:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
       arm:  +   dra7xx_hs_evm
+  hccr = (struct xhci_hccr *)devfdt_get_addr(dev);
+         ^
+  hcor = (struct xhci_hcor *)((phys_addr_t)hccr +
+                              ^
w+drivers/usb/host/xhci-dwc3.c: In function 'xhci_dwc3_probe':
w+drivers/usb/host/xhci-dwc3.c:124:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
w+drivers/usb/host/xhci-dwc3.c:125:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
w+drivers/usb/host/xhci-dwc3.c:125:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

Introduced by 7e65e84 usb: host: xhci-dwc3: Convert driver to DM

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2017-07-28 23:34:45 +02:00
Patrice Chotard
2080d023d9 usb: host: ohci-generic: initialize PHY only when found
Call generic_phy_init() only when a PHY was found.
This will avoid a crash if no "phys" property is found in DT.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reported-by: Patrick Delaunay <patrick.delaunay@st.com>
2017-07-28 23:34:43 +02:00
Patrice Chotard
4b3928a08f usb: host: ehci-generic: initialize PHY only when found
Call generic_phy_init() only when a PHY was found.
This will avoid a crash if no "phys" property is found in DT.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reported-by: Patrick Delaunay <patrick.delaunay@st.com>
2017-07-28 23:34:43 +02:00
Patrice Chotard
623b7aca1f dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB
Add CONFIG_DM_USB flag to avoid following compilation errors
detected by buildman :
+drivers/usb/host/built-in.o: In function `xhci_dwc3_remove':
+drivers/usb/host/xhci-dwc3.c:168: undefined reference to `xhci_deregister'
+drivers/usb/host/built-in.o: In function `xhci_dwc3_probe':
+drivers/usb/host/xhci-dwc3.c:145: undefined reference to `usb_get_dr_mode'
+drivers/usb/host/xhci-dwc3.c:152: undefined reference to `xhci_register'

introduced by patch d5c3f014da3 "usb: host: xhci-dwc3: Convert driver to DM"

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reported-by: Ran Wang <ran.wang_1@nxp.com>
2017-07-28 23:34:42 +02:00
Siva Durga Prasad Paladugu
bab0146ea9 usb: gadget: f_thor: Free the allocated out request buffer
Fix the memory leak by freeing the allocated out request buffer

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2017-07-28 23:34:38 +02:00
Bin Meng
78e3098752 usb: xhci: Enable TT to support LS/FS devices behind a HS hub
So far LS/FS devices directly attached to xHC root port can be
successfully enumerated by xHCI driver, but if they are connected
behind a hub, the enumeration process fails to address the device.

It turns out xHCI driver still misses a part that in the device's
input slot context, all Transaction Translator (TT) related fields
are not programmed. The xHCI spec defines how to enable TT.

Now LS/FS devices like USB keyboard/mouse can be enumerated behind
a high speed hub.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28 23:34:37 +02:00
Bin Meng
196ef8323c usb: xhci: Correct TT_SLOT and TT_PORT macros
These two macros really need a parameter to make them useful.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28 23:34:36 +02:00
Bin Meng
d228ca362b usb: xhci: Implement update_hub_device() operation
There is no way to know whether the attached device is a hub or
not in advance before the device's descriptor is fetched. But
once we know it's a high speed hub, per the xHCI spec, we need
to tell xHC it's a hub device by initializing hub-related fields
in the input slot context.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28 23:34:36 +02:00
Bin Meng
9ca1b4bab1 dm: usb: Add a new USB controller operation 'update_hub_device'
For USB host controllers like xHC, its internal representation of
hub needs to be updated after the hub descriptor is fetched. This
adds a new op that does this.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28 23:34:35 +02:00
Bin Meng
493b8dd070 usb: xhci: Program 'route string' in the input slot context
xHCI spec says: the values of the 'route string' field shall be
initialized by the first 'Address Device' command issued to a
device slot, and shall not be modified by any other command.

So far U-Boot does not program this field, and it does not prevent
SS device directly attached to root port, or HS device behind an HS
hub, from working, due to the fact that 'route string' is used by
the xHC to target SS packets. But in order to enumerate devices
behind an SS hub, this field must be programmed.

With this commit and along with previous commits, now SS & HS devices
attached to a USB 3.0 hub can be enumerated by U-Boot.

As usual, this new feature is only available when DM is on.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28 23:34:33 +02:00
Bin Meng
daec469144 usb: xhci: Change xhci_setup_addressable_virt_dev() signature
For future extension, change xhci_setup_addressable_virt_dev()
signature to accept a pointer to 'struct usb_device', instead
of its members slot_id & speed, as the struct already contains
these two plus some other useful information of the device.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-28 23:34:33 +02:00
Bin Meng
46c1d49330 usb: hub: Add a new API to test if a hub device is root hub
Sometimes we need know if a given hub device is root hub or not.
Add a new API to test this. This removes the xHCI driver's own
version is_root_hub() and change to use the new API.

While we are here, remove the unused/commented out get_usb_device()
in the xHCI driver too.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-28 23:34:30 +02:00