[U-Boot] re-use dm data for pre-relocate and post-relocate

Kever Yang kever.yang at rock-chips.com
Tue Nov 21 10:24:46 UTC 2017


Hi Simon,

     In order to make people easier to maintain a U-Boot for product,

we want to re-use the dtb from kernel. Some peripheral like power/pmic

and display panel, key, charger which need work in U-Boot and may different

in different product, we want to make people only maintain kernel dts, 
but not

one more U-Boot project for all these devices.

I want to do this just around the

relocate, need to read dtb from storage like emmc/nand/spi, and then use

a new dtb for initr_dm after relocate.

     Here are issues I have met:

- The kernel dts may not have a stdout in chosen, we may use earlycon, 
earlyprintk instead;

     this lead to U-Boot can not find a serial driver after relocate;

- no alias for mmc device which is need by  U-Boot but not used in kernel;

- not able to init mmc driver twice with current driver;

     mmc driver not able to work before relocate, no bss for (static int 
initialized), and hang even

     if I skip this;

     mmc driver can init and read dtb before initr_dm, but not able to 
init again after initr_dm.


In fact, I don't think we have to re-init serial driver and mmc driver, 
and most other driver which

need pre-relocate like clock, the only driver I have seem have different 
use in pre-relocate and post-relocate

is video driver(no idea why it have to be pre-relocate, we always have 
display very late),

can we add a tag for re-use the dm driver data for those with pre-relocate ?


Thanks,

- Kever




More information about the U-Boot mailing list