]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
3 months agoMerge tag 'u-boot-imx-next-20240902' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Mon, 2 Sep 2024 22:03:02 +0000 (16:03 -0600)]
Merge tag 'u-boot-imx-next-20240902' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next

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

- Enable SPI NOR flash support and MTD partitions for phycore_imx8mp.
- Convert mx6slevk to OF_UPSTREAM and watchdog DM.
- Cleanup some mx5/mx6 USB options.
- Make PLL settings configurable at board level.
- Set CONFIG_SPL_LOAD_FIT_ADDRESS for verdin-imx8m/p.
- Make the mxc-gpio reading state of GPIO pins in output mode to be
  consistent with the Linux kernel.
- Add HUK derivation support for ELE AHAB.

3 months agoMerge tag 'u-boot-amlogic-next-20240902' of https://source.denx.de/u-boot/custodians...
Tom Rini [Mon, 2 Sep 2024 22:02:37 +0000 (16:02 -0600)]
Merge tag 'u-boot-amlogic-next-20240902' of https://source.denx.de/u-boot/custodians/u-boot-amlogic into next

- meson_nand: R/W support for pages used by boot ROM

3 months agoMerge tag 'v2024.10-rc4' into next
Tom Rini [Mon, 2 Sep 2024 20:13:57 +0000 (14:13 -0600)]
Merge tag 'v2024.10-rc4' into next

Prepare v2024.10-rc4

3 months agoPrepare v2024.10-rc4
Tom Rini [Mon, 2 Sep 2024 20:07:53 +0000 (14:07 -0600)]
Prepare v2024.10-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
3 months agoARM: imx: Wrap i.MX config options in MACH_IMX
Marek Vasut [Sun, 1 Sep 2024 00:38:00 +0000 (02:38 +0200)]
ARM: imx: Wrap i.MX config options in MACH_IMX

Wrap all the i.MX specific options in MACH_IMX, otherwise they keep
showing up in other SoC vendor configurations. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 months agoMerge tag 'dm-pull-1sep24' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Sun, 1 Sep 2024 21:56:22 +0000 (15:56 -0600)]
Merge tag 'dm-pull-1sep24' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm

Minor fixes for qconfig and patman

3 months agoqconfig: Fix an incorrect format-string with negative value
Simon Glass [Wed, 21 Aug 2024 23:52:24 +0000 (17:52 -0600)]
qconfig: Fix an incorrect format-string with negative value

This is not allowed, so use ljust() instead. This fixes the
'qconfig -i -I help' command.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 1bd43060b3e ("moveconfig: Use f strings where possible")
3 months agopatman: Resolve python string vs. regex escaping syntax
Brian Norris [Fri, 26 Jul 2024 19:02:33 +0000 (12:02 -0700)]
patman: Resolve python string vs. regex escaping syntax

Python strings have their own notion of backslash-escaping, and that can
conflict with the intentions for strings passed to the 're' module. In
particular, I get warnings like this:

tools/patman/../patman/commit.py:9: SyntaxWarning: invalid escape sequence '\s'
  re_subject_tag = re.compile('([^:\s]*):\s*(.*)')

We should use a raw string (r'...') so that all escaping is passed into
the regex module, not interpreted within the string itself.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agoARM: imx: Make PLL settings configurable at board level
Marek Vasut [Tue, 27 Aug 2024 20:04:27 +0000 (22:04 +0200)]
ARM: imx: Make PLL settings configurable at board level

Staticize intpll_configure(). Add weak board_imx_intpll_override()
function which can be defined at board level to override specific
PLL frequency settings early during boot. This can be used to for
example force faster CPU core clock frequency if the hardware can
handle it.

Example of increasing CPU core clock to 1600 MHz on i.MX8M Plus:
```
int board_imx_intpll_override(enum pll_clocks pll, ulong *freq)
{
       if (pll == ANATOP_ARM_PLL)
               *freq = MHZ(1600);
       return 0;
}
```

Signed-off-by: Marek Vasut <marex@denx.de>
4 months agoimx: Remove CFG_MXC_USB_PORTSC
Fabio Estevam [Sat, 31 Aug 2024 01:43:40 +0000 (22:43 -0300)]
imx: Remove CFG_MXC_USB_PORTSC

The definition of CFG_MXC_USB_PORTSC as (PORT_PTS_UTMI | PORT_PTS_PTW)
can be removed from mx5/mx6/mx7/mx8m board config files as it is the
default in drivers/usb/host/ehci-mx5.c and drivers/usb/host/ehci-mx6.c.

Suggested-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Tim Harvey <tharvey@gateworks.com>
4 months agomx5: Remove CFG_MXC_USB_PORT
Fabio Estevam [Wed, 28 Aug 2024 13:25:28 +0000 (10:25 -0300)]
mx5: Remove CFG_MXC_USB_PORT

CFG_MXC_USB_PORT is not used anywhere, so remove this unused symbol.

Suggested-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Marek Vasut <marex@denx.de>
4 months agousb: ehci-mx5: Add a default for CFG_MXC_USB_PORTSC
Fabio Estevam [Wed, 28 Aug 2024 13:25:27 +0000 (10:25 -0300)]
usb: ehci-mx5: Add a default for CFG_MXC_USB_PORTSC

Just like drivers/usb/host/ehci-mx6.c, add a default for
drivers/usb/host/ehci-mx5.c.

The motivation for doing this is to remove CFG_MXC_USB_PORTSC
from board config files.

All the mx5 boards, with the exeption of mx51evk, define
CFG_MXC_USB_PORTSC as:

 #define CFG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)

So move this definition as a default into ehci-mx5.c.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Marek Vasut <marex@denx.de>
4 months agoimx: Remove CFG_MXC_USB_FLAGS
Fabio Estevam [Sat, 31 Aug 2024 01:38:23 +0000 (22:38 -0300)]
imx: Remove CFG_MXC_USB_FLAGS

CFG_MXC_USB_FLAGS is only used for drivers/usb/host/ehci-mx5.c, so it
can be removed from all the imx6/imx7/imx8m board config files.

mx51evk.h is the only place CFG_MXC_USB_FLAGS is not set to 0.

Suggested-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
4 months agoconfigs: verdin-imx8m[mp]: set CONFIG_SPL_LOAD_FIT_ADDRESS
Rogerio Guerra Borin [Thu, 29 Aug 2024 11:23:57 +0000 (08:23 -0300)]
configs: verdin-imx8m[mp]: set CONFIG_SPL_LOAD_FIT_ADDRESS

Set the CONFIG_SPL_LOAD_FIT_ADDRESS for both verdin-imx8mm and
verdin-imx8mp configurations to specify the load address for FIT images
loaded by the SPL.

As per lastest instructions from NXP, the generation of a HABv4 CSF
(Command Sequence File) requires the U-Boot FIT image (u-boot.itb) load
address to be set to a fixed value when binman is used. The address is
defined by CONFIG_SPL_LOAD_FIT_ADDRESS.

Here we set CONFIG_SPL_LOAD_FIT_ADDRESS to an address 64MB past the
start of the DDR memory leaving plenty of room for the various DDR-
residing artifacts to be moved to their usual load addresses which are
close to the start of the DDR.

Signed-off-by: Rogerio Guerra Borin <rogerio.borin@toradex.com>
Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
Acked-by: Francesco Dolcini <francesco.dolcini@toradex.com>
4 months agogpio: mxc_gpio: fix reading state of GPIO pins in output mode
Tomas Paukrt [Wed, 28 Aug 2024 13:09:48 +0000 (15:09 +0200)]
gpio: mxc_gpio: fix reading state of GPIO pins in output mode

The PSR register works correctly for GPIO pins in input mode,
but always returns 0 for GPIO pins in output mode unless the SION
bit is set.

The DR register should be used for GPIO pins in output mode
to allow correct getting of previously set output value.

Please note that the Linux gpio-mxc driver and the NXP U-Boot mxc_gpio
driver already use the DR register for all GPIO pins in output mode:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=442b2494b17d1a4f0a14721580271eb23ebffd42
https://github.com/nxp-imx/uboot-imx/commit/4afc3f90943c6b117f79b66d2cd04e64f437b0c2

Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Fabio Estevam <festevam@gmail.com>
4 months agoMerge patch series "Add support for Ethernet Boot on SK-AM62"
Tom Rini [Fri, 30 Aug 2024 20:02:03 +0000 (14:02 -0600)]
Merge patch series "Add support for Ethernet Boot on SK-AM62"

Chintan Vankar <c-vankar@ti.com> says:

This series enables Ethernet Boot on SK-AM62 device.

This series is based on commit 'f4f845b85926' of origin/next branch of
U-Boot.

Logs for Ethernet Boot for AM625-SK:
https://gist.github.com/chintanv133/464782796a9a60b9f5a49e674c5fc31a

4 months agoarm64: dts: ti: k3-am62x-sk-common: Add bootph-all property in phy_gmii_sel node
Chintan Vankar [Mon, 26 Aug 2024 10:25:15 +0000 (15:55 +0530)]
arm64: dts: ti: k3-am62x-sk-common: Add bootph-all property in phy_gmii_sel node

Add missing bootph-all property for CPSW MAC's PHY node
phy_gmii_sel.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Chintan Vankar <c-vankar@ti.com>
Link: https://lore.kernel.org/r/20240430085048.3143665-1-c-vankar@ti.com
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
[ upstream commit: ba50141137fae205a731005e70687f4a52289050 ]

(cherry picked from commit 2bdd1743a9f6515efe7c3648a25d63b4a9ce4a10)

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
4 months agoarm: dts: k3-am625-r5-sk: Enable DM services for main_pktdma
Siddharth Vadapalli [Mon, 26 Aug 2024 10:25:14 +0000 (15:55 +0530)]
arm: dts: k3-am625-r5-sk: Enable DM services for main_pktdma

Enable DM services for main_pktdma during R5 SPL stage.

Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Signed-off-by: Chintan Vankar <c-vankar@ti.com>
4 months agoconfigs: am62: Enable configs required for Ethboot
Kishon Vijay Abraham I [Mon, 26 Aug 2024 10:25:13 +0000 (15:55 +0530)]
configs: am62: Enable configs required for Ethboot

Enable config options needed to support Ethernet boot on AM62x SK.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Signed-off-by: Chintan Vankar <c-vankar@ti.com>
4 months agoconfigs: am62: Add configs for enabling ETHBOOT in R5SPL
Kishon Vijay Abraham I [Mon, 26 Aug 2024 10:25:12 +0000 (15:55 +0530)]
configs: am62: Add configs for enabling ETHBOOT in R5SPL

Add configs for enabling ETHBOOT in R5SPL.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Signed-off-by: Chintan Vankar <c-vankar@ti.com>
4 months agoarm: mach-k3: am62x: am625_init: Probe AM65 CPSW NUSS
Kishon Vijay Abraham I [Mon, 26 Aug 2024 10:25:11 +0000 (15:55 +0530)]
arm: mach-k3: am62x: am625_init: Probe AM65 CPSW NUSS

In order to support Ethernet boot on AM62x, probe AM65 CPSW NUSS
driver in board_init_f().

Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Signed-off-by: Chintan Vankar <c-vankar@ti.com>
4 months agodma: ti: k3-udma: Add support for native configuration of chan/flow
Kishon Vijay Abraham I [Mon, 26 Aug 2024 10:25:10 +0000 (15:55 +0530)]
dma: ti: k3-udma: Add support for native configuration of chan/flow

In absence of Device Manager (DM) services such as at R5 SPL stage,
driver will have to natively setup TCHAN/RCHAN/RFLOW cfg registers.
Existing UDMA driver performed the above mentioned configuration
for UDMA. Add similar configuration for PKTDMA here.

Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Signed-off-by: Chintan Vankar <c-vankar@ti.com>
4 months agosoc: ti: k3-navss-ringacc: Fix reconfiguration of qmode API
Chintan Vankar [Mon, 26 Aug 2024 10:25:09 +0000 (15:55 +0530)]
soc: ti: k3-navss-ringacc: Fix reconfiguration of qmode API

Function "k3_ringacc_ring_reconfig_qmode_raw()" should reset qmode to
requested value and should not update other fields in ring configuration
register.

Signed-off-by: Chintan Vankar <c-vankar@ti.com>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>
4 months agosoc: ti: k3-navss-ringacc: Fix reset ring API
Vignesh Raghavendra [Mon, 26 Aug 2024 10:25:08 +0000 (15:55 +0530)]
soc: ti: k3-navss-ringacc: Fix reset ring API

Expectation of k3_ringacc_ring_reset_raw() is to reset the ring to
requested size and not to 0. Fix this.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Signed-off-by: Chintan Vankar <c-vankar@ti.com>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
4 months agosoc: ti: k3-navss-ringacc: Initialize base address of ring cfg registers
Kishon Vijay Abraham I [Mon, 26 Aug 2024 10:25:07 +0000 (15:55 +0530)]
soc: ti: k3-navss-ringacc: Initialize base address of ring cfg registers

Initialize base address of ring config registers required to natively
setup ring cfg registers in the absence of Device Manager (DM) services
at R5 SPL stage. Since register property is defined as "ring" for PKTDMA
and "cfg" for UDMA, configure base address of ring configuration register
accordingly.

Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Signed-off-by: Chintan Vankar <c-vankar@ti.com>
4 months agofirmware: ti_sci: Add No-OP for "RX_FL_CFG"
Kishon Vijay Abraham I [Mon, 26 Aug 2024 10:25:06 +0000 (15:55 +0530)]
firmware: ti_sci: Add No-OP for "RX_FL_CFG"

RX_FL_CFG message should not be forwarded to TIFS and should be
handled within R5 SPL (when DM services are not available). Add
a no-op function to not handle RX_FL_CFG messages.

Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Signed-off-by: Chintan Vankar <c-vankar@ti.com>
4 months agocommon: spl: spl: Init DRAM size in R5/A53 SPL
Chintan Vankar [Mon, 26 Aug 2024 10:25:05 +0000 (15:55 +0530)]
common: spl: spl: Init DRAM size in R5/A53 SPL

Initialize DRAM size in SPL stage since networking requires DDR
to be initialized.

Reviewed-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Chintan Vankar <c-vankar@ti.com>
4 months agolib: crypto: fix ASYMMETRIC_KEY_TYPE dependency
Tomas Paukrt [Tue, 27 Aug 2024 17:38:09 +0000 (19:38 +0200)]
lib: crypto: fix ASYMMETRIC_KEY_TYPE dependency

Fix the dependency to avoid a warning if RSA_VERIFY_WITH_PKEY is enabled.

Fixes: b7463f198da6 ("Make ASYMMETRIC_KEY_TYPE depend on FIT_SIGNATURE")
Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz>
4 months agolist: use list_count_nodes() to count list entries
Sughosh Ganu [Wed, 28 Aug 2024 16:54:22 +0000 (22:24 +0530)]
list: use list_count_nodes() to count list entries

Use the API function list_count_nodes() to count the number of list
entries.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agomx6slevk: Convert to OF_UPSTREAM
Fabio Estevam [Mon, 26 Aug 2024 18:04:54 +0000 (15:04 -0300)]
mx6slevk: Convert to OF_UPSTREAM

Instead of using the local imx6sl-evk, imx6sl-pinfunc.h and
imx6sl.dtsi devicetree copies from U-Boot, convert the imx6sl-evk board
to OF_UPSTREAM so that the upstream kernel devicetree can be used instead.

Signed-off-by: Fabio Estevam <festevam@denx.de>
4 months agomx6slevk: Keep a single defconfig
Fabio Estevam [Mon, 26 Aug 2024 18:04:53 +0000 (15:04 -0300)]
mx6slevk: Keep a single defconfig

Remove mx6slevk_spinor_defconfig and mx6slevk_spl_defconfig in
favor of having a single mx6slevk_defconfig to help reducing
the maintenance effort.

Signed-off-by: Fabio Estevam <festevam@denx.de>
4 months agomx6slevk: Fix the boot device number
Fabio Estevam [Mon, 26 Aug 2024 18:04:52 +0000 (15:04 -0300)]
mx6slevk: Fix the boot device number

The SD card is registered as mmc device 0.

Fix it accordingly so that the board can boot to Linux
from the SD card.

Signed-off-by: Fabio Estevam <festevam@denx.de>
4 months agomx6slevk: Convert to watchdog driver model
Fabio Estevam [Mon, 26 Aug 2024 18:04:51 +0000 (15:04 -0300)]
mx6slevk: Convert to watchdog driver model

Commit 68dcbdd594d4 ("ARM: imx: Add weak default reset_cpu()") caused
the 'reset' command in U-Boot to not cause a board reset.

Fix it by switching to the watchdog driver model via sysreset, which
is the preferred method for implementing the watchdog reset.

Signed-off-by: Fabio Estevam <festevam@denx.de>
4 months agoboard: phytec: phycore_imx8mp: Add mtd spi partitions
Benjamin Hahn [Mon, 26 Aug 2024 16:49:06 +0000 (18:49 +0200)]
board: phytec: phycore_imx8mp: Add mtd spi partitions

Depending on if a SPI-NOR flash is populated add the mtd partition
table to the device tree. For this we have to also probe the
flash before booting.

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>
4 months agoconfigs: phycore-imx8mp_defconfig: Enable SPI NOR flash support
Benjamin Hahn [Mon, 26 Aug 2024 16:49:05 +0000 (18:49 +0200)]
configs: phycore-imx8mp_defconfig: Enable SPI NOR flash support

Enable SPI NOR flash support in U-Boot.

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>
4 months agoimx: ele_ahab: Add HUK derivation support
Mathieu Othacehe [Mon, 26 Aug 2024 10:07:07 +0000 (12:07 +0200)]
imx: ele_ahab: Add HUK derivation support

Add a new ahab_derive command that derives the hardware unique key (HUK)
into a 16 or 32 bytes key and stores it at the given address.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
Reviewed-by: Ye Li <ye.li@nxp.com>
4 months agoMerge tag 'u-boot-imx-master-20240829' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Thu, 29 Aug 2024 14:15:37 +0000 (08:15 -0600)]
Merge tag 'u-boot-imx-master-20240829' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

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

- Fix an issue with "tools/buildman/buildman imx8ulp_evk"
  failing every other time.

4 months agomach-imx: do not use if_changed more than once per target
Jerome Forissier [Wed, 28 Aug 2024 15:36:37 +0000 (17:36 +0200)]
mach-imx: do not use if_changed more than once per target

doc/develop/makefiles.rst has the following note:

  if_changed should not be used more than once per target.
  It stores the executed command in a corresponding .cmd
  file and multiple calls would result in overwrites and
  unwanted results when the target is up to date and only the
  tests on changed commands trigger execution of commands.

The mach-imx Makefile does not follow this recommandation, so fix it
by implementing a single command that performs both the cpp_cfg
and imx9_check actions.

This change fixes an issue with "tools/buildman/buildman imx8ulp_evk"
failing every other time [1].

[1] https://lists.denx.de/pipermail/u-boot/2024-August/563192.html

Fixes: f637dfe8c468 ("mach-imx: Add i.MX93 binman support.")
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
4 months agobootstage: Fix unstash of records from SPL
Jonas Karlman [Sat, 3 Aug 2024 12:41:44 +0000 (12:41 +0000)]
bootstage: Fix unstash of records from SPL

The commit b81e31a1e6c5 ("bootstash: Do not provide a default address
for all") changed a bootstage unstash call to bootstage stash, this
has resulted in bootstage records stashed in SPL no longer get unstaged
in U-Boot proper. Fix this by changing back to a unstage call.

Fixes: b81e31a1e6c5 ("bootstash: Do not provide a default address for all")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 months agobootstage: Fix unstash of records from SPL
Jonas Karlman [Sat, 3 Aug 2024 12:41:44 +0000 (12:41 +0000)]
bootstage: Fix unstash of records from SPL

The commit b81e31a1e6c5 ("bootstash: Do not provide a default address
for all") changed a bootstage unstash call to bootstage stash, this
has resulted in bootstage records stashed in SPL no longer get unstaged
in U-Boot proper. Fix this by changing back to a unstage call.

Fixes: b81e31a1e6c5 ("bootstash: Do not provide a default address for all")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 months agomtd: rawnand: meson: read/write access for boot ROM pages
Arseniy Krasnov [Mon, 26 Aug 2024 13:17:10 +0000 (16:17 +0300)]
mtd: rawnand: meson: read/write access for boot ROM pages

Boot ROM on Meson needs some pages to be read/written in a special mode:
384 byte ECC mode (so called "short" by Amlogic) and with scrambling
enabled. Such pages are located on the chip in the following way (for
example):

[ p0 ][ p1 ][ p2 ][ p3 ][ p4 ][ p5 ][ p6 ][ p7 ] ... [ pN ]
  ^           ^           ^           ^

pX is page number "X". "^" means "special" page used by boot ROM - e.g.
every 2nd page in the range of [0, 7]. Step (2 here) and last page in
range is read from the device tree.

Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Link: https://lore.kernel.org/r/20240826131710.29746-4-avkrasnov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
4 months agomtd: rawnand: meson: refactor use of 'meson_nfc_cmd_access()'
Arseniy Krasnov [Mon, 26 Aug 2024 13:17:09 +0000 (16:17 +0300)]
mtd: rawnand: meson: refactor use of 'meson_nfc_cmd_access()'

Move call 'meson_nfc_cmd_seed()' and check for 'NAND_NEED_SCRAMBLING'
to 'meson_nfc_cmd_access()', thus removing code duplication.

Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Link: https://lore.kernel.org/r/20240826131710.29746-3-avkrasnov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
4 months agomtd: rawnand: nand_base: support for 'NAND_IS_BOOT_MEDIUM' flag
Arseniy Krasnov [Mon, 26 Aug 2024 13:17:08 +0000 (16:17 +0300)]
mtd: rawnand: nand_base: support for 'NAND_IS_BOOT_MEDIUM' flag

Based on Linux kernel:
commit f922bd798bb9 ("mtd: rawnand: add an option to specify NAND chip as a boot device")

Allow to define a NAND chip as a boot device. This can be helpful
for the selection of the ECC algorithm and strength in case the boot
ROM supports only a subset of controller provided options.

Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Link: https://lore.kernel.org/r/20240826131710.29746-2-avkrasnov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
4 months agommc: fix signed vs unsigned compare in read check in _spl_load()
Franco Venturi [Wed, 31 Jul 2024 13:09:00 +0000 (09:09 -0400)]
mmc: fix signed vs unsigned compare in read check in _spl_load()

Fix signed vs unsigned compare in read check in _spl_load()

Issue: when info->read() returns a negative value because of an error,
       the comparison of 'read' (signed) with 'sizeof(*header)'
       (unsigned silently converts the negative value into a very
       large unsigned value and the check on the error condition
       always return false, i.e. the error is not detected
Symptoms: if spl_load_image_fat() is unable to find the file 'uImage',
          the SPL phase of the boot process just hangs after displaying
          the following line:
          Trying to boot from MMC1
Fix: cast 'sizeof(*header)' to int so the compare is now between
     signed types
Reference: https://stackoverflow.com/questions/17293749/sizeof-operator-in-if-statement

Signed-off-by: Franco Venturi <fventuri@comcast.net>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
4 months agogpio: Add G7 Aspeed gpio controller driver
Billy Tsai [Tue, 20 Aug 2024 07:27:36 +0000 (15:27 +0800)]
gpio: Add G7 Aspeed gpio controller driver

In the 7th generation of the SoC from Aspeed, the control logic of the
GPIO controller has been updated to support per-pin control. Each pin now
has its own 32-bit register, allowing for individual control of the pin’s
value, direction, interrupt type, and other settings.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
4 months agotools/scripts/Kconfig: Update references from kconfig-language.txt to rst
Hiago De Franco [Mon, 19 Aug 2024 16:24:49 +0000 (13:24 -0300)]
tools/scripts/Kconfig: Update references from kconfig-language.txt to rst

The Linux kernel documentation has transitioned from using
kconfig-language.txt to kconfig-language.rst. Therefore update all
occurrences of kconfig-language.txt.

Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
4 months agodm: core: Make SPL_DM_SEQ_ALIAS select SPL_STRTO
Gaskell, Oliver [Mon, 19 Aug 2024 09:43:52 +0000 (09:43 +0000)]
dm: core: Make SPL_DM_SEQ_ALIAS select SPL_STRTO

Enabling CONFIG_DM_SEQ_ALIAS enables code which relies on
`trailing_strtol()` - which is only linked in SPL when CONFIG_SPL_STRTO
is enabled.

CONFIG_SPL_STRTO is not enabled by default - to ensure this function is
available in SPL, CONFIG_SPL_DM_SEQ_ALIAS should select
CONFIG_SPL_STRTO.

Signed-off-by: Oliver Gaskell <Oliver.Gaskell@analog.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agoarm: dts: nuvoton: add dts support for npcm845 yosemite4
Jim Liu [Mon, 19 Aug 2024 07:24:28 +0000 (15:24 +0800)]
arm: dts: nuvoton: add dts support for npcm845 yosemite4

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
4 months agolib: move phdr increment to for loop heading
Maxim Moskalets [Sat, 17 Aug 2024 11:02:22 +0000 (14:02 +0300)]
lib: move phdr increment to for loop heading

Shifting this pointer in the loop will be more logical when working
with the code later, because you can see at a glance what exactly
changes at each iteration. Moreover, the code remains equivalent
because this variable is not used after the loop.

Signed-off-by: Maxim Moskalets <maximmosk4@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agoMerge patch series "dm: core: Avoid multiple calls to fdt_parent_offset()"
Tom Rini [Tue, 27 Aug 2024 20:32:54 +0000 (14:32 -0600)]
Merge patch series "dm: core: Avoid multiple calls to fdt_parent_offset()"

Jonas Karlman <jonas@kwiboo.se> says:

Use of fdt_parent_offset() is very expensive as detailed by the function
documentation:

  NOTE: This function is expensive, as it must scan the device tree
  structure from the start to nodeoffset, *twice*.

This series remove multiple calls to fdt_parent_offset() or
ofnode_get_parent() when instead a single call can be made and the
returned value can be reused.

This series help reduce boot time by around:
- ~137ms on a Radxa ROCK Pi 4 (RK3399)
- ~33ms on a Radxa ZERO 3W (RK3566)

4 months agotimer: npcm: Change counter source
Jim Liu [Mon, 29 Jul 2024 09:04:06 +0000 (17:04 +0800)]
timer: npcm: Change counter source

The counter value read from TDR register may not be correct.
Read SECCNT and CNTR25M instead to get the correct timestamp.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
4 months agodm: core: regmap: Avoid multiple calls to ofnode_get_parent()
Jonas Karlman [Sun, 4 Aug 2024 15:05:51 +0000 (15:05 +0000)]
dm: core: regmap: Avoid multiple calls to ofnode_get_parent()

Until a live tree is used in U-Boot proper after relocation, use of
ofnode_get_parent() will trigger a call to the very expensive
fdt_parent_offset(), as detailed by the function documentation:

  NOTE: This function is expensive, as it must scan the device tree
  structure from the start to nodeoffset, *twice*.

Re-use the returned value from a single call instead of having to make
multiple calls for same node.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agodm: core: ofnode: Avoid multiple calls to ofnode_get_parent()
Jonas Karlman [Sun, 4 Aug 2024 15:05:50 +0000 (15:05 +0000)]
dm: core: ofnode: Avoid multiple calls to ofnode_get_parent()

Until a live tree is used in U-Boot proper after relocation, use of
ofnode_get_parent() will trigger a call to the very expensive
fdt_parent_offset() as detailed by the function documentation:

  NOTE: This function is expensive, as it must scan the device tree
  structure from the start to nodeoffset, *twice*.

Re-use the returned value from a single call instead of having to make
multiple calls for same node.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agodm: core: fdtaddr: Avoid multiple calls to fdt_parent_offset()
Jonas Karlman [Sun, 4 Aug 2024 15:05:49 +0000 (15:05 +0000)]
dm: core: fdtaddr: Avoid multiple calls to fdt_parent_offset()

Use of fdt_parent_offset() is very expensive as detailed by the function
documentation:

  NOTE: This function is expensive, as it must scan the device tree
  structure from the start to nodeoffset, *twice*.

Re-use the returned value from a single call instead of having to make
multiple calls for same nodeoffset.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agogpio: npcm: Add SGPIO support for Nuvoton NPCM SoCs
Jim Liu [Mon, 29 Jul 2024 08:51:03 +0000 (16:51 +0800)]
gpio: npcm: Add SGPIO support for Nuvoton NPCM SoCs

Add Nuvoton BMC NPCM7xx/NPCM8xx sgpio driver.
BMC can use this driver to increase 64 GPI pins and 64 GPO pins to use.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
4 months agotest/py: spi: Add tests for SPI flash device
Love Kumar [Wed, 31 Jul 2024 09:24:12 +0000 (14:54 +0530)]
test/py: spi: Add tests for SPI flash device

Add test cases for sf commands to verify various SPI flash operations
such as erase, write and read. It also adds qspi lock unlock cases.
This test relies on boardenv_* configurations to run it for different
SPI flash family such as single SPI, QSPI, and OSPI.

Signed-off-by: Love Kumar <love.kumar@amd.com>
4 months agocmd: bind: Use device sequence instead for driver bind/unbind
Zixun LI [Fri, 2 Aug 2024 09:28:13 +0000 (11:28 +0200)]
cmd: bind: Use device sequence instead for driver bind/unbind

Currently uclass index is used for bind/unbind which ignores alias
sequence numbering. Use device sequence number instead as it's
the number explicitly set in the DT.

Also update documentation to use sequence number.

Signed-off-by: Zixun LI <admin@hifiphile.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agodm: core: Show device sequence instead in dm_dump_tree()
Zixun LI [Fri, 2 Aug 2024 09:28:12 +0000 (11:28 +0200)]
dm: core: Show device sequence instead in dm_dump_tree()

Currently uclass index is shown in DM tree dump which ignores alias
sequence numbering. The result could be confusing since these 2 numbers
could be different. Show device sequence number instead as it's more
meaningful.

Also update documentation to use sequence number.

Signed-off-by: Zixun LI <admin@hifiphile.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agomtd: nand: raw: omap_gpmc: Check return value of gpmc_nand_init
Vignesh Raghavendra [Wed, 31 Jul 2024 14:58:55 +0000 (20:28 +0530)]
mtd: nand: raw: omap_gpmc: Check return value of gpmc_nand_init

If the function is called with no NAND device attached, then this
function can return error value, proceeding further ignoring the same
can cause system crash. This is seen when "mtd list" is run with no NAND
addon cards connected.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Acked-by: Roger Quadros <rogerq@kernel.org>
4 months agoomap3: omap3evm: Migrate to OF_UPSTREAM
Derald D. Woods [Sat, 24 Aug 2024 21:48:22 +0000 (17:48 -0400)]
omap3: omap3evm: Migrate to OF_UPSTREAM

This commit brings the omap3evm inline with the remaining OMAP3XXX variants.

Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
4 months agosandbox: Fix pinmux warnings with non-test devicetrees
Sean Anderson [Fri, 16 Aug 2024 02:38:22 +0000 (22:38 -0400)]
sandbox: Fix pinmux warnings with non-test devicetrees

The sandbox pinmux driver is used in the non-test devicetree as well as
the test one. I didn't realize this when I modified the driver for
tests, and so broke the regular use case (which only resulted in
warnings). First, making the pinmux and the UART group available
pre-relocation to avoid ENODEV errors. Then, convert the pin groups and
functions to the new style, adding onewire group as well.

Fixes: 7f0f1806e3a ("test: pinmux: Add test for pin muxing")
Closes: https://source.denx.de/u-boot/u-boot/-/issues/2
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agoata: sata_rescan must scan for block devices
Heinrich Schuchardt [Wed, 14 Aug 2024 07:10:37 +0000 (09:10 +0200)]
ata: sata_rescan must scan for block devices

A system may have multiple SATA controller. Removing the controller with
the lowest sequence number before probing all SATA controllers makes no
sense.

In sata_rescan we remove all block devices which are children of SATA
controllers. We also have to remove the bootdev devices as they will be
created when scanning for block devices.

After probing all SATA controllers we must scan for block devices otherwise
we end up without any SATA block device.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agopci: mediatek: add support for upstream split PCIe node
Christian Marangi [Mon, 12 Aug 2024 12:31:48 +0000 (14:31 +0200)]
pci: mediatek: add support for upstream split PCIe node

Add support for upstream linux split PCIe node.

Upstream linux have an alternative way to declare PCIe nodes that splits
them in dedicated nodes for each line instead of putting them all in one
node.

Detect this by checking if the mediatek,generic-pciecfg node is passed
as it's used to reference the common address for all the PCIe lines.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoremoteproc: uclass: Modify uc_pdata->name to use combination of device name and devic...
MD Danish Anwar [Wed, 7 Aug 2024 09:08:29 +0000 (14:38 +0530)]
remoteproc: uclass: Modify uc_pdata->name to use combination of device name and device's parent name

uc_pdata->name is populated from device tree property "remoteproc-name".
For those devcices that don't set "remoteproc-name", uc_pdata->name
falls back to dev->name.

If two devices have same name, this will result into uc_pdata->name not
being unique and rproc_init() will fail.

Fix this by using combination of dev->name and dev->parent->name instead
of using just the dev->name to populate uc_pdata->name.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Andrew Davis <afd@ti.com>
4 months agoata: dwc_ahsata: create boot device
Heinrich Schuchardt [Thu, 8 Aug 2024 07:08:03 +0000 (09:08 +0200)]
ata: dwc_ahsata: create boot device

For each block device we must create a sibling boot device.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
4 months agoMerge patch series "bootstd: Try again to resolve infinite-loop bug"
Tom Rini [Tue, 27 Aug 2024 16:09:11 +0000 (10:09 -0600)]
Merge patch series "bootstd: Try again to resolve infinite-loop bug"

Simon Glass <sjg@chromium.org> says:

This little series tries to resolve a problem found with an earlier
fix.

4 months agoMerge patch series "arch: arm: dts: ti: Add missing fss range"
Tom Rini [Tue, 27 Aug 2024 16:04:34 +0000 (10:04 -0600)]
Merge patch series "arch: arm: dts: ti: Add missing fss range"

Jonathan Humphreys <j-humphreys@ti.com> says:

Upstream DTS added explicit ranges to the fss node. It did not include
the 32 bit memory space needed by the R5 to access OSPI. With the
upstream DTS sync, OSPI boot no longer works.

Adding the missing range here. It is also being added in the upstream DTS,
so after the next upstream DTS sync, these patches can be removed.

Fixes: 5024a96db8e ("Subtree merge tag 'v6.10-dts' of devicetree-rebasing repo [1] into dts/upstream")
4 months agobootstd: Make bootdev_next_prio() continue after failure
Simon Glass [Thu, 15 Aug 2024 20:30:22 +0000 (14:30 -0600)]
bootstd: Make bootdev_next_prio() continue after failure

When a device fails to probe, the next device should be tried, until
either we find a suitable device or run out of devices. A device
should never be tried twice.

When we run out of devices of a particular priority, the hunter should
be used to generate devices of the next priority. Only if all attempts
fail should this function return an error.

Update the function to use the latent 'found' boolean to determine
whether another loop iteration is warranted, rather than setting 'dev'
to NULL, which creates confusion, suggesting that no devices have been
scanned and the whole process is starting from the beginning.

Note that the upcoming bootflow_efi() test is used to test this
behaviour.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/17
4 months agoRevert "bootdev: avoid infinite probe loop"
Simon Glass [Thu, 15 Aug 2024 20:30:21 +0000 (14:30 -0600)]
Revert "bootdev: avoid infinite probe loop"

This turns out to be insufficient to fix the problem, since when
bootdev_next_prio() exits, the caller has no idea that this really
is the end. Nor is it, since there may be other devices which should
be checked.

The caller iterates which calls iter_incr() which calls
bootdev_next_prio() again, which finds the same device and the loop
continues.

We never did create a test for this[1], which makes it hard to be
sure which problem was fixed.

The original code had the virtue of staying in the loop looking for a
bootdev, so let's go back to that and try to fix this another way.

A future patch will make bootdev_next_prio() continue after failure
which should provide same effect.

This reverts commit 9d92c418acfb7576e12e2bd53fed294bb9543724.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoarch: arm: dts: k3-j721e-r5-sk: Add missing fss range
Jonathan Humphreys [Fri, 9 Aug 2024 23:01:57 +0000 (18:01 -0500)]
arch: arm: dts: k3-j721e-r5-sk: Add missing fss range

Upstream DTS added explicit ranges to the fss node.  It did not include the
32 bit memory space needed by the R5 to access OSPI.  With the upstream DTS
sync, OSPI boot no longer works.

Adding the missing range here. It is also being added in the upstream DTS,
so after the next upstream DTS sync, this patch can be removed.  See
0c0e03ec22 (arm64: dts: ti: k3-j721e: Use exact ranges for FSS node)

Fixes: 5024a96db8e ("Subtree merge tag 'v6.10-dts' of devicetree-rebasing repo [1] into dts/upstream")
Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
4 months agoarch: arm: dts: k3-j721e-r5-evm: Add missing fss range
Jonathan Humphreys [Fri, 9 Aug 2024 23:01:56 +0000 (18:01 -0500)]
arch: arm: dts: k3-j721e-r5-evm: Add missing fss range

Upstream DTS added explicit ranges to the fss node.  It did not include the
32 bit memory space needed by the R5 to access OSPI.  With the upstream DTS
sync, OSPI boot no longer works.

Adding the missing range here. It is also being added in the upstream DTS,
so after the next upstream DTS sync, this patch can be removed.  See
0c0e03ec22 (arm64: dts: ti: k3-j721e: Use exact ranges for FSS node)

Fixes: 5024a96db8e ("Subtree merge tag 'v6.10-dts' of devicetree-rebasing repo [1] into dts/upstream")
Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
4 months agoarch: arm: dts: k3-j7200-r5-evm: Add missing fss range
Jonathan Humphreys [Fri, 9 Aug 2024 23:01:55 +0000 (18:01 -0500)]
arch: arm: dts: k3-j7200-r5-evm: Add missing fss range

Upstream DTS added explicit ranges to the fss node.  It did not include the
32 bit memory space needed by the R5 to access OSPI.  With the upstream DTS
sync, OSPI boot no longer works.

Adding the missing range here. It is also being added in the upstream DTS,
so after the next upstream DTS sync, this patch can be removed. See
f00e626085 (arm64: dts: ti: k3-j7200: Use exact ranges for FSS node)

Fixes: 5024a96db8e ("Subtree merge tag 'v6.10-dts' of devicetree-rebasing repo [1] into dts/upstream")
Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
Reviewed-by: Aniket Limaye <a-limaye@ti.com>
4 months agoarch: arm: dts: k3-am69-r5-sk: Add missing fss range
Jonathan Humphreys [Fri, 9 Aug 2024 23:01:54 +0000 (18:01 -0500)]
arch: arm: dts: k3-am69-r5-sk: Add missing fss range

Upstream DTS added explicit ranges to the fss node.  It did not include the
32 bit memory space needed by the R5 to access OSPI.  With the upstream DTS
sync, OSPI boot no longer works.

Adding the missing range here. It is also being added in the upstream DTS,
so after the next upstream DTS sync, this patch can be removed. See
f062a015f4 (arm64: dts: ti: k3-j784s4: Use exact ranges for FSS node)

Fixes: 5024a96db8e ("Subtree merge tag 'v6.10-dts' of devicetree-rebasing repo [1] into dts/upstream")
Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
4 months agoarch: arm: dts: k3-j784s4-r5-evm: Add missing fss range
Jonathan Humphreys [Fri, 9 Aug 2024 23:01:53 +0000 (18:01 -0500)]
arch: arm: dts: k3-j784s4-r5-evm: Add missing fss range

Upstream DTS added explicit ranges to the fss node.  It did not include the
32 bit memory space needed by the R5 to access OSPI.  With the upstream DTS
sync, OSPI boot no longer works.

Adding the missing range here. It is also being added in the upstream DTS,
so after the next upstream DTS sync, this patch can be removed. See
f062a015f4 (arm64: dts: ti: k3-j784s4: Use exact ranges for FSS node)

Fixes: 5024a96db8e ("Subtree merge tag 'v6.10-dts' of devicetree-rebasing repo [1] into dts/upstream")
Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
Reviewed-by: Andrew Davis <afd@ti.com>
4 months agoMerge patch series "Tidy up console recording in tests"
Tom Rini [Tue, 27 Aug 2024 00:52:18 +0000 (18:52 -0600)]
Merge patch series "Tidy up console recording in tests"

Simon Glass <sjg@chromium.org> says:

This series started as a small fix for checking for an empty line,
but in the process several other problems were found and fixed:

- fix tests which use console recording but don't set the flag
- drop unnecessary resetting of the console in tests
- drop unnecessary blank line before MMC output
- update the docs a little
- fix buildman test failure on newer Pythons
- a few other minor things

This series also renames the confusing flag names, so that they are
easier to remember - just a UTF_ (unit-test flags) prefix.

4 months agodoc: Add a few notes about how to use console checking
Simon Glass [Thu, 22 Aug 2024 13:58:04 +0000 (07:58 -0600)]
doc: Add a few notes about how to use console checking

Tidy up the existing docs in line with current conventions.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Tidy up checking for console end
Simon Glass [Thu, 22 Aug 2024 13:58:03 +0000 (07:58 -0600)]
test: Tidy up checking for console end

Use the ut_assert_console_end() function provided, rather than doing it
separately.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Use UTF_CONSOLE in remaining tests
Simon Glass [Thu, 22 Aug 2024 13:58:02 +0000 (07:58 -0600)]
test: Use UTF_CONSOLE in remaining tests

Set this flag rather than doing things manually in the test.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: log: Use UTF_CONSOLE in tests
Simon Glass [Thu, 22 Aug 2024 13:58:01 +0000 (07:58 -0600)]
test: log: Use UTF_CONSOLE in tests

Set this flag rather than doing things manually in the test.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: hush: Use UTF_CONSOLE in tests
Simon Glass [Thu, 22 Aug 2024 13:58:00 +0000 (07:58 -0600)]
test: hush: Use UTF_CONSOLE in tests

Set this flag rather than doing things manually in the test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agotest: dm: Use UTF_CONSOLE in tests
Simon Glass [Thu, 22 Aug 2024 13:57:59 +0000 (07:57 -0600)]
test: dm: Use UTF_CONSOLE in tests

Set this flag rather than doing things manually in the test.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: cmd: Drop unnecessary console_record_reset_enable()
Simon Glass [Thu, 22 Aug 2024 13:57:58 +0000 (07:57 -0600)]
test: cmd: Drop unnecessary console_record_reset_enable()

It is seldom necessary to call this function. Drop its use in the
command tests.

Add a few extra checks to the wget test so that resetting is not
needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: cmd: Use UTF_CONSOLE in tests
Simon Glass [Thu, 22 Aug 2024 13:57:57 +0000 (07:57 -0600)]
test: cmd: Use UTF_CONSOLE in tests

Set this flag rather than doing things manually in the test.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: fdt: Move common code into the setup functions
Simon Glass [Thu, 22 Aug 2024 13:57:56 +0000 (07:57 -0600)]
test: fdt: Move common code into the setup functions

Quite a lot of tests have the same two lines of code at the start. Move
this into the two setup functions to reduce redundancy.

Add a line to check the output from set_working_fdt_addr() since this is
always emitted.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: fdt: Check internal-function return values
Simon Glass [Thu, 22 Aug 2024 13:57:55 +0000 (07:57 -0600)]
test: fdt: Check internal-function return values

Some functions are using asserts but the result of the functions
themselves is not checked. This means that if a test fails, the result
is not noticed until later, which can be confusing to debug.

Add the missing asserts.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: boot: Use UTF_CONSOLE in tests
Simon Glass [Thu, 22 Aug 2024 13:57:54 +0000 (07:57 -0600)]
test: boot: Use UTF_CONSOLE in tests

Set this flag rather than doing things manually in the test.

Drop unnecessary calls to console_record_reset_enable()

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agotest: bloblist: Use UTF_CONSOLE in tests
Simon Glass [Thu, 22 Aug 2024 13:57:53 +0000 (07:57 -0600)]
test: bloblist: Use UTF_CONSOLE in tests

Set this flag rather than doing things manually in the test.

Drop the code which is now unnecessary.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Update NAND test to avoid extra macros
Simon Glass [Thu, 22 Aug 2024 13:57:52 +0000 (07:57 -0600)]
test: Update NAND test to avoid extra macros

Write out the tests in full to allow the test to be found more easily
when there is a failure. We could use a single test function with a
for() loop but this would stop at the first failure, and some variations
might while other pass.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agommc: Drop the blank line before accesses
Simon Glass [Thu, 22 Aug 2024 13:57:51 +0000 (07:57 -0600)]
mmc: Drop the blank line before accesses

Several mmc subcommand print a blank line before starting and after
finishing. It isn't necessary to do both, so drop the first one.

It is questionable whether these command should produce any output at
all, but leave it for now.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Rename UTF_CONSOLE_REC to UTF_CONSOLE
Simon Glass [Thu, 22 Aug 2024 13:57:50 +0000 (07:57 -0600)]
test: Rename UTF_CONSOLE_REC to UTF_CONSOLE

The _REC suffix doesn't add much. Really what we want to know is whether
the test uses the console, so rename this flag.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agotest: Drop the blank line before test macros
Simon Glass [Thu, 22 Aug 2024 13:57:49 +0000 (07:57 -0600)]
test: Drop the blank line before test macros

Most tests don't have this. It helps to keep the test declaration
clearly associated with the function it relates to, rather than the next
one in the file. Remove the extra blank line and mention this in the
docs.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Rename unit-test flags
Simon Glass [Thu, 22 Aug 2024 13:57:48 +0000 (07:57 -0600)]
test: Rename unit-test flags

The UT_TESTF_ macros read as 'unit test test flags' which is not right.
Rename to UTF ('unit test flags').

This has the benefit of being shorter, which helps keep UNIT_TEST()
declarations on a single line.

Give the enum a name and reference it from the UNIT_TEST() macros while
we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Fail when an empty line is expected but not present
Simon Glass [Thu, 22 Aug 2024 13:57:47 +0000 (07:57 -0600)]
test: Fail when an empty line is expected but not present

The existing implementation of ut_assert_nextline_empty() cannot
distinguish between an empty line and no line at all. It can in fact be
called at the end of the recorded output and will happily return
success.

Adjust the logic so that this condition is detected. Show a failure
message in this case.

Fix the one test which falls foul of this fix.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 400175b0a7d ("test: Add a way to check each line of console...")
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agobuildman: Make test_process_limit handle time.monotonic()
Simon Glass [Thu, 22 Aug 2024 13:57:46 +0000 (07:57 -0600)]
buildman: Make test_process_limit handle time.monotonic()

Newer versions of filelock use time.monotonic() instead of time.time().
Update the test the handle this.

It would be better if filelock had support for writing unit tests which
use locking.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoMerge patch series "global_data: Reduce size of struct global_data"
Tom Rini [Mon, 26 Aug 2024 20:06:16 +0000 (14:06 -0600)]
Merge patch series "global_data: Reduce size of struct global_data"

Simon Glass <sjg@chromium.org> says:

The global data structure has grown quite a lot over the years, being
the best place to put an important pointer or something that must be
accessed before and after relocation.

This series attempts to reduce the size a little, by moving some things
out and shrinking and aligning some fields.

Some fields are needed during init but not afterwards. To deal with this
a new 'boardf' structure is created, which sits on the stack and is only
present during board_init_f(). It is possible that more fields could
move to this struct, but for now only 4 are moved.

An assumption is made that an int is 32-bits wide on all architectures,
which seems to be true, but maintainers should be able to confirm.

Mostly the code-size impact is neutral, but the patch
'Use less space for environment fields' does increase U-Boot's size by
about 30 bytes on aarch64.

For firefly-rk3399 (64-bit) the size of global reduces from 456 to 368
bytes. For SPL it reduces from 416 to 272 bytes.

There are other things which could be attempted, for example:
- Using hlist instead of list for some lists
- Checking that only necessary fields are present in SPL

4 months agodoc: Add some guidelines about global data
Simon Glass [Wed, 21 Aug 2024 16:19:27 +0000 (10:19 -0600)]
doc: Add some guidelines about global data

Update the documentation to provide a bit more information about how to
use global data.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agodoc: Move generic-board documentation into rst
Simon Glass [Wed, 21 Aug 2024 16:19:26 +0000 (10:19 -0600)]
doc: Move generic-board documentation into rst

This information is useful for people looking at how U-Boot has changed
over the years and the design decisions which led to it. Move it into
doc/ in an 'historical' section.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Remove environment members if not used
Simon Glass [Wed, 21 Aug 2024 16:19:25 +0000 (10:19 -0600)]
global_data: Remove environment members if not used

If the environment is not enabled we don't need these fields in
global_data. Make them conditional.

Make these fields conditional. Move env_buf up one so it can share
an #ifdef.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Remove jump table in SPL
Simon Glass [Wed, 21 Aug 2024 16:19:24 +0000 (10:19 -0600)]
global_data: Remove jump table in SPL

SPL builds don't use the jump table since they cannot run apps. Drop
it, moving it together with boardf.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Move pointer members together
Simon Glass [Wed, 21 Aug 2024 16:19:23 +0000 (10:19 -0600)]
global_data: Move pointer members together

Collect the pointer members near the top of global_data to help with
alignment.

Signed-off-by: Simon Glass <sjg@chromium.org>