source: mainline/uspace/drv/bus/adb/cuda_adb/cuda_hw.h@ a2afd8f

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since a2afd8f was e27e36e, checked in by Jiri Svoboda <jiri@…>, 8 years ago

Convert CUDA driver to DDF.

  • Property mode set to 100644
File size: 2.6 KB
Line 
1/*
2 * Copyright (c) 2006 Martin Decky
3 * Copyright (c) 2010 Jiri Svoboda
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * - Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * - Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * - The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30/** @addtogroup genarch
31 * @{
32 */
33/** @file
34 */
35
36#ifndef CUDA_HW_H_
37#define CUDA_HW_H_
38
39#include <stdint.h>
40
41typedef struct cuda_regs {
42 uint8_t b;
43 uint8_t pad0[0x1ff];
44
45 uint8_t a;
46 uint8_t pad1[0x1ff];
47
48 uint8_t dirb;
49 uint8_t pad2[0x1ff];
50
51 uint8_t dira;
52 uint8_t pad3[0x1ff];
53
54 uint8_t t1cl;
55 uint8_t pad4[0x1ff];
56
57 uint8_t t1ch;
58 uint8_t pad5[0x1ff];
59
60 uint8_t t1ll;
61 uint8_t pad6[0x1ff];
62
63 uint8_t t1lh;
64 uint8_t pad7[0x1ff];
65
66 uint8_t t2cl;
67 uint8_t pad8[0x1ff];
68
69 uint8_t t2ch;
70 uint8_t pad9[0x1ff];
71
72 uint8_t sr;
73 uint8_t pad10[0x1ff];
74
75 uint8_t acr;
76 uint8_t pad11[0x1ff];
77
78 uint8_t pcr;
79 uint8_t pad12[0x1ff];
80
81 uint8_t ifr;
82 uint8_t pad13[0x1ff];
83
84 uint8_t ier;
85 uint8_t pad14[0x1ff];
86
87 uint8_t anh;
88 uint8_t pad15[0x1ff];
89} cuda_regs_t;
90
91/** B register fields */
92enum {
93 TREQ = 0x08,
94 TACK = 0x10,
95 TIP = 0x20
96};
97
98/** IER register fields */
99enum {
100 IER_CLR = 0x00,
101 IER_SET = 0x80,
102
103 SR_INT = 0x04,
104 ALL_INT = 0x7f
105};
106
107/** ACR register fields */
108enum {
109 SR_OUT = 0x10
110};
111
112/** Packet types */
113enum {
114 PT_ADB = 0x00,
115 PT_CUDA = 0x01
116};
117
118/** CUDA packet types */
119enum {
120 CPT_AUTOPOLL = 0x01
121};
122
123enum {
124 ADB_MAX_ADDR = 16
125};
126
127#endif
128
129/** @}
130 */
Note: See TracBrowser for help on using the repository browser.