Thomas Gleixner | 1802d0b | 2019-05-27 08:55:21 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Pawel Moll | 3ecbf05 | 2012-09-24 14:55:40 +0100 | [diff] [blame] | 2 | /* |
Pawel Moll | 3ecbf05 | 2012-09-24 14:55:40 +0100 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2012 ARM Limited |
| 5 | */ |
| 6 | |
| 7 | #ifndef _LINUX_VEXPRESS_H |
| 8 | #define _LINUX_VEXPRESS_H |
| 9 | |
| 10 | #include <linux/device.h> |
Pawel Moll | 3b9334a | 2014-04-30 16:46:29 +0100 | [diff] [blame] | 11 | #include <linux/regmap.h> |
Pawel Moll | 3ecbf05 | 2012-09-24 14:55:40 +0100 | [diff] [blame] | 12 | |
| 13 | #define VEXPRESS_SITE_MB 0 |
| 14 | #define VEXPRESS_SITE_DB1 1 |
| 15 | #define VEXPRESS_SITE_DB2 2 |
| 16 | #define VEXPRESS_SITE_MASTER 0xf |
| 17 | |
Pawel Moll | 3b9334a | 2014-04-30 16:46:29 +0100 | [diff] [blame] | 18 | /* Config infrastructure */ |
| 19 | |
| 20 | void vexpress_config_set_master(u32 site); |
| 21 | u32 vexpress_config_get_master(void); |
| 22 | |
| 23 | void vexpress_config_lock(void *arg); |
| 24 | void vexpress_config_unlock(void *arg); |
| 25 | |
| 26 | int vexpress_config_get_topo(struct device_node *node, u32 *site, |
| 27 | u32 *position, u32 *dcc); |
| 28 | |
Pawel Moll | 3ecbf05 | 2012-09-24 14:55:40 +0100 | [diff] [blame] | 29 | /* Config bridge API */ |
| 30 | |
Pawel Moll | 3b9334a | 2014-04-30 16:46:29 +0100 | [diff] [blame] | 31 | struct vexpress_config_bridge_ops { |
| 32 | struct regmap * (*regmap_init)(struct device *dev, void *context); |
| 33 | void (*regmap_exit)(struct regmap *regmap, void *context); |
Pawel Moll | 3ecbf05 | 2012-09-24 14:55:40 +0100 | [diff] [blame] | 34 | }; |
| 35 | |
Pawel Moll | 3b9334a | 2014-04-30 16:46:29 +0100 | [diff] [blame] | 36 | struct device *vexpress_config_bridge_register(struct device *parent, |
| 37 | struct vexpress_config_bridge_ops *ops, void *context); |
Pawel Moll | 3ecbf05 | 2012-09-24 14:55:40 +0100 | [diff] [blame] | 38 | |
Pawel Moll | 3b9334a | 2014-04-30 16:46:29 +0100 | [diff] [blame] | 39 | /* Config regmap API */ |
Pawel Moll | 3ecbf05 | 2012-09-24 14:55:40 +0100 | [diff] [blame] | 40 | |
Pawel Moll | 3b9334a | 2014-04-30 16:46:29 +0100 | [diff] [blame] | 41 | struct regmap *devm_regmap_init_vexpress_config(struct device *dev); |
Pawel Moll | 3ecbf05 | 2012-09-24 14:55:40 +0100 | [diff] [blame] | 42 | |
Pawel Moll | 88e0abc | 2012-09-18 12:24:57 +0100 | [diff] [blame] | 43 | /* Platform control */ |
| 44 | |
Pawel Moll | 88e0abc | 2012-09-18 12:24:57 +0100 | [diff] [blame] | 45 | void vexpress_flags_set(u32 data); |
| 46 | |
Pawel Moll | 3ecbf05 | 2012-09-24 14:55:40 +0100 | [diff] [blame] | 47 | #endif |