summaryrefslogtreecommitdiff
path: root/drivers/mmc/pci_mmc.c
diff options
context:
space:
mode:
authorBernhard Messerklinger <bernhard.messerklinger@br-automation.com>2018-02-15 09:09:43 +0100
committerBin Meng <bmeng.cn@gmail.com>2018-03-30 16:05:08 +0800
commit0851f344d7b3ef73e2520d4b6f5ad1e3bca8dc44 (patch)
tree9a3dfafe4f21de1229d7cb0b983bfb14be38655d /drivers/mmc/pci_mmc.c
parentee1109bb45be4aaf057a44a70c9bdf2d7ff5bbc7 (diff)
downloadu-boot-0851f344d7b3ef73e2520d4b6f5ad1e3bca8dc44.tar.gz
x86: mmc: Fix mapping of BAR memory
Use dm_pci_map_bar function for BAR mapping. This has the advantage of clearing BAR flags and and only accepting mapped memory. Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com> Reviewed-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/mmc/pci_mmc.c')
-rw-r--r--drivers/mmc/pci_mmc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mmc/pci_mmc.c b/drivers/mmc/pci_mmc.c
index 05c0044a7a..b7a2ebfe3f 100644
--- a/drivers/mmc/pci_mmc.c
+++ b/drivers/mmc/pci_mmc.c
@@ -29,11 +29,10 @@ static int pci_mmc_probe(struct udevice *dev)
struct pci_mmc_plat *plat = dev_get_platdata(dev);
struct pci_mmc_priv *priv = dev_get_priv(dev);
struct sdhci_host *host = &priv->host;
- u32 ioaddr;
int ret;
- dm_pci_read_config32(dev, PCI_BASE_ADDRESS_0, &ioaddr);
- host->ioaddr = map_sysmem(ioaddr, 0);
+ host->ioaddr = (void *)dm_pci_map_bar(dev, PCI_BASE_ADDRESS_0,
+ PCI_REGION_MEM);
host->name = dev->name;
ret = sdhci_setup_cfg(&plat->cfg, host, 0, 0);
if (ret)