1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * (C) Copyright 2018 - Beniamino Galvani <b.galvani@gmail.com>
4 * (C) Copyright 2018 - BayLibre, SAS
5 * Author: Neil Armstrong <narmstrong@baylibre.com>
18 #define MESON_GATE(id, _reg, _bit) \
32 #define PMASK(width) GENMASK(width - 1, 0)
33 #define SETPMASK(width, shift) GENMASK(shift + width - 1, shift)
34 #define CLRPMASK(width, shift) (~SETPMASK(width, shift))
36 #define PARM_GET(width, shift, reg) \
37 (((reg) & SETPMASK(width, shift)) >> (shift))
38 #define PARM_SET(width, shift, reg, val) \
39 (((reg) & CLRPMASK(width, shift)) | ((val) << (shift)))