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();
}
}
-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<DFII_NPHASES;p++)
+ for(i=first_byte;i<DFII_PIX_RDDATA_SIZE;i+=step)
+ printf("%02x", MMPTR(dfii_pix_rddata_addr[p]+4*i));
+ printf("\n");
+}
+
+void sdrrd(char *startaddr, char *dq)
{
char *c;
unsigned int addr;
- int i;
- int p;
+ int _dq;
if(*startaddr == 0) {
printf("sdrrd <address>\n");
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<DFII_NPHASES;p++)
- for(i=0;i<DFII_PIX_RDDATA_SIZE;i++)
- printf("%02x", MMPTR(dfii_pix_rddata_addr[p]+4*i));
- printf("\n");
+ sdrrdbuf(_dq);
}
void sdrwr(char *startaddr)
void sdrsw(void);
void sdrhw(void);
void sdrrow(char *_row);
-void sdrrd(char *startaddr);
+void sdrrdbuf(int dq);
+void sdrrd(char *startaddr, char *dq);
void sdrwr(char *startaddr);
int memtest_silent(void);
int memtest(void);