19 Feb, 2014

1 commit


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

    Piotr Wilczek
     

01 Nov, 2013

1 commit


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

    Wu, Josh
     

24 Jul, 2013

1 commit


02 May, 2013

1 commit


05 Mar, 2013

1 commit


04 Feb, 2013

2 commits


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

    Marek Vasut
     

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

    Stephen Warren
     

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

    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: Stephen Warren
    Reviewed-by: Benoît Thébaudeau

    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: Stephen Warren
    Reviewed-by: Benoît Thébaudeau

    Stephen Warren
     

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

    Marek Vasut
     

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

    Albert ARIBAUD
     

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

    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

    Benoît Thébaudeau
     

19 Sep, 2012

1 commit


02 Sep, 2012

6 commits


22 Jun, 2012

1 commit


30 Apr, 2012

1 commit


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

    Anatolij Gustschin
     

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 Schwerin

    Fixed patch author and added all needed SoB from the original patch
    and also submitter's SoB. Extended commit log.
    Signed-off-by: Anatolij Gustschin

    Donggeun Kim
     

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

    Donggeun Kim
     
  • 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

    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

    Kyle Moffett
     

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

    Sergei Shtylyov
     

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 header

    Conflicts:
    tools/mkenvimage.c

    Signed-off-by: Wolfgang Denk

    Wolfgang Denk
     

21 Dec, 2011

1 commit

  • Writing a file to the FAT partition didn't work while a
    test using a CF card. The test was done on mpc5200 based
    board (powerpc). There is a number of problems in FAT
    write code:

    Compiler warning:
    fat_write.c: In function 'file_fat_write':
    fat_write.c:326: warning: 'counter' may be used uninitialized
    in this function
    fat_write.c:326: note: 'counter' was declared here

    'l_filename' string is not terminated, so a file name
    with garbage at the end is used as a file name as shown
    by debug code.

    Return value of set_contents() is not checked properly
    so actually a file won't be written at all (as checked
    using 'fatls' after a write attempt with 'fatwrite'
    command).

    do_fat_write() doesn't return the number of written bytes
    if no error happened. However the return value of this
    function is used to show the number of written bytes
    in do_fat_fswrite().

    The patch adds some debug code and fixes above mentioned
    problems and also fixes a typo in error output.

    NOTE: after a successful write to the FAT partition (under
    U-Boot) the partition was checked under Linux using fsck.
    The partition needed fixing FATs:
    -bash-3.2# fsck -a /dev/sda1
    fsck 1.39 (29-May-2006)
    dosfsck 2.11, 12 Mar 2005, FAT32, LFN
    FATs differ but appear to be intact. Using first FAT.
    Performing changes.

    Signed-off-by: Anatolij Gustschin
    Cc: Donggeun Kim
    Cc: Aaron Williams
    Acked-by: Donggeun Kim

    Anatolij Gustschin
     

18 Dec, 2011

1 commit

  • The DIRENTSPERBLOCK utilizes sizeof() which will return a size_t which has no
    fixed size. Therefor use correct length modifer for printf() statement to
    prevent compiler warnings.

    This patch fixes following warning:

    ---88---

    Signed-off-by: Andreas Bießmann
    cc: Mike Frysinger
    cc: Thomas Chou
    cc: rjones@nexus-tech.net
    cc: kharris@nexus-tech.net
    Acked-by: Mike Frysinger

    Andreas Bießmann
     

08 Nov, 2011

1 commit


28 Oct, 2011

2 commits


27 Oct, 2011

1 commit

  • In some cases, saving data in RAM as a file with FAT format is required.
    This patch allows the file to be written in FAT formatted partition.

    The usage is similar with reading a file.
    First, fat_register_device function is called before file_fat_write function
    in order to set target partition.
    Then, file_fat_write function is invoked with desired file name,
    start ram address for writing data, and file size.

    Signed-off-by: Donggeun Kim
    Signed-off-by: Kyungmin Park

    Donggeun Kim