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