From: Siva Durga Prasad Paladugu Date: Fri, 14 Mar 2014 11:05:39 +0000 (+0530) Subject: fs: zynq: Added FAT support for zynq u-boot on OCM X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5cc5bc475a4857e0b3a97ff195105981954441c0;p=thirdparty%2Fu-boot.git fs: zynq: Added FAT support for zynq u-boot on OCM Modified the buffers and its sizes inorder to support SD/MMC fat read capability for u-bbot running from OCM Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 569d6e3ae7f..6ed4dfef79d 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -319,11 +319,15 @@ get_cluster(fsdata *mydata, __u32 clustnum, __u8 *buffer, unsigned long size) * into 'buffer'. * Return the number of bytes read or -1 on fatal errors. */ +#ifndef CONFIG_ZYNQ_OCM #if defined(CONFIG_ZYNQ) && defined(CONFIG_SPL_BUILD) __section(.ddr) #endif __u8 get_contents_vfatname_block[MAX_CLUSTSIZE] __aligned(ARCH_DMA_MINALIGN); +#else +__u8 *get_contents_vfatname_block = (__u8 *)FAT_BUFF_PTR_OCM; +#endif static long get_contents(fsdata *mydata, dir_entry *dentptr, unsigned long pos, @@ -574,11 +578,13 @@ static __u8 mkcksum(const char name[8], const char ext[3]) * Get the directory entry associated with 'filename' from the directory * starting at 'startsect' */ +#ifndef CONFIG_ZYNQ_OCM #if defined(CONFIG_ZYNQ) && defined(CONFIG_SPL_BUILD) __section(.ddr) #endif __u8 get_dentfromdir_block[MAX_CLUSTSIZE] __aligned(ARCH_DMA_MINALIGN); +#endif static dir_entry *get_dentfromdir(fsdata *mydata, int startsect, char *filename, dir_entry *retdent, @@ -587,6 +593,10 @@ static dir_entry *get_dentfromdir(fsdata *mydata, int startsect, __u16 prevcksum = 0xffff; __u32 curclust = START(retdent); int files = 0, dirs = 0; +#ifdef CONFIG_ZYNQ_OCM + __u8 get_dentfromdir_block[MAX_CLUSTSIZE] + __aligned(ARCH_DMA_MINALIGN); +#endif debug("get_dentfromdir: %s\n", filename); @@ -809,11 +819,13 @@ exit: return ret; } +#ifndef CONFIG_ZYNQ_OCM #if defined(CONFIG_ZYNQ) && defined(CONFIG_SPL_BUILD) __section(.ddr) #endif __u8 do_fat_read_at_block[MAX_CLUSTSIZE] __aligned(ARCH_DMA_MINALIGN); +#endif long do_fat_read_at(const char *filename, unsigned long pos, void *buffer, @@ -835,6 +847,10 @@ do_fat_read_at(const char *filename, unsigned long pos, void *buffer, __u32 root_cluster = 0; int rootdir_size = 0; int j; +#ifdef CONFIG_ZYNQ_OCM + __u8 do_fat_read_at_block[MAX_CLUSTSIZE] + __aligned(ARCH_DMA_MINALIGN); +#endif if (read_bootsectandvi(&bs, &volinfo, &mydata->fatsize)) { debug("Error: reading boot sector\n");