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
--- /dev/null
+#include <stdio.h>
+
+#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<neps;i++) {
+ ack_count = 0;
+ for(j=0;j<nbytes;j++) {
+ ack_count <<= 8;
+ ack_count |= regs[offset++];
+ }
+ nack_count = 0;
+ for(j=0;j<nbytes;j++) {
+ nack_count <<= 8;
+ nack_count |= regs[offset++];
+ }
+ cur_status = regs[offset++];
+ printf("#%d: ACK_CNT:%10u NAK_CNT:%10u %s %s\n",
+ i, ack_count, nack_count,
+ cur_status & 1 ? "stb" : " ",
+ cur_status & 2 ? "ack" : " ");
+ }
+}
#include <hw/minimac.h>
#include "ddrinit.h"
+#include "dataflow.h"
#include "boot.h"
enum {
}
}
+static void dfs(char *baseaddr)
+{
+ char *c;
+ unsigned int addr;
+
+ if(*baseaddr == 0) {
+ printf("dfs <address>\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)
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");