<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/fs/fat, branch v2011.12</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>FAT: fix some issues in FAT write support code</title>
<updated>2011-12-20T22:18:43+00:00</updated>
<author>
<name>Anatolij Gustschin</name>
<email>agust@denx.de</email>
</author>
<published>2011-12-15T03:12:14+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8506eb8d6abefa6d91468a8c350b60ce3321a53e'/>
<id>8506eb8d6abefa6d91468a8c350b60ce3321a53e</id>
<content type='text'>
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 &lt;agust@denx.de&gt;
Cc: Donggeun Kim &lt;dg77.kim@samsung.com&gt;
Cc: Aaron Williams &lt;Aaron.Williams@cavium.com&gt;
Acked-by: Donggeun Kim &lt;dg77.kim@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;agust@denx.de&gt;
Cc: Donggeun Kim &lt;dg77.kim@samsung.com&gt;
Cc: Aaron Williams &lt;Aaron.Williams@cavium.com&gt;
Acked-by: Donggeun Kim &lt;dg77.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/fat/fat.c: Fix GCC 4.6 build warning</title>
<updated>2011-11-07T21:11:20+00:00</updated>
<author>
<name>Wolfgang Denk</name>
<email>wd@denx.de</email>
</author>
<published>2011-11-04T15:55:15+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6471ada534a917f89dd910cfe06279ea1238fbd0'/>
<id>6471ada534a917f89dd910cfe06279ea1238fbd0</id>
<content type='text'>
Fix:
fat.c: In function 'fat_register_device':
fat.c:74:19: warning: variable 'info' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk &lt;wd@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix:
fat.c: In function 'fat_register_device':
fat.c:74:19: warning: variable 'info' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk &lt;wd@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fat: correct ATTR_VFAT check</title>
<updated>2011-10-27T21:53:57+00:00</updated>
<author>
<name>J. Vijayanand</name>
<email>vijayanand.jayaraman@in.bosch.com</email>
</author>
<published>2011-10-19T07:43:08+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=206d68fdd41e4942825cfc4a91a096297b654a24'/>
<id>206d68fdd41e4942825cfc4a91a096297b654a24</id>
<content type='text'>
ATTR_VFAT condition requires multiple bits to be set but the present
condition checking in do_fat_read() &amp; get_dentfromdir() ends up
passing on even a single bit being set.

Signed-off-by: J. Vijayanand &lt;vijayanand.jayaraman@in.bosch.com&gt;
Signed-off-by: Sergei Shtylyov &lt;sshtylyov@ru.mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ATTR_VFAT condition requires multiple bits to be set but the present
condition checking in do_fat_read() &amp; get_dentfromdir() ends up
passing on even a single bit being set.

Signed-off-by: J. Vijayanand &lt;vijayanand.jayaraman@in.bosch.com&gt;
Signed-off-by: Sergei Shtylyov &lt;sshtylyov@ru.mvista.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/fat/fat.c: fix warning: 'part_size' defined but not used</title>
<updated>2011-10-27T21:53:57+00:00</updated>
<author>
<name>Wolfgang Denk</name>
<email>wd@denx.de</email>
</author>
<published>2011-10-27T21:08:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e116cc069fa4cbe51f3dab84698bc0ac57085f62'/>
<id>e116cc069fa4cbe51f3dab84698bc0ac57085f62</id>
<content type='text'>
Commit c30a15e "FAT: Add FAT write feature" introduced a compiler
warning.  Fix this.

Signed-off-by: Wolfgang Denk &lt;wd@denx.de&gt;
Cc: Donggeun Kim &lt;dg77.kim@samsung.com&gt;
Cc: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit c30a15e "FAT: Add FAT write feature" introduced a compiler
warning.  Fix this.

Signed-off-by: Wolfgang Denk &lt;wd@denx.de&gt;
Cc: Donggeun Kim &lt;dg77.kim@samsung.com&gt;
Cc: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>FAT: Add FAT write feature</title>
<updated>2011-10-26T19:40:44+00:00</updated>
<author>
<name>Donggeun Kim</name>
<email>dg77.kim@samsung.com</email>
</author>
<published>2011-10-24T21:15:28+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c30a15e590c7e5bfd27e4704c81648071f11d51f'/>
<id>c30a15e590c7e5bfd27e4704c81648071f11d51f</id>
<content type='text'>
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 &lt;dg77.kim@samsung.com&gt;
Signed-off-by: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;dg77.kim@samsung.com&gt;
Signed-off-by: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fat: replace LINEAR_PREFETCH_SIZE with PREFETCH_BLOCKS</title>
<updated>2011-10-01T19:52:19+00:00</updated>
<author>
<name>Sergei Shtylyov</name>
<email>sshtylyov@ru.mvista.com</email>
</author>
<published>2011-08-19T09:37:46+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=025421eab453fd41a3cc14a0fc48115b0dc4c287'/>
<id>025421eab453fd41a3cc14a0fc48115b0dc4c287</id>
<content type='text'>
Currently in do_fat_read() when reading FAT sectors, we have to divide down
LINEAR_PREFETCH_SIZE by the sector size, whereas it's defined as 2 sectors
worth of bytes. In order to avoid redundant multiplication/division, introduce
#define PREFETCH_BLOCKS instead of #define LINEAR_PREFETCH_SIZE.

Signed-off-by: Sergei Shtylyov &lt;sshtylyov@mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently in do_fat_read() when reading FAT sectors, we have to divide down
LINEAR_PREFETCH_SIZE by the sector size, whereas it's defined as 2 sectors
worth of bytes. In order to avoid redundant multiplication/division, introduce
#define PREFETCH_BLOCKS instead of #define LINEAR_PREFETCH_SIZE.

Signed-off-by: Sergei Shtylyov &lt;sshtylyov@mvista.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fat: root directory cluster only makes sense for FAT32</title>
<updated>2011-10-01T19:52:06+00:00</updated>
<author>
<name>Sergei Shtylyov</name>
<email>sshtylyov@ru.mvista.com</email>
</author>
<published>2011-08-19T09:32:34+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=40e219165bcdf450cc69976fa129f2ef9889973a'/>
<id>40e219165bcdf450cc69976fa129f2ef9889973a</id>
<content type='text'>
The root directory cluster field only exists in a FAT32 boot sector, so the
'root_cluster' variable in do_fat_read() contains garbage in case of FAT12/16.
Make it contain 0 instead as this is what is passed to get_vfatname() in that
case anyway.

Signed-off-by: Sergei Shtylyov &lt;sshtylyov@mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The root directory cluster field only exists in a FAT32 boot sector, so the
'root_cluster' variable in do_fat_read() contains garbage in case of FAT12/16.
Make it contain 0 instead as this is what is passed to get_vfatname() in that
case anyway.

Signed-off-by: Sergei Shtylyov &lt;sshtylyov@mvista.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fat: cannot compare bytes and sectors</title>
<updated>2011-10-01T19:51:23+00:00</updated>
<author>
<name>Sergei Shtylyov</name>
<email>sshtylyov@ru.mvista.com</email>
</author>
<published>2011-08-08T09:39:29+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=60b36f0fc7c77e98b9d55c237e455c42a1caa44b'/>
<id>60b36f0fc7c77e98b9d55c237e455c42a1caa44b</id>
<content type='text'>
The code multiples the FAT size in sectors by the sector size and then tries to
compare that to the number of sectors in the 'getsize' variable.  While fixing
this, also change the initial value of 'getsize' as the division of FATBUFSIZE
by the sector size gets us FATBUFBLOCKS.

Signed-off-by: Sergei Shtylyov &lt;sshtylyov@mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The code multiples the FAT size in sectors by the sector size and then tries to
compare that to the number of sectors in the 'getsize' variable.  While fixing
this, also change the initial value of 'getsize' as the division of FATBUFSIZE
by the sector size gets us FATBUFBLOCKS.

Signed-off-by: Sergei Shtylyov &lt;sshtylyov@mvista.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fat: fix crash with big sector size</title>
<updated>2011-10-01T19:50:39+00:00</updated>
<author>
<name>Sergei Shtylyov</name>
<email>sshtylyov@ru.mvista.com</email>
</author>
<published>2011-08-08T09:38:33+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ac4977719e157bcb3c45c70d9dd781164727530d'/>
<id>ac4977719e157bcb3c45c70d9dd781164727530d</id>
<content type='text'>
Apple iPod nanos have sector sizes of 2 or 4 KiB, which crashes U-Boot when it
tries to read the boot sector into 512-byte buffer situated on stack. Make the
FAT code indifferent to the sector size.

Signed-off-by: Sergei Shtylyov &lt;sshtylyov@mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Apple iPod nanos have sector sizes of 2 or 4 KiB, which crashes U-Boot when it
tries to read the boot sector into 512-byte buffer situated on stack. Make the
FAT code indifferent to the sector size.

Signed-off-by: Sergei Shtylyov &lt;sshtylyov@mvista.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scaled down version of generic libraries for SPL</title>
<updated>2011-07-26T12:44:25+00:00</updated>
<author>
<name>Aneesh V</name>
<email>aneesh@ti.com</email>
</author>
<published>2011-07-13T05:11:06+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=05bad4aa567ccffaac128d9090abde245f8463d1'/>
<id>05bad4aa567ccffaac128d9090abde245f8463d1</id>
<content type='text'>
Signed-off-by: Aneesh V &lt;aneesh@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Aneesh V &lt;aneesh@ti.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
