From owner-freebsd-arm@freebsd.org Thu Aug 10 01:46:05 2017 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 716D0DDB8D7 for ; Thu, 10 Aug 2017 01:46:05 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-91.reflexion.net [208.70.210.91]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34C346922F for ; Thu, 10 Aug 2017 01:46:04 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 27380 invoked from network); 10 Aug 2017 01:46:03 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 10 Aug 2017 01:46:03 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.2) with SMTP; Wed, 09 Aug 2017 21:46:03 -0400 (EDT) Received: (qmail 17648 invoked from network); 10 Aug 2017 01:46:03 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 10 Aug 2017 01:46:03 -0000 Received: from [192.168.1.26] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id A9C8CEC8559; Wed, 9 Aug 2017 18:46:02 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: armv6 kernel support for Raspberry Pi 3 in default aarch32 mode From: Mark Millard In-Reply-To: <8910A9FB-E936-4576-97B1-B2EDCB1ED1AE@dsl-only.net> Date: Wed, 9 Aug 2017 18:45:58 -0700 Cc: freebsd-arm Content-Transfer-Encoding: quoted-printable Message-Id: References: <8910A9FB-E936-4576-97B1-B2EDCB1ED1AE@dsl-only.net> To: Sylvain Garrigues X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Aug 2017 01:46:05 -0000 On 2017-Aug-9, at 4:58 PM, Mark Millard wrote: > On 2017-Aug-9, at 3:08 PM, Sylvain Garrigues wrote: >=20 >> . . . >>=20 >> On Raspberry Pi 3, the cortex-a53 processor starts in the aarch32 = state if I'm correct, provided you don't add any arm_control=3D0x200 = line in config.txt (no arm_control by default). =20 >>=20 >> . . . >=20 > [As we go beyond what I can find material to quote that > directly applies take the word of folks like Ian Lepore > (and others) over anything I write. (I'm lookging up > things as I go.)] >=20 > Seems to be as you say above. But. . . >=20 > Note: aarch32 does not support armv6, just an > variation on armv7. I've already listed in prior > submittals some differences between aarch32 and > armv7 that I found mention of. (Linux goes so far > as to be configurable to partially-emulate some > missing instructions, for example. FreeBSD does > not.) >=20 > FreeBSD for aarch64 on an rpi3 is only designed to deal > with its sysutils/u-boot-rpi3 u-boot context: >=20 > # more /usr/local/share/u-boot/u-boot-rpi3/config.txt=20 > arm_control=3D0x200 > dtparam=3Daudio=3Don,i2c_arm=3Don,spi=3Don > dtoverlay=3Dmmc > dtoverlay=3Dpi3-disable-bt > device_tree_address=3D0x100 > kernel=3Du-boot.bin >=20 > This indicates that this u-boot likely is in control of > the aarch32 vs. aarch64 execution state that the FreeBSD > kernel starts in. And u-boot-rpi3 sets up aarch64 and > the aarch64 FreeBSD kernel requires that if I understand > right. >=20 > FreeBSD has no established u-boot variant for starting > armv8 in an aarch32 execution state (or cortex-a53 > specifically) and no later stages of booting that > are designed to handle handoff from such a u-boot > variant. At least that is my understanding. >=20 > Similarly for FreeBSD armv6 (/v7) on an rpi2v1.1 (or before): >=20 > # more /usr/local/share/u-boot/u-boot-rpi2/config.txt > disable_commandline_tags=3D0 > device_tree_address=3D0x100 > device_tree=3Drpi2.dtb > kernel=3Du-boot.bin >=20 > This u-boot-rpi2 is not designed to deal with > armv8 related early boot issues or other > aarach32 vs. armv7 differences at all: > It is limited to armv6/7: The design and > implementation predate the v8 context and no > armv8 or aarch32 support has been added as far > as I know. u-boot-rpi2, later loader stages, > and possibly even FreeBSD may well still use > instructions (or other things) that are not > supported by the aarch32 execution state on > armv8 (cortex-a53). >=20 > There is no u-boot variant that is explicitly > for rpi2v1.2+. >=20 >=20 > Overall: Supporting aarch32 is not automatic > even if one starts from armv7 or specifically > a cortex-a53 context unless one was lucky > enough to happen to not touch or depend on > any of the differences at any stage. > . . . I'll remind that if you try an old enough rpi2 B V1.1- raspbian image/boot files it will not boot a rpi3. At a given point they announced a file set that started to support booting the rpi3. Quoting a reference to this: https://www.raspberrypi.org/forums/viewtopic.php?t=3D58151 says: "If you use a PI3, note that it will only boot past the "rainbow screen" if you feed it the right (latest) boot files. So in case of trouble try using the latest Raspbian from the download page, or try updating your older software on an earlier PI on which it boots, with Raspbian that should work." And: https://www.raspberrypi.org/blog/raspberry-pi-3-on-sale/ says: "You=E2=80=99ll need a recent NOOBS or Raspbian image from our downloads page." So: Raspbian and its related boot files did not automatically support the rpi3 but had to be changed to do so. =3D=3D=3D Mark Millard markmi at dsl-only.net