6 #include <asm/jz4740.h>
7 #include <asm/io.h> /* virt_to_phys() */
8 #define JZ4740_CPM_TEST
18 int myatoi(char *string
)
21 while (*string
>='0' && *string
<='9')
31 int myhatoi(char *string
)
35 if ( *string
!= '0' || *(string
+1) != 'x' ) {
44 if (*string
>='0' && *string
<='9')
46 else if (*string
>='a' && *string
<='f')
47 res
+= *string
-'a' + 10;
57 int atoi( char * string
)
59 if ( *string
== '0' && *(string
+1) == 'x' ) {
60 return myhatoi(string
);
63 return myatoi(string
);
66 void cpm_add_test(void)
68 pll_add_test(cpm_value
);
69 //sdram_add_test(cpm_value);
70 calc_clocks_add_test();
73 int do_jz_cpmtest_function(cmd_tbl_t
*cmdtp
, int flag
, int argc
, char *argv
[])
76 if ( !strncmp(argv
[1], "add", 3 ) ) {
78 cpm_value
= atoi( argv
[2] );
79 printf("cpm value:%d\n",cpm_value
);
80 if((cpm_value
>= 999) || (cpm_value
<= 100)) {
81 printf("param is wrong!\n");
87 printf("command is wrong!\n");
93 cpm
, 4, 1, do_jz_cpmtest_function
,
94 "cpm:\t - Usage: cpmtest [add][cpm_value]\n",
98 #endif /* CONFIG_JZ4740 */