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