spi: Tegra2: Seaboard: fix UART corruption during SPI transactions

Simon Glass's proposal to fix this on Seaboard was NAK'd, so I
removed his NS16550 references and added a small delay before
SPI/UART muxing. Tested on my Seaboard with large SPI reads/writes
and saw no corruption (crc's matched) and no spurious comm chars.

Signed-off-by: Tom Warren <twarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Jimmy Zhang <jimmzhang@nvidia.com>
spi: Tegra2: Seaboard: enable SPI/UART corruption fix

Signed-off-by: Tom Warren <twarren@nvidia.com>
tegra: paz00: fix typo in SD slot CD detect GPIO

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
tegra: add alternate UART1 funcmux entry

(In at least some configurations) Whistler uses UART1 on pingroups
UAA, UAB.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
tegra: Whistler board support

Whistler is a highly configurable Tegra evaluation and development board.
This change adds support for the following specific configuration:

E1120 motherboard
E1108 CPU board
E1116 PMU board

The motherboard configuration switches are set as follows:
SW1=0 SW2=0 SW3=5
S1/S2/S3/S4 all on, except S3 7/8 are off.

Other combinations of daugher boards may work to varying degrees, but will
likely require some SW adjustment.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
tegra: remove some cruft from CONFIG_EXTRA_ENV_SETTINGS

console isn't used by anything, and the kernel should be set appropriately
by whatever script is booting the kernel, not imposed by the bootloader.

mem might be useful, but the current value is pretty bogus, since it
includes nvmem options that make no sense for an upstream kernel, and
equally should not be required for any downstream kernel. Either way, this
is also best left to the kernel boot script.

smpflag isn't used by anything, and again was probably intended to be a
kernel command-line option better set by the kernel boot script.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
tegra: flesh out bootcmd

This implements a useful bootcmd for Tegra. The boot order is:

* If USB enabled, USB storage
* Internal MMC (SD card or eMMC)
* If networking is enabled, BOOTP/TFTP

When booting from USB or MMC, the boot script is assumed to be in
partition 1 (although this may be overridden via the rootpart variable),
both ext2 and FAT filesystems are supported, the boot script may exist
in either / or /boot, and the boot script may be named boot.scr.uimg or
boot.scr.

When booting over the network, it is assumed that boot.scr.uimg exists
on the TFTP server. There is less flexibility here since those setting
up network booting are expected to need less hand-holding.

In all cases, it is expected that the initial file loaded is a U-Boot
image containing a script that will load the kernel, load any required
initrd, load any required DTB, and finally bootm the kernel.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
tegra: whistler: reduce and comment network cfg options

CONFIG_CMD_PING/NFS aren't required for Whistler to boot.

Add some comments.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
tegra: seaboard: add support for USB networking

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
tegra: add UART1 on GPU funcmux entry

TrimSlice uses UART1 on the GPU pingroup.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
tegra: sync SDIO1 pingroup enum name with TRM

Signed-off-by: Lucas Stach <dev@lynxeye.de>
CC: Tom Warren <twarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
tegra: add SDIO1 funcmux entry for UARTA

This is based on top of:
tegra: add alternate UART1 funcmux entry
tegra: add UART1 on GPU funcmux entry

v2: remove enum change

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
CC: Stephen Warren <swarren@wwwdotorg.org>
CC: Tom Warren <twarren@nvidia.com>
CC: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>
tegra: add SDMMC1 on SDIO1 funcmux entry

This will be used on TrimSlice.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
tegra: Compulab TrimSlice board support

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
tegra: harmony: add device tree support

... to enable USB host support, which enables Ethernet support.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
tegra: paz00: add device tree support

... to enable USB host support, which enables Ethernet support.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
tegra: remove CONFIG_USB_ETHER_SMSC95XX from boards without it

The SMSC95xx series may exist either directly on a main board, or as a USB
to Ethernet dongle. However, dongles containing these chips are very rare.
Hence, remove this config option, except on Harmony where such a chip is
actually present on the board.

The asix option remains, since it's a popular chip, and I actively use a
dongle containing this.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
tegra: override compiler flags for more files

Override -march setting for tegra to -march=armv4t for cmd_nvedit.c and
string.c.

The recent change to use -march=armv7-a for armv7 caused a regression
on Tegra because tegra starts boot on a arm7tdmi processor before
transferring control to the cortex-a9. While still executing on the
arm7tdmi there is a call to getenv_ulong() that causes an illegal
instruction exception if cmd_nvedit is compiled for armv7. A similar
issue exists for functions in string.c.

Signed-off-by: Allen Martin <amartin@nvidia.com>
[swarren: added string.o override]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
NOTE: Don't upstream this - Allen posted a more complete patch at:
http://lists.denx.de/pipermail/u-boot/2012-May/124384.html
HACK: Disable cache alignment warnings

They are very annoying and noisy
Add env vars describing U-Boot target board

This can be useful for generic scripts. For example, rather than hard-
coding a script to ext2load tegra-harmony.dtb, it could load
${soc}-${board}.dtb and hence not need adjustments to run on multiple
boards.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
v3:
* Prefix config.h #defines with CONFIG_SYS_. The environment variable
  names remain unchanged.
v2:
* Pass values via config.h instead of command-line
* Use a single CONFIG option to enable this feature
* Simplify names of the environment variables
* add README entry describing CONFIG_ENV_VARS_UBOOT_CONFIG