Arm Community
Arm Community
  • Site
  • User
  • Site
  • Search
  • User
Open Source Software and Platforms
Open Source Software and Platforms
Wiki Guide to Run OpenEuler Embedded on TC2 Platform
  • Help
  • Jump...
  • Cancel
  • About this wiki
  • Supported platforms
  • Obtaining support
  • +Arm Reference Platforms deliverables
  • -A-class platforms
    • +Juno
    • +FVPs
    • -Total Compute Platforms
      • Guide to Set Up Debugging Environment for Total Compute Software Stack
      • Guide to Debug RSS Firmware Booting on Total Compute Platform
      • Guide to Debug SCP Firmware Booting on Total Compute Platform
      • Guide to Set Up TF-A Firmwares Debug Environment on Arm DS for Total Compute Platform
      • Guide to Debug Hafnium on Total Compute Platform
      • Guide to Disable AP Secure Images on Total Compute Platform
      • Guide to Run OpenEuler Embedded on TC2 Platform
      • Guide to add "Hello World" application into edk2 of TC2 LSC platform?
      • Guide to Set Up Linux Kernel Debug Environment on Arm DS for Total Compute Platform
      • Guide to Set Up U-boot Debug Environment on Arm DS for Total Compute Platform
    • +Morello Platform
    • +System Guidance for Infrastructure (SGI)
    • +System Guidance for Mobile (SGM)
    • Corstone-500
    • Cortex-A5 DesignStart
    • +Neoverse N1 SDP
    • Neoverse Reference Designs
    • +Legacy platforms
  • +M-class platforms
  • +R-class platforms
  • +FPGA prototyping boards
  • +Open source software

You are currently reviewing an older revision of this page.

  • History View current version

Guide to Run the OpenEuler Embedded on TC2 platform

OpenEuler is an open-source operating system. The current openEuler kernel is based on Linux.It fully unleashes the potential of computing chips. As an efficient, stable, and secure open-source OS built by global open-source contributors, openEuler applies to database, big data, cloud computing, and artificial intelligence (AI) scenarios. In addition, openEuler community is an open-source community for global OSs. Through community cooperation, openEuler builds an innovative platform, builds a unified and open OS that supports multiple processor architectures, and promotes the prosperity of the software and hardware application ecosystem.

In this article, we will take OpenEuler Enbedded as example,the openEuler Embedded is a Linux version for embedded scenarios based on the openEuler community version. The embedded system applications are restricted by multiple factors, such as resources, power consumption, and compatibility. Therefore, the server-oriented Linux versions and the associated build systems can hardly satisfy the requirements of embedded scenarios. Yocto is widely used to customize and build embedded Linux. openEuler Embedded is also built using Yocto.

Build OpenEuler Kernel

The OpenEuler Kernel can be downloaded from the link kernel, we take OLK-6.6 which is based on LTS v6.6 as example for this usage. Firstly, we create the workspace directory as below: 

mkdir workspace
cd workspace/
mkdir kernel rootfs tool

Download the Kernel and Toolchain

cd workspace/kernel
wget https://gitee.com/openeuler/kernel/repository/archive/OLK-6.6.zip
unzip OLK-6.6.zip

cd ../tool/
wget https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz
tar -xvf arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz

Build the Kernel Image

cd $workspace/kernel/kernel-OLK-6.6
export export CROSS_COMPILE=$workspace/tool/arm-gnu-toolchain-13.2.Rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-
export ARCH=arm64
make openeuler_defconfig
make -j $nproc

Create the OpenEuler root filessystem

The openEuler Embedded support multiple architecture such as ARM64、ARM32、x86-64、RISC-V etc. For the ARM64, it add the QEMU support, we can leverate the QEMU root filesystem, then create the partition image for the TC2 FVP platform.

Create the OpenEuler Embeded root filesystem

Let's take ubuntu 20.04 host enviroment as exmaple:

Step1: Install the related tools and package

# Install necessary packages
$ sudo apt-get install python3 python3-pip docker docker.io
$ pip install oebuild

# Configure the Docker environment
$ sudo usermod -a -G docker $(whoami)
$ sudo systemctl daemon-reload && sudo systemctl restart docker
$ sudo chmod o+rw /var/run/docker.sock

Step2: Initializing the oebuild build environment

# <work_dir> is the directory to be created
$ oebuild init <work_dir>

# Switch to the working directory
$ cd <work_dir>

# Pull the build container and yocto-meta-openeuler project code
$ oebuild update

Step3:  Start building

# All build tasks need to be performed within the oebuild working directory
$ cd <work_dir>

# Create the configuration file compile.yaml for the openeuler-image-qemu-arm64 image
$ oebuild generate -p qemu-aarch64 -d build_arm64

# Switch to the build workspace directory that contains compile.yaml, such as build/build_arm64/
$ cd build/build_arm64/

# Follow the instructions to enter the build_arm64 directory and start the build
$ oebuild bitbake openeuler-image

At the last, you can see the build out root filesystem for  as below:

 

Create the parition image for TC2 FVP platform

Step1: Extract the root filesystem and change the machine name as “TC2-FVP”:

Step2: Create the image as below:

Run the OpenEuler on TC2 FVP platform

Setup the TC2 software stak 

We can follow up the user guide to build out TC2 software Image, including RSS/SCP ,  AP firmware  and boot loader, we can only replace the Kernel "Image" and the root filesystem "".

Change for OpenEuler filesystem support

We can modify the script to run for the OpenEuler filesystem

diff --git a/tc2/run_model.sh b/tc2/run_model.sh
index 1fe76b0..cd7a6b6 100755
--- a/tc2/run_model.sh
+++ b/tc2/run_model.sh
@@ -147,7 +147,8 @@ echo "Launching model: "`basename $MODEL`
 $MODEL --version

 DEPLOY_DIR=$RUN_SCRIPTS_DIR/../../output/${DISTRO}/deploy/tc2/
-DEB_MMC_IMAGE_NAME=debian_fs.img
+DEB_MMC_IMAGE_NAME=openeuler_fs.img
+OPENEULER_MMC_IMAGE_NAME=openeuler_fs.img

 check_dir_exists_and_exit $DEPLOY_DIR "firmware and kernel images"

@@ -180,6 +181,15 @@ case $DISTRO in
        RSS_CM_PROV_BUNDLE="$DEPLOY_DIR/rss_encrypted_cm_provisioning_bundle_0.bin"
        RSS_DM_PROV_BUNDLE="$DEPLOY_DIR/rss_encrypted_dm_provisioning_bundle.bin"
         ;;
+     openeuler)
+        DISTRO_MODEL_PARAMS="--data board.dram=${DEPLOY_DIR}/Image@0x80000 \
+                    -C board.mmc.p_mmc_file=$DEPLOY_DIR/$OPENEULER_MMC_IMAGE_NAME"
+        BL1_IMAGE_FILE="$DEPLOY_DIR/bl1-tc.bin"
+        FIP_IMAGE_FILE="$DEPLOY_DIR/fip_gpt-tc.bin"
+        RSS_ROM_FILE="$DEPLOY_DIR/rss_rom.bin"
+       RSS_CM_PROV_BUNDLE="$DEPLOY_DIR/rss_encrypted_cm_provisioning_bundle_0.bin"
+       RSS_DM_PROV_BUNDLE="$DEPLOY_DIR/rss_encrypted_dm_provisioning_bundle.bin"
+        ;;

     *) echo "bad option for distro $3"; incorrect_script_use
         ;;

Run the system