Objdump confirms no change to the resulting binary.

Signed-off-by: Ian Campbell <i...@hellion.org.uk>
---
 arch/arm/include/asm/arch-sunxi/mmc.h | 8 ++++++++
 drivers/mmc/sunxi_mmc.c               | 8 +++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/arch/arm/include/asm/arch-sunxi/mmc.h 
b/arch/arm/include/asm/arch-sunxi/mmc.h
index 10bf214..97b14c3 100644
--- a/arch/arm/include/asm/arch-sunxi/mmc.h
+++ b/arch/arm/include/asm/arch-sunxi/mmc.h
@@ -105,6 +105,14 @@ struct sunxi_mmc {
         SUNXI_MMC_RINT_COMMAND_DONE |          \
         SUNXI_MMC_RINT_VOLTAGE_CHANGE_DONE)
 
+#define SUNXI_MMC_STATUS_RXWL_FLAG             (0x1 << 0)
+#define SUNXI_MMC_STATUS_TXWL_FLAG             (0x1 << 1)
+#define SUNXI_MMC_STATUS_FIFO_EMPTY            (0x1 << 2)
+#define SUNXI_MMC_STATUS_FIFO_FULL             (0x1 << 3)
+#define SUNXI_MMC_STATUS_CARD_PRESENT          (0x1 << 8)
+#define SUNXI_MMC_STATUS_CARD_DATA_BUSY                (0x1 << 9)
+#define SUNXI_MMC_STATUS_DATA_FSM_BUSY         (0x1 << 10)
+
 #define SUNXI_MMC_IDMAC_RESET          (0x1 << 0)
 #define SUNXI_MMC_IDMAC_FIXBURST       (0x1 << 1)
 #define SUNXI_MMC_IDMAC_ENABLE         (0x1 << 7)
diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index e67b3ce..34c4996 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -316,7 +316,8 @@ static int mmc_trans_data_by_cpu(struct mmc *mmc, struct 
mmc_data *data)
                buff = (unsigned int *)data->dest;
                for (i = 0; i < (byte_cnt >> 2); i++) {
                        while (--timeout &&
-                                (readl(&mmchost->reg->status) & (0x1 << 2)));
+                              (readl(&mmchost->reg->status) &
+                               SUNXI_MMC_STATUS_FIFO_EMPTY));
                        if (timeout <= 0)
                                goto out;
                        buff[i] = readl(mmchost->database);
@@ -326,7 +327,8 @@ static int mmc_trans_data_by_cpu(struct mmc *mmc, struct 
mmc_data *data)
                buff = (unsigned int *)data->src;
                for (i = 0; i < (byte_cnt >> 2); i++) {
                        while (--timeout &&
-                                (readl(&mmchost->reg->status) & (0x1 << 3)));
+                              (readl(&mmchost->reg->status) &
+                               SUNXI_MMC_STATUS_FIFO_FULL));
                        if (timeout <= 0)
                                goto out;
                        writel(buff[i], mmchost->database);
@@ -553,7 +555,7 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd 
*cmd,
                                error = TIMEOUT;
                                goto out;
                        }
-               } while (status & (1 << 9));
+               } while (status & SUNXI_MMC_STATUS_CARD_DATA_BUSY);
        }
 
        if (cmd->resp_type & MMC_RSP_136) {
-- 
1.8.5.3

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to