1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
3 * (C) Copyright 2019 Amarula Solutions(India)
4 * Author: Jagan Teki <jagan@amarulasolutions.com>
9 #include <asm/arch-rockchip/clock.h>
10 #include <asm/arch-rockchip/cru.h>
11 #include <asm/arch-rockchip/hardware.h>
12 #include <linux/err.h>
14 static char *get_reset_cause(void)
16 struct rockchip_cru *cru = rockchip_get_cru();
22 switch (cru->glb_rst_st) {
30 case FST_GLB_TSADC_RST_ST:
31 case SND_GLB_TSADC_RST_ST:
34 case FST_GLB_WDT_RST_ST:
35 case SND_GLB_WDT_RST_ST:
39 cause = "unknown reset";
43 * reset_reason env is used by rk3288, due to special use case
44 * to figure it the boot behavior. so keep this as it is.
46 env_set("reset_reason", cause);
49 * Clear glb_rst_st, so we can determine the last reset cause
50 * for following resets.
52 rk_clrreg(&cru->glb_rst_st, GLB_RST_ST_MASK);
57 int print_cpuinfo(void)
59 printf("SoC: Rockchip %s\n", CONFIG_SYS_SOC);
60 printf("Reset cause: %s\n", get_reset_cause());
62 /* TODO print operating temparature and clock */