arm: Simple delay function because of an chicken and egg problem

Johannes (krjdev) Krottmayer krjdev at gmail.com
Wed Mar 2 22:06:36 CET 2022


Hi,

I'm running into an chicken and egg problem when modifying
(fixing) some drivers for STMicroelectronics SoC's.

The problem, I will implement a timeout, when accessing some
registers. Unfortunately I cannot use the basic mdelay() or
higher level functions, which use this function, because
there on these SoC's there isn't setup and enabled the timer
before. Also the ARMv7-M SysTick timer will not be used.

I could write a simple delay loop which counts down at the
frequency from the processor speed. But I think, this is
not a good idea.

Any suggestion, what I can do? I'm still new in U-Boot,
so I don't know if there a simple delay function exists.

Thanks in advance!

Johannes K.


More information about the U-Boot mailing list