* iMX ddrphy_utils difference with U-boot
@ 2026-06-08 14:24 Andrei Lalaev
2026-06-08 17:26 ` Ahmad Fatoum
2026-06-11 20:35 ` Ahmad Fatoum
0 siblings, 2 replies; 7+ messages in thread
From: Andrei Lalaev @ 2026-06-08 14:24 UTC (permalink / raw)
To: barebox
Hi,
I am moving an iMX8MP module from vendor U-Boot 2024.04 to Barebox 2025.02
and found a strange difference in the DDR training code:
vim drivers/ddr/imx/ddrphy_utils.c +94
And the corresponding line in U-Boot:
vim drivers/ddr/imx/phy/ddrphy_utils.c +101
Is there any chance that somebody knows/remembers why "return -1" was replaced with "hang()"?
I couldn't find any explanation in the commits/mailing lists.
Thanks a lot!
--
Best regards,
Andrei Lalaev
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: iMX ddrphy_utils difference with U-boot
2026-06-08 14:24 iMX ddrphy_utils difference with U-boot Andrei Lalaev
@ 2026-06-08 17:26 ` Ahmad Fatoum
2026-06-08 18:15 ` Andrei Lalaev
2026-06-15 8:49 ` Sascha Hauer
2026-06-11 20:35 ` Ahmad Fatoum
1 sibling, 2 replies; 7+ messages in thread
From: Ahmad Fatoum @ 2026-06-08 17:26 UTC (permalink / raw)
To: Andrei Lalaev, barebox
Hello Andrei,
On 6/8/26 16:24, Andrei Lalaev wrote:
> Hi,
>
> I am moving an iMX8MP module from vendor U-Boot 2024.04 to Barebox 2025.02
Sidenote: You'll probably want to use one of the still supported
v2026.04 or v2026.06 releases.
> and found a strange difference in the DDR training code:
>
> vim drivers/ddr/imx/ddrphy_utils.c +94
>
> And the corresponding line in U-Boot:
>
> vim drivers/ddr/imx/phy/ddrphy_utils.c +101
>
> Is there any chance that somebody knows/remembers why "return -1" was replaced with "hang()"?
I can't speak for Sascha, but having looked at the code, I see no reason
why not to propagate the error.
> I couldn't find any explanation in the commits/mailing lists.
My guess is that it wasn't anticipated that boards would handle
the error gracefully to fall back to a different DDR init.
Cheers,
Ahmad
>
> Thanks a lot!
>
> --
> Best regards,
> Andrei Lalaev
>
>
>
--
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 |
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: iMX ddrphy_utils difference with U-boot
2026-06-08 17:26 ` Ahmad Fatoum
@ 2026-06-08 18:15 ` Andrei Lalaev
2026-06-08 19:12 ` Ahmad Fatoum
2026-06-15 8:49 ` Sascha Hauer
1 sibling, 1 reply; 7+ messages in thread
From: Andrei Lalaev @ 2026-06-08 18:15 UTC (permalink / raw)
To: Ahmad Fatoum, barebox
Hi Ahmad,
Thank you for your quick reply.
On 08.06.26 19:26, Ahmad Fatoum wrote:
> Hello Andrei,
>
> On 6/8/26 16:24, Andrei Lalaev wrote:
>> Hi,
>>
>> I am moving an iMX8MP module from vendor U-Boot 2024.04 to Barebox 2025.02
>
> Sidenote: You'll probably want to use one of the still supported
> v2026.04 or v2026.06 releases.
>
That's our plan for the near future :)
>> and found a strange difference in the DDR training code:
>>
>> vim drivers/ddr/imx/ddrphy_utils.c +94
>>
>> And the corresponding line in U-Boot:
>>
>> vim drivers/ddr/imx/phy/ddrphy_utils.c +101
>>
>> Is there any chance that somebody knows/remembers why "return -1" was replaced with "hang()"?
>
> I can't speak for Sascha, but having looked at the code, I see no reason
> why not to propagate the error.
>
>> I couldn't find any explanation in the commits/mailing lists.
>
> My guess is that it wasn't anticipated that boards would handle
> the error gracefully to fall back to a different DDR init.
>
In our case this is the only option, because we may have 2 and 4 GB modules.
So, if the 4 GB timings don't apply, we fall back to the 2 GB timings.
> Cheers,
> Ahmad
--
Best regards,
Andrei Lalaev
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: iMX ddrphy_utils difference with U-boot
2026-06-08 18:15 ` Andrei Lalaev
@ 2026-06-08 19:12 ` Ahmad Fatoum
0 siblings, 0 replies; 7+ messages in thread
From: Ahmad Fatoum @ 2026-06-08 19:12 UTC (permalink / raw)
To: Andrei Lalaev, barebox
Hi,
On 6/8/26 20:15, Andrei Lalaev wrote:
> Hi Ahmad,
>
> Thank you for your quick reply.
>
> On 08.06.26 19:26, Ahmad Fatoum wrote:
>> Hello Andrei,
>>
>> On 6/8/26 16:24, Andrei Lalaev wrote:
>>> Hi,
>>>
>>> I am moving an iMX8MP module from vendor U-Boot 2024.04 to Barebox 2025.02
>>
>> Sidenote: You'll probably want to use one of the still supported
>> v2026.04 or v2026.06 releases.
>>
>
> That's our plan for the near future :)
>
>
>>> and found a strange difference in the DDR training code:
>>>
>>> vim drivers/ddr/imx/ddrphy_utils.c +94
>>>
>>> And the corresponding line in U-Boot:
>>>
>>> vim drivers/ddr/imx/phy/ddrphy_utils.c +101
>>>
>>> Is there any chance that somebody knows/remembers why "return -1" was replaced with "hang()"?
>>
>> I can't speak for Sascha, but having looked at the code, I see no reason
>> why not to propagate the error.
>>
>>> I couldn't find any explanation in the commits/mailing lists.
>>
>> My guess is that it wasn't anticipated that boards would handle
>> the error gracefully to fall back to a different DDR init.
>>
>
> In our case this is the only option, because we may have 2 and 4 GB modules.
> So, if the 4 GB timings don't apply, we fall back to the 2 GB timings.
Send a patch and we continue the discussion there?
Cheers,
Ahmad
>
>
>> Cheers,
>> Ahmad
>
>
--
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 |
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: iMX ddrphy_utils difference with U-boot
2026-06-08 14:24 iMX ddrphy_utils difference with U-boot Andrei Lalaev
2026-06-08 17:26 ` Ahmad Fatoum
@ 2026-06-11 20:35 ` Ahmad Fatoum
2026-06-11 20:36 ` Ahmad Fatoum
1 sibling, 1 reply; 7+ messages in thread
From: Ahmad Fatoum @ 2026-06-11 20:35 UTC (permalink / raw)
To: Andrei Lalaev, barebox
Hello Andrei,
On 6/8/26 16:24, Andrei Lalaev wrote:
> Hi,
>
> I am moving an iMX8MP module from vendor U-Boot 2024.04 to Barebox 2025.02
> and found a strange difference in the DDR training code:
>
> vim drivers/ddr/imx/ddrphy_utils.c +94
>
> And the corresponding line in U-Boot:
>
> vim drivers/ddr/imx/phy/ddrphy_utils.c +101
>
> Is there any chance that somebody knows/remembers why "return -1" was replaced with "hang()"?
>
> I couldn't find any explanation in the commits/mailing lists.
>
> Thanks a lot!
>
> --
> Best regards,
> Andrei Lalaev
>
>
>
--
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 |
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: iMX ddrphy_utils difference with U-boot
2026-06-11 20:35 ` Ahmad Fatoum
@ 2026-06-11 20:36 ` Ahmad Fatoum
0 siblings, 0 replies; 7+ messages in thread
From: Ahmad Fatoum @ 2026-06-11 20:36 UTC (permalink / raw)
To: Andrei Lalaev, barebox
sorry for the noise. Sent a draft instead of discarding it :/
On 6/11/26 22:35, Ahmad Fatoum wrote:
> Hello Andrei,
>
> On 6/8/26 16:24, Andrei Lalaev wrote:
>> Hi,
>>
>> I am moving an iMX8MP module from vendor U-Boot 2024.04 to Barebox 2025.02
>> and found a strange difference in the DDR training code:
>>
>> vim drivers/ddr/imx/ddrphy_utils.c +94
>>
>> And the corresponding line in U-Boot:
>>
>> vim drivers/ddr/imx/phy/ddrphy_utils.c +101
>>
>> Is there any chance that somebody knows/remembers why "return -1" was replaced with "hang()"?
>
>
>
>>
>> I couldn't find any explanation in the commits/mailing lists.
>>
>> Thanks a lot!
>>
>> --
>> Best regards,
>> Andrei Lalaev
>>
>>
>>
>
>
--
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 |
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: iMX ddrphy_utils difference with U-boot
2026-06-08 17:26 ` Ahmad Fatoum
2026-06-08 18:15 ` Andrei Lalaev
@ 2026-06-15 8:49 ` Sascha Hauer
1 sibling, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2026-06-15 8:49 UTC (permalink / raw)
To: Ahmad Fatoum; +Cc: Andrei Lalaev, barebox
On 2026-06-08 19:26, Ahmad Fatoum wrote:
> Hello Andrei,
>
> On 6/8/26 16:24, Andrei Lalaev wrote:
> > Hi,
> >
> > I am moving an iMX8MP module from vendor U-Boot 2024.04 to Barebox 2025.02
>
> Sidenote: You'll probably want to use one of the still supported
> v2026.04 or v2026.06 releases.
>
> > and found a strange difference in the DDR training code:
> >
> > vim drivers/ddr/imx/ddrphy_utils.c +94
> >
> > And the corresponding line in U-Boot:
> >
> > vim drivers/ddr/imx/phy/ddrphy_utils.c +101
> >
> > Is there any chance that somebody knows/remembers why "return -1" was replaced with "hang()"?
>
> I can't speak for Sascha, but having looked at the code, I see no reason
> why not to propagate the error.
>
> > I couldn't find any explanation in the commits/mailing lists.
>
> My guess is that it wasn't anticipated that boards would handle
> the error gracefully to fall back to a different DDR init.
That's my guess as well. Note the callers of
imx8m_wait_ddrphy_training_complete() which is only a wrapper around
calling wait_ddrphy_training_complete() do not check the error code, so
when changing it back to return an error code we likely want to add
error checking where missing.
Sascha
--
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 |
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-06-15 8:50 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-08 14:24 iMX ddrphy_utils difference with U-boot Andrei Lalaev
2026-06-08 17:26 ` Ahmad Fatoum
2026-06-08 18:15 ` Andrei Lalaev
2026-06-08 19:12 ` Ahmad Fatoum
2026-06-15 8:49 ` Sascha Hauer
2026-06-11 20:35 ` Ahmad Fatoum
2026-06-11 20:36 ` Ahmad Fatoum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox