how to allocate 9MB of memory in kernel ?

Arnd Bergmann arnd at arndb.de
Fri Jul 25 18:50:51 EST 2008


On Friday 25 July 2008, Misbah khan wrote:
> 
> I am really unaware of how can we get this physical address from the device
> tree which you have mentioned can you please explain this to me ???

With current Linux versions, all powerpc machines come with an open-firmware
like device tree, which describes all devices that are part of the
system. If your machine doesn't run an actual open firmware implementation,
you most likely have the device tree source in arch/powerpc/boot/dts/,
and that needs to describe your device.

Your init function should then not assume that the device is there, but
register an of_platform_driver for that device.
When the driver is loaded, it is then bound to your hardware, and a
struct of_device gets passed to a probe() function that does the
actual initialization.
That is the device you pass to of_iomap in order to mmap the I/O range.

	Arnd <><


More information about the Linuxppc-embedded mailing list