Port ppc driver to alpha.

Submitted by: Andrew M. Miklic <miklic@ibm.net>
This commit is contained in:
Doug Rabson 2000-05-14 13:47:57 +00:00
parent d5865fe838
commit 5c885c3f83
10 changed files with 97 additions and 7 deletions

View File

@ -116,6 +116,14 @@ device mcclock0 at isa? port 0x70
device sio0 at isa? port IO_COM1 irq 4
device sio1 at isa? port IO_COM2 irq 3 flags 0x50
# Parallel port
device ppc0 at isa? irq 7
device ppbus # Parallel port bus (required)
device lpt # Printer
device plip # TCP/IP over parallel
device ppi # Parallel port interface device
#device vpo # Requires scbus and da
# PCI Ethernet NICs.
device de # DEC/Intel DC21x4x (``Tulip'')
device fxp # Intel EtherExpress PRO/100B (82557, 82558)

View File

@ -116,6 +116,14 @@ device mcclock0 at isa? port 0x70
device sio0 at isa? port IO_COM1 irq 4
device sio1 at isa? port IO_COM2 irq 3 flags 0x50
# Parallel port
device ppc0 at isa? irq 7
device ppbus # Parallel port bus (required)
device lpt # Printer
device plip # TCP/IP over parallel
device ppi # Parallel port interface device
#device vpo # Requires scbus and da
# PCI Ethernet NICs.
device de # DEC/Intel DC21x4x (``Tulip'')
device fxp # Intel EtherExpress PRO/100B (82557, 82558)

View File

@ -61,6 +61,13 @@ breakpoint(void)
/*
* Bulk i/o (for IDE driver).
*/
static __inline void insb(u_int32_t port, void *buffer, size_t count)
{
u_int8_t *p = (u_int8_t *) buffer;
while (count--)
*p++ = inb(port);
}
static __inline void insw(u_int32_t port, void *buffer, size_t count)
{
u_int16_t *p = (u_int16_t *) buffer;
@ -75,6 +82,13 @@ static __inline void insl(u_int32_t port, void *buffer, size_t count)
*p++ = inl(port);
}
static __inline void outsb(u_int32_t port, const void *buffer, size_t count)
{
const u_int8_t *p = (const u_int8_t *) buffer;
while (count--)
outb(port, *p++);
}
static __inline void outsw(u_int32_t port, const void *buffer, size_t count)
{
const u_int16_t *p = (const u_int16_t *) buffer;

View File

@ -170,6 +170,7 @@ dev/syscons/sysmouse.c optional sc
isa/atkbd_isa.c optional atkbd
isa/atkbdc_isa.c optional atkbdc
isa/fd.c optional fd
isa/ppc.c optional ppc
isa/psm.c optional psm
isa/sio.c optional sio
isa/syscons_isa.c optional sc

View File

@ -15,6 +15,9 @@ DEC_3000_300 opt_cpu.h
DEC_3000_500 opt_cpu.h
DEC_1000A opt_cpu.h
PPC_PROBE_CHIPSET opt_ppc.h
PPC_DEBUG opt_ppc.h
SHOW_BUSYBUFS
PANIC_REBOOT_WAIT_TIME opt_panic.h

View File

@ -1764,7 +1764,31 @@ ppc_probe(device_t dev)
device_printf(dev, "cannot reserve I/O port range\n");
goto error;
}
ppc->ppc_base = rman_get_start(ppc->res_ioport);
/* Assume we support the extended IO range of some ppc chipsets...*/
ppc->rid_extraio = 1;
ppc->res_extraio =
bus_alloc_resource(dev,
SYS_RES_IOPORT,
&ppc->rid_extraio,
0,
~0,
IO_LPTSIZE,
RF_ACTIVE);
/* If we cannot reserve the extra ports for the extended IO range,
indicate this with a non-threatening message (this is not an error,
so don't treat it as such)... */
if (ppc->res_extraio == 0) {
ppc->rid_extraio = 0;
device_printf(dev, "This ppc chipset does not support the extended I/O port range...no problem\n");
}
ppc->ppc_base = rman_get_start(ppc->res_ioport);
ppc->ppc_flags = device_get_flags(dev);

View File

@ -100,8 +100,8 @@ struct ppc_data {
device_t ppbus; /* parallel port chipset corresponding ppbus */
int rid_irq, rid_drq, rid_ioport;
struct resource *res_irq, *res_drq, *res_ioport;
int rid_irq, rid_drq, rid_ioport, rid_extraio;
struct resource *res_irq, *res_drq, *res_ioport, *res_extraio;
void *intr_cookie;

View File

@ -157,7 +157,15 @@
#define IO_GSCSIZE 8 /* GeniScan GS-4500G hand scanner */
#define IO_ICUSIZE 16 /* 8259A interrupt controllers */
#define IO_KBDSIZE 16 /* 8042 Keyboard controllers */
#define IO_LPTSIZE 8 /* LPT controllers, some use only 4 */
/* The following line was changed to support more architectures (simpler
chipsets (like those for Alpha) only use 4, but more complex controllers
(usually modern i386's) can use an additional 4; the probe to see if
the additional 4 can be used by the specific chipset is now done in the ppc
code by ppc_probe()... */
#define IO_LPTSIZE 4 /* LPT controllers, Alpha only uses 4 */
#define IO_MDASIZE 12 /* Monochrome display controllers */
#define IO_NPXSIZE 16 /* 80387/80487 NPX registers */
#define IO_PMPSIZE 2 /* 82347 power management peripheral */

View File

@ -1764,7 +1764,31 @@ ppc_probe(device_t dev)
device_printf(dev, "cannot reserve I/O port range\n");
goto error;
}
ppc->ppc_base = rman_get_start(ppc->res_ioport);
/* Assume we support the extended IO range of some ppc chipsets...*/
ppc->rid_extraio = 1;
ppc->res_extraio =
bus_alloc_resource(dev,
SYS_RES_IOPORT,
&ppc->rid_extraio,
0,
~0,
IO_LPTSIZE,
RF_ACTIVE);
/* If we cannot reserve the extra ports for the extended IO range,
indicate this with a non-threatening message (this is not an error,
so don't treat it as such)... */
if (ppc->res_extraio == 0) {
ppc->rid_extraio = 0;
device_printf(dev, "This ppc chipset does not support the extended I/O port range...no problem\n");
}
ppc->ppc_base = rman_get_start(ppc->res_ioport);
ppc->ppc_flags = device_get_flags(dev);

View File

@ -100,8 +100,8 @@ struct ppc_data {
device_t ppbus; /* parallel port chipset corresponding ppbus */
int rid_irq, rid_drq, rid_ioport;
struct resource *res_irq, *res_drq, *res_ioport;
int rid_irq, rid_drq, rid_ioport, rid_extraio;
struct resource *res_irq, *res_drq, *res_ioport, *res_extraio;
void *intr_cookie;