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