summaryrefslogtreecommitdiffstats
path: root/common/cmd_ide.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2008-04-28 14:36:06 +0200
committerWolfgang Denk <wd@denx.de>2008-04-28 20:42:51 +0200
commit413bf586266f86c6bdbc6c6d140f67a15af4c4f1 (patch)
tree4d78e8f087099983eb5854e0c5909571378bdc92 /common/cmd_ide.c
parentdb9084de28c46ac81c8f681722cb0d7411be4d7f (diff)
downloadtalos-obmc-uboot-413bf586266f86c6bdbc6c6d140f67a15af4c4f1.tar.gz
talos-obmc-uboot-413bf586266f86c6bdbc6c6d140f67a15af4c4f1.zip
IDE: fix compiler warnings
The IDE driver can use 32-bit addresses in LBA mode, in which case it spits multiple warnings during compilation. Fix them. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Diffstat (limited to 'common/cmd_ide.c')
-rw-r--r--common/cmd_ide.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index f9cd422f21..ead7e10d66 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -1264,7 +1264,7 @@ ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
#ifdef CONFIG_LBA48
unsigned char lba48 = 0;
- if (blknr & 0x0000fffff0000000) {
+ if (blknr & 0x0000fffff0000000ULL) {
/* more than 28 bits used, use 48bit mode */
lba48 = 1;
}
@@ -1318,8 +1318,13 @@ ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
/* write high bits */
ide_outb (device, ATA_SECT_CNT, 0);
ide_outb (device, ATA_LBA_LOW, (blknr >> 24) & 0xFF);
+#ifdef CFG_64BIT_LBA
ide_outb (device, ATA_LBA_MID, (blknr >> 32) & 0xFF);
ide_outb (device, ATA_LBA_HIGH, (blknr >> 40) & 0xFF);
+#else
+ ide_outb (device, ATA_LBA_MID, 0);
+ ide_outb (device, ATA_LBA_HIGH, 0);
+#endif
}
#endif
ide_outb (device, ATA_SECT_CNT, 1);
@@ -1383,7 +1388,7 @@ ulong ide_write (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
#ifdef CONFIG_LBA48
unsigned char lba48 = 0;
- if (blknr & 0x0000fffff0000000) {
+ if (blknr & 0x0000fffff0000000ULL) {
/* more than 28 bits used, use 48bit mode */
lba48 = 1;
}
@@ -1408,8 +1413,13 @@ ulong ide_write (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
/* write high bits */
ide_outb (device, ATA_SECT_CNT, 0);
ide_outb (device, ATA_LBA_LOW, (blknr >> 24) & 0xFF);
+#ifdef CFG_64BIT_LBA
ide_outb (device, ATA_LBA_MID, (blknr >> 32) & 0xFF);
ide_outb (device, ATA_LBA_HIGH, (blknr >> 40) & 0xFF);
+#else
+ ide_outb (device, ATA_LBA_MID, 0);
+ ide_outb (device, ATA_LBA_HIGH, 0);
+#endif
}
#endif
ide_outb (device, ATA_SECT_CNT, 1);
OpenPOWER on IntegriCloud