diff mbox series

[1/2] net: pcnet: Replace mips-specific accessors

Message ID 20200418031543.427069-1-marek.vasut+renesas@gmail.com
State New
Headers show
Series [1/2] net: pcnet: Replace mips-specific accessors | expand

Commit Message

Marek Vasut April 18, 2020, 3:15 a.m. UTC
Replace mips-specific UNCACHED_SDRAM() macro with standard
map_physmem(), which permits the driver to work on other
systems than mips.

Signed-off-by: Marek Vasut <marek.vasut+renesas at gmail.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck at gmail.com>
Cc: Joe Hershberger <joe.hershberger at ni.com>
---
 drivers/net/pcnet.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Daniel Schwierzeck April 20, 2020, 11:07 a.m. UTC | #1
Am 18.04.20 um 05:15 schrieb Marek Vasut:
> Replace mips-specific UNCACHED_SDRAM() macro with standard
> map_physmem(), which permits the driver to work on other
> systems than mips.
> 
> Signed-off-by: Marek Vasut <marek.vasut+renesas at gmail.com>
> Cc: Daniel Schwierzeck <daniel.schwierzeck at gmail.com>
> Cc: Joe Hershberger <joe.hershberger at ni.com>
> ---
>  drivers/net/pcnet.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck at gmail.com>

BTW: after this patch, arch/mips/lib/bootm.c is the only user of
UNCACHED_SDRAM. I'll prepare a patch to remove that old macro entirely.

> 
> diff --git a/drivers/net/pcnet.c b/drivers/net/pcnet.c
> index 59241c95bc..e7d6c8d714 100644
> --- a/drivers/net/pcnet.c
> +++ b/drivers/net/pcnet.c
> @@ -332,7 +332,9 @@ static int pcnet_init(struct eth_device *dev, bd_t *bis)
>  		addr = (unsigned long)memalign(ARCH_DMA_MINALIGN,
>  					       sizeof(*lp->uc));
>  		flush_dcache_range(addr, addr + sizeof(*lp->uc));
> -		addr = UNCACHED_SDRAM(addr);
> +		addr = (unsigned long)map_physmem(addr,
> +				roundup(sizeof(*lp->uc), ARCH_DMA_MINALIGN),
> +				MAP_NOCACHE);
>  		lp->uc = (struct pcnet_uncached_priv *)addr;
>  
>  		addr = (unsigned long)memalign(ARCH_DMA_MINALIGN,
>
diff mbox series

Patch

diff --git a/drivers/net/pcnet.c b/drivers/net/pcnet.c
index 59241c95bc..e7d6c8d714 100644
--- a/drivers/net/pcnet.c
+++ b/drivers/net/pcnet.c
@@ -332,7 +332,9 @@  static int pcnet_init(struct eth_device *dev, bd_t *bis)
 		addr = (unsigned long)memalign(ARCH_DMA_MINALIGN,
 					       sizeof(*lp->uc));
 		flush_dcache_range(addr, addr + sizeof(*lp->uc));
-		addr = UNCACHED_SDRAM(addr);
+		addr = (unsigned long)map_physmem(addr,
+				roundup(sizeof(*lp->uc), ARCH_DMA_MINALIGN),
+				MAP_NOCACHE);
 		lp->uc = (struct pcnet_uncached_priv *)addr;
 
 		addr = (unsigned long)memalign(ARCH_DMA_MINALIGN,