XilinxProcessorIPLib/drivers/nandps/src/xnandps_onfi.c
static int Onfi_ReadParamPage(XNandPs *InstancePtr, u8 *Buf)
{
	u32 Index;
	u32 CrcCalc;
	OnfiNand_Geometry *Geometry;

	/*
	 * Read the first 256 bytes of parameter page
	 */
	Onfi_CmdReadParamPage(InstancePtr);
	/* Read the 3 mandatory parameter pages */
	for(Index = 0; Index < 3; Index++) {
		Onfi_ReadData(InstancePtr, Buf, ONFI_PARAM_PAGE_LEN);
		Geometry = (OnfiNand_Geometry *)Buf;
		/* Check the CRC */
		CrcCalc = Onfi_Crc16(Buf);
		if(CrcCalc == Geometry->Crc) {
			break;
		}
	}

	if (Index == 3) {
		return XST_FAILURE;
	}

	return XST_SUCCESS;
}
/**************************************************************************/
/**
*
* This function reads the NAND flash parameter page defined by ONFI 1.0
* specification.
*
* @param	InstancePtr is a pointer to the XNandPs instance.
* @param	Buf is a buffer pointer to fill the data.
*
* @return
* 		- XST_SUCCESS if parameter page read successfully.
* 		- XST_FAILURE if parameter page is not read successfully.
*
* @note		None
*
***************************************************************************/
This function reads the NAND flash parameter page defined by ONFI 1.0
specification.
This function reads the NAND flash parameter page defined by ONFI 1 . 0 specification .
static int Onfi_ReadParamPage(XNandPs *InstancePtr, u8 *Buf)
{
	u32 Index;
	u32 CrcCalc;
	OnfiNand_Geometry *Geometry;
	Onfi_CmdReadParamPage(InstancePtr);
	for(Index = 0; Index < 3; Index++) {
		Onfi_ReadData(InstancePtr, Buf, ONFI_PARAM_PAGE_LEN);
		Geometry = (OnfiNand_Geometry *)Buf;
		CrcCalc = Onfi_Crc16(Buf);
		if(CrcCalc == Geometry->Crc) {
			break;
		}
	}
	if (Index == 3) {
		return XST_FAILURE;
	}
	return XST_SUCCESS;
}
static int Onfi_ReadParamPage ( XNandPs * InstancePtr , u8 * Buf ) { u32 Index ; u32 CrcCalc ; OnfiNand_Geometry * Geometry ; Onfi_CmdReadParamPage ( InstancePtr ) ; for ( Index = 0 ; Index < 3 ; Index ++ ) { Onfi_ReadData ( InstancePtr , Buf , ONFI_PARAM_PAGE_LEN ) ; Geometry = ( OnfiNand_Geometry * ) Buf ; CrcCalc = Onfi_Crc16 ( Buf ) ; if ( CrcCalc == Geometry -> Crc ) { break ; } } if ( Index == 3 ) { return XST_FAILURE ; } return XST_SUCCESS ; }
This function reads the NAND flash parameter page defined by ONFI 1.0
specification.
This function reads the NAND flash parameter page defined by ONFI 1 . 0 specification .
/*
	 * Read the first 256 bytes of parameter page
	 */ /* Read the 3 mandatory parameter pages */ /* Check the CRC */