blob: 0ab01d51f997db967e2dbfff97972854be827ec9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (c) 2025-2026 TQ-Systems GmbH <[email protected]>,
* D-82229 Seefeld, Germany.
* Author: Alexander Feilke, Max Merchel
*/
#ifndef __TQ_SOM_H
#define __TQ_SOM_H
#include <init.h>
#include <asm/io.h>
#include <linux/iopoll.h>
void tq_som_ram_init(void);
/* used as a wrapper to write to specific register addresses */
static inline void tq_som_init_write_reg(u32 address, u32 value)
{
writel_relaxed(value, address);
}
/*
* checks if the accessible range equals the requested ram size.
* returns true if successful, false otherwise
*/
bool tq_som_ram_check_size(long ram_size);
static inline void tq_som_check_bits_set(u32 address, u32 mask)
{
u32 val;
readl_poll_timeout(address, val, (val & mask) == mask, 1000);
}
#endif /* __TQ_SOM_H */
|