From 274a00217ec9f491cc1444fa49328f46ba266250 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 4 Aug 2012 16:32:15 +0200 Subject: [PATCH] bios: asmiprobe command Because with reordering architectures come order-dependent intermittent bugs. --- software/bios/Makefile | 2 +- software/bios/main.c | 3 ++- software/bios/{ddrinit.c => sdram.c} | 32 +++++++++++++++++++++++++++- software/bios/{ddrinit.h => sdram.h} | 8 ++++--- 4 files changed, 39 insertions(+), 6 deletions(-) rename software/bios/{ddrinit.c => sdram.c} (85%) rename software/bios/{ddrinit.h => sdram.h} (69%) diff --git a/software/bios/Makefile b/software/bios/Makefile index 42aa7bfe4..827fe207c 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 dataflow.o +OBJECTS=crt0.o isr.o sdram.o main.o microudp.o tftp.o boot-helper.o boot.o dataflow.o all: bios.bin diff --git a/software/bios/main.c b/software/bios/main.c index 30cd87187..606ba8c6b 100644 --- a/software/bios/main.c +++ b/software/bios/main.c @@ -13,7 +13,7 @@ #include #include -#include "ddrinit.h" +#include "sdram.h" #include "dataflow.h" #include "boot.h" @@ -367,6 +367,7 @@ 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, "asmiprobe") == 0) asmiprobe(); else if(strcmp(token, "dfs") == 0) dfs(get_token(&c)); diff --git a/software/bios/ddrinit.c b/software/bios/sdram.c similarity index 85% rename from software/bios/ddrinit.c rename to software/bios/sdram.c index ce53f050a..233d1912d 100644 --- a/software/bios/ddrinit.c +++ b/software/bios/sdram.c @@ -3,8 +3,9 @@ #include #include +#include -#include "ddrinit.h" +#include "sdram.h" static void cdelay(int i) { @@ -196,3 +197,32 @@ int ddrinit(void) return 1; } + +static const char *format_slot_state(int state) +{ + switch(state) { + case 0: return "Empty"; + case 1: return "Pending"; + case 2: return "Processing"; + default: return "UNEXPECTED VALUE"; + } +} + +void asmiprobe(void) +{ + volatile unsigned int *regs = (unsigned int *)ASMIPROBE_BASE; + int slot_count; + int trace_depth; + int i; + int offset; + + offset = 0; + slot_count = regs[offset++]; + trace_depth = regs[offset++]; + for(i=0;i