All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] x86: mmc: Fix mapping of BAR memory
@ 2018-02-15  8:09 Bernhard Messerklinger
  2018-02-15  8:37 ` Hannes Schmelzer
  2018-03-19  3:43 ` Bin Meng
  0 siblings, 2 replies; 4+ messages in thread
From: Bernhard Messerklinger @ 2018-02-15  8:09 UTC (permalink / raw)
  To: u-boot

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>
---

 drivers/mmc/pci_mmc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/pci_mmc.c b/drivers/mmc/pci_mmc.c
index 05c0044a7a..616af5afbf 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)
-- 
2.16.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] x86: mmc: Fix mapping of BAR memory
  2018-02-15  8:09 [U-Boot] [PATCH] x86: mmc: Fix mapping of BAR memory Bernhard Messerklinger
@ 2018-02-15  8:37 ` Hannes Schmelzer
  2018-03-19  3:43 ` Bin Meng
  1 sibling, 0 replies; 4+ messages in thread
From: Hannes Schmelzer @ 2018-02-15  8:37 UTC (permalink / raw)
  To: u-boot

> Von: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
> An: u-boot at lists.denx.de
> Kopie: hannes.schmelzer at br-automation.com, Bernhard Messerklinger 
> <bernhard.messerklinger@br-automation.com>, Bin Meng 
<bmeng.cn@gmail.com>, 
> Simon Glass <sjg@chromium.org>, Jaehoon Chung <jh80.chung@samsung.com>
> Datum: 15.02.2018 09:09
> Betreff: [PATCH] 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>
> ---
> 
>  drivers/mmc/pci_mmc.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/pci_mmc.c b/drivers/mmc/pci_mmc.c
> index 05c0044a7a..616af5afbf 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)
> -- 
> 2.16.1
> 

Reviewed-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] x86: mmc: Fix mapping of BAR memory
  2018-02-15  8:09 [U-Boot] [PATCH] x86: mmc: Fix mapping of BAR memory Bernhard Messerklinger
  2018-02-15  8:37 ` Hannes Schmelzer
@ 2018-03-19  3:43 ` Bin Meng
  2018-03-30  7:32   ` Bin Meng
  1 sibling, 1 reply; 4+ messages in thread
From: Bin Meng @ 2018-03-19  3:43 UTC (permalink / raw)
  To: u-boot

On Thu, Feb 15, 2018 at 4:09 PM, Bernhard Messerklinger
<bernhard.messerklinger@br-automation.com> wrote:
> 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>
> ---
>
>  drivers/mmc/pci_mmc.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] x86: mmc: Fix mapping of BAR memory
  2018-03-19  3:43 ` Bin Meng
@ 2018-03-30  7:32   ` Bin Meng
  0 siblings, 0 replies; 4+ messages in thread
From: Bin Meng @ 2018-03-30  7:32 UTC (permalink / raw)
  To: u-boot

On Mon, Mar 19, 2018 at 11:43 AM, Bin Meng <bmeng.cn@gmail.com> wrote:
> On Thu, Feb 15, 2018 at 4:09 PM, Bernhard Messerklinger
> <bernhard.messerklinger@br-automation.com> wrote:
>> 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>
>> ---
>>
>>  drivers/mmc/pci_mmc.c | 5 ++---
>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

applied to u-boot-x86, thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-03-30  7:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-15  8:09 [U-Boot] [PATCH] x86: mmc: Fix mapping of BAR memory Bernhard Messerklinger
2018-02-15  8:37 ` Hannes Schmelzer
2018-03-19  3:43 ` Bin Meng
2018-03-30  7:32   ` Bin Meng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.