| 054731b0 | 29-May-2014 |
Stephen Warren <swarren@nvidia.com> |
usb: ci_udc: use a single descriptor for ep0
ci_udc currently points ep->desc at separate descriptors for IN and OUT. These descriptors only differ in the ep address IN/OUT field. Modify the code to
usb: ci_udc: use a single descriptor for ep0
ci_udc currently points ep->desc at separate descriptors for IN and OUT. These descriptors only differ in the ep address IN/OUT field. Modify the code to use a single descriptor, and change that descriptor's ep address to indicate IN/OUT as required. This removes some data duplication.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
show more ...
|
| 584b55b0 | 12-May-2014 |
Przemyslaw Marczak <p.marczak@samsung.com> |
usb:gadget:f_thor: download_tail(): remove dfu_write with 0 size
Since dfu_flush() can write raw data, dfu_write() with zero size can be removed from download_tail() in thor gadget.
Signed-off-by:
usb:gadget:f_thor: download_tail(): remove dfu_write with 0 size
Since dfu_flush() can write raw data, dfu_write() with zero size can be removed from download_tail() in thor gadget.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Heiko Schocher <hs@denx.de> Cc: Marek Vasut <marex@denx.de>
show more ...
|
| fc25fa27 | 11-Apr-2014 |
Heiko Schocher <hs@denx.de> |
dfu, nand: add medium specific polltimeout function
add a possibility to add a medium specific polltimeout function. So it is possible to define different poll timeouts.
Used on nand medium, for se
dfu, nand: add medium specific polltimeout function
add a possibility to add a medium specific polltimeout function. So it is possible to define different poll timeouts.
Used on nand medium, for setting the DFU_MANIFEST_POLL_TIMEOUT only on nand ubi partitions, which is currently the only usecase.
Change-Id: If1db5f49b32d93fefa7481e8dfe5b7ccc0e65af4 Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Marek Vasut <marex@denx.de> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Reviewed-by: Marek Vasut <marex@denx.de> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
show more ...
|
| 3aab70af | 05-May-2014 |
Sebastian Siewior <bigeasy@linutronix.de> |
usb/gadget: add the fastboot gadget
This patch contains an implementation of the fastboot protocol on the device side and documentation. This is based on USB download gadget infrastructure. The fast
usb/gadget: add the fastboot gadget
This patch contains an implementation of the fastboot protocol on the device side and documentation. This is based on USB download gadget infrastructure. The fastboot function implements the getvar, reboot, download and reboot commands. What is missing is the flash handling i.e. writting the image to media.
v3 (Rob Herring): This is based on http://patchwork.ozlabs.org/patch/126798/ with the following changes: - Rebase to current mainline and updates for current gadget API - Use SPDX identifiers for licenses - Traced the history and added missing copyright to cmd_fastboot.c - Use load_addr/load_size for transfer buffer - Allow vendor strings to be optional - Set vendor/product ID from config defines - Allow Ctrl-C to exit fastboot mode v4: - Major re-write to use the USB download gadget. Consolidated function code to a single file. - Moved globals into single struct. - Use puts and putc as appropriate. - Added CONFIG_USB_FASTBOOT_BUF_ADDR and CONFIG_USB_FASTBOOT_BUF_SIZE to set the fastboot transfer buffer. v5: - Add CONFIG option documentation to README - Rebase using new downloader registration
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Rob Herring <robh@kernel.org>
show more ...
|
| 340ed422 | 05-May-2014 |
Stephen Warren <swarren@nvidia.com> |
usb: ums: remove ci_udc special case
Now that the ci_udc driver supports allocating multiple requests per endpoint, we can revert the special-case added by a022c1e13c01 "usb: ums: use only 1 buffer
usb: ums: remove ci_udc special case
Now that the ci_udc driver supports allocating multiple requests per endpoint, we can revert the special-case added by a022c1e13c01 "usb: ums: use only 1 buffer for CI_UDC".
Signed-off-by: Stephen Warren <swarren@nvidia.com>
show more ...
|
| 2813006f | 05-May-2014 |
Stephen Warren <swarren@nvidia.com> |
usb: ci_udc: allow multiple buffer allocs per ep
Modify ci_ep_alloc_request() to return a dynamically allocated request object, rather than a singleton that's part of the endpoint. This requires mov
usb: ci_udc: allow multiple buffer allocs per ep
Modify ci_ep_alloc_request() to return a dynamically allocated request object, rather than a singleton that's part of the endpoint. This requires moving various state from the endpoint structure to the request structure, since we need one copy per request.
The "fast bounce buffer" b_fast is removed by this change rather than moved to the request object. Instead, we enhance the bounce buffer logic in ci_bounce()/ci_debounce() to keep the bounce buffer around between request submissions. This avoids the need to allocate an arbitrarily- sized bounce buffer up-front, yet avoids incurring the allocation overhead each time a request is submitted.
A future enhancement would be to actually submit multiple requests to HW at once. The Linux driver shows that this is possible. That might improve throughput (depending on the USB protocol in use), since USB could be performing a transfer to one HW buffer in parallel with whatever SW actions U-Boot performs on another buffer. However, I have not made this change as part of this patch, in order to keep SW changes related to buffer management separate from any change in the way the HW is programmed.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
show more ...
|
| 25fbf96b | 01-May-2014 |
Stephen Warren <swarren@nvidia.com> |
USB: gadget: save driver name before registering it
g_dnl_register() currently first attempts to register a composite driver by name, and then saves the driver name once it's registered. Internally
USB: gadget: save driver name before registering it
g_dnl_register() currently first attempts to register a composite driver by name, and then saves the driver name once it's registered. Internally to the registration code, g_dnl_do_config() is called and attempts to compare the composite device's name with the list of known device names. This fails since the composite device's name has not yet been stored. This means that the first time "ums 0 0" is run, it fails, but subsequent attempts succeed.
Re-order the name-saving and registration code to solve this.
Fixes: e5b834e07f51 ("USB: gadget: added a saner gadget downloader registration API") Signed-off-by: Stephen Warren <swarren@nvidia.com>
show more ...
|
| 75504e95 | 30-Apr-2014 |
Mateusz Zalega <m.zalega@samsung.com> |
usb: dfu: fix boards wo USB cable detection
Former usb_cable_connected() patch broke compilation of boards which do not support this feature.
I've renamed usb_cable_connected() to g_dnl_usb_cable_c
usb: dfu: fix boards wo USB cable detection
Former usb_cable_connected() patch broke compilation of boards which do not support this feature.
I've renamed usb_cable_connected() to g_dnl_usb_cable_connected() and added its default implementation to gadget downloader driver code. There's only one driver of this kind and it's unlikely there'll be another, so there's no point in keeping it in /common.
Previously this function was declared in usb.h. I've moved it, since it's more appropriate to keep it in g_dnl.h - usb.h seems to be intended for USB host implementation.
Existing code, confronted with default -EOPNOTSUPP return value, continues as if the cable was connected.
CONFIG_USB_CABLE_CHECK was removed.
Change-Id: Ib9198621adee2811b391c64512f14646cefd0369 Signed-off-by: Mateusz Zalega <m.zalega@samsung.com> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
show more ...
|
| 2fc5dab2 | 28-Apr-2014 |
Stephen Warren <swarren@nvidia.com> |
usb: gadget: allow ci_udc to build with new gadget framework
Allow ci_udc.o to be built when using the new(?) USB gadget framework, as enabled by CONFIG_USB_GADGET.
Note that this duplicates the Ma
usb: gadget: allow ci_udc to build with new gadget framework
Allow ci_udc.o to be built when using the new(?) USB gadget framework, as enabled by CONFIG_USB_GADGET.
Note that this duplicates the Makefile entry for ci_udc.o, since it's also included inside #ifdef CONFIG_USB_ETHER. I'm not sure what that define means; perhaps an old style of Ethernet-specific USB gadget implementation?
I wonder if the line that this patch adds shouldn't be outside all of the ifdefs, so it stands on its own, similar to how e.g. epautoconf.o is shared between the two?
Signed-off-by: Stephen Warren <swarren@nvidia.com>
show more ...
|
| a022c1e1 | 24-Apr-2014 |
Stephen Warren <swarren@nvidia.com> |
usb: ums: use only 1 buffer for CI_UDC
ci_udc.c allocates only a single buffer for each endpoint, which ci_ep_alloc_request() returns as a hard-coded value rather than dynamically allocating. Conseq
usb: ums: use only 1 buffer for CI_UDC
ci_udc.c allocates only a single buffer for each endpoint, which ci_ep_alloc_request() returns as a hard-coded value rather than dynamically allocating. Consequently, storage_common.c must limit itself to using a single buffer at a time. Add a special case to the definition of FSG_NUM_BUFFERS for this.
Another option would be to fix ci_ep_alloc_request() to dynamically allocate the buffers like some/all(?) other device mode drivers do. However, I don't think that ci_ep_queue() supports queueing up multiple buffers either yet, and I'm not familiar enough with the controller yet to implement that. As such, any attempt to use multiple buffers simply results in data corruption and other errors.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
show more ...
|
| fcf2ede1 | 24-Apr-2014 |
Stephen Warren <swarren@nvidia.com> |
usb: ci_udc: support variants with hostpc register
Tegra's USB controller appears to be a variant of the ChipIdea controller; perhaps derived from it, or simply a different version of the IP core to
usb: ci_udc: support variants with hostpc register
Tegra's USB controller appears to be a variant of the ChipIdea controller; perhaps derived from it, or simply a different version of the IP core to what U-Boot supports today.
In this variant, at least the following difference are present: - Some registers are moved about. - Setup transaction completion is reported in a separate 'epsetupstat' register, rather than in 'epstat' (which still exists, perhaps for other transaction types). - USB connection speed is reported in a separate 'hostpc1_devlc' register, rather than 'portsc'. - The registers used by ci_udc.c begin at offset 0x130 from the USB register base, rather than offset 0x140. However, this is handled by the associated EHCI controller driver, since the register address is stored in controller.ctrl->hcor.
Introduce define CONFIG_CI_UDC_HAS_HOSTPC to indicate which variant of the controller should be supported. The "HAS_HOSTPC" part of this name mirrors the similar "has_hostpc" field used by the Linux EHCI controller core to represent the presence/absence of the hostpc1_devlc register.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
show more ...
|
| 0c51dc6d | 24-Apr-2014 |
Stephen Warren <swarren@nvidia.com> |
usb: ci_udc: make PHY initialization conditional
usb_gadget_register_driver() currently unconditionally programs PORTSC to select a ULPI PHY. This is incorrect on at least the Tegra boards I am test
usb: ci_udc: make PHY initialization conditional
usb_gadget_register_driver() currently unconditionally programs PORTSC to select a ULPI PHY. This is incorrect on at least the Tegra boards I am testing with, which use a UTMI PHY for the OTG ports. Make the PHY selection code conditional upon the specific EHCI controller that is in use.
Ideally, I believe that the PHY initialization code should be part of ehci_hcd_init() in the relevant EHCI controller driver, or some board- specific function that ehci_hcd_init() calls.
For MX6, I'm not sure this PHY initialization code is correct even before this patch, since ehci-mx6's ehci_hcd_init() already configures PORTSC to a board-specific value, and it seems likely that the code in ci_udc.c is incorrectly undoing this. Perhaps this is not an issue if the PHY selection register bits aren't implemented on this instance of the MX6 USB controller?
ehci-mxs.c doens't appear to touch PORTSC, so this code is likely still required there.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
show more ...
|
| 8aac6e9c | 24-Apr-2014 |
Stephen Warren <swarren@nvidia.com> |
usb: ci_udc: set ep->req.actual after transfer
At least drivers/usb/gadget/storage_common.c expects that ep->req.actual contain the number of bytes actually transferred. (At least in practice, I obs
usb: ci_udc: set ep->req.actual after transfer
At least drivers/usb/gadget/storage_common.c expects that ep->req.actual contain the number of bytes actually transferred. (At least in practice, I observed it failing to work correctly unless this was the case).
However, ci_udc.c modifies ep->req.length instead. I assume that .length is supposed to represent the allocated buffer size, whereas .actual is supposed to represent the actual number of bytes transferred. In the OUT transaction case, this may happen simply because the host sends a smaller packet than the max possible size, which is quite legal. In the IN case, transferring fewer bytes than requested could presumably happen as an error.
Modify handle_ep_complete() to write to .actual rather than modifying .length.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
show more ...
|
| f5c03006 | 24-Apr-2014 |
Stephen Warren <swarren@nvidia.com> |
usb: ci_udc: Support larger packets
ci_ep_queue() currently only fills in the page0/page1 fields in the queue item. If the buffer is larger than 4KiB (unaligned) or 8KiB (page-aligned), then this pr
usb: ci_udc: Support larger packets
ci_ep_queue() currently only fills in the page0/page1 fields in the queue item. If the buffer is larger than 4KiB (unaligned) or 8KiB (page-aligned), then this prevents the HW from knowing where to write the balance of the data.
Fix this by initializing all 5 pageN pointers, which allows up to 16KiB (potentially non-page-aligned) buffers.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
show more ...
|
| 52d45012 | 18-Apr-2014 |
Rob Herring <robh@kernel.org> |
usb: handle NULL table in usb_gadget_get_string
Allow a NULL table to be passed to usb_gadget_get_string for cases when a string table may not be populated.
Signed-off-by: Rob Herring <robh@kernel.
usb: handle NULL table in usb_gadget_get_string
Allow a NULL table to be passed to usb_gadget_get_string for cases when a string table may not be populated.
Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Tom Rini <trini@ti.com> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
show more ...
|
| fd2a89b2 | 18-Apr-2014 |
Przemyslaw Marczak <p.marczak@samsung.com> |
usb:gadget:f_thor: fix write to filesystem by add dfu_flush()
Since dfu read/write operations needs to be flushed manually, writing to filesystem on MMC by thor was broken. MMC raw write actually is
usb:gadget:f_thor: fix write to filesystem by add dfu_flush()
Since dfu read/write operations needs to be flushed manually, writing to filesystem on MMC by thor was broken. MMC raw write actually is working fine because current dfu_flush() function writes filesystem only. This commit adds dfu_flush() to f_thor and now filesystem write is working.
This change was tested on Trats2 board.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de> Cc: Heiko Schocher <hs@denx.de> Cc: Tom Rini <trini@ti.com>
show more ...
|
| fc2d5d04 | 05-Feb-2014 |
Lukasz Majewski <l.majewski@samsung.com> |
usb:gadget:f_thor: cosmetic: Remove debug memset
Apparently debug memset (with a 0x55 value) has been overlooked in the f_thor code.
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Mare
usb:gadget:f_thor: cosmetic: Remove debug memset
Apparently debug memset (with a 0x55 value) has been overlooked in the f_thor code.
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de>
show more ...
|
| 84c13e6f | 05-Feb-2014 |
Lukasz Majewski <l.majewski@samsung.com> |
usb:gadget:f_thor: Allocate request up to THOR_PACKET_SIZE not ep->maxpacket
Now it is possible to allocate static request - which receives data from the host (OUT transaction) to the size of THOR p
usb:gadget:f_thor: Allocate request up to THOR_PACKET_SIZE not ep->maxpacket
Now it is possible to allocate static request - which receives data from the host (OUT transaction) to the size of THOR packet.
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de>
show more ...
|