oweals/u-boot.git
6 years agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 3 Sep 2018 19:26:12 +0000 (15:26 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agospl: Kconfig: Fix typo in 'Upgrade'
Fabio Estevam [Fri, 31 Aug 2018 13:02:28 +0000 (10:02 -0300)]
spl: Kconfig: Fix typo in 'Upgrade'

Correct the spelling of 'Upgrade'.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
6 years agoMake kmalloc'ed memory really DMA-safe
Masahiro Yamada [Fri, 24 Aug 2018 10:30:15 +0000 (19:30 +0900)]
Make kmalloc'ed memory really DMA-safe

In Linux, the memory returned by kmalloc() is DMA-capable.
However, it is not true in U-Boot.

At a glance, kmalloc() in U-Boot returns address aligned with
ARCH_DMA_MINALIGN.  However, it never pads the allocated memory.
This half-way house is completely useless because calling kmalloc()
and malloc() in this order causes a cache sharing problem.

Change the implementation to call malloc_cache_aligned(), which
allocates really DMA-capable memory.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agotest: fix typo in cmd_ut_category() description
Heinrich Schuchardt [Mon, 27 Aug 2018 20:04:10 +0000 (22:04 +0200)]
test: fix typo in cmd_ut_category() description

argc = 1: all tests are run
argc > 1: only argv[1] is run

So we need argc >= 1.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agohisilicon: hikey: Update instructions based on latest source
Manivannan Sadhasivam [Wed, 29 Aug 2018 04:37:36 +0000 (10:07 +0530)]
hisilicon: hikey: Update instructions based on latest source

Update the HiKey board instructions based on the latest source
available. These instructions are derived from the ATF platform doc.
While updating the instructions, some comments on ATF issue has been
removed since it is fixed in latest ATF source.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
6 years agoMerge branch 'master' of git://git.denx.de/u-boot-sh
Tom Rini [Thu, 30 Aug 2018 14:15:03 +0000 (10:15 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-sh

6 years agoMerge branch 'master' of git://git.denx.de/u-boot-usb
Tom Rini [Thu, 30 Aug 2018 14:06:29 +0000 (10:06 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-usb

6 years agoMerge branch 'master' of git://git.denx.de/u-boot-rockchip
Tom Rini [Thu, 30 Aug 2018 14:06:19 +0000 (10:06 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-rockchip

6 years agoMerge git://git.denx.de/u-boot-x86
Tom Rini [Thu, 30 Aug 2018 14:06:11 +0000 (10:06 -0400)]
Merge git://git.denx.de/u-boot-x86

6 years agommc: renesas-sdhi: Use priv directly
Marek Vasut [Thu, 30 Aug 2018 13:27:26 +0000 (15:27 +0200)]
mmc: renesas-sdhi: Use priv directly

The dev_get_priv(dev) is used twice in the probe function.
Replace the second invocation with priv variable.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
6 years agox86: zimage: Remove acpi_rsdp_addr propagation to kernel boot parameters
Bin Meng [Fri, 24 Aug 2018 04:28:58 +0000 (21:28 -0700)]
x86: zimage: Remove acpi_rsdp_addr propagation to kernel boot parameters

As of today, the proposal of adding "acpi_rsdp_addr" to the kernel
boot protocol does not make its way to the kernel mainline. This
creates some confusion if we leave it in the U-Boot code base.
Remove it for now until we have a clear picture with kernel upstream.

Note this eventually does a partial revert to commit 3469bf427454
("x86: zImage: Propagate acpi_rsdp_addr to kernel via boot parameters")

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agox86: efi: payload: Turn on acpi in the kernel command line
Bin Meng [Thu, 23 Aug 2018 15:24:11 +0000 (08:24 -0700)]
x86: efi: payload: Turn on acpi in the kernel command line

Now that we have full Linux kernel boot support on EFI payload,
avoid pass "acpi=off" to the kernel command line.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agox86: zimage: Support booting Linux kernel from an EFI payload
Bin Meng [Thu, 23 Aug 2018 15:24:10 +0000 (08:24 -0700)]
x86: zimage: Support booting Linux kernel from an EFI payload

At present Linux kernel loaded from U-Boot as an EFI payload does
not boot. This fills in kernel's boot params structure with the
required critical EFI information like system table address and
memory map stuff so that kernel can obtain essential data like
runtime services and ACPI table to boot.

With this patch, now U-Boot as an EFI payload becomes much more
practical: it is another option of kernel bootloader, ie, can be
a replacement for grub.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agoefi: stub: Pass EFI system table address to U-Boot payload
Bin Meng [Thu, 23 Aug 2018 15:24:09 +0000 (08:24 -0700)]
efi: stub: Pass EFI system table address to U-Boot payload

This updates the EFI stub codes to pass UEFI BIOS's system table
address to U-Boot payload so that U-Boot can utilize it.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agox86: efi: payload: Install E820 map from EFI memory map
Bin Meng [Thu, 23 Aug 2018 15:24:08 +0000 (08:24 -0700)]
x86: efi: payload: Install E820 map from EFI memory map

This implements payload-specific install_e820_map() to get E820 map
from the EFI memory map descriptors.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agorockchip: dts: fix unnecessary '-cells' warning
Kever Yang [Tue, 28 Aug 2018 09:57:32 +0000 (17:57 +0800)]
rockchip: dts: fix unnecessary '-cells' warning

Fix warning below:
unnecessary #address-cells/#size-cells without "ranges" or child "reg"
property

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agousb: dwc2: Add reset ctrl to driver
Ley Foon Tan [Tue, 28 Aug 2018 16:08:48 +0000 (00:08 +0800)]
usb: dwc2: Add reset ctrl to driver

Add code to reset all reset signals as in usb DT node. A reset property
is an optional feature, so only print out a warning and do not fail if a
reset property is not present.

If a reset property is discovered, then use it to deassert, thus
bringing the IP out of reset.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
6 years agopci: rmobile: Filter out device 1 and 2
Marek Vasut [Fri, 24 Aug 2018 19:03:14 +0000 (21:03 +0200)]
pci: rmobile: Filter out device 1 and 2

Only PCI device 1 and 2 is populated on the R-Car Gen2 internal
PCIe controller. Ignore all other devices. This fix prevents a
duplication of OHCI controller response on slot 0 and 1.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
6 years agousb: ehci: Add PHY support to ehci-pci
Marek Vasut [Tue, 7 Aug 2018 10:27:10 +0000 (12:27 +0200)]
usb: ehci: Add PHY support to ehci-pci

Add support for operating a PHY attached to ehci-pci. There are
systems where the EHCI controller is internally wired to a PCI
bus and has a PHY connected to it as well, ie. the R-Car Gen2.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
6 years agousb: ehci: Make the PHY handling generic
Marek Vasut [Wed, 8 Aug 2018 12:29:55 +0000 (14:29 +0200)]
usb: ehci: Make the PHY handling generic

Pull out the EHCI PHY functions into the ehci-hcd.c to let other
EHCI drivers use them.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
6 years agophy: Fix warning due to missing definition of structure
Marek Vasut [Thu, 16 Aug 2018 12:37:03 +0000 (14:37 +0200)]
phy: Fix warning due to missing definition of structure

Fix this sort of warning if generic-phy.h is included:

include/generic-phy.h:52:42: warning: ‘struct ofnode_phandle_args’ declared inside parameter list will not be visible outside of this definition or declaration
  int (*of_xlate)(struct phy *phy, struct ofnode_phandle_args *args);

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
6 years agoconfigs: am57xx: change default board name to beagle_x15
Praneeth Bajjuri [Wed, 22 Aug 2018 04:47:49 +0000 (23:47 -0500)]
configs: am57xx: change default board name to beagle_x15

beagleboard x15 is the first supported platform variant of am57xx
in AOSP (android open source project) now.

changing board name to stay in consistent with aosp target name.

Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
6 years agocmd: ubi: change 'default y' for SUNXI to 'imply' in Kconfig
Masahiro Yamada [Mon, 9 Jul 2018 06:12:37 +0000 (15:12 +0900)]
cmd: ubi: change 'default y' for SUNXI to 'imply' in Kconfig

It is not preferred to put SUNXI-specific code in the common place.

Change it to 'imply' property of ARCH_SUNXI.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agoMerge branch 'master' of git://git.denx.de/u-boot-socfpga
Tom Rini [Fri, 24 Aug 2018 20:11:12 +0000 (16:11 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-socfpga

6 years agoMerge branch 'master' of git://git.denx.de/u-boot-usb
Tom Rini [Fri, 24 Aug 2018 20:11:01 +0000 (16:11 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-usb

6 years agoMerge branch 'master' of git://git.denx.de/u-boot-sunxi
Tom Rini [Fri, 24 Aug 2018 20:10:54 +0000 (16:10 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-sunxi

6 years agoARM: dts: am33xx: fix SLEWCTRL_FAST pinctrl binding
Christian Amann [Tue, 21 Aug 2018 15:04:09 +0000 (17:04 +0200)]
ARM: dts: am33xx: fix SLEWCTRL_FAST pinctrl binding

Copy missing Kernel patch to make SLEWCTRL_SLOW available in device tree
and to correct the value of SLEWCTRL_FAST.
After this patch, the Kernel and U-boot device tree settings for
SLEWCTRL have the same effect.

Original Kernel patch message:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=424e0f039bfa8a51fb5c5178b6ece8baa4996469

"
According to AM335x TRM, Document spruh73l, Revised February 2015,
Section 9.2.2 Pad Control Registers, setting bit 6 of the pad control
registers actually sets the SLEWCTRL value to slow rather than fast as
the current macro indicates. Introduce a new macro, SLEWCTRL_SLOW, that
sets the bit, and modify SLEWCTRL_FAST to 0 but keep it for
completeness. Current users of the macro (i2c and mdio) are left
unmodified as SLEWCTRL_FAST was the macro used and actual desired state.
Tested on am335x-gp-evm with no difference in software performance seen.
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
"

Signed-off-by: Christian Amann <Christian.Amann@de.bosch.com>
6 years agoenv: ubi: Add missing ENV_NAME
Marek Vasut [Tue, 21 Aug 2018 13:53:33 +0000 (15:53 +0200)]
env: ubi: Add missing ENV_NAME

Add missing environment name for UBI, to prevent this NULL in output:
Loading Environment from <NULL>...
and rather have a valid UBI there:
Loading Environment from UBI...

Signed-off-by: Marek Vasut <marex@denx.de>
6 years agou-boot: align cache flushes in load_elf_image_shdr to line boundaries
Neil Stainton [Mon, 20 Aug 2018 15:46:19 +0000 (15:46 +0000)]
u-boot: align cache flushes in load_elf_image_shdr to line boundaries

Prevent cache warning messages when using the 'bootelf' command on an
Arm target. Round down each section start address and round up the
respective section end to the nearest cache line.

Currently when using bootelf to load an image on Arm, several warnings
such as the following appear in the console:
  CACHE: Misaligned operation at range [878000008783c5e0]
  CACHE: Misaligned operation at range [8783c5e08784b3e0]

Signed-off-by: Neil Stainton <nstainton@asl-control.co.uk>
[trini: Reword commit message to include the info after the --- which
included the Signed-off-by line, and change ' at ' to '@']
Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agoARM: display5: Remove "factory procedure" from display5 board config
Lukasz Majewski [Mon, 20 Aug 2018 14:23:58 +0000 (16:23 +0200)]
ARM: display5: Remove "factory procedure" from display5 board config

This code now is regarded as dead one and hence shall be removed.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
6 years agodm: test: Fix typo in test-main comment
Michal Simek [Mon, 20 Aug 2018 06:03:22 +0000 (08:03 +0200)]
dm: test: Fix typo in test-main comment

Trivial fix.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agomalloc_simple: calloc: don't call memset if malloc failed
Simon Goldschmidt [Thu, 16 Aug 2018 07:50:32 +0000 (09:50 +0200)]
malloc_simple: calloc: don't call memset if malloc failed

malloc_simple() can return 0 if out of memory. Don't call memset
from calloc() in this case but rely on the caller checking
the return value.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>
6 years agoboard: arm: bcmstb: Declare get_ticks in timer.h
Thomas Fitzsimmons [Thu, 16 Aug 2018 01:33:49 +0000 (21:33 -0400)]
board: arm: bcmstb: Declare get_ticks in timer.h

In an earlier proposed patch, bcmstb.c implemented timer_read_counter,
but it was updated to implement get_ticks instead.  This patch updates
the declaration in timer.h accordingly.

Signed-off-by: Thomas Fitzsimmons <fitzsim@fitzsim.org>
6 years agoboards: amlogic: remove ethernet gpio reset code from boards
Beniamino Galvani [Tue, 14 Aug 2018 13:07:52 +0000 (15:07 +0200)]
boards: amlogic: remove ethernet gpio reset code from boards

The reset is already handled by the designware driver using
information from device tree.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
6 years agocommon: avb_verify: Fix division by zero in mmc_byte_io()
Eugeniu Rosca [Tue, 14 Aug 2018 00:43:09 +0000 (02:43 +0200)]
common: avb_verify: Fix division by zero in mmc_byte_io()

Compiling U-Boot with ubsan/asan libraries and running it in sandbox
may lead to below backtrace:

 => avb init 0
 => avb verify
 ## Android Verified Boot 2.0 version 1.1.0
read_is_device_unlocked not supported yet
common/avb_verify.c:407:31: runtime error: division by zero
AddressSanitizer:DEADLYSIGNAL
Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
=================================================================
==9388==ERROR: AddressSanitizer: FPE on unknown address 0x0000004b467f \
    (pc 0x0000004b467f bp 0x000000000000 sp 0x7ffd899fe150 T0)
    #0 0x4b467e in mmc_byte_io common/avb_verify.c:407
    #1 0x4b4c47 in mmc_byte_io common/avb_verify.c:532
    #2 0x4b4c47 in read_from_partition common/avb_verify.c:533
    #3 0x69dc0d in load_and_verify_vbmeta lib/libavb/avb_slot_verify.c:560
    #4 0x6a1ee6 in avb_slot_verify lib/libavb/avb_slot_verify.c:1139
    #5 0x45dabd in do_avb_verify_part cmd/avb.c:245
    #6 0x4af77c in cmd_call common/command.c:499
    #7 0x4af77c in cmd_process common/command.c:538
    #8 0x46bafc in run_pipe_real common/cli_hush.c:1677
    #9 0x46bafc in run_list_real common/cli_hush.c:1875
    #10 0x46c780 in run_list common/cli_hush.c:2024
    #11 0x46c780 in parse_stream_outer common/cli_hush.c:3216
    #12 0x46d34b in parse_file_outer common/cli_hush.c:3299
    #13 0x4ad609 in cli_loop common/cli.c:217
    #14 0x4625ae in main_loop common/main.c:65
    #15 0x46f2d1 in run_main_loop common/board_r.c:648
    #16 0x640253 in initcall_run_list lib/initcall.c:30
    #17 0x46f9d0 in board_init_r common/board_r.c:879
    #18 0x40539b in main arch/sandbox/cpu/start.c:321
    #19 0x7fa94925f82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #20 0x408908 in _start (/srv/R/u-boot-master/u-boot+0x408908)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: FPE common/avb_verify.c:407 in mmc_byte_io
==9388==ABORTING

Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
6 years agocommon: avb_verify: Fix never-occurring avb_free(ops_data)
Eugeniu Rosca [Tue, 14 Aug 2018 00:43:08 +0000 (02:43 +0200)]
common: avb_verify: Fix never-occurring avb_free(ops_data)

Cppcheck (v1.85) reports w/o this patch:

[common/avb_verify.c:738] -> [common/avb_verify.c:741]: (warning) \
  Either the condition 'ops' is redundant or there is possible null \
  pointer dereference: ops.

Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
6 years agocommon: avb_verify: Fix memory leaks
Eugeniu Rosca [Tue, 14 Aug 2018 00:43:07 +0000 (02:43 +0200)]
common: avb_verify: Fix memory leaks

Cppcheck (v1.85) reports w/o this patch:

[common/avb_verify.c:351]: (error) Memory leak: part
[common/avb_verify.c:356]: (error) Memory leak: part
[common/avb_verify.c:361]: (error) Memory leak: part
[common/avb_verify.c:366]: (error) Memory leak: part

Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
6 years agocommon: avb_verify: Make local data static
Eugeniu Rosca [Tue, 14 Aug 2018 00:43:06 +0000 (02:43 +0200)]
common: avb_verify: Make local data static

Fix sparse complaint:

common/avb_verify.c:14:21: warning: \
  symbol 'avb_root_pub' was not declared. Should it be static?

Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
6 years agocommon: kconfig: Mark AVB_VERIFY as dependent on PARTITION_UUIDS
Eugeniu Rosca [Tue, 14 Aug 2018 00:43:05 +0000 (02:43 +0200)]
common: kconfig: Mark AVB_VERIFY as dependent on PARTITION_UUIDS

Avoid below compiler [1] errors, reproduced with configuration [2]:

common/avb_verify.c: In function ‘get_unique_guid_for_partition’:
common/avb_verify.c:692:31: error: ‘disk_partition_t {aka struct disk_partition}’ has no member named ‘uuid’
  uuid_size = sizeof(part->info.uuid);
                               ^
common/avb_verify.c:696:29: error: ‘disk_partition_t {aka struct disk_partition}’ has no member named ‘uuid’
  memcpy(guid_buf, part->info.uuid, uuid_size);
                             ^
  LD      drivers/built-in.o
make[2]: *** [scripts/Makefile.build:278: common/avb_verify.o] Error 1

[1] aarch64-linux-gnu-gcc (Linaro GCC 7.2-2017.11)
[2] r8a7795_ulcb_defconfig, plus:
    CONFIG_AVB_VERIFY=y
    CONFIG_PARTITION_UUIDS=y
    CONFIG_UDP_FUNCTION_FASTBOOT=y
    CONFIG_LIBAVB=y

Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
6 years agocommon: avb_verify: Fix invalid 'for' loop condition
Eugeniu Rosca [Tue, 14 Aug 2018 00:43:04 +0000 (02:43 +0200)]
common: avb_verify: Fix invalid 'for' loop condition

Fix below compiler [1] warning:

common/avb_verify.c: In function ‘avb_find_dm_args’:
common/avb_verify.c:179:30: warning: left-hand operand of comma expression has no effect [-Wunused-value]
  for (i = 0; i < AVB_MAX_ARGS, args[i]; ++i) {

[1] aarch64-linux-gnu-gcc (Linaro GCC 7.2-2017.11)

Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
6 years agolibavb: Handle wrong hashtree_error_mode in avb_append_options()
Ievgen Maliarenko [Tue, 14 Aug 2018 00:43:03 +0000 (02:43 +0200)]
libavb: Handle wrong hashtree_error_mode in avb_append_options()

Exit with AVB_SLOT_VERIFY_RESULT_ERROR_INVALID_ARGUMENT
when hashtree_error_mode value passed to avb_append_options()
is unknown (not from AvbHashtreeErrorMode enum).

Otherwise, default value is not handled in the
switch(hashtree_error_mode), which causes below compile warning:

lib/libavb/avb_cmdline.c: In function ‘avb_append_options’:
lib/libavb/avb_cmdline.c:354:13: warning: ‘dm_verity_mode’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     new_ret = avb_replace(
     ~~~~~~~~^~~~~~~~~~~~~~
         slot_data->cmdline, "$(ANDROID_VERITY_MODE)", dm_verity_mode);
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/libavb/avb_cmdline.c:363:8: warning: ‘verity_mode’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   if (!cmdline_append_option(
        ^~~~~~~~~~~~~~~~~~~~~~
           slot_data, "androidboot.veritymode", verity_mode)) {

Signed-off-by: Ievgen Maliarenko <ievgen.maliarenko@globallogic.com>
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
6 years agoARM: dts: socfpga: Add missing NAND reset
Marek Vasut [Tue, 21 Aug 2018 13:54:22 +0000 (15:54 +0200)]
ARM: dts: socfpga: Add missing NAND reset

The NAND reset is missing from DT, so the reset manager cannot unreset the NAND.
Add the missing DT reset entry.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <chin.liang.see@intel.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
6 years agoARM: dts: socfpga: Drop ad-hoc UART clock frequency encoding from DT
Marek Vasut [Tue, 21 Aug 2018 14:26:32 +0000 (16:26 +0200)]
ARM: dts: socfpga: Drop ad-hoc UART clock frequency encoding from DT

The UART clock frequency can be obtained from the clock framework by the
ns16550 driver, so drop this redundant DT node.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <chin.liang.see@intel.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
6 years agoARM: socfpga: Convert Arria10 to timer framework
Marek Vasut [Sat, 18 Aug 2018 14:00:31 +0000 (16:00 +0200)]
ARM: socfpga: Convert Arria10 to timer framework

Switch the Arria10 from ad-hoc hardcoded timer to timer framework
and the DW APB timer driver. This allows the A10 to extract timer
information, like timer rate, from clock framework and thus DT
instead of having it hardcoded in U-Boot configuration files.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <chin.liang.see@intel.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
6 years agoARM: dts: socfpga: Flag timer clock as pre-reloc
Marek Vasut [Sat, 18 Aug 2018 17:13:28 +0000 (19:13 +0200)]
ARM: dts: socfpga: Flag timer clock as pre-reloc

Flag timer clock as DM pre-reloc, so that a timer driver can be used and
it can extract information about it's clock rate using the clock framework.
This patch also moves some of the pre-reloc flags into the core dtsi file,
this is because the timer is not board specific, but rather is used on all
boards.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <chin.liang.see@intel.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
6 years agotimer: dw-apb: Add Designware APB timer driver
Marek Vasut [Sat, 18 Aug 2018 13:58:32 +0000 (15:58 +0200)]
timer: dw-apb: Add Designware APB timer driver

Add timer driver for the Designware APB Timer IP. This is present
for example on the Altera SoCFPGA chips.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <chin.liang.see@intel.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
6 years agoARM: socfpga: Reorder Arria10 SPL
Marek Vasut [Sat, 18 Aug 2018 17:11:52 +0000 (19:11 +0200)]
ARM: socfpga: Reorder Arria10 SPL

The Arria10 SPL is a complete mess of calls to functions which are
called in the wrong context and it is surprise it works at all. This
patch tries to clean that mess up by shuffling the function calls
around and moving the calls into the correct context. Due to the
delicate nature of the reordering, this is done in one huge patch.

The following changes happen in this patch:
- Security policy init and NIC301 happens first in board_init_f()
- The clock init happens very early in board_init_f() in SPL only
- arch_early_init_r() only registers the FPGA, just like on Gen5
- arch_early_init_r() is never called from any _f() function
- Dedicated FPGA pins are inited in board_init_f() as on Gen5

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <chin.liang.see@intel.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
6 years agoarm: socfpga: stratix10: Fix mailbox urgent command with urgent register
Ley Foon Tan [Fri, 17 Aug 2018 08:22:03 +0000 (16:22 +0800)]
arm: socfpga: stratix10: Fix mailbox urgent command with urgent register

According to mailbox spec, software should send urgent command with
urgent register instead of COUT location. This patch write urgent
command index to urgent register.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
6 years agoarm: socfpga: stratix10: Enable EMAC to FPGA bridge based on handoff
Ley Foon Tan [Fri, 17 Aug 2018 08:22:02 +0000 (16:22 +0800)]
arm: socfpga: stratix10: Enable EMAC to FPGA bridge based on handoff

Code checking and setting EMAC use fpga is in
populate_sysmgr_fpgaintf_module(). So, call to sysmgr_pinmux_init()
instead of populate_sysmgr_pinmux().
In sysmgr_pinmux_init(), it will call to both populate_sysmgr_pinmux()
and populate_sysmgr_fpgaintf_module().

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
6 years agoMerge git://git.denx.de/u-boot-fsl-qoriq
Tom Rini [Fri, 24 Aug 2018 00:05:37 +0000 (20:05 -0400)]
Merge git://git.denx.de/u-boot-fsl-qoriq

6 years agoPartially revert "efi_loader: Rename sections to allow for implicit data"
Simon Glass [Wed, 8 Aug 2018 09:54:16 +0000 (03:54 -0600)]
Partially revert "efi_loader: Rename sections to allow for implicit data"

This partially reverts commit 7e21fbca26d18327cf7cabaad08df276a06a07d8.

That change broke sandbox EFI support for unknown reasons. It also changes
sandbox to use--gc-sections which we don't want.

For now I am just reverting the sandbox portion as presumably this change
is safe on other architectures.

Fixes: 7e21fbca26 (efi_loader: Rename sections to allow for implicit data)
Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agoarmv8: layerscape: Build u-boot-with-spl.bin for selected boards
Jagdish Gediya [Thu, 23 Aug 2018 17:23:33 +0000 (22:53 +0530)]
armv8: layerscape: Build u-boot-with-spl.bin for selected boards

This patch reverts the changes made for ls1088a and ls2080a
based boards in commit 18b6dd6cb0564 ("armv8: layerscape: Drop
u-boot-with-spl.bin for selected boards").

u-boot-with-spl.bin is required for Gen3 based SoC where internal
ROM copy data in the internal memory

CC: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
CC: Priyanka Jain <priyanka.jain@nxp.com>
CC: Pramod Kumar <pramod.kumar_1@nxp.com>
CC: Ashish Kumar <ashish.kumar@nxp.com>
CC: York Sun <york.sun@nxp.com>
Signed-off-by: Jagdish Gediya <jagdish.gediya@nxp.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
6 years agoarmv8: fsl-layerscape: Update README.falcon for compression
York Sun [Mon, 30 Jul 2018 16:53:19 +0000 (09:53 -0700)]
armv8: fsl-layerscape: Update README.falcon for compression

Update README.falcon to use "none" for compression property for
ramdisk image to avoid being uncompressed upon loading.

Signed-off-by: York Sun <york.sun@nxp.com>
6 years agousb: musb-new: Call musb_platform_exit from musb_stop
Jagan Teki [Fri, 20 Jul 2018 07:14:01 +0000 (12:44 +0530)]
usb: musb-new: Call musb_platform_exit from musb_stop

musb stop is musb core call during unregister or shutting down
gadget or host musb. For graceful exit add musb_platform_exit
on musb_stop so-that it can exit the musb platform driver as well.

Tested-by: Chen-Yu Tsai <wens@csie.org> # A33-OlinuXino
Tested-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
6 years agousb: musb-new: sunxi: Add proper musb exit support
Jagan Teki [Fri, 20 Jul 2018 07:14:00 +0000 (12:44 +0530)]
usb: musb-new: sunxi: Add proper musb exit support

musb have platform ops to do proper graceful exit,
so add the exit call and move musb platform exit code
instead of keeping it in driver remove.
This make proper shutdown of musb where .remove will
call disable, exit serially via musb_stop.

Tested-by: Chen-Yu Tsai <wens@csie.org> # A33-OlinuXino
Tested-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
6 years agomusb-new: sunxi: Access ahb_reset0_cfg via ccm offset
Jagan Teki [Fri, 20 Jul 2018 07:13:59 +0000 (12:43 +0530)]
musb-new: sunxi: Access ahb_reset0_cfg via ccm offset

reset0 is not available for sun4i, 5i and 7i so access
the reset0 offset from ccm via driver data for relevant
Allwinner SoC. this will eventually drop the existing
ifdef for SUN6I.

Tested-by: Chen-Yu Tsai <wens@csie.org> # A33-OlinuXino
Tested-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
6 years agousb: musb-new: sunxi: Allocate struct phy in private
Jagan Teki [Fri, 20 Jul 2018 07:13:57 +0000 (12:43 +0530)]
usb: musb-new: sunxi: Allocate struct phy in private

Allocate struct phy in private structure instead of allocating
locally and assign it to a pointer. This eventually fix miss
alignment phy which is used in another functions.

Tested-by: Chen-Yu Tsai <wens@csie.org> # A33-OlinuXino
Tested-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
6 years agousb: musb-new: Fix improper musb host pointer
Jagan Teki [Fri, 20 Jul 2018 07:13:56 +0000 (12:43 +0530)]
usb: musb-new: Fix improper musb host pointer

When MUSB is operating in peripheral mode, probe registering
musb core using musb_register which intern return int value
for validation. so there is no scope to preserve struct musb
pointer but the same can be used in .remove musb_stop.
So fix this by return musb_register with struct musb pointer.

Cc: Igor Grinberg <grinberg@compulab.co.il>
Cc: Purna Chandra Mandal <purna.mandal@microchip.com>
Tested-by: Chen-Yu Tsai <wens@csie.org> # A33-OlinuXino
Tested-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
6 years agoMerge branch 'master' of git://git.denx.de/u-boot-tegra
Tom Rini [Thu, 23 Aug 2018 02:36:08 +0000 (22:36 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-tegra

6 years agoMerge tag 'signed-efi-2018.09' of git://github.com/agraf/u-boot
Tom Rini [Tue, 21 Aug 2018 17:15:21 +0000 (13:15 -0400)]
Merge tag 'signed-efi-2018.09' of git://github.com/agraf/u-boot

Patch queue for efi - 2018-08-21

A few fixes for 2018.09. Most noticable are:

  - unbreak x86 target (-fdata-section fallout)
  - fix undefined behavior in a few corner cases
  - make Jetson TX1 boot again
  - RTS fixes
  - implement reset for simple output

6 years agoARM: tegra: avoid more operations in non-secure world
Stephen Warren [Tue, 31 Jul 2018 18:39:07 +0000 (12:39 -0600)]
ARM: tegra: avoid more operations in non-secure world

A secure monitor that runs before U-Boot, and hence causes U-Boot to run
in non-secure world, must implement a few operations that U-Boot
otherwise implements when running in secure world. Fix U-Boot to skip
these operations when running in non-secure world. In particular:

- The secure monitor must provide the LP0 resume code and own LP0
  configuration in order to maintain security, so must initialize all
  the PMC scratch registers used by the boot ROM during LP0 resume.
  Consequently, U-Boot should not attempt to clear those registers,
  since the register accesses will fail or cause an error.

- The secure monitor owns system security, and so is responsible for
  configuring security-related items such as the VPR.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
6 years agoarm: tegra: Restore host1x/dc dm-pre-reloc properties
Nicolas Chauvet [Wed, 11 Jul 2018 18:42:57 +0000 (20:42 +0200)]
arm: tegra: Restore host1x/dc dm-pre-reloc properties

Since commit f2faffecb016, tegra: Convert to use binman
the dm-pre-reloc properties are removed.

This leads U-Boot not to enable the display on paz00

This patch restore the dm-pre-reloc properties allowing
the bootloader to output to the display panel

v4: - Spell project name as appropriate
v3: - Fix few typos
v2: - Add more characters to commit hash

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
6 years agocmd: Add bind/unbind commands to bind a device to a driver from the command line
Jean-Jacques Hiblot [Thu, 9 Aug 2018 14:17:46 +0000 (16:17 +0200)]
cmd: Add bind/unbind commands to bind a device to a driver from the command line

In some cases it can be useful to be able to bind a device to a driver from
the command line.
The obvious example is for versatile devices such as USB gadget.
Another use case is when the devices are not yet ready at startup and
require some setup before the drivers are bound (ex: FPGA which bitsream is
fetched from a mass storage or ethernet)

usage example:

bind usb_dev_generic 0 usb_ether
unbind usb_dev_generic 0 usb_ether
or
unbind eth 1

bind /ocp/omap_dwc3@48380000/usb@48390000 usb_ether
unbind /ocp/omap_dwc3@48380000/usb@48390000

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
6 years agodevice: expose the functions used to remove and unbind children of a device
Jean-Jacques Hiblot [Thu, 9 Aug 2018 14:17:45 +0000 (16:17 +0200)]
device: expose the functions used to remove and unbind children of a device

Also add a 'drv' parameter to filter the children to remove/unbind.
Exporting those functions is a preparatory work for the addition of the
bind/unbind commands.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
6 years agodm: convert device_get_global_by_of_offset() to device_get_global_by_ofnode()
Jean-Jacques Hiblot [Thu, 9 Aug 2018 14:17:44 +0000 (16:17 +0200)]
dm: convert device_get_global_by_of_offset() to device_get_global_by_ofnode()

Also add device_find_global_by_ofnode() that also find a device based on
the OF node, but doesn't probe the device.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
6 years agodm: print the index of the device when dumping the dm tree
Jean-Jacques Hiblot [Thu, 9 Aug 2018 14:17:43 +0000 (16:17 +0200)]
dm: print the index of the device when dumping the dm tree

Command "dm tree" dumps the devices with class, driver, name information.
Add the index of the device in the class too, because the information is
useful for the bind/unbind commands.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agouclass: Add dev_get_uclass_index() to get the uclass/index of a device
Jean-Jacques Hiblot [Thu, 9 Aug 2018 14:17:42 +0000 (16:17 +0200)]
uclass: Add dev_get_uclass_index() to get the uclass/index of a device

This function is the reciprocal of uclass_find_device().
It will be used to print the index information in dm tree dump.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
6 years agonet: eth-uclass: Fix for DM USB ethernet support
Jean-Jacques Hiblot [Thu, 9 Aug 2018 14:17:41 +0000 (16:17 +0200)]
net: eth-uclass: Fix for DM USB ethernet support

When a USB ethernet device is halted, the device driver is removed. When
this happens the uclass private memory is freed and uclass_priv is set to
NULL. This causes a data abort when uclass_priv->state is then set to
ETH_STATE_PASSIVE.

Fix it by checking if uclass_priv is NULL before setting uclass_priv->state

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agousb: gadget: Add bcdDevice for the DWC3 USB Gadget Controller
Jean-Jacques Hiblot [Thu, 9 Aug 2018 14:17:40 +0000 (16:17 +0200)]
usb: gadget: Add bcdDevice for the DWC3 USB Gadget Controller

Add an entry in usb_gadget_controller_number() for the DWC3 gadget
controller. Without it, it is not possible to bind the USB Ethernet driver.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
6 years agousb: musb-new: omap2430: Enable DM_USB and OF support
Adam Ford [Tue, 31 Jul 2018 10:58:01 +0000 (05:58 -0500)]
usb: musb-new: omap2430: Enable DM_USB and OF support

With upcoming changes that require CONFIG_BLK, this broke
USB Mass Storage on the OMAP3 boards because if CONFIG_BLK is
enabled, it assumes that DM_USB is enabled, but it wasn't yet
available on omap3 and omap4 boards.

This patch converts the OMAP2430 MUSB glue to support DM_USB and
extracts the necessary information based on the device tree.

It's based on the ti-musb driver, but there are enough significant
differences in both the architecture and device tree entires between
am33xx and OMAP3/OMAP4, that I think it makes sense to continue to
keep the separate.

Per doc/driver-model/usb-info.txt, the USB gadget stuff hasn't
migrated to DM_USB yet, so this only supports USB Host for now.

Users wanting USB Gadgets will need to disable DM_USB and leave
it the old way for now.

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agousb: musb-new: omap2430: Remove dead code
Adam Ford [Fri, 13 Jul 2018 20:50:02 +0000 (15:50 -0500)]
usb: musb-new: omap2430: Remove dead code

A bunch of code was encapsulated in #ifdef's whether or not
it is building or for U-Boot.  Since this code is always building
for U-Boot, this patch removes the dead code.

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agocmd: fastboot: Validate user input
Sam Protsenko [Fri, 29 Jun 2018 18:59:40 +0000 (21:59 +0300)]
cmd: fastboot: Validate user input

In case when user provides '-' as USB controller index, like this:

    => fastboot -

data abort occurs in strcmp() function in do_fastboot(), here:

    if (!strcmp(argv[1], "udp"))

(tested on BeagleBone Black).

That's because argv[1] is NULL when user types in the '-', and null
pointer dereference occurs in strcmp() (which is ok according to C
standard specification). So we must validate user input to prevent such
behavior.

While at it, check also the result of strtoul() function and handle
error cases properly.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
6 years agocmd: efi: Clarify calculation precedence for '&' and '?'
Eugeniu Rosca [Sat, 14 Jul 2018 20:53:32 +0000 (22:53 +0200)]
cmd: efi: Clarify calculation precedence for '&' and '?'

Fix cppcheck complaint:
[cmd/efi.c:173]: (style) Clarify calculation precedence for '&' and '?'.

Fixes: f1a0bafb5802 ("efi: Add a command to display the memory map")
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi: Add EFI_MEMORY_{NV, MORE_RELIABLE, RO} attributes
Eugeniu Rosca [Sat, 14 Jul 2018 20:53:31 +0000 (22:53 +0200)]
efi: Add EFI_MEMORY_{NV, MORE_RELIABLE, RO} attributes

With this update, the memory attributes are in sync with Linux
kernel v4.18-rc4. They also match page 190 of UEFI 2.7 spec [1].

[1] http://www.uefi.org/sites/default/files/resources/UEFI_Spec_2_7.pdf

Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi: Fix truncation of constant value
Eugeniu Rosca [Sat, 14 Jul 2018 20:53:30 +0000 (22:53 +0200)]
efi: Fix truncation of constant value

Starting with commit 867a6ac86dd8 ("efi: Add start-up library code"),
sparse constantly complains about truncated constant value in efi.h:

include/efi.h:176:35: warning: cast truncates bits from constant value (8000000000000000 becomes 0)

This can get quite noisy, preventing real issues to be noticed:

$ make defconfig
*** Default configuration is based on 'sandbox_defconfig'
$ make C=2 -j12 2>&1 | grep truncates | wc -l
441

After the patch is applied:
$ make C=2 -j12 2>&1 | grep truncates | wc -l
0
$ sparse --version
v0.5.2

Following the suggestion of Heinrich Schuchardt, instead of only
fixing the root-cause, I replaced the whole enum of _SHIFT values
by ULL defines. This matches both the UEFI 2.7 spec and the Linux
kernel implementation.

Some ELF size comparison before and after the patch (gcc 7.3.0):

efi-x86_payload64_defconfig:
text    data    bss     dec       hex   filename
407174  29432   278676  715282    aea12 u-boot.old
407152  29464   278676  715292    aea1c u-boot.new
-22     +32     0       +10

efi-x86_payload32_defconfig:
text    data    bss     dec       hex   filename
447075  30308   280076  757459    b8ed3 u-boot.old
447053  30340   280076  757469    b8edd u-boot.new
-22     +32     0       +10

Fixes: 867a6ac86dd8 ("efi: Add start-up library code")
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset()
Heinrich Schuchardt [Thu, 5 Jul 2018 17:58:07 +0000 (19:58 +0200)]
efi_loader: EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset()

Implement the reset service of the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.

This should resolve the error reported by the SCT in
Protocol/SimpleTextOut/BlackBoxTest/SimpleTextOutBBTestFunction_uefi.c:639

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoMerge branch 'master' of git://git.denx.de/u-boot-sunxi
Tom Rini [Mon, 20 Aug 2018 17:41:56 +0000 (13:41 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-sunxi

6 years agoMerge git://git.denx.de/u-boot-x86
Tom Rini [Mon, 20 Aug 2018 17:41:37 +0000 (13:41 -0400)]
Merge git://git.denx.de/u-boot-x86

6 years agodisplay5: Introduce fitImg_fw_sz variable
Lukasz Majewski [Sat, 18 Aug 2018 20:22:07 +0000 (22:22 +0200)]
display5: Introduce fitImg_fw_sz variable

This cosmetic change allow easy adjustment of the to-load kernel size if
needed.

Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Lukasz Majewski <lukma@denx.de>
6 years agoefi_selftest: correct block device unit test
Heinrich Schuchardt [Sun, 22 Jul 2018 06:06:57 +0000 (08:06 +0200)]
efi_selftest: correct block device unit test

The UEFI specification mandates that the create flag is only used in
conjunction with both the read and the write flag.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: document runtime functions
Heinrich Schuchardt [Sun, 29 Jul 2018 13:10:11 +0000 (15:10 +0200)]
efi_loader: document runtime functions

Add comments for runtime service functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: update runtime services table crc32
Heinrich Schuchardt [Sun, 29 Jul 2018 07:49:04 +0000 (09:49 +0200)]
efi_loader: update runtime services table crc32

The crc32 of the runtime services table must be updated after detaching.

efi_update_table_header_crc32() must be __efi_runtime. So move it to
efi_runtime.c

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agolib: crc32: mark function crc32() as __efi_runtime
Heinrich Schuchardt [Sun, 29 Jul 2018 07:49:03 +0000 (09:49 +0200)]
lib: crc32: mark function crc32() as __efi_runtime

The function crc32() is needed by the EFI subsystem at runtime. So it has
to be linked into the runtime section together with all dependencies.

Eliminate empty defines local and ZEXPORT.

Mark variables as static which are not exported.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: avoid NULL dereference in efi_get_memory_map()
Heinrich Schuchardt [Mon, 6 Aug 2018 20:28:18 +0000 (22:28 +0200)]
efi_loader: avoid NULL dereference in efi_get_memory_map()

We should only dereference parameter memory_map_size after checking that
it is valid.

Fixes: 8e835554b36b ("efi_loader: check parameters of GetMemoryMap")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoboard: sunxi: Remove unused local variables
Jagan Teki [Mon, 20 Aug 2018 11:43:15 +0000 (17:13 +0530)]
board: sunxi: Remove unused local variables

variables buf from board_mmc_init, and ret from misc_init_r
were unused on the functions, so remove it.

Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
6 years agoefi_loader: fix a parameter check at CreateEvent()
AKASHI Takahiro [Fri, 10 Aug 2018 06:36:32 +0000 (15:36 +0900)]
efi_loader: fix a parameter check at CreateEvent()

The commit 21b3edfc9644 ("efi_loader: check parameters of CreateEvent")
enforces a strict parameter check at CreateEvent(). On the other hand,
UEFI specification version 2.7, section 7.1, says:

    The EVT_NOTIFY_WAIT and EVT_NOTIFY_SIGNAL flags are exclusive. If
    neither flag is specified, the caller does not require any notification
    concerning the event and the NotifyTpl, NotifyFunction, and
    NotifyContext parameters are ignored.

So the check should be mitigated so as to comply with the specification.
Without this patch, EDK2's Shell.efi won't be started.

Fixes: 21b3edfc9644 ("efi_loader: check parameters of CreateEvent")
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoriscv: Include bss subsections in linker script
Alexander Graf [Mon, 20 Aug 2018 12:25:49 +0000 (14:25 +0200)]
riscv: Include bss subsections in linker script

When we build with -fdata-sections we may end up with bss subsections. Our
linker script explicitly lists only a single consecutive bss section though.

Adapt the statement to also include subsections.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agox86: Enable -fdata-sections always
Alexander Graf [Mon, 20 Aug 2018 12:20:51 +0000 (14:20 +0200)]
x86: Enable -fdata-sections always

We left -fdata-sections disabled for x86_64 before because we encountered
random bugs that were at that time inexplicable.

Turns out this really was just side effects of missing .bss* statements
in the linker scripts. With those fixed, we can enable data sections for all
targets.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agox86: Include bss subsections in linker script
Alexander Graf [Mon, 20 Aug 2018 12:17:41 +0000 (14:17 +0200)]
x86: Include bss subsections in linker script

When we build with -fdata-sections we may end up with bss subsections. Our
linker script explicitly lists only a single consecutive bss section though.

Adapt the statement to also include subsections.

This fixes booting efi-x86_app_defconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agosunxi: fix sid base address macro name for H6
Icenowy Zheng [Sat, 18 Aug 2018 05:36:44 +0000 (13:36 +0800)]
sunxi: fix sid base address macro name for H6

In the current H6 CPU memory space code, the SUNXI in the macro name of
the SID address base is wrongly spelled as SNUXI, which leads to SID
readout not working.

Fix this macro name.

Fixes: 55f6b1c351c9 ("sunxi: add basic memory map definitions of H6 SoC")
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
6 years agoconfigs: sun7i: Fix to use emmc dts for OLinuXino_MICRO-eMMC
Jagan Teki [Mon, 13 Aug 2018 17:29:40 +0000 (22:59 +0530)]
configs: sun7i: Fix to use emmc dts for OLinuXino_MICRO-eMMC

A20 OLinuXino Micro eMMC board has emmc with mmc2 slot
so use proper dts, sun7i-a20-olinuxino-micro-emmc.dts

Cc: Stefan Mavrodiev <stefan@olimex.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
6 years agodoc: FIT image: fix typo
Pierre-Jean Texier [Sat, 18 Aug 2018 13:51:25 +0000 (15:51 +0200)]
doc: FIT image: fix typo

Fix typo in beaglebone verified boot documentation.

Signed-off-by: Pierre-Jean Texier <texier.pj2@gmail.com>
6 years agocmd: Add dtimg command
Sam Protsenko [Thu, 16 Aug 2018 20:34:13 +0000 (23:34 +0300)]
cmd: Add dtimg command

dtimg command allows user to work with Android DTB/DTBO image format.
Such as, getting the address of desired DTB/DTBO file, printing the dump
of the image in U-Boot shell, etc.

This command is needed to provide Android boot with new Android DT image
format further.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
6 years agocommon: Add support for Android DT image
Sam Protsenko [Thu, 16 Aug 2018 20:34:12 +0000 (23:34 +0300)]
common: Add support for Android DT image

Android documentation recommends new image format for storing DTB/DTBO
files: [1]. To support that format, this patch adds helper functions for
Android DTB/DTBO format. In image-android-dt.* files you can find helper
functions to work with Android DT image format, such us routines for:
    - printing the dump of image structure
    - getting the address and size of desired dtb/dtbo file

This patch uses dt_table.h file, that was added in commit 643cefa4d848
("Import Android's dt_table.h for DT image format") by Alex Deymo.

[1] https://source.android.com/devices/architecture/dto/partitions

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
6 years agofs/fat: debug-print file read position during file_fat_read_at()
Andreas Dannenberg [Tue, 14 Aug 2018 02:35:15 +0000 (21:35 -0500)]
fs/fat: debug-print file read position during file_fat_read_at()

In order to make the debug print in file_fat_read_at() a tad more useful,
show the offset the file is being read at alongside the filename.

Suggested-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
6 years agospl: fix debug print in spl_common_init()
Simon Goldschmidt [Mon, 13 Aug 2018 09:24:05 +0000 (11:24 +0200)]
spl: fix debug print in spl_common_init()

spl_common_init() debug-prints "spl_early_init()\n" but it is
called both from spl_early_init() and spl_init().

Fix this by moving the debug() statement to the calling functions
which now print their name.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agoARM: da8xxevm: README: Add NOR booting instructions
Adam Ford [Sat, 11 Aug 2018 12:34:55 +0000 (07:34 -0500)]
ARM: da8xxevm: README: Add NOR booting instructions

The da850evm with its UI expander board can boot XIP boot from
NOR flash.  This adds the instructions to the readme. file.

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoARM: da850evm: Enable SPL_SYS_MALLOC_SIMPLE
Adam Ford [Fri, 10 Aug 2018 21:07:47 +0000 (16:07 -0500)]
ARM: da850evm: Enable SPL_SYS_MALLOC_SIMPLE

The SPL space is limited.  In order to try to enable DM in SPL,
we need more space. When combined wtih TINY_PRINTF, this reduces
the size of SPL by 6.5k

Original:

   text    data     bss     dec     hex filename
  20760    1216      80   22056    5628 spl/u-boot-spl

Tiny Printf
   text    data     bss     dec     hex filename
  17947    1216      80   19243    4b2b spl/u-boot-spl

Malloc Simple + Tiny Printf
   text    data     bss     dec     hex filename
  15187     176      28   15391    3c1f spl/u-boot-spl

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoARM: da850evm: Enable USE_TINY_PRINTF
Adam Ford [Fri, 10 Aug 2018 20:53:41 +0000 (15:53 -0500)]
ARM: da850evm: Enable USE_TINY_PRINTF

The SPL space is limited.  In order to try to enable DM in SPL,
we need more space. This reduces the size of SPL by ~2.7K

before:
   text    data     bss     dec     hex filename
  20760    1216      80   22056    5628 spl/u-boot-spl
after:
   text    data     bss     dec     hex filename
  17947    1216      80   19243    4b2b spl/u-boot-spl

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoconfigs: da850evm: Remove DM_I2C_COMPAT
Adam Ford [Fri, 10 Aug 2018 10:24:12 +0000 (05:24 -0500)]
configs: da850evm: Remove DM_I2C_COMPAT

Since using DM_I2C_COMPAT throws a warning during compilation,
and it isn't really needed any longer, so this patch removes
this feature and shrinks the code a bit.

from:
   text    data     bss     dec     hex filename
 343326   13388  123448  480162   753a2 u-boot

to:
   text    data     bss     dec     hex filename
 342924   13380  123440  479744   75200 u-boot

Signed-off-by: Adam Ford <aford173@gmail.com>