armv6 kernel support for Raspberry Pi 3 in default aarch32 mode

Mark Millard markmi at dsl-only.net
Wed Aug 9 23:59:04 UTC 2017


On 2017-Aug-9, at 3:08 PM, Sylvain Garrigues <sylvain at sylvaingarrigues.com> wrote:

> . . .
> 
> 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=0x200 line in config.txt (no arm_control by default).  
> 
> . . .

[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 
arm_control=0x200
dtparam=audio=on,i2c_arm=on,spi=on
dtoverlay=mmc
dtoverlay=pi3-disable-bt
device_tree_address=0x100
kernel=u-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=0
device_tree_address=0x100
device_tree=rpi2.dtb
kernel=u-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
]

===
Mark Millard
markmi at dsl-only.net



More information about the freebsd-arm mailing list