]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
20 months agoCI: Move to clang-16
Tom Rini [Tue, 21 Mar 2023 19:07:45 +0000 (15:07 -0400)]
CI: Move to clang-16

As this is now the stable release, move to using that now for our tests.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agolinker_lists: Rework start/end macros to not rely on undefined behavior
Tom Rini [Tue, 28 Mar 2023 18:54:51 +0000 (14:54 -0400)]
linker_lists: Rework start/end macros to not rely on undefined behavior

Per the GCC bug listed below, the way we do linker lists is relying on
undefined behavior that seems to work in gcc, but doesn't always work in
clang. Andrew suggests rewriting our start/end macros in a different way
(as implemented here, from what he said in comment 1) to avoid these
problems.

Reported-by: AdityaK <appujee@google.com>
Suggested-by: Andrew Pinski <apinski@marvell.com>
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108915
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andrew Pinski <apinski@marvell.com>
20 months agosmartweb: Enable LTO
Tom Rini [Tue, 28 Mar 2023 18:54:50 +0000 (14:54 -0400)]
smartweb: Enable LTO

In order to prepare for slight size growth due to reworking linker list
support, enable LTO here to save more space again.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
20 months agoDockerfile: Populate a pip cache
Tom Rini [Thu, 23 Mar 2023 18:57:58 +0000 (14:57 -0400)]
Dockerfile: Populate a pip cache

Given the number of jobs in CI we have which use python and pip install
packages, we should do this once in the Dockerfile, in order to populate
the cache. We let each job continue to create and use the virtual
environments they need to facilitate making updates to these
environments easier.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agopytest: Update requirements to match sphinx versions
Tom Rini [Thu, 23 Mar 2023 18:57:57 +0000 (14:57 -0400)]
pytest: Update requirements to match sphinx versions

In order to better make use of pip caches, and also for better overall
consistency, we should use the same versions of packages in each of our
python requirements files. Update pytest to use the newer versions of
packages we use in sphinx builds.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agoMerge tag 'u-boot-imx-next-20230404' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Tue, 4 Apr 2023 13:50:13 +0000 (09:50 -0400)]
Merge tag 'u-boot-imx-next-20230404' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-next-20230404
------------------------

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

- boards : DH-Electronics, Toradex, imx8mp-beacon-kit

20 months agoarm64: imx: Add support for imx8mp-beacon-kit
Adam Ford [Fri, 24 Mar 2023 03:06:16 +0000 (22:06 -0500)]
arm64: imx: Add support for imx8mp-beacon-kit

Beacon Embedded has an i.MX8M Plus development kit which consists
of a SOM + baseboard.  The SOM includes Bluetooth, WiFi, QSPI, eMMC,
and one Ethernet PHY. The baseboard includes audio, HDMI, USB-C Dual
Role port, USB Hub with five ports, a PCIe slot, and a second Ethernet
PHY.  The device trees are already queued for inclusion in Linux 6.3.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
20 months agoARM: imx: Enable LTO for DH electronics i.MX6 DHCOM
Marek Vasut [Tue, 7 Mar 2023 07:51:04 +0000 (08:51 +0100)]
ARM: imx: Enable LTO for DH electronics i.MX6 DHCOM

Enable LTO to reduce the size of SPL, which with SPL SDP
support may be close to the limit.

Signed-off-by: Marek Vasut <marex@denx.de>
20 months agoARM: dts: imx: Add support for Data Modul i.MX8M Plus eDM SBC
Marek Vasut [Mon, 3 Apr 2023 23:07:43 +0000 (01:07 +0200)]
ARM: dts: imx: Add support for Data Modul i.MX8M Plus eDM SBC

Add support for Data Modul i.MX8M Plus eDM SBC board. This is an
evaluation board for various custom display units. Currently
supported are serial console, ethernet, eMMC, SD, SPI NOR, USB.

Signed-off-by: Marek Vasut <marex@denx.de>
20 months agoARM: dts: imx: Add WDT reboot bindings on DH i.MX6 DHSOM
Marek Vasut [Mon, 3 Apr 2023 22:39:37 +0000 (00:39 +0200)]
ARM: dts: imx: Add WDT reboot bindings on DH i.MX6 DHSOM

Add WDT reboot bindings on DH i.MX6 DHSOM to permit the platform
to reboot via WDT in U-Boot. These are custom U-Boot bindings,
hence they are placed in -u-boot.dtsi .

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Marek Vasut <marex@denx.de>
20 months agoboard: verdin-imx8mp: change prints in spl_dram_init function
Emanuele Ghidoli [Mon, 3 Apr 2023 12:01:57 +0000 (14:01 +0200)]
board: verdin-imx8mp: change prints in spl_dram_init function

change prints to show which DDR configuration (single/dual rank) is used

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
20 months agoboard: verdin-imx8mp: compact slight different lpddr4 configuration
Emanuele Ghidoli [Mon, 3 Apr 2023 12:01:56 +0000 (14:01 +0200)]
board: verdin-imx8mp: compact slight different lpddr4 configuration

Deduplicate similar DDRC configurations and LPDDR4 training patterns
by patching a single configuration.

The aim is to reduce the SPL memory footprint and simplify maintenance
of lpddr4_timing.c

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
20 months agoboard: verdin-imx8mp: update lpddr4 configuration and training
Emanuele Ghidoli [Mon, 3 Apr 2023 12:01:55 +0000 (14:01 +0200)]
board: verdin-imx8mp: update lpddr4 configuration and training

Update LPDDR4 configuration and training using updated spreadsheet and
tools from NXP using data from previous spreadsheet and verified
toward datasheet:
 - MX8M_Plus_LPDDR4_RPA_v9.xlsx
 - mscale_ddr_tool_v3.30.exe

From:
https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8M-Family-DDR-Tool-Release/ta-p/1104467

Some register values differ due to these fixes/modifications:

- corrected calculation of T_CKPDX parameter (equal to tCKCKEH for LPDDR4)
- corrected ECC related items, none of which affect normal operation
  when ECC is not enabled
- corrected formula for calculation of tRTP in cell D122

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
20 months agoboard: verdin-imx8mp: fix lpddr4 refresh timing
Emanuele Ghidoli [Mon, 3 Apr 2023 12:01:54 +0000 (14:01 +0200)]
board: verdin-imx8mp: fix lpddr4 refresh timing

Change tRFCmin (tRFCab) from 280 ns to 380 ns to be compliant with
current and futures memories.

Fixes: 2bc2f817cea7 ("board: toradex: add verdin imx8m plus support")
Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
20 months agoboard: verdin-imx8mp: update ddrc config for different lpddr4 memories
Emanuele Ghidoli [Mon, 3 Apr 2023 12:01:53 +0000 (14:01 +0200)]
board: verdin-imx8mp: update ddrc config for different lpddr4 memories

Add support to Verdin IMX8MP V1.1B SKU which uses
MT53E1G32D2FW-046 WT:B memory.
Compared to the 8 GB memory (MT53E2G32D4NQ-046 WT:A) used on
Verdin IMX8MP V1.0A it has 16 row addresses instead of 17.
In fact, the new memory, is a 2 GB/rank memory. The 8 GB memory is a
4 GB/rank memory.

Manually tweaking Host Interface addresses vs LPDDR4 signals mapping it
is possible to have a single configuration working with both memories:
 - Old configuration: HIF bit 30 -> rank, HIF bit 29 -> Row 16
 - New configuration: HIF bit 29 -> rank, HIF bit 30 -> Row 16

With this change the memory space from the host processor is contiguous
for both the configurations and the correct memory size is computed
using get_ram_size() at runtime.

Support for single rank memories still works thanks to the fact
dual ranks training fails (ddr_init->ddr_cfg_phy) toward single rank
memories.

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
20 months agoconfigs: tqma6: enable DM_THERMAL
Markus Niebel [Mon, 27 Mar 2023 08:23:31 +0000 (10:23 +0200)]
configs: tqma6: enable DM_THERMAL

Enabling this gives some informal output at boot time.

Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
20 months agoconfigs: tqma6: enable DM for MDIO / PHY
Markus Niebel [Mon, 27 Mar 2023 08:23:30 +0000 (10:23 +0200)]
configs: tqma6: enable DM for MDIO / PHY

Since this works with current device trees, enabled these.

Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
20 months agoconfigs: tqma6: switch to DM_SERIAL
Markus Niebel [Mon, 27 Mar 2023 08:23:29 +0000 (10:23 +0200)]
configs: tqma6: switch to DM_SERIAL

Usage without DM_SERIAL is deprecated. Fix this.

Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
20 months agoarm: imx: add u-boot-nand.imx to boot from NAND without SPL
Luca Ceresoli [Fri, 10 Mar 2023 10:07:52 +0000 (11:07 +0100)]
arm: imx: add u-boot-nand.imx to boot from NAND without SPL

U-Boot can be booted from NAND without SPL by prepending the DCD header to
the actual U-Boot binary. However this requires prepending 1024 bytes to
u-boot.imx (DCD + u-boot.bin).

There is already a similar target to build spl/u-boot-nand-spl.imx, add the
same option for no-SPL boot.

Tested on i.MX6ULL.

The resulting layout of u-boot-nand.imx is:

 - Offset 0x0000 (0 KiB): padding
 - Offset 0x0400 (1 KiB): DCD header
 - Offset 0x1000 (4 KiB): u-boot.bin

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
20 months agoARM: imx: Enable SDP download in SPL on DH i.MX6 DHSOM
Marek Vasut [Tue, 7 Mar 2023 07:51:05 +0000 (08:51 +0100)]
ARM: imx: Enable SDP download in SPL on DH i.MX6 DHSOM

Enable SDP protocol support in SPL for DH i.MX6 DHSOM, now that those
components fit into the SPL due to LTO.

To start U-Boot via SDP upload on i.MX6 DHSOM based board, proceed as follows:
- Compile imx_usb [1] .
- Power off the i.MX6 DHSOM based board.
- Connect both USB-serial console and USB-OTG miniB ports to host PC.
- Switch board to USB boot mode.
- Power on the board.
- Verify using '$ dmesg' that a new device has been detected as follows:
    New USB device found, idVendor=15a2, idProduct=0054, bcdDevice= 0.01
    New USB device strings: Mfr=1, Product=2, SerialNumber=0
    Product: SE Blank ARIK
    Manufacturer: Freescale SemiConductor Inc

- Upload U-Boot SPL:
$ imx_usb u-boot-with-spl.imx

- Wait for SPL to come up, the following print ought to be the last on
  UART console:
SDP: handle requests...

- Upload U-Boot proper:
$ imx_usb u-boot.img

[1] https://github.com/boundarydevices/imx_usb_loader.git

Signed-off-by: Marek Vasut <marex@denx.de>
20 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Tue, 4 Apr 2023 00:49:03 +0000 (20:49 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-usb

- Two USB gadget fixes

20 months agomx6sx-udoo-neo-basic-u-boot.dtsi: Correct to bootph-all
Tom Rini [Tue, 4 Apr 2023 00:48:24 +0000 (20:48 -0400)]
mx6sx-udoo-neo-basic-u-boot.dtsi: Correct to bootph-all

Updating this was missed in the merge of the next branch back in to
master.

Signed-off-by: Tom Rini <trini@konsulko.com>
20 months agousb: gadget: f_sdp: Add missing spl_board_prepare_for_boot() call
Marek Vasut [Tue, 7 Mar 2023 07:42:33 +0000 (08:42 +0100)]
usb: gadget: f_sdp: Add missing spl_board_prepare_for_boot() call

The spl_board_prepare_for_boot() should be called before jump_to_image_no_args()
to perform board-specific deinitialization before jumping to the next stage.
This board-specific deinitialization can be very much anything, e.g. disable
dcache in case it was enabled, or such.

Add the missing spl_board_prepare_for_boot() call into f_sdp .

Signed-off-by: Marek Vasut <marex@denx.de>
20 months agousb: gadget: missing fallthrough in composite_setup()
Heinrich Schuchardt [Sat, 1 Apr 2023 07:06:55 +0000 (09:06 +0200)]
usb: gadget: missing fallthrough in composite_setup()

Add a missing fallthrough macro. This fixes a -Wimplicit-fallthrough
warning.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
20 months agoMerge branch 'next'
Tom Rini [Mon, 3 Apr 2023 20:45:41 +0000 (16:45 -0400)]
Merge branch 'next'

Signed-off-by: Tom Rini <trini@konsulko.com>
20 months agoPrepare v2023.04
Tom Rini [Mon, 3 Apr 2023 20:38:50 +0000 (16:38 -0400)]
Prepare v2023.04

Signed-off-by: Tom Rini <trini@konsulko.com>
20 months agoarm: dts: k3-j721e-sk-u-boot: fix boot on j721e SK
Sinthu Raja [Mon, 3 Apr 2023 17:03:12 +0000 (12:03 -0500)]
arm: dts: k3-j721e-sk-u-boot: fix boot on j721e SK

J721e SK has been broken since at least March 2022.

The main-navss and mcu-navss nodes were renamed and this caused the
A72 SPL to fail early in the boot even before the serial port was
enabled. Fix this.

A later patch series between v2022.07 and v2022.10 additionally broke
boot on this board by introducing hbmc nodes which are not present on
this board. The right fix is to disable these by default in the SOC
dtsi file, but for now we can also disable them in the u-boot dtsi.

With both these fixed, we can now boot the j721e SK board fully from
mainline u-boot.

Fixes: 58d61fb5a77ef ("arm: dts: k3-j721e-sk: Add initial A72 specific dts support")
Fixes: 297daac43afb9 ("arm: dts: k3-j721e-mcu-wakeup: Add HyperBus Controller node")
Reported-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
[gadiyar@ti.com: update commit description]
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Cc: Bryan Brattlof <bb@ti.com>
20 months agoMerge tag 'dm-next-3apr23' of https://source.denx.de/u-boot/custodians/u-boot-dm...
Tom Rini [Mon, 3 Apr 2023 15:35:30 +0000 (11:35 -0400)]
Merge tag 'dm-next-3apr23' of https://source.denx.de/u-boot/custodians/u-boot-dm into next

Enable VPL tests
Minor changes with fdt command, vboot test, pinctrl

20 months agoRevert "disk: Use a helper function to reduce duplication"
Tom Rini [Mon, 3 Apr 2023 14:43:37 +0000 (10:43 -0400)]
Revert "disk: Use a helper function to reduce duplication"

Per Takahiro Akashi this is not an equivalent rework, so revert it.

This reverts commit d87bdb82eae66512c222fd93280acaf4dd1cd4be.

Signed-off-by: Tom Rini <trini@konsulko.com>
20 months agopico-imx6: Pass the mmc alias to fix boot regression
Fabio Estevam [Wed, 15 Feb 2023 18:24:44 +0000 (15:24 -0300)]
pico-imx6: Pass the mmc alias to fix boot regression

Originally, the mmc aliases node was present in imx6qdl-pico.dtsi.

After the sync with Linux in commit d0399a46e7cd ("imx6dl/imx6qdl:
synchronise device trees with linux"), the aliases node is gone as
the upstream version does not have it.

This causes a boot regression in which the eMMC card cannot be found anymore.

Fix it by passing the alias node in the u-boot.dtsi file to
restore the original behaviour where the eMMC (esdhc3) was
mapped to mmc0.

Fixes: d0399a46e7cd ("imx6dl/imx6qdl: synchronise device trees with linux")
Signed-off-by: Fabio Estevam <festevam@denx.de>
20 months agoMerge tag 'u-boot-imx-20230403' of https://source.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Mon, 3 Apr 2023 14:13:36 +0000 (10:13 -0400)]
Merge tag 'u-boot-imx-20230403' of https://source.denx.de/u-boot/custodians/u-boot-imx

Fixes for 2023.04
------------------

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

- fix for imx8mn_bsh_smm_s2

20 months agotest: Run the VPL tests with 'make check'
Simon Glass [Sun, 2 Apr 2023 02:01:27 +0000 (14:01 +1200)]
test: Run the VPL tests with 'make check'

Update the script to run VPL tests as well as the others.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agoCI: Ensure that vpl test is run
Simon Glass [Sun, 2 Apr 2023 02:01:26 +0000 (14:01 +1200)]
CI: Ensure that vpl test is run

This is actually skipped at present due to the condition in the file.
Fix this by running all vpl tests.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agovbe: Use the correct image filename in the test
Simon Glass [Sun, 2 Apr 2023 02:01:25 +0000 (14:01 +1200)]
vbe: Use the correct image filename in the test

At present this inadvertently relies on having a symlink to the correct
file from the current directory. Use the correct path to fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 months agosandbox: Update the VBE firmware location
Simon Glass [Sun, 2 Apr 2023 02:01:24 +0000 (14:01 +1200)]
sandbox: Update the VBE firmware location

The image size was increased but the firmware-update part was not
updated. Correct this so that VBE firmware update can succeed with
sandbox_vpl.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 85c66dc95c2 ("sandbox: Expand size for VPL image")
20 months agodoc: sandbox: replace sgdisk input with options
Corentin Guillevic [Fri, 24 Mar 2023 13:43:36 +0000 (14:43 +0100)]
doc: sandbox: replace sgdisk input with options

The input provided to sgdisk is in fact aimed for sfdisk. The use of
sgdisk and sfdisk, coming from different projects, is not the same.

So, this commit translates the sfdisk-formatted input into
sgdisk-compatible options. Partitions are not modified.

Signed-off-by: Corentin Guillevic <corentin.guillevic@smile.fr>
20 months agofdt: Make fdt addr -q quieter
Peter Hoyes [Tue, 21 Mar 2023 13:01:16 +0000 (13:01 +0000)]
fdt: Make fdt addr -q quieter

64597346 "fdt: Add -q option to fdt addr for distro_bootcmd" introduced
the -q option for fdt addr, which sets the current working fdt address
without printing any output.

baf41410 "fdt: Show a message when the working FDT changes" made the
utility function set_working_fdt_addr (in cmd/fdt.c) output a message
on each invocation, even if called via fdt addr -q, in which case its
output is now slightly noisier.

To fix this, split out set_working_fdt_addr into set_working_fdt_addr
plus the static function set_working_fdt_addr_quiet.
set_working_fdt_addr_quiet can be called by "quiet" fdt cmd logic and
set_working_fdt_addr is exported (as before) to other boot logic. The
latter calls the former.

Remove the assertion from the fdt addr test case when calling with the
-q argument.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agopinctrl: fix pinctrl_gpio_get_pinctrl_and_offset for gpio-ranges array
Quanyang Wang [Thu, 16 Mar 2023 06:11:46 +0000 (14:11 +0800)]
pinctrl: fix pinctrl_gpio_get_pinctrl_and_offset for gpio-ranges array

Sometimes a multi-element array is used for "gpio-ranges" property in
dts file:

    qe_pio_e: gpio-controller@1460 {
        ......
        gpio-ranges = <&pinctrl1 0 20 10>, <&pinctrl2 10 50 20>;
        ......
    };

But the function pinctrl_gpio_get_pinctrl_and_offset can't handle this
case because the "index" argument passed to dev_read_phandle_with_args
is fixed to be "0". Use a loop to traverse the array to fix it.

Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
20 months agocmd: fdt: Use env_set_hex() for "get addr" and "get size"
Marek Vasut [Sat, 11 Mar 2023 16:29:21 +0000 (17:29 +0100)]
cmd: fdt: Use env_set_hex() for "get addr" and "get size"

The 'fdt get addr' and 'env get size' is always assumed to be hex
value, drop the prefix, and outright switch to env_set_hex(). Since
this might break existing users who depend on the existing behavior
with 0x prefix, this is a separate patch.

Revert if this breaks anything.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agorockchip: Fix incorrect constant name in RAM init code
David Sebek [Thu, 30 Mar 2023 21:51:14 +0000 (17:51 -0400)]
rockchip: Fix incorrect constant name in RAM init code

A condition in the rk3399 RAM initialization code used the old
CONFIG_RAM_RK3399_LPDDR4 constant name. This commit changes the
condition to use the correct CONFIG_RAM_ROCKCHIP_LPDDR4 constant.

Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agotest_vboot.py: include test of fdt_add_pubkey tool
Roman Kopytin [Mon, 20 Mar 2023 03:28:13 +0000 (03:28 +0000)]
test_vboot.py: include test of fdt_add_pubkey tool

Add test_fdt_add_pubkey test which provides simple functionality test
which contains such steps:
 create DTB and FIT files
 add keys with fdt_add_pubkey to DTB
 sign FIT image
 check with fit_check_sign that keys properly added to DTB file

Signed-off-by: Roman Kopytin <Roman.Kopytin@kaspersky.com>
Signed-off-by: Ivan Mikhaylov <fr0st61te@gmail.com>
Cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
20 months agoMerge tag 'efi-2023-04-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sat, 1 Apr 2023 14:55:06 +0000 (10:55 -0400)]
Merge tag 'efi-2023-04-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2023-04-rc6

Documentation:

* describe skipping triggering a pipeline in Gitlab

UEFI:

* correct shortening of device-paths for boot options

20 months agoefi_loader: remove duplicate assignment
Heinrich Schuchardt [Sat, 1 Apr 2023 05:21:55 +0000 (07:21 +0200)]
efi_loader: remove duplicate assignment

Assigning the value of a variable to itself should be avoided.

Addresses-Coverity-ID: 451089 ("Evaluation order violation")
Fixes: 180b7118bed8 ("efi_loader: fix device-path for USB devices")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
20 months agoefi_loader: correct shortening of device-paths
Heinrich Schuchardt [Sun, 26 Mar 2023 10:22:40 +0000 (12:22 +0200)]
efi_loader: correct shortening of device-paths

We use short device-paths in boot options so that a file on a block device
can be found independent of the port into which the device is plugged.

Usb() device-path nodes only contain port and interface information and
therefore cannot identify a block device.
UsbWwi() device-path nodes contain the serial number of USB devices.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
20 months agodoc: describe skipping triggering a pipeline in Gitlab
Heinrich Schuchardt [Sun, 26 Mar 2023 02:55:12 +0000 (02:55 +0000)]
doc: describe skipping triggering a pipeline in Gitlab

'git push -o ci.skip' can be used to push to Gitlab without triggering a
pipeline.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agoscsi: typo supporedt
Heinrich Schuchardt [Sun, 26 Mar 2023 15:08:03 +0000 (17:08 +0200)]
scsi: typo supporedt

%s/supporedt/supported/

Fixes: edca8cf72130 ("Convert CONFIG_SCSI_AHCI_PLAT et al to Kconfig")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agoMerge tag 'u-boot-imx-next-20230331' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Fri, 31 Mar 2023 16:50:34 +0000 (12:50 -0400)]
Merge tag 'u-boot-imx-next-20230331' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next

u-boot-imx-next-20230331 for next
---------------------------------

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

i.MX patches queued for next:

- Conversions to DM_SERIAL
- Fixes for Toradex boards
- Gateworks Boards
- i.MX8ULP
- EQoS support / fixes, changes in boards

21 months agoMerge tag 'dm-pull-31mar23' of https://source.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Fri, 31 Mar 2023 16:02:41 +0000 (12:02 -0400)]
Merge tag 'dm-pull-31mar23' of https://source.denx.de/u-boot/custodians/u-boot-dm

Fixes for buildman and sysreset

21 months agoMerge branch '2023-03-30-assorted-general-upates' into next
Tom Rini [Fri, 31 Mar 2023 14:04:23 +0000 (10:04 -0400)]
Merge branch '2023-03-30-assorted-general-upates' into next

- RTC cleanups / improvements, run_commandf() cleanups, fs bugfixes,
  socrates config fix, PCI MPS support, GPIO improvements, other code
  cleanups

21 months agoconfigs: imx8mn_bsh_smm_s2: remove console from bootargs
Dario Binacchi [Wed, 8 Feb 2023 08:15:39 +0000 (09:15 +0100)]
configs: imx8mn_bsh_smm_s2: remove console from bootargs

The Linux kernel device tree already specifies the device to be used for
boot console output with a stdout-path property under /chosen.

Commit 36b661dc919da ("Merge branch 'next'") re-added the console
setting that commit bede82f750752 ("configs: imx8mn_bsh_smm_s2: remove
console from bootargs") had previously removed.

Fixes: 36b661dc919da ("Merge branch 'next'")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
21 months agosysreset: gpio: fix gpio_reboot_request return value
Jonathan Liu [Tue, 28 Mar 2023 06:44:23 +0000 (17:44 +1100)]
sysreset: gpio: fix gpio_reboot_request return value

It should return -EINPROGRESS if successful otherwise sysreset-uclass
will continue to the next sysreset device.

Signed-off-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agobuildman: Correct overwriting of settings file
Simon Glass [Mon, 27 Mar 2023 21:47:37 +0000 (10:47 +1300)]
buildman: Correct overwriting of settings file

The toolchain test causes the settings file to be overwritten, which is
annoying for local development. Fix it by passing None as the filename.

Signed-off-by: Simon Glass <sjg@chromium.org>
21 months agotest: fs: Check fat short file name
Stefan Herbrechtsmeier [Wed, 22 Mar 2023 08:46:02 +0000 (09:46 +0100)]
test: fs: Check fat short file name

Ensure that a freshly written fat file with a lower case filename which
fits into the upper case 8.3 short filename is not mangeled with a tilde
and number.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
21 months agoinput: button_kbd: make driver complementary to gpio buttons
Svyatoslav Ryhel [Mon, 20 Mar 2023 19:06:30 +0000 (21:06 +0200)]
input: button_kbd: make driver complementary to gpio buttons

Remove need of dts binding for button keyboard since it reuses
gpio-keys binding. Select gpio-keys driver if button keyboard
is selected since button keyboard can not operate on its own.

Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # HTC One X T30
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agocmd: ums: abort mounting by pressing any key
Svyatoslav Ryhel [Mon, 20 Mar 2023 19:01:43 +0000 (21:01 +0200)]
cmd: ums: abort mounting by pressing any key

This patch introduses config which allows interrupt run of usb
mass storage with any key. This is especially useful on devices
with limited input capabilities like tablets and smatphones which
have only gpio keys in direct access.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agotest: exit: fix run_commandf() warnings
Evgeny Bachinin [Mon, 20 Mar 2023 08:23:14 +0000 (11:23 +0300)]
test: exit: fix run_commandf() warnings

Fix warnings after adding printf-like attribute format for
run_commandf():
warning: too many arguments for format [-Wformat-extra-args]

Signed-off-by: Evgeny Bachinin <EABachinin@sberdevices.ru>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agotest: fdt: fix run_commandf() warnings
Evgeny Bachinin [Mon, 20 Mar 2023 08:23:13 +0000 (11:23 +0300)]
test: fdt: fix run_commandf() warnings

Fix warnings both for 32bit and 64bit architecture after adding
printf-like attribute format for run_commandf():
warning: format â€˜%x’ expects argument of type â€˜unsigned int’, but
  argument 2 has type â€˜ulong {aka long unsigned int}’ [-Wformat=]
  ret = run_commandf("fdt addr -c %08x", addr);
                     ^
Signed-off-by: Evgeny Bachinin <EABachinin@sberdevices.ru>
Cc: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fixup testcases added since patch was posted]
Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agounit-test: cover run_commandf() by test-cases
Evgeny Bachinin [Mon, 20 Mar 2023 08:23:12 +0000 (11:23 +0300)]
unit-test: cover run_commandf() by test-cases

As run_commandf() is variadic version of run_command() and just a wrapper,
hence apply similar run_command's test-cases.

Let's avoid warning about empty string passing:
warning: zero-length gnu_printf format string [-Wformat-zero-length]
   assert(run_commandf("") == 0);

Signed-off-by: Evgeny Bachinin <EABachinin@sberdevices.ru>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agocli: run_commandf(): small fixups
Evgeny Bachinin [Mon, 20 Mar 2023 08:23:11 +0000 (11:23 +0300)]
cli: run_commandf(): small fixups

* vsnprintf() can truncate cmd, hence it makes no sense to launch such
command (it's broken). Moreover, it's better to signalize to the caller
about such case (for facilitating debugging or bug hunting).

* Fix kernel-doc warnings:
  include/command.h:264: info: Scanning doc for run_commandf
  include/command.h:268: warning: contents before sections
  include/command.h:271: warning: No description found for return value
                                  of 'run_commandf'

* Add printf-like format attribute to validate at compile-time the format
string against parameters's type.

* Fix compilation error in case of -Wall, -Werror, -Wextra:
error: variable â€˜i’ set but not used [-Werror=unused-but-set-variable]

* Drop extra ret variable.

Signed-off-by: Evgeny Bachinin <EABachinin@sberdevices.ru>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agodrivers: rtc: add max313xx series rtc driver
Chris Packham [Sun, 19 Mar 2023 21:23:44 +0000 (10:23 +1300)]
drivers: rtc: add max313xx series rtc driver

Adding support for Analog Devices MAX313XX series RTCs.

This is ported from the Linux driver and adapted for use in u-boot.
Notable differences are
- handling of tm_year and tm_mon differ
- clock source support is omitted
- hwmon support for the MAX31328 and MAX31343 is omitted
- rtc_ops->reset is added

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agoinclude: kernel.h: port find_closest() from Linux
Chris Packham [Sun, 19 Mar 2023 21:23:43 +0000 (10:23 +1300)]
include: kernel.h: port find_closest() from Linux

The find_closest() macro can be used to find an element in a sorted
array that is closest to an input value. Bring in this macro from
Linux v6.3-rc1-2-g8ca09d5fa354.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agodisk: Use a helper function to reduce duplication
Simon Glass [Sun, 19 Mar 2023 19:29:57 +0000 (08:29 +1300)]
disk: Use a helper function to reduce duplication

Reduce the duplicated code slightly by using a helper function to handle
the common code.

This reduces the code size very slightly.

Signed-off-by: Simon Glass <sjg@chromium.org>
21 months agolib: Fix SYS_TIMER_COUNTS_DOWN description in Kconfig
Marek Vasut [Sun, 19 Mar 2023 03:13:02 +0000 (04:13 +0100)]
lib: Fix SYS_TIMER_COUNTS_DOWN description in Kconfig

The SYS_TIMER_COUNTS_DOWN description contains a typo,
s@rathe@&r@ , fix it.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
21 months agogpio: allow passing NULL to gpio_request_by_line_name() to search all gpio controllers
Rasmus Villemoes [Fri, 17 Mar 2023 20:12:22 +0000 (21:12 +0100)]
gpio: allow passing NULL to gpio_request_by_line_name() to search all gpio controllers

The API is more convenient to use if one doesn't have to know upfront
which gpio controller has a line with the name one is searching for,
and arrange to look that device up somehow. Or implement this loop
oneself.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agortc: m41t62: implements read8/write8 operations
Thomas Perrot [Fri, 17 Mar 2023 14:22:41 +0000 (15:22 +0100)]
rtc: m41t62: implements read8/write8 operations

These operations are required by dm_rtc_read and
dm_bootcount_get helpers.

Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agofs: ext4: fix files seen as symlink during deletion
Corentin GUILLEVIC [Fri, 17 Mar 2023 12:15:12 +0000 (13:15 +0100)]
fs: ext4: fix files seen as symlink during deletion

The deletion process handles special case for symlinks whose target are
small enough that it fits in struct ext2_inode.b.symlink. So no block had
been allocated. But the check of file type wrongly considered regular
files as symlink. So, no block was freed. So, the EXT4 partition could be
corrupted because of no free block available.

Signed-off-by: Corentin GUILLEVIC <corentin.guillevic@smile.fr>
21 months agofs: fat: do not mangle short filenames
Stefan Herbrechtsmeier [Fri, 17 Mar 2023 12:04:13 +0000 (13:04 +0100)]
fs: fat: do not mangle short filenames

Do not mangle lower or mixed case filenames which fit into the upper
case 8.3 short filename. This ensures FAT standard compatible short
filenames (SFN) to support systems without long filename (LFN) support
like boot roms (ex. SFN BOOT.BIN instead of BOOT~1.BIN for LFN
boot.bin).

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
21 months agotest: Add test for new command pci_mps
Stephen Carlson [Fri, 10 Mar 2023 19:07:15 +0000 (11:07 -0800)]
test: Add test for new command pci_mps

Adds a test for the new pci_mps command to ensure that it can set the
Maximum Payload Size (MPS) of all devices to 256 bytes in the sandbox
environment. Enables the pci_mps command in the sandbox environment so
that this test can be run.

Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com>
21 months agodrivers: pci: sandbox: Add stub sandbox PCI MPS support
Stephen Carlson [Fri, 10 Mar 2023 19:07:14 +0000 (11:07 -0800)]
drivers: pci: sandbox: Add stub sandbox PCI MPS support

Reports the sandbox swapcase PCI Express device to support a 256 byte
Maximum Payload Size for MPS tuning tests.

Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agocmd: pci: Add command to set MPS of all PCIe devices
Stephen Carlson [Fri, 10 Mar 2023 19:07:13 +0000 (11:07 -0800)]
cmd: pci: Add command to set MPS of all PCIe devices

Enable tuning of the PCI Express MPS (Maximum Payload Size) of
each device. The Maximum Read Request Size is not altered.

The SAFE method uses the largest MPS value supported by all devices in the
system for each device. This method is the same algorithm as used by Linux
pci=pcie_bus_safe.

The PEER2PEER method sets all devices to the minimal (128 byte) MPS, which
allows hot plug of devices later that might only support the minimum size,
and ensures compatibility of DMA between two devices on the bus.

Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com>
21 months agosysinfo: gpio: fix loop over DT "revisions" array
Rasmus Villemoes [Fri, 10 Mar 2023 10:58:03 +0000 (11:58 +0100)]
sysinfo: gpio: fix loop over DT "revisions" array

There can certainly be a lot more elements in the "revisions" (and
"names") arrays than there are gpios used to form the trinary number
we're searching for; we simply don't know the array size up-front.

Nor do we need to, because the loop body already knows to recognize
-EOVERFLOW as "not that many elements present" (and we have a test
that specifically ensures that dev_read_u32_index() returns exactly
that). So just drop the i < priv->gpio_num condition.

While in here, fix the weird placement of the default: keyword.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <sean.anderson@seco.com>
21 months agonvedit: simplify do_env_indirect()
Rasmus Villemoes [Mon, 6 Mar 2023 13:27:21 +0000 (14:27 +0100)]
nvedit: simplify do_env_indirect()

Instead of calling env_get(from) up to three times, just do it once,
computing the value we will put into 'to' and error out if that is
NULL (i.e. no 'from' variable and no default provided).

No functional change.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agoapi: move API related config options into submenu
Heinrich Schuchardt [Fri, 3 Mar 2023 22:31:22 +0000 (23:31 +0100)]
api: move API related config options into submenu

Kconfig settings that are related to the API for standalone applications
should be in the API sub-menu and not on the top level.

CONFIG_STANDALONE_LOAD_ADDR is only relevant if standalone example
applications are built.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
21 months agoKconfig: Sort the BUILD_TARGET list
Marek Vasut [Tue, 28 Feb 2023 06:22:21 +0000 (07:22 +0100)]
Kconfig: Sort the BUILD_TARGET list

Sort the defaults list in BUILD_TARGET Kconfig option. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agoimage: Fix potentially uninitialized data variable
Marek Vasut [Mon, 27 Feb 2023 19:56:31 +0000 (20:56 +0100)]
image: Fix potentially uninitialized data variable

In case fitImage support is disabled, and image_locate_script() is
passed a fitImage, then the 'data' variable is used uninitialized.
Drop into the default: branch of the switch-case statement and do
not return the uninitialized data, and do not modify the return
pointer either, just print an error message.

Reported by clang build:
"
$ make HOSTCC=clang CC=clang KCFLAGS=-Werror sandbox64_defconfig && make HOSTCC=clang CC=clang KCFLAGS=-Werror
...
boot/image-board.c:1006:7: error: variable 'data' is used uninitialized whenever switch case is taken [-Werror,-Wsometimes-uninitialized]
        case IMAGE_FORMAT_LEGACY:
             ^~~~~~~~~~~~~~~~~~~
include/image.h:608:29: note: expanded from macro 'IMAGE_FORMAT_LEGACY'
                                ^~~~
boot/image-board.c:1128:19: note: uninitialized use occurs here
        *datap = (char *)data;
                         ^~~~
boot/image-board.c:1001:11: note: initialize the variable 'data' to silence this warning
        u32 *data;
                 ^
                  = NULL
"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agopowerpc/mpc85xx: disable legacy format booting
Heiko Schocher [Thu, 23 Feb 2023 06:03:47 +0000 (07:03 +0100)]
powerpc/mpc85xx: disable legacy format booting

disable CONFIG_LEGACY_IMAGE_FORMAT so prevent of booting
not signed fitimages.

Signed-off-by: Heiko Schocher <hs@denx.de>
21 months agoMerge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-marvell into...
Tom Rini [Thu, 30 Mar 2023 14:04:21 +0000 (10:04 -0400)]
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-marvell into next

- mvebu: Fix boot mode detection (Pali)
- mvebu: clearfog: defconfig and eMMC updates (Martin)

21 months agoclk: imx8mp: add pwm clocks support
Tommaso Merciai [Fri, 10 Mar 2023 15:24:24 +0000 (16:24 +0100)]
clk: imx8mp: add pwm clocks support

Add clocks support for the PWM controllers. This is ported from
Linux v6.3.0-rc1

Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
21 months agoarm64: imx8mm: imx8mn: imx8mp: Drop FEC GPR[1] board workaround
Marek Vasut [Mon, 6 Mar 2023 14:53:54 +0000 (15:53 +0100)]
arm64: imx8mm: imx8mn: imx8mp: Drop FEC GPR[1] board workaround

The FEC interface mode is now configured in common board_interface_eth_init()
and called by FEC MAC driver when appropriate. Drop the board side duplicates
if the same functionality.

Signed-off-by: Marek Vasut <marex@denx.de>
21 months agoarm64: imx8mp: Drop EQoS GPR[1] board workaround
Marek Vasut [Mon, 6 Mar 2023 14:53:53 +0000 (15:53 +0100)]
arm64: imx8mp: Drop EQoS GPR[1] board workaround

The EQoS interface mode is now configured in common board_interface_eth_init()
and called by EQoS MAC driver when appropriate. Drop the board side duplicates
if the same functionality.

Signed-off-by: Marek Vasut <marex@denx.de>
21 months agoarm64: dts: imx8mp: Drop EQoS clock workaround
Marek Vasut [Mon, 6 Mar 2023 14:53:52 +0000 (15:53 +0100)]
arm64: dts: imx8mp: Drop EQoS clock workaround

The assigned-clock no longer have to be dropped, the clock are now
defined in clk-imx8mp.c and used by DWMAC driver to configure the
DWMAC clock. Drop the workarounds from U-Boot specific DT extras.

Signed-off-by: Marek Vasut <marex@denx.de>
21 months agoconfigs: verdin-imx8mp: Fix wrong early malloc() heap size
Emanuele Ghidoli [Thu, 16 Feb 2023 11:31:15 +0000 (12:31 +0100)]
configs: verdin-imx8mp: Fix wrong early malloc() heap size

Set, previously unset, CONFIG_SPL_SYS_MALLOC_F_LEN to 0x4000 whose
default value is 0x10000.
Early malloc() uses CRAM_S at 0x184000 (CFG_MALLOC_F_ADDR), this ram
area end at 0x188000.

Fixes: 2bc2f817cea7 ("board: toradex: add verdin imx8m plus support")
Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
21 months agoARM: imx: imx8mp: fix enable_i2c_clk
Rasmus Villemoes [Wed, 22 Mar 2023 14:42:05 +0000 (15:42 +0100)]
ARM: imx: imx8mp: fix enable_i2c_clk

In order for i2c_num==4 and 5 to stay invalid for non-imx8mp SOCs, the
i2c_ccgr[] array must be sized by the number of initializers present,
not with a hard-coded 6 which would implicitly initialize the last two
elements with zeroes.

Also, the bounds check is off-by-one.

Fixes: c92c3a4453b8 "ARM: imx: imx8mp: Enable support for i2c5 and i2c6 on i.MX8MP"
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
21 months agocompulab: imx8mm-cl-iot-gate: Fix some function declarations in ddr.h
Ying-Chun Liu (PaulLiu) [Mon, 13 Mar 2023 18:26:20 +0000 (02:26 +0800)]
compulab: imx8mm-cl-iot-gate: Fix some function declarations in ddr.h

We have a few places here that the function declarations do not
match their prototypes, correct them.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reported-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
21 months agonet: fec_mxc: Add board_interface_eth_init() for i.MX8M Mini/Nano/Plus
Marek Vasut [Mon, 6 Mar 2023 14:53:51 +0000 (15:53 +0100)]
net: fec_mxc: Add board_interface_eth_init() for i.MX8M Mini/Nano/Plus

Implement common board_interface_eth_init() and call it from the FEC
driver to configure IOMUXC GPR[1] register according to the PHY mode
obtained from DT. This supports all three interface modes supported by
the i.MX8M Mini/Nano/Plus FEC and supersedes the current board-side
configuration of the same IOMUX GPR[1] duplicated in the board files.

Signed-off-by: Marek Vasut <marex@denx.de>
21 months agonet: fec_mxc: Add ref clock setup support for i.MX8M Mini/Nano/Plus
Marek Vasut [Mon, 6 Mar 2023 14:53:50 +0000 (15:53 +0100)]
net: fec_mxc: Add ref clock setup support for i.MX8M Mini/Nano/Plus

The FEC ref clock frequency on i.MX8M Mini/Nano/Plus was so far configured
via ad-hoc board code. Replace that with DM clock clk_set_rate() instead.
This way, the driver claims all its required clock and sets the ref clock
rate, without any need of architecture specific register fiddling.

Signed-off-by: Marek Vasut <marex@denx.de>
21 months agonet: dwc_eth_qos: Add board_interface_eth_init() for i.MX8M Plus
Marek Vasut [Mon, 6 Mar 2023 14:53:49 +0000 (15:53 +0100)]
net: dwc_eth_qos: Add board_interface_eth_init() for i.MX8M Plus

Implement common board_interface_eth_init() and call it from the DWMAC
driver to configure IOMUXC GPR[1] register according to the PHY mode
obtained from DT. This supports all three interface modes supported by
the i.MX8M Plus DWMAC and supersedes current board-side configuration
of the same IOMUX GPR[1] duplicated in the board files.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
21 months agonet: dwc_eth_qos: Add i.MX8M Plus RMII support
Marek Vasut [Mon, 6 Mar 2023 14:53:48 +0000 (15:53 +0100)]
net: dwc_eth_qos: Add i.MX8M Plus RMII support

With DM clock support in place, it is easy to add RMII support into the
MAC driver. The RMII cannot operate at 1000 Mbps and at 100 and 10 Mbps
the clock frequency is 50 MHz and 5 MHz instead of 25 MHz and 2.5 MHz.

The board DT requires the following adjustments to EQoS node:
  phy-mode = "rmii";
  assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_266M>,
   <&clk IMX8MP_SYS_PLL2_100M>,
   <&clk IMX8MP_SYS_PLL2_50M>;
  assigned-clock-rates = <0>, <100000000>, <50000000>;

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
21 months agonet: dwc_eth_qos: Add DM CLK support for i.MX8M Plus
Marek Vasut [Mon, 6 Mar 2023 14:53:47 +0000 (15:53 +0100)]
net: dwc_eth_qos: Add DM CLK support for i.MX8M Plus

The DWMAC clock in i.MX8M Plus were so far configured via ad-hoc
architecture code. Replace that with DM clock instead. This way,
the driver claims all its required clock, enables and disables
them, and even gets the CSR clock rate and sets the TX clock rate,
without any need of architecture specific register fiddling. Drop
the architecture specific code while at it too.

The adjustment here is modeled after STM32MP15xx clock handling
in this driver.

Signed-off-by: Marek Vasut <marex@denx.de>
21 months agonet: dwc_eth_qos: Set DMA_MODE SWR bit to reset the MAC
Marek Vasut [Mon, 6 Mar 2023 14:53:46 +0000 (15:53 +0100)]
net: dwc_eth_qos: Set DMA_MODE SWR bit to reset the MAC

The driver currently only waits for DMA_MODE SWR bit to clear itself.
This is insufficient e.g. on i.MX8M Plus, where the MAC must be reset
before IOMUX GPR[1] content is latched into the MAC and used. Without
the proper reset, the i.MX8M Plus MAC variant does not take the value
in IOMUX GPR[1] into account, which makes it impossible e.g. to switch
interface mode from RGMII to any other.

Since proper reset is desired in general to put the block into defined
state, always assert the DMA_MODE SWR bit before waiting for the bit
to clear itself.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
21 months agonet: dwc_eth_qos: Staticize eqos_inval_buffer_tegra186()
Marek Vasut [Mon, 6 Mar 2023 14:53:45 +0000 (15:53 +0100)]
net: dwc_eth_qos: Staticize eqos_inval_buffer_tegra186()

This function is only used within the driver, staticize it.

Fixes: 149e80f74b6 ("net: dwc_eth_qos: public some functions")
Signed-off-by: Marek Vasut <marex@denx.de>
21 months agonet: dwc_eth_qos: Drop unused dm_gpio_free() on STM32
Marek Vasut [Mon, 6 Mar 2023 14:53:44 +0000 (15:53 +0100)]
net: dwc_eth_qos: Drop unused dm_gpio_free() on STM32

The dm_gpio_free() is never called, because for stm32, the phy_reset_gpio
pointer is never valid. This is because only tegra186 ever claims the
phy_reset_gpio, all other platforms use the PHY framework to reset the
PHY instead. Drop the dm_gpio_free() and dm_gpio_is_valid().

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
21 months agonet: dwc_eth_qos: Drop bogus return after goto
Marek Vasut [Mon, 6 Mar 2023 14:53:43 +0000 (15:53 +0100)]
net: dwc_eth_qos: Drop bogus return after goto

The return is never triggered due to the goto just above it.
Drop it. No functional change.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
21 months agonet: Pull board_interface_eth_init() into common code
Marek Vasut [Mon, 6 Mar 2023 14:53:42 +0000 (15:53 +0100)]
net: Pull board_interface_eth_init() into common code

Move the board_interface_eth_init() into common ethernet uclass code,
since this function could be shared by multiple drivers.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marex@denx.de>
21 months agoclk: imx8mp: Add EQoS MAC clock
Marek Vasut [Mon, 6 Mar 2023 14:53:41 +0000 (15:53 +0100)]
clk: imx8mp: Add EQoS MAC clock

Add clock for the DWMAC EQoS block. This is used among other things
to configure the MII clock via DM CLK.

Acked-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Marek Vasut <marex@denx.de>
21 months agoRevert "imx: imx8x: colibri: switch to binman"
Andrejs Cainikovs [Fri, 3 Mar 2023 13:26:41 +0000 (14:26 +0100)]
Revert "imx: imx8x: colibri: switch to binman"

This reverts commit bdadc140a127b14a666d2007eddc3f65c8de7d5a.

We do not want this, see [1].

[1] https://lore.kernel.org/all/56cf058164f331ce99ce75b0751b825ee2e07fc0.camel@toradex.com/

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
21 months agocolibri-imx8x: set bootdelay
Marcel Ziswiler [Fri, 3 Mar 2023 13:26:40 +0000 (14:26 +0100)]
colibri-imx8x: set bootdelay

Set the boot delay to one second.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
21 months agocolibri-imx8x: set bootaux memory base and size
Andrejs Cainikovs [Fri, 3 Mar 2023 13:26:38 +0000 (14:26 +0100)]
colibri-imx8x: set bootaux memory base and size

Move i.MX auxiliary core memory base and size configuration
to defconfig where it should belong.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
21 months agocolibri-imx8x: update env memory layout
Marcel Ziswiler [Fri, 3 Mar 2023 13:26:37 +0000 (14:26 +0100)]
colibri-imx8x: update env memory layout

Update the distro config env memory layout for the Colibri iMX8X:

- kernel_comp_addr_r=0xb0000000 temporary area for uncompressing (ie FIT
images or Image.gz booted using booti)
- kernel_comp_size=0x08000000
- loadaddr=0x95400000 avoiding any reserved areas located before that
- fdt_addr_r = loadaddr + 128MB - allows for 128MB kernel
- scriptaddr = fdt_addr_r + 512KB - allows for 512KB fdt
- ramdisk_addr_r = scriptaddr + 512KB - allows for 512KB script

Idea of memory layout taken from commit a9f1e35bedc4
("apalis-imx8: update env memory layout").

Note that for our regular BSP Layers and Reference Images for Yocto
Project an updated distro boot script is required (see
meta-toradex-bsp-common/recipes-bsp/u-boot/u-boot-distro-boot).

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
21 months agocolibri-imx8x: switch from fatload to load
Andrejs Cainikovs [Fri, 3 Mar 2023 13:26:36 +0000 (14:26 +0100)]
colibri-imx8x: switch from fatload to load

Make sure M4 binary loading works equally well
on ext4 as well as fat file systems.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>