qcom_q6v5.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __QCOM_Q6V5_H__
  6. #define __QCOM_Q6V5_H__
  7. #include <linux/kernel.h>
  8. #include <linux/completion.h>
  9. #define RMB_BOOT_WAIT_REG 0x8
  10. #define RMB_BOOT_CONT_REG 0xC
  11. #define RMB_Q6_BOOT_STATUS_REG 0x10
  12. #define RMB_POLL_MAX_TIMES 250
  13. struct rproc;
  14. struct qcom_smem_state;
  15. struct qcom_sysmon;
  16. struct qcom_q6v5 {
  17. struct device *dev;
  18. struct rproc *rproc;
  19. void __iomem *rmb_base;
  20. struct qcom_smem_state *state;
  21. unsigned stop_bit;
  22. int wdog_irq;
  23. int fatal_irq;
  24. int ready_irq;
  25. int handover_irq;
  26. int stop_irq;
  27. struct rproc_subdev *ssr_subdev;
  28. struct work_struct crash_handler;
  29. bool handover_issued;
  30. struct completion start_done;
  31. struct completion stop_done;
  32. int crash_reason;
  33. bool running;
  34. atomic_t ssr_in_prog;
  35. spinlock_t silent_ssr_lock;
  36. void (*handover)(struct qcom_q6v5 *q6v5);
  37. };
  38. int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
  39. struct rproc *rproc, int crash_reason,
  40. void (*handover)(struct qcom_q6v5 *q6v5));
  41. void qcom_q6v5_register_ssr_subdev(struct qcom_q6v5 *q6v5, struct rproc_subdev *ssr_subdev);
  42. int qcom_q6v5_prepare(struct qcom_q6v5 *q6v5);
  43. int qcom_q6v5_unprepare(struct qcom_q6v5 *q6v5);
  44. int qcom_q6v5_request_stop(struct qcom_q6v5 *q6v5, struct qcom_sysmon *sysmon);
  45. int qcom_q6v5_wait_for_start(struct qcom_q6v5 *q6v5, int timeout);
  46. unsigned long qcom_q6v5_panic(struct qcom_q6v5 *q6v5);
  47. #endif