- 20 8月, 2017 1 次提交
-
-
由 Tom Rini 提交于
The function blk_dread will return -ENOSYS on failure or on success the number of blocks read, which must be the number asked to read (otherwise it failed somewhere). Correct this check. Signed-off-by: NTom Rini <trini@konsulko.com>
-
- 12 7月, 2017 1 次提交
-
-
由 Simon Glass 提交于
At present CONFIG_CMD_SATA enables the 'sata' command which also brings in SATA support. Some boards may wish to enable SATA without the command. Add a separate CONFIG to permit this. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
-
- 23 5月, 2017 1 次提交
-
-
由 Simon Glass 提交于
At present IDE support is controlled by CONFIG_CMD_IDE. Add a separate CONFIG_IDE option so that IDE support can be enabled without requiring the 'ide' command. Update existing users and move the ide driver into drivers/block since it should not be in common/. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 29 1月, 2017 1 次提交
-
-
由 Stefan Brüns 提交于
Doing unaligned reads is not supported on all architectures, use byte sized reads of the little endian buffer. Rename off16 to off8, as it reflects the buffer offset in byte granularity (offset is in entry, i.e. 12 bit, granularity). Fix a regression introduced in 8d48c92bReported-by: NOleksandr Tymoshenko <gonzo@bluezbox.com> Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de> Tested-by: NOleksandr Tymoshenko <gonzo@bluezbox.com>
-
- 28 1月, 2017 1 次提交
-
-
由 Patrick Delaunay 提交于
We convert CONFIG_PARTITION_UUIDS to Kconfig first. But in order to cleanly update all of the config files we must also update CMD_PART and CMD_GPT to also be in Kconfig in order to avoid complex logic elsewhere to update all of the config files. Signed-off-by: NPatrick Delaunay <patrick.delaunay@st.com> Signed-off-by: NPatrick Delaunay <patrick.delaunay73@gmail.com> Signed-off-by: NTom Rini <trini@konsulko.com>
-
- 28 12月, 2016 3 次提交
-
-
由 Stefan Brüns 提交于
Instead of shuffling bits from two adjacent 16 bit words, use one 16 bit word with the appropriate byte offset in the buffer. Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de>
-
由 Stefan Brüns 提交于
get_fatent_value(...) flushes changed FAT entries to disk when fetching the next FAT blocks, in every other aspect it is identical to get_fatent(...). Provide a stub implementation for flush_dirty_fat_buffer if CONFIG_FAT_WRITE is not set. Calling flush_dirty_fat_buffer during read only operation is fine as it checks if any buffers needs flushing. Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: NBenoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
-
由 Stefan Brüns 提交于
The FAT is read/flushed in segments of 6 (FATBUFBLOCKS) disk sectors. The last segment may be less than 6 sectors, cap the length. Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: NBenoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
-
- 23 9月, 2016 1 次提交
-
-
由 Stefan Brüns 提交于
The code caches 6 sectors of the FAT. On FAT traversal, the old contents needs to be flushed to disk, but only if any FAT entries had been modified. Explicitly flag the buffer on modification. Currently, creating a new file traverses the whole FAT up to the first free cluster and rewrites the on-disk blocks. Signed-off-by: NStefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: NLukasz Majewski <l.majewski@samsung.com>
-
- 17 5月, 2016 1 次提交
-
-
由 Simon Glass 提交于
This option currently enables both the command and the SCSI functionality. Rename the existing option to CONFIG_SCSI since most of the code relates to the feature. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 15 3月, 2016 4 次提交
-
-
由 Simon Glass 提交于
To ease conversion to driver model, add helper functions which deal with calling each block device method. With driver model we can reimplement these functions with the same arguments. Use inline functions to avoid increasing code size on some boards. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NBin Meng <bmeng.cn@gmail.com> Tested-by: NStephen Warren <swarren@nvidia.com>
-
由 Simon Glass 提交于
This is a device number, and we want to use 'dev' to mean a driver model device. Rename the member. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NBin Meng <bmeng.cn@gmail.com> Tested-by: NStephen Warren <swarren@nvidia.com>
-
由 Simon Glass 提交于
Rename three partition functions so that they start with part_. This makes it clear what they relate to. Signed-off-by: NSimon Glass <sjg@chromium.org> Tested-by: NStephen Warren <swarren@nvidia.com>
-
由 Simon Glass 提交于
Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long and causes 80-column violations, rename it to struct blk_desc. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NBin Meng <bmeng.cn@gmail.com> Tested-by: NStephen Warren <swarren@nvidia.com>
-
- 14 1月, 2016 1 次提交
-
-
由 Stephen Warren 提交于
This will allow the implementation to make use of data in the block_dev structure beyond the base device number. This will be useful so that eMMC block devices can encompass the HW partition ID rather than treating this out-of-band. Equally, the existence of the priv field is crying out for this patch to exist. Signed-off-by: NStephen Warren <swarren@nvidia.com> Reviewed-by: NTom Rini <trini@konsulko.com>
-
- 12 9月, 2015 3 次提交
-
-
由 Łukasz Majewski 提交于
It is very common that FAT code is using following pattern: if (disk_{read|write}() < 0) return -1; Up till now the above code was dead, since disk_{read|write) could only return value >= 0. As a result some errors from medium layer (i.e. eMMC/SD) were not caught. The above behavior was caused by block_{read|write|erase} declared at struct block_dev_desc (@part.h). It returns unsigned long, where 0 indicates error and > 0 indicates that medium operation was correct. This patch as error regards 0 returned from block_{read|write|erase} when nr_blocks is grater than zero. Read/Write operation with nr_blocks=0 should return 0 and hence is not considered as an error. Signed-off-by: NLukasz Majewski <l.majewski@samsung.com> Test HW: Odroid XU3 - Exynos 5433
-
由 Simon Glass 提交于
Now that we have a new header file for cache-aligned allocation, we should move the stack-based allocation macro there also. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Stephen Warren 提交于
The FAT code contains a special case to parse the root directory. This is needed since the root directory location/layout on disk is special cased for FAT12/16. In particular, the location and size of the FAT12/16 root directory is hard-coded and contiguous, whereas all FAT12/16 non-root directories, and all FAT32 directories, are stored in a non-contiguous fashion, with the layout represented by a linked-list of clusters in the FAT. If a file path contains ../ (for example /extlinux/../bcm2835-rpi-cm.dtb), it is possible to need to parse the root directory for the first element in the path (requiring application of the special case), then a sub- directory (in the general way), then re-parse the root directory (again requiring the special case). However, the current code in U-Boot only applies the special case for the very first path element, and never for any later path element. When reparsing the root directory without applying the special case, any file in a sector (or cluster?) other than the first sector/cluster of the root directory will not be found. This change modifies the non-root-dir-parsing loop of do_fat_read_at() to detect if it's walked back to the root directory, and if so, jumps back to the special case code that handles parsing of the root directory. This change was tested using sandbox by executing: ./u-boot -c "host bind 0 ../sd-p1.bin; ls host 0:0" ./u-boot -c "host bind 0 ../sd-p1.bin; ls host 0:0 /" ./u-boot -c "host bind 0 ../sd-p1.bin; ls host 0:0 /extlinux" ./u-boot -c "host bind 0 ../sd-p1.bin; ls host 0:0 /extlinux/" ./u-boot -c "host bind 0 ../sd-p1.bin; ls host 0:0 /extlinux/.." ./u-boot -c "host bind 0 ../sd-p1.bin; ls host 0:0 /extlinux/../" ./u-boot -c "host bind 0 ../sd-p1.bin; ls host 0:0 /extlinux/../backup" ./u-boot -c "host bind 0 ../sd-p1.bin; ls host 0:0 /extlinux/../backup/" ./u-boot -c "host bind 0 ../sd-p1.bin; ls host 0:0 /extlinux/../backup/.." ./u-boot -c "host bind 0 ../sd-p1.bin; ls host 0:0 /extlinux/../backup/../" ./u-boot -c "host bind 0 ../sd-p1.bin; load host 0:0 0 /bcm2835-rpi-cm.dtb" ./u-boot -c "host bind 0 ../sd-p1.bin; load host 0:0 0 /extlinux/../bcm2835-rpi-cm.dtb" ./u-boot -c "host bind 0 ../sd-p1.bin; load host 0:0 0 /backup/../bcm2835-rpi-cm.dtb" ./u-boot -c "host bind 0 ../sd-p1.bin; load host 0:0 0 /extlinux/..backup/../bcm2835-rpi-cm.dtb" ./u-boot -c "host bind 0 ../sd-p1.bin; load host 0:0 0 /extlinux/../backup/../bcm2835-rpi-cm.dtb" (/extlinux and /backup are in different sectors so trigger some different cases, and bcm2835-rpi-cm.dtb is in a sector of the root directory other than the first). In all honesty, this change is a bit of a hack, using goto and all. However, as demonstrated above it appears to work well in practice, is quite minimal, likely doesn't introduce any risk of regressions, and hopefully doesn't introduce any maintenance issues. The correct fix would be to collapse the root and non-root loops in do_fat_read_at() and get_dentfromdir() into a single loop that has a small special-case when moving from one sector to the next, to handle the layout difference of root/non-root directories. AFAIK all other aspects of directory parsing are identical. However, that's a much larger change which needs significantly more thought before it's implemented. Signed-off-by: NStephen Warren <swarren@wwwdotorg.org>
-
- 06 1月, 2015 1 次提交
-
-
由 Przemyslaw Marczak 提交于
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: NPrzemyslaw 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: NSimon Glass <sjg@chomium.org>
-
- 23 11月, 2014 3 次提交
-
-
由 Suriyan Ramasami 提交于
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: NSuriyan Ramasami <suriyan.r@gmail.com> Acked-by: NSimon Glass <sjg@chromium.org> [trini: Update board/gdsys/p1022/controlcenterd-id.c, drivers/fpga/zynqpl.c for changes] Signed-off-by: NTom Rini <trini@ti.com>
-
由 Suriyan Ramasami 提交于
Change the internal FAT functions to use loff_t for offsets. Signed-off-by: NSuriyan Ramasami <suriyan.r@gmail.com> Acked-by: NSimon Glass <sjg@chromium.org> [trini: Fix fs/fat/fat.c for min3 updates] Signed-off-by: NTom Rini <trini@ti.com>
-
由 Masahiro Yamada 提交于
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: NMasahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: NPavel Machek <pavel@denx.de> Acked-by: NLukasz Majewski <l.majewski@samsung.com> Tested-by: NLukasz Majewski <l.majewski@samsung.com> [trini: Fixup arch/blackfin/lib/string.c] Signed-off-by: NTom Rini <trini@ti.com>
-
- 09 8月, 2014 1 次提交
-
-
由 Stephen Warren 提交于
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: NStephen Warren <swarren@nvidia.com>
-
- 19 2月, 2014 1 次提交
-
-
由 Stephen Warren 提交于
This hooks into the generic "file exists" support added in an earlier patch, and provides an implementation for the FAT filesystem. Signed-off-by: NStephen Warren <swarren@nvidia.com> Acked-by: NSimon Glass <sjg@chromium.org>
-
- 24 7月, 2013 1 次提交
-
-
由 Wolfgang Denk 提交于
Signed-off-by: NWolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: NTom Rini <trini@ti.com>
-
- 05 3月, 2013 1 次提交
-
-
由 Simon Glass 提交于
It doesn't make a lot of sense to have these methods in fs.c. They are filesystem-specific, not generic code. Add each to the relevant filesystem and remove the associated #ifdefs in fs.c. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NTom Rini <trini@ti.com>
-
- 04 2月, 2013 2 次提交
-
-
由 Richard Genoud 提交于
ifdefs in the code are making it harder to read. The use of simple if(vfat_enabled) makes no more code and is cleaner. (the code is discarded by the compiler instead of the preprocessor.) NB: if -O0 is used, the code won't be discarded and bonus, now the code compiles even if CONFIG_SUPPORT_VFAT is not defined. Signed-off-by: NRichard Genoud <richard.genoud@gmail.com>
-
由 Richard Genoud 提交于
toupper/tolower function are already declared, so use them. Signed-off-by: NRichard Genoud <richard.genoud@gmail.com> Acked-by: NMarek Vasut <marex@denx.de> Acked-by: NStefano Babic <sbabic@denx.de>
-
- 01 2月, 2013 1 次提交
-
-
由 Marek Vasut 提交于
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: NAaron Williams <Aaron.Williams@cavium.com> Signed-off-by: NMarek Vasut <marex@denx.de> Cc: Tom Rini <tom.rini@gmail.com> Cc: Aaron Williams <Aaron.Williams@cavium.com> Tested-by: NMichal Simek <michal.simek@xilinx.com> Reviewed-by: NJoe Hershberger <joe.hershberger@ni.com>
-
- 26 10月, 2012 3 次提交
-
-
由 Stephen Warren 提交于
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: NStephen Warren <swarren@nvidia.com> Reviewed-by: NBenoît Thébaudeau <benoit.thebaudeau@advansee.com>
-
由 Stephen Warren 提交于
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: NStephen Warren <swarren@nvidia.com> Reviewed-by: NBenoît Thébaudeau <benoit.thebaudeau@advansee.com>
-
由 Stephen Warren 提交于
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: NStephen Warren <swarren@nvidia.com> Reviewed-by: NBenoît Thébaudeau <benoit.thebaudeau@advansee.com>
-
- 17 10月, 2012 1 次提交
-
-
由 Marek Vasut 提交于
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: NMarek Vasut <marex@denx.de> Cc: Tom Rini <trini@ti.com>
-
- 09 10月, 2012 1 次提交
-
-
由 Stephen Warren 提交于
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: NStephen Warren <swarren@nvidia.com>
-
- 27 9月, 2012 1 次提交
-
-
由 Benoît Thébaudeau 提交于
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: NBenoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de> Signed-off-by: NTom Rini <trini@ti.com>
-
- 19 9月, 2012 1 次提交
-
-
由 Benoît Thébaudeau 提交于
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: NBenoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de>
-
- 02 9月, 2012 4 次提交
-
-
由 Benoît Thébaudeau 提交于
One call to get_cluster can be factorized with another, so avoid duplicating code. Signed-off-by: NBenoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de>
-
由 Benoît Thébaudeau 提交于
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: NBenoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de>
-
由 Benoît Thébaudeau 提交于
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: NBenoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de>
-
由 Benoît Thébaudeau 提交于
fatlength is not used after this assignment, so it is useless and can be removed. Signed-off-by: NBenoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de>
-