1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2021-2022 Digiteq Automotive
4 * author: Martin Tuma <martin.tuma@digiteqautomotive.com>
7 #ifndef __MGB4_REGS_H__
8 #define __MGB4_REGS_H__
13 resource_size_t mapbase
;
14 resource_size_t mapsize
;
15 void __iomem
*membase
;
18 #define mgb4_write_reg(regs, offset, val) \
19 iowrite32(val, (regs)->membase + (offset))
20 #define mgb4_read_reg(regs, offset) \
21 ioread32((regs)->membase + (offset))
23 static inline void mgb4_mask_reg(struct mgb4_regs
*regs
, u32 reg
, u32 mask
,
26 u32 ret
= mgb4_read_reg(regs
, reg
);
29 mgb4_write_reg(regs
, reg
, val
);
32 int mgb4_regs_map(struct resource
*res
, struct mgb4_regs
*regs
);
33 void mgb4_regs_free(struct mgb4_regs
*regs
);