Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Simon Glass | 932bc4a | 2015-08-30 16:55:28 -0600 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2015 Google, Inc |
Simon Glass | 932bc4a | 2015-08-30 16:55:28 -0600 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef _ASM_ARCH_HARDWARE_H |
| 7 | #define _ASM_ARCH_HARDWARE_H |
| 8 | |
Quentin Schulz | 8b05c18 | 2024-03-11 13:01:57 +0100 | [diff] [blame] | 9 | #include <asm/io.h> |
| 10 | |
Simon Glass | f71eb80 | 2016-01-21 19:45:12 -0700 | [diff] [blame] | 11 | #define RK_CLRSETBITS(clr, set) ((((clr) | (set)) << 16) | (set)) |
Simon Glass | 932bc4a | 2015-08-30 16:55:28 -0600 | [diff] [blame] | 12 | #define RK_SETBITS(set) RK_CLRSETBITS(0, set) |
| 13 | #define RK_CLRBITS(clr) RK_CLRSETBITS(clr, 0) |
| 14 | |
Simon Glass | f71eb80 | 2016-01-21 19:45:12 -0700 | [diff] [blame] | 15 | #define rk_clrsetreg(addr, clr, set) \ |
| 16 | writel(((clr) | (set)) << 16 | (set), addr) |
Simon Glass | 932bc4a | 2015-08-30 16:55:28 -0600 | [diff] [blame] | 17 | #define rk_clrreg(addr, clr) writel((clr) << 16, addr) |
Simon Glass | f71eb80 | 2016-01-21 19:45:12 -0700 | [diff] [blame] | 18 | #define rk_setreg(addr, set) writel((set) << 16 | (set), addr) |
Simon Glass | 932bc4a | 2015-08-30 16:55:28 -0600 | [diff] [blame] | 19 | |
| 20 | #endif |