platform/kernel/u-boot.git
8 years agoARM: at91: sama5d2: configure the L2 cache memory
Samuel Mescoff [Tue, 16 Feb 2016 08:45:06 +0000 (09:45 +0100)]
ARM: at91: sama5d2: configure the L2 cache memory

The SAMA5D2 has a second internal SRAM that can be reassigned as a L2
cache memory.
Make sure it is configured as a L2 cache memory when booting from a SPL
image.

Based on the commit b5ea95ef2b5b from the at91bootstrap repository.

Signed-off-by: Samuel Mescoff <samuel.mescoff@mobile-devices.fr>
Reviewed-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
8 years agoarm: at91: Add support for DENX MA5D4 SoM and EVK
Marek Vasut [Thu, 11 Feb 2016 13:13:38 +0000 (14:13 +0100)]
arm: at91: Add support for DENX MA5D4 SoM and EVK

Add support for DENX MA5D4 SoM and MA5D4EVK board, based on the
Atmel SAMA5D4 SoC. The SoM contains the SoC, eMMC, SPI NOR, SPI
CAN controllers and DRAM, the baseboard contains UART connectors,
ethernet port, microSD slot, LCD header, 2x CAN connector and a
lot of expansion headers.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Andreas Bießmann <andreas.devel@googlemail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
8 years agosiemens,at91: enable features for smartweb
Matthias Michel [Wed, 27 Jan 2016 14:56:07 +0000 (15:56 +0100)]
siemens,at91: enable features for smartweb

New features for smartweb:
* switch to hush command parser
* change autoboot stop to <ESC><ESC>
* allow to write ethaddr

Signed-off-by: Matthias Michel <matthias.michel@siemens.com>
Reviewed-by: Samuel Egli <samuel.egli@siemens.com>
Cc: Roger Meier <r.meier@siemens.com>
Cc: Heiko Schocher <hs@denx.de>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
8 years agoboard: atmel: clean up the PMC_PLLICPR init code
Wenyou Yang [Tue, 2 Feb 2016 04:46:14 +0000 (12:46 +0800)]
board: atmel: clean up the PMC_PLLICPR init code

Due to introducing the PMC_PLLICPR init function, use this
function to clean up the code.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
8 years agoARM: at91: clean up the PMC_PLLICPR init code
Wenyou Yang [Tue, 2 Feb 2016 04:46:13 +0000 (12:46 +0800)]
ARM: at91: clean up the PMC_PLLICPR init code

Due to introducing the PMC_PLLICPR init function, use this
function to clean up the code.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
8 years agoARM: at91: clock: add PMC_PLLICPR init function
Wenyou Yang [Tue, 2 Feb 2016 04:46:12 +0000 (12:46 +0800)]
ARM: at91: clock: add PMC_PLLICPR init function

To avoid the duplicated code, add the PMC_PLLICPR init function.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
8 years agoboard: atmel: siemens: clean up PLLB code
Wenyou Yang [Wed, 3 Feb 2016 02:20:45 +0000 (10:20 +0800)]
board: atmel: siemens: clean up PLLB code

Due to introducing the new PLLB clock handle functions,
use these functions to clean up the PLLB enable code.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
Tested-by: Heiko Schocher <hs@denx.de>
8 years agodrivers: usb: ohci-at91: clean up the PLLB code
Wenyou Yang [Wed, 3 Feb 2016 02:20:44 +0000 (10:20 +0800)]
drivers: usb: ohci-at91: clean up the PLLB code

Due to introducing the new PLLB clock handle functions,
use these functions to clean up the PLLB enable/disable code.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
Tested-by: Heiko Schocher <hs@denx.de>
8 years agoARM: at91: clock: add PLLB enable/disable functions
Wenyou Yang [Wed, 3 Feb 2016 02:20:43 +0000 (10:20 +0800)]
ARM: at91: clock: add PLLB enable/disable functions

To avoid the duplicated code, add the PLLB handle functions.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
Tested-by: Heiko Schocher <hs@denx.de>
[add enable/disable functions to arm920t]
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
8 years agoboard: atmel: siemens: clean up UTMI PLL code
Wenyou Yang [Tue, 2 Feb 2016 03:11:54 +0000 (11:11 +0800)]
board: atmel: siemens: clean up UTMI PLL code

Due to introducing the new UTMI PLL clock handle functions,
use the functions to reduce the duplicated code.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
8 years agodrivers: usb: atmel: clean up the UTMI PLL code
Wenyou Yang [Tue, 2 Feb 2016 03:11:53 +0000 (11:11 +0800)]
drivers: usb: atmel: clean up the UTMI PLL code

Due to introducing the new UTMI PLL clock handle functions,
use these function to reduce the duplicated code.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
8 years agoARM: at91: armv7: clean up UTMI PLL handle code
Wenyou Yang [Tue, 2 Feb 2016 03:11:52 +0000 (11:11 +0800)]
ARM: at91: armv7: clean up UTMI PLL handle code

Due to introducing the UTMI PLL enable function, use this function
to reduce the duplicated code.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
8 years agoARM: at91: clock: add UTMI PLL enable/disable function
Wenyou Yang [Tue, 2 Feb 2016 03:11:51 +0000 (11:11 +0800)]
ARM: at91: clock: add UTMI PLL enable/disable function

To avoid the duplicated code, add the UTMI PLL handle functions,
and add PMC_USB init function too.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
8 years agodrivers: at91: clean up peripheral clock code
Wenyou Yang [Wed, 3 Feb 2016 02:16:51 +0000 (10:16 +0800)]
drivers: at91: clean up peripheral clock code

Due to introducing the new peripheral clock handle functions,
use these functions to reduce the duplicated code.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Heiko Schocher <hs@denx.de>
[fixup for missing clk.h in at91_emac.c]
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
8 years agoboard: atmel: clean up peripheral clock code
Wenyou Yang [Wed, 3 Feb 2016 02:16:50 +0000 (10:16 +0800)]
board: atmel: clean up peripheral clock code

Due to introducing the new peripheral clock handle functions,
use these functions to reduce duplicated code.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Heiko Schocher <hs@denx.de>
[Rebased on current master, fixup for at91rm9200ek]
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
8 years agoARM: cpu: at91: clean up peripheral clock code
Wenyou Yang [Wed, 3 Feb 2016 02:16:49 +0000 (10:16 +0800)]
ARM: cpu: at91: clean up peripheral clock code

Due to introducing the new peripheral clock handle functions,
use these functions to clean up the duplicated code.

Meanwhile, remove unneeded header file include, at91_pmc.h.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
[fixup for arm920t code]
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
8 years agoARM: at91: clock: add a new file to handle clock
Wenyou Yang [Wed, 3 Feb 2016 02:16:48 +0000 (10:16 +0800)]
ARM: at91: clock: add a new file to handle clock

To reduce the duplicated code, add a new file to accommodate
the peripheral's and system's clock handle code, shared with
the SoCs with different ARM core.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
8 years agoARM: at91: asm/at91_pmc.h: fix trival register offset
Wenyou Yang [Wed, 3 Feb 2016 02:16:47 +0000 (10:16 +0800)]
ARM: at91: asm/at91_pmc.h: fix trival register offset

Remove unnecessary #ifdef CPU_HAS_PCR.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
8 years agoPrepare v2016.03-rc2 v2016.03-rc2
Tom Rini [Mon, 15 Feb 2016 21:44:30 +0000 (21:44 +0000)]
Prepare v2016.03-rc2

Signed-off-by: Tom Rini <trini@konsulko.com>
8 years agotest/py: put "Starting U-Boot" into separate log section
Stephen Warren [Thu, 11 Feb 2016 18:46:12 +0000 (11:46 -0700)]
test/py: put "Starting U-Boot" into separate log section

The initial boot of U-Boot happens within the context of the first test
that needs to access the U-Boot console when there is no existing
connection. This keeps all activity nestled within test execution, which
fits well into the pytest model. However, this mingles the U-Boot startup
logs with the execution of some test(s), which hides find the boundary
between the two.

To solve this, wrap the "Starting U-Boot" logic into a separate log
section. If the user wishes, they can simply collapse this log section
when viewing the HTML log, to concentrate purely on the test's own
interaction.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agotest/py: handle exceptions in console creation
Stephen Warren [Wed, 10 Feb 2016 23:54:37 +0000 (16:54 -0700)]
test/py: handle exceptions in console creation

u_boot_console.exec_attach.get_spawn() performs two steps:
1) Spawn a process to communicate with the serial console.
2) Reset the board so that U-Boot starts running from scratch.

Currently, if an exception happens in step (2), no cleanup is performed on
the process created in step (1). That process stays running and may e.g.
hold serial port locks, or simply continue to read data from the serial
port, thus preventing it from reaching any other process that attempts to
read from the same serial port later. While there is error cleanup code in
u_boot_console_base.ensure_spawned(), this is not triggered since the
exception prevents assignment to self.p there, and hence the exception
handler has no object to operate upon in cleanup_spawn().

Solve this by enhancing u_boot_console.exec_attach.get_spawn() to clean
up any objects it has created.

In theory, u_boot_spawn.Spawn's constructor has a similar issue, so fix
this too.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agotest/py: print summary in test order
Stephen Warren [Wed, 10 Feb 2016 20:47:37 +0000 (13:47 -0700)]
test/py: print summary in test order

Use lists rather than sets to record the status of tests. This causes
the test summary in the HTML file to be generated in the same order as
the tests are (or would have been) run. This makes it easier to locate
the first failed test. The log for this test might have interesting
first clues re: interaction with the environment (e.g. hardware flashing,
serial console, ...) and may help tracking down external issues.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agotest/py: fix CONFIG_SPL test
Stephen Warren [Wed, 10 Feb 2016 19:39:30 +0000 (12:39 -0700)]
test/py: fix CONFIG_SPL test

The Python ini file parser that's used to parse .config converts all keys
to lower-case. Hence, all queries against the results must use lower-case.
Fix u_boot_console.ensure_spawned() to test CONFIG_SPL correctly, or the
connection will fail for boards that have SPL.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agoEnable test/py for sandbox in Travis CI
Stephen Warren [Tue, 9 Feb 2016 01:23:35 +0000 (18:23 -0700)]
Enable test/py for sandbox in Travis CI

This provides runtime test coverage in Travis, in addition to the existing
build coverage.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Roger Meier <r.meier@siemens.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agotest/py: don't import pexpect
Stephen Warren [Tue, 9 Feb 2016 01:23:34 +0000 (18:23 -0700)]
test/py: don't import pexpect

The code replaced pexpect with custom code long ago. Don't import the
unused module so it doesn't need to be installed.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agotest/py: add docs for gdbserver and pytest options
Stephen Warren [Mon, 8 Feb 2016 21:49:02 +0000 (14:49 -0700)]
test/py: add docs for gdbserver and pytest options

Add documentation describing the new --gdbserver feature, and some common
pytest options.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agotest/py: run all "ut" subtests
Stephen Warren [Mon, 8 Feb 2016 21:44:16 +0000 (14:44 -0700)]
test/py: run all "ut" subtests

Invoke each "ut"-based unit test as a separate pytest.

Now that the DM unit test runs under test/py, remove the manual shell
script that invokes it.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org> # v2, on sandbox
8 years agoMakefile: generate symbol list from u-boot
Stephen Warren [Mon, 8 Feb 2016 21:44:15 +0000 (14:44 -0700)]
Makefile: generate symbol list from u-boot

This information may be useful for both debugging, and processes that want
to perform simple forms of introspection on the U-Boot binary, such as
determining the set of "ut" subtests that are compiled in.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agogpio: Correct handling of 'gpio status'
Simon Glass [Sun, 14 Feb 2016 23:28:59 +0000 (16:28 -0700)]
gpio: Correct handling of 'gpio status'

This is broken - we need to look at the first two characters to distinguish
'gpio status' from 'gpio set'.

Fixes: 0ffe6ab5 (gpio: Allow 's' as an abbreviation for 'status')
Reported-by: Soeren Moch <smoch@web.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Soeren Moch <smoch@web.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at>
8 years agotools: fix env_flags build
Lubomir Rintel [Sun, 14 Feb 2016 19:13:24 +0000 (20:13 +0100)]
tools: fix env_flags build

$ make tools-all
  ...
  In file included from tools/env/env_flags.c:1:0:
  tools/env/../../common/env_flags.c: In function
    ‘env_flags_parse_varaccess_from_binflags’:
    tools/env/../../common/env_flags.c:156:18: warning: implicit declaration
    of function ‘ARRAY_SIZE’ [-Wimplicit-function-declaration]
      for (i = 0; i < ARRAY_SIZE(env_flags_varaccess_mask); i++)
                      ^
Seems like the other utilities just add a copy of ARRAY_SIZE since
there's nowhere to include it from (tools/imagetool.h,
tools/mxsimage.h). Let's do the same here.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
8 years agoARM: rpi: set initrd_high
Lubomir Rintel [Sun, 14 Feb 2016 18:23:24 +0000 (19:23 +0100)]
ARM: rpi: set initrd_high

The kernel gets much too sad when the ramdisk is loaded too high into the 1GiB
of memory on Raspberry Pi 2:

  ## Flattened Device Tree blob at 00000100
     Booting using the fdt blob at 0x000100
     Loading Ramdisk to 39c14000, end 3ab45067 ... OK
     Using Device Tree in place at 00000100, end 000045ea
  ...
  [    0.599346] Unpacking initramfs...
  [    0.602924] Unable to handle kernel paging request at virtual address f9c14000

Placement of the device tree was fixed in 89ca1000 (ARM: rpi: set fdt_high
in the default environment).

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agoMakefile: remove BUILD_TAG from KBUILD_CFLAGS
Stephen Warren [Wed, 10 Feb 2016 22:16:19 +0000 (15:16 -0700)]
Makefile: remove BUILD_TAG from KBUILD_CFLAGS

If BUILD_TAG is part of KBUILD_CFLAGS, then any time the value changes,
all files get rebuilt. In a continuous integration environment, the value
will change every build. This wastes time, assuming that incremental
builds would otherwise occur.

To solve this, remove BUILD_TAG from KBUILD_CFLAGS and add it to CFLAGS
for just the one file that uses it. This does have the disadvantage that
if any other files want to use the flag, we'll need to duplicate this
custom CFLAGS setup logic. However, it seems unlikely we'll need this.

An alternative would be to add BUILD_TAG to the "local version" and remove
the special case code from display_options.c. However, that would affect
the format of the U-Boot signon message, which may negatively affect
people looking for specific data there. The approach of using
file-specific CFLAGS was suggested by Masahiro Yamada.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Simon Glass <sjg@chromium.org>
8 years agoOMAP3_logic: Add NAND args to boot UBIFS
Adam Ford [Wed, 10 Feb 2016 07:41:10 +0000 (01:41 -0600)]
OMAP3_logic: Add NAND args to boot UBIFS

With the recent addition of UBI support, this patch will add the preset
parameters to allow for mouting an UBIFS from the 'fs' partition in NAND.

-V2: ubi.mtd=fs instead of ubi.mtd=4

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoam43xx: qspi: Fix config to select SPI mode
Vignesh R [Wed, 10 Feb 2016 05:36:09 +0000 (11:06 +0530)]
am43xx: qspi: Fix config to select SPI mode

CONFIG_SF_DEFAULT_MODE is used to select default SPI mode when using
sf commands. Therefore fix am43xx to use CONFIG_SF_DEFAULT_MODE instead
of CONFIG_DEFAULT_SPI_MODE.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
8 years agoARM : DRA7: Switch QSPI to use MODE-0 at 64MHz
Vignesh R [Wed, 10 Feb 2016 05:21:43 +0000 (10:51 +0530)]
ARM : DRA7: Switch QSPI to use MODE-0 at 64MHz

According to Data Manual(SPRS915P) of AM572x, TI QSPI controller on
DRA74 EVM(rev 1.1+) can support up to 64MHz in MODE-0, whereas MODE-3 is
limited to 48MHz. Hence, switch to MODE-0 for better throughput.
Also, add IODelay parameters for the same.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoarm: VCMA9: because of NOR flash space constrains, activate THUMB build mode
David Müller (ELSOFT AG) [Tue, 9 Feb 2016 15:48:31 +0000 (16:48 +0100)]
arm: VCMA9: because of NOR flash space constrains, activate THUMB build mode

Signed-off-by: David Müller <d.mueller@elsoft.ch>
8 years agoarm: build some file(s) as ARM mode only
David Müller (ELSOFT AG) [Tue, 9 Feb 2016 15:48:30 +0000 (16:48 +0100)]
arm: build some file(s) as ARM mode only

Signed-off-by: David Müller <d.mueller@elsoft.ch>
8 years agoarm: the ARM920T is THUMB capable, so select the appropriate ISA
David Müller (ELSOFT AG) [Tue, 9 Feb 2016 15:48:29 +0000 (16:48 +0100)]
arm: the ARM920T is THUMB capable, so select the appropriate ISA

Signed-off-by: David Müller <d.mueller@elsoft.ch>
8 years agoarm: make sure board_init_r() is being called using the right mode (ARM / THUMB)
David Müller (ELSOFT AG) [Tue, 9 Feb 2016 15:48:28 +0000 (16:48 +0100)]
arm: make sure board_init_r() is being called using the right mode (ARM / THUMB)

Signed-off-by: David Müller <d.mueller@elsoft.ch>
8 years agoFix variable documented in README.distro for PXE address.
Vagrant Cascadian [Tue, 9 Feb 2016 03:55:31 +0000 (19:55 -0800)]
Fix variable documented in README.distro for PXE address.

Fixes typo of pxe_addr_r with pxefile_addr_r.

Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
Reviewed-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agoOMAP3LOGIC: Update maintainer
Adam Ford [Tue, 9 Feb 2016 03:27:19 +0000 (21:27 -0600)]
OMAP3LOGIC: Update maintainer

I will take this over from Peter Barada, since I work with it daily
at Logic PD.

Signed-off-by: Adam Ford <aford173@gmail.com>
Acked-by: Peter Barada <peter.barada@logicpd.com>
8 years agoOMAP3: omap3_logic: Grow SPL to 64K from 54K
Adam Ford [Tue, 9 Feb 2016 01:06:08 +0000 (19:06 -0600)]
OMAP3: omap3_logic: Grow SPL to 64K from 54K

Based on the work done by Overo, this seems to help some compilers
that have a hard time fitting all the code into the allocated space.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoOMAP3: am3517_evm: SD/MMC boot with uEnv.txt, zImage, and FDT
Derald D. Woods [Mon, 8 Feb 2016 02:54:47 +0000 (20:54 -0600)]
OMAP3: am3517_evm: SD/MMC boot with uEnv.txt, zImage, and FDT

Boot with the Linux zImage and am3517-evm.dtb pair, when SD/MMC media
is present. This behavior can be overridden by creating a 'uEnv.txt'
file with 'uenvcmd' defined.

To boot an existing 'uImage', create the following 'uEnv.txt':

[start]-----------------------------------------------------------------

loaduimage=fatload mmc 0:1 ${loadaddr} ${bootfile}
uenvcmd=run loaduimage; run mmcargs; bootm ${loadaddr}

[end]-------------------------------------------------------------------

Inspired by similar patches, for other OMAP3 boards, from EEWiki
- https://github.com/eewiki/u-boot-patches/tree/master/v2016.01

Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agoMerge branch 'master' of git://git.denx.de/u-boot-uniphier
Tom Rini [Sun, 14 Feb 2016 13:39:32 +0000 (08:39 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-uniphier

8 years agoARM: uniphier: add support for PH1-Pro4 Ace and Sanji boards
Masahiro Yamada [Fri, 12 Feb 2016 11:27:02 +0000 (20:27 +0900)]
ARM: uniphier: add support for PH1-Pro4 Ace and Sanji boards

Initial commit for PH1-Pro4 Ace and Sanji boards.

Note:
There are two variants for the Ace board in terms of the amount of
DDR memory; 1GB or 2GB.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: dts: uniphier: enable I2C channel 2 of ProXstream2 Gentil board
Masahiro Yamada [Fri, 12 Feb 2016 11:27:01 +0000 (20:27 +0900)]
ARM: dts: uniphier: enable I2C channel 2 of ProXstream2 Gentil board

This is used for on-board inter-connection.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: dts: uniphier: add EEPROM node for ProXstream2 Gentil board
Masahiro Yamada [Fri, 12 Feb 2016 11:27:00 +0000 (20:27 +0900)]
ARM: dts: uniphier: add EEPROM node for ProXstream2 Gentil board

This board has an EEPROM connected to the I2C channel 0 of the SoC.
Its slave address is 0x54.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: uniphier: drop unnecessary "bootm_low" environment define
Masahiro Yamada [Tue, 9 Feb 2016 09:59:52 +0000 (18:59 +0900)]
ARM: uniphier: drop unnecessary "bootm_low" environment define

This environment define has been here to work around the LMB
allocation error introduced by commit 9c11135ce053 ("image: fix
getenv_bootm_size() function").

It is no longer needed because the root cause was fixed by commit
0cb389dd1a38 ("image: fix getenv_bootm_size() function again").

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: uniphier: adjust DDR clock delay line for ProXstream2
Masahiro Yamada [Fri, 5 Feb 2016 04:21:07 +0000 (13:21 +0900)]
ARM: uniphier: adjust DDR clock delay line for ProXstream2

It turned out that DDR channel 2 was not working on ProXstream2
Vodka board.  Add the missing ACBLDR0 register setting to adjust
the delay between the clock lines and the address/command lines.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: uniphier: move cmd_ddrmphy.c to fix build error
Masahiro Yamada [Fri, 5 Feb 2016 04:20:32 +0000 (13:20 +0900)]
ARM: uniphier: move cmd_ddrmphy.c to fix build error

If CONFIG_CMD_DDRMPHY_DUMP is enabled, the build fails.

Fixes: 93d92d46cd01 ("ARM: uniphier: add dump command for DDR Multi PHY registers")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: uniphier: fix makefiles to build cmd_ddr(m)phy.c
Masahiro Yamada [Fri, 5 Feb 2016 04:20:31 +0000 (13:20 +0900)]
ARM: uniphier: fix makefiles to build cmd_ddr(m)phy.c

The U-Boot proper building needs to descend arch/arm/mach-uniphier/dram
to build these commands.

Fixes: 93d92d46cd01 ("ARM: uniphier: add dump command for DDR Multi PHY registers")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: uniphier: remove unused header mio-regs.h
Masahiro Yamada [Tue, 2 Feb 2016 12:51:41 +0000 (21:51 +0900)]
ARM: uniphier: remove unused header mio-regs.h

This header is no longer used.

This is the last file in arch/arm/mach-uniphier/include/mach/.
At last, I've succeeded in eliminating the mach directory.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: uniphier: drop unneeded EHCI pin mux settings
Masahiro Yamada [Tue, 2 Feb 2016 12:11:40 +0000 (21:11 +0900)]
ARM: uniphier: drop unneeded EHCI pin mux settings

These pin mux settings are cared by the pinctrl drivers.
Remove the ad-hoc code.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agousb: remove UniPhier EHCI driver
Masahiro Yamada [Tue, 2 Feb 2016 12:11:38 +0000 (21:11 +0900)]
usb: remove UniPhier EHCI driver

Now, all this driver does can be covered by the generic EHCI driver
(drivers/usb/host/ehci-generic.c).  UniPhier SoCs have switched to
use it.  Delete this driver rather than bothering to convert it to
Driver Model.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Marek Vasut <marex@denx.de>
8 years agoARM: uniphier: switch over to generic EHCI driver
Masahiro Yamada [Tue, 2 Feb 2016 12:11:39 +0000 (21:11 +0900)]
ARM: uniphier: switch over to generic EHCI driver

The UniPhier EHCI driver (drivers/usb/host/ehci-uniphier.c) does
nothing special but set the base address and handle reset/clock.

Since commit 4feefdcfe916 ("usb: add clock support for generic EHCI"),
the generic one (drivers/usb/host/ehci-generic.c) can do those, too.

We no longer need to stick to the dedicated driver.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: dts: uniphier: add clocks properties to EHCI nodes
Masahiro Yamada [Tue, 2 Feb 2016 12:11:37 +0000 (21:11 +0900)]
ARM: dts: uniphier: add clocks properties to EHCI nodes

This allows the EHCI driver to get clocks from device tree.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: dts: uniphier: add device nodes for MIO control block
Masahiro Yamada [Tue, 2 Feb 2016 12:11:36 +0000 (21:11 +0900)]
ARM: dts: uniphier: add device nodes for MIO control block

This block provides clock and reset control for MIO (Media I/O)
hardware blocks such as USB2.0, SD card, eMMC, etc.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: dts: uniphier: add device nodes for Peripheral control block
Masahiro Yamada [Tue, 2 Feb 2016 12:11:35 +0000 (21:11 +0900)]
ARM: dts: uniphier: add device nodes for Peripheral control block

This block provides clock and reset control for peripherals such as
UART, I2C, IC card, etc.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: dts: uniphier: add device nodes for System Control blocks
Masahiro Yamada [Tue, 2 Feb 2016 12:11:34 +0000 (21:11 +0900)]
ARM: dts: uniphier: add device nodes for System Control blocks

These are mainly used for controlling clocks and resets.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: dts: uniphier: add reference clock nodes
Masahiro Yamada [Tue, 2 Feb 2016 12:11:33 +0000 (21:11 +0900)]
ARM: dts: uniphier: add reference clock nodes

Add master clock nodes generated by crystal oscillators.

  PH1-sLD3, PH1-LD4: 24.576 MHz
  PH1-Pro4, ProXstream2: 25.000 MHz
  PH1-Pro5: 20.000 MHz

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoclk: uniphier: add Media I/O clock driver for UniPhier SoCs
Masahiro Yamada [Tue, 2 Feb 2016 12:11:32 +0000 (21:11 +0900)]
clk: uniphier: add Media I/O clock driver for UniPhier SoCs

This is the initial commit for the UniPhier clock drivers.
Currently, only the Media I/O clock is supported.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: uniphier: support USB boot mode for ProXstream2 / PH1-LD6b SoC
Masahiro Yamada [Tue, 2 Feb 2016 12:11:31 +0000 (21:11 +0900)]
ARM: uniphier: support USB boot mode for ProXstream2 / PH1-LD6b SoC

The USB boot code is too fat and complicated to be included in SPL
(at least for now).  So, it was implemented as a separate project
(what we call USB-loader).

The expected boot sequence is as follows:

  Boot ROM -> USB-loader -> SPL -> U-Boot proper

The USB-loader loads the SPL and U-Boot proper from a USB memory
onto the locked L2 cache.  Then, SPL needs to copy the U-Boot proper
to DRAM, so this mode looks like a NOR boot from the view of SPL.
However, we want to distinguish between (genuine) NOR boot and USB
boot in some places.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: uniphier: add missing static qualifier
Masahiro Yamada [Tue, 2 Feb 2016 12:11:30 +0000 (21:11 +0900)]
ARM: uniphier: add missing static qualifier

This function is for local use in the file.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: uniphier: create early page table at run-time
Masahiro Yamada [Tue, 2 Feb 2016 12:11:29 +0000 (21:11 +0900)]
ARM: uniphier: create early page table at run-time

UniPhier SoCs are not equipped with dedicated on-chip SRAM.  Instead,
locked outer cache is used as RAM area during the early boot stage
where DRAM is not ready yet.  This effectively means MMU must be
always enabled while we are in SPL.

Currently, the SPL image for UniPhier SoCs contains the page table
statically defined at compile time.  It has been a burden because the
16KB page table occupies a quarter memory footprint of the 64KB SPL
image.

Finally, there is no more room to implement new features in SPL.
Setting aside the NOR boot mode, this issue can be solved by creating
the page table onto RAM at run time.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: uniphier: change stack pointer address for SPL
Masahiro Yamada [Tue, 2 Feb 2016 12:11:28 +0000 (21:11 +0900)]
ARM: uniphier: change stack pointer address for SPL

No special reason for the current stack address 0x0ff08000.
Change it to 0x00100000 to simplify the init_page_table.

There are two types of SoCs in terms of the load address of SPL.

 [1] PH1-sLD3, PH1-LD4, PH1-sLD8
   SPL is loaded at 0x00040000-0x0004ffff
 [2] PH1-Pro4, PH1-Pro5, ProXstream2, PH1-LD6b
   SPL is loaded at 0x00100000-0x0010ffff

The new stack area (0x000f8000-0x00100000) should be safe for all the
cases.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agospl: define BOOT_DEVICE_USB
Masahiro Yamada [Tue, 2 Feb 2016 10:12:31 +0000 (19:12 +0900)]
spl: define BOOT_DEVICE_USB

This enum is referenced from common/spl/spl.c.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: uniphier: update U-Boot file names in workflow
Masahiro Yamada [Tue, 2 Feb 2016 03:53:31 +0000 (12:53 +0900)]
ARM: uniphier: update U-Boot file names in workflow

Since commit ad1ecd2063da ("fdt: Build a U-Boot binary without device
tree") and commit 03c25bcd263a ("fdt: Build an SPL binary without
device tree"), we can use shorter file names for the output images.

The default configuration for UniPhier SoCs enables CONFIG_OF_SEPARATE
and CONFIG_SPL_OF_CONTROL.  In this case, spl/u-boot-spl.bin is the
same as spl/u-boot-spl-dtb.bin.  Likewise, u-boot.img is the same as
as u-boot-dtb.img.  So, this change of the flow has no impact.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agoARM: uniphier: support some more DRAM use cases on PH1-Pro4 boards
Masahiro Yamada [Thu, 21 Jan 2016 05:57:30 +0000 (14:57 +0900)]
ARM: uniphier: support some more DRAM use cases on PH1-Pro4 boards

Some of PH1-Pro4 boards are equipped with larger amount of DRAM than
the reference board.  Add UMC settings to support them.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: uniphier: fix nfsboot command
Masahiro Yamada [Thu, 21 Jan 2016 05:56:09 +0000 (14:56 +0900)]
ARM: uniphier: fix nfsboot command

This is no longer working, so needs reworking.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: uniphier: factor out common part of boot commands
Masahiro Yamada [Thu, 21 Jan 2016 05:56:08 +0000 (14:56 +0900)]
ARM: uniphier: factor out common part of boot commands

The environment "bootm_low" is updated before the "bootz" command.
This is common for all the boot modes (NOR, NAND, TFTP, etc.), so
can be factored out.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: uniphier: add default bootm_low to fix FIT boot
Masahiro Yamada [Thu, 21 Jan 2016 05:56:07 +0000 (14:56 +0900)]
ARM: uniphier: add default bootm_low to fix FIT boot

Commit 25d4eb8091f4 ("ARM: uniphier: add bootm_low environment")
missed to add "bootm_low" for FIT boot.  Set "bootm_low" to the
DRAM base address.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoARM: uniphier: fix NOR boot command
Masahiro Yamada [Thu, 21 Jan 2016 05:56:06 +0000 (14:56 +0900)]
ARM: uniphier: fix NOR boot command

Commit 89835b3557fe ("ARM: uniphier: allow to run zImage rather than
uImage") changed the kernel boot commands.  Unlike "bootm", "bootz"
does not relocate the kernel image.  When the boot device is a NOR
flash, the zImage should be copied from the NOR onto the DRAM before
it is passed to the "bootz" command.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
8 years agoarasan: nfc: Add initial nand driver support for arasan
Siva Durga Prasad Paladugu [Tue, 17 Nov 2015 09:00:10 +0000 (14:30 +0530)]
arasan: nfc: Add initial nand driver support for arasan

Added initial nand driver support for arasan nand flash
controller.This supports nand erase,nand read, nand write
This uses the hardware ECC for read and write operations
ZynqMP uses this  driver.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
[scottwood: Fix checkpatch warnings]
Signed-off-by: Scott Wood <oss@buserror.net>
8 years agozynqmp: nand: Add Nand driver support for zynqmp
Siva Durga Prasad Paladugu [Tue, 17 Nov 2015 09:00:09 +0000 (14:30 +0530)]
zynqmp: nand: Add Nand driver support for zynqmp

Add nand driver support for zynqmp. The Nand
controller used in ZynqMP is Arasan Nand Flash
controller.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
[scottwood: Fix checkpatch warning]
Signed-off-by: Scott Wood <oss@buserror.net>
8 years agomtd: pxa3xx_nand: Don't alloc unneeded memory
Kevin Smith [Thu, 14 Jan 2016 16:01:39 +0000 (16:01 +0000)]
mtd: pxa3xx_nand: Don't alloc unneeded memory

The allocation size is reduced from what was introduced from the
Linux kernel, as U-boot uses the statically allocated nand_info
instead of needing to dynamically allocate an mtd_info instance.

Signed-off-by: Kevin Smith <kevin.smith@elecsyscorp.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Scott Wood <scottwood@freescale.com>
8 years agomtd: pxa3xx_nand: Correct offset calculation
Kevin Smith [Thu, 14 Jan 2016 16:01:38 +0000 (16:01 +0000)]
mtd: pxa3xx_nand: Correct offset calculation

Correct some pointer math in initialization.  An offset was added
to a struct-typed pointer instead of one casted to a byte-size,
resulting in a much larger offset than intended.

Signed-off-by: Kevin Smith <kevin.smith@elecsyscorp.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Scott Wood <scottwood@freescale.com>
8 years agomtd: pxa3xx_nand: Correct null dereference
Kevin Smith [Thu, 14 Jan 2016 16:01:36 +0000 (16:01 +0000)]
mtd: pxa3xx_nand: Correct null dereference

Correct a null pointer dereference in board_nand_init().  Zeroed
memory was allocated, then immediately dereferenced.  The
dereference is completely removed, since this pointer is later
initialized in alloc_nand_resources.

Signed-off-by: Kevin Smith <kevin.smith@elecsyscorp.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Scott Wood <scottwood@freescale.com>
8 years agonand: mxs: fix error handling for mxs_nand_init
Peng Fan [Wed, 27 Jan 2016 02:38:02 +0000 (10:38 +0800)]
nand: mxs: fix error handling for mxs_nand_init

Fix error handling for mxs_nand_init.

The original error handling is wrong for err2 and err1.
Should first free desc[x], then free desc.

This patch also correctly handle err3, should use
MXS_DMA_CHANNEL_AHB_APBH_GPMI0 as the check point.

Cc: Stefano Babic <sbabic@denx.de>
CC: Fabio Estevam <Fabio.Estevam@freescale.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Peng Fan <van.freenix@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>
8 years agoMerge branch 'master' of git://git.denx.de/u-boot-video
Tom Rini [Thu, 11 Feb 2016 23:18:15 +0000 (18:18 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-video

8 years agovideo: tegra: Enable the 'lcd' env variable work-around
Simon Glass [Sat, 6 Feb 2016 21:31:38 +0000 (14:31 -0700)]
video: tegra: Enable the 'lcd' env variable work-around

Enable this option on all tegra boards.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
8 years agodm: video: Add a temporary work-around for old stdout var
Simon Glass [Sat, 6 Feb 2016 21:31:37 +0000 (14:31 -0700)]
dm: video: Add a temporary work-around for old stdout var

Boards with a saved environment may use 'lcd' in their stdout environment
variable, expecting that this will enable output to the LCD. When the board
moves to use driver model for video, this will no-longer work. Add a
work-around to fix this. A warning messages is printed, and we will remove
the work-around at the end of 2016.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Tested-by: Stephen Warren <swarren@nvidia.com>
8 years agoRevert "common/memsize.c: Simplify RAM size detection"
Hans de Goede [Tue, 9 Feb 2016 21:38:31 +0000 (22:38 +0100)]
Revert "common/memsize.c: Simplify RAM size detection"

This commit breaks bootup on sunxi boards, the get stuck
when running the main u-boot binary at:

CPU:   Allwinner H3 (SUN8I)
I2C:   ready
DRAM:

This reverts commit 8e7cba048baae68ee0916a8f52b4304277328d5e.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 years agotest/py: capture the entire U-Boot version at boot
Stephen Warren [Sat, 6 Feb 2016 01:04:43 +0000 (18:04 -0700)]
test/py: capture the entire U-Boot version at boot

The existing regex simply ensures that the captured version string doesn't
go past the end of a line. We really want to grab as much as possible. Do
this by explicitly including a ) character at the end of the regex to
match the last character of the version test.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
8 years agotest/py: fix off-by-one error in spawn matching code
Stephen Warren [Sat, 6 Feb 2016 01:04:42 +0000 (18:04 -0700)]
test/py: fix off-by-one error in spawn matching code

A regex match object's .end() value is already the index after the match,
not the index of the last character in the match, so there's no need to
add 1 to point past the match.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
8 years agotest/py: HTML awesome!
Stephen Warren [Wed, 3 Feb 2016 23:46:34 +0000 (16:46 -0700)]
test/py: HTML awesome!

Implement three improvements to the HTML log file:
- Ability to expand/contract sections. All passing sections are contracted
  at file load time so the user can concentrate on issues requiring
  action.
- The overall status report is copied to the top of the log for easy
  access.
- Add links from the status report to the test logs, for easy navigation.

This all relies on Javascript and the jquery library. If the user doesn't
have Javascript enabled, or jquery can't be downloaded, the log should
look and behave identically to how it did before this patch.

A few notes on the diff:

- A few more 'with log.section("xxx")' were added, so that all stream
  blocks are kept within a section block for consistent HTML entity
  nesting structure. This changed indentation in a few places, making
  the diff look slightly larger.
- HTML entity IDs are cleaned up. We assign simple incrementing integer
  IDs now, rather than using mangled test names which were possibly
  invalid.
- Sections and streams now use common CSS class names (in addition to the
  current separate class names) to more easily share the new behaviour.
  This also reduces the CSS file size since rules don't need to be
  duplicated.
- An "OK" status is logged after some external command executions so that
  make and flash steps are auto-contracted at log file load time, assuming
  they passed.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
8 years agotest/py: exit(1) if there are problems running py.test
Stephen Warren [Wed, 3 Feb 2016 17:42:11 +0000 (10:42 -0700)]
test/py: exit(1) if there are problems running py.test

The test/py/test.py wrapper script catches exceptions thrown when
exec()ing py.test in order to print a helpful error message. However,
the exception handling code squashes the exception and so the script
exits with a non-zero exit code, leading callers to believe that it
passed. Fix this.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
8 years agoitest: allow map_physmem to return 0 in limited cases
Stephen Warren [Fri, 29 Jan 2016 23:10:04 +0000 (16:10 -0700)]
itest: allow map_physmem to return 0 in limited cases

On some systems, RAM starts at address 0. If the user executes itest
against address 0 on such a system, it will call map_physmem(0, ...)
which will return 0 back; mapping only changes the address on sandbox.
This causes itest to believe map_physmem() has failed, and hence fails
the comparison.

Fix itest so that it allows map_physmem() to return 0 /if/ the orignal
address passed to it was also 0.

This fixes "tegra-uboot-flasher flash" on Tegra20.

This has the disadvantage that on sandbox, failed mapping attempts for
address 0 are not detected. Instead, should the code only call
map_physmem() on sandbox? Or, should map_physmem() return its error status
some other way. Or, should the special case only be allowed on systems
where the base of RAM is 0 somehow?

Fixes: 7861204c9af7 ("itest: make memory access work under sandbox")
Signed-off-by: Stephen Warren <swarren@nvidia.com>
8 years agogunzip: remove avail_in recalculation
Stephen Warren [Fri, 29 Jan 2016 20:26:58 +0000 (13:26 -0700)]
gunzip: remove avail_in recalculation

Current, the following passes:
    ./u-boot -d arch/sandbox/dts/test.dtb -c 'ut_image_decomp'
but the following fails:
    ./u-boot -d arch/sandbox/dts/test.dtb -c 'ut dm; ut_image_decomp'

This is because the gunzip code reads input data beyond the end of its
input buffer. In the first case above, this data just happens to be 0,
which just happens to trigger gzip to signal the error the decompression
unit test expects. In the second case above, the "ut dm" test has written
data to the accidentally-read memory, which causes the gzip code to take a
different path and so return a different value, which triggers the test
failure.

The cause of gunzip reading past its input buffer is the re-calculation of
s.avail_in in zunzip(), since it can underflow. Not only is the formula
non-sensical (it uses the delta between two output buffer pointers to
calculate available input buffer size), it also appears to be unnecessary,
since the gunzip code already maintains this value itself. This patch
removes this re-calculation to avoid the underflow and redundant work.

The loop exit condition is also adjusted so that if inflate() has consumed
the entire input buffer, without indicating returning Z_STREAM_END (i.e.
decompression complete without error), an error is raised. There is still
opportunity to simplify the code here by splitting up the loop exit
condition into separate tests. However, this patch makes the minimum
modifications required to solve the problem at hand, in order to keep the
Acked-by: Kees Cook <keescook@chromium.org>
diff simple.

I am not entirely convinced that the loop in zunzip() is necessary at all.
It could only be useful if inflate() can return Z_BUF_ERROR (which
typically means that it needs more data in the input buffer, or more space
in the output buffer), even though Z_FINISH is set /and/ the full input is
available in the input buffer /and/ there is enough space to store the
decompressed output in the output buffer. The comment in zlib.h after the
prototype of inflate() implies this is never the case. However, I assume
there must have been some reason for introducing this loop in the first
place, as part of commit "Fix gunzip to work for any gziped uImage size".

This patch is similar to the earlier b75650d84d4b "gzip: correctly
bounds-check output buffer", which corrected a similar issue for
s.avail_out.

Cc: Catalin Radu <Catalin@VirtualMetrix.com>
Cc: Kees Cook <keescook@chromium.org>
Fixes: f039ada5c109 ("Fix gunzip to work for any gziped uImage size")
Signed-off-by: Stephen Warren <swarren@nvidia.com>
8 years agosniper: Drop references to P970
Paul Kocialkowski [Sun, 7 Feb 2016 15:50:50 +0000 (16:50 +0100)]
sniper: Drop references to P970

There are various different boards with the same hardware sold as LG Optimus
Black, such as P970, P970g and KU5900. Since this port is functional for all
variants, it doesn't make sense to keep references to P970.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@konsulko.com>
8 years agos3c24xx: serial: Remove dead code
David Müller (ELSOFT AG) [Sat, 6 Feb 2016 06:57:29 +0000 (07:57 +0100)]
s3c24xx: serial: Remove dead code

Signed-off-by: David Müller <d.mueller@elsoft.ch>
8 years agodoc: Remove any reference to CONFIG_MODEM_SUPPORT, CONFIG_CMD_HWFLOW, CONFIG_HWFLOW...
David Müller (ELSOFT AG) [Sat, 6 Feb 2016 06:57:28 +0000 (07:57 +0100)]
doc: Remove any reference to CONFIG_MODEM_SUPPORT, CONFIG_CMD_HWFLOW, CONFIG_HWFLOW and friends from the documentation.

Signed-off-by: David Müller <d.mueller@elsoft.ch>
8 years agoRemove unused CONFIG_HWFLOW option and associated dead code.
David Müller (ELSOFT AG) [Sat, 6 Feb 2016 06:57:27 +0000 (07:57 +0100)]
Remove unused CONFIG_HWFLOW option and associated dead code.

Signed-off-by: David Müller <d.mueller@elsoft.ch>
8 years agoRemove unused CONFIG_CMD_HWFLOW option and associated dead code.
David Müller (ELSOFT AG) [Sat, 6 Feb 2016 06:57:26 +0000 (07:57 +0100)]
Remove unused CONFIG_CMD_HWFLOW option and associated dead code.

Signed-off-by: David Müller <d.mueller@elsoft.ch>
8 years agoRemove unused CONFIG_MODEM_SUPPORT option and associated dead code.
David Müller (ELSOFT AG) [Sat, 6 Feb 2016 06:57:25 +0000 (07:57 +0100)]
Remove unused CONFIG_MODEM_SUPPORT option and associated dead code.

Signed-off-by: David Müller <d.mueller@elsoft.ch>
8 years agoARM: rpi: set fdt_high in the default environment
Stephen Warren [Sat, 6 Feb 2016 05:45:47 +0000 (22:45 -0700)]
ARM: rpi: set fdt_high in the default environment

The ARM Linux kernel requires the DT to be in memory accessible early
during the boot process. This always happens naturally on the RPi 1,
since the maximum memory size of 512MiB, and additionally some of that
is reserved for use by the GPU. The RPi 2 has 1GiB of RAM (minus some
GPU usage), and so if the DT is relocated to the top of RAM, Linux cannot
access it. Prevent this from happening by setting fdt_high.

Cc: Daniel Stone <daniels@collabora.com>
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agoARM: rpi: update memory layout env. var. documentation
Stephen Warren [Sat, 6 Feb 2016 05:45:46 +0000 (22:45 -0700)]
ARM: rpi: update memory layout env. var. documentation

Update rpi-common.h's documentation that describes the rationale for
choosing various addresses for standardized variables used by boot
scripts. This comment was correct when written, but not updated when some
of the values were changed.

Fixes: 14006a567105 ("rpi: set fdt_addr_r to 0x00000100 to match default
...device_tree_address")
Cc: Jonathan Liu <net147@gmail.com>
Cc: Daniel Stone <daniels@collabora.com>
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
8 years agoboard_r: fix a typo in comment block
Masahiro Yamada [Fri, 5 Feb 2016 11:49:39 +0000 (20:49 +0900)]
board_r: fix a typo in comment block

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
8 years agokbuild: fix build rule of u-boot-spl.dtb
Masahiro Yamada [Fri, 5 Feb 2016 08:55:14 +0000 (17:55 +0900)]
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>
8 years agokbuild: add missing FORCE where $(call if_changed, ) is used
Masahiro Yamada [Fri, 5 Feb 2016 08:55:13 +0000 (17:55 +0900)]
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>
8 years agokbuild: remove unneeded ifdef conditionals around build rules
Masahiro Yamada [Fri, 5 Feb 2016 08:55:12 +0000 (17:55 +0900)]
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>