1d4a67d9dSGabor Juhos /* 2d4a67d9dSGabor Juhos * Atheros AR71XX/AR724X/AR913X SoC register definitions 3d4a67d9dSGabor Juhos * 4*703327ddSGabor 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 * 8*703327ddSGabor 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 154d4a67d9dSGabor Juhos /* 1557e98aa46SGabor Juhos * USB_CONFIG block 1567e98aa46SGabor Juhos */ 1577e98aa46SGabor Juhos #define AR71XX_USB_CTRL_REG_FLADJ 0x00 1587e98aa46SGabor Juhos #define AR71XX_USB_CTRL_REG_CONFIG 0x04 1597e98aa46SGabor Juhos 1607e98aa46SGabor Juhos /* 161d4a67d9dSGabor Juhos * RESET block 162d4a67d9dSGabor Juhos */ 163d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_TIMER 0x00 164d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_TIMER_RELOAD 0x04 165d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_WDOG_CTRL 0x08 166d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_WDOG 0x0c 167d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_MISC_INT_STATUS 0x10 168d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_MISC_INT_ENABLE 0x14 169d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PCI_INT_STATUS 0x18 170d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PCI_INT_ENABLE 0x1c 171d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_GLOBAL_INT_STATUS 0x20 172d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_RESET_MODULE 0x24 173d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PERFC_CTRL 0x2c 174d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PERFC0 0x30 175d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_PERFC1 0x34 176d4a67d9dSGabor Juhos #define AR71XX_RESET_REG_REV_ID 0x90 177d4a67d9dSGabor Juhos 178d4a67d9dSGabor Juhos #define AR913X_RESET_REG_GLOBAL_INT_STATUS 0x18 179d4a67d9dSGabor Juhos #define AR913X_RESET_REG_RESET_MODULE 0x1c 180d4a67d9dSGabor Juhos #define AR913X_RESET_REG_PERF_CTRL 0x20 181d4a67d9dSGabor Juhos #define AR913X_RESET_REG_PERFC0 0x24 182d4a67d9dSGabor Juhos #define AR913X_RESET_REG_PERFC1 0x28 183d4a67d9dSGabor Juhos 184d4a67d9dSGabor Juhos #define AR724X_RESET_REG_RESET_MODULE 0x1c 185d4a67d9dSGabor Juhos 1867ee15d8aSGabor Juhos #define AR933X_RESET_REG_RESET_MODULE 0x1c 18704225e1dSGabor Juhos #define AR933X_RESET_REG_BOOTSTRAP 0xac 18804225e1dSGabor Juhos 189d2b4ac1eSGabor Juhos #define MISC_INT_ETHSW BIT(12) 190d2b4ac1eSGabor Juhos #define MISC_INT_TIMER4 BIT(10) 191d2b4ac1eSGabor Juhos #define MISC_INT_TIMER3 BIT(9) 192d2b4ac1eSGabor Juhos #define MISC_INT_TIMER2 BIT(8) 193d4a67d9dSGabor Juhos #define MISC_INT_DMA BIT(7) 194d4a67d9dSGabor Juhos #define MISC_INT_OHCI BIT(6) 195d4a67d9dSGabor Juhos #define MISC_INT_PERFC BIT(5) 196d4a67d9dSGabor Juhos #define MISC_INT_WDOG BIT(4) 197d4a67d9dSGabor Juhos #define MISC_INT_UART BIT(3) 198d4a67d9dSGabor Juhos #define MISC_INT_GPIO BIT(2) 199d4a67d9dSGabor Juhos #define MISC_INT_ERROR BIT(1) 200d4a67d9dSGabor Juhos #define MISC_INT_TIMER BIT(0) 201d4a67d9dSGabor Juhos 202d4a67d9dSGabor Juhos #define AR71XX_RESET_EXTERNAL BIT(28) 203d4a67d9dSGabor Juhos #define AR71XX_RESET_FULL_CHIP BIT(24) 204d4a67d9dSGabor Juhos #define AR71XX_RESET_CPU_NMI BIT(21) 205d4a67d9dSGabor Juhos #define AR71XX_RESET_CPU_COLD BIT(20) 206d4a67d9dSGabor Juhos #define AR71XX_RESET_DMA BIT(19) 207d4a67d9dSGabor Juhos #define AR71XX_RESET_SLIC BIT(18) 208d4a67d9dSGabor Juhos #define AR71XX_RESET_STEREO BIT(17) 209d4a67d9dSGabor Juhos #define AR71XX_RESET_DDR BIT(16) 210d4a67d9dSGabor Juhos #define AR71XX_RESET_GE1_MAC BIT(13) 211d4a67d9dSGabor Juhos #define AR71XX_RESET_GE1_PHY BIT(12) 212d4a67d9dSGabor Juhos #define AR71XX_RESET_USBSUS_OVERRIDE BIT(10) 213d4a67d9dSGabor Juhos #define AR71XX_RESET_GE0_MAC BIT(9) 214d4a67d9dSGabor Juhos #define AR71XX_RESET_GE0_PHY BIT(8) 215d4a67d9dSGabor Juhos #define AR71XX_RESET_USB_OHCI_DLL BIT(6) 216d4a67d9dSGabor Juhos #define AR71XX_RESET_USB_HOST BIT(5) 217d4a67d9dSGabor Juhos #define AR71XX_RESET_USB_PHY BIT(4) 218d4a67d9dSGabor Juhos #define AR71XX_RESET_PCI_BUS BIT(1) 219d4a67d9dSGabor Juhos #define AR71XX_RESET_PCI_CORE BIT(0) 220d4a67d9dSGabor Juhos 2217e98aa46SGabor Juhos #define AR7240_RESET_USB_HOST BIT(5) 2227e98aa46SGabor Juhos #define AR7240_RESET_OHCI_DLL BIT(3) 2237e98aa46SGabor Juhos 224d4a67d9dSGabor Juhos #define AR724X_RESET_GE1_MDIO BIT(23) 225d4a67d9dSGabor Juhos #define AR724X_RESET_GE0_MDIO BIT(22) 226d4a67d9dSGabor Juhos #define AR724X_RESET_PCIE_PHY_SERIAL BIT(10) 227d4a67d9dSGabor Juhos #define AR724X_RESET_PCIE_PHY BIT(7) 228d4a67d9dSGabor Juhos #define AR724X_RESET_PCIE BIT(6) 2297e98aa46SGabor Juhos #define AR724X_RESET_USB_HOST BIT(5) 2307e98aa46SGabor Juhos #define AR724X_RESET_USB_PHY BIT(4) 2317e98aa46SGabor Juhos #define AR724X_RESET_USBSUS_OVERRIDE BIT(3) 232d4a67d9dSGabor Juhos 233d4a67d9dSGabor Juhos #define AR913X_RESET_AMBA2WMAC BIT(22) 2347e98aa46SGabor Juhos #define AR913X_RESET_USBSUS_OVERRIDE BIT(10) 2357e98aa46SGabor Juhos #define AR913X_RESET_USB_HOST BIT(5) 2367e98aa46SGabor Juhos #define AR913X_RESET_USB_PHY BIT(4) 237d4a67d9dSGabor Juhos 23834cfcd26SGabor Juhos #define AR933X_RESET_WMAC BIT(11) 239c279b775SGabor Juhos #define AR933X_RESET_USB_HOST BIT(5) 240c279b775SGabor Juhos #define AR933X_RESET_USB_PHY BIT(4) 241c279b775SGabor Juhos #define AR933X_RESET_USBSUS_OVERRIDE BIT(3) 242c279b775SGabor Juhos 24304225e1dSGabor Juhos #define AR933X_BOOTSTRAP_REF_CLK_40 BIT(0) 24404225e1dSGabor Juhos 245d4a67d9dSGabor Juhos #define REV_ID_MAJOR_MASK 0xfff0 246d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR71XX 0x00a0 247d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR913X 0x00b0 248d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR7240 0x00c0 249d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR7241 0x0100 250d4a67d9dSGabor Juhos #define REV_ID_MAJOR_AR7242 0x1100 2516d1c8fdeSGabor Juhos #define REV_ID_MAJOR_AR9330 0x0110 2526d1c8fdeSGabor Juhos #define REV_ID_MAJOR_AR9331 0x1110 253*703327ddSGabor Juhos #define REV_ID_MAJOR_AR9341 0x0120 254*703327ddSGabor Juhos #define REV_ID_MAJOR_AR9342 0x1120 255*703327ddSGabor Juhos #define REV_ID_MAJOR_AR9344 0x2120 256d4a67d9dSGabor Juhos 257d4a67d9dSGabor Juhos #define AR71XX_REV_ID_MINOR_MASK 0x3 258d4a67d9dSGabor Juhos #define AR71XX_REV_ID_MINOR_AR7130 0x0 259d4a67d9dSGabor Juhos #define AR71XX_REV_ID_MINOR_AR7141 0x1 260d4a67d9dSGabor Juhos #define AR71XX_REV_ID_MINOR_AR7161 0x2 261d4a67d9dSGabor Juhos #define AR71XX_REV_ID_REVISION_MASK 0x3 262d4a67d9dSGabor Juhos #define AR71XX_REV_ID_REVISION_SHIFT 2 263d4a67d9dSGabor Juhos 264d4a67d9dSGabor Juhos #define AR913X_REV_ID_MINOR_MASK 0x3 265d4a67d9dSGabor Juhos #define AR913X_REV_ID_MINOR_AR9130 0x0 266d4a67d9dSGabor Juhos #define AR913X_REV_ID_MINOR_AR9132 0x1 267d4a67d9dSGabor Juhos #define AR913X_REV_ID_REVISION_MASK 0x3 268d4a67d9dSGabor Juhos #define AR913X_REV_ID_REVISION_SHIFT 2 269d4a67d9dSGabor Juhos 2706d1c8fdeSGabor Juhos #define AR933X_REV_ID_REVISION_MASK 0x3 2716d1c8fdeSGabor Juhos 272d4a67d9dSGabor Juhos #define AR724X_REV_ID_REVISION_MASK 0x3 273d4a67d9dSGabor Juhos 274d4a67d9dSGabor Juhos /* 275d4a67d9dSGabor Juhos * SPI block 276d4a67d9dSGabor Juhos */ 277d4a67d9dSGabor Juhos #define AR71XX_SPI_REG_FS 0x00 /* Function Select */ 278d4a67d9dSGabor Juhos #define AR71XX_SPI_REG_CTRL 0x04 /* SPI Control */ 279d4a67d9dSGabor Juhos #define AR71XX_SPI_REG_IOC 0x08 /* SPI I/O Control */ 280d4a67d9dSGabor Juhos #define AR71XX_SPI_REG_RDS 0x0c /* Read Data Shift */ 281d4a67d9dSGabor Juhos 282d4a67d9dSGabor Juhos #define AR71XX_SPI_FS_GPIO BIT(0) /* Enable GPIO mode */ 283d4a67d9dSGabor Juhos 284d4a67d9dSGabor Juhos #define AR71XX_SPI_CTRL_RD BIT(6) /* Remap Disable */ 285d4a67d9dSGabor Juhos #define AR71XX_SPI_CTRL_DIV_MASK 0x3f 286d4a67d9dSGabor Juhos 287d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_DO BIT(0) /* Data Out pin */ 288d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CLK BIT(8) /* CLK pin */ 289d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS(n) BIT(16 + (n)) 290d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS0 AR71XX_SPI_IOC_CS(0) 291d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS1 AR71XX_SPI_IOC_CS(1) 292d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS2 AR71XX_SPI_IOC_CS(2) 293d4a67d9dSGabor Juhos #define AR71XX_SPI_IOC_CS_ALL (AR71XX_SPI_IOC_CS0 | AR71XX_SPI_IOC_CS1 | \ 294d4a67d9dSGabor Juhos AR71XX_SPI_IOC_CS2) 295d4a67d9dSGabor Juhos 2966eae43c5SGabor Juhos /* 2976eae43c5SGabor Juhos * GPIO block 2986eae43c5SGabor Juhos */ 2996eae43c5SGabor Juhos #define AR71XX_GPIO_REG_OE 0x00 3006eae43c5SGabor Juhos #define AR71XX_GPIO_REG_IN 0x04 3016eae43c5SGabor Juhos #define AR71XX_GPIO_REG_OUT 0x08 3026eae43c5SGabor Juhos #define AR71XX_GPIO_REG_SET 0x0c 3036eae43c5SGabor Juhos #define AR71XX_GPIO_REG_CLEAR 0x10 3046eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_MODE 0x14 3056eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_TYPE 0x18 3066eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_POLARITY 0x1c 3076eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_PENDING 0x20 3086eae43c5SGabor Juhos #define AR71XX_GPIO_REG_INT_ENABLE 0x24 3096eae43c5SGabor Juhos #define AR71XX_GPIO_REG_FUNC 0x28 3106eae43c5SGabor Juhos 3116eae43c5SGabor Juhos #define AR71XX_GPIO_COUNT 16 3126eae43c5SGabor Juhos #define AR724X_GPIO_COUNT 18 3136eae43c5SGabor Juhos #define AR913X_GPIO_COUNT 22 314fdfbcf47SGabor Juhos #define AR933X_GPIO_COUNT 30 3156eae43c5SGabor Juhos 316d4a67d9dSGabor Juhos #endif /* __ASM_MACH_AR71XX_REGS_H */ 317