mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
bios: add sdrrderr
This commit is contained in:
parent
57335bdf3f
commit
6decb357f1
3 changed files with 47 additions and 0 deletions
|
@ -380,6 +380,7 @@ static void do_command(char *c)
|
|||
else if(strcmp(token, "sdrhw") == 0) sdrhw();
|
||||
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, "sdrrderr") == 0) sdrrderr(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();
|
||||
|
|
|
@ -112,6 +112,51 @@ void sdrrd(char *startaddr, char *dq)
|
|||
sdrrdbuf(_dq);
|
||||
}
|
||||
|
||||
void sdrrderr(char *count)
|
||||
{
|
||||
char *c;
|
||||
int _count;
|
||||
int i, j, p;
|
||||
unsigned char prev_data[DFII_NPHASES*DFII_PIX_RDDATA_SIZE];
|
||||
unsigned char errs[DFII_PIX_RDDATA_SIZE/2];
|
||||
|
||||
if(*count == 0) {
|
||||
printf("sdrrderr <count>\n");
|
||||
return;
|
||||
}
|
||||
_count = strtoul(count, &c, 0);
|
||||
if(*c != 0) {
|
||||
printf("incorrect count\n");
|
||||
return;
|
||||
}
|
||||
|
||||
dfii_pird_address_write(0);
|
||||
dfii_pird_baddress_write(0);
|
||||
command_prd(DFII_COMMAND_CAS|DFII_COMMAND_CS|DFII_COMMAND_RDDATA);
|
||||
cdelay(15);
|
||||
for(p=0;p<DFII_NPHASES;p++)
|
||||
for(i=0;i<DFII_PIX_RDDATA_SIZE;i++)
|
||||
prev_data[p*DFII_PIX_RDDATA_SIZE+i] = MMPTR(dfii_pix_rddata_addr[p]+4*i);
|
||||
for(i=0;i<DFII_PIX_RDDATA_SIZE/2;i++)
|
||||
errs[i] = 0;
|
||||
|
||||
for(j=0;j<_count;j++) {
|
||||
command_prd(DFII_COMMAND_CAS|DFII_COMMAND_CS|DFII_COMMAND_RDDATA);
|
||||
cdelay(15);
|
||||
for(p=0;p<DFII_NPHASES;p++)
|
||||
for(i=0;i<DFII_PIX_RDDATA_SIZE;i++) {
|
||||
unsigned char new_data;
|
||||
|
||||
new_data = MMPTR(dfii_pix_rddata_addr[p]+4*i);
|
||||
errs[i%(DFII_PIX_RDDATA_SIZE/2)] |= prev_data[p*DFII_PIX_RDDATA_SIZE+i] ^ new_data;
|
||||
prev_data[p*DFII_PIX_RDDATA_SIZE+i] = new_data;
|
||||
}
|
||||
}
|
||||
for(i=0;i<DFII_PIX_RDDATA_SIZE/2;i++)
|
||||
printf("%02x ", errs[i]);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
void sdrwr(char *startaddr)
|
||||
{
|
||||
char *c;
|
||||
|
|
|
@ -6,6 +6,7 @@ void sdrhw(void);
|
|||
void sdrrow(char *_row);
|
||||
void sdrrdbuf(int dq);
|
||||
void sdrrd(char *startaddr, char *dq);
|
||||
void sdrrderr(char *count);
|
||||
void sdrwr(char *startaddr);
|
||||
int memtest_silent(void);
|
||||
int memtest(void);
|
||||
|
|
Loading…
Reference in a new issue