From: Jean THOMAS Date: Thu, 30 Jul 2020 14:40:29 +0000 (+0200) Subject: Remove memtest X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=476bf206232a40a9ab9c40b87f51c7b212d19442;p=gram.git Remove memtest --- diff --git a/libgram/Makefile b/libgram/Makefile index fffed37..80f454f 100644 --- a/libgram/Makefile +++ b/libgram/Makefile @@ -1,4 +1,4 @@ -OBJS := src/init.o src/memtest.o src/dfii.o src/calibration.o +OBJS := src/init.o src/dfii.o src/calibration.o TRIPLE := riscv64-unknown-elf- diff --git a/libgram/src/memtest.c b/libgram/src/memtest.c deleted file mode 100644 index 8dd28c2..0000000 --- a/libgram/src/memtest.c +++ /dev/null @@ -1,45 +0,0 @@ -#include - -static int memtest8(struct gramCtx *ctx, size_t length) { - volatile uint8_t *ram = (volatile uint8_t*)ctx->ddr_base; - size_t i; - - for (i = 0; i < length; i++) { - ram[i] = 0xDE; - } - - for (i = 0; i < length; i++) { - if (ram[i] != 0xDE) { - return GRAM_ERR_MEMTEST; - } - } - - return GRAM_ERR_NONE; -} - -static int memtest32(struct gramCtx *ctx, size_t length) { - volatile uint32_t *ram = (volatile uint32_t*)ctx->ddr_base; - size_t i; - - for (i = 0; i < length; i++) { - ram[i] = 0xFEEDFACE; - } - - for (i = 0; i < length; i++) { - if (ram[i] != 0xFEEDFACE) { - return GRAM_ERR_MEMTEST; - } - } - - return GRAM_ERR_NONE; -} - -int gram_memtest(struct gramCtx *ctx, size_t length, enum GramWidth width) { - if (width == GRAM_8B) { - return memtest8(ctx, length); - } else if (width == GRAM_32B) { - return memtest32(ctx, length); - } - - return GRAM_ERR_UNDOCUMENTED; -}