platform/kernel/u-boot.git
6 years agodriver: net: fsl-mc: initialize dpmac irrespective of phy
Pankaj Bansal [Wed, 10 Oct 2018 08:38:33 +0000 (14:08 +0530)]
driver: net: fsl-mc: initialize dpmac irrespective of phy

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

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

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

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

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

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

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

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

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

Also phy_regs is not being used, therefore remove it

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

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

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

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

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

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

That report was:

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

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

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

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

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

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

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

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

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
6 years agonet: sandbox: Add a priv ptr for tests to use
Joe Hershberger [Wed, 26 Sep 2018 21:48:59 +0000 (16:48 -0500)]
net: sandbox: Add a priv ptr for tests to use

Tests need to be able to pass their "unit test state" to the handlers
where asserts are evaluated. Add a function that allows the tests to set
this private data on the sandbox eth device.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
6 years agonet: Add an accessor to know if waiting for ARP
Joe Hershberger [Wed, 26 Sep 2018 21:48:58 +0000 (16:48 -0500)]
net: Add an accessor to know if waiting for ARP

This single-sources the state of the ARP.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
6 years agonet: sandbox: Allow fake eth to handle more than 1 packet response
Joe Hershberger [Wed, 26 Sep 2018 21:48:57 +0000 (16:48 -0500)]
net: sandbox: Allow fake eth to handle more than 1 packet response

Use up to the max allocated receive buffers so as to be able to test
more complex situations.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
6 years agonet: sandbox: Share the priv structure with tests
Joe Hershberger [Wed, 26 Sep 2018 21:48:56 +0000 (16:48 -0500)]
net: sandbox: Share the priv structure with tests

If tests want to implement tx handlers, they will likely need access to
the details in the priv structure.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
6 years agonet: sandbox: Make the fake eth driver response configurable
Joe Hershberger [Wed, 26 Sep 2018 21:48:55 +0000 (16:48 -0500)]
net: sandbox: Make the fake eth driver response configurable

Make the send handler registerable so tests can check for different
things.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
6 years agonet: sandbox: Refactor sandbox send function
Joe Hershberger [Wed, 26 Sep 2018 21:48:54 +0000 (16:48 -0500)]
net: sandbox: Refactor sandbox send function

Make the behavior of the send function reusable.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
6 years agonet: sandbox: Move disabled flag into priv struct
Joe Hershberger [Wed, 26 Sep 2018 21:48:53 +0000 (16:48 -0500)]
net: sandbox: Move disabled flag into priv struct

Store the per-device data with the device.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
6 years agophy: Add 25G_AUI, XLAUI, CAUI2, CAUI4 related macros
Priyanka Jain [Mon, 27 Aug 2018 09:45:19 +0000 (15:15 +0530)]
phy: Add 25G_AUI, XLAUI, CAUI2, CAUI4 related macros

NXP SoCs like LX2160A can support new ethernet modes
which are 25G_AUI(25G), XLAUI(40G), CAUI2(50G)
and CAUI4(100G)
Add corresponding macros definitions in phy_interface.h

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agonet: phy: ti: Add binding for the CLK_OUT pin muxing
Janine Hagemann [Tue, 28 Aug 2018 06:25:39 +0000 (08:25 +0200)]
net: phy: ti: Add binding for the CLK_OUT pin muxing

The DP83867 has a muxing option for the CLK_OUT pin. It is possible
to set CLK_OUT for different channels.
Create a binding to select a specific clock for CLK_OUT pin.

Based on commit 9708fb630d19 ("net: phy: dp83867: Add binding for
the CLK_OUT pin muxing option") of mainline linux kernel.

Signed-off-by: Janine Hagemann <j.hagemann@phytec.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agonet: phy: ti: Recover from "port mirroring" N/A MODE4
Janine Hagemann [Tue, 28 Aug 2018 06:25:38 +0000 (08:25 +0200)]
net: phy: ti: Recover from "port mirroring" N/A MODE4

The DP83867 when not properly bootstrapped - especially with LED_0 pin -
can enter N/A MODE4 for "port mirroring" feature.

To provide normal operation of the PHY, one needs not only to explicitly
disable the port mirroring feature, but as well stop some IC internal
testing (which disables RGMII communication).

To do that the STRAP_STS1 (0x006E) register must be read and RESERVED bit
11 examined. When it is set, the another RESERVED bit (11) at PHYCR
(0x0010) register must be clear to disable testing mode and enable RGMII
communication.

Thorough explanation of the problem can be found at following e2e thread:
"DP83867IR: Problem with RESERVED bits in PHY Control Register (PHYCR) -
Linux driver"

https://e2e.ti.com/support/interface/ethernet/f/903/p/571313/2096954#2096954

Based on commit ac6e058b75be ("net: phy: dp83867: Recover from "port mirroring"
N/A MODE4") of mainline linux kernel.

Signed-off-by: Janine Hagemann <j.hagemann@phytec.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Lukasz Majewski <lukma@denx.de>
6 years agonet: phy: ti: Add lane swapping support in the DP83867 TI's PHY driver
Janine Hagemann [Tue, 28 Aug 2018 06:25:37 +0000 (08:25 +0200)]
net: phy: ti: Add lane swapping support in the DP83867 TI's PHY driver

This patch adds support for enabling or disabling the lane swapping
(called "port mirroring" in PHY's CFG4 register) feature of the DP83867
TI's PHY device.

One use case is when bootstrap configuration enables this feature (because
of e.g. LED_0 wrong wiring) so then one needs to disable it in software
(at u-boot/Linux).

Based on commit fc6d39c39581 ("net: phy: dp83867: Add lane swapping
support in the DP83867 TI's PHY driver") of mainline linux kernel.

Signed-off-by: Janine Hagemann <j.hagemann@phytec.de>
Acked-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agolinux/if_ether.h: Add VLAN related macros
Bin Meng [Tue, 31 Jul 2018 09:55:23 +0000 (02:55 -0700)]
linux/if_ether.h: Add VLAN related macros

There are VLAN related macros defined in include/linux/if_vlan.h
in Linux kernel, as well as some kernel useful structures and inline
functions. Instead of a complete import from kernel, let's add these
VLAN macros to U-Boot's include/linux/if_ether.h.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agonet.h: Include linux/if_ether.h to avoid duplication
Bin Meng [Tue, 31 Jul 2018 09:55:22 +0000 (02:55 -0700)]
net.h: Include linux/if_ether.h to avoid duplication

There are plenty of existing drivers that have macros like ETH_ALEN
defined in their own source files. Now that we imported the kernel's
if_ether.h to U-Boot we can reduce some duplication.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agolinux/if_ether.h: Initial import from Linux kernel v4.17
Bin Meng [Tue, 31 Jul 2018 09:55:21 +0000 (02:55 -0700)]
linux/if_ether.h: Initial import from Linux kernel v4.17

This imports include/uapi/linux/if_ether.h from Linux kernel v4.17.
It can be very helpful When porting Linux ethernet driver to U-Boot.

Note it is not exactly the same as the kernel one, as checkpatch
issues are fixed.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agonet: pch_gbe: Make probe/remove static
Bin Meng [Sun, 29 Jul 2018 07:11:22 +0000 (00:11 -0700)]
net: pch_gbe: Make probe/remove static

These two routines are internal to pch_gbe driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agolinux/compat.h: Add netdev_### log macros
Bin Meng [Thu, 26 Jul 2018 10:15:58 +0000 (03:15 -0700)]
linux/compat.h: Add netdev_### log macros

Currently there are two ethernet drivers (mvneta.c and mvpp2.c) that
has netdev_### (eg: netdev_dbg) log macros defined in its own driver
file. This adds these log macros in a common place linux/compat.h.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agolinux/mdio.h: Sync with Linux kernel v4.17
Bin Meng [Thu, 26 Jul 2018 09:39:40 +0000 (02:39 -0700)]
linux/mdio.h: Sync with Linux kernel v4.17

This syncs U-Boot's include/linux/mdio.h with Linux kernel v4.17
include/uapi/linux/mdio.h.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agolinux/mii.h: Sync with Linux kernel v4.17
Bin Meng [Thu, 26 Jul 2018 09:39:39 +0000 (02:39 -0700)]
linux/mii.h: Sync with Linux kernel v4.17

This syncs U-Boot's include/linux/mii.h with Linux kernel v4.17
include/uapi/linux/mii.h.

While we are here, this also fixes some style issues.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agoKconfig: sandbox: enable cmd_avb and dependencies
Jens Wiklander [Tue, 25 Sep 2018 14:40:23 +0000 (16:40 +0200)]
Kconfig: sandbox: enable cmd_avb and dependencies

Enables cmd_avb and its dependencies need to run the AVB tests.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
[trini: Disable for sandbox_noblk]
Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agoavb_verify: support sandbox configuration
Jens Wiklander [Tue, 25 Sep 2018 14:40:22 +0000 (16:40 +0200)]
avb_verify: support sandbox configuration

Change get_sector_buf() to use map_sysmem() to get a pointer to the
CONFIG_FASTBOOT_BUF_ADDR in memory.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agotest_avb: Update pymark.buildconfigspec information for the AVB tests
Jens Wiklander [Tue, 25 Sep 2018 14:40:21 +0000 (16:40 +0200)]
test_avb: Update pymark.buildconfigspec information for the AVB tests

Update the pymark.buildconfigspec to depend on 'cmd_mmc' in addition to
'cmd_avb' for those tests that needs more a more complete MMC
implementation or the "mmc" command.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
6 years agoavb_verify: support using OP-TEE TA AVB
Jens Wiklander [Tue, 25 Sep 2018 14:40:20 +0000 (16:40 +0200)]
avb_verify: support using OP-TEE TA AVB

With CONFIG_OPTEE_TA_AVB use the trusted application AVB provided by
OP-TEE to manage rollback indexes and device-lock status.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
6 years agotest: tee: test TEE uclass
Jens Wiklander [Tue, 25 Sep 2018 14:40:19 +0000 (16:40 +0200)]
test: tee: test TEE uclass

Tests the TEE uclass with a sandbox tee driver.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
[trini: initialize session to 0 in dm_test_tee]
Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agotee: add sandbox driver
Jens Wiklander [Tue, 25 Sep 2018 14:40:18 +0000 (16:40 +0200)]
tee: add sandbox driver

Adds a sandbox tee driver which emulates a generic TEE with the OP-TEE
AVB TA.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix printf warnings in ta_avb_invoke_func, slots is uint]
Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agosandbox: imply CONFIG_TEE (TEE uclass)
Jens Wiklander [Tue, 25 Sep 2018 14:40:17 +0000 (16:40 +0200)]
sandbox: imply CONFIG_TEE (TEE uclass)

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
6 years agosandbox: dt: add sandbox_tee node
Jens Wiklander [Tue, 25 Sep 2018 14:40:16 +0000 (16:40 +0200)]
sandbox: dt: add sandbox_tee node

Adds a sandbox_tee node to enable the sandbox tee driver in all the
sandbox dts files.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
6 years agotee: optee: support AVB trusted application
Jens Wiklander [Tue, 25 Sep 2018 14:40:15 +0000 (16:40 +0200)]
tee: optee: support AVB trusted application

Adds configuration option OPTEE_TA_AVB and a header file describing the
interface to the Android Verified Boot 2.0 (AVB) trusted application
provided by OP-TEE.

Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agooptee: support routing of rpmb data frames to mmc
Jens Wiklander [Tue, 25 Sep 2018 14:40:14 +0000 (16:40 +0200)]
optee: support routing of rpmb data frames to mmc

Adds support in optee supplicant to route signed (MACed) RPMB frames
from OP-TEE Secure OS to MMC and vice versa to manipulate the RPMB
partition.

Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agoarm: dt: hikey: Add optee node
Jens Wiklander [Tue, 25 Sep 2018 14:40:13 +0000 (16:40 +0200)]
arm: dt: hikey: Add optee node

Sync with 14e21cb8f811 ("arm64: dt: hikey: Add optee node"
from Linux kernel.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
6 years agoDocumentation: tee uclass and op-tee driver
Jens Wiklander [Tue, 25 Sep 2018 14:40:12 +0000 (16:40 +0200)]
Documentation: tee uclass and op-tee driver

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
6 years agotee: add OP-TEE driver
Jens Wiklander [Tue, 25 Sep 2018 14:40:11 +0000 (16:40 +0200)]
tee: add OP-TEE driver

Adds a OP-TEE driver.

* Targets ARM and ARM64
* Supports using any U-Boot memory as shared memory
* Probes OP-TEE version using SMCs
* Uses OPTEE message protocol version 2 to communicate with secure world

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
6 years agodt/bindings: add bindings for optee
Jens Wiklander [Tue, 25 Sep 2018 14:40:10 +0000 (16:40 +0200)]
dt/bindings: add bindings for optee

Sync with c8bfafb15944 ("dt/bindings: add bindings for optee")
from Linux kernel.

Introduces linaro prefix and adds bindings for ARM TrustZone based OP-TEE
implementation.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
6 years agoAdd UCLASS_TEE for Trusted Execution Environment
Jens Wiklander [Tue, 25 Sep 2018 14:40:09 +0000 (16:40 +0200)]
Add UCLASS_TEE for Trusted Execution Environment

Adds a uclass to interface with a TEE (Trusted Execution Environment).

A TEE driver is a driver that interfaces with a trusted OS running in
some secure environment, for example, TrustZone on ARM cpus, or a
separate secure co-processor etc.

The TEE subsystem can serve a TEE driver for a Global Platform compliant
TEE, but it's not limited to only Global Platform TEEs.

The over all design is based on the TEE subsystem in the Linux kernel,
tailored for U-Boot.

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
6 years agommc: rpmb: add mmc_rpmb_route_frames()
Jens Wiklander [Tue, 25 Sep 2018 14:40:08 +0000 (16:40 +0200)]
mmc: rpmb: add mmc_rpmb_route_frames()

Adds mmc_rpmb_route_frames() to route RPMB data frames from/to an
external entity.

Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agocmd: avb: print error message if command fails
Jens Wiklander [Tue, 25 Sep 2018 14:40:07 +0000 (16:40 +0200)]
cmd: avb: print error message if command fails

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
6 years agocmd: avb read_rb: print rb_idx in hexadecimal
Jens Wiklander [Tue, 25 Sep 2018 14:40:06 +0000 (16:40 +0200)]
cmd: avb read_rb: print rb_idx in hexadecimal

Prior to this patch was do_avb_write_rb() reading supplied rb_idx as a
hexadecimal number while do_avb_read_rb() printed the read out rb_idx as
decimal number. For consistency change do_avb_read_rb() to print rb_idx
as a hexadecimal number too.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
6 years agodm: fdt: scan for devices under /firmware too
Jens Wiklander [Tue, 25 Sep 2018 14:40:05 +0000 (16:40 +0200)]
dm: fdt: scan for devices under /firmware too

Just as /chosen may contain devices /firmware may contain devices, scan
for devices under /firmware too.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
6 years agospl: spi: Do not hardcode fixed size for header
Michal Simek [Thu, 4 Oct 2018 07:30:20 +0000 (09:30 +0200)]
spl: spi: Do not hardcode fixed size for header

Find out size directly from header structure.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agospl: ram: Fix u_boot_pos calculation
Michal Simek [Thu, 4 Oct 2018 07:29:20 +0000 (09:29 +0200)]
spl: ram: Fix u_boot_pos calculation

The patch:
"spl: Weed out CONFIG_SYS_TEXT_BASE usage"
(sha1: 04ce5427bd3914cab8be78513275a20ab878520a)
introduced bug where assigning to u_boot_pos variable wasn't done
which end up in situation where SPL wasn't able to find out
image on the selected address.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agomach-stm32: Set MPU SDRAM size to 512MB for STM32F7/H7
Patrice Chotard [Tue, 2 Oct 2018 07:03:10 +0000 (09:03 +0200)]
mach-stm32: Set MPU SDRAM size to 512MB for STM32F7/H7

This allows to boot all STM32F7 and STM32H7 boards independently
of the amount of embedded SDRAM.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>
6 years agofs: fat: fix set_cluster()
Heinrich Schuchardt [Tue, 2 Oct 2018 07:30:45 +0000 (09:30 +0200)]
fs: fat: fix set_cluster()

Avoid CoverityScan warning SIGN_EXTENSION by changing the type of
parameter size of set_cluster().

Avoid leaking stack content when writing an incomplete last sector.

Reported-by: Coverity (CID: 184096)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
6 years agofs: fat: memory leak in fat_unlink()
Heinrich Schuchardt [Tue, 2 Oct 2018 04:58:00 +0000 (06:58 +0200)]
fs: fat: memory leak in fat_unlink()

Do not leak filename_copy in case of error.
Catch out of memory when calling strdup.

Reported-by: Coverity (CID: 184086)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
6 years agoARM: LogicPD: omap3logic: Remove Torpedo/SOM-LV autodection
Adam Ford [Sat, 29 Sep 2018 19:10:19 +0000 (14:10 -0500)]
ARM: LogicPD: omap3logic: Remove Torpedo/SOM-LV autodection

With there now being four device tree files, and 4 separate
defconfig files, the code necessary to determine which board is
being used is no longer necessary as the corresponding pin-muxing
and board names are determined by the device tree.

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoARM: DTS: Add Logic PD OMAP35/DM37 SOM-LV and OMAP35 Torpedo
Adam Ford [Sat, 29 Sep 2018 19:10:18 +0000 (14:10 -0500)]
ARM: DTS: Add Logic PD OMAP35/DM37 SOM-LV and OMAP35 Torpedo

With the device trees doing most of the work of pin-muxing and
DM doing much of the peripheral initialization, this creates
new defconfig files for each of the Logic PD variants with
proper register settings/pin-muxing.

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Update MAINTAINERS entry]
Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agoARM: DTS: Add support for Logic PD OMAP35 Torpedo & SOM-LV
Adam Ford [Sat, 29 Sep 2018 19:10:17 +0000 (14:10 -0500)]
ARM: DTS: Add support for Logic PD OMAP35 Torpedo & SOM-LV

The baseboards and SOM's are virtually identical to their DM37
counterparts, but OMAP36/37 and OMAP3 have some minor register
differences.  With the boards being mostly driven by device trees
now, this synchronizes their respective device trees with linux-omap
for-next branch destined for 4.20 (or whatever the version after 4.19
will be called)

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoARM: DTS: Remove unnecessary u-boot.dtsi options from omap3/36xx
Adam Ford [Sat, 29 Sep 2018 19:10:16 +0000 (14:10 -0500)]
ARM: DTS: Remove unnecessary u-boot.dtsi options from omap3/36xx

With the introduction of the omap serial driver, the need for some
of these U-Boot specific modifications is gone.  This cleans up
this unnneeded stuff.

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoARM: DTS: LogicPD-SOM-LV & Torpedo: Resync DTS with Kernel
Adam Ford [Sat, 29 Sep 2018 19:10:15 +0000 (14:10 -0500)]
ARM: DTS: LogicPD-SOM-LV & Torpedo: Resync DTS with Kernel

The device tree entries are from linux-omap's for-next branch
destined to me put into 4.20 (or whatever the version is after 4.19)

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agomisc: Add support for the Arm Versatile Express config bus
Liviu Dudau [Fri, 28 Sep 2018 12:43:31 +0000 (13:43 +0100)]
misc: Add support for the Arm Versatile Express config bus

Add support for the Arm Versatile Express config bus that is
being used for exposing various subsystems via a generic
configuration bus. This driver adds support for generating
transactions on this configuration bus and can be used by
other drivers to abstract the communication with the actual
function providers.

Signed-off-by: Liviu Dudau <liviu.dudau@foss.arm.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
6 years agoconfigs: drop CONFIG_SYS_EXTRA_ENV_RELOC
Simon Goldschmidt [Thu, 27 Sep 2018 10:38:34 +0000 (12:38 +0200)]
configs: drop CONFIG_SYS_EXTRA_ENV_RELOC

Instead of manually specifying CONFIG_SYS_EXTRA_ENV_RELOC
for every board that needs it, it shouldn't hurt to let
initr_reloc_global_data() always relocate gd->env_addr
unless we know this pointer is outside the initial binary.

To achieve this, the relocation is omitted if
CONFIG_ENV_ADDR is defined (and ENV_IS_EMBEDDED is not).

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
6 years agotest/py: test_fs: add docstring comments to helper functions
Akashi Takahiro [Thu, 27 Sep 2018 07:07:23 +0000 (16:07 +0900)]
test/py: test_fs: add docstring comments to helper functions

After Siomon's comment, add a descriptive comment (docstring) to each of
helper functions in conftest.py. No functionality changed.

Signed-off-by: Akashi Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agotest/py: test_fs: remove fs_type argument from umount_fs()
Akashi Takahiro [Thu, 27 Sep 2018 07:07:22 +0000 (16:07 +0900)]
test/py: test_fs: remove fs_type argument from umount_fs()

Since there is no use of fs_type in umount_fs(), just remove it.

Signed-off-by: Akashi Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agotest/py: ignore console read exceptions after test failure
Stephen Warren [Thu, 20 Sep 2018 22:55:03 +0000 (16:55 -0600)]
test/py: ignore console read exceptions after test failure

After a test has failed, test/py drains the U-Boot console log to ensure
that any relevant output is captured. At this point, we don't care about
detecting any additional errors, since the test is already known to have
failed, and U-Boot will be restarted. To ensure that the test cleanup code
is not interrupted, and can correctly terminate the log sections for the
failed test, ignore any exception that occurs while reading the U-Boot
console output during this limited period of time.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
6 years agoMerge branch 'master' of git://git.denx.de/u-boot-sh
Tom Rini [Sat, 6 Oct 2018 01:17:35 +0000 (21:17 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-sh

6 years agoMerge branch 'master' of git://git.denx.de/u-boot-socfpga
Tom Rini [Sat, 6 Oct 2018 01:17:21 +0000 (21:17 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-socfpga

6 years agoMerge tag 'rockchip-for-v2018.11-rc2' of git://git.denx.de/u-boot-rockchip
Tom Rini [Fri, 5 Oct 2018 14:16:46 +0000 (10:16 -0400)]
Merge tag 'rockchip-for-v2018.11-rc2' of git://git.denx.de/u-boot-rockchip

Rockchip-focused changes for v2018.11-rc2:
 - fixes to rkimage for SPL boot via USB
 - fixes to make_fit_atf.py, incl. entry-point calculation and python3
   compatibility
 - OP-TEE support for ARMv7-based SoCs
 - fixes to RGMII/GMII selection on the RK3328

Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agoMerge tag 'arc-updates-for-2018.11-rc2' of git://git.denx.de/u-boot-arc
Tom Rini [Fri, 5 Oct 2018 14:16:31 +0000 (10:16 -0400)]
Merge tag 'arc-updates-for-2018.11-rc2' of git://git.denx.de/u-boot-arc

Here we do a couple of impovements for all ARC boards
as well as introduce yet another developemnt board.

1. Now for ARC boards we print CPU and board info
   which is useful for users and helps with
   analysis of logs "post-mortem".

2. Synopsys IoT development kit support is added
   This one might bw a bit too late as we're past RC1
   but:
    1) This doesn't affect any other arches etc
       as we change purely ARC code.
    2) I've got a chance to talk about U-Boot on
       IoT platforms during ELCE (my proposal was on
       a wait list and only this week I've got
       an update and invitation to talk) so it would
       be good to have this board as a primer in upstream
       code-base by the time of ELCE 2018.
    3) For complete support of IoT devkit I'm yet to
       significantly rework regmap subsystem in U-Boot
       but that's a different topic and hopefully it will
       be done sometime soon... though not this release
       cycle for sure.

6 years agoarc: Add support for IoT development kit
Alexey Brodkin [Wed, 24 Jan 2018 18:37:14 +0000 (21:37 +0300)]
arc: Add support for IoT development kit

The DesignWare ARC IoT Development Kit is a versatile platform
that includes the necessary hardware and software to accelerate
software development and debugging of sensor fusion,
voice recognition and face detection designs.

More information is avaialble here [1] and here [2].

The board is based on real silicon with
ARC EM9D-based Data Fusion IP Subsystem.

It sports a rich set of I/O including
 * DW USB OTG
 * DW MobileStorage (used for micro SD-card)
 * GPIO
 * multiple serial interface including DW APB UART
 * ADC, PWM and eFlash, SRAM and SPI Flash memory
 * Real-Time Clock (RTC)
 * Bluetooth module with worldwide regulatory compliance
   (FCC, IC, CE, ETSI, TELEC)
 * On-board 9-axis sensor (gyro, accelerometer and compass)

Extensible with Arduino, Pmod, mikroBUS connectors and a 2x18
extension header.

One of the most interesting features for developers is built-in
Digilent USB JTAG probe so only micro-USB cable is needed!

[1] https://www.synopsys.com/dw/ipdir.php?ds=arc_iot_development_kit
[2] https://www.synopsys.com/dw/doc.php/ds/cc/iot_dev_kit.pdf

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
6 years agoARC: Enable DISPLAY_CPUINFO & DISPLAY_BOARDINFO
Alexey Brodkin [Tue, 2 Oct 2018 08:43:28 +0000 (11:43 +0300)]
ARC: Enable DISPLAY_CPUINFO & DISPLAY_BOARDINFO

With implemented print_cpuinfo() and model property in .dts
we're ready to print nice info about ARC cores and boards on boot.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
6 years agoARC: Implement print_cpuinfo()
Alexey Brodkin [Tue, 2 Oct 2018 08:42:23 +0000 (11:42 +0300)]
ARC: Implement print_cpuinfo()

Once we enable DISPLAY_CPUINFO for ARC we'll see
ARC core family and version printed on boot.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
6 years agoARC: Add model property to boards .dts
Alexey Brodkin [Tue, 2 Oct 2018 08:37:25 +0000 (11:37 +0300)]
ARC: Add model property to boards .dts

1. This way we sync with Linux kernel where we have model
   set for all ARC boards for quite some time, see [1]

2. Once we enable DISPLAY_BOARDINFO for ARC this info will
   be printed on boot givin some extra data-point about the board

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=618a9cd06dd471ac232f5b27325b24d26eba5571

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
6 years agoARC: Don't pre-define CROSS_COMPILE
Alexey Brodkin [Mon, 1 Oct 2018 08:48:47 +0000 (11:48 +0300)]
ARC: Don't pre-define CROSS_COMPILE

Even though arc-linux- prefix is used in ARC prebuilt tools and
in Buildroot there're other options like Linux distro cross-tools
etc where prefix is different so let's not rely on this default.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
6 years agorockchip: Fix rkimage format for SPL boot over USB
Daniel Gröber [Thu, 4 Oct 2018 13:32:42 +0000 (15:32 +0200)]
rockchip: Fix rkimage format for SPL boot over USB

The 'rkimage' format used for booting rockchip boards over USB seems to
have been broken since commit 7bf274b9caab ("rockchip: mkimage: use
imagename to select spl hdr & spl size"). That commit adds an offset of
RK_SPL_HDR_START(=2048) to the location the 'RKxx' header is written
at. However the bootrom expects this header to be the first four bytes of
the image, not at offset 2048. This appears to have been a copy paste
error since the 'rksd' and 'rkspi' image types do require this offset.

Furthermore commit 111bcc4fb6cb ("rockchip: mkimage: pad the header to
8-bytes (using a 'nop') for RK3399"), commit 3d54eabcafec9 ("rockchip:
spl: RK3399: use boot0 hook to create space for SPL magic") and
commit 308277569229 ("rockchip: mkimage: update rkimage to support
pre-padded payloads") changed the way the space for the 'RKxx' header is
allocated and written to the image without adjusting 'rkimage'.

This commit fixes those mistakes and makes it possible to load u-boot SPL
over USB once more.

(Tested on RK3399)

Signed-off-by: Daniel Gröber <daniel@dps.uibk.ac.at>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: make_fit_atf.py depends on u-boot
Andreas Färber [Sun, 3 Jun 2018 05:23:58 +0000 (07:23 +0200)]
rockchip: make_fit_atf.py depends on u-boot

u-boot.itb depends on u-boot-nodtb.bin, which in turn depends on u-boot.
u-boot.its from Rockchip make_fit_atf.py (used by {evb,firefly}-rk3399)
wants to read u-boot but is lacking this dependency, so that u-boot.itb
cannot be built in one go. Detect its use and add the missing dependency.

Reported-by: Yousaf Kaukab <yousaf.kaukab@suse.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agonet: gmac_rockchip: Add handling for RGMII_ID/RXID/TXID
Janine Hagemann [Tue, 28 Aug 2018 06:25:05 +0000 (08:25 +0200)]
net: gmac_rockchip: Add handling for RGMII_ID/RXID/TXID

Using PHY internal delays in combination with the phy-mode
rgmii-id/rxid/txid was not possible. Only rgmii was supported.

Now we can disable rockchip's gmac delay lines and also use
rgmii-id/rxid/txid.

Based on commit eaf70ad14cbb ("net: stmmac: dwmac-rk: Add
handling for RGMII_ID/RXID/TXID") for mainline linux kernel.

Signed-off-by: Janine Hagemann <j.hagemann@phytec.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: David Wu <david.wu@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agonet: gmac_rockchip: Fix a register write in rk3328_gmac_set_to_rgmii
Janine Hagemann [Tue, 28 Aug 2018 06:25:04 +0000 (08:25 +0200)]
net: gmac_rockchip: Fix a register write in rk3328_gmac_set_to_rgmii

We have to use RK3328_RXCLK_DLY_ENA_GMAC_ENABLE instead of
RK3328_RXCLK_DLY_ENA_GMAC_MASK in rk3328_gmac_set_to_rgmii()
to enable the RX delay.
The MASK was used in a wrong way.

Signed-off-by: Janine Hagemann <j.hagemann@phytec.de>
Reviewed-by: Philipp Tomisch <philipp.tomisch@theobroma-systems.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agorockchip: make_fit_atf: make python3 compatible
Mian Yousaf Kaukab [Fri, 8 Jun 2018 08:47:10 +0000 (10:47 +0200)]
rockchip: make_fit_atf: make python3 compatible

Make script python3 compatible. No functional changes intended.

Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: make_fit_atf: use elf entry point
Mian Yousaf Kaukab [Fri, 8 Jun 2018 08:47:09 +0000 (10:47 +0200)]
rockchip: make_fit_atf: use elf entry point

make_fit_atf.py uses physical address of first segment as the
entry point to bl31. It is incorrect and causes following abort
when bl31_entry() is called:

U-Boot SPL board initTrying to boot from MMC1
"Synchronous Abort" handler, esr 0x02000000
elr: 0000000000000000 lr : 00000000ff8c7e8c
x 0: 00000000ff8e0000 x 1: 0000000000000000
x 2: 0000000000000000 x 3: 00000000ff8e0180
x 4: 0000000000000000 x 5: 0000000000000000
x 6: 0000000000000030 x 7: 00000000ff8e0188
x 8: 00000000000001e0 x 9: 0000000000000000
x10: 000000000007fcdc x11: 00000000002881b8
x12: 00000000000001a2 x13: 0000000000000198
x14: 000000000007fdcc x15: 00000000002881b8
x16: 00000000003c0724 x17: 00000000003c0718
x18: 000000000007fe80 x19: 00000000ff8e0000
x20: 0000000000200000 x21: 00000000ff8e0000
x22: 0000000000000000 x23: 000000000007fe30
x24: 00000000ff8d1c3c x25: 00000000ff8d5000
x26: 00000000deadbeef x27: 00000000000004a0
x28: 000000000000009c x29: 000000000007fd90

Fix it by using the entry point from the elf header.

Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: add fit source file for pack itb with op-tee
Kever Yang [Thu, 23 Aug 2018 09:18:00 +0000 (17:18 +0800)]
rockchip: add fit source file for pack itb with op-tee

We package U-Boot and OP-TEE into one itb file for SPL,
so that we can support OP-TEE in SPL.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agospl: add support to booting with OP-TEE
Kever Yang [Thu, 23 Aug 2018 09:17:59 +0000 (17:17 +0800)]
spl: add support to booting with OP-TEE

OP-TEE is an open source trusted OS, in armv7, its loading and
running are like this:
loading:
- SPL load both OP-TEE and U-Boot
running:
- SPL run into OP-TEE in secure mode;
- OP-TEE run into U-Boot in non-secure mode;

To make code simple, it would be fine to use IH_OS_TEE for the
os tyle in TPL(just like IH_OS_LINUX is using both in SPL and U-Boot).

Here is the diagram for SPL loading OP-TEE,
IH_OS_TEE:(make u-boot.itb for SPL)
    Non-Secure       Secure

                     BootROM
                       |
                       v
                      SPL
                       |
                       v
          ---------  OP-TEE
         |
         v
       U-Boot
         |
         V
       Linux
For other two king of OP-TEE loading/booting, see commit message:
45b55712d4 image: Add IH_OS_TEE for TEE chain-load boot

More detail:
https://github.com/OP-TEE/optee_os
and search for 'boot arguments' for detail entry parameter in:
core/arch/arm/kernel/generic_entry_a32.S

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Cc: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: make_fit_atf: fix warning unit_address_vs_reg
Kever Yang [Thu, 23 Aug 2018 03:01:08 +0000 (11:01 +0800)]
rockchip: make_fit_atf: fix warning unit_address_vs_reg

Patch fix warning:
/builddir/BUILD/u-boot-2018.05-rc2/"arch/arm/mach-rockchip/make_fit_atf.py" \
arch/arm/dts/rk3399-firefly.dtb > u-boot.its
  ./tools/mkimage  -f u-boot.its -E u-boot.itb >/dev/null  && cat
/dev/null
u-boot.itb.tmp: Warning (unit_address_vs_reg): Node /images/uboot@1
has a unit name, but no reg property
u-boot.itb.tmp: Warning (unit_address_vs_reg): Node /images/atf@1 has
a unit name, but no reg property
u-boot.itb.tmp: Warning (unit_address_vs_reg): Node /images/atf@2 has
a unit name, but no reg property
u-boot.itb.tmp: Warning (unit_address_vs_reg): Node /images/atf@3 has
a unit name, but no reg property
u-boot.itb.tmp: Warning (unit_address_vs_reg): Node /images/fdt@1 has
a unit name, but no reg property
u-boot.itb.tmp: Warning (unit_address_vs_reg): Node
/configurations/config@1 has a unit name, but no reg property
make[1]: Leaving directory
'/builddir/BUILD/u-boot-2018.05-rc2/builds/firefly-rk3399'

Reported-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agoMerge branch 'master' of git://git.denx.de/u-boot-spi
Tom Rini [Thu, 4 Oct 2018 13:18:30 +0000 (09:18 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-spi

6 years agospi: Add SPI driver for MT76xx SoCs
Stefan Roese [Thu, 16 Aug 2018 08:48:48 +0000 (10:48 +0200)]
spi: Add SPI driver for MT76xx SoCs

This patch adds the SPI driver for the MediaTek MT7688 SoC (and
derivates). Its been tested on the LinkIt Smart 7688 and the Gardena
Smart Gateway with and SPI NOR on CS0 and on the Gardena Smart
Gateway additionally with an SPI NAND on CS1.

Note that the SPI controller only supports a max transfer size of 32
bytes. This driver implementes a workaround to enable bigger xfer
sizes to speed up the transfer especially for the SPI NAND support.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Jagan Teki <jagan@openedev.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Piotr Dymacz <pepe2k@gmail.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
6 years agomtd: nand: spi: Add Gigadevice SPI NAND support
Stefan Roese [Thu, 16 Aug 2018 16:05:08 +0000 (18:05 +0200)]
mtd: nand: spi: Add Gigadevice SPI NAND support

This patch adds support for Gigadevices SPI NAND device to the new SPI
NAND infrastructure in U-Boot. Currently only the 128MiB GD5F1GQ4UC
device is supported.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Jagan Teki <jagan@openedev.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Jagan Teki <jagan@openedev.com>
6 years agosf: Add XMC xm25qh64a and xm25qh128a entries
Stefan Roese [Mon, 6 Aug 2018 14:33:19 +0000 (16:33 +0200)]
sf: Add XMC xm25qh64a and xm25qh128a entries

This patch adds support for 2 new XMC (Wuhan Xinxin Semiconductor
Manufacturing Corp) SPI NOR chips.

This support can be enabled by selecting the SPI_FLASH_XMC Kconfig
option.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Jagan Teki <jagan@openedev.com>
6 years agoMerge tag 'rockchip-for-v2018.11' of git://git.denx.de/u-boot-rockchip
Tom Rini [Wed, 3 Oct 2018 16:09:19 +0000 (12:09 -0400)]
Merge tag 'rockchip-for-v2018.11' of git://git.denx.de/u-boot-rockchip

Rockchip changes for 2018.11

6 years agoMerge git://git.denx.de/u-boot-riscv
Tom Rini [Wed, 3 Oct 2018 12:09:53 +0000 (08:09 -0400)]
Merge git://git.denx.de/u-boot-riscv

- QEMU support

6 years agoMerge branch 'master' of git://git.denx.de/u-boot-i2c
Tom Rini [Wed, 3 Oct 2018 12:09:22 +0000 (08:09 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-i2c

Add support for the Arm's Versatile Express I2C controller.

6 years agoarm: socfpga: stratix10: add sgmii in phymode setup
Ooi, Joyce [Tue, 25 Sep 2018 06:31:45 +0000 (23:31 -0700)]
arm: socfpga: stratix10: add sgmii in phymode setup

Additional sgmii phymode is added in socfpga_phymode_setup() along with
a minor fix for maximum number of GMACs.

Signed-off-by: Ooi, Joyce <joyce.ooi@intel.com>
6 years agoarm: socfpga: Remove unused function socfpga_emac_manage_reset()
Ley Foon Tan [Thu, 20 Sep 2018 16:22:14 +0000 (00:22 +0800)]
arm: socfpga: Remove unused function socfpga_emac_manage_reset()

Remove code from the reset manager that is never called.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
6 years agotools: socfpga: fix sfp_verify_header
Atsushi Nemoto [Fri, 21 Sep 2018 00:19:13 +0000 (09:19 +0900)]
tools: socfpga: fix sfp_verify_header

Fix sfp_verify_header to return correct version number.
This fixes "Not a sane SOCFPGA preloader" error message with v1 header.

Signed-off-by: Atsushi Nemoto <atsushi.nemoto@sord.co.jp>
6 years agogpio: dwapb_gpio: Change to use devm_kcalloc()
Ley Foon Tan [Wed, 19 Sep 2018 08:26:33 +0000 (16:26 +0800)]
gpio: dwapb_gpio: Change to use devm_kcalloc()

Change to use managed resource function devm_kcalloc(),
so it will auto free memory when driver is removed.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
6 years agoARM: rmobile: Enable PHY framework on Gen3
Marek Vasut [Tue, 2 Oct 2018 20:48:26 +0000 (22:48 +0200)]
ARM: rmobile: Enable PHY framework on Gen3

Enable PHY framework on Gen3, this is required for USB EHCI PHY support.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
6 years agophy: rcar: Add R-Car Gen3 PHY driver
Marek Vasut [Tue, 2 Oct 2018 20:31:47 +0000 (22:31 +0200)]
phy: rcar: Add R-Car Gen3 PHY driver

Add a PHY driver for the R-Car Gen3 which allows configuring
USB OTG PHY on Gen3 into host mode and toggles VBUS in case a
dedicated regulator is present.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
6 years agoARM: rmobile: Mark 4-64GiB as DRAM on Gen3
Marek Vasut [Tue, 2 Oct 2018 19:42:49 +0000 (21:42 +0200)]
ARM: rmobile: Mark 4-64GiB as DRAM on Gen3

Mark area 0x1_0000_0000 - 0x10_0000_0000 as DRAM on Gen3 as the
chip is capable of addressing that and U-Boot can make use of it.
This patch prevents exception when accessing those areas.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
6 years agoARM: rmobile: Repair TMU clock on Gen2
Marek Vasut [Wed, 19 Sep 2018 14:33:09 +0000 (16:33 +0200)]
ARM: rmobile: Repair TMU clock on Gen2

The CPfi/4 is derived from XTAL clock and is not fixed. Undo
the previous commit 7984ac8d1635aebd11175c96b07f937a39f0384d.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
6 years agoARM: dts: rmobile: Reinstate missing i2c6 on Porter
Marek Vasut [Wed, 19 Sep 2018 11:56:27 +0000 (13:56 +0200)]
ARM: dts: rmobile: Reinstate missing i2c6 on Porter

The I2C6 is used to communicate with the PMIC and it was removed
during DT sync with Linux 4.17. Reinstate it.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
6 years agoriscv: allow native compilation
Heinrich Schuchardt [Mon, 6 Aug 2018 17:15:38 +0000 (19:15 +0200)]
riscv: allow native compilation

If environment variable CROSS_COMPILE is not set, this indicates native
compilation. In this case we should not set an arbitrary value which is
not applicable for 64bit anyway.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
6 years agoriscv: cosmetic: Reword do_reset() printf message.
Rick Chen [Wed, 3 Oct 2018 05:59:03 +0000 (13:59 +0800)]
riscv: cosmetic: Reword do_reset() printf message.

The Sentence "reset unsupported yet" is not
grammatically correct and should say
"reset not supported yet" instead.

Suggested-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Signed-off-by: Rick Chen <rick@andestech.com>
6 years agoriscv: Move do_reset() to a common place
Bin Meng [Wed, 26 Sep 2018 13:55:22 +0000 (06:55 -0700)]
riscv: Move do_reset() to a common place

We don't have a reset method on any RISC-V board yet. Instead of
adding the same 'unsupported' message for each CPU variant it might
make more sense to add a generic do_reset function for all CPU
variants to lib/, similar to the one for ARM (arch/arm/lib/reset.c).

Suggested-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
6 years agoriscv: Add QEMU virt board support
Bin Meng [Wed, 26 Sep 2018 13:55:21 +0000 (06:55 -0700)]
riscv: Add QEMU virt board support

This adds QEMU RISC-V 'virt' board target support, with the hope of
helping people easily test U-Boot on RISC-V.

The QEMU virt machine models a generic RISC-V virtual machine with
support for the VirtIO standard networking and block storage devices.
It has CLINT, PLIC, 16550A UART devices in addition to VirtIO and
it also uses device-tree to pass configuration information to guest
software. It implements RISC-V privileged architecture spec v1.10.

Both 32-bit and 64-bit builds are supported. Support is pretty much
preliminary, only booting to U-Boot shell with the UART driver on
a single core. Booting Linux is not supported yet.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
6 years agoriscv: kconfig: Imply DM support for some common drivers
Bin Meng [Wed, 26 Sep 2018 13:55:20 +0000 (06:55 -0700)]
riscv: kconfig: Imply DM support for some common drivers

This implies DM support for some common drivers that are used on
RISC-V.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>