xilffs : Use data cache
Change xilffs library to support data cache. Dont disable data cache in the example. Signed-off-by: Harini Katakam <harinik@xilinx.com> Acked-by: Anirudha Sarangi <anirudh@xilinx.com>
This commit is contained in:
parent
c7905e97cb
commit
831df57b90
3 changed files with 24 additions and 4 deletions
|
@ -48,6 +48,7 @@
|
|||
* Ver Who Date Changes
|
||||
* ----- --- -------- -----------------------------------------------
|
||||
* 1.00a hk 10/17/13 First release
|
||||
* 2.2 hk 07/28/14 Make changes to enable use of data cache.
|
||||
*
|
||||
*</pre>
|
||||
*
|
||||
|
@ -76,8 +77,17 @@ static FIL fil; /* File object */
|
|||
static FATFS fatfs;
|
||||
static char FileName[32] = "Test.bin";
|
||||
static char *SD_File;
|
||||
|
||||
#ifdef __ICCARM__
|
||||
#pragma data_alignment = 32
|
||||
u8 DestinationAddress[10*1024*1024];
|
||||
u8 SourceAddress[10*1024*1024];
|
||||
#pragma data_alignment = 4
|
||||
#else
|
||||
u8 DestinationAddress[10*1024*1024] __attribute__ ((aligned(32)));
|
||||
u8 SourceAddress[10*1024*1024] __attribute__ ((aligned(32)));
|
||||
#endif
|
||||
|
||||
#define TEST 7
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -133,9 +143,6 @@ int FfsSdPolledExample(void)
|
|||
u32 BuffCnt;
|
||||
u32 FileSize = (8*1024*1024);
|
||||
|
||||
Xil_DCacheFlush();
|
||||
Xil_DCacheDisable();
|
||||
|
||||
for(BuffCnt = 0; BuffCnt < FileSize; BuffCnt++){
|
||||
SourceAddress[BuffCnt] = TEST + BuffCnt;
|
||||
}
|
||||
|
|
|
@ -64,6 +64,7 @@
|
|||
* 2.1 hk 04/16/14 Move check for ExtCSD high speed bit set inside if
|
||||
* condition for high speed support.
|
||||
* Include xil_types.h irrespective of xsdps.h. CR# 797086.
|
||||
* 2.2 hk 07/28/14 Make changes to enable use of data cache.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -297,7 +297,13 @@ typedef struct {
|
|||
DWORD dirbase; /* Root directory start sector (FAT32:Cluster#) */
|
||||
DWORD database; /* Data start sector */
|
||||
DWORD winsect; /* Current sector appearing in the win[] */
|
||||
BYTE win[_MAX_SS]; /* Disk access window for Directory, FAT (and Data on tiny cfg) */
|
||||
#ifdef __ICCARM__
|
||||
#pragma data_alignment = 32
|
||||
BYTE win[_MAX_SS];
|
||||
#pragma data_alignment = 4
|
||||
#else
|
||||
BYTE win[_MAX_SS] __attribute__ ((aligned(32))); /* Disk access window for Directory, FAT (and Data on tiny cfg) */
|
||||
#endif
|
||||
} FATFS;
|
||||
|
||||
|
||||
|
@ -325,7 +331,13 @@ typedef struct {
|
|||
UINT lockid; /* File lock ID (index of file semaphore table) */
|
||||
#endif
|
||||
#if !_FS_TINY
|
||||
#ifdef __ICCARM__
|
||||
#pragma data_alignment = 32
|
||||
BYTE buf[_MAX_SS]; /* File data read/write buffer */
|
||||
#pragma data_alignment = 4
|
||||
#else
|
||||
BYTE buf[_MAX_SS] __attribute__ ((aligned(32))); /* File data read/write buffer */
|
||||
#endif
|
||||
#endif
|
||||
} FIL;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue