oweals/u-boot.git
5 years agosyscon: update syscon_regmap_lookup_by_phandle
Patrick Delaunay [Thu, 7 Mar 2019 08:57:13 +0000 (09:57 +0100)]
syscon: update syscon_regmap_lookup_by_phandle

Change the function syscon_regmap_lookup_by_phandle()
introduced by commit 6c3af1f24e4b ("syscon: dm: Add a
new method to get a regmap from DTS") to have
Linux-compatible syscon API.

Same modification than commit e151a1c288bd ("syscon: add
Linux-compatible syscon API") solves issue when the node
identified by the phandle has several compatibles and is
already bound to a dedicated driver.

See Linux commit bdb0066df96e ("mfd: syscon: Decouple syscon
interface from platform devices").

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agofdt: Remove duplicate code
Thierry Reding [Fri, 1 Mar 2019 18:20:48 +0000 (19:20 +0100)]
fdt: Remove duplicate code

Commit 6d29cc7dcf2d ("fdt: Fixup only valid memory banks") ended up
being merged twice, first as:

commit 6d29cc7dcf2d35966aa0b6119fd1cbca0d21d5e6
Author:     Thierry Reding <treding@nvidia.com>
AuthorDate: Tue Jan 30 11:34:17 2018 +0100
Commit:     Simon Glass <sjg@chromium.org>
CommitDate: Sun Feb 18 12:53:38 2018 -0700

    fdt: Fixup only valid memory banks

    Memory banks with address 0 and size 0 are empty and should not be
    passed to the OS via device tree.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
and later again, though this time it was v2:

commit ed5af03f9bb8905f1e94d68ab49f22d7f061d75f
Author:     Thierry Reding <treding@nvidia.com>
AuthorDate: Thu Feb 15 19:05:59 2018 +0100
Commit:     Tom Rini <trini@konsulko.com>
CommitDate: Fri Feb 23 10:40:50 2018 -0500

    fdt: Fixup only valid memory banks

    Memory banks with address 0 and size 0 are empty and should not be
    passed to the OS via device tree.

Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
The second version was slightly different, so the main hunk of the patch
was applied twice. This isn't harmful because the code is idempotent,
but it's wasteful to run the same code twice.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agodm: pinctrl: Skip gpio-controller node in pinconfig_post_bind()
Patrick Delaunay [Mon, 25 Feb 2019 12:39:56 +0000 (13:39 +0100)]
dm: pinctrl: Skip gpio-controller node in pinconfig_post_bind()

Some binding define child node gpio-controller without compatible property.
This patch avoid to bind the pinconfig uclass to these node.

For example, the binding for st,stm32-pinctrl
(./device-tree-bindings/pinctrl/st,stm32-pinctrl.txt) defines the GPIO
controller/bank node as sub-node of pincontrol (st,stm32f429-pinctrl)
but without compatible (as it is not mandatory).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agodm: pinctrl: Avoid race condition on probe for UCLASS_PINCTRL
Patrice Chotard [Mon, 25 Feb 2019 12:39:55 +0000 (13:39 +0100)]
dm: pinctrl: Avoid race condition on probe for UCLASS_PINCTRL

In case of system with several pin-controller device, probe the first
UCLASS_PINCTRL by seq number (defined by alias) to avoid race condition
with I2C PINCONTROL driver for GPIO expander (GPIO expander need I2C bus,
I2C driver need PINCONFIG).

Signed-off-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agodm: Also remove interrupts property from SPL DT
Michal Simek [Fri, 22 Feb 2019 09:50:23 +0000 (10:50 +0100)]
dm: Also remove interrupts property from SPL DT

interrupt-parent property is removed already that's why there is no
reason to keep interrupts property if parent doesn't exist.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agodm: pinctrl: Remove obsolete function pinctrl_decode_pin_config_dm().
Christoph Muellner [Tue, 12 Feb 2019 17:28:53 +0000 (18:28 +0100)]
dm: pinctrl: Remove obsolete function pinctrl_decode_pin_config_dm().

This reverts commit 5ff776889212c080e3d1a33634ac904405ed6845.

As noted in the comment, the function pinctrl_decode_pin_config_dm()
only served as a temporary solution.

Since the function has no users anymore, we can remove it again.

Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agodm: remove pre reloc properties in SPL and TPL device tree
Patrick Delaunay [Mon, 11 Feb 2019 11:49:57 +0000 (12:49 +0100)]
dm: remove pre reloc properties in SPL and TPL device tree

We can remove the pre reloc property in SPL and TPL device-tree:
- u-boot,dm-pre-reloc
- u-boot,dm-spl
- u-boot,dm-tpl
As only the needed node are kept by fdtgrep (1st pass).

The associated function (XXX_pre_reloc) are simple for SPL/TPL:
return always true.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agocros: Expand the Chromium OS documentation
Simon Glass [Thu, 31 Jan 2019 03:51:20 +0000 (20:51 -0700)]
cros: Expand the Chromium OS documentation

The current documentation only covers how to chain-load U-Boot on a
Chromebook. Add more information about the other ways to use U-Boot on
Chromebooks.

In particular it is again possible to build it with Chromium OS
verified boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
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 agomisc: i2c_eeprom: add eeprom write support
Baruch Siach [Sun, 7 Apr 2019 09:38:49 +0000 (12:38 +0300)]
misc: i2c_eeprom: add eeprom write support

Write up to page size in each i2c transfer.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agomisc: i2c_eeprom: support DT pagesize property
Baruch Siach [Sun, 7 Apr 2019 09:38:48 +0000 (12:38 +0300)]
misc: i2c_eeprom: support DT pagesize property

Read the page size from DT when available.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agoi2c: muxes: pca954x: support PCA9543 I2C switch
Luca Ceresoli [Tue, 9 Apr 2019 06:57:43 +0000 (08:57 +0200)]
i2c: muxes: pca954x: support PCA9543 I2C switch

The PCA9543 is a 2-channel I2C switch.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Heiko Schocher<hs@denx.de>
5 years agoi2c: muxes: pca954x: clarify enable field
Luca Ceresoli [Tue, 9 Apr 2019 06:57:42 +0000 (08:57 +0200)]
i2c: muxes: pca954x: clarify enable field

The chip_desc.enable field is used only for muxes, not for switches.
Document it and remove the unused values.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Heiko Schocher<hs@denx.de>
5 years agoi2c: muxes: pca954x: update list of supported devices
Luca Ceresoli [Tue, 9 Apr 2019 06:57:41 +0000 (08:57 +0200)]
i2c: muxes: pca954x: update list of supported devices

The Kconfig help has not been updated while adding PCA9547 and PCA9646.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Heiko Schocher<hs@denx.de>
5 years agoDTS: imx53: Add imx53-kp-u-boot.dtsi file with u-boot specific property
Lukasz Majewski [Thu, 4 Apr 2019 10:35:35 +0000 (12:35 +0200)]
DTS: imx53: Add imx53-kp-u-boot.dtsi file with u-boot specific property

This file adds the "u-boot,i2c-transaction-bytes" to mc34708 PMIC.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agoDM: I2C: Introduce 'u-boot, i2c-transaction-bytes' property
Lukasz Majewski [Thu, 4 Apr 2019 10:35:34 +0000 (12:35 +0200)]
DM: I2C: Introduce 'u-boot, i2c-transaction-bytes' property

The 'u-boot,i2c-transaction-bytes' device tree property provides
information regarding number of bytes transferred by a device in a
single transaction.

This change is necessary to avoid hanging devices after soft reset.
One notable example is communication with MC34708 device:

1. Reset when communicating with MC34708 via I2C.

2. The u-boot (after reboot -f) tries to setup the I2C and then calls
force_idle_bus. In the same time MC34708 still has some data to be sent
(as it transfers data in 24 bits chunks).

3. The force_idle_bus() is not able to make the bus idle as 8 SCL
clocks may be not enough to have the full transmission.

4. We end up with I2C inconsistency with MC34708.

This PMIC device requires 24+ SCL cycles to make finish any pending I2C
transmission.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
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 agosunxi: Allow booting from 128KB SD/eMMC offset
Andre Przywara [Sun, 16 Dec 2018 02:04:58 +0000 (02:04 +0000)]
sunxi: Allow booting from 128KB SD/eMMC offset

On modern Allwinner SoCs (tested: H2+, A64, H5, H6) the BootROM can
actually load the SPL also from sector 256 (128KB) of an SD card or eMMC
chip. For more details, see [1].
In this case the boot source indicator (written at offset 0x28 of SRAM A1)
has bit 4 set, so it's 0x10 for SD card and 0x12 for eMMC.

Add those new values to the existing boot source check to allow booting
the SPL from those "high" disk offsets as well. For this to work, the
value of CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR needs to be adjusted,
for instance to 0x140 (right after the high SPL). Doing this dynamically
sounds desirable, but looks nasty to implement.

[1] https://groups.google.com/forum/#!topic/linux-sunxi/MaiijyaAFjk

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
5 years agoarm: sunxi: Enable DRAM ODT by default on H3/H5
Paul Kocialkowski [Thu, 14 Mar 2019 10:36:16 +0000 (11:36 +0100)]
arm: sunxi: Enable DRAM ODT by default on H3/H5

Most of the boards we support with H3/H5 enable DRAM on-die termination,
which is consistent with the high DRAM clocks that are used.

Make it the default (like it's done for other similar platforms) instead
of defining it in each defconfig.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
5 years agoarm: sunxi: Set the default DRAM ZQ value to 3881979 on H3/H5
Paul Kocialkowski [Thu, 14 Mar 2019 10:36:15 +0000 (11:36 +0100)]
arm: sunxi: Set the default DRAM ZQ value to 3881979 on H3/H5

Most H3/H5 boards we support have the DRAM ZQ value set to 3881979,
which is also consistent with the default set for the R40.

Make this value the default on H3/H5 instead of 123.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
5 years agoarm: sunxi: Allow per-platform DRAM ZQ configuration on sun8i
Paul Kocialkowski [Thu, 14 Mar 2019 10:36:14 +0000 (11:36 +0100)]
arm: sunxi: Allow per-platform DRAM ZQ configuration on sun8i

A few sun8i platforms define specific default DRAM ZQ values, but they
are not taken in account because of MACH_SUN8I being used for the 123
default first.

Replace MACH_SUN8I with the list of platforms that don't have specific
DRAM ZQ values, to avoid overwriting the default for those that do.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Acked-by: Jagan Teki <jagan@openedev.com>
5 years agosunxi: dram_sun8i: Fix A33 memory initialization
Michael Trimarchi [Mon, 18 Mar 2019 09:47:45 +0000 (15:17 +0530)]
sunxi: dram_sun8i: Fix A33 memory initialization

While the exact problem is not known, based on discussion between
Philipp Tomsich and André Przywara it is guessed that exit self-refresh
timing is not set with correct value. There may be implicit enter or
exit Self-Refresh anywhere as part of some training phase.

In ZynqMP register guide [1], which is close to the various
Allwinner DRAM controllers, tXSDLL is bits [14:8], while the non-DLL
tXS is bits [6:0]: Self refresh exit delay. So it could be safely
increased and it only affects the time after the self-refresh “exit”,
which happens only after (re-)initialisation.

There was no document for cpu in question so based on oscilloscope
readings [2][3] and observed result by comparing allwinner architecture.
So set it same as  Allwinner H5 silicon.

Before this patch, failure rate of was 7%.

This was tested on A33 allwinner cpu, dual rank connection connected
with two MT41K512M16HA-125:A memory model. Memory is configured as DDR3
1.5V

And also this is tested in A33-OLinuXino dev board.

[1] https://www.xilinx.com/html_docs/registers/ug1087/ddrc___dramtmg8.html
[2] https://ibb.co/R70zmyS
[3] https://ibb.co/HVVCGQ8

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Shyam Saini <shyam.saini@amarulasolutions.com>
Acked-by: Jagan Teki <jagan@openedev.com>
5 years agosunxi: Pine64-LTS: (Re-)enable USB 1.x support
Andre Przywara [Sat, 9 Mar 2019 01:03:31 +0000 (01:03 +0000)]
sunxi: Pine64-LTS: (Re-)enable USB 1.x support

The Pine64-LTS defconfig is missing the CONFIG_USB_OHCI_HCD symbol, as
this was added during the same time as this defconfig was merged.
USB 1.x devices like USB keyboards don't work due to this.

Add the symbol to the defconfig as all the other boards do.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
5 years agosun50i: a64: Add Oceanic 5205 5inMFD initial support
Jagan Teki [Wed, 6 Mar 2019 16:54:48 +0000 (22:24 +0530)]
sun50i: a64: Add Oceanic 5205 5inMFD initial support

Oceanic 5205 5inMFD is a 5 inch Multi function display baseboard
designed to mount SoPine SOM.

Key features:
- Allwinner A64 Cortex-A53
- Mali-400MP2 GPU
- AXP803 PMIC
- 2GB DDR3 RAM
- SD Slot
- SPI-NOR flash
- EMAC, RTL8211E
- MCP2515 CAN
- 4-lane, MIPI-DSI panel
- Goodix 911 CTP
- USB Host
- 12V DC power supply

Linux commit details about the sun50i-a64-oceanic-5205-5inmfd.dts sync:
"arm64: allwinner: a64: Add Oceanic 5205 5inMFD initial support"
(sha1: 00f7980a3bd53d12abc34f68146a8eed0e894248)

Signed-off-by: Jagan Teki <jagan@amarulasolutions.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>
5 years agospl: ymodem: Terminate YModem session on error
Marek Vasut [Tue, 12 Mar 2019 03:02:39 +0000 (04:02 +0100)]
spl: ymodem: Terminate YModem session on error

In case spl_parse_image_header() errors out, terminate the YModem
session, otherwise we won't get any further output.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
5 years agoMerge branch 'master' of git://git.denx.de/u-boot-ubi
Tom Rini [Tue, 9 Apr 2019 16:10:53 +0000 (12:10 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-ubi

5 years agoMerge tag 'u-boot-atmel-2019.07-a' of git://git.denx.de/u-boot-atmel
Tom Rini [Tue, 9 Apr 2019 16:10:40 +0000 (12:10 -0400)]
Merge tag 'u-boot-atmel-2019.07-a' of git://git.denx.de/u-boot-atmel

First set of u-boot-atmel features and fixes for 2019.07 cycle

5 years agousb: ehci-mx6: Use common code to extract dr_mode
Adam Ford [Wed, 3 Apr 2019 13:41:56 +0000 (08:41 -0500)]
usb: ehci-mx6: Use common code to extract dr_mode

There exists code in drivers/common/common.c to read the dr_mode
from the device tree.  This patch converts this driver to use that
function to initialize the driver.

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agousb: Make portspeed return a read-only string
Ismael Luceno Cortes [Mon, 1 Apr 2019 16:09:13 +0000 (16:09 +0000)]
usb: Make portspeed return a read-only string

Current code is plain wrong, and there's no need to have a mutable string,
so fix function type and remove the intermediate variable.

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
5 years agousb: host: Print device name when scanning
Ismael Luceno Cortes [Tue, 19 Mar 2019 09:19:44 +0000 (09:19 +0000)]
usb: host: Print device name when scanning

Drop the counter, it has no meaning other than being the order in which
the interface is found; the name assigned to the USB host controller
interface is a better indicator.

Example of the original output:
> USB0:   USB EHCI 1.10
> scanning bus 0 for devices... 2 USB Device(s) found
>        scanning usb for storage devices... 1 Storage Device(s) found

Patched output:
> Bus usb@ee080100: USB EHCI 1.10
> scanning bus usb@ee080100 for devices... 2 USB Device(s) found
>        scanning usb for storage devices... 1 Storage Device(s) found

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
5 years agonet: macb: Add small delay after link establishment
Stefan Roese [Wed, 27 Mar 2019 10:20:19 +0000 (11:20 +0100)]
net: macb: Add small delay after link establishment

I've noticed that the first ethernet packet after PHY link establishment
is not tranferred correctly most of the time on my AT91SAM9G25 board.
Here I usually see a timeout of a few seconds, which is quite
annoying.

Adding a small delay (10ms in this case) after the link establishment
helps to solve this problem. With this patch applied, this timeout
on the first packet is not seen any more.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Wenyou Yang <wenyou.yang@atmel.com>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agopinctrl: at91: add slewrate support for SAM9X60
Claudiu Beznea [Mon, 25 Mar 2019 10:34:00 +0000 (10:34 +0000)]
pinctrl: at91: add slewrate support for SAM9X60

Add slew rate support for SAM9X60 pin controller.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
5 years agopinctrl: at91: add compatibles for SAM9X60 pin controller
Claudiu Beznea [Mon, 25 Mar 2019 10:33:59 +0000 (10:33 +0000)]
pinctrl: at91: add compatibles for SAM9X60 pin controller

Add compatibles for SAM9X60 pin controller.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
5 years agopinctrl: at91: add drive strength support for SAM9X60
Claudiu Beznea [Mon, 25 Mar 2019 10:33:57 +0000 (10:33 +0000)]
pinctrl: at91: add drive strength support for SAM9X60

Add drive strength support for SAM9X60 pin controller.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
5 years agopinctrl: at91: add option to use drive strength bits
Claudiu Beznea [Mon, 25 Mar 2019 10:33:56 +0000 (10:33 +0000)]
pinctrl: at91: add option to use drive strength bits

SAM9X60 uses high and low drive strengths. To implement this, in
at91_pinctrl_mux_ops::set_drivestrength we need bit numbers of
drive strengths (1 for low, 2 for high), thus change the code to
allow the usage of drive strength bit numbers.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
5 years agoarm: at91: Add gardena-gateway-at91sam support
Stefan Roese [Tue, 2 Apr 2019 08:57:27 +0000 (10:57 +0200)]
arm: at91: Add gardena-gateway-at91sam support

The GARDENA smart Gateway boards are equipped with an Atmel / Microchip
AT91SAM9G25 SoC and with 128 MiB of RAM and 256 MiB of NAND storage.
This patch adds support for this board including SPL support. Therefore
the AT91Boostrap is not needed on this platform any more.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agoarm: at91: at91sam9x5.dtsi: Add watchdog handle
Stefan Roese [Tue, 2 Apr 2019 08:57:26 +0000 (10:57 +0200)]
arm: at91: at91sam9x5.dtsi: Add watchdog handle

This makes it possible to reference the watchdog DT node via "&watchdog"
from board dts files.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agoarm: at91: siemens: Add support to generate combined SPL+U-Boot image
Stefan Roese [Tue, 2 Apr 2019 08:57:25 +0000 (10:57 +0200)]
arm: at91: siemens: Add support to generate combined SPL+U-Boot image

This patch adds the necessary defines to the Siemens AT91SAM based
boards (smartweb, corvus and taurus) to generate the combined binary
image with SPL and main U-Boot image combined (u-boot-with-spl.bin).

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Tested on the taurus board:
Tested-by: Heiko Schocher <hs@denx.de>
5 years agoMakefile: Add Kconfig option CONFIG_SPL_IMAGE to select the SPL binary
Stefan Roese [Wed, 3 Apr 2019 13:24:50 +0000 (15:24 +0200)]
Makefile: Add Kconfig option CONFIG_SPL_IMAGE to select the SPL binary

This patch adds the CONFIG_SPL_IMAGE option to select the SPL image that
shall be used to generate the combined SPL + U-Boot image. The default
value is the current value "spl/u-boot-spl.bin".

This patch also sets CONFIG_SPL_IMAGE to "spl/boot.bin" for AT91 targets
which use SPL NAND support (boot from NAND). For these build targets the
combined image "u-boot-with-spl.bin" is now automatically generated and
can be programmed into NAND as one single image (vs. SPL image and U-Boot
as 2 separate images).

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
5 years agoMakefile.spl: Move generated AT91SAM NAND image boot.bin to spl directory
Stefan Roese [Tue, 2 Apr 2019 08:57:23 +0000 (10:57 +0200)]
Makefile.spl: Move generated AT91SAM NAND image boot.bin to spl directory

This patch moves the AT91SAM NAND booting SPL image "boot.bin" which
includes the ECC values from the root directory into the spl directory,
where all SPL related images are located.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Tested on the taurus board:
Tested-by: Heiko Schocher <hs@denx.de>
5 years agoarm: at91: arm926ejs/u-boot-spl.lds: Add _image_binary_end to SPL lds
Stefan Roese [Tue, 2 Apr 2019 08:57:22 +0000 (10:57 +0200)]
arm: at91: arm926ejs/u-boot-spl.lds: Add _image_binary_end to SPL lds

This patch adds _image_binary_end to the SPL linker script. This will be
used be the upcoming GARDENA AT91SAM based platform, which uses DT in
SPL and configures CONFIGURE_SPL_SEPARATE_BSS.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agoarm: at91: Enable watchdog support
Stefan Roese [Wed, 3 Apr 2019 05:37:40 +0000 (07:37 +0200)]
arm: at91: Enable watchdog support

This patch enables and starts the watchdog on the AT91 platform if
configured. The WD timeout value is read in the AT91 WD device driver
from the DT, using the "timeout-sec" DT property. If not provided in
the DT, the default value of 2 seconds is used.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
5 years agoarm: at91: Remove CONFIG_AT91_HW_WDT_TIMEOUT
Stefan Roese [Wed, 3 Apr 2019 05:37:05 +0000 (07:37 +0200)]
arm: at91: Remove CONFIG_AT91_HW_WDT_TIMEOUT

This patch removes the CONFIG_AT91_HW_WDT_TIMEOUT as its not needed any
more. The WD timeout value can be provided via the "timeout-sec" DT
property. If not provided this way, the default value of 2 seconds will
be used.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
5 years agowatchdog: at91sam9_wdt: Fix WDT setup in at91_wdt_start()
Stefan Roese [Tue, 2 Apr 2019 08:57:19 +0000 (10:57 +0200)]
watchdog: at91sam9_wdt: Fix WDT setup in at91_wdt_start()

This patch fixes the timer register setup in at91_wdt_start() to
correctly configure the register again. The input timeout value is
now in milli-seconds instead of seconds with the new watchdog API.
Make sure to take this into account and only use a max timeout
value of 16 seconds as appropriate for this SoC.

Also the check against a lower timeout value than 0 is removed. This
check makes no sense, as the timeout value is unsigned.

Signed-off-by: Stefan Roese <sr@denx.de>
Reported-by: Heiko Schocher <hs@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Tested on the taurus board:
Tested-by: Heiko Schocher <hs@denx.de>
5 years agowatchdog: Handle SPL build with watchdog disabled
Stefan Roese [Tue, 2 Apr 2019 08:57:18 +0000 (10:57 +0200)]
watchdog: Handle SPL build with watchdog disabled

This patch adds some checks, so that the watchdog can be enabled in main
U-Boot proper but can be disabled in SPL.

This will be used by some AT91SAM based boards, which might enable the
watchdog in the main U-Boot proper and not in SPL. It will be enabled in
SPL by default there, so no need to configure it there. This approach
saves some space in SPL.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Tested on the taurus board:
Tested-by: Heiko Schocher <hs@denx.de>
5 years agoserial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL
Stefan Roese [Wed, 3 Apr 2019 13:24:19 +0000 (15:24 +0200)]
serial: atmel_usart: Use fixed clock value in SPL version with DM_SERIAL

This patch adds an alterative SPL version of atmel_serial_enable_clk().
This enables the usage of this driver without full clock support (in
drivers and DT nodes). This saves some space in the SPL image.

Please note that this fixed clock support is only added to the SPL code
in the DM_SERIAL part of this file. All boards not using SPL & DM_SERIAL
should not be affected.

This patch also introduces CONFIG_SPL_UART_CLOCK for the fixed UART
input clock. It defaults to 132096000 for ARCH_AT91 but can be set to
a different value if needed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
5 years agoarm: at91: spl_at91.c: Call spl_early_init() if OF_CONTROL is enabled
Stefan Roese [Tue, 2 Apr 2019 08:57:16 +0000 (10:57 +0200)]
arm: at91: spl_at91.c: Call spl_early_init() if OF_CONTROL is enabled

This patch adds a call to spl_early_init() to board_init_f() which is
needed when CONFIG_SPL_OF_CONTROL is configured. This is necessary for
the early SPL setup including the DTB setup for later usage.

Please note that this call might also be needed for non SPL_OF_CONTROL
board, like the smartweb target. But smartweb fails to build with this
call because its binary grows too big. So I disabled it for these kind
of targets for now.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Tested on the taurus board:
Tested-by: Heiko Schocher <hs@denx.de>
5 years agoarm: at91: Makefile: Compile lowlevel_init only when really necessary
Stefan Roese [Tue, 2 Apr 2019 08:57:15 +0000 (10:57 +0200)]
arm: at91: Makefile: Compile lowlevel_init only when really necessary

Make sure that lowlevel_init is not compiled when
CONFIG_SKIP_LOWLEVEL_INIT_ONLY is configured.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas@biessmann.org>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Tested on the taurus board:
Tested-by: Heiko Schocher <hs@denx.de>
5 years agoboard: pm9g45: Migrate to CONFIG_DM
Ilko Iliev [Wed, 3 Apr 2019 14:50:30 +0000 (16:50 +0200)]
board: pm9g45: Migrate to CONFIG_DM

Migrate the following options to CONFIG_DM:
  CONFIG_DM_GPIO
  CONFIG_DM_MMC
  CONFIG_DM_ETH
  CONFIG_DM_SERIAL
  CONFIG_DM_USB

Signed-off-by: Ilko Iliev <iliev@ronetix.at>
5 years agoARM: at91: sama5d2: Wrap cpu detection to fix macb driver
Alexander Dahl [Fri, 22 Mar 2019 13:25:54 +0000 (14:25 +0100)]
ARM: at91: sama5d2: Wrap cpu detection to fix macb driver

When introducing the SAMA5D27 SoCs, the SAMA5D2 series got an additional
chip id. The check if the cpu is sama5d2 was changed from a preprocessor
definition (inlining a call to 'get_chip_id()') to a C function,
probably to not call get_chip_id twice?

That however broke a check in the macb ethernet driver. That driver is
more generic and also used for other platforms. I suppose this solution
was implemented to use it in 'gem_is_gigabit_capable()', without having
to stricly depend on the at91 platform:

#ifndef cpu_is_sama5d2
#define cpu_is_sama5d2() 0
#endif

That only works as long as cpu_is_sama5d2 is a preprocessor definition.
(The same is still true for sama5d4 by the way.) So this is a straight
forward fix for the workaround.

The not working check on the SAMA5D2 CPU lead to an issue on a custom
board with a LAN8720A ethernet phy connected to the SoC:

=> dhcp
ethernet@f8008000: PHY present at 1
ethernet@f8008000: Starting autonegotiation...
ethernet@f8008000: Autonegotiation complete
ethernet@f8008000: link up, 1000Mbps full-duplex (lpa: 0xffff)
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9
BOOTP broadcast 10
BOOTP broadcast 11
BOOTP broadcast 12
BOOTP broadcast 13
BOOTP broadcast 14
BOOTP broadcast 15
BOOTP broadcast 16
BOOTP broadcast 17

Retry time exceeded; starting again

Notice the wrong reported link speed, although both SoC and phy only
support 100 MBit/s!

The real issue on reliably detecting the features of that cadence
ethernet mac IP block, is probably more complicated, though.

Fixes: 245cbc583d ("ARM: at91: Get the Chip ID of SAMA5D2 SiP")
Signed-off-by: Alexander Dahl <ada@thorsis.com>
5 years agomtd: ubi, ubifs debug: Use pr_debug instead of pr_crit
Eran Matityahu [Wed, 13 Feb 2019 18:56:17 +0000 (20:56 +0200)]
mtd: ubi, ubifs debug: Use pr_debug instead of pr_crit

Before printk.h was introduced and MTDDEBUG was removed,
pr_crit() was calling MTDDEBUG(), which was since then
replaced by the current pr_debug().

pr_debug is more appropriate here.

Signed-off-by: Eran Matityahu <eran.m@variscite.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agomtd: ubi debug: Remove the pid print from ubi_assert
Eran Matityahu [Wed, 13 Feb 2019 18:55:43 +0000 (20:55 +0200)]
mtd: ubi debug: Remove the pid print from ubi_assert

Add a new definition for ubi_assert and keep
the original one in an ifndef __UBOOT__.

Signed-off-by: Eran Matityahu <eran.m@variscite.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agoMerge tag 'efi-2019-07-rc1' of git://git.denx.de/u-boot-efi
Tom Rini [Tue, 9 Apr 2019 02:32:45 +0000 (22:32 -0400)]
Merge tag 'efi-2019-07-rc1' of git://git.denx.de/u-boot-efi

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

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

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

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

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