Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
iconfalse

$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-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

$ cp firmware/ddr/synopsys/lpddr4_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 .bin ../imx-mkimage/iMX8M/
$ cp firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem_202006.bin .bin ../imx-mkimage/iMX8M/

$ cp firmware/hdmi/cadence/signed_hdmi_imx8m.bin ../imx-mkimage/iMX8M/

$ cd ../

...

Info
iconfalse

$ make ARCH=arm CROSS_COMPILE=${CC} distclean

$ make ARCH=arm CROSS_COMPILE=${CC} smarcimx8mp_4g_ser3_defconfig

$ make ARCH=arm CROSS_COMPILE=${CC}

Note
iconfalse

Note1:

If the board is 2GB LPDDR4, use
$ make ARCH=arm CROSS_COMPILE=${CC} smarcimx8mp_2g_ser3_defconfig

If the board is 4GB LPDDR4, use
$ make ARCH=arm CROSS_COMPILE=${CC} smarcimx8mp_4g_ser3_defconfig

If the board is 6GB LPDDR4, use
$ make ARCH=arm CROSS_COMPILE=${CC} smarcimx8mp_6g_ser3_defconfig

Note 2:

"ser3" stands for console debug port in SMARC definition. 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 files, you also need to modify plat/imx/imx8m/imx8mp/platform.mk in the imx-atf. Find "IMX_BOOT_UART_BASE      ?=      0x30890000" and change to the correct address that defined in uEnv.txt file.

Note 4:

The SMARC-iMX8MP module always boot up from the on-module eMMC flash. The factory default will be flash.bin pre-installed with SER3 as console output. In some cases when the eMMC flash is empty or needs to be upgraded. Users can shunt crossed the TEST# to ground. In this way, the SMARC-iMX8MP module will boot up to carrier SD card, if TEST# pin is shunt crossed. The flash.bin image are the same, the difference is how you flash flash.bin. This will be explained in the "Setup SD card" section.

...

Info
iconfalse

$ make ARCH=arm64 CROSS_COMPILE=${CC} distclean

$ make ARCH=arm64 CROSS_COMPILE=${CC} smarcimx8mp_defconfig

$ make ARCH=arm64 CROSS_COMPILE=${CC} Image modules dtbs

 

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 NameDescription
imx8mp-smarc.dtbDevice tree blob for no display configuration.
imx8mp-smarc-hdmi.dtbDevice tree blob for HDMI display configuration.
imx8mp-smarc-lvds.dtbDevice tree blob for LVDS display configuration.
imx8mp-smarc-m7.dtbDevice tree blob for Cortex-M7 co-processor configuration.

Root File System

...

Ubuntu ARM64 18.04Debian 11 Bullseys:

UserPassword
rootN/A

...

root


Debian 11 Bullseye Download:

Info
iconfalse
$ wget -c ftp://ftp.embedian.com/public/dev/minfs/ubuntu/bionic/ubuntu-minimal-imx8m-18.04-arm64.tar.gz

...

Info
iconfalse
title~/uEnv.txt

optargs="video=HDMI-A-1:1920x1080-32@60 consoleblank=0"
#optargs="video=HDMI-A-1:3840x2160-32@30 consoleblank=0"
#optargs="video=HDMI-A-1:3840x2160-32@60 consoleblank=0"
#console port SER3
console=ttymxc1,115200 earlycon=ec_imx6q,0x30890000,115200
#console port SER2
#console=ttymxc2,115200 earlycon=ec_imx6q,0x30880000,115200
#console port SER1
#console=ttymxc3,115200 earlycon=ec_imx6q,0x30a60000,115200
#console port SER0
#console=ttymxc0,115200 earlycon=ec_imx6q,0x30860000,115200
mmcdev=1
mmcpart=1
image=Image
loadaddr=0x40480000
fdt_addr=0x43000000
mmcroot=/dev/mmcblk1p2 rw
usbroot=/dev/sda2 rw
mmcrootfstype=ext4 rootwait fixrtc
netdev=eth0
ethact=FEC0
ipaddr=192.168.1.150
serverip=192.168.1.53
gatewayip=192.168.1.254
mmcargs=setenv bootargs cma=1280M console=${console} root=${mmcroot} rootfstype=${mmcrootfstype} ${optargs}
uenvcmd=run loadimage; run loadfdt; run mmcboot
# USB Boot
#usbargs=setenv bootargs console=${console} root=${usbroot} rootfstype=${mmcrootfstype} ${optargs}
#uenvcmd=run loadusbimage; run loadusbfdt; run usbboot

...

Info
iconfalse
titledirectory where your root file system is

$ sudo tar jxvf <filename.tar.gz> -C /media/rootfs


Ubuntu 18.04Debian 11 Bullseys:

Info
iconfalse
titledirectory where your root file system is

$ sudo tar xvfz ubuntu-minimal-imx8m-18.04-arm64.tar.gz -C /media/rootfs

...

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 SMARC-iMX8MP, the SD 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.

...

Info
iconfalse
$ sudo mkdir -p /media/boot/
$ sudo mkdir -p /media/rootfs/
 
for: DISK=/dev/mmcblk0
$ sudo mount ${DISK}p1 /media/boot/
$ sudo mount ${DISK}p2 /media/rootfs/
 
for: DISK=/dev/sdX
$ sudo mount ${DISK}1 /media/boot/
$ sudo mount ${DISK}2 /media/rootfs/

 

Copy Image to Image to rootfs partition:

Info
iconfalse

$ sudo cp -v /media/boot/Image /media/rootfs/home/root

...

Copy and paste the following contents to to /media/rootfs/home/root ($ sudo vim /media/rootfs/home/root/uEnv.txt)

Info
iconfalse

optargs="video=HDMI-A-1:1920x1080-32@60 consoleblank=0"
#optargs="video=HDMI-A-1:3840x2160-32@30 consoleblank=0"
#optargs="video=HDMI-A-1:3840x2160-32@60 consoleblank=0"
#console port SER3
console=ttymxc1,115200 earlycon=ec_imx6q,0x30890000,115200
#console port SER2
#console=ttymxc2,115200 earlycon=ec_imx6q,0x30880000,115200
#console port SER1
#console=ttymxc3,115200 earlycon=ec_imx6q,0x30a60000,115200
#console port SER0
#console=ttymxc0,115200 earlycon=ec_imx6q,0x30860000,115200
mmcdev=2
mmcpart=1
image=Image
loadaddr=0x40480000
fdt_addr=0x43000000
mmcroot=/dev/mmcblk2p2 rw
usbroot=/dev/sda2 rw
mmcrootfstype=ext4 rootwait fixrtc
netdev=eth0
ethact=FEC0
ipaddr=192.168.1.150
serverip=192.168.1.53
gatewayip=192.168.1.254
mmcargs=setenv bootargs cma=1280M console=${console} root=${mmcroot} rootfstype=${mmcrootfstype} ${optargs}
uenvcmd=run loadimage; run loadfdt; run mmcboot
# USB Boot
#usbargs=setenv bootargs console=${console} root=${usbroot} rootfstype=${mmcrootfstype} ${optargs}
#uenvcmd=run loadusbimage; run loadusbfdt; run usbboot

 

Copy device tree blob to rootfs partition:

Info
iconfalse
$ sudo cp -v /media/boot/dtbs/<device tree name> /media/rootfs/home/root/imx8mp-smarc.dtb


Copy boot file to rootfs partition:

Info
iconfalse
title~/imx-mkimage

$ sudo cp -v iMX8M/flash.bin /media/rootfs/home/root/imx8mp-smarcflash.dtbbin


Copy real rootfs to rootfs partition:

...

Info
iconfalse

$ pushd /media/rootfs

$ sudo tar cvfz ~/smarcimx8mp-emmc-rootfs.tar.gz .

$ sudo mv ~/smarcimx8mp-emmc-rootfs.tar.gz /media/rootfs/home/root

$ popd

Ubuntu 18.04 Debian Bulleyes Root File Systems

Info
iconfalse

$ sudo vim /media/rootfs/etc/udev/rules.d/70-persistent-net.rules

Delete all contents starting with "SUBSYSTEM=="

$ pushd /media/rootfs

$ sudo tar cvfz ~/smarcimx8mp-emmc-rootfs.tar.gz .

$ sudo mv ~/smarcimx8mp-emmc-rootfs.tar.gz /media/rootfs/home/ubunturoot

$ popd


Remove Unmount SD card:.

Info
iconfalse
$ sync
$ sudo umount /media/boot
$ sudo umount /media/rootfs

It is safe to remove SD card now.

Copy Binaries to eMMC from SD card:

Insert this SD card into your SMARC-iMX8M device iMX8MP device and boot into SD card.

Now it will be almost the same as you did when setup your SD card, but the eMMC device descriptor is /dev/mmcblk2 now.

Info
iconfalse

$ export DISK=/dev/mmcblk2

Erase eMMCSD card:

Info
iconfalse

$ sudo dd if=/dev/zero of=${DISK} bs=2M 1M count=16160

Create Partition Layout:

Info
iconfalse

$ sudo sfdisk ${DISK} <<-__EOF__

 
2M,48M,0x83,*
 
50M,,,
__EOF__

Format Partitions:

Info
iconfalse
$ sudo mkfs.vfat -F 16 ${DISK}p1 -n boot
$ sudo mkfs.ext4 ${DISK}p2 -L rootfs

...

Install binaries for partition 1

Copy Copy uEnv.txt/Image/*.dtb to dtb to the boot partition

Info
iconfalse

$ sudo cp -v Image uEnv.txt /media/boot/

...

Info
iconfalse

$ sudo mkdir -p /media/boot/dtbs

$ sudo cp -v imx8mp-smarc.dtb /media/boot/dtbs/

...

Install Root File System

...

Info
iconfalse

$ sudo tar -zxvf smarcimx8mp-emmc-rootfs.tar.gz -C /media/rootfs

 

Unmount eMMC:

 

Info
iconfalse
$ sync
$ sudo umount /media/boot
$ sudo umount /media/rootfs

 

Flash boot file

 

Info
iconfalse

$ sudo dd if=flash.bin of=${DISK} bs=1024 seek=32

Switch your Boot Select to eMMC (OFF ON ON) and you will be able to boot up from eMMC now.


version 1.0a, 1008/25/2021

Last updated 20212022-1006-2513