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