- Apr 18, 2015
-
-
Simon Glass authored
Add some documentation describing how USB is implemented with USB. This might make things easier for people to understand. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This adds a simple test for probing and a functional test using the flash stick emulator, which tests a large chunk of the USB stack. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
As well as running all tests, it is useful to be able to run a selected test. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
Neither the hyphen nor the equals sign is needed. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
Enable USB emulation and associated features so that USB can be used in sandbox. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
Add a few more shifts/masks to make it easier to decode a pipe value (rather than just building it). We need this for USB device emulation. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
This is useful for creating lists of descriptors, and is better than using void * for this purpose. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
Since we can support both controllers now, enable this in the device tree. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
Switch snow over to use both EHCI and XHCI at the same time. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
Convert Exynos boards over to use driver model for USB. This does not remove any unnecessary code so far. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
Support driver model in the exynos XHCI driver. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
This should be "U-Boot", not "u-boot". Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
Add driver model support in the XHCI support code so that it can be used by XHCI USB drivers. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
Since driver model will want to use most of the same code for XHCI init and uninit, put it in a separate function. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
This function should not be delving into struct usb_device. Pass in the parameters it needs directly. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
This function should not be delving into struct usb_device. Pass in the parameters it needs directly. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
Rather than getting this directly from struct usb_device, call a function to obtain it. This will make it possible for driver model to provide it another way. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
Update this driver with driver model support for USB. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
We want to use mostly the same init and uninit code for driver model, so move the common part into two functions. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
Try to return useful error numbers where possible. Also avoid swallowing an error number when it is returned by a called function. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
This variable is a bit of a hack. We can obtain the same information from the normal device config. This will fit better with driver model, where global variables are best avoided. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
Update this driver with driver model support for USB. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
Add support for scanning USB etghernet devices with driver model. This mostly involves scanning all buses since device numbering is not unique across buses. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
These allow basic testing of the USB functionality within sandbox. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
This driver supports using emulation devices to provide a USB bus within sandbox. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
All USB controllers need a root hub. Add a sandbox emulation for this so that we can add USB devices to sandbox. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
This emulator supports USB enumeration and allows a local file to be provided as the contents of the emulated flash stick. U-Boot can then use the file as it would a normal device, with all access passing through the usb_stor layer and the USB stack. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
These devices must have their addresses removed ready for the next USB bus enumeration. Add this logic to usb_stop(). Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
With sandbox we want to be able to emulate USB devices so that we can test the USB stack. Add a uclass to support this. It implements the same operations as a normal USB device driver, but in this case passes them on to an emulation driver. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
This is needed for sandbox USB device emulation, so move it to a place where it can be found by things other than gadgets. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
These are needed to enable the USB bus (although not sufficient since it still does not work). Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
Allow USB keyboards to work with driver model. The main difference is that we can have multiple buses (each with its own device numbering) and each bus must be scanned. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
Before adding driver model support, split out code from this over-long function. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
Some controllers support OTG (on-the-go) where they can operate as either host or device. The gadget layer in U-Boot supports this. While this layer does not interact with driver model, we can provide a function which sets up the controller in the correct way. This way the code at least builds (although it likely will not work). Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
At present USB devices with no driver model driver cannot be seen in the device list, and we fail to set them up correctly. This means they cannot be used. While having real drivers that support driver model for all USB devices is the eventual goal, we are not there yet. As a stop-gap, add a generic USB driver which is bound when we do not have a real driver. This allows the device to be set up and shown on the bus. It also allows ad-hoc code (such as usb_ether) to find these devices and set them up. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
USB devices in U-Boot are currently probed only after all devices have been enumerated. Each type of device is probed by custom code, e.g.: - USB storage - Keyboard - Ethernet With driver model this approach doesn't work very well. We could build a picture of the bus and then go back and add the devices later, but this means that the data structures are incomplete for quite a while. It also does not follow the model of being able to bind a device when we discover it. We would prefer to have devices automatically be bound as the device is enumerated. This allows us to attach drivers to particular USB classes or product/vendor IDs. This is the method used by Linux. Add the required #defines from Linux, a way of declaring a USB driver and the logic to locate the correct driver given the USB device's descriptors. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
Add a way for EHCI controller drivers to support driver model. Drivers can call ehci_register() to register themselves in their probe() methods. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
The index cannot be used with driver model, and isn't needed anyway. Change the parameter to a pointer. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Simon Glass authored
These are a pain with driver model because we might have different EHCI drivers which want to implement them differently. Now that they use consistent function signatures, we can in good conscience move them to a struct. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de> Fix non-driver-model EHCI to set up the EHCI operations correctly: Signed-off-by:
Tom Rini <trini@konsulko.com>
-
Simon Glass authored
Move the bulk of the code in usb_lowlevel_init() into a separate function which will also be used by driver model. Keep the CONFIG options out of this function by providing a tweak flag for Faraday. We need to avoid using CONFIG options in driver model code where possible, since it makes it impossible to use multiple controllers in that code where they have different options. The CONFIG_EHCI_HCD_INIT_AFTER_RESET option is also kept out of the common init function. With driver model the controller will be able to perform this extra init itself after registering with the EHCI layer. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-