3 * Copyright (C) 2015 Rockchip Electronics
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.
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.
15 #ifndef __DWC2_PRIV_H__
16 #define __DWC2_PRIV_H__
17 #include <usb/dwc2_registers.h>
19 #define EP_MAXLEN (64 * 1024)
22 #define RX_FIFO_SIZE 0x210
23 #define DTX_FIFO_SIZE_0_OFFSET RX_FIFO_SIZE
24 #define DTX_FIFO_SIZE_0 0x10
25 #define DTX_FIFO_SIZE_1_OFFSET (DTX_FIFO_SIZE_0_OFFSET +\
27 #define DTX_FIFO_SIZE_1 0x100
28 #define DTX_FIFO_SIZE_2_OFFSET (DTX_FIFO_SIZE_1_OFFSET +\
30 #define DTX_FIFO_SIZE_2 0x10
33 SIMPLEQ_ENTRY(job
) queue
; // linkage
38 int zlp
; // append zero length packet?
39 int autofree
; // free after processing?
41 SIMPLEQ_HEAD(job_queue
, job
);
43 typedef struct dwc2_ep
{
44 dwc2_ep_reg_t
*ep_regs
;
45 struct job_queue job_queue
;
51 typedef struct dwc2_pdata
{
53 dwc2_ep_t eps
[MAX_EPS_CHANNELS
][2];
58 #define DWC2_PDATA(ctrl) ((dwc2_pdata_t *)((ctrl)->pdata))