Skip to contentSkip to conversation

disk: support host devices in dev_print()

PATCH New Stephen Warren 2 participants 14 messages Oct 2, 2015 – May 17, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/10 disk: support host devices in dev_print()

Add a case statement for IF_TYPE_HOST in dev_print() so that it prints the device type rather than the "device type unknown" message.

---
 disk/part.c | 3 +++
 1 file changed, 3 insertions(+)
disk/part.c +3 -0
index 43485c9148b0..4e72257434b6 100644
@@ -179,6 +179,9 @@ void dev_print (block_dev_desc_t *dev_desc)
 	case IF_TYPE_DOC:
 		puts("device type DOC\n");
 		return;
+	case IF_TYPE_HOST:
+		puts("host device\n");
+		break;
 	case IF_TYPE_UNKNOWN:
 		puts("device type unknown\n");
 		return;
Signature · 1 line
1.9.1
#1 lore raw

PATCH v3 2/10 fat: move to a different directory

A future patch will add a new implementation of the FAT filesystem in fat/. Move the old version to fat_orig/ so that the patches which add the new implementation can add it directly in the final location.

---
 fs/Kconfig                       | 2 +-
 fs/Makefile                      | 4 ++--
 fs/{fat => fat_orig}/Kconfig     | 0
 fs/{fat => fat_orig}/Makefile    | 0
 fs/{fat => fat_orig}/fat.c       | 0
 fs/{fat => fat_orig}/fat_write.c | 0
 fs/{fat => fat_orig}/file.c      | 0
 7 files changed, 3 insertions(+), 3 deletions(-)
 rename fs/{fat => fat_orig}/Kconfig (100%)
 rename fs/{fat => fat_orig}/Makefile (100%)
 rename fs/{fat => fat_orig}/fat.c (100%)
 rename fs/{fat => fat_orig}/fat_write.c (100%)
 rename fs/{fat => fat_orig}/file.c (100%)
fs/Kconfig +1 -1
index 41bb0b9f3a47..6017a0136012 100644
@@ -8,7 +8,7 @@ source "fs/ext4/Kconfig"
 
 source "fs/reiserfs/Kconfig"
 
-source "fs/fat/Kconfig"
+source "fs/fat_orig/Kconfig"
 
 source "fs/jffs2/Kconfig"
 
fs/Makefile +2 -2
index 51d06fccb61e..1614650fb6fe 100644
@@ -7,7 +7,7 @@
 #
 
 ifdef CONFIG_SPL_BUILD
-obj-$(CONFIG_SPL_FAT_SUPPORT) += fat/
+obj-$(CONFIG_SPL_FAT_SUPPORT) += fat_orig/
 obj-$(CONFIG_SPL_EXT_SUPPORT) += ext4/
 else
 obj-y				+= fs.o
@@ -15,7 +15,7 @@ obj-y				+= fs.o
 obj-$(CONFIG_CMD_CBFS) += cbfs/
 obj-$(CONFIG_CMD_CRAMFS) += cramfs/
 obj-$(CONFIG_FS_EXT4) += ext4/
-obj-y += fat/
+obj-y += fat_orig/
 obj-$(CONFIG_CMD_JFFS2) += jffs2/
 obj-$(CONFIG_CMD_REISER) += reiserfs/
 obj-$(CONFIG_SANDBOX) += sandbox/
fs/fat_orig/Kconfig renamed from fs/fat/Kconfig +0 -0
similarity index 100%
rename from fs/fat/Kconfig
rename to fs/fat_orig/Kconfig
fs/fat_orig/Makefile renamed from fs/fat/Makefile +0 -0
similarity index 100%
rename from fs/fat/Makefile
rename to fs/fat_orig/Makefile
fs/fat_orig/fat.c renamed from fs/fat/fat.c +0 -0
similarity index 100%
rename from fs/fat/fat.c
rename to fs/fat_orig/fat.c
fs/fat_orig/fat_write.c renamed from fs/fat/fat_write.c +0 -0
similarity index 100%
rename from fs/fat/fat_write.c
rename to fs/fat_orig/fat_write.c
fs/fat_orig/file.c renamed from fs/fat/file.c +0 -0
similarity index 100%
rename from fs/fat/file.c
rename to fs/fat_orig/file.c
Signature · 1 line
1.9.1
#2 lore raw

PATCH v3 3/10 fat: add ff.c implementation

In reply to Stephen Warren

These files come from http://elm-chan.org/fsw/ff/ff11a.zip downloaded on 20150929. This is linked from http://elm-chan.org/fsw/ff/00index_e.html.
This commit adds unmodified versions of these files, except that dos2unix has been executed on them all.

---
v3: Import v0.11a rather than v0.11. This includes an upstream patch that I'd previously applied separately, so that patch is dropped from v3 too.

---
 fs/fat/diskio.h  |   80 +
 fs/fat/ff.c      | 4677 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 fs/fat/ff.h      |  350 ++++
 fs/fat/ffconf.h  |  276 ++++
 fs/fat/integer.h |   33 +
 5 files changed, 5416 insertions(+)
 create mode 100644 fs/fat/diskio.h
 create mode 100644 fs/fat/ff.c
 create mode 100644 fs/fat/ff.h
 create mode 100644 fs/fat/ffconf.h
 create mode 100644 fs/fat/integer.h
fs/fat/diskio.h new file +80 -0
new file mode 100644
index 000000000000..9ca0c7e10689
@@ -0,0 +1,80 @@
+/*-----------------------------------------------------------------------/
+/  Low level disk interface modlue include file   (C)ChaN, 2014          /
+/-----------------------------------------------------------------------*/
+
+#ifndef _DISKIO_DEFINED
+#define _DISKIO_DEFINED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define _USE_WRITE	1	/* 1: Enable disk_write function */
+#define _USE_IOCTL	1	/* 1: Enable disk_ioctl fucntion */
+
+#include "integer.h"
+
+
+/* Status of Disk Functions */
+typedef BYTE	DSTATUS;
+
+/* Results of Disk Functions */
+typedef enum {
+	RES_OK = 0,		/* 0: Successful */
+	RES_ERROR,		/* 1: R/W Error */
+	RES_WRPRT,		/* 2: Write Protected */
+	RES_NOTRDY,		/* 3: Not Ready */
+	RES_PARERR		/* 4: Invalid Parameter */
+} DRESULT;
+
+
+/*---------------------------------------*/
+/* Prototypes for disk control functions */
+
+
+DSTATUS disk_initialize (BYTE pdrv);
+DSTATUS disk_status (BYTE pdrv);
+DRESULT disk_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count);
+DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count);
+DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
+
+
+/* Disk Status Bits (DSTATUS) */
+
+#define STA_NOINIT		0x01	/* Drive not initialized */
+#define STA_NODISK		0x02	/* No medium in the drive */
+#define STA_PROTECT		0x04	/* Write protected */
+
+
+/* Command code for disk_ioctrl fucntion */
+
+/* Generic command (Used by FatFs) */
+#define CTRL_SYNC			0	/* Complete pending write process (needed at _FS_READONLY == 0) */
+#define GET_SECTOR_COUNT	1	/* Get media size (needed at _USE_MKFS == 1) */
+#define GET_SECTOR_SIZE		2	/* Get sector size (needed at _MAX_SS != _MIN_SS) */
+#define GET_BLOCK_SIZE		3	/* Get erase block size (needed at _USE_MKFS == 1) */
+#define CTRL_TRIM			4	/* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */
+
+/* Generic command (Not used by FatFs) */
+#define CTRL_POWER			5	/* Get/Set power status */
+#define CTRL_LOCK			6	/* Lock/Unlock media removal */
+#define CTRL_EJECT			7	/* Eject media */
+#define CTRL_FORMAT			8	/* Create physical format on the media */
+
+/* MMC/SDC specific ioctl command */
+#define MMC_GET_TYPE		10	/* Get card type */
+#define MMC_GET_CSD			11	/* Get CSD */
+#define MMC_GET_CID			12	/* Get CID */
+#define MMC_GET_OCR			13	/* Get OCR */
+#define MMC_GET_SDSTAT		14	/* Get SD status */
+
+/* ATA/CF specific ioctl command */
+#define ATA_GET_REV			20	/* Get F/W revision */
+#define ATA_GET_MODEL		21	/* Get model name */
+#define ATA_GET_SN			22	/* Get serial number */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
fs/fat/ff.c new file +4677 -0

2,920 lines not on this page · raw message

fs/fat/ff.h new file +350 -0

350 lines not on this page · raw message

fs/fat/ffconf.h new file +276 -0

276 lines not on this page · raw message

fs/fat/integer.h new file +33 -0
new file mode 100644
index 000000000000..ef49fdd63423

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.9.1

Part of the diff is not shown here. View the raw message.

#3 lore raw

PATCH v3 4/10 fat: ff: add ifdef to avoid unused function warning

In reply to Stephen Warren

Without this, any board that doesn't enable read-write FAT triggers:
fs/fat/ff.c:1331:6: warning: ?gen_numname? defined but not used [-Wunused-function]

... since gen_numname() is not referenced from dir_register() is ifdef'd out.

---
v2: New patch.

---
 fs/fat/ff.c | 2 ++
 1 file changed, 2 insertions(+)
fs/fat/ff.c +2 -0
index 345c174155d1..478daa7d6b0b 100644
@@ -1374,6 +1374,7 @@ void fit_lfn (
 /*-----------------------------------------------------------------------*/
 /* Create numbered name                                                  */
 /*-----------------------------------------------------------------------*/
+#if !_FS_READONLY
 #if _USE_LFN
 static
 void gen_numname (
@@ -1426,6 +1427,7 @@ void gen_numname (
 	} while (j < 8);
 }
 #endif
+#endif
 
 
 
Signature · 1 line
1.9.1
#4 lore raw

PATCH v3 5/10 fat: ff: read max contiguous file data

In reply to Stephen Warren

Enhance f_read() to find the maximum contiguous set of clusters to read, and read it all at once (which is fast) rather one by one (which is slow).

---
V3: New patch.

---
 fs/fat/ff.c | 45 ++++++++++++++++++++++++++++++++-------------
 1 file changed, 32 insertions(+), 13 deletions(-)
fs/fat/ff.c +32 -13
index 478daa7d6b0b..0df5a9ddcf7c 100644
@@ -2593,7 +2593,7 @@ FRESULT f_read (
 )
 {
 	FRESULT res;
-	DWORD clst, sect, remain;
+	DWORD clst, sect, remain, cfptr, cclst, maxclust;
 	UINT rcnt, cc;
 	BYTE csect, *rbuff = (BYTE*)buff;
 
@@ -2614,27 +2614,46 @@ FRESULT f_read (
 		if ((fp->fptr % SS(fp->fs)) == 0) {		/* On the sector boundary? */
 			csect = (BYTE)(fp->fptr / SS(fp->fs) & (fp->fs->csize - 1));	/* Sector offset in the cluster */
 			if (!csect) {						/* On the cluster boundary? */
-				if (fp->fptr == 0) {			/* On the top of the file? */
-					clst = fp->sclust;			/* Follow from the origin */
-				} else {						/* Middle or end of the file */
+				maxclust = 0;
+				cfptr = fp->fptr;
+				cclst = fp->clust;
+				for (;;) {
+					if (cfptr == 0) {			/* On the top of the file? */
+						clst = fp->sclust;			/* Follow from the origin */
+					} else {						/* Middle or end of the file */
 #if _USE_FASTSEEK
-					if (fp->cltbl)
-						clst = clmt_clust(fp, fp->fptr);	/* Get cluster# from the CLMT */
-					else
+						if (fp->cltbl)
+							clst = clmt_clust(fp, cfptr);	/* Get cluster# from the CLMT */
+						else
 #endif
-						clst = get_fat(fp->fs, fp->clust);	/* Follow cluster chain on the FAT */
+							clst = get_fat(fp->fs, cclst);	/* Follow cluster chain on the FAT */
+					}
+					if (clst < 2) ABORT(fp->fs, FR_INT_ERR);
+					if (clst == 0xFFFFFFFF) ABORT(fp->fs, FR_DISK_ERR);
+					if (!maxclust) {
+						fp->clust = clst;				/* Update current cluster */
+					} else {
+						if (clst != (cclst + 1))
+							break;
+					}
+					maxclust++;
+					if ((maxclust * fp->fs->csize * SS(fp->fs)) >= btr)
+						break;
+					cclst = clst;
+					cfptr += fp->fs->csize * SS(fp->fs);
 				}
-				if (clst < 2) ABORT(fp->fs, FR_INT_ERR);
-				if (clst == 0xFFFFFFFF) ABORT(fp->fs, FR_DISK_ERR);
-				fp->clust = clst;				/* Update current cluster */
+			} else {
+				maxclust = 1;
 			}
 			sect = clust2sect(fp->fs, fp->clust);	/* Get current sector */
+			if (maxclust > 1)
+				fp->clust += (maxclust - 1);
 			if (!sect) ABORT(fp->fs, FR_INT_ERR);
 			sect += csect;
 			cc = btr / SS(fp->fs);				/* When remaining bytes >= sector size, */
 			if (cc) {							/* Read maximum contiguous sectors directly */
-				if (csect + cc > fp->fs->csize)	/* Clip at cluster boundary */
-					cc = fp->fs->csize - csect;
+				if (csect + cc > (fp->fs->csize * maxclust))	/* Clip at cluster boundary */
+					cc = (fp->fs->csize * maxclust) - csect;
 				if (disk_read(fp->fs->drv, rbuff, sect, cc) != RES_OK)
 					ABORT(fp->fs, FR_DISK_ERR);
 #if !_FS_READONLY && _FS_MINIMIZE <= 2			/* Replace one of the read sectors with cached data if it contains a dirty sector */
Signature · 1 line
1.9.1
#5 lore raw

PATCH v3 5/10 fat: ff: read max contiguous file data

Quoted 3 lines · Stephen Warren

Enhance f_read() to find the maximum contiguous set of clusters to read, and read it all at once (which is fast) rather one by one (which is slow).

Hmm. I had hoped that the author of ff.c would accept this patch upstream, so we could pick up a later upstream version that included this patch. However, it seems the author of ff.c has a policy of not accepting outside contributions:

http://elm-chan.org/fsw/ff/bd/?show=2472
(That's a link to the author's reply to my patch, on the forum system associated with his/her SW)

I wonder how much of a liability incorporating ff.c into U-Boot will be, if we can't ever get any fixes merged upstream. Perhaps we just fork it, although I had hoped we'd be able to keep picking up new versions.

#6 lore raw

PATCH v3 5/10 fat: ff: read max contiguous file data

Quoted 5 lines · Stephen Warren
Quoted 3 lines · Stephen Warren

Enhance f_read() to find the maximum contiguous set of clusters to read, and read it all at once (which is fast) rather one by one (which is slow).

Quoted 8 lines

Hmm. I had hoped that the author of ff.c would accept this patch upstream, so we could pick up a later upstream version that included this patch. However, it seems the author of ff.c has a policy of not accepting outside contributions:

http://elm-chan.org/fsw/ff/bd/?show=2472
(That's a link to the author's reply to my patch, on the forum system associated with his/her SW)

The bit about the license is at
http://elm-chan.org/fsw/ff/en/appnote.html#license

Quoted 4 lines

I wonder how much of a liability incorporating ff.c into U-Boot will be, if we can't ever get any fixes merged upstream. Perhaps we just fork it, although I had hoped we'd be able to keep picking up new versions.

Arg, that really does take away one of the potential nice features. I guess, sadly, at this point I'd rather stick with the version we have unless you want to deal with re-syncing their releases but still effectively doing a fork (so that we can also make use of caches which I think you said before you thought might be part of the performance problem.

Or we take a look at borrowing the kernel's code, similar to how we leverage UBIFS today.

Regardless, thanks for the time you've already put in on this!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151020/8ecda3e0/attachment.sig>
#7 lore raw

PATCH v3 5/10 fat: ff: read max contiguous file data

Quoted 23 lines · Tom Rini
Quoted 5 lines · Stephen Warren
Quoted 3 lines · Stephen Warren

Enhance f_read() to find the maximum contiguous set of clusters to read, and read it all at once (which is fast) rather one by one (which is slow).

Quoted 8 lines

Hmm. I had hoped that the author of ff.c would accept this patch upstream, so we could pick up a later upstream version that included this patch. However, it seems the author of ff.c has a policy of not accepting outside contributions:

http://elm-chan.org/fsw/ff/bd/?show=2472
(That's a link to the author's reply to my patch, on the forum system associated with his/her SW)

The bit about the license is at
http://elm-chan.org/fsw/ff/en/appnote.html#license

Quoted 4 lines

I wonder how much of a liability incorporating ff.c into U-Boot will be, if we can't ever get any fixes merged upstream. Perhaps we just fork it, although I had hoped we'd be able to keep picking up new versions.

Quoted 6 lines

Arg, that really does take away one of the potential nice features. I guess, sadly, at this point I'd rather stick with the version we have unless you want to deal with re-syncing their releases but still effectively doing a fork (so that we can also make use of caches which I think you said before you thought might be part of the performance problem.

FWIW, the caching (of FAT bitmap, not CPU memory) turned out not to be an issue at all; it was just my wild conjecture before I'd investigated the read performance issues.

#8 lore raw

PATCH v3 5/10 fat: ff: read max contiguous file data

In reply to Tom Rini
Quoted 30 lines · Tom Rini
Quoted 5 lines · Stephen Warren
Quoted 3 lines · Stephen Warren

Enhance f_read() to find the maximum contiguous set of clusters to read, and read it all at once (which is fast) rather one by one (which is slow).

Quoted 8 lines

Hmm. I had hoped that the author of ff.c would accept this patch upstream, so we could pick up a later upstream version that included this patch. However, it seems the author of ff.c has a policy of not accepting outside contributions:

http://elm-chan.org/fsw/ff/bd/?show=2472
(That's a link to the author's reply to my patch, on the forum system associated with his/her SW)

The bit about the license is at
http://elm-chan.org/fsw/ff/en/appnote.html#license

Quoted 4 lines

I wonder how much of a liability incorporating ff.c into U-Boot will be, if we can't ever get any fixes merged upstream. Perhaps we just fork it, although I had hoped we'd be able to keep picking up new versions.

Arg, that really does take away one of the potential nice features. I guess, sadly, at this point I'd rather stick with the version we have unless you want to deal with re-syncing their releases but still effectively doing a fork (so that we can also make use of caches which I think you said before you thought might be part of the performance problem.

Quoted 4 lines

Or we take a look at borrowing the kernel's code, similar to how we leverage UBIFS today.

Regardless, thanks for the time you've already put in on this!

If anyone is still interested in replacing the FAT code, I just noticed that FreeRTOS has been relicensed to MIT along with some/all of its extensions, including the FAT code:

https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_FAT/index.html

I'd assume that code is reasonably well maintained and embedded-suitable. I have not investigated:

- If it has the same "no contributions" issue that FF had.
- If it's modular enough to plug into other hosts besides FreeRTOS.
- What its performance is like.

#9 lore raw

PATCH v3 6/10 fat: ffconf.h changes for U-Boot port

In reply to Stephen Warren

Turn on _FS_NORTC: This means we don't have to implement get_fattime() which simplifies life for now.

Automatically set _FS_READONLY based on CONFIG_FAT_WRITE. This requires including <config.h> since we reference CONFIG_*.

Set _USE_LFN to enable long filename handling; an essential feature.

Set _FS_RPATH so that paths components "." and ".." are correctly parsed and handled. This enables paths such as "/extlinux/../foo" to work.

Set _USE_LABEL so that volume labels can be read.

---
 fs/fat/ffconf.h | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
fs/fat/ffconf.h +10 -4
index f4e8e8b1c6d9..34209e0ca13c 100644
@@ -1,3 +1,5 @@
+#include <config.h>
+
 /*---------------------------------------------------------------------------/
 /  FatFs - FAT file system module configuration file  R0.11a (C)ChaN, 2015
 /---------------------------------------------------------------------------*/
@@ -8,7 +10,11 @@
 / Function Configurations
 /---------------------------------------------------------------------------*/
 
+#ifdef CONFIG_FAT_WRITE
 #define _FS_READONLY	0
+#else
+#define _FS_READONLY	1
+#endif
 /* This option switches read-only configuration. (0:Read/Write or 1:Read-only)
 /  Read-only configuration removes writing API functions, f_write(), f_sync(),
 /  f_unlink(), f_mkdir(), f_chmod(), f_rename(), f_truncate(), f_getfree()
@@ -47,7 +53,7 @@
 /* This option switches fast seek feature. (0:Disable or 1:Enable) */
 
 
-#define _USE_LABEL		0
+#define _USE_LABEL		1
 /* This option switches volume label functions, f_getlabel() and f_setlabel().
 /  (0:Disable or 1:Enable) */
 
@@ -90,7 +96,7 @@
 */
 
 
-#define	_USE_LFN	0
+#define	_USE_LFN	1
 #define	_MAX_LFN	255
 /* The _USE_LFN option switches the LFN feature.
 /
@@ -124,7 +130,7 @@
 /  When _LFN_UNICODE is 0, this option has no effect. */
 
 
-#define _FS_RPATH	0
+#define _FS_RPATH	1
 /* This option configures relative path feature.
 /
 /   0: Disable relative path feature and remove related functions.
@@ -200,7 +206,7 @@
 /  data transfer. */
 
 
-#define _FS_NORTC	0
+#define _FS_NORTC	1
 #define _NORTC_MON	1
 #define _NORTC_MDAY	1
 #define _NORTC_YEAR	2015
Signature · 1 line
1.9.1
#10 lore raw

PATCH v3 7/10 fat: port integer.h to U-Boot types

In reply to Stephen Warren

ff.c uses a bunch of custom typedefs. Define these in terms of standard types from <linux/types.h>, so they'll automatically be the correct size for any build of U-Boot.

---
v2: Make INT and UINT 32-bit types e.g. so that f_read() can read (or at the least, report reading) more than 64KiB-1 bytes. Now, ./test/fs/fs-test.sh passes.

---
 fs/fat/integer.h | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
fs/fat/integer.h +10 -8
index ef49fdd63423..019b68101122 100644
@@ -5,6 +5,8 @@
 #ifndef _FF_INTEGER
 #define _FF_INTEGER
 
+#include <linux/types.h>
+
 #ifdef _WIN32	/* Development platform */
 
 #include <windows.h>
@@ -13,20 +15,20 @@
 #else			/* Embedded platform */
 
 /* This type MUST be 8-bit */
-typedef unsigned char	BYTE;
+typedef uint8_t		BYTE;
 
 /* These types MUST be 16-bit */
-typedef short			SHORT;
-typedef unsigned short	WORD;
-typedef unsigned short	WCHAR;
+typedef int16_t		SHORT;
+typedef uint16_t	WORD;
+typedef uint16_t	WCHAR;
 
 /* These types MUST be 16-bit or 32-bit */
-typedef int				INT;
-typedef unsigned int	UINT;
+typedef int32_t		INT;
+typedef uint32_t	UINT;
 
 /* These types MUST be 32-bit */
-typedef long			LONG;
-typedef unsigned long	DWORD;
+typedef int32_t		LONG;
+typedef uint32_t	DWORD;
 
 #endif
 
Signature · 1 line
1.9.1
#11 lore raw

PATCH v3 8/10 fat: add U-Boot to ff.c API conversion wrapper

In reply to Stephen Warren

Add a file that converts all the FAT-related APIs used by U-Boot into ff.c calls. This allows ff.c to provide the FAT implementation for U-Boot.

---
v3:
* Fix writes to truncate the file to the written length.
* Add error cleanup (e.g. fclose()) to a number of functions. v2:
* Implement fat_register_device(), file_fat_read() for SPL FAT usage.
* Use _MAX_LFN to define size of lfname[] in file_fat_ls().

---
 fs/fat/Kconfig    |   0
 fs/fat/Makefile   |   7 +
 fs/fat/ff-uboot.c | 421 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 428 insertions(+)
 create mode 100644 fs/fat/Kconfig
 create mode 100644 fs/fat/Makefile
 create mode 100644 fs/fat/ff-uboot.c
fs/fat/Kconfig new file +0 -0
new file mode 100644
index 000000000000..e69de29bb2d1
fs/fat/Makefile new file +7 -0
new file mode 100644
index 000000000000..c527fc2bb401
@@ -0,0 +1,7 @@
+#
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-$(CONFIG_FS_FAT)	+= ff.o
+obj-$(CONFIG_FS_FAT)	+= ff-uboot.o
fs/fat/ff-uboot.c new file +421 -0

421 lines not on this page · raw message

Signature · 1 line
1.9.1
#12 lore raw

PATCH v3 9/10 fat: switch to new FAT implementation

In reply to Stephen Warren

Modify the U-Boot build system to build the new FAT implementation in fs/fat/ rather than the old implementation in fs/fat_orig/.

---
 fs/Kconfig  | 2 +-
 fs/Makefile | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
fs/Kconfig +1 -1
index 6017a0136012..41bb0b9f3a47 100644
@@ -8,7 +8,7 @@ source "fs/ext4/Kconfig"
 
 source "fs/reiserfs/Kconfig"
 
-source "fs/fat_orig/Kconfig"
+source "fs/fat/Kconfig"
 
 source "fs/jffs2/Kconfig"
 
fs/Makefile +2 -2
index 1614650fb6fe..51d06fccb61e 100644
@@ -7,7 +7,7 @@
 #
 
 ifdef CONFIG_SPL_BUILD
-obj-$(CONFIG_SPL_FAT_SUPPORT) += fat_orig/
+obj-$(CONFIG_SPL_FAT_SUPPORT) += fat/
 obj-$(CONFIG_SPL_EXT_SUPPORT) += ext4/
 else
 obj-y				+= fs.o
@@ -15,7 +15,7 @@ obj-y				+= fs.o
 obj-$(CONFIG_CMD_CBFS) += cbfs/
 obj-$(CONFIG_CMD_CRAMFS) += cramfs/
 obj-$(CONFIG_FS_EXT4) += ext4/
-obj-y += fat_orig/
+obj-y += fat/
 obj-$(CONFIG_CMD_JFFS2) += jffs2/
 obj-$(CONFIG_CMD_REISER) += reiserfs/
 obj-$(CONFIG_SANDBOX) += sandbox/
Signature · 1 line
1.9.1
#13 lore raw

PATCH v3 10/10 fat: remove old implementation

In reply to Stephen Warren

Now that we've switched to the new FAT filesystem implementation, delete the old implementation.

---
 fs/fat_orig/Kconfig     |    0
 fs/fat_orig/Makefile    |   11 -
 fs/fat_orig/fat.c       | 1360 -----------------------------------------------
 fs/fat_orig/fat_write.c | 1122 --------------------------------------
 fs/fat_orig/file.c      |  183 -------
 5 files changed, 2676 deletions(-)
 delete mode 100644 fs/fat_orig/Kconfig
 delete mode 100644 fs/fat_orig/Makefile
 delete mode 100644 fs/fat_orig/fat.c
 delete mode 100644 fs/fat_orig/fat_write.c
 delete mode 100644 fs/fat_orig/file.c
fs/fat_orig/Kconfig deleted +0 -0
deleted file mode 100644
index e69de29bb2d1..000000000000
fs/fat_orig/Makefile deleted +0 -11
deleted file mode 100644
index b60e8486c48d..000000000000
@@ -1,11 +0,0 @@
-#
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-obj-$(CONFIG_FS_FAT)	:= fat.o
-obj-$(CONFIG_FAT_WRITE):= fat_write.o
-
-ifndef CONFIG_SPL_BUILD
-obj-$(CONFIG_FS_FAT)	+= file.o
-endif
fs/fat_orig/fat.c deleted +0 -1360

1,360 lines not on this page · raw message

fs/fat_orig/fat_write.c deleted +0 -1122

1,122 lines not on this page · raw message

fs/fat_orig/file.c deleted +0 -183

183 lines not on this page · raw message

Signature · 1 line
1.9.1