[PATCH v4 1/4] imx9: Add support for saving DDR training data to NVM
Marek Vasut
marex at nabladev.com
Tue Jun 2 13:20:57 CEST 2026
On 4/30/26 10:33 AM, Simona Toaca (OSS) wrote:
[...]
> +static int imx_qb_spi(bool save)
> +{
> + struct udevice *flash;
> + u64 offset;
> + int ret;
> +
> + if (!CONFIG_IS_ENABLED(SPI)) {
> + printf("SPI not enabled\n");
> + return -EOPNOTSUPP;
> + }
> +
> + ret = uclass_first_device_err(UCLASS_SPI_FLASH, &flash);
> + if (ret) {
> + printf("SPI flash not found.\n");
> + return -ENODEV;
> + }
> +
> + ret = imx_qb_get_qbdata_offset(flash, SPI_DEV, &offset);
> + if (ret) {
> + printf("get_qbdata_offset failed, ret = %d\n", ret);
> + return ret;
> + }
> +
> + ret = spi_flash_erase_dm(flash, offset, QB_STATE_LOAD_SIZE);
Can you please double-check whether "offset" here is always aligned to
64 kiB (SPI NOR erase block size) ? If not, this erase here will fail.
Thank you
More information about the U-Boot
mailing list