Searched hist:"7 a1970f4ad497c9f83595fc321f58aa58549e369" (Results 1 – 1 of 1) sorted by relevance
| /rk3399_ARM-atf/include/lib/ |
| H A D | mmio_poll.h | 7a1970f4ad497c9f83595fc321f58aa58549e369 Wed May 21 06:24:44 UTC 2025 Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com> feat(lib): add mmio read with timeout
In several cases, drivers poll a register using a blocking 'while' or 'for' loop without a timeout mechanism. Introducing a timeout would be beneficial, as it allows the system to log an error and delegate the decision to the caller - whether to continue execution or halt with a panic.
To address this, the mmio_read_poll_timeout() helper can be used. It exits with -ETIMEDOUT if the timeout is reached, or 0 on success. Additionally, the final value read from the register is stored in the 'val' variable, avoiding the need for an extra read after polling completes.
Change-Id: I2ef53299b12ece6bc7be0e1234d5c2708e36ecf9 Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
|