#include #include #include #include int timer_init (void); #define TIMER_CUR_VAL ( *( (volatile unsigned int *)(0xc0000000 + 0x04) ) ) #if (CONFIG_COMMANDS & CFG_CMD_TEST) int do_test (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { ulong nowtime = 0; printf("\n--- START ---\n"); timer_init(); #if 0 while( TIMER_CUR_VAL > ( 0xffffffff - 5*CFG_HZ ) ) ; #endif nowtime = get_timer(0); while (1) { if ( get_timer(nowtime) > 10*CFG_HZ ) { break; } } printf("\n === END ===\n"); return 0; } U_BOOT_CMD( test, 3, 2, do_test, "test\t- user defined function to test U-Boot status\n", "user defined\n" ); #endif /* CFG_CMD_TEST */