Message-ID: <358111382.5251.1711703722143.JavaMail.root@dns3>
Subject: Exported From Confluence
MIME-Version: 1.0
Content-Type: multipart/related;
boundary="----=_Part_5250_2007210015.1711703722143"
------=_Part_5250_2007210015.1711703722143
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Content-Location: file:///C:/exported.html
Build=
and Install Linux System for SMARC-iMX8M (Dual, Quad Li=
te and Quad Core)
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 SMARC-iMX8M product platform and how to instal=
l 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 Ubuntu 16.04.
Availability
=
SMARC-iMX8M from Embedian
Carrier Board
=
EVK-STD-CARRIER-S20 (universal carrier board for all SMARC 2.0 mod=
ules) from Embedian
Basic Resources
- AArch64 Cross Compiler
- Bootloader
- Linux Kernel
- ARM based rootfs
ARM Cross Compiler: GCC
To build Embedian=E2=80=99s SMARC-iMX8M u-boot and =
linux kernel, you will need to install the following ARM GNU aarch64 compil=
er first:
For u-boot 2020.04&nb=
sp;and Linux 5.4.24, you need to use the f=
ollowing ARM GNU aarch64 coss compilier.=
=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 patch to acce=
pt Embedian's device tree blob.
=20
=20
=20
$ git clone https://source.codeaurora.org/external/imx/imx-mkim=
age -b imx_5.4.24_2.1.0
$ cd imx-mkimage
$ wget -c ftp://ftp.embedian=
.com/public/smarcimx8m/0005-change-uboot-device-tree-name.patch
$ patch -p1 <0005-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 imx_5.4.24_2.1.0
$ cd imx-atf
=
p>
$ make CROSS_COMPILE=3D${CC} PLAT=3Dimx8mq bl31
$ cp build/imx8mq/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/MA=
D/YOCTO/firmware-imx-8.8.bin
$ chmod a+x firmware-imx-8.8.bin
$ ./f=
irmware-imx-8.8
enter "y" to accept EULA
$ cd =
firmware-imx-8.8
$ cp =
firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem.bin ../imx-mkimage/iMX8M/
$ cp firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem.bin ../imx-mkimage/i=
MX8M/
$ cp firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem.bin ../imx-m=
kimage/iMX8M/
$ cp firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem.bin =
../imx-mkimage/iMX8M/
$ cp firmware/hdmi/cadence/s=
igned_hdmi_imx8m.bin ../imx-mkimage/iMX8M/
$ =
span>cp firmware/hdmi/cadence/signed_dp_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/iMX8=
M/ directory.
Download:
For u-boot v2020.04:
=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} smarcimx8mq_2g_ser3_defconfig
$ make ARCH=3Darm CROSS_COMP=
ILE=3D${CC}
=20
=20
=20
=
=20
=20
Note1:=
If the board is 2GB LPDDR4 in commercial or industrial temperature, use<=
br />$ make ARCH=3Darm CROSS_CO=
MPILE=3D${CC} smarcimx8mq_2g_ser3_defconfig
If the board is SMARC-iMX8M-Q-4G or SMARC-iMX8M-Q-4G-I (4GB LPDDR4), use=
$ make ARCH=3Darm CROSS_C=
OMPILE=3D${CC} smarcimx8mq_4g_ser3_defconfig
Note 2:
"ser3" stands for console debug port in SMARC definit=
ion. In this example, we uses SER3 as debug port. If user uses SER0 as your=
debug port, make change to "ser0" instead. Same as SER1=
and SER2.
Note 3:
To change the debug port, in addition to u-boot defconfig and uEnv.txt f=
iles, you also need to modify plat/imx/imx8m/imx8mq/include/platfo=
rm_def.h in the imx-atf. Find "#define IMX_BOOT_UART_BAS=
E U(0x30860000)" and change to the correct address that defined i=
n uEnv.txt file.
Note 4:
The SMARC-iMX8M module always boot up from the on-mod=
ule eMMC flash. The factory default will be fla=
sh.bin pre-installed with SER3 as console output. In some cases w=
hen the eMMC flash is empty or needs to be upgraded. Use=
rs can shunt crossed the TEST# to ground. In this way, t=
he SMARC-iMX8M module will boot up to carrier SD card, i=
f TEST# pin is shunt crossed. The flash.bin ima=
ge are the same, the difference is how you flash flash.bin. This w=
ill be explained in the "Setup SD card" section.
=20
=20
=20
Copy u-boot-nodtb.bin spl/u-boot-spl.bin arch/arm/dts/imx8mq-=
smarc.dtb
to imx-mkimage/iMX8M
directory 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/imx8=
mq-smarc.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}=
SOC=3DiMX8M flash_spl_uboot
=20
=20
=20
=
=20
=20
If you device has HDMI port use the following command instead.
$ make CROSS_COMPILE=3D${CC}=
SOC=3DiMX8M flash_hdmi_spl_uboot
<=
/p>
If you device has Display Port use the following command instead.
$ make CROSS_COMPILE=3D${CC}=
SOC=3DiMX8M flash_dp_spl_uboot
=20
=20
=20
The flash.bin file will be located at imx-mkimage/iMX8M directory. Go to=
"Setup SD Card" section to instruct you how to flash this file i=
nto SD card.
Linux Kernel
Download:
For 5.4.24 (Based on Fr=
eescale imx_5.4.24_2.1.0 official release):
=20
=20
=20
$ git clone git@git.embedi=
an.com:developer/smarc-fsl-linux-kernel.git linux_v5.4.24 -b smarc_8mq_=
imx_5.4.24_2.1.0
$ cd linux_v5.4.24
=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} smarcimx8mq_defconfig
$ make ARCH=3Darm64 CROSS_CO=
MPILE=3D${CC} Image modules dtbs
=20
=20
=20
=
=20
=20
DCSS vs LCDIF
i.MX8M comes with 2 display controlle=
rs: DCSS and LCDIF.
DCSS can be connected to either HDMI or MIPI-DSI (to LVDS bridge=
) and supports resolutions up to 4K.
LCDIF can be connected only to MIPI-DSI and supports resolutions=
up to 1080p.
=20
=20
=20
Selecting display configuration is a =
matter of selecting an appropriate DTB file under arch/arm64/boot/dts=
/embedian
.
All availa=
ble DTB files are listed in the table below.
DTB File Name |
Description |
=
imx8mq-smarc.dtb |
Device tree b=
lob for no display configuration. |
=
imx8mq-smarc-hdmi.dtb |
Device tree b=
lob for HDMI display configuration (DCSS). |
=
imx8mq-smarc-dp.dtb |
Device tree b=
lob for Display Port (DP) display configuration (DCSS). |
=
imx8mq-smarc-lcdif-lvds.dtb |
Device tree b=
lob for LCDIF LVDS display configuration. |
=
imx8mq-smarc-dcss-lvds.dtb |
Device tree b=
lob for DCSS LVDS display configuration. |
=
imx8mq-smarc-dual-display.dtb |
Device tree b=
lob for dual LVDS+HDMI display configuration. |
Root File System
Ubuntu ARM64 18.04:
Ubuntu 18.04 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 SD 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 SD card:
=20
=20
=20
$ sudo =
dd
if
=3D/dev/zero of=3D${DISK} bs=3D1M count=3D
16
=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 SD card firs=
t. Users need to shunt cross the TEST# pin to ground. In this way,&nb=
sp;SMARC-iMX8M will always boot up from SD card.
Fuse flash.bin to the SD card.
=
=20
=20
~/imx-mkimage
=20
=20
$ sudo=
dd if=3DiMX8M/flash.bin of=3D${DISK} bs=3D1024 seek=3D33
=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. SMARC-iMX8M is designe=
d to always boot up from on-module eMMC flash and to load Image, device tre=
e blob and root file systems based on the setting of BOOT_SEL=
. 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 ho=
me directory of your SD card and boot into SD card. Go to home directory an=
d you should see flash.bin file (The flash.bin file is located at imx-mkima=
ge/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/mmcblk0 in SMARC-iMX8M)
=20
=20
home directory
=20
=20
$ sudo dd if=3Dflash.bin of=3D/dev/mmcblk0 bs=3D1024 seek=3D33=
em>
=20
=20
=20
=20
Icon=20
=20
- If your u-boot hasn't been finalized=
and still under development, it is recommended to shunt cross the test pin=
and boot directly from SD card first. Once your u-boot is fully tested and=
finalized, you can fuse your flash.bin to eMMC flash.<=
/li>
- When TEST# pin of SMARC-iMX=
8M is not shunt crossed, it will always boot up from on-module eMMC flash. =
U-boot will read the BOOT_SEL configuration and determine where it=
should load Image and device tree blob. When TEST# is shunt crossed (pull =
low), it will always boot up from SD 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 port SER3
console=3Dttymxc0,115200 earlycon=3Dec_i=
mx6q,0x30860000,115200
#console port SER2
#console=3Dttymxc1,1152=
00 earlycon=3Dec_imx6q,0x30890000,115200
#console port SER1
#cons=
ole=3Dttymxc2,115200 earlycon=3Dec_imx6q,0x30880000,115200
#console po=
rt SER0
#console=3Dttymxc3,115200 earlycon=3Dec_imx6q,0x30A60000,11520=
0
mmcdev=3D1
mmcpart=3D1
image=3DImage
loadaddr=3D0x404=
80000
fdt_addr=3D0x43000000
mmcroot=3D/dev/mmcblk1p2 rw
usbr=
oot=3D/dev/sda2 rw
mmcrootfstype=3Dext4 rootwait fixrtc
netdev=3D=
eth0
ethact=3DFEC0
ipaddr=3D192.168.1.150
serverip=3D192.168=
.1.53
gatewayip=3D192.168.1.254
mmcargs=3Dsetenv bootargs cma=3D1=
280M console=3D${console} root=3D${mmcroot} rootfstype=3D${mmcrootfstype} $=
{optargs}
uenvcmd=3Drun loadimage; run loadfdt; run mmcboot
# USB=
Boot
#usbargs=3Dsetenv bootargs console=3D${console} root=3D${usbroot=
} rootfstype=3D${mmcrootfstype} ${optargs}
#uenvcmd=3Drun loadusbimage=
; run loadusbfdt; 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.4.24
=20
=20
$ sudo cp -v arch/arm64/boot=
/Image /media/boot
=20
=20
=20
Install Kernel Device Tree Binary=
h3>=20
=20
=20
$ sudo mkdir -p /media/boot/=
dtbs
$ sudo cp -v arch/arm64/boot=
/dts/embedian/<device tree name> /media/boot/dtbs/imx8mq-smarc.dtb
=20
=20
=20
=
=20
=20
The device tree name in your SD card has be to imx8mq-smarc.dt=
b
=20
=20
=20
Install Root File System and =
Kernel 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>Ubuntu 18.04:<=
/span>
<=
/span>
=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 SD 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 SD card or NFS environments. From software=
point of view, eMMC is nothing but a non-removable SD card on board. For&n=
bsp;SMARC-iMX8MQ, the SD card is always emulated as /dev/mmcblk1 a=
nd on-module eMMC is always emulated as /dev/mmcblk0. Setting up eMMC now i=
s 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 SD card or NFS.
Prepare for eMMC binaries from =
SD 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 Ubuntu 16.04, copy to /media/rootfs/home/ubuntu instead of /media/rootfs/h=
ome/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 port SER3
console=3Dttymxc0,115200 earlycon=3Dec_i=
mx6q,0x30860000,115200
#console port SER2
#console=3Dttymxc1,1152=
00 earlycon=3Dec_imx6q,0x30890000,115200
#console port SER1
#cons=
ole=3Dttymxc2,115200 earlycon=3Dec_imx6q,0x30880000,115200
#console po=
rt SER0
#console=3Dttymxc3,115200 earlycon=3Dec_imx6q,0x30A60000,11520=
0
mmcdev=3D0
mmcpart=
=3D1
image=3DImage
loadaddr=3D0x40480000
fdt_addr=3D0x430000=
00
mmcroot=3D/dev/mmcblk0p2 rw
usbroot=3D/dev/sda2 rw
mmcrootfstype=3Dext4 rootwait fixrtc<=
br />netdev=3Deth0
ethact=3DFEC0
ipaddr=3D192.168.1.150
serv=
erip=3D192.168.1.53
gatewayip=3D192.168.1.254
mmcargs=3Dsetenv bo=
otargs cma=3D1280M console=3D${console} root=3D${mmcroot} rootfstype=3D${mm=
crootfstype} ${optargs}
uenvcmd=3Drun loadimage; run loadfdt; run mmcb=
oot
# USB Boot
#usbargs=3Dsetenv bootargs console=3D${console} ro=
ot=3D${usbroot} rootfstype=3D${mmcrootfstype} ${optargs}
#uenvcmd=3Dru=
n 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/imx8mq-smarc.dtb /media/rootfs/home/root/imx8mq-smarc.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 ~/smarcimx8m=
q-emmc-rootfs.tar.gz .
$ sudo mv ~/smarcimx8mq-emmc=
-rootfs.tar.gz /media/rootfs/home/root
$ popd
=20
=20
=20
<=
strong>Ubuntu 18.04 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 ~/smarcimx8m=
q-emmc-rootfs.tar.gz .
$ sudo mv ~/smarcimx8mq-emmc=
-rootfs.tar.gz /media/rootfs/home/ubuntu
$ popd
=20
=20
=20
Remove SD card:
=20
=20
=20
$ sync
$ sudo umo=
unt /media/boot
$ sudo umo=
unt /media/rootfs
=20
=20
=20
Copy Binaries to eMMC from SD card:=
Insert this SD card into your SMARC-iMX8M device and boot into SD card.<=
/p>
Now it will be almost the same as you did when setup your SD card, but t=
he eMMC device descriptor is /dev/mmcblk0 now.
=20
=20
=20
$ export DISK=3D/dev/mmcblk0
=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=
=20
=20
=20
$ sudo mkdir -p /media/boot/=
dtbs
$ sudo cp -v imx8mq-smarc.dt=
b /media/boot/dtbs/
=20
=20
=20
Setup eMMC
=20
=20
=20
$ sudo tar -zxvf smarcimx8mq=
-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, 9/13/2020
Last updated 2020-9-13
------=_Part_5250_2007210015.1711703722143--