i.MX8/9: question about unused DDR PHY trained CSR board array

Ahmad Fatoum a.fatoum at pengutronix.de
Fri Sep 27 16:08:00 CEST 2024


Hello Peng,

Looking at the DDR setup code for i.MX8M and i.MX9 that you had contributed,
I am wondering about struct dram_cfg_param::ddrphy_trained_csr and the global
ddrphy_trained_csr array.

struct dram_cfg_param::ddrphy_trained_csr is presumably generated by the
i.MX DDR tool and it seems populated by all the i.MX8M/9 boards in U-Boot.

This struct member is wholly unused though and instead a global
ddrphy_trained_csr is used.

What I wonder about is whether it's possible for the DDR tool to generate
a different ddrphy_trained_csr than the default:

  1) If yes, we should drop the global ddrphy_trained_csr and actually use
     the board-specific array

  2) If not, we should drop the board-specific array and perhaps ask for
    the DDR tool to be changed

I initially assumed 1) and because all boards supported by barebox had a
board-specific ddrphy_trained_csr that's identical to the global
ddrphy_trained_csr, I dropped the unused array[1][2].

I now have the DDR settings for an i.MX9 LPDDR4 board in front of me that
has different contents for struct dram_cfg_param::ddrphy_trained_csr than
the default.

I will inquire how that came about, but in parallel I wanted to ask you if
this is supposed to happen and to alert you to this issue.

The way things are, this is either a bug or a missed space saving opportunity
for U-Boot.

[1]: https://lore.barebox.org/barebox/20231205083604.1497018-1-a.fatoum@pengutronix.de/
[2]: https://lore.barebox.org/barebox/20240313154217.2747582-1-a.fatoum@pengutronix.de/

Thanks,
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 |



More information about the U-Boot mailing list