1c3079787STakanori Watanabe /*
2c3079787STakanori Watanabe * Copyright (c) 2020 Takanori Watanabe
3c3079787STakanori Watanabe *
4c3079787STakanori Watanabe * Redistribution and use in source and binary forms, with or without
5c3079787STakanori Watanabe * modification, are permitted provided that the following conditions
6c3079787STakanori Watanabe * are met:
7c3079787STakanori Watanabe * 1. Redistributions of source code must retain the above copyright
8c3079787STakanori Watanabe * notice, this list of conditions and the following disclaimer.
9c3079787STakanori Watanabe * 2. Redistributions in binary form must reproduce the above copyright
10c3079787STakanori Watanabe * notice, this list of conditions and the following disclaimer in the
11c3079787STakanori Watanabe * documentation and/or other materials provided with the distribution.
12c3079787STakanori Watanabe *
13c3079787STakanori Watanabe * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14c3079787STakanori Watanabe * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15c3079787STakanori Watanabe * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16c3079787STakanori Watanabe * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17c3079787STakanori Watanabe * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18c3079787STakanori Watanabe * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19c3079787STakanori Watanabe * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20c3079787STakanori Watanabe * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21c3079787STakanori Watanabe * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22c3079787STakanori Watanabe * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23c3079787STakanori Watanabe * SUCH DAMAGE.
24c3079787STakanori Watanabe */
25c3079787STakanori Watanabe
26c3079787STakanori Watanabe #include <sys/param.h>
27c3079787STakanori Watanabe #include <sys/systm.h>
28c3079787STakanori Watanabe #include <sys/kernel.h>
29c3079787STakanori Watanabe #include <sys/module.h>
30c3079787STakanori Watanabe #include <sys/errno.h>
31c3079787STakanori Watanabe #include <sys/lock.h>
32c3079787STakanori Watanabe #include <sys/mutex.h>
33c3079787STakanori Watanabe #include <sys/sysctl.h>
34c3079787STakanori Watanabe #include <sys/syslog.h>
35c3079787STakanori Watanabe #include <sys/bus.h>
36c3079787STakanori Watanabe
37c3079787STakanori Watanabe #include <machine/bus.h>
38c3079787STakanori Watanabe #include <sys/rman.h>
39c3079787STakanori Watanabe #include <machine/resource.h>
40c3079787STakanori Watanabe #include <dev/pci/pcivar.h>
41c3079787STakanori Watanabe #include <dev/pci/pcireg.h>
42c3079787STakanori Watanabe
43c3079787STakanori Watanabe #define PCHTHERM_REG_TEMP 0
44c3079787STakanori Watanabe #define PCHTHERM_REG_TSC 4
45c3079787STakanori Watanabe #define PCHTHERM_REG_TSS 6
46c3079787STakanori Watanabe #define PCHTHERM_REG_TSEL 8
47c3079787STakanori Watanabe #define PCHTHERM_REG_TSREL 0xa
48c3079787STakanori Watanabe #define PCHTHERM_REG_TSMIC 0xc
49c3079787STakanori Watanabe #define PCHTHERM_REG_CTT 0x10
50c3079787STakanori Watanabe #define PCHTHERM_REG_TAHV 0x14
51c3079787STakanori Watanabe #define PCHTHERM_REG_TALV 0x18
52c3079787STakanori Watanabe #define PCHTHERM_REG_TSPM 0x1c
53c3079787STakanori Watanabe #define PCHTHERM_REG_TL 0x40
54c3079787STakanori Watanabe #define PCHTHERM_REG_TL2 0x50
55c3079787STakanori Watanabe #define PCHTHERM_REG_PHL 0x60
56c3079787STakanori Watanabe #define PCHTHERM_REG_PHLC 0x62
57c3079787STakanori Watanabe #define PCHTHERM_REG_TAS 0x80
58c3079787STakanori Watanabe #define PCHTHERM_REG_TSPIEN 0x82
59c3079787STakanori Watanabe #define PCHTHERM_REG_TSGPEN 0x84
60c3079787STakanori Watanabe #define PCHTHERM_REG_TCFD 0xf0
61c3079787STakanori Watanabe #define PCHTHERM_GEN_LOCKDOWN 0x80
62c3079787STakanori Watanabe #define PCHTHERM_GEN_ENABLE 1
63c3079787STakanori Watanabe #define PCHTHERM_TEMP_FACTOR 5
64c3079787STakanori Watanabe #define PCHTHERM_TEMP_ZERO 2231
65c3079787STakanori Watanabe #define PCHTHERM_TEMP_MASK 0x1ff
66c3079787STakanori Watanabe #define PCHTHERM_TL_T0 0
67c3079787STakanori Watanabe #define PCHTHERM_TL_T1 10
68c3079787STakanori Watanabe #define PCHTHERM_TL_T2 20
69c3079787STakanori Watanabe #define PCHTHERM_TEMP_TO_IK(val) (((val) & PCHTHERM_TEMP_MASK) * \
70c3079787STakanori Watanabe PCHTHERM_TEMP_FACTOR + \
71c3079787STakanori Watanabe PCHTHERM_TEMP_ZERO)
72c3079787STakanori Watanabe
73c3079787STakanori Watanabe struct pchtherm_softc
74c3079787STakanori Watanabe {
75c3079787STakanori Watanabe int tbarrid;
76c3079787STakanori Watanabe struct resource *tbar;
77c3079787STakanori Watanabe int enable;
78c3079787STakanori Watanabe int ctten;
79c3079787STakanori Watanabe int pmtemp;
80c3079787STakanori Watanabe unsigned int pmtime;
81c3079787STakanori Watanabe };
82c3079787STakanori Watanabe
83c3079787STakanori Watanabe static const struct pci_device_table pchtherm_devices[] =
84c3079787STakanori Watanabe {
85c3079787STakanori Watanabe { PCI_DEV(0x8086, 0x9c24),
86c3079787STakanori Watanabe PCI_DESCR("Haswell Thermal Subsystem")},
87c3079787STakanori Watanabe { PCI_DEV(0x8086, 0x8c24),
88c3079787STakanori Watanabe PCI_DESCR("Haswell Thermal Subsystem")},
89c3079787STakanori Watanabe { PCI_DEV(0x8086, 0x9ca4),
90c3079787STakanori Watanabe PCI_DESCR("Wildcat Point Thermal Subsystem")},
91c3079787STakanori Watanabe { PCI_DEV(0x8086, 0x9d31),
92c3079787STakanori Watanabe PCI_DESCR("Skylake PCH Thermal Subsystem")},
93c3079787STakanori Watanabe { PCI_DEV(0x8086, 0xa131),
94c3079787STakanori Watanabe PCI_DESCR("Skylake PCH 100 Thermal Subsystem")},
95e26b9046STakanori Watanabe { PCI_DEV(0x8086, 0x9df9),
966678e75eSVladimir Kondratyev PCI_DESCR("CannonLake-LP Thermal Subsystem")},
976678e75eSVladimir Kondratyev { PCI_DEV(0x8086, 0xa379),
986678e75eSVladimir Kondratyev PCI_DESCR("CannonLake-H Thermal Subsystem")},
996678e75eSVladimir Kondratyev { PCI_DEV(0x8086, 0x02f9),
1006678e75eSVladimir Kondratyev PCI_DESCR("CometLake-LP Thermal Subsystem")},
1016678e75eSVladimir Kondratyev { PCI_DEV(0x8086, 0x06f9),
1026678e75eSVladimir Kondratyev PCI_DESCR("CometLake-H Thermal Subsystem")},
1036678e75eSVladimir Kondratyev { PCI_DEV(0x8086, 0xa1b1),
1046678e75eSVladimir Kondratyev PCI_DESCR("Lewisburg Thermal Subsystem")},
105*45835894SDmitry Luhtionov { PCI_DEV(0x8086, 0x8d24),
106*45835894SDmitry Luhtionov PCI_DESCR("Wellsburg Thermal Subsystem")},
107c3079787STakanori Watanabe };
108c3079787STakanori Watanabe
pchtherm_probe(device_t dev)109c3079787STakanori Watanabe static int pchtherm_probe(device_t dev)
110c3079787STakanori Watanabe {
111c3079787STakanori Watanabe const struct pci_device_table *tbl;
112c3079787STakanori Watanabe
113c3079787STakanori Watanabe tbl = PCI_MATCH(dev, pchtherm_devices);
114c3079787STakanori Watanabe if (tbl == NULL)
115c3079787STakanori Watanabe return (ENXIO);
116c3079787STakanori Watanabe device_set_desc(dev, tbl->descr);
117c3079787STakanori Watanabe
118c3079787STakanori Watanabe return (BUS_PROBE_DEFAULT);
119c3079787STakanori Watanabe
120c3079787STakanori Watanabe }
pchtherm_tltemp_sysctl(SYSCTL_HANDLER_ARGS)121c3079787STakanori Watanabe static int pchtherm_tltemp_sysctl(SYSCTL_HANDLER_ARGS)
122c3079787STakanori Watanabe {
123c3079787STakanori Watanabe struct pchtherm_softc *sc = oidp->oid_arg1;
124c3079787STakanori Watanabe int regshift = oidp->oid_arg2;
125c3079787STakanori Watanabe int temp;
126c3079787STakanori Watanabe
127c3079787STakanori Watanabe temp = bus_read_4(sc->tbar, PCHTHERM_REG_TL);
128c3079787STakanori Watanabe temp >>= regshift;
129c3079787STakanori Watanabe temp = PCHTHERM_TEMP_TO_IK(temp);
130c3079787STakanori Watanabe
131c3079787STakanori Watanabe return sysctl_handle_int(oidp, &temp, 0, req);
132c3079787STakanori Watanabe }
pchtherm_temp_sysctl(SYSCTL_HANDLER_ARGS)133c3079787STakanori Watanabe static int pchtherm_temp_sysctl(SYSCTL_HANDLER_ARGS)
134c3079787STakanori Watanabe {
135c3079787STakanori Watanabe struct pchtherm_softc *sc = oidp->oid_arg1;
136c3079787STakanori Watanabe int regoff = oidp->oid_arg2;
137c3079787STakanori Watanabe int temp;
138c3079787STakanori Watanabe
139c3079787STakanori Watanabe temp = bus_read_2(sc->tbar, regoff);
140c3079787STakanori Watanabe temp = PCHTHERM_TEMP_TO_IK(temp);
141c3079787STakanori Watanabe
142c3079787STakanori Watanabe return sysctl_handle_int(oidp, &temp, 0, req);
143c3079787STakanori Watanabe }
144c3079787STakanori Watanabe
145c3079787STakanori Watanabe #define FLAG_PRINT(dev, str, val) device_printf \
146c3079787STakanori Watanabe (dev, str " %s %sable\n", \
147c3079787STakanori Watanabe ((val) & 0x80)? "Locked" : "", \
148c3079787STakanori Watanabe ((val) & 0x1)? "En" : "Dis")
149c3079787STakanori Watanabe
pchtherm_attach(device_t dev)150c3079787STakanori Watanabe static int pchtherm_attach(device_t dev)
151c3079787STakanori Watanabe {
152c3079787STakanori Watanabe struct pchtherm_softc *sc = device_get_softc(dev);
153c3079787STakanori Watanabe unsigned int val;
154c3079787STakanori Watanabe int flag;
155c3079787STakanori Watanabe int temp;
156c3079787STakanori Watanabe
157c3079787STakanori Watanabe sc->tbarrid = PCIR_BAR(0);
158c3079787STakanori Watanabe sc->tbar = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
159c3079787STakanori Watanabe &sc->tbarrid, RF_ACTIVE|RF_SHAREABLE);
160c3079787STakanori Watanabe if (sc->tbar == NULL) {
161c3079787STakanori Watanabe return (ENOMEM);
162c3079787STakanori Watanabe }
163c3079787STakanori Watanabe sc->enable = bus_read_1(sc->tbar, PCHTHERM_REG_TSEL);
164c3079787STakanori Watanabe if (!(sc->enable & PCHTHERM_GEN_ENABLE )) {
165c3079787STakanori Watanabe if (sc->enable & PCHTHERM_GEN_LOCKDOWN) {
166c3079787STakanori Watanabe device_printf(dev, "Sensor not available\n");
167c3079787STakanori Watanabe return 0;
168c3079787STakanori Watanabe } else {
169c3079787STakanori Watanabe device_printf(dev, "Enabling Sensor\n");
170c3079787STakanori Watanabe bus_write_1(sc->tbar, PCHTHERM_REG_TSEL,
171c3079787STakanori Watanabe PCHTHERM_GEN_ENABLE);
172c3079787STakanori Watanabe sc->enable = bus_read_1(sc->tbar, PCHTHERM_REG_TSEL);
1735084dde5SMichal Vanco if (!(sc->enable & PCHTHERM_GEN_ENABLE)) {
174c3079787STakanori Watanabe device_printf(dev, "Sensor enable failed\n");
175c3079787STakanori Watanabe return 0;
176c3079787STakanori Watanabe }
177c3079787STakanori Watanabe }
178c3079787STakanori Watanabe }
179c3079787STakanori Watanabe
180c3079787STakanori Watanabe sc->ctten = bus_read_1(sc->tbar, PCHTHERM_REG_TSC);
181c3079787STakanori Watanabe if (bootverbose) {
182c3079787STakanori Watanabe FLAG_PRINT(dev, "Catastrophic Power Down", sc->ctten);
183c3079787STakanori Watanabe }
184c3079787STakanori Watanabe val = bus_read_1(sc->tbar, PCHTHERM_REG_TSREL);
185c3079787STakanori Watanabe if (bootverbose) {
186c3079787STakanori Watanabe FLAG_PRINT(dev, "SMBus report", val);
187c3079787STakanori Watanabe }
1885084dde5SMichal Vanco val = bus_read_1(sc->tbar, PCHTHERM_REG_TSMIC);
189c3079787STakanori Watanabe if (bootverbose) {
190c3079787STakanori Watanabe FLAG_PRINT(dev, "SMI on alert", val);
191c3079787STakanori Watanabe }
192c3079787STakanori Watanabe val = bus_read_2(sc->tbar, PCHTHERM_REG_TSPM);
193c3079787STakanori Watanabe flag = val >> 13;
194c3079787STakanori Watanabe if (bootverbose) {
195c3079787STakanori Watanabe device_printf(dev, "TSPM: %b\n",
196c3079787STakanori Watanabe flag, "\20\3Lock\2DTSS0EN\1DSSOC0");
197c3079787STakanori Watanabe device_printf(dev, "MAX Thermal Sensor Shutdown Time %ds\n",
198c3079787STakanori Watanabe 1<<((val>>9)&7));
199c3079787STakanori Watanabe }
200c3079787STakanori Watanabe
201c3079787STakanori Watanabe temp = val & PCHTHERM_TEMP_MASK;
202c3079787STakanori Watanabe sc->pmtemp = PCHTHERM_TEMP_TO_IK(temp);
203c3079787STakanori Watanabe sc->pmtime = 1<<((val>>9)&7);
204c3079787STakanori Watanabe SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
205c3079787STakanori Watanabe SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
206c3079787STakanori Watanabe OID_AUTO, "pmtemp", CTLTYPE_INT|CTLFLAG_RD,
207c3079787STakanori Watanabe sc, PCHTHERM_REG_TSPM, pchtherm_temp_sysctl,
208c3079787STakanori Watanabe "IK", "Thermal sensor idle temperature");
209c3079787STakanori Watanabe SYSCTL_ADD_U32(device_get_sysctl_ctx(dev),
210c3079787STakanori Watanabe SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
211c3079787STakanori Watanabe OID_AUTO, "pmtime", CTLFLAG_RD,
212c3079787STakanori Watanabe &sc->pmtime, 0,"Thermal sensor idle duration");
213c3079787STakanori Watanabe
214c3079787STakanori Watanabe val = bus_read_4(sc->tbar, PCHTHERM_REG_TL);
215c3079787STakanori Watanabe flag = val>>29;
216c3079787STakanori Watanabe
217c3079787STakanori Watanabe if (bootverbose) {
218c3079787STakanori Watanabe device_printf(dev, "Throttling %b\n",
219c3079787STakanori Watanabe flag, "\20\3Lock\2TT13EN\1TTEN");
220c3079787STakanori Watanabe }
221c3079787STakanori Watanabe
222c3079787STakanori Watanabe SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
223c3079787STakanori Watanabe SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
224c3079787STakanori Watanabe OID_AUTO, "t0temp", CTLTYPE_INT |CTLFLAG_RD,
225c3079787STakanori Watanabe sc, PCHTHERM_TL_T0, pchtherm_tltemp_sysctl,
226c3079787STakanori Watanabe "IK", "T0 temperature");
227c3079787STakanori Watanabe
228c3079787STakanori Watanabe SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
229c3079787STakanori Watanabe SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
230c3079787STakanori Watanabe OID_AUTO, "t1temp", CTLTYPE_INT |CTLFLAG_RD,
231c3079787STakanori Watanabe sc, PCHTHERM_TL_T1, pchtherm_tltemp_sysctl,
232c3079787STakanori Watanabe "IK", "T1 temperature");
233c3079787STakanori Watanabe
234c3079787STakanori Watanabe SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
235c3079787STakanori Watanabe SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
236c3079787STakanori Watanabe OID_AUTO, "t2temp", CTLTYPE_INT |CTLFLAG_RD,
237c3079787STakanori Watanabe sc, PCHTHERM_TL_T2, pchtherm_tltemp_sysctl,
238c3079787STakanori Watanabe "IK", "T2 temperature");
239c3079787STakanori Watanabe
240c3079787STakanori Watanabe val = bus_read_2(sc->tbar, PCHTHERM_REG_TL2);
241c3079787STakanori Watanabe if (bootverbose) {
242c3079787STakanori Watanabe flag = val >>14;
243c3079787STakanori Watanabe device_printf(dev, "TL2 flag %b\n",
244c3079787STakanori Watanabe flag, "\20\1PMCTEN\2Lock");
245c3079787STakanori Watanabe }
246c3079787STakanori Watanabe
247c3079787STakanori Watanabe /* If PHL is disable and lockdown, don't export it.*/
248c3079787STakanori Watanabe val = bus_read_2(sc->tbar, PCHTHERM_REG_PHLC);
249c3079787STakanori Watanabe val <<= 16;
250c3079787STakanori Watanabe val |= bus_read_2(sc->tbar, PCHTHERM_REG_PHL);
251c3079787STakanori Watanabe if ((val & 0x10000) != 0x10000) {
252c3079787STakanori Watanabe SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
253c3079787STakanori Watanabe SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
254c3079787STakanori Watanabe OID_AUTO, "pch_hot_level",
255c3079787STakanori Watanabe CTLTYPE_INT |CTLFLAG_RD,
256c3079787STakanori Watanabe sc, PCHTHERM_REG_PHL,
257c3079787STakanori Watanabe pchtherm_temp_sysctl, "IK",
258c3079787STakanori Watanabe "PCH Hot level Temperature");
259c3079787STakanori Watanabe }
260c3079787STakanori Watanabe
261c3079787STakanori Watanabe SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
262c3079787STakanori Watanabe SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
263c3079787STakanori Watanabe OID_AUTO, "temperature", CTLTYPE_INT |CTLFLAG_RD,
264c3079787STakanori Watanabe sc, PCHTHERM_REG_TEMP,
265c3079787STakanori Watanabe pchtherm_temp_sysctl, "IK", "Current temperature");
266c3079787STakanori Watanabe /*
267c3079787STakanori Watanabe * If sensor enable bit is locked down, there is no way to change
268c3079787STakanori Watanabe * alart values effectively.
269c3079787STakanori Watanabe */
270c3079787STakanori Watanabe if (!(sc->enable & PCHTHERM_GEN_LOCKDOWN) ||
271c3079787STakanori Watanabe bus_read_2(sc->tbar, PCHTHERM_REG_TAHV) != 0) {
272c3079787STakanori Watanabe SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
273c3079787STakanori Watanabe SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
274c3079787STakanori Watanabe OID_AUTO, "tahv", CTLTYPE_INT |CTLFLAG_RD,
275c3079787STakanori Watanabe sc, PCHTHERM_REG_TAHV,
276c3079787STakanori Watanabe pchtherm_temp_sysctl, "IK",
277c3079787STakanori Watanabe "Alart High temperature");
278c3079787STakanori Watanabe }
279c3079787STakanori Watanabe
280c3079787STakanori Watanabe if (!(sc->enable & PCHTHERM_GEN_LOCKDOWN) ||
281c3079787STakanori Watanabe bus_read_2(sc->tbar, PCHTHERM_REG_TALV) != 0) {
282c3079787STakanori Watanabe SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
283c3079787STakanori Watanabe SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
284c3079787STakanori Watanabe OID_AUTO, "talv", CTLTYPE_INT |CTLFLAG_RD,
285c3079787STakanori Watanabe sc, PCHTHERM_REG_TALV,
286c3079787STakanori Watanabe pchtherm_temp_sysctl, "IK",
287c3079787STakanori Watanabe "Alart Low temperature");
288c3079787STakanori Watanabe }
289c3079787STakanori Watanabe if (!(sc->ctten& PCHTHERM_GEN_LOCKDOWN) ||
290c3079787STakanori Watanabe sc->ctten& PCHTHERM_GEN_ENABLE) {
291c3079787STakanori Watanabe SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
292c3079787STakanori Watanabe SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
293c3079787STakanori Watanabe OID_AUTO, "ctt",
294c3079787STakanori Watanabe CTLTYPE_INT |CTLFLAG_RD,
295c3079787STakanori Watanabe sc, PCHTHERM_REG_CTT,
296c3079787STakanori Watanabe pchtherm_temp_sysctl, "IK",
297c3079787STakanori Watanabe "Catastrophic Trip Point");
298c3079787STakanori Watanabe }
299c3079787STakanori Watanabe
300c3079787STakanori Watanabe return 0;
301c3079787STakanori Watanabe }
pchtherm_detach(device_t dev)302c3079787STakanori Watanabe static int pchtherm_detach(device_t dev)
303c3079787STakanori Watanabe {
304c3079787STakanori Watanabe struct pchtherm_softc *sc = device_get_softc(dev);
305c3079787STakanori Watanabe bus_release_resource(dev, SYS_RES_MEMORY, sc->tbarrid, sc->tbar);
306c3079787STakanori Watanabe
307c3079787STakanori Watanabe return 0;
308c3079787STakanori Watanabe }
309289b5607SJohn Baldwin
310c3079787STakanori Watanabe static device_method_t pchtherm_methods[] =
311c3079787STakanori Watanabe {
312c3079787STakanori Watanabe DEVMETHOD(device_probe, pchtherm_probe),
313c3079787STakanori Watanabe DEVMETHOD(device_attach, pchtherm_attach),
314c3079787STakanori Watanabe DEVMETHOD(device_detach, pchtherm_detach),
315c3079787STakanori Watanabe
316c3079787STakanori Watanabe DEVMETHOD_END
317c3079787STakanori Watanabe };
318289b5607SJohn Baldwin
319c3079787STakanori Watanabe static driver_t pchtherm_driver = {
320c3079787STakanori Watanabe "pchtherm",
321c3079787STakanori Watanabe pchtherm_methods,
322c3079787STakanori Watanabe sizeof(struct pchtherm_softc)
323c3079787STakanori Watanabe };
324c3079787STakanori Watanabe
325289b5607SJohn Baldwin DRIVER_MODULE(pchtherm, pci, pchtherm_driver, 0, 0);
326c3079787STakanori Watanabe PCI_PNP_INFO(pchtherm_devices);
327