From dc2024f54d7709dcc6ee7c385e804541dba1cde6 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 23 May 2014 21:31:26 +0200 Subject: [PATCH] bios: remove references to 'DDR' SDRAM, as we also support SDR SDRAM --- software/bios/main.c | 20 ++++++++++---------- software/bios/sdram.c | 24 +++++++++++++----------- software/bios/sdram.h | 12 ++++++------ 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/software/bios/main.c b/software/bios/main.c index 7bd0d085..01c2e0ec 100644 --- a/software/bios/main.c +++ b/software/bios/main.c @@ -375,13 +375,13 @@ static void do_command(char *c) #endif #ifdef DFII_BASE - else if(strcmp(token, "ddrrow") == 0) ddrrow(get_token(&c)); - else if(strcmp(token, "ddrsw") == 0) ddrsw(); - else if(strcmp(token, "ddrhw") == 0) ddrhw(); - else if(strcmp(token, "ddrrd") == 0) ddrrd(get_token(&c)); - else if(strcmp(token, "ddrwr") == 0) ddrwr(get_token(&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, "sdrwr") == 0) sdrwr(get_token(&c)); else if(strcmp(token, "memtest") == 0) memtest(); - else if(strcmp(token, "ddrinit") == 0) ddrinit(); + else if(strcmp(token, "sdrinit") == 0) sdrinit(); #endif else if(strcmp(token, "dfs") == 0) dfs(get_token(&c)); @@ -505,7 +505,7 @@ static void boot_sequence(void) int main(int i, char **c) { char buffer[64]; - int ddr_ok; + int sdr_ok; irq_setmask(0); irq_setie(1); @@ -519,11 +519,11 @@ int main(int i, char **c) ethreset(); #endif #ifdef DFII_BASE - ddr_ok = ddrinit(); + sdr_ok = sdrinit(); #else - ddr_ok = 1; + sdr_ok = 1; #endif - if(ddr_ok) + if(sdr_ok) boot_sequence(); else printf("Memory initialization failed\n"); diff --git a/software/bios/sdram.c b/software/bios/sdram.c index afa72864..1f862a63 100644 --- a/software/bios/sdram.c +++ b/software/bios/sdram.c @@ -24,19 +24,19 @@ static void cdelay(int i) } } -void ddrsw(void) +void sdrsw(void) { dfii_control_write(DFII_CONTROL_CKE); - printf("DDR now under software control\n"); + printf("SDRAM now under software control\n"); } -void ddrhw(void) +void sdrhw(void) { dfii_control_write(DFII_CONTROL_SEL|DFII_CONTROL_CKE); - printf("DDR now under hardware control\n"); + printf("SDRAM now under hardware control\n"); } -void ddrrow(char *_row) +void sdrrow(char *_row) { char *c; unsigned int row; @@ -61,14 +61,14 @@ void ddrrow(char *_row) } } -void ddrrd(char *startaddr) +void sdrrd(char *startaddr) { char *c; unsigned int addr; int i; if(*startaddr == 0) { - printf("ddrrd
\n"); + printf("sdrrd
\n"); return; } addr = strtoul(startaddr, &c, 0); @@ -82,6 +82,7 @@ void ddrrd(char *startaddr) command_prd(DFII_COMMAND_CAS|DFII_COMMAND_CS|DFII_COMMAND_RDDATA); cdelay(15); + // FIXME for(i=0;i<8;i++) printf("%02x", MMPTR(0xe0001038+4*i)); for(i=0;i<8;i++) @@ -89,14 +90,14 @@ void ddrrd(char *startaddr) printf("\n"); } -void ddrwr(char *startaddr) +void sdrwr(char *startaddr) { char *c; unsigned int addr; int i; if(*startaddr == 0) { - printf("ddrrd
\n"); + printf("sdrrd
\n"); return; } addr = strtoul(startaddr, &c, 0); @@ -105,6 +106,7 @@ void ddrwr(char *startaddr) return; } + // FIXME for(i=0;i<8;i++) { MMPTR(0xe0001018+4*i) = i; MMPTR(0xe000106c+4*i) = 0xf0 + i; @@ -154,9 +156,9 @@ int memtest(void) } } -int ddrinit(void) +int sdrinit(void) { - printf("Initializing DDR SDRAM...\n"); + printf("Initializing SDRAM...\n"); init_sequence(); dfii_control_write(DFII_CONTROL_SEL|DFII_CONTROL_CKE); diff --git a/software/bios/sdram.h b/software/bios/sdram.h index e32df186..e2fa919f 100644 --- a/software/bios/sdram.h +++ b/software/bios/sdram.h @@ -1,13 +1,13 @@ #ifndef __SDRAM_H #define __SDRAM_H -void ddrsw(void); -void ddrhw(void); -void ddrrow(char *_row); -void ddrrd(char *startaddr); -void ddrwr(char *startaddr); +void sdrsw(void); +void sdrhw(void); +void sdrrow(char *_row); +void sdrrd(char *startaddr); +void sdrwr(char *startaddr); int memtest_silent(void); int memtest(void); -int ddrinit(void); +int sdrinit(void); #endif /* __SDRAM_H */ -- 2.30.2