Lines Matching +full:3 +full:- +full:point

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
45 * There is one slight problem on non-ACPI or ACPI 1.x systems: we have no
52 * For details about the ICH WDT, see Intel Application Note AP-725
53 * (document no. 292273-001). The WDT is also described in the individual
55 * (document no. 252516-001) sections 9.10 and 9.11.
58 * SoC PMC support by Denir Li <denir.li@cas-well.com>
86 { DEVICEID_82801CA, "Intel 82801CA watchdog timer", 3, 1 },
87 { DEVICEID_82801CAM, "Intel 82801CAM watchdog timer", 3, 1 },
106 { DEVICEID_ICH8ME, "Intel ICH8M-E watchdog timer", 8, 2 },
112 { DEVICEID_ICH9ME, "Intel ICH9M-E watchdog timer", 9, 2 },
133 { DEVICEID_CPT0, "Intel Cougar Point watchdog timer", 10, 2 },
134 { DEVICEID_CPT1, "Intel Cougar Point watchdog timer", 10, 2 },
135 { DEVICEID_CPT2, "Intel Cougar Point watchdog timer", 10, 2 },
136 { DEVICEID_CPT3, "Intel Cougar Point watchdog timer", 10, 2 },
137 { DEVICEID_CPT4, "Intel Cougar Point watchdog timer", 10, 2 },
138 { DEVICEID_CPT5, "Intel Cougar Point watchdog timer", 10, 2 },
139 { DEVICEID_CPT6, "Intel Cougar Point watchdog timer", 10, 2 },
140 { DEVICEID_CPT7, "Intel Cougar Point watchdog timer", 10, 2 },
141 { DEVICEID_CPT8, "Intel Cougar Point watchdog timer", 10, 2 },
142 { DEVICEID_CPT9, "Intel Cougar Point watchdog timer", 10, 2 },
143 { DEVICEID_CPT10, "Intel Cougar Point watchdog timer", 10, 2 },
144 { DEVICEID_CPT11, "Intel Cougar Point watchdog timer", 10, 2 },
145 { DEVICEID_CPT12, "Intel Cougar Point watchdog timer", 10, 2 },
146 { DEVICEID_CPT13, "Intel Cougar Point watchdog timer", 10, 2 },
147 { DEVICEID_CPT14, "Intel Cougar Point watchdog timer", 10, 2 },
148 { DEVICEID_CPT15, "Intel Cougar Point watchdog timer", 10, 2 },
149 { DEVICEID_CPT16, "Intel Cougar Point watchdog timer", 10, 2 },
150 { DEVICEID_CPT17, "Intel Cougar Point watchdog timer", 10, 2 },
151 { DEVICEID_CPT18, "Intel Cougar Point watchdog timer", 10, 2 },
152 { DEVICEID_CPT19, "Intel Cougar Point watchdog timer", 10, 2 },
153 { DEVICEID_CPT20, "Intel Cougar Point watchdog timer", 10, 2 },
154 { DEVICEID_CPT21, "Intel Cougar Point watchdog timer", 10, 2 },
155 { DEVICEID_CPT22, "Intel Cougar Point watchdog timer", 10, 2 },
156 { DEVICEID_CPT23, "Intel Cougar Point watchdog timer", 10, 2 },
157 { DEVICEID_CPT24, "Intel Cougar Point watchdog timer", 10, 2 },
158 { DEVICEID_CPT25, "Intel Cougar Point watchdog timer", 10, 2 },
159 { DEVICEID_CPT26, "Intel Cougar Point watchdog timer", 10, 2 },
160 { DEVICEID_CPT27, "Intel Cougar Point watchdog timer", 10, 2 },
161 { DEVICEID_CPT28, "Intel Cougar Point watchdog timer", 10, 2 },
162 { DEVICEID_CPT29, "Intel Cougar Point watchdog timer", 10, 2 },
163 { DEVICEID_CPT30, "Intel Cougar Point watchdog timer", 10, 2 },
164 { DEVICEID_CPT31, "Intel Cougar Point watchdog timer", 10, 2 },
167 { DEVICEID_PPT0, "Intel Panther Point watchdog timer", 10, 2 },
168 { DEVICEID_PPT1, "Intel Panther Point watchdog timer", 10, 2 },
169 { DEVICEID_PPT2, "Intel Panther Point watchdog timer", 10, 2 },
170 { DEVICEID_PPT3, "Intel Panther Point watchdog timer", 10, 2 },
171 { DEVICEID_PPT4, "Intel Panther Point watchdog timer", 10, 2 },
172 { DEVICEID_PPT5, "Intel Panther Point watchdog timer", 10, 2 },
173 { DEVICEID_PPT6, "Intel Panther Point watchdog timer", 10, 2 },
174 { DEVICEID_PPT7, "Intel Panther Point watchdog timer", 10, 2 },
175 { DEVICEID_PPT8, "Intel Panther Point watchdog timer", 10, 2 },
176 { DEVICEID_PPT9, "Intel Panther Point watchdog timer", 10, 2 },
177 { DEVICEID_PPT10, "Intel Panther Point watchdog timer", 10, 2 },
178 { DEVICEID_PPT11, "Intel Panther Point watchdog timer", 10, 2 },
179 { DEVICEID_PPT12, "Intel Panther Point watchdog timer", 10, 2 },
180 { DEVICEID_PPT13, "Intel Panther Point watchdog timer", 10, 2 },
181 { DEVICEID_PPT14, "Intel Panther Point watchdog timer", 10, 2 },
182 { DEVICEID_PPT15, "Intel Panther Point watchdog timer", 10, 2 },
183 { DEVICEID_PPT16, "Intel Panther Point watchdog timer", 10, 2 },
184 { DEVICEID_PPT17, "Intel Panther Point watchdog timer", 10, 2 },
185 { DEVICEID_PPT18, "Intel Panther Point watchdog timer", 10, 2 },
186 { DEVICEID_PPT19, "Intel Panther Point watchdog timer", 10, 2 },
187 { DEVICEID_PPT20, "Intel Panther Point watchdog timer", 10, 2 },
188 { DEVICEID_PPT21, "Intel Panther Point watchdog timer", 10, 2 },
189 { DEVICEID_PPT22, "Intel Panther Point watchdog timer", 10, 2 },
190 { DEVICEID_PPT23, "Intel Panther Point watchdog timer", 10, 2 },
191 { DEVICEID_PPT24, "Intel Panther Point watchdog timer", 10, 2 },
192 { DEVICEID_PPT25, "Intel Panther Point watchdog timer", 10, 2 },
193 { DEVICEID_PPT26, "Intel Panther Point watchdog timer", 10, 2 },
194 { DEVICEID_PPT27, "Intel Panther Point watchdog timer", 10, 2 },
195 { DEVICEID_PPT28, "Intel Panther Point watchdog timer", 10, 2 },
196 { DEVICEID_PPT29, "Intel Panther Point watchdog timer", 10, 2 },
197 { DEVICEID_PPT30, "Intel Panther Point watchdog timer", 10, 2 },
198 { DEVICEID_PPT31, "Intel Panther Point watchdog timer", 10, 2 },
199 { DEVICEID_LPT0, "Intel Lynx Point watchdog timer", 10, 2 },
200 { DEVICEID_LPT1, "Intel Lynx Point watchdog timer", 10, 2 },
201 { DEVICEID_LPT2, "Intel Lynx Point watchdog timer", 10, 2 },
202 { DEVICEID_LPT3, "Intel Lynx Point watchdog timer", 10, 2 },
203 { DEVICEID_LPT4, "Intel Lynx Point watchdog timer", 10, 2 },
204 { DEVICEID_LPT5, "Intel Lynx Point watchdog timer", 10, 2 },
205 { DEVICEID_LPT6, "Intel Lynx Point watchdog timer", 10, 2 },
206 { DEVICEID_LPT7, "Intel Lynx Point watchdog timer", 10, 2 },
207 { DEVICEID_LPT8, "Intel Lynx Point watchdog timer", 10, 2 },
208 { DEVICEID_LPT9, "Intel Lynx Point watchdog timer", 10, 2 },
209 { DEVICEID_LPT10, "Intel Lynx Point watchdog timer", 10, 2 },
210 { DEVICEID_LPT11, "Intel Lynx Point watchdog timer", 10, 2 },
211 { DEVICEID_LPT12, "Intel Lynx Point watchdog timer", 10, 2 },
212 { DEVICEID_LPT13, "Intel Lynx Point watchdog timer", 10, 2 },
213 { DEVICEID_LPT14, "Intel Lynx Point watchdog timer", 10, 2 },
214 { DEVICEID_LPT15, "Intel Lynx Point watchdog timer", 10, 2 },
215 { DEVICEID_LPT16, "Intel Lynx Point watchdog timer", 10, 2 },
216 { DEVICEID_LPT17, "Intel Lynx Point watchdog timer", 10, 2 },
217 { DEVICEID_LPT18, "Intel Lynx Point watchdog timer", 10, 2 },
218 { DEVICEID_LPT19, "Intel Lynx Point watchdog timer", 10, 2 },
219 { DEVICEID_LPT20, "Intel Lynx Point watchdog timer", 10, 2 },
220 { DEVICEID_LPT21, "Intel Lynx Point watchdog timer", 10, 2 },
221 { DEVICEID_LPT22, "Intel Lynx Point watchdog timer", 10, 2 },
222 { DEVICEID_LPT23, "Intel Lynx Point watchdog timer", 10, 2 },
223 { DEVICEID_LPT24, "Intel Lynx Point watchdog timer", 10, 2 },
224 { DEVICEID_LPT25, "Intel Lynx Point watchdog timer", 10, 2 },
225 { DEVICEID_LPT26, "Intel Lynx Point watchdog timer", 10, 2 },
226 { DEVICEID_LPT27, "Intel Lynx Point watchdog timer", 10, 2 },
227 { DEVICEID_LPT28, "Intel Lynx Point watchdog timer", 10, 2 },
228 { DEVICEID_LPT29, "Intel Lynx Point watchdog timer", 10, 2 },
229 { DEVICEID_LPT30, "Intel Lynx Point watchdog timer", 10, 2 },
230 { DEVICEID_LPT31, "Intel Lynx Point watchdog timer", 10, 2 },
231 { DEVICEID_WCPT1, "Intel Wildcat Point watchdog timer", 10, 2 },
232 { DEVICEID_WCPT2, "Intel Wildcat Point watchdog timer", 10, 2 },
233 { DEVICEID_WCPT3, "Intel Wildcat Point watchdog timer", 10, 2 },
234 { DEVICEID_WCPT4, "Intel Wildcat Point watchdog timer", 10, 2 },
235 { DEVICEID_WCPT6, "Intel Wildcat Point watchdog timer", 10, 2 },
268 { DEVICEID_LPT_LP0, "Intel Lynx Point-LP watchdog timer", 10, 2 },
269 { DEVICEID_LPT_LP1, "Intel Lynx Point-LP watchdog timer", 10, 2 },
270 { DEVICEID_LPT_LP2, "Intel Lynx Point-LP watchdog timer", 10, 2 },
271 { DEVICEID_LPT_LP3, "Intel Lynx Point-LP watchdog timer", 10, 2 },
272 { DEVICEID_LPT_LP4, "Intel Lynx Point-LP watchdog timer", 10, 2 },
273 { DEVICEID_LPT_LP5, "Intel Lynx Point-LP watchdog timer", 10, 2 },
274 { DEVICEID_LPT_LP6, "Intel Lynx Point-LP watchdog timer", 10, 2 },
275 { DEVICEID_LPT_LP7, "Intel Lynx Point-LP watchdog timer", 10, 2 },
276 { DEVICEID_WCPT_LP1, "Intel Wildcat Point-LP watchdog timer", 10, 2 },
277 { DEVICEID_WCPT_LP2, "Intel Wildcat Point-LP watchdog timer", 10, 2 },
278 { DEVICEID_WCPT_LP3, "Intel Wildcat Point-LP watchdog timer", 10, 2 },
279 { DEVICEID_WCPT_LP5, "Intel Wildcat Point-LP watchdog timer", 10, 2 },
280 { DEVICEID_WCPT_LP6, "Intel Wildcat Point-LP watchdog timer", 10, 2 },
281 { DEVICEID_WCPT_LP7, "Intel Wildcat Point-LP watchdog timer", 10, 2 },
282 { DEVICEID_WCPT_LP9, "Intel Wildcat Point-LP watchdog timer", 10, 2 },
285 { DEVICEID_AVN0, "Intel Avoton/Rangeley SoC watchdog timer",10, 3 },
286 { DEVICEID_AVN1, "Intel Avoton/Rangeley SoC watchdog timer",10, 3 },
287 { DEVICEID_AVN2, "Intel Avoton/Rangeley SoC watchdog timer",10, 3 },
288 { DEVICEID_AVN3, "Intel Avoton/Rangeley SoC watchdog timer",10, 3 },
289 { DEVICEID_BAYTRAIL, "Intel Bay Trail SoC watchdog timer", 10, 3 },
290 { DEVICEID_BRASWELL, "Intel Braswell SoC watchdog timer", 10, 3 },
299 { DEVICEID_SRPTLP_SMB, "Sunrise Point-LP watchdog timer", 10, 4 },
305 bus_read_1((sc)->tco_res, (off))
307 bus_read_2((sc)->tco_res, (off))
309 bus_read_4((sc)->tco_res, (off))
311 bus_read_4((sc)->smi_res, (off))
313 bus_read_4((sc)->gcs_res, (off))
314 /* NB: TCO version 3 devices use the gcs_res resource for the PMC register. */
316 bus_read_4((sc)->gcs_res, (off))
318 bus_read_4((sc)->gc_res, (off))
321 bus_write_1((sc)->tco_res, (off), (val))
323 bus_write_2((sc)->tco_res, (off), (val))
325 bus_write_4((sc)->tco_res, (off), (val))
327 bus_write_4((sc)->smi_res, (off), (val))
329 bus_write_4((sc)->gcs_res, (off), (val))
330 /* NB: TCO version 3 devices use the gcs_res resource for the PMC register. */
332 bus_write_4((sc)->gcs_res, (off), (val))
334 bus_write_4((sc)->gc_res, (off), (val))
391 if (sc->tco_version < 4) in ichwd_sts_reset()
408 sc->active = 1; in ichwd_tmr_enable()
409 ichwd_verbose_printf(sc->device, "timer enabled\n"); in ichwd_tmr_enable()
422 sc->active = 0; in ichwd_tmr_disable()
423 ichwd_verbose_printf(sc->device, "timer disabled\n"); in ichwd_tmr_disable()
434 if (sc->tco_version == 1) in ichwd_tmr_reload()
451 if (sc->tco_version == 1) { in ichwd_tmr_set()
469 sc->timeout = timeout; in ichwd_tmr_set()
471 ichwd_verbose_printf(sc->device, "timeout set to %u ticks\n", timeout); in ichwd_tmr_set()
481 switch (sc->tco_version) { in ichwd_clear_noreboot()
483 status = pci_read_config(sc->ich, ICH_GEN_STA, 1); in ichwd_clear_noreboot()
485 pci_write_config(sc->ich, ICH_GEN_STA, status, 1); in ichwd_clear_noreboot()
486 status = pci_read_config(sc->ich, ICH_GEN_STA, 1); in ichwd_clear_noreboot()
498 case 3: in ichwd_clear_noreboot()
515 ichwd_verbose_printf(sc->device, in ichwd_clear_noreboot()
517 sc->tco_version); in ichwd_clear_noreboot()
522 device_printf(sc->device, in ichwd_clear_noreboot()
529 * Watchdog event handler - called by the framework to enable or disable
538 /* convert from power-of-two-ns to WDT ticks */ in ichwd_event()
541 if (sc->tco_version == 3) { in ichwd_event()
548 if (!sc->active) in ichwd_event()
550 if (timeout != sc->timeout) in ichwd_event()
555 if (sc->active) in ichwd_event()
575 for (id = ichwd_devices; id->desc != NULL; ++id) { in ichwd_find_ich_lpc_bridge()
576 if (devid == id->device) { in ichwd_find_ich_lpc_bridge()
605 for (id = ichwd_smb_devices; id->desc != NULL; ++id) { in ichwd_find_smb_dev()
606 if (devid == id->device) { in ichwd_find_smb_dev()
638 KASSERT(id_p->tco_version >= 1, in ichwd_identify()
639 ("unexpected TCO version %d", id_p->tco_version)); in ichwd_identify()
640 KASSERT(id_p->tco_version != 4 || smb != NULL, in ichwd_identify()
642 KASSERT(id_p->tco_version >= 4 || ich != NULL, in ichwd_identify()
643 ("could not find PCI LPC bridge device for TCOv1-3")); in ichwd_identify()
646 if ((dev = device_find_child(parent, driver->name, 0)) == NULL) in ichwd_identify()
647 dev = BUS_ADD_CHILD(parent, 0, driver->name, 0); in ichwd_identify()
652 switch (id_p->tco_version) { in ichwd_identify()
664 id_p->tco_version); in ichwd_identify()
666 case 3: in ichwd_identify()
675 id_p->tco_version); in ichwd_identify()
683 id_p->tco_version); in ichwd_identify()
692 id_p->tco_version, rc); in ichwd_identify()
718 id_p->tco_version, rc); in ichwd_identify()
725 id_p->tco_version); in ichwd_identify()
743 device_set_desc_copy(dev, id_p->desc); in ichwd_probe()
761 sc->ich_version = id_p->ich_version; in ichwd_smb_attach()
762 sc->tco_version = id_p->tco_version; in ichwd_smb_attach()
765 sc->tco_rid = 0; in ichwd_smb_attach()
766 sc->tco_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->tco_rid, in ichwd_smb_attach()
768 if (sc->tco_res == NULL) { in ichwd_smb_attach()
777 sc->gc_rid = 1; in ichwd_smb_attach()
778 sc->gc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->gc_rid, in ichwd_smb_attach()
780 if (sc->gc_res == NULL) { in ichwd_smb_attach()
789 if (id_p->quirks & PMC_HIDDEN) { in ichwd_smb_attach()
809 sc->smi_rid = 2; in ichwd_smb_attach()
810 sc->smi_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->smi_rid, in ichwd_smb_attach()
811 acpi_base + SMI_BASE, acpi_base + SMI_BASE + SMI_LEN - 1, SMI_LEN, in ichwd_smb_attach()
813 if (sc->smi_res == NULL) { in ichwd_smb_attach()
835 sc->ich = ich; in ichwd_lpc_attach()
836 sc->ich_version = id_p->ich_version; in ichwd_lpc_attach()
837 sc->tco_version = id_p->tco_version; in ichwd_lpc_attach()
847 sc->smi_rid = 0; in ichwd_lpc_attach()
848 sc->smi_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->smi_rid, in ichwd_lpc_attach()
849 pmbase + SMI_BASE, pmbase + SMI_BASE + SMI_LEN - 1, SMI_LEN, in ichwd_lpc_attach()
851 if (sc->smi_res == NULL) { in ichwd_lpc_attach()
856 sc->tco_rid = 1; in ichwd_lpc_attach()
857 sc->tco_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->tco_rid, in ichwd_lpc_attach()
858 pmbase + TCO_BASE, pmbase + TCO_BASE + TCO_LEN - 1, TCO_LEN, in ichwd_lpc_attach()
860 if (sc->tco_res == NULL) { in ichwd_lpc_attach()
865 sc->gcs_rid = 0; in ichwd_lpc_attach()
866 if (sc->tco_version >= 2) { in ichwd_lpc_attach()
867 sc->gcs_res = bus_alloc_resource_any(ich, SYS_RES_MEMORY, in ichwd_lpc_attach()
868 &sc->gcs_rid, RF_ACTIVE|RF_SHAREABLE); in ichwd_lpc_attach()
869 if (sc->gcs_res == NULL) { in ichwd_lpc_attach()
884 sc->device = dev; in ichwd_attach()
893 * Determine if we are coming up after a watchdog-induced reset. Some in ichwd_attach()
908 sc->ev_tag = EVENTHANDLER_REGISTER(watchdog_list, ichwd_event, sc, 0); in ichwd_attach()
911 sc->smi_enabled = ichwd_smi_is_enabled(sc); in ichwd_attach()
917 if (sc->tco_res != NULL) in ichwd_attach()
919 sc->tco_rid, sc->tco_res); in ichwd_attach()
920 if (sc->smi_res != NULL) in ichwd_attach()
922 sc->smi_rid, sc->smi_res); in ichwd_attach()
923 if (sc->gcs_res != NULL) in ichwd_attach()
924 bus_release_resource(sc->ich, SYS_RES_MEMORY, in ichwd_attach()
925 sc->gcs_rid, sc->gcs_res); in ichwd_attach()
926 if (sc->gc_res != NULL) in ichwd_attach()
928 sc->gc_rid, sc->gc_res); in ichwd_attach()
941 if (sc->active) in ichwd_detach()
945 if (sc->smi_enabled != 0) in ichwd_detach()
949 if (sc->ev_tag != NULL) in ichwd_detach()
950 EVENTHANDLER_DEREGISTER(watchdog_list, sc->ev_tag); in ichwd_detach()
951 sc->ev_tag = NULL; in ichwd_detach()
957 bus_release_resource(dev, SYS_RES_IOPORT, sc->tco_rid, sc->tco_res); in ichwd_detach()
958 bus_release_resource(dev, SYS_RES_IOPORT, sc->smi_rid, sc->smi_res); in ichwd_detach()
961 if (sc->gcs_res) in ichwd_detach()
962 bus_release_resource(sc->ich, SYS_RES_MEMORY, sc->gcs_rid, in ichwd_detach()
963 sc->gcs_res); in ichwd_detach()
964 if (sc->gc_res) in ichwd_detach()
965 bus_release_resource(dev, SYS_RES_MEMORY, sc->gc_rid, in ichwd_detach()
966 sc->gc_res); in ichwd_detach()