fs: handle CONFIG_NEEDS_MANUAL_RELOC

Without this, fstypes[].probe points at the wrong place, so calling the
function results in undefined behaviour.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Andreas Bießmann <andreas.devel@googlemail.com>
---
Note: I have compile-tested this with the relocation code forcibly
enabled, but have no way of actually testing the result.
fs: fix do_fsload() handling of optional arguments

Most arguments to the shell command do_fsload() implements are optional.
Fix the minimum argc check to respect that. Cater for the situation
where argv[2] is not provided.

Enhance both do_fsload() and do_ls() to check the maximum number of
arguments too. While this check would typically be implemented via
U_BOOT_CMD()'s max_args parameter, if these functions are called
directly, then that check won't exist.

Finally, alter do_ls() to check (argc >= 4) rather than (argc == 4) so
that if the function is enhanced to allow extra arguments in the future,
this test won't need to be changed at that time.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
cmd_ext4: remove TABs from command help text

TABs in the help text won't line up in the same place on the console as
in a source editor. Replace them with spaces to make ensuring correct
alignment easier.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
fs: fix number base behaviour change in fatload/ext*load

Commit 045fa1e "fs: add filesystem switch libary, implement ls and
fsload commands" unified the implementation of fatload and ext*load
with the new command fsload. However, this altered the interpretation
of command-line numbers from always being base-16, to requiring a "0x"
prefix for base-16 numbers. Enhance do_fsload() to allow commands to
specify which base to use.

Use base 0, thus requiring a "0x" prefix for the new fsload command.
This feels much cleaner than assuming base 16.

Use base 16 for the pre-existing fatload and ext*load to prevent a
change in behaviour.

Use base 16 exclusively for the loadaddr environment variable, since
that variable is interpreted in multiple places, so we don't want the
behaviour to change.

Update command help text to make it clear where numbers are assumed to
be hex, and where an explicit "0x" prefix is required.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
fs: rename fsload command to load

When the generic filesystem load command "fsload" was written, I felt
that "load" was too generic of a name for it, since many other similar
commands already existed. However, it turns out that there is already
an "fsload" command, so that name cannot be used. Rename the new
"fsload" to plain "load" to avoid the conflict. At least anyone who's
used a Basic interpreter should feel familiar with the name!

Signed-off-by: Stephen Warren <swarren@nvidia.com>
ARM: tegra: TrimSlice: add support for USB1 port

FIXME: This doesn't work; check Compulab's downstream U-Boot for the
startup timing workaround they have...

TrimSlice's USB1 port has two purposes; it either acts as a device port
hosting Tegra's USB recovery protocol, or acts as a host port connected
to the internal USB->SATA bridge chip, which may in turn be connected to
an SSD or HDD. Add the appropriate device tree and board configuration
options to enable this port as a host port, and route the port to the
SATA bridge using the VBUS GPIO.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
tegra: use generic fs commands in BOOTCOMMAND

Modify tegra-common-post.h's BOOTCOMMAND definition to use the generic
filesystem command load rather than separate fatload and ext2load.
This removes the need to iterate over supported filesystem types in the
boot command.

This requires editing all board config headers to enable the new
commands. The now-unused commands are left enabled to assue backwards
compatibility with any user scripts. Boards (all from Avionic Design)
which define custom BOOTCOMMAND values are not affected.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
tegra generic fs cmds fixup
USB: make usb_kbd obey USB DMA alignment requirements

Change usb_kbd driver to obey alignment requirements for USB DMA on
the buffer used for data transfer.  This is necessary for
architectures that enable dcache and enable USB DMA.

Signed-off-by: Allen Martin <amartin@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
tegra: move TEGRA_DEVICE_SETTINGS to tegra-common-post.h

Move environment settings for stdin/stdout/stderr to
tegra-common-post.h and generate them automaticaly based on input
device selection.

Signed-off-by: Allen Martin <amartin@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
tegra: Enable USB keyboard

Enable USB keyboard for seaboard and ventana

Signed-off-by: Allen Martin <amartin@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>