summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorRabin Vincent <rabin@rab.in>2009-04-05 13:30:54 +0530
committerAndy Fleming <afleming@freescale.com>2009-06-02 17:18:56 -0500
commit9b1f942c09dd942e6de3185caa81c111b14de567 (patch)
tree063db5807fadccb82d2080eb71e6f04cd86975f6 /drivers/mmc
parente85649c7e683faea1ccfddc9fa9abc62f38e4201 (diff)
downloadu-boot-imx-9b1f942c09dd942e6de3185caa81c111b14de567.zip
u-boot-imx-9b1f942c09dd942e6de3185caa81c111b14de567.tar.gz
u-boot-imx-9b1f942c09dd942e6de3185caa81c111b14de567.tar.bz2
mmc: use lldiv to fix arm eabi build
The generic MMC core uses direct long long divisions, which do not build with ARM EABI toolchains. Use lldiv() instead, which works everywhere. Signed-off-by: Rabin Vincent <rabin@rab.in>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/mmc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 70b4130..95ed21e 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -31,6 +31,7 @@
#include <malloc.h>
#include <linux/list.h>
#include <mmc.h>
+#include <div64.h>
static struct list_head mmc_devices;
static int cur_dev_num = -1;
@@ -155,8 +156,8 @@ int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size)
char *buffer;
int i;
int blklen = mmc->read_bl_len;
- int startblock = src / blklen;
- int endblock = (src + size - 1) / blklen;
+ int startblock = lldiv(src, mmc->read_bl_len);
+ int endblock = lldiv(src + size - 1, mmc->read_bl_len);
int err = 0;
/* Make a buffer big enough to hold all the blocks we might read */
@@ -789,7 +790,7 @@ int mmc_startup(struct mmc *mmc)
mmc->block_dev.lun = 0;
mmc->block_dev.type = 0;
mmc->block_dev.blksz = mmc->read_bl_len;
- mmc->block_dev.lba = mmc->capacity/mmc->read_bl_len;
+ mmc->block_dev.lba = lldiv(mmc->capacity, mmc->read_bl_len);
sprintf(mmc->block_dev.vendor,"Man %02x%02x%02x Snr %02x%02x%02x%02x",
mmc->cid[0], mmc->cid[1], mmc->cid[2],
mmc->cid[9], mmc->cid[10], mmc->cid[11], mmc->cid[12]);