[RFC] introduce ioremap() and dev_ioremap_resource()

Sascha Hauer s.hauer at pengutronix.de
Fri Dec 19 23:05:42 PST 2014


On Fri, Dec 19, 2014 at 05:12:19PM +0400, Antony Pavlov wrote:
> On Fri, 19 Dec 2014 07:45:42 +0100
> > > moreover dev_ioremap_resource() has the second 'struct resource *res'
> > > argument, so additional dev_get_resource() is needed.
> > > 
> > > Can we insert ioremap() into dev_request_mem_region() directly?
> > > (we also can use already existion IOMEM() macro instead of linux' ioremap()).
> > 
> > I'm not sure if it's a good idea to put that behind some standard
> > lookingioremap() call, because its behaviour is not standard.
> > 
> > I'm also fine with adding some
> > 
> > #ifdef CONFIG_MIPS
> > 	return mips_iomem(res->start);
> > #else
> > 	return (void __force __iomem *)res->start;
> > #endif
> > 
> > At least this makes explicit that MIPS has a very special handling.
> 
> We already have this in include/common.h
> 
> #if defined(CONFIG_MIPS)
> #include <asm/addrspace.h>
> 
> #define IOMEM(addr) ((void __force __iomem *)CKSEG1ADDR(addr))
> #else
> #define IOMEM(addr) ((void __force __iomem *)(addr))
> #endif
> 
> So can I use just
> 
>     return IOMEM(res->start);
> 
> in dev_request_mem_region()?

Yes, nice. That's the right solution then.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list