0018-ar71xx-rework-patch-for-qca953x-956x.patch 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Thu, 6 Aug 2015 03:01:47 +0200
  3. Subject: ar71xx: rework patch for qca953x/956x
  4. Patch cherry-picked from the following location:
  5. https://www.codeaurora.org/cgit/quic/qsdk/oss/system/openwrt/commit/?h=release/coconut_ioe4531_2.0&id=5c357bf6c763e4140dddcc9a3bc5f005525a9c0e
  6. Changelist,
  7. - add more register defines
  8. - add EHCI support
  9. - fix GPIO pin count to 18
  10. - fix chained irq disabled
  11. - fix GMAC0/GMAC1 initial
  12. - fix WMAC irq number to 47
  13. - merge the changes of dev-eth.c from the patch to file.
  14. Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org>
  15. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
  16. diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
  17. index ae3db4c..ff94e2e 100644
  18. --- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
  19. +++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
  20. @@ -198,6 +198,8 @@ void __init ath79_register_mdio(unsigned int id, u32 phy_mask)
  21. case ATH79_SOC_AR9330:
  22. case ATH79_SOC_AR9331:
  23. case ATH79_SOC_QCA9533:
  24. + case ATH79_SOC_QCA9561:
  25. + case ATH79_SOC_TP9343:
  26. mdio_dev = &ath79_mdio1_device;
  27. mdio_data = &ath79_mdio1_data;
  28. break;
  29. @@ -256,6 +258,8 @@ void __init ath79_register_mdio(unsigned int id, u32 phy_mask)
  30. break;
  31. case ATH79_SOC_QCA9533:
  32. + case ATH79_SOC_QCA9561:
  33. + case ATH79_SOC_TP9343:
  34. mdio_data->builtin_switch = 1;
  35. break;
  36. @@ -571,6 +575,8 @@ static void __init ath79_init_eth_pll_data(unsigned int id)
  37. case ATH79_SOC_QCA9533:
  38. case ATH79_SOC_QCA9556:
  39. case ATH79_SOC_QCA9558:
  40. + case ATH79_SOC_QCA9561:
  41. + case ATH79_SOC_TP9343:
  42. pll_10 = AR934X_PLL_VAL_10;
  43. pll_100 = AR934X_PLL_VAL_100;
  44. pll_1000 = AR934X_PLL_VAL_1000;
  45. @@ -627,6 +633,8 @@ static int __init ath79_setup_phy_if_mode(unsigned int id,
  46. case ATH79_SOC_AR9330:
  47. case ATH79_SOC_AR9331:
  48. case ATH79_SOC_QCA9533:
  49. + case ATH79_SOC_QCA9561:
  50. + case ATH79_SOC_TP9343:
  51. pdata->phy_if_mode = PHY_INTERFACE_MODE_MII;
  52. break;
  53. @@ -687,7 +695,8 @@ static int __init ath79_setup_phy_if_mode(unsigned int id,
  54. case ATH79_SOC_AR7241:
  55. case ATH79_SOC_AR9330:
  56. case ATH79_SOC_AR9331:
  57. - case ATH79_SOC_QCA9533:
  58. + case ATH79_SOC_QCA9561:
  59. + case ATH79_SOC_TP9343:
  60. pdata->phy_if_mode = PHY_INTERFACE_MODE_GMII;
  61. break;
  62. @@ -697,6 +706,7 @@ static int __init ath79_setup_phy_if_mode(unsigned int id,
  63. case ATH79_SOC_AR9341:
  64. case ATH79_SOC_AR9342:
  65. case ATH79_SOC_AR9344:
  66. + case ATH79_SOC_QCA9533:
  67. switch (pdata->phy_if_mode) {
  68. case PHY_INTERFACE_MODE_MII:
  69. case PHY_INTERFACE_MODE_GMII:
  70. @@ -986,6 +996,7 @@ void __init ath79_register_eth(unsigned int id)
  71. case ATH79_SOC_AR9341:
  72. case ATH79_SOC_AR9342:
  73. case ATH79_SOC_AR9344:
  74. + case ATH79_SOC_QCA9533:
  75. if (id == 0) {
  76. pdata->reset_bit = AR934X_RESET_GE0_MAC |
  77. AR934X_RESET_GE0_MDIO;
  78. @@ -1017,7 +1028,8 @@ void __init ath79_register_eth(unsigned int id)
  79. pdata->fifo_cfg3 = 0x01f00140;
  80. break;
  81. - case ATH79_SOC_QCA9533:
  82. + case ATH79_SOC_QCA9561:
  83. + case ATH79_SOC_TP9343:
  84. if (id == 0) {
  85. pdata->reset_bit = AR933X_RESET_GE0_MAC |
  86. AR933X_RESET_GE0_MDIO;
  87. @@ -1123,6 +1135,8 @@ void __init ath79_register_eth(unsigned int id)
  88. case ATH79_SOC_AR9330:
  89. case ATH79_SOC_AR9331:
  90. case ATH79_SOC_QCA9533:
  91. + case ATH79_SOC_QCA9561:
  92. + case ATH79_SOC_TP9343:
  93. pdata->mii_bus_dev = &ath79_mdio1_device.dev;
  94. break;
  95. diff --git a/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch b/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch
  96. index f3b4446..cf10af3 100644
  97. --- a/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch
  98. +++ b/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch
  99. @@ -175,6 +175,48 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  100. soc_is_qca955x()) {
  101. ath79_uart_data[0].uartclk = uart_clk_rate;
  102. platform_device_register(&ath79_uart_device);
  103. +--- a/arch/mips/ath79/dev-usb.c
  104. ++++ b/arch/mips/ath79/dev-usb.c
  105. +@@ -236,6 +236,30 @@ static void __init ar934x_usb_setup(void
  106. + &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
  107. + }
  108. +
  109. ++static void __init qca953x_usb_setup(void)
  110. ++{
  111. ++ u32 bootstrap;
  112. ++
  113. ++ bootstrap = ath79_reset_rr(QCA953X_RESET_REG_BOOTSTRAP);
  114. ++
  115. ++ ath79_device_reset_set(QCA953X_RESET_USBSUS_OVERRIDE);
  116. ++ udelay(1000);
  117. ++
  118. ++ ath79_device_reset_clear(QCA953X_RESET_USB_PHY);
  119. ++ udelay(1000);
  120. ++
  121. ++ ath79_device_reset_clear(QCA953X_RESET_USB_PHY_ANALOG);
  122. ++ udelay(1000);
  123. ++
  124. ++ ath79_device_reset_clear(QCA953X_RESET_USB_HOST);
  125. ++ udelay(1000);
  126. ++
  127. ++ ath79_usb_register("ehci-platform", -1,
  128. ++ QCA953X_EHCI_BASE, QCA953X_EHCI_SIZE,
  129. ++ ATH79_CPU_IRQ(3),
  130. ++ &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
  131. ++}
  132. ++
  133. + static void qca955x_usb_reset_notifier(struct platform_device *pdev)
  134. + {
  135. + u32 base;
  136. +@@ -286,6 +310,8 @@ void __init ath79_register_usb(void)
  137. + ar933x_usb_setup();
  138. + else if (soc_is_ar934x())
  139. + ar934x_usb_setup();
  140. ++ else if (soc_is_qca953x())
  141. ++ qca953x_usb_setup();
  142. + else if (soc_is_qca955x())
  143. + qca955x_usb_setup();
  144. + else
  145. --- a/arch/mips/ath79/dev-wmac.c
  146. +++ b/arch/mips/ath79/dev-wmac.c
  147. @@ -101,7 +101,7 @@ static int ar933x_wmac_reset(void)
  148. @@ -207,8 +249,8 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  149. +
  150. + ath79_wmac_resources[0].start = QCA953X_WMAC_BASE;
  151. + ath79_wmac_resources[0].end = QCA953X_WMAC_BASE + QCA953X_WMAC_SIZE - 1;
  152. -+ ath79_wmac_resources[1].start = ATH79_CPU_IRQ(2);
  153. -+ ath79_wmac_resources[1].end = ATH79_CPU_IRQ(2);
  154. ++ ath79_wmac_resources[1].start = ATH79_IP2_IRQ(1);
  155. ++ ath79_wmac_resources[1].end = ATH79_IP2_IRQ(1);
  156. +
  157. + t = ath79_reset_rr(QCA953X_RESET_REG_BOOTSTRAP);
  158. + if (t & QCA953X_BOOTSTRAP_REF_CLK_40)
  159. @@ -244,6 +286,24 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  160. _prom_putchar = prom_putchar_ar71xx;
  161. --- a/arch/mips/ath79/gpio.c
  162. +++ b/arch/mips/ath79/gpio.c
  163. +@@ -148,7 +148,7 @@ static void __iomem *ath79_gpio_get_func
  164. + soc_is_ar913x() ||
  165. + soc_is_ar933x())
  166. + reg = AR71XX_GPIO_REG_FUNC;
  167. +- else if (soc_is_ar934x())
  168. ++ else if (soc_is_ar934x() || soc_is_qca953x())
  169. + reg = AR934X_GPIO_REG_FUNC;
  170. + else
  171. + BUG();
  172. +@@ -187,7 +187,7 @@ void __init ath79_gpio_output_select(uns
  173. + unsigned int reg;
  174. + u32 t, s;
  175. +
  176. +- BUG_ON(!soc_is_ar934x());
  177. ++ BUG_ON(!soc_is_ar934x() && !soc_is_qca953x());
  178. +
  179. + if (gpio >= AR934X_GPIO_COUNT)
  180. + return;
  181. @@ -224,6 +224,8 @@ void __init ath79_gpio_init(void)
  182. ath79_gpio_count = AR933X_GPIO_COUNT;
  183. else if (soc_is_ar934x())
  184. @@ -272,16 +332,77 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  185. soc_is_qca955x())
  186. ath79_misc_irq_chip.irq_ack = ar724x_misc_irq_ack;
  187. else
  188. -@@ -352,6 +353,9 @@ void __init arch_init_irq(void)
  189. +@@ -153,6 +154,38 @@ static void ar934x_ip2_irq_init(void)
  190. + irq_set_chained_handler(ATH79_CPU_IRQ(2), ar934x_ip2_irq_dispatch);
  191. + }
  192. +
  193. ++static void qca953x_ip2_irq_dispatch(unsigned int irq, struct irq_desc *desc)
  194. ++{
  195. ++ u32 status;
  196. ++
  197. ++ disable_irq_nosync(irq);
  198. ++
  199. ++ status = ath79_reset_rr(QCA953X_RESET_REG_PCIE_WMAC_INT_STATUS);
  200. ++
  201. ++ if (status & QCA953X_PCIE_WMAC_INT_PCIE_ALL) {
  202. ++ ath79_ddr_wb_flush(QCA953X_DDR_REG_FLUSH_PCIE);
  203. ++ generic_handle_irq(ATH79_IP2_IRQ(0));
  204. ++ } else if (status & QCA953X_PCIE_WMAC_INT_WMAC_ALL) {
  205. ++ ath79_ddr_wb_flush(QCA953X_DDR_REG_FLUSH_WMAC);
  206. ++ generic_handle_irq(ATH79_IP2_IRQ(1));
  207. ++ } else {
  208. ++ spurious_interrupt();
  209. ++ }
  210. ++
  211. ++ enable_irq(irq);
  212. ++}
  213. ++
  214. ++static void qca953x_irq_init(void)
  215. ++{
  216. ++ int i;
  217. ++
  218. ++ for (i = ATH79_IP2_IRQ_BASE;
  219. ++ i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++)
  220. ++ irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq);
  221. ++
  222. ++ irq_set_chained_handler(ATH79_CPU_IRQ(2), qca953x_ip2_irq_dispatch);
  223. ++}
  224. ++
  225. + static void qca955x_ip2_irq_dispatch(unsigned int irq, struct irq_desc *desc)
  226. + {
  227. + u32 status;
  228. +@@ -335,6 +368,12 @@ static void ar934x_ip3_handler(void)
  229. + do_IRQ(ATH79_CPU_IRQ(3));
  230. + }
  231. +
  232. ++static void qca953x_ip3_handler(void)
  233. ++{
  234. ++ ath79_ddr_wb_flush(QCA953X_DDR_REG_FLUSH_USB);
  235. ++ do_IRQ(ATH79_CPU_IRQ(3));
  236. ++}
  237. ++
  238. + void __init arch_init_irq(void)
  239. + {
  240. + if (soc_is_ar71xx()) {
  241. +@@ -352,6 +391,9 @@ void __init arch_init_irq(void)
  242. } else if (soc_is_ar934x()) {
  243. ath79_ip2_handler = ath79_default_ip2_handler;
  244. ath79_ip3_handler = ar934x_ip3_handler;
  245. + } else if (soc_is_qca953x()) {
  246. + ath79_ip2_handler = ath79_default_ip2_handler;
  247. -+ ath79_ip3_handler = ath79_default_ip3_handler;
  248. ++ ath79_ip3_handler = qca953x_ip3_handler;
  249. } else if (soc_is_qca955x()) {
  250. ath79_ip2_handler = ath79_default_ip2_handler;
  251. ath79_ip3_handler = ath79_default_ip3_handler;
  252. +@@ -365,6 +407,8 @@ void __init arch_init_irq(void)
  253. +
  254. + if (soc_is_ar934x())
  255. + ar934x_ip2_irq_init();
  256. ++ else if (soc_is_qca953x())
  257. ++ qca953x_irq_init();
  258. + else if (soc_is_qca955x())
  259. + qca955x_irq_init();
  260. + }
  261. --- a/arch/mips/ath79/setup.c
  262. +++ b/arch/mips/ath79/setup.c
  263. @@ -59,6 +59,7 @@ static void __init ath79_detect_sys_type
  264. @@ -329,23 +450,49 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  265. pr_info("SoC: %s\n", ath79_sys_type);
  266. --- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
  267. +++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
  268. -@@ -105,6 +105,9 @@
  269. +@@ -105,6 +105,21 @@
  270. #define AR934X_SRIF_BASE (AR71XX_APB_BASE + 0x00116000)
  271. #define AR934X_SRIF_SIZE 0x1000
  272. ++#define QCA953X_GMAC_BASE (AR71XX_APB_BASE + 0x00070000)
  273. ++#define QCA953X_GMAC_SIZE 0x14
  274. +#define QCA953X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000)
  275. +#define QCA953X_WMAC_SIZE 0x20000
  276. ++#define QCA953X_EHCI_BASE 0x1b000000
  277. ++#define QCA953X_EHCI_SIZE 0x200
  278. ++#define QCA953X_SRIF_BASE (AR71XX_APB_BASE + 0x00116000)
  279. ++#define QCA953X_SRIF_SIZE 0x1000
  280. ++
  281. ++#define QCA953X_PCI_CFG_BASE0 0x14000000
  282. ++#define QCA953X_PCI_CTRL_BASE0 (AR71XX_APB_BASE + 0x000f0000)
  283. ++#define QCA953X_PCI_CRP_BASE0 (AR71XX_APB_BASE + 0x000c0000)
  284. ++#define QCA953X_PCI_MEM_BASE0 0x10000000
  285. ++#define QCA953X_PCI_MEM_SIZE 0x02000000
  286. +
  287. #define QCA955X_PCI_MEM_BASE0 0x10000000
  288. #define QCA955X_PCI_MEM_BASE1 0x12000000
  289. #define QCA955X_PCI_MEM_SIZE 0x02000000
  290. -@@ -279,6 +282,43 @@
  291. +@@ -173,6 +188,12 @@
  292. + #define AR934X_DDR_REG_FLUSH_PCIE 0xa8
  293. + #define AR934X_DDR_REG_FLUSH_WMAC 0xac
  294. +
  295. ++#define QCA953X_DDR_REG_FLUSH_GE0 0x9c
  296. ++#define QCA953X_DDR_REG_FLUSH_GE1 0xa0
  297. ++#define QCA953X_DDR_REG_FLUSH_USB 0xa4
  298. ++#define QCA953X_DDR_REG_FLUSH_PCIE 0xa8
  299. ++#define QCA953X_DDR_REG_FLUSH_WMAC 0xac
  300. ++
  301. + /*
  302. + * PLL block
  303. + */
  304. +@@ -279,6 +300,44 @@
  305. #define AR934X_PLL_SWITCH_CLOCK_CONTROL_MDIO_CLK_SEL BIT(6)
  306. +#define QCA953X_PLL_CPU_CONFIG_REG 0x00
  307. +#define QCA953X_PLL_DDR_CONFIG_REG 0x04
  308. +#define QCA953X_PLL_CLK_CTRL_REG 0x08
  309. ++#define QCA953X_PLL_SWITCH_CLOCK_CONTROL_REG 0x24
  310. +#define QCA953X_PLL_ETH_XMII_CONTROL_REG 0x2c
  311. +#define QCA953X_PLL_ETH_SGMII_CONTROL_REG 0x48
  312. +
  313. @@ -356,7 +503,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  314. +#define QCA953X_PLL_CPU_CONFIG_REFDIV_SHIFT 12
  315. +#define QCA953X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f
  316. +#define QCA953X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19
  317. -+#define QCA953X_PLL_CPU_CONFIG_OUTDIV_MASK 0x3
  318. ++#define QCA953X_PLL_CPU_CONFIG_OUTDIV_MASK 0x7
  319. +
  320. +#define QCA953X_PLL_DDR_CONFIG_NFRAC_SHIFT 0
  321. +#define QCA953X_PLL_DDR_CONFIG_NFRAC_MASK 0x3ff
  322. @@ -383,27 +530,85 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  323. #define QCA955X_PLL_CPU_CONFIG_REG 0x00
  324. #define QCA955X_PLL_DDR_CONFIG_REG 0x04
  325. #define QCA955X_PLL_CLK_CTRL_REG 0x08
  326. -@@ -355,6 +395,10 @@
  327. +@@ -355,6 +414,10 @@
  328. #define AR934X_RESET_REG_BOOTSTRAP 0xb0
  329. #define AR934X_RESET_REG_PCIE_WMAC_INT_STATUS 0xac
  330. +#define QCA953X_RESET_REG_RESET_MODULE 0x1c
  331. +#define QCA953X_RESET_REG_BOOTSTRAP 0xb0
  332. -+#define QCA953X_RESET_REG_EXT_INT_STATUS 0xac
  333. ++#define QCA953X_RESET_REG_PCIE_WMAC_INT_STATUS 0xac
  334. +
  335. #define QCA955X_RESET_REG_RESET_MODULE 0x1c
  336. #define QCA955X_RESET_REG_BOOTSTRAP 0xb0
  337. #define QCA955X_RESET_REG_EXT_INT_STATUS 0xac
  338. -@@ -503,6 +547,8 @@
  339. +@@ -450,6 +513,27 @@
  340. + #define AR934X_RESET_MBOX BIT(1)
  341. + #define AR934X_RESET_I2S BIT(0)
  342. +
  343. ++#define QCA953X_RESET_USB_EXT_PWR BIT(29)
  344. ++#define QCA953X_RESET_EXTERNAL BIT(28)
  345. ++#define QCA953X_RESET_RTC BIT(27)
  346. ++#define QCA953X_RESET_FULL_CHIP BIT(24)
  347. ++#define QCA953X_RESET_GE1_MDIO BIT(23)
  348. ++#define QCA953X_RESET_GE0_MDIO BIT(22)
  349. ++#define QCA953X_RESET_CPU_NMI BIT(21)
  350. ++#define QCA953X_RESET_CPU_COLD BIT(20)
  351. ++#define QCA953X_RESET_DDR BIT(16)
  352. ++#define QCA953X_RESET_USB_PHY_PLL_PWD_EXT BIT(15)
  353. ++#define QCA953X_RESET_GE1_MAC BIT(13)
  354. ++#define QCA953X_RESET_ETH_SWITCH_ANALOG BIT(12)
  355. ++#define QCA953X_RESET_USB_PHY_ANALOG BIT(11)
  356. ++#define QCA953X_RESET_GE0_MAC BIT(9)
  357. ++#define QCA953X_RESET_ETH_SWITCH BIT(8)
  358. ++#define QCA953X_RESET_PCIE_PHY BIT(7)
  359. ++#define QCA953X_RESET_PCIE BIT(6)
  360. ++#define QCA953X_RESET_USB_HOST BIT(5)
  361. ++#define QCA953X_RESET_USB_PHY BIT(4)
  362. ++#define QCA953X_RESET_USBSUS_OVERRIDE BIT(3)
  363. ++
  364. + #define QCA955X_RESET_HOST BIT(31)
  365. + #define QCA955X_RESET_SLIC BIT(30)
  366. + #define QCA955X_RESET_HDMA BIT(29)
  367. +@@ -503,6 +587,13 @@
  368. #define AR934X_BOOTSTRAP_SDRAM_DISABLED BIT(1)
  369. #define AR934X_BOOTSTRAP_DDR1 BIT(0)
  370. ++#define QCA953X_BOOTSTRAP_SW_OPTION2 BIT(12)
  371. ++#define QCA953X_BOOTSTRAP_SW_OPTION1 BIT(11)
  372. ++#define QCA953X_BOOTSTRAP_EJTAG_MODE BIT(5)
  373. +#define QCA953X_BOOTSTRAP_REF_CLK_40 BIT(4)
  374. ++#define QCA953X_BOOTSTRAP_SDRAM_DISABLED BIT(1)
  375. ++#define QCA953X_BOOTSTRAP_DDR1 BIT(0)
  376. +
  377. #define QCA955X_BOOTSTRAP_REF_CLK_40 BIT(4)
  378. #define AR934X_PCIE_WMAC_INT_WMAC_MISC BIT(0)
  379. -@@ -565,6 +611,8 @@
  380. +@@ -523,6 +614,24 @@
  381. + AR934X_PCIE_WMAC_INT_PCIE_RC1 | AR934X_PCIE_WMAC_INT_PCIE_RC2 | \
  382. + AR934X_PCIE_WMAC_INT_PCIE_RC3)
  383. +
  384. ++#define QCA953X_PCIE_WMAC_INT_WMAC_MISC BIT(0)
  385. ++#define QCA953X_PCIE_WMAC_INT_WMAC_TX BIT(1)
  386. ++#define QCA953X_PCIE_WMAC_INT_WMAC_RXLP BIT(2)
  387. ++#define QCA953X_PCIE_WMAC_INT_WMAC_RXHP BIT(3)
  388. ++#define QCA953X_PCIE_WMAC_INT_PCIE_RC BIT(4)
  389. ++#define QCA953X_PCIE_WMAC_INT_PCIE_RC0 BIT(5)
  390. ++#define QCA953X_PCIE_WMAC_INT_PCIE_RC1 BIT(6)
  391. ++#define QCA953X_PCIE_WMAC_INT_PCIE_RC2 BIT(7)
  392. ++#define QCA953X_PCIE_WMAC_INT_PCIE_RC3 BIT(8)
  393. ++#define QCA953X_PCIE_WMAC_INT_WMAC_ALL \
  394. ++ (QCA953X_PCIE_WMAC_INT_WMAC_MISC | QCA953X_PCIE_WMAC_INT_WMAC_TX | \
  395. ++ QCA953X_PCIE_WMAC_INT_WMAC_RXLP | QCA953X_PCIE_WMAC_INT_WMAC_RXHP)
  396. ++
  397. ++#define QCA953X_PCIE_WMAC_INT_PCIE_ALL \
  398. ++ (QCA953X_PCIE_WMAC_INT_PCIE_RC | QCA953X_PCIE_WMAC_INT_PCIE_RC0 | \
  399. ++ QCA953X_PCIE_WMAC_INT_PCIE_RC1 | QCA953X_PCIE_WMAC_INT_PCIE_RC2 | \
  400. ++ QCA953X_PCIE_WMAC_INT_PCIE_RC3)
  401. ++
  402. + #define QCA955X_EXT_INT_WMAC_MISC BIT(0)
  403. + #define QCA955X_EXT_INT_WMAC_TX BIT(1)
  404. + #define QCA955X_EXT_INT_WMAC_RXLP BIT(2)
  405. +@@ -565,6 +674,8 @@
  406. #define REV_ID_MAJOR_AR9341 0x0120
  407. #define REV_ID_MAJOR_AR9342 0x1120
  408. #define REV_ID_MAJOR_AR9344 0x2120
  409. @@ -412,7 +617,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  410. #define REV_ID_MAJOR_QCA9556 0x0130
  411. #define REV_ID_MAJOR_QCA9558 0x1130
  412. -@@ -587,6 +635,8 @@
  413. +@@ -587,6 +698,8 @@
  414. #define AR934X_REV_ID_REVISION_MASK 0xf
  415. @@ -421,14 +626,81 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  416. #define QCA955X_REV_ID_REVISION_MASK 0xf
  417. /*
  418. -@@ -640,6 +690,7 @@
  419. +@@ -634,12 +747,32 @@
  420. + #define AR934X_GPIO_REG_OUT_FUNC5 0x40
  421. + #define AR934X_GPIO_REG_FUNC 0x6c
  422. +
  423. ++#define QCA953X_GPIO_REG_OUT_FUNC0 0x2c
  424. ++#define QCA953X_GPIO_REG_OUT_FUNC1 0x30
  425. ++#define QCA953X_GPIO_REG_OUT_FUNC2 0x34
  426. ++#define QCA953X_GPIO_REG_OUT_FUNC3 0x38
  427. ++#define QCA953X_GPIO_REG_OUT_FUNC4 0x3c
  428. ++#define QCA953X_GPIO_REG_IN_ENABLE0 0x44
  429. ++#define QCA953X_GPIO_REG_FUNC 0x6c
  430. ++
  431. ++#define QCA953X_GPIO_OUT_MUX_SPI_CS1 10
  432. ++#define QCA953X_GPIO_OUT_MUX_SPI_CS2 11
  433. ++#define QCA953X_GPIO_OUT_MUX_SPI_CS0 9
  434. ++#define QCA953X_GPIO_OUT_MUX_SPI_CLK 8
  435. ++#define QCA953X_GPIO_OUT_MUX_SPI_MOSI 12
  436. ++#define QCA953X_GPIO_OUT_MUX_LED_LINK1 41
  437. ++#define QCA953X_GPIO_OUT_MUX_LED_LINK2 42
  438. ++#define QCA953X_GPIO_OUT_MUX_LED_LINK3 43
  439. ++#define QCA953X_GPIO_OUT_MUX_LED_LINK4 44
  440. ++#define QCA953X_GPIO_OUT_MUX_LED_LINK5 45
  441. ++
  442. + #define AR71XX_GPIO_COUNT 16
  443. + #define AR7240_GPIO_COUNT 18
  444. + #define AR7241_GPIO_COUNT 20
  445. #define AR913X_GPIO_COUNT 22
  446. #define AR933X_GPIO_COUNT 30
  447. #define AR934X_GPIO_COUNT 23
  448. -+#define QCA953X_GPIO_COUNT 24
  449. ++#define QCA953X_GPIO_COUNT 18
  450. #define QCA955X_GPIO_COUNT 24
  451. /*
  452. +@@ -663,6 +796,24 @@
  453. + #define AR934X_SRIF_DPLL2_OUTDIV_SHIFT 13
  454. + #define AR934X_SRIF_DPLL2_OUTDIV_MASK 0x7
  455. +
  456. ++#define QCA953X_SRIF_CPU_DPLL1_REG 0x1c0
  457. ++#define QCA953X_SRIF_CPU_DPLL2_REG 0x1c4
  458. ++#define QCA953X_SRIF_CPU_DPLL3_REG 0x1c8
  459. ++
  460. ++#define QCA953X_SRIF_DDR_DPLL1_REG 0x240
  461. ++#define QCA953X_SRIF_DDR_DPLL2_REG 0x244
  462. ++#define QCA953X_SRIF_DDR_DPLL3_REG 0x248
  463. ++
  464. ++#define QCA953X_SRIF_DPLL1_REFDIV_SHIFT 27
  465. ++#define QCA953X_SRIF_DPLL1_REFDIV_MASK 0x1f
  466. ++#define QCA953X_SRIF_DPLL1_NINT_SHIFT 18
  467. ++#define QCA953X_SRIF_DPLL1_NINT_MASK 0x1ff
  468. ++#define QCA953X_SRIF_DPLL1_NFRAC_MASK 0x0003ffff
  469. ++
  470. ++#define QCA953X_SRIF_DPLL2_LOCAL_PLL BIT(30)
  471. ++#define QCA953X_SRIF_DPLL2_OUTDIV_SHIFT 13
  472. ++#define QCA953X_SRIF_DPLL2_OUTDIV_MASK 0x7
  473. ++
  474. + #define AR71XX_GPIO_FUNC_STEREO_EN BIT(17)
  475. + #define AR71XX_GPIO_FUNC_SLIC_EN BIT(16)
  476. + #define AR71XX_GPIO_FUNC_SPI_CS2_EN BIT(13)
  477. +@@ -804,6 +955,16 @@
  478. + #define AR934X_ETH_CFG_RDV_DELAY_SHIFT 16
  479. +
  480. + /*
  481. ++ * QCA953X GMAC Interface
  482. ++ */
  483. ++#define QCA953X_GMAC_REG_ETH_CFG 0x00
  484. ++
  485. ++#define QCA953X_ETH_CFG_SW_ONLY_MODE BIT(6)
  486. ++#define QCA953X_ETH_CFG_SW_PHY_SWAP BIT(7)
  487. ++#define QCA953X_ETH_CFG_SW_APB_ACCESS BIT(9)
  488. ++#define QCA953X_ETH_CFG_SW_ACC_MSB_FIRST BIT(13)
  489. ++
  490. ++/*
  491. + * QCA955X GMAC Interface
  492. + */
  493. +
  494. --- a/arch/mips/include/asm/mach-ath79/ath79.h
  495. +++ b/arch/mips/include/asm/mach-ath79/ath79.h
  496. @@ -32,6 +32,7 @@ enum ath79_soc_type {
  497. diff --git a/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch b/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch
  498. index ab2bc38..eecccdc 100644
  499. --- a/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch
  500. +++ b/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch
  501. @@ -142,74 +142,9 @@
  502. ath79_uart_data[0].uartclk = uart_clk_rate;
  503. platform_device_register(&ath79_uart_device);
  504. } else if (soc_is_ar933x()) {
  505. ---- a/arch/mips/ath79/dev-eth.c
  506. -+++ b/arch/mips/ath79/dev-eth.c
  507. -@@ -198,6 +198,8 @@ void __init ath79_register_mdio(unsigned
  508. - case ATH79_SOC_AR9330:
  509. - case ATH79_SOC_AR9331:
  510. - case ATH79_SOC_QCA9533:
  511. -+ case ATH79_SOC_QCA9561:
  512. -+ case ATH79_SOC_TP9343:
  513. - mdio_dev = &ath79_mdio1_device;
  514. - mdio_data = &ath79_mdio1_data;
  515. - break;
  516. -@@ -256,6 +258,8 @@ void __init ath79_register_mdio(unsigned
  517. - break;
  518. -
  519. - case ATH79_SOC_QCA9533:
  520. -+ case ATH79_SOC_QCA9561:
  521. -+ case ATH79_SOC_TP9343:
  522. - mdio_data->builtin_switch = 1;
  523. - break;
  524. -
  525. -@@ -571,6 +575,8 @@ static void __init ath79_init_eth_pll_da
  526. - case ATH79_SOC_QCA9533:
  527. - case ATH79_SOC_QCA9556:
  528. - case ATH79_SOC_QCA9558:
  529. -+ case ATH79_SOC_QCA9561:
  530. -+ case ATH79_SOC_TP9343:
  531. - pll_10 = AR934X_PLL_VAL_10;
  532. - pll_100 = AR934X_PLL_VAL_100;
  533. - pll_1000 = AR934X_PLL_VAL_1000;
  534. -@@ -627,6 +633,8 @@ static int __init ath79_setup_phy_if_mod
  535. - case ATH79_SOC_AR9330:
  536. - case ATH79_SOC_AR9331:
  537. - case ATH79_SOC_QCA9533:
  538. -+ case ATH79_SOC_QCA9561:
  539. -+ case ATH79_SOC_TP9343:
  540. - pdata->phy_if_mode = PHY_INTERFACE_MODE_MII;
  541. - break;
  542. -
  543. -@@ -688,6 +696,8 @@ static int __init ath79_setup_phy_if_mod
  544. - case ATH79_SOC_AR9330:
  545. - case ATH79_SOC_AR9331:
  546. - case ATH79_SOC_QCA9533:
  547. -+ case ATH79_SOC_QCA9561:
  548. -+ case ATH79_SOC_TP9343:
  549. - pdata->phy_if_mode = PHY_INTERFACE_MODE_GMII;
  550. - break;
  551. -
  552. -@@ -1018,6 +1028,8 @@ void __init ath79_register_eth(unsigned
  553. - break;
  554. -
  555. - case ATH79_SOC_QCA9533:
  556. -+ case ATH79_SOC_QCA9561:
  557. -+ case ATH79_SOC_TP9343:
  558. - if (id == 0) {
  559. - pdata->reset_bit = AR933X_RESET_GE0_MAC |
  560. - AR933X_RESET_GE0_MDIO;
  561. -@@ -1123,6 +1135,8 @@ void __init ath79_register_eth(unsigned
  562. - case ATH79_SOC_AR9330:
  563. - case ATH79_SOC_AR9331:
  564. - case ATH79_SOC_QCA9533:
  565. -+ case ATH79_SOC_QCA9561:
  566. -+ case ATH79_SOC_TP9343:
  567. - pdata->mii_bus_dev = &ath79_mdio1_device.dev;
  568. - break;
  569. -
  570. --- a/arch/mips/ath79/dev-usb.c
  571. +++ b/arch/mips/ath79/dev-usb.c
  572. -@@ -272,6 +272,19 @@ static void __init qca955x_usb_setup(voi
  573. +@@ -296,6 +296,19 @@ static void __init qca955x_usb_setup(voi
  574. &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
  575. }
  576. @@ -229,8 +164,8 @@
  577. void __init ath79_register_usb(void)
  578. {
  579. if (soc_is_ar71xx())
  580. -@@ -288,6 +301,8 @@ void __init ath79_register_usb(void)
  581. - ar934x_usb_setup();
  582. +@@ -314,6 +327,8 @@ void __init ath79_register_usb(void)
  583. + qca953x_usb_setup();
  584. else if (soc_is_qca955x())
  585. qca955x_usb_setup();
  586. + else if (soc_is_qca9561())
  587. @@ -291,9 +226,9 @@
  588. soc_is_ar913x() ||
  589. soc_is_ar933x())
  590. reg = AR71XX_GPIO_REG_FUNC;
  591. -- else if (soc_is_ar934x())
  592. +- else if (soc_is_ar934x() || soc_is_qca953x())
  593. + else if (soc_is_ar934x() ||
  594. -+ soc_is_qca956x())
  595. ++ soc_is_qca953x() || soc_is_qca956x())
  596. reg = AR934X_GPIO_REG_FUNC;
  597. else
  598. BUG();
  599. @@ -326,7 +261,7 @@
  600. ath79_misc_irq_chip.irq_ack = ar724x_misc_irq_ack;
  601. else
  602. BUG();
  603. -@@ -236,6 +237,99 @@ static void qca955x_irq_init(void)
  604. +@@ -268,6 +269,97 @@ static void qca955x_irq_init(void)
  605. irq_set_chained_handler(ATH79_CPU_IRQ(3), qca955x_ip3_irq_dispatch);
  606. }
  607. @@ -406,15 +341,13 @@
  608. +
  609. + for (i = ATH79_IP2_IRQ_BASE;
  610. + i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++)
  611. -+ irq_set_chip_and_handler(i, &dummy_irq_chip,
  612. -+ handle_level_irq);
  613. ++ irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq);
  614. +
  615. + irq_set_chained_handler(ATH79_CPU_IRQ(2), qca956x_ip2_irq_dispatch);
  616. +
  617. + for (i = ATH79_IP3_IRQ_BASE;
  618. + i < ATH79_IP3_IRQ_BASE + ATH79_IP3_IRQ_COUNT; i++)
  619. -+ irq_set_chip_and_handler(i, &dummy_irq_chip,
  620. -+ handle_level_irq);
  621. ++ irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq);
  622. +
  623. + irq_set_chained_handler(ATH79_CPU_IRQ(3), qca956x_ip3_irq_dispatch);
  624. +
  625. @@ -426,7 +359,7 @@
  626. asmlinkage void plat_irq_dispatch(void)
  627. {
  628. unsigned long pending;
  629. -@@ -359,6 +453,9 @@ void __init arch_init_irq(void)
  630. +@@ -397,6 +489,9 @@ void __init arch_init_irq(void)
  631. } else if (soc_is_qca955x()) {
  632. ath79_ip2_handler = ath79_default_ip2_handler;
  633. ath79_ip3_handler = ath79_default_ip3_handler;
  634. @@ -436,8 +369,8 @@
  635. } else {
  636. BUG();
  637. }
  638. -@@ -371,4 +468,6 @@ void __init arch_init_irq(void)
  639. - ar934x_ip2_irq_init();
  640. +@@ -411,4 +506,6 @@ void __init arch_init_irq(void)
  641. + qca953x_irq_init();
  642. else if (soc_is_qca955x())
  643. qca955x_irq_init();
  644. + else if (soc_is_qca956x())
  645. @@ -554,7 +487,7 @@
  646. pr_info("SoC: %s\n", ath79_sys_type);
  647. --- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
  648. +++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
  649. -@@ -131,6 +131,23 @@
  650. +@@ -143,6 +143,23 @@
  651. #define QCA955X_NFC_BASE 0x1b800200
  652. #define QCA955X_NFC_SIZE 0xb8
  653. @@ -578,7 +511,7 @@
  654. #define AR9300_OTP_BASE 0x14000
  655. #define AR9300_OTP_STATUS 0x15f18
  656. #define AR9300_OTP_STATUS_TYPE 0x7
  657. -@@ -356,6 +373,49 @@
  658. +@@ -375,6 +392,49 @@
  659. #define QCA955X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21)
  660. #define QCA955X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24)
  661. @@ -628,7 +561,7 @@
  662. /*
  663. * USB_CONFIG block
  664. */
  665. -@@ -403,6 +463,11 @@
  666. +@@ -422,6 +482,11 @@
  667. #define QCA955X_RESET_REG_BOOTSTRAP 0xb0
  668. #define QCA955X_RESET_REG_EXT_INT_STATUS 0xac
  669. @@ -640,7 +573,7 @@
  670. #define MISC_INT_ETHSW BIT(12)
  671. #define MISC_INT_TIMER4 BIT(10)
  672. #define MISC_INT_TIMER3 BIT(9)
  673. -@@ -551,6 +616,8 @@
  674. +@@ -596,6 +661,8 @@
  675. #define QCA955X_BOOTSTRAP_REF_CLK_40 BIT(4)
  676. @@ -649,7 +582,7 @@
  677. #define AR934X_PCIE_WMAC_INT_WMAC_MISC BIT(0)
  678. #define AR934X_PCIE_WMAC_INT_WMAC_TX BIT(1)
  679. #define AR934X_PCIE_WMAC_INT_WMAC_RXLP BIT(2)
  680. -@@ -600,6 +667,37 @@
  681. +@@ -663,6 +730,37 @@
  682. QCA955X_EXT_INT_PCIE_RC2_INT1 | QCA955X_EXT_INT_PCIE_RC2_INT2 | \
  683. QCA955X_EXT_INT_PCIE_RC2_INT3)
  684. @@ -687,7 +620,7 @@
  685. #define REV_ID_MAJOR_MASK 0xfff0
  686. #define REV_ID_MAJOR_AR71XX 0x00a0
  687. #define REV_ID_MAJOR_AR913X 0x00b0
  688. -@@ -615,6 +713,8 @@
  689. +@@ -678,6 +776,8 @@
  690. #define REV_ID_MAJOR_QCA9533_V2 0x0160
  691. #define REV_ID_MAJOR_QCA9556 0x0130
  692. #define REV_ID_MAJOR_QCA9558 0x1130
  693. @@ -696,7 +629,7 @@
  694. #define AR71XX_REV_ID_MINOR_MASK 0x3
  695. #define AR71XX_REV_ID_MINOR_AR7130 0x0
  696. -@@ -639,6 +739,8 @@
  697. +@@ -702,6 +802,8 @@
  698. #define QCA955X_REV_ID_REVISION_MASK 0xf
  699. @@ -705,9 +638,9 @@
  700. /*
  701. * SPI block
  702. */
  703. -@@ -684,6 +786,19 @@
  704. - #define AR934X_GPIO_REG_OUT_FUNC5 0x40
  705. - #define AR934X_GPIO_REG_FUNC 0x6c
  706. +@@ -766,6 +868,19 @@
  707. + #define QCA953X_GPIO_OUT_MUX_LED_LINK4 44
  708. + #define QCA953X_GPIO_OUT_MUX_LED_LINK5 45
  709. +#define QCA956X_GPIO_REG_OUT_FUNC0 0x2c
  710. +#define QCA956X_GPIO_REG_OUT_FUNC1 0x30
  711. @@ -725,9 +658,9 @@
  712. #define AR71XX_GPIO_COUNT 16
  713. #define AR7240_GPIO_COUNT 18
  714. #define AR7241_GPIO_COUNT 20
  715. -@@ -692,6 +807,7 @@
  716. +@@ -774,6 +889,7 @@
  717. #define AR934X_GPIO_COUNT 23
  718. - #define QCA953X_GPIO_COUNT 24
  719. + #define QCA953X_GPIO_COUNT 18
  720. #define QCA955X_GPIO_COUNT 24
  721. +#define QCA956X_GPIO_COUNT 23
  722. diff --git a/target/linux/ar71xx/patches-3.18/736-MIPS-ath79-fix-chained-irq-disable.patch b/target/linux/ar71xx/patches-3.18/736-MIPS-ath79-fix-chained-irq-disable.patch
  723. index 8cb38d3..8c0cc95 100644
  724. --- a/target/linux/ar71xx/patches-3.18/736-MIPS-ath79-fix-chained-irq-disable.patch
  725. +++ b/target/linux/ar71xx/patches-3.18/736-MIPS-ath79-fix-chained-irq-disable.patch
  726. @@ -19,7 +19,16 @@
  727. irq_set_chained_handler(ATH79_CPU_IRQ(2), ar934x_ip2_irq_dispatch);
  728. }
  729. -@@ -224,15 +225,13 @@ static void qca955x_irq_init(void)
  730. +@@ -182,7 +183,7 @@ static void qca953x_irq_init(void)
  731. +
  732. + for (i = ATH79_IP2_IRQ_BASE;
  733. + i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++)
  734. +- irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq);
  735. ++ irq_set_chip_and_handler(i, &ip2_chip, handle_level_irq);
  736. +
  737. + irq_set_chained_handler(ATH79_CPU_IRQ(2), qca953x_ip2_irq_dispatch);
  738. + }
  739. +@@ -256,15 +257,13 @@ static void qca955x_irq_init(void)
  740. for (i = ATH79_IP2_IRQ_BASE;
  741. i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++)
  742. @@ -37,25 +46,23 @@
  743. irq_set_chained_handler(ATH79_CPU_IRQ(3), qca955x_ip3_irq_dispatch);
  744. }
  745. -@@ -313,15 +312,13 @@ static void qca956x_irq_init(void)
  746. +@@ -345,13 +344,13 @@ static void qca956x_irq_init(void)
  747. for (i = ATH79_IP2_IRQ_BASE;
  748. i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++)
  749. -- irq_set_chip_and_handler(i, &dummy_irq_chip,
  750. -- handle_level_irq);
  751. +- irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq);
  752. + irq_set_chip_and_handler(i, &ip2_chip, handle_level_irq);
  753. irq_set_chained_handler(ATH79_CPU_IRQ(2), qca956x_ip2_irq_dispatch);
  754. for (i = ATH79_IP3_IRQ_BASE;
  755. i < ATH79_IP3_IRQ_BASE + ATH79_IP3_IRQ_COUNT; i++)
  756. -- irq_set_chip_and_handler(i, &dummy_irq_chip,
  757. -- handle_level_irq);
  758. +- irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq);
  759. + irq_set_chip_and_handler(i, &ip3_chip, handle_level_irq);
  760. irq_set_chained_handler(ATH79_CPU_IRQ(3), qca956x_ip3_irq_dispatch);
  761. -@@ -430,8 +427,35 @@ static void ar934x_ip3_handler(void)
  762. +@@ -466,8 +465,35 @@ static void qca953x_ip3_handler(void)
  763. do_IRQ(ATH79_CPU_IRQ(3));
  764. }