All of lore.kernel.org
 help / color / mirror / Atom feed
* Early debug UART not working on AM33XX SoC
@ 2022-01-26 14:02 Felix Brack
  2022-01-27 15:05 ` Simon Glass
  0 siblings, 1 reply; 10+ messages in thread
From: Felix Brack @ 2022-01-26 14:02 UTC (permalink / raw)
  To: sjg; +Cc: u-boot

Hello Simon,

I am trying to get the current U-Boot master working on the PDU001
board. This involves the use of an early debug UART.

With commit 0dba4586 (arm: Init the debug UART) the early debug UART on
the AM33XX SoC doesn't work anymore.

By looking at the code involved I believe a call to
setup_clocks_for_console() implemented in clock_am33xx.c before the call
to debug_uart_init() is missing. This is also what happens prior to
commit 0dba4586 by a call to early_system_init() which in turn calls
setup_early_clocks() which then calls setup_clocks_for_console().

My quick and dirty fix consist of inserting a call in crt0.S to
setup_clocks_for_console() just before the call to debug_uart_init()
which was added in commit 0dba4586. I have guarded this call with
#if/#endif testing for CONFIG_AM33XX. The code sequence in crt0.S now
looks like this:

#if defined(CONFIG_DEBUG_UART) && CONFIG_IS_ENABLED(SERIAL)
  #if defined(CONFIG_AM33XX)
    bl setup_clocks_for_console
  #endif
    bl debug_uart_init
#endif

However, from what I understand the crt0.S is for _all_ ARM boards hence
it's probably a bad idea polluting it with such #if/#endif tests for
different SoCs. What do you think?

If my quick and dirty fix is not that dirty I would be happy to send a
patch which would also include the removal of the currently remaining
call to debug_uart_init() in am33xx/board.c

Please apologize my narrow view of the matter dealing only with AM33XX SoCs.

-- 
Felix

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-02-01 17:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26 14:02 Early debug UART not working on AM33XX SoC Felix Brack
2022-01-27 15:05 ` Simon Glass
2022-01-27 16:27   ` Felix Brack
2022-01-27 17:33     ` Simon Glass
2022-01-31  9:43       ` Felix Brack
2022-01-31 16:12         ` Simon Glass
2022-02-01 10:48           ` Felix Brack
2022-02-01 14:05             ` Simon Glass
2022-02-01 16:54               ` Felix Brack
2022-02-01 17:13               ` Felix Brack

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.