memspeed: Write a fixed value
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 8 Jul 2020 07:13:37 +0000 (17:13 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 8 Jul 2020 07:13:37 +0000 (17:13 +1000)
Otherwise we have at least an extra addition in the loop
which squews the result compared to the read loop.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
litex/soc/software/libbase/memtest.c

index 2fd5aedcbbb5479c0c880b2609c9b15306672d6f..2067d5e433f6d2088914fc68c5daeb3944f55b7c 100644 (file)
@@ -185,7 +185,7 @@ void memspeed(unsigned int *addr, unsigned long size, bool read_only)
                timer0_update_value_write(1);
                start = timer0_value_read();
                for(i = 0; i < size/sz; i++) {
-                       array[i] = i;
+                       array[i] = -1ul;
                }
                timer0_update_value_write(1);
                end = timer0_value_read();