[meta-zephyr][PATCH 0/3] Add 96Boards Avenger96 support


Wojciech Zmuda
 

From: Wojciech Zmuda <wojciech.zmuda@huawei.com>

This patch set adds support of Avenger96 boards based on
STMicro STM32MP157AAC 2xCortex-A7+2xCortex-M4 SoC.
The support consists of:
- cloning dependencies i.e. STM32 HAL and OpenAMP framework,
- adding STM32MP1 and Avenger96 $MACHINE config files.

Verification:

1. Build an example app for Avenger96:

$ DISTRO=zephyr MACHINE=96b-avenger96 bitbake zephyr-philosophers

2. Please be aware that Avenger96's Cortex-M4 core can be
programmed and got out of reset only by software running
on the Cortex-A7 core, e.g. by U-Boot or Linux. Therefore,
despite the SoC can enter DFU mode, it cannot be used
for programming the M4 firmware. This example uses Linux.

3. Linux has to be built with remoteproc support. This can
be verified with simple dmesg inspection:

root@stm32mp1-av96:~# dmesg | grep remoteproc
[ 2.336231] remoteproc remoteproc0: m4 is available

4. Transfer the example app to the board, e.g. using scp.
The elf is located as usual in build/tmp-newlib/deploy/images/96b-avenger96/.

5. On the board, check the expected location of the fimrware image.
Empty path defaults to /lib/firmware. You can leave them as
they are and copy the Zephyr ELF file to the location pointed
by them or you can echo the new path and image name.

root@stm32mp1-av96:~# cat /sys/module/firmware_class/parameters/path
<empty>

root@stm32mp1-av96:~# cat /sys/class/remoteproc/remoteproc0/firmware
rproc-m4-fw

6. After the image path and name are configured, start the M4 core:

root@stm32mp1-av96:~# echo start > /sys/class/remoteproc/remoteproc0/state
remoteproc remoteproc0: powering up m4
remoteprocroc remoteproc0: Booting fw image rproc-m4-fw, size 591544
rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:m4_led (ops 0xc0be1210)
remoteproc remoteproc0: remote processor m4 is now

7. Firmware output can be inspected with:

root@stm32mp1-av96:~# cat /sys/kernel/debug/remoteproc/remoteproc0/trace0
Philosopher 5 [C:-2] STARVING
Philosopher 3 [P: 0] DROPPED ONE FORK
Philosopher 3 [P: 0] THINKING [ 25 ms ]
Philosopher 2 [P: 1] EATING [ 425 ms ]
Philosopher 3 [P: 0] STARVING
Philosopher 4 [C:-1] STARVING
Philosopher 4 [C:-1] HOLDING ONE FORK
Philosopher 4 [C:-1] EATING [ 800 ms ]
Philosopher 3 [P: 0] HOLDING ONE FORK
Philosopher 2 [P: 1] DROPPED ONE FORK
Philosopher 2 [P: 1] THINKING [ 725 ms ]
Philosopher 1 [P: 2] EATING [ 225 ms ]

Wojciech Zmuda (3):
zephyr-kernel: clone STM32 HAL
zephyr-kernel: clone OpenAMP
conf: machine: add 96boards Avenger96 support

classes/zephyr-kernel-src.bbclass | 6 ++++++
conf/machine/96b-avenger96.conf | 8 ++++++++
conf/machine/include/stm32mp1-cortex-m4.inc | 11 +++++++++++
recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc | 2 ++
4 files changed, 27 insertions(+)
create mode 100644 conf/machine/96b-avenger96.conf
create mode 100644 conf/machine/include/stm32mp1-cortex-m4.inc

--
2.25.1

Join yocto@lists.yoctoproject.org to automatically receive all group messages.