What to do when redboot lies about RAM?

Aleksandr Rybalko ray at dlink.ua
Thu Mar 10 09:12:23 UTC 2011


On Thu, 10 Mar 2011 08:41:08 +0530
"Jayachandran C." <c.jayachandran at gmail.com> wrote:

>> On Thu, Mar 10, 2011 at 8:13 AM, Adrian Chadd <adrian at freebsd.org> wrote:
>> > One of the Ubiquiti boards (LS-SR71) has redboot firmware that seems to lie
>> > about the amount of RAM it has.
>> >
>> > Although the board has 32 megabytes of RAM, Redboot only reports 16mb. Linux
>> > doesn't query redboot; it probes the amount of RAM by writing bits and
>> > reading them back until it finds where that fails.
>> >
>> > I've whacked together a quick hack to make this memory selection overridable
>> > in the kernel configuration.
>> > What would be the cleaner way? :)
>> 
>> Sibyte (mips/sibyte/sb_machdep.c) has a tunable hw.physmem for this.
>> That has an advantage that you do not have to re-compile the kernel to
>> change the memory setting.
>> 
>> There is also a MAXMEM option already in conf/options.mips which can
>> be used I think...
>> 
>> JC.
>> _______________________________________________
>> freebsd-mips at freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-mips
>> To unsubscribe, send any mail to "freebsd-mips-unsubscribe at freebsd.org"

Hi there,

for that case will be nice to have (and use) some fallback variable in nvram/U-Boot env.
something like realmem_override.

Also we can use realmem testing algorithm:
1. backup uint32 in some place of minimum memory size (think 8M)
2. write some unique signature in that place
3. for (i = 8M; place < sdram_window_size; i <<= 1)
	if (*(i + place) == signature) {
		*place = ~signature;
		if (*(i + place) == ~signature) {
			printf("Found memory \"address wire\" alias, realmem=%08x\n", i);
			break;
		}
		/* Restore signature */
		*place = signature;
	}

-- 
Alexandr Rybalko <ray at dlink.ua> 
aka Alex RAY <ray at ddteam.net>


More information about the freebsd-mips mailing list