1/*-
2 * Device driver for Specialix range (SI/XIO) of serial line multiplexors.
3 * 'C' definitions for Specialix serial multiplex driver.
4 *
5 * Copyright (C) 1990, 1992, 1998 Specialix International,
6 * Copyright (C) 1993, Andy Rutter <andy@acronym.co.uk>
7 * Copyright (C) 1995, Peter Wemm <peter@netplex.com.au>
8 *
9 * Derived from:	SunOS 4.x version
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 *    notices, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 *    notices, this list of conditions and the following disclaimer in the
18 *    documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 *    must display the following acknowledgement:
21 *	This product includes software developed by Andy Rutter of
22 *	Advanced Methods and Tools Ltd. based on original information
23 *	from Specialix International.
24 * 4. Neither the name of Advanced Methods and Tools, nor Specialix
25 *    International may be used to endorse or promote products derived from
26 *    this software without specific prior written permission.
27 *
28 * THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY EXPRESS OR IMPLIED
29 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
31 * NO EVENT SHALL THE AUTHORS BE LIABLE.
32 *
33 * $FreeBSD$
34 */
35
36/*
37 * Hardware parameters which should be changed at your peril!
38 */
39
40/* Base and mask for SI Host 2.x (SIHOST2) */
41#define SIPLSIG		0x7FF8			/* Start of control space */
42#define SIPLCNTL	0x7FF8			/* Ditto */
43#define SIPLRESET	SIPLCNTL		/* 0 = reset */
44#define SIPLIRQ11	(SIPLCNTL+1)		/* 0 = mask irq 11 */
45#define SIPLIRQ12	(SIPLCNTL+2)		/* 0 = mask irq 12 */
46#define SIPLIRQ15	(SIPLCNTL+3)		/* 0 = mask irq 15 */
47#define SIPLIRQSET	(SIPLCNTL+4)		/* 0 = interrupt host */
48#define SIPLIRQCLR	(SIPLCNTL+5)		/* 0 = clear irq */
49
50/* SI Host 1.x */
51#define	SIRAM		0x0000			/* Ram Starts here */
52#define	SIRESET		0x8000			/* Set reset */
53#define	SIRESET_CL 	0xc000			/* Clear reset */
54#define	SIWAIT		0x9000			/* Set wait */
55#define	SIWAIT_CL 	0xd000			/* Set wait */
56#define SIINTCL		0xA000			/* Clear host int */
57#define SIINTCL_CL 	0xE000			/* Clear host int */
58
59/* SI EISA */
60#define SIEISADEVID	0x4d980411		/* EISA Device ID */
61#define SIEISABASE	0xc00			/* Our ports start here */
62#define SIEISAIOSIZE	0x100			/* XXX How many ports */
63
64/* SI old PCI */
65#define SIPCIBADR	PCIR_BAR(0)		/* Which BADR to map in RAM */
66#define SIPCI_MEMSIZE	0x100000		/* Mapping size */
67#define SIPCIRESET	0xc0001			/* 0 = Reset */
68#define SIPCIINTCL	0x40001			/* 0 = clear int */
69
70/* SI Jet PCI */
71#define SIJETSSIDREG	PCIR_SUBVEND_0		/* Is it an SX or RIO? */
72#define SIJETBADR	PCIR_BAR(2)		/* Which BADR to map in RAM */
73/* SI Jet PCI & ISA */
74#define SIJETIDBASE	0x7c00			/* ID ROM base */
75#define SISPLXID	0x984d			/* Specialix ID */
76#define SIUNIQID	0x7c0e			/* & 0xf0 = 0x20 for SX */
77#define SIJETIDSTR	0x7c20			/* ID ROM string */
78#define SIJETRESET	0x7d00
79#define SIJETINTCL	0x7d80
80#define SIJETCONFIG	0x7c00			/* for ISA, top nibble = IRQ */
81#define SIJETBUSEN	0x2
82#define SIJETIRQEN	0x4
83
84/*
85 * MEMSIZE is the total shared mem region
86 * RAMSIZE is value to use when probing
87 * PROBEALLOC is the amount to bus_resource_alloc() during probe.
88 */
89#define SIJETPCI_MEMSIZE	0x10000
90#define SIJETISA_MEMSIZE	0x8000
91#define SIJET_RAMSIZE		0x7000
92#define	SIHOST_MEMSIZE		0x10000
93#define	SIHOST_RAMSIZE		0x8000
94#define	SIHOST2_MEMSIZE		0x8000
95#define	SIHOST2_RAMSIZE		0x7ff7
96#define	SIEISA_MEMSIZE		0x10000
97#define	SIEISA_RAMSIZE		0x10000
98#define SIPROBEALLOC		0x8000
99