]> git.sur5r.net Git - u-boot/commitdiff
mmc: uniphier-sd: Fix long response processing
authorMarek Vasut <marek.vasut@gmail.com>
Fri, 21 Jul 2017 21:11:59 +0000 (23:11 +0200)
committerJaehoon Chung <jh80.chung@samsung.com>
Thu, 17 Aug 2017 05:36:05 +0000 (14:36 +0900)
The long response entry 0..3 LSByte comes from the next response
register MSByte, not from the next response register LSByte. Fix
this to make the driver report correct values in response 136 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
drivers/mmc/uniphier-sd.c

index 3c462bd5835e9e4efae745791fdaaff80a4c2af5..e272b141532456ba1cb4a46db895a9ba6e52b944 100644 (file)
@@ -470,13 +470,13 @@ static int uniphier_sd_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
                u32 rsp_71_40 = readl(priv->regbase + UNIPHIER_SD_RSP32);
                u32 rsp_39_8 = readl(priv->regbase + UNIPHIER_SD_RSP10);
 
-               cmd->response[0] = (rsp_127_104 & 0xffffff) << 8 |
-                                                       (rsp_103_72 & 0xff);
-               cmd->response[1] = (rsp_103_72  & 0xffffff) << 8 |
-                                                       (rsp_71_40 & 0xff);
-               cmd->response[2] = (rsp_71_40   & 0xffffff) << 8 |
-                                                       (rsp_39_8 & 0xff);
-               cmd->response[3] = (rsp_39_8    & 0xffffff) << 8;
+               cmd->response[0] = ((rsp_127_104 & 0x00ffffff) << 8) |
+                                  ((rsp_103_72  & 0xff000000) >> 24);
+               cmd->response[1] = ((rsp_103_72  & 0x00ffffff) << 8) |
+                                  ((rsp_71_40   & 0xff000000) >> 24);
+               cmd->response[2] = ((rsp_71_40   & 0x00ffffff) << 8) |
+                                  ((rsp_39_8    & 0xff000000) >> 24);
+               cmd->response[3] = (rsp_39_8     & 0xffffff)   << 8;
        } else {
                /* bit 39-8 */
                cmd->response[0] = readl(priv->regbase + UNIPHIER_SD_RSP10);