ahb.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* SPDX-License-Identifier: ISC */
  2. /*
  3. * Copyright (c) 2016 Qualcomm Atheros, Inc. All rights reserved.
  4. * Copyright (c) 2015 The Linux Foundation. All rights reserved.
  5. */
  6. #ifndef _AHB_H_
  7. #define _AHB_H_
  8. #include <linux/platform_device.h>
  9. struct ath10k_ahb {
  10. struct platform_device *pdev;
  11. void __iomem *mem;
  12. unsigned long mem_len;
  13. void __iomem *gcc_mem;
  14. void __iomem *tcsr_mem;
  15. int irq;
  16. struct clk *cmd_clk;
  17. struct clk *ref_clk;
  18. struct clk *rtc_clk;
  19. struct reset_control *core_cold_rst;
  20. struct reset_control *radio_cold_rst;
  21. struct reset_control *radio_warm_rst;
  22. struct reset_control *radio_srif_rst;
  23. struct reset_control *cpu_init_rst;
  24. };
  25. #ifdef CONFIG_ATH10K_AHB
  26. #define ATH10K_GCC_REG_BASE 0x1800000
  27. #define ATH10K_GCC_REG_SIZE 0x60000
  28. #define ATH10K_TCSR_REG_BASE 0x1900000
  29. #define ATH10K_TCSR_REG_SIZE 0x80000
  30. #define ATH10K_AHB_GCC_FEPLL_PLL_DIV 0x2f020
  31. #define ATH10K_AHB_WIFI_SCRATCH_5_REG 0x4f014
  32. #define ATH10K_AHB_WLAN_CORE_ID_REG 0x82030
  33. #define ATH10K_AHB_TCSR_WIFI0_GLB_CFG 0x49000
  34. #define ATH10K_AHB_TCSR_WIFI1_GLB_CFG 0x49004
  35. #define TCSR_WIFIX_GLB_CFG_DISABLE_CORE_CLK BIT(25)
  36. #define ATH10K_AHB_TCSR_WCSS0_HALTREQ 0x52000
  37. #define ATH10K_AHB_TCSR_WCSS1_HALTREQ 0x52010
  38. #define ATH10K_AHB_TCSR_WCSS0_HALTACK 0x52004
  39. #define ATH10K_AHB_TCSR_WCSS1_HALTACK 0x52014
  40. #define ATH10K_AHB_AXI_BUS_HALT_TIMEOUT 10 /* msec */
  41. #define AHB_AXI_BUS_HALT_REQ 1
  42. #define AHB_AXI_BUS_HALT_ACK 1
  43. #define ATH10K_AHB_CORE_CTRL_CPU_INTR_MASK 1
  44. int ath10k_ahb_init(void);
  45. void ath10k_ahb_exit(void);
  46. #else /* CONFIG_ATH10K_AHB */
  47. static inline int ath10k_ahb_init(void)
  48. {
  49. return 0;
  50. }
  51. static inline void ath10k_ahb_exit(void)
  52. {
  53. }
  54. #endif /* CONFIG_ATH10K_AHB */
  55. #endif /* _AHB_H_ */