cldma_platform.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #ifndef __CLDMA_PLATFORM_H__
  2. #define __CLDMA_PLATFORM_H__
  3. /* this is the platform header file for CLDMA MODEM, not just CLDMA! */
  4. /* Modem WDT */
  5. #define WDT_MD_MODE (0x00)
  6. #define WDT_MD_LENGTH (0x04)
  7. #define WDT_MD_RESTART (0x08)
  8. #define WDT_MD_STA (0x0C)
  9. #define WDT_MD_SWRST (0x1C)
  10. #define WDT_MD_MODE_KEY (0x0000220E)
  11. /* CCIF */
  12. #define APCCIF_CON (0x00)
  13. #define APCCIF_BUSY (0x04)
  14. #define APCCIF_START (0x08)
  15. #define APCCIF_TCHNUM (0x0C)
  16. #define APCCIF_RCHNUM (0x10)
  17. #define APCCIF_ACK (0x14)
  18. #define APCCIF_CHDATA (0x100)
  19. #define APCCIF_SRAM_SIZE 512
  20. /* channel usage */
  21. #define EXCEPTION_NONE (0)
  22. /* AP to MD */
  23. #define H2D_EXCEPTION_ACK (1)
  24. #define H2D_EXCEPTION_CLEARQ_ACK (2)
  25. #define H2D_FORCE_MD_ASSERT (3)
  26. /* MD to AP */
  27. #define D2H_EXCEPTION_INIT (1)
  28. #define D2H_EXCEPTION_INIT_DONE (2)
  29. #define D2H_EXCEPTION_CLEARQ_DONE (3)
  30. #define D2H_EXCEPTION_ALLQ_RESET (4)
  31. /* peer */
  32. #define AP_MD_PEER_WAKEUP (5)
  33. #define AP_MD_SEQ_ERROR (6)
  34. struct md_hw_info {
  35. /* HW info - Register Address */
  36. unsigned long cldma_ap_ao_base;
  37. unsigned long cldma_md_ao_base;
  38. unsigned long cldma_ap_pdn_base;
  39. unsigned long cldma_md_pdn_base;
  40. unsigned long md_rgu_base;
  41. unsigned long md_boot_slave_Vector;
  42. unsigned long md_boot_slave_Key;
  43. unsigned long md_boot_slave_En;
  44. unsigned long ap_ccif_base;
  45. unsigned long md_ccif_base;
  46. unsigned int sram_size;
  47. /* HW info - Interrutpt ID */
  48. unsigned int cldma_irq_id;
  49. unsigned int ap_ccif_irq_id;
  50. unsigned int md_wdt_irq_id;
  51. unsigned int ap2md_bus_timeout_irq_id;
  52. /* HW info - Interrupt flags */
  53. unsigned long cldma_irq_flags;
  54. unsigned long ap_ccif_irq_flags;
  55. unsigned long md_wdt_irq_flags;
  56. unsigned long ap2md_bus_timeout_irq_flags;
  57. };
  58. int ccci_modem_remove(struct platform_device *dev);
  59. void ccci_modem_shutdown(struct platform_device *dev);
  60. int ccci_modem_suspend(struct platform_device *dev, pm_message_t state);
  61. int ccci_modem_resume(struct platform_device *dev);
  62. int ccci_modem_pm_suspend(struct device *device);
  63. int ccci_modem_pm_resume(struct device *device);
  64. int ccci_modem_pm_restore_noirq(struct device *device);
  65. int md_cd_power_on(struct ccci_modem *md);
  66. int md_cd_power_off(struct ccci_modem *md, unsigned int timeout);
  67. int md_cd_let_md_go(struct ccci_modem *md);
  68. void md_cd_lock_cldma_clock_src(int locked);
  69. void md_cd_lock_modem_clock_src(int locked);
  70. int md_cd_bootup_cleanup(struct ccci_modem *md, int success);
  71. int md_cd_low_power_notify(struct ccci_modem *md, LOW_POEWR_NOTIFY_TYPE type, int level);
  72. int md_cd_get_modem_hw_info(struct platform_device *dev_ptr, struct ccci_dev_cfg *dev_cfg, struct md_hw_info *hw_info);
  73. int md_cd_io_remap_md_side_register(struct ccci_modem *md);
  74. void md_cd_dump_debug_register(struct ccci_modem *md);
  75. void md_cd_check_emi_state(struct ccci_modem *md, int polling);
  76. void cldma_dump_register(struct ccci_modem *md);
  77. void md_cldma_hw_reset(struct ccci_modem *md);
  78. /* ADD_SYS_CORE */
  79. int ccci_modem_syssuspend(void);
  80. void ccci_modem_sysresume(void);
  81. void md_cd_check_md_DCM(struct ccci_modem *md);
  82. extern unsigned long infra_ao_base;
  83. extern void ccci_mem_dump(int md_id, void *start_addr, int len);
  84. #endif /* __CLDMA_PLATFORM_H__ */