19fc4831cSPete Zaitcev /* 29fc4831cSPete Zaitcev * NetChip 2280 high/full speed USB device controller. 39fc4831cSPete Zaitcev * Unlike many such controllers, this one talks PCI. 4dda43a0eSRobert P. J. Day * 59fc4831cSPete Zaitcev * Copyright (C) 2002 NetChip Technology, Inc. (http://www.netchip.com) 69fc4831cSPete Zaitcev * Copyright (C) 2003 David Brownell 79fc4831cSPete Zaitcev * 89fc4831cSPete Zaitcev * This program is free software; you can redistribute it and/or modify 99fc4831cSPete Zaitcev * it under the terms of the GNU General Public License as published by 109fc4831cSPete Zaitcev * the Free Software Foundation; either version 2 of the License, or 119fc4831cSPete Zaitcev * (at your option) any later version. 129fc4831cSPete Zaitcev * 139fc4831cSPete Zaitcev * This program is distributed in the hope that it will be useful, 149fc4831cSPete Zaitcev * but WITHOUT ANY WARRANTY; without even the implied warranty of 159fc4831cSPete Zaitcev * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 169fc4831cSPete Zaitcev * GNU General Public License for more details. 179fc4831cSPete Zaitcev * 189fc4831cSPete Zaitcev * You should have received a copy of the GNU General Public License 199fc4831cSPete Zaitcev * along with this program; if not, write to the Free Software 209fc4831cSPete Zaitcev * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 219fc4831cSPete Zaitcev */ 229fc4831cSPete Zaitcev 23dda43a0eSRobert P. J. Day #ifndef __LINUX_USB_NET2280_H 24dda43a0eSRobert P. J. Day #define __LINUX_USB_NET2280_H 25dda43a0eSRobert P. J. Day 269fc4831cSPete Zaitcev /*-------------------------------------------------------------------------*/ 279fc4831cSPete Zaitcev 289fc4831cSPete Zaitcev /* NET2280 MEMORY MAPPED REGISTERS 299fc4831cSPete Zaitcev * 309fc4831cSPete Zaitcev * The register layout came from the chip documentation, and the bit 319fc4831cSPete Zaitcev * number definitions were extracted from chip specification. 329fc4831cSPete Zaitcev * 339fc4831cSPete Zaitcev * Use the shift operator ('<<') to build bit masks, with readl/writel 349fc4831cSPete Zaitcev * to access the registers through PCI. 359fc4831cSPete Zaitcev */ 369fc4831cSPete Zaitcev 379fc4831cSPete Zaitcev /* main registers, BAR0 + 0x0000 */ 389fc4831cSPete Zaitcev struct net2280_regs { 3941dceed5SGreg Kroah-Hartman /* offset 0x0000 */ 409fc4831cSPete Zaitcev u32 devinit; 419fc4831cSPete Zaitcev #define LOCAL_CLOCK_FREQUENCY 8 429fc4831cSPete Zaitcev #define FORCE_PCI_RESET 7 439fc4831cSPete Zaitcev #define PCI_ID 6 449fc4831cSPete Zaitcev #define PCI_ENABLE 5 459fc4831cSPete Zaitcev #define FIFO_SOFT_RESET 4 469fc4831cSPete Zaitcev #define CFG_SOFT_RESET 3 479fc4831cSPete Zaitcev #define PCI_SOFT_RESET 2 489fc4831cSPete Zaitcev #define USB_SOFT_RESET 1 499fc4831cSPete Zaitcev #define M8051_RESET 0 509fc4831cSPete Zaitcev u32 eectl; 519fc4831cSPete Zaitcev #define EEPROM_ADDRESS_WIDTH 23 529fc4831cSPete Zaitcev #define EEPROM_CHIP_SELECT_ACTIVE 22 539fc4831cSPete Zaitcev #define EEPROM_PRESENT 21 549fc4831cSPete Zaitcev #define EEPROM_VALID 20 559fc4831cSPete Zaitcev #define EEPROM_BUSY 19 569fc4831cSPete Zaitcev #define EEPROM_CHIP_SELECT_ENABLE 18 579fc4831cSPete Zaitcev #define EEPROM_BYTE_READ_START 17 589fc4831cSPete Zaitcev #define EEPROM_BYTE_WRITE_START 16 599fc4831cSPete Zaitcev #define EEPROM_READ_DATA 8 609fc4831cSPete Zaitcev #define EEPROM_WRITE_DATA 0 619fc4831cSPete Zaitcev u32 eeclkfreq; 629fc4831cSPete Zaitcev u32 _unused0; 6341dceed5SGreg Kroah-Hartman /* offset 0x0010 */ 649fc4831cSPete Zaitcev 659fc4831cSPete Zaitcev u32 pciirqenb0; /* interrupt PCI master ... */ 669fc4831cSPete Zaitcev #define SETUP_PACKET_INTERRUPT_ENABLE 7 679fc4831cSPete Zaitcev #define ENDPOINT_F_INTERRUPT_ENABLE 6 689fc4831cSPete Zaitcev #define ENDPOINT_E_INTERRUPT_ENABLE 5 699fc4831cSPete Zaitcev #define ENDPOINT_D_INTERRUPT_ENABLE 4 709fc4831cSPete Zaitcev #define ENDPOINT_C_INTERRUPT_ENABLE 3 719fc4831cSPete Zaitcev #define ENDPOINT_B_INTERRUPT_ENABLE 2 729fc4831cSPete Zaitcev #define ENDPOINT_A_INTERRUPT_ENABLE 1 739fc4831cSPete Zaitcev #define ENDPOINT_0_INTERRUPT_ENABLE 0 749fc4831cSPete Zaitcev u32 pciirqenb1; 759fc4831cSPete Zaitcev #define PCI_INTERRUPT_ENABLE 31 769fc4831cSPete Zaitcev #define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27 779fc4831cSPete Zaitcev #define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26 789fc4831cSPete Zaitcev #define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25 799fc4831cSPete Zaitcev #define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20 809fc4831cSPete Zaitcev #define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19 819fc4831cSPete Zaitcev #define PCI_TARGET_ABORT_ASSERTED_INTERRUPT_ENABLE 18 829fc4831cSPete Zaitcev #define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17 839fc4831cSPete Zaitcev #define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16 849fc4831cSPete Zaitcev #define GPIO_INTERRUPT_ENABLE 13 859fc4831cSPete Zaitcev #define DMA_D_INTERRUPT_ENABLE 12 869fc4831cSPete Zaitcev #define DMA_C_INTERRUPT_ENABLE 11 879fc4831cSPete Zaitcev #define DMA_B_INTERRUPT_ENABLE 10 889fc4831cSPete Zaitcev #define DMA_A_INTERRUPT_ENABLE 9 899fc4831cSPete Zaitcev #define EEPROM_DONE_INTERRUPT_ENABLE 8 909fc4831cSPete Zaitcev #define VBUS_INTERRUPT_ENABLE 7 919fc4831cSPete Zaitcev #define CONTROL_STATUS_INTERRUPT_ENABLE 6 929fc4831cSPete Zaitcev #define ROOT_PORT_RESET_INTERRUPT_ENABLE 4 939fc4831cSPete Zaitcev #define SUSPEND_REQUEST_INTERRUPT_ENABLE 3 949fc4831cSPete Zaitcev #define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2 959fc4831cSPete Zaitcev #define RESUME_INTERRUPT_ENABLE 1 969fc4831cSPete Zaitcev #define SOF_INTERRUPT_ENABLE 0 979fc4831cSPete Zaitcev u32 cpu_irqenb0; /* ... or onboard 8051 */ 989fc4831cSPete Zaitcev #define SETUP_PACKET_INTERRUPT_ENABLE 7 999fc4831cSPete Zaitcev #define ENDPOINT_F_INTERRUPT_ENABLE 6 1009fc4831cSPete Zaitcev #define ENDPOINT_E_INTERRUPT_ENABLE 5 1019fc4831cSPete Zaitcev #define ENDPOINT_D_INTERRUPT_ENABLE 4 1029fc4831cSPete Zaitcev #define ENDPOINT_C_INTERRUPT_ENABLE 3 1039fc4831cSPete Zaitcev #define ENDPOINT_B_INTERRUPT_ENABLE 2 1049fc4831cSPete Zaitcev #define ENDPOINT_A_INTERRUPT_ENABLE 1 1059fc4831cSPete Zaitcev #define ENDPOINT_0_INTERRUPT_ENABLE 0 1069fc4831cSPete Zaitcev u32 cpu_irqenb1; 1079fc4831cSPete Zaitcev #define CPU_INTERRUPT_ENABLE 31 1089fc4831cSPete Zaitcev #define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27 1099fc4831cSPete Zaitcev #define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26 1109fc4831cSPete Zaitcev #define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25 1119fc4831cSPete Zaitcev #define PCI_INTA_INTERRUPT_ENABLE 24 1129fc4831cSPete Zaitcev #define PCI_PME_INTERRUPT_ENABLE 23 1139fc4831cSPete Zaitcev #define PCI_SERR_INTERRUPT_ENABLE 22 1149fc4831cSPete Zaitcev #define PCI_PERR_INTERRUPT_ENABLE 21 1159fc4831cSPete Zaitcev #define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20 1169fc4831cSPete Zaitcev #define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19 1179fc4831cSPete Zaitcev #define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17 1189fc4831cSPete Zaitcev #define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16 1199fc4831cSPete Zaitcev #define GPIO_INTERRUPT_ENABLE 13 1209fc4831cSPete Zaitcev #define DMA_D_INTERRUPT_ENABLE 12 1219fc4831cSPete Zaitcev #define DMA_C_INTERRUPT_ENABLE 11 1229fc4831cSPete Zaitcev #define DMA_B_INTERRUPT_ENABLE 10 1239fc4831cSPete Zaitcev #define DMA_A_INTERRUPT_ENABLE 9 1249fc4831cSPete Zaitcev #define EEPROM_DONE_INTERRUPT_ENABLE 8 1259fc4831cSPete Zaitcev #define VBUS_INTERRUPT_ENABLE 7 1269fc4831cSPete Zaitcev #define CONTROL_STATUS_INTERRUPT_ENABLE 6 1279fc4831cSPete Zaitcev #define ROOT_PORT_RESET_INTERRUPT_ENABLE 4 1289fc4831cSPete Zaitcev #define SUSPEND_REQUEST_INTERRUPT_ENABLE 3 1299fc4831cSPete Zaitcev #define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2 1309fc4831cSPete Zaitcev #define RESUME_INTERRUPT_ENABLE 1 1319fc4831cSPete Zaitcev #define SOF_INTERRUPT_ENABLE 0 1329fc4831cSPete Zaitcev 13341dceed5SGreg Kroah-Hartman /* offset 0x0020 */ 1349fc4831cSPete Zaitcev u32 _unused1; 1359fc4831cSPete Zaitcev u32 usbirqenb1; 1369fc4831cSPete Zaitcev #define USB_INTERRUPT_ENABLE 31 1379fc4831cSPete Zaitcev #define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27 1389fc4831cSPete Zaitcev #define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26 1399fc4831cSPete Zaitcev #define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25 1409fc4831cSPete Zaitcev #define PCI_INTA_INTERRUPT_ENABLE 24 1419fc4831cSPete Zaitcev #define PCI_PME_INTERRUPT_ENABLE 23 1429fc4831cSPete Zaitcev #define PCI_SERR_INTERRUPT_ENABLE 22 1439fc4831cSPete Zaitcev #define PCI_PERR_INTERRUPT_ENABLE 21 1449fc4831cSPete Zaitcev #define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20 1459fc4831cSPete Zaitcev #define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19 1469fc4831cSPete Zaitcev #define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17 1479fc4831cSPete Zaitcev #define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16 1489fc4831cSPete Zaitcev #define GPIO_INTERRUPT_ENABLE 13 1499fc4831cSPete Zaitcev #define DMA_D_INTERRUPT_ENABLE 12 1509fc4831cSPete Zaitcev #define DMA_C_INTERRUPT_ENABLE 11 1519fc4831cSPete Zaitcev #define DMA_B_INTERRUPT_ENABLE 10 1529fc4831cSPete Zaitcev #define DMA_A_INTERRUPT_ENABLE 9 1539fc4831cSPete Zaitcev #define EEPROM_DONE_INTERRUPT_ENABLE 8 1549fc4831cSPete Zaitcev #define VBUS_INTERRUPT_ENABLE 7 1559fc4831cSPete Zaitcev #define CONTROL_STATUS_INTERRUPT_ENABLE 6 1569fc4831cSPete Zaitcev #define ROOT_PORT_RESET_INTERRUPT_ENABLE 4 1579fc4831cSPete Zaitcev #define SUSPEND_REQUEST_INTERRUPT_ENABLE 3 1589fc4831cSPete Zaitcev #define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2 1599fc4831cSPete Zaitcev #define RESUME_INTERRUPT_ENABLE 1 1609fc4831cSPete Zaitcev #define SOF_INTERRUPT_ENABLE 0 1619fc4831cSPete Zaitcev u32 irqstat0; 1629fc4831cSPete Zaitcev #define INTA_ASSERTED 12 1639fc4831cSPete Zaitcev #define SETUP_PACKET_INTERRUPT 7 1649fc4831cSPete Zaitcev #define ENDPOINT_F_INTERRUPT 6 1659fc4831cSPete Zaitcev #define ENDPOINT_E_INTERRUPT 5 1669fc4831cSPete Zaitcev #define ENDPOINT_D_INTERRUPT 4 1679fc4831cSPete Zaitcev #define ENDPOINT_C_INTERRUPT 3 1689fc4831cSPete Zaitcev #define ENDPOINT_B_INTERRUPT 2 1699fc4831cSPete Zaitcev #define ENDPOINT_A_INTERRUPT 1 1709fc4831cSPete Zaitcev #define ENDPOINT_0_INTERRUPT 0 171a09e23f5SMian Yousaf Kaukab #define USB3380_IRQSTAT0_EP_INTR_MASK_IN (0xF << 17) 172a09e23f5SMian Yousaf Kaukab #define USB3380_IRQSTAT0_EP_INTR_MASK_OUT (0xF << 1) 173a09e23f5SMian Yousaf Kaukab 1749fc4831cSPete Zaitcev u32 irqstat1; 1759fc4831cSPete Zaitcev #define POWER_STATE_CHANGE_INTERRUPT 27 1769fc4831cSPete Zaitcev #define PCI_ARBITER_TIMEOUT_INTERRUPT 26 1779fc4831cSPete Zaitcev #define PCI_PARITY_ERROR_INTERRUPT 25 1789fc4831cSPete Zaitcev #define PCI_INTA_INTERRUPT 24 1799fc4831cSPete Zaitcev #define PCI_PME_INTERRUPT 23 1809fc4831cSPete Zaitcev #define PCI_SERR_INTERRUPT 22 1819fc4831cSPete Zaitcev #define PCI_PERR_INTERRUPT 21 1829fc4831cSPete Zaitcev #define PCI_MASTER_ABORT_RECEIVED_INTERRUPT 20 1839fc4831cSPete Zaitcev #define PCI_TARGET_ABORT_RECEIVED_INTERRUPT 19 1849fc4831cSPete Zaitcev #define PCI_RETRY_ABORT_INTERRUPT 17 1859fc4831cSPete Zaitcev #define PCI_MASTER_CYCLE_DONE_INTERRUPT 16 1869fc4831cSPete Zaitcev #define SOF_DOWN_INTERRUPT 14 1879fc4831cSPete Zaitcev #define GPIO_INTERRUPT 13 1889fc4831cSPete Zaitcev #define DMA_D_INTERRUPT 12 1899fc4831cSPete Zaitcev #define DMA_C_INTERRUPT 11 1909fc4831cSPete Zaitcev #define DMA_B_INTERRUPT 10 1919fc4831cSPete Zaitcev #define DMA_A_INTERRUPT 9 1929fc4831cSPete Zaitcev #define EEPROM_DONE_INTERRUPT 8 1939fc4831cSPete Zaitcev #define VBUS_INTERRUPT 7 1949fc4831cSPete Zaitcev #define CONTROL_STATUS_INTERRUPT 6 1959fc4831cSPete Zaitcev #define ROOT_PORT_RESET_INTERRUPT 4 1969fc4831cSPete Zaitcev #define SUSPEND_REQUEST_INTERRUPT 3 1979fc4831cSPete Zaitcev #define SUSPEND_REQUEST_CHANGE_INTERRUPT 2 1989fc4831cSPete Zaitcev #define RESUME_INTERRUPT 1 1999fc4831cSPete Zaitcev #define SOF_INTERRUPT 0 20041dceed5SGreg Kroah-Hartman /* offset 0x0030 */ 2019fc4831cSPete Zaitcev u32 idxaddr; 2029fc4831cSPete Zaitcev u32 idxdata; 2039fc4831cSPete Zaitcev u32 fifoctl; 2049fc4831cSPete Zaitcev #define PCI_BASE2_RANGE 16 2059fc4831cSPete Zaitcev #define IGNORE_FIFO_AVAILABILITY 3 2069fc4831cSPete Zaitcev #define PCI_BASE2_SELECT 2 2079fc4831cSPete Zaitcev #define FIFO_CONFIGURATION_SELECT 0 2089fc4831cSPete Zaitcev u32 _unused2; 20941dceed5SGreg Kroah-Hartman /* offset 0x0040 */ 2109fc4831cSPete Zaitcev u32 memaddr; 2119fc4831cSPete Zaitcev #define START 28 2129fc4831cSPete Zaitcev #define DIRECTION 27 2139fc4831cSPete Zaitcev #define FIFO_DIAGNOSTIC_SELECT 24 2149fc4831cSPete Zaitcev #define MEMORY_ADDRESS 0 2159fc4831cSPete Zaitcev u32 memdata0; 2169fc4831cSPete Zaitcev u32 memdata1; 2179fc4831cSPete Zaitcev u32 _unused3; 21841dceed5SGreg Kroah-Hartman /* offset 0x0050 */ 2199fc4831cSPete Zaitcev u32 gpioctl; 2209fc4831cSPete Zaitcev #define GPIO3_LED_SELECT 12 2219fc4831cSPete Zaitcev #define GPIO3_INTERRUPT_ENABLE 11 2229fc4831cSPete Zaitcev #define GPIO2_INTERRUPT_ENABLE 10 2239fc4831cSPete Zaitcev #define GPIO1_INTERRUPT_ENABLE 9 2249fc4831cSPete Zaitcev #define GPIO0_INTERRUPT_ENABLE 8 2259fc4831cSPete Zaitcev #define GPIO3_OUTPUT_ENABLE 7 2269fc4831cSPete Zaitcev #define GPIO2_OUTPUT_ENABLE 6 2279fc4831cSPete Zaitcev #define GPIO1_OUTPUT_ENABLE 5 2289fc4831cSPete Zaitcev #define GPIO0_OUTPUT_ENABLE 4 2299fc4831cSPete Zaitcev #define GPIO3_DATA 3 2309fc4831cSPete Zaitcev #define GPIO2_DATA 2 2319fc4831cSPete Zaitcev #define GPIO1_DATA 1 2329fc4831cSPete Zaitcev #define GPIO0_DATA 0 2339fc4831cSPete Zaitcev u32 gpiostat; 2349fc4831cSPete Zaitcev #define GPIO3_INTERRUPT 3 2359fc4831cSPete Zaitcev #define GPIO2_INTERRUPT 2 2369fc4831cSPete Zaitcev #define GPIO1_INTERRUPT 1 2379fc4831cSPete Zaitcev #define GPIO0_INTERRUPT 0 2389fc4831cSPete Zaitcev } __attribute__ ((packed)); 2399fc4831cSPete Zaitcev 2409fc4831cSPete Zaitcev /* usb control, BAR0 + 0x0080 */ 2419fc4831cSPete Zaitcev struct net2280_usb_regs { 24241dceed5SGreg Kroah-Hartman /* offset 0x0080 */ 2439fc4831cSPete Zaitcev u32 stdrsp; 2449fc4831cSPete Zaitcev #define STALL_UNSUPPORTED_REQUESTS 31 2459fc4831cSPete Zaitcev #define SET_TEST_MODE 16 2469fc4831cSPete Zaitcev #define GET_OTHER_SPEED_CONFIGURATION 15 2479fc4831cSPete Zaitcev #define GET_DEVICE_QUALIFIER 14 2489fc4831cSPete Zaitcev #define SET_ADDRESS 13 2499fc4831cSPete Zaitcev #define ENDPOINT_SET_CLEAR_HALT 12 2509fc4831cSPete Zaitcev #define DEVICE_SET_CLEAR_DEVICE_REMOTE_WAKEUP 11 2519fc4831cSPete Zaitcev #define GET_STRING_DESCRIPTOR_2 10 2529fc4831cSPete Zaitcev #define GET_STRING_DESCRIPTOR_1 9 2539fc4831cSPete Zaitcev #define GET_STRING_DESCRIPTOR_0 8 2549fc4831cSPete Zaitcev #define GET_SET_INTERFACE 6 2559fc4831cSPete Zaitcev #define GET_SET_CONFIGURATION 5 2569fc4831cSPete Zaitcev #define GET_CONFIGURATION_DESCRIPTOR 4 2579fc4831cSPete Zaitcev #define GET_DEVICE_DESCRIPTOR 3 2589fc4831cSPete Zaitcev #define GET_ENDPOINT_STATUS 2 2599fc4831cSPete Zaitcev #define GET_INTERFACE_STATUS 1 2609fc4831cSPete Zaitcev #define GET_DEVICE_STATUS 0 2619fc4831cSPete Zaitcev u32 prodvendid; 2629fc4831cSPete Zaitcev #define PRODUCT_ID 16 2639fc4831cSPete Zaitcev #define VENDOR_ID 0 2649fc4831cSPete Zaitcev u32 relnum; 2659fc4831cSPete Zaitcev u32 usbctl; 2669fc4831cSPete Zaitcev #define SERIAL_NUMBER_INDEX 16 2679fc4831cSPete Zaitcev #define PRODUCT_ID_STRING_ENABLE 13 2689fc4831cSPete Zaitcev #define VENDOR_ID_STRING_ENABLE 12 2699fc4831cSPete Zaitcev #define USB_ROOT_PORT_WAKEUP_ENABLE 11 2709fc4831cSPete Zaitcev #define VBUS_PIN 10 2719fc4831cSPete Zaitcev #define TIMED_DISCONNECT 9 2729fc4831cSPete Zaitcev #define SUSPEND_IMMEDIATELY 7 2739fc4831cSPete Zaitcev #define SELF_POWERED_USB_DEVICE 6 2749fc4831cSPete Zaitcev #define REMOTE_WAKEUP_SUPPORT 5 2759fc4831cSPete Zaitcev #define PME_POLARITY 4 2769fc4831cSPete Zaitcev #define USB_DETECT_ENABLE 3 2779fc4831cSPete Zaitcev #define PME_WAKEUP_ENABLE 2 2789fc4831cSPete Zaitcev #define DEVICE_REMOTE_WAKEUP_ENABLE 1 2799fc4831cSPete Zaitcev #define SELF_POWERED_STATUS 0 28041dceed5SGreg Kroah-Hartman /* offset 0x0090 */ 2819fc4831cSPete Zaitcev u32 usbstat; 2829fc4831cSPete Zaitcev #define HIGH_SPEED 7 2839fc4831cSPete Zaitcev #define FULL_SPEED 6 2849fc4831cSPete Zaitcev #define GENERATE_RESUME 5 2859fc4831cSPete Zaitcev #define GENERATE_DEVICE_REMOTE_WAKEUP 4 2869fc4831cSPete Zaitcev u32 xcvrdiag; 2879fc4831cSPete Zaitcev #define FORCE_HIGH_SPEED_MODE 31 2889fc4831cSPete Zaitcev #define FORCE_FULL_SPEED_MODE 30 2899fc4831cSPete Zaitcev #define USB_TEST_MODE 24 2909fc4831cSPete Zaitcev #define LINE_STATE 16 2919fc4831cSPete Zaitcev #define TRANSCEIVER_OPERATION_MODE 2 2929fc4831cSPete Zaitcev #define TRANSCEIVER_SELECT 1 2939fc4831cSPete Zaitcev #define TERMINATION_SELECT 0 2949fc4831cSPete Zaitcev u32 setup0123; 2959fc4831cSPete Zaitcev u32 setup4567; 29641dceed5SGreg Kroah-Hartman /* offset 0x0090 */ 2979fc4831cSPete Zaitcev u32 _unused0; 2989fc4831cSPete Zaitcev u32 ouraddr; 2999fc4831cSPete Zaitcev #define FORCE_IMMEDIATE 7 3009fc4831cSPete Zaitcev #define OUR_USB_ADDRESS 0 3019fc4831cSPete Zaitcev u32 ourconfig; 3029fc4831cSPete Zaitcev } __attribute__ ((packed)); 3039fc4831cSPete Zaitcev 3049fc4831cSPete Zaitcev /* pci control, BAR0 + 0x0100 */ 3059fc4831cSPete Zaitcev struct net2280_pci_regs { 30641dceed5SGreg Kroah-Hartman /* offset 0x0100 */ 3079fc4831cSPete Zaitcev u32 pcimstctl; 3089fc4831cSPete Zaitcev #define PCI_ARBITER_PARK_SELECT 13 3099fc4831cSPete Zaitcev #define PCI_MULTI LEVEL_ARBITER 12 3109fc4831cSPete Zaitcev #define PCI_RETRY_ABORT_ENABLE 11 3119fc4831cSPete Zaitcev #define DMA_MEMORY_WRITE_AND_INVALIDATE_ENABLE 10 3129fc4831cSPete Zaitcev #define DMA_READ_MULTIPLE_ENABLE 9 3139fc4831cSPete Zaitcev #define DMA_READ_LINE_ENABLE 8 3149fc4831cSPete Zaitcev #define PCI_MASTER_COMMAND_SELECT 6 3159fc4831cSPete Zaitcev #define MEM_READ_OR_WRITE 0 3169fc4831cSPete Zaitcev #define IO_READ_OR_WRITE 1 3179fc4831cSPete Zaitcev #define CFG_READ_OR_WRITE 2 3189fc4831cSPete Zaitcev #define PCI_MASTER_START 5 3199fc4831cSPete Zaitcev #define PCI_MASTER_READ_WRITE 4 3209fc4831cSPete Zaitcev #define PCI_MASTER_WRITE 0 3219fc4831cSPete Zaitcev #define PCI_MASTER_READ 1 3229fc4831cSPete Zaitcev #define PCI_MASTER_BYTE_WRITE_ENABLES 0 3239fc4831cSPete Zaitcev u32 pcimstaddr; 3249fc4831cSPete Zaitcev u32 pcimstdata; 3259fc4831cSPete Zaitcev u32 pcimststat; 3269fc4831cSPete Zaitcev #define PCI_ARBITER_CLEAR 2 3279fc4831cSPete Zaitcev #define PCI_EXTERNAL_ARBITER 1 3289fc4831cSPete Zaitcev #define PCI_HOST_MODE 0 3299fc4831cSPete Zaitcev } __attribute__ ((packed)); 3309fc4831cSPete Zaitcev 3319fc4831cSPete Zaitcev /* dma control, BAR0 + 0x0180 ... array of four structs like this, 3329fc4831cSPete Zaitcev * for channels 0..3. see also struct net2280_dma: descriptor 3339fc4831cSPete Zaitcev * that can be loaded into some of these registers. 3349fc4831cSPete Zaitcev */ 3359fc4831cSPete Zaitcev struct net2280_dma_regs { /* [11.7] */ 33641dceed5SGreg Kroah-Hartman /* offset 0x0180, 0x01a0, 0x01c0, 0x01e0, */ 3379fc4831cSPete Zaitcev u32 dmactl; 3389fc4831cSPete Zaitcev #define DMA_SCATTER_GATHER_DONE_INTERRUPT_ENABLE 25 3399fc4831cSPete Zaitcev #define DMA_CLEAR_COUNT_ENABLE 21 3409fc4831cSPete Zaitcev #define DESCRIPTOR_POLLING_RATE 19 3419fc4831cSPete Zaitcev #define POLL_CONTINUOUS 0 3429fc4831cSPete Zaitcev #define POLL_1_USEC 1 3439fc4831cSPete Zaitcev #define POLL_100_USEC 2 3449fc4831cSPete Zaitcev #define POLL_1_MSEC 3 3459fc4831cSPete Zaitcev #define DMA_VALID_BIT_POLLING_ENABLE 18 3469fc4831cSPete Zaitcev #define DMA_VALID_BIT_ENABLE 17 3479fc4831cSPete Zaitcev #define DMA_SCATTER_GATHER_ENABLE 16 3489fc4831cSPete Zaitcev #define DMA_OUT_AUTO_START_ENABLE 4 3499fc4831cSPete Zaitcev #define DMA_PREEMPT_ENABLE 3 3509fc4831cSPete Zaitcev #define DMA_FIFO_VALIDATE 2 3519fc4831cSPete Zaitcev #define DMA_ENABLE 1 3529fc4831cSPete Zaitcev #define DMA_ADDRESS_HOLD 0 3539fc4831cSPete Zaitcev u32 dmastat; 3549fc4831cSPete Zaitcev #define DMA_ABORT_DONE_INTERRUPT 27 3559fc4831cSPete Zaitcev #define DMA_SCATTER_GATHER_DONE_INTERRUPT 25 3569fc4831cSPete Zaitcev #define DMA_TRANSACTION_DONE_INTERRUPT 24 3579fc4831cSPete Zaitcev #define DMA_ABORT 1 3589fc4831cSPete Zaitcev #define DMA_START 0 3599fc4831cSPete Zaitcev u32 _unused0[2]; 36041dceed5SGreg Kroah-Hartman /* offset 0x0190, 0x01b0, 0x01d0, 0x01f0, */ 3619fc4831cSPete Zaitcev u32 dmacount; 3629fc4831cSPete Zaitcev #define VALID_BIT 31 3639fc4831cSPete Zaitcev #define DMA_DIRECTION 30 3649fc4831cSPete Zaitcev #define DMA_DONE_INTERRUPT_ENABLE 29 3659fc4831cSPete Zaitcev #define END_OF_CHAIN 28 3669fc4831cSPete Zaitcev #define DMA_BYTE_COUNT_MASK ((1<<24)-1) 3679fc4831cSPete Zaitcev #define DMA_BYTE_COUNT 0 3689fc4831cSPete Zaitcev u32 dmaaddr; 3699fc4831cSPete Zaitcev u32 dmadesc; 3709fc4831cSPete Zaitcev u32 _unused1; 3719fc4831cSPete Zaitcev } __attribute__ ((packed)); 3729fc4831cSPete Zaitcev 3739fc4831cSPete Zaitcev /* dedicated endpoint registers, BAR0 + 0x0200 */ 3749fc4831cSPete Zaitcev 3759fc4831cSPete Zaitcev struct net2280_dep_regs { /* [11.8] */ 37641dceed5SGreg Kroah-Hartman /* offset 0x0200, 0x0210, 0x220, 0x230, 0x240 */ 3779fc4831cSPete Zaitcev u32 dep_cfg; 37841dceed5SGreg Kroah-Hartman /* offset 0x0204, 0x0214, 0x224, 0x234, 0x244 */ 3799fc4831cSPete Zaitcev u32 dep_rsp; 3809fc4831cSPete Zaitcev u32 _unused[2]; 3819fc4831cSPete Zaitcev } __attribute__ ((packed)); 3829fc4831cSPete Zaitcev 3839fc4831cSPete Zaitcev /* configurable endpoint registers, BAR0 + 0x0300 ... array of seven structs 3849fc4831cSPete Zaitcev * like this, for ep0 then the configurable endpoints A..F 3859fc4831cSPete Zaitcev * ep0 reserved for control; E and F have only 64 bytes of fifo 3869fc4831cSPete Zaitcev */ 3879fc4831cSPete Zaitcev struct net2280_ep_regs { /* [11.9] */ 38841dceed5SGreg Kroah-Hartman /* offset 0x0300, 0x0320, 0x0340, 0x0360, 0x0380, 0x03a0, 0x03c0 */ 3899fc4831cSPete Zaitcev u32 ep_cfg; 3909fc4831cSPete Zaitcev #define ENDPOINT_BYTE_COUNT 16 3919fc4831cSPete Zaitcev #define ENDPOINT_ENABLE 10 3929fc4831cSPete Zaitcev #define ENDPOINT_TYPE 8 3939fc4831cSPete Zaitcev #define ENDPOINT_DIRECTION 7 3949fc4831cSPete Zaitcev #define ENDPOINT_NUMBER 0 3959fc4831cSPete Zaitcev u32 ep_rsp; 3969fc4831cSPete Zaitcev #define SET_NAK_OUT_PACKETS 15 3979fc4831cSPete Zaitcev #define SET_EP_HIDE_STATUS_PHASE 14 3989fc4831cSPete Zaitcev #define SET_EP_FORCE_CRC_ERROR 13 3999fc4831cSPete Zaitcev #define SET_INTERRUPT_MODE 12 4009fc4831cSPete Zaitcev #define SET_CONTROL_STATUS_PHASE_HANDSHAKE 11 4019fc4831cSPete Zaitcev #define SET_NAK_OUT_PACKETS_MODE 10 4029fc4831cSPete Zaitcev #define SET_ENDPOINT_TOGGLE 9 4039fc4831cSPete Zaitcev #define SET_ENDPOINT_HALT 8 4049fc4831cSPete Zaitcev #define CLEAR_NAK_OUT_PACKETS 7 4059fc4831cSPete Zaitcev #define CLEAR_EP_HIDE_STATUS_PHASE 6 4069fc4831cSPete Zaitcev #define CLEAR_EP_FORCE_CRC_ERROR 5 4079fc4831cSPete Zaitcev #define CLEAR_INTERRUPT_MODE 4 4089fc4831cSPete Zaitcev #define CLEAR_CONTROL_STATUS_PHASE_HANDSHAKE 3 4099fc4831cSPete Zaitcev #define CLEAR_NAK_OUT_PACKETS_MODE 2 4109fc4831cSPete Zaitcev #define CLEAR_ENDPOINT_TOGGLE 1 4119fc4831cSPete Zaitcev #define CLEAR_ENDPOINT_HALT 0 4129fc4831cSPete Zaitcev u32 ep_irqenb; 4139fc4831cSPete Zaitcev #define SHORT_PACKET_OUT_DONE_INTERRUPT_ENABLE 6 4149fc4831cSPete Zaitcev #define SHORT_PACKET_TRANSFERRED_INTERRUPT_ENABLE 5 4159fc4831cSPete Zaitcev #define DATA_PACKET_RECEIVED_INTERRUPT_ENABLE 3 4169fc4831cSPete Zaitcev #define DATA_PACKET_TRANSMITTED_INTERRUPT_ENABLE 2 4179fc4831cSPete Zaitcev #define DATA_OUT_PING_TOKEN_INTERRUPT_ENABLE 1 4189fc4831cSPete Zaitcev #define DATA_IN_TOKEN_INTERRUPT_ENABLE 0 4199fc4831cSPete Zaitcev u32 ep_stat; 4209fc4831cSPete Zaitcev #define FIFO_VALID_COUNT 24 4219fc4831cSPete Zaitcev #define HIGH_BANDWIDTH_OUT_TRANSACTION_PID 22 4229fc4831cSPete Zaitcev #define TIMEOUT 21 4239fc4831cSPete Zaitcev #define USB_STALL_SENT 20 4249fc4831cSPete Zaitcev #define USB_IN_NAK_SENT 19 4259fc4831cSPete Zaitcev #define USB_IN_ACK_RCVD 18 4269fc4831cSPete Zaitcev #define USB_OUT_PING_NAK_SENT 17 4279fc4831cSPete Zaitcev #define USB_OUT_ACK_SENT 16 4289fc4831cSPete Zaitcev #define FIFO_OVERFLOW 13 4299fc4831cSPete Zaitcev #define FIFO_UNDERFLOW 12 4309fc4831cSPete Zaitcev #define FIFO_FULL 11 4319fc4831cSPete Zaitcev #define FIFO_EMPTY 10 4329fc4831cSPete Zaitcev #define FIFO_FLUSH 9 4339fc4831cSPete Zaitcev #define SHORT_PACKET_OUT_DONE_INTERRUPT 6 4349fc4831cSPete Zaitcev #define SHORT_PACKET_TRANSFERRED_INTERRUPT 5 4359fc4831cSPete Zaitcev #define NAK_OUT_PACKETS 4 4369fc4831cSPete Zaitcev #define DATA_PACKET_RECEIVED_INTERRUPT 3 4379fc4831cSPete Zaitcev #define DATA_PACKET_TRANSMITTED_INTERRUPT 2 4389fc4831cSPete Zaitcev #define DATA_OUT_PING_TOKEN_INTERRUPT 1 4399fc4831cSPete Zaitcev #define DATA_IN_TOKEN_INTERRUPT 0 44041dceed5SGreg Kroah-Hartman /* offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0 */ 4419fc4831cSPete Zaitcev u32 ep_avail; 4429fc4831cSPete Zaitcev u32 ep_data; 4439fc4831cSPete Zaitcev u32 _unused0[2]; 4449fc4831cSPete Zaitcev } __attribute__ ((packed)); 4459fc4831cSPete Zaitcev 4469fc4831cSPete Zaitcev #endif /* __LINUX_USB_NET2280_H */ 447