diff --git a/software/bios/Makefile b/software/bios/Makefile index bfd0aafa5..42aa7bfe4 100644 --- a/software/bios/Makefile +++ b/software/bios/Makefile @@ -1,7 +1,7 @@ M2DIR=../.. include $(M2DIR)/software/common.mak -OBJECTS=crt0.o isr.o ddrinit.o main.o microudp.o tftp.o boot-helper.o boot.o +OBJECTS=crt0.o isr.o ddrinit.o main.o microudp.o tftp.o boot-helper.o boot.o dataflow.o all: bios.bin diff --git a/software/bios/dataflow.c b/software/bios/dataflow.c new file mode 100644 index 000000000..b3c64a2c8 --- /dev/null +++ b/software/bios/dataflow.c @@ -0,0 +1,42 @@ +#include + +#include "dataflow.h" + +void print_isd_info(unsigned int baseaddr) +{ + volatile unsigned int *regs; + int neps; + int nbytes; + int i, j; + int offset; + unsigned int ack_count, nack_count, cur_status; + + regs = (unsigned int *)baseaddr; + if((regs[0] != 0x6a) || (regs[1] != 0xb4)) { + printf("Incorrect magic number\n"); + return; + } + neps = regs[2]; + nbytes = (regs[3] + 7)/8; + + // regs[4] is reset + + offset = 5; + for(i=0;i #include "ddrinit.h" +#include "dataflow.h" #include "boot.h" enum { @@ -285,6 +286,23 @@ static void wcsr(char *csr, char *value) } } +static void dfs(char *baseaddr) +{ + char *c; + unsigned int addr; + + if(*baseaddr == 0) { + printf("dfs
\n"); + return; + } + addr = strtoul(baseaddr, &c, 0); + if(*c != 0) { + printf("incorrect address\n"); + return; + } + print_isd_info(addr); +} + /* Init + command line */ static void help(void) @@ -349,6 +367,8 @@ static void do_command(char *c) else if(strcmp(token, "ddrwr") == 0) ddrwr(get_token(&c)); else if(strcmp(token, "memtest") == 0) memtest(); else if(strcmp(token, "ddrinit") == 0) ddrinit(); + + else if(strcmp(token, "dfs") == 0) dfs(get_token(&c)); else if(strcmp(token, "") != 0) printf("Command not found\n");