wkup_m3_ipc.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * TI Wakeup M3 for AMx3 SoCs Power Management Routines
  3. *
  4. * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
  5. * Dave Gerlach <d-gerlach@ti.com>
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation version 2.
  10. *
  11. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  12. * kind, whether express or implied; without even the implied warranty
  13. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. */
  16. #ifndef _LINUX_WKUP_M3_IPC_H
  17. #define _LINUX_WKUP_M3_IPC_H
  18. #define WKUP_M3_DEEPSLEEP 1
  19. #define WKUP_M3_STANDBY 2
  20. #define WKUP_M3_IDLE 3
  21. #include <linux/mailbox_client.h>
  22. struct wkup_m3_ipc_ops;
  23. struct wkup_m3_ipc {
  24. struct rproc *rproc;
  25. void __iomem *ipc_mem_base;
  26. struct device *dev;
  27. int mem_type;
  28. unsigned long resume_addr;
  29. int vtt_conf;
  30. int isolation_conf;
  31. int state;
  32. u32 halt;
  33. unsigned long volt_scale_offsets;
  34. const char *sd_fw_name;
  35. struct completion sync_complete;
  36. struct mbox_client mbox_client;
  37. struct mbox_chan *mbox;
  38. struct wkup_m3_ipc_ops *ops;
  39. bool is_rtc_only;
  40. struct dentry *dbg_path;
  41. };
  42. struct wkup_m3_wakeup_src {
  43. int irq_nr;
  44. char src[10];
  45. };
  46. struct wkup_m3_scale_data_header {
  47. u16 magic;
  48. u8 sleep_offset;
  49. u8 wake_offset;
  50. } __packed;
  51. struct wkup_m3_ipc_ops {
  52. void (*set_mem_type)(struct wkup_m3_ipc *m3_ipc, int mem_type);
  53. void (*set_resume_address)(struct wkup_m3_ipc *m3_ipc, void *addr);
  54. int (*prepare_low_power)(struct wkup_m3_ipc *m3_ipc, int state);
  55. int (*finish_low_power)(struct wkup_m3_ipc *m3_ipc);
  56. int (*request_pm_status)(struct wkup_m3_ipc *m3_ipc);
  57. const char *(*request_wake_src)(struct wkup_m3_ipc *m3_ipc);
  58. void (*set_rtc_only)(struct wkup_m3_ipc *m3_ipc);
  59. };
  60. struct wkup_m3_ipc *wkup_m3_ipc_get(void);
  61. void wkup_m3_ipc_put(struct wkup_m3_ipc *m3_ipc);
  62. void wkup_m3_set_rtc_only_mode(void);
  63. #endif /* _LINUX_WKUP_M3_IPC_H */