summaryrefslogtreecommitdiffstats
path: root/disk
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 /disk
parenta17c548b5393c5e0b457d6e3043a85bde717f532 (diff)
downloadbootable_bootloader_goldelico_gta04-66c2d73cfc901aa35e0331b2fd710b250151f966.zip
bootable_bootloader_goldelico_gta04-66c2d73cfc901aa35e0331b2fd710b250151f966.tar.gz
bootable_bootloader_goldelico_gta04-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 'disk')
-rw-r--r--disk/part_dos.c4
-rw-r--r--disk/part_dos.h3
2 files changed, 5 insertions, 2 deletions
diff --git a/disk/part_dos.c b/disk/part_dos.c
index 887b75e..2de1bb8 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -77,8 +77,10 @@ static int test_block_type(unsigned char *buffer)
(buffer[DOS_PART_MAGIC_OFFSET + 1] != 0xaa) ) {
return (-1);
} /* no DOS Signature at all */
- if(strncmp((char *)&buffer[DOS_PBR_FSTYPE_OFFSET],"FAT",3)==0)
+ if (strncmp((char *)&buffer[DOS_PBR_FSTYPE_OFFSET],"FAT",3)==0 ||
+ strncmp((char *)&buffer[DOS_PBR32_FSTYPE_OFFSET],"FAT32",5)==0) {
return DOS_PBR; /* is PBR */
+ }
return DOS_MBR; /* Is MBR */
}
diff --git a/disk/part_dos.h b/disk/part_dos.h
index ac93f20..195a32c 100644
--- a/disk/part_dos.h
+++ b/disk/part_dos.h
@@ -28,13 +28,14 @@
#ifdef CONFIG_ISO_PARTITION
/* Make the buffers bigger if ISO partition support is enabled -- CD-ROMS
have 2048 byte blocks */
-#define DEFAULT_SECTOR_SIZE 2048
+#define DEFAULT_SECTOR_SIZE 2048
#else
#define DEFAULT_SECTOR_SIZE 512
#endif
#define DOS_PART_TBL_OFFSET 0x1be
#define DOS_PART_MAGIC_OFFSET 0x1fe
#define DOS_PBR_FSTYPE_OFFSET 0x36
+#define DOS_PBR32_FSTYPE_OFFSET 0x52
#define DOS_PBR_MEDIA_TYPE_OFFSET 0x15
#define DOS_MBR 0
#define DOS_PBR 1