Commit Graph

383 Commits

Author SHA1 Message Date
Tom Rini 711b534120 Merge git://git.denx.de/u-boot-fsl-qoriq
Signed-off-by: Tom Rini <trini@konsulko.com>

Conflicts:
	include/configs/ls1021aqds.h
	include/configs/ls1021atwr.h
2016-10-12 08:29:42 -04:00
Masahiro Yamada e19b0fb485 kbuild: generate u-boot.cfg as a byproduct of include/autoconf.mk
Our build system still parses ad-hoc CONFIG options in header files
and generates include/autoconf.mk so that Makefiles can reference
them.  This gimmick was introduced in the pre-Kconfig days and will
be kept until Kconfig migration is completed.

The include/autoconf.mk is generated like follows:

  [1] Preprocess include/common.h with -DDO_DEPS_ONLY and
      retrieve macros into include/autoconf.mk.tmp
  [2] Reformat include/autoconf.mk.dep into include/autoconf.mk
      with tools/scripts/define2mk.sed script
  [3] Remove include/autoconf.mk.tmp

Here, include/autoconf.mk.tmp is similar to u-boot.cfg, which is
also generated by preprocessing include/config.h with -DDO_DEPS_ONLY.
In other words, there is much overlap among include/autoconf.mk and
u-boot.cfg build rules.

So, the idea is to split the build rule of include/autoconf.mk
into two stages.  The first preprocesses headers into u-boot.cfg.
The second parses the u-boot.cfg into include/autoconf.mk.  The
build rules of u-boot.cfg in Makefile and spl/Makefile will be gone.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-10-07 14:26:34 +00:00
Masahiro Yamada 1406992f4f kbuild: make dependencies in scripts/Makefile.autoconf more readable
I do not remember why I wrote the code like this, but let's make it
a bit more readable.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-10-07 14:26:34 +00:00
Masahiro Yamada 7b76daab47 check-config: fix wrong comment about how to build whitelist
The command suggested in this comment block is wrong; it would not
rip off CONFIG options that had already been converted to Kconfig.

Instead, we should use the scripts/build-whitelist.sh tool.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-10-07 14:26:32 +00:00
Masahiro Yamada 8bb0f7c0c5 config_whitelist: remove bogus options
These are not CONFIG options (detected by my eyes).

CONFIG_SPL_BUILD and CONFIG_TPL_BUILD are build options defined only
for building SPL and TPL, respectively.

The others are just mentioned in comment blocks.

Now, scripts/build-whitelist.sh never picks up new options.  Once
we kill these false ones, they will never revive.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-10-07 14:26:31 +00:00
Masahiro Yamada 1da33a2851 config_whitelist: sync by tool
It is a good practice to drop an option from the whitelist when we
convert it to Kconfig, but we may sometimes forget to do that.

So, it might be a good idea to sync the whitelist from time to time.

This commit was generated by:
  scripts/build-whitelist.sh

Looks like we had a bit progress...

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-10-07 14:26:31 +00:00
Masahiro Yamada 9608f43c3d build-whitelist: do not add new options to whitelist when update
If somebody adds references to new CONFIG options in source files,
they will be added in the whitelist when we sync it.  (For example,
if we run scripts/build-whitelist.sh against commit 42f7505066,
new options CONFIG_SPL_DFU_SUPPORT and CONFIG_USB_XHCI_UNIPHIER will
appear in the list.)

In order to make steady progress of Kconfig migration, we want to
only decrease whitelist options, but never increase.

So, when we update the whitelist, we should create a temporary list,
then take the intersection of the temporary one and the current one.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-10-07 14:26:30 +00:00
Lukasz Majewski 27229b2a4c scripts: Add script to extract default environment
This script looks for env_common.o object file and extracts from it default
u-boot environment, which is afterwards printed on standard output.

Usage example:
get_default_envs.sh > u-boot-env-default.txt

The generated text file can be used as input for mkenvimage.

Signed-off-by: Lukasz Majewski <l.majewski@majess.pl>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-10-06 21:00:53 -04:00
Robert P. J. Day fc0b5948e0 Various, accumulated typos collected from around the tree.
Fix various misspellings of:

 * deprecated
 * partition
 * preceding,preceded
 * preparation
 * its versus it's
 * export
 * existing
 * scenario
 * redundant
 * remaining
 * value
 * architecture

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Reviewed-by: Jagan Teki <jteki@openedev.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2016-10-06 20:57:40 -04:00
York Sun fb2bf8c2c6 arm: Move FSL_LSCH2 FSL_LSCH3 to Kconfig
Move these options to Kconfig and create a sub-menu to avoid name
conflict with other architectures.

Signed-off-by: York Sun <york.sun@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-10-06 09:59:10 -07:00
B, Ravi bc5dbcb918 spl: dfu: add dfu support in SPL
Traditionally the DFU support is available only
as part 2nd stage boot loader(u-boot) and DFU
is not supported in SPL.

The SPL-DFU feature is useful for boards which
does not have MMC/SD, ethernet boot mechanism
to boot the board and only has USB inteface.

This patch add DFU support in SPL with RAM
memory device support to load and execute u-boot.
And then leverage full functionality DFU in
u-boot to flash boot inital binary images to
factory or bare-metal boards to memory devices
like SPI, eMMC, MMC/SD card using USB interface.

This SPL-DFU support can be enabled through
Menuconfig->Boot Images->Enable SPL-DFU support

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-09-27 23:30:17 +02:00
Heiko Schocher 8f2fe0c86c kconfig: introduce kconfig for UBI
move the UBI config options into Kconfig.

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andrew F. Davis <afd@ti.com>
Reviewed by: Evgeni Dobrev <evgeni at studio-punkt.com>
2016-09-26 13:24:43 -04:00
Stephen Warren a6c1309782 Makefile: rm u-boot.cfg dependencies are missing
Prior to the previous patch, a freshly created .u-boot.cfg.cmd may not
correctly represent all dependencies for u-boot.cfg. The previous change
only solved this issue for fresh builds; when performing an incremental
build, the deficient .u-boot.cfg.cmd is already present, so u-boot.cfg
is not rebuilt, and hence .u-boot.cfg.cmd is not rebuilt with the correct
content.

Solve this by explicitly detecting when the dependency file .u-boot.cfg.d
has not been integrated into .u-boot.cfg.cmd, and force u-boot.cfg to be
rebuilt in this case by deleting it first. This is possible since
if_changed_dep will always delete .u-boot.cfg.d when it executes
successfully, so its presence means either that the previous build was
made by a source tree that contained a Makefile that didn't include the
previous patch, or that the build failed part way through executing
if_changed_dep for u-boot.cfg. Forcing a rebuild of u-boot.cfg is required
in the former case, and will cause no additional work in the latter case,
since the file would be rebuilt anyway for the same reason it was being
rebuilt by the previous build.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
2016-09-22 11:34:59 -04:00
Stephen Warren fcd29a4d0e Makefile: use if_change_dep for u-boot.cfg
cmd_cpp_cfg generates a dependency output, but because it's invoked using
if_changed rather than if_changed_dep, that dependency file is ignored.
This results in Kbuild not knowing about which files u-boot.cfg depends
on, so it may not be rebuilt when required.

A practical result of this is that u-boot.cfg may continue to reference
CONFIG_ options that no longer exist in the source tree, and this can
cause the adhoc config options check to fail.

This change modifies Makefile to use if_changed_dep, which in turn causes
all dependencies to be known to the next make invocation.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
2016-09-22 11:34:59 -04:00
Tom Rini 60c629b836 PowerPC: Update last users of CONFIG_ISO_STRING to Kconfig
There are a few boards that use CONFIG_ISO_STRING as part of a sanity
check during firmware update at run time.  Move this string to Kconfig.

Signed-off-by: Tom Rini <trini@konsulko.com>
2016-09-20 09:30:26 -04:00
Tom Rini adf32adb70 PowerPC: Update MIP405/MIP405T to use Kconfig better
Convert CONFIG_MIP405T from SYS_EXTRA_OPTIONS to a real config

There are two boards, MIP405 and MIP405T that have a few differences.
Start by checking for CONFIG_TARGET_MIP405.  Then introduce
CONFIG_TARGET_MIP405T and use that not CONFIG_MIP405T.  Next, convert
also convert the usage of CONFIG_ISO_STRING to be based on Kconfig.

Signed-off-by: Tom Rini <trini@konsulko.com>
2016-09-20 09:30:25 -04:00
Simon Glass 371244cb19 Makefile: Give a build error if ad-hoc CONFIG options are added
New CONFIG options should be added via Kconfig. To help prevent new ad-hoc
CONFIGs from being added, give a build error when these are detected.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2016-09-16 17:27:24 -04:00
Simon Glass eed921d923 Kconfig: Add a whitelist of ad-hoc CONFIG options
Add a list of ad-hoc CONFIG options that don't use Kconfig. This can be used
to check that new ones are not being added.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-16 17:27:24 -04:00
Simon Glass 76f1f38816 Use separate options for TPL support
At present TPL uses the same options as SPL support. In a few cases the board
config enables or disables the SPL options depending on whether
CONFIG_TPL_BUILD is defined.

With the move to Kconfig, options are determined for the whole build and
(without a hack like an #undef in a header file) cannot be controlled in this
way.

Create new TPL options for these and update users. This will allow Kconfig
conversion to proceed for these boards.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-16 17:03:39 -04:00
Maxime Ripard 716f908526 scripts: Makefile.lib: Sanitize DTB names
Having dashes as a separator in the DTB name is a quite common practice.

However, the current code to generate objects from DTBs assumes the
separator is an underscore, leading to a compilation error when building a
device tree with dashes.

Replace all the dashes in the DTB name to generate the symbols name, which
should solve this issue.

Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-08-20 11:34:59 -04:00
Joe Hershberger 63d985985e scripts: Add a cocci patch for miiphy_register
Many Ethernet drivers still use the legacy miiphy API to register their
mdio interface for access to the mdio commands.

This semantic patch will convert the drivers from the legacy adapter API
to the more modern alloc/register API.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2016-08-15 15:26:23 -05:00
Simon Glass d22199b166 dm: Don't attach the device tree to SPL with of-platdata
When of-platdata is used in SPL we don't use the device tree. So there is no
point in attaching it. Adjust the Makefile to skip attaching the device tree
when of-platdata is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-07-14 20:40:24 -06:00
Simon Glass 76bce10d21 dm: Add a more efficient libfdt library
Add a Python version of the libfdt library which contains enough features to
support the dtoc tool. This is only a very bare-bones implementation. It
requires the 'swig' to build.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-07-14 20:40:24 -06:00
Simon Glass dbbe2e6401 dm: Makefile: Build of-platdata files when the feature is enabled
Update the Makefile to call dtoc to create the C header and source files,
then build these into the image.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-07-14 20:40:24 -06:00
Simon Glass 72a7e07604 Makefile: Allow the SPL final link rule to be overridden
Overriding the final link rule is possible with U-Boot proper. It us used to
create a sandbox image links with host libraries. To build a sandbox SPL
image we need the same feature for SPL.

To support this, update the SPL link rule so sandbox can override it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-07-14 20:40:24 -06:00
Michal Simek 1a6a6e9a16 ARM64: zynq: Fix boot.bin generation for Zynq and ZynqMP
Fix boot.bin generation for Zynq and ZynqMP.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Marek Vasut <marex@denx.de>
2016-06-06 11:23:27 +02:00
Bin Meng 6683584c08 acpi: Pass -D__ASSEMBLY__ when compiling ASL files
ASL files may include various U-Boot header files, but IASL compiler
does not understand any C language embedded in these header files.
To reuse those header files for ASL compiling, use __ASSEMBLY__ in
the header files to exclude everything that is not liked by IASL.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-05-30 10:21:12 +08:00
Tom Rini ec8fb48ce9 Merge branch 'master' of git://www.denx.de/git/u-boot-microblaze 2016-05-24 08:20:43 -04:00
Michal Simek d9b58b3031 tools: zynqmpimage: Add Xilinx ZynqMP boot header generation
Add support for the zynqmpimage to mkimage.
Only basic functionality is supported without encryption and register
initialization with one partition which is filled by U-Boot SPL.
For more detail information look at Xilinx ZynqMP TRM.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-05-24 11:15:01 +02:00
Tom Rini 6d54868eeb Merge branch 'master' of git://git.denx.de/u-boot-x86 2016-05-23 18:32:47 -04:00
Tom Rini c1420f8b2b kbuild: fixdep: Check fstat(2) return value
Coverity has recently added a check that will find when we don't check
the return code from fstat(2).  Copy/paste the checking logic that
print_deps() has with an appropriate re-wording of the perror() message.

[ Linux commit : 46fe94ad18aa7ce6b3dad8c035fb538942020f2b ]

Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
2016-05-23 11:50:21 -04:00
Bin Meng bb68dd528f acpi: Quieten IASL output when 'make -s' is used
IASL compiler does not provide a command line option to turn off
its non-warning message. To quieten the output when 'make -s',
redirect its output to /dev/null.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-05-23 15:18:00 +08:00
Bin Meng 5dafcb8f7d acpi: Output all errors/warnings/remarks when compiling ASL
Remove -va option when invoking IASL compiler so that we can see
errors/warnings/remarks in the build log.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-05-23 15:18:00 +08:00
Bin Meng 8c4cc21c1f acpi: Specify U-Boot include path for ASL files
It will be much easier if we split the whole dsdt.asl file into
multiple smaller ASL parts and have access to U-Boot include files.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-05-23 15:18:00 +08:00
Bin Meng 3a2a3d0b48 acpi: Explicitly spell out dsdt.c in the make rule
Currently the make rule for dsdt.c uses a wildcard, as below:

  $(obj)/%.c:    $(src)/%.asl

To avoid any side effect, explicitly mention dsdt.c as this is
the file we intend to use for ACPI DSDT AML generation.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-05-23 15:18:00 +08:00
Bin Meng 68af8d887c acpi: Change build log for ASL files
Currently when compiling U-Boot with ASL file, the build log says:

  ASL     board/intel/bayleybay/dsdt.c

This looks odd as ASL compiler's input is ASL file, not C file.
Change the make rule to use $< instead.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-05-23 15:18:00 +08:00
Michal Simek fd2d1e0d47 kbuild: Do not append dtb for OF_EMBED case
dtb is already included in binary that's why there is no need to replace
u-boot-spl.bin with u-boot-spl-dtb.bin. This is only needed for
OF_SEPARATE is enabled. Only copy -nodtb.bin version which is straight
output from objcopy -O binary.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-05-02 18:37:11 -04:00
Simon Glass e28fcb2279 x86: Add a script to aid code conversion from coreboot
It is useful to automate the process of converting code from coreboot a
little. Add a sed script which performs some common transformations.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Bin Meng <bmeng.cn@gmail.com>
2016-03-17 10:27:23 +08:00
Masahiro Yamada 35b786780f kbuild: fix build rule of u-boot-spl.dtb
The build command of u-boot-spl.dtb is not constant, but dependent
on CONFIG_OF_SPL_REMOVE_PROPS.  Use $(call if_changed,...) so that
the change of CONFIG_OF_SPL_REMOVE_PROPS is detected.

Also, add tools/fdtgrep to the dependency to make sure u-boot-spl.dtb
is generated by the up-to-date fdtgrep in case the tool is modified.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-02-08 10:22:41 -05:00
Masahiro Yamada 514ec43892 kbuild: add missing FORCE where $(call if_changed, ) is used
FORCE is needed for $(call if_changed,...) to be evaluated every time.
Otherwise, the command is not executed when the command line has
changed but any prerequisite has not been updated.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-02-08 10:22:41 -05:00
Masahiro Yamada 8ee19a7319 kbuild: remove unneeded ifdef conditionals around build rules
These rules are only used for SOCFPGA, SUNXI, but no need to hide
them from other SoCs.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-02-08 10:22:40 -05:00
Bin Meng a187559e3d Use correct spelling of "U-Boot"
Correct spelling of "U-Boot" shall be used in all written text
(documentation, comments in source files etc.).

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
2016-02-06 12:00:59 +01:00
Simon Glass bd7dc3883b socfpga: Simplify Makefile filenames
We don't need the -dtb suffix anymore, so drop it.

Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2016-02-01 20:55:48 -05:00
Simon Glass 03c25bcd26 fdt: Build an SPL binary without device tree
At present u-boot-spl.bin holds the plain SPL binary without the device
tree. This is somewhat annoying since you need either u-boot-spl.bin or
u-boot-spl-dtb.bin depending on whether device tree is used.

Adjust the build such that u-boot-spl.bin includes a device tree
(if enabled), and the plain binary is in u-boot-spl-nodtb.bin. For now
u-boot-spl-dtb.bin remains the same.

Tested-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2016-02-01 20:55:38 -05:00
Simon Glass 30a1dcad3c Makefile: Add rules to build in .ttf files
Add rules to allow TrueType files to be compiled into U-Boot for use on
the video console.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-01-30 09:36:12 +01:00
Tom Rini 29c4d281bc kbuild: Add clang detection
Adapted from:

>From 5631d9c429857194bd55d7bcd8fa5bdd1a9899a3 Mon Sep 17 00:00:00 2001
From: Michal Marek <mmarek@suse.com>
Date: Wed, 19 Aug 2015 17:36:41 +0200
Subject: [PATCH 1/1] kbuild: Fix clang detection

We cannot detect clang before including the arch Makefile, because that
can set the default cross compiler. We also cannot detect clang after
including the arch Makefile, because powerpc wants to know about clang.
Solve this by using an deferred variable. This costs us a few shell
invocations, but this is only a constant number.

Reported-by: Behan Webster <behanw@converseincode.com>
Reported-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michal Marek <mmarek@suse.com>

in the Linux kernel.

This will allow us to make better decisions about when to run tests
later on for gcc features.

Signed-off-by: Tom Rini <trini@konsulko.com>
2016-01-25 10:39:44 -05:00
Simon Glass 72a8cf8dcc Move all command code into its own directory
There are a lot of unrelated files in common, including all of the commands.
Moving them into their own directory makes them easier to find and is more
logical.

Some commands include non-command code, such as cmd_scsi.c. This should be
sorted out at some point so that the function can be enabled with or without
the associated command.

Unfortunately, with m68k I get this error:

m68k:  +   M5329AFEE
+arch/m68k/cpu/mcf532x/start.o: In function `_start':
+arch/m68k/cpu/mcf532x/start.S:159:(.text+0x452): relocation truncated to fit: R_68K_PC16 against symbol `board_init_f' defined in .text.board_init_f section in common/built-in.o

I hope someone can shed some light on what this means. I hope it isn't
depending on the position of code in the image.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>
2016-01-25 10:39:43 -05:00
Tom Rini 5b8031ccb4 Add more SPDX-License-Identifier tags
In a number of places we had wordings of the GPL (or LGPL in a few
cases) license text that were split in such a way that it wasn't caught
previously.  Convert all of these to the correct SPDX-License-Identifier
tag.

Signed-off-by: Tom Rini <trini@konsulko.com>
2016-01-19 08:31:21 -05:00
Tom Rini f32c864938 scripts/Makefile* Add SPDX-License-Identifier tag
A general best practice for SPDX is that Makefiles should have an
identifier, add these as everything else is currently covered.

Signed-off-by: Tom Rini <trini@konsulko.com>
2016-01-19 08:31:17 -05:00
Ben Whitten 192bc6948b Fix GCC format-security errors and convert sprintfs.
With format-security errors turned on, GCC picks up the use of sprintf with
a format parameter not being a string literal.

Simple uses of sprintf are also converted to use strcpy.

Signed-off-by: Ben Whitten <ben.whitten@gmail.com>
Acked-by: Wolfgang Denk <wd@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-01-14 22:11:34 -05:00
Heiko Schocher 35729218b8 get_maintainer: fix perl 5.22/5.24 deprecated/incompatible "\C" use
from linux commit ce8155f7a3d5:

Perl 5.22 emits a deprecated message when "\C" is used in a regex.  Perl
5.24 will disallow it altogether.

Fix it by using [A-Z] instead of \C.

>From linux adapted to U-Boot by:
Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
2016-01-08 10:15:47 -05:00
Heiko Schocher d8a1a304ef checkpatch: fix left brace warning
using checkpatch with Perl 5.22.0 generates a warning,
this is fixed in linux through commit:

commit 4e5d56bdf892e18832a6540b63ebf709966bce2a
Author: Eddie Kovsky <ewk@edkovsky.org>
Date:   Wed Sep 9 15:37:52 2015 -0700

checkpatch: fix left brace warning

Using checkpatch.pl with Perl 5.22.0 generates the following warning:

Unescaped left brace in regex is deprecated, passed through in regex;

This patch fixes the warnings by escaping occurrences of the left brace
inside the regular expression.

Adapt it for U-Boot.

Signed-off-by: Heiko Schocher <hs@denx.de>
2016-01-04 12:25:29 -05:00
Nathan Rossi 08598d6ee9 ARM: zynq: Add target for building bootable SPL image for Zynq
Add a build target to generate 'boot.bin' which includes SPL. This is
used by the platforms BootROM to load SPL directly.

This change also conditionally changes what the 'boot.bin' target
generates depending on the SoC. Leaving the behaviour unchanged for the
AT91 targets.

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Andreas Bießmann <andreas.devel@googlemail.com>
Cc: Heiko Schocher <hs@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
2015-11-19 13:09:21 +01:00
Michal Simek 8d7a2b83f9 spl: Add support for CONFIG_OF_EMBED=y
CONFIG_OF_EMBED=y is the option which is here only for testing purpose
and shouldn't be enabled by default as is describe at:
"dts: Add a comment about CONFIG_OF_EMBED being for local use"
(sha1: 3d3f60cb7a)

But still enabling this option locally shouldn't end up with compilation
error when you build SPL. This patch fix it.

Compilation error:
lib/built-in.o: In function `fdtdec_setup':
/mnt/disk/u-boot/lib/fdtdec.c:1246: undefined reference to
`__dtb_dt_begin'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reported-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-11-12 18:13:21 -05:00
Andy Fleming ca746f044e Fix trini email in the get_maintainer.pl script
Looks like one spot got missed. Probably due to the backslash.

Signed-off-by: Andy Fleming <afleming@gmail.com>
2015-11-12 18:13:20 -05:00
Tom Rini da58dec866 Various Makefiles: Add SPDX-License-Identifier tags
After consulting with some of the SPDX team, the conclusion is that
Makefiles are worth adding SPDX-License-Identifier tags too, and most of
ours have one.  This adds tags to ones that lack them and converts a few
that had full (or in one case, very partial) license blobs into the
equivalent tag.

Cc: Kate Stewart <kstewart@linuxfoundation.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2015-11-10 09:19:52 -05:00
Simon Glass 021b4d117c dm: spl: Generate u-boot-spl-dtb.bin only when enabled
At present this file is generated even when device tree is not enabled in
SPL. Avoid this, since this file serves no purpose in that case.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2015-11-04 14:49:52 +01:00
Simon Glass af6bbd4dae Move board_init_f_mem() into a common location
This function will be used by both SPL and U-Boot proper. So move it into
a common place. Also change the #ifdef so that the early malloc() area is
not set up in SPL if CONFIG_SYS_SPL_MALLOC_START is defined. In that case
it would never actually be used, and just chews up stack space.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-10-24 13:50:34 -04:00
Masahiro Yamada 2fc1c80ede kbuild: fixdep: drop meaningless hash table initialization
The clear_config() is called just once at the beginning of this
program, but the global variable hashtab[] is already zero-filled
at the start-up.

[ Linux commit: d179e22762fd38414c4108acedd5feca4cf7e0d8 ]

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
2015-09-15 15:05:23 -04:00
Saket Sinha 867bcb63e7 x86: Generate a valid ACPI table
Implement write_acpi_table() to create a minimal working ACPI table.
This includes writing FACS, XSDT, RSDP, FADT, MCFG, MADT, DSDT & SSDT
ACPI table entries.

Use a Kconfig option GENERATE_ACPI_TABLE to tell U-Boot whether we need
actually write the APCI table just like we did for PIRQ routing, MP table
and SFI tables. With ACPI table existence, linux kernel gets control of
power management, thermal management, configuration management and
monitoring in hardware.

Signed-off-by: Saket Sinha <saket.sinha89@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tidied up whitespace and aligned some tabs:
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-08-26 07:54:13 -07:00
Masahiro Yamada 0f9258228e of: clean up OF_CONTROL ifdef conditionals
We have flipped CONFIG_SPL_DISABLE_OF_CONTROL.  We have cleansing
devices, $(SPL_) and CONFIG_IS_ENABLED(), so we are ready to clear
away the ugly logic in include/fdtdec.h:

 #ifdef CONFIG_OF_CONTROL
 # if defined(CONFIG_SPL_BUILD) && !defined(SPL_OF_CONTROL)
 #  define OF_CONTROL 0
 # else
 #  define OF_CONTROL 1
 # endif
 #else
 # define OF_CONTROL 0
 #endif

Now CONFIG_IS_ENABLED(OF_CONTROL) is the substitute.  It refers to
CONFIG_OF_CONTROL for U-boot proper and CONFIG_SPL_OF_CONTROL for
SPL.

Also, we no longer have to cancel CONFIG_OF_CONTROL in
include/config_uncmd_spl.h and scripts/Makefile.spl.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2015-08-18 13:46:05 -04:00
Masahiro Yamada dffb86e468 of: flip CONFIG_SPL_DISABLE_OF_CONTROL into CONFIG_SPL_OF_CONTROL
As we discussed a couple of times, negative CONFIG options make our
life difficult; CONFIG_SYS_NO_FLASH, CONFIG_SYS_DCACHE_OFF, ...
and here is another one.

Now, there are three boards enabling OF_CONTROL on SPL:
 - socfpga_arria5_defconfig
 - socfpga_cyclone5_defconfig
 - socfpga_socrates_defconfig

This commit adds CONFIG_SPL_OF_CONTROL for them and deletes
CONFIG_SPL_DISABLE_OF_CONTROL from the other boards to invert
the logic.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-08-18 13:46:04 -04:00
Masahiro Yamada 0a5804b53a dm: drop CONFIG_DM_DEVICE_REMOVE from uncmd list
We do not want to compile the DM remove code for SPL.  Currently,
we undef it in include/config_uncmd_spl.h (for C files) and in
scripts/Makefile.uncmd_spl (for Makefiles).  This is really ugly.

This commit demonstrates how we can deprecate those two files.

Use $(SPL_) for the entry in the Makfile and CONFIG_IS_ENABLED()
in C files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-08-18 13:46:04 -04:00
Masahiro Yamada d6c2ac5b75 spl: move SPL driver entries to driver/Makefile
Just preparing for upcoming cleaning.

The board-specific linker script  board/vpac270/u-boot-spl.lds
has been touched to avoid build error.  It does not change the
size of spl/u-boot-spl.bin for this board, so it should be OK.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-08-18 13:46:00 -04:00
Masahiro Yamada 8be60f06c2 linux/kconfig.h: add CPP macros useful for per-image config options
The previous commit introduced a useful macro used in makefiles,
in order to reference to different variables (CONFIG_... or
CONFIG_SPL_...) depending on the build context.

Per-image config option control is a PITA in C sources, too.
Here are some macros useful in C/CPP expressions.

CONFIG_IS_ENABLED(FOO) can be used as a shorthand for

  (!defined(CONFIG_SPL_BUILD) && defined(CONFIG_FOO)) || \
   (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_FOO))

For example, it is useful to describe C code as follows,

  #if CONFIG_IS_ENABLED(OF_CONTROL)
      (device tree code)
  #else
      (board file code)
  #endif

The ifdef conditional above is switched by CONFIG_OF_CONTROL during
the U-Boot proper building (CONFIG_SPL_BUILD is not defined), and by
CONFIG_SPL_OF_CONTROL during SPL building (CONFIG_SPL_BUILD is
defined).

The macro can be used in C context as well, so you can also write the
equivalent code as follows:

  if (CONFIG_IS_ENABLED(OF_CONTROL)) {
      (device tree code)
  } else {
      (board file code)
  }

Another useful macro is CONFIG_VALUE().
CONFIG_VALUE(FOO) is expanded into CONFIG_FOO if CONFIG_SPL_BUILD is
undefined, and into CONFIG_SPL_FOO if CONFIG_SPL_BUILD is defined.

You can write as follows:

  text_base = CONFIG_VALUE(TEXT_BASE);

instead of:

  #ifdef CONFIG_SPL_BUILD
      text_base = CONFIG_SPL_TEXT_BASE;
  #else
      text_base = CONFIG_TEXT_BASE;
  #endif

This commit also adds slight hacking on fixdep so that it can
output a correct list of fixed dependencies.

If the fixdep finds CONFIG_IS_ENABLED(FOO) in a source file,
we want
    $(wildcard include/config/foo.h)
in the U-boot proper building context, while we want
    $(wildcard include/config/spl/foo.h)
in the SPL build context.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-08-18 13:46:00 -04:00
Masahiro Yamada 04a5c40601 kbuild: add a makefile macro useful with per-image config options
Commit e02ee2548a ("kconfig: switch to single .config
configuration") made the configuration itself pretty simple,
instead, we lost the way to systematically enable/disable config
options for each image independently.

Our current strategy is, put entries into Makefile.spl for options
we need separate enabling, or once enable the options globally in
Kconfig and then undef them in Makefile.uncmd_spl if we do not want
to compile the features for SPL at all.  Things are getting really
messy.  Besides, "ifdef CONFIG_SPL_BUILD" are sprinkled everywhere
in makefiles.

This commit adds a variable to help describe makefile simpler.

$(SPL_) evaluates to "SPL_" during the SPL build, while to an empty
string during building U-boot proper.

So, you can write

  obj-$(CONFIG_$(SPL_)FOO) += foo.o

instead of

  ifdef CONFIG_SPL_BUILD
  obj-$(CONFIG_SPL_FOO) += foo.o
  else
  obj-$(CONFIG_FOO) += foo.o
  endif

If CONFIG_SPL_FOO does not exist in Kconfig, it is equivalent to

  ifndef CONFIG_SPL_BUILD
  obj-$(CONFIG_SPL_FOO) += foo.o
  endif

This is the pattern we often see in our current makefiles.

To take advantage of this macro, we should prefix SPL_ for the SPL
version of the option when we need independent control between
U-boot and SPL.  With this naming scheme, I hope our makefiles will
be much simplified.

It means we want to rename existing config options as follows
in the long run:

  CONFIG_SPL_SERIAL_SUPPORT     -> CONFIG_SPL_SERIAL
  CONFIG_SPL_I2C_SUPPORT        -> CONFIG_SPL_I2C
  CONFIG_SPL_GPIO_SUPPORT       -> CONFIG_SPL_GPIO
  CONFIG_SPL_SPI_SUPPORT        -> CONFIG_SPL_SPI
  CONFIG_SPL_DISABLE_OF_CONTROL -> CONFIG_SPL_OF_CONTROL
                                      (inverting the logic)

Then drivers/Makefile would be re-worked as follows:

  obj-$(CONFIG_$(SPL_)SERIAL)  += serial/
  obj-$(CONFIG_$(SPL_)I2C)     += i2c/
  obj-$(CONFIG_$(SPL_)GPIO)    += gpio/
  obj-$(CONFIG_$(SPL_)SPI)     += spi/
     ...

Eventually, SPL-specialized entries in Makefile.spl would go away.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-08-18 13:46:00 -04:00
Masahiro Yamada 29974f7737 kbuild: fixdep: optimize code slightly
If the target string matches "CONFIG_", move the pointer p
forward.  This saves several 7-chars adjustments.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-08-18 13:45:59 -04:00
Marek Vasut 333b7209ed Makefile: Add target for building bootable SPL image for SoCFPGA
Add build target for generating boot partition images recognised by
the SoCFPGA BootROM. The SoCFPGA BootROM expects four copies of the
u-boot-spl-dtb.sfp at the beginning of boot partition. Those are
u-boot-spl-dtb.bin augmented by a header with which the BootROM can
work. The u-boot-dtb.img uImage is appended to this to produce a
full boot partition image, the u-boot-with-spl-dtb.sfp . This is
the name of the final target.

Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08 14:14:10 +02:00
Dinh Nguyen 9bbd2132e3 driver/ddr/altera: Add DDR driver for Altera's SDRAM controller
This patch enables the SDRAM controller that is used on Altera's SoCFPGA
family. This patch configures the SDRAM controller based on a configuration
file that is generated from the Quartus tool, sdram_config.h.

Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
2015-08-08 14:14:05 +02:00
Simon Glass 3834f41720 Support removing default assembler flags
The CFLAGS_REMOVE_<file> feature allows default C compiler flags to be
removed for particular files. Add the same feature for assembler, using
AFLAGS_REMOVE_<file>.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2015-08-05 08:42:39 -06:00
Masahiro Yamada a350c6a602 kbuild: create symbolic link only for ARM, AVR32, SPARC, PowerPC, x86
The symbolic link to SoC/CPU specific header directory is created
during the build, while it is only necessary for ARM, AVR32, SPARC,
x86, and some CPUs of PowerPC.  For the other architectures, it just
results in a broken symbolic link.

Introduce CONFIG_CREATE_ARCH_SYMLINK to not create unneeded symbolic
links.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-07-27 15:02:00 -04:00
Masahiro Yamada 98bd0e0d9b kbuild: sync with Linux 4.1
Update some build scripts to match Linux 4.1.  Commit-based syncing
was done so as not to break U-Boot specific changes.
The previous big sync was from Linux 3.18-rc1 by commit 176d098277
(kbuild: sync misc scripts with Linux 3.18-rc1).

The commits imported from Linux (some with adjustments) are:

[1] commit 9fb5e5372208973984a23ee6f5f025c05d364633
    Author: Robert Richter <rrichter@cavium.com>
    dts, kbuild: Factor out dtbs install rules to Makefile.dtbinst

[2] commit 371fdc77af44f4cb32475fd499e1d912ccc30890
    Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
    kbuild: collect shorthands into scripts/Kbuild.include

[3] commit a29b82326ed4eb5567b03c85b52c6891578d5a03
    Author: Michal Marek <mmarek@suse.cz>
    kbuild: Remove duplicate $(cmd) definition in Makefile.clean

[4] commit 1846dfbde3e8a53f3673dcb1c1b79fd9b3f8d40d
    Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
    kbuild: remove redundant -rR flag of hdr-inst

[5] commit 34948e0bbf98640fc1821751b01d2f0cd17d84d5
    Author: Michal Marek <mmarek@suse.cz>
    kbuild: Drop support for clean-rule

[6] commit a16c5f99a28c9945165c46da27fff8e6f26f8736
    Author: Michal Marek <mmarek@suse.cz>
    kbuild: Fix removal of the debian/ directory

[7] commit d0d38cd9e853db11e0242b3df4c9c3c4a663fbb4
    Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
    kbuild: use mixed-targets when two or more config targets are given

[8] commit dd33c03b18b3f2db791eb6a17c37d2de66e4de18
    Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
    kbuild: fix cc-ifversion macro

[9] commit 665d92e38f65d70796aad2b8e49e42e80815d4a4
    Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
    kbuild: do not add $(call ...) to invoke cc-version or cc-fullversion

[10] commit 6dcb4e5edf39e3b65a75ca76f087b2fdbee8a808
    Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
    kbuild: allow cc-ifversion to have the argument for false condition

[11] commit c0a80c0c27e5e65b180a25e6c4c2f7ef9e386cd3
    Author: Heiko Carstens <heiko.carstens@de.ibm.com>
    ftrace: allow architectures to specify ftrace compile options

[12] commit 0b24becc810dc3be6e3f94103a866f214c282394
    Author: Andrey Ryabinin <a.ryabinin@samsung.com>
    kasan: add kernel address sanitizer infrastructure

[13] commit 4218affdf57f938c04e3a916a9685ee27079f377
    Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
    kbuild: remove warning about "make depend"

[14] commit 77479b38e2f58890eb221a0418357502a5b41cd6
    Author: Nathan Rossi <nathan.rossi@xilinx.com>
    kbuild: Create directory for target DTB

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Robert Richter <rrichter@cavium.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2015-07-27 15:01:54 -04:00
Masahiro Yamada 9b5f0b1da9 kconfig: sync with Linux 4.1
Update the files under scripts/kconfig/ to match Linux 4.1.
Some Kconfig sources have diverged from those in the kernel,
so commit-base syncing was done not to lose U-Boot specific updates.

The commits cherry-picked from Linux are:

[1] commit be8af2d54a66911693eddc556e4f7a866670082b
    Author: Bjørn Forsman <bjorn.forsman@gmail.com>
    kconfig/lxdialog: get ncurses CFLAGS with pkg-config

[2] commit 3943f42c11896ce82ad3da132c8a5630313bdd0e
    Author: Andrey Utkin <andrey.krieger.utkin@gmail.com>
    Replace mentions of "list_struct" to "list_head"

[3] commit e4e458b45c5861808674eebfea94cee2258bb2ea
    Author: Arjun Sreedharan <arjun024@gmail.com>
    calloc/xcalloc: Fix argument order

[4] commit 09950bc256e3628d275f90e016e6f5a039fbdcab
    Author: Olof Johansson <olof@lixom.net>
    merge_config.sh: Display usage if given too few arguments

[5] commit b6a2ab2cd4739a9573ed41677e53171987b8da34
    Author: Colin Ian King <colin.king@canonical.com>
    kconfig: use va_end to match corresponding va_start

[6] commit 70529b1a1784503169416df19ce3d68746401340
    Author: Michal Marek <mmarek@suse.cz>
    kconfig: Get rid of the P() macro in headers

[7] commit 463157444e377bf9b279101b1f16a94c4648c03a
    Author: Michal Marek <mmarek@suse.cz>
    kconfig: Remove dead code

[8] commit ad8d40cda3ad22ad9e8863d55a5c88f85c0173f0
    Author: Michal Marek <mmarek@suse.cz>
    kconfig: Remove unnecessary prototypes from headers

[9] commit de4619937229378e81f95e99c9866acc8e207d34
    Author: Masahiro Yamada <yamada.masahiro@socionext.com>
    kbuild: mergeconfig: fix "jobserver unavailable" warning

[10] commit b9fe99c5b994c6ddc57780993966b18899526c0b
    Author: Masahiro Yamada <yamada.masahiro@socionext.com>
    kbuild: mergeconfig: move an error check to merge_config.sh

[11] commit 371cfd4ff0611d8bc5d18bbb9cc6a2bc3d56cd3d
    Author: Masahiro Yamada <yamada.masahiro@socionext.com>
    kbuild: mergeconfig: remove redundant $(objtree)

[12] commit 3a975b8cfcbe026b535f83bde9a3c009bae214f9
    Author: Masahiro Yamada <yamada.masahiro@socionext.com>
    merge_config.sh: improve indentation

[13] commit bc8f8f5fc47cd02c2c5f3580dac2fe6695af1edd
    Author: Masahiro Yamada <yamada.masahiro@socionext.com>
    merge_config.sh: rename MAKE to RUNMAKE

[14] commit 63a91033d52e64a22e571fe84924c0b7f21c280d
    Author: Masahiro Yamada <yamada.masahiro@socionext.com>
    kbuild: add generic mergeconfig target, %.config

[15] commit 1cba0c305758c3c1786ecaceb03e142c95a4edc9
    Author: Michal Marek <mmarek@suse.cz>
    kconfig: Simplify Makefile

[16] commit 0a1f00a1c86421cc07cec87011c7cf4df68ee54b
    Author: Michal Marek <mmarek@suse.cz>
    kconfig: Do not print status messages in make -s mode

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Bjørn Forsman <bjorn.forsman@gmail.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2015-07-27 15:01:53 -04:00
Tom Rini 3c9cc70d71 Merge git://git.denx.de/u-boot-marvell 2015-07-23 09:02:28 -04:00
Stefan Roese f1df936445 arm: mvebu: Add Armada 38x DDR3 training code from Marvell bin_hdr
This patch adds the DDR3 setup and training code taken from the Marvell
U-Boot repository. This code used to be included as a binary (bin_hdr)
into the Armada A38x boot image. Not linked with the main U-Boot. With this
code addition and the serdes/PHY setup code, the Armada A38x support
in mainline U-Boot is finally self-contained. So the complete image
for booting can be built from mainline U-Boot. Without any additional
external inclusion.

Note:
This code has undergone many hours (days!) of coding-style cleanup and
refactoring. It still is not checkpatch clean though, I'm afraid. As the
factoring of the code has so many levels of indentation that many lines
are longer than 80 chars.

Signed-off-by: Stefan Roese <sr@denx.de>
2015-07-23 10:38:44 +02:00
Stefan Roese ff9112df8b arm: mvebu: drivers/ddr: Move Armada XP DDR init code into new directory
With the upcoming addition of the Armada 38x DDR support, which is not
compatible to the Armada XP DDR init code, we need to introduce a new
directory infrastructure. To support multiple Marvell DDR controller.

This will be the new structure:

     drivers/ddr/marvell/axp
     Supporting Armada XP (AXP) devices (and perhaps Armada 370)

     drivers/ddr/marvell/a38x
     Supporting Armada 38x devices (and perhaps Armada 39x)

Signed-off-by: Stefan Roese <sr@denx.de>
2015-07-23 10:38:30 +02:00
Simon Glass f26c8a8e77 dm: Add a clock uclass
Clocks are an important feature of platforms and have become increasing
complex with time. Most modern SoCs have multiple PLLs and dozens of clock
dividers which distribute clocks to on-chip peripherals.

Some SoC implementations have a clock API which is private to that SoC family,
e.g. Tegra and Exynos. This is useful but it would be better to have a
common API that can be understood and used throughout U-Boot.

Add a simple clock API as a starting point. It supports querying and setting
the rate of a clock. Each clock is a device. To reduce memory and processing
overhead the concept of peripheral clocks is provided. These do not need to
be explicit devices - it is possible to write a driver that can adjust the
I2C clock (for example) without an explicit I2C clock device. This can
dramatically reduce the number of devices (and associated overhead) in a
complex SoC.

Clocks are referenced by a number, and it is expected that SoCs will define
that numbering themselves via an enum.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-07-21 17:39:29 -06:00
Simon Glass 6c51df6859 dm: Add support for RAM drivers
Add support for a driver which sets up DRAM and can return information about
the amount of RAM available. This is a first step towards moving RAM init
to driver model.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-07-21 17:39:27 -06:00
Simon Glass 30987ef10b dm: power: Allow use of regulators in SPL
This functionality may be useful for setting up regulators early during
boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-07-21 17:39:27 -06:00
Simon Glass 5917112c9e dm: Add support for LEDs
Add a simple uclass for LEDs, so that these can be controlled by the device
tree and activated when needed. LEDs are referred to by their label.

This implementation requires a driver for each type of LED (e.g GPIO, I2C).

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-07-21 17:39:24 -06:00
Simon Glass fa78e0a371 dm: Reduce SPL device tree size
The SPL device tree size must be minimised to save memory. Only include
properties that are needed by SPL - this is determined by the presence
of the "u-boot,dm-pre-reloc" property. Also remove a predefined list of
unused properties from the nodes that remain.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-07-21 17:39:21 -06:00
Simon Glass a59abd1049 Remove SPL undefine of CONFIG_OF_CONTROL
Allow SPL to be built with this option so that we can support device tree
control. Disable the simple bus for now in SPL. It may be needed later.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-06-10 19:26:55 -06:00
Stefan Roese 20c20826ef Kconfig: Enable usage of escape char '\' in string values
I might have missed something, but I failed to use the escape char '\'
in strings. To pass a printf format string like "foo %d bar\n" via
Kconfig to the code.

Right now its not possible to use the escape character '\' in Kconfig
string values correctly to e.g. set this string value "test output\n".
The '\n' will be converted to 'n'.

The current implementation removes some of the '\' chars from the input
string in conf_set_sym_val(). Examples:

'\'	-> ''
'\\'	-> '\'
'\\\'	-> '\'
'\\\\'	-> '\\'
...

And then doubles the backslash chars in the output string in
sym_escape_string_value(). Example:

'\'	-> ''	-> ''
'\\'	-> '\'	-> '\\'
'\\\'	-> '\'	-> '\\'
'\\\\'	-> '\\'	-> '\\\\'
...

As you see in these examples, its impossible to generate a single '\'
charater in the output string as its needed for something like '\n'.

This patch now changes this behavior to not drop some backslashes in
conf_set_sym_val() and to not add new backslashes in the resulting
output string. Removing the function sym_escape_string_value()
completely as its not needed anymore.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
2015-06-08 10:45:04 -04:00
Masahiro Yamada 3113471f3a kbuild: define DO_DEPS_ONLY for u-boot.cfg to fix build error
Since 741e58e0fc (Create a .cfg file containing the CONFIG options
used to build), all the Blackfin boards fail to build if the parallel
(-j) option is passed.

  $ make -s bf506f-ezkit_defconfig
  #
  # configuration written to .config
  #
  $ make -j8 CROSS_COMPILE=bfin-elf-
  scripts/kconfig/conf --silentoldconfig Kconfig
    CHK     include/config.h
    UPD     include/config.h
    GEN     include/autoconf.mk
    GEN     include/autoconf.mk.dep
    CHK     include/config/uboot.release
    CHK     include/generated/timestamp_autogenerated.h
    UPD     include/generated/timestamp_autogenerated.h
    CFG     u-boot.cfg
  include/asm-offsets.h:3:43: fatal error:
  generated/generic-asm-offsets.h: No such file or directory
  compilation terminated.
  make: *** [u-boot.cfg] Error 1

When parsing header files for defined CONFIG options, DO_DEPS_ONLY
must be defined to exclude generated headers that might not have
been available yet.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-05-28 08:18:22 -04:00
Joe Hershberger 7740f653e6 moveconfig: Ignore duplicate configs when moving
When moving configs, it is important to know what was defined in the
config header even if it duplicates the configs coming from Kconfig.

This is specifically needed for the case where a config is set to
default 'y' in the Kconfig. This would previously cause the actual value
from the include config to be filtered out, and moveconfig.py would
think that it was 'n'... This means that the value that should be 'y'
is now (in every defconfig) set to 'not set'.

tools/moveconfig.py now defines KCONFIG_IGNORE_DUPLICATES to prevent the
filtering from happening and selecting wrong values for the defconfig.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2015-05-27 08:39:15 +09:00
Simon Glass 741e58e0fc Create a .cfg file containing the CONFIG options used to build
At present CONFIG options are split across Kconfig and board config headers
files. Also we have multiple files containing these CONFIG options.

In order to see exactly what is being used for building, create a .cfg
file which holds these options as reported by the C preprocessor.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-04-18 16:24:24 -06:00
Pavel Machek c4aaf2e0a6 fix makefiles to respect DTC setting
Top-level Makefile has option to select dtc binary, but it is ignored
due to bug in Makefile.lib. Fix it.

Signed-off-by: Pavel Machek <pavel@denx.de>
2015-04-07 08:41:10 -04:00
Masahiro Yamada 5f9eb22075 kbuild: remove scripts/multiconfig.sh
We have switched to the single .config configuration system,
the same one as used in Linux Kernel.

The necessary glue code is small enough now, so move it to the
top-level Makefile and scripts/kconfig/Makefile, and then delete
scripts/multiconfig.sh.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-03-28 09:03:08 -04:00
Masahiro Yamada 97ec89e501 kbuild: remove "*_felconfig" target
This target was added by commit cbdd9a9737 (sunxi: kconfig: Add
%_felconfig rule to enable FEL build of sunxi platforms.).

At that time, U-Boot used separate .config files for U-Boot proper
and SPL.  I understood the pain to modify both .config and
spl/.config.

Now, we have switched to single .config configuration.
It seems acceptable to run "make menuconfig" or friends to enable
CONFIG_SPL_FEL, as we do for other CONFIGs.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Ian Campbell <ijc@hellion.org.uk>
Cc: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-03-28 09:03:08 -04:00
Masahiro Yamada fc196d0e9b fixdep: remove multiple .config support code
Since commit e02ee2548a (kconfig: switch to single .config
configuration), the ".*.cmd" files are not correctly created
for SPL/TPL.  The U-Boot extension code in fixdep, which was
introduced to support the multiple .config, must be removed.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-03-05 20:50:30 -05:00
Kim Phillips a32ab4d910 scripts/checkstack.pl: update to get AArch64 port from Linux
Bring checkstack.pl up to date from its upstream Linux development.
Effectively, the following linux commits:

208ad00 checkstack.pl: port to AArch64
fda9f99 scripts/checkstack.pl: automatically handle 32-bit and 64-bit mode for ARCH=x86
7eb6e34 kbuild: trivial - remove trailing empty lines
690998b scripts/checkstack.pl: Add metag support

Reported-by: York Sun <yorksun@freescale.com>
Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
2015-03-05 11:17:53 -05:00
Masahiro Yamada cc2b49c2ba kconfig: remove unneeded U-Boot extension code
This code was introduced to support the multiple .config
configuration in U-Boot.  We do not need it any more.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2015-03-02 08:48:14 -05:00
Masahiro Yamada d648964fc2 kconfig: remove unneeded dependency on !SPL_BUILD
Now CONFIG_SPL_BUILD is not defined in Kconfig, so
"!depends on SPL_BUILD" and "if !SPL_BUILD" are redundant.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2015-02-24 17:06:27 -05:00
Masahiro Yamada e02ee2548a kconfig: switch to single .config configuration
When Kconfig for U-boot was examined, one of the biggest issues was
how to support multiple images (Normal, SPL, TPL).  There were
actually two options, "single .config" and "multiple .config".
After some discussions and thought experiments, I chose the latter,
i.e. to create ".config", "spl/.config", "tpl/.config" for Normal,
SPL, TPL, respectively.

It is true that the "multiple .config" strategy provided us the
maximum flexibility and helped to avoid duplicating CONFIGs among
Normal, SPL, TPL, but I have noticed some fatal problems:

[1] It is impossible to share CONFIG options across the images.
  If you change the configuration of Main image, you often have to
  adjust some SPL configurations correspondingly.  Currently, we
  cannot handle the dependencies between them.  It means one of the
  biggest advantages of Kconfig is lost.

[2] It is too painful to change both ".config" and "spl/.config".
  Sunxi guys started to work around this problem by creating a new
  configuration target.  Commit cbdd9a9737 (sunxi: kconfig: Add
  %_felconfig rule to enable FEL build of sunxi platforms.) added
  "make *_felconfig" to enable CONFIG_SPL_FEL on both images.
  Changing the configuration of multiple images in one command is a
  generic demand.  The current implementation cannot propose any
  good solution about this.

[3] Kconfig files are getting ugly and difficult to understand.
  Commit b724bd7d63 (dm: Kconfig: Move CONFIG_SYS_MALLOC_F_LEN to
  Kconfig) has sprinkled "if !SPL_BUILD" over the Kconfig files.

[4] The build system got more complicated than it should be.
  To adjust Linux-originated Kconfig to U-Boot, the helper script
  "scripts/multiconfig.sh" was introduced.  Writing a complicated
  text processor is a shell script sometimes caused problems.

Now I believe the "single .config" will serve us better.  With it,
all the problems above would go away.  Instead, we will have to add
some CONFIG_SPL_* (and CONFIG_TPL_*) options such as CONFIG_SPL_DM,
but we will not have much.  Anyway, this is what we do now in
scripts/Makefile.spl.

I admit my mistake with my apology and this commit switches to the
single .config configuration.

It is not so difficult to do that:

 - Remove unnecessary processings from scripts/multiconfig.sh
  This file will remain for a while to support the current defconfig
  format.  It will be removed after more cleanups are done.

 - Adjust some makefiles and Kconfigs

 - Add some entries to include/config_uncmd_spl.h and the new file
   scripts/Makefile.uncmd_spl.  Some CONFIG options that are not
   supported on SPL must be disabled because one .config is shared
   between SPL and U-Boot proper going forward.  I know this is not
   a beautiful solution and I think we can do better, but let's see
   how much we will have to describe them.

 - update doc/README.kconfig

More cleaning up patches will follow this.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-02-24 17:06:23 -05:00
Masahiro Yamada 0e7368c6c4 kbuild: prepare for moving headers into mach-*/include/mach
In U-Boot, SoC-specific headers are placed in
arch/$(ARCH)/include/asm/arch-$(SOC) and a symbolic link to that
directory is created at the early stage of the build process.

Creating and removing a symbolic link during the build is not
preferred.  In fact, Linux Kernel did away with include/asm-$(ARCH)
directories a long time time ago.

As for ARM, now it is possible to collect SoC sources into
arch/arm/mach-$(SOC).  It is also reasonable to move SoC headers
into arch/arm/mach-$(SOC)/include/mach.

This commit prepares for that.
If the directory arch/$(ARCH)/mach-$(SOC)/include/mach exists,
a symbolic to that directory is created.  Otherwise, a symbolic link
to arch/$(ARCH)/include/asm/arch-$(SOC) or arch-$(CPU) is created.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2015-02-21 08:23:52 -05:00
Simon Glass 942cb0b6a2 sunxi: Normalise FEL support
Make sunxi's FEL code fit with the normal U-Boot boot sequence instead of
creating its own. There are some #ifdefs required in start.S. Future work
will hopefully remove these.

This series is available at u-boot-dm, branch sunxi-working.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-02-16 20:15:09 +01:00
Stefan Roese 0cf47862bf scripts/Makefile.spl: Add MVEBU DDR code to SPL
Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Luka Perkov <luka.perkov@sartura.hr>
2015-02-06 17:24:54 +01:00
Masahiro Yamada 478d9372d1 scripts: add a utility to fill blank fields of doc/README.scrapyard
We are removing bunch of non-generic boards these days.

Updating doc/README.scrapyard is a really tedious task, but it can
be automated.  I hope this tool will make our life easier.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-01-14 10:58:49 -05:00
Siarhei Siamashka f0ce28e9ed sunxi: Fix CONFIG_UART0_PORT_F build and add it to menuconfig
The CONFIG_UART0_PORT_F option has been supported since
    http://git.denx.de/?p=u-boot.git;a=commit;h=ff2b47f6a9cc1025

This option is primarily useful only for low level u-boot debugging
on tablets, where normal UART0 is difficult to access and requires
device disassembly and/or soldering.

This patch now allows it to be selected from menuconfig. A dependency on
SPL_FEL is added because u-boot does not support booting from NAND yet
and also booting from SD card is impossible when a MicroSD breakout board
is plugged into the SD slot.

Additionally a compilation problem is fixed:

common/spl/built-in.o: In function `spl_mmc_load_image':
/tmp/u-boot-sunxi/common/spl/spl_mmc.c:94: undefined reference to `mmc_initialize'
/tmp/u-boot-sunxi/common/spl/spl_mmc.c:96: undefined reference to `find_mmc_device'
/tmp/u-boot-sunxi/common/spl/spl_mmc.c:104: undefined reference to `mmc_init'
scripts/Makefile.spl:206: recipe for target 'spl/u-boot-spl' failed

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-01-14 14:56:37 +01:00
Bill Pringlemeir b6b1b44586 scripts: fix binutils-version.sh for 'as' without a package.
Commit 73c25753 fixed the common issue that binutil packages (tool/organization
that packaged or built the bin-utils) are included in brackets and this may
falsely be recognized as a version.  However, some tools do not provide a
'package' and previously we add the 'Gnu assembler..' to the version.

Strip out the '(package version text)' and then look for a ##.## string.

Signed-off-by: Bill Pringlemeir <bpringlemeir@nbsps.com>
Tested-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
2015-01-08 11:00:45 -05:00
Masahiro Yamada 73c2575306 scripts: fix binutils-version.sh
The current binutils-version.sh expects the version string at the end
of the first line.  It turned out to not work with Linaro toolchain:
It has "Linaro 2014.09" at the back.

To fix this issue, let's parse the word right after the close
parenthesis.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reported-by: York Sun <yorksun@freescale.com>
Acked-by: Dirk Behme <dirk.behme@gmail.com>
2014-12-29 16:31:23 -05:00
Peter Kümmel 60cd06e13c 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>
2014-12-08 09:35:48 -05:00
Daniel Schwierzeck e19db555b4 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>
2014-12-08 09:35:45 -05:00
Daniel Schwierzeck 27e77183a1 get_maintainer.pl: fix source tree detection
get_maintainer.pl always fails with following message:
./scripts/get_maintainer.pl: The current directory does not appear to be a linux kernel source tree.

This was caused by commit:

commit 548b310c68
Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
Date:   Thu Oct 30 15:50:15 2014 +0900

    Remove the CREDITS file

    This file is not maintained these days.

    We use MAINTAINERS for the maintainership of the supported boards.
    For dead boards, we have some clues in doc/README.scrapyard and
    also imperishable history in git-log.

Remove CREDITS from source tree detection to fix this.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-12-08 09:35:41 -05:00
Simon Glass 5c30bf435f Align embedded device tree correctly
Device trees must be aligned to a 4-byte boundary. This was dropped in the
Kbuild conversion. Bring it back, and use 16-byte alignment for good
measure.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-25 06:33:58 -07:00
Tom Rini 1739564e75 Merge git://git.denx.de/u-boot-dm
Conflicts:
	drivers/serial/serial-uclass.c

Signed-off-by: Tom Rini <trini@ti.com>
2014-11-24 12:01:48 -05:00
Masahiro Yamada 167544e83a spl: fix descending condition to drivers/mtd/nand/
SPL should not reference CONFIG_CMD_NAND to decide whether or not
it should build drivers/mtd/nand.  CONFIG_CMD_NAND should be only
used to select the NAND utility command on the command parser.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-23 06:49:03 -05:00
Masahiro Yamada 165ecd26f0 kbuild: Descend into SOC directory from CPU directory
Some CPUs of some architectures have SOC directories.
At present, the build system directly descends into SOC directories
from the top Makefile, but it should generally descend into each
directory from its parent directory.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-23 06:49:02 -05:00
Simon Glass 1151651831 dm: spl: Allow driver model to be used
When enabled, set up driver model for SPL. This allows SPL to use the same
drivers as the main U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Tom Rini <trini@ti.com>
2014-11-21 08:12:55 +01:00
Heiko Schocher c001486d99 arm, at91: generate boot.bin file for all atmel SoC
generate the boot.bin file for all atmel SoC (arm920, arm926, armv7)

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
[fix subject]
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2014-11-17 08:47:16 -05:00
Masahiro Yamada 06471dfc3d kbuild: Make scripts executable
The Makefiles call the respective interpreter explicitly, but this makes
it easier to use the scripts manually.

(This commit follows commit 06ed5c2bfaca of Linux Kernel)

Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-12 13:25:42 -05:00
Masahiro Yamada 176d098277 kbuild: sync misc scripts with Linux 3.18-rc1
This commit imports some updates in misc scripts from Linux 3.18-rc1.

[1] commit cbb4d3e6510b99522719c5ef0 by Horia Geanta
scripts/kernel-doc: handle object-like macros

[2] commit 164f0d2efaaef83 by Michal Marek
kbuild: Fix handling of backslashes in *.cmd files

[3] commit 270a00963cd367214e by Randy Dunlap
scripts/kernel-doc: recognize __meminit

[4] commit a4954fd7724c0f55361eb5 by Masahiro Yamada
  kbuild: remove obj-n and lib-n handling

[5] commit 5b2389b45d1a9c12b9f by Masahiro Yamada
kbuild: simplify build, clean, modbuiltin shorthands

Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-07 16:27:07 -05:00
Masahiro Yamada ad618992f7 kconfig: sync kconfig files with Linux 3.18-rc1
This commit imports Kconfig updates from Linux 3.18-rc1.

'kvmconfig' and 'tinyconfig' help message have been commented out
since they are unavailable at least now;  in the future perhaps
we can implement 'tinyconfig' to disable most of CONFIG_CMD_* to
create a very small U-Boot image.

[1] commit 3aaefce10351 by Josh Triplett
x86, platform, kconfig: move kvmconfig functionality to a helper

[2] commit 0da1d4a0b951 by Josh Triplett
x86: Add "make tinyconfig" to configure the tiniest possible kernel

[3] commit c40724d3f381 by Brian Norris
  kconfig: lxdialog: fix spelling

[4] commit 7285996aa000 by Brian Norris
  kconfig: nconfig: fix multi-byte UTF handling

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-07 16:27:07 -05:00
Masahiro Yamada ffe29ebc07 kbuild: sync top Makefile with Linux 3.18-rc1
Since Linux 3.15, relative path feature and related fixes,
cleanups have been merged to the top Makefile.

The relative path feature looks stable enough, so let's import it
to U-Boot along with various cleanups.

Commits imported from Linux (some need adjustment) are:

[1] commit 7e1c04779efd by Michal Marek
  kbuild: Use relative path for $(objtree)

[2] commit 890676c65d69 by Michal Marek
  kbuild: Use relative path when building in the source tree

[3] commit 9da0763bdd82 by Michal Marek
  kbuild: Use relative path when building in a subdir of the source tree

[4] commit c2e28dc975ea by Michal Marek
  kbuild: Print the name of the build directory

[5] commit 066b7ed95580 by Michal Marek
  kbuild: Do not print the build directory with make -s

[6] commit 3f1d9a6cec01 by Michal Marek
  kbuild: make -s should be used with kernelrelease/kernelversion/image_name

[7] commit 7ff525712acf by Masahiro Yamada
  kbuild: fake the "Entering directory ..." message more simply

[8] commit 745a254322c8 by Masahiro Yamada
  kbuild: use $(Q) for sub-make target

[9] commit aa55c8e2f7a3 by Masahiro Yamada
  kbuild: handle C=... and M=... after entering into build directory

[10] commit ab7474ea5361 by Borislav Petkov
  Kbuild: Ignore GREP_OPTIONS env variable

To use relative path feature, tools/Makefile and scripts/Makefile.autoconf
must be tweaked.

Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-07 16:27:06 -05:00
Masahiro Yamada cb6e7b0db9 kbuild: improve multi-objs dependency and cleanups
Since Linux 3.18-rc1, Kbuild is able to handle multi-objs
dependency correctly, which also allows us futher cleanups
of some makefiles.

This commit imports those commits:

[1] commit c8589d1e9e01 by Masahiro Yamada
kbuild: handle multi-objs dependency appropriately

[2] commit 97e3226e6e98 by Masahiro Yamada
kbuild: handle the dependency of multi-objs hostprogs appropriately

[3] commit 022af62d0190 by Masahiro Yamada
kbuild: refactor script/kconfig/Makefile

[4] commit 221ecca6cafe by Masahiro Yamada
kbuild: remove redundant clean-files from scripts/kconfig/Makefile

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-07 16:27:06 -05:00
Masahiro Yamada 87e90729ea kbuild: bug fixes and cleanups of Makefile.host
This commit imports updates of scripts/Makefile.host
from Linux 3.18-rc1.

Imported commits are:

[1] commit d8d9efe22709 by Masahiro Yamada
  kbuild: fix a typo in scripts/Makefile.host

[2] commit edb950c17de0 by Masahiro Yamada
  kbuild: fix a bug of C++ host program handling

[3] commit 62e2210798ed by Masahiro Yamada
  kbuild: drop shared library support from Makefile.host

[4] commit 663935593915 by Masahiro Yamada
  kbuild: clean up scripts/Makefile.host

[5] commit 1791ff7179f6 by Masahiro Yamada
  kbuild: clean-up and bug fix of scripts/Makefile.host

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-07 16:27:06 -05:00
Ian Campbell cbdd9a9737 sunxi: kconfig: Add %_felconfig rule to enable FEL build of sunxi platforms.
$ make BOARD_felconfig
is more convenient than
    $ make BOARD_defconfig
    $ echo CONFIG_SPL_FEL=y >> .config
    $ echo CONFIG_SPL_FEL=y >> spl/.config

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-11-05 13:09:58 +01:00
Masahiro Yamada 15cfa32a22 kbuild: do not hide clang warnings during build with W=1
These lines originate in Linux;  it looks like Linux folks chose to
hide bunch of warnings reported by clang rather than fixing C code.

In U-boot, warnings are being fixed thanks to Jeroen's great efforts.
Let's stop suppressing clang warnings.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-11-04 15:01:56 -05:00
Robert P. J. Day 5699ea6d0e Correct two non-functional misspellings "overrided".
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
2014-10-27 17:54:11 -04:00
Masahiro Yamada 0732b2f96b kconfig: invoke silentoldconfig if spl, tpl/.config is updated
When spl/.config is updated by "make spl/menuconfig" or friends,
spl/include/config/auto.conf, spl/include/generated/autoconf.h
and some other files must be updated by "make silentoldconfig".

There is no hook for SPL in the top Makefile, so this commit
touches .config when spl/.config is updated to invoke silentoldconfig.
Likewise for TPL.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-10-23 13:19:13 -04:00
Masahiro Yamada 9adb6d2407 kbuild: fix a bug of the u-boot-spl link rule
cmd_u-boot-spl includes $(PLATFORM_LIBS) which changes
when CONFIG_USE_PRIVATE_GCC is updated.  The u-boot-spl image
should be re-linked if any prerequisite is newer than it
or the command line has changed.
$(call, if_changed,...) should be used instead of $(call cmd,...).

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-10-23 13:19:11 -04:00
York Sun 703a08f2b3 scripts/multiconfig.sh: Fix a typo
Fix the spelling of "configs".

Signed-off-by: York Sun <yorksun@freescale.com>
CC: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-10-10 09:44:45 -04:00
Jeroen Hofstee 16c429c9ea multiconfig.sh: replace GNU sed specific match
A SPL/TPL enabled target would was not recognized as
such by BSD sed, since it relies on a GNU extension.
Instead of or-ing just spell out both matches.

Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Acked-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-10-10 09:44:45 -04:00
Masahiro Yamada 717a23b871 kconfig: fix another bug of "make savedefconfig"
In some cases, the last lines of SPL or TPL are not output to a file.
The entries remaining in the "unmatched" variable must be flushed.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-10-10 09:44:42 -04:00
Joe Perches e3a4facdfc checkpatch: remove unnecessary + after {8,8}
Pick the following commit from Linux kernel:
commit 66cb4ee0e52ca721f609fd5eec16187189ae5fda
Author: Joe Perches <joe@perches.com>
Date:   Wed Sep 10 09:40:47 2014 +1000

checkpatch: remove unnecessary + after {8,8}

There's a useless "+" use that needs to be removed as perl 5.20 emits a
"Useless use of greediness modifier '+'" message each time it's hit.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@ti.com>
2014-09-25 09:31:24 -04:00
Masahiro Yamada 64147e564c kconfig: remove config_cmd_defaults.h
Now config_cmd_defaults.h is empty so it can be deleted safely.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-09-24 18:30:29 -04:00
Masahiro Yamada 11b5db6787 kconfig: add sanity checks for SPL configuration
For the SPL configuration, "make <dir>/<target>" is used.
Here,
  <dir> is either "spl" or "tpl"
  <target> is one of "config", "menuconfig", "xconfig", etc.

This commit adds two checks:

[1] If <dir> is given an unsupported subimage, the configuration
    should error out like this:

  $ make qpl/menuconfig
  ***
  *** "make qpl/menuconfig" is not supported.
  ***

[2] Make sure that "CONFIG_SPL" is enabled in the ".config" before
    running "make spl/menuconfig.  Otherwise, the SPL image
    is not built at all.  Having "spl/.config" makes no sense.
    In such a case, the configuration should exit with a message:

  $ make spl/menuconfig
  ***
  *** Create ".config" with "CONFIG_SPL" enabled
  *** before "make spl/menuconfig".
  ***

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Suggested-by: Simon Glass <sjg@chromium.org>
2014-09-16 12:23:59 -04:00
Masahiro Yamada 021f049597 scripts/Makefile.clean: clean also $(extra-m) and $(extra-)
This commit is a backport from Linux Kernel,
commit 9d5db8949f1ecf4019785b04d8986835d3c0e99e,
written by me.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-09-16 12:23:58 -04:00
Masahiro Yamada 8caaec6260 kconfig: show an error message when defconfig is not found
When a non-existing defconfig is specified,
display an easy-to-understand message
(fake the error message on Linux Kernel):

  $ make foo_defconfig
  ***
  *** Can't find default configuration "confis/foo_defconfig"!
  ***

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
2014-09-16 12:23:58 -04:00
Masahiro Yamada dee745bf3d kconfig: fix savedefconfig to handle TPL correctly
Since 3ff291f371
(kconfig: convert Kconfig helper script into a shell script),
"make savedefconfig" of TPL boards has not been working.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.o.rg
Acked-by: Simon Glass <sjg@chromium.org>
2014-09-16 12:23:58 -04:00
Masahiro Yamada 8dffe663a2 kconfig: fix whitespace handling bug of savedefconfig
Commit 3ff291f371
(kconfig: convert Kconfig helper script into a shell script)
introduced another regression.

Shell usually handles whitespaces as separators,
so "make saveconfig" outputs

  # CONFIG_FOO is not set

into:

  #
  CONFIG_FOO
  is
  not
  set

Whitespaces should not be treated as separators here.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-09-16 12:23:58 -04:00
Masahiro Yamada 93481b9f6b kconfig: fix savedefconfig to output empty defconfig
Commit 3ff291f371
(kconfig: convert Kconfig helper script into a shell script)
introduced a minor regression.

make alldefconfig; make savedefconfig
should create an empty 'defconfig'.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-09-16 12:23:58 -04:00
Jeroen Hofstee 1401d87b44 cc-option: also detect unsupported warnings options
By default clang will echo a warning if a warning option is
unknown. Turning warnings into errors when polling for options
also catches such cases and prevents passing arguments to the
compiler which cause warnings.

cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
cc: Tom Rini <trini@ti.com>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-09-09 13:51:00 +02:00
Masahiro Yamada d1b60d3407 README.kconfig: document backward compatibility "make *_config"
Commit 3ff291f371
(kconfig: convert Kconfig helper script into a shell script)
restored "<board>_config" target for backward compatibility.
It should be documented.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
2014-08-28 17:18:49 -04:00
Masahiro Yamada a6f47d2434 scripts: refetch scripts/setlocalversion from Linux 3.16
Now we have CONFIG_LOCALVERSION and CONFIG_LOCALVERSION_AUTO
in Kconfig so we can use scripts/setlocalversion without
any adjustment.  Copy it from Linux 3.16 as is.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-08-28 17:18:48 -04:00
Masahiro Yamada 3ff291f371 kconfig: convert Kconfig helper script into a shell script
Commit 51148790 added scripts/multiconfig.py written in Python 2
to adjust Kconfig for U-Boot.

It has been hard for Python 3 users because Python 2 and Python 3
are not compatible with each other.

We are not happy about adding a new host tool dependency
(in this case, Python version dependency) for the core build process.
After some discussion, we decided to use only basic tools.

The script may get a bit more unreadable by shell scripting,
but we believe it is worthwhile.

In addition, this commit revives "<board>_config" target that is
equivalent to "<board>_defconfig" for backwards compatibility.
It is annoying to adjust various projects which use U-Boot.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Suggested-by: Igor Grinberg <grinberg@compulab.co.il>
Tested-by: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@ti.com>
Cc: Jeroen Hofstee <jeroen@myspectrum.nl>
Cc: Stephen Warren <swarren@nvidia.com>
2014-08-22 10:41:50 -04:00
Masahiro Yamada bf52b8ae9f scripts/Lindent: import from Linux 3.16
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-08-21 12:01:29 -04:00
Masahiro Yamada 9b586031db scripts: objdiff: sync with Linux 3.16
Import scripts/objdiff improvements from Linux v3.16, which
consists of 7 commits written by me.

  commit 7fa0e6db3cedc9b70d68a4170f1352e2b1aa0f90
  scripts: objdiff: support directories for the augument of record command

  commit 8ac28bee76eec006aac5ba5c418878a607d53a9b
  scripts: objdiff: fix a comment

  commit 8b5d0f20d64f00ffd5685879f8eb3659379f5aaa
  scripts: objdiff: change the extension of disassembly from .o to .dis

  commit 18165efa8203a34d82f60a1831ea290e7304c654
  scripts: objdiff: improve path flexibility for record command

  commit 1ecc8e489abfdaa6d8d1689f7ff62fdf1adda30c
  scripts: objdiff: remove unnecessary code

  commit 5ab370e91af70d5f1b1dbaec78798a2ff236a2d5
  scripts: objdiff: direct error messages to stderr

  commit fd6e12423311697860f30d10398a0f9eb91977d2
  scripts: objdiff: get the path to .tmp_objdiff more simply

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-08-21 12:01:11 -04:00
Masahiro Yamada e773440425 kbuild: sync mixed targets handling with Linux 3.16
"make %_config all" was supported for the first time in U-Boot:
  commit 53bca5ab
  kbuild: support simultaneous board configuration and "make all"

Surprisingly it had not been working in Linux Kernel for a long time.

So I sent back the patch to the Linux Kbuild community and it was
accepted with a little code improvement, at commit 9319f453.

Now, you can do "make defconfig all" or "make %_defconfig all"
in Linux too.

This commit updates some scripts to fill the code-diff
between Linux and U-Boot.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-08-21 12:01:11 -04:00
Masahiro Yamada 6419e14492 kbuild: move extra gcc checks to scripts/Makefile.extrawarn
This commit was imported from Linux Kernel:
commit a86fe353 written by me.

W=... provides extra gcc checks.

Having such code in scripts/Makefile.build results in the same flags
being added to KBUILD_CFLAGS multiple times becuase
scripts/Makefile.build is invoked every time Kbuild descends into
the subdirectories.

Since the top Makefile is already too cluttered, this commit moves
all of extra gcc check stuff to a new file scripts/Makefile.extrawarn,
which is included from the top Makefile.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-08-21 12:01:11 -04:00
Masahiro Yamada 31e2141d5a tools, scripts: refactor error-out statements of Python scripts
In Python, sys.exit() function can also take an object other
than an integer.

If an integer is given to the argument, Python exits with the return
code of it.  If a non-integer argument is given, Python outputs it
to stderr and exits with the return code of 1.

That means,

    print >> sys.stderr, "Blah Blah"
    sys.exit(1)

is equivalent to

    sys.exit("Blah Blah")

The latter is a useful shorthand.

Note:
Some error messages in Buildman and Patman were output to stdout.
But they should go to stderr.  They are also fixed by this commit.
This is a nice side effect.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-08-21 12:01:11 -04:00
Daniel Schwierzeck 68dc8769e3 get_maintainer.pl: add support for scanning multiple MAINTAINERS files
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2014-08-09 11:17:05 -04:00
Daniel Schwierzeck ee360cd26a get_maintainer.pl: adapt to U-Boot tree
Switch core maintainer to Tom Rini. Adapt directory layout for
git tree detection.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2014-08-09 11:17:05 -04:00
Daniel Schwierzeck 92bca3981d get_maintainer.pl: import script from linux 3.15
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-08-09 11:17:05 -04:00
Masahiro Yamada 51148790f2 kconfig: switch to Kconfig
This commit enables Kconfig.
Going forward, we use Kconfig for the board configuration.
mkconfig will never be used. Nor will include/config.mk be generated.

Kconfig must be adjusted for U-Boot because our situation is
a little more complicated than Linux Kernel.
We have to generate multiple boot images (Normal, SPL, TPL)
from one source tree.
Each image needs its own configuration input.

Usage:

Run "make <board>_defconfig" to do the board configuration.

It will create the .config file and additionally spl/.config, tpl/.config
if SPL, TPL is enabled, respectively.

You can use "make config", "make menuconfig" etc. to create
a new .config or modify the existing one.

Use "make spl/config", "make spl/menuconfig" etc. for spl/.config
and do likewise for tpl/.config file.

The generic syntax of configuration targets for SPL, TPL is:

  <target_image>/<config_command>

Here, <target_image> is either 'spl' or 'tpl'
      <config_command> is 'config', 'menuconfig', 'xconfig', etc.

When the configuration is done, run "make".
(Or "make <board>_defconfig all" will do the configuration and build
in one time.)

For futher information of how Kconfig works in U-Boot,
please read the comment block of scripts/multiconfig.py.

By the way, there is another item worth remarking here:
coexistence of Kconfig and board herder files.

Prior to Kconfig, we used C headers to define a set of configs.

We expect a very long term to migrate from C headers to Kconfig.
Two different infractructure must coexist in the interim.

In our former configuration scheme, include/autoconf.mk was generated
for use in makefiles.
It is still generated under include/, spl/include/, tpl/include/ directory
for the Normal, SPL, TPL image, respectively.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-07-30 08:48:03 -04:00
Masahiro Yamada 0a9064fb47 kconfig: import Kconfig files from Linux 3.16-rc7
Import
  - scripts/kconfig/*
  - include/linux/kconfig.h
from Linux 3.16-rc7.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2014-07-30 08:47:46 -04:00
Masahiro Yamada b68a406263 scripts: add scripts/show-gnu-make to get GNU Make command name
U-Boot is expected to be built on various platforms.

We should keep in mind that the command 'make' is not always GNU Make,
while all the makefiles are written for GNU Make.

For example, on Linux, people generally do:

  make <board>_config; make

But FreeBSD folks do

  gmake <board>_config; gmake

(The command 'make' on FreeBSD is BSD Make, not GNU Make)

It is not a good idea to hard-code the command name 'make'
in MAKEALL or buildman.

They should call this helper script and get the command name
for GNU Make.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-07-29 11:48:36 -04:00
Masahiro Yamada 45765eeda2 scripts: add mailmapper, a tool to create/update mailmap file
This tool helps to create/update the mailmap file.

It runs 'git shortlog' internally and searches differently spelled author
names which share the same email address. The author name with the most
commits is asuumed to be a canonical real name. If the number of commits
from the cananonical name is equal to or greater than 'MIN_COMMITS' (=50),
the entry for the cananical name will be output. ('MIN_COMMITS' is used
here because we do not want to create a fat mailmap by adding every author
with only a few commits.)

If there exists a mailmap file specified by the mailmap.file configuration
options or '.mailmap' at the toplevel of the repository, it is used as
a base file.

The base file and the newly added entries are merged together and sorted
alphabetically (but the comment block is kept untouched), and then printed
to standard output.

 Usage
 -----

  scripts/mailmapper

prints the mailmapping to standard output.

  scripts/mailmapper > tmp; mv tmp .mailmap

will be useful for updating '.mailmap' file.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-07-22 07:44:27 -04:00
Tom Rini 39b6d07fd7 Merge branch 'master' of git://git.denx.de/u-boot-dm 2014-06-20 20:03:51 -04:00
Simon Glass 5957ac2a9f Makefile: Support include files for .dts files
Linux supports this, and if we are to have compatible device tree files,
U-Boot should also.

Avoid giving the device tree files access to U-Boot's include/ directory.
Only include/dt-bindings is accessible.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-06-20 11:55:03 -06:00
Masahiro Yamada 45f0ad9545 cosmetic: kbuild: clean-up coding style (sync with Linux 3.16-rc1)
Import the following trivial commits from Linux v3.16-rc1:

 bb66fc6 kbuild: trivial - use tabs for code indent where possible
 7eb6e34 kbuild: trivial - remove trailing empty lines
 3fbb43d kbuild: trivial - fix comment block indent
 38385f8 kbuild: trivial - remove trailing spaces

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-06-20 11:56:26 -04:00
Masahiro Yamada c71630838d kbuild: move spl/Makefile to scripts/Makefile.spl
All files under spl/ and tpl/ are generated during the build process
except spl/Makefile.

We can simplify clean-rule and git-ignore by moving spl/Makefile
to somewhere else.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-06-11 16:27:05 -04:00
Masahiro Yamada ba8dd7755e kbuild: move cmd_mkimage to scripts/Makefile.lib
Because cmd_mkimage is used in various subdirectories,
it seems reasonable to define it in scripts/Makefile.lib.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-06-05 17:01:58 -04:00
Masahiro Yamada 598e2d3388 kbuild: sync with Linux Kernel v3.15-rc1
This commit imports Kbuild-related updates
from v3.14 to v3.15-rc1.

 - commit 3d3d6b8474204b6819688c9800774d52d370a538
    kbuild: LLVMLinux: Adapt warnings for compilation with clang
 - commit 61163efae02040f66a95c8ed17f4407951ba58fa
    kbuild: LLVMLinux: Add Kbuild support for building kernel with Clang
 - commit 79192ca8ebd9a25c583aa46024a250fef1e7766f
    scripts: objdiff: detect object code changes between two commits
 - commit 1c9e70a55b088d97a59241744fe459409d0c3582
    kbuild: create a build directory automatically for out-of-tree build
 - commit a03fcb50e816a69acffb13b5e56db75063aeba8a
    kbuild: remove redundant '.*.cmd' pattern from make distclean
 - commit 13338935f1574a2dcd1c891461b0dcc42f8cff42
    kbuild: move "quote" to Kbuild.include to be consistent
 - commit bfdfaeae500a3b194b73b01e92a8034791a58b7f
    kbuild: specify build_docproc as a phony target
 - commit f4d4ffc03efc864645b990e1d579bbe1b8e358a4
    kbuild: dtbs_install: new make target
 - commit 1e64ff42ea3d8d2fc8aa71f9717b3c1cb6c2f893
    Kbuild, lto: Disable LTO for asm-offsets.c
 - commit ccbef1674a1579842c7dbdf554efca85d2cd245a
    Kbuild, lto: add ld-version and ld-ifversion macros
 - commit ae63b2d7bdd9bd66b88843be0daf8e37d8f0b574
    scripts/tags.sh: Ignore *.mod.c
 - commit e36aaea28972c57a32a3ba5365e61633739719b9
    kbuild: Fix silent builds with make-4

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-04-18 11:43:36 -04:00
Masahiro Yamada 6bd04bb487 kbuild: fix bugs in cleaning targets
"make clean", "make clobber", "make mrproper" and "make distclean"
missed to clean-up some files when they were run with
O=<some_dir> option.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reported-by: Wolfgang Denk <wd@denx.de>
2014-03-28 15:06:32 -04:00
Masahiro Yamada 026f9cf24f kbuild: improve Kbuild speed
Kbuild brought about many advantages for us but a significant
performance regression was reported by Simon Glass.

After some discussions and analysis, it turned out
its main cause is in $(call cc-option,...).

Historically, U-Boot parses all config.mk
(arch/*/config.mk and board/*/config.mk)
every time descending into subdirectories.
That means cc-options are evaluated over and over again.

$(call cc-option,...) is useful but costly.
So we want to evaluate them only in ./Makefile
and spl/Makefile and export compiler flags.

This commit changes the build system as follows:

  - Modify scripts/Makefile.build to not include config.mk
    Instead, add $(PLATFORM_CPPFLAGS) to asflags-y, ccflags-y,
    cppflags-y.

  - Export many variables
    Going forward, Kbuild will not parse config.mk files
    when it descends into subdirectories.
    If we want to set variables in config.mk and use them
    in subdirectories, they must be exported.

    This is the list of variables to get exported:
      PLATFORM_CPPFLAGS
      CPUDIR
      BOARDDIR
      OBJCOPYFLAGS
      LDFLAGS
      LDFLAGS_FINAL
        (used in nand_spl/board/*/*/Makefile)
      CONFIG_STANDALONE_LOAD_ADDR
        (used in examples/standalone/Makefile)
      SYM_PREFIX
        (used in examples/standalone/Makefile)
      RELFLAGS
        (used in examples/standalone/Makefile)

  - Delete CPPFLAGS
    This variable has been replaced with PLATFORM_CPPFLAGS

  - Copy gcclibdir from example/standalone/Makefile
    to arch/sparc/config.mk
    The reference in CONFIG_STANDALONE_LOAD_ADDR must be
    resolved before it is exported.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reported-by: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org> [on Sandbox]
Tested-by: Stephen Warren <swarren@nvidia.com> [on Tegra]
2014-03-07 10:59:06 -05:00
Tom Rini 6b9709d914 scripts: update checkpatch.pl to latest upstream version
Update to v3.14-rc4's version of checkpatch.pl.  In doing so we drop the
changes to top_of_kernel_tree() as we pass in --no-tree and drop our
changes about MAINTAINERS as that's for reporting checkpatch.pl problems
itself (and upstream has said they'll reword this section to be
clearer).

Signed-off-by: Tom Rini <trini@ti.com>
2014-03-04 12:15:30 -05:00
Tom Rini eeb72e6761 Merge branch 'master' of git://git.denx.de/u-boot-arm
Conflicts:
	arch/arm/cpu/armv7/config.mk
	board/ti/am43xx/mux.c
	include/configs/am43xx_evm.h

Signed-off-by: Tom Rini <trini@ti.com>
2014-02-26 16:49:58 -05:00
Tom Rini f503cc49a5 checkpatch.pl: Add warning for new __packed additions
While there are valid reasons to use __packed, often the answer is that
you should be doing something else here instead.

Signed-off-by: Tom Rini <trini@ti.com>
2014-02-26 21:19:29 +01:00
Masahiro Yamada 7424145f30 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>
2014-02-25 11:01:28 -05:00
Masahiro Yamada 5b1f1f4aff 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>
2014-02-25 07:51:08 -05:00
Masahiro Yamada 5ab502cb89 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>
2014-02-19 11:10:05 -05:00
Masahiro Yamada 6ab6b2afa0 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>
2014-02-19 11:10:05 -05:00
Masahiro Yamada ced032989a 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>
2014-02-19 11:10:04 -05:00
Masahiro Yamada 8fac9c7b7d 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>
2014-02-19 11:10:04 -05:00
Masahiro Yamada 9a368d0f58 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>
2014-02-19 11:10:04 -05:00
Masahiro Yamada efcf861931 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>
2014-02-19 11:10:04 -05:00
Masahiro Yamada 01072b44db 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>
2014-02-19 11:07:51 -05:00
Masahiro Yamada f2d293d0f8 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>
2014-02-19 11:07:50 -05:00
Masahiro Yamada 6825a95b0b 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>
2014-02-19 11:07:50 -05:00
Masahiro Yamada 22433fc54b 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>
2014-02-19 11:07:50 -05:00
Masahiro Yamada ec626f1139 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>
2014-02-19 11:07:50 -05:00
Masahiro Yamada 9e4140329e 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>
2014-02-19 11:07:50 -05:00
Masahiro Yamada bf4b3de101 kbuild: Use Kbuild.include
This commit adjusts some files to use Kbuild.include.

 - Use cc-option defined in Kbuild.include
    (Delete cc-option in config.mk)
 - Use cc-version defined in
    (Delete cc-version in config.mk)
 - Move binutils-version and dtc-version to Kbuild.include
     by analogy to cc-version

This commit also adds srctree (same as SRCTREE)
to use Kbuild scripts.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-19 11:07:50 -05:00
Masahiro Yamada ceec4c8746 kbuild: import Kbuild.include from linux v3.13 tag
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-19 11:07:50 -05:00
Masahiro Yamada 5651ccffa4 Makfile: move suffix rules to Makefile.build
This commit moves suffix rules from config.mk
to scripts/Makefile.build, which will allow us
to switch smoothly to real Kbuild.

Note1:
post/lib_powerpc/fpu/Makefile has
its own rule to compile C sources.
We need to tweak it to keep the same behavior.

Note2:
There are two file2 with the same name:
arch/arm/lib/crt0.S and eamples/api/crt0.S.
To keep the same build behavior,
examples/api/Makefile also has to be treaked.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-19 11:07:50 -05:00
Masahiro Yamada 4a20df395d examples: Use scripts/Makefile.build
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-19 11:07:49 -05:00
Masahiro Yamada ad71fa9971 Makefile.host.tmp: add a new script to refactor tools
This commit adds scripts/Makefile.host.tmp which will
be used in the next commit to convert makefiles
under tools/ directory to Kbuild style.

Notice this script, scripts/Makefile.host.tmp
is temporary.

When switching over to real Kbuild,
it will be replaced with scripts/Makefile.host of Linux Kernel.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-19 11:05:13 -05:00
Masahiro Yamada dd88ab325c Makefile: Move some scripts imported from Linux
We have some scripts imported from Linux Kernel:
setlocalversion, checkstack.pl, checkpatch.pl, cleanpatch

They are located under tools/ directory in U-Boot now.
But they were originally located under scripts/ directory
in Linux Kernel.

This commit moves them to the original location.

It is true that binutils-version.sh and dtc-version.sh
do not originate in Linux Kernel, but they should
be moved by analogy to gcc-version.sh.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2013-12-13 09:18:45 -05:00
Masahiro Yamada e5c5301f14 Makefile: make directories by Makefile.build
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2013-11-17 14:11:31 -05:00
Masahiro Yamada 3fdf5c8e94 Makefile: abolish COBJS, SOBJS, etc.
The support for COBJS, COBJS-y, SOBJS, SOBJS-y, GLCOBJS, GLSOBJS
from scripts/Makefile.build.
Going forward we need to use Kbuild style consistently.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2013-11-17 14:11:30 -05:00
Masahiro Yamada ac7e735322 Makefile: support descending down to subdirectories
This patch tweaks scripts/Makefile.build to allow
the build system to descend into subdirectories like Kbuild.

To use this feature, use "obj-y += foo/" syntax.

Example:
    obj-$(CONFIG_FOO) += foo/

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Simon Glass <sjg@chromium.org>
2013-10-31 13:26:44 -04:00
Masahiro Yamada ce28d7ac6d Makefile: prepare for using Kbuild-style Makefile
Every makefile in sub directories has common lines
at the top and the bottom.
This commit pushes the common parts into script/Makefile.build.

Going forward sub-makefiles only need to describe this part:

    COBJS := ...
    COBJS += ...
    SOBJS := ...

But using obj-y is preferable to prepare for switching to Kbuild.

The conventional (non-Kbuild) Makefile style is still supported.
This is achieved by greping the Makefile before entering into it.
U-Boot conventional sub makefiles always include some other makefiles.
So the build system searches a line beginning with "include" keyword
in the makefile in order to distinguish which style it is.
If the Makefile include a "include" line, we assume it is a conventional
U-Boot style. Otherwise, it is treated as a Kbuild-style makefile.

With this tweak, we can switch sub-makefiles
from U-Boot style to Kbuild style little by little.

obj-y := foo/
syntax (descending into the sub directory) is not supportd yet.
It will be implemented in the upcomming commit.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@ti.com>
2013-10-31 12:53:39 -04:00