Question regarding CONFIG_SPL_OF_PLATDATA_INST usage
Hi Simon,
I'm trying to convert imx28 based XEA board to use CONFIG_DM_SERIAL. This board uses SPL_OF_PLATDATA to have as small SPL as possible.
It looks like the 'duart' description/driver is properly instantiated, but serial console is configured too early -> apparently serial_find_console_or_panic() from serial_init() at serial-uclass.c is called before DM is setup in SPL.
To fix this problem - in the commit (SHA1: 5a1b25c2011) the CONFIG_SPL_OF_PLATDATA_INST has been introduced; without it (after commit SHA1: 1e9ced28f18ed75bef96df08e47baad27dd51829) uclass_get() returns -EDEADLOCK.
Grepping the sources show that only two "boards" use it:
1. arch/x86/cpu/apollolake/Kconfig -> TPL_OF_PLATDATA_INST (configs/chromebook_coral_defconfig and corresponding ./arch/x86/dts/chromebook_coral.dts)
2. configs/sandbox_spl_defconfig -> CONFIG_SPL_OF_PLATDATA_INST=y
I would like to ask if:
- Anybody managed to use CONFIG_SPL_OF_PLATDATA_INST=y on real HW?
- Is it on purpose, that dtoc tool is not extracting structures definitions from *.c files ?
- Is the "coral" board (from point 1 above) using any extra coral*-u-boot.dtsi to specify which parts of dts shall be included to the in-TPL DTS? Or is it just using full-blown DTS support ins TPL?
I'm using cutting-edge mainline u-boot - SHA1:6a11fdf0536e02ac9cd4a3da0535a271c694715f
Thanks in advance for any help.
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: [email protected]
Hi Lukasz,
Quoted 12 lines · Lukasz Majewski
Hi Simon,
I'm trying to convert imx28 based XEA board to use
CONFIG_DM_SERIAL. This board usesSPL_OF_PLATDATAto have as small SPL as possible.It looks like the 'duart' description/driver is properly instantiated, but serial console is configured too early -> apparently
serial_find_console_or_panic()fromserial_init()atserial-uclass.cis called before DM is setup in SPL.
Quoted 4 lines
To fix this problem - in the commit (SHA1:
5a1b25c2011) theCONFIG_SPL_OF_PLATDATA_INSThas been introduced; without it (after commit SHA1:1e9ced28f18ed75bef96df08e47baad27dd51829)uclass_get()returns-EDEADLOCK.
That is not the goal of the _INST feature. The goal is to drop the need for the device_bind() function, thus cutting down the code size of driver model by about 1KB.
To get DM inited early you can call spl_early_init().
Quoted 12 lines
Grepping the sources show that only two "boards" use it:
1.
arch/x86/cpu/apollolake/Kconfig->TPL_OF_PLATDATA_INST(configs/chromebook_coral_defconfig and corresponding./arch/x86/dts/chromebook_coral.dts)2. configs/sandbox_spl_defconfig ->
CONFIG_SPL_OF_PLATDATA_INST=y
Quoted 6 lines
I would like to ask if:
- Anybody managed to use
CONFIG_SPL_OF_PLATDATA_INST=yon real HW?- Is it on purpose, that dtoc tool is not extracting structures definitions from *.c files ?
I don't understand that question, sorry. The docs is at [1] but I suppose you saw that.
Quoted 4 lines
- Is the "coral" board (from point 1 above) using any extra coral*-u-boot.dtsi to specify which parts of dts shall be included to the in-TPL DTS? Or is it just using full-blown DTS support ins TPL?
Yes it is using tags, since we don't want all the devices in TPL. It only has enough to use serial, SPI flash and some early pinmux stuff. You can build it and take a look.
Quoted 6 lines
I'm using cutting-edge mainline u-boot - SHA1:
6a11fdf0536e02ac9cd4a3da0535a271c694715fThanks in advance for any help.
Regards,
Simon