| Age | Commit message (Collapse) | Author |
|
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 <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
|
|
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 <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
|
|
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 <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
|
|
The for() loop is not needed since the value is immediately accessible.
Use this instead to simplify the code.
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
|
|
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 <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
|
|
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 <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
|
|
Adjust the existing hub code to support driver model, and add a USB driver
for hubs.
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
|
|
Split out the hub detection logic so it can be used by driver model. Also
adjust the code to return errors correctly.
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
|
|
Add the required #ifdefs and remove unwanted data structures so that the
USB uclass will be able to use this file.
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
|
|
This function now calls usb_setup_device() to set up the device and
usb_hub_probe() to check if it is a hub. The XHCI special case is now a
parameter to usb_setup_device(). The latter will be used by the USB uclass
when it is added, since it does not rely on any CONFIGs or legacy data
structures.
Signed-off-by: Simon Glass <[email protected]>
Bug-fixes for descriptor reading and usb_new_device() return value
Signed-off-by: Hans de Goede <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
Tested-by: Tom Rini <[email protected]>
|
|
Move the code that sets up the device with a new address into its own
function, usb_prepare_device().
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
|
|
usb_new_device() is far too long and does far too much. As a first step, move
the code that does initial setup and reads a descriptor into its own function
called usb_setup_descriptor().
For XHCI the init order is different - we set up the device but don't
actually read the descriptor until after we set an address. Support this
option as a parameter to usb_setup_descriptor().
Avoid changing this torturous code more than necessary to make it easy to
review.
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
|
|
Move the port reset code into its own function. Rename usb_hub_reset() to
indicate that is is now a legacy function.
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
|
|
This CONFIG is not used anywhere in U-Boot, so drop it.
Signed-off-by: Simon Glass <[email protected]>
Acked-by: Marek Vasut <[email protected]>
|
|
Adjust this command to work with the new driver model uclass. It needs to
iterate through multiple independent controllers to find hubs, and work
through their children recursively in a different way. Otherwise the
functionality is much the same.
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
|
|
This function returns NULL on error at present. Adjust it so that we can
return a real error, as is needed with driver model. Also improve the
error handling in its caller, usb_hub_port_connect_change(), and adjust
the code order to prepare for driver model.
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
|
|
Use 'udev' instead of 'dev' in a few places, reserving 'dev' for driver
model's struct udevice. Also adjust the code in a few minor ways to make
it easier to plumb in driver model.
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
|
|
Now that driver model handles cros_ec init, we can drop this special code.
Signed-off-by: Simon Glass <[email protected]>
|
|
Since all supported boards enable this option now, we can remove it along
with the old code.
Signed-off-by: Simon Glass <[email protected]>
|
|
Convert this driver over to use driver model. Since all x86 platforms use
it, move x86 to use driver model for SPI and SPI flash. Adjust all dependent
code and remove the old x86 spi_init() function.
Note that this does not make full use of the new PCI uclass as yet. We still
scan the bus looking for the device. It should move to finding its details
in the device tree.
Signed-off-by: Simon Glass <[email protected]>
|
|
First just add support for MAC drivers.
Signed-off-by: Joe Hershberger <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
|
|
The return codes in common/cmd_net.c had a number of inconsistencies.
Update them to all use the enum from command.h
Signed-off-by: Joe Hershberger <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
|
|
This value is not used by the network stack and is available in the
global data, so stop passing it around. For the one legacy function
that still expects it (init op on old Ethernet drivers) pass in the
global pointer version directly to avoid changing that interface.
Signed-off-by: Joe Hershberger <[email protected]>
Reported-by: Simon Glass <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Signed-off-by: Simon Glass <[email protected]>
(Trival fix to remove an unneeded variable declaration in 4xx_enet.c)
|
|
In the case where the arch defines a custom map_sysmem(), make sure that
including just mapmem.h is sufficient to have these functions as they
are when the arch does not override it.
Also split the non-arch specific functions out of common.h
Signed-off-by: Joe Hershberger <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
|
|
Sometimes, for example if the display is mounted in portrait mode or even if it
is mounted landscape but rotated by 180 degrees, we need to rotate our content
of the display respectively the framebuffer, so that user can read the messages
which are printed out.
For this we introduce the feature called "CONFIG_LCD_ROTATION", this may be
defined in the board-configuration if needed. After this the lcd_console will
be initialized with a given rotation from "vl_rot" out of "vidinfo_t" which is
provided by the board specific code.
If CONFIG_LCD_ROTATION is not defined, the console will be initialized with
0 degrees rotation.
Signed-off-by: Hannes Petermaier <[email protected]>
Signed-off-by: Hannes Petermaier <[email protected]>
Acked-by: Nikita Kiryanov <[email protected]>
[agust: fixed 'struct vidinfo' has no member named 'vl_rot' errors]
Signed-off-by: Anatolij Gustschin <[email protected]>
|
|
For coming implementation of lcd_console rotation, we will need some more
variables for holding information about framebuffer size, rotation, ...
For better readability we catch all them into a common structure.
Signed-off-by: Hannes Petermaier <[email protected]>
Signed-off-by: Hannes Petermaier <[email protected]>
Acked-by: Nikita Kiryanov <[email protected]>
|
|
Don't call the lcd_getfgcolor and lcd_getbgcolor within the "draw-loop", this
only wastes time.
Signed-off-by: Hannes Petermaier <[email protected]>
Signed-off-by: Hannes Petermaier <[email protected]>
Acked-by: Nikita Kiryanov <[email protected]>
|
|
the capability of drawing some *str with count from lcd_drawchars is unnary.
It is always called from lcd_putc_xy with one character of and count = 1.
So we simply rename lcd_drawchars into lcd_putc_xy and remove the loops inside.
Signed-off-by: Hannes Petermaier <[email protected]>
Signed-off-by: Hannes Petermaier <[email protected]>
Acked-by: Nikita Kiryanov <[email protected]>
|
|
Add a uclass for PCI controllers and a generic one for PCI devices. Adjust
the 'pci' command and the existing PCI support to work with this new uclass.
Keep most of the compatibility code in a separate file so that it can be
removed one day.
TODO: Add more header file comments to the new parts of pci.h
Signed-off-by: Simon Glass <[email protected]>
|
|
Add a convenience function to access the private data that a uclass stores
for each of its devices. Convert over most existing uses for consistency
and to provide an example for others.
Signed-off-by: Simon Glass <[email protected]>
|
|
This function does not unmap what it maps. Correct it.
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Bin Meng <[email protected]>
|
|
Since driver model is set up after arch_cpu_init(), that function cannot
use drivers. Add a new arch_cpu_init_dm() function which is called
immediately after driver model is ready, and can reference devices.
This can be used to probe essential devices for the CPU.
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Bin Meng <[email protected]>
|
|
Signed-off-by: Paul Kocialkowski <[email protected]>
|
|
Implement an alias name check for devices where GPT limitations prevent
user-friendly partition names such as "boot", "system" and "cache". Or,
where the actual partition name doesn't match a standard partition name
used commonly with fastboot.
To set an alias, add an environment setting as follows:
fastboot_partition_alias_<alias partition name>=<actual partition name>
Example: fastboot_partition_alias_boot=LNX
Signed-off-by: Michael Scott <[email protected]>
Acked-by: Steve Rae <[email protected]>
Cc: Steve Rae <[email protected]>
Cc: Lukasz Majewski <[email protected]>
|
|
trigger watchdog before calling usb_gadget_handle_interrupts()
This prevents board resets when calling dfu command on boards
which have a watchdog.
Signed-off-by: Heiko Schocher <[email protected]>
[ Reedition by Lukasz Majewski <[email protected]> to apply to
v2014.04 release ]
|
|
USB Mass Storage is the standard name, so let's use it here.
Suggested-by: Soeren Moch <[email protected]>
Signed-off-by: Fabio Estevam <[email protected]>
Acked-by: Marek Vasut <[email protected]>
|
|
This patch invokes board-specific USB cleanup (board_usb_cleanup)
function in the thor gadget.
Signed-off-by: Inha Song <[email protected]>
|
|
This patch invokes board-specific USB cleanup (board_usb_cleanup)
function in the mass storage gadget
Signed-off-by: Inha Song <[email protected]>
|
|
Since we support multiple dwc3 controllers to be existent at the same
time, in order to handle the interrupts of a particular dwc3 controller
usb_gadget_handle_interrutps should take controller index as an
argument.
Hence the API of usb_gadget_handle_interrupts is modified to take
controller index as an argument and made the corresponding changes to all
the usb_gadget_handle_interrupts calls.
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
Reviewed-by: Lukasz Majewski <[email protected]>
|
|
Invoked board_usb_cleanup for cleaning up initialized USB. It
will be invoked if the user enterts ctrl-C.
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
Reviewed-by: Lukasz Majewski <[email protected]>
|
|
Some USB devices break the spec and require longer warm-up times. Allow
the usb_pgood_delay env variable to override the calculated time.
Signed-off-by: Tim Harvey <[email protected]>
|
|
When fetching the first descriptor from a new device, only validate that
we received at least 8 bytes, not that we received the entire descriptor.
The reasoning is:
- The code only uses fields in the first 8 bytes, so that's all we need
to have fetched at this stage.
- The smallest maxpacket size is 8 bytes. Before we know the actual
maxpacket the device uses, the USB controller may only accept a single
packet (see the DWC2 note in the comment added in the commit).
Consequently we are only guaranteed to receive 1 packet (at least 8
bytes) even in a non-error case.
Fixes: 1a7758044b04 ("usb: Early failure when the first descriptor read
fails or is invalid")
Cc: Paul Kocialkowski <[email protected]>
Signed-off-by: Stephen Warren <[email protected]>
|
|
This may happen when using an USB1 device on a controller that only supports
USB2 (e.g. EHCI). Reading the first descriptor will fail (read 0 byte), so we
can abort the process at this point instead of failing later and wasting time.
Signed-off-by: Paul Kocialkowski <[email protected]>
|
|
This checks that a new USB device is correctly initialized and frees it if not.
In addition, this doesn't report that USB was started when no device was found.
Signed-off-by: Paul Kocialkowski <[email protected]>
|
|
This makes use of errno return codes for representing error codes in a unified
way.
Signed-off-by: Paul Kocialkowski <[email protected]>
|
|
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-independent
Signed-off-by: Sergey Temerkhanov <[email protected]>
Signed-off-by: Radha Mohan Chintakuntla <[email protected]>
|
|
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 <[email protected]>
|
|
The ARM reference designs all use a special flash image format
that stores a footer (two versions exist) at the end of the last
erase block of the image in flash memory.
Version one of the footer is indicated by the magic number
0xA0FFFF9F at 12 bytes before the end of the flash block and
version two is indicated by the magic number 0x464F4F54 0x464C5348
(ASCII for "FLSHFOOT") in the very last 8 bytes of the erase block.
This command driver implements support for both versions of the
AFS images (the name comes from the Linux driver in drivers/mtd/afs.c)
and makes it possible to list images and load an image by name into
the memory with these commands:
afs - lists flash contents
afs load <image> - loads image to address indicated in the image
afs load <image> <addres> - loads image to a specified address
This image scheme is used on the ARM Integrator family, ARM
Versatile family, ARM RealView family (not yet supported in U-Boot)
and ARM Versatile Express family up to and including the new
Juno board for 64 bit development.
Reviewed-by: Tom Rini <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
|