0057-ar71xx-Add-QCA955X-GPIO-mux-and-function-definitions.patch 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. From: Sven Eckelmann <sven.eckelmann@open-mesh.com>
  2. Date: Wed, 23 Mar 2016 12:52:31 +0000
  3. Subject: ar71xx: Add QCA955X GPIO mux and function definitions
  4. Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
  5. Backport of r49075
  6. Forwarded: https://patchwork.ozlabs.org/patch/624184/
  7. diff --git a/target/linux/ar71xx/patches-3.18/601-MIPS-ath79-add-more-register-defines.patch b/target/linux/ar71xx/patches-3.18/601-MIPS-ath79-add-more-register-defines.patch
  8. index 797977f..0126f6a 100644
  9. --- a/target/linux/ar71xx/patches-3.18/601-MIPS-ath79-add-more-register-defines.patch
  10. +++ b/target/linux/ar71xx/patches-3.18/601-MIPS-ath79-add-more-register-defines.patch
  11. @@ -194,7 +194,7 @@
  12. #define AR933X_BOOTSTRAP_REF_CLK_40 BIT(0)
  13. #define AR934X_BOOTSTRAP_SW_OPTION8 BIT(23)
  14. -@@ -529,6 +626,12 @@
  15. +@@ -529,8 +626,22 @@
  16. #define AR71XX_GPIO_REG_INT_ENABLE 0x24
  17. #define AR71XX_GPIO_REG_FUNC 0x28
  18. @@ -206,8 +206,18 @@
  19. +#define AR934X_GPIO_REG_OUT_FUNC5 0x40
  20. #define AR934X_GPIO_REG_FUNC 0x6c
  21. ++#define QCA955X_GPIO_REG_OUT_FUNC0 0x2c
  22. ++#define QCA955X_GPIO_REG_OUT_FUNC1 0x30
  23. ++#define QCA955X_GPIO_REG_OUT_FUNC2 0x34
  24. ++#define QCA955X_GPIO_REG_OUT_FUNC3 0x38
  25. ++#define QCA955X_GPIO_REG_OUT_FUNC4 0x3c
  26. ++#define QCA955X_GPIO_REG_OUT_FUNC5 0x40
  27. ++#define QCA955X_GPIO_REG_FUNC 0x6c
  28. ++
  29. #define AR71XX_GPIO_COUNT 16
  30. -@@ -560,4 +663,170 @@
  31. + #define AR7240_GPIO_COUNT 18
  32. + #define AR7241_GPIO_COUNT 20
  33. +@@ -560,4 +671,235 @@
  34. #define AR934X_SRIF_DPLL2_OUTDIV_SHIFT 13
  35. #define AR934X_SRIF_DPLL2_OUTDIV_MASK 0x7
  36. @@ -288,6 +298,71 @@
  37. +#define AR934X_GPIO_OUT_EXT_LNA0 46
  38. +#define AR934X_GPIO_OUT_EXT_LNA1 47
  39. +
  40. ++#define QCA955X_GPIO_FUNC_CLK_OBS7_EN BIT(9)
  41. ++#define QCA955X_GPIO_FUNC_CLK_OBS6_EN BIT(8)
  42. ++#define QCA955X_GPIO_FUNC_CLK_OBS5_EN BIT(7)
  43. ++#define QCA955X_GPIO_FUNC_CLK_OBS4_EN BIT(6)
  44. ++#define QCA955X_GPIO_FUNC_CLK_OBS3_EN BIT(5)
  45. ++#define QCA955X_GPIO_FUNC_CLK_OBS2_EN BIT(4)
  46. ++#define QCA955X_GPIO_FUNC_CLK_OBS1_EN BIT(3)
  47. ++#define QCA955X_GPIO_FUNC_JTAG_DISABLE BIT(1)
  48. ++
  49. ++#define QCA955X_GPIO_OUT_GPIO 0
  50. ++#define QCA955X_MII_EXT_MDI 1
  51. ++#define QCA955X_SLIC_DATA_OUT 3
  52. ++#define QCA955X_SLIC_PCM_FS 4
  53. ++#define QCA955X_SLIC_PCM_CLK 5
  54. ++#define QCA955X_SPI_CLK 8
  55. ++#define QCA955X_SPI_CS_0 9
  56. ++#define QCA955X_SPI_CS_1 10
  57. ++#define QCA955X_SPI_CS_2 11
  58. ++#define QCA955X_SPI_MISO 12
  59. ++#define QCA955X_I2S_CLK 13
  60. ++#define QCA955X_I2S_WS 14
  61. ++#define QCA955X_I2S_SD 15
  62. ++#define QCA955X_I2S_MCK 16
  63. ++#define QCA955X_SPDIF_OUT 17
  64. ++#define QCA955X_UART1_TD 18
  65. ++#define QCA955X_UART1_RTS 19
  66. ++#define QCA955X_UART1_RD 20
  67. ++#define QCA955X_UART1_CTS 21
  68. ++#define QCA955X_UART0_SOUT 22
  69. ++#define QCA955X_SPDIF2_OUT 23
  70. ++#define QCA955X_LED_SGMII_SPEED0 24
  71. ++#define QCA955X_LED_SGMII_SPEED1 25
  72. ++#define QCA955X_LED_SGMII_DUPLEX 26
  73. ++#define QCA955X_LED_SGMII_LINK_UP 27
  74. ++#define QCA955X_SGMII_SPEED0_INVERT 28
  75. ++#define QCA955X_SGMII_SPEED1_INVERT 29
  76. ++#define QCA955X_SGMII_DUPLEX_INVERT 30
  77. ++#define QCA955X_SGMII_LINK_UP_INVERT 31
  78. ++#define QCA955X_GE1_MII_MDO 32
  79. ++#define QCA955X_GE1_MII_MDC 33
  80. ++#define QCA955X_SWCOM2 38
  81. ++#define QCA955X_SWCOM3 39
  82. ++#define QCA955X_MAC2_GPIO 40
  83. ++#define QCA955X_MAC3_GPIO 41
  84. ++#define QCA955X_ATT_LED 42
  85. ++#define QCA955X_PWR_LED 43
  86. ++#define QCA955X_TX_FRAME 44
  87. ++#define QCA955X_RX_CLEAR_EXTERNAL 45
  88. ++#define QCA955X_LED_NETWORK_EN 46
  89. ++#define QCA955X_LED_POWER_EN 47
  90. ++#define QCA955X_WMAC_GLUE_WOW 68
  91. ++#define QCA955X_RX_CLEAR_EXTENSION 70
  92. ++#define QCA955X_CP_NAND_CS1 73
  93. ++#define QCA955X_USB_SUSPEND 74
  94. ++#define QCA955X_ETH_TX_ERR 75
  95. ++#define QCA955X_DDR_DQ_OE 76
  96. ++#define QCA955X_CLKREQ_N_EP 77
  97. ++#define QCA955X_CLKREQ_N_RC 78
  98. ++#define QCA955X_CLK_OBS0 79
  99. ++#define QCA955X_CLK_OBS1 80
  100. ++#define QCA955X_CLK_OBS2 81
  101. ++#define QCA955X_CLK_OBS3 82
  102. ++#define QCA955X_CLK_OBS4 83
  103. ++#define QCA955X_CLK_OBS5 84
  104. ++
  105. +/*
  106. + * MII_CTRL block
  107. + */
  108. diff --git a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch
  109. index 0e87357..8a54859 100644
  110. --- a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch
  111. +++ b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch
  112. @@ -37,37 +37,12 @@
  113. + }
  114. - if (gpio >= AR934X_GPIO_COUNT)
  115. +- return;
  116. + if (gpio >= gpio_count)
  117. - return;
  118. ++ return;
  119. - reg = AR934X_GPIO_REG_OUT_FUNC0 + 4 * (gpio / 4);
  120. + reg = reg_base + 4 * (gpio / 4);
  121. s = 8 * (gpio % 4);
  122. spin_lock_irqsave(&ath79_gpio_lock, flags);
  123. ---- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
  124. -+++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
  125. -@@ -875,6 +875,14 @@
  126. - #define QCA953X_GPIO_OUT_MUX_LED_LINK4 44
  127. - #define QCA953X_GPIO_OUT_MUX_LED_LINK5 45
  128. -
  129. -+#define QCA955X_GPIO_REG_OUT_FUNC0 0x2c
  130. -+#define QCA955X_GPIO_REG_OUT_FUNC1 0x30
  131. -+#define QCA955X_GPIO_REG_OUT_FUNC2 0x34
  132. -+#define QCA955X_GPIO_REG_OUT_FUNC3 0x38
  133. -+#define QCA955X_GPIO_REG_OUT_FUNC4 0x3c
  134. -+#define QCA955X_GPIO_REG_OUT_FUNC5 0x40
  135. -+#define QCA955X_GPIO_REG_FUNC 0x6c
  136. -+
  137. - #define QCA956X_GPIO_REG_OUT_FUNC0 0x2c
  138. - #define QCA956X_GPIO_REG_OUT_FUNC1 0x30
  139. - #define QCA956X_GPIO_REG_OUT_FUNC2 0x34
  140. -@@ -1014,6 +1022,8 @@
  141. - #define AR934X_GPIO_OUT_EXT_LNA0 46
  142. - #define AR934X_GPIO_OUT_EXT_LNA1 47
  143. -
  144. -+#define QCA955X_GPIO_OUT_GPIO 0
  145. -+
  146. - /*
  147. - * MII_CTRL block
  148. - */