sdps
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Macros Groups Pages
xsdps_options.c File Reference

Overview

Implements the APIs for changing the various options in host and card.

See xsdps.h for a detailed description of the device and driver.

MODIFICATION HISTORY:
Ver   Who    Date     Changes


1.00a hk/sg 10/17/13 Initial release 2.1 hk 04/18/14 Increase sleep for eMMC switch command. Add sleep for microblaze designs. CR# 781117. 2.3 sk 09/23/14 Use XSdPs_Change_ClkFreq API whenever changing clock.CR# 816586. 2.5 sg 07/09/15 Added SD 3.0 features kvn 07/15/15 Modified the code according to MISRAC-2012. 2.7 sk 01/08/16 Added workaround for issue in auto tuning mode of SDR50, SDR104 and HS200. sk 02/16/16 Corrected the Tuning logic. sk 03/02/16 Configured the Tap Delay values for eMMC HS200 mode. 2.8 sk 04/20/16 Added new workaround for auto tuning. 3.0 sk 07/07/16 Used usleep API for both arm and microblaze. sk 07/16/16 Added support for UHS modes. sk 07/16/16 Added Tap delays accordingly to different SD/eMMC operating modes. 3.1 mi 09/07/16 Removed compilation warnings with extra compiler flags. sk 11/07/16 Enable Rst_n bit in ext_csd reg if not enabled. sk 11/16/16 Issue DLL reset at 31 iteration to load new zero value. 3.2 sk 02/01/17 Added HSD and DDR mode support for eMMC. sk 02/01/17 Consider bus width parameter from design for switching vns 02/09/17 Added ARMA53_32 support for ZynqMP CR#968397 vns 03/13/17 Fixed MISRAC mandatory violation sk 03/20/17 Add support for EL1 non-secure mode. 3.3 mn 07/25/17 Removed SD0_OTAPDLYENA and SD1_OTAPDLYENA bits mn 08/07/17 Properly set OTAPDLY value by clearing previous bit settings mn 08/17/17 Added CCI support for A53 and disabled data cache operations when it is enabled. mn 08/22/17 Updated for Word Access System support 3.4 mn 01/22/18 Separated out SDR104 and HS200 clock defines 3.6 mn 07/06/18 Fix Cppcheck warnings for sdps driver 3.7 aru 03/12/19 Modified the code according to MISRAC-2012. mn 03/27/19 Disable calls to dll_reset API for versal SPP Platforms 3.8 mn 04/12/19 Modified TapDelay code for supporting ZynqMP and Versal mn 05/21/19 Set correct tap delays for Versal mn 05/21/19 Disable DLL Reset code for Versal mn 08/29/19 Add call to Cache Invalidation API in XSdPs_Get_BusWidth 3.9 mn 03/03/20 Restructured the code for more readability and modularity mn 03/16/20 Move XSdPs_Select_Card API to User APIs 3.10 mn 06/05/20 Modified code for SD Non-Blocking Read support 3.12 sk 01/28/21 Added support for non-blocking write. 3.14 mn 11/28/21 Fix MISRA-C violations. 4.0 sk 02/25/22 Add support for eMMC5.1. 4.1 sk 11/10/22 Add SD/eMMC Tap delay support for Versal Net. 4.5 sk 10/28/25 Update IsCacheCoherent logic to include EL1_NS mode. 4.6 vlt 01/28/26 Fixed codespell issues 4.7 tb 10/01/26 Align Doxygen comments with AMD documentation standards

 
#include "xsdps_core.h"

Functions

s32 XSdPs_Change_ClkFreq (XSdPs *InstancePtr, u32 SelFreq)
 Changes the clock frequency to a given value. More...
 
s32 XSdPs_SetBlkSize (XSdPs *InstancePtr, u16 BlkSize)
 Updates Block size for read/write operations. More...
 
s32 XSdPs_Get_BusWidth (XSdPs *InstancePtr, u8 *ReadBuff)
 Gets bus width support by card. More...
 
s32 XSdPs_Change_BusWidth (XSdPs *InstancePtr)
 Sets bus width to 4-bit in card and host. More...
 
s32 XSdPs_Get_BusSpeed (XSdPs *InstancePtr, u8 *ReadBuff)
 Gets bus speed supported by card. More...
 
s32 XSdPs_Get_Status (XSdPs *InstancePtr, u8 *SdStatReg)
 Gets SD card status information. More...
 
s32 XSdPs_Change_BusSpeed (XSdPs *InstancePtr)
 Sets high speed in card and host. More...
 
s32 XSdPs_Get_Mmc_ExtCsd (XSdPs *InstancePtr, u8 *ReadBuff)
 Gets EXT_CSD register of eMMC. More...
 
s32 XSdPs_Set_Mmc_ExtCsd (XSdPs *InstancePtr, u32 Arg)
 Writes EXT_CSD register of eMMC. More...
 
s32 XSdPs_Pullup (XSdPs *InstancePtr)
 Sends pullup command to card before using DAT line 3 (using 4-bit bus). More...
 
s32 XSdPs_Select_Card (XSdPs *InstancePtr)
 Selects card and sets default block size. More...
 
s32 XSdPs_StartReadTransfer (XSdPs *InstancePtr, u32 Arg, u32 BlkCnt, u8 *Buff)
 Starts SD read transfer. More...
 
s32 XSdPs_StartWriteTransfer (XSdPs *InstancePtr, u32 Arg, u32 BlkCnt, u8 *Buff)
 Starts SD write transfer. More...
 
s32 XSdPs_CheckReadTransfer (XSdPs *InstancePtr)
 Checks if the transfer is completed successfully. More...
 
s32 XSdPs_CheckWriteTransfer (XSdPs *InstancePtr)
 Checks for the write transfer completed. More...