platform/kernel/u-boot.git
2 years agotreewide: Use 16-bit Unicode strings
Simon Glass [Sun, 23 Jan 2022 19:55:14 +0000 (12:55 -0700)]
treewide: Use 16-bit Unicode strings

At present we use wide characters for Unicode but this is not necessary.
Change the code to use the 'u' literal instead. This helps to fix build
warnings for sandbox on the Raspberry Pi.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agoefi: Use 16-bit unicode strings
Simon Glass [Sun, 23 Jan 2022 19:55:12 +0000 (12:55 -0700)]
efi: Use 16-bit unicode strings

At present we use wide characters for unicode but this is not necessary.
Change the code to use the 'u' literal instead. This helps to fix build
warnings for sandbox on rpi.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agoscripts/checkpatch.pl: Resync with v5.16
Simon Glass [Sun, 23 Jan 2022 19:55:11 +0000 (12:55 -0700)]
scripts/checkpatch.pl: Resync with v5.16

This resyncs us with the version found in v5.16 of the Linux kernel with
the following exceptions:
- Keep our u-boot specific tests / code area.
- Change the location of checkpatch.rst
- Drop the "use strscpy" test as we don't have that, but do have strlcpy
  and want that used now.
- Keep debug/printf in the list for $logFunctions

This also syncs the spdxcheck.py tool and all the associated
documentation.
S
Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoarmv8: start.S: remove CONFIG_SYS_RESET_SCTRL code
Andre Przywara [Mon, 24 Jan 2022 17:17:40 +0000 (17:17 +0000)]
armv8: start.S: remove CONFIG_SYS_RESET_SCTRL code

There is some code that tries to "reset" the SCTLR_ELx register early in
the boot process. The idea seems to be to guarantee some sane settings
that U-Boot actually relies on, for instance running in little-endian
mode, with the MMU off initially.
However the current code has multiple problems:
- For a start, no platform or config defines the symbol that would
  enable that code.
- The code itself really only works if the bits that it tries to clear
  are already cleared:
  - If we run in big-endian mode initially, any previous loads would have
    been wrong already. That applies to the (optional) relocation code,
    but more prominently to the mask that it uses to clear those bits:
    "ldr x1, =0xfdfffffa" looks innocent, but actually involves a memory
    access to the literal pool, using the current endianness.
  - If we run with the MMU enabled, we are probably doomed already. We
    *could* hope that we are running with an identity mapping, but would
    need to do some cache maintenance to avoid losing dirty cache lines.
- The idea of doing a read-modify-write of SCTLR is somewhat
  questionable to begin with, because as the owner of the current
  exception level we should initialise all bits of this register with a
  certain fixed value.
- The code is unnecessarily complicated, and the function name is
  misspelled.

While those problems *could* admittedly be fixed, the point that is does
not seem to be used at all at the moment tells me we should just remove
this code, and be it to not give a bad example.

If people care, I could introduce some proper SCTLR initialisation code.
We are about to work this out for the boot-wrapper[1] as we speak, but
apparently we got away without doing this in U-Boot ever since, so it
might not be worth the potential trouble.

[1] https://lore.kernel.org/linux-arm-kernel/20220114105653.3003399-7-mark.rutland@arm.com/

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agoscripts: Makefile: also clean subdir dtc
Philippe Reynes [Tue, 25 Jan 2022 10:32:20 +0000 (11:32 +0100)]
scripts: Makefile: also clean subdir dtc

Since commit 93b196532254 ("Makefile: Only build dtc if needed"),
the sub directory scripts/dtc is never cleaned.
Adds the directory dtc to subdir to always clean it.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agonet: ti: am65-cpsw: Cleanup resources before jump to kernel
Vignesh Raghavendra [Fri, 28 Jan 2022 05:51:19 +0000 (11:21 +0530)]
net: ti: am65-cpsw: Cleanup resources before jump to kernel

In case fastboot over Ethernet, am65_cpsw_stop() is not called unless
DM_FLAG_OS_PREPARE is set. Without call to am65_cpsw_stop(), DMA
resources are not released thus leading to failures in kernel.
Fix this by adding DM_FLAG_OS_PREPARE flag to am65_cpsw_nuss_port
driver.

Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agoarm: pdu001: Exend the list of maintained files
Felix Brack [Fri, 28 Jan 2022 13:36:12 +0000 (14:36 +0100)]
arm: pdu001: Exend the list of maintained files

Add the PDU001 board specific DT files to MAINTAINERS. This should
help for better tracking of changes to these files.

Signed-off-by: Felix Brack <fb@ltec.ch>
2 years agoarmv8: spl: Fix build with LINUX_KERNEL_IMAGE_HEADER
Alper Nebi Yasak [Sat, 29 Jan 2022 15:27:03 +0000 (18:27 +0300)]
armv8: spl: Fix build with LINUX_KERNEL_IMAGE_HEADER

Setting LINUX_KERNEL_IMAGE_HEADER=y attempts to include an ARM64 Linux
kernel image header at the start of both U-Boot proper and SPL binaries.
However, some definitions that the image header uses are not included by
the SPL linker script, resulting in a build error. Include them the way
they are included in U-Boot proper's linker script to fix the error.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2 years agospl: ymodem: Fix buffer overflow during Image copy
Vignesh Raghavendra [Mon, 31 Jan 2022 04:19:19 +0000 (09:49 +0530)]
spl: ymodem: Fix buffer overflow during Image copy

ymodem_read_fit() driver will end copying up to BUF_SIZE boundary even
when requested size of copy operation is less than that.
For example, if offset = 0, size = 1440B, ymodem_read_fit() ends up
copying 2KB from offset = 0, to destination buffer addr

This causes data corruption when malloc'd buffer is passed during UART
boot since commit 03f1f78a9b44 ("spl: fit: Prefer a malloc()'d buffer
for loading images")

With this, UART boot works again on K3 (AM654, J7, AM64) family of
devices.

Fixes: 03f1f78a9b44 ("spl: fit: Prefer a malloc()'d buffer for loading images")
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
2 years agoDockfile, CI: Update to latest focal tag and build
Tom Rini [Thu, 3 Feb 2022 13:38:34 +0000 (08:38 -0500)]
Dockfile, CI: Update to latest focal tag and build

- Latest focal tag
- Add libgnutls to image

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoDockerfile: Add libgnutls package for building mkeficapsule command
AKASHI Takahiro [Tue, 1 Feb 2022 01:32:36 +0000 (10:32 +0900)]
Dockerfile: Add libgnutls package for building mkeficapsule command

For adding signing feature for capsule authentication to the host tool,
mkeficapsule, we will link gnutls library for crypto operation.
Since we need this command to complete the capsule authentication test
on sandbox in CI loop, necessary packages must be installed on the host.

See my patch, "tools: mkeficapsule: add firmware image signing."

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq
Tom Rini [Wed, 2 Feb 2022 14:16:49 +0000 (09:16 -0500)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq

Update and fixes for ls1088a, FMAN, ls1046ardb, ls1043ardb
sync ls1028ardb u-boot and Linux device-tree

2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-cfi-flash
Tom Rini [Tue, 1 Feb 2022 15:54:52 +0000 (10:54 -0500)]
Merge https://source.denx.de/u-boot/custodians/u-boot-cfi-flash

- cfi_mtd: populate mtd->dev with flash_info->dev (Patrice)

2 years agomtd: cfi_mtd: populate mtd->dev with flash_info->dev
Patrice Chotard [Fri, 3 Dec 2021 09:27:44 +0000 (10:27 +0100)]
mtd: cfi_mtd: populate mtd->dev with flash_info->dev

Populate mtd->dev with flash_info->dev which allows to get
full mtd information using the "mtd list" command.
Before, "mtd list" command returns :

List of MTD devices:
* nor0
  - type: NOR flash
  - block size: 0x40000 bytes
  - min I/O: 0x1 bytes
  - 0x000000000000-0x000004000000 : "nor0"

After this patch we get for example:

List of MTD devices:
* nor0
  - device: flash@0
  - parent: spi@40430000
  - driver: cfi_flash
  - path: /soc/spi@40430000/flash@0
  - type: NOR flash
  - block size: 0x40000 bytes
  - min I/O: 0x1 bytes
  - 0x000000000000-0x000004000000 : "nor0"

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoboard: ls1046ardb: force PCI device enumeration
Martin Schiller [Wed, 17 Nov 2021 11:59:20 +0000 (12:59 +0100)]
board: ls1046ardb: force PCI device enumeration

Commit 045ecf899252 ("configs: enable DM_ETH support for LS1046ARDB")
resulted in the PCI bus no longer being implicitly enumerated.

However, this is necessary for the fdt pcie fixups to work.

Therefore, similar to commit 8b6558bd4187 ("board: ls1088ardb:
transition to DM_ETH"), pci_init() is now called in the board_init()
routine when CONFIG_DM_ETH is active.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
CC: Priyanka Jain <priyanka.jain@nxp.com>
Acked-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoboard: ls1088a: update ifc node name to be memory-controller
Jianpeng Bu [Mon, 31 Jan 2022 13:12:36 +0000 (18:42 +0530)]
board: ls1088a: update ifc node name to be memory-controller

IFC-NOR and QSPI are muxed on SoC.
So disable IFC node in dts if QSPI is enabled or disable QSPI node in dts
in case QSPI is not enabled.
"ifc/nor" will be changed to "memory-controller/nor" in linux. So need to
modify "ifc/nor" to "memory-controller/nor" in fdt_path_offset().

Signed-off-by: Jianpeng Bu <jianpeng.bu@nxp.com>
[Rebased]
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoconfigs: fsl: add missing FMAN/QE_FW_ADDR defines
Camelia Groza [Thu, 13 Jan 2022 13:43:14 +0000 (15:43 +0200)]
configs: fsl: add missing FMAN/QE_FW_ADDR defines

The initial patch had typos that caused four defconfigs to miss the
symbol transition to Kconfig. CONFIG_SYS_QE_FW_ADDR and
CONFIG_SYS_FMAN_FW_ADDR are currently initialized to 0 by default
on these builds, which prevents the firmware from loading.

Add the correct symbols to these defconfigs.

Fixes: a97a071d10d2b ("configs: fsl: migrate FMAN/QE specific defines to Kconfig")
Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoarm: dts: ls1028a-qds: declare in-band autoneg for Ethernet ports
Vladimir Oltean [Mon, 3 Jan 2022 12:47:37 +0000 (14:47 +0200)]
arm: dts: ls1028a-qds: declare in-band autoneg for Ethernet ports

The commit in the Fixes: tag below broke traffic through switch ports
where the SERDES protocol requires in-band autoneg and this requirement
isn't described in the device tree: SGMII, QSGMII, USXGMII (with
2500Base-X, in-band autoneg isn't supported).

The LS1028A-QDS boards are not yet ready for syncing their device trees
with Linux, since Ethernet is missing there (but has been submitted):
https://lore.kernel.org/lkml/20211112223457.10599-11-leoyang.li@nxp.com/

When agreement is reached for the Ethernet support in Linux, there will
be a sync for these boards as well. For now, just enable in-band autoneg
to fix the breakage.

Fixes: e3789a726269 ("net: dsa: felix: configure the in-band autoneg property based on OF node info")
Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoarm: dts: ls1028a-rdb: sync device tree with Linux
Vladimir Oltean [Mon, 3 Jan 2022 12:47:36 +0000 (14:47 +0200)]
arm: dts: ls1028a-rdb: sync device tree with Linux

Allow device trees to be reused between Linux and U-Boot.
The source for these device trees is linux-next as of commit
bd8a9cd624c6 ("arm64: dts: ls1028a-rdb: update copyright"), which was
chosen because some changes needed to be done to the Linux DTs too,
before they could be shared:
https://lore.kernel.org/linux-arm-kernel/20211202141528.2450169-5-vladimir.oltean@nxp.com/T/#m6f63c92e75fa79a01144b2c2c6dc4776e7971395

There are two more commits on the RDB device tree which haven't been
picked up yet, because they have dependencies on the SoC device tree:

dd3d936a1b17 ("arm64: dts: ls1028a: add ftm_alarm1 node to be used as wakeup source")
b2e2d3e02fb6 ("arm64: dts: ls1028a-rdb: enable pwm0")

These will be picked up on the next resync.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Reviewed-by: Michael Walle <michael@walle.cc>
2 years agoarm: dts: ls1028a-rdb: enable PCIe controllers from U-Boot dtsi
Vladimir Oltean [Mon, 3 Jan 2022 12:47:35 +0000 (14:47 +0200)]
arm: dts: ls1028a-rdb: enable PCIe controllers from U-Boot dtsi

Reuse the scheme implemented by the Kontron SL28 boards in
commit d08011d7f9b4
("arm: dts: ls1028a: disable the PCIe controller by default")
and move the 'status = "okay"' lines for the PCIe controllers
inside a separate U-Boot dtsi for the LS1028A-RDB board. This way, the
existing Linux device tree can simply be dropped in.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoarm: dts: ls1028a-rdb: disable I2C buses 1 through 7
Vladimir Oltean [Mon, 3 Jan 2022 12:47:34 +0000 (14:47 +0200)]
arm: dts: ls1028a-rdb: disable I2C buses 1 through 7

There is no I2C peripheral on these buses on the reference design board,
and the Linux device tree does not enable them either.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoarm: dts: ls1028a-rdb: disable DSPI nodes
Vladimir Oltean [Mon, 3 Jan 2022 12:47:33 +0000 (14:47 +0200)]
arm: dts: ls1028a-rdb: disable DSPI nodes

There is no SPI peripheral on the LS1028A-RDB, therefore no reason to
enable these nodes in the U-Boot device tree (and Linux does not enable
them either).

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoarm: dts: ls1028a-rdb: sync Ethernet device tree nodes with Linux
Vladimir Oltean [Mon, 3 Jan 2022 12:47:32 +0000 (14:47 +0200)]
arm: dts: ls1028a-rdb: sync Ethernet device tree nodes with Linux

In a bit of a blunder, the blamed commit in the Fixes: tag below made
the mscc_felix switch driver look at the 'managed = "in-band-status"'
device tree property, forgetting that the U-Boot device tree had not
been updated to include that property, whereas the Linux one does.

The switch is therefore described in the device tree as not requiring
in-band autoneg, but the PHY driver for VSC8514 (drivers/net/phy/mscc.c)
still enables that feature. This results in a mismatch => no traffic.

This patch is a copy-paste of the Ethernet device tree nodes from Linux,
which resolves that issue. The device tree update also renames the
Ethernet PHY labels.

Fixes: e3789a726269 ("net: dsa: felix: configure the in-band autoneg property based on OF node info")
Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoarm: dts: ls1028a-rdb: sort nodes alphabetically
Vladimir Oltean [Mon, 3 Jan 2022 12:47:31 +0000 (14:47 +0200)]
arm: dts: ls1028a-rdb: sort nodes alphabetically

The nodes in the NXP LS1028A-RDB device tree are out of order, regroup
them alphabetically to have a simple delta when the Linux device tree is
brought in.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agortc: pcf2127: remove U-Boot specific compatible string
Vladimir Oltean [Mon, 3 Jan 2022 12:47:30 +0000 (14:47 +0200)]
rtc: pcf2127: remove U-Boot specific compatible string

Now that all in-tree boards have been converted to the compatible
strings from Linux, delete the support for the ad-hoc "pcf2127-rtc" one.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoarm: dts: lx2160a-rdb: use Linux compatible string for RTC
Vladimir Oltean [Mon, 3 Jan 2022 12:47:29 +0000 (14:47 +0200)]
arm: dts: lx2160a-rdb: use Linux compatible string for RTC

During the LS1028A-RDB sync with Linux device trees, it was observed
that the same RTC is present on the two boards, and the wrong compatible
string is used in both places. This change updates the RTC from the
LX2160A-RDB to use the compatible string that was established in Linux.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Reviewed-by: Michael Walle <michael@walle.cc>
2 years agoarm: dts: ls1028a-rdb: use Linux compatible string for RTC
Vladimir Oltean [Mon, 3 Jan 2022 12:47:28 +0000 (14:47 +0200)]
arm: dts: ls1028a-rdb: use Linux compatible string for RTC

During this board's sync with Linux device trees, it was observed that
it doesn't use the same compatible string for the RTC node as in U-Boot.
This change makes the RTC compatible strings match, for a smoother sync.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoarm: dts: ls1028a-qds: use Linux compatible string for RTC
Vladimir Oltean [Mon, 3 Jan 2022 12:47:27 +0000 (14:47 +0200)]
arm: dts: ls1028a-qds: use Linux compatible string for RTC

The LS1028A-QDS board won't be synced with the Linux device trees right
now, since those are currently still in progress (Ethernet is missing).

However, while we're at converting the RDB, it can be observed that the
same RTC is present on the two boards, and the wrong compatible string
is used in both places. This change updates the RTC from the QDS to use
the compatible string that was established in Linux.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Reviewed-by: Michael Walle <michael@walle.cc>
2 years agoarm: dts: lx2160a-qds: use Linux compatible string for RTC
Vladimir Oltean [Mon, 3 Jan 2022 12:47:26 +0000 (14:47 +0200)]
arm: dts: lx2160a-qds: use Linux compatible string for RTC

During the LS1028A-RDB sync with Linux device trees, it was observed
that the same RTC is present on the two boards, and the wrong compatible
string is used in both places. This change updates the RTC from the
LX2160A-QDS to use the compatible string that was established in Linux.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Reviewed-by: Michael Walle <michael@walle.cc>
2 years agoarm: dts: ls1088a-rdb: use Linux compatible string for RTC
Vladimir Oltean [Mon, 3 Jan 2022 12:47:25 +0000 (14:47 +0200)]
arm: dts: ls1088a-rdb: use Linux compatible string for RTC

During the LS1028A-RDB sync with Linux device trees, it was observed
that the same RTC is present on the two boards, and the wrong compatible
string is used in both places. This change updates the RTC from the
LS1088A-RDB to use the compatible string that was established in Linux.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Reviewed-by: Michael Walle <michael@walle.cc>
2 years agoarm: dts: ls1088a-qds: use Linux compatible string for RTC
Vladimir Oltean [Mon, 3 Jan 2022 12:47:24 +0000 (14:47 +0200)]
arm: dts: ls1088a-qds: use Linux compatible string for RTC

During the LS1028A-RDB sync with Linux device trees, it was observed
that the same RTC is present on the two boards, and the wrong compatible
string is used in both places. This change updates the RTC from the
LS1088A-QDS to use the compatible string that was established in Linux.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Reviewed-by: Michael Walle <michael@walle.cc>
2 years agortc: pcf2127: sync with Linux compatible strings
Vladimir Oltean [Mon, 3 Jan 2022 12:47:23 +0000 (14:47 +0200)]
rtc: pcf2127: sync with Linux compatible strings

Allow this driver to be used by boards which inherit their device trees
from Linux. Compatibility is temporarily retained with the old
compatible string which is U-Boot specific, and will be removed after a
few changes.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoi2c: muxes: pca954x: add PCA9847 variant
Vladimir Oltean [Mon, 3 Jan 2022 12:47:22 +0000 (14:47 +0200)]
i2c: muxes: pca954x: add PCA9847 variant

This seems to be very similar to the already existing PCA9547, save for
the fact that it supports 0.8V and doesn't support 5V. In fact, it is so
similar to the PCA9547 that the NXP LS1028A-RDB board has been driving
this chip using a "nxp,pca9547" compatible string.

Create a new compatible for the PCA9847 (which is the same as in Linux)
and define the same operating parameters for it as for PCA9547.

Cc: Heiko Schocher <hs@denx.de>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Reviewed-by: Michael Walle <michael@walle.cc>
2 years agopci: layerscape: update the searching compatible of LX2160A PCIe
Hou Zhiqiang [Tue, 7 Dec 2021 10:13:12 +0000 (18:13 +0800)]
pci: layerscape: update the searching compatible of LX2160A PCIe

The current fixup of LX2160A PCIe nodes is based on non-production
rev1 silicon, and in Linux the nodes have been updated for rev2
silicon, so update the searching compatible string to match the
kernel changes. And for compatibility with the rev1 nodes, move
forward the board specific fixup.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoboard: ls1043ardb: force PCI device enumeration
Martin Schiller [Tue, 23 Nov 2021 06:28:00 +0000 (07:28 +0100)]
board: ls1043ardb: force PCI device enumeration

Commit eb1986804d1d ("configs: enable DM_ETH support for LS1043ARDB")
resulted in the PCI bus no longer being implicitly enumerated.

However, this is necessary for the fdt pcie fixups to work.

Therefore, similar to commit 8b6558bd4187 ("board: ls1088ardb:
transition to DM_ETH"), pci_init() is now called in the board_init()
routine when CONFIG_DM_ETH is active.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
CC: Priyanka Jain <priyanka.jain@nxp.com>
CC: Camelia Groza <camelia.groza@nxp.com>
Acked-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agokm/ls102xa: use unused scratchrw4 address for post word
Aleksandar Gerasimovski [Tue, 16 Nov 2021 13:13:35 +0000 (13:13 +0000)]
km/ls102xa: use unused scratchrw4 address for post word

The SCRATCHRW4 is only used in secure boot scenario that is unsupported by
our design, so this address can be stolen for storing POST status.
The SCRATCHRW4 is initialized to zero at core rest.

Using a DDR address was unfortunate choice, the DDR at boot time has a
random contend and it happens that sometimes is matching POST magic number.
This behavior can lead to undefined POST behavior and u-boot ending in
failbootcmd command.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachienergy.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoconfigs/expu1/seli8: limit autoboot stop to space key
Aleksandar Gerasimovski [Tue, 16 Nov 2021 13:12:45 +0000 (13:12 +0000)]
configs/expu1/seli8: limit autoboot stop to space key

Make it in a same way as on the other FOXMC products, this also helps to
avoid unwanted stop caused by some terminal servers that are sending junk
on the serial line.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachienergy.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoarm/expu1/seli8: adapt dts NOR partition table to the latest used
Aleksandar Gerasimovski [Tue, 16 Nov 2021 13:11:17 +0000 (13:11 +0000)]
arm/expu1/seli8: adapt dts NOR partition table to the latest used

Even not used by u-boot, this has to be inline with the hw and kernel dts.
U-boot partition table is defined by MTDPARTS_DEFAULT Kconfig.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachienergy.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoconfigs/expu1: add u-boot update defconfig
Aleksandar Gerasimovski [Tue, 16 Nov 2021 13:10:00 +0000 (13:10 +0000)]
configs/expu1: add u-boot update defconfig

This patch adds default defconfig for u-boot update version, the u-boot
update defconfig is a copy of the default (factory) defconfig with:
- adapted text base and environment addresses
- explicit flag that this is a field updated u-boot version

At the time of implementation this version is only used to verify the
update procedure, in future depend on the needs this defconfig can be
extended with additional options.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachienergy.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoconfigs/expu1: enable field fail-safe u-boot update
Aleksandar Gerasimovski [Fri, 10 Dec 2021 10:09:18 +0000 (11:09 +0100)]
configs/expu1: enable field fail-safe u-boot update

Field fail-safe u-boot update for pg-wcom-ls102x designs is introduced
with patch: 81fb05e.

This patch enables already added support by:
 - Defining default u-boot build as bootpackage (factory) image.
 - Defining u-boot update image location according to the EXPU1 NOR layout.
 - Extending mtd partitions according defined EXPU1 NOR layout.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachienergy.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoconfigs: expu1: enable ver envvar for version_string
Aleksandar Gerasimovski [Tue, 16 Nov 2021 13:08:11 +0000 (13:08 +0000)]
configs: expu1: enable ver envvar for version_string

This is used by out ESW for reading u-boot build version.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachienergy.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoconfigs: seli8: enable ver envvar for version_string
Aleksandar Gerasimovski [Tue, 16 Nov 2021 13:07:20 +0000 (13:07 +0000)]
configs: seli8: enable ver envvar for version_string

This is used by out ESW for reading u-boot build version.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachienergy.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agokm/ls102xa: fix device disable configuration
Aleksandar Gerasimovski [Tue, 16 Nov 2021 13:06:31 +0000 (13:06 +0000)]
km/ls102xa: fix device disable configuration

This was probably broken when mainlining, CONFIG_FSL_DEVICE_DISABLE is
not Kconfig but whitelisted.

It's fine to be without flag as this is always enabled for abec1020
(pg-wcom-ls102xa.h)

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachienergy.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoconfigs/seli8: add u-boot update defconfig
Aleksandar Gerasimovski [Tue, 16 Nov 2021 13:05:42 +0000 (13:05 +0000)]
configs/seli8: add u-boot update defconfig

This patch adds default defconfig for u-boot update version, the u-boot
update defconfig is a copy of the default (factory) defconfig with:
- adapted text base and environment addresses
- explicit flag that this is a field updated u-boot version

At the time of implementation this version is only used to verify the
update procedure, in future depend on the needs this defconfig can be
extended with additional options.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachienergy.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoconfigs/seli8: enable field fail-safe u-boot update
Aleksandar Gerasimovski [Fri, 10 Dec 2021 10:09:01 +0000 (11:09 +0100)]
configs/seli8: enable field fail-safe u-boot update

Field fail-safe u-boot update for pg-wcom-ls102x designs is introduced
with patch 81fb05e.

This patch enables already added support by:
 - Defining default u-boot build as bootpackage (factory) image.
 - Defining u-boot update image location according to the SELI8 NOR layout.
 - Extending mtd partitions according defined SELI8 NOR layout.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachienergy.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agokm/ls102xa: add support for field fail-safe u-boot update
Aleksandar Gerasimovski [Fri, 10 Dec 2021 10:08:44 +0000 (11:08 +0100)]
km/ls102xa: add support for field fail-safe u-boot update

Field fail-safe u-boot update procedure for pg-wcom boards is defined and
implemented by patch: 59b3403.
This patch invokes the update procedure for pg-wcom-ls102x designs during
early misc_init_f execution.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachienergy.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agokm: common: implement field fail-safe u-boot update
Aleksandar Gerasimovski [Fri, 10 Dec 2021 10:07:53 +0000 (11:07 +0100)]
km: common: implement field fail-safe u-boot update

This patch provides possibility for field fail-safe u-boot updates.
The implementation can be used on all pg-wcom boards that are booting from
parallel NOR flash.

When used in a board design, provided check_for_uboot_update function will
start new u-boot at defined location if updateduboot envvar is set to yes.
With this implementation it is expected that factory programmed u-boot
will always stay as it is, and optionally new u-boot can be safely
programmed by embedded software when the unit is rolled out on the field.

It is expected check_for_uboot_update to be called early in execution
before relocation (*_f) once SoC is basically initialized and environment
can be read, with this possibilities to not be able to fix a u-boot bug by
a u-boot update are reduced to minimum.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachienergy.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agokm: qrio: add access functions for ebootcount
Aleksandar Gerasimovski [Tue, 16 Nov 2021 12:53:28 +0000 (12:53 +0000)]
km: qrio: add access functions for ebootcount

The EBOOTCNT is a reserved persistent static memory area in QRIO,
and similar to BOOTCNT is intended to be used as boot counter location.

Comparable to BOOTCNT that is reserved for u-boot main bootcount
infrastructure, EBOOTCNT is intended to be used for pg-wcom board
specific purposes (e.g implementing early boot counter for fail-safe
u-boot update).

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachienergy.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agokm/ls102xa: dbg phy prst depends on piggy presence
Aleksandar Gerasimovski [Tue, 16 Nov 2021 12:51:47 +0000 (12:51 +0000)]
km/ls102xa: dbg phy prst depends on piggy presence

The PHY for the debug interface was placed on the board for the
pg_wcom_ls102x. Hence only when a piggy is plugged, a RJ45 jack
including magnetics is connected to the MDI of the PHY. Without a
piggy the MDI lines are left floating and it does not make sense to
have an active debug PHY.
In case of expu1 an active PHY without a piggy even led to increased
jitter for syncE.

This patch only deactivates the prst line of the debug PHY when a piggy
is detected persent.

Signed-off-by: Rainer Boschung <rainer.boschung@hitachienergy.com>
Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachienergy.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agokm: qrio: add function to read PGY_PRES pin status
Aleksandar Gerasimovski [Tue, 16 Nov 2021 12:50:54 +0000 (12:50 +0000)]
km: qrio: add function to read PGY_PRES pin status

It is necessary to read the status of the PGY_PRES pin
so that u-boot can react accordingly.

Signed-off-by: Rainer Boschung <rainer.boschung@hitachienergy.com>
Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachienergy.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agokm/ls102xa: use qrio selftest_pin for reading selftest
Aleksandar Gerasimovski [Tue, 16 Nov 2021 12:49:46 +0000 (12:49 +0000)]
km/ls102xa: use qrio selftest_pin for reading selftest

QRIO library now supports direct read of the test pin status.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachienergy.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agokm: qrio: add function to read SLFTEST pin status
Aleksandar Gerasimovski [Tue, 16 Nov 2021 12:48:46 +0000 (12:48 +0000)]
km: qrio: add function to read SLFTEST pin status

There is a request from HW designers to use this QRIO pin for detecting
DIC26_SELFTEST status instead of a GPIO pin.
This pin is typically used during production for executing POST tests and
starting test ESW bank.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachienergy.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoarm: ls1021a: limit debug eth phy speed to 100Mbps
Aleksandar Gerasimovski [Tue, 16 Nov 2021 12:47:25 +0000 (12:47 +0000)]
arm: ls1021a: limit debug eth phy speed to 100Mbps

Beside that mounted rgmii debug phy is 1000Mbps capable, the debug link
between the piggy board and the phy is 100Mbps only.
This leads to longer link establishment time when working in debug mode,
as phy tries to autoneg 1000Mbps.

This patch fixes the speed to 100Mbps and allows smother link establishment
time for the debug interface.

Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachienergy.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoboard: traverse: add initial Ten64 support
Mathew McBride [Mon, 31 Jan 2022 13:04:43 +0000 (18:34 +0530)]
board: traverse: add initial Ten64 support

The Ten64 is a networking-oriented MiniITX board
using the NXP LS1088A SoC.

This patch provides the bare minimum to support
Ten64 boards under U-Boot for distroboot.

Some related drivers have not yet been submitted
and this basic support lacks some of the
opinionated defaults provided by our firmware
distribution.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
[Rebased]
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoboard: traverse: add Ten64 board controller driver
Mathew McBride [Wed, 10 Nov 2021 04:46:38 +0000 (04:46 +0000)]
board: traverse: add Ten64 board controller driver

Traverse Technologies Ten64 family boards use a microcontroller
to control low level board functions like startup and reset,
as well as holding details such as the board MAC address.

Communication between the CPU and microcontroller is via
I2C.

To keep the driver structure clean between the Ten64 board
file, DM_I2C, and a future utility command, this driver
has been implemented as a misc uclass device.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2 years agoPrepare v2022.04-rc1
Tom Rini [Mon, 31 Jan 2022 22:57:32 +0000 (17:57 -0500)]
Prepare v2022.04-rc1

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agomkimage: fix segfault on MacOS arm64
Sergey V. Lobanov [Mon, 24 Jan 2022 23:29:44 +0000 (02:29 +0300)]
mkimage: fix segfault on MacOS arm64

mkimage segfaults due to the ASLR mechanism on MacOS arm64

It is required to use _dyld_get_image_vmaddr_slide()
to prevent segfault on MacOS arm64

This patch is based on the discussion
https://github.com/u-boot/u-boot/commit/3b142045e8a7f0ab17b6099e9226296af45967d0

Thanks to Jessica Clarke, Ronny Kotzschmar and ptpt52 github user

Reviewed-by: Jessica Clarke <jrtc27@jrtc27.com>
Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
2 years agoMerge tag 'dm-pull-30jan22' of https://source.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Mon, 31 Jan 2022 14:26:54 +0000 (09:26 -0500)]
Merge tag 'dm-pull-30jan22' of https://source.denx.de/u-boot/custodians/u-boot-dm

moveconfig fix
binman support for listing files with generated entries

2 years agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 31 Jan 2022 14:18:49 +0000 (14:18 +0000)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agopylint: Adjust how the output is produced
Simon Glass [Sat, 29 Jan 2022 04:31:07 +0000 (21:31 -0700)]
pylint: Adjust how the output is produced

The current Makefile rule requires there to be a 'Module' line in the
pylint output, like this:

   ************* Module binman.fip_util

This line only appears if pylint has some comments about the module. We
cannot rely on it for naming.

Update the code to instead use the filename as the identifier for each
score, so rather than:

   multiplexed_log 7.49

we output:

   test_multiplexed_log.py 7.20

It is still easy to see which file the score relates to. In fact the new
naming is nicer since the full subdirectories are shown.

The avoids the problem where a module name is not produced, and the output
gets out of sync.

Regenerate pylint.base so we can start from the current baseline.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Mon, 31 Jan 2022 12:45:13 +0000 (07:45 -0500)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-marvell

- kirkwood: Add Pogoplug-V4 support (Tony)
- kirkwood: GoFlex Home : Use Marvell PHY driver (Tony)
- Another set of kwboot improvements (Pali)
- Minor misc stuff

2 years agoarm: kirkwood: GoFlex Home : Use Marvell uclass mvgbe and PHY driver for Ethernet
Tony Dinh [Wed, 26 Jan 2022 03:33:44 +0000 (19:33 -0800)]
arm: kirkwood: GoFlex Home : Use Marvell uclass mvgbe and PHY driver for Ethernet

The GoFlex Home board has the network chip Marvell 88E1116R.
Use uclass mvgbe and the compatible driver M88E1118R to bring up Ethernet.

- Currently, CONFIG_RESET_PHY_R symbol is used in
arch/arm/mach-kirkwood/include/mach/config.h for all Kirkwood
boards with mv8831116 PHY, with each board defines the function
reset_phy(). Undefine it for this board.
- Add board_eth_init() to use uclass mvgbe to bring up the network.
And remove ad-hoc code.
- Enable CONFIG_PHY_MARVELL to properly configure the network.
- Miscellaneous changes: use CONFIG_SYS_THUMB_BUILD to keep u-boot image
under 512K, use BIT macro, and cleanup comments.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotools: kwboot: Set debug flag to 1
Pali Rohár [Tue, 25 Jan 2022 17:13:13 +0000 (18:13 +0100)]
tools: kwboot: Set debug flag to 1

This should enable BootROM output on UART.

(At least on A385 BootROM this is broken, BootROM ignores this debug
 flag and does not enable its output on UART if some valid image is
 available in SPI-NOR.)

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotools: kwboot: Fix usage of -D without -t
Pali Rohár [Tue, 25 Jan 2022 17:13:12 +0000 (18:13 +0100)]
tools: kwboot: Fix usage of -D without -t

When -D is specified then both bootmsg and debugmsg are not set, but
imgpath is set. Fix this check for valid and required parameters.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotools: kwboot: Handle EINTR in kwboot_tty_recv()
Pali Rohár [Tue, 25 Jan 2022 17:13:11 +0000 (18:13 +0100)]
tools: kwboot: Handle EINTR in kwboot_tty_recv()

The select() and read() syscalls may be interrupted. Handle EINTR and
retry them.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotools: kwboot: Handle EINTR in kwboot_write()
Pali Rohár [Tue, 25 Jan 2022 17:13:10 +0000 (18:13 +0100)]
tools: kwboot: Handle EINTR in kwboot_write()

The write() syscall may be interrupted. Handle EINTR and retry it.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotools: kwboot: Remove 2s delay before sending first xmodem packet
Pali Rohár [Tue, 25 Jan 2022 17:13:09 +0000 (18:13 +0100)]
tools: kwboot: Remove 2s delay before sending first xmodem packet

This delay is not needed anymore since kwboot already handles retrying
logic for incomplete xmodem packets and also forces BootROM to flush its
input queue. Removing it decreases total transfer time.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotools: kwboot: Force BootROM to flush input queue after boot pattern
Pali Rohár [Tue, 25 Jan 2022 17:13:08 +0000 (18:13 +0100)]
tools: kwboot: Force BootROM to flush input queue after boot pattern

Force the BootROM to flush its input queue after sending boot pattern.

This ensures that after function kwboot_bootmsg() finishes, BootROM is
able to start receiving xmodem packets without any specific delay or
setup.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotools: kwboot: Allow to use option -b without image path
Pali Rohár [Tue, 25 Jan 2022 17:13:07 +0000 (18:13 +0100)]
tools: kwboot: Allow to use option -b without image path

Allow option -b without image path parameter, to send boot pattern and
wait for response but not send any image. This allows to use kwboot just
for processing boot pattern and user can use any other xmodem tool for
transferring the image itself (e.g. sx). Useful for debugging purposes.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotools: kwboot: Show 'E' in progress output when error occurs
Pali Rohár [Tue, 25 Jan 2022 17:13:06 +0000 (18:13 +0100)]
tools: kwboot: Show 'E' in progress output when error occurs

When kwboot is unable to resend current xmodem packet, show an 'E' in the
progress output instead of a '+'. This allows to distinguish between the
state when kwboot is retrying sending the packet and when retry is not
possible.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotools: kwboot: Fix handling of repeated xmodem packets
Pali Rohár [Tue, 25 Jan 2022 17:13:05 +0000 (18:13 +0100)]
tools: kwboot: Fix handling of repeated xmodem packets

Unfortunately during some stages of xmodem transfer, A385 BootROM is not
able to handle repeated xmodem packets. So if an error occurs during that
stage, stop the transfer and return failure.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotools: kwboot: Do not change received character in kwboot_xm_recv_reply()
Pali Rohár [Tue, 25 Jan 2022 17:13:04 +0000 (18:13 +0100)]
tools: kwboot: Do not change received character in kwboot_xm_recv_reply()

Marvell BootROM expects retransmission of previous xmodem packet only in
the case when it sends NAK response to the host.

Do not change non-xmodem response (possibly UART transfer error) to NAK
in kwboot_xm_recv_reply() function. Allow caller to receive original
response from device.

Change argument 'nak_on_non_xm' to 'stop_on_non_xm'. Instead of changing
non-xmodem character to NAK, stop processing on invalid character and
return it.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotools: kwboot: Remove code for handling CAN byte
Pali Rohár [Tue, 25 Jan 2022 17:13:03 +0000 (18:13 +0100)]
tools: kwboot: Remove code for handling CAN byte

It is unknown why handling of CAN byte was added into kwboot tool as
Marvell BootROM does not support CAN byte. It never sends CAN byte to host
and if host sends CAN byte BootROM handles it as an unknown byte.

Remove code for handling and sending CAN bytes from the kwboot tool.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotools: kwboot: Improve retrying logic for incomplete xmodem packets
Pali Rohár [Tue, 25 Jan 2022 17:13:02 +0000 (18:13 +0100)]
tools: kwboot: Improve retrying logic for incomplete xmodem packets

Sometimes if the first byte of xmodem packet (SOH) is incorrectly
transmitted, BootROM sends NAK for every non-SOH received byte, which
makes BootROM and the host kwboot tool out of sync. BootROM automatically
re-synchronizes after 2s pause by dropping its input queue. So when
attempting retransmit for 9th time or later, ignore NAK reply from BootROM
and either wait for valid ACK or let kwboot timeout, which implies
re-synchronization.

This fixes retransmission of xmodem packets and allows kwboot to work also
without "Waiting ... and flushing tty" code which is at the beginning of
kwboot xmodem transfer.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotools: kwboot: Wait blk_rsp_timeo when flushing
Pali Rohár [Tue, 25 Jan 2022 17:13:01 +0000 (18:13 +0100)]
tools: kwboot: Wait blk_rsp_timeo when flushing

Use the blk_rsp_timeo variable when sleeping before flushing tty.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotools: kwboot: Increase blk_rsp_timeo to 2s
Pali Rohár [Tue, 25 Jan 2022 17:13:00 +0000 (18:13 +0100)]
tools: kwboot: Increase blk_rsp_timeo to 2s

Fix xmodem retry mechanism if some bytes from xmodem packet were lost and
BootROM is still waiting for completing previous xmodem packet.

It is required to wait at least 1.312s on A385, otherwise BootROM does not
accept next xmodem packet if previous one was not completely transferred.

2s should be enough timeout cause that BootROM will drop incomplete xmodem
packet and expects new packet.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: kirkwood: Pogoplug V4 : Use Marvell network PHY driver
Tony Dinh [Tue, 25 Jan 2022 10:00:48 +0000 (02:00 -0800)]
arm: kirkwood: Pogoplug V4 : Use Marvell network PHY driver

The Pogoplug V4 board has the network chip Marvell 88E1116R. So to
properly configure the network, enable CONFIG_PHY_MARVELL to activate
the compatible driver M88E1118R.

- This patch depends on the series:
https://patchwork.ozlabs.org/project/uboot/patch/20220124061712.28316-2-mibodhi@gmail.com/

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
2 years agoarm: kirkwood: Pogoplug-V4 : Add board implementation files
Tony Dinh [Mon, 24 Jan 2022 06:17:12 +0000 (22:17 -0800)]
arm: kirkwood: Pogoplug-V4 : Add board implementation files

Add board header, defconfig, and implementation files for Pogoplug V4.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Pali Rohár <pali@kernel.org>
2 years agoarm: kirkwood: Pogoplug-V4 : Add Kconfig files
Tony Dinh [Mon, 24 Jan 2022 06:17:11 +0000 (22:17 -0800)]
arm: kirkwood: Pogoplug-V4 : Add Kconfig files

Add Kconfig files for Pogoplug V4 board

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Pali Rohár <pali@kernel.org>
2 years agoarm: kirkwood: Pogoplug-V4 : Add DTS files
Tony Dinh [Mon, 24 Jan 2022 06:17:10 +0000 (22:17 -0800)]
arm: kirkwood: Pogoplug-V4 : Add DTS files

Add DTS files for Pogoplug V4 board

Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Pali Rohár <pali@kernel.org>
2 years agoarm: mvebu: Espressobin: Fix URLs in comments
Pali Rohár [Fri, 21 Jan 2022 11:01:15 +0000 (12:01 +0100)]
arm: mvebu: Espressobin: Fix URLs in comments

Use versioned URLs for line numbers as branches are moving in the time and
use master branch for mv-ddr-marvell where is up-to-date code.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agobinman: Skip node generation for images read from files
Jan Kiszka [Fri, 28 Jan 2022 19:37:53 +0000 (20:37 +0100)]
binman: Skip node generation for images read from files

We can and should run the node generator only when creating a new image.
When we read it back, there is no need to generate nodes - they already
exits, and binman does not dive that deep into the image - and there is
no way to provide the required fdt-list. So store the mode in the image
object so that Entry_fit can simply skip generator nodes when reading
them from an fdtmap.

This unbreaks all read-backs of images that contain generator nodes in
their fdtmap. To confirm this, add a corresponding test case.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Add SPDX to dts file:
Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agomoveconfig: Fix code relying on now-stripped newline characters
Alper Nebi Yasak [Sat, 29 Jan 2022 15:22:08 +0000 (18:22 +0300)]
moveconfig: Fix code relying on now-stripped newline characters

Commit 37f815cad07d ("moveconfig: Use a function to read files") adds a
helper function that can read a file as lines, but strips the newline
characters. This change broke parts of moveconfig code that relied on
their existence, resulting in a few issues:

Configs that are defined as empty aren't removed from header files (e.g.
"#define CONFIG_REMAKE_ELF"). Make regex patterns use '\b' to match word
boundaries instead of '\W' (which matched the newlines) so these lines
still match and get removed.

All changes in defconfig are considered removed by savedefconfig even
if they weren't, and line continuations in the headers aren't recognized
and removed properly, because their checks explicitly look for a newline
character. Remove the character from both comparisons.

The printed diff of header files is wrongly formatted and raises an
IndexError if a blank line was removed. Let print() print the new lines,
and use size-independent ways to check strings to fix the diff output.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2 years agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Sun, 30 Jan 2022 22:12:34 +0000 (17:12 -0500)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi

a bit delayed, the first batch of the sunxi pull request for this cycle.
This is mostly collecting some patches that were lying around for a
while, plus some recent fixes. Nothing too exciting at this point, but
of course they should be merged nevertheless.
There is the much bigger F1C100s SoC support coming up, which I hope to
be able to send in the next few days, along with the removal of sunxi's
lowlevel_init usage.

Compile tested for all 159 sunxi boards, plus briefly tested on BananaPi
M1, OrangePi Zero, Pine64 and Pine-H64.

2 years agomkimage: sunxi_egon: Allow overriding the padding size
Samuel Holland [Wed, 13 Oct 2021 00:21:27 +0000 (19:21 -0500)]
mkimage: sunxi_egon: Allow overriding the padding size

Due to a bug in the H3 SoC, where the CPU 0 hotplug flag cannot be
written, resuming CPU 0 requires using the "Super Standby" code path in
the BROM instead of the hotplug path. This path requires jumping to an
eGON image in SRAM.

This resume image, whose single purpose is to jump back to the secure
monitor, only needs to contain a single instruction. Padding the image
to 8 KiB would be wasteful of SRAM. Hook up the -B (block size) option
so users can set the block/padding size.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agosunxi: Fix H616 DRAM read calibration for dual rank
Jernej Skrabec [Sat, 29 Jan 2022 15:58:43 +0000 (16:58 +0100)]
sunxi: Fix H616 DRAM read calibration for dual rank

Although it isn't known what bit 0 in PHY reg 8 does, it's obvious that
it has to be set before read calibration and cleared afterwards. This is
already done for first rank, but not for second (copy & paste error.)

Fix it.

Fixes: f4317dbd06b6 ("sunxi: Add H616 DRAM support")
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agosunxi: fix H616 DRAM ODT support
Jernej Skrabec [Sat, 29 Jan 2022 15:58:42 +0000 (16:58 +0100)]
sunxi: fix H616 DRAM ODT support

Kconfig symbol is missing CONFIG_ prefix, so compiler will always
skip ODT configuration.

Fix symbol name.

Fixes: f4317dbd06b6 ("sunxi: Add H616 DRAM support")
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agosunxi: Add option to prevent booting on power plug-in
Chris Morgan [Fri, 21 Jan 2022 13:37:32 +0000 (13:37 +0000)]
sunxi: Add option to prevent booting on power plug-in

For sunxi boards with the AXP209, AXP221, AXP809, and AXP818 PMICs
(plus possibly others, I only confirmed the datasheets for these),
it is sometimes desirable to not boot whenever the device is
plugged in. An example would be when using the NTC CHIP inside a
PocketCHIP.
This provides a configurable option to check if bit 0 of
register 0 of the PMIC says it was powered because of a power button
press (0) or a plug-in event (1). If the value is 1 and this option
is selected, the device shuts down shortly after printing a message
to console stating the reason why it's shutting down. Powering up the
board with the power button is not affected.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
[Andre: reword to speak of boot, remove #ifdefs]
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agopmic: axp: define ALDO_IN startup bit
Andre Przywara [Fri, 21 Jan 2022 13:37:31 +0000 (13:37 +0000)]
pmic: axp: define ALDO_IN startup bit

Most AXP PMICs feature a "startup source" register, which keeps
information about how the PMIC started operation. Bit 0 in there means
it has been started by "plugging in the power cable".

Define a symbol in each PMIC's header file to be able to use that
register and bit later on.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agosunxi: gpio: Fix up pointer arithmetic
Andre Przywara [Sun, 30 Jan 2022 01:19:42 +0000 (01:19 +0000)]
sunxi: gpio: Fix up pointer arithmetic

The calls for flipping bits in the Allwinner pin controller registers
were using unnecessarily complex pointer arithmetic.

Improve readability by simplifying the expression.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agommc: sunxi: Use DM_GPIO flags to set pull-up
Samuel Holland [Thu, 21 Oct 2021 04:52:57 +0000 (23:52 -0500)]
mmc: sunxi: Use DM_GPIO flags to set pull-up

Now that the sunxi_gpio driver handles pull-up/down via the driver
model, pin configuration does not need a platform-specific function.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Tested-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agogpio: sunxi: Implement .set_flags
Samuel Holland [Thu, 21 Oct 2021 04:52:56 +0000 (23:52 -0500)]
gpio: sunxi: Implement .set_flags

This, along with gpio_flags_xlate(), allows the GPIO driver to handle
pull-up/down flags provided by consumer drivers or in the device tree.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agosunxi: gpio: Add per-bank drive and pull setters
Samuel Holland [Thu, 21 Oct 2021 04:52:55 +0000 (23:52 -0500)]
sunxi: gpio: Add per-bank drive and pull setters

The GPIO and pinctrl drivers need these setters for pin configuration.
Since they are DM drivers, they should not be using hardcoded base
addresses. Factor out variants of the setter functions which take a
pointer to the GPIO bank's MMIO registers.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agosunxi: gpio: Return void from setter functions
Samuel Holland [Thu, 21 Oct 2021 04:52:54 +0000 (23:52 -0500)]
sunxi: gpio: Return void from setter functions

The return values of these functions are always zero, and they are
never checked. Since they are not needed, remove them.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agosunxi: dram_sun4i/5i: use DRAM_MEMORY_TYPE_DDR3 instead of magic number 3
Giulio Benetti [Thu, 2 Dec 2021 23:57:54 +0000 (00:57 +0100)]
sunxi: dram_sun4i/5i: use DRAM_MEMORY_TYPE_DDR3 instead of magic number 3

Since DRAM_MEMORY_TYPE_DDR3 is defined let's use it instead of magic
number 3.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agoi2c: mvtwsi: Add compatible string for allwinner, sun4i-a10-i2c
Chris Morgan [Fri, 7 Jan 2022 17:52:54 +0000 (11:52 -0600)]
i2c: mvtwsi: Add compatible string for allwinner, sun4i-a10-i2c

This adds a compatible string for the Allwinner Sun4i-A10 I2C
controller. Without this, boards based on the R8 and A13 (at a
minimum) fail to boot.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Acked-by: Akash Gajjar <gajjar04akash@gmail.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agosunxi: call fdt_fixup_ethernet again to set macaddr for more aliases
Icenowy Zheng [Sat, 11 Sep 2021 17:39:16 +0000 (19:39 +0200)]
sunxi: call fdt_fixup_ethernet again to set macaddr for more aliases

Sometimes some ethernet aliases do not exist in U-Boot DT but they
exist in the DT used to boot the system (for example, modified via DT
overlays). In this situation setup_environment is called again in
ft_board_setup() to generate macaddr environment variable for them.
However now the call to fdt_fixup_ethernet() is moved before the call
of ft_board_setup().

Call fdt_fixup_ethernet() again to add MAC addresses for the extra
ethernet aliases.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
[updated commit message]
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agosunxi: SPI: fix pinmuxing for Allwinner H6 SoCs
Daniel Wagenknecht [Thu, 16 Dec 2021 19:42:10 +0000 (20:42 +0100)]
sunxi: SPI: fix pinmuxing for Allwinner H6 SoCs

The driver for SPI0 on Allwinner H6 SoCs did not use the correct define
SUN50I_GPC_SPI0 for the pin function, but one for a different Allwinner
SoC series.

Fix the conditionals to use the correct define for H6 SoCs. This matches
the conditional logic in the SPL spi driver.

Tested by probing the spi-flash on a pine64_h64-model-b board with
adapted device-tree (disable mmc2, enable spi0).

Signed-off-by: Daniel Wagenknecht <dwagenk@mailbox.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agoMerge tag 'efi-2022-04-rc1-3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sat, 29 Jan 2022 18:50:19 +0000 (13:50 -0500)]
Merge tag 'efi-2022-04-rc1-3' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2022-04-rc1-3

Documentation:

* update Nokia RX-51 documentation and move it to rst
* describe boot switch settings for HiFive Unmatched board

UEFI:

* fix the checking of images hashes and signatures
* provide the RISCV_EFI_BOOT_PROTOCOL

2 years agoMerge branch '2022-01-28-assorted-fixes'
Tom Rini [Sat, 29 Jan 2022 18:42:58 +0000 (13:42 -0500)]
Merge branch '2022-01-28-assorted-fixes'

- Extend the pci command to support a few more features.
- Add support for custom SPL boot device names (so it's easier for users
  to understand)
- Updates for am64x to address some review comments.
- Migration deadline notice for DM_SERIAL
- coreboot payload test
- Support rsa3072 signatures.
- DFU should skip writing empty UBI pages, bootcount printf format char
  correction.