1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */ 21d3d0f1fSWills Wang /* 31d3d0f1fSWills Wang * Atheros AR71XX/AR724X/AR913X SoC register definitions 41d3d0f1fSWills Wang * 51d3d0f1fSWills Wang * Copyright (C) 2015-2016 Wills Wang <wills.wang@live.com> 61d3d0f1fSWills Wang * Copyright (C) 2010-2011 Jaiganesh Narayanan <jnarayanan@atheros.com> 71d3d0f1fSWills Wang * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org> 81d3d0f1fSWills Wang * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> 91d3d0f1fSWills Wang */ 101d3d0f1fSWills Wang 111d3d0f1fSWills Wang #ifndef __ASM_MACH_AR71XX_REGS_H 121d3d0f1fSWills Wang #define __ASM_MACH_AR71XX_REGS_H 131d3d0f1fSWills Wang 141d3d0f1fSWills Wang #ifndef __ASSEMBLY__ 151d3d0f1fSWills Wang #include <linux/bitops.h> 161d3d0f1fSWills Wang #else 171d3d0f1fSWills Wang #ifndef BIT 181d3d0f1fSWills Wang #define BIT(nr) (1 << (nr)) 191d3d0f1fSWills Wang #endif 201d3d0f1fSWills Wang #endif 211d3d0f1fSWills Wang 221d3d0f1fSWills Wang #define AR71XX_APB_BASE 0x18000000 231d3d0f1fSWills Wang #define AR71XX_GE0_BASE 0x19000000 241d3d0f1fSWills Wang #define AR71XX_GE0_SIZE 0x10000 251d3d0f1fSWills Wang #define AR71XX_GE1_BASE 0x1a000000 261d3d0f1fSWills Wang #define AR71XX_GE1_SIZE 0x10000 271d3d0f1fSWills Wang #define AR71XX_EHCI_BASE 0x1b000000 281d3d0f1fSWills Wang #define AR71XX_EHCI_SIZE 0x1000 291d3d0f1fSWills Wang #define AR71XX_OHCI_BASE 0x1c000000 301d3d0f1fSWills Wang #define AR71XX_OHCI_SIZE 0x1000 311d3d0f1fSWills Wang #define AR71XX_SPI_BASE 0x1f000000 321d3d0f1fSWills Wang #define AR71XX_SPI_SIZE 0x01000000 331d3d0f1fSWills Wang 340a6767efSMarek Vasut #define AR71XX_DDR_CTRL_BASE \ 350a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00000000) 361d3d0f1fSWills Wang #define AR71XX_DDR_CTRL_SIZE 0x100 370a6767efSMarek Vasut #define AR71XX_UART_BASE \ 380a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00020000) 391d3d0f1fSWills Wang #define AR71XX_UART_SIZE 0x100 400a6767efSMarek Vasut #define AR71XX_USB_CTRL_BASE \ 410a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00030000) 421d3d0f1fSWills Wang #define AR71XX_USB_CTRL_SIZE 0x100 430a6767efSMarek Vasut #define AR71XX_GPIO_BASE \ 440a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00040000) 451d3d0f1fSWills Wang #define AR71XX_GPIO_SIZE 0x100 460a6767efSMarek Vasut #define AR71XX_PLL_BASE \ 470a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00050000) 481d3d0f1fSWills Wang #define AR71XX_PLL_SIZE 0x100 490a6767efSMarek Vasut #define AR71XX_RESET_BASE \ 500a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00060000) 511d3d0f1fSWills Wang #define AR71XX_RESET_SIZE 0x100 520a6767efSMarek Vasut #define AR71XX_MII_BASE \ 530a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00070000) 541d3d0f1fSWills Wang #define AR71XX_MII_SIZE 0x100 551d3d0f1fSWills Wang 561d3d0f1fSWills Wang #define AR71XX_PCI_MEM_BASE 0x10000000 571d3d0f1fSWills Wang #define AR71XX_PCI_MEM_SIZE 0x07000000 581d3d0f1fSWills Wang 591d3d0f1fSWills Wang #define AR71XX_PCI_WIN0_OFFS 0x10000000 601d3d0f1fSWills Wang #define AR71XX_PCI_WIN1_OFFS 0x11000000 611d3d0f1fSWills Wang #define AR71XX_PCI_WIN2_OFFS 0x12000000 621d3d0f1fSWills Wang #define AR71XX_PCI_WIN3_OFFS 0x13000000 631d3d0f1fSWills Wang #define AR71XX_PCI_WIN4_OFFS 0x14000000 641d3d0f1fSWills Wang #define AR71XX_PCI_WIN5_OFFS 0x15000000 651d3d0f1fSWills Wang #define AR71XX_PCI_WIN6_OFFS 0x16000000 661d3d0f1fSWills Wang #define AR71XX_PCI_WIN7_OFFS 0x07000000 671d3d0f1fSWills Wang 681d3d0f1fSWills Wang #define AR71XX_PCI_CFG_BASE \ 691d3d0f1fSWills Wang (AR71XX_PCI_MEM_BASE + AR71XX_PCI_WIN7_OFFS + 0x10000) 701d3d0f1fSWills Wang #define AR71XX_PCI_CFG_SIZE 0x100 711d3d0f1fSWills Wang 720a6767efSMarek Vasut #define AR7240_USB_CTRL_BASE \ 730a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00030000) 741d3d0f1fSWills Wang #define AR7240_USB_CTRL_SIZE 0x100 751d3d0f1fSWills Wang #define AR7240_OHCI_BASE 0x1b000000 761d3d0f1fSWills Wang #define AR7240_OHCI_SIZE 0x1000 771d3d0f1fSWills Wang 781d3d0f1fSWills Wang #define AR724X_PCI_MEM_BASE 0x10000000 791d3d0f1fSWills Wang #define AR724X_PCI_MEM_SIZE 0x04000000 801d3d0f1fSWills Wang 811d3d0f1fSWills Wang #define AR724X_PCI_CFG_BASE 0x14000000 821d3d0f1fSWills Wang #define AR724X_PCI_CFG_SIZE 0x1000 830a6767efSMarek Vasut #define AR724X_PCI_CRP_BASE \ 840a6767efSMarek Vasut (AR71XX_APB_BASE + 0x000c0000) 851d3d0f1fSWills Wang #define AR724X_PCI_CRP_SIZE 0x1000 860a6767efSMarek Vasut #define AR724X_PCI_CTRL_BASE \ 870a6767efSMarek Vasut (AR71XX_APB_BASE + 0x000f0000) 881d3d0f1fSWills Wang #define AR724X_PCI_CTRL_SIZE 0x100 891d3d0f1fSWills Wang 901d3d0f1fSWills Wang #define AR724X_EHCI_BASE 0x1b000000 911d3d0f1fSWills Wang #define AR724X_EHCI_SIZE 0x1000 921d3d0f1fSWills Wang 931d3d0f1fSWills Wang #define AR913X_EHCI_BASE 0x1b000000 941d3d0f1fSWills Wang #define AR913X_EHCI_SIZE 0x1000 950a6767efSMarek Vasut #define AR913X_WMAC_BASE \ 960a6767efSMarek Vasut (AR71XX_APB_BASE + 0x000C0000) 971d3d0f1fSWills Wang #define AR913X_WMAC_SIZE 0x30000 981d3d0f1fSWills Wang 990a6767efSMarek Vasut #define AR933X_UART_BASE \ 1000a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00020000) 1011d3d0f1fSWills Wang #define AR933X_UART_SIZE 0x14 1020a6767efSMarek Vasut #define AR933X_GMAC_BASE \ 1030a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00070000) 1041d3d0f1fSWills Wang #define AR933X_GMAC_SIZE 0x04 1050a6767efSMarek Vasut #define AR933X_WMAC_BASE \ 1060a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00100000) 1071d3d0f1fSWills Wang #define AR933X_WMAC_SIZE 0x20000 1080a6767efSMarek Vasut #define AR933X_RTC_BASE \ 1090a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00107000) 1101d3d0f1fSWills Wang #define AR933X_RTC_SIZE 0x1000 1111d3d0f1fSWills Wang #define AR933X_EHCI_BASE 0x1b000000 1121d3d0f1fSWills Wang #define AR933X_EHCI_SIZE 0x1000 1130a6767efSMarek Vasut #define AR933X_SRIF_BASE \ 1140a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00116000) 1151d3d0f1fSWills Wang #define AR933X_SRIF_SIZE 0x1000 1161d3d0f1fSWills Wang 1170a6767efSMarek Vasut #define AR934X_GMAC_BASE \ 1180a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00070000) 1191d3d0f1fSWills Wang #define AR934X_GMAC_SIZE 0x14 1200a6767efSMarek Vasut #define AR934X_WMAC_BASE \ 1210a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00100000) 1221d3d0f1fSWills Wang #define AR934X_WMAC_SIZE 0x20000 1231d3d0f1fSWills Wang #define AR934X_EHCI_BASE 0x1b000000 1241d3d0f1fSWills Wang #define AR934X_EHCI_SIZE 0x200 1251d3d0f1fSWills Wang #define AR934X_NFC_BASE 0x1b000200 1261d3d0f1fSWills Wang #define AR934X_NFC_SIZE 0xb8 1270a6767efSMarek Vasut #define AR934X_SRIF_BASE \ 1280a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00116000) 1291d3d0f1fSWills Wang #define AR934X_SRIF_SIZE 0x1000 1301d3d0f1fSWills Wang 1310a6767efSMarek Vasut #define QCA953X_GMAC_BASE \ 1320a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00070000) 1331d3d0f1fSWills Wang #define QCA953X_GMAC_SIZE 0x14 1340a6767efSMarek Vasut #define QCA953X_WMAC_BASE \ 1350a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00100000) 1361d3d0f1fSWills Wang #define QCA953X_WMAC_SIZE 0x20000 1370a6767efSMarek Vasut #define QCA953X_RTC_BASE \ 1380a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00107000) 1391d3d0f1fSWills Wang #define QCA953X_RTC_SIZE 0x1000 1401d3d0f1fSWills Wang #define QCA953X_EHCI_BASE 0x1b000000 1411d3d0f1fSWills Wang #define QCA953X_EHCI_SIZE 0x200 1420a6767efSMarek Vasut #define QCA953X_SRIF_BASE \ 1430a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00116000) 1441d3d0f1fSWills Wang #define QCA953X_SRIF_SIZE 0x1000 1451d3d0f1fSWills Wang 1461d3d0f1fSWills Wang #define QCA953X_PCI_CFG_BASE0 0x14000000 1470a6767efSMarek Vasut #define QCA953X_PCI_CTRL_BASE0 \ 1480a6767efSMarek Vasut (AR71XX_APB_BASE + 0x000f0000) 1490a6767efSMarek Vasut #define QCA953X_PCI_CRP_BASE0 \ 1500a6767efSMarek Vasut (AR71XX_APB_BASE + 0x000c0000) 1511d3d0f1fSWills Wang #define QCA953X_PCI_MEM_BASE0 0x10000000 1521d3d0f1fSWills Wang #define QCA953X_PCI_MEM_SIZE 0x02000000 1531d3d0f1fSWills Wang 1541d3d0f1fSWills Wang #define QCA955X_PCI_MEM_BASE0 0x10000000 1551d3d0f1fSWills Wang #define QCA955X_PCI_MEM_BASE1 0x12000000 1561d3d0f1fSWills Wang #define QCA955X_PCI_MEM_SIZE 0x02000000 1571d3d0f1fSWills Wang #define QCA955X_PCI_CFG_BASE0 0x14000000 1581d3d0f1fSWills Wang #define QCA955X_PCI_CFG_BASE1 0x16000000 1591d3d0f1fSWills Wang #define QCA955X_PCI_CFG_SIZE 0x1000 1600a6767efSMarek Vasut #define QCA955X_PCI_CRP_BASE0 \ 1610a6767efSMarek Vasut (AR71XX_APB_BASE + 0x000c0000) 1620a6767efSMarek Vasut #define QCA955X_PCI_CRP_BASE1 \ 1630a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00250000) 1641d3d0f1fSWills Wang #define QCA955X_PCI_CRP_SIZE 0x1000 1650a6767efSMarek Vasut #define QCA955X_PCI_CTRL_BASE0 \ 1660a6767efSMarek Vasut (AR71XX_APB_BASE + 0x000f0000) 1670a6767efSMarek Vasut #define QCA955X_PCI_CTRL_BASE1 \ 1680a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00280000) 1691d3d0f1fSWills Wang #define QCA955X_PCI_CTRL_SIZE 0x100 1701d3d0f1fSWills Wang 1710a6767efSMarek Vasut #define QCA955X_GMAC_BASE \ 1720a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00070000) 1731d3d0f1fSWills Wang #define QCA955X_GMAC_SIZE 0x40 1740a6767efSMarek Vasut #define QCA955X_WMAC_BASE \ 1750a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00100000) 1761d3d0f1fSWills Wang #define QCA955X_WMAC_SIZE 0x20000 1771d3d0f1fSWills Wang #define QCA955X_EHCI0_BASE 0x1b000000 1781d3d0f1fSWills Wang #define QCA955X_EHCI1_BASE 0x1b400000 1791d3d0f1fSWills Wang #define QCA955X_EHCI_SIZE 0x1000 1801d3d0f1fSWills Wang #define QCA955X_NFC_BASE 0x1b800200 1811d3d0f1fSWills Wang #define QCA955X_NFC_SIZE 0xb8 1821d3d0f1fSWills Wang 1831d3d0f1fSWills Wang #define QCA956X_PCI_MEM_BASE1 0x12000000 1841d3d0f1fSWills Wang #define QCA956X_PCI_MEM_SIZE 0x02000000 1851d3d0f1fSWills Wang #define QCA956X_PCI_CFG_BASE1 0x16000000 1861d3d0f1fSWills Wang #define QCA956X_PCI_CFG_SIZE 0x1000 1870a6767efSMarek Vasut #define QCA956X_PCI_CRP_BASE1 \ 1880a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00250000) 1891d3d0f1fSWills Wang #define QCA956X_PCI_CRP_SIZE 0x1000 1900a6767efSMarek Vasut #define QCA956X_PCI_CTRL_BASE1 \ 1910a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00280000) 1921d3d0f1fSWills Wang #define QCA956X_PCI_CTRL_SIZE 0x100 1931d3d0f1fSWills Wang 1940a6767efSMarek Vasut #define QCA956X_WMAC_BASE \ 1950a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00100000) 1961d3d0f1fSWills Wang #define QCA956X_WMAC_SIZE 0x20000 1971d3d0f1fSWills Wang #define QCA956X_EHCI0_BASE 0x1b000000 1981d3d0f1fSWills Wang #define QCA956X_EHCI1_BASE 0x1b400000 1991d3d0f1fSWills Wang #define QCA956X_EHCI_SIZE 0x200 2000a6767efSMarek Vasut #define QCA956X_GMAC_BASE \ 2010a6767efSMarek Vasut (AR71XX_APB_BASE + 0x00070000) 2021d3d0f1fSWills Wang #define QCA956X_GMAC_SIZE 0x64 2031d3d0f1fSWills Wang 2041d3d0f1fSWills Wang /* 2051d3d0f1fSWills Wang * DDR_CTRL block 2061d3d0f1fSWills Wang */ 2071d3d0f1fSWills Wang #define AR71XX_DDR_REG_CONFIG 0x00 2081d3d0f1fSWills Wang #define AR71XX_DDR_REG_CONFIG2 0x04 2091d3d0f1fSWills Wang #define AR71XX_DDR_REG_MODE 0x08 2101d3d0f1fSWills Wang #define AR71XX_DDR_REG_EMR 0x0c 2111d3d0f1fSWills Wang #define AR71XX_DDR_REG_CONTROL 0x10 2121d3d0f1fSWills Wang #define AR71XX_DDR_REG_REFRESH 0x14 2131d3d0f1fSWills Wang #define AR71XX_DDR_REG_RD_CYCLE 0x18 2141d3d0f1fSWills Wang #define AR71XX_DDR_REG_TAP_CTRL0 0x1c 2151d3d0f1fSWills Wang #define AR71XX_DDR_REG_TAP_CTRL1 0x20 2161d3d0f1fSWills Wang 2171d3d0f1fSWills Wang #define AR71XX_DDR_REG_PCI_WIN0 0x7c 2181d3d0f1fSWills Wang #define AR71XX_DDR_REG_PCI_WIN1 0x80 2191d3d0f1fSWills Wang #define AR71XX_DDR_REG_PCI_WIN2 0x84 2201d3d0f1fSWills Wang #define AR71XX_DDR_REG_PCI_WIN3 0x88 2211d3d0f1fSWills Wang #define AR71XX_DDR_REG_PCI_WIN4 0x8c 2221d3d0f1fSWills Wang #define AR71XX_DDR_REG_PCI_WIN5 0x90 2231d3d0f1fSWills Wang #define AR71XX_DDR_REG_PCI_WIN6 0x94 2241d3d0f1fSWills Wang #define AR71XX_DDR_REG_PCI_WIN7 0x98 2251d3d0f1fSWills Wang #define AR71XX_DDR_REG_FLUSH_GE0 0x9c 2261d3d0f1fSWills Wang #define AR71XX_DDR_REG_FLUSH_GE1 0xa0 2271d3d0f1fSWills Wang #define AR71XX_DDR_REG_FLUSH_USB 0xa4 2281d3d0f1fSWills Wang #define AR71XX_DDR_REG_FLUSH_PCI 0xa8 2291d3d0f1fSWills Wang 2301d3d0f1fSWills Wang #define AR724X_DDR_REG_FLUSH_GE0 0x7c 2311d3d0f1fSWills Wang #define AR724X_DDR_REG_FLUSH_GE1 0x80 2321d3d0f1fSWills Wang #define AR724X_DDR_REG_FLUSH_USB 0x84 2331d3d0f1fSWills Wang #define AR724X_DDR_REG_FLUSH_PCIE 0x88 2341d3d0f1fSWills Wang 2351d3d0f1fSWills Wang #define AR913X_DDR_REG_FLUSH_GE0 0x7c 2361d3d0f1fSWills Wang #define AR913X_DDR_REG_FLUSH_GE1 0x80 2371d3d0f1fSWills Wang #define AR913X_DDR_REG_FLUSH_USB 0x84 2381d3d0f1fSWills Wang #define AR913X_DDR_REG_FLUSH_WMAC 0x88 2391d3d0f1fSWills Wang 2401d3d0f1fSWills Wang #define AR933X_DDR_REG_FLUSH_GE0 0x7c 2411d3d0f1fSWills Wang #define AR933X_DDR_REG_FLUSH_GE1 0x80 2421d3d0f1fSWills Wang #define AR933X_DDR_REG_FLUSH_USB 0x84 2431d3d0f1fSWills Wang #define AR933X_DDR_REG_FLUSH_WMAC 0x88 2441d3d0f1fSWills Wang #define AR933X_DDR_REG_DDR2_CONFIG 0x8c 2451d3d0f1fSWills Wang #define AR933X_DDR_REG_EMR2 0x90 2461d3d0f1fSWills Wang #define AR933X_DDR_REG_EMR3 0x94 2471d3d0f1fSWills Wang #define AR933X_DDR_REG_BURST 0x98 2481d3d0f1fSWills Wang #define AR933X_DDR_REG_TIMEOUT_MAX 0x9c 2491d3d0f1fSWills Wang #define AR933X_DDR_REG_TIMEOUT_CNT 0x9c 2501d3d0f1fSWills Wang #define AR933X_DDR_REG_TIMEOUT_ADDR 0x9c 2511d3d0f1fSWills Wang 252e08539b7SMarek Vasut #define AR934X_DDR_REG_TAP_CTRL2 0x24 253e08539b7SMarek Vasut #define AR934X_DDR_REG_TAP_CTRL3 0x28 2541d3d0f1fSWills Wang #define AR934X_DDR_REG_FLUSH_GE0 0x9c 2551d3d0f1fSWills Wang #define AR934X_DDR_REG_FLUSH_GE1 0xa0 2561d3d0f1fSWills Wang #define AR934X_DDR_REG_FLUSH_USB 0xa4 2571d3d0f1fSWills Wang #define AR934X_DDR_REG_FLUSH_PCIE 0xa8 2581d3d0f1fSWills Wang #define AR934X_DDR_REG_FLUSH_WMAC 0xac 259e08539b7SMarek Vasut #define AR934X_DDR_REG_FLUSH_SRC1 0xb0 260e08539b7SMarek Vasut #define AR934X_DDR_REG_FLUSH_SRC2 0xb4 261e08539b7SMarek Vasut #define AR934X_DDR_REG_DDR2_CONFIG 0xb8 262e08539b7SMarek Vasut #define AR934X_DDR_REG_EMR2 0xbc 263e08539b7SMarek Vasut #define AR934X_DDR_REG_EMR3 0xc0 264e08539b7SMarek Vasut #define AR934X_DDR_REG_BURST 0xc4 265e08539b7SMarek Vasut #define AR934X_DDR_REG_BURST2 0xc8 266e08539b7SMarek Vasut #define AR934X_DDR_REG_TIMEOUT_MAX 0xcc 267e08539b7SMarek Vasut #define AR934X_DDR_REG_CTL_CONF 0x108 2681d3d0f1fSWills Wang 2691d3d0f1fSWills Wang #define QCA953X_DDR_REG_FLUSH_GE0 0x9c 2701d3d0f1fSWills Wang #define QCA953X_DDR_REG_FLUSH_GE1 0xa0 2711d3d0f1fSWills Wang #define QCA953X_DDR_REG_FLUSH_USB 0xa4 2721d3d0f1fSWills Wang #define QCA953X_DDR_REG_FLUSH_PCIE 0xa8 2731d3d0f1fSWills Wang #define QCA953X_DDR_REG_FLUSH_WMAC 0xac 2741d3d0f1fSWills Wang #define QCA953X_DDR_REG_DDR2_CONFIG 0xb8 2751d3d0f1fSWills Wang #define QCA953X_DDR_REG_BURST 0xc4 2761d3d0f1fSWills Wang #define QCA953X_DDR_REG_BURST2 0xc8 2771d3d0f1fSWills Wang #define QCA953X_DDR_REG_TIMEOUT_MAX 0xcc 2781d3d0f1fSWills Wang #define QCA953X_DDR_REG_CTL_CONF 0x108 2791d3d0f1fSWills Wang #define QCA953X_DDR_REG_CONFIG3 0x15c 2801d3d0f1fSWills Wang 2811d3d0f1fSWills Wang /* 2821d3d0f1fSWills Wang * PLL block 2831d3d0f1fSWills Wang */ 2841d3d0f1fSWills Wang #define AR71XX_PLL_REG_CPU_CONFIG 0x00 2851d3d0f1fSWills Wang #define AR71XX_PLL_REG_SEC_CONFIG 0x04 2861d3d0f1fSWills Wang #define AR71XX_PLL_REG_ETH0_INT_CLOCK 0x10 2871d3d0f1fSWills Wang #define AR71XX_PLL_REG_ETH1_INT_CLOCK 0x14 2881d3d0f1fSWills Wang 2891d3d0f1fSWills Wang #define AR71XX_PLL_DIV_SHIFT 3 2901d3d0f1fSWills Wang #define AR71XX_PLL_DIV_MASK 0x1f 2911d3d0f1fSWills Wang #define AR71XX_CPU_DIV_SHIFT 16 2921d3d0f1fSWills Wang #define AR71XX_CPU_DIV_MASK 0x3 2931d3d0f1fSWills Wang #define AR71XX_DDR_DIV_SHIFT 18 2941d3d0f1fSWills Wang #define AR71XX_DDR_DIV_MASK 0x3 2951d3d0f1fSWills Wang #define AR71XX_AHB_DIV_SHIFT 20 2961d3d0f1fSWills Wang #define AR71XX_AHB_DIV_MASK 0x7 2971d3d0f1fSWills Wang 2981d3d0f1fSWills Wang #define AR71XX_ETH0_PLL_SHIFT 17 2991d3d0f1fSWills Wang #define AR71XX_ETH1_PLL_SHIFT 19 3001d3d0f1fSWills Wang 3011d3d0f1fSWills Wang #define AR724X_PLL_REG_CPU_CONFIG 0x00 3021d3d0f1fSWills Wang #define AR724X_PLL_REG_PCIE_CONFIG 0x18 3031d3d0f1fSWills Wang 3041d3d0f1fSWills Wang #define AR724X_PLL_DIV_SHIFT 0 3051d3d0f1fSWills Wang #define AR724X_PLL_DIV_MASK 0x3ff 3061d3d0f1fSWills Wang #define AR724X_PLL_REF_DIV_SHIFT 10 3071d3d0f1fSWills Wang #define AR724X_PLL_REF_DIV_MASK 0xf 3081d3d0f1fSWills Wang #define AR724X_AHB_DIV_SHIFT 19 3091d3d0f1fSWills Wang #define AR724X_AHB_DIV_MASK 0x1 3101d3d0f1fSWills Wang #define AR724X_DDR_DIV_SHIFT 22 3111d3d0f1fSWills Wang #define AR724X_DDR_DIV_MASK 0x3 3121d3d0f1fSWills Wang 3131d3d0f1fSWills Wang #define AR7242_PLL_REG_ETH0_INT_CLOCK 0x2c 3141d3d0f1fSWills Wang 3151d3d0f1fSWills Wang #define AR913X_PLL_REG_CPU_CONFIG 0x00 3161d3d0f1fSWills Wang #define AR913X_PLL_REG_ETH_CONFIG 0x04 3171d3d0f1fSWills Wang #define AR913X_PLL_REG_ETH0_INT_CLOCK 0x14 3181d3d0f1fSWills Wang #define AR913X_PLL_REG_ETH1_INT_CLOCK 0x18 3191d3d0f1fSWills Wang 3201d3d0f1fSWills Wang #define AR913X_PLL_DIV_SHIFT 0 3211d3d0f1fSWills Wang #define AR913X_PLL_DIV_MASK 0x3ff 3221d3d0f1fSWills Wang #define AR913X_DDR_DIV_SHIFT 22 3231d3d0f1fSWills Wang #define AR913X_DDR_DIV_MASK 0x3 3241d3d0f1fSWills Wang #define AR913X_AHB_DIV_SHIFT 19 3251d3d0f1fSWills Wang #define AR913X_AHB_DIV_MASK 0x1 3261d3d0f1fSWills Wang 3271d3d0f1fSWills Wang #define AR913X_ETH0_PLL_SHIFT 20 3281d3d0f1fSWills Wang #define AR913X_ETH1_PLL_SHIFT 22 3291d3d0f1fSWills Wang 3301d3d0f1fSWills Wang #define AR933X_PLL_CPU_CONFIG_REG 0x00 3311d3d0f1fSWills Wang #define AR933X_PLL_CLK_CTRL_REG 0x08 3321d3d0f1fSWills Wang #define AR933X_PLL_DITHER_FRAC_REG 0x10 333ca09e66bSWills Wang #define AR933X_PLL_SWITCH_CLOCK_CONTROL_REG 0x24 3341d3d0f1fSWills Wang 3351d3d0f1fSWills Wang #define AR933X_PLL_CPU_CONFIG_NINT_SHIFT 10 3361d3d0f1fSWills Wang #define AR933X_PLL_CPU_CONFIG_NINT_MASK 0x3f 3371d3d0f1fSWills Wang #define AR933X_PLL_CPU_CONFIG_REFDIV_SHIFT 16 3381d3d0f1fSWills Wang #define AR933X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f 3391d3d0f1fSWills Wang #define AR933X_PLL_CPU_CONFIG_OUTDIV_SHIFT 23 3401d3d0f1fSWills Wang #define AR933X_PLL_CPU_CONFIG_OUTDIV_MASK 0x7 3411d3d0f1fSWills Wang 3421d3d0f1fSWills Wang #define AR933X_PLL_CLK_CTRL_BYPASS BIT(2) 3431d3d0f1fSWills Wang #define AR933X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT 5 3441d3d0f1fSWills Wang #define AR933X_PLL_CLK_CTRL_CPU_POST_DIV_MASK 0x3 3451d3d0f1fSWills Wang #define AR933X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT 10 3461d3d0f1fSWills Wang #define AR933X_PLL_CLK_CTRL_DDR_POST_DIV_MASK 0x3 3471d3d0f1fSWills Wang #define AR933X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT 15 3481d3d0f1fSWills Wang #define AR933X_PLL_CLK_CTRL_AHB_POST_DIV_MASK 0x7 3491d3d0f1fSWills Wang 3501d3d0f1fSWills Wang #define AR934X_PLL_CPU_CONFIG_REG 0x00 3511d3d0f1fSWills Wang #define AR934X_PLL_DDR_CONFIG_REG 0x04 3521d3d0f1fSWills Wang #define AR934X_PLL_CPU_DDR_CLK_CTRL_REG 0x08 3531d3d0f1fSWills Wang #define AR934X_PLL_SWITCH_CLOCK_CONTROL_REG 0x24 3541d3d0f1fSWills Wang #define AR934X_PLL_ETH_XMII_CONTROL_REG 0x2c 355e08539b7SMarek Vasut #define AR934X_PLL_DDR_DIT_FRAC_REG 0x44 356e08539b7SMarek Vasut #define AR934X_PLL_CPU_DIT_FRAC_REG 0x48 3571d3d0f1fSWills Wang 3581d3d0f1fSWills Wang #define AR934X_PLL_CPU_CONFIG_NFRAC_SHIFT 0 3591d3d0f1fSWills Wang #define AR934X_PLL_CPU_CONFIG_NFRAC_MASK 0x3f 3601d3d0f1fSWills Wang #define AR934X_PLL_CPU_CONFIG_NINT_SHIFT 6 3611d3d0f1fSWills Wang #define AR934X_PLL_CPU_CONFIG_NINT_MASK 0x3f 3621d3d0f1fSWills Wang #define AR934X_PLL_CPU_CONFIG_REFDIV_SHIFT 12 3631d3d0f1fSWills Wang #define AR934X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f 364e08539b7SMarek Vasut #define AR934X_PLL_CPU_CONFIG_RANGE_SHIFT 17 365e08539b7SMarek Vasut #define AR934X_PLL_CPU_CONFIG_RANGE_MASK 0x3 3661d3d0f1fSWills Wang #define AR934X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19 3671d3d0f1fSWills Wang #define AR934X_PLL_CPU_CONFIG_OUTDIV_MASK 0x3 368e08539b7SMarek Vasut #define AR934X_PLL_CPU_CONFIG_PLLPWD BIT(30) 369e08539b7SMarek Vasut #define AR934X_PLL_CPU_CONFIG_UPDATING BIT(31) 3701d3d0f1fSWills Wang 3711d3d0f1fSWills Wang #define AR934X_PLL_DDR_CONFIG_NFRAC_SHIFT 0 3721d3d0f1fSWills Wang #define AR934X_PLL_DDR_CONFIG_NFRAC_MASK 0x3ff 3731d3d0f1fSWills Wang #define AR934X_PLL_DDR_CONFIG_NINT_SHIFT 10 3741d3d0f1fSWills Wang #define AR934X_PLL_DDR_CONFIG_NINT_MASK 0x3f 3751d3d0f1fSWills Wang #define AR934X_PLL_DDR_CONFIG_REFDIV_SHIFT 16 3761d3d0f1fSWills Wang #define AR934X_PLL_DDR_CONFIG_REFDIV_MASK 0x1f 377e08539b7SMarek Vasut #define AR934X_PLL_DDR_CONFIG_RANGE_SHIFT 21 378e08539b7SMarek Vasut #define AR934X_PLL_DDR_CONFIG_RANGE_MASK 0x3 3791d3d0f1fSWills Wang #define AR934X_PLL_DDR_CONFIG_OUTDIV_SHIFT 23 3801d3d0f1fSWills Wang #define AR934X_PLL_DDR_CONFIG_OUTDIV_MASK 0x7 381e08539b7SMarek Vasut #define AR934X_PLL_DDR_CONFIG_PLLPWD BIT(30) 382e08539b7SMarek Vasut #define AR934X_PLL_DDR_CONFIG_UPDATING BIT(31) 3831d3d0f1fSWills Wang 3841d3d0f1fSWills Wang #define AR934X_PLL_CLK_CTRL_CPU_PLL_BYPASS BIT(2) 3851d3d0f1fSWills Wang #define AR934X_PLL_CLK_CTRL_DDR_PLL_BYPASS BIT(3) 3861d3d0f1fSWills Wang #define AR934X_PLL_CLK_CTRL_AHB_PLL_BYPASS BIT(4) 3871d3d0f1fSWills Wang #define AR934X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT 5 3881d3d0f1fSWills Wang #define AR934X_PLL_CLK_CTRL_CPU_POST_DIV_MASK 0x1f 3891d3d0f1fSWills Wang #define AR934X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT 10 3901d3d0f1fSWills Wang #define AR934X_PLL_CLK_CTRL_DDR_POST_DIV_MASK 0x1f 3911d3d0f1fSWills Wang #define AR934X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT 15 3921d3d0f1fSWills Wang #define AR934X_PLL_CLK_CTRL_AHB_POST_DIV_MASK 0x1f 3931d3d0f1fSWills Wang #define AR934X_PLL_CLK_CTRL_CPUCLK_FROM_CPUPLL BIT(20) 3941d3d0f1fSWills Wang #define AR934X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21) 3951d3d0f1fSWills Wang #define AR934X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) 3961d3d0f1fSWills Wang 3971d3d0f1fSWills Wang #define AR934X_PLL_SWITCH_CLK_CTRL_MDIO_CLK_SEL BIT(6) 3981d3d0f1fSWills Wang 399e08539b7SMarek Vasut #define AR934X_PLL_DDR_DIT_FRAC_MAX_SHIFT 0 400e08539b7SMarek Vasut #define AR934X_PLL_DDR_DIT_FRAC_MAX_MASK 0x3ff 401e08539b7SMarek Vasut #define AR934X_PLL_DDR_DIT_FRAC_MIN_SHIFT 10 402e08539b7SMarek Vasut #define AR934X_PLL_DDR_DIT_FRAC_MIN_MASK 0x3ff 403e08539b7SMarek Vasut #define AR934X_PLL_DDR_DIT_FRAC_STEP_SHIFT 20 404e08539b7SMarek Vasut #define AR934X_PLL_DDR_DIT_FRAC_STEP_MASK 0x3f 405e08539b7SMarek Vasut #define AR934X_PLL_DDR_DIT_UPD_CNT_SHIFT 27 406e08539b7SMarek Vasut #define AR934X_PLL_DDR_DIT_UPD_CNT_MASK 0x3f 407e08539b7SMarek Vasut #define AR934X_PLL_DDR_DIT_DITHER_EN BIT(31) 408e08539b7SMarek Vasut 409e08539b7SMarek Vasut #define AR934X_PLL_CPU_DIT_FRAC_MAX_SHIFT 0 410e08539b7SMarek Vasut #define AR934X_PLL_CPU_DIT_FRAC_MAX_MASK 0x3f 411e08539b7SMarek Vasut #define AR934X_PLL_CPU_DIT_FRAC_MIN_SHIFT 6 412e08539b7SMarek Vasut #define AR934X_PLL_CPU_DIT_FRAC_MIN_MASK 0x3f 413e08539b7SMarek Vasut #define AR934X_PLL_CPU_DIT_FRAC_STEP_SHIFT 12 414e08539b7SMarek Vasut #define AR934X_PLL_CPU_DIT_FRAC_STEP_MASK 0x3f 415e08539b7SMarek Vasut #define AR934X_PLL_CPU_DIT_UPD_CNT_SHIFT 18 416e08539b7SMarek Vasut #define AR934X_PLL_CPU_DIT_UPD_CNT_MASK 0x3f 417e08539b7SMarek Vasut #define AR934X_PLL_CPU_DIT_DITHER_EN BIT(31) 418e08539b7SMarek Vasut 4191d3d0f1fSWills Wang #define QCA953X_PLL_CPU_CONFIG_REG 0x00 4201d3d0f1fSWills Wang #define QCA953X_PLL_DDR_CONFIG_REG 0x04 4211d3d0f1fSWills Wang #define QCA953X_PLL_CLK_CTRL_REG 0x08 4221d3d0f1fSWills Wang #define QCA953X_PLL_SWITCH_CLOCK_CONTROL_REG 0x24 4231d3d0f1fSWills Wang #define QCA953X_PLL_ETH_XMII_CONTROL_REG 0x2c 4241d3d0f1fSWills Wang #define QCA953X_PLL_DDR_DIT_FRAC_REG 0x44 4251d3d0f1fSWills Wang #define QCA953X_PLL_CPU_DIT_FRAC_REG 0x48 4261d3d0f1fSWills Wang 4271d3d0f1fSWills Wang #define QCA953X_PLL_CPU_CONFIG_NFRAC_SHIFT 0 4281d3d0f1fSWills Wang #define QCA953X_PLL_CPU_CONFIG_NFRAC_MASK 0x3f 4291d3d0f1fSWills Wang #define QCA953X_PLL_CPU_CONFIG_NINT_SHIFT 6 4301d3d0f1fSWills Wang #define QCA953X_PLL_CPU_CONFIG_NINT_MASK 0x3f 4311d3d0f1fSWills Wang #define QCA953X_PLL_CPU_CONFIG_REFDIV_SHIFT 12 4321d3d0f1fSWills Wang #define QCA953X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f 4331d3d0f1fSWills Wang #define QCA953X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19 4341d3d0f1fSWills Wang #define QCA953X_PLL_CPU_CONFIG_OUTDIV_MASK 0x7 4351d3d0f1fSWills Wang 4361d3d0f1fSWills Wang #define QCA953X_PLL_DDR_CONFIG_NFRAC_SHIFT 0 4371d3d0f1fSWills Wang #define QCA953X_PLL_DDR_CONFIG_NFRAC_MASK 0x3ff 4381d3d0f1fSWills Wang #define QCA953X_PLL_DDR_CONFIG_NINT_SHIFT 10 4391d3d0f1fSWills Wang #define QCA953X_PLL_DDR_CONFIG_NINT_MASK 0x3f 4401d3d0f1fSWills Wang #define QCA953X_PLL_DDR_CONFIG_REFDIV_SHIFT 16 4411d3d0f1fSWills Wang #define QCA953X_PLL_DDR_CONFIG_REFDIV_MASK 0x1f 4421d3d0f1fSWills Wang #define QCA953X_PLL_DDR_CONFIG_OUTDIV_SHIFT 23 4431d3d0f1fSWills Wang #define QCA953X_PLL_DDR_CONFIG_OUTDIV_MASK 0x7 4441d3d0f1fSWills Wang 4451d3d0f1fSWills Wang #define QCA953X_PLL_CONFIG_PWD BIT(30) 4461d3d0f1fSWills Wang 4471d3d0f1fSWills Wang #define QCA953X_PLL_CLK_CTRL_CPU_PLL_BYPASS BIT(2) 4481d3d0f1fSWills Wang #define QCA953X_PLL_CLK_CTRL_DDR_PLL_BYPASS BIT(3) 4491d3d0f1fSWills Wang #define QCA953X_PLL_CLK_CTRL_AHB_PLL_BYPASS BIT(4) 4501d3d0f1fSWills Wang #define QCA953X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT 5 4511d3d0f1fSWills Wang #define QCA953X_PLL_CLK_CTRL_CPU_POST_DIV_MASK 0x1f 4521d3d0f1fSWills Wang #define QCA953X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT 10 4531d3d0f1fSWills Wang #define QCA953X_PLL_CLK_CTRL_DDR_POST_DIV_MASK 0x1f 4541d3d0f1fSWills Wang #define QCA953X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT 15 4551d3d0f1fSWills Wang #define QCA953X_PLL_CLK_CTRL_AHB_POST_DIV_MASK 0x1f 4561d3d0f1fSWills Wang #define QCA953X_PLL_CLK_CTRL_CPUCLK_FROM_CPUPLL BIT(20) 4571d3d0f1fSWills Wang #define QCA953X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21) 4581d3d0f1fSWills Wang #define QCA953X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) 4591d3d0f1fSWills Wang 4601d3d0f1fSWills Wang #define QCA953X_PLL_CPU_DIT_FRAC_MAX_SHIFT 0 4611d3d0f1fSWills Wang #define QCA953X_PLL_CPU_DIT_FRAC_MAX_MASK 0x3f 4621d3d0f1fSWills Wang #define QCA953X_PLL_CPU_DIT_FRAC_MIN_SHIFT 6 4631d3d0f1fSWills Wang #define QCA953X_PLL_CPU_DIT_FRAC_MIN_MASK 0x3f 4641d3d0f1fSWills Wang #define QCA953X_PLL_CPU_DIT_FRAC_STEP_SHIFT 12 4651d3d0f1fSWills Wang #define QCA953X_PLL_CPU_DIT_FRAC_STEP_MASK 0x3f 4661d3d0f1fSWills Wang #define QCA953X_PLL_CPU_DIT_UPD_CNT_SHIFT 18 4671d3d0f1fSWills Wang #define QCA953X_PLL_CPU_DIT_UPD_CNT_MASK 0x3f 4681d3d0f1fSWills Wang 4691d3d0f1fSWills Wang #define QCA953X_PLL_DDR_DIT_FRAC_MAX_SHIFT 0 4701d3d0f1fSWills Wang #define QCA953X_PLL_DDR_DIT_FRAC_MAX_MASK 0x3ff 4711d3d0f1fSWills Wang #define QCA953X_PLL_DDR_DIT_FRAC_MIN_SHIFT 9 4721d3d0f1fSWills Wang #define QCA953X_PLL_DDR_DIT_FRAC_MIN_MASK 0x3ff 4731d3d0f1fSWills Wang #define QCA953X_PLL_DDR_DIT_FRAC_STEP_SHIFT 20 4741d3d0f1fSWills Wang #define QCA953X_PLL_DDR_DIT_FRAC_STEP_MASK 0x3f 4751d3d0f1fSWills Wang #define QCA953X_PLL_DDR_DIT_UPD_CNT_SHIFT 27 4761d3d0f1fSWills Wang #define QCA953X_PLL_DDR_DIT_UPD_CNT_MASK 0x3f 4771d3d0f1fSWills Wang 4781d3d0f1fSWills Wang #define QCA953X_PLL_DIT_FRAC_EN BIT(31) 4791d3d0f1fSWills Wang 4801d3d0f1fSWills Wang #define QCA955X_PLL_CPU_CONFIG_REG 0x00 4811d3d0f1fSWills Wang #define QCA955X_PLL_DDR_CONFIG_REG 0x04 4821d3d0f1fSWills Wang #define QCA955X_PLL_CLK_CTRL_REG 0x08 4831d3d0f1fSWills Wang #define QCA955X_PLL_ETH_XMII_CONTROL_REG 0x28 4841d3d0f1fSWills Wang #define QCA955X_PLL_ETH_SGMII_CONTROL_REG 0x48 4851d3d0f1fSWills Wang 4861d3d0f1fSWills Wang #define QCA955X_PLL_CPU_CONFIG_NFRAC_SHIFT 0 4871d3d0f1fSWills Wang #define QCA955X_PLL_CPU_CONFIG_NFRAC_MASK 0x3f 4881d3d0f1fSWills Wang #define QCA955X_PLL_CPU_CONFIG_NINT_SHIFT 6 4891d3d0f1fSWills Wang #define QCA955X_PLL_CPU_CONFIG_NINT_MASK 0x3f 4901d3d0f1fSWills Wang #define QCA955X_PLL_CPU_CONFIG_REFDIV_SHIFT 12 4911d3d0f1fSWills Wang #define QCA955X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f 4921d3d0f1fSWills Wang #define QCA955X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19 4931d3d0f1fSWills Wang #define QCA955X_PLL_CPU_CONFIG_OUTDIV_MASK 0x3 4941d3d0f1fSWills Wang 4951d3d0f1fSWills Wang #define QCA955X_PLL_DDR_CONFIG_NFRAC_SHIFT 0 4961d3d0f1fSWills Wang #define QCA955X_PLL_DDR_CONFIG_NFRAC_MASK 0x3ff 4971d3d0f1fSWills Wang #define QCA955X_PLL_DDR_CONFIG_NINT_SHIFT 10 4981d3d0f1fSWills Wang #define QCA955X_PLL_DDR_CONFIG_NINT_MASK 0x3f 4991d3d0f1fSWills Wang #define QCA955X_PLL_DDR_CONFIG_REFDIV_SHIFT 16 5001d3d0f1fSWills Wang #define QCA955X_PLL_DDR_CONFIG_REFDIV_MASK 0x1f 5011d3d0f1fSWills Wang #define QCA955X_PLL_DDR_CONFIG_OUTDIV_SHIFT 23 5021d3d0f1fSWills Wang #define QCA955X_PLL_DDR_CONFIG_OUTDIV_MASK 0x7 5031d3d0f1fSWills Wang 5041d3d0f1fSWills Wang #define QCA955X_PLL_CLK_CTRL_CPU_PLL_BYPASS BIT(2) 5051d3d0f1fSWills Wang #define QCA955X_PLL_CLK_CTRL_DDR_PLL_BYPASS BIT(3) 5061d3d0f1fSWills Wang #define QCA955X_PLL_CLK_CTRL_AHB_PLL_BYPASS BIT(4) 5071d3d0f1fSWills Wang #define QCA955X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT 5 5081d3d0f1fSWills Wang #define QCA955X_PLL_CLK_CTRL_CPU_POST_DIV_MASK 0x1f 5091d3d0f1fSWills Wang #define QCA955X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT 10 5101d3d0f1fSWills Wang #define QCA955X_PLL_CLK_CTRL_DDR_POST_DIV_MASK 0x1f 5111d3d0f1fSWills Wang #define QCA955X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT 15 5121d3d0f1fSWills Wang #define QCA955X_PLL_CLK_CTRL_AHB_POST_DIV_MASK 0x1f 5131d3d0f1fSWills Wang #define QCA955X_PLL_CLK_CTRL_CPUCLK_FROM_CPUPLL BIT(20) 5141d3d0f1fSWills Wang #define QCA955X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21) 5151d3d0f1fSWills Wang #define QCA955X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) 5161d3d0f1fSWills Wang 5171d3d0f1fSWills Wang #define QCA956X_PLL_CPU_CONFIG_REG 0x00 5181d3d0f1fSWills Wang #define QCA956X_PLL_CPU_CONFIG1_REG 0x04 5191d3d0f1fSWills Wang #define QCA956X_PLL_DDR_CONFIG_REG 0x08 5201d3d0f1fSWills Wang #define QCA956X_PLL_DDR_CONFIG1_REG 0x0c 5211d3d0f1fSWills Wang #define QCA956X_PLL_CLK_CTRL_REG 0x10 5221d3d0f1fSWills Wang 5231d3d0f1fSWills Wang #define QCA956X_PLL_CPU_CONFIG_REFDIV_SHIFT 12 5241d3d0f1fSWills Wang #define QCA956X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f 5251d3d0f1fSWills Wang #define QCA956X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19 5261d3d0f1fSWills Wang #define QCA956X_PLL_CPU_CONFIG_OUTDIV_MASK 0x7 5271d3d0f1fSWills Wang 5281d3d0f1fSWills Wang #define QCA956X_PLL_CPU_CONFIG1_NFRAC_L_SHIFT 0 5291d3d0f1fSWills Wang #define QCA956X_PLL_CPU_CONFIG1_NFRAC_L_MASK 0x1f 5301d3d0f1fSWills Wang #define QCA956X_PLL_CPU_CONFIG1_NFRAC_H_SHIFT 5 5311d3d0f1fSWills Wang #define QCA956X_PLL_CPU_CONFIG1_NFRAC_H_MASK 0x3fff 5321d3d0f1fSWills Wang #define QCA956X_PLL_CPU_CONFIG1_NINT_SHIFT 18 5331d3d0f1fSWills Wang #define QCA956X_PLL_CPU_CONFIG1_NINT_MASK 0x1ff 5341d3d0f1fSWills Wang 5351d3d0f1fSWills Wang #define QCA956X_PLL_DDR_CONFIG_REFDIV_SHIFT 16 5361d3d0f1fSWills Wang #define QCA956X_PLL_DDR_CONFIG_REFDIV_MASK 0x1f 5371d3d0f1fSWills Wang #define QCA956X_PLL_DDR_CONFIG_OUTDIV_SHIFT 23 5381d3d0f1fSWills Wang #define QCA956X_PLL_DDR_CONFIG_OUTDIV_MASK 0x7 5391d3d0f1fSWills Wang 5401d3d0f1fSWills Wang #define QCA956X_PLL_DDR_CONFIG1_NFRAC_L_SHIFT 0 5411d3d0f1fSWills Wang #define QCA956X_PLL_DDR_CONFIG1_NFRAC_L_MASK 0x1f 5421d3d0f1fSWills Wang #define QCA956X_PLL_DDR_CONFIG1_NFRAC_H_SHIFT 5 5431d3d0f1fSWills Wang #define QCA956X_PLL_DDR_CONFIG1_NFRAC_H_MASK 0x3fff 5441d3d0f1fSWills Wang #define QCA956X_PLL_DDR_CONFIG1_NINT_SHIFT 18 5451d3d0f1fSWills Wang #define QCA956X_PLL_DDR_CONFIG1_NINT_MASK 0x1ff 5461d3d0f1fSWills Wang 5471d3d0f1fSWills Wang #define QCA956X_PLL_CLK_CTRL_CPU_PLL_BYPASS BIT(2) 5481d3d0f1fSWills Wang #define QCA956X_PLL_CLK_CTRL_DDR_PLL_BYPASS BIT(3) 5491d3d0f1fSWills Wang #define QCA956X_PLL_CLK_CTRL_AHB_PLL_BYPASS BIT(4) 5501d3d0f1fSWills Wang #define QCA956X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT 5 5511d3d0f1fSWills Wang #define QCA956X_PLL_CLK_CTRL_CPU_POST_DIV_MASK 0x1f 5521d3d0f1fSWills Wang #define QCA956X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT 10 5531d3d0f1fSWills Wang #define QCA956X_PLL_CLK_CTRL_DDR_POST_DIV_MASK 0x1f 5541d3d0f1fSWills Wang #define QCA956X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT 15 5551d3d0f1fSWills Wang #define QCA956X_PLL_CLK_CTRL_AHB_POST_DIV_MASK 0x1f 5561d3d0f1fSWills Wang #define QCA956X_PLL_CLK_CTRL_CPU_DDRCLK_FROM_DDRPLL BIT(20) 5571d3d0f1fSWills Wang #define QCA956X_PLL_CLK_CTRL_CPU_DDRCLK_FROM_CPUPLL BIT(21) 5581d3d0f1fSWills Wang #define QCA956X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) 5591d3d0f1fSWills Wang 5601d3d0f1fSWills Wang /* 5611d3d0f1fSWills Wang * USB_CONFIG block 5621d3d0f1fSWills Wang */ 5631d3d0f1fSWills Wang #define AR71XX_USB_CTRL_REG_FLADJ 0x00 5641d3d0f1fSWills Wang #define AR71XX_USB_CTRL_REG_CONFIG 0x04 5651d3d0f1fSWills Wang 5661d3d0f1fSWills Wang /* 5671d3d0f1fSWills Wang * RESET block 5681d3d0f1fSWills Wang */ 5691d3d0f1fSWills Wang #define AR71XX_RESET_REG_TIMER 0x00 5701d3d0f1fSWills Wang #define AR71XX_RESET_REG_TIMER_RELOAD 0x04 5711d3d0f1fSWills Wang #define AR71XX_RESET_REG_WDOG_CTRL 0x08 5721d3d0f1fSWills Wang #define AR71XX_RESET_REG_WDOG 0x0c 5731d3d0f1fSWills Wang #define AR71XX_RESET_REG_MISC_INT_STATUS 0x10 5741d3d0f1fSWills Wang #define AR71XX_RESET_REG_MISC_INT_ENABLE 0x14 5751d3d0f1fSWills Wang #define AR71XX_RESET_REG_PCI_INT_STATUS 0x18 5761d3d0f1fSWills Wang #define AR71XX_RESET_REG_PCI_INT_ENABLE 0x1c 5771d3d0f1fSWills Wang #define AR71XX_RESET_REG_GLOBAL_INT_STATUS 0x20 5781d3d0f1fSWills Wang #define AR71XX_RESET_REG_RESET_MODULE 0x24 5791d3d0f1fSWills Wang #define AR71XX_RESET_REG_PERFC_CTRL 0x2c 5801d3d0f1fSWills Wang #define AR71XX_RESET_REG_PERFC0 0x30 5811d3d0f1fSWills Wang #define AR71XX_RESET_REG_PERFC1 0x34 5821d3d0f1fSWills Wang #define AR71XX_RESET_REG_REV_ID 0x90 5831d3d0f1fSWills Wang 5841d3d0f1fSWills Wang #define AR913X_RESET_REG_GLOBAL_INT_STATUS 0x18 5851d3d0f1fSWills Wang #define AR913X_RESET_REG_RESET_MODULE 0x1c 5861d3d0f1fSWills Wang #define AR913X_RESET_REG_PERF_CTRL 0x20 5871d3d0f1fSWills Wang #define AR913X_RESET_REG_PERFC0 0x24 5881d3d0f1fSWills Wang #define AR913X_RESET_REG_PERFC1 0x28 5891d3d0f1fSWills Wang 5901d3d0f1fSWills Wang #define AR724X_RESET_REG_RESET_MODULE 0x1c 5911d3d0f1fSWills Wang 5921d3d0f1fSWills Wang #define AR933X_RESET_REG_RESET_MODULE 0x1c 5931d3d0f1fSWills Wang #define AR933X_RESET_REG_BOOTSTRAP 0xac 5941d3d0f1fSWills Wang 5951d3d0f1fSWills Wang #define AR934X_RESET_REG_RESET_MODULE 0x1c 5961d3d0f1fSWills Wang #define AR934X_RESET_REG_BOOTSTRAP 0xb0 5971d3d0f1fSWills Wang #define AR934X_RESET_REG_PCIE_WMAC_INT_STATUS 0xac 5981d3d0f1fSWills Wang 5991d3d0f1fSWills Wang #define QCA953X_RESET_REG_RESET_MODULE 0x1c 6001d3d0f1fSWills Wang #define QCA953X_RESET_REG_BOOTSTRAP 0xb0 6011d3d0f1fSWills Wang #define QCA953X_RESET_REG_PCIE_WMAC_INT_STATUS 0xac 6021d3d0f1fSWills Wang 6031d3d0f1fSWills Wang #define QCA955X_RESET_REG_RESET_MODULE 0x1c 6041d3d0f1fSWills Wang #define QCA955X_RESET_REG_BOOTSTRAP 0xb0 6051d3d0f1fSWills Wang #define QCA955X_RESET_REG_EXT_INT_STATUS 0xac 6061d3d0f1fSWills Wang 6071d3d0f1fSWills Wang #define QCA956X_RESET_REG_RESET_MODULE 0x1c 6081d3d0f1fSWills Wang #define QCA956X_RESET_REG_BOOTSTRAP 0xb0 6091d3d0f1fSWills Wang #define QCA956X_RESET_REG_EXT_INT_STATUS 0xac 6101d3d0f1fSWills Wang 6111d3d0f1fSWills Wang #define MISC_INT_MIPS_SI_TIMERINT_MASK BIT(28) 6121d3d0f1fSWills Wang #define MISC_INT_ETHSW BIT(12) 6131d3d0f1fSWills Wang #define MISC_INT_TIMER4 BIT(10) 6141d3d0f1fSWills Wang #define MISC_INT_TIMER3 BIT(9) 6151d3d0f1fSWills Wang #define MISC_INT_TIMER2 BIT(8) 6161d3d0f1fSWills Wang #define MISC_INT_DMA BIT(7) 6171d3d0f1fSWills Wang #define MISC_INT_OHCI BIT(6) 6181d3d0f1fSWills Wang #define MISC_INT_PERFC BIT(5) 6191d3d0f1fSWills Wang #define MISC_INT_WDOG BIT(4) 6201d3d0f1fSWills Wang #define MISC_INT_UART BIT(3) 6211d3d0f1fSWills Wang #define MISC_INT_GPIO BIT(2) 6221d3d0f1fSWills Wang #define MISC_INT_ERROR BIT(1) 6231d3d0f1fSWills Wang #define MISC_INT_TIMER BIT(0) 6241d3d0f1fSWills Wang 6251d3d0f1fSWills Wang #define AR71XX_RESET_EXTERNAL BIT(28) 6261d3d0f1fSWills Wang #define AR71XX_RESET_FULL_CHIP BIT(24) 6271d3d0f1fSWills Wang #define AR71XX_RESET_CPU_NMI BIT(21) 6281d3d0f1fSWills Wang #define AR71XX_RESET_CPU_COLD BIT(20) 6291d3d0f1fSWills Wang #define AR71XX_RESET_DMA BIT(19) 6301d3d0f1fSWills Wang #define AR71XX_RESET_SLIC BIT(18) 6311d3d0f1fSWills Wang #define AR71XX_RESET_STEREO BIT(17) 6321d3d0f1fSWills Wang #define AR71XX_RESET_DDR BIT(16) 6331d3d0f1fSWills Wang #define AR71XX_RESET_GE1_MAC BIT(13) 6341d3d0f1fSWills Wang #define AR71XX_RESET_GE1_PHY BIT(12) 6351d3d0f1fSWills Wang #define AR71XX_RESET_USBSUS_OVERRIDE BIT(10) 6361d3d0f1fSWills Wang #define AR71XX_RESET_GE0_MAC BIT(9) 6371d3d0f1fSWills Wang #define AR71XX_RESET_GE0_PHY BIT(8) 6381d3d0f1fSWills Wang #define AR71XX_RESET_USB_OHCI_DLL BIT(6) 6391d3d0f1fSWills Wang #define AR71XX_RESET_USB_HOST BIT(5) 6401d3d0f1fSWills Wang #define AR71XX_RESET_USB_PHY BIT(4) 6411d3d0f1fSWills Wang #define AR71XX_RESET_PCI_BUS BIT(1) 6421d3d0f1fSWills Wang #define AR71XX_RESET_PCI_CORE BIT(0) 6431d3d0f1fSWills Wang 6441d3d0f1fSWills Wang #define AR7240_RESET_USB_HOST BIT(5) 6451d3d0f1fSWills Wang #define AR7240_RESET_OHCI_DLL BIT(3) 6461d3d0f1fSWills Wang 6471d3d0f1fSWills Wang #define AR724X_RESET_GE1_MDIO BIT(23) 6481d3d0f1fSWills Wang #define AR724X_RESET_GE0_MDIO BIT(22) 6491d3d0f1fSWills Wang #define AR724X_RESET_PCIE_PHY_SERIAL BIT(10) 6501d3d0f1fSWills Wang #define AR724X_RESET_PCIE_PHY BIT(7) 6511d3d0f1fSWills Wang #define AR724X_RESET_PCIE BIT(6) 6521d3d0f1fSWills Wang #define AR724X_RESET_USB_HOST BIT(5) 6531d3d0f1fSWills Wang #define AR724X_RESET_USB_PHY BIT(4) 6541d3d0f1fSWills Wang #define AR724X_RESET_USBSUS_OVERRIDE BIT(3) 6551d3d0f1fSWills Wang 6561d3d0f1fSWills Wang #define AR913X_RESET_AMBA2WMAC BIT(22) 6571d3d0f1fSWills Wang #define AR913X_RESET_USBSUS_OVERRIDE BIT(10) 6581d3d0f1fSWills Wang #define AR913X_RESET_USB_HOST BIT(5) 6591d3d0f1fSWills Wang #define AR913X_RESET_USB_PHY BIT(4) 6601d3d0f1fSWills Wang 6611d3d0f1fSWills Wang #define AR933X_RESET_GE1_MDIO BIT(23) 6621d3d0f1fSWills Wang #define AR933X_RESET_GE0_MDIO BIT(22) 66342a3f3e6SWills Wang #define AR933X_RESET_ETH_SWITCH_ANALOG BIT(14) 6641d3d0f1fSWills Wang #define AR933X_RESET_GE1_MAC BIT(13) 6651d3d0f1fSWills Wang #define AR933X_RESET_WMAC BIT(11) 6661d3d0f1fSWills Wang #define AR933X_RESET_GE0_MAC BIT(9) 6674771bbeeSMarek Vasut #define AR933X_RESET_ETH_SWITCH BIT(8) 6681d3d0f1fSWills Wang #define AR933X_RESET_USB_HOST BIT(5) 6691d3d0f1fSWills Wang #define AR933X_RESET_USB_PHY BIT(4) 6701d3d0f1fSWills Wang #define AR933X_RESET_USBSUS_OVERRIDE BIT(3) 6711d3d0f1fSWills Wang 6721d3d0f1fSWills Wang #define AR934X_RESET_HOST BIT(31) 6731d3d0f1fSWills Wang #define AR934X_RESET_SLIC BIT(30) 6741d3d0f1fSWills Wang #define AR934X_RESET_HDMA BIT(29) 6751d3d0f1fSWills Wang #define AR934X_RESET_EXTERNAL BIT(28) 6761d3d0f1fSWills Wang #define AR934X_RESET_RTC BIT(27) 6771d3d0f1fSWills Wang #define AR934X_RESET_PCIE_EP_INT BIT(26) 6781d3d0f1fSWills Wang #define AR934X_RESET_CHKSUM_ACC BIT(25) 6791d3d0f1fSWills Wang #define AR934X_RESET_FULL_CHIP BIT(24) 6801d3d0f1fSWills Wang #define AR934X_RESET_GE1_MDIO BIT(23) 6811d3d0f1fSWills Wang #define AR934X_RESET_GE0_MDIO BIT(22) 6821d3d0f1fSWills Wang #define AR934X_RESET_CPU_NMI BIT(21) 6831d3d0f1fSWills Wang #define AR934X_RESET_CPU_COLD BIT(20) 6841d3d0f1fSWills Wang #define AR934X_RESET_HOST_RESET_INT BIT(19) 6851d3d0f1fSWills Wang #define AR934X_RESET_PCIE_EP BIT(18) 6861d3d0f1fSWills Wang #define AR934X_RESET_UART1 BIT(17) 6871d3d0f1fSWills Wang #define AR934X_RESET_DDR BIT(16) 6881d3d0f1fSWills Wang #define AR934X_RESET_USB_PHY_PLL_PWD_EXT BIT(15) 6891d3d0f1fSWills Wang #define AR934X_RESET_NANDF BIT(14) 6901d3d0f1fSWills Wang #define AR934X_RESET_GE1_MAC BIT(13) 6911d3d0f1fSWills Wang #define AR934X_RESET_ETH_SWITCH_ANALOG BIT(12) 6921d3d0f1fSWills Wang #define AR934X_RESET_USB_PHY_ANALOG BIT(11) 6931d3d0f1fSWills Wang #define AR934X_RESET_HOST_DMA_INT BIT(10) 6941d3d0f1fSWills Wang #define AR934X_RESET_GE0_MAC BIT(9) 6951d3d0f1fSWills Wang #define AR934X_RESET_ETH_SWITCH BIT(8) 6961d3d0f1fSWills Wang #define AR934X_RESET_PCIE_PHY BIT(7) 6971d3d0f1fSWills Wang #define AR934X_RESET_PCIE BIT(6) 6981d3d0f1fSWills Wang #define AR934X_RESET_USB_HOST BIT(5) 6991d3d0f1fSWills Wang #define AR934X_RESET_USB_PHY BIT(4) 7001d3d0f1fSWills Wang #define AR934X_RESET_USBSUS_OVERRIDE BIT(3) 7011d3d0f1fSWills Wang #define AR934X_RESET_LUT BIT(2) 7021d3d0f1fSWills Wang #define AR934X_RESET_MBOX BIT(1) 7031d3d0f1fSWills Wang #define AR934X_RESET_I2S BIT(0) 7041d3d0f1fSWills Wang 7051d3d0f1fSWills Wang #define QCA953X_RESET_USB_EXT_PWR BIT(29) 7061d3d0f1fSWills Wang #define QCA953X_RESET_EXTERNAL BIT(28) 7071d3d0f1fSWills Wang #define QCA953X_RESET_RTC BIT(27) 7081d3d0f1fSWills Wang #define QCA953X_RESET_FULL_CHIP BIT(24) 7091d3d0f1fSWills Wang #define QCA953X_RESET_GE1_MDIO BIT(23) 7101d3d0f1fSWills Wang #define QCA953X_RESET_GE0_MDIO BIT(22) 7111d3d0f1fSWills Wang #define QCA953X_RESET_CPU_NMI BIT(21) 7121d3d0f1fSWills Wang #define QCA953X_RESET_CPU_COLD BIT(20) 7131d3d0f1fSWills Wang #define QCA953X_RESET_DDR BIT(16) 7141d3d0f1fSWills Wang #define QCA953X_RESET_USB_PHY_PLL_PWD_EXT BIT(15) 7151d3d0f1fSWills Wang #define QCA953X_RESET_GE1_MAC BIT(13) 7161d3d0f1fSWills Wang #define QCA953X_RESET_ETH_SWITCH_ANALOG BIT(12) 7171d3d0f1fSWills Wang #define QCA953X_RESET_USB_PHY_ANALOG BIT(11) 7181d3d0f1fSWills Wang #define QCA953X_RESET_GE0_MAC BIT(9) 7191d3d0f1fSWills Wang #define QCA953X_RESET_ETH_SWITCH BIT(8) 7201d3d0f1fSWills Wang #define QCA953X_RESET_PCIE_PHY BIT(7) 7211d3d0f1fSWills Wang #define QCA953X_RESET_PCIE BIT(6) 7221d3d0f1fSWills Wang #define QCA953X_RESET_USB_HOST BIT(5) 7231d3d0f1fSWills Wang #define QCA953X_RESET_USB_PHY BIT(4) 7241d3d0f1fSWills Wang #define QCA953X_RESET_USBSUS_OVERRIDE BIT(3) 7251d3d0f1fSWills Wang 7261d3d0f1fSWills Wang #define QCA955X_RESET_HOST BIT(31) 7271d3d0f1fSWills Wang #define QCA955X_RESET_SLIC BIT(30) 7281d3d0f1fSWills Wang #define QCA955X_RESET_HDMA BIT(29) 7291d3d0f1fSWills Wang #define QCA955X_RESET_EXTERNAL BIT(28) 7301d3d0f1fSWills Wang #define QCA955X_RESET_RTC BIT(27) 7311d3d0f1fSWills Wang #define QCA955X_RESET_PCIE_EP_INT BIT(26) 7321d3d0f1fSWills Wang #define QCA955X_RESET_CHKSUM_ACC BIT(25) 7331d3d0f1fSWills Wang #define QCA955X_RESET_FULL_CHIP BIT(24) 7341d3d0f1fSWills Wang #define QCA955X_RESET_GE1_MDIO BIT(23) 7351d3d0f1fSWills Wang #define QCA955X_RESET_GE0_MDIO BIT(22) 7361d3d0f1fSWills Wang #define QCA955X_RESET_CPU_NMI BIT(21) 7371d3d0f1fSWills Wang #define QCA955X_RESET_CPU_COLD BIT(20) 7381d3d0f1fSWills Wang #define QCA955X_RESET_HOST_RESET_INT BIT(19) 7391d3d0f1fSWills Wang #define QCA955X_RESET_PCIE_EP BIT(18) 7401d3d0f1fSWills Wang #define QCA955X_RESET_UART1 BIT(17) 7411d3d0f1fSWills Wang #define QCA955X_RESET_DDR BIT(16) 7421d3d0f1fSWills Wang #define QCA955X_RESET_USB_PHY_PLL_PWD_EXT BIT(15) 7431d3d0f1fSWills Wang #define QCA955X_RESET_NANDF BIT(14) 7441d3d0f1fSWills Wang #define QCA955X_RESET_GE1_MAC BIT(13) 7451d3d0f1fSWills Wang #define QCA955X_RESET_SGMII_ANALOG BIT(12) 7461d3d0f1fSWills Wang #define QCA955X_RESET_USB_PHY_ANALOG BIT(11) 7471d3d0f1fSWills Wang #define QCA955X_RESET_HOST_DMA_INT BIT(10) 7481d3d0f1fSWills Wang #define QCA955X_RESET_GE0_MAC BIT(9) 7491d3d0f1fSWills Wang #define QCA955X_RESET_SGMII BIT(8) 7501d3d0f1fSWills Wang #define QCA955X_RESET_PCIE_PHY BIT(7) 7511d3d0f1fSWills Wang #define QCA955X_RESET_PCIE BIT(6) 7521d3d0f1fSWills Wang #define QCA955X_RESET_USB_HOST BIT(5) 7531d3d0f1fSWills Wang #define QCA955X_RESET_USB_PHY BIT(4) 7541d3d0f1fSWills Wang #define QCA955X_RESET_USBSUS_OVERRIDE BIT(3) 7551d3d0f1fSWills Wang #define QCA955X_RESET_LUT BIT(2) 7561d3d0f1fSWills Wang #define QCA955X_RESET_MBOX BIT(1) 7571d3d0f1fSWills Wang #define QCA955X_RESET_I2S BIT(0) 7581d3d0f1fSWills Wang 7591d3d0f1fSWills Wang #define AR933X_BOOTSTRAP_MDIO_GPIO_EN BIT(18) 7601d3d0f1fSWills Wang #define AR933X_BOOTSTRAP_DDR2 BIT(13) 7611d3d0f1fSWills Wang #define AR933X_BOOTSTRAP_EEPBUSY BIT(4) 7621d3d0f1fSWills Wang #define AR933X_BOOTSTRAP_REF_CLK_40 BIT(0) 7631d3d0f1fSWills Wang 7641d3d0f1fSWills Wang #define AR934X_BOOTSTRAP_SW_OPTION8 BIT(23) 7651d3d0f1fSWills Wang #define AR934X_BOOTSTRAP_SW_OPTION7 BIT(22) 7661d3d0f1fSWills Wang #define AR934X_BOOTSTRAP_SW_OPTION6 BIT(21) 7671d3d0f1fSWills Wang #define AR934X_BOOTSTRAP_SW_OPTION5 BIT(20) 7681d3d0f1fSWills Wang #define AR934X_BOOTSTRAP_SW_OPTION4 BIT(19) 7691d3d0f1fSWills Wang #define AR934X_BOOTSTRAP_SW_OPTION3 BIT(18) 7701d3d0f1fSWills Wang #define AR934X_BOOTSTRAP_SW_OPTION2 BIT(17) 7711d3d0f1fSWills Wang #define AR934X_BOOTSTRAP_SW_OPTION1 BIT(16) 7721d3d0f1fSWills Wang #define AR934X_BOOTSTRAP_USB_MODE_DEVICE BIT(7) 7731d3d0f1fSWills Wang #define AR934X_BOOTSTRAP_PCIE_RC BIT(6) 7741d3d0f1fSWills Wang #define AR934X_BOOTSTRAP_EJTAG_MODE BIT(5) 7751d3d0f1fSWills Wang #define AR934X_BOOTSTRAP_REF_CLK_40 BIT(4) 7761d3d0f1fSWills Wang #define AR934X_BOOTSTRAP_BOOT_FROM_SPI BIT(2) 7771d3d0f1fSWills Wang #define AR934X_BOOTSTRAP_SDRAM_DISABLED BIT(1) 7781d3d0f1fSWills Wang #define AR934X_BOOTSTRAP_DDR1 BIT(0) 7791d3d0f1fSWills Wang 7801d3d0f1fSWills Wang #define QCA953X_BOOTSTRAP_SW_OPTION2 BIT(12) 7811d3d0f1fSWills Wang #define QCA953X_BOOTSTRAP_SW_OPTION1 BIT(11) 7821d3d0f1fSWills Wang #define QCA953X_BOOTSTRAP_EJTAG_MODE BIT(5) 7831d3d0f1fSWills Wang #define QCA953X_BOOTSTRAP_REF_CLK_40 BIT(4) 7841d3d0f1fSWills Wang #define QCA953X_BOOTSTRAP_SDRAM_DISABLED BIT(1) 7851d3d0f1fSWills Wang #define QCA953X_BOOTSTRAP_DDR1 BIT(0) 7861d3d0f1fSWills Wang 7871d3d0f1fSWills Wang #define QCA955X_BOOTSTRAP_REF_CLK_40 BIT(4) 7881d3d0f1fSWills Wang 7891d3d0f1fSWills Wang #define QCA956X_BOOTSTRAP_REF_CLK_40 BIT(2) 7901d3d0f1fSWills Wang 7911d3d0f1fSWills Wang #define AR934X_PCIE_WMAC_INT_WMAC_MISC BIT(0) 7921d3d0f1fSWills Wang #define AR934X_PCIE_WMAC_INT_WMAC_TX BIT(1) 7931d3d0f1fSWills Wang #define AR934X_PCIE_WMAC_INT_WMAC_RXLP BIT(2) 7941d3d0f1fSWills Wang #define AR934X_PCIE_WMAC_INT_WMAC_RXHP BIT(3) 7951d3d0f1fSWills Wang #define AR934X_PCIE_WMAC_INT_PCIE_RC BIT(4) 7961d3d0f1fSWills Wang #define AR934X_PCIE_WMAC_INT_PCIE_RC0 BIT(5) 7971d3d0f1fSWills Wang #define AR934X_PCIE_WMAC_INT_PCIE_RC1 BIT(6) 7981d3d0f1fSWills Wang #define AR934X_PCIE_WMAC_INT_PCIE_RC2 BIT(7) 7991d3d0f1fSWills Wang #define AR934X_PCIE_WMAC_INT_PCIE_RC3 BIT(8) 8001d3d0f1fSWills Wang #define AR934X_PCIE_WMAC_INT_WMAC_ALL \ 8011d3d0f1fSWills Wang (AR934X_PCIE_WMAC_INT_WMAC_MISC | AR934X_PCIE_WMAC_INT_WMAC_TX | \ 8021d3d0f1fSWills Wang AR934X_PCIE_WMAC_INT_WMAC_RXLP | AR934X_PCIE_WMAC_INT_WMAC_RXHP) 8031d3d0f1fSWills Wang 8041d3d0f1fSWills Wang #define AR934X_PCIE_WMAC_INT_PCIE_ALL \ 8051d3d0f1fSWills Wang (AR934X_PCIE_WMAC_INT_PCIE_RC | AR934X_PCIE_WMAC_INT_PCIE_RC0 | \ 8061d3d0f1fSWills Wang AR934X_PCIE_WMAC_INT_PCIE_RC1 | AR934X_PCIE_WMAC_INT_PCIE_RC2 | \ 8071d3d0f1fSWills Wang AR934X_PCIE_WMAC_INT_PCIE_RC3) 8081d3d0f1fSWills Wang 8091d3d0f1fSWills Wang #define QCA953X_PCIE_WMAC_INT_WMAC_MISC BIT(0) 8101d3d0f1fSWills Wang #define QCA953X_PCIE_WMAC_INT_WMAC_TX BIT(1) 8111d3d0f1fSWills Wang #define QCA953X_PCIE_WMAC_INT_WMAC_RXLP BIT(2) 8121d3d0f1fSWills Wang #define QCA953X_PCIE_WMAC_INT_WMAC_RXHP BIT(3) 8131d3d0f1fSWills Wang #define QCA953X_PCIE_WMAC_INT_PCIE_RC BIT(4) 8141d3d0f1fSWills Wang #define QCA953X_PCIE_WMAC_INT_PCIE_RC0 BIT(5) 8151d3d0f1fSWills Wang #define QCA953X_PCIE_WMAC_INT_PCIE_RC1 BIT(6) 8161d3d0f1fSWills Wang #define QCA953X_PCIE_WMAC_INT_PCIE_RC2 BIT(7) 8171d3d0f1fSWills Wang #define QCA953X_PCIE_WMAC_INT_PCIE_RC3 BIT(8) 8181d3d0f1fSWills Wang #define QCA953X_PCIE_WMAC_INT_WMAC_ALL \ 8191d3d0f1fSWills Wang (QCA953X_PCIE_WMAC_INT_WMAC_MISC | QCA953X_PCIE_WMAC_INT_WMAC_TX | \ 8201d3d0f1fSWills Wang QCA953X_PCIE_WMAC_INT_WMAC_RXLP | QCA953X_PCIE_WMAC_INT_WMAC_RXHP) 8211d3d0f1fSWills Wang 8221d3d0f1fSWills Wang #define QCA953X_PCIE_WMAC_INT_PCIE_ALL \ 8231d3d0f1fSWills Wang (QCA953X_PCIE_WMAC_INT_PCIE_RC | QCA953X_PCIE_WMAC_INT_PCIE_RC0 | \ 8241d3d0f1fSWills Wang QCA953X_PCIE_WMAC_INT_PCIE_RC1 | QCA953X_PCIE_WMAC_INT_PCIE_RC2 | \ 8251d3d0f1fSWills Wang QCA953X_PCIE_WMAC_INT_PCIE_RC3) 8261d3d0f1fSWills Wang 8271d3d0f1fSWills Wang #define QCA955X_EXT_INT_WMAC_MISC BIT(0) 8281d3d0f1fSWills Wang #define QCA955X_EXT_INT_WMAC_TX BIT(1) 8291d3d0f1fSWills Wang #define QCA955X_EXT_INT_WMAC_RXLP BIT(2) 8301d3d0f1fSWills Wang #define QCA955X_EXT_INT_WMAC_RXHP BIT(3) 8311d3d0f1fSWills Wang #define QCA955X_EXT_INT_PCIE_RC1 BIT(4) 8321d3d0f1fSWills Wang #define QCA955X_EXT_INT_PCIE_RC1_INT0 BIT(5) 8331d3d0f1fSWills Wang #define QCA955X_EXT_INT_PCIE_RC1_INT1 BIT(6) 8341d3d0f1fSWills Wang #define QCA955X_EXT_INT_PCIE_RC1_INT2 BIT(7) 8351d3d0f1fSWills Wang #define QCA955X_EXT_INT_PCIE_RC1_INT3 BIT(8) 8361d3d0f1fSWills Wang #define QCA955X_EXT_INT_PCIE_RC2 BIT(12) 8371d3d0f1fSWills Wang #define QCA955X_EXT_INT_PCIE_RC2_INT0 BIT(13) 8381d3d0f1fSWills Wang #define QCA955X_EXT_INT_PCIE_RC2_INT1 BIT(14) 8391d3d0f1fSWills Wang #define QCA955X_EXT_INT_PCIE_RC2_INT2 BIT(15) 8401d3d0f1fSWills Wang #define QCA955X_EXT_INT_PCIE_RC2_INT3 BIT(16) 8411d3d0f1fSWills Wang #define QCA955X_EXT_INT_USB1 BIT(24) 8421d3d0f1fSWills Wang #define QCA955X_EXT_INT_USB2 BIT(28) 8431d3d0f1fSWills Wang 8441d3d0f1fSWills Wang #define QCA955X_EXT_INT_WMAC_ALL \ 8451d3d0f1fSWills Wang (QCA955X_EXT_INT_WMAC_MISC | QCA955X_EXT_INT_WMAC_TX | \ 8461d3d0f1fSWills Wang QCA955X_EXT_INT_WMAC_RXLP | QCA955X_EXT_INT_WMAC_RXHP) 8471d3d0f1fSWills Wang 8481d3d0f1fSWills Wang #define QCA955X_EXT_INT_PCIE_RC1_ALL \ 8491d3d0f1fSWills Wang (QCA955X_EXT_INT_PCIE_RC1 | QCA955X_EXT_INT_PCIE_RC1_INT0 | \ 8501d3d0f1fSWills Wang QCA955X_EXT_INT_PCIE_RC1_INT1 | QCA955X_EXT_INT_PCIE_RC1_INT2 | \ 8511d3d0f1fSWills Wang QCA955X_EXT_INT_PCIE_RC1_INT3) 8521d3d0f1fSWills Wang 8531d3d0f1fSWills Wang #define QCA955X_EXT_INT_PCIE_RC2_ALL \ 8541d3d0f1fSWills Wang (QCA955X_EXT_INT_PCIE_RC2 | QCA955X_EXT_INT_PCIE_RC2_INT0 | \ 8551d3d0f1fSWills Wang QCA955X_EXT_INT_PCIE_RC2_INT1 | QCA955X_EXT_INT_PCIE_RC2_INT2 | \ 8561d3d0f1fSWills Wang QCA955X_EXT_INT_PCIE_RC2_INT3) 8571d3d0f1fSWills Wang 8581d3d0f1fSWills Wang #define QCA956X_EXT_INT_WMAC_MISC BIT(0) 8591d3d0f1fSWills Wang #define QCA956X_EXT_INT_WMAC_TX BIT(1) 8601d3d0f1fSWills Wang #define QCA956X_EXT_INT_WMAC_RXLP BIT(2) 8611d3d0f1fSWills Wang #define QCA956X_EXT_INT_WMAC_RXHP BIT(3) 8621d3d0f1fSWills Wang #define QCA956X_EXT_INT_PCIE_RC1 BIT(4) 8631d3d0f1fSWills Wang #define QCA956X_EXT_INT_PCIE_RC1_INT0 BIT(5) 8641d3d0f1fSWills Wang #define QCA956X_EXT_INT_PCIE_RC1_INT1 BIT(6) 8651d3d0f1fSWills Wang #define QCA956X_EXT_INT_PCIE_RC1_INT2 BIT(7) 8661d3d0f1fSWills Wang #define QCA956X_EXT_INT_PCIE_RC1_INT3 BIT(8) 8671d3d0f1fSWills Wang #define QCA956X_EXT_INT_PCIE_RC2 BIT(12) 8681d3d0f1fSWills Wang #define QCA956X_EXT_INT_PCIE_RC2_INT0 BIT(13) 8691d3d0f1fSWills Wang #define QCA956X_EXT_INT_PCIE_RC2_INT1 BIT(14) 8701d3d0f1fSWills Wang #define QCA956X_EXT_INT_PCIE_RC2_INT2 BIT(15) 8711d3d0f1fSWills Wang #define QCA956X_EXT_INT_PCIE_RC2_INT3 BIT(16) 8721d3d0f1fSWills Wang #define QCA956X_EXT_INT_USB1 BIT(24) 8731d3d0f1fSWills Wang #define QCA956X_EXT_INT_USB2 BIT(28) 8741d3d0f1fSWills Wang 8751d3d0f1fSWills Wang #define QCA956X_EXT_INT_WMAC_ALL \ 8761d3d0f1fSWills Wang (QCA956X_EXT_INT_WMAC_MISC | QCA956X_EXT_INT_WMAC_TX | \ 8771d3d0f1fSWills Wang QCA956X_EXT_INT_WMAC_RXLP | QCA956X_EXT_INT_WMAC_RXHP) 8781d3d0f1fSWills Wang 8791d3d0f1fSWills Wang #define QCA956X_EXT_INT_PCIE_RC1_ALL \ 8801d3d0f1fSWills Wang (QCA956X_EXT_INT_PCIE_RC1 | QCA956X_EXT_INT_PCIE_RC1_INT0 | \ 8811d3d0f1fSWills Wang QCA956X_EXT_INT_PCIE_RC1_INT1 | QCA956X_EXT_INT_PCIE_RC1_INT2 | \ 8821d3d0f1fSWills Wang QCA956X_EXT_INT_PCIE_RC1_INT3) 8831d3d0f1fSWills Wang 8841d3d0f1fSWills Wang #define QCA956X_EXT_INT_PCIE_RC2_ALL \ 8851d3d0f1fSWills Wang (QCA956X_EXT_INT_PCIE_RC2 | QCA956X_EXT_INT_PCIE_RC2_INT0 | \ 8861d3d0f1fSWills Wang QCA956X_EXT_INT_PCIE_RC2_INT1 | QCA956X_EXT_INT_PCIE_RC2_INT2 | \ 8871d3d0f1fSWills Wang QCA956X_EXT_INT_PCIE_RC2_INT3) 8881d3d0f1fSWills Wang 8891d3d0f1fSWills Wang #define REV_ID_MAJOR_MASK 0xfff0 8901d3d0f1fSWills Wang #define REV_ID_MAJOR_AR71XX 0x00a0 8911d3d0f1fSWills Wang #define REV_ID_MAJOR_AR913X 0x00b0 8921d3d0f1fSWills Wang #define REV_ID_MAJOR_AR7240 0x00c0 8931d3d0f1fSWills Wang #define REV_ID_MAJOR_AR7241 0x0100 8941d3d0f1fSWills Wang #define REV_ID_MAJOR_AR7242 0x1100 8951d3d0f1fSWills Wang #define REV_ID_MAJOR_AR9330 0x0110 8961d3d0f1fSWills Wang #define REV_ID_MAJOR_AR9331 0x1110 8971d3d0f1fSWills Wang #define REV_ID_MAJOR_AR9341 0x0120 8981d3d0f1fSWills Wang #define REV_ID_MAJOR_AR9342 0x1120 8991d3d0f1fSWills Wang #define REV_ID_MAJOR_AR9344 0x2120 9001d3d0f1fSWills Wang #define REV_ID_MAJOR_QCA9533 0x0140 9011d3d0f1fSWills Wang #define REV_ID_MAJOR_QCA9533_V2 0x0160 9021d3d0f1fSWills Wang #define REV_ID_MAJOR_QCA9556 0x0130 9031d3d0f1fSWills Wang #define REV_ID_MAJOR_QCA9558 0x1130 9041d3d0f1fSWills Wang #define REV_ID_MAJOR_TP9343 0x0150 9051d3d0f1fSWills Wang #define REV_ID_MAJOR_QCA9561 0x1150 9061d3d0f1fSWills Wang 9071d3d0f1fSWills Wang #define AR71XX_REV_ID_MINOR_MASK 0x3 9081d3d0f1fSWills Wang #define AR71XX_REV_ID_MINOR_AR7130 0x0 9091d3d0f1fSWills Wang #define AR71XX_REV_ID_MINOR_AR7141 0x1 9101d3d0f1fSWills Wang #define AR71XX_REV_ID_MINOR_AR7161 0x2 9111d3d0f1fSWills Wang #define AR913X_REV_ID_MINOR_AR9130 0x0 9121d3d0f1fSWills Wang #define AR913X_REV_ID_MINOR_AR9132 0x1 9131d3d0f1fSWills Wang 9141d3d0f1fSWills Wang #define AR71XX_REV_ID_REVISION_MASK 0x3 9151d3d0f1fSWills Wang #define AR71XX_REV_ID_REVISION_SHIFT 2 9161d3d0f1fSWills Wang #define AR71XX_REV_ID_REVISION2_MASK 0xf 9171d3d0f1fSWills Wang 9181d3d0f1fSWills Wang /* 9191d3d0f1fSWills Wang * RTC block 9201d3d0f1fSWills Wang */ 9211d3d0f1fSWills Wang #define AR933X_RTC_REG_RESET 0x40 9221d3d0f1fSWills Wang #define AR933X_RTC_REG_STATUS 0x44 9231d3d0f1fSWills Wang #define AR933X_RTC_REG_DERIVED 0x48 9241d3d0f1fSWills Wang #define AR933X_RTC_REG_FORCE_WAKE 0x4c 9251d3d0f1fSWills Wang #define AR933X_RTC_REG_INT_CAUSE 0x50 9261d3d0f1fSWills Wang #define AR933X_RTC_REG_CAUSE_CLR 0x50 9271d3d0f1fSWills Wang #define AR933X_RTC_REG_INT_ENABLE 0x54 9281d3d0f1fSWills Wang #define AR933X_RTC_REG_INT_MASKE 0x58 9291d3d0f1fSWills Wang 9301d3d0f1fSWills Wang #define QCA953X_RTC_REG_SYNC_RESET 0x40 9311d3d0f1fSWills Wang #define QCA953X_RTC_REG_SYNC_STATUS 0x44 9321d3d0f1fSWills Wang 9331d3d0f1fSWills Wang /* 9341d3d0f1fSWills Wang * SPI block 9351d3d0f1fSWills Wang */ 9361d3d0f1fSWills Wang #define AR71XX_SPI_REG_FS 0x00 9371d3d0f1fSWills Wang #define AR71XX_SPI_REG_CTRL 0x04 9381d3d0f1fSWills Wang #define AR71XX_SPI_REG_IOC 0x08 9391d3d0f1fSWills Wang #define AR71XX_SPI_REG_RDS 0x0c 9401d3d0f1fSWills Wang 9411d3d0f1fSWills Wang #define AR71XX_SPI_FS_GPIO BIT(0) 9421d3d0f1fSWills Wang 9431d3d0f1fSWills Wang #define AR71XX_SPI_CTRL_RD BIT(6) 9441d3d0f1fSWills Wang #define AR71XX_SPI_CTRL_DIV_MASK 0x3f 9451d3d0f1fSWills Wang 9461d3d0f1fSWills Wang #define AR71XX_SPI_IOC_DO BIT(0) 9471d3d0f1fSWills Wang #define AR71XX_SPI_IOC_CLK BIT(8) 9481d3d0f1fSWills Wang #define AR71XX_SPI_IOC_CS(n) BIT(16 + (n)) 9491d3d0f1fSWills Wang #define AR71XX_SPI_IOC_CS0 AR71XX_SPI_IOC_CS(0) 9501d3d0f1fSWills Wang #define AR71XX_SPI_IOC_CS1 AR71XX_SPI_IOC_CS(1) 9511d3d0f1fSWills Wang #define AR71XX_SPI_IOC_CS2 AR71XX_SPI_IOC_CS(2) 9521d3d0f1fSWills Wang #define AR71XX_SPI_IOC_CS_ALL \ 9531d3d0f1fSWills Wang (AR71XX_SPI_IOC_CS0 | AR71XX_SPI_IOC_CS1 | AR71XX_SPI_IOC_CS2) 9541d3d0f1fSWills Wang 9551d3d0f1fSWills Wang /* 9561d3d0f1fSWills Wang * GPIO block 9571d3d0f1fSWills Wang */ 9581d3d0f1fSWills Wang #define AR71XX_GPIO_REG_OE 0x00 9591d3d0f1fSWills Wang #define AR71XX_GPIO_REG_IN 0x04 9601d3d0f1fSWills Wang #define AR71XX_GPIO_REG_OUT 0x08 9611d3d0f1fSWills Wang #define AR71XX_GPIO_REG_SET 0x0c 9621d3d0f1fSWills Wang #define AR71XX_GPIO_REG_CLEAR 0x10 9631d3d0f1fSWills Wang #define AR71XX_GPIO_REG_INT_MODE 0x14 9641d3d0f1fSWills Wang #define AR71XX_GPIO_REG_INT_TYPE 0x18 9651d3d0f1fSWills Wang #define AR71XX_GPIO_REG_INT_POLARITY 0x1c 9661d3d0f1fSWills Wang #define AR71XX_GPIO_REG_INT_PENDING 0x20 9671d3d0f1fSWills Wang #define AR71XX_GPIO_REG_INT_ENABLE 0x24 9681d3d0f1fSWills Wang #define AR71XX_GPIO_REG_FUNC 0x28 9691d3d0f1fSWills Wang #define AR933X_GPIO_REG_FUNC 0x30 9701d3d0f1fSWills Wang 9711d3d0f1fSWills Wang #define AR934X_GPIO_REG_OUT_FUNC0 0x2c 9721d3d0f1fSWills Wang #define AR934X_GPIO_REG_OUT_FUNC1 0x30 9731d3d0f1fSWills Wang #define AR934X_GPIO_REG_OUT_FUNC2 0x34 9741d3d0f1fSWills Wang #define AR934X_GPIO_REG_OUT_FUNC3 0x38 9751d3d0f1fSWills Wang #define AR934X_GPIO_REG_OUT_FUNC4 0x3c 9761d3d0f1fSWills Wang #define AR934X_GPIO_REG_OUT_FUNC5 0x40 9771d3d0f1fSWills Wang #define AR934X_GPIO_REG_FUNC 0x6c 9781d3d0f1fSWills Wang 9791d3d0f1fSWills Wang #define QCA953X_GPIO_REG_OUT_FUNC0 0x2c 9801d3d0f1fSWills Wang #define QCA953X_GPIO_REG_OUT_FUNC1 0x30 9811d3d0f1fSWills Wang #define QCA953X_GPIO_REG_OUT_FUNC2 0x34 9821d3d0f1fSWills Wang #define QCA953X_GPIO_REG_OUT_FUNC3 0x38 9831d3d0f1fSWills Wang #define QCA953X_GPIO_REG_OUT_FUNC4 0x3c 9841d3d0f1fSWills Wang #define QCA953X_GPIO_REG_IN_ENABLE0 0x44 9851d3d0f1fSWills Wang #define QCA953X_GPIO_REG_FUNC 0x6c 9861d3d0f1fSWills Wang 9871d3d0f1fSWills Wang #define QCA955X_GPIO_REG_OUT_FUNC0 0x2c 9881d3d0f1fSWills Wang #define QCA955X_GPIO_REG_OUT_FUNC1 0x30 9891d3d0f1fSWills Wang #define QCA955X_GPIO_REG_OUT_FUNC2 0x34 9901d3d0f1fSWills Wang #define QCA955X_GPIO_REG_OUT_FUNC3 0x38 9911d3d0f1fSWills Wang #define QCA955X_GPIO_REG_OUT_FUNC4 0x3c 9921d3d0f1fSWills Wang #define QCA955X_GPIO_REG_OUT_FUNC5 0x40 9931d3d0f1fSWills Wang #define QCA955X_GPIO_REG_FUNC 0x6c 9941d3d0f1fSWills Wang 9951d3d0f1fSWills Wang #define QCA956X_GPIO_REG_OUT_FUNC0 0x2c 9961d3d0f1fSWills Wang #define QCA956X_GPIO_REG_OUT_FUNC1 0x30 9971d3d0f1fSWills Wang #define QCA956X_GPIO_REG_OUT_FUNC2 0x34 9981d3d0f1fSWills Wang #define QCA956X_GPIO_REG_OUT_FUNC3 0x38 9991d3d0f1fSWills Wang #define QCA956X_GPIO_REG_OUT_FUNC4 0x3c 10001d3d0f1fSWills Wang #define QCA956X_GPIO_REG_OUT_FUNC5 0x40 10011d3d0f1fSWills Wang #define QCA956X_GPIO_REG_IN_ENABLE0 0x44 10021d3d0f1fSWills Wang #define QCA956X_GPIO_REG_IN_ENABLE3 0x50 10031d3d0f1fSWills Wang #define QCA956X_GPIO_REG_FUNC 0x6c 10041d3d0f1fSWills Wang 10051d3d0f1fSWills Wang #define AR71XX_GPIO_FUNC_STEREO_EN BIT(17) 10061d3d0f1fSWills Wang #define AR71XX_GPIO_FUNC_SLIC_EN BIT(16) 10071d3d0f1fSWills Wang #define AR71XX_GPIO_FUNC_SPI_CS2_EN BIT(13) 10081d3d0f1fSWills Wang #define AR71XX_GPIO_FUNC_SPI_CS1_EN BIT(12) 10091d3d0f1fSWills Wang #define AR71XX_GPIO_FUNC_UART_EN BIT(8) 10101d3d0f1fSWills Wang #define AR71XX_GPIO_FUNC_USB_OC_EN BIT(4) 10111d3d0f1fSWills Wang #define AR71XX_GPIO_FUNC_USB_CLK_EN BIT(0) 10121d3d0f1fSWills Wang 10131d3d0f1fSWills Wang #define AR724X_GPIO_FUNC_GE0_MII_CLK_EN BIT(19) 10141d3d0f1fSWills Wang #define AR724X_GPIO_FUNC_SPI_EN BIT(18) 10151d3d0f1fSWills Wang #define AR724X_GPIO_FUNC_SPI_CS_EN2 BIT(14) 10161d3d0f1fSWills Wang #define AR724X_GPIO_FUNC_SPI_CS_EN1 BIT(13) 10171d3d0f1fSWills Wang #define AR724X_GPIO_FUNC_CLK_OBS5_EN BIT(12) 10181d3d0f1fSWills Wang #define AR724X_GPIO_FUNC_CLK_OBS4_EN BIT(11) 10191d3d0f1fSWills Wang #define AR724X_GPIO_FUNC_CLK_OBS3_EN BIT(10) 10201d3d0f1fSWills Wang #define AR724X_GPIO_FUNC_CLK_OBS2_EN BIT(9) 10211d3d0f1fSWills Wang #define AR724X_GPIO_FUNC_CLK_OBS1_EN BIT(8) 10221d3d0f1fSWills Wang #define AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN BIT(7) 10231d3d0f1fSWills Wang #define AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN BIT(6) 10241d3d0f1fSWills Wang #define AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN BIT(5) 10251d3d0f1fSWills Wang #define AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN BIT(4) 10261d3d0f1fSWills Wang #define AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN BIT(3) 10271d3d0f1fSWills Wang #define AR724X_GPIO_FUNC_UART_RTS_CTS_EN BIT(2) 10281d3d0f1fSWills Wang #define AR724X_GPIO_FUNC_UART_EN BIT(1) 10291d3d0f1fSWills Wang #define AR724X_GPIO_FUNC_JTAG_DISABLE BIT(0) 10301d3d0f1fSWills Wang 10311d3d0f1fSWills Wang #define AR913X_GPIO_FUNC_WMAC_LED_EN BIT(22) 10321d3d0f1fSWills Wang #define AR913X_GPIO_FUNC_EXP_PORT_CS_EN BIT(21) 10331d3d0f1fSWills Wang #define AR913X_GPIO_FUNC_I2S_REFCLKEN BIT(20) 10341d3d0f1fSWills Wang #define AR913X_GPIO_FUNC_I2S_MCKEN BIT(19) 10351d3d0f1fSWills Wang #define AR913X_GPIO_FUNC_I2S1_EN BIT(18) 10361d3d0f1fSWills Wang #define AR913X_GPIO_FUNC_I2S0_EN BIT(17) 10371d3d0f1fSWills Wang #define AR913X_GPIO_FUNC_SLIC_EN BIT(16) 10381d3d0f1fSWills Wang #define AR913X_GPIO_FUNC_UART_RTSCTS_EN BIT(9) 10391d3d0f1fSWills Wang #define AR913X_GPIO_FUNC_UART_EN BIT(8) 10401d3d0f1fSWills Wang #define AR913X_GPIO_FUNC_USB_CLK_EN BIT(4) 10411d3d0f1fSWills Wang 10421d3d0f1fSWills Wang #define AR933X_GPIO(x) BIT(x) 10431d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_SPDIF2TCK BIT(31) 10441d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_SPDIF_EN BIT(30) 10451d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_I2SO_22_18_EN BIT(29) 10461d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_I2S_MCK_EN BIT(27) 10471d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_I2SO_EN BIT(26) 10481d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_ETH_SWITCH_LED_DUPL BIT(25) 10491d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_ETH_SWITCH_LED_COLL BIT(24) 10501d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_ETH_SWITCH_LED_ACT BIT(23) 10511d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_SPI_EN BIT(18) 10521d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_RES_TRUE BIT(15) 10531d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_SPI_CS_EN2 BIT(14) 10541d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_SPI_CS_EN1 BIT(13) 10551d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_XLNA_EN BIT(12) 10561d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN BIT(7) 10571d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN BIT(6) 10581d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN BIT(5) 10591d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN BIT(4) 10601d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN BIT(3) 10611d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_UART_RTS_CTS_EN BIT(2) 10621d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_UART_EN BIT(1) 10631d3d0f1fSWills Wang #define AR933X_GPIO_FUNC_JTAG_DISABLE BIT(0) 10641d3d0f1fSWills Wang 10651d3d0f1fSWills Wang #define AR934X_GPIO_FUNC_CLK_OBS7_EN BIT(9) 10661d3d0f1fSWills Wang #define AR934X_GPIO_FUNC_CLK_OBS6_EN BIT(8) 10671d3d0f1fSWills Wang #define AR934X_GPIO_FUNC_CLK_OBS5_EN BIT(7) 10681d3d0f1fSWills Wang #define AR934X_GPIO_FUNC_CLK_OBS4_EN BIT(6) 10691d3d0f1fSWills Wang #define AR934X_GPIO_FUNC_CLK_OBS3_EN BIT(5) 10701d3d0f1fSWills Wang #define AR934X_GPIO_FUNC_CLK_OBS2_EN BIT(4) 10711d3d0f1fSWills Wang #define AR934X_GPIO_FUNC_CLK_OBS1_EN BIT(3) 10721d3d0f1fSWills Wang #define AR934X_GPIO_FUNC_CLK_OBS0_EN BIT(2) 10731d3d0f1fSWills Wang #define AR934X_GPIO_FUNC_JTAG_DISABLE BIT(1) 10741d3d0f1fSWills Wang 10751d3d0f1fSWills Wang #define AR934X_GPIO_OUT_GPIO 0 10761d3d0f1fSWills Wang #define AR934X_GPIO_OUT_SPI_CS1 7 10771d3d0f1fSWills Wang #define AR934X_GPIO_OUT_LED_LINK0 41 10781d3d0f1fSWills Wang #define AR934X_GPIO_OUT_LED_LINK1 42 10791d3d0f1fSWills Wang #define AR934X_GPIO_OUT_LED_LINK2 43 10801d3d0f1fSWills Wang #define AR934X_GPIO_OUT_LED_LINK3 44 10811d3d0f1fSWills Wang #define AR934X_GPIO_OUT_LED_LINK4 45 10821d3d0f1fSWills Wang #define AR934X_GPIO_OUT_EXT_LNA0 46 10831d3d0f1fSWills Wang #define AR934X_GPIO_OUT_EXT_LNA1 47 10841d3d0f1fSWills Wang 10851d3d0f1fSWills Wang #define QCA953X_GPIO(x) BIT(x) 10861d3d0f1fSWills Wang #define QCA953X_GPIO_MUX_MASK(x) (0xff << (x)) 10871d3d0f1fSWills Wang #define QCA953X_GPIO_OUT_MUX_SPI_CS1 10 10881d3d0f1fSWills Wang #define QCA953X_GPIO_OUT_MUX_SPI_CS2 11 10891d3d0f1fSWills Wang #define QCA953X_GPIO_OUT_MUX_SPI_CS0 9 10901d3d0f1fSWills Wang #define QCA953X_GPIO_OUT_MUX_SPI_CLK 8 10911d3d0f1fSWills Wang #define QCA953X_GPIO_OUT_MUX_SPI_MOSI 12 10921d3d0f1fSWills Wang #define QCA953X_GPIO_OUT_MUX_UART0_SOUT 22 10931d3d0f1fSWills Wang #define QCA953X_GPIO_OUT_MUX_LED_LINK1 41 10941d3d0f1fSWills Wang #define QCA953X_GPIO_OUT_MUX_LED_LINK2 42 10951d3d0f1fSWills Wang #define QCA953X_GPIO_OUT_MUX_LED_LINK3 43 10961d3d0f1fSWills Wang #define QCA953X_GPIO_OUT_MUX_LED_LINK4 44 10971d3d0f1fSWills Wang #define QCA953X_GPIO_OUT_MUX_LED_LINK5 45 10981d3d0f1fSWills Wang 10991d3d0f1fSWills Wang #define QCA953X_GPIO_IN_MUX_UART0_SIN 9 11001d3d0f1fSWills Wang #define QCA953X_GPIO_IN_MUX_SPI_DATA_IN 8 11011d3d0f1fSWills Wang 11021d3d0f1fSWills Wang #define QCA956X_GPIO_OUT_MUX_GE0_MDO 32 11031d3d0f1fSWills Wang #define QCA956X_GPIO_OUT_MUX_GE0_MDC 33 11041d3d0f1fSWills Wang 11051d3d0f1fSWills Wang #define AR71XX_GPIO_COUNT 16 11061d3d0f1fSWills Wang #define AR7240_GPIO_COUNT 18 11071d3d0f1fSWills Wang #define AR7241_GPIO_COUNT 20 11081d3d0f1fSWills Wang #define AR913X_GPIO_COUNT 22 11091d3d0f1fSWills Wang #define AR933X_GPIO_COUNT 30 11101d3d0f1fSWills Wang #define AR934X_GPIO_COUNT 23 11111d3d0f1fSWills Wang #define QCA953X_GPIO_COUNT 18 11121d3d0f1fSWills Wang #define QCA955X_GPIO_COUNT 24 11131d3d0f1fSWills Wang #define QCA956X_GPIO_COUNT 23 11141d3d0f1fSWills Wang 11151d3d0f1fSWills Wang /* 11161d3d0f1fSWills Wang * SRIF block 11171d3d0f1fSWills Wang */ 11181d3d0f1fSWills Wang #define AR933X_SRIF_DDR_DPLL1_REG 0x240 11191d3d0f1fSWills Wang #define AR933X_SRIF_DDR_DPLL2_REG 0x244 11201d3d0f1fSWills Wang #define AR933X_SRIF_DDR_DPLL3_REG 0x248 11211d3d0f1fSWills Wang #define AR933X_SRIF_DDR_DPLL4_REG 0x24c 11221d3d0f1fSWills Wang 11231d3d0f1fSWills Wang #define AR934X_SRIF_CPU_DPLL1_REG 0x1c0 11241d3d0f1fSWills Wang #define AR934X_SRIF_CPU_DPLL2_REG 0x1c4 11251d3d0f1fSWills Wang #define AR934X_SRIF_CPU_DPLL3_REG 0x1c8 1126e08539b7SMarek Vasut #define AR934X_SRIF_CPU_DPLL4_REG 0x1cc 11271d3d0f1fSWills Wang 11281d3d0f1fSWills Wang #define AR934X_SRIF_DDR_DPLL1_REG 0x240 11291d3d0f1fSWills Wang #define AR934X_SRIF_DDR_DPLL2_REG 0x244 11301d3d0f1fSWills Wang #define AR934X_SRIF_DDR_DPLL3_REG 0x248 1131e08539b7SMarek Vasut #define AR934X_SRIF_DDR_DPLL4_REG 0x24c 11321d3d0f1fSWills Wang 11331d3d0f1fSWills Wang #define AR934X_SRIF_DPLL1_REFDIV_SHIFT 27 11341d3d0f1fSWills Wang #define AR934X_SRIF_DPLL1_REFDIV_MASK 0x1f 11351d3d0f1fSWills Wang #define AR934X_SRIF_DPLL1_NINT_SHIFT 18 11361d3d0f1fSWills Wang #define AR934X_SRIF_DPLL1_NINT_MASK 0x1ff 11371d3d0f1fSWills Wang #define AR934X_SRIF_DPLL1_NFRAC_MASK 0x0003ffff 11381d3d0f1fSWills Wang 11391d3d0f1fSWills Wang #define AR934X_SRIF_DPLL2_LOCAL_PLL BIT(30) 11401d3d0f1fSWills Wang #define AR934X_SRIF_DPLL2_OUTDIV_SHIFT 13 11411d3d0f1fSWills Wang #define AR934X_SRIF_DPLL2_OUTDIV_MASK 0x7 11421d3d0f1fSWills Wang 11431d3d0f1fSWills Wang #define QCA953X_SRIF_BB_DPLL1_REG 0x180 11441d3d0f1fSWills Wang #define QCA953X_SRIF_BB_DPLL2_REG 0x184 11451d3d0f1fSWills Wang #define QCA953X_SRIF_BB_DPLL3_REG 0x188 11461d3d0f1fSWills Wang 11471d3d0f1fSWills Wang #define QCA953X_SRIF_CPU_DPLL1_REG 0x1c0 11481d3d0f1fSWills Wang #define QCA953X_SRIF_CPU_DPLL2_REG 0x1c4 11491d3d0f1fSWills Wang #define QCA953X_SRIF_CPU_DPLL3_REG 0x1c8 11501d3d0f1fSWills Wang 11511d3d0f1fSWills Wang #define QCA953X_SRIF_DDR_DPLL1_REG 0x240 11521d3d0f1fSWills Wang #define QCA953X_SRIF_DDR_DPLL2_REG 0x244 11531d3d0f1fSWills Wang #define QCA953X_SRIF_DDR_DPLL3_REG 0x248 11541d3d0f1fSWills Wang 11551d3d0f1fSWills Wang #define QCA953X_SRIF_PCIE_DPLL1_REG 0xc00 11561d3d0f1fSWills Wang #define QCA953X_SRIF_PCIE_DPLL2_REG 0xc04 11571d3d0f1fSWills Wang #define QCA953X_SRIF_PCIE_DPLL3_REG 0xc08 11581d3d0f1fSWills Wang 11591d3d0f1fSWills Wang #define QCA953X_SRIF_PMU1_REG 0xc40 11601d3d0f1fSWills Wang #define QCA953X_SRIF_PMU2_REG 0xc44 11611d3d0f1fSWills Wang 11621d3d0f1fSWills Wang #define QCA953X_SRIF_DPLL1_REFDIV_SHIFT 27 11631d3d0f1fSWills Wang #define QCA953X_SRIF_DPLL1_REFDIV_MASK 0x1f 11641d3d0f1fSWills Wang 11651d3d0f1fSWills Wang #define QCA953X_SRIF_DPLL1_NINT_SHIFT 18 11661d3d0f1fSWills Wang #define QCA953X_SRIF_DPLL1_NINT_MASK 0x1ff 11671d3d0f1fSWills Wang #define QCA953X_SRIF_DPLL1_NFRAC_MASK 0x0003ffff 11681d3d0f1fSWills Wang 11691d3d0f1fSWills Wang #define QCA953X_SRIF_DPLL2_LOCAL_PLL BIT(30) 11701d3d0f1fSWills Wang 11711d3d0f1fSWills Wang #define QCA953X_SRIF_DPLL2_KI_SHIFT 29 11721d3d0f1fSWills Wang #define QCA953X_SRIF_DPLL2_KI_MASK 0x3 11731d3d0f1fSWills Wang 11741d3d0f1fSWills Wang #define QCA953X_SRIF_DPLL2_KD_SHIFT 25 11751d3d0f1fSWills Wang #define QCA953X_SRIF_DPLL2_KD_MASK 0xf 11761d3d0f1fSWills Wang 11771d3d0f1fSWills Wang #define QCA953X_SRIF_DPLL2_PWD BIT(22) 11781d3d0f1fSWills Wang 11791d3d0f1fSWills Wang #define QCA953X_SRIF_DPLL2_OUTDIV_SHIFT 13 11801d3d0f1fSWills Wang #define QCA953X_SRIF_DPLL2_OUTDIV_MASK 0x7 11811d3d0f1fSWills Wang 11821d3d0f1fSWills Wang /* 11831d3d0f1fSWills Wang * MII_CTRL block 11841d3d0f1fSWills Wang */ 11851d3d0f1fSWills Wang #define AR71XX_MII_REG_MII0_CTRL 0x00 11861d3d0f1fSWills Wang #define AR71XX_MII_REG_MII1_CTRL 0x04 11871d3d0f1fSWills Wang 11881d3d0f1fSWills Wang #define AR71XX_MII_CTRL_IF_MASK 3 11891d3d0f1fSWills Wang #define AR71XX_MII_CTRL_SPEED_SHIFT 4 11901d3d0f1fSWills Wang #define AR71XX_MII_CTRL_SPEED_MASK 3 11911d3d0f1fSWills Wang #define AR71XX_MII_CTRL_SPEED_10 0 11921d3d0f1fSWills Wang #define AR71XX_MII_CTRL_SPEED_100 1 11931d3d0f1fSWills Wang #define AR71XX_MII_CTRL_SPEED_1000 2 11941d3d0f1fSWills Wang 11951d3d0f1fSWills Wang #define AR71XX_MII0_CTRL_IF_GMII 0 11961d3d0f1fSWills Wang #define AR71XX_MII0_CTRL_IF_MII 1 11971d3d0f1fSWills Wang #define AR71XX_MII0_CTRL_IF_RGMII 2 11981d3d0f1fSWills Wang #define AR71XX_MII0_CTRL_IF_RMII 3 11991d3d0f1fSWills Wang 12001d3d0f1fSWills Wang #define AR71XX_MII1_CTRL_IF_RGMII 0 12011d3d0f1fSWills Wang #define AR71XX_MII1_CTRL_IF_RMII 1 12021d3d0f1fSWills Wang 12031d3d0f1fSWills Wang /* 12041d3d0f1fSWills Wang * AR933X GMAC interface 12051d3d0f1fSWills Wang */ 12061d3d0f1fSWills Wang #define AR933X_GMAC_REG_ETH_CFG 0x00 12071d3d0f1fSWills Wang 12081d3d0f1fSWills Wang #define AR933X_ETH_CFG_RGMII_GE0 BIT(0) 12091d3d0f1fSWills Wang #define AR933X_ETH_CFG_MII_GE0 BIT(1) 12101d3d0f1fSWills Wang #define AR933X_ETH_CFG_GMII_GE0 BIT(2) 12111d3d0f1fSWills Wang #define AR933X_ETH_CFG_MII_GE0_MASTER BIT(3) 12121d3d0f1fSWills Wang #define AR933X_ETH_CFG_MII_GE0_SLAVE BIT(4) 12131d3d0f1fSWills Wang #define AR933X_ETH_CFG_MII_GE0_ERR_EN BIT(5) 12141d3d0f1fSWills Wang #define AR933X_ETH_CFG_SW_PHY_SWAP BIT(7) 12151d3d0f1fSWills Wang #define AR933X_ETH_CFG_SW_PHY_ADDR_SWAP BIT(8) 12161d3d0f1fSWills Wang #define AR933X_ETH_CFG_RMII_GE0 BIT(9) 12171d3d0f1fSWills Wang #define AR933X_ETH_CFG_RMII_GE0_SPD_10 0 12181d3d0f1fSWills Wang #define AR933X_ETH_CFG_RMII_GE0_SPD_100 BIT(10) 12191d3d0f1fSWills Wang 12201d3d0f1fSWills Wang /* 12211d3d0f1fSWills Wang * AR934X GMAC Interface 12221d3d0f1fSWills Wang */ 12231d3d0f1fSWills Wang #define AR934X_GMAC_REG_ETH_CFG 0x00 12241d3d0f1fSWills Wang 12251d3d0f1fSWills Wang #define AR934X_ETH_CFG_RGMII_GMAC0 BIT(0) 12261d3d0f1fSWills Wang #define AR934X_ETH_CFG_MII_GMAC0 BIT(1) 12271d3d0f1fSWills Wang #define AR934X_ETH_CFG_GMII_GMAC0 BIT(2) 12281d3d0f1fSWills Wang #define AR934X_ETH_CFG_MII_GMAC0_MASTER BIT(3) 12291d3d0f1fSWills Wang #define AR934X_ETH_CFG_MII_GMAC0_SLAVE BIT(4) 12301d3d0f1fSWills Wang #define AR934X_ETH_CFG_MII_GMAC0_ERR_EN BIT(5) 12311d3d0f1fSWills Wang #define AR934X_ETH_CFG_SW_ONLY_MODE BIT(6) 12321d3d0f1fSWills Wang #define AR934X_ETH_CFG_SW_PHY_SWAP BIT(7) 12331d3d0f1fSWills Wang #define AR934X_ETH_CFG_SW_APB_ACCESS BIT(9) 12341d3d0f1fSWills Wang #define AR934X_ETH_CFG_RMII_GMAC0 BIT(10) 12351d3d0f1fSWills Wang #define AR933X_ETH_CFG_MII_CNTL_SPEED BIT(11) 12361d3d0f1fSWills Wang #define AR934X_ETH_CFG_RMII_GMAC0_MASTER BIT(12) 12371d3d0f1fSWills Wang #define AR933X_ETH_CFG_SW_ACC_MSB_FIRST BIT(13) 12381d3d0f1fSWills Wang #define AR934X_ETH_CFG_RXD_DELAY BIT(14) 12391d3d0f1fSWills Wang #define AR934X_ETH_CFG_RXD_DELAY_MASK 0x3 12401d3d0f1fSWills Wang #define AR934X_ETH_CFG_RXD_DELAY_SHIFT 14 12411d3d0f1fSWills Wang #define AR934X_ETH_CFG_RDV_DELAY BIT(16) 12421d3d0f1fSWills Wang #define AR934X_ETH_CFG_RDV_DELAY_MASK 0x3 12431d3d0f1fSWills Wang #define AR934X_ETH_CFG_RDV_DELAY_SHIFT 16 12441d3d0f1fSWills Wang 12451d3d0f1fSWills Wang /* 12461d3d0f1fSWills Wang * QCA953X GMAC Interface 12471d3d0f1fSWills Wang */ 12481d3d0f1fSWills Wang #define QCA953X_GMAC_REG_ETH_CFG 0x00 12491d3d0f1fSWills Wang 12501d3d0f1fSWills Wang #define QCA953X_ETH_CFG_SW_ONLY_MODE BIT(6) 12511d3d0f1fSWills Wang #define QCA953X_ETH_CFG_SW_PHY_SWAP BIT(7) 12521d3d0f1fSWills Wang #define QCA953X_ETH_CFG_SW_APB_ACCESS BIT(9) 12531d3d0f1fSWills Wang #define QCA953X_ETH_CFG_SW_ACC_MSB_FIRST BIT(13) 12541d3d0f1fSWills Wang 12551d3d0f1fSWills Wang /* 12561d3d0f1fSWills Wang * QCA955X GMAC Interface 12571d3d0f1fSWills Wang */ 12581d3d0f1fSWills Wang 12591d3d0f1fSWills Wang #define QCA955X_GMAC_REG_ETH_CFG 0x00 12601d3d0f1fSWills Wang 12611d3d0f1fSWills Wang #define QCA955X_ETH_CFG_RGMII_EN BIT(0) 12621d3d0f1fSWills Wang #define QCA955X_ETH_CFG_GE0_SGMII BIT(6) 12631d3d0f1fSWills Wang 12641d3d0f1fSWills Wang #endif /* __ASM_AR71XX_H */ 1265