soc/intel/cmn/cse: Deprecate CONFIG_SOC_INTEL_CSE_RW_VERSION
[coreboot2.git] / payloads / libpayload / drivers / udc / dwc2_priv.h
blob284310e60aa093acb42c31ab4e2a7f0d2ef23c8a
1 /*
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)
20 #define EP0_MAXLEN 64
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 +\
26 DTX_FIFO_SIZE_0)
27 #define DTX_FIFO_SIZE_1 0x100
28 #define DTX_FIFO_SIZE_2_OFFSET (DTX_FIFO_SIZE_1_OFFSET +\
29 DTX_FIFO_SIZE_1)
30 #define DTX_FIFO_SIZE_2 0x10
32 struct job {
33 SIMPLEQ_ENTRY(job) queue; // linkage
34 void *data;
35 size_t length;
36 size_t xfered_length;
37 size_t xfer_length;
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;
46 unsigned txfifo:5;
47 unsigned busy:1;
48 unsigned ep_num:8;
49 } dwc2_ep_t;
51 typedef struct dwc2_pdata {
52 dwc2_reg_t *regs;
53 dwc2_ep_t eps[MAX_EPS_CHANNELS][2];
54 uint32_t fifo_map;
55 void *setup_buf;
56 } dwc2_pdata_t;
58 #define DWC2_PDATA(ctrl) ((dwc2_pdata_t *)((ctrl)->pdata))
60 #endif