xref: /openbmc/linux/include/linux/usb/net2280.h (revision dda43a0e)
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
1719fc4831cSPete Zaitcev 	u32		irqstat1;
1729fc4831cSPete Zaitcev #define     POWER_STATE_CHANGE_INTERRUPT                        27
1739fc4831cSPete Zaitcev #define     PCI_ARBITER_TIMEOUT_INTERRUPT                       26
1749fc4831cSPete Zaitcev #define     PCI_PARITY_ERROR_INTERRUPT                          25
1759fc4831cSPete Zaitcev #define     PCI_INTA_INTERRUPT                                  24
1769fc4831cSPete Zaitcev #define     PCI_PME_INTERRUPT                                   23
1779fc4831cSPete Zaitcev #define     PCI_SERR_INTERRUPT                                  22
1789fc4831cSPete Zaitcev #define     PCI_PERR_INTERRUPT                                  21
1799fc4831cSPete Zaitcev #define     PCI_MASTER_ABORT_RECEIVED_INTERRUPT                 20
1809fc4831cSPete Zaitcev #define     PCI_TARGET_ABORT_RECEIVED_INTERRUPT                 19
1819fc4831cSPete Zaitcev #define     PCI_RETRY_ABORT_INTERRUPT                           17
1829fc4831cSPete Zaitcev #define     PCI_MASTER_CYCLE_DONE_INTERRUPT                     16
1839fc4831cSPete Zaitcev #define     SOF_DOWN_INTERRUPT                                  14
1849fc4831cSPete Zaitcev #define     GPIO_INTERRUPT                                      13
1859fc4831cSPete Zaitcev #define     DMA_D_INTERRUPT                                     12
1869fc4831cSPete Zaitcev #define     DMA_C_INTERRUPT                                     11
1879fc4831cSPete Zaitcev #define     DMA_B_INTERRUPT                                     10
1889fc4831cSPete Zaitcev #define     DMA_A_INTERRUPT                                     9
1899fc4831cSPete Zaitcev #define     EEPROM_DONE_INTERRUPT                               8
1909fc4831cSPete Zaitcev #define     VBUS_INTERRUPT                                      7
1919fc4831cSPete Zaitcev #define     CONTROL_STATUS_INTERRUPT                            6
1929fc4831cSPete Zaitcev #define     ROOT_PORT_RESET_INTERRUPT                           4
1939fc4831cSPete Zaitcev #define     SUSPEND_REQUEST_INTERRUPT                           3
1949fc4831cSPete Zaitcev #define     SUSPEND_REQUEST_CHANGE_INTERRUPT                    2
1959fc4831cSPete Zaitcev #define     RESUME_INTERRUPT                                    1
1969fc4831cSPete Zaitcev #define     SOF_INTERRUPT                                       0
19741dceed5SGreg Kroah-Hartman 	/* offset 0x0030 */
1989fc4831cSPete Zaitcev 	u32		idxaddr;
1999fc4831cSPete Zaitcev 	u32		idxdata;
2009fc4831cSPete Zaitcev 	u32		fifoctl;
2019fc4831cSPete Zaitcev #define     PCI_BASE2_RANGE                                     16
2029fc4831cSPete Zaitcev #define     IGNORE_FIFO_AVAILABILITY                            3
2039fc4831cSPete Zaitcev #define     PCI_BASE2_SELECT                                    2
2049fc4831cSPete Zaitcev #define     FIFO_CONFIGURATION_SELECT                           0
2059fc4831cSPete Zaitcev 	u32		_unused2;
20641dceed5SGreg Kroah-Hartman 	/* offset 0x0040 */
2079fc4831cSPete Zaitcev 	u32		memaddr;
2089fc4831cSPete Zaitcev #define     START                                               28
2099fc4831cSPete Zaitcev #define     DIRECTION                                           27
2109fc4831cSPete Zaitcev #define     FIFO_DIAGNOSTIC_SELECT                              24
2119fc4831cSPete Zaitcev #define     MEMORY_ADDRESS                                      0
2129fc4831cSPete Zaitcev 	u32		memdata0;
2139fc4831cSPete Zaitcev 	u32		memdata1;
2149fc4831cSPete Zaitcev 	u32		_unused3;
21541dceed5SGreg Kroah-Hartman 	/* offset 0x0050 */
2169fc4831cSPete Zaitcev 	u32		gpioctl;
2179fc4831cSPete Zaitcev #define     GPIO3_LED_SELECT                                    12
2189fc4831cSPete Zaitcev #define     GPIO3_INTERRUPT_ENABLE                              11
2199fc4831cSPete Zaitcev #define     GPIO2_INTERRUPT_ENABLE                              10
2209fc4831cSPete Zaitcev #define     GPIO1_INTERRUPT_ENABLE                              9
2219fc4831cSPete Zaitcev #define     GPIO0_INTERRUPT_ENABLE                              8
2229fc4831cSPete Zaitcev #define     GPIO3_OUTPUT_ENABLE                                 7
2239fc4831cSPete Zaitcev #define     GPIO2_OUTPUT_ENABLE                                 6
2249fc4831cSPete Zaitcev #define     GPIO1_OUTPUT_ENABLE                                 5
2259fc4831cSPete Zaitcev #define     GPIO0_OUTPUT_ENABLE                                 4
2269fc4831cSPete Zaitcev #define     GPIO3_DATA                                          3
2279fc4831cSPete Zaitcev #define     GPIO2_DATA                                          2
2289fc4831cSPete Zaitcev #define     GPIO1_DATA                                          1
2299fc4831cSPete Zaitcev #define     GPIO0_DATA                                          0
2309fc4831cSPete Zaitcev 	u32		gpiostat;
2319fc4831cSPete Zaitcev #define     GPIO3_INTERRUPT                                     3
2329fc4831cSPete Zaitcev #define     GPIO2_INTERRUPT                                     2
2339fc4831cSPete Zaitcev #define     GPIO1_INTERRUPT                                     1
2349fc4831cSPete Zaitcev #define     GPIO0_INTERRUPT                                     0
2359fc4831cSPete Zaitcev } __attribute__ ((packed));
2369fc4831cSPete Zaitcev 
2379fc4831cSPete Zaitcev /* usb control, BAR0 + 0x0080 */
2389fc4831cSPete Zaitcev struct net2280_usb_regs {
23941dceed5SGreg Kroah-Hartman 	/* offset 0x0080 */
2409fc4831cSPete Zaitcev 	u32		stdrsp;
2419fc4831cSPete Zaitcev #define     STALL_UNSUPPORTED_REQUESTS                          31
2429fc4831cSPete Zaitcev #define     SET_TEST_MODE                                       16
2439fc4831cSPete Zaitcev #define     GET_OTHER_SPEED_CONFIGURATION                       15
2449fc4831cSPete Zaitcev #define     GET_DEVICE_QUALIFIER                                14
2459fc4831cSPete Zaitcev #define     SET_ADDRESS                                         13
2469fc4831cSPete Zaitcev #define     ENDPOINT_SET_CLEAR_HALT                             12
2479fc4831cSPete Zaitcev #define     DEVICE_SET_CLEAR_DEVICE_REMOTE_WAKEUP               11
2489fc4831cSPete Zaitcev #define     GET_STRING_DESCRIPTOR_2                             10
2499fc4831cSPete Zaitcev #define     GET_STRING_DESCRIPTOR_1                             9
2509fc4831cSPete Zaitcev #define     GET_STRING_DESCRIPTOR_0                             8
2519fc4831cSPete Zaitcev #define     GET_SET_INTERFACE                                   6
2529fc4831cSPete Zaitcev #define     GET_SET_CONFIGURATION                               5
2539fc4831cSPete Zaitcev #define     GET_CONFIGURATION_DESCRIPTOR                        4
2549fc4831cSPete Zaitcev #define     GET_DEVICE_DESCRIPTOR                               3
2559fc4831cSPete Zaitcev #define     GET_ENDPOINT_STATUS                                 2
2569fc4831cSPete Zaitcev #define     GET_INTERFACE_STATUS                                1
2579fc4831cSPete Zaitcev #define     GET_DEVICE_STATUS                                   0
2589fc4831cSPete Zaitcev 	u32		prodvendid;
2599fc4831cSPete Zaitcev #define     PRODUCT_ID                                          16
2609fc4831cSPete Zaitcev #define     VENDOR_ID                                           0
2619fc4831cSPete Zaitcev 	u32		relnum;
2629fc4831cSPete Zaitcev 	u32		usbctl;
2639fc4831cSPete Zaitcev #define     SERIAL_NUMBER_INDEX                                 16
2649fc4831cSPete Zaitcev #define     PRODUCT_ID_STRING_ENABLE                            13
2659fc4831cSPete Zaitcev #define     VENDOR_ID_STRING_ENABLE                             12
2669fc4831cSPete Zaitcev #define     USB_ROOT_PORT_WAKEUP_ENABLE                         11
2679fc4831cSPete Zaitcev #define     VBUS_PIN                                            10
2689fc4831cSPete Zaitcev #define     TIMED_DISCONNECT                                    9
2699fc4831cSPete Zaitcev #define     SUSPEND_IMMEDIATELY                                 7
2709fc4831cSPete Zaitcev #define     SELF_POWERED_USB_DEVICE                             6
2719fc4831cSPete Zaitcev #define     REMOTE_WAKEUP_SUPPORT                               5
2729fc4831cSPete Zaitcev #define     PME_POLARITY                                        4
2739fc4831cSPete Zaitcev #define     USB_DETECT_ENABLE                                   3
2749fc4831cSPete Zaitcev #define     PME_WAKEUP_ENABLE                                   2
2759fc4831cSPete Zaitcev #define     DEVICE_REMOTE_WAKEUP_ENABLE                         1
2769fc4831cSPete Zaitcev #define     SELF_POWERED_STATUS                                 0
27741dceed5SGreg Kroah-Hartman 	/* offset 0x0090 */
2789fc4831cSPete Zaitcev 	u32		usbstat;
2799fc4831cSPete Zaitcev #define     HIGH_SPEED                                          7
2809fc4831cSPete Zaitcev #define     FULL_SPEED                                          6
2819fc4831cSPete Zaitcev #define     GENERATE_RESUME                                     5
2829fc4831cSPete Zaitcev #define     GENERATE_DEVICE_REMOTE_WAKEUP                       4
2839fc4831cSPete Zaitcev 	u32		xcvrdiag;
2849fc4831cSPete Zaitcev #define     FORCE_HIGH_SPEED_MODE                               31
2859fc4831cSPete Zaitcev #define     FORCE_FULL_SPEED_MODE                               30
2869fc4831cSPete Zaitcev #define     USB_TEST_MODE                                       24
2879fc4831cSPete Zaitcev #define     LINE_STATE                                          16
2889fc4831cSPete Zaitcev #define     TRANSCEIVER_OPERATION_MODE                          2
2899fc4831cSPete Zaitcev #define     TRANSCEIVER_SELECT                                  1
2909fc4831cSPete Zaitcev #define     TERMINATION_SELECT                                  0
2919fc4831cSPete Zaitcev 	u32		setup0123;
2929fc4831cSPete Zaitcev 	u32		setup4567;
29341dceed5SGreg Kroah-Hartman 	/* offset 0x0090 */
2949fc4831cSPete Zaitcev 	u32		_unused0;
2959fc4831cSPete Zaitcev 	u32		ouraddr;
2969fc4831cSPete Zaitcev #define     FORCE_IMMEDIATE                                     7
2979fc4831cSPete Zaitcev #define     OUR_USB_ADDRESS                                     0
2989fc4831cSPete Zaitcev 	u32		ourconfig;
2999fc4831cSPete Zaitcev } __attribute__ ((packed));
3009fc4831cSPete Zaitcev 
3019fc4831cSPete Zaitcev /* pci control, BAR0 + 0x0100 */
3029fc4831cSPete Zaitcev struct net2280_pci_regs {
30341dceed5SGreg Kroah-Hartman 	/* offset 0x0100 */
3049fc4831cSPete Zaitcev 	u32		 pcimstctl;
3059fc4831cSPete Zaitcev #define     PCI_ARBITER_PARK_SELECT                             13
3069fc4831cSPete Zaitcev #define     PCI_MULTI LEVEL_ARBITER                             12
3079fc4831cSPete Zaitcev #define     PCI_RETRY_ABORT_ENABLE                              11
3089fc4831cSPete Zaitcev #define     DMA_MEMORY_WRITE_AND_INVALIDATE_ENABLE              10
3099fc4831cSPete Zaitcev #define     DMA_READ_MULTIPLE_ENABLE                            9
3109fc4831cSPete Zaitcev #define     DMA_READ_LINE_ENABLE                                8
3119fc4831cSPete Zaitcev #define     PCI_MASTER_COMMAND_SELECT                           6
3129fc4831cSPete Zaitcev #define         MEM_READ_OR_WRITE                                   0
3139fc4831cSPete Zaitcev #define         IO_READ_OR_WRITE                                    1
3149fc4831cSPete Zaitcev #define         CFG_READ_OR_WRITE                                   2
3159fc4831cSPete Zaitcev #define     PCI_MASTER_START                                    5
3169fc4831cSPete Zaitcev #define     PCI_MASTER_READ_WRITE                               4
3179fc4831cSPete Zaitcev #define         PCI_MASTER_WRITE                                    0
3189fc4831cSPete Zaitcev #define         PCI_MASTER_READ                                     1
3199fc4831cSPete Zaitcev #define     PCI_MASTER_BYTE_WRITE_ENABLES                       0
3209fc4831cSPete Zaitcev 	u32		 pcimstaddr;
3219fc4831cSPete Zaitcev 	u32		 pcimstdata;
3229fc4831cSPete Zaitcev 	u32		 pcimststat;
3239fc4831cSPete Zaitcev #define     PCI_ARBITER_CLEAR                                   2
3249fc4831cSPete Zaitcev #define     PCI_EXTERNAL_ARBITER                                1
3259fc4831cSPete Zaitcev #define     PCI_HOST_MODE                                       0
3269fc4831cSPete Zaitcev } __attribute__ ((packed));
3279fc4831cSPete Zaitcev 
3289fc4831cSPete Zaitcev /* dma control, BAR0 + 0x0180 ... array of four structs like this,
3299fc4831cSPete Zaitcev  * for channels 0..3.  see also struct net2280_dma:  descriptor
3309fc4831cSPete Zaitcev  * that can be loaded into some of these registers.
3319fc4831cSPete Zaitcev  */
3329fc4831cSPete Zaitcev struct net2280_dma_regs {	/* [11.7] */
33341dceed5SGreg Kroah-Hartman 	/* offset 0x0180, 0x01a0, 0x01c0, 0x01e0, */
3349fc4831cSPete Zaitcev 	u32		dmactl;
3359fc4831cSPete Zaitcev #define     DMA_SCATTER_GATHER_DONE_INTERRUPT_ENABLE            25
3369fc4831cSPete Zaitcev #define     DMA_CLEAR_COUNT_ENABLE                              21
3379fc4831cSPete Zaitcev #define     DESCRIPTOR_POLLING_RATE                             19
3389fc4831cSPete Zaitcev #define         POLL_CONTINUOUS                                     0
3399fc4831cSPete Zaitcev #define         POLL_1_USEC                                         1
3409fc4831cSPete Zaitcev #define         POLL_100_USEC                                       2
3419fc4831cSPete Zaitcev #define         POLL_1_MSEC                                         3
3429fc4831cSPete Zaitcev #define     DMA_VALID_BIT_POLLING_ENABLE                        18
3439fc4831cSPete Zaitcev #define     DMA_VALID_BIT_ENABLE                                17
3449fc4831cSPete Zaitcev #define     DMA_SCATTER_GATHER_ENABLE                           16
3459fc4831cSPete Zaitcev #define     DMA_OUT_AUTO_START_ENABLE                           4
3469fc4831cSPete Zaitcev #define     DMA_PREEMPT_ENABLE                                  3
3479fc4831cSPete Zaitcev #define     DMA_FIFO_VALIDATE                                   2
3489fc4831cSPete Zaitcev #define     DMA_ENABLE                                          1
3499fc4831cSPete Zaitcev #define     DMA_ADDRESS_HOLD                                    0
3509fc4831cSPete Zaitcev 	u32		dmastat;
3519fc4831cSPete Zaitcev #define     DMA_ABORT_DONE_INTERRUPT                            27
3529fc4831cSPete Zaitcev #define     DMA_SCATTER_GATHER_DONE_INTERRUPT                   25
3539fc4831cSPete Zaitcev #define     DMA_TRANSACTION_DONE_INTERRUPT                      24
3549fc4831cSPete Zaitcev #define     DMA_ABORT                                           1
3559fc4831cSPete Zaitcev #define     DMA_START                                           0
3569fc4831cSPete Zaitcev 	u32		_unused0 [2];
35741dceed5SGreg Kroah-Hartman 	/* offset 0x0190, 0x01b0, 0x01d0, 0x01f0, */
3589fc4831cSPete Zaitcev 	u32		dmacount;
3599fc4831cSPete Zaitcev #define     VALID_BIT                                           31
3609fc4831cSPete Zaitcev #define     DMA_DIRECTION                                       30
3619fc4831cSPete Zaitcev #define     DMA_DONE_INTERRUPT_ENABLE                           29
3629fc4831cSPete Zaitcev #define     END_OF_CHAIN                                        28
3639fc4831cSPete Zaitcev #define         DMA_BYTE_COUNT_MASK                                 ((1<<24)-1)
3649fc4831cSPete Zaitcev #define     DMA_BYTE_COUNT                                      0
3659fc4831cSPete Zaitcev 	u32		dmaaddr;
3669fc4831cSPete Zaitcev 	u32		dmadesc;
3679fc4831cSPete Zaitcev 	u32		_unused1;
3689fc4831cSPete Zaitcev } __attribute__ ((packed));
3699fc4831cSPete Zaitcev 
3709fc4831cSPete Zaitcev /* dedicated endpoint registers, BAR0 + 0x0200 */
3719fc4831cSPete Zaitcev 
3729fc4831cSPete Zaitcev struct net2280_dep_regs {	/* [11.8] */
37341dceed5SGreg Kroah-Hartman 	/* offset 0x0200, 0x0210, 0x220, 0x230, 0x240 */
3749fc4831cSPete Zaitcev 	u32		dep_cfg;
37541dceed5SGreg Kroah-Hartman 	/* offset 0x0204, 0x0214, 0x224, 0x234, 0x244 */
3769fc4831cSPete Zaitcev 	u32		dep_rsp;
3779fc4831cSPete Zaitcev 	u32		_unused [2];
3789fc4831cSPete Zaitcev } __attribute__ ((packed));
3799fc4831cSPete Zaitcev 
3809fc4831cSPete Zaitcev /* configurable endpoint registers, BAR0 + 0x0300 ... array of seven structs
3819fc4831cSPete Zaitcev  * like this, for ep0 then the configurable endpoints A..F
3829fc4831cSPete Zaitcev  * ep0 reserved for control; E and F have only 64 bytes of fifo
3839fc4831cSPete Zaitcev  */
3849fc4831cSPete Zaitcev struct net2280_ep_regs {	/* [11.9] */
38541dceed5SGreg Kroah-Hartman 	/* offset 0x0300, 0x0320, 0x0340, 0x0360, 0x0380, 0x03a0, 0x03c0 */
3869fc4831cSPete Zaitcev 	u32		ep_cfg;
3879fc4831cSPete Zaitcev #define     ENDPOINT_BYTE_COUNT                                 16
3889fc4831cSPete Zaitcev #define     ENDPOINT_ENABLE                                     10
3899fc4831cSPete Zaitcev #define     ENDPOINT_TYPE                                       8
3909fc4831cSPete Zaitcev #define     ENDPOINT_DIRECTION                                  7
3919fc4831cSPete Zaitcev #define     ENDPOINT_NUMBER                                     0
3929fc4831cSPete Zaitcev 	u32		ep_rsp;
3939fc4831cSPete Zaitcev #define     SET_NAK_OUT_PACKETS                                 15
3949fc4831cSPete Zaitcev #define     SET_EP_HIDE_STATUS_PHASE                            14
3959fc4831cSPete Zaitcev #define     SET_EP_FORCE_CRC_ERROR                              13
3969fc4831cSPete Zaitcev #define     SET_INTERRUPT_MODE                                  12
3979fc4831cSPete Zaitcev #define     SET_CONTROL_STATUS_PHASE_HANDSHAKE                  11
3989fc4831cSPete Zaitcev #define     SET_NAK_OUT_PACKETS_MODE                            10
3999fc4831cSPete Zaitcev #define     SET_ENDPOINT_TOGGLE                                 9
4009fc4831cSPete Zaitcev #define     SET_ENDPOINT_HALT                                   8
4019fc4831cSPete Zaitcev #define     CLEAR_NAK_OUT_PACKETS                               7
4029fc4831cSPete Zaitcev #define     CLEAR_EP_HIDE_STATUS_PHASE                          6
4039fc4831cSPete Zaitcev #define     CLEAR_EP_FORCE_CRC_ERROR                            5
4049fc4831cSPete Zaitcev #define     CLEAR_INTERRUPT_MODE                                4
4059fc4831cSPete Zaitcev #define     CLEAR_CONTROL_STATUS_PHASE_HANDSHAKE                3
4069fc4831cSPete Zaitcev #define     CLEAR_NAK_OUT_PACKETS_MODE                          2
4079fc4831cSPete Zaitcev #define     CLEAR_ENDPOINT_TOGGLE                               1
4089fc4831cSPete Zaitcev #define     CLEAR_ENDPOINT_HALT                                 0
4099fc4831cSPete Zaitcev 	u32		ep_irqenb;
4109fc4831cSPete Zaitcev #define     SHORT_PACKET_OUT_DONE_INTERRUPT_ENABLE              6
4119fc4831cSPete Zaitcev #define     SHORT_PACKET_TRANSFERRED_INTERRUPT_ENABLE           5
4129fc4831cSPete Zaitcev #define     DATA_PACKET_RECEIVED_INTERRUPT_ENABLE               3
4139fc4831cSPete Zaitcev #define     DATA_PACKET_TRANSMITTED_INTERRUPT_ENABLE            2
4149fc4831cSPete Zaitcev #define     DATA_OUT_PING_TOKEN_INTERRUPT_ENABLE                1
4159fc4831cSPete Zaitcev #define     DATA_IN_TOKEN_INTERRUPT_ENABLE                      0
4169fc4831cSPete Zaitcev 	u32		ep_stat;
4179fc4831cSPete Zaitcev #define     FIFO_VALID_COUNT                                    24
4189fc4831cSPete Zaitcev #define     HIGH_BANDWIDTH_OUT_TRANSACTION_PID                  22
4199fc4831cSPete Zaitcev #define     TIMEOUT                                             21
4209fc4831cSPete Zaitcev #define     USB_STALL_SENT                                      20
4219fc4831cSPete Zaitcev #define     USB_IN_NAK_SENT                                     19
4229fc4831cSPete Zaitcev #define     USB_IN_ACK_RCVD                                     18
4239fc4831cSPete Zaitcev #define     USB_OUT_PING_NAK_SENT                               17
4249fc4831cSPete Zaitcev #define     USB_OUT_ACK_SENT                                    16
4259fc4831cSPete Zaitcev #define     FIFO_OVERFLOW                                       13
4269fc4831cSPete Zaitcev #define     FIFO_UNDERFLOW                                      12
4279fc4831cSPete Zaitcev #define     FIFO_FULL                                           11
4289fc4831cSPete Zaitcev #define     FIFO_EMPTY                                          10
4299fc4831cSPete Zaitcev #define     FIFO_FLUSH                                          9
4309fc4831cSPete Zaitcev #define     SHORT_PACKET_OUT_DONE_INTERRUPT                     6
4319fc4831cSPete Zaitcev #define     SHORT_PACKET_TRANSFERRED_INTERRUPT                  5
4329fc4831cSPete Zaitcev #define     NAK_OUT_PACKETS                                     4
4339fc4831cSPete Zaitcev #define     DATA_PACKET_RECEIVED_INTERRUPT                      3
4349fc4831cSPete Zaitcev #define     DATA_PACKET_TRANSMITTED_INTERRUPT                   2
4359fc4831cSPete Zaitcev #define     DATA_OUT_PING_TOKEN_INTERRUPT                       1
4369fc4831cSPete Zaitcev #define     DATA_IN_TOKEN_INTERRUPT                             0
43741dceed5SGreg Kroah-Hartman 	/* offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0 */
4389fc4831cSPete Zaitcev 	u32		ep_avail;
4399fc4831cSPete Zaitcev 	u32		ep_data;
4409fc4831cSPete Zaitcev 	u32		_unused0 [2];
4419fc4831cSPete Zaitcev } __attribute__ ((packed));
4429fc4831cSPete Zaitcev 
4439fc4831cSPete Zaitcev #endif /* __LINUX_USB_NET2280_H */
444