platform/kernel/u-boot.git
10 years agokbuild: use shorten logs for cat rules
Masahiro Yamada [Mon, 24 Feb 2014 02:12:16 +0000 (11:12 +0900)]
kbuild: use shorten logs for cat rules

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agokbuild: use shorten logs for mkimage rules
Masahiro Yamada [Mon, 24 Feb 2014 02:12:15 +0000 (11:12 +0900)]
kbuild: use shorten logs for mkimage rules

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agokbuild: use shorten logs objcopy rules
Masahiro Yamada [Mon, 24 Feb 2014 02:12:14 +0000 (11:12 +0900)]
kbuild: use shorten logs objcopy rules

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agokbuild: Add $(Q) when descending into subdirectories
Masahiro Yamada [Mon, 24 Feb 2014 02:12:13 +0000 (11:12 +0900)]
kbuild: Add $(Q) when descending into subdirectories

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
10 years agokbuild: rename OBJCFLAGS to OBJCOPYFLAGS
Masahiro Yamada [Mon, 24 Feb 2014 02:12:12 +0000 (11:12 +0900)]
kbuild: rename OBJCFLAGS to OBJCOPYFLAGS

Rename OBJCFLAGS to OBJCOPYFLAGS beforehand to use
"cmd_objcopy" in scripts/Makefile.lib in an upcoming commit.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agokbuild: move asm-offsets.h rules to ./Kbuild
Masahiro Yamada [Mon, 24 Feb 2014 02:12:11 +0000 (11:12 +0900)]
kbuild: move asm-offsets.h rules to ./Kbuild

Generate include/generated/generic-asm-offsets.h and
include/generated/asm-offsets.h in ./Kbuild.

This commit also changes the include guard.

Before this commit, __ASM_OFFSETS_H__ was used for both of them.
So we could not include generic-asm-offsets.h and asm-offsets.h
at the same time.

This commit renames the include guard of the former to
__GENERIC_ASM_OFFSETS_H__.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agokbuild: abolish "depend" target
Masahiro Yamada [Mon, 24 Feb 2014 02:12:10 +0000 (11:12 +0900)]
kbuild: abolish "depend" target

This commit moves include/generated/{generic-asm-offsets.h, asm-offsets.h}
from "depend" targets to "prepare" targets and deletes "depend" targets.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agokbuild: consolidate version and timestamp headers generation
Masahiro Yamada [Mon, 24 Feb 2014 02:12:09 +0000 (11:12 +0900)]
kbuild: consolidate version and timestamp headers generation

- Generate include/generated/{timestamp.h, version.h}
   more simply by using filechk rule.

 - Add $(UBOOTRELEASE) variable and re-write u-boot.imx rule
   more simply.

 - Rename U_BOOT_VERSION in Makefile to UBOOTVERSION

   Before this commit, the same variable name, "U_BOOT_VERSION"
   was used for two different strings.

   One of them was defined in Makefile.
   It takes the form like "2014.01-rc1" and used in
   makefiles and script files.

   The other is defined in include/generated/version.h
   It takes the form like "U-Boot 2014.01-rc1-00010-gbe6d426-dirty"
   and used in C and Aseembler.

   It is confusing when grepping the source tree. So, this commit
   renames the former to UBOOTVERSION.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agoMakefile: add a new script to check -fstack-usage support
Masahiro Yamada [Wed, 11 Dec 2013 11:11:34 +0000 (20:11 +0900)]
Makefile: add a new script to check -fstack-usage support

If -fstack-usage option is given to crosstools
that do not support it, gcc displays a warning message
but still exits with status 0.

This means we can not rely on $(call cc-option,...)
to detect if -fstack-usage option is supported or not.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agoboards.cfg: Keep arc entries sorted
Fabio Estevam [Mon, 24 Feb 2014 13:32:42 +0000 (10:32 -0300)]
boards.cfg: Keep arc entries sorted

Run "tools/reformat.py -i -d '-' -s 8 <boards.cfg >boards0.cfg && mv boards0.cfg boards.cfg"
in order to keep arc entries sorted.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
10 years agoarm: delete unused macro CONFIG_ARCH_DEVICE_TREE
Masahiro Yamada [Mon, 24 Feb 2014 12:45:48 +0000 (21:45 +0900)]
arm: delete unused macro CONFIG_ARCH_DEVICE_TREE

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Tom Warren <twarren@nvidia.com>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Rajeshwari Birje <rajeshwari.s@samsung.com>
Cc: Inderpal Singh <inderpal.singh@linaro.org>
10 years agox86: coreboot: delete unused coreboot/config.mk
Masahiro Yamada [Mon, 24 Feb 2014 12:36:35 +0000 (21:36 +0900)]
x86: coreboot: delete unused coreboot/config.mk

HOSTCFLAGS_autoconf.mk.dep was added by commit 422322f
but it has never been used.

Cc: Vadim Bendebury <vbendeb@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agopower: fix: Do not execute pmic command when not all necessary parameters are passed
Łukasz Majewski [Mon, 24 Feb 2014 12:33:08 +0000 (13:33 +0100)]
power: fix: Do not execute pmic command when not all necessary parameters are passed

Lack of this check resulted in a data abort when CPU tried to execute the
following command (without further mandatory input): 'pmic MAX77686_PMIC'.

Only the 'pmic list' command requires one passed parameter.
Other require at least two valid parameters for correct operation.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
10 years agokbuild: fix SPL link bug when USE_PRIVATE_LIBGCC is "yes"
Masahiro Yamada [Mon, 24 Feb 2014 11:44:14 +0000 (20:44 +0900)]
kbuild: fix SPL link bug when USE_PRIVATE_LIBGCC is "yes"

Commit 6825a95 (kbuild: use Linux Kernel build scripts)
changed the behavior of linkage when USE_PRIAVATE_LIBGCC
is defined as "yes".
(It dropped arch/arm/lib/eabi_compat.o from the
target library.)

Affected boards are all Tegra boards.

This commit gets back the same behavior as before Kbuild series.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Tom Warren <twarren@nvidia.com>
Cc: Tom Rini <trini@ti.com>
10 years agopart_efi: fix protective mbr struct allocation
Hector Palacios [Thu, 13 Feb 2014 08:48:24 +0000 (09:48 +0100)]
part_efi: fix protective mbr struct allocation

The calloc() call was allocating space for the sizeof the struct
pointer rather than for the struct contents.
Besides, since this buffer is passed to mmc for writing and some
platforms may use cache, the legacy_mbr struct should be cache-aligned.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
10 years agoubifs: fix checkpatch warning
Karicheri, Muralidharan [Mon, 20 Jan 2014 22:10:07 +0000 (17:10 -0500)]
ubifs: fix checkpatch warning

Fix the following checkpatch warning:-

WARNING: externs should be avoided in .c files

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
10 years agocommon, itest: pass u-boot env variables to itest.s
Heiko Schocher [Sat, 25 Jan 2014 06:27:12 +0000 (07:27 +0100)]
common, itest: pass u-boot env variables to itest.s

compare two U-Boot Environment variables with itest.s, example:

=> print tmp ver
tmp=U-Boot 2013.10-g75e
ver=U-Boot 2013.10-g75eb4bc (Jan 21 2014 - 10:35:39)MPC83XX
=> print check_ub_ver
check_ub_ver=if itest.s \${tmp} == \${ver}; then echo equal; else echo diff ;fi
=> run check_ub_ver
diff
=> setenv tmp U-Boot 2013.10-g75eb4bc (Jan 21 2014 - 10:35:39)MPC83XX
=> print tmp ver
tmp=U-Boot 2013.10-g75eb4bc (Jan 21 2014 - 10:35:39)MPC83XX
ver=U-Boot 2013.10-g75eb4bc (Jan 21 2014 - 10:35:39)MPC83XX
=> run check_ub_ver
equal

Signed-off-by: Heiko Schocher <hs@denx.de>
10 years agocommon, ubi: add ubi check volumename command
Heiko Schocher [Sat, 25 Jan 2014 06:27:11 +0000 (07:27 +0100)]
common, ubi: add ubi check volumename command

check with this ubi command, if a UBI volume with "volumename"
exists in current ubi device.

Signed-off-by: Heiko Schocher <hs@denx.de>
10 years agoboards.cfg: Delete the equivalent entries
Masahiro Yamada [Thu, 23 Jan 2014 11:09:29 +0000 (20:09 +0900)]
boards.cfg: Delete the equivalent entries

There are some entries which produce the same binaries:
 - ep8248E           is equivalent to ep8248
 - MPC8360ERDK_66    is equivalent to MPC8360ERDK
 - Adder87x/AdderUSB is equivalent to Adder
 - EVB64260_750CX    is equivalent to EVB64260

I also notice
 - Lite5200           is equivalent to icecube_5200
 - Lite5200_LOWBOOT   is equivalent to icecube_5200_LOWBOOT
 - Lite5200_LOWBOOT08 is equivalent to icecube_5200_LOWBOOT08
But I am keeping them.
(Wolfgang suggested to do so because Lite5200* are referenced
in misc documents.)

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agoboards.cfg: Place "-" in the 8th field if it is the same as 7th
Masahiro Yamada [Thu, 23 Jan 2014 11:09:28 +0000 (20:09 +0900)]
boards.cfg: Place "-" in the 8th field if it is the same as 7th

The 8th field of boards.cfg takes the form:
     <board config name>[:comma separated config options]

We should describe explicitely the 8th field only when it is necessary
to do so.
Specify "-" in the 8th field if it is the same as 7th field.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
10 years agoext4fs: Add ext4 extent cache for read operations
Ionut Nicu [Tue, 4 Feb 2014 14:48:10 +0000 (15:48 +0100)]
ext4fs: Add ext4 extent cache for read operations

In an ext4 filesystem, the inode corresponding to a file has a 60-byte
area which contains an extent header structure and up to 4 extent
structures (5 x 12 bytes).

For files that need more than 4 extents to be represented (either files
larger than 4 x 128MB = 512MB or smaller files but very fragmented),
ext4 creates extent index structures. Each extent index points to a 4KB
physical block where one extent header and additional 340 extents could
be stored.

The current u-boot ext4 code is very inefficient when it tries to load a
file which has extent indexes. For each logical file block the code will
read over and over again the same blocks of 4096 bytes from the disk.

Since the extent tree in a file is always the same, we can cache the
extent structures in memory before actually starting to read the file.

This patch creates a simple linked list of structures holding information
about all the extents used to represent a file. The list is sorted by
the logical block number (ee_block) so that we can easily find the
proper extent information for any file block.

Without this patch, a 69MB file which had just one extent index pointing
to a block with another 6 extents was read in approximately 3 minutes.
With this patch applied the same file can be read in almost 20 seconds.

Signed-off-by: Ionut Nicu <ioan.nicu.ext@nsn.com>
10 years agoSMC91111: Fix compilation warnings
Bhupesh Sharma [Wed, 5 Feb 2014 07:39:56 +0000 (13:09 +0530)]
SMC91111: Fix compilation warnings

This patch fixes the following warning messages coming out of
'drivers/net/smc91111.h' when compiled for 'vexpress_aemv8a':

warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

Currently this issue seems to surface when SMSC is compiled for 64-bit
ARMv8 platforms, so the change is protected under CONFIG_ARM64, so that
it doesn't break other existing platforms.

In addition this patch tries to fix some checkpatch errors and warnings
(others related to camel-casing and volatile usage will be addressed
by a later patch).

This fix has been tested on both ARMv8 foundation model v1 and v2.

Signed-off-by: Bhupesh Sharma <bhupesh.sharma@freescale.com>
10 years agokbuild: fix errors of 'make *tags' and 'make cscope'
Masahiro Yamada [Fri, 21 Feb 2014 06:45:11 +0000 (15:45 +0900)]
kbuild: fix errors of 'make *tags' and 'make cscope'

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reported-by: Nishanth Menon <nm@ti.com>
10 years agokbuild: a minor optimization of "make clobber"
Masahiro Yamada [Thu, 20 Feb 2014 08:50:57 +0000 (17:50 +0900)]
kbuild: a minor optimization of "make clobber"

The pattern rule "MLO*" can delete both MLO and MLO.byteswap.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years ago.gitignore: ignore boot images by pattern rule /u-boot*
Masahiro Yamada [Thu, 20 Feb 2014 08:43:07 +0000 (17:43 +0900)]
.gitignore: ignore boot images by pattern rule /u-boot*

U-Boot supports various boot images for various SoCs.
It is annoying to modify .gitignore file every time
we add/delete boot images.

Fortunately, there is a simple rule:
Those with file name prefix "u-boot" at the top directory
are all generated files.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agoFix memory commands for 64-bit platforms
York Sun [Wed, 12 Feb 2014 23:55:35 +0000 (15:55 -0800)]
Fix memory commands for 64-bit platforms

For aarch64, unsigned long is 64-bit data. Memory commands should be fixed
with u32 for 32-bit address access. To be clear, ushort is replace with
u16, u_char is replaced with u8.

Signed-off-by: York Sun <yorksun@freescale.com>
Acked-by: Wolfgang Denk <wd@denx.de>
10 years agopxe: prepend fdtdir to DTB name irrespective of source
Stephen Warren [Wed, 12 Feb 2014 21:30:04 +0000 (14:30 -0700)]
pxe: prepend fdtdir to DTB name irrespective of source

The directory name from an fdtdir directive in a PXE config file should
always be pre-pended to the DTB filename; it shouldn't matter whether
the DTB filename came from the $fdtfile environment variable, or whether
it was constructed dynamically from ${soc}-${board}.dtb. Fix the code to
always prepend the directory name.

Reported-by: Dennis Gilmore <dennis@ausil.us>
Fixes: c61d94d86035 ("pxe: implement fdtdir extlinux.conf tag")
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Dennis Gilmore <dennis@ausil.us>
Tested-by: Dennis Gilmore <dennis@ausil.us>
10 years agofix address of error message in mtest command
David Feng [Wed, 12 Feb 2014 08:10:08 +0000 (16:10 +0800)]
fix address of error message in mtest command

This patch deal with error message of mtest command.
When test failed, the mtest command will output error information
that include memory address and value. But the address field is
not correct or misleading.

Signed-off-by: David Feng <fenghua@phytium.com.cn>
10 years agocommon: Add get_effective_memsize() to memsize.c
York Sun [Tue, 11 Feb 2014 19:57:26 +0000 (11:57 -0800)]
common: Add get_effective_memsize() to memsize.c

This function has been around for powerpc. It is used for systems with
memory more than CONFIG_MAX_MEM_MAPPED. In case of non-contiguous memory,
this feature can limit U-boot to one block without going over the limit.

Signed-off-by: York Sun <yorksun@freescale.com>
Acked-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
10 years agodriver/ddr: Add 256 byte interleaving support
York Sun [Mon, 10 Feb 2014 21:59:44 +0000 (13:59 -0800)]
driver/ddr: Add 256 byte interleaving support

Freescale LayerScape SoCs support controller interleaving on 256 byte size.
This interleaving is mandoratory.

Signed-off-by: York Sun <yorksun@freescale.com>
10 years agoDriver/ddr: Add support of different DDR base address
York Sun [Mon, 10 Feb 2014 21:59:43 +0000 (13:59 -0800)]
Driver/ddr: Add support of different DDR base address

DDR base address has been the same from the view of core and DDR
controllers. This has changed for Freescale ARM-based SoCs. Controllers
setup DDR memory in a contiguous space and cores view it at separated
locations.

Signed-off-by: York Sun <yorksun@freescale.com>
10 years agodriver/ddr: Change Freescale ARM DDR driver to support both big and little endian
York Sun [Mon, 10 Feb 2014 21:59:42 +0000 (13:59 -0800)]
driver/ddr: Change Freescale ARM DDR driver to support both big and little endian

Initially it was believed the DDR controller on Freescale ARM would have
big endian. But some platform will have little endian.

Signed-off-by: York Sun <yorksun@freescale.com>
10 years agocommon: Remove invalid endianess conversion
Christian Eggers [Sat, 8 Feb 2014 18:27:45 +0000 (19:27 +0100)]
common: Remove invalid endianess conversion

do_bootm_standanlone() calls ntohl(images->ep) which is wrong because
endianess conversion has already been done:

do_bootm()
\-do_bootm_states()
  +-bootm_find_os()
  | \-images.ep = image_get_ep();
  |   \-uimage_to_cpu(hdr->ih_ep);
  \-boot_selected_os()
    \-do_bootm_standanlone()

Without this conversion the code works correctly at least on AT91SAM9G45.
On big endian systems there should be no difference after applying this
patch because uimage_to_cpu(x) and ntohl(x) both expand to 'x'.

Signed-off-by: Christian Eggers <ceggers@gmx.de>
10 years agoserial: arc: Convert to use default_serial_puts
Axel Lin [Sat, 8 Feb 2014 07:04:58 +0000 (15:04 +0800)]
serial: arc: Convert to use default_serial_puts

Use default_serial_puts() instead of duplicating the implementation.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
10 years agofs/fdos: Remove
Tom Rini [Fri, 21 Feb 2014 13:42:02 +0000 (08:42 -0500)]
fs/fdos: Remove

We have an unused FAT implementation in fs/fdos, remove.

Signed-off-by: Tom Rini <trini@ti.com>
10 years agoMerge branch 'master' of git://git.denx.de/u-boot-spi
Tom Rini [Fri, 21 Feb 2014 13:00:22 +0000 (08:00 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-spi

10 years agoarc: fix relocation for big-endian target
Alexey Brodkin [Tue, 18 Feb 2014 11:10:58 +0000 (15:10 +0400)]
arc: fix relocation for big-endian target

In case of little-endian ARC700 instructions (which may include target
address) are encoded as middle-endian. That's why it's required to swap
bytes after read and ten right before write back.

But in case of big-endian ARC700 instructions are encoded as a plain
big-endian. Thus no need for byte swapping.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Francois Bedard <fbedard@synopsys.com>
Cc: Tom Rini <trini@ti.com>
cc: Noam Camus <noamc@ezchip.com>

10 years agoaxs101: change command prompt marker to match marketing name of the board
Alexey Brodkin [Sat, 8 Feb 2014 06:30:59 +0000 (10:30 +0400)]
axs101: change command prompt marker to match marketing name of the board

Proper spelling of the boad marketing name is with upper case.
So changing it from lower case to upper case here.

Cc: Tom Rini <trini@ti.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
10 years agoaxs101: fix dw gmac instantiation for updated dw gmac driver
Alexey Brodkin [Sat, 8 Feb 2014 06:24:35 +0000 (10:24 +0400)]
axs101: fix dw gmac instantiation for updated dw gmac driver

With accepted change to DW GMAC driver -
92a190aaab3536d695c51e0739f925910eb49889 (net/designware - switch driver
to phylib usage) we need to update this board because
"designware_initialize" now accepts only 2 parameters instead of 4.

Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Tom Rini <trini@ti.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
10 years agoserial/serial_arc: switch from {read|write}l to {read|write}b accessors
Alexey Brodkin [Sat, 8 Feb 2014 06:10:02 +0000 (10:10 +0400)]
serial/serial_arc: switch from {read|write}l to {read|write}b accessors

This is required for proper functionality on big-endian targets.
Memory-mapped registres of ARC UART are not 32-bit words but 8-bit bytes
so on little-endian target either acessor (_l or _b) works fine.
On big-endian only _b accessors works as expected.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Noam Camus <noamc@ezchip.com>
Cc: Tom Rini <trini@ti.com>
10 years agoserial/serial_arc: add work-around of ISS bug
Alexey Brodkin [Sat, 8 Feb 2014 06:10:01 +0000 (10:10 +0400)]
serial/serial_arc: add work-around of ISS bug

Explanation is in in-lined comment.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Noam Camus <noamc@ezchip.com>
Cc: Tom Rini <trini@ti.com>
10 years agoMerge branch 'master' of git://git.denx.de/u-boot-arm
Tom Rini [Thu, 20 Feb 2014 17:18:59 +0000 (12:18 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-arm

10 years agoblackfin: Add <asm/clock.h> to numerous drivers
Tom Rini [Thu, 20 Feb 2014 15:14:10 +0000 (10:14 -0500)]
blackfin: Add <asm/clock.h> to numerous drivers

With d6a320d we moved some clock externs out of blackfin_local.h and
into clock.h but now need to include <asm/clock.h> in more drivers to
avoid warnings.

Cc: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Tom Rini <trini@ti.com>
10 years agodfu: mmc: fs: Fix format accepted by ext4write command
Lukasz Majewski [Thu, 20 Feb 2014 09:29:18 +0000 (10:29 +0100)]
dfu: mmc: fs: Fix format accepted by ext4write command

The commit:

"EXT4: Fix number base handling of "ext4write" command"
 SHA1: f7740f7712b8638f08b83a7e5d00bc1d6bb086a9

Cleaned up the ext4write command format.

This commit shall be regarded as a follow up, since the DFU subsystem is
using those commands for its normal operation.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
10 years agovenice2: move device tree to fix build error
Masahiro Yamada [Thu, 20 Feb 2014 08:18:42 +0000 (17:18 +0900)]
venice2: move device tree to fix build error

Commit 5ab502cb gathered all device tree sources
to arch/$(ARCH)/dts/.
So tegra124-venice2.dts also must go to arch/arm/dts directory
to build venice2 board.

(Commit 5ab502cb had been posted before venice2 board support
was merged. So an unvisible conflict happened.)

Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@ti.com>
10 years agoMerge branch 'u-boot/master' into 'u-boot-arm/master'
Albert ARIBAUD [Thu, 20 Feb 2014 12:16:05 +0000 (13:16 +0100)]
Merge branch 'u-boot/master' into 'u-boot-arm/master'

Conflicts:
Makefile
drivers/net/npe/Makefile

These two conflicts arise from commit 0b2d3f20
("ARM: NET: Remove the IXP NPE ethernet driver") and are
resolved by deleting the drivers/net/npe/Makefile file
and removing the CONFIG_IXP4XX_NPE line from Makefile.

10 years agoarc: remove "hardware.h"
Alexey Brodkin [Mon, 10 Feb 2014 08:20:13 +0000 (12:20 +0400)]
arc: remove "hardware.h"

This file was only required for compilation of designware_i2c driver.
Since explicit inclusion of "hardware.h" is now removed from the driver
we may safely remove this empty header as well.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Tom Rini <trini@ti.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Vipin Kumar <vipin.kumar@st.com>
Cc: Armando Visconti <armando.visconti@st.com>
10 years agodesignware_i2c: remove inclusion of <asm/arch/hardware.h>
Alexey Brodkin [Mon, 10 Feb 2014 08:20:12 +0000 (12:20 +0400)]
designware_i2c: remove inclusion of <asm/arch/hardware.h>

As soon as all boards have their CONFIG_SYS_I2C_BASE defined in
configuration files instead of "asm/arch/hardware.h" it's safe to remove
the inclusion in question and make driver platform-independent.

Cc: Tom Rini <trini@ti.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Vipin Kumar <vipin.kumar@st.com>
Cc: Armando Visconti <armando.visconti@st.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
10 years agospear: move CONFIG_SYS_I2C_BASE from arch-spear/hardware to board configs
Alexey Brodkin [Mon, 10 Feb 2014 08:20:11 +0000 (12:20 +0400)]
spear: move CONFIG_SYS_I2C_BASE from arch-spear/hardware to board configs

Having CONFIG_SYS_I2C_BASE requires DW I2C driver to explicitly include
<arch/hardware.h> which other platforms may not have at all.

It's always good to have a driver platform-independent.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Tom Rini <trini@ti.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Vipin Kumar <vipin.kumar@st.com>
Cc: Armando Visconti <armando.visconti@st.com>
10 years agoOMAP24xx I2C: Add support for set-speed
Hannes Petermaier [Mon, 3 Feb 2014 20:22:18 +0000 (21:22 +0100)]
OMAP24xx I2C: Add support for set-speed

Adds support for set-speed on the OMAP24xx I2C Adapter.

Changes to omap24_i2c_write(...) for polling ARDY Bit from IRQ-Status.
Otherwise on a subsequent call the transfer of last byte from the
predecessor is aborted and therefore lost. For exmaple when
i2c_write(...) is followed by a i2c_setspeed(...) (which has to
deactivate and activate master for changing psc,...).

Minor cosmetical changes.

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
Cc: Heiko Schocher <hs@denx.de>
10 years agoi2c: i2c-mxs: Wait for I2C to empty queue
Marek Vasut [Thu, 6 Feb 2014 01:59:34 +0000 (02:59 +0100)]
i2c: i2c-mxs: Wait for I2C to empty queue

Make sure the I2C write queue is empty before leaving the mxs_i2c_write().
If we start and I2C write and only wait for ACK, the MXS I2C IP block may
enter next operation while still processing the write aftermath internally.
This will in turn disrupt one or more subsequent transfer(s).

A testcase for this issue is as such. This testcase is also interesting because
the first I2C_WRITE which becomes disruptive happens in the 'i2c read' command.
The 'i2c read' command first uses I2C_WRITE to send I2C address of the chip and
then uses I2C_READ to read data from the chip. After this command completes, the
'i2c probe' will use sequence of I2C_WRITE commands to probe the I2C bus. The
problem is that the first I2C_WRITE disrupted the I2C IP block operation and
this sideeffect propagates all the way to this next I2C_WRITE used by the 'i2c
probe' call. The result is the 'i2c probe' receives an ACK on I2C address 0x00,
even if this ACK was owned by the previous I2C_WRITE operation. Note that the
'i2c read' command must read from a valid I2C chip address.

Wrong:
> i2c probe
Valid chip addresses: 50 51
> i2c read 0x50 0x0.2 0x10 0x42000000
> i2c probe
Valid chip addresses: 00 50 51

With this patch
> i2c probe
Valid chip addresses: 50 51
> i2c read 0x50 0x0.2 0x10 0x42000000
> i2c probe
Valid chip addresses: 50 51

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
10 years agodesignware_i2c: Enhance DesignWare I2C driver address support
Chin Liang See [Tue, 4 Feb 2014 17:56:23 +0000 (11:56 -0600)]
designware_i2c: Enhance DesignWare I2C driver address support

Enhance the DesignWare I2C driver to support address length more
than 1 byte. This enhancement is required as some I2C slave
device such as EEPROM chip might have 16 bit address byte.

Signed-off-by: Chin Liang See <clsee@altera.com>
Acked-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Cc: Tom Rini <trini@ti.com>
cc: Armando Visconti <armando.visconti@st.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
Cc: Heiko Schocher <hs@denx.de>
10 years agoi2c, bootcount: add support for bootcounter on i2c devices
Heiko Schocher [Sat, 25 Jan 2014 06:27:13 +0000 (07:27 +0100)]
i2c, bootcount: add support for bootcounter on i2c devices

add support for bootcounter on an i2c device. And add a
README for all bootcounter options.

Signed-off-by: Heiko Schocher <hs@denx.de>
10 years agoblackfin: make i2c driver blackfin independant
Scott Jiang [Tue, 28 Jan 2014 05:53:36 +0000 (13:53 +0800)]
blackfin: make i2c driver blackfin independant

The ADI twi peripheral is not binding to Blackfin processor only.
Access i2c registers by standard io functions.
Fix coding style.

Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
10 years agoblackfin: rename bfin-twi_i2c driver to adi_i2c
Sonic Zhang [Tue, 28 Jan 2014 05:53:35 +0000 (13:53 +0800)]
blackfin: rename bfin-twi_i2c driver to adi_i2c

The ADI twi peripheral is not binding to Blackfin processor only.
Change to a generic name.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
10 years agoblackfin: add spi and i2c specific get clock functions
Sonic Zhang [Tue, 28 Jan 2014 05:53:34 +0000 (13:53 +0800)]
blackfin: add spi and i2c specific get clock functions

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
10 years agoblackfin: the sclk MHz in i2c driver should be divided by 1000 other than 1024
Sonic Zhang [Tue, 28 Jan 2014 05:53:33 +0000 (13:53 +0800)]
blackfin: the sclk MHz in i2c driver should be divided by 1000 other than 1024

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
10 years agoi2c: zynq: Add support for the second i2c controller
Michael Burr [Wed, 22 Jan 2014 08:46:08 +0000 (09:46 +0100)]
i2c: zynq: Add support for the second i2c controller

Initialize the second i2c controller.

Signed-off-by: Michael Burr <michael.burr@logicpd.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
10 years agoi2c: zynq: Support for 0-length register address
Michael Burr [Wed, 22 Jan 2014 08:46:07 +0000 (09:46 +0100)]
i2c: zynq: Support for 0-length register address

Fixed bug with alen == 0 in 'i2c_write', 'i2c_read'
Further minor corrections:
- Write 'address' register before 'data' register.
- Write 'transfer_size' register before 'address' register.

Signed-off-by: Michael Burr <michael.burr@logicpd.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
10 years agoPrepare v2014.04-rc1 v2014.04-rc1
Tom Rini [Wed, 19 Feb 2014 21:01:28 +0000 (16:01 -0500)]
Prepare v2014.04-rc1

Signed-off-by: Tom Rini <trini@ti.com>
10 years agokbuild,tegra124: add dummy obj- for Kbuild
Masahiro Yamada [Wed, 19 Feb 2014 13:26:43 +0000 (22:26 +0900)]
kbuild,tegra124: add dummy obj- for Kbuild

In Kbuild, every makefile must have non-empty obj- or obj-y.
Otherwise, built-in.o will not be created and the link stage
will fail.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agocosmetic: FIT: fix a strange comment
Masahiro Yamada [Tue, 18 Feb 2014 06:39:21 +0000 (15:39 +0900)]
cosmetic: FIT: fix a strange comment

There is a strange comment in fit_image_load().
This function can be used for loading Kernel Image, FDT
as well as ramdisk.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
10 years agoMove CONFIG_DISPLAY_CPUINFO to Makefile
Masahiro Yamada [Thu, 13 Feb 2014 09:30:27 +0000 (18:30 +0900)]
Move CONFIG_DISPLAY_CPUINFO to Makefile

If the whole code is surrounded by #ifdef(CONFIG_ ) .. #endif,
it should be moved to Makefile.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agoMove #ifdef(CONFIG_DISPLAY_CPUINFO) from caller to callee
Masahiro Yamada [Thu, 13 Feb 2014 09:30:26 +0000 (18:30 +0900)]
Move #ifdef(CONFIG_DISPLAY_CPUINFO) from caller to callee

- When CONFIG_DISPLAY_CPUINFO is not enabled,
   print_cpuinfo() should be defined as an empty function
   in a header, include/common.h

 - Remove #ifdef CONFIG_DISPLAY_CPUINFO .. #endif
   from caller, common/board_f.c and arch/arm/lib/board.c

 - Remove redundant prototypes in arch/arm/lib/board.c,
   arch/arm/include/asm/arch-am33x/sys_proto.h and
   board/nokia/rx51/rx51.h, keeping the one in include/common.h

 - Add #ifdef CONFIG_DISPLAY_CPUINFO to the func definition
   where it is missing

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agoconfigs: Delete unused CONFIG_SYS_64BIT_{VSPRINTF, STRTOUL}
Masahiro Yamada [Fri, 7 Feb 2014 08:20:52 +0000 (17:20 +0900)]
configs: Delete unused CONFIG_SYS_64BIT_{VSPRINTF, STRTOUL}

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agoconfigs: Delete obsolete macro, CONFIG_SYS_GBL_DATA_SIZE
Masahiro Yamada [Fri, 7 Feb 2014 00:23:03 +0000 (09:23 +0900)]
configs: Delete obsolete macro, CONFIG_SYS_GBL_DATA_SIZE

CONFIG_SYS_GBL_DATA_SIZE is not used any more.
The size of struct "global_data" is automatically calculated
by asm-offsets. (See lib/asm-offsets.c)

GENERATED_GBL_DATA_SIZE should be used instead of
CONFIG_SYS_GBL_DATA_SIZE.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agodts: generate multiple device tree blobs
Masahiro Yamada [Wed, 5 Feb 2014 02:28:27 +0000 (11:28 +0900)]
dts: generate multiple device tree blobs

It is convenient to have all device trees on the same SoC compiled.
It allows for later easy repackaging without the need to re-run
the make file.

  - Build device trees with the same SoC under arch/$(ARCH)/dts

  - Copy the one specified by CONFIG_DEFAULT_DEVICE_TREE or
    DEVICE_TREE=... to dts/dt.dtb

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agodts: move device tree sources to arch/$(ARCH)/dts/
Masahiro Yamada [Wed, 5 Feb 2014 02:28:26 +0000 (11:28 +0900)]
dts: move device tree sources to arch/$(ARCH)/dts/

Unlike Linux Kernel, U-Boot historically had *.dts files under
board/$(VENDOR)/dts/ and *.dtsi files under arch/$(ARCH)/dts/.

I think arch/$(ARCH)/dts dicretory is a better location
to store both *.dts and *.dtsi files.

For example, before this commit, board/xilinx/dts directory
had both Microblaze dts (microblaze-generic.dts) and
ARM dts (zynq-*.dts), which are totally unrelated.

This commit moves *.dts to arch/$(ARCH)/dts/ directories,
allowing us to describe nicely mutiple DTBs generation in the next commit.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agodts: re-write dts/Makefile more simply with Kbuild
Masahiro Yamada [Wed, 5 Feb 2014 02:28:25 +0000 (11:28 +0900)]
dts: re-write dts/Makefile more simply with Kbuild

Useful rules in scripts/Makefile.lib allows us to easily
generate a device tree blob and wrap it in assembly code.

We do not need to parse a linker script to get output format and arch.

This commit deletes ./u-boot.dtb since it is a copy of dts/dt.dtb.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agokernel-doc: fix some errors
Masahiro Yamada [Wed, 5 Feb 2014 01:52:52 +0000 (10:52 +0900)]
kernel-doc: fix some errors

- Delete fs.xml from DOCBOOKS to fix an error.
     Commit e3ff797c added fs.xml to DOCBOOKS
     but missed to add doc/DocBook/fs.tmpl.
  - Fix the location of include guard in include/linker_lists.h.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reported-by: Abraham Varricatt <abraham.varricatt@vvdntech.com>
Acked-by: Simon Glass <sjg@chromium.org>
10 years agokernel-doc: update kernel-doc related files to Linux v3.13
Masahiro Yamada [Wed, 5 Feb 2014 01:52:51 +0000 (10:52 +0900)]
kernel-doc: update kernel-doc related files to Linux v3.13

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
10 years agokernel-doc: move kernel-doc tools to scripts/
Masahiro Yamada [Wed, 5 Feb 2014 01:52:50 +0000 (10:52 +0900)]
kernel-doc: move kernel-doc tools to scripts/

tools/kernel-doc/docproc.c and tools/kernel-doc/kernel-doc are
files imported from Linux Kernel.

They originally resided under scripts/ directory in Linux Kernel.

This commit moves them to the original location.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
10 years ago.gitignore: drop include/asm from ignored file list
Masahiro Yamada [Wed, 5 Feb 2014 01:41:27 +0000 (10:41 +0900)]
.gitignore: drop include/asm from ignored file list

Commit bb02c536 stopped creaing a symbolic link include/asm.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agotools/env: cross-compile fw_printenv without setting HOSTCC
Masahiro Yamada [Tue, 4 Feb 2014 08:24:45 +0000 (17:24 +0900)]
tools/env: cross-compile fw_printenv without setting HOSTCC

fw_printenv is a program which mostly runs on the target Linux.

Before switching to Kbuild, we needed to set HOSTCC at the
command line like this:
    make HOSTCC=<your CC cross-compiler> env

Going forward we can cross compile it by specifying CROSS_COMPILE:
    make CROSS_COMPILE=<your cross-compiler prefix> env
This looks more natural.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
10 years agokbuild: Do not generate .*.su files at the top directory
Masahiro Yamada [Tue, 4 Feb 2014 08:24:44 +0000 (17:24 +0900)]
kbuild: Do not generate .*.su files at the top directory

Without this workaround, you will see a lot of ".*.su" files
at the top directory after building with a compiler
which supports "-fstack-usage" option.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agoboard: sandburst: delete FORCEBUILD
Masahiro Yamada [Tue, 4 Feb 2014 08:24:43 +0000 (17:24 +0900)]
board: sandburst: delete FORCEBUILD

We had switched to Kbuild, so we do not need to
delete sandburst board files at every build.

U-Boot conventional build system did not check the
update of command line option, -DBUILDUSER.

Kbuild can handle it nicely and re-builds object files
when command line options are changed.
(The file ".*.cmd" stores the information how the file
was generated at the previous build.)

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agokbuild: check clean source and generate Makefile for out-of-tree build
Masahiro Yamada [Tue, 4 Feb 2014 08:24:42 +0000 (17:24 +0900)]
kbuild: check clean source and generate Makefile for out-of-tree build

For out-of-tree build
  - Check if the source tree is clean
  - Create a Makefile in the output directory

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agokbuild: support simultaneous board configuration and "make all"
Masahiro Yamada [Tue, 4 Feb 2014 08:24:41 +0000 (17:24 +0900)]
kbuild: support simultaneous board configuration and "make all"

This commit fixes two problems:

[1] We could not do board configuration and "make all"
    in one command line.

For example, the following did not work as we expect:
  $ make sandbox_config all
  Configuring for sandbox board...
  make: Nothing to be done for `all'.

[2] mixed-target build did not work with -j option

For example, the following did not work:
  $ make -j8 sandbox_config u-boot
  Makefile:481: *** "System not configured - see README".  Stop.
  make: *** [u-boot] Error 2
  make: *** Waiting for unfinished jobs....
  Configuring for sandbox board...

Going forward, we can do
  $ make -j8 sandbox_config all

This is the same as
  $ make sandbox_config
  $ make -j8

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agokbuild: use scripts/Makefile.clean
Masahiro Yamada [Tue, 4 Feb 2014 08:24:40 +0000 (17:24 +0900)]
kbuild: use scripts/Makefile.clean

This commit refactors cleaning targets such as
clean, clobber, mrpropper, distclean
with scripts/Makefile.clean.

By using scripts/Makefile.clean, we can recursively descend
into subdirectories and delete generated files there.

We do not need add a big list of generated files
to the "clean" target.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agoMakefile: refactor tools-all targets
Masahiro Yamada [Tue, 4 Feb 2014 08:24:39 +0000 (17:24 +0900)]
Makefile: refactor tools-all targets

- Move "easylogo", "gdb" tagets to tools/Makefile
 - Delete "gdbtools" target (same as "gdb")

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agoMakefile: Do not pass MTD_VERSION from the top Makefile
Masahiro Yamada [Tue, 4 Feb 2014 08:24:38 +0000 (17:24 +0900)]
Makefile: Do not pass MTD_VERSION from the top Makefile

$(MTD_VERSION) is used in tools/env/Makefile

If you specify a variable at a command line like:
  $ make MTD_VERSION=old env
or specify it thru an envrionment variable like:
  $ export MTD_VERSION=old
  $ make env
it is inherited to the sub-make too.
We do not need to pass it from the top Makefile explicitely.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agokbuild: refactor Makefile and spl/Makefile more
Masahiro Yamada [Tue, 4 Feb 2014 08:24:37 +0000 (17:24 +0900)]
kbuild: refactor Makefile and spl/Makefile more

This commit refactors rules of directory descending
and defines u-boot-dirs and u-boot-all-dirs.
(We will need u-boot-all-dirs when using
scripts/Makefile.clean)

Additionally, rename LIBS-y to libs-y.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agoexamples: move api/ and standalone/ entry to examples/Makefile
Masahiro Yamada [Tue, 4 Feb 2014 08:24:36 +0000 (17:24 +0900)]
examples: move api/ and standalone/ entry to examples/Makefile

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agokbuild: change the top Makefile to more Kbuild-ish structure
Masahiro Yamada [Tue, 4 Feb 2014 08:24:35 +0000 (17:24 +0900)]
kbuild: change the top Makefile to more Kbuild-ish structure

This commit changes the top Makefile to handle various targets
nicely.
Make targets are divided into four categories:

 - mixed-targets
     We can call a configuration target and build targets
     at one command line like follows:
     $ make <board_name>_config u-boot

     They are handled one by one.

 - config targets
     <board_name>_config

 - no-dot-config-targets
     Targets we can run without board configuration such as
       clean, mrproper, distclean, TAGS, %docs, etc.

 - build targets
     The other target which need board configuration.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agoMakefile: remove a cleaning target "tidy"
Masahiro Yamada [Tue, 4 Feb 2014 08:24:34 +0000 (17:24 +0900)]
Makefile: remove a cleaning target "tidy"

Before this commit, "make tidy" did
"make clean" + delete "*.depend*" files.

But, we do not have "*.depend*" files any more,
which means "make tidy" is the same as "make clean".

This commit removes the redandant target "tidy".

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agokbuild: generate {spl, tpl}-autoconf.mk only when it is necessary
Masahiro Yamada [Tue, 4 Feb 2014 08:24:33 +0000 (17:24 +0900)]
kbuild: generate {spl, tpl}-autoconf.mk only when it is necessary

Before this commit, {spl,tpl}-autoconf.mk was always generated
at the top Makefile even if SPL(TPL) build was not selected.

This commit moves the build rule of {spl,tpl}-autoconf.mk
from the top Makefile to spl/Makefile.
It prevents unnecessary {spl,tpl}-autoconf.mk from being
generated.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agokbuild: move include directives of board configuration files
Masahiro Yamada [Tue, 4 Feb 2014 08:24:32 +0000 (17:24 +0900)]
kbuild: move include directives of board configuration files

This commit changes the location of include directives
of board configuration files.

The purpose of this change is:
 - Slim down $(TOPDIR)/config.mk
 - Prevent $(TOPDIR)/Makefile from including the same
    configuration file twice
 - Do not include include/config.mk multiple times
    because ARCH, CPU, BOARD, VENDOR, SOC are exported

Before this commit:

 - include/autoconf.mk was included from $(TOPDIR)/Makefile
   and $(TOPDIR)/config.mk
   (This means $(TOPDIR)/Makefile included include/autoconf.mk twice)

 - include/{spl,tpl}-autoconf.mk was included from $(TOPDIR)/config.mk

 - include/config.mk was included from $(TOPDIR)/Makefile
   and $(TOPDIR)/config.mk
   (This means $(TOPDIR)/Makefile included include/config.mk twice)

After this commit:

 - include/autoconf.mk is included from $(TOPDIR)/Makefile
   and $(TOPDIR)/scripts/Makefile.build

 - include/{spl,tpl}-autoconf.mk is included from $(TOPDIR)/spl/Makefile
   and $(TOPDIR)/scripts/Makefile.build

 - include/config.mk is included from $(TOPDIR)/config.mk and
   $(TOPDIR)/spl/Makefile

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agokbuild: convert some make rules to Kbuild style
Masahiro Yamada [Tue, 4 Feb 2014 08:24:31 +0000 (17:24 +0900)]
kbuild: convert some make rules to Kbuild style

We can get Kbuild-ish log style like this:
  GEN     include/autoconf.mk
  GEN     include/autoconf.mk.dep

We do not need XECHO any more.

And also change checkstack target like Linux Kernel.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agokbuild: move some lines to more suitable place
Masahiro Yamada [Tue, 4 Feb 2014 08:24:30 +0000 (17:24 +0900)]
kbuild: move some lines to more suitable place

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agokbuild: delete temporary build scripts
Masahiro Yamada [Tue, 4 Feb 2014 08:24:29 +0000 (17:24 +0900)]
kbuild: delete temporary build scripts

We had switched to Kbuild.
We do not need old build scripts any more.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agokbuild: use Linux Kernel build scripts
Masahiro Yamada [Tue, 4 Feb 2014 08:24:28 +0000 (17:24 +0900)]
kbuild: use Linux Kernel build scripts

Now we are ready to switch over to real Kbuild.

This commit disables temporary scripts:
  scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
  scripts/{Makefile.build,Makefile.host,Makefile.lib}.

This switch is triggered by the line in scripts/Kbuild.include
  -build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
  +build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj

We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.

Additionally, we need to fix compiler flags which are
locally added or removed.

In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
10 years agokbuild: import more build scripts from Linux v3.13 tag
Masahiro Yamada [Tue, 4 Feb 2014 08:24:27 +0000 (17:24 +0900)]
kbuild: import more build scripts from Linux v3.13 tag

This commit imports build scripts from Linux Kernel v3.13
as they are.

I know they include some trailing spaces
but I am intentionally keeping them untouched.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agoMakefile: rename scripts/Makefile.build to scripts/Makefile.build.tmp
Masahiro Yamada [Tue, 4 Feb 2014 08:24:26 +0000 (17:24 +0900)]
Makefile: rename scripts/Makefile.build to scripts/Makefile.build.tmp

Some build scripts including scripts/Makefile.build
will be imported from Linux Kernel in the next commit.
We need to adjust them for U-Boot in the following commits.

To make it easier for reviewers to track the modification,
this commit renames scripts/Makefile.build to
scripts/Makefile.build.tmp beforehand.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agokbuild: add dummy obj-y to create built-in.o
Masahiro Yamada [Tue, 4 Feb 2014 08:24:25 +0000 (17:24 +0900)]
kbuild: add dummy obj-y to create built-in.o

We are going to switch over to Kbuild in upcoming commits.

Each makefile must have non-empty obj- or obj-y
to generate built-in.o on Kbuild.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agokbuild: change out-of-tree build
Masahiro Yamada [Tue, 4 Feb 2014 08:24:24 +0000 (17:24 +0900)]
kbuild: change out-of-tree build

This commit changes the working directory
where the build process occurs.

Before this commit, build process occurred under the source
tree for both in-tree and out-of-tree build.

That's why we needed to add $(obj) prefix to all generated
files in makefiles like follows:
  $(obj)u-boot.bin:  $(obj)u-boot

Here, $(obj) is empty for in-tree build, whereas it points
to the output directory for out-of-tree build.

And our old build system changes the current working directory
with "make -C <sub-dir>" syntax when descending into the
sub-directories.

On the other hand, Kbuild uses a different idea
to handle out-of-tree build and directory descending.

The build process of Kbuild always occurs under the output tree.
When "O=dir/to/store/output/files" is given, the build system
changes the current working directory to that directory and
restarts the make.

Kbuild uses "make -f $(srctree)/scripts/Makefile.build obj=<sub-dir>"
syntax for descending into sub-directories.
(We can write it like "make $(obj)=<sub-dir>" with a shorthand.)
This means the current working directory is always the top
of the output directory.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
10 years agoMakefile: move some flags to examples makefiles
Masahiro Yamada [Tue, 4 Feb 2014 08:24:23 +0000 (17:24 +0900)]
Makefile: move some flags to examples makefiles

This commit moves some flags which are used
under examples/ directory only.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agoMakefile: move some flags to spl/Makefile
Masahiro Yamada [Tue, 4 Feb 2014 08:24:22 +0000 (17:24 +0900)]
Makefile: move some flags to spl/Makefile

Some flags are used for SPL (and TPL) build only.
This commit moves them from config.mk to spl/Makefile.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agoMakefile: move more stuff to top Makefile
Masahiro Yamada [Tue, 4 Feb 2014 08:24:21 +0000 (17:24 +0900)]
Makefile: move more stuff to top Makefile

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agoMakefile: refactor include path settings
Masahiro Yamada [Tue, 4 Feb 2014 08:24:20 +0000 (17:24 +0900)]
Makefile: refactor include path settings

This commit merges commonly-used header include paths
to UBOOTINCLUDE and NOSTDINC_FLAGS variables, which are placed
at the top Makefile.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
10 years agoMakefile: move more flags to the top Makefile
Masahiro Yamada [Tue, 4 Feb 2014 08:24:19 +0000 (17:24 +0900)]
Makefile: move more flags to the top Makefile

Before this commit, most of compiler flags were defined in config.mk.
But it is redundant because config.mk is included from all recursive make.

This commit moves many complier flags to the top Makefile
and export them.
And we use new vaiarables to store them:
KBUILD_CPPFLAGS, KBUILD_CFLAGS, KBUILD_AFLAGS.
This will allow us to switch more smoothly to Kbuild.

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