Tom Rini [Fri, 25 Oct 2024 20:22:36 +0000 (14:22 -0600)]
Merge patch series "Allow showing the memory map"
Simon Glass <sjg@chromium.org> says:
This little series adds a new 'memmap' command, intended to show the
layout of memory within U-Boot and how much memory is available for
loading images.
Link: https://lore.kernel.org/r/20241021081934.289473-1-sjg@chromium.org
Simon Glass [Mon, 21 Oct 2024 08:19:32 +0000 (10:19 +0200)]
meminfo: Show the lmb records
Add the lmb records onto the end of the memory map.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 21 Oct 2024 08:19:31 +0000 (10:19 +0200)]
lmb: Export the lmb data structure
Provide a way to access this data structure so that the meminfo command
can use it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Simon Glass [Mon, 21 Oct 2024 08:19:30 +0000 (10:19 +0200)]
cmd: Update the meminfo command to show the memory map
U-Boot has a fairly rigid memory map which is normally not visible
unless debugging is enabled in board_f.c
Update the 'meminfo' command to show it. This command does not cover
arch-specific pieces but gives a good overview of where things are.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 21 Oct 2024 08:19:29 +0000 (10:19 +0200)]
cmd: Move meminfo command into its own file
In preparation for expanding this command, move it into a separate file.
Rename the function to remove the extra underscore. Update the number of
arguments to 1, since 3 is incorrect.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Simon Glass [Mon, 21 Oct 2024 08:19:28 +0000 (10:19 +0200)]
bootstage: Allow counting memory without strings
The bootstage array includes pointers to strings but not the strings
themselves. The strings are added when stashing, but including them in
the size calculation gives an inflated view of the amount of space used
by the array.
Update this function so it can return the amount of memory used by the
bootstage structures themselves, without the strings which they point
to.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 21 Oct 2024 08:19:27 +0000 (10:19 +0200)]
global_data: Add some more accessors
Add accessors for bloblist, bootstage, trace and video to avoid needing
more #ifdefs in the C code.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 21 Oct 2024 08:19:26 +0000 (10:19 +0200)]
common: Tidy up how malloc() is inited
The call to malloc() is a bit strange. The naming of the arguments
suggests that an address is passed, but in fact it is a pointer, at
least in the board_init_r() function and SPL equivalent.
Update it to work as described. Add a function comment as well.
Note that this does adjustment does not extend into the malloc()
implementation itself, apart from changing mem_malloc_init(), since
there are lots of casts and pointers and integers are used
interchangeably.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Simon Glass [Mon, 21 Oct 2024 08:19:25 +0000 (10:19 +0200)]
common: Fix up malloc() comment in reserve_noncached()
The function name has changed, so update it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tom Rini [Fri, 25 Oct 2024 17:55:23 +0000 (11:55 -0600)]
Merge tag 'xilinx-for-v2025.01-rc1-v2' of https://source.denx.de/u-boot/custodians/u-boot-microblaze
AMD/Xilinx changes for v2025.01-rc1 v2
.mailmap:
- Switch Padmarao's email to AMD one
zynq_spi:
- Make update_stripe static
xilinx:
- Update DT description for EMMCs
zynqmp:
- Update logic around RPUs and tcm handling
- Update bootmenu selection for Kria
- Add description for SC vm-p-b1369
- Fix comment about file location in zynqmp-p-a2197-00-revA.dts
versal:
- Fix logic around USB boot
versal2:
- Disable useless features for Mini configurations
versal-net:
- Get rid of current-speed DT property from mini configuration
microblaze:
- Fix scriptaddr location
# -----BEGIN PGP SIGNATURE-----
#
# iF0EABECAB0WIQQbPNTMvXmYlBPRwx7KSWXLKUoMIQUCZxuweAAKCRDKSWXLKUoM
# IY1iAKCH/GKJHEXFfLvr0OGuO6c1SX9+ZQCfTjRAHrL186X6LUgjOpmtmsrVK1c=
# =4gY0
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 25 Oct 2024 08:51:36 AM CST
# gpg: using DSA key
1B3CD4CCBD79989413D1C31ECA4965CB294A0C21
# gpg: Good signature from "Michal Simek <monstr@monstr.eu>" [full]
# gpg: aka "Michal Simek (Xilinx) <michals@xilinx.com>" [full]
# gpg: aka "Michal Simek (Xilinx) <michal.simek@xilinx.com>" [full]
# gpg: aka "Michal Simek (AMD) <michal.simek@amd.com>" [unknown]
Tom Rini [Fri, 25 Oct 2024 14:35:56 +0000 (08:35 -0600)]
Merge tag 'u-boot-dfu-
20241025' of https://source.denx.de/u-boot/custodians/u-boot-dfu
CI: https://source.denx.de/u-boot/custodians/u-boot-dfu/-/pipelines/22962
Dfu:
- Rely on device tree for spi speed/mode on spi flash
Android Image:
- Fix booting on platforms having > 4GiB of memory
- Decompress boot image to kernel_addr_r when compression is enabled
- Honor CONFIG_SYS_LOAD_ADDR when mkbootimg uses default address
Bcb:
- Rework bcb command to use U_BOOT_LONGHELP
- Move ab_select cmd to bcb cmd
- Implement ab_dump command in bcb
- bcb: Write '_<slot>' instead of '<slot>' to misc partition
Padmarao Begari [Wed, 23 Oct 2024 08:51:27 +0000 (14:21 +0530)]
.mailmap: update e-mail address for Padmarao Begari
Update e-mail address.
Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20241023085127.3450680-1-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Venkatesh Yadav Abbarapu [Wed, 16 Oct 2024 04:44:02 +0000 (10:14 +0530)]
spi: zynq_qspi: Add missing prototype for update_stripe
Add missing prototype to fix the sparse warning,
warning: no previous prototype for 'update_stripe'
[-Wmissing-prototypes].
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20241016044402.18052-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Michal Simek [Mon, 7 Oct 2024 07:30:08 +0000 (09:30 +0200)]
amd: Disable LMB, BOOTM, MTD and EFI loader for mini configurations
Mini configurations don't need these features that's why disable them.
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/6a263cf5f6b7c7f8e0bfc11649887f2760385d0e.1728286203.git.michal.simek@amd.com
Padmarao Begari [Fri, 11 Oct 2024 11:34:35 +0000 (17:04 +0530)]
arm64: zynqmp: fix tcm initialization for mini u-boot
Fix the issue introduced by commit
fed064477c2c
("arm64: zynqmp: Print an error for split to lock mode switch").
The mini u-boot is hanging, because of the tcm is not initialized.
The mini u-boot is using the tcm to reserve the mmu table and
currently it is not initialized, so allowing u-boot to initialize
the tcm.
Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20241011113435.1966604-1-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Michal Simek [Wed, 25 Sep 2024 07:02:07 +0000 (09:02 +0200)]
arm64: xilinx: Fix file location described in zynqmp-p-a2197-00-revA.dts
Fix pointers to incorrect file name described in DT.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202409250603.7achimjs-lkp@intel.com/
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/6e6017ad613d452d16ce0f7fba8a6ce32b174413.1727247725.git.michal.simek@amd.com
Michal Simek [Wed, 25 Sep 2024 07:03:59 +0000 (09:03 +0200)]
arm64: versal-net: Remove current-speed from mini
U-Boot code is not reading this variable that's why remove it from DT.
PL011 code is automatically using CONFIG_BAUDRATE instead.
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/3de28cc8bbf9571d24673a60809c2075fe2f44c3.1727247837.git.michal.simek@amd.com
Michal Simek [Wed, 25 Sep 2024 07:03:38 +0000 (09:03 +0200)]
arm64: zynqmp: Add description for SC on vm-p-m1369 board
Board is very similar to vn-p-b2197 with subset of functinality.
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/fbc6d56c4aaa33113e35a53520320f4050ed141e.1727247815.git.michal.simek@amd.com
Paul Alvin [Wed, 25 Sep 2024 07:03:13 +0000 (09:03 +0200)]
xilinx: Add cap-mmc-hw-reset and no-sd, no-sdio property to eMMC
Add "cap-mmc-hw-reset" property to the eMMC DT node to perform the
eMMC device hardware reset.
Also, add "no-sd", "no-sdio" properties to eMMC DT node to skip
unwanted sd, sdio related commands during initialization for eMMC
device as this may lead to unnecessary register dump.
Signed-off-by: Paul Alvin <alvin.paulp@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/b31554816a3378365143e9f5c266f6386af0a438.1727247785.git.michal.simek@amd.com
John Vicky Vykuntapu [Wed, 2 Oct 2024 11:15:17 +0000 (13:15 +0200)]
xilinx: zynqmp: Remove conditional check for bootmenu_default variable
As per bootmenu support added default boot options to CC on AMD CCs and
default to SOM on others.
However, if no secondary boot device is enabled in the design,it should
be the default boot option for SOM when combined with AMD CCs because it
only contains SOM peripherals.
To address this issue, The conditional check for the bootmenu_default
variable was removed, and it has always been set to SOM as the default
boot option.
In this way, users can choose preferred boot options from the bootmenu
based on the boot devices configured in the design for AMD CCs.
Fixes: 61bf0fa8663d ("xilinx: zynqmp: Add bootmenu support")
Signed-off-by: John Vicky Vykuntapu <johnvicky.vykuntapu@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/0e30b44ce3b478fdec21edad8d896f4d438ce331.1727867715.git.michal.simek@amd.com
Padmarao Begari [Tue, 1 Oct 2024 08:25:37 +0000 (13:55 +0530)]
xilinx: common: fix script address for Microblaze
Fix the issue introduced by commit
067e0294806e
("board: xilinx: Remove conditional check for Microblaze").
The scriptaddr should be physical location not really offset
from start of DDR. When U-Boot is not found boot.scr script
address in device tree, then it is assigned based on script
address and ram base address for Microblaze and i.e exceeding
DDR memory. To fix this, the script address is assigned
initially with offset instead of address. Later it is added
with ram base address and gets the physical address.
Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20241001082537.830286-1-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Michal Simek [Mon, 30 Sep 2024 11:03:53 +0000 (13:03 +0200)]
arm64: versal: Wire USB0 in distro boot
For unknown reason USB host hasn't been described for distro boot that's
why wire it now.
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/9715605c232ce38a36a200204c14208b9d76cd83.1727694230.git.michal.simek@amd.com
Michal Simek [Mon, 30 Sep 2024 11:03:52 +0000 (13:03 +0200)]
arm64: versal: Remove description for USB1
There is only one USB controller that's why remove description for USB1.
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/f148161ee489d19d708df1b4fa7477821e06bb55.1727694230.git.michal.simek@amd.com
Padmarao Begari [Mon, 30 Sep 2024 04:38:14 +0000 (10:08 +0530)]
arm64: zynqmp: Fix tcminit mode value based on argv
The RPU pytest introduced by commit
e894c10c040b
("test/py: zynqmp_rpu: Add test for loading RPU apps") expects
3rd parameter as string not a number that's why extend command
to actually handle both. The issue with existing code is that
when any non number string is passed hextoul returns 0. For
backward compatibility zynqmp tcminit 0/1 can be still used but
it is recommended to use strings instead.
Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20240930043814.530181-3-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Padmarao Begari [Mon, 30 Sep 2024 04:38:13 +0000 (10:08 +0530)]
arm64: zynqmp: Print an error for split to lock mode switch
The zynqmp tcminit crashes the U-Boot when switching from
r5-mode "split" to "lockstep" instead it should throw an error.
When cpu is enabled, the check_tcm_mode() function checks
if the previous mode is "split", switch mode is "lockstep" then
it returns the error code and the initialize_tcm() function is not
updating the global control register of the RPU instead it prints
the error message. When cpu is disabled, the check_tcm_mode()
function returns the success code for switch split to lockstep mode.
Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20240930043814.530181-2-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Andy Shevchenko [Mon, 21 Oct 2024 14:20:45 +0000 (17:20 +0300)]
Mark a few functions static inline
The function prototypes that are defined in the header most likely has
to be marked as static inline. This helps avoiding the compiler warnings:
include/mux.h:120:14: warning: no previous prototype for ‘mux_control_states’ [-Wmissing-prototypes]
include/mux.h:125:18: warning: no previous prototype for ‘mux_control_select’ [-Wmissing-prototypes]
include/mux.h:133:5: warning: no previous prototype for ‘mux_control_deselect’ [-Wmissing-prototypes]
include/mux.h:138:21: warning: no previous prototype for ‘mux_control_get’ [-Wmissing-prototypes]
include/mux.h:143:6: warning: no previous prototype for ‘mux_control_put’ [-Wmissing-prototypes]
include/mux.h:147:21: warning: no previous prototype for ‘devm_mux_control_get’ [-Wmissing-prototypes]
include/mux.h:153:5: warning: no previous prototype for ‘dm_mux_init’ [-Wmissing-prototype ]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Andy Shevchenko [Mon, 21 Oct 2024 13:56:33 +0000 (16:56 +0300)]
cmd: nvedit: Mark a few functions static
Some functions are not used anywhere except the same file
where they are defined. Mark them static. This helps avoiding
the compiler warnings:
cmd/nvedit.c:201:5: warning: no previous prototype for ‘do_env_ask’ [-Wmissing-prototypes]
cmd/nvedit.c:315:5: warning: no previous prototype for ‘do_env_callback’ [-Wmissing-prototypes]
cmd/nvedit.c:384:5: warning: no previous prototype for ‘do_env_flags’ [-Wmissing-prototype ]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Heinrich Schuchardt [Fri, 18 Oct 2024 01:30:15 +0000 (03:30 +0200)]
block: make blk_create_device() static
There are no users of the blk_create_device() function outside the uclass.
Let's make it static. This will ensure that new block drivers will use
blk_create_devicef().
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Heinrich Schuchardt [Fri, 18 Oct 2024 01:30:13 +0000 (03:30 +0200)]
rockchip: block: simplify rkmtd driver
By using blk_create_devicef() instead of blk_create_devicef() the driver
can be simplified and brought into line with other block device drivers.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tested-by: Johan Jonker <jbx6244@gmail.com>
Vaishnav Achath [Wed, 16 Oct 2024 07:40:48 +0000 (13:10 +0530)]
arm: dts: k3-j722s-r5-evm: Add LPDDR4 4000 MT/s configs
Add the latest 4000 MT/s DDR config generated by
Jacinto7_DDRSS_RegConfigTool Rev 0.11 for J722S , make it the
default config and update A53 default clock to 1.4 GHz matching
the default speed grade (K).
Signed-off-by: Vaishnav Achath <vaishnav.a@ti.com>
Marek Vasut [Sun, 20 Oct 2024 15:43:12 +0000 (17:43 +0200)]
boot: Introduce BOOTSTD_MENU to control bootflow menu build
The bootflow_menu.c code depends on e.g. scene_txt_set_font(),
which is only built when CONFIG_EXPO is enabled. Introduce new
Kconfig symbol BOOTSTD_MENU which depends on EXPO to prevent
triggering errors like these in case e.g. CONFIG_VIDEO=n :
"
boot/bootflow_menu.c:158:(.text+0x8851): undefined reference to `scene_txt_set_font'
"
Make the symbol depend on BOOTSTD_FULL as well to get rid of
the Makefile dependency workaround. Since BOOTSTD_FULL is not
available in SPL, do not define SPL variant of BOOTSTD_MENU.
Fix up bootflow test accordingly.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Philip Balister [Fri, 18 Oct 2024 21:19:57 +0000 (17:19 -0400)]
mcp230xx_gpio.c: Add a missing include file.
* Fixes a warning about implicit declaration of udelay.
Signed-off-by: Philip Balister <philip@balister.org>
Tom Rini [Thu, 24 Oct 2024 15:13:45 +0000 (09:13 -0600)]
Merge https://source.denx.de/u-boot/custodians/u-boot-spi
CI: https://source.denx.de/u-boot/custodians/u-boot-spi/-/pipelines/22949
Han Xu [Sat, 5 Oct 2024 23:46:20 +0000 (07:46 +0800)]
mtd: spi-nor: Add mt35xu01gbba octal mode SPI NOR flash
Add SPI NOR flash id for mt35xu01gbba which supports 4 bytes address with
octal mode read.
Signed-off-by: Han Xu <han.xu@nxp.com>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Dmitry Dunaev [Mon, 26 Feb 2024 10:25:20 +0000 (13:25 +0300)]
mtd: spi-nor-ids: Add Puya Semiconductor chips description
Added support for the Puya Semiconductor chips.
The datasheet can be found here:
https://www.puyasemi.com/h_xilie715.html
Signed-off-by: Dmitry Dunaev <dunaev@tecon.ru>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Neil Armstrong [Thu, 17 Oct 2024 14:44:44 +0000 (16:44 +0200)]
image: android: handle ramdisk default address
The two tools that create android boot images, mkbootimg and the fastboot
client, set the kernel address by default to 0x11008000.
U-boot always honors this field, and will try to copy the ramdisk to
whatever value is set in the header, which won't be mapped to the actual
RAM on most platforms, resulting in the kernel obviously not booting.
All the targets in U-Boot right now will download the android boot image
to CONFIG_SYS_LOAD_ADDR, which means that it will already have been
downloaded to some location that is suitable to use the ramdisk in-place
for header version 0 to 2. For header version 3 and later, the ramdisk
can't be used in-place to use ramdisk_addr_r in this case.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Guillaume La Roque <glaroque@baylibre.com>
Link: https://lore.kernel.org/r/20241017-topic-fastboot-fixes-mkbootimg-v2-3-c3927102d931@linaro.org
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Neil Armstrong [Thu, 17 Oct 2024 14:44:43 +0000 (16:44 +0200)]
image: android: do not boot XIP when kernel is compressed
When trying to boot an android boot image with a compressed
kernel, if the kernel is used in-place because it was created
with mkbootimg, the space will be too small to properly
uncompress.
Take in account the compressed state, and if compressed
use the kernel_addr_r which should be big enough.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Guillaume La Roque <glaroque@baylibre.com>
Link: https://lore.kernel.org/r/20241017-topic-fastboot-fixes-mkbootimg-v2-2-c3927102d931@linaro.org
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Neil Armstrong [Thu, 17 Oct 2024 14:44:42 +0000 (16:44 +0200)]
image: android: use ulong for kernel address
When booting with platforms having > 4GiB of memory,
the kernel physical address can be more than 32bits.
Use ulong like all the other addresses, and fix the
print to show the > 32bits address numbers.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Guillaume La Roque <glaroque@baylibre.com>
Link: https://lore.kernel.org/r/20241017-topic-fastboot-fixes-mkbootimg-v2-1-c3927102d931@linaro.org
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Dmitry Rokosov [Thu, 17 Oct 2024 14:12:11 +0000 (17:12 +0300)]
common: android_ab: fix slot suffix for abc block
To align with the official Android BCB (Bootloader Control Block)
specifications, it's important to note that the slot_suffix should start
with an underscore symbol.
For a comprehensive understanding of the expected slot_suffix format in
userspace, please refer to the provided reference [1].
Links:
[1] - https://source.android.com/docs/core/architecture/bootloader/updating#slots
Based-on: https://android-review.googlesource.com/c/platform/external/u-boot/+/
1446439
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Guillaume La Roque <glaroque@baylibre.com>
Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # vim3_android
Link: https://lore.kernel.org/r/20241017-android_ab_master-v5-6-43bfcc096d95@salutedevices.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Dmitry Rokosov [Thu, 17 Oct 2024 14:12:10 +0000 (17:12 +0300)]
cmd: bcb: introduce 'ab_dump' command to print BCB block content
It's really helpful to have the ability to dump BCB block for debugging
A/B logic on the board supported this partition schema.
Command 'bcb ab_dump' prints all fields of bootloader_control struct
including slot_metadata for all presented slots.
Output example:
=====
> board# bcb ab_dump ubi 0#misc
> Read 512 bytes from volume misc to
000000000bf07580
> Read 512 bytes from volume misc to
000000000bf42f40
> Bootloader Control: [misc]
> Active Slot: _a
> Magic Number: 0x42414342
> Version: 1
> Number of Slots: 2
> Recovery Tries Remaining: 0
> CRC: 0x2c8b50bc (Valid)
>
> Slot[0] Metadata:
> - Priority: 15
> - Tries Remaining: 0
> - Successful Boot: 1
> - Verity Corrupted: 0
>
> Slot[1] Metadata:
> - Priority: 14
> - Tries Remaining: 7
> - Successful Boot: 0
> - Verity Corrupted: 0
====
The ab_dump command allows you to display ABC data directly on the
U-Boot console. During an A/B test execution, this test verifies the
accuracy of each field within the ABC data.
Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # vim3_android
Link: https://lore.kernel.org/r/20241017-android_ab_master-v5-5-43bfcc096d95@salutedevices.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Dmitry Rokosov [Thu, 17 Oct 2024 14:12:09 +0000 (17:12 +0300)]
cmd: bcb: change strcmp() usage style in the do_bcb_ab_select()
In the entire cmd/bcb.c file, the return value of strcmp() is not
directly compared to 0. Therefore, it would be better to maintain this
style in the new do_bcb_ab_select() function as well.
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Guillaume La Roque <glaroque@baylibre.com>
Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # vim3_android
Link: https://lore.kernel.org/r/20241017-android_ab_master-v5-4-43bfcc096d95@salutedevices.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Dmitry Rokosov [Thu, 17 Oct 2024 14:12:08 +0000 (17:12 +0300)]
treewide: bcb: move ab_select command to bcb subcommands
To enhance code organization, it is beneficial to consolidate all A/B
BCB management routines into a single super-command.
The 'bcb' command is an excellent candidate for this purpose.
This patch integrates the separate 'ab_select' command into the 'bcb'
group as the 'ab_select' subcommand, maintaining the same parameter list
for consistency.
Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # vim3_android
Link: https://lore.kernel.org/r/20241017-android_ab_master-v5-3-43bfcc096d95@salutedevices.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Dmitry Rokosov [Thu, 17 Oct 2024 14:12:07 +0000 (17:12 +0300)]
cmd: bcb: rework the command to U_BOOT_LONGHELP approach
U_BOOT_LONGHELP and U_BOOT_CMD_WITH_SUBCMDS offer numerous advantages,
including:
- common argument restrictions checking
- automatic subcommand matching
- improved usage and help handling
By utilizing the U_BOOT_LONGHELP approach, we can reduce the amount of
command management code and describe commands more succinctly.
Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # vim3_android
Link: https://lore.kernel.org/r/20241017-android_ab_master-v5-2-43bfcc096d95@salutedevices.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Dmitry Rokosov [Thu, 17 Oct 2024 14:12:06 +0000 (17:12 +0300)]
include/android_ab: move ab_select_slot() documentation to @ notation
There are new function documentation requirements in U-Boot, so apply
these changes for android_ab.
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Guillaume La Roque <glaroque@baylibre.com>
Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # vim3_android
Link: https://lore.kernel.org/r/20241017-android_ab_master-v5-1-43bfcc096d95@salutedevices.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Neil Armstrong [Tue, 1 Oct 2024 16:06:12 +0000 (18:06 +0200)]
dfu: sf: rely on DT for spi speed and mode
Align with cmd_sf, and try to rely on DT for spi speed and mode,
and still fallback on spi_flash_probe() if it fails.
With the current scheme, spi_flash_probe() will be called
with CONFIG_SF_DEFAULT_SPEED and CONFIG_SF_DEFAULT_MODE
with are set to 0 by default on DT platforms using DM_SPI_FLASH.
Like cmd_sf, keep the option to specify the speed and mode
from the dfu_alt_mode string, but rely on DT properties
if not specified.
Using CONFIG_SF_DEFAULT_SPEED and CONFIG_SF_DEFAULT_MODE
makes the SPIFC controller on Amlogic Meson G12B & SM1
hardware fail and is unable to recover until a system reboot.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20241001-uboot-topic-dfu-sf-dt-v2-2-67f7acfa3ff5@linaro.org
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Neil Armstrong [Tue, 1 Oct 2024 16:06:11 +0000 (18:06 +0200)]
spi: add DM_SPI_FLASH compatibility inline functions
To smoothly handle the transition from the legacy SPI FLASH
API to the driver model API, add the DM functions
as dummy inline functions.
Today, client code uses #if/#else conditionals, but it's better
to use if(IS_ENABLED()) to make sure all code builds fine
and avoid configuration hell, leaving the compiler remove
the dead code.
An example is cmd/sf, which could make use of those dummy
functions to drop the conditional compilation.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20241001-uboot-topic-dfu-sf-dt-v2-1-67f7acfa3ff5@linaro.org
[mkorpershoek: removed duplicate "the" from commit msg]
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tom Rini [Wed, 23 Oct 2024 14:33:56 +0000 (08:33 -0600)]
Merge https://source.denx.de/u-boot/custodians/u-boot-watchdog
CI: https://dev.azure.com/sr0718/u-boot/_build/results?buildId=378&view=results
* watchdog: gpio_wdt: add support for stoppable devices (Rasmus)
* watchdog: Add DaVinci's watchdog support (Bastien)
* cyclic: disentangling cyclic API from schedule() (Rasmus)
* watchdog: introduce separate SPL symbol for WDT_GPIO (Rasmus)
Rasmus Villemoes [Mon, 7 Oct 2024 17:47:16 +0000 (19:47 +0200)]
watchdog: introduce separate SPL symbol for WDT_GPIO
Currently, enabling WDT_GPIO on a board which uses SPL, but does not
have SPL_WDT, SPL_DM_GPIO or SPL_OF_CONTROL enabled, breaks the build.
Make it possible to use the WDT_GPIO driver on such boards by
introducing a separate symbol controlling whether the driver is built
for SPL. Make it default to WDT_GPIO such that boards that already
have it enabled and all the SPL prerequisites satisfied will continue
to have it in SPL.
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Rasmus Villemoes [Thu, 3 Oct 2024 21:28:02 +0000 (23:28 +0200)]
global_data.h: remove unnecesary include of cyclic.h
Nothing in cyclic.h is needed to define struct global_data, so do not
include that header.
If any .c file relies on getting cyclic.h through asm/global_data.h,
it needs to include it itself.
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Rasmus Villemoes [Thu, 3 Oct 2024 21:28:01 +0000 (23:28 +0200)]
boot: cedit: include u-boot/schedule.h
This TU currently relies on getting a declaration of schedule()
through some nested include. Include the proper header directly.
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Rasmus Villemoes [Thu, 3 Oct 2024 21:28:00 +0000 (23:28 +0200)]
ddr: altera: include u-boot/schedule.h
These TUs currently rely on getting a declaration of schedule()
through some nested include. Include the proper header directly.
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Rasmus Villemoes [Thu, 3 Oct 2024 21:27:59 +0000 (23:27 +0200)]
i2c: rzg2l: include u-boot/schedule.h
This TU currently relies on getting a declaration of schedule()
through some nested include. Include the proper header directly.
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Rasmus Villemoes [Thu, 3 Oct 2024 21:27:58 +0000 (23:27 +0200)]
lib/sha*: include u-boot/schedule.h instead of cyclic.h
These library routines obviously do not make use of the
cyclic_register() etc. API, but do need to call schedule(). Include
the proper header.
Eventually, their ifdef logic should be updated to avoid talking about
CONFIG_WATCHDOG.
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Rasmus Villemoes [Thu, 3 Oct 2024 21:27:57 +0000 (23:27 +0200)]
watchdog.h: change include of cyclic.h to u-boot/schedule.h
Nobody relies on getting the cyclic API declared by including the
watchdog.h header, but for historical reasons, many TUs include
watchdog.h to get a declaration of schedule(). Now that we have a
dedicated header for just that, include that header instead of
cyclic.h.
Eventually, all TUs that call schedule() should themselves include
u-boot/schedule.h, but this is a step towards getting rid of
unnecessary include statements in cyclic.h and global_data.h.
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Rasmus Villemoes [Thu, 3 Oct 2024 21:27:56 +0000 (23:27 +0200)]
cyclic: make cyclic_run static
The only caller left is schedule(); everybody outside cyclic.c now
calls or references schedule().
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Rasmus Villemoes [Thu, 3 Oct 2024 21:27:55 +0000 (23:27 +0200)]
test: dm: wdt: replace cyclic_run() by schedule()
This is the last place outside of cyclic.c that references
cyclic_run() directly. Replace by schedule(), so that cyclic_run() can
be made private. This also better matches what I believe commit
29caf9305b6f ("cyclic: Use schedule() instead of WATCHDOG_RESET()")
intended to do.
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Rasmus Villemoes [Thu, 3 Oct 2024 21:27:54 +0000 (23:27 +0200)]
fs/cramfs: use schedule instead of cyclic_run as callback
Prior to commit
29caf9305b6f ("cyclic: Use schedule() instead of
WATCHDOG_RESET()") we had
/* Currently only needed for fs/cramfs/uncompress.c */
static inline void watchdog_reset_func(void)
{
WATCHDOG_RESET();
}
and .outcb was set to that watchdog_reset_func(). Said commit changed
that .outcb to cyclic_run instead of schedule, which would otherwise
match all the other WATCHDOG_RESET replacements done. As the
HW_WATCHDOG case is not handled by cyclic_run, this seems to be an
oversight.
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Rasmus Villemoes [Thu, 3 Oct 2024 21:27:53 +0000 (23:27 +0200)]
m68k: asm/ptrace.h: include linux/types.h
Modifying a generic header like watchdog.h, removing not directly used
asm/ptrace.h header relies on whoever includes it to already have
included something that defines the type ulong.
Make the asm/ptrace.h header self-contained by including the proper
header.
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Rasmus Villemoes [Thu, 3 Oct 2024 21:27:52 +0000 (23:27 +0200)]
led: include cyclic.h in led_sw_blink.c
This makes use of the cyclic API but relies on implicitly getting the
appropriate declarations through some nested include. Include the
cyclic.h header directly.
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Rasmus Villemoes [Thu, 3 Oct 2024 21:27:51 +0000 (23:27 +0200)]
cyclic: introduce u-boot/schedule.h
I noticed an "unnecessary" include of <cyclic.h> in
global_data.h, in the sense that nothing in cyclic.h is needed in
order to define 'struct global_data'.
Well, it's not unnecessary, as it implicitly ensures that everybody
gets a declaration of schedule(), and schedule() is (obviously) called
all over the tree. Almost none of those places directly include
<cyclic.h>, but for historical reasons, many do include
<watchdog.h> (most schedule() instances are replacements of
WATCHDOG_RESET()).
However, very few TUs actually need the declarations of the
cyclic_register() and struct cyclic_info, and they also don't really
need anything from the watchdog.h header.
So introduce a new header which just contains a declaration of
schedule(), which can then be included from all the places that do
call schedule(). I removed the direct reference to cyclic_run(),
because we shouldn't have two public functions for doing roughly the
same without being very explicit about when one should call one or the
other.
Testing of later patches that explicitly include <schedule.h> when
schedule() is used revealed a problem with host tool build on win32,
which apparently picked up a host <schedule.h>. To avoid that problem,
put the new header in include/u-boot/ and hence make the include
statements say <u-boot/schedule.h>.
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Rasmus Villemoes [Thu, 3 Oct 2024 21:27:50 +0000 (23:27 +0200)]
doc: cyclic: remove reference to WATCHDOG_RESET
WATCHDOG_RESET is no more. Replace the reference by schedule().
While here, rearrange the sentence a bit so that "cyclic_run()"
becomes the object and "the main function responsible for calling all
registered cyclic functions" a parenthetical rather than the other way
around, which at least to me makes it more readable.
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Bastien Curutchet [Thu, 3 Oct 2024 08:42:55 +0000 (10:42 +0200)]
drivers: watchdog: Add DaVinci's watchdog support
Add support for the DaVinci's watchdog timer
Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Rasmus Villemoes [Wed, 2 Oct 2024 19:23:23 +0000 (21:23 +0200)]
watchdog: gpio_wdt: add support for stoppable devices
Back when I added this driver in commit
2ac8490412c9, I wrote
The corresponding linux driver apparently has support for some
watchdog circuits which can be disabled by tri-stating the gpio, but I
have never actually encountered such a chip in the wild;
That has changed now; I have a board with just such a watchdog on my
desk currently. Add support for that.
- For a hw_algo="toggle" device, the gpio is requested as output if the
always-running flag is set, otherwise as input.
- The ->start() method is updated to change the direction to output when
required (i.e. it is not always-running).
- The ->stop() method is implemented, but of course reports failure if
always-running.
As I still haven't met any hw_algo="level" devices, I'm not entirely
sure how they fit in, but I'm borrowing logic from the corresponding
linux driver:
- In ->probe(), such devices always request the gpio as GPIOD_IS_OUT.
- In ->stop(), the linux driver has an "eternal ping" comment and sets
the gpio to (logic) high.
Stefan:
Added necessary changes in test/dm/wdt.c to fix CI build breakage, as
suggested by Rasmus.
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Stefan Roese <sr@denx.de>
Tom Rini [Tue, 22 Oct 2024 20:11:20 +0000 (14:11 -0600)]
Merge tag 'video-
20241022' of https://source.denx.de/u-boot/custodians/u-boot-video
CI: https://source.denx.de/u-boot/custodians/u-boot-video/-/pipelines/22907
* VNBYTES() comment fix
* add VIDEO dependency for FDT_SIMPLEFB
* fdt_simplefb: drop not needed CONFIG_VIDEO check
* am62x,evm: preserve splash screen while OS is booting
* simplefb: warning fix for CONFIG_FDT_64BIT=n
Eva Kurchatova [Wed, 9 Oct 2024 08:48:28 +0000 (16:48 +0800)]
video: simplefb: Fix build warn with CONFIG_FDT_64BIT=n
Fix compile warning with !CONFIG_FDT_64BIT by
casting the variable in the debug print.
Signed-off-by: Eva Kurchatova <lekkit@at.encryp.ch>
Reported-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Devarsh Thakkar [Wed, 25 Sep 2024 15:13:54 +0000 (20:43 +0530)]
board: ti: am62x: evm: Update simple-framebuffer node in device-tree
Update simple-framebuffer device-tree node by enumerating framebuffer
related information in existing simple-framebuffer node in Linux
device-tree file and enabling it.
In case there is no simple-framebuffer stub detected in Linux kernel
device-tree and video is still active, then update the device-tree to
reserve the framebuffer region for the active splash screen.
This helps preserve the splash screen till the display server takes over
after OS is booted.
Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
Devarsh Thakkar [Wed, 25 Sep 2024 15:13:53 +0000 (20:43 +0530)]
boot: fdt_simplefb: Remove conditional compilation checks for VIDEO Kconfig
CONFIG_VIDEO conditional compilation checks are no longer needed since
FDT_SIMPLEFB Kconfig now depends on VIDEO Kconfig.
Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Devarsh Thakkar [Wed, 25 Sep 2024 15:13:52 +0000 (20:43 +0530)]
boot/Kconfig: Add Video Kconfig as dependency for FDT_SIMPLEFB
The fdt_simplefb.c APIs rely on video-uclass APIs and structures to
fill/update framebuffer information, so compile it only when VIDEO
Kconfig is enabled, as otherwise below warning can be seen if VIDEO
Kconfig is disabled:
"boot/fdt_simplefb.c:96:12: warning: fdt_simplefb_enable_existing_node
defined but not used [-Wunused-function]
96 | static int fdt_simplefb_enable_existing_node(void *blob)"
Reported-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Miquel Raynal [Tue, 10 Sep 2024 09:11:59 +0000 (11:11 +0200)]
video: Fix VNBYTES() macro comment
The VNBYTES() macro has been updated to silence possible warnings
regarding authorized (but unusual) uses of this macro, but the comment
was kept unchanged. A year has passed so let's fix the comment now to
avoid confusions.
Fixes: cc05d352fbc ("video: Add parentheses around VNBYTES() macro")
Suggested-by: Tom Rini <trini@konsulko.com>
Link: https://lore.kernel.org/u-boot/20240906183432.GG3879073@bill-the-cat/
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Rasmus Villemoes [Wed, 16 Oct 2024 15:10:35 +0000 (17:10 +0200)]
envtools: make them build again
In v2024.10, "make envtools" is broken for at least these defconfigs:
am335x_evm_defconfig
rpi_3_defconfig
rpi_4_defconfig
mx7dsabresd_defconfig
wandboard_defconfig
imx8mp_evk_defconfig
The only defconfig we use for which it is not broken is
stm32mp13_defconfig. They all work just fine in v2024.07.
The symptoms are slightly different, but all related to the fact that
some transitively included header uses IS_ENABLED or CONFIG_IS_ENABLED
without linux/kconfig.h having already been included.
A simple git bisect doesn't produce anything sensible, it ends up at
3a9f642ca94 (crypto: nuvoton: npcm_sha: Support SHA 384/512) which
clearly has nothing to do with this. But digging deeper, one
eventually finds
0f92fa45603 ("env: Remove <common.h> and add needed
includes").
So at first I tried adding "#include <linux/kconfig.h>" in
include/env_default.h and include/env_flags.h. That fixes it for some,
but not all, of the above. For example rpi_3_defconfig still fails,
then in log.h complaining about BIT() and u8 not being defined. At
least BIT() is should have gotten from bitops.h, except that that's
behind ifdef __KERNEL__, so not set for the envtools build.
It turns out that the envtools source code in fw_env_private.h already
has some hackery to deal with all this, in the form of the __ASSEMBLY__
games it plays before including config.h. It seems that if we just
make sure to do that include early enough, so that config.h is indeed
parsed with that __ASSEMBLY__ hackery in place, everything builds
fine.
Fixes: 0f92fa45603 ("env: Remove <common.h> and add needed includes")
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Tom Rini [Mon, 21 Oct 2024 23:53:11 +0000 (17:53 -0600)]
Merge patch series "aspeed: ast2700: Add Caliptra ECDSA driver"
Chia-Wei Wang <chiawei_wang@aspeedtech.com> says:
Aspeed AST2700 SoCs integrates the Caliptra secure IP, where an ECDSA384
signature verification HW interface is exported for SoC crypto needs.
This patch series firstly extends the FIT image signing/verify common
code to support the ECDSA384 algorithm. For better convenience, the
device tree for ECDSA public key storage is also revised by referring
to RSA implementations.
After the FIT common code revision, the driver is implemented for
AST2700 to leverage the Caliptra ECDSA384 signature verification.
These are verified by signed FIT images with the algorithm "sha384,ecdsa384".
Link: https://lore.kernel.org/r/20241014095620.216936-1-chiawei_wang@aspeedtech.com
Chia-Wei Wang [Mon, 14 Oct 2024 09:56:20 +0000 (17:56 +0800)]
drivers/crypto: aspeed: Add Caliptra ECDSA384 support
Aspeed AST27xx SoCs integrate the CPTRA 1.0 secure IP, which export
an ECDSA384_SIGNATURE_VERIFY mailbox command service for SoC to use.
This patch is verified by the FIT signature verification using the
"sha384,ecdsa384" algorithm.
Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Chia-Wei Wang [Mon, 14 Oct 2024 09:56:19 +0000 (17:56 +0800)]
image-fit-sig: Remove padding check
The padding algorithm is not mandatory for all signing algorithm.
For example, ECDSA does not require a padding method.
For RSA requiring PKCS padding, the belonging info->crypto(), assigned
with rsa_verify_key(), also has the check on the validity of info->padding().
Thus, remove the info->padding check from the upper, general layer.
Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Chia-Wei Wang [Mon, 14 Oct 2024 09:56:18 +0000 (17:56 +0800)]
lib: ecdsa: Add ECDSA384 support
Add ECDSA384 algorithm support for image signing and verification.
Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini [Mon, 21 Oct 2024 23:52:40 +0000 (17:52 -0600)]
Merge patch series "Add AVS support for J721S2"
Manorit Chawdhry <m-chawdhry@ti.com> says:
This series adds support for Adaptive voltage scaling on J721S2 device [0].
[0]: https://www.ti.com/lit/pdf/spruj28 (Section 5.2.4.1 AVS Support)
AVS Test for J721S2: https://gist.github.com/manorit2001/
b2fd9f6764a863294d4aa0755c83c84f
Boot Test results: https://gist.github.com/manorit2001/
d44e035552cb19aadeb0d928d5cb5f26
Link: https://lore.kernel.org/r/20241015-b4-upstream-j721s2-avs-v5-0-5c8087387dc5@ti.com
Manorit Chawdhry [Tue, 15 Oct 2024 10:52:23 +0000 (16:22 +0530)]
configs: j721s2_evm_r5_defconfig: Add AVS Configs
Add AVS and PMIC regulator configs
Also, disable it explicitly in am68_sk_r5_defconfig as it includes
j721s2_evm_r5_defconfig for re-usability.
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Reviewed-by: Aniket Limaye <a-limaye@ti.com>
Manorit Chawdhry [Tue, 15 Oct 2024 10:52:22 +0000 (16:22 +0530)]
arm: dts: j721s2: Add VTM node in R5
Also adds bootph-pre-ram property to VTM node and the pmic node.
vdd-supply is used to assign the buck regulator that the AVS driver can
use to program the proper voltage which it picked up from e-fuse.
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Reviewed-by: Aniket Limaye <a-limaye@ti.com>
Manorit Chawdhry [Tue, 15 Oct 2024 10:52:21 +0000 (16:22 +0530)]
arm: mach-k3: j721s2_init: Initialize AVS Class 0
Adaptive Voltage Scaling (AVS) Class 0 is a procedure for lowering the
voltage on certain device power rails. Initialize AVS Class 0.
Link: https://www.ti.com/lit/pdf/spruj28
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Reviewed-by: Aniket Limaye <a-limaye@ti.com>
Manorit Chawdhry [Tue, 15 Oct 2024 10:52:20 +0000 (16:22 +0530)]
drivers: misc: k3_avs: Extract MPU clk and dev ID from DT
Different devices have different MPU clk and dev ID. Currently it had
been hardcoded. Move it to DT based extraction.
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Reviewed-by: Aniket Limaye <a-limaye@ti.com>
Manorit Chawdhry [Tue, 15 Oct 2024 10:52:19 +0000 (16:22 +0530)]
arm: dts: k3-*-r5: Add MPU clock in clocks property
MPU clock had been missing. Distinguish multiple clocks with clock-names
and add MPU clock as well.
Link: https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/j721s2/clocks.html#clocks-for-a72ss0-core0-device
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Reviewed-by: Aniket Limaye <a-limaye@ti.com>
Manorit Chawdhry [Tue, 15 Oct 2024 10:52:18 +0000 (16:22 +0530)]
drivers: misc: k3_avs: Check return code while programming AVS
Check if AVS could not be programmed and print a warning.
Fixes: 9d233b4e3ed6 ("misc: k3_avs: add driver for K3 Adaptive Voltage Scaling Class 0")
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Reviewed-by: Aniket Limaye <a-limaye@ti.com>
Manorit Chawdhry [Tue, 15 Oct 2024 10:52:17 +0000 (16:22 +0530)]
power: pmic: tps65941: Add DM_PMIC dependency
This Kconfig depends on DM_PMIC but hadn't be explicitly stated which
could cause config related issues.
Adds the dependency in Kconfig for tps65941.
Fixes: 6b86dd0c1ead ("power: pmic: tps65941: Add support for tps65941 family of PMICs")
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Reviewed-by: Aniket Limaye <a-limaye@ti.com>
Tom Rini [Mon, 21 Oct 2024 23:51:55 +0000 (17:51 -0600)]
Merge patch series "Add TI K3 PCIe Controller support for J7200"
Siddharth Vadapalli <s-vadapalli@ti.com> says:
Hello,
This series adds support for the Cadence PCIe controller on TI's K3
family of SoCs to which the J7200 SoC belongs. The driver is an adaptation
of the Linux driver (drivers/pci/controller/cadence/pci-j721e.c) and has
been implemented specifically for Root-Complex mode of operation on the
J7200 SoC. A minor set of changes will be sufficient to support other K3
SoCs as well with plans to implement it in the near future.
Link: https://lore.kernel.org/r/20241014053924.4027491-1-s-vadapalli@ti.com
Siddharth Vadapalli [Mon, 14 Oct 2024 05:39:24 +0000 (11:09 +0530)]
configs: j7200_evm_a72_defconfig: Enable configs for PCI support
TI's J7200 SoC has a single instance of PCIe Controller namely PCIe1 which
is a Cadence PCIe Controller. To support PCIe functionality with the PCIe1
instance of PCIe, enable the corresponding configs.
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Siddharth Vadapalli [Mon, 14 Oct 2024 05:39:23 +0000 (11:09 +0530)]
pci: Add TI K3 Cadence PCIe Controller
Add support for the Cadence PCIe Controller present on TI's K3 SoCs.
This driver is an adaptation of the Linux driver.
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tom Rini [Mon, 21 Oct 2024 21:27:38 +0000 (15:27 -0600)]
Merge patch series "dwc3: gadget: properly fix cache operations"
Neil Armstrong <neil.armstrong@linaro.org> says:
We experience huge problems with cache handling on Qualcomm
systems, and it appears the dcache handling in the DWC3 gadget
code is quite wrong and causes operational issues.
This serie fixes the dcache operations on unaligned data,
and properly invalidate buffers when reading back data from
hardware.
Link: https://lore.kernel.org/r/20241011-u-boot-dwc3-gadget-dcache-fixup-v4-0-5f3498d8035b@linaro.org
Neil Armstrong [Fri, 11 Oct 2024 14:38:26 +0000 (16:38 +0200)]
usb: dwc3: invalidate dcache on buffer used in interrupt handling
On Qualcomm systems, the setup buffer and even buffers are in
a bad state at interrupt handling, so invalidate the dcache lines
for the setup_buf and event buffer to make sure we read correct
data written by the hardware.
This fixes the following error:
dwc3-generic-peripheral usb@
a600000: UNKNOWN IRQ type -1
dwc3-generic-peripheral usb@
a600000: UNKNOWN IRQ type
4673109
and invalid situation in dwc3_gadget_giveback() because setup_buf content
is read at 0s and leads to fatal crash fixed by [1].
[1] https://lore.kernel.org/all/
20240528-topic-sm8x50-dwc3-gadget-crash-fix-v1-1-
58434ab4b3d3@linaro.org/
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Marek Vasut <marex@denx.de>
Neil Armstrong [Fri, 11 Oct 2024 14:38:25 +0000 (16:38 +0200)]
usb: dwc3: fix dcache flush range calculation
The current flush operation will omit doing a flush/invalidate on
the first and last bytes if the base address and size are not aligned
with CACHELINE_SIZE.
This causes operation failures Qualcomm platforms.
Take in account the alignment and size of the buffer and also
flush the previous and last cacheline.
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Marek Vasut <marex@denx.de>
Neil Armstrong [Fri, 11 Oct 2024 14:38:24 +0000 (16:38 +0200)]
usb: dwc3: allocate setup_buf with dma_alloc_coherent()
Since setup_buf is also consumed by hardware DMA, aligns it's
allocation like other hardware buffers by introduce setup_buf_addr
populated by dma_alloc_coherent(), and use it to pass the physical
address of the buffer to the hardware.
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Tom Rini [Mon, 21 Oct 2024 14:30:12 +0000 (08:30 -0600)]
Merge tag 'i2c-tag-v2025.01-rc1' of https://source.denx.de/u-boot/custodians/u-boot-i2c
i2c updates for v2025.01-rc1
- Add support for the following Maxim chips using the existing PCA954x
driver from Maxim:
- MAX7356
- MAX7357
- MAX7358
- MAX7367
- MAX7368
- MAX7369
- introduce "i2c-gpio,sda-output-only" functionality
from Alex
Alex Shumsky [Tue, 15 Oct 2024 20:29:31 +0000 (23:29 +0300)]
i2c: i2c-gpio: add support for i2c-gpio,sda-output-only
Some I2C slave devices are read-only and don't even answer with NACK.
For example FD65x segment LED controllers.
Make them usable with i2c-gpio,sda-output-only that are already supported
by Linux 6.3+.
Signed-off-by: Alex Shumsky <alexthreed@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Maksim Kiselev [Thu, 19 Sep 2024 16:06:56 +0000 (19:06 +0300)]
i2c: muxes: pca954x: Add MAX735x/MAX736x support
Add support for the following Maxim chips using the existing PCA954x
driver:
- MAX7356
- MAX7357
- MAX7358
- MAX7367
- MAX7368
- MAX7369
All added Maxim chips behave like the PCA954x, where a single SMBUS byte
write selects up to 8 channels to be bridged to the primary bus.
Tested using the MAX7358.
Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Tom Rini [Sun, 20 Oct 2024 14:27:15 +0000 (08:27 -0600)]
Merge tag 'efi-2025-01-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2025-01-rc1-2
CI: https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/22810
Documentation:
* Add document describing Ethernet boot on AM62x SoC
* Fix typo in blkmap command example
UEFI:
* Avoid #ifdef in efi_setup.c
* Reduce message noisiness if ESP is missing
* Remove ERROR:, WARNING: prefixes in messages
* Use blk_create_devicef() in block device driver
Others:
* Let CONFIG_CMD_WGET depend on CONFIG_CMD_NET
Tom Rini [Sat, 19 Oct 2024 04:32:45 +0000 (22:32 -0600)]
Merge tag 'dm-pull-17oct24-take2' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
A few new x86 commands and minor improvements
expo improvements
binman support for signing FIT images
Marek Vasut [Tue, 15 Oct 2024 20:14:53 +0000 (22:14 +0200)]
mtd: spi-nor: Move SR3 WPS bit definition in the correct location
Move the SR3 bit definition in the right place. Fix
what is likely a rebase artifact. No functional change.
Fixes: 215f1d5794c6 ("mtd: spi-nor: Clear Winbond SR3 WPS bit on boot")
Signed-off-by: Marek Vasut <marex@denx.de>
Raymond Mao [Wed, 16 Oct 2024 23:48:26 +0000 (16:48 -0700)]
mbedtls: fix defects in coverity scan
Fixes of unreleased buffer, deadcode and wrong variable type detected
by coverity scan.
Addresses-Coverity-ID: 510809: Resource leaks (RESOURCE_LEAK)
Addresses-Coverity-ID: 510806: Control flow issues (DEADCODE)
Addresses-Coverity-ID: 510794 Control flow issues (NO_EFFECT)
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Heinrich Schuchardt [Fri, 18 Oct 2024 02:46:57 +0000 (04:46 +0200)]
cmd: upl: correct printf code
Building on 32-bit results in a build failure:
cmd/upl.c:75:51: warning: format ‘%lx’ expects argument of type
‘long unsigned int’, but argument 3 has type ‘size_t’
{aka ‘unsigned int’} [-Wformat=]
75 | printf("UPL handoff written to %lx size %lx\n", addr, abuf_size(&buf));
| ~~^ ~~~~~~~~~~~~~~~
| | |
| | size_t {aka unsigned int}
| long unsigned int
| %x
Fixes: 264f4b0b34c0 ("upl: Add a command")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Caleb Connolly [Fri, 18 Oct 2024 13:51:07 +0000 (15:51 +0200)]
lmb: notify when adjacent regions are added
lmb_add_region() returns a positive integer if the added regions causes
existing regions to be coalesced. We still want to notify the EFI
subsystem about these added regions though, so adjust lmb_add() to only
bail on errors.
This fixes EFI memory allocation on boards with adjacent memory banks as is the
case on several Qualcomm boards like the RB3 Gen 2.
Fixes: 2f6191526a13 (lmb: notify of any changes to the LMB memory map)
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Andy Shevchenko [Sat, 5 Oct 2024 19:12:00 +0000 (22:12 +0300)]
x86: cpu: Add missing header inclusion
Without asm/cpu_x86.h inclusion a compiler is not happy:
arch/x86/cpu/cpu_x86.c:14:5: warning: no previous prototype for ‘cpu_x86_bind’ [-Wmissing-prototypes]
arch/x86/cpu/cpu_x86.c:29:5: warning: no previous prototype for ‘cpu_x86_get_vendor’ [-Wmissing-prototypes]
arch/x86/cpu/cpu_x86.c:41:5: warning: no previous prototype for ‘cpu_x86_get_desc’ [-Wmissing-prototypes]
arch/x86/cpu/cpu_x86.c:55:5: warning: no previous prototype for ‘cpu_x86_get_count’ [-Wmissing-prototypes]
Add missing header inclusion.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Andy Shevchenko [Sat, 5 Oct 2024 19:11:59 +0000 (22:11 +0300)]
x86: cpu: Add a few prototypes to the header file
The compiler is not happy to have no prototypes for the functions that
are not defined static. Add them. This helps avoiding the compiler warnings:
arch/x86/cpu/cpu.c:197:13: warning: no previous prototype for ‘board_final_init’ [-Wmissing-prototypes]
arch/x86/cpu/cpu.c:205:13: warning: no previous prototype for ‘board_final_cleanup’ [-Wmissing-prototypes]
arch/x86/cpu/cpu.c:307:5: warning: no previous prototype for ‘reserve_arch’ [-Wmissing-prototypes]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>