From 2e8bfd71a887833fcd4dcc28ad8fe8437e14b2e9 Mon Sep 17 00:00:00 2001 From: Harini Katakam Date: Thu, 14 May 2015 14:21:07 +0530 Subject: [PATCH] xilffs: Add card check logic to support Zynq Ultrascale+ MPSoC Add card detection logic as per Zynq Ultrascale+ MPSoc specification. Signed-off-by: Srinivas Goud Signed-off-by: Harini Katakam --- lib/sw_services/xilffs/src/diskio.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/sw_services/xilffs/src/diskio.c b/lib/sw_services/xilffs/src/diskio.c index 43f67a89..d63e8cd9 100644 --- a/lib/sw_services/xilffs/src/diskio.c +++ b/lib/sw_services/xilffs/src/diskio.c @@ -73,6 +73,7 @@ * Updated the FatFs to R0.10b * Removed alignment for local buffers as CacheInvalidate * will take care of it. +* sg 03/03/15 Added card detection check logic * * * @@ -211,6 +212,18 @@ DSTATUS disk_initialize ( XSdPs_Config *SdConfig; + /* + * Card detection check + * If the HC detects the No Card State, power will be cleared + */ + while(!((XSDPS_PSR_CARD_DPL_MASK | + XSDPS_PSR_CARD_STABLE_MASK | + XSDPS_PSR_CARD_INSRT_MASK) == + ( XSdPs_GetPresentStatusReg((u32)XPAR_XSDPS_0_BASEADDR) & + (XSDPS_PSR_CARD_DPL_MASK | + XSDPS_PSR_CARD_STABLE_MASK | + XSDPS_PSR_CARD_INSRT_MASK)))); + /* * Check if card is in the socket */