Lines Matching +full:temp +full:- +full:sensor
96 PCI_DESCR("CannonLake-LP Thermal Subsystem")},
98 PCI_DESCR("CannonLake-H Thermal Subsystem")},
100 PCI_DESCR("CometLake-LP Thermal Subsystem")},
102 PCI_DESCR("CometLake-H Thermal Subsystem")},
116 device_set_desc(dev, tbl->descr); in pchtherm_probe()
123 struct pchtherm_softc *sc = oidp->oid_arg1; in pchtherm_tltemp_sysctl()
124 int regshift = oidp->oid_arg2; in pchtherm_tltemp_sysctl()
125 int temp; in pchtherm_tltemp_sysctl() local
127 temp = bus_read_4(sc->tbar, PCHTHERM_REG_TL); in pchtherm_tltemp_sysctl()
128 temp >>= regshift; in pchtherm_tltemp_sysctl()
129 temp = PCHTHERM_TEMP_TO_IK(temp); in pchtherm_tltemp_sysctl()
131 return sysctl_handle_int(oidp, &temp, 0, req); in pchtherm_tltemp_sysctl()
135 struct pchtherm_softc *sc = oidp->oid_arg1; in pchtherm_temp_sysctl()
136 int regoff = oidp->oid_arg2; in pchtherm_temp_sysctl()
137 int temp; in pchtherm_temp_sysctl() local
139 temp = bus_read_2(sc->tbar, regoff); in pchtherm_temp_sysctl()
140 temp = PCHTHERM_TEMP_TO_IK(temp); in pchtherm_temp_sysctl()
142 return sysctl_handle_int(oidp, &temp, 0, req); in pchtherm_temp_sysctl()
155 int temp; in pchtherm_attach() local
157 sc->tbarrid = PCIR_BAR(0); in pchtherm_attach()
158 sc->tbar = bus_alloc_resource_any(dev, SYS_RES_MEMORY, in pchtherm_attach()
159 &sc->tbarrid, RF_ACTIVE|RF_SHAREABLE); in pchtherm_attach()
160 if (sc->tbar == NULL) { in pchtherm_attach()
163 sc->enable = bus_read_1(sc->tbar, PCHTHERM_REG_TSEL); in pchtherm_attach()
164 if (!(sc->enable & PCHTHERM_GEN_ENABLE )) { in pchtherm_attach()
165 if (sc->enable & PCHTHERM_GEN_LOCKDOWN) { in pchtherm_attach()
166 device_printf(dev, "Sensor not available\n"); in pchtherm_attach()
169 device_printf(dev, "Enabling Sensor\n"); in pchtherm_attach()
170 bus_write_1(sc->tbar, PCHTHERM_REG_TSEL, in pchtherm_attach()
172 sc->enable = bus_read_1(sc->tbar, PCHTHERM_REG_TSEL); in pchtherm_attach()
173 if (!(sc->enable & PCHTHERM_GEN_ENABLE)) { in pchtherm_attach()
174 device_printf(dev, "Sensor enable failed\n"); in pchtherm_attach()
180 sc->ctten = bus_read_1(sc->tbar, PCHTHERM_REG_TSC); in pchtherm_attach()
182 FLAG_PRINT(dev, "Catastrophic Power Down", sc->ctten); in pchtherm_attach()
184 val = bus_read_1(sc->tbar, PCHTHERM_REG_TSREL); in pchtherm_attach()
188 val = bus_read_1(sc->tbar, PCHTHERM_REG_TSMIC); in pchtherm_attach()
192 val = bus_read_2(sc->tbar, PCHTHERM_REG_TSPM); in pchtherm_attach()
197 device_printf(dev, "MAX Thermal Sensor Shutdown Time %ds\n", in pchtherm_attach()
201 temp = val & PCHTHERM_TEMP_MASK; in pchtherm_attach()
202 sc->pmtemp = PCHTHERM_TEMP_TO_IK(temp); in pchtherm_attach()
203 sc->pmtime = 1<<((val>>9)&7); in pchtherm_attach()
208 "IK", "Thermal sensor idle temperature"); in pchtherm_attach()
212 &sc->pmtime, 0,"Thermal sensor idle duration"); in pchtherm_attach()
214 val = bus_read_4(sc->tbar, PCHTHERM_REG_TL); in pchtherm_attach()
240 val = bus_read_2(sc->tbar, PCHTHERM_REG_TL2); in pchtherm_attach()
248 val = bus_read_2(sc->tbar, PCHTHERM_REG_PHLC); in pchtherm_attach()
250 val |= bus_read_2(sc->tbar, PCHTHERM_REG_PHL); in pchtherm_attach()
267 * If sensor enable bit is locked down, there is no way to change in pchtherm_attach()
270 if (!(sc->enable & PCHTHERM_GEN_LOCKDOWN) || in pchtherm_attach()
271 bus_read_2(sc->tbar, PCHTHERM_REG_TAHV) != 0) { in pchtherm_attach()
280 if (!(sc->enable & PCHTHERM_GEN_LOCKDOWN) || in pchtherm_attach()
281 bus_read_2(sc->tbar, PCHTHERM_REG_TALV) != 0) { in pchtherm_attach()
289 if (!(sc->ctten& PCHTHERM_GEN_LOCKDOWN) || in pchtherm_attach()
290 sc->ctten& PCHTHERM_GEN_ENABLE) { in pchtherm_attach()
305 bus_release_resource(dev, SYS_RES_MEMORY, sc->tbarrid, sc->tbar); in pchtherm_detach()