From: Benjamin Herrenschmidt Date: Mon, 1 Jun 2020 22:08:42 +0000 (+1000) Subject: sdram: Use unsigned long for memory test X-Git-Tag: 24jan2021_ls180~246^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6239eac1301f81ab4981002d7a2209cfb9c2dd4b;p=litex.git sdram: Use unsigned long for memory test This makes it twice as fast on 64-bit CPUs when using a 64-bit bus :-) Signed-off-by: Benjamin Herrenschmidt --- diff --git a/litex/soc/software/liblitedram/sdram.c b/litex/soc/software/liblitedram/sdram.c index 55ea65f1..52b3455b 100644 --- a/litex/soc/software/liblitedram/sdram.c +++ b/litex/soc/software/liblitedram/sdram.c @@ -878,12 +878,13 @@ static int memtest_addr(void) static void memspeed(void) { - volatile unsigned int *array = (unsigned int *)MAIN_RAM_BASE; + volatile unsigned long *array = (unsigned long *)MAIN_RAM_BASE; int i; unsigned int start, end; unsigned long write_speed; unsigned long read_speed; - __attribute__((unused)) unsigned int data; + __attribute__((unused)) unsigned long data; + const unsigned int sz = sizeof(unsigned long); /* init timer */ timer0_en_write(0); @@ -894,7 +895,7 @@ static void memspeed(void) /* write speed */ timer0_update_value_write(1); start = timer0_value_read(); - for(i=0;i