Part 1
요약·해설
A53와 M7의 지원 기능을 구분하고, A53 U-Boot·SMP·Jailhouse 실행부터 M7 ITCM/DDR 메모리 지도, Linux remoteproc 기동과 JTAG 디버깅까지 연결해 설명합니다.
4× Cortex-A53 · 1× Cortex-M7
ITCM · DDR · OCRAM
U-Boot · remoteproc · Jailhouse
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
A94004273755FCAFB55A1E39B53ED2A0F1AA65C2BEEB678DF3869C115BD555A0
.. _imx8mp_evk:
NXP i.MX8MP EVK
###############
Overview
********
i.MX8M Plus LPDDR4 EVK board is based on NXP i.MX8M Plus applications
processor, composed of a quad Cortex®-A53 cluster and a single Cortex®-M7 core.
Zephyr OS is ported to run on the Cortex®-A53 core.
- Board features:
- RAM: 2GB LPDDR4
- Storage:
- SanDisk 16GB eMMC5.1
- Micron 32MB QSPI NOR
- microSD Socket
- Wireless:
- WiFi: 2.4/5GHz IEEE 802.11b/g/n
- Bluetooth: v4.1
- USB:
- OTG - 2x type C
- Ethernet
- PCI-E M.2
- Connectors:
- 40-Pin Dual Row Header
- LEDs:
- 1x Power status LED
- 1x UART LED
- Debug
- JTAG 20-pin connector
- MicroUSB for UART debug, two COM ports for A53 and M4
More information about the board can be found at the
`NXP website`_.
Supported Features
==================
The Zephyr mimx8mp_evk_a53 board configuration supports the following hardware
features:
+-----------+------------+-------------------------------------+
| Interface | Controller | Driver/Component |
+===========+============+=====================================+
| GIC-v3 | on-chip | interrupt controller |
+-----------+------------+-------------------------------------+
| ARM TIMER | on-chip | system clock |
+-----------+------------+-------------------------------------+
| CLOCK | on-chip | clock_control |
+-----------+------------+-------------------------------------+
| PINMUX | on-chip | pinmux |
+-----------+------------+-------------------------------------+
| RDC | on-chip | Resource Domain Controller |
+-----------+------------+-------------------------------------+
| UART | on-chip | serial port |
+-----------+------------+-------------------------------------+
| ENET | on-chip | ethernet port |
+-----------+------------+-------------------------------------+
The Zephyr mimx8mp_evk_m7 board configuration supports the following hardware
features:
+-----------+------------+-------------------------------------+
| Interface | Controller | Driver/Component |
+===========+============+=====================================+
| NVIC | on-chip | nested vector interrupt controller |
+-----------+------------+-------------------------------------+
| SYSTICK | on-chip | systick |
+-----------+------------+-------------------------------------+
| CLOCK | on-chip | clock_control |
+-----------+------------+-------------------------------------+
| PINMUX | on-chip | pinmux |
+-----------+------------+-------------------------------------+
| UART | on-chip | serial port-polling; |
| | | serial port-interrupt |
+-----------+------------+-------------------------------------+
Devices
========
System Clock
------------
This board configuration uses a system clock frequency of 8 MHz.
The M7 Core is configured to run at a 800 MHz clock speed.
Serial Port
-----------
This board configuration uses a single serial communication channel with the
CPU's UART4.
Programming and Debugging (A53)
*******************************
Copy the compiled ``zephyr.bin`` to the first FAT partition of the SD card and
plug the SD card into the board. Power it up and stop the u-boot execution at
prompt.
Use U-Boot to load and kick non-smp zephyr.bin:
.. code-block:: console
fatload mmc 1:1 0xc0000000 zephyr.bin; dcache flush; icache flush; dcache off; icache off; go 0xc0000000
Or kick SMP zephyr.bin:
.. code-block:: console
fatload mmc 1:1 0xc0000000 zephyr.bin; dcache flush; icache flush; dcache off; icache off; cpu 2 release 0xc0000000
Use this configuration to run basic Zephyr applications and kernel tests,
for example, with the :zephyr:code-sample:`synchronization` sample:
.. zephyr-app-commands::
:zephyr-app: samples/synchronization
:host-os: unix
:board: imx8mp_evk/mimx8ml8/a53
:goals: run
This will build an image with the synchronization sample app, boot it and
display the following console output:
.. code-block:: console
*** Booting Zephyr OS build zephyr-v3.1.0-3575-g44dd713bd883 ***
thread_a: Hello World from cpu 0 on mimx8mp_evk_a53!
thread_b: Hello World from cpu 0 on mimx8mp_evk_a53!
thread_a: Hello World from cpu 0 on mimx8mp_evk_a53!
thread_b: Hello World from cpu 0 on mimx8mp_evk_a53!
thread_a: Hello World from cpu 0 on mimx8mp_evk_a53!
Use Jailhouse hypervisor, after root cell linux is up:
.. code-block:: console
#jailhouse enable imx8mp.cell
#jailhouse cell create imx8mp-zephyr.cell
#jailhouse cell load 1 zephyr.bin -a 0xc0000000
#jailhouse cell start 1
Programming and Debugging (M7)
******************************
The MIMX8MP EVK board doesn't have QSPI flash for the M7, and it needs
to be started by the A53 core. The A53 core is responsible to load the M7 binary
application into the RAM, put the M7 in reset, set the M7 Program Counter and
Stack Pointer, and get the M7 out of reset. The A53 can perform these steps at
bootloader level or after the Linux system has booted.
The M7 can use up to 3 different RAMs (currently, only two configurations are
supported: ITCM and DDR). These are the memory mapping for A53 and M7:
+------------+-------------------------+------------------------+-----------------------+----------------------+
| Region | Cortex-A53 | Cortex-M7 (System Bus) | Cortex-M7 (Code Bus) | Size |
+============+=========================+========================+=======================+======================+
| OCRAM | 0x00900000-0x0098FFFF | 0x20200000-0x2028FFFF | 0x00900000-0x0098FFFF | 576KB |
+------------+-------------------------+------------------------+-----------------------+----------------------+
| DTCM | 0x00800000-0x0081FFFF | 0x20000000-0x2001FFFF | | 128KB |
+------------+-------------------------+------------------------+-----------------------+----------------------+
| ITCM | 0x007E0000-0x007FFFFF | | 0x00000000-0x0001FFFF | 128KB |
+------------+-------------------------+------------------------+-----------------------+----------------------+
| OCRAM_S | 0x00180000-0x00188FFF | 0x20180000-0x20188FFF | 0x00180000-0x00188FFF | 36KB |
+------------+-------------------------+------------------------+-----------------------+----------------------+
| DDR | 0x80000000-0x803FFFFF | 0x80200000-0x803FFFFF | 0x80000000-0x801FFFFF | 2MB |
+------------+-------------------------+------------------------+-----------------------+----------------------+
For more information about memory mapping see the
`i.MX 8M Applications Processor Reference Manual`_ (section 2.1 to 2.3)
At compilation time you have to choose which RAM will be used. This
configuration is done based on board name (imx8mp_evk/mimx8ml8/m7 for ITCM and
imx8mp_evk/mimx8ml8/m7/ddr for DDR).
There are two methods to load M7 Core images: U-Boot command and Linux remoteproc.
Load and Run M7 Zephyr Image from U-Boot
========================================
Load and run Zephyr on M7 from A53 using u-boot by copying the compiled
``zephyr.bin`` to the first FAT partition of the SD card and plug the SD
card into the board. Power it up and stop the u-boot execution at prompt.
Load the M7 binary onto the desired memory and start its execution using:
ITCM
====
.. code-block:: console
fatload mmc 0:1 0x48000000 zephyr.bin
cp.b 0x48000000 0x7e0000 20000
bootaux 0x7e0000
DDR
===
.. code-block:: console
fatload mmc 0:1 0x80000000 zephyr.bin
dcache flush
bootaux 0x80000000
Load and Run M7 Zephyr Image by using Linux remoteproc
======================================================
Prepare device tree:
The device tree must inlcude CM7 dts node with compatible string "fsl,imx8mn-cm7",
and also need to reserve M4 DDR memory if using DDR code and sys address, and also
need to put "m4_reserved" in the list of memory-region property of the cm7 node.
.. code-block:: console
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
m7_reserved: m4@80000000 {
no-map;
reg = <0 0x80000000 0 0x1000000>;
};
...
}
imx8mp-cm7 {
compatible = "fsl,imx8mn-cm7";
rsc-da = <0x55000000>;
clocks = <&clk IMX8MP_CLK_M7_DIV>,
<&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_AUDPLL_ROOT>;
clock-names = "core", "audio";
mbox-names = "tx", "rx", "rxdb";
mboxes = <&mu 0 1
&mu 1 1
&mu 3 1>;
memory-region = <&vdevbuffer>, <&vdev0vring0>, <&vdev0vring1>, <&rsc_table>, <&m7_reserved>;
status = "okay";
fsl,startup-delay-ms = <500>;
};
Extra Zephyr Kernel configure item for DDR Image:
If use remotepoc to boot DDR board (imx8mp_evk/mimx8ml8/m7/ddr), also need to enable
"CONFIG_ROMSTART_RELOCATION_ROM" in order to put romstart memory section into ITCM because
M7 Core will get the first instruction from zero address of ITCM, but romstart relocation
will make the storage size of zephyr.bin too large, so we don't enable it by default in
board defconfig.
.. code-block:: console
diff --git a/boards/nxp/imx8mp_evk/imx8mp_evk_mimx8ml8_m7_ddr_defconfig b/boards/nxp/imx8mp_evk/imx8mp_evk_mimx8ml8_m7_ddr_defconfig
index 17542cb4eec..8c30c5b6fa3 100644
--- a/boards/nxp/imx8mp_evk/imx8mp_evk_mimx8ml8_m7_ddr_defconfig
+++ b/boards/nxp/imx8mp_evk/imx8mp_evk_mimx8ml8_m7_ddr_defconfig
@@ -12,3 +12,4 @@ CONFIG_CONSOLE=y
CONFIG_XIP=y
CONFIG_CODE_DDR=y
CONFIG_PINCTRL=y
+CONFIG_ROMSTART_RELOCATION_ROM=y
Then use the following steps to boot Zephyr kernel:
1. In U-Boot command line execute prepare script:
.. code-block:: console
u-boot=> run prepare_mcore
2. Boot Linux kernel with specified dtb and then boot Zephyr by using remoteproc:
.. code-block:: console
root@imx8mp-lpddr4-evk:~# echo zephyr.elf > /sys/devices/platform/imx8mp-cm7/remoteproc/remoteproc0/firmware
root@imx8mp-lpddr4-evk:~# echo start > /sys/devices/platform/imx8mp-cm7/remoteproc/remoteproc0/state
[ 39.195651] remoteproc remoteproc0: powering up imx-rproc
[ 39.203345] remoteproc remoteproc0: Booting fw image zephyr.elf, size 503992
[ 39.203388] remoteproc remoteproc0: No resource table in elf
root@imx8mp-lpddr4-evk:~# [ 39.711380] remoteproc remoteproc0: remote processor imx-rproc is now up
root@imx8mp-lpddr4-evk:~#
Debugging
=========
MIMX8MP EVK board can be debugged by connecting an external JLink
JTAG debugger to the J24 debug connector and to the PC. Then
the application can be debugged using the usual way.
Here is an example for the :ref:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: imx8mp_evk/mimx8ml8/m7
:goals: debug
Open a serial terminal, step through the application in your debugger, and you
should see the following message in the terminal:
.. code-block:: console
*** Booting Zephyr OS build v2.7.99-1310-g2801bf644a91 ***
Hello World! imx8mp_evk
References
==========
.. _NXP website:
https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/evaluation-kit-for-the-i-mx-8m-plus-applications-processor:8MPLUSLPD4-EVK
.. _i.MX 8M Applications Processor Reference Manual:
https://www.nxp.com/webapp/Download?colCode=IMX8MPRM
Part 3
한국어 전문 번역
개요
i.MX8M Plus LPDDR4 EVK 보드는 NXP i.MX8M Plus 애플리케이션 프로세서를 기반으로 합니다. 프로세서는 쿼드 Cortex-A53 클러스터와 단일 Cortex-M7 코어로 구성되며, Zephyr OS는 Cortex-A53 코어에서 실행되도록 포팅되어 있습니다.
보드 기능
- RAM: 2 GB LPDDR4
- 저장 장치: SanDisk 16 GB eMMC 5.1, Micron 32 MB QSPI NOR, microSD 소켓
- 무선: 2.4/5 GHz IEEE 802.11b/g/n Wi-Fi, Bluetooth v4.1
- USB: OTG Type-C 2개
- Ethernet, PCI-E M.2
- 커넥터: 40핀 듀얼 로우 헤더
- LED: 전원 상태 LED 1개, UART LED 1개
- 디버그: 20핀 JTAG 커넥터, A53와 M4용 COM 포트 두 개를 제공하는 UART 디버그용 MicroUSB
보드에 관한 자세한 내용은 아래의 NXP 웹사이트에서 확인할 수 있습니다.
지원 기능
Zephyr mimx8mp_evk_a53 보드 구성은 다음 하드웨어 기능을 지원합니다.
| 인터페이스 | 컨트롤러 | 드라이버/컴포넌트 |
|---|---|---|
GIC-v3 | on-chip | interrupt controller |
ARM TIMER | on-chip | system clock |
CLOCK | on-chip | clock_control |
PINMUX | on-chip | pinmux |
RDC | on-chip | Resource Domain Controller |
UART | on-chip | serial port |
ENET | on-chip | ethernet port |
Zephyr mimx8mp_evk_m7 보드 구성은 다음 하드웨어 기능을 지원합니다.
| 인터페이스 | 컨트롤러 | 드라이버/컴포넌트 |
|---|---|---|
NVIC | on-chip | nested vector interrupt controller |
SYSTICK | on-chip | systick |
CLOCK | on-chip | clock_control |
PINMUX | on-chip | pinmux |
UART | on-chip | serial port-polling; serial port-interrupt |
장치
시스템 클록
이 보드 구성은 8 MHz 시스템 클록 주파수를 사용합니다. M7 코어는 800 MHz로 동작하도록 구성됩니다.
직렬 포트
이 보드 구성은 CPU의 UART4를 사용해 하나의 직렬 통신 채널을 제공합니다.
A53 프로그래밍과 디버깅
컴파일된 zephyr.bin을 SD 카드의 첫 번째 FAT 파티션에 복사하고 카드를 보드에 꽂습니다. 보드 전원을 켠 뒤 U-Boot 프롬프트에서 실행을 중지합니다.
U-Boot에서 비-SMP zephyr.bin을 로드하고 시작하려면 다음 명령을 사용합니다.
fatload mmc 1:1 0xc0000000 zephyr.bin; dcache flush; icache flush; dcache off; icache off; go 0xc0000000
SMP zephyr.bin을 시작하려면 다음 명령을 사용합니다.
fatload mmc 1:1 0xc0000000 zephyr.bin; dcache flush; icache flush; dcache off; icache off; cpu 2 release 0xc0000000
이 구성으로 기본 Zephyr 애플리케이션과 커널 테스트를 실행할 수 있습니다. 예를 들어 synchronization 샘플은 다음과 같이 빌드하고 실행합니다.
west build -b imx8mp_evk/mimx8ml8/a53 samples/synchronization
west build -t run
이 명령은 synchronization 샘플 애플리케이션을 포함한 이미지를 빌드하고 부팅한 뒤 다음 콘솔 출력을 표시합니다.
*** Booting Zephyr OS build zephyr-v3.1.0-3575-g44dd713bd883 ***
thread_a: Hello World from cpu 0 on mimx8mp_evk_a53!
thread_b: Hello World from cpu 0 on mimx8mp_evk_a53!
thread_a: Hello World from cpu 0 on mimx8mp_evk_a53!
thread_b: Hello World from cpu 0 on mimx8mp_evk_a53!
thread_a: Hello World from cpu 0 on mimx8mp_evk_a53!
root cell Linux가 기동한 뒤 Jailhouse 하이퍼바이저로 Zephyr를 실행하려면 다음 명령을 사용합니다.
#jailhouse enable imx8mp.cell
#jailhouse cell create imx8mp-zephyr.cell
#jailhouse cell load 1 zephyr.bin -a 0xc0000000
#jailhouse cell start 1
M7 프로그래밍과 디버깅
MIMX8MP EVK 보드에는 M7용 QSPI 플래시가 없으므로 M7은 A53 코어가 시작해야 합니다. A53 코어는 M7 바이너리 애플리케이션을 RAM에 로드하고, M7을 리셋 상태로 둔 채 Program Counter와 Stack Pointer를 설정한 다음, M7을 리셋에서 해제합니다. A53은 부트로더 단계 또는 Linux 시스템이 부팅된 뒤 이 절차를 수행할 수 있습니다.
M7은 최대 세 종류의 RAM을 사용할 수 있습니다. 현재 지원되는 구성은 ITCM과 DDR 두 가지입니다. A53와 M7에서 보이는 메모리 주소는 다음과 같습니다.
| 영역 | Cortex-A53 | Cortex-M7 시스템 버스 | Cortex-M7 코드 버스 | 크기 |
|---|---|---|---|---|
OCRAM | 0x00900000-0x0098FFFF | 0x20200000-0x2028FFFF | 0x00900000-0x0098FFFF | 576 KB |
DTCM | 0x00800000-0x0081FFFF | 0x20000000-0x2001FFFF | - | 128 KB |
ITCM | 0x007E0000-0x007FFFFF | - | 0x00000000-0x0001FFFF | 128 KB |
OCRAM_S | 0x00180000-0x00188FFF | 0x20180000-0x20188FFF | 0x00180000-0x00188FFF | 36 KB |
DDR | 0x80000000-0x803FFFFF | 0x80200000-0x803FFFFF | 0x80000000-0x801FFFFF | 2 MB |
메모리 매핑의 자세한 설명은 i.MX 8M Applications Processor Reference Manual 2.1절부터 2.3절을 참고하십시오.
컴파일할 때 사용할 RAM을 선택해야 합니다. 보드 이름으로 구성을 선택하며, ITCM은 imx8mp_evk/mimx8ml8/m7, DDR은 imx8mp_evk/mimx8ml8/m7/ddr을 사용합니다.
M7 코어 이미지를 로드하는 방법은 U-Boot 명령과 Linux remoteproc 두 가지입니다.
U-Boot에서 M7 Zephyr 이미지 로드 및 실행
컴파일된 zephyr.bin을 SD 카드의 첫 번째 FAT 파티션에 복사하고 보드에 꽂습니다. 전원을 켠 뒤 U-Boot 프롬프트에서 실행을 중지하고, 선택한 메모리에 M7 바이너리를 로드해 실행합니다.
ITCM
fatload mmc 0:1 0x48000000 zephyr.bin
cp.b 0x48000000 0x7e0000 20000
bootaux 0x7e0000
DDR
fatload mmc 0:1 0x80000000 zephyr.bin
dcache flush
bootaux 0x80000000
Linux remoteproc로 M7 Zephyr 이미지 로드 및 실행
Device Tree 준비
Device Tree에는 compatible 문자열이 fsl,imx8mn-cm7인 CM7 DTS 노드가 있어야 합니다. DDR 코드와 시스템 주소를 사용한다면 M4 DDR 메모리도 예약해야 하며, CM7 노드의 memory-region 속성 목록에 m4_reserved를 넣어야 합니다. 공식 문서의 노드와 이름을 그대로 옮기면 다음과 같습니다.
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
m7_reserved: m4@80000000 {
no-map;
reg = <0 0x80000000 0 0x1000000>;
};
...
}
imx8mp-cm7 {
compatible = "fsl,imx8mn-cm7";
rsc-da = <0x55000000>;
clocks = <&clk IMX8MP_CLK_M7_DIV>,
<&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_AUDPLL_ROOT>;
clock-names = "core", "audio";
mbox-names = "tx", "rx", "rxdb";
mboxes = <&mu 0 1
&mu 1 1
&mu 3 1>;
memory-region = <&vdevbuffer>, <&vdev0vring0>, <&vdev0vring1>, <&rsc_table>, <&m7_reserved>;
status = "okay";
fsl,startup-delay-ms = <500>;
};
DDR 이미지용 추가 Zephyr 커널 설정
remoteproc로 DDR 보드 imx8mp_evk/mimx8ml8/m7/ddr을 부팅할 때는 CONFIG_ROMSTART_RELOCATION_ROM도 활성화해야 합니다. M7 코어는 ITCM의 0번 주소에서 첫 명령을 가져오므로 romstart 메모리 섹션을 ITCM에 배치해야 하기 때문입니다. 다만 romstart 재배치는 zephyr.bin의 저장 크기를 크게 만들기 때문에 보드 기본 구성에서는 활성화하지 않습니다.
diff --git a/boards/nxp/imx8mp_evk/imx8mp_evk_mimx8ml8_m7_ddr_defconfig b/boards/nxp/imx8mp_evk/imx8mp_evk_mimx8ml8_m7_ddr_defconfig
index 17542cb4eec..8c30c5b6fa3 100644
--- a/boards/nxp/imx8mp_evk/imx8mp_evk_mimx8ml8_m7_ddr_defconfig
+++ b/boards/nxp/imx8mp_evk/imx8mp_evk_mimx8ml8_m7_ddr_defconfig
@@ -12,3 +12,4 @@ CONFIG_CONSOLE=y
CONFIG_XIP=y
CONFIG_CODE_DDR=y
CONFIG_PINCTRL=y
+CONFIG_ROMSTART_RELOCATION_ROM=y
그런 다음 다음 절차로 Zephyr 커널을 부팅합니다.
- U-Boot 명령줄에서 준비 스크립트를 실행합니다.
u-boot=> run prepare_mcore
- 지정한 DTB로 Linux 커널을 부팅한 뒤
remoteproc로 Zephyr를 시작합니다.
root@imx8mp-lpddr4-evk:~# echo zephyr.elf > /sys/devices/platform/imx8mp-cm7/remoteproc/remoteproc0/firmware
root@imx8mp-lpddr4-evk:~# echo start > /sys/devices/platform/imx8mp-cm7/remoteproc/remoteproc0/state
[ 39.195651] remoteproc remoteproc0: powering up imx-rproc
[ 39.203345] remoteproc remoteproc0: Booting fw image zephyr.elf, size 503992
[ 39.203388] remoteproc remoteproc0: No resource table in elf
root@imx8mp-lpddr4-evk:~# [ 39.711380] remoteproc remoteproc0: remote processor imx-rproc is now up
root@imx8mp-lpddr4-evk:~#
디버깅
MIMX8MP EVK 보드는 외부 J-Link JTAG 디버거를 J24 디버그 커넥터와 PC에 연결해 일반적인 방식으로 디버깅할 수 있습니다. hello_world 애플리케이션의 예는 다음과 같습니다.
west build -b imx8mp_evk/mimx8ml8/m7 samples/hello_world
west debug
직렬 터미널을 열고 디버거에서 애플리케이션을 단계 실행하면 터미널에 다음 메시지가 나타납니다.
*** Booting Zephyr OS build v2.7.99-1310-g2801bf644a91 ***
Hello World! imx8mp_evk
참고 자료
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.