[PATCH v2 2/8] board/tq: Add common SoM API
Feilke, Alexander
alexander.feilke at ew.tq-group.com
Wed Mar 25 14:20:34 CET 2026
On 25.03.2026 at 12:25 Peng Fan wrote:
> On Wed, Mar 25, 2026 at 10:57:55AM +0100, Alexander Feilke wrote:
>> From: Alexander Feilke <alexander.feilke at ew.tq-group.com>
>>
>> Reduce code duplication by adding a default implementation.
>>
>> Signed-off-by: Alexander Feilke <alexander.feilke at ew.tq-group.com>
>> Signed-off-by: Max Merchel <Max.Merchel at ew.tq-group.com>
>> ---
>> +static inline void tq_som_check_bits_set(u32 address, u32 mask)
>> +{
>> + while ((readl(address) & mask) != mask)
>> + ;
> You may need to use readl_poll_timeout API.
>
> Regards
> Peng
Thanks for the suggestion. I successfully tested the patch below with
all our RAM variants.
You may apply it directly or I can send a v3 if you prefer that.
---
diff --git a/board/tq/common/tq_som.h b/board/tq/common/tq_som.h
index d7168eb7e46..0ab01d51f99 100644
--- a/board/tq/common/tq_som.h
+++ b/board/tq/common/tq_som.h
@@ -10,6 +10,7 @@
#include <init.h>
#include <asm/io.h>
+#include <linux/iopoll.h>
void tq_som_ram_init(void);
@@ -27,8 +28,8 @@ bool tq_som_ram_check_size(long ram_size);
static inline void tq_som_check_bits_set(u32 address, u32 mask)
{
- while ((readl(address) & mask) != mask)
- ;
+ u32 val;
+ readl_poll_timeout(address, val, (val & mask) == mask, 1000);
}
#endif /* __TQ_SOM_H */
More information about the U-Boot
mailing list