lib/sw_apps/zynqmp_fsbl/src/xfsbl_sd.c
u32 XFsbl_SdCopy(u32 SrcAddress, PTRSIZE DestAddress, u32 Length)
{
	u32 Status;

	FRESULT rc;	 /* Result code */
	UINT br=0U;

	rc = f_lseek(&fil, SrcAddress);
	if (rc != FR_OK) {
		XFsbl_Printf(DEBUG_INFO,
			"SD: Unable to seek to %x\n", SrcAddress);
		Status = XFSBL_ERROR_SD_F_LSEEK;
		XFsbl_Printf(DEBUG_GENERAL,"XFSBL_ERROR_SD_F_LSEEK\n\r");
		goto END;
	}

	rc = f_read(&fil, (void*)DestAddress, Length, &br);

	if (rc != FR_OK) {
		XFsbl_Printf(DEBUG_GENERAL,
			"SD: f_read returned %d\r\n", rc);
		Status = XFSBL_ERROR_SD_F_READ;
		XFsbl_Printf(DEBUG_GENERAL,"XFSBL_ERROR_SD_F_READ\n\r");
		goto END;
	}

	Status = XFSBL_SUCCESS;
END:
	return Status;
}
/*****************************************************************************/
/**
 * This function is used to copy the data from SD/eMMC to destination
 * address
 *
 * @param SrcAddress is the address of the SD flash where copy should
 * start from
 *
 * @param DestAddress is the address of the destination where it
 * should copy to
 *
 * @param Length Length of the bytes to be copied
 *
 * @return
 * 		- XFSBL_SUCCESS for successful copy
 * 		- errors as mentioned in xfsbl_error.h
 *
 *****************************************************************************/
This function is used to copy the data from SD/eMMC to destination
address

@param SrcAddress is the address of the SD flash where copy should
start from

@param DestAddress is the address of the destination where it
should copy to

@param Length Length of the bytes to be copied

@return
- XFSBL_SUCCESS for successful copy
- errors as mentioned in xfsbl_error.h
This function is used to copy the data from SD / eMMC to destination address @param SrcAddress is the address of the SD flash where copy should start from @param DestAddress is the address of the destination where it should copy to @param Length Length of the bytes to be copied @return - XFSBL_SUCCESS for successful copy - errors as mentioned in xfsbl_error . h
u32 XFsbl_SdCopy(u32 SrcAddress, PTRSIZE DestAddress, u32 Length)
{
	u32 Status;
	FRESULT rc;	 
	UINT br=0U;
	rc = f_lseek(&fil, SrcAddress);
	if (rc != FR_OK) {
		XFsbl_Printf(DEBUG_INFO,
			"SD: Unable to seek to %x\n", SrcAddress);
		Status = XFSBL_ERROR_SD_F_LSEEK;
		XFsbl_Printf(DEBUG_GENERAL,"XFSBL_ERROR_SD_F_LSEEK\n\r");
		goto END;
	}
	rc = f_read(&fil, (void*)DestAddress, Length, &br);
	if (rc != FR_OK) {
		XFsbl_Printf(DEBUG_GENERAL,
			"SD: f_read returned %d\r\n", rc);
		Status = XFSBL_ERROR_SD_F_READ;
		XFsbl_Printf(DEBUG_GENERAL,"XFSBL_ERROR_SD_F_READ\n\r");
		goto END;
	}
	Status = XFSBL_SUCCESS;
END:
	return Status;
}
u32 XFsbl_SdCopy ( u32 SrcAddress , PTRSIZE DestAddress , u32 Length ) { u32 Status ; FRESULT rc ; UINT br = 0U ; rc = f_lseek ( & fil , SrcAddress ) ; if ( rc != FR_OK ) { XFsbl_Printf ( DEBUG_INFO , " \n " , SrcAddress ) ; Status = XFSBL_ERROR_SD_F_LSEEK ; XFsbl_Printf ( DEBUG_GENERAL , " \n \r " ) ; goto END ; } rc = f_read ( & fil , ( void * ) DestAddress , Length , & br ) ; if ( rc != FR_OK ) { XFsbl_Printf ( DEBUG_GENERAL , " \r \n " , rc ) ; Status = XFSBL_ERROR_SD_F_READ ; XFsbl_Printf ( DEBUG_GENERAL , " \n \r " ) ; goto END ; } Status = XFSBL_SUCCESS ; END : return Status ; }
This function is used to copy the data from SD/eMMC to destination
 address
This function is used to copy the data from SD / eMMC to destination address
/* Result code */