Commit Graph

219 Commits

Author SHA1 Message Date
Wolfgang Denk 9d0265e9bb YAFFS2: fs/yaffs2/Makefile - fix build warnings
Drop the "-DNO_Y_INLINE" setting to fix these:
yaffs_guts.h:806: warning: 'yaffs_GetBlockInfo' defined but not used

Impact on image size is negligible - for the VCMA9 board the text
segment size grew from 496353 to 496357 bytes (i. e. 0.0008%);
total image size even remained constant.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-09-10 00:00:22 +02:00
Wolfgang Denk 6ac360c465 YAFFS2: fs/yaffs2/yaffscfg.c - fix build warnings
Fix these:
yaffscfg.c: In function 'cmd_yaffs_mread_file':
yaffscfg.c:316: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'char *'
yaffscfg.c: In function 'cmd_yaffs_ls': yaffscfg.c:371: warning: format '%7d' expects type 'int', but argument 3 has type 'off_t'

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-09-10 00:00:18 +02:00
Wolfgang Denk 3267bc1b2b ubifs: Fix bad free() sequence in ubifs_finddir()
Free private_data member element before freeing file structure.
This was causing malloc to crash. Also remove unnecessary variable
assigments as file structure gets free'd as well.

Signed-off-by: Rod Boyce <uboot@teamboyce.co.uk>
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
2011-08-19 17:21:02 +02:00
Albert ARIBAUD fa82f871c8 Convert ISO-8859 files to UTF-8
There was a mix of UTF-8 and ISO-8859 files in the U-Boot source
tree, which could cause issues with the patchwork review system.
This commit converts all ISO-8859 files to UTF-8.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
2011-08-04 23:34:02 +02:00
Anton Staaf d961c188b2 ext2: Simplify partial sector access logic
Previously reading or writing zero full sectors (reading the end of
one sector and the beginning of the next for example) was special
cased and involved stack allocating a second sector buffer.  This
change uses the same code path for this case as well as when there
are a non-zero number of full sectors to access.  The result is
easier to read and reduces the maximum stack used.

Signed-off-by: Anton Staaf <robotboy@chromium.org>
Cc: Andy Fleming <afleming@freescale.com>
Acked-by: Detlev Zundel <dzu@denx.de>
2011-07-28 15:36:32 +02:00
Anton Staaf 9bac35f57b ext2: Fix checkpatch violations
Fix all checkpatch violations in the low level Ext2 block
device reading code.  This is done in preparation for cleaning
up the partial sector access code.

Signed-off-by: Anton Staaf <robotboy@chromium.org>
Cc: Andy Fleming <afleming@freescale.com>
Acked-by: Detlev Zundel <dzu@denx.de>
2011-07-28 15:36:10 +02:00
Aneesh V 05bad4aa56 scaled down version of generic libraries for SPL
Signed-off-by: Aneesh V <aneesh@ti.com>
2011-07-26 14:44:25 +02:00
Heiko Schocher 62a813bcac cramfs: make cramfs usable without a NOR flash
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
2011-05-10 22:47:32 +02:00
Loïc Minier 6052cbab40 Fix misc spelling errors found by lintian
Signed-off-by: Loc Minier <loic.minier@linaro.org>
2011-04-12 22:58:31 +02:00
Erik Hansen 3f270f42d7 fat32 root directory handling
Fat directory handling didn't check reaching the end of the root directory. It
relied on a stop condition based on a directory entry with a name starting with
a '\0' character. This check in itself is wrong ('\0' indicates free entry, not
end_of_directory) but outside the scope of this fix. For FAT32, the end of the
rootdir is reached when the end of the cluster chain is reached. The code didn't
check this condition and started to read an incorrect cluster. This caused a
subsequent read request of a sector outside the range of the usb stick in
use. On its turn, the usb stick protested with a stall handshake.

Both FAT32 and non-FAT32 (FAT16/FAT12) end or rootdir checks have been put in.

Signed-off-by: Erik Hansen <erik@makarta.com>
2011-04-02 09:38:24 +02:00
Dirk Behme c7b7d4550d UBIFS: Fix dereferencing type-punned pointer compiler warning
Fix compiler warning

In file included from ubifs.h:2137:0,
                 from ubifs.c:26:
misc.h: In function 'ubifs_idx_key':
misc.h:263:26: warning: dereferencing type-punned pointer will break strict-aliasing rules

seen with gcc version 4.5.1 (Sourcery G++ Lite 2010.09-50).

No functional change.

CC: Stefan Roese <sr@denx.de>
Signed-off-by: Dirk Behme <dirk.behme@googlemail.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2011-01-11 11:09:36 +01:00
Wolfgang Denk 006915fbb0 Merge branch 'master' of ../master into next 2010-12-16 23:00:53 +01:00
Ricardo Ribalda Delgado 64b6817848 ubifs.c: BUG: Error following links
The link_name variable is declared inside the if block and it is used
outside it through the name pointer.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2010-12-03 18:24:04 +01:00
Stefan Roese b1a14f8a1c UBIFS: Change ubifsload to not read beyond the requested size
Until now ubifsload pads the destination with 0 up to a multiple of
UBIFS_BLOCK_SIZE (4KiB) while reading a file to memory. This patch
changes this behaviour to only read to the requested length. This
is either the file length or the length/size provided as parameter
to the ubifsload command.

Signed-off-by: Stefan Roese <sr@denx.de>
2010-12-03 16:33:47 +01:00
Stefan Roese cb9c09d487 UBIFS: Add ubifsumount command to unmount an active volume
This new ubifsumount command allows the user to unmount a previously
mounted UBIFS volume.

Signed-off-by: Stefan Roese <sr@denx.de>
2010-12-03 16:32:09 +01:00
Mike Frysinger c87f6457bb ext2: constify file/dir names
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-11-28 21:58:51 +01:00
Sebastien Carlier 6d8962e814 Switch from archive libraries to partial linking
Before this commit, weak symbols were not overridden by non-weak symbols
found in archive libraries when linking with recent versions of
binutils.  As stated in the System V ABI, "the link editor does not
extract archive members to resolve undefined weak symbols".

This commit changes all Makefiles to use partial linking (ld -r) instead
of creating library archives, which forces all symbols to participate in
linking, allowing non-weak symbols to override weak symbols as intended.
This approach is also used by Linux, from which the gmake function
cmd_link_o_target (defined in config.mk and used in all Makefiles) is
inspired.

The name of each former library archive is preserved except for
extensions which change from ".a" to ".o".  This commit updates
references accordingly where needed, in particular in some linker
scripts.

This commit reveals board configurations that exclude some features but
include source files that depend these disabled features in the build,
resulting in undefined symbols.  Known such cases include:
- disabling CMD_NET but not CMD_NFS;
- enabling CONFIG_OF_LIBFDT but not CONFIG_QE.

Signed-off-by: Sebastien Carlier <sebastien.carlier@gmail.com>
2010-11-17 21:02:18 +01:00
Wolfgang Denk 2e5167ccad Replace CONFIG_RELOC_FIXUP_WORKS by CONFIG_NEEDS_MANUAL_RELOC
By now, the majority of architectures have working relocation
support, so the few remaining architectures have become exceptions.
To make this more obvious, we make working relocation now the default
case, and flag the remaining cases with CONFIG_NEEDS_MANUAL_RELOC.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Tested-by: Heiko Schocher <hs@denx.de>
Tested-by: Reinhard Meyer <u-boot@emk-elektronik.de>
2010-10-29 21:32:07 +02:00
Stefano Babic 11c8dd36ed FAT: buffer overflow with FAT12/16
Last commit 3831530dcb7b71329c272ccd6181f8038b6a6dd0a was intended
"explicitly specify FAT12/16 root directory parsing buffer size, instead
of relying on cluster size". Howver, the underlying function requires
the size of the buffer in blocks, not in bytes, and instead of passing
a double sector size a request for 1024 blocks is sent. This generates
a buffer overflow with overwriting of other structure (in the case seen,
USB structures were overwritten).

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Mikhail Zolotaryov <lebon@lebon.org.ua>
2010-10-20 09:14:38 +02:00
Mikhail Zolotaryov 3831530dcb VFAT: fix processing of scattered long file name entries
The U-Boot code has the following bugs related to the processing of Long File
Name (LFN) entries scattered across several clusters/sectors :

1) get_vfatname() function is designed to gather scattered LFN entries by
cluster chain processing - that doesn't work for FAT12/16 root directory.
In other words, the function expects the following input data:
 1.1) FAT32 directory (which is cluster chain based);
        OR
 1.2) FAT12/16 non-root directory (which is also cluster chain based);
        OR
 1.3) FAT12/16 root directory (allocated as contiguous sectors area), but
 all necessary information MUST be within the input buffer of filesystem cluster
 size (thus cluster-chain jump is never initiated).

In order to accomplish the last condition, root directory parsing code in
do_fat_read() uses the following trick: read-out cluster-size block, process
only first sector (512 bytes), then shift 512 forward, read-out cluster-size
block and so on. This works great unless cluster size is equal to 512 bytes
(in a case you have a small partition), or long file name entries are scattered
across three sectors, see 4) for details.

2) Despite of the fact that get_vfatname() supports FAT32 root directory
browsing, do_fat_read() function doesn't send current cluster number correctly,
so root directory look-up doesn't work correctly.

3) get_vfatname() doesn't gather scattered entries correctly also is the case
when all LFN entries are located at the end of the source cluster, but real
directory entry (which must be returned) is at the only beginning of the
next one. No error detected, the resulting directory entry returned contains
a semi-random information (wrong size, wrong start cluster number and so on)
i.e. the entry is not accessible.

4) LFN (VFAT) allows up to 20 entries (slots) each containing 26 bytes (13
UTF-16 code units) to represent a single long file name i.e. up to 520 bytes.
U-Boot allocates 256 bytes buffer instead, i.e. 10 or more LFN slots record
may cause buffer overflow / memory corruption.
Also, it's worth to mention that 20+1 slots occupy 672 bytes space which may
take more than one cluster of 512 bytes (medium-size FAT32 or small FAT16
partition) - get_vfatname() function doesn't support such case as well.

The patch attached fixes these problems in the following way:
- keep using 256 bytes buffer for a long file name, but safely prevent a
possible buffer overflow (skip LFN processing, if it contains 10 or more
slots).

- explicitly specify FAT12/16 root directory parsing buffer size, instead
of relying on cluster size. The value used is a double sector size (to store
current sector and the next one). This fixes the first problem and increases
performance on big FAT12/16 partitions;

- send current cluster number (FAT32) to get_vfatname() during root
directory processing;

- use LFN counter to seek the real directory entry in get_vfatname() - fixes the
third problem;

- skip deleted entries in the root directory (to prevent bogus buffer
overflow detection and LFN counter steps).

Note: it's not advised to split up the patch, because a separate part may
operate incorrectly.

Signed-off-by: Mikhail Zolotaryov <lebon@lebon.org.ua>
2010-10-12 22:39:14 +02:00
Aaron Pace a2740dd00d ext2fs: Fix optimization bug for doubly-indirect block pointers
Doubly-indirect block numbers are compared against the first-level
indirect block when checking for a cached copy.  This is causing the
doubly-indirect block to be re-read each time it is accessed.
Repairing this reduces load time for a 70M file from 72 seconds
to 38 seconds.

Signed-off-by: Aaron Pace <Aaron.Pace@alcatel-lucent.com>
2010-08-07 22:44:08 +02:00
Wolfgang Denk 7385c28e9b fs/fat: Big code cleanup.
- reformat
- throw out macros like FAT_DPRINT and FAT_DPRINT
- remove dead code

Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-07-24 20:54:46 +02:00
Wolfgang Denk 2aa98c6612 FAT32: fix broken root directory handling.
On FAT32, instead of fetching the cluster numbers from the FAT, the
code assumed (incorrectly) that the clusters for the root directory
were allocated contiguously. In the result, only the first cluster
could be accessed. At the typical cluster size of 8 sectors this
caused all accesses to files after the first 128 entries to fail -
"fatls" would terminate after 128 files (usually displaying a bogus
file name, occasionally even crashing the system), and "fatload"
would fail to find any files that were not in the first directory
cluster.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-07-24 20:53:50 +02:00
Wolfgang Denk 66c2d73cfc FAT32: fix support for superfloppy-format (PBR)
"Superfloppy" format (in U-Boot called PBR) did not work for FAT32 as
the file system type string is at a different location. Add support
for FAT32.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-07-24 20:53:43 +02:00
Thomas Chou 1117cbf2ad nios: remove nios-32 arch
The nios-32 arch is obsolete and broken. So it is removed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
2010-05-28 10:56:04 -04:00
Stefano Babic 6865168359 ubifsmount fails due to not initialized list
ubifsmount is not working and causes an access with
a pointer set to zero because the ubifs_fs_type
is not initialized correctly.

Signed-off-by: Stefano Babic <sbabic@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
2010-04-28 10:00:13 +02:00
Heiko Schocher 2d2018f3db jffs2, suen3: Fix compiler warning
$ ./MAKEALL suen3
jffs2_1pass.c: In function 'get_fl_mem':
jffs2_1pass.c:399: warning: unused variable 'id'
jffs2_1pass.c: In function 'get_node_mem':
jffs2_1pass.c:423: warning: unused variable 'id'

Signed-off-by: Heiko Schocher <hs@denx.de>
Tested-by: Tom <Tom.Rix@windriver.com>
2010-03-31 15:13:31 +02:00
Wolfgang Denk f098337152 JFFS2: drop support for LZARI compression mode
Support for LZARI compression mode was added based on a MTD CVS
snapshot of March 13, 2005. However, fs/jffs2/compr_lzari.c contains
contradictory licensing terms: the original copyright clause says "All
rights reserved. Permission granted for non-commercial use.", but
later reference to the file 'LICENCE' in the jffs2 directory was added
which says GPL v2 or later.

As no boards ever used LZARI compression, and this file is also not
present in recent MTD code, we resolve this conflict by removing the
conflicting file and references to it.

Also copy the referenced but missing file 'LICENCE' from the current
MTD source tree.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-01-15 11:16:47 +01:00
Wolfgang Wegner 87d93a1ba2 move prototypes for gunzip() and zunzip() to common.h
Prototype for gunzip/zunzip was only in lib_generic/gunzip.c and thus
repeated in every file using it. This patch moves the prototypes to
common.h and removes all prototypes distributed anywhere else.

Signed-off-by: Wolfgang Wegner <w.wegner@astro-kom.de>
2009-12-21 21:39:59 +01:00
Heiko Schocher 4b142febff common: delete CONFIG_SYS_64BIT_VSPRINTF and CONFIG_SYS_64BIT_STRTOUL
There is more and more usage of printing 64bit values,
so enable this feature generally, and delete the
CONFIG_SYS_64BIT_VSPRINTF and CONFIG_SYS_64BIT_STRTOUL
defines.

Signed-off-by: Heiko Schocher <hs@denx.de>
2009-12-08 22:14:07 +01:00
Michael Brandt 270737acca EXT2FS: fix inode size for ext2fs rev#0
extfs.c assumes that there is always a valid inode_size field in the
superblock. But this is not true for ext2fs rev 0. Such ext2fs images
are for instance generated by genext2fs. Symptoms on ARM machines are
messages like: "raise: Signal # 8 caught"; on PowerPC "ext2ls" will
print nothing.
This fix checks for rev 0 and uses then 128 bytes as inode size.

Signed-off-by: Michael Brandt <Michael.Brandt@emsyso.de>
Tested on: TQM5200S
Tested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-12-05 00:46:10 +01:00
Peter Tyser 521af04d85 Conditionally perform common relocation fixups
Add #ifdefs where necessary to not perform relocation fixups.  This
allows boards/architectures which support relocation to trim a decent
chunk of code.

Note that this patch doesn't add #ifdefs to architecture-specific code
which does not support relocation.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-10-03 10:17:57 +02:00
Simon Kagstrom ef37c6835e ubifs: Correct dereferencing of files-after-symlinks
Files in directories which are symlinked to were not dereferenced
correctly in last commit. E.g., with a symlink

   /boot/lnk -> /boot/real_dir

loading

   /boot/lnk/uImage

will fail. This patch fixes that by simply seeing to it that the target
base directory has a slash after it.

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Signed-off-by: Stefan Roese <sr@denx.de>
2009-09-28 16:58:31 +02:00
Simon Kagstrom 9d7952e4c6 ubifs: Add support for looking up directory and relative symlinks
This patch adds support for resolving symlinks to directories as well as
relative symlinks. Symlinks are now always resolved during file lookup,
so the load stage no longer needs to special-case them.

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Signed-off-by: Stefan Roese <sr@denx.de>
2009-09-23 15:58:05 +02:00
Simon Kagstrom 02f99901ed Move __set/clear_bit from ubifs.h to bitops.h
__set_bit and __clear_bit are defined in ubifs.h as well as in
asm/include/bitops.h for some architectures. This patch moves
the generic implementation to include/linux/bitops.h and uses
that unless it's defined by the architecture.

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
2009-09-15 22:31:24 +02:00
Ilya Yanok 8cf19b9fec jffs2: some fixes to summary support
This patch fixes some issues with JFFS2 summary support in U-Boot.
1/ Summary support made compilation configurable (as summary support
considered expiremental even in Linux).
2/ Summary code can do unaligned 16-bit and 32-bit memory accesses.
We need to get data byte by byte to exclude data aborts.
3/ Make summary scan in two passes so we can safely fall back to full
scan if we found unsupported entry in the summary.

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
2009-08-21 23:29:35 +02:00
Ilya Yanok b644006e1a jffs2: clean the cache in case of malloc fails in build_lists
We should call jffs2_clean_cache() if we return from jffs2_build_lists()
with an error to prevent usage of incomplete lists. Also we should
free() a local buffer to prevent memory leaks.

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
2009-08-18 21:30:58 +02:00
Weirich, Bernhard 56fdaadc12 ext2: fix inode size and calculations
Signed-off-by: unsik Kim <donari75@gmail.com>
Signed-off-by: Bernhard Weirich <bernhard.weirich@riedel.net>
Signed-off-by: Wolfgang Denk <wd@denx.de>
Tested-by: Wolfgang Denk <wd@denx.de>
2009-07-28 22:38:17 +02:00
Scott Wood be33b046b5 Remove legacy NAND and disk on chip code.
Legacy NAND had been scheduled for removal.  Any boards that use this
were already not building in the previous release due to an #error.

The disk on chip code in common/cmd_doc.c relies on legacy NAND,
and it has also been removed.  There is newer disk on chip code
in drivers/mtd/nand; someone with access to hardware and sufficient
time and motivation can try to get that working, but for now disk
on chip is not supported.

Signed-off-by: Scott Wood <scottwood@freescale.com>
2009-07-16 19:07:47 -05:00
Tom Rix 651351fe98 FAT replace compare_sign with strncmp.
The static function compare_sign is only used to compare the fs_type string
and does not do anything more than what strncmp does.

The addition of the trailing '\0' to fs_type, while legal, is not needed
because the it is never printed out and strncmp does not depend on NULL
terminated strings.

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>
2009-06-12 20:45:48 +02:00
Daniel Mack 165f9859b6 ubifs: fix small error path mismatch
In do_readpage(), don't free 'dn' if its allocation failed.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
2009-06-09 23:11:53 +02:00
Ricardo Ribalda Delgado c1a0fd5f28 ubifs: BUG: Blocks commpressed with zlib
Blocks compressed with zlib dont have the full gzip header.

Without this patch, block compressed with zlib cannot be readed!

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
2009-04-30 23:07:04 +02:00
Ricardo Ribalda Delgado dbd3361440 ubifs: BUG realpath string must be ended with NULL
If the memory used to copy the link_make is "dirty" the string wont
be ended with NULL, throwing out multiple memory bugs.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
Acked-by: Stefan Roese <sr@denx.de>
2009-04-28 01:21:36 +02:00
Stefan Roese 7d3d30b1b3 UBIFS: Remove tnc_commit.c which is not used in the read-only version
I missed removing this file while implementing the UBIFS support. It's
not referenced at all, so let's remove it. Thanks to Artem Bityutskiy
for spotting.

Signed-off-by: Stefan Roese <sr@denx.de>
2009-04-28 00:36:53 +02:00
Adrian Hunter 6356daff70 UBIFS: fix recovery bug
UBIFS did not recovery in a situation in which it could
have. The relevant function assumed there could not be
more nodes in an eraseblock after a corrupted node, but
in fact the last (NAND) page written might contain anything.
The correct approach is to check for empty space (0xFF bytes)
from then on.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2009-04-28 00:36:21 +02:00
Wolfgang Denk c0a14aedc3 Update CHANGELOG, coding style cleanup. 2009-04-05 00:27:57 +02:00
Artem Bityutskiy febd7e4174 UBIFS: add R/O compatibility
Now UBIFS is supported by u-boot. If we ever decide to change the
media format, then people will have to upgrade their u-boots to
mount new format images. However, very often it is possible to
preserve R/O forward-compatibility, even though the write
forward-compatibility is not preserved.

This patch introduces a new super-block field which stores the
R/O compatibility version.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Acked-by: Adrian Hunter <Adrian.Hunter@nokia.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2009-04-04 22:44:22 +02:00
Jean-Christophe PLAGNIOL-VILLARD a31e091ad7 rename include/zlib.h to include/u-boot/zlib.h
Some systems have zlib.h installed in /usr/include/. This isn't the
desired file for u-boot code - we want the one in include/zlib.h.
This rename will avoid the conflict.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-04-04 15:37:54 +02:00
unsik Kim 75eb82ec7c mflash: Initial mflash support
Mflash is fusion memory device mainly targeted consumer eletronic and
mobile phone.
Internally, it have nand flash and other hardware logics and supports
some different operation (ATA, IO, XIP) modes.

IO mode is custom mode for the host that doesn't have IDE interface.
(Many mobile targeted SoC doesn't have IDE bus)

This driver support mflash IO mode.

Followings are brief descriptions about IO mode.

1. IO mode based on ATA protocol and uses some custom command. (read
   confirm, write confirm)
2. IO mode uses SRAM bus interface.

Signed-off-by: unsik Kim <donari75@gmail.com>
2009-04-03 23:47:06 +02:00
Michael Lawnick faac4fd852 UBIFS: Missing offset relocation for compressor 'none'
On systems where U-Boot is linked to another address than it really lays
(e.g. backup image), calls via function pointers must be fixed with a
'+= gd->reloc_off'.
This was not done for none_compr in ubifs_compressors_init() what leads
to system crash on ubifsmount command.

Signed-off-by: Michael Lawnick <ml.lawnick@gmx.de>
Acked-by: Stefan Roese <sr@denx.de>
2009-03-20 22:39:15 +01:00
Stefan Roese 9eefe2a2b3 UBIFS: Implement read-only UBIFS support in U-Boot
The U-Boot UBIFS implementation is largely a direct copy from the current
Linux version (2.6.29-rc6). As already done in the UBI version we have an
"abstraction layer" to redefine or remove some OS calls (e.g. mutex_lock()
...). This makes it possible to use the original Linux code with very
little changes. And by this we can better update to later Linux versions.

I removed some of the Linux features that are not used in the U-Boot
version (e.g. garbage-collection, write support).

Signed-off-by: Stefan Roese <sr@denx.de>
CC: Artem Bityutskiy <dedekind@infradead.org>
CC: Adrian Hunter <ext-Adrian.Hunter@nokia.com>
2009-03-20 22:39:15 +01:00
Wolfgang Denk 65f7d41031 fat.c: fix warning: array subscript is above array bounds
Fix based on suggestion by David Hawkins <dwh@ovro.caltech.edu>.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-01-27 21:36:28 +01:00
Bryan Wu 7e4b9b4f6f fat: fix unaligned errors
A couple of buffers in the fat code are declared as an array of bytes.
But it is then cast up to a structure with 16bit and 32bit members.
Since GCC assumes structure alignment here, we have to force the
buffers to be aligned according to the structure usage.

Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-24 02:03:39 +01:00
Ilya Yanok 584eedab66 jffs2: include <linux/mtd/compat.h> instead of defining own min_t
Include <linux/mtd/compat.h> header for min_t definition instead of
providing our own one. Removes warnings in case of OneNAND support
enabled.

Although I thinks it's a bit silly to include <linux/mtd/compat.h>
just for min_t...

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
Acked-by: Stefan Roese <sr@denx.de>
2008-12-16 17:14:54 +01:00
Sonic Zhang 8c5170a7d0 fs/fat: handle FAT on SATA
The FAT file system driver should also handle FAT on SATA devices.

Signed-off-by: Sonic Zhang <Sonic.Zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-12-10 09:21:48 +01:00
Ilya Yanok 142a80ffc3 jffs2: cache data_crc results
As we moved data_crc() invocation from jffs2_1pass_build_lists() to
jffs2_1pass_read_inode() data_crc is going to be calculated on each
inode access. This patch adds caching of data_crc() results. There
is no significant improvement in speed (because of flash access
caching added in previous patch I think, crc in RAM is really fast)
but this patch impacts memory usage -- every b_node structure uses
12 bytes instead of 8.

Signed-off-by: Alexey Neyman <avn@emcraft.com>
Signed-off-by: Ilya Yanok <yanok@emcraft.com>
2008-12-09 23:40:01 +01:00
Ilya Yanok 9b7076229e jffs2: summary support
This patch adds support for reading fs information from summary
node instead of scanning full eraseblock.

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
2008-12-09 23:39:59 +01:00
Ilya Yanok 70741004dc jffs2: add buffer to cache flash accesses
With this patch JFFS2 code allocates memory buffer of max_totlen size
(size of the largest node, calculated during scan time) and uses it to
store entire node. Speeds up loading. If malloc fails we use old ways
to do things.

Signed-off-by: Alexey Neyman <avn@emcraft.com>
Signed-off-by: Ilya Yanok <yanok@emcraft.com>
2008-12-09 23:39:58 +01:00
Ilya Yanok 8a36d31f72 jffs2: rewrite jffs2 scanning code based on Linux one
Rewrites jffs2_1pass_build_lists() function in style of Linux's
jffs2_scan_medium() and jffs2_scan_eraseblock().
This includes:
 - Caching flash acceses
 - Smart dealing with free space

Signed-off-by: Alexey Neyman <avn@emcraft.com>
Signed-off-by: Ilya Yanok <yanok@emcraft.com>
2008-12-09 23:39:16 +01:00
Ilya Yanok f738469567 jffs2: fix searching for latest version in jffs2_1pass_list_inodes()
We need to update i_version inside cycle to find really latest version
inside jffs2_1pass_list_inodes(). With that fixed we can use isize inside
dump_inode() instead of calling expensive jffs2_1pass_read_inode().

Signed-off-by: Alexey Neyman <avn@emcraft.com>
Signed-off-by: Ilya Yanok <yanok@emcraft.com>
2008-12-09 23:38:21 +01:00
Remy Bohmer 3c2c2f4279 Remove non-ascii characters from fat code
This code contains some non-ascii characters in comment lines and code.
Most editors do not display those characters properly and editing those
files results always in diffs at these places which are usually not required
to be changed at all. This is error prone.

So, remove those weird characters and replace them by normal C-style
equivalents for which the proper defines were already in the header.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
2008-12-04 20:51:44 +01:00
Scott Wood 2f77c7f45b JFFS2: Eliminate compiler error when both NAND and OneNAND are enabled.
Reported-by: Alessandro Rubini <rubini-list@gnudd.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2008-10-31 13:51:12 -05:00
Jean-Christophe PLAGNIOL-VILLARD 6d0f6bcf33 rename CFG_ macros to CONFIG_SYS
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-10-18 21:54:03 +02:00
Kyungmin Park 1a7f8ccec9 Add JFFS2 command support on OneNAND
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2008-09-06 22:50:08 +02:00
Jean-Christophe PLAGNIOL-VILLARD 08ab4e1780 fs: Move conditional compilation to Makefile
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-08-31 04:24:56 +02:00
Remy Bohmer 0bb86d823b Make the YAFFS filesystem work
Recently the YAFFS filesystem support has been added to U-boot.
However, just enabling CONFIG_YAFFS2 is not enough to get it working.

ymount will generate an exception (when dereferencing mtd->readoob()), because
the genericDevice is a null pointer. Further, a lot of logging is produced
while using YAFFS fs, so logging should also be disabled.
Both issues are solved by this patch.

With this patch and CONFIG_YAFFS2 enabled, I get a readable filesystem
in U-boot, as well as in Linux.

Tested on a Atmel AT91SAM9261EK board.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
Acked-by: William Juul <william.juul@tandberg.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2008-08-21 14:05:33 -05:00
Wolfgang Denk 4b0708093e Coding Style cleanup, update CHANGELOG
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-08-14 14:41:06 +02:00
Jean-Christophe PLAGNIOL-VILLARD cc4a0ceeac drivers/mtd/nand: Move conditional compilation to Makefile
rename CFG_NAND_LEGACY to CONFIG_NAND_LEGACY

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-08-13 01:40:43 +02:00
William Juul 43ea36fb8f moving files from yaffs2/direct/ to yaffs2/ and deleting all symlinks
Signed-off-by: William Juul <william.juul@tandberg.com>
2008-08-12 11:31:21 -05:00
William Juul 98824ce3f9 Clean out unneeded files
Signed-off-by: William Juul <william.juul@tandberg.com>
2008-08-12 11:31:20 -05:00
William Juul ec29a32b5a Create symlinks from yaffs2/direct to yaffs2
Signed-off-by: William Juul <william.juul@tandberg.com>
2008-08-12 11:31:19 -05:00
William Juul 90ef117b68 Incorporate yaffs2 into U-boot
To use YAFFS2 define CONFIG_YAFFS2

Signed-off-by: William Juul <william.juul@tandberg.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2008-08-12 11:31:19 -05:00
William Juul 0e8cc8bd92 YAFFS2 import
Direct import of yaffs as a tarball as of 20071113 from their public
CVS-web at http://www.aleph1.co.uk/cgi-bin/viewcvs.cgi/yaffs2/

The code can also be imported on the command line with:
export CVSROOT=:pserver:anonymous@cvs.aleph1.co.uk:/home/aleph1/cvs cvs logon
(Hit return when asked for a password)
cvs checkout yaffs2

Signed-off-by: William Juul <william.juul@tandberg.com>
Signed-off-by: Stig Olsen <stig.olsen@tandberg.com>
2008-08-12 11:31:18 -05:00
Wolfgang Denk b64f190b7a Fix printf() format issues with sizeof_t types by using %zu
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-07-14 15:06:35 +02:00
Wolfgang Denk d5996dd555 Fix some more printf() format problems.
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-07-13 19:51:00 +02:00
Jean-Christophe PLAGNIOL-VILLARD 0a5676befb Fix some more printf() format issues.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-07-13 16:55:00 +02:00
Stuart Wood 86d3273e2b jffs2_1pass.c: add watchdog support
Signed-off-by: Stuart Wood <stuart.wood@labxtechnologies.com>
2008-06-29 19:51:12 +02:00
Stelian Pop 5922db6c09 Cleanup nand_info[] declaration.
The nand_info array is declared as extern in several .c files.
Those days, nand.h contains a reference to the array, so there is
no need to declare it elsewhere.

Signed-off-by: Stelian Pop <stelian@popies.net>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2008-05-28 11:06:25 -05:00
Wolfgang Denk 53677ef18e Big white-space cleanup.
This commit gets rid of a huge amount of silly white-space issues.
Especially, all sequences of SPACEs followed by TAB characters get
removed (unless they appear in print statements).

Also remove all embedded "vim:" and "vi:" statements which hide
indentation problems.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-05-21 00:14:08 +02:00
Wolfgang Denk 707fa917cc jffs2_1pass.c: fix incompatible pointer type warning
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-04-28 22:01:04 +02:00
Bartlomiej Sieka 27f33e9f45 Merge branch 'new-image' of git://www.denx.de/git/u-boot-testing
Conflicts:

	common/cmd_bootm.c
	cpu/mpc8xx/cpu.c

Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
2008-03-26 09:38:06 +01:00
Jean-Christophe PLAGNIOL-VILLARD 0210cff3d0 cramfs: Fix ifdef
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-03-16 01:18:45 +01:00
Marian Balakowicz 7e492d8258 Merge branch 'master' of git://www.denx.de/git/u-boot into new-image 2008-03-12 12:23:02 +01:00
michael 8ce4e5c2c0 Fix checking fat32 cluster size.
This fixes the cluster size tests in the FAT32 file system.
The current implementation of VFAT support doesn't work if the
referred cluster has an offset > 16bit representation, causing
"fatload" and "fatls" commands etc. to fail.

Signed-off-by: michael trimarchi <trimarchi@gandalf.sssup.it>
2008-03-03 00:40:42 +01:00
Dave Liu ce1120dd70 fs: Fix ext2 read issue
The ext2 aligned process will corrupt the key
data struct, the patch fix this.

Signed-off-by: Dave Liu <daveliu@freescale.com>
2008-03-02 22:47:35 +01:00
Marian Balakowicz 20c9395933 Merge branch 'master' of /home/git/u-boot 2008-02-21 17:18:01 +01:00
Andy Fleming 21f6f9636f Fix CONFIG_MMC usage in fat code
A #if statement in fat.c depended on CONFIG_MMC, instead of
defined(CONFIG_MMC).  This meant CONFIG_MMC needed to be defined
as "1" rather than just defined.  Now it's better.

Signed-off-by: Andy Fleming <afleming@freescale.com>
2008-02-14 22:03:17 +01:00
Marian Balakowicz 321359f208 [new uImage] Move gunzip() common code to common/gunzip.c
Move gunzip(), zalloc() and zfree() to a separate file.
Share zalloc() and zfree() with cramfs uncompress routine.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-07 01:12:55 +01:00
Andy Fleming 02df4a270f Fix my own merge stupidity
Way back in August I merged Heiko's patch:
566a494f592: [PCS440EP] upgrade the PCS440EP board

with Jon's CONFIG_COMMANDS patches.

This was done in commit: 6bf6f114dc

However, in the process, I left out some of Heiko's good changes.

Now Heiko's and Jon's patches are properly merged in fat_register_device()

Signed-off-by: Andy Fleming <afleming@freescale.com>
2008-01-09 23:13:00 +01:00
Marcel Ziswiler 7817cb2083 fix comments with new drivers organization
Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com>
2008-01-09 21:48:49 +01:00
Harald Welte f540c42d95 Fix building with CRAMFS but not JFFS2 support
Signed-off-by: Harald Welte <laforge@openmoko.org>
2008-01-09 13:04:37 +01:00
Wolfgang Denk 0ddb89601a Fix memset bug in ext2fs_read_file()
ext2fs_read_file() had the function arguments swapped.

Pointed out by Mike Montour, 19 Dec 2007 22:34:25 -0800

Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-01-09 10:16:33 +01:00
Grant Likely f0037c56b0 Build: split COBJS value into multiple lines
This change is in preparation for condtitionial compile support in the
build system.  By spliting them all into seperate lines now, subsequent
patches that change 'COBJS-y += ' into 'COBJS-$(CONFIG_<blah>) += ' will
be less invasive and easier to review

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2007-11-15 11:05:18 -07:00
Michal Simek b49c90df6e [FIX] remove files form repository 2007-09-16 20:51:57 +02:00
Michal Simek 991b089d1c Synchronize with U-BOOT mainline 2007-09-15 00:03:35 +02:00
Michal Simek 7aa63d8cd3 [FIX] Correction command definition 2007-08-15 21:03:41 +02:00
Michal Simek 85fad497b3 Merge git://www.denx.de/git/u-boot 2007-08-07 22:12:05 +02:00
Wolfgang Denk bf1060ea4f Fix missing brace error in fs/fat/fat.c
[pointed out by Roderik Wildenburg]

Signed-off-by: Wolfgang Denk <wd@denx.de>
2007-08-07 16:02:13 +02:00
Michal Simek f500d9fdeb [FIX] Fix romfs code 2007-08-06 23:35:26 +02:00
Andy Fleming 6bf6f114dc Merge branch 'testing' into working
Conflicts:

	CHANGELOG
	fs/fat/fat.c
	include/configs/MPC8560ADS.h
	include/configs/pcs440ep.h
	net/eth.c
2007-08-03 02:23:23 -05:00