| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ichlpcib.c,v 1.29 2011/04/04 20:37:55 dyoung Exp $ */ | | 1 | /* $NetBSD: ichlpcib.c,v 1.30 2011/06/06 14:33:31 msaitoh Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2004 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2004 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Minoura Makoto and Matthew R. Green. | | 8 | * by Minoura Makoto and Matthew R. Green. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -29,27 +29,27 @@ | | | @@ -29,27 +29,27 @@ |
29 | * POSSIBILITY OF SUCH DAMAGE. | | 29 | * POSSIBILITY OF SUCH DAMAGE. |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | /* | | 32 | /* |
33 | * Intel I/O Controller Hub (ICHn) LPC Interface Bridge driver | | 33 | * Intel I/O Controller Hub (ICHn) LPC Interface Bridge driver |
34 | * | | 34 | * |
35 | * LPC Interface Bridge is basically a pcib (PCI-ISA Bridge), but has | | 35 | * LPC Interface Bridge is basically a pcib (PCI-ISA Bridge), but has |
36 | * some power management and monitoring functions. | | 36 | * some power management and monitoring functions. |
37 | * Currently we support the watchdog timer, SpeedStep (on some systems) | | 37 | * Currently we support the watchdog timer, SpeedStep (on some systems) |
38 | * and the power management timer. | | 38 | * and the power management timer. |
39 | */ | | 39 | */ |
40 | | | 40 | |
41 | #include <sys/cdefs.h> | | 41 | #include <sys/cdefs.h> |
42 | __KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.29 2011/04/04 20:37:55 dyoung Exp $"); | | 42 | __KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.30 2011/06/06 14:33:31 msaitoh Exp $"); |
43 | | | 43 | |
44 | #include <sys/types.h> | | 44 | #include <sys/types.h> |
45 | #include <sys/param.h> | | 45 | #include <sys/param.h> |
46 | #include <sys/systm.h> | | 46 | #include <sys/systm.h> |
47 | #include <sys/device.h> | | 47 | #include <sys/device.h> |
48 | #include <sys/sysctl.h> | | 48 | #include <sys/sysctl.h> |
49 | #include <sys/timetc.h> | | 49 | #include <sys/timetc.h> |
50 | #include <sys/gpio.h> | | 50 | #include <sys/gpio.h> |
51 | #include <machine/bus.h> | | 51 | #include <machine/bus.h> |
52 | | | 52 | |
53 | #include <dev/pci/pcivar.h> | | 53 | #include <dev/pci/pcivar.h> |
54 | #include <dev/pci/pcireg.h> | | 54 | #include <dev/pci/pcireg.h> |
55 | #include <dev/pci/pcidevs.h> | | 55 | #include <dev/pci/pcidevs.h> |
| @@ -173,27 +173,27 @@ CFATTACH_DECL2_NEW(ichlpcib, sizeof(stru | | | @@ -173,27 +173,27 @@ CFATTACH_DECL2_NEW(ichlpcib, sizeof(stru |
173 | | | 173 | |
174 | static struct lpcib_device { | | 174 | static struct lpcib_device { |
175 | pcireg_t vendor, product; | | 175 | pcireg_t vendor, product; |
176 | int has_rcba; | | 176 | int has_rcba; |
177 | int has_ich5_hpet; | | 177 | int has_ich5_hpet; |
178 | } lpcib_devices[] = { | | 178 | } lpcib_devices[] = { |
179 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801AA_LPC, 0, 0 }, | | 179 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801AA_LPC, 0, 0 }, |
180 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801AB_LPC, 0, 0 }, | | 180 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801AB_LPC, 0, 0 }, |
181 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801BA_LPC, 0, 0 }, | | 181 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801BA_LPC, 0, 0 }, |
182 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801BAM_LPC, 0, 0 }, | | 182 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801BAM_LPC, 0, 0 }, |
183 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801CA_LPC, 0, 0 }, | | 183 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801CA_LPC, 0, 0 }, |
184 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801CAM_LPC, 0, 0 }, | | 184 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801CAM_LPC, 0, 0 }, |
185 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801DB_LPC, 0, 0 }, | | 185 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801DB_LPC, 0, 0 }, |
186 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801DB_ISA, 0, 0 }, | | 186 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801DBM_LPC, 0, 0 }, |
187 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801EB_LPC, 0, 1 }, | | 187 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801EB_LPC, 0, 1 }, |
188 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801FB_LPC, 1, 0 }, | | 188 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801FB_LPC, 1, 0 }, |
189 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801FBM_LPC, 1, 0 }, | | 189 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801FBM_LPC, 1, 0 }, |
190 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801G_LPC, 1, 0 }, | | 190 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801G_LPC, 1, 0 }, |
191 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801GBM_LPC, 1, 0 }, | | 191 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801GBM_LPC, 1, 0 }, |
192 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801GHM_LPC, 1, 0 }, | | 192 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801GHM_LPC, 1, 0 }, |
193 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801H_LPC, 1, 0 }, | | 193 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801H_LPC, 1, 0 }, |
194 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801HEM_LPC, 1, 0 }, | | 194 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801HEM_LPC, 1, 0 }, |
195 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801HH_LPC, 1, 0 }, | | 195 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801HH_LPC, 1, 0 }, |
196 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801HO_LPC, 1, 0 }, | | 196 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801HO_LPC, 1, 0 }, |
197 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801HBM_LPC, 1, 0 }, | | 197 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801HBM_LPC, 1, 0 }, |
198 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801IH_LPC, 1, 0 }, | | 198 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801IH_LPC, 1, 0 }, |
199 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801IO_LPC, 1, 0 }, | | 199 | { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801IO_LPC, 1, 0 }, |
| @@ -795,27 +795,27 @@ speedstep_bad_hb_check(const struct pci_ | | | @@ -795,27 +795,27 @@ speedstep_bad_hb_check(const struct pci_ |
795 | return 1; | | 795 | return 1; |
796 | | | 796 | |
797 | return 0; | | 797 | return 0; |
798 | } | | 798 | } |
799 | | | 799 | |
800 | static void | | 800 | static void |
801 | speedstep_configure(device_t self) | | 801 | speedstep_configure(device_t self) |
802 | { | | 802 | { |
803 | struct lpcib_softc *sc = device_private(self); | | 803 | struct lpcib_softc *sc = device_private(self); |
804 | const struct sysctlnode *node, *ssnode; | | 804 | const struct sysctlnode *node, *ssnode; |
805 | int rv; | | 805 | int rv; |
806 | | | 806 | |
807 | /* Supported on ICH2-M, ICH3-M and ICH4-M. */ | | 807 | /* Supported on ICH2-M, ICH3-M and ICH4-M. */ |
808 | if (PCI_PRODUCT(sc->sc_pa.pa_id) == PCI_PRODUCT_INTEL_82801DB_ISA || | | 808 | if (PCI_PRODUCT(sc->sc_pa.pa_id) == PCI_PRODUCT_INTEL_82801DBM_LPC || |
809 | PCI_PRODUCT(sc->sc_pa.pa_id) == PCI_PRODUCT_INTEL_82801CAM_LPC || | | 809 | PCI_PRODUCT(sc->sc_pa.pa_id) == PCI_PRODUCT_INTEL_82801CAM_LPC || |
810 | (PCI_PRODUCT(sc->sc_pa.pa_id) == PCI_PRODUCT_INTEL_82801BAM_LPC && | | 810 | (PCI_PRODUCT(sc->sc_pa.pa_id) == PCI_PRODUCT_INTEL_82801BAM_LPC && |
811 | pci_find_device(&sc->sc_pa, speedstep_bad_hb_check) == 0)) { | | 811 | pci_find_device(&sc->sc_pa, speedstep_bad_hb_check) == 0)) { |
812 | pcireg_t pmcon; | | 812 | pcireg_t pmcon; |
813 | | | 813 | |
814 | /* Enable SpeedStep if it isn't already enabled. */ | | 814 | /* Enable SpeedStep if it isn't already enabled. */ |
815 | pmcon = pci_conf_read(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag, | | 815 | pmcon = pci_conf_read(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag, |
816 | LPCIB_PCI_GEN_PMCON_1); | | 816 | LPCIB_PCI_GEN_PMCON_1); |
817 | if ((pmcon & LPCIB_PCI_GEN_PMCON_1_SS_EN) == 0) | | 817 | if ((pmcon & LPCIB_PCI_GEN_PMCON_1_SS_EN) == 0) |
818 | pci_conf_write(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag, | | 818 | pci_conf_write(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag, |
819 | LPCIB_PCI_GEN_PMCON_1, | | 819 | LPCIB_PCI_GEN_PMCON_1, |
820 | pmcon | LPCIB_PCI_GEN_PMCON_1_SS_EN); | | 820 | pmcon | LPCIB_PCI_GEN_PMCON_1_SS_EN); |
821 | | | 821 | |