oweals/u-boot.git
6 years agotravis: Add sandbox/clang-7 support
Tom Rini [Sun, 7 Oct 2018 18:20:30 +0000 (14:20 -0400)]
travis: Add sandbox/clang-7 support

To make testing with clang support easier, add sandbox/clang-7
combination to our testing matrix.  To facilitate this, switch to using
the "sources" method that the travis.yml file supports to list
additional repositories and add the official one for llvm-7.  Due to
buildman not supporting using clang at this time add logic to manually
build a single sandbox configuration in the expected output directory so
that we can still invoke all of our tests.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agobootcount: Make bootcount magic configurable
Marek Vasut [Wed, 10 Oct 2018 22:13:54 +0000 (00:13 +0200)]
bootcount: Make bootcount magic configurable

Add new Kconfig option, SYS_BOOTCOUNT_MAGIC, to select the boot
counter magic word. This can be useful ie. in case the entire
boot counter register is not usable.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@konsulko.com>
6 years agotravis: Switch to i386 version toolchain for x86
Bin Meng [Mon, 8 Oct 2018 23:53:54 +0000 (16:53 -0700)]
travis: Switch to i386 version toolchain for x86

Currently this uses x86_64 version toolchain for x86 build in
travis-ci. Change it to i386 version to avoid updating the
buildman toolchain path every time when the toolchain version
number is changed, eg: from 7.3.0 to 8.1.0.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
6 years agotravis: Remove or32 toolchain info
Bin Meng [Mon, 8 Oct 2018 23:53:53 +0000 (16:53 -0700)]
travis: Remove or32 toolchain info

or32 is not supported by U-Boot anymore.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
6 years agoARM: mach-omap2: Kconfig: Make SYS_MPUCLK dependent on AM33XX
Adam Ford [Sun, 7 Oct 2018 14:58:25 +0000 (09:58 -0500)]
ARM: mach-omap2: Kconfig: Make SYS_MPUCLK dependent on AM33XX

This value is unly used in arch/arm/mach-omap2/am33xx/
clock_am33xx.c, so let's make it dependent on AM33XX since
that is the only way this file gets compiled into the code
according to the Makefile.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Fix symbol name]
Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agoarm: lpc32xx: remove phantom CONFIG_LPC32XX_SDRAM_ config option
Vladimir Zapolskiy [Mon, 17 Sep 2018 19:03:27 +0000 (22:03 +0300)]
arm: lpc32xx: remove phantom CONFIG_LPC32XX_SDRAM_ config option

The option has never existed and config whitelist script accumulates
it from a comment block, wipe it out from the source code.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
6 years agowork_92105: remove unused CONFIG_SPL_NAND_BOOT configuration option
Vladimir Zapolskiy [Mon, 17 Sep 2018 18:56:37 +0000 (21:56 +0300)]
work_92105: remove unused CONFIG_SPL_NAND_BOOT configuration option

The option is unused, SPL image gets a wanted boot device by standard
spl_boot_device() call.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
6 years agowork_92105: remove unused CONFIG_LPC32XX_SPL configuration option
Vladimir Zapolskiy [Mon, 17 Sep 2018 18:56:36 +0000 (21:56 +0300)]
work_92105: remove unused CONFIG_LPC32XX_SPL configuration option

The CONFIG_LPC32XX_SPL option from board include file has never been
used, it is safe to remove it.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
6 years agoMakefile: add LPC32xx precondition for building platform images
Vladimir Zapolskiy [Mon, 17 Sep 2018 18:43:04 +0000 (21:43 +0300)]
Makefile: add LPC32xx precondition for building platform images

To prevent accidental build failures the change converts a number of
NXP LPC32xx specific image targets to be conditionally dependent on
target build configuration. The wrapped image targets always contain
a U-Boot SPL binary and the images are supposed to be directly flashed
on a NAND flash device for read access by LPC32xx NAND MLC controller.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
6 years agoarm: lpc32xx: add CONFIG_ARCH_LPC32XX build option
Vladimir Zapolskiy [Mon, 17 Sep 2018 18:43:03 +0000 (21:43 +0300)]
arm: lpc32xx: add CONFIG_ARCH_LPC32XX build option

The explicit arch specific build symbol allows to group supported
boards, generalize common config options and it will serve as
a dependency for platform only drivers.

Two related board defconfigs are resynced after the change.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
6 years agoMerge branch 'master' of git://git.denx.de/u-boot-sh
Tom Rini [Fri, 19 Oct 2018 11:12:46 +0000 (07:12 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-sh

6 years agoARM: rmobile: Drop PRR syscon driver
Marek Vasut [Thu, 18 Oct 2018 18:28:19 +0000 (20:28 +0200)]
ARM: rmobile: Drop PRR syscon driver

The PRR syscon driver is available too late for Multi DTB build
of U-Boot. Replace it with simple check whether a platform is
Gen3 or not and produce an address of the PRR.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
6 years agoARM: dts: rmobile: Build -u-boot variants of DTs
Marek Vasut [Thu, 18 Oct 2018 18:27:16 +0000 (20:27 +0200)]
ARM: dts: rmobile: Build -u-boot variants of DTs

Build the -u-boot variants of the device trees so they can be included
in Multi-DTB fitImage, which in turn allows us to build single U-Boot
image for multiple boards.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
6 years agoARM: dts: rmobile: r8a77990: Add USB2.0(EHCI) DT nodes on Ebisu
Hiroyuki Yokoyama [Thu, 27 Sep 2018 10:05:18 +0000 (19:05 +0900)]
ARM: dts: rmobile: r8a77990: Add USB2.0(EHCI) DT nodes on Ebisu

Add device tree nodes for USB2.0(EHCI) on R-Car E3 Ebisu board.

Signed-off-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
6 years agoARM: rmobile: Fix module clock controls refer status on Gen3
Hiroyuki Yokoyama [Wed, 26 Sep 2018 07:00:09 +0000 (16:00 +0900)]
ARM: rmobile: Fix module clock controls refer status on Gen3

When referring to the MSTPSR register, it contains the clock
status of SYS, RT, SECURE, and controlling SMSTPCR using this
value has the problem of being affected by the RT and SECURE
status.This patch changes the reference register to SMSTPCR.

Signed-off-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
6 years agoARM: rmobile: Enable cache command on Gen3
Hiroyuki Yokoyama [Wed, 26 Sep 2018 05:32:13 +0000 (14:32 +0900)]
ARM: rmobile: Enable cache command on Gen3

This patch enables the cache command, mostly for convenience of testing.

Signed-off-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
6 years agoARM: rmobile: Tidy up SYSC_PWRx define of 3DG on Gen3
Hiroyuki Yokoyama [Thu, 23 Mar 2017 01:35:41 +0000 (10:35 +0900)]
ARM: rmobile: Tidy up SYSC_PWRx define of 3DG on Gen3

Tidy up unused definition related to power control of 3DG.

Signed-off-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
6 years agoARM: rmobile: salvator-x: Remove GSX clock force supply
Hiroyuki Yokoyama [Tue, 25 Sep 2018 10:03:03 +0000 (19:03 +0900)]
ARM: rmobile: salvator-x: Remove GSX clock force supply

GSX clock force supply code is unnecessary at U-Boot,
because GSX clock control is supported at the kernel driver.

Signed-off-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
6 years agoARM: rmobile: Remove Watchdog and CPG settings on Gen3
Hiroyuki Yokoyama [Tue, 25 Sep 2018 09:48:03 +0000 (18:48 +0900)]
ARM: rmobile: Remove Watchdog and CPG settings on Gen3

This code is unnecessary, because these registers are set by the
initial program loader (IPL).

Signed-off-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
6 years agoARM: rmobile: Remove TMU0/TMU1 settings on Gen3
Hiroyuki Yokoyama [Wed, 30 Mar 2016 01:56:21 +0000 (10:56 +0900)]
ARM: rmobile: Remove TMU0/TMU1 settings on Gen3

U-Boot uses ARM generic timer, TMU0 and TMU1 are not used, remove them.

Signed-off-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
6 years agoARM: rmobile: Remove console parameter from bootargs on Gen3
Hiroyuki Yokoyama [Tue, 25 Sep 2018 07:16:14 +0000 (16:16 +0900)]
ARM: rmobile: Remove console parameter from bootargs on Gen3

This patch removes 'console=' argument, because kernel uses
stdout-path as parameter.

Signed-off-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
6 years agoARM: rmobile: Fix CPGWPR Address define and Settings on Gen3
Hiroyuki Yokoyama [Mon, 14 Dec 2015 02:24:44 +0000 (11:24 +0900)]
ARM: rmobile: Fix CPGWPR Address define and Settings on Gen3

This patch fixes the write-protect control of CPG.

Signed-off-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
6 years agoMerge tag 'signed-efi-2018.11' of git://github.com/agraf/u-boot
Tom Rini [Wed, 17 Oct 2018 11:20:52 +0000 (07:20 -0400)]
Merge tag 'signed-efi-2018.11' of git://github.com/agraf/u-boot

Patch queue for efi - 2018-10-17

A few bug fixes for the 2018.11 release:

  - Fix block seeking on 32bit
  - Fix execution with DEBUG set
  - Fix a few Coverity found bugs
  - Fix warnings

Heinrich Schuchardt (13):
      efi_loader: fix relocation on x86_64
      efi_loader: correct signature of GetPosition, SetPosition
      efi_loader: execute efi_save_gd() first
      efi_loader: efi_allocate_pool(EFI_ALLOCATE_ANY_PAGES, ...)
      efi_loader: error handling in read_console()
      efi_loader: return type efi_console_register()
      efi_loader: superfluous statement in is_dir()
      efi_loader: memory leak in efi_set_variable()
      efi_loader: remove lcd.h from efi_net.c
      arm: do not include efi_loader.h twice
      efi_loader: fix typo in efi_boottime.c
      efi_selftest: creating new handle in controller test
      efi_loader: efi_dp_get_next_instance() superfluous statement

Tom Rini (2):
      efi_loader: Fix warning in efi_load_image()
      fs: fat: Fix warning in normalize_longname()

6 years agoefi_loader: efi_dp_get_next_instance() superfluous statement
Heinrich Schuchardt [Thu, 27 Sep 2018 18:55:04 +0000 (20:55 +0200)]
efi_loader: efi_dp_get_next_instance() superfluous statement

Remove a superfluous statement in efi_dp_get_next_instance().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_selftest: creating new handle in controller test
Heinrich Schuchardt [Fri, 28 Sep 2018 20:14:16 +0000 (22:14 +0200)]
efi_selftest: creating new handle in controller test

When the last protocol interface is uninstalled the handle is deleted but
this does not set the value of the handle to NULL.

To create a new handle with OpenProtocolInterface the value of the handle
must be NULL.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoMerge git://git.denx.de/u-boot-microblaze
Tom Rini [Tue, 16 Oct 2018 17:57:23 +0000 (13:57 -0400)]
Merge git://git.denx.de/u-boot-microblaze

Xilinx changes for v2018.11-rc2-v2

FPGA:
- Fix SPL fpga loading from FIT

ARM64:
- Fix gic accesses in EL2/EL1

Xilinx:
- Add dlc20 board support
- Add Versal board support
- Sync defconfigs
- Enable MP via Kconfig
- Add missing efuse node
- Enable CDC for zcu100

cmd:
- Fix kgdb Kconfig dependency

6 years agocmd: kgdb: Enable kgdb only for PPC
Michal Simek [Thu, 4 Oct 2018 12:26:13 +0000 (14:26 +0200)]
cmd: kgdb: Enable kgdb only for PPC

Only PPC supports this option that's why there should be proper
dependency setup via Kconfig.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agoarm64: zynqmp: Enable MP by default via Kconfig
Michal Simek [Thu, 4 Oct 2018 12:26:13 +0000 (14:26 +0200)]
arm64: zynqmp: Enable MP by default via Kconfig

Simplify defconfig for ZynqMP but keep option not to enable it for mini
targets.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agoarm64: zynqmp: Add new command for TCM initialization
Siva Durga Prasad Paladugu [Fri, 5 Oct 2018 09:39:05 +0000 (15:09 +0530)]
arm64: zynqmp: Add new command for TCM initialization

This patch adds new zynqmp command "zynqmp tcminit mode" to
initialize TCM. TCM needs to be initialized before accessing
to avoid ECC errors. This new command helps to perform
the same. It also makes tcm_init() as global and uses it for
doing the TCM initialization.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agoarm64: zynqmp: Move TCM initialization to a separate routine
Siva Durga Prasad Paladugu [Fri, 5 Oct 2018 09:39:04 +0000 (15:09 +0530)]
arm64: zynqmp: Move TCM initialization to a separate routine

This patch moves TCM initialization to a separate routine to
make it modular and can be reused if required. It also prints
warning message now as it writes to TCM.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agoarm64: versal: Add Xilinx Versal Virtual QEMU board
Michal Simek [Tue, 18 Sep 2018 12:58:16 +0000 (14:58 +0200)]
arm64: versal: Add Xilinx Versal Virtual QEMU board

Virtual QEMU board is generating DTB self and putting it to
VERSAL_QEMU_DTB_ADDR address.
Board is using CONFIG_OF_BOARD which ensures that u-boot is aligned with
board created by QEMU.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agonet: gem: Do not setup any clock for Xilinx SoC Versal
Michal Simek [Wed, 22 Aug 2018 14:18:34 +0000 (16:18 +0200)]
net: gem: Do not setup any clock for Xilinx SoC Versal

Xilinx SoC Versal is using fixed clock where setting rate is not supported.
That's why workaround the driver till real clock driver is supported.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agoarm64: versal: Add support for new Xilinx Versal ACAPs
Michal Simek [Wed, 22 Aug 2018 12:55:27 +0000 (14:55 +0200)]
arm64: versal: Add support for new Xilinx Versal ACAPs

Xilinx is introducing Versal, an adaptive compute acceleration platform
(ACAP), built on 7nm FinFET process technology. Versal ACAPs combine
Scalar Processing Engines, Adaptable Hardware Engines, and Intelligent
Engines with leading-edge memory and interfacing technologies to deliver
powerful heterogeneous acceleration for any application. The Versal AI
Core series has five devices, offering 128 to 400 AI Engines. The series
includes dual-core Arm Cortex™-A72 application processors, dual-core Arm
Cortex-R5 real-time processors, 256KB of on-chip memory with ECC, more
than 1,900 DSP engines optimized for high-precision floating point with
low latency.

The patch is adding necessary infrastructure in place without enabling
platform which is done in separate patch.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agoefi_loader: fix typo in efi_boottime.c
Heinrich Schuchardt [Sun, 30 Sep 2018 11:40:43 +0000 (13:40 +0200)]
efi_loader: fix typo in efi_boottime.c

%s/conncected/connected/

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agofs: fat: Fix warning in normalize_longname()
Tom Rini [Sun, 30 Sep 2018 14:33:42 +0000 (10:33 -0400)]
fs: fat: Fix warning in normalize_longname()

As observed with clang:
fs/fat/fat_write.c:1024:13: warning: comparison of constant 128
      with expression of type 'char' is always false
      [-Wtautological-constant-out-of-range-compare]
                if ((0x80 <= c) && (c <= 0xff))
                     ~~~~ ^  ~
fs/fat/fat_write.c:1024:25: warning: comparison of constant 255
      with expression of type 'char' is always true
      [-Wtautological-constant-out-of-range-compare]
                if ((0x80 <= c) && (c <= 0xff))
                                    ~ ^  ~~~~

Fixes: 25bb9dab14f4 ("fs: fat: check and normalize file name")
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: Fix warning in efi_load_image()
Tom Rini [Sun, 30 Sep 2018 14:38:15 +0000 (10:38 -0400)]
efi_loader: Fix warning in efi_load_image()

As observed with clang:
lib/efi_loader/efi_boottime.c:1624:7: warning: variable 'info'
      is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
                if (ret != EFI_SUCCESS)
                    ^~~~~~~~~~~~~~~~~~
lib/efi_loader/efi_boottime.c:1653:7: note: uninitialized use
      occurs here
        free(info);
             ^~~~
lib/efi_loader/efi_boottime.c:1624:3: note: remove the 'if' if
      its condition is always false
                if (ret != EFI_SUCCESS)
                ^~~~~~~~~~~~~~~~~~~~~~~
lib/efi_loader/efi_boottime.c:1602:31: note: initialize the
      variable 'info' to silence this warning
        struct efi_loaded_image *info;
                                     ^
                                      = NULL

Rather than change how we unwind the function it makes the most sense to
initialize info to NULL so that we can continue to pass it to free().

Fixes: c982874e930d ("efi_loader: refactor efi_setup_loaded_image()")
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoarm: do not include efi_loader.h twice
Heinrich Schuchardt [Mon, 1 Oct 2018 03:03:30 +0000 (05:03 +0200)]
arm: do not include efi_loader.h twice

We should not include the same include twice.

Fixes: 99b8db7291ce ("arm: print information about loaded UEFI images")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: remove lcd.h from efi_net.c
Heinrich Schuchardt [Mon, 1 Oct 2018 03:24:46 +0000 (05:24 +0200)]
efi_loader: remove lcd.h from efi_net.c

Remove superfluous include.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: memory leak in efi_set_variable()
Heinrich Schuchardt [Tue, 2 Oct 2018 03:30:05 +0000 (05:30 +0200)]
efi_loader: memory leak in efi_set_variable()

Do not leak native_name if out of memory.

This addresses CoverityScan CID 184095.

Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: superfluous statement in is_dir()
Heinrich Schuchardt [Tue, 2 Oct 2018 03:57:32 +0000 (05:57 +0200)]
efi_loader: superfluous statement in is_dir()

When is_dir() is called we have already execute set_blk_dev(fh).
So don't call it again.

This fixes CoverityScan CID 184093.

Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: return type efi_console_register()
Heinrich Schuchardt [Tue, 2 Oct 2018 04:08:26 +0000 (06:08 +0200)]
efi_loader: return type efi_console_register()

Use a return type that can encompass the return value.

This fixes CoverityScan CID 184090.

Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: error handling in read_console()
Heinrich Schuchardt [Tue, 2 Oct 2018 04:43:38 +0000 (06:43 +0200)]
efi_loader: error handling in read_console()

getc() might return an error code. Avoid an incorrect converison to
Unicode.

This addresses CoverityScan CID 184087.

Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: efi_allocate_pool(EFI_ALLOCATE_ANY_PAGES, ...)
Heinrich Schuchardt [Wed, 3 Oct 2018 18:02:29 +0000 (20:02 +0200)]
efi_loader: efi_allocate_pool(EFI_ALLOCATE_ANY_PAGES, ...)

The first parameter of efi_allocate_pool is a memory type. It cannot be
EFI_ALLOCATE_ANY_PAGES. Use EFI_BOOT_SERVICES_DATA instead.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: execute efi_save_gd() first
Heinrich Schuchardt [Wed, 3 Oct 2018 21:55:38 +0000 (23:55 +0200)]
efi_loader: execute efi_save_gd() first

If DEBUG is defined we may be calling EFI_CALL already during the
initialization of the EFI subsystem. We must make sure efi_save_gd() has
already been called at that moment.

Anyway it is better to have this call in one location instead of three.

This fixes an illegal memory access occurring since 4e6b5d6503ce
("efi_loader: create root node") with DEBUG = 1.

Fixes: 4e6b5d6503ce ("efi_loader: create root node")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: correct signature of GetPosition, SetPosition
Heinrich Schuchardt [Sun, 7 Oct 2018 03:26:26 +0000 (05:26 +0200)]
efi_loader: correct signature of GetPosition, SetPosition

The UEFI spec requires that file positions are passed as u64 in
GetPosition() and SetPosition().

Check if the file handle points to a directory in GetPosition().

Provide a unit test for GetPosition() and SetPosition().

Fix Coverity warning CID 184079 (CONSTANT_EXPRESSION_RESULT).

Add comments.

Fixes: b6dd57773719 ("efi_loader: use correct types in EFI_FILE_PROTOCOL")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: fix relocation on x86_64
Heinrich Schuchardt [Sun, 14 Oct 2018 03:52:08 +0000 (20:52 -0700)]
efi_loader: fix relocation on x86_64

Currently the relocation of the EFI runtime on x86_64 fails. This renders
the EFI subsystem unusable. The ELF relocation records for x86_64 contain
an addend field.

Always write the function name into error messages related to the EFI
runtime relocation.

Break an excessively long line.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoarm64: gic: Do gicv3 secure initialization based on EL level
Michal Simek [Thu, 7 Sep 2017 07:20:32 +0000 (09:20 +0200)]
arm64: gic: Do gicv3 secure initialization based on EL level

Do gic cpu initialization based on EL level which u-boot enters.
U-Boot can't access EL3 regs when runs in EL2/EL1, etc.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agoarm64: zynqmp: Enable CDC ethernet gadget for zcu100/Ultra96
Michal Simek [Wed, 27 Jun 2018 13:53:59 +0000 (15:53 +0200)]
arm64: zynqmp: Enable CDC ethernet gadget for zcu100/Ultra96

Ethernet is not present on this board that's why there are two other
options how to wire the board to ethernet. The first is asix_eth usb
host converter which is already enabled by default. The second option is
to use USB CDC/RNDIS ethernet gadget.

This patch is enabling CDC which is working with Linux.
With new bind/unbind command there is no need to call usb_ether_init()
from platform code and use for example these commands:

bind /amba/usb0@ff9d0000/dwc3@fe200000 usb_ether
dhcp
unbind /amba/usb0@ff9d0000/dwc3@fe200000

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agoxilinx: Sync defconfigs with current Kconfig
Michal Simek [Thu, 4 Oct 2018 07:41:54 +0000 (09:41 +0200)]
xilinx: Sync defconfigs with current Kconfig

There are some inconsistencies which should be fixed.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agoarm: zynq: Add efuse node for Zynq-7000S devices
Michal Simek [Tue, 28 Feb 2017 10:46:37 +0000 (11:46 +0100)]
arm: zynq: Add efuse node for Zynq-7000S devices

Add access to efuse for Zynq-7000S device detection.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agoarm: zynq: Add support for DLC20 board
Michal Simek [Thu, 13 Sep 2018 06:44:02 +0000 (08:44 +0200)]
arm: zynq: Add support for DLC20 board

Xilinx DLC20 has I2C0 with EEPROM(1KB), UART1, GPIO, SD0 (EMMC 4GB),
USB0 device, ENET0, QSPI (16MB) and DDR(two of 256MB each).

Boards have mix of Winbond/ST QSPIs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agoarm: zynq: Enable FIT fpga loading in SPL for zc706
Michal Simek [Wed, 18 Jul 2018 11:27:24 +0000 (13:27 +0200)]
arm: zynq: Enable FIT fpga loading in SPL for zc706

Enable loading FPGA from FIT image in SPL.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agospl: fpga: Implement fpga bistream loading with fpga_load
Michal Simek [Wed, 18 Jul 2018 12:33:15 +0000 (14:33 +0200)]
spl: fpga: Implement fpga bistream loading with fpga_load

This patch partially reverts:
"spl: fit: Add support for loading FPGA bitstream"
(sha1: 26a642238bdecc53527142dc043b29e21c5cc94c)

There shouldn't be a need to call private spl_load_fpga_image function
because the whole sequence should be already handled by fpga framework.
If there is missing loading bistream by chunks it should be done via
fpga framework instead of having private hooks.
Also spl_load_fpga_image() weak function is not used anywhere and
opening a way for not reviewed hacks out of mainline U-Boot is not the
right way to go.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agoMerge branch 'master' of git://git.denx.de/u-boot-i2c
Tom Rini [Tue, 16 Oct 2018 11:25:28 +0000 (07:25 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-i2c

6 years agoPrepare v2018.11-rc2 v2018.11-rc2
Tom Rini [Tue, 16 Oct 2018 00:26:22 +0000 (20:26 -0400)]
Prepare v2018.11-rc2

Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agoRevert "fdt: fdtdec_setup_memory_banksize() use livetree"
Michal Simek [Wed, 3 Oct 2018 13:53:52 +0000 (15:53 +0200)]
Revert "fdt: fdtdec_setup_memory_banksize() use livetree"

This reverts commit c35a7d375ec8f0a8ee343ae4868be3242172632e.
This commit is breaking SPL on zc706.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Patrice Chotard <patrice.chotard@st.com> [on STM32F746-disco]
6 years agoMerge tag 'arc-more-updates-for-2018.11-rc2-2' of git://git.denx.de/u-boot-arc
Tom Rini [Mon, 15 Oct 2018 11:20:07 +0000 (07:20 -0400)]
Merge tag 'arc-more-updates-for-2018.11-rc2-2' of git://git.denx.de/u-boot-arc

More fixes and improvements for ARC here:

Fixes (this time included for real):
 * Take care of global uninitialized variables
   They used to be put right after .bss section and were never
   zeroed as they should be. Now merged with normal .bss

Improvements:
 * Print more verbose CPU info for boards built on real silicon
 * Add support for SD-card detection on all ARC boards
 * Quite a few fixes for IoT DK
   - Support reset by command
   - Print of CPU freq on boot
   - Link for eFlash etc

6 years agoARC: Don't use COMMON section for global not-initialized variables
Alexey Brodkin [Thu, 11 Oct 2018 20:12:05 +0000 (23:12 +0300)]
ARC: Don't use COMMON section for global not-initialized variables

By default GCC puts global non-initialized variables in COMMON section.
And we used to ignore existence of COMMON section in our linker
scripts though smart LD silently appended it right after .bss.

And the problem here is variables from COMMON section even though
require zeroing in run-time were not zeroed as they were placed
right after __bss_end symbol.

It was a pure luck we never faced serious problem due to this,
but now it is fixed.

Now as for some other architectures we'll just force GCC to put
those global variables in normal .bss section.

This solution is much nicer than adding COMMON section to each and
every linker script.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
6 years agoMerge git://git.denx.de/u-boot-sunxi
Tom Rini [Fri, 12 Oct 2018 15:54:30 +0000 (11:54 -0400)]
Merge git://git.denx.de/u-boot-sunxi

[trini: Convert da850evm_nand defconfig now to to SPL_DM]
Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agoMerge branch 'master' of git://git.denx.de/u-boot-spi
Tom Rini [Fri, 12 Oct 2018 15:54:13 +0000 (11:54 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-spi

6 years agoiot_dk: Link for eFlash
Alexey Brodkin [Thu, 11 Oct 2018 11:14:13 +0000 (14:14 +0300)]
iot_dk: Link for eFlash

That's what we'll have in production.
But note it won't work for loading via JTAG as
eFlash is not directly writable, one needs to use
prebootloader to flash uboot.bin from SD-card into eFlash.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
6 years agoaxs10x/emdk/hsdk/iot_dk: Implement board_mmc_getcd()
Alexey Brodkin [Thu, 11 Oct 2018 09:39:55 +0000 (12:39 +0300)]
axs10x/emdk/hsdk/iot_dk: Implement board_mmc_getcd()

So now we may detect MMC/SD-card existence and
instead of completely misleading message on missing card:
------------------------>8-----------------------
Loading Environment from FAT... Card did not respond to voltage select!
------------------------>8-----------------------

we now get very clear one:
------------------------>8-----------------------
Loading Environment from FAT... MMC: no card present
------------------------>8-----------------------

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
6 years agoiot_dk: Save CPU clock value to gd->cpu_clk
Alexey Brodkin [Wed, 10 Oct 2018 13:15:20 +0000 (16:15 +0300)]
iot_dk: Save CPU clock value to gd->cpu_clk

Since gd->cpu_clk is a global item we may once populate it from .dtb
ans use it then in other places like for printing CPU info etc.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
6 years agoiot_dk: Add support of 136 MHz clock
Alexey Brodkin [Wed, 10 Oct 2018 12:53:45 +0000 (15:53 +0300)]
iot_dk: Add support of 136 MHz clock

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
6 years agoiot_dk: Implement board reset
Alexey Brodkin [Wed, 10 Oct 2018 11:20:11 +0000 (14:20 +0300)]
iot_dk: Implement board reset

It is done by writing some magic sequence in a special register.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
6 years agoiot_dk/hsdk: Implement its own print_cpuinfo()
Alexey Brodkin [Wed, 10 Oct 2018 11:03:47 +0000 (14:03 +0300)]
iot_dk/hsdk: Implement its own print_cpuinfo()

ARC IDENTITY register only encodes major architecture
type and version while for a particular board/silicon we
may know better which template was used and so we may identify
CPU more precise, which exactly we do here.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
6 years agoARC: make generic print_cpuinfo() weak
Alexey Brodkin [Wed, 10 Oct 2018 10:59:33 +0000 (13:59 +0300)]
ARC: make generic print_cpuinfo() weak

This allows board to override print_cpuinfo() because
they might know better which ARChitect template was used.
This way we may not only derive base architecture type and
version but more meaningful things like "ARC EM7D" instead of
simple "ARC EM", "ARC HS36" instead of "ARC HS".

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
6 years agoiot_dk: Disable networking support
Alexey Brodkin [Tue, 9 Oct 2018 10:26:26 +0000 (13:26 +0300)]
iot_dk: Disable networking support

There's no Ethernet controller on the board so no point in having
networking support. This also saves us 5.5 kB of precious memory.

| # bloat-o-meter u-boot.net u-boot.no_net_regex | tail -1
| Total: Before=127892, After=122334, chg -4.35%

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
6 years agoiot_dk: Add localversion string
Alexey Brodkin [Tue, 2 Oct 2018 12:04:39 +0000 (15:04 +0300)]
iot_dk: Add localversion string

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
6 years agoldpaa_eth.c: Fix warning when PHYLIB is not enabled
Tom Rini [Fri, 12 Oct 2018 00:07:48 +0000 (20:07 -0400)]
ldpaa_eth.c: Fix warning when PHYLIB is not enabled

We need to #ifdef some variables to avoid warning about them being
unused.

Fixes: 1a048cd65645 ("driver: net: fsl-mc: Add support of multiple phys for dpmac")
Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agosf: Add MICRON manufacturer id
Ashish Kumar [Tue, 25 Sep 2018 08:41:33 +0000 (14:11 +0530)]
sf: Add MICRON manufacturer id

NOR flash name MT35X_QLKA and MT25Q_** used on NXP board has
manufacturer id as 0x2C, which are rather for newer flashes
after the split of Micron from ST.

So macro for this micron manufacturer id.

Signed-off-by: Suresh Gupta <suresh.gupta@nxp.com>
Signed-off-by: Yogesh Gaur <yogeshnarayan.gaur@nxp.com>
Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
[jagan: updated commit message]
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
6 years agoi2c: fix: Add support for the Arm's Versatile Express I2C controller
Heiko Schocher [Thu, 11 Oct 2018 05:26:33 +0000 (07:26 +0200)]
i2c: fix: Add support for the Arm's Versatile Express I2C controller

accidentially while fixing merge errors for patch:
https://lists.denx.de/pipermail/u-boot/2018-September/342278.html

missed to add files:

MAINTAINERS
drivers/i2c/Kconfig
drivers/i2c/Makefile

add them with this patch.

Signed-off-by: Heiko Schocher <hs@denx.de>
Acked-by: Liviu Dudau <liviu.dudau@foss.arm.com>
6 years agoMerge branch 'master' of git://git.denx.de/u-boot-net
Tom Rini [Thu, 11 Oct 2018 19:28:32 +0000 (15:28 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-net

6 years agodriver: net: fsl-mc: Add support of multiple phys for dpmac
Pankaj Bansal [Wed, 10 Oct 2018 08:38:34 +0000 (14:08 +0530)]
driver: net: fsl-mc: Add support of multiple phys for dpmac

Till now we have had cases where we had one phy device per dpmac.
Now, with the upcoming products (LX2160AQDS), we have cases, where there
are sometimes two phy devices for one dpmac. One phy for TX lanes and
one phy for RX lanes. to handle such cases, add the support for multiple
phys in ethernet driver. The ethernet link is up if all the phy devices
connected to one dpmac report link up. also the link capabilities are
limited by the weakest phy device.

i.e. say if there are two phys for one dpmac. one operates at 10G without
autoneg and other operate at 1G with autoneg. Then the ethernet interface
will operate at 1G without autoneg.

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agodriver: net: fsl-mc: initialize dpmac irrespective of phy
Pankaj Bansal [Wed, 10 Oct 2018 08:38:33 +0000 (14:08 +0530)]
driver: net: fsl-mc: initialize dpmac irrespective of phy

The dpmac initalization should not depend on phy.
As the phy is not necessary to be present for dpmac to function.
Therefore, remove dpmac initialization dependency from phy.

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agodriver: net: fsl-mc: Modify the dpmac link detection method
Pankaj Bansal [Wed, 10 Oct 2018 08:38:32 +0000 (14:08 +0530)]
driver: net: fsl-mc: Modify the dpmac link detection method

when there is no phy present for a dpmac, a dummy phy device is created.
when we move to multiple phy method, we need to create as many dummy phy
devices.

Change this method so that we don't need to create dummy phy devices.
We always report linkup if no phy is present.

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agodriver: net: fsl-mc: fix error handing in init_phy
Pankaj Bansal [Wed, 10 Oct 2018 08:38:31 +0000 (14:08 +0530)]
driver: net: fsl-mc: fix error handing in init_phy

if an error occurs during init_phy, we should free the phydev structure
which has been allocated by phy_connect.

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agodriver: net: fsl-mc: remove unused strcture elements
Pankaj Bansal [Wed, 10 Oct 2018 08:38:30 +0000 (14:08 +0530)]
driver: net: fsl-mc: remove unused strcture elements

The phydev structure is present in both ldpaa_eth_priv and
wriop_dpmac_info. the phydev in wriop_dpmac_info is not being used

As the phydev is created based on phy_addr and bus members of
wriop_dpmac_info, it is appropriate to keep phydev in wriop_dpmac_info.

Also phy_regs is not being used, therefore remove it

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agoMerge tag 'dm-9oct18' of git://git.denx.de/u-boot-dm
Tom Rini [Wed, 10 Oct 2018 17:35:17 +0000 (13:35 -0400)]
Merge tag 'dm-9oct18' of git://git.denx.de/u-boot-dm

Test improvements to tidy up output and drop duplicate tests
Sandbox SPL/TPL support
Various dm-related improvements

6 years agoMerge branch 'master' of git://git.denx.de/u-boot-sh
Tom Rini [Wed, 10 Oct 2018 17:35:14 +0000 (13:35 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-sh

6 years agoarm: remove duplicated prototypes in u-boot.arm.h
Patrick Delaunay [Fri, 5 Oct 2018 09:33:53 +0000 (11:33 +0200)]
arm: remove duplicated prototypes in u-boot.arm.h

Remove the function prototypes duplicated between u-boot.arm.h
and init.h/common.h

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agoarm: remove prototype for get_timer_masked
Patrick Delaunay [Fri, 5 Oct 2018 09:33:52 +0000 (11:33 +0200)]
arm: remove prototype for get_timer_masked

The interruption support had be removed for ARM architecture and
the function get_timer_masked() is no more used except in some
the timer.c files.

This patch clean each timer.c which implement this function and
remove the associated prototype in u-boot-arm.h

For timer.c, I don't verify if the weak version of get_timer
(in lib/time.c) can be used

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agoarm: remove prototype for udelay_masked
Patrick Delaunay [Fri, 5 Oct 2018 09:33:51 +0000 (11:33 +0200)]
arm: remove prototype for udelay_masked

The interruption support had be removed for ARM architecture and
the function udelay_masked() is no more used except in some timer.c
files  and have the same content than udelay() or __udelay().

This patch update each timer.c implementing this function and
remove the associated prototype in u-boot-arm.h.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agoarm: remove prototype for reset_timer_masked
Patrick Delaunay [Fri, 5 Oct 2018 09:33:50 +0000 (11:33 +0200)]
arm: remove prototype for reset_timer_masked

Remove prototype for function only used in one file

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agoarm: remove prototype for arch_interrupt_init
Patrick Delaunay [Fri, 5 Oct 2018 09:33:49 +0000 (11:33 +0200)]
arm: remove prototype for arch_interrupt_init

Remove prototype for no more existing function

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agobootm: Add board specific OS preboot hook
Marek Vasut [Thu, 4 Oct 2018 19:16:31 +0000 (21:16 +0200)]
bootm: Add board specific OS preboot hook

Add board-specific hook which is executed before the code hands over
control to the OS. This lets the board perform some last-minute clean
ups.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
6 years agoarm: K3: am654: Add support for getting boot mode
Andrew F. Davis [Wed, 3 Oct 2018 15:03:23 +0000 (10:03 -0500)]
arm: K3: am654: Add support for getting boot mode

Read the boot mode register to find the boot mode. Only use eMMC boot0
mode when the mode is eMMC boot (called BOOT_DEVICE_MMC1 currently due
to current conflating of boot mode and boot device), and not iff the
boot device is MMC port 0.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
6 years agoarm: K3: am654: Choose MMC boot device based on boot port
Andrew F. Davis [Wed, 3 Oct 2018 15:03:22 +0000 (10:03 -0500)]
arm: K3: am654: Choose MMC boot device based on boot port

For most devices the boot mode maps directly to the boot
device. For MMC this is not the case as we have two MMC
boot modes and two MMC boot devices (ports). Check the
boot port to determine which MMC device was our boot
device. Make this change for both primary and secondary
boot modes.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
6 years agogpio: da8xx: Push generic defines of gpio.h out of mach-davinci
Keerthy [Wed, 3 Oct 2018 12:25:14 +0000 (17:55 +0530)]
gpio: da8xx: Push generic defines of gpio.h out of mach-davinci

Push generic defines of gpio.h out of mach-davinci to drivers/gpio
now that non-davinci architectures are beginning to use this IP.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Fix calimain build]
Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agogpio: da8xx: Add k2g compatible
Keerthy [Wed, 3 Oct 2018 12:25:13 +0000 (17:55 +0530)]
gpio: da8xx: Add k2g compatible

Add k2g compatible so that k3 SoCs can be supported

Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
6 years agoboard: ks2: move uinitrd fixup logic inside ft_board_setup_ex
Nicholas Faustini [Wed, 3 Oct 2018 10:58:49 +0000 (12:58 +0200)]
board: ks2: move uinitrd fixup logic inside ft_board_setup_ex

The uinitrd fixup logic should be executed after the FDT /chosen
node has been properly populated by fdt_initrd()

Signed-off-by: Nicholas Faustini <nicholas.faustini@azcomtech.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
6 years agofdt: add call to ft_board_setup_ex() for ks2 boards
Nicholas Faustini [Wed, 3 Oct 2018 10:58:48 +0000 (12:58 +0200)]
fdt: add call to ft_board_setup_ex() for ks2 boards

When updating the board FDT, some of the operations
are performed by ft_board_setup_ex() and should be
executed also by the fdt command.

Signed-off-by: Nicholas Faustini <nicholas.faustini@azcomtech.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
6 years agoARM: meson: Add Khadas VIM2 board support
Loic Devulder [Wed, 3 Oct 2018 10:02:07 +0000 (12:02 +0200)]
ARM: meson: Add Khadas VIM2 board support

This adds platform code for the Khadas VIM2 board based on a
Meson GXM (S912) SoC with the Meson GXM configuration.

This initial submission supports UART, MMC/SDCard and Ethernet.
USB is partially supported.

All the code is from Neil Armstrong! I just rebased the code, do
some cleanup and tested on my board.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Loic Devulder <ldevulder@suse.de>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
6 years agoARM: meson: Add Khadas VIM2 board DT
Loic Devulder [Wed, 3 Oct 2018 10:02:06 +0000 (12:02 +0200)]
ARM: meson: Add Khadas VIM2 board DT

This adds Device Tree for the Khadas VIM2 board.

The meson-gxm-khadas-vim2.dts is synchronized from Linux 4.18.10.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Loic Devulder <ldevulder@suse.de>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
6 years agoARM: dts: stm32mp1: Add usbotg_hs regulator for stm32mp157c-ev1
Patrice Chotard [Wed, 3 Oct 2018 07:38:38 +0000 (09:38 +0200)]
ARM: dts: stm32mp1: Add usbotg_hs regulator for stm32mp157c-ev1

Add usbotg_hs regulator to allow to use the USB mass-storage
feature on OTG usb port.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agodriver: net: fsl-mc: modify the label name
Pankaj Bansal [Wed, 10 Oct 2018 08:38:29 +0000 (14:08 +0530)]
driver: net: fsl-mc: modify the label name

The goto label name is misspelled it should be DPMAC not DPAMC

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agonet: Consolidate UDP header functions
Duncan Hare [Sun, 24 Jun 2018 22:40:41 +0000 (15:40 -0700)]
net: Consolidate UDP header functions

Make it possible to add TCP versions of the same, while reusing
IP portions. This patch should not change any behavior.

Signed-off-by: Duncan Hare <DH@Synoia.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agonet: Don't overwrite waiting packets with asynchronous replies
Joe Hershberger [Wed, 26 Sep 2018 21:49:02 +0000 (16:49 -0500)]
net: Don't overwrite waiting packets with asynchronous replies

Peter originally sent a fix, but it breaks a number of other things.
This addresses the original reported issue in a different way.

That report was:

> U-Boot has 1 common buffer to send Ethernet frames, pointed to by
> net_tx_packet.  When sending to an IP address without knowing the MAC
> address, U-Boot makes an ARP request (using the arp_tx_packet buffer)
> to find out the MAC address of the IP addressr. When a matching ARP
> reply is received, U-Boot continues sending the frame stored in the
> net_tx_packet buffer.
>
> However, in the mean time, if U-Boot needs to send out any network
> packets (e.g. replying ping packets or ARP requests for its own IP
> address etc.), it will use the net_tx_packet buffer to prepare the
> new packet. Thus this buffer is no longer the original packet meant
> to be transmitted after the ARP reply. The original packet will be
> lost.

This instead uses the ARP tx buffer to send async replies in the case
where we are actively waiting for an ARP reply.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reported-by: Tran Tien Dat <peter.trantiendat@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
6 years agotest: eth: Add a test for the target being pinged
Joe Hershberger [Wed, 26 Sep 2018 21:49:01 +0000 (16:49 -0500)]
test: eth: Add a test for the target being pinged

The target will respond to pings while doing other network handling.
Make sure that the response happens and is correct.

This currently corrupts the ongoing operation of the device if it
happens to be awaiting an ARP reply of its own to whatever serverip it
is attempting to communicate with. In the test, add an expectation that
the user operation (ping, in this case) will fail. A later patch will
address this problem.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
6 years agotest: eth: Add a test for ARP requests
Joe Hershberger [Wed, 26 Sep 2018 21:49:00 +0000 (16:49 -0500)]
test: eth: Add a test for ARP requests

This tests that ARP requests made to this target's IP address are
responded-to by the target when it is doing other networking operations.

This currently corrupts the ongoing operation of the device if it
happens to be awaiting an ARP reply of its own to whatever serverip it
is attempting to communicate with. In the test, add an expectation that
the user operation (ping, in this case) will fail. A later patch will
address this problem.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>