rsi_boot_params.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /**
  2. * Copyright (c) 2014 Redpine Signals Inc.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef __RSI_BOOTPARAMS_HEADER_H__
  17. #define __RSI_BOOTPARAMS_HEADER_H__
  18. #define CRYSTAL_GOOD_TIME BIT(0)
  19. #define BOOTUP_MODE_INFO BIT(1)
  20. #define WIFI_TAPLL_CONFIGS BIT(5)
  21. #define WIFI_PLL960_CONFIGS BIT(6)
  22. #define WIFI_AFEPLL_CONFIGS BIT(7)
  23. #define WIFI_SWITCH_CLK_CONFIGS BIT(8)
  24. #define TA_PLL_M_VAL_20 9
  25. #define TA_PLL_N_VAL_20 0
  26. #define TA_PLL_P_VAL_20 4
  27. #define PLL960_M_VAL_20 0x14
  28. #define PLL960_N_VAL_20 0
  29. #define PLL960_P_VAL_20 5
  30. #define UMAC_CLK_40MHZ 80
  31. #define TA_PLL_M_VAL_40 9
  32. #define TA_PLL_N_VAL_40 0
  33. #define TA_PLL_P_VAL_40 4
  34. #define PLL960_M_VAL_40 0x14
  35. #define PLL960_N_VAL_40 0
  36. #define PLL960_P_VAL_40 5
  37. #define UMAC_CLK_20BW \
  38. (((TA_PLL_M_VAL_20 + 1) * 40) / \
  39. ((TA_PLL_N_VAL_20 + 1) * (TA_PLL_P_VAL_20 + 1)))
  40. #define VALID_20 \
  41. (WIFI_TAPLL_CONFIGS | WIFI_PLL960_CONFIGS | WIFI_AFEPLL_CONFIGS | \
  42. WIFI_SWITCH_CLK_CONFIGS | BOOTUP_MODE_INFO | CRYSTAL_GOOD_TIME)
  43. #define UMAC_CLK_40BW \
  44. (((TA_PLL_M_VAL_40 + 1) * 40) / \
  45. ((TA_PLL_N_VAL_40 + 1) * (TA_PLL_P_VAL_40 + 1)))
  46. #define VALID_40 \
  47. (WIFI_PLL960_CONFIGS | WIFI_AFEPLL_CONFIGS | WIFI_SWITCH_CLK_CONFIGS | \
  48. WIFI_TAPLL_CONFIGS | CRYSTAL_GOOD_TIME | BOOTUP_MODE_INFO)
  49. /* structure to store configs related to TAPLL programming */
  50. struct tapll_info {
  51. __le16 pll_reg_1;
  52. __le16 pll_reg_2;
  53. } __packed;
  54. /* structure to store configs related to PLL960 programming */
  55. struct pll960_info {
  56. __le16 pll_reg_1;
  57. __le16 pll_reg_2;
  58. __le16 pll_reg_3;
  59. } __packed;
  60. /* structure to store configs related to AFEPLL programming */
  61. struct afepll_info {
  62. __le16 pll_reg;
  63. } __packed;
  64. /* structure to store configs related to pll configs */
  65. struct pll_config {
  66. struct tapll_info tapll_info_g;
  67. struct pll960_info pll960_info_g;
  68. struct afepll_info afepll_info_g;
  69. } __packed;
  70. /* structure to store configs related to UMAC clk programming */
  71. struct switch_clk {
  72. __le16 switch_clk_info;
  73. /* If switch_bbp_lmac_clk_reg is set then this value will be programmed
  74. * into reg
  75. */
  76. __le16 bbp_lmac_clk_reg_val;
  77. /* if switch_umac_clk is set then this value will be programmed */
  78. __le16 umac_clock_reg_config;
  79. /* if switch_qspi_clk is set then this value will be programmed */
  80. __le16 qspi_uart_clock_reg_config;
  81. } __packed;
  82. struct device_clk_info {
  83. struct pll_config pll_config_g;
  84. struct switch_clk switch_clk_g;
  85. } __packed;
  86. struct bootup_params {
  87. __le16 magic_number;
  88. __le16 crystal_good_time;
  89. __le32 valid;
  90. __le32 reserved_for_valids;
  91. __le16 bootup_mode_info;
  92. /* configuration used for digital loop back */
  93. __le16 digital_loop_back_params;
  94. __le16 rtls_timestamp_en;
  95. __le16 host_spi_intr_cfg;
  96. struct device_clk_info device_clk_info[3];
  97. /* ulp buckboost wait time */
  98. __le32 buckboost_wakeup_cnt;
  99. /* pmu wakeup wait time & WDT EN info */
  100. __le16 pmu_wakeup_wait;
  101. u8 shutdown_wait_time;
  102. /* Sleep clock source selection */
  103. u8 pmu_slp_clkout_sel;
  104. /* WDT programming values */
  105. __le32 wdt_prog_value;
  106. /* WDT soc reset delay */
  107. __le32 wdt_soc_rst_delay;
  108. /* dcdc modes configs */
  109. __le32 dcdc_operation_mode;
  110. __le32 soc_reset_wait_cnt;
  111. __le32 waiting_time_at_fresh_sleep;
  112. __le32 max_threshold_to_avoid_sleep;
  113. u8 beacon_resedue_alg_en;
  114. } __packed;
  115. #endif