blob: 5b1a547f8d786a0e67901c23ce3c10683d479447 [file] [log] [blame]
huang lin365250e2014-08-06 16:43:43 +08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2014 Rockchip Electronics
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
Patrick Georgib890a122015-03-26 15:17:45 +010017 * Foundation, Inc.
huang lin365250e2014-08-06 16:43:43 +080018 */
19
20#ifndef __DWC2_REGS_H__
21#define __DWC2_REGS_H__
huang lin41e24992015-05-20 17:27:10 +080022#include <usb/dwc2_registers.h>
huang lin365250e2014-08-06 16:43:43 +080023
24typedef struct dwc_ctrl {
25#define DMA_SIZE (64 * 1024)
26 void *dma_buffer;
Yunzhi Liaa336092015-06-19 17:09:04 +080027 u32 *hprt0;
28 u32 frame;
huang lin365250e2014-08-06 16:43:43 +080029} dwc_ctrl_t;
30
Yunzhi Liaa336092015-06-19 17:09:04 +080031typedef struct {
32 u8 *data;
33 endpoint_t *endp;
34 int reqsize;
35 u32 reqtiming;
36 u32 timestamp;
37} intr_queue_t;
38
Yunzhi Liebd3da72015-07-02 15:28:11 +080039typedef struct {
40 int hubaddr;
41 int hubport;
42} split_info_t;
43
huang lin365250e2014-08-06 16:43:43 +080044#define DWC2_INST(controller) ((dwc_ctrl_t *)((controller)->instance))
45#define DWC2_REG(controller) ((dwc2_reg_t *)((controller)->reg_base))
46
47typedef enum {
48 HCSTAT_DONE = 0,
49 HCSTAT_XFERERR,
50 HCSTAT_BABBLE,
51 HCSTAT_STALL,
Yunzhi Liebd3da72015-07-02 15:28:11 +080052 HCSTAT_ACK,
53 HCSTAT_NAK,
54 HCSTAT_NYET,
huang lin365250e2014-08-06 16:43:43 +080055 HCSTAT_UNKNOW,
56 HCSTAT_TIMEOUT,
57} hcstat_t;
58#endif