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

Last change on this file was db8568a, checked in by Jakub Jermar <jakub@…>, 6 years ago

Use ioport8_t for CUDA registers

  • Property mode set to 100644
File size: 2.7 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 uspace_drv_cuda_adb
31 * @{
32 */
33/** @file
34 */
35
36#ifndef CUDA_HW_H_
37#define CUDA_HW_H_
38
39#include <ddi.h>
40
41#include <stdint.h>
42
43typedef struct cuda_regs {
44 ioport8_t b;
45 uint8_t pad0[0x1ff];
46
47 ioport8_t a;
48 uint8_t pad1[0x1ff];
49
50 ioport8_t dirb;
51 uint8_t pad2[0x1ff];
52
53 ioport8_t dira;
54 uint8_t pad3[0x1ff];
55
56 ioport8_t t1cl;
57 uint8_t pad4[0x1ff];
58
59 ioport8_t t1ch;
60 uint8_t pad5[0x1ff];
61
62 ioport8_t t1ll;
63 uint8_t pad6[0x1ff];
64
65 ioport8_t t1lh;
66 uint8_t pad7[0x1ff];
67
68 ioport8_t t2cl;
69 uint8_t pad8[0x1ff];
70
71 ioport8_t t2ch;
72 uint8_t pad9[0x1ff];
73
74 ioport8_t sr;
75 uint8_t pad10[0x1ff];
76
77 ioport8_t acr;
78 uint8_t pad11[0x1ff];
79
80 ioport8_t pcr;
81 uint8_t pad12[0x1ff];
82
83 ioport8_t ifr;
84 uint8_t pad13[0x1ff];
85
86 ioport8_t ier;
87 uint8_t pad14[0x1ff];
88
89 ioport8_t anh;
90 uint8_t pad15[0x1ff];
91} cuda_regs_t;
92
93/** B register fields */
94enum {
95 TREQ = 0x08,
96 TACK = 0x10,
97 TIP = 0x20
98};
99
100/** IER register fields */
101enum {
102 IER_CLR = 0x00,
103 IER_SET = 0x80,
104
105 SR_INT = 0x04,
106 ALL_INT = 0x7f
107};
108
109/** ACR register fields */
110enum {
111 SR_OUT = 0x10
112};
113
114/** Packet types */
115enum {
116 PT_ADB = 0x00,
117 PT_CUDA = 0x01
118};
119
120/** CUDA packet types */
121enum {
122 CPT_AUTOPOLL = 0x01
123};
124
125enum {
126 ADB_MAX_ADDR = 16
127};
128
129#endif
130
131/** @}
132 */
Note: See TracBrowser for help on using the repository browser.