Part 1
요약·해설
Cortex-A55 Zephyr 포트의 U-Boot 실행과 synchronization 샘플을 설명하고, DSP 없이 SOF를 실행하기 위한 Jailhouse의 Cell·Root cell·Inmate 자원 분할 모델을 풀이합니다.
2× Cortex-A55 · 1× Cortex-M33
Wi-Fi 6 · BT 5.2 · 802.15.4
Jailhouse · Core 1 inmate
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
BEF11671AA1C09BA9FCCFD9299D30D6C00E2B266002E58357359885C942E172C
.. _imx93_evk:
NXP i.MX93 EVK (Cortex-A55)
############################
Overview
********
The i.MX93 Evaluation Kit (MCIMX93-EVK board) is a platform designed to show
the most commonly used features of the i.MX 93 Applications Processor in a
small and low cost package. The MCIMX93-EVK board is an entry-level development
board, which helps developers to get familiar with the processor before
investing a large amount of resources in more specific designs.
i.MX93 MPU is composed of one cluster of 2x Cortex-A55 cores and a single
Cortex®-M33 core. Zephyr OS is ported to run on one of the Cortex®-A55 core.
- Board features:
- RAM: 2GB LPDDR4
- Storage:
- SanDisk 16GB eMMC5.1
- microSD Socket
- Wireless:
- Murata Type-2EL (SDIO+UART+SPI) module. It is based on NXP IW612 SoC,
which supports dual-band (2.4 GHz /5 GHz) 1x1 Wi-Fi 6, Bluetooth 5.2,
and 802.15.4
- USB:
- Two USB 2.0 Type C connectors
- Ethernet
- PCI-E M.2
- Connectors:
- 40-Pin Dual Row Header
- LEDs:
- 1x Power status LED
- 2x UART LED
- Debug
- JTAG 20-pin connector
- MicroUSB for UART debug, two COM ports for A55 and M33
Supported Features
==================
The Zephyr mimx93_evk board configuration supports the following hardware
features:
+-----------+------------+-------------------------------------+
| Interface | Controller | Driver/Component |
+===========+============+=====================================+
| GIC-v4 | on-chip | interrupt controller |
+-----------+------------+-------------------------------------+
| ARM TIMER | on-chip | system clock |
+-----------+------------+-------------------------------------+
| UART | on-chip | serial port |
+-----------+------------+-------------------------------------+
Devices
========
System Clock
------------
This board configuration uses a system clock frequency of 24 MHz.
Cortex-A55 Core runs up to 1.7 GHz.
Serial Port
-----------
This board configuration uses a single serial communication channel with the
CPU's UART4.
Programming and Debugging
*************************
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 zephyr.bin to Cortex-A55 Core1:
.. code-block:: console
fatload mmc 1:1 0xd0000000 zephyr.bin; dcache flush; icache flush; dcache off; icache off; cpu 1 release 0xd0000000
Or use the following command to kick zephyr.bin to Cortex-A55 Core0:
.. code-block:: console
fatload mmc 1:1 0xd0000000 zephyr.bin; dcache flush; icache flush; dcache off; icache off; go 0xd0000000
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: mimx93_evk/mimx9352/a55
:goals: run
This will build an image with the synchronization sample app, boot it and
display the following ram console output:
.. code-block:: console
*** Booting Zephyr OS build zephyr-v3.2.0-8-g1613870534a0 ***
thread_a: Hello World from cpu 0 on mimx93_evk_a55!
thread_b: Hello World from cpu 0 on mimx93_evk_a55!
thread_a: Hello World from cpu 0 on mimx93_evk_a55!
thread_b: Hello World from cpu 0 on mimx93_evk_a55!
References
==========
More information can refer to NXP official website:
`NXP website`_.
.. _NXP website:
https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/i-mx-applications-processors/i-mx-9-processors/i-mx-93-applications-processor-family-arm-cortex-a55-ml-acceleration-power-efficient-mpu:i.MX93
Using the SOF-specific variant
******************************
Purpose
=======
Since this board doesn't have a DSP, an alternative for people who might be interested
in running SOF on this board had to be found. The alternative consists of running SOF
on an A55 core using Jailhouse as a way to "take away" one A55 core from Linux and
assign it to Zephyr with `SOF`_.
.. _SOF:
https://github.com/thesofproject/sof
What is Jailhouse?
==================
Jailhouse is a light-weight hypervisor that allows the partitioning of hardware resources.
For more details on how this is done and, generally, about Jailhouse, please see: `1`_,
`2`_ and `3`_. The GitHub repo can be found `here`_.
.. _1:
https://lwn.net/Articles/578295/
.. _2:
https://lwn.net/Articles/578852/
.. _3:
http://events17.linuxfoundation.org/sites/events/files/slides/ELCE2016-Jailhouse-Tutorial.pdf
.. _here:
https://github.com/siemens/jailhouse
How does it work?
=================
Firstly, we need to explain a few Jailhouse concepts that will be referred to later on:
* **Cell**: refers to a set of hardware resources that the OS assigned to this
cell can utilize.
* **Root cell**: refers to the cell in which Linux is running. This is the main cell which
will contain all the hardware resources that Linux will utilize and will be used to assign
resources to the inmates. The inmates CANNOT use resources such as the CPU that haven't been
assigned to the root cell.
* **Inmate**: refers to any other OS that runs alongside Linux. The resources an inmate will
use are taken from the root cell (the cell Linux is running in).
SOF+Zephyr will run as an inmate, alongside Linux, on core 1 of the board. This means that
said core will be taken away from Linux and will only be utilized by Zephyr.
The hypervisor restricts inmate's/root's access to certain hardware resources using
the second-stage translation table which is based on the memory regions described in the
configuration files. Please consider the following scenario:
Root cell wants to use the **UART** which let's say has its registers mapped in
the **[0x0 - 0x42000000]** region. If the inmate wants to use the same **UART** for
some reason then we'd need to also add this region to inmate's configuration
file and add the **JAILHOUSE_MEM_ROOTSHARED** flag. This flag means that the inmate
is allowed to share this region with the root. If this region is not set in
the inmate's configuration file and Zephyr (running as an inmate here) tries
to access this region this will result in a second stage translation fault.
Notes:
* Linux and Zephyr are not aware that they are running alongside each other.
They will only be aware of the cores they have been assigned through the config
files (there's a config file for the root and one for each inmate).
Architecture overview
=====================
The architecture overview can be found at this `location`_. (latest status update as of now
and the only one containing diagrams).
.. _location:
https://github.com/thesofproject/sof/issues/7192
How to use this board?
======================
This board has been designed for SOF so it's only intended to be used with SOF.
TODO: document the SOF build process for this board. For now, the support for
i.MX93 is still in review and has yet to merged on SOF side.
Part 3
한국어 전문 번역
개요
i.MX93 Evaluation Kit(MCIMX93-EVK 보드)는 작고 저렴한 패키지에서 i.MX 93 애플리케이션 프로세서의 가장 일반적인 기능을 보여 주도록 설계된 플랫폼입니다. MCIMX93-EVK는 입문용 개발 보드로, 개발자가 더 구체적인 설계에 많은 자원을 투자하기 전에 프로세서에 익숙해질 수 있도록 돕습니다.
i.MX93 MPU는 Cortex-A55 코어 2개로 이루어진 클러스터 하나와 단일 Cortex-M33 코어로 구성됩니다. Zephyr OS는 Cortex-A55 코어 중 하나에서 실행되도록 포팅되어 있습니다.
보드 기능
- RAM: 2 GB LPDDR4
- 저장 장치: SanDisk 16 GB eMMC 5.1, microSD 소켓
- 무선: NXP IW612 SoC 기반 Murata Type-2EL(SDIO+UART+SPI) 모듈. 듀얼 밴드 2.4/5 GHz 1×1 Wi-Fi 6, Bluetooth 5.2, 802.15.4 지원
- USB: USB 2.0 Type-C 커넥터 2개
- Ethernet, PCI-E M.2
- 커넥터: 40핀 듀얼 로우 헤더
- LED: 전원 상태 LED 1개, UART LED 2개
- 디버그: 20핀 JTAG 커넥터, A55와 M33용 COM 포트 두 개를 제공하는 UART 디버그용 MicroUSB
지원 기능
Zephyr mimx93_evk 보드 구성은 다음 하드웨어 기능을 지원합니다.
| 인터페이스 | 컨트롤러 | 드라이버/컴포넌트 |
|---|---|---|
GIC-v4 | on-chip | interrupt controller |
ARM TIMER | on-chip | system clock |
UART | on-chip | serial port |
장치
시스템 클록
이 보드 구성은 24 MHz 시스템 클록 주파수를 사용합니다. Cortex-A55 코어는 최대 1.7 GHz로 동작합니다.
직렬 포트
이 보드 구성은 CPU의 UART4를 사용해 하나의 직렬 통신 채널을 제공합니다.
프로그래밍과 디버깅
컴파일된 zephyr.bin을 SD 카드의 첫 번째 FAT 파티션에 복사하고 카드를 보드에 꽂습니다. 전원을 켠 뒤 U-Boot 프롬프트에서 실행을 중지합니다.
U-Boot에서 zephyr.bin을 Cortex-A55 Core 1에 로드하고 시작하려면 다음 명령을 사용합니다.
fatload mmc 1:1 0xd0000000 zephyr.bin; dcache flush; icache flush; dcache off; icache off; cpu 1 release 0xd0000000
대신 Cortex-A55 Core 0에서 zephyr.bin을 시작하려면 다음 명령을 사용합니다.
fatload mmc 1:1 0xd0000000 zephyr.bin; dcache flush; icache flush; dcache off; icache off; go 0xd0000000
이 구성으로 기본 Zephyr 애플리케이션과 커널 테스트를 실행할 수 있습니다. 예를 들어 synchronization 샘플은 다음과 같이 빌드하고 실행합니다.
west build -b mimx93_evk/mimx9352/a55 samples/synchronization
west build -t run
이 명령은 synchronization 샘플 애플리케이션을 포함한 이미지를 빌드하고 부팅한 뒤 다음 RAM 콘솔 출력을 표시합니다.
*** Booting Zephyr OS build zephyr-v3.2.0-8-g1613870534a0 ***
thread_a: Hello World from cpu 0 on mimx93_evk_a55!
thread_b: Hello World from cpu 0 on mimx93_evk_a55!
thread_a: Hello World from cpu 0 on mimx93_evk_a55!
thread_b: Hello World from cpu 0 on mimx93_evk_a55!
참고 자료
자세한 내용은 NXP i.MX 93 공식 웹사이트를 참고하십시오.
SOF 전용 변형 사용
목적
이 보드에는 DSP가 없기 때문에 이 보드에서 SOF를 실행하려는 사용자를 위한 대안이 필요했습니다. 이 대안은 Jailhouse를 사용해 A55 코어 하나를 Linux에서 떼어 내고, SOF를 포함한 Zephyr에 할당하여 SOF를 A55 코어에서 실행하는 방식입니다.
Jailhouse란 무엇인가?
Jailhouse는 하드웨어 자원을 파티션으로 나눌 수 있게 해 주는 경량 하이퍼바이저입니다. 작동 방식과 Jailhouse 전반에 관한 자세한 내용은 LWN 1부, LWN 2부, ELCE 2016 튜토리얼을 참고하십시오. 소스 저장소는 Siemens Jailhouse GitHub에 있습니다.
어떻게 동작하는가?
뒤에서 사용할 Jailhouse의 몇 가지 개념을 먼저 정리합니다.
- Cell: 이 cell에 할당된 OS가 사용할 수 있는 하드웨어 자원의 집합입니다.
- Root cell: Linux가 실행되는 cell입니다. Linux가 사용할 모든 하드웨어 자원을 담는 주 cell이며, 여기에서 inmate에게 자원을 할당합니다. CPU처럼 root cell에 할당되지 않은 자원은 inmate가 사용할 수 없습니다.
- Inmate: Linux와 나란히 실행되는 다른 OS를 뜻합니다. inmate가 사용할 자원은 Linux가 실행되는 root cell에서 가져옵니다.
SOF+Zephyr는 Linux와 함께 보드의 Core 1에서 inmate로 실행됩니다. 따라서 이 코어는 Linux에서 제외되고 Zephyr만 사용합니다.
하이퍼바이저는 구성 파일에 기술된 메모리 영역을 바탕으로 만든 2단계 변환 테이블을 사용하여 inmate와 root가 특정 하드웨어 자원에 접근하지 못하도록 제한합니다. 다음 상황을 예로 들 수 있습니다.
참고
- Linux와 Zephyr는 서로 나란히 실행된다는 사실을 인식하지 못합니다. 두 OS는 구성 파일을 통해 자신에게 할당된 코어만 인식합니다. root용 구성 파일 하나와 inmate별 구성 파일 하나가 있습니다.
아키텍처 개요
아키텍처 개요는 SOF GitHub issue #7192에서 확인할 수 있습니다. 원문 작성 시점의 최신 상태를 보여 주며 diagram을 포함한 유일한 자료입니다.
이 보드를 사용하는 방법
이 보드 변형은 SOF용으로 설계되었으므로 SOF와 함께 사용하는 용도로만 제공됩니다.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.