summaryrefslogtreecommitdiff
path: root/fs/fat
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2010-07-19 11:36:57 +0200
committerWolfgang Denk <wd@denx.de>2010-07-24 20:53:43 +0200
commit66c2d73cfc901aa35e0331b2fd710b250151f966 (patch)
tree36cd0dff7cca6db402795feedd708ee78fdab1cc /fs/fat
parenta17c548b5393c5e0b457d6e3043a85bde717f532 (diff)
downloadu-boot-imx-66c2d73cfc901aa35e0331b2fd710b250151f966.zip
u-boot-imx-66c2d73cfc901aa35e0331b2fd710b250151f966.tar.gz
u-boot-imx-66c2d73cfc901aa35e0331b2fd710b250151f966.tar.bz2
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>
Diffstat (limited to 'fs/fat')
-rw-r--r--fs/fat/fat.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 6b3a274..5b9ec2a 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -50,6 +50,7 @@ static int cur_part = 1;
#define DOS_PART_TBL_OFFSET 0x1be
#define DOS_PART_MAGIC_OFFSET 0x1fe
#define DOS_FS_TYPE_OFFSET 0x36
+#define DOS_FS32_TYPE_OFFSET 0x52
int disk_read (__u32 startblock, __u32 getsize, __u8 * bufptr)
{
@@ -94,7 +95,8 @@ fat_register_device(block_dev_desc_t *dev_desc, int part_no)
if (!get_partition_info (dev_desc, part_no, &info)) {
part_offset = info.start;
cur_part = part_no;
- } else if (!strncmp((char *)&buffer[DOS_FS_TYPE_OFFSET], "FAT", 3)) {
+ } else if (strncmp((char *)&buffer[DOS_FS_TYPE_OFFSET], "FAT", 3)==0 ||
+ strncmp((char *)&buffer[DOS_FS32_TYPE_OFFSET],"FAT32",5)==0) {
/* ok, we assume we are on a PBR only */
cur_part = 1;
part_offset = 0;
@@ -105,7 +107,8 @@ fat_register_device(block_dev_desc_t *dev_desc, int part_no)
}
#else
- if (!strncmp((char *)&buffer[DOS_FS_TYPE_OFFSET],"FAT",3)) {
+ if ((strncmp((char *)&buffer[DOS_FS_TYPE_OFFSET], "FAT", 3) == 0) ||
+ (strncmp((char *)&buffer[DOS_FS32_TYPE_OFFSET], "FAT32", 5) == 0)) {
/* ok, we assume we are on a PBR only */
cur_part = 1;
part_offset = 0;