From 245f5cda69a1332585c2a22a48420f4ca1ab67ad Mon Sep 17 00:00:00 2001 From: Mario Six Date: Mon, 6 Aug 2018 10:23:32 +0200 Subject: sysreset: Add get_status method It's useful to have the reset status of the SoC printed out during reset (e.g. to learn whether the reset was caused by software or a watchdog). As a first step to implement this, add a get_status method to the sysreset class, which enables the caller to get printable information about the reset status (akin to get_desc in the CPU uclass). Reviewed-by: Simon Glass Signed-off-by: Mario Six --- include/sysreset.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include/sysreset.h') diff --git a/include/sysreset.h b/include/sysreset.h index 81318bdbf5..a5c0b74a47 100644 --- a/include/sysreset.h +++ b/include/sysreset.h @@ -28,6 +28,14 @@ struct sysreset_ops { * (in which case this method will not actually return) */ int (*request)(struct udevice *dev, enum sysreset_t type); + /** + * get_status() - get printable reset status information + * + * @buf: Buffer to receive the textual reset information + * @size: Size of the passed buffer + * @return 0 if OK, -ve on error + */ + int (*get_status)(struct udevice *dev, char *buf, int size); }; #define sysreset_get_ops(dev) ((struct sysreset_ops *)(dev)->driver->ops) @@ -40,6 +48,15 @@ struct sysreset_ops { */ int sysreset_request(struct udevice *dev, enum sysreset_t type); +/** + * get_status() - get printable reset status information + * + * @buf: Buffer to receive the textual reset information + * @size: Size of the passed buffer + * @return 0 if OK, -ve on error + */ +int sysreset_get_status(struct udevice *dev, char *buf, int size); + /** * sysreset_walk() - cause a system reset * -- cgit v1.2.3