Commit Graph

41799 Commits

Author SHA1 Message Date
Tom Rini 035ebf85b0 Merge branch 'master' of git://git.denx.de/u-boot-spi 2017-01-15 13:33:30 -05:00
Tom Rini cc422dae21 Merge branch 'master' of git://git.denx.de/u-boot-sunxi 2017-01-15 13:33:16 -05:00
Jagan Teki 68e7999ba9 spi: Zap cf_qspi driver and related code
Dropped becuase
- driver not used any board.
- no dm conversion.

Cc: Angelo Dureghello <angelo@sysam.it>
Cc: Richard Retanubun <richardretanubun@ruggedcom.com>
Signed-off-by: Jagan Teki <jagan@openedev.com>
Acked-by: Angelo Dureghello <angelo@sysam.it>
2017-01-15 18:29:04 +01:00
Andre Przywara 7490130c9f sunxi: OrangePi Zero: defconfig: enable SPI flash
Newer OrangePi Zero boards all come with 16 Mib SPI flash soldered, from
which the board can actually boot from.
Enable the SPL support for the SPI controller and SPI flash to allow
putting the SPL, the DT and U-Boot proper into there. This will let
a board boot without an SD card inserted.
The flash chip can be written with a version of the sunxi-fel tool.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Priit Laes <plaes@plaes.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
2017-01-15 18:22:27 +01:00
Andre Przywara 8b15f8eb67 sunxi: dts: OrangePi Zero: add Ethernet node
The OrangePi Zero can happily use the EMAC along with its integrated
PHY to use Ethernet (for TFTP booting, for instance).
Add the emac node to the board .dts by copying it from the OrangePi One
DT.

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>
2017-01-15 18:21:39 +01:00
Icenowy Zheng 485329a578 sunxi: add orangepi zero defconfig
Orange Pi Zero is a board designed by Xunlong. It has an Allwinner H2+
SoC (similar to H3, which shares the same SoC ID), 256MB/512MB RAM,
Allwinner XR819 SDIO Wi-Fi, a MicroUSB port which is used to power the
board (also capable of OTG), a USB Type-A socket and a MicroSD slot.

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
Reviewed-by: Jagan Teki <jagan@openedev.com>
2017-01-15 18:16:12 +01:00
Icenowy Zheng 59603d026b sunxi: add proper device tree for Orange Pi Zero boards
Add a proper device tree file for Orange Pi Zero boards from Xunlong,
which come with a Allwinner H2+ SoC (similar to H3).

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
Reviewed-by: Jagan Teki <jagan@openedev.com>
2017-01-15 18:16:12 +01:00
Jelle van der Waa 2fc554d3e3 sunxi: enable H3 EMAC for the nanopi neo
The nanopi already had the CONFIG_SUN8I_EMAC=y enabled in it's defconfig
file, but was missing the &emac the device tree entry.

Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
2017-01-15 18:16:12 +01:00
Meng Yi 45a0194b2b rtc: pcf2127: Update Kconfig and code style
Unfortunately version 2 of this patch was applied which was missing some
changes. Fix this.

Signed-off-by: Meng Yi <meng.yi@nxp.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
2017-01-14 16:47:59 -05:00
Ladislav Michl df015c90c3 igep00x0: Remove IGEP0020_NAND BOARD entry from MAINTAINERS
Boards with NAND and OneNAND are supported by single configuration,
thus remove now obsolete IGEP0020_NAND BOARD entry.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2017-01-14 16:47:59 -05:00
Ladislav Michl 568b471e15 igep00x0: enable CONFIG_FDT_FIXUP_PARTITIONS
SPL partition size depends on sector size and we want kernel to use
the same layout, so let U-Boot modify FDT accordingly.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2017-01-14 16:47:58 -05:00
Ladislav Michl 6fe7fe12cc omap-gpmc: use SECTOR_BYTES instead of hardcoded value
Replace hardcoded value with defined constant SECTOR_BYTES.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2017-01-14 16:47:18 -05:00
Fabien Parent 506c66ee9c omapl138_lcdk: remove empty ifdef block
Small clean-up.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2017-01-14 16:47:17 -05:00
Fabien Parent fa71f70901 omapl138_lcdk: enable SPL MMC support
Enable SPL MMC support in order to allow to build a single u-boot image
that is able to boot from MMC and NAND devices.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2017-01-14 16:47:17 -05:00
Fabien Parent c0fa385c9b davinci: spl: use bootcfg to select boot device
Right now the SPL is trying to load u-boot based on defines, i.e. one
has to define CONFIG_SPL_NAND_SIMPLE to boot from NAND,
or CONFIG_SPL_SPI_LOAD to boot from SPI FLASH, etc...
This prevent us from having a single SPL image that is able to boot from
all media, and one need to build an image for each medium. This
commit is replacing the #ifdef that select the boot medium by reading
the value of the boot pins (via the BOOTCFG register).

Now a single SPL image will be able to read from the boot pin to know
which device should be used to load u-boot.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2017-01-14 16:47:16 -05:00
Mark Kettenis 208db781ca Avoid non-portable sed construct
Using \n in a substitution is a GNU extension.  Use the 'G" command instead
to insert the desired line.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
2017-01-14 16:47:15 -05:00
Andrew F. Davis f19f131503 Makefile: Make EFI build quiet
Make building EFI example less noisy.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-01-14 16:47:14 -05:00
George McCollister f1ca1fdebf mkimage: Add support for signing with pkcs11
Add support for signing with the pkcs11 engine. This allows FIT images
to be signed with keys securely stored on a smartcard, hardware security
module, etc without exposing the keys.

Support for other engines can be added in the future by modifying
rsa_engine_get_pub_key() and rsa_engine_get_priv_key() to construct
correct key_id strings.

Signed-off-by: George McCollister <george.mccollister@gmail.com>
2017-01-14 16:47:13 -05:00
Emmanuel Vadot b1c6a54a53 ti: am335x: mmc: Set CONFIG_SYS_MMC_MAX_DEVICE
Set CONFIG_SYS_MMC_MAX_DEVICE to 2 for am335x SoC.
This define is needed in the API code.

Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>
2017-01-14 16:47:12 -05:00
Adam Ford bb5854c4f4 ARM: omap3_logic: Use DEFAULT_LINUX_BOOT_ENV from ti_armv7_common
Since we're including ti_armv7_common, let's pull in DEFAULT_LINUX_BOOT_ENV
and remove unnecessary duplicative definitions.  This patch also renames a
few environmental variables to match what is inside ti_armv7_common. This
should help future-proof any subsequent memory or memory location changes.

Signed-off-by: Adam Ford <aford173@gmail.com>
2017-01-14 16:47:12 -05:00
Chris Packham f267e40f96 lib: net_utils: enforce '.' as octet separator in string_to_ip
Ensure '.' is used to separate octets. If another character is seen
reject the string outright and return 0.0.0.0.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2017-01-14 16:47:11 -05:00
Chris Packham d921ed9a2a lib: net_utils: make string_to_ip stricter
Previously values greater than 255 were implicitly truncated. Add some
stricter checking to reject addresses with components >255.

With the input "1234192.168.1.1" the old behaviour would truncate the
address to 192.168.1.1. New behaviour rejects the string outright and
returns 0.0.0.0, which for the purposes of IP addresses can be
considered an error.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2017-01-14 16:47:11 -05:00
Robert P. J. Day 266aa86b04 Kconfig: Refactoring of top-level Kconfig file
Some refactoring of the top-level Kconfig file which includes:

* using "if" to remove numerous identical dependency tests
* reordering config entries to group related ones
* spelling and grammar fixes

There should be no functional changes, only aesthetic ones.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
2017-01-14 16:47:10 -05:00
Oded Gabbay 8c36e99f21 armv8: release slave cores from CPU_RELEASE_ADDR
When using ARMv8 with ARMV8_SPIN_TABLE=y, we want the slave cores to
wait on spin_table_cpu_release_addr, until the Linux kernel will "wake" them
by writing to that location. The address of spin_table_cpu_release_addr is
transferred to the kernel using the device tree that is updated by
spin_table_update_dt().

However, if we also use SPL, then the slave cores are stuck at
CPU_RELEASE_ADDR instead and as a result, never wake up.

This patch releases the slave cores by writing spl_image->entry_point to
CPU_RELEASE_ADDR location before the end of the SPL code
(at jump_to_image_no_args()).

That way, the slave cores will start to execute the u-boot and will get to
the spin-table code and wait on the correct address
(spin_table_cpu_release_addr).

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-01-14 16:47:10 -05:00
Masahiro Yamada 6569c0d325 iopoll: import include/linux/iopoll.h from Linux 4.9
This was imported from Linux 4.9 and adjusted for U-Boot.

 - Replace the license block with SPDX
 - Drop all *_atomic variants, which make no sense for U-Boot
 - Remove the sleep_us argument, which makes no sense for U-Boot

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-01-14 16:46:30 -05:00
Masahiro Yamada 21cdd133ca time: import time_after, time_before and friends from Linux
It is not safe to compare timer values directly.

On 32-bit systems, for example, timer_get_us() wraps around every
72 min. (2 ^ 32 / 1000000 =~ 4295 sec =~ 72 min).  Depending on
the get_ticks() implementation, it may wrap more frequently.
The 72 min might be possible on the use of U-Boot.

Let's borrow time_after, time_before, and friends to solve the
wrap-around problem.

These macros were copied from include/linux/jiffies.h of Linux 4.9.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-01-14 16:46:30 -05:00
Masahiro Yamada ff90af6c73 typecheck: import include/linux/typecheck.h from Linux 4.9
Copied from Linux 4.9.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-01-14 16:46:29 -05:00
Masahiro Yamada a7b8176999 time: move timer APIs to include/time.h
The include/common.h is a collection of unrelated declarations,
macros, etc.

It is horrible to include such a cluttered header just for some
timer functions.  Split out timer functions into include/time.h.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-01-14 16:46:29 -05:00
Masahiro Yamada 5bc516ed66 delay: collect {m, n, u}delay declarations to include/linux/delay.h
Currently, mdelay() and udelay() are declared in include/common.h,
while ndelay() in include/linux/compat.h.  It would be nice to
collect them into include/linux/delay.h like Linux.

While we are here, fix the ndelay() implementation; I used the
DIV_ROUND_UP() instead of (x)/1000 because it must wait *longer*
than the given period of time.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-01-14 16:46:28 -05:00
Oded Gabbay 4b105f6ca9 armv8: fix #if around spin-table code in start.S
Using CONFIG_IS_ENABLED() doesn't work in SPL. This patch replaces the only
occurrence of CONFIG_IS_ENABLED() in start.S to a regular #if defined().
It also adds "&& !defined(CONFIG_SPL_BUILD)" to that #if statement because
the spin-table code can't currently work in SPL, and the spin-table file
isn't even compiled in SPL.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
2017-01-14 16:46:27 -05:00
Stefan Agner 22802f4e3a spl: move RAM boot support in separate file
Add a new top-level config option so support booting an image stored
in RAM. This allows to move the RAM boot support into a sparate file
and having a single condition to compile that file.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2017-01-14 16:46:26 -05:00
Stefan Agner f417d40fe2 Convert CONFIG_SPL_RAM_DEVICE to defconfig
This converts the following to Kconfig:
  CONFIG_SPL_RAM_DEVICE

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2017-01-14 16:46:26 -05:00
Andrew F. Davis 4ac19bae2d arm: omap-common: add secure ROM signature verify index for AM33xx
On AM33xx devices the secure ROM uses a different call index for
signature verification, the function and arguments are the same.

Signed-off-by: Andrew F. Davis <afd@ti.com>
2017-01-14 16:46:24 -05:00
Andrew F. Davis 2170652d98 ti_armv7_common: env: Use FIT image configs by default
This allows us to specify a FIT configuration that will automatically
use the correct images from the FIT blob.

Signed-off-by: Andrew F. Davis <afd@ti.com>
2017-01-14 16:46:24 -05:00
Andrew F. Davis 4e2fdf4511 MAINTAINERS: Add maintainer for TI security related files
Changes involving High-Security boards should be CC'd for additional
assessment of the security implications.

Signed-off-by: Andrew F. Davis <afd@ti.com>
2017-01-14 16:46:23 -05:00
Gary Bisson 8547f45bc5 cmd: sata: fix init command return value
Since commit aa6ab905b2, sata_initialize returns -1 if init_sata or
scan_sata fails. But this return value becomes the do_sata return
value which is equivalent to CMD_RET_USAGE.

In case one issues 'sata init' and that the hardware fails to
initialize, there's no need to display the command usage. Instead
the command shoud just return the CMD_RET_FAILURE value.

Fixes: aa6ab905b2 (sata: fix sata command can not being executed bug)

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
Reviewed-by: Eric Nelson <eric@nelint.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-01-14 16:46:23 -05:00
Tom Rini 7f73ca484f Kconfig: CONFIG_OF_PLATDATA doesn't really exist
There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename
the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA.

Signed-off-by: Tom Rini <trini@konsulko.com>
2017-01-14 12:20:23 -05:00
Tom Rini f9dadaef8b arm: Re-sync asm/mach-types.h with Linux Kernel v4.9
This re-syncs the MACH_TYPE_xxx values from the Linux Kernel v4.9
release.  In addition this removes all of the machine_arch_type and
machine_is_xxx logic that is unused in U-Boot.  This removal removes a
large number of otherwise unused CONFIG values from the list to be
converted.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Tested-by: Adam Ford <aford173@gmail.com>
2017-01-14 12:18:12 -05:00
Tom Rini 70b26cd057 arm: Remove unregister MACH_TYPE_xxx uses
Before we can sync with the latest mach-types.h file from the Linux
Kernel we need to remove some instances of MACH_TYPE_xxx from our
sources.  As these values have been removed from the canonical upstream
source we should not be using them either, so drop.

Cc: Tom Warren <twarren@nvidia.com>
Cc: Lucas Stach <dev@lynxeye.de>
Cc: Luka Perkov <luka@openwrt.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Heiko Schocher <hs@denx.de>
Cc: Thomas Weber <weber@corscience.de>
Cc: Lucile Quirion <lucile.quirion@savoirfairelinux.com>
Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Suriyan Ramasami <suriyan.r@gmail.com>
Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Cc: Bo Shen <voice.shen@atmel.com>
Cc: Nick Thompson <nick.thompson@gefanuc.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Erik van Luijk <evanluijk@interact.nl>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2017-01-14 12:18:11 -05:00
Tom Rini d5324e2fb6 omap3_igep00x0: Rework MACH_TYPE and status LED logic slightly
The MACH_TYPE for IGEP0032 was never officially used and has been
removed from upstream, so we must not use it.  In order to remove this
we need to rework the status LED logic.

Cc: Enric Balletbo i Serra <eballetbo@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
2017-01-14 12:18:08 -05:00
Tom Rini c63d270d15 omap3_logic: Rework MACH_TYPE and fdtfile logic
The MACH_TYPE values for the omap37xx based platforms are no longer
officially valid, so we must not set and pass them.  In order to not
reference them but still be able to set the default fdtfile based on the
board detection logic we need to combine the two steps into one.

Cc: Adam Ford <aford173@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Adam Ford <aford173@gmail.com>
2017-01-14 12:18:07 -05:00
Tom Rini b7127e3c51 Merge git://git.denx.de/u-boot-fdt 2017-01-14 12:16:43 -05:00
Andreas Färber b05bf6c75d cmd/fdt: Make fdt get value endian-safe for single-cell properties
On a Raspberry Pi 2 disagreements on cell endianness can be observed:

  U-Boot> fdt print /soc/gpio@7e200000 phandle
  phandle = <0x0000000d>
  U-Boot> fdt get value myvar /soc/gpio@7e200000 phandle; printenv myvar
  myvar=0x0D000000

Fix this by always treating the pointer as BE and converting it in
fdt_value_setenv(), like its counterpart fdt_parse_prop() already does.

Consistently use fdt32_t, fdt32_to_cpu() and cpu_to_fdt32().

Fixes: bc80295 ("fdt: Add get commands to fdt")
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Gerald Van Baren <gvb@unssw.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Simon Glass <sjg@chromium.org>
2017-01-14 10:09:46 -07:00
Stefan Agner 082b1414e8 cmd: fdt: Print error message when fdt application fails
There are lots of reason why a FDT application might fail, the
error code might give an indication. Let the error code translate
in a error string so users can try to understand what went wrong.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Simon Glass <sjg@chromium.org>
2017-01-13 18:19:45 -07:00
David Gibson 46743c412d libfdt: Correct fdt handling of overlays without fixups and base trees without symbols
The fdt_overlay_apply() function purports to support the edge cases where
an overlay has no fixups to be applied, or a base tree which has no
symbols (the latter can only work if the former is also true).  However it
gets it wrong in a couple of small ways:

  * In the no fixups case, it doesn't fail immediately, but will attempt
    fdt_for_each_property_offset() giving -FDT_ERR_NOTFOUND as the node
    offset, which will fail.  Instead it should succeed immediately, since
    there's nothing to do.
  * In the case of no symbols, it again doesn't fail immediately.  However
    if there is an actual fixup it will fail with an unexpected error,
    because -FDT_ERR_NOTFOUND is passed to fdt_getprop() when attempting to
    look up the symbols.  We should instead return -FDT_ERR_NOTFOUND
    directly.

Both of these errors lead to the code returning misleading error codes in
failing cases.

[ DTC commit: 7d8ef6e1db9794f72805a0855f4f7f12fadd03d3 ]

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>
2017-01-13 18:19:45 -07:00
Jagan Teki ee86e0d2fe spi: Zap ep93xx_spi driver and related code
Dropped becuase
- driver and related configs not used any board.
- no dm conversion.

Cc: Heiko Schocher <hs@denx.de>
Cc: Sergey Kostanbaev <sergey.kostanbaev@gmail.com>
Signed-off-by: Jagan Teki <jagan@openedev.com>
2017-01-13 22:47:14 +01:00
tomas.melin@vaisala.com 3b593f9030 splash: fix splash source flags check
SPLASH_STORAGE_RAW is defined as 0, so a check against & will
never be true. These flags are never combined so do a check
against == instead.

Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2017-01-13 20:45:25 +01:00
Anatolij Gustschin b4fc6f2214 video: cfb_console: fix hang if splashimage file is missing
If the splash file doesn't exist, the booting stops bricking
the boards. Check return value of prepare function and stop
decoding the logo data if splash prepare stage failed.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
2017-01-13 20:20:35 +01:00
tomas.melin@vaisala.com db1b79b886 splash: add support for loading splash from a FIT image
Enable support for loading a splash image from within a FIT image.
The image is assumed to be generated with mkimage -E flag to hold
the data external to the FIT.

Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
2017-01-13 17:40:38 +01:00
tomas.melin@vaisala.com 7583f1f577 splash: sort include files
Sort include files in accordance to U-Boot coding style.

Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
2017-01-13 17:39:15 +01:00