Source
/*
* ACPI watchdog table parsing support.
*
* Copyright (C) 2016, Intel Corporation
* Author: Mika Westerberg <mika.westerberg@linux.intel.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/*
* There are several systems where the WDAT table is accessing RTC SRAM to
* store persistent information. This does not work well with the Linux RTC
* driver so on those systems we skip WDAT driver and prefer iTCO_wdt
* instead.
*
* See also https://bugzilla.kernel.org/show_bug.cgi?id=199033.
*/
static bool acpi_watchdog_uses_rtc(const struct acpi_table_wdat *wdat)
{
const struct acpi_wdat_entry *entries;
int i;
entries = (struct acpi_wdat_entry *)(wdat + 1);
for (i = 0; i < wdat->entries; i++) {
const struct acpi_generic_address *gas;
gas = &entries[i].register_region;
if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO) {
switch (gas->address) {
case RTC_PORT(0):
case RTC_PORT(1):
case RTC_PORT(2):
case RTC_PORT(3):
return true;
}
}
}
return false;
}
static bool acpi_watchdog_uses_rtc(const struct acpi_table_wdat *wdat)
{
return false;
}
static const struct acpi_table_wdat *acpi_watchdog_get_wdat(void)
{
const struct acpi_table_wdat *wdat = NULL;