NXP Tech Blog

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

NXP Tech Blog

yuhe-r64908
NXP Employee
NXP Employee

このシリーズでは、低コストでコンパクトな開発ボード「FRDM i.MX 93 Development Board」を用いて、i.MX 93内のCortex-M33コア向けのSDKサンプルコードのビルドと実行方法を、ハンズオン形式で全3回にわたって解説します。

  • 【第1回】開発環境構築とMコアイメージのビルド(本記事)
  • 【第2回】U-BootとremoteprocによるMコア実行
  • 【第3回】ブートローダーによるMコアの自動起動
阅读更多内容...

更多
1 0 197
gaurav_sharma
NXP Employee
NXP Employee

Hey everyone! This blog will cover the following: -

 

  1. System Overview
  2. Use-case
  3. What are Outbound and Inbound windows in PCIe and how do they work?
  4. What is ATU and why is it important in PCIe?
  5. How to configure the PCIe windows in LS1028 and iMX8QXP
  6. Code walkthrough
  7. Running the test case



System Overview

1.png

As depicted in the illustration above, the system has 2 main blocks: -

a. iMX8QXP [configured as PCIe Root Complex]
b. LS1028 [ configured as PCIe Endpoint]


Software components: -

iMX8QXP - Linux Factory 6.6.36
LS1028ARDB - LSDK-18.09

Hardware components: -

iMX8QXP MEK Board
LS1028ARDB Board
M.2 Key E PCIe Bridge


The root complex and endpoint are connected via a PCIe bridge on M.2 Key E connector of both the boards.
Reference clock used for both PCIe RC and EP - 100 MHz 




PCIe Bridge with M.2 Key E interfacePCIe Bridge with M.2 Key E interface

M.2 Key E PCIe Bridge


Use-case

 

There was a customer requirement wherein a software program was needed at Uboot to benchmark the PCIe to DDR transfers, involving cacheable and non-cacheable DRAM memory regions. 
 

The benchmark software periodically realizes several DMA transfers from PCIe space to DDR in the following way: -

 

1) Start PCIe to DDR DMA transfer (no descriptor). Data are transferred from PCIe to a non-cacheable buffer (A).

2) Wait for the DMA transfer to finish.

3) Copy received data from non-cacheable buffer (A) to a cacheable buffer(B).

 

4)  Check if there's a data mismatch and reports accordingly.


Note: -
There are 2 types of DMA transfers - Descriptor and Non-descriptor.
In Descriptor based DMA, the CPU sets up a list or chain of 'descriptors' in memory. Each descriptor is a data structure containing info such as source, destination, transfer size etc.

In Non-descriptor DMA, the CPU directly configures the DMA controller's registers to define parameters for a single, specific DMA transfer.

This use-case employs non-descriptor DMA transfers.

RC and EP will exercise the above use-case at Uboot itself. iMX8QXP by default acts as a RC. However, to configure LS1028 PCIe2 as EP, we have to configure the RCW[HOST_AGT_PEX] = 1 and then boot LS1028 with the modified RCW flashed onto the board.


To implement this use-case: -

On the iMX8QXP we will be adding our own functionality to the 'pci' utility by modifying the cmd/pci.c in the Uboot source code. After applying this patch, we can execute the test case at Uboot console by just executing this command - "pci p"

On LS1028A, we will simply be writing to the PCIe controller registers using the 'mw' command to set up the EP for the use-case.
 

What are Outbound and Inbound transactions in PCIe?

To explain the concept of outbound and inbound transactions, there are 2 entities that we need to keep in mind w.r.t the transactions that flow in the PCIe fabric:-

Initiator - component that initiates the transaction by sending a request. Example- Memory Read request sends the request for data.

Completer -  component that receives the request and eventually sends a response. Example - After receiving Memory Read request sent by the initiator to it, it sends the completion TLP containing the requested data back to the initiator.

 

3_memrd_write.png

 

Transactions in PCIe can be categorized into 2 parts, depending on the direction of data flow relative to a device [Root complex or End-point]  :-

Inbound - Data is coming into the device from the PCIe bus. From the device's perspective, the device is the completer of this request which was initiated by some other device. Example - Root complex[initiator] sending memory write TLP to an End-point[completer]. In this case EP will have inbound transactions coming from RC.

Outbound - Data is going out from the device to the PCIe bus. From the device's perspective, the device is the initiator of this request which will be completed by some other device. Example - End-point[Initiator] sending memory read TLP to a Root-complex[completer]. In this case, EP will have outbound transactions going towards RC.
 

What is ATU and why is it important in PCIe?

 

PCIe TLP transactions use PCIe addresses. These addresses are different from local internal bus addresses [like AXI, AHB] which are used in on-chip communication between CPU, memory and peripherals. So, we need an entity that maps the addresses from PCIe to local internal bus. Here comes the ATU: -

ATU is an Address Translation Unit that is responsible for address mapping between the device's address space and host's address space. It enables devices to access the host system's memory or other resources. Have a look at the following scenarios where ATU is needed: -

1. A PCIe device (such as network card, storage controller) needs to access the host's memory via DMA. So, the addresses that are issued by the device need to be translated via ATU so that the host can recognize and process these addresses.

 

2. A PCIe device wants to access a memory-mapped IO address. To do this, ATU is needed for translating device's requested address into an address that the host understands.

 

So, whenever a PCIe device initiates an access request like DMA memory read/write, the ATU translates the address issued by the device into the address of the host system as illustrated below: -

ATU TranslationATU Translation

 

Now that we know what Inbound/Outbound transactions are and how does ATU work in PCIe, we will now discuss how to enable the devices [RC/EP] to carry out these transactions. To achieve this, we configure Inbound and Outbound windows in the PCIe controller of a device by setting up ATU translation.
 

 

How to configure PCIe Outbound and Inbound windows in iMX8QXP & LS1028 respectively?



5_ib_ob.png

For our use-case, we will be configuring 1 outbound window on iMX8QXP [Root Complex] and 1 Inbound window on LS1028A[Endpoint].
 
a. To set up an Outbound window on iMX8QXP, we configure the following registers:-

iATU Index register
- defines which region is being accessed and its direction[Inbound/Outbound].


iATU Region Control 1 Register - To configure Max ATU Region size and other TLP attributes.


iATU Lower Base Address Register

                   &
iATU Upper Base Address Register


- These registers configure the start address of a window before the translation

 

iATU Limit Address Register - To configure the End-address of the window before the translation


iATU Lower Target Address Register
                    &

iATU Upper Target Address Register

- These registers configure the start and end addresses after the translation.
 

iATU Region Control 2 Register - To enable the REGION_EN bit and select match mode.

 

 

Outbound WindowOutbound Window

 

b. To set up an Inbound window on LS1028A, we configure the same set of registers :-

iATU Index Register
iATU Region Control 1 Register

iATU Lower Base Address Register

iATU Upper Base Address Register

iATU Limit Address Register

iATU Lower Target Address Register

iATU Upper Target Address Register

iATU Region Control 2 Register
 

Additionally, we will be configuring

PCI Express Command Register - to enable Bus master bit
PEX PF0 CONFIG Register - to set the Config Ready bit. Used by EP to indicate the RC that the controller has done its initialization.


 

The reason why we need to configure 2 additional registers on the EP side is that LS1028[EP] will be at Uboot console the whole time we are exercising our use-case. If it was in Linux, the PCIe drivers would have taken care of this.
 

 

Inbound WindowInbound Window

Code-walkthrough


There's a patch attached with this blog so that the readers can go through it and use it if required.

Note:-  In no way this claims itself to be a production level code, so readers are encouraged to only take it as a reference.
 

The Uboot patch achieves the following:-

 

  1. Configure MMU to make the DRAM range 80020000-88000000 non-cacheable. We are using the DRAM range 0x92000000-FE000000 as cacheable memory for our test case.  
  2. Creates an outbound window on iMX8QXP[connected to LS1028 End-point via PCIe bridge]. To complement this, an Inbound window will be configured on the LS1028.
  3. In a loop:-
    1. zeroize the cacheable and non-cacheable 1MB memory region.
    2. flushing the data cache for the cacheable 1MB region.
    3. configure and trigger DMA read to transfer 1MB of data from End-point’s DDR to RC’s non-cacheable memory region.
    4. copy 1MB data from non-cacheable to cacheable memory.
    5. compares the cacheable 1MB memory with the expected data. If mismatch occurs, we error out and break out of loop. Otherwise the   looping continues.


 

Executing ‘pci p’ command at U-boot console starts the above sequence.

 

After applying the patch in Uboot source, build the Uboot binary, then build SPL. Flash the SPL to iMX8QXP.

 

Running the test case


a. Connect RC [iMX8QXP] and EP[LS1028ARDB] via M.2 Key.E bridge, boot RC and EP till Uboot.


b. At Uboot console of LS1028, execute the following commands to configure the inbound window: -


 

mw.l 0x3500900 0x80000001

mw.l 0x3500904 0x0

mw.l 0x350090c 0x0

mw.l 0x3500910 0x0

mw.l 0x3500914 0x07ffff

 

mw.l 0x3500918 0xA0000000

mw.l 0x350091c 0x0

mw.l 0x3500908 0xC0000000

mw.b 0x3500004 0x06

mw.l  0x35C0014 0x00001001


The above registers are part of PCIe ATU configuration that was mentioned in the section -

How to configure PCIe Outbound and Inbound windows in iMX8QXP & LS1028 respectively

Please feel free to cross-check the Reference manual of LS1028A to verify the register addresses and their significance.
 

 c. On RC, execute 'pci p' -- this will trigger the DMA transfer use-case. 

 

This blog merely scratched the surface of PCIe inbound and outbound transactions. However it aimed at giving a raw view of how memory transfer can be triggered using DMA. For any queries, feel free to DM or send your questions in the comments section.

 

 

 

 

 



更多
0 0 325
yutaka_ando
NXP Employee
NXP Employee

i.MXアプリケーション・プロセッサのLinux BSPに含まれるデモ・リポジトリ「GoPoint」を紹介します。
「GoPoint」には、物体/顔検出などのMachine Learning (ML)をはじめ、ビデオ再生カメラのISP調整3Dグラフィックス(OpenGL ES)などのマルチメディアのデモがあり、i.MXアプリケーション・プロセッサの各種機能を簡単に確認できますので、是非お試しください。

阅读更多内容...

更多
1 0 1,008
yutaka_ando
NXP Employee
NXP Employee

i.MX 8M Plusの評価ボード (EVK) を用いて、マルチメディア機能(ビデオ再生、オーディオの録音/再生、カメラ動作、Wi-Fi接続、NPU動作など)の動作を確認する方法について説明します。

阅读更多内容...

更多
1 0 1,393
YuseiUegama
NXP Employee
NXP Employee

組み込みデバイスの限られたリソースの中でLLMを使用するためには、RAGが必要となります。

本稿では、NXPの LLM + RAG ソリューション 「eIQ GenAI Flow」についてハンズオン形式で紹介します。

阅读更多内容...

更多
2 0 2,269
Keita_Nagashima
NXP Employee
NXP Employee

eIQ Time Series Studio(時系列モデル開発ツール)の概要から、プロジェクトの作成 → データセット → トレーニング → エミュレーション → デプロイメント → データロギングと、使い方の流れを記載しています。

本記事は、eIQ Time Series Studio v1.0.4を起動させた際に表示される"Documentation"メニューに記載されている資料を翻訳したものです。必ず最新の英語版をご確認いただき、本記事はあくまでも補足的な内容としてご利用ください。

阅读更多内容...

更多
1 0 4,193
YuseiUegama
NXP Employee
NXP Employee

組込み機器へのAI/ML導入における課題に対して、NXPのAI/MLソリューション eIQを活用するメリットをご紹介します

-LLM+RAGソリューションをリリース予定

-時系列AI、画像処理AIモデルを開発

-Convert機能により、既存のAI/ML資産をスムーズに移行

阅读更多内容...

更多
3 0 2,236
Keita_Nagashima
NXP Employee
NXP Employee

Yocto Linux BSPをi.MX上で利用する方法 をまとめたページです。

是非ブックマークを!

阅读更多内容...

更多
2 0 1,832
Keita_Nagashima
NXP Employee
NXP Employee

Linux BSPをビルドして生成したイメージをターゲットボードに書き込む方法を説明します。

uuuというユーティリティを使う方法と、ddコマンドの2種類の書き込み方法を紹介します。

Linux BSPのビルド方法については、以下をご参照ください。

[入門] Yocto Linux BSPのビルド方法 - i.MX 8M Plus編

阅读更多内容...

更多
1 0 3,411
Keita_Nagashima
NXP Employee
NXP Employee

Yocto Linux BSPのビルド時におけるTIPS(ビルドの効率化、Dockerを使ってビルド等)を紹介します。

阅读更多内容...

更多
0 0 4,845
Keita_Nagashima
NXP Employee
NXP Employee

i.MX 8M PlusのEVKをベースに、Yocto Linuxのビルド方法をご紹介します。

Yocto Linux BSPは、6.1.55-2.2.0を使用しています。

阅读更多内容...

更多
0 0 7,125
Kaixin_Ding
NXP Employee
NXP Employee

PyeIQ is written on top of eIQ™ ML Software Development Environment and provides a set of Python classes allowing the user to run Machine Learning applications in a simplified and efficiently way without spending time on cross-compilations, deployments or reading extensive guides.

Now PyeIQ 3.0.x release is announced. This release is based on i.MX Linux BSP 5.4.70_2.3.0 & 5.4.70_2.3.2(8QM, 8M Plus) and can also work on i.MX Linux BSP 5.10.9_1.0.0 & 5.10.35_2.0.0 & 5.10.52_2.1.0. And also, in latest PyeIQ 3.1.0 release, BSP 5.10.72_2.2.0 is also added into supported list.

This article is a simple guide for users. For further questions, please post a comment on eIQ Community or just below this article.

阅读更多内容...

更多
5 1 9,514
brendonslade
NXP TechSupport
NXP TechSupport

Share your FreeMASTER dashboard designs, get a board!

 

Calling all FreeMASTER fans!

 

Are you an experienced FreeMASTER user who has already created custom dashboards, or are you an HTML/Javascript coder who is new to this great tool and keen to share your creative ideas? With all the possibilities that resources such as jqWidgets, Google, PrimeUI, Plotly.js combined with FreeMASTER offer for creating engaging dashboards to control and/or demo your application, we'd love you to share your creations with the NXP Community. We are giving away* 50 NXP evaluation boards (20 each of the i.MX RT1020 and LPC55S28 EVKs, and 10 of the S32K144EVB) as a thank you to those of you who are willing to share your dashboards with our community.

阅读更多内容...

更多
2 13 12.1K
monicavelez
NXP Employee
NXP Employee

A FOUR-PART WEBINAR SERIES | 60 MINUTES EACH

FreeMASTER, from NXP, is a powerful real-time debugging and data visualization tool that can help you create engaging demo interfaces for your embedded application. Join NXP for this four-part on-demand training series as we’ll provide an overview of the software, it’s features, capabilities, available examples, application use cases and how to easily get started.

阅读更多内容...

更多
1 7 9,046
Ragan_Dunham
NXP Employee
NXP Employee

Machine Learning at the Edge:

eIQ Software for i.MX Applications Processors

Developing machine learning (ML) applications for embedded devices can be a daunting task. For the traditional embedded developer, the learning curve can be quite steep, as there are numerous decisions that must be made and new jargon that must be learned. Which framework should I choose? Which model best meets the requirements of my application and how do I know when it’s good enough? What “size” microcontroller or application processor do I need? The questions are many and figuring out how to get started can prove to be a challenge.

阅读更多内容...

更多
2 7 21.3K