ccci_platform.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef _CCCCI_PLATFORM_H_
  2. #define _CCCCI_PLATFORM_H_
  3. #include <mt-plat/sync_write.h>
  4. #include "ccci_config.h"
  5. #include "ccci_core.h"
  6. #define INVALID_ADDR (0xF0000000) /* the last EMI bank, properly not used */
  7. #define KERN_EMI_BASE (0x40000000) /* Bank4 */
  8. /* - AP side, using mcu config base */
  9. /* -- AP Bank4 */
  10. #define AP_BANK4_MAP0 (0) /* ((volatile unsigned int*)(MCUSYS_CFGREG_BASE+0x200)) */
  11. #define AP_BANK4_MAP1 (0) /* ((volatile unsigned int*)(MCUSYS_CFGREG_BASE+0x204)) */
  12. /* - MD side, using infra config base */
  13. #define DBG_FLAG_DEBUG (1<<0)
  14. #define DBG_FLAG_JTAG (1<<1)
  15. #define MD_DBG_JTAG_BIT (1<<0)
  16. #define ccci_write32(b, a, v) mt_reg_sync_writel(v, (b)+(a))
  17. #define ccci_write16(b, a, v) mt_reg_sync_writew(v, (b)+(a))
  18. #define ccci_write8(b, a, v) mt_reg_sync_writeb(v, (b)+(a))
  19. #define ccci_read32(b, a) ioread32((void __iomem *)((b)+(a)))
  20. #define ccci_read16(b, a) ioread16((void __iomem *)((b)+(a)))
  21. #define ccci_read8(b, a) ioread8((void __iomem *)((b)+(a)))
  22. void ccci_clear_md_region_protection(struct ccci_modem *md);
  23. void ccci_set_mem_access_protection(struct ccci_modem *md);
  24. void ccci_set_ap_region_protection(struct ccci_modem *md);
  25. #ifdef ENABLE_DSP_SMEM_SHARE_MPU_REGION
  26. void ccci_set_exp_region_protection(struct ccci_modem *md);
  27. #endif
  28. void ccci_set_mem_remap(struct ccci_modem *md, unsigned long smem_offset, phys_addr_t invalid);
  29. unsigned int ccci_get_md_debug_mode(struct ccci_modem *md);
  30. void ccci_get_platform_version(char *ver);
  31. void ccci_set_dsp_region_protection(struct ccci_modem *md, int loaded);
  32. void ccci_clear_dsp_region_protection(struct ccci_modem *md);
  33. int ccci_plat_common_init(void);
  34. int ccci_platform_init(struct ccci_modem *md);
  35. #define MD_IN_DEBUG(md) ((ccci_get_md_debug_mode(md)&(DBG_FLAG_JTAG|DBG_FLAG_DEBUG)) != 0)
  36. #endif /* _CCCCI_PLATFORM_H_ */