How to get Root filesystem on PHRAM

"Stern, Eli" <[email protected]> Thu, 11 Feb 2010 11:35:11 +0100
Newsgroups org.kernel.vger.linux-config
Message-ID <[email protected]>
I would like to have my root file system reside on a PHRAM.
Reason: Embedded Linux. This way I can download the file system into RAM, without burning it into Flash. This saves time. I know there are other ways, e.g. Ramdisk, but this will require creating and maintaining several types of images. The phram solution allows using the same image that is burned into Flash.

I tried to create a phram by adding the following to the kernel command line : 
    phram.phram=RAM0,0x83800000,8Mi
Then use it in the mtdparts :
    mtdparts=RAM0:0xcfb48@0x7f1cb8(Kernel)ro,0x21dc00(RootFileSystem)ro...

The result is:
    phram: out of memory

Looking at phram.c, seems phram_setup() attempts to kmalloc(), and it is probably too early in the startup sequence.

Is there a way to delay creation of the phram to a stage where kmalloc() is allowed?
On the other hand, is there a way to configure so my phram is always created (at the allowed time) regardless of the command line?

Thanx

Eli Stern