platform/kernel/u-boot.git
5 years agommc: fsl_esdhc: add uclass clk support
Peng Fan [Thu, 18 Oct 2018 12:28:35 +0000 (14:28 +0200)]
mmc: fsl_esdhc: add uclass clk support

When CONIFG_CLK is enabled, use uclass clk api to handle
the clock.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Stefano Babic <sbabic@denx.de>
5 years agofsl_esdhc: Update usdhc driver to support i.MX8
Ye Li [Thu, 18 Oct 2018 12:28:34 +0000 (14:28 +0200)]
fsl_esdhc: Update usdhc driver to support i.MX8

Add CONFIG_ARCH_IMX8 to use the 64bits support in usdhc driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
5 years agoserial: lpuart: support uclass clk api
Peng Fan [Thu, 18 Oct 2018 22:26:23 +0000 (00:26 +0200)]
serial: lpuart: support uclass clk api

Modify most APIs to use udevice as the first parameter, then
it will be easy to get the clk reference by using udevice pointer.
Use uclass api to get lpuart clk when CONFIG_CLK is enabled.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoserial: lpuart: Enable RX and TX FIFO
Ye Li [Thu, 18 Oct 2018 12:28:32 +0000 (14:28 +0200)]
serial: lpuart: Enable RX and TX FIFO

Enable the RX and TX FIFO in LPUART driver to avoid the input lost
during U-Boot boot up.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoserial_lpuart: Update lpuart driver to support i.MX8
Peng Fan [Thu, 18 Oct 2018 12:28:31 +0000 (14:28 +0200)]
serial_lpuart: Update lpuart driver to support i.MX8

Add i.MX8 compatible string and cpu type support to lpuart driver,
to use little endian 32 bits configurations.

Also, according to RM, the Receive FIFO Enable (RXFE) field in LPUART
FIFO register is bit 3, so this definition should change to 0x08
(not 0x40) for i.MX8, otherwise the Receive FIFO is not disabled.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoclk: imx: add clk driver for i.MX8QXP
Peng Fan [Thu, 18 Oct 2018 12:28:30 +0000 (14:28 +0200)]
clk: imx: add clk driver for i.MX8QXP

Add clk driver for i.MX8QXP. This basic version supports clk
enable/disable/get_rate/set_rate operations for I2C, ENET,
SDHC0 and UART clocks.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agopower: Add power domain driver for i.MX8
Peng Fan [Thu, 18 Oct 2018 12:28:29 +0000 (14:28 +0200)]
power: Add power domain driver for i.MX8

Add the power domain DM driver for i.MX8, that it depends on the DTB
power domain trees to generate the power domain provider devices. Users
need to add power domain trees with property "compatible = "nxp,imx8-pd";"

When power on a PD device, the driver will power on its ancestor PD
devices in power domain tree.

When power off a PD device, the driver will check its child PD devices
first. Only if all child PD devices are off, then power off the current PD
device. Then the driver checks sibling PD devices. If sibling PD devices
are off, then it will power off parent PD device.

There is no counter maintained in this driver, but a state to hold current
on/off state. So the request and free functions are empty.

The power domain implementation in i.MX8 DTB set the "#power-domain-cells"
to 0, so there is no ID binding with each PD device. We don't use "id"
variable in struct power_domain. At the same time, we have to set of_xlate
to empty to bypass standard of_xlate in uclass driver.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agopinctrl: Add pinctrl driver for i.MX8
Peng Fan [Thu, 18 Oct 2018 12:28:28 +0000 (14:28 +0200)]
pinctrl: Add pinctrl driver for i.MX8

Add pinctrl driver for i.MX8. The pads configuration is controlled
by SCU, so need to ask SCU to configure pads through scfw API.
Add pinctrl-scu to invoke sc_pad_set to configure pads.
Add a new flag IMX8_USE_SCU to differentiate i.MX8 from other platforms
which could directly configure pads from Acore side.
Add CONFIG_PINCTRL_IMX8 as the built gate.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agogpio: mxc_gpio: add support for i.MX8
Peng Fan [Thu, 18 Oct 2018 12:28:27 +0000 (14:28 +0200)]
gpio: mxc_gpio: add support for i.MX8

Add i.MX8 support, there are 8 GPIO banks.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx8: add dummy clock
Peng Fan [Thu, 18 Oct 2018 12:28:26 +0000 (14:28 +0200)]
imx8: add dummy clock

This driver is mostly used to avoid build errors.
We use uclass clk driver for clk related operations.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx8: add iomux configuration api
Peng Fan [Thu, 18 Oct 2018 12:28:25 +0000 (14:28 +0200)]
imx8: add iomux configuration api

Add iomux configuration api.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx8: cpu: add uclass based CPU driver
Anatolij Gustschin [Thu, 18 Oct 2018 12:28:24 +0000 (14:28 +0200)]
imx8: cpu: add uclass based CPU driver

print_cpuinfo() in board init code requires uclass CPU driver,
add it to be able to display CPU info when CONFIG_DISPLAY_CPUINFO
option is enabled. CPU node in DT will have to include 'clocks'
and 'u-boot,dm-pre-reloc' properties for generic print_cpuinfo()
to work as expected. The driver outputs info for i.MX8QXP Rev A
and Rev B CPUs.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx8: cpu: add function for reading FEC MAC from fuse
Anatolij Gustschin [Thu, 18 Oct 2018 12:28:23 +0000 (14:28 +0200)]
imx8: cpu: add function for reading FEC MAC from fuse

FEC driver requires imx_get_mac_from_fuse(). Add it in preparation
for ENETx support.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx8: add arch_cpu_init arch_cpu_init_dm
Peng Fan [Thu, 18 Oct 2018 12:28:22 +0000 (14:28 +0200)]
imx8: add arch_cpu_init arch_cpu_init_dm

Add arch_cpu_init(_dm) mainly to open the channel between ACore and SCU.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx8: add mmu and dram related functions
Peng Fan [Thu, 18 Oct 2018 12:28:21 +0000 (14:28 +0200)]
imx8: add mmu and dram related functions

Add mmu memmap, some memory regions are reserved by M4, Arm Trusted
Firmware, so need to get memreg using SCFW API and setup the memmap.

Add dram_init, dram_init_banksize, get_effective_memsize functions,
according to the memreg.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx8: implement mmc_get_env_dev
Peng Fan [Thu, 18 Oct 2018 12:28:20 +0000 (14:28 +0200)]
imx8: implement mmc_get_env_dev

Implement mmc_get_env_dev for i.MX8.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx8: add boot device detection
Peng Fan [Thu, 18 Oct 2018 12:28:19 +0000 (14:28 +0200)]
imx8: add boot device detection

Add get_boot_device to detect boot device.
Add print_bootinfo to print the boot device info.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx8: add basic cpu support
Peng Fan [Thu, 18 Oct 2018 12:28:18 +0000 (14:28 +0200)]
imx8: add basic cpu support

Add basic cpu support, including cpu revision, cpu type,
cpu core detection.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoarmv8: add cpu core helper functions
Peng Fan [Thu, 18 Oct 2018 12:28:17 +0000 (14:28 +0200)]
armv8: add cpu core helper functions

Add helper functions to identify different armv8 variants.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx: add i.MX8 cpu type
Peng Fan [Thu, 18 Oct 2018 12:28:16 +0000 (14:28 +0200)]
imx: add i.MX8 cpu type

Add i.MX8 cpu type and is_imx8/is_imx8qxp help macros.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx8: pins: include i.MX8QXP pin header when CONFIG_IMX8QXP defined
Peng Fan [Thu, 18 Oct 2018 12:28:15 +0000 (14:28 +0200)]
imx8: pins: include i.MX8QXP pin header when CONFIG_IMX8QXP defined

Include i.MX8QXP pin header when CONFIG_IMX8QXP defined,
if no SoC macro defined, report error.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx8: add imx-regs header file
Peng Fan [Thu, 18 Oct 2018 12:28:14 +0000 (14:28 +0200)]
imx8: add imx-regs header file

Add imx-regs header file to include the register base definition

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx: boot_mode: Add FLEXSPI boot entry
Peng Fan [Thu, 18 Oct 2018 12:28:13 +0000 (14:28 +0200)]
imx: boot_mode: Add FLEXSPI boot entry

i.MX8 support FLEXSPI boot support. So add FLEXSPI boot entry.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agomisc: imx8: add scfw api impementation
Peng Fan [Thu, 18 Oct 2018 12:28:12 +0000 (14:28 +0200)]
misc: imx8: add scfw api impementation

Add clk/misc/pad/pm/rm scfw api implementaion for different
drivers to invoke. The low level code is using misc_call
to invoke imx8_scu driver.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agomisc: add i.MX8 misc driver
Peng Fan [Thu, 18 Oct 2018 12:28:11 +0000 (14:28 +0200)]
misc: add i.MX8 misc driver

Add i.MX8 MISC driver to handle the communication between
A35 Core and SCU.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoarm: global_data: add scu_dev for i.MX8
Peng Fan [Thu, 18 Oct 2018 12:28:10 +0000 (14:28 +0200)]
arm: global_data: add scu_dev for i.MX8

Add scu_dev for i.MX8, this will be used as a handle
to communite with SCU from A35.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoarm: build mach-imx for i.MX8
Peng Fan [Thu, 18 Oct 2018 12:28:09 +0000 (14:28 +0200)]
arm: build mach-imx for i.MX8

Build mach-imx for i.MX8

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx: add Kconfig entry for i.MX8QXP
Peng Fan [Thu, 18 Oct 2018 12:28:08 +0000 (14:28 +0200)]
imx: add Kconfig entry for i.MX8QXP

Add Kconfig entry for i.MX8QXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx8: add scfw macro definition
Peng Fan [Thu, 18 Oct 2018 12:28:07 +0000 (14:28 +0200)]
imx8: add scfw macro definition

Add SCFW macro definition.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agodt-bindings: soc: add i.MX8QXP pm and rsrc definition
Peng Fan [Thu, 18 Oct 2018 12:28:06 +0000 (14:28 +0200)]
dt-bindings: soc: add i.MX8QXP pm and rsrc definition

Add i.MX8QXP power and resource definition

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agodt-bindings: clock: dt-bindings: pinctrl: add i.MX8QXP clocks definition
Peng Fan [Thu, 18 Oct 2018 12:28:05 +0000 (14:28 +0200)]
dt-bindings: clock: dt-bindings: pinctrl: add i.MX8QXP clocks definition

Add i.MX8QXP clocks definition

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agodt-bindings: pinctrl: add i.MX8QXP pads definition
Peng Fan [Thu, 18 Oct 2018 12:28:04 +0000 (14:28 +0200)]
dt-bindings: pinctrl: add i.MX8QXP pads definition

Add i.MX8QXP pads definition

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agotravis: Add qemu-x86_64 target for test.py testing
Bin Meng [Sun, 14 Oct 2018 03:52:14 +0000 (20:52 -0700)]
travis: Add qemu-x86_64 target for test.py testing

Add qemu-x86_64 to the list of targets we use for test.py runs.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agotravis: Update to use QEMU 3.0.0 for testing
Bin Meng [Sun, 14 Oct 2018 03:52:13 +0000 (20:52 -0700)]
travis: Update to use QEMU 3.0.0 for testing

This updates travis-ci to use QEMU 3.0.0 for testing.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agotravis: Generate grub_x64.efi for qemu-x86_64
Bin Meng [Sun, 14 Oct 2018 03:52:12 +0000 (20:52 -0700)]
travis: Generate grub_x64.efi for qemu-x86_64

grub_x86.efi is for 32-bit QEMU. Generate the 64-bit one.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agox86: quark: Specify X86_TSC_TIMER_EARLY_FREQ
Bin Meng [Sun, 14 Oct 2018 03:52:11 +0000 (20:52 -0700)]
x86: quark: Specify X86_TSC_TIMER_EARLY_FREQ

Specify X86_TSC_TIMER_EARLY_FREQ for Quark SoC so that TSC as
the early timer can be supported.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agox86: tsc: Introduce config option for early timer frequency
Bin Meng [Sun, 14 Oct 2018 03:52:10 +0000 (20:52 -0700)]
x86: tsc: Introduce config option for early timer frequency

So far the TSC timer driver supports trying hardware calibration first
and using device tree as last resort for its running frequency as the
normal timer.

However when it is used as the early timer, it only supports hardware
calibration and if it fails, the driver just panics. This introduces
a new config option to specify the early timer frequency in MHz and
it should be equal to the value described in the device tree.

Without this patch, the travis-ci testing on QEMU x86_64 target fails
each time after it finishes the 'bootefi selftest' as the test.py see
an error was emitted on the console like this:

  TSC frequency is ZERO
  resetting ...
  ### ERROR ### Please RESET the board ###

It's strange that this error is consistently seen on the travis-ci
machine, but only occasionally seen on my local machine (maybe 1 out
of 10). Since QEMU x86_64 target enables BOOTSTAGE support which uses
early timer, with this fix it should work without any failure.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agox86: Fix the mystery of printch() during 64-bit boot
Bin Meng [Sun, 14 Oct 2018 03:52:09 +0000 (20:52 -0700)]
x86: Fix the mystery of printch() during 64-bit boot

At present in arch_setup_gd() it calls printch(' ') at the end which
has been a mystery for a long time as without such call the 64-bit
U-Boot just does not boot at all.

In fact this is due to the bug that board_init_f() was called with
boot_flags not being set. Hence whatever value being there in the
rdi register becomes the boot_flags if without such magic call.
With a printch(' ') call the rdi register is initialized as 0x20
and this value seems to be sane enough for the whole boot process.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agox86: put global data pointer into the .data section
Heinrich Schuchardt [Sun, 14 Oct 2018 03:52:07 +0000 (20:52 -0700)]
x86: put global data pointer into the .data section

On x86_64 the field global_data_ptr is assigned before relocation. As
sections for uninitialized global data (.bss) overlap with the relocation
sections (.rela) this destroys the relocation table and leads to spurious
errors.

Initialization forces the global_data_ptr into a section for initialized
global data (.data) which cannot overlap any .rela section.

Fixes: a160092a610f ("x86: Support global_data on x86_64")
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>
5 years agox86: detect unsupported relocation types
Heinrich Schuchardt [Sun, 14 Oct 2018 03:52:06 +0000 (20:52 -0700)]
x86: detect unsupported relocation types

Currently we support only relocations of type ELF64_R_TYPE or ELF32_R_TYPE.
We should be warned if other relocation types appear in the relocation
sections.

This type of message has helped to identify code overwriting a relocation
section before relocation and incorrect parsing of relocation tables.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: qemu: enable CONFIG_SPL_DM_RTC
Heinrich Schuchardt [Sun, 14 Oct 2018 03:52:05 +0000 (20:52 -0700)]
x86: qemu: enable CONFIG_SPL_DM_RTC

Since commit 380d4f787a3f ("rtc: Allow use of RTC in SPL and TPL")
qemu-x86_64_defconfig does not boot anymore.

Fixes: 380d4f787a3f ("rtc: Allow use of RTC in SPL and TPL")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: doc: Remove stale sections of 64-bit support
Bin Meng [Sun, 14 Oct 2018 03:52:04 +0000 (20:52 -0700)]
x86: doc: Remove stale sections of 64-bit support

There are some sections in current doc saying 64-bit is unsupported.
This apparently is out of date. Remove it.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agox86: doc: Mention qemu-x86_64 support
Bin Meng [Sun, 14 Oct 2018 03:52:03 +0000 (20:52 -0700)]
x86: doc: Mention qemu-x86_64 support

Currently only 32-bit U-Boot for QEMU x86 is documented. Mention
the 64-bit support.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agox86: Ensure no instruction sets of MMX/SSE are generated in 64-bit build
Bin Meng [Sun, 14 Oct 2018 03:52:02 +0000 (20:52 -0700)]
x86: Ensure no instruction sets of MMX/SSE are generated in 64-bit build

With the '-march=core2' fix, it seems that we have some luck that
the 64-bit U-Boot boots again. However if we examine the disassembly
codes there are still SSE instructions elsewhere which means passing
cpu type to GCC is not enough to prevent it from generating these
instructions. A simple test case is doing a 'bootefi selftest' from
the U-Boot shell and it leads to a reset too.

The 'bootefi selftest' reset is even seen with the image created by
the relative older GCC 5.4.0, the one shipped by Ubuntu 16.04.

The reset actually originates from undefined instruction exception
caused by these SSE instructions. To keep U-Boot as a bootloader as
simple as possible, we don't want to handle such advanced SIMD stuff.
To make sure no MMX/SSE instruction sets are generated, tell GCC not
to do this. Note AVX is out of the question as CORE2 is old enough
to support AVX yet.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agox86: Specify -march=core2 to build 64-bit U-Boot proper
Bin Meng [Sun, 14 Oct 2018 03:52:01 +0000 (20:52 -0700)]
x86: Specify -march=core2 to build 64-bit U-Boot proper

With newer kernel.org GCC (7.3.0 or 8.1.0), the u-boot.rom image
built for qemu-x86_64 target does not boot. It keeps resetting
soon after the 32-bit SPL jumps to 64-bit proper. Debugging shows
that the reset happens inside env_callback_init().

000000000113dd85 <env_callback_init>:
 113dd85:       41 54                   push   %r12
 113dd87:       55                      push   %rbp
 113dd88:       31 c0                   xor    %eax,%eax
 113dd8a:       53                      push   %rbx
 113dd8b:       0f 57 c0                xorps  %xmm0,%xmm0

Executing "xorps %xmm0,%xmm0" causes CPU to immediately reset.
However older GCC like 5.4.0 (the one shipped by Ubuntu 16.04)
does not generate such instructions that utilizes SSE for this
function - env_callback_init() and U-Boot boots without any issue.
Explicitly specifying -march=core2 for newer GCC allows U-Boot
proper to boot again. Examine assembly codes of env_callback_init
and there is no SSE instruction in that function hence U-Boot
continues to boot.

core2 seems to be the oldest arch in GCC that supports 64-bit.
Like 32-bit U-Boot build we use -march=i386 which is the most
conservative cpu type so that the image can run on any x86
processor, let's do the same for the 64-bit U-Boot build.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agox86/bootm: fix error handling in boot_prep_linux(...)
Hannes Schmelzer [Thu, 11 Oct 2018 05:44:42 +0000 (07:44 +0200)]
x86/bootm: fix error handling in boot_prep_linux(...)

Once we get a zero pointer from load_zimage(...) we must bunch out
instead of continue boot.

Signed-off-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoEnable CONFIG_TIMER_EARLY with bootstage
Simon Glass [Sun, 2 Sep 2018 23:02:24 +0000 (17:02 -0600)]
Enable CONFIG_TIMER_EARLY with bootstage

In initr_bootstage() we call bootstage_mark_name() which ends up calling
timer_get_us(). This call happens before initr_dm(), which inits driver
model.

On x86 we set gd->timer to NULL in the transition from board_init_f()
to board_init_r(). See board_init_f_r() for this assignment. So U-Boot
knows there is no timer available in the period immediately after
relocation.

On x86 the timer_get_us() call is implemented as calls to get_ticks() and
get_tbclk(). Both of these call dm_timer_init() to set up the timer, if
gd->timer is NULL and the early timer is not available.

However dm_timer_init() cannot succeed before initr_dm() is called.

So it seems that on x86 if we want to use CONFIG_BOOTSTAGE we must enable
CONFIG_TIMER_EARLY. Update the Kconfig to handle this.

Note: On most architectures we can rely on the pre-relocation memory still
being available, so that gd->timer pointers to a valid timer device and
everything works correctly. Admittedly this is not strictly correct since
the timer device is set up by pre-relocation U-Boot, but normally this is
fine. On x86 the 'CAR' (cache-as-RAM) memory used by pre-relocation U-Boot
disappears in board_init_f_r() and any attempt to access it will hang.
This is the reason why we must mark the timer as invalid when we get to
board_init_f_r().

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agobinman: Add support for Intel reference code
Simon Glass [Sun, 2 Sep 2018 23:02:26 +0000 (17:02 -0600)]
binman: Add support for Intel reference code

Some platforms use this instead of FSP to set up the platform, including
memory. Add support for this in binman. This is needed for
chromebook_samus, for example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agochromebook_samus: Increase pre-relocation memory
Simon Glass [Sun, 2 Sep 2018 23:02:25 +0000 (17:02 -0600)]
chromebook_samus: Increase pre-relocation memory

With bootstage now allocating pre-relocation memory the current amount
available is insufficient. Increase it a little.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agotest: Add test for PCI device without compat string and with DT node
Marek Vasut [Wed, 10 Oct 2018 19:27:09 +0000 (21:27 +0200)]
test: Add test for PCI device without compat string and with DT node

Add test which checks if a PCI device described in DT with an
entry and reg = <...> property, but without compatible string
results in a valid U-Boot PCI udevice with the udevice.node
populated with reference to this DT node. Also check if the
other PCI device without a DT node does not contain any bogus
udevice.node.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agotest: Add PCI device entry without compat string and with DT node
Marek Vasut [Wed, 10 Oct 2018 19:27:08 +0000 (21:27 +0200)]
test: Add PCI device entry without compat string and with DT node

Add PCI entry without compatible string and with a DT node only with
reg = <...> property into the DT. This is needed for the tests to
verify whether such a setup creates an U-Boot PCI device with the
DT node associated with it in udevice.node.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agopci: Update documentation to make 'compatible' string optional
Marek Vasut [Wed, 10 Oct 2018 19:27:07 +0000 (21:27 +0200)]
pci: Update documentation to make 'compatible' string optional

Reword the documentation to make it clear the compatible string is now
optional, yet still matching on it takes precedence over PCI IDs and
PCI classes.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agopci: Support parsing PCI controller DT subnodes
Marek Vasut [Wed, 10 Oct 2018 19:27:06 +0000 (21:27 +0200)]
pci: Support parsing PCI controller DT subnodes

The PCI controller can have DT subnodes describing extra properties
of particular PCI devices, ie. a PHY attached to an EHCI controller
on a PCI bus. This patch parses those DT subnodes and assigns a node
to the PCI device instance, so that the driver can extract details
from that node and ie. configure the PHY using the PHY subsystem.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agocommon: command: fix typo
Heinrich Schuchardt [Fri, 12 Oct 2018 09:23:04 +0000 (11:23 +0200)]
common: command: fix typo

%s/CMD_RET_SUCCESX/CMD_RET_SUCCESS/g

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoConvert CONFIG_FLASH_CFI_DRIVER et al to Kconfig
Adam Ford [Sun, 14 Oct 2018 20:10:50 +0000 (15:10 -0500)]
Convert CONFIG_FLASH_CFI_DRIVER et al to Kconfig

This converts the following to Kconfig:
   CONFIG_FLASH_CFI_DRIVER
   CONFIG_SYS_FLASH_USE_BUFFER_WRITE
   CONFIG_FLASH_CFI_MTD
   CONFIG_SYS_FLASH_PROTECTION
   CONFIG_SYS_FLASH_CFI

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-migrate]
Signed-off-by: Tom Rini <trini@konsulko.com>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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

5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>