arm-ccn.c (b228ab57e51b62663a80ca820c87ba2650583f08) arm-ccn.c (b91b73a43822566930490e5aa421ccb1900a2124)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 *
4 * Copyright (C) 2014 ARM Limited
5 */
6
7#include <linux/ctype.h>
8#include <linux/hrtimer.h>

--- 201 unchanged lines hidden (view full) ---

210#define CCN_CONFIG_MASK(_config) (((_config) >> 30) & 0xf)
211
212static void arm_ccn_pmu_config_set(u64 *config, u32 node_xp, u32 type, u32 port)
213{
214 *config &= ~((0xff << 0) | (0xff << 8) | (0x3 << 24));
215 *config |= (node_xp << 0) | (type << 8) | (port << 24);
216}
217
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 *
4 * Copyright (C) 2014 ARM Limited
5 */
6
7#include <linux/ctype.h>
8#include <linux/hrtimer.h>

--- 201 unchanged lines hidden (view full) ---

210#define CCN_CONFIG_MASK(_config) (((_config) >> 30) & 0xf)
211
212static void arm_ccn_pmu_config_set(u64 *config, u32 node_xp, u32 type, u32 port)
213{
214 *config &= ~((0xff << 0) | (0xff << 8) | (0x3 << 24));
215 *config |= (node_xp << 0) | (type << 8) | (port << 24);
216}
217
218static ssize_t arm_ccn_pmu_format_show(struct device *dev,
219 struct device_attribute *attr, char *buf)
220{
221 struct dev_ext_attribute *ea = container_of(attr,
222 struct dev_ext_attribute, attr);
223
224 return sysfs_emit(buf, "%s\n", (char *)ea->var);
225}
226
227#define CCN_FORMAT_ATTR(_name, _config) \
228 struct dev_ext_attribute arm_ccn_pmu_format_attr_##_name = \
218#define CCN_FORMAT_ATTR(_name, _config) \
219 struct dev_ext_attribute arm_ccn_pmu_format_attr_##_name = \
229 { __ATTR(_name, S_IRUGO, arm_ccn_pmu_format_show, \
220 { __ATTR(_name, S_IRUGO, device_show_string, \
230 NULL), _config }
231
232static CCN_FORMAT_ATTR(node, "config:0-7");
233static CCN_FORMAT_ATTR(xp, "config:0-7");
234static CCN_FORMAT_ATTR(type, "config:8-15");
235static CCN_FORMAT_ATTR(event, "config:16-23");
236static CCN_FORMAT_ATTR(port, "config:24-25");
237static CCN_FORMAT_ATTR(bus, "config:24-25");

--- 1335 unchanged lines hidden ---
221 NULL), _config }
222
223static CCN_FORMAT_ATTR(node, "config:0-7");
224static CCN_FORMAT_ATTR(xp, "config:0-7");
225static CCN_FORMAT_ATTR(type, "config:8-15");
226static CCN_FORMAT_ATTR(event, "config:16-23");
227static CCN_FORMAT_ATTR(port, "config:24-25");
228static CCN_FORMAT_ATTR(bus, "config:24-25");

--- 1335 unchanged lines hidden ---