From: wdenk Date: Sat, 19 Jan 2002 23:18:26 +0000 (+0000) Subject: * Fix output of "iminfo" for script images X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=030f0e9e7a1878d5dbd0df537b71ec9feb6cb4f8;p=users%2Frw%2Fppcboot.git * 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 --- diff --git a/CHANGELOG b/CHANGELOG index ddbb2c0..a5800e9 100644 --- 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: ====================================================================== diff --git a/board/gth/gth.c b/board/gth/gth.c index c6065c2..24a19b4 100644 --- a/board/gth/gth.c +++ b/board/gth/gth.c @@ -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; diff --git a/common/cmd_boot.c b/common/cmd_boot.c index 9c74d28..00242d3 100644 --- a/common/cmd_boot.c +++ b/common/cmd_boot.c @@ -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 ="); diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 39bbf1a..4bc4f1d 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -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; } diff --git a/include/config_PCIPPC2.h b/include/config_PCIPPC2.h index bb693ce..b6719b5 100644 --- a/include/config_PCIPPC2.h +++ b/include/config_PCIPPC2.h @@ -58,8 +58,15 @@ #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 */ diff --git a/include/version.h b/include/version.h index f318373..1a46410 100644 --- a/include/version.h +++ b/include/version.h @@ -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__ */