XilinxProcessorIPLib/drivers/spi/examples/xspi_winbond_flash_xip_example.c
int SpiXipExample(XSpi *SpiInstancePtr, u16 SpiDeviceId)
{
	u32 Flashdata;
	int Status;
	XSpi_Config *ConfigPtr;	/* Pointer to Configuration data */

	/*
	 * Initialize the SPI driver so that it is  ready to use.
	 */
	ConfigPtr = XSpi_LookupConfig(SpiDeviceId);
	if (ConfigPtr == NULL) {
		return XST_DEVICE_NOT_FOUND;
	}

	Status = XSpi_CfgInitialize(SpiInstancePtr, ConfigPtr,
				  ConfigPtr->BaseAddress);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/* Read data from flash in the way any memory is accessed using
		Flash Memory Base Address in InstancePtr */

	Flashdata = Xil_In32(SpiInstancePtr->FlashBaseAddr);



	return XST_SUCCESS;
}
/*****************************************************************************/
/**
*
* This function reads data from Flash memory in the way any memory is accessed.
* The purpose of this function is to illustrate how to use SPI device in XIP
* Mode.
*
* This function reads data from Flash in the same way any other memory is
* accessed
*
*
* @param	SpiInstancePtr is a pointer to the instance of Spi component.
* @param	SpiDeviceId is the Device ID of the Spi Device and is the
*		XPAR_<SPI_instance>_DEVICE_ID value from xparameters.h.
*
* @return	XST_SUCCESS if successful, otherwise XST_FAILURE.
*
* @note		None
*
******************************************************************************/
This function reads data from Flash memory in the way any memory is accessed.
The purpose of this function is to illustrate how to use SPI device in XIP
Mode.

This function reads data from Flash in the same way any other memory is
accessed
This function reads data from Flash memory in the way any memory is accessed . The purpose of this function is to illustrate how to use SPI device in XIP Mode . This function reads data from Flash in the same way any other memory is accessed
int SpiXipExample(XSpi *SpiInstancePtr, u16 SpiDeviceId)
{
	u32 Flashdata;
	int Status;
	XSpi_Config *ConfigPtr;	
	ConfigPtr = XSpi_LookupConfig(SpiDeviceId);
	if (ConfigPtr == NULL) {
		return XST_DEVICE_NOT_FOUND;
	}
	Status = XSpi_CfgInitialize(SpiInstancePtr, ConfigPtr,
				  ConfigPtr->BaseAddress);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	Flashdata = Xil_In32(SpiInstancePtr->FlashBaseAddr);
	return XST_SUCCESS;
}
int SpiXipExample ( XSpi * SpiInstancePtr , u16 SpiDeviceId ) { u32 Flashdata ; int Status ; XSpi_Config * ConfigPtr ; ConfigPtr = XSpi_LookupConfig ( SpiDeviceId ) ; if ( ConfigPtr == NULL ) { return XST_DEVICE_NOT_FOUND ; } Status = XSpi_CfgInitialize ( SpiInstancePtr , ConfigPtr , ConfigPtr -> BaseAddress ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } Flashdata = Xil_In32 ( SpiInstancePtr -> FlashBaseAddr ) ; return XST_SUCCESS ; }
This function reads data from Flash memory in the way any memory is accessed.
This function reads data from Flash memory in the way any memory is accessed .
/* Pointer to Configuration data */ /*
	 * Initialize the SPI driver so that it is  ready to use.
	 */ /* Read data from flash in the way any memory is accessed using
		Flash Memory Base Address in InstancePtr */