1 /* 2 * 3 * Copyright (C) 2014 Rockchip Electronics 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; version 2 of the License. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 */ 14 15 #ifndef __DWC2_REGS_H__ 16 #define __DWC2_REGS_H__ 17 #include <usb/dwc2_registers.h> 18 19 typedef struct dwc_ctrl { 20 #define DMA_SIZE (64 * 1024) 21 void *dma_buffer; 22 u32 *hprt0; 23 u32 frame; 24 } dwc_ctrl_t; 25 26 typedef struct { 27 u8 *data; 28 endpoint_t *endp; 29 int reqsize; 30 u32 reqtiming; 31 u32 timestamp; 32 } intr_queue_t; 33 34 typedef struct { 35 int hubaddr; 36 int hubport; 37 } split_info_t; 38 39 #define DWC2_INST(controller) ((dwc_ctrl_t *)((controller)->instance)) 40 #define DWC2_REG(controller) ((dwc2_reg_t *)((controller)->reg_base)) 41 42 typedef enum { 43 HCSTAT_DONE = 0, 44 HCSTAT_XFERERR, 45 HCSTAT_BABBLE, 46 HCSTAT_STALL, 47 HCSTAT_ACK, 48 HCSTAT_NAK, 49 HCSTAT_NYET, 50 HCSTAT_UNKNOW, 51 HCSTAT_TIMEOUT, 52 HCSTAT_DISCONNECTED, 53 } hcstat_t; 54 #endif 55