From owner-freebsd-arm@FreeBSD.ORG Thu Feb 28 06:27:11 2013 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A349D4EA for ; Thu, 28 Feb 2013 06:27:11 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id 48D9CDB3 for ; Thu, 28 Feb 2013 06:27:10 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id r1S6R9KB042115 for freebsd-arm@freebsd.org; Thu, 28 Feb 2013 06:27:09 GMT (envelope-from kientzle@freebsd.org) Received: from [192.168.2.143] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id 4ib47fp559kfmeftpr3az9xrse; for freebsd-arm@freebsd.org; Thu, 28 Feb 2013 06:27:09 +0000 (UTC) (envelope-from kientzle@freebsd.org) From: Tim Kientzle Content-Type: multipart/signed; boundary="Apple-Mail=_2781E653-7090-4675-87D1-DADE99D8603C"; protocol="application/pgp-signature"; micalg=pgp-sha1 Subject: PHYSADDR Date: Wed, 27 Feb 2013 22:27:06 -0800 Message-Id: To: freebsd-arm@freebsd.org Mime-Version: 1.0 (Apple Message framework v1283) X-Mailer: Apple Mail (2.1283) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 06:27:11 -0000 --Apple-Mail=_2781E653-7090-4675-87D1-DADE99D8603C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Starting to look at what is needed for a Generic ARM kernel. There's a lot here; I sincerely hope I'm not the only one=85 ;-) First up: Can we get rid of PHYSADDR? I think we can always compute it at runtime from PC. For example, I think this works in several places: and r0, pc, #0xF0000000 And I've found at least one reference that I think can be simply eliminated: Index: arm/elf_trampoline.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- arm/elf_trampoline.c (revision 247250) +++ arm/elf_trampoline.c (working copy) @@ -169,7 +169,7 @@ void _startC(void) { - int physaddr =3D KERNPHYSADDR; + unsigned int physaddr =3D (unsigned int)&_start & 0xfffff000; int tmp1; unsigned int sp =3D ((unsigned int)&_end & ~3) + 4; #if defined(FLASHADDR) && defined(LOADERRAMADDR) @@ -189,10 +189,9 @@ */ unsigned int target_addr; unsigned int tmp_sp; - uint32_t src_addr =3D (uint32_t)&_start - PHYSADDR + = FLASHADDR - + (pc - FLASHADDR - ((uint32_t)&_startC - PHYSADDR)) = & 0xfffff000; + uint32_t src_addr =3D (uint32_t)&_start; =20 - target_addr =3D (unsigned int)&_start - PHYSADDR + = LOADERRAMADDR; + target_addr =3D (unsigned int)&_start - (pc & = 0xf0000000) + LOADERRAMADDR; tmp_sp =3D target_addr + 0x100000 + (unsigned int)&_end - (unsigned int)&_start; memcpy((char *)target_addr, (char *)src_addr, Tim --Apple-Mail=_2781E653-7090-4675-87D1-DADE99D8603C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) iQEcBAEBAgAGBQJRLvi7AAoJEGMNyGo0rfFBdMwIAL3EPXt8BlsCYTnt3/c3tpPW E4k6S06Nx9Q1YlQeO/mHV97WMJJ/zmbD0lKvFT6TIOAgbOqRiC2cq+AXRZLxwYLO ypzgHQz8wjvqOjwSgsKBzGymOpNwNdPYTgCCGLwv4VwM7Mlq7Hj8ZSVk00sbB26z O3e37u4YWYS8n8aIe8mNbnZDbj4QKM5OkTJ/NwcjS2Lj9108EB0VqcENcmITFo+U 9XnRaTOrbVQYy683iVLp7D7YHzrSjUQNPo0ik7SQ0ep0FIKixEpVoCBriAOwqn+e CSfKRgEj0+w5AeyjhR2aZQ4cAE2uxNzvpz9OPxe+KS0u8VXDSWqor7rMlYSi5IA= =uTxh -----END PGP SIGNATURE----- --Apple-Mail=_2781E653-7090-4675-87D1-DADE99D8603C--