Index: firmware/target/arm/s5l8700/debug-s5l8700.c =================================================================== --- firmware/target/arm/s5l8700/debug-s5l8700.c (Revision 24202) +++ firmware/target/arm/s5l8700/debug-s5l8700.c (Arbeitskopie) @@ -27,6 +27,7 @@ #include "lcd.h" #include "font.h" #include "sprintf.h" +#include "storage.h" /* Skeleton for adding target specific debug info to the debug menu */ @@ -35,35 +36,61 @@ snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf); \ } while(0) +extern int lcd_type; +extern uint32_t nand_type[4]; +unsigned int nand_get_id(uint32_t nand_tp); + bool __dbg_hw_info(void) { char buf[50]; int line; + int i; +#ifdef IPOD_NANO2G + struct storage_info info; + nand_get_info(&info); +#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", lcd_type); + line++; + + _DEBUG_PRINTF("NAND:"); + + for(i=0;i<4;i++) + { + _DEBUG_PRINTF("bank: %d, id: %08X", i, nand_get_id(i)); + } + + _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; } Index: firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c =================================================================== --- firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c (Revision 24202) +++ firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c (Arbeitskopie) @@ -101,6 +102,10 @@ static uint8_t nand_spare[0x40] __attribute__((aligned(16))); static uint8_t nand_ecc[0x30] __attribute__((aligned(16))); +unsigned int nand_get_id(uint32_t bank) +{ + return nand_deviceinfotable[nand_type[bank]].id; +} uint32_t nand_unlock(uint32_t rc) { Index: firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c =================================================================== --- firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c (Revision 24202) +++ firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c (Arbeitskopie) @@ -60,7 +60,7 @@ /** globals **/ -static int lcd_type; +int lcd_type; /* also needed in debug-s5l8700.c */ static int xoffset; /* needed for flip */ /** hardware access functions */