Kbuild: introduce Makefile in arch/$ARCH/

Introduce a Makefile under arch/$ARCH/ and include it in the
top Makefile (similar to Linux kernel). This allows further
refactoringi like moving architecture-specific code out of global
makefiles, deprecating config variables (CPU, CPUDIR, SOC) or
deprecating arch/$ARCH/config.mk.

In contrary to Linux kernel, U-Boot defines the ARCH variable by
Kconfig, thus the arch Makefile can only included conditionally
after the top config.mk.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Acked-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
lib: string: move strlcpy() to a common place

Move strlcpy() definition from drivers/usb/gadget/ether.c to
lib/string.c because it is a very useful function.
Let's add the prototype to include/linux/string.h too.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
dm_test: improve the appearance shown by "dm tree" command

The command "dm tree" lists devices in a tree-like format.
This commit makes it look more like what the Unix command "tree"
shows.

=> dm tree
 Class       Probed   Name
----------------------------------------
 root        [ + ]    root_driver
 demo        [   ]    |-- demo_shape_drv
 demo        [   ]    |-- demo_simple_drv
 demo        [   ]    |-- demo_shape_drv
 demo        [   ]    |-- demo_simple_drv
 demo        [   ]    |-- demo_shape_drv
 test        [   ]    |-- test_drv
 test        [   ]    |-- test_drv
 test        [   ]    |-- test_drv
 gpio        [   ]    |-- gpio_sandbox
 serial      [   ]    |-- serial_sandbox
 serial      [ + ]    |-- serial
 demo        [   ]    |-- triangle
 demo        [   ]    |-- square
 demo        [   ]    |-- hexagon
 gpio        [   ]    |-- gpios
 spi         [   ]    |-- spi@0
 spi_emul    [   ]    |   `-- flash@0
 cros_ec     [ + ]    `-- cros-ec@0

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Series-cc: sjg
Commit-notes:

This commit uses strlcpy().

Please apply the following first:
http://patchwork.ozlabs.org/patch/412670/

END
kconfig: Fix warning "‘jump’ may be used uninitialized"

Warning:
In file included from scripts/kconfig/zconf.tab.c:2537:0:
scripts/kconfig/menu.c: In function ‘get_symbol_str’:
scripts/kconfig/menu.c:590:18: warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     jump->offset = strlen(r->s);

Simplifies the test logic because (head && local) means (jump != 0)
and makes GCC happy when checking if the jump pointer was initialized.

Signed-off-by: Peter Kümmel <syntheticpp@gmx.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
[ imported from Linux Kernel, commit 2d5603060967 ]
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
sh: move -m options to arch/sh/config.mk

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
dm: do not check dm_root before searching in uclass_root

The function uclass_find() looks for a uclass in the linked
list of gd->uclass_root; gd->dm_root has nothing to do with
gd->uclass_root.  Remove this confusing code.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
dm: minor coding style fixes
kconfig: add CONFIG_CROSS_COMPILE

Copy from Linux Kernel (with a few adjustments in comments).
kbuild: collect useful commands into scripts/Makefile.lib
include/configs: Do not use $(BOARDDIR)
patman,buildman: remove redundant readlines() method

In Python, file objects can be used directly in iterators
without readlines() method.

The behavior is the same but it generally saves memory
without readlines().

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
patman: use raw strings for regular expression

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
buildman: Do not parse git aliase file
consolidate undefined macros
common: remove asmlinkage definition
scripts/mailmapper: add overwrite option
buildman: Do not search under non-existing toolchain directories

The function glob.glob(pathname) is useful for expanding '*' in the
pathname. But it can be used even if '*' is not contained in the
pathname. In this case, glob.glob() returns an empty list if the given
pathname does not exist.

It means glob.glob is useful for all cases, not only for expanding '*'
but also for ignoring non-existing pathname.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
buildman: remove unnecessay sanity check

The confitonal statement "if config_fname:" is redundant
because ConfigParser.read() always succeeds even if an empty
string is given to its argument.

Besides, 'config_fname' always contains a non-empty string.
The variable 'config_fname', if empty, is set to '$HOME/.buildman'
at the previous line.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
buildman: improve readability of toolchain check
patman, buildman: avoid using magic numbers in code

When changing the foreground color, '+30' is a magic number.
Put it into the BRIGHT_START and NORMAL_START macros.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>