npe.h 1021 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __IXP4XX_NPE_H
  3. #define __IXP4XX_NPE_H
  4. #include <linux/kernel.h>
  5. extern const char *npe_names[];
  6. struct npe_regs {
  7. u32 exec_addr, exec_data, exec_status_cmd, exec_count;
  8. u32 action_points[4];
  9. u32 watchpoint_fifo, watch_count;
  10. u32 profile_count;
  11. u32 messaging_status, messaging_control;
  12. u32 mailbox_status, /*messaging_*/ in_out_fifo;
  13. };
  14. struct npe {
  15. struct resource *mem_res;
  16. struct npe_regs __iomem *regs;
  17. u32 regs_phys;
  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 */