summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/alpha/conf/GENERIC8
-rw-r--r--sys/alpha/conf/NOTES8
-rw-r--r--sys/alpha/include/cpufunc.h14
-rw-r--r--sys/conf/files.alpha1
-rw-r--r--sys/conf/options.alpha3
-rw-r--r--sys/dev/ppc/ppc.c26
-rw-r--r--sys/dev/ppc/ppcreg.h4
-rw-r--r--sys/isa/isareg.h10
-rw-r--r--sys/isa/ppc.c26
-rw-r--r--sys/isa/ppcreg.h4
10 files changed, 97 insertions, 7 deletions
diff --git a/sys/alpha/conf/GENERIC b/sys/alpha/conf/GENERIC
index 7ae6dce..3cb0b3e 100644
--- a/sys/alpha/conf/GENERIC
+++ b/sys/alpha/conf/GENERIC
@@ -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)
diff --git a/sys/alpha/conf/NOTES b/sys/alpha/conf/NOTES
index 7ae6dce..3cb0b3e 100644
--- a/sys/alpha/conf/NOTES
+++ b/sys/alpha/conf/NOTES
@@ -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)
diff --git a/sys/alpha/include/cpufunc.h b/sys/alpha/include/cpufunc.h
index 98f72e8..96a91b6 100644
--- a/sys/alpha/include/cpufunc.h
+++ b/sys/alpha/include/cpufunc.h
@@ -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;
diff --git a/sys/conf/files.alpha b/sys/conf/files.alpha
index ce54565..cfa8e32 100644
--- a/sys/conf/files.alpha
+++ b/sys/conf/files.alpha
@@ -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
diff --git a/sys/conf/options.alpha b/sys/conf/options.alpha
index f3c3c0d..5697855 100644
--- a/sys/conf/options.alpha
+++ b/sys/conf/options.alpha
@@ -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
diff --git a/sys/dev/ppc/ppc.c b/sys/dev/ppc/ppc.c
index 53cb50d..f0aa95d 100644
--- a/sys/dev/ppc/ppc.c
+++ b/sys/dev/ppc/ppc.c
@@ -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);
diff --git a/sys/dev/ppc/ppcreg.h b/sys/dev/ppc/ppcreg.h
index ec17806..ab0bf6f 100644
--- a/sys/dev/ppc/ppcreg.h
+++ b/sys/dev/ppc/ppcreg.h
@@ -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;
diff --git a/sys/isa/isareg.h b/sys/isa/isareg.h
index a2162cd..532da43 100644
--- a/sys/isa/isareg.h
+++ b/sys/isa/isareg.h
@@ -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 */
diff --git a/sys/isa/ppc.c b/sys/isa/ppc.c
index 53cb50d..f0aa95d 100644
--- a/sys/isa/ppc.c
+++ b/sys/isa/ppc.c
@@ -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);
diff --git a/sys/isa/ppcreg.h b/sys/isa/ppcreg.h
index ec17806..ab0bf6f 100644
--- a/sys/isa/ppcreg.h
+++ b/sys/isa/ppcreg.h
@@ -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;
OpenPOWER on IntegriCloud