oweals/u-boot.git
5 years agoefi_selftest: physical and virtual addresses must match
Heinrich Schuchardt [Thu, 11 Apr 2019 17:59:31 +0000 (19:59 +0200)]
efi_selftest: physical and virtual addresses must match

At boottime physical and virtual addresses must match. Add a corresponding
check to the memory unit test.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: update virtual address in efi_mem_carve_out
Heinrich Schuchardt [Thu, 11 Apr 2019 18:08:54 +0000 (20:08 +0200)]
efi_loader: update virtual address in efi_mem_carve_out

Handle virtual address in efi_mem_carve_out() function
when a new region is created to avoid issue in EFI memory map.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
At boottime physical and virtual addressed have to be the same.
This allowed to simplify the proposed logic.

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: add protection for block_dev
Patrick Delaunay [Wed, 10 Apr 2019 09:02:58 +0000 (11:02 +0200)]
efi_loader: add protection for block_dev

Check the value of block_dev before to use this pointer.

This patch solves problem for the command "load" when ubifs
is previously mounted: in this case the function
blk_get_device_part_str("ubi 0") don't return error but return
block_dev = NULL and then data abort.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: fix setting PlatformLang
Heinrich Schuchardt [Thu, 11 Apr 2019 05:34:24 +0000 (07:34 +0200)]
efi_loader: fix setting PlatformLang

The UEFI variables PlatformLang and PlatformLangCodes specify the current
firmware language and the list of all available languages.

Currently their values are hard coded. With the patch a new configuration
variable EFI_PLATFORM_LANG_CODES is provided.

When initializing the UEFI subsystem this configuration variable is used to
initialize PlatformLangCodes. The value of variable PlatformLang is read.
If it is not set, the first language specified in EFI_PLATFORM_LANG_CODES
is used to initialize PlatformLang.

Suggested-by: Takahiro Akashi <takahiro.akashi@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: the development target should be the EBBR
Heinrich Schuchardt [Wed, 10 Apr 2019 06:04:38 +0000 (08:04 +0200)]
efi_loader: the development target should be the EBBR

Two subsets of the UEFI specifications have been defined. The one for
servers is "Server Base Boot Requirements System Software on ARM
Platforms" (SBBR), the one for embedded systems is the "Embedded Base Boot
Requirements (EBBR) Specification". Reaching compliance with thei EBBR is a
more realistic development target than reaching complicance with the SBBR.

Suggested-by: Alexander Graf <agraf@csgraf.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi: fix memory calculation overflow on 32-bit systems
Patrick Wildt [Tue, 9 Apr 2019 20:58:30 +0000 (22:58 +0200)]
efi: fix memory calculation overflow on 32-bit systems

There are Cubox-i machines out there with nearly 4 GiB of RAM.  The
RAM starts at 0x10000000 with a size of 0xf0000000.  Thus the end
of RAM is at 0x100000000.  This overflows a 32-bit integer, which
should be fine since in the EFI memory code the variables used are
all 64-bit with a fixed size.  Unfortunately EFI_PAGE_MASK, which is
used in the EFI memory code to remove the lower bits, is based on
the EFI_PAGE_SIZE macro which, uses 1UL with a shift.  This means
the resulting mask is UL, which is only 32-bit on ARMv7.  Use ULL to
make sure that even on 32-bit platforms we use a 64-bit long mask.
Without this there will be no memory available in the EFI memory map
and bootefi will fail allocating pages.

Signed-off-by: Patrick Wildt <patrick@blueri.se>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agoarm: print information about loaded UEFI images
Heinrich Schuchardt [Thu, 4 Apr 2019 20:06:25 +0000 (22:06 +0200)]
arm: print information about loaded UEFI images

If an exception occurs in a UEFI loaded image we need the start address of
the image to determine the relocation offset.

This patch adds the necessary lines after the registers in the crash dump
for armv8. A possible output would be:

UEFI image [0x00000000bffe6000:0x00000000bffe631f] pc=0x138 '/\snp.efi'

With the offset 0x138 we can now find the relevant instruction in the
disassembled 'snp.efi' binary.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: move efi_save_gd() call to board_r.c
Heinrich Schuchardt [Tue, 9 Apr 2019 22:32:07 +0000 (00:32 +0200)]
efi_loader: move efi_save_gd() call to board_r.c

The first functions of the UEFI sub-system are invoked before reaching the
U-Boot shell, e.g. efi_set_bootdev(), efi_dp_from_name(),
efi_dp_from_file(). We should be able to print out device paths for
debugging purposes here.

When printing device paths via printf("%pD\n", dp) this invokes functions
defined as EFIAPI. So efi_save_gd() must be called beforehand.

So let's move the efi_save_gd() call to function initr_reloc_global_data(()
in board_r.c.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: remove stray #define LOG_CATEGORY LOGL_ERR
Heinrich Schuchardt [Tue, 9 Apr 2019 21:22:13 +0000 (23:22 +0200)]
efi_loader: remove stray #define LOG_CATEGORY LOGL_ERR

The statement '#define LOG_CATEGORY LOGL_ERR' makes not sense. LOGL_ERR is
not a LOG_CATEGORY. Remove the statement.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: enable HII protocols by default
Heinrich Schuchardt [Sun, 7 Apr 2019 21:58:50 +0000 (23:58 +0200)]
efi_loader: enable HII protocols by default

As the UEFI shell requires the HII protocols let's enable them by default.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: assign HII protocols to root node
Heinrich Schuchardt [Sun, 7 Apr 2019 21:53:53 +0000 (23:53 +0200)]
efi_loader: assign HII protocols to root node

We should not install the HII protocols on every loaded image. It is
sufficient to install them once on the root node.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoMerge branch '2019-04-11-ti-master-imports'
Tom Rini [Fri, 12 Apr 2019 16:22:43 +0000 (12:22 -0400)]
Merge branch '2019-04-11-ti-master-imports'

- Improve Keystone 3 SoC support (DMA, TI SCI)
- Improve Keystone 2 SoC support (PHY fixes on various platforms)
- Improve am335x families (new platforms, more boot mode options in SPL
  via DM).
- General DaVinci, OMAP5 fixes.

5 years agommc: omap_hsmmc: Set 3.3V for IO voltage
Faiz Abbas [Fri, 5 Apr 2019 08:48:46 +0000 (14:18 +0530)]
mmc: omap_hsmmc: Set 3.3V for IO voltage

Pbias voltage should match the IO voltage set for the SD card. With the
latest pbias change to 3.3V, update the capabilities and IO voltages
settings to 3.3V.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
5 years agoARM: dts: dra71-evm: Correct evm_sd regulator max voltage
Faiz Abbas [Fri, 5 Apr 2019 08:48:45 +0000 (14:18 +0530)]
ARM: dts: dra71-evm: Correct evm_sd regulator max voltage

Correct vpo_sd_1v8_3v3 regulator max voltage to 3.3V

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Reviewed-by: Keerthy <j-keerthy@ti.com>
5 years agoARM: dts: dra7: Change pbias voltage to 3.3V
Faiz Abbas [Fri, 5 Apr 2019 08:48:44 +0000 (14:18 +0530)]
ARM: dts: dra7: Change pbias voltage to 3.3V

As per recent TRM[1], PBIAS cell on dra7 devices supports
3.3v and not 3.0v as documented earlier.

Update PBIAS regulator max voltage and the voltage written
in the driver to reflect this.

[1] http://www.ti.com/lit/pdf/sprui30

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
5 years agoARM: am3517_evm: Add spl_start_uboot for Falcon Mode
Adam Ford [Sun, 31 Mar 2019 14:18:29 +0000 (09:18 -0500)]
ARM: am3517_evm: Add spl_start_uboot for Falcon Mode

When booting the am3517-evm, the following message appears:
SPL: Please implement spl_start_uboot() for your board
SPL: Direct Linux boot not active!

This patch implements spl_start_uboot to clear this message
and allow device to know if it should boot U-Boot or kernel.

Fixes: 1c6b6f383a41 ("ARM: am3517_evm: Enable Falcon Mode")

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agoti: keystone2: Move CONFIG_ISW_ENTRY_ADDR to a common place
Tom Rini [Tue, 19 Mar 2019 11:14:37 +0000 (07:14 -0400)]
ti: keystone2: Move CONFIG_ISW_ENTRY_ADDR to a common place

The ISW_ENTRY_ADDR Kconfig option under mach-omap2 isn't a SoC specific
notion but rather "where is our previous stage loaded in memory?"
option.  Make use of this on ARCH_KEYSTONE rather than SPL_TEXT_BASE for
our HS builds that are not using SPL anyhow.

Cc: Vitaly Andrianov <vitalya@ti.com>
Cc: Andrew F. Davis <afd@ti.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com?
5 years agoboard: ti: am335x: Remove non DM_ETH code
Faiz Abbas [Mon, 18 Mar 2019 08:24:41 +0000 (13:54 +0530)]
board: ti: am335x: Remove non DM_ETH code

With DM_ETH enabled in am335x devices, remove all the unused
non-DM code.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
5 years agoconfigs: am335x_evm: Update VCI String
Faiz Abbas [Mon, 18 Mar 2019 08:24:40 +0000 (13:54 +0530)]
configs: am335x_evm: Update VCI String

Update VCI string to keep it compatible with legacy test setups.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agoconfigs: am335x_evm: Add Support for SPL_ETH
Faiz Abbas [Mon, 18 Mar 2019 08:24:39 +0000 (13:54 +0530)]
configs: am335x_evm: Add Support for SPL_ETH

Add Support for booting from Ethernet.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
5 years agoconfigs: am335x_evm: Reduce size of SPL
Faiz Abbas [Mon, 18 Mar 2019 08:24:38 +0000 (13:54 +0530)]
configs: am335x_evm: Reduce size of SPL

Make some room in SPL by getting rid of unnecessary configs.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
5 years agoboard: ti: am335x: Add platdata for cpsw in SPL
Faiz Abbas [Mon, 18 Mar 2019 08:24:37 +0000 (13:54 +0530)]
board: ti: am335x: Add platdata for cpsw in SPL

The SPL image overflows when cpsw dt nodes are added and SPL_OF_CONTROL
is enabled. Use static platdata instead to save space.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
5 years agonet: ti: cpsw: Enable DM_FLAG_PRE_RELOC
Faiz Abbas [Mon, 18 Mar 2019 08:24:36 +0000 (13:54 +0530)]
net: ti: cpsw: Enable DM_FLAG_PRE_RELOC

Add DM_FLAG_PRE_RELOC to make the driver probe in SPL.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
5 years agonet: ti: cpsw: Block off ofdata_to_platdata with OF_CONTROL
Faiz Abbas [Mon, 18 Mar 2019 08:24:35 +0000 (13:54 +0530)]
net: ti: cpsw: Block off ofdata_to_platdata with OF_CONTROL

The ofdata_to_platdata function should not be called if OF_CONTROL is
not enabled because fdtdec_* calls will fail. Block the function with
OF_CONTROL

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
5 years agonet: ti: cpsw-common: Isolate getting syscon address from assigning macid
Faiz Abbas [Mon, 18 Mar 2019 08:24:34 +0000 (13:54 +0530)]
net: ti: cpsw-common: Isolate getting syscon address from assigning macid

ti_cm_get_macid() is used to get a syscon node from the dt, read the
efuse address and then assign the macid read from the address. Divide
these two steps into separate functions one of which can be called from
ofdata_to_platdata() while the other can be called from _probe(). This
ensures that platdata can be assigned statically in a board file when
OF_CONTROL is not enabled. Also add a macid_sel_compat in private data
to get information about the macid byte placement.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
5 years agonet: ti: cpsw: Convert cpsw_platform_data to a pointer in cpsw_priv
Faiz Abbas [Mon, 18 Mar 2019 08:24:33 +0000 (13:54 +0530)]
net: ti: cpsw: Convert cpsw_platform_data to a pointer in cpsw_priv

Convert cpsw_platform_data to a pointer in cpsw_priv. Allocate it
dynamically and assign it as a part of eth_pdata. This helps in
isolating platform data handling and implementing platdata for SPL
in a board file.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
5 years agonet: ti: cpsw: Move cpsw_phy_sel() to _probe()
Faiz Abbas [Mon, 18 Mar 2019 08:24:32 +0000 (13:54 +0530)]
net: ti: cpsw: Move cpsw_phy_sel() to _probe()

cpsw_phy_sel() is a configuration step that should not be in
ofdata_to_platdata(). Add phy_sel_compat to the cpsw_platform_data
structure so that it is accessible in _probe. Then move the call of
cpsw_phy_sel() to _probe.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
5 years agonet: Add priv_pdata to eth_pdata
Faiz Abbas [Mon, 18 Mar 2019 08:24:31 +0000 (13:54 +0530)]
net: Add priv_pdata to eth_pdata

Add a priv member for eth_pdata for platform specific platform data.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
5 years agoarmv7R: K3: am654: Trigger panic on DDR init failures
Andreas Dannenberg [Mon, 11 Mar 2019 20:15:43 +0000 (15:15 -0500)]
armv7R: K3: am654: Trigger panic on DDR init failures

When initializing DDR from R5 SPL trigger U-Boot's panic facility
rather than simply returning from the board init function as there
is little point continuing code execution. Further, as panic implies
a board reset, so using it might potentially allow to recover from
this error in certain cases such as when the init failure was caused
by a temporary glitch of some sorts.

Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agoconfigs: am65x_evm_a53: Enable CONFIG_OF_BOARD_SETUP
Lokesh Vutla [Fri, 8 Mar 2019 06:17:36 +0000 (11:47 +0530)]
configs: am65x_evm_a53: Enable CONFIG_OF_BOARD_SETUP

Enable CONFIG_OF_BOARD_SETUP so that msmc sram dt nodes
are updated correctly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agoboard: ti: am65x: Enable fixing up msmc sram node
Lokesh Vutla [Fri, 8 Mar 2019 06:17:35 +0000 (11:47 +0530)]
board: ti: am65x: Enable fixing up msmc sram node

Create a ft_board_setup() api that gets called as part of
DT fixup before jumping to kernel. In this ft_board_setup()
call fdt_fixup_msmc_ram that update msmc sram node.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agoarm: k3: Add support for updating msmc dt node
Lokesh Vutla [Fri, 8 Mar 2019 06:17:34 +0000 (11:47 +0530)]
arm: k3: Add support for updating msmc dt node

Certain parts of msmc sram can be used by DMSC or can be
marked as L3 cache. Since the available size can vary, changing
DT every time the size varies might be painful. So, query this
information using TISCI cmd and fixup the DT for kernel.
Fixing up DT does the following:
- Create a sram node if not available
- update the reg property with available size
- update ranges property
- loop through available sub nodes and delete it if:
- mentioned size is out if available range
- subnode represents l3 cache or dmsc usage.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agoarm: k3: Add a wrapper to get tisci handle
Lokesh Vutla [Fri, 8 Mar 2019 06:17:33 +0000 (11:47 +0530)]
arm: k3: Add a wrapper to get tisci handle

Create a wrapper to get the ti sci handle.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agofirmware: Add support for querying msmc memory
Lokesh Vutla [Fri, 8 Mar 2019 06:17:32 +0000 (11:47 +0530)]
firmware: Add support for querying msmc memory

DMSC can use certain amount of msmc memory available in the
system. Also certain part of msmc memory can be marked as L3
cache using board config. But users might not know what size
is being used and the remaining available msmc memory. In order
to fix this TISCI protocol provides a messages that can query
the available msmc memory in the system. Add support for this
message.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agoconfigs: ti_omap5_common: Add NAND environment settings
Faiz Abbas [Wed, 27 Feb 2019 07:59:38 +0000 (13:29 +0530)]
configs: ti_omap5_common: Add NAND environment settings

Now that NAND is supported on DRA71x include various NAND environment
settings

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agoconfigs: dra71x-evm: Add Support for NAND
Faiz Abbas [Wed, 27 Feb 2019 07:59:37 +0000 (13:29 +0530)]
configs: dra71x-evm: Add Support for NAND

Add NAND support to dra71x-evm defconfig

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
5 years agoarm: dra7: Allow NAND to be enabled on DRA71x EVM.
Franklin S Cooper Jr [Wed, 27 Feb 2019 07:59:36 +0000 (13:29 +0530)]
arm: dra7: Allow NAND to be enabled on DRA71x EVM.

If SW 8 pins 0 and 1 indicate that NAND should be enabled then
the pins pinmux must be reconfigured for NAND mode.

Therefore, enable NAND by reconfiguring the pinmux.

Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
5 years agoboard: ti: dra71: Add pinmux settings for NAND on DRA71x EVM
Franklin S Cooper Jr [Wed, 27 Feb 2019 07:59:35 +0000 (13:29 +0530)]
board: ti: dra71: Add pinmux settings for NAND on DRA71x EVM

By default VOUT3 occupies the pins required for NAND. Therefore, create
a seperate entry that can be use to reconfigure these pins to work for
NAND.

On the EVM SWITCH 8 pins 0 and 1 will be used to determine if NAND is
enabled or not. For NAND to be selected pin 0 should be on and pin 1
should be off. Any other combination will assume NAND shouldn't be
enabled.

Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
5 years agoARM: davinci: da850evm: Enable SPL_OF_CONTROL without PLATDATA
Adam Ford [Tue, 26 Feb 2019 03:53:47 +0000 (21:53 -0600)]
ARM: davinci: da850evm: Enable SPL_OF_CONTROL without PLATDATA

With the memory mapping giving us some more avialable RAM, this
updates the da850-evm-u-boot.dtsi to include the serial port, SPI
and Flash nodes along with some dependent nodes in the SPL dtb.
This also removes the platform data initialization code for the
serial port and SPI Flash.

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agodavinci: da850evm/omapl138-lcdk: Move BSS to SDRAM because SRAM is full
Adam Ford [Tue, 26 Feb 2019 03:53:46 +0000 (21:53 -0600)]
davinci: da850evm/omapl138-lcdk: Move BSS to SDRAM because SRAM is full

In order to fully support SPL_OF_CONTROL, we need BSS to be a bit
larger. This patch relocates BSS to SDRAM instead of SRAM which
is similar to how ARMv7 boards (like OMAP2+) do it.

This means two new variables are required:
CONFIG_SPL_BSS_START_ADDR  set to DAVINCI_DDR_EMIF_DATA_BASE
CONFIG_SPL_BSS_MAX_SIZE is set to 0x1080000 which is 1 byte
before the location where U-Boot will load.

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agoam335x, guardian: Add support for the bosch guardian board
Sjoerd Simons [Mon, 25 Feb 2019 15:33:00 +0000 (15:33 +0000)]
am335x, guardian: Add support for the bosch guardian board

Add support for the Bosch Guardian board.

CPU  : AM335X-GP rev 2.1
Model: Bosch AM335x Guardian
I2C:   ready
DRAM:  256 MiB
NAND:  512 MiB
MMC:   OMAP SD/MMC: 0

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Felix Brack <fb@ltec.ch>
5 years agoenv: Don't check CONFIG_ENV_OFFSET_REDUND for SPL build
Martyn Welch [Mon, 25 Feb 2019 15:32:59 +0000 (15:32 +0000)]
env: Don't check CONFIG_ENV_OFFSET_REDUND for SPL build

When booting using an SPL on am335x, if we want to support booting with
the boot ROM loader via USB (which uses RNDIS, making bootp and tftp
calls) we need to enable gadget eth in the SPL to load the main U-Boot
image. To enable CONFIG_SPL_ETH_SUPPORT, we must enable
CONFIG_SPL_ENV_SUPPORT as the environment is used by the eth support, but
we don't actually need to have environment variables saved in the SPL
environment. We do however have environment variables saved in the main
U-Boot image and enable CONFIG_ENV_OFFSET_REDUND (we are storing in raw
NAND). In such instances, even with the build config enabling both
CONFIG_CMD_SAVEENV and CONFIG_CMD_NAND, these options aren't set when
building the SPL, but CONFIG_ENV_OFFSET_REDUND still is.

Don't check this configuration option for SPL builds to enable the above
configuration.

Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agoAdd support for the MT41K128M16JT125K memory modules
Sjoerd Simons [Mon, 25 Feb 2019 15:32:58 +0000 (15:32 +0000)]
Add support for the MT41K128M16JT125K memory modules

Add configuration for the MT41K128M16JT125K memory modules as used on the
Bosch Guardian device.

Based on a patch by:
    Govindaraji Sivanantham <Govindaraji.Sivanantham@in.bosch.com>

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
[checkpatch.pl cleanup by Martyn Welch]
Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
5 years agoam57xx_evm_defconfig: Enable configs to support QSPI boot
Vignesh R [Fri, 22 Feb 2019 05:31:52 +0000 (11:01 +0530)]
am57xx_evm_defconfig: Enable configs to support QSPI boot

AM57xx IDK EVMs can boot out of QSPI. Enable configs to support QSPI
boot. Also enable configs for updating QSPI boot images over DFU.

Tested on AM572x IDK EVM.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agoARM: dts: k2g-ice: add dt node for netcp
Murali Karicheri [Thu, 21 Feb 2019 17:02:07 +0000 (12:02 -0500)]
ARM: dts: k2g-ice: add dt node for netcp

This patch adds dt node for DP83867 phy used on K2G ICE board and
also enable netcp device nodes for the board.

EVM hardware spec recommends to add 0.25 nsec delay in the tx
direction and 2.25 nsec delay in the rx direction for internal
delay in the clock path to be on the safer side.

The board straps RX_DV/RX_CTRL pin of on board DP83867 phy in mode
1. Unfortunately, the phy data manual disallows this. Add
ti,dp83867-rxctrl-strap-quirk in the phy node to allow software to
enable workaround suggested for this incorrect strap setting. This
ensures proper operation of this PHY.

The dts bindings are kept in sync with that from 4.14.y linux
kernel. This required the pinmux device related bindings to be
commented out to allow for compilation.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agok2g: config enable ti phy dp83867 for k2g
Murali Karicheri [Thu, 21 Feb 2019 17:02:06 +0000 (12:02 -0500)]
k2g: config enable ti phy dp83867 for k2g

Enable ti phy dp83867 for k2g

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agoARM: dts: k2g-evm: remove unused phy-mode property from phy node
Murali Karicheri [Thu, 21 Feb 2019 17:02:05 +0000 (12:02 -0500)]
ARM: dts: k2g-evm: remove unused phy-mode property from phy node

This patch removes the unused phy-mode property from the phy dt node. On
K2G, currently link-interface determines if phy is used or not and is
already set to use rgmii. So this is not needed. Besides phy-mode should
be added to slave interface configuration of the cpsw driver, not in the
phy node.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agoARM: k2g: add a workaround to reset the phy
Murali Karicheri [Thu, 21 Feb 2019 17:02:04 +0000 (12:02 -0500)]
ARM: k2g: add a workaround to reset the phy

This patch adds a workaround to reset the phy one time during boot
using GPIO0 pin 10 to make sure, the Phy latches the configuration
from the input pins correctly.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: netcp: add support for phy with rgmii ids
Murali Karicheri [Thu, 21 Feb 2019 17:02:03 +0000 (12:02 -0500)]
net: netcp: add support for phy with rgmii ids

Enhance the netcp driver to support phys that can be configured
for internal delay (rgmii-id, rgmii-rxid, rgmii-txid)

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agoARM: k2g-gp-evm: update to rgmii pinmux configuration
Murali Karicheri [Thu, 21 Feb 2019 17:02:02 +0000 (12:02 -0500)]
ARM: k2g-gp-evm: update to rgmii pinmux configuration

This patch updates pinmux configuration for K2G GP EVM based on
data generated by the pinmux tool at
https://dev.ti.com/pinmux/app.html#/default

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agoARM: k2g-ice: Add pinmux support for rgmii interface
Murali Karicheri [Thu, 21 Feb 2019 17:02:01 +0000 (12:02 -0500)]
ARM: k2g-ice: Add pinmux support for rgmii interface

This add pinmux configuration for rgmii interface so that network
driver can be supported on K2G ICE boards. The pinmux configurations
for this are generated using the pinmux tool at
https://dev.ti.com/pinmux/app.html#/default

As this required some BUFFER_CLASS definitions, same is re-used
from the linux defnitions in include/dt-bindings/pinctrl/keystone.h

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agoconfigs: am65x_evm_a53: Enable DMA related configs
Grygorii Strashko [Tue, 5 Feb 2019 12:01:27 +0000 (17:31 +0530)]
configs: am65x_evm_a53: Enable DMA related configs

Enable TI K3 AM65x PSI-L, Ring Accelerator and UDMA drivers

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agoarm64: dts: ti: k3-am65: add mcu navss nodes
Grygorii Strashko [Tue, 5 Feb 2019 12:01:26 +0000 (17:31 +0530)]
arm64: dts: ti: k3-am65: add mcu navss nodes

Add DT node for MCU NAVSS its components to get DMA working on AM654
SoC.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agosoc: keystone: Merge into ti specific directory
Vignesh R [Tue, 5 Feb 2019 12:01:25 +0000 (17:31 +0530)]
soc: keystone: Merge into ti specific directory

Merge drivers/soc/keystone/ into drivers/soc/ti/
and convert CONFIG_TI_KEYSTONE_SERDES into Kconfig.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agodma: ti: add driver to K3 UDMA
Vignesh R [Tue, 5 Feb 2019 12:01:24 +0000 (17:31 +0530)]
dma: ti: add driver to K3 UDMA

The UDMA-P is intended to perform similar (but significantly upgraded) functions
as the packet-oriented DMA used on previous SoC devices. The UDMA-P module
supports the transmission and reception of various packet types.
The UDMA-P also supports acting as both a UTC and UDMA-C for its internal
channels. Channels in the UDMA-P can be configured to be either Packet-Based or
Third-Party channels on a channel by channel basis.

The initial driver supports:
- MEM_TO_MEM (TR mode)
- DEV_TO_MEM (Packet mode)
- MEM_TO_DEV (Packet mode)

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Vignesh R <vigneshr@ti.com>
5 years agosoc: ti: k3: add CPPI5 description and helpers
Grygorii Strashko [Tue, 5 Feb 2019 12:01:23 +0000 (17:31 +0530)]
soc: ti: k3: add CPPI5 description and helpers

Add TI Communications Port Programming Interface (CPPI) 5
interface description and helpers

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agosoc: ti: k3: add navss ringacc driver
Grygorii Strashko [Tue, 5 Feb 2019 12:01:22 +0000 (17:31 +0530)]
soc: ti: k3: add navss ringacc driver

The Ring Accelerator (RINGACC or RA) provides hardware acceleration to
enable straightforward passing of work between a producer and a consumer.
There is one RINGACC module per NAVSS on TI AM65x SoCs.

The RINGACC converts constant-address read and write accesses to equivalent
read or write accesses to a circular data structure in memory. The RINGACC
eliminates the need for each DMA controller which needs to access ring
elements from having to know the current state of the ring (base address,
current offset). The DMA controller performs a read or write access to a
specific address range (which maps to the source interface on the RINGACC)
and the RINGACC replaces the address for the transaction with a new address
which corresponds to the head or tail element of the ring (head for reads,
tail for writes). Since the RINGACC maintains the state, multiple DMA
controllers or channels are allowed to coherently share the same rings as
applicable. The RINGACC is able to place data which is destined towards
software into cached memory directly.

Supported ring modes:
 - Ring Mode
 - Messaging Mode
 - Credentials Mode
 - Queue Manager Mode

TI-SCI integration:

Texas Instrument's System Control Interface (TI-SCI) Message Protocol now
has control over Ringacc module resources management (RM) and Rings
configuration.

The Ringacc driver manages Rings allocation by itself now and requests
TI-SCI firmware to allocate and configure specific Rings only. It's done
this way because, Linux driver implements two stage Rings allocation and
configuration (allocate ring and configure ring) while TI-SCI Message
Protocol supports only one combined operation (allocate+configure).

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Vignesh R <vigneshr@ti.com>
5 years agofirmware: ti_sci: Add support for NAVSS resource management
Grygorii Strashko [Tue, 5 Feb 2019 12:01:21 +0000 (17:31 +0530)]
firmware: ti_sci: Add support for NAVSS resource management

Texas Instruments' System Control Interface (TI-SCI) Message Protocol
abstracts management of NAVSS resources, like PSI-L pairing and
unpairing, UDMAP tx/rx/flow configuration and Rings.

This patch adds support for requesting and configuring such resources
from TI-SCI firmware.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Vignesh R <vigneshr@ti.com>
5 years agoMerge branch 'master' of git://git.denx.de/u-boot-usb
Tom Rini [Thu, 11 Apr 2019 18:29:37 +0000 (14:29 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-usb

5 years agoMerge branch 'master' of git://git.denx.de/u-boot-sh
Tom Rini [Thu, 11 Apr 2019 18:29:22 +0000 (14:29 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-sh

- Various rmobile fixes

5 years agoMerge branch '2019-04-09-master-imports-fs'
Tom Rini [Wed, 10 Apr 2019 12:18:18 +0000 (08:18 -0400)]
Merge branch '2019-04-09-master-imports-fs'

- test.py tests for mmc
- ext4 symlink support and other fixes
- ext4 block group descriptor sizing

5 years agotest.py: Disable fsck for FAT tests for now
Tom Rini [Tue, 9 Apr 2019 20:08:52 +0000 (16:08 -0400)]
test.py: Disable fsck for FAT tests for now

Currently enabling fsck on FAT16/FAT32 exposes that we have problems
with:
TestFsBasic.test_fs13[fat16]
TestFsBasic.test_fs11[fat32]
TestFsBasic.test_fs12[fat32]
TestFsBasic.test_fs13[fat32]
TestFsExt.test_fs_ext1[fat32]
TestFsExt.test_fs_ext2[fat32]
TestFsExt.test_fs_ext3[fat32]
TestFsExt.test_fs_ext4[fat32]
TestFsExt.test_fs_ext5[fat32]
TestFsExt.test_fs_ext6[fat32]
TestFsExt.test_fs_ext7[fat32]
TestFsExt.test_fs_ext8[fat32]
TestFsExt.test_fs_ext9[fat32]
TestMkdir.test_mkdir6[fat16]
TestMkdir.test_mkdir1[fat32]
TestMkdir.test_mkdir2[fat32]
TestMkdir.test_mkdir3[fat32]
TestMkdir.test_mkdir4[fat32]
TestMkdir.test_mkdir5[fat32]
TestMkdir.test_mkdir6[fat32]
TestUnlink.test_unlink1[fat16]
TestUnlink.test_unlink2[fat16]
TestUnlink.test_unlink3[fat16]
TestUnlink.test_unlink4[fat16]
TestUnlink.test_unlink5[fat16]
TestUnlink.test_unlink6[fat16]
TestUnlink.test_unlink7[fat16]
TestUnlink.test_unlink1[fat32]
TestUnlink.test_unlink2[fat32]
TestUnlink.test_unlink3[fat32]
TestUnlink.test_unlink4[fat32]
TestUnlink.test_unlink5[fat32]
TestUnlink.test_unlink6[fat32]
TestUnlink.test_unlink7[fat32]

This is because we don't update the "information sector" on FAT32.
While in the future we should resolve this problem and include that
feature, we should enable fsck for ext4 to ensure that things remain in
good shape there.

Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agoFix ext4 block group descriptor sizing
Benjamin Lim [Fri, 29 Mar 2019 11:29:45 +0000 (07:29 -0400)]
Fix ext4 block group descriptor sizing

Ext4 allows for arbitrarily sized block group descriptors when 64-bit
addressing is enabled, which was previously not properly supported. This
patch dynamically allocates a chunk of memory of the correct size.

Signed-off-by: Benjamin Lim <jarsp.ctf@gmail.com>
5 years agotest/py: mmc: Add 'mmc read' performance check
Marek Vasut [Wed, 13 Mar 2019 16:49:29 +0000 (17:49 +0100)]
test/py: mmc: Add 'mmc read' performance check

Add option to the mmc rd test to check the duration of the
execution of the mmc read command. This allows intercepting
read performance regressions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agotest/py: mmc: Add 'mmc info' test
Marek Vasut [Wed, 13 Mar 2019 16:49:28 +0000 (17:49 +0100)]
test/py: mmc: Add 'mmc info' test

Add test for 'mmc info' subcommand. This tests whether the card
information is obtained correctly and verifies the device, bus
speed, bus mode and bus width.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agotest/py: mmc: Add 'mmc rescan' test
Marek Vasut [Wed, 13 Mar 2019 16:49:27 +0000 (17:49 +0100)]
test/py: mmc: Add 'mmc rescan' test

Add test for 'mmc rescan' subcommand. This tests whether the
system can switch to a specific card and then rescan the card.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agotest/py: mmc: Add 'mmc dev' test
Marek Vasut [Wed, 13 Mar 2019 16:49:26 +0000 (17:49 +0100)]
test/py: mmc: Add 'mmc dev' test

Add separate test for 'mmc dev' subcommand. This tests whether
the system can switch to a specific card.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agotest/py: mmc: Factor out device selection
Marek Vasut [Wed, 13 Mar 2019 16:49:25 +0000 (17:49 +0100)]
test/py: mmc: Factor out device selection

Factor out the 'mmc dev' call so it can be recycled by other tests.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agofs: fat: fix reading non-cluster-aligned root directory
Anssi Hannula [Wed, 27 Feb 2019 10:55:57 +0000 (12:55 +0200)]
fs: fat: fix reading non-cluster-aligned root directory

A FAT12/FAT16 root directory location is specified by a sector offset and
it might not start at a cluster boundary. It also resides before the
data area (before cluster 2).

However, the current code assumes that the root directory is located at
a beginning of a cluster, causing no files to be found if that is not
the case.

Since the FAT12/FAT16 root directory is located before the data area
and is not aligned to clusters, using unsigned cluster numbers to refer
to the root directory does not work well (the "cluster number" may be
negative, and even allowing it be signed would not make it properly
aligned).

Modify the code to not use the normal cluster numbering when referring to
the root directory of FAT12/FAT16 and instead use a cluster-sized
offsets counted from the root directory start sector.

This is a relatively common case as at least the filesystem formatter on
Win7 seems to create such filesystems by default on 2GB USB sticks when
"FAT" is selected (cluster size 64 sectors, rootdir size 32 sectors,
rootdir starts at half a cluster before cluster 2).

dosfstools mkfs.vfat does not seem to create affected filesystems.

Signed-off-by: Anssi Hannula <anssi.hannula@bitwise.fi>
Reviewed-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Tested-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
5 years agofs: ext4: Problem with ext4load and sparse files
Gero Schumacher [Tue, 26 Feb 2019 15:45:22 +0000 (15:45 +0000)]
fs: ext4: Problem with ext4load and sparse files

Hi,

when I try to load a sparse file via ext4load, I am getting the error message
'invalid extent'

After a deeper look in the code, it seems to be an issue in the function ext4fs_get_extent_block in fs/ext4/ext4_common.c:

The file starts with 1k of zeros. The blocksize is 1024. So the first extend block contains the following information:

eh_entries: 1
eh_depth: 1
ei_block 1

When the upper layer (ext4fs_read_file) asks for fileblock 0, we are running in the 'invalid extent' error message.
For me it seems, that the code is not prepared for handling a sparse block at the beginning of the file. The following change, solved my problem:

I am really not an expert in ext4 filesystems. Can somebody please have a look at this issue and give me a feedback, if I am totally wrong or not?

5 years agotest: fs: Added tests for symlinks
Jean-Jacques Hiblot [Wed, 13 Feb 2019 11:15:27 +0000 (12:15 +0100)]
test: fs: Added tests for symlinks

Test cases are:
1) basic link creation, verify it can be followed
2) chained links, verify it can be followed
3) replace exiting file a with a link, and a link with a link. verify it
   can be followed
4) create a broken link, verify it can't be followed

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agofs: Add a new command to create symbolic links
Jean-Jacques Hiblot [Wed, 13 Feb 2019 11:15:26 +0000 (12:15 +0100)]
fs: Add a new command to create symbolic links

The command line is:
ln <interface> <dev[:part]> target linkname

Currently symbolic links are supported only in ext4 and only if the option
CMD_EXT4_WRITE is enabled.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agofs: ext4: Add support for the creation of symbolic links
Jean-Jacques Hiblot [Wed, 13 Feb 2019 11:15:25 +0000 (12:15 +0100)]
fs: ext4: Add support for the creation of symbolic links

Re-use the functions used to write/create a file, to support creation of a
symbolic link.
The difference with a regular file are small:
- The inode mode is flagged with S_IFLNK instead of S_IFREG
- The ext2_dirent's filetype is FILETYPE_SYMLINK instead of FILETYPE_REG
- Instead of storing the content of a file in allocated blocks, the path
to the target is stored. And if the target's path is short enough, no block
is allocated and the target's path is stored in ext2_inode.b.symlink

As with regulars files, if a file/symlink with the same name exits, it is
unlinked first and then re-created.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Fix ext4 env code]
Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agofs: ext4: constify the buffer passed to write functions
Jean-Jacques Hiblot [Wed, 13 Feb 2019 11:15:24 +0000 (12:15 +0100)]
fs: ext4: constify the buffer passed to write functions

There is no need to modify the buffer passed to ext4fs_write_file().
The memset() call is not required here and was likely copied from the
equivalent part of the ext4fs_read_file() function where we do need it.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agotest: fs: Add filesystem integrity checks
Jean-Jacques Hiblot [Wed, 13 Feb 2019 11:15:23 +0000 (12:15 +0100)]
test: fs: Add filesystem integrity checks

We need to make sure that file writes,file creation, etc. are properly
performed and do not corrupt the filesystem.
To help with this, introduce the assert_fs_integrity() function that
executes the appropriate fsck tool. It should be called at the end of any
test that modify the content/organization of the filesystem.
Currently only supports FATs and EXT4.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agotest: fs: disable the metadata checksums on ext4 filesystems
Jean-Jacques Hiblot [Wed, 13 Feb 2019 11:15:22 +0000 (12:15 +0100)]
test: fs: disable the metadata checksums on ext4 filesystems

If the metadata checksums are enabled, all write operations will fail.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agofs: ext4: cache extent data
Stephen Warren [Wed, 30 Jan 2019 19:58:05 +0000 (12:58 -0700)]
fs: ext4: cache extent data

When a file contains extents, U-Boot currently reads extent-related data
for each block in the file, even if that data is located in the same
block each time. This significantly slows down loading of files that use
extents. Implement a very dumb cache to prevent repeatedly reading the
same block. Files with extents now load as fast as files without.

Note: There are many cases where read_allocated_block() is called. This
patch only addresses one of those places; all others still read redundant
data in any case they did before. This is a minimal patch to fix the
load command; other cases aren't fixed.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
5 years agoARM: rmobile: rcar-common: Zap arch_preboot_os()
Eugeniu Rosca [Tue, 9 Apr 2019 17:11:09 +0000 (19:11 +0200)]
ARM: rmobile: rcar-common: Zap arch_preboot_os()

v2018.01 commit e23eb942ad103f ("ARM: rmobile: Stop using
rcar-common/common.c on Gen3") removed
board/renesas/rcar-common/common.c from the build chain with the
reasoning that calling arch_preboot_os() is no longer needed.

However, it left the arch_preboot_os() in place. Get rid of it.
This is done in preparation of resurrecting rcar-common/common.c.

NOTE: The three removed header includes (io.h, sys_proto.h, rcar-mstp.h)
are in direct relationship with the dropped arch_preboot_os() hook. The
other headers (common.h, rmobile.h) are going to be needed by pretty
much anything that is going to appear in the rcar common code. So, keep
the two in place.

Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
5 years agoARM: dts: rmobile: Enable USB on E2 Alt
Marek Vasut [Sat, 30 Mar 2019 06:58:43 +0000 (07:58 +0100)]
ARM: dts: rmobile: Enable USB on E2 Alt

The E2 Alt board has two USB ports, add missing DT nodes to make the
USB available.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agoARM: rmobile: alt: Increase USB power-good delay
Marek Vasut [Sat, 30 Mar 2019 07:04:29 +0000 (08:04 +0100)]
ARM: rmobile: alt: Increase USB power-good delay

Increase the USB power good delay on Alt, this is required with
certain USB sticks, otherwise they might not be detected.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agonet: sh_eth: Initialize PHY in probe() once
Marek Vasut [Sat, 30 Mar 2019 06:22:09 +0000 (07:22 +0100)]
net: sh_eth: Initialize PHY in probe() once

Reset and initialize the PHY once in the probe() function rather than
doing it over and over again is start() function. This requires us to
keep the clock enabled while the driver is in use. This significantly
reduces the time between transfers as the PHY doesn't have to restart
autonegotiation between transfers, which takes forever.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
5 years agoARM: dts: rmobile: Synchronize Gen3 DTs with Linux 5.0
Marek Vasut [Mon, 4 Mar 2019 21:53:28 +0000 (22:53 +0100)]
ARM: dts: rmobile: Synchronize Gen3 DTs with Linux 5.0

Synchronize R-Car Gen3 device trees with Linux 5.0,
commit 1c163f4c7b3f621efff9b28a47abb36f7378d783 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agoARM: dts: rmobile: Synchronize Gen2 DTs with Linux 5.0
Marek Vasut [Mon, 4 Mar 2019 21:50:54 +0000 (22:50 +0100)]
ARM: dts: rmobile: Synchronize Gen2 DTs with Linux 5.0

Synchronize R-Car Gen2 device trees with Linux 5.0,
commit 1c163f4c7b3f621efff9b28a47abb36f7378d783 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agopinctrl: renesas: Synchronize Gen3 tables with Linux 5.0
Marek Vasut [Mon, 4 Mar 2019 21:39:51 +0000 (22:39 +0100)]
pinctrl: renesas: Synchronize Gen3 tables with Linux 5.0

Synchronize R-Car Gen3 pin control tables with Linux 5.0,
commit 1c163f4c7b3f621efff9b28a47abb36f7378d783 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agopinctrl: renesas: Synchronize Gen2 tables with Linux 5.0
Marek Vasut [Mon, 4 Mar 2019 21:26:28 +0000 (22:26 +0100)]
pinctrl: renesas: Synchronize Gen2 tables with Linux 5.0

Synchronize R-Car Gen2 pin control tables with Linux 5.0,
commit 1c163f4c7b3f621efff9b28a47abb36f7378d783 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agopinctrl: renesas: Add TDSEL fixup for H2/E2 ES1.0 SoCs
Marek Vasut [Mon, 4 Mar 2019 21:29:30 +0000 (22:29 +0100)]
pinctrl: renesas: Add TDSEL fixup for H2/E2 ES1.0 SoCs

Linux 5.0, commit 1c163f4c7b3f621efff9b28a47abb36f7378d783,
has a TDSEL fix for R8A7790 H2 and R8A7794 E2 SoCs, implement
similar fix for U-Boot. The difference here is that the SoC
ES matching has to be implemented manually.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agoclk: renesas: Synchronize Gen3 tables with Linux 5.0
Marek Vasut [Mon, 4 Mar 2019 20:38:10 +0000 (21:38 +0100)]
clk: renesas: Synchronize Gen3 tables with Linux 5.0

Synchronize R-Car Gen3 clock tables with Linux 5.0,
commit 1c163f4c7b3f621efff9b28a47abb36f7378d783 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agoclk: renesas: Synchronize Gen2 tables with Linux 5.0
Marek Vasut [Mon, 4 Mar 2019 20:23:25 +0000 (21:23 +0100)]
clk: renesas: Synchronize Gen2 tables with Linux 5.0

Synchronize R-Car Gen2 clock tables with Linux 5.0,
commit 1c163f4c7b3f621efff9b28a47abb36f7378d783 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agoARM: rmobile: Add R8A77965 M3NULCB support
Marek Vasut [Mon, 4 Mar 2019 11:34:50 +0000 (12:34 +0100)]
ARM: rmobile: Add R8A77965 M3NULCB support

Add defconfig and board specific adjustments for the R8A77965 M3N ULCB.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agoARM: dts: rmobile: Import R8A77965 M3NULCB DTs
Marek Vasut [Mon, 4 Mar 2019 11:28:31 +0000 (12:28 +0100)]
ARM: dts: rmobile: Import R8A77965 M3NULCB DTs

Import R8A77965 M3N ULCB device trees from Linux 5.0 ,
commit 1c163f4c7b3f621efff9b28a47abb36f7378d783 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agopinctrl: renesas: Add R8A77965 pin control tables
Marek Vasut [Mon, 4 Mar 2019 00:32:44 +0000 (01:32 +0100)]
pinctrl: renesas: Add R8A77965 pin control tables

Add pin control tables for R8A77965 from Linux 5.0 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agoclk: renesas: Add R8A77965 clock tables
Marek Vasut [Mon, 4 Mar 2019 12:36:13 +0000 (13:36 +0100)]
clk: renesas: Add R8A77965 clock tables

Add clock tables for R8A77965 from Linux 5.0 , except for the
crit, R and Z clock, which are neither used nor supported by
the U-Boot clock framework yet.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agoARM: rmobile: Add dedicated R8A77965 SoC support
Marek Vasut [Mon, 4 Mar 2019 00:32:44 +0000 (01:32 +0100)]
ARM: rmobile: Add dedicated R8A77965 SoC support

Add dedicated entry for R8A77965 M3N SoC.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agoARM: rmobile: Enable multi-DTB fit LZO compression
Marek Vasut [Wed, 13 Mar 2019 20:09:49 +0000 (21:09 +0100)]
ARM: rmobile: Enable multi-DTB fit LZO compression

Enable LZO compression of the multi-DTB fitImages, since the U-Boot
with multiple DTs enabled is becoming quite large and the DTs can
be well compressed. The LZO compression saves almost 200 kiB on the
Salvator-X(S) and ULCB targets.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agolib: fdt: Allow LZO and GZIP DT compression in U-Boot
Marek Vasut [Fri, 8 Mar 2019 15:06:55 +0000 (16:06 +0100)]
lib: fdt: Allow LZO and GZIP DT compression in U-Boot

Add required Kconfig symbols, Makefile bits and macro fixes in a
few places to support LZO and DT compression in U-Boot. This can
save a lot of space with multi-DTB fitImages.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
5 years agolib: fdt: Allow enabling both LZO and GZIP DT compression
Marek Vasut [Wed, 13 Mar 2019 20:11:22 +0000 (21:11 +0100)]
lib: fdt: Allow enabling both LZO and GZIP DT compression

Allow enabling both LZO and GZIP DT compression in SPL and fix a
bug where if the GZIP decompression failed, the LZO decompression
would not even be attempted.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
5 years agoARM: renesas: Save boot parameters passed in by ATF
Marek Vasut [Thu, 18 Oct 2018 16:38:05 +0000 (18:38 +0200)]
ARM: renesas: Save boot parameters passed in by ATF

The ATF can pass additional information via the first four registers,
x0...x3. The R-Car Gen3 with mainline ATF, register x1 contains pointer
to a device tree with platform information. Save these registers for
future use.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5 years agolib: fdt: Split fdtdec_setup_memory_banksize()
Marek Vasut [Tue, 5 Mar 2019 03:25:55 +0000 (04:25 +0100)]
lib: fdt: Split fdtdec_setup_memory_banksize()

Split fdtdec_setup_memory_banksize() into fdtdec_setup_memory_banksize_fdt(),
which allows the caller to pass custom blob into the function and the
original fdtdec_setup_memory_banksize(), which uses the gd->fdt_blob. This
is useful when configuring the DRAM properties from a FDT blob fragment
passed in by the firmware.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agolib: fdt: Split fdtdec_setup_mem_size_base()
Marek Vasut [Tue, 5 Mar 2019 03:25:54 +0000 (04:25 +0100)]
lib: fdt: Split fdtdec_setup_mem_size_base()

Split fdtdec_setup_mem_size_base() into fdtdec_setup_mem_size_base_fdt(),
which allows the caller to pass custom blob into the function and the
original fdtdec_setup_mem_size_base(), which uses the gd->fdt_blob. This
is useful when configuring the DRAM properties from a FDT blob fragment
passed in by the firmware.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agospl: ymodem: Move GZ handling out of YModem session
Marek Vasut [Tue, 12 Mar 2019 03:00:09 +0000 (04:00 +0100)]
spl: ymodem: Move GZ handling out of YModem session

In case the gunzip() call fails, it will print an error message.
If that happens within the YModem session, the error message will
not be displayed and would be useless. Move the gunzip() call out
of the YModem session to make those possible error messages visible.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Tom Rini <trini@konsulko.com>