From: Sebastien Bourdeauducq Date: Mon, 1 Sep 2014 06:58:58 +0000 (+0800) Subject: bios: add DQ filtering to sdrrd, add sdrrdbuf command X-Git-Tag: 24jan2021_ls180~2649 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=57335bdf3fa1afc10e77e92be66851e2c8f0fae4;p=litex.git bios: add DQ filtering to sdrrd, add sdrrdbuf command --- diff --git a/software/bios/main.c b/software/bios/main.c index 01c2e0ec..603f0085 100644 --- a/software/bios/main.c +++ b/software/bios/main.c @@ -378,7 +378,8 @@ static void do_command(char *c) else if(strcmp(token, "sdrrow") == 0) sdrrow(get_token(&c)); else if(strcmp(token, "sdrsw") == 0) sdrsw(); else if(strcmp(token, "sdrhw") == 0) sdrhw(); - else if(strcmp(token, "sdrrd") == 0) sdrrd(get_token(&c)); + else if(strcmp(token, "sdrrdbuf") == 0) sdrrdbuf(-1); + else if(strcmp(token, "sdrrd") == 0) sdrrd(get_token(&c), get_token(&c)); else if(strcmp(token, "sdrwr") == 0) sdrwr(get_token(&c)); else if(strcmp(token, "memtest") == 0) memtest(); else if(strcmp(token, "sdrinit") == 0) sdrinit(); diff --git a/software/bios/sdram.c b/software/bios/sdram.c index 6185487d..25b93f22 100644 --- a/software/bios/sdram.c +++ b/software/bios/sdram.c @@ -61,12 +61,30 @@ void sdrrow(char *_row) } } -void sdrrd(char *startaddr) +void sdrrdbuf(int dq) +{ + int i, p; + int first_byte, step; + + if(dq < 0) { + first_byte = 0; + step = 1; + } else { + first_byte = DFII_PIX_RDDATA_SIZE/2 - 1 - dq; + step = DFII_PIX_RDDATA_SIZE/2; + } + + for(p=0;p\n"); @@ -77,16 +95,21 @@ void sdrrd(char *startaddr) printf("incorrect address\n"); return; } + if(*dq == 0) + _dq = -1; + else { + _dq = strtoul(dq, &c, 0); + if(*c != 0) { + printf("incorrect DQ\n"); + return; + } + } dfii_pird_address_write(addr); dfii_pird_baddress_write(0); command_prd(DFII_COMMAND_CAS|DFII_COMMAND_CS|DFII_COMMAND_RDDATA); cdelay(15); - - for(p=0;p