platform/kernel/u-boot.git
3 years agonet: bcm-sf2: ensure mdiodev->name is NULL terminated after MDIO_NAME_LEN truncation
Vladimir Oltean [Mon, 27 Sep 2021 11:21:45 +0000 (14:21 +0300)]
net: bcm-sf2: ensure mdiodev->name is NULL terminated after MDIO_NAME_LEN truncation

strncpy() simply bails out when copying a source string whose size
exceeds the destination string size, potentially leaving the destination
string unterminated.

One possible way to address is to pass MDIO_NAME_LEN - 1 and a
previously zero-initialized destination string, but this is more
difficult to maintain.

The chosen alternative is to use strlcpy(), which properly limits the
copy len in the (srclen >= size) case to "size - 1", and which is also
more efficient than the strncpy() byte-by-byte implementation by using
memcpy. The destination string returned by strlcpy() is always NULL
terminated.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: at91_emac: ensure mdiodev->name is NULL terminated after MDIO_NAME_LEN truncation
Vladimir Oltean [Mon, 27 Sep 2021 11:21:44 +0000 (14:21 +0300)]
net: at91_emac: ensure mdiodev->name is NULL terminated after MDIO_NAME_LEN truncation

strncpy() simply bails out when copying a source string whose size
exceeds the destination string size, potentially leaving the destination
string unterminated.

One possible way to address is to pass MDIO_NAME_LEN - 1 and a
previously zero-initialized destination string, but this is more
difficult to maintain.

The chosen alternative is to use strlcpy(), which properly limits the
copy len in the (srclen >= size) case to "size - 1", and which is also
more efficient than the strncpy() byte-by-byte implementation by using
memcpy. The destination string returned by strlcpy() is always NULL
terminated.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: armada100_fec: ensure mdiodev->name is NULL terminated after MDIO_NAME_LEN trunc...
Vladimir Oltean [Mon, 27 Sep 2021 11:21:43 +0000 (14:21 +0300)]
net: armada100_fec: ensure mdiodev->name is NULL terminated after MDIO_NAME_LEN truncation

strncpy() simply bails out when copying a source string whose size
exceeds the destination string size, potentially leaving the destination
string unterminated.

One possible way to address is to pass MDIO_NAME_LEN - 1 and a
previously zero-initialized destination string, but this is more
difficult to maintain.

The chosen alternative is to use strlcpy(), which properly limits the
copy len in the (srclen >= size) case to "size - 1", and which is also
more efficient than the strncpy() byte-by-byte implementation by using
memcpy. The destination string returned by strlcpy() is always NULL
terminated.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agoboard: gdsys: a38x: ensure mdiodev->name is NULL terminated after MDIO_NAME_LEN trunc...
Vladimir Oltean [Mon, 27 Sep 2021 11:21:42 +0000 (14:21 +0300)]
board: gdsys: a38x: ensure mdiodev->name is NULL terminated after MDIO_NAME_LEN truncation

strncpy() simply bails out when copying a source string whose size
exceeds the destination string size, potentially leaving the destination
string unterminated.

One possible way to address is to pass MDIO_NAME_LEN - 1 and a
previously zero-initialized destination string, but this is more
difficult to maintain.

The chosen alternative is to use strlcpy(), which properly limits the
copy len in the (srclen >= size) case to "size - 1", and which is also
more efficient than the strncpy() byte-by-byte implementation by using
memcpy. The destination string returned by strlcpy() is always NULL
terminated.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agoarch: powerpc: mpc85xx: ensure mdiodev->name is NULL terminated after MDIO_NAME_LEN...
Vladimir Oltean [Mon, 27 Sep 2021 11:21:41 +0000 (14:21 +0300)]
arch: powerpc: mpc85xx: ensure mdiodev->name is NULL terminated after MDIO_NAME_LEN truncation

strncpy() simply bails out when copying a source string whose size
exceeds the destination string size, potentially leaving the destination
string unterminated.

One possible way to address is to pass MDIO_NAME_LEN - 1 and a
previously zero-initialized destination string, but this is more
difficult to maintain.

The chosen alternative is to use strlcpy(), which properly limits the
copy len in the (srclen >= size) case to "size - 1", and which is also
more efficient than the strncpy() byte-by-byte implementation by using
memcpy. The destination string returned by strlcpy() is always NULL
terminated.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: tsec: read the phy-mode property as fallback to phy-connection-type
Vladimir Oltean [Sat, 18 Sep 2021 12:46:55 +0000 (15:46 +0300)]
net: tsec: read the phy-mode property as fallback to phy-connection-type

The two should be equivalent, but at the moment some platforms
(ls1021a-tsn.dts) use phy-mode only, which is not parsed.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: tsec: only call tsec_get_interface as fallback to DT-specified PHY mode
Vladimir Oltean [Sat, 18 Sep 2021 12:46:54 +0000 (15:46 +0300)]
net: tsec: only call tsec_get_interface as fallback to DT-specified PHY mode

Currently the init_phy function may overwrite the priv->interface
property, since it calls tsec_get_interface which tries to determine it
dynamically based on default register values in ECNTRL.

Let's do that only if phy-connection-type happens to not be defined in
the device tree.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: dsa: felix: remove "xgmii" phy-mode
Vladimir Oltean [Sat, 18 Sep 2021 12:32:37 +0000 (15:32 +0300)]
net: dsa: felix: remove "xgmii" phy-mode

The felix driver runs only on NXP LS1028A, which most definitely does
not support the parallel 10G interface, just USXGMII, and that only up
to 2.5Gbps (toned down from 10 Gbps via symbol replication).

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: enetc: remove support for "xgmii" phy-mode
Vladimir Oltean [Sat, 18 Sep 2021 12:32:36 +0000 (15:32 +0300)]
net: enetc: remove support for "xgmii" phy-mode

The enetc driver runs only on NXP LS1028A, which most definitely does
not support the parallel 10G interface, just USXGMII, and that only up
to 2.5Gbps (toned down from 10 Gbps via symbol replication).

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: freescale: replace usage of phy-mode = "sgmii-2500" with "2500base-x"
Vladimir Oltean [Sat, 18 Sep 2021 12:32:35 +0000 (15:32 +0300)]
net: freescale: replace usage of phy-mode = "sgmii-2500" with "2500base-x"

After the discussion here:
https://lore.kernel.org/netdev/20210603143453.if7hgifupx5k433b@pali/

which resulted in this patch:
https://patchwork.kernel.org/project/netdevbpf/patch/20210704134325.24842-1-pali@kernel.org/

and many other discussions before it, notably:
https://patchwork.kernel.org/project/linux-arm-kernel/patch/1512016235-15909-1-git-send-email-Bhaskar.Upadhaya@nxp.com/

it became apparent that nobody really knows what "SGMII 2500" is.
Certainly, Freescale/NXP hardware engineers name this protocol
"SGMII 2500" in the reference manuals, but the PCS devices do not
support any "SGMII" specific features when operating at the speed of
2500 Mbps, no in-band autoneg and no speed change via symbol replication
. So that leaves a fixed speed of 2500 Mbps using a coding of 8b/10b
with a SERDES lane frequency of 3.125 GHz. In fact, "SGMII 2500 without
in-band autoneg and at a fixed speed" is indistinguishable from
"2500base-x without in-band autoneg", which is precisely what these NXP
devices support.

So it just appears that "SGMII 2500" is an unclear name with no clear
definition that stuck.

As such, in the Linux kernel, the drivers which use this SERDES protocol
use the 2500base-x phy-mode.

This patch converts U-Boot to use 2500base-x too, or at least, as much
as it can.

Note that I would have really liked to delete PHY_INTERFACE_MODE_SGMII_2500
completely, but the mvpp2 driver seems to even distinguish between SGMII
2500 and 2500base-X. Namely, it enables in-band autoneg for one but not
the other, and forces flow control for one but not the other. This goes
back to the idea that maybe 2500base-X is a fiber protocol and SGMII-2500
is an MII protocol (connects a MAC to a PHY such as Aquantia), but the
two are practically indistinguishable through everything except use case.

NXP devices can support both use cases through an identical configuration,
for example RX flow control can be unconditionally enabled in order to
support rate adaptation performed by an Aquantia PHY. At least I can
find no indication in online documents published by Cisco which would
point towards "SGMII-2500" being an actual standard with an actual
definition, so I cannot say "yes, NXP devices support it".

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: replace the "xfi" phy-mode with "10gbase-r"
Vladimir Oltean [Sat, 18 Sep 2021 12:32:34 +0000 (15:32 +0300)]
net: replace the "xfi" phy-mode with "10gbase-r"

As part of the effort of making U-Boot work with the same device tree as
Linux, there is an issue with the "xfi" phy-mode. To be precise, in
Linux there was a discussion (for those who have time to read:
https://lore.kernel.org/netdev/1576768881-24971-2-git-send-email-madalin.bucur@oss.nxp.com/)

which led to a patch:
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=c114574ebfdf42f826776f717c8056a00fa94881

TL;DR: "xfi" was standardized in Linux as "10gbase-r".

This patch changes the relevant occurrences in U-Boot to use "10gbase-r"
instead of "xfi" wherever applicable.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: phy: genphy_init can be static
Vladimir Oltean [Sat, 18 Sep 2021 11:55:24 +0000 (14:55 +0300)]
net: phy: genphy_init can be static

To avoid a warning with W=1 about this function not having a previous
prototype, declare it as static, because it is not used outside of this
translation module.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: dsa: remove unused variables
Vladimir Oltean [Sat, 18 Sep 2021 11:49:56 +0000 (14:49 +0300)]
net: dsa: remove unused variables

"dev" and "dsa_pdata" are unused inside dsa_port_of_to_pdata.

"dsa_priv" is unused inside dsa_port_probe.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: dsa: pass CPU port fixed PHY to .port_disable
Vladimir Oltean [Sat, 18 Sep 2021 11:49:55 +0000 (14:49 +0300)]
net: dsa: pass CPU port fixed PHY to .port_disable

While adding the logic for DSA to register a fixed-link PHY for the CPU
port, I forgot to pass it to the .port_disable method too, just
.port_enable.

Bug had no impact for felix_switch.c, due to the phy argument not being
used, but ksz9477.c does use it => NULL pointer dereference.

Fixes: fc054d563bfb ("net: Introduce DSA class for Ethernet switches")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: update NXP copyright text
Vladimir Oltean [Fri, 17 Sep 2021 11:27:13 +0000 (14:27 +0300)]
net: update NXP copyright text

NXP Legal insists that the following are not fine:

- Saying "NXP Semiconductors" instead of "NXP", since the company's
  registered name is "NXP"

- Putting a "(c)" sign in the copyright string

- Putting a comma in the copyright string

The only accepted copyright string format is "Copyright <year-range> NXP".

This patch changes the copyright headers in the networking files that
were sent by me, or derived from code sent by me.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: dsa: felix: propagate the error code from phy_startup()
Vladimir Oltean [Tue, 24 Aug 2021 12:00:43 +0000 (15:00 +0300)]
net: dsa: felix: propagate the error code from phy_startup()

Make sure that the link status returned by phy_startup() is propagated
to the .start() method of struct eth_ops.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Tested-by: Michael Walle <michael@walle.cc>
3 years agonet: dsa: felix: call phy_config at .port_probe() time
Vladimir Oltean [Tue, 24 Aug 2021 12:00:42 +0000 (15:00 +0300)]
net: dsa: felix: call phy_config at .port_probe() time

It is an unfortunate reality that some PHY settings done by U-Boot
persist even after the PHY is reset and taken over by Linux, and even
more unfortunate that Linux has come to depend on things being set in a
certain way.

For example, on the NXP LS1028A-RDB, the felix switch ports are
connected to a VSC8514 QSGMII PHY. Between the switch port PCS and the
PHY, the U-Boot drivers enable in-band auto-negotiation which makes the
copper-side negotiated speed and duplex be transmitted from the PHY to
the MAC automatically.

The PHY driver portion that does this is in vsc8514_config():

/* Enable Serdes Auto-negotiation */
phy_write(phydev, MDIO_DEVAD_NONE, PHY_EXT_PAGE_ACCESS,
  PHY_EXT_PAGE_ACCESS_EXTENDED3);
val = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_VSC8514_MAC_SERDES_CON);
val = val | MIIM_VSC8574_MAC_SERDES_ANEG;
phy_write(phydev, MDIO_DEVAD_NONE, MIIM_VSC8514_MAC_SERDES_CON, val);

The point is that in-band autoneg should be turned on in both the PHY
and the MAC, or off in both the PHY and the MAC, otherwise the QSGMII
link will be broken.

And because phy_config() is currently called at .port_enable() time, the
result is that ports on which traffic has been sent in U-Boot will have
in-band autoneg enabled, and the rest won't.

It can be argued that the Linux kernel should not assume one way or
another and just reinitialize everything according to what it expects,
and that is completely fair. In fact, I've already started an attempt to
remove this dependency, although admittedly I am making slow progress at
it:
https://patchwork.kernel.org/project/netdevbpf/cover/20210212172341.3489046-1-olteanv@gmail.com/

Nonetheless, the sad reality is that NXP also has, apart from kernel
drivers, some user space networking (DPDK), and for some reason, the
expectation there is that somebody else initializes the PHYs. The kernel
can't do it because the device ownership doesn't belong to the kernel,
so what remains is for the bootloader to do it (especially since other
drivers generally call phy_config() at probe time). This is a really
weak guarantee that might break at any time, but apparently that is
enough for some.

Since initializing the ports and PHYs at probe time does not break
anything, we can just do that.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Tested-by: Michael Walle <michael@walle.cc>
3 years agonet: dsa: introduce a .port_probe() method in struct dsa_ops
Vladimir Oltean [Tue, 24 Aug 2021 12:00:41 +0000 (15:00 +0300)]
net: dsa: introduce a .port_probe() method in struct dsa_ops

Some drivers might want to execute code for each port at probe time, as
opposed to executing code just-in-time for the port selected for
networking.

To cater to that use case, introduce a .port_probe() callback method
into the DSA switch operations which is called for each available port,
at the end of dsa_port_probe().

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Tested-by: Michael Walle <michael@walle.cc>
3 years agonet: dsa: refactor the code to set the port MAC address into a dedicated function
Vladimir Oltean [Tue, 24 Aug 2021 12:00:40 +0000 (15:00 +0300)]
net: dsa: refactor the code to set the port MAC address into a dedicated function

This snippet of code has a bothering "if (...) return 0" in it which
assumes it is the last piece of code running in dsa_port_probe().

This makes it difficult to add further code at the end of dsa_port_probe()
which does not depend on MAC address stuff.

So move the code to a dedicated function which returns void and let the
code flow through.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Tested-by: Michael Walle <michael@walle.cc>
3 years agonet: dsa: use "err" instead of "ret" in dsa_port_probe
Vladimir Oltean [Tue, 24 Aug 2021 12:00:39 +0000 (15:00 +0300)]
net: dsa: use "err" instead of "ret" in dsa_port_probe

DM DSA uses "err" for error code values, so use this consistently.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Tested-by: Michael Walle <michael@walle.cc>
3 years agonet: dsa: felix: felix_init() can be static
Vladimir Oltean [Tue, 24 Aug 2021 12:00:38 +0000 (15:00 +0300)]
net: dsa: felix: felix_init() can be static

No one is calling this function from outside felix_switch.c.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Tested-by: Michael Walle <michael@walle.cc>
3 years agonet: tsec: Mark tsec_get_interface as __maybe_unused
Ramon Fried [Tue, 28 Sep 2021 15:49:02 +0000 (18:49 +0300)]
net: tsec: Mark tsec_get_interface as __maybe_unused

Non DM builds fail with the following error:
drivers/net/tsec.c:641:24: error: 'tsec_get_interface' defined but not used [-Werror=unused-function]
  641 | static phy_interface_t tsec_get_interface(struct tsec_private *priv)

Fix that.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
3 years agoPrepare v2021.10-rc5
Tom Rini [Mon, 27 Sep 2021 13:34:20 +0000 (09:34 -0400)]
Prepare v2021.10-rc5

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agophy: marvell: cp110: Support SATA invert polarity
Denis Odintsov [Wed, 15 Sep 2021 13:45:31 +0000 (15:45 +0200)]
phy: marvell: cp110: Support SATA invert polarity

In commit b24bb99d cp110 configuration initially done in u-boot
was removed and delegated to atf firmware as smc call.
That commit didn't account for later introduced in d13b740c SATA invert polarity support.

This patch adds support of passing SATA invert polarity flags to atf
firmware during the smc call.

Signed-off-by: Denis Odintsov <shiva@mail.ru>
Cc: Baruch Siach <baruch@tkos.co.il>
Cc: Rabeeh Khoury <rabeeh@solid-run.com>
Cc: Stefan Roese <sr@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: turris_omnia: fix leaked mtd device
Marek Behún [Sat, 25 Sep 2021 00:49:18 +0000 (02:49 +0200)]
arm: mvebu: turris_omnia: fix leaked mtd device

After getting MTD device via get_mtd_device_nm(), we need to put it with
put_mtd_device(), otherwise we get

  Removing MTD device #0 (mx25l6405d) with use count 1

before booting kernel.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Pali Rohár <pali@kernel.org>
Tested-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoefi_loader: Fix spec ID event creation
Ruchika Gupta [Tue, 14 Sep 2021 06:44:31 +0000 (12:14 +0530)]
efi_loader: Fix spec ID event creation

TCG EFI Protocol Specification defines the number_of_algorithms
field in spec ID event to be equal to the number of active
algorithms supported by the TPM device. In current implementation,
this field is populated with the count of all algorithms supported
by the TPM which leads to incorrect spec ID event creation.

Similarly, the algorithm array in spec ID event should be a variable
length array with length being equal to the number_of_algorithms field.
In current implementation this is defined as a fixed length array
which has been fixed.

Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org>
CC: Masahisa Kojima <masahisa.kojima@linaro.org>
CC: Ilias Apalodimas <ilias.apalodimas@linaro.org>
CC: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 years agodoc: Add mention of the /config binding
Simon Glass [Sun, 19 Sep 2021 21:51:10 +0000 (15:51 -0600)]
doc: Add mention of the /config binding

The devicetree binding files are in their own directory and use a simple
text format. Add a link for the binding for the /config node, since it
is otherwise hard to find.

Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoarm: orion5x: edminiv2: change maintainer
Simon Guinot [Wed, 15 Sep 2021 13:01:51 +0000 (15:01 +0200)]
arm: orion5x: edminiv2: change maintainer

Since Albert Aribaud is not maintaining anymore the LaCie Ethernet Disk
mini V2 board, then I am taking over.

Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agomtd: remove SPEAr flash driver st_smi
Patrick Delaunay [Wed, 22 Sep 2021 09:02:26 +0000 (11:02 +0200)]
mtd: remove SPEAr flash driver st_smi

Remove the driver st_smic.c used in SPEAr products and the associated
config CONFIG_ST_SMI; this driver is no more used in U-Boot after the
commit 570c3dcfc153 ("arm: Remove spear600 boards and the rest of SPEAr
support").

Fixes: 570c3dcfc153 ("arm: Remove spear600 boards and the rest of SPEAr support")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agoTaking over responsibility for GE boards from Sebastian
Martyn Welch [Tue, 21 Sep 2021 16:35:06 +0000 (17:35 +0100)]
Taking over responsibility for GE boards from Sebastian

I am taking over responsibility for the GE board from Sebastian Reichel.
Updating the MAINTAINERS files to reflect this.

Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agoMAINTAINERS: remove SPEAR entry
Patrick Delaunay [Tue, 21 Sep 2021 16:18:51 +0000 (18:18 +0200)]
MAINTAINERS: remove SPEAR entry

As the lastest spear directories are removed, delete the associated entry
in the MAINTAINERS file:
- arch/arm/cpu/arm926ejs/spear/
- arch/arm/include/asm/arch-spear/

Fixes: 570c3dcfc153 ("arm: Remove spear600 boards and the rest of SPEAr support")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
3 years agofs: avoid superfluous messages
Heinrich Schuchardt [Mon, 20 Sep 2021 12:15:03 +0000 (14:15 +0200)]
fs: avoid superfluous messages

Output like the following is quite irritating:

    => bootefi hello
    Scanning disk mmc2.blk...
    No valid Btrfs found
    Bad magic number for SquashFS image.
    ** Unrecognized filesystem type **
    Scanning disk mmc1.blk...
    No valid Btrfs found
    Bad magic number for SquashFS image.
    ** Unrecognized filesystem type **
    Scanning disk mmc0.blk...
    No valid Btrfs found
    Bad magic number for SquashFS image.
    ** Unrecognized filesystem type **

Albeit a whole disk may be formatted with a filesystem in most cases
a partition table is used and the whole disk (partition number 0) doesn't
contain a filesytem. Some partitions may only contain a blob. Not seeing a
filesytem on the whole disk or on any partition is only worth a debug
message.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoscripts/mailmapper: enable running with Python 3
Heinrich Schuchardt [Thu, 16 Sep 2021 08:59:12 +0000 (10:59 +0200)]
scripts/mailmapper: enable running with Python 3

Our mailmapper script required Python 2 which is no longer maintained.
A main difference when converting to Python 3 is that byte strings are not
character strings. So add conversion and skip over conversion errors.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 years agotest/py: tpm2: Skip tpm pytest based on env variable
T Karthik Reddy [Fri, 23 Jul 2021 12:18:26 +0000 (06:18 -0600)]
test/py: tpm2: Skip tpm pytest based on env variable

Tpm test cases relies on tpm device setup. Provide an environment
variable "env__tpm_device_test_skip = True" to skip the test case
if tpm device is not present.
Only needed will have to add variable to the py-test framework.
Test runs successfully even this variable is absent.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 years agoddr: altera: use KBUILD_BASENAME instead of __FILE__
Marek Vasut [Tue, 14 Sep 2021 03:20:19 +0000 (05:20 +0200)]
ddr: altera: use KBUILD_BASENAME instead of __FILE__

The KBUILD_BASENAME contains just the name of the compiled module,
in this case 'sequencer', rather than a full path to the compiled
file. Use it to prevent pulling the full path into the U-Boot binary,
which is useless and annoying.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tien Fong Chee <tien.fong.chee@intel.com>
3 years agoarm: socfpga: vining: Let DWMAC configure PHY reset GPIO
Marek Vasut [Tue, 14 Sep 2021 03:25:36 +0000 (05:25 +0200)]
arm: socfpga: vining: Let DWMAC configure PHY reset GPIO

The DM DWMAC driver is perfectly capable of configuring the ethernet
PHY reset GPIO, let the driver do it instead of doing it in the board
file.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tien Fong Chee <tien.fong.chee@intel.com>
3 years agoarm: socfpga: vining: Enable DW I2C driver
Marek Vasut [Tue, 14 Sep 2021 03:25:35 +0000 (05:25 +0200)]
arm: socfpga: vining: Enable DW I2C driver

The Designware I2C IP is used to communicate with I2C peripherals on
SoCFPGA, and required to access I2C EEPROM on this board. Enable it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tien Fong Chee <tien.fong.chee@intel.com>
3 years agoarm: socfpga: vining: Fix UDC controller phandle in DT
Marek Vasut [Tue, 14 Sep 2021 03:25:34 +0000 (05:25 +0200)]
arm: socfpga: vining: Fix UDC controller phandle in DT

The USB peripheral controller is the DWC2 controller 1, not 0.
Update the phandle to fix UDC support on this board.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tien Fong Chee <tien.fong.chee@intel.com>
3 years agoarm: socfpga: vining: Un-disable WDT in DT
Marek Vasut [Tue, 14 Sep 2021 03:25:33 +0000 (05:25 +0200)]
arm: socfpga: vining: Un-disable WDT in DT

The WDT on this system should be enabled, make it so.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tien Fong Chee <tien.fong.chee@intel.com>
3 years agoarm: socfpga: vining: Set default SPI NOR mode and frequency
Marek Vasut [Tue, 14 Sep 2021 03:25:32 +0000 (05:25 +0200)]
arm: socfpga: vining: Set default SPI NOR mode and frequency

The SPI NOR bus mode is 0 on this system, update it accordingly.
Increase frequency to 40 MHz and enable SFDP parsing, since the
flashes on this system support that and it is a huge performance
improvement.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tien Fong Chee <tien.fong.chee@intel.com>
3 years agoarm: socfpga: vining: Set USB gadget manufacturer to Softing with capital S
Marek Vasut [Tue, 14 Sep 2021 03:25:31 +0000 (05:25 +0200)]
arm: socfpga: vining: Set USB gadget manufacturer to Softing with capital S

This was configured in downstream, so it is likely that most of the
custom software used around the device depends on it. Make upstream
compatible.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tien Fong Chee <tien.fong.chee@intel.com>
3 years agoarm: socfpga: vining: Increase environment size
Marek Vasut [Tue, 14 Sep 2021 03:25:30 +0000 (05:25 +0200)]
arm: socfpga: vining: Increase environment size

Increase the environment size from 4k to 16k to prevent
environment from becoming full.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tien Fong Chee <tien.fong.chee@intel.com>
3 years agoarm: socfpga: vining: Drop meaningless comment
Marek Vasut [Tue, 14 Sep 2021 03:25:29 +0000 (05:25 +0200)]
arm: socfpga: vining: Drop meaningless comment

The comment is no longer meaningful due to DT conversion, drop it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tien Fong Chee <tien.fong.chee@intel.com>
3 years agousb: xhci-dwc3: Add support for USB 3.1 controllers
Mark Kettenis [Thu, 16 Sep 2021 14:00:09 +0000 (16:00 +0200)]
usb: xhci-dwc3: Add support for USB 3.1 controllers

This adds support for the DWC_sub31 controllers such as those
found on Apple's M1 SoC.  This version of the controller
seems to work fine with the existing driver.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
3 years agousb: ehci-mx6: use phy_type from device tree
Matthias Schiffer [Mon, 20 Sep 2021 13:37:25 +0000 (15:37 +0200)]
usb: ehci-mx6: use phy_type from device tree

Allow using different PHY interfaces for multiple USB controllers. When no
value is set in DT, we fall back to CONFIG_MXC_USB_PORTSC for now to stay
compatible with current board configurations.

This also adds support for the HSIC mode of the i.MX7.

Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
3 years agousb: ehci-ci: remove redundant PORTSC flag definitions
Matthias Schiffer [Mon, 20 Sep 2021 13:37:24 +0000 (15:37 +0200)]
usb: ehci-ci: remove redundant PORTSC flag definitions

These definitions are unused, all boards that define portsc flags use
the equivalent PORT_* definitions instead.

Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
3 years agoinclude/configs: replace MXC_EHCI_MODE_SERIAL with PORT_PTS_SERIAL
Matthias Schiffer [Mon, 20 Sep 2021 13:37:23 +0000 (15:37 +0200)]
include/configs: replace MXC_EHCI_MODE_SERIAL with PORT_PTS_SERIAL

The MXC_EHCI_MODE_ definitions are redundant. Replace MXC_EHCI_MODE_SERIAL
with the equivalent PORT_PTS_SERIAL.

Only the zmx25 platform is affected.

Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
3 years agousb: add support for ULPI/SERIAL/HSIC PHY modes
Matthias Schiffer [Mon, 20 Sep 2021 13:37:22 +0000 (15:37 +0200)]
usb: add support for ULPI/SERIAL/HSIC PHY modes

Import usb_phy_interface enum values and DT match strings from the Linux
kernel.

Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
3 years agoconfigs: Enable USB3 on Allwinner H6 boards
Samuel Holland [Mon, 5 Jul 2021 12:29:04 +0000 (13:29 +0100)]
configs: Enable USB3 on Allwinner H6 boards

Pine H64 and Orange Pi 3 both provide a USB3 type A port.
Enable it in U-Boot.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agousb: xhci-dwc3: Add support for clocks/resets
Samuel Holland [Mon, 5 Jul 2021 12:29:03 +0000 (13:29 +0100)]
usb: xhci-dwc3: Add support for clocks/resets

Some platforms, like the Allwinner H6, do not have a separate glue layer
around the dwc3. Instead, they rely on the clocks/resets/phys referenced
from the dwc3 DT node itself. Add support for enabling the clocks/resets
referenced from the dwc3 DT node.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agousb: xhci-pci: Move reset logic out of XHCI core
Samuel Holland [Mon, 5 Jul 2021 12:29:02 +0000 (13:29 +0100)]
usb: xhci-pci: Move reset logic out of XHCI core

Resetting an XHCI controller inside xhci_register undoes any register
setup performed by the platform driver. And at least on the Allwinner
H6, resetting the XHCI controller also resets the PHY, which prevents
the controller from working. That means the controller must be taken out
of reset before initializing the PHY, which must be done before calling
xhci_register.

The logic in the XHCI core was added to support the Raspberry Pi 4
(although this was not mentioned in the commit log!), which uses the
xhci-pci platform driver. Move the reset logic to the platform driver,
where it belongs, and where it cannot interfere with other platform
drivers.

This also fixes a failure to call reset_free if xhci_register failed.

Fixes: 0b80371b350e ("usb: xhci: Add reset controller support")
Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agophy: sun50i-usb3: Add a driver for the H6 USB3 PHY
Samuel Holland [Mon, 5 Jul 2021 12:29:01 +0000 (13:29 +0100)]
phy: sun50i-usb3: Add a driver for the H6 USB3 PHY

This driver is needed for XHCI to work on the Allwinner H6 SoC. The
driver is copied from Linux v5.10.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agox86: tangier: acpi: Add GPIO card detection to SDHCI #2
Andy Shevchenko [Sat, 11 Sep 2021 18:27:42 +0000 (21:27 +0300)]
x86: tangier: acpi: Add GPIO card detection to SDHCI #2

On Intel Tangier the SDHCI #2 provides SD card connection.
Add GPIO card detection for it.

Fixes: 39665beed6f7 ("x86: tangier: Enable ACPI support for Intel Tangier")
BugLink: https://github.com/edison-fw/meta-intel-edison/issues/135
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Bin Meng <bmeng.cn@gmail.com>
3 years agox86: edison: Mark eMMC non-removable
Andy Shevchenko [Fri, 10 Sep 2021 07:59:27 +0000 (10:59 +0300)]
x86: edison: Mark eMMC non-removable

eMMC is non-removable on Intel Edison board. Fix the DTS accordingly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
3 years agomtd: cfi_flash: use cfi_flash_num_flash_banks only when supported
Patrick Delaunay [Wed, 22 Sep 2021 16:29:07 +0000 (18:29 +0200)]
mtd: cfi_flash: use cfi_flash_num_flash_banks only when supported

When CONFIG_SYS_MAX_FLASH_BANKS_DETECT is activated,
CONFIG_SYS_MAX_FLASH_BANKS is replaced by cfi_flash_num_flash_banks,
but this variable is defined in drivers/mtd/cfi_flash.c, which is
compiled only when CONFIG_FLASH_CFI_DRIVER is activated, in U-Boot
or in SPL when CONFIG_SPL_MTD_SUPPORT is activated.

This patch deactivates this feature CONFIG_SYS_MAX_FLASH_BANKS_DETECT
when flash cfi driver is not activated to avoid compilation issue in
the next patch, when CONFIG_SYS_MAX_FLASH_BANKS is used in spi_nor_scan().

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agomtd: nand: raw: convert nand_dt_init() to ofnode_xx() interface
Patrice Chotard [Mon, 13 Sep 2021 14:25:53 +0000 (16:25 +0200)]
mtd: nand: raw: convert nand_dt_init() to ofnode_xx() interface

nand_dt_init() is still using fdtdec_xx() interface.
If OF_LIVE flag is enabled, dt property can't be get anymore.
Updating all fdtdec_xx() interface to ofnode_xx() to solve this issue.

For doing this, node parameter type must be ofnode.

First idea was to convert "node" parameter to ofnode type inside
nand_dt_init() using offset_to_ofnode(node). But offset_to_ofnode()
is not bijective, in case OF_LIVE flag is enabled, it performs an assert().

So, this leads to update nand_chip struct flash_node field from int to
ofnode and to update all nand_dt_init() callers.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agoi2c: mvtwsi: Add support for DM clocks and resets
Samuel Holland [Sun, 12 Sep 2021 15:21:39 +0000 (10:21 -0500)]
i2c: mvtwsi: Add support for DM clocks and resets

The controller may need to have clocks/resets enabled for it to work.
Add support for this. Since the clocks/resets are optional on some
platforms (per the device tree binding), do not prevent probing the
controller if they are missing.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
3 years agoi2c: rcar_i2c: Enable configuring SCL rise and fall times
Adam Ford [Tue, 24 Aug 2021 14:10:31 +0000 (09:10 -0500)]
i2c: rcar_i2c: Enable configuring SCL rise and fall times

The Linux i2c driver supports i2c-scl-rising-time-ns,
and i2c-scl-falling-time-ns, but U-Boot uses hard-coded values
for these values.

Update the calculation by fetching them from the device tree if
present and use the previous values as the default if they are
missing.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
3 years agoti: keystone: Migrate CONFIG_SOC_K2* to Kconfig
Tom Rini [Mon, 13 Sep 2021 00:32:33 +0000 (20:32 -0400)]
ti: keystone: Migrate CONFIG_SOC_K2* to Kconfig

Move the individual keystone 2 SoC symbols to the mach Kconfig file,
select them as needed.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoti: keystone: Move away from CONFIG_SOC_KEYSTONE
Tom Rini [Mon, 13 Sep 2021 00:32:32 +0000 (20:32 -0400)]
ti: keystone: Move away from CONFIG_SOC_KEYSTONE

We have individual SOC symbols for each keystone 2 platform.  Use the
existing CONFIG_ARCH_KEYSTONE rather than CONFIG_SOC_KEYSTONE to
encompass all of the keystone families.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoomap4_panda: Remove unused comments/code
Tom Rini [Mon, 13 Sep 2021 00:32:31 +0000 (20:32 -0400)]
omap4_panda: Remove unused comments/code

Clean up the config header file by removing some now irrelevant code /
comments.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoomap3_logic: Remove unused comments/code
Tom Rini [Mon, 13 Sep 2021 00:32:30 +0000 (20:32 -0400)]
omap3_logic: Remove unused comments/code

Clean up the config header file by removing some now irrelevant code /
comments.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoam3517_evm: Remove unused comments/code
Tom Rini [Mon, 13 Sep 2021 00:32:29 +0000 (20:32 -0400)]
am3517_evm: Remove unused comments/code

Clean up the config header file by removing some now irrelevant code /
comments.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoConvert CONFIG_OMAP_EHCI_PHY1_RESET_GPIO et al to Kconfig
Tom Rini [Mon, 13 Sep 2021 00:32:28 +0000 (20:32 -0400)]
Convert CONFIG_OMAP_EHCI_PHY1_RESET_GPIO et al to Kconfig

This converts the following to Kconfig:
   CONFIG_OMAP_EHCI_PHY1_RESET_GPIO
   CONFIG_OMAP_EHCI_PHY2_RESET_GPIO
   CONFIG_OMAP_EHCI_PHY3_RESET_GPIO

To do this, we also introduce CONFIG_HAS_CONFIG_OMAP_EHCI_PHYn_RESET_GPIO
options to get setting the GPIO number.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agousb: ehci-omap: Drop non-DM_USB legacy code
Tom Rini [Mon, 13 Sep 2021 00:32:27 +0000 (20:32 -0400)]
usb: ehci-omap: Drop non-DM_USB legacy code

Now that DM_USB is always enabled, we can drop some legacy code.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoomapl138_lcdk: Stop using CONFIG_MACH_OMAPL138_LCDK
Tom Rini [Mon, 13 Sep 2021 00:32:26 +0000 (20:32 -0400)]
omapl138_lcdk: Stop using CONFIG_MACH_OMAPL138_LCDK

We have one places that uses this symbol and CONFIG_TARGET_OMAPL138_LCDK
works equally well, switch to that.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoti: keystone: dma: Migrate to Kconfig
Tom Rini [Mon, 13 Sep 2021 00:32:25 +0000 (20:32 -0400)]
ti: keystone: dma: Migrate to Kconfig

Move the main option for handling drivers/dma/keystone_nav* to Kconfig,
and enable it by default.  All of the sub-symbols are not configurable,
so remove them from the CONFIG namespace.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoti: keystone: Clean up or migrate some NAND related options.
Tom Rini [Mon, 13 Sep 2021 00:32:24 +0000 (20:32 -0400)]
ti: keystone: Clean up or migrate some NAND related options.

The COFNIG_KEYSTONE_RBL_NAND option is always enabled for the driver on
keystone platforms, but not older davinci platforms.  Use def_bool for
the symbol. For CONFIG_KEYSTONE_NAND_MAX_RBL_PAGE, it's only used within
the driver and derived from another symbol, so remove CONFIG from the
name.  Finally, CONFIG_KEYSTONE_NAND_MAX_RBL_SIZE is a bit more fixed.
For now, use the value directly.  Long term, as part of DM'ifying NAND,
this should come from the device tree.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agocompulab: Clean up some unused symbols
Tom Rini [Mon, 13 Sep 2021 00:32:23 +0000 (20:32 -0400)]
compulab: Clean up some unused symbols

Since cm_t35 was removed, CONFIG_CM_T3X does not exist.  This lets us
simplify the code in board/compulab/common/eeprom.c a bit.

Cc: Igor Grinberg <grinberg@compulab.co.il>
Cc: Nikita Kiryanov <nikita@compulab.co.il>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoConvert CONFIG_USB_XHCI_OMAP to Kconfig
Tom Rini [Mon, 13 Sep 2021 00:32:22 +0000 (20:32 -0400)]
Convert CONFIG_USB_XHCI_OMAP to Kconfig

This converts the following to Kconfig:
   CONFIG_USB_XHCI_OMAP

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agousb: phy: ti: Remove non-DM PHY code
Tom Rini [Mon, 13 Sep 2021 00:32:21 +0000 (20:32 -0400)]
usb: phy: ti: Remove non-DM PHY code

At this point in time, all platforms that had previously used
drivers/usb/phy/omap_usb_phy.c have been migrated to DM and related
options.  Remove this now unused code and some related unused defines.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agokeystone2: Move CONFIG_AEMIF_CNTRL_BASE out of CONFIG namespace
Tom Rini [Mon, 13 Sep 2021 00:32:20 +0000 (20:32 -0400)]
keystone2: Move CONFIG_AEMIF_CNTRL_BASE out of CONFIG namespace

This is only used in the aemif driver that is otherwise currently
keystone2 centric.  Moving forward, if this is applicable to some other
platform then such base addresses should be able to be obtained via the
device tree.  Use KS2_AEMIF_CNTRL_BASE directly now rather than
indirectly.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agodoc: ti: am335x_evm: Minor general updates
Tom Rini [Sat, 11 Sep 2021 12:57:32 +0000 (08:57 -0400)]
doc: ti: am335x_evm: Minor general updates

- At this point there are a large number of Beaglebone boards, refer to
  them as a family rather than a growing list.
- Reword customization as we're largely Kconfig-oriented now.
- Remove the NOR section as the relevant defconfigs have long been
  removed and the general support was not updated.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agodoc: ti: Convert am335x_evm README to rST
Tom Rini [Sat, 11 Sep 2021 12:57:31 +0000 (08:57 -0400)]
doc: ti: Convert am335x_evm README to rST

Convert the existing documentation to rST, keeping to just making
formatting changes to start with.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge tag 'dm-pull-next-27sep21' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Mon, 27 Sep 2021 15:09:23 +0000 (11:09 -0400)]
Merge tag 'dm-pull-next-27sep21' of https://source.denx.de/u-boot/custodians/u-boot-dm into next

Various of-platdata improvements, including CONFIG_OF_REAL

3 years agoMerge tag 'v2021.10-rc5' into next
Tom Rini [Mon, 27 Sep 2021 13:45:36 +0000 (09:45 -0400)]
Merge tag 'v2021.10-rc5' into next

Prepare v2021.10-rc5

3 years agoPrepare v2021.10-rc5
Tom Rini [Mon, 27 Sep 2021 13:34:20 +0000 (09:34 -0400)]
Prepare v2021.10-rc5

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Mon, 27 Sep 2021 11:41:03 +0000 (07:41 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- turris_omnia: fix leaked mtd device (Marek)
- phy: marvell: cp110: Fix SATA invert polarity (Denis)

3 years agophy: marvell: cp110: Support SATA invert polarity
Denis Odintsov [Wed, 15 Sep 2021 13:45:31 +0000 (15:45 +0200)]
phy: marvell: cp110: Support SATA invert polarity

In commit b24bb99d cp110 configuration initially done in u-boot
was removed and delegated to atf firmware as smc call.
That commit didn't account for later introduced in d13b740c SATA invert polarity support.

This patch adds support of passing SATA invert polarity flags to atf
firmware during the smc call.

Signed-off-by: Denis Odintsov <shiva@mail.ru>
Cc: Baruch Siach <baruch@tkos.co.il>
Cc: Rabeeh Khoury <rabeeh@solid-run.com>
Cc: Stefan Roese <sr@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: turris_omnia: fix leaked mtd device
Marek Behún [Sat, 25 Sep 2021 00:49:18 +0000 (02:49 +0200)]
arm: mvebu: turris_omnia: fix leaked mtd device

After getting MTD device via get_mtd_device_nm(), we need to put it with
put_mtd_device(), otherwise we get

  Removing MTD device #0 (mx25l6405d) with use count 1

before booting kernel.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Pali Rohár <pali@kernel.org>
Tested-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoMerge tag 'efi-2021-10-rc5' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 26 Sep 2021 18:15:14 +0000 (14:15 -0400)]
Merge tag 'efi-2021-10-rc5' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2021-10-rc5

Documentation:

* add /config bindings to HTML documentation

UEFI

* Fix number_of_algorithms field in TCG EFI Protocol

3 years agofdt_support.h: Remove duplicated declarations
Bin Meng [Sat, 18 Sep 2021 09:37:23 +0000 (17:37 +0800)]
fdt_support.h: Remove duplicated declarations

There are two duplicated declarations for ft_cpu_setup() and
ft_pci_setup().

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
3 years agodm: pci: Fix handling of errors when scanning device
Pali Rohár [Tue, 7 Sep 2021 16:07:08 +0000 (18:07 +0200)]
dm: pci: Fix handling of errors when scanning device

Some PCIe controller's read_config() method support indicating error
directly via return value, but some cannot distinguish all-ones (or
all-zeros) read response from an error.

The current code in pci_bind_bus_devices() interprets all-ones /
all-zeros in PCI_VENDOR_ID register as "nothing connected", and
continues the cycle, but an error returned via return value breaks the
cycle.

This is wrong for the PCIe controllers which return this error via
return value.

Handle all errors when reading PCI_VENDOR_ID the same way.

This fixes enumeration of PCI devices for example when there is a PCI
bridge connected behind another PCI bridge and not all ports are
connected to a device, and the controller (for example Aardvark)
translates the UR error (Unsupported Request) as -EOPNOTSUPP.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agosandbox: correct cpu nodes
Heinrich Schuchardt [Sat, 28 Aug 2021 09:42:08 +0000 (11:42 +0200)]
sandbox: correct cpu nodes

The cpu nodes in arch/sandbox/dts/test.dts should conform to the devicetree
specification:

* property device_type must be set to "cpu"
* the reg property must be provided
* the cpu nodes must have an address

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agodm: gpio: Add of-platdata support
Simon Glass [Sat, 7 Aug 2021 13:24:12 +0000 (07:24 -0600)]
dm: gpio: Add of-platdata support

Add support for accessing GPIOs using of-plata. This uses the same
mechanism as for clocks, but allows use of the xlate() method so that
the driver can interpret the parameters.

Update the condition for GPIO_HOG so that it is not built into SPL,
since it needs SPL_OF_REAL which is not enabled in sandbox_spl.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoirq: Tidy up of-platdata irq support
Simon Glass [Sat, 7 Aug 2021 13:24:11 +0000 (07:24 -0600)]
irq: Tidy up of-platdata irq support

This function is available but not exported. More generally it does not
really work as intended.

Reimplement it and add a sandbox test too.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agodm: doc: Add a note about of-platdata header files
Simon Glass [Sat, 7 Aug 2021 13:24:10 +0000 (07:24 -0600)]
dm: doc: Add a note about of-platdata header files

This error can be confusing so mention it specifically in the
documentation.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoclk: Rename clk_get_by_driver_info()
Simon Glass [Sat, 7 Aug 2021 13:24:09 +0000 (07:24 -0600)]
clk: Rename clk_get_by_driver_info()

This is actually a misnomer now, since the phandle info may contain
a driver_info index or a udevice index. Rename it to use the word
'phandle', which seems more accurate. Add a comment while we are here.

Also add a test for this function.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agodm: Add comments to dt-structs contents
Simon Glass [Sat, 7 Aug 2021 13:24:08 +0000 (07:24 -0600)]
dm: Add comments to dt-structs contents

These structs do not have comments at present. Add them.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agofdt: Update Makefile rules with the new OF_REAL Kconfig
Simon Glass [Sat, 7 Aug 2021 13:24:07 +0000 (07:24 -0600)]
fdt: Update Makefile rules with the new OF_REAL Kconfig

Simplify some of the Makefile rules using this Kconfig.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agotreewide: Try to avoid the preprocessor with OF_REAL
Simon Glass [Sat, 7 Aug 2021 13:24:06 +0000 (07:24 -0600)]
treewide: Try to avoid the preprocessor with OF_REAL

Convert some of these occurences to C code, where it is easy to do. This
should help encourage this approach to be used in new code.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agommc: nds32: ftsdc010: Convert to livetree
Simon Glass [Sat, 7 Aug 2021 13:24:05 +0000 (07:24 -0600)]
mmc: nds32: ftsdc010: Convert to livetree

Use the livetree API for this driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Rick Chen <rick@andestech.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agotreewide: Use OF_REAL instead of !OF_PLATDATA
Simon Glass [Sat, 7 Aug 2021 13:24:04 +0000 (07:24 -0600)]
treewide: Use OF_REAL instead of !OF_PLATDATA

Now that we have a 'positive' Kconfig option, use this instead of the
negative one, which is harder to understand.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agotreewide: Simply conditions with the new OF_REAL
Simon Glass [Sat, 7 Aug 2021 13:24:03 +0000 (07:24 -0600)]
treewide: Simply conditions with the new OF_REAL

Use this new Kconfig to simplify the compilation conditions where
appropriate.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agofdt: Create a new OF_REAL Kconfig
Simon Glass [Sat, 7 Aug 2021 13:24:02 +0000 (07:24 -0600)]
fdt: Create a new OF_REAL Kconfig

The condition to indicate whether there is a runtime devicetree available
is OF_CONTROL && !OF_PLATDATA. This is a bit unweidly and is repeated in
a lot of places.

Add a new OF_REAL Kconfig which provides this information directly.

Note: This is similar in effect to LIBFDT. We might consider dropping
LIBFDT and using this instead, but this is left for now as we also have
OF_LIBFDT_OVERLAY which it would not make sense to change.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agotreewide: fdt: Move fdt_get_config_... to ofnode_conf_read...
Simon Glass [Sat, 7 Aug 2021 13:24:01 +0000 (07:24 -0600)]
treewide: fdt: Move fdt_get_config_... to ofnode_conf_read...

The current API is outdated as it requires a devicetree pointer.

Move these functions to use the ofnode API and update this globally. Add
some tests while we are here.

Correct the call in exynos_dsim_config_parse_dt() which is obviously
wrong.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoefi_loader: Fix spec ID event creation
Ruchika Gupta [Tue, 14 Sep 2021 06:44:31 +0000 (12:14 +0530)]
efi_loader: Fix spec ID event creation

TCG EFI Protocol Specification defines the number_of_algorithms
field in spec ID event to be equal to the number of active
algorithms supported by the TPM device. In current implementation,
this field is populated with the count of all algorithms supported
by the TPM which leads to incorrect spec ID event creation.

Similarly, the algorithm array in spec ID event should be a variable
length array with length being equal to the number_of_algorithms field.
In current implementation this is defined as a fixed length array
which has been fixed.

Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org>
CC: Masahisa Kojima <masahisa.kojima@linaro.org>
CC: Ilias Apalodimas <ilias.apalodimas@linaro.org>
CC: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 years agodoc: Add mention of the /config binding
Simon Glass [Sun, 19 Sep 2021 21:51:10 +0000 (15:51 -0600)]
doc: Add mention of the /config binding

The devicetree binding files are in their own directory and use a simple
text format. Add a link for the binding for the /config node, since it
is otherwise hard to find.

Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agovexpress_ca9x4: Add missing SYS_LOAD_ADDR
Tom Rini [Sat, 25 Sep 2021 02:12:35 +0000 (22:12 -0400)]
vexpress_ca9x4: Add missing SYS_LOAD_ADDR

- Add missing CONFIG_SYS_LOAD_ADDR based on other platforms
- Resync

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge branch '2021-09-24-assorted-updates' into next
Tom Rini [Sat, 25 Sep 2021 00:35:50 +0000 (20:35 -0400)]
Merge branch '2021-09-24-assorted-updates' into next

- A few minor updates