blob: f8e76e08ebe47e78671369114d1cac0c5a079951 [file] [log] [blame]
Pawel Moll3ecbf052012-09-24 14:55:40 +01001/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License version 2 as
4 * published by the Free Software Foundation.
5 *
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * Copyright (C) 2012 ARM Limited
12 */
13
14#ifndef _LINUX_VEXPRESS_H
15#define _LINUX_VEXPRESS_H
16
17#include <linux/device.h>
Pawel Moll3b9334a2014-04-30 16:46:29 +010018#include <linux/regmap.h>
Pawel Moll3ecbf052012-09-24 14:55:40 +010019
20#define VEXPRESS_SITE_MB 0
21#define VEXPRESS_SITE_DB1 1
22#define VEXPRESS_SITE_DB2 2
23#define VEXPRESS_SITE_MASTER 0xf
24
Pawel Moll3b9334a2014-04-30 16:46:29 +010025/* Config infrastructure */
26
27void vexpress_config_set_master(u32 site);
28u32 vexpress_config_get_master(void);
29
30void vexpress_config_lock(void *arg);
31void vexpress_config_unlock(void *arg);
32
33int vexpress_config_get_topo(struct device_node *node, u32 *site,
34 u32 *position, u32 *dcc);
35
Pawel Moll3ecbf052012-09-24 14:55:40 +010036/* Config bridge API */
37
Pawel Moll3b9334a2014-04-30 16:46:29 +010038struct vexpress_config_bridge_ops {
39 struct regmap * (*regmap_init)(struct device *dev, void *context);
40 void (*regmap_exit)(struct regmap *regmap, void *context);
Pawel Moll3ecbf052012-09-24 14:55:40 +010041};
42
Pawel Moll3b9334a2014-04-30 16:46:29 +010043struct device *vexpress_config_bridge_register(struct device *parent,
44 struct vexpress_config_bridge_ops *ops, void *context);
Pawel Moll3ecbf052012-09-24 14:55:40 +010045
Pawel Moll3b9334a2014-04-30 16:46:29 +010046/* Config regmap API */
Pawel Moll3ecbf052012-09-24 14:55:40 +010047
Pawel Moll3b9334a2014-04-30 16:46:29 +010048struct regmap *devm_regmap_init_vexpress_config(struct device *dev);
Pawel Moll3ecbf052012-09-24 14:55:40 +010049
Pawel Moll88e0abc2012-09-18 12:24:57 +010050/* Platform control */
51
Pawel Moll88e0abc2012-09-18 12:24:57 +010052void vexpress_flags_set(u32 data);
53
Pawel Moll3ecbf052012-09-24 14:55:40 +010054#endif