]> www.infradead.org Git - users/rw/ppcboot.git/commitdiff
* Fix output of "iminfo" for script images
authorwdenk <wdenk>
Sat, 19 Jan 2002 23:18:26 +0000 (23:18 +0000)
committerwdenk <wdenk>
Sat, 19 Jan 2002 23:18:26 +0000 (23:18 +0000)
* Include all the 8260 clocks in the "bdinfo" output
  Patch by Jon Diekema, 19 Jan 2002

* GTH Board: added logging of software watchdog reboot
  Patch by Thomas Lange, 19 Jan 2002

CHANGELOG
board/gth/gth.c
common/cmd_boot.c
common/cmd_bootm.c
include/config_PCIPPC2.h
include/version.h

index ddbb2c012eefe3bd5b884d6d27050a20599814c9..a5800e99b5ec9f3a08503fc6c45b46cf30661e33 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,15 @@
+======================================================================
+Modifications for 1.1.5:
+======================================================================
+
+* Fix output of "iminfo" for script images
+
+* Include all the 8260 clocks in the "bdinfo" output
+  Patch by Jon Diekema, 19 Jan 2002
+
+* GTH Board: added logging of software watchdog reboot
+  Patch by Thomas Lange, 19 Jan 2002
+
 ======================================================================
 Modifications for 1.1.4:
 ======================================================================
index c6065c253dd1311ca0b7eb85acac8748fd1f8d30..24a19b4b381cee54835582d57b545bc86e5d4f5d 100644 (file)
@@ -316,6 +316,9 @@ long int initdram (int board_type)
   return (sdramsz << 20);
 }
 
+#define POWER_OFFSET    0xF0000
+#define SW_WATCHDOG_REASON 13
+
 #define BOOTDATA_OFFSET 0xF8000
 #define MAX_ATTEMPTS 5
 
@@ -359,6 +362,77 @@ static void write_bootdata( volatile u16* addr, u8 System, u8 Count ){
   WRITE_FLASH16(addr, data);
 }
 
+static void maybe_update_restart_reason(volatile u32 *addr32){
+  /* Update addr if sw wd restart */
+  volatile u16 *flash = (u16*)(CFG_FLASH_BASE);
+  volatile u16 *addr_16 = (u16*)addr32;
+  u32 rsr;
+
+  /* Dont reset register now */
+  rsr = ((volatile immap_t *)CFG_IMMR)->im_clkrst.car_rsr;
+
+  rsr >>=24;
+  
+  if(rsr&0x10){
+    /* Was really a sw wd restart, update reason */
+
+    printf("Last restart by software watchdog\n");
+    
+    /* AMD 16 bit */
+    WRITE_FLASH16(&flash[0x555], 0xAAAA);
+    WRITE_FLASH16(&flash[0x2AA], 0x5555);
+    WRITE_FLASH16(&flash[0x555], 0xA0A0);
+    
+    WRITE_FLASH16(addr_16, 0);
+
+    udelay(1000);
+
+    WATCHDOG_RESET();
+    
+    /* AMD 16 bit */
+    WRITE_FLASH16(&flash[0x555], 0xAAAA);
+    WRITE_FLASH16(&flash[0x2AA], 0x5555);
+    WRITE_FLASH16(&flash[0x555], 0xA0A0);
+    
+    WRITE_FLASH16(addr_16+1, SW_WATCHDOG_REASON);
+
+  }
+}
+
+static void check_restart_reason(void){
+  /* Update restart reason if sw watchdog was
+     triggered */
+
+  int i;
+  volatile u32 *raddr;
+
+  raddr = (u32*)(CFG_FLASH_BASE+POWER_OFFSET);
+
+  if(*raddr==0xFFFFFFFF){
+    /* Nothing written */
+    maybe_update_restart_reason(raddr);
+  }
+  else{
+    /* Search for latest written reason */
+    i=0;
+    while((*(raddr+2)!=0xFFFFFFFF)&(i<2000)){
+      raddr+=2;
+      i++;
+    }
+    if(i>=2000){
+      /* Whoa, dont write any more */
+      printf("*** No free restart reason found ***\n");
+    }
+    else{
+      /* Check if written */
+      if(*raddr==0){
+       /* Erased by kernel, no new reason written */
+       maybe_update_restart_reason(raddr+2);
+      }
+    }
+  }
+}
+
 static void check_boot_tries(void){
   /* Count the number of boot attemps
      switch system if too many */
@@ -384,7 +458,7 @@ static void check_boot_tries(void){
       i++;
     }
     if(i>=8000){
-      // Whoa, dont write any more
+      /* Whoa, dont write any more */
       printf("*** No bootdata found. Not updating flash***\n");
     }
     else{
@@ -404,18 +478,18 @@ static void check_boot_tries(void){
        case 2:
        case 3:
        case 4:
-         // Try same system again if needed
+         /* Try same system again if needed */
          count++;
          break;
          
        case 5:
-         // Switch system and reset tries
+         /* Switch system and reset tries */
          count=1;
          system=3-system;
          printf("***Too many boot attempts, switching system***\n"); 
          break;
        default:
-         // Switch system, start over and hope it works
+         /* Switch system, start over and hope it works */
          printf("***Unexpected data on addr 0x%x, %u***\n",(u32)addr,data);
          count=1;
          system=3-system;
@@ -463,6 +537,9 @@ void misc_init_r(bd_t *bd){
   /* Check if we need to boot failsafe system */
   check_boot_tries();
 
+  /* Check if we need to update restart reason */
+  check_restart_reason();
+  
   if(ee_init_data()){
     printf("EEPROM init failed\n");
     return;
index 9c74d28b6ec46ae10cde239c4da7e379795a1a0f..00242d3b38253fb6b534394deb805071f226bc61 100644 (file)
@@ -69,7 +69,15 @@ int do_bdinfo (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
        print_str ("pci_busfreq",           strmhz(buf, bd->bi_pci_busfreq));
 #endif
 #else
+#if defined(CONFIG_8260)
+       print_str ("vco",           strmhz(buf, bd->bi_vco));
+       print_str ("sccfreq",       strmhz(buf, bd->bi_sccfreq));
+       print_str ("brgfreq",       strmhz(buf, bd->bi_brgfreq));
+#endif
        print_str ("intfreq",       strmhz(buf, bd->bi_intfreq));
+#if defined(CONFIG_8260)
+       print_str ("cpmfreq",       strmhz(buf, bd->bi_cpmfreq));
+#endif
        print_str ("busfreq",       strmhz(buf, bd->bi_busfreq));
 #endif /* defined(CONFIG_405GP) || defined(CONFIG_405CR) */
        printf ("ethaddr     =");
index 39bbf1a8292a65e497af6123cae323a330ad67e0..4bc4f1d7ca6fce5305cb3837774df0dd61596d76 100644 (file)
@@ -740,7 +740,8 @@ print_type (image_header_t *hdr)
        case IH_TYPE_KERNEL:    type = "Kernel Image";          break;
        case IH_TYPE_RAMDISK:   type = "RAMDisk Image";         break;
        case IH_TYPE_MULTI:     type = "Multi-File Image";      break;
-       case IH_TYPE_FIRMWARE:  type = "Firmware";                      break;
+       case IH_TYPE_FIRMWARE:  type = "Firmware";              break;
+       case IH_TYPE_SCRIPT:    type = "Script";                break;
        default:                type = "Unknown Image";         break;
        }
 
index bb693cea763aa3261f6779442a8afc3bb38e63cb..b6719b5b1e46561ed0e5c30f713b31d591bf5b5d 100644 (file)
 #define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
                                 CONFIG_BOOTP_BOOTFILESIZE)
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | CFG_CMD_DHCP | \
-                                CFG_CMD_PCI | CFG_CMD_DOC | CFG_CMD_DATE)
+#define CONFIG_MAC_PARTITION
+#define CONFIG_DOS_PARTITION
+
+#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
+                                CFG_CMD_ASKENV | \
+                                CFG_CMD_DHCP   | \
+                                CFG_CMD_PCI    | \
+                                CFG_CMD_DOC    | \
+                                CFG_CMD_DATE)
 
 #define CONFIG_PCI             1
 #define CONFIG_PCI_PNP         1       /* PCI plug-and-play */
index f318373c481359fb91346457701b9afbc8416c29..1a464101e2927660654075c72dafcf576e2a96e9 100644 (file)
@@ -24,6 +24,6 @@
 #ifndef        __VERSION_H__
 #define        __VERSION_H__
 
-#define        PPCBOOT_VERSION "PPCBoot 1.1.4"
+#define        PPCBOOT_VERSION "PPCBoot 1.1.5"
 
 #endif /* __VERSION_H__ */