]> git.sur5r.net Git - u-boot/log
u-boot
7 years agosunxi: clocks: Use the correct pattern register for PLL11
Philipp Tomsich [Mon, 2 Jan 2017 11:48:41 +0000 (11:48 +0000)]
sunxi: clocks: Use the correct pattern register for PLL11

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agosunxi: H3: add DRAM controller single bit delay support
Jens Kuske [Mon, 2 Jan 2017 11:48:40 +0000 (11:48 +0000)]
sunxi: H3: add DRAM controller single bit delay support

So far the DRAM driver for the H3 SoC (and apparently boot0/libdram as
well) only applied coarse delay line settings, with one delay value for
all the data lines in each byte lane and one value for the control lines.

Instead of setting the delays for whole bytes only allow setting it for
each individual bit. Also add support for address/command lane delays.

For the purpose of this patch the rules for the existing coarse settings
were just applied to the new scheme, so the actual register writes don't
change for the H3. Other SoCs will utilize this feature later properly.

With a stock GCC 5.3.0 this increases the dram_sun8i_h3.o code size from
2296 to 2344 Bytes.

[Andre: move delay parameters into macros to ease later sharing, use
defines for numbers of delay registers, extend commit message]

Signed-off-by: Jens Kuske <jenskuske@gmail.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agosunxi: H3: add and rename some DRAM contoller registers
Jens Kuske [Mon, 2 Jan 2017 11:48:39 +0000 (11:48 +0000)]
sunxi: H3: add and rename some DRAM contoller registers

The IOCR registers got renamed to BDLR to match the public
documentation of similar controllers.

Signed-off-by: Jens Kuske <jenskuske@gmail.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agosunxi: H3: Rework MBUS priority setup
Philipp Tomsich [Mon, 2 Jan 2017 11:48:38 +0000 (11:48 +0000)]
sunxi: H3: Rework MBUS priority setup

So far the MBUS priority setup was done by writing "magic" values taken
from a DRAM controller register dump after a boot0 run.
By peeking at the Linux (sic!) MBUS driver [1] from the Allwinner BSP
kernel, we learned more about the actual meaning of those bits.
Add macros and refactor the setup function to make the MBUS setup much
more readable and meaningful.
The actual values used now are a transformation of the values used
before, which are assembled by the new code to result in the same register
writes. So this rework does not change any settings, also the code size
stays the same.

The respective source files in the BSP kernel had a proper GPL header,
so lifting this code and information into U-Boot is legal.

[Andre: provide a convenience macro to fit definitions on one line]

[1] https://github.com/longsleep/linux-pine64/blob/lichee-dev-v3.10.65/drivers/bus/sunxi_mbus.c

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agosunxi: provide default DRAM config for sun50i in Kconfig
Andre Przywara [Mon, 2 Jan 2017 11:48:37 +0000 (11:48 +0000)]
sunxi: provide default DRAM config for sun50i in Kconfig

To avoid enumerating the very same DRAM values in defconfig files
for each and every Allwinner A64 board out there, let's put some sane
default values in the Kconfig file.
Boards with different needs can override them at any time.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agosunxi: A64: do an RMR switch if started in AArch32 mode
Andre Przywara [Mon, 2 Jan 2017 11:48:36 +0000 (11:48 +0000)]
sunxi: A64: do an RMR switch if started in AArch32 mode

The Allwinner A64 SoC starts execution in AArch32 mode, and both
the boot ROM and Allwinner's boot0 keep running in this mode.
So U-Boot gets entered in 32-bit, although we want it to run in AArch64.

By using a "magic" instruction, which happens to be an almost-NOP in
AArch64 and a branch in AArch32, we differentiate between being
entered in 64-bit or 32-bit mode.
If in 64-bit mode, we proceed with the branch to reset, but in 32-bit
mode we trigger an RMR write to bring the core into AArch64/EL3 and
re-enter U-Boot at CONFIG_SYS_TEXT_BASE.
This allows a 64-bit U-Boot to be both entered in 32 and 64-bit mode,
so we can use the same start code for the SPL and the U-Boot proper.

We use the existing custom header (boot0.h) functionality, but restrict
the existing boot0 header reservation to the non-SPL build now. A SPL
wouldn't need such header anyway. This allows to have both options
defined and lets us use one for the SPL and the other for U-Boot proper.

Also add arch/arm/mach-sunxi/rmr_switch.S, which contains the original
ARM assembly code and instructions how to re-generate the encoded
version.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agosunxi: introduce extra config option for boot0 header
Andre Przywara [Mon, 2 Jan 2017 11:48:35 +0000 (11:48 +0000)]
sunxi: introduce extra config option for boot0 header

The ENABLE_ARM_SOC_BOOT0_HOOK option is a generic option shared with
other boards. To allow alternative code to be inserted, we create
another, now function specific config symbol on top of it to simplify
later additions. No functional change at this time.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agoARM: boot0 hook: remove macro, include whole header file
Andre Przywara [Mon, 2 Jan 2017 11:48:34 +0000 (11:48 +0000)]
ARM: boot0 hook: remove macro, include whole header file

For prepending some board specific header area to U-Boot images we
were so far including a header file with a macro definition containing
the actual header specification.
This works fine if there are just a few statements and if there is only
one alternative.
However adding more complex code quickly gets messy with this approach,
so let's just drop that intermediate macro and let the #include actually
insert the code directly.
This converts the callers and the callees, but doesn't change anything
at this point.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Steve Rae <steve.rae@raedomain.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agoarmv8: move reset branch into boot hook
Andre Przywara [Mon, 2 Jan 2017 11:48:33 +0000 (11:48 +0000)]
armv8: move reset branch into boot hook

The boot0 hook we have so far is applied _after_ the initial branch
to the "reset" entry point. An upcoming change requires even this
branch to be changed, so we apply the hook macro at the earliest
point, and have the branch in the hook file as well.
This is no functional change at this point, just refactoring to simplify
upcoming patches.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agoarmv8: add simple sdelay implementation
Andre Przywara [Mon, 2 Jan 2017 11:48:32 +0000 (11:48 +0000)]
armv8: add simple sdelay implementation

The sunxi DRAM setup code needs an sdelay() implementation, which
wasn't defined for armv8 so far.
Shamelessly copy the armv7 version and adjust it to work in AArch64.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agoSPL: make struct spl_image 64-bit safe
Andre Przywara [Mon, 2 Jan 2017 11:48:31 +0000 (11:48 +0000)]
SPL: make struct spl_image 64-bit safe

Since entry_point and load_addr are addresses, they should be
represented as longs to cover the whole address space and to avoid
warning when compiling the SPL in 64-bit.
Also adjust debug prints to add the 'l' specifier, where needed.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agomove UL() macro from armv8/mmu.h into common.h
Andre Przywara [Mon, 2 Jan 2017 11:48:30 +0000 (11:48 +0000)]
move UL() macro from armv8/mmu.h into common.h

The UL() macro is pretty useful in sharing constants between assembly
and C files while still being able to specify a type for C.
Move the macro from an armv8 specific header into a common header file
to be able to use it by arm code (for instance) as well.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agoSPL: tiny-printf: ignore "-" modifier
Andre Przywara [Mon, 2 Jan 2017 11:48:29 +0000 (11:48 +0000)]
SPL: tiny-printf: ignore "-" modifier

tiny-printf does not know about the "-" modifier, which aligns numbers.
This is used by some SPL code, but as it's purely cosmetical, we just
ignore this modifier here to avoid changing correct printf strings.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agoSPL: tiny-printf: add "l" modifier
Andre Przywara [Mon, 2 Jan 2017 11:48:28 +0000 (11:48 +0000)]
SPL: tiny-printf: add "l" modifier

tiny-printf does not know about the "l" modifier so far, which breaks
the crash dump on AArch64, because it uses %lx to print the registers.
Add an easy way of handling longs correctly.

Using a relatively decent compiler (GCC 5.3.0) this does _not_ increase
the code size of tiny-printf.o for 32-bit builds (where long and int
are actually the same), actually it looses three (ARM Thumb2) instructions
from the actual SPL (numbers for orangepi_plus_defconfig):
  text    data     bss     dec     hex filename
   758       0       0     758     2f6 spl/lib/tiny-printf.o before
 18839     488     232   19559    4c67 spl/u-boot-spl before
   758       0       0     758     2f6 spl/lib/tiny-printf.o after
 18833     488     232   19553    4c61 spl/u-boot-spl after

This adds some substantial amount of code to a 64-bit build, though:
(taken after a later commit, which enables the ARM64 SPL build for sunxi)
  text    data     bss     dec     hex filename
  1542       0       0    1542     606 spl/lib/tiny-printf.o before
 25830     392     360   26582    67d6 spl/u-boot-spl before
  1758       0       0    1758     6de spl/lib/tiny-printf.o after
 26040     392     360   26792    68a8 spl/u-boot-spl after

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agoarmv8: add lowlevel_init.S
Andre Przywara [Mon, 2 Jan 2017 11:48:27 +0000 (11:48 +0000)]
armv8: add lowlevel_init.S

For boards that call s_init() when the SPL runs, we are expected to
setup an early stack before calling this C function.
Implement the proper AArch64 version of this based on the ARMv7 code.
This allows sunxi boards to setup the basic peripherals even with a
64-bit SPL.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agoarmv8: prevent using THUMB
Andre Przywara [Mon, 2 Jan 2017 11:48:26 +0000 (11:48 +0000)]
armv8: prevent using THUMB

The predominantely 32-bit ARM targets try to compile the SPL in Thumb
mode to reduce code size.
The 64-bit AArch64 instruction set does not know an alternative, concise
encoding, so the Thumb build option should only be set for 32-bit
targets.
Likewise -marm machine options are only valid for ARMv7 targets.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agosun6i: Restrict some register initialization to Allwinner A31 SoC
Andre Przywara [Mon, 2 Jan 2017 11:48:25 +0000 (11:48 +0000)]
sun6i: Restrict some register initialization to Allwinner A31 SoC

These days many Allwinner SoCs use clock_sun6i.c, although out of them
only the (original sun6i) A31 has a second MBUS clock register.
Also the requirement for setting up the PRCM PLL_CTLR1 register to provide
the proper voltage seems to be a property of older SoCs only as well.

Restrict the MBUS initialization to this SoC only to avoid writing bogus
values to (undefined) registers in other chips.
I can only verify that the PLL voltage setup is not needed for H3 and
A64, so for now we only spare those two SoCs.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agospl: sunxi: Fix build error with CONFIG_SPL_SPI_SUNXI
Priit Laes [Mon, 2 Jan 2017 18:24:50 +0000 (20:24 +0200)]
spl: sunxi: Fix build error with CONFIG_SPL_SPI_SUNXI

Fix typo introduced in ebc4ef61d76fc182773fe225151adc9b913c62eb

Signed-off-by: Priit Laes <plaes@plaes.org>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agoPrepare v2017.01-rc3 v2017.01-rc3
Tom Rini [Tue, 3 Jan 2017 01:00:55 +0000 (20:00 -0500)]
Prepare v2017.01-rc3

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoMerge branch 'master' of git://www.denx.de/git/u-boot-imx
Tom Rini [Mon, 2 Jan 2017 21:32:05 +0000 (16:32 -0500)]
Merge branch 'master' of git://www.denx.de/git/u-boot-imx

7 years agoudoo: neo: Fix indentation
Fabio Estevam [Mon, 2 Jan 2017 10:44:04 +0000 (08:44 -0200)]
udoo: neo: Fix indentation

The standard way is to put ifdef/endif in the very first column.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
7 years agoimx6ul: geam6ul: Enable I2C support
Jagan Teki [Wed, 21 Dec 2016 21:14:46 +0000 (22:14 +0100)]
imx6ul: geam6ul: Enable I2C support

Enable I2C support for Engicam GEAM6UL NAND module.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
7 years agoimx6ul: geam6ul: Add MAINTAINERS for nand_defconfig
Jagan Teki [Wed, 21 Dec 2016 11:02:13 +0000 (12:02 +0100)]
imx6ul: geam6ul: Add MAINTAINERS for nand_defconfig

Add Jagan as MAINTAINERS of configs/imx6ul_geam_nand_defconfig

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
7 years agoconfigs: engicam: Add fitboot env support
Jagan Teki [Wed, 21 Dec 2016 11:00:29 +0000 (12:00 +0100)]
configs: engicam: Add fitboot env support

Add FIT image booting from MMC device, during MMC bootcmd
u-boot env script look for bootscript, else fit image or else
finally look for legacy image uImage.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
7 years agoconfigs: engicam: Cleanup on mmcboot env
Jagan Teki [Wed, 21 Dec 2016 11:00:28 +0000 (12:00 +0100)]
configs: engicam: Cleanup on mmcboot env

- Add tab space
- remove exctra 'mmc dev ${mmcdev}'

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
7 years agoconfigs: engicam: Enable CONFIG_IMAGE_FORMAT_LEGACY
Jagan Teki [Wed, 21 Dec 2016 11:00:27 +0000 (12:00 +0100)]
configs: engicam: Enable CONFIG_IMAGE_FORMAT_LEGACY

Enabling FIT along with Signature will make bootm to
not-understanding u-boot legacy image formats like uImage, etc.
So this patch enabling legacy image format for backward compatibility.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
7 years agodefconfigs: imx6: engicam: Enable FIT
Jagan Teki [Wed, 21 Dec 2016 11:00:26 +0000 (12:00 +0100)]
defconfigs: imx6: engicam: Enable FIT

Enable Flattened Image Tree support for all Engicam boards.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
7 years agoimx6: engicam: Add nandboot env support
Jagan Teki [Wed, 21 Dec 2016 11:00:25 +0000 (12:00 +0100)]
imx6: engicam: Add nandboot env support

Add config options for booting Linux from NAND in UBI format.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
7 years agodefconfigs: engicam: Enable UBI commands
Jagan Teki [Wed, 21 Dec 2016 11:00:24 +0000 (12:00 +0100)]
defconfigs: engicam: Enable UBI commands

Create ubifs.img:
$ mkfs.ubifs -q -r /rootfs -m 4096 -e 253952 -c 7936 -o ubifs.img

Write ubifs.img:
---------------
icorem6qdl> nand erase.part rootfs
icorem6qdl> ubi part rootfs
icorem6qdl> ubi create rootfs

icorem6qdl> ext4load mmc 0:2 ${loadaddr} ubifs.img
166592512 bytes read in 8091 ms (19.6 MiB/s)
icorem6qdl> ubi write ${loadaddr} rootfs ${filesize}
166592512 bytes written to volume rootfs
icorem6qdl> ubifsmount ubi0:rootfs

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
7 years agodefconfigs: engicam: Enable MMC commands in nand
Jagan Teki [Wed, 21 Dec 2016 11:00:23 +0000 (12:00 +0100)]
defconfigs: engicam: Enable MMC commands in nand

For writing Linux or rootfs on to NAND, the best suitable way
is to use MMC commands since MMC driver by default enabled by
mx6_common.h, hence enabled MMC commands in nand defconfigs.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
7 years agoconfigs: engicam: Rename nand with gpmi-name in mtdparts
Jagan Teki [Wed, 21 Dec 2016 11:00:22 +0000 (12:00 +0100)]
configs: engicam: Rename nand with gpmi-name in mtdparts

gpmi-nand is the proper name used in nand driver from Linux for all
imx related nand boards, so rename mtdparts name as gpmi-nand instead
of nand, this will eventually reflects all nand info to Linux from
u-boot like mtdparts.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
7 years agoimx6: engicam: Use bootm instead of bootz
Jagan Teki [Wed, 21 Dec 2016 11:00:21 +0000 (12:00 +0100)]
imx6: engicam: Use bootm instead of bootz

Boot Linux with uImage instead of zImage, so update
bootz with bootm.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
7 years agoconfigs: engicam: Increase nand kernel partition size
Jagan Teki [Wed, 21 Dec 2016 11:00:20 +0000 (12:00 +0100)]
configs: engicam: Increase nand kernel partition size

Increase the nand kernel partition size, for supporting
large uImage files, maximum 8MiB.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
7 years agoarm: am57xx: cl-som-am57x: update default env
Uri Mashiach [Wed, 28 Dec 2016 16:28:36 +0000 (18:28 +0200)]
arm: am57xx: cl-som-am57x: update default env

Modify U-Boot default env settings.

Boot sequence:
1. SD card boot script
2. SD card boot no script
3. SATA boot script
4. SATA boot no script
5. eMMC boot script
6. eMMC boot no script

Signed-off-by: Uri Mashiach <uri.mashiach@compulab.co.il>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoarm: am57xx: cl-som-am57x: add ETH support
Dmitry Lifshitz [Wed, 28 Dec 2016 16:28:35 +0000 (18:28 +0200)]
arm: am57xx: cl-som-am57x: add ETH support

Add MAC support.

Use PHY, connected to RGMII1 as a default Eth adapter,
by appropriate setting of 'cpsw_data.active_slave'.

'cpsw_phy' env variable can override this setting.

Set the MAC addresses in the U-Boot environment.
The addresses are retrieved from the on-board EEPROM or from the SOC's
MAC fuses.

Set the following PHYs RGMII clock delays:
- Enable RX delay
- Disable TX delay

Signed-off-by: Dmitry Lifshitz <lifshitz@compulab.co.il>
[uri.mashiach@compulab.co.il: add RGMII clock delays]
Signed-off-by: Uri Mashiach <uri.mashiach@compulab.co.il>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoarm: am57xx: cl-som-am57x: fetch board rev from EEPROM
Dmitry Lifshitz [Wed, 28 Dec 2016 16:28:34 +0000 (18:28 +0200)]
arm: am57xx: cl-som-am57x: fetch board rev from EEPROM

Add PCB revision message.
Implement board revision get_board_rev API.

Signed-off-by: Dmitry Lifshitz <lifshitz@compulab.co.il>
Commit description update.
Signed-off-by: Uri Mashiach <uri.mashiach@compulab.co.il>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoarm: am57xx: cl-som-am57x: add initial board support
Dmitry Lifshitz [Wed, 28 Dec 2016 16:28:33 +0000 (18:28 +0200)]
arm: am57xx: cl-som-am57x: add initial board support

Features supported :

* Serial console
* SPI Flash
* MMC/SD Card
* eMMC storage
* SATA
* PCA9555 - GPIO expander over I2C5 bus
* USB

Use spl alternate boot device feature to define fallback to
the main boot device as it is defined by hardware.

Signed-off-by: Dmitry Lifshitz <lifshitz@compulab.co.il>
[uri.mashiach@compulab.co.il: Adjust to v2016.11]
Signed-off-by: Uri Mashiach <uri.mashiach@compulab.co.il>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
7 years agotools: binman: Use /usr/bin/env to find python executable
Emmanuel Vadot [Tue, 27 Dec 2016 21:36:08 +0000 (22:36 +0100)]
tools: binman: Use /usr/bin/env to find python executable

Some OS (all BSD and probably others) do not have python in /usr/bin
but in another directory.
It is a common usage to use /usr/bin/env python as shebang for python
scripts so use this for binman.

Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>
7 years agoOMAP3: omap3_logic: Remove display parameter
Adam Ford [Sat, 31 Dec 2016 12:33:46 +0000 (06:33 -0600)]
OMAP3: omap3_logic: Remove display parameter

The display is done in the device tree now, and there is no need
to pass 'display' kernel parameter any longer.

Signed-off-by: Adam Ford <aford173@gmail.com>
7 years agoARM: OMAP3_LOGIC: Remove ONENAND config options
Adam Ford [Sat, 31 Dec 2016 11:51:27 +0000 (05:51 -0600)]
ARM: OMAP3_LOGIC: Remove ONENAND config options

These boards do not and never have had ONENAND support, so let's remove it.

Signed-off-by: Adam Ford <aford173@gmail.com>
7 years agodoc/README.cfi: Update code snippet, and add example.
Robert P. J. Day [Thu, 29 Dec 2016 10:23:19 +0000 (05:23 -0500)]
doc/README.cfi: Update code snippet, and add example.

First, update the code snippet referenced in the README file. And
since there are only two boards that override flash_cmd_reset(),
might as well show them both.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
7 years agodigsy_mtc.c: Minor spelling/grammar fixes.
Robert P. J. Day [Thu, 29 Dec 2016 10:06:41 +0000 (05:06 -0500)]
digsy_mtc.c: Minor spelling/grammar fixes.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
7 years agomx6qsabreauto: Fix the EIM clock for the mx6qp variant
Fabio Estevam [Tue, 27 Dec 2016 01:04:41 +0000 (23:04 -0200)]
mx6qsabreauto: Fix the EIM clock for the mx6qp variant

On the MX6Q the aclk_eim_slow_podf field is '1' after POR, while on the
MX6DQP it is '3'.

This makes the EIM clock to be only 66MHz on the mx6qp variant, instead of
132 MHz.

Instead of relying on the POR values for the CSMR1 register, make sure to
manually configure the clk_eim_slow_sel field as '00' so that EIM clock is
derived from AXI clock and the aclk_eim_slow_podf field as '1' so that EIM
clock can be AXI clock divided by 2.

This way a consistent EIM clock frequency is configured for all the mx6
variants.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
7 years agoARM: imx7s-warp: enable USB gadget ethernet
Kevin Hilman [Fri, 16 Dec 2016 21:08:10 +0000 (13:08 -0800)]
ARM: imx7s-warp: enable USB gadget ethernet

Enable USB gadget ethernet by default to have networking capabilities.

Tested using DHCP and TFTP to transfer kernel, DT, ramdisk.

Cc: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
7 years agoudoo_neo: Use 'fdtfile' variable name
Fabio Estevam [Thu, 15 Dec 2016 22:10:08 +0000 (20:10 -0200)]
udoo_neo: Use 'fdtfile' variable name

'fdtfile' is the preferred name for the variable that contains the
device tree blob according to the README file.

It also makes it consistent with other i.MX boards that use config_distro,
so change it accordingly.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
7 years agoimx: thermal: Kconfig: add MX7
Peng Fan [Fri, 2 Dec 2016 05:43:03 +0000 (13:43 +0800)]
imx: thermal: Kconfig: add MX7

The thermal drivers support i.MX6 and i.MX7, add MX7 in Kconfig file.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
7 years agoMakefile: preserve output for images that can contain HAB Blocks
Sven Ebenfeld [Sun, 6 Nov 2016 15:37:58 +0000 (16:37 +0100)]
Makefile: preserve output for images that can contain HAB Blocks

To being able to sign created binaries, we need to know the HAB Blocks
for that image. Especially for the imximage type the HAB Blocks are
only available during creation of the image. We want to preserve the
information until we get to sign the files.
In the verbose case we still get them printed out instead of writing
to log files.

Cc: sbabic@denx.de
v2-Changes:
 - No usage of MKIMAGEOUTPUT_$(@F) macro.
 - Predefine default value /dev/null in every involved Makefile.

Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com>
Reviewed-by: George McCollister <george.mccollister@gmail.com>
Tested-by: George McCollister <george.mccollister@gmail.com>
7 years agodoc: imx6: add section for secure boot with SPL
Sven Ebenfeld [Sun, 6 Nov 2016 15:37:57 +0000 (16:37 +0100)]
doc: imx6: add section for secure boot with SPL

Cc: sbabic@denx.de
Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com>
Reviewed-by: George McCollister <george.mccollister@gmail.com>
7 years agotools: mkimage: add firmware-ivt image type for HAB verification
Sven Ebenfeld [Sun, 6 Nov 2016 15:37:56 +0000 (16:37 +0100)]
tools: mkimage: add firmware-ivt image type for HAB verification

When we want to use Secure Boot with HAB from SPL over U-Boot.img,
we need to append the IVT to the image and leave space for the CSF.
Images generated as firmware_ivt can directly be signed using the
Freescale code signing tool. For creation of a CSF, mkimage outputs
the correct HAB Blocks for the image.
The changes to the usual firmware image class are quite small,
that is why I implemented that directly into the default_image.

Cc: sbabic@denx.de
v2-Changes: None

Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com>
Reviewed-by: George McCollister <george.mccollister@gmail.com>
Tested-by: George McCollister <george.mccollister@gmail.com>
7 years agoarm: imx: add HAB authentication of image to SPL boot
Sven Ebenfeld [Sun, 6 Nov 2016 15:37:55 +0000 (16:37 +0100)]
arm: imx: add HAB authentication of image to SPL boot

When using HAB as secure boot mechanism on Wandboard, the chain of
trust breaks immediately after the SPL. As this is not checking
the authenticity of the loaded image before jumping to it.

The HAB status output will not be implemented in SPL as it adds
a lot of strings that are only required in debug cases. With those
it exceeds the maximum size of the available OCRAM (69 KiB).

The SPL MISC driver support must be enabled, so that the driver can use OTP fuse
to check if HAB is enabled.

Cc: sbabic@denx.de
v2-Changes: None

Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com>
Reviewed-by: George McCollister <george.mccollister@gmail.com>
Tested-by: George McCollister <george.mccollister@gmail.com>
7 years agoarm: imx: remove bmode , hdmidet and dek commands from SPL
Sven Ebenfeld [Sun, 6 Nov 2016 15:37:54 +0000 (16:37 +0100)]
arm: imx: remove bmode , hdmidet and dek commands from SPL

These files are blowing up the SPL and should not be required
there as the SPL delivers no command console. Because building fails
for mx27 and mx31 machines with SPL build, we remove the linker flag
for them from the Makefile. Nothing is built for them to be linked
in that directory.

Cc: sbabic@denx.de
v2 Changes:
 - Remove mx27 and mx31 from Makefile during SPL build as nothing is built for
   them in that directory. And removing the commands with the libs-y directive
   lead to linker failures. e.g. "armv5te-ld.bfd: cannot find arch/arm/imx-common/built-in.o: No such file or directory)"

Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com>
Reviewed-by: George McCollister <george.mccollister@gmail.com>
Tested-by: George McCollister <george.mccollister@gmail.com>
7 years agoudoo_neo: Remove USDHC3 entry
Fabio Estevam [Fri, 16 Dec 2016 13:18:32 +0000 (11:18 -0200)]
udoo_neo: Remove USDHC3 entry

Commit c94981efa20cc58 ("udoo_neo: Remove USDHC3 support") removed
the SDHC3 support, but missed to remove the entry from the usdhc_cfg
structure, so just remove it.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
7 years agommc: move MMC_SDHCI_IO_ACCESSORS to Kconfig
Masahiro Yamada [Wed, 7 Dec 2016 13:10:30 +0000 (22:10 +0900)]
mmc: move MMC_SDHCI_IO_ACCESSORS to Kconfig

This is a user-unconfigurable option that is selected by the
drivers that need to overwrite SDHCI IO memory accessors.
(BCM2835 SDHCI seems the only driver that needs to do so.)

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
7 years agommc: move some SDHCI related options to Kconfig
Masahiro Yamada [Wed, 7 Dec 2016 13:10:29 +0000 (22:10 +0900)]
mmc: move some SDHCI related options to Kconfig

While I moved the options, I also renamed them so that they are all
prefixed with MMC_SDHCI_.

This commit was created in the following steps.

[1] Rename with the following command
find . -name .git -prune -o ! -path ./scripts/config_whitelist.txt \
-type f -print | xargs sed -i -e '
s/CONFIG_MMC_SDMA/CONFIG_MMC_SDHCI_SDMA/g
s/CONFIG_BCM2835_SDHCI/CONFIG_MMC_SDHCI_BCM2835/g
s/CONFIG_KONA_SDHCI/CONFIG_MMC_SDHCI_KONA/g
s/CONFIG_MV_SDHCI/CONFIG_MMC_SDHCI_MV/g
s/CONFIG_S5P_SDHCI/CONFIG_MMC_SDHCI_S5P/g
s/CONFIG_SPEAR_SDHCI/CONFIG_MMC_SDHCI_SPEAR/g
'

[2] create the Kconfig entries in drivers/mmc/Kconfig

[3] Move the options by the following command
tools/moveconfig.py -y MMC_SDHCI_SDMA MMC_SDHCI_BCM2835 \
MMC_SDHCI_KONA MMC_SDHCI_MV MMC_SDHCI_S5P MMC_SDHCI_SPEAR

[4] Sort drivers/mmc/Makefile for readability

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
7 years agommc: move CONFIG_SDHCI to Kconfig, renaming to CONFIG_MMC_SDHCI
Masahiro Yamada [Wed, 7 Dec 2016 13:10:28 +0000 (22:10 +0900)]
mmc: move CONFIG_SDHCI to Kconfig, renaming to CONFIG_MMC_SDHCI

Move CONFIG_SDHCI to Kconfig and rename it to CONFIG_MMC_SDHCI.
My motivation for the rename is, ultimately, to make all the MMC
options prefixed with MMC_ and SDHCI options with MMC_SDHCI_,
like Linux.

This commit was created as follows:

[1] Rename the config option with the following command:
find . -name .git -prune -o ! -path ./scripts/config_whitelist.txt \
-type f -print | xargs sed -i -e 's/CONFIG_SDHCI/CONFIG_MMC_SDHCI/g'

[2] create the entry for MMC_SDHCI in drivers/mmc/Kconfig

[3] run "tools/moveconfig.py -y MMC_SDHCI"

[4] add "depends on MMC_SDHCI" to existing SDHCI driver entries

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
7 years agommc: make MMC driver entries dependent on MMC
Masahiro Yamada [Wed, 7 Dec 2016 13:10:27 +0000 (22:10 +0900)]
mmc: make MMC driver entries dependent on MMC

Currently, CONFIG_MMC is not related to any other options by
"depends on" or "select".  One of big advantages of using Kconfig
is automatic dependency tracking, but the current state is lacking
it.  As the first step, make the existing MMC driver entries depend
on MMC.

This commit was created by the following steps:

[1] Run the following script:

--------------------8<--------------------
rm -f tmp.txt

for d in $(find . -path './configs/*_defconfig')
do
        if grep -q -e 'CONFIG_MSM_SDHCI=y' $d ||
           grep -q -e 'CONFIG_ATMEL_SDHCI=y' $d ||
           grep -q -e 'CONFIG_ROCKCHIP_DWMMC=y' $d ||
           grep -q -e 'CONFIG_SH_SDHI=y' $d ||
           grep -q -e 'CONFIG_PIC32_SDHCI=y' $d ||
           grep -q -e 'CONFIG_ZYNQ_SDHCI=y' $d ||
           grep -q -e 'CONFIG_ROCKCHIP_SDHCI=y' $d ||
           grep -q -e 'CONFIG_MMC_UNIPHIER=y' $d ||
           grep -q -e 'CONFIG_SANDBOX_MMC=y' $d
        then
                echo CONFIG_MMC=y >> $d
                echo ${d#./configs/} >> tmp.txt
        fi
done

tools/moveconfig.py -y -s -d tmp.txt
rm tmp.txt
--------------------8<--------------------

[2] surround MMC driver entries with "if MMC" and "endif"

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
7 years agommc: complete unfinished move of CONFIG_MMC
Masahiro Yamada [Wed, 7 Dec 2016 13:10:26 +0000 (22:10 +0900)]
mmc: complete unfinished move of CONFIG_MMC

Commit 7a777f6d6f35 ("mmc: Add generic Kconfig option") created
a Kconfig entry for this option without any actual moves, then
commit 44c798799f66 ("sunxi: Use Kconfig CONFIG_MMC") moved
instances only for SUNXI.

We generally do not like such partial moves.  This kind of work
is automated by tools/moveconfig.py, so it is pretty easy to
complete this move.

I am adding "default ARM || PPC || SANDBOX" (suggested by Tom).
This shortens the configs and will ease new board porting.

This commit was created as follows:

[1] Edit Kconfig (remove the "depends on", add the "default",
    copy the prompt and help message from Linux)

[2] Run 'tools/moveconfig.py -y -s -r HEAD MMC'

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
7 years agoSync defconfig files by savedefconfig
Masahiro Yamada [Wed, 7 Dec 2016 13:10:25 +0000 (22:10 +0900)]
Sync defconfig files by savedefconfig

Generated by "tools/moveconfig -s".

This will make config moves easier.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
7 years agoimx: mx6sllevk: add MAINTAINERS file
Peng Fan [Tue, 27 Dec 2016 12:19:07 +0000 (20:19 +0800)]
imx: mx6sllevk: add MAINTAINERS file

add MAINTAINERS files

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
7 years agoboard: samsung: update the MAINTAINERS file
Jaehoon Chung [Tue, 27 Dec 2016 11:08:13 +0000 (20:08 +0900)]
board: samsung: update the MAINTAINERS file

Update the maintainer from Przemyslaw and Lukasz to me.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 years agocmd: net: fix function name in comment
Baruch Siach [Tue, 27 Dec 2016 09:03:29 +0000 (11:03 +0200)]
cmd: net: fix function name in comment

In commit 7044c6bb6 (net: cosmetic: Clean up DHCP variables and functions)
BootpCopyNetParams() was renamed to store_net_params(). Update the reference in
comment.

Cc: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
7 years agofs/ext4: Initialize group descriptor size for revision level 0 filesystems
Stefan Brüns [Tue, 27 Dec 2016 01:35:08 +0000 (02:35 +0100)]
fs/ext4: Initialize group descriptor size for revision level 0 filesystems

genext2fs creates revision level 0 filesystems, which are not readable
by u-boot due to the initialized group descriptor size field.
f798b1dda1c5de818b806189e523d1b75db7e72d

Reported-by: Kever Yang <kever.yang@rock-chips.com>
Reported-by: FrostyBytes@protonmail.com
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Tested-by: Kever Yang <kever.yang@rock-chips.com>
7 years agodisk: Fixed capacity message
Jean-Jacques Hiblot [Fri, 23 Dec 2016 09:45:43 +0000 (10:45 +0100)]
disk: Fixed capacity message

With capacities getting bigger, we can see see messages with negative
numbers like "Capacity: 1907729.0 MB = 1863.0 GB (-387938128 x 512)".
Here the printed LBA is -387938128 when it should have been 3907029168.
To fix this, use the right format when displaying the unsigned integers.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reported-by: Yan Liu <yan-liu@ti.com>
7 years agoUpdate Maintainer and Author's email address
Ajay Bhargav [Wed, 21 Dec 2016 07:58:06 +0000 (13:28 +0530)]
Update Maintainer and Author's email address

I am not longer using my old email address
"ajay.bhargav@einfochips.com". For U-Boot development email address is
now updated to contact@8051projects.net

Signed-off-by: Ajay Bhargav <contact@8051projects.net>
7 years agotools: mkimage: Call fclose in error path
Michal Simek [Tue, 20 Dec 2016 08:58:31 +0000 (09:58 +0100)]
tools: mkimage: Call fclose in error path

This patch is fixing missing fclose() calls
in error patch introduced by:
"tools: mkimage: Use fstat instead of stat to avoid malicious hacks"
(sha1: ebe0f53f48e8f9ecc823e533a85b05c13638c350)

Reported-by: Coverity (CID: 155064, 155065)
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoREADME: remove description about CONFIG_USE_ARCH_MEMCPY/SET
Masahiro Yamada [Mon, 19 Dec 2016 10:31:04 +0000 (19:31 +0900)]
README: remove description about CONFIG_USE_ARCH_MEMCPY/SET

These options are now described in the Kconfig help.  We do not want
to maintain duplicated documentation.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoARM: revive CONFIG_USE_ARCH_MEMCPY/MEMSET for UniPhier and Tegra
Masahiro Yamada [Mon, 19 Dec 2016 10:31:02 +0000 (19:31 +0900)]
ARM: revive CONFIG_USE_ARCH_MEMCPY/MEMSET for UniPhier and Tegra

Commit be72591bcd64 ("Kconfig: Move USE_ARCH_MEMCPY/MEMSET to
Kconfig") is misconversion.

The original logic in include/configs/uniphier.h was as follows:

  #if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_ARM64)
  #define CONFIG_USE_ARCH_MEMSET
  #define CONFIG_USE_ARCH_MEMCPY
  #endif

This means those configs were enabled when building U-Boot proper,
but disabled when building SPL.  Likewise for Tegra.

Now "depends on !SPL" prevents any boards with SPL support
from reaching these options.  This changed the behavior for
UniPhier and Tegra SoC family.

Please notice these two options only control the U-Boot proper
build.  As you see arch/arm/Makefile, ARM-specific memset/memcpy
are never compiled for SPL.  So, __HAVE_ARCH_MEMCPY/MEMSET should
not set for SPL.

Fixes: be72591bcd64 ("Kconfig: Move USE_ARCH_MEMCPY/MEMSET to Kconfig")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
7 years agoMAINTAINERS, git-mailrc: update the Power maintainer
Jaehoon Chung [Mon, 19 Dec 2016 04:36:01 +0000 (13:36 +0900)]
MAINTAINERS, git-mailrc: update the Power maintainer

Przemyslaw didn't maintain the PMIC anymore.
Update the pmic maintainer from Przeymyslaw to me.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agofs/fat: simplify get_fatent for FAT12
Stefan Brüns [Sat, 17 Dec 2016 02:55:10 +0000 (03:55 +0100)]
fs/fat: simplify get_fatent for FAT12

Instead of shuffling bits from two adjacent 16 bit words, use one 16 bit
word with the appropriate byte offset in the buffer.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
7 years agofs/fat: merge readwrite get_fatent_value() with readonly get_fatent()
Stefan Brüns [Fri, 16 Dec 2016 23:27:51 +0000 (00:27 +0100)]
fs/fat: merge readwrite get_fatent_value() with readonly get_fatent()

get_fatent_value(...) flushes changed FAT entries to disk when fetching
the next FAT blocks, in every other aspect it is identical to
get_fatent(...).

Provide a stub implementation for flush_dirty_fat_buffer if
CONFIG_FAT_WRITE is not set. Calling flush_dirty_fat_buffer during read
only operation is fine as it checks if any buffers needs flushing.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
7 years agofs/fat: Avoid corruption of sectors following the FAT
Stefan Brüns [Fri, 16 Dec 2016 23:27:50 +0000 (00:27 +0100)]
fs/fat: Avoid corruption of sectors following the FAT

The FAT is read/flushed in segments of 6 (FATBUFBLOCKS) disk sectors. The
last segment may be less than 6 sectors, cap the length.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
7 years agocmd/Kconfig: Fix typo in CMD_MEMORY help text
Fabio Estevam [Thu, 15 Dec 2016 22:02:19 +0000 (20:02 -0200)]
cmd/Kconfig: Fix typo in CMD_MEMORY help text

Fix "Memory" and "initialize" typos in the CMD_MEMORY help text.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agofat: fatwrite: fix the command for FAT12
Philipp Skadorov [Thu, 15 Dec 2016 20:52:53 +0000 (15:52 -0500)]
fat: fatwrite: fix the command for FAT12

The u-boot command fatwrite empties FAT clusters from the beginning
till the end of the file.
Specifically for FAT12 it fails to detect the end of the file and goes
beyond the file bounds thus corrupting the file system.

Additionally, FAT entry chaining-up into a file is not implemented
for FAT12.

The users normally workaround this by re-formatting the partition as
FAT16/FAT32, like here:
https://github.com/FEDEVEL/openrex-uboot-v2015.10/issues/1

The patch fixes the bounds of a file and FAT12 entries chaining into
a file, including EOF markup.

Signed-off-by: Philipp Skadorov <philipp.skadorov@savoirfairelinux.com>
7 years agorelocate-rela: use compiler.h endian macros
Jonathan Gray [Sun, 11 Dec 2016 03:51:13 +0000 (14:51 +1100)]
relocate-rela: use compiler.h endian macros

Use the endian macros from u-boot's compiler.h instead of duplicating
the definitions.

This also avoids a build error on OpenBSD by removing swap64 which
collides with a system definition in endian.h pulled in by inttypes.h.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
7 years agotimer: Support clocks via phandle
Zakharov Vlad [Fri, 9 Dec 2016 14:18:32 +0000 (17:18 +0300)]
timer: Support clocks via phandle

Earlier timer driver needed a clock-frequency property in compatible
device-tree nodes. Another way is to reference a clock via a phandle.

So now timer_pre_probe tries to get clock by reference through device
tree. In case it is impossible to get clock device through the
reference, clock-frequency property of the timer node is read to provide
backward compatibility.

Signed-off-by: Vlad Zakharov <vzakhar@synopsys.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoregulator: fixed: Add support to handle enable-active-high DT property
Vignesh R [Wed, 7 Dec 2016 11:25:06 +0000 (16:55 +0530)]
regulator: fixed: Add support to handle enable-active-high DT property

Add support to handle enable-active-high DT property. This property is
used to drive the gpio controlling fixed regulator as active high when
claiming gpio line.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Simon Glass <sjg@chromium.org>
7 years agobinman: Remove hard-coded file name for x86 CMC/FSP/VGA
Bin Meng [Mon, 26 Dec 2016 04:52:47 +0000 (20:52 -0800)]
binman: Remove hard-coded file name for x86 CMC/FSP/VGA

Now that we have added file names from Kconfig in x86 u-boot.dtsi,
update binman to avoid using hard-coded names.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agox86: Add file names from Kconfig in CMC/FSP/VGA nodes in u-boot.dtsi
Bin Meng [Mon, 26 Dec 2016 04:52:46 +0000 (20:52 -0800)]
x86: Add file names from Kconfig in CMC/FSP/VGA nodes in u-boot.dtsi

Since we already have a bunch of Kconfig options for CMC/FSP/VGA file
names, add these from Kconfig in the corresponding dts nodes.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agox86: quark: Fix build error for quark-based boards
Bin Meng [Mon, 26 Dec 2016 04:52:45 +0000 (20:52 -0800)]
x86: quark: Fix build error for quark-based boards

With the conversion to use binman to build x86 boards, Intel Galileo
board does not build anymore due to missing ucode entry. In fact
ucode is not needed for quark-based boards.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoMerge branch 'master' of git://git.denx.de/u-boot-sunxi
Tom Rini [Fri, 23 Dec 2016 23:41:56 +0000 (18:41 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-sunxi

7 years agoMerge branch 'master' of git://git.denx.de/u-boot-spi
Tom Rini [Fri, 23 Dec 2016 23:41:32 +0000 (18:41 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-spi

7 years agoMerge branch 'master' of git://git.denx.de/u-boot-samsung
Tom Rini [Fri, 23 Dec 2016 15:17:22 +0000 (10:17 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-samsung

7 years agoconfigs: enable the DM_PMIC and DM_I2C_GPIO for max8998 pmic
Jaehoon Chung [Thu, 15 Dec 2016 09:21:12 +0000 (18:21 +0900)]
configs: enable the DM_PMIC and DM_I2C_GPIO for max8998 pmic

Enable the DM_PMIC and DM_I2C_GPIO for using max8998 pmic.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
7 years agoarm: dts: s5pc1xx-goni: add the pmic node for using DM
Jaehoon Chung [Thu, 15 Dec 2016 09:21:11 +0000 (18:21 +0900)]
arm: dts: s5pc1xx-goni: add the pmic node for using DM

To use driver-model adds the pmic node for max8998.
This is used as kerel device-tree in Linux.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
7 years agopower: pmic: add the max8998 controller for DM
Jaehoon Chung [Thu, 15 Dec 2016 09:21:10 +0000 (18:21 +0900)]
power: pmic: add the max8998 controller for DM

Add the max8998 controller for Driver model.
Samsung S5P series are using max8998 pmic controller.
In future, it should be supported the regulator framework.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
7 years agommc: Extend dependencies for zynq sdhci
Michal Simek [Thu, 15 Dec 2016 10:15:49 +0000 (11:15 +0100)]
mmc: Extend dependencies for zynq sdhci

There is hard dependency on BLK and DM_MMC which is also used by ATMEL
and ROCKCHIP.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
7 years agommc: spear: remove the entire spear_sdhci.c file
Jaehoon Chung [Fri, 2 Dec 2016 08:46:10 +0000 (17:46 +0900)]
mmc: spear: remove the entire spear_sdhci.c file

Remove the entire spear_sdhci.c file.
There is no use case. This is dead codes.
Also there is no place to call "spear_sdhci_init()" anywhere.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agospi: Zap armada100_spi.c and env
Jagan Teki [Thu, 24 Nov 2016 19:28:58 +0000 (00:58 +0530)]
spi: Zap armada100_spi.c and env

armada100_spi.c and related env is zapping becuase
of "no DM conversion".

Cc: Ajay Bhargav <ajay.bhargav@einfochips.com>
Signed-off-by: Jagan Teki <jagan@openedev.com>
7 years agospi: Zap mpc52xx_spi.c, config and related code
Jagan Teki [Thu, 15 Dec 2016 16:36:47 +0000 (17:36 +0100)]
spi: Zap mpc52xx_spi.c, config and related code

armada100_spi.c, related config options and related codes
are zapping becuase of "no DM conversion".

Cc: Werner Pfister <Pfister_Werner@intercontrol.de>
Signed-off-by: Jagan Teki <jagan@openedev.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoarm64: mvebu: Fix A8K memory mapping and add documentation
Konstantin Porotchkin [Mon, 19 Dec 2016 15:04:42 +0000 (17:04 +0200)]
arm64: mvebu: Fix A8K memory mapping and add documentation

Fix the MMU mapping for A8K device family:
 - Separate A7K and A8K memory mappings
 - Fix memory regions by including IO mapping for all
   3 PCIe interfaces existing on each connected CP110 controller
Add A8K memory mapping documentation with all regions
configured by Marvell ATF.

Change-Id: I9c930569b1853900f5fba2d5db319b092cc7a2a6
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Neta Zur Hershkovits <neta@marvell.com>
Cc: Omri Itach <omrii@marvell.com>
Cc: Igal Liberman <igall@marvell.com>
Cc: Haim Boot <hayim@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
7 years agoMerge git://git.denx.de/u-boot-mpc85xx
Tom Rini [Tue, 20 Dec 2016 17:20:12 +0000 (12:20 -0500)]
Merge git://git.denx.de/u-boot-mpc85xx

7 years agopowerpc: Retain compatible property for L2 cache
Chris Packham [Fri, 2 Dec 2016 08:22:30 +0000 (21:22 +1300)]
powerpc: Retain compatible property for L2 cache

When setting the compatible property for the L2 cache ensure that we
follow the documented binding by setting both
"<chip>-l2-cache-controller" and "cache" as values.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: York Sun <york.sun@nxp.com>
7 years agosunxi: fix SID read on H3
Icenowy Zheng [Mon, 19 Dec 2016 18:03:36 +0000 (02:03 +0800)]
sunxi: fix SID read on H3

H3 SID controller has some bug, which makes the initial SID value at
SUNXI_SID_BASE wrong when boot.

Change the SID retrieve code to call the SID Controller directly on H3,
which can get the correct value, and also fix the SID value at
SUNXI_SID_BASE, so that it can be used by further operations.

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
7 years agoMerge branch 'master' of git://www.denx.de/git/u-boot-microblaze
Tom Rini [Tue, 20 Dec 2016 13:42:50 +0000 (08:42 -0500)]
Merge branch 'master' of git://www.denx.de/git/u-boot-microblaze

7 years agoMerge git://git.denx.de/u-boot-dm
Tom Rini [Tue, 20 Dec 2016 13:42:04 +0000 (08:42 -0500)]
Merge git://git.denx.de/u-boot-dm

7 years agoMerge branch 'master' of git://git.denx.de/u-boot-i2c
Tom Rini [Tue, 20 Dec 2016 13:41:54 +0000 (08:41 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-i2c

7 years agoARM64: zynqmp: Replace board specific with generic memory bank decoding
Nathan Rossi [Sun, 18 Dec 2016 14:03:34 +0000 (00:03 +1000)]
ARM64: zynqmp: Replace board specific with generic memory bank decoding

The dram_init and dram_init_banksize functions were using a board
specific implementation for decoding the memory banks from the fdt. This
board specific implementation uses a static variable 'tmp' which makes
these functions unsafe for execution from within the board_init_f
context.

This change makes the dram_init* functions use a generic implementation
of decoding and populating memory bank and size data.

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Fixes: 8d59d7f63b ("ARM64: zynqmp: Read RAM information from DT")
Cc: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
7 years agoARM: zynq: Replace board specific with generic memory bank decoding
Nathan Rossi [Sun, 18 Dec 2016 14:03:34 +0000 (00:03 +1000)]
ARM: zynq: Replace board specific with generic memory bank decoding

The dram_init and dram_init_banksize functions were using a board
specific implementation for decoding the memory banks from the fdt. This
board specific implementation uses a static variable 'tmp' which makes
these functions unsafe for execution from within the board_init_f
context.

This unsafe use of a static variable was causing a specific bug when
using the zynq_zybo configuration, U-Boot would generate the following
error during image load. This was caused due to dram_init overwriting
the relocations for the 'image' variable within the do_bootm function.
Out of coincidence the un-initialized memory has a compression type
which is the same as the value for the relocation type R_ARM_RELATIVE.

   Uncompressing Invalid Image ... Unimplemented compression type 23

It should be noted that this is just one way the issue could surface,
other cases my not be observed in normal boot flow. Depending on the
size of various sections, and location of relocations within __rel_dyn
and the compiler/linker the outcome of this bug can differ greatly.

This change makes the dram_init* functions use a generic implementation
of decoding and populating memory bank and size data.

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Fixes: 758f29d0f8 ("ARM: zynq: Support systems with more memory banks")
Cc: Michal Simek <monstr@monstr.eu>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
7 years agofdt: add memory bank decoding functions for board setup
Nathan Rossi [Sun, 18 Dec 2016 14:03:34 +0000 (00:03 +1000)]
fdt: add memory bank decoding functions for board setup

Add two functions for use by board implementations to decode the memory
banks of the /memory node so as to populate the global data with
ram_size and board info for memory banks.

The fdtdec_setup_memory_size() function decodes the first memory bank
and sets up the gd->ram_size with the size of the memory bank. This
function should be called from the boards dram_init().

The fdtdec_setup_memory_banksize() function decode the memory banks
(up to the CONFIG_NR_DRAM_BANKS) and populates the base address and size
into the gd->bd->bi_dram array of banks. This function should be called
from the boards dram_init_banksize().

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Michal Simek <monstr@monstr.eu>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
7 years agoARM64: zynqmp: Add one empty line between license and nodes
Michal Simek [Fri, 16 Dec 2016 12:12:48 +0000 (13:12 +0100)]
ARM64: zynqmp: Add one empty line between license and nodes

Sync with Linux kernel.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>