summaryrefslogtreecommitdiff
path: root/cleopatre
diff options
context:
space:
mode:
authordraskovic2009-09-24 15:22:30 +0000
committerdraskovic2009-09-24 15:22:30 +0000
commit5c16e725c500c7580e294880e29dcf874a1b4bb9 (patch)
treecb393c01751780dc1aef346be7075a20dcd1f21e /cleopatre
parentaeb96cb93f7df0767d82d0625db4a3c57af041c2 (diff)
[CLEO][U-BOOT] Added command for testing na ddebugging U-BOOT.
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@5744 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cleopatre')
-rw-r--r--cleopatre/u-boot-1.1.6/common/cmd_test.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/cleopatre/u-boot-1.1.6/common/cmd_test.c b/cleopatre/u-boot-1.1.6/common/cmd_test.c
new file mode 100644
index 0000000000..f8486716a5
--- /dev/null
+++ b/cleopatre/u-boot-1.1.6/common/cmd_test.c
@@ -0,0 +1,60 @@
+#include <common.h>
+#include <command.h>
+#include <asm/io.h>
+#include <asm/arch/hardware.h>
+
+extern int reset_hit;
+
+int record_timer = 0;
+
+int timer_init (void);
+
+#define TIMER_CUR_VAL ( *( (volatile unsigned int *)(0xc0000000 + 0x04) ) )
+
+#if (CONFIG_COMMANDS & CFG_CMD_TEST)
+
+int do_test (void)
+{
+ int i = 0;
+ ulong nowtime = 0;
+ ulong delta = 0;
+
+ unsigned int status = 0;
+
+ printf("reset_hit = %d\n", reset_hit);
+
+//record_timer = 1;
+ 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");
+
+record_timer = 0;
+
+ return 0;
+}
+
+U_BOOT_CMD(
+ test, 2, 1, do_test,
+ "test\t- user defined function to test U-Boot status\n",
+ "user defined\n"
+);
+
+#endif /* CFG_CMD_TEST */
+