mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-30 02:51:33 +00:00
mmc: Introduce mmc_phys_to_bus()/mmc_bus_to_phys()
This will allow us to use DM variants of phys_to_bus()/bus_to_phys() when relevant. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Peter Robinson <pbrobinson@gmail.com> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
This commit is contained in:
parent
1a474559d9
commit
c89c96d322
2 changed files with 12 additions and 4 deletions
|
@ -74,6 +74,7 @@ static void sdhci_transfer_pio(struct sdhci_host *host, struct mmc_data *data)
|
||||||
static void sdhci_prepare_dma(struct sdhci_host *host, struct mmc_data *data,
|
static void sdhci_prepare_dma(struct sdhci_host *host, struct mmc_data *data,
|
||||||
int *is_aligned, int trans_bytes)
|
int *is_aligned, int trans_bytes)
|
||||||
{
|
{
|
||||||
|
dma_addr_t dma_addr;
|
||||||
unsigned char ctrl;
|
unsigned char ctrl;
|
||||||
void *buf;
|
void *buf;
|
||||||
|
|
||||||
|
@ -104,8 +105,8 @@ static void sdhci_prepare_dma(struct sdhci_host *host, struct mmc_data *data,
|
||||||
mmc_get_dma_dir(data));
|
mmc_get_dma_dir(data));
|
||||||
|
|
||||||
if (host->flags & USE_SDMA) {
|
if (host->flags & USE_SDMA) {
|
||||||
sdhci_writel(host, phys_to_bus((ulong)host->start_addr),
|
dma_addr = dev_phys_to_bus(mmc_to_dev(host->mmc), host->start_addr);
|
||||||
SDHCI_DMA_ADDRESS);
|
sdhci_writel(host, dma_addr, SDHCI_DMA_ADDRESS);
|
||||||
}
|
}
|
||||||
#if CONFIG_IS_ENABLED(MMC_SDHCI_ADMA)
|
#if CONFIG_IS_ENABLED(MMC_SDHCI_ADMA)
|
||||||
else if (host->flags & (USE_ADMA | USE_ADMA64)) {
|
else if (host->flags & (USE_ADMA | USE_ADMA64)) {
|
||||||
|
@ -163,8 +164,9 @@ static int sdhci_transfer_data(struct sdhci_host *host, struct mmc_data *data)
|
||||||
start_addr &=
|
start_addr &=
|
||||||
~(SDHCI_DEFAULT_BOUNDARY_SIZE - 1);
|
~(SDHCI_DEFAULT_BOUNDARY_SIZE - 1);
|
||||||
start_addr += SDHCI_DEFAULT_BOUNDARY_SIZE;
|
start_addr += SDHCI_DEFAULT_BOUNDARY_SIZE;
|
||||||
sdhci_writel(host, phys_to_bus((ulong)start_addr),
|
start_addr = dev_phys_to_bus(mmc_to_dev(host->mmc),
|
||||||
SDHCI_DMA_ADDRESS);
|
start_addr);
|
||||||
|
sdhci_writel(host, start_addr, SDHCI_DMA_ADDRESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (timeout-- > 0)
|
if (timeout-- > 0)
|
||||||
|
|
|
@ -736,6 +736,12 @@ struct mmc {
|
||||||
u8 hs400_tuning;
|
u8 hs400_tuning;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if CONFIG_IS_ENABLED(DM_MMC)
|
||||||
|
#define mmc_to_dev(_mmc) _mmc->dev
|
||||||
|
#else
|
||||||
|
#define mmc_to_dev(_mmc) NULL
|
||||||
|
#endif
|
||||||
|
|
||||||
struct mmc_hwpart_conf {
|
struct mmc_hwpart_conf {
|
||||||
struct {
|
struct {
|
||||||
uint enh_start; /* in 512-byte sectors */
|
uint enh_start; /* in 512-byte sectors */
|
||||||
|
|
Loading…
Add table
Reference in a new issue