On Wed, Mar 20, 2019 at 1:16 AM Sascha Hauer <s.ha...@pengutronix.de> wrote: > > On Tue, Mar 19, 2019 at 11:12:19AM -0700, Andrey Smirnov wrote: > > On Wed, Mar 13, 2019 at 3:27 AM Sascha Hauer <s.ha...@pengutronix.de> wrote: > > > > > > PBL often needs a way to udelay execution. Since we have a generic timer > > > in ARMv8 we can implement a generic udelay. > > > > > > > Now that get_cntpct() and get_cntfrq() are implemented for ARMv7 we > > can probably extend this to both ARMv8 and ARMv7. > > Yes, we could do this. The problem is that this works only on ARMv7 > cores that have this timer. What about the others? PBL code that depends > on udelay() can then only run on these cores. Arguably we already have > this problem when I introduce the symbol for ARMv8, but it probably gets > worse when we start using udelay in more places in PBL. > Any idea for a way to implement a udelay for the older cores? >
Yeah, throwing ARMv4 and ARMv5 into the mix does complicate this. The only solution that I can think of so far, would be to keep udealy() a static inline, header-only function and then strategically include that header in places that we know are ARMv7 only. As for ARMv4 and v5, I can't think of a universal way of implementing a delay function, so there's probably not much that we can do there. Anyway, my original message was just a suggestion, having this function even for just ARMv8 is an improvement already. Thanks, Andrey Smirnov _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox