1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * PRU-ICSS Subsystem user interfaces
5 * Copyright (C) 2015-2022 Texas Instruments Incorporated - http://www.ti.com
9 #ifndef __LINUX_PRUSS_H
10 #define __LINUX_PRUSS_H
12 #include <linux/device.h>
13 #include <linux/types.h>
15 #define PRU_RPROC_DRVNAME "pru-rproc"
18 * enum pruss_pru_id - PRU core identifiers
19 * @PRUSS_PRU0: PRU Core 0.
20 * @PRUSS_PRU1: PRU Core 1.
21 * @PRUSS_NUM_PRUS: Total number of PRU Cores available.
32 * enum pru_ctable_idx - Configurable Constant table index identifiers
48 #if IS_ENABLED(CONFIG_PRU_REMOTEPROC)
50 struct rproc *pru_rproc_get(struct device_node *np, int index,
51 enum pruss_pru_id *pru_id);
52 void pru_rproc_put(struct rproc *rproc);
53 int pru_rproc_set_ctable(struct rproc *rproc, enum pru_ctable_idx c, u32 addr);
57 static inline struct rproc *
58 pru_rproc_get(struct device_node *np, int index, enum pruss_pru_id *pru_id)
60 return ERR_PTR(-EOPNOTSUPP);
63 static inline void pru_rproc_put(struct rproc *rproc) { }
65 static inline int pru_rproc_set_ctable(struct rproc *rproc,
66 enum pru_ctable_idx c, u32 addr)
71 #endif /* CONFIG_PRU_REMOTEPROC */
73 static inline bool is_pru_rproc(struct device *dev)
75 const char *drv_name = dev_driver_string(dev);
77 if (strncmp(drv_name, PRU_RPROC_DRVNAME, sizeof(PRU_RPROC_DRVNAME)))
83 #endif /* __LINUX_PRUSS_H */