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
RevLine 
[6886705]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
[6404aca]30/** @addtogroup uspace_drv_cuda_adb
[6886705]31 * @{
32 */
33/** @file
34 */
35
36#ifndef CUDA_HW_H_
37#define CUDA_HW_H_
38
[db8568a]39#include <ddi.h>
40
[6886705]41#include <stdint.h>
42
[7e55bed7]43typedef struct cuda_regs {
[db8568a]44 ioport8_t b;
[6886705]45 uint8_t pad0[0x1ff];
46
[db8568a]47 ioport8_t a;
[6886705]48 uint8_t pad1[0x1ff];
49
[db8568a]50 ioport8_t dirb;
[6886705]51 uint8_t pad2[0x1ff];
52
[db8568a]53 ioport8_t dira;
[6886705]54 uint8_t pad3[0x1ff];
55
[db8568a]56 ioport8_t t1cl;
[6886705]57 uint8_t pad4[0x1ff];
58
[db8568a]59 ioport8_t t1ch;
[6886705]60 uint8_t pad5[0x1ff];
61
[db8568a]62 ioport8_t t1ll;
[6886705]63 uint8_t pad6[0x1ff];
64
[db8568a]65 ioport8_t t1lh;
[6886705]66 uint8_t pad7[0x1ff];
67
[db8568a]68 ioport8_t t2cl;
[6886705]69 uint8_t pad8[0x1ff];
70
[db8568a]71 ioport8_t t2ch;
[6886705]72 uint8_t pad9[0x1ff];
73
[db8568a]74 ioport8_t sr;
[6886705]75 uint8_t pad10[0x1ff];
76
[db8568a]77 ioport8_t acr;
[6886705]78 uint8_t pad11[0x1ff];
79
[db8568a]80 ioport8_t pcr;
[6886705]81 uint8_t pad12[0x1ff];
82
[db8568a]83 ioport8_t ifr;
[6886705]84 uint8_t pad13[0x1ff];
85
[db8568a]86 ioport8_t ier;
[6886705]87 uint8_t pad14[0x1ff];
88
[db8568a]89 ioport8_t anh;
[6886705]90 uint8_t pad15[0x1ff];
[7e55bed7]91} cuda_regs_t;
[6886705]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.