Message-ID: <301904659.5213.1711640838487.JavaMail.root@dns3>
Subject: Exported From Confluence
MIME-Version: 1.0
Content-Type: multipart/related;
boundary="----=_Part_5212_1179747630.1711640838487"
------=_Part_5212_1179747630.1711640838487
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Content-Location: file:///C:/exported.html
Build and In=
stall Linux System for pITX-MX8M-PLUS (Dual and Quad Cor=
e)
This document provides instructions for advanced users how Embedian offe=
rs patches and builds a customized version of u-boot and linux kernel for E=
mbedian's pITX-MX8M-PLUS product platform and how to ins=
tall the images to bring the evaluation board up and running.
Our aim is to fully support our hardw=
are through device drivers. We also provide unit tests so that testing a bo=
ard is easy and custom development can start precisely. The recommended hos=
t environment is Ubuntu 16.04 or 18.04 LTS.
Availability
=
pITX-MX8M-PLUS from Embedian
Carrier Board
p=
ITX-IOB-2201 (Expansion IO board for pITX-MX8M-PLUS) at Embedian=
p>
Basic Resources
- AArch64 Cross Compiler
- Bootloader
- Linux Kernel
- ARM based rootfs
ARM Cross Compiler: GCC
To build Embedian=E2=80=99s pITX-=
MX8M-PLUS u-boot and li=
nux kernel, you will need to install the following ARM GNU aarch64 compiler=
first:
For u-boot 2020.04&nb=
sp;and Linux 5.10.9, you need to use the f=
ollowing ARM GNU aarch64 coss compilier.=
=20
=20
=20
$ wget -c https://developer.arm.co=
m/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_=
64-aarch64-linux-gnu.tar.xz&nbs=
p;
$ sudo tar -C /opt -xJf gcc-=
arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz
$ export CC=3D/opt/gcc-arm-8=
.3-2019.03-x86_64-aarch64-linux-gnu/bin/aarch64-linux-gnu-
=20
=20
=20
Test:
If this test fails, verify that you have the 32bit libraries ins=
talled on your development system.
=20
=20
=20
$ ${CC}gcc --version<=
/code>
aarch64-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 8.3-=
2019.03 (arm-rel-8.36)) 8.3.0
Copyright (C) 2018 Free Software Foundat=
ion, Inc.
This is free software; see the source for copying conditions=
. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A =
PARTICULAR PURPOSE.
=20
=20
=20
Generating SSH Keys
We recommend you use SSH keys to establish a secure connection between y=
our computer and Embedian Gitlab server. The steps below will walk you thro=
ugh generating an SSH key and then adding the public key to our Gitlab acco=
unt.
First, we need to check for existing ssh keys on your computer. Open up&=
nbsp;Git Bash and run:
=20
$ cd ~/.ssh
$ ls
# Lists the files in your .ssh directory
=20
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, y=
ou 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 set=
tings so when asked to enter a file in which to save the key, just press en=
ter.
=20
$ ssh-keygen -t rsa -C "your_email@example.com"
# Creates a new ssh key, using the provided email as a label
# Generating public/private rsa key pair.
# Enter file in which to save the key (/c/Users/you/.ssh/id_rsa): [Press en=
ter]
$ ssh-add id_rsa
=20
Now you need to enter a passphrase.
=20
Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]
=20
Which should give you something like this:
=20
Your identification has been saved in /c/Users/you/.ssh/id_rsa.
Your public key has been saved in /c/Users/you/.ssh/id_rsa.pub.
The key fingerprint is:
01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com
=20
Copy the key to your clipboard.
=20
$ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAABDAQABAAABAQDQUEnh8uGpfxaZVU6+uE4bsDrs/tEE5/BPW7j=
MAxak
6qgOh6nUrQGBWS+VxMM2un3KzwvLRJSj8G4TnTK2CSmlBvR+X8ZeXNTyAdaDxULs/StVhH+QRtF=
EGy4o
iMIzvIlTyORY89jzhIsgZzwr01nqoSeWWASd+59JWtFjVy0nwVNVtbek7NfuIGGAPaijO5Wnshr=
2uChB
Pk8ScGjQ3z4VqNXP6CWhCXTqIk7EQl7yX2GKd6FgEFrzae+5Jf63Xm8g6abbE3ytCrMT/jYy5OO=
j2XSg
6jlxSFnKcONAcfMTWkTXeG/OgeGeG5kZdtqryRtOlGmOeuQe1dd3I+Zz3JyT your_email@exa=
mple.c
om
=20
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 instruc=
t you how to generate flash.bin.
1. Download the imx-mkimage tool and apply Embedian's patc=
h to accept Embedian's device tree blob.
=20
=20
=20
$ git clone https=
://source.codeaurora.org/external/imx/imx-mkimage -b lf-5.10.y_1.0.0
$ cd imx-mkimage
$ wget -c ftp://ftp.embedian=
.com/public/pitximx8mp/0001-change-uboot-device-tree-name.patch
$ patch -p1 <0001-change-=
uboot-device-tree-name.patch
$ cd ../
=
=20
=20
=20
2. Get and Build the ARM Trusted firmware and copy bl31.bin to imx-=
mkimage/iMX8M directory.
=20
=20
=20
$ git clone https=
://source.codeaurora.org/external/imx/imx-atf=
span> -b lf_v2.4
$ cd imx-atf
=
p>
$ wget -c ftp://ftp.=
embedian.com/public/pitximx8mp/0001-imx-atf-change-console-t=
o-ttymxc3.patch
$ patch -p1 <0001-imx-atf-change-console-to-ttymxc3.patch
$ make CROSS_COMPILE=3D${CC} PLAT=3Dimx8mp bl31
$ cp build/imx8mp/release/bl=
31.bin ../imx-mkimage/iMX8M/
$ cd ../
=
=20
=20
=20
3. Get the DDR firmware and copy to imx-mkimage/iMX8M/ directory.=
p>=20
=20
=20
$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/fi=
rmware-imx-8.11.bin
 =
;$ chmod a+x firmware-imx-8.11.bin
$ ./firmware-imx-8.11.bin
enter "y" to accept EULA
$ cd firmware-imx-8.11.bin=
span>
$ cp firmware/ddr/synopsys/l=
pddr4_pmu_train_1d_dmem_202006.bin ../imx-mkimage/iMX8M/
$ cp firmware=
/ddr/synopsys/lpddr4_pmu_train_1d_imem_202006.bin ../imx-mkimage/iMX8M/
$ cp firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem_202006.bin ../imx-mki=
mage/iMX8M/
$ cp firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem_202006=
.bin ../imx-mkimage/iMX8M/
$ cp =
firmware/hdmi/cadence/signed_hdmi_imx8m.bin ../imx-mkimage/iMX8M/
$ cd ../
=
=20
=20
=20
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:
=20
=20
=20
$ git clone git@git.embedian=
.com:developer/smarc-t335x-uboot.git u-boot_v2020.04 -b pitx_8mp_lf_v2020.0=
4
$ cd u-boot_v2020.04<=
/code>
=20
=20
=20
Configure and Build:
=20
=20
=20
$ make ARCH=3Darm CROSS_COMP=
ILE=3D${CC} distclean
$ make ARCH=3Darm CROSS_COMP=
ILE=3D${CC} pitximx8mp_4g_defconfig
$ make ARCH=3Darm CROSS_COMP=
ILE=3D${CC}
=20
=20
=20
=
=20
=20
Note 1:
If the board is 2GB LPDDR4, use
$ make ARCH=3Darm CROSS_COMPILE=3D${CC} pitximx8mp_2g_defconfig
If the board is 4GB LPDDR4, use
$ make ARCH=3Darm CROSS_COMPILE=3D${CC} pitximx8mp_4g_defconfig
If the board is 6GB LPDDR4, use
$ make ARCH=3Darm CROSS_COMPILE=3D${CC} pitximx8mp_6g_defconfig
Note 2:
The pITX-MX8M-PLUS module always boot up from the on-=
module eMMC flash. The factory default will be =
flash.bin pre-installed. In some cases when the eMMC flash is empty or needs to be upgraded. Users can set SW2 port 1-3 a=
s (ON ON ON). In this way, the pITX-MX8M-PLUS module wil=
l boot up to carrier microSD card. The flash.bin image for eMMC an=
d microSD card is the same, the difference is how you flash flash.bin=
em> and how SW2 port 1-3 is set. This will be explained in the "Setup =
microSD card" section.
=20
=20
=20
Copy u-boot-nodtb.bin spl/u-boot-spl.bin arch/arm/dts/imx8mp-=
pitx.dtb
to imx-mkimage/iMX8M
d=
irectory and copy tools/mkimage
to imx-mkimage/iMX8M/mkimage_uboot
=20
=20
=20
$ cp u-boot-nodtb.bin spl/u-=
boot-spl.bin arch/arm/dts/imx8mp-pitx.dtb ../imx-mkimage/iMX8M/
$ cp tools/mkimage ../imx-mk=
image/iMX8M/mkimage_uboot
=20
=20
=20
5. Generate flash.bin file.
=20
=20
=20
$ cd ../imx-mkimage
$ make CROSS_COMPILE=3D${CC} SO=
C=3DiMX8MP clean
$ make CROSS_COMPILE=3D${CC}=
SOC=3DiMX8MP flash_evk
=20
=20
=20
The flash.bin file will be located at imx-mkimage/iMX8M directory. Go to "Setup microSD Card" section to instruct you h=
ow to flash this file into microSD card.
Linux Kernel
Download:
For 5.10.9 (Based on NX=
P lf-5.10.y official release):
=20
=20
=20
$ git clone git@git.embedian=
.com:developer/smarc-fsl-linux-kernel.git linux_v5.10.9 -b pitx_8mp_lf-5.10=
.y
$ cd linux_v5.10.9
=20
=20
=20
Configure and Build:
=20
=20
=20
$ make ARCH=3Darm64 CROSS_CO=
MPILE=3D${CC} distclean
$ make ARCH=3Darm64 CROSS_CO=
MPILE=3D${CC} pitxmx8mplus_defconfig
$ make ARCH=3Darm64 CROSS_CO=
MPILE=3D${CC} Image modules dtbs
=20
=20
=20
Selecting display configuration is a =
matter of selecting an appropriate DTB file under arch/ar=
m64/boot/dts/embedian
.
All available DTB files are listed in=
the table below.
DTB File Name |
Description |
=
imx8mp-pitx.dtb |
Device tree b=
lob for no display configuration. |
=
imx8mp-pitx-hdmi.dtb |
Device tree b=
lob for HDMI display configuration. |
=
imx8mp-pitx-lvds.dtb |
Device tree b=
lob for LVDS display configuration. |
=
imx8mp-pitx-m7.dtb |
Device tree b=
lob for Cortex-M7 co-processor configuration. |
Root File System
Debian 11 Bullseys:
Debian 11 Bullseye Download:
=20
=20
=20
$ wget -c ftp://ftp.embedian.com/public/dev/minfs/ubuntu/bionic/ubuntu=
-minimal-imx8m-18.04-arm64.tar.gz
=20
=20
=20
Verify:
=20
=20
=20
$ md5sum ubuntu-minimal-imx8m-18.04-arm64.tar.gz
50afb3331998473d505693eabd031b9e ubuntu-minimal-imx8m-18.04-arm6=
4.tar.gz
=20
=20
=20
<=
/u>Yocto Build Root File S=
ystem:=
Find the yocto pre-built root file systems here at Embedian's ftp site based on your module CPU va=
riants.
Setup microSD Card
For these instruction, we are assuming: DISK=3D/dev/mmcblk0, "lsblk=
" is very useful for determining the device id.
=20
=20
=20
$ export DISK=3D/dev/mmcblk0=
=20
=20
=20
Erase microSD card:
=20
=20
=20
$ sudo =
dd
if
=3D/dev/zero of=3D${DISK} bs=3D1M count=3D
160
=20
=20
=20
Create Partition Layout: Leave 2MB offset for flash.bin.
With util-linux v2.26, sfdisk was rewritten and is now based on =
libfdisk.
=20
=20
sfdisk
=20
=20
$ sudo sfd=
isk --version
sfdisk from util-linux 2.27.1
=20
=20
=20
Create Partitions:
=20
=20
sfdisk >=3D2.26.x
=20
Icon=20
=20
$ sudo sfd=
isk ${DISK} <<-__EOF__
2M
<=
code class=3D"java plain">,48M
,0x83
,*
50M,,,
__EOF__
=20
=20
=20
=20
sfdisk <=3D2.25
=20
Icon=20
=20
$ sudo sfd=
isk --in-order --Linux --unit M ${DISK} <<-__EOF__
2,
<=
code class=3D"java value">48,
0x83
,*
,,,-
__EOF__
=20
=20
=20
Format Partitions:
=20
=20
=20
for: DISK=3D/dev/mmcblk0
$ sudo mkf=
s.vfat -F
16
${DISK}p1 -n boot
$ sudo mkf=
s.ext4 ${DISK}p2 -L rootfs
for
: DISK=3D/dev/sdX
$ sudo mkf=
s.vfat -F
16
${DISK}
1
-n boot
$ sudo mkf=
s.ext4 ${DISK}
2
-L rootfs
=20
=20
=20
Mount Partitions:
On some systems, these partitions may be auto-mounted...
=20
=20
=20
$ sudo mkd=
ir -p /media/boot/
$ sudo mkd=
ir -p /media/rootfs/
for
: DISK=3D/dev/mmcblk0
$ sudo mou=
nt ${DISK}p1 /media/boot/
$ sudo mou=
nt ${DISK}p2 /media/rootfs/
for
: DISK=3D/dev/sdX
$ sudo mou=
nt ${DISK}
1
/media/boot/
$ sudo mou=
nt ${DISK}
2
/media/rootfs/
=20
=20
=20
Install Boot File
If on-module eMMC Flash is empty<=
/strong>
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. =
=20
=20
~/imx-mkimage
=20
=20
$ sudo=
dd if=3DiMX8M/flash.bin of=3D${DISK} bs=3D1024 seek=3D32
=20
=20
=20
If on-module eMMC Flash is not em=
pty
The flash.bin is pre-i=
nstalled in on-module eMMC flash at factory default. pITX-MX8M-PLUS is designed to always boot u=
p from on-module eMMC flash and to load Image, device tree blob and root fi=
le 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 ho=
w to do that.
Copy flash.bin to the second partition ho=
me directory of your microSD card and boot into microSD card. Go to home di=
rectory and you should see flash.bin file (The flash.bin file is located at=
imx-mkimage/iMX8M/ directory).
=20
=20
=20
$ sudo cp -v imx-mkimage/iMX8M/flash.bin /media/rootfs/home/root/
=20
=20
=20
Fuse flash.bin to the on-module eMMC flas=
h. (The eMMC flash is emulated as /dev/mmcblk2 in pITX-MX8M-PLUS)<=
/p>=20
=20
home directory
=20
=20
$ sudo dd if=3Dflash.bin of=3D/dev/mmcblk2 bs=3D1024 seek=3D32=
em>
=20
=20
=20
=20
Icon=20
=20
- If your u-boot hasn't been finalized=
and still under development, it is recommended to set SW2 port 1-3 as (ON =
ON ON) and boot directly from microSD card first. Once your u-boot is fully=
tested and finalized, you can fuse your flash.bin to eMMC flash.
- When SW2 port1-3 on pITX-MX8M-PL=
US is set as (OFF ON OFF), it will always boot up from on-module eMMC =
flash. U-boot will read the SW2 port 1-3 configuration and determine where =
it should load Image and device tree blob. When SW2 port 1-3 is set (ON ON =
ON), it will always boot up from microSD card.
=20
=20
=20
uEnv.txt based bootscript
Create "uEnv.txt" boot script: ($ vim uEnv.txt)
=20
=20
~/uEnv.txt
=20
=20
optargs=3D"video=3DHDMI-A-1:1920x1080-32@60 consoleblank=3D0"<=
br />#optargs=3D"video=3DHDMI-A-1:3840x2160-32@30 consoleblank=3D0&quo=
t;
#optargs=3D"video=3DHDMI-A-1:3840x2160-32@60 consoleblank=3D0&=
quot;
console=3Dttymxc3,115200 earlycon=3Dec_imx6q,0x30a60000,115200mmcdev=3D1
mmcpart=3D1
image=3DImage
loadaddr=3D0x404800=
00
fdt_addr=3D0x43000000
mmcroot=3D/dev/mmcblk1p2 rw
usbroot=
=3D/dev/sda2 rw
mmcrootfstype=3Dext4 rootwait fixrtc
netdev=3Deth=
0
ethact=3DFEC0
ipaddr=3D192.168.1.150
serverip=3D192.168.1.=
53
gatewayip=3D192.168.1.254
mmcargs=3Dsetenv bootargs console=3D=
${console} root=3D${mmcroot} rootfstype=3D${mmcrootfstype} ${optargs}
=
uenvcmd=3Drun loadimage; run loadfdt; run mmcboot
# USB Boot
#usb=
args=3Dsetenv bootargs console=3D${console} root=3D${usbroot} rootfstype=3D=
${mmcrootfstype} ${optargs}
#uenvcmd=3Drun loadusbimage; run loadusbfd=
t; run usbboot
=20
=20
=20
Copy uEnv.txt to the boot partition:
=20
=20
~/
=20
=20
$ sudo cp -v ~/uEnv.txt /med=
ia/boot/
=20
=20
=20
Install Kernel Image
Copy Image to the boot partition:
=20
=20
~/linux_v5.10.9
=20
=20
$ sudo cp -v arch/arm64/boot=
/Image /media/boot
=20
=20
=20
Install Kernel Device Tree Binary=20
=20
=20
$ sudo mkdir -p /media/boot/=
dtbs
$ sudo cp -v arch/arm64/boot=
/dts/embedian/<device tree name> /media/boot/dtbs/imx8mp-pitx.dtb
=20
=20
=20
All available DTB files are listed in=
the table below.
DTB File Name |
Description |
=
imx8mp-pitx.dtb |
Device tree b=
lob for no display configuration. |
=
imx8mp-pitx-hdmi.dtb |
Device tree b=
lob for HDMI display configuration. |
=
imx8mp-pitx-lvds.dtb |
Device tree b=
lob for LVDS display configuration. |
=
imx8mp-pitx-m7.dtb |
Device tree b=
lob for Cortex-M7 co-processor configuration. |
=20
=
=20
=20
The device tree name in your microSD card has be to imx8mp-pit=
x.dtb
=20
=20
=20
Install Root File System and K=
ernel Modules
Copy Root File System:
Yocto Pre-Built Rootfs:=
=20
=20
directory where your root file system is
=20
=20
$ sudo tar jxvf <filename=
.tar.gz> -C /media/rootfs
=20
=20
=20
<=
/u>Debian 11 Bullseys:
=20
=20
directory where your root file system is
=20
=20
$ sudo tar xvfz ubunt=
u-minimal-imx8m-18.04-arm64.tar.gz -C /media/rootfs
=20
=20
=20
Copy Kernel Modules:
=20
=20
~/linux_v5.4.24
=20
=20
$ sudo make ARCH=3Darm64 CRO=
SS_COMPILE=3D${CC} INSTALL_MOD_PATH=3D/media/rootfs modules_install<=
/code>
=20
=20
=20
=20
Note
=20
Icon=20
=20
- MAC address is factory pre-installed at on board I2C EEPROM at offset 6=
0 bytes). It starts with Embedian's vendor code 10:0D:32. u-boot w=
ill read it and pass this parameter to kernel.
- If your rootfs is yocto built, the kernel modules will be included in t=
he rootfs. No need to copy again.
=20
=20
=20
Networking:
Edit: /etc/network/interfaces
=20
=20
=20
$ sudo vim /media/rootfs/etc/network/interfaces
=20
=20
=20
Add:
=20
=20
/media/rootfs/etc/network/interfaces
=20
=20
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
=20
=20
=20
Remove microSD card:
=20
=20
=20
$ sync
$ sudo umo=
unt /media/boot
$ sudo umo=
unt /media/rootfs
=20
=20
=20
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 sof=
tware 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 /d=
ev/mmcblk1 and on-module eMMC is always emulated as /dev/mmcblk2. Setting u=
p eMMC now is nothing but changing the device descriptor.
This section gives a step-by-step procedure to setup eMMC flash. Users c=
an 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 NF=
S.
Prepare for eMMC binaries f=
rom microSD card (or NFS):
Insert SD card into your Linux PC. For these instructions, we are assumi=
ng: DISK=3D/dev/mmcblk0, "lsblk" is very useful for determining t=
he device id.
For these instruction, we are assuming: DISK=3D/dev/mmcblk0, "lsblk=
" is very useful for determining the device id.
=20
=20
=20
$ export DISK=3D/dev/mmcblk0=
=20
=20
=20
Mount Partitions:
On some systems, these partitions may be auto-mounted...
=20
=20
=20
$ sudo mkd=
ir -p /media/boot/
$ sudo mkd=
ir -p /media/rootfs/
for
: DISK=3D/dev/mmcblk0
$ sudo mou=
nt ${DISK}p1 /media/boot/
$ sudo mou=
nt ${DISK}p2 /media/rootfs/
for
: DISK=3D/dev/sdX
$ sudo mou=
nt ${DISK}
1
/media/boot/
$ sudo mou=
nt ${DISK}
2
/media/rootfs/
=20
=20
=20
Copy Image to roo=
tfs partition:
=20
=20
=20
$ sudo cp -v /media/boot/Ima=
ge /media/rootfs/home/root
=20
=20
=20
=20
Note
=20
Icon=20
=20
- If your rootfs is Debian Bullseye, copy to /media/rootfs/root/ instead of /media/rootfs/root=
=20
=20
=20
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)
=20
=20
=20
optargs=3D"video=3DHDMI-A-1:1920x1080-32@60 consoleblank=3D0"<=
br />#optargs=3D"video=3DHDMI-A-1:3840x2160-32@30 consoleblank=3D0&quo=
t;
#optargs=3D"video=3DHDMI-A-1:3840x2160-32@60 consoleblank=3D0&=
quot;
console=3Dttymxc3,115200 earlycon=3Dec_imx6q,0x30a60000,115200mmcdev=3D2
mmcpart=3D1=
image=3DImage
loadaddr=3D0x40480000
fdt_addr=3D0x43000000mmcroot=3D/dev/mmcblk2p2 rw=
usbroot=3D/dev/sda2 rw
mmcrootfstype=3Dext4 rootwait fixrtc
netdev=3Deth0
ethact=3DFEC0
ipaddr=3D192.168.1.150
serverip=
=3D192.168.1.53
gatewayip=3D192.168.1.254
mmcargs=3Dsetenv bootar=
gs console=3D${console} root=3D${mmcroot} rootfstype=3D${mmcrootfstype} ${o=
ptargs}
uenvcmd=3Drun loadimage; run loadfdt; run mmcboot
# USB B=
oot
#usbargs=3Dsetenv bootargs console=3D${console} root=3D${usbroot} =
rootfstype=3D${mmcrootfstype} ${optargs}
#uenvcmd=3Drun loadusbimage; =
run loadusbfdt; run usbboot
=20
=20
=20
Copy device tree blob t=
o rootfs partition:
=20
=20
=20
$ sudo cp -v /media/boot/dtb=
s/imx8mp-pitx.dtb /media/rootfs/home/root/imx8mp-pitx.dtb
=20
=20
=20
Copy real rootfs to roo=
tfs partition:
<=
strong>Yocto Built Root File Systems
=20
=20
=20
$ pushd /media/rootfs=
$ sudo tar cvfz ~/pitximx8mp=
-emmc-rootfs.tar.gz .
$ sudo mv ~/pitximx8mp-emmc-=
rootfs.tar.gz /media/rootfs/home/root
$ popd
=20
=20
=20
<=
strong>Debian 11 Bullseye Root File Systems
=20
=20
=20
$ sudo vim /media/rootfs/etc=
/udev/rules.d/70-persistent-net.rules
Delete all contents starting with =
"SUBSYSTEM=3D=3D"
$ pushd /media/rootfs=
$ sudo tar cvfz ~/pitximx8mp=
-emmc-rootfs.tar.gz .
$ sudo mv ~/pitximx8mp-emmc-=
rootfs.tar.gz /media/rootfs/root/
$ popd
=20
=20
=20
Remove microSD card:
=20
=20
=20
$ sync
$ sudo umo=
unt /media/boot
$ sudo umo=
unt /media/rootfs
=20
=20
=20
<=
span style=3D"color: rgb(0,51,102);">Copy Binaries to eMMC from microSD car=
d:
Insert this microSD card into your pITX-MX8M-PLUS device and bo=
ot 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.
=20
=20
=20
$ export DISK=3D/dev/mmcblk2
=20
=20
=20
Erase eMMC:
=20
=20
=20
$ sudo =
dd
if
=3D/dev/zero of=3D${DISK} bs=3D2M count=3D
16
=20
=20
=20
Create Partition Layout:
=20
=20
=20
$ =
code>sudo sfdisk ${DISK} <<-__EOF__
2M,48M,0x83,*
50M,,,
=20
=20
=20
Format Partitions:
=20
=20
=20
$ sudo mkfs.vfat -F
16
${DISK}p1 -n boot
$ sudo mkf=
s.ext4 ${DISK}p2 -L rootfs
=20
=20
=20
Mount Partitions:
=20
=20
=20
$ sudo mkd=
ir -p /media/boot/
$ sudo mkd=
ir -p /media/rootfs/
$ sudo mou=
nt ${DISK}p1 /media/boot/
$ sudo mou=
nt ${DISK}p2 /media/rootfs/
=20
=20
=20
Install binaries for partition 1
Copy uEnv.txt/Image/*.dtb to the boot pa=
rtition
=20
=20
=20
$ sudo cp =
-v Image uEnv.txt /media/boot/
=20
=20
=20
Install Kernel Device Tree Binary<=
/h3>=20
=20
=20
$ sudo mkdir -p /media/boot/=
dtbs
$ sudo cp -v imx8mp-pitx.dtb=
/media/boot/dtbs/
=20
=20
=20
Setup eMMC
=20
=20
=20
$ sudo tar -zxvf pitximx8mp-=
emmc-rootfs.tar.gz -C /media/rootfs
=20
=20
=20
Unmount eMMC:
=20
=20
=20
$ sync
$ sudo umo=
unt /media/boot
$ sudo umo=
unt /media/rootfs
=20
=20
=20
Switch your Boot Select to eMMC and you will be able to boot up from eMM=
C now.
version 1.0a, 08/18/2022
Last updated 2022-08-18
------=_Part_5212_1179747630.1711640838487--