summaryrefslogtreecommitdiff
path: root/src/soc/amd/picasso
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2020-12-08 02:07:18 +0100
committerFelix Held <felix-coreboot@felixheld.de>2020-12-09 02:11:53 +0000
commit37609852f7955bd2496a3555d215c03d2c145938 (patch)
tree79134f1a6dd07b64ccaee026516bd70481d92c05 /src/soc/amd/picasso
parent20a4874445dfc52b4721b01246d86e1114165b1b (diff)
soc/amd: factor out functionality to print last reset source
Change-Id: I5cec38dac7ea27aa316f5dd4f91ed84627a0f937 Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/48437 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Diffstat (limited to 'src/soc/amd/picasso')
-rw-r--r--src/soc/amd/picasso/include/soc/southbridge.h1
-rw-r--r--src/soc/amd/picasso/southbridge.c54
2 files changed, 1 insertions, 54 deletions
diff --git a/src/soc/amd/picasso/include/soc/southbridge.h b/src/soc/amd/picasso/include/soc/southbridge.h
index 13ef53fc56..a74e91f2bc 100644
--- a/src/soc/amd/picasso/include/soc/southbridge.h
+++ b/src/soc/amd/picasso/include/soc/southbridge.h
@@ -78,7 +78,6 @@
#define PM_ACPI_RTC_WAKE_EN BIT(29)
#define PM_RST_CTRL1 0xbe
#define SLPTYPE_CONTROL_EN BIT(5)
-#define PM_RST_STATUS 0xc0
#define PM_LPC_GATING 0xec
#define PM_LPC_AB_NO_BYPASS_EN BIT(2)
#define PM_LPC_A20_EN BIT(1)
diff --git a/src/soc/amd/picasso/southbridge.c b/src/soc/amd/picasso/southbridge.c
index 3110deaa02..03c424ec6f 100644
--- a/src/soc/amd/picasso/southbridge.c
+++ b/src/soc/amd/picasso/southbridge.c
@@ -132,62 +132,10 @@ void fch_pre_init(void)
set_uart_config(CONFIG_UART_FOR_CONSOLE);
}
-static void print_num_status_bits(int num_bits, uint32_t status,
- const char *const bit_names[])
-{
- int i;
-
- if (!status)
- return;
-
- for (i = num_bits - 1; i >= 0; i--) {
- if (status & (1 << i)) {
- if (bit_names[i])
- printk(BIOS_DEBUG, "%s ", bit_names[i]);
- else
- printk(BIOS_DEBUG, "BIT%d ", i);
- }
- }
-}
-
-static void sb_print_pmxc0_status(void)
-{
- /* PMxC0 S5/Reset Status shows the source of previous reset. */
- uint32_t pmxc0_status = pm_read32(PM_RST_STATUS);
-
- static const char *const pmxc0_status_bits[32] = {
- [0] = "ThermalTrip",
- [1] = "FourSecondPwrBtn",
- [2] = "Shutdown",
- [3] = "ThermalTripFromTemp",
- [4] = "RemotePowerDownFromASF",
- [5] = "ShutDownFan0",
- [16] = "UserRst",
- [17] = "SoftPciRst",
- [18] = "DoInit",
- [19] = "DoReset",
- [20] = "DoFullReset",
- [21] = "SleepReset",
- [22] = "KbReset",
- [23] = "LtReset",
- [24] = "FailBootRst",
- [25] = "WatchdogIssueReset",
- [26] = "RemoteResetFromASF",
- [27] = "SyncFlood",
- [28] = "HangReset",
- [29] = "EcWatchdogRst",
- };
-
- printk(BIOS_DEBUG, "PMxC0 STATUS: 0x%x ", pmxc0_status);
- print_num_status_bits(ARRAY_SIZE(pmxc0_status_bits), pmxc0_status,
- pmxc0_status_bits);
- printk(BIOS_DEBUG, "\n");
-}
-
/* After console init */
void fch_early_init(void)
{
- sb_print_pmxc0_status();
+ fch_print_pmxc0_status();
i2c_soc_early_init();
if (CONFIG(DISABLE_SPI_FLASH_ROM_SHARING))