Memtest. Changed way to specify memtest data width
This commit is contained in:
parent
51514b134e
commit
d5e967add4
|
@ -227,20 +227,15 @@ static void memtest_wrapper(memtest_t *testp,
|
|||
void (*p_u8)(memtest_t *testp),
|
||||
void (*p_u16)(memtest_t *testp),
|
||||
void (*p_u32)(memtest_t *testp)) {
|
||||
switch(testp->width) {
|
||||
case MEMTEST_WIDTH_32:
|
||||
|
||||
if (testp->width_mask & MEMTEST_WIDTH_8)
|
||||
p_u8(testp);
|
||||
|
||||
if (testp->width_mask & MEMTEST_WIDTH_16)
|
||||
p_u16(testp);
|
||||
|
||||
if (testp->width_mask & MEMTEST_WIDTH_32)
|
||||
p_u32(testp);
|
||||
break;
|
||||
case MEMTEST_WIDTH_16:
|
||||
p_u8(testp);
|
||||
p_u16(testp);
|
||||
break;
|
||||
case MEMTEST_WIDTH_8:
|
||||
p_u8(testp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
#ifndef MEMTEST_H_
|
||||
#define MEMTEST_H_
|
||||
|
||||
/*
|
||||
* Memtest types
|
||||
*/
|
||||
#define MEMTEST_WALKING_ONE (1 << 0)
|
||||
#define MEMTEST_WALKING_ZERO (1 << 1)
|
||||
#define MEMTEST_OWN_ADDRESS (1 << 2)
|
||||
|
@ -24,6 +27,9 @@
|
|||
#define MEMTEST_MOVING_INVERSION_55AA (1 << 4)
|
||||
#define MEMTEST_MOVING_INVERSION_RAND (1 << 5)
|
||||
|
||||
/*
|
||||
* combined types for convenient
|
||||
*/
|
||||
#define MEMTEST_RUN_ALL (MEMTEST_WALKING_ONE | \
|
||||
MEMTEST_WALKING_ZERO | \
|
||||
MEMTEST_OWN_ADDRESS | \
|
||||
|
@ -31,6 +37,13 @@
|
|||
MEMTEST_MOVING_INVERSION_55AA | \
|
||||
MEMTEST_MOVING_INVERSION_RAND)
|
||||
|
||||
/*
|
||||
* Memtest data widths
|
||||
*/
|
||||
#define MEMTEST_WIDTH_8 (1 << 0)
|
||||
#define MEMTEST_WIDTH_16 (1 << 1)
|
||||
#define MEMTEST_WIDTH_32 (1 << 2)
|
||||
|
||||
typedef struct memtest_t memtest_t;
|
||||
typedef uint32_t testtype;
|
||||
|
||||
|
@ -40,15 +53,6 @@ typedef uint32_t testtype;
|
|||
typedef void (*memtestecb_t)(memtest_t *testp, testtype type, size_t index,
|
||||
size_t current_width, uint32_t got, uint32_t expect);
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
MEMTEST_WIDTH_8,
|
||||
MEMTEST_WIDTH_16,
|
||||
MEMTEST_WIDTH_32,
|
||||
} memtest_bus_width_t;
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
@ -62,12 +66,9 @@ struct memtest_t {
|
|||
*/
|
||||
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.
|
||||
* Allowable data widths mask.
|
||||
*/
|
||||
memtest_bus_width_t width;
|
||||
uint32_t width_mask;
|
||||
/*
|
||||
* Error callback pointer. Set to NULL if unused.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue