huang lin | 365250e | 2014-08-06 16:43:43 +0800 | [diff] [blame] | 1 | /* |
| 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. |
huang lin | 365250e | 2014-08-06 16:43:43 +0800 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #ifndef __DWC2_REGS_H__ |
| 17 | #define __DWC2_REGS_H__ |
huang lin | 41e2499 | 2015-05-20 17:27:10 +0800 | [diff] [blame] | 18 | #include <usb/dwc2_registers.h> |
huang lin | 365250e | 2014-08-06 16:43:43 +0800 | [diff] [blame] | 19 | |
| 20 | typedef struct dwc_ctrl { |
| 21 | #define DMA_SIZE (64 * 1024) |
| 22 | void *dma_buffer; |
Yunzhi Li | aa33609 | 2015-06-19 17:09:04 +0800 | [diff] [blame] | 23 | u32 *hprt0; |
| 24 | u32 frame; |
huang lin | 365250e | 2014-08-06 16:43:43 +0800 | [diff] [blame] | 25 | } dwc_ctrl_t; |
| 26 | |
Yunzhi Li | aa33609 | 2015-06-19 17:09:04 +0800 | [diff] [blame] | 27 | typedef struct { |
| 28 | u8 *data; |
| 29 | endpoint_t *endp; |
| 30 | int reqsize; |
| 31 | u32 reqtiming; |
| 32 | u32 timestamp; |
| 33 | } intr_queue_t; |
| 34 | |
Yunzhi Li | ebd3da7 | 2015-07-02 15:28:11 +0800 | [diff] [blame] | 35 | typedef struct { |
| 36 | int hubaddr; |
| 37 | int hubport; |
| 38 | } split_info_t; |
| 39 | |
huang lin | 365250e | 2014-08-06 16:43:43 +0800 | [diff] [blame] | 40 | #define DWC2_INST(controller) ((dwc_ctrl_t *)((controller)->instance)) |
| 41 | #define DWC2_REG(controller) ((dwc2_reg_t *)((controller)->reg_base)) |
| 42 | |
| 43 | typedef enum { |
| 44 | HCSTAT_DONE = 0, |
| 45 | HCSTAT_XFERERR, |
| 46 | HCSTAT_BABBLE, |
| 47 | HCSTAT_STALL, |
Yunzhi Li | ebd3da7 | 2015-07-02 15:28:11 +0800 | [diff] [blame] | 48 | HCSTAT_ACK, |
| 49 | HCSTAT_NAK, |
| 50 | HCSTAT_NYET, |
huang lin | 365250e | 2014-08-06 16:43:43 +0800 | [diff] [blame] | 51 | HCSTAT_UNKNOW, |
| 52 | HCSTAT_TIMEOUT, |
Yunzhi Li | 4938426 | 2015-08-11 17:58:14 +0800 | [diff] [blame] | 53 | HCSTAT_DISCONNECTED, |
huang lin | 365250e | 2014-08-06 16:43:43 +0800 | [diff] [blame] | 54 | } hcstat_t; |
| 55 | #endif |