lib/sw_apps/zynq_fsbl/src/nand.c
u32 InitNand(void)
{

	u32 Status;
	XNandPs_Config *ConfigPtr;

	/*
	 * Set up pointers to instance and the config structure
	 */
	NandInstPtr = &NandInstance;

	/*
	 * Initialize the flash driver.
	 */
	ConfigPtr = XNandPs_LookupConfig(NAND_DEVICE_ID);

	if (ConfigPtr == NULL) {
		fsbl_printf(DEBUG_GENERAL,"Nand Driver failed \n \r");
		return XST_FAILURE;
	}

	Status = XNandPs_CfgInitialize(NandInstPtr, ConfigPtr,
			ConfigPtr->SmcBase,ConfigPtr->FlashBase);
	if (Status != XST_SUCCESS) {
		fsbl_printf(DEBUG_GENERAL,"NAND initialization failed \n \r");
		return XST_FAILURE;
	}

	/*
	 * Set up base address for access
	 */
	FlashReadBaseAddress = XPS_NAND_BASEADDR;

	fsbl_printf(DEBUG_INFO,"InitNand: Geometry = 0x%x\r\n",
		NandInstPtr->Geometry.FlashWidth);

	if (Status != XST_SUCCESS) {
		fsbl_printf(DEBUG_GENERAL,"InitNand: Status = 0x%.8x\r\n", 
				Status);
		return XST_FAILURE;
	}

	/*
	 * set up the FLASH access pointers
	 */
	fsbl_printf(DEBUG_INFO,"Nand driver initialized \n\r");

	return XST_SUCCESS;
}
/******************************************************************************/
/**
*
* This function initializes the controller for the NAND FLASH interface.
*
* @param	none
*
* @return
*		- XST_SUCCESS if the controller initializes correctly
*		- XST_FAILURE if the controller fails to initializes correctly
*
* @note		none.
*
****************************************************************************/
This function initializes the controller for the NAND FLASH interface.
This function initializes the controller for the NAND FLASH interface .
u32 InitNand(void)
{
	u32 Status;
	XNandPs_Config *ConfigPtr;
	NandInstPtr = &NandInstance;
	ConfigPtr = XNandPs_LookupConfig(NAND_DEVICE_ID);
	if (ConfigPtr == NULL) {
		fsbl_printf(DEBUG_GENERAL,"Nand Driver failed \n \r");
		return XST_FAILURE;
	}
	Status = XNandPs_CfgInitialize(NandInstPtr, ConfigPtr,
			ConfigPtr->SmcBase,ConfigPtr->FlashBase);
	if (Status != XST_SUCCESS) {
		fsbl_printf(DEBUG_GENERAL,"NAND initialization failed \n \r");
		return XST_FAILURE;
	}
	FlashReadBaseAddress = XPS_NAND_BASEADDR;
	fsbl_printf(DEBUG_INFO,"InitNand: Geometry = 0x%x\r\n",
		NandInstPtr->Geometry.FlashWidth);
	if (Status != XST_SUCCESS) {
		fsbl_printf(DEBUG_GENERAL,"InitNand: Status = 0x%.8x\r\n", 
				Status);
		return XST_FAILURE;
	}
	fsbl_printf(DEBUG_INFO,"Nand driver initialized \n\r");
	return XST_SUCCESS;
}
u32 InitNand ( void ) { u32 Status ; XNandPs_Config * ConfigPtr ; NandInstPtr = & NandInstance ; ConfigPtr = XNandPs_LookupConfig ( NAND_DEVICE_ID ) ; if ( ConfigPtr == NULL ) { fsbl_printf ( DEBUG_GENERAL , " \n \r " ) ; return XST_FAILURE ; } Status = XNandPs_CfgInitialize ( NandInstPtr , ConfigPtr , ConfigPtr -> SmcBase , ConfigPtr -> FlashBase ) ; if ( Status != XST_SUCCESS ) { fsbl_printf ( DEBUG_GENERAL , " \n \r " ) ; return XST_FAILURE ; } FlashReadBaseAddress = XPS_NAND_BASEADDR ; fsbl_printf ( DEBUG_INFO , " \r \n " , NandInstPtr -> Geometry . FlashWidth ) ; if ( Status != XST_SUCCESS ) { fsbl_printf ( DEBUG_GENERAL , " \r \n " , Status ) ; return XST_FAILURE ; } fsbl_printf ( DEBUG_INFO , " \n \r " ) ; return XST_SUCCESS ; }
This function initializes the controller for the NAND FLASH interface.
This function initializes the controller for the NAND FLASH interface .
/*
	 * Set up pointers to instance and the config structure
	 */ /*
	 * Initialize the flash driver.
	 */ /*
	 * Set up base address for access
	 */ /*
	 * set up the FLASH access pointers
	 */