ahb.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * Copyright (c) 2016 Qualcomm Atheros, Inc. All rights reserved.
  3. * Copyright (c) 2015 The Linux Foundation. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. #ifndef _AHB_H_
  18. #define _AHB_H_
  19. #include <linux/platform_device.h>
  20. struct ath10k_ahb {
  21. struct platform_device *pdev;
  22. void __iomem *mem;
  23. unsigned long mem_len;
  24. void __iomem *gcc_mem;
  25. void __iomem *tcsr_mem;
  26. int irq;
  27. struct clk *cmd_clk;
  28. struct clk *ref_clk;
  29. struct clk *rtc_clk;
  30. struct reset_control *core_cold_rst;
  31. struct reset_control *radio_cold_rst;
  32. struct reset_control *radio_warm_rst;
  33. struct reset_control *radio_srif_rst;
  34. struct reset_control *cpu_init_rst;
  35. };
  36. #ifdef CONFIG_ATH10K_AHB
  37. #define ATH10K_GCC_REG_BASE 0x1800000
  38. #define ATH10K_GCC_REG_SIZE 0x60000
  39. #define ATH10K_TCSR_REG_BASE 0x1900000
  40. #define ATH10K_TCSR_REG_SIZE 0x80000
  41. #define ATH10K_AHB_GCC_FEPLL_PLL_DIV 0x2f020
  42. #define ATH10K_AHB_WIFI_SCRATCH_5_REG 0x4f014
  43. #define ATH10K_AHB_WLAN_CORE_ID_REG 0x82030
  44. #define ATH10K_AHB_TCSR_WIFI0_GLB_CFG 0x49000
  45. #define ATH10K_AHB_TCSR_WIFI1_GLB_CFG 0x49004
  46. #define TCSR_WIFIX_GLB_CFG_DISABLE_CORE_CLK BIT(25)
  47. #define ATH10K_AHB_TCSR_WCSS0_HALTREQ 0x52000
  48. #define ATH10K_AHB_TCSR_WCSS1_HALTREQ 0x52010
  49. #define ATH10K_AHB_TCSR_WCSS0_HALTACK 0x52004
  50. #define ATH10K_AHB_TCSR_WCSS1_HALTACK 0x52014
  51. #define ATH10K_AHB_AXI_BUS_HALT_TIMEOUT 10 /* msec */
  52. #define AHB_AXI_BUS_HALT_REQ 1
  53. #define AHB_AXI_BUS_HALT_ACK 1
  54. #define ATH10K_AHB_CORE_CTRL_CPU_INTR_MASK 1
  55. int ath10k_ahb_init(void);
  56. void ath10k_ahb_exit(void);
  57. #else /* CONFIG_ATH10K_AHB */
  58. static inline int ath10k_ahb_init(void)
  59. {
  60. return 0;
  61. }
  62. static inline void ath10k_ahb_exit(void)
  63. {
  64. }
  65. #endif /* CONFIG_ATH10K_AHB */
  66. #endif /* _AHB_H_ */