[PATCH 1/2] memsize: Make get_ram_size RAM proof

Juergen Beisert jbe at pengutronix.de
Thu Mar 7 09:10:38 EST 2013

Hi Maxime,

Maxime Ripard wrote:
> > [....]
> >
> > Unfortunately I had to drop this one. It breaks compilation on some
> > architectures which do not have _text and __bss_stop (namely blackfin
> > and another one I forgot about).
> >
> > Anyway, I realized that we now can start the MMU during early startup,
> > so when you call this function from your board code your SDRAM might
> > already be cached. I assume get_ram_size won't work reliably in this
> > case anymore.
> >
> > Since you only use it to detect whether you have 128MiB or 256Mib, could
> > you code a stripped down version of this function especially for your
> > board? Could you even adjust the SDRAM controller registers to the size
> > you really have? I have no idea if the SDRAM controller can cope with
> > that, but it might be worth giving it a try. I have a patch in the
> > queue moving the i.MX28 over to dynamically detecting the SDRAM size
> > via controller readback, so this then would simply detect the correct
> > size.
> I agree that this patch you're mentionning would be the best solution.
> However, the imx28 SDRAM controller doesn't seem to be able to be
> reconfigured, so once it has been configured once, you're screwed.

You have to do this test in the bootlets instead. As they run from the 
internal SRAM, you can do whatever you want with the SDRAM controller.


Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |

More information about the barebox mailing list