Subject: Re: struct _BootConfig is ... strange...
To: None <port-hpcarm@netbsd.org>
From: Ignatios Souvatzis <is@netbsd.org>
List: port-hpcarm
Date: 02/21/2006 20:54:17
--ReaqsoxgOBHFXBhH
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Feb 21, 2006 at 05:57:44PM +0000, Robert Swindells wrote:
>=20
> Ignatios Souvatzis wrote:
> >I've spent about 4 days in total in the last few months debugging a
> >strange startup problem with the Jornada 820 which runs out to having
> >been caused by this part of hpcarm/include/bootconfig.h:
>=20
> >#define DRAM_BLOCKS     1
>=20
> >typedef struct _BootConfig {
> >        PhysMem dram[DRAM_BLOCKS];
> >	u_int dramblocks;
> >	u_int kernsize;
> >} BootConfig;
>=20
> >Why exactly is this written that way?
>=20
> It is copied from cats.
>=20
> The DRAM_BLOCKS define ought to be 4 on SA11x0/PXA2xx systems, that is
> what I was using for the webpad port that I did.
>=20
> How are you getting on with the port ?

Fighting with strange effects, that would not have been there without the=
=20
1 above.

I've moved the SACOM_BASE hack to 0xd800d000 and moved the
corresponding page table in initarm(). After that, the kernel was
recognizing all 32 MB of memory and asking for the root device when
I uvm_physload()ed the 2nd memory bank "manually"; when I tried to
add it to the dram array to have one place where it is defined, all
hell broke loose, so I spent two hours debugging that instead of moving
the serial port to some really out-of-the-way address.

Next steps would have been to create a config option for the memory
configuration - do all HPCARM have SA1100/SA1110-like DRAM controllers?
In that case, make it definable as an array {4096, 0, 4096, 0} for an
expanded 820 or {4096, 0, 0, 0} for a simple '820 or, I think,
{8192, 0, 0, 0} for an 728? would be possible.

We can still change this later if we find a way to get the memory
configuration from WinCE via the boot loader, or to probe the four DRAM
blocks at 0xc0000000, 0xc8000000, 0xd0000000, 0xd8000000, ourselves.

Opinions?

What would break, if I'd change DRAM_BLOCKS to 4 ? Is it passed from the
boot loader at all?

Regards,
	Ignatios Souvatzis


--=20
seal your e-mail: http://www.gnupg.org/

--ReaqsoxgOBHFXBhH
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (NetBSD)

iD8DBQFD+2/oN4tiz3B8hB0RAg7tAJ40STsk/zYeZAuqoyg/7GoyEzofTQCgsZRK
Q60RQqGedCzqJbBEhNSUQGY=
=8s4x
-----END PGP SIGNATURE-----

--ReaqsoxgOBHFXBhH--