]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
12 months agocommand: Move command completion temporary buffer to stack
Marek Vasut [Sat, 2 Dec 2023 20:52:31 +0000 (21:52 +0100)]
command: Move command completion temporary buffer to stack

The command completion temporary buffer seems to be only
used by the argv tokenizer, move it to stack. This saves
2 kiB from the binary size (depends on configuration) per:
$ aarch64-linux-gnu-readelf -s u-boot | sort -n -k 3

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 months agocommand: Allocate history buffer using calloc()
Marek Vasut [Sat, 2 Dec 2023 20:52:30 +0000 (21:52 +0100)]
command: Allocate history buffer using calloc()

The history buffer is currently a static array which can be some
10-40 kiB depending on configuration, and so adds considerably to
the U-Boot binary size. Allocate it dynamically instead to reduce
the U-Boot binary size.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
12 months agobootflow: Allow setting a cmdline arg with no value
Simon Glass [Wed, 29 Nov 2023 17:31:19 +0000 (10:31 -0700)]
bootflow: Allow setting a cmdline arg with no value

This is supposed to be supported by the 'bootflow cmd' command, at
least according to the help. There is a 'bootflow cmd clear' but it is
often more intuitive to use 'bootcmd cmd set' with an empty value.

Update the command to pass BOOTFLOWCL_EMPTY in this case.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agobootm: Fix flags used for bootargs string substitution
Piotr Kubik [Fri, 24 Nov 2023 16:30:46 +0000 (17:30 +0100)]
bootm: Fix flags used for bootargs string substitution

Commit 51bb33846ad2 ("bootm: Support string substitution in
bootargs") introduced a feature of bootargs string substitution
and changed a flag used in bootm_process_cmdline_env() call
to be either true or false. With this flag value,
condition in bootm_process_cmdline()
`if (flags & BOOTM_CL_SUBST)` is never true
and process_subst() is never called.

Add a simple test to verify if substitution works OK.

Signed-off-by: Piotr Kubik <piotr.kubik@iopsys.eu>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 months agoarm: afs: Set the filesize env. var. on load
Robert Catherall [Thu, 23 Nov 2023 14:16:01 +0000 (14:16 +0000)]
arm: afs: Set the filesize env. var. on load

The `afs load` command copies data to RAM. Set the filesize
environment variable to record how much data was 'loaded'

Signed-off-by: Robert Catherall <robert.catherall@arm.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Andre Przywara <andre.przywara@arm.com>
12 months agorsa: use pkcs11 uri as defined in rfc7512
Ayoub Zaki [Sat, 26 Aug 2023 11:53:29 +0000 (13:53 +0200)]
rsa: use pkcs11 uri as defined in rfc7512

pkcs11 : change engine uri to use full pk11-URI as defined in:

https://www.rfc-editor.org/rfc/rfc7512.html
Signed-off-by: Ayoub Zaki <ayoub.zaki@embetrix.com>
12 months agoimxtract: specify max gunzip size
Nikita Shubin [Mon, 19 Dec 2022 08:05:27 +0000 (11:05 +0300)]
imxtract: specify max gunzip size

Specify max gunzip size from config to override SYS_XIMG_LEN
default value wich is 0x800000. In case we have a large portion of FIT
image, for example gzipped kernel with decompressed size large than
0x800000 we should enlarge imxract area, otherwise extracting it will
fail.

It used to be a hardcoded define in cmd/ximg.c and we are moving it to
config.

Signed-off-by: Nikita Shubin <n.shubin@yadro.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 months agoMerge tag 'u-boot-amlogic-next-20231220' of https://source.denx.de/u-boot/custodians...
Tom Rini [Wed, 20 Dec 2023 13:34:12 +0000 (08:34 -0500)]
Merge tag 'u-boot-amlogic-next-20231220' of https://source.denx.de/u-boot/custodians/u-boot-amlogic into next

- Add support for new GXL MDIO mux, with driver and Linux DT sync from v6.4

12 months agoMerge branch 'staging' of https://source.denx.de/u-boot/custodians/u-boot-tegra into...
Tom Rini [Tue, 19 Dec 2023 20:16:13 +0000 (15:16 -0500)]
Merge branch 'staging' of https://source.denx.de/u-boot/custodians/u-boot-tegra into next

This PR contains 4 patchsets:

1. PMIC GPIO cells bringup. Created drivers for MAX7663 and Palmas
PMICs and gpio-uclass patch isolated behind configs for these 2
drivers. No unintentional size increase on any board. (proposed
2023-11-06 without any reaction)

2. Simple PLL clocks support in common tegra clock code which allows
use of simple PLL the same way main PLLs are used (before only
clock_start_pll was available). PLLD2 is an example of simple PLL, it
is used as a video subsystem parent clock and was used to test this
code. So far everything worked as expected. (proposed 2023-11-16
without any reaction)

3. A small patch for tegra emmc to allow pass max frequency from
device tree since some devices may not support full speed.

4. Pinmux DM conversion. Patchset consists of commit with DM wrapper
for existing pinmux code for t20/t30/t114, pinmux and funcmux files
relocation into a dedicated folder inside pinctrl, conversion of some
tegra boards to device tree pinmux setup.

12 months agoboard: compal: paz00: clean up the board
Svyatoslav Ryhel [Sat, 2 Dec 2023 08:08:02 +0000 (10:08 +0200)]
board: compal: paz00: clean up the board

Since implementation of pinctrl driver for T20 Paz00 can switch
to device tree pinmux setup along with remove of board pinmux
and some minor device tree and defconfig tweaks.

Tested-by: Agneli <poczt@protonmail.ch> # Toshiba AC100 T20
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
12 months agoboard: htc: endeavoru: switch to DM pinmux
Svyatoslav Ryhel [Tue, 28 Nov 2023 11:43:31 +0000 (13:43 +0200)]
board: htc: endeavoru: switch to DM pinmux

Drop the pinmux setup in the board in favor of setting it up in
the device tree. Device tree nodes match nodes used for the Linux
device tree and are set according to the downstream kernel. 

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
12 months agoboard: asus: transformer: switch to DM pinmux
Svyatoslav Ryhel [Mon, 27 Nov 2023 17:20:21 +0000 (19:20 +0200)]
board: asus: transformer: switch to DM pinmux

Drop the pinmux setup in the board in favor of setting it up in
the device tree. Device tree nodes match nodes used in the Linux
device tree. 

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
12 months agoboard: lg: x3-t30: switch to DM pinmux
Svyatoslav Ryhel [Mon, 27 Nov 2023 17:08:32 +0000 (19:08 +0200)]
board: lg: x3-t30: switch to DM pinmux

Drop the pinmux setup in the board in favor of setting it up in
the device tree. Device tree nodes match nodes used for the Linux
device tree and are set according to the service manual.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
12 months agoboard: asus: grouper: switch to DM pinmux
Svyatoslav Ryhel [Mon, 27 Nov 2023 16:16:50 +0000 (18:16 +0200)]
board: asus: grouper: switch to DM pinmux

Drop the pinmux setup in the board in favor of setting it up in
the device tree. Device tree nodes match nodes used in the Linux
device tree.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
12 months agodrivers: pinctrl: tegra: incorporate existing code
Svyatoslav Ryhel [Mon, 27 Nov 2023 09:54:21 +0000 (11:54 +0200)]
drivers: pinctrl: tegra: incorporate existing code

Move all existing pinmux and funcmux code into a dedicated folder in
pinctrl to simplify further maintenance.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
12 months agodrivers: pinctrl: create Tegra DM pinctrl driver
Svyatoslav Ryhel [Sun, 26 Nov 2023 15:54:03 +0000 (17:54 +0200)]
drivers: pinctrl: create Tegra DM pinctrl driver

The existing pinctrl driver available for Tegra SOC is well
designed, but it lacks DM support. Let's add a DM compatible
overlay, which allows use of the device tree, along with preserving
backward compatibility with all existing setups and the ability
to use it in SPL board configuration stage.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
12 months agoARM: mach-tegra: rearrange SPL configs
Svyatoslav Ryhel [Fri, 1 Dec 2023 11:22:00 +0000 (13:22 +0200)]
ARM: mach-tegra: rearrange SPL configs

SPL configs are used only by the ARMv7-based Tegra SOC's, so move
SPL_SYSRESET under TEGRA_ARMV7_COMMON selection and enable SPL_DM
since SPL_SYSRESET depends on it.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
12 months agommc: tegra: use max-frequency from device tree if provided
Peter Geis [Tue, 19 Dec 2023 13:35:52 +0000 (15:35 +0200)]
mmc: tegra: use max-frequency from device tree if provided

The driver currently hard-codes the max freqency for the sdhci
controllers. If the controller is unable to operate at the max
frequency, the mmc card will not be available on the first scan.
Subsequent scans will eventually find a working combination.

Fix this by allowing the driver to check for the max-frequency
property and default to the original value if it doesn't exist.

Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
12 months agoARM: tegra114: clock: implement PLLD2 support
Svyatoslav Ryhel [Thu, 16 Nov 2023 07:35:26 +0000 (09:35 +0200)]
ARM: tegra114: clock: implement PLLD2 support

PLLD2 is a simple clock (controlled by 2 registers) and appears starting
from T30. Primary use of PLLD2 is as main HDMI clock parent.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
12 months agoARM: tegra30: clock: implement PLLD2 support
Svyatoslav Ryhel [Mon, 3 Jul 2023 15:11:58 +0000 (18:11 +0300)]
ARM: tegra30: clock: implement PLLD2 support

PLLD2 is a simple clock (controlled by 2 registers) and appears starting
from T30. Primary use of PLLD2 is as main HDMI clock parent.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
12 months agoARM: tegra: clock: support get and set rate for simple PLL
Svyatoslav Ryhel [Mon, 3 Jul 2023 15:06:54 +0000 (18:06 +0300)]
ARM: tegra: clock: support get and set rate for simple PLL

Simple PLL clocks like PLLD2 were omitted since they do not share common
4 register structure with main clocks. Such clocks are containd in simple
PLL group. Only clock_start_pll function supported them. This patch expands
this support on clock_set_rate and clock_get_rate which should make
simple PLL clocks equal to main PLL clocks.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
12 months agodrivers: gpio-uclass: support PMIC GPIO children
Svyatoslav Ryhel [Wed, 26 Jul 2023 14:10:06 +0000 (17:10 +0300)]
drivers: gpio-uclass: support PMIC GPIO children

UCLASS_PMIC may have GPIO children without exposed fdt node,
in this case if requesting fails, check if uclass is PMIC.

Restrict build for supported devices only to save those precious
bytes on devices with no spare memory.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
12 months agodrivers: gpio: implement PALMAS GPIO cell
Svyatoslav Ryhel [Fri, 21 Jul 2023 07:50:15 +0000 (10:50 +0300)]
drivers: gpio: implement PALMAS GPIO cell

Add gpio driver for TI Palmas series PMIC. This has 8 gpio which can
work as input/output.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
12 months agodrivers: gpio: implement MAX77663 GPIO cell
Svyatoslav Ryhel [Sat, 15 Jul 2023 19:25:03 +0000 (22:25 +0300)]
drivers: gpio: implement MAX77663 GPIO cell

MAXIM Semiconductor's PMIC, MAX77663 has 8 GPIO pins and 3 GPIO-like
pins. It also supports interrupts from these pins.

Add GPIO driver for these pins to control via GPIO APIs.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
12 months agoMerge patch series "Fix J7200 kernel boot when using upstream u-boot"
Tom Rini [Tue, 19 Dec 2023 15:15:57 +0000 (10:15 -0500)]
Merge patch series "Fix J7200 kernel boot when using upstream u-boot"

Reid Tonking <reidt@ti.com> says:

Since the 09.01.00.002 release of ti-linux-firmware [0] upstream uboot
has led to the kernel hanging during boot [1] for the TI J7200 S0C. The
issue was found to be a few patches that had be added to ti-u-boot, but not
yet upstreamed. This series adds the missing two patches to allow upstream
u-boot to boot the kernel properly [2].

[0] https://git.ti.com/cgit/processor-firmware/ti-linux-firmware/commit/?h=ti-linux-firmware-next&id=952fd03e36a50ec070e73560dc1060102d637ce0

Boot logs:
[1] https://gist.github.com/reidt1/5f4e85a0db258bcf20d7168bd0caebd0
[2] https://gist.github.com/reidt1/e950dc97f15ad0a09623d64f81edac39

Links to patches on ti-u-boot:
https://git.ti.com/cgit/ti-u-boot/ti-u-boot/commit/?h=ti-u-boot-2023.04-next&id=d878fbef4d4460e87608d8d2dfe5311499de49c5
https://git.ti.com/cgit/ti-u-boot/ti-u-boot/commit/?h=ti-u-boot-2023.04-next&id=543e735fe495be233a8a75b19b3d7f8ed44251e0

12 months agoMerge patch series "Add support for MediaTek MT8365 EVK Board"
Tom Rini [Tue, 19 Dec 2023 15:09:14 +0000 (10:09 -0500)]
Merge patch series "Add support for MediaTek MT8365 EVK Board"

Julien Masson <jmasson@baylibre.com> says:

This patch series add the support for the MediaTek MT8365 EVK Board [1].
Most of the code have been copied/adapted from Linux tag v6.7-rc2.

For now we only enable/test these features:
Boot, UART, Watchdog and MMC.

[trini: This includes two clocks not listed in the Linux binding, which
 needs resyncing later]

12 months agoMerge branch '2023-12-19-assorted-platform-updates' into next
Tom Rini [Tue, 19 Dec 2023 15:07:56 +0000 (10:07 -0500)]
Merge branch '2023-12-19-assorted-platform-updates' into next

- Assorted platform updates for TI K3, vexpress64, mediatek and related
  cleanups to the DW GPIO driver and OPTEE

12 months agoarm: dts: k3-j7200-r5-common-proc-board: Set parent clock for clock ID 323
Reid Tonking [Thu, 7 Dec 2023 16:52:11 +0000 (10:52 -0600)]
arm: dts: k3-j7200-r5-common-proc-board: Set parent clock for clock ID 323

Previously, dynamic frequency scaling supported rates only through fixed
divison.

This virtual clock mux configuration enables more varied rates on A72
clock ID 202 by setting up the required register.

Reviewed-by: Udit Kumar <u-kumar1@ti.com>
Signed-off-by: Apurva Nandan <a-nandan@ti.com>
Signed-off-by: Reid Tonking <reidt@ti.com>
12 months agoarm: mach-k3: j72xx: add new 'virtual' mux
Bryan Brattlof [Thu, 7 Dec 2023 16:52:10 +0000 (10:52 -0600)]
arm: mach-k3: j72xx: add new 'virtual' mux

In order for the Cortex-A72s to operate at different frequencies other
than the default 2GHz, add in a new 'virtual' mux (a mux that does not
physically exist in the clock tree) that can be selected.

CC: Vishal Mahaveer <vishalm@ti.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Apurva Nandan <a-nandan@ti.com>
Signed-off-by: Reid Tonking <reidt@ti.com>
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
12 months agoboard: mediatek: add MT8365 EVK board support
Julien Masson [Mon, 4 Dec 2023 10:48:58 +0000 (11:48 +0100)]
board: mediatek: add MT8365 EVK board support

This adds support for the MT8365 EVK board with the following
features enabled/tested: Boot, UART, Watchdog and MMC.

Signed-off-by: Julien Masson <jmasson@baylibre.com>
12 months agodt-bindings: clock: add Mediatek MT8365 pinctrl bindings
Julien Masson [Mon, 4 Dec 2023 10:48:56 +0000 (11:48 +0100)]
dt-bindings: clock: add Mediatek MT8365 pinctrl bindings

This adds the pinctrl bindings for Mediatek MT8365 SoC based on the
dt-bindings in Linux tag v6.7-rc2.
(commit 8b4c397d88d97d4fd9c3f3527aa66688b1a3387a)

Signed-off-by: Julien Masson <jmasson@baylibre.com>
12 months agoarm: mediatek: add support for MediaTek MT8365 SoC
Julien Masson [Mon, 4 Dec 2023 10:48:55 +0000 (11:48 +0100)]
arm: mediatek: add support for MediaTek MT8365 SoC

This patch adds basic support for MediaTek MT8365 SoC.
The dtsi has been copied from Linux source code tag v6.7-rc2.
(commit 9b5d64654ea8f51fe1e8e29ca1777b620be8fb7c)

Signed-off-by: Julien Masson <jmasson@baylibre.com>
12 months agodt-bindings: power: add power-domain header for MediaTek MT8365 SoC
Julien Masson [Mon, 4 Dec 2023 10:48:53 +0000 (11:48 +0100)]
dt-bindings: power: add power-domain header for MediaTek MT8365 SoC

Add power-domain header for MediaTek MT8365 SoC copied from Linux
source code tag v6.7-rc2.
(commit a1571f1f333c2fced076f0d54ed771d1838d827f)

Signed-off-by: Julien Masson <jmasson@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
12 months agoclk: mediatek: add clock driver support for MediaTek MT8365 SoC
Julien Masson [Mon, 4 Dec 2023 10:48:52 +0000 (11:48 +0100)]
clk: mediatek: add clock driver support for MediaTek MT8365 SoC

This patch adds clock driver support for MediaTek MT8365 SoC.
The changes are based on the Linux source code tag v6.7-rc2.

clk-mt8365.c has been written based on these kernel files:
- clk-mt8365.c (a96cbb146a9736f501fe66ebda6a9018735e5e8a)
- clk-mt8365-apmixedsys.c (65c9ad77cbc0eed78db94d80041aba675cfbdfa9)
And adapted following the clk attributes supported by U-Boot.

Signed-off-by: Julien Masson <jmasson@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
12 months agodt-bindings: clock: add Mediatek MT8365 SoC clock bindings
Julien Masson [Mon, 4 Dec 2023 10:48:51 +0000 (11:48 +0100)]
dt-bindings: clock: add Mediatek MT8365 SoC clock bindings

This adds the clock bindings for Mediatek MT8365 SoC based on the
dt-bindings in Linux tag v6.7-rc2.
(commit c61978175ac1337f028ac1f956666f16db84f4e5)

Signed-off-by: Julien Masson <jmasson@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
12 months agoarm: mach-k3: am625: Relax emmc boot condition
Michael Trimarchi [Fri, 8 Dec 2023 07:53:05 +0000 (08:53 +0100)]
arm: mach-k3: am625: Relax emmc boot condition

spl_mmc_emmc_boot_partition return a number different from 0
if the partition is a boot one. We can have the uboot img
for instance in a raw offset in emmc partition 0 so we would
like to continue to load the next stage. If the user want
to use EMMC as boot device allow him to use any part of the
emmc and not only boot partition

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
12 months agommc: mediatek: set b_max according CONFIG_SYS_MMC_MAX_BLK_COUNT
Julien Masson [Mon, 4 Dec 2023 13:41:45 +0000 (14:41 +0100)]
mmc: mediatek: set b_max according CONFIG_SYS_MMC_MAX_BLK_COUNT

The block count limit on MMC based devices should be set according to
CONFIG_SYS_MMC_MAX_BLK_COUNT instead of hardcoding value.

Signed-off-by: Julien Masson <jmasson@baylibre.com>
12 months agogpio: dw: Drop unused headers
Maksim Kiselev [Wed, 29 Nov 2023 21:47:31 +0000 (00:47 +0300)]
gpio: dw: Drop unused headers

Drop headers which are not used or needed in this file.

Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
12 months agotee: optee: don't enumerate services if there ain't any
Etienne Carriere [Wed, 29 Nov 2023 12:37:53 +0000 (13:37 +0100)]
tee: optee: don't enumerate services if there ain't any

Change optee driver service enumeration to not enumerate (and
allocate a zero sized shared memory buffer) when OP-TEE
reports that there is no service to enumerate.

This change fixes an existing issue that occurs when the such zero
sized shared memory buffer allocated from malloc() has a physical
address of offset 0 of a physical 4kB page. In such case, OP-TEE
secure world refuses to register the zero-sized shared memory
area and makes U-Boot optee service enumeration to fail.

Fixes: 94ccfb78a4d6 ("drivers: tee: optee: discover OP-TEE services")
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
12 months agotee: optee: don't fail on services enumeration failure
Etienne Carriere [Wed, 29 Nov 2023 12:37:52 +0000 (13:37 +0100)]
tee: optee: don't fail on services enumeration failure

Change optee probe function to only warn when service enumeration
sequence fails instead of reporting an optee driver probe failure.
Indeed U-Boot can still use OP-TEE even if some OP-TEE services are
not discovered.

Fixes: 94ccfb78a4d6 ("drivers: tee: optee: discover OP-TEE services")
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
12 months agoremoteproc: k3-dsp: Avoid reloading of firmware
Udit Kumar [Sat, 25 Nov 2023 18:29:39 +0000 (23:59 +0530)]
remoteproc: k3-dsp: Avoid reloading of firmware

DSP core is going into abnormal state when load callback is called
after starting of DSP core.
Reload of firmware needs core to be stopped first, followed by
load.
So avoid loading of firmware, when core is started.

Signed-off-by: Udit Kumar <u-kumar1@ti.com>
12 months agoarm: vexpress64: juno: Allow boot from VirtIO
Robert Catherall [Thu, 23 Nov 2023 18:22:58 +0000 (18:22 +0000)]
arm: vexpress64: juno: Allow boot from VirtIO

The AEM and Juno FVPs (Fixed Virtual Platforms) support a VirtIO
disc interface. Adding VIRTIO to the list of boot devices allows
these FastModel platforms to boot from 'disc' in the same way
the hardware counterpart can boot from SATA or USB.

This is a NOP if CONFIG_CMD_VIRTIO is not enabled, so no impact
on Juno hardware (which is built with vexpress_aemv8a_juno_defconfig)

Signed-off-by: Robert Catherall <robert.catherall@arm.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
12 months agoARM: dts: sync Amlogic GX DT to Linux v6.4
Neil Armstrong [Wed, 13 Dec 2023 09:30:13 +0000 (10:30 +0100)]
ARM: dts: sync Amlogic GX DT to Linux v6.4

Sync Amlogic GXBB, GXL & GXM DTs from Linux v6.4, and also
switch to GXL MDIO MUX driver to adapt to DT change,

Most of the changes are only cosmetic or doesn't concern U-Boot,
the most important change for U-Boot is the GXL mdio mux compatible
switch to amlogic,gxl-mdio-mux.

Link: https://lore.kernel.org/r/20231213-u-boot-gxl-mdio-mux-v2-2-c56bb02a75ea@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
12 months agonet: Add Amlogic GXL MDIO Mux driver
Neil Armstrong [Wed, 13 Dec 2023 09:30:12 +0000 (10:30 +0100)]
net: Add Amlogic GXL MDIO Mux driver

Port the mdio-mux-meson-gxl.c Linux driver introduced in [1],
and adapt it to U-Boot.

This driver is needed to boot U-Boot with Linux DT since v6.4,
since it switched the MDIO mux from the mmio to a proper GXL driver.

[1] 9a24e1ff4326 ("net: mdio: add amlogic gxl mdio mux support")

Link: https://lore.kernel.org/r/20231213-u-boot-gxl-mdio-mux-v2-1-c56bb02a75ea@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
12 months agoMerge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-riscv into...
Tom Rini [Mon, 18 Dec 2023 14:56:58 +0000 (09:56 -0500)]
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-riscv into next

- VisionFive2: Enable CONFIG_SYSRESET
- StarFive: Modify starfive timer driver
- AMD/Xilinx: Add MicroBlaze V support
- Unmatched: Migrate to text environment

12 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-spi into...
Tom Rini [Mon, 18 Dec 2023 14:56:42 +0000 (09:56 -0500)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-spi into next

- spi_nor_read_sfdp_dma_unsafe (Vaishnav)
- w25q01/02 (Jim)

12 months agoMerge tag 'v2024.01-rc5' into next
Tom Rini [Mon, 18 Dec 2023 13:31:50 +0000 (08:31 -0500)]
Merge tag 'v2024.01-rc5' into next

Prepare v2024.01-rc5

12 months agoPrepare v2024.01-rc5
Tom Rini [Mon, 18 Dec 2023 12:49:45 +0000 (07:49 -0500)]
Prepare v2024.01-rc5

Signed-off-by: Tom Rini <trini@konsulko.com>
12 months agoriscv: sifive: unmatched: migrate to text environment
Yong-Xuan Wang [Tue, 5 Dec 2023 11:09:55 +0000 (11:09 +0000)]
riscv: sifive: unmatched: migrate to text environment

Migrate to the new environment format and drop most of the config.h.

Signed-off-by: Yong-Xuan Wang <yongxuan.wang@sifive.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agotimer: starfive: Add Starfive timer support
Kuan Lim Lee [Mon, 11 Dec 2023 02:22:10 +0000 (10:22 +0800)]
timer: starfive: Add Starfive timer support

Add timer driver in Starfive SoC. It is an timer that outside
of CPU core and inside Starfive SoC.

Signed-off-by: Kuan Lim Lee <kuanlim.lee@starfivetech.com>
Signed-off-by: Wei Liang Lim <weiliang.lim@starfivetech.com>
Changes for v2:
- correct driver name, comment, variable
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
12 months agoriscv: Add support for AMD/Xilinx MicroBlaze V
Michal Simek [Mon, 6 Nov 2023 11:56:47 +0000 (12:56 +0100)]
riscv: Add support for AMD/Xilinx MicroBlaze V

MicroBlaze V is new AMD/Xilinx soft-core 32bit RISC-V processor IP.
It is hardware compatible with classic MicroBlaze processor.

The patch contains initial wiring and configuration for initial HW design
with memory, cpu, interrupt controller, timers and uartlite console
(interrupt controller is listed but U-Boot is not using it).

Provided DT is just describing one configuration and should be taken only
as example.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
12 months agoconfigs: visionfive2: Enable CONFIG_SYSRESET config
Jaehoon Chung [Tue, 31 Oct 2023 08:24:39 +0000 (17:24 +0900)]
configs: visionfive2: Enable CONFIG_SYSRESET config

Enable CONFIG_SYSRESET config to do reset.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
12 months agoriscv: dts: jh7110: Add a gpio-restart node
Jaehoon Chung [Tue, 31 Oct 2023 08:24:38 +0000 (17:24 +0900)]
riscv: dts: jh7110: Add a gpio-restart node

Add gpio-restart node to do reset.

Before applied this patch, System Reset Extension doesn't appear with
sbi command.

OpenSBI 1.3
Machine:
  Vendor ID 489
  Architecture ID 8000000000000007
  Implementation ID 4210427
Extensions:
  sbi_set_timer
  sbi_console_putchar
...[snip]...
  IPI Extension
  RFENCE Extension
  Hart State Management Extension
  Performance Monitoring Unit Extension

After applied this patch, System Reset Extension is supported from SBI.

OpenSBI 1.3
Machine:
  Vendor ID 489
  Architecture ID 8000000000000007
  Implementation ID 4210427
Extensions:
  sbi_set_timer
  sbi_console_putchar
...[snip]...
  IPI Extension
  RFENCE Extension
  Hart State Management Extension
  System Reset Extension
  Performance Monitoring Unit Extension

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
12 months agoMerge tag 'efi-next-20231217' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Sun, 17 Dec 2023 14:11:06 +0000 (09:11 -0500)]
Merge tag 'efi-next-20231217' of https://source.denx.de/u-boot/custodians/u-boot-efi into next

Pull request for efi-next-20231217

Documentation:

* replace MD5 and SHA1 by SHA256 in examples

UEFI:

* Refactor boot manager and bootefi command to let the EFI boot method work
  without shell.

12 months agodoc: Replace examples of MD5 and SHA1 with SHA256
Sean Anderson [Sat, 2 Dec 2023 19:33:14 +0000 (14:33 -0500)]
doc: Replace examples of MD5 and SHA1 with SHA256

Both SHA1 and (especially) MD5 are no longer as safe as they once were for
cryptographic use. Replaces examples which use them with examples using
SHA256 instead. This will provide more-secure defaults for users who use
documentation examples as a base for their own use. This is not too
necessary for non-verified-boot scenarios (since someone could just replace
the checksum), but I wanted to be complete.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agobootmeth: use efi_loader interfaces instead of bootefi command
AKASHI Takahiro [Tue, 21 Nov 2023 01:29:46 +0000 (10:29 +0900)]
bootmeth: use efi_loader interfaces instead of bootefi command

Now that efi_loader subsystem provides interfaces that are equivalent
with bootefi command, we can replace command invocations with APIs.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
12 months agocmd: efidebug: ease efi configuration dependency
AKASHI Takahiro [Tue, 21 Nov 2023 01:29:45 +0000 (10:29 +0900)]
cmd: efidebug: ease efi configuration dependency

Now it is clear that the command actually depends on interfaces,
not "bootefi bootmgr" command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
12 months agocmd: bootefi: move library interfaces under lib/efi_loader
AKASHI Takahiro [Tue, 21 Nov 2023 01:29:44 +0000 (10:29 +0900)]
cmd: bootefi: move library interfaces under lib/efi_loader

In the prior commits, interfaces for executing EFI binary and boot manager
were carved out. Move them under efi_loader directory so that they can
be called from other places without depending on bootefi command.

Only efi_selftest-related code will be left in bootefi.c.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
12 months agocmd: bootefi: localize global device paths for efi_selftest
AKASHI Takahiro [Tue, 21 Nov 2023 01:29:43 +0000 (10:29 +0900)]
cmd: bootefi: localize global device paths for efi_selftest

Device paths allocated in bootefi_test_prepare() will be immediately
consumed by do_efi_selftest() and there is no need to keep them for later
use. Introduce test-specific varialbles to make it easier to move other
bootmgr functions into library directory in the next commit.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
12 months agocmd: bootefi: carve out binary execution interface
AKASHI Takahiro [Tue, 21 Nov 2023 01:29:42 +0000 (10:29 +0900)]
cmd: bootefi: carve out binary execution interface

Carve binary execution code out of do_bootefi_image() in order to move
binary-execution specific code into library directory in the later
commit.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
12 months agocmd: bootefi: carve out EFI boot manager interface
AKASHI Takahiro [Tue, 21 Nov 2023 01:29:41 +0000 (10:29 +0900)]
cmd: bootefi: carve out EFI boot manager interface

Carve EFI boot manager related code out of do_bootefi_image() in order
to move boot manager specific code into library directory in the later
commit.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
12 months agocmd: bootefi: re-organize do_bootefi()
AKASHI Takahiro [Tue, 21 Nov 2023 01:29:40 +0000 (10:29 +0900)]
cmd: bootefi: re-organize do_bootefi()

Replicate some code and re-organize do_bootefi() into three cases, which
will be carved out as independent functions in the next two commits.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
12 months agocmd: bootefi: unfold do_bootefi_image()
AKASHI Takahiro [Tue, 21 Nov 2023 01:29:39 +0000 (10:29 +0900)]
cmd: bootefi: unfold do_bootefi_image()

Unfold do_bootefi_image() into do_bootefi() in order to make it easier
to re-organize do_bootefi() in the next commit.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
12 months agoRevert "board: ti: am62x/am62ax: Update virtual interrupt allocations in board config"
Tom Rini [Sat, 16 Dec 2023 01:23:59 +0000 (20:23 -0500)]
Revert "board: ti: am62x/am62ax: Update virtual interrupt allocations in board config"

After talking with the author off-list I was reminded that this part of
the series was not supposed to be merged, only parts 1-3 upon further
review.

This reverts commit 58a277c207927530469f0ae56eff7d5f702d5486.

Signed-off-by: Tom Rini <trini@konsulko.com>
12 months agoMerge tag 'clk-2024.01-next' of https://source.denx.de/u-boot/custodians/u-boot-clk...
Tom Rini [Fri, 15 Dec 2023 22:49:13 +0000 (17:49 -0500)]
Merge tag 'clk-2024.01-next' of https://source.denx.de/u-boot/custodians/u-boot-clk into next

clock patches for u-boot/next

The main thing in here is Igor's conversion of soc_clk_dump to a clk_ops
member. There's also a write-protect feature for nuvoton clocks.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
12 months agoMerge tag 'clk-2024.01-rc5' of https://source.denx.de/u-boot/custodians/u-boot-clk
Tom Rini [Fri, 15 Dec 2023 22:48:52 +0000 (17:48 -0500)]
Merge tag 'clk-2024.01-rc5' of https://source.denx.de/u-boot/custodians/u-boot-clk

clock changes for u-boot/master

This has some clock fixes which should go in before the release. It's a bit
late in the cycle, but most of these have tests to go along with them.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
12 months agoMerge branch '2023-12-15-assorted-TI-platform-updates' into next
Tom Rini [Fri, 15 Dec 2023 21:20:24 +0000 (16:20 -0500)]
Merge branch '2023-12-15-assorted-TI-platform-updates' into next

- Assorted updates and fixes for some TI K3 platforms and SoCs

12 months agoboard: ti: k3: Remove need for CFG_SYS_SDRAM_BASE
Andrew Davis [Thu, 30 Nov 2023 14:49:11 +0000 (08:49 -0600)]
board: ti: k3: Remove need for CFG_SYS_SDRAM_BASE

The base address of extended DDR does not change across the K3 family.
Setting this per SoC is not needed. Remove this definition to help
remove the last bits from K3 include/configs/*.h files.

Signed-off-by: Andrew Davis <afd@ti.com>
12 months agotest: dm: clk_ccf: fix building error
Yang Xiwen [Fri, 15 Dec 2023 20:21:11 +0000 (04:21 +0800)]
test: dm: clk_ccf: fix building error

Fix unused variable error produced by building tests

Fixes: d3061824 (test: dm: clk_ccf: test ccf_clk_ops)
Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231216-b4-fix_build-v1-1-b8e79c94744f@outlook.com
12 months agoboard: ti: am62x/am62ax: Update virtual interrupt allocations in board config
Vishal Mahaveer [Tue, 28 Nov 2023 19:40:24 +0000 (13:40 -0600)]
board: ti: am62x/am62ax: Update virtual interrupt allocations in board config

Updates as a result of TIFS core now reserving a virtual interrupt
for enabling interrupts between DM to TIFS core. Because of this
change other virtual interrupt counts decrease by one.

Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
12 months agoboard: ti: am62x/am62ax: Update MCU GPIO interrupt allocation in board config
Vishal Mahaveer [Tue, 28 Nov 2023 19:40:23 +0000 (13:40 -0600)]
board: ti: am62x/am62ax: Update MCU GPIO interrupt allocation in board config

Share the MCU GPIO interrupts between A53 core and DM R5 core. Allocating
2 instances each to A53 and DM R5.

Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
12 months agoboard: ti: am62ax: Add C7x resource allocation entries to board config
Vishal Mahaveer [Tue, 28 Nov 2023 19:40:22 +0000 (13:40 -0600)]
board: ti: am62ax: Add C7x resource allocation entries to board config

Update am62ax rm-cfg with allocation entries for C7x core. Following
updates are added for C7x:
- Share split BCDMA tx and rx channels between DM R5 and C7x
- Share rings for split BCDMA tx and rx channels between DM R5 and C7x
- Add Global events and Virtual interrupts for C7x

Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
12 months agoboard: ti: am62x/am62ax: Formatting updates to board config files
Vishal Mahaveer [Tue, 28 Nov 2023 19:40:21 +0000 (13:40 -0600)]
board: ti: am62x/am62ax: Formatting updates to board config files

Minor formatting updates to the rm board configuration file for
am62x and am62ax boards.

Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
12 months agoarm: mach-k3: Merge initial memory maps
Andrew Davis [Tue, 28 Nov 2023 17:05:28 +0000 (11:05 -0600)]
arm: mach-k3: Merge initial memory maps

The Device vs Normal memory map is the same for all K3 SoCs. Merge
the SoC specific maps into one.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: Nishanth Menon <nm@ti.com>
12 months agoarm: mach-k3: Remove non-cached memory map areas
Andrew Davis [Tue, 28 Nov 2023 17:05:27 +0000 (11:05 -0600)]
arm: mach-k3: Remove non-cached memory map areas

All normal memory areas should be mapped as such.

We added these un-cached holes in our memory map to hack around the
remoteproc driver missing the proper cache maintenance operations.

The problem is having these non-cached memory map areas causes stability
issues later in system operation due to the nature of the K3 coherency
architecture. Plus these are board specific carveouts and instead
should have been added at the board level, not here in the SoC common
code area.

Remove these non-cached memory map areas.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: Nishanth Menon <nm@ti.com>
12 months agoarm: mach-k3: Do not map ATF and OPTEE regions in MMU
Andrew Davis [Tue, 28 Nov 2023 17:05:26 +0000 (11:05 -0600)]
arm: mach-k3: Do not map ATF and OPTEE regions in MMU

ATF and OPTEE regions may be firewalled from non-secure entities. To
prevent access to this area we leave a hole there in the MMU map. This
is the same idea as [0] but we complete that patch by adding the same
for AM65, J721e, J7200, and J721s2 here.

[0] commit 0688ff3ae23c ("arm: mach-k3: arm64-mmu: do not map ATF and OPTEE regions in A53 MMU")

Signed-off-by: Andrew Davis <afd@ti.com>
12 months agoarm: mach-k3: Let the compiler size the mem_map lists
Andrew Davis [Tue, 28 Nov 2023 17:05:25 +0000 (11:05 -0600)]
arm: mach-k3: Let the compiler size the mem_map lists

NR_MMU_REGIONS is a copy/paste from another platform that extends
this list later. We do not do that, so let the list be the size
of the initializer list.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: Nishanth Menon <nm@ti.com>
12 months agoarm: mach-k3: Move K3 common schema.yaml out of board directory
Andrew Davis [Wed, 22 Nov 2023 21:30:05 +0000 (15:30 -0600)]
arm: mach-k3: Move K3 common schema.yaml out of board directory

This file is common for all K3, move it out of board/ directory and
into mach-k3. As we need to change the path in k3-binman.dtsi let's
take this opportunity to switch to absolute paths which makes adding
non-TI boards (like Toradex Verdin) not need to override these paths.

Signed-off-by: Andrew Davis <afd@ti.com>
12 months agotest: dm: clk_ccf: test ccf_clk_ops
Yang Xiwen [Fri, 15 Dec 2023 18:28:52 +0000 (02:28 +0800)]
test: dm: clk_ccf: test ccf_clk_ops

Assign ccf_clk_ops to .ops of clk_ccf driver so that it can act as an
clk provider. Also add "#clock-cells=<1>" to its device tree node.

Add "i2c_root" to clk_test in the device tree and driver for testing.

Get "i2c_root" clock in CCF unit tests and add tests for it.

Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231111-enable_count-v3-2-08a821892fa9@outlook.com
12 months agoMerge tag 'u-boot-stm32-20231215' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Fri, 15 Dec 2023 18:33:11 +0000 (13:33 -0500)]
Merge tag 'u-boot-stm32-20231215' of https://source.denx.de/u-boot/custodians/u-boot-stm into next

_ run savedefconfig on all STM32 defconfig

STM32 MCU:
_ Sync stm32f469-disco DT with Linux 6.5
_ rework ltdc node for stm32f769-disco
_ clk: stm32f: Fix settings for LCD_CLK
_ Support display on stm32f469-disco board

STM32 MPU:
_ stm32mp_dfu : Fix board_get_alt_info_mtd()
_ stm32mp_dfu : Simplify MTD device parsing

12 months agoclk: nuvoton: add read only feature for clk driver
Jim Liu [Tue, 14 Nov 2023 09:00:04 +0000 (17:00 +0800)]
clk: nuvoton: add read only feature for clk driver

Add a flag to set ahb/apb/fiu/spi clock divider as read-only
The spi clock setting is related to booting flash, it is setup by early
bootloader.
It just protects the clock source and can't modify it in uboot.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231114090004.3746024-1-JJLIU0@nuvoton.com
12 months agocmd: clk: Make soc_clk_dump static
Igor Prusov [Thu, 9 Nov 2023 10:55:16 +0000 (13:55 +0300)]
cmd: clk: Make soc_clk_dump static

After introducing dump to clk_ops there is no need to override or expose
this symbol anymore.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-9-ivprusov@sberdevices.ru
12 months agoclk: treewide: switch to clock dump from clk_ops
Igor Prusov [Thu, 9 Nov 2023 10:55:15 +0000 (13:55 +0300)]
clk: treewide: switch to clock dump from clk_ops

Switch to using new dump operation in clock provider drivers instead of
overriding soc_clk_dump.

Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-8-ivprusov@sberdevices.ru
12 months agocmd: clk: Use dump function from clk_ops
Igor Prusov [Thu, 9 Nov 2023 10:55:14 +0000 (13:55 +0300)]
cmd: clk: Use dump function from clk_ops

Add another loop to dump additional info from clock providers that
implement dump operation.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-7-ivprusov@sberdevices.ru
12 months agoclk: Add dump operation to clk_ops
Igor Prusov [Thu, 9 Nov 2023 10:55:13 +0000 (13:55 +0300)]
clk: Add dump operation to clk_ops

This adds dump function to struct clk_ops which should replace
soc_clk_dump. It allows clock drivers to provide custom dump
implementation without overriding generic CCF dump function.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
[ Fixed parameter name in documentation ]
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231109105516.24892-6-ivprusov@sberdevices.ru
12 months agoclk: amlogic: Move driver and ops structs
Igor Prusov [Thu, 9 Nov 2023 10:55:12 +0000 (13:55 +0300)]
clk: amlogic: Move driver and ops structs

Move driver and ops structs to avoid forward declaration after switching
to dump in clk_ops.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-5-ivprusov@sberdevices.ru
12 months agoclk: k210: Move soc_clk_dump function
Igor Prusov [Thu, 9 Nov 2023 10:55:11 +0000 (13:55 +0300)]
clk: k210: Move soc_clk_dump function

Move clock dump function to avoid forward declaration after switching to
dump in clk_ops.

Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-4-ivprusov@sberdevices.ru
12 months agoclk: ast2600: Move soc_clk_dump function
Igor Prusov [Thu, 9 Nov 2023 10:55:10 +0000 (13:55 +0300)]
clk: ast2600: Move soc_clk_dump function

Move clock dump function to avoid forward declaration after switching to
dump in clk_ops.

Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-3-ivprusov@sberdevices.ru
12 months agoclk: zynq: Move soc_clk_dump to Zynq clock driver
Igor Prusov [Thu, 9 Nov 2023 10:55:09 +0000 (13:55 +0300)]
clk: zynq: Move soc_clk_dump to Zynq clock driver

Move clock dump function in preparation for switching to dump function
in clk_ops.

Acked-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-2-ivprusov@sberdevices.ru
12 months agodm: test: clk: Add test for ccf clk_set_rate()
Igor Prusov [Tue, 5 Dec 2023 23:23:34 +0000 (02:23 +0300)]
dm: test: clk: Add test for ccf clk_set_rate()

Add a simple test case which sets clock rate to its current value.

Signed-off-by: Igor Prusov <ivprusov@salutedevices.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231205232334.2931-3-ivprusov@salutedevices.com
12 months agoclk: Check that composite clock's div has set_rate()
Igor Prusov [Tue, 5 Dec 2023 23:23:33 +0000 (02:23 +0300)]
clk: Check that composite clock's div has set_rate()

It's possible for composite clocks to have a divider that does not
implement set_rate() operation. For example, sandbox_clk_composite()
registers composite clock with a divider that only has get_rate().
Currently clk_composite_set_rate() only checks thate rate_ops are
present, so for sandbox it will cause NULL dereference during
clk_set_rate().

This patch adds rate_ops->set_rate check tp clk_composite_set_rate().

Signed-off-by: Igor Prusov <ivprusov@salutedevices.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231205232334.2931-2-ivprusov@salutedevices.com
12 months agoclk: get correct ops for clk_enable() and clk_disable()
Yang Xiwen [Sat, 18 Nov 2023 22:10:06 +0000 (06:10 +0800)]
clk: get correct ops for clk_enable() and clk_disable()

assign clk_dev_ops(clkp->dev) to ops to ensure correct clk operations
are called on clocks.

This fixes the incorrect enable_count issue as described in [1].

[1]: https://lore.kernel.org/all/SEZPR06MB695927A6DEEEF8489A06897396A7A@SEZPR06MB6959.apcprd06.prod.outlook.com/

Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231111-enable_count-v2-2-20e3728600b5@outlook.com
12 months agoclk: check parent_name in clk_register to avoid confusing log_error() output
Yang Xiwen [Fri, 10 Nov 2023 19:19:52 +0000 (03:19 +0800)]
clk: check parent_name in clk_register to avoid confusing log_error() output

For some gate clocks and fixed clocks without a parent, calling
clk_register will print an useless error message indicating that parent
is missing. Fix that by gaurding log_xxx() with an if-statement.

Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
Suggested-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20230807-clk-fix-v2-1-0b688e21fb4e@outlook.com
12 months agoMerge patch series "bootm: Handle compressed arm64 images with bootm"
Tom Rini [Fri, 15 Dec 2023 14:41:44 +0000 (09:41 -0500)]
Merge patch series "bootm: Handle compressed arm64 images with bootm"

To quote the author:

This little series corrects a problem I noticed with arm64 images,
where the kernel is not recognised if compression is used:

   U-Boot> tftp image.fit
   Using ethernet@7d580000 device
   TFTP from server 192.168.4.7; our IP address is 192.168.4.147
   Filename 'image.fit'.
   Load address: 0x1000000
   Loading: ##################################################  23 MiB
     20.5 MiB/s
   done
   Bytes transferred = 24118272 (1700400 hex)
   U-Boot> bootm
   ## Loading kernel from FIT Image at 01000000 ...
      Using 'conf-768' configuration
      Trying 'kernel' kernel subimage
        Description:  Linux
        Type:         Kernel Image (no loading done)
        Compression:  gzip compressed
        Data Start:   0x01000120
        Data Size:    13662338 Bytes = 13 MiB
      Verifying Hash Integrity ... OK
   Bad Linux ARM64 Image magic!

With this series:

   U-Boot> tftp 20000000 image.fit
   Using ethernet@7d580000 device
   TFTP from server 192.168.4.7; our IP address is 192.168.4.147
   Filename 'image.fit'.
   Load address: 0x20000000
   Loading: ##################################################  23.5 MiB
     20.8 MiB/s
   done
   Bytes transferred = 24642560 (1780400 hex)
   U-Boot> bootm 0x20000000
   ## Loading kernel from FIT Image at 20000000 ...
      Using 'conf-768' configuration
      Trying 'kernel' kernel subimage
        Description:  Linux
        Type:         Kernel Image (no loading done)
        Compression:  zstd compressed
        Data Start:   0x20000120
        Data Size:    14333475 Bytes = 13.7 MiB
      Verifying Hash Integrity ... OK
   Using kernel load address 80000
   ## Loading fdt from FIT Image at 20000000 ...
      Using 'conf-768' configuration
      Trying 'fdt-768' fdt subimage
        Description:  Raspberry Pi 4 Model B
        Type:         Flat Device Tree
        Compression:  zstd compressed
        Data Start:   0x215f820c
        Data Size:    9137 Bytes = 8.9 KiB
        Architecture: AArch64
      Verifying Hash Integrity ... OK
      Uncompressing Flat Device Tree to 3aff3010
      Booting using the fdt blob at 0x3aff3010
   Working FDT set to 3aff3010
      Uncompressing Kernel Image (no loading done) to 80000
   Moving Image from 0x80000 to 0x200000, end=2b00000
      Using Device Tree in place at 000000003aff3010, end 000000003afff4c4
   Working FDT set to 3aff3010

   Starting kernel ...

   [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]

The problem is that the arm64 magic is checked before the image is
decompressed. However this is only part of it. The kernel_noload image
type doesn't work with compression, since the kernel is not loaded. So
this series deals with that by using an lmb-allocated buffer for the
uncompressed kernel.

Another issue is that the arm64 handling is done too early, before the
image is loaded. This series moves it to after loading, so that
compression can be handled.

A patch is included to show the kernel load-address, so it is easy to
see what is going on.

One annoying feature of arm64 is that the image is often copied to
another address. It might be possible for U-Boot to figure that out
earlier and decompress it to the right place, but perhaps not.

With all of this it should be possible to boot a compressed kernel on
any of the 990 arm64 boards supported by Linux, although I have only
tested two.

12 months agobootm: Support kernel_noload with compression
Simon Glass [Sun, 19 Nov 2023 14:43:34 +0000 (07:43 -0700)]
bootm: Support kernel_noload with compression

It is not currently possible to execute the kernel in-place without
loading it. Use lmb to allocate memory for it.

Co-developed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
12 months agobootm: Move arm64-image processing later
Simon Glass [Sun, 19 Nov 2023 14:43:33 +0000 (07:43 -0700)]
bootm: Move arm64-image processing later

If the image is compressed, then the existing check fails, since the
header is wrong.

Move the check later in the boot process, after the kernel is
decompressed. This allows use of bootm with compressed kernels, while
still permitting an uncompressed kernel to be used.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agoimage: Show the load address when decompressing
Simon Glass [Sun, 19 Nov 2023 14:43:32 +0000 (07:43 -0700)]
image: Show the load address when decompressing

The destination address for decompression (or copying) is useful
information. Show this to the user while booting, e.g.:

   Uncompressing Kernel Image (no loading done) to 2080000

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agoimage: Correct load_bug typo
Simon Glass [Sun, 19 Nov 2023 14:43:31 +0000 (07:43 -0700)]
image: Correct load_bug typo

Correct a typo in the function comment for image_decomp().

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agoconfigs: stm32: Apply savedefconfig
Patrice Chotard [Fri, 15 Dec 2023 14:32:20 +0000 (15:32 +0100)]
configs: stm32: Apply savedefconfig

Apply savedefconfig on all stm32 defconfig.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
12 months agoboard: st: common: simplify MTD device parsing
Patrice Chotard [Fri, 17 Nov 2023 17:01:07 +0000 (18:01 +0100)]
board: st: common: simplify MTD device parsing

Simplify the way all MTD devices are parsed.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>