diff options
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/arm_pl180_mmci.c | 2 | ||||
-rw-r--r-- | drivers/mmc/mmc.c | 14 | ||||
-rw-r--r-- | drivers/mmc/mmc_private.h | 8 | ||||
-rw-r--r-- | drivers/mmc/mmc_spi.c | 4 | ||||
-rw-r--r-- | drivers/mmc/mmc_write.c | 8 | ||||
-rw-r--r-- | drivers/mmc/mxsmmc.c | 24 | ||||
-rw-r--r-- | drivers/mmc/omap_hsmmc.c | 4 | ||||
-rw-r--r-- | drivers/mmc/sdhci.c | 2 |
8 files changed, 33 insertions, 33 deletions
diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c index 5ef7ff7ff2..8f2694f14c 100644 --- a/drivers/mmc/arm_pl180_mmci.c +++ b/drivers/mmc/arm_pl180_mmci.c @@ -375,7 +375,7 @@ int arm_pl180_mmci_init(struct pl180_mmc_host *host) if (mmc == NULL) return -1; - debug("registered mmc interface number is:%d\n", mmc->block_dev.dev); + debug("registered mmc interface number is:%d\n", mmc->block_dev.devnum); return 0; } diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index ede5d6eeec..8b2e6069ea 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -182,7 +182,7 @@ struct mmc *find_mmc_device(int dev_num) list_for_each(entry, &mmc_devices) { m = list_entry(entry, struct mmc, link); - if (m->block_dev.dev == dev_num) + if (m->block_dev.devnum == dev_num) return m; } @@ -234,10 +234,10 @@ static int mmc_read_blocks(struct mmc *mmc, void *dst, lbaint_t start, return blkcnt; } -static ulong mmc_bread(block_dev_desc_t *block_dev, lbaint_t start, +static ulong mmc_bread(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt, void *dst) { - int dev_num = block_dev->dev; + int dev_num = block_dev->devnum; int err; lbaint_t cur, blocks_todo = blkcnt; @@ -1495,7 +1495,7 @@ static int mmc_startup(struct mmc *mmc) mmc->block_dev.revision[0] = 0; #endif #if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBDISK_SUPPORT) - init_part(&mmc->block_dev); + part_init(&mmc->block_dev); #endif return 0; @@ -1556,7 +1556,7 @@ struct mmc *mmc_create(const struct mmc_config *cfg, void *priv) mmc->dsr = 0xffffffff; /* Setup the universal parts of the block interface just once */ mmc->block_dev.if_type = IF_TYPE_MMC; - mmc->block_dev.dev = cur_dev_num++; + mmc->block_dev.devnum = cur_dev_num++; mmc->block_dev.removable = 1; mmc->block_dev.block_read = mmc_bread; mmc->block_dev.block_write = mmc_bwrite; @@ -1579,7 +1579,7 @@ void mmc_destroy(struct mmc *mmc) } #ifdef CONFIG_PARTITIONS -block_dev_desc_t *mmc_get_dev(int dev) +struct blk_desc *mmc_get_dev(int dev) { struct mmc *mmc = find_mmc_device(dev); if (!mmc || mmc_init(mmc)) @@ -1728,7 +1728,7 @@ void print_mmc_devices(char separator) else mmc_type = NULL; - printf("%s: %d", m->cfg->name, m->block_dev.dev); + printf("%s: %d", m->cfg->name, m->block_dev.devnum); if (mmc_type) printf(" (%s)", mmc_type); diff --git a/drivers/mmc/mmc_private.h b/drivers/mmc/mmc_private.h index 6a7063976c..d3f6bfe123 100644 --- a/drivers/mmc/mmc_private.h +++ b/drivers/mmc/mmc_private.h @@ -22,23 +22,23 @@ void mmc_adapter_card_type_ident(void); #ifndef CONFIG_SPL_BUILD -unsigned long mmc_berase(block_dev_desc_t *block_dev, lbaint_t start, +unsigned long mmc_berase(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt); -unsigned long mmc_bwrite(block_dev_desc_t *block_dev, lbaint_t start, +unsigned long mmc_bwrite(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt, const void *src); #else /* CONFIG_SPL_BUILD */ /* SPL will never write or erase, declare dummies to reduce code size. */ -static inline unsigned long mmc_berase(block_dev_desc_t *block_dev, +static inline unsigned long mmc_berase(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt) { return 0; } -static inline ulong mmc_bwrite(block_dev_desc_t *block_dev, lbaint_t start, +static inline ulong mmc_bwrite(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt, const void *src) { return 0; diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c index 9032a73d78..7547e1aef8 100644 --- a/drivers/mmc/mmc_spi.c +++ b/drivers/mmc/mmc_spi.c @@ -91,7 +91,7 @@ static uint mmc_spi_readdata(struct mmc *mmc, void *xbuf, spi_xfer(spi, bsize * 8, NULL, buf, 0); spi_xfer(spi, 2 * 8, NULL, &crc, 0); #ifdef CONFIG_MMC_SPI_CRC_ON - if (be_to_cpu16(cyg_crc16(buf, bsize)) != crc) { + if (be_to_cpu16(crc16_ccitt(0, buf, bsize)) != crc) { debug("%s: CRC error\n", mmc->cfg->name); r1 = R1_SPI_COM_CRC; break; @@ -120,7 +120,7 @@ static uint mmc_spi_writedata(struct mmc *mmc, const void *xbuf, tok[1] = multi ? SPI_TOKEN_MULTI_WRITE : SPI_TOKEN_SINGLE; while (bcnt--) { #ifdef CONFIG_MMC_SPI_CRC_ON - crc = cpu_to_be16(cyg_crc16((u8 *)buf, bsize)); + crc = cpu_to_be16(crc16_ccitt(0, (u8 *)buf, bsize)); #endif spi_xfer(spi, 2 * 8, tok, NULL, 0); spi_xfer(spi, bsize * 8, buf, NULL, 0); diff --git a/drivers/mmc/mmc_write.c b/drivers/mmc/mmc_write.c index 79b8c4d808..7b186f8500 100644 --- a/drivers/mmc/mmc_write.c +++ b/drivers/mmc/mmc_write.c @@ -65,10 +65,10 @@ err_out: return err; } -unsigned long mmc_berase(block_dev_desc_t *block_dev, lbaint_t start, +unsigned long mmc_berase(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt) { - int dev_num = block_dev->dev; + int dev_num = block_dev->devnum; int err = 0; u32 start_rem, blkcnt_rem; struct mmc *mmc = find_mmc_device(dev_num); @@ -171,10 +171,10 @@ static ulong mmc_write_blocks(struct mmc *mmc, lbaint_t start, return blkcnt; } -ulong mmc_bwrite(block_dev_desc_t *block_dev, lbaint_t start, lbaint_t blkcnt, +ulong mmc_bwrite(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt, const void *src) { - int dev_num = block_dev->dev; + int dev_num = block_dev->devnum; lbaint_t cur, blocks_todo = blkcnt; int err; diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c index 31fb3abc9c..9fa87d5717 100644 --- a/drivers/mmc/mxsmmc.c +++ b/drivers/mmc/mxsmmc.c @@ -142,7 +142,7 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) uint32_t ctrl0; int ret; - debug("MMC%d: CMD%d\n", mmc->block_dev.dev, cmd->cmdidx); + debug("MMC%d: CMD%d\n", mmc->block_dev.devnum, cmd->cmdidx); /* Check bus busy */ timeout = MXSMMC_MAX_TIMEOUT; @@ -157,13 +157,13 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) } if (!timeout) { - printf("MMC%d: Bus busy timeout!\n", mmc->block_dev.dev); + printf("MMC%d: Bus busy timeout!\n", mmc->block_dev.devnum); return TIMEOUT; } /* See if card is present */ if (!mxsmmc_cd(priv)) { - printf("MMC%d: No card detected!\n", mmc->block_dev.dev); + printf("MMC%d: No card detected!\n", mmc->block_dev.devnum); return NO_CARD_ERR; } @@ -200,9 +200,9 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) if (data->flags & MMC_DATA_READ) { ctrl0 |= SSP_CTRL0_READ; } else if (priv->mmc_is_wp && - priv->mmc_is_wp(mmc->block_dev.dev)) { + priv->mmc_is_wp(mmc->block_dev.devnum)) { printf("MMC%d: Can not write a locked card!\n", - mmc->block_dev.dev); + mmc->block_dev.devnum); return UNUSABLE_ERR; } @@ -243,21 +243,21 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) if (!timeout) { printf("MMC%d: Command %d busy\n", - mmc->block_dev.dev, cmd->cmdidx); + mmc->block_dev.devnum, cmd->cmdidx); return TIMEOUT; } /* Check command timeout */ if (reg & SSP_STATUS_RESP_TIMEOUT) { printf("MMC%d: Command %d timeout (status 0x%08x)\n", - mmc->block_dev.dev, cmd->cmdidx, reg); + mmc->block_dev.devnum, cmd->cmdidx, reg); return TIMEOUT; } /* Check command errors */ if (reg & (SSP_STATUS_RESP_CRC_ERR | SSP_STATUS_RESP_ERR)) { printf("MMC%d: Command %d error (status 0x%08x)!\n", - mmc->block_dev.dev, cmd->cmdidx, reg); + mmc->block_dev.devnum, cmd->cmdidx, reg); return COMM_ERR; } @@ -279,14 +279,14 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) if (ret) { printf("MMC%d: Data timeout with command %d " "(status 0x%08x)!\n", - mmc->block_dev.dev, cmd->cmdidx, reg); + mmc->block_dev.devnum, cmd->cmdidx, reg); return ret; } } else { ret = mxsmmc_send_cmd_dma(priv, data); if (ret) { printf("MMC%d: DMA transfer failed\n", - mmc->block_dev.dev); + mmc->block_dev.devnum); return ret; } } @@ -297,7 +297,7 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) (SSP_STATUS_TIMEOUT | SSP_STATUS_DATA_CRC_ERR | SSP_STATUS_FIFO_OVRFLW | SSP_STATUS_FIFO_UNDRFLW)) { printf("MMC%d: Data error with command %d (status 0x%08x)!\n", - mmc->block_dev.dev, cmd->cmdidx, reg); + mmc->block_dev.devnum, cmd->cmdidx, reg); return COMM_ERR; } @@ -330,7 +330,7 @@ static void mxsmmc_set_ios(struct mmc *mmc) SSP_CTRL0_BUS_WIDTH_MASK, priv->buswidth); debug("MMC%d: Set %d bits bus width\n", - mmc->block_dev.dev, mmc->bus_width); + mmc->block_dev.devnum, mmc->bus_width); } static int mxsmmc_init(struct mmc *mmc) diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index 5038a9f55f..5f2db3b5cf 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -177,11 +177,11 @@ static unsigned char mmc_board_init(struct mmc *mmc) #if defined(CONFIG_OMAP44XX) && defined(CONFIG_TWL6030_POWER) /* PBIAS config needed for MMC1 only */ - if (mmc->block_dev.dev == 0) + if (mmc->block_dev.devnum == 0) omap4_vmmc_pbias_config(mmc); #endif #if defined(CONFIG_OMAP54XX) && defined(CONFIG_PALMAS_POWER) - if (mmc->block_dev.dev == 0) + if (mmc->block_dev.devnum == 0) omap5_pbias_config(mmc); #endif diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 8586d898fd..ef7e6150f9 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -137,7 +137,7 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd, int trans_bytes = 0, is_aligned = 1; u32 mask, flags, mode; unsigned int time = 0, start_addr = 0; - int mmc_dev = mmc->block_dev.dev; + int mmc_dev = mmc->block_dev.devnum; unsigned start = get_timer(0); /* Timeout unit - ms */ |