aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/isa
diff options
context:
space:
mode:
authorDavid Greenman <dg@FreeBSD.org>1994-10-01 02:56:21 +0000
committerDavid Greenman <dg@FreeBSD.org>1994-10-01 02:56:21 +0000
commit22414e535af32f5550d25c6409b5dae1cfc43ad0 (patch)
treecae0fc2309e6ae1169ee8bdcf42212d2f39fb3ea /sys/amd64/isa
parent7f4295e33795e2c758fe46c2b2291df1c683d844 (diff)
Laptop Advanced Power Management support by HOSOKAWA Tatsumi.
Submitted by: HOSOKAWA Tatsumi
Notes
Notes: svn path=/head/; revision=3258
Diffstat (limited to 'sys/amd64/isa')
-rw-r--r--sys/amd64/isa/icu.h9
-rw-r--r--sys/amd64/isa/isa.c137
-rw-r--r--sys/amd64/isa/isa.h8
3 files changed, 103 insertions, 51 deletions
diff --git a/sys/amd64/isa/icu.h b/sys/amd64/isa/icu.h
index 5cecf65b8f07..a68269b0801a 100644
--- a/sys/amd64/isa/icu.h
+++ b/sys/amd64/isa/icu.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)icu.h 5.6 (Berkeley) 5/9/91
- * $Id: icu.h,v 1.5 1994/09/18 23:08:56 bde Exp $
+ * $Id: icu.h,v 1.6 1994/09/18 23:18:32 bde Exp $
*/
/*
@@ -52,9 +52,10 @@
*/
extern unsigned imen; /* interrupt mask enable */
-#define INTREN(s) (imen &= ~(s), SET_ICUS())
-#define INTRDIS(s) (imen |= (s), SET_ICUS())
-#define INTRMASK(msk,s) (msk |= (s))
+#define INTREN(s) (imen &= ~(s), SET_ICUS())
+#define INTRDIS(s) (imen |= (s), SET_ICUS())
+#define INTRMASK(msk,s) (msk |= (s))
+#define INTRUNMASK(msk,s) (msk &= ~(s))
#if 0
#define SET_ICUS() (outb(IO_ICU1 + 1, imen), outb(IU_ICU2 + 1, imen >> 8))
#else
diff --git a/sys/amd64/isa/isa.c b/sys/amd64/isa/isa.c
index 2cd9d2367f83..2f93fccb6766 100644
--- a/sys/amd64/isa/isa.c
+++ b/sys/amd64/isa/isa.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
- * $Id: isa.c,v 1.25 1994/09/20 05:07:11 bde Exp $
+ * $Id: isa.c,v 1.26 1994/09/30 05:35:55 swallace Exp $
*/
/*
@@ -317,13 +317,35 @@ isa_configure() {
/*
* Configure an ISA device.
*/
+
+
+static void config_isadev_c();
+
static void
config_isadev(isdp, mp)
+ struct isa_device *isdp;
+ u_int *mp;
+{
+ config_isadev_c(isdp, mp, 0);
+}
+
+void
+reconfig_isadev(isdp, mp)
+ struct isa_device *isdp;
+ u_int *mp;
+{
+ config_isadev_c(isdp, mp, 1);
+}
+
+static void
+config_isadev_c(isdp, mp, reconfig)
struct isa_device *isdp;
u_int *mp;
+ int reconfig;
{
u_int checkbits;
int id_alive;
+ int last_alive;
struct isa_driver *dp = isdp->id_driver;
checkbits = 0;
@@ -339,12 +361,18 @@ config_isadev(isdp, mp)
#ifndef ALLOW_CONFLICT_MEMADDR
checkbits |= CC_MEMADDR;
#endif
- if (haveseen_isadev(isdp, checkbits))
+ if (!reconfig && haveseen_isadev(isdp, checkbits))
return;
- if (isdp->id_maddr) {
+ if (!reconfig && isdp->id_maddr) {
isdp->id_maddr -= 0xa0000; /* XXX should be a define */
isdp->id_maddr += atdevbase;
}
+ if (reconfig) {
+ last_alive = isdp->id_alive;
+ }
+ else {
+ last_alive = 0;
+ }
id_alive = (*dp->probe)(isdp);
if (id_alive) {
/*
@@ -354,50 +382,52 @@ config_isadev(isdp, mp)
* 16 it will not report I/O addresses.
* Rod Grimes 04/26/94
*/
- printf("%s%d", dp->name, isdp->id_unit);
- if (id_alive != -1) {
- printf(" at 0x%x", isdp->id_iobase);
- if ((isdp->id_iobase + id_alive - 1) !=
- isdp->id_iobase) {
- printf("-0x%x",
- isdp->id_iobase + id_alive - 1);
+ if (!isdp->id_reconfig) {
+ printf("%s%d", dp->name, isdp->id_unit);
+ if (id_alive != -1) {
+ printf(" at 0x%x", isdp->id_iobase);
+ if ((isdp->id_iobase + id_alive - 1) !=
+ isdp->id_iobase) {
+ printf("-0x%x",
+ isdp->id_iobase + id_alive - 1);
+ }
}
- }
- if (isdp->id_irq)
- printf(" irq %d", ffs(isdp->id_irq) - 1);
- if (isdp->id_drq != -1)
- printf(" drq %d", isdp->id_drq);
- if (isdp->id_maddr)
- printf(" maddr 0x%lx", kvtop(isdp->id_maddr));
- if (isdp->id_msize)
- printf(" msize %d", isdp->id_msize);
- if (isdp->id_flags)
- printf(" flags 0x%x", isdp->id_flags);
- if (isdp->id_iobase) {
- if (isdp->id_iobase < 0x100) {
- printf(" on motherboard\n");
- } else {
- if (isdp->id_iobase >= 0x1000) {
- printf (" on eisa\n");
+ if (isdp->id_irq)
+ printf(" irq %d", ffs(isdp->id_irq) - 1);
+ if (isdp->id_drq != -1)
+ printf(" drq %d", isdp->id_drq);
+ if (isdp->id_maddr)
+ printf(" maddr 0x%lx", kvtop(isdp->id_maddr));
+ if (isdp->id_msize)
+ printf(" msize %d", isdp->id_msize);
+ if (isdp->id_flags)
+ printf(" flags 0x%x", isdp->id_flags);
+ if (isdp->id_iobase) {
+ if (isdp->id_iobase < 0x100) {
+ printf(" on motherboard\n");
} else {
- printf (" on isa\n");
+ if (isdp->id_iobase >= 0x1000) {
+ printf (" on eisa\n");
+ } else {
+ printf (" on isa\n");
+ }
}
}
- }
- /*
- * Check for conflicts again. The driver may have changed
- * *dvp. We should weaken the early check since the
- * driver may have been able to change *dvp to avoid
- * conflicts if given a chance. We already skip the early
- * check for IRQs and force a check for IRQs in the next
- * group of checks.
- */
+ /*
+ * Check for conflicts again. The driver may have
+ * changed *dvp. We should weaken the early check
+ * since the driver may have been able to change
+ * *dvp to avoid conflicts if given a chance. We
+ * already skip the early check for IRQs and force
+ * a check for IRQs in the next group of checks.
+ */
#ifndef ALLOW_CONFLICT_IRQ
- checkbits |= CC_IRQ;
+ checkbits |= CC_IRQ;
#endif
- if (haveseen_isadev(isdp, checkbits))
- return;
- isdp->id_alive = id_alive;
+ if (haveseen_isadev(isdp, checkbits))
+ return;
+ isdp->id_alive = id_alive;
+ }
(*dp->attach)(isdp);
if (isdp->id_irq) {
if (mp)
@@ -408,11 +438,28 @@ config_isadev(isdp, mp)
INTREN(isdp->id_irq);
}
} else {
- printf("%s%d not found", dp->name, isdp->id_unit);
- if (isdp->id_iobase) {
- printf(" at 0x%x", isdp->id_iobase);
+ if (isdp->id_reconfig) {
+ (*dp->attach)(isdp); /* reconfiguration attach */
+ }
+ if (!last_alive) {
+ if (!isdp->id_reconfig) {
+ printf("%s%d not found", dp->name, isdp->id_unit);
+ if (isdp->id_iobase) {
+ printf(" at 0x%x", isdp->id_iobase);
+ }
+ printf("\n");
+ }
+ }
+ else {
+ /* This code has not been tested.... */
+ if (isdp->id_irq) {
+ INTRDIS(isdp->id_irq);
+ unregister_intr(ffs(isdp->id_irq) - 1,
+ isdp->id_intr);
+ if (mp)
+ INTRUNMASK(*mp, isdp->id_irq);
+ }
}
- printf("\n");
}
}
diff --git a/sys/amd64/isa/isa.h b/sys/amd64/isa/isa.h
index e2a26e719f03..7f6b02a761ff 100644
--- a/sys/amd64/isa/isa.h
+++ b/sys/amd64/isa/isa.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.h 5.7 (Berkeley) 5/9/91
- * $Id: isa.h,v 1.4 1994/01/05 15:03:28 rgrimes Exp $
+ * $Id: isa.h,v 1.5 1994/04/21 14:20:54 sos Exp $
*/
#ifndef _I386_ISA_ISA_H_
@@ -62,6 +62,7 @@ unsigned char rtcin __P((int));
/* CPU Board */
#define IO_DMA1 0x000 /* 8237A DMA Controller #1 */
#define IO_ICU1 0x020 /* 8259A Interrupt Controller #1 */
+#define IO_PMP1 0x026 /* 82347 Power Management Peripheral */
#define IO_TIMER1 0x040 /* 8253 Timer #1 */
#define IO_TIMER2 0x048 /* 8253 Timer #2 */
#define IO_KBD 0x060 /* 8042 Keyboard */
@@ -78,7 +79,9 @@ unsigned char rtcin __P((int));
#define IO_WD2 0x170 /* Secondary Fixed Disk Controller */
- /* 0x178 - 0x1EF Open */
+#define IO_PMP2 0x178 /* 82347 Power Management Peripheral */
+
+ /* 0x17A - 0x1EF Open */
#define IO_WD1 0x1f0 /* Primary Fixed Disk Controller */
#define IO_GAME 0x200 /* Game Controller */
@@ -146,6 +149,7 @@ unsigned char rtcin __P((int));
#define IO_TMRSIZE 16 /* 8253 programmable timers */
#define IO_NPXSIZE 16 /* 80387/80487 NPX registers */
#define IO_VGASIZE 16 /* VGA controllers */
+#define IO_PMPSIZE 2 /* 82347 power management peripheral */
#endif /* IO_ISASIZES */