Commit Graph

25584 Commits

Author SHA1 Message Date
Masahiro Yamada 8e71443211 kbuild: standalone: simplify clean-files
Files added $(extra-) are removed by "make clean".
Besides, wildcard "*.srec *.bin" is simpler.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
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
Gabriel Huau ec3b48201d common: fix include guards for CONFIG_MP
This was breaking the build for some boards:
MPC8536DS MPC8536DS_36BIT MPC8536DS_SDCARD MPC8536DS_SPIFLASH qemu-ppce500

Include only these features for some PPC boards if the configuration for MultiProcessor
is enabled.

Signed-off-by: Gabriel Huau <contact@huau-gabriel.fr>
Cc: Tom Rini <trini@ti.com>
Cc: York Sun <yorksun@freescale.com>
Acked-by: York Sun <yorksun@freescale.com>
2014-09-16 12:23:58 -04:00
Masahiro Yamada f458e3559b kconfig: fix a bug of "make config"
Since 3ff291f371
(kconfig: convert Kconfig helper script into a shell script),
"make config" is not working because of a missing '$' before '(Q)'.

Besides, "make config" should be invoked via scripts/multiconfig.sh
to avoid a warning message:
Kconfig:11:warning: environment variable KCONFIG_OBJDIR undefined

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 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
Masahiro Yamada 2d5db193ee standalone: use GCC_VERSION defined in compiler-gcc.h
Now GCC_VERSION is defined in include/linux/compiler-gcc.h
(with a little different definition).
Use it and delete the one in examples/standlone/stub.c.

This should work on Clang too because __GNUC__, __GNUC_MINOR__,
__GNUC_PATCHLEVEL__ are also defined on Clang.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-09-16 12:23:57 -04:00
Masahiro Yamada fb8ffd7cfc compiler*.h: sync include/linux/compiler*.h with Linux 3.16
Copy them from Linux v3.16 tag.
My main motivation of this commit is to add compiler-clang.h.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-09-16 12:23:57 -04:00
Steve Rae e6ca1ad604 implement the Android sparse image format
update to provide usable implementation to U-Boot

Signed-off-by: Steve Rae <srae@broadcom.com>
2014-09-16 12:23:57 -04:00
Steve Rae 1c39d856db cleanup code which handles the Android sparse image format
- port dprintf() to debug()
- update formatting

Signed-off-by: Steve Rae <srae@broadcom.com>
2014-09-16 12:23:57 -04:00
Steve Rae 20465c73b4 update code which handles Android sparse image format
- remove unnecessary functions

Signed-off-by: Steve Rae <srae@broadcom.com>
2014-09-16 12:23:57 -04:00
Steve Rae b4e4bbe5ab add code to handle Android sparse image format
Add original file (pristine) from :
  https://www.codeaurora.org/cgit/quic/la/kernel/lk/plain/app/aboot/aboot.c?h=master
[3b5092d20b]

Signed-off-by: Steve Rae <srae@broadcom.com>
2014-09-16 12:23:57 -04:00
Masahiro Yamada 5a8608e586 cmd_mem: add static to internally used functions
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-09-16 12:23:57 -04:00
Peng Fan f9f040b215 kgdb: Remove first_entry for kgdb
There are two ways to run into handle_exception, run command 'kgdb' and
encounter a breakpoint which triggers exception handling.

The origin source code only saves regs when first run command 'kgdb'.
Take the following for example, When run 'kgdb', regs is saved to entry_regs.
When run 'bootz', regs is not saved. However, if we set a breakpoint, then
continue. When breakpoint is reached, run `quit`, and Now return to the
instruction which follows kgdb, but not bootz.This may cause errors. So,
save regs for each handle_exception call to return to the correct place.
Example:
Target      |    Host
=>kgdb      |    (gdb)b bootz
            |    (gdb)c
=>bootz     |
            |    (gdb)Here stop because of breakpoint
            |    (gdb)q

Signed-off-by: Peng Fan <van.freenix@gmail.com>
2014-09-16 12:23:56 -04:00
Masahiro Yamada f6c8f38ec6 tools/genboardscfg.py: improve performance more with Kconfiglib
The idea of using Kconfiglib was given by Tom Rini.
It allows us to scan lots of defconfigs very quickly.
This commit also uses multiprocessing for further acceleration.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Suggested-by: Tom Rini <trini@ti.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-09-16 12:23:56 -04:00
Masahiro Yamada f219e01311 tools: Import Kconfiglib
Kconfiglib is the flexible Python Kconfig parser and library
created by Ulf Magnusson.
(https://github.com/ulfalizer/Kconfiglib)

This commit imports kconfiglib.py from
commit ce84c22e58fa59cb93679d4ead03c3cd1387965e,
with ISC SPDX-License-Identifier.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Cc: Ulf Magnusson <ulfalizer@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
2014-09-16 12:23:56 -04:00
Masahiro Yamada c25a1784d0 SPDX: Add ISC SPDX-License-Identifier
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Wolfgang Denk <wd@denx.de>
2014-09-16 12:23:56 -04:00
Masahiro Yamada 3b61297024 kbuild: force to define __UBOOT__ in all the C sources
U-Boot has imported various source files from other projects,
mostly Linux.

Something like

  #ifdef __UBOOT__
    [ modification for U-Boot ]
  #else
    [ original code ]
  #endif

is an often used strategy for clarification of adjusted parts,
that is, easier re-sync in future.

Instead of defining __UBOOT__ in each source file,
passing it from the top Makefile would be easier.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Heiko Schocher <hs@denx.de>
2014-09-16 12:23:56 -04:00
Thierry Reding 5d9f423ddb rtl8169: Defer network packet processing
When network protocol errors occur (such as a file not being found on a
TFTP server), the processing done by the NetReceive() function will end
up calling the driver's .halt() implementation. However, after that the
device no longer has access to the memory buffers and will cause errors
such as this in the rtl_recv() function when trying to hand descriptors
back to the device:

	pci_hose_bus_to_phys: invalid physical address

This can be fixed by deferring processing of network packets until the
descriptors have been handed back. That way rtl_halt() tearing down
network buffers is not going to prevent access to the buffers.

Reported-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-09-16 12:23:45 -04:00
Vasili Galka 9f680d2d97 openrisc: Fix a few type cast related warnings
Use size_t type for positive offsets instead of the loff_t type. The
later is defined as long long, which is larger than the pointer type
on OpenRISC architecture and therefore the following warning was
generated:

"warning: cast to pointer from integer of different size"

Signed-off-by: Vasili Galka <vvv444@gmail.com>
2014-09-15 13:32:56 -04:00
Vasili Galka 5d69a5d178 Fix a few printf argument verification warnings
The parameters of size_t type shall be formatted using "%zu" and not
using "%d".

Precision argument for the "%.*s" parameters shall be of int type.

Signed-off-by: Vasili Galka <vvv444@gmail.com>
2014-09-15 13:32:55 -04:00
Masahiro Yamada 2dd2cde11c cosmetic: README.scrapyard: add NIOS2 boards
Commit 70fbc461 removed obsolete PCI5441 and PK1C20 boards.
This commit adds them to README.scrapyard and also fills
some commit IDs and dates for removed boards.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Thomas Chou <thomas@wytron.com.tw>
2014-09-15 13:32:55 -04:00
Masahiro Yamada 461be2f96e kconfig: remove redundant "string" type in arch and board Kconfigs
Now the types of CONFIG_SYS_{ARCH, CPU, SOC, VENDOR, BOARD, CONFIG_NAME}
are specified in arch/Kconfig.

We can delete the ones in arch and board Kconfig files.

This commit can be easily reproduced by the following command:

find . -name Kconfig -a ! -path ./arch/Kconfig | xargs sed -i -e '
/config[[:space:]]SYS_\(ARCH\|CPU\|SOC\|\VENDOR\|BOARD\|CONFIG_NAME\)/ {
    N
    s/\n[[:space:]]*string//
}
'

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-09-13 16:43:55 -04:00
Masahiro Yamada 3174e4e812 kconfig: add CONFIG_SYS_{ARCH, CPU, ...} type def to arch/Kconfig
This commit adds the type definitions (+ help messages) of
CONFIG_SYS_{ARCH, CPU, SOC, VENDOR, BOARD, CONFIG_NAME} to arch/Kconfig,
which would save lots of type defs for taget boards.
(See also the next commit.)

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-09-13 16:43:50 -04:00
Tom Rini 8d028d404f Merge branch 'master' of git://git.denx.de/u-boot-dm 2014-09-13 16:32:52 -04:00
Tom Rini 114cc4290b Merge branch 'master' of git://git.denx.de/u-boot-arm 2014-09-12 11:27:46 -04:00
Benoît Thébaudeau a7f99bf139 arm: Fix _start for CONFIG_SYS_DV_NOR_BOOT_CFG
The boards using CONFIG_SYS_DV_NOR_BOOT_CFG (i.e. calimain,
da850evm_direct_nor and enbw_cmc) had the _start symbol defined after
the CONFIG_SYS_DV_NOR_BOOT_CFG word rather than before it in
arch/arm/lib/vectors.S. Because of that, if by lack of luck
'gd->mon_len = (ulong)&__bss_end - (ulong)_start' (see setup_mon_len())
was a multiple of 4 kiB (see reserve_uboot()), then the last BSS word
overlapped the first word of the following reserved RAM area (or went
beyond the top of RAM without such an area) after relocation because
__image_copy_start did not match _start (see relocate_code()).

This was broken by commit 41623c9 'arm: move exception handling out of
start.S files', which defined _start twice (before and after the
CONFIG_SYS_DV_NOR_BOOT_CFG word), then by commit 0a26e1d 'arm: fix a
double-definition error of _start symbol', which kept the definition of
the _start symbol after the CONFIG_SYS_DV_NOR_BOOT_CFG word. This new
commit fixes this issue by restoring the original behavior, i.e. by
defining the _start symbol before the CONFIG_SYS_DV_NOR_BOOT_CFG word.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Manfred Rudigier <manfred.rudigier@omicron.at>
Cc: Christian Riesch <christian.riesch@omicron.at>
Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Cc: Heiko Schocher <hs@denx.de>
2014-09-11 18:04:39 +02:00
Benoît Thébaudeau 58f9e1ae63 arm: Make reset position-independent
Some boards, like mx31pdk and tx25, require the beginning of the SPL
code to be position-independent. For these two boards, this is because
they use the i.MX external NAND boot, which starts by executing the
first NAND Flash page from the NFC page buffer. The SPL then needs to
copy itself to its actual link address in order to free the NFC page
buffer and use it to load the non-SPL image from Flash before running
it. This means that the SPL runtime address differs from its link
address between the reset and the initial copy performed by
board_init_f(), so this part of the SPL binary must be
position-independent.

This requirement was broken by commit 41623c9 'arm: move exception
handling out of start.S files', which used an absolute address to branch
to the reset routine. This new commit restores the original behavior,
which just performed a relative branch. This fixes the boot of mx31pdk
and tx25.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
Reported-by: Helmut Raiger <helmut.raiger@hale.at>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Magnus Lilja <lilja.magnus@gmail.com>
Cc: John Rigby <jcrigby@gmail.com>
Tested-by: Magnus Lilja <lilja.magnus@gmail.com>
2014-09-11 18:04:34 +02:00
Jeroen Hofstee 5bfdcebf73 README.clang: build command with clang
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-09-11 10:12:19 +02:00
Jeroen Hofstee b477fe44ee Makefile: default to cc for host compiler
Since the host compiler might not be gcc but e.g. clang
default to cc/c++ to invoke it.

cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
cc: Tom Rini <trini@ti.com>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-09-11 10:12:05 +02:00
Simon Glass 858530a8c0 dm: tegra: Enable driver model for serial
Use driver model for serial ports.

Since Tegra now uses driver model for serial, adjust the definition of
V_NS16550_CLK so that it is clear that this is only used for SPL.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-10 13:00:02 -06:00
Simon Glass c369139234 tegra: dts: Add serial port details
Some Tegra device tree files do not include information about the serial
ports. Add this and also add information about the input clock speed.

The console alias needs to be set up to indicate which port is used for
the console.

Also add a binding file since this is missing.

Series-changes; 5
- Add full serial port nodes from Linux tree (commit fc9d4dbe)
- Use /chosen/stdout-path instead of /aliases/console to specify the console

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-10 13:00:02 -06:00
Simon Glass 12e431b277 dm: serial: Add driver model support for ns16550
Add driver model support so that ns16550 can support operation both with
and without driver model.

The driver needs a clock frequency so cannot stand alone unfortunately. The
clock frequency must be provided by a separate driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-10 13:00:01 -06:00
Simon Glass 8bbe33c829 dm: serial: Collect common baud rate code in ns16550
The same sequence is used in several places, so move it into a function.
Note that UART_LCR_BKSE is an alias for UART_LCR_DLAB.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-10 13:00:01 -06:00
Simon Glass fa54eb1243 dm: serial: Move baud rate calculation to ns16550.c
Move the function that calculates the baud rate divisor into ns16550.c so
it can be used by that file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-10 13:00:01 -06:00
Simon Glass 2a9ae6e02f sandbox: dts: Add a serial console node
If the sandbox device tree is provided to U-Boot (with the -d flag) then it
will use the device tree version in preference to the built-in device. The
only difference is the colour.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-10 13:00:00 -06:00
Simon Glass 72e98228c3 sandbox: serial: Support a coloured console
The current sandbox serial driver is a pretty trivial example and does not
have the featues that might be needed for other board serial drivers. To
help provide a better example, add a text colour property to the device
tree for sandbox. This uses platform data, a device tree node, driver
private data and a remove() method.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-10 13:00:00 -06:00
Simon Glass 890fcefe2e sandbox: Convert serial driver to use driver model
Adjust the sandbox serial driver to use the new driver model uclass. The
driver works much as before, but within the new framework.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-10 13:00:00 -06:00
Simon Glass 57d92753d4 dm: Add a uclass for serial devices
Serial devices support simple byte input/output and a few operations to find
out whether data is available. Add a basic uclass for serial devices to be
used by drivers that are converted to driver model.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-10 13:00:00 -06:00
Simon Glass 1f359e3611 dm: Adjust lists_bind_fdt() to return the bound device
Allow the caller to find out the device that was bound in response to this
call.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-10 12:59:59 -06:00
Simon Glass aac07d49d0 dm: fdt: Add a function to look up a chosen node
Within /chosen we may have a node which points to another node, similar
to how /aliases works. Add a helper function to do this lookup.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-10 12:59:59 -06:00
Simon Glass addf9513d0 serial: Set up the 'priv' pointer when creating a serial device
The stdio_dev structure has a private pointer for its creator, but it is
not set up by the serial system. Set it to point to the serial device so
that it can be found by code called by stdio.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-10 12:59:59 -06:00
Simon Glass 2fccd2d96b tegra: Convert tegra GPIO driver to use driver model
This is an implementation of GPIOs for Tegra that uses driver model. It has
been tested on trimslice and also using the new iotrace feature.

The implementation uses a top-level GPIO device (which has no actual GPIOS).
Under this all the banks are created as separate GPIO devices.

The GPIOs are named as per the Tegra datasheet/header files: A0..A7, B0..B7,
..., Z0..Z7, AA0..AA7, etc.

Since driver model is not yet available before relocation, or in SPL, a
special function is provided for seaboard's SPL code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-10 12:59:59 -06:00
Simon Glass a47411110c dm: tegra: Set up a pre-reloc malloc()
Allocate 1KB so that driver model can operate before relocation.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-10 12:59:58 -06:00
Simon Glass 9fb02491fe dm: Make driver model available before board_init()
For some boards board_init() will change GPIOs, so we need to have driver
model available before then. Adjust the board init to arrange this, but
enable it for driver model only, just to be safe.

This does create additional #ifdef logic, but it is safer than trying to
make a pervasive change which may cause some boards to break.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-10 12:59:58 -06:00
Simon Glass 294b91a581 Set up stdio earlier when using driver model
Since driver model registers itself with the stdio subsystem, and we
want to avoid delayed registration and other complexity associated with
the current serial console, move the stdio subsystem init earlier when
driver model is used for serial.

This simplifies the implementation. Should there be any problems with
this approach they can be dealt with as boards are converted over to
use driver model for serial.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-10 12:59:58 -06:00
Simon Glass 3ea0953d36 dm: Move pre-reloc init earlier to cope with board_early_init_f()
In order to support GPIO access in board_early_init_f() we must set up
driver model before this function is called. In any case, earlier is
better since driver model is (or will become) a key function for most
init.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-10 12:59:57 -06:00
Tom Rini b7a809957b Merge branch 'master' of git://www.denx.de/git/u-boot-microblaze 2014-09-10 06:59:49 -04:00