summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMarc Balmer <mbalmer@cvs.openbsd.org>2007-10-07 18:41:08 +0000
committerMarc Balmer <mbalmer@cvs.openbsd.org>2007-10-07 18:41:08 +0000
commit042762629ae171662af5c1caeee0b2d3797e2230 (patch)
tree4b8a0de6bfa0febd341c88072b9495fa1ee56eb4 /sys/arch
parentd297dc193bfe20930e7d8c895fb00f4b5e0eab99 (diff)
Add a driver, amdpcib(4), for the AMD 8111 series LPC bridge and HPET written
by mickey, man page by me. Help, suggestions by Theo and jmc. Enable this driver and glxpcib(4) in all RAMDISK kernel, but glxpcib(4) does not provide the watchdog timer in the RAMDISK kernels. Prodded by deraadt. E
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/amd64/conf/GENERIC4
-rw-r--r--sys/arch/amd64/conf/files.amd649
-rw-r--r--sys/arch/i386/conf/GENERIC3
-rw-r--r--sys/arch/i386/conf/RAMDISK6
-rw-r--r--sys/arch/i386/conf/RAMDISKB7
-rw-r--r--sys/arch/i386/conf/RAMDISKC6
-rw-r--r--sys/arch/i386/conf/RAMDISK_CD6
-rw-r--r--sys/arch/i386/conf/files.i3869
-rw-r--r--sys/arch/i386/pci/glxpcib.c15
9 files changed, 51 insertions, 14 deletions
diff --git a/sys/arch/amd64/conf/GENERIC b/sys/arch/amd64/conf/GENERIC
index 92c658c0362..20d7007b35a 100644
--- a/sys/arch/amd64/conf/GENERIC
+++ b/sys/arch/amd64/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.198 2007/09/30 10:16:56 jsg Exp $
+# $OpenBSD: GENERIC,v 1.199 2007/10/07 18:41:07 mbalmer Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
@@ -35,6 +35,7 @@ bios0 at mainbus?
cpu0 at mainbus?
isa0 at mainbus0
isa0 at pcib?
+isa0 at amdpcib?
pci* at mainbus0
#option ACPIVERBOSE
@@ -62,6 +63,7 @@ ppb* at pci? # PCI-PCI bridges
pci* at ppb?
pci* at pchb?
pcib* at pci? # PCI-ISA bridge
+amdpcib* at pci? # AMD 8111 LPC bridge
# National Semiconductor LM7[89] and compatible hardware monitors
lm0 at isa? port 0x290
diff --git a/sys/arch/amd64/conf/files.amd64 b/sys/arch/amd64/conf/files.amd64
index bb14e4e4ae7..3c5fa842f78 100644
--- a/sys/arch/amd64/conf/files.amd64
+++ b/sys/arch/amd64/conf/files.amd64
@@ -1,4 +1,4 @@
-# $OpenBSD: files.amd64,v 1.34 2007/09/12 18:18:27 deraadt Exp $
+# $OpenBSD: files.amd64,v 1.35 2007/10/07 18:41:07 mbalmer Exp $
maxpartitions 16
maxusers 2 16 128
@@ -127,7 +127,12 @@ include "dev/pcmcia/files.pcmcia"
# PCI-ISA bridges
device pcib: isabus
attach pcib at pci
-file arch/amd64/pci/pcib.c pcib
+file arch/amd64/pci/pcib.c pcib | amdpcib
+
+# AMD 8111 LPC bridge
+device amdpcib: isabus
+attach amdpcib at pci
+file dev/pci/amdpcib.c amdpcib
device aapic
attach aapic at pci
diff --git a/sys/arch/i386/conf/GENERIC b/sys/arch/i386/conf/GENERIC
index f8d5a237bd9..75d84f496ee 100644
--- a/sys/arch/i386/conf/GENERIC
+++ b/sys/arch/i386/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.579 2007/10/07 13:41:48 mbalmer Exp $
+# $OpenBSD: GENERIC,v 1.580 2007/10/07 18:41:07 mbalmer Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
@@ -82,6 +82,7 @@ ppb* at pci? # PCI-PCI bridges
pci* at ppb?
pci* at pchb?
pcib* at pci? # PCI-ISA bridge
+amdpcib* at pci? # AMD 8111 LPC bridge
ichpcib* at pci? # Intel ICHx/ICHx-M LPC bridges
piixpcib* at pci? # Intel PIIX4 PCI-ISA bridge
gscpcib* at pci? # NS Geode SC1100 PCI-ISA bridge
diff --git a/sys/arch/i386/conf/RAMDISK b/sys/arch/i386/conf/RAMDISK
index 2723a013ef1..ff978188cce 100644
--- a/sys/arch/i386/conf/RAMDISK
+++ b/sys/arch/i386/conf/RAMDISK
@@ -1,4 +1,4 @@
-# $OpenBSD: RAMDISK,v 1.153 2007/07/04 19:27:48 deraadt Exp $
+# $OpenBSD: RAMDISK,v 1.154 2007/10/07 18:41:07 mbalmer Exp $
machine i386 # architecture, used by config; REQUIRED
@@ -57,8 +57,10 @@ pcibios0 at bios0 flags 0x0000
isa0 at mainbus0
isa0 at pcib?
+isa0 at amdpcib?
isa0 at ichpcib?
isa0 at gscpcib?
+isa0 at glxpcib?
eisa0 at mainbus0
pci* at mainbus0
@@ -72,7 +74,9 @@ pci* at pchb?
pcib* at pci? # PCI-ISA bridge
ichpcib* at pci? # Intel ICHx/ICHx-M LPC bridges
gscpcib* at pci? # NS Geode SC1100 PCI-ISA bridge
+amdpcib* at pci? # AMD 8111 LPC bridge
geodesc* at pci? # Geode SC1100/SCx200 IAOC
+glxpcib* at pci? # AMD CS5536 PCI-ISA bridge
# ISA PCMCIA controllers
pcic0 at isa? port 0x3e0 iomem 0xd0000 iosiz 0x4000
diff --git a/sys/arch/i386/conf/RAMDISKB b/sys/arch/i386/conf/RAMDISKB
index 8c50c1e6f87..e53a752db92 100644
--- a/sys/arch/i386/conf/RAMDISKB
+++ b/sys/arch/i386/conf/RAMDISKB
@@ -1,4 +1,4 @@
-# $OpenBSD: RAMDISKB,v 1.97 2007/05/29 18:18:19 tom Exp $
+# $OpenBSD: RAMDISKB,v 1.98 2007/10/07 18:41:07 mbalmer Exp $
machine i386 # architecture, used by config; REQUIRED
@@ -59,6 +59,8 @@ isa0 at mainbus0
isa0 at pcib?
isa0 at ichpcib?
isa0 at gscpcib?
+isa0 at glxpcib?
+isa0 at amdpcib?
#eisa0 at mainbus0
pci* at mainbus0
@@ -72,6 +74,9 @@ pci* at pchb?
pcib* at pci? # PCI-ISA bridge
ichpcib* at pci? # Intel ICHx/ICHx-M LPC bridges
gscpcib* at pci? # NS Geode SC1100 PCI-ISA bridge
+amdpcib* at pci? # AMD 8111 LPC bridge
+glxpcib* at pci? # AMD CS5536 PCI-ISA bridge
+
geodesc* at pci? # Geode SC1100/SCx200 IAOC
# ISA PCMCIA controllers
diff --git a/sys/arch/i386/conf/RAMDISKC b/sys/arch/i386/conf/RAMDISKC
index e2433efdd9a..b7b7932e717 100644
--- a/sys/arch/i386/conf/RAMDISKC
+++ b/sys/arch/i386/conf/RAMDISKC
@@ -1,4 +1,4 @@
-# $OpenBSD: RAMDISKC,v 1.77 2007/07/21 01:19:52 deraadt Exp $
+# $OpenBSD: RAMDISKC,v 1.78 2007/10/07 18:41:07 mbalmer Exp $
machine i386 # architecture, used by config; REQUIRED
@@ -59,6 +59,8 @@ isa0 at mainbus0
isa0 at pcib?
isa0 at ichpcib?
isa0 at gscpcib?
+isa0 at glxpcib?
+isa0 at amdpcib?
#eisa0 at mainbus0
pci* at mainbus0
@@ -72,7 +74,9 @@ pci* at pchb?
pcib* at pci? # PCI-ISA bridge
ichpcib* at pci? # Intel ICHx/ICHx-M LPC bridges
gscpcib* at pci? # NS Geode SC1100 PCI-ISA bridge
+amdpcib* at pci? # AMD 8111 LPC bridge
geodesc* at pci? # Geode SC1100/SCx200 IAOC
+glxpcib* at pci? # AMD CS5536 PCI-ISA bridge
# ISA PCMCIA controllers
pcic0 at isa? port 0x3e0 iomem 0xd0000 iosiz 0x4000
diff --git a/sys/arch/i386/conf/RAMDISK_CD b/sys/arch/i386/conf/RAMDISK_CD
index 15fef3efd18..5c7df0d6a2f 100644
--- a/sys/arch/i386/conf/RAMDISK_CD
+++ b/sys/arch/i386/conf/RAMDISK_CD
@@ -1,4 +1,4 @@
-# $OpenBSD: RAMDISK_CD,v 1.142 2007/07/02 14:29:37 dlg Exp $
+# $OpenBSD: RAMDISK_CD,v 1.143 2007/10/07 18:41:07 mbalmer Exp $
machine i386 # architecture, used by config; REQUIRED
@@ -61,6 +61,8 @@ isa0 at mainbus0
isa0 at pcib?
isa0 at ichpcib?
isa0 at gscpcib?
+isa0 at glxpcib?
+isa0 at amdpcib?
eisa0 at mainbus0
pci* at mainbus0
@@ -74,6 +76,8 @@ pci* at pchb?
pcib* at pci? # PCI-ISA bridge
ichpcib* at pci? # Intel ICHx/ICHx-M LPC bridges
gscpcib* at pci? # NS Geode SC1100 PCI-ISA bridge
+glxpcib* at pci? # AMD CS5536 PCI-ISA bridge
+amdpcib* at pci? # AMD 8111 LPC bridge
geodesc* at pci? # Geode SC1100/SCx200 IAOC
# CardBus bus support
diff --git a/sys/arch/i386/conf/files.i386 b/sys/arch/i386/conf/files.i386
index 1ff9e84a4e6..e9adcb32ece 100644
--- a/sys/arch/i386/conf/files.i386
+++ b/sys/arch/i386/conf/files.i386
@@ -1,4 +1,4 @@
-# $OpenBSD: files.i386,v 1.165 2007/10/07 13:41:48 mbalmer Exp $
+# $OpenBSD: files.i386,v 1.166 2007/10/07 18:41:07 mbalmer Exp $
#
# new style config file for i386 architecture
#
@@ -140,7 +140,7 @@ file arch/i386/pci/glxpcib.c glxpcib
# PCI-ISA bridge chipsets
device pcib: isabus
attach pcib at pci
-file arch/i386/pci/pcib.c pcib | ichpcib | gscpcib | glxpcib | piixpcib
+file arch/i386/pci/pcib.c pcib | ichpcib | gscpcib | glxpcib | piixpcib | amdpcib
# Intel ICHx/ICHx-M LPC bridges
device ichpcib: isabus
@@ -157,6 +157,11 @@ device gscpcib: isabus, gpiobus
attach gscpcib at pci
file arch/i386/pci/gscpcib.c gscpcib
+# AMD 8111 LPC bridge
+device amdpcib: isabus
+attach amdpcib at pci
+file dev/pci/amdpcib.c amdpcib
+
device hme: ether, ifnet, mii, ifmedia
file dev/ic/hme.c hme
attach hme at pci with hme_pci
diff --git a/sys/arch/i386/pci/glxpcib.c b/sys/arch/i386/pci/glxpcib.c
index 64d179616f3..9426e80d20e 100644
--- a/sys/arch/i386/pci/glxpcib.c
+++ b/sys/arch/i386/pci/glxpcib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: glxpcib.c,v 1.1 2007/10/07 13:41:48 mbalmer Exp $ */
+/* $OpenBSD: glxpcib.c,v 1.2 2007/10/07 18:41:07 mbalmer Exp $ */
/*
* Copyright (c) 2007 Michael Shalayeff
@@ -34,9 +34,9 @@
#include <dev/pci/pcivar.h>
#include <dev/pci/pcidevs.h>
-#define AMD5536_REV 0x51400017
+#define AMD5536_REV 0x51400017
#define AMD5536_REV_MASK 0xff
-#define AMD5536_TMC 0x51400050
+#define AMD5536_TMC 0x51400050
#define MSR_LBAR_MFGPT 0x5140000d
#define AMD5536_MFGPT0_CMP1 0x00000000
@@ -125,7 +125,9 @@ struct cfattach glxpcib_ca = {
void pcibattach(struct device *parent, struct device *self, void *aux);
u_int glxpcib_get_timecount(struct timecounter *tc);
+#ifndef SMALL_KERNEL
int glxpcib_wdogctl_cb(void *, int);
+#endif
const struct pci_matchid glxpcib_devices[] = {
{ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_CS5536_PCIB }
@@ -146,8 +148,10 @@ glxpcib_attach(struct device *parent, struct device *self, void *aux)
{
struct glxpcib_softc *sc = (struct glxpcib_softc *)self;
struct timecounter *tc = &sc->sc_timecounter;
+#ifndef SMALL_KERNEL
struct pci_attach_args *pa = aux;
u_int64_t wa;
+#endif
tc->tc_get_timecount = glxpcib_get_timecount;
tc->tc_counter_mask = 0xffffffff;
@@ -161,6 +165,7 @@ glxpcib_attach(struct device *parent, struct device *self, void *aux)
(int)rdmsr(AMD5536_REV) & AMD5536_REV_MASK,
tc->tc_frequency);
+#ifndef SMALL_KERNEL
sc->sc_iot = pa->pa_iot;
wa = rdmsr(MSR_LBAR_MFGPT);
if (wa & 0x100000000ULL &&
@@ -174,7 +179,7 @@ glxpcib_attach(struct device *parent, struct device *self, void *aux)
printf(", watchdog");
}
-
+#endif
pcibattach(parent, self, aux);
}
@@ -184,6 +189,7 @@ glxpcib_get_timecount(struct timecounter *tc)
return rdmsr(AMD5536_TMC);
}
+#ifndef SMALL_KERNEL
int
glxpcib_wdogctl_cb(void *v, int period)
{
@@ -206,3 +212,4 @@ glxpcib_wdogctl_cb(void *v, int period)
return (period);
}
+#endif