patman: Handle checkpatch.pl not providing file/line info

Sometimes we don't get a valid filename or line number from checkpatch.pl,
for example if the patch is in a bad format. Deal with this by using a
default value, rather than a stack trace.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools: Add cleanpatch

There are some errors reported by checkpatch.pl that can be easily cleaned up by
using the cleanpatch tool.

Import the cleanpatch script from linux kernel 3.5.4 stable version as from the
following commit:

commit cb3ed5b7e09c6c0462e396d55e3fecc0980a333a
Author: H. Peter Anvin <hpa@zytor.com>
Date:   Fri May 25 17:58:26 2007 -0700

    scripts: Make cleanfile/cleanpatch warn about long lines

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
input: Correct key_matrix fdt decoding

Some issues with this were not addressed in the previous series. Fix up
the binding decoding to deal with what is actually expected in the fdt.

This corrects the broken keyboard on seaboard.

Signed-off-by: Simon Glass <sjg@chromium.org>
input: Separate out keyboard repeat/delay from init

It is inconvenient to have to specify the keyboard repeat and delay at
init time if it is not yet available, so move this into a separate
function.

Some drivers will want to do this when their keyboard init routine
is actually called.

Signed-off-by: Simon Glass <sjg@chromium.org>
input: Allow key ghosting filter to be disabled

Some keyboards will not need a key ghosting filter, so make this feature
optional.

Signed-off-by: Simon Glass <sjg@chromium.org>
input: Add debugging for key matrix key codes

These are read from the fdt - add a debug feature to display the mapping
on start-up.

See that we get debug output listing the keycodes

Signed-off-by: Simon Glass <sjg@chromium.org>
common: cmd_bdinfo: fix type of value in print_lnum

This fixes a warning when compiling with ELDK-5.2.1 for MIPS64:

cmd_bdinfo.c: In function 'print_lnum':
cmd_bdinfo.c:56:2: warning: format '%llX' expects argument of type 'long long unsigned int', but argument 3 has type 'u64' [-Wformat]

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
tools/env: Use a board-specific default env

Originally added in aa701b94336b358798d676eef12a7b90bdac23f5

Before this patch, there was a hard-coded env that was used as default
if the env in flash is detected as invalid.  Now this tool (compiled
for a given board) will share the default env with the u-boot for the
board.

Fix include of config.h

Need to define "TEXT_BASE" when building the fw_env tool so that the
default env will be correct for environments which use it.

Define __ASSEMBLY__ when calling #include <config.h> so that we only
get #defines (all we're interested in).

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
tools/env: Remove unneeded complexity

The length included the name length, and then it was subtracted back
out on each use.  Now we don't include it in the first place.  Also
realloc as we process arguments and eliminate memset.  Use memcpy
instead of manually copying each byte.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
tools/env: Don't call env_init() in fw_getenv()

We will only call fw_getenv when the env has already been initialized.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
tools/env: Serialize calls to fw_*env

Use a lock file at /var/lock/fw_printenv.lock.
Avoids seriously confusing the MTD driver.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
env: Check for NULL pointer in envmatch()

If the pointer passed into envmatch() is NULL, return -1 instead of
crashing.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
tools: Add a README note about fw_printenv lock file

Add a mention of the lock file to the README for the fw_printenv tool.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reported-by: Luka Perkov <uboot@lukaperkov.net>
tegra: Update Avionic Design vendor prefix

The official vendor prefix for Avionic Design is now "ad". Update the
board DTS files accordingly.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
tegra: Rename Medcom to Medcom-Wide

Medcom is the marketing name for an older, PXA-based version of the same
device. In order to avoid confusion, rename the Tegra-based version to
the new marketing name.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
Tegra20: Move some code files to common directories for upcoming Tegra30 patches.

Move files that are going to be common between T20 and T30 into 'tegra-common'
subdirs in AVP (arm720t), CPU (armv7), and shared (arch/arm/cpu/.) areas. Any
files that are left behind in '/tegra20' will be copied to '/tegra30' subdirs
and modified for that SoC. The 'common' files should need only minor changes.

Include files (arch/arm/include/asm/arch-tegra/tegra20) will be done in a
follow-on patch.

Builds fine w/MAKEALL -s tegra20. Checkpatch.pl is clean.

Signed-off-by: Tom Warren <twarren@nvidia.com>
Tegra20: Move some include files to arch-tegra for sharing with Tegra30

The move is pretty straight-forward. ap20.h and tegra20.h were renamed to ap.h and tegra.h.
Some files remain in arch-tegra20 but 'include' a file in 'arch-tegra' with #defines & structs
that will be common between T20 and T30 HW. HW-specific #defines, etc. stay in the 'arch-tegra20'
'root' file.

All boards build OK w/MAKEALL -s tegra20. Checkpatch.pl runs clean. Seaboard works OK.

Signed-off-by: Tom Warren <twarren@nvidia.com>
tegra: enable CONFIG_CMD_PART

This is extremely likely to be used from the boot.scr that Tegra's default
bootcmd locates and executes.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
tegra20: complete periph_id enum

Most Tegra boards output the ULPI reference clock on pad DEV2.

Complete the periph_id enum so that we are able to enable this
clock output circuit.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
tegra20: add clock_set_pllout function

Common practice on Tegra 2 boards is to use the pllp_out4 FO
to generate the ULPI reference clock. For this to work we have
to override the default hardware generated output divider.

This function adds a clean way to do so.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>