mapping large amount of memory on physical addresses

Jean-Christophe Dubois jcd at tribudubois.net
Thu Mar 17 20:57:20 EST 2005


Hello Sophie,

If you really need the 36MB block in DV to be a physically contiguous
memory block one possible simple solution would be to exclude both high
memory blocks from Linux at boot time with mem=220M on the cmdline.

Then you could write 2 simple mapping drivers for the DV and MC memory
blocks. This would allow you to map the 2 areas from user space and copy
data back and forth. The drivers you would write would not do ioremap()
but rather remap_page_range() in the implementation of the mmap()
function.

Now I am not sure if you want to use the PPC to transfer data between
the 2 areas or if you have some other hardware mean to do it. If so you
could also integrate this in your driver.

Now if you don't really care if the 36MB block is physically contiguous
(but only logically contiguous and physically scattered), you would
write only the MC driver part and use standard memory allocation for the
36MB block (with the drawback that you will not be necessarily sure to
be able to allocate such memory block as it would not be
pre-allocated/reserved and it depends if there is enough free space at
the allocation time. So pre-allocation at boot time could be your best
bet anyway).

Regards

JC
  
On Thu, 2005-03-17 at 09:51 +0100, scarayol at assystembrime.com wrote:
> Hello,
> 
> Could you help me : I work on embedded Linux on a MPC885 processor
> (PowerPC). On my embedded system, i have 2 different components of RAM. One
> (name = DV, total size of 256 MB ) is only accessed by the processor, the
> other (name = MC, size = 2MB on the top of the RAM) is also access by an
> FPGA. I want to do data transferts between each others. For that, I have to
> allocate a big structure on DV for a size of 36 MB.
> - Could I do like that to have contiguous memory on DV ?
> For MC, it would be more complicated : I have to map on the physical
> adresses of MC (for example 1300 0000-13FF FFFF) in order to be sure that
> the memory will be really allocated on MC and not on DV (as there is enough
> place on DV).
> - How can I do that ?
> - Do I have to write a driver and use ioremap on the physical address of MC
> (with reserving the top of memory with 'mem=' at boot time) ? Can i use
> physical addresses with ioremap or is it only virtual addresses ?
> I think i can reserve the memory early in boot via the bootmem allocator
> but i think it isn't with physical addresses only an amount of memory and
> it's only forbdrivers directly linked in  the kernel image and i want a
> module.
> - Is there another solution to do that ?
> 
> Thank you really for your help.
> 
> Best regards.
> 
> ----------------------------------------------------------
> Sophie CARAYOL
> 
> TECHNOLOGIES & SYSTEMES
> 50 rue du Président Sadate
> F - 29337 QUIMPER CEDEX
> 
> Tél: +33 2 98 10 30 06
> mailto:scarayol at assystembrime.com
> ----------------------------------------------------------
> 
> 
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded at ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded




More information about the Linuxppc-embedded mailing list