[PATCH 2/2] board: tbs2910: Convert to DM_SERIAL

Soeren Moch smoch at web.de
Mon Mar 14 20:22:10 CET 2022


On 14.03.22 19:28, Tom Rini wrote:
> On Mon, Mar 14, 2022 at 12:24:36PM -0600, Simon Glass wrote:
>> Hi Soeren,
>>
>> On Mon, 14 Mar 2022 at 02:26, Soeren Moch <smoch at web.de> wrote:
>>> ... to get rid of the build warning.
>>> Unfortunately we still need the board specific serial pin init code.
>>> Otherwise the first boot messages over the serial console are lost.
>>>
>>> Signed-off-by: Soeren Moch <smoch at web.de>
>>> ---
>>> Cc: Stefano Babic <sbabic at denx.de>
>>> Cc: Fabio Estevam <festevam at gmail.com>
>>> Cc: Tom Rini <trini at konsulko.com>
>>> Cc: Simon Glass <sjg at chromium.org>
>>> Cc: u-boot at lists.denx.de
>>>
>>> The whole purpose of DM is somewhat defeated when we still need board
>>> specific initializations. Any ideas how we can get all boot messages
>>> without board specific inits? 'u-boot,dm-pre-reloc;' in the uart device
>>> tree node did not help.
>> You can put that in your serial driver, perhaps? Or in the initial SoC
>> init code?
Why should I do so? The whole point of DM is initializing devices from
DT. And when I wish to do so pre-relocation, it is advertised in DM to
add 'u-boot,dm-pre-reloc;' for this purpose. I tried, it did not work.
And this is nothing closely related to the serial driver itself, I just
want the pin setup running pre-relocation and not as late as it is
running now under DM_SERIAL.

I also do not want to run this pin setup twice (first in board or SoC
code and again by DM_SERIAL later). Maybe I miss something obvious, but
duplication of the setup code cannot be a proper solution.
>>
>> Another recent way (in -next) is to use events to monitor the
>> EVT_DM_PRE_PROBE event for the serial driver.
I can monitor the probe event, OK. But how can this solve my problem?
Again, maybe I miss something obvious, please tell me when I do so.
> It's just the same thing every single imx platform is doing.
>
Sorry, I don't understand what you mean here. The reference platform for
my board is mx6sabresd. This is not converted to DM_SERIAL yet. Most (?)
imx boards use SPL, pin setup is different there.
I looked into imx boards with DM_SERIAL. They either removed the
board-specific setup code (which results in missing early boot messages:
u-boot version, board name, DDR size, ...) or they are playing tricks in
SPL (not the clean and easy solution that DM promises). Maybe I missed a
better reference for the DM_SERIAL conversion without SPL. Can you point
me to such board?

Thanks,
Soeren


More information about the U-Boot mailing list