Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 1583

How do I use both internal SRAM and external SDRAM for malloc on RZA1?

$
0
0

We are using:

  • 3.12.x kernel
  • XIP for kernel base libraries
  • SPI flash for our application
  • external SDRAM for Linux
  • (parts of) internal SRAM for frame buffer

We would like to make the unused portion of the on-chip RAM available to malloc, basically to complement the external SDRAM.  Preferably in a manner that is completely transparent to any user space code that uses new or malloc.

So if I'm using 32MB external SDRAM, and I'm using 2MB out of 10MB for framebuffer, I'd like to end up with 32+(10-2)=40MB of RAM that is available to and managed by the Linux kernel and thus available for malloc etc.

Is this at all possible in Linux for RZ?  If so, is it possible in the 3.12 kernel and what exactly would need to go into the device tree and other files?

Now in absence of making this 100% transparent to Linux user space, I guess the next best thing would be to replace malloc w/ a custom implementation that is aware of the SRAM (and has mapped it into the user space address space via mmap). I think I understand how to override the default malloc so that the application is not even aware that a custom one is used, and I understand conceptually what this custom malloc would have to do, but struggling to find a library to provides a heap allocation implementation that is as good as malloc, in terms of ability to deal with fragmentation.   So any pointes to a good heap allocator library would also be appreciated.

 


Viewing all articles
Browse latest Browse all 1583

Trending Articles