platform/kernel/u-boot.git
3 years agonet: eth-phy: define LOG_CATEGORY
Patrick Delaunay [Tue, 20 Jul 2021 18:15:28 +0000 (20:15 +0200)]
net: eth-phy: define LOG_CATEGORY

Define LOG_CATEGORY to allow filtering with log command.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: dwc: add a common empty ops eqos_null_ops
Patrick Delaunay [Tue, 20 Jul 2021 18:09:56 +0000 (20:09 +0200)]
net: dwc: add a common empty ops eqos_null_ops

Add a common empty ops: eqos_null_ops() to remove the duplicated empty
functions and reduce the driver size for stm32 and imx config.

This patch also aligns the prototype of ops 'eqos_stop_clks' with other
eqos ops by adding return value.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agonet: dwc_eth_qos: use generic ethernet phy for stm32 variant
Patrick Delaunay [Tue, 20 Jul 2021 18:09:55 +0000 (20:09 +0200)]
net: dwc_eth_qos: use generic ethernet phy for stm32 variant

Use the generic ethernet phy which already manages the correct binding
for gpio reset, including the assert an deassert delays.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agonet: dwc_eth_qos: remove the field phyaddr of the struct eqos_priv
Patrick Delaunay [Tue, 20 Jul 2021 18:09:54 +0000 (20:09 +0200)]
net: dwc_eth_qos: remove the field phyaddr of the struct eqos_priv

Since the commit commit 6a895d039ba7 ("net: Update eQos driver and FEC
driver to use eth phy interfaces") the field phyaddr of driver private data
struct eqos_priv is no more used in eqos_start() for the phy_connect()
parameter.

Now this variable is only initialized in eqos_probe_resources_stm32()
it can be removed.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agonet: eth-phy: manage subnode mdio0
Patrick Delaunay [Tue, 20 Jul 2021 18:09:53 +0000 (20:09 +0200)]
net: eth-phy: manage subnode mdio0

Bind any subnode with name beginning by mdio, mdio0 for example,
and not only the "mdio" as namei of subnode.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agonet: eth-phy: use dev_dbg and log_notice
Patrick Delaunay [Tue, 20 Jul 2021 18:09:52 +0000 (20:09 +0200)]
net: eth-phy: use dev_dbg and log_notice

Replace debug trace and printf to log macros:
- debug() replaced by dev_dbg() when device is available, this macro
indicate the device name since commit ceb70bb870ac ("dm: Print device
name in dev_xxx like Linux")
- printf() replaced by log_notice() to allow  dispatch to log backends.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agonet: eth-phy: add support of device tree configuration for gpio reset
Patrick Delaunay [Tue, 20 Jul 2021 18:09:51 +0000 (20:09 +0200)]
net: eth-phy: add support of device tree configuration for gpio reset

The gpio reset and the assert or deassert delay are defined in generic
binding of the ethernet phy in Linux:
Documentation/devicetree/bindings/net/ethernet-phy.yaml

  reset-gpios:
    maxItems: 1
    description:
      The GPIO phandle and specifier for the PHY reset signal.

  reset-assert-us:
    description:
      Delay after the reset was asserted in microseconds. If this
      property is missing the delay will be skipped.

  reset-deassert-us:
    description:
      Delay after the reset was deasserted in microseconds. If
      this property is missing the delay will be skipped.

See also U-Boot: doc/device-tree-bindings/net/phy.txt

This patch adds the parsing of this common DT properties in the
u-class "eth_phy_generic", used by default in the associated driver
"eth_phy_generic_drv"

This parsing function eth_phy_of_to_plat can be reused by other
ethernet phy drivers for this uclass UCLASS_ETH_PHY.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: Use phys_addr_t for SMC net device addresses
Peter Hoyes [Fri, 9 Jul 2021 09:52:06 +0000 (10:52 +0100)]
net: Use phys_addr_t for SMC net device addresses

Use same type as eth_device->iobase and support addresses greater
than INT_MAX.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
3 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq
Tom Rini [Thu, 22 Jul 2021 12:45:32 +0000 (08:45 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq

fsl-qoriq: Update mc firmware size, address in LS1088A, LS2088A, LX2
Updates on ls1043aqds, ls1043ardb
Refactor I2C MUX Code on fsl-qoriq platforms.

3 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Thu, 22 Jul 2021 02:46:18 +0000 (22:46 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv

3 years agoboard: sifive: unmatched: reset USB hub, PCIe-USB bridge, and ULPI device in SPL
Vincent Chen [Thu, 8 Jul 2021 01:08:21 +0000 (09:08 +0800)]
board: sifive: unmatched: reset USB hub, PCIe-USB bridge, and ULPI device in SPL

Ensure USB hub, PCIe-USB bridge, and ULPI device to be reset
even if the rebooting is without power-cycling.

Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
3 years agoboard: sifive: unmatched: refine GEMGXL initialized function in SPL
Vincent Chen [Thu, 8 Jul 2021 01:08:20 +0000 (09:08 +0800)]
board: sifive: unmatched: refine GEMGXL initialized function in SPL

Create a new function spl_reset_device_by_gpio to reset the device
whose reset pin is connected to the GPIO. Then, using this function
to initialize GEMGXL.

Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
3 years agoboard: sifive: drop stuff related to unmatched revision 1
Zong Li [Tue, 20 Jul 2021 06:26:08 +0000 (14:26 +0800)]
board: sifive: drop stuff related to unmatched revision 1

This patch reverts the following commits:
 - 4b4159d0f3 ("riscv: dts: add dts for unmatched rev1")
 - ffe9a394df ("board: sifive: support spl multi-dtb on unmatched board")

We won't plan to support unmatched that the revision below 3 in u-boot,
so they can be dropped because they might be useless.

Changed in v2:
 - rebase codebase to the latest master branch

Signed-off-by: Zong Li <zong.li@sifive.com>
Suggested-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
3 years agoriscv: booti: do not force relocation if force_reloc is not set
Vitaly Wool [Tue, 6 Apr 2021 07:50:16 +0000 (10:50 +0300)]
riscv: booti: do not force relocation if force_reloc is not set

If force_reloc flag is not set and booti is called for an address
ouside RAM (i. e. QSPI NOR flash), we should honor that and not try
to force relocation in a bogus fashion.

Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
3 years agoboard: sifive: remove the command for setting serial number
Zong Li [Fri, 9 Jul 2021 08:26:35 +0000 (16:26 +0800)]
board: sifive: remove the command for setting serial number

We wouldn't like to allow user to change the serial number, so remove
the command for changing serial number in EEPROM.

Signed-off-by: Zong Li <zong.li@sifive.com>
Suggested-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
3 years agoMerge branch 'master' of git://source.denx.de/u-boot-sh
Tom Rini [Tue, 20 Jul 2021 23:31:40 +0000 (19:31 -0400)]
Merge branch 'master' of git://source.denx.de/u-boot-sh

- R-Car3 updates

3 years agoARM: dts: rmobile: Remove multiple unused DT properties on R-Car Gen3
Marek Vasut [Sat, 10 Jul 2021 17:17:34 +0000 (19:17 +0200)]
ARM: dts: rmobile: Remove multiple unused DT properties on R-Car Gen3

Filter out dmas dma-names interrupt-parent interrupts interrupts-extended
interrupt-names interrupt-map interrupt-map-mask iommus DT properties on
R-Car Gen3, since they are not used by U-Boot and only take space.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agoARM: dts: rmobile: Disable RPC HF by default
Marek Vasut [Sat, 10 Jul 2021 16:56:29 +0000 (18:56 +0200)]
ARM: dts: rmobile: Disable RPC HF by default

The RPC HF might be locked by ATF, and any access to its register
space would result in complete hang. Disable the RPC HF by default.
The ATF should be patched to set RPC node status = "okay" in the DT
fragment it passes to U-Boot in case the RPC HF access is unlocked,
and that way U-Boot could access the RPC HF safely.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agoARM: rmobile: Align CPU: print with other prints
Marek Vasut [Sun, 4 Jul 2021 15:27:27 +0000 (17:27 +0200)]
ARM: rmobile: Align CPU: print with other prints

The CPU: print only has one space after it, while the other prints
from U-Boot align the value to offset 7. Align the CPU: print too.
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agoARM: rmobile: Enable sysinfo on R-Car Gen3
Marek Vasut [Sat, 3 Jul 2021 18:41:50 +0000 (20:41 +0200)]
ARM: rmobile: Enable sysinfo on R-Car Gen3

Enable support for sysinfo on supported R-Car Gen3 boards. The sysinfo
is used e.g. to access and decode board-specific information and then
in turn used by board-info to print those information. On R-Car Gen3
the sysinfo rcar3 driver is used to parse the board ID EEPROM, obtain
board type and revision from it, and let board-info print this
information on boot.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agoARM: rmobile: Enable I2C EEPROM support on R-Car Gen3
Marek Vasut [Sat, 3 Jul 2021 18:39:28 +0000 (20:39 +0200)]
ARM: rmobile: Enable I2C EEPROM support on R-Car Gen3

Enable support for I2C EEPROM driver on supported Renesas R-Car Gen3 boards.
This is useful for accessing the board ID EEPROM.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agoARM: dts: rmobile: Add sysinfo extras on R-Car Gen3
Marek Vasut [Sat, 3 Jul 2021 16:16:14 +0000 (18:16 +0200)]
ARM: dts: rmobile: Add sysinfo extras on R-Car Gen3

Add sysinfo node and phandle to the board ID EEPROM on all boards
where this functionality is described in DT, which is Salvator-X(S),
ULCB and Ebisu. The u-boot,dm-pre-reloc is necessary here, since the
sysinfo must be available early during boot. The V3M and V3H boards
currently do not describe this board ID EEPROM in upstream DT, but
that could be easily added later, once the DTs contain the necessary
nodes.

ULCB and Ebisu needs the full EEPROM node in the u-boot extras DT,
since the EEPROM node is still missing in the upstream DTs. Ebisu
also needs extra compatible string override for the i2c_dvfs.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agosysinfo: rcar3: Add Renesas R-Car Gen3 sysinfo driver
Marek Vasut [Sat, 3 Jul 2021 18:38:26 +0000 (20:38 +0200)]
sysinfo: rcar3: Add Renesas R-Car Gen3 sysinfo driver

The Renesas R-Car Gen3 development kits contain board ID EEPROM.
This driver parses out the board ID and revision out of that
EEPROM and exports it e.g. for the board-info print on boot.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Sean Anderson <sean.anderson@seco.com>
Cc: Simon Glass <sjg@chromium.org>
3 years agoconfigs: ls2080ardb.h: Update mc size in env
Priyanka Jain [Mon, 19 Jul 2021 09:37:49 +0000 (15:07 +0530)]
configs: ls2080ardb.h: Update mc size in env

Set MC Firmware size in read commands in
env to 2MB.
Update DDR Memory read address for MC firmware to
0x80a00000 and MC DPC address to 0x80e00000.

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoconfigs: ls2080aqds.h: Update mc size in env
Priyanka Jain [Mon, 19 Jul 2021 09:24:25 +0000 (14:54 +0530)]
configs: ls2080aqds.h: Update mc size in env

Set MC Firmware size in read commands in
env to 2MB.
Update DDR Memory read address for MC firmware to
0x80a00000 and MC DPC address to 0x80e00000.

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoconfigs: ls1088ardb.h: Update mc size in env
Priyanka Jain [Mon, 19 Jul 2021 09:23:34 +0000 (14:53 +0530)]
configs: ls1088ardb.h: Update mc size in env

Set MC Firmware size in read commands in
env to 2MB.
Update DDR Memory read address for MC firmware to
0x80a00000 and MC DPC address to 0x80e00000.

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoconfigs: ls1088aqds.h: Update mc size in env
Priyanka Jain [Mon, 19 Jul 2021 09:21:24 +0000 (14:51 +0530)]
configs: ls1088aqds.h: Update mc size in env

Set MC Firmware size in read commands in
env to 2MB.
Update DDR Memory read address for MC firmware to
0x80a00000 and MC DPC address to 0x80e00000.

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoconfigs: ls1043aqds: Configure environment related configs
Kuldeep Singh [Wed, 7 Jul 2021 06:40:24 +0000 (12:10 +0530)]
configs: ls1043aqds: Configure environment related configs

LS1043A-QDS board requires updation in few environment configs in TFA
and QSPI defconfigs.

Following are the changes:
- Define CONFIG_ENV_ADDR
- Unset CONFIG_SPI_FLASH_BAR
- Enable CONFIG_SYS_RELOC_GD_ENV_ADDR

Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: LX2162AQDS: Add MAINTAINER
Wasim Khan [Mon, 28 Jun 2021 12:14:52 +0000 (14:14 +0200)]
board: freescale: LX2162AQDS: Add MAINTAINER

Add "Wasim Khan <wasim.khan@nxp.com>" as MAINTAINER
for LX2162AQDS board

Signed-off-by: Wasim Khan <wasim.khan@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: LX2160AQDS: Add MAINTAINER
Wasim Khan [Mon, 28 Jun 2021 12:14:51 +0000 (14:14 +0200)]
board: freescale: LX2160AQDS: Add MAINTAINER

Add "Wasim Khan <wasim.khan@nxp.com>" as MAINTAINER
for LX2160AQDS board

Signed-off-by: Wasim Khan <wasim.khan@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: LX2160ARDB: Add MAINTAINER
Wasim Khan [Mon, 28 Jun 2021 12:14:50 +0000 (14:14 +0200)]
board: freescale: LX2160ARDB: Add MAINTAINER

Add "Wasim Khan <wasim.khan@nxp.com>" as MAINTAINER
for LX2160ARDB board

Signed-off-by: Wasim Khan <wasim.khan@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoconfigs: ls1046ardb: enable PHY_FIXED
Camelia Groza [Thu, 17 Jun 2021 15:19:32 +0000 (18:19 +0300)]
configs: ls1046ardb: enable PHY_FIXED

The optical 10G port is described as fixed-link in the device tree. Enable
the necessary support.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoarmv8: lx2160ardb: Add thermal node fixup for revc board
Wasim Khan [Thu, 17 Jun 2021 07:12:59 +0000 (09:12 +0200)]
armv8: lx2160ardb: Add thermal node fixup for revc board

lx2160ardb Rev-C board has i2c node for thermal monitors
connected to different chip offset.
Add device tree fixup to use lx2160ardb dts and apply
thermal node fixups for lx2160ardb Rev-C board.

Signed-off-by: Wasim Khan <wasim.khan@nxp.com>
[sp:thernal->thermal]
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoarm: dts: ls1043ardb: configure the RGMII ports with rgmii-id
Camelia Groza [Wed, 16 Jun 2021 13:22:12 +0000 (16:22 +0300)]
arm: dts: ls1043ardb: configure the RGMII ports with rgmii-id

The RGMII ports on LS1043ARDB platforms require both RX and TX internal
delays to be enabled. The device tree reports only the TX ID because the
RX ID used to be enabled by default.

With the addition of RX ID support for the Realtek 8211F PHY driver in
commit e32e4d0f58cb ("net: phy: realtek: add rx delay support for
RTL8211F"), the RX ID is disabled by the driver if not reported explicitly.
This causes the RX to no longer work.

Change the phy-connection-type for the RGMII ports to "rgmii-id" in order
to enable both RX and TX internal delays.

Fixes: be1d75896996 ("ARM: dts: add QorIQ DPAA 1 FMan v3 to LS1043ARDB")
Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: t2080qds: Update I2C mux config
Stephen Carlson [Tue, 22 Jun 2021 23:43:48 +0000 (16:43 -0700)]
board: freescale: t2080qds: Update I2C mux config

Updates the board configuration to enable use of the PCA9547 I2C mux.

Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: lx2160a: Update I2C mux config
Stephen Carlson [Tue, 22 Jun 2021 23:43:03 +0000 (16:43 -0700)]
board: freescale: lx2160a: Update I2C mux config

Updates the board configuration to enable use of the PCA9547 I2C mux.

Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: ls2080a, ls2088a: Update I2C mux config
Stephen Carlson [Tue, 22 Jun 2021 23:42:02 +0000 (16:42 -0700)]
board: freescale: ls2080a, ls2088a: Update I2C mux config

Updates the board configuration to enable use of the PCA9547 I2C mux.

Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com>
[Squashed ls2088a patch to fix compilation]
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: ls1088a: Update I2C mux config
Stephen Carlson [Tue, 22 Jun 2021 23:41:38 +0000 (16:41 -0700)]
board: freescale: ls1088a: Update I2C mux config

Updates the board configuration to enable use of the PCA9547 I2C mux.

Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: ls1046a: Update I2C mux config
Stephen Carlson [Tue, 22 Jun 2021 23:40:27 +0000 (16:40 -0700)]
board: freescale: ls1046a: Update I2C mux config

Updates the board configuration to enable use of the PCA9547 I2C mux.

Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: ls1043aqds: Update I2C mux config
Stephen Carlson [Tue, 22 Jun 2021 23:39:31 +0000 (16:39 -0700)]
board: freescale: ls1043aqds: Update I2C mux config

Updates the board configuration to enable use of the PCA9547 I2C mux.

Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: ls1021aqds: Update I2C mux config
Stephen Carlson [Tue, 22 Jun 2021 23:38:21 +0000 (16:38 -0700)]
board: freescale: ls1021aqds: Update I2C mux config

Updates the board configuration to enable use of the PCA9547 I2C mux.

Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: Refactor NXP common mux code
Stephen Carlson [Tue, 22 Jun 2021 23:35:20 +0000 (16:35 -0700)]
board: freescale: Refactor NXP common mux code

Refactors similar mux code from multiple NXP boards into a common location,
and allows it to be disabled in config.

New config: CONFIG_FSL_USE_PCA9547_MUX to enable PCA9547 mux functionality.

Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Mon, 19 Jul 2021 12:41:04 +0000 (08:41 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- Marvell SheevaPlug: Convert Ethernet and SATA to Driver Model (Tony)
- Zyxel NSA310S NAS: Convert to Driver Model (Tony)
- Turris_omnia: Add `u-boot-env` NOR partition (Marek)
- Turris_omnia: Fixup MTD partitions in Linux' DTB (Marek)
- Espressobin: Enable 'mtd' command and define SPI NOR partitions (Pali)

3 years agoMerge tag 'ti-v2021.10-rc1' of https://source.denx.de/u-boot/custodians/u-boot-ti
Tom Rini [Mon, 19 Jul 2021 12:29:24 +0000 (08:29 -0400)]
Merge tag 'ti-v2021.10-rc1' of https://source.denx.de/u-boot/custodians/u-boot-ti

- Enabled distro boot for all TI platforms.
- Cleanup for AM335x Guardian Board
- PRUSS rproc on AM65 platform.
- Add PMIC support for J7200
- Misc fixes for Nokia RX-51

# Conflicts:
# arch/arm/mach-omap2/am33xx/Kconfig

3 years agoarm: mvebu: Espressobin: Enable 'mtd' command and define SPI NOR partitions
Pali Rohár [Fri, 16 Jul 2021 10:34:42 +0000 (12:34 +0200)]
arm: mvebu: Espressobin: Enable 'mtd' command and define SPI NOR partitions

U-Boot now supports parsing SPI NOR partitions from Device Tree. So enable
'mtd' command support for Espressobin board and define partition layout in
U-Boot Espressobin DTS file. Access to SPI NOR via 'sf' command is old
method and 'mtd' command is now preferred variant.

From include file remove '#define CONFIG_MTD_PARTITIONS' as this option is
now defined and enabled in defconfig file. This change is required to fix
compile error:

      CC      arch/arm/lib/asm-offsets.s
    In file included from include/config.h:4,
                     from include/common.h:16,
                     from lib/asm-offsets.c:14:
    include/configs/mvebu_armada-37xx.h:63: warning: "CONFIG_MTD_PARTITIONS" redefined
     #define CONFIG_MTD_PARTITIONS  /* required for UBI partition support */

    In file included from ././include/linux/kconfig.h:4,
                     from <command-line>:
    include/generated/autoconf.h:44: note: this is the location of the previous definition
     #define CONFIG_MTD_PARTITIONS 1

After enabling support for mtd command, output from 'mtd list' on
Espressobin board is:

    => mtd list
    List of MTD devices:
    * w25q32dw
      - device: spi-flash@0
      - parent: spi@10600
      - driver: jedec_spi_nor
      - path: /soc/internal-regs/spi@10600/spi-flash@0
      - type: NOR flash
      - block size: 0x1000 bytes
      - min I/O: 0x1 bytes
      - 0x000000000000-0x000000400000 : "w25q32dw"
              - 0x000000000000-0x0000003f0000 : "firmware"
              - 0x0000003f0000-0x000000400000 : "u-boot-env"
    =>

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB
Marek Behún [Thu, 15 Jul 2021 17:21:02 +0000 (19:21 +0200)]
arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB

Fixup SPI NOR partition nodes in Linux' device tree prior booting Linux.

Linux' devicetree does not contain "u-boot-env" partition and we do not
want to add it there because the address is different between stock
U-Boot and current upstream U-Boot.

Instead we add code that recreates partition nodes from scratch
according to how U-Boot sees them (which is defined in U-Boot's device
tree).

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoARM: dts: armada-385-turris-omnia: add `u-boot-env` NOR partition
Marek Behún [Thu, 15 Jul 2021 17:21:01 +0000 (19:21 +0200)]
ARM: dts: armada-385-turris-omnia: add `u-boot-env` NOR partition

Specify a separate partition `u-boot-env` for U-Boot's env settings for
the Turris Omnia board.

Do this only in U-Boot's specific DTS. We do not want to do this in
Linux' official DTS, because Omnia's stock U-Boot stores env at a
different address, and there are still boards with stock U-Boot.

In a subsequent patch will add board code that fixes Linux's DTB before
booting Linux.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: kirkwood: Marvell Sheevaplug: Use Ethernet PHY name and address from device...
Tony Dinh [Fri, 16 Jul 2021 09:18:04 +0000 (02:18 -0700)]
arm: kirkwood: Marvell Sheevaplug: Use Ethernet PHY name and address from device tree

- In DM Ethernet, the old "egiga0" name is no longer valid, so replace it
with Ethernet PHY name from device tree. Also, Ethernet PHY address
is available so read it from device tree.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
3 years agoarm: kirkwood: Marvell Sheevaplug: Add DM SATA and remove IDE configs
Tony Dinh [Wed, 14 Jul 2021 04:35:46 +0000 (21:35 -0700)]
arm: kirkwood: Marvell Sheevaplug: Add DM SATA and remove IDE configs

Enable DM SATA, removed IDE driver, and add SATA MV driver.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
3 years agoarm: kirkwood: Marvell Sheevaplug: Add DM Ethernet and DM SATA configs
Tony Dinh [Wed, 14 Jul 2021 04:35:44 +0000 (21:35 -0700)]
arm: kirkwood: Marvell Sheevaplug: Add DM Ethernet and DM SATA configs

Add DM_ETH, SATA_MV and associated configs to sheevaplug_defconfig

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
3 years agoarm: kirkwood: NSA310S: Use Ethernet PHY name from device tree
Tony Dinh [Wed, 7 Jul 2021 09:06:47 +0000 (02:06 -0700)]
arm: kirkwood: NSA310S: Use Ethernet PHY name from device tree

In DM Ethernet, the old "egiga0" name is no longer valid, so replace it
with Ethernet PHY name from device tree. Also, Ethernet PHY address
is available so read it from device tree.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
3 years agoarm: kirkwood: NSA310S: Add DM SATA configs
Tony Dinh [Sat, 3 Jul 2021 03:08:14 +0000 (20:08 -0700)]
arm: kirkwood: NSA310S: Add DM SATA configs

Enable DM SATA, removed IDE driver, and add SATA MV driver.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
3 years agoarm: kirkwood: NSA310S: Add DM USB, DM Ethernet, and DM SATA configs
Tony Dinh [Thu, 1 Jul 2021 04:26:23 +0000 (21:26 -0700)]
arm: kirkwood: NSA310S: Add DM USB, DM Ethernet, and DM SATA configs

Convert to Driver Model.

- Add DM USB, DM Ethernet, and DM SATA configs to nsa310s_defconfig
- Add CONFIG_DEFAULT_DEVICE_TREE to nsa310s_defconfig
- Move CONFIG_ENV_SECT_SIZE from board file to nsa310s_defconfig
- Add CONFIG_IDENT_STRING, and CONFIG_NET_RANDOM_ETHADDR
to nsa310s_defconfig

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: kirkwood: NSA310S: Add device tree DTS for Zyxel NSA310S board
Tony Dinh [Thu, 1 Jul 2021 04:26:22 +0000 (21:26 -0700)]
arm: kirkwood: NSA310S: Add device tree DTS for Zyxel NSA310S board

Add device tree kirkwood-nsa310s.dts for Zyxel NSA310S board to
convert to Driver Model.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoMerge branch '2021-07-18-finalize-migrations'
Tom Rini [Mon, 19 Jul 2021 03:07:36 +0000 (23:07 -0400)]
Merge branch '2021-07-18-finalize-migrations'

- With the deadline for DM_USB (host controller support), DM_VIDEO,
  DM_SPI_FLASH and DM_PCI now at 2 years past the release where their
  migration deadline was given, finish removing platforms and enforcing
  the switch.

3 years agoMakefile: Remove DM_VIDEO and DM_SPI_FLASH checks
Tom Rini [Mon, 19 Jul 2021 01:06:33 +0000 (21:06 -0400)]
Makefile: Remove DM_VIDEO and DM_SPI_FLASH checks

As we have now completed the DM_VIDEO and DM_SPI_FLASH migrations we can
remove the checks.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agopci: Require DM_PCI
Tom Rini [Sat, 15 May 2021 01:34:32 +0000 (21:34 -0400)]
pci: Require DM_PCI

As the migration deadline has passed, require that DM_PCI be used.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agousb: Enforce DM_USB migration for USB_HOST devices.
Tom Rini [Fri, 9 Jul 2021 14:11:56 +0000 (10:11 -0400)]
usb: Enforce DM_USB migration for USB_HOST devices.

As the deadline for migration to DM_USB, when using a USB host
controller has now gone two years past the deadline, enforce migration.
This is done by:

- Ensuring that all host controller options (other than the very legacy
  old MUSB ones) now select USB_HOST.  USB_HOST now enforces DM_USB and
  OF_CONTROL.
  - Remove other parts of Kconfig logic that had platforms pick DM_USB.
  - To keep Kconfig happy, have some select statements test for USB_HOST
    as well.
- Re-order some Kconfig entries and menus so that we can cleanly pick
  host or gadget roles.  For the various HCD options that have platform
  glue options, group them together and update dependencies in some
  cases.
- As SPL_DM_USB is not required, on platforms that had not yet enabled
  it, disable it.

Cc: Marek Vasut <marex@denx.de>
Cc: Icenowy Zheng <icenowy@aosc.io>
Cc: Samuel Holland <samuel@sholland.org>
Cc: FUKAUMI Naoki <naobsd@gmail.com>
Cc: Andre Przywara <andre.przywara@arm.com>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agotreewide: Test on CONFIG_USB_HOST (or CONFIG_CMD_USB) not CONFIG_USB
Tom Rini [Fri, 9 Jul 2021 14:11:55 +0000 (10:11 -0400)]
treewide: Test on CONFIG_USB_HOST (or CONFIG_CMD_USB) not CONFIG_USB

As the logic here is only used when we have a USB host controller, test
on CONFIG_USB_HOST rather than CONFIG_USB in general.  This lets us move
towards using CONFIG_USB only as a menu symbol to say that we have some
form of USB, and then USB_HOST or USB_GADGET depending on the role that
USB plays within the build.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agotegra: Test on CONFIG_CMD_USB being enabled for distro bootcmd
Tom Rini [Fri, 9 Jul 2021 14:11:54 +0000 (10:11 -0400)]
tegra: Test on CONFIG_CMD_USB being enabled for distro bootcmd

Reuse the common logic to allow for BOOT_TARGET_DEVICES to list USB as a
possibility if we're building for a platform that will have USB but not
if we don't, so that we don't hit the link-time check for trying to have
USB boot on a non-USB system.

Acked-by: Tom Warren <twarren@nvidia.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoge_bx50v3: Remove unused USB related defines
Tom Rini [Fri, 9 Jul 2021 14:11:53 +0000 (10:11 -0400)]
ge_bx50v3: Remove unused USB related defines

These USB defines do not change the build as there is no USB support
enabled currently.

Cc: Ian Ray <ian.ray@ge.com>
Cc: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
3 years agom68k: Remove M52277EVB board
Tom Rini [Mon, 12 Jul 2021 16:42:14 +0000 (12:42 -0400)]
m68k: Remove M52277EVB board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.  As this is also the last in family remove the related
support as well.

Cc: Angelo Durgehello <angelo.dureghello@timesys.com>
Cc: TsiChung Liew <Tsi-Chung.Liew@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agom68k: Remove M54451EVB board
Tom Rini [Mon, 12 Jul 2021 16:42:13 +0000 (12:42 -0400)]
m68k: Remove M54451EVB board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.  As this is also the last in family remove the related
support as well.

Cc: Angelo Durgehello <angelo.dureghello@timesys.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agom68k: Remove M54418TWR board
Tom Rini [Mon, 12 Jul 2021 16:42:12 +0000 (12:42 -0400)]
m68k: Remove M54418TWR board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Angelo Durgehello <angelo.dureghello@timesys.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agom68k: Remove M54455EVB board
Tom Rini [Mon, 12 Jul 2021 16:42:11 +0000 (12:42 -0400)]
m68k: Remove M54455EVB board

This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.

Cc: Angelo Durgehello <angelo.dureghello@timesys.com>
Cc: TsiChung Liew <Tsi-Chung.Liew@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agovinco: Enable DM_USB and DM_SPI_FLASH support
Tom Rini [Mon, 12 Jul 2021 16:42:10 +0000 (12:42 -0400)]
vinco: Enable DM_USB and DM_SPI_FLASH support

As this platform already enables CONFIG_DM and CONFIG_OF_CONTROL,
migrating to DM_USB and DM_SPI_FLASH is just a matter of enabling the
correct options.

Cc: Gregory CLEMENT <gregory.clement@bootlin.com>
u-boot@lists.denx.de (open list)
Reported-by: Marek Behun <marek.behun@nic.cz>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge tag 'mips-pull-2021-07-18' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Sun, 18 Jul 2021 22:31:16 +0000 (18:31 -0400)]
Merge tag 'mips-pull-2021-07-18' of https://source.denx.de/u-boot/custodians/u-boot-mips

- mips: gardena-smart-gateway: adjust config to new production values
- mips: malta: convert to PCI DM and ETH DM

3 years agoMIPS: malta: enable PCI driver model
Daniel Schwierzeck [Thu, 15 Jul 2021 18:54:01 +0000 (20:54 +0200)]
MIPS: malta: enable PCI driver model

Enable DM_PCI and DM_ETH on MIPS Malta.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
3 years agoMIPS: malta: add support for PCI driver model
Daniel Schwierzeck [Thu, 15 Jul 2021 18:54:00 +0000 (20:54 +0200)]
MIPS: malta: add support for PCI driver model

As almost all peripherals are connected via PCI dependent on the
used core card, PCI setup is always required. Thus run pci_init()
including PCI scanning and probing and core card specific setups
in board_early_init_r().

Also prepare support for dynamically managing the status of the
different PCI DT nodes dependent on used core card via option
CONFIG_OF_BOARD_FIXUP. Before this feature can be enabled,
the call order of the fix_fdt() init hook in board_init_f
needs to be changed. Otherwise rw_fdt_blob points to a read-only
NOR flash address. Thus this options needs to stay disabled
until the board_init_f problem could be solved. This breaks
running the default U-Boot image on real HW using the FPGA core
card but Qemu emulation still works. Currently Qemu is more
important as MIPS CI tests depend on Malta and the deadline
for PCI DM conversion will be enforced soon.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
3 years agoMIPS: malta: add DT bindings for PCI host controller
Daniel Schwierzeck [Thu, 15 Jul 2021 18:53:59 +0000 (20:53 +0200)]
MIPS: malta: add DT bindings for PCI host controller

Add DT binding for GT64120 and MSC01 PCI controllers. Only
GT64120 is enabled by default to support Qemu. The MSC01 node
will be dynamically enabled by Malta board code dependent
on the plugged core card.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
3 years agopci: msc01: convert to driver model
Daniel Schwierzeck [Thu, 15 Jul 2021 18:53:58 +0000 (20:53 +0200)]
pci: msc01: convert to driver model

This driver is currently only used on MIPS Malta boards.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agopci: gt64120: convert to driver model
Daniel Schwierzeck [Thu, 15 Jul 2021 18:53:57 +0000 (20:53 +0200)]
pci: gt64120: convert to driver model

This driver is currently only used on MIPS Malta boards.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agodm: pci: add option to map virtual system memory base address
Daniel Schwierzeck [Thu, 15 Jul 2021 18:53:56 +0000 (20:53 +0200)]
dm: pci: add option to map virtual system memory base address

On MIPS the DRAM start address respectively CONFIG_SYS_SDRAM_BASE
is still used as a virtual, CPU-mapped address instead of being used
as physical address. Converting all MIPS boards and generic MIPS code
to fix that is not trivial. Due to the approaching deadline for
PCI DM conversion, this workaround is required for MIPS boards with
PCI support until the CONFIG_SYS_SDRAM_BASE issue could be solved.

Add a compile-time option to let the PCI uclass core optionally map
the DRAM address to a physical address when adding the PCI region
of type PCI_REGION_SYS_MEMORY.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agomips: mt7688: gardena-smart-gateway: Adjust to production values
Reto Schneider [Thu, 17 Jun 2021 16:09:34 +0000 (18:09 +0200)]
mips: mt7688: gardena-smart-gateway: Adjust to production values

This commit updates the default config with the values that will
be used soon on the MediaTek MT7688 based GARDENA smart gateway.

CONFIG_SPL_SYS_MALLOC_F_LEN had to be increased due to the more
demanding new configuration.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoMerge tag 'efi-2021-10-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 18 Jul 2021 15:03:02 +0000 (11:03 -0400)]
Merge tag 'efi-2021-10-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2021-10-rc1-2

* Correct device path nodes for GUID partitions
* Embed keys to check update capsules instead of providing then in DTB
* Increase event log buffer size for measured boot.

3 years agodoc: Update CapsuleUpdate READMEs
Ilias Apalodimas [Sat, 17 Jul 2021 14:26:46 +0000 (17:26 +0300)]
doc: Update CapsuleUpdate READMEs

Since we removed embeddingg the capsule key into a .dtb and fixed
authenticated capsule updates for all boards, move the relevant
documentation in the efi file and update it accordingly

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 years agomkeficapsule: Remove dtb related options
Ilias Apalodimas [Sat, 17 Jul 2021 14:26:45 +0000 (17:26 +0300)]
mkeficapsule: Remove dtb related options

commit 322c813f4bec ("mkeficapsule: Add support for embedding public key in a dtb")
added a bunch of options enabling the addition of the capsule public key
in a dtb.  Since now we embedded the key in U-Boot's .rodata we don't this
this functionality anymore

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 years agoefi_capsule: Move signature from DTB to .rodata
Ilias Apalodimas [Sat, 17 Jul 2021 14:26:44 +0000 (17:26 +0300)]
efi_capsule: Move signature from DTB to .rodata

The capsule signature is now part of our DTB.  This is problematic when a
user is allowed to change/fixup that DTB from U-Boots command line since he
can overwrite the signature as well.
So Instead of adding the key on the DTB, embed it in the u-boot binary it
self as part of it's .rodata.  This assumes that the U-Boot binary we load
is authenticated by a previous boot stage loader.

Reviewed-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Tested-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Tested-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 years agoefi_loader: increase eventlog buffer size
Masahisa Kojima [Wed, 14 Jul 2021 13:00:01 +0000 (22:00 +0900)]
efi_loader: increase eventlog buffer size

TCG PC Client PFP spec says "The Log Area Minimum Length
for the TCG event log MUST be at least 64KB." in ACPI chapter.
This commit increase the buffer size to 64KB.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: Use %pD to log device-path instead of local efi_dp_str()
Masami Hiramatsu [Wed, 14 Jul 2021 05:19:13 +0000 (14:19 +0900)]
efi_loader: Use %pD to log device-path instead of local efi_dp_str()

Use %pD to log device-path instead of using efi_dp_str() and
efi_free_pool() locally in find_boot_device().
This is a cleanup patch, no feature update nor fix.

Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: set partition GUID in device path for SIG_TYPE_GUID
Alfonso Sánchez-Beato [Thu, 15 Jul 2021 13:31:42 +0000 (15:31 +0200)]
efi_loader: set partition GUID in device path for SIG_TYPE_GUID

Previously, the GPT device GUID was being used instead of the partition,
which was incorrect.

Signed-off-by: Alfonso Sánchez-Beato <alfonso.sanchez-beato@canonical.com>
Let EFI_LOADER select CONFIG_PARTITION_UUIDS.
Use log_warning() instead of printf() for warning.
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 years agoMerge branch '2021-07-16-cleanup-image-support'
Tom Rini [Sat, 17 Jul 2021 15:39:50 +0000 (11:39 -0400)]
Merge branch '2021-07-16-cleanup-image-support'

- A large rework of the logic around supporting various image
  types/formats and sharing between the host and target.

3 years agoMerge tag 'u-boot-imx-20210717' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Sat, 17 Jul 2021 14:52:21 +0000 (10:52 -0400)]
Merge tag 'u-boot-imx-20210717' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

i.MX
----

- mx7ulp : fix  WDOG
- imx8 : Phytec
- USB3 support for i.MX8

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/8277

3 years agomx7ulp: wdog: Wait for WDOG unlock and reconfiguration to complete
Breno Lima [Tue, 29 Jun 2021 02:32:35 +0000 (10:32 +0800)]
mx7ulp: wdog: Wait for WDOG unlock and reconfiguration to complete

According to i.MX7ULP Reference Manual we should wait for WDOG unlock
and reconfiguration to complete.

Section "59.5.3 Configure Watchdog" provides the following example:

DisableInterrupts; //disable global interrupt
WDOG_CNT = 0xD928C520; //unlock watchdog
while(WDOG_CS[ULK]==0); //wait until registers are unlocked
WDOG_TOVAL = 256; //set timeout value
WDOG_CS = WDOG_CS_EN(1) | WDOG_CS_CLK(1) | WDOG_CS_INT(1) |
  WDOG_CS_WIN(0) | WDOG_CS_UPDATE(1);
while(WDOG_CS[RCS]==0); //wait until new configuration takes effect
EnableInterrupts; //enable global interrupt

Update U-Boot WDOG driver to align with i.MX7ULP reference manual.

Use 32 bits accessing to CS register. According to RM, the bits in
this register only can write once after unlock. So using 8 bits access
will cause problem.

Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agomx7ulp: Update unlock and refresh sequences in sWDOG driver
Breno Lima [Tue, 29 Jun 2021 02:32:34 +0000 (10:32 +0800)]
mx7ulp: Update unlock and refresh sequences in sWDOG driver

According to i.MX7ULP Reference Manual the second word write for both
UNLOCK and REFRESH operations must occur in maximum 16 bus clock.

The current code is using writel() function which has a DMB barrier to
order the memory access. The DMB between two words write may introduce
some delay in certain circumstance, causing a WDOG timeout due to 16 bus
clock window requirement.

Replace writel() function by __raw_writel() to achieve a faster memory
access and avoid such issue.

Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
3 years agoimx8mq_evk: Enable the USB3.0 host port
Ye Li [Sun, 21 Feb 2021 16:26:24 +0000 (08:26 -0800)]
imx8mq_evk: Enable the USB3.0 host port

Setup USB clock in board codes, and enable the DWC3 XHCI and
PHY drivers to make USB3.0 host port working on i.MX8MQ EVK.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
3 years agoarm: imx8mq: Add USB clock init function
Ye Li [Sun, 21 Feb 2021 16:26:23 +0000 (08:26 -0800)]
arm: imx8mq: Add USB clock init function

Add clock function to setup relevant clocks for USB3.0 controllers and
PHYs on i.MX8MQ

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Tested-by: Patrick Wildt <patrick@blueri.se>
3 years agoarm: dts: imx8mq: Add alias for two usb controllers
Ye Li [Sun, 21 Feb 2021 16:26:22 +0000 (08:26 -0800)]
arm: dts: imx8mq: Add alias for two usb controllers

Add alias for two DWC3 usb controllers to fix the seq index.

Signed-off-by: Ye Li <ye.li@nxp.com>
Tested-by: Patrick Wildt <patrick@blueri.se>
3 years agophy: phy-imx8mq-usb: Add USB PHY driver for i.MX8MQ
Ye Li [Sun, 21 Feb 2021 16:26:21 +0000 (08:26 -0800)]
phy: phy-imx8mq-usb: Add USB PHY driver for i.MX8MQ

Add the USB PHY driver for i.MX8MQ to work with DWC3 USB controller.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Tested-by: Patrick Wildt <patrick@blueri.se>
3 years agotools: Use a single target-independent config to enable OpenSSL
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:47 +0000 (17:05 -0500)]
tools: Use a single target-independent config to enable OpenSSL

Host tool features, such as mkimage's ability to sign FIT images were
enabled or disabled based on the target configuration. However, this
misses the point of a target-agnostic host tool.

A target's ability to verify FIT signatures is independent of
mkimage's ability to create those signatures. In fact, u-boot's build
system doesn't sign images. The target code can be successfully built
without relying on any ability to sign such code.

Conversely, mkimage's ability to sign images does not require that
those images will only work on targets which support FIT verification.
Linking mkimage cryptographic features to target support for FIT
verification is misguided.

Without loss of generality, we can say that host features are and
should be independent of target features.

While we prefer that a host tool always supports the same feature set,
we recognize the following
  - some users prefer to build u-boot without a dependency on OpenSSL.
  - some distros prefer to ship mkimage without linking to OpenSSL

To allow these use cases, introduce a host-only Kconfig which is used
to select or deselect libcrypto support. Some mkimage features or some
host tools might not be available, but this shouldn't affect the
u-boot build.

I also considered setting the default of this config based on
FIT_SIGNATURE. While it would preserve the old behaviour it's also
contrary to the goals of this change. I decided to enable it by
default, so that the default build yields the most feature-complete
mkimage.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
3 years agoimage: Add support for relocating crypto_algos in linker lists
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:46 +0000 (17:05 -0500)]
image: Add support for relocating crypto_algos in linker lists

Function pointers from crypto_algos array are relocated, when
NEEDS_MANUAL_RELOC is set. This relocation doesn't happen if the algo
is placed in a linker list. Implement this relocation.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Michal Simek <michal.simek@xilinx.com>
3 years agoimage: Eliminate IMAGE_ENABLE_VERIFY_ECDSA macro
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:45 +0000 (17:05 -0500)]
image: Eliminate IMAGE_ENABLE_VERIFY_ECDSA macro

This macro is no longer needed for code flow or #ifdefs. Remove it.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoimage: Eliminate IMAGE_ENABLE_VERIFY macro
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:44 +0000 (17:05 -0500)]
image: Eliminate IMAGE_ENABLE_VERIFY macro

This macro is no longer needed for code flow or #ifdefs. Remove it.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agolib: rsa: Remove #ifdefs from rsa.h
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:43 +0000 (17:05 -0500)]
lib: rsa: Remove #ifdefs from rsa.h

It is no longer necessary to implement rsa_() functions as no-ops
depending on config options. It is merely sufficient to provide the
prototypes, as the rsa code is no longer linked when unused.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agolib: ecdsa: Remove #ifdefs from ecdsa.h
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:42 +0000 (17:05 -0500)]
lib: ecdsa: Remove #ifdefs from ecdsa.h

It is no longer necessary to implement ecdsa_() functions as no-ops
depending on config options. It is merely sufficient to provide the
prototypes, as the ecdsa code is no longer linked when unused.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoimage: image-sig.c: Remove crypto_algos array
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:41 +0000 (17:05 -0500)]
image: image-sig.c: Remove crypto_algos array

Crytographic algorithms (currently RSA), are stored in linker lists.
The crypto_algos array is unused, so remove it, and any logic
associated with it.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoimage: rsa: Move verification algorithm to a linker list
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:40 +0000 (17:05 -0500)]
image: rsa: Move verification algorithm to a linker list

Move the RSA verification crytpo_algo structure out of the
crypto_algos array, and into a linker list.

Although it appears we are adding an #ifdef to rsa-verify.c, the gains
outweigh this small inconvenience. This is because rsa_verify() is
defined differently based on #ifdefs. This change allows us to have
a single definition of rsa_verify().

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoimage: Add support for placing crypto_algo in linker lists
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:39 +0000 (17:05 -0500)]
image: Add support for placing crypto_algo in linker lists

The purpose of this change is to enable crypto algorithms to be placed
in linker lists, rather than be declared as a static array. The goal
is to remove the crypto_algos array in a subsequent patch.

Create a new linker list named "cryptos", and search it when
image_get_crypto_algo() is invoked.

NOTE that adding support for manual relocation of crypto_algos within
linker lists is beyond the scope of this patch.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agocommon: image-sig.c: Remove host-specific logic and #ifdefs
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:38 +0000 (17:05 -0500)]
common: image-sig.c: Remove host-specific logic and #ifdefs

Remove any ifdefs in image-sig.c that were previously used to
differentiate from the host code. Note that all code dedicated to
relocating ->sign() and ->add_verify_data)_ can be safely removed,
as signing is not supported target-side.

NOTE that although it appears we are removing ecdsa256 support, this
is intentional. ecdsa_verify() is a no-op on the target, and is
currently only used by host code.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agocommon: Move host-only logic in image-sig.c to separate file
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:37 +0000 (17:05 -0500)]
common: Move host-only logic in image-sig.c to separate file

image-sig.c is used to map a hash or crypto algorithm name to a
handler of that algorithm. There is some similarity between the host
and target variants, with the differences worked out by #ifdefs. The
purpose of this change is to remove those ifdefs.

First, copy the file to a host-only version, and remove target
specific code. Although it looks like we are duplicating code,
subsequent patches will change the way target algorithms are searched.
Besides we are only duplicating three string to struct mapping
functions. This isn't something to fuss about.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>