[PATCH 2/2] imx6-mmdc: Revert calibration configuration on failure

Ahmad Fatoum a.fatoum at pengutronix.de
Tue Jan 24 04:07:55 PST 2023


On 24.01.23 13:01, John Watts wrote:
> On Tue, Jan 24, 2023 at 09:29:02AM +0100, Ahmad Fatoum wrote:
>>>  int mmdc_do_write_level_calibration(void)
>>>  {
>>> +	u32 ldectrl[4] = {0};
>>
>> Initial value never read back.
>>
> 
> Remove the = {0}?

Ye.

> 
>>>  	/* check for any errors on both PHYs */
>>> -	if (wlcalib_failed(P0_IPS) || wlcalib_failed(P1_IPS))
>>> +	if (wlcalib_failed(P0_IPS) || wlcalib_failed(P1_IPS)) {
>>> +		pr_debug("Calibration failed, rolling back calibration data\n");
>>
>> Still you only restore P0 calibration data, even if it succeeded,
>> but P1 failed. Is this intended?
> 
> Not quite sure what you mean. I restore both P0 and P1 calibration data I
> think?

Was a bit too early for me. I overlooked this somwhow.

> 
> If you're asking whether it is correct behaviour to REVERT all calibration
> data, instead of for each channel, I'm not sure. It seems like the safest
> thing to do to me since it's unclear why the calibration process has failed.
> 
> This is the behaviour U-Boot does and seems to work in the wild.

Sorry for the noise,
Ahmad

> 
> John.
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




More information about the barebox mailing list