diff options
author | Furquan Shaikh <furquan@google.com> | 2014-09-30 20:34:18 -0700 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-03-28 08:45:09 +0100 |
commit | 4d9dc8cf50445e9e3e637edbe89daf6602dec62f (patch) | |
tree | c5415e3accc5d5b1591b05aae94ba37d638f62dd /src/soc/nvidia/tegra132/power.c | |
parent | c2115e3f383a0c5046f49497e1c48791b21d17d1 (diff) | |
download | coreboot-4d9dc8cf50445e9e3e637edbe89daf6602dec62f.tar.xz |
tegra132: Add support for pmc_rst_status get and print
BUG=None
BRANCH=None
TEST=Compiles successfully and pmc rst status POR is seen.
Change-Id: Ic09cb46d9be7670e467543e42b251efb1a4313d0
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 5dbfae6bbc0f4f30e216e37b515f4120f7833a38
Original-Change-Id: Id0c2b208222deaf099b8938ba583551979588d52
Original-Signed-off-by: Furquan Shaikh <furquan@google.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/220721
Original-Tested-by: Furquan Shaikh <furquan@chromium.org>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Commit-Queue: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: http://review.coreboot.org/9106
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/soc/nvidia/tegra132/power.c')
-rw-r--r-- | src/soc/nvidia/tegra132/power.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/soc/nvidia/tegra132/power.c b/src/soc/nvidia/tegra132/power.c index 5c7cc05ef4..679845c2ce 100644 --- a/src/soc/nvidia/tegra132/power.c +++ b/src/soc/nvidia/tegra132/power.c @@ -19,6 +19,7 @@ */ #include <arch/io.h> +#include <assert.h> #include <console/console.h> #include <soc/addressmap.h> @@ -55,3 +56,24 @@ void power_ungate_partition(uint32_t id) printk(BIOS_INFO, "Ungated power partition %d.\n", id); } + +uint8_t pmc_rst_status(void) +{ + return read32(&pmc->rst_status) & PMC_RST_STATUS_SOURCE_MASK; +} + +static const char *pmc_rst_status_str[PMC_RST_STATUS_NUM_SOURCES] = { + [PMC_RST_STATUS_SOURCE_POR] = "POR", + [PMC_RST_STATUS_SOURCE_WATCHDOG] = "Watchdog", + [PMC_RST_STATUS_SOURCE_SENSOR] = "Sensor", + [PMC_RST_STATUS_SOURCE_SW_MAIN] = "SW Main", + [PMC_RST_STATUS_SOURCE_LP0] = "LP0", +}; + +void pmc_print_rst_status(void) +{ + uint8_t rst_status = pmc_rst_status(); + assert(rst_status < PMC_RST_STATUS_NUM_SOURCES); + printk(BIOS_INFO, "PMC Reset Status: %s\n", + pmc_rst_status_str[rst_status]); +} |