]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
12 months agoarm64: imx8mp: Enable TCP, IPv6, wget on Data Modul i.MX8M eDM SBC
Marek Vasut [Wed, 22 Nov 2023 23:37:38 +0000 (00:37 +0100)]
arm64: imx8mp: Enable TCP, IPv6, wget on Data Modul i.MX8M eDM SBC

Enable support for TCP protocol, wget, and IPv6 on this platform.
The former two allow users download payload into the U-Boot from
a web server, which may be more convenient or easier to set up
than TFTP server. The later is enabled to future proof the IP
stack on this platform.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
12 months agoarm64: imx8mp: Enable TCP, IPv6, wget on DH i.MX8MP DHCOM
Marek Vasut [Sat, 4 Nov 2023 16:32:21 +0000 (17:32 +0100)]
arm64: imx8mp: Enable TCP, IPv6, wget on DH i.MX8MP DHCOM

Enable support for TCP protocol, wget, and IPv6 on this platform.
The former two allow users download payload into the U-Boot from
a web server, which may be more convenient or easier to set up
than TFTP server. The later is enabled to future proof the IP
stack on this platform.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
12 months agoarm: imx6: Enable TCP, IPv6, wget on DH i.MX6 DHCOM
Marek Vasut [Sat, 4 Nov 2023 16:32:20 +0000 (17:32 +0100)]
arm: imx6: Enable TCP, IPv6, wget on DH i.MX6 DHCOM

Enable support for TCP protocol, wget, and IPv6 on this platform.
The former two allow users download payload into the U-Boot from
a web server, which may be more convenient or easier to set up
than TFTP server. The later is enabled to future proof the IP
stack on this platform.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
12 months agopico-imx7d: add baseboard SD card boot detect
Benjamin Szőke [Wed, 13 Dec 2023 18:51:49 +0000 (15:51 -0300)]
pico-imx7d: add baseboard SD card boot detect

Technexion PICO-IMX7 SoM is supporting USDHC3 (eMMC or micro SD on SoM)
and USDHC1 (SD on carrier board) to use on any carrier board like
PICO-NYMPH. Based on the U-Boot version from Technexion it adds
baseboard SD card boot detect to able to boot from selected USDHC1
or USDHC3 boot devices.

Signed-off-by: Benjamin Szőke <egyszeregy@freemail.hu>
Tested-by: Fabio Estevam <festevam@gmail.com>
12 months agoimx: imx-hab: Select SPL_DRIVERS_MISC in the SPL case
Fabio Estevam [Mon, 11 Dec 2023 13:46:17 +0000 (10:46 -0300)]
imx: imx-hab: Select SPL_DRIVERS_MISC in the SPL case

Selecting CONFIG_IMX_HAB=y on a SPL target, such as apalis_imx6_defconfig,
for example, leads to the following build error:

/usr/bin/arm-linux-gnueabihf-ld.bfd: arch/arm/mach-imx/hab.o: in function `imx_hab_is_enabled':
arch/arm/mach-imx/hab.c:879: undefined reference to `fuse_read'

fuse_read() comes from SPL_MXC_OCOTP, which depends on SPL_DRIVERS_MISC,
since commit 251a3053b1e6 ("misc: imx: remove DM dependency for ocotp
driver in SPL").

Select SPL_DRIVERS_MISC in the SPL case to fix this build issue.

Reported-by: Lisandro Pérez Meyer <lpmeyer@ics.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Tested-by: Lisandro Pérez Meyer <lpmeyer@ics.com>
12 months agotools: mxsboot: pre-fill buffer with 0xff, not 0
Alessandro Rubini [Sun, 3 Dec 2023 17:08:26 +0000 (18:08 +0100)]
tools: mxsboot: pre-fill buffer with 0xff, not 0

The tool works for me, with imx28 and NAND memory, but the resulting
blocks are reported as bad, both by u-boot and the kernel.

This makes it impossible to erase from Linux (for an upgrade without
console access, for example -- u-boot can "nand scrub" but linux can't).

pre-filling with 0xff creates a proper boot loader image, but no
bad-block marker is there when written to flash.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>
12 months agoarm: mxs: Clear CPSR V bit to activate low vectors
Marek Vasut [Wed, 18 Oct 2023 18:51:59 +0000 (20:51 +0200)]
arm: mxs: Clear CPSR V bit to activate low vectors

The MXS starts with CPSR V bit set, which makes the CPU jump to high vectors
in case of an exception. Those high vectors are located at 0xffff0000, which
is where the BootROM exception table is located as well. U-Boot should handle
exceptions on its own using its own exception handling code, which is located
at 0x0, i.e. at low vectors. Clear the CPSR V bit, so that the CPU would jump
to low vectors on exception instead, and therefore run the U-Boot exception
handling code.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
12 months agoclk: imx8mn: add pwm clocks
Nicolas Heemeryck [Mon, 11 Dec 2023 10:06:13 +0000 (11:06 +0100)]
clk: imx8mn: add pwm clocks

Based on Linux kernel 6.7-rc4, add necessary clocks for the PWM
controllers.

Signed-off-by: Nicolas Heemeryck <nicolas.heemeryck@devialet.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
12 months agoboard: apalis/colibri imx6/imx6ull/imx7: Add fastboot bootcmd support
Hiago De Franco [Thu, 9 Nov 2023 16:24:01 +0000 (13:24 -0300)]
board: apalis/colibri imx6/imx6ull/imx7: Add fastboot bootcmd support

This commit adds support for Fastboot boot commands by checking both
CONFIG_CMD_USB_SDP and CONFIG_USB_FUNCTION_FASTBOOT. If either of these
configurations is set, it indicates that the board is in recovery mode
and can use either SDP or Fastboot.

The default option remains the SDP command, but if
CONFIG_CMD_FASTBOOT is set, it changes to 'fastboot usb 0' as
the boot command.

Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
12 months agoapalis/colibri imx6/imx6ull/imx7: defconfig: Enable fastboot support
Hiago De Franco [Thu, 9 Nov 2023 16:24:00 +0000 (13:24 -0300)]
apalis/colibri imx6/imx6ull/imx7: defconfig: Enable fastboot support

Add fastboot support for Apalis iMX6, Colibri iMX6, Colibri iMX6ULL and
Colibri iMX7 boards. Remove CONFIG_FASTBOOT_BUF_SIZE from
colibri_imx7_emmc_defconfig to get the default value of 0x7000000 instead
of 0x10000000, to make it consistent with the other boards.

Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
12 months agoimx7d-pico-pi-u-boot.dtsi: Fix aliases indentation
Fabio Estevam [Fri, 3 Nov 2023 23:00:54 +0000 (20:00 -0300)]
imx7d-pico-pi-u-boot.dtsi: Fix aliases indentation

The aliases are currently indented using spaces.

Fix it to use the standard tab indentation.

Signed-off-by: Fabio Estevam <festevam@denx.de>
12 months agopico-imx7d: Remove board_phy_config()
Fabio Estevam [Fri, 3 Nov 2023 22:47:33 +0000 (19:47 -0300)]
pico-imx7d: Remove board_phy_config()

With Ethernet DM in place, there is no longer the need for having
the board_phy_config() anymore.

Remove it.

Tested on imx7d-pico-pi board:

=> setenv autoload no
=> dhcp
BOOTP broadcast 1
*** Unhandled DHCP Option in OFFER/ACK: 42
DHCP client bound to address 192.168.0.138 (138 ms)
=> tftp zImage
Using ethernet@30be0000 device
TFTP from server 192.168.0.16; our IP address is 192.168.0.138
Filename 'zImage'.
Load address: 0x80800000
Loading: #################################################################
....
 #################################################################
 ##########
 4.3 MiB/s
done
Bytes transferred = 9034120 (89d988 hex)

Signed-off-by: Fabio Estevam <festevam@denx.de>
12 months agolibrem5: Add addresses for compressed kernel load
Arnaud Ferraris [Fri, 27 Oct 2023 13:40:45 +0000 (15:40 +0200)]
librem5: Add addresses for compressed kernel load

The "booti" command to load arm64 Linux kernels supports automatic
decompression of zipped kernel images, but relies on some environment
variables to point to usable buffer RAM.

Add those variables and let them point to some default values, that
should cover most use-cases.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
12 months agolibrem5: properly set the `fdtfile` env variable
Arnaud Ferraris [Fri, 27 Oct 2023 13:40:44 +0000 (15:40 +0200)]
librem5: properly set the `fdtfile` env variable

In order to use the generic "distro boot" using an extlinux.conf file,
the `fdtfile` environment variable is mandatory. This commit ensure this
variable is properly constructed based on the detected board revision.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
12 months agoconfigs: imx8mn_beacon: Disable the WDT autostart
Adam Ford [Wed, 25 Oct 2023 23:04:56 +0000 (18:04 -0500)]
configs: imx8mn_beacon: Disable the WDT autostart

Auto-starting the WDT can cause false reboots when the user
is not intentionally trying to use the WDT, so leave it off until
it is requested.

Signed-off-by: Adam Ford <aford173@gmail.com>
12 months agoconfigs: imx8mn_beacon: Do not set SYS_CONSOLE_IS_IN_ENV
Adam Ford [Wed, 25 Oct 2023 23:04:55 +0000 (18:04 -0500)]
configs: imx8mn_beacon: Do not set SYS_CONSOLE_IS_IN_ENV

The hardware only supports a specific console port, so  remove the
option to change the console location in the environment.

Signed-off-by: Adam Ford <aford173@gmail.com>
12 months agoconfigs: imx8mm_beacon: Disable the WDT autostart
Adam Ford [Wed, 25 Oct 2023 23:04:54 +0000 (18:04 -0500)]
configs: imx8mm_beacon: Disable the WDT autostart

Auto-starting the WDT can cause false reboots when the user
is not intentionally trying to use the WDT, so leave it off until
it is requested.

Signed-off-by: Adam Ford <aford173@gmail.com>
12 months agoconfigs: imx8mm_beacon: Enable fastboot downloading
Adam Ford [Wed, 25 Oct 2023 23:04:53 +0000 (18:04 -0500)]
configs: imx8mm_beacon: Enable fastboot downloading

Fastboot is necessary to use UUU enhanced functions, so enable it.

Signed-off-by: Adam Ford <aford173@gmail.com>
12 months agoconfigs: imx8mp_beacon: Do not set SYS_CONSOLE_IS_IN_ENV
Adam Ford [Wed, 25 Oct 2023 23:04:52 +0000 (18:04 -0500)]
configs: imx8mp_beacon: Do not set SYS_CONSOLE_IS_IN_ENV

The hardware only supports a specific console port, so  remove the
option to change the console location in the environment.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
12 months agoMAINTAINERS: Remove non-working address from MAINTAINERS
Hugo Villeneuve [Mon, 23 Oct 2023 15:26:28 +0000 (11:26 -0400)]
MAINTAINERS: Remove non-working address from MAINTAINERS

The address ariel.dalessandro@collabora.com is no longer working:

  A message that you sent could not be delivered to one or more of its
  recipients. This is a permanent error. The following address(es) failed:

  ariel.dalessandro@collabora.com
    host mx.collabora.co.uk [46.235.227.165]
    SMTP error from remote mail server after RCPT TO:<ariel.dalessandro@collabora.com>:
    550 5.1.1 <ariel.dalessandro@collabora.com>: Recipient address rejected:
    undeliverable address: host mail.collabora.co.uk[46.235.227.172] said:
    550 5.1.1 <ariel.dalessandro@collabora.com>: Recipient address rejected:
    User unknown in local recipient table (in reply to RCPT TO command)

Remove this address from MAINTAINERS.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
12 months agoimx8mn-var-som: Simplify FEC initialization
Hugo Villeneuve [Thu, 19 Oct 2023 19:43:23 +0000 (15:43 -0400)]
imx8mn-var-som: Simplify FEC initialization

With DM enabled, there is no need for board code to initialize
the FEC interface.

The ethernet PHYs on the symphony carrier board have a dedicated
crystal/oscillator. If the SOM has the EC configuration option
(onboard ethernet PHY), it also has a dedicated crystal/oscillator.
So in all cases, there is no need to enable the RGMII TX clk output.

This follows a similar change introduced by Fabio Estevam:
Link: https://lore.kernel.org/u-boot/20231019170441.1610453-1-festevam@gmail.com/
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
12 months agoimx8mn_var_som: Add myself to MAINTAINERS
Hugo Villeneuve [Thu, 19 Oct 2023 19:42:41 +0000 (15:42 -0400)]
imx8mn_var_som: Add myself to MAINTAINERS

I would like to help maintaining the imx8mn_var_som symphony board.

Add myself to MAINTAINERS.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
12 months agoclock_imx8mm: Add a stub for imx8mp_fec_interface_init()
Fabio Estevam [Fri, 20 Oct 2023 00:47:35 +0000 (21:47 -0300)]
clock_imx8mm: Add a stub for imx8mp_fec_interface_init()

When CONFIG_DWC_ETH_QOS_IMX=y and CONFIG_FEC_MXC is not selected, the
following warning is seen:

arch/arm/mach-imx/imx8m/clock_imx8mm.c: In function 'board_interface_eth_init':
arch/arm/mach-imx/imx8m/clock_imx8mm.c:914:24: warning: implicit declaration of function 'imx8mp_fec_interface_init; did you mean 'imx8mp_eqos_interface_init'? [-Wimplicit-function-declaration]

Fix it by adding a stub for imx8mp_fec_interface_init() to handle this
case.

This follows the same approach done on imx8mp_eqos_interface_init().

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
12 months agoimx8mp_evk: Remove unneeded header files
Fabio Estevam [Thu, 19 Oct 2023 21:51:13 +0000 (18:51 -0300)]
imx8mp_evk: Remove unneeded header files

Cleanup the file by removing unneeded header files.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
12 months agoimx8mp_evk: Simplify Ethernet initialization
Fabio Estevam [Thu, 19 Oct 2023 21:51:12 +0000 (18:51 -0300)]
imx8mp_evk: Simplify Ethernet initialization

With DM enabled, there is no need for board code to initialize
the Ethernet interfaces.

The RTL8211FDI Ethernet PHYs have 25MHz oscillator, so there is no
need to enable the RGMII TX clk output.

Also, there is no need for describing the deprecated phy-reset FEC
properties, nor passing reset properties to the EQOS interface in
u-boot.dtsi.

Remove all these unneeded pieces.

Tested both Ethernet interfaces after these changes.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
12 months agophy: phy-imx8mq-usb: Remove .exit operation
Fabio Estevam [Thu, 19 Oct 2023 12:36:09 +0000 (09:36 -0300)]
phy: phy-imx8mq-usb: Remove .exit operation

Currently, when running "ums 0 mmc 2" and breaking it via
CTRL + C, the following message is seen:

u-boot=> ums 0 mmc 1
UMS: LUN 0, dev mmc 1, hwpart 0, sector 0x0, count 0x1dacc00
CTRL+C - Operation aborted
clk usb_phy_root_clk already disabled

The USB PHY clock is disabled twice: first it gets disabled
inside imx8mq_usb_phy_power_off(), then it is disabled again
inside imx8mq_usb_phy_exit().

Let the USB PHY clock be disabled only once inside
imx8mq_usb_phy_power_off() by removing the .exit operation.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
12 months agoarm: dts: imx8mp: Sync with linux-next 20231019
Fabio Estevam [Thu, 19 Oct 2023 12:06:23 +0000 (09:06 -0300)]
arm: dts: imx8mp: Sync with linux-next 20231019

Sync imx8mp.dtsi and imx8mp-clock.h with linux-next 20231019.

Signed-off-by: Fabio Estevam <festevam@denx.de>
12 months agoarm: dts: imx8mn: Sync with linux-next 20231019
Fabio Estevam [Thu, 19 Oct 2023 12:06:22 +0000 (09:06 -0300)]
arm: dts: imx8mn: Sync with linux-next 20231019

Sync imx8mn.dtsi with linux-next 20231019.

Signed-off-by: Fabio Estevam <festevam@denx.de>
12 months agoarm: dts: imx8mm: Sync with linux-next 20231019
Fabio Estevam [Thu, 19 Oct 2023 12:06:21 +0000 (09:06 -0300)]
arm: dts: imx8mm: Sync with linux-next 20231019

Sync imx8mm.dtsi with linux-next 20231019.

The motivation for doing this sync was a bug when doing "ums 0 mmc 1"
on imx8mm-evk. It worked well for the first time, but after doing
a CTRL+C and launching the ums again, the command did not work.

Adam Ford suggested to sync imx8mm.dtsi with the Linux dts, as there was
a recent USB power domain reorganization there.

After syncing the imx8mm.dtsi with Linux, the ums command works without
problem after a CTRL+C.

Suggested-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Acked-by: Tim Harvey <tharvey@gateworks.com>
12 months agoimx8mp_evk: Add myself to MAINTAINERS
Fabio Estevam [Wed, 18 Oct 2023 19:17:42 +0000 (16:17 -0300)]
imx8mp_evk: Add myself to MAINTAINERS

I would like to help maintaining the imx8mp_evk board.

Add myself to MAINTAINERS.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Acked-by: Peng Fan <peng.fan@nxp.com>
12 months agoimx8mp_evk: Convert to DM_PMIC
Fabio Estevam [Wed, 18 Oct 2023 19:17:41 +0000 (16:17 -0300)]
imx8mp_evk: Convert to DM_PMIC

Currently, the imx8mp_evk uses the non-DM code to initialize the PMIC.

Convert to DM_PMIC, which is the recommended way to access the PMIC.

While at it, fix multi-line comments style.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
12 months agoarm: dts: imx8mp-venice-gw73xx: add TPM device
Tim Harvey [Wed, 18 Oct 2023 18:33:52 +0000 (11:33 -0700)]
arm: dts: imx8mp-venice-gw73xx: add TPM device

Add the TPM device found on the GW73xx revision F PCB.

This hangs off of SPI2, uses gpio1_10 as a CS and gpio1_11 as RST#.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
12 months agoarm: dts: imx8mm-venice-gw73xx: add TPM device
Tim Harvey [Wed, 18 Oct 2023 18:33:38 +0000 (11:33 -0700)]
arm: dts: imx8mm-venice-gw73xx: add TPM device

Add the TPM device found on the GW73xx revision F PCB.

This hangs off of SPI2, uses gpio1_10 as a CS and gpio1_11 as RST#.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
12 months agoimx8mn-var-som: add manufacturer to target description
Hugo Villeneuve [Tue, 17 Oct 2023 14:25:00 +0000 (10:25 -0400)]
imx8mn-var-som: add manufacturer to target description

Add Variscite manufacturer to the IMX8MN_VAR_SOM target menu label as
the majority of targets include the manufacturer as part of their menu
description/label and it helps when looking for a particular
manufacturer/board.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
12 months agoarm: dts: imx93-evk: remove wrong eqos compatible string
Sébastien Szymanski [Tue, 17 Oct 2023 09:45:01 +0000 (11:45 +0200)]
arm: dts: imx93-evk: remove wrong eqos compatible string

The correct compatible string for i.MX93 variant of DWC EQoS MAC is now
"nxp,imx93-dwmac-eqos".

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
12 months agonet: phy: realtek: Add support for RTL8211F(D)(I)-VD-CG
Sébastien Szymanski [Tue, 17 Oct 2023 09:45:00 +0000 (11:45 +0200)]
net: phy: realtek: Add support for RTL8211F(D)(I)-VD-CG

Add support for the RTL8211F(D)(I)-VD-CG PHY present on the i.MX93 EVK
board.

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
12 months agonet: dwc_eth_qos: Add board_interface_eth_init() for i.MX93
Sébastien Szymanski [Tue, 17 Oct 2023 09:44:59 +0000 (11:44 +0200)]
net: dwc_eth_qos: Add board_interface_eth_init() for i.MX93

Add a common board_interface_eth_init() called by the DWC MAC driver to
setup the MAC <-> PHY interface according to the PHY mode obtained from
DT.
Remove the board-side configuration in the i.MX93 EVK files.

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
12 months agonet: dwc_eth_qos: add i.MX93 support
Sébastien Szymanski [Tue, 17 Oct 2023 09:44:58 +0000 (11:44 +0200)]
net: dwc_eth_qos: add i.MX93 support

Add support for DWC EQoS MAC on i.MX93.

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
12 months agoARM: imx8ulp: support env in fat and ext4
Ricardo Salveti [Fri, 25 Aug 2023 14:44:14 +0000 (17:44 +0300)]
ARM: imx8ulp: support env in fat and ext4

Change boot device logic to also allow environment stored in fat and
in ext4 when booting from SD or eMMC.

As the boot device check for SD and for eMMC was depending on
ENV_IS_IN_MMC being defined, change the ifdef blocks at
env_get_location to use IS_ENABLED instead for all modes, returning
NOWHERE when no valid mode is found.

Signed-off-by: Ricardo Salveti <ricardo@foundries.io>
Co-developed-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
12 months agoimx: imx8: ahab: refactor do_ahab_close command
Igor Opaniuk [Mon, 21 Aug 2023 19:33:41 +0000 (22:33 +0300)]
imx: imx8: ahab: refactor do_ahab_close command

Move an OEM closing logic to ahab_close() function to be able to use
it directly without calling a u-boot command.

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
Co-developed-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
12 months agoarm: mxs: Fix ICOLL macro name typo
Marek Vasut [Sat, 29 Jul 2023 13:29:41 +0000 (15:29 +0200)]
arm: mxs: Fix ICOLL macro name typo

The interrupt collector macro name for i.MX23 is MXS_ICOLL_BASE,
this is correct and matches the documentation of both i.MX23 and
i.MX28. Align the i.MX28 macro accordingly. No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
12 months agoarm: dts: imx8mm-phyboard-polis-rdk: Sync dts files with kernel
Cem Tenruh [Fri, 14 Jul 2023 08:23:26 +0000 (10:23 +0200)]
arm: dts: imx8mm-phyboard-polis-rdk: Sync dts files with kernel

Sync the devicetree files used in the kernel for the imx8mm-phyboard-polis
with the corresponding devicetree files in U-Boot.
Replaced phycore-imx8mm.dts with kernel dts imx8mm-phyboard-polis-rdk.dts

Synced with kernel 6.5.0-rc1 commit
e752a4f9589c (arm64: dts: freescale: imx8mm-phyboard: Add I2C4 pinmuxing)

Signed-off-by: Cem Tenruh <c.tenruh@phytec.de>
12 months agoimx7d-sdb: Sync devicetree with kernel 6.5-rc1
Fabio Estevam [Wed, 13 Dec 2023 12:37:08 +0000 (09:37 -0300)]
imx7d-sdb: Sync devicetree with kernel 6.5-rc1

Commit 0aea5dda2928 ("ARM: dts: imx7d-sdb-u-boot: Fix usdhc1 UHS
operation") did a temporary workaround by addng the usdhc1 fix
inside the -u-boot.dtsi file.

The imx7d-sdb.dts from kernel 6.5-rc1 contains the proper UHS
fix, so sync the devicetree tree and remove the previous fix
from -u-boot.dtsi.

Also, adjust the PMIC node name inside pmic_get() to match
the devicetree update.

Signed-off-by: Fabio Estevam <festevam@denx.de>
12 months agoimx: imx8mp: Add support for Polyhex Debix Model A SBC
Gilles Talis [Wed, 13 Dec 2023 12:29:40 +0000 (09:29 -0300)]
imx: imx8mp: Add support for Polyhex Debix Model A SBC

Add support for the Polyhex Debix Model A SBC board.
It is an industrial grade single board computer based on
NXP's i.MX 8M Plus.
Currently supported interfaces are:
- Serial console
- Micro SD
- eQOS and FEC Ethernet

imx8mp-debix-model-a.dts is taken from Linux 6.3.

Signed-off-by: Gilles Talis <gilles.talis@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
12 months agoimx8qm_dmsse20a1: Improve SPL memory configuration
Fabio Estevam [Wed, 13 Dec 2023 12:16:12 +0000 (09:16 -0300)]
imx8qm_dmsse20a1: Improve SPL memory configuration

Currently, building imx8qm_dmsse20a1_defconfig leads to the following
warning:

aarch64-linux-ld.bfd: invalid origin for memory region .sdram

Fix it by using the same SPL memory layout as done in the imx8mq_evk.

Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Tested-by: Oliver Graute <oliver.graute@kococonnector.com>
12 months agoddr: imx: Save the FW loading if it hasn't changed
Shawn Guo [Mon, 2 Jan 2023 12:20:34 +0000 (20:20 +0800)]
ddr: imx: Save the FW loading if it hasn't changed

Function ddr_load_train_firmware() is called 4 times in a loop by
ddr_cfg_phy(). The first 3 calls are all '1D' type and just loading the
same FWs.  Let's add a type check and save 2 of them.  This helps to
reduce DDRPHY training time from 269 ms down to 212 ms, and thus speed
up boot time ~ 50 ms.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Fabio Estevam <festevam@denx.de>
12 months agotest: bdinfo: Handle systems without getopt
Marek Vasut [Sun, 10 Dec 2023 15:01:56 +0000 (16:01 +0100)]
test: bdinfo: Handle systems without getopt

Systems without getopt support fall back to plain full bdinfo print,
handle such a case, which occurs e.g. with sandbox_flattree_defconfig .

Fixes: 8827a3871452 ("test: bdinfo: Test bdinfo -h")
Fixes: 2696f3ab8101 ("test: bdinfo: Test bdinfo -m")
Fixes: 3ff2d796a6f2 ("test: bdinfo: Test bdinfo -e")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
12 months agotest/py: Disable error E0611 in two cases for pylint
Tom Rini [Sat, 9 Dec 2023 19:52:46 +0000 (14:52 -0500)]
test/py: Disable error E0611 in two cases for pylint

Recently pylint has started to complain about:
No name 'fs_helper' in module 'tests' (no-name-in-module)

Due to:
from tests import fs_helper

However, we have:
test/py/tests/fs_helper.py

And since we do not want to add a dummy test/py/tests/__init__.py to
silence this warning we instead just disable it as needed.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
12 months agoMerge patch series "cmd: bdinfo: Optionally use getopt and implement bdinfo -a"
Tom Rini [Sat, 9 Dec 2023 13:42:49 +0000 (08:42 -0500)]
Merge patch series "cmd: bdinfo: Optionally use getopt and implement bdinfo -a"

Clean up our bdinfo command a bit and introduce "bdinfo -a"

12 months agotest: bdinfo: Test bdinfo -e
Marek Vasut [Sat, 7 Oct 2023 21:41:06 +0000 (23:41 +0200)]
test: bdinfo: Test bdinfo -e

The bdinfo -e should print only the board ethernet settings.
Test the expected output.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
12 months agotest: bdinfo: Test bdinfo -m
Marek Vasut [Sat, 7 Oct 2023 21:41:05 +0000 (23:41 +0200)]
test: bdinfo: Test bdinfo -m

The bdinfo -m should print only the board memory layout.
Test the expected output.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 months agotest: bdinfo: Test bdinfo -h
Marek Vasut [Sat, 7 Oct 2023 21:41:04 +0000 (23:41 +0200)]
test: bdinfo: Test bdinfo -h

The bdinfo -h should print error message that -h is an unknown
parameter and then command help text. Test the expected output.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
12 months agotest: bdinfo: Test both bdinfo and bdinfo -a
Marek Vasut [Sat, 7 Oct 2023 21:41:03 +0000 (23:41 +0200)]
test: bdinfo: Test both bdinfo and bdinfo -a

Factor out the core of test for all bdinfo output into bdinfo_test_all()
and then reuse it to verify that both 'bdinfo' and 'bdinfo -a' print all
the bdinfo output.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
12 months agotest: bdinfo: Rename bdinfo_test_move() to bdinfo_test_full()
Marek Vasut [Sat, 7 Oct 2023 21:41:02 +0000 (23:41 +0200)]
test: bdinfo: Rename bdinfo_test_move() to bdinfo_test_full()

Rename bdinfo_test_move() to bdinfo_test_full(). The former is a
remnant of deriving this test from another test. No functional
change.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
12 months agoconfigs: sandbox: Enable GETOPT for sandbox and sandbox64 target
Marek Vasut [Sat, 7 Oct 2023 21:41:01 +0000 (23:41 +0200)]
configs: sandbox: Enable GETOPT for sandbox and sandbox64 target

Enable GETOPT so that 'bdinfo' command with getopt() support can be
tested in CI.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
12 months agocmd: bdinfo: Implement support for printing ethernet settings via bdinfo -e
Marek Vasut [Sat, 7 Oct 2023 21:41:00 +0000 (23:41 +0200)]
cmd: bdinfo: Implement support for printing ethernet settings via bdinfo -e

Add support for printing ethernet settings only via 'bdinfo -e' .

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
12 months agocmd: bdinfo: Implement support for printing memory layout via bdinfo -m
Marek Vasut [Sat, 7 Oct 2023 21:40:59 +0000 (23:40 +0200)]
cmd: bdinfo: Implement support for printing memory layout via bdinfo -m

Add support for printing memory layout only via 'bdinfo -m' .

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
12 months agocmd: bdinfo: Optionally use getopt and implement bdinfo -a
Marek Vasut [Sat, 7 Oct 2023 21:40:58 +0000 (23:40 +0200)]
cmd: bdinfo: Optionally use getopt and implement bdinfo -a

Add optional support for getopt() and in case this is enabled via
GETOPT configuration option, implement support for 'bdinfo -a'.
The 'bdinfo -a' behaves exactly like bdinfo and prints 'all' the
bdinfo information. This is implemented in preparation for other
more fine-grained options.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
12 months agoMerge tag 'v2024.01-rc4' into next
Tom Rini [Tue, 5 Dec 2023 02:39:57 +0000 (21:39 -0500)]
Merge tag 'v2024.01-rc4' into next

Prepare v2024.01-rc4

# -----BEGIN PGP SIGNATURE-----
#
# iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmVuHrwACgkQFHw5/5Y0
# tyy3Tgv+LB/X0ZR3IHnu1mvQ7kpOFvAjjKr0BUpcEEzsrDZeJnS6sy06m+REez2E
# UmuLeKFj5NUCYXNKtxn2+gVnJt8Tk6ftxhMTiZHmR4Y4NVc5aPtqYmVsv6Q29j0U
# mcg7AGcZTniu9/naNM+ZcDeHzLDAB0whmE9eVfixXVgyitILoLHNdFiQ7W4oR7Kh
# /mBgdMDBS3rqiRi6CuqKUnl4ADX8T3AXaSfi3hqOC5Pj+HPkZSUfyWx31mu9mN1D
# wXTHASZX06Dop25fm/ZSdWk1blBw29WqRiJBdwNatvyC5pqMsotTvAfH2AcHBEYg
# tpoper+WDOBAipt6b6Y1B7q4VPvJ97L9dFCAYqN0nGCe+rkdi+k+cly7M6Ye9xLt
# e7rVUfnKgIMP8jkLcVBYoWkFY5FiJ82O5qjoF5N3dAuHeWacDFsB5TugDTOQvblH
# LWCmcIyU1N9Ma/Ib0rTvNduvpBUYBKXYlD1+rjPZUbTUnfc79mf+ReFpcoW6Kxh+
# bkz81p8P
# =ebIZ
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 04 Dec 2023 01:47:24 PM EST
# gpg:                using RSA key 1A3C7F70E08FAB1707809BBF147C39FF9634B72C
# gpg: Good signature from "Thomas Rini <trini@konsulko.com>" [ultimate]

12 months agoPrepare v2024.01-rc4
Tom Rini [Mon, 4 Dec 2023 18:46:56 +0000 (13:46 -0500)]
Prepare v2024.01-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
12 months agoefi_loader: generated SMBIOS table below 4 GiB
Heinrich Schuchardt [Mon, 20 Nov 2023 22:25:58 +0000 (23:25 +0100)]
efi_loader: generated SMBIOS table below 4 GiB

We currently use an outdated format 32-bit format for SMBIOS tables.
So we must allocate SMBIOS tables below 4 GiB.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
12 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-watchdog
Tom Rini [Mon, 4 Dec 2023 18:37:18 +0000 (13:37 -0500)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-watchdog

- Correct watchdog timeout print message (Chanho Park)

12 months agowatchdog: Correct watchdog timeout print message
Chanho Park [Sun, 3 Dec 2023 08:30:40 +0000 (17:30 +0900)]
watchdog: Correct watchdog timeout print message

The wdt_start function takes timeout_ms as a parameter and starts the
watchdog with this value. However, when you output the message, it shows
the default timeout value for the watchdog device.
So this patch fixes that part to output the correct timeout value.

Before -->
StarFive # wdt start 3000
WDT:   Started watchdog@13070000 without servicing  (60s timeout)

After -->
StarFive # wdt start 3000
WDT:   Started watchdog@13070000 without servicing  (3s timeout)

Fixes: c2fd0ca1a822 ("watchdog: Integrate watchdog triggering into the cyclic framework")
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Reviewed-by: Stefan Roese <sr@denx.de>
12 months agoMerge branch 'master-rpc-off' of https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Sun, 3 Dec 2023 21:30:32 +0000 (16:30 -0500)]
Merge branch 'master-rpc-off' of https://source.denx.de/u-boot/custodians/u-boot-sh

12 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Sat, 2 Dec 2023 18:37:27 +0000 (13:37 -0500)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-usb

- USB XHCI fixes

12 months agoARM: dts: renesas: Disable RPC driver on R8A779G0 V4H White Hawk board
Cong Dang [Mon, 19 Jun 2023 22:41:50 +0000 (00:41 +0200)]
ARM: dts: renesas: Disable RPC driver on R8A779G0 V4H White Hawk board

As requirement of CR side, QSPI Flash usage via RPC driver shall
be disabled and leaving the control of this module to CR side.
Perform DT modification to disable the RPC SPI.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Cong Dang <cong.dang.xn@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Do not modify defconfig, modify the DT instead, this way
        the RPC SPI can be enabled without recompiling the U-Boot
itself. Update commit message accordingly.]

12 months agoARM: dts: renesas: Clean up R8A779G0 V4H RPC SPI DT node
Marek Vasut [Mon, 19 Jun 2023 22:41:49 +0000 (00:41 +0200)]
ARM: dts: renesas: Clean up R8A779G0 V4H RPC SPI DT node

Use the phandle reference to &rpc node in arch/arm/dts/r8a779g0.dtsi
and remove properties which are already in arch/arm/dts/r8a779g0.dtsi.
No functional change and no resulting DT change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
12 months agousb: USB_XHCI_PCI depends on PCI
Heinrich Schuchardt [Mon, 20 Nov 2023 14:56:36 +0000 (15:56 +0100)]
usb: USB_XHCI_PCI depends on PCI

Compiling with CONFIG_USB_XHCI_PCI and CONFIG_PCI=n results in

    usb/host/xhci-pci.c:48:(.text.xhci_pci_probe+0x44):
    undefined reference to `dm_pci_write_config32

Add the missing Kconfig dependency.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Marek Vasut <marex@denx.de>
12 months agousb: dwc3-generic: Use combined glue and ctrl node for RK3588
Jonas Karlman [Sun, 12 Nov 2023 15:25:25 +0000 (15:25 +0000)]
usb: dwc3-generic: Use combined glue and ctrl node for RK3588

Like Rockchip RK3328 and RK3568, the RK3588 also have a single node to
represent the glue and ctrl for USB 3.0.

Use rk_ops as driver data to select correct ctrl node for RK3588 DWC3.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Marek Vasut <marex@denx.de>
12 months agousb: storage: Use the correct CBW lengths
Hector Martin [Sun, 29 Oct 2023 07:23:30 +0000 (16:23 +0900)]
usb: storage: Use the correct CBW lengths

USB UFI uses fixed 12-byte commands (as does RBC, which is not
supported), but SCSI does not have this limitation. Use the correct
command block lengths depending on the subclass.

Signed-off-by: Hector Martin <marcan@marcan.st>
Reviewed-by: Marek Vasut <marex@denx.de>
12 months agousb: hub: Add missing reset recovery delay
Hector Martin [Sun, 29 Oct 2023 07:09:09 +0000 (16:09 +0900)]
usb: hub: Add missing reset recovery delay

Some devices like YubiKeys need more time before SET_ADDRESS. The spec
says we need to wait 10ms.

Signed-off-by: Hector Martin <marcan@marcan.st>
Reviewed-by: Marek Vasut <marex@denx.de>
12 months agousb: xhci: Fix DMA address calculation in queue_trb
Hector Martin [Sun, 29 Oct 2023 06:37:44 +0000 (15:37 +0900)]
usb: xhci: Fix DMA address calculation in queue_trb

We need to get the DMA address before incrementing the pointer, as that
might move us onto another segment.

Signed-off-by: Hector Martin <marcan@marcan.st>
Reviewed-by: Marek Vasut <marex@denx.de>
12 months agousb: xhci: Do not panic on event timeouts
Hector Martin [Sun, 29 Oct 2023 06:37:43 +0000 (15:37 +0900)]
usb: xhci: Do not panic on event timeouts

Now that we always check the return value, just return NULL on timeouts.
We can still log the error since this is a problem, but it's not reason
to panic.

Signed-off-by: Hector Martin <marcan@marcan.st>
Reviewed-by: Marek Vasut <marex@denx.de>
12 months agousb: xhci: Fail on attempt to queue TRBs to a halted endpoint
Hector Martin [Sun, 29 Oct 2023 06:37:42 +0000 (15:37 +0900)]
usb: xhci: Fail on attempt to queue TRBs to a halted endpoint

This isn't going to work, don't pretend it will and then end up timing
out.

Signed-off-by: Hector Martin <marcan@marcan.st>
Reviewed-by: Marek Vasut <marex@denx.de>
12 months agousb: xhci: Recover from halted bulk endpoints
Hector Martin [Sun, 29 Oct 2023 06:37:41 +0000 (15:37 +0900)]
usb: xhci: Recover from halted bulk endpoints

There is currently no codepath to recover from this case. In principle
we could require that the upper layer do this explicitly, but let's just
do it in xHCI when the next bulk transfer is started, since that
reasonably implies whatever caused the problem has been dealt with.

Signed-off-by: Hector Martin <marcan@marcan.st>
Reviewed-by: Marek Vasut <marex@denx.de>
12 months agousb: xhci: Allow context state errors when halting an endpoint
Hector Martin [Sun, 29 Oct 2023 06:37:40 +0000 (15:37 +0900)]
usb: xhci: Allow context state errors when halting an endpoint

There is a race where an endpoint may halt by itself while we are trying
to halt it, which results in a context state error. See xHCI 4.6.9 which
mentions this case.

This also avoids BUGging when we attempt to stop an endpoint which was
already stopped to begin with, which is probably a bug elsewhere but
not a good reason to crash.

Signed-off-by: Hector Martin <marcan@marcan.st>
Reviewed-by: Marek Vasut <marex@denx.de>
12 months agousb: xhci: Better error handling in abort_td()
Hector Martin [Sun, 29 Oct 2023 06:37:39 +0000 (15:37 +0900)]
usb: xhci: Better error handling in abort_td()

If the xHC has a problem with our STOP ENDPOINT command, it is likely to
return a completion directly instead of first a transfer event for the
in-progress transfer. Handle that more gracefully.

We still BUG() on the error code, but at least we don't end up timing
out on the event and ending up with unexpected event errors.

Signed-off-by: Hector Martin <marcan@marcan.st>
Reviewed-by: Marek Vasut <marex@denx.de>
12 months agousb: xhci: Guard all calls to xhci_wait_for_event
Hector Martin [Sun, 29 Oct 2023 06:37:38 +0000 (15:37 +0900)]
usb: xhci: Guard all calls to xhci_wait_for_event

xhci_wait_for_event returns NULL on timeout, so the caller always has to
check for that. This addresses immediate explosions in this part
of the code when timeouts happen, but not the root cause for the
timeout.

Signed-off-by: Hector Martin <marcan@marcan.st>
Reviewed-by: Marek Vasut <marex@denx.de>
12 months agoMerge branch 'staging' of https://source.denx.de/u-boot/custodians/u-boot-tegra into...
Tom Rini [Thu, 30 Nov 2023 14:33:31 +0000 (09:33 -0500)]
Merge branch 'staging' of https://source.denx.de/u-boot/custodians/u-boot-tegra into next

Device tree improvents for Paz00 and DM PMIC convertion of recently
merged Tegra boards.

12 months agoMerge branch '2023-11-29-assorted-platform-updates' into next
Tom Rini [Wed, 29 Nov 2023 16:16:13 +0000 (11:16 -0500)]
Merge branch '2023-11-29-assorted-platform-updates' into next

- Add a TFTP put test, a few TI Keystone 2 updates, fix stack-protector
  for PowerPC, fixes in lib/slre, timer-uclass and pvblock.

12 months agoARM: keystone2: Remove unneeded inclusions of common.h
Andrew Davis [Fri, 17 Nov 2023 22:38:29 +0000 (16:38 -0600)]
ARM: keystone2: Remove unneeded inclusions of common.h

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 months agoconfigs: keystone2: Do not include hardware.h
Andrew Davis [Fri, 17 Nov 2023 22:38:28 +0000 (16:38 -0600)]
configs: keystone2: Do not include hardware.h

This is a hacky way to have this file included in all source files that
include common.h, instead just include from the files that need it.

Signed-off-by: Andrew Davis <afd@ti.com>
12 months agoconfigs: keystone2: Remove unused SPL_MALLOC_F_SIZE and KEYSTONE_SPL_STACK_SIZE
Andrew Davis [Fri, 17 Nov 2023 22:38:27 +0000 (16:38 -0600)]
configs: keystone2: Remove unused SPL_MALLOC_F_SIZE and KEYSTONE_SPL_STACK_SIZE

These are leftover definitions. While here cleanup some leftover comments.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 months agoFix stack-protector for powerpc
Christophe Leroy [Wed, 15 Nov 2023 18:36:36 +0000 (19:36 +0100)]
Fix stack-protector for powerpc

On powerpc, stack protector expects a function called
__stack_chk_fail_local() instead of __stack_chk_fail()

And some versions of GCC for powerpc default to TLS canary
instead of global canary, so always force GCC to use global
canary with -mstack-protector-guard=global

Cc: Joel Peshkin <joel.peshkin@broadcom.com>
Fixes: 4e9bce12432 ("Add support for stack-protector")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
12 months agoxen: pvblock: fix the maximum io size in one operation
AKASHI Takahiro [Wed, 15 Nov 2023 01:53:45 +0000 (10:53 +0900)]
xen: pvblock: fix the maximum io size in one operation

The current implementation may cause BUG_ON() in blkfront_aio()
BUG_ON(n > BLKIF_MAX_SEGMENTS_PER_REQUEST);

In pvblock_iop(), a read/write operation will be split into smaller
chunks of data so that the size in one access (aio_nbytes) is limited
to, at the maximum,
BLKIF_MAX_SEGMENTS_PER_REQUEST * PAGE_SIZE

But this works only if when the *buffer* passed in to pvblock_io()
is page-aligned. If not, the given data region may stand across
(BLKIF_MAX_SEGMENTS_PER_REQUEST + 1) pages. See the logic in
blkfront_aio():
start = (uintptr_t)aiocbp->aio_buf & PAGE_MASK;
end = ((uintptr_t)aiocbp->aio_buf + aiocbp->aio_nbytes +
       PAGE_SIZE - 1) & PAGE_MASK;
Then this will lead to BUG_ON() above.

This can be fixed by decreasing the maximum size of aio_nbytes.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Fixes: commit 3a739cc6c948 ("xen: pvblock: Implement front-back protocol and do IO")
12 months agotimer-uclass: Always use "clock-frequency" property as fallback
Alex Bee [Tue, 14 Nov 2023 21:11:27 +0000 (22:11 +0100)]
timer-uclass: Always use "clock-frequency" property as fallback

Currently the "clock-frequency" DT property is only being considered as an
fallback if either there is no clock driver, the clock driver implements
the request-op correctly or there is no clock defined for the timer at all.

This patch makes "clock-frequency" also being picked as a fallback if
getting the clock-rate fails, since clk_get(_by_index) will return no
error, if a clock driver does not implement the request-op and does also
not support getting the rate of the clock in question.
timer_post_probe will take care if the property does not exist in the DT or
is defined as 0.

Signed-off-by: Alex Bee <knaerzche@gmail.com>
12 months agolib/slre: Fix memory leak if regex compilation fails
Francois Berder [Sun, 12 Nov 2023 19:16:50 +0000 (20:16 +0100)]
lib/slre: Fix memory leak if regex compilation fails

Signed-off-by: Francois Berder <fberder@outlook.fr>
12 months agotest/py: net: Add a TFTP put test
Love Kumar [Wed, 8 Nov 2023 07:10:31 +0000 (12:40 +0530)]
test/py: net: Add a TFTP put test

Execute tftpput command for uploading files to a server and validate its
size & CRC32.

Signed-off-by: Love Kumar <love.kumar@amd.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agoMerge patch series "cmd: add scmi command"
Tom Rini [Wed, 29 Nov 2023 03:31:09 +0000 (22:31 -0500)]
Merge patch series "cmd: add scmi command"

To quote the author:

"Scmi" command will be re-introduced per Michal's request.
The functionality is the same as I put it in my patch set of adding
SCMI base protocol support, but made some tweak to make UT, "ut dm
scmi_cmd," more flexible and tolerable when enabling/disabling a specific
SCMI protocol for test purpose.

Each commit may have some change history inherited from the preceding
patch series.

Test
====
The patch series was tested on the following platforms:
* sandbox

12 months agotest: dm: add scmi command test
AKASHI Takahiro [Tue, 14 Nov 2023 02:14:28 +0000 (11:14 +0900)]
test: dm: add scmi command test

In this test, "scmi" command is tested against different sub-commands.
Please note that scmi command is for debug purpose and is not intended
in production system.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
12 months agodoc: cmd: add documentation for scmi
AKASHI Takahiro [Tue, 14 Nov 2023 02:14:27 +0000 (11:14 +0900)]
doc: cmd: add documentation for scmi

This is a help text for scmi command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
12 months agocmd: add scmi command for SCMI firmware
AKASHI Takahiro [Tue, 14 Nov 2023 02:14:26 +0000 (11:14 +0900)]
cmd: add scmi command for SCMI firmware

This command, "scmi", may provide a command line interface to various SCMI
protocols. It supports at least initially SCMI base protocol and is
intended mainly for debug purpose.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
12 months agofirmware: scmi: support protocols on sandbox only if enabled
AKASHI Takahiro [Tue, 14 Nov 2023 02:14:25 +0000 (11:14 +0900)]
firmware: scmi: support protocols on sandbox only if enabled

This change will be useful when we manually test SCMI on sandbox
by enabling/disabling a specific SCMI protocol.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 months agotest: dm: skip scmi tests against disabled protocols
AKASHI Takahiro [Tue, 14 Nov 2023 02:14:24 +0000 (11:14 +0900)]
test: dm: skip scmi tests against disabled protocols

This is a precautionary change to make scmi tests workable whether or not
a specific protocol be enabled. If a given protocol is not configured,
we skip the test by returning -EAGAIN.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 months agoMerge patch series "fs: fat: calculate FAT type based on cluster count"
Tom Rini [Wed, 29 Nov 2023 01:10:36 +0000 (20:10 -0500)]
Merge patch series "fs: fat: calculate FAT type based on cluster count"

To quote the author:

This series fixes an issue where the FAT type (FAT12, FAT16) is not
correctly detected, e.g. when the BPB field BS_FilSysType contains the
valid value "FAT     ".

This issue occures, for example, if a partition is formatted by
swupdate using its diskformat handler. swupdate uses the FAT library
from http://elm-chan.org/fsw/ff/ internally.

See https://groups.google.com/g/swupdate/c/7Yc3NupjXx8 for a
discussion in the swupdate mailing list.

Please refer to the commit messages for more details.

1. Added bootsector checks

Most tests from https://www.win.tue.nl/~aeb/linux/fs/fat/fat-2.html
are added in the commit 'fs: fat: add bootsector validity check'.
Only the tests VIII, IX and X are not implemented.

I also checked the Linux kernel code (v6.6) and did not find any
checks on 'vistart->fs_type'. This is the reason why is skipped them
here.

See section '2. Size comparisons' for the impact on the binary size.

2. Size comparisons

I executed bloat-o-meter from the Linux kernel for an arm64
target (config xilinx_zynqmp_mini_emmc0_defconfig):

Comparison of the binary spl/u-boot-spl between master (rev
e17d174773e9ba9447596708e702b7382e47a6cf) and this patch
series (including the added validity checks of the boot sector):

add/remove: 0/0 grow/shrink: 1/1 up/down: 100/-12 (88)
Function                                     old     new   delta
read_bootsectandvi                           308     408    +100
fat_itr_root                                 444     432     -12
Total: Before=67977, After=68065, chg +0.13%

When compare the size of the binary spl/u-boot-spl between master this
series without the the validity checks of the boot sector:

add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-24 (-24)
Function                                     old     new   delta
read_bootsectandvi                           308     296     -12
fat_itr_root                                 444     432     -12
Total: Before=67977, After=67953, chg -0.04%

So the size of the spl on this arm64 target increases by 88 bytes for
this series. When i remove the validity check the size decreases by 24 bytes.

12 months agotest: fs: Add test to detect fat type
Christian Taedcke [Wed, 15 Nov 2023 12:44:24 +0000 (13:44 +0100)]
test: fs: Add test to detect fat type

Ensure that a large FAT12 filesystem and a small FAT16 filesystem are
detected correctly.

Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com>
12 months agotest: Add size granularity parameter to mk_fs
Christian Taedcke [Wed, 15 Nov 2023 12:44:23 +0000 (13:44 +0100)]
test: Add size granularity parameter to mk_fs

Without this commit it is only possible to create filesystem images
with a size granularity of 1MB.
This commit adds the option to create file systems with different
sizes, e.g 8.5MB.

Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com>
12 months agotest: fs: Add fat12 to supported fs of some tests
Christian Taedcke [Wed, 15 Nov 2023 12:44:22 +0000 (13:44 +0100)]
test: fs: Add fat12 to supported fs of some tests

The tests fs_ext, fs_mkdir and fs_unlink support fat12 without
modifications.
The fs_basic test uses a partition that is too large for fat12, so it
is omitted here.

Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com>
12 months agotest: Add support to create a fat12 fs
Christian Taedcke [Wed, 15 Nov 2023 12:44:21 +0000 (13:44 +0100)]
test: Add support to create a fat12 fs

This enables to implement tests for fat12 filesystem.

Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com>
12 months agofs: fat: add bootsector validity check
Christian Taedcke [Wed, 15 Nov 2023 12:44:20 +0000 (13:44 +0100)]
fs: fat: add bootsector validity check

The performed checks are similar to the checks performed by the Linux
kernel in the function fat_read_bpb() in the file fs/fat/inode.c.

Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com>