soc/qualcomm/qclib: Improve logging on invalid MRC cache data

This patch downgrades the message severity from BIOS_ERR to
BIOS_WARNING when mrc_cache_load_current() returns an invalid size
(typically during the first boot or after firmware update).

The failure to load previously saved MRC training data from flash is
often non-fatal, as the system can typically proceed to perform a full
memory training run. Therefore, a warning is more appropriate.

The message is also updated to provide crucial diagnostic information,
including the actual and expected data sizes, which aids in debugging
cache corruption or version mismatch issues.

w/o this patch

```
[ERROR]  Unable to load previous training data.
```

w/ this patch

```
[WARN ]  qclib: Invalid MRC data in flash (size: 0xffffffffffffffff, expected: 0x10000)
```

Change-Id: I810c868adf923e4527abe06a857b15950aa8f17a
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/89315
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
This commit is contained in:
Subrata Banik 2025-09-23 18:08:58 +05:30
commit e3a2d1cecf

View file

@ -259,7 +259,8 @@ void qclib_load_and_run(void)
data_size = mrc_cache_load_current(MRC_TRAINING_DATA, QCLIB_VERSION,
_ddr_training, REGION_SIZE(ddr_training));
if (data_size < 0) {
printk(BIOS_ERR, "Unable to load previous training data.\n");
printk(BIOS_WARNING, "qclib: Invalid MRC data in flash (size: %#zx, expected: %#zx)\n",
data_size, REGION_SIZE(ddr_training));
memset(_ddr_training, 0, REGION_SIZE(ddr_training));
data_size = REGION_SIZE(ddr_training);
}