diff --git a/soc/runtime/test_mode.c b/soc/runtime/test_mode.c index 3fda83ae8..40384ee0a 100644 --- a/soc/runtime/test_mode.c +++ b/soc/runtime/test_mode.c @@ -248,7 +248,7 @@ static void ddsinit(void) } #endif -static void ddstest_one(unsigned int i) +static void do_ddstest_one(unsigned int i) { unsigned int v[12] = { 0xaaaaaaaa, 0x55555555, 0xa5a5a5a5, 0x5a5a5a5a, @@ -258,9 +258,10 @@ static void ddstest_one(unsigned int i) unsigned int f, g, j; #ifdef DDS_ONEHOT_SEL - i = 1 << i; -#endif + brg_ddssel(1 << i); +#else brg_ddssel(i); +#endif ddsinit(); for(j=0; j<12; j++) { @@ -291,23 +292,40 @@ static void ddstest_one(unsigned int i) } } -static void ddstest(char *n) +static void ddstest(char *n, char *channel) { int i, j; char *c; unsigned int n2; + int channel2; - if (*n == 0) { - printf("ddstest \n"); + if((*n == 0) || (*channel == 0)) { + printf("ddstest \n"); return; } n2 = strtoul(n, &c, 0); - - for(i=0;i= 0) { + for(i=0;i - read DDS register"); puts("ddsfud - pulse FUD"); puts("ddsftw - write FTW"); - puts("ddstest - perform test sequence on DDS"); + puts("ddstest - perform test sequence on DDS"); puts("leds - set LEDs"); #if (defined CSR_SPIFLASH_BASE && defined SPIFLASH_PAGE_SIZE) puts("fserase - erase flash storage"); @@ -606,7 +624,7 @@ static void do_command(char *c) else if(strcmp(token, "ddsinit") == 0) ddsinit(); else if(strcmp(token, "ddsfud") == 0) ddsfud(); else if(strcmp(token, "ddsftw") == 0) ddsftw(get_token(&c), get_token(&c)); - else if(strcmp(token, "ddstest") == 0) ddstest(get_token(&c)); + else if(strcmp(token, "ddstest") == 0) ddstest(get_token(&c), get_token(&c)); #if (defined CSR_SPIFLASH_BASE && defined SPIFLASH_PAGE_SIZE) else if(strcmp(token, "fserase") == 0) fs_erase();