summaryrefslogtreecommitdiff
path: root/fs
Commit message (Collapse)AuthorAgeLines
* vfat: Fix mkcksum argument sizesMarek Vasut2013-01-31-2/+2
| | | | | | | | | | | | | | | | In case a function argument is known/fixed size array in C, the argument is still decoyed as pointer instead ( T f(U n[k]) ~= T fn(U *n) ) and therefore calling sizeof on the function argument will result in the size of the pointer, not the size of the array. The VFAT code contains such a bug, this patch fixes it. Reported-by: Aaron Williams <Aaron.Williams@cavium.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <tom.rini@gmail.com> Cc: Aaron Williams <Aaron.Williams@cavium.com> Tested-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
* fs:ext4:write: Initialize cache aligned filename bufferŁukasz Majewski2012-12-07-2/+3
| | | | | | | | | | | The filename buffer is allocated dynamically. It must be cache aligned. Moreover, it is necessary to erase its content before we use it for file name operations. This prevents from corruption of written file names. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* fs:ext4:fix: Code refactoring to suppress compiler warningsŁukasz Majewski2012-12-07-9/+11
| | | | | | | | Several fixes to suppress compiler's (eldk-5.[12].x gcc 4.6) warning [-Wunused-but-set-variable] Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* fs:ext4:write: Store block device descriptor in file system structureŁukasz Majewski2012-12-07-0/+1
| | | | | | | | | The device block descriptor (block_dev_desc_t) )shall be stored at ext4 early code (at ext4fs_set_blk_dev in this case) to be available for latter use (like put_ext4()). Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* fs:ext4:write: Add lldiv and do_div to perform 64-32 bits divisionŁukasz Majewski2012-12-07-2/+3
| | | | | | | | | | | | | | | | | | | | | | The ext4write code has been using direct calls to 64-32 division (/ and %). Officially supported u-boot toolchains (eldk-5.[12].x) generate calls to __aeabi_uldivmod(), which is niether defined in the toolchain libs nor u-boot source tree. Due to that, when the ext4write command has been executed, "undefined instruction" execption was generated (since the __aeabi_uldivmod() is not provided). To fix this error, lldiv() for division and do_div() for modulo have been used. Those two functions are recommended for performing 64-32 bit number division in u-boot. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* cbfs: Remove mention of CREDITS filesSimon Glass2012-12-06-6/+1
| | | | | | | As requested by Wolfgang, remove references to CREDITS in the CBFS files. Signed-off-by: Simon Glass <sjg@chromium.org>
* fs/fs.c: do_fsload: measure throughputAndreas Bießmann2012-11-14-1/+10
| | | | | | | | | | | | | | | | | | | | | This patch adds time measurement and throughput calculation for all supported load commands. The output of ext2load changes from ---8<--- 1830666 bytes read --->8--- to ---8<--- 1830666 bytes read in 237 ms (7.4 MiB/s) --->8--- Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> [agust: rebased and revised commit log] Signed-off-by: Anatolij Gustschin <agust@denx.de>
* fs: zfs: fix illegal use of fpAlejandro Mery2012-11-14-1/+3
| | | | | | | | | the upcoming sunxi (allwinner a10/a13) platform enables zfs by default, and using linaro's hf -msoft-float makes the build fail because this u64 division. Signed-off-by: Alejandro Mery <amery@geeks.cl> Acked-by: Stefan Roese <sr@denx.de>
* include/linux/byteorder: import latest endian definitions from linuxKim Phillips2012-11-04-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | u-boot's byteorder headers did not contain endianness attributions for use with sparse, causing a lot of false positives. Import the kernel's latest definitions, and enable them by including compiler.h and types.h. They come with 'const' added for some swab functions, so fix those up, too: include/linux/byteorder/big_endian.h:46:2: warning: passing argument 1 of '__swab64p' discards 'const' qualifier from pointer target type [enabled by default] Also, note: u-boot's historic __BYTE_ORDER definition has been preserved (for the time being at least). We also remove ad-hoc barrier() definitions, since we're including compiler.h in files that hadn't in the past: macb.c:54:0: warning: "barrier" redefined [enabled by default] In addition, including compiler.h in byteorder changes the 'noinline' definition to expand to __attribute__((noinline)). This fixes arch/powerpc/lib/bootm.c: bootm.c:329:16: error: attribute '__attribute__': unknown attribute bootm.c:329:16: error: expected ')' before '__attribute__' bootm.c:329:25: error: expected identifier or '(' before ')' token powerpc sparse builds yield: include/common.h:356:22: error: marked inline, but without a definition the unknown-reason inlining without a definition is considered obsolete given it was part of the 2002 initial commit, and no arm version was 'fixed.' also fixed: ydirectenv.h:60:0: warning: "inline" redefined [enabled by default] and: Configuring for devconcenter - Board: intip, Options: DEVCONCENTER make[1]: *** [4xx_ibm_ddr2_autocalib.o] Error 1 make: *** [arch/powerpc/cpu/ppc4xx/libppc4xx.o] Error 2 powerpc-fsl-linux-size: './u-boot': No such file 4xx_ibm_ddr2_autocalib.c: In function 'DQS_autocalibration': include/asm/ppc4xx-sdram.h:1407:13: sorry, unimplemented: inlining failed in call to 'ppc4xx_ibm_ddr2_register_dump': function body not available 4xx_ibm_ddr2_autocalib.c:1243:32: sorry, unimplemented: called from here and: In file included from crc32.c:50:0: crc32table.h:4:1: warning: implicit declaration of function '___constant_swab32' [-Wimplicit-function-declaration] crc32table.h:4:1: error: initializer element is not constant crc32table.h:4:1: error: (near initialization for 'crc32table_le[0]') Signed-off-by: Kim Phillips <kim.phillips@freescale.com> [trini: Remove '#endif' in include/common.h around setenv portion] Signed-off-by: Tom Rini <trini@ti.com>
* fs: rename fsload command to loadStephen Warren2012-11-04-1/+1
| | | | | | | | | | | When the generic filesystem load command "fsload" was written, I felt that "load" was too generic of a name for it, since many other similar commands already existed. However, it turns out that there is already an "fsload" command, so that name cannot be used. Rename the new "fsload" to plain "load" to avoid the conflict. At least anyone who's used a Basic interpreter should feel familiar with the name! Signed-off-by: Stephen Warren <swarren@nvidia.com>
* fs: fix number base behaviour change in fatload/ext*loadStephen Warren2012-11-04-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Commit 045fa1e "fs: add filesystem switch libary, implement ls and fsload commands" unified the implementation of fatload and ext*load with the new command fsload. However, this altered the interpretation of command-line numbers from always being base-16, to requiring a "0x" prefix for base-16 numbers. Enhance do_fsload() to allow commands to specify which base to use. Use base 0, thus requiring a "0x" prefix for the new fsload command. This feels much cleaner than assuming base 16. Use base 16 for the pre-existing fatload and ext*load to prevent a change in behaviour. Use base 16 exclusively for the loadaddr environment variable, since that variable is interpreted in multiple places, so we don't want the behaviour to change. Update command help text to make it clear where numbers are assumed to be hex, and where an explicit "0x" prefix is required. Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* fs: fix do_fsload() handling of optional argumentsStephen Warren2012-11-04-3/+7
| | | | | | | | | | | | | | | | | | Most arguments to the shell command do_fsload() implements are optional. Fix the minimum argc check to respect that. Cater for the situation where argv[2] is not provided. Enhance both do_fsload() and do_ls() to check the maximum number of arguments too. While this check would typically be implemented via U_BOOT_CMD()'s max_args parameter, if these functions are called directly, then that check won't exist. Finally, alter do_ls() to check (argc >= 4) rather than (argc == 4) so that if the function is enhanced to allow extra arguments in the future, this test won't need to be changed at that time. Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* ZFS: Fix compile warning in fs/zfs/zfs.c (GCC 4.6.4 from ELDK 5.2.1)Stefan Roese2012-11-02-51/+0
| | | | | | | | | This patch fixes the following compile warning: zfs.c:2006:1: warning: 'zfs_label' defined but not used [-Wunused-function] zfs.c:2029:1: warning: 'zfs_uuid' defined but not used [-Wunused-function] Signed-off-by: Stefan Roese <sr@denx.de> Cc: Jorgen Lundman <lundman@lundman.net>
* fs: handle CONFIG_NEEDS_MANUAL_RELOCStephen Warren2012-11-02-1/+12
| | | | | | | | Without this, fstypes[].probe points at the wrong place, so calling the function results in undefined behaviour. Signed-off-by: Stephen Warren <swarren@nvidia.com> Tested-by: Andreas Bießmann <andreas.devel@googlemail.com>
* fs: add filesystem switch libary, implement ls and fsload commandsStephen Warren2012-10-29-0/+355
| | | | | | | | | | | | Implement "ls" and "fsload" commands that act like {fat,ext2}{ls,load}, and transparently handle either file-system. This scheme could easily be extended to other filesystem types; I only didn't do it for zfs because I don't have any filesystems of that type to test with. Replace the implementation of {fat,ext[24]}{ls,load} with this new code too. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* fs: separate CONFIG_FS_{FAT, EXT4} from CONFIG_CMD_{FAT, EXT*}Stephen Warren2012-10-29-11/+8
| | | | | | | | | | | | | | | | | | This makes the FAT and ext4 filesystem implementations build if CONFIG_FS_{FAT,EXT4} are defined, rather than basing the build on whether CONFIG_CMD_{FAT,EXT*} are defined. This will allow the filesystems to be built separately from the filesystem-specific commands that use them. This paves the way for the creation of filesystem-generic commands that used the filesystems, without requiring the filesystem- specific commands. Minor documentation changes are made for this change. The new config options are automatically selected by the old config options to retain backwards-compatibility. Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* fs: delete unused MakefileStephen Warren2012-10-29-43/+0
| | | | | | | | | | | | fs/Makefile is unused. The top-level Makefile sets LIBS-y += fs/xxx and hence causes make to directly descend two directory levels into each individual filesystem, and it never descends into fs/ itself. So, delete this useless file. Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Acked-by: Simon Glass <sjg@chromium.org>
* FAT: implement fat_set_blk_dev(), convert cmd_fat.cStephen Warren2012-10-25-35/+31
| | | | | | | | | | | | | This makes the FAT filesystem API more consistent with other block-based filesystems. If in the future standard multi-filesystem commands such as "ls" or "load" are implemented, having FAT work the same way as other filesystems will be necessary. Convert cmd_fat.c to the new API, so the code looks more like other files implementing the same commands for other filesystems. Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* FAT: initialize all fields in cur_part_info, simplify initStephen Warren2012-10-25-2/+6
| | | | | | | | | | | | | | cur_part_info.{name,type} are strings. So, we don't need to memset() the entire thing, just put the NULL-termination in the first byte. Add missing initialization of the bootable and uuid fields. None of these fields are actually used by fat.c. However, since it stores the entire disk_partition_t, we should make sure that all fields are valid. Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* FAT: remove cur_part_nrStephen Warren2012-10-25-7/+2
| | | | | | | | | | | | | | | A future patch will implement the more standard filesystem API fat_set_blk_dev(). This API has no way to know which partition number the partition represents. Equally, future DM rework will make the concept of partition number harder to pass around. So, simply remove cur_part_nr from fat.c; its only use is in a diagnostic printf, and the context where it's printed should make it obvious which partition is referred to anyway (since the partition ID would come from the user command-line that caused it). Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* fs: Add a Coreboot Filesystem (CBFS) driver and commandsGabe Black2012-10-22-0/+383
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. The CBFS driver can also be used programmatically from within u-boot. 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. The cbfs_file_find_uncached function searches a CBFS instance without touching the heap. Signed-off-by: Gabe Black <gabeblack@google.com> Signed-off-by: Stefan Reinauer <reinauer@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
* fs: fat: Fix mkcksum() function parametersMarek Vasut2012-10-17-9/+13
| | | | | | | | | | | | | | | | | | | | The mkcksum() function now takes one parameter, the pointer to 11-byte wide character array, which it then operates on. Currently, the function is wrongly passed (dir_entry)->name, which is only 8-byte wide character array. Though by further inspecting the dir_entry structure, it can be noticed that the name[8] entry is immediatelly followed by ext[3] entry. Thus, name[8] and ext[3] in the dir_entry structure actually work as this 11-byte wide array since they're placed right next to each other by current compiler behavior. Depending on this is obviously wrong, thus fix this by correctly passing both (dir_entry)->name and (dir_entry)->ext to the mkcksum() function and adjust the function appropriately. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@ti.com>
* ARM: prevent misaligned array initsAlbert ARIBAUD2012-10-15-0/+5
| | | | | | | | | | | | | | Under option -munaligned-access, gcc can perform local char or 16-bit array initializations using misaligned native accesses which will throw a data abort exception. Fix files where these array initializations were unneeded, and for files known to contain such initializations, enforce gcc option -mno-unaligned-access. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net> [trini: Switch to usign call cc-option for -mno-unaligned-access as Albert had done previously as that's really correct] Signed-off-by: Tom Rini <trini@ti.com>
* yaffs2: Fix GCC 4.6 compile warningsAnatolij Gustschin2012-10-08-40/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix: yaffs_guts.c: In function 'yaffs_check_chunk_erased': yaffs_guts.c:324:6: warning: variable 'result' set but not used [-Wunused-but-set-variable] yaffs_guts.c: In function 'yaffs_verify_chunk_written': yaffs_guts.c:352:6: warning: variable 'result' set but not used [-Wunused-but-set-variable] yaffs_guts.c: In function 'yaffs_grab_chunk_cache': yaffs_guts.c:1488:6: warning: variable 'pushout' set but not used [-Wunused-but-set-variable] yaffs_guts.c: In function 'yaffs_check_obj_details_loaded': yaffs_guts.c:3180:6: warning: variable 'alloc_failed' set but not used [-Wunused-but-set-variable] yaffs_guts.c:3179:6: warning: variable 'result' set but not used [-Wunused-but-set-variable] yaffs_guts.c: In function 'yaffs_update_oh': yaffs_guts.c:3288:6: warning: variable 'result' set but not used [-Wunused-but-set-variable] yaffs_guts.c: In function 'yaffs_get_obj_name': yaffs_guts.c:4447:7: warning: variable 'result' set but not used [-Wunused-but-set-variable] yaffs_summary.c: In function 'yaffs_summary_read': yaffs_summary.c:194:6: warning: variable 'sum_tags_bytes' set but not used [-Wunused-but-set-variable] yaffs_verify.c: In function 'yaffs_verify_file': yaffs_verify.c:227:6: warning: variable 'actual_depth' set but not used [-Wunused-but-set-variable] yaffs_yaffs1.c: In function 'yaffs1_scan': yaffs_yaffs1.c:26:6: warning: variable 'result' set but not used [-Wunused-but-set-variable] yaffs_yaffs2.c: In function 'yaffs2_scan_chunk': yaffs_yaffs2.c:949:6: warning: variable 'result' set but not used [-Wunused-but-set-variable] yaffs_yaffs2.c: In function 'yaffs2_scan_backwards': yaffs_yaffs2.c:1352:6: warning: variable 'deleted' set but not used [-Wunused-but-set-variable] Signed-off-by: Anatolij Gustschin <agust@denx.de> Cc: Charles Manning <cdhmanning@gmail.com> Tested-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
* FAT: check for partition 0 not 1 for whole-disk fsStephen Warren2012-10-08-1/+1
| | | | | | | | | | | | | | | | | | | | | The recent switch to use get_device_and_partition() from do_fat_ls() broke the ability to access a FAT filesystem directly on a whole device; FAT only works within a partition on a device. This change makes e.g. "fatls mmc 0:0" work; explicitly requesting partition ID 0 is something that get_device_and_partition() fully supports. However, fat_register_device() expects partition ID 1 to be used in the full-disk case; partition ID 1 was previously implicitly specified when the user didn't actually specify a partition ID. Update fat_register_device() to expect the correct ID. This change does imply that if a user explicitly executes "fatls mmc 0:1" then this will fail, and may be a change in behaviour. Note that this still prevents "fatls mmc 0:auto" from working. The next patch will fix that. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* ext4: Rename block group descriptor table from gd to bgdSimon Glass2012-10-03-90/+94
| | | | | | | | | | | On x86 machines gd is unfortunately a #define, so we should avoid using gd for anything. This patch changes uses of gd to bgd so that ext4fs can be used on x86. A better fix would be to remove the #define in x86, but I'm not sure how to do that. Signed-off-by: Simon Glass <sjg@chromium.org>
* FAT: Make it possible to read from any file positionBenoît Thébaudeau2012-09-26-28/+88
| | | | | | | | | | | | | | | When storage devices contain files larger than the embedded RAM, it is useful to be able to read these files by chunks, e.g. for a software update to the embedded NAND Flash from an external storage device (USB stick, SD card, etc.). Hence, this patch makes it possible by adding a new FAT API to read files from a given position. This patch also adds this feature to the fatload command. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de> Signed-off-by: Tom Rini <trini@ti.com>
* cmd_reiser: use common get_device_and_partition functionRob Herring2012-09-25-19/+10
| | | | | | | | Convert reiserload and reiserls to use common device and partition parsing function. With the common function "dev:part" can come from the environment and a '-' can be used in that case. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* cmd_zfs: use common get_device_and_partition functionRob Herring2012-09-25-24/+11
| | | | | | | | Convert zfsload and zfsls to use common device and partition parsing function. With the common function "dev:part" can come from the environment and a '-' can be used in that case. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* cmd_extX: use common get_device_and_partition functionRob Herring2012-09-25-21/+13
| | | | | | | | Convert ext2/4 load, ls, and write functions to use common device and partition parsing function. With the common function "dev:part" can come from the environment and a '-' can be used in that case. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* ext4: remove init_fs/deinit_fsRob Herring2012-09-25-34/+2
| | | | | | | There's no real need to expose this and it can be removed by using a static allocation. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* Merge branch 'ext4'Tom Rini2012-09-20-1054/+4551
|\ | | | | | | | | | | | | | | | | Update Makefile change for LIBS -> LIBS-y change. Conflicts: Makefile Signed-off-by: Tom Rini <trini@ti.com>
| * ext4: cache-align buffers so the invalidation worksStephen Warren2012-09-20-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DMA buffer cache invalidation requires that buffers have cache-aligned buffer locations and sizes. Use memalign() and ALLOC_CACHE_ALIGN_BUFFER() to ensure this. On Tegra at least, without this fix, the following fail commands fail in u-boot-master/ext4, but succeeded at the branch's branch point in u-boot/master. With this fix, the commands work again: ext2ls mmc 0:1 / ext2load mmc 0:1 /boot/zImage Cc: Uma Shankar <uma.shankar@samsung.com> Cc: Manjunatha C Achar <a.manjunatha@samsung.com> Cc: Iqbal Shareef <iqbal.ams@samsung.com> Cc: Hakgoo Lee <goodguy.lee@samsung.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Tom Rini <trini@ti.com> Signed-off-by: Stephen Warren <swarren@nvidia.com>
| * ext4fs write supportUma Shankar2012-08-09-0/+3226
| | | | | | | | | | | | | | Signed-off-by: Uma Shankar <uma.shankar@samsung.com> Signed-off-by: Manjunatha C Achar <a.manjunatha@samsung.com> Signed-off-by: Iqbal Shareef <iqbal.ams@samsung.com> Signed-off-by: Hakgoo Lee <goodguy.lee@samsung.com>
| * ext4fs ls load supportUma Shankar2012-08-09-1054/+1320
| | | | | | | | | | | | | | Signed-off-by: Uma Shankar <uma.shankar@samsung.com> Signed-off-by: Manjunatha C Achar <a.manjunatha@samsung.com> Signed-off-by: Iqbal Shareef <iqbal.ams@samsung.com> Signed-off-by: Hakgoo Lee <goodguy.lee@samsung.com>
* | FAT: Fix file contents listed as directoryBenoît Thébaudeau2012-09-18-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | With: fatls mmc 0 /dir/file dir: regular directory file: regular file The previous code read the contents of file as if it were directory entries to list. This patch refuses to list file contents as if it were a folder. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de>
* | ubifs: Fix ubifsload when using ZLIBVeli-Pekka Peltola2012-09-10-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using ZLIB compression with UBIFS fails if last data node is not a size of UBIFS_BLOCK_SIZE (4096 bytes). Easiest way to test this is trying to read a file smaller than 4k: => ubifsload 41000000 /etc/fstab Loading file '/etc/fstab' to addr 0x41000000 with size 704 (0x000002c0)... UBIFS error (pid 0): read_block: bad data node (block 0, inode 2506) UBIFS error (pid 0): do_readpage: cannot read page 0 of inode 2506, error -22 Error reading file '/etc/fstab' /etc/fstab not found! exit not allowed from main input shell. => With this patch: => ubifsload 41000000 /etc/fstab Loading file '/etc/fstab' to addr 0x41000000 with size 704 (0x000002c0)... Done => Signed-off-by: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com> Cc: kmpark@infradead.org Tested-by: Andreas Bießmann <andreas.devel@googlemail.com> Signed-off-by: Stefan Roese <sr@denx.de>
* | ubifs: Fix memory leak in ubifs_finddirStefan Roese2012-09-03-5/+6
| | | | | | | | | | | | | | This patch fixes a memory leak in ubifs_finddir(). Signed-off-by: Stefan Roese <sr@denx.de> Cc: dev.ma.dma@gmail.com
* | FAT: Simplify get_contentsBenoît Thébaudeau2012-09-02-13/+1
| | | | | | | | | | | | | | | | One call to get_cluster can be factorized with another, so avoid duplicating code. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de>
* | FAT: get_cluster: Add buffer bouncingBenoît Thébaudeau2012-09-02-12/+30
| | | | | | | | | | | | | | | | | | | | Add a buffer bouncing mechanism to get_cluster. This can be useful for misaligned applicative buffers passed through get_contents. This is required for the following patches in the case of data aligned differently relatively to buffers and clusters. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de>
* | FAT: Fix redundant sector readBenoît Thébaudeau2012-09-02-26/+33
| | | | | | | | | | | | | | | | | | With the previous code, the remaining prefetched sectors were read again after each sector. With this patch, each sector is read only once, thus making the prefetch useful. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de>
* | FAT: cosmetic: Remove useless assignmentBenoît Thébaudeau2012-09-02-1/+0
| | | | | | | | | | | | | | | | fatlength is not used after this assignment, so it is useless and can be removed. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de>
* | FAT: get_fatent: Fix FAT boundary checkBenoît Thébaudeau2012-09-02-2/+2
| | | | | | | | | | | | | | | | startblock must be taken into account in order not to read past the end of the FAT. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de>
* | FAT: cosmetic: Remove extra spacesBenoît Thébaudeau2012-09-02-23/+21
| | | | | | | | | | | | | | Remove spaces before opening parentheses in function calls. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de>
* | u-boot yaffs2: Fix compilation warningsCharles Manning2012-09-02-100/+6
|/ | | | | | Also remove yaffs_hweight and use the hweight in u-boot. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
* zfs: Add ZFS filesystem supportJorgen Lundman2012-08-09-0/+2912
| | | | | | | | | | | | | | | | | | | | | U-Boot port is based on sources forked from GRUB-0.97 by Sun in 2004, which can be found here: http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/grub/grub-0.97/stage2/zfs-include/zfs.h Released by Sun for GRUB under the license: * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. GRUB official releases include ZFS in version: ftp://alpha.gnu.org/gnu/grub/grub-1.99~rc1.tar.gz And patched against GRUB Bazaar repository for ashift fixes (4KB HDDs) more conveniently found at github: https://github.com/pendor/grub-zfs/commit/e7b6ef3ac3b9685ac4c394c897b1d4221b7381f1 Signed-off-by: Jorgen Lundman <lundman@lundman.net>
* u-boot: Update yaffs2 file systemCharles Manning2012-08-09-9909/+13269
| | | | | | | | This patch updates the yaffs2 in u-boot to correspond to git://www.aleph1.co.uk/yaffs2 commit id 9ee5d0643e559568dbe62215f76e0a7bd5a63d93 Signed-off-by: Charles Manning <cdhmanning@gmail.com>
* UBIFS: Improve error message when reading superblock failedBernhard Walle2012-08-09-1/+1
| | | | | | | | | | | | | | In addition to the error message also display the error code. I had the problem that my malloc memory was not enough (ENOMEM), and if u-boot had displayed the error code immediately that would have saved me some debugging. Signed-off-by: Bernhard Walle <walle@corscience.de> Use ubifs_err instead of printf. Add "errno=%d" in output as suggested by Albert Aribaud. Signed-off-by: Thomas Weber <weber@corscience.de>
* ext2fs: fix warning: 'blocknxt' may be used uninitialized with gcc 4.2Tom Rini2012-08-07-2/+2
| | | | | | | | | | | | | | | | | | | | The above warning was introduced originally in 436da3c "ext2load: increase read speed" and fixed for newer toolchains in b803273 "ext2fs: fix warning: 'blocknxt' may be used uninitialized". This change did not fix the warning with gcc 4.2, as found in ELDK 4.2. If we rework the while loop to initalize blocknxt before entering the warning really goes away. Tested on am335x with an approx 7mb file and crc32 in U-Boot befor and after this change. Cc: Wolfgang Denk <wd@denx.de> Cc: Eric Nelson <eric.nelson@boundarydevices.com> Cc: Thierry Reding <thierry.reding@avionic-design.de> Cc: Jason Cooper <u-boot@lakedaemon.net> Cc: Andreas Bießmann <andreas.devel@googlemail.com> Cc: Reinhard Arlt <reinhard.arlt@esd-electronics.com> Cc: Kim Phillips <kim.phillips@freescale.com> Signed-off-by: Tom Rini <trini@ti.com>
* ext2fs: fix warning: 'blocknxt' may be used uninitializedKim Phillips2012-07-08-1/+1
| | | | | | | | | | | | | | | | | This warning was introduced in 436da3c "ext2load: increase read speed": ext2fs.c: In function 'ext2fs_read_file': ext2fs.c:458:19: warning: 'blocknxt' may be used uninitialized in this function [-Wuninitialized] this change makes it go away. Cc: Eric Nelson <eric.nelson@boundarydevices.com> Cc: Thierry Reding <thierry.reding@avionic-design.de> Cc: Jason Cooper <u-boot@lakedaemon.net> Cc: Andreas Bießmann <andreas.devel@googlemail.com> Cc: Reinhard Arlt <reinhard.arlt@esd-electronics.com> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>