summaryrefslogtreecommitdiff
path: root/os/js/ns16552.h
blob: d36e0c4a0bccbf3d851b8f6776bf1b141220e515 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
 *  Javastation specific code for the ns16552 (really the superio chip,
 *  but it has a serial port that looks like the ns16552).
 */
enum
{
	UartFREQ= 1843200,
	TTYABase = 0x2F8
};

#define uartwrreg(u,r,v)	outb((u)->port + r, (u)->sticky[r] | (v))
#define uartrdreg(u,r)		inb((u)->port + r)

void	ns16552setup(ulong, ulong, char*);

static void
uartpower(int, int)
{
}

/*
 *  handle an interrupt to a single uart
 */
static void
ns16552intrx(Ureg *ur, void *arg)
{
	USED(ur);

	ns16552intr((ulong)arg);
}

/*
 *  install the uarts (called by reset)
 */
void
ns16552install(void)
{
	static int already;
	void uartclock(void);

	if(already)
		return;
	already = 1;

	/* first two ports are always there and always the normal frequency */
	ns16552setup(superiova()+TTYABase, UartFREQ, "eia0");
	ns16552special(0, 38400, &kbdq, &printq, kbdputc);
	addclock0link(uartclock, 22);
}

/*
 * If the UART's receiver can be connected to a DMA channel,
 * this function does what is necessary to create the
 * connection and returns the DMA channel number.
 * If the UART's receiver cannot be connected to a DMA channel,
 * a -1 is returned.
 */
char
ns16552dmarcv(int dev)
{
 
	USED(dev);
        return -1;
}

long
dmasetup(int,void*,long,int)
{
	return 0;
}

void
dmaend(int)
{
}

int
dmacount(int)
{
	return 0;
}