coresight.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2012, 2020-2021, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _LINUX_CORESIGHT_H
  6. #define _LINUX_CORESIGHT_H
  7. #include <linux/device.h>
  8. #include <linux/io.h>
  9. #include <linux/perf_event.h>
  10. #include <linux/sched.h>
  11. #include <linux/android_kabi.h>
  12. /* Peripheral id registers (0xFD0-0xFEC) */
  13. #define CORESIGHT_PERIPHIDR4 0xfd0
  14. #define CORESIGHT_PERIPHIDR5 0xfd4
  15. #define CORESIGHT_PERIPHIDR6 0xfd8
  16. #define CORESIGHT_PERIPHIDR7 0xfdC
  17. #define CORESIGHT_PERIPHIDR0 0xfe0
  18. #define CORESIGHT_PERIPHIDR1 0xfe4
  19. #define CORESIGHT_PERIPHIDR2 0xfe8
  20. #define CORESIGHT_PERIPHIDR3 0xfeC
  21. /* Component id registers (0xFF0-0xFFC) */
  22. #define CORESIGHT_COMPIDR0 0xff0
  23. #define CORESIGHT_COMPIDR1 0xff4
  24. #define CORESIGHT_COMPIDR2 0xff8
  25. #define CORESIGHT_COMPIDR3 0xffC
  26. #define ETM_ARCH_V3_3 0x23
  27. #define ETM_ARCH_V3_5 0x25
  28. #define PFT_ARCH_V1_0 0x30
  29. #define PFT_ARCH_V1_1 0x31
  30. #define CORESIGHT_UNLOCK 0xc5acce55
  31. extern struct bus_type coresight_bustype;
  32. enum coresight_dev_type {
  33. CORESIGHT_DEV_TYPE_SINK,
  34. CORESIGHT_DEV_TYPE_LINK,
  35. CORESIGHT_DEV_TYPE_LINKSINK,
  36. CORESIGHT_DEV_TYPE_SOURCE,
  37. CORESIGHT_DEV_TYPE_HELPER,
  38. CORESIGHT_DEV_TYPE_ECT,
  39. };
  40. enum coresight_dev_subtype_sink {
  41. CORESIGHT_DEV_SUBTYPE_SINK_PORT,
  42. CORESIGHT_DEV_SUBTYPE_SINK_BUFFER,
  43. CORESIGHT_DEV_SUBTYPE_SINK_SYSMEM,
  44. CORESIGHT_DEV_SUBTYPE_SINK_PERCPU_SYSMEM,
  45. };
  46. enum coresight_dev_subtype_link {
  47. CORESIGHT_DEV_SUBTYPE_LINK_MERG,
  48. CORESIGHT_DEV_SUBTYPE_LINK_SPLIT,
  49. CORESIGHT_DEV_SUBTYPE_LINK_FIFO,
  50. };
  51. enum coresight_dev_subtype_source {
  52. CORESIGHT_DEV_SUBTYPE_SOURCE_PROC,
  53. CORESIGHT_DEV_SUBTYPE_SOURCE_BUS,
  54. CORESIGHT_DEV_SUBTYPE_SOURCE_SOFTWARE,
  55. };
  56. enum coresight_dev_subtype_helper {
  57. CORESIGHT_DEV_SUBTYPE_HELPER_CATU,
  58. };
  59. /* Embedded Cross Trigger (ECT) sub-types */
  60. enum coresight_dev_subtype_ect {
  61. CORESIGHT_DEV_SUBTYPE_ECT_NONE,
  62. CORESIGHT_DEV_SUBTYPE_ECT_CTI,
  63. };
  64. /**
  65. * union coresight_dev_subtype - further characterisation of a type
  66. * @sink_subtype: type of sink this component is, as defined
  67. * by @coresight_dev_subtype_sink.
  68. * @link_subtype: type of link this component is, as defined
  69. * by @coresight_dev_subtype_link.
  70. * @source_subtype: type of source this component is, as defined
  71. * by @coresight_dev_subtype_source.
  72. * @helper_subtype: type of helper this component is, as defined
  73. * by @coresight_dev_subtype_helper.
  74. * @ect_subtype: type of cross trigger this component is, as
  75. * defined by @coresight_dev_subtype_ect
  76. */
  77. union coresight_dev_subtype {
  78. /* We have some devices which acts as LINK and SINK */
  79. struct {
  80. enum coresight_dev_subtype_sink sink_subtype;
  81. enum coresight_dev_subtype_link link_subtype;
  82. };
  83. enum coresight_dev_subtype_source source_subtype;
  84. enum coresight_dev_subtype_helper helper_subtype;
  85. enum coresight_dev_subtype_ect ect_subtype;
  86. };
  87. /**
  88. * struct coresight_platform_data - data harvested from the firmware
  89. * specification.
  90. *
  91. * @nr_inport: Number of elements for the input connections.
  92. * @nr_outport: Number of elements for the output connections.
  93. * @conns: Sparse array of nr_outport connections from this component.
  94. */
  95. struct coresight_platform_data {
  96. int nr_inport;
  97. int nr_outport;
  98. struct coresight_connection *conns;
  99. };
  100. /**
  101. * struct csdev_access - Abstraction of a CoreSight device access.
  102. *
  103. * @io_mem : True if the device has memory mapped I/O
  104. * @base : When io_mem == true, base address of the component
  105. * @read : Read from the given "offset" of the given instance.
  106. * @write : Write "val" to the given "offset".
  107. */
  108. struct csdev_access {
  109. bool io_mem;
  110. union {
  111. void __iomem *base;
  112. struct {
  113. u64 (*read)(u32 offset, bool relaxed, bool _64bit);
  114. void (*write)(u64 val, u32 offset, bool relaxed,
  115. bool _64bit);
  116. };
  117. };
  118. };
  119. #define CSDEV_ACCESS_IOMEM(_addr) \
  120. ((struct csdev_access) { \
  121. .io_mem = true, \
  122. .base = (_addr), \
  123. })
  124. /**
  125. * struct coresight_desc - description of a component required from drivers
  126. * @type: as defined by @coresight_dev_type.
  127. * @subtype: as defined by @coresight_dev_subtype.
  128. * @ops: generic operations for this component, as defined
  129. * by @coresight_ops.
  130. * @pdata: platform data collected from DT.
  131. * @dev: The device entity associated to this component.
  132. * @groups: operations specific to this component. These will end up
  133. * in the component's sysfs sub-directory.
  134. * @name: name for the coresight device, also shown under sysfs.
  135. * @access: Describe access to the device
  136. */
  137. struct coresight_desc {
  138. enum coresight_dev_type type;
  139. union coresight_dev_subtype subtype;
  140. const struct coresight_ops *ops;
  141. struct coresight_platform_data *pdata;
  142. struct device *dev;
  143. const struct attribute_group **groups;
  144. const char *name;
  145. struct csdev_access access;
  146. ANDROID_KABI_RESERVE(1);
  147. };
  148. /**
  149. * struct coresight_connection - representation of a single connection
  150. * @outport: a connection's output port number.
  151. * @child_port: remote component's port number @output is connected to.
  152. * @source_name: source component's name.
  153. * @chid_fwnode: remote component's fwnode handle.
  154. * @child_dev: a @coresight_device representation of the component
  155. connected to @outport.
  156. * @link: Representation of the connection as a sysfs link.
  157. */
  158. struct coresight_connection {
  159. int outport;
  160. int child_port;
  161. const char *source_name;
  162. struct fwnode_handle *child_fwnode;
  163. struct coresight_device *child_dev;
  164. struct coresight_sysfs_link *link;
  165. ANDROID_KABI_RESERVE(1);
  166. };
  167. /**
  168. * struct coresight_sysfs_link - representation of a connection in sysfs.
  169. * @orig: Originating (master) coresight device for the link.
  170. * @orig_name: Name to use for the link orig->target.
  171. * @target: Target (slave) coresight device for the link.
  172. * @target_name: Name to use for the link target->orig.
  173. */
  174. struct coresight_sysfs_link {
  175. struct coresight_device *orig;
  176. const char *orig_name;
  177. struct coresight_device *target;
  178. const char *target_name;
  179. };
  180. /**
  181. * struct coresight_device - representation of a device as used by the framework
  182. * @pdata: Platform data with device connections associated to this device.
  183. * @type: as defined by @coresight_dev_type.
  184. * @subtype: as defined by @coresight_dev_subtype.
  185. * @ops: generic operations for this component, as defined
  186. * by @coresight_ops.
  187. * @access: Device i/o access abstraction for this device.
  188. * @dev: The device entity associated to this component.
  189. * @refcnt: keep track of what is in use.
  190. * @orphan: true if the component has connections that haven't been linked.
  191. * @enable: 'true' if component is currently part of an active path.
  192. * @activated: 'true' only if a _sink_ has been activated. A sink can be
  193. * activated but not yet enabled. Enabling for a _sink_
  194. * happens when a source has been selected and a path is enabled
  195. * from source to that sink.
  196. * @ea: Device attribute for sink representation under PMU directory.
  197. * @def_sink: cached reference to default sink found for this device.
  198. * @ect_dev: Associated cross trigger device. Not part of the trace data
  199. * path or connections.
  200. * @nr_links: number of sysfs links created to other components from this
  201. * device. These will appear in the "connections" group.
  202. * @has_conns_grp: Have added a "connections" group for sysfs links.
  203. * @feature_csdev_list: List of complex feature programming added to the device.
  204. * @config_csdev_list: List of system configurations added to the device.
  205. * @cscfg_csdev_lock: Protect the lists of configurations and features.
  206. * @active_cscfg_ctxt: Context information for current active system configuration.
  207. */
  208. struct coresight_device {
  209. struct coresight_platform_data *pdata;
  210. enum coresight_dev_type type;
  211. union coresight_dev_subtype subtype;
  212. const struct coresight_ops *ops;
  213. struct csdev_access access;
  214. struct device dev;
  215. atomic_t *refcnt;
  216. bool orphan;
  217. bool enable; /* true only if configured as part of a path */
  218. /* sink specific fields */
  219. bool activated; /* true only if a sink is part of a path */
  220. struct dev_ext_attribute *ea;
  221. struct coresight_device *def_sink;
  222. /* cross trigger handling */
  223. struct coresight_device *ect_dev;
  224. /* sysfs links between components */
  225. int nr_links;
  226. bool has_conns_grp;
  227. bool ect_enabled; /* true only if associated ect device is enabled */
  228. /* system configuration and feature lists */
  229. struct list_head feature_csdev_list;
  230. struct list_head config_csdev_list;
  231. spinlock_t cscfg_csdev_lock;
  232. void *active_cscfg_ctxt;
  233. ANDROID_KABI_RESERVE(1);
  234. ANDROID_KABI_RESERVE(2);
  235. };
  236. /*
  237. * coresight_dev_list - Mapping for devices to "name" index for device
  238. * names.
  239. *
  240. * @nr_idx: Number of entries already allocated.
  241. * @pfx: Prefix pattern for device name.
  242. * @fwnode_list: Array of fwnode_handles associated with each allocated
  243. * index, upto nr_idx entries.
  244. */
  245. struct coresight_dev_list {
  246. int nr_idx;
  247. const char *pfx;
  248. struct fwnode_handle **fwnode_list;
  249. };
  250. #define DEFINE_CORESIGHT_DEVLIST(var, dev_pfx) \
  251. static struct coresight_dev_list (var) = { \
  252. .pfx = dev_pfx, \
  253. .nr_idx = 0, \
  254. .fwnode_list = NULL, \
  255. }
  256. #define to_coresight_device(d) container_of(d, struct coresight_device, dev)
  257. #define source_ops(csdev) csdev->ops->source_ops
  258. #define sink_ops(csdev) csdev->ops->sink_ops
  259. #define link_ops(csdev) csdev->ops->link_ops
  260. #define helper_ops(csdev) csdev->ops->helper_ops
  261. #define ect_ops(csdev) csdev->ops->ect_ops
  262. /**
  263. * struct coresight_ops_sink - basic operations for a sink
  264. * Operations available for sinks
  265. * @enable: enables the sink.
  266. * @disable: disables the sink.
  267. * @alloc_buffer: initialises perf's ring buffer for trace collection.
  268. * @free_buffer: release memory allocated in @get_config.
  269. * @update_buffer: update buffer pointers after a trace session.
  270. */
  271. struct coresight_ops_sink {
  272. int (*enable)(struct coresight_device *csdev, u32 mode, void *data);
  273. int (*disable)(struct coresight_device *csdev);
  274. void *(*alloc_buffer)(struct coresight_device *csdev,
  275. struct perf_event *event, void **pages,
  276. int nr_pages, bool overwrite);
  277. void (*free_buffer)(void *config);
  278. unsigned long (*update_buffer)(struct coresight_device *csdev,
  279. struct perf_output_handle *handle,
  280. void *sink_config);
  281. ANDROID_KABI_RESERVE(1);
  282. };
  283. /**
  284. * struct coresight_ops_link - basic operations for a link
  285. * Operations available for links.
  286. * @enable: enables flow between iport and oport.
  287. * @disable: disables flow between iport and oport.
  288. */
  289. struct coresight_ops_link {
  290. int (*enable)(struct coresight_device *csdev, int iport, int oport);
  291. void (*disable)(struct coresight_device *csdev, int iport, int oport);
  292. };
  293. /**
  294. * struct coresight_ops_source - basic operations for a source
  295. * Operations available for sources.
  296. * @cpu_id: returns the value of the CPU number this component
  297. * is associated to.
  298. * @trace_id: returns the value of the component's trace ID as known
  299. * to the HW.
  300. * @enable: enables tracing for a source.
  301. * @disable: disables tracing for a source.
  302. */
  303. struct coresight_ops_source {
  304. int (*cpu_id)(struct coresight_device *csdev);
  305. int (*trace_id)(struct coresight_device *csdev);
  306. int (*enable)(struct coresight_device *csdev,
  307. struct perf_event *event, u32 mode);
  308. void (*disable)(struct coresight_device *csdev,
  309. struct perf_event *event);
  310. ANDROID_KABI_RESERVE(1);
  311. };
  312. /**
  313. * struct coresight_ops_helper - Operations for a helper device.
  314. *
  315. * All operations could pass in a device specific data, which could
  316. * help the helper device to determine what to do.
  317. *
  318. * @enable : Enable the device
  319. * @disable : Disable the device
  320. */
  321. struct coresight_ops_helper {
  322. int (*enable)(struct coresight_device *csdev, void *data);
  323. int (*disable)(struct coresight_device *csdev, void *data);
  324. };
  325. /**
  326. * struct coresight_ops_ect - Ops for an embedded cross trigger device
  327. *
  328. * @enable : Enable the device
  329. * @disable : Disable the device
  330. */
  331. struct coresight_ops_ect {
  332. int (*enable)(struct coresight_device *csdev);
  333. int (*disable)(struct coresight_device *csdev);
  334. };
  335. struct coresight_ops {
  336. const struct coresight_ops_sink *sink_ops;
  337. const struct coresight_ops_link *link_ops;
  338. const struct coresight_ops_source *source_ops;
  339. const struct coresight_ops_helper *helper_ops;
  340. const struct coresight_ops_ect *ect_ops;
  341. ANDROID_KABI_RESERVE(1);
  342. };
  343. #if IS_ENABLED(CONFIG_CORESIGHT)
  344. static inline u32 csdev_access_relaxed_read32(struct csdev_access *csa,
  345. u32 offset)
  346. {
  347. if (likely(csa->io_mem))
  348. return readl_relaxed(csa->base + offset);
  349. return csa->read(offset, true, false);
  350. }
  351. static inline u64 csdev_access_relaxed_read_pair(struct csdev_access *csa,
  352. u32 lo_offset, u32 hi_offset)
  353. {
  354. if (likely(csa->io_mem)) {
  355. return readl_relaxed(csa->base + lo_offset) |
  356. ((u64)readl_relaxed(csa->base + hi_offset) << 32);
  357. }
  358. return csa->read(lo_offset, true, false) | (csa->read(hi_offset, true, false) << 32);
  359. }
  360. static inline void csdev_access_relaxed_write_pair(struct csdev_access *csa, u64 val,
  361. u32 lo_offset, u32 hi_offset)
  362. {
  363. if (likely(csa->io_mem)) {
  364. writel_relaxed((u32)val, csa->base + lo_offset);
  365. writel_relaxed((u32)(val >> 32), csa->base + hi_offset);
  366. } else {
  367. csa->write((u32)val, lo_offset, true, false);
  368. csa->write((u32)(val >> 32), hi_offset, true, false);
  369. }
  370. }
  371. static inline u32 csdev_access_read32(struct csdev_access *csa, u32 offset)
  372. {
  373. if (likely(csa->io_mem))
  374. return readl(csa->base + offset);
  375. return csa->read(offset, false, false);
  376. }
  377. static inline void csdev_access_relaxed_write32(struct csdev_access *csa,
  378. u32 val, u32 offset)
  379. {
  380. if (likely(csa->io_mem))
  381. writel_relaxed(val, csa->base + offset);
  382. else
  383. csa->write(val, offset, true, false);
  384. }
  385. static inline void csdev_access_write32(struct csdev_access *csa, u32 val, u32 offset)
  386. {
  387. if (likely(csa->io_mem))
  388. writel(val, csa->base + offset);
  389. else
  390. csa->write(val, offset, false, false);
  391. }
  392. #ifdef CONFIG_64BIT
  393. static inline u64 csdev_access_relaxed_read64(struct csdev_access *csa,
  394. u32 offset)
  395. {
  396. if (likely(csa->io_mem))
  397. return readq_relaxed(csa->base + offset);
  398. return csa->read(offset, true, true);
  399. }
  400. static inline u64 csdev_access_read64(struct csdev_access *csa, u32 offset)
  401. {
  402. if (likely(csa->io_mem))
  403. return readq(csa->base + offset);
  404. return csa->read(offset, false, true);
  405. }
  406. static inline void csdev_access_relaxed_write64(struct csdev_access *csa,
  407. u64 val, u32 offset)
  408. {
  409. if (likely(csa->io_mem))
  410. writeq_relaxed(val, csa->base + offset);
  411. else
  412. csa->write(val, offset, true, true);
  413. }
  414. static inline void csdev_access_write64(struct csdev_access *csa, u64 val, u32 offset)
  415. {
  416. if (likely(csa->io_mem))
  417. writeq(val, csa->base + offset);
  418. else
  419. csa->write(val, offset, false, true);
  420. }
  421. #else /* !CONFIG_64BIT */
  422. static inline u64 csdev_access_relaxed_read64(struct csdev_access *csa,
  423. u32 offset)
  424. {
  425. WARN_ON(1);
  426. return 0;
  427. }
  428. static inline u64 csdev_access_read64(struct csdev_access *csa, u32 offset)
  429. {
  430. WARN_ON(1);
  431. return 0;
  432. }
  433. static inline void csdev_access_relaxed_write64(struct csdev_access *csa,
  434. u64 val, u32 offset)
  435. {
  436. WARN_ON(1);
  437. }
  438. static inline void csdev_access_write64(struct csdev_access *csa, u64 val, u32 offset)
  439. {
  440. WARN_ON(1);
  441. }
  442. #endif /* CONFIG_64BIT */
  443. static inline bool coresight_is_percpu_source(struct coresight_device *csdev)
  444. {
  445. return csdev && (csdev->type == CORESIGHT_DEV_TYPE_SOURCE) &&
  446. (csdev->subtype.source_subtype == CORESIGHT_DEV_SUBTYPE_SOURCE_PROC);
  447. }
  448. static inline bool coresight_is_percpu_sink(struct coresight_device *csdev)
  449. {
  450. return csdev && (csdev->type == CORESIGHT_DEV_TYPE_SINK) &&
  451. (csdev->subtype.sink_subtype == CORESIGHT_DEV_SUBTYPE_SINK_PERCPU_SYSMEM);
  452. }
  453. extern struct coresight_device *
  454. coresight_register(struct coresight_desc *desc);
  455. extern void coresight_unregister(struct coresight_device *csdev);
  456. extern int coresight_enable(struct coresight_device *csdev);
  457. extern void coresight_disable(struct coresight_device *csdev);
  458. extern int coresight_timeout(struct csdev_access *csa, u32 offset,
  459. int position, int value);
  460. extern int coresight_claim_device(struct coresight_device *csdev);
  461. extern int coresight_claim_device_unlocked(struct coresight_device *csdev);
  462. extern void coresight_disclaim_device(struct coresight_device *csdev);
  463. extern void coresight_disclaim_device_unlocked(struct coresight_device *csdev);
  464. extern char *coresight_alloc_device_name(struct coresight_dev_list *devs,
  465. struct device *dev);
  466. extern bool coresight_loses_context_with_cpu(struct device *dev);
  467. u32 coresight_relaxed_read32(struct coresight_device *csdev, u32 offset);
  468. u32 coresight_read32(struct coresight_device *csdev, u32 offset);
  469. void coresight_write32(struct coresight_device *csdev, u32 val, u32 offset);
  470. void coresight_relaxed_write32(struct coresight_device *csdev,
  471. u32 val, u32 offset);
  472. u64 coresight_relaxed_read64(struct coresight_device *csdev, u32 offset);
  473. u64 coresight_read64(struct coresight_device *csdev, u32 offset);
  474. void coresight_relaxed_write64(struct coresight_device *csdev,
  475. u64 val, u32 offset);
  476. void coresight_write64(struct coresight_device *csdev, u64 val, u32 offset);
  477. #else
  478. static inline struct coresight_device *
  479. coresight_register(struct coresight_desc *desc) { return NULL; }
  480. static inline void coresight_unregister(struct coresight_device *csdev) {}
  481. static inline int
  482. coresight_enable(struct coresight_device *csdev) { return -ENOSYS; }
  483. static inline void coresight_disable(struct coresight_device *csdev) {}
  484. static inline int coresight_timeout(struct csdev_access *csa, u32 offset,
  485. int position, int value)
  486. {
  487. return 1;
  488. }
  489. static inline int coresight_claim_device_unlocked(struct coresight_device *csdev)
  490. {
  491. return -EINVAL;
  492. }
  493. static inline int coresight_claim_device(struct coresight_device *csdev)
  494. {
  495. return -EINVAL;
  496. }
  497. static inline void coresight_disclaim_device(struct coresight_device *csdev) {}
  498. static inline void coresight_disclaim_device_unlocked(struct coresight_device *csdev) {}
  499. static inline bool coresight_loses_context_with_cpu(struct device *dev)
  500. {
  501. return false;
  502. }
  503. static inline u32 coresight_relaxed_read32(struct coresight_device *csdev, u32 offset)
  504. {
  505. WARN_ON_ONCE(1);
  506. return 0;
  507. }
  508. static inline u32 coresight_read32(struct coresight_device *csdev, u32 offset)
  509. {
  510. WARN_ON_ONCE(1);
  511. return 0;
  512. }
  513. static inline void coresight_write32(struct coresight_device *csdev, u32 val, u32 offset)
  514. {
  515. }
  516. static inline void coresight_relaxed_write32(struct coresight_device *csdev,
  517. u32 val, u32 offset)
  518. {
  519. }
  520. static inline u64 coresight_relaxed_read64(struct coresight_device *csdev,
  521. u32 offset)
  522. {
  523. WARN_ON_ONCE(1);
  524. return 0;
  525. }
  526. static inline u64 coresight_read64(struct coresight_device *csdev, u32 offset)
  527. {
  528. WARN_ON_ONCE(1);
  529. return 0;
  530. }
  531. static inline void coresight_relaxed_write64(struct coresight_device *csdev,
  532. u64 val, u32 offset)
  533. {
  534. }
  535. static inline void coresight_write64(struct coresight_device *csdev, u64 val, u32 offset)
  536. {
  537. }
  538. #endif /* IS_ENABLED(CONFIG_CORESIGHT) */
  539. extern int coresight_get_cpu(struct device *dev);
  540. struct coresight_platform_data *coresight_get_platform_data(struct device *dev);
  541. #endif /* _LINUX_COREISGHT_H */