All of lore.kernel.org
 help / color / mirror / Atom feed
* ioremap to a specific virtual address
@ 2012-03-23  0:23 jonsmirl at gmail.com
  2012-03-23  4:00 ` Nicolas Pitre
  0 siblings, 1 reply; 26+ messages in thread
From: jonsmirl at gmail.com @ 2012-03-23  0:23 UTC (permalink / raw)
  To: linux-arm-kernel

When iotable is used to initially map memory you can specify the
mapping address. In this case IO_SDMMC_PHYS is 0x18000000 and it gets
mapped to  0xf1800000

NXP has supplied this handly macro
#define io_p2v(x) (0xf0000000 | (((x) & 0xff000000) >> 4) | ((x) & 0x000fffff))

iotable_init(lpc313x_io_desc, ARRAY_SIZE(lpc313x_io_desc));

	{
		.virtual	= io_p2v(IO_SDMMC_PHYS),
		.pfn		= __phys_to_pfn(IO_SDMMC_PHYS),
		.length		= IO_SDMMC_SIZE,
		.type		= MT_DEVICE
	},

The supplied kernel is full of code that uses this type of addressing.
It has macros for register definition that all depend on the registers
being mapped to a well know location - io_p2v(x).

I'd like to move the map out of the core code and into the SDMMC
device driver and then only do it if the driver loads.  Is there some
way to ioremap to a specific address on ARM? Or is there another way
to build the mapping in the driver?

-- 
Jon Smirl
jonsmirl at gmail.com

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

end of thread, other threads:[~2012-04-02  7:31 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-23  0:23 ioremap to a specific virtual address jonsmirl at gmail.com
2012-03-23  4:00 ` Nicolas Pitre
2012-03-23  4:17   ` jonsmirl at gmail.com
2012-03-23  4:28     ` Nicolas Pitre
2012-03-23 13:25       ` jonsmirl at gmail.com
2012-03-23 14:07         ` Arnd Bergmann
2012-03-23 14:32           ` jonsmirl at gmail.com
2012-03-23 14:49             ` Arnd Bergmann
2012-03-23 15:20             ` Arnd Bergmann
2012-03-23 18:28               ` jonsmirl at gmail.com
2012-03-23 19:31                 ` Arnd Bergmann
2012-03-24  1:14                   ` jonsmirl at gmail.com
2012-03-25 17:34                     ` Arnd Bergmann
2012-03-26  8:47                       ` Arnd Bergmann
2012-03-26 13:11                         ` jonsmirl at gmail.com
2012-03-26 11:21                   ` jonsmirl at gmail.com
2012-03-23 14:52           ` Roland Stigge
2012-03-23 15:05             ` jonsmirl at gmail.com
2012-03-23 15:12               ` Roland Stigge
2012-03-31 23:12   ` jonsmirl at gmail.com
2012-03-31 23:52     ` Nicolas Pitre
2012-04-01  0:08       ` jonsmirl at gmail.com
2012-04-01 19:46         ` Arnd Bergmann
2012-04-01 21:41           ` jonsmirl at gmail.com
2012-04-02  1:18             ` Nicolas Pitre
2012-04-02  7:31               ` Arnd Bergmann

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.