summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 28df15e)
raw | patch | inline | side by side (parent: 28df15e)
author | John Rigby <john.rigby@linaro.org> | |
Mon, 18 Apr 2011 05:50:08 +0000 (05:50 +0000) | ||
committer | Andy Fleming <afleming@freescale.com> | |
Fri, 29 Apr 2011 08:21:54 +0000 (03:21 -0500) |
Make existing field b_max field in struct mmc unconditional
and use it instead of CONFIG_SYS_MMC_MAX_BLK_COUNT in mmc_bread
and mmc_bwrite.
Initialize b_max to CONFIG_SYS_MMC_MAX_BLK_COUNT in mmc_register
if it has not been initialized by the hw driver.
Initialize b_max to 0 in all callers to mmc_register.
Signed-off-by: John Rigby <john.rigby@linaro.org>
Signed-off-by: Andy Fleming <afleming@freescale.com>
and use it instead of CONFIG_SYS_MMC_MAX_BLK_COUNT in mmc_bread
and mmc_bwrite.
Initialize b_max to CONFIG_SYS_MMC_MAX_BLK_COUNT in mmc_register
if it has not been initialized by the hw driver.
Initialize b_max to 0 in all callers to mmc_register.
Signed-off-by: John Rigby <john.rigby@linaro.org>
Signed-off-by: Andy Fleming <afleming@freescale.com>
index 245f48294c15c842a845b157c5a9429ee237dd22..ed296ee0266f96a46c4e610bf639f4e826681e20 100644 (file)
return -1;
}
+ dev->b_max = 0;
+
mmc_register(dev);
debug("registered mmc interface number is:%d\n", dev->block_dev.dev);
diff --git a/drivers/mmc/bfin_sdh.c b/drivers/mmc/bfin_sdh.c
index 31b645937360022fece4b5490f7057613c7586ad..bc9057fa9a5a444c359eb93d34032ec8e19cf384 100644 (file)
--- a/drivers/mmc/bfin_sdh.c
+++ b/drivers/mmc/bfin_sdh.c
mmc->f_min = mmc->f_max >> 9;
mmc->block_dev.part_type = PART_TYPE_DOS;
+ mmc->b_max = 0;
+
mmc_register(mmc);
return 0;
index d5d19ebee30ea679637b71137c3be1132bea7bd9..5d918e6ffcac8139a9dfa28ea344b05a6d06b801 100644 (file)
mmc->voltages = host->voltages;
mmc->host_caps = host->host_caps;
-#ifdef CONFIG_MMC_MBLOCK
mmc->b_max = DAVINCI_MAX_BLOCKS;
-#endif
+
mmc_register(mmc);
return 0;
index 2984d645c9ddab0dfba0f9229eecc52f1d3e20bd..6577925b8ecc558e91b160acc571c6b2690d9c2d 100644 (file)
mmc->f_min = get_mci_clk_rate() / (2*256);
mmc->f_max = get_mci_clk_rate() / (2*1);
+ mmc->b_max = 0;
+
mmc_register(mmc);
return 0;
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index f27b7c79e50e310fc047fbcbf6e4bd19bb03698c..f6d31f58488f427c8099be59e7624533efcd492e 100644 (file)
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
return 0;
do {
- cur = (blocks_todo > CONFIG_SYS_MMC_MAX_BLK_COUNT) ?
- CONFIG_SYS_MMC_MAX_BLK_COUNT : blocks_todo;
+ cur = (blocks_todo > mmc->b_max) ? mmc->b_max : blocks_todo;
if(mmc_write_blocks(mmc, start, cur, src) != cur)
return 0;
blocks_todo -= cur;
return 0;
do {
- cur = (blocks_todo > CONFIG_SYS_MMC_MAX_BLK_COUNT) ?
- CONFIG_SYS_MMC_MAX_BLK_COUNT : blocks_todo;
+ cur = (blocks_todo > mmc->b_max) ? mmc->b_max : blocks_todo;
if(mmc_read_blocks(mmc, dst, start, cur) != cur)
return 0;
blocks_todo -= cur;
mmc->block_dev.removable = 1;
mmc->block_dev.block_read = mmc_bread;
mmc->block_dev.block_write = mmc_bwrite;
+ if (!mmc->b_max)
+ mmc->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
INIT_LIST_HEAD (&mmc->link);
diff --git a/drivers/mmc/mxcmmc.c b/drivers/mmc/mxcmmc.c
index 59639539f304c43409650de56e3689fc246e191c..ab1fc82fbb68dd3f0d6f90f55b3be916fd8eac56 100644 (file)
--- a/drivers/mmc/mxcmmc.c
+++ b/drivers/mmc/mxcmmc.c
mmc->f_min = imx_get_perclk2() >> 7;
mmc->f_max = imx_get_perclk2() >> 1;
+ mmc->b_max = 0;
+
mmc_register(mmc);
return 0;
index 6f2280abff91af577644e0249a175702d477524e..dcbde8935a60af85e3edaadd073a4ba1b4236b55 100644 (file)
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
mmc->f_min = 400000;
mmc->f_max = 52000000;
+ mmc->b_max = 0;
+
mmc_register(mmc);
return 0;
diff --git a/drivers/mmc/s5p_mmc.c b/drivers/mmc/s5p_mmc.c
index 0323800711ba16104c9b1a092b4e88b5ba70ece6..668c28bded9c0b505235f0828a3c2b8d3ee26de3 100644 (file)
--- a/drivers/mmc/s5p_mmc.c
+++ b/drivers/mmc/s5p_mmc.c
mmc_host[dev_index].clock = 0;
mmc_host[dev_index].reg = s5p_get_base_mmc(dev_index);
+ mmc->m_bmax = 0;
mmc_register(mmc);
return 0;
diff --git a/include/mmc.h b/include/mmc.h
index e0a56d9d23b76501f1d378ce79ec9f2702762cfa..b4197a72f4d7c5868ee9244e82ab36dcd17c1d68 100644 (file)
--- a/include/mmc.h
+++ b/include/mmc.h
struct mmc_cmd *cmd, struct mmc_data *data);
void (*set_ios)(struct mmc *mmc);
int (*init)(struct mmc *mmc);
-#ifdef CONFIG_MMC_MBLOCK
uint b_max;
-#endif
};
int mmc_register(struct mmc *mmc);