How to debug HW startup?

Sean Anderson seanga2 at gmail.com
Sun Jan 12 00:58:03 CET 2020


On 1/11/20 4:38 PM, Mauro Condarelli wrote:
> Thanks Joel,
> unfortunately I already have that defined, even if I forgot to copy it.
> I attach my full .config for reference as I have no idea what I'm
> still missing.
> 
> On 1/11/20 9:42 PM, Sean Anderson wrote:
>>> Could You share a Linkit  _defconfig with early serial debug enabled?
>>> I'm decidedly missing something as, even enabling
>>>
>>> CONFIG_DEBUG_UART=y
>>> CONFIG_DEBUG_UART_BASE=0x10000e00
>>> CONFIG_DEBUG_UART_CLOCK=20
>>> CONFIG_DEBUG_UART_SHIFT=2
>>> CONFIG_DEBUG_UART_ANNOUNCE=y

So it looks like your clock is way too low. The unit for the clock is
Hz. From the device tree you sent, this board is based off
arch/mips/dts/mt7628a.dtsi, using uart2. The clock controller for this
board is compatible with "mediatek,mt7628-clk", and the driver is
located in "drivers/clk/mtmips/clk-mt7628.c". From that file, the uart2
clock gets its frequency from CLK_SRC_PERI. Under mt7628_clk_get_rate,
the peripheral clock source depends on the value of
PERI_CLK_FROM_XTAL_SEL, which is initialized to 0 (as documented in the
data sheet). Therefore, the else clause is taken (unless configured
otherwise), so you should use 40000000 for your clock.

>> You need to pick a debug uart driver, e.g. CONFIG_DEBUG_UART_NS16550.
> As said I have it, but I'm not sure about the other parameters.
> Maybe a better choice would be CONFIG_DEBUG_UART_MTK.
> Having a "known good" configuration would help a lot.
> 
> Regards
> Mauro
> 




More information about the U-Boot mailing list