Merge branch 'master' of git://git.denx.de/u-boot-net
[oweals/u-boot.git] / drivers / mmc / mxsmmc.c
index dfceaef953a918aa38eff4136318c036a7a97426..4187a941207e584b855104c7c4fcfc3ef1b7e93b 100644 (file)
@@ -133,7 +133,8 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
                /* READ or WRITE */
                if (data->flags & MMC_DATA_READ) {
                        ctrl0 |= SSP_CTRL0_READ;
-               } else if (priv->mmc_is_wp(mmc->block_dev.dev)) {
+               } else if (priv->mmc_is_wp &&
+                       priv->mmc_is_wp(mmc->block_dev.dev)) {
                        printf("MMC%d: Can not write a locked card!\n",
                                mmc->block_dev.dev);
                        return UNUSABLE_ERR;
@@ -338,6 +339,7 @@ int mxsmmc_initialize(bd_t *bis, int id, int (*wp)(int))
                (struct mx28_clkctrl_regs *)MXS_CLKCTRL_BASE;
        struct mmc *mmc = NULL;
        struct mxsmmc_priv *priv = NULL;
+       int ret;
 
        mmc = malloc(sizeof(struct mmc));
        if (!mmc)
@@ -356,6 +358,10 @@ int mxsmmc_initialize(bd_t *bis, int id, int (*wp)(int))
                return -ENOMEM;
        }
 
+       ret = mxs_dma_init_channel(id);
+       if (ret)
+               return ret;
+
        priv->mmc_is_wp = wp;
        priv->id = id;
        switch (id) {
@@ -401,7 +407,7 @@ int mxsmmc_initialize(bd_t *bis, int id, int (*wp)(int))
         */
        mmc->f_min = 400000;
        mmc->f_max = mxc_get_clock(MXC_SSP0_CLK + id) * 1000 / 2;
-       mmc->b_max = 0x40;
+       mmc->b_max = 0x20;
 
        mmc_register(mmc);
        return 0;