Build and Install Linux System for pITX-MX8M-PLUS (Dual and Quad Core)
This document provides instructions for advanced users how Embedian offers patches and builds a customized version of u-boot and linux kernel for Embedian's pITX-MX8M-PLUS product platform and how to install the images to bring the evaluation board up and running.
Our aim is to fully support our hardware through device drivers. We also provide unit tests so that testing a board is easy and custom development can start precisely. The recommended host environment is Ubuntu 16.04 or 18.04 LTS.
Availability
pITX-MX8M-PLUS from Embedian
Carrier Board
pITX-IOB-2201 (Expansion IO board for pITX-MX8M-PLUS) at Embedian
Basic Resources
- AArch64 Cross Compiler
- Bootloader
- Das U-Boot – the Universal Boot Loader http://www.denx.de/wiki/U-Boot
- Source – http://git.denx.de/?p=u-boot.git;a=summary
- Linux Kernel
- Linus's Mainline tree: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=summary
- Freescale Linux source tree: git://git.freescale.com/imx/linux-imx.git
- Freescale BSP meta layer: git://git.freescale.com/imx/meta-fsl-bsp-release
- OpenEmbedded/Yocto BSP layer for Freescale's ARM platform git://git.yoctoproject.org/meta-fsl-arm
- Embedian pITX-MX8M-PLUS kernel source tree for linux pitx-8mp_lf-5.10.y: git@git.embedian.com:developer/pitx-fsl-linux-kernel.git
- ARM based rootfs
- Debian Squeeze: http://www.debian.org/
ARM Cross Compiler: GCC
To build Embedian’s pITX-MX8M-PLUS u-boot and linux kernel, you will need to install the following ARM GNU aarch64 compiler first:
For u-boot 2020.04 and Linux 5.10.9, you need to use the following ARM GNU aarch64 coss compilier.
Test:
If this test fails, verify that you have the 32bit libraries installed on your development system.
Generating SSH Keys
We recommend you use SSH keys to establish a secure connection between your computer and Embedian Gitlab server. The steps below will walk you through generating an SSH key and then adding the public key to our Gitlab account.
Step 1. Check for SSH keys
First, we need to check for existing ssh keys on your computer. Open up Git Bash and run:
Check the directory listing to see if you have a file named either id_rsa.pub
or id_dsa.pub
. If you don't have either of those files go to step 2. Otherwise, you already have an existing keypair, and you can skip to step 3.
Step 2. Generate a new SSH key
To generate a new SSH key, enter the code below. We want the default settings so when asked to enter a file in which to save the key, just press enter.
Now you need to enter a passphrase.
Which should give you something like this:
Step 3. Add your SSH key to Embedian Gitlab Server
Copy the key to your clipboard.
Go to Embedian Git Server. At Profile Setting --> SSH Keys --> Add SSH Key
Paste your public key and press "Add Key" and your are done.
Boot File: flash.bin
The boot file is called flash.bin. It is made up of some pieces of programs. This section instruct you how to generate flash.bin.
1. Download the imx-mkimage tool and apply Embedian's patch to accept Embedian's device tree blob.
2. Get and Build the ARM Trusted firmware and copy bl31.bin to imx-mkimage/iMX8M directory.
3. Get the DDR firmware and copy to imx-mkimage/iMX8M/ directory.
4. Clone the U-Boot source code from Embedian Git Server and copy related files to imx-mkimage/iMX8M/ directory.
Download:
For u-boot v2020.04:
Configure and Build:
Copy u-boot-nodtb.bin spl/u-boot-spl.bin arch/arm/dts/imx8mp-pitx.dtb
to imx-mkimage/iMX8M
directory and copy tools/mkimage
to imx-mkimage/iMX8M/mkimage_uboot
5. Generate flash.bin file.
The flash.bin file will be located at imx-mkimage/iMX8M directory. Go to "Setup microSD Card" section to instruct you how to flash this file into microSD card.
Linux Kernel
Download:
For 5.10.9 (Based on NXP lf-5.10.y official release):
Configure and Build:
Selecting display configuration is a matter of selecting an appropriate DTB file under arch/arm64/boot/dts/embedian
.
All available DTB files are listed in the table below.
DTB File Name | Description |
---|---|
imx8mp-pitx.dtb | Device tree blob for no display configuration. |
imx8mp-pitx-hdmi.dtb | Device tree blob for HDMI display configuration. |
imx8mp-pitx-lvds.dtb | Device tree blob for LVDS display configuration. |
imx8mp-pitx-m7.dtb | Device tree blob for Cortex-M7 co-processor configuration. |
Root File System
Debian 11 Bullseys:
User | Password |
---|---|
root | root |
Debian 11 Bullseye Download:
Verify:
Yocto Build Root File System:
User | Password |
---|---|
root | N/A |
Find the yocto pre-built root file systems here at Embedian's ftp site based on your module CPU variants.
Setup microSD Card
For these instruction, we are assuming: DISK=/dev/mmcblk0, "lsblk" is very useful for determining the device id.
Erase microSD card:
Create Partition Layout: Leave 2MB offset for flash.bin.
With util-linux v2.26, sfdisk was rewritten and is now based on libfdisk.
Create Partitions:
Format Partitions:
Mount Partitions:
On some systems, these partitions may be auto-mounted...
Install Boot File
If on-module eMMC Flash is empty
In some cases, when eMMC flash is erased or the u-boot is under development, we need a way to boot from microSD card first. Users need to ser SW2 port 1-3 and (ON ON ON). In this way, pITX-iMX8M-PLUS will always boot up from microSD card.
Fuse flash.bin to the microSD card.
If on-module eMMC Flash is not empty
The flash.bin is pre-installed in on-module eMMC flash at factory default. pITX-MX8M-PLUS is designed to always boot up from on-module eMMC flash and to load Image, device tree blob and root file systems based on the setting of SW2 port 1-3. If users need to fuse your own flash.bin or perform u-boot upgrade. This section will instruct you how to do that.
Copy flash.bin to the second partition home directory of your microSD card and boot into microSD card. Go to home directory and you should see flash.bin file (The flash.bin file is located at imx-mkimage/iMX8M/ directory).
Fuse flash.bin to the on-module eMMC flash. (The eMMC flash is emulated as /dev/mmcblk2 in pITX-MX8M-PLUS)
uEnv.txt based bootscript
Create "uEnv.txt" boot script: ($ vim uEnv.txt)
Copy uEnv.txt to the boot partition:
Install Kernel Image
Copy Image to the boot partition:
Install Kernel Device Tree Binary
All available DTB files are listed in the table below.
DTB File Name | Description |
---|---|
imx8mp-pitx.dtb | Device tree blob for no display configuration. |
imx8mp-pitx-hdmi.dtb | Device tree blob for HDMI display configuration. |
imx8mp-pitx-lvds.dtb | Device tree blob for LVDS display configuration. |
imx8mp-pitx-m7.dtb | Device tree blob for Cortex-M7 co-processor configuration. |
Install Root File System and Kernel Modules
Copy Root File System:
Yocto Pre-Built Rootfs:
Debian 11 Bullseys:
Copy Kernel Modules:
Networking:
Edit: /etc/network/interfaces
Add:
Remove microSD card:
Setup eMMC
Setting up eMMC usually is the last step at development stage after the development work is done at your microSD card or NFS environments. From software point of view, eMMC is nothing but a non-removable SD card on board. For pITX-MX8M-PLUS, the microSD card is always emulated as /dev/mmcblk1 and on-module eMMC is always emulated as /dev/mmcblk2. Setting up eMMC now is nothing but changing the device descriptor.
This section gives a step-by-step procedure to setup eMMC flash. Users can write a shell script your own at production to simplify the steps.
First, we need to backup the final firmware from your microSD card or NFS.
Prepare for eMMC binaries from microSD card (or NFS):
Insert SD card into your Linux PC. For these instructions, we are assuming: DISK=/dev/mmcblk0, "lsblk" is very useful for determining the device id.
For these instruction, we are assuming: DISK=/dev/mmcblk0, "lsblk" is very useful for determining the device id.
Mount Partitions:
On some systems, these partitions may be auto-mounted...
Copy Image to rootfs partition:
Copy uEnv.txt to rootfs partition:
Copy and paste the following contents to /media/rootfs/home/root ($ sudo vim /media/rootfs/home/root/uEnv.txt)
Copy device tree blob to rootfs partition:
Copy real rootfs to rootfs partition:
Yocto Built Root File Systems
Debian 11 Bullseye Root File Systems
Remove microSD card:
Copy Binaries to eMMC from microSD card:
Insert this microSD card into your pITX-MX8M-PLUS device and boot into microSD card.
Now it will be almost the same as you did when setup your microSD card, but the eMMC device descriptor is /dev/mmcblk2 now.
Erase eMMC:
Create Partition Layout:
Format Partitions:
Mount Partitions:
Install binaries for partition 1
Copy uEnv.txt/Image/*.dtb to the boot partition
Install Kernel Device Tree Binary
Setup eMMC
Unmount eMMC:
Switch your Boot Select to eMMC and you will be able to boot up from eMMC now.
version 1.0a, 08/18/2022
Last updated 2022-08-18