summaryrefslogtreecommitdiff
path: root/fs
AgeCommit message (Collapse)Author
2012-08-22Initial Toradex Colibri T20 L4T R15 support.T20_LinuxImageV2.0Alpha1_20120808Marcel Ziswiler
2011-08-29Some minor cleanup in the CBFS driverGabe Black
Added some comments, and moved function return values to the same line as the function name. TEST=Compiled for x86-alex. BUG=chrome-os-partner:5702 Change-Id: I101ab927f72653a912ec82df5e665a0baf223c92 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://gerrit.chromium.org/gerrit/6726 Reviewed-by: Stefan Reinauer <reinauer@google.com>
2011-08-29Refactor the CBFS implementation and add a cbfs_file_find_uncached functionGabe Black
If u-boot needs something out of CBFS very early before the heap is configured, it won't be able to use the normal CBFS support which caches some information in memory it allocates from the heap. This change adds a new cbfs_file_find_uncached function which searchs a CBFS instance without touching the heap. It also refactors the implementation of u-boot's CBFS support to avoid code duplication, and allows some functions to be used without CBFS being initialized which sets up the cache on the heap. BUG=chrome-os-partner:5432 TEST=Built x86-alex, verified that the CBFS commands still work, and with later changes verified that the device tree could be loaded from CBFS before the heap is initialized. Signed-off-by: Gabe Black <gabeblack@google.com> Change-Id: Ia57a5c553a0cd524073c05ca964501ccf6c5e025 Reviewed-on: http://gerrit.chromium.org/gerrit/5858 Tested-by: Gabe Black <gabeblack@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2011-08-29Refactor the CBFS driver so that it's easier to use programmaticallyGabe Black
This change refactors the implementation of the CBFS driver so that it can be used effectively both from the command line and programmatically from within u-boot. BUG=chrome-os-partner:4993 TEST=Built and booted on Alex. Verified that the CBFS commands still behaved correctly. Change-Id: I97720828e282261f69479979d7d0c2c7d193c53f Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://gerrit.chromium.org/gerrit/4916 Reviewed-by: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
2011-08-29Add a CBFS driver and commands to u-boot.Gabe Black
This change adds CBFS support and some commands to use it to u-boot. These commands are: cbfsinit - Initialize CBFS support and pull all metadata into RAM. The end of the ROM is an optional parameter which defaults to the standard 0xffffffff and can be used to support multiple CBFSes in a system. The last one set up with cbfsinit is the one that will be used. cbfsinfo - Print information from the CBFS header. cbfsls - Print out the size, type, and name of all the files in the current CBFS. Recognized types are translated into symbolic names. cbfsload - Load a file from CBFS into memory. Like the similar command for fat filesystems, you can optionally provide a maximum size. Support for CBFS is compiled in when the CONFIG_CMD_CBFS option is specified. BUG=chrome-os-partner:3910 TEST=Built and booted on an Alex. Initialized with and without specifying the end of the ROM, and with a bad end of ROM. Ran the commands before CBFS was initialized. Ran cbfsinfo and saw reasonable output. Ran cbfsls and saw output that matched what was printed when the CBFS was put together by the coreboot ebuild. Used cbfsload to load a test text file into memory and verified that it was the correct size and had the correct contents. Ran with a max size and saw the file was truncated in memory. Change-Id: I64d06d49633cef3cffac1d571519eae38c7d267f Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://gerrit.chromium.org/gerrit/4167 Reviewed-by: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
2011-08-29ext2: Cache line align partial sector bounce bufferAnton Staaf
This allocates a cache line size aligned sector sized bounce buffer the first time that ext2fs_devread is called. This is required to avoid bounce buffers on ARM. BUG=chromium-os:16317 TEST=run "ext2ls mmc 0:3" on Seaboard Change-Id: Ia01d17d655eb503bf7835a8e663c3b71806872a8 Reviewed-on: http://gerrit.chromium.org/gerrit/2328 Reviewed-by: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org>
2011-08-29ext2: Simplify partial sector access logicAnton Staaf
Previously reading or writing zero full sectors (reading the end of one sector and the beginning of the next for example) was special cased and involved stack allocating a second sector buffer. This change uses the same code path for this case as well as when there are a non-zero number of full sectors to access. The result is easier to read and reduces the maximum stack used. BUG=None TEST=run "ext2ls mmc 0:3" on Seaboard Change-Id: Iac92172bf40724302292a2a9695cb61029b02ae7 Reviewed-on: http://gerrit.chromium.org/gerrit/2327 Reviewed-by: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org>
2011-08-29ext2: Fix checkpatch violationsAnton Staaf
BUG=chromium-os:16317 TEST=Build and run "ext2ls mmc 0:3" on Seaboard Change-Id: Ie927ee8a2b5d15d0ff33b2531814a3bff7ec9cea Reviewed-on: http://gerrit.chromium.org/gerrit/2386 Reviewed-by: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org>
2011-05-10cramfs: make cramfs usable without a NOR flashHeiko Schocher
cc: Wolfgang Denk <wd@denx.de> cc: Detlev Zundel <dzu@denx.de> cc: Valentin Longchamp <valentin.longchamp@keymile.com> cc: Holger Brunck <holger.brunck@keymile.com> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
2011-04-12Fix misc spelling errors found by lintianLoïc Minier
Signed-off-by: Loïc Minier <loic.minier@linaro.org>
2011-04-02fat32 root directory handlingErik Hansen
Fat directory handling didn't check reaching the end of the root directory. It relied on a stop condition based on a directory entry with a name starting with a '\0' character. This check in itself is wrong ('\0' indicates free entry, not end_of_directory) but outside the scope of this fix. For FAT32, the end of the rootdir is reached when the end of the cluster chain is reached. The code didn't check this condition and started to read an incorrect cluster. This caused a subsequent read request of a sector outside the range of the usb stick in use. On its turn, the usb stick protested with a stall handshake. Both FAT32 and non-FAT32 (FAT16/FAT12) end or rootdir checks have been put in. Signed-off-by: Erik Hansen <erik@makarta.com>
2011-01-11UBIFS: Fix dereferencing type-punned pointer compiler warningDirk Behme
Fix compiler warning In file included from ubifs.h:2137:0, from ubifs.c:26: misc.h: In function 'ubifs_idx_key': misc.h:263:26: warning: dereferencing type-punned pointer will break strict-aliasing rules seen with gcc version 4.5.1 (Sourcery G++ Lite 2010.09-50). No functional change. CC: Stefan Roese <sr@denx.de> Signed-off-by: Dirk Behme <dirk.behme@googlemail.com> Signed-off-by: Stefan Roese <sr@denx.de>
2010-12-16Merge branch 'master' of ../master into nextWolfgang Denk
2010-12-03ubifs.c: BUG: Error following linksRicardo Ribalda Delgado
The link_name variable is declared inside the if block and it is used outside it through the name pointer. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Stefan Roese <sr@denx.de>
2010-12-03UBIFS: Change ubifsload to not read beyond the requested sizeStefan Roese
Until now ubifsload pads the destination with 0 up to a multiple of UBIFS_BLOCK_SIZE (4KiB) while reading a file to memory. This patch changes this behaviour to only read to the requested length. This is either the file length or the length/size provided as parameter to the ubifsload command. Signed-off-by: Stefan Roese <sr@denx.de>
2010-12-03UBIFS: Add ubifsumount command to unmount an active volumeStefan Roese
This new ubifsumount command allows the user to unmount a previously mounted UBIFS volume. Signed-off-by: Stefan Roese <sr@denx.de>
2010-11-28ext2: constify file/dir namesMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-11-17Switch from archive libraries to partial linkingSebastien Carlier
Before this commit, weak symbols were not overridden by non-weak symbols found in archive libraries when linking with recent versions of binutils. As stated in the System V ABI, "the link editor does not extract archive members to resolve undefined weak symbols". This commit changes all Makefiles to use partial linking (ld -r) instead of creating library archives, which forces all symbols to participate in linking, allowing non-weak symbols to override weak symbols as intended. This approach is also used by Linux, from which the gmake function cmd_link_o_target (defined in config.mk and used in all Makefiles) is inspired. The name of each former library archive is preserved except for extensions which change from ".a" to ".o". This commit updates references accordingly where needed, in particular in some linker scripts. This commit reveals board configurations that exclude some features but include source files that depend these disabled features in the build, resulting in undefined symbols. Known such cases include: - disabling CMD_NET but not CMD_NFS; - enabling CONFIG_OF_LIBFDT but not CONFIG_QE. Signed-off-by: Sebastien Carlier <sebastien.carlier@gmail.com>
2010-10-29Replace CONFIG_RELOC_FIXUP_WORKS by CONFIG_NEEDS_MANUAL_RELOCWolfgang Denk
By now, the majority of architectures have working relocation support, so the few remaining architectures have become exceptions. To make this more obvious, we make working relocation now the default case, and flag the remaining cases with CONFIG_NEEDS_MANUAL_RELOC. Signed-off-by: Wolfgang Denk <wd@denx.de> Tested-by: Heiko Schocher <hs@denx.de> Tested-by: Reinhard Meyer <u-boot@emk-elektronik.de>
2010-10-20FAT: buffer overflow with FAT12/16Stefano Babic
Last commit 3831530dcb7b71329c272ccd6181f8038b6a6dd0a was intended "explicitly specify FAT12/16 root directory parsing buffer size, instead of relying on cluster size". Howver, the underlying function requires the size of the buffer in blocks, not in bytes, and instead of passing a double sector size a request for 1024 blocks is sent. This generates a buffer overflow with overwriting of other structure (in the case seen, USB structures were overwritten). Signed-off-by: Stefano Babic <sbabic@denx.de> CC: Mikhail Zolotaryov <lebon@lebon.org.ua>
2010-10-12VFAT: fix processing of scattered long file name entriesMikhail Zolotaryov
The U-Boot code has the following bugs related to the processing of Long File Name (LFN) entries scattered across several clusters/sectors : 1) get_vfatname() function is designed to gather scattered LFN entries by cluster chain processing - that doesn't work for FAT12/16 root directory. In other words, the function expects the following input data: 1.1) FAT32 directory (which is cluster chain based); OR 1.2) FAT12/16 non-root directory (which is also cluster chain based); OR 1.3) FAT12/16 root directory (allocated as contiguous sectors area), but all necessary information MUST be within the input buffer of filesystem cluster size (thus cluster-chain jump is never initiated). In order to accomplish the last condition, root directory parsing code in do_fat_read() uses the following trick: read-out cluster-size block, process only first sector (512 bytes), then shift 512 forward, read-out cluster-size block and so on. This works great unless cluster size is equal to 512 bytes (in a case you have a small partition), or long file name entries are scattered across three sectors, see 4) for details. 2) Despite of the fact that get_vfatname() supports FAT32 root directory browsing, do_fat_read() function doesn't send current cluster number correctly, so root directory look-up doesn't work correctly. 3) get_vfatname() doesn't gather scattered entries correctly also is the case when all LFN entries are located at the end of the source cluster, but real directory entry (which must be returned) is at the only beginning of the next one. No error detected, the resulting directory entry returned contains a semi-random information (wrong size, wrong start cluster number and so on) i.e. the entry is not accessible. 4) LFN (VFAT) allows up to 20 entries (slots) each containing 26 bytes (13 UTF-16 code units) to represent a single long file name i.e. up to 520 bytes. U-Boot allocates 256 bytes buffer instead, i.e. 10 or more LFN slots record may cause buffer overflow / memory corruption. Also, it's worth to mention that 20+1 slots occupy 672 bytes space which may take more than one cluster of 512 bytes (medium-size FAT32 or small FAT16 partition) - get_vfatname() function doesn't support such case as well. The patch attached fixes these problems in the following way: - keep using 256 bytes buffer for a long file name, but safely prevent a possible buffer overflow (skip LFN processing, if it contains 10 or more slots). - explicitly specify FAT12/16 root directory parsing buffer size, instead of relying on cluster size. The value used is a double sector size (to store current sector and the next one). This fixes the first problem and increases performance on big FAT12/16 partitions; - send current cluster number (FAT32) to get_vfatname() during root directory processing; - use LFN counter to seek the real directory entry in get_vfatname() - fixes the third problem; - skip deleted entries in the root directory (to prevent bogus buffer overflow detection and LFN counter steps). Note: it's not advised to split up the patch, because a separate part may operate incorrectly. Signed-off-by: Mikhail Zolotaryov <lebon@lebon.org.ua>
2010-08-07ext2fs: 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. Signed-off-by: Aaron Pace <Aaron.Pace@alcatel-lucent.com>
2010-07-24fs/fat: Big code cleanup.Wolfgang Denk
- reformat - throw out macros like FAT_DPRINT and FAT_DPRINT - remove dead code Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-07-24FAT32: fix broken root directory handling.Wolfgang Denk
On FAT32, instead of fetching the cluster numbers from the FAT, the code assumed (incorrectly) that the clusters for the root directory were allocated contiguously. In the result, only the first cluster could be accessed. At the typical cluster size of 8 sectors this caused all accesses to files after the first 128 entries to fail - "fatls" would terminate after 128 files (usually displaying a bogus file name, occasionally even crashing the system), and "fatload" would fail to find any files that were not in the first directory cluster. Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-07-24FAT32: fix support for superfloppy-format (PBR)Wolfgang Denk
"Superfloppy" format (in U-Boot called PBR) did not work for FAT32 as the file system type string is at a different location. Add support for FAT32. Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-05-28nios: remove nios-32 archThomas Chou
The nios-32 arch is obsolete and broken. So it is removed. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
2010-04-28ubifsmount fails due to not initialized listStefano Babic
ubifsmount is not working and causes an access with a pointer set to zero because the ubifs_fs_type is not initialized correctly. Signed-off-by: Stefano Babic <sbabic@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
2010-03-31jffs2, suen3: Fix compiler warningHeiko Schocher
$ ./MAKEALL suen3 jffs2_1pass.c: In function 'get_fl_mem': jffs2_1pass.c:399: warning: unused variable 'id' jffs2_1pass.c: In function 'get_node_mem': jffs2_1pass.c:423: warning: unused variable 'id' Signed-off-by: Heiko Schocher <hs@denx.de> Tested-by: Tom <Tom.Rix@windriver.com>
2010-01-15JFFS2: drop support for LZARI compression modeWolfgang Denk
Support for LZARI compression mode was added based on a MTD CVS snapshot of March 13, 2005. However, fs/jffs2/compr_lzari.c contains contradictory licensing terms: the original copyright clause says "All rights reserved. Permission granted for non-commercial use.", but later reference to the file 'LICENCE' in the jffs2 directory was added which says GPL v2 or later. As no boards ever used LZARI compression, and this file is also not present in recent MTD code, we resolve this conflict by removing the conflicting file and references to it. Also copy the referenced but missing file 'LICENCE' from the current MTD source tree. Signed-off-by: Wolfgang Denk <wd@denx.de>
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>