Skip to content

Commit 1ed04e7

Browse files
JiafeiPanaescolar
authored andcommitted
board: imx8mp_evk: update doc to add remoteproc boot
Add document for boot M7 Core by using Linux remoteproc to address some known issues when boot DDR Zephyr kernel. Signed-off-by: Jiafei Pan <[email protected]>
1 parent dcfc3e7 commit 1ed04e7

File tree

1 file changed

+86
-1
lines changed

1 file changed

+86
-1
lines changed

boards/nxp/imx8mp_evk/doc/index.rst

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,19 @@ At compilation time you have to choose which RAM will be used. This
181181
configuration is done based on board name (imx8mp_evk/mimx8ml8/m7 for ITCM and
182182
imx8mp_evk/mimx8ml8/m7/ddr for DDR).
183183

184+
There are two methods to load M7 Core images: U-Boot command and Linux remoteproc.
185+
186+
Load and Run M7 Zephyr Image from U-Boot
187+
========================================
188+
184189
Load and run Zephyr on M7 from A53 using u-boot by copying the compiled
185190
``zephyr.bin`` to the first FAT partition of the SD card and plug the SD
186191
card into the board. Power it up and stop the u-boot execution at prompt.
187192

188193
Load the M7 binary onto the desired memory and start its execution using:
189194

190195
ITCM
191-
===
196+
====
192197

193198
.. code-block:: console
194199
@@ -205,6 +210,86 @@ DDR
205210
dcache flush
206211
bootaux 0x80000000
207212
213+
Load and Run M7 Zephyr Image by using Linux remoteproc
214+
======================================================
215+
216+
Prepare device tree:
217+
218+
The device tree must inlcude CM7 dts node with compatible string "fsl,imx8mn-cm7",
219+
and also need to reserve M4 DDR memory if using DDR code and sys address, and also
220+
need to put "m4_reserved" in the list of memory-region property of the cm7 node.
221+
222+
.. code-block:: console
223+
224+
reserved-memory {
225+
#address-cells = <2>;
226+
#size-cells = <2>;
227+
ranges;
228+
229+
m7_reserved: m4@80000000 {
230+
no-map;
231+
reg = <0 0x80000000 0 0x1000000>;
232+
};
233+
...
234+
}
235+
236+
237+
imx8mp-cm7 {
238+
compatible = "fsl,imx8mn-cm7";
239+
rsc-da = <0x55000000>;
240+
clocks = <&clk IMX8MP_CLK_M7_DIV>,
241+
<&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_AUDPLL_ROOT>;
242+
clock-names = "core", "audio";
243+
mbox-names = "tx", "rx", "rxdb";
244+
mboxes = <&mu 0 1
245+
&mu 1 1
246+
&mu 3 1>;
247+
memory-region = <&vdevbuffer>, <&vdev0vring0>, <&vdev0vring1>, <&rsc_table>, <&m7_reserved>;
248+
status = "okay";
249+
fsl,startup-delay-ms = <500>;
250+
};
251+
252+
Extra Zephyr Kernel configure item for DDR Image:
253+
254+
If use remotepoc to boot DDR board (imx8mp_evk/mimx8ml8/m7/ddr), also need to enable
255+
"CONFIG_ROMSTART_RELOCATION_ROM" in order to put romstart memory section into ITCM because
256+
M7 Core will get the first instruction from zero address of ITCM, but romstart relocation
257+
will make the storage size of zephyr.bin too large, so we don't enable it by default in
258+
board defconfig.
259+
260+
.. code-block:: console
261+
262+
diff --git a/boards/nxp/imx8mp_evk/imx8mp_evk_mimx8ml8_m7_ddr_defconfig b/boards/nxp/imx8mp_evk/imx8mp_evk_mimx8ml8_m7_ddr_defconfig
263+
index 17542cb4eec..8c30c5b6fa3 100644
264+
--- a/boards/nxp/imx8mp_evk/imx8mp_evk_mimx8ml8_m7_ddr_defconfig
265+
+++ b/boards/nxp/imx8mp_evk/imx8mp_evk_mimx8ml8_m7_ddr_defconfig
266+
@@ -12,3 +12,4 @@ CONFIG_CONSOLE=y
267+
CONFIG_XIP=y
268+
CONFIG_CODE_DDR=y
269+
CONFIG_PINCTRL=y
270+
+CONFIG_ROMSTART_RELOCATION_ROM=y
271+
272+
Then use the following steps to boot Zephyr kernel:
273+
274+
1. In U-Boot command line execute prepare script:
275+
276+
.. code-block:: console
277+
278+
u-boot=> run prepare_mcore
279+
280+
2. Boot Linux kernel with specified dtb and then boot Zephyr by using remoteproc:
281+
282+
.. code-block:: console
283+
284+
root@imx8mp-lpddr4-evk:~# echo zephyr.elf > /sys/devices/platform/imx8mp-cm7/remoteproc/remoteproc0/firmware
285+
root@imx8mp-lpddr4-evk:~# echo start > /sys/devices/platform/imx8mp-cm7/remoteproc/remoteproc0/state
286+
[ 39.195651] remoteproc remoteproc0: powering up imx-rproc
287+
[ 39.203345] remoteproc remoteproc0: Booting fw image zephyr.elf, size 503992
288+
[ 39.203388] remoteproc remoteproc0: No resource table in elf
289+
root@imx8mp-lpddr4-evk:~# [ 39.711380] remoteproc remoteproc0: remote processor imx-rproc is now up
290+
291+
root@imx8mp-lpddr4-evk:~#
292+
208293
Debugging
209294
=========
210295

0 commit comments

Comments
 (0)