1*d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 2d4a67d9dSGabor Juhos /* 3d4a67d9dSGabor Juhos * Atheros AR71XX/AR724X/AR913X SoC register definitions 4d4a67d9dSGabor Juhos * 5703327ddSGabor Juhos * Copyright (C) 2010-2011 Jaiganesh Narayanan <jnarayanan@atheros.com> 6d4a67d9dSGabor Juhos * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org> 7d4a67d9dSGabor Juhos * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> 8d4a67d9dSGabor Juhos * 9703327ddSGabor Juhos * Parts of this file are based on Atheros' 2.6.15/2.6.31 BSP 10d4a67d9dSGabor Juhos */ 11d4a67d9dSGabor Juhos 12d4a67d9dSGabor Juhos #ifndef __ASM_MACH_AR71XX_REGS_H 13d4a67d9dSGabor Juhos #define __ASM_MACH_AR71XX_REGS_H 14d4a67d9dSGabor Juhos 15d4a67d9dSGabor Juhos #include <linux/types.h> 16d4a67d9dSGabor Juhos #include <linux/io.h> 17d4a67d9dSGabor Juhos #include <linux/bitops.h> 18d4a67d9dSGabor Juhos 19d4a67d9dSGabor Juhos #define AR71XX_APB_BASE 0x18000000 20a95f4b1cSGabor Juhos #define AR71XX_GE0_BASE 0x19000000 21a95f4b1cSGabor Juhos #define AR71XX_GE0_SIZE 0x10000 22a95f4b1cSGabor Juhos #define AR71XX_GE1_BASE 0x1a000000 23a95f4b1cSGabor Juhos #define AR71XX_GE1_SIZE 0x10000 247e98aa46SGabor Juhos #define AR71XX_EHCI_BASE 0x1b000000 257e98aa46SGabor Juhos #define AR71XX_EHCI_SIZE 0x1000 267e98aa46SGabor Juhos #define AR71XX_OHCI_BASE 0x1c000000 277e98aa46SGabor Juhos #define AR71XX_OHCI_SIZE 0x1000 2868a1d316SGabor Juhos #define AR71XX_SPI_BASE 0x1f000000 2968a1d316SGabor Juhos #define AR71XX_SPI_SIZE 0x01000000 30d4a67d9dSGabor Juhos 31d4a67d9dSGabor Juhos #define AR71XX_DDR_CTRL_BASE (AR71XX_APB_BASE + 0x00000000) 32d4a67d9dSGabor Juhos #define AR71XX_DDR_CTRL_SIZE 0x100 33d4a67d9dSGabor Juhos #define AR71XX_UART_BASE (AR71XX_APB_BASE + 0x00020000) 34d4a67d9dSGabor Juhos #define AR71XX_UART_SIZE 0x100 357e98aa46SGabor Juhos #define AR71XX_USB_CTRL_BASE (AR71XX_APB_BASE + 0x00030000) 367e98aa46SGabor Juhos #define AR71XX_USB_CTRL_SIZE 0x100 376eae43c5SGabor Juhos #define AR71XX_GPIO_BASE (AR71XX_APB_BASE + 0x00040000) 386eae43c5SGabor Juhos #define AR71XX_GPIO_SIZE 0x100 39d4a67d9dSGabor Juhos #define AR71XX_PLL_BASE (AR71XX_APB_BASE + 0x00050000) 40d4a67d9dSGabor Juhos #define AR71XX_PLL_SIZE 0x100 41d4a67d9dSGabor Juhos #define AR71XX_RESET_BASE (AR71XX_APB_BASE + 0x00060000) 42d4a67d9dSGabor Juhos #define AR71XX_RESET_SIZE 0x100 43a95f4b1cSGabor Juhos #define AR71XX_MII_BASE (AR71XX_APB_BASE + 0x00070000) 44a95f4b1cSGabor Juhos #define AR71XX_MII_SIZE 0x100 45d4a67d9dSGabor Juhos 46ad4ce92eSGabor Juhos #define AR71XX_PCI_MEM_BASE 0x10000000 47ad4ce92eSGabor Juhos #define AR71XX_PCI_MEM_SIZE 0x07000000 48ad4ce92eSGabor Juhos 49ad4ce92eSGabor Juhos #define AR71XX_PCI_WIN0_OFFS 0x10000000 50ad4ce92eSGabor Juhos #define AR71XX_PCI_WIN1_OFFS 0x11000000 51ad4ce92eSGabor Juhos #define AR71XX_PCI_WIN2_OFFS 0x12000000 52ad4ce92eSGabor Juhos #define AR71XX_PCI_WIN3_OFFS 0x13000000 53ad4ce92eSGabor Juhos #define AR71XX_PCI_WIN4_OFFS 0x14000000 54ad4ce92eSGabor Juhos #define AR71XX_PCI_WIN5_OFFS 0x15000000 55ad4ce92eSGabor Juhos #define AR71XX_PCI_WIN6_OFFS 0x16000000 56ad4ce92eSGabor Juhos #define AR71XX_PCI_WIN7_OFFS 0x07000000 57ad4ce92eSGabor Juhos 58ad4ce92eSGabor Juhos #define AR71XX_PCI_CFG_BASE \ 59ad4ce92eSGabor Juhos (AR71XX_PCI_MEM_BASE + AR71XX_PCI_WIN7_OFFS + 0x10000) 60ad4ce92eSGabor Juhos #define AR71XX_PCI_CFG_SIZE 0x100 61ad4ce92eSGabor Juhos 627e98aa46SGabor Juhos #define AR7240_USB_CTRL_BASE (AR71XX_APB_BASE + 0x00030000) 637e98aa46SGabor Juhos #define AR7240_USB_CTRL_SIZE 0x100 647e98aa46SGabor Juhos #define AR7240_OHCI_BASE 0x1b000000 657e98aa46SGabor Juhos #define AR7240_OHCI_SIZE 0x1000 667e98aa46SGabor Juhos 67ad4ce92eSGabor Juhos #define AR724X_PCI_MEM_BASE 0x10000000 68ad4ce92eSGabor Juhos #define AR724X_PCI_MEM_SIZE 0x04000000 69ad4ce92eSGabor Juhos 70ad4ce92eSGabor Juhos #define AR724X_PCI_CFG_BASE 0x14000000 71ad4ce92eSGabor Juhos #define AR724X_PCI_CFG_SIZE 0x1000 7212401fc2SGabor Juhos #define AR724X_PCI_CRP_BASE (AR71XX_APB_BASE + 0x000c0000) 7312401fc2SGabor Juhos #define AR724X_PCI_CRP_SIZE 0x1000 74ad4ce92eSGabor Juhos #define AR724X_PCI_CTRL_BASE (AR71XX_APB_BASE + 0x000f0000) 75ad4ce92eSGabor Juhos #define AR724X_PCI_CTRL_SIZE 0x100 76ad4ce92eSGabor Juhos 777e98aa46SGabor Juhos #define AR724X_EHCI_BASE 0x1b000000 787e98aa46SGabor Juhos #define AR724X_EHCI_SIZE 0x1000 797e98aa46SGabor Juhos 807e98aa46SGabor Juhos #define AR913X_EHCI_BASE 0x1b000000 817e98aa46SGabor Juhos #define AR913X_EHCI_SIZE 0x1000 82f5b35d0bSGabor Juhos #define AR913X_WMAC_BASE (AR71XX_APB_BASE + 0x000C0000) 83f5b35d0bSGabor Juhos #define AR913X_WMAC_SIZE 0x30000 84f5b35d0bSGabor Juhos 850bd3acdfSGabor Juhos #define AR933X_UART_BASE (AR71XX_APB_BASE + 0x00020000) 860bd3acdfSGabor Juhos #define AR933X_UART_SIZE 0x14 87a95f4b1cSGabor Juhos #define AR933X_GMAC_BASE (AR71XX_APB_BASE + 0x00070000) 88a95f4b1cSGabor Juhos #define AR933X_GMAC_SIZE 0x04 8934cfcd26SGabor Juhos #define AR933X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000) 9034cfcd26SGabor Juhos #define AR933X_WMAC_SIZE 0x20000 91c279b775SGabor Juhos #define AR933X_EHCI_BASE 0x1b000000 92c279b775SGabor Juhos #define AR933X_EHCI_SIZE 0x1000 93c279b775SGabor Juhos 94a95f4b1cSGabor Juhos #define AR934X_GMAC_BASE (AR71XX_APB_BASE + 0x00070000) 95a95f4b1cSGabor Juhos #define AR934X_GMAC_SIZE 0x14 96574d6e70SGabor Juhos #define AR934X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000) 97574d6e70SGabor Juhos #define AR934X_WMAC_SIZE 0x20000 9800ffed58SGabor Juhos #define AR934X_EHCI_BASE 0x1b000000 9900ffed58SGabor Juhos #define AR934X_EHCI_SIZE 0x200 100a95f4b1cSGabor Juhos #define AR934X_NFC_BASE 0x1b000200 101a95f4b1cSGabor Juhos #define AR934X_NFC_SIZE 0xb8 10297541ccfSGabor Juhos #define AR934X_SRIF_BASE (AR71XX_APB_BASE + 0x00116000) 10397541ccfSGabor Juhos #define AR934X_SRIF_SIZE 0x1000 104574d6e70SGabor Juhos 105a95f4b1cSGabor Juhos #define QCA953X_GMAC_BASE (AR71XX_APB_BASE + 0x00070000) 106a95f4b1cSGabor Juhos #define QCA953X_GMAC_SIZE 0x14 107a95f4b1cSGabor Juhos #define QCA953X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000) 108a95f4b1cSGabor Juhos #define QCA953X_WMAC_SIZE 0x20000 109a95f4b1cSGabor Juhos #define QCA953X_EHCI_BASE 0x1b000000 110a95f4b1cSGabor Juhos #define QCA953X_EHCI_SIZE 0x200 111a95f4b1cSGabor Juhos #define QCA953X_SRIF_BASE (AR71XX_APB_BASE + 0x00116000) 112a95f4b1cSGabor Juhos #define QCA953X_SRIF_SIZE 0x1000 113a95f4b1cSGabor Juhos 114a95f4b1cSGabor Juhos #define QCA953X_PCI_CFG_BASE0 0x14000000 115a95f4b1cSGabor Juhos #define QCA953X_PCI_CTRL_BASE0 (AR71XX_APB_BASE + 0x000f0000) 116a95f4b1cSGabor Juhos #define QCA953X_PCI_CRP_BASE0 (AR71XX_APB_BASE + 0x000c0000) 117a95f4b1cSGabor Juhos #define QCA953X_PCI_MEM_BASE0 0x10000000 118a95f4b1cSGabor Juhos #define QCA953X_PCI_MEM_SIZE 0x02000000 119a95f4b1cSGabor Juhos 1200a5f3b1cSGabor Juhos #define QCA955X_PCI_MEM_BASE0 0x10000000 1210a5f3b1cSGabor Juhos #define QCA955X_PCI_MEM_BASE1 0x12000000 1220a5f3b1cSGabor Juhos #define QCA955X_PCI_MEM_SIZE 0x02000000 1230a5f3b1cSGabor Juhos #define QCA955X_PCI_CFG_BASE0 0x14000000 1240a5f3b1cSGabor Juhos #define QCA955X_PCI_CFG_BASE1 0x16000000 1250a5f3b1cSGabor Juhos #define QCA955X_PCI_CFG_SIZE 0x1000 1260a5f3b1cSGabor Juhos #define QCA955X_PCI_CRP_BASE0 (AR71XX_APB_BASE + 0x000c0000) 1270a5f3b1cSGabor Juhos #define QCA955X_PCI_CRP_BASE1 (AR71XX_APB_BASE + 0x00250000) 1280a5f3b1cSGabor Juhos #define QCA955X_PCI_CRP_SIZE 0x1000 1290a5f3b1cSGabor Juhos #define QCA955X_PCI_CTRL_BASE0 (AR71XX_APB_BASE + 0x000f0000) 1300a5f3b1cSGabor Juhos #define QCA955X_PCI_CTRL_BASE1 (AR71XX_APB_BASE + 0x00280000) 1310a5f3b1cSGabor Juhos #define QCA955X_PCI_CTRL_SIZE 0x100 1320a5f3b1cSGabor Juhos 133a95f4b1cSGabor Juhos #define QCA955X_GMAC_BASE (AR71XX_APB_BASE + 0x00070000) 134a95f4b1cSGabor Juhos #define QCA955X_GMAC_SIZE 0x40 135e9c0d0aaSGabor Juhos #define QCA955X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000) 136e9c0d0aaSGabor Juhos #define QCA955X_WMAC_SIZE 0x20000 13782c46840SGabor Juhos #define QCA955X_EHCI0_BASE 0x1b000000 13882c46840SGabor Juhos #define QCA955X_EHCI1_BASE 0x1b400000 13982c46840SGabor Juhos #define QCA955X_EHCI_SIZE 0x1000 140a95f4b1cSGabor Juhos #define QCA955X_NFC_BASE 0x1b800200 141a95f4b1cSGabor Juhos #define QCA955X_NFC_SIZE 0xb8 142a95f4b1cSGabor Juhos 143a95f4b1cSGabor Juhos #define QCA956X_PCI_MEM_BASE1 0x12000000 144a95f4b1cSGabor Juhos #define QCA956X_PCI_MEM_SIZE 0x02000000 145a95f4b1cSGabor Juhos #define QCA956X_PCI_CFG_BASE1 0x16000000 146a95f4b1cSGabor Juhos #define QCA956X_PCI_CFG_SIZE 0x1000 147a95f4b1cSGabor Juhos #define QCA956X_PCI_CRP_BASE1 (AR71XX_APB_BASE + 0x00250000) 148a95f4b1cSGabor Juhos #define QCA956X_PCI_CRP_SIZE 0x1000 149a95f4b1cSGabor Juhos #define QCA956X_PCI_CTRL_BASE1 (AR71XX_APB_BASE + 0x00280000) 150a95f4b1cSGabor Juhos #define QCA956X_PCI_CTRL_SIZE 0x100 151a95f4b1cSGabor Juhos 152a95f4b1cSGabor Juhos #define QCA956X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000) 153a95f4b1cSGabor Juhos #define QCA956X_WMAC_SIZE 0x20000 154a95f4b1cSGabor Juhos #define QCA956X_EHCI0_BASE 0x1b000000 155a95f4b1cSGabor Juhos #define QCA956X_EHCI1_BASE 0x1b400000 156a95f4b1cSGabor Juhos #define QCA956X_EHCI_SIZE 0x200 157a95f4b1cSGabor Juhos #define QCA956X_GMAC_SGMII_BASE (AR71XX_APB_BASE + 0x00070000) 158a95f4b1cSGabor Juhos #define QCA956X_GMAC_SGMII_SIZE 0x64 159a95f4b1cSGabor Juhos #define QCA956X_PLL_BASE (AR71XX_APB_BASE + 0x00050000) 160a95f4b1cSGabor Juhos #define QCA956X_PLL_SIZE 0x50 161a95f4b1cSGabor Juhos #define QCA956X_GMAC_BASE (AR71XX_APB_BASE + 0x00070000) 162a95f4b1cSGabor Juhos #define QCA956X_GMAC_SIZE 0x64 163a95f4b1cSGabor Juhos 164a95f4b1cSGabor Juhos /* 165a95f4b1cSGabor Juhos * Hidden Registers 166a95f4b1cSGabor Juhos */ 167a95f4b1cSGabor Juhos #define QCA956X_MAC_CFG_BASE 0xb9000000 168a95f4b1cSGabor Juhos #define QCA956X_MAC_CFG_SIZE 0x64 169a95f4b1cSGabor Juhos 170a95f4b1cSGabor Juhos #define QCA956X_MAC_CFG1_REG 0x00 171a95f4b1cSGabor Juhos #define QCA956X_MAC_CFG1_SOFT_RST BIT(31) 172a95f4b1cSGabor Juhos #define QCA956X_MAC_CFG1_RX_RST BIT(19) 173a95f4b1cSGabor Juhos #define QCA956X_MAC_CFG1_TX_RST BIT(18) 174a95f4b1cSGabor Juhos #define QCA956X_MAC_CFG1_LOOPBACK BIT(8) 175a95f4b1cSGabor Juhos #define QCA956X_MAC_CFG1_RX_EN BIT(2) 176a95f4b1cSGabor Juhos #define QCA956X_MAC_CFG1_TX_EN BIT(0) 177a95f4b1cSGabor Juhos 178a95f4b1cSGabor Juhos #define QCA956X_MAC_CFG2_REG 0x04 179a95f4b1cSGabor Juhos #define QCA956X_MAC_CFG2_IF_1000 BIT(9) 180a95f4b1cSGabor Juhos #define QCA956X_MAC_CFG2_IF_10_100 BIT(8) 181a95f4b1cSGabor Juhos #define QCA956X_MAC_CFG2_HUGE_FRAME_EN BIT(5) 182a95f4b1cSGabor Juhos #define QCA956X_MAC_CFG2_LEN_CHECK BIT(4) 183a95f4b1cSGabor Juhos #define QCA956X_MAC_CFG2_PAD_CRC_EN BIT(2) 184a95f4b1cSGabor Juhos #define QCA956X_MAC_CFG2_FDX BIT(0) 185a95f4b1cSGabor Juhos 186a95f4b1cSGabor Juhos #define QCA956X_MAC_MII_MGMT_CFG_REG 0x20 187a95f4b1cSGabor Juhos #define QCA956X_MGMT_CFG_CLK_DIV_20 0x07 188a95f4b1cSGabor Juhos 189a95f4b1cSGabor Juhos #define QCA956X_MAC_FIFO_CFG0_REG 0x48 190a95f4b1cSGabor Juhos #define QCA956X_MAC_FIFO_CFG1_REG 0x4c 191a95f4b1cSGabor Juhos #define QCA956X_MAC_FIFO_CFG2_REG 0x50 192a95f4b1cSGabor Juhos #define QCA956X_MAC_FIFO_CFG3_REG 0x54 193a95f4b1cSGabor Juhos #define QCA956X_MAC_FIFO_CFG4_REG 0x58 194a95f4b1cSGabor Juhos #define QCA956X_MAC_FIFO_CFG5_REG 0x5c 195a95f4b1cSGabor Juhos 196a95f4b1cSGabor Juhos #define QCA956X_DAM_RESET_OFFSET 0xb90001bc 197a95f4b1cSGabor Juhos #define QCA956X_DAM_RESET_SIZE 0x4 198a95f4b1cSGabor Juhos #define QCA956X_INLINE_CHKSUM_ENG BIT(27) 199e9c0d0aaSGabor Juhos 200d4a67d9dSGabor Juhos /* 201d4a67d9dSGabor Juhos * DDR_CTRL block 202d4a67d9dSGabor Juhos */ 203d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN0 0x7c 204d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN1 0x80 205d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN2 0x84 206d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN3 0x88 207d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN4 0x8c 208d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN5 0x90 209d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN6 0x94 210d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN7 0x98 211d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_FLUSH_GE0 0x9c 212d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_FLUSH_GE1 0xa0 213d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_FLUSH_USB 0xa4 214d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_FLUSH_PCI 0xa8 215d4a67d9dSGabor Juhos 216d4a67d9dSGabor Juhos #define AR724X_DDR_REG_FLUSH_GE0 0x7c 217d4a67d9dSGabor Juhos #define AR724X_DDR_REG_FLUSH_GE1 0x80 218d4a67d9dSGabor Juhos #define AR724X_DDR_REG_FLUSH_USB 0x84 219d4a67d9dSGabor Juhos #define AR724X_DDR_REG_FLUSH_PCIE 0x88 220d4a67d9dSGabor Juhos 221d4a67d9dSGabor Juhos #define AR913X_DDR_REG_FLUSH_GE0 0x7c 222d4a67d9dSGabor Juhos #define AR913X_DDR_REG_FLUSH_GE1 0x80 223d4a67d9dSGabor Juhos #define AR913X_DDR_REG_FLUSH_USB 0x84 224d4a67d9dSGabor Juhos #define AR913X_DDR_REG_FLUSH_WMAC 0x88 225d4a67d9dSGabor Juhos 22654eed4c7SGabor Juhos #define AR933X_DDR_REG_FLUSH_GE0 0x7c 22754eed4c7SGabor Juhos #define AR933X_DDR_REG_FLUSH_GE1 0x80 22854eed4c7SGabor Juhos #define AR933X_DDR_REG_FLUSH_USB 0x84 22954eed4c7SGabor Juhos #define AR933X_DDR_REG_FLUSH_WMAC 0x88 23054eed4c7SGabor Juhos 231fce5cc6eSGabor Juhos #define AR934X_DDR_REG_FLUSH_GE0 0x9c 232fce5cc6eSGabor Juhos #define AR934X_DDR_REG_FLUSH_GE1 0xa0 233fce5cc6eSGabor Juhos #define AR934X_DDR_REG_FLUSH_USB 0xa4 234fce5cc6eSGabor Juhos #define AR934X_DDR_REG_FLUSH_PCIE 0xa8 235fce5cc6eSGabor Juhos #define AR934X_DDR_REG_FLUSH_WMAC 0xac 236fce5cc6eSGabor Juhos 237a95f4b1cSGabor Juhos #define QCA953X_DDR_REG_FLUSH_GE0 0x9c 238a95f4b1cSGabor Juhos #define QCA953X_DDR_REG_FLUSH_GE1 0xa0 239a95f4b1cSGabor Juhos #define QCA953X_DDR_REG_FLUSH_USB 0xa4 240a95f4b1cSGabor Juhos #define QCA953X_DDR_REG_FLUSH_PCIE 0xa8 241a95f4b1cSGabor Juhos #define QCA953X_DDR_REG_FLUSH_WMAC 0xac 242a95f4b1cSGabor Juhos 243d4a67d9dSGabor Juhos /* 244d4a67d9dSGabor Juhos * PLL block 245d4a67d9dSGabor Juhos */ 246d4a67d9dSGabor Juhos #define AR71XX_PLL_REG_CPU_CONFIG 0x00 247d4a67d9dSGabor Juhos #define AR71XX_PLL_REG_SEC_CONFIG 0x04 248d4a67d9dSGabor Juhos #define AR71XX_PLL_REG_ETH0_INT_CLOCK 0x10 249d4a67d9dSGabor Juhos #define AR71XX_PLL_REG_ETH1_INT_CLOCK 0x14 250d4a67d9dSGabor Juhos 251626a0695SAlban Bedel #define AR71XX_PLL_FB_SHIFT 3 252626a0695SAlban Bedel #define AR71XX_PLL_FB_MASK 0x1f 253d4a67d9dSGabor Juhos #define AR71XX_CPU_DIV_SHIFT 16 254d4a67d9dSGabor Juhos #define AR71XX_CPU_DIV_MASK 0x3 255d4a67d9dSGabor Juhos #define AR71XX_DDR_DIV_SHIFT 18 256d4a67d9dSGabor Juhos #define AR71XX_DDR_DIV_MASK 0x3 257d4a67d9dSGabor Juhos #define AR71XX_AHB_DIV_SHIFT 20 258d4a67d9dSGabor Juhos #define AR71XX_AHB_DIV_MASK 0x7 259d4a67d9dSGabor Juhos 260a95f4b1cSGabor Juhos #define AR71XX_ETH0_PLL_SHIFT 17 261a95f4b1cSGabor Juhos #define AR71XX_ETH1_PLL_SHIFT 19 262a95f4b1cSGabor Juhos 263d4a67d9dSGabor Juhos #define AR724X_PLL_REG_CPU_CONFIG 0x00 26405454c1bSMathias Kresin #define AR724X_PLL_REG_PCIE_CONFIG 0x10 265d4a67d9dSGabor Juhos 266a95f4b1cSGabor Juhos #define AR724X_PLL_REG_PCIE_CONFIG_PPL_BYPASS BIT(16) 267a95f4b1cSGabor Juhos #define AR724X_PLL_REG_PCIE_CONFIG_PPL_RESET BIT(25) 268a95f4b1cSGabor Juhos 269626a0695SAlban Bedel #define AR724X_PLL_FB_SHIFT 0 270626a0695SAlban Bedel #define AR724X_PLL_FB_MASK 0x3ff 271d4a67d9dSGabor Juhos #define AR724X_PLL_REF_DIV_SHIFT 10 272d4a67d9dSGabor Juhos #define AR724X_PLL_REF_DIV_MASK 0xf 273d4a67d9dSGabor Juhos #define AR724X_AHB_DIV_SHIFT 19 274d4a67d9dSGabor Juhos #define AR724X_AHB_DIV_MASK 0x1 275d4a67d9dSGabor Juhos #define AR724X_DDR_DIV_SHIFT 22 276d4a67d9dSGabor Juhos #define AR724X_DDR_DIV_MASK 0x3 277d4a67d9dSGabor Juhos 278a95f4b1cSGabor Juhos #define AR7242_PLL_REG_ETH0_INT_CLOCK 0x2c 279a95f4b1cSGabor Juhos 280d4a67d9dSGabor Juhos #define AR913X_PLL_REG_CPU_CONFIG 0x00 281d4a67d9dSGabor Juhos #define AR913X_PLL_REG_ETH_CONFIG 0x04 282d4a67d9dSGabor Juhos #define AR913X_PLL_REG_ETH0_INT_CLOCK 0x14 283d4a67d9dSGabor Juhos #define AR913X_PLL_REG_ETH1_INT_CLOCK 0x18 284d4a67d9dSGabor Juhos 285626a0695SAlban Bedel #define AR913X_PLL_FB_SHIFT 0 286626a0695SAlban Bedel #define AR913X_PLL_FB_MASK 0x3ff 287d4a67d9dSGabor Juhos #define AR913X_DDR_DIV_SHIFT 22 288d4a67d9dSGabor Juhos #define AR913X_DDR_DIV_MASK 0x3 289d4a67d9dSGabor Juhos #define AR913X_AHB_DIV_SHIFT 19 290d4a67d9dSGabor Juhos #define AR913X_AHB_DIV_MASK 0x1 291d4a67d9dSGabor Juhos 292a95f4b1cSGabor Juhos #define AR913X_ETH0_PLL_SHIFT 20 293a95f4b1cSGabor Juhos #define AR913X_ETH1_PLL_SHIFT 22 294a95f4b1cSGabor Juhos 29504225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_REG 0x00 29604225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_REG 0x08 29704225e1dSGabor Juhos 29804225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_NINT_SHIFT 10 29904225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_NINT_MASK 0x3f 30004225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_REFDIV_SHIFT 16 30104225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f 30204225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_OUTDIV_SHIFT 23 30304225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_OUTDIV_MASK 0x7 30404225e1dSGabor Juhos 30504225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_BYPASS BIT(2) 30604225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_CPU_DIV_SHIFT 5 30704225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_CPU_DIV_MASK 0x3 30804225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_DDR_DIV_SHIFT 10 30904225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_DDR_DIV_MASK 0x3 31004225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_AHB_DIV_SHIFT 15 31104225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_AHB_DIV_MASK 0x7 31204225e1dSGabor Juhos 3138889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_REG 0x00 3148889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_REG 0x04 3158889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_REG 0x08 316a95f4b1cSGabor Juhos #define AR934X_PLL_SWITCH_CLOCK_CONTROL_REG 0x24 317a95f4b1cSGabor Juhos #define AR934X_PLL_ETH_XMII_CONTROL_REG 0x2c 3188889612bSGabor Juhos 3198889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_NFRAC_SHIFT 0 3208889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_NFRAC_MASK 0x3f 3218889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_NINT_SHIFT 6 3228889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_NINT_MASK 0x3f 3238889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_REFDIV_SHIFT 12 3248889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f 3258889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19 3268889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_OUTDIV_MASK 0x3 3278889612bSGabor Juhos 3288889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_NFRAC_SHIFT 0 3298889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_NFRAC_MASK 0x3ff 3308889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_NINT_SHIFT 10 3318889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_NINT_MASK 0x3f 3328889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_REFDIV_SHIFT 16 3338889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_REFDIV_MASK 0x1f 3348889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_OUTDIV_SHIFT 23 3358889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_OUTDIV_MASK 0x7 3368889612bSGabor Juhos 3378889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_PLL_BYPASS BIT(2) 3388889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_PLL_BYPASS BIT(3) 3398889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_PLL_BYPASS BIT(4) 3408889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_POST_DIV_SHIFT 5 3418889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_POST_DIV_MASK 0x1f 3428889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_POST_DIV_SHIFT 10 3438889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_POST_DIV_MASK 0x1f 3448889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_POST_DIV_SHIFT 15 3458889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_POST_DIV_MASK 0x1f 3468889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_CPUCLK_FROM_CPUPLL BIT(20) 3478889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21) 3488889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) 3498889612bSGabor Juhos 350a95f4b1cSGabor Juhos #define AR934X_PLL_SWITCH_CLOCK_CONTROL_MDIO_CLK_SEL BIT(6) 351a95f4b1cSGabor Juhos 352a95f4b1cSGabor Juhos #define QCA953X_PLL_CPU_CONFIG_REG 0x00 353a95f4b1cSGabor Juhos #define QCA953X_PLL_DDR_CONFIG_REG 0x04 354a95f4b1cSGabor Juhos #define QCA953X_PLL_CLK_CTRL_REG 0x08 355a95f4b1cSGabor Juhos #define QCA953X_PLL_SWITCH_CLOCK_CONTROL_REG 0x24 356a95f4b1cSGabor Juhos #define QCA953X_PLL_ETH_XMII_CONTROL_REG 0x2c 357a95f4b1cSGabor Juhos #define QCA953X_PLL_ETH_SGMII_CONTROL_REG 0x48 358a95f4b1cSGabor Juhos 359a95f4b1cSGabor Juhos #define QCA953X_PLL_CPU_CONFIG_NFRAC_SHIFT 0 360a95f4b1cSGabor Juhos #define QCA953X_PLL_CPU_CONFIG_NFRAC_MASK 0x3f 361a95f4b1cSGabor Juhos #define QCA953X_PLL_CPU_CONFIG_NINT_SHIFT 6 362a95f4b1cSGabor Juhos #define QCA953X_PLL_CPU_CONFIG_NINT_MASK 0x3f 363a95f4b1cSGabor Juhos #define QCA953X_PLL_CPU_CONFIG_REFDIV_SHIFT 12 364a95f4b1cSGabor Juhos #define QCA953X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f 365a95f4b1cSGabor Juhos #define QCA953X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19 366a95f4b1cSGabor Juhos #define QCA953X_PLL_CPU_CONFIG_OUTDIV_MASK 0x7 367a95f4b1cSGabor Juhos 368a95f4b1cSGabor Juhos #define QCA953X_PLL_DDR_CONFIG_NFRAC_SHIFT 0 369a95f4b1cSGabor Juhos #define QCA953X_PLL_DDR_CONFIG_NFRAC_MASK 0x3ff 370a95f4b1cSGabor Juhos #define QCA953X_PLL_DDR_CONFIG_NINT_SHIFT 10 371a95f4b1cSGabor Juhos #define QCA953X_PLL_DDR_CONFIG_NINT_MASK 0x3f 372a95f4b1cSGabor Juhos #define QCA953X_PLL_DDR_CONFIG_REFDIV_SHIFT 16 373a95f4b1cSGabor Juhos #define QCA953X_PLL_DDR_CONFIG_REFDIV_MASK 0x1f 374a95f4b1cSGabor Juhos #define QCA953X_PLL_DDR_CONFIG_OUTDIV_SHIFT 23 375a95f4b1cSGabor Juhos #define QCA953X_PLL_DDR_CONFIG_OUTDIV_MASK 0x7 376a95f4b1cSGabor Juhos 377a95f4b1cSGabor Juhos #define QCA953X_PLL_CLK_CTRL_CPU_PLL_BYPASS BIT(2) 378a95f4b1cSGabor Juhos #define QCA953X_PLL_CLK_CTRL_DDR_PLL_BYPASS BIT(3) 379a95f4b1cSGabor Juhos #define QCA953X_PLL_CLK_CTRL_AHB_PLL_BYPASS BIT(4) 380a95f4b1cSGabor Juhos #define QCA953X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT 5 381a95f4b1cSGabor Juhos #define QCA953X_PLL_CLK_CTRL_CPU_POST_DIV_MASK 0x1f 382a95f4b1cSGabor Juhos #define QCA953X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT 10 383a95f4b1cSGabor Juhos #define QCA953X_PLL_CLK_CTRL_DDR_POST_DIV_MASK 0x1f 384a95f4b1cSGabor Juhos #define QCA953X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT 15 385a95f4b1cSGabor Juhos #define QCA953X_PLL_CLK_CTRL_AHB_POST_DIV_MASK 0x1f 386a95f4b1cSGabor Juhos #define QCA953X_PLL_CLK_CTRL_CPUCLK_FROM_CPUPLL BIT(20) 387a95f4b1cSGabor Juhos #define QCA953X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21) 388a95f4b1cSGabor Juhos #define QCA953X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) 389a95f4b1cSGabor Juhos 39041583c05SGabor Juhos #define QCA955X_PLL_CPU_CONFIG_REG 0x00 39141583c05SGabor Juhos #define QCA955X_PLL_DDR_CONFIG_REG 0x04 39241583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_REG 0x08 393a95f4b1cSGabor Juhos #define QCA955X_PLL_ETH_XMII_CONTROL_REG 0x28 394a95f4b1cSGabor Juhos #define QCA955X_PLL_ETH_SGMII_CONTROL_REG 0x48 395a95f4b1cSGabor Juhos #define QCA955X_PLL_ETH_SGMII_SERDES_REG 0x4c 39641583c05SGabor Juhos 39741583c05SGabor Juhos #define QCA955X_PLL_CPU_CONFIG_NFRAC_SHIFT 0 39841583c05SGabor Juhos #define QCA955X_PLL_CPU_CONFIG_NFRAC_MASK 0x3f 39941583c05SGabor Juhos #define QCA955X_PLL_CPU_CONFIG_NINT_SHIFT 6 40041583c05SGabor Juhos #define QCA955X_PLL_CPU_CONFIG_NINT_MASK 0x3f 40141583c05SGabor Juhos #define QCA955X_PLL_CPU_CONFIG_REFDIV_SHIFT 12 40241583c05SGabor Juhos #define QCA955X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f 40341583c05SGabor Juhos #define QCA955X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19 40441583c05SGabor Juhos #define QCA955X_PLL_CPU_CONFIG_OUTDIV_MASK 0x3 40541583c05SGabor Juhos 40641583c05SGabor Juhos #define QCA955X_PLL_DDR_CONFIG_NFRAC_SHIFT 0 40741583c05SGabor Juhos #define QCA955X_PLL_DDR_CONFIG_NFRAC_MASK 0x3ff 40841583c05SGabor Juhos #define QCA955X_PLL_DDR_CONFIG_NINT_SHIFT 10 40941583c05SGabor Juhos #define QCA955X_PLL_DDR_CONFIG_NINT_MASK 0x3f 41041583c05SGabor Juhos #define QCA955X_PLL_DDR_CONFIG_REFDIV_SHIFT 16 41141583c05SGabor Juhos #define QCA955X_PLL_DDR_CONFIG_REFDIV_MASK 0x1f 41241583c05SGabor Juhos #define QCA955X_PLL_DDR_CONFIG_OUTDIV_SHIFT 23 41341583c05SGabor Juhos #define QCA955X_PLL_DDR_CONFIG_OUTDIV_MASK 0x7 41441583c05SGabor Juhos 41541583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_CPU_PLL_BYPASS BIT(2) 41641583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_DDR_PLL_BYPASS BIT(3) 41741583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_AHB_PLL_BYPASS BIT(4) 41841583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT 5 41941583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_CPU_POST_DIV_MASK 0x1f 42041583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT 10 42141583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_DDR_POST_DIV_MASK 0x1f 42241583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT 15 42341583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_AHB_POST_DIV_MASK 0x1f 42441583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_CPUCLK_FROM_CPUPLL BIT(20) 42541583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21) 42641583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) 42741583c05SGabor Juhos 428a95f4b1cSGabor Juhos #define QCA955X_PLL_ETH_SGMII_SERDES_LOCK_DETECT BIT(2) 429a95f4b1cSGabor Juhos #define QCA955X_PLL_ETH_SGMII_SERDES_PLL_REFCLK BIT(1) 430a95f4b1cSGabor Juhos #define QCA955X_PLL_ETH_SGMII_SERDES_EN_PLL BIT(0) 431a95f4b1cSGabor Juhos 432a95f4b1cSGabor Juhos #define QCA956X_PLL_CPU_CONFIG_REG 0x00 433a95f4b1cSGabor Juhos #define QCA956X_PLL_CPU_CONFIG1_REG 0x04 434a95f4b1cSGabor Juhos #define QCA956X_PLL_DDR_CONFIG_REG 0x08 435a95f4b1cSGabor Juhos #define QCA956X_PLL_DDR_CONFIG1_REG 0x0c 436a95f4b1cSGabor Juhos #define QCA956X_PLL_CLK_CTRL_REG 0x10 437a95f4b1cSGabor Juhos #define QCA956X_PLL_SWITCH_CLOCK_CONTROL_REG 0x28 438a95f4b1cSGabor Juhos #define QCA956X_PLL_ETH_XMII_CONTROL_REG 0x30 439a95f4b1cSGabor Juhos #define QCA956X_PLL_ETH_SGMII_SERDES_REG 0x4c 440a95f4b1cSGabor Juhos 441a95f4b1cSGabor Juhos #define QCA956X_PLL_CPU_CONFIG_REFDIV_SHIFT 12 442a95f4b1cSGabor Juhos #define QCA956X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f 443a95f4b1cSGabor Juhos #define QCA956X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19 444a95f4b1cSGabor Juhos #define QCA956X_PLL_CPU_CONFIG_OUTDIV_MASK 0x7 445a95f4b1cSGabor Juhos 446a95f4b1cSGabor Juhos #define QCA956X_PLL_CPU_CONFIG1_NFRAC_L_SHIFT 0 447a95f4b1cSGabor Juhos #define QCA956X_PLL_CPU_CONFIG1_NFRAC_L_MASK 0x1f 448a95f4b1cSGabor Juhos #define QCA956X_PLL_CPU_CONFIG1_NFRAC_H_SHIFT 5 449a95f4b1cSGabor Juhos #define QCA956X_PLL_CPU_CONFIG1_NFRAC_H_MASK 0x1fff 450a95f4b1cSGabor Juhos #define QCA956X_PLL_CPU_CONFIG1_NINT_SHIFT 18 451a95f4b1cSGabor Juhos #define QCA956X_PLL_CPU_CONFIG1_NINT_MASK 0x1ff 452a95f4b1cSGabor Juhos 453a95f4b1cSGabor Juhos #define QCA956X_PLL_DDR_CONFIG_REFDIV_SHIFT 16 454a95f4b1cSGabor Juhos #define QCA956X_PLL_DDR_CONFIG_REFDIV_MASK 0x1f 455a95f4b1cSGabor Juhos #define QCA956X_PLL_DDR_CONFIG_OUTDIV_SHIFT 23 456a95f4b1cSGabor Juhos #define QCA956X_PLL_DDR_CONFIG_OUTDIV_MASK 0x7 457a95f4b1cSGabor Juhos 458a95f4b1cSGabor Juhos #define QCA956X_PLL_DDR_CONFIG1_NFRAC_L_SHIFT 0 459a95f4b1cSGabor Juhos #define QCA956X_PLL_DDR_CONFIG1_NFRAC_L_MASK 0x1f 460a95f4b1cSGabor Juhos #define QCA956X_PLL_DDR_CONFIG1_NFRAC_H_SHIFT 5 461a95f4b1cSGabor Juhos #define QCA956X_PLL_DDR_CONFIG1_NFRAC_H_MASK 0x1fff 462a95f4b1cSGabor Juhos #define QCA956X_PLL_DDR_CONFIG1_NINT_SHIFT 18 463a95f4b1cSGabor Juhos #define QCA956X_PLL_DDR_CONFIG1_NINT_MASK 0x1ff 464a95f4b1cSGabor Juhos 465a95f4b1cSGabor Juhos #define QCA956X_PLL_CLK_CTRL_CPU_PLL_BYPASS BIT(2) 466a95f4b1cSGabor Juhos #define QCA956X_PLL_CLK_CTRL_DDR_PLL_BYPASS BIT(3) 467a95f4b1cSGabor Juhos #define QCA956X_PLL_CLK_CTRL_AHB_PLL_BYPASS BIT(4) 468a95f4b1cSGabor Juhos #define QCA956X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT 5 469a95f4b1cSGabor Juhos #define QCA956X_PLL_CLK_CTRL_CPU_POST_DIV_MASK 0x1f 470a95f4b1cSGabor Juhos #define QCA956X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT 10 471a95f4b1cSGabor Juhos #define QCA956X_PLL_CLK_CTRL_DDR_POST_DIV_MASK 0x1f 472a95f4b1cSGabor Juhos #define QCA956X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT 15 473a95f4b1cSGabor Juhos #define QCA956X_PLL_CLK_CTRL_AHB_POST_DIV_MASK 0x1f 474a95f4b1cSGabor Juhos #define QCA956X_PLL_CLK_CTRL_CPU_DDRCLK_FROM_DDRPLL BIT(20) 475a95f4b1cSGabor Juhos #define QCA956X_PLL_CLK_CTRL_CPU_DDRCLK_FROM_CPUPLL BIT(21) 476a95f4b1cSGabor Juhos #define QCA956X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) 477a95f4b1cSGabor Juhos 478a95f4b1cSGabor Juhos #define QCA956X_PLL_SWITCH_CLOCK_SPARE_I2C_CLK_SELB BIT(5) 479a95f4b1cSGabor Juhos #define QCA956X_PLL_SWITCH_CLOCK_SPARE_MDIO_CLK_SEL0_1 BIT(6) 480a95f4b1cSGabor Juhos #define QCA956X_PLL_SWITCH_CLOCK_SPARE_UART1_CLK_SEL BIT(7) 481a95f4b1cSGabor Juhos #define QCA956X_PLL_SWITCH_CLOCK_SPARE_USB_REFCLK_FREQ_SEL_SHIFT 8 482a95f4b1cSGabor Juhos #define QCA956X_PLL_SWITCH_CLOCK_SPARE_USB_REFCLK_FREQ_SEL_MASK 0xf 483a95f4b1cSGabor Juhos #define QCA956X_PLL_SWITCH_CLOCK_SPARE_EN_PLL_TOP BIT(12) 484a95f4b1cSGabor Juhos #define QCA956X_PLL_SWITCH_CLOCK_SPARE_MDIO_CLK_SEL0_2 BIT(13) 485a95f4b1cSGabor Juhos #define QCA956X_PLL_SWITCH_CLOCK_SPARE_MDIO_CLK_SEL1_1 BIT(14) 486a95f4b1cSGabor Juhos #define QCA956X_PLL_SWITCH_CLOCK_SPARE_MDIO_CLK_SEL1_2 BIT(15) 487a95f4b1cSGabor Juhos #define QCA956X_PLL_SWITCH_CLOCK_SPARE_SWITCH_FUNC_TST_MODE BIT(16) 488a95f4b1cSGabor Juhos #define QCA956X_PLL_SWITCH_CLOCK_SPARE_EEE_ENABLE BIT(17) 489a95f4b1cSGabor Juhos #define QCA956X_PLL_SWITCH_CLOCK_SPARE_OEN_CLK125M_PLL BIT(18) 490a95f4b1cSGabor Juhos #define QCA956X_PLL_SWITCH_CLOCK_SPARE_SWITCHCLK_SEL BIT(19) 491a95f4b1cSGabor Juhos 492a95f4b1cSGabor Juhos #define QCA956X_PLL_ETH_XMII_TX_INVERT BIT(1) 493a95f4b1cSGabor Juhos #define QCA956X_PLL_ETH_XMII_GIGE BIT(25) 494a95f4b1cSGabor Juhos #define QCA956X_PLL_ETH_XMII_RX_DELAY_SHIFT 28 495a95f4b1cSGabor Juhos #define QCA956X_PLL_ETH_XMII_RX_DELAY_MASK 0x3 496a95f4b1cSGabor Juhos #define QCA956X_PLL_ETH_XMII_TX_DELAY_SHIFT 26 497a95f4b1cSGabor Juhos #define QCA956X_PLL_ETH_XMII_TX_DELAY_MASK 3 498a95f4b1cSGabor Juhos 499a95f4b1cSGabor Juhos #define QCA956X_PLL_ETH_SGMII_SERDES_LOCK_DETECT BIT(2) 500a95f4b1cSGabor Juhos #define QCA956X_PLL_ETH_SGMII_SERDES_PLL_REFCLK BIT(1) 501a95f4b1cSGabor Juhos #define QCA956X_PLL_ETH_SGMII_SERDES_EN_PLL BIT(0) 502a95f4b1cSGabor Juhos 503d4a67d9dSGabor Juhos /* 5047e98aa46SGabor Juhos * USB_CONFIG block 5057e98aa46SGabor Juhos */ 5067e98aa46SGabor Juhos #define AR71XX_USB_CTRL_REG_FLADJ 0x00 5077e98aa46SGabor Juhos #define AR71XX_USB_CTRL_REG_CONFIG 0x04 5087e98aa46SGabor Juhos 5097e98aa46SGabor Juhos /* 510d4a67d9dSGabor Juhos * RESET block 511d4a67d9dSGabor Juhos */ 512d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_TIMER 0x00 513d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_TIMER_RELOAD 0x04 514d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_WDOG_CTRL 0x08 515d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_WDOG 0x0c 516d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_MISC_INT_STATUS 0x10 517d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_MISC_INT_ENABLE 0x14 518d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PCI_INT_STATUS 0x18 519d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PCI_INT_ENABLE 0x1c 520d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_GLOBAL_INT_STATUS 0x20 521d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_RESET_MODULE 0x24 522d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PERFC_CTRL 0x2c 523d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PERFC0 0x30 524d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PERFC1 0x34 525d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_REV_ID 0x90 526d4a67d9dSGabor Juhos 527d4a67d9dSGabor Juhos #define AR913X_RESET_REG_GLOBAL_INT_STATUS 0x18 528d4a67d9dSGabor Juhos #define AR913X_RESET_REG_RESET_MODULE 0x1c 529d4a67d9dSGabor Juhos #define AR913X_RESET_REG_PERF_CTRL 0x20 530d4a67d9dSGabor Juhos #define AR913X_RESET_REG_PERFC0 0x24 531d4a67d9dSGabor Juhos #define AR913X_RESET_REG_PERFC1 0x28 532d4a67d9dSGabor Juhos 533d4a67d9dSGabor Juhos #define AR724X_RESET_REG_RESET_MODULE 0x1c 534d4a67d9dSGabor Juhos 5357ee15d8aSGabor Juhos #define AR933X_RESET_REG_RESET_MODULE 0x1c 53604225e1dSGabor Juhos #define AR933X_RESET_REG_BOOTSTRAP 0xac 53704225e1dSGabor Juhos 53842184768SGabor Juhos #define AR934X_RESET_REG_RESET_MODULE 0x1c 5398889612bSGabor Juhos #define AR934X_RESET_REG_BOOTSTRAP 0xb0 540fce5cc6eSGabor Juhos #define AR934X_RESET_REG_PCIE_WMAC_INT_STATUS 0xac 5418889612bSGabor Juhos 542a95f4b1cSGabor Juhos #define QCA953X_RESET_REG_RESET_MODULE 0x1c 543a95f4b1cSGabor Juhos #define QCA953X_RESET_REG_BOOTSTRAP 0xb0 544a95f4b1cSGabor Juhos #define QCA953X_RESET_REG_PCIE_WMAC_INT_STATUS 0xac 545a95f4b1cSGabor Juhos 5467d4c2af9SGabor Juhos #define QCA955X_RESET_REG_RESET_MODULE 0x1c 54741583c05SGabor Juhos #define QCA955X_RESET_REG_BOOTSTRAP 0xb0 54853330332SGabor Juhos #define QCA955X_RESET_REG_EXT_INT_STATUS 0xac 54941583c05SGabor Juhos 550a95f4b1cSGabor Juhos #define QCA956X_RESET_REG_RESET_MODULE 0x1c 551a95f4b1cSGabor Juhos #define QCA956X_RESET_REG_BOOTSTRAP 0xb0 552a95f4b1cSGabor Juhos #define QCA956X_RESET_REG_EXT_INT_STATUS 0xac 553a95f4b1cSGabor Juhos 554a95f4b1cSGabor Juhos #define MISC_INT_MIPS_SI_TIMERINT_MASK BIT(28) 555d2b4ac1eSGabor Juhos #define MISC_INT_ETHSW BIT(12) 556d2b4ac1eSGabor Juhos #define MISC_INT_TIMER4 BIT(10) 557d2b4ac1eSGabor Juhos #define MISC_INT_TIMER3 BIT(9) 558d2b4ac1eSGabor Juhos #define MISC_INT_TIMER2 BIT(8) 559d4a67d9dSGabor Juhos #define MISC_INT_DMA BIT(7) 560d4a67d9dSGabor Juhos #define MISC_INT_OHCI BIT(6) 561d4a67d9dSGabor Juhos #define MISC_INT_PERFC BIT(5) 562d4a67d9dSGabor Juhos #define MISC_INT_WDOG BIT(4) 563d4a67d9dSGabor Juhos #define MISC_INT_UART BIT(3) 564d4a67d9dSGabor Juhos #define MISC_INT_GPIO BIT(2) 565d4a67d9dSGabor Juhos #define MISC_INT_ERROR BIT(1) 566d4a67d9dSGabor Juhos #define MISC_INT_TIMER BIT(0) 567d4a67d9dSGabor Juhos 568d4a67d9dSGabor Juhos #define AR71XX_RESET_EXTERNAL BIT(28) 569d4a67d9dSGabor Juhos #define AR71XX_RESET_FULL_CHIP BIT(24) 570d4a67d9dSGabor Juhos #define AR71XX_RESET_CPU_NMI BIT(21) 571d4a67d9dSGabor Juhos #define AR71XX_RESET_CPU_COLD BIT(20) 572d4a67d9dSGabor Juhos #define AR71XX_RESET_DMA BIT(19) 573d4a67d9dSGabor Juhos #define AR71XX_RESET_SLIC BIT(18) 574d4a67d9dSGabor Juhos #define AR71XX_RESET_STEREO BIT(17) 575d4a67d9dSGabor Juhos #define AR71XX_RESET_DDR BIT(16) 576d4a67d9dSGabor Juhos #define AR71XX_RESET_GE1_MAC BIT(13) 577d4a67d9dSGabor Juhos #define AR71XX_RESET_GE1_PHY BIT(12) 578d4a67d9dSGabor Juhos #define AR71XX_RESET_USBSUS_OVERRIDE BIT(10) 579d4a67d9dSGabor Juhos #define AR71XX_RESET_GE0_MAC BIT(9) 580d4a67d9dSGabor Juhos #define AR71XX_RESET_GE0_PHY BIT(8) 581d4a67d9dSGabor Juhos #define AR71XX_RESET_USB_OHCI_DLL BIT(6) 582d4a67d9dSGabor Juhos #define AR71XX_RESET_USB_HOST BIT(5) 583d4a67d9dSGabor Juhos #define AR71XX_RESET_USB_PHY BIT(4) 584d4a67d9dSGabor Juhos #define AR71XX_RESET_PCI_BUS BIT(1) 585d4a67d9dSGabor Juhos #define AR71XX_RESET_PCI_CORE BIT(0) 586d4a67d9dSGabor Juhos 5877e98aa46SGabor Juhos #define AR7240_RESET_USB_HOST BIT(5) 5887e98aa46SGabor Juhos #define AR7240_RESET_OHCI_DLL BIT(3) 5897e98aa46SGabor Juhos 590d4a67d9dSGabor Juhos #define AR724X_RESET_GE1_MDIO BIT(23) 591d4a67d9dSGabor Juhos #define AR724X_RESET_GE0_MDIO BIT(22) 592d4a67d9dSGabor Juhos #define AR724X_RESET_PCIE_PHY_SERIAL BIT(10) 593d4a67d9dSGabor Juhos #define AR724X_RESET_PCIE_PHY BIT(7) 594d4a67d9dSGabor Juhos #define AR724X_RESET_PCIE BIT(6) 5957e98aa46SGabor Juhos #define AR724X_RESET_USB_HOST BIT(5) 5967e98aa46SGabor Juhos #define AR724X_RESET_USB_PHY BIT(4) 5977e98aa46SGabor Juhos #define AR724X_RESET_USBSUS_OVERRIDE BIT(3) 598d4a67d9dSGabor Juhos 599d4a67d9dSGabor Juhos #define AR913X_RESET_AMBA2WMAC BIT(22) 6007e98aa46SGabor Juhos #define AR913X_RESET_USBSUS_OVERRIDE BIT(10) 6017e98aa46SGabor Juhos #define AR913X_RESET_USB_HOST BIT(5) 6027e98aa46SGabor Juhos #define AR913X_RESET_USB_PHY BIT(4) 603d4a67d9dSGabor Juhos 604a95f4b1cSGabor Juhos #define AR933X_RESET_GE1_MDIO BIT(23) 605a95f4b1cSGabor Juhos #define AR933X_RESET_GE0_MDIO BIT(22) 606a95f4b1cSGabor Juhos #define AR933X_RESET_GE1_MAC BIT(13) 60734cfcd26SGabor Juhos #define AR933X_RESET_WMAC BIT(11) 608a95f4b1cSGabor Juhos #define AR933X_RESET_GE0_MAC BIT(9) 609c279b775SGabor Juhos #define AR933X_RESET_USB_HOST BIT(5) 610c279b775SGabor Juhos #define AR933X_RESET_USB_PHY BIT(4) 611c279b775SGabor Juhos #define AR933X_RESET_USBSUS_OVERRIDE BIT(3) 612c279b775SGabor Juhos 613a95f4b1cSGabor Juhos #define AR934X_RESET_HOST BIT(31) 614a95f4b1cSGabor Juhos #define AR934X_RESET_SLIC BIT(30) 615a95f4b1cSGabor Juhos #define AR934X_RESET_HDMA BIT(29) 616a95f4b1cSGabor Juhos #define AR934X_RESET_EXTERNAL BIT(28) 617a95f4b1cSGabor Juhos #define AR934X_RESET_RTC BIT(27) 618a95f4b1cSGabor Juhos #define AR934X_RESET_PCIE_EP_INT BIT(26) 619a95f4b1cSGabor Juhos #define AR934X_RESET_CHKSUM_ACC BIT(25) 620a95f4b1cSGabor Juhos #define AR934X_RESET_FULL_CHIP BIT(24) 621a95f4b1cSGabor Juhos #define AR934X_RESET_GE1_MDIO BIT(23) 622a95f4b1cSGabor Juhos #define AR934X_RESET_GE0_MDIO BIT(22) 623a95f4b1cSGabor Juhos #define AR934X_RESET_CPU_NMI BIT(21) 624a95f4b1cSGabor Juhos #define AR934X_RESET_CPU_COLD BIT(20) 625a95f4b1cSGabor Juhos #define AR934X_RESET_HOST_RESET_INT BIT(19) 626a95f4b1cSGabor Juhos #define AR934X_RESET_PCIE_EP BIT(18) 627a95f4b1cSGabor Juhos #define AR934X_RESET_UART1 BIT(17) 628a95f4b1cSGabor Juhos #define AR934X_RESET_DDR BIT(16) 629a95f4b1cSGabor Juhos #define AR934X_RESET_USB_PHY_PLL_PWD_EXT BIT(15) 630a95f4b1cSGabor Juhos #define AR934X_RESET_NANDF BIT(14) 631a95f4b1cSGabor Juhos #define AR934X_RESET_GE1_MAC BIT(13) 632a95f4b1cSGabor Juhos #define AR934X_RESET_ETH_SWITCH_ANALOG BIT(12) 63300ffed58SGabor Juhos #define AR934X_RESET_USB_PHY_ANALOG BIT(11) 634a95f4b1cSGabor Juhos #define AR934X_RESET_HOST_DMA_INT BIT(10) 635a95f4b1cSGabor Juhos #define AR934X_RESET_GE0_MAC BIT(9) 636a95f4b1cSGabor Juhos #define AR934X_RESET_ETH_SWITCH BIT(8) 637a95f4b1cSGabor Juhos #define AR934X_RESET_PCIE_PHY BIT(7) 638a95f4b1cSGabor Juhos #define AR934X_RESET_PCIE BIT(6) 63900ffed58SGabor Juhos #define AR934X_RESET_USB_HOST BIT(5) 64000ffed58SGabor Juhos #define AR934X_RESET_USB_PHY BIT(4) 64100ffed58SGabor Juhos #define AR934X_RESET_USBSUS_OVERRIDE BIT(3) 642a95f4b1cSGabor Juhos #define AR934X_RESET_LUT BIT(2) 643a95f4b1cSGabor Juhos #define AR934X_RESET_MBOX BIT(1) 644a95f4b1cSGabor Juhos #define AR934X_RESET_I2S BIT(0) 64500ffed58SGabor Juhos 646a95f4b1cSGabor Juhos #define QCA953X_RESET_USB_EXT_PWR BIT(29) 647a95f4b1cSGabor Juhos #define QCA953X_RESET_EXTERNAL BIT(28) 648a95f4b1cSGabor Juhos #define QCA953X_RESET_RTC BIT(27) 649a95f4b1cSGabor Juhos #define QCA953X_RESET_FULL_CHIP BIT(24) 650a95f4b1cSGabor Juhos #define QCA953X_RESET_GE1_MDIO BIT(23) 651a95f4b1cSGabor Juhos #define QCA953X_RESET_GE0_MDIO BIT(22) 652a95f4b1cSGabor Juhos #define QCA953X_RESET_CPU_NMI BIT(21) 653a95f4b1cSGabor Juhos #define QCA953X_RESET_CPU_COLD BIT(20) 654a95f4b1cSGabor Juhos #define QCA953X_RESET_DDR BIT(16) 655a95f4b1cSGabor Juhos #define QCA953X_RESET_USB_PHY_PLL_PWD_EXT BIT(15) 656a95f4b1cSGabor Juhos #define QCA953X_RESET_GE1_MAC BIT(13) 657a95f4b1cSGabor Juhos #define QCA953X_RESET_ETH_SWITCH_ANALOG BIT(12) 658a95f4b1cSGabor Juhos #define QCA953X_RESET_USB_PHY_ANALOG BIT(11) 659a95f4b1cSGabor Juhos #define QCA953X_RESET_GE0_MAC BIT(9) 660a95f4b1cSGabor Juhos #define QCA953X_RESET_ETH_SWITCH BIT(8) 661a95f4b1cSGabor Juhos #define QCA953X_RESET_PCIE_PHY BIT(7) 662a95f4b1cSGabor Juhos #define QCA953X_RESET_PCIE BIT(6) 663a95f4b1cSGabor Juhos #define QCA953X_RESET_USB_HOST BIT(5) 664a95f4b1cSGabor Juhos #define QCA953X_RESET_USB_PHY BIT(4) 665a95f4b1cSGabor Juhos #define QCA953X_RESET_USBSUS_OVERRIDE BIT(3) 666a95f4b1cSGabor Juhos 667a95f4b1cSGabor Juhos #define QCA955X_RESET_HOST BIT(31) 668a95f4b1cSGabor Juhos #define QCA955X_RESET_SLIC BIT(30) 669a95f4b1cSGabor Juhos #define QCA955X_RESET_HDMA BIT(29) 670a95f4b1cSGabor Juhos #define QCA955X_RESET_EXTERNAL BIT(28) 671a95f4b1cSGabor Juhos #define QCA955X_RESET_RTC BIT(27) 672a95f4b1cSGabor Juhos #define QCA955X_RESET_PCIE_EP_INT BIT(26) 673a95f4b1cSGabor Juhos #define QCA955X_RESET_CHKSUM_ACC BIT(25) 674a95f4b1cSGabor Juhos #define QCA955X_RESET_FULL_CHIP BIT(24) 675a95f4b1cSGabor Juhos #define QCA955X_RESET_GE1_MDIO BIT(23) 676a95f4b1cSGabor Juhos #define QCA955X_RESET_GE0_MDIO BIT(22) 677a95f4b1cSGabor Juhos #define QCA955X_RESET_CPU_NMI BIT(21) 678a95f4b1cSGabor Juhos #define QCA955X_RESET_CPU_COLD BIT(20) 679a95f4b1cSGabor Juhos #define QCA955X_RESET_HOST_RESET_INT BIT(19) 680a95f4b1cSGabor Juhos #define QCA955X_RESET_PCIE_EP BIT(18) 681a95f4b1cSGabor Juhos #define QCA955X_RESET_UART1 BIT(17) 682a95f4b1cSGabor Juhos #define QCA955X_RESET_DDR BIT(16) 683a95f4b1cSGabor Juhos #define QCA955X_RESET_USB_PHY_PLL_PWD_EXT BIT(15) 684a95f4b1cSGabor Juhos #define QCA955X_RESET_NANDF BIT(14) 685a95f4b1cSGabor Juhos #define QCA955X_RESET_GE1_MAC BIT(13) 686a95f4b1cSGabor Juhos #define QCA955X_RESET_SGMII_ANALOG BIT(12) 687a95f4b1cSGabor Juhos #define QCA955X_RESET_USB_PHY_ANALOG BIT(11) 688a95f4b1cSGabor Juhos #define QCA955X_RESET_HOST_DMA_INT BIT(10) 689a95f4b1cSGabor Juhos #define QCA955X_RESET_GE0_MAC BIT(9) 690a95f4b1cSGabor Juhos #define QCA955X_RESET_SGMII BIT(8) 691a95f4b1cSGabor Juhos #define QCA955X_RESET_PCIE_PHY BIT(7) 692a95f4b1cSGabor Juhos #define QCA955X_RESET_PCIE BIT(6) 693a95f4b1cSGabor Juhos #define QCA955X_RESET_USB_HOST BIT(5) 694a95f4b1cSGabor Juhos #define QCA955X_RESET_USB_PHY BIT(4) 695a95f4b1cSGabor Juhos #define QCA955X_RESET_USBSUS_OVERRIDE BIT(3) 696a95f4b1cSGabor Juhos #define QCA955X_RESET_LUT BIT(2) 697a95f4b1cSGabor Juhos #define QCA955X_RESET_MBOX BIT(1) 698a95f4b1cSGabor Juhos #define QCA955X_RESET_I2S BIT(0) 699a95f4b1cSGabor Juhos 700a95f4b1cSGabor Juhos #define QCA956X_RESET_EXTERNAL BIT(28) 701a95f4b1cSGabor Juhos #define QCA956X_RESET_FULL_CHIP BIT(24) 702a95f4b1cSGabor Juhos #define QCA956X_RESET_GE1_MDIO BIT(23) 703a95f4b1cSGabor Juhos #define QCA956X_RESET_GE0_MDIO BIT(22) 704a95f4b1cSGabor Juhos #define QCA956X_RESET_CPU_NMI BIT(21) 705a95f4b1cSGabor Juhos #define QCA956X_RESET_CPU_COLD BIT(20) 706a95f4b1cSGabor Juhos #define QCA956X_RESET_DMA BIT(19) 707a95f4b1cSGabor Juhos #define QCA956X_RESET_DDR BIT(16) 708a95f4b1cSGabor Juhos #define QCA956X_RESET_GE1_MAC BIT(13) 709a95f4b1cSGabor Juhos #define QCA956X_RESET_SGMII_ANALOG BIT(12) 710a95f4b1cSGabor Juhos #define QCA956X_RESET_USB_PHY_ANALOG BIT(11) 711a95f4b1cSGabor Juhos #define QCA956X_RESET_GE0_MAC BIT(9) 712a95f4b1cSGabor Juhos #define QCA956X_RESET_SGMII BIT(8) 713a95f4b1cSGabor Juhos #define QCA956X_RESET_USB_HOST BIT(5) 714a95f4b1cSGabor Juhos #define QCA956X_RESET_USB_PHY BIT(4) 715a95f4b1cSGabor Juhos #define QCA956X_RESET_USBSUS_OVERRIDE BIT(3) 716a95f4b1cSGabor Juhos #define QCA956X_RESET_SWITCH_ANALOG BIT(2) 717a95f4b1cSGabor Juhos #define QCA956X_RESET_SWITCH BIT(0) 718a95f4b1cSGabor Juhos 719a95f4b1cSGabor Juhos #define AR933X_BOOTSTRAP_MDIO_GPIO_EN BIT(18) 720a95f4b1cSGabor Juhos #define AR933X_BOOTSTRAP_EEPBUSY BIT(4) 72104225e1dSGabor Juhos #define AR933X_BOOTSTRAP_REF_CLK_40 BIT(0) 72204225e1dSGabor Juhos 7238889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION8 BIT(23) 7248889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION7 BIT(22) 7258889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION6 BIT(21) 7268889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION5 BIT(20) 7278889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION4 BIT(19) 7288889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION3 BIT(18) 7298889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION2 BIT(17) 7308889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION1 BIT(16) 7318889612bSGabor Juhos #define AR934X_BOOTSTRAP_USB_MODE_DEVICE BIT(7) 7328889612bSGabor Juhos #define AR934X_BOOTSTRAP_PCIE_RC BIT(6) 7338889612bSGabor Juhos #define AR934X_BOOTSTRAP_EJTAG_MODE BIT(5) 7348889612bSGabor Juhos #define AR934X_BOOTSTRAP_REF_CLK_40 BIT(4) 7358889612bSGabor Juhos #define AR934X_BOOTSTRAP_BOOT_FROM_SPI BIT(2) 7368889612bSGabor Juhos #define AR934X_BOOTSTRAP_SDRAM_DISABLED BIT(1) 7378889612bSGabor Juhos #define AR934X_BOOTSTRAP_DDR1 BIT(0) 7388889612bSGabor Juhos 739a95f4b1cSGabor Juhos #define QCA953X_BOOTSTRAP_SW_OPTION2 BIT(12) 740a95f4b1cSGabor Juhos #define QCA953X_BOOTSTRAP_SW_OPTION1 BIT(11) 741a95f4b1cSGabor Juhos #define QCA953X_BOOTSTRAP_EJTAG_MODE BIT(5) 742a95f4b1cSGabor Juhos #define QCA953X_BOOTSTRAP_REF_CLK_40 BIT(4) 743a95f4b1cSGabor Juhos #define QCA953X_BOOTSTRAP_SDRAM_DISABLED BIT(1) 744a95f4b1cSGabor Juhos #define QCA953X_BOOTSTRAP_DDR1 BIT(0) 745a95f4b1cSGabor Juhos 74641583c05SGabor Juhos #define QCA955X_BOOTSTRAP_REF_CLK_40 BIT(4) 74741583c05SGabor Juhos 748a95f4b1cSGabor Juhos #define QCA956X_BOOTSTRAP_REF_CLK_40 BIT(2) 749a95f4b1cSGabor Juhos 750fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_WMAC_MISC BIT(0) 751fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_WMAC_TX BIT(1) 752fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_WMAC_RXLP BIT(2) 753fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_WMAC_RXHP BIT(3) 754fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_PCIE_RC BIT(4) 755fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_PCIE_RC0 BIT(5) 756fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_PCIE_RC1 BIT(6) 757fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_PCIE_RC2 BIT(7) 758fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_PCIE_RC3 BIT(8) 759fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_WMAC_ALL \ 760fce5cc6eSGabor Juhos (AR934X_PCIE_WMAC_INT_WMAC_MISC | AR934X_PCIE_WMAC_INT_WMAC_TX | \ 761fce5cc6eSGabor Juhos AR934X_PCIE_WMAC_INT_WMAC_RXLP | AR934X_PCIE_WMAC_INT_WMAC_RXHP) 762fce5cc6eSGabor Juhos 763fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_PCIE_ALL \ 764fce5cc6eSGabor Juhos (AR934X_PCIE_WMAC_INT_PCIE_RC | AR934X_PCIE_WMAC_INT_PCIE_RC0 | \ 765fce5cc6eSGabor Juhos AR934X_PCIE_WMAC_INT_PCIE_RC1 | AR934X_PCIE_WMAC_INT_PCIE_RC2 | \ 766fce5cc6eSGabor Juhos AR934X_PCIE_WMAC_INT_PCIE_RC3) 767fce5cc6eSGabor Juhos 768a95f4b1cSGabor Juhos #define QCA953X_PCIE_WMAC_INT_WMAC_MISC BIT(0) 769a95f4b1cSGabor Juhos #define QCA953X_PCIE_WMAC_INT_WMAC_TX BIT(1) 770a95f4b1cSGabor Juhos #define QCA953X_PCIE_WMAC_INT_WMAC_RXLP BIT(2) 771a95f4b1cSGabor Juhos #define QCA953X_PCIE_WMAC_INT_WMAC_RXHP BIT(3) 772a95f4b1cSGabor Juhos #define QCA953X_PCIE_WMAC_INT_PCIE_RC BIT(4) 773a95f4b1cSGabor Juhos #define QCA953X_PCIE_WMAC_INT_PCIE_RC0 BIT(5) 774a95f4b1cSGabor Juhos #define QCA953X_PCIE_WMAC_INT_PCIE_RC1 BIT(6) 775a95f4b1cSGabor Juhos #define QCA953X_PCIE_WMAC_INT_PCIE_RC2 BIT(7) 776a95f4b1cSGabor Juhos #define QCA953X_PCIE_WMAC_INT_PCIE_RC3 BIT(8) 777a95f4b1cSGabor Juhos #define QCA953X_PCIE_WMAC_INT_WMAC_ALL \ 778a95f4b1cSGabor Juhos (QCA953X_PCIE_WMAC_INT_WMAC_MISC | QCA953X_PCIE_WMAC_INT_WMAC_TX | \ 779a95f4b1cSGabor Juhos QCA953X_PCIE_WMAC_INT_WMAC_RXLP | QCA953X_PCIE_WMAC_INT_WMAC_RXHP) 780a95f4b1cSGabor Juhos 781a95f4b1cSGabor Juhos #define QCA953X_PCIE_WMAC_INT_PCIE_ALL \ 782a95f4b1cSGabor Juhos (QCA953X_PCIE_WMAC_INT_PCIE_RC | QCA953X_PCIE_WMAC_INT_PCIE_RC0 | \ 783a95f4b1cSGabor Juhos QCA953X_PCIE_WMAC_INT_PCIE_RC1 | QCA953X_PCIE_WMAC_INT_PCIE_RC2 | \ 784a95f4b1cSGabor Juhos QCA953X_PCIE_WMAC_INT_PCIE_RC3) 785a95f4b1cSGabor Juhos 78653330332SGabor Juhos #define QCA955X_EXT_INT_WMAC_MISC BIT(0) 78753330332SGabor Juhos #define QCA955X_EXT_INT_WMAC_TX BIT(1) 78853330332SGabor Juhos #define QCA955X_EXT_INT_WMAC_RXLP BIT(2) 78953330332SGabor Juhos #define QCA955X_EXT_INT_WMAC_RXHP BIT(3) 79053330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC1 BIT(4) 79153330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC1_INT0 BIT(5) 79253330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC1_INT1 BIT(6) 79353330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC1_INT2 BIT(7) 79453330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC1_INT3 BIT(8) 79553330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC2 BIT(12) 79653330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC2_INT0 BIT(13) 79753330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC2_INT1 BIT(14) 79853330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC2_INT2 BIT(15) 79953330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC2_INT3 BIT(16) 80053330332SGabor Juhos #define QCA955X_EXT_INT_USB1 BIT(24) 80153330332SGabor Juhos #define QCA955X_EXT_INT_USB2 BIT(28) 80253330332SGabor Juhos 80353330332SGabor Juhos #define QCA955X_EXT_INT_WMAC_ALL \ 80453330332SGabor Juhos (QCA955X_EXT_INT_WMAC_MISC | QCA955X_EXT_INT_WMAC_TX | \ 80553330332SGabor Juhos QCA955X_EXT_INT_WMAC_RXLP | QCA955X_EXT_INT_WMAC_RXHP) 80653330332SGabor Juhos 80753330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC1_ALL \ 80853330332SGabor Juhos (QCA955X_EXT_INT_PCIE_RC1 | QCA955X_EXT_INT_PCIE_RC1_INT0 | \ 80953330332SGabor Juhos QCA955X_EXT_INT_PCIE_RC1_INT1 | QCA955X_EXT_INT_PCIE_RC1_INT2 | \ 81053330332SGabor Juhos QCA955X_EXT_INT_PCIE_RC1_INT3) 81153330332SGabor Juhos 81253330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC2_ALL \ 81353330332SGabor Juhos (QCA955X_EXT_INT_PCIE_RC2 | QCA955X_EXT_INT_PCIE_RC2_INT0 | \ 81453330332SGabor Juhos QCA955X_EXT_INT_PCIE_RC2_INT1 | QCA955X_EXT_INT_PCIE_RC2_INT2 | \ 81553330332SGabor Juhos QCA955X_EXT_INT_PCIE_RC2_INT3) 81653330332SGabor Juhos 817a95f4b1cSGabor Juhos #define QCA956X_EXT_INT_WMAC_MISC BIT(0) 818a95f4b1cSGabor Juhos #define QCA956X_EXT_INT_WMAC_TX BIT(1) 819a95f4b1cSGabor Juhos #define QCA956X_EXT_INT_WMAC_RXLP BIT(2) 820a95f4b1cSGabor Juhos #define QCA956X_EXT_INT_WMAC_RXHP BIT(3) 821a95f4b1cSGabor Juhos #define QCA956X_EXT_INT_PCIE_RC1 BIT(4) 822a95f4b1cSGabor Juhos #define QCA956X_EXT_INT_PCIE_RC1_INT0 BIT(5) 823a95f4b1cSGabor Juhos #define QCA956X_EXT_INT_PCIE_RC1_INT1 BIT(6) 824a95f4b1cSGabor Juhos #define QCA956X_EXT_INT_PCIE_RC1_INT2 BIT(7) 825a95f4b1cSGabor Juhos #define QCA956X_EXT_INT_PCIE_RC1_INT3 BIT(8) 826a95f4b1cSGabor Juhos #define QCA956X_EXT_INT_PCIE_RC2 BIT(12) 827a95f4b1cSGabor Juhos #define QCA956X_EXT_INT_PCIE_RC2_INT0 BIT(13) 828a95f4b1cSGabor Juhos #define QCA956X_EXT_INT_PCIE_RC2_INT1 BIT(14) 829a95f4b1cSGabor Juhos #define QCA956X_EXT_INT_PCIE_RC2_INT2 BIT(15) 830a95f4b1cSGabor Juhos #define QCA956X_EXT_INT_PCIE_RC2_INT3 BIT(16) 831a95f4b1cSGabor Juhos #define QCA956X_EXT_INT_USB1 BIT(24) 832a95f4b1cSGabor Juhos #define QCA956X_EXT_INT_USB2 BIT(28) 833a95f4b1cSGabor Juhos 834a95f4b1cSGabor Juhos #define QCA956X_EXT_INT_WMAC_ALL \ 835a95f4b1cSGabor Juhos (QCA956X_EXT_INT_WMAC_MISC | QCA956X_EXT_INT_WMAC_TX | \ 836a95f4b1cSGabor Juhos QCA956X_EXT_INT_WMAC_RXLP | QCA956X_EXT_INT_WMAC_RXHP) 837a95f4b1cSGabor Juhos 838a95f4b1cSGabor Juhos #define QCA956X_EXT_INT_PCIE_RC1_ALL \ 839a95f4b1cSGabor Juhos (QCA956X_EXT_INT_PCIE_RC1 | QCA956X_EXT_INT_PCIE_RC1_INT0 | \ 840a95f4b1cSGabor Juhos QCA956X_EXT_INT_PCIE_RC1_INT1 | QCA956X_EXT_INT_PCIE_RC1_INT2 | \ 841a95f4b1cSGabor Juhos QCA956X_EXT_INT_PCIE_RC1_INT3) 842a95f4b1cSGabor Juhos 843a95f4b1cSGabor Juhos #define QCA956X_EXT_INT_PCIE_RC2_ALL \ 844a95f4b1cSGabor Juhos (QCA956X_EXT_INT_PCIE_RC2 | QCA956X_EXT_INT_PCIE_RC2_INT0 | \ 845a95f4b1cSGabor Juhos QCA956X_EXT_INT_PCIE_RC2_INT1 | QCA956X_EXT_INT_PCIE_RC2_INT2 | \ 846a95f4b1cSGabor Juhos QCA956X_EXT_INT_PCIE_RC2_INT3) 847a95f4b1cSGabor Juhos 848d4a67d9dSGabor Juhos #define REV_ID_MAJOR_MASK 0xfff0 849d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR71XX 0x00a0 850d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR913X 0x00b0 851d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR7240 0x00c0 852d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR7241 0x0100 853d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR7242 0x1100 8546d1c8fdeSGabor Juhos #define REV_ID_MAJOR_AR9330 0x0110 8556d1c8fdeSGabor Juhos #define REV_ID_MAJOR_AR9331 0x1110 856703327ddSGabor Juhos #define REV_ID_MAJOR_AR9341 0x0120 857703327ddSGabor Juhos #define REV_ID_MAJOR_AR9342 0x1120 858703327ddSGabor Juhos #define REV_ID_MAJOR_AR9344 0x2120 859a95f4b1cSGabor Juhos #define REV_ID_MAJOR_QCA9533 0x0140 860a95f4b1cSGabor Juhos #define REV_ID_MAJOR_QCA9533_V2 0x0160 86190898779SGabor Juhos #define REV_ID_MAJOR_QCA9556 0x0130 86290898779SGabor Juhos #define REV_ID_MAJOR_QCA9558 0x1130 863a95f4b1cSGabor Juhos #define REV_ID_MAJOR_TP9343 0x0150 864a95f4b1cSGabor Juhos #define REV_ID_MAJOR_QCA956X 0x1150 865d4a67d9dSGabor Juhos 866d4a67d9dSGabor Juhos #define AR71XX_REV_ID_MINOR_MASK 0x3 867d4a67d9dSGabor Juhos #define AR71XX_REV_ID_MINOR_AR7130 0x0 868d4a67d9dSGabor Juhos #define AR71XX_REV_ID_MINOR_AR7141 0x1 869d4a67d9dSGabor Juhos #define AR71XX_REV_ID_MINOR_AR7161 0x2 870d4a67d9dSGabor Juhos #define AR71XX_REV_ID_REVISION_MASK 0x3 871d4a67d9dSGabor Juhos #define AR71XX_REV_ID_REVISION_SHIFT 2 872d4a67d9dSGabor Juhos 873d4a67d9dSGabor Juhos #define AR913X_REV_ID_MINOR_MASK 0x3 874d4a67d9dSGabor Juhos #define AR913X_REV_ID_MINOR_AR9130 0x0 875d4a67d9dSGabor Juhos #define AR913X_REV_ID_MINOR_AR9132 0x1 876d4a67d9dSGabor Juhos #define AR913X_REV_ID_REVISION_MASK 0x3 877d4a67d9dSGabor Juhos #define AR913X_REV_ID_REVISION_SHIFT 2 878d4a67d9dSGabor Juhos 8796d1c8fdeSGabor Juhos #define AR933X_REV_ID_REVISION_MASK 0x3 8806d1c8fdeSGabor Juhos 881d4a67d9dSGabor Juhos #define AR724X_REV_ID_REVISION_MASK 0x3 882d4a67d9dSGabor Juhos 883d8411466SGabor Juhos #define AR934X_REV_ID_REVISION_MASK 0xf 884d8411466SGabor Juhos 885a95f4b1cSGabor Juhos #define QCA953X_REV_ID_REVISION_MASK 0xf 886a95f4b1cSGabor Juhos 8872e6c91e3SGabor Juhos #define QCA955X_REV_ID_REVISION_MASK 0xf 8882e6c91e3SGabor Juhos 889a95f4b1cSGabor Juhos #define QCA956X_REV_ID_REVISION_MASK 0xf 890a95f4b1cSGabor Juhos 891d4a67d9dSGabor Juhos /* 892d4a67d9dSGabor Juhos * SPI block 893d4a67d9dSGabor Juhos */ 894d4a67d9dSGabor Juhos #define AR71XX_SPI_REG_FS 0x00 /* Function Select */ 895d4a67d9dSGabor Juhos #define AR71XX_SPI_REG_CTRL 0x04 /* SPI Control */ 896d4a67d9dSGabor Juhos #define AR71XX_SPI_REG_IOC 0x08 /* SPI I/O Control */ 897d4a67d9dSGabor Juhos #define AR71XX_SPI_REG_RDS 0x0c /* Read Data Shift */ 898d4a67d9dSGabor Juhos 899d4a67d9dSGabor Juhos #define AR71XX_SPI_FS_GPIO BIT(0) /* Enable GPIO mode */ 900d4a67d9dSGabor Juhos 901d4a67d9dSGabor Juhos #define AR71XX_SPI_CTRL_RD BIT(6) /* Remap Disable */ 902d4a67d9dSGabor Juhos #define AR71XX_SPI_CTRL_DIV_MASK 0x3f 903d4a67d9dSGabor Juhos 904d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_DO BIT(0) /* Data Out pin */ 905d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CLK BIT(8) /* CLK pin */ 906d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS(n) BIT(16 + (n)) 907d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS0 AR71XX_SPI_IOC_CS(0) 908d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS1 AR71XX_SPI_IOC_CS(1) 909d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS2 AR71XX_SPI_IOC_CS(2) 910d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS_ALL (AR71XX_SPI_IOC_CS0 | AR71XX_SPI_IOC_CS1 | \ 911d4a67d9dSGabor Juhos AR71XX_SPI_IOC_CS2) 912d4a67d9dSGabor Juhos 9136eae43c5SGabor Juhos /* 9146eae43c5SGabor Juhos * GPIO block 9156eae43c5SGabor Juhos */ 9166eae43c5SGabor Juhos #define AR71XX_GPIO_REG_OE 0x00 9176eae43c5SGabor Juhos #define AR71XX_GPIO_REG_IN 0x04 9186eae43c5SGabor Juhos #define AR71XX_GPIO_REG_OUT 0x08 9196eae43c5SGabor Juhos #define AR71XX_GPIO_REG_SET 0x0c 9206eae43c5SGabor Juhos #define AR71XX_GPIO_REG_CLEAR 0x10 9216eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_MODE 0x14 9226eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_TYPE 0x18 9236eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_POLARITY 0x1c 9246eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_PENDING 0x20 9256eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_ENABLE 0x24 9266eae43c5SGabor Juhos #define AR71XX_GPIO_REG_FUNC 0x28 9276eae43c5SGabor Juhos 928a95f4b1cSGabor Juhos #define AR934X_GPIO_REG_OUT_FUNC0 0x2c 929a95f4b1cSGabor Juhos #define AR934X_GPIO_REG_OUT_FUNC1 0x30 930a95f4b1cSGabor Juhos #define AR934X_GPIO_REG_OUT_FUNC2 0x34 931a95f4b1cSGabor Juhos #define AR934X_GPIO_REG_OUT_FUNC3 0x38 932a95f4b1cSGabor Juhos #define AR934X_GPIO_REG_OUT_FUNC4 0x3c 933a95f4b1cSGabor Juhos #define AR934X_GPIO_REG_OUT_FUNC5 0x40 9348838becdSGabor Juhos #define AR934X_GPIO_REG_FUNC 0x6c 9358838becdSGabor Juhos 936a95f4b1cSGabor Juhos #define QCA953X_GPIO_REG_OUT_FUNC0 0x2c 937a95f4b1cSGabor Juhos #define QCA953X_GPIO_REG_OUT_FUNC1 0x30 938a95f4b1cSGabor Juhos #define QCA953X_GPIO_REG_OUT_FUNC2 0x34 939a95f4b1cSGabor Juhos #define QCA953X_GPIO_REG_OUT_FUNC3 0x38 940a95f4b1cSGabor Juhos #define QCA953X_GPIO_REG_OUT_FUNC4 0x3c 941a95f4b1cSGabor Juhos #define QCA953X_GPIO_REG_IN_ENABLE0 0x44 942a95f4b1cSGabor Juhos #define QCA953X_GPIO_REG_FUNC 0x6c 943a95f4b1cSGabor Juhos 944a95f4b1cSGabor Juhos #define QCA953X_GPIO_OUT_MUX_SPI_CS1 10 945a95f4b1cSGabor Juhos #define QCA953X_GPIO_OUT_MUX_SPI_CS2 11 946a95f4b1cSGabor Juhos #define QCA953X_GPIO_OUT_MUX_SPI_CS0 9 947a95f4b1cSGabor Juhos #define QCA953X_GPIO_OUT_MUX_SPI_CLK 8 948a95f4b1cSGabor Juhos #define QCA953X_GPIO_OUT_MUX_SPI_MOSI 12 949a95f4b1cSGabor Juhos #define QCA953X_GPIO_OUT_MUX_LED_LINK1 41 950a95f4b1cSGabor Juhos #define QCA953X_GPIO_OUT_MUX_LED_LINK2 42 951a95f4b1cSGabor Juhos #define QCA953X_GPIO_OUT_MUX_LED_LINK3 43 952a95f4b1cSGabor Juhos #define QCA953X_GPIO_OUT_MUX_LED_LINK4 44 953a95f4b1cSGabor Juhos #define QCA953X_GPIO_OUT_MUX_LED_LINK5 45 954a95f4b1cSGabor Juhos 955a95f4b1cSGabor Juhos #define QCA955X_GPIO_REG_OUT_FUNC0 0x2c 956a95f4b1cSGabor Juhos #define QCA955X_GPIO_REG_OUT_FUNC1 0x30 957a95f4b1cSGabor Juhos #define QCA955X_GPIO_REG_OUT_FUNC2 0x34 958a95f4b1cSGabor Juhos #define QCA955X_GPIO_REG_OUT_FUNC3 0x38 959a95f4b1cSGabor Juhos #define QCA955X_GPIO_REG_OUT_FUNC4 0x3c 960a95f4b1cSGabor Juhos #define QCA955X_GPIO_REG_OUT_FUNC5 0x40 961a95f4b1cSGabor Juhos #define QCA955X_GPIO_REG_FUNC 0x6c 962a95f4b1cSGabor Juhos 963a95f4b1cSGabor Juhos #define QCA956X_GPIO_REG_OUT_FUNC0 0x2c 964a95f4b1cSGabor Juhos #define QCA956X_GPIO_REG_OUT_FUNC1 0x30 965a95f4b1cSGabor Juhos #define QCA956X_GPIO_REG_OUT_FUNC2 0x34 966a95f4b1cSGabor Juhos #define QCA956X_GPIO_REG_OUT_FUNC3 0x38 967a95f4b1cSGabor Juhos #define QCA956X_GPIO_REG_OUT_FUNC4 0x3c 968a95f4b1cSGabor Juhos #define QCA956X_GPIO_REG_OUT_FUNC5 0x40 969a95f4b1cSGabor Juhos #define QCA956X_GPIO_REG_IN_ENABLE0 0x44 970a95f4b1cSGabor Juhos #define QCA956X_GPIO_REG_IN_ENABLE3 0x50 971a95f4b1cSGabor Juhos #define QCA956X_GPIO_REG_FUNC 0x6c 972a95f4b1cSGabor Juhos 973a95f4b1cSGabor Juhos #define QCA956X_GPIO_OUT_MUX_GE0_MDO 32 974a95f4b1cSGabor Juhos #define QCA956X_GPIO_OUT_MUX_GE0_MDC 33 975a95f4b1cSGabor Juhos 9766eae43c5SGabor Juhos #define AR71XX_GPIO_COUNT 16 977b4da14abSGabor Juhos #define AR7240_GPIO_COUNT 18 978b4da14abSGabor Juhos #define AR7241_GPIO_COUNT 20 9796eae43c5SGabor Juhos #define AR913X_GPIO_COUNT 22 980fdfbcf47SGabor Juhos #define AR933X_GPIO_COUNT 30 9815b5b544eSGabor Juhos #define AR934X_GPIO_COUNT 23 982a95f4b1cSGabor Juhos #define QCA953X_GPIO_COUNT 18 983f818ca3eSGabor Juhos #define QCA955X_GPIO_COUNT 24 984a95f4b1cSGabor Juhos #define QCA956X_GPIO_COUNT 23 9856eae43c5SGabor Juhos 98697541ccfSGabor Juhos /* 98797541ccfSGabor Juhos * SRIF block 98897541ccfSGabor Juhos */ 98997541ccfSGabor Juhos #define AR934X_SRIF_CPU_DPLL1_REG 0x1c0 99097541ccfSGabor Juhos #define AR934X_SRIF_CPU_DPLL2_REG 0x1c4 99197541ccfSGabor Juhos #define AR934X_SRIF_CPU_DPLL3_REG 0x1c8 99297541ccfSGabor Juhos 99397541ccfSGabor Juhos #define AR934X_SRIF_DDR_DPLL1_REG 0x240 99497541ccfSGabor Juhos #define AR934X_SRIF_DDR_DPLL2_REG 0x244 99597541ccfSGabor Juhos #define AR934X_SRIF_DDR_DPLL3_REG 0x248 99697541ccfSGabor Juhos 99797541ccfSGabor Juhos #define AR934X_SRIF_DPLL1_REFDIV_SHIFT 27 99897541ccfSGabor Juhos #define AR934X_SRIF_DPLL1_REFDIV_MASK 0x1f 99997541ccfSGabor Juhos #define AR934X_SRIF_DPLL1_NINT_SHIFT 18 100097541ccfSGabor Juhos #define AR934X_SRIF_DPLL1_NINT_MASK 0x1ff 100197541ccfSGabor Juhos #define AR934X_SRIF_DPLL1_NFRAC_MASK 0x0003ffff 100297541ccfSGabor Juhos 100397541ccfSGabor Juhos #define AR934X_SRIF_DPLL2_LOCAL_PLL BIT(30) 100497541ccfSGabor Juhos #define AR934X_SRIF_DPLL2_OUTDIV_SHIFT 13 100597541ccfSGabor Juhos #define AR934X_SRIF_DPLL2_OUTDIV_MASK 0x7 100697541ccfSGabor Juhos 1007a95f4b1cSGabor Juhos #define QCA953X_SRIF_CPU_DPLL1_REG 0x1c0 1008a95f4b1cSGabor Juhos #define QCA953X_SRIF_CPU_DPLL2_REG 0x1c4 1009a95f4b1cSGabor Juhos #define QCA953X_SRIF_CPU_DPLL3_REG 0x1c8 1010a95f4b1cSGabor Juhos 1011a95f4b1cSGabor Juhos #define QCA953X_SRIF_DDR_DPLL1_REG 0x240 1012a95f4b1cSGabor Juhos #define QCA953X_SRIF_DDR_DPLL2_REG 0x244 1013a95f4b1cSGabor Juhos #define QCA953X_SRIF_DDR_DPLL3_REG 0x248 1014a95f4b1cSGabor Juhos 1015a95f4b1cSGabor Juhos #define QCA953X_SRIF_DPLL1_REFDIV_SHIFT 27 1016a95f4b1cSGabor Juhos #define QCA953X_SRIF_DPLL1_REFDIV_MASK 0x1f 1017a95f4b1cSGabor Juhos #define QCA953X_SRIF_DPLL1_NINT_SHIFT 18 1018a95f4b1cSGabor Juhos #define QCA953X_SRIF_DPLL1_NINT_MASK 0x1ff 1019a95f4b1cSGabor Juhos #define QCA953X_SRIF_DPLL1_NFRAC_MASK 0x0003ffff 1020a95f4b1cSGabor Juhos 1021a95f4b1cSGabor Juhos #define QCA953X_SRIF_DPLL2_LOCAL_PLL BIT(30) 1022a95f4b1cSGabor Juhos #define QCA953X_SRIF_DPLL2_OUTDIV_SHIFT 13 1023a95f4b1cSGabor Juhos #define QCA953X_SRIF_DPLL2_OUTDIV_MASK 0x7 1024a95f4b1cSGabor Juhos 1025a95f4b1cSGabor Juhos #define AR71XX_GPIO_FUNC_STEREO_EN BIT(17) 1026a95f4b1cSGabor Juhos #define AR71XX_GPIO_FUNC_SLIC_EN BIT(16) 1027a95f4b1cSGabor Juhos #define AR71XX_GPIO_FUNC_SPI_CS2_EN BIT(13) 1028a95f4b1cSGabor Juhos #define AR71XX_GPIO_FUNC_SPI_CS1_EN BIT(12) 1029a95f4b1cSGabor Juhos #define AR71XX_GPIO_FUNC_UART_EN BIT(8) 1030a95f4b1cSGabor Juhos #define AR71XX_GPIO_FUNC_USB_OC_EN BIT(4) 1031a95f4b1cSGabor Juhos #define AR71XX_GPIO_FUNC_USB_CLK_EN BIT(0) 1032a95f4b1cSGabor Juhos 1033a95f4b1cSGabor Juhos #define AR724X_GPIO_FUNC_GE0_MII_CLK_EN BIT(19) 1034a95f4b1cSGabor Juhos #define AR724X_GPIO_FUNC_SPI_EN BIT(18) 1035a95f4b1cSGabor Juhos #define AR724X_GPIO_FUNC_SPI_CS_EN2 BIT(14) 1036a95f4b1cSGabor Juhos #define AR724X_GPIO_FUNC_SPI_CS_EN1 BIT(13) 1037a95f4b1cSGabor Juhos #define AR724X_GPIO_FUNC_CLK_OBS5_EN BIT(12) 1038a95f4b1cSGabor Juhos #define AR724X_GPIO_FUNC_CLK_OBS4_EN BIT(11) 1039a95f4b1cSGabor Juhos #define AR724X_GPIO_FUNC_CLK_OBS3_EN BIT(10) 1040a95f4b1cSGabor Juhos #define AR724X_GPIO_FUNC_CLK_OBS2_EN BIT(9) 1041a95f4b1cSGabor Juhos #define AR724X_GPIO_FUNC_CLK_OBS1_EN BIT(8) 1042a95f4b1cSGabor Juhos #define AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN BIT(7) 1043a95f4b1cSGabor Juhos #define AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN BIT(6) 1044a95f4b1cSGabor Juhos #define AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN BIT(5) 1045a95f4b1cSGabor Juhos #define AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN BIT(4) 1046a95f4b1cSGabor Juhos #define AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN BIT(3) 1047a95f4b1cSGabor Juhos #define AR724X_GPIO_FUNC_UART_RTS_CTS_EN BIT(2) 1048a95f4b1cSGabor Juhos #define AR724X_GPIO_FUNC_UART_EN BIT(1) 1049a95f4b1cSGabor Juhos #define AR724X_GPIO_FUNC_JTAG_DISABLE BIT(0) 1050a95f4b1cSGabor Juhos 1051a95f4b1cSGabor Juhos #define AR913X_GPIO_FUNC_WMAC_LED_EN BIT(22) 1052a95f4b1cSGabor Juhos #define AR913X_GPIO_FUNC_EXP_PORT_CS_EN BIT(21) 1053a95f4b1cSGabor Juhos #define AR913X_GPIO_FUNC_I2S_REFCLKEN BIT(20) 1054a95f4b1cSGabor Juhos #define AR913X_GPIO_FUNC_I2S_MCKEN BIT(19) 1055a95f4b1cSGabor Juhos #define AR913X_GPIO_FUNC_I2S1_EN BIT(18) 1056a95f4b1cSGabor Juhos #define AR913X_GPIO_FUNC_I2S0_EN BIT(17) 1057a95f4b1cSGabor Juhos #define AR913X_GPIO_FUNC_SLIC_EN BIT(16) 1058a95f4b1cSGabor Juhos #define AR913X_GPIO_FUNC_UART_RTSCTS_EN BIT(9) 1059a95f4b1cSGabor Juhos #define AR913X_GPIO_FUNC_UART_EN BIT(8) 1060a95f4b1cSGabor Juhos #define AR913X_GPIO_FUNC_USB_CLK_EN BIT(4) 1061a95f4b1cSGabor Juhos 1062a95f4b1cSGabor Juhos #define AR933X_GPIO_FUNC_SPDIF2TCK BIT(31) 1063a95f4b1cSGabor Juhos #define AR933X_GPIO_FUNC_SPDIF_EN BIT(30) 1064a95f4b1cSGabor Juhos #define AR933X_GPIO_FUNC_I2SO_22_18_EN BIT(29) 1065a95f4b1cSGabor Juhos #define AR933X_GPIO_FUNC_I2S_MCK_EN BIT(27) 1066a95f4b1cSGabor Juhos #define AR933X_GPIO_FUNC_I2SO_EN BIT(26) 1067a95f4b1cSGabor Juhos #define AR933X_GPIO_FUNC_ETH_SWITCH_LED_DUPL BIT(25) 1068a95f4b1cSGabor Juhos #define AR933X_GPIO_FUNC_ETH_SWITCH_LED_COLL BIT(24) 1069a95f4b1cSGabor Juhos #define AR933X_GPIO_FUNC_ETH_SWITCH_LED_ACT BIT(23) 1070a95f4b1cSGabor Juhos #define AR933X_GPIO_FUNC_SPI_EN BIT(18) 1071a95f4b1cSGabor Juhos #define AR933X_GPIO_FUNC_SPI_CS_EN2 BIT(14) 1072a95f4b1cSGabor Juhos #define AR933X_GPIO_FUNC_SPI_CS_EN1 BIT(13) 1073a95f4b1cSGabor Juhos #define AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN BIT(7) 1074a95f4b1cSGabor Juhos #define AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN BIT(6) 1075a95f4b1cSGabor Juhos #define AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN BIT(5) 1076a95f4b1cSGabor Juhos #define AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN BIT(4) 1077a95f4b1cSGabor Juhos #define AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN BIT(3) 1078a95f4b1cSGabor Juhos #define AR933X_GPIO_FUNC_UART_RTS_CTS_EN BIT(2) 1079a95f4b1cSGabor Juhos #define AR933X_GPIO_FUNC_UART_EN BIT(1) 1080a95f4b1cSGabor Juhos #define AR933X_GPIO_FUNC_JTAG_DISABLE BIT(0) 1081a95f4b1cSGabor Juhos 1082a95f4b1cSGabor Juhos #define AR934X_GPIO_FUNC_CLK_OBS7_EN BIT(9) 1083a95f4b1cSGabor Juhos #define AR934X_GPIO_FUNC_CLK_OBS6_EN BIT(8) 1084a95f4b1cSGabor Juhos #define AR934X_GPIO_FUNC_CLK_OBS5_EN BIT(7) 1085a95f4b1cSGabor Juhos #define AR934X_GPIO_FUNC_CLK_OBS4_EN BIT(6) 1086a95f4b1cSGabor Juhos #define AR934X_GPIO_FUNC_CLK_OBS3_EN BIT(5) 1087a95f4b1cSGabor Juhos #define AR934X_GPIO_FUNC_CLK_OBS2_EN BIT(4) 1088a95f4b1cSGabor Juhos #define AR934X_GPIO_FUNC_CLK_OBS1_EN BIT(3) 1089a95f4b1cSGabor Juhos #define AR934X_GPIO_FUNC_CLK_OBS0_EN BIT(2) 1090a95f4b1cSGabor Juhos #define AR934X_GPIO_FUNC_JTAG_DISABLE BIT(1) 1091a95f4b1cSGabor Juhos 1092a95f4b1cSGabor Juhos #define AR934X_GPIO_OUT_GPIO 0 1093a95f4b1cSGabor Juhos #define AR934X_GPIO_OUT_SPI_CS1 7 1094a95f4b1cSGabor Juhos #define AR934X_GPIO_OUT_LED_LINK0 41 1095a95f4b1cSGabor Juhos #define AR934X_GPIO_OUT_LED_LINK1 42 1096a95f4b1cSGabor Juhos #define AR934X_GPIO_OUT_LED_LINK2 43 1097a95f4b1cSGabor Juhos #define AR934X_GPIO_OUT_LED_LINK3 44 1098a95f4b1cSGabor Juhos #define AR934X_GPIO_OUT_LED_LINK4 45 1099a95f4b1cSGabor Juhos #define AR934X_GPIO_OUT_EXT_LNA0 46 1100a95f4b1cSGabor Juhos #define AR934X_GPIO_OUT_EXT_LNA1 47 1101a95f4b1cSGabor Juhos 1102a95f4b1cSGabor Juhos #define QCA955X_GPIO_FUNC_CLK_OBS7_EN BIT(9) 1103a95f4b1cSGabor Juhos #define QCA955X_GPIO_FUNC_CLK_OBS6_EN BIT(8) 1104a95f4b1cSGabor Juhos #define QCA955X_GPIO_FUNC_CLK_OBS5_EN BIT(7) 1105a95f4b1cSGabor Juhos #define QCA955X_GPIO_FUNC_CLK_OBS4_EN BIT(6) 1106a95f4b1cSGabor Juhos #define QCA955X_GPIO_FUNC_CLK_OBS3_EN BIT(5) 1107a95f4b1cSGabor Juhos #define QCA955X_GPIO_FUNC_CLK_OBS2_EN BIT(4) 1108a95f4b1cSGabor Juhos #define QCA955X_GPIO_FUNC_CLK_OBS1_EN BIT(3) 1109a95f4b1cSGabor Juhos #define QCA955X_GPIO_FUNC_JTAG_DISABLE BIT(1) 1110a95f4b1cSGabor Juhos 1111a95f4b1cSGabor Juhos #define QCA955X_GPIO_OUT_GPIO 0 1112a95f4b1cSGabor Juhos #define QCA955X_MII_EXT_MDI 1 1113a95f4b1cSGabor Juhos #define QCA955X_SLIC_DATA_OUT 3 1114a95f4b1cSGabor Juhos #define QCA955X_SLIC_PCM_FS 4 1115a95f4b1cSGabor Juhos #define QCA955X_SLIC_PCM_CLK 5 1116a95f4b1cSGabor Juhos #define QCA955X_SPI_CLK 8 1117a95f4b1cSGabor Juhos #define QCA955X_SPI_CS_0 9 1118a95f4b1cSGabor Juhos #define QCA955X_SPI_CS_1 10 1119a95f4b1cSGabor Juhos #define QCA955X_SPI_CS_2 11 1120a95f4b1cSGabor Juhos #define QCA955X_SPI_MISO 12 1121a95f4b1cSGabor Juhos #define QCA955X_I2S_CLK 13 1122a95f4b1cSGabor Juhos #define QCA955X_I2S_WS 14 1123a95f4b1cSGabor Juhos #define QCA955X_I2S_SD 15 1124a95f4b1cSGabor Juhos #define QCA955X_I2S_MCK 16 1125a95f4b1cSGabor Juhos #define QCA955X_SPDIF_OUT 17 1126a95f4b1cSGabor Juhos #define QCA955X_UART1_TD 18 1127a95f4b1cSGabor Juhos #define QCA955X_UART1_RTS 19 1128a95f4b1cSGabor Juhos #define QCA955X_UART1_RD 20 1129a95f4b1cSGabor Juhos #define QCA955X_UART1_CTS 21 1130a95f4b1cSGabor Juhos #define QCA955X_UART0_SOUT 22 1131a95f4b1cSGabor Juhos #define QCA955X_SPDIF2_OUT 23 1132a95f4b1cSGabor Juhos #define QCA955X_LED_SGMII_SPEED0 24 1133a95f4b1cSGabor Juhos #define QCA955X_LED_SGMII_SPEED1 25 1134a95f4b1cSGabor Juhos #define QCA955X_LED_SGMII_DUPLEX 26 1135a95f4b1cSGabor Juhos #define QCA955X_LED_SGMII_LINK_UP 27 1136a95f4b1cSGabor Juhos #define QCA955X_SGMII_SPEED0_INVERT 28 1137a95f4b1cSGabor Juhos #define QCA955X_SGMII_SPEED1_INVERT 29 1138a95f4b1cSGabor Juhos #define QCA955X_SGMII_DUPLEX_INVERT 30 1139a95f4b1cSGabor Juhos #define QCA955X_SGMII_LINK_UP_INVERT 31 1140a95f4b1cSGabor Juhos #define QCA955X_GE1_MII_MDO 32 1141a95f4b1cSGabor Juhos #define QCA955X_GE1_MII_MDC 33 1142a95f4b1cSGabor Juhos #define QCA955X_SWCOM2 38 1143a95f4b1cSGabor Juhos #define QCA955X_SWCOM3 39 1144a95f4b1cSGabor Juhos #define QCA955X_MAC2_GPIO 40 1145a95f4b1cSGabor Juhos #define QCA955X_MAC3_GPIO 41 1146a95f4b1cSGabor Juhos #define QCA955X_ATT_LED 42 1147a95f4b1cSGabor Juhos #define QCA955X_PWR_LED 43 1148a95f4b1cSGabor Juhos #define QCA955X_TX_FRAME 44 1149a95f4b1cSGabor Juhos #define QCA955X_RX_CLEAR_EXTERNAL 45 1150a95f4b1cSGabor Juhos #define QCA955X_LED_NETWORK_EN 46 1151a95f4b1cSGabor Juhos #define QCA955X_LED_POWER_EN 47 1152a95f4b1cSGabor Juhos #define QCA955X_WMAC_GLUE_WOW 68 1153a95f4b1cSGabor Juhos #define QCA955X_RX_CLEAR_EXTENSION 70 1154a95f4b1cSGabor Juhos #define QCA955X_CP_NAND_CS1 73 1155a95f4b1cSGabor Juhos #define QCA955X_USB_SUSPEND 74 1156a95f4b1cSGabor Juhos #define QCA955X_ETH_TX_ERR 75 1157a95f4b1cSGabor Juhos #define QCA955X_DDR_DQ_OE 76 1158a95f4b1cSGabor Juhos #define QCA955X_CLKREQ_N_EP 77 1159a95f4b1cSGabor Juhos #define QCA955X_CLKREQ_N_RC 78 1160a95f4b1cSGabor Juhos #define QCA955X_CLK_OBS0 79 1161a95f4b1cSGabor Juhos #define QCA955X_CLK_OBS1 80 1162a95f4b1cSGabor Juhos #define QCA955X_CLK_OBS2 81 1163a95f4b1cSGabor Juhos #define QCA955X_CLK_OBS3 82 1164a95f4b1cSGabor Juhos #define QCA955X_CLK_OBS4 83 1165a95f4b1cSGabor Juhos #define QCA955X_CLK_OBS5 84 1166a95f4b1cSGabor Juhos 1167a95f4b1cSGabor Juhos /* 1168a95f4b1cSGabor Juhos * MII_CTRL block 1169a95f4b1cSGabor Juhos */ 1170a95f4b1cSGabor Juhos #define AR71XX_MII_REG_MII0_CTRL 0x00 1171a95f4b1cSGabor Juhos #define AR71XX_MII_REG_MII1_CTRL 0x04 1172a95f4b1cSGabor Juhos 1173a95f4b1cSGabor Juhos #define AR71XX_MII_CTRL_IF_MASK 3 1174a95f4b1cSGabor Juhos #define AR71XX_MII_CTRL_SPEED_SHIFT 4 1175a95f4b1cSGabor Juhos #define AR71XX_MII_CTRL_SPEED_MASK 3 1176a95f4b1cSGabor Juhos #define AR71XX_MII_CTRL_SPEED_10 0 1177a95f4b1cSGabor Juhos #define AR71XX_MII_CTRL_SPEED_100 1 1178a95f4b1cSGabor Juhos #define AR71XX_MII_CTRL_SPEED_1000 2 1179a95f4b1cSGabor Juhos 1180a95f4b1cSGabor Juhos #define AR71XX_MII0_CTRL_IF_GMII 0 1181a95f4b1cSGabor Juhos #define AR71XX_MII0_CTRL_IF_MII 1 1182a95f4b1cSGabor Juhos #define AR71XX_MII0_CTRL_IF_RGMII 2 1183a95f4b1cSGabor Juhos #define AR71XX_MII0_CTRL_IF_RMII 3 1184a95f4b1cSGabor Juhos 1185a95f4b1cSGabor Juhos #define AR71XX_MII1_CTRL_IF_RGMII 0 1186a95f4b1cSGabor Juhos #define AR71XX_MII1_CTRL_IF_RMII 1 1187a95f4b1cSGabor Juhos 1188a95f4b1cSGabor Juhos /* 1189a95f4b1cSGabor Juhos * AR933X GMAC interface 1190a95f4b1cSGabor Juhos */ 1191a95f4b1cSGabor Juhos #define AR933X_GMAC_REG_ETH_CFG 0x00 1192a95f4b1cSGabor Juhos 1193a95f4b1cSGabor Juhos #define AR933X_ETH_CFG_RGMII_GE0 BIT(0) 1194a95f4b1cSGabor Juhos #define AR933X_ETH_CFG_MII_GE0 BIT(1) 1195a95f4b1cSGabor Juhos #define AR933X_ETH_CFG_GMII_GE0 BIT(2) 1196a95f4b1cSGabor Juhos #define AR933X_ETH_CFG_MII_GE0_MASTER BIT(3) 1197a95f4b1cSGabor Juhos #define AR933X_ETH_CFG_MII_GE0_SLAVE BIT(4) 1198a95f4b1cSGabor Juhos #define AR933X_ETH_CFG_MII_GE0_ERR_EN BIT(5) 1199a95f4b1cSGabor Juhos #define AR933X_ETH_CFG_SW_PHY_SWAP BIT(7) 1200a95f4b1cSGabor Juhos #define AR933X_ETH_CFG_SW_PHY_ADDR_SWAP BIT(8) 1201a95f4b1cSGabor Juhos #define AR933X_ETH_CFG_RMII_GE0 BIT(9) 1202a95f4b1cSGabor Juhos #define AR933X_ETH_CFG_RMII_GE0_SPD_10 0 1203a95f4b1cSGabor Juhos #define AR933X_ETH_CFG_RMII_GE0_SPD_100 BIT(10) 1204a95f4b1cSGabor Juhos 1205a95f4b1cSGabor Juhos /* 1206a95f4b1cSGabor Juhos * AR934X GMAC Interface 1207a95f4b1cSGabor Juhos */ 1208a95f4b1cSGabor Juhos #define AR934X_GMAC_REG_ETH_CFG 0x00 1209a95f4b1cSGabor Juhos 1210a95f4b1cSGabor Juhos #define AR934X_ETH_CFG_RGMII_GMAC0 BIT(0) 1211a95f4b1cSGabor Juhos #define AR934X_ETH_CFG_MII_GMAC0 BIT(1) 1212a95f4b1cSGabor Juhos #define AR934X_ETH_CFG_GMII_GMAC0 BIT(2) 1213a95f4b1cSGabor Juhos #define AR934X_ETH_CFG_MII_GMAC0_MASTER BIT(3) 1214a95f4b1cSGabor Juhos #define AR934X_ETH_CFG_MII_GMAC0_SLAVE BIT(4) 1215a95f4b1cSGabor Juhos #define AR934X_ETH_CFG_MII_GMAC0_ERR_EN BIT(5) 1216a95f4b1cSGabor Juhos #define AR934X_ETH_CFG_SW_ONLY_MODE BIT(6) 1217a95f4b1cSGabor Juhos #define AR934X_ETH_CFG_SW_PHY_SWAP BIT(7) 1218a95f4b1cSGabor Juhos #define AR934X_ETH_CFG_SW_APB_ACCESS BIT(9) 1219a95f4b1cSGabor Juhos #define AR934X_ETH_CFG_RMII_GMAC0 BIT(10) 1220a95f4b1cSGabor Juhos #define AR933X_ETH_CFG_MII_CNTL_SPEED BIT(11) 1221a95f4b1cSGabor Juhos #define AR934X_ETH_CFG_RMII_GMAC0_MASTER BIT(12) 1222a95f4b1cSGabor Juhos #define AR933X_ETH_CFG_SW_ACC_MSB_FIRST BIT(13) 1223a95f4b1cSGabor Juhos #define AR934X_ETH_CFG_RXD_DELAY BIT(14) 1224a95f4b1cSGabor Juhos #define AR934X_ETH_CFG_RXD_DELAY_MASK 0x3 1225a95f4b1cSGabor Juhos #define AR934X_ETH_CFG_RXD_DELAY_SHIFT 14 1226a95f4b1cSGabor Juhos #define AR934X_ETH_CFG_RDV_DELAY BIT(16) 1227a95f4b1cSGabor Juhos #define AR934X_ETH_CFG_RDV_DELAY_MASK 0x3 1228a95f4b1cSGabor Juhos #define AR934X_ETH_CFG_RDV_DELAY_SHIFT 16 1229a95f4b1cSGabor Juhos 1230a95f4b1cSGabor Juhos /* 1231a95f4b1cSGabor Juhos * QCA953X GMAC Interface 1232a95f4b1cSGabor Juhos */ 1233a95f4b1cSGabor Juhos #define QCA953X_GMAC_REG_ETH_CFG 0x00 1234a95f4b1cSGabor Juhos 1235a95f4b1cSGabor Juhos #define QCA953X_ETH_CFG_SW_ONLY_MODE BIT(6) 1236a95f4b1cSGabor Juhos #define QCA953X_ETH_CFG_SW_PHY_SWAP BIT(7) 1237a95f4b1cSGabor Juhos #define QCA953X_ETH_CFG_SW_APB_ACCESS BIT(9) 1238a95f4b1cSGabor Juhos #define QCA953X_ETH_CFG_SW_ACC_MSB_FIRST BIT(13) 1239a95f4b1cSGabor Juhos 1240a95f4b1cSGabor Juhos /* 1241a95f4b1cSGabor Juhos * QCA955X GMAC Interface 1242a95f4b1cSGabor Juhos */ 1243a95f4b1cSGabor Juhos 1244a95f4b1cSGabor Juhos #define QCA955X_GMAC_REG_ETH_CFG 0x00 1245a95f4b1cSGabor Juhos #define QCA955X_GMAC_REG_SGMII_SERDES 0x18 1246a95f4b1cSGabor Juhos 1247a95f4b1cSGabor Juhos #define QCA955X_ETH_CFG_RGMII_EN BIT(0) 1248a95f4b1cSGabor Juhos #define QCA955X_ETH_CFG_MII_GE0 BIT(1) 1249a95f4b1cSGabor Juhos #define QCA955X_ETH_CFG_GMII_GE0 BIT(2) 1250a95f4b1cSGabor Juhos #define QCA955X_ETH_CFG_MII_GE0_MASTER BIT(3) 1251a95f4b1cSGabor Juhos #define QCA955X_ETH_CFG_MII_GE0_SLAVE BIT(4) 1252a95f4b1cSGabor Juhos #define QCA955X_ETH_CFG_GE0_ERR_EN BIT(5) 1253a95f4b1cSGabor Juhos #define QCA955X_ETH_CFG_GE0_SGMII BIT(6) 1254a95f4b1cSGabor Juhos #define QCA955X_ETH_CFG_RMII_GE0 BIT(10) 1255a95f4b1cSGabor Juhos #define QCA955X_ETH_CFG_MII_CNTL_SPEED BIT(11) 1256a95f4b1cSGabor Juhos #define QCA955X_ETH_CFG_RMII_GE0_MASTER BIT(12) 1257a95f4b1cSGabor Juhos #define QCA955X_ETH_CFG_RXD_DELAY_MASK 0x3 1258a95f4b1cSGabor Juhos #define QCA955X_ETH_CFG_RXD_DELAY_SHIFT 14 1259a95f4b1cSGabor Juhos #define QCA955X_ETH_CFG_RDV_DELAY BIT(16) 1260a95f4b1cSGabor Juhos #define QCA955X_ETH_CFG_RDV_DELAY_MASK 0x3 1261a95f4b1cSGabor Juhos #define QCA955X_ETH_CFG_RDV_DELAY_SHIFT 16 1262a95f4b1cSGabor Juhos #define QCA955X_ETH_CFG_TXD_DELAY_MASK 0x3 1263a95f4b1cSGabor Juhos #define QCA955X_ETH_CFG_TXD_DELAY_SHIFT 18 1264a95f4b1cSGabor Juhos #define QCA955X_ETH_CFG_TXE_DELAY_MASK 0x3 1265a95f4b1cSGabor Juhos #define QCA955X_ETH_CFG_TXE_DELAY_SHIFT 20 1266a95f4b1cSGabor Juhos 1267a95f4b1cSGabor Juhos #define QCA955X_SGMII_SERDES_LOCK_DETECT_STATUS BIT(15) 1268a95f4b1cSGabor Juhos #define QCA955X_SGMII_SERDES_RES_CALIBRATION_SHIFT 23 1269a95f4b1cSGabor Juhos #define QCA955X_SGMII_SERDES_RES_CALIBRATION_MASK 0xf 1270a95f4b1cSGabor Juhos /* 1271a95f4b1cSGabor Juhos * QCA956X GMAC Interface 1272a95f4b1cSGabor Juhos */ 1273a95f4b1cSGabor Juhos 1274a95f4b1cSGabor Juhos #define QCA956X_GMAC_REG_ETH_CFG 0x00 1275a95f4b1cSGabor Juhos #define QCA956X_GMAC_REG_SGMII_RESET 0x14 1276a95f4b1cSGabor Juhos #define QCA956X_GMAC_REG_SGMII_SERDES 0x18 1277a95f4b1cSGabor Juhos #define QCA956X_GMAC_REG_MR_AN_CONTROL 0x1c 1278a95f4b1cSGabor Juhos #define QCA956X_GMAC_REG_SGMII_CONFIG 0x34 1279a95f4b1cSGabor Juhos #define QCA956X_GMAC_REG_SGMII_DEBUG 0x58 1280a95f4b1cSGabor Juhos 1281a95f4b1cSGabor Juhos #define QCA956X_ETH_CFG_RGMII_EN BIT(0) 1282a95f4b1cSGabor Juhos #define QCA956X_ETH_CFG_GE0_SGMII BIT(6) 1283a95f4b1cSGabor Juhos #define QCA956X_ETH_CFG_SW_ONLY_MODE BIT(7) 1284a95f4b1cSGabor Juhos #define QCA956X_ETH_CFG_SW_PHY_SWAP BIT(8) 1285a95f4b1cSGabor Juhos #define QCA956X_ETH_CFG_SW_PHY_ADDR_SWAP BIT(9) 1286a95f4b1cSGabor Juhos #define QCA956X_ETH_CFG_SW_APB_ACCESS BIT(10) 1287a95f4b1cSGabor Juhos #define QCA956X_ETH_CFG_SW_ACC_MSB_FIRST BIT(13) 1288a95f4b1cSGabor Juhos #define QCA956X_ETH_CFG_RXD_DELAY_MASK 0x3 1289a95f4b1cSGabor Juhos #define QCA956X_ETH_CFG_RXD_DELAY_SHIFT 14 1290a95f4b1cSGabor Juhos #define QCA956X_ETH_CFG_RDV_DELAY_MASK 0x3 1291a95f4b1cSGabor Juhos #define QCA956X_ETH_CFG_RDV_DELAY_SHIFT 16 1292a95f4b1cSGabor Juhos 1293a95f4b1cSGabor Juhos #define QCA956X_SGMII_RESET_RX_CLK_N_RESET 0x0 1294a95f4b1cSGabor Juhos #define QCA956X_SGMII_RESET_RX_CLK_N BIT(0) 1295a95f4b1cSGabor Juhos #define QCA956X_SGMII_RESET_TX_CLK_N BIT(1) 1296a95f4b1cSGabor Juhos #define QCA956X_SGMII_RESET_RX_125M_N BIT(2) 1297a95f4b1cSGabor Juhos #define QCA956X_SGMII_RESET_TX_125M_N BIT(3) 1298a95f4b1cSGabor Juhos #define QCA956X_SGMII_RESET_HW_RX_125M_N BIT(4) 1299a95f4b1cSGabor Juhos 1300a95f4b1cSGabor Juhos #define QCA956X_SGMII_SERDES_CDR_BW_MASK 0x3 1301a95f4b1cSGabor Juhos #define QCA956X_SGMII_SERDES_CDR_BW_SHIFT 1 1302a95f4b1cSGabor Juhos #define QCA956X_SGMII_SERDES_TX_DR_CTRL_MASK 0x7 1303a95f4b1cSGabor Juhos #define QCA956X_SGMII_SERDES_TX_DR_CTRL_SHIFT 4 1304a95f4b1cSGabor Juhos #define QCA956X_SGMII_SERDES_PLL_BW BIT(8) 1305a95f4b1cSGabor Juhos #define QCA956X_SGMII_SERDES_VCO_FAST BIT(9) 1306a95f4b1cSGabor Juhos #define QCA956X_SGMII_SERDES_VCO_SLOW BIT(10) 1307a95f4b1cSGabor Juhos #define QCA956X_SGMII_SERDES_LOCK_DETECT_STATUS BIT(15) 1308a95f4b1cSGabor Juhos #define QCA956X_SGMII_SERDES_EN_SIGNAL_DETECT BIT(16) 1309a95f4b1cSGabor Juhos #define QCA956X_SGMII_SERDES_FIBER_SDO BIT(17) 1310a95f4b1cSGabor Juhos #define QCA956X_SGMII_SERDES_RES_CALIBRATION_SHIFT 23 1311a95f4b1cSGabor Juhos #define QCA956X_SGMII_SERDES_RES_CALIBRATION_MASK 0xf 1312a95f4b1cSGabor Juhos #define QCA956X_SGMII_SERDES_VCO_REG_SHIFT 27 1313a95f4b1cSGabor Juhos #define QCA956X_SGMII_SERDES_VCO_REG_MASK 0xf 1314a95f4b1cSGabor Juhos 1315a95f4b1cSGabor Juhos #define QCA956X_MR_AN_CONTROL_AN_ENABLE BIT(12) 1316a95f4b1cSGabor Juhos #define QCA956X_MR_AN_CONTROL_PHY_RESET BIT(15) 1317a95f4b1cSGabor Juhos 1318a95f4b1cSGabor Juhos #define QCA956X_SGMII_CONFIG_MODE_CTRL_SHIFT 0 1319a95f4b1cSGabor Juhos #define QCA956X_SGMII_CONFIG_MODE_CTRL_MASK 0x7 1320a95f4b1cSGabor Juhos 1321d4a67d9dSGabor Juhos #endif /* __ASM_MACH_AR71XX_REGS_H */ 1322