From owner-freebsd-arm@freebsd.org Wed Aug 9 23:59:04 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 29CAADD8855 for ; Wed, 9 Aug 2017 23:59:04 +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 C4C12653E9 for ; Wed, 9 Aug 2017 23:59:03 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 18438 invoked from network); 10 Aug 2017 00:03:55 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 10 Aug 2017 00:03:55 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.2) with SMTP; Wed, 09 Aug 2017 19:59:01 -0400 (EDT) Received: (qmail 30397 invoked from network); 9 Aug 2017 23:59:01 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 9 Aug 2017 23:59:01 -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 A8D7FEC7E2B; Wed, 9 Aug 2017 16:59:00 -0700 (PDT) Content-Type: text/plain; charset=us-ascii 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: Date: Wed, 9 Aug 2017 16:58:59 -0700 Cc: freebsd-arm Content-Transfer-Encoding: quoted-printable Message-Id: <8910A9FB-E936-4576-97B1-B2EDCB1ED1AE@dsl-only.net> References: 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: Wed, 09 Aug 2017 23:59:04 -0000 On 2017-Aug-9, at 3:08 PM, Sylvain Garrigues wrote: > . . . >=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 > . . . [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.)] Seems to be as you say above. But. . . 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.) FreeBSD for aarch64 on an rpi3 is only designed to deal with its sysutils/u-boot-rpi3 u-boot context: # 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 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. 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. Similarly for FreeBSD armv6 (/v7) on an rpi2v1.1 (or before): # 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 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). There is no u-boot variant that is explicitly for rpi2v1.2+. 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. [Note: My /usr/ports/ is at: # svnlite info /usr/ports/ | grep "Re[plv]" Relative URL: ^/head Repository Root: svn://svn.freebsd.org/ports Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5 Revision: 447082 Last Changed Rev: 447082 ] =3D=3D=3D Mark Millard markmi at dsl-only.net