Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Mar 2011 10:40:38 +0200
From:      Aleksandr Rybalko <ray@dlink.ua>
To:        "Jayachandran C." <c.jayachandran@gmail.com>
Cc:        freebsd-mips@freebsd.org
Subject:   Re: What to do when redboot lies about RAM?
Message-ID:  <20110310104038.b67b3c5b.ray@dlink.ua>
In-Reply-To: <AANLkTimK4s82hSzenLCh40LQZHptb%2BHiJ%2BDJpYBE8bJ2@mail.gmail.com>
References:  <AANLkTik4yE1RDg7TTNxgph4m2EimRcpLY=EG=ZTc%2BVbc@mail.gmail.com> <AANLkTimK4s82hSzenLCh40LQZHptb%2BHiJ%2BDJpYBE8bJ2@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 10 Mar 2011 08:41:08 +0530
"Jayachandran C." <c.jayachandran@gmail.com> wrote:

>> On Thu, Mar 10, 2011 at 8:13 AM, Adrian Chadd <adrian@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@freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-mips
>> To unsubscribe, send any mail to "freebsd-mips-unsubscribe@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@dlink.ua> 
aka Alex RAY <ray@ddteam.net>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110310104038.b67b3c5b.ray>