pi_tests.h 2.73 KB
#ifndef __PIDV_TESTS_HDR__
#define __PIDV_TESTS_HDR__

/*
 * Tests returning int return PASS, FAIL, or TESTERROR.
 * PASS/FAIL indicates the test was able to run and
 * whether it completed successfully. TESTERROR
 * indicates a failure in code supporting the
 * actual test, such as malloc returning NULL.
 *
 * Tests returning void are wrappers that drive the
 * tests returning int and control output.
 *
 */

/*
 * Flash controller tests 
 */
void flashCtlReadId(const u16 expectedIds[]);
void flashCtlFullPageRead(char *flashInitFileName,
                          const u32 flashSimDeviceSize[]);

void flashCtlBlockOperations(const u32 flashSimDeviceSize[]);
void flashCtlPartialPageReads(const u32 flashSimDeviceSize[]);
int  flashCtlOobReadBufPack(const u32 flashSimDeviceSize[]);
void flashCtlStopAndReset(const u32 flashSimDeviceSize[]);
void flashCtlReadStatus(const u32 flashSimDeviceSize[]);
void flashCtlModuleState(const u32 flashSimDeviceSize[]);
int  flashReadId(int intEnable,int numDevices,const u16 expectedIds[]);
int  flashFullPageReadWalk(FILE *fp,const u32 devSize[]);
int  flashFullPageReadRandom(FILE *fp,const u32 devSize[]);

/*
 * ECC tests
 */
void eccGen(const u32 flashSimDeviceSize[]);
void eccReadValid(const u32 flashSimDeviceSize[]);
void eccSingleBitErr(const u32 flashSimDeviceSize[]);
void eccDoubleBitErr(const u32 flashSimDeviceSize[]);
void eccSingleBitGateLevel(int device,int bigDevice);


/*
 * PI Buffer DMA tests
 */
int piBufDmaTest();
void piBufDmaIntTest();
void piBufDmaErrTest();
void piBufDmaModTest();
void piBufDmaRand(u32 dramStartAddr,int dramSize,int verify);
int startDmaToBuf(u8 *data, u32 pi_addr, u32 num_bytes);
int checkDmaToBuf(u8 *data, u32 pi_addr, u32 num_bytes);
int CheckDmaToDramAccess(u32 pi_addr,int num_bytes, int expect_fail);


/* 
 * AES tests 
 */
int piAesTestRandomKeyDataIv(int intrEnable,
                             u32 ivIndx16,u32 dataIndex16,u32 size16,
                             u8 **rdecdata, u8 **rindata);
int piAesTestRandomKeyDataIvCheck(int intEnable,
                             u32 dataIndex16,u32 size16,
                             u8 *decdata,u8 *indata);
int piAesCheckClearIntr();
void aesGateLevel();

/*
 * ATB tests 
 */
int piAtbEntryIoTest();
int piAtbDmaTest();
void piAtbDmaIntTest(char *flashInitFileName);
void piAtbDmaErrTest(char *flashInitFileName);
void piAtbDmaPioTest(char *flashInitFileName);

/*
 * Register i/o tests
 */
int piRegIoTest();
int piBufIoTest();
/*
 * Register reset state test
 */
int RegResetStateTest();

/*
 * GPIO tests
 */
void gpioSignals();
void gpioBoardId();

/*
 * Memory Module Indicator test
 */
void memModIndicators();

/*
 * Access Control
 */
void accCtrlTest(const u32 flashSimDeviceSize[]);

/*
 * IDE
 */
void ideDebugPort();

#endif