01 Oct, 2017
1 commit
-
The stored 'blk' value is overwritten to 'size / 512' before it can
be used in usb_stor_set_max_xfer_blk(). This is not what we want.
In fact, when 'size' exceeds the upper limit (USHRT_MAX * 512), we
should simply assign 'size' to the upper limit.Reported-by: Coverity (CID: 167250)
Signed-off-by: Bin Meng
27 Sep, 2017
2 commits
-
When EHCD and xHCD are enabled at the same time, USB storage device
driver will fail to read/write from/to the storage device attached
to the xHCI interface, due to its transfer blocks exceeds the xHCD
driver limitation.With driver model, we have an API to get the controller's maximum
transfer size and we can use that to determine the storage driver's
capability of read/write.Note: the non-DM version driver is still broken with xHCD and the
intent here is not to fix the non-DM one, since the xHCD itself is
already broken in places like 3.0 hub support, etc.Signed-off-by: Bin Meng
-
This adds a new memeber max_xfer_blk in struct us_data to record
the maximum number of transfer blocks for the storage device.It is set per HCD setting, and so far is to 65535 for EHCD and 20
for everything else.Signed-off-by: Bin Meng
12 Jul, 2017
1 commit
-
We should not be using typedefs in U-Boot and 'ccb' is a pretty short
name. It is also used with variables. Drop the typedef and use 'struct'
instead.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
15 May, 2017
1 commit
-
In order to be able to migrate the various SoC EHCI CONFIG options we
first need to finish the switch from CONFIG_USB_EHCI to
CONFIG_USB_EHCI_HCD.Cc: Marek Vasut
Signed-off-by: Tom Rini
Reviewed-by: Marek Vasut
14 Apr, 2017
1 commit
-
This fixes a regression caused by
commit 07b2b78ce4bc8ae25e066c65245eaf58c0d9a67c
dm: usb: Convert USB storage to use driver-model for block devswhich caused part_init to be called when it was not previously.
Without this patch, the following happens when a USB sd card reader is used.=> usb start
starting USB...
USB0: Port not available.
USB1: USB EHCI 1.00
scanning bus 1 for devices... 3 USB Device(s) found
scanning usb for storage devices... Device NOT ready
Request Sense returned 02 3A 00
### ERROR ### Please RESET the board ###This happens because dev_desc->blksz is 0.
Signed-off-by: Troy Kisky
17 Jan, 2017
1 commit
-
By enabling DM_USB information about number of storage devices
was lost.
Get this information back simply by printing number of devices detected
via BLK uclass.For example:
scanning bus 0 for devices... 7 USB Device(s) found
scanning usb for storage devices... 3 Storage Device(s) found
scanning usb for ethernet devices... 0 Ethernet Device(s) foundSigned-off-by: Michal Simek
24 Sep, 2016
1 commit
-
This makes functions much simpler.
Signed-off-by: Masahiro Yamada
17 May, 2016
3 commits
-
Add a function that automatically builds the device name given the parent
and a supplied string. Most callers will want to do this, so putting this
functionality in one place makes more sense.Signed-off-by: Simon Glass
-
This function is implemented by the legacy block functions now. Drop it.
Signed-off-by: Simon Glass
-
Add a legacy block interface for USB storage.
Signed-off-by: Simon Glass
23 Mar, 2016
2 commits
-
This should return 0 on success, not 1. Fix it.
Signed-off-by: Simon Glass
Acked-by: Marek Vasut
Reviewed-by: Tom Rini -
Signed-off-by: Vagrant Cascadian
Acked-by: Marek Vasut
Reviewed-by: Simon Glass
Reviewed-by: Tom Rini
15 Mar, 2016
6 commits
-
Update this code to support CONFIG_BLK. Each USB storage device can have
one or more block devices as children, each one representing a LUN
(logical unit) of the USB device.Signed-off-by: Simon Glass
Reviewed-by: Marek Vasut
Tested-by: Stephen Warren -
Adjust a few things so that the addition of driver-models support involved
adding code rather than also changing it. This makes the patches easier to
review.Signed-off-by: Simon Glass
Reviewed-by: Marek Vasut
Tested-by: Stephen Warren -
The limit on storage devices is USB_MAX_STOR_DEV but we use one extra
element while probing to see if a device is a storage device. Avoid this,
since it causes memory corruption.Signed-off-by: Simon Glass
Reviewed-by: Marek Vasut
Tested-by: Stephen Warren -
This is a device number, and we want to use 'dev' to mean a driver model
device. Rename the member.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
Tested-by: Stephen Warren -
Rename three partition functions so that they start with part_. This makes
it clear what they relate to.Signed-off-by: Simon Glass
Tested-by: Stephen Warren -
Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long
and causes 80-column violations, rename it to struct blk_desc.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
Tested-by: Stephen Warren
21 Jan, 2016
1 commit
-
We can define this in the header file and use it in usb_storage.c. There is
no need to define it twice. Remove the #define from usb_storage.c.Signed-off-by: Simon Glass
Reviewed-by: Marek Vasut
14 Jan, 2016
1 commit
-
This will allow the implementation to make use of data in the block_dev
structure beyond the base device number. This will be useful so that eMMC
block devices can encompass the HW partition ID rather than treating this
out-of-band. Equally, the existence of the priv field is crying out for
this patch to exist.Signed-off-by: Stephen Warren
Reviewed-by: Tom Rini
08 Jan, 2016
1 commit
-
The current limit of 5 is not enough for the driver model USB tests. Really
we should not have a limit but the driver model code still uses the
usb_dev_desc[] array, which has a limit.Increasing the limit by 2 should not bother anyone. Adjust it.
Signed-off-by: Simon Glass
Reviewed-by: Marek Vasut
04 Nov, 2015
1 commit
-
We have the protocol and subclass variables which are used only in
disabled debug code. This code dates back to the initial git import and
seemingly dead code so remove it.This was detected by Coverity (CID 131117)
Signed-off-by: Tom Rini
23 Oct, 2015
1 commit
-
The current name is inconsistent with other driver model data access
functions. Rename it and fix up all users.Signed-off-by: Simon Glass
Reviewed-by: Joe Hershberger
12 Sep, 2015
1 commit
-
Now that we have a new header file for cache-aligned allocation, we should
move the stack-based allocation macro there also.Signed-off-by: Simon Glass
22 Jul, 2015
1 commit
-
In Linux USB_DEVICE() is used to declare a USB device by vendor/device ID.
We should follow the same convention in U-Boot. Rename the existing
USB_DEVICE() macro to U_BOOT_USB_DEVICE() and bring in the USB_DEVICE()
macro from Linux for use in U-Boot.Signed-off-by: Simon Glass
19 Apr, 2015
7 commits
-
Add support for scanning USB storage devices with driver model. This mostly
involves adding a USB device ID for storage devices.Signed-off-by: Simon Glass
Reviewed-by: Marek Vasut -
The usb_stor_scan() function is quite long, so split out the code that scans
each device into its own function. Also, rather than setting up the block
device list once at the start, set it up as each device is scanned. This
makes it possible to use this code from driver model.Signed-off-by: Simon Glass
Reviewed-by: Marek Vasut -
This reverts commit cd749658d5994978579628a6333e5c2a6c8ec632.
The conflicts with this commit are hard for me to figure out. I will re-apply
it later. -
With a few tweaks we can compile this code with sandbox and enable testing
of the USB storage layer.Signed-off-by: Simon Glass
Reviewed-by: Marek Vasut -
The for() loop is not needed since the value is immediately accessible.
Use this instead to simplify the code.Signed-off-by: Simon Glass
Reviewed-by: Marek Vasut -
This function assumes that unsigned long is 32-bits wide, but it is not
on 64-bit machines. Use the correct type, and add a few debug() lines also.Signed-off-by: Simon Glass
Reviewed-by: Marek Vasut -
These are better off in a header file so they can be used by other code (e.g.
the sandbox USB storage emulator).Signed-off-by: Simon Glass
Reviewed-by: Marek Vasut
14 Apr, 2015
2 commits
-
This patch fixes USB storage capacity detection breakage on 64-bit systems
which arises due to 'unsigned long' length difference. Old code assumes that
to be 32 bit and breaks because of inappropriate response buffer layout.
Also this fixes a number of build warnings and changes big-endian values
treatment style to be architecture-independentSigned-off-by: Sergey Temerkhanov
Signed-off-by: Radha Mohan Chintakuntla -
Mass storage is not necessary present on interface 0. This
patch allow usb_stor_scan to look in every available interface.Signed-off-by: Franck Jullien
08 Nov, 2014
1 commit
-
Skip enclosure service devices when probing for usb storage devices.
This avoids long timeouts when probing for external usb harddisks
which provide "Enclosure Services".Signed-off-by: Soeren Moch
--This is a new version of the patch
"usb_storage: skip all unknown devices when probing"
http://http://lists.denx.de/pipermail/u-boot/2014-November/194622.htmlCc: Marek Vasut
Cc: Tom Rini
27 Oct, 2014
1 commit
-
Use the inttypes header file to provide this.
Signed-off-by: Simon Glass
24 Jul, 2013
1 commit
-
Signed-off-by: Wolfgang Denk
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini
26 Jun, 2013
1 commit
-
With CONFIG_SYS_64BIT_LBA, lbaint_t gets defined as a 64-bit type,
which is required to represent block numbers for storage devices that
exceed 2TiB (the block size usually is 512B), e.g. recent hard drives.For some obscure reason, the current U-Boot code uses lbaint_t for the
number of blocks to read (a rather optimistic estimation of how RAM
sizes will evolve), but not for the starting address. Trying to access
blocks beyond the 2TiB boundary will simply wrap around and read a
block within the 0..2TiB range.We now use lbaint_t for block start addresses, too. This required
changes to all block drivers as the signature of block_read(),
block_write() and block_erase() in block_dev_desc_t changed.Signed-off-by: Sascha Silbe
06 May, 2013
1 commit
-
Some cleanup in usb framework, nothing much on feature side.
Signed-off-by: Vikas C Sajjan
Signed-off-by: Vivek Gautam