From 8c8c0a0be4dc937c36bac5c5f29a1974e5a1e0ec Mon Sep 17 00:00:00 2001 From: barthess Date: Tue, 4 Aug 2015 00:35:44 +0300 Subject: Memtest improvements --- os/various/memtest.hpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'os/various/memtest.hpp') diff --git a/os/various/memtest.hpp b/os/various/memtest.hpp index 200db1f..ba686a3 100644 --- a/os/various/memtest.hpp +++ b/os/various/memtest.hpp @@ -37,7 +37,8 @@ typedef uint32_t testtype; /* * Error call back. */ -typedef void (*memtestecb_t)(memtest_t *testp, testtype type, size_t address); +typedef void (*memtestecb_t)(memtest_t *testp, testtype type, size_t offset, + size_t current_width, uint32_t got, uint32_t expect); /* * @@ -45,18 +46,32 @@ typedef void (*memtestecb_t)(memtest_t *testp, testtype type, size_t address); typedef enum { MEMTEST_WIDTH_8, MEMTEST_WIDTH_16, - MEMTEST_WIDTH_32 + MEMTEST_WIDTH_32, } memtest_bus_width_t; /* * */ struct memtest_t { + /* + * Pointer to the test area start. Must be word aligned. + */ void *start; + /* + * Test area size in bytes. + */ size_t size; + /* + * Maximum width of transactions. + * Note: it implies all narrower tests. + * Note: width my be wider then your memory interface because AHB is + * smart enough to split big transactions to smaller ones. + */ memtest_bus_width_t width; - memtestecb_t ecb; - unsigned int rand_seed; + /* + * Error callback pointer. Set to NULL if unused. + */ + memtestecb_t errcb; }; /* -- cgit v1.2.3