Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xilinx v2023.01 rebase #230

Draft
wants to merge 119 commits into
base: xlnx_rebase_v2023.01
Choose a base branch
from

Conversation

quaresmajose
Copy link
Member

Please do not submit a Pull Request via github. Our project makes use of
mailing lists for patch submission and review. For more details please
see https://www.denx.de/wiki/U-Boot/Patches

The only exception to this is in order to trigger a CI loop on Azure prior
to posting of patches.

Amit Kumar Mahapatra and others added 30 commits June 12, 2023 16:08
Except Linux no other component (i.e., u-boot, fsbl or BootRom) of the
software stack supports software ecc engine. So, make hw-ecc as the
default ecc mode.

Fixes: 8ae46e9 ("arm64: zynqmp: Update device tree properties for nand flash")
Signed-off-by: Amit Kumar Mahapatra <[email protected]>
State: pending
The xhci host controller driver trying to queue the URB's and it is
getting halted at the endpoint, thereby hitting the BUG_ON's.
Mostly these kind of random issues are seen on faulty boards.
Removing these BUG_ON's from the U-Boot xhci code, as in Linux kernel
xhci code BUG_ON/BUG's are removed entirely.
Please also note, that BUG_ON() is not recommended any more in the Linux
kernel.
Similar issue has been observed on TI AM437x board and they created a patch
in Linux kernel as below
https://patches.linaro.org/project/linux-usb/patch/[email protected]/

Signed-off-by: Venkatesh Yadav Abbarapu <[email protected]>
State: pending
For Winbond flash write enable is missing before programming
status register2(SR2). Send write enable command before write to
status register2(SR2).

Signed-off-by: Venkatesh Yadav Abbarapu <[email protected]>
State: pending
… area

Update MTD partitions of System-controller device tree to allocate 128KB of QSPI
memory for secure OS. Increased "SHA256" partition size & changed
starting address and size of "User" partition to accommodate the new partition
"Secure OS Storage"

Reference : commit c863016

Signed-off-by: Tejas Bhumkar <[email protected]>
State: pending
DT binding has been approved that's why use new compatible string.
The old one is mark as deprecated and should be removed after some
releases.

Link: https://lore.kernel.org/r/[email protected]/
Link: https://lore.kernel.org/r/6e78d0d2e21f2f9e7f8f448bb8e0d27ced4de7d3.1686655339.git.michal.simek@amd.com
Signed-off-by: Michal Simek <[email protected]>
State: waiting
Switch to the new DT binding with new xlnx,versal-wwdt compatible string.

Link: https://lore.kernel.org/r/[email protected]/
Signed-off-by: Michal Simek <[email protected]>
State: pending
description of VNX board peripherals:
- GEM1 with RMII
- OSPI connected mt35xu02g flash
- eMMC
- USB host
- UART1 as console and UART0
- SPI1
- I2C0 and I2C1 with EEPROM connected

Signed-off-by: Kiran Kumar Perepu <[email protected]>
State: pending
Renames interrupt-controller node name to fix errors report by dtbs_check.

Signed-off-by: Thippeswamy Havalige <[email protected]>
State: pending
Add missing properties to fix dtbs_check errors in cpm_pciea node.

Signed-off-by: Thippeswamy Havalige <[email protected]>
State: pending
Xilinx Versal Premium series has CPM5 block which supports Root Port
functioning at Gen5 speed.

Xilinx Versal CPM5 has few changes with existing CPM block.
- CPM5 has dedicated register space for control and status registers.
- CPM5 legacy interrupt handling needs additional register bit
  to enable and handle legacy interrupts.

Signed-off-by: Thippeswamy Havalige <[email protected]>
Signed-off-by: Bharat Kumar Gogada <[email protected]>
State: pending
Add TCM_A and RPU_A_0 nodes for Versal NET devices

Signed-off-by: Tarak Reddy <[email protected]>
State: pending
Clock node with fixed clock is placed in versal-net-clk.dtsi and
with CCF in versal-net-clk-ccf.dtsi. Which in turn requires Clock-IDs
and PM-IDs to be updated in xlnx-versal-net-clk.h and in
xlnx-versal-net-power.h respectively.

Earlier only FPD-WWDT were part of versal-net.dtsi

Signed-off-by: Kiran Kumar Perepu <[email protected]>
State: pending
Before DMA read, ideally cache should be invalidated, so that data from
memory will be updated to cache after DMA is completed. But
flush_dcache_range is being used which is incorrect. Change
flush_dcache_range to invalidate_dcache_range.

Signed-off-by: Ashok Reddy Soma <[email protected]>
State: pending
Cache related issues are seen with small sized data reads in Versal NET
platform. Due to this, proper data is not read. Also some times sf probe
fails randomly. To workaround this issue, invalidate dcache after read DMA
is triggered for Versal NET platforms.

Signed-off-by: Ashok Reddy Soma <[email protected]>
State: pending
As per spec MDC must not exceed 2.5MHz, read the pclk clock
from the device tree and update the MDC clock divisor.
GEM devices support larger clock divisors and have a different
range of divisors.  Program the MDIO clock divisors based on
the clock rate of the pclk clock.

Signed-off-by: Venkatesh Yadav Abbarapu <[email protected]>
State: pending
Add support for Winbond 256M-bit flash w25q256jwm.
Performed basic erase/write/readback operations on
ZynqMP zc1751+dc1 board.

Signed-off-by: Venkatesh Yadav Abbarapu <[email protected]>
Acked-by: Ashok Reddy Soma <[email protected]>
State: pending
Following changes are required in SPI node. On hardware SPI1 is
connected to flash not SPI0. Also the slave-select (chip-select) to
be used is SS2 not SS0.

Signed-off-by: Kiran Kumar Perepu <[email protected]>
State: pending
Added no-wp DT property in OSPI flash node for all board dts & dtsi files
on which the WP# signal of the OSPI flash device is not connected. If this
property is set, then the software will avoid setting the status register
write disable (SRWD) bit in status register during status register
write operation.

Signed-off-by: Amit Kumar Mahapatra <[email protected]>
State: pending
Based on DT binding dwc_usb3 is single entry without anything else. That's
why combination dwc3_usb3, otg is not allowed. That's why split it to host
and peripheral pair which both points to the same IRQ.
DWC3 code is reading these two properties first before generic dwc_usb3.

Updated "interrupt-names" property in dwc3 core for versal-net, to support
the USB remote-wakeup feature based on upstreamed dwc3,snps DT binding for
wakeup irq.

Signed-off-by: Piyush Mehta <[email protected]>
State: pending
Fix xhci_wait_for_event() to return NULL when the control
reaches the end.
drivers/usb/host/xhci-ring.c: In function 'xhci_wait_for_event':
drivers/usb/host/xhci-ring.c:487:1: warning: control reaches end of
	     			    non-void function [-Wreturn-type]

Signed-off-by: Venkatesh Yadav Abbarapu <[email protected]>
State: pending
When CONFIG_CMD_MMC and CONFIG_MMC are disabled, still some compilation
errors are seen as below due to unresolved symbols.

drivers/dfu/dfu_mmc.o: in function `mmc_block_op':
drivers/dfu/dfu_mmc.c:32: undefined reference to `find_mmc_device'
drivers/dfu/dfu_mmc.c:54: undefined reference to `mmc_get_blk_desc'
drivers/dfu/dfu_mmc.c:67: undefined reference to `mmc_get_blk_desc'
drivers/dfu/dfu_mmc.c:70: undefined reference to `mmc_get_blk_desc'
drivers/dfu/dfu_mmc.o: in function `dfu_fill_entity_mmc':
drivers/dfu/dfu_mmc.c:369: undefined reference to `find_mmc_device'
drivers/dfu/dfu_mmc.c:376: undefined reference to `mmc_init'
drivers/dfu/dfu_mmc.c:403: undefined reference to `mmc_get_blk_desc'
gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-ld.bfd: line 4:
31661 Segmentation fault      (core dumped) $CC --sysroot=$LIBC
--no-warn-rwx-segment "$@"
Makefile:1760: recipe for target 'u-boot' failed
make: *** [u-boot] Error 139
make: *** Deleting file 'u-boot'

Add dependency of CONFIG_MMC for CONFIG_DFU_MMC config to fix the errors.

Signed-off-by: Ashok Reddy Soma <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
State: waiting
When CONFIG_CMD_USB and CONFIG_USB are disabled some compilation errors
are seen as below.

cmd/thordown.o: in function `usb_gadget_initialize':
include/linux/usb/gadget.h:981: undefined reference to `board_usb_init'
cmd/thordown.o: in function `do_thor_down':
cmd/thordown.c:68: undefined reference to `g_dnl_unregister'
cmd/thordown.o: in function `usb_gadget_release':
include/linux/usb/gadget.h:986: undefined reference to `board_usb_cleanup'
cmd/thordown.o: in function `do_thor_down':
cmd/thordown.c:41: undefined reference to `g_dnl_register'
cmd/thordown.c:48: undefined reference to `thor_init'
cmd/thordown.c:56: undefined reference to `thor_handle'
gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-ld.bfd: line 4:  8485
Segmentation fault      (core dumped) $CC --sysroot=$LIBC
--no-warn-rwx-segment "$@"
Makefile:1779: recipe for target 'u-boot' failed
make: *** [u-boot] Error 139
make: *** Deleting file 'u-boot'

Add dependency of CMD_USB for CONFIG_CMD_THOR_DOWNLOAD to fix the errors.

Signed-off-by: Ashok Reddy Soma <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michal Simek <[email protected]>
State: waiting
When CONFIG_CMD_USB and CONFIG_USB are disabled, still some compilation
errors are seen as below.

In file included from include/configs/xilinx_zynqmp.h:173,
                 from include/config.h:3,
                 from include/common.h:16,
                 from env/common.c:10:
include/config_distro_bootcmd.h:302:9: error: expected '}' before 'BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB'
  302 |         BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/config_distro_bootcmd.h:302:9: note: in definition of macro
'BOOTENV_DEV_NAME_USB'
  302 |         BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/configs/xilinx_zynqmp.h:77:41: note: in expansion of macro
'BOOTENV_DEV_NAME'
   77 | # define BOOT_TARGET_DEVICES_USB(func)  func(USB, usb, 0)
   func(USB, usb, 1)
      |                                         ^~~~
include/configs/xilinx_zynqmp.h:168:9: note: in expansion of macro
'BOOT_TARGET_DEVICES_USB'
  168 |         BOOT_TARGET_DEVICES_USB(func) \
      |         ^~~~~~~~~~~~~~~~~~~~~~~
include/config_distro_bootcmd.h:454:25: note: in expansion of macro
'BOOT_TARGET_DEVICES'
  454 |         "boot_targets=" BOOT_TARGET_DEVICES(BOOTENV_DEV_NAME) "\0"
      |                         ^~~~~~~~~~~~~~~~~~~
include/config_distro_bootcmd.h:474:9: note: in expansion of macro
'BOOTENV_BOOT_TARGETS'
  474 |         BOOTENV_BOOT_TARGETS \
      |         ^~~~~~~~~~~~~~~~~~~~
include/configs/xilinx_zynqmp.h:179:9: note: in expansion of macro
'BOOTENV'
  179 |         BOOTENV
      |         ^~~~~~~
include/env_default.h:120:9: note: in expansion of macro
'CFG_EXTRA_ENV_SETTINGS'
  120 |         CFG_EXTRA_ENV_SETTINGS
      |         ^~~~~~~~~~~~~~~~~~~~~~
In file included from env/common.c:32:
include/env_default.h:27:36: note: to match this '{'
   27 | const char default_environment[] = {
      |                                    ^
scripts/Makefile.build:256: recipe for target 'env/common.o' failed
make[1]: *** [env/common.o] Error 1
Makefile:1853: recipe for target 'env' failed
make: *** [env] Error 2
make: *** Waiting for unfinished jobs....

Add CONFIG_USB_STORAGE as dependency for USB related macro's such as
BOOT_TARGET_DEVICES_USB() and DFU_DEFAULT_POLL_TIMEOUT and
CONFIG_THOR_RESET_OFF.

Remove CONFIG_ZYNQMP_USB from Kconfig and also from defconfig since it
is not used anywhere else.

Signed-off-by: Ashok Reddy Soma <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michal Simek <[email protected]>
State: waiting
When CONFIG_SYS_REDUNDAND_ENVIRONMENT is enabled, by default env is
getting saved to redundant environment irrespective of primary env is
present or not.

It means even if primary and redundant environment are not present, by
default, env is getting stored to redundant environment. Even if primary
env is present, it is choosing to store in redudndant env.

Ideally it should look for primary env and choose to store in primary env
if it is present. If both primary and redundant env are not present then
it should save in to primary env area.

Fix the issue by making env_valid = ENV_INVALID when both the
environments are not present.

Signed-off-by: Ashok Reddy Soma <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
State: waiting
Enables the FDT library (libfdt) overlay support for zynq platforms
to be able to use fdt apply command.

Signed-off-by: Raju Kumar Pothuraju <[email protected]>
Link: https://lore.kernel.org/r/ab26dd186fb752b3d607e6160ae5baf6661d5de7.1688990179.git.michal.simek@amd.com
Signed-off-by: Michal Simek <[email protected]>
State: waiting
There is a chance that assigned-clock-rates is given and assigned-clocks
could be empty. Dont return error in that case, because the probe of the
corresponding driver will not be called at all if this fails.
Better to continue to look for it and return 0.

Signed-off-by: Ashok Reddy Soma <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
State: waiting
This patch adds testcase for locking and unlocking the qspi flash
region, it covers the entire flash area for lock/unlock operation.

It relies on boardenv* file which contains the supported flash part
list, this test will run only for supported flash parts.

Example of boardenv file:
env__qspi_lock_unlock = {
    "supported_flash": "mt25qu512a, n25q00a, n25q512ax3",
}

Signed-off-by: Love Kumar <[email protected]>
State: pending
This patch adds negative tests for qspi flash operations which includes
erase, write and read.

Signed-off-by: Love Kumar <[email protected]>
State: pending
Remove USB description from System Controller revB and revC. Newer boards
won't have HW for it populated and current boards like vpk120, etc have it
but SW running on SC is not using it at all. That's why remove description
for generic SC image which will target both new boards but also old boards.

Signed-off-by: Michal Simek <[email protected]>
State: pending
Add helper function to allow reading a single indexed u64 value from a
device-tree property containing multiple u64 values, that is an array of
u64's.

Signed-off-by: Ashok Reddy Soma <[email protected]>
State: pending
Venkatesh Yadav Abbarapu and others added 29 commits September 21, 2023 13:02
MDC clock change needs to be done when the driver probe function
is called and not when the interface is being used.

Signed-off-by: Venkatesh Yadav Abbarapu <[email protected]>
State: pending
Add command for retrieving/adjusting multiboot register value, which
permits to force CSU ROM t`o boot image from particular offset after
soft reset.

Signed-off-by: Igor Opaniuk <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
Add weak function for detecting U-Boot SPL payload, this introduces
possibility to detect SPL payload in runtime (usually handy on A/B setups).

Signed-off-by: Igor Opaniuk <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
Detect a filename of SPL payload based on the value of multiboot offset.

Signed-off-by: Igor Opaniuk <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
SPL FIT load checks the signature on loadable images but just continues
in the case of a failure. This is undesirable behavior because the boot
process depends on the authenticity of each loadable part.

Adding CONFIG_SPL_FIT_SIGNATURE_STRICT to halt the platform when any
image fails its signature check, including loadable parts.

SPL already supports image signature verification but had no mechanism
to check that the FIT's configuration block was signed correctly.

Add a check near the start of spl_load_simple_fit that verifies the
FIT's configuration block, and fails if it's not present or the
signature doesn't match what's stored in the SPL DTB.

Signed-off-by: Henry Beberman <[email protected]>
Signed-off-by: Ricardo Salveti <[email protected]>
Co-developed-by: Oleksandr Suvorov <[email protected]>
Signed-off-by: Oleksandr Suvorov <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
Add CONFIG_FIT_SIGNATURE_STRICT to require a valid FIT configuration
signature for each command that is able to manipulate FIT images.

Signed-off-by: Ricardo Salveti <[email protected]>
Co-developed-by: Oleksandr Suvorov <[email protected]>
Signed-off-by: Oleksandr Suvorov <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
Signed-off-by: Jorge Ramirez-Ortiz <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
Make sure to check if SPL legacy image format is enabled before
trying to execute the image.

Signed-off-by: Ricardo Salveti <[email protected]>
Signed-off-by: Oleksandr Suvorov <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
Signed-off-by: Jorge Ramirez-Ortiz <[email protected]>
Signed-off-by: Ricardo Salveti <[email protected]>

[FIO internal] common: FIOVB: split SPL config out

This allows removal of this driver when SPL is enabled.

Signed-off-by: Michael Scott <[email protected]>

[FIO extras] fiovb: add support to delete persistent values

Add command to allow deleting persistent values.

Signed-off-by: Ricardo Salveti <[email protected]>

[FIO extras] fiovb: sync ta header for upgrade_available support

Sync ta_fiovb.h from OP-TEE to support getting/setting the
upgrade_available variable.

Also bump fiovb_name to 30 in order for fiovb to be able to set an env
var for upgrade_available.

Signed-off-by: Ricardo Salveti <[email protected]>

[FIO extras] fiovb: convert to cmd_tbl

Commit 0914011 removed the cmd_tbl_t typedef, so update fiovb to
use struct cmd_tbl instead.

Signed-off-by: Ricardo Salveti <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
Prefer aborting the fit verification process when a signature node is
not found by U-Boot and FIT SIGNATURE STRICT is enabled. This is a way
to always force a proper signature verification via sig verify.

Signed-off-by: Ricardo Salveti <[email protected]>
Signed-off-by: Oleksandr Suvorov <[email protected]>

[FIO toup-squash] spl: minor fixes for FIT_SIGNATURE_STRICT mode

This fixes a possible ambiguous 'else' [2] and using undeclared
function hang() [1].

[1]
common/spl/spl_fit.c: In function ‘spl_load_fit_image’:
common/spl/spl_fit.c:335:5: warning: implicit declaration of function ‘hang’ [-Wimplicit-function-declaration]
  335 |     hang();
      |     ^~~~
---------------------------------------------------------------------
[2]
common/spl/spl_fit.c:332:6: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]
  332 |   if (!fit_image_verify_with_data(fit, node, src, length))
      |      ^
---------------------------------------------------------------------
Fixes: dd9336e ("[FIO fromlist] spl: Add CONFIG_SPL_FIT_SIGNATURE_STRICT")
Signed-off-by: Oleksandr Suvorov <[email protected]>

[FIO toup-squash] spl: use spl_simple_fit_parse for STRICT validation

FIT image is already parsed and verified by the spl_simple_fit_parse
function, so instead of searching for the default config node entry and
validating its signature, just use the return code from the fit parser
and hang in case of errors.

Fixes: dd9336e ("[FIO fromlist] spl: Add CONFIG_SPL_FIT_SIGNATURE_STRICT")
Signed-off-by: Ricardo Salveti <[email protected]>
Signed-off-by: Oleksandr Suvorov <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
This variable is pointing to offset is qspi where u-boot image is placed.
In our case it is location of u-boot.itb file. Offset is the same as is
used by Xilinx Zynq SoC.

Signed-off-by: Michal Simek <[email protected]>
Link: https://patchwork.ozlabs.org/project/uboot/patch/846902c505aca09b67e1b287837bbae42d75824d.1627551566.git.michal.simek@xilinx.com/
Signed-off-by: Jose Quaresma <[email protected]>
Add dynamic detection of FIT image offset for QSPI boot.

Testing (regular boot from primary boot image):
U-Boot SPL 2021.07+xlnx+gc5d8da6b06 (Nov 02 2021 - 21:49:46 +0000)
PMUFW:	v1.1
Loading new PMUFW cfg obj (2168 bytes)
Silicon version:	3
EL Level:	EL3
Multiboot:	0
Trying to boot from SPI
SPL: Booting next image from 0x100000 SPI offset

Testing (booting secondary boot image):
U-Boot SPL 2021.07+xlnx+g3f451431d6 (Nov 02 2021 - 22:09:42 +0000)
PMUFW:	v1.1
Loading new PMUFW cfg obj (2168 bytes)
Silicon version:	3
EL Level:	EL3
Multiboot:	10
Trying to boot from SPI
SPL: Booting next image from 0xaa0000 SPI offset

Signed-off-by: Igor Opaniuk <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
Introduce SYS_SPI_BOOT_IMAGE_OFFS/SYS_SPI_BOOT_IMAGE_OFFS2 Kconfig
options that provide possibility to adjust spi boot image layout.

Signed-off-by: Igor Opaniuk <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
Add additional check to multi_boot cmd implementation, so it permits to set
values of multiboot offset register that correspond to
SYS_SPI_BOOT_IMAGE_OFFS/SYS_SPI_BOOT_IMAGE_OFFS2.

Signed-off-by: Igor Opaniuk <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
Fix error output print.

Fixes: 09d96c0("[FIO toup] zynqmp: multi_boot cmd valid value check")
Signed-off-by: Igor Opaniuk <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
If env is reset with env default -a, modeboot also becomes empty and
it is never set after as we hit this condition after each boot:

if (!(gd->flags & GD_FLG_ENV_DEFAULT)) {
    debug("Saved variables - Skipping\n");
    return 0;
}

This causes all logic, which depends on modeboot value, work
incorrectly. Set modeboot on every boot unconditionally.

Signed-off-by: Igor Opaniuk <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
Since ea2ca7e("spi: Rename SPI_SUPPORT to SPI") SPI_SUPPORT os not
valid anymore, use new one instead.

Signed-off-by: Igor Opaniuk <[email protected]>
Signed-off-by: Ricardo Salveti <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
Allow saving the environment in fat and in ext4 when bootmode is qspi.

Signed-off-by: Ricardo Salveti <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
Adjust additional check to multi_boot cmd implementation, that in case
of QSPI boot besides SYS_SPI_BOOT_IMAGE_OFFS/SYS_SPI_BOOT_IMAGE_OFFS2,
it permits to set 0 for the special case, when Image Selector is used.

Signed-off-by: Igor Opaniuk <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
Introduce bootslot cmd for updating persistent register, whose values
are used by imgsel tool.

> bootslot
SF: Detected mt25qu512a with page size 256 Bytes, erase size 64 KiB, total 64 MiB
Image A: Bootable
Image B: Bootable
Requested Boot Image: Image A
Last Booted Image: Image A

> bootslot 1 0 1
SF: Detected mt25qu512a with page size 256 Bytes, erase size 64 KiB, total 64 MiB
Image A: Bootable
Image B: Non Bootable
Requested Boot Image: Image B
Last Booted Image: Image A

'bootslot' command also creates these env vars, that can be used
in script logic:
zynqmp.image_a_bootable=1
zynqmp.image_b_bootable=0
zynqmp.last_booted=0
zynqmp.requested_boot=1

Signed-off-by: Igor Opaniuk <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
Add clean-up after SPI flash operation is finished.

Signed-off-by: Igor Opaniuk <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
Add required OP-TEE nodes by default in zynqmp.dtsi, which allows having
a functional runtime when OP-TEE is enabled.

Signed-off-by: Ricardo Salveti <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
Add required OP-TEE nodes by default in versal.dtsi, which allows having
a functional runtime when OP-TEE is enabled.

Signed-off-by: Ricardo Salveti <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
… command

When running "i2c md 0 0 80000100", the function do_i2c_md parses the
length into an unsigned int variable named length. The value is then
moved to a signed variable:

    int nbytes = length;
    #define DISP_LINE_LEN 16
    int linebytes = (nbytes > DISP_LINE_LEN) ? DISP_LINE_LEN : nbytes;
    ret = dm_i2c_read(dev, addr, linebuf, linebytes);

On systems where integers are 32 bits wide, 0x80000100 is a negative
value to "nbytes > DISP_LINE_LEN" is false and linebytes gets assigned
0x80000100 instead of 16.

The consequence is that the function which reads from the i2c device
(dm_i2c_read or i2c_read) is called with a 16-byte stack buffer to fill
but with a size parameter which is too large. In some cases, this could
trigger a crash. But with some i2c drivers, such as drivers/i2c/nx_i2c.c
(used with "nexell,s5pxx18-i2c" bus), the size is actually truncated to
a 16-bit integer. This is because function i2c_transfer expects an
unsigned short length. In such a case, an attacker who can control the
response of an i2c device can overwrite the return address of a function
and execute arbitrary code through Return-Oriented Programming.

Fix this issue by using unsigned integers types in do_i2c_md. While at
it, make also alen unsigned, as signed sizes can cause vulnerabilities
when people forgot to check that they can be negative.

CVE: CVE-2022-34835

Signed-off-by: Nicolas Iooss <[email protected]>
Reviewed-by: Heiko Schocher <[email protected]>
(cherry picked from commit 8f8c04b)
Signed-off-by: Ricardo Salveti <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
Improve multi_boot cmd:
1. Support both hex and dec values for register value.
2. Provide more details about boot image offset used during QSPI boot.

Signed-off-by: Igor Opaniuk <[email protected]>
Signed-off-by: Jose Quaresma <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.