1d4a67d9dSGabor Juhos /* 2d4a67d9dSGabor Juhos * Atheros AR71XX/AR724X/AR913X SoC register definitions 3d4a67d9dSGabor Juhos * 4703327ddSGabor Juhos * Copyright (C) 2010-2011 Jaiganesh Narayanan <jnarayanan@atheros.com> 5d4a67d9dSGabor Juhos * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org> 6d4a67d9dSGabor Juhos * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> 7d4a67d9dSGabor Juhos * 8703327ddSGabor Juhos * Parts of this file are based on Atheros' 2.6.15/2.6.31 BSP 9d4a67d9dSGabor Juhos * 10d4a67d9dSGabor Juhos * This program is free software; you can redistribute it and/or modify it 11d4a67d9dSGabor Juhos * under the terms of the GNU General Public License version 2 as published 12d4a67d9dSGabor Juhos * by the Free Software Foundation. 13d4a67d9dSGabor Juhos */ 14d4a67d9dSGabor Juhos 15d4a67d9dSGabor Juhos #ifndef __ASM_MACH_AR71XX_REGS_H 16d4a67d9dSGabor Juhos #define __ASM_MACH_AR71XX_REGS_H 17d4a67d9dSGabor Juhos 18d4a67d9dSGabor Juhos #include <linux/types.h> 19d4a67d9dSGabor Juhos #include <linux/io.h> 20d4a67d9dSGabor Juhos #include <linux/bitops.h> 21d4a67d9dSGabor Juhos 22d4a67d9dSGabor Juhos #define AR71XX_APB_BASE 0x18000000 237e98aa46SGabor Juhos #define AR71XX_EHCI_BASE 0x1b000000 247e98aa46SGabor Juhos #define AR71XX_EHCI_SIZE 0x1000 257e98aa46SGabor Juhos #define AR71XX_OHCI_BASE 0x1c000000 267e98aa46SGabor Juhos #define AR71XX_OHCI_SIZE 0x1000 2768a1d316SGabor Juhos #define AR71XX_SPI_BASE 0x1f000000 2868a1d316SGabor Juhos #define AR71XX_SPI_SIZE 0x01000000 29d4a67d9dSGabor Juhos 30d4a67d9dSGabor Juhos #define AR71XX_DDR_CTRL_BASE (AR71XX_APB_BASE + 0x00000000) 31d4a67d9dSGabor Juhos #define AR71XX_DDR_CTRL_SIZE 0x100 32d4a67d9dSGabor Juhos #define AR71XX_UART_BASE (AR71XX_APB_BASE + 0x00020000) 33d4a67d9dSGabor Juhos #define AR71XX_UART_SIZE 0x100 347e98aa46SGabor Juhos #define AR71XX_USB_CTRL_BASE (AR71XX_APB_BASE + 0x00030000) 357e98aa46SGabor Juhos #define AR71XX_USB_CTRL_SIZE 0x100 366eae43c5SGabor Juhos #define AR71XX_GPIO_BASE (AR71XX_APB_BASE + 0x00040000) 376eae43c5SGabor Juhos #define AR71XX_GPIO_SIZE 0x100 38d4a67d9dSGabor Juhos #define AR71XX_PLL_BASE (AR71XX_APB_BASE + 0x00050000) 39d4a67d9dSGabor Juhos #define AR71XX_PLL_SIZE 0x100 40d4a67d9dSGabor Juhos #define AR71XX_RESET_BASE (AR71XX_APB_BASE + 0x00060000) 41d4a67d9dSGabor Juhos #define AR71XX_RESET_SIZE 0x100 42d4a67d9dSGabor Juhos 43ad4ce92eSGabor Juhos #define AR71XX_PCI_MEM_BASE 0x10000000 44ad4ce92eSGabor Juhos #define AR71XX_PCI_MEM_SIZE 0x07000000 45ad4ce92eSGabor Juhos 46ad4ce92eSGabor Juhos #define AR71XX_PCI_WIN0_OFFS 0x10000000 47ad4ce92eSGabor Juhos #define AR71XX_PCI_WIN1_OFFS 0x11000000 48ad4ce92eSGabor Juhos #define AR71XX_PCI_WIN2_OFFS 0x12000000 49ad4ce92eSGabor Juhos #define AR71XX_PCI_WIN3_OFFS 0x13000000 50ad4ce92eSGabor Juhos #define AR71XX_PCI_WIN4_OFFS 0x14000000 51ad4ce92eSGabor Juhos #define AR71XX_PCI_WIN5_OFFS 0x15000000 52ad4ce92eSGabor Juhos #define AR71XX_PCI_WIN6_OFFS 0x16000000 53ad4ce92eSGabor Juhos #define AR71XX_PCI_WIN7_OFFS 0x07000000 54ad4ce92eSGabor Juhos 55ad4ce92eSGabor Juhos #define AR71XX_PCI_CFG_BASE \ 56ad4ce92eSGabor Juhos (AR71XX_PCI_MEM_BASE + AR71XX_PCI_WIN7_OFFS + 0x10000) 57ad4ce92eSGabor Juhos #define AR71XX_PCI_CFG_SIZE 0x100 58ad4ce92eSGabor Juhos 597e98aa46SGabor Juhos #define AR7240_USB_CTRL_BASE (AR71XX_APB_BASE + 0x00030000) 607e98aa46SGabor Juhos #define AR7240_USB_CTRL_SIZE 0x100 617e98aa46SGabor Juhos #define AR7240_OHCI_BASE 0x1b000000 627e98aa46SGabor Juhos #define AR7240_OHCI_SIZE 0x1000 637e98aa46SGabor Juhos 64ad4ce92eSGabor Juhos #define AR724X_PCI_MEM_BASE 0x10000000 65ad4ce92eSGabor Juhos #define AR724X_PCI_MEM_SIZE 0x04000000 66ad4ce92eSGabor Juhos 67ad4ce92eSGabor Juhos #define AR724X_PCI_CFG_BASE 0x14000000 68ad4ce92eSGabor Juhos #define AR724X_PCI_CFG_SIZE 0x1000 6912401fc2SGabor Juhos #define AR724X_PCI_CRP_BASE (AR71XX_APB_BASE + 0x000c0000) 7012401fc2SGabor Juhos #define AR724X_PCI_CRP_SIZE 0x1000 71ad4ce92eSGabor Juhos #define AR724X_PCI_CTRL_BASE (AR71XX_APB_BASE + 0x000f0000) 72ad4ce92eSGabor Juhos #define AR724X_PCI_CTRL_SIZE 0x100 73ad4ce92eSGabor Juhos 747e98aa46SGabor Juhos #define AR724X_EHCI_BASE 0x1b000000 757e98aa46SGabor Juhos #define AR724X_EHCI_SIZE 0x1000 767e98aa46SGabor Juhos 777e98aa46SGabor Juhos #define AR913X_EHCI_BASE 0x1b000000 787e98aa46SGabor Juhos #define AR913X_EHCI_SIZE 0x1000 79f5b35d0bSGabor Juhos #define AR913X_WMAC_BASE (AR71XX_APB_BASE + 0x000C0000) 80f5b35d0bSGabor Juhos #define AR913X_WMAC_SIZE 0x30000 81f5b35d0bSGabor Juhos 820bd3acdfSGabor Juhos #define AR933X_UART_BASE (AR71XX_APB_BASE + 0x00020000) 830bd3acdfSGabor Juhos #define AR933X_UART_SIZE 0x14 8434cfcd26SGabor Juhos #define AR933X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000) 8534cfcd26SGabor Juhos #define AR933X_WMAC_SIZE 0x20000 86c279b775SGabor Juhos #define AR933X_EHCI_BASE 0x1b000000 87c279b775SGabor Juhos #define AR933X_EHCI_SIZE 0x1000 88c279b775SGabor Juhos 89574d6e70SGabor Juhos #define AR934X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000) 90574d6e70SGabor Juhos #define AR934X_WMAC_SIZE 0x20000 9100ffed58SGabor Juhos #define AR934X_EHCI_BASE 0x1b000000 9200ffed58SGabor Juhos #define AR934X_EHCI_SIZE 0x200 9397541ccfSGabor Juhos #define AR934X_SRIF_BASE (AR71XX_APB_BASE + 0x00116000) 9497541ccfSGabor Juhos #define AR934X_SRIF_SIZE 0x1000 95574d6e70SGabor Juhos 960a5f3b1cSGabor Juhos #define QCA955X_PCI_MEM_BASE0 0x10000000 970a5f3b1cSGabor Juhos #define QCA955X_PCI_MEM_BASE1 0x12000000 980a5f3b1cSGabor Juhos #define QCA955X_PCI_MEM_SIZE 0x02000000 990a5f3b1cSGabor Juhos #define QCA955X_PCI_CFG_BASE0 0x14000000 1000a5f3b1cSGabor Juhos #define QCA955X_PCI_CFG_BASE1 0x16000000 1010a5f3b1cSGabor Juhos #define QCA955X_PCI_CFG_SIZE 0x1000 1020a5f3b1cSGabor Juhos #define QCA955X_PCI_CRP_BASE0 (AR71XX_APB_BASE + 0x000c0000) 1030a5f3b1cSGabor Juhos #define QCA955X_PCI_CRP_BASE1 (AR71XX_APB_BASE + 0x00250000) 1040a5f3b1cSGabor Juhos #define QCA955X_PCI_CRP_SIZE 0x1000 1050a5f3b1cSGabor Juhos #define QCA955X_PCI_CTRL_BASE0 (AR71XX_APB_BASE + 0x000f0000) 1060a5f3b1cSGabor Juhos #define QCA955X_PCI_CTRL_BASE1 (AR71XX_APB_BASE + 0x00280000) 1070a5f3b1cSGabor Juhos #define QCA955X_PCI_CTRL_SIZE 0x100 1080a5f3b1cSGabor Juhos 109e9c0d0aaSGabor Juhos #define QCA955X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000) 110e9c0d0aaSGabor Juhos #define QCA955X_WMAC_SIZE 0x20000 11182c46840SGabor Juhos #define QCA955X_EHCI0_BASE 0x1b000000 11282c46840SGabor Juhos #define QCA955X_EHCI1_BASE 0x1b400000 11382c46840SGabor Juhos #define QCA955X_EHCI_SIZE 0x1000 114e9c0d0aaSGabor Juhos 115d4a67d9dSGabor Juhos /* 116d4a67d9dSGabor Juhos * DDR_CTRL block 117d4a67d9dSGabor Juhos */ 118d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN0 0x7c 119d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN1 0x80 120d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN2 0x84 121d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN3 0x88 122d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN4 0x8c 123d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN5 0x90 124d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN6 0x94 125d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN7 0x98 126d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_FLUSH_GE0 0x9c 127d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_FLUSH_GE1 0xa0 128d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_FLUSH_USB 0xa4 129d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_FLUSH_PCI 0xa8 130d4a67d9dSGabor Juhos 131d4a67d9dSGabor Juhos #define AR724X_DDR_REG_FLUSH_GE0 0x7c 132d4a67d9dSGabor Juhos #define AR724X_DDR_REG_FLUSH_GE1 0x80 133d4a67d9dSGabor Juhos #define AR724X_DDR_REG_FLUSH_USB 0x84 134d4a67d9dSGabor Juhos #define AR724X_DDR_REG_FLUSH_PCIE 0x88 135d4a67d9dSGabor Juhos 136d4a67d9dSGabor Juhos #define AR913X_DDR_REG_FLUSH_GE0 0x7c 137d4a67d9dSGabor Juhos #define AR913X_DDR_REG_FLUSH_GE1 0x80 138d4a67d9dSGabor Juhos #define AR913X_DDR_REG_FLUSH_USB 0x84 139d4a67d9dSGabor Juhos #define AR913X_DDR_REG_FLUSH_WMAC 0x88 140d4a67d9dSGabor Juhos 14154eed4c7SGabor Juhos #define AR933X_DDR_REG_FLUSH_GE0 0x7c 14254eed4c7SGabor Juhos #define AR933X_DDR_REG_FLUSH_GE1 0x80 14354eed4c7SGabor Juhos #define AR933X_DDR_REG_FLUSH_USB 0x84 14454eed4c7SGabor Juhos #define AR933X_DDR_REG_FLUSH_WMAC 0x88 14554eed4c7SGabor Juhos 146fce5cc6eSGabor Juhos #define AR934X_DDR_REG_FLUSH_GE0 0x9c 147fce5cc6eSGabor Juhos #define AR934X_DDR_REG_FLUSH_GE1 0xa0 148fce5cc6eSGabor Juhos #define AR934X_DDR_REG_FLUSH_USB 0xa4 149fce5cc6eSGabor Juhos #define AR934X_DDR_REG_FLUSH_PCIE 0xa8 150fce5cc6eSGabor Juhos #define AR934X_DDR_REG_FLUSH_WMAC 0xac 151fce5cc6eSGabor Juhos 152d4a67d9dSGabor Juhos /* 153d4a67d9dSGabor Juhos * PLL block 154d4a67d9dSGabor Juhos */ 155d4a67d9dSGabor Juhos #define AR71XX_PLL_REG_CPU_CONFIG 0x00 156d4a67d9dSGabor Juhos #define AR71XX_PLL_REG_SEC_CONFIG 0x04 157d4a67d9dSGabor Juhos #define AR71XX_PLL_REG_ETH0_INT_CLOCK 0x10 158d4a67d9dSGabor Juhos #define AR71XX_PLL_REG_ETH1_INT_CLOCK 0x14 159d4a67d9dSGabor Juhos 160*626a0695SAlban Bedel #define AR71XX_PLL_FB_SHIFT 3 161*626a0695SAlban Bedel #define AR71XX_PLL_FB_MASK 0x1f 162d4a67d9dSGabor Juhos #define AR71XX_CPU_DIV_SHIFT 16 163d4a67d9dSGabor Juhos #define AR71XX_CPU_DIV_MASK 0x3 164d4a67d9dSGabor Juhos #define AR71XX_DDR_DIV_SHIFT 18 165d4a67d9dSGabor Juhos #define AR71XX_DDR_DIV_MASK 0x3 166d4a67d9dSGabor Juhos #define AR71XX_AHB_DIV_SHIFT 20 167d4a67d9dSGabor Juhos #define AR71XX_AHB_DIV_MASK 0x7 168d4a67d9dSGabor Juhos 169d4a67d9dSGabor Juhos #define AR724X_PLL_REG_CPU_CONFIG 0x00 170d4a67d9dSGabor Juhos #define AR724X_PLL_REG_PCIE_CONFIG 0x18 171d4a67d9dSGabor Juhos 172*626a0695SAlban Bedel #define AR724X_PLL_FB_SHIFT 0 173*626a0695SAlban Bedel #define AR724X_PLL_FB_MASK 0x3ff 174d4a67d9dSGabor Juhos #define AR724X_PLL_REF_DIV_SHIFT 10 175d4a67d9dSGabor Juhos #define AR724X_PLL_REF_DIV_MASK 0xf 176d4a67d9dSGabor Juhos #define AR724X_AHB_DIV_SHIFT 19 177d4a67d9dSGabor Juhos #define AR724X_AHB_DIV_MASK 0x1 178d4a67d9dSGabor Juhos #define AR724X_DDR_DIV_SHIFT 22 179d4a67d9dSGabor Juhos #define AR724X_DDR_DIV_MASK 0x3 180d4a67d9dSGabor Juhos 181d4a67d9dSGabor Juhos #define AR913X_PLL_REG_CPU_CONFIG 0x00 182d4a67d9dSGabor Juhos #define AR913X_PLL_REG_ETH_CONFIG 0x04 183d4a67d9dSGabor Juhos #define AR913X_PLL_REG_ETH0_INT_CLOCK 0x14 184d4a67d9dSGabor Juhos #define AR913X_PLL_REG_ETH1_INT_CLOCK 0x18 185d4a67d9dSGabor Juhos 186*626a0695SAlban Bedel #define AR913X_PLL_FB_SHIFT 0 187*626a0695SAlban Bedel #define AR913X_PLL_FB_MASK 0x3ff 188d4a67d9dSGabor Juhos #define AR913X_DDR_DIV_SHIFT 22 189d4a67d9dSGabor Juhos #define AR913X_DDR_DIV_MASK 0x3 190d4a67d9dSGabor Juhos #define AR913X_AHB_DIV_SHIFT 19 191d4a67d9dSGabor Juhos #define AR913X_AHB_DIV_MASK 0x1 192d4a67d9dSGabor Juhos 19304225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_REG 0x00 19404225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_REG 0x08 19504225e1dSGabor Juhos 19604225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_NINT_SHIFT 10 19704225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_NINT_MASK 0x3f 19804225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_REFDIV_SHIFT 16 19904225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f 20004225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_OUTDIV_SHIFT 23 20104225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_OUTDIV_MASK 0x7 20204225e1dSGabor Juhos 20304225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_BYPASS BIT(2) 20404225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_CPU_DIV_SHIFT 5 20504225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_CPU_DIV_MASK 0x3 20604225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_DDR_DIV_SHIFT 10 20704225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_DDR_DIV_MASK 0x3 20804225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_AHB_DIV_SHIFT 15 20904225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_AHB_DIV_MASK 0x7 21004225e1dSGabor Juhos 2118889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_REG 0x00 2128889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_REG 0x04 2138889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_REG 0x08 2148889612bSGabor Juhos 2158889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_NFRAC_SHIFT 0 2168889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_NFRAC_MASK 0x3f 2178889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_NINT_SHIFT 6 2188889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_NINT_MASK 0x3f 2198889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_REFDIV_SHIFT 12 2208889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f 2218889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19 2228889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_OUTDIV_MASK 0x3 2238889612bSGabor Juhos 2248889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_NFRAC_SHIFT 0 2258889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_NFRAC_MASK 0x3ff 2268889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_NINT_SHIFT 10 2278889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_NINT_MASK 0x3f 2288889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_REFDIV_SHIFT 16 2298889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_REFDIV_MASK 0x1f 2308889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_OUTDIV_SHIFT 23 2318889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_OUTDIV_MASK 0x7 2328889612bSGabor Juhos 2338889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_PLL_BYPASS BIT(2) 2348889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_PLL_BYPASS BIT(3) 2358889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_PLL_BYPASS BIT(4) 2368889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_POST_DIV_SHIFT 5 2378889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_POST_DIV_MASK 0x1f 2388889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_POST_DIV_SHIFT 10 2398889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_POST_DIV_MASK 0x1f 2408889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_POST_DIV_SHIFT 15 2418889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_POST_DIV_MASK 0x1f 2428889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_CPUCLK_FROM_CPUPLL BIT(20) 2438889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21) 2448889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) 2458889612bSGabor Juhos 24641583c05SGabor Juhos #define QCA955X_PLL_CPU_CONFIG_REG 0x00 24741583c05SGabor Juhos #define QCA955X_PLL_DDR_CONFIG_REG 0x04 24841583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_REG 0x08 24941583c05SGabor Juhos 25041583c05SGabor Juhos #define QCA955X_PLL_CPU_CONFIG_NFRAC_SHIFT 0 25141583c05SGabor Juhos #define QCA955X_PLL_CPU_CONFIG_NFRAC_MASK 0x3f 25241583c05SGabor Juhos #define QCA955X_PLL_CPU_CONFIG_NINT_SHIFT 6 25341583c05SGabor Juhos #define QCA955X_PLL_CPU_CONFIG_NINT_MASK 0x3f 25441583c05SGabor Juhos #define QCA955X_PLL_CPU_CONFIG_REFDIV_SHIFT 12 25541583c05SGabor Juhos #define QCA955X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f 25641583c05SGabor Juhos #define QCA955X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19 25741583c05SGabor Juhos #define QCA955X_PLL_CPU_CONFIG_OUTDIV_MASK 0x3 25841583c05SGabor Juhos 25941583c05SGabor Juhos #define QCA955X_PLL_DDR_CONFIG_NFRAC_SHIFT 0 26041583c05SGabor Juhos #define QCA955X_PLL_DDR_CONFIG_NFRAC_MASK 0x3ff 26141583c05SGabor Juhos #define QCA955X_PLL_DDR_CONFIG_NINT_SHIFT 10 26241583c05SGabor Juhos #define QCA955X_PLL_DDR_CONFIG_NINT_MASK 0x3f 26341583c05SGabor Juhos #define QCA955X_PLL_DDR_CONFIG_REFDIV_SHIFT 16 26441583c05SGabor Juhos #define QCA955X_PLL_DDR_CONFIG_REFDIV_MASK 0x1f 26541583c05SGabor Juhos #define QCA955X_PLL_DDR_CONFIG_OUTDIV_SHIFT 23 26641583c05SGabor Juhos #define QCA955X_PLL_DDR_CONFIG_OUTDIV_MASK 0x7 26741583c05SGabor Juhos 26841583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_CPU_PLL_BYPASS BIT(2) 26941583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_DDR_PLL_BYPASS BIT(3) 27041583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_AHB_PLL_BYPASS BIT(4) 27141583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT 5 27241583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_CPU_POST_DIV_MASK 0x1f 27341583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT 10 27441583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_DDR_POST_DIV_MASK 0x1f 27541583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT 15 27641583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_AHB_POST_DIV_MASK 0x1f 27741583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_CPUCLK_FROM_CPUPLL BIT(20) 27841583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21) 27941583c05SGabor Juhos #define QCA955X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) 28041583c05SGabor Juhos 281d4a67d9dSGabor Juhos /* 2827e98aa46SGabor Juhos * USB_CONFIG block 2837e98aa46SGabor Juhos */ 2847e98aa46SGabor Juhos #define AR71XX_USB_CTRL_REG_FLADJ 0x00 2857e98aa46SGabor Juhos #define AR71XX_USB_CTRL_REG_CONFIG 0x04 2867e98aa46SGabor Juhos 2877e98aa46SGabor Juhos /* 288d4a67d9dSGabor Juhos * RESET block 289d4a67d9dSGabor Juhos */ 290d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_TIMER 0x00 291d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_TIMER_RELOAD 0x04 292d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_WDOG_CTRL 0x08 293d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_WDOG 0x0c 294d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_MISC_INT_STATUS 0x10 295d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_MISC_INT_ENABLE 0x14 296d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PCI_INT_STATUS 0x18 297d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PCI_INT_ENABLE 0x1c 298d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_GLOBAL_INT_STATUS 0x20 299d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_RESET_MODULE 0x24 300d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PERFC_CTRL 0x2c 301d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PERFC0 0x30 302d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PERFC1 0x34 303d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_REV_ID 0x90 304d4a67d9dSGabor Juhos 305d4a67d9dSGabor Juhos #define AR913X_RESET_REG_GLOBAL_INT_STATUS 0x18 306d4a67d9dSGabor Juhos #define AR913X_RESET_REG_RESET_MODULE 0x1c 307d4a67d9dSGabor Juhos #define AR913X_RESET_REG_PERF_CTRL 0x20 308d4a67d9dSGabor Juhos #define AR913X_RESET_REG_PERFC0 0x24 309d4a67d9dSGabor Juhos #define AR913X_RESET_REG_PERFC1 0x28 310d4a67d9dSGabor Juhos 311d4a67d9dSGabor Juhos #define AR724X_RESET_REG_RESET_MODULE 0x1c 312d4a67d9dSGabor Juhos 3137ee15d8aSGabor Juhos #define AR933X_RESET_REG_RESET_MODULE 0x1c 31404225e1dSGabor Juhos #define AR933X_RESET_REG_BOOTSTRAP 0xac 31504225e1dSGabor Juhos 31642184768SGabor Juhos #define AR934X_RESET_REG_RESET_MODULE 0x1c 3178889612bSGabor Juhos #define AR934X_RESET_REG_BOOTSTRAP 0xb0 318fce5cc6eSGabor Juhos #define AR934X_RESET_REG_PCIE_WMAC_INT_STATUS 0xac 3198889612bSGabor Juhos 3207d4c2af9SGabor Juhos #define QCA955X_RESET_REG_RESET_MODULE 0x1c 32141583c05SGabor Juhos #define QCA955X_RESET_REG_BOOTSTRAP 0xb0 32253330332SGabor Juhos #define QCA955X_RESET_REG_EXT_INT_STATUS 0xac 32341583c05SGabor Juhos 324d2b4ac1eSGabor Juhos #define MISC_INT_ETHSW BIT(12) 325d2b4ac1eSGabor Juhos #define MISC_INT_TIMER4 BIT(10) 326d2b4ac1eSGabor Juhos #define MISC_INT_TIMER3 BIT(9) 327d2b4ac1eSGabor Juhos #define MISC_INT_TIMER2 BIT(8) 328d4a67d9dSGabor Juhos #define MISC_INT_DMA BIT(7) 329d4a67d9dSGabor Juhos #define MISC_INT_OHCI BIT(6) 330d4a67d9dSGabor Juhos #define MISC_INT_PERFC BIT(5) 331d4a67d9dSGabor Juhos #define MISC_INT_WDOG BIT(4) 332d4a67d9dSGabor Juhos #define MISC_INT_UART BIT(3) 333d4a67d9dSGabor Juhos #define MISC_INT_GPIO BIT(2) 334d4a67d9dSGabor Juhos #define MISC_INT_ERROR BIT(1) 335d4a67d9dSGabor Juhos #define MISC_INT_TIMER BIT(0) 336d4a67d9dSGabor Juhos 337d4a67d9dSGabor Juhos #define AR71XX_RESET_EXTERNAL BIT(28) 338d4a67d9dSGabor Juhos #define AR71XX_RESET_FULL_CHIP BIT(24) 339d4a67d9dSGabor Juhos #define AR71XX_RESET_CPU_NMI BIT(21) 340d4a67d9dSGabor Juhos #define AR71XX_RESET_CPU_COLD BIT(20) 341d4a67d9dSGabor Juhos #define AR71XX_RESET_DMA BIT(19) 342d4a67d9dSGabor Juhos #define AR71XX_RESET_SLIC BIT(18) 343d4a67d9dSGabor Juhos #define AR71XX_RESET_STEREO BIT(17) 344d4a67d9dSGabor Juhos #define AR71XX_RESET_DDR BIT(16) 345d4a67d9dSGabor Juhos #define AR71XX_RESET_GE1_MAC BIT(13) 346d4a67d9dSGabor Juhos #define AR71XX_RESET_GE1_PHY BIT(12) 347d4a67d9dSGabor Juhos #define AR71XX_RESET_USBSUS_OVERRIDE BIT(10) 348d4a67d9dSGabor Juhos #define AR71XX_RESET_GE0_MAC BIT(9) 349d4a67d9dSGabor Juhos #define AR71XX_RESET_GE0_PHY BIT(8) 350d4a67d9dSGabor Juhos #define AR71XX_RESET_USB_OHCI_DLL BIT(6) 351d4a67d9dSGabor Juhos #define AR71XX_RESET_USB_HOST BIT(5) 352d4a67d9dSGabor Juhos #define AR71XX_RESET_USB_PHY BIT(4) 353d4a67d9dSGabor Juhos #define AR71XX_RESET_PCI_BUS BIT(1) 354d4a67d9dSGabor Juhos #define AR71XX_RESET_PCI_CORE BIT(0) 355d4a67d9dSGabor Juhos 3567e98aa46SGabor Juhos #define AR7240_RESET_USB_HOST BIT(5) 3577e98aa46SGabor Juhos #define AR7240_RESET_OHCI_DLL BIT(3) 3587e98aa46SGabor Juhos 359d4a67d9dSGabor Juhos #define AR724X_RESET_GE1_MDIO BIT(23) 360d4a67d9dSGabor Juhos #define AR724X_RESET_GE0_MDIO BIT(22) 361d4a67d9dSGabor Juhos #define AR724X_RESET_PCIE_PHY_SERIAL BIT(10) 362d4a67d9dSGabor Juhos #define AR724X_RESET_PCIE_PHY BIT(7) 363d4a67d9dSGabor Juhos #define AR724X_RESET_PCIE BIT(6) 3647e98aa46SGabor Juhos #define AR724X_RESET_USB_HOST BIT(5) 3657e98aa46SGabor Juhos #define AR724X_RESET_USB_PHY BIT(4) 3667e98aa46SGabor Juhos #define AR724X_RESET_USBSUS_OVERRIDE BIT(3) 367d4a67d9dSGabor Juhos 368d4a67d9dSGabor Juhos #define AR913X_RESET_AMBA2WMAC BIT(22) 3697e98aa46SGabor Juhos #define AR913X_RESET_USBSUS_OVERRIDE BIT(10) 3707e98aa46SGabor Juhos #define AR913X_RESET_USB_HOST BIT(5) 3717e98aa46SGabor Juhos #define AR913X_RESET_USB_PHY BIT(4) 372d4a67d9dSGabor Juhos 37334cfcd26SGabor Juhos #define AR933X_RESET_WMAC BIT(11) 374c279b775SGabor Juhos #define AR933X_RESET_USB_HOST BIT(5) 375c279b775SGabor Juhos #define AR933X_RESET_USB_PHY BIT(4) 376c279b775SGabor Juhos #define AR933X_RESET_USBSUS_OVERRIDE BIT(3) 377c279b775SGabor Juhos 37800ffed58SGabor Juhos #define AR934X_RESET_USB_PHY_ANALOG BIT(11) 37900ffed58SGabor Juhos #define AR934X_RESET_USB_HOST BIT(5) 38000ffed58SGabor Juhos #define AR934X_RESET_USB_PHY BIT(4) 38100ffed58SGabor Juhos #define AR934X_RESET_USBSUS_OVERRIDE BIT(3) 38200ffed58SGabor Juhos 38304225e1dSGabor Juhos #define AR933X_BOOTSTRAP_REF_CLK_40 BIT(0) 38404225e1dSGabor Juhos 3858889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION8 BIT(23) 3868889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION7 BIT(22) 3878889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION6 BIT(21) 3888889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION5 BIT(20) 3898889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION4 BIT(19) 3908889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION3 BIT(18) 3918889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION2 BIT(17) 3928889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION1 BIT(16) 3938889612bSGabor Juhos #define AR934X_BOOTSTRAP_USB_MODE_DEVICE BIT(7) 3948889612bSGabor Juhos #define AR934X_BOOTSTRAP_PCIE_RC BIT(6) 3958889612bSGabor Juhos #define AR934X_BOOTSTRAP_EJTAG_MODE BIT(5) 3968889612bSGabor Juhos #define AR934X_BOOTSTRAP_REF_CLK_40 BIT(4) 3978889612bSGabor Juhos #define AR934X_BOOTSTRAP_BOOT_FROM_SPI BIT(2) 3988889612bSGabor Juhos #define AR934X_BOOTSTRAP_SDRAM_DISABLED BIT(1) 3998889612bSGabor Juhos #define AR934X_BOOTSTRAP_DDR1 BIT(0) 4008889612bSGabor Juhos 40141583c05SGabor Juhos #define QCA955X_BOOTSTRAP_REF_CLK_40 BIT(4) 40241583c05SGabor Juhos 403fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_WMAC_MISC BIT(0) 404fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_WMAC_TX BIT(1) 405fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_WMAC_RXLP BIT(2) 406fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_WMAC_RXHP BIT(3) 407fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_PCIE_RC BIT(4) 408fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_PCIE_RC0 BIT(5) 409fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_PCIE_RC1 BIT(6) 410fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_PCIE_RC2 BIT(7) 411fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_PCIE_RC3 BIT(8) 412fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_WMAC_ALL \ 413fce5cc6eSGabor Juhos (AR934X_PCIE_WMAC_INT_WMAC_MISC | AR934X_PCIE_WMAC_INT_WMAC_TX | \ 414fce5cc6eSGabor Juhos AR934X_PCIE_WMAC_INT_WMAC_RXLP | AR934X_PCIE_WMAC_INT_WMAC_RXHP) 415fce5cc6eSGabor Juhos 416fce5cc6eSGabor Juhos #define AR934X_PCIE_WMAC_INT_PCIE_ALL \ 417fce5cc6eSGabor Juhos (AR934X_PCIE_WMAC_INT_PCIE_RC | AR934X_PCIE_WMAC_INT_PCIE_RC0 | \ 418fce5cc6eSGabor Juhos AR934X_PCIE_WMAC_INT_PCIE_RC1 | AR934X_PCIE_WMAC_INT_PCIE_RC2 | \ 419fce5cc6eSGabor Juhos AR934X_PCIE_WMAC_INT_PCIE_RC3) 420fce5cc6eSGabor Juhos 42153330332SGabor Juhos #define QCA955X_EXT_INT_WMAC_MISC BIT(0) 42253330332SGabor Juhos #define QCA955X_EXT_INT_WMAC_TX BIT(1) 42353330332SGabor Juhos #define QCA955X_EXT_INT_WMAC_RXLP BIT(2) 42453330332SGabor Juhos #define QCA955X_EXT_INT_WMAC_RXHP BIT(3) 42553330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC1 BIT(4) 42653330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC1_INT0 BIT(5) 42753330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC1_INT1 BIT(6) 42853330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC1_INT2 BIT(7) 42953330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC1_INT3 BIT(8) 43053330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC2 BIT(12) 43153330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC2_INT0 BIT(13) 43253330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC2_INT1 BIT(14) 43353330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC2_INT2 BIT(15) 43453330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC2_INT3 BIT(16) 43553330332SGabor Juhos #define QCA955X_EXT_INT_USB1 BIT(24) 43653330332SGabor Juhos #define QCA955X_EXT_INT_USB2 BIT(28) 43753330332SGabor Juhos 43853330332SGabor Juhos #define QCA955X_EXT_INT_WMAC_ALL \ 43953330332SGabor Juhos (QCA955X_EXT_INT_WMAC_MISC | QCA955X_EXT_INT_WMAC_TX | \ 44053330332SGabor Juhos QCA955X_EXT_INT_WMAC_RXLP | QCA955X_EXT_INT_WMAC_RXHP) 44153330332SGabor Juhos 44253330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC1_ALL \ 44353330332SGabor Juhos (QCA955X_EXT_INT_PCIE_RC1 | QCA955X_EXT_INT_PCIE_RC1_INT0 | \ 44453330332SGabor Juhos QCA955X_EXT_INT_PCIE_RC1_INT1 | QCA955X_EXT_INT_PCIE_RC1_INT2 | \ 44553330332SGabor Juhos QCA955X_EXT_INT_PCIE_RC1_INT3) 44653330332SGabor Juhos 44753330332SGabor Juhos #define QCA955X_EXT_INT_PCIE_RC2_ALL \ 44853330332SGabor Juhos (QCA955X_EXT_INT_PCIE_RC2 | QCA955X_EXT_INT_PCIE_RC2_INT0 | \ 44953330332SGabor Juhos QCA955X_EXT_INT_PCIE_RC2_INT1 | QCA955X_EXT_INT_PCIE_RC2_INT2 | \ 45053330332SGabor Juhos QCA955X_EXT_INT_PCIE_RC2_INT3) 45153330332SGabor Juhos 452d4a67d9dSGabor Juhos #define REV_ID_MAJOR_MASK 0xfff0 453d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR71XX 0x00a0 454d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR913X 0x00b0 455d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR7240 0x00c0 456d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR7241 0x0100 457d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR7242 0x1100 4586d1c8fdeSGabor Juhos #define REV_ID_MAJOR_AR9330 0x0110 4596d1c8fdeSGabor Juhos #define REV_ID_MAJOR_AR9331 0x1110 460703327ddSGabor Juhos #define REV_ID_MAJOR_AR9341 0x0120 461703327ddSGabor Juhos #define REV_ID_MAJOR_AR9342 0x1120 462703327ddSGabor Juhos #define REV_ID_MAJOR_AR9344 0x2120 46390898779SGabor Juhos #define REV_ID_MAJOR_QCA9556 0x0130 46490898779SGabor Juhos #define REV_ID_MAJOR_QCA9558 0x1130 465d4a67d9dSGabor Juhos 466d4a67d9dSGabor Juhos #define AR71XX_REV_ID_MINOR_MASK 0x3 467d4a67d9dSGabor Juhos #define AR71XX_REV_ID_MINOR_AR7130 0x0 468d4a67d9dSGabor Juhos #define AR71XX_REV_ID_MINOR_AR7141 0x1 469d4a67d9dSGabor Juhos #define AR71XX_REV_ID_MINOR_AR7161 0x2 470d4a67d9dSGabor Juhos #define AR71XX_REV_ID_REVISION_MASK 0x3 471d4a67d9dSGabor Juhos #define AR71XX_REV_ID_REVISION_SHIFT 2 472d4a67d9dSGabor Juhos 473d4a67d9dSGabor Juhos #define AR913X_REV_ID_MINOR_MASK 0x3 474d4a67d9dSGabor Juhos #define AR913X_REV_ID_MINOR_AR9130 0x0 475d4a67d9dSGabor Juhos #define AR913X_REV_ID_MINOR_AR9132 0x1 476d4a67d9dSGabor Juhos #define AR913X_REV_ID_REVISION_MASK 0x3 477d4a67d9dSGabor Juhos #define AR913X_REV_ID_REVISION_SHIFT 2 478d4a67d9dSGabor Juhos 4796d1c8fdeSGabor Juhos #define AR933X_REV_ID_REVISION_MASK 0x3 4806d1c8fdeSGabor Juhos 481d4a67d9dSGabor Juhos #define AR724X_REV_ID_REVISION_MASK 0x3 482d4a67d9dSGabor Juhos 483d8411466SGabor Juhos #define AR934X_REV_ID_REVISION_MASK 0xf 484d8411466SGabor Juhos 4852e6c91e3SGabor Juhos #define QCA955X_REV_ID_REVISION_MASK 0xf 4862e6c91e3SGabor Juhos 487d4a67d9dSGabor Juhos /* 488d4a67d9dSGabor Juhos * SPI block 489d4a67d9dSGabor Juhos */ 490d4a67d9dSGabor Juhos #define AR71XX_SPI_REG_FS 0x00 /* Function Select */ 491d4a67d9dSGabor Juhos #define AR71XX_SPI_REG_CTRL 0x04 /* SPI Control */ 492d4a67d9dSGabor Juhos #define AR71XX_SPI_REG_IOC 0x08 /* SPI I/O Control */ 493d4a67d9dSGabor Juhos #define AR71XX_SPI_REG_RDS 0x0c /* Read Data Shift */ 494d4a67d9dSGabor Juhos 495d4a67d9dSGabor Juhos #define AR71XX_SPI_FS_GPIO BIT(0) /* Enable GPIO mode */ 496d4a67d9dSGabor Juhos 497d4a67d9dSGabor Juhos #define AR71XX_SPI_CTRL_RD BIT(6) /* Remap Disable */ 498d4a67d9dSGabor Juhos #define AR71XX_SPI_CTRL_DIV_MASK 0x3f 499d4a67d9dSGabor Juhos 500d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_DO BIT(0) /* Data Out pin */ 501d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CLK BIT(8) /* CLK pin */ 502d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS(n) BIT(16 + (n)) 503d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS0 AR71XX_SPI_IOC_CS(0) 504d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS1 AR71XX_SPI_IOC_CS(1) 505d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS2 AR71XX_SPI_IOC_CS(2) 506d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS_ALL (AR71XX_SPI_IOC_CS0 | AR71XX_SPI_IOC_CS1 | \ 507d4a67d9dSGabor Juhos AR71XX_SPI_IOC_CS2) 508d4a67d9dSGabor Juhos 5096eae43c5SGabor Juhos /* 5106eae43c5SGabor Juhos * GPIO block 5116eae43c5SGabor Juhos */ 5126eae43c5SGabor Juhos #define AR71XX_GPIO_REG_OE 0x00 5136eae43c5SGabor Juhos #define AR71XX_GPIO_REG_IN 0x04 5146eae43c5SGabor Juhos #define AR71XX_GPIO_REG_OUT 0x08 5156eae43c5SGabor Juhos #define AR71XX_GPIO_REG_SET 0x0c 5166eae43c5SGabor Juhos #define AR71XX_GPIO_REG_CLEAR 0x10 5176eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_MODE 0x14 5186eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_TYPE 0x18 5196eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_POLARITY 0x1c 5206eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_PENDING 0x20 5216eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_ENABLE 0x24 5226eae43c5SGabor Juhos #define AR71XX_GPIO_REG_FUNC 0x28 5236eae43c5SGabor Juhos 5248838becdSGabor Juhos #define AR934X_GPIO_REG_FUNC 0x6c 5258838becdSGabor Juhos 5266eae43c5SGabor Juhos #define AR71XX_GPIO_COUNT 16 527b4da14abSGabor Juhos #define AR7240_GPIO_COUNT 18 528b4da14abSGabor Juhos #define AR7241_GPIO_COUNT 20 5296eae43c5SGabor Juhos #define AR913X_GPIO_COUNT 22 530fdfbcf47SGabor Juhos #define AR933X_GPIO_COUNT 30 5315b5b544eSGabor Juhos #define AR934X_GPIO_COUNT 23 532f818ca3eSGabor Juhos #define QCA955X_GPIO_COUNT 24 5336eae43c5SGabor Juhos 53497541ccfSGabor Juhos /* 53597541ccfSGabor Juhos * SRIF block 53697541ccfSGabor Juhos */ 53797541ccfSGabor Juhos #define AR934X_SRIF_CPU_DPLL1_REG 0x1c0 53897541ccfSGabor Juhos #define AR934X_SRIF_CPU_DPLL2_REG 0x1c4 53997541ccfSGabor Juhos #define AR934X_SRIF_CPU_DPLL3_REG 0x1c8 54097541ccfSGabor Juhos 54197541ccfSGabor Juhos #define AR934X_SRIF_DDR_DPLL1_REG 0x240 54297541ccfSGabor Juhos #define AR934X_SRIF_DDR_DPLL2_REG 0x244 54397541ccfSGabor Juhos #define AR934X_SRIF_DDR_DPLL3_REG 0x248 54497541ccfSGabor Juhos 54597541ccfSGabor Juhos #define AR934X_SRIF_DPLL1_REFDIV_SHIFT 27 54697541ccfSGabor Juhos #define AR934X_SRIF_DPLL1_REFDIV_MASK 0x1f 54797541ccfSGabor Juhos #define AR934X_SRIF_DPLL1_NINT_SHIFT 18 54897541ccfSGabor Juhos #define AR934X_SRIF_DPLL1_NINT_MASK 0x1ff 54997541ccfSGabor Juhos #define AR934X_SRIF_DPLL1_NFRAC_MASK 0x0003ffff 55097541ccfSGabor Juhos 55197541ccfSGabor Juhos #define AR934X_SRIF_DPLL2_LOCAL_PLL BIT(30) 55297541ccfSGabor Juhos #define AR934X_SRIF_DPLL2_OUTDIV_SHIFT 13 55397541ccfSGabor Juhos #define AR934X_SRIF_DPLL2_OUTDIV_MASK 0x7 55497541ccfSGabor Juhos 555d4a67d9dSGabor Juhos #endif /* __ASM_MACH_AR71XX_REGS_H */ 556