mmc: sdhci: add the quirk for broken r1b response
[oweals/u-boot.git] / drivers / mmc / mmc.c
index e70fa9f8dcc2bb591d536bb3811a2334723b39cb..aebe578ff6f2e0228baa3e5d010f6808ea269760 100644 (file)
@@ -179,7 +179,7 @@ int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
                        for (i = 0; i < 4; i++) {
                                int j;
                                printf("\t\t\t\t\t%03d - ", i*4);
-                               ptr = &cmd->response[i];
+                               ptr = (u8 *)&cmd->response[i];
                                ptr += 3;
                                for (j = 0; j < 4; j++)
                                        printf("%02X ", *ptr--);
@@ -1199,7 +1199,9 @@ int mmc_startup(struct mmc *mmc)
                else
                        mmc_set_clock(mmc, 25000000);
        } else {
-               for (width = EXT_CSD_BUS_WIDTH_8; width >= 0; width--) {
+               width = ((mmc->host_caps & MMC_MODE_MASK_WIDTH_BITS) >>
+                        MMC_MODE_WIDTH_BITS_SHIFT);
+               for (; width >= 0; width--) {
                        /* Set the card to use 4 bit*/
                        err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL,
                                        EXT_CSD_BUS_WIDTH, width);