Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Aug 2017 16:58:59 -0700
From:      Mark Millard <markmi@dsl-only.net>
To:        Sylvain Garrigues <sylvain@sylvaingarrigues.com>
Cc:        freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: armv6 kernel support for Raspberry Pi 3 in default aarch32 mode
Message-ID:  <8910A9FB-E936-4576-97B1-B2EDCB1ED1AE@dsl-only.net>
In-Reply-To: <CAKT8nAgciFjG2iBVCFnUEQEMQ94mi80Sk%2BH_qmG_V31V=ks%2BJg@mail.gmail.com>
References:  <CAKT8nAiUYBOzvCoHz_rx4npMVvisqQgQLX1jRWhYzq5hk6wcGQ@mail.gmail.com> <AA7A410C-CED5-48C5-B62F-1FCD679DF317@dsl-only.net> <CAKT8nAgciFjG2iBVCFnUEQEMQ94mi80Sk%2BH_qmG_V31V=ks%2BJg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 2017-Aug-9, at 3:08 PM, Sylvain Garrigues <sylvain at =
sylvaingarrigues.com> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8910A9FB-E936-4576-97B1-B2EDCB1ED1AE>