lib/sw_services/xilisf/src/xilisf_write.c
static int WriteOTPData(XIsf *InstancePtr, u32 Address, const u8 *BufferPtr)
{
	int Status = (int)XST_FAILURE;

	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(Address != 0);
	Xil_AssertNonvoid(BufferPtr != NULL);


#if (XPAR_XISF_FLASH_FAMILY == INTEL)
	if (BufferPtr == NULL)
		return (int)XST_FAILURE;

	InstancePtr->WriteBufPtr[BYTE1] = XISF_CMD_OTP_WRITE;
	InstancePtr->WriteBufPtr[BYTE2] =
			(u8) (Address >> XISF_ADDR_SHIFT16);
	InstancePtr->WriteBufPtr[BYTE3] =
			(u8) (Address >> XISF_ADDR_SHIFT8);
	InstancePtr->WriteBufPtr[BYTE4] = (u8) Address;
	InstancePtr->WriteBufPtr[BYTE5] = *BufferPtr;

	/*
	 * Initiate the Transfer.
	 */
	Status = XIsf_Transfer(InstancePtr, InstancePtr->WriteBufPtr, NULL,
					XISF_OTP_RDWR_EXTRA_BYTES);
	if (Status != (int)XST_SUCCESS)
		return (int)XST_FAILURE;
#endif /* (XPAR_XISF_FLASH_FAMILY == INTEL) */

	return Status;
}
/*****************************************************************************/
/**
 *
 * This function writes one byte of data to the OTP area in the Serial Flash.
 *
 * @param	InstancePtr is a pointer to the XIsf instance.
 * @param	Address is the address in the OTP area, where to write data.
 * @param	BufferPtr is the pointer to the data to be written into OTP
 *		region of Serial Flash.
 *
 * @return	XST_SUCCESS if successful else XST_FAILURE.
 *
 * @note
 *		- A minimum of one byte and a maximum of one byte can be
 *		written using this function.
 *		- This operation is supported only for Intel Serial Flash.
 *
 ******************************************************************************/
This function writes one byte of data to the OTP area in the Serial Flash.
@param       InstancePtr is a pointer to the XIsf instance.
@param       Address is the address in the OTP area, where to write data.
@param       BufferPtr is the pointer to the data to be written into OTP
region of Serial Flash.



@note
- A minimum of one byte and a maximum of one byte can be
written using this function.
- This operation is supported only for Intel Serial Flash.
This function writes one byte of data to the OTP area in the Serial Flash . @param InstancePtr is a pointer to the XIsf instance . @param Address is the address in the OTP area where to write data . @param BufferPtr is the pointer to the data to be written into OTP region of Serial Flash . @note - A minimum of one byte and a maximum of one byte can be written using this function . - This operation is supported only for Intel Serial Flash .
static int WriteOTPData(XIsf *InstancePtr, u32 Address, const u8 *BufferPtr)
{
	int Status = (int)XST_FAILURE;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(Address != 0);
	Xil_AssertNonvoid(BufferPtr != NULL);
#if (XPAR_XISF_FLASH_FAMILY == INTEL)
	if (BufferPtr == NULL)
		return (int)XST_FAILURE;
	InstancePtr->WriteBufPtr[BYTE1] = XISF_CMD_OTP_WRITE;
	InstancePtr->WriteBufPtr[BYTE2] =
			(u8) (Address >> XISF_ADDR_SHIFT16);
	InstancePtr->WriteBufPtr[BYTE3] =
			(u8) (Address >> XISF_ADDR_SHIFT8);
	InstancePtr->WriteBufPtr[BYTE4] = (u8) Address;
	InstancePtr->WriteBufPtr[BYTE5] = *BufferPtr;
	Status = XIsf_Transfer(InstancePtr, InstancePtr->WriteBufPtr, NULL,
					XISF_OTP_RDWR_EXTRA_BYTES);
	if (Status != (int)XST_SUCCESS)
		return (int)XST_FAILURE;
#endif 
	return Status;
}
static int WriteOTPData ( XIsf * InstancePtr , u32 Address , const u8 * BufferPtr ) { int Status = ( int ) XST_FAILURE ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( Address != 0 ) ; Xil_AssertNonvoid ( BufferPtr != NULL ) ; #if ( XPAR_XISF_FLASH_FAMILY == INTEL ) if ( BufferPtr == NULL ) return ( int ) XST_FAILURE ; InstancePtr -> WriteBufPtr [ BYTE1 ] = XISF_CMD_OTP_WRITE ; InstancePtr -> WriteBufPtr [ BYTE2 ] = ( u8 ) ( Address >> XISF_ADDR_SHIFT16 ) ; InstancePtr -> WriteBufPtr [ BYTE3 ] = ( u8 ) ( Address >> XISF_ADDR_SHIFT8 ) ; InstancePtr -> WriteBufPtr [ BYTE4 ] = ( u8 ) Address ; InstancePtr -> WriteBufPtr [ BYTE5 ] = * BufferPtr ; Status = XIsf_Transfer ( InstancePtr , InstancePtr -> WriteBufPtr , NULL , XISF_OTP_RDWR_EXTRA_BYTES ) ; if ( Status != ( int ) XST_SUCCESS ) return ( int ) XST_FAILURE ; #endif return Status ; }
This function writes one byte of data to the OTP area in the Serial Flash.
This function writes one byte of data to the OTP area in the Serial Flash .
/*
	 * Initiate the Transfer.
	 */ /* (XPAR_XISF_FLASH_FAMILY == INTEL) */