source: mainline/uspace/drv/ohci/ohci_regs.h@ c2be0e5

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since c2be0e5 was 2c617b0, checked in by Jan Vesely <jano.vesely@…>, 14 years ago

Basic OHCI initialization

  • Property mode set to 100644
File size: 3.3 KB
Line 
1/*
2 * Copyright (c) 2011 Jan Vesely
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/** @addtogroup drvusbohcihc
30 * @{
31 */
32/** @file
33 * @brief OHCI host controller register structure
34 */
35#ifndef DRV_OHCI_OHCI_REGS_H
36#define DRV_OHCI_OHCI_REGS_H
37#include <stdint.h>
38
39typedef struct ohci_regs
40{
41 const volatile uint32_t revision;
42 volatile uint32_t control;
43#define C_CSBR_MASK (0x3)
44#define C_CSBR_SHIFT (0)
45#define C_PLE (1 << 2)
46#define C_IE (1 << 3)
47#define C_CLE (1 << 4)
48#define C_BLE (1 << 5)
49
50#define C_HCFS_MASK (0x3)
51#define C_HCFS_SHIFT (6)
52#define C_HCFS_RESET (0x0)
53#define C_HCFS_OPERATIONAL (0x1)
54#define C_HCFS_RESUME (0x2)
55#define C_HCFS_SUSPEND (0x3)
56
57#define C_IR (1 << 8)
58#define C_RWC (1 << 9)
59#define C_RWE (1 << 10)
60
61 volatile uint32_t command_status;
62#define CS_HCR (1 << 0)
63#define CS_CLF (1 << 1)
64#define CS_BLF (1 << 2)
65#define CS_OCR (1 << 3)
66#define CS_SOC_MASK (0x3)
67#define CS_SOC_SHIFT (16)
68
69 volatile uint32_t interrupt_status;
70#define IS_SO (1 << 0)
71#define IS_WDH (1 << 1)
72#define IS_SF (1 << 2)
73#define IS_RD (1 << 3)
74#define IS_UE (1 << 4)
75#define IS_FNO (1 << 5)
76#define IS_RHSC (1 << 6)
77#define IS_OC (1 << 30)
78
79 volatile uint32_t interupt_enable;
80#define IE_SO (1 << 0)
81#define IE_WDH (1 << 1)
82#define IE_SF (1 << 2)
83#define IE_RD (1 << 3)
84#define IE_UE (1 << 4)
85#define IE_FNO (1 << 5)
86#define IE_RHSC (1 << 6)
87#define IE_OC (1 << 30)
88#define IE_MIE (1 << 31)
89
90 volatile uint32_t interrupt_disable;
91 volatile uint32_t hcca;
92 volatile uint32_t period_corrent;
93 volatile uint32_t control_head;
94 volatile uint32_t control_current;
95 volatile uint32_t bulk_head;
96 volatile uint32_t bulk_current;
97 volatile uint32_t done_head;
98 volatile uint32_t fm_interval;
99 volatile uint32_t fm_remaining;
100 volatile uint32_t fm_number;
101 volatile uint32_t periodic_start;
102 volatile uint32_t ls_threshold;
103 volatile uint32_t rh_desc_a;
104 volatile uint32_t rh_desc_b;
105 volatile uint32_t rh_status;
106 volatile uint32_t rh_port_status[];
107} __attribute__((packed)) ohci_regs_t;
108#endif
109/**
110 * @}
111 */
Note: See TracBrowser for help on using the repository browser.