platform/chrome: cros_ec: Poll EC log on EC panic

Add handler for CrOS EC panic events. When a panic is reported,
immediately poll for EC log.

This should result in the log leading to the EC panic being
preserved.

ACPI_NOTIFY_CROS_EC_PANIC is defined in coreboot at
https://review.coreboot.org/plugins/gitiles/coreboot/+/refs/heads/master/src/ec/google/chromeec/acpi/ec.asl

Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-by: Prashant Malani <pmalani@chromium.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20230104011524.369764-2-robbarnes@google.com
This commit is contained in:
Rob Barnes 2023-01-04 01:15:23 +00:00 committed by Tzung-Bi Shih
parent aaab5af4b2
commit d90fa2c64d
3 changed files with 39 additions and 0 deletions

View file

@ -41,6 +41,13 @@
#define EC_MAX_REQUEST_OVERHEAD 1
#define EC_MAX_RESPONSE_OVERHEAD 32
/*
* EC panic is not covered by the standard (0-F) ACPI notify values.
* Arbitrarily choosing B0 to notify ec panic, which is in the 84-BF
* device specific ACPI notify range.
*/
#define ACPI_NOTIFY_CROS_EC_PANIC 0xB0
/*
* Command interface between EC and AP, for LPC, I2C and SPI interfaces.
*/
@ -176,6 +183,8 @@ struct cros_ec_device {
/* The platform devices used by the mfd driver */
struct platform_device *ec;
struct platform_device *pd;
struct blocking_notifier_head panic_notifier;
};
/**