- Aug 13, 2015
-
-
Max Krummenacher authored
http://lists.denx.de/pipermail/u-boot/2012-September/134347.html allows for reading files in chunks from the shell. When this feature is used to read past the end of a file an error was returned instead of returning the bytes read up to the end of file. Thus the following fails in the shell: offset = 0 len = chunksize do read file, offset, len write data until bytes_read < len The patch changes the behaviour to printing an informational message and returning the actual read number of bytes aka read(2) behaviour for convenient use in U-Boot scripts. Signed-off-by:
Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by:
Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by:
Marek Vasut <marex@denx.de> Signed-off-by:
Stefan Agner <stefan.agner@toradex.com> Signed-off-by:
Marcel Ziswiler <marcel.ziswiler@toradex.com>
-
Mark Tomlinson authored
When building the file system the existing code does an insertion into a linked list. It attempts to speed this up by keeping a pointer to where the last entry was inserted but it's still slow. Now the nodes are just inserted into the list without searching through for the correct place. This unsorted list is then sorted once using mergesort after all the entries have been added to the list. This speeds up the scanning of the flash file system considerably. Signed-off-by:
Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
-
Mark Tomlinson authored
If a sector has a CLEANMARKER at the beginning, it indicates that the entire sector has been erased. Therefore, if this is found, we can skip the entire block. This was not being done before this patch. The code now does the same as the kernel does when encountering a CLEANMARKER. It still checks that the next few words are FFFFFFFF, and if so, the block is assumed to be empty, and so is skipped. Signed-off-by:
Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
-
Mark Tomlinson authored
The scan code is similar to the linux kernel, but the kernel defines a much smaller size to scan through before deciding a sector is blank. Assuming that what is in the kernel is OK, make these two match. On its own, this change makes no difference to scanning of any sectors which have a clean marker at the beginning, since the entire sector is not blank. Signed-off-by:
Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
-
Mark Tomlinson authored
If the flash is slow, reading less from the flash into buffers makes the process faster. Signed-off-by:
Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
-
Mark Tomlinson authored
jffs2_1pass_read_inode() would read the entire data for each node in the filesystem, regardless of whether it was part of the file to be loaded or not. By only reading the header data for an inode, and then reading the data only when it is found to be part of the file to be loaded, much copying of data is saved. jffs2_1pass_list_inodes() read each inode for every file in the directory into a buffer. By using NULL as a buffer pointer, NOR flash simply returns a pointer, and therefore avoids a memory copy. Signed-off-by:
Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
-
Mark Tomlinson authored
If multiple versions of a file exist, only the most recent version should be used. The scheme to write 0 for the inode in older versions did not work, since this would have required writing to flash. The only time this caused an issue was listing a directory, where older versions of the file would still be seen. Since the directory entries are sorted, just look at the next entry in the list, and if it's the same move to that entry instead. Signed-off-by:
Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
-
Mark Tomlinson authored
Copying complete nodes from flash can be slow if the flash is slow to read. By only reading the data needed, the sorting operation can be made much faster. The directory entry comparison function also had a two bugs. First, it did not ensure the name was copied, so the name comparison may have been faulty (although it would have worked with NOR flash). Second, setting the ino to zero to ignore the entry did not work, since this was either writing to a temporary buffer, or (for NOR flash) directly to flash. Either way, the change was not remembered. Signed-off-by:
Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
-
Mark Tomlinson authored
If a destination is not provided, jffs2_1pass_read_inode() only returns the length of the file. In this case, avoid reading all the data nodes, and return as soon as the length of the file is known. Signed-off-by:
Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
-
- Apr 19, 2015
-
-
Sjoerd Simons authored
Only do sandbox filesystem access when using the hostfs device interface, rather then falling back to it in all cases. This prevents confusion situations due to the fallback being taken rather then an unsupported error being raised. Signed-off-by:
Sjoerd Simons <sjoerd.simons@collabora.co.uk> Reviewed-by:
Simon Glass <sjg@chromium.org> Acked-by:
Simon Glass <sjg@chromium.org>
-
- Apr 18, 2015
-
-
Joe Hershberger authored
In the case where the arch defines a custom map_sysmem(), make sure that including just mapmem.h is sufficient to have these functions as they are when the arch does not override it. Also split the non-arch specific functions out of common.h Signed-off-by:
Joe Hershberger <joe.hershberger@ni.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Mar 06, 2015
-
-
Przemyslaw Marczak authored
After rework of the file system API, the size of ext4 write was missed. This causes printing unreliable write size at the end of the file system write operation. Signed-off-by:
Przemyslaw Marczak <p.marczak@samsung.com> Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Simon Glass <sjg@chromium.org> Tested-by:
Stephen Warren <swarren@nvidia.com>
-
- Jan 29, 2015
-
-
Sjoerd Simons authored
New command to determine the filesystem type of a given partition. Optionally stores the filesystem type in a environment variable. Signed-off-by:
Sjoerd Simons <sjoerd.simons@collabora.co.uk> Reviewed-by:
Stephen Warren <swarren@nvidia.com>
-
Enable ubifs_replay_journal during mount_ubifs, which was disabled before. This commit fix an issue with unrecoverable ubifs volumes after power cut. Therefor the gc.c is imported now from 1860e37 Linux 3.15 hs: added SPDX-License-Identifier for fs/ubifs/gc.c Signed-off-by:
Anton Habegger <anton.habegger@gmail.com>
-
- Jan 28, 2015
-
-
This commit is a preperation for a subsequent UBIFS commit which needs atomic_long operations. Therefor "include/asm-generic/atomic-long.h" is imported from 1860e37 Linux 3.15 Signed-off-by:
Anton Habegger <anton.habegger@gmail.com>
-
- Jan 05, 2015
-
-
Przemyslaw Marczak authored
The present fat implementation ignores FAT16 long name directory entries which aren't placed in a single sector. This was becouse of the buffer was always filled by the two sectors, and the loop was made also for two sectors. If some file long name entries are stored in two sectors, the we have two cases: Case 1: Both of sectors are in the buffer - all required data for long file name is in the buffer. - Read OK! Case 2: The current directory entry is placed at the end of the second buffered sector. And the next entries are placed in a sector which is not buffered yet. Then two next sectors are buffered and the mentioned entry is ignored. - Read fail! This commit fixes this issue by: - read two sectors after loop on each single is done - keep the last used sector as a first in the buffer before the read of two next The commit doesn't affects the fat32 imlementation, which works good as previous. Signed-off-by:
Przemyslaw Marczak <p.marczak@samsung.com> Cc: Mikhail Zolotaryov <lebon@lebon.org.ua> Cc: Tom Rini <trini@ti.com> Cc: Stephen Warren <swarren@nvidia.com> Cc: Simon Glass <sjg@chromium.org> Cc: Suriyan Ramasami <suriyan.r@gmail.com> Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Wolfgang Denk <wd@denx.de> Tested-by:
Simon Glass <sjg@chomium.org>
-
- Dec 01, 2014
-
-
Tom Rini authored
The changes to introduce loff_t into filesize means that we need to do 64bit math on 32bit platforms. Make sure we use the right wrappers for these operations. Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Suriyan Ramasami <suriyan.r@gmail.com> Reviewed-by:
Simon Glass <sjg@chromium.org> Signed-off-by:
Tom Rini <trini@ti.com> Tested-by:
Pierre Aubert <p.aubert@staubli.com>
-
- Nov 23, 2014
-
-
Suriyan Ramasami authored
The sandbox/ext4/fat/generic fs commands do not gracefully deal with files greater than 2GB. Negative values are returned in such cases. To handle this, the fs functions have been modified to take an additional parameter of type "* loff_t" which is then populated. The return value of the fs functions are used only for error conditions. Signed-off-by:
Suriyan Ramasami <suriyan.r@gmail.com> Acked-by:
Simon Glass <sjg@chromium.org> [trini: Update board/gdsys/p1022/controlcenterd-id.c, drivers/fpga/zynqpl.c for changes] Signed-off-by:
Tom Rini <trini@ti.com>
-
Suriyan Ramasami authored
Change the internal sandbox functions to use loff_t for file offsets. Signed-off-by:
Suriyan Ramasami <suriyan.r@gmail.com> Acked-by:
Simon Glass <sjg@chromium.org>
-
Suriyan Ramasami authored
Change the internal EXT4 functions to use loff_t for offsets. Signed-off-by:
Suriyan Ramasami <suriyan.r@gmail.com> Acked-by:
Simon Glass <sjg@chromium.org> [trini: Update common/spl/spl_ext.c] Signed-off-by:
Tom Rini <trini@ti.com>
-
Suriyan Ramasami authored
Change the internal FAT functions to use loff_t for offsets. Signed-off-by:
Suriyan Ramasami <suriyan.r@gmail.com> Acked-by:
Simon Glass <sjg@chromium.org> [trini: Fix fs/fat/fat.c for min3 updates] Signed-off-by:
Tom Rini <trini@ti.com>
-
Christian Gmeiner authored
Some filesystems have a UUID stored in its superblock. To allow using root=UUID=... for the kernel command line we need a way to read-out the filesystem UUID. changes rfc -> v1: - make the environment variable an option parameter. If not given, the UUID is printed out. If given, it is stored in the env variable. - corrected typos - return error codes changes v1 -> v2: - fix return code of do_fs_uuid(..) - document do_fs_uuid(..) - implement fs_uuid_unsuported(..) be more consistent with the way other optional functionality works changes v2 -> v3: - change ext4fs_uuid(..) to make use of #if .. #else .. #endif construct to get rid of unreachable code Hit any key to stop autoboot: 0 => fsuuid fsuuid - Look up a filesystem UUID Usage: fsuuid <interface> <dev>:<part> - print filesystem UUID fsuuid <interface> <dev>:<part> <varname> - set environment variable to filesystem UUID => fsuuid mmc 0:1 d9f9fc05-45ae-4a36-a616-fccce0e4f887 => fsuuid mmc 0:2 eb3db83c-7b28-499f-95ce-9e0bb21cda81 => fsuuid mmc 0:1 uuid1 => fsuuid mmc 0:2 uuid2 => printenv uuid1 uuid1=d9f9fc05-45ae-4a36-a616-fccce0e4f887 => printenv uuid2 uuid2=eb3db83c-7b28-499f-95ce-9e0bb21cda81 => Signed-off-by:
Christian Gmeiner <christian.gmeiner@gmail.com> Acked-by:
Stephen Warren <swarren@nvidia.com>
-
Masahiro Yamada authored
U-Boot has never cared about the type when we get max/min of two values, but Linux Kernel does. This commit gets min, max, min3, max3 macros synced with the kernel introducing type checks. Many of references of those macros must be fixed to suppress warnings. We have two options: - Use min, max, min3, max3 only when the arguments have the same type (or add casts to the arguments) - Use min_t/max_t instead with the appropriate type for the first argument Signed-off-by:
Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by:
Pavel Machek <pavel@denx.de> Acked-by:
Lukasz Majewski <l.majewski@samsung.com> Tested-by:
Lukasz Majewski <l.majewski@samsung.com> [trini: Fixup arch/blackfin/lib/string.c] Signed-off-by:
Tom Rini <trini@ti.com>
-
- Nov 20, 2014
-
-
Masahiro Yamada authored
U-Boot has imported various utility macros from Linux scattering them to various places without consistency. In include/common.h are min, max, min3, max3, ARRAY_SIZE, ALIGN, container_of, DIV_ROUND_UP, etc. In include/linux/compat.h are min_t, max_t, round_up, round_down, etc. We also have duplicated defines of min_t in some *.c files. Moreover, we are suffering from too cluttered include/common.h. This commit moves various macros that originate in include/linux/kernel.h of Linux to their original position. Note: This commit simply moves the macros; the macros roundup, min, max, min2, max3, ARRAY_SIZE are different from those of Linux at this point. Signed-off-by:
Masahiro Yamada <yamada.m@jp.panasonic.com>
-
- Nov 10, 2014
-
-
Jorgen Lundman authored
In a message from Wolfgang Denk highlighting warnings from cppcheck, the patch will address those that are correctly diagnosed. Some are false-positives: > [fs/zfs/zfs.c:937]: (error) Memory leak: l dmu_read() allocates "l" if successful, so error-case should not free it. > [fs/zfs/zfs.c:1141]: (error) Memory leak: dnbuf dmu_read() allocates "dnbuf" if successful, so error-case should not free it. > [fs/zfs/zfs.c:1372]: (error) Memory leak: osp zio_read() allocates "osp" if successful, so error-case should not free it. > [fs/zfs/zfs.c:1726]: (error) Memory leak: nvlist int_zfs_fetch_nvlist() allocates "nvlist" if successful, so error-case should not free it. Signed-off-by:
Jorgen Lundman <lundman@lundman.net>
-
- Oct 27, 2014
-
-
Guillaume GARDET authored
Add EXT filesystem support to SPL. Signed-off-by:
Guillaume GARDET <guillaume.gardet@free.fr> [trini: Fix a warning and checkpatch problems] Signed-off-by:
Tom Rini <trini@ti.com>
-
Simon Glass authored
On 64-bit platforms (like sandbox) 64-bit integers may be 'long' rather than 'long long'. Use the inttypes header to avoid compiler warnings. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Sep 24, 2014
-
-
Masahiro Yamada authored
The macro MIN, MAX is defined as the aliase of min, max, respectively. Signed-off-by:
Masahiro Yamada <yamada.m@jp.panasonic.com>
-
Masahiro Yamada authored
This would be useful to start moving various config options. Signed-off-by:
Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by:
Simon Glass <sjg@chromium.org> Tested-by:
Simon Glass <sjg@chromium.org>
-
- Sep 16, 2014
-
-
Masahiro Yamada authored
U-Boot has imported various source files from other projects, mostly Linux. Something like #ifdef __UBOOT__ [ modification for U-Boot ] #else [ original code ] #endif is an often used strategy for clarification of adjusted parts, that is, easier re-sync in future. Instead of defining __UBOOT__ in each source file, passing it from the top Makefile would be easier. Signed-off-by:
Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by:
Marek Vasut <marex@denx.de> Acked-by:
Heiko Schocher <hs@denx.de>
-
- Aug 25, 2014
-
-
Heiko Schocher authored
snyc with linux v3.15: commit 1860e379875dfe7271c649058aeddffe5afd9d0d Author: Linus Torvalds <torvalds@linux-foundation.org> Date: Sun Jun 8 11:19:54 2014 -0700 Linux 3.15 Signed-off-by:
Heiko Schocher <hs@denx.de> Cc: Scott Wood <scottwood@freescale.com> Cc: Tom Rini <trini@ti.com>
-
Heiko Schocher authored
while playing with the new mtd/ubi/ubifs sync, found some small updates for it: - add del_mtd_partition() to include/linux/mtd/mtd - mtd: add a debug_printf - remove some not used functions Signed-off-by:
Heiko Schocher <hs@denx.de> Cc: Scott Wood <scottwood@freescale.com> Cc: Tom Rini <trini@ti.com>
-
Heiko Schocher authored
resync ubi subsystem with linux: commit 455c6fdbd219161bd09b1165f11699d6d73de11c Author: Linus Torvalds <torvalds@linux-foundation.org> Date: Sun Mar 30 20:40:15 2014 -0700 Linux 3.14 A nice side effect of this, is we introduce UBI Fastmap support to U-Boot. Signed-off-by:
Heiko Schocher <hs@denx.de> Signed-off-by:
Tom Rini <trini@ti.com> Cc: Marek Vasut <marex@denx.de> Cc: Sergey Lapin <slapin@ossfans.org> Cc: Scott Wood <scottwood@freescale.com> Cc: Joerg Krause <jkrause@posteo.de>
-
Heiko Schocher authored
- move linux specific defines from usb and video code into linux/compat.h - move common linux specific defines from include/ubi_uboot.h to linux/compat.h - add for new mtd/ubi/ubifs sync new needed linux specific defines to linux/compat.h Signed-off-by:
Heiko Schocher <hs@denx.de> Cc: Marek Vasut <marex@denx.de> Cc: Anatolij Gustschin <agust@denx.de> [trini: Add spin_lock_irqsave/spin_unlock_irqrestore dummies from usb/lin_gadet_compat.h] Signed-off-by:
Tom Rini <trini@ti.com>
-
- Aug 09, 2014
-
-
Stephen Warren authored
These commands may be used to determine the size of a file without actually reading the whole file content into memory. This may be used to determine if the file will fit into the memory buffer that will contain it. In particular, the DFU code will use it for this purpose in the next commit. Signed-off-by:
Stephen Warren <swarren@nvidia.com>
-
- Jul 22, 2014
-
-
Pavel Machek authored
If filename is passed instead of address to ext2load or fatload, u-boot silently accepts that, and uses 0 for load address and default filename from environment. That is confusing, display help instead. Signed-off-by:
Pavel Machek <pavel@denx.de>
-
- Jul 18, 2014
-
-
Jeroen Hofstee authored
Current code uses the preprocessor to change an else case to a statement without any if condition at all. Although this works, change the optional code to return early, so all optional code is contained within a single #ifdef. Signed-off-by:
Jeroen Hofstee <jeroen@myspectrum.nl>
-
Jeroen Hofstee authored
Remove self assignments which is just dead code to prevent compiler warnings about non used arguments. For u-boot this does not prevent any warning though, on the contrary it actual introduces warnings when compiling with clang. Remove them. Signed-off-by:
Jeroen Hofstee <jeroen@myspectrum.nl>
-
- Jun 19, 2014
-
-
Stephen Warren authored
ext4fs_allocate_blocks() always allocates at least one block for a file. If the file size is zero, this causes total_remaining_blocks to underflow, which then causes an apparent hang while 2^32 blocks are allocated. To solve this, check that total_remaining_blocks is non-zero as part of the loop condition (i.e. before each loop) rather than at the end of the loop. Signed-off-by:
Stephen Warren <swarren@nvidia.com>
-
- Jun 11, 2014
-
-
Jeroen Hofstee authored
Clang interpretes an if condition like "if ((a = b) == NULL) as it tries to assign a value in a statement. Hence if you do "if ((something)) it warns you that you might be confused. Hence drop the double braces for plane if statements. Signed-off-by:
Jeroen Hofstee <jeroen@myspectrum.nl>
-