summaryrefslogtreecommitdiff
path: root/fs
AgeCommit message (Collapse)Author
2011-05-19Fix for SnowballTony MÃ¥nsson
2010-09-29Fix mmc_read_cmd_fileMikael Larsson
mmc_read_cmd_file broke with the latest changes in fat and mmc. This makes it work again. Change-Id: I9bd0fee41bc4dfe790166415bb856104ab412536 Signed-off-by: Mikael Larsson <mikael.xt.larsson@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/5765 Reviewed-by: Ulf HANSSON <ulf.hansson@stericsson.com> Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com>
2010-08-30Read/write VFAT support from Rockbox-3.3 FAT stackMichael Brandt
Add read/write VFAT support from Rockbox-3.3 FAT stack. It should be also applicable to the unmodified 2009.11 U-Boot release. Note that is was taken as is from Rockbox and from a older U-Boot Rockbox patch. "checkpatch" shows very many coding style errors and warnings, but it is tedious work to clean this up. To make this patch work an additional mmc_block_write() board support routine and the errno variable are needed. Furthermore following defines in the board config header file: #define CONFIG_ROCKBOX_FAT 1 #define CONFIG_U_BOOT 1 #define CONFIG_SUPPORT_VFAT 1 #define CONFIG_CMD_TREE_FAT This will be added in a follow-up patch. This patch is based on the patch from Etienne Carriere <etienne.carriere@stericsson.com> for the U671x U-Boot: This commit adds FAT write support to u-boot native read-only FAT code. Commit initially applied on u-boot-v2009.01 (SHA1: 72d15e705bc3983884105cb7755c7ba80e74a0a5) Based on FAT stack dumped from Rockbox package v3.1 (www.rockbox.org). Based on initial Rockbox FAT stack integration in u-boot by Keith Outwater (outwater@comcast.net). Current porting is aligned with Rockbox v3.3 FAT stack. Enable upon config switches: CONFIG_CMD_FAT CONFIG_ROCKBOX_FAT CONFIG_CMD_TREE_FAT (recommended) CONFIG_SUPPORT_VFAT (recommended) C code APIs (from U-boot native FAT support): int fat_register_device(block_dev_desc_t *dev_desc, int part_no); long file_fat_read(const char *path, void *buf, unsigned long maxsize); int file_fat_ls(const char *dirname); int file_fat_detectfs(void); C code APIs (added by Rockbox FAT support): long file_fat_write(const char *path, void *buf, unsigned long maxsize); int file_fat_rm(const char *path); int file_fat_rmdir(const char *path); int file_fat_mkdir(const char *path); int file_fat_cd(const char *path); int file_fat_pwd(void); int file_fat_mv(const char *oldpath, const char *newpath); unsigned int rockbox_fat_free(unsigned long size_kbyte); unsigned int rockbox_fat_size(void); Use "help fat" from u-boot console to see available commands. ST-Ericsson ID: WP264488 Change-Id: I9afc29ecb80f9152bd8534bbf11e47e54cfad796 Signed-off-by: Michael Brandt <michael.brandt@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/3009
2010-08-23ext2fs: Fix optimization bug for doubly-indirect block pointersAaron Pace
Doubly-indirect block numbers are compared against the first-level indirect block when checking for a cached copy. This is causing the doubly-indirect block to be re-read each time it is accessed. Repairing this reduces load time for a 70M file from 72 seconds to 38 seconds. Change-Id: I497e1f063f0d596d95171e42d1c39dc2c6aedf38 Signed-off-by: Aaron Pace <Aaron.Pace@alcatel-lucent.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/3975 Tested-by: Michael BRANDT <michael.brandt@stericsson.com> Reviewed-by: Sebastian RASMUSSEN <sebastian.rasmussen@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com>
2009-12-21move prototypes for gunzip() and zunzip() to common.hWolfgang Wegner
Prototype for gunzip/zunzip was only in lib_generic/gunzip.c and thus repeated in every file using it. This patch moves the prototypes to common.h and removes all prototypes distributed anywhere else. Signed-off-by: Wolfgang Wegner <w.wegner@astro-kom.de>
2009-12-08common: delete CONFIG_SYS_64BIT_VSPRINTF and CONFIG_SYS_64BIT_STRTOULHeiko Schocher
There is more and more usage of printing 64bit values, so enable this feature generally, and delete the CONFIG_SYS_64BIT_VSPRINTF and CONFIG_SYS_64BIT_STRTOUL defines. Signed-off-by: Heiko Schocher <hs@denx.de>
2009-12-05EXT2FS: fix inode size for ext2fs rev#0Michael Brandt
extfs.c assumes that there is always a valid inode_size field in the superblock. But this is not true for ext2fs rev 0. Such ext2fs images are for instance generated by genext2fs. Symptoms on ARM machines are messages like: "raise: Signal # 8 caught"; on PowerPC "ext2ls" will print nothing. This fix checks for rev 0 and uses then 128 bytes as inode size. Signed-off-by: Michael Brandt <Michael.Brandt@emsyso.de> Tested on: TQM5200S Tested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-10-03Conditionally perform common relocation fixupsPeter Tyser
Add #ifdefs where necessary to not perform relocation fixups. This allows boards/architectures which support relocation to trim a decent chunk of code. Note that this patch doesn't add #ifdefs to architecture-specific code which does not support relocation. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-09-28ubifs: Correct dereferencing of files-after-symlinksSimon Kagstrom
Files in directories which are symlinked to were not dereferenced correctly in last commit. E.g., with a symlink /boot/lnk -> /boot/real_dir loading /boot/lnk/uImage will fail. This patch fixes that by simply seeing to it that the target base directory has a slash after it. Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Signed-off-by: Stefan Roese <sr@denx.de>
2009-09-23ubifs: Add support for looking up directory and relative symlinksSimon Kagstrom
This patch adds support for resolving symlinks to directories as well as relative symlinks. Symlinks are now always resolved during file lookup, so the load stage no longer needs to special-case them. Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Signed-off-by: Stefan Roese <sr@denx.de>
2009-09-15Move __set/clear_bit from ubifs.h to bitops.hSimon Kagstrom
__set_bit and __clear_bit are defined in ubifs.h as well as in asm/include/bitops.h for some architectures. This patch moves the generic implementation to include/linux/bitops.h and uses that unless it's defined by the architecture. Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
2009-08-21jffs2: some fixes to summary supportIlya Yanok
This patch fixes some issues with JFFS2 summary support in U-Boot. 1/ Summary support made compilation configurable (as summary support considered expiremental even in Linux). 2/ Summary code can do unaligned 16-bit and 32-bit memory accesses. We need to get data byte by byte to exclude data aborts. 3/ Make summary scan in two passes so we can safely fall back to full scan if we found unsupported entry in the summary. Signed-off-by: Ilya Yanok <yanok@emcraft.com>
2009-08-18jffs2: clean the cache in case of malloc fails in build_listsIlya Yanok
We should call jffs2_clean_cache() if we return from jffs2_build_lists() with an error to prevent usage of incomplete lists. Also we should free() a local buffer to prevent memory leaks. Signed-off-by: Ilya Yanok <yanok@emcraft.com>
2009-07-28ext2: fix inode size and calculationsWeirich, Bernhard
Signed-off-by: unsik Kim <donari75@gmail.com> Signed-off-by: Bernhard Weirich <bernhard.weirich@riedel.net> Signed-off-by: Wolfgang Denk <wd@denx.de> Tested-by: Wolfgang Denk <wd@denx.de>
2009-07-16Remove legacy NAND and disk on chip code.Scott Wood
Legacy NAND had been scheduled for removal. Any boards that use this were already not building in the previous release due to an #error. The disk on chip code in common/cmd_doc.c relies on legacy NAND, and it has also been removed. There is newer disk on chip code in drivers/mtd/nand; someone with access to hardware and sufficient time and motivation can try to get that working, but for now disk on chip is not supported. Signed-off-by: Scott Wood <scottwood@freescale.com>
2009-06-12FAT replace compare_sign with strncmp.Tom Rix
The static function compare_sign is only used to compare the fs_type string and does not do anything more than what strncmp does. The addition of the trailing '\0' to fs_type, while legal, is not needed because the it is never printed out and strncmp does not depend on NULL terminated strings. Signed-off-by: Tom Rix <Tom.Rix@windriver.com>
2009-06-09ubifs: fix small error path mismatchDaniel Mack
In do_readpage(), don't free 'dn' if its allocation failed. Signed-off-by: Daniel Mack <daniel@caiaq.de>
2009-04-30ubifs: BUG: Blocks commpressed with zlibRicardo Ribalda Delgado
Blocks compressed with zlib dont have the full gzip header. Without this patch, block compressed with zlib cannot be readed! Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
2009-04-28ubifs: BUG realpath string must be ended with NULLRicardo Ribalda Delgado
If the memory used to copy the link_make is "dirty" the string wont be ended with NULL, throwing out multiple memory bugs. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es> Acked-by: Stefan Roese <sr@denx.de>
2009-04-28UBIFS: Remove tnc_commit.c which is not used in the read-only versionStefan Roese
I missed removing this file while implementing the UBIFS support. It's not referenced at all, so let's remove it. Thanks to Artem Bityutskiy for spotting. Signed-off-by: Stefan Roese <sr@denx.de>
2009-04-28UBIFS: fix recovery bugAdrian Hunter
UBIFS did not recovery in a situation in which it could have. The relevant function assumed there could not be more nodes in an eraseblock after a corrupted node, but in fact the last (NAND) page written might contain anything. The correct approach is to check for empty space (0xFF bytes) from then on. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Stefan Roese <sr@denx.de>
2009-04-05Update CHANGELOG, coding style cleanup.Wolfgang Denk
2009-04-04UBIFS: add R/O compatibilityArtem Bityutskiy
Now UBIFS is supported by u-boot. If we ever decide to change the media format, then people will have to upgrade their u-boots to mount new format images. However, very often it is possible to preserve R/O forward-compatibility, even though the write forward-compatibility is not preserved. This patch introduces a new super-block field which stores the R/O compatibility version. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Acked-by: Adrian Hunter <Adrian.Hunter@nokia.com> Signed-off-by: Stefan Roese <sr@denx.de>
2009-04-04rename include/zlib.h to include/u-boot/zlib.hJean-Christophe PLAGNIOL-VILLARD
Some systems have zlib.h installed in /usr/include/. This isn't the desired file for u-boot code - we want the one in include/zlib.h. This rename will avoid the conflict. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-04-03mflash: Initial mflash supportunsik Kim
Mflash is fusion memory device mainly targeted consumer eletronic and mobile phone. Internally, it have nand flash and other hardware logics and supports some different operation (ATA, IO, XIP) modes. IO mode is custom mode for the host that doesn't have IDE interface. (Many mobile targeted SoC doesn't have IDE bus) This driver support mflash IO mode. Followings are brief descriptions about IO mode. 1. IO mode based on ATA protocol and uses some custom command. (read confirm, write confirm) 2. IO mode uses SRAM bus interface. Signed-off-by: unsik Kim <donari75@gmail.com>
2009-03-20UBIFS: Missing offset relocation for compressor 'none'Michael Lawnick
On systems where U-Boot is linked to another address than it really lays (e.g. backup image), calls via function pointers must be fixed with a '+= gd->reloc_off'. This was not done for none_compr in ubifs_compressors_init() what leads to system crash on ubifsmount command. Signed-off-by: Michael Lawnick <ml.lawnick@gmx.de> Acked-by: Stefan Roese <sr@denx.de>
2009-03-20UBIFS: Implement read-only UBIFS support in U-BootStefan Roese
The U-Boot UBIFS implementation is largely a direct copy from the current Linux version (2.6.29-rc6). As already done in the UBI version we have an "abstraction layer" to redefine or remove some OS calls (e.g. mutex_lock() ...). This makes it possible to use the original Linux code with very little changes. And by this we can better update to later Linux versions. I removed some of the Linux features that are not used in the U-Boot version (e.g. garbage-collection, write support). Signed-off-by: Stefan Roese <sr@denx.de> CC: Artem Bityutskiy <dedekind@infradead.org> CC: Adrian Hunter <ext-Adrian.Hunter@nokia.com>
2009-01-27fat.c: fix warning: array subscript is above array boundsWolfgang Denk
Fix based on suggestion by David Hawkins <dwh@ovro.caltech.edu>. Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-01-24fat: fix unaligned errorsBryan Wu
A couple of buffers in the fat code are declared as an array of bytes. But it is then cast up to a structure with 16bit and 32bit members. Since GCC assumes structure alignment here, we have to force the buffers to be aligned according to the structure usage. Signed-off-by: Bryan Wu <bryan.wu@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-12-16jffs2: include <linux/mtd/compat.h> instead of defining own min_tIlya Yanok
Include <linux/mtd/compat.h> header for min_t definition instead of providing our own one. Removes warnings in case of OneNAND support enabled. Although I thinks it's a bit silly to include <linux/mtd/compat.h> just for min_t... Signed-off-by: Ilya Yanok <yanok@emcraft.com> Acked-by: Stefan Roese <sr@denx.de>
2008-12-10fs/fat: handle FAT on SATASonic Zhang
The FAT file system driver should also handle FAT on SATA devices. Signed-off-by: Sonic Zhang <Sonic.Zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-12-09jffs2: cache data_crc resultsIlya Yanok
As we moved data_crc() invocation from jffs2_1pass_build_lists() to jffs2_1pass_read_inode() data_crc is going to be calculated on each inode access. This patch adds caching of data_crc() results. There is no significant improvement in speed (because of flash access caching added in previous patch I think, crc in RAM is really fast) but this patch impacts memory usage -- every b_node structure uses 12 bytes instead of 8. Signed-off-by: Alexey Neyman <avn@emcraft.com> Signed-off-by: Ilya Yanok <yanok@emcraft.com>
2008-12-09jffs2: summary supportIlya Yanok
This patch adds support for reading fs information from summary node instead of scanning full eraseblock. Signed-off-by: Ilya Yanok <yanok@emcraft.com>
2008-12-09jffs2: add buffer to cache flash accessesIlya Yanok
With this patch JFFS2 code allocates memory buffer of max_totlen size (size of the largest node, calculated during scan time) and uses it to store entire node. Speeds up loading. If malloc fails we use old ways to do things. Signed-off-by: Alexey Neyman <avn@emcraft.com> Signed-off-by: Ilya Yanok <yanok@emcraft.com>
2008-12-09jffs2: rewrite jffs2 scanning code based on Linux oneIlya Yanok
Rewrites jffs2_1pass_build_lists() function in style of Linux's jffs2_scan_medium() and jffs2_scan_eraseblock(). This includes: - Caching flash acceses - Smart dealing with free space Signed-off-by: Alexey Neyman <avn@emcraft.com> Signed-off-by: Ilya Yanok <yanok@emcraft.com>
2008-12-09jffs2: fix searching for latest version in jffs2_1pass_list_inodes()Ilya Yanok
We need to update i_version inside cycle to find really latest version inside jffs2_1pass_list_inodes(). With that fixed we can use isize inside dump_inode() instead of calling expensive jffs2_1pass_read_inode(). Signed-off-by: Alexey Neyman <avn@emcraft.com> Signed-off-by: Ilya Yanok <yanok@emcraft.com>
2008-12-04Remove non-ascii characters from fat codeRemy Bohmer
This code contains some non-ascii characters in comment lines and code. Most editors do not display those characters properly and editing those files results always in diffs at these places which are usually not required to be changed at all. This is error prone. So, remove those weird characters and replace them by normal C-style equivalents for which the proper defines were already in the header. Signed-off-by: Remy Bohmer <linux@bohmer.net>
2008-10-31JFFS2: Eliminate compiler error when both NAND and OneNAND are enabled.Scott Wood
Reported-by: Alessandro Rubini <rubini-list@gnudd.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
2008-10-18rename CFG_ macros to CONFIG_SYSJean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-09-06Add JFFS2 command support on OneNANDKyungmin Park
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2008-08-31fs: Move conditional compilation to MakefileJean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-08-21Make the YAFFS filesystem workRemy Bohmer
Recently the YAFFS filesystem support has been added to U-boot. However, just enabling CONFIG_YAFFS2 is not enough to get it working. ymount will generate an exception (when dereferencing mtd->readoob()), because the genericDevice is a null pointer. Further, a lot of logging is produced while using YAFFS fs, so logging should also be disabled. Both issues are solved by this patch. With this patch and CONFIG_YAFFS2 enabled, I get a readable filesystem in U-boot, as well as in Linux. Tested on a Atmel AT91SAM9261EK board. Signed-off-by: Remy Bohmer <linux@bohmer.net> Acked-by: William Juul <william.juul@tandberg.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
2008-08-14Coding Style cleanup, update CHANGELOGWolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-08-13drivers/mtd/nand: Move conditional compilation to MakefileJean-Christophe PLAGNIOL-VILLARD
rename CFG_NAND_LEGACY to CONFIG_NAND_LEGACY Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-08-12moving files from yaffs2/direct/ to yaffs2/ and deleting all symlinksWilliam Juul
Signed-off-by: William Juul <william.juul@tandberg.com>
2008-08-12Clean out unneeded filesWilliam Juul
Signed-off-by: William Juul <william.juul@tandberg.com>
2008-08-12Create symlinks from yaffs2/direct to yaffs2William Juul
Signed-off-by: William Juul <william.juul@tandberg.com>
2008-08-12Incorporate yaffs2 into U-bootWilliam Juul
To use YAFFS2 define CONFIG_YAFFS2 Signed-off-by: William Juul <william.juul@tandberg.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
2008-08-12YAFFS2 importWilliam Juul
Direct import of yaffs as a tarball as of 20071113 from their public CVS-web at http://www.aleph1.co.uk/cgi-bin/viewcvs.cgi/yaffs2/ The code can also be imported on the command line with: export CVSROOT=:pserver:anonymous@cvs.aleph1.co.uk:/home/aleph1/cvs cvs logon (Hit return when asked for a password) cvs checkout yaffs2 Signed-off-by: William Juul <william.juul@tandberg.com> Signed-off-by: Stig Olsen <stig.olsen@tandberg.com>
2008-07-14Fix printf() format issues with sizeof_t types by using %zuWolfgang Denk
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Wolfgang Denk <wd@denx.de>