lib/sw_apps/zynq_fsbl/src/nor.c
u32 NorAccess(u32 SourceAddress, u32 DestinationAddress, u32 LengthBytes)
{
	u32 Data;
	u32 Count;
	u32 *SourceAddr;
	u32 *DestAddr;
	u32 LengthWords;

	/*
	 * check for non-word tail
	 * add bytes to cover the end
	 */
	if ((LengthBytes%4) != 0){

		LengthBytes += (4 - (LengthBytes & 0x00000003));
	}

	LengthWords = LengthBytes >> WORD_LENGTH_SHIFT;

	SourceAddr = (u32 *)(SourceAddress + FlashReadBaseAddress);
	DestAddr = (u32 *)(DestinationAddress);

	/*
	 * Word transfers, endianism isn't an issue
	 */
	for (Count=0; Count < LengthWords; Count++){

		Data = Xil_In32((u32)(SourceAddr++));
		Xil_Out32((u32)(DestAddr++), Data);
	}

	return XST_SUCCESS;
}
/******************************************************************************/
/**
*
* This function provides the NOR FLASH interface for the Simplified header
* functionality.
*
* @param	SourceAddress is address in FLASH data space
* @param	DestinationAddress is address in OCM data space
* @param	LengthBytes is the data length to transfer in bytes
*
* @return
*		- XST_SUCCESS if the write completes correctly
*		- XST_FAILURE if the write fails to completes correctly
*
* @note		None.
*
****************************************************************************/
This function provides the NOR FLASH interface for the Simplified header
functionality.
This function provides the NOR FLASH interface for the Simplified header functionality .
u32 NorAccess(u32 SourceAddress, u32 DestinationAddress, u32 LengthBytes)
{
	u32 Data;
	u32 Count;
	u32 *SourceAddr;
	u32 *DestAddr;
	u32 LengthWords;
	if ((LengthBytes%4) != 0){
		LengthBytes += (4 - (LengthBytes & 0x00000003));
	}
	LengthWords = LengthBytes >> WORD_LENGTH_SHIFT;
	SourceAddr = (u32 *)(SourceAddress + FlashReadBaseAddress);
	DestAddr = (u32 *)(DestinationAddress);
	for (Count=0; Count < LengthWords; Count++){
		Data = Xil_In32((u32)(SourceAddr++));
		Xil_Out32((u32)(DestAddr++), Data);
	}
	return XST_SUCCESS;
}
u32 NorAccess ( u32 SourceAddress , u32 DestinationAddress , u32 LengthBytes ) { u32 Data ; u32 Count ; u32 * SourceAddr ; u32 * DestAddr ; u32 LengthWords ; if ( ( LengthBytes % 4 ) != 0 ) { LengthBytes += ( 4 - ( LengthBytes & 0x00000003 ) ) ; } LengthWords = LengthBytes >> WORD_LENGTH_SHIFT ; SourceAddr = ( u32 * ) ( SourceAddress + FlashReadBaseAddress ) ; DestAddr = ( u32 * ) ( DestinationAddress ) ; for ( Count = 0 ; Count < LengthWords ; Count ++ ) { Data = Xil_In32 ( ( u32 ) ( SourceAddr ++ ) ) ; Xil_Out32 ( ( u32 ) ( DestAddr ++ ) , Data ) ; } return XST_SUCCESS ; }
This function provides the NOR FLASH interface for the Simplified header
functionality.
This function provides the NOR FLASH interface for the Simplified header functionality .
/*
	 * check for non-word tail
	 * add bytes to cover the end
	 */ /*
	 * Word transfers, endianism isn't an issue
	 */