]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
5 years agoMerge tag 'efi-2019-07-rc1' of git://git.denx.de/u-boot-efi
Tom Rini [Tue, 9 Apr 2019 02:32:45 +0000 (22:32 -0400)]
Merge tag 'efi-2019-07-rc1' of git://git.denx.de/u-boot-efi

Pull request for UEFI sub-system for v2019.07-rc1

The patch series adds support for the BootNext and BootCurrent variables.

The rest is mostly bug fixes. With the bug fixes in place it becomes
possible to use the EFI Shell `edit` command.

A new unit test is supplied to check the image base and size fields of the
loaded image protocol.

An inline check when freeing memory from the pool safeguards against double
frees.

5 years agoMerge git://git.denx.de/u-boot-riscv
Tom Rini [Tue, 9 Apr 2019 02:32:11 +0000 (22:32 -0400)]
Merge git://git.denx.de/u-boot-riscv

- RISC-V arch support SMP.
- Support Andestech's PLIC and PLMT.
- qemu, fu54e, ae350 boards enable SMP by default.
- Fix CONFIG_DEFAULT_DEVICE_TREE failure.

5 years agoPrepare v2019.04
Tom Rini [Tue, 9 Apr 2019 01:40:40 +0000 (21:40 -0400)]
Prepare v2019.04

Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agoarm: sunxi: Enable DM_MMC on required SoCs
Jagan Teki [Mon, 8 Apr 2019 20:27:54 +0000 (01:57 +0530)]
arm: sunxi: Enable DM_MMC on required SoCs

Enabling DM_MMC is forcing CONFIG_BLK=y so if any board which uses
SCSI must need to enable DM_SCSI otherwise SCSI reads on that particular
target making invalid reading to the disk drive.

Allwinner platform do support SCSI on A10, A20 and R40 SoC's out of
these only A10 have DM_SCSI enabled. So enabling DM_MMC on A20, R40
would eventually end-up with scsi disk read failures like [1]

So, enable DM_MMC in all places of respective SoC's instead of enabling
them globally to Allwinner platform.

Now, DM_MMC is enabled in Allwinner SoC's except A20 and R40.

[1] https://lists.denx.de/pipermail/u-boot/2019-April/364057.html

Reported-by: Pablo Sebastián Greco <pgreco@centosproject.org>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agoMerge tag 'fixes-for-2019.04-rc4' of git://git.denx.de/u-boot-staging
Tom Rini [Mon, 8 Apr 2019 14:11:29 +0000 (10:11 -0400)]
Merge tag 'fixes-for-2019.04-rc4' of git://git.denx.de/u-boot-staging

- i.MX8QXP-MEK ethernet fix

5 years agodts: imx8qxp-mek: Add PHY post reset delay
Andrejs Cainikovs [Fri, 1 Mar 2019 13:28:00 +0000 (13:28 +0000)]
dts: imx8qxp-mek: Add PHY post reset delay

PHY cannot be detected unless we wait about 150 ms.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Stefano Babic <sbabic@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: dm: fec: Support phy-reset-post-delay property
Andrejs Cainikovs [Fri, 1 Mar 2019 13:27:59 +0000 (13:27 +0000)]
net: dm: fec: Support phy-reset-post-delay property

As per Linux kernel DT binding doc:
- phy-reset-post-delay : Post reset delay in milliseconds. If present then
  a delay of phy-reset-post-delay milliseconds will be observed after the
  phy-reset-gpios has been toggled. Can be omitted thus no delay is
  observed. Delay is in range of 1ms to 1000ms. Other delays are invalid.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Stefano Babic <sbabic@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Lukasz Majewski <lukma@denx.de>
5 years agowatchdog: Move watchdog_dev to data section (BSS may not be cleared)
Stefan Roese [Wed, 3 Apr 2019 07:12:48 +0000 (09:12 +0200)]
watchdog: Move watchdog_dev to data section (BSS may not be cleared)

This patch moves all instances of static "watchdog_dev" declarations to
the "data" section. This may be needed, as the BSS may not be cleared
in the early U-Boot phase, where watchdog_reset() is already beeing
called. This may result in incorrect pointer access, as the check to
"!watchdog_dev" in watchdog_reset() may not be true and the function
may continue to run.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: "Marek Behún" <marek.behun@nic.cz>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Tested-by: Michal Simek <michal.simek@xilinx.com> (on zcu100)
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
5 years agoriscv: dts: fix CONFIG_DEFAULT_DEVICE_TREE failure
Rick Chen [Wed, 3 Apr 2019 02:43:37 +0000 (10:43 +0800)]
riscv: dts: fix CONFIG_DEFAULT_DEVICE_TREE failure

It occurs since commit 27cb7300ffda
("Ensure device tree DTS is compiled").

More details can refer to
89c2b5c02049aea746b1edee0b4e1d8519dec2f4
ARM: fix arch/arm/dts/Makefile

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: Greentime Hu <greentime@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
5 years agoriscv: ae350: enable SMP
Rick Chen [Tue, 2 Apr 2019 07:56:44 +0000 (15:56 +0800)]
riscv: ae350: enable SMP

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: Greentime Hu <greentime@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
5 years agoriscv: dts: ae350 support SMP
Rick Chen [Tue, 2 Apr 2019 07:56:43 +0000 (15:56 +0800)]
riscv: dts: ae350 support SMP

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: Greentime Hu <greentime@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
5 years agoriscv: ax25: Andes specific cache shall only support in M-mode
Rick Chen [Tue, 2 Apr 2019 07:56:42 +0000 (15:56 +0800)]
riscv: ax25: Andes specific cache shall only support in M-mode

Limit the cache configuration only can be supported in M mode.
It can not be manipulated in S mode.

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: Greentime Hu <greentime@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
5 years agoriscv: ax25: Add platform-specific Kconfig options
Rick Chen [Tue, 2 Apr 2019 07:56:41 +0000 (15:56 +0800)]
riscv: ax25: Add platform-specific Kconfig options

Add ax25 RISC-V platform-specific Kconfig options,
to include CPU and timer drivers. Also disable
ATCPIT100 SoC timer and replace by PLMT.

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: Greentime Hu <greentime@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
5 years agoriscv: Add a SYSCON driver for Andestech's PLMT
Rick Chen [Tue, 2 Apr 2019 07:56:40 +0000 (15:56 +0800)]
riscv: Add a SYSCON driver for Andestech's PLMT

The platform-Level Machine Timer (PLMT) block
holds memory-mapped mtime register associated
with timer tick.

This driver implements the riscv_get_time() which
is required by the generic RISC-V timer driver.

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: Greentime Hu <greentime@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
5 years agoriscv: Add a SYSCON driver for Andestech's PLIC
Rick Chen [Tue, 2 Apr 2019 07:56:39 +0000 (15:56 +0800)]
riscv: Add a SYSCON driver for Andestech's PLIC

The Platform-Level Interrupt Controller (PLIC)
block holds memory-mapped claim and pending registers
associated with software interrupt. It is required
for handling IPI.

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: Greentime Hu <greentime@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
5 years agoriscv: qemu: enable SMP
Lukas Auer [Sun, 17 Mar 2019 18:28:42 +0000 (19:28 +0100)]
riscv: qemu: enable SMP

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoriscv: fu540: enable SMP
Lukas Auer [Sun, 17 Mar 2019 18:28:41 +0000 (19:28 +0100)]
riscv: fu540: enable SMP

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoriscv: hang if relocation of secondary harts fails
Lukas Auer [Sun, 17 Mar 2019 18:28:40 +0000 (19:28 +0100)]
riscv: hang if relocation of secondary harts fails

Print an error message and hang if smp_call_function() returns an error,
indicating that relocation of the secondary harts has failed.

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
5 years agoriscv: do not rely on hart ID passed by previous boot stage
Lukas Auer [Sun, 17 Mar 2019 18:28:39 +0000 (19:28 +0100)]
riscv: do not rely on hart ID passed by previous boot stage

RISC-V U-Boot expects the hart ID to be passed to it via register a0 by
the previous boot stage. Machine mode firmware such as BBL and OpenSBI
do this when starting their payload (U-Boot) in supervisor mode. If
U-Boot is running in machine mode, this task must be handled by the boot
ROM. Explicitly populate register a0 with the hart ID from the mhartid
CSR to avoid possible problems on RISC-V processors with a boot ROM that
does not handle this task.

Suggested-by: Rick Chen <rick@andestech.com>
Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Rick Chen <rick@andestech.com>
5 years agoriscv: boot images passed to bootm on all harts
Lukas Auer [Sun, 17 Mar 2019 18:28:38 +0000 (19:28 +0100)]
riscv: boot images passed to bootm on all harts

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoriscv: add support for multi-hart systems
Lukas Auer [Sun, 17 Mar 2019 18:28:37 +0000 (19:28 +0100)]
riscv: add support for multi-hart systems

On RISC-V, all harts boot independently. To be able to run on a
multi-hart system, U-Boot must be extended with the functionality to
manage all harts in the system. All harts entering U-Boot are registered
in the available_harts mask stored in global data. A hart lottery system
as used in the Linux kernel selects the hart U-Boot runs on. All other
harts are halted. U-Boot can delegate functions to them using
smp_call_function().

Every hart has a valid pointer to the global data structure and a 8KiB
stack by default. The stack size is set with CONFIG_STACK_SIZE_SHIFT.

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoriscv: save hart ID in register tp instead of s0
Lukas Auer [Sun, 17 Mar 2019 18:28:36 +0000 (19:28 +0100)]
riscv: save hart ID in register tp instead of s0

The hart ID passed by the previous boot stage is currently stored in
register s0. If we divert the control flow inside a function, which is
required as part of multi-hart support, the function epilog may not be
called, clobbering register s0. Save the hart ID in the unallocatable
register tp instead to protect the hart ID.

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Rick Chen <rick@andestech.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
5 years agoriscv: delay initialization of caches and debug UART
Lukas Auer [Sun, 17 Mar 2019 18:28:35 +0000 (19:28 +0100)]
riscv: delay initialization of caches and debug UART

Move the initialization of the caches and the debug UART until after
board_init_f_init_reserve. This is in preparation for SMP support, where
code prior to this point will be executed by all harts. This ensures
that initialization will only be performed once on the main hart running
U-Boot.

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoriscv: implement IPI platform functions using SBI
Lukas Auer [Sun, 17 Mar 2019 18:28:34 +0000 (19:28 +0100)]
riscv: implement IPI platform functions using SBI

The supervisor binary interface (SBI) provides the necessary functions
to implement the platform IPI functions riscv_send_ipi() and
riscv_clear_ipi(). Use it to implement them.

This adds support for inter-processor interrupts (IPIs) on RISC-V CPUs
running in supervisor mode. Support for machine mode is already
available for CPUs that include the SiFive CLINT.

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoriscv: import the supervisor binary interface header file
Lukas Auer [Sun, 17 Mar 2019 18:28:33 +0000 (19:28 +0100)]
riscv: import the supervisor binary interface header file

Import the supervisor binary interface (SBI) header file from Linux
(arch/riscv/include/asm/sbi.h). The last change to it was in commit
6d60b6ee0c97 ("RISC-V: Device, timer, IRQs, and the SBI").

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
5 years agoriscv: add infrastructure for calling functions on other harts
Lukas Auer [Sun, 17 Mar 2019 18:28:32 +0000 (19:28 +0100)]
riscv: add infrastructure for calling functions on other harts

Harts on RISC-V boot independently, U-Boot is responsible for managing
them. Functions are called on other harts with smp_call_function(),
which sends inter-processor interrupts (IPIs) to all other available
harts. Available harts are those marked as available in the device tree
and present in the available_harts mask stored in global data. The
available_harts mask is used to register all harts that have entered
U-Boot. Functions are specified with their address and two function
arguments (argument 2 and 3). The first function argument is always the
hart ID of the hart calling the function. On the other harts, the IPI
interrupt handler handle_ipi() must be called on software interrupts to
handle the request and call the specified function.

Functions are stored in the ipi_data data structure. Every hart has its
own data structure in global data. While this is not required at the
moment (all harts are expected to boot Linux), this does allow future
expansion, where other harts may be used for monitoring or other tasks.

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agonet: phy: implement fallback mechanism for negative phy adresses
Hannes Schmelzer [Fri, 29 Mar 2019 08:54:05 +0000 (09:54 +0100)]
net: phy: implement fallback mechanism for negative phy adresses

Negative phy-addresses can occour if the caller function was not able to
determine a valid phy address (from device-tree for example). In this
case we catch this here and search for ANY phy device on the given mdio-
bus.

Signed-off-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
Tested-by: Michal Simek <michal.simek@xilinx.com>
Tested-by: Lukasz Majewski <lukma@denx.de>
5 years agoefi_loader: correct CTRL-A - CTRL-Z console input
Heinrich Schuchardt [Sat, 6 Apr 2019 18:59:24 +0000 (20:59 +0200)]
efi_loader: correct CTRL-A - CTRL-Z console input

In the extended text input protocol CTRL-A - CTRL-Z have to be signaled as
Unicode characters a-z or A-Z depending on the shift state and not as 0x01
to 0x1a.

Update Python unit test.

This patch is required for using the EFI shell `edit` command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: enable file SetInfo()
Heinrich Schuchardt [Sat, 6 Apr 2019 16:17:39 +0000 (18:17 +0200)]
efi_loader: enable file SetInfo()

EFI shell command edit uses the SetInfo() methods to unset the read only
attribute of the file to be edited. So let efi_file_setinfo() return
success in this case.

Return an error if the function is called for to rename or resize a file
as we do not support this yet.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: correct file creation
Heinrich Schuchardt [Sat, 6 Apr 2019 14:27:34 +0000 (16:27 +0200)]
efi_loader: correct file creation

The EFI shell expects that after opening a file with EFI_FILE_MODE_CREATE
GetInfo() succeeds. Up to now we do not actually create the file when
method Open() of the EFI_FILE_PROTOCOL is called.

If method Open() of the EFI_FILE_PROTOCOL is called with
EFI_FILE_MODE_CREATE and the file does not yet exist, call fs_write() with
a buffer size of zero to actually create the file.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: debug output file handle in efi_file_open()
Heinrich Schuchardt [Sat, 6 Apr 2019 14:36:16 +0000 (16:36 +0200)]
efi_loader: debug output file handle in efi_file_open()

For debugging it is helpful to know the address of the file handle created
by the Open() method of the EFI file protocol. So let's write it with
EFI_PRINT().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: boottime: export efi_[un]load_image()
AKASHI Takahiro [Tue, 5 Mar 2019 05:53:31 +0000 (14:53 +0900)]
efi_loader: boottime: export efi_[un]load_image()

Those two functions will be used later to re-implement do_bootefi_exec().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: boottime: add loaded image device path protocol to image handle
AKASHI Takahiro [Wed, 27 Mar 2019 04:40:32 +0000 (13:40 +0900)]
efi_loader: boottime: add loaded image device path protocol to image handle

To meet UEFI spec v2.7a section 9.2, we should add
EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL to image handle,
instead of EFI_DEVICE_PATH_PROTOCOL.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: variables PlatformLang and PlatformLangCodes
Heinrich Schuchardt [Fri, 5 Apr 2019 00:45:21 +0000 (02:45 +0200)]
efi_loader: variables PlatformLang and PlatformLangCodes

Since TianoCore EDK2 commit d65f2cea36d1 ("ShellPkg/CommandLib: Locate
proper UnicodeCollation instance") in edk2 the UEFI Shell crashes if EFI
variable PlatformLang is not defined.

As this variable is anyway prescribed in the UEFI 2.7 spec let's define it
to L"en-US". Use the same value for PlatformLangCodes that defines the list
of all supported languages.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: EFI_PRINT instead of debug for memory services
Heinrich Schuchardt [Thu, 4 Apr 2019 19:50:02 +0000 (21:50 +0200)]
efi_loader: EFI_PRINT instead of debug for memory services

For debug messages inside EFI API functions we should use the EFI_PRINT
macro which gives us well aligned output like:

EFI: Entry efi_allocate_pool_ext(4, 14, 000000007edd7718)
  EFI: efi_add_memory_map: 0x7dcfa000 0x1 4 yes
EFI: Exit: efi_allocate_pool_ext: 0

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: EFI_PRINT instead of debug for variable services
Heinrich Schuchardt [Thu, 4 Apr 2019 19:36:44 +0000 (21:36 +0200)]
efi_loader: EFI_PRINT instead of debug for variable services

For debug messages inside EFI API functions we should use the EFI_PRINT
macro which gives us well aligned output like:

EFI: Entry efi_get_variable("PlatformLang" ...)
  EFI: get 'efi_8be4df61-93ca-11d2-aa0d-00e098032b8c_PlatformLang'
EFI: Exit: efi_get_variable: 14

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: parameter checks in StartImage and Exit()
Heinrich Schuchardt [Tue, 26 Mar 2019 18:03:17 +0000 (19:03 +0100)]
efi_loader: parameter checks in StartImage and Exit()

Add parameter checks in the StartImage() and Exit() boottime services:
- check that the image handle is valid and has the loaded image protocol
  installed
- in StartImage() record the current image
- in Exit() check that the image is the current image

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: rearrange boottime service functions
Heinrich Schuchardt [Tue, 26 Mar 2019 18:02:05 +0000 (19:02 +0100)]
efi_loader: rearrange boottime service functions

To avoid forward declarations move efi_start_image() and efi_exit() down.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: sanity checks when freeing memory
Heinrich Schuchardt [Tue, 26 Mar 2019 04:31:41 +0000 (05:31 +0100)]
efi_loader: sanity checks when freeing memory

Use a checksum to validate that efi_free_pool() is only called for memory
allocated by efi_allocated_pool().

Add a plausibility check to efi_free_pages() checking that the address
passed is page aligned.

Update related function comments to match Sphinx style.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_selftest: check image_base, image_size
Heinrich Schuchardt [Sun, 30 Sep 2018 07:20:06 +0000 (09:20 +0200)]
efi_selftest: check image_base, image_size

In efi_selftest_start_image_exit.c test the image_base and image_size are
correctly set in the loaded image protocol.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: set image_base and image_size to correct values
AKASHI Takahiro [Thu, 11 Oct 2018 11:09:58 +0000 (04:09 -0700)]
efi_loader: set image_base and image_size to correct values

Currently, image's image_base points to an address where the image was
temporarily uploaded for further loading. Since efi_loader relocates
the image to final destination, image_base and image_size should reflect
that.

This bug was detected in UEFI SCT, "Loaded Image Protocol Test - test 2,"
which shows that 'Unload' function doesn't fit into a range suggested by
image_base and image_size.

TestCase/UEFI/EFI/Protocol/LoadedImage/BlackBoxTest/
LoadedImageBBTestMain.c:1002

Changes in this patch also includes:
* reverts a patch, "efi_loader: save image relocation address
  and size" since newly added fields are no longer needed.
* copy PE headers as well since those information will be needed
  for module loading, in particular, at gurb.
  (This bug was reported by Heinrich.)

Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Rebase patch.
Remove unused fields from struct efi_loaded_image_obj.

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: bootmgr: support BootNext and BootCurrent variable behavior
AKASHI Takahiro [Wed, 20 Mar 2019 00:07:55 +0000 (09:07 +0900)]
efi_loader: bootmgr: support BootNext and BootCurrent variable behavior

See UEFI v2.7, section 3.1.2 for details of the specification.

With efidebug command, you can run any EFI boot option as follows:
  => efi boot add 1 SHELL ...
  => efi boot add 2 HELLO ...
  => efi boot order 1 2
  => efi bootmgr
     (starting SHELL ...)

  => efi boot next 2
  => efi bootmgr
     (starting HELLO ...)
  => env print -e
  <snip ...>
  BootCurrent: {boot,run}(blob)
  00000000:  02 00                    ..
  BootOrder: {boot,run}(blob)
  00000000:  01 00 02 00              ....

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: release file buffer after loading image
Heinrich Schuchardt [Mon, 4 Mar 2019 16:50:05 +0000 (17:50 +0100)]
efi_loader: release file buffer after loading image

Commit 0e18f584de59 ("efi_loader: LoadImage: always allocate new pages")
ensured that whether we load an image from file or from memory we end up
with the same number of newly allocated buffers. But essentially we ended
up with one buffer too many in both cases:

efi_load_pe() copies and rebases the UEFI image.
We do not need the buffer with the file contents afterwards.

Fixes: 0e18f584de59 ("efi_loader: LoadImage: always allocate new pages")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoMerge tag 'u-boot-imx-20190405' of git://git.denx.de/u-boot-imx
Tom Rini [Fri, 5 Apr 2019 13:09:56 +0000 (09:09 -0400)]
Merge tag 'u-boot-imx-20190405' of git://git.denx.de/u-boot-imx

Fixes for 2019.04

- fix bashism for MX8
- fix ethernet for MX53
- fix docs for i.MX8

5 years agoMerge branch 'master' of git://git.denx.de/u-boot-usb
Tom Rini [Wed, 3 Apr 2019 14:28:10 +0000 (10:28 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-usb

- Documentation fix

5 years agoMerge branch '2019-04-03-master-imports'
Tom Rini [Wed, 3 Apr 2019 14:26:57 +0000 (10:26 -0400)]
Merge branch '2019-04-03-master-imports'

- Important Khadas VIM2 fix
- Build fix for macOS Mojave
- Build fix for gcc-4.7 for host tools.

5 years agotools/Makefile: build host tools with -std=gnu99
Thomas Petazzoni [Sat, 30 Mar 2019 14:29:23 +0000 (15:29 +0100)]
tools/Makefile: build host tools with -std=gnu99

Parts of the code are using C99 constructs (such as variables declared
inside loops), but also GNU extensions (such as typeof), so using
-std=gnu99 is necessary to build with older versions of gcc that don't
default to building with gnu99.

It fixes the following build failure:

./tools/../lib/crc16.c: In function "crc16_ccitt":
./tools/../lib/crc16.c:70:2: error: "for" loop initial declarations are only allowed in C99 mode
  for (int i = 0;  i < len;  i++)
  ^
./tools/../lib/crc16.c:70:2: note: use option -std=c99 or -std=gnu99 to compile your code

when building the host tools with gcc 4.7.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
5 years agofix compile error on macOS Mojave
默默 [Sun, 31 Mar 2019 08:07:03 +0000 (16:07 +0800)]
fix compile error on macOS Mojave

5 years agoconfigs: khadas_vim2: Fix defconfig
Neil Armstrong [Wed, 3 Apr 2019 11:46:37 +0000 (13:46 +0200)]
configs: khadas_vim2: Fix defconfig

The Khadas VIM2 defconfig was missing the USB PHY config and
two other misc configs to setup dram banks and call misc_init_r.
Align it on the other Amlogic SoC based boards defconfig.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
5 years agophy: Also allow MESON_GXM for MESON_GXL_USB_PHY
Neil Armstrong [Wed, 3 Apr 2019 11:46:36 +0000 (13:46 +0200)]
phy: Also allow MESON_GXM for MESON_GXL_USB_PHY

The MESON_GXL_USB_PHY is also used on the Amlogic Meson GXM SoCs.

Fixes: 2960e27e38 ("phy: Add Amlogic Meson USB2 & USB3 Generic PHY drivers")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
5 years agotravis-ci: fix at91 missing boards
Eugen Hristev [Mon, 1 Apr 2019 11:04:03 +0000 (11:04 +0000)]
travis-ci: fix at91 missing boards

Fix missing at91 boards and split the at91 in two categories:
at91 arm v7
at91 arm926esj
which are the two main cores for the at91 architecture.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
5 years agoDTS: Fix ETH PHY reset on HSC|DDC boards (imx53)
Lukasz Majewski [Mon, 1 Apr 2019 14:00:05 +0000 (16:00 +0200)]
DTS: Fix ETH PHY reset on HSC|DDC boards (imx53)

After the commit: "eth: dm: fec: Add gpio phy reset binding"
SHA1: efd0b791069af93e9d439a70d1fe2ae8994dbbfa

The FEC ETH driver switched to PHY GPIO reset performed with data defined
in DTS.
For the HSC|DDC boards the GPIO reset signal is active low and hence the
wrong DTS description must be changed (otherwise the reset for ETH is not
properly setup).

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agocosmetic: Remove not needed string from kp_imx53.h config
Lukasz Majewski [Mon, 1 Apr 2019 14:00:04 +0000 (16:00 +0200)]
cosmetic: Remove not needed string from kp_imx53.h config

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agocosmetic: config: Remove empty #ifdefs
Lukasz Majewski [Mon, 1 Apr 2019 14:00:03 +0000 (16:00 +0200)]
cosmetic: config: Remove empty #ifdefs

After running tools/moveconfig.py it turned out that for various boards
there are an empty #ifdef statements.

Remove them to clean u-boot source code.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agodoc: Fix outdated ohci board hook documentation
Krzysztof Kozlowski [Tue, 2 Apr 2019 07:32:12 +0000 (09:32 +0200)]
doc: Fix outdated ohci board hook documentation

The ohci driver calls board_usb_init(), not usb_board_init().

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
5 years agoimx8mq_evk: README: Make the underline marker fill the whole sentence
Fabio Estevam [Wed, 13 Mar 2019 18:02:58 +0000 (15:02 -0300)]
imx8mq_evk: README: Make the underline marker fill the whole sentence

Let the underline marker "=" fill the whole sentence for better
readability.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
5 years agoimx8mq_evk: README: Fix a typo in the destination path
Fabio Estevam [Wed, 13 Mar 2019 18:02:57 +0000 (15:02 -0300)]
imx8mq_evk: README: Fix a typo in the destination path

The DDR firmware binaries should be copied to '$(srctree)', so fix
a typo.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
5 years agoimx8mq_evk: README: Need to copy bl31.bin to U-Boot source tree
Fabio Estevam [Wed, 13 Mar 2019 18:02:56 +0000 (15:02 -0300)]
imx8mq_evk: README: Need to copy bl31.bin to U-Boot source tree

After building ATF it is needed to copy the generated bl31.bin file to
the U-Boot source tree.

Make this step explicit in the instructions.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
5 years agoMerge branch 'master' of git://git.denx.de/u-boot-sh
Tom Rini [Tue, 2 Apr 2019 03:30:00 +0000 (23:30 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-sh

Minor fixes for the Alt board and PHY use on Gen2.

5 years agoMerge branch 'master' of git://git.denx.de/u-boot-sunxi
Tom Rini [Mon, 1 Apr 2019 16:31:22 +0000 (12:31 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-sunxi

- clk: sunxi: a10: Add CLK_AHB_GMAC

5 years agoclk: sunxi: a10: Add CLK_AHB_GMAC
Jagan Teki [Thu, 28 Mar 2019 08:16:11 +0000 (13:46 +0530)]
clk: sunxi: a10: Add CLK_AHB_GMAC

CLK_AHB_GMAC was suppose to be part of previous commit
"clk: sunxi: Implement A10 EMAC clocks" add it so-that
we can get rid of sunxi_set_gate warning on boot message.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agotools/imx8m_image.sh: remove bashism
Baruch Siach [Wed, 2 Jan 2019 06:58:28 +0000 (08:58 +0200)]
tools/imx8m_image.sh: remove bashism

Use a single '=' to test string equality for compatibility with non-bash
shells. Otherwise, if /bin/sh is dash, build fails:

./tools/imx8m_image.sh: 15: [: signed_hdmi_imx8m.bin: unexpected operator
./tools/imx8m_image.sh: 15: [: signed_hdmi_imx8m.bin: unexpected operator
./tools/imx8m_image.sh: 15: [: spl/u-boot-spl-ddr.bin: unexpected operator
./tools/imx8m_image.sh: 15: [: spl/u-boot-spl-ddr.bin: unexpected operator
WARNING './spl/u-boot-spl-ddr.bin' not found, resulting binary is not-functional

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Tested-by: Chris Spencer <christopher.spencer@sea.co.uk>
5 years agoMerge tag 'u-boot-imx-20190401' of git://git.denx.de/u-boot-imx
Tom Rini [Mon, 1 Apr 2019 13:39:38 +0000 (09:39 -0400)]
Merge tag 'u-boot-imx-20190401' of git://git.denx.de/u-boot-imx

Fixes for 2019.01

- pico-imx6ul: fix after conversion
- engicam boards
- pico-imx7d _ README due to hang with imx-usb-loader

5 years agopico-imx7d: README: Recommend the usage of a USB hub
Fabio Estevam [Wed, 27 Mar 2019 23:03:39 +0000 (20:03 -0300)]
pico-imx7d: README: Recommend the usage of a USB hub

Since commit 9e3c0174da842 ("pico-imx7d: Add LCD support") we started to
notice some hangs in U-Boot.

There is not an issue on such commit per se, but due to the LCD support
the current drawn is increased and this may cause issues when powering
pico-imx7d-pi from USB.

Some computers may be a bit strict with USB current draw and will
shut down their ports if the draw is too high.

The solution for that is to use an externally powered USB hub between the
board and the host computer.

Add such recommendation to the README file.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
5 years agoconfigs: icorem6: Use imx6 cratch register for bootcount
Jagan Teki [Thu, 21 Mar 2019 08:35:53 +0000 (14:05 +0530)]
configs: icorem6: Use imx6 cratch register for bootcount

SRAM address used for bootcount on exiting code is erasing
previous count value when system reset from Linux. So use
the dedicated imx6 scratch register, GPR2 to preserve the
contents even if the system reset from Linux.

Fixes: 4eb9aa39350e ("configs: imx6qdl_icore_mmc: Enable watchdog and bootcounter")
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Tested-by: Shyam Saini <shyam.saini@amarulasolutions.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
5 years agoconfigs: icore: Fix U-Boot proper loading from nand
Michael Trimarchi [Fri, 8 Mar 2019 07:35:03 +0000 (13:05 +0530)]
configs: icore: Fix U-Boot proper loading from nand

SPL on Engicam i.Core M6 boards enabled DM, so it would require some
malloc() pool before relocation in order to load U-Boot proper properly.

So, enable SPL malloc() pool of 0x2000 size similarly like what we have
used for icore mmc defconfigs.

Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Tested-by: Shyam Saini <shyam.saini@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
5 years agoARM: imx6q_logic: Enable UUID support
Adam Ford [Sun, 3 Mar 2019 22:22:45 +0000 (16:22 -0600)]
ARM: imx6q_logic: Enable UUID support

With UUID support, the root can now point to UUID.  This makes
swiching between mmc 0 and mmc 1 easier by simplying changing
mmcdev between 0 and 1.  From there, the scripts handle the rest.

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agopico-imx6ul: Fix eMMC boot after DM_MMC conversion
Fabio Estevam [Thu, 21 Mar 2019 13:59:06 +0000 (10:59 -0300)]
pico-imx6ul: Fix eMMC boot after DM_MMC conversion

After the DM_MMC conversion the following eMMC boot error is observed:

U-Boot SPL 2019.04-rc4 (Mar 20 2019 - 18:53:28 +0000)
Trying to boot from MMC1
MMC Device 0 not found
spl: could not find mmc device 0. error: -19
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

This happens because the SPL code does not initialize the SDHC pins
and clock.

Fix it by moving the original eMMC initialization from U-Boot proper
to SPL.

Reported-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Fabio Berton <fabio.berton@ossystems.com.br>
Reviewed-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agoMerge branch 'master' of git://git.denx.de/u-boot
Stefano Babic [Sun, 31 Mar 2019 17:54:10 +0000 (19:54 +0200)]
Merge branch 'master' of git://git.denx.de/u-boot

Signed-off-by: Stefano Babic <sbabic@denx.de>
5 years agoMerge tag 'video-fixes-for-2019.04-rc4' of git://git.denx.de/u-boot-video
Tom Rini [Sun, 31 Mar 2019 11:25:11 +0000 (07:25 -0400)]
Merge tag 'video-fixes-for-2019.04-rc4' of git://git.denx.de/u-boot-video

sunxi HDMI clock fix

5 years agoMerge tag 'rockchip-fixes-for-2019.04' of git://git.denx.de/u-boot-rockchip
Tom Rini [Sun, 31 Mar 2019 11:25:00 +0000 (07:25 -0400)]
Merge tag 'rockchip-fixes-for-2019.04' of git://git.denx.de/u-boot-rockchip

Last-minute fixes for Rockchip for 2019.04:
- reverts the deprecation of the 'download-key' detection
  (with a full solution pending for the next release)
- applies a temporary fix for the 32bit pinctrl registers on the RK3288

5 years agodfu: usb: Update MAINTAINERS file regarding DFU/USB gadget support
Lukasz Majewski [Sat, 30 Mar 2019 15:22:21 +0000 (16:22 +0100)]
dfu: usb: Update MAINTAINERS file regarding DFU/USB gadget support

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agoARM: rmobile: alt: Fix I2C bus number
Marek Vasut [Sat, 30 Mar 2019 07:24:19 +0000 (08:24 +0100)]
ARM: rmobile: alt: Fix I2C bus number

The I2C bus number to access the PMIC is I2C 7, fix this.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agoARM: dts: rmobile: Activate I2C7 on Alt
Marek Vasut [Sat, 30 Mar 2019 07:23:20 +0000 (08:23 +0100)]
ARM: dts: rmobile: Activate I2C7 on Alt

Activate I2C7 on Alt to allow access to the PMIC.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agoARM: rmobile: rcar-gen2: Activate bootm_size
Marek Vasut [Sat, 30 Mar 2019 06:43:55 +0000 (07:43 +0100)]
ARM: rmobile: rcar-gen2: Activate bootm_size

Commit d245059ff797 ("ARM: rmobile: rcar-gen3: Activate bootm_size")
only fixed the superfluous CONFIG_SYS_BOOTMAPSZ for R-Car Gen3, even
though it listed all affected boards. Apply the same fix to Gen2.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Fixes: d245059ff797 ("ARM: rmobile: rcar-gen3: Activate bootm_size")
Cc: Eugeniu Rosca <erosca@de.adit-jv.com>
5 years agoARM: rmobile: Fix PHY LED mode register mask
Marek Vasut [Sat, 30 Mar 2019 06:05:09 +0000 (07:05 +0100)]
ARM: rmobile: Fix PHY LED mode register mask

The PHY LED mode register mask should be 0xc000 , not 0xc0000.
Correct the mask to operate on the right bits.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agoARM: rmobile: alt: Synchronize defconfig
Marek Vasut [Sat, 30 Mar 2019 05:20:01 +0000 (06:20 +0100)]
ARM: rmobile: alt: Synchronize defconfig

Synchronize the R8A7794 Alt defconfig, enable DM SPI, DM SPI FLASH
and I2C driver support.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agoARM: rmobile: alt: Remove CLK2MHZ macro
Marek Vasut [Sat, 30 Mar 2019 05:14:42 +0000 (06:14 +0100)]
ARM: rmobile: alt: Remove CLK2MHZ macro

The CLK2MHZ macro is unused, remove it.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agoARM: rmobile: alt: Remove R8A7794_ETHERNET_B
Marek Vasut [Sat, 30 Mar 2019 05:10:49 +0000 (06:10 +0100)]
ARM: rmobile: alt: Remove R8A7794_ETHERNET_B

The R8A7794_ETHERNET_B config option is unused and based on the
description, this is a setting which should be fully done on a
DT level instead. Remove this config option.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agoMerge branch '2019-03-29-master-imports'
Tom Rini [Fri, 29 Mar 2019 14:53:28 +0000 (10:53 -0400)]
Merge branch '2019-03-29-master-imports'

- Bugfixes:
  - mmc: correct the HS400 initialization process
  - configs: ti: Move FIT image load address to avoid overwrite
  - lib: time: update module enable MACRO
  - Add mbrugger as RPi board maintainer, correct agraf's email address.

5 years agolib: time: update module enable MACRO
Kever Yang [Fri, 29 Mar 2019 14:17:33 +0000 (22:17 +0800)]
lib: time: update module enable MACRO

We'd better use correct way to check if module has enabled.
for we have 3 timer MACRO:
- CONFIG_TIMER
- CONFIG_SPL_TIMER
- CONFIG_TPL_TIMER

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
5 years agodoc/git-mailrc: correct entry 'agraf'
Heinrich Schuchardt [Thu, 28 Mar 2019 21:51:35 +0000 (22:51 +0100)]
doc/git-mailrc: correct entry 'agraf'

Correct Alex's email address.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Alexander Graf <agraf@csgraf.de>
5 years agoRPi: Add mbrugger as board maintainer
Matthias Brugger [Thu, 28 Mar 2019 13:47:39 +0000 (14:47 +0100)]
RPi: Add mbrugger as board maintainer

I took over maintainership from Alex Graf with commit
3157bbfa18 ("rpi: Make Matthias maintainer")
But I forgot to update the board maintainer file.
This patch adds myself to the game.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Alexander Graf <agraf@csgraf.de>
5 years agoconfigs: ti: Move FIT image load address to avoid overwrite
Andrew F. Davis [Tue, 26 Mar 2019 15:12:01 +0000 (10:12 -0500)]
configs: ti: Move FIT image load address to avoid overwrite

The FIT image is loaded to 0x8700_0000 followed by extracting from that
several large images also into the 0x8x00_0000 range. Large images
can end up overwriting the FIT image as it is being extracted from.
Move the FIT load address clear out to 0x9000_0000, this will require
a board to have at least 256MB of DRAM, if less then more careful
planning will be required for that platform.

Signed-off-by: Andrew F. Davis <afd@ti.com>
5 years agommc: correct the HS400 initialization process
BOUGH CHEN [Tue, 26 Mar 2019 06:24:17 +0000 (06:24 +0000)]
mmc: correct the HS400 initialization process

After the commit b9a2a0e2e9c0 ("mmc: Add support for downgrading
HS200/HS400 to HS mode"), it add a parameter in mmc_set_card_speed()
which indicates that the HS200/HS400 to HS downgrade is happening.

During the HS400 initialization, first select to HS200, and config
the related clock rate, then downgrade to HS mode. So here also need
to config the downgrade value to be true for two reasons. First,
make sure in the function mmc_set_card_speed(), after switch to HS
mode, first config the clock rate, then read the EXT_CSD, avoid
receiving data of EXT_CSD in HS mode at 200MHz. Second, after issue
the MMC_CMD_SWITCH command, it need to wait a bit then switch bus
properties.

Test on i.MX8QM MEK board, some Micron eMMC will stuck in transfer
mode in this case, and USDHC will never get data transfer complete
status, cause the uboot hang.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
5 years agoMerge tag 'efi-2019-04-rc5-2' of git://git.denx.de/u-boot-efi
Tom Rini [Fri, 29 Mar 2019 13:21:30 +0000 (09:21 -0400)]
Merge tag 'efi-2019-04-rc5-2' of git://git.denx.de/u-boot-efi

Pull request for UEFI system for v2019.04-rc5-2

This patch series contains a bug fix for a double free in a UEFI unit
test. The other patches are documentation only (except for the definition
of two additional constants).

5 years agopinctrl: rockchip: Add 32bit writing function for rk3288 gpio0 pinctrl
David Wu [Tue, 12 Feb 2019 11:51:51 +0000 (19:51 +0800)]
pinctrl: rockchip: Add 32bit writing function for rk3288 gpio0 pinctrl

There are no higher 16 writing corresponding bits for pmu_gpio0's
iomux/drive/pull at rk3288, need to read the value from register
firstly. Add the flag to distinguish it from normal registers.

Signed-off-by: David Wu <david.wu@rock-chips.com>
5 years agoRevert "rockchip: Drop call to rockchip_dnl_mode_check() for now"
Philipp Tomsich [Fri, 29 Mar 2019 08:21:13 +0000 (09:21 +0100)]
Revert "rockchip: Drop call to rockchip_dnl_mode_check() for now"

Due to a final resolution not coming up in time for 2019.04 and
following the consensus on the discussion, we'll keep this around
for 2019.04 after all.

This reverts commit 0d968ceb1ff63b0d220a571f438f0d5fe6350e88.

5 years agoMerge tag 'arc-last-minute-for-2019.04' of git://git.denx.de/u-boot-arc
Tom Rini [Fri, 29 Mar 2019 01:44:49 +0000 (21:44 -0400)]
Merge tag 'arc-last-minute-for-2019.04' of git://git.denx.de/u-boot-arc

This is last minute change which fixes problems in runtime on
AXS10x board caused by some changes in NAND framework and
tiny documentation improvement.

Anyways NAND flash storage was never really used on the board for various
reasons and now we decided to drop it for good.

Note this change only touches 1 ARC board so that should be safe for others.
As usual - build tested in TravisCI, see
https://travis-ci.org/abrodkin/u-boot/builds/512041342

5 years agosunxi: video: HDMI: Fix clock setup
Jernej Skrabec [Sun, 24 Mar 2019 18:26:40 +0000 (19:26 +0100)]
sunxi: video: HDMI: Fix clock setup

Currently, HDMI driver doesn't consider minimum and maximum allowed rate
of pll3 (video PLL). It works most of the time, but not always.

Consider monitor with resolution 1920x1200, which has pixel clock rate
of 154 MHz. Current code would determine that pll3 rate has to be set to
154 MHz. However, minimum supported rate is 192 MHz. In this case video
output just won't work.

The reason why the driver is written in the way it is, is that at the
time HDMI PHY and clock configuration wasn't fully understood. But now
we have needed knowledge, so the issue can be fixed.

With this fix, clock configuration routine uses full range (1-16) for
clock divider instead of limited one (1, 2, 4, 11). It also considers
minimum and maximum allowed rate for pll3.

Fixes: 56009451d843 ("sunxi: video: Add A64/H3/H5 HDMI driver")
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
5 years agohsdk: readme: Suggest getting pyelftools with pip
Alexey Brodkin [Mon, 18 Feb 2019 12:03:34 +0000 (15:03 +0300)]
hsdk: readme: Suggest getting pyelftools with pip

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Suggested-by: Yunir Salimzyanov <yunir@synopsys.com>
5 years agoARC: AXS10x: drop NAND support
Eugeniy Paltsev [Wed, 27 Mar 2019 13:53:43 +0000 (16:53 +0300)]
ARC: AXS10x: drop NAND support

On AXS10x boards we have non-standard NAND controller
which was never really used a lot as there're other much more
convenient [as they are standard & removable] persistent media
like SD-card and USB mass storage.

Moreover after recent changes we face with some NAND controller
runtime issues. So instead of keeping support of yet another
non-standard peripheral we're dropping its support for good.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
5 years agoefi_loader: define development target in README.uefi
Heinrich Schuchardt [Thu, 28 Mar 2019 07:09:16 +0000 (08:09 +0100)]
efi_loader: define development target in README.uefi

Describe the target scope of the UEFI implementation in U-Boot.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: update TODOs in doc/README.uefi
Heinrich Schuchardt [Wed, 27 Mar 2019 21:02:30 +0000 (22:02 +0100)]
efi_loader: update TODOs in doc/README.uefi

The following TODOs are closed:

- GetNextVariableName is not implemented
- event groups
- manage events in a linked list

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoMAINTAINERS: adjust git repository for EFI PAYLOAD
Heinrich Schuchardt [Wed, 20 Mar 2019 17:47:07 +0000 (18:47 +0100)]
MAINTAINERS: adjust git repository for EFI PAYLOAD

The EFI PAYLOAD will use git://git.denx.de/u-boot-efi.git in future.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: TODO for the EFI file protocol
Heinrich Schuchardt [Wed, 27 Mar 2019 20:41:04 +0000 (21:41 +0100)]
efi_loader: TODO for the EFI file protocol

We currently only support EFI_FILE_PROTOCOL_REVISION while
UEFI specs 2.4 - 2.7 prescribe EFI_FILE_PROTOCOL_REVISION2.
Add a todo.

Add missing constants for the EFI file protocol revision.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_selftest: avoid double free in dp utilities test
Heinrich Schuchardt [Tue, 26 Mar 2019 04:56:31 +0000 (05:56 +0100)]
efi_selftest: avoid double free in dp utilities test

Avoid duplicate FreePool() in unit test for the device patch utilities
protocol.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoMerge branch 'master' of git://git.denx.de/u-boot-socfpga
Tom Rini [Wed, 27 Mar 2019 03:19:31 +0000 (23:19 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-socfpga

- configs: Stratix10: Remove CONFIG_USE_TINY_PRINTF

5 years agoMerge branch 'master' of git://git.denx.de/u-boot-sh
Tom Rini [Wed, 27 Mar 2019 03:19:11 +0000 (23:19 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-sh

- Various fixes for bugs found by u-boot test.py

5 years agoMerge branch '2019-03-25-master-imports'
Tom Rini [Wed, 27 Mar 2019 03:17:21 +0000 (23:17 -0400)]
Merge branch '2019-03-25-master-imports'

- Convert various SPI related options to Kconfig