scripts: add scripts/gnu_make to not hard-code make command

U-Boot is expected to be built on various platforms
but makefiles are written for GNU Make.

We should keep in mind that the command 'make' is not always 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.

Instead, they should call the make command via this helper script
to make sure it is GNU Make.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Series-to: uboot
Series-cc: sjg
Series-cc: trini
Series-cc: Jeroen Hofstee <jeroen@myspectrum.nl>
Cover-letter:
Do not hard-code the command name 'make' in upper-level tools

END
MAKEALL: make sure to invoke GNU Make

Since the command name 'make' is not GNU Make on some platforms
such as FreeBSD, MAKEALL should call the make via scripts/gnu_make.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
buildman: make sure to invoke GNU Make

Since the command name 'make' is not GNU Make on some platforms
such as FreeBSD, MAKEALL should call the make via scripts/gnu_make.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
zynq: disable -Wstrict-prototypes option for ps7_init.c

The files ps7_init.c and ps7_init.h are supposed to be generated by
hw projects such as Vivado, PlanAhead and then to be copied into
board/xilinx/zynq directory.

But some prototypes in them cause annoying warning messages:

  CC      spl/board/xilinx/zynq/ps7_init.o
In file included from board/xilinx/zynq/ps7_init.c:50:0:
board/xilinx/zynq/ps7_init.h:137:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.h:138:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.h:139:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.h:145:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.c:12602:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.c:12723:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.c:12742:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.c:12761:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.c:12854:6: warning: function declaration isn't a prototype [-Wstrict-prototypes]

The prototypes should be

  int ps7_init(void);
  int ps7_post_config(void);
  int ps7_debug(void);

rather than

  int ps7_init();
  int ps7_post_config();
  int ps7_debug();

We do not want to be bothered because of automatically generated files.
But we cannot touch the external projects for now.
What we can do is to disable -Wstrict-prototypes for ps7_init.c

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Tested-by: Michal Simek <michal.simek@xilinx.com>
Series-to: uboot
Series-version: 2
Series-changes: 2
   No change in code. Some changes in git-log
  - Fix a typo:  s/causes/cause/
  - Add Tested-by credit
sparc: merge LEON3 linker scripts

The linker scripts of LEON3

 - board/gaisler/grsim/u-boot.lds
 - board/gaisler/gr_cpci_ax2000/u-boot.lds
 - board/gaisler/gr_ep2s60/u-boot.lds
 - board/gaisler/gr_xc3s_1500/u-boot.lds

are the same (except cosmetic differences such as indentation).

This commit merges them into arch/sparc/cpu/leon3/u-boot.lds.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Daniel Hellstrom <daniel@gaisler.com>
Series-to: uboot
Series-cc: Daniel Hellstrom <daniel@gaisler.com>
Cover-letter:
Merge all SPARC linker scripts into a single file

In the other architecutres, the default linker scripts are placed at
arch/${ARCH}/cpu/u-boot.lds or arch/${ARCH}/cpu/${CPU}/u-boot.lds.

On the other hand, SPARC does not have arch-default linker script
but has almost the same linker scripts under each board directory.

They can be easily merged.

I built all SPARC boards and compared MD5SUM.
The same binaries are produced before/after this series.
So I am sure this clean-up is correct.

END
sparc: merge LEON2 and LEON3 linker scripts

There is only one line diff between LEON2 and LEON3 linker scripts:

  -             arch/sparc/cpu/leon2/start.o (.text)
  +             arch/sparc/cpu/leon3/start.o (.text)

They can be written in the same way:

                */start.o (.text)

So, board/gaisler/grsim_leon2/u-boot.lds
and arch/sparc/cpu/leon3/u-boot.lds
can be merged into arch/sparc/cpu/u-boot.lds.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Daniel Hellstrom <daniel@gaisler.com>
.gitignore: clean-up unnecessary entries

There have been /errlog and /reloc_off in the top level .gitignore
since commit 1b4aaffe added it about 7 years ago.

But they are no longer generated.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
sh: unify sh2/sh3/sh4 linker scripts

The linker scripts of sh2/sh3/sh4 are almost the same.
The difference among them is essentially only one line.

They can be consolidated into a single file, arch/sh/cpu/u-boot.lds
by re-writing the diffrent line as follows:

	KEEP(*/start.o	(.text))

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Series-to: uboot
Commit-notes:

I built all SuperH boards and comprared MD5SUM.
I confirmed the same output binaries are produced with/without
this patch.

END
spl: nand: read only in the size of image_header on the first access

For the same reason as in commit 50c8d66d, all the remaining
CONFIG_SYS_NAND_PAGE_SIZE in common/spl/spl_nand.c can be replaced
with sizeof(*header).

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Tim Harvey <tharvey@gateworks.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
serial: ns16550: drop CONFIG_OMAP1610 from the special case

If CONFIG_OMAP1610 is defined, the code returning the fixed value (26)
is enabled. But this case is covered by the following code.

(CONFIG_SYS_NS16550_CLK + (gd->baudrate * (MODE_X_DIV / 2))) /
    (MODE_X_DIV * gd->baudrate)
= (48000000 + (115200 * (16 / 2))) / (16 * 115200)
= 48921600 / 1843200
= 26

The "#ifdef CONFIG_OMAP1610" was added by commit 6f21347d more than
ten years ago. In those days, the divide-and-round was not used.
I guess that is why this weird code was added here.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Tom Rini <trini@ti.com>
Cc: Rishi Bhattacharya <rishi@ti.com>
Series-to: uboot
Cover-letter:
Collection of ns16550 UART driver refactoring

END
serial: ns16550: use DIV_ROUND_CLOSEST macro to compute the divisor

The function still returns the same value.

The comment block is no longer necessary because our intention is
clear enough by using DIV_ROUND_CLOSEST() macro.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
serial: ns16550: use a const variable instead of macro

Just for type checking.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Marek Vasut <marex@denx.de>
add .mailmap for proper git-shortlog output

This is the first version of .mailmap created by hand.
Please see "man git-shortlog" for what this commit is trying to do.

Without this file, for example, "git shortlog -n -s" shows as follows:

  2693  Wolfgang Denk     <------
  1002  Stefan Roese      <------
   811  wdenk             <------
   808  Mike Frysinger
   806  Simon Glass
     [snip]
   177  Matthias Fuchs
   154  stroese           <------
   153  Timur Tabi

And then, with this file, it shows as follows:

  3504  Wolfgang Denk     <------
  1156  Stefan Roese      <------
   808  Mike Frysinger
   806  Simon Glass

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Series-version: 2
Series-to: u-boot
Cover-letter:
Add .mailmap file and a tool to maintain it

END
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>
Series-changes: 2
  - Fix a typo in comments.
Update .mailmap using scripts/mailmapper

Add more entries to .mailmap for the canonical names with
50 commits or more.

This commit was generated by the following command:

  scripts/mailmapper > tmp; mv tmp .mailmap

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
omap: clean-up CONFIG_OMAP1510 ifdefs

CONFIG_OMAP1510 is not defned anywhere.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Tom Rini <trini@ti.com>
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>
Series-to: uboot
Cover-letter:
Kbuild: sync with Linux 3.16-rc1

The merge window for Linux 3.16 is closed and Linux 3.16-rc1 is out now.

During the merge window, various Kbuild-related updates were merged into
the upstream.

This series imports them to U-Boot.

END
kbuild: sync mixed targets handling with Linux 3.16-rc1

"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>
scripts: objdiff: sync with Linux 3.16-rc1

Import scripts/objdiff improvements from Linux v3.16-rc1, 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>
tools/reformat.py: refactor ignore-case option handling

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