Index: firmware/target/arm/s5l8700/debug-s5l8700.c =================================================================== --- firmware/target/arm/s5l8700/debug-s5l8700.c (Revision 24229) +++ firmware/target/arm/s5l8700/debug-s5l8700.c (Arbeitskopie) @@ -27,6 +27,10 @@ #include "lcd.h" #include "font.h" #include "sprintf.h" +#include "storage.h" +#ifdef IPOD_NANO2G +#include "nand-target.h" +#endif /* Skeleton for adding target specific debug info to the debug menu */ @@ -35,35 +39,70 @@ snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf); \ } while(0) +extern int lcd_type; +extern uint32_t nand_type[4]; bool __dbg_hw_info(void) { char buf[50]; int line; + int i, nand_bank_count; +#ifdef IPOD_NANO2G + struct storage_info info; + const struct nand_device_info_type *nand_devicetype[4]; + nand_get_info(&info); + nand_bank_count = 0; + for(i=0;i<4;i++) + { + nand_devicetype[i] = nand_get_device_type(i); + if(nand_devicetype[i] != NULL) nand_bank_count++; + } +#endif lcd_clear_display(); lcd_setfont(FONT_SYSFIXED); while(1) { - while(1) - { lcd_clear_display(); line = 0; /* _DEBUG_PRINTF statements can be added here to show debug info */ +#ifdef IPOD_NANO2G + + _DEBUG_PRINTF("CPU:"); + _DEBUG_PRINTF("current_tick: %d", (unsigned int)current_tick); + line++; + + _DEBUG_PRINTF("LCD:"); + _DEBUG_PRINTF("type: %d, %s", lcd_type, lcd_type ? "(7) LDS176" : "(2) ILI9320"); + line++; + + _DEBUG_PRINTF("NAND:"); + _DEBUG_PRINTF("banks: %d",nand_bank_count); + + for(i=0;i<4;i++) + { + if(nand_devicetype[i] != NULL) + { + _DEBUG_PRINTF("bank: %d, id: %08X", i, (unsigned int)(*nand_devicetype[i]).id); + } + } + + _DEBUG_PRINTF("sectors: %d", info.num_sectors); + _DEBUG_PRINTF("sector size: %d", info.sector_size); + _DEBUG_PRINTF("last disk activity: %d", (unsigned int)nand_last_disk_activity()); + +#else _DEBUG_PRINTF("__dbg_hw_info"); +#endif lcd_update(); int btn = button_get_w_tmo(HZ/10); if(btn == (DEBUG_CANCEL|BUTTON_REL)) - goto end; - else if(btn == (BUTTON_PLAY|BUTTON_REL)) break; - } } -end: lcd_setfont(FONT_UI); return false; }