]> git.kernelconcepts.de Git - karo-tx-redboot.git/blobdiff - packages/hal/arm/mx51/var/v2_0/src/soc_misc.c
RedBoot STK5 Release 2010-03-04
[karo-tx-redboot.git] / packages / hal / arm / mx51 / var / v2_0 / src / soc_misc.c
index ccf039f987d349df5d8d4282e28d1d00d87cf376..877a26c3c539f2ab5ba466912263c37cdadfd1a1 100644 (file)
@@ -581,6 +581,7 @@ unsigned int mxc_nfc_soc_setup(unsigned int pg_sz, unsigned int io_sz,
 static void show_sys_info(void)
 {
        unsigned int sbmr = readl(SRC_BASE_ADDR + 0x4);
+       const char *dlm = "";
 
        if (find_correct_chip == CHIP_VERSION_UNKNOWN) {
                diag_printf("Unrecognized chip version: 0x%08x!!!\n", read_system_rev());
@@ -590,19 +591,49 @@ static void show_sys_info(void)
        }
 
        diag_printf("Reset reason: ");
-       switch (_reset_reason) {
-       case 0x09:
-               diag_printf("User reset\n");
-               break;
-       case 0x01:
-               diag_printf("Power-on reset\n");
-               break;
-       case 0x10:
-       case 0x11:
-               diag_printf("WDOG reset\n");
-               break;
-       default:
-               diag_printf("Unknown: 0x%08x\n", _reset_reason);
+
+       if (_reset_reason & (1 << 0)) {
+               diag_printf("%sPOWER_ON", dlm);
+               dlm = " | ";
+       }
+       if (_reset_reason & (1 << 2)) {
+               diag_printf("%sCSU", dlm);
+               dlm = " | ";
+       }
+       if (_reset_reason & (1 << 3)) {
+               diag_printf("%sUSER", dlm);
+               dlm = " | ";
+       }
+       if (_reset_reason & (1 << 4)) {
+               CYG_WORD16 wrsr;
+
+               HAL_READ_UINT16(WDOG_BASE_ADDR + 4, wrsr);
+               if (wrsr & 0x01) {
+                       diag_printf("%sSOFT", dlm);
+                       dlm = " | ";
+               }
+               if (wrsr & 0x10) {
+                       diag_printf("%sWATCHDOG", dlm);
+                       dlm = " | ";
+               }
+       }
+       if (_reset_reason & (1 << 5)) {
+               diag_printf("%sJTAG_HW", dlm);
+               dlm = " | ";
+       }
+       if (_reset_reason & (1 << 6)) {
+               diag_printf("%sJTAG_SW", dlm);
+               dlm = " | ";
+       }
+       if (_reset_reason & (1 << 16)) {
+               diag_printf("%sWARM BOOT", dlm);
+               dlm = " | ";
+       }
+
+       if (*dlm == '\0') {
+               diag_printf("UNKNOWN: %08x\n", _reset_reason);
+       } else {
+               diag_printf(" RESET\n");
        }
 
        if (_mxc_fis == MMC_FLASH_BOOT) {