Code: Select all
REVISION=`cat /proc/cpuinfo | grep Revision | cut -f 2 -d ":"`
if [ ${REVISION:(-2)} -gt "04" ];
then
echo "512MB RAM"
else
echo "256MB RAM"
fi
Code: Select all
REVISION=`cat /proc/cpuinfo | grep Revision | cut -f 2 -d ":"`
if [ ${REVISION:(-2)} -gt "04" ];
then
echo "512MB RAM"
else
echo "256MB RAM"
fi
That's not going to help if you've booted a 512MB device with 256MB firmware - the only sure fire way is to check the revision number, or look at the markings on the RAM chip.RaTTuS wrote:Oo
it's easier to do
free -h
as ^ that will not show you anything about memory
At this point in time, a Revision number (from /proc/cpuinfo) of 5 would strongly suggest a 512MB device, below 5 and it's almost certainly 256MB.RaTTuS wrote:revision number is not going to help
Code: Select all
pi@raspberrypi ~ $ cat /proc/cpuinfo
Processor : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 996.14
Features : swp half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7
Hardware : BCM2708
Revision : 100000f

Aha, that explains why one of mine is now showing 15 (booted on latest firmware) and the other (on older firmware) still shows 5!dom wrote:unfortunately one of the manufacturers didn't update their OTP corrrectly and report 5. If you update to latest firmware we will correct that to 15.

Indeed. And removing the plethora of start.elf variants would be nice too. Perhaps just specify how much RAM you want the GPU to have, then then ARM has can have the rest (of the 256M or 512M).NerdUno wrote:There needs to be a straight-forward way to use the same firmware for BOTH 256MB and 512MB boards.
Which is fine, but what if the OS wants 256MB GPU RAM on a 512MB board, but only 128MB on a 256MB, ie. different GPU allocations based on total available RAM (maybe with reduced functionality on the 256MB board)? This would suggest that two values are required (though this could default to a single value in some circumstances, such as when only 128MB or any value that works for both models is required).dom wrote: Indeed. And removing the plethora of start.elf variants would be nice too. Perhaps just specify how much RAM you want the GPU to have, then then ARM has can have the rest (of the 256M or 512M).

That makes it more complicated. The XBMC distros already handle this. They read board_rev and copy start.elf files as appropritate, so they could edit the config.txt.milhouse wrote:Which is fine, but what if the OS wants 256MB GPU RAM on a 512MB board, but only 128MB on a 256MB, ie. different GPU allocations based on total available RAM (maybe with reduced functionality on the 256MB board)? This would suggest that two values are required (though this could default to a single value in some circumstances, such as when only 128MB or any value that works for both models is required).
To be honest, that sounds more complicated to me...dom wrote:You can pick one or the other. And if you pick both it sums them. E.g. that would give you 128M on a 256M board, and 192M on a 512M board.
i like this solution with only one generic start.elf much more then all others.dom wrote: That makes it more complicated. The XBMC distros already handle this. They read board_rev and copy start.elf files as appropritate, so they could edit the config.txt.
We could have two options:
gpu_mem=64
gpu_mem_percent=25
You can pick one or the other. And if you pick both it sums them. E.g. that would give you 128M on a 256M board, and 192M on a 512M board.
Confirmed.dextrus wrote: Can someone else confirm that the 192Mb .elf only gives 256Mb free RAM on a 512Mb Pi please?
Not necessarily a disaster, but certainly not ideal - a better solution is on the list of things to do (and lets be fair, it's only become a problem with the introduction of the 512MB model, and I ain't complaining about that!)dextrus wrote:Well, that's a disaster isn't it?
Does this mean that if you have a 512Mb Pi you *must* split the memory 256Mb or above to get the full RAM?
/Dextrus
None of the sub-256 memory split elf's will give access to the full 512MB - the only way to access it is with the 256MB+ elfs (256/384/448/496). Other than the inability to swap the card between a 256 and 512 model, I don't really see a problem - they both allocate roughly the same RAM amounts to the GPU, with the remainder available to the ARM (the naming convention of the various elf files relates to the amount of RAM that will be available to the ARM).dextrus wrote:128Mb split (arm128_start.elf) also doesn't use the available memory. As far as I can tell. This is the default start.elf too.
What's the problem then, other than the one I acknowledged as being a problem?dextrus wrote:I simply can't understand why you don't think this is a problem. Try and think like normal people and get back to me.
/Dextrus