25 Sep, 2014
1 commit
-
This would be useful to start moving various config options.
Signed-off-by: Masahiro Yamada
Acked-by: Simon Glass
Tested-by: Simon Glass
09 Aug, 2014
1 commit
-
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
06 Jun, 2014
1 commit
-
- update the comments regarding lbaint_t usage
- cleanup casting of values related to the lbaint_t type
- cleanup of a type that requires a u64Tested on little endian ARMv7 and ARMv8 configurations
Signed-off-by: Steve Rae
13 May, 2014
3 commits
-
When write a file into FAT file system, it will search a match file in
root dir. So the find_directory_entry() will get the first cluster of
root dir content and search the directory item one by one. If the file
is not found, we will call get_fatent_value() to get next cluster of root
dir via lookup the FAT table and continue the search.The issue is in FAT16/12 system, we cannot get root dir's next clust
from FAT table. The FAT table only be use to find the clust of data
aera in FAT16/12.In FAT16/12 if the clust is in root dir, the clust number is a negative
number or 0, 1. Since root dir is located in front of the data area.
Data area start clust #2. So the root dir clust number should < 2.This patch will check above situation before call get_fatenv_value().
If curclust is < 2, include minus number, we just increase one on the
curclust since root dir is in continous cluster.The patch also add a sanity check for entry in get_fatenv_value().
Signed-off-by: Josh Wu
-
In fat_write.c, the last clust condition check is incorrect:
if ((curclust >= 0xffffff8) || (curclust >= 0xfff8)) {
... ...
}For example, in FAT32 if curclust is 0x11000. It is a valid clust.
But on above condition check, it will be think as a last clust.So the correct last clust check should be:
in fat32, curclust >= 0xffffff8
in fat16, curclust >= 0xfff8
in fat12, curclust >= 0xff8This patch correct the last clust check.
Signed-off-by: Josh Wu
-
Use of malloc of do_fat_write() causes cache error on ARM v7 platforms.
Perhaps, the same problem will occur at any other CPUs.
This replaces malloc with memalign to fix cache buffer alignment.Signed-off-by: Nobuhiro Iwamatsu
Signed-off-by: Yoshiyuki Ito
Tested-by: Hector Palacios
19 Feb, 2014
1 commit
-
This hooks into the generic "file exists" support added in an earlier
patch, and provides an implementation for the FAT filesystem.Signed-off-by: Stephen Warren
Acked-by: Simon Glass
09 Nov, 2013
1 commit
-
Curently memcpy copies string without null terminating char because
function strlen returns only number of characters excluding
null terminating character. Replace memcpy with strcpy.Signed-off-by: Piotr Wilczek
Signed-off-by: Kyungmin Park
CC: Tom Rini
01 Nov, 2013
1 commit
-
Signed-off-by: Masahiro Yamada
07 Sep, 2013
1 commit
-
In the set_cluster() function, it will convert the buffer size to sector
numbers. Then call disk_write() to write by sector.
For remaining buffer, the size is less than a sector, call disk_write()
again to write them in one sector.But if the total buffer size is less then one sector, the original code
will call disk_write() with zero sector number. It is unnecessary.
So this patch fix this. Now it will not call disk_write() if total buffer size
is less than one sector.Signed-off-by: Josh Wu
24 Jul, 2013
1 commit
-
Signed-off-by: Wolfgang Denk
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini
02 May, 2013
1 commit
-
Bugfix:
Here at this place we need the fat size in sectors not bytes.
This was found during code review when adding support for storage
devices with blocksizes != 512.Signed-off-by: Egbert Eich
05 Mar, 2013
1 commit
-
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: Simon Glass
Reviewed-by: Tom Rini
04 Feb, 2013
2 commits
-
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 discardedand bonus, now the code compiles even if CONFIG_SUPPORT_VFAT is not
defined.Signed-off-by: Richard Genoud
-
toupper/tolower function are already declared, so use them.
Signed-off-by: Richard Genoud
Acked-by: Marek Vasut
Acked-by: Stefano Babic
01 Feb, 2013
1 commit
-
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
Signed-off-by: Marek Vasut
Cc: Tom Rini
Cc: Aaron Williams
Tested-by: Michal Simek
Reviewed-by: Joe Hershberger
30 Oct, 2012
1 commit
-
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
Reviewed-by: Benoît Thébaudeau
26 Oct, 2012
3 commits
-
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
Reviewed-by: Benoît Thébaudeau -
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
Reviewed-by: Benoît Thébaudeau -
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
Reviewed-by: Benoît Thébaudeau
17 Oct, 2012
1 commit
-
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
Cc: Tom Rini
16 Oct, 2012
1 commit
-
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
[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
09 Oct, 2012
1 commit
-
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
27 Sep, 2012
1 commit
-
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
Cc: Wolfgang Denk
Signed-off-by: Tom Rini
19 Sep, 2012
1 commit
-
With:
fatls mmc 0 /dir/file
dir: regular directory
file: regular fileThe 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
Cc: Wolfgang Denk
02 Sep, 2012
6 commits
-
One call to get_cluster can be factorized with another, so avoid
duplicating code.Signed-off-by: Benoît Thébaudeau
Cc: Wolfgang Denk -
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
Cc: Wolfgang Denk -
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
Cc: Wolfgang Denk -
fatlength is not used after this assignment, so it is useless and can
be removed.Signed-off-by: Benoît Thébaudeau
Cc: Wolfgang Denk -
startblock must be taken into account in order not to read past the
end of the FAT.Signed-off-by: Benoît Thébaudeau
Cc: Wolfgang Denk -
Remove spaces before opening parentheses in function calls.
Signed-off-by: Benoît Thébaudeau
Cc: Wolfgang Denk
22 Jun, 2012
1 commit
-
This driver is unused and obsolete.
Signed-off-by: Marek Vasut
Cc: Wolfgang Denk
Cc: unsik Kim
30 Apr, 2012
1 commit
-
Signed-off-by: Eric Nelson
Acked-by: Mike Frysinger
26 Mar, 2012
1 commit
-
Fix:
fat_write.c: In function 'find_directory_entry':
fat_write.c:826:8: warning: variable 'prevcksum' set but not used
[-Wunused-but-set-variable]
fat_write.c: In function 'do_fat_write':
fat_write.c:933:6: warning: variable 'root_cluster' set but not used
[-Wunused-but-set-variable]
fat_write.c:925:12: warning: variable 'slotptr' set but not used
[-Wunused-but-set-variable]Signed-off-by: Anatolij Gustschin
Cc: Donggeun Kim
Acked-by: Maximilian Schwerin
Acked-by: Kyungmin Park
25 Mar, 2012
1 commit
-
This patch removes compile errors introduced by
commit 9813b750f32c0056f0a35813b9a9ec0f68b664af
'fs/fat: Fix FAT detection to support non-DOS partition tables'fat_write.c: In function 'disk_write':
fat_write.c:54: error: 'part_offset' undeclared (first use in this function)
fat_write.c:54: error: (Each undeclared identifier is reported only once
fat_write.c:54: error: for each function it appears in.)
fat_write.c: In function 'do_fat_write':
fat_write.c:950: error: 'part_size' undeclared (first use in this function)These errors only appear when this code is enabled by
defining CONFIG_FAT_WRITE option.This patch was originally part of
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/121847
Signed-off-by: Donggeun Kim
Signed-off-by: Kyungmin Park
Signed-off-by: Maximilian SchwerinFixed patch author and added all needed SoB from the original patch
and also submitter's SoB. Extended commit log.
Signed-off-by: Anatolij Gustschin
06 Jan, 2012
3 commits
-
After susccessful write to the FAT partition,
fsck program may print warning message due to different FAT,
provided that the filesystem supports two FATs.This patch makes the second FAT to be same with the first one
when writing a file.Signed-off-by: Donggeun Kim
Signed-off-by: Kyungmin Park -
The FAT filesystem fails silently in inexplicable ways when given a
filesystem with a block-size that does not match the device sector size.
In theory this is not an unsupportable combination but requires a major
rewrite of a lot of the filesystem. Until that occurs, the filesystem
should detect that scenario and display a helpful error message.This scenario in particular occurred on a 512-byte blocksize FAT fs
stored in an El-Torito boot volume on a CD-ROM (2048-byte sector size).Additionally, in many circumstances the ->block_read method will not
return a negative number to indicate an error but instead return 0 to
indicate the number of blocks successfully read (IE: None).The FAT filesystem should defensively check to ensure that it got all of
the sectors that it asked for when reading.Signed-off-by: Kyle Moffett
-
The FAT filesystem code currently ends up requiring that the partition
table be a DOS MBR, as it checks for the DOS 0x55 0xAA signature on the
partition table (which may be Mac, EFI, ISO9660, etc) before actually
computing the partition offset.This fixes support for accessing a FAT filesystem in an ISO9660 boot
volume (El-Torito format) by reordering the filesystem checks and
reading the 0x55 0xAA "DOS boot signature" and FAT/FAT32 magic number
from the first sector of the partition instead of from sector 0.Signed-off-by: Kyle Moffett
Fix build warning: fat.c: In function 'fat_register_device':
fat.c:66:15: warning: variable 'found_partition' set but not used
[-Wunused-but-set-variable]
Signed-off-by: Wolfgang Denk
05 Jan, 2012
1 commit
-
The VFAT short alias checksum read from a long file name is only overwritten
when another long file name appears in a directory list. Until then it renders
short file names invisible that have the same checksum. Reset the checksum on
first match.Signed-off-by: Sergei Shtylyov
Signed-off-by: Martin Mueller
24 Dec, 2011
1 commit
-
* 'next' of ../next:
mkenvimage: Add version info switch (-V)
mkenvimage: Fix getopt() error handling
mkenvimage: Fix some typos
phy: add Micrel KS8721BL phy definition
net: introduce per device index
mvgbe: remove setting of ethaddr within the driver
x86: Add support for specifying an initrd with the zboot command
x86: Refactor the zboot innards so they can be reused with a vboot image
x86: Add infrastructure to extract an e820 table from the coreboot tables
x86: Add support for booting Linux using the 32 bit boot protocol
x86: Clean up the x86 zimage code in preparation to extend it
x86: Import code from coreboot's libpayload to parse the coreboot table
x86: Initial commit for running as a coreboot payload
CHECKPATCH: ./board/esd/hh405/logo_320_240_8bpp.c
CHECKPATCH: ./board/esd/hh405/logo_1024_768_8bpp.c
CHECKPATCH: ./board/esd/hh405/logo_320_240_4bpp.c
CHECKPATCH: ./board/esd/hh405/logo_640_480_24bpp.c
CHECKPATCH: ./board/esd/apc405/logo_640_480_24bpp.c
CHECKPATCH: ./board/esd/voh405/logo_320_240_4bpp.c
CHECKPATCH: ./board/esd/voh405/logo_640_480_24bpp.c
CHECKPATCH: ./board/esd/hh405/fpgadata.c
CHECKPATCH: ./board/esd/pci405/fpgadata.c
CHECKPATCH: ./board/esd/tasreg/fpgadata.c
CHECKPATCH: ./board/esd/apc405/fpgadata.c
CHECKPATCH: ./board/esd/voh405/fpgadata.c
CHECKPATCH: ./board/esd/ash405/fpgadata.c
CHECKPATCH: ./board/esd/dasa_sim/fpgadata.c
CHECKPATCH: ./board/esd/ar405/fpgadata_xl30.c
CHECKPATCH: ./board/esd/ar405/fpgadata.c
CHECKPATCH: ./board/esd/plu405/fpgadata.c
CHECKPATCH: ./board/esd/wuh405/fpgadata.c
CHECKPATCH: ./board/esd/cpci405/fpgadata_cpci405.c
CHECKPATCH: ./board/esd/cpci405/fpgadata_cpci405ab.c
CHECKPATCH: ./board/esd/cpci405/fpgadata_cpci4052.c
CHECKPATCH: ./board/esd/canbt/fpgadata.c
CHECKPATCH: ./board/esd/du405/fpgadata.c
CHECKPATCH: ./board/esd/cpciiser4/fpgadata.c
CHECKPATCH: ./board/dave/PPChameleonEVB/fpgadata.c
avr32:mmu.c: fix printf() length modifier
fat.c: fix printf() length modifier
cmd_sf.c: fix printf() length modifier
Make printf and vprintf safe from buffer overruns
vsprintf: Move function documentation into header file
Add safe vsnprintf and snprintf library functions
Move vsprintf functions into their own headerConflicts:
tools/mkenvimage.cSigned-off-by: Wolfgang Denk