.. | .. |
---|
1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
---|
| 2 | +#include <linux/of.h> |
---|
| 3 | +#include <linux/of_address.h> |
---|
2 | 4 | #include <asm/mach/arch.h> |
---|
3 | 5 | |
---|
4 | 6 | #include "core.h" |
---|
5 | 7 | |
---|
| 8 | +#define SYS_FLAGSSET 0x030 |
---|
| 9 | +#define SYS_FLAGSCLR 0x034 |
---|
| 10 | + |
---|
| 11 | +void vexpress_flags_set(u32 data) |
---|
| 12 | +{ |
---|
| 13 | + static void __iomem *base; |
---|
| 14 | + |
---|
| 15 | + if (!base) { |
---|
| 16 | + struct device_node *node = of_find_compatible_node(NULL, NULL, |
---|
| 17 | + "arm,vexpress-sysreg"); |
---|
| 18 | + |
---|
| 19 | + base = of_iomap(node, 0); |
---|
| 20 | + } |
---|
| 21 | + |
---|
| 22 | + if (WARN_ON(!base)) |
---|
| 23 | + return; |
---|
| 24 | + |
---|
| 25 | + writel(~0, base + SYS_FLAGSCLR); |
---|
| 26 | + writel(data, base + SYS_FLAGSSET); |
---|
| 27 | +} |
---|
| 28 | + |
---|
6 | 29 | static const char * const v2m_dt_match[] __initconst = { |
---|
7 | 30 | "arm,vexpress", |
---|
8 | 31 | NULL, |
---|