npe.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __IXP4XX_NPE_H
  3. #define __IXP4XX_NPE_H
  4. #include <linux/kernel.h>
  5. #include <linux/regmap.h>
  6. extern const char *npe_names[];
  7. struct npe_regs {
  8. u32 exec_addr, exec_data, exec_status_cmd, exec_count;
  9. u32 action_points[4];
  10. u32 watchpoint_fifo, watch_count;
  11. u32 profile_count;
  12. u32 messaging_status, messaging_control;
  13. u32 mailbox_status, /*messaging_*/ in_out_fifo;
  14. };
  15. struct npe {
  16. struct npe_regs __iomem *regs;
  17. struct regmap *rmap;
  18. int id;
  19. int valid;
  20. };
  21. static inline const char *npe_name(struct npe *npe)
  22. {
  23. return npe_names[npe->id];
  24. }
  25. int npe_running(struct npe *npe);
  26. int npe_send_message(struct npe *npe, const void *msg, const char *what);
  27. int npe_recv_message(struct npe *npe, void *msg, const char *what);
  28. int npe_send_recv_message(struct npe *npe, void *msg, const char *what);
  29. int npe_load_firmware(struct npe *npe, const char *name, struct device *dev);
  30. struct npe *npe_request(unsigned id);
  31. void npe_release(struct npe *npe);
  32. #endif /* __IXP4XX_NPE_H */