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/init.h> 20d4a67d9dSGabor Juhos #include <linux/io.h> 21d4a67d9dSGabor Juhos #include <linux/bitops.h> 22d4a67d9dSGabor Juhos 23d4a67d9dSGabor Juhos #define AR71XX_APB_BASE 0x18000000 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 43d4a67d9dSGabor Juhos 447e98aa46SGabor Juhos #define AR7240_USB_CTRL_BASE (AR71XX_APB_BASE + 0x00030000) 457e98aa46SGabor Juhos #define AR7240_USB_CTRL_SIZE 0x100 467e98aa46SGabor Juhos #define AR7240_OHCI_BASE 0x1b000000 477e98aa46SGabor Juhos #define AR7240_OHCI_SIZE 0x1000 487e98aa46SGabor Juhos 497e98aa46SGabor Juhos #define AR724X_EHCI_BASE 0x1b000000 507e98aa46SGabor Juhos #define AR724X_EHCI_SIZE 0x1000 517e98aa46SGabor Juhos 527e98aa46SGabor Juhos #define AR913X_EHCI_BASE 0x1b000000 537e98aa46SGabor Juhos #define AR913X_EHCI_SIZE 0x1000 54f5b35d0bSGabor Juhos #define AR913X_WMAC_BASE (AR71XX_APB_BASE + 0x000C0000) 55f5b35d0bSGabor Juhos #define AR913X_WMAC_SIZE 0x30000 56f5b35d0bSGabor Juhos 570bd3acdfSGabor Juhos #define AR933X_UART_BASE (AR71XX_APB_BASE + 0x00020000) 580bd3acdfSGabor Juhos #define AR933X_UART_SIZE 0x14 5934cfcd26SGabor Juhos #define AR933X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000) 6034cfcd26SGabor Juhos #define AR933X_WMAC_SIZE 0x20000 61c279b775SGabor Juhos #define AR933X_EHCI_BASE 0x1b000000 62c279b775SGabor Juhos #define AR933X_EHCI_SIZE 0x1000 63c279b775SGabor Juhos 64d4a67d9dSGabor Juhos /* 65d4a67d9dSGabor Juhos * DDR_CTRL block 66d4a67d9dSGabor Juhos */ 67d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN0 0x7c 68d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN1 0x80 69d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN2 0x84 70d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN3 0x88 71d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN4 0x8c 72d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN5 0x90 73d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN6 0x94 74d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_PCI_WIN7 0x98 75d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_FLUSH_GE0 0x9c 76d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_FLUSH_GE1 0xa0 77d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_FLUSH_USB 0xa4 78d4a67d9dSGabor Juhos #define AR71XX_DDR_REG_FLUSH_PCI 0xa8 79d4a67d9dSGabor Juhos 80d4a67d9dSGabor Juhos #define AR724X_DDR_REG_FLUSH_GE0 0x7c 81d4a67d9dSGabor Juhos #define AR724X_DDR_REG_FLUSH_GE1 0x80 82d4a67d9dSGabor Juhos #define AR724X_DDR_REG_FLUSH_USB 0x84 83d4a67d9dSGabor Juhos #define AR724X_DDR_REG_FLUSH_PCIE 0x88 84d4a67d9dSGabor Juhos 85d4a67d9dSGabor Juhos #define AR913X_DDR_REG_FLUSH_GE0 0x7c 86d4a67d9dSGabor Juhos #define AR913X_DDR_REG_FLUSH_GE1 0x80 87d4a67d9dSGabor Juhos #define AR913X_DDR_REG_FLUSH_USB 0x84 88d4a67d9dSGabor Juhos #define AR913X_DDR_REG_FLUSH_WMAC 0x88 89d4a67d9dSGabor Juhos 9054eed4c7SGabor Juhos #define AR933X_DDR_REG_FLUSH_GE0 0x7c 9154eed4c7SGabor Juhos #define AR933X_DDR_REG_FLUSH_GE1 0x80 9254eed4c7SGabor Juhos #define AR933X_DDR_REG_FLUSH_USB 0x84 9354eed4c7SGabor Juhos #define AR933X_DDR_REG_FLUSH_WMAC 0x88 9454eed4c7SGabor Juhos 95d4a67d9dSGabor Juhos /* 96d4a67d9dSGabor Juhos * PLL block 97d4a67d9dSGabor Juhos */ 98d4a67d9dSGabor Juhos #define AR71XX_PLL_REG_CPU_CONFIG 0x00 99d4a67d9dSGabor Juhos #define AR71XX_PLL_REG_SEC_CONFIG 0x04 100d4a67d9dSGabor Juhos #define AR71XX_PLL_REG_ETH0_INT_CLOCK 0x10 101d4a67d9dSGabor Juhos #define AR71XX_PLL_REG_ETH1_INT_CLOCK 0x14 102d4a67d9dSGabor Juhos 103d4a67d9dSGabor Juhos #define AR71XX_PLL_DIV_SHIFT 3 104d4a67d9dSGabor Juhos #define AR71XX_PLL_DIV_MASK 0x1f 105d4a67d9dSGabor Juhos #define AR71XX_CPU_DIV_SHIFT 16 106d4a67d9dSGabor Juhos #define AR71XX_CPU_DIV_MASK 0x3 107d4a67d9dSGabor Juhos #define AR71XX_DDR_DIV_SHIFT 18 108d4a67d9dSGabor Juhos #define AR71XX_DDR_DIV_MASK 0x3 109d4a67d9dSGabor Juhos #define AR71XX_AHB_DIV_SHIFT 20 110d4a67d9dSGabor Juhos #define AR71XX_AHB_DIV_MASK 0x7 111d4a67d9dSGabor Juhos 112d4a67d9dSGabor Juhos #define AR724X_PLL_REG_CPU_CONFIG 0x00 113d4a67d9dSGabor Juhos #define AR724X_PLL_REG_PCIE_CONFIG 0x18 114d4a67d9dSGabor Juhos 115d4a67d9dSGabor Juhos #define AR724X_PLL_DIV_SHIFT 0 116d4a67d9dSGabor Juhos #define AR724X_PLL_DIV_MASK 0x3ff 117d4a67d9dSGabor Juhos #define AR724X_PLL_REF_DIV_SHIFT 10 118d4a67d9dSGabor Juhos #define AR724X_PLL_REF_DIV_MASK 0xf 119d4a67d9dSGabor Juhos #define AR724X_AHB_DIV_SHIFT 19 120d4a67d9dSGabor Juhos #define AR724X_AHB_DIV_MASK 0x1 121d4a67d9dSGabor Juhos #define AR724X_DDR_DIV_SHIFT 22 122d4a67d9dSGabor Juhos #define AR724X_DDR_DIV_MASK 0x3 123d4a67d9dSGabor Juhos 124d4a67d9dSGabor Juhos #define AR913X_PLL_REG_CPU_CONFIG 0x00 125d4a67d9dSGabor Juhos #define AR913X_PLL_REG_ETH_CONFIG 0x04 126d4a67d9dSGabor Juhos #define AR913X_PLL_REG_ETH0_INT_CLOCK 0x14 127d4a67d9dSGabor Juhos #define AR913X_PLL_REG_ETH1_INT_CLOCK 0x18 128d4a67d9dSGabor Juhos 129d4a67d9dSGabor Juhos #define AR913X_PLL_DIV_SHIFT 0 130d4a67d9dSGabor Juhos #define AR913X_PLL_DIV_MASK 0x3ff 131d4a67d9dSGabor Juhos #define AR913X_DDR_DIV_SHIFT 22 132d4a67d9dSGabor Juhos #define AR913X_DDR_DIV_MASK 0x3 133d4a67d9dSGabor Juhos #define AR913X_AHB_DIV_SHIFT 19 134d4a67d9dSGabor Juhos #define AR913X_AHB_DIV_MASK 0x1 135d4a67d9dSGabor Juhos 13604225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_REG 0x00 13704225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_REG 0x08 13804225e1dSGabor Juhos 13904225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_NINT_SHIFT 10 14004225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_NINT_MASK 0x3f 14104225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_REFDIV_SHIFT 16 14204225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f 14304225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_OUTDIV_SHIFT 23 14404225e1dSGabor Juhos #define AR933X_PLL_CPU_CONFIG_OUTDIV_MASK 0x7 14504225e1dSGabor Juhos 14604225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_BYPASS BIT(2) 14704225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_CPU_DIV_SHIFT 5 14804225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_CPU_DIV_MASK 0x3 14904225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_DDR_DIV_SHIFT 10 15004225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_DDR_DIV_MASK 0x3 15104225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_AHB_DIV_SHIFT 15 15204225e1dSGabor Juhos #define AR933X_PLL_CLOCK_CTRL_AHB_DIV_MASK 0x7 15304225e1dSGabor Juhos 154*8889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_REG 0x00 155*8889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_REG 0x04 156*8889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_REG 0x08 157*8889612bSGabor Juhos 158*8889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_NFRAC_SHIFT 0 159*8889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_NFRAC_MASK 0x3f 160*8889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_NINT_SHIFT 6 161*8889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_NINT_MASK 0x3f 162*8889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_REFDIV_SHIFT 12 163*8889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f 164*8889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19 165*8889612bSGabor Juhos #define AR934X_PLL_CPU_CONFIG_OUTDIV_MASK 0x3 166*8889612bSGabor Juhos 167*8889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_NFRAC_SHIFT 0 168*8889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_NFRAC_MASK 0x3ff 169*8889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_NINT_SHIFT 10 170*8889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_NINT_MASK 0x3f 171*8889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_REFDIV_SHIFT 16 172*8889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_REFDIV_MASK 0x1f 173*8889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_OUTDIV_SHIFT 23 174*8889612bSGabor Juhos #define AR934X_PLL_DDR_CONFIG_OUTDIV_MASK 0x7 175*8889612bSGabor Juhos 176*8889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_PLL_BYPASS BIT(2) 177*8889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_PLL_BYPASS BIT(3) 178*8889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_PLL_BYPASS BIT(4) 179*8889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_POST_DIV_SHIFT 5 180*8889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_POST_DIV_MASK 0x1f 181*8889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_POST_DIV_SHIFT 10 182*8889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_POST_DIV_MASK 0x1f 183*8889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_POST_DIV_SHIFT 15 184*8889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_POST_DIV_MASK 0x1f 185*8889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_CPUCLK_FROM_CPUPLL BIT(20) 186*8889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21) 187*8889612bSGabor Juhos #define AR934X_PLL_CPU_DDR_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24) 188*8889612bSGabor Juhos 189d4a67d9dSGabor Juhos /* 1907e98aa46SGabor Juhos * USB_CONFIG block 1917e98aa46SGabor Juhos */ 1927e98aa46SGabor Juhos #define AR71XX_USB_CTRL_REG_FLADJ 0x00 1937e98aa46SGabor Juhos #define AR71XX_USB_CTRL_REG_CONFIG 0x04 1947e98aa46SGabor Juhos 1957e98aa46SGabor Juhos /* 196d4a67d9dSGabor Juhos * RESET block 197d4a67d9dSGabor Juhos */ 198d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_TIMER 0x00 199d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_TIMER_RELOAD 0x04 200d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_WDOG_CTRL 0x08 201d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_WDOG 0x0c 202d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_MISC_INT_STATUS 0x10 203d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_MISC_INT_ENABLE 0x14 204d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PCI_INT_STATUS 0x18 205d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PCI_INT_ENABLE 0x1c 206d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_GLOBAL_INT_STATUS 0x20 207d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_RESET_MODULE 0x24 208d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PERFC_CTRL 0x2c 209d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PERFC0 0x30 210d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PERFC1 0x34 211d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_REV_ID 0x90 212d4a67d9dSGabor Juhos 213d4a67d9dSGabor Juhos #define AR913X_RESET_REG_GLOBAL_INT_STATUS 0x18 214d4a67d9dSGabor Juhos #define AR913X_RESET_REG_RESET_MODULE 0x1c 215d4a67d9dSGabor Juhos #define AR913X_RESET_REG_PERF_CTRL 0x20 216d4a67d9dSGabor Juhos #define AR913X_RESET_REG_PERFC0 0x24 217d4a67d9dSGabor Juhos #define AR913X_RESET_REG_PERFC1 0x28 218d4a67d9dSGabor Juhos 219d4a67d9dSGabor Juhos #define AR724X_RESET_REG_RESET_MODULE 0x1c 220d4a67d9dSGabor Juhos 2217ee15d8aSGabor Juhos #define AR933X_RESET_REG_RESET_MODULE 0x1c 22204225e1dSGabor Juhos #define AR933X_RESET_REG_BOOTSTRAP 0xac 22304225e1dSGabor Juhos 224*8889612bSGabor Juhos #define AR934X_RESET_REG_BOOTSTRAP 0xb0 225*8889612bSGabor Juhos 226d2b4ac1eSGabor Juhos #define MISC_INT_ETHSW BIT(12) 227d2b4ac1eSGabor Juhos #define MISC_INT_TIMER4 BIT(10) 228d2b4ac1eSGabor Juhos #define MISC_INT_TIMER3 BIT(9) 229d2b4ac1eSGabor Juhos #define MISC_INT_TIMER2 BIT(8) 230d4a67d9dSGabor Juhos #define MISC_INT_DMA BIT(7) 231d4a67d9dSGabor Juhos #define MISC_INT_OHCI BIT(6) 232d4a67d9dSGabor Juhos #define MISC_INT_PERFC BIT(5) 233d4a67d9dSGabor Juhos #define MISC_INT_WDOG BIT(4) 234d4a67d9dSGabor Juhos #define MISC_INT_UART BIT(3) 235d4a67d9dSGabor Juhos #define MISC_INT_GPIO BIT(2) 236d4a67d9dSGabor Juhos #define MISC_INT_ERROR BIT(1) 237d4a67d9dSGabor Juhos #define MISC_INT_TIMER BIT(0) 238d4a67d9dSGabor Juhos 239d4a67d9dSGabor Juhos #define AR71XX_RESET_EXTERNAL BIT(28) 240d4a67d9dSGabor Juhos #define AR71XX_RESET_FULL_CHIP BIT(24) 241d4a67d9dSGabor Juhos #define AR71XX_RESET_CPU_NMI BIT(21) 242d4a67d9dSGabor Juhos #define AR71XX_RESET_CPU_COLD BIT(20) 243d4a67d9dSGabor Juhos #define AR71XX_RESET_DMA BIT(19) 244d4a67d9dSGabor Juhos #define AR71XX_RESET_SLIC BIT(18) 245d4a67d9dSGabor Juhos #define AR71XX_RESET_STEREO BIT(17) 246d4a67d9dSGabor Juhos #define AR71XX_RESET_DDR BIT(16) 247d4a67d9dSGabor Juhos #define AR71XX_RESET_GE1_MAC BIT(13) 248d4a67d9dSGabor Juhos #define AR71XX_RESET_GE1_PHY BIT(12) 249d4a67d9dSGabor Juhos #define AR71XX_RESET_USBSUS_OVERRIDE BIT(10) 250d4a67d9dSGabor Juhos #define AR71XX_RESET_GE0_MAC BIT(9) 251d4a67d9dSGabor Juhos #define AR71XX_RESET_GE0_PHY BIT(8) 252d4a67d9dSGabor Juhos #define AR71XX_RESET_USB_OHCI_DLL BIT(6) 253d4a67d9dSGabor Juhos #define AR71XX_RESET_USB_HOST BIT(5) 254d4a67d9dSGabor Juhos #define AR71XX_RESET_USB_PHY BIT(4) 255d4a67d9dSGabor Juhos #define AR71XX_RESET_PCI_BUS BIT(1) 256d4a67d9dSGabor Juhos #define AR71XX_RESET_PCI_CORE BIT(0) 257d4a67d9dSGabor Juhos 2587e98aa46SGabor Juhos #define AR7240_RESET_USB_HOST BIT(5) 2597e98aa46SGabor Juhos #define AR7240_RESET_OHCI_DLL BIT(3) 2607e98aa46SGabor Juhos 261d4a67d9dSGabor Juhos #define AR724X_RESET_GE1_MDIO BIT(23) 262d4a67d9dSGabor Juhos #define AR724X_RESET_GE0_MDIO BIT(22) 263d4a67d9dSGabor Juhos #define AR724X_RESET_PCIE_PHY_SERIAL BIT(10) 264d4a67d9dSGabor Juhos #define AR724X_RESET_PCIE_PHY BIT(7) 265d4a67d9dSGabor Juhos #define AR724X_RESET_PCIE BIT(6) 2667e98aa46SGabor Juhos #define AR724X_RESET_USB_HOST BIT(5) 2677e98aa46SGabor Juhos #define AR724X_RESET_USB_PHY BIT(4) 2687e98aa46SGabor Juhos #define AR724X_RESET_USBSUS_OVERRIDE BIT(3) 269d4a67d9dSGabor Juhos 270d4a67d9dSGabor Juhos #define AR913X_RESET_AMBA2WMAC BIT(22) 2717e98aa46SGabor Juhos #define AR913X_RESET_USBSUS_OVERRIDE BIT(10) 2727e98aa46SGabor Juhos #define AR913X_RESET_USB_HOST BIT(5) 2737e98aa46SGabor Juhos #define AR913X_RESET_USB_PHY BIT(4) 274d4a67d9dSGabor Juhos 27534cfcd26SGabor Juhos #define AR933X_RESET_WMAC BIT(11) 276c279b775SGabor Juhos #define AR933X_RESET_USB_HOST BIT(5) 277c279b775SGabor Juhos #define AR933X_RESET_USB_PHY BIT(4) 278c279b775SGabor Juhos #define AR933X_RESET_USBSUS_OVERRIDE BIT(3) 279c279b775SGabor Juhos 28004225e1dSGabor Juhos #define AR933X_BOOTSTRAP_REF_CLK_40 BIT(0) 28104225e1dSGabor Juhos 282*8889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION8 BIT(23) 283*8889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION7 BIT(22) 284*8889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION6 BIT(21) 285*8889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION5 BIT(20) 286*8889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION4 BIT(19) 287*8889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION3 BIT(18) 288*8889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION2 BIT(17) 289*8889612bSGabor Juhos #define AR934X_BOOTSTRAP_SW_OPTION1 BIT(16) 290*8889612bSGabor Juhos #define AR934X_BOOTSTRAP_USB_MODE_DEVICE BIT(7) 291*8889612bSGabor Juhos #define AR934X_BOOTSTRAP_PCIE_RC BIT(6) 292*8889612bSGabor Juhos #define AR934X_BOOTSTRAP_EJTAG_MODE BIT(5) 293*8889612bSGabor Juhos #define AR934X_BOOTSTRAP_REF_CLK_40 BIT(4) 294*8889612bSGabor Juhos #define AR934X_BOOTSTRAP_BOOT_FROM_SPI BIT(2) 295*8889612bSGabor Juhos #define AR934X_BOOTSTRAP_SDRAM_DISABLED BIT(1) 296*8889612bSGabor Juhos #define AR934X_BOOTSTRAP_DDR1 BIT(0) 297*8889612bSGabor Juhos 298d4a67d9dSGabor Juhos #define REV_ID_MAJOR_MASK 0xfff0 299d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR71XX 0x00a0 300d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR913X 0x00b0 301d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR7240 0x00c0 302d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR7241 0x0100 303d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR7242 0x1100 3046d1c8fdeSGabor Juhos #define REV_ID_MAJOR_AR9330 0x0110 3056d1c8fdeSGabor Juhos #define REV_ID_MAJOR_AR9331 0x1110 306703327ddSGabor Juhos #define REV_ID_MAJOR_AR9341 0x0120 307703327ddSGabor Juhos #define REV_ID_MAJOR_AR9342 0x1120 308703327ddSGabor Juhos #define REV_ID_MAJOR_AR9344 0x2120 309d4a67d9dSGabor Juhos 310d4a67d9dSGabor Juhos #define AR71XX_REV_ID_MINOR_MASK 0x3 311d4a67d9dSGabor Juhos #define AR71XX_REV_ID_MINOR_AR7130 0x0 312d4a67d9dSGabor Juhos #define AR71XX_REV_ID_MINOR_AR7141 0x1 313d4a67d9dSGabor Juhos #define AR71XX_REV_ID_MINOR_AR7161 0x2 314d4a67d9dSGabor Juhos #define AR71XX_REV_ID_REVISION_MASK 0x3 315d4a67d9dSGabor Juhos #define AR71XX_REV_ID_REVISION_SHIFT 2 316d4a67d9dSGabor Juhos 317d4a67d9dSGabor Juhos #define AR913X_REV_ID_MINOR_MASK 0x3 318d4a67d9dSGabor Juhos #define AR913X_REV_ID_MINOR_AR9130 0x0 319d4a67d9dSGabor Juhos #define AR913X_REV_ID_MINOR_AR9132 0x1 320d4a67d9dSGabor Juhos #define AR913X_REV_ID_REVISION_MASK 0x3 321d4a67d9dSGabor Juhos #define AR913X_REV_ID_REVISION_SHIFT 2 322d4a67d9dSGabor Juhos 3236d1c8fdeSGabor Juhos #define AR933X_REV_ID_REVISION_MASK 0x3 3246d1c8fdeSGabor Juhos 325d4a67d9dSGabor Juhos #define AR724X_REV_ID_REVISION_MASK 0x3 326d4a67d9dSGabor Juhos 327d8411466SGabor Juhos #define AR934X_REV_ID_REVISION_MASK 0xf 328d8411466SGabor Juhos 329d4a67d9dSGabor Juhos /* 330d4a67d9dSGabor Juhos * SPI block 331d4a67d9dSGabor Juhos */ 332d4a67d9dSGabor Juhos #define AR71XX_SPI_REG_FS 0x00 /* Function Select */ 333d4a67d9dSGabor Juhos #define AR71XX_SPI_REG_CTRL 0x04 /* SPI Control */ 334d4a67d9dSGabor Juhos #define AR71XX_SPI_REG_IOC 0x08 /* SPI I/O Control */ 335d4a67d9dSGabor Juhos #define AR71XX_SPI_REG_RDS 0x0c /* Read Data Shift */ 336d4a67d9dSGabor Juhos 337d4a67d9dSGabor Juhos #define AR71XX_SPI_FS_GPIO BIT(0) /* Enable GPIO mode */ 338d4a67d9dSGabor Juhos 339d4a67d9dSGabor Juhos #define AR71XX_SPI_CTRL_RD BIT(6) /* Remap Disable */ 340d4a67d9dSGabor Juhos #define AR71XX_SPI_CTRL_DIV_MASK 0x3f 341d4a67d9dSGabor Juhos 342d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_DO BIT(0) /* Data Out pin */ 343d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CLK BIT(8) /* CLK pin */ 344d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS(n) BIT(16 + (n)) 345d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS0 AR71XX_SPI_IOC_CS(0) 346d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS1 AR71XX_SPI_IOC_CS(1) 347d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS2 AR71XX_SPI_IOC_CS(2) 348d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS_ALL (AR71XX_SPI_IOC_CS0 | AR71XX_SPI_IOC_CS1 | \ 349d4a67d9dSGabor Juhos AR71XX_SPI_IOC_CS2) 350d4a67d9dSGabor Juhos 3516eae43c5SGabor Juhos /* 3526eae43c5SGabor Juhos * GPIO block 3536eae43c5SGabor Juhos */ 3546eae43c5SGabor Juhos #define AR71XX_GPIO_REG_OE 0x00 3556eae43c5SGabor Juhos #define AR71XX_GPIO_REG_IN 0x04 3566eae43c5SGabor Juhos #define AR71XX_GPIO_REG_OUT 0x08 3576eae43c5SGabor Juhos #define AR71XX_GPIO_REG_SET 0x0c 3586eae43c5SGabor Juhos #define AR71XX_GPIO_REG_CLEAR 0x10 3596eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_MODE 0x14 3606eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_TYPE 0x18 3616eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_POLARITY 0x1c 3626eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_PENDING 0x20 3636eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_ENABLE 0x24 3646eae43c5SGabor Juhos #define AR71XX_GPIO_REG_FUNC 0x28 3656eae43c5SGabor Juhos 3666eae43c5SGabor Juhos #define AR71XX_GPIO_COUNT 16 3676eae43c5SGabor Juhos #define AR724X_GPIO_COUNT 18 3686eae43c5SGabor Juhos #define AR913X_GPIO_COUNT 22 369fdfbcf47SGabor Juhos #define AR933X_GPIO_COUNT 30 3706eae43c5SGabor Juhos 371d4a67d9dSGabor Juhos #endif /* __ASM_MACH_AR71XX_REGS_H */ 372