ndps8_v2_0: Optimized integration test files.

Removed multiple inclusion of header files,
unused variables, unused function parameters.

Signed-off-by: Shakti Bhatnagar <shaktib@xilinx.com>
This commit is contained in:
Shakti Bhatnagar 2014-12-19 14:30:53 +05:30 committed by Suneel Garapati
parent eb25d9c385
commit 9b4870e9cb
11 changed files with 24 additions and 50 deletions

View file

@ -1,9 +1,5 @@
NandPs8 Integration test
- On A53 processors use the linker script for DDR region to run the integration test
With OCM linker script which is the default linker script, the integration test may hang.
In order to run on OCM, you can use Xil_DCacheDisable() in the main and run the integration test.
- On R5 processors, you may get compilation error for bsp stating "undefined reference to `end'"
Add end = .; at the end of the linker script to remove this error

View file

@ -58,7 +58,7 @@
******************************************************************************/
/***************************** Include Files *********************************/
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <unistd.h>

View file

@ -164,7 +164,6 @@ u8 WriteBuffer[TEST_BUF_SIZE] __attribute__ ((aligned(64)));/**< write buffer */
*/
XNandPs8 NandInstance;
XNandPs8 *NandInstPtr = &NandInstance;
XNandPs8_Config *Config;
/************************** Function Prototypes ******************************/
static unsigned int GetUserInput(char* Prompt, char* Response,
@ -373,7 +372,7 @@ void Intg_Entry(void)
#endif
Out:
exit(0);
return;
}
#ifdef AUTOMATIC_TEST_MODE
@ -817,6 +816,7 @@ int UART_RecvByte(u8 *Data)
s32 FlashInit(u16 NandDeviceId){
s32 Status = XST_FAILURE;
XNandPs8_Config *Config;
Config = XNandPs8_LookupConfig(NandDeviceId);
if (Config == NULL) {

View file

@ -116,8 +116,7 @@ extern u8 WriteBuffer[]; /**< write buffer */
/************************** Variable Definitions ****************************/
/**< XCanPs instance used throughout tests */
extern XNandPs8 NandInstance;
/**< XNandPs8 instance used throughout tests */
extern XNandPs8* NandInstPtr;
s32 MismatchCounter;
/************************** Function Prototypes *****************************/

View file

@ -120,8 +120,6 @@ int Intg_BbtTest(XNandPs8 * NandInstPtr, int TestLoops)
* If not found Create new and write it onto flash.
*
* @param NandInstPtr - Instance to the nand driver.
* @param NandDeviceId is is the XPAR_<NAND_instance>_DEVICE_ID value
* from xparameters.h.
*
* @return
*

View file

@ -77,7 +77,7 @@
/************************** Variable Definitions ****************************/
/************************** Function Prototypes *****************************/
s32 Ecc_Test(XNandPs8 * NandInstPtr, u16 NandDeviceId);
s32 Ecc_Test(XNandPs8 * NandInstPtr);
/************************** Function Definitions ****************************/
/****************************************************************************/
@ -100,8 +100,7 @@ int Intg_EccTest(XNandPs8 * NandInstPtr, int TestLoops)
CT_TestReset("Module Ecc Error Check test");
while(TestLoops--) {
/* Get the configuration table entry for this CAN device */
Status = Ecc_Test(NandInstPtr, NAND_DEVICE_ID);
Status = Ecc_Test(NandInstPtr);
if (Status != XST_SUCCESS) {
CT_LOG_FAILURE("Ecc Error Check Test Failed with "
"%d mismatches\r\n", MismatchCounter);
@ -128,8 +127,6 @@ int Intg_EccTest(XNandPs8 * NandInstPtr, int TestLoops)
* - Compare the data read against the data Written before corruption.
*
* @param NandInstPtr - Instance to the nand driver.
* @param NandDeviceId is is the XPAR_<NAND_instance>_DEVICE_ID value
* from xparameters.h.
*
* @return
* - XST_SUCCESS if successful.
@ -139,7 +136,7 @@ int Intg_EccTest(XNandPs8 * NandInstPtr, int TestLoops)
* None
*
****************************************************************************/
s32 Ecc_Test(XNandPs8 * NandInstPtr, u16 NandDeviceId)
s32 Ecc_Test(XNandPs8 * NandInstPtr)
{
s32 Status = XST_FAILURE;
u32 Index;

View file

@ -77,7 +77,7 @@
/************************** Variable Definitions ****************************/
/************************** Function Prototypes *****************************/
s32 Erase_Read_Test(XNandPs8 * NandInstPtr, u16 NandDeviceId);
s32 Erase_Read_Test(XNandPs8 * NandInstPtr);
/************************** Function Definitions ****************************/
/****************************************************************************/
@ -100,8 +100,7 @@ int Intg_EraseReadTest(XNandPs8 * NandInstPtr, int TestLoops)
CT_TestReset("Module FLASH Erase Read test");
while(TestLoops--) {
/* Get the configuration table entry for this CAN device */
Status = Erase_Read_Test(NandInstPtr, NAND_DEVICE_ID);
Status = Erase_Read_Test(NandInstPtr);
if (Status != XST_SUCCESS) {
CT_LOG_FAILURE("Nand Flash Erase ReadTest Failed"
" with %d mismatches\r\n", MismatchCounter);
@ -124,8 +123,6 @@ int Intg_EraseReadTest(XNandPs8 * NandInstPtr, int TestLoops)
* - Compare the data read against 0xFF.
*
* @param NandInstPtr - Instance to the nand driver.
* @param NandDeviceId is is the XPAR_<NAND_instance>_DEVICE_ID value
* from xparameters.h.
*
* @return
* - XST_SUCCESS if successful.
@ -135,7 +132,7 @@ int Intg_EraseReadTest(XNandPs8 * NandInstPtr, int TestLoops)
* None
*
****************************************************************************/
s32 Erase_Read_Test(XNandPs8 * NandInstPtr, u16 NandDeviceId)
s32 Erase_Read_Test(XNandPs8 * NandInstPtr)
{
s32 Status = XST_FAILURE;
s32 i = 0;

View file

@ -77,7 +77,7 @@
/************************** Variable Definitions ****************************/
/************************** Function Prototypes *****************************/
s32 Flash_RW_Test(XNandPs8 * NandInstPtr, u16 NandDeviceId);
s32 Flash_RW_Test(XNandPs8 * NandInstPtr);
/************************** Function Definitions ****************************/
/****************************************************************************/
@ -100,9 +100,7 @@ int Intg_FlashRWTest(XNandPs8 * NandInstPtr, int TestLoops)
CT_TestReset("Module FLASH Read Write test");
while(TestLoops--) {
/* Get the configuration table entry for this CAN device */
Status = Flash_RW_Test(NandInstPtr, NAND_DEVICE_ID);
Status = Flash_RW_Test(NandInstPtr);
if (Status != XST_SUCCESS) {
CT_LOG_FAILURE("Nand Flash Read Write Test Failed"
" with %d mismatches\r\n", MismatchCounter);
@ -128,8 +126,6 @@ int Intg_FlashRWTest(XNandPs8 * NandInstPtr, int TestLoops)
* - Compare the data read against the data Written.
*
* @param NandInstPtr - Instance to the nand driver.
* @param NandDeviceId is is the XPAR_<NAND_instance>_DEVICE_ID value
* from xparameters.h.
*
* @return
* - XST_SUCCESS if successful.
@ -139,7 +135,7 @@ int Intg_FlashRWTest(XNandPs8 * NandInstPtr, int TestLoops)
* None
*
****************************************************************************/
s32 Flash_RW_Test(XNandPs8 * NandInstPtr, u16 NandDeviceId)
s32 Flash_RW_Test(XNandPs8 * NandInstPtr)
{
s32 Status = XST_FAILURE;
u32 Index;

View file

@ -78,7 +78,7 @@
/************************** Variable Definitions ****************************/
/************************** Function Prototypes *****************************/
s32 PartialPage_RW_Test(XNandPs8 * NandInstPtr, u16 NandDeviceId);
s32 PartialPage_RW_Test(XNandPs8 * NandInstPtr);
/************************** Function Definitions ****************************/
/****************************************************************************/
@ -101,8 +101,7 @@ int Intg_PartialRWTest(XNandPs8 * NandInstPtr, int TestLoops)
CT_TestReset("Module Partial Page Read Write test");
while(TestLoops--) {
/* Get the configuration table entry for this CAN device */
Status = PartialPage_RW_Test(NandInstPtr, NAND_DEVICE_ID);
Status = PartialPage_RW_Test(NandInstPtr);
if (Status != XST_SUCCESS) {
CT_LOG_FAILURE("Nand Partial Page Read Write Failed"
" with %d mismatches\r\n", MismatchCounter);
@ -127,8 +126,6 @@ int Intg_PartialRWTest(XNandPs8 * NandInstPtr, int TestLoops)
* - Compare the data read against the data Written.
*
* @param NandInstPtr - Instance to the nand driver.
* @param NandDeviceId is is the XPAR_<NAND_instance>_DEVICE_ID value
* from xparameters.h.
*
* @return
* - XST_SUCCESS if successful.
@ -138,7 +135,7 @@ int Intg_PartialRWTest(XNandPs8 * NandInstPtr, int TestLoops)
* None
*
****************************************************************************/
s32 PartialPage_RW_Test(XNandPs8 * NandInstPtr, u16 NandDeviceId)
s32 PartialPage_RW_Test(XNandPs8 * NandInstPtr)
{
s32 Status = (s32)XST_FAILURE;
u32 Index;
@ -150,7 +147,7 @@ s32 PartialPage_RW_Test(XNandPs8 * NandInstPtr, u16 NandDeviceId)
Length = NandInstPtr->Geometry.BytesPerPage;
/*
* Repeat the test for 20 iterations
* Repeat the test for 5 iterations
*/
for(i = 0; i< 5; i++){

View file

@ -78,7 +78,7 @@
/************************** Variable Definitions ****************************/
/************************** Function Prototypes *****************************/
s32 Random_Block_RW_Test(XNandPs8 * NandInstPtr, u16 NandDeviceId);
s32 Random_Block_RW_Test(XNandPs8 * NandInstPtr);
/************************** Function Definitions ****************************/
/****************************************************************************/
@ -101,8 +101,7 @@ int Intg_RandomRWTest(XNandPs8 * NandInstPtr, int TestLoops)
CT_TestReset("Module Random Block Read Write test");
while(TestLoops--) {
/* Get the configuration table entry for this CAN device */
Status = Random_Block_RW_Test(NandInstPtr, NAND_DEVICE_ID);
Status = Random_Block_RW_Test(NandInstPtr);
if (Status != XST_SUCCESS) {
CT_LOG_FAILURE("Nand Random Block Read Write Test Failed"
" with %d mismatches\r\n", MismatchCounter);
@ -127,8 +126,6 @@ int Intg_RandomRWTest(XNandPs8 * NandInstPtr, int TestLoops)
* - Compare the data read against the data Written.
*
* @param NandInstPtr - Instance to the nand driver.
* @param NandDeviceId is is the XPAR_<NAND_instance>_DEVICE_ID value
* from xparameters.h.
*
* @return
* - XST_SUCCESS if successful.
@ -138,7 +135,7 @@ int Intg_RandomRWTest(XNandPs8 * NandInstPtr, int TestLoops)
* None
*
****************************************************************************/
s32 Random_Block_RW_Test(XNandPs8 * NandInstPtr, u16 NandDeviceId)
s32 Random_Block_RW_Test(XNandPs8 * NandInstPtr)
{
s32 Status = XST_FAILURE;
u32 Index;
@ -161,7 +158,7 @@ s32 Random_Block_RW_Test(XNandPs8 * NandInstPtr, u16 NandDeviceId)
}
/*
* Flash operation i.e. erase, write and read for all the pages
* Flash operation i.e. write and read for all the pages
* of the block.
* This test will take some time to execute. Please be patient.
*/

View file

@ -76,7 +76,7 @@
/************************** Variable Definitions ****************************/
/************************** Function Prototypes *****************************/
s32 SpareBytes_RW_Test(XNandPs8 * NandInstPtr, u16 NandDeviceId);
s32 SpareBytes_RW_Test(XNandPs8 * NandInstPtr);
/************************** Function Definitions ****************************/
/****************************************************************************/
@ -99,8 +99,7 @@ int Intg_SpareBytesRWTest(XNandPs8 * NandInstPtr, int TestLoops)
CT_TestReset("Module Spare Bytes Read Write test");
while(TestLoops--) {
/* Get the configuration table entry for this CAN device */
Status = SpareBytes_RW_Test(NandInstPtr, NAND_DEVICE_ID);
Status = SpareBytes_RW_Test(NandInstPtr);
if (Status != XST_SUCCESS) {
CT_LOG_FAILURE("Nand Spare Bytes Read Write Test Failed"
" with %d mismatches\r\n", MismatchCounter);
@ -124,8 +123,6 @@ int Intg_SpareBytesRWTest(XNandPs8 * NandInstPtr, int TestLoops)
* - Compare the data read against the data Written.
*
* @param NandInstPtr - Instance to the nand driver.
* @param NandDeviceId is is the XPAR_<NAND_instance>_DEVICE_ID value
* from xparameters.h.
*
* @return
* - XST_SUCCESS if successful.
@ -135,7 +132,7 @@ int Intg_SpareBytesRWTest(XNandPs8 * NandInstPtr, int TestLoops)
* None
*
****************************************************************************/
s32 SpareBytes_RW_Test(XNandPs8 * NandInstPtr, u16 NandDeviceId)
s32 SpareBytes_RW_Test(XNandPs8 * NandInstPtr)
{
s32 Status = XST_FAILURE;
u32 Index;