0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef __LINUX_USB_NET2280_H
0011 #define __LINUX_USB_NET2280_H
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 struct net2280_regs {
0026
0027 u32 devinit;
0028 #define LOCAL_CLOCK_FREQUENCY 8
0029 #define FORCE_PCI_RESET 7
0030 #define PCI_ID 6
0031 #define PCI_ENABLE 5
0032 #define FIFO_SOFT_RESET 4
0033 #define CFG_SOFT_RESET 3
0034 #define PCI_SOFT_RESET 2
0035 #define USB_SOFT_RESET 1
0036 #define M8051_RESET 0
0037 u32 eectl;
0038 #define EEPROM_ADDRESS_WIDTH 23
0039 #define EEPROM_CHIP_SELECT_ACTIVE 22
0040 #define EEPROM_PRESENT 21
0041 #define EEPROM_VALID 20
0042 #define EEPROM_BUSY 19
0043 #define EEPROM_CHIP_SELECT_ENABLE 18
0044 #define EEPROM_BYTE_READ_START 17
0045 #define EEPROM_BYTE_WRITE_START 16
0046 #define EEPROM_READ_DATA 8
0047 #define EEPROM_WRITE_DATA 0
0048 u32 eeclkfreq;
0049 u32 _unused0;
0050
0051
0052 u32 pciirqenb0;
0053 #define SETUP_PACKET_INTERRUPT_ENABLE 7
0054 #define ENDPOINT_F_INTERRUPT_ENABLE 6
0055 #define ENDPOINT_E_INTERRUPT_ENABLE 5
0056 #define ENDPOINT_D_INTERRUPT_ENABLE 4
0057 #define ENDPOINT_C_INTERRUPT_ENABLE 3
0058 #define ENDPOINT_B_INTERRUPT_ENABLE 2
0059 #define ENDPOINT_A_INTERRUPT_ENABLE 1
0060 #define ENDPOINT_0_INTERRUPT_ENABLE 0
0061 u32 pciirqenb1;
0062 #define PCI_INTERRUPT_ENABLE 31
0063 #define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27
0064 #define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26
0065 #define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25
0066 #define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20
0067 #define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19
0068 #define PCI_TARGET_ABORT_ASSERTED_INTERRUPT_ENABLE 18
0069 #define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17
0070 #define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16
0071 #define GPIO_INTERRUPT_ENABLE 13
0072 #define DMA_D_INTERRUPT_ENABLE 12
0073 #define DMA_C_INTERRUPT_ENABLE 11
0074 #define DMA_B_INTERRUPT_ENABLE 10
0075 #define DMA_A_INTERRUPT_ENABLE 9
0076 #define EEPROM_DONE_INTERRUPT_ENABLE 8
0077 #define VBUS_INTERRUPT_ENABLE 7
0078 #define CONTROL_STATUS_INTERRUPT_ENABLE 6
0079 #define ROOT_PORT_RESET_INTERRUPT_ENABLE 4
0080 #define SUSPEND_REQUEST_INTERRUPT_ENABLE 3
0081 #define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2
0082 #define RESUME_INTERRUPT_ENABLE 1
0083 #define SOF_INTERRUPT_ENABLE 0
0084 u32 cpu_irqenb0;
0085 #define SETUP_PACKET_INTERRUPT_ENABLE 7
0086 #define ENDPOINT_F_INTERRUPT_ENABLE 6
0087 #define ENDPOINT_E_INTERRUPT_ENABLE 5
0088 #define ENDPOINT_D_INTERRUPT_ENABLE 4
0089 #define ENDPOINT_C_INTERRUPT_ENABLE 3
0090 #define ENDPOINT_B_INTERRUPT_ENABLE 2
0091 #define ENDPOINT_A_INTERRUPT_ENABLE 1
0092 #define ENDPOINT_0_INTERRUPT_ENABLE 0
0093 u32 cpu_irqenb1;
0094 #define CPU_INTERRUPT_ENABLE 31
0095 #define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27
0096 #define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26
0097 #define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25
0098 #define PCI_INTA_INTERRUPT_ENABLE 24
0099 #define PCI_PME_INTERRUPT_ENABLE 23
0100 #define PCI_SERR_INTERRUPT_ENABLE 22
0101 #define PCI_PERR_INTERRUPT_ENABLE 21
0102 #define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20
0103 #define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19
0104 #define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17
0105 #define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16
0106 #define GPIO_INTERRUPT_ENABLE 13
0107 #define DMA_D_INTERRUPT_ENABLE 12
0108 #define DMA_C_INTERRUPT_ENABLE 11
0109 #define DMA_B_INTERRUPT_ENABLE 10
0110 #define DMA_A_INTERRUPT_ENABLE 9
0111 #define EEPROM_DONE_INTERRUPT_ENABLE 8
0112 #define VBUS_INTERRUPT_ENABLE 7
0113 #define CONTROL_STATUS_INTERRUPT_ENABLE 6
0114 #define ROOT_PORT_RESET_INTERRUPT_ENABLE 4
0115 #define SUSPEND_REQUEST_INTERRUPT_ENABLE 3
0116 #define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2
0117 #define RESUME_INTERRUPT_ENABLE 1
0118 #define SOF_INTERRUPT_ENABLE 0
0119
0120
0121 u32 _unused1;
0122 u32 usbirqenb1;
0123 #define USB_INTERRUPT_ENABLE 31
0124 #define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27
0125 #define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26
0126 #define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25
0127 #define PCI_INTA_INTERRUPT_ENABLE 24
0128 #define PCI_PME_INTERRUPT_ENABLE 23
0129 #define PCI_SERR_INTERRUPT_ENABLE 22
0130 #define PCI_PERR_INTERRUPT_ENABLE 21
0131 #define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20
0132 #define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19
0133 #define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17
0134 #define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16
0135 #define GPIO_INTERRUPT_ENABLE 13
0136 #define DMA_D_INTERRUPT_ENABLE 12
0137 #define DMA_C_INTERRUPT_ENABLE 11
0138 #define DMA_B_INTERRUPT_ENABLE 10
0139 #define DMA_A_INTERRUPT_ENABLE 9
0140 #define EEPROM_DONE_INTERRUPT_ENABLE 8
0141 #define VBUS_INTERRUPT_ENABLE 7
0142 #define CONTROL_STATUS_INTERRUPT_ENABLE 6
0143 #define ROOT_PORT_RESET_INTERRUPT_ENABLE 4
0144 #define SUSPEND_REQUEST_INTERRUPT_ENABLE 3
0145 #define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2
0146 #define RESUME_INTERRUPT_ENABLE 1
0147 #define SOF_INTERRUPT_ENABLE 0
0148 u32 irqstat0;
0149 #define INTA_ASSERTED 12
0150 #define SETUP_PACKET_INTERRUPT 7
0151 #define ENDPOINT_F_INTERRUPT 6
0152 #define ENDPOINT_E_INTERRUPT 5
0153 #define ENDPOINT_D_INTERRUPT 4
0154 #define ENDPOINT_C_INTERRUPT 3
0155 #define ENDPOINT_B_INTERRUPT 2
0156 #define ENDPOINT_A_INTERRUPT 1
0157 #define ENDPOINT_0_INTERRUPT 0
0158 #define USB3380_IRQSTAT0_EP_INTR_MASK_IN (0xF << 17)
0159 #define USB3380_IRQSTAT0_EP_INTR_MASK_OUT (0xF << 1)
0160
0161 u32 irqstat1;
0162 #define POWER_STATE_CHANGE_INTERRUPT 27
0163 #define PCI_ARBITER_TIMEOUT_INTERRUPT 26
0164 #define PCI_PARITY_ERROR_INTERRUPT 25
0165 #define PCI_INTA_INTERRUPT 24
0166 #define PCI_PME_INTERRUPT 23
0167 #define PCI_SERR_INTERRUPT 22
0168 #define PCI_PERR_INTERRUPT 21
0169 #define PCI_MASTER_ABORT_RECEIVED_INTERRUPT 20
0170 #define PCI_TARGET_ABORT_RECEIVED_INTERRUPT 19
0171 #define PCI_RETRY_ABORT_INTERRUPT 17
0172 #define PCI_MASTER_CYCLE_DONE_INTERRUPT 16
0173 #define SOF_DOWN_INTERRUPT 14
0174 #define GPIO_INTERRUPT 13
0175 #define DMA_D_INTERRUPT 12
0176 #define DMA_C_INTERRUPT 11
0177 #define DMA_B_INTERRUPT 10
0178 #define DMA_A_INTERRUPT 9
0179 #define EEPROM_DONE_INTERRUPT 8
0180 #define VBUS_INTERRUPT 7
0181 #define CONTROL_STATUS_INTERRUPT 6
0182 #define ROOT_PORT_RESET_INTERRUPT 4
0183 #define SUSPEND_REQUEST_INTERRUPT 3
0184 #define SUSPEND_REQUEST_CHANGE_INTERRUPT 2
0185 #define RESUME_INTERRUPT 1
0186 #define SOF_INTERRUPT 0
0187
0188 u32 idxaddr;
0189 u32 idxdata;
0190 u32 fifoctl;
0191 #define PCI_BASE2_RANGE 16
0192 #define IGNORE_FIFO_AVAILABILITY 3
0193 #define PCI_BASE2_SELECT 2
0194 #define FIFO_CONFIGURATION_SELECT 0
0195 u32 _unused2;
0196
0197 u32 memaddr;
0198 #define START 28
0199 #define DIRECTION 27
0200 #define FIFO_DIAGNOSTIC_SELECT 24
0201 #define MEMORY_ADDRESS 0
0202 u32 memdata0;
0203 u32 memdata1;
0204 u32 _unused3;
0205
0206 u32 gpioctl;
0207 #define GPIO3_LED_SELECT 12
0208 #define GPIO3_INTERRUPT_ENABLE 11
0209 #define GPIO2_INTERRUPT_ENABLE 10
0210 #define GPIO1_INTERRUPT_ENABLE 9
0211 #define GPIO0_INTERRUPT_ENABLE 8
0212 #define GPIO3_OUTPUT_ENABLE 7
0213 #define GPIO2_OUTPUT_ENABLE 6
0214 #define GPIO1_OUTPUT_ENABLE 5
0215 #define GPIO0_OUTPUT_ENABLE 4
0216 #define GPIO3_DATA 3
0217 #define GPIO2_DATA 2
0218 #define GPIO1_DATA 1
0219 #define GPIO0_DATA 0
0220 u32 gpiostat;
0221 #define GPIO3_INTERRUPT 3
0222 #define GPIO2_INTERRUPT 2
0223 #define GPIO1_INTERRUPT 1
0224 #define GPIO0_INTERRUPT 0
0225 } __attribute__ ((packed));
0226
0227
0228 struct net2280_usb_regs {
0229
0230 u32 stdrsp;
0231 #define STALL_UNSUPPORTED_REQUESTS 31
0232 #define SET_TEST_MODE 16
0233 #define GET_OTHER_SPEED_CONFIGURATION 15
0234 #define GET_DEVICE_QUALIFIER 14
0235 #define SET_ADDRESS 13
0236 #define ENDPOINT_SET_CLEAR_HALT 12
0237 #define DEVICE_SET_CLEAR_DEVICE_REMOTE_WAKEUP 11
0238 #define GET_STRING_DESCRIPTOR_2 10
0239 #define GET_STRING_DESCRIPTOR_1 9
0240 #define GET_STRING_DESCRIPTOR_0 8
0241 #define GET_SET_INTERFACE 6
0242 #define GET_SET_CONFIGURATION 5
0243 #define GET_CONFIGURATION_DESCRIPTOR 4
0244 #define GET_DEVICE_DESCRIPTOR 3
0245 #define GET_ENDPOINT_STATUS 2
0246 #define GET_INTERFACE_STATUS 1
0247 #define GET_DEVICE_STATUS 0
0248 u32 prodvendid;
0249 #define PRODUCT_ID 16
0250 #define VENDOR_ID 0
0251 u32 relnum;
0252 u32 usbctl;
0253 #define SERIAL_NUMBER_INDEX 16
0254 #define PRODUCT_ID_STRING_ENABLE 13
0255 #define VENDOR_ID_STRING_ENABLE 12
0256 #define USB_ROOT_PORT_WAKEUP_ENABLE 11
0257 #define VBUS_PIN 10
0258 #define TIMED_DISCONNECT 9
0259 #define SUSPEND_IMMEDIATELY 7
0260 #define SELF_POWERED_USB_DEVICE 6
0261 #define REMOTE_WAKEUP_SUPPORT 5
0262 #define PME_POLARITY 4
0263 #define USB_DETECT_ENABLE 3
0264 #define PME_WAKEUP_ENABLE 2
0265 #define DEVICE_REMOTE_WAKEUP_ENABLE 1
0266 #define SELF_POWERED_STATUS 0
0267
0268 u32 usbstat;
0269 #define HIGH_SPEED 7
0270 #define FULL_SPEED 6
0271 #define GENERATE_RESUME 5
0272 #define GENERATE_DEVICE_REMOTE_WAKEUP 4
0273 u32 xcvrdiag;
0274 #define FORCE_HIGH_SPEED_MODE 31
0275 #define FORCE_FULL_SPEED_MODE 30
0276 #define USB_TEST_MODE 24
0277 #define LINE_STATE 16
0278 #define TRANSCEIVER_OPERATION_MODE 2
0279 #define TRANSCEIVER_SELECT 1
0280 #define TERMINATION_SELECT 0
0281 u32 setup0123;
0282 u32 setup4567;
0283
0284 u32 _unused0;
0285 u32 ouraddr;
0286 #define FORCE_IMMEDIATE 7
0287 #define OUR_USB_ADDRESS 0
0288 u32 ourconfig;
0289 } __attribute__ ((packed));
0290
0291
0292 struct net2280_pci_regs {
0293
0294 u32 pcimstctl;
0295 #define PCI_ARBITER_PARK_SELECT 13
0296 #define PCI_MULTI LEVEL_ARBITER 12
0297 #define PCI_RETRY_ABORT_ENABLE 11
0298 #define DMA_MEMORY_WRITE_AND_INVALIDATE_ENABLE 10
0299 #define DMA_READ_MULTIPLE_ENABLE 9
0300 #define DMA_READ_LINE_ENABLE 8
0301 #define PCI_MASTER_COMMAND_SELECT 6
0302 #define MEM_READ_OR_WRITE 0
0303 #define IO_READ_OR_WRITE 1
0304 #define CFG_READ_OR_WRITE 2
0305 #define PCI_MASTER_START 5
0306 #define PCI_MASTER_READ_WRITE 4
0307 #define PCI_MASTER_WRITE 0
0308 #define PCI_MASTER_READ 1
0309 #define PCI_MASTER_BYTE_WRITE_ENABLES 0
0310 u32 pcimstaddr;
0311 u32 pcimstdata;
0312 u32 pcimststat;
0313 #define PCI_ARBITER_CLEAR 2
0314 #define PCI_EXTERNAL_ARBITER 1
0315 #define PCI_HOST_MODE 0
0316 } __attribute__ ((packed));
0317
0318
0319
0320
0321
0322 struct net2280_dma_regs {
0323
0324 u32 dmactl;
0325 #define DMA_SCATTER_GATHER_DONE_INTERRUPT_ENABLE 25
0326 #define DMA_CLEAR_COUNT_ENABLE 21
0327 #define DESCRIPTOR_POLLING_RATE 19
0328 #define POLL_CONTINUOUS 0
0329 #define POLL_1_USEC 1
0330 #define POLL_100_USEC 2
0331 #define POLL_1_MSEC 3
0332 #define DMA_VALID_BIT_POLLING_ENABLE 18
0333 #define DMA_VALID_BIT_ENABLE 17
0334 #define DMA_SCATTER_GATHER_ENABLE 16
0335 #define DMA_OUT_AUTO_START_ENABLE 4
0336 #define DMA_PREEMPT_ENABLE 3
0337 #define DMA_FIFO_VALIDATE 2
0338 #define DMA_ENABLE 1
0339 #define DMA_ADDRESS_HOLD 0
0340 u32 dmastat;
0341 #define DMA_ABORT_DONE_INTERRUPT 27
0342 #define DMA_SCATTER_GATHER_DONE_INTERRUPT 25
0343 #define DMA_TRANSACTION_DONE_INTERRUPT 24
0344 #define DMA_ABORT 1
0345 #define DMA_START 0
0346 u32 _unused0[2];
0347
0348 u32 dmacount;
0349 #define VALID_BIT 31
0350 #define DMA_DIRECTION 30
0351 #define DMA_DONE_INTERRUPT_ENABLE 29
0352 #define END_OF_CHAIN 28
0353 #define DMA_BYTE_COUNT_MASK ((1<<24)-1)
0354 #define DMA_BYTE_COUNT 0
0355 u32 dmaaddr;
0356 u32 dmadesc;
0357 u32 _unused1;
0358 } __attribute__ ((packed));
0359
0360
0361
0362 struct net2280_dep_regs {
0363
0364 u32 dep_cfg;
0365
0366 u32 dep_rsp;
0367 u32 _unused[2];
0368 } __attribute__ ((packed));
0369
0370
0371
0372
0373
0374 struct net2280_ep_regs {
0375
0376 u32 ep_cfg;
0377 #define ENDPOINT_BYTE_COUNT 16
0378 #define ENDPOINT_ENABLE 10
0379 #define ENDPOINT_TYPE 8
0380 #define ENDPOINT_DIRECTION 7
0381 #define ENDPOINT_NUMBER 0
0382 u32 ep_rsp;
0383 #define SET_NAK_OUT_PACKETS 15
0384 #define SET_EP_HIDE_STATUS_PHASE 14
0385 #define SET_EP_FORCE_CRC_ERROR 13
0386 #define SET_INTERRUPT_MODE 12
0387 #define SET_CONTROL_STATUS_PHASE_HANDSHAKE 11
0388 #define SET_NAK_OUT_PACKETS_MODE 10
0389 #define SET_ENDPOINT_TOGGLE 9
0390 #define SET_ENDPOINT_HALT 8
0391 #define CLEAR_NAK_OUT_PACKETS 7
0392 #define CLEAR_EP_HIDE_STATUS_PHASE 6
0393 #define CLEAR_EP_FORCE_CRC_ERROR 5
0394 #define CLEAR_INTERRUPT_MODE 4
0395 #define CLEAR_CONTROL_STATUS_PHASE_HANDSHAKE 3
0396 #define CLEAR_NAK_OUT_PACKETS_MODE 2
0397 #define CLEAR_ENDPOINT_TOGGLE 1
0398 #define CLEAR_ENDPOINT_HALT 0
0399 u32 ep_irqenb;
0400 #define SHORT_PACKET_OUT_DONE_INTERRUPT_ENABLE 6
0401 #define SHORT_PACKET_TRANSFERRED_INTERRUPT_ENABLE 5
0402 #define DATA_PACKET_RECEIVED_INTERRUPT_ENABLE 3
0403 #define DATA_PACKET_TRANSMITTED_INTERRUPT_ENABLE 2
0404 #define DATA_OUT_PING_TOKEN_INTERRUPT_ENABLE 1
0405 #define DATA_IN_TOKEN_INTERRUPT_ENABLE 0
0406 u32 ep_stat;
0407 #define FIFO_VALID_COUNT 24
0408 #define HIGH_BANDWIDTH_OUT_TRANSACTION_PID 22
0409 #define TIMEOUT 21
0410 #define USB_STALL_SENT 20
0411 #define USB_IN_NAK_SENT 19
0412 #define USB_IN_ACK_RCVD 18
0413 #define USB_OUT_PING_NAK_SENT 17
0414 #define USB_OUT_ACK_SENT 16
0415 #define FIFO_OVERFLOW 13
0416 #define FIFO_UNDERFLOW 12
0417 #define FIFO_FULL 11
0418 #define FIFO_EMPTY 10
0419 #define FIFO_FLUSH 9
0420 #define SHORT_PACKET_OUT_DONE_INTERRUPT 6
0421 #define SHORT_PACKET_TRANSFERRED_INTERRUPT 5
0422 #define NAK_OUT_PACKETS 4
0423 #define DATA_PACKET_RECEIVED_INTERRUPT 3
0424 #define DATA_PACKET_TRANSMITTED_INTERRUPT 2
0425 #define DATA_OUT_PING_TOKEN_INTERRUPT 1
0426 #define DATA_IN_TOKEN_INTERRUPT 0
0427
0428 u32 ep_avail;
0429 u32 ep_data;
0430 u32 _unused0[2];
0431 } __attribute__ ((packed));
0432
0433 #endif